@visactor/vrender-animate 1.0.0-alpha.4 → 1.0.0-alpha.6

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.
Files changed (106) hide show
  1. package/cjs/animate.js +2 -1
  2. package/cjs/animate.js.map +1 -1
  3. package/cjs/config/morphing.d.ts +2 -0
  4. package/cjs/config/morphing.js +9 -0
  5. package/cjs/config/morphing.js.map +1 -0
  6. package/cjs/custom/clip-graphic.js +1 -1
  7. package/cjs/custom/clip-graphic.js.map +1 -1
  8. package/cjs/custom/clip.d.ts +1 -0
  9. package/cjs/custom/clip.js +6 -0
  10. package/cjs/custom/clip.js.map +1 -1
  11. package/cjs/custom/fade.js +6 -3
  12. package/cjs/custom/fade.js.map +1 -1
  13. package/cjs/custom/fromTo.js +2 -1
  14. package/cjs/custom/groupFade.js +1 -2
  15. package/cjs/custom/growHeight.js +4 -4
  16. package/cjs/custom/growHeight.js.map +1 -1
  17. package/cjs/custom/morphing.d.ts +51 -0
  18. package/cjs/custom/morphing.js +298 -0
  19. package/cjs/custom/morphing.js.map +1 -0
  20. package/cjs/custom/move.d.ts +4 -0
  21. package/cjs/custom/move.js +8 -7
  22. package/cjs/custom/move.js.map +1 -1
  23. package/cjs/custom/register.d.ts +2 -2
  24. package/cjs/custom/register.js +19 -1
  25. package/cjs/custom/register.js.map +1 -1
  26. package/cjs/custom/richtext/input-richtext.d.ts +4 -2
  27. package/cjs/custom/richtext/input-richtext.js +18 -9
  28. package/cjs/custom/richtext/input-richtext.js.map +1 -1
  29. package/cjs/custom/richtext/slide-richtext.js +1 -1
  30. package/cjs/custom/scale.js +3 -2
  31. package/cjs/custom/scale.js.map +1 -1
  32. package/cjs/custom/story.d.ts +68 -0
  33. package/cjs/custom/story.js +147 -2
  34. package/cjs/custom/story.js.map +1 -1
  35. package/cjs/executor/animate-executor.js +19 -18
  36. package/cjs/executor/animate-executor.js.map +1 -1
  37. package/cjs/index.d.ts +1 -0
  38. package/cjs/index.js +30 -1
  39. package/cjs/index.js.map +1 -1
  40. package/cjs/ticker/default-ticker.d.ts +3 -2
  41. package/cjs/ticker/default-ticker.js +9 -6
  42. package/cjs/ticker/default-ticker.js.map +1 -1
  43. package/cjs/ticker/manual-ticker.d.ts +2 -1
  44. package/cjs/ticker/manual-ticker.js +6 -4
  45. package/cjs/ticker/manual-ticker.js.map +1 -1
  46. package/cjs/timeline.d.ts +11 -3
  47. package/cjs/timeline.js +28 -15
  48. package/cjs/timeline.js.map +1 -1
  49. package/cjs/utils/easing-func.js +2 -1
  50. package/cjs/utils/transform.d.ts +2 -0
  51. package/cjs/utils/transform.js +10 -0
  52. package/cjs/utils/transform.js.map +1 -0
  53. package/dist/index.es.js +888 -85
  54. package/es/animate.js +2 -1
  55. package/es/animate.js.map +1 -1
  56. package/es/config/morphing.d.ts +2 -0
  57. package/es/config/morphing.js +5 -0
  58. package/es/config/morphing.js.map +1 -0
  59. package/es/custom/clip-graphic.js +1 -1
  60. package/es/custom/clip-graphic.js.map +1 -1
  61. package/es/custom/clip.d.ts +1 -0
  62. package/es/custom/clip.js +6 -0
  63. package/es/custom/clip.js.map +1 -1
  64. package/es/custom/fade.js +6 -3
  65. package/es/custom/fade.js.map +1 -1
  66. package/es/custom/fromTo.js +2 -1
  67. package/es/custom/groupFade.js +1 -2
  68. package/es/custom/growHeight.js +4 -4
  69. package/es/custom/growHeight.js.map +1 -1
  70. package/es/custom/morphing.d.ts +51 -0
  71. package/es/custom/morphing.js +289 -0
  72. package/es/custom/morphing.js.map +1 -0
  73. package/es/custom/move.d.ts +4 -0
  74. package/es/custom/move.js +7 -6
  75. package/es/custom/move.js.map +1 -1
  76. package/es/custom/register.d.ts +2 -2
  77. package/es/custom/register.js +7 -6
  78. package/es/custom/register.js.map +1 -1
  79. package/es/custom/richtext/input-richtext.d.ts +4 -2
  80. package/es/custom/richtext/input-richtext.js +18 -9
  81. package/es/custom/richtext/input-richtext.js.map +1 -1
  82. package/es/custom/richtext/slide-richtext.js +1 -1
  83. package/es/custom/scale.js +3 -2
  84. package/es/custom/scale.js.map +1 -1
  85. package/es/custom/story.d.ts +68 -0
  86. package/es/custom/story.js +140 -0
  87. package/es/custom/story.js.map +1 -1
  88. package/es/executor/animate-executor.js +20 -18
  89. package/es/executor/animate-executor.js.map +1 -1
  90. package/es/index.d.ts +1 -0
  91. package/es/index.js +2 -0
  92. package/es/index.js.map +1 -1
  93. package/es/ticker/default-ticker.d.ts +3 -2
  94. package/es/ticker/default-ticker.js +9 -6
  95. package/es/ticker/default-ticker.js.map +1 -1
  96. package/es/ticker/manual-ticker.d.ts +2 -1
  97. package/es/ticker/manual-ticker.js +6 -4
  98. package/es/ticker/manual-ticker.js.map +1 -1
  99. package/es/timeline.d.ts +11 -3
  100. package/es/timeline.js +28 -15
  101. package/es/timeline.js.map +1 -1
  102. package/es/utils/easing-func.js +2 -1
  103. package/es/utils/transform.d.ts +2 -0
  104. package/es/utils/transform.js +4 -0
  105. package/es/utils/transform.js.map +1 -0
  106. package/package.json +4 -4
@@ -0,0 +1,289 @@
1
+ import { splitArc, splitCircle, splitLine, splitRect, splitPolygon, splitArea, splitPath, CustomPath2D, application, interpolateColor, ColorStore, ColorType, alignBezierCurves, applyTransformOnBezierCurves, findBestMorphingRotation, pathToBezierCurves, AttributeUpdateType } from "@visactor/vrender-core";
2
+
3
+ import { isArray, isNil } from "@visactor/vutils";
4
+
5
+ import { ACustomAnimate } from "./custom-animate";
6
+
7
+ import { DefaultMorphingAnimateConfig } from "../config/morphing";
8
+
9
+ import { isTransformKey } from "../utils/transform";
10
+
11
+ const interpolateOtherAttrs = (attrs, out, ratio) => {
12
+ attrs.forEach((entry => {
13
+ if (Number.isFinite(entry.to)) out[entry.key] = entry.from + (entry.to - entry.from) * ratio; else if ("fill" === entry.key || "stroke" === entry.key) {
14
+ const color = interpolateColor(entry.from, entry.to, ratio, !1);
15
+ color && (out[entry.key] = color);
16
+ }
17
+ }));
18
+ }, interpolateMorphingData = (morphingData, path, ratio) => {
19
+ const tmpArr = [], newCp = [];
20
+ path.clear();
21
+ for (let i = 0; i < morphingData.length; i++) {
22
+ const item = morphingData[i], from = item.from, to = item.to, angle = item.rotation * ratio, fromCp = item.fromCp, toCp = item.toCp, sa = Math.sin(angle), ca = Math.cos(angle);
23
+ newCp[0] = fromCp[0] + (toCp[0] - fromCp[0]) * ratio, newCp[1] = fromCp[1] + (toCp[1] - fromCp[1]) * ratio;
24
+ for (let m = 0; m < from.length; m += 2) {
25
+ const x0 = from[m], y0 = from[m + 1], x = x0 * (1 - ratio) + to[m] * ratio, y = y0 * (1 - ratio) + to[m + 1] * ratio;
26
+ tmpArr[m] = x * ca - y * sa + newCp[0], tmpArr[m + 1] = x * sa + y * ca + newCp[1];
27
+ }
28
+ let x0 = tmpArr[0], y0 = tmpArr[1];
29
+ path.moveTo(x0, y0);
30
+ for (let m = 2; m < from.length; m += 6) {
31
+ const x1 = tmpArr[m], y1 = tmpArr[m + 1], x2 = tmpArr[m + 2], y2 = tmpArr[m + 3], x3 = tmpArr[m + 4], y3 = tmpArr[m + 5];
32
+ x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3 ? path.lineTo(x3, y3) : path.bezierCurveTo(x1, y1, x2, y2, x3, y3),
33
+ x0 = x3, y0 = y3;
34
+ }
35
+ }
36
+ }, parseMorphingData = (fromPath, toPath, config) => {
37
+ const fromBezier = fromPath ? pathToBezierCurves(fromPath) : [], toBezier = pathToBezierCurves(toPath);
38
+ config && fromBezier && (config.fromTransform && applyTransformOnBezierCurves(fromBezier, config.fromTransform.clone().getInverse()),
39
+ applyTransformOnBezierCurves(fromBezier, config.toTransfrom));
40
+ const [fromBezierCurves, toBezierCurves] = alignBezierCurves(fromBezier, toBezier);
41
+ return fromPath ? findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI) : toBezierCurves.map(((to, index) => ({
42
+ from: fromBezierCurves[index],
43
+ to: to,
44
+ fromCp: [ 0, 0 ],
45
+ toCp: [ 0, 0 ],
46
+ rotation: 0
47
+ })));
48
+ }, validateOtherAttrs = [ "fill", "fillOpacity", "shadowBlur", "shadowColor", "shadowOffsetX", "shadowOffsetY", "stroke", "strokeOpacity", "lineDashOffset" ], parseOtherAnimateAttrs = (fromAttrs, toAttrs) => {
49
+ if (!fromAttrs || !toAttrs) return null;
50
+ const res = [];
51
+ let hasAttr = !1;
52
+ return Object.keys(fromAttrs).forEach((fromKey => {
53
+ if (!validateOtherAttrs.includes(fromKey)) return;
54
+ const toValue = toAttrs[fromKey];
55
+ if (!isNil(toValue) && !isNil(fromAttrs[fromKey]) && toValue !== fromAttrs[fromKey]) {
56
+ if ("fill" === fromKey || "stroke" === fromKey) {
57
+ const parseColor = color => "string" == typeof color ? ColorStore.Get(color, ColorType.Color255) : color;
58
+ res.push({
59
+ from: isArray(fromAttrs[fromKey]) ? fromAttrs[fromKey].map(parseColor) : parseColor(fromAttrs[fromKey]),
60
+ to: isArray(toValue) ? toValue.map(parseColor) : parseColor(toValue),
61
+ key: fromKey
62
+ });
63
+ } else res.push({
64
+ from: fromAttrs[fromKey],
65
+ to: toValue,
66
+ key: fromKey
67
+ });
68
+ hasAttr = !0;
69
+ }
70
+ })), hasAttr ? res : null;
71
+ };
72
+
73
+ export class MorphingPath extends ACustomAnimate {
74
+ constructor(config, duration, easing) {
75
+ super({}, {}, duration, easing), this.morphingData = config.morphingData, this.otherAttrs = config.otherAttrs,
76
+ this.saveOnEnd = config.saveOnEnd;
77
+ }
78
+ getEndProps() {
79
+ return {};
80
+ }
81
+ onBind() {
82
+ this.target.createPathProxy(), this.onUpdate(!1, 0, this.target.attribute);
83
+ }
84
+ onEnd() {}
85
+ onUpdate(end, ratio, out) {
86
+ const target = this.target, pathProxy = "function" == typeof target.pathProxy ? target.pathProxy(target.attribute) : target.pathProxy;
87
+ interpolateMorphingData(this.morphingData, pathProxy, ratio), this.otherAttrs && this.otherAttrs.length && interpolateOtherAttrs(this.otherAttrs, out, ratio),
88
+ this.target.setAttributes(out), end && !this.saveOnEnd && (this.target.pathProxy = null);
89
+ }
90
+ }
91
+
92
+ export const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
93
+ var _a, _b, _c;
94
+ if (fromGraphic && (!fromGraphic.valid || !fromGraphic.toCustomPath)) return __DEV__ && console.error(fromGraphic, " is not validate"),
95
+ null;
96
+ if (!toGraphic.valid || !toGraphic.toCustomPath) return __DEV__ && console.error(toGraphic, " is not validate"),
97
+ null;
98
+ let fromTransform = null == fromGraphic ? void 0 : fromGraphic.globalTransMatrix;
99
+ fromGraphicTransform && fromTransform && (fromTransform = fromGraphicTransform.clone().multiply(fromTransform.a, fromTransform.b, fromTransform.c, fromTransform.d, fromTransform.e, fromTransform.f));
100
+ const morphingData = parseMorphingData(null === (_a = null == fromGraphic ? void 0 : fromGraphic.toCustomPath) || void 0 === _a ? void 0 : _a.call(fromGraphic), toGraphic.toCustomPath(), {
101
+ fromTransform: fromTransform,
102
+ toTransfrom: toGraphic.globalTransMatrix
103
+ }), attrs = parseOtherAnimateAttrs(null == fromGraphic ? void 0 : fromGraphic.attribute, toGraphic.attribute), animate = toGraphic.animate(animationConfig);
104
+ (null == animationConfig ? void 0 : animationConfig.delay) && animate.wait(animationConfig.delay);
105
+ const morphingPath = new MorphingPath({
106
+ morphingData: morphingData,
107
+ otherAttrs: attrs
108
+ }, null !== (_b = null == animationConfig ? void 0 : animationConfig.duration) && void 0 !== _b ? _b : DefaultMorphingAnimateConfig.duration, null !== (_c = null == animationConfig ? void 0 : animationConfig.easing) && void 0 !== _c ? _c : DefaultMorphingAnimateConfig.easing);
109
+ return animate.play(morphingPath), animate;
110
+ };
111
+
112
+ export const oneToMultiMorph = (fromGraphic, toGraphics, animationConfig) => {
113
+ var _a;
114
+ const validateToGraphics = toGraphics.filter((graphic => graphic && graphic.toCustomPath && graphic.valid));
115
+ validateToGraphics.length || __DEV__ && console.error(validateToGraphics, " is not validate"),
116
+ fromGraphic.valid && fromGraphic.toCustomPath || __DEV__ && console.error(fromGraphic, " is not validate");
117
+ const childGraphics = ("clone" === (null == animationConfig ? void 0 : animationConfig.splitPath) ? cloneGraphic : null !== (_a = null == animationConfig ? void 0 : animationConfig.splitPath) && void 0 !== _a ? _a : splitGraphic)(fromGraphic, validateToGraphics.length, !1), oldOnEnd = null == animationConfig ? void 0 : animationConfig.onEnd;
118
+ let count = validateToGraphics.length;
119
+ const onEachEnd = () => {
120
+ count--, 0 === count && oldOnEnd && oldOnEnd();
121
+ };
122
+ validateToGraphics.forEach(((toChild, index) => {
123
+ var _a;
124
+ const fromChild = childGraphics[index], delay = (null !== (_a = null == animationConfig ? void 0 : animationConfig.delay) && void 0 !== _a ? _a : 0) + ((null == animationConfig ? void 0 : animationConfig.individualDelay) ? animationConfig.individualDelay(index, validateToGraphics.length, fromChild, toChild) : 0);
125
+ morphPath(fromChild, toChild, Object.assign({}, animationConfig, {
126
+ onEnd: onEachEnd,
127
+ delay: delay
128
+ }), fromGraphic.globalTransMatrix);
129
+ }));
130
+ };
131
+
132
+ export class MultiToOneMorphingPath extends ACustomAnimate {
133
+ constructor(config, duration, easing) {
134
+ super({}, {}, duration, easing), this.morphingData = config.morphingData, this.otherAttrs = config.otherAttrs;
135
+ }
136
+ getEndProps() {
137
+ return {};
138
+ }
139
+ onBind() {
140
+ this.addPathProxy();
141
+ }
142
+ addPathProxy() {
143
+ this.target.shadowRoot.forEachChildren((child => {
144
+ child.createPathProxy();
145
+ })), this.onUpdate(!1, 0, this.target.attribute);
146
+ }
147
+ clearPathProxy() {
148
+ this.target.shadowRoot.forEachChildren((child => {
149
+ child.pathProxy = null;
150
+ }));
151
+ }
152
+ onEnd() {}
153
+ onUpdate(end, ratio, out) {
154
+ this.target.shadowRoot.forEachChildren(((child, index) => {
155
+ var _a;
156
+ interpolateMorphingData(this.morphingData[index], "function" == typeof child.pathProxy ? child.pathProxy(child.attribute) : child.pathProxy, ratio),
157
+ (null === (_a = this.otherAttrs) || void 0 === _a ? void 0 : _a[index]) && this.otherAttrs[index].length && interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio);
158
+ })), end && (this.clearPathProxy(), this.morphingData = null);
159
+ }
160
+ }
161
+
162
+ const parseShadowChildAttrs = graphicAttrs => {
163
+ const attrs = {};
164
+ return Object.keys(graphicAttrs).forEach((key => {
165
+ isTransformKey(key) || (attrs[key] = graphicAttrs[key]);
166
+ })), attrs;
167
+ }, appendShadowChildrenToGraphic = (graphic, children, count) => {
168
+ const childAttrs = parseShadowChildAttrs(graphic.attribute), shadowRoot = graphic.attachShadow();
169
+ if (children.length) shadowRoot.setTheme({
170
+ [children[0].type]: childAttrs
171
+ }), children.forEach((element => {
172
+ element.setAttributes({
173
+ pickable: !1
174
+ }), shadowRoot.appendChild(element);
175
+ })); else {
176
+ const box = graphic.AABBBounds, width = box.width(), height = box.height();
177
+ shadowRoot.setTheme({
178
+ rect: childAttrs
179
+ }), new Array(count).fill(0).forEach((el => {
180
+ const child = application.graphicService.creator.rect({
181
+ x: 0,
182
+ y: 0,
183
+ width: width,
184
+ height: height,
185
+ pickable: !1
186
+ });
187
+ shadowRoot.appendChild(child), children.push(child);
188
+ }));
189
+ }
190
+ };
191
+
192
+ export const cloneGraphic = (graphic, count, needAppend) => {
193
+ const children = [], childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute), path = graphic.toCustomPath();
194
+ for (let i = 0; i < count; i++) {
195
+ const element = {
196
+ path: (new CustomPath2D).fromCustomPath2D(path)
197
+ };
198
+ children.push(application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element)));
199
+ }
200
+ return needAppend && appendShadowChildrenToGraphic(graphic, children, count), children;
201
+ };
202
+
203
+ export const splitGraphic = (graphic, count, needAppend) => {
204
+ const children = [], childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);
205
+ if ("rect" === graphic.type) {
206
+ splitRect(graphic, count).forEach((element => {
207
+ children.push(application.graphicService.creator.rect(needAppend ? element : Object.assign({}, childAttrs, element)));
208
+ }));
209
+ } else if ("arc" === graphic.type) {
210
+ splitArc(graphic, count).forEach((element => {
211
+ children.push(application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element)));
212
+ }));
213
+ } else if ("circle" === graphic.type) {
214
+ splitCircle(graphic, count).forEach((element => {
215
+ children.push(application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element)));
216
+ }));
217
+ } else if ("line" === graphic.type) {
218
+ const childrenAttrs = splitLine(graphic, count), defaultSymbol = {
219
+ size: 10,
220
+ symbolType: "circle"
221
+ };
222
+ childrenAttrs.forEach((element => {
223
+ children.push(application.graphicService.creator.symbol(needAppend ? Object.assign({}, element, defaultSymbol) : Object.assign({}, childAttrs, element, defaultSymbol)));
224
+ }));
225
+ } else if ("polygon" === graphic.type) {
226
+ splitPolygon(graphic, count).forEach((element => {
227
+ children.push(application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
228
+ }));
229
+ } else if ("area" === graphic.type) {
230
+ splitArea(graphic, count).forEach((element => {
231
+ children.push(application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
232
+ }));
233
+ } else if ("path" === graphic.type) {
234
+ splitPath(graphic, count).forEach((element => {
235
+ "path" in element ? children.push(application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))) : children.push(application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
236
+ }));
237
+ }
238
+ return needAppend && appendShadowChildrenToGraphic(graphic, children, count), children;
239
+ };
240
+
241
+ export const multiToOneMorph = (fromGraphics, toGraphic, animationConfig) => {
242
+ var _a, _b, _c;
243
+ const validateFromGraphics = fromGraphics.filter((graphic => graphic.toCustomPath && graphic.valid));
244
+ validateFromGraphics.length || __DEV__ && console.error(fromGraphics, " is not validate"),
245
+ toGraphic.valid && toGraphic.toCustomPath || __DEV__ && console.error(toGraphic, " is not validate");
246
+ const childGraphics = ("clone" === (null == animationConfig ? void 0 : animationConfig.splitPath) ? cloneGraphic : null !== (_a = null == animationConfig ? void 0 : animationConfig.splitPath) && void 0 !== _a ? _a : splitGraphic)(toGraphic, validateFromGraphics.length, !0), toAttrs = toGraphic.attribute;
247
+ toGraphic.setAttribute("visible", !1);
248
+ const morphingData = validateFromGraphics.map(((graphic, index) => parseMorphingData(graphic.toCustomPath(), childGraphics[index].toCustomPath(), {
249
+ fromTransform: graphic.globalTransMatrix,
250
+ toTransfrom: childGraphics[index].globalTransMatrix
251
+ }))), otherAttrs = validateFromGraphics.map(((graphic, index) => parseOtherAnimateAttrs(graphic.attribute, toAttrs)));
252
+ if (null == animationConfig ? void 0 : animationConfig.individualDelay) {
253
+ const oldOnEnd = animationConfig.onEnd;
254
+ let count = validateFromGraphics.length;
255
+ const onEachEnd = () => {
256
+ count--, 0 === count && (toGraphic.setAttributes({
257
+ visible: !0,
258
+ ratio: null
259
+ }, !1, {
260
+ type: AttributeUpdateType.ANIMATE_END
261
+ }), toGraphic.detachShadow(), oldOnEnd && oldOnEnd());
262
+ };
263
+ childGraphics.forEach(((to, index) => {
264
+ var _a, _b, _c;
265
+ const delay = (null !== (_a = animationConfig.delay) && void 0 !== _a ? _a : 0) + animationConfig.individualDelay(index, validateFromGraphics.length, fromGraphics[index], to), animate = to.animate(Object.assign({}, animationConfig, {
266
+ onEnd: onEachEnd
267
+ }));
268
+ animate.wait(delay), animate.play(new MorphingPath({
269
+ morphingData: morphingData[index],
270
+ saveOnEnd: !0,
271
+ otherAttrs: otherAttrs[index]
272
+ }, null !== (_b = animationConfig.duration) && void 0 !== _b ? _b : DefaultMorphingAnimateConfig.duration, null !== (_c = animationConfig.easing) && void 0 !== _c ? _c : DefaultMorphingAnimateConfig.easing));
273
+ }));
274
+ } else {
275
+ const oldOnEnd = null == animationConfig ? void 0 : animationConfig.onEnd, config = animationConfig ? Object.assign({}, animationConfig) : {};
276
+ config.onEnd = () => {
277
+ toGraphic.setAttribute("visible", !0, !1, {
278
+ type: AttributeUpdateType.ANIMATE_END
279
+ }), toGraphic.detachShadow(), oldOnEnd && oldOnEnd();
280
+ };
281
+ const animate = toGraphic.animate(config);
282
+ (null == animationConfig ? void 0 : animationConfig.delay) && animate.wait(animationConfig.delay),
283
+ animate.play(new MultiToOneMorphingPath({
284
+ morphingData: morphingData,
285
+ otherAttrs: otherAttrs
286
+ }, null !== (_b = null == animationConfig ? void 0 : animationConfig.duration) && void 0 !== _b ? _b : DefaultMorphingAnimateConfig.duration, null !== (_c = null == animationConfig ? void 0 : animationConfig.easing) && void 0 !== _c ? _c : DefaultMorphingAnimateConfig.easing));
287
+ }
288
+ };
289
+ //# sourceMappingURL=morphing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/morphing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,SAAS,EACT,SAAS,EACT,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EAcpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAwBpD,MAAM,qBAAqB,GAAG,CAAC,KAAsB,EAAE,GAAQ,EAAE,KAAa,EAAE,EAAE;IAChF,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACpB,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;YAC7B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,G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ath2D,\n application,\n interpolateColor,\n ColorStore,\n ColorType,\n alignBezierCurves,\n applyTransformOnBezierCurves,\n findBestMorphingRotation,\n pathToBezierCurves,\n AttributeUpdateType,\n type MorphingAnimateConfig,\n type MultiMorphingAnimateConfig,\n type ICustomPath2D,\n type IGraphic,\n type IRect,\n type EasingType,\n type IArc,\n type ICircle,\n type IGraphicAttribute,\n type ILine,\n type IPolygon,\n type IArea,\n type IPath\n} from '@visactor/vrender-core';\nimport { isArray, isNil, type IMatrix } from '@visactor/vutils';\nimport { ACustomAnimate } from './custom-animate';\nimport { DefaultMorphingAnimateConfig } from '../config/morphing';\nimport { isTransformKey } from '../utils/transform';\n\ndeclare const __DEV__: boolean;\n\ninterface MorphingDataItem {\n from: number[];\n to: number[];\n fromCp: number[];\n toCp: number[];\n rotation: number;\n}\n\ninterface OtherAttrItem {\n from: any;\n to: any;\n key: string;\n}\n\n/**\n * 插值计算非路径属性(如颜色、透明度等)\n * @param attrs 要插值的属性数组\n * @param out 输出对象\n * @param ratio 插值比例\n */\nconst interpolateOtherAttrs = (attrs: OtherAttrItem[], out: any, ratio: number) => {\n attrs.forEach(entry => {\n if (Number.isFinite(entry.to)) {\n out[entry.key] = entry.from + (entry.to - entry.from) * ratio;\n } else if (entry.key === 'fill' || entry.key === 'stroke') {\n // 保存解析的结果到step\n const color = interpolateColor(entry.from, entry.to, ratio, false);\n if (color) {\n out[entry.key] = color;\n }\n }\n });\n};\n\n/* Adapted from zrender by ecomfe\n * https://github.com/ecomfe/zrender\n * Licensed under the BSD-3-Clause\n\n * url: https://github.com/ecomfe/zrender/blob/master/src/tool/morphPath.ts\n * License: https://github.com/ecomfe/zrender/blob/master/LICENSE\n * @license\n */\n/**\n * 根据给定比例插值计算形变数据并应用到路径\n * @param morphingData 形变数据\n * @param path 目标路径对象\n * @param ratio 插值比例\n */\nconst interpolateMorphingData = (morphingData: MorphingDataItem[], path: ICustomPath2D, ratio: number) => {\n const tmpArr: number[] = [];\n const newCp: number[] = [];\n path.clear();\n\n for (let i = 0; i < morphingData.length; i++) {\n const item = morphingData[i];\n const from = item.from;\n const to = item.to;\n const angle = item.rotation * ratio;\n const fromCp = item.fromCp;\n const toCp = item.toCp;\n const sa = Math.sin(angle);\n const ca = Math.cos(angle);\n\n newCp[0] = fromCp[0] + (toCp[0] - fromCp[0]) * ratio;\n newCp[1] = fromCp[1] + (toCp[1] - fromCp[1]) * ratio;\n\n for (let m = 0; m < from.length; m += 2) {\n const x0 = from[m];\n const y0 = from[m + 1];\n const x1 = to[m];\n const y1 = to[m + 1];\n\n const x = x0 * (1 - ratio) + x1 * ratio;\n const y = y0 * (1 - ratio) + y1 * ratio;\n\n tmpArr[m] = x * ca - y * sa + newCp[0];\n tmpArr[m + 1] = x * sa + y * ca + newCp[1];\n }\n\n let x0 = tmpArr[0];\n let y0 = tmpArr[1];\n\n path.moveTo(x0, y0);\n\n for (let m = 2; m < from.length; m += 6) {\n const x1 = tmpArr[m];\n const y1 = tmpArr[m + 1];\n const x2 = tmpArr[m + 2];\n const y2 = tmpArr[m + 3];\n const x3 = tmpArr[m + 4];\n const y3 = tmpArr[m + 5];\n\n // Is a line.\n if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) {\n path.lineTo(x3, y3);\n } else {\n path.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n x0 = x3;\n y0 = y3;\n }\n }\n};\n\n/**\n * 解析形变数据,将源路径和目标路径转换为贝塞尔曲线并找到最佳旋转角度\n * @param fromPath 源路径\n * @param toPath 目标路径\n * @param config 变换配置\n * @returns 形变数据数组\n */\nconst parseMorphingData = (\n fromPath: ICustomPath2D | null,\n toPath: ICustomPath2D,\n config?: {\n fromTransform?: IMatrix;\n toTransfrom: IMatrix;\n }\n) => {\n // [fromPath, toPath] = [toPath, fromPath];\n const fromBezier = fromPath ? pathToBezierCurves(fromPath) : [];\n const toBezier = pathToBezierCurves(toPath);\n\n if (config && fromBezier) {\n config.fromTransform && applyTransformOnBezierCurves(fromBezier, config.fromTransform.clone().getInverse());\n applyTransformOnBezierCurves(fromBezier, config.toTransfrom);\n // applyTransformOnBezierCurves(toBezier, config.toTransfrom.clone().getInverse());\n }\n\n const [fromBezierCurves, toBezierCurves] = alignBezierCurves(fromBezier, toBezier);\n\n return fromPath\n ? findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI)\n : toBezierCurves.map((to, index) => {\n return {\n from: fromBezierCurves[index],\n to,\n fromCp: [0, 0],\n toCp: [0, 0],\n rotation: 0\n };\n });\n};\n\nconst validateOtherAttrs = [\n 'fill',\n 'fillOpacity',\n 'shadowBlur',\n 'shadowColor',\n 'shadowOffsetX',\n 'shadowOffsetY',\n 'stroke',\n 'strokeOpacity',\n 'lineDashOffset'\n // 'lineWidth'\n];\n\n/**\n * 解析可动画属性,提取源属性和目标属性的差异\n * @param fromAttrs 源属性\n * @param toAttrs 目标属性\n * @returns 可动画属性数组\n */\nconst parseOtherAnimateAttrs = (\n fromAttrs: Partial<IGraphicAttribute> | null,\n toAttrs: Partial<IGraphicAttribute> | null\n) => {\n if (!fromAttrs || !toAttrs) {\n return null;\n }\n const res: OtherAttrItem[] = [];\n let hasAttr = false;\n\n Object.keys(fromAttrs).forEach(fromKey => {\n if (!validateOtherAttrs.includes(fromKey)) {\n return;\n }\n\n const toValue = (toAttrs as any)[fromKey];\n if (!isNil(toValue) && !isNil((fromAttrs as any)[fromKey]) && toValue !== (fromAttrs as any)[fromKey]) {\n if (fromKey === 'fill' || fromKey === 'stroke') {\n const parseColor = (color: string) => {\n return typeof color === 'string' ? ColorStore.Get(color, ColorType.Color255) : color;\n };\n res.push({\n from: isArray(fromAttrs[fromKey])\n ? (fromAttrs[fromKey] as any).map(parseColor)\n : parseColor((fromAttrs as any)[fromKey]),\n to: isArray(toValue) ? toValue.map(parseColor) : parseColor(toValue),\n key: fromKey\n });\n } else {\n res.push({ from: (fromAttrs as any)[fromKey], to: toValue, key: fromKey });\n }\n\n hasAttr = true;\n }\n });\n\n return hasAttr ? res : null;\n};\n\n/**\n * 形变路径动画类,用于处理路径和其他属性的形变\n */\nexport class MorphingPath extends ACustomAnimate<Record<string, any>> {\n declare path: CustomPath2D;\n\n saveOnEnd?: boolean;\n otherAttrs?: OtherAttrItem[];\n\n constructor(\n config: { morphingData: MorphingDataItem[]; otherAttrs?: OtherAttrItem[]; saveOnEnd?: boolean },\n duration: number,\n easing: EasingType\n ) {\n super({}, {}, duration, easing);\n this.morphingData = config.morphingData;\n this.otherAttrs = config.otherAttrs;\n this.saveOnEnd = config.saveOnEnd;\n }\n\n private morphingData?: MorphingDataItem[];\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n (this.target as IGraphic).createPathProxy();\n this.onUpdate(false, 0, (this.target as IGraphic).attribute);\n }\n\n onEnd(): void {\n return;\n }\n\n /**\n * 更新动画状态\n * @param end 是否结束\n * @param ratio 动画进度比例\n * @param out 输出属性对象\n */\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const target = this.target as IGraphic;\n const pathProxy = typeof target.pathProxy === 'function' ? target.pathProxy(target.attribute) : target.pathProxy;\n interpolateMorphingData(this.morphingData, pathProxy, ratio);\n if (this.otherAttrs && this.otherAttrs.length) {\n interpolateOtherAttrs(this.otherAttrs, out, ratio);\n }\n this.target.setAttributes(out);\n // 计算位置\n if (end && !this.saveOnEnd) {\n (this.target as IGraphic).pathProxy = null;\n }\n }\n}\n\n/**\n * 创建从一个图形到另一个图形的形变动画\n * @param fromGraphic 源图形\n * @param toGraphic 目标图形\n * @param animationConfig 动画配置\n * @param fromGraphicTransform 源图形变换矩阵\n * @returns 动画实例\n */\nexport const morphPath = (\n fromGraphic: IGraphic | null,\n toGraphic: IGraphic,\n animationConfig?: MorphingAnimateConfig,\n fromGraphicTransform?: IMatrix\n) => {\n if (fromGraphic && (!fromGraphic.valid || !fromGraphic.toCustomPath)) {\n if (__DEV__) {\n console.error(fromGraphic, ' is not validate');\n }\n return null;\n }\n\n if (!toGraphic.valid || !toGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(toGraphic, ' is not validate');\n }\n return null;\n }\n\n let fromTransform = fromGraphic?.globalTransMatrix;\n\n if (fromGraphicTransform && fromTransform) {\n fromTransform = fromGraphicTransform\n .clone()\n .multiply(fromTransform.a, fromTransform.b, fromTransform.c, fromTransform.d, fromTransform.e, fromTransform.f);\n }\n const morphingData = parseMorphingData(fromGraphic?.toCustomPath?.(), toGraphic.toCustomPath(), {\n fromTransform,\n toTransfrom: toGraphic.globalTransMatrix\n });\n\n const attrs = parseOtherAnimateAttrs(fromGraphic?.attribute, toGraphic.attribute);\n const animate = toGraphic.animate(animationConfig);\n\n if (animationConfig?.delay) {\n animate.wait(animationConfig.delay);\n }\n\n const morphingPath = new MorphingPath(\n { morphingData, otherAttrs: attrs },\n animationConfig?.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig?.easing ?? DefaultMorphingAnimateConfig.easing\n );\n animate.play(morphingPath);\n\n return animate;\n};\n\n/**\n * 创建从一个图形到多个图形的形变动画\n * @param fromGraphic 源图形\n * @param toGraphics 目标图形数组\n * @param animationConfig 动画配置\n */\nexport const oneToMultiMorph = (\n fromGraphic: IGraphic,\n toGraphics: IGraphic[],\n animationConfig?: MultiMorphingAnimateConfig\n) => {\n const validateToGraphics = toGraphics.filter(graphic => graphic && graphic.toCustomPath && graphic.valid);\n if (!validateToGraphics.length) {\n if (__DEV__) {\n console.error(validateToGraphics, ' is not validate');\n }\n }\n\n if (!fromGraphic.valid || !fromGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(fromGraphic, ' is not validate');\n }\n }\n\n const childGraphics: IGraphic[] = (\n animationConfig?.splitPath === 'clone' ? cloneGraphic : animationConfig?.splitPath ?? splitGraphic\n )(fromGraphic, validateToGraphics.length, false);\n\n const oldOnEnd = animationConfig?.onEnd;\n let count = validateToGraphics.length;\n const onEachEnd = () => {\n count--;\n if (count === 0 && oldOnEnd) {\n oldOnEnd();\n }\n };\n\n validateToGraphics.forEach((toChild, index) => {\n const fromChild = childGraphics[index];\n const delay =\n (animationConfig?.delay ?? 0) +\n (animationConfig?.individualDelay\n ? animationConfig.individualDelay(index, validateToGraphics.length, fromChild, toChild)\n : 0);\n morphPath(\n fromChild,\n toChild,\n Object.assign({}, animationConfig, { onEnd: onEachEnd, delay }),\n fromGraphic.globalTransMatrix\n );\n });\n};\n\n/**\n * 多对一形变路径动画类,用于处理多个路径形变为一个目标路径\n */\nexport class MultiToOneMorphingPath extends ACustomAnimate<Record<string, any>> {\n declare path: CustomPath2D;\n\n otherAttrs?: OtherAttrItem[][];\n\n constructor(\n config: { morphingData: MorphingDataItem[][]; otherAttrs?: OtherAttrItem[][] },\n duration: number,\n easing: EasingType\n ) {\n super({}, {}, duration, easing);\n this.morphingData = config.morphingData;\n this.otherAttrs = config.otherAttrs;\n }\n\n private morphingData?: MorphingDataItem[][];\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.addPathProxy();\n }\n\n /**\n * 为每个子图形添加路径代理\n */\n private addPathProxy() {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren(child => {\n (child as IGraphic).createPathProxy();\n });\n\n this.onUpdate(false, 0, (this.target as IGraphic).attribute);\n }\n\n /**\n * 清除所有子图形的路径代理\n */\n private clearPathProxy() {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren(child => {\n (child as IGraphic).pathProxy = null;\n });\n }\n\n onEnd(): void {\n return;\n }\n\n /**\n * 更新动画状态\n * @param end 是否结束\n * @param ratio 动画进度比例\n * @param out 输出属性对象\n */\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren((child: IGraphic, index) => {\n interpolateMorphingData(\n this.morphingData[index],\n typeof child.pathProxy === 'function' ? child.pathProxy(child.attribute) : child.pathProxy,\n ratio\n );\n\n if (this.otherAttrs?.[index] && this.otherAttrs[index].length) {\n interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio);\n }\n });\n\n // 计算位置\n if (end) {\n this.clearPathProxy();\n this.morphingData = null;\n }\n }\n}\n\n/**\n * 解析图形的阴影子元素属性(排除变换相关属性)\n * @param graphicAttrs 图形属性\n * @returns 阴影子元素属性\n */\nconst parseShadowChildAttrs = (graphicAttrs: Partial<IGraphicAttribute>) => {\n const attrs: Partial<IGraphicAttribute> = {};\n\n Object.keys(graphicAttrs).forEach(key => {\n if (!isTransformKey(key)) {\n (attrs as any)[key] = (graphicAttrs as any)[key];\n }\n });\n\n // if (attrs.fill == null) {\n // attrs.fill = !!attrs.fillColor;\n // }\n // if (attrs.stroke == null) {\n // attrs.stroke = !!attrs.strokeColor;\n // }\n\n return attrs;\n};\n\n/**\n * 将阴影子元素添加到图形中\n * @param graphic 目标图形\n * @param children 子元素数组\n * @param count 子元素数量\n */\nconst appendShadowChildrenToGraphic = (graphic: IGraphic, children: IGraphic[], count: number) => {\n const childAttrs = parseShadowChildAttrs(graphic.attribute);\n const shadowRoot = graphic.attachShadow();\n\n if (children.length) {\n shadowRoot.setTheme({\n [children[0].type]: childAttrs\n });\n children.forEach(element => {\n element.setAttributes({ pickable: false });\n shadowRoot.appendChild(element);\n });\n } else {\n const box = graphic.AABBBounds;\n const width = box.width();\n const height = box.height();\n\n shadowRoot.setTheme({\n rect: childAttrs\n });\n new Array(count).fill(0).forEach(el => {\n const child = application.graphicService.creator.rect({\n x: 0,\n y: 0,\n width,\n height: height,\n pickable: false\n });\n shadowRoot.appendChild(child);\n children.push(child);\n });\n }\n};\n\n/**\n * 克隆图形为多个相同的图形\n * @param graphic 源图形\n * @param count 克隆数量\n * @param needAppend 是否需要添加到源图形中\n * @returns 克隆的图形数组\n */\nexport const cloneGraphic = (graphic: IGraphic, count: number, needAppend?: boolean) => {\n const children: IGraphic[] = [];\n const childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);\n const path = graphic.toCustomPath();\n\n for (let i = 0; i < count; i++) {\n const element = {\n path: new CustomPath2D().fromCustomPath2D(path)\n };\n\n children.push(\n application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n }\n\n if (needAppend) {\n appendShadowChildrenToGraphic(graphic, children, count);\n }\n\n return children;\n};\n\n/**\n * 将图形分割为多个子图形\n * @param graphic 源图形\n * @param count 分割数量\n * @param needAppend 是否需要添加到源图形中\n * @returns 分割后的图形数组\n */\nexport const splitGraphic = (graphic: IGraphic, count: number, needAppend?: boolean) => {\n const children: IGraphic[] = [];\n const childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);\n\n if (graphic.type === 'rect') {\n const childrenAttrs = splitRect(graphic as IRect, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.rect(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'arc') {\n const childrenAttrs = splitArc(graphic as IArc, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'circle') {\n const childrenAttrs = splitCircle(graphic as ICircle, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'line') {\n const childrenAttrs = splitLine(graphic as ILine, count);\n const defaultSymbol = { size: 10, symbolType: 'circle' };\n\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.symbol(\n needAppend ? Object.assign({}, element, defaultSymbol) : Object.assign({}, childAttrs, element, defaultSymbol)\n )\n );\n });\n } else if (graphic.type === 'polygon') {\n const childrenAttrs = splitPolygon(graphic as IPolygon, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'area') {\n const childrenAttrs = splitArea(graphic as IArea, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'path') {\n const childrenAttrs = splitPath(graphic as IPath, count);\n childrenAttrs.forEach(element => {\n if ('path' in element) {\n children.push(\n application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n } else {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n }\n });\n }\n\n if (needAppend) {\n appendShadowChildrenToGraphic(graphic, children, count);\n }\n\n return children;\n};\n\n/**\n * 创建从多个图形到一个图形的形变动画\n * @param fromGraphics 源图形数组\n * @param toGraphic 目标图形\n * @param animationConfig 动画配置\n */\nexport const multiToOneMorph = (\n fromGraphics: IGraphic[],\n toGraphic: IGraphic,\n animationConfig?: MultiMorphingAnimateConfig\n) => {\n const validateFromGraphics = fromGraphics.filter(graphic => graphic.toCustomPath && graphic.valid);\n if (!validateFromGraphics.length) {\n if (__DEV__) {\n console.error(fromGraphics, ' is not validate');\n }\n }\n\n if (!toGraphic.valid || !toGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(toGraphic, ' is not validate');\n }\n }\n\n const childGraphics: IGraphic[] = (\n animationConfig?.splitPath === 'clone' ? cloneGraphic : animationConfig?.splitPath ?? splitGraphic\n )(toGraphic, validateFromGraphics.length, true);\n\n const toAttrs = toGraphic.attribute;\n toGraphic.setAttribute('visible', false);\n\n const morphingData = validateFromGraphics.map((graphic, index) => {\n return parseMorphingData(graphic.toCustomPath(), childGraphics[index].toCustomPath(), {\n fromTransform: graphic.globalTransMatrix,\n toTransfrom: childGraphics[index].globalTransMatrix\n });\n });\n const otherAttrs = validateFromGraphics.map((graphic, index) => {\n return parseOtherAnimateAttrs(graphic.attribute, toAttrs);\n });\n\n if (animationConfig?.individualDelay) {\n const oldOnEnd = animationConfig.onEnd;\n let count = validateFromGraphics.length;\n const onEachEnd = () => {\n count--;\n if (count === 0) {\n toGraphic.setAttributes({ visible: true, ratio: null } as any, false, {\n type: AttributeUpdateType.ANIMATE_END\n });\n toGraphic.detachShadow();\n if (oldOnEnd) {\n oldOnEnd();\n }\n }\n };\n childGraphics.forEach((to, index) => {\n const delay =\n (animationConfig.delay ?? 0) +\n animationConfig.individualDelay(index, validateFromGraphics.length, fromGraphics[index], to);\n const animate = to.animate(Object.assign({}, animationConfig, { onEnd: onEachEnd }));\n animate.wait(delay);\n\n animate.play(\n new MorphingPath(\n {\n morphingData: morphingData[index],\n saveOnEnd: true,\n otherAttrs: otherAttrs[index]\n },\n animationConfig.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n });\n } else {\n const oldOnEnd = animationConfig?.onEnd;\n const config = animationConfig ? Object.assign({}, animationConfig) : {};\n\n config.onEnd = () => {\n toGraphic.setAttribute('visible', true, false, { type: AttributeUpdateType.ANIMATE_END });\n toGraphic.detachShadow();\n\n if (oldOnEnd) {\n oldOnEnd();\n }\n };\n\n const animate = toGraphic.animate(config);\n\n if (animationConfig?.delay) {\n animate.wait(animationConfig.delay);\n }\n\n animate.play(\n new MultiToOneMorphingPath(\n { morphingData, otherAttrs },\n animationConfig?.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig?.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n }\n};\n"]}
@@ -13,6 +13,10 @@ export interface IMoveAnimationOptions {
13
13
  y?: number;
14
14
  }>;
15
15
  excludeChannels?: string[];
16
+ layoutRect?: {
17
+ width: number;
18
+ height: number;
19
+ };
16
20
  }
17
21
  interface IAnimationParameters {
18
22
  width: number;
package/es/custom/move.js CHANGED
@@ -3,12 +3,13 @@ import { isFunction, isValidNumber } from "@visactor/vutils";
3
3
  import { ACustomAnimate } from "./custom-animate";
4
4
 
5
5
  export const moveIn = (graphic, options, animationParameters) => {
6
- var _a, _b;
7
- const {offset: offset = 0, orient: orient, direction: direction, point: pointOpt, excludeChannels: excludeChannels = []} = null != options ? options : {};
6
+ var _a, _b, _c, _d;
7
+ const {offset: offset = 0, orient: orient, direction: direction, point: pointOpt, excludeChannels: excludeChannels = [], layoutRect: layoutRect = {}} = null != options ? options : {};
8
8
  let changedX = 0, changedY = 0;
9
- "negative" === orient && (changedX = graphic.stage.viewWidth, changedY = graphic.stage.viewHeight),
9
+ "negative" === orient && (changedX = null !== (_a = layoutRect.width) && void 0 !== _a ? _a : graphic.stage.viewWidth,
10
+ changedY = null !== (_b = layoutRect.height) && void 0 !== _b ? _b : graphic.stage.viewHeight),
10
11
  changedX += offset, changedY += offset;
11
- const point = isFunction(pointOpt) ? pointOpt.call(null, null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, animationParameters) : pointOpt, fromX = point && isValidNumber(point.x) ? point.x : changedX, fromY = point && isValidNumber(point.y) ? point.y : changedY, finalAttrs = graphic.getFinalAttribute(), finalAttrsX = excludeChannels.includes("x") ? graphic.attribute.x : finalAttrs.x, finalAttrsY = excludeChannels.includes("y") ? graphic.attribute.y : finalAttrs.y;
12
+ const point = isFunction(pointOpt) ? pointOpt.call(null, null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, animationParameters) : pointOpt, fromX = point && isValidNumber(point.x) ? point.x : changedX, fromY = point && isValidNumber(point.y) ? point.y : changedY, finalAttrs = graphic.getFinalAttribute(), finalAttrsX = excludeChannels.includes("x") ? graphic.attribute.x : finalAttrs.x, finalAttrsY = excludeChannels.includes("y") ? graphic.attribute.y : finalAttrs.y;
12
13
  switch (direction) {
13
14
  case "x":
14
15
  return {
@@ -45,8 +46,8 @@ export const moveIn = (graphic, options, animationParameters) => {
45
46
  };
46
47
 
47
48
  export const moveOut = (graphic, options, animationParameters) => {
48
- var _a, _b;
49
- const {offset: offset = 0, orient: orient, direction: direction, point: pointOpt} = null != options ? options : {}, groupWidth = graphic.stage.viewWidth, groupHeight = graphic.stage.viewHeight, changedX = ("negative" === orient ? groupWidth : 0) + offset, changedY = ("negative" === orient ? groupHeight : 0) + offset, point = isFunction(pointOpt) ? pointOpt.call(null, null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, animationParameters) : pointOpt, fromX = point && isValidNumber(point.x) ? point.x : changedX, fromY = point && isValidNumber(point.y) ? point.y : changedY;
49
+ var _a, _b, _c, _d, _e, _f;
50
+ const {offset: offset = 0, orient: orient, direction: direction, point: pointOpt} = null != options ? options : {}, groupWidth = null !== (_b = null === (_a = options.layoutRect) || void 0 === _a ? void 0 : _a.width) && void 0 !== _b ? _b : graphic.stage.viewWidth, groupHeight = null !== (_d = null === (_c = options.layoutRect) || void 0 === _c ? void 0 : _c.height) && void 0 !== _d ? _d : graphic.stage.viewHeight, changedX = ("negative" === orient ? groupWidth : 0) + offset, changedY = ("negative" === orient ? groupHeight : 0) + offset, point = isFunction(pointOpt) ? pointOpt.call(null, null === (_f = null === (_e = graphic.context) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f[0], graphic, animationParameters) : pointOpt, fromX = point && isValidNumber(point.x) ? point.x : changedX, fromY = point && isValidNumber(point.y) ? point.y : changedY;
50
51
  switch (direction) {
51
52
  case "x":
52
53
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/custom/move.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAwBlD,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,OAAiB,EACjB,OAA8B,EAC9B,mBAAyC,EACzC,EAAE;;IACF,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,GAAG,EAAE,EAAE,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;IAC/F,IAAI,QAAQ,GAAG,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,aAAa,CAAC,IAAI,CAAC,CAAC;SACjC;IACH,CAAC;CACF;AAED,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IACnC,MAAM;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5E,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAE,EAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;QACxE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;CACF","file":"move.js","sourcesContent":["import type { EasingType, IGraphic, IGroup } from '@visactor/vrender-core';\nimport { isFunction, isValidNumber } from '@visactor/vutils';\nimport { ACustomAnimate } from './custom-animate';\n\nexport type FunctionCallback<T> = (...args: any[]) => T;\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n excludeChannels?: string[];\n}\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\n// When user did not provide proper x/y value, move animation will never work properly,\n// due to that, default x/y value won't be set.\n\nexport const moveIn = (\n graphic: IGraphic,\n options: IMoveAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const { offset = 0, orient, direction, point: pointOpt, excludeChannels = [] } = options ?? {};\n let changedX = 0;\n let changedY = 0;\n\n if (orient === 'negative') {\n changedX = graphic.stage.viewWidth;\n changedY = graphic.stage.viewHeight;\n }\n\n changedX += offset;\n changedY += offset;\n const point = isFunction(pointOpt)\n ? pointOpt.call(null, graphic.context?.data?.[0], graphic, animationParameters)\n : pointOpt;\n const fromX = point && isValidNumber(point.x) ? point.x : changedX;\n const fromY = point && isValidNumber(point.y) ? point.y : changedY;\n const finalAttrs = graphic.getFinalAttribute();\n const finalAttrsX = excludeChannels.includes('x') ? graphic.attribute.x : finalAttrs.x;\n const finalAttrsY = excludeChannels.includes('y') ? graphic.attribute.y : finalAttrs.y;\n\n switch (direction) {\n case 'x':\n return {\n from: { x: fromX },\n to: { x: finalAttrsX }\n };\n case 'y':\n return {\n from: { y: fromY },\n to: { y: finalAttrsY }\n };\n case 'xy':\n default:\n return {\n from: { x: fromX, y: fromY },\n to: {\n x: finalAttrsX,\n y: finalAttrsY\n }\n };\n }\n};\n\nexport const moveOut = (\n graphic: IGraphic,\n options: IMoveAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const { offset = 0, orient, direction, point: pointOpt } = options ?? {};\n\n // consider the offset of group\n // const groupBounds = graphic.parent ? graphic.parent.getBounds() : null;\n const groupWidth = graphic.stage.viewWidth;\n const groupHeight = graphic.stage.viewHeight;\n const changedX = (orient === 'negative' ? groupWidth : 0) + offset;\n const changedY = (orient === 'negative' ? groupHeight : 0) + offset;\n const point = isFunction(pointOpt)\n ? pointOpt.call(null, graphic.context?.data?.[0], graphic, animationParameters)\n : pointOpt;\n const fromX = point && isValidNumber(point.x) ? point.x : changedX;\n const fromY = point && isValidNumber(point.y) ? point.y : changedY;\n\n switch (direction) {\n case 'x':\n return {\n from: { x: graphic.attribute.x },\n to: { x: fromX }\n };\n case 'y':\n return {\n from: { y: graphic.attribute.y },\n to: { y: fromY }\n };\n case 'xy':\n default:\n return {\n from: {\n x: graphic.attribute.x,\n y: graphic.attribute.y\n },\n to: { x: fromX, y: fromY }\n };\n }\n};\n\nexport class MoveBase extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 增长渐入\n */\nexport class MoveIn extends MoveBase {\n onBind(): void {\n super.onBind();\n const { from, to } = moveIn(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => (to as any)[key] != null);\n this.from = from;\n this.to = to;\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n Object.assign(this.target.attribute, finalAttribute);\n }\n\n if (this.params.controlOptions?.immediatelyApply !== false) {\n this.target.setAttributes(from);\n }\n }\n}\n\nexport class MoveOut extends MoveBase {\n onBind(): void {\n super.onBind();\n const { from, to } = moveOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => (to as any)[key] != null);\n this.from = from;\n this.to = to;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/custom/move.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyBlD,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,OAAiB,EACjB,OAA8B,EAC9B,mBAAyC,EACzC,EAAE;;IACF,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;IAChH,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,QAA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c,CAAC,CAAC;SACtD;QAED,IAAI,CAAA,MAAA,IAAI,CAAC,MAAM,CAAC,cAAc,0CAAE,gBAAgB,MAAK,KAAK,EAAE;YAC1D,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;SACjC;IACH,CAAC;CACF;AAED,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IACnC,MAAM;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5E,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAE,EAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;QACxE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;CACF","file":"move.js","sourcesContent":["import type { EasingType, IGraphic, IGroup } from '@visactor/vrender-core';\nimport { isFunction, isValidNumber } from '@visactor/vutils';\nimport { ACustomAnimate } from './custom-animate';\n\nexport type FunctionCallback<T> = (...args: any[]) => T;\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n excludeChannels?: string[];\n layoutRect?: { width: number; height: number };\n}\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\n// When user did not provide proper x/y value, move animation will never work properly,\n// due to that, default x/y value won't be set.\n\nexport const moveIn = (\n graphic: IGraphic,\n options: IMoveAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const { offset = 0, orient, direction, point: pointOpt, excludeChannels = [], layoutRect = {} } = options ?? {};\n let changedX = 0;\n let changedY = 0;\n\n if (orient === 'negative') {\n changedX = (layoutRect as any).width ?? graphic.stage.viewWidth;\n changedY = (layoutRect as any).height ?? graphic.stage.viewHeight;\n }\n\n changedX += offset;\n changedY += offset;\n const point = isFunction(pointOpt)\n ? pointOpt.call(null, graphic.context?.data?.[0], graphic, animationParameters)\n : pointOpt;\n const fromX = point && isValidNumber(point.x) ? point.x : changedX;\n const fromY = point && isValidNumber(point.y) ? point.y : changedY;\n const finalAttrs = graphic.getFinalAttribute();\n const finalAttrsX = excludeChannels.includes('x') ? graphic.attribute.x : finalAttrs.x;\n const finalAttrsY = excludeChannels.includes('y') ? graphic.attribute.y : finalAttrs.y;\n\n switch (direction) {\n case 'x':\n return {\n from: { x: fromX },\n to: { x: finalAttrsX }\n };\n case 'y':\n return {\n from: { y: fromY },\n to: { y: finalAttrsY }\n };\n case 'xy':\n default:\n return {\n from: { x: fromX, y: fromY },\n to: {\n x: finalAttrsX,\n y: finalAttrsY\n }\n };\n }\n};\n\nexport const moveOut = (\n graphic: IGraphic,\n options: IMoveAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const { offset = 0, orient, direction, point: pointOpt } = options ?? {};\n\n // consider the offset of group\n // const groupBounds = graphic.parent ? graphic.parent.getBounds() : null;\n const groupWidth = options.layoutRect?.width ?? graphic.stage.viewWidth;\n const groupHeight = options.layoutRect?.height ?? graphic.stage.viewHeight;\n const changedX = (orient === 'negative' ? groupWidth : 0) + offset;\n const changedY = (orient === 'negative' ? groupHeight : 0) + offset;\n const point = isFunction(pointOpt)\n ? pointOpt.call(null, graphic.context?.data?.[0], graphic, animationParameters)\n : pointOpt;\n const fromX = point && isValidNumber(point.x) ? point.x : changedX;\n const fromY = point && isValidNumber(point.y) ? point.y : changedY;\n\n switch (direction) {\n case 'x':\n return {\n from: { x: graphic.attribute.x },\n to: { x: fromX }\n };\n case 'y':\n return {\n from: { y: graphic.attribute.y },\n to: { y: fromY }\n };\n case 'xy':\n default:\n return {\n from: {\n x: graphic.attribute.x,\n y: graphic.attribute.y\n },\n to: { x: fromX, y: fromY }\n };\n }\n};\n\nexport class MoveBase extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 增长渐入\n */\nexport class MoveIn extends MoveBase {\n onBind(): void {\n super.onBind();\n const { from, to } = moveIn(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => (to as any)[key] != null);\n this.from = from;\n this.to = to;\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n Object.assign(this.target.attribute, finalAttribute);\n }\n\n if (this.params.controlOptions?.immediatelyApply !== false) {\n this.target.setAttributes(from);\n }\n }\n}\n\nexport class MoveOut extends MoveBase {\n onBind(): void {\n super.onBind();\n const { from, to } = moveOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => (to as any)[key] != null);\n this.from = from;\n this.to = to;\n }\n}\n"]}
@@ -16,7 +16,7 @@ import { SlideRichText } from './richtext/slide-richtext';
16
16
  import { SlideOutRichText } from './richtext/slide-out-richtext';
17
17
  import { ScaleIn, ScaleOut } from './scale';
18
18
  import { State } from './state';
19
- import { GrowIn, GrowOut, MoveRotateIn, MoveRotateOut, MoveScaleIn, MoveScaleOut, SlideIn, SlideOut, SpinIn, SpinOut } from './story';
19
+ import { GrowIn, GrowOut, MoveRotateIn, MoveRotateOut, MoveScaleIn, MoveScaleOut, PulseAnimate, SlideIn, SlideOut, SpinIn, SpinOut, StrokeIn, StrokeOut } from './story';
20
20
  import { Update } from './update';
21
21
  import { MoveIn, MoveOut } from './move';
22
22
  import { RotateIn, RotateOut } from './rotate';
@@ -25,4 +25,4 @@ import { FromTo } from './fromTo';
25
25
  import { GroupFadeIn, GroupFadeOut } from './groupFade';
26
26
  import { StreamLight } from './streamLight';
27
27
  export declare const registerCustomAnimate: () => void;
28
- export { ClipIn, ClipOut, FadeIn, FadeOut, GrowAngleIn, GrowAngleOut, GrowCenterIn, GrowCenterOut, GrowHeightIn, GrowHeightOut, GrowPointsIn, GrowPointsOut, GrowPointsXIn, GrowPointsXOut, GrowPointsYIn, GrowPointsYOut, GrowRadiusIn, GrowRadiusOut, GrowWidthIn, GrowWidthOut, IncreaseCount, PoptipAppear, PoptipDisappear, ScaleIn, ScaleOut, MoveIn, MoveOut, RotateIn, RotateOut, State, Update, MotionPath, LabelItemAppear, LabelItemDisappear, InputText, InputRichText, OutputRichText, SlideRichText, SlideOutRichText, SlideIn, GrowIn, SpinIn, MoveScaleIn, MoveRotateIn, SlideOut, GrowOut, SpinOut, MoveScaleOut, MoveRotateOut, GroupFadeIn, GroupFadeOut, FromTo, StreamLight };
28
+ export { ClipIn, ClipOut, FadeIn, FadeOut, GrowAngleIn, GrowAngleOut, GrowCenterIn, GrowCenterOut, GrowHeightIn, GrowHeightOut, GrowPointsIn, GrowPointsOut, GrowPointsXIn, GrowPointsXOut, GrowPointsYIn, GrowPointsYOut, GrowRadiusIn, GrowRadiusOut, GrowWidthIn, GrowWidthOut, IncreaseCount, PoptipAppear, PoptipDisappear, ScaleIn, ScaleOut, MoveIn, MoveOut, RotateIn, RotateOut, State, Update, MotionPath, LabelItemAppear, LabelItemDisappear, InputText, InputRichText, OutputRichText, SlideRichText, SlideOutRichText, SlideIn, GrowIn, SpinIn, MoveScaleIn, MoveRotateIn, SlideOut, GrowOut, SpinOut, MoveScaleOut, MoveRotateOut, StrokeIn, StrokeOut, PulseAnimate, GroupFadeIn, GroupFadeOut, FromTo, StreamLight };
@@ -36,7 +36,7 @@ import { ScaleIn, ScaleOut } from "./scale";
36
36
 
37
37
  import { State } from "./state";
38
38
 
39
- import { GrowIn, GrowOut, MoveRotateIn, MoveRotateOut, MoveScaleIn, MoveScaleOut, SlideIn, SlideOut, SpinIn, SpinOut } from "./story";
39
+ import { GrowIn, GrowOut, MoveRotateIn, MoveRotateOut, MoveScaleIn, MoveScaleOut, PulseAnimate, SlideIn, SlideOut, SpinIn, SpinOut, StrokeIn, StrokeOut } from "./story";
40
40
 
41
41
  import { Update } from "./update";
42
42
 
@@ -75,11 +75,12 @@ export const registerCustomAnimate = () => {
75
75
  AnimateExecutor.registerBuiltInAnimate("slideOutRichText", SlideOutRichText), AnimateExecutor.registerBuiltInAnimate("slideIn", SlideIn),
76
76
  AnimateExecutor.registerBuiltInAnimate("growIn", GrowIn), AnimateExecutor.registerBuiltInAnimate("spinIn", SpinIn),
77
77
  AnimateExecutor.registerBuiltInAnimate("moveScaleIn", MoveScaleIn), AnimateExecutor.registerBuiltInAnimate("moveRotateIn", MoveRotateIn),
78
- AnimateExecutor.registerBuiltInAnimate("slideOut", SlideOut), AnimateExecutor.registerBuiltInAnimate("growOut", GrowOut),
79
- AnimateExecutor.registerBuiltInAnimate("spinOut", SpinOut), AnimateExecutor.registerBuiltInAnimate("moveScaleOut", MoveScaleOut),
80
- AnimateExecutor.registerBuiltInAnimate("moveRotateOut", MoveRotateOut), AnimateExecutor.registerBuiltInAnimate("MotionPath", MotionPath),
81
- AnimateExecutor.registerBuiltInAnimate("streamLight", StreamLight);
78
+ AnimateExecutor.registerBuiltInAnimate("strokeIn", StrokeIn), AnimateExecutor.registerBuiltInAnimate("slideOut", SlideOut),
79
+ AnimateExecutor.registerBuiltInAnimate("growOut", GrowOut), AnimateExecutor.registerBuiltInAnimate("spinOut", SpinOut),
80
+ AnimateExecutor.registerBuiltInAnimate("moveScaleOut", MoveScaleOut), AnimateExecutor.registerBuiltInAnimate("moveRotateOut", MoveRotateOut),
81
+ AnimateExecutor.registerBuiltInAnimate("strokeOut", StrokeOut), AnimateExecutor.registerBuiltInAnimate("pulse", PulseAnimate),
82
+ AnimateExecutor.registerBuiltInAnimate("MotionPath", MotionPath), AnimateExecutor.registerBuiltInAnimate("streamLight", StreamLight);
82
83
  };
83
84
 
84
- export { ClipIn, ClipOut, FadeIn, FadeOut, GrowAngleIn, GrowAngleOut, GrowCenterIn, GrowCenterOut, GrowHeightIn, GrowHeightOut, GrowPointsIn, GrowPointsOut, GrowPointsXIn, GrowPointsXOut, GrowPointsYIn, GrowPointsYOut, GrowRadiusIn, GrowRadiusOut, GrowWidthIn, GrowWidthOut, IncreaseCount, PoptipAppear, PoptipDisappear, ScaleIn, ScaleOut, MoveIn, MoveOut, RotateIn, RotateOut, State, Update, MotionPath, LabelItemAppear, LabelItemDisappear, InputText, InputRichText, OutputRichText, SlideRichText, SlideOutRichText, SlideIn, GrowIn, SpinIn, MoveScaleIn, MoveRotateIn, SlideOut, GrowOut, SpinOut, MoveScaleOut, MoveRotateOut, GroupFadeIn, GroupFadeOut, FromTo, StreamLight };
85
+ export { ClipIn, ClipOut, FadeIn, FadeOut, GrowAngleIn, GrowAngleOut, GrowCenterIn, GrowCenterOut, GrowHeightIn, GrowHeightOut, GrowPointsIn, GrowPointsOut, GrowPointsXIn, GrowPointsXOut, GrowPointsYIn, GrowPointsYOut, GrowRadiusIn, GrowRadiusOut, GrowWidthIn, GrowWidthOut, IncreaseCount, PoptipAppear, PoptipDisappear, ScaleIn, ScaleOut, MoveIn, MoveOut, RotateIn, RotateOut, State, Update, MotionPath, LabelItemAppear, LabelItemDisappear, InputText, InputRichText, OutputRichText, SlideRichText, SlideOutRichText, SlideIn, GrowIn, SpinIn, MoveScaleIn, MoveRotateIn, SlideOut, GrowOut, SpinOut, MoveScaleOut, MoveRotateOut, StrokeIn, StrokeOut, PulseAnimate, GroupFadeIn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CAAC;IAGvE,eAAe,CAAC,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAEjE,eAAe,CAAC,sBAAsB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AACrE,CAAC,CAAC;AAEF,OAAO,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,eAAe,EACf,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,EACN,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,MAAM,EACN,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,OAAO,EACP,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,MAAM,EACN,WAAW,EACZ,CAAC","file":"register.js","sourcesContent":["import { AnimateExecutor } from '../executor/animate-executor';\nimport { ClipIn, ClipOut } from './clip';\nimport { FadeIn, FadeOut } from './fade';\nimport { GrowAngleIn, GrowAngleOut } from './growAngle';\nimport { GrowCenterIn, GrowCenterOut } from './growCenter';\nimport { GrowHeightIn, GrowHeightOut } from './growHeight';\nimport {\n GrowPointsIn,\n GrowPointsOut,\n GrowPointsXIn,\n GrowPointsXOut,\n GrowPointsYIn,\n GrowPointsYOut\n} from './growPoints';\nimport { GrowRadiusIn, GrowRadiusOut } from './growRadius';\nimport { GrowWidthIn, GrowWidthOut } from './growWidth';\nimport { InputText } from './input-text';\nimport { LabelItemAppear, LabelItemDisappear } from './label-item-animate';\nimport { IncreaseCount } from './number';\nimport { PoptipAppear, PoptipDisappear } from './poptip-animate';\nimport { InputRichText } from './richtext/input-richtext';\nimport { OutputRichText } from './richtext/output-richtext';\nimport { SlideRichText } from './richtext/slide-richtext';\nimport { SlideOutRichText } from './richtext/slide-out-richtext';\nimport { ScaleIn, ScaleOut } from './scale';\nimport { State } from './state';\nimport {\n GrowIn,\n GrowOut,\n MoveRotateIn,\n MoveRotateOut,\n MoveScaleIn,\n MoveScaleOut,\n SlideIn,\n SlideOut,\n SpinIn,\n SpinOut\n} from './story';\nimport { Update } from './update';\nimport { MoveIn, MoveOut } from './move';\nimport { RotateIn, RotateOut } from './rotate';\nimport { MotionPath } from './motionPath';\nimport { FromTo } from './fromTo';\nimport { GroupFadeIn, GroupFadeOut } from './groupFade';\nimport { StreamLight } from './streamLight';\n\nexport const registerCustomAnimate = () => {\n // 基础动画\n AnimateExecutor.registerBuiltInAnimate('increaseCount', IncreaseCount);\n\n AnimateExecutor.registerBuiltInAnimate('fromTo', FromTo);\n AnimateExecutor.registerBuiltInAnimate('scaleIn', ScaleIn);\n AnimateExecutor.registerBuiltInAnimate('scaleOut', ScaleOut);\n AnimateExecutor.registerBuiltInAnimate('growHeightIn', GrowHeightIn);\n AnimateExecutor.registerBuiltInAnimate('growHeightOut', GrowHeightOut);\n AnimateExecutor.registerBuiltInAnimate('growWidthIn', GrowWidthIn);\n AnimateExecutor.registerBuiltInAnimate('growWidthOut', GrowWidthOut);\n AnimateExecutor.registerBuiltInAnimate('growCenterIn', GrowCenterIn);\n AnimateExecutor.registerBuiltInAnimate('growCenterOut', GrowCenterOut);\n AnimateExecutor.registerBuiltInAnimate('clipIn', ClipIn);\n AnimateExecutor.registerBuiltInAnimate('clipOut', ClipOut);\n AnimateExecutor.registerBuiltInAnimate('fadeIn', FadeIn);\n AnimateExecutor.registerBuiltInAnimate('fadeOut', FadeOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsIn', GrowPointsIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsXIn', GrowPointsXIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsXOut', GrowPointsXOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsYIn', GrowPointsYIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsYOut', GrowPointsYOut);\n AnimateExecutor.registerBuiltInAnimate('growAngleIn', GrowAngleIn);\n AnimateExecutor.registerBuiltInAnimate('growAngleOut', GrowAngleOut);\n AnimateExecutor.registerBuiltInAnimate('growRadiusIn', GrowRadiusIn);\n AnimateExecutor.registerBuiltInAnimate('growRadiusOut', GrowRadiusOut);\n AnimateExecutor.registerBuiltInAnimate('moveIn', MoveIn);\n AnimateExecutor.registerBuiltInAnimate('moveOut', MoveOut);\n AnimateExecutor.registerBuiltInAnimate('rotateIn', RotateIn);\n AnimateExecutor.registerBuiltInAnimate('rotateOut', RotateOut);\n // state和update共用一个自定义动画类\n AnimateExecutor.registerBuiltInAnimate('update', Update);\n AnimateExecutor.registerBuiltInAnimate('state', State);\n // Label item animations\n AnimateExecutor.registerBuiltInAnimate('labelItemAppear', LabelItemAppear);\n AnimateExecutor.registerBuiltInAnimate('labelItemDisappear', LabelItemDisappear);\n // Poptip animations\n AnimateExecutor.registerBuiltInAnimate('poptipAppear', PoptipAppear);\n AnimateExecutor.registerBuiltInAnimate('poptipDisappear', PoptipDisappear);\n\n // Text input animations\n AnimateExecutor.registerBuiltInAnimate('inputText', InputText);\n AnimateExecutor.registerBuiltInAnimate('inputRichText', InputRichText);\n AnimateExecutor.registerBuiltInAnimate('outputRichText', OutputRichText);\n AnimateExecutor.registerBuiltInAnimate('slideRichText', SlideRichText);\n AnimateExecutor.registerBuiltInAnimate('slideOutRichText', SlideOutRichText);\n\n // 故事化动画 - 入场\n AnimateExecutor.registerBuiltInAnimate('slideIn', SlideIn);\n AnimateExecutor.registerBuiltInAnimate('growIn', GrowIn);\n AnimateExecutor.registerBuiltInAnimate('spinIn', SpinIn);\n AnimateExecutor.registerBuiltInAnimate('moveScaleIn', MoveScaleIn);\n AnimateExecutor.registerBuiltInAnimate('moveRotateIn', MoveRotateIn);\n\n // 故事化动画 - 出场\n AnimateExecutor.registerBuiltInAnimate('slideOut', SlideOut);\n AnimateExecutor.registerBuiltInAnimate('growOut', GrowOut);\n AnimateExecutor.registerBuiltInAnimate('spinOut', SpinOut);\n AnimateExecutor.registerBuiltInAnimate('moveScaleOut', MoveScaleOut);\n AnimateExecutor.registerBuiltInAnimate('moveRotateOut', MoveRotateOut);\n\n // 路径动画\n AnimateExecutor.registerBuiltInAnimate('MotionPath', MotionPath);\n // 流光动画\n AnimateExecutor.registerBuiltInAnimate('streamLight', StreamLight);\n};\n\nexport {\n ClipIn,\n ClipOut,\n FadeIn,\n FadeOut,\n GrowAngleIn,\n GrowAngleOut,\n GrowCenterIn,\n GrowCenterOut,\n GrowHeightIn,\n GrowHeightOut,\n GrowPointsIn,\n GrowPointsOut,\n GrowPointsXIn,\n GrowPointsXOut,\n GrowPointsYIn,\n GrowPointsYOut,\n GrowRadiusIn,\n GrowRadiusOut,\n GrowWidthIn,\n GrowWidthOut,\n IncreaseCount,\n PoptipAppear,\n PoptipDisappear,\n ScaleIn,\n ScaleOut,\n MoveIn,\n MoveOut,\n RotateIn,\n RotateOut,\n State,\n Update,\n MotionPath,\n LabelItemAppear,\n LabelItemDisappear,\n InputText,\n InputRichText,\n OutputRichText,\n SlideRichText,\n SlideOutRichText,\n SlideIn,\n GrowIn,\n SpinIn,\n MoveScaleIn,\n MoveRotateIn,\n SlideOut,\n GrowOut,\n SpinOut,\n MoveScaleOut,\n MoveRotateOut,\n GroupFadeIn,\n GroupFadeOut,\n FromTo,\n StreamLight\n};\n"]}
1
+ {"version":3,"sources":["../src/custom/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACzC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;IAG9D,eAAe,CAAC,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAEjE,eAAe,CAAC,sBAAsB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AACrE,CAAC,CAAC;AAEF,OAAO,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,eAAe,EACf,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,EACN,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,MAAM,EACN,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,OAAO,EACP,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,MAAM,EACN,WAAW,EACZ,CAAC","file":"register.js","sourcesContent":["import { AnimateExecutor } from '../executor/animate-executor';\nimport { ClipIn, ClipOut } from './clip';\nimport { FadeIn, FadeOut } from './fade';\nimport { GrowAngleIn, GrowAngleOut } from './growAngle';\nimport { GrowCenterIn, GrowCenterOut } from './growCenter';\nimport { GrowHeightIn, GrowHeightOut } from './growHeight';\nimport {\n GrowPointsIn,\n GrowPointsOut,\n GrowPointsXIn,\n GrowPointsXOut,\n GrowPointsYIn,\n GrowPointsYOut\n} from './growPoints';\nimport { GrowRadiusIn, GrowRadiusOut } from './growRadius';\nimport { GrowWidthIn, GrowWidthOut } from './growWidth';\nimport { InputText } from './input-text';\nimport { LabelItemAppear, LabelItemDisappear } from './label-item-animate';\nimport { IncreaseCount } from './number';\nimport { PoptipAppear, PoptipDisappear } from './poptip-animate';\nimport { InputRichText } from './richtext/input-richtext';\nimport { OutputRichText } from './richtext/output-richtext';\nimport { SlideRichText } from './richtext/slide-richtext';\nimport { SlideOutRichText } from './richtext/slide-out-richtext';\nimport { ScaleIn, ScaleOut } from './scale';\nimport { State } from './state';\nimport {\n GrowIn,\n GrowOut,\n MoveRotateIn,\n MoveRotateOut,\n MoveScaleIn,\n MoveScaleOut,\n PulseAnimate,\n SlideIn,\n SlideOut,\n SpinIn,\n SpinOut,\n StrokeIn,\n StrokeOut\n} from './story';\nimport { Update } from './update';\nimport { MoveIn, MoveOut } from './move';\nimport { RotateIn, RotateOut } from './rotate';\nimport { MotionPath } from './motionPath';\nimport { FromTo } from './fromTo';\nimport { GroupFadeIn, GroupFadeOut } from './groupFade';\nimport { StreamLight } from './streamLight';\n\nexport const registerCustomAnimate = () => {\n // 基础动画\n AnimateExecutor.registerBuiltInAnimate('increaseCount', IncreaseCount);\n\n AnimateExecutor.registerBuiltInAnimate('fromTo', FromTo);\n AnimateExecutor.registerBuiltInAnimate('scaleIn', ScaleIn);\n AnimateExecutor.registerBuiltInAnimate('scaleOut', ScaleOut);\n AnimateExecutor.registerBuiltInAnimate('growHeightIn', GrowHeightIn);\n AnimateExecutor.registerBuiltInAnimate('growHeightOut', GrowHeightOut);\n AnimateExecutor.registerBuiltInAnimate('growWidthIn', GrowWidthIn);\n AnimateExecutor.registerBuiltInAnimate('growWidthOut', GrowWidthOut);\n AnimateExecutor.registerBuiltInAnimate('growCenterIn', GrowCenterIn);\n AnimateExecutor.registerBuiltInAnimate('growCenterOut', GrowCenterOut);\n AnimateExecutor.registerBuiltInAnimate('clipIn', ClipIn);\n AnimateExecutor.registerBuiltInAnimate('clipOut', ClipOut);\n AnimateExecutor.registerBuiltInAnimate('fadeIn', FadeIn);\n AnimateExecutor.registerBuiltInAnimate('fadeOut', FadeOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsIn', GrowPointsIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsXIn', GrowPointsXIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsXOut', GrowPointsXOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsYIn', GrowPointsYIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsYOut', GrowPointsYOut);\n AnimateExecutor.registerBuiltInAnimate('growAngleIn', GrowAngleIn);\n AnimateExecutor.registerBuiltInAnimate('growAngleOut', GrowAngleOut);\n AnimateExecutor.registerBuiltInAnimate('growRadiusIn', GrowRadiusIn);\n AnimateExecutor.registerBuiltInAnimate('growRadiusOut', GrowRadiusOut);\n AnimateExecutor.registerBuiltInAnimate('moveIn', MoveIn);\n AnimateExecutor.registerBuiltInAnimate('moveOut', MoveOut);\n AnimateExecutor.registerBuiltInAnimate('rotateIn', RotateIn);\n AnimateExecutor.registerBuiltInAnimate('rotateOut', RotateOut);\n // state和update共用一个自定义动画类\n AnimateExecutor.registerBuiltInAnimate('update', Update);\n AnimateExecutor.registerBuiltInAnimate('state', State);\n // Label item animations\n AnimateExecutor.registerBuiltInAnimate('labelItemAppear', LabelItemAppear);\n AnimateExecutor.registerBuiltInAnimate('labelItemDisappear', LabelItemDisappear);\n // Poptip animations\n AnimateExecutor.registerBuiltInAnimate('poptipAppear', PoptipAppear);\n AnimateExecutor.registerBuiltInAnimate('poptipDisappear', PoptipDisappear);\n\n // Text input animations\n AnimateExecutor.registerBuiltInAnimate('inputText', InputText);\n AnimateExecutor.registerBuiltInAnimate('inputRichText', InputRichText);\n AnimateExecutor.registerBuiltInAnimate('outputRichText', OutputRichText);\n AnimateExecutor.registerBuiltInAnimate('slideRichText', SlideRichText);\n AnimateExecutor.registerBuiltInAnimate('slideOutRichText', SlideOutRichText);\n\n // 故事化动画 - 入场\n AnimateExecutor.registerBuiltInAnimate('slideIn', SlideIn);\n AnimateExecutor.registerBuiltInAnimate('growIn', GrowIn);\n AnimateExecutor.registerBuiltInAnimate('spinIn', SpinIn);\n AnimateExecutor.registerBuiltInAnimate('moveScaleIn', MoveScaleIn);\n AnimateExecutor.registerBuiltInAnimate('moveRotateIn', MoveRotateIn);\n AnimateExecutor.registerBuiltInAnimate('strokeIn', StrokeIn);\n\n // 故事化动画 - 出场\n AnimateExecutor.registerBuiltInAnimate('slideOut', SlideOut);\n AnimateExecutor.registerBuiltInAnimate('growOut', GrowOut);\n AnimateExecutor.registerBuiltInAnimate('spinOut', SpinOut);\n AnimateExecutor.registerBuiltInAnimate('moveScaleOut', MoveScaleOut);\n AnimateExecutor.registerBuiltInAnimate('moveRotateOut', MoveRotateOut);\n AnimateExecutor.registerBuiltInAnimate('strokeOut', StrokeOut);\n\n // 特效动画\n AnimateExecutor.registerBuiltInAnimate('pulse', PulseAnimate);\n\n // 路径动画\n AnimateExecutor.registerBuiltInAnimate('MotionPath', MotionPath);\n // 流光动画\n AnimateExecutor.registerBuiltInAnimate('streamLight', StreamLight);\n};\n\nexport {\n ClipIn,\n ClipOut,\n FadeIn,\n FadeOut,\n GrowAngleIn,\n GrowAngleOut,\n GrowCenterIn,\n GrowCenterOut,\n GrowHeightIn,\n GrowHeightOut,\n GrowPointsIn,\n GrowPointsOut,\n GrowPointsXIn,\n GrowPointsXOut,\n GrowPointsYIn,\n GrowPointsYOut,\n GrowRadiusIn,\n GrowRadiusOut,\n GrowWidthIn,\n GrowWidthOut,\n IncreaseCount,\n PoptipAppear,\n PoptipDisappear,\n ScaleIn,\n ScaleOut,\n MoveIn,\n MoveOut,\n RotateIn,\n RotateOut,\n State,\n Update,\n MotionPath,\n LabelItemAppear,\n LabelItemDisappear,\n InputText,\n InputRichText,\n OutputRichText,\n SlideRichText,\n SlideOutRichText,\n SlideIn,\n GrowIn,\n SpinIn,\n MoveScaleIn,\n MoveRotateIn,\n SlideOut,\n GrowOut,\n SpinOut,\n MoveScaleOut,\n MoveRotateOut,\n StrokeIn,\n StrokeOut,\n PulseAnimate,\n GroupFadeIn,\n GroupFadeOut,\n FromTo,\n StreamLight\n};\n"]}
@@ -10,10 +10,10 @@ export declare class InputRichText extends ACustomAnimate<{
10
10
  private showCursor;
11
11
  private cursorChar;
12
12
  private blinkCursor;
13
- private beforeText;
14
- private afterText;
15
13
  private fadeInChars;
16
14
  private fadeInDuration;
15
+ private strokeFirst;
16
+ private strokeToFillRatio;
17
17
  constructor(from: {
18
18
  textConfig: IRichTextCharacter[];
19
19
  }, to: {
@@ -26,6 +26,8 @@ export declare class InputRichText extends ACustomAnimate<{
26
26
  afterText?: string;
27
27
  fadeInChars?: boolean;
28
28
  fadeInDuration?: number;
29
+ strokeFirst?: boolean;
30
+ strokeToFillRatio?: number;
29
31
  });
30
32
  onFirstRun(): void;
31
33
  onEnd(cb?: (animate: IAnimate, step: IStep) => void): void;