@visactor/vrender-animate 1.0.43 → 1.0.45
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/custom-animate.js +2 -1
- package/cjs/custom/groupFade.js +1 -2
- package/cjs/custom/poptip-animate.js +2 -1
- package/cjs/custom/scale.js +1 -2
- package/cjs/executor/utils.js +1 -0
- package/cjs/executor/utils.js.map +1 -1
- package/dist/index.es.js +4 -0
- package/es/custom/custom-animate.js +2 -1
- package/es/custom/groupFade.js +1 -2
- package/es/custom/poptip-animate.js +2 -1
- package/es/custom/scale.js +1 -2
- package/es/executor/utils.js +1 -0
- package/es/executor/utils.js.map +1 -1
- package/package.json +4 -4
package/cjs/custom/groupFade.js
CHANGED
package/cjs/custom/scale.js
CHANGED
package/cjs/executor/utils.js
CHANGED
|
@@ -14,6 +14,7 @@ function getCustomType(custom) {
|
|
|
14
14
|
if (custom.prototype.constructor === custom) {
|
|
15
15
|
const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
|
|
16
16
|
if (descriptor && !descriptor.writable) return 1;
|
|
17
|
+
if (Object.getOwnPropertyNames(custom.prototype).length > 1) return 1;
|
|
17
18
|
}
|
|
18
19
|
return 2;
|
|
19
20
|
}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;QAGD,MAAM,SAAS,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC/D,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,OAAO,CAAC,CAAC;SACV;KACF;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AA5BD,sCA4BC","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 // 检查构造函数是否是它自己\n if (custom.prototype.constructor === custom) {\n // 检查prototype是否可写,原生class的prototype是不可写的\n const descriptor = Object.getOwnPropertyDescriptor(custom, 'prototype');\n if (descriptor && !descriptor.writable) {\n return 1;\n }\n // Babel/TypeScript 转译后的类,prototype 可写但仍有方法在 prototype 上\n // 通过检查 prototype 上是否有除 constructor 之外的自有属性来判断\n const protoKeys = Object.getOwnPropertyNames(custom.prototype);\n if (protoKeys.length > 1) {\n return 1;\n }\n }\n return 2;\n}\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -1578,6 +1578,10 @@ function getCustomType(custom) {
|
|
|
1578
1578
|
if (descriptor && !descriptor.writable) {
|
|
1579
1579
|
return 1;
|
|
1580
1580
|
}
|
|
1581
|
+
const protoKeys = Object.getOwnPropertyNames(custom.prototype);
|
|
1582
|
+
if (protoKeys.length > 1) {
|
|
1583
|
+
return 1;
|
|
1584
|
+
}
|
|
1581
1585
|
}
|
|
1582
1586
|
return 2;
|
|
1583
1587
|
}
|
package/es/custom/groupFade.js
CHANGED
package/es/custom/scale.js
CHANGED
package/es/executor/utils.js
CHANGED
|
@@ -8,6 +8,7 @@ export function getCustomType(custom) {
|
|
|
8
8
|
if (custom.prototype.constructor === custom) {
|
|
9
9
|
const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
|
|
10
10
|
if (descriptor && !descriptor.writable) return 1;
|
|
11
|
+
if (Object.getOwnPropertyNames(custom.prototype).length > 1) return 1;
|
|
11
12
|
}
|
|
12
13
|
return 2;
|
|
13
14
|
}
|
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;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 //
|
|
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;QAGD,MAAM,SAAS,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC/D,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,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 // 检查构造函数是否是它自己\n if (custom.prototype.constructor === custom) {\n // 检查prototype是否可写,原生class的prototype是不可写的\n const descriptor = Object.getOwnPropertyDescriptor(custom, 'prototype');\n if (descriptor && !descriptor.writable) {\n return 1;\n }\n // Babel/TypeScript 转译后的类,prototype 可写但仍有方法在 prototype 上\n // 通过检查 prototype 上是否有除 constructor 之外的自有属性来判断\n const protoKeys = Object.getOwnPropertyNames(custom.prototype);\n if (protoKeys.length > 1) {\n return 1;\n }\n }\n return 2;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vrender-animate",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45",
|
|
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.
|
|
16
|
+
"@visactor/vrender-core": "1.0.45"
|
|
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/eslint-config": "0.0.1",
|
|
33
33
|
"@internal/ts-config": "0.0.1",
|
|
34
|
-
"@internal/
|
|
34
|
+
"@internal/bundler": "0.0.1"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"VisActor",
|