Skip to content

Commit d894879

Browse files
authored
Merge pull request #17 from proyecto26/develop
Release 1.1.9
2 parents b66f432 + d93432f commit d894879

File tree

11 files changed

+562
-229
lines changed

11 files changed

+562
-229
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [1.1.9] - 2020-11-02
10+
### Fixed
11+
- Use `disconnectedCallback()` instead of `componentDidUnload()`.
12+
- Update to `Stencil` v2.0.
13+
- Fix accessibility issues from GitHub page.
14+
915
## [1.1.8] - 2020-05-07
1016
### Fixed
1117
- Validate if the manager is initialized before to destroy the animation.
@@ -65,7 +71,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6571
- Added GitHub page with Google Analytics to track some events.
6672
- Added README with instructions to integrate the Web component with any other framework (Angular, React, Vue, etc).
6773

68-
[Unreleased]: https://github.com/proyecto26/animatable-component/compare/v1.1.7...HEAD
74+
[Unreleased]: https://github.com/proyecto26/animatable-component/compare/v1.1.9...HEAD
75+
[1.1.9]: https://github.com/proyecto26/animatable-component/compare/v1.1.8...v1.1.9
76+
[1.1.8]: https://github.com/proyecto26/animatable-component/compare/v1.1.7...v1.1.8
6977
[1.1.7]: https://github.com/proyecto26/animatable-component/compare/v1.1.6...v1.1.7
7078
[1.1.6]: https://github.com/proyecto26/animatable-component/compare/v1.1.5...v1.1.6
7179
[1.1.5]: https://github.com/proyecto26/animatable-component/compare/v1.1.4...v1.1.5

package-lock.json

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

package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "@proyecto26/animatable-component",
3-
"version": "1.1.8",
3+
"version": "1.1.9",
44
"private": false,
55
"description": "Animate once, use Everywhere! 💫",
66
"author": "Proyecto 26",
77
"homepage": "https://proyecto26.github.io/animatable-component",
8-
"main": "dist/index.js",
9-
"module": "dist/index.mjs",
10-
"es2015": "dist/esm/index.mjs",
11-
"es2017": "dist/esm/index.mjs",
8+
"main": "dist/index.cjs.js",
9+
"module": "dist/index.js",
10+
"es2015": "dist/esm/index.js",
11+
"es2017": "dist/esm/index.js",
12+
"jsnext:main": "dist/esm/index.js",
1213
"types": "dist/types/index.d.ts",
1314
"collection": "dist/collection/collection-manifest.json",
1415
"collection:main": "dist/collection/index.js",
@@ -27,13 +28,14 @@
2728
"lint": "eslint src/**/*{.ts,.tsx}"
2829
},
2930
"devDependencies": {
30-
"@stencil/core": "^1.17.3",
31+
"typescript": "^4.0.5",
32+
"@stencil/core": "^2.2.0",
3133
"@stencil/eslint-plugin": "^0.3.1",
32-
"@stencil/react-output-target": "^0.0.8",
33-
"@typescript-eslint/eslint-plugin": "^3.7.1",
34-
"@typescript-eslint/parser": "^3.7.1",
35-
"eslint": "^7.6.0",
36-
"eslint-plugin-react": "^7.20.5",
34+
"@stencil/react-output-target": "^0.0.9",
35+
"@typescript-eslint/eslint-plugin": "^4.6.0",
36+
"@typescript-eslint/parser": "^4.6.0",
37+
"eslint": "^7.12.1",
38+
"eslint-plugin-react": "^7.21.5",
3739
"gh-pages": "^3.1.0"
3840
},
3941
"license": "MIT",

react/src/components.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* auto-generated react proxies */
44
import { createReactComponent } from './react-component-lib';
55

6-
import { JSX } from '@proyecto26/animatable-component';
6+
import type { JSX } from '@proyecto26/animatable-component';
77

88
import { applyPolyfills, defineCustomElements } from '@proyecto26/animatable-component/loader';
99

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import {
77
isCoveredByReact,
88
mergeRefs,
99
} from './utils';
10-
import { HTMLStencilElement } from '@stencil/core/internal/stencil-public-runtime';
10+
11+
export interface HTMLStencilElement extends HTMLElement {
12+
componentOnReady(): Promise<this>;
13+
}
1114

1215
interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
1316
forwardedRef: React.RefObject<ElementType>;
@@ -54,9 +57,11 @@ export const createReactComponent = <
5457
let propsToPass = Object.keys(cProps).reduce((acc, name) => {
5558
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
5659
const eventName = name.substring(2).toLowerCase();
57-
if (typeof document !== "undefined" && isCoveredByReact(eventName)) {
60+
if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {
5861
(acc as any)[name] = (cProps as any)[name];
5962
}
63+
} else {
64+
(acc as any)[name] = (cProps as any)[name];
6065
}
6166
return acc;
6267
}, {});
@@ -65,7 +70,7 @@ export const createReactComponent = <
6570
propsToPass = manipulatePropsFunction(this.props, propsToPass);
6671
}
6772

68-
const newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {
73+
let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {
6974
...propsToPass,
7075
ref: mergeRefs(forwardedRef, this.setComponentElRef),
7176
style,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}
2424
const eventName = name.substring(2);
2525
const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
2626

27-
if (!isCoveredByReact(eventNameLc)) {
27+
if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {
2828
syncEvent(node, eventNameLc, newProps[name]);
2929
}
3030
} else {
@@ -68,7 +68,7 @@ export const getClassName = (classList: DOMTokenList, newProps: any, oldProps: a
6868
* Checks if an event is supported in the current execution environment.
6969
* @license Modernizr 3.0.0pre (Custom Build) | MIT
7070
*/
71-
export const isCoveredByReact = (eventNameSuffix: string, doc: Document = document) => {
71+
export const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {
7272
const eventName = 'on' + eventNameSuffix;
7373
let isSupported = eventName in doc;
7474

react/src/react-component-lib/utils/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import { StyleReactProps } from '../interfaces';
3+
import type { StyleReactProps } from '../interfaces';
44

55
type Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?
66

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const easingOutCubic = EASING_FUNCTIONS[EASING.EASE_OUT_CUBIC];
109109

110110
### Script tag
111111

112-
- Put a script tag similar to this `<script src='https://unpkg.com/animatable-component@1.1.8/dist/animatable-component.js'></script>` in the head of your index.html
112+
- Put a script tag similar to this `<script src='https://unpkg.com/animatable-component@1.1.9/dist/animatable-component.js'></script>` in the head of your index.html
113113
- Then you can use the element anywhere in your template, JSX, html etc
114114

115115
### Node Modules

src/components/animatable-component/animatable-component.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export class AnimatableComponent implements IAnimatableComponent {
323323
/**
324324
* Initialize manager
325325
*/
326-
componentWillLoad() {
326+
connectedCallback() {
327327
this.manager = new AnimationManager(this);
328328
this.manager.setState(this.element, this);
329329
}
@@ -332,15 +332,15 @@ export class AnimatableComponent implements IAnimatableComponent {
332332
this.manager.savedState();
333333
}
334334

335-
componentWillUpdate() {
335+
componentShouldUpdate() {
336336
this.manager.setState(this.element, this);
337337
}
338338

339339
componentDidUpdate() {
340340
this.manager.savedState();
341341
}
342342

343-
componentDidUnload() {
343+
disconnectedCallback() {
344344
this.destroy();
345345
}
346346

src/components/animatable-cube/animatable-cube.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export class Cube implements IAnimatableComponent {
333333
/**
334334
* Initialize manager
335335
*/
336-
componentWillLoad() {
336+
connectedCallback() {
337337
this.manager = new AnimationManager(this);
338338
}
339339

@@ -342,15 +342,15 @@ export class Cube implements IAnimatableComponent {
342342
this.manager.savedState();
343343
}
344344

345-
componentWillUpdate() {
345+
componentShouldUpdate() {
346346
this.manager.setState(this.element, this);
347347
}
348348

349349
componentDidUpdate() {
350350
this.manager.savedState();
351351
}
352352

353-
componentDidUnload() {
353+
disconnectedCallback() {
354354
this.destroy();
355355
}
356356

0 commit comments

Comments
 (0)