Skip to content

Commit b66f432

Browse files
committed
Update React dependencies
1 parent 3ade3b9 commit b66f432

File tree

9 files changed

+1744
-3272
lines changed

9 files changed

+1744
-3272
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
"lint": "eslint src/**/*{.ts,.tsx}"
2828
},
2929
"devDependencies": {
30-
"@stencil/core": "^1.17.2",
30+
"@stencil/core": "^1.17.3",
3131
"@stencil/eslint-plugin": "^0.3.1",
32+
"@stencil/react-output-target": "^0.0.8",
3233
"@typescript-eslint/eslint-plugin": "^3.7.1",
3334
"@typescript-eslint/parser": "^3.7.1",
3435
"eslint": "^7.6.0",
3536
"eslint-plugin-react": "^7.20.5",
36-
"gh-pages": "^3.1.0",
37-
"@stencil/react-output-target": "^0.0.7"
37+
"gh-pages": "^3.1.0"
3838
},
3939
"license": "MIT",
4040
"repository": {

react/package-lock.json

Lines changed: 1707 additions & 3079 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

react/package.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@proyecto26/animatable-component-react",
33
"sideEffects": false,
4-
"version": "1.0.3",
4+
"version": "1.0.4",
55
"description": "React specific wrapper for animatable-component",
66
"repository": {
77
"type": "git",
@@ -12,7 +12,7 @@
1212
"clean": "rm -rf dist",
1313
"compile": "npm run tsc",
1414
"tsc": "tsc -p .",
15-
"lint": "tsc --noEmit && eslint 'src/**/*.{js,ts,tsx}' --quiet --fix --ignore-pattern 'src/react-component-lib/*'"
15+
"lint": "tsc --noEmit && eslint 'src/**/*.{js,ts,tsx}' --quiet --fix --ignore-pattern 'src/react-component-lib/*' --resolve-plugins-relative-to ."
1616
},
1717
"main": "./dist/index.js",
1818
"module": "./dist/index.js",
@@ -21,21 +21,20 @@
2121
"dist/"
2222
],
2323
"devDependencies": {
24-
"@types/jest": "23.3.9",
25-
"@types/node": "13.13.0",
26-
"@types/react": "16.7.6",
27-
"@types/react-dom": "16.0.9",
28-
"@typescript-eslint/eslint-plugin": "^2.28.0",
29-
"@typescript-eslint/parser": "^2.28.0",
30-
"eslint": "^6.8.0",
31-
"eslint-plugin-react": "^7.19.0",
32-
"jest": "^25.4.0",
33-
"jest-dom": "^3.0.2",
34-
"react": "^16.7.0",
35-
"react-dom": "^16.7.0",
36-
"rollup": "^1.21.2",
37-
"rollup-plugin-node-resolve": "^5.2.0",
38-
"typescript": "^3.3.4000"
24+
"@stencil/core": "^1.17.3",
25+
"@types/jest": "^26.0.0",
26+
"@types/node": "^14.0.0",
27+
"@types/react": "^16.9.0",
28+
"@types/react-dom": "^16.9.0",
29+
"@typescript-eslint/eslint-plugin": "^3.7.0",
30+
"@typescript-eslint/parser": "^3.7.0",
31+
"eslint": "^7.0.0",
32+
"eslint-plugin-react": "^7.0.0",
33+
"jest": "^26.0.0",
34+
"jest-dom": "^4.0.0",
35+
"react": "^16.0.0",
36+
"react-dom": "^16.0.0",
37+
"typescript": "^3.0.0"
3938
},
4039
"dependencies": {
4140
"@proyecto26/animatable-component": "^1.1.8"

react/src/hocs/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type AnimatableComponentType = ComponentType<AnimatableProps>;
1010
*/
1111
export function createAnimatableComponent<T> (
1212
WrappedComponent: ComponentType<T>
13-
) {
13+
): ComponentType<T & AnimatableProps> {
1414
return function WrappedWithAnimatable (props: T & AnimatableProps) {
1515
const {
1616
ref,
@@ -74,4 +74,4 @@ export function createAnimatableComponent<T> (
7474
</AnimatableComponent>
7575
);
7676
};
77-
};
77+
}

react/src/react-component-lib/createComponent.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import { HTMLStencilElement } from '@stencil/core/internal/stencil-public-runtime';
1111

1212
interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
13-
forwardedRef?: React.RefObject<ElementType>;
13+
forwardedRef: React.RefObject<ElementType>;
1414
ref?: React.Ref<any>;
1515
}
1616

@@ -22,15 +22,15 @@ export const createReactComponent = <
2222
>(
2323
tagName: string,
2424
ReactComponentContext?: React.Context<ContextStateType>,
25-
manipulatePropsFunction: (
25+
manipulatePropsFunction?: (
2626
originalProps: StencilReactInternalProps<ElementType>,
2727
propsToPass: any,
28-
) => ExpandedPropsTypes = undefined,
28+
) => ExpandedPropsTypes,
2929
) => {
3030
const displayName = dashToPascalCase(tagName);
3131

3232
const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {
33-
componentEl: ElementType;
33+
componentEl!: ElementType;
3434

3535
setComponentElRef = (element: ElementType) => {
3636
this.componentEl = element;
@@ -54,7 +54,7 @@ export const createReactComponent = <
5454
let propsToPass = Object.keys(cProps).reduce((acc, name) => {
5555
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
5656
const eventName = name.substring(2).toLowerCase();
57-
if (isCoveredByReact(eventName)) {
57+
if (typeof document !== "undefined" && isCoveredByReact(eventName)) {
5858
(acc as any)[name] = (cProps as any)[name];
5959
}
6060
}
@@ -65,7 +65,7 @@ export const createReactComponent = <
6565
propsToPass = manipulatePropsFunction(this.props, propsToPass);
6666
}
6767

68-
let newProps: StencilReactInternalProps<ElementType> = {
68+
const newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {
6969
...propsToPass,
7070
ref: mergeRefs(forwardedRef, this.setComponentElRef),
7171
style,

react/src/react-component-lib/createControllerComponent.tsx

Lines changed: 0 additions & 71 deletions
This file was deleted.

react/src/react-component-lib/interfaces.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { EventEmitter } from '@stencil/core';
1+
// General types important to applications using stencil built components
2+
export interface EventEmitter<T = any> {
3+
emit: (data?: T) => CustomEvent<T>;
4+
}
25

36
export interface StyleReactProps {
47
class?: string;

react/src/react-component-lib/utils/attachEventProps.ts

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)