@visactor/vrender-animate 1.0.33-alpha.0 → 1.0.33-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,4 +58,5 @@ class CommonOut extends custom_animate_1.ACustomAnimate {
58
58
  }
59
59
  }
60
60
 
61
- exports.CommonOut = CommonOut;
61
+ exports.CommonOut = CommonOut;
62
+ //# sourceMappingURL=common.js.map
@@ -234,4 +234,4 @@ class Dissolve extends CustomEffectBase_1.HybridEffectBase {
234
234
  }
235
235
 
236
236
  exports.Dissolve = Dissolve;
237
- //# sourceMappingURL=dissolve.js.map
237
+ //# sourceMappingURL=dissolve.js.map
@@ -117,4 +117,4 @@ class Distortion extends CustomEffectBase_1.HybridEffectBase {
117
117
  }
118
118
 
119
119
  exports.Distortion = Distortion;
120
- //# sourceMappingURL=distortion.js.map
120
+ //# sourceMappingURL=distortion.js.map
@@ -22,5 +22,4 @@ class GroupFadeOut extends common_1.CommonOut {
22
22
  }
23
23
  }
24
24
 
25
- exports.GroupFadeOut = GroupFadeOut;
26
- //# sourceMappingURL=groupFade.js.map
25
+ exports.GroupFadeOut = GroupFadeOut;
@@ -98,4 +98,5 @@ class IncreaseCount extends custom_animate_1.ACustomAnimate {
98
98
  }
99
99
  }
100
100
 
101
- exports.IncreaseCount = IncreaseCount;
101
+ exports.IncreaseCount = IncreaseCount;
102
+ //# sourceMappingURL=number.js.map
@@ -77,4 +77,4 @@ class InputRichText extends custom_animate_1.ACustomAnimate {
77
77
  }
78
78
 
79
79
  exports.InputRichText = InputRichText;
80
- //# sourceMappingURL=input-richtext.js.map
80
+ //# sourceMappingURL=input-richtext.js.map
@@ -91,4 +91,4 @@ class OutputRichText extends custom_animate_1.ACustomAnimate {
91
91
  }
92
92
 
93
93
  exports.OutputRichText = OutputRichText;
94
- //# sourceMappingURL=output-richtext.js.map
94
+ //# sourceMappingURL=output-richtext.js.map
@@ -118,5 +118,4 @@ class ScaleOut extends custom_animate_1.ACustomAnimate {
118
118
  }
119
119
  }
120
120
 
121
- exports.ScaleOut = ScaleOut;
122
- //# sourceMappingURL=scale.js.map
121
+ exports.ScaleOut = ScaleOut;
@@ -7,7 +7,15 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const vutils_1 = require("@visactor/vutils");
8
8
 
9
9
  function getCustomType(custom) {
10
- return custom && (0, vutils_1.isFunction)(custom) ? /^class\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2 : 0;
10
+ if (!custom || !(0, vutils_1.isFunction)(custom)) return 0;
11
+ const functionStr = Function.prototype.toString.call(custom);
12
+ if (/^class\s/.test(functionStr)) return 1;
13
+ if (!custom.prototype) return 2;
14
+ if (custom.prototype.constructor === custom) {
15
+ const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
16
+ if (descriptor && !descriptor.writable) return 1;
17
+ }
18
+ return 2;
11
19
  }
12
20
 
13
21
  exports.getCustomType = getCustomType;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/executor/utils.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAE9C,SAAgB,aAAa,CAAC,MAAW;IACvC,OAAO,MAAM,IAAI,IAAA,mBAAU,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChH,CAAC;AAFD,sCAEC","file":"utils.js","sourcesContent":["import { isFunction } from '@visactor/vutils';\n\nexport function getCustomType(custom: any): number {\n return custom && isFunction(custom) ? (/^class\\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2) : 0;\n}\n"]}
1
+ {"version":3,"sources":["../src/executor/utils.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAO9C,SAAgB,aAAa,CAAC,MAAW;IACvC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAA,mBAAU,EAAC,MAAM,CAAC,EAAE;QAClC,OAAO,CAAC,CAAC;KACV;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAChC,OAAO,CAAC,CAAC;KACV;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,OAAO,CAAC,CAAC;KACV;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,KAAK,MAAM,EAAE;QAE3C,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACxE,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;YACtC,OAAO,CAAC,CAAC;SACV;KACF;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAtBD,sCAsBC","file":"utils.js","sourcesContent":["import { isFunction } from '@visactor/vutils';\n\n/**\n * 获取自定义类型\n * @param custom 自定义动画对象\n * @returns 0: 不是函数/类, 1: 是类, 2: 是函数\n */\nexport function getCustomType(custom: any): number {\n if (!custom || !isFunction(custom)) {\n return 0;\n }\n // 正则表达式检查是最快的,优先使用\n const functionStr = Function.prototype.toString.call(custom);\n if (/^class\\s/.test(functionStr)) {\n return 1;\n }\n // 检查箭头函数(没有prototype)\n if (!custom.prototype) {\n return 2;\n }\n // 检查构造函数是否是它自己(ES5类)\n if (custom.prototype.constructor === custom) {\n // 检查prototype是否可写,类的prototype是不可写的\n const descriptor = Object.getOwnPropertyDescriptor(custom, 'prototype');\n if (descriptor && !descriptor.writable) {\n return 1;\n }\n }\n return 2;\n}\n"]}
@@ -2,5 +2,4 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- });
6
- //# sourceMappingURL=types.js.map
5
+ });
@@ -137,4 +137,5 @@ class DefaultTicker extends vutils_1.EventEmitter {
137
137
  }
138
138
  }
139
139
 
140
- exports.DefaultTicker = DefaultTicker;
140
+ exports.DefaultTicker = DefaultTicker;
141
+ //# sourceMappingURL=default-ticker.js.map
package/dist/index.es.js CHANGED
@@ -1561,7 +1561,23 @@ class AnimationTransitionRegistry {
1561
1561
  const transitionRegistry = AnimationTransitionRegistry.getInstance();
1562
1562
 
1563
1563
  function getCustomType(custom) {
1564
- return custom && isFunction(custom) ? (/^class\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2) : 0;
1564
+ if (!custom || !isFunction(custom)) {
1565
+ return 0;
1566
+ }
1567
+ const functionStr = Function.prototype.toString.call(custom);
1568
+ if (/^class\s/.test(functionStr)) {
1569
+ return 1;
1570
+ }
1571
+ if (!custom.prototype) {
1572
+ return 2;
1573
+ }
1574
+ if (custom.prototype.constructor === custom) {
1575
+ const descriptor = Object.getOwnPropertyDescriptor(custom, 'prototype');
1576
+ if (descriptor && !descriptor.writable) {
1577
+ return 1;
1578
+ }
1579
+ }
1580
+ return 2;
1565
1581
  }
1566
1582
 
1567
1583
  class AnimateExecutor {
@@ -48,4 +48,5 @@ export class CommonOut extends ACustomAnimate {
48
48
  attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
49
49
  })), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
50
50
  }
51
- }
51
+ }
52
+ //# sourceMappingURL=common.js.map
@@ -228,4 +228,4 @@ export class Dissolve extends HybridEffectBase {
228
228
  return new ImageData(result, width, height);
229
229
  }
230
230
  }
231
- //# sourceMappingURL=dissolve.js.map
231
+ //# sourceMappingURL=dissolve.js.map
@@ -109,4 +109,4 @@ export class Distortion extends HybridEffectBase {
109
109
  return this.distortionConfig.strength <= 0 ? canvas : super.afterStageRender(stage, canvas);
110
110
  }
111
111
  }
112
- //# sourceMappingURL=distortion.js.map
112
+ //# sourceMappingURL=distortion.js.map
@@ -12,5 +12,4 @@ export class GroupFadeOut extends CommonOut {
12
12
  constructor(from, to, duration, easing, params) {
13
13
  super(from, to, duration, easing, params), this.keys = [ "baseOpacity" ];
14
14
  }
15
- }
16
- //# sourceMappingURL=groupFade.js.map
15
+ }
@@ -90,4 +90,5 @@ export class IncreaseCount extends ACustomAnimate {
90
90
  formattedText = this.formatTemplate ? this.formatTemplate.replace("{{var}}", formattedWithBasicFormat.toString()) : formattedWithBasicFormat,
91
91
  this.target.setAttribute("text", formattedText);
92
92
  }
93
- }
93
+ }
94
+ //# sourceMappingURL=number.js.map
@@ -71,4 +71,4 @@ export class InputRichText extends ACustomAnimate {
71
71
  this.target.setAttribute("textConfig", currentTextConfig);
72
72
  }
73
73
  }
74
- //# sourceMappingURL=input-richtext.js.map
74
+ //# sourceMappingURL=input-richtext.js.map
@@ -85,4 +85,4 @@ export class OutputRichText extends ACustomAnimate {
85
85
  return textConfig;
86
86
  }
87
87
  }
88
- //# sourceMappingURL=output-richtext.js.map
88
+ //# sourceMappingURL=output-richtext.js.map
@@ -108,5 +108,4 @@ export class ScaleOut extends ACustomAnimate {
108
108
  attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
109
109
  })), this.target.addUpdatePositionTag(), this.target.addUpdateBoundTag();
110
110
  }
111
- }
112
- //# sourceMappingURL=scale.js.map
111
+ }
@@ -1,6 +1,14 @@
1
1
  import { isFunction } from "@visactor/vutils";
2
2
 
3
3
  export function getCustomType(custom) {
4
- return custom && isFunction(custom) ? /^class\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2 : 0;
4
+ if (!custom || !isFunction(custom)) return 0;
5
+ const functionStr = Function.prototype.toString.call(custom);
6
+ if (/^class\s/.test(functionStr)) return 1;
7
+ if (!custom.prototype) return 2;
8
+ if (custom.prototype.constructor === custom) {
9
+ const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
10
+ if (descriptor && !descriptor.writable) return 1;
11
+ }
12
+ return 2;
5
13
  }
6
14
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/executor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,UAAU,aAAa,CAAC,MAAW;IACvC,OAAO,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChH,CAAC","file":"utils.js","sourcesContent":["import { isFunction } from '@visactor/vutils';\n\nexport function getCustomType(custom: any): number {\n return custom && isFunction(custom) ? (/^class\\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2) : 0;\n}\n"]}
1
+ {"version":3,"sources":["../src/executor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAO9C,MAAM,UAAU,aAAa,CAAC,MAAW;IACvC,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAClC,OAAO,CAAC,CAAC;KACV;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAChC,OAAO,CAAC,CAAC;KACV;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,OAAO,CAAC,CAAC;KACV;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,KAAK,MAAM,EAAE;QAE3C,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACxE,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;YACtC,OAAO,CAAC,CAAC;SACV;KACF;IACD,OAAO,CAAC,CAAC;AACX,CAAC","file":"utils.js","sourcesContent":["import { isFunction } from '@visactor/vutils';\n\n/**\n * 获取自定义类型\n * @param custom 自定义动画对象\n * @returns 0: 不是函数/类, 1: 是类, 2: 是函数\n */\nexport function getCustomType(custom: any): number {\n if (!custom || !isFunction(custom)) {\n return 0;\n }\n // 正则表达式检查是最快的,优先使用\n const functionStr = Function.prototype.toString.call(custom);\n if (/^class\\s/.test(functionStr)) {\n return 1;\n }\n // 检查箭头函数(没有prototype)\n if (!custom.prototype) {\n return 2;\n }\n // 检查构造函数是否是它自己(ES5类)\n if (custom.prototype.constructor === custom) {\n // 检查prototype是否可写,类的prototype是不可写的\n const descriptor = Object.getOwnPropertyDescriptor(custom, 'prototype');\n if (descriptor && !descriptor.writable) {\n return 1;\n }\n }\n return 2;\n}\n"]}
package/es/state/types.js CHANGED
@@ -1,2 +1 @@
1
- export { };
2
- //# sourceMappingURL=types.js.map
1
+ export { };
@@ -131,4 +131,5 @@ export class DefaultTicker extends EventEmitter {
131
131
  if ("performance" === (null === (_c = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.params) || void 0 === _b ? void 0 : _b.optimize) || void 0 === _c ? void 0 : _c.tickRenderMode)) return !1;
132
132
  return delta < this.interval + 2 * (Math.random() - .5) * this._jitter;
133
133
  }
134
- }
134
+ }
135
+ //# sourceMappingURL=default-ticker.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-animate",
3
- "version": "1.0.33-alpha.0",
3
+ "version": "1.0.33-alpha.1",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "main": "cjs/index.js",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "dependencies": {
15
15
  "@visactor/vutils": "~1.0.12",
16
- "@visactor/vrender-core": "1.0.33-alpha.0"
16
+ "@visactor/vrender-core": "1.0.33-alpha.1"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@rushstack/eslint-patch": "~1.1.4",
@@ -29,9 +29,9 @@
29
29
  "vite": "3.2.6",
30
30
  "typescript": "4.9.5",
31
31
  "cross-env": "^7.0.3",
32
- "@internal/eslint-config": "0.0.1",
32
+ "@internal/bundler": "0.0.1",
33
33
  "@internal/ts-config": "0.0.1",
34
- "@internal/bundler": "0.0.1"
34
+ "@internal/eslint-config": "0.0.1"
35
35
  },
36
36
  "keywords": [
37
37
  "VisActor",