@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.
- package/cjs/custom/common.js +2 -1
- package/cjs/custom/disappear/dissolve.js +1 -1
- package/cjs/custom/disappear/distortion.js +1 -1
- package/cjs/custom/groupFade.js +1 -2
- package/cjs/custom/number.js +2 -1
- package/cjs/custom/richtext/input-richtext.js +1 -1
- package/cjs/custom/richtext/output-richtext.js +1 -1
- package/cjs/custom/scale.js +1 -2
- package/cjs/executor/utils.js +9 -1
- package/cjs/executor/utils.js.map +1 -1
- package/cjs/state/types.js +1 -2
- package/cjs/ticker/default-ticker.js +2 -1
- package/dist/index.es.js +17 -1
- package/es/custom/common.js +2 -1
- package/es/custom/disappear/dissolve.js +1 -1
- package/es/custom/disappear/distortion.js +1 -1
- package/es/custom/groupFade.js +1 -2
- package/es/custom/number.js +2 -1
- package/es/custom/richtext/input-richtext.js +1 -1
- package/es/custom/richtext/output-richtext.js +1 -1
- package/es/custom/scale.js +1 -2
- package/es/executor/utils.js +9 -1
- package/es/executor/utils.js.map +1 -1
- package/es/state/types.js +1 -2
- package/es/ticker/default-ticker.js +2 -1
- package/package.json +4 -4
package/cjs/custom/common.js
CHANGED
package/cjs/custom/groupFade.js
CHANGED
package/cjs/custom/number.js
CHANGED
package/cjs/custom/scale.js
CHANGED
package/cjs/executor/utils.js
CHANGED
|
@@ -7,7 +7,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
const vutils_1 = require("@visactor/vutils");
|
|
8
8
|
|
|
9
9
|
function getCustomType(custom) {
|
|
10
|
-
|
|
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;
|
|
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"]}
|
package/cjs/state/types.js
CHANGED
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
|
-
|
|
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 {
|
package/es/custom/common.js
CHANGED
package/es/custom/groupFade.js
CHANGED
package/es/custom/number.js
CHANGED
|
@@ -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
|
package/es/custom/scale.js
CHANGED
package/es/executor/utils.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { isFunction } from "@visactor/vutils";
|
|
2
2
|
|
|
3
3
|
export function getCustomType(custom) {
|
|
4
|
-
|
|
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
|
package/es/executor/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/executor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
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.
|
|
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.
|
|
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/
|
|
32
|
+
"@internal/bundler": "0.0.1",
|
|
33
33
|
"@internal/ts-config": "0.0.1",
|
|
34
|
-
"@internal/
|
|
34
|
+
"@internal/eslint-config": "0.0.1"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"VisActor",
|