@visactor/vrender-animate 0.23.0-alpha.3 → 1.0.0-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.
Files changed (269) hide show
  1. package/cjs/animate-extension.d.ts +1 -3
  2. package/cjs/animate-extension.js +0 -7
  3. package/cjs/animate-extension.js.map +1 -1
  4. package/cjs/animate.d.ts +1 -5
  5. package/cjs/animate.js +12 -12
  6. package/cjs/animate.js.map +1 -1
  7. package/cjs/component/component-animator.d.ts +3 -2
  8. package/cjs/component/component-animator.js +18 -32
  9. package/cjs/component/component-animator.js.map +1 -1
  10. package/cjs/custom/clip-graphic.d.ts +1 -1
  11. package/cjs/custom/clip-graphic.js.map +1 -1
  12. package/cjs/custom/clip.d.ts +1 -1
  13. package/cjs/custom/clip.js.map +1 -1
  14. package/cjs/custom/common.d.ts +1 -2
  15. package/cjs/custom/common.js +12 -10
  16. package/cjs/custom/common.js.map +1 -1
  17. package/cjs/custom/custom-animate.d.ts +2 -4
  18. package/cjs/custom/custom-animate.js +2 -2
  19. package/cjs/custom/custom-animate.js.map +1 -1
  20. package/cjs/custom/fade.d.ts +1 -1
  21. package/cjs/custom/fade.js.map +1 -1
  22. package/cjs/custom/from-to.d.ts +9 -0
  23. package/cjs/custom/from-to.js +38 -0
  24. package/cjs/custom/from-to.js.map +1 -0
  25. package/cjs/custom/group-fade.d.ts +8 -14
  26. package/cjs/custom/group-fade.js +9 -50
  27. package/cjs/custom/group-fade.js.map +1 -1
  28. package/cjs/custom/growAngle.d.ts +2 -2
  29. package/cjs/custom/growAngle.js +17 -12
  30. package/cjs/custom/growAngle.js.map +1 -1
  31. package/cjs/custom/growCenter.d.ts +1 -2
  32. package/cjs/custom/growCenter.js +8 -7
  33. package/cjs/custom/growCenter.js.map +1 -1
  34. package/cjs/custom/growHeight.d.ts +1 -3
  35. package/cjs/custom/growHeight.js +7 -7
  36. package/cjs/custom/growHeight.js.map +1 -1
  37. package/cjs/custom/growPoints.d.ts +1 -2
  38. package/cjs/custom/growPoints.js +19 -17
  39. package/cjs/custom/growPoints.js.map +1 -1
  40. package/cjs/custom/growRadius.d.ts +4 -5
  41. package/cjs/custom/growRadius.js +12 -12
  42. package/cjs/custom/growRadius.js.map +1 -1
  43. package/cjs/custom/growWidth.d.ts +1 -3
  44. package/cjs/custom/growWidth.js +7 -6
  45. package/cjs/custom/growWidth.js.map +1 -1
  46. package/cjs/custom/input-text.d.ts +1 -2
  47. package/cjs/custom/input-text.js.map +1 -1
  48. package/cjs/custom/label-item-animate.js +2 -2
  49. package/cjs/custom/label-item-animate.js.map +1 -1
  50. package/cjs/custom/move.d.ts +92 -0
  51. package/cjs/custom/move.js +131 -0
  52. package/cjs/custom/move.js.map +1 -0
  53. package/cjs/custom/number.d.ts +1 -2
  54. package/cjs/custom/number.js.map +1 -1
  55. package/cjs/custom/poptip-animate.js +2 -1
  56. package/cjs/custom/poptip-animate.js.map +1 -1
  57. package/cjs/custom/register.js +21 -2
  58. package/cjs/custom/register.js.map +1 -1
  59. package/cjs/custom/richtext/input-richtext.d.ts +33 -0
  60. package/cjs/custom/richtext/input-richtext.js +70 -0
  61. package/cjs/custom/richtext/input-richtext.js.map +1 -0
  62. package/cjs/custom/richtext/output-richtext.d.ts +37 -0
  63. package/cjs/custom/richtext/output-richtext.js +94 -0
  64. package/cjs/custom/richtext/output-richtext.js.map +1 -0
  65. package/cjs/custom/richtext/slide-out-richtext.d.ts +38 -0
  66. package/cjs/custom/richtext/slide-out-richtext.js +146 -0
  67. package/cjs/custom/richtext/slide-out-richtext.js.map +1 -0
  68. package/cjs/custom/richtext/slide-richtext.d.ts +36 -0
  69. package/cjs/custom/richtext/slide-richtext.js +144 -0
  70. package/cjs/custom/richtext/slide-richtext.js.map +1 -0
  71. package/cjs/custom/rotate.d.ts +33 -0
  72. package/cjs/custom/rotate.js +76 -0
  73. package/cjs/custom/rotate.js.map +1 -0
  74. package/cjs/custom/scale.d.ts +2 -2
  75. package/cjs/custom/scale.js +25 -21
  76. package/cjs/custom/scale.js.map +1 -1
  77. package/cjs/custom/sphere.js +1 -2
  78. package/cjs/custom/state.d.ts +1 -1
  79. package/cjs/custom/state.js.map +1 -1
  80. package/cjs/custom/story.d.ts +128 -0
  81. package/cjs/custom/story.js +347 -0
  82. package/cjs/custom/story.js.map +1 -0
  83. package/cjs/custom/tag-points.d.ts +2 -3
  84. package/cjs/custom/tag-points.js +18 -5
  85. package/cjs/custom/tag-points.js.map +1 -1
  86. package/cjs/custom/update.d.ts +2 -1
  87. package/cjs/custom/update.js +10 -2
  88. package/cjs/custom/update.js.map +1 -1
  89. package/cjs/executor/animate-executor.d.ts +6 -5
  90. package/cjs/executor/animate-executor.js +57 -29
  91. package/cjs/executor/animate-executor.js.map +1 -1
  92. package/cjs/executor/executor.d.ts +6 -3
  93. package/cjs/executor/executor.js.map +1 -1
  94. package/cjs/index.d.ts +3 -6
  95. package/cjs/index.js +16 -4
  96. package/cjs/index.js.map +1 -1
  97. package/cjs/interpolate/store.d.ts +2 -2
  98. package/cjs/interpolate/store.js +2 -0
  99. package/cjs/interpolate/store.js.map +1 -1
  100. package/cjs/state/animation-state.d.ts +2 -2
  101. package/cjs/state/animation-state.js +3 -3
  102. package/cjs/state/animation-state.js.map +1 -1
  103. package/cjs/state/graphic-extension.d.ts +1 -1
  104. package/cjs/state/graphic-extension.js.map +1 -1
  105. package/cjs/step.d.ts +2 -4
  106. package/cjs/step.js +1 -1
  107. package/cjs/step.js.map +1 -1
  108. package/cjs/ticker/default-ticker.d.ts +2 -3
  109. package/cjs/ticker/default-ticker.js +14 -12
  110. package/cjs/ticker/default-ticker.js.map +1 -1
  111. package/cjs/ticker/manual-ticker.d.ts +1 -1
  112. package/cjs/ticker/manual-ticker.js.map +1 -1
  113. package/cjs/timeline.d.ts +1 -2
  114. package/cjs/timeline.js.map +1 -1
  115. package/cjs/utils/easing-func.js +2 -1
  116. package/dist/index.es.js +1859 -554
  117. package/es/animate-extension.d.ts +1 -3
  118. package/es/animate-extension.js +0 -7
  119. package/es/animate-extension.js.map +1 -1
  120. package/es/animate.d.ts +1 -5
  121. package/es/animate.js +1 -3
  122. package/es/animate.js.map +1 -1
  123. package/es/component/component-animator.d.ts +3 -2
  124. package/es/component/component-animator.js +18 -32
  125. package/es/component/component-animator.js.map +1 -1
  126. package/es/custom/clip-graphic.d.ts +1 -1
  127. package/es/custom/clip-graphic.js.map +1 -1
  128. package/es/custom/clip.d.ts +1 -1
  129. package/es/custom/clip.js.map +1 -1
  130. package/es/custom/common.d.ts +1 -2
  131. package/es/custom/common.js +12 -10
  132. package/es/custom/common.js.map +1 -1
  133. package/es/custom/custom-animate.d.ts +2 -4
  134. package/es/custom/custom-animate.js +2 -2
  135. package/es/custom/custom-animate.js.map +1 -1
  136. package/es/custom/fade.d.ts +1 -1
  137. package/es/custom/fade.js.map +1 -1
  138. package/es/custom/from-to.d.ts +9 -0
  139. package/es/custom/from-to.js +30 -0
  140. package/es/custom/from-to.js.map +1 -0
  141. package/es/custom/group-fade.d.ts +8 -14
  142. package/es/custom/group-fade.js +9 -50
  143. package/es/custom/group-fade.js.map +1 -1
  144. package/es/custom/growAngle.d.ts +2 -2
  145. package/es/custom/growAngle.js +20 -12
  146. package/es/custom/growAngle.js.map +1 -1
  147. package/es/custom/growCenter.d.ts +1 -2
  148. package/es/custom/growCenter.js +8 -7
  149. package/es/custom/growCenter.js.map +1 -1
  150. package/es/custom/growHeight.d.ts +1 -3
  151. package/es/custom/growHeight.js +8 -8
  152. package/es/custom/growHeight.js.map +1 -1
  153. package/es/custom/growPoints.d.ts +1 -2
  154. package/es/custom/growPoints.js +19 -17
  155. package/es/custom/growPoints.js.map +1 -1
  156. package/es/custom/growRadius.d.ts +4 -5
  157. package/es/custom/growRadius.js +12 -10
  158. package/es/custom/growRadius.js.map +1 -1
  159. package/es/custom/growWidth.d.ts +1 -3
  160. package/es/custom/growWidth.js +8 -7
  161. package/es/custom/growWidth.js.map +1 -1
  162. package/es/custom/input-text.d.ts +1 -2
  163. package/es/custom/input-text.js.map +1 -1
  164. package/es/custom/label-item-animate.js +2 -2
  165. package/es/custom/label-item-animate.js.map +1 -1
  166. package/es/custom/move.d.ts +92 -0
  167. package/es/custom/move.js +116 -0
  168. package/es/custom/move.js.map +1 -0
  169. package/es/custom/number.d.ts +1 -2
  170. package/es/custom/number.js.map +1 -1
  171. package/es/custom/poptip-animate.js +2 -1
  172. package/es/custom/poptip-animate.js.map +1 -1
  173. package/es/custom/register.js +41 -16
  174. package/es/custom/register.js.map +1 -1
  175. package/es/custom/richtext/input-richtext.d.ts +33 -0
  176. package/es/custom/richtext/input-richtext.js +64 -0
  177. package/es/custom/richtext/input-richtext.js.map +1 -0
  178. package/es/custom/richtext/output-richtext.d.ts +37 -0
  179. package/es/custom/richtext/output-richtext.js +88 -0
  180. package/es/custom/richtext/output-richtext.js.map +1 -0
  181. package/es/custom/richtext/slide-out-richtext.d.ts +38 -0
  182. package/es/custom/richtext/slide-out-richtext.js +140 -0
  183. package/es/custom/richtext/slide-out-richtext.js.map +1 -0
  184. package/es/custom/richtext/slide-richtext.d.ts +36 -0
  185. package/es/custom/richtext/slide-richtext.js +138 -0
  186. package/es/custom/richtext/slide-richtext.js.map +1 -0
  187. package/es/custom/rotate.d.ts +33 -0
  188. package/es/custom/rotate.js +62 -0
  189. package/es/custom/rotate.js.map +1 -0
  190. package/es/custom/scale.d.ts +2 -2
  191. package/es/custom/scale.js +25 -21
  192. package/es/custom/scale.js.map +1 -1
  193. package/es/custom/sphere.js +1 -2
  194. package/es/custom/state.d.ts +1 -1
  195. package/es/custom/state.js.map +1 -1
  196. package/es/custom/story.d.ts +128 -0
  197. package/es/custom/story.js +323 -0
  198. package/es/custom/story.js.map +1 -0
  199. package/es/custom/tag-points.d.ts +2 -3
  200. package/es/custom/tag-points.js +19 -6
  201. package/es/custom/tag-points.js.map +1 -1
  202. package/es/custom/update.d.ts +2 -1
  203. package/es/custom/update.js +10 -2
  204. package/es/custom/update.js.map +1 -1
  205. package/es/executor/animate-executor.d.ts +6 -5
  206. package/es/executor/animate-executor.js +55 -29
  207. package/es/executor/animate-executor.js.map +1 -1
  208. package/es/executor/executor.d.ts +6 -3
  209. package/es/executor/executor.js.map +1 -1
  210. package/es/index.d.ts +3 -6
  211. package/es/index.js +4 -10
  212. package/es/index.js.map +1 -1
  213. package/es/interpolate/store.d.ts +2 -2
  214. package/es/interpolate/store.js +2 -0
  215. package/es/interpolate/store.js.map +1 -1
  216. package/es/state/animation-state.d.ts +2 -2
  217. package/es/state/animation-state.js +4 -2
  218. package/es/state/animation-state.js.map +1 -1
  219. package/es/state/graphic-extension.d.ts +1 -1
  220. package/es/state/graphic-extension.js.map +1 -1
  221. package/es/step.d.ts +2 -4
  222. package/es/step.js +2 -2
  223. package/es/step.js.map +1 -1
  224. package/es/ticker/default-ticker.d.ts +2 -3
  225. package/es/ticker/default-ticker.js +5 -5
  226. package/es/ticker/default-ticker.js.map +1 -1
  227. package/es/ticker/manual-ticker.d.ts +1 -1
  228. package/es/ticker/manual-ticker.js.map +1 -1
  229. package/es/timeline.d.ts +1 -2
  230. package/es/timeline.js +1 -1
  231. package/es/timeline.js.map +1 -1
  232. package/es/utils/easing-func.js +2 -1
  233. package/package.json +5 -5
  234. package/cjs/custom/label-animate.d.ts +0 -4
  235. package/cjs/custom/label-animate.js +0 -48
  236. package/cjs/custom/label-animate.js.map +0 -1
  237. package/cjs/intreface/animate.d.ts +0 -92
  238. package/cjs/intreface/animate.js +0 -10
  239. package/cjs/intreface/animate.js.map +0 -1
  240. package/cjs/intreface/easing.d.ts +0 -3
  241. package/cjs/intreface/easing.js +0 -6
  242. package/cjs/intreface/easing.js.map +0 -1
  243. package/cjs/intreface/ticker.d.ts +0 -37
  244. package/cjs/intreface/ticker.js +0 -11
  245. package/cjs/intreface/ticker.js.map +0 -1
  246. package/cjs/intreface/timeline.d.ts +0 -17
  247. package/cjs/intreface/timeline.js +0 -6
  248. package/cjs/intreface/timeline.js.map +0 -1
  249. package/cjs/intreface/type.d.ts +0 -13
  250. package/cjs/intreface/type.js +0 -15
  251. package/cjs/intreface/type.js.map +0 -1
  252. package/es/custom/label-animate.d.ts +0 -4
  253. package/es/custom/label-animate.js +0 -42
  254. package/es/custom/label-animate.js.map +0 -1
  255. package/es/intreface/animate.d.ts +0 -92
  256. package/es/intreface/animate.js +0 -6
  257. package/es/intreface/animate.js.map +0 -1
  258. package/es/intreface/easing.d.ts +0 -3
  259. package/es/intreface/easing.js +0 -2
  260. package/es/intreface/easing.js.map +0 -1
  261. package/es/intreface/ticker.d.ts +0 -37
  262. package/es/intreface/ticker.js +0 -7
  263. package/es/intreface/ticker.js.map +0 -1
  264. package/es/intreface/timeline.d.ts +0 -17
  265. package/es/intreface/timeline.js +0 -2
  266. package/es/intreface/timeline.js.map +0 -1
  267. package/es/intreface/type.d.ts +0 -13
  268. package/es/intreface/type.js +0 -14
  269. package/es/intreface/type.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/custom/label-item-animate.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,4CAAuD;AACvD,6CAAyC;AAKzC,MAAa,eAAgB,SAAQ,kCAAsB;IACzD,MAAM;QACJ,MAAM,QAAQ,GAAG,IAAA,mCAAuB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAa,CAAC;QAElC,MAAM,EAAE,oBAAoB,GAAG,OAAO,EAAE,SAAS,GAAG,YAAY,EAAE,cAAc,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAE3G,MAAM,UAAU,GAAG,QAAQ,GAAG,EAAE,CAAC;QACjC,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,MAAM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AAM;aACP,CAAC,CAAC;YAEH,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE;gBACzC,IAAI,EAAE,IAAI;gBACV,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE;gBACpB,QAAQ,EAAE,QAAQ,GAAG,CAAC;gBACtB,KAAK,EAAE,QAAQ,GAAG,CAAC;gBACnB,MAAM;aACP,CAAC,CAAC;YAEH,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE;gBACtC,IAAI,EAAE,IAAI;gBACV,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;gBACjB,QAAQ;gBACR,MAAM;aACP,CAAC,CAAC;YAEH,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE;gBACzC,IAAI,EAAE,IAAI;gBACV,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;gBACjB,QAAQ;gBACR,MAAM;aACP,CAAC,CAAC;SACJ;IACH,CAAC;CACF;AA9ED,gDA8EC","file":"label-item-animate.js","sourcesContent":["import { AComponentAnimate } from './custom-animate';\nimport { createComponentAnimator } from '../component';\nimport { InputText } from './input-text';\n\n/**\n * LabelItemAppear class handles the appear animation for StoryLabelItem components\n */\nexport class LabelItemAppear extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n const target = this.target as any;\n\n const { symbolStartOuterType = 'scale', titleType = 'typewriter', titlePanelType = 'scale' } = this.params;\n\n const symbolTime = duration / 10;\n target._symbolStart.setAttributes({ scaleX: 0, scaleY: 0 });\n\n animator.animate(target._symbolStart, {\n type: 'to',\n to: { scaleX: 1, scaleY: 1 },\n duration: symbolTime * 5,\n easing\n });\n\n let symbolStartOuterFrom: any;\n let symbolStartOuterTo: any;\n if (symbolStartOuterType === 'scale') {\n symbolStartOuterFrom = { scaleX: 0, scaleY: 0 };\n symbolStartOuterTo = { scaleX: 1, scaleY: 1 };\n } else {\n symbolStartOuterFrom = { clipRange: 0 };\n symbolStartOuterTo = { clipRange: 1 };\n }\n target._symbolStartOuter.setAttributes(symbolStartOuterFrom);\n\n animator.animate(target._symbolStartOuter, {\n type: 'to',\n to: symbolStartOuterTo,\n duration: symbolTime * 5,\n easing\n });\n\n target._symbolEnd.setAttributes({ scaleX: 0, scaleY: 0 });\n\n animator.animate(target._symbolEnd, {\n type: 'to',\n to: { scaleX: 1, scaleY: 1 },\n duration: symbolTime * 2,\n delay: symbolTime * 8,\n easing\n });\n\n target._line.setAttributes({ clipRange: 0 });\n\n animator.animate(target._line, {\n type: 'to',\n to: { clipRange: 1 },\n duration: symbolTime * 9,\n easing\n });\n\n if (titleType === 'typewriter') {\n const titleTopText = target._titleTop.attribute.text as string;\n target._titleTop.setAttributes({ text: '' });\n\n animator.animate(target._titleTop, {\n type: 'custom',\n delay: symbolTime * 5,\n duration: symbolTime * 4,\n easing: 'linear',\n to: { text: titleTopText },\n custom: InputText\n });\n\n const titleBottomText = target._titleBottom.attribute.text as string;\n target._titleBottom.setAttributes({ text: '' });\n\n animator.animate(target._titleBottom, {\n type: 'custom',\n delay: symbolTime * 5,\n duration: symbolTime * 4,\n easing: 'linear',\n to: { text: titleBottomText },\n custom: InputText\n });\n } else {\n target._titleTop.setAttributes({ dy: target._titleTop.AABBBounds.height() + 10 });\n\n animator.animate(target._titleTop, {\n type: 'to',\n to: {\n dy: 0\n },\n delay: symbolTime * 5,\n duration: symbolTime * 4,\n easing: 'linear'\n });\n\n target._titleBottom.setAttributes({ dy: -(10 + target._titleBottom.AABBBounds.height()) });\n\n animator.animate(target._titleBottom, {\n type: 'to',\n to: {\n dy: 0\n },\n delay: symbolTime * 5,\n duration: symbolTime * 4,\n easing: 'linear'\n });\n }\n\n if (titlePanelType === 'scale') {\n [target._titleTopPanel, target._titleBottomPanel].forEach(panel => {\n const scaleX = panel.attribute.scaleX ?? 1;\n panel.setAttributes({ scaleX: 0 });\n animator.animate(panel, {\n type: 'to',\n to: {\n scaleX\n },\n duration,\n easing\n });\n });\n } else if (titlePanelType === 'stroke') {\n [target._titleTopPanel, target._titleBottomPanel].forEach(panel => {\n const b = panel.AABBBounds;\n const totalLen = (b.width() + b.height()) * 2;\n panel.setAttributes({ lineDash: [0, totalLen * 10] });\n animator.animate(panel, {\n type: 'to',\n to: {\n lineDash: [totalLen, totalLen * 10]\n },\n duration,\n easing\n });\n });\n }\n }\n}\n\n/**\n * LabelItemDisappear class handles the disappear animation for StoryLabelItem components\n */\nexport class LabelItemDisappear extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n\n const duration = this.duration;\n const easing = this.easing;\n const target = this.target as any;\n\n const { mode } = this.params;\n\n if (mode === 'scale') {\n animator.animate(target._symbolStart, {\n type: 'to',\n to: { scaleX: 0, scaleY: 0 },\n duration,\n easing\n });\n } else {\n animator.animate(target._line, {\n type: 'to',\n to: { clipRange: 0 },\n duration,\n easing\n });\n\n animator.animate(target._symbolStart, {\n type: 'to',\n to: { scaleX: 0, scaleY: 0 },\n duration: duration / 2,\n delay: duration / 2,\n easing\n });\n\n animator.animate(target._symbolEnd, {\n type: 'to',\n to: { scaleX: 0, scaleY: 0 },\n duration,\n easing\n });\n\n animator.animate(target._titleTop, {\n type: 'to',\n to: { dy: target._titleTop.AABBBounds.height() + 10 },\n duration: duration / 2,\n easing\n });\n\n animator.animate(target._titleBottom, {\n type: 'to',\n to: { dy: -(10 + target._titleBottom.AABBBounds.height()) },\n duration: duration / 2,\n easing\n });\n\n animator.animate(target._symbolStartOuter, {\n type: 'to',\n to: { clipRange: 0 },\n duration: duration / 2,\n delay: duration / 2,\n easing\n });\n\n animator.animate(target._titleTopPanel, {\n type: 'to',\n to: { scaleX: 0 },\n duration,\n easing\n });\n\n animator.animate(target._titleBottomPanel, {\n type: 'to',\n to: { scaleX: 0 },\n duration,\n easing\n });\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/custom/label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BACjB,QAAQ;gBACR,MAAM;aACP,CAAC,CAAC;SACJ;QAED,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;CACF;AAhFD,gDAgFC","file":"label-item-animate.js","sourcesContent":["import { AComponentAnimate } from './custom-animate';\nimport { createComponentAnimator } from '../component';\nimport { InputText } from './input-text';\n\n/**\n * LabelItemAppear class handles the appear animation for StoryLabelItem components\n */\nexport class LabelItemAppear extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n const target = this.target as any;\n\n const { symbolStartOuterType = 'scale', titleType = 'typewriter', titlePanelType = 'scale' } = this.params;\n\n const symbolTime = duration / 10;\n target._symbolStart.setAttributes({ scaleX: 0, scaleY: 0 });\n\n animator.animate(target._symbolStart, {\n type: 'to',\n to: { scaleX: 1, scaleY: 1 },\n duration: symbolTime * 5,\n easing\n });\n\n let symbolStartOuterFrom: any;\n let symbolStartOuterTo: any;\n if (symbolStartOuterType === 'scale') {\n symbolStartOuterFrom = { scaleX: 0, scaleY: 0 };\n symbolStartOuterTo = { scaleX: 1, scaleY: 1 };\n } else {\n symbolStartOuterFrom = { clipRange: 0 };\n symbolStartOuterTo = { clipRange: 1 };\n }\n target._symbolStartOuter.setAttributes(symbolStartOuterFrom);\n\n animator.animate(target._symbolStartOuter, {\n type: 'to',\n to: symbolStartOuterTo,\n duration: symbolTime * 5,\n easing\n });\n\n target._symbolEnd.setAttributes({ scaleX: 0, scaleY: 0 });\n\n animator.animate(target._symbolEnd, {\n type: 'to',\n to: { scaleX: 1, scaleY: 1 },\n duration: symbolTime * 2,\n delay: symbolTime * 8,\n easing\n });\n\n target._line.setAttributes({ clipRange: 0 });\n\n animator.animate(target._line, {\n type: 'to',\n to: { clipRange: 1 },\n duration: symbolTime * 9,\n easing\n });\n\n if (titleType === 'typewriter') {\n const titleTopText = target._titleTop.attribute.text as string;\n target._titleTop.setAttributes({ text: '' });\n\n animator.animate(target._titleTop, {\n type: 'custom',\n delay: symbolTime * 5,\n duration: symbolTime * 4,\n easing: 'linear',\n to: { text: titleTopText },\n custom: InputText\n });\n\n const titleBottomText = target._titleBottom.attribute.text as string;\n target._titleBottom.setAttributes({ text: '' });\n\n animator.animate(target._titleBottom, {\n type: 'custom',\n delay: symbolTime * 5,\n duration: symbolTime * 4,\n easing: 'linear',\n to: { text: titleBottomText },\n custom: InputText\n });\n } else {\n target._titleTop.setAttributes({ dy: target._titleTop.AABBBounds.height() + 10 });\n\n animator.animate(target._titleTop, {\n type: 'to',\n to: {\n dy: 0\n },\n delay: symbolTime * 5,\n duration: symbolTime * 4,\n easing: 'linear'\n });\n\n target._titleBottom.setAttributes({ dy: -(10 + target._titleBottom.AABBBounds.height()) });\n\n animator.animate(target._titleBottom, {\n type: 'to',\n to: {\n dy: 0\n },\n delay: symbolTime * 5,\n duration: symbolTime * 4,\n easing: 'linear'\n });\n }\n\n if (titlePanelType === 'scale') {\n [target._titleTopPanel, target._titleBottomPanel].forEach(panel => {\n const scaleX = panel.attribute.scaleX ?? 1;\n panel.setAttributes({ scaleX: 0 });\n animator.animate(panel, {\n type: 'to',\n to: {\n scaleX\n },\n duration,\n easing\n });\n });\n } else if (titlePanelType === 'stroke') {\n [target._titleTopPanel, target._titleBottomPanel].forEach(panel => {\n const b = panel.AABBBounds;\n const totalLen = (b.width() + b.height()) * 2;\n panel.setAttributes({ lineDash: [0, totalLen * 10] });\n animator.animate(panel, {\n type: 'to',\n to: {\n lineDash: [totalLen, totalLen * 10]\n },\n duration,\n easing\n });\n });\n }\n\n this.completeBind(animator);\n }\n}\n\n/**\n * LabelItemDisappear class handles the disappear animation for StoryLabelItem components\n */\nexport class LabelItemDisappear extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n\n const duration = this.duration;\n const easing = this.easing;\n const target = this.target as any;\n\n const { mode } = this.params;\n\n if (mode === 'scale') {\n animator.animate(target._symbolStart, {\n type: 'to',\n to: { scaleX: 0, scaleY: 0 },\n duration,\n easing\n });\n } else {\n animator.animate(target._line, {\n type: 'to',\n to: { clipRange: 0 },\n duration,\n easing\n });\n\n animator.animate(target._symbolStart, {\n type: 'to',\n to: { scaleX: 0, scaleY: 0 },\n duration: duration / 2,\n delay: duration / 2,\n easing\n });\n\n animator.animate(target._symbolEnd, {\n type: 'to',\n to: { scaleX: 0, scaleY: 0 },\n duration,\n easing\n });\n\n animator.animate(target._titleTop, {\n type: 'to',\n to: { dy: target._titleTop.AABBBounds.height() + 10 },\n duration: duration / 2,\n easing\n });\n\n animator.animate(target._titleBottom, {\n type: 'to',\n to: { dy: -(10 + target._titleBottom.AABBBounds.height()) },\n duration: duration / 2,\n easing\n });\n\n animator.animate(target._symbolStartOuter, {\n type: 'to',\n to: { clipRange: 0 },\n duration: duration / 2,\n delay: duration / 2,\n easing\n });\n\n animator.animate(target._titleTopPanel, {\n type: 'to',\n to: { scaleX: 0 },\n duration,\n easing\n });\n\n animator.animate(target._titleBottomPanel, {\n type: 'to',\n to: { scaleX: 0 },\n duration,\n easing\n });\n }\n\n this.completeBind(animator);\n }\n}\n"]}
@@ -0,0 +1,92 @@
1
+ import type { EasingType, IGraphic, IGroup } from '@visactor/vrender-core';
2
+ import { ACustomAnimate } from './custom-animate';
3
+ export type FunctionCallback<T> = (...args: any[]) => T;
4
+ export interface IMoveAnimationOptions {
5
+ direction?: 'x' | 'y' | 'xy';
6
+ orient?: 'positive' | 'negative';
7
+ offset?: number;
8
+ point?: {
9
+ x?: number;
10
+ y?: number;
11
+ } | FunctionCallback<{
12
+ x?: number;
13
+ y?: number;
14
+ }>;
15
+ excludeChannels?: string[];
16
+ }
17
+ interface IAnimationParameters {
18
+ width: number;
19
+ height: number;
20
+ group: IGroup;
21
+ elementIndex: number;
22
+ elementCount: number;
23
+ view: any;
24
+ }
25
+ export declare const moveIn: (graphic: IGraphic, options: IMoveAnimationOptions, animationParameters: IAnimationParameters) => {
26
+ from: {
27
+ x: any;
28
+ y?: undefined;
29
+ };
30
+ to: {
31
+ x: any;
32
+ y?: undefined;
33
+ };
34
+ } | {
35
+ from: {
36
+ y: any;
37
+ x?: undefined;
38
+ };
39
+ to: {
40
+ y: any;
41
+ x?: undefined;
42
+ };
43
+ } | {
44
+ from: {
45
+ x: any;
46
+ y: any;
47
+ };
48
+ to: {
49
+ x: any;
50
+ y: any;
51
+ };
52
+ };
53
+ export declare const moveOut: (graphic: IGraphic, options: IMoveAnimationOptions, animationParameters: IAnimationParameters) => {
54
+ from: {
55
+ x: number;
56
+ y?: undefined;
57
+ };
58
+ to: {
59
+ x: any;
60
+ y?: undefined;
61
+ };
62
+ } | {
63
+ from: {
64
+ y: number;
65
+ x?: undefined;
66
+ };
67
+ to: {
68
+ y: any;
69
+ x?: undefined;
70
+ };
71
+ } | {
72
+ from: {
73
+ x: number;
74
+ y: number;
75
+ };
76
+ to: {
77
+ x: any;
78
+ y: any;
79
+ };
80
+ };
81
+ export declare class MoveBase extends ACustomAnimate<Record<string, number>> {
82
+ valid: boolean;
83
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
84
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
85
+ }
86
+ export declare class MoveIn extends MoveBase {
87
+ onBind(): void;
88
+ }
89
+ export declare class MoveOut extends MoveBase {
90
+ onBind(): void;
91
+ }
92
+ export {};
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.MoveOut = exports.MoveIn = exports.MoveBase = exports.moveOut = exports.moveIn = void 0;
6
+
7
+ const vutils_1 = require("@visactor/vutils"), custom_animate_1 = require("./custom-animate"), moveIn = (graphic, options, animationParameters) => {
8
+ var _a, _b;
9
+ const {offset: offset = 0, orient: orient, direction: direction, point: pointOpt, excludeChannels: excludeChannels = []} = null != options ? options : {};
10
+ let changedX = 0, changedY = 0;
11
+ "negative" === orient && (animationParameters.group ? (changedX = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(),
12
+ changedY = null !== (_b = animationParameters.groupHeight) && void 0 !== _b ? _b : animationParameters.group.getBounds().height(),
13
+ animationParameters.groupWidth = changedX, animationParameters.groupHeight = changedY) : (changedX = animationParameters.width,
14
+ changedY = animationParameters.height)), changedX += offset, changedY += offset;
15
+ const point = (0, vutils_1.isFunction)(pointOpt) ? pointOpt.call(null, graphic.getDatum(), graphic, animationParameters) : pointOpt, fromX = point && (0,
16
+ vutils_1.isValidNumber)(point.x) ? point.x : changedX, fromY = point && (0, vutils_1.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;
17
+ switch (direction) {
18
+ case "x":
19
+ return {
20
+ from: {
21
+ x: fromX
22
+ },
23
+ to: {
24
+ x: finalAttrsX
25
+ }
26
+ };
27
+
28
+ case "y":
29
+ return {
30
+ from: {
31
+ y: fromY
32
+ },
33
+ to: {
34
+ y: finalAttrsY
35
+ }
36
+ };
37
+
38
+ default:
39
+ return {
40
+ from: {
41
+ x: fromX,
42
+ y: fromY
43
+ },
44
+ to: {
45
+ x: finalAttrsX,
46
+ y: finalAttrsY
47
+ }
48
+ };
49
+ }
50
+ };
51
+
52
+ exports.moveIn = moveIn;
53
+
54
+ const moveOut = (graphic, options, animationParameters) => {
55
+ var _a, _b;
56
+ const {offset: offset = 0, orient: orient, direction: direction, point: pointOpt} = null != options ? options : {}, groupBounds = animationParameters.group ? animationParameters.group.getBounds() : null, groupWidth = null !== (_a = null == groupBounds ? void 0 : groupBounds.width()) && void 0 !== _a ? _a : animationParameters.width, groupHeight = null !== (_b = null == groupBounds ? void 0 : groupBounds.height()) && void 0 !== _b ? _b : animationParameters.height, changedX = ("negative" === orient ? groupWidth : 0) + offset, changedY = ("negative" === orient ? groupHeight : 0) + offset, point = (0,
57
+ vutils_1.isFunction)(pointOpt) ? pointOpt.call(null, graphic.getDatum(), graphic, animationParameters) : pointOpt, fromX = point && (0,
58
+ vutils_1.isValidNumber)(point.x) ? point.x : changedX, fromY = point && (0, vutils_1.isValidNumber)(point.y) ? point.y : changedY;
59
+ switch (direction) {
60
+ case "x":
61
+ return {
62
+ from: {
63
+ x: graphic.attribute.x
64
+ },
65
+ to: {
66
+ x: fromX
67
+ }
68
+ };
69
+
70
+ case "y":
71
+ return {
72
+ from: {
73
+ y: graphic.attribute.y
74
+ },
75
+ to: {
76
+ y: fromY
77
+ }
78
+ };
79
+
80
+ default:
81
+ return {
82
+ from: {
83
+ x: graphic.attribute.x,
84
+ y: graphic.attribute.y
85
+ },
86
+ to: {
87
+ x: fromX,
88
+ y: fromY
89
+ }
90
+ };
91
+ }
92
+ };
93
+
94
+ exports.moveOut = moveOut;
95
+
96
+ class MoveBase extends custom_animate_1.ACustomAnimate {
97
+ constructor(from, to, duration, easing, params) {
98
+ super(from, to, duration, easing, params);
99
+ }
100
+ onUpdate(end, ratio, out) {
101
+ const attribute = this.target.attribute;
102
+ this.propKeys.forEach((key => {
103
+ attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
104
+ })), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
105
+ }
106
+ }
107
+
108
+ exports.MoveBase = MoveBase;
109
+
110
+ class MoveIn extends MoveBase {
111
+ onBind() {
112
+ const {from: from, to: to} = (0, exports.moveIn)(this.target, this.params.options, this.params);
113
+ this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
114
+ this.from = from, this.to = to;
115
+ const finalAttribute = this.target.getFinalAttribute();
116
+ finalAttribute && Object.assign(this.target.attribute, finalAttribute), this.target.setAttributes(from);
117
+ }
118
+ }
119
+
120
+ exports.MoveIn = MoveIn;
121
+
122
+ class MoveOut extends MoveBase {
123
+ onBind() {
124
+ const {from: from, to: to} = (0, exports.moveOut)(this.target, this.params.options, this.params);
125
+ this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
126
+ this.from = from, this.to = to;
127
+ }
128
+ }
129
+
130
+ exports.MoveOut = MoveOut;
131
+ //# sourceMappingURL=move.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/move.ts"],"names":[],"mappings":";;;AACA,6CAA6D;AAC7D,qDAAkD;AAwB3C,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,CAAC,CAAC;IACjB,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,IAAI,MAAM,KAAK,UAAU,EAAE;QAEzB,IAAI,mBAAmB,CAAC,KAAK,EAAE;YAC7B,QAAQ,GAAG,MAAC,mBAA2B,CAAC,UAAU,mCAAI,mBAAmB,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC;YACpG,QAAQ,GAAG,MAAC,mBAA2B,CAAC,WAAW,mCAAI,mBAAmB,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC;YAErG,mBAA2B,CAAC,UAAU,GAAG,QAAQ,CAAC;YAClD,mBAA2B,CAAC,WAAW,GAAG,QAAQ,CAAC;SACrD;aAAM;YACL,QAAQ,GAAG,mBAAmB,CAAC,KAAK,CAAC;YACrC,QAAQ,GAAG,mBAAmB,CAAC,MAAM,CAAC;SACvC;KACF;IAED,QAAQ,IAAI,MAAM,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC;IACnB,MAAM,KAAK,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,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I,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;AARD,0BAQC","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 // consider the offset of group\n if (animationParameters.group) {\n changedX = (animationParameters as any).groupWidth ?? animationParameters.group.getBounds().width();\n changedY = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupWidth = changedX;\n (animationParameters as any).groupHeight = changedY;\n } else {\n changedX = animationParameters.width;\n changedY = animationParameters.height;\n }\n }\n\n changedX += offset;\n changedY += offset;\n const point = isFunction(pointOpt) ? pointOpt.call(null, graphic.getDatum(), graphic, animationParameters) : 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 = animationParameters.group ? animationParameters.group.getBounds() : null;\n const groupWidth = groupBounds?.width() ?? animationParameters.width;\n const groupHeight = groupBounds?.height() ?? animationParameters.height;\n const changedX = (orient === 'negative' ? groupWidth : 0) + offset;\n const changedY = (orient === 'negative' ? groupHeight : 0) + offset;\n const point = isFunction(pointOpt) ? pointOpt.call(null, graphic.getDatum(), graphic, animationParameters) : 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 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 this.target.setAttributes(from);\n }\n}\n\nexport class MoveOut extends MoveBase {\n onBind(): void {\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,5 +1,4 @@
1
- import type { IAnimate, IStep } from '../intreface/animate';
2
- import type { EasingType } from '../intreface/easing';
1
+ import type { EasingType, IAnimate, IStep } from '@visactor/vrender-core';
3
2
  import { ACustomAnimate } from './custom-animate';
4
3
  export declare class IncreaseCount extends ACustomAnimate<{
5
4
  text: string | number;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/custom/number.ts"],"names":[],"mappings":";;;AAEA,qDAAkD;AAOlD,MAAa,aAAc,SAAQ,+BAAyC;IAS1E,YACE,IAA+B,EAC/B,EAA6B,EAC7B,QAAgB,EAChB,MAAkB,EAIlB,MAIC;QAED,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAhBpC,mBAAc,GAAkB,IAAI,CAAC;QAiB3C,IAAI,CAAC,aAAa,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,CAAC;QAG3C,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAA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GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;YAC1D,wBAAwB,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC5C;aAAM;YAEL,wBAAwB,GAAG,eAAe,CAAC;SAC5C;QAGD,IAAI,IAAI,CAAC,cAAc,EAAE;YAEvB,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,wBAAwB,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC7F;aAAM;YAEL,aAAa,GAAG,wBAAwB,CAAC;SAC1C;QAGD,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAClD,CAAC;CACF;AAvOD,sCAuOC","file":"number.js","sourcesContent":["import type { IAnimate, IStep } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\n\n/**\n * 数字增加动画,支持string; number; xx%; xx,xxx; xxx.xx%\n * 也支持通过formatTemplate参数指定格式化模板,如 \"{{var}}m\"、\"${{var}}\"\n * format和formatTemplate可以同时生效,先应用format再应用模板\n */\nexport class IncreaseCount extends ACustomAnimate<{ text: string | number }> {\n declare valid: boolean;\n\n private fromNumber: number;\n private toNumber: number;\n private decimalLength: number;\n private format: string;\n private formatTemplate: string | null = null;\n\n constructor(\n from: { text: string | number },\n to: { text: string | number },\n duration: number,\n easing: EasingType,\n // 支持外部控制小数位数以及格式化\n // format控制数字本身的格式化方式\n // formatTemplate可以定义模板字符串如 \"{{var}}m\"、\"${{var}}\",两者可以同时使用\n params?: {\n decimalLength?: number;\n format?: 'percent' | 'thousandth' | 'none';\n formatTemplate?: string;\n }\n ) {\n super(from, to, duration, easing, params);\n this.decimalLength = params?.decimalLength;\n\n // 检查是否提供了格式化模板\n if (params?.formatTemplate && params.formatTemplate.includes('{{var}}')) {\n this.formatTemplate = params.formatTemplate;\n }\n }\n\n onFirstRun(): void {\n const fromProps = this.getLastProps();\n const toProps = this.getEndProps();\n const fromText = fromProps.text ?? 0;\n const toText = toProps.text ?? 0;\n\n // 初始化解析结果\n this.valid = true;\n let fromNum = 0;\n let toNum = 0;\n let fromFormat = '';\n let toFormat = '';\n let maxDecimalLength = 0;\n\n // 解析fromText\n if (typeof fromText === 'number') {\n fromNum = fromText;\n const str = fromText.toString();\n const decimalPart = str.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length);\n } else if (typeof fromText === 'string') {\n // 检查是否是百分比\n if (fromText.endsWith('%')) {\n fromFormat = '%';\n const numStr = fromText.substring(0, fromText.length - 1);\n // 去除可能的千分位逗号\n const cleanNumStr = numStr.replace(/,/g, '');\n fromNum = parseFloat(cleanNumStr) / 100;\n if (isNaN(fromNum)) {\n this.valid = false;\n return;\n }\n const decimalPart = cleanNumStr.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length + 2); // 百分比需要加2\n } else {\n // 处理普通数字或带千分位逗号的数字\n const cleanNumStr = fromText.replace(/,/g, '');\n fromNum = parseFloat(cleanNumStr);\n if (isNaN(fromNum)) {\n this.valid = false;\n return;\n }\n // 检查是否有千分位\n if (fromText.includes(',')) {\n fromFormat = ',';\n }\n const decimalPart = cleanNumStr.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length);\n }\n } else {\n this.valid = false;\n return;\n }\n\n // 解析toText\n if (typeof toText === 'number') {\n toNum = toText;\n const str = toText.toString();\n const decimalPart = str.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length);\n } else if (typeof toText === 'string') {\n // 检查是否是百分比\n if (toText.endsWith('%')) {\n toFormat = '%';\n const numStr = toText.substring(0, toText.length - 1);\n // 去除可能的千分位逗号\n const cleanNumStr = numStr.replace(/,/g, '');\n toNum = parseFloat(cleanNumStr) / 100;\n if (isNaN(toNum)) {\n this.valid = false;\n return;\n }\n const decimalPart = cleanNumStr.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length + 2); // 百分比需要加2\n } else {\n // 处理普通数字或带千分位逗号的数字\n const cleanNumStr = toText.replace(/,/g, '');\n toNum = parseFloat(cleanNumStr);\n if (isNaN(toNum)) {\n this.valid = false;\n return;\n }\n // 检查是否有千分位\n if (toText.includes(',')) {\n toFormat = ',';\n }\n const decimalPart = cleanNumStr.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length);\n }\n } else {\n this.valid = false;\n return;\n }\n\n // 设置最终格式\n // 检查是否有外部传入的格式\n if (this.params?.format) {\n // 使用外部传入的格式,将外部格式映射到内部格式\n switch (this.params.format) {\n case 'percent':\n this.format = '%';\n break;\n case 'thousandth':\n this.format = ',';\n break;\n case 'none':\n this.format = '';\n break;\n default:\n // 如果传入了未知格式,则使用自动检测的格式\n this.format = toFormat || fromFormat;\n }\n\n // 如果外部指定了百分比格式,但输入不是百分比,需要适配\n if (this.format === '%' && toFormat !== '%' && fromFormat !== '%') {\n // 不需要除以100,因为输入不是百分比\n if (this.decimalLength === undefined) {\n // 默认百分比显示2位小数\n this.decimalLength = 2;\n }\n }\n\n // 如果外部指定了不用百分比格式,但输入是百分比,需要适配\n if (this.format !== '%' && (toFormat === '%' || fromFormat === '%')) {\n // 需要乘以100,因为输入是百分比但不显示为百分比\n fromNum = fromNum * 100;\n toNum = toNum * 100;\n }\n } else {\n // 自动检测格式,优先使用toFormat,如果to没有特殊格式则使用fromFormat\n this.format = toFormat || fromFormat;\n }\n\n // 设置fromNumber和toNumber\n this.fromNumber = fromNum;\n this.toNumber = toNum;\n\n // 如果没有传入decimalLength,则根据输入格式设置\n if (this.decimalLength === undefined) {\n this.decimalLength = maxDecimalLength;\n }\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n if (!cb) {\n this.props && this.target.setAttributes(this.props as any);\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this.valid) {\n return;\n }\n // 插值计算当前数值\n const currentNumber = this.fromNumber + (this.toNumber - this.fromNumber) * ratio;\n\n // 根据格式和小数位格式化数字\n let formattedText: string | number = '';\n const format = this.format;\n\n // 首先格式化数字值(保留小数位)\n // 对于百分比,乘以100\n const adjustedNumber = format === '%' ? currentNumber * 100 : currentNumber;\n // 保留指定小数位\n const numberWithDecimals = adjustedNumber.toFixed(this.decimalLength);\n // 如果小数位全是0,转为整数\n let formattedNumber: string | number = numberWithDecimals;\n if (parseFloat(numberWithDecimals) === Math.floor(parseFloat(numberWithDecimals))) {\n formattedNumber = Math.floor(parseFloat(numberWithDecimals));\n }\n\n // 应用基本格式(百分比、千分位)\n let formattedWithBasicFormat: string | number;\n if (format === '%') {\n // 百分比格式\n formattedWithBasicFormat = `${formattedNumber}%`;\n } else if (format === ',') {\n // 千分位格式\n const parts = formattedNumber.toString().split('.');\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n formattedWithBasicFormat = parts.join('.');\n } else {\n // 普通数字格式\n formattedWithBasicFormat = formattedNumber;\n }\n\n // 应用模板(如果存在)\n if (this.formatTemplate) {\n // 使用模板格式化\n formattedText = this.formatTemplate.replace('{{var}}', formattedWithBasicFormat.toString());\n } else {\n // 不使用模板,直接使用基本格式的结果\n formattedText = formattedWithBasicFormat;\n }\n\n // 更新图形的text属性\n this.target.setAttribute('text', formattedText);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/custom/number.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAOlD,MAAa,aAAc,SAAQ,+BAAyC;IAS1E,YACE,IAA+B,EAC/B,EAA6B,EAC7B,QAAgB,EAChB,MAAkB,EAIlB,MAIC;QAED,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAhBpC,mBAAc,GAAkB,IAAI,CAAC;QAiB3C,IAAI,CAAC,aAAa,GAAG,MAAM,aAAN,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CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpD,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;YAC1D,wBAAwB,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC5C;aAAM;YAEL,wBAAwB,GAAG,eAAe,CAAC;SAC5C;QAGD,IAAI,IAAI,CAAC,cAAc,EAAE;YAEvB,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,wBAAwB,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC7F;aAAM;YAEL,aAAa,GAAG,wBAAwB,CAAC;SAC1C;QAGD,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAClD,CAAC;CACF;AAvOD,sCAuOC","file":"number.js","sourcesContent":["import type { EasingType, IAnimate, IStep } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\n/**\n * 数字增加动画,支持string; number; xx%; xx,xxx; xxx.xx%\n * 也支持通过formatTemplate参数指定格式化模板,如 \"{{var}}m\"、\"${{var}}\"\n * format和formatTemplate可以同时生效,先应用format再应用模板\n */\nexport class IncreaseCount extends ACustomAnimate<{ text: string | number }> {\n declare valid: boolean;\n\n private fromNumber: number;\n private toNumber: number;\n private decimalLength: number;\n private format: string;\n private formatTemplate: string | null = null;\n\n constructor(\n from: { text: string | number },\n to: { text: string | number },\n duration: number,\n easing: EasingType,\n // 支持外部控制小数位数以及格式化\n // format控制数字本身的格式化方式\n // formatTemplate可以定义模板字符串如 \"{{var}}m\"、\"${{var}}\",两者可以同时使用\n params?: {\n decimalLength?: number;\n format?: 'percent' | 'thousandth' | 'none';\n formatTemplate?: string;\n }\n ) {\n super(from, to, duration, easing, params);\n this.decimalLength = params?.decimalLength;\n\n // 检查是否提供了格式化模板\n if (params?.formatTemplate && params.formatTemplate.includes('{{var}}')) {\n this.formatTemplate = params.formatTemplate;\n }\n }\n\n onFirstRun(): void {\n const fromProps = this.getLastProps();\n const toProps = this.getEndProps();\n const fromText = fromProps.text ?? 0;\n const toText = toProps.text ?? 0;\n\n // 初始化解析结果\n this.valid = true;\n let fromNum = 0;\n let toNum = 0;\n let fromFormat = '';\n let toFormat = '';\n let maxDecimalLength = 0;\n\n // 解析fromText\n if (typeof fromText === 'number') {\n fromNum = fromText;\n const str = fromText.toString();\n const decimalPart = str.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length);\n } else if (typeof fromText === 'string') {\n // 检查是否是百分比\n if (fromText.endsWith('%')) {\n fromFormat = '%';\n const numStr = fromText.substring(0, fromText.length - 1);\n // 去除可能的千分位逗号\n const cleanNumStr = numStr.replace(/,/g, '');\n fromNum = parseFloat(cleanNumStr) / 100;\n if (isNaN(fromNum)) {\n this.valid = false;\n return;\n }\n const decimalPart = cleanNumStr.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length + 2); // 百分比需要加2\n } else {\n // 处理普通数字或带千分位逗号的数字\n const cleanNumStr = fromText.replace(/,/g, '');\n fromNum = parseFloat(cleanNumStr);\n if (isNaN(fromNum)) {\n this.valid = false;\n return;\n }\n // 检查是否有千分位\n if (fromText.includes(',')) {\n fromFormat = ',';\n }\n const decimalPart = cleanNumStr.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length);\n }\n } else {\n this.valid = false;\n return;\n }\n\n // 解析toText\n if (typeof toText === 'number') {\n toNum = toText;\n const str = toText.toString();\n const decimalPart = str.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length);\n } else if (typeof toText === 'string') {\n // 检查是否是百分比\n if (toText.endsWith('%')) {\n toFormat = '%';\n const numStr = toText.substring(0, toText.length - 1);\n // 去除可能的千分位逗号\n const cleanNumStr = numStr.replace(/,/g, '');\n toNum = parseFloat(cleanNumStr) / 100;\n if (isNaN(toNum)) {\n this.valid = false;\n return;\n }\n const decimalPart = cleanNumStr.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length + 2); // 百分比需要加2\n } else {\n // 处理普通数字或带千分位逗号的数字\n const cleanNumStr = toText.replace(/,/g, '');\n toNum = parseFloat(cleanNumStr);\n if (isNaN(toNum)) {\n this.valid = false;\n return;\n }\n // 检查是否有千分位\n if (toText.includes(',')) {\n toFormat = ',';\n }\n const decimalPart = cleanNumStr.split('.')[1] || '';\n maxDecimalLength = Math.max(maxDecimalLength, decimalPart.length);\n }\n } else {\n this.valid = false;\n return;\n }\n\n // 设置最终格式\n // 检查是否有外部传入的格式\n if (this.params?.format) {\n // 使用外部传入的格式,将外部格式映射到内部格式\n switch (this.params.format) {\n case 'percent':\n this.format = '%';\n break;\n case 'thousandth':\n this.format = ',';\n break;\n case 'none':\n this.format = '';\n break;\n default:\n // 如果传入了未知格式,则使用自动检测的格式\n this.format = toFormat || fromFormat;\n }\n\n // 如果外部指定了百分比格式,但输入不是百分比,需要适配\n if (this.format === '%' && toFormat !== '%' && fromFormat !== '%') {\n // 不需要除以100,因为输入不是百分比\n if (this.decimalLength === undefined) {\n // 默认百分比显示2位小数\n this.decimalLength = 2;\n }\n }\n\n // 如果外部指定了不用百分比格式,但输入是百分比,需要适配\n if (this.format !== '%' && (toFormat === '%' || fromFormat === '%')) {\n // 需要乘以100,因为输入是百分比但不显示为百分比\n fromNum = fromNum * 100;\n toNum = toNum * 100;\n }\n } else {\n // 自动检测格式,优先使用toFormat,如果to没有特殊格式则使用fromFormat\n this.format = toFormat || fromFormat;\n }\n\n // 设置fromNumber和toNumber\n this.fromNumber = fromNum;\n this.toNumber = toNum;\n\n // 如果没有传入decimalLength,则根据输入格式设置\n if (this.decimalLength === undefined) {\n this.decimalLength = maxDecimalLength;\n }\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n if (!cb) {\n this.props && this.target.setAttributes(this.props as any);\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this.valid) {\n return;\n }\n // 插值计算当前数值\n const currentNumber = this.fromNumber + (this.toNumber - this.fromNumber) * ratio;\n\n // 根据格式和小数位格式化数字\n let formattedText: string | number = '';\n const format = this.format;\n\n // 首先格式化数字值(保留小数位)\n // 对于百分比,乘以100\n const adjustedNumber = format === '%' ? currentNumber * 100 : currentNumber;\n // 保留指定小数位\n const numberWithDecimals = adjustedNumber.toFixed(this.decimalLength);\n // 如果小数位全是0,转为整数\n let formattedNumber: string | number = numberWithDecimals;\n if (parseFloat(numberWithDecimals) === Math.floor(parseFloat(numberWithDecimals))) {\n formattedNumber = Math.floor(parseFloat(numberWithDecimals));\n }\n\n // 应用基本格式(百分比、千分位)\n let formattedWithBasicFormat: string | number;\n if (format === '%') {\n // 百分比格式\n formattedWithBasicFormat = `${formattedNumber}%`;\n } else if (format === ',') {\n // 千分位格式\n const parts = formattedNumber.toString().split('.');\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n formattedWithBasicFormat = parts.join('.');\n } else {\n // 普通数字格式\n formattedWithBasicFormat = formattedNumber;\n }\n\n // 应用模板(如果存在)\n if (this.formatTemplate) {\n // 使用模板格式化\n formattedText = this.formatTemplate.replace('{{var}}', formattedWithBasicFormat.toString());\n } else {\n // 不使用模板,直接使用基本格式的结果\n formattedText = formattedWithBasicFormat;\n }\n\n // 更新图形的text属性\n this.target.setAttribute('text', formattedText);\n }\n}\n"]}
@@ -80,6 +80,7 @@ class PoptipAppear extends custom_animate_1.AComponentAnimate {
80
80
  } ]
81
81
  });
82
82
  }
83
+ this.completeBind(animator);
83
84
  }
84
85
  }
85
86
 
@@ -98,7 +99,7 @@ class PoptipDisappear extends custom_animate_1.AComponentAnimate {
98
99
  },
99
100
  duration: duration,
100
101
  easing: easing
101
- });
102
+ }), this.completeBind(animator);
102
103
  }
103
104
  }
104
105
 
@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AAC,MAAa,CAAC;QAElC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE;YACvB,IAAI,EAAE,IAAI;YACV,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;YAC5B,QAAQ;YACR,MAAM;SACP,CAAC,CAAC;IACL,CAAC;CACF;AAhBD,0CAgBC","file":"poptip-animate.js","sourcesContent":["import { AComponentAnimate } from './custom-animate';\nimport { createComponentAnimator } from '../component';\nimport { InputText } from './input-text';\n\n/**\n * PoptipAppear class handles the appear animation for Poptip components\n */\nexport class PoptipAppear extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n\n const duration = this.duration;\n const easing = this.easing;\n const target = this.target as any;\n\n const { wave } = this.params;\n\n target.setAttributes({ scaleX: 0, scaleY: 0 });\n\n animator.animate(target, {\n type: 'to',\n to: { scaleX: 1, scaleY: 1 },\n duration: (duration / 3) * 2,\n easing\n });\n\n target.titleShape &&\n animator.animate(target.titleShape, {\n type: 'custom',\n to: { text: target.titleShape.attribute.text as string },\n duration,\n easing,\n custom: InputText\n });\n\n target.contentShape &&\n animator.animate(target.contentShape, {\n type: 'custom',\n to: { text: target.contentShape.attribute.text as string },\n duration,\n easing,\n custom: InputText\n });\n\n if (wave) {\n const dur = duration / 6;\n animator.animate(target.group, {\n timeSlices: [\n {\n duration: dur,\n effects: {\n type: 'to',\n to: { angle: wave },\n easing\n }\n },\n {\n duration: dur * 2,\n effects: {\n type: 'to',\n to: { angle: -wave },\n easing\n }\n },\n {\n duration: dur * 2,\n effects: {\n type: 'to',\n to: { angle: wave },\n easing\n }\n },\n {\n duration: dur,\n effects: {\n type: 'to',\n to: { angle: 0 },\n easing\n }\n }\n ]\n });\n }\n }\n}\n\n/**\n * PoptipDisappear class handles the disappear animation for Poptip components\n */\nexport class PoptipDisappear extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n\n const duration = this.duration;\n const easing = this.easing;\n const target = this.target as any;\n\n animator.animate(target, {\n type: 'to',\n to: { scaleX: 0, scaleY: 0 },\n duration,\n easing\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/custom/poptip-animate.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,4CAAuD;AACvD,6CAAyC;AAKzC,MAAa,YAAa,SAAQ,kCAAsB;IACtD,MAAM;QACJ,MAAM,QAAQ,GAAG,IAAA,mCAAuB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAa,CAAC;QAElC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,MAAM,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;QAE/C,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE;YACvB,IAAI,EAAE,IAAI;YACV,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;YAC5B,QAAQ,EAAE,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC;YAC5B,MAAM;SACP,CAAC,CAAC;QAEH,MAAM,CAAC,UAAU;YACf,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;gBAClC,IAAI,EAAE,QAAQ;gBACd,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,IAAc,EAAE;gBACxD,QAAQ;gBACR,MAAM;gBACN,MAAM,EAAE,sBAAS;aAClB,CAAC,CAAC;QAEL,MAAM,CAAC,YAAY;YACjB,QAAQ,CAAC,OAAO,CAAC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GAAG,QAAQ,CAAC;QAE1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAa,CAAC;QAElC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE;YACvB,IAAI,EAAE,IAAI;YACV,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;YAC5B,QAAQ;YACR,MAAM;SACP,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;CACF;AAlBD,0CAkBC","file":"poptip-animate.js","sourcesContent":["import { AComponentAnimate } from './custom-animate';\nimport { createComponentAnimator } from '../component';\nimport { InputText } from './input-text';\n\n/**\n * PoptipAppear class handles the appear animation for Poptip components\n */\nexport class PoptipAppear extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n\n const duration = this.duration;\n const easing = this.easing;\n const target = this.target as any;\n\n const { wave } = this.params;\n\n target.setAttributes({ scaleX: 0, scaleY: 0 });\n\n animator.animate(target, {\n type: 'to',\n to: { scaleX: 1, scaleY: 1 },\n duration: (duration / 3) * 2,\n easing\n });\n\n target.titleShape &&\n animator.animate(target.titleShape, {\n type: 'custom',\n to: { text: target.titleShape.attribute.text as string },\n duration,\n easing,\n custom: InputText\n });\n\n target.contentShape &&\n animator.animate(target.contentShape, {\n type: 'custom',\n to: { text: target.contentShape.attribute.text as string },\n duration,\n easing,\n custom: InputText\n });\n\n if (wave) {\n const dur = duration / 6;\n animator.animate(target.group, {\n timeSlices: [\n {\n duration: dur,\n effects: {\n type: 'to',\n to: { angle: wave },\n easing\n }\n },\n {\n duration: dur * 2,\n effects: {\n type: 'to',\n to: { angle: -wave },\n easing\n }\n },\n {\n duration: dur * 2,\n effects: {\n type: 'to',\n to: { angle: wave },\n easing\n }\n },\n {\n duration: dur,\n effects: {\n type: 'to',\n to: { angle: 0 },\n easing\n }\n }\n ]\n });\n }\n\n this.completeBind(animator);\n }\n}\n\n/**\n * PoptipDisappear class handles the disappear animation for Poptip components\n */\nexport class PoptipDisappear extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n\n const duration = this.duration;\n const easing = this.easing;\n const target = this.target as any;\n\n animator.animate(target, {\n type: 'to',\n to: { scaleX: 0, scaleY: 0 },\n duration,\n easing\n });\n\n this.completeBind(animator);\n }\n}\n"]}
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.registerCustomAnimate = void 0;
6
6
 
7
- const animate_executor_1 = require("../executor/animate-executor"), clip_1 = require("./clip"), fade_1 = require("./fade"), growAngle_1 = require("./growAngle"), growCenter_1 = require("./growCenter"), growHeight_1 = require("./growHeight"), growPoints_1 = require("./growPoints"), growRadius_1 = require("./growRadius"), growWidth_1 = require("./growWidth"), label_animate_1 = require("./label-animate"), label_item_animate_1 = require("./label-item-animate"), number_1 = require("./number"), poptip_animate_1 = require("./poptip-animate"), scale_1 = require("./scale"), state_1 = require("./state"), update_1 = require("./update"), registerCustomAnimate = () => {
7
+ const animate_executor_1 = require("../executor/animate-executor"), clip_1 = require("./clip"), fade_1 = require("./fade"), growAngle_1 = require("./growAngle"), growCenter_1 = require("./growCenter"), growHeight_1 = require("./growHeight"), growPoints_1 = require("./growPoints"), growRadius_1 = require("./growRadius"), growWidth_1 = require("./growWidth"), input_text_1 = require("./input-text"), label_item_animate_1 = require("./label-item-animate"), number_1 = require("./number"), poptip_animate_1 = require("./poptip-animate"), input_richtext_1 = require("./richtext/input-richtext"), output_richtext_1 = require("./richtext/output-richtext"), slide_richtext_1 = require("./richtext/slide-richtext"), slide_out_richtext_1 = require("./richtext/slide-out-richtext"), scale_1 = require("./scale"), state_1 = require("./state"), story_1 = require("./story"), update_1 = require("./update"), move_1 = require("./move"), rotate_1 = require("./rotate"), from_to_1 = require("./from-to"), registerCustomAnimate = () => {
8
8
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("increaseCount", number_1.IncreaseCount),
9
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("fromTo", from_to_1.FromTo),
9
10
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("scaleIn", scale_1.ScaleIn),
10
11
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("scaleOut", scale_1.ScaleOut),
11
12
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("growHeightIn", growHeight_1.GrowHeightIn),
@@ -28,13 +29,31 @@ const animate_executor_1 = require("../executor/animate-executor"), clip_1 = req
28
29
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("growAngleOut", growAngle_1.GrowAngleOut),
29
30
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("growRadiusIn", growRadius_1.GrowRadiusIn),
30
31
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("growRadiusOut", growRadius_1.GrowRadiusOut),
32
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("moveIn", move_1.MoveIn),
33
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("moveOut", move_1.MoveOut),
34
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("rotateIn", rotate_1.RotateIn),
35
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("rotateOut", rotate_1.RotateOut),
31
36
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("update", update_1.Update),
32
37
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("state", state_1.State),
33
38
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("labelItemAppear", label_item_animate_1.LabelItemAppear),
34
39
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("labelItemDisappear", label_item_animate_1.LabelItemDisappear),
35
40
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("poptipAppear", poptip_animate_1.PoptipAppear),
36
41
  animate_executor_1.AnimateExecutor.registerBuiltInAnimate("poptipDisappear", poptip_animate_1.PoptipDisappear),
37
- animate_executor_1.AnimateExecutor.registerBuiltInAnimate("labelUpdate", label_animate_1.LabelUpdate);
42
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("inputText", input_text_1.InputText),
43
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("inputRichText", input_richtext_1.InputRichText),
44
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("outputRichText", output_richtext_1.OutputRichText),
45
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("slideRichText", slide_richtext_1.SlideRichText),
46
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("slideOutRichText", slide_out_richtext_1.SlideOutRichText),
47
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("slideIn", story_1.SlideIn),
48
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("growIn", story_1.GrowIn),
49
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("spinIn", story_1.SpinIn),
50
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("moveScaleIn", story_1.MoveScaleIn),
51
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("moveRotateIn", story_1.MoveRotateIn),
52
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("slideOut", story_1.SlideOut),
53
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("growOut", story_1.GrowOut),
54
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("spinOut", story_1.SpinOut),
55
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("moveScaleOut", story_1.MoveScaleOut),
56
+ animate_executor_1.AnimateExecutor.registerBuiltInAnimate("moveRotateOut", story_1.MoveRotateOut);
38
57
  };
39
58
 
40
59
  exports.registerCustomAnimate = registerCustomAnimate;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/custom/register.ts"],"names":[],"mappings":";;;AAAA,mEAA+D;AAC/D,iCAAyC;AACzC,iCAAyC;AACzC,2CA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AAC,eAAe,EAAE,0BAAa,CAAC,CAAC;IACvE,kCAAe,CAAC,sBAAsB,CAAC,gBAAgB,EAAE,2BAAc,CAAC,CAAC;IACzE,kCAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,0BAAa,CAAC,CAAC;IACvE,kCAAe,CAAC,sBAAsB,CAAC,gBAAgB,EAAE,2BAAc,CAAC,CAAC;IACzE,kCAAe,CAAC,sBAAsB,CAAC,aAAa,EAAE,uBAAW,CAAC,CAAC;IACnE,kCAAe,CAAC,sBAAsB,CAAC,cAAc,EAAE,wBAAY,CAAC,CAAC;IACrE,kCAAe,CAAC,sBAAsB,CAAC,cAAc,EAAE,yBAAY,CAAC,CAAC;IACrE,kCAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,0BAAa,CAAC,CAAC;IAEvE,kCAAe,CAAC,sBAAsB,CAAC,QAAQ,EAAE,eAAM,CAAC,CAAC;IACzD,kCAAe,CAAC,sBAAsB,CAAC,OAAO,EAAE,aAAK,CAAC,CAAC;IAEvD,kCAAe,CAAC,sBAAsB,CAAC,iBAAiB,EAAE,oCAAe,CAAC,CAAC;IAC3E,kCAAe,CAAC,sBAAsB,CAAC,oBAAoB,EAAE,uCAAkB,CAAC,CAAC;IAEjF,kCAAe,CAAC,sBAAsB,CAAC,cAAc,EAAE,6BAAY,CAAC,CAAC;IACrE,kCAAe,CAAC,sBAAsB,CAAC,iBAAiB,EAAE,gCAAe,CAAC,CAAC;IAE3E,kCAAe,CAAC,sBAAsB,CAAC,aAAa,EAAE,2BAAW,CAAC,CAAC;AACrE,CAAC,CAAC;AArCW,QAAA,qBAAqB,yBAqChC","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 { LabelUpdate } from './label-animate';\nimport { LabelItemAppear, LabelItemDisappear } from './label-item-animate';\nimport { IncreaseCount } from './number';\nimport { PoptipAppear, PoptipDisappear } from './poptip-animate';\nimport { ScaleIn, ScaleOut } from './scale';\nimport { State } from './state';\nimport { Update } from './update';\n\nexport const registerCustomAnimate = () => {\n // 基础动画\n AnimateExecutor.registerBuiltInAnimate('increaseCount', IncreaseCount);\n\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 // 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 // Label update animation\n AnimateExecutor.registerBuiltInAnimate('labelUpdate', LabelUpdate);\n};\n"]}
1
+ {"version":3,"sources":["../src/custom/register.ts"],"names":[],"mappings":";;;AAAA,mEAA+D;AAC/D,iCAAyC;AACzC,iCAAyC;AACzC,2CAAwD;AACxD,6CAA2D;AAC3D,6CAA2D;AAC3D,6CAOsB;AACtB,6CAA2D;AAC3D,2CAAwD;AACxD,6CAAyC;AACzC,6DAA2E;AAC3E,qCAAyC;AACzC,qDAAiE;AACjE,8DAA0D;AAC1D,gEAA4D;AAC5D,8DAA0D;AAC1D,sEAAiE;AACjE,mCAA4C;AAC5C,mCAAgC;AAChC,mCAWiB;AACjB,qCAAkC;AAClC,iCAAyC;AACzC,qCAA+C;AAC/C,uCAAmC;AAE5B,MAAM,qBAAqB,GAAG,GAAG,EAAE;IAExC,kCAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,sBAAa,CAAC,CAAC;IAEvE,kCAAe,CAAC,sBAAsB,CAAC,QAAQ,EAAE,gBAAM,CAAC,CAAC;IACzD,kCAAe,CAAC,sBAAsB,CAAC,SAAS,EAAE,eAAO,CAAC,CAAC;IAC3D,kCAAe,CAAC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cAAM,CAAC,CAAC;IACzD,kCAAe,CAAC,sBAAsB,CAAC,QAAQ,EAAE,cAAM,CAAC,CAAC;IACzD,kCAAe,CAAC,sBAAsB,CAAC,aAAa,EAAE,mBAAW,CAAC,CAAC;IACnE,kCAAe,CAAC,sBAAsB,CAAC,cAAc,EAAE,oBAAY,CAAC,CAAC;IAGrE,kCAAe,CAAC,sBAAsB,CAAC,UAAU,EAAE,gBAAQ,CAAC,CAAC;IAC7D,kCAAe,CAAC,sBAAsB,CAAC,SAAS,EAAE,eAAO,CAAC,CAAC;IAC3D,kCAAe,CAAC,sBAAsB,CAAC,SAAS,EAAE,eAAO,CAAC,CAAC;IAC3D,kCAAe,CAAC,sBAAsB,CAAC,cAAc,EAAE,oBAAY,CAAC,CAAC;IACrE,kCAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,qBAAa,CAAC,CAAC;AACzE,CAAC,CAAC;AA7DW,QAAA,qBAAqB,yBA6DhC","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 { FromTo } from './from-to';\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"]}
@@ -0,0 +1,33 @@
1
+ import { ACustomAnimate } from '../custom-animate';
2
+ import type { IRichTextCharacter, IAnimate, IStep, EasingType } from '@visactor/vrender-core';
3
+ export declare class InputRichText extends ACustomAnimate<{
4
+ textConfig: IRichTextCharacter[];
5
+ }> {
6
+ valid: boolean;
7
+ private fromTextConfig;
8
+ private toTextConfig;
9
+ private originalTextConfig;
10
+ private showCursor;
11
+ private cursorChar;
12
+ private blinkCursor;
13
+ private beforeText;
14
+ private afterText;
15
+ private fadeInChars;
16
+ private fadeInDuration;
17
+ constructor(from: {
18
+ textConfig: IRichTextCharacter[];
19
+ }, to: {
20
+ textConfig: IRichTextCharacter[];
21
+ }, duration: number, easing: EasingType, params?: {
22
+ showCursor?: boolean;
23
+ cursorChar?: string;
24
+ blinkCursor?: boolean;
25
+ beforeText?: string;
26
+ afterText?: string;
27
+ fadeInChars?: boolean;
28
+ fadeInDuration?: number;
29
+ });
30
+ onFirstRun(): void;
31
+ onEnd(cb?: (animate: IAnimate, step: IStep) => void): void;
32
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
33
+ }