@visactor/vstory 0.0.4-alpha.2 → 0.0.5-alpha.0

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 (734) hide show
  1. package/README.md +13 -0
  2. package/cjs/animate/typewirter.d.ts +3 -4
  3. package/cjs/animate/typewirter.js +44 -30
  4. package/cjs/animate/typewirter.js.map +1 -1
  5. package/cjs/constants/action.d.ts +9 -0
  6. package/cjs/constants/action.js +10 -2
  7. package/cjs/constants/action.js.map +1 -1
  8. package/cjs/constants/character.d.ts +2 -2
  9. package/cjs/constants/character.js +2 -3
  10. package/cjs/constants/character.js.map +1 -1
  11. package/cjs/constants/config.js +2 -1
  12. package/cjs/dsl/constant/index.d.ts +13 -0
  13. package/cjs/dsl/constant/index.js +6 -1
  14. package/cjs/dsl/constant/index.js.map +1 -1
  15. package/cjs/dsl/story-chart/area.d.ts +2 -0
  16. package/cjs/dsl/story-chart/area.js +5 -1
  17. package/cjs/dsl/story-chart/area.js.map +1 -1
  18. package/cjs/dsl/story-chart/bar.d.ts +2 -0
  19. package/cjs/dsl/story-chart/bar.js +1 -1
  20. package/cjs/dsl/story-chart/bar.js.map +1 -1
  21. package/cjs/dsl/story-chart/line.d.ts +2 -0
  22. package/cjs/dsl/story-chart/line.js +2 -2
  23. package/cjs/dsl/story-chart/line.js.map +1 -1
  24. package/cjs/dsl/story-chart/pie.d.ts +2 -0
  25. package/cjs/dsl/story-chart/pie.js +4 -1
  26. package/cjs/dsl/story-chart/pie.js.map +1 -1
  27. package/cjs/dsl/story-processor/graphic/appear.js.map +1 -1
  28. package/cjs/dsl/story-processor/graphic/effect/appear.js +2 -7
  29. package/cjs/dsl/story-processor/graphic/effect/appear.js.map +1 -1
  30. package/cjs/dsl/story-processor/graphic/effect/typewriter.js +1 -1
  31. package/cjs/dsl/story-processor/graphic/effect/typewriter.js.map +1 -1
  32. package/cjs/dsl/story-processor/index.js +1 -1
  33. package/cjs/dsl/story-processor/processor.js +1 -1
  34. package/cjs/dsl/types/index.d.ts +1 -0
  35. package/cjs/dsl/types/index.js.map +1 -1
  36. package/cjs/dsl/utils/datum.js +2 -1
  37. package/cjs/dsl/utils/flicker.js +1 -1
  38. package/cjs/edit/const.d.ts +1 -3
  39. package/cjs/edit/const.js +1 -0
  40. package/cjs/edit/const.js.map +1 -1
  41. package/cjs/edit/edit-action.d.ts +9 -0
  42. package/cjs/edit/edit-action.js +61 -5
  43. package/cjs/edit/edit-action.js.map +1 -1
  44. package/cjs/edit/edit-component/base-selection.d.ts +8 -3
  45. package/cjs/edit/edit-component/base-selection.js +30 -4
  46. package/cjs/edit/edit-component/base-selection.js.map +1 -1
  47. package/cjs/edit/edit-component/chart-selection.d.ts +15 -0
  48. package/cjs/edit/edit-component/chart-selection.js +39 -0
  49. package/cjs/edit/edit-component/chart-selection.js.map +1 -0
  50. package/cjs/edit/edit-component/common.d.ts +1 -11
  51. package/cjs/edit/edit-component/common.js +1 -32
  52. package/cjs/edit/edit-component/common.js.map +1 -1
  53. package/cjs/edit/edit-component/edit-control/richtext-control.d.ts +19 -0
  54. package/cjs/edit/edit-component/edit-control/richtext-control.js +34 -0
  55. package/cjs/edit/edit-component/edit-control/richtext-control.js.map +1 -0
  56. package/cjs/edit/edit-component/edit-control/richtext-transform-control.d.ts +2 -3
  57. package/cjs/edit/edit-component/edit-control/richtext-transform-control.js +30 -32
  58. package/cjs/edit/edit-component/edit-control/richtext-transform-control.js.map +1 -1
  59. package/cjs/edit/edit-component/edit-control/transform-control.d.ts +4 -2
  60. package/cjs/edit/edit-component/edit-control/transform-control.js +10 -6
  61. package/cjs/edit/edit-component/edit-control/transform-control.js.map +1 -1
  62. package/cjs/edit/edit-component/edit-control/transform-drag.d.ts +1 -0
  63. package/cjs/edit/edit-component/edit-control/transform-drag.js +4 -2
  64. package/cjs/edit/edit-component/edit-control/transform-drag.js.map +1 -1
  65. package/cjs/edit/edit-component/image-selection.d.ts +1 -2
  66. package/cjs/edit/edit-component/image-selection.js +2 -5
  67. package/cjs/edit/edit-component/image-selection.js.map +1 -1
  68. package/cjs/edit/edit-component/index.js +4 -5
  69. package/cjs/edit/edit-component/index.js.map +1 -1
  70. package/cjs/edit/edit-component/layer-edit.js +0 -2
  71. package/cjs/edit/edit-component/mixin/richtext.d.ts +21 -0
  72. package/cjs/edit/edit-component/mixin/richtext.js +26 -0
  73. package/cjs/edit/edit-component/mixin/richtext.js.map +1 -0
  74. package/cjs/edit/edit-component/rect-selection.d.ts +8 -12
  75. package/cjs/edit/edit-component/rect-selection.js +13 -18
  76. package/cjs/edit/edit-component/rect-selection.js.map +1 -1
  77. package/cjs/edit/edit-component/richtext-selection-common.d.ts +19 -0
  78. package/cjs/edit/edit-component/richtext-selection-common.js +35 -0
  79. package/cjs/edit/edit-component/richtext-selection-common.js.map +1 -0
  80. package/cjs/edit/edit-component/richtext-selection.d.ts +0 -2
  81. package/cjs/edit/edit-component/richtext-selection.js +1 -7
  82. package/cjs/edit/edit-component/richtext-selection.js.map +1 -1
  83. package/cjs/edit/edit-component/shape-selection.d.ts +11 -0
  84. package/cjs/edit/edit-component/shape-selection.js +36 -0
  85. package/cjs/edit/edit-component/shape-selection.js.map +1 -0
  86. package/cjs/edit/edit-component/text-selection.d.ts +0 -3
  87. package/cjs/edit/edit-component/text-selection.js +3 -11
  88. package/cjs/edit/edit-component/text-selection.js.map +1 -1
  89. package/cjs/edit/edit.d.ts +5 -2
  90. package/cjs/edit/edit.js +20 -5
  91. package/cjs/edit/edit.js.map +1 -1
  92. package/cjs/edit/interface.d.ts +6 -1
  93. package/cjs/edit/interface.js +3 -1
  94. package/cjs/edit/interface.js.map +1 -1
  95. package/cjs/index.d.ts +3 -1
  96. package/cjs/index.js +2 -1
  97. package/cjs/index.js.map +1 -1
  98. package/cjs/interface/type.js +1 -2
  99. package/cjs/player/interface/player.d.ts +5 -2
  100. package/cjs/player/interface/player.js.map +1 -1
  101. package/cjs/player/interface/scheduler.d.ts +1 -1
  102. package/cjs/player/interface/scheduler.js.map +1 -1
  103. package/cjs/player/player.d.ts +7 -2
  104. package/cjs/player/player.js +31 -21
  105. package/cjs/player/player.js.map +1 -1
  106. package/cjs/player/processor/chart/common/chartAppear.d.ts +5 -0
  107. package/cjs/player/processor/chart/common/chartAppear.js +11 -0
  108. package/cjs/player/processor/chart/common/chartAppear.js.map +1 -0
  109. package/cjs/player/processor/chart/common/commonAppear.d.ts +8 -0
  110. package/cjs/player/processor/chart/common/commonAppear.js +46 -0
  111. package/cjs/player/processor/chart/common/commonAppear.js.map +1 -0
  112. package/cjs/player/processor/chart/component/axisAppear.d.ts +2 -2
  113. package/cjs/player/processor/chart/component/axisAppear.js +2 -2
  114. package/cjs/player/processor/chart/component/axisAppear.js.map +1 -1
  115. package/cjs/player/processor/chart/component/commonAppear.d.ts +3 -3
  116. package/cjs/player/processor/chart/component/commonAppear.js +5 -17
  117. package/cjs/player/processor/chart/component/commonAppear.js.map +1 -1
  118. package/cjs/player/processor/chart/component/labelAppear.d.ts +2 -2
  119. package/cjs/player/processor/chart/component/labelAppear.js +1 -1
  120. package/cjs/player/processor/chart/component/labelAppear.js.map +1 -1
  121. package/cjs/player/processor/chart/component/legendsAppear.d.ts +4 -3
  122. package/cjs/player/processor/chart/component/legendsAppear.js +2 -3
  123. package/cjs/player/processor/chart/component/legendsAppear.js.map +1 -1
  124. package/cjs/player/processor/chart/component/titleAppear.d.ts +4 -3
  125. package/cjs/player/processor/chart/component/titleAppear.js +2 -3
  126. package/cjs/player/processor/chart/component/titleAppear.js.map +1 -1
  127. package/cjs/player/processor/chart/rankingBar/rankingBar.d.ts +29 -0
  128. package/cjs/player/processor/chart/rankingBar/rankingBar.js +54 -0
  129. package/cjs/player/processor/chart/rankingBar/rankingBar.js.map +1 -0
  130. package/cjs/player/processor/chart/seriesmark/commonTransformMarkAppear.d.ts +3 -3
  131. package/cjs/player/processor/chart/seriesmark/commonTransformMarkAppear.js.map +1 -1
  132. package/cjs/player/processor/chart/seriesmark/{transformArcAppear.d.ts → transformArcVisibility.d.ts} +2 -2
  133. package/cjs/player/processor/chart/seriesmark/{transformArcAppear.js → transformArcVisibility.js} +5 -6
  134. package/cjs/player/processor/chart/seriesmark/transformArcVisibility.js.map +1 -0
  135. package/cjs/player/processor/chart/seriesmark/{transformRectAppear.d.ts → transformLineVisibility.d.ts} +2 -2
  136. package/cjs/player/processor/chart/seriesmark/transformLineVisibility.js +12 -0
  137. package/cjs/player/processor/chart/seriesmark/transformLineVisibility.js.map +1 -0
  138. package/cjs/player/processor/chart/seriesmark/{transformLineAppear.d.ts → transformRectVisibility.d.ts} +2 -2
  139. package/cjs/player/processor/chart/seriesmark/{transformRectAppear.js → transformRectVisibility.js} +6 -7
  140. package/cjs/player/processor/chart/seriesmark/transformRectVisibility.js.map +1 -0
  141. package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.d.ts +12 -0
  142. package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.js +12 -0
  143. package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.js.map +1 -0
  144. package/cjs/player/processor/chart/seriesmark/transformTextVisibility.d.ts +12 -0
  145. package/cjs/player/processor/chart/seriesmark/transformTextVisibility.js +12 -0
  146. package/cjs/player/processor/chart/seriesmark/transformTextVisibility.js.map +1 -0
  147. package/cjs/player/processor/chart/transformMap.d.ts +24 -18
  148. package/cjs/player/processor/chart/transformMap.js +8 -7
  149. package/cjs/player/processor/chart/transformMap.js.map +1 -1
  150. package/cjs/player/processor/chart/vchart.d.ts +76 -18
  151. package/cjs/player/processor/chart/vchart.js +151 -36
  152. package/cjs/player/processor/chart/vchart.js.map +1 -1
  153. package/cjs/player/processor/common/bounce-processor.d.ts +3 -0
  154. package/cjs/player/processor/common/bounce-processor.js +23 -0
  155. package/cjs/player/processor/common/bounce-processor.js.map +1 -0
  156. package/cjs/player/processor/common/common.d.ts +5 -0
  157. package/cjs/player/processor/common/common.js +20 -0
  158. package/cjs/player/processor/common/common.js.map +1 -0
  159. package/cjs/player/processor/common/fade-processor.d.ts +4 -0
  160. package/cjs/player/processor/common/fade-processor.js +36 -0
  161. package/cjs/player/processor/common/fade-processor.js.map +1 -0
  162. package/cjs/player/processor/common/move-processor.d.ts +8 -0
  163. package/cjs/player/processor/common/move-processor.js +155 -0
  164. package/cjs/player/processor/common/move-processor.js.map +1 -0
  165. package/cjs/player/processor/common/scale-processor.d.ts +8 -0
  166. package/cjs/player/processor/common/scale-processor.js +49 -0
  167. package/cjs/player/processor/common/scale-processor.js.map +1 -0
  168. package/cjs/player/processor/common/wipe-processor.d.ts +4 -0
  169. package/cjs/player/processor/common/wipe-processor.js +40 -0
  170. package/cjs/player/processor/common/wipe-processor.js.map +1 -0
  171. package/cjs/player/processor/common-processor.js +3 -0
  172. package/cjs/player/processor/common-processor.js.map +1 -0
  173. package/cjs/player/processor/component/common-component.d.ts +45 -9
  174. package/cjs/player/processor/component/common-component.js +99 -78
  175. package/cjs/player/processor/component/common-component.js.map +1 -1
  176. package/cjs/player/processor/component/image/image-visibility.d.ts +5 -0
  177. package/cjs/player/processor/component/image/image-visibility.js +16 -0
  178. package/cjs/player/processor/component/image/image-visibility.js.map +1 -0
  179. package/cjs/player/processor/component/line/line-visibility.d.ts +5 -0
  180. package/cjs/player/processor/component/line/line-visibility.js +16 -0
  181. package/cjs/player/processor/component/line/line-visibility.js.map +1 -0
  182. package/cjs/player/processor/component/rect/rect-visibility.d.ts +5 -0
  183. package/cjs/player/processor/component/rect/rect-visibility.js +16 -0
  184. package/cjs/player/processor/component/rect/rect-visibility.js.map +1 -0
  185. package/cjs/player/processor/component/shape/shape-visibility.d.ts +5 -0
  186. package/cjs/player/processor/component/shape/shape-visibility.js +16 -0
  187. package/cjs/player/processor/component/shape/shape-visibility.js.map +1 -0
  188. package/cjs/player/processor/component/text/text-visibility.d.ts +6 -0
  189. package/cjs/player/processor/component/text/text-visibility.js +41 -0
  190. package/cjs/player/processor/component/text/text-visibility.js.map +1 -0
  191. package/cjs/player/processor/component/timeline/timeline-visibility.d.ts +15 -0
  192. package/cjs/player/processor/component/timeline/timeline-visibility.js +79 -0
  193. package/cjs/player/processor/component/timeline/timeline-visibility.js.map +1 -0
  194. package/cjs/player/processor/component/utils.d.ts +3 -1
  195. package/cjs/player/processor/component/utils.js +16 -1
  196. package/cjs/player/processor/component/utils.js.map +1 -1
  197. package/cjs/player/processor/interface/action-processor.d.ts +6 -6
  198. package/cjs/player/processor/interface/action-processor.js.map +1 -1
  199. package/cjs/player/processor/interface/appear-action.d.ts +30 -18
  200. package/cjs/player/processor/interface/appear-action.js.map +1 -1
  201. package/cjs/player/processor/interface/common-action.d.ts +15 -0
  202. package/cjs/player/processor/interface/common-action.js +6 -0
  203. package/cjs/player/processor/interface/common-action.js.map +1 -0
  204. package/cjs/player/processor/interface/style-action.d.ts +33 -0
  205. package/cjs/player/processor/interface/style-action.js +6 -0
  206. package/cjs/player/processor/interface/style-action.js.map +1 -0
  207. package/cjs/player/processor/processor-item.d.ts +5 -5
  208. package/cjs/player/processor/processor-item.js.map +1 -1
  209. package/cjs/player/processor/processor.d.ts +3 -3
  210. package/cjs/player/processor/processor.js +2 -2
  211. package/cjs/player/processor/processor.js.map +1 -1
  212. package/cjs/player/processor/processorMap.d.ts +31 -21
  213. package/cjs/player/processor/processorMap.js +48 -8
  214. package/cjs/player/processor/processorMap.js.map +1 -1
  215. package/cjs/player/scheduler.d.ts +4 -3
  216. package/cjs/player/scheduler.js +16 -10
  217. package/cjs/player/scheduler.js.map +1 -1
  218. package/cjs/scene/scene.js +2 -0
  219. package/cjs/story/canvas/canvas.d.ts +4 -2
  220. package/cjs/story/canvas/canvas.js +20 -14
  221. package/cjs/story/canvas/canvas.js.map +1 -1
  222. package/cjs/story/character/base/base.d.ts +7 -4
  223. package/cjs/story/character/base/base.js +7 -4
  224. package/cjs/story/character/base/base.js.map +1 -1
  225. package/cjs/story/character/chart/character.d.ts +16 -0
  226. package/cjs/story/character/chart/character.js +59 -14
  227. package/cjs/story/character/chart/character.js.map +1 -1
  228. package/cjs/story/character/chart/characters/rankingBar.d.ts +4 -0
  229. package/cjs/story/character/chart/characters/rankingBar.js +15 -0
  230. package/cjs/story/character/chart/characters/rankingBar.js.map +1 -0
  231. package/cjs/story/character/chart/graphic/vchart-graphic-picker.js +6 -8
  232. package/cjs/story/character/chart/graphic/vchart-graphic-picker.js.map +1 -1
  233. package/cjs/story/character/chart/graphic/vchart-graphic-render.js +8 -8
  234. package/cjs/story/character/chart/graphic/vchart-graphic-render.js.map +1 -1
  235. package/cjs/story/character/chart/graphic/vchart-graphic.d.ts +13 -2
  236. package/cjs/story/character/chart/graphic/vchart-graphic.js +82 -14
  237. package/cjs/story/character/chart/graphic/vchart-graphic.js.map +1 -1
  238. package/cjs/story/character/chart/runtime/common-spec.d.ts +2 -4
  239. package/cjs/story/character/chart/runtime/common-spec.js +0 -2
  240. package/cjs/story/character/chart/runtime/common-spec.js.map +1 -1
  241. package/cjs/story/character/chart/runtime/component-spec.d.ts +4 -3
  242. package/cjs/story/character/chart/runtime/component-spec.js +7 -5
  243. package/cjs/story/character/chart/runtime/component-spec.js.map +1 -1
  244. package/cjs/story/character/chart/temp/constant.d.ts +1 -0
  245. package/cjs/story/character/chart/temp/constant.js +2 -1
  246. package/cjs/story/character/chart/temp/constant.js.map +1 -1
  247. package/cjs/story/character/chart/temp/templates/bar.d.ts +20 -0
  248. package/cjs/story/character/chart/temp/templates/bar.js +31 -0
  249. package/cjs/story/character/chart/temp/templates/bar.js.map +1 -0
  250. package/cjs/story/character/chart/temp/templates/base-temp.d.ts +6 -4
  251. package/cjs/story/character/chart/temp/templates/base-temp.js +1 -1
  252. package/cjs/story/character/chart/temp/templates/base-temp.js.map +1 -1
  253. package/cjs/story/character/chart/temp/templates/ranking-bar-temp.d.ts +8 -0
  254. package/cjs/story/character/chart/temp/templates/ranking-bar-temp.js +22 -0
  255. package/cjs/story/character/chart/temp/templates/ranking-bar-temp.js.map +1 -0
  256. package/cjs/story/character/component/character-group/component-group-graphic-render.d.ts +2 -2
  257. package/cjs/story/character/component/character-group/component-group-graphic-render.js +3 -3
  258. package/cjs/story/character/component/character-group/component-group-graphic-render.js.map +1 -1
  259. package/cjs/story/character/component/character-group/component-group-graphic.d.ts +2 -1
  260. package/cjs/story/character/component/character-group/component-group-graphic.js +12 -4
  261. package/cjs/story/character/component/character-group/component-group-graphic.js.map +1 -1
  262. package/cjs/story/character/component/character.d.ts +9 -4
  263. package/cjs/story/character/component/character.js +26 -6
  264. package/cjs/story/character/component/character.js.map +1 -1
  265. package/cjs/story/character/component/characters/character-image.d.ts +3 -0
  266. package/cjs/story/character/component/characters/character-image.js +4 -0
  267. package/cjs/story/character/component/characters/character-image.js.map +1 -1
  268. package/cjs/story/character/component/characters/character-rect.d.ts +3 -0
  269. package/cjs/story/character/component/characters/character-rect.js +4 -0
  270. package/cjs/story/character/component/characters/character-rect.js.map +1 -1
  271. package/cjs/story/character/component/characters/character-richtext.d.ts +1 -6
  272. package/cjs/story/character/component/characters/character-richtext.js +0 -16
  273. package/cjs/story/character/component/characters/character-richtext.js.map +1 -1
  274. package/cjs/story/character/component/characters/character-shape.d.ts +4 -0
  275. package/cjs/story/character/component/characters/character-shape.js +15 -0
  276. package/cjs/story/character/component/characters/character-shape.js.map +1 -1
  277. package/cjs/story/character/component/characters/character-text.js +1 -1
  278. package/cjs/story/character/component/characters/character-text.js.map +1 -1
  279. package/cjs/story/character/component/graphic/graphic-base-text.d.ts +24 -0
  280. package/cjs/story/character/component/graphic/{graphic-text.js → graphic-base-text.js} +45 -24
  281. package/cjs/story/character/component/graphic/graphic-base-text.js.map +1 -0
  282. package/cjs/story/character/component/graphic/graphic.d.ts +1 -1
  283. package/cjs/story/character/component/graphic/graphic.js.map +1 -1
  284. package/cjs/story/character/component/graphic/richtext.d.ts +1 -9
  285. package/cjs/story/character/component/graphic/richtext.js +0 -45
  286. package/cjs/story/character/component/graphic/richtext.js.map +1 -1
  287. package/cjs/story/character/component/graphic/symbol.d.ts +3 -0
  288. package/cjs/story/character/component/graphic/symbol.js +17 -3
  289. package/cjs/story/character/component/graphic/symbol.js.map +1 -1
  290. package/cjs/story/character/component/graphic/text.d.ts +4 -3
  291. package/cjs/story/character/component/graphic/text.js +21 -6
  292. package/cjs/story/character/component/graphic/text.js.map +1 -1
  293. package/cjs/story/character/component/graphic/timeline.d.ts +6 -0
  294. package/cjs/story/character/component/graphic/timeline.js +7 -1
  295. package/cjs/story/character/component/graphic/timeline.js.map +1 -1
  296. package/cjs/story/character/dsl-interface.d.ts +4 -2
  297. package/cjs/story/character/dsl-interface.js.map +1 -1
  298. package/cjs/story/character/runtime-interface.d.ts +10 -4
  299. package/cjs/story/character/runtime-interface.js.map +1 -1
  300. package/cjs/story/character/visactor/character.d.ts +20 -6
  301. package/cjs/story/character/visactor/character.js +17 -1
  302. package/cjs/story/character/visactor/character.js.map +1 -1
  303. package/cjs/story/character/visactor/interface.d.ts +1 -0
  304. package/cjs/story/character/visactor/interface.js.map +1 -1
  305. package/cjs/story/character-tree/character-tree.d.ts +1 -0
  306. package/cjs/story/character-tree/character-tree.js +6 -0
  307. package/cjs/story/character-tree/character-tree.js.map +1 -1
  308. package/cjs/story/index.js +5 -3
  309. package/cjs/story/index.js.map +1 -1
  310. package/cjs/story/interface/dsl-interface.d.ts +7 -9
  311. package/cjs/story/interface/dsl-interface.js.map +1 -1
  312. package/cjs/story/interface/player.d.ts +1 -13
  313. package/cjs/story/interface/player.js +1 -4
  314. package/cjs/story/interface/player.js.map +1 -1
  315. package/cjs/story/interface/runtime-interface.d.ts +5 -3
  316. package/cjs/story/interface/runtime-interface.js.map +1 -1
  317. package/cjs/story/story.d.ts +2 -1
  318. package/cjs/story/story.js +9 -6
  319. package/cjs/story/story.js.map +1 -1
  320. package/cjs/story/utils/layout.d.ts +2 -1
  321. package/cjs/story/utils/layout.js +2 -2
  322. package/cjs/story/utils/layout.js.map +1 -1
  323. package/cjs/story/utils/vchart-pick.d.ts +115 -0
  324. package/cjs/story/utils/vchart-pick.js +109 -0
  325. package/cjs/story/utils/vchart-pick.js.map +1 -0
  326. package/cjs/util/space.js +2 -1
  327. package/dist/index.js +50811 -0
  328. package/dist/index.min.js +20 -0
  329. package/es/animate/typewirter.d.ts +3 -4
  330. package/es/animate/typewirter.js +46 -30
  331. package/es/animate/typewirter.js.map +1 -1
  332. package/es/constants/action.d.ts +9 -0
  333. package/es/constants/action.js +11 -1
  334. package/es/constants/action.js.map +1 -1
  335. package/es/constants/character.d.ts +2 -2
  336. package/es/constants/character.js +2 -3
  337. package/es/constants/character.js.map +1 -1
  338. package/es/constants/config.js +2 -1
  339. package/es/dsl/constant/index.d.ts +13 -0
  340. package/es/dsl/constant/index.js +6 -1
  341. package/es/dsl/constant/index.js.map +1 -1
  342. package/es/dsl/story-chart/area.d.ts +2 -0
  343. package/es/dsl/story-chart/area.js +5 -1
  344. package/es/dsl/story-chart/area.js.map +1 -1
  345. package/es/dsl/story-chart/bar.d.ts +2 -0
  346. package/es/dsl/story-chart/bar.js +1 -1
  347. package/es/dsl/story-chart/bar.js.map +1 -1
  348. package/es/dsl/story-chart/line.d.ts +2 -0
  349. package/es/dsl/story-chart/line.js +2 -2
  350. package/es/dsl/story-chart/line.js.map +1 -1
  351. package/es/dsl/story-chart/pie.d.ts +2 -0
  352. package/es/dsl/story-chart/pie.js +4 -1
  353. package/es/dsl/story-chart/pie.js.map +1 -1
  354. package/es/dsl/story-processor/graphic/appear.js.map +1 -1
  355. package/es/dsl/story-processor/graphic/effect/appear.js +1 -8
  356. package/es/dsl/story-processor/graphic/effect/appear.js.map +1 -1
  357. package/es/dsl/story-processor/graphic/effect/typewriter.js +1 -1
  358. package/es/dsl/story-processor/graphic/effect/typewriter.js.map +1 -1
  359. package/es/dsl/story-processor/index.js +1 -1
  360. package/es/dsl/story-processor/processor.js +1 -1
  361. package/es/dsl/types/index.d.ts +1 -0
  362. package/es/dsl/types/index.js.map +1 -1
  363. package/es/dsl/utils/datum.js +2 -1
  364. package/es/dsl/utils/flicker.js +1 -1
  365. package/es/edit/const.d.ts +1 -3
  366. package/es/edit/const.js +1 -0
  367. package/es/edit/const.js.map +1 -1
  368. package/es/edit/edit-action.d.ts +9 -0
  369. package/es/edit/edit-action.js +63 -5
  370. package/es/edit/edit-action.js.map +1 -1
  371. package/es/edit/edit-component/base-selection.d.ts +8 -3
  372. package/es/edit/edit-component/base-selection.js +31 -3
  373. package/es/edit/edit-component/base-selection.js.map +1 -1
  374. package/es/edit/edit-component/chart-selection.d.ts +15 -0
  375. package/es/edit/edit-component/chart-selection.js +31 -0
  376. package/es/edit/edit-component/chart-selection.js.map +1 -0
  377. package/es/edit/edit-component/common.d.ts +1 -11
  378. package/es/edit/edit-component/common.js +1 -26
  379. package/es/edit/edit-component/common.js.map +1 -1
  380. package/es/edit/edit-component/edit-control/richtext-control.d.ts +19 -0
  381. package/es/edit/edit-component/edit-control/richtext-control.js +28 -0
  382. package/es/edit/edit-component/edit-control/richtext-control.js.map +1 -0
  383. package/es/edit/edit-component/edit-control/richtext-transform-control.d.ts +2 -3
  384. package/es/edit/edit-component/edit-control/richtext-transform-control.js +29 -34
  385. package/es/edit/edit-component/edit-control/richtext-transform-control.js.map +1 -1
  386. package/es/edit/edit-component/edit-control/transform-control.d.ts +4 -2
  387. package/es/edit/edit-component/edit-control/transform-control.js +10 -6
  388. package/es/edit/edit-component/edit-control/transform-control.js.map +1 -1
  389. package/es/edit/edit-component/edit-control/transform-drag.d.ts +1 -0
  390. package/es/edit/edit-component/edit-control/transform-drag.js +4 -2
  391. package/es/edit/edit-component/edit-control/transform-drag.js.map +1 -1
  392. package/es/edit/edit-component/image-selection.d.ts +1 -2
  393. package/es/edit/edit-component/image-selection.js +2 -5
  394. package/es/edit/edit-component/image-selection.js.map +1 -1
  395. package/es/edit/edit-component/index.js +7 -9
  396. package/es/edit/edit-component/index.js.map +1 -1
  397. package/es/edit/edit-component/layer-edit.js +0 -2
  398. package/es/edit/edit-component/mixin/richtext.d.ts +21 -0
  399. package/es/edit/edit-component/mixin/richtext.js +18 -0
  400. package/es/edit/edit-component/mixin/richtext.js.map +1 -0
  401. package/es/edit/edit-component/rect-selection.d.ts +8 -12
  402. package/es/edit/edit-component/rect-selection.js +14 -21
  403. package/es/edit/edit-component/rect-selection.js.map +1 -1
  404. package/es/edit/edit-component/richtext-selection-common.d.ts +19 -0
  405. package/es/edit/edit-component/richtext-selection-common.js +33 -0
  406. package/es/edit/edit-component/richtext-selection-common.js.map +1 -0
  407. package/es/edit/edit-component/richtext-selection.d.ts +0 -2
  408. package/es/edit/edit-component/richtext-selection.js +1 -7
  409. package/es/edit/edit-component/richtext-selection.js.map +1 -1
  410. package/es/edit/edit-component/shape-selection.d.ts +11 -0
  411. package/es/edit/edit-component/shape-selection.js +30 -0
  412. package/es/edit/edit-component/shape-selection.js.map +1 -0
  413. package/es/edit/edit-component/text-selection.d.ts +0 -3
  414. package/es/edit/edit-component/text-selection.js +2 -12
  415. package/es/edit/edit-component/text-selection.js.map +1 -1
  416. package/es/edit/edit.d.ts +5 -2
  417. package/es/edit/edit.js +21 -4
  418. package/es/edit/edit.js.map +1 -1
  419. package/es/edit/interface.d.ts +6 -1
  420. package/es/edit/interface.js +3 -1
  421. package/es/edit/interface.js.map +1 -1
  422. package/es/index.d.ts +3 -1
  423. package/es/index.js +5 -1
  424. package/es/index.js.map +1 -1
  425. package/es/interface/type.js +1 -2
  426. package/es/player/interface/player.d.ts +5 -2
  427. package/es/player/interface/player.js.map +1 -1
  428. package/es/player/interface/scheduler.d.ts +1 -1
  429. package/es/player/interface/scheduler.js.map +1 -1
  430. package/es/player/player.d.ts +7 -2
  431. package/es/player/player.js +33 -20
  432. package/es/player/player.js.map +1 -1
  433. package/es/player/processor/chart/common/chartAppear.d.ts +5 -0
  434. package/es/player/processor/chart/common/chartAppear.js +4 -0
  435. package/es/player/processor/chart/common/chartAppear.js.map +1 -0
  436. package/es/player/processor/chart/common/commonAppear.d.ts +8 -0
  437. package/es/player/processor/chart/common/commonAppear.js +36 -0
  438. package/es/player/processor/chart/common/commonAppear.js.map +1 -0
  439. package/es/player/processor/chart/component/axisAppear.d.ts +2 -2
  440. package/es/player/processor/chart/component/axisAppear.js +3 -1
  441. package/es/player/processor/chart/component/axisAppear.js.map +1 -1
  442. package/es/player/processor/chart/component/commonAppear.d.ts +3 -3
  443. package/es/player/processor/chart/component/commonAppear.js +3 -14
  444. package/es/player/processor/chart/component/commonAppear.js.map +1 -1
  445. package/es/player/processor/chart/component/labelAppear.d.ts +2 -2
  446. package/es/player/processor/chart/component/labelAppear.js +1 -1
  447. package/es/player/processor/chart/component/labelAppear.js.map +1 -1
  448. package/es/player/processor/chart/component/legendsAppear.d.ts +4 -3
  449. package/es/player/processor/chart/component/legendsAppear.js +2 -2
  450. package/es/player/processor/chart/component/legendsAppear.js.map +1 -1
  451. package/es/player/processor/chart/component/titleAppear.d.ts +4 -3
  452. package/es/player/processor/chart/component/titleAppear.js +2 -2
  453. package/es/player/processor/chart/component/titleAppear.js.map +1 -1
  454. package/es/player/processor/chart/rankingBar/rankingBar.d.ts +29 -0
  455. package/es/player/processor/chart/rankingBar/rankingBar.js +50 -0
  456. package/es/player/processor/chart/rankingBar/rankingBar.js.map +1 -0
  457. package/es/player/processor/chart/seriesmark/commonTransformMarkAppear.d.ts +3 -3
  458. package/es/player/processor/chart/seriesmark/commonTransformMarkAppear.js.map +1 -1
  459. package/{cjs/player/processor/chart/seriesmark/transformSymbolAppear.d.ts → es/player/processor/chart/seriesmark/transformArcVisibility.d.ts} +3 -3
  460. package/es/player/processor/chart/seriesmark/{transformArcAppear.js → transformArcVisibility.js} +3 -4
  461. package/es/player/processor/chart/seriesmark/transformArcVisibility.js.map +1 -0
  462. package/es/player/processor/chart/seriesmark/transformLineVisibility.d.ts +12 -0
  463. package/es/player/processor/chart/seriesmark/transformLineVisibility.js +4 -0
  464. package/es/player/processor/chart/seriesmark/transformLineVisibility.js.map +1 -0
  465. package/es/player/processor/chart/seriesmark/transformRectVisibility.d.ts +12 -0
  466. package/es/player/processor/chart/seriesmark/{transformRectAppear.js → transformRectVisibility.js} +4 -5
  467. package/es/player/processor/chart/seriesmark/transformRectVisibility.js.map +1 -0
  468. package/es/player/processor/chart/seriesmark/transformSymbolVisibility.d.ts +12 -0
  469. package/es/player/processor/chart/seriesmark/transformSymbolVisibility.js +4 -0
  470. package/es/player/processor/chart/seriesmark/transformSymbolVisibility.js.map +1 -0
  471. package/es/player/processor/chart/seriesmark/transformTextVisibility.d.ts +12 -0
  472. package/es/player/processor/chart/seriesmark/transformTextVisibility.js +4 -0
  473. package/es/player/processor/chart/seriesmark/transformTextVisibility.js.map +1 -0
  474. package/es/player/processor/chart/transformMap.d.ts +24 -18
  475. package/es/player/processor/chart/transformMap.js +14 -11
  476. package/es/player/processor/chart/transformMap.js.map +1 -1
  477. package/es/player/processor/chart/vchart.d.ts +76 -18
  478. package/es/player/processor/chart/vchart.js +145 -34
  479. package/es/player/processor/chart/vchart.js.map +1 -1
  480. package/es/player/processor/common/bounce-processor.d.ts +3 -0
  481. package/es/player/processor/common/bounce-processor.js +19 -0
  482. package/es/player/processor/common/bounce-processor.js.map +1 -0
  483. package/es/player/processor/common/common.d.ts +5 -0
  484. package/es/player/processor/common/common.js +12 -0
  485. package/es/player/processor/common/common.js.map +1 -0
  486. package/es/player/processor/common/fade-processor.d.ts +4 -0
  487. package/es/player/processor/common/fade-processor.js +30 -0
  488. package/es/player/processor/common/fade-processor.js.map +1 -0
  489. package/es/player/processor/common/move-processor.d.ts +8 -0
  490. package/es/player/processor/common/move-processor.js +148 -0
  491. package/es/player/processor/common/move-processor.js.map +1 -0
  492. package/es/player/processor/common/scale-processor.d.ts +8 -0
  493. package/es/player/processor/common/scale-processor.js +43 -0
  494. package/es/player/processor/common/scale-processor.js.map +1 -0
  495. package/es/player/processor/common/wipe-processor.d.ts +4 -0
  496. package/es/player/processor/common/wipe-processor.js +36 -0
  497. package/es/player/processor/common/wipe-processor.js.map +1 -0
  498. package/es/player/processor/common-processor.js +3 -0
  499. package/es/player/processor/common-processor.js.map +1 -0
  500. package/es/player/processor/component/common-component.d.ts +45 -9
  501. package/es/player/processor/component/common-component.js +97 -73
  502. package/es/player/processor/component/common-component.js.map +1 -1
  503. package/es/player/processor/component/image/image-visibility.d.ts +5 -0
  504. package/es/player/processor/component/image/image-visibility.js +8 -0
  505. package/es/player/processor/component/image/image-visibility.js.map +1 -0
  506. package/es/player/processor/component/line/line-visibility.d.ts +5 -0
  507. package/es/player/processor/component/line/line-visibility.js +8 -0
  508. package/es/player/processor/component/line/line-visibility.js.map +1 -0
  509. package/es/player/processor/component/rect/rect-visibility.d.ts +5 -0
  510. package/es/player/processor/component/rect/rect-visibility.js +8 -0
  511. package/es/player/processor/component/rect/rect-visibility.js.map +1 -0
  512. package/es/player/processor/component/shape/shape-visibility.d.ts +5 -0
  513. package/es/player/processor/component/shape/shape-visibility.js +8 -0
  514. package/es/player/processor/component/shape/shape-visibility.js.map +1 -0
  515. package/es/player/processor/component/text/text-visibility.d.ts +6 -0
  516. package/es/player/processor/component/text/text-visibility.js +39 -0
  517. package/es/player/processor/component/text/text-visibility.js.map +1 -0
  518. package/es/player/processor/component/timeline/timeline-visibility.d.ts +15 -0
  519. package/es/player/processor/component/timeline/timeline-visibility.js +71 -0
  520. package/es/player/processor/component/timeline/timeline-visibility.js.map +1 -0
  521. package/es/player/processor/component/utils.d.ts +3 -1
  522. package/es/player/processor/component/utils.js +13 -0
  523. package/es/player/processor/component/utils.js.map +1 -1
  524. package/es/player/processor/interface/action-processor.d.ts +6 -6
  525. package/es/player/processor/interface/action-processor.js.map +1 -1
  526. package/es/player/processor/interface/appear-action.d.ts +30 -18
  527. package/es/player/processor/interface/appear-action.js.map +1 -1
  528. package/es/player/processor/interface/common-action.d.ts +15 -0
  529. package/es/player/processor/interface/common-action.js +2 -0
  530. package/es/player/processor/interface/common-action.js.map +1 -0
  531. package/es/player/processor/interface/style-action.d.ts +33 -0
  532. package/es/player/processor/interface/style-action.js +2 -0
  533. package/es/player/processor/interface/style-action.js.map +1 -0
  534. package/es/player/processor/processor-item.d.ts +5 -5
  535. package/es/player/processor/processor-item.js.map +1 -1
  536. package/es/player/processor/processor.d.ts +3 -3
  537. package/es/player/processor/processor.js +2 -2
  538. package/es/player/processor/processor.js.map +1 -1
  539. package/es/player/processor/processorMap.d.ts +31 -21
  540. package/es/player/processor/processorMap.js +59 -15
  541. package/es/player/processor/processorMap.js.map +1 -1
  542. package/es/player/scheduler.d.ts +4 -3
  543. package/es/player/scheduler.js +16 -10
  544. package/es/player/scheduler.js.map +1 -1
  545. package/es/scene/scene.js +2 -0
  546. package/es/story/canvas/canvas.d.ts +4 -2
  547. package/es/story/canvas/canvas.js +21 -14
  548. package/es/story/canvas/canvas.js.map +1 -1
  549. package/es/story/character/base/base.d.ts +7 -4
  550. package/es/story/character/base/base.js +7 -4
  551. package/es/story/character/base/base.js.map +1 -1
  552. package/es/story/character/chart/character.d.ts +16 -0
  553. package/es/story/character/chart/character.js +63 -17
  554. package/es/story/character/chart/character.js.map +1 -1
  555. package/es/story/character/chart/characters/rankingBar.d.ts +4 -0
  556. package/es/story/character/chart/characters/rankingBar.js +14 -0
  557. package/es/story/character/chart/characters/rankingBar.js.map +1 -0
  558. package/es/story/character/chart/graphic/vchart-graphic-picker.js +6 -8
  559. package/es/story/character/chart/graphic/vchart-graphic-picker.js.map +1 -1
  560. package/es/story/character/chart/graphic/vchart-graphic-render.js +9 -9
  561. package/es/story/character/chart/graphic/vchart-graphic-render.js.map +1 -1
  562. package/es/story/character/chart/graphic/vchart-graphic.d.ts +13 -2
  563. package/es/story/character/chart/graphic/vchart-graphic.js +85 -13
  564. package/es/story/character/chart/graphic/vchart-graphic.js.map +1 -1
  565. package/es/story/character/chart/runtime/common-spec.d.ts +2 -4
  566. package/es/story/character/chart/runtime/common-spec.js +0 -2
  567. package/es/story/character/chart/runtime/common-spec.js.map +1 -1
  568. package/es/story/character/chart/runtime/component-spec.d.ts +4 -3
  569. package/es/story/character/chart/runtime/component-spec.js +7 -5
  570. package/es/story/character/chart/runtime/component-spec.js.map +1 -1
  571. package/es/story/character/chart/temp/constant.d.ts +1 -0
  572. package/es/story/character/chart/temp/constant.js +2 -1
  573. package/es/story/character/chart/temp/constant.js.map +1 -1
  574. package/es/story/character/chart/temp/templates/bar.d.ts +20 -0
  575. package/es/story/character/chart/temp/templates/bar.js +27 -0
  576. package/es/story/character/chart/temp/templates/bar.js.map +1 -0
  577. package/es/story/character/chart/temp/templates/base-temp.d.ts +6 -4
  578. package/es/story/character/chart/temp/templates/base-temp.js +1 -1
  579. package/es/story/character/chart/temp/templates/base-temp.js.map +1 -1
  580. package/es/story/character/chart/temp/templates/ranking-bar-temp.d.ts +8 -0
  581. package/es/story/character/chart/temp/templates/ranking-bar-temp.js +18 -0
  582. package/es/story/character/chart/temp/templates/ranking-bar-temp.js.map +1 -0
  583. package/es/story/character/component/character-group/component-group-graphic-render.d.ts +2 -2
  584. package/es/story/character/component/character-group/component-group-graphic-render.js +4 -4
  585. package/es/story/character/component/character-group/component-group-graphic-render.js.map +1 -1
  586. package/es/story/character/component/character-group/component-group-graphic.d.ts +2 -1
  587. package/es/story/character/component/character-group/component-group-graphic.js +11 -3
  588. package/es/story/character/component/character-group/component-group-graphic.js.map +1 -1
  589. package/es/story/character/component/character.d.ts +9 -4
  590. package/es/story/character/component/character.js +26 -5
  591. package/es/story/character/component/character.js.map +1 -1
  592. package/es/story/character/component/characters/character-image.d.ts +3 -0
  593. package/es/story/character/component/characters/character-image.js +4 -0
  594. package/es/story/character/component/characters/character-image.js.map +1 -1
  595. package/es/story/character/component/characters/character-rect.d.ts +3 -0
  596. package/es/story/character/component/characters/character-rect.js +4 -0
  597. package/es/story/character/component/characters/character-rect.js.map +1 -1
  598. package/es/story/character/component/characters/character-richtext.d.ts +1 -6
  599. package/es/story/character/component/characters/character-richtext.js +0 -12
  600. package/es/story/character/component/characters/character-richtext.js.map +1 -1
  601. package/es/story/character/component/characters/character-shape.d.ts +4 -0
  602. package/es/story/character/component/characters/character-shape.js +15 -0
  603. package/es/story/character/component/characters/character-shape.js.map +1 -1
  604. package/es/story/character/component/characters/character-text.js +2 -2
  605. package/es/story/character/component/characters/character-text.js.map +1 -1
  606. package/es/story/character/component/graphic/graphic-base-text.d.ts +24 -0
  607. package/es/story/character/component/graphic/{graphic-text.js → graphic-base-text.js} +44 -23
  608. package/es/story/character/component/graphic/graphic-base-text.js.map +1 -0
  609. package/es/story/character/component/graphic/graphic.d.ts +1 -1
  610. package/es/story/character/component/graphic/graphic.js.map +1 -1
  611. package/es/story/character/component/graphic/richtext.d.ts +1 -9
  612. package/es/story/character/component/graphic/richtext.js +0 -41
  613. package/es/story/character/component/graphic/richtext.js.map +1 -1
  614. package/es/story/character/component/graphic/symbol.d.ts +3 -0
  615. package/es/story/character/component/graphic/symbol.js +17 -2
  616. package/es/story/character/component/graphic/symbol.js.map +1 -1
  617. package/es/story/character/component/graphic/text.d.ts +4 -3
  618. package/es/story/character/component/graphic/text.js +21 -4
  619. package/es/story/character/component/graphic/text.js.map +1 -1
  620. package/es/story/character/component/graphic/timeline.d.ts +6 -0
  621. package/es/story/character/component/graphic/timeline.js +7 -1
  622. package/es/story/character/component/graphic/timeline.js.map +1 -1
  623. package/es/story/character/dsl-interface.d.ts +4 -2
  624. package/es/story/character/dsl-interface.js.map +1 -1
  625. package/es/story/character/runtime-interface.d.ts +10 -4
  626. package/es/story/character/runtime-interface.js.map +1 -1
  627. package/es/story/character/visactor/character.d.ts +20 -6
  628. package/es/story/character/visactor/character.js +18 -0
  629. package/es/story/character/visactor/character.js.map +1 -1
  630. package/es/story/character/visactor/interface.d.ts +1 -0
  631. package/es/story/character/visactor/interface.js.map +1 -1
  632. package/es/story/character-tree/character-tree.d.ts +1 -0
  633. package/es/story/character-tree/character-tree.js +6 -0
  634. package/es/story/character-tree/character-tree.js.map +1 -1
  635. package/es/story/index.js +7 -6
  636. package/es/story/index.js.map +1 -1
  637. package/es/story/interface/dsl-interface.d.ts +7 -9
  638. package/es/story/interface/dsl-interface.js.map +1 -1
  639. package/es/story/interface/player.d.ts +1 -13
  640. package/es/story/interface/player.js +2 -1
  641. package/es/story/interface/player.js.map +1 -1
  642. package/es/story/interface/runtime-interface.d.ts +5 -3
  643. package/es/story/interface/runtime-interface.js.map +1 -1
  644. package/es/story/story.d.ts +2 -1
  645. package/es/story/story.js +9 -6
  646. package/es/story/story.js.map +1 -1
  647. package/es/story/utils/layout.d.ts +2 -1
  648. package/es/story/utils/layout.js +2 -2
  649. package/es/story/utils/layout.js.map +1 -1
  650. package/es/story/utils/vchart-pick.d.ts +115 -0
  651. package/es/story/utils/vchart-pick.js +115 -0
  652. package/es/story/utils/vchart-pick.js.map +1 -0
  653. package/es/util/space.js +2 -1
  654. package/package.json +9 -8
  655. package/cjs/player/processor/chart/seriesmark/transformArcAppear.js.map +0 -1
  656. package/cjs/player/processor/chart/seriesmark/transformLineAppear.js +0 -14
  657. package/cjs/player/processor/chart/seriesmark/transformLineAppear.js.map +0 -1
  658. package/cjs/player/processor/chart/seriesmark/transformRectAppear.js.map +0 -1
  659. package/cjs/player/processor/chart/seriesmark/transformSymbolAppear.js +0 -14
  660. package/cjs/player/processor/chart/seriesmark/transformSymbolAppear.js.map +0 -1
  661. package/cjs/player/processor/chart/seriesmark/transformTextAppear.d.ts +0 -12
  662. package/cjs/player/processor/chart/seriesmark/transformTextAppear.js +0 -14
  663. package/cjs/player/processor/chart/seriesmark/transformTextAppear.js.map +0 -1
  664. package/cjs/player/processor/component/image/image-appear.d.ts +0 -5
  665. package/cjs/player/processor/component/image/image-appear.js +0 -16
  666. package/cjs/player/processor/component/image/image-appear.js.map +0 -1
  667. package/cjs/player/processor/component/line/line-appear.d.ts +0 -5
  668. package/cjs/player/processor/component/line/line-appear.js +0 -16
  669. package/cjs/player/processor/component/line/line-appear.js.map +0 -1
  670. package/cjs/player/processor/component/rect/rect-appear.d.ts +0 -5
  671. package/cjs/player/processor/component/rect/rect-appear.js +0 -16
  672. package/cjs/player/processor/component/rect/rect-appear.js.map +0 -1
  673. package/cjs/player/processor/component/shape/shape-appear.d.ts +0 -5
  674. package/cjs/player/processor/component/shape/shape-appear.js +0 -16
  675. package/cjs/player/processor/component/shape/shape-appear.js.map +0 -1
  676. package/cjs/player/processor/component/text/text-appear.d.ts +0 -7
  677. package/cjs/player/processor/component/text/text-appear.js +0 -34
  678. package/cjs/player/processor/component/text/text-appear.js.map +0 -1
  679. package/cjs/player/processor/component/timeline/timeline-appear.d.ts +0 -7
  680. package/cjs/player/processor/component/timeline/timeline-appear.js +0 -33
  681. package/cjs/player/processor/component/timeline/timeline-appear.js.map +0 -1
  682. package/cjs/story/character/component/graphic/graphic-text.d.ts +0 -18
  683. package/cjs/story/character/component/graphic/graphic-text.js.map +0 -1
  684. package/cjs/story/player/encode.js +0 -3
  685. package/cjs/story/player/encode.js.map +0 -1
  686. package/cjs/story/player/index.js +0 -3
  687. package/cjs/story/player/index.js.map +0 -1
  688. package/cjs/story/player/ticker.d.ts +0 -1
  689. package/cjs/story/player/ticker.js +0 -3
  690. package/cjs/story/player/ticker.js.map +0 -1
  691. package/es/player/processor/chart/seriesmark/transformArcAppear.d.ts +0 -12
  692. package/es/player/processor/chart/seriesmark/transformArcAppear.js.map +0 -1
  693. package/es/player/processor/chart/seriesmark/transformLineAppear.d.ts +0 -12
  694. package/es/player/processor/chart/seriesmark/transformLineAppear.js +0 -7
  695. package/es/player/processor/chart/seriesmark/transformLineAppear.js.map +0 -1
  696. package/es/player/processor/chart/seriesmark/transformRectAppear.d.ts +0 -12
  697. package/es/player/processor/chart/seriesmark/transformRectAppear.js.map +0 -1
  698. package/es/player/processor/chart/seriesmark/transformSymbolAppear.d.ts +0 -12
  699. package/es/player/processor/chart/seriesmark/transformSymbolAppear.js +0 -7
  700. package/es/player/processor/chart/seriesmark/transformSymbolAppear.js.map +0 -1
  701. package/es/player/processor/chart/seriesmark/transformTextAppear.d.ts +0 -12
  702. package/es/player/processor/chart/seriesmark/transformTextAppear.js +0 -7
  703. package/es/player/processor/chart/seriesmark/transformTextAppear.js.map +0 -1
  704. package/es/player/processor/component/image/image-appear.d.ts +0 -5
  705. package/es/player/processor/component/image/image-appear.js +0 -8
  706. package/es/player/processor/component/image/image-appear.js.map +0 -1
  707. package/es/player/processor/component/line/line-appear.d.ts +0 -5
  708. package/es/player/processor/component/line/line-appear.js +0 -8
  709. package/es/player/processor/component/line/line-appear.js.map +0 -1
  710. package/es/player/processor/component/rect/rect-appear.d.ts +0 -5
  711. package/es/player/processor/component/rect/rect-appear.js +0 -8
  712. package/es/player/processor/component/rect/rect-appear.js.map +0 -1
  713. package/es/player/processor/component/shape/shape-appear.d.ts +0 -5
  714. package/es/player/processor/component/shape/shape-appear.js +0 -8
  715. package/es/player/processor/component/shape/shape-appear.js.map +0 -1
  716. package/es/player/processor/component/text/text-appear.d.ts +0 -7
  717. package/es/player/processor/component/text/text-appear.js +0 -32
  718. package/es/player/processor/component/text/text-appear.js.map +0 -1
  719. package/es/player/processor/component/timeline/timeline-appear.d.ts +0 -7
  720. package/es/player/processor/component/timeline/timeline-appear.js +0 -27
  721. package/es/player/processor/component/timeline/timeline-appear.js.map +0 -1
  722. package/es/story/character/component/graphic/graphic-text.d.ts +0 -18
  723. package/es/story/character/component/graphic/graphic-text.js.map +0 -1
  724. package/es/story/player/encode.d.ts +0 -1
  725. package/es/story/player/encode.js +0 -3
  726. package/es/story/player/encode.js.map +0 -1
  727. package/es/story/player/index.d.ts +0 -1
  728. package/es/story/player/index.js +0 -3
  729. package/es/story/player/index.js.map +0 -1
  730. package/es/story/player/ticker.d.ts +0 -1
  731. package/es/story/player/ticker.js +0 -3
  732. package/es/story/player/ticker.js.map +0 -1
  733. /package/cjs/{story/player/encode.d.ts → player/processor/common-processor.d.ts} +0 -0
  734. /package/{cjs/story/player/index.d.ts → es/player/processor/common-processor.d.ts} +0 -0
@@ -8,7 +8,7 @@ export interface IGraphicConstructor {
8
8
  export declare abstract class Graphic {
9
9
  readonly containsShapePoints: boolean;
10
10
  type: string;
11
- protected _character: CharacterComponent;
11
+ protected _character: any;
12
12
  protected _graphic: IGraphic<any>;
13
13
  get graphic(): IGraphic<any>;
14
14
  constructor(type: string, character: CharacterComponent);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/graphic/graphic.ts"],"names":[],"mappings":"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","file":"graphic.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender';\nimport type { IAABBBounds, IPointLike } from '@visactor/vutils';\nimport { isValid } from '@visactor/vutils';\nimport type { CharacterComponent } from '../character';\nimport type { IComponentCharacterSpec, IWidgetData } from '../..';\nimport { getLayoutFromWidget } from '../../../utils/layout';\n\nexport interface IGraphicConstructor {\n new (type: string, character: CharacterComponent): Graphic;\n}\n\nexport abstract class Graphic {\n readonly containsShapePoints: boolean = false;\n type: string;\n\n protected _character: CharacterComponent;\n protected _graphic: IGraphic<any>;\n get graphic() {\n return this._graphic;\n }\n // protected _group: IGraphic<any>;\n\n constructor(type: string, character: CharacterComponent) {\n this.type = type;\n this._character = character;\n }\n\n abstract init(): void;\n\n getBounds(): IAABBBounds {\n return this._graphic.AABBBounds;\n }\n\n release() {\n if (this._graphic) {\n this._graphic.parent.removeChild(this._graphic);\n this._graphic = null;\n }\n }\n\n getInitialAttributes(): any {\n return {\n x: 0,\n y: 0,\n width: 120,\n height: 80,\n angle: 0,\n anchor: [60, 40],\n lineWidth: 2,\n stroke: '#000000',\n shapePoints: [] as IPointLike[]\n };\n }\n\n setAttributes(attr: Record<string, any>): void {\n if (!this._graphic) {\n return;\n }\n this._graphic.setAttributes(attr);\n }\n\n show(): void {\n this._graphic.setAttributes({\n visible: true,\n visibleAll: true\n });\n }\n hide(): void {\n this._graphic.setAttributes({\n visible: false,\n visibleAll: false\n });\n }\n\n getGraphicAttribute(): IComponentCharacterSpec['options']['graphic'] {\n return this._graphic?.attribute;\n }\n\n applyGraphicAttribute(graphicAttribute: IComponentCharacterSpec['options']['graphic']): void {\n this._graphic.setAttributes(\n this._transformAttributes({\n ...graphicAttribute\n })\n );\n }\n\n getPositionData() {\n return {\n x: this._graphic.attribute.x,\n y: this._graphic.attribute.y,\n width: this._graphic.attribute.width,\n height: this._graphic.attribute.height,\n angle: this._graphic.attribute.angle,\n shapePoints: this._graphic.attribute.shapePoints\n };\n }\n\n applyLayoutData(layoutData: Partial<IWidgetData>): void {\n this._graphic.setAttributes(\n this._transformAttributes({\n ...getLayoutFromWidget(layoutData),\n shapePoints: this._character.spec.options.shapePoints\n })\n );\n }\n\n getTextLayoutRatio(): { left: number; right: number; top: number; bottom: number } {\n return {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1\n };\n }\n\n protected _transformAttributes(attributes: any): any {\n // const x = attributes.x ?? this._graphic?.attribute.x;\n // const y = attributes.y ?? this._graphic?.attribute.y;\n const width = attributes.width ?? this._graphic?.attribute.width;\n const height = attributes.height ?? this._graphic?.attribute.height;\n\n const transformedAttributes = Object.assign({}, attributes);\n Object.keys(transformedAttributes).forEach(key => {\n if (!isValid(attributes[key])) {\n delete transformedAttributes[key];\n }\n });\n transformedAttributes.anchor = [width / 2, height / 2];\n transformedAttributes.scaleCenter = [width / 2, height / 2];\n transformedAttributes.x = 0;\n transformedAttributes.y = 0;\n return transformedAttributes;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/graphic/graphic.ts"],"names":[],"mappings":"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","file":"graphic.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender';\nimport type { IAABBBounds, IPointLike } from '@visactor/vutils';\nimport { isValid } from '@visactor/vutils';\nimport type { CharacterComponent } from '../character';\nimport type { IComponentCharacterSpec, IWidgetData } from '../..';\nimport { getLayoutFromWidget } from '../../../utils/layout';\n\nexport interface IGraphicConstructor {\n new (type: string, character: CharacterComponent): Graphic;\n}\n\nexport abstract class Graphic {\n readonly containsShapePoints: boolean = false;\n type: string;\n\n protected _character: any;\n protected _graphic: IGraphic<any>;\n get graphic() {\n return this._graphic;\n }\n // protected _group: IGraphic<any>;\n\n constructor(type: string, character: CharacterComponent) {\n this.type = type;\n this._character = character;\n }\n\n abstract init(): void;\n\n getBounds(): IAABBBounds {\n return this._graphic.AABBBounds;\n }\n\n release() {\n if (this._graphic) {\n this._graphic.parent.removeChild(this._graphic);\n this._graphic = null;\n }\n }\n\n getInitialAttributes(): any {\n return {\n x: 0,\n y: 0,\n width: 120,\n height: 80,\n angle: 0,\n anchor: [60, 40],\n lineWidth: 2,\n stroke: '#000000',\n shapePoints: [] as IPointLike[]\n };\n }\n\n setAttributes(attr: Record<string, any>): void {\n if (!this._graphic) {\n return;\n }\n this._graphic.setAttributes(attr);\n }\n\n show(): void {\n this._graphic.setAttributes({\n visible: true,\n visibleAll: true\n });\n }\n hide(): void {\n this._graphic.setAttributes({\n visible: false,\n visibleAll: false\n });\n }\n\n getGraphicAttribute(): IComponentCharacterSpec['options']['graphic'] {\n return this._graphic?.attribute;\n }\n\n applyGraphicAttribute(graphicAttribute: IComponentCharacterSpec['options']['graphic']): void {\n this._graphic.setAttributes(\n this._transformAttributes({\n ...graphicAttribute\n })\n );\n }\n\n getPositionData() {\n return {\n x: this._graphic.attribute.x,\n y: this._graphic.attribute.y,\n width: this._graphic.attribute.width,\n height: this._graphic.attribute.height,\n angle: this._graphic.attribute.angle,\n shapePoints: this._graphic.attribute.shapePoints\n };\n }\n\n applyLayoutData(layoutData: Partial<IWidgetData>): void {\n this._graphic.setAttributes(\n this._transformAttributes({\n ...getLayoutFromWidget(layoutData),\n shapePoints: this._character.spec.options.shapePoints\n })\n );\n }\n\n getTextLayoutRatio(): { left: number; right: number; top: number; bottom: number } {\n return {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1\n };\n }\n\n protected _transformAttributes(attributes: any): any {\n // const x = attributes.x ?? this._graphic?.attribute.x;\n // const y = attributes.y ?? this._graphic?.attribute.y;\n const width = attributes.width ?? this._graphic?.attribute.width;\n const height = attributes.height ?? this._graphic?.attribute.height;\n\n const transformedAttributes = Object.assign({}, attributes);\n Object.keys(transformedAttributes).forEach(key => {\n if (!isValid(attributes[key])) {\n delete transformedAttributes[key];\n }\n });\n transformedAttributes.anchor = [width / 2, height / 2];\n transformedAttributes.scaleCenter = [width / 2, height / 2];\n transformedAttributes.x = 0;\n transformedAttributes.y = 0;\n return transformedAttributes;\n }\n}\n"]}
@@ -1,9 +1 @@
1
- import type { IRichText, IRichTextAttribute } from '@visactor/vrender';
2
- import { Graphic } from './graphic';
3
- import type { IWidgetData } from '../../dsl-interface';
4
- export declare class GraphicRichText extends Graphic {
5
- protected _graphic: IRichText;
6
- getInitialAttributes(): Partial<IRichTextAttribute>;
7
- init(): void;
8
- applyLayoutData(w: Partial<IWidgetData>): void;
9
- }
1
+
@@ -1,48 +1,3 @@
1
- "use strict";
2
1
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.GraphicRichText = void 0;
6
2
 
7
- const vrender_1 = require("@visactor/vrender"), graphic_1 = require("./graphic"), layout_1 = require("../../../utils/layout");
8
-
9
- class GraphicRichText extends graphic_1.Graphic {
10
- getInitialAttributes() {
11
- return {
12
- x: 0,
13
- y: 0,
14
- width: 120,
15
- height: 80,
16
- maxWidth: 120,
17
- maxHeight: 80,
18
- angle: 0,
19
- fontSize: 16,
20
- textAlign: "center",
21
- textBaseline: "middle",
22
- fill: "#000000",
23
- lineWidth: 2,
24
- ignoreBuf: !0,
25
- stroke: !1,
26
- ellipsis: !0,
27
- textConfig: []
28
- };
29
- }
30
- init() {
31
- var _a, _b;
32
- this._graphic || (this._graphic = (0, vrender_1.createRichText)(this._transformAttributes(Object.assign(Object.assign({}, this.getInitialAttributes()), null !== (_b = null === (_a = this._character.spec.options) || void 0 === _a ? void 0 : _a.graphic) && void 0 !== _b ? _b : {}))),
33
- this._graphic.name = `graphic-richtext-${this._character.id}`, this._character.getGraphicParent().add(this._graphic));
34
- }
35
- applyLayoutData(w) {
36
- const {x: x, y: y, width: width, height: height, angle: angle} = (0, layout_1.getLayoutFromWidget)(w);
37
- this._graphic.setAttributes(this._transformAttributes({
38
- x: x,
39
- y: y,
40
- angle: angle,
41
- maxWidth: width,
42
- maxHeight: height
43
- }));
44
- }
45
- }
46
-
47
- exports.GraphicRichText = GraphicRichText;
48
3
  //# sourceMappingURL=richtext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/graphic/richtext.ts"],"names":[],"mappings":";;;AACA,+CAAmD;AACnD,uCAAoC;AAEpC,kDAA4D;AAE5D,MAAa,eAAgB,SAAQ,iBAAO;IAG1C,oBAAoB;QAClB,OAAO;YACL,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,GAAG;YACb,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,QAAQ;YACnB,YAAY,EAAE,QAAQ;YACtB,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,EAAE;SACgB,CAAC;IACnC,CAAC;IAED,IAAI;;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAA,wBAAc,EAC5B,IAAI,CAAC,oBAAoB,iCACpB,IAAI,CAAC,oBAAoB,EAAE,GAC3B,CAAC,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,0CAAE,OAAO,mCAAI,EAAE,CAAC,EAChD,CACH,CAAC;YACF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,oBAAoB,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YAC9D,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACvD;IACH,CAAC;IAED,eAAe,CAAC,CAAuB;QACrC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,4BAAmB,EAAC,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,QAAQ,CAAC,aAAa,CACzB,IAAI,CAAC,oBAAoB,CAAC;YACxB,CAAC;YACD,CAAC;YACD,KAAK;YACL,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,MAAM;SAClB,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AAjDD,0CAiDC","file":"richtext.js","sourcesContent":["import type { IRichText, IRichTextAttribute } from '@visactor/vrender';\nimport { createRichText } from '@visactor/vrender';\nimport { Graphic } from './graphic';\nimport type { IWidgetData } from '../../dsl-interface';\nimport { getLayoutFromWidget } from '../../../utils/layout';\n\nexport class GraphicRichText extends Graphic {\n protected _graphic: IRichText;\n\n getInitialAttributes() {\n return {\n x: 0,\n y: 0,\n width: 120,\n height: 80,\n maxWidth: 120,\n maxHeight: 80,\n angle: 0,\n fontSize: 16,\n textAlign: 'center',\n textBaseline: 'middle',\n fill: '#000000',\n lineWidth: 2,\n ignoreBuf: true,\n stroke: false,\n ellipsis: true,\n textConfig: []\n } as Partial<IRichTextAttribute>;\n }\n\n init() {\n if (!this._graphic) {\n this._graphic = createRichText(\n this._transformAttributes({\n ...this.getInitialAttributes(),\n ...(this._character.spec.options?.graphic ?? {})\n })\n );\n this._graphic.name = `graphic-richtext-${this._character.id}`;\n this._character.getGraphicParent().add(this._graphic);\n }\n }\n\n applyLayoutData(w: Partial<IWidgetData>) {\n const { x, y, width, height, angle } = getLayoutFromWidget(w);\n this._graphic.setAttributes(\n this._transformAttributes({\n x,\n y,\n angle,\n maxWidth: width,\n maxHeight: height\n })\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/graphic/richtext.ts"],"names":[],"mappings":"","file":"richtext.js","sourcesContent":["// import type { IRichText, IRichTextAttribute } from '@visactor/vrender';\n// import { createRichText } from '@visactor/vrender';\n// import { Graphic } from './graphic';\n// import type { IWidgetData } from '../../dsl-interface';\n// import { getLayoutFromWidget } from '../../../utils/layout';\n\n// export class GraphicRichText extends Graphic {\n// protected _graphic: IRichText;\n\n// getInitialAttributes() {\n// return {\n// x: 0,\n// y: 0,\n// width: 120,\n// height: 80,\n// maxWidth: 120,\n// maxHeight: 80,\n// angle: 0,\n// fontSize: 16,\n// textAlign: 'center',\n// textBaseline: 'middle',\n// fill: '#000000',\n// lineWidth: 2,\n// ignoreBuf: true,\n// stroke: false,\n// ellipsis: true,\n// textConfig: []\n// } as Partial<IRichTextAttribute>;\n// }\n\n// init() {\n// if (!this._graphic) {\n// this._graphic = createRichText(\n// this._transformAttributes({\n// ...this.getInitialAttributes(),\n// ...(this._character.spec.options?.graphic ?? {})\n// })\n// );\n// this._graphic.name = `graphic-richtext-${this._character.id}`;\n// this._character.getGraphicParent().add(this._graphic);\n// }\n// }\n\n// applyLayoutData(w: Partial<IWidgetData>) {\n// const { x, y, width, height, angle } = getLayoutFromWidget(w);\n// this._graphic.setAttributes(\n// this._transformAttributes({\n// x,\n// y,\n// angle,\n// maxWidth: width,\n// maxHeight: height\n// })\n// );\n// }\n// }\n"]}
@@ -1,6 +1,7 @@
1
1
  import type { ISymbol } from '@visactor/vrender';
2
2
  import type { IPointLike } from '@visactor/vutils';
3
3
  import { Graphic } from './graphic';
4
+ import type { IWidgetData } from '../../dsl-interface';
4
5
  export declare class GraphicSymbol extends Graphic {
5
6
  protected _graphic: ISymbol;
6
7
  getInitialAttributes(): {
@@ -16,4 +17,6 @@ export declare class GraphicSymbol extends Graphic {
16
17
  symbolType: string;
17
18
  };
18
19
  init(): void;
20
+ applyLayoutData(layoutData: Partial<IWidgetData>): void;
21
+ protected _transformAttributes(attributes: any): any;
19
22
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.GraphicSymbol = void 0;
6
6
 
7
- const vrender_1 = require("@visactor/vrender"), graphic_1 = require("./graphic");
7
+ const vrender_1 = require("@visactor/vrender"), graphic_1 = require("./graphic"), layout_1 = require("../../../utils/layout");
8
8
 
9
9
  class GraphicSymbol extends graphic_1.Graphic {
10
10
  getInitialAttributes() {
@@ -23,8 +23,22 @@ class GraphicSymbol extends graphic_1.Graphic {
23
23
  }
24
24
  init() {
25
25
  var _a, _b;
26
- this._graphic || (this._graphic = (0, vrender_1.createSymbol)(this._transformAttributes(Object.assign(Object.assign({}, this.getInitialAttributes()), null !== (_b = null === (_a = this._character.spec.options) || void 0 === _a ? void 0 : _a.graphic) && void 0 !== _b ? _b : {}))),
27
- this._graphic.name = `graphic-symbol-${this._character.id}`, this._character.getGraphicParent().add(this._graphic));
26
+ if (!this._graphic) {
27
+ const attributes = this._transformAttributes(Object.assign(Object.assign({}, this.getInitialAttributes()), null !== (_b = null === (_a = this._character.spec.options) || void 0 === _a ? void 0 : _a.graphic) && void 0 !== _b ? _b : {}));
28
+ this._graphic = (0, vrender_1.createSymbol)(attributes), this._graphic.name = `graphic-symbol-${this._character.id}`,
29
+ this._character.getGraphicParent().add(this._graphic);
30
+ }
31
+ }
32
+ applyLayoutData(layoutData) {
33
+ const attributes = this._transformAttributes(Object.assign(Object.assign({}, (0,
34
+ layout_1.getLayoutFromWidget)(layoutData)), {
35
+ shapePoints: this._character.spec.options.shapePoints
36
+ }));
37
+ attributes.size = Math.min(attributes.width, attributes.height), this._graphic.setAttributes(attributes);
38
+ }
39
+ _transformAttributes(attributes) {
40
+ const data = super._transformAttributes(attributes), {width: width, height: height} = attributes;
41
+ return data.x = width / 2, data.y = height / 2, data;
28
42
  }
29
43
  }
30
44
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/graphic/symbol.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AAEjD,uCAAoC;AAEpC,MAAa,aAAc,SAAQ,iBAAO;IAGxC,oBAAoB;QAClB,OAAO;YACL,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;YAChB,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,SAAS;YACjB,WAAW,EAAE,EAAkB;YAC/B,UAAU,EAAE,QAAQ;SACrB,CAAC;IACJ,CAAC;IAED,IAAI;;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAA,sBAAY,EAC1B,IAAI,CAAC,oBAAoB,iCACpB,IAAI,CAAC,oBAAoB,EAAE,GAC3B,CAAC,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,0CAAE,OAAO,mCAAI,EAAE,CAAC,EAChD,CACH,CAAC;YACF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,kBAAkB,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YAC5D,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACvD;IACH,CAAC;CACF;AA9BD,sCA8BC","file":"symbol.js","sourcesContent":["import type { ISymbol } from '@visactor/vrender';\nimport { createSymbol } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport { Graphic } from './graphic';\n\nexport class GraphicSymbol extends Graphic {\n protected _graphic: ISymbol;\n\n getInitialAttributes() {\n return {\n x: 0,\n y: 0,\n width: 120,\n height: 80,\n angle: 0,\n anchor: [60, 40],\n lineWidth: 2,\n stroke: '#000000',\n shapePoints: [] as IPointLike[],\n symbolType: 'circle'\n };\n }\n\n init() {\n if (!this._graphic) {\n this._graphic = createSymbol(\n this._transformAttributes({\n ...this.getInitialAttributes(),\n ...(this._character.spec.options?.graphic ?? {})\n })\n );\n this._graphic.name = `graphic-symbol-${this._character.id}`;\n this._character.getGraphicParent().add(this._graphic);\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/graphic/symbol.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AAEjD,uCAAoC;AAEpC,kDAA4D;AAE5D,MAAa,aAAc,SAAQ,iBAAO;IAGxC,oBAAoB;QAClB,OAAO;YACL,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;YAChB,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,SAAS;YACjB,WAAW,EAAE,EAAkB;YAC/B,UAAU,EAAE,QAAQ;SACrB,CAAC;IACJ,CAAC;IAED,IAAI;;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,MAAM,UAAU,GAAG,IAAI,CAAC,oBAAoB,iCACvC,IAAI,CAAC,oBAAoB,EAAE,GAC3B,CAAC,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,0CAAE,OAAO,mCAAI,EAAE,CAAC,EAChD,CAAC;YACH,IAAI,CAAC,QAAQ,GAAG,IAAA,sBAAY,EAAC,UAAU,CAAC,CAAC;YACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,kBAAkB,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YAC5D,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACvD;IACH,CAAC;IAED,eAAe,CAAC,UAAgC;QAC9C,MAAM,UAAU,GAAG,IAAI,CAAC,oBAAoB,iCACvC,IAAA,4BAAmB,EAAC,UAAU,CAAC,KAClC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,IACrD,CAAC;QACH,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QAEhE,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAES,oBAAoB,CAAC,UAAe;QAC5C,MAAM,IAAI,GAAG,KAAK,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACpD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QACrC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/CD,sCA+CC","file":"symbol.js","sourcesContent":["import type { ISymbol } from '@visactor/vrender';\nimport { createSymbol } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport { Graphic } from './graphic';\nimport type { IWidgetData } from '../../dsl-interface';\nimport { getLayoutFromWidget } from '../../../utils/layout';\n\nexport class GraphicSymbol extends Graphic {\n protected _graphic: ISymbol;\n\n getInitialAttributes() {\n return {\n x: 0,\n y: 0,\n width: 120,\n height: 80,\n angle: 0,\n anchor: [60, 40],\n lineWidth: 2,\n stroke: '#000000',\n shapePoints: [] as IPointLike[],\n symbolType: 'circle'\n };\n }\n\n init() {\n if (!this._graphic) {\n const attributes = this._transformAttributes({\n ...this.getInitialAttributes(),\n ...(this._character.spec.options?.graphic ?? {})\n });\n this._graphic = createSymbol(attributes);\n this._graphic.name = `graphic-symbol-${this._character.id}`;\n this._character.getGraphicParent().add(this._graphic);\n }\n }\n\n applyLayoutData(layoutData: Partial<IWidgetData>): void {\n const attributes = this._transformAttributes({\n ...getLayoutFromWidget(layoutData),\n shapePoints: this._character.spec.options.shapePoints\n });\n attributes.size = Math.min(attributes.width, attributes.height);\n\n this._graphic.setAttributes(attributes);\n }\n\n protected _transformAttributes(attributes: any): any {\n const data = super._transformAttributes(attributes);\n const { width, height } = attributes;\n data.x = width / 2;\n data.y = height / 2;\n return data;\n }\n}\n"]}
@@ -1,9 +1,9 @@
1
- import type { IText } from '@visactor/vrender';
1
+ import type { IRichText } from '@visactor/vrender';
2
2
  import type { IPointLike } from '@visactor/vutils';
3
3
  import { Graphic } from './graphic';
4
4
  import type { IWidgetData } from '../../dsl-interface';
5
- export declare class GraphicPureText extends Graphic {
6
- protected _graphic: IText;
5
+ export declare class GraphicText extends Graphic {
6
+ protected _graphic: IRichText;
7
7
  getInitialAttributes(): {
8
8
  x: number;
9
9
  y: number;
@@ -19,6 +19,7 @@ export declare class GraphicPureText extends Graphic {
19
19
  stroke: boolean;
20
20
  shapePoints: IPointLike[];
21
21
  };
22
+ transformTextAttrsToRichTextConfig(): import("@visactor/vrender").IRichTextCharacter[];
22
23
  init(): void;
23
24
  applyLayoutData(w: Partial<IWidgetData>): void;
24
25
  }
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.GraphicPureText = void 0;
5
+ }), exports.GraphicText = void 0;
6
6
 
7
- const vrender_1 = require("@visactor/vrender"), graphic_1 = require("./graphic"), layout_1 = require("../../../utils/layout");
7
+ const vrender_1 = require("@visactor/vrender"), graphic_1 = require("./graphic"), layout_1 = require("../../../utils/layout"), richtextCombinedAttrs = [ "fill", "stroke", "fontSize", "fontFamily", "fontStyle", "fontWeight", "lineWidth", "opacity", "fillOpacity", "strokeOpacity" ];
8
8
 
9
- class GraphicPureText extends graphic_1.Graphic {
9
+ class GraphicText extends graphic_1.Graphic {
10
10
  getInitialAttributes() {
11
11
  return {
12
12
  x: 0,
@@ -24,10 +24,25 @@ class GraphicPureText extends graphic_1.Graphic {
24
24
  shapePoints: []
25
25
  };
26
26
  }
27
+ transformTextAttrsToRichTextConfig() {
28
+ var _a, _b;
29
+ const textAttr = null !== (_b = null === (_a = this._character.spec.options) || void 0 === _a ? void 0 : _a.graphic) && void 0 !== _b ? _b : {};
30
+ let textConfig = textAttr.textConfig;
31
+ if ((!textConfig || !textConfig.length) && textAttr.text) {
32
+ const textList = Array.isArray(textAttr.text) ? textAttr.text : [ textAttr.text ];
33
+ textConfig = textList.map(((item, i) => ({
34
+ textAlign: textAttr.textAlign,
35
+ textBaseline: textAttr.textBaseline,
36
+ text: item + (i < textList.length - 1 ? "\n" : "")
37
+ })));
38
+ }
39
+ return textConfig;
40
+ }
27
41
  init() {
28
42
  var _a, _b;
29
- this._graphic || (this._graphic = (0, vrender_1.createText)(this._transformAttributes(Object.assign(Object.assign({}, this.getInitialAttributes()), null !== (_b = null === (_a = this._character.spec.options) || void 0 === _a ? void 0 : _a.graphic) && void 0 !== _b ? _b : {}))),
30
- this._graphic.name = `graphic-text-${this._character.id}`, this._character.getGraphicParent().add(this._graphic));
43
+ this._graphic || (this._graphic = (0, vrender_1.createRichText)(this._transformAttributes(Object.assign(Object.assign(Object.assign({}, this.getInitialAttributes()), null !== (_b = null === (_a = this._character.spec.options) || void 0 === _a ? void 0 : _a.graphic) && void 0 !== _b ? _b : {}), {
44
+ textConfig: this.transformTextAttrsToRichTextConfig()
45
+ }))), this._graphic.name = `graphic-text-${this._character.id}`, this._character.getGraphicParent().add(this._graphic));
31
46
  }
32
47
  applyLayoutData(w) {
33
48
  const {x: x, y: y, width: width, height: height, angle: angle} = (0, layout_1.getLayoutFromWidget)(w);
@@ -43,5 +58,5 @@ class GraphicPureText extends graphic_1.Graphic {
43
58
  }
44
59
  }
45
60
 
46
- exports.GraphicPureText = GraphicPureText;
61
+ exports.GraphicText = GraphicText;
47
62
  //# sourceMappingURL=text.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/graphic/text.ts"],"names":[],"mappings":";;;AACA,+CAA+C;AAE/C,uCAAoC;AAEpC,kDAA4D;AAE5D,MAAa,eAAgB,SAAQ,iBAAO;IAG1C,oBAAoB;QAClB,OAAO;YACL,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,QAAQ;YACnB,YAAY,EAAE,QAAQ;YACtB,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,EAAkB;SAChC,CAAC;IACJ,CAAC;IAED,IAAI;;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAA,oBAAU,EACxB,IAAI,CAAC,oBAAoB,iCACpB,IAAI,CAAC,oBAAoB,EAAE,GAC3B,CAAC,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,0CAAE,OAAO,mCAAI,EAAE,CAAC,EAChD,CACH,CAAC;YACF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,gBAAgB,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YAC1D,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACvD;IACH,CAAC;IAED,eAAe,CAAC,CAAuB;QACrC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,4BAAmB,EAAC,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,QAAQ,CAAC,aAAa,CACzB,IAAI,CAAC,oBAAoB,CAAC;YACxB,CAAC;YACD,CAAC;YACD,KAAK;YACL,KAAK;YACL,MAAM;YACN,YAAY,EAAE,KAAK;YACnB,WAAW,EAAE,MAAM;SACpB,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AAhDD,0CAgDC","file":"text.js","sourcesContent":["import type { IText } from '@visactor/vrender';\nimport { createText } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport { Graphic } from './graphic';\nimport type { IWidgetData } from '../../dsl-interface';\nimport { getLayoutFromWidget } from '../../../utils/layout';\n\nexport class GraphicPureText extends Graphic {\n protected _graphic: IText;\n\n getInitialAttributes() {\n return {\n x: 0,\n y: 0,\n width: 120,\n height: 80,\n angle: 0,\n fontSize: 16,\n textAlign: 'center',\n textBaseline: 'middle',\n fill: '#000000',\n lineWidth: 2,\n ignoreBuf: true,\n stroke: false,\n shapePoints: [] as IPointLike[]\n };\n }\n\n init() {\n if (!this._graphic) {\n this._graphic = createText(\n this._transformAttributes({\n ...this.getInitialAttributes(),\n ...(this._character.spec.options?.graphic ?? {})\n })\n );\n this._graphic.name = `graphic-text-${this._character.id}`;\n this._character.getGraphicParent().add(this._graphic);\n }\n }\n\n applyLayoutData(w: Partial<IWidgetData>) {\n const { x, y, width, height, angle } = getLayoutFromWidget(w);\n this._graphic.setAttributes(\n this._transformAttributes({\n x,\n y,\n angle,\n width,\n height,\n maxLineWidth: width,\n heightLimit: height\n })\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/graphic/text.ts"],"names":[],"mappings":";;;AACA,+CAA+D;AAE/D,uCAAoC;AAEpC,kDAA4D;AAE5D,MAAM,qBAAqB,GAAG;IAC5B,MAAM;IACN,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,WAAW;IACX,SAAS;IACT,aAAa;IACb,eAAe;CAChB,CAAC;AAEF,MAAa,WAAY,SAAQ,iBAAO;IAGtC,oBAAoB;QAClB,OAAO;YACL,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,QAAQ;YACnB,YAAY,EAAE,QAAQ;YACtB,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,EAAkB;SAChC,CAAC;IACJ,CAAC;IAED,kCAAkC;;QAChC,MAAM,QAAQ,GAAG,CAAC,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,0CAAE,OAAO,mCAAI,EAAE,CAA8B,CAAC;QAC5F,IAAI,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;QAGrC,IAAI,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,EAAE;YACvD,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAChF,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;gBACpC,OAAO;oBACL,SAAS,EAAE,QAAQ,CAAC,SAAS;oBAC7B,YAAY,EAAE,QAAQ,CAAC,YAAY;oBAEnC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;iBACnD,CAAC;YACJ,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAI;;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAA,wBAAc,EAC5B,IAAI,CAAC,oBAAoB,+CACpB,IAAI,CAAC,oBAAoB,EAAE,GAC3B,CAAC,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,0CAAE,OAAO,mCAAI,EAAE,CAAC,KAChD,UAAU,EAAE,IAAI,CAAC,kCAAkC,EAAE,IACrD,CACH,CAAC;YACF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,gBAAgB,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YAC1D,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACvD;IACH,CAAC;IAED,eAAe,CAAC,CAAuB;QACrC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,4BAAmB,EAAC,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,QAAQ,CAAC,aAAa,CACzB,IAAI,CAAC,oBAAoB,CAAC;YACxB,CAAC;YACD,CAAC;YACD,KAAK;YACL,KAAK;YACL,MAAM;YACN,YAAY,EAAE,KAAK;YACnB,WAAW,EAAE,MAAM;SACpB,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AArED,kCAqEC","file":"text.js","sourcesContent":["import type { IRichText, IRichTextGraphicAttribute, IText } from '@visactor/vrender';\nimport { createRichText, createText } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport { Graphic } from './graphic';\nimport type { IWidgetData } from '../../dsl-interface';\nimport { getLayoutFromWidget } from '../../../utils/layout';\n\nconst richtextCombinedAttrs = [\n 'fill',\n 'stroke',\n 'fontSize',\n 'fontFamily',\n 'fontStyle',\n 'fontWeight',\n 'lineWidth',\n 'opacity',\n 'fillOpacity',\n 'strokeOpacity'\n];\n\nexport class GraphicText extends Graphic {\n protected _graphic: IRichText;\n\n getInitialAttributes() {\n return {\n x: 0,\n y: 0,\n width: 120,\n height: 80,\n angle: 0,\n fontSize: 16,\n textAlign: 'center',\n textBaseline: 'middle',\n fill: '#000000',\n lineWidth: 2,\n ignoreBuf: true,\n stroke: false,\n shapePoints: [] as IPointLike[]\n };\n }\n\n transformTextAttrsToRichTextConfig() {\n const textAttr = (this._character.spec.options?.graphic ?? {}) as IRichTextGraphicAttribute;\n let textConfig = textAttr.textConfig;\n\n // 如果是纯文本定义方式\n if (!(textConfig && textConfig.length) && textAttr.text) {\n const textList = Array.isArray(textAttr.text) ? textAttr.text : [textAttr.text];\n textConfig = textList.map((item, i) => {\n return {\n textAlign: textAttr.textAlign,\n textBaseline: textAttr.textBaseline,\n // ...((textAttr || {}) as any),\n text: item + (i < textList.length - 1 ? '\\n' : '')\n };\n });\n }\n\n return textConfig;\n }\n\n init() {\n if (!this._graphic) {\n this._graphic = createRichText(\n this._transformAttributes({\n ...this.getInitialAttributes(),\n ...(this._character.spec.options?.graphic ?? {}),\n textConfig: this.transformTextAttrsToRichTextConfig()\n })\n );\n this._graphic.name = `graphic-text-${this._character.id}`;\n this._character.getGraphicParent().add(this._graphic);\n }\n }\n\n applyLayoutData(w: Partial<IWidgetData>) {\n const { x, y, width, height, angle } = getLayoutFromWidget(w);\n this._graphic.setAttributes(\n this._transformAttributes({\n x,\n y,\n angle,\n width,\n height,\n maxLineWidth: width,\n heightLimit: height\n })\n );\n }\n}\n"]}
@@ -7,6 +7,12 @@ export declare class GraphicTimeline extends Graphic {
7
7
  x: number;
8
8
  y: number;
9
9
  clipRange: number;
10
+ activeSymbolStyle: {
11
+ size: number;
12
+ };
13
+ activeLineStyle: {
14
+ lineWidth: number;
15
+ };
10
16
  };
11
17
  init(): void;
12
18
  applyLayoutData(w: Partial<IWidgetData>): void;
@@ -11,7 +11,13 @@ class GraphicTimeline extends graphic_1.Graphic {
11
11
  return {
12
12
  x: 0,
13
13
  y: 0,
14
- clipRange: 0
14
+ clipRange: 0,
15
+ activeSymbolStyle: {
16
+ size: 26
17
+ },
18
+ activeLineStyle: {
19
+ lineWidth: 1.5
20
+ }
15
21
  };
16
22
  }
17
23
  init() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/graphic/timeline.ts"],"names":[],"mappings":";;;AAAA,qEAAwD;AAGxD,uCAAoC;AAEpC,kDAA4D;AAE5D,MAAa,eAAgB,SAAQ,iBAAO;IAG1C,oBAAoB;QAClB,OAAO;YACL,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,SAAS,EAAE,CAAC;SACb,CAAC;IACJ,CAAC;IAED,IAAI;;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,6BAAQ,CAC1B,IAAI,CAAC,oBAAoB,iCACpB,IAAI,CAAC,oBAAoB,EAAE,GAC3B,CAAC,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,0CAAE,OAAO,mCAAI,EAAE,CAAC,EAChD,CACH,CAAC;YACF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,YAAY,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YACtD,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACvD;IACH,CAAC;IAED,eAAe,CAAC,CAAuB;QACrC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,4BAAmB,EAAC,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,QAAQ,CAAC,aAAa,CACzB,IAAI,CAAC,oBAAoB,CAAC;YACxB,CAAC;YACD,CAAC;YACD,KAAK;YACL,KAAK;YACL,MAAM;SACP,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AApCD,0CAoCC","file":"timeline.js","sourcesContent":["import { Timeline } from '@visactor/vrender-components';\nimport { createText } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport { Graphic } from './graphic';\nimport type { IWidgetData } from '../../dsl-interface';\nimport { getLayoutFromWidget } from '../../../utils/layout';\n\nexport class GraphicTimeline extends Graphic {\n protected _graphic: Timeline;\n\n getInitialAttributes() {\n return {\n x: 0,\n y: 0,\n clipRange: 0\n };\n }\n\n init() {\n if (!this._graphic) {\n this._graphic = new Timeline(\n this._transformAttributes({\n ...this.getInitialAttributes(),\n ...(this._character.spec.options?.graphic ?? {})\n })\n );\n this._graphic.name = `timeline-${this._character.id}`;\n this._character.getGraphicParent().add(this._graphic);\n }\n }\n\n applyLayoutData(w: Partial<IWidgetData>) {\n const { x, y, width, height, angle } = getLayoutFromWidget(w);\n this._graphic.setAttributes(\n this._transformAttributes({\n x,\n y,\n angle,\n width,\n height\n })\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/graphic/timeline.ts"],"names":[],"mappings":";;;AAAA,qEAAwD;AAGxD,uCAAoC;AAEpC,kDAA4D;AAE5D,MAAa,eAAgB,SAAQ,iBAAO;IAG1C,oBAAoB;QAClB,OAAO;YACL,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,SAAS,EAAE,CAAC;YACZ,iBAAiB,EAAE;gBACjB,IAAI,EAAE,EAAE;aACT;YACD,eAAe,EAAE;gBACf,SAAS,EAAE,GAAG;aACf;SACF,CAAC;IACJ,CAAC;IAED,IAAI;;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,6BAAQ,CAC1B,IAAI,CAAC,oBAAoB,iCACpB,IAAI,CAAC,oBAAoB,EAAE,GAC3B,CAAC,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,0CAAE,OAAO,mCAAI,EAAE,CAAC,EAChD,CACH,CAAC;YACF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,YAAY,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YACtD,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACvD;IACH,CAAC;IAED,eAAe,CAAC,CAAuB;QACrC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,4BAAmB,EAAC,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,QAAQ,CAAC,aAAa,CACzB,IAAI,CAAC,oBAAoB,CAAC;YACxB,CAAC;YACD,CAAC;YACD,KAAK;YACL,KAAK;YACL,MAAM;SACP,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AA1CD,0CA0CC","file":"timeline.js","sourcesContent":["import { Timeline } from '@visactor/vrender-components';\nimport { createText } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport { Graphic } from './graphic';\nimport type { IWidgetData } from '../../dsl-interface';\nimport { getLayoutFromWidget } from '../../../utils/layout';\n\nexport class GraphicTimeline extends Graphic {\n protected _graphic: Timeline;\n\n getInitialAttributes() {\n return {\n x: 0,\n y: 0,\n clipRange: 0,\n activeSymbolStyle: {\n size: 26\n },\n activeLineStyle: {\n lineWidth: 1.5\n }\n };\n }\n\n init() {\n if (!this._graphic) {\n this._graphic = new Timeline(\n this._transformAttributes({\n ...this.getInitialAttributes(),\n ...(this._character.spec.options?.graphic ?? {})\n })\n );\n this._graphic.name = `timeline-${this._character.id}`;\n this._character.getGraphicParent().add(this._graphic);\n }\n }\n\n applyLayoutData(w: Partial<IWidgetData>) {\n const { x, y, width, height, angle } = getLayoutFromWidget(w);\n this._graphic.setAttributes(\n this._transformAttributes({\n x,\n y,\n angle,\n width,\n height\n })\n );\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
- import type { ITextGraphicAttribute } from '@visactor/vrender';
1
+ import type { IInitOption } from '@visactor/vchart';
2
+ import type { IRichTextGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender';
2
3
  import type { DirectionType } from './chart/const';
3
4
  export type IPercent = `${number}%`;
4
5
  export type WidgetNumber = number;
@@ -21,7 +22,7 @@ export interface ICharacterSpecBase {
21
22
  export type IEditorTextGraphicAttribute = {
22
23
  graphicAlign?: 'left' | 'center' | 'right';
23
24
  graphicBaseline?: 'top' | 'middle' | 'bottom';
24
- } & ITextGraphicAttribute;
25
+ } & Partial<ITextGraphicAttribute & IRichTextGraphicAttribute>;
25
26
  export interface IComponentCharacterSpec extends ICharacterSpecBase {
26
27
  options: {
27
28
  graphic: any;
@@ -44,6 +45,7 @@ export interface IComponentSpec {
44
45
  export interface IChartCharacterSpec extends ICharacterSpecBase {
45
46
  options: {
46
47
  spec?: any;
48
+ initOption?: IInitOption;
47
49
  panel?: any;
48
50
  theme?: any;
49
51
  data?: any;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/dsl-interface.ts"],"names":[],"mappings":"","file":"dsl-interface.js","sourcesContent":["import type { ITextGraphicAttribute } from '@visactor/vrender';\nimport type { DirectionType } from './chart/const';\n\nexport type IPercent = `${number}%`;\nexport type WidgetNumber = number; // | IPercent;\n\nexport type IWidgetData = {\n left: WidgetNumber;\n top: WidgetNumber;\n} & (\n | {\n bottom: WidgetNumber;\n right: WidgetNumber;\n }\n | {\n width: WidgetNumber;\n height: WidgetNumber;\n }\n);\n\nexport interface ICharacterSpecBase {\n id: string;\n type: string; // 类型\n position: IWidgetData; // 定位描述\n zIndex: number;\n}\n\nexport type IEditorTextGraphicAttribute = {\n graphicAlign?: 'left' | 'center' | 'right';\n graphicBaseline?: 'top' | 'middle' | 'bottom';\n} & ITextGraphicAttribute;\n\nexport interface IComponentCharacterSpec extends ICharacterSpecBase {\n options: {\n graphic: any;\n text?: IEditorTextGraphicAttribute;\n isResized?: boolean;\n angle?: number;\n shapePoints?: any;\n };\n}\n\nexport interface IComponentMatch {\n usrId?: string;\n specIndex?: number | 'all'; // all 表示所有\n [key: string]: any;\n}\n\nexport interface IComponentSpec {\n specKey: string;\n matchInfo: IComponentMatch;\n spec: any;\n}\n\nexport interface IChartCharacterSpec extends ICharacterSpecBase {\n options: {\n // 图表spec\n spec?: any;\n panel?: any;\n // 各种图表配置属性\n theme?: any;\n // 数据源\n data?: any;\n // 内部模块布局信息\n padding?: any;\n // 标题\n title?: any;\n layout?: any;\n // 色板\n color?: string[];\n // 标注\n marker?: any;\n // mark单元素样式配置\n markStyle?: any[];\n // 组样式\n dataGroupSpec?: {\n [key: string]: any;\n };\n // 方向\n direction?: DirectionType;\n // 系列配置\n seriesSpec?: {\n matchInfo: IComponentMatch;\n spec: any;\n }[];\n // 模块 spec\n componentSpec?: IComponentSpec[];\n };\n}\n\nexport type ICharacterSpec = IChartCharacterSpec | IComponentCharacterSpec;\n"]}
1
+ {"version":3,"sources":["../src/story/character/dsl-interface.ts"],"names":[],"mappings":"","file":"dsl-interface.js","sourcesContent":["import type { IInitOption } from '@visactor/vchart';\nimport type { IRichTextGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender';\nimport type { DirectionType } from './chart/const';\n\nexport type IPercent = `${number}%`;\nexport type WidgetNumber = number; // | IPercent;\n\nexport type IWidgetData = {\n left: WidgetNumber;\n top: WidgetNumber;\n} & (\n | {\n bottom: WidgetNumber;\n right: WidgetNumber;\n }\n | {\n width: WidgetNumber;\n height: WidgetNumber;\n }\n);\n\nexport interface ICharacterSpecBase {\n id: string;\n type: string; // 类型\n position: IWidgetData; // 定位描述\n zIndex: number;\n}\n\nexport type IEditorTextGraphicAttribute = {\n graphicAlign?: 'left' | 'center' | 'right';\n graphicBaseline?: 'top' | 'middle' | 'bottom';\n} & Partial<ITextGraphicAttribute & IRichTextGraphicAttribute>;\n\nexport interface IComponentCharacterSpec extends ICharacterSpecBase {\n options: {\n graphic: any;\n text?: IEditorTextGraphicAttribute;\n isResized?: boolean;\n angle?: number;\n shapePoints?: any;\n };\n}\n\nexport interface IComponentMatch {\n usrId?: string;\n specIndex?: number | 'all'; // all 表示所有\n [key: string]: any;\n}\n\nexport interface IComponentSpec {\n specKey: string;\n matchInfo: IComponentMatch;\n spec: any;\n}\n\nexport interface IChartCharacterSpec extends ICharacterSpecBase {\n options: {\n // 图表spec\n spec?: any;\n // 初始化参数\n initOption?: IInitOption;\n panel?: any;\n // 各种图表配置属性\n theme?: any;\n // 数据源\n data?: any;\n // 内部模块布局信息\n padding?: any;\n // 标题\n title?: any;\n layout?: any;\n // 色板\n color?: string[];\n // 标注\n marker?: any;\n // mark单元素样式配置\n markStyle?: any[];\n // 组样式\n dataGroupSpec?: {\n [key: string]: any;\n };\n // 方向\n direction?: DirectionType;\n // 系列配置\n seriesSpec?: {\n matchInfo: IComponentMatch;\n spec: any;\n }[];\n // 模块 spec\n componentSpec?: IComponentSpec[];\n };\n}\n\nexport type ICharacterSpec = IChartCharacterSpec | IComponentCharacterSpec;\n"]}
@@ -1,25 +1,31 @@
1
- import type { IGroup } from '@visactor/vrender';
2
- import type { IPointLike } from '@visactor/vutils';
1
+ import type { IGroup, IGraphic } from '@visactor/vrender';
2
+ import type { IBoundsLike, IPointLike } from '@visactor/vutils';
3
3
  import type { IStory, IStoryCanvas, StoryEvent } from '../interface/runtime-interface';
4
4
  import type { ICharacterSpec } from './dsl-interface';
5
5
  import type { Graphic } from './component/graphic/graphic';
6
6
  export interface ICharacterPickInfo {
7
7
  part: string;
8
- graphicType: string;
8
+ graphic?: IGraphic;
9
+ graphicType?: string;
10
+ modelInfo?: any;
9
11
  }
10
12
  export interface ICharacter {
11
13
  id: string;
14
+ type: string;
15
+ visActorType: string;
12
16
  spec: ICharacterSpec;
17
+ graphic: Graphic | IGroup;
13
18
  init: () => void;
14
19
  reset: () => void;
15
20
  show: () => void;
16
21
  hide: () => void;
17
22
  getGraphicParent: () => IGroup;
18
- graphic: Graphic | IGroup;
23
+ getLayoutBounds: () => IBoundsLike;
19
24
  tickTo: (t: number) => void;
20
25
  checkEvent: (event: StoryEvent) => false | (ICharacterPickInfo & any);
21
26
  updateSpec: (spec: Omit<Partial<ICharacterSpec>, 'id' | 'type'>) => void;
22
27
  setAttributes: (attr: Record<string, any>) => void;
28
+ release: () => void;
23
29
  }
24
30
  export interface ICharacterInitOption {
25
31
  story: IStory;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/runtime-interface.ts"],"names":[],"mappings":"","file":"runtime-interface.js","sourcesContent":["import type { IGroup } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { StoryCanvas } from '../canvas/canvas';\nimport type { IStory, IStoryCanvas, StoryEvent } from '../interface/runtime-interface';\nimport type { ICharacterSpec } from './dsl-interface';\nimport type { Graphic } from './component/graphic/graphic';\n\nexport interface ICharacterPickInfo {\n part: string;\n graphicType: string;\n}\nexport interface ICharacter {\n id: string;\n spec: ICharacterSpec;\n\n init: () => void;\n reset: () => void;\n show: () => void;\n hide: () => void;\n getGraphicParent: () => IGroup;\n graphic: Graphic | IGroup;\n tickTo: (t: number) => void;\n\n checkEvent: (event: StoryEvent) => false | (ICharacterPickInfo & any);\n\n updateSpec: (spec: Omit<Partial<ICharacterSpec>, 'id' | 'type'>) => void;\n\n setAttributes: (attr: Record<string, any>) => void;\n}\n\nexport interface ICharacterInitOption {\n story: IStory;\n canvas: IStoryCanvas;\n graphicParent: IGroup;\n}\n\nexport interface ICharacterConstructor {\n new (spec: ICharacterSpec, option: ICharacterInitOption): ICharacter;\n}\n\nexport interface ILayoutAttribute {\n x: number;\n y: number;\n width: number;\n height: number;\n angle: number;\n anchor?: [number | string, number | string];\n dx?: number;\n dy?: number;\n shapePoints?: IPointLike[];\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/runtime-interface.ts"],"names":[],"mappings":"","file":"runtime-interface.js","sourcesContent":["import type { IGroup, IGraphic } from '@visactor/vrender';\nimport type { IBoundsLike, IPointLike } from '@visactor/vutils';\nimport type { IStory, IStoryCanvas, StoryEvent } from '../interface/runtime-interface';\nimport type { ICharacterSpec } from './dsl-interface';\nimport type { Graphic } from './component/graphic/graphic';\n\nexport interface ICharacterPickInfo {\n part: string;\n graphic?: IGraphic;\n graphicType?: string;\n modelInfo?: any;\n}\nexport interface ICharacter {\n id: string;\n type: string;\n visActorType: string;\n spec: ICharacterSpec;\n graphic: Graphic | IGroup;\n\n init: () => void;\n reset: () => void;\n show: () => void;\n hide: () => void;\n getGraphicParent: () => IGroup;\n getLayoutBounds: () => IBoundsLike;\n tickTo: (t: number) => void;\n\n checkEvent: (event: StoryEvent) => false | (ICharacterPickInfo & any);\n\n updateSpec: (spec: Omit<Partial<ICharacterSpec>, 'id' | 'type'>) => void;\n\n setAttributes: (attr: Record<string, any>) => void;\n release: () => void;\n}\n\nexport interface ICharacterInitOption {\n story: IStory;\n canvas: IStoryCanvas;\n graphicParent: IGroup;\n}\n\nexport interface ICharacterConstructor {\n new (spec: ICharacterSpec, option: ICharacterInitOption): ICharacter;\n}\n\nexport interface ILayoutAttribute {\n x: number;\n y: number;\n width: number;\n height: number;\n angle: number;\n anchor?: [number | string, number | string];\n dx?: number;\n dy?: number;\n shapePoints?: IPointLike[];\n}\n"]}
@@ -1,15 +1,14 @@
1
- import { ICharacterSpec } from 'src/story/character/dsl-interface';
1
+ import type { ICharacterSpec } from 'src/story/character/dsl-interface';
2
2
  import { CharacterBase } from '../base/base';
3
- import type { ISpecProcess, ICharacterVisactor, IVisactorGraphic } from './interface';
4
- import { ICharacterInitOption } from '../runtime-interface';
5
- import { IChartCharacterRuntime } from '../chart/runtime/interface';
3
+ import type { ISpecProcess, ICharacterVisactor } from './interface';
4
+ import type { ICharacterInitOption } from '../runtime-interface';
5
+ import type { IChartCharacterRuntime } from '../chart/runtime/interface';
6
6
  export declare abstract class CharacterVisactor extends CharacterBase implements ICharacterVisactor {
7
7
  protected _specProcess: ISpecProcess;
8
8
  get specProcess(): ISpecProcess;
9
9
  get dataTempTransform(): import("./interface").IDataTempTransform;
10
10
  get chartType(): string;
11
11
  get tempType(): string;
12
- protected _graphic: IVisactorGraphic;
13
12
  protected _runtime: IChartCharacterRuntime[];
14
13
  constructor(spec: ICharacterSpec, option: ICharacterInitOption);
15
14
  protected _initRuntime(): void;
@@ -24,7 +23,22 @@ export declare abstract class CharacterVisactor extends CharacterBase implements
24
23
  protected abstract _updateVisactorSpec(): void;
25
24
  show(): void;
26
25
  hide(): void;
27
- getGraphicParent(): IVisactorGraphic;
26
+ getGraphicParent(): any;
27
+ getViewBoxFromSpec(): {
28
+ layout: Partial<import("../runtime-interface").ILayoutAttribute>;
29
+ viewBox: {
30
+ x1: number;
31
+ x2: number;
32
+ y1: number;
33
+ y2: number;
34
+ };
35
+ };
36
+ getLayoutBounds(): {
37
+ x1: number;
38
+ x2: number;
39
+ y1: number;
40
+ y2: number;
41
+ };
28
42
  tickTo(t: number): void;
29
43
  release(): void;
30
44
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.CharacterVisactor = void 0;
6
6
 
7
- const base_1 = require("../base/base");
7
+ const base_1 = require("../base/base"), layout_1 = require("../../utils/layout");
8
8
 
9
9
  class CharacterVisactor extends base_1.CharacterBase {
10
10
  get specProcess() {
@@ -43,6 +43,22 @@ class CharacterVisactor extends base_1.CharacterBase {
43
43
  getGraphicParent() {
44
44
  return this._graphic;
45
45
  }
46
+ getViewBoxFromSpec() {
47
+ const layout = (0, layout_1.getLayoutFromWidget)(this._spec.position);
48
+ return {
49
+ layout: layout,
50
+ viewBox: {
51
+ x1: layout.x,
52
+ x2: layout.x + layout.width,
53
+ y1: layout.y,
54
+ y2: layout.y + layout.height
55
+ }
56
+ };
57
+ }
58
+ getLayoutBounds() {
59
+ const {viewBox: viewBox} = this.getViewBoxFromSpec();
60
+ return viewBox;
61
+ }
46
62
  tickTo(t) {}
47
63
  release() {
48
64
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/visactor/character.ts"],"names":[],"mappings":";;;AAEA,uCAA6C;AAK7C,MAAsB,iBAAkB,SAAQ,oBAAa;IAE3D,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IACD,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC;IAC7C,CAAC;IAED,IAAI,SAAS;;QACX,OAAO,MAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,QAAQ,0CAAE,YAAY,EAAE,CAAC;IACtE,CAAC;IAED,IAAI,QAAQ;;QACV,OAAO,MAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,QAAQ,0CAAE,IAAI,CAAC;IAC5D,CAAC;IAMD,YAAY,IAAoB,EAAE,MAA4B;QAC5D,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAHZ,aAAQ,GAA6B,EAAE,CAAC;QAelD,gBAAW,GAAG,GAAG,EAAE;;YACjB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,WAAW,iDAAI,CAAA,EAAA,CAAC,CAAC;YAC9C,MAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,QAAQ,0CAAE,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACpH,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC3B,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,CAAC,CAAC;QAjBA,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAES,YAAY,KAAU,CAAC;IAEjC,WAAW,CAAC,GAAqD;IAEjE,CAAC;IAgBD,IAAI;QACF,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IACD,IAAI;QACF,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,CAAS;QACd,OAAO;IACT,CAAC;IAED,OAAO;;QACL,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QAC5B,MAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,MAAM,0CAAE,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC3C,CAAC;CACF;AAlED,8CAkEC","file":"character.js","sourcesContent":["/* eslint-disable no-console */\nimport { ICharacterSpec } from 'src/story/character/dsl-interface';\nimport { CharacterBase } from '../base/base';\nimport type { ISpecProcess, ICharacterVisactor, IVisactorGraphic } from './interface';\nimport { ICharacterInitOption } from '../runtime-interface';\nimport { IChartCharacterRuntime } from '../chart/runtime/interface';\n\nexport abstract class CharacterVisactor extends CharacterBase implements ICharacterVisactor {\n protected declare _specProcess: ISpecProcess;\n get specProcess() {\n return this._specProcess;\n }\n get dataTempTransform() {\n return this._specProcess.dataTempTransform;\n }\n\n get chartType() {\n return this._specProcess.dataTempTransform.specTemp?.getChartType();\n }\n\n get tempType() {\n return this._specProcess.dataTempTransform.specTemp?.type;\n }\n\n protected declare _graphic: IVisactorGraphic;\n\n protected _runtime: IChartCharacterRuntime[] = [];\n\n constructor(spec: ICharacterSpec, option: ICharacterInitOption) {\n super(spec, option);\n this._initSpecProcess();\n }\n\n protected _initRuntime(): void {}\n\n clearConfig(opt: { clearCurrent: false | { [key: string]: any } }) {\n // do nothing\n }\n\n protected abstract _initSpecProcess(): void;\n\n onSpecReady = () => {\n console.log('onSpecReady !');\n this._runtime.forEach(r => r.onSpecReady?.());\n this._specProcess.dataTempTransform.specTemp?.standardizedSpec(this._specProcess.getVisSpec(), { character: this });\n this._updateVisactorSpec();\n this._afterRender();\n };\n\n protected abstract _afterRender(): void;\n\n protected abstract _updateVisactorSpec(): void;\n\n show(): void {\n this._graphic.setAttribute('visibleAll', true);\n }\n hide(): void {\n this._graphic.setAttribute('visibleAll', false);\n }\n\n getGraphicParent() {\n return this._graphic;\n }\n\n tickTo(t: number): void {\n return;\n }\n\n release() {\n this._specProcess.release();\n this._graphic?.parent?.removeChild(this._graphic);\n this._specProcess = this._graphic = null;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/visactor/character.ts"],"names":[],"mappings":";;;AAEA,uCAA6C;AAI7C,+CAAyD;AAEzD,MAAsB,iBAAkB,SAAQ,oBAAa;IAE3D,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IACD,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC;IAC7C,CAAC;IAED,IAAI,SAAS;;QACX,OAAO,MAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,QAAQ,0CAAE,YAAY,EAAE,CAAC;IACtE,CAAC;IAED,IAAI,QAAQ;;QACV,OAAO,MAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,QAAQ,0CAAE,IAAI,CAAC;IAC5D,CAAC;IAID,YAAY,IAAoB,EAAE,MAA4B;QAC5D,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAHZ,aAAQ,GAA6B,EAAE,CAAC;QAiBlD,gBAAW,GAAG,GAAG,EAAE;;YACjB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,WAAW,iDAAI,CAAA,EAAA,CAAC,CAAC;YAC9C,MAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,QAAQ,0CAAE,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACpH,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC3B,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,CAAC,CAAC;QAnBA,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAES,YAAY;QACpB,OAAO;IACT,CAAC;IAED,WAAW,CAAC,GAAqD;IAEjE,CAAC;IAgBD,IAAI;QACF,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IACD,IAAI;QACF,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,kBAAkB;QAChB,MAAM,MAAM,GAAG,IAAA,4BAAmB,EAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxD,MAAM,OAAO,GAAG;YACd,EAAE,EAAE,MAAM,CAAC,CAAC;YACZ,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK;YAC3B,EAAE,EAAE,MAAM,CAAC,CAAC;YACZ,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM;SAC7B,CAAC;QACF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,eAAe;QACb,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC9C,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,CAAS;QACd,OAAO;IACT,CAAC;IAED,OAAO;;QACL,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QAC5B,MAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,MAAM,0CAAE,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC3C,CAAC;CACF;AAlFD,8CAkFC","file":"character.js","sourcesContent":["/* eslint-disable no-console */\nimport type { ICharacterSpec } from 'src/story/character/dsl-interface';\nimport { CharacterBase } from '../base/base';\nimport type { ISpecProcess, ICharacterVisactor } from './interface';\nimport type { ICharacterInitOption } from '../runtime-interface';\nimport type { IChartCharacterRuntime } from '../chart/runtime/interface';\nimport { getLayoutFromWidget } from '../../utils/layout';\n\nexport abstract class CharacterVisactor extends CharacterBase implements ICharacterVisactor {\n protected declare _specProcess: ISpecProcess;\n get specProcess() {\n return this._specProcess;\n }\n get dataTempTransform() {\n return this._specProcess.dataTempTransform;\n }\n\n get chartType() {\n return this._specProcess.dataTempTransform.specTemp?.getChartType();\n }\n\n get tempType() {\n return this._specProcess.dataTempTransform.specTemp?.type;\n }\n\n protected _runtime: IChartCharacterRuntime[] = [];\n\n constructor(spec: ICharacterSpec, option: ICharacterInitOption) {\n super(spec, option);\n this._initSpecProcess();\n }\n\n protected _initRuntime(): void {\n return;\n }\n\n clearConfig(opt: { clearCurrent: false | { [key: string]: any } }) {\n // do nothing\n }\n\n protected abstract _initSpecProcess(): void;\n\n onSpecReady = () => {\n console.log('onSpecReady !');\n this._runtime.forEach(r => r.onSpecReady?.());\n this._specProcess.dataTempTransform.specTemp?.standardizedSpec(this._specProcess.getVisSpec(), { character: this });\n this._updateVisactorSpec();\n this._afterRender();\n };\n\n protected abstract _afterRender(): void;\n\n protected abstract _updateVisactorSpec(): void;\n\n show(): void {\n this._graphic.setAttribute('visibleAll', true);\n }\n hide(): void {\n this._graphic.setAttribute('visibleAll', false);\n }\n\n getGraphicParent() {\n return this._graphic;\n }\n\n getViewBoxFromSpec() {\n const layout = getLayoutFromWidget(this._spec.position);\n const viewBox = {\n x1: layout.x,\n x2: layout.x + layout.width,\n y1: layout.y,\n y2: layout.y + layout.height\n };\n return { layout, viewBox };\n }\n\n getLayoutBounds() {\n const { viewBox } = this.getViewBoxFromSpec();\n return viewBox;\n }\n\n tickTo(t: number): void {\n return;\n }\n\n release() {\n this._specProcess.release();\n this._graphic?.parent?.removeChild(this._graphic);\n this._specProcess = this._graphic = null;\n }\n}\n"]}
@@ -84,6 +84,7 @@ export interface IVisactorTempConstructor {
84
84
  export interface IVisactorGraphic extends IGroup {
85
85
  readonly vProduct: IVChart;
86
86
  updateSpec: (spec: any) => void;
87
+ release: () => void;
87
88
  }
88
89
  export interface ICharacterVisactor extends ICharacter {
89
90
  clearConfig: (opt: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/visactor/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IChartCharacterSpec } from '../dsl-interface';\nimport type { EventEmitter } from '@visactor/vutils';\nimport type { ICharacter } from '../runtime-interface';\nimport type { ISpec, IVChart } from '@visactor/vchart';\nimport type { IGroup } from '@visactor/vrender';\n\nexport type StandardData = IDataValue | IDataValue[];\nexport type IParserValue = any;\nexport type DataUpdateCall = (data: StandardData) => void;\nexport type DataErrorCall = (msg: { type: string; info: string }, opt?: any) => void;\n\n// visactor 元素的内部结构\n// 数据部分 start\n// DataParser:数据处理。负责解析数据,得到模版可用数据,处理数据上的特性内容。\n// VisactorTemp:模版处理。负责结合数据,生成对应类型的基础 spec。不同类型图表的特殊逻辑,在 temp 中处理\n// DataTempTransform:数据与模版更新管理,当数据/模版更新时,通过这个模块判定更新是否成功,成功后抛出更新成功消息。包含 VisactorTemp 与 DataParser\n// SpecProcess:编辑配置管理器,编辑属性更新的处理,对外输出合并了编辑信息的 spec 。包含一个 dataTempTransform\n// 数据部分 end\n\n// graphic 部分 start\n// IVisactorGraphic:包含一个 vchart|vtbale 。visactor 的自定义图元封装。处理图元是否重绘,viewBox的图元属性逻辑\n// IVisactorGraphic-render:实际的 draw 入口,处理绘图过程,主要是处理变换矩阵。\n// graphic 部分 end\n\n// Visactor-role:编辑元素,包含一个 specProcess、IVisactorGraphic\n\nexport interface IDataTempTransform {\n readonly specTemp: IVisactorTemp;\n\n readonly nextTemp: IVisactorTemp;\n emitter: EventEmitter;\n\n updateChartTemp: (temp?: string) => void;\n\n // 得到没有经过编辑器配置加工过的基础spec\n getBaseSpec: () => any;\n\n // 释放\n release: () => void;\n\n dataParser?: IDataParser;\n}\n\nexport interface IDataTempTransformConstructor {\n new ({ specProcess, character }: { character: ICharacterVisactor; specProcess: ISpecProcess }): IDataTempTransform;\n}\n\nexport interface ISpecProcess {\n dataTempTransform: IDataTempTransform;\n emitter: EventEmitter;\n\n // 得到visactor元素的spec\n getVisSpec: () => ISpec;\n // 得到角色的spec\n getCharacterSpec: () => IChartCharacterSpec;\n\n // temp\n getCharacterType: () => string;\n\n release: () => void;\n}\n\nexport type IDataType = any;\n\nexport interface IDataValue {\n id: string;\n sourceKey: string;\n values: IDataType[];\n}\n\nexport type DataInfo = {\n [key: string]: {\n type: 'ordinal' | 'linear';\n };\n};\n\nexport type DataSave = {\n type: string;\n value: any;\n};\n\nexport interface IDataParser {\n type: string;\n getData: () => StandardData;\n getDataValue: () => IParserValue;\n getDataInfo?: () => DataInfo;\n getSpecOption?: () => any;\n getSave: () => DataSave;\n updateValue: (value: IParserValue) => void;\n setDataUpdateHandler: (call: DataUpdateCall) => void;\n setDataErrorHandler: (call: DataErrorCall) => void;\n clear: () => void;\n}\n\nexport interface IDataParserConstructor {\n type: string;\n new (\n value: any,\n option: {\n updateCall: DataUpdateCall;\n errorCall: DataErrorCall;\n currentData?: IDataParser;\n emitter: EventEmitter;\n }\n ): IDataParser;\n}\n\n// chart & table 都是用这个模版接口\nexport interface IVisactorTemp {\n type: string;\n getSpec: (data: StandardData, ctx: any, opt?: any) => ISpec | null;\n standardizedSpec: (spec: any, ctx: any, opt?: any) => void;\n getChartType: () => string;\n checkDataEnable: (data: StandardData, opt?: any) => boolean;\n getTempInfo?: () => any;\n clear: () => void;\n}\n\nexport interface IVisactorTempConstructor {\n new (): IVisactorTemp;\n}\n\n// 绘图元素\nexport interface IVisactorGraphic extends IGroup {\n readonly vProduct: IVChart;\n\n updateSpec: (spec: any) => void;\n}\n\n// 编辑元素\nexport interface ICharacterVisactor extends ICharacter {\n // 清除编辑数据\n clearConfig: (opt: { clearCurrent: false | { [key: string]: any } }) => void;\n getGraphicParent: () => IVisactorGraphic;\n}\n\nexport interface IUpdateAttributeOption {\n triggerHistory?: boolean;\n saveData?: boolean;\n actionType?: 'data-add' | 'data-change' | 'data-replace' | string;\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/visactor/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IChartCharacterSpec } from '../dsl-interface';\nimport type { EventEmitter, IBoundsLike } from '@visactor/vutils';\nimport type { ICharacter } from '../runtime-interface';\nimport type { ISpec, IVChart } from '@visactor/vchart';\nimport type { IGroup } from '@visactor/vrender';\n\nexport type StandardData = IDataValue | IDataValue[];\nexport type IParserValue = any;\nexport type DataUpdateCall = (data: StandardData) => void;\nexport type DataErrorCall = (msg: { type: string; info: string }, opt?: any) => void;\n\n// visactor 元素的内部结构\n// 数据部分 start\n// DataParser:数据处理。负责解析数据,得到模版可用数据,处理数据上的特性内容。\n// VisactorTemp:模版处理。负责结合数据,生成对应类型的基础 spec。不同类型图表的特殊逻辑,在 temp 中处理\n// DataTempTransform:数据与模版更新管理,当数据/模版更新时,通过这个模块判定更新是否成功,成功后抛出更新成功消息。包含 VisactorTemp 与 DataParser\n// SpecProcess:编辑配置管理器,编辑属性更新的处理,对外输出合并了编辑信息的 spec 。包含一个 dataTempTransform\n// 数据部分 end\n\n// graphic 部分 start\n// IVisactorGraphic:包含一个 vchart|vtbale 。visactor 的自定义图元封装。处理图元是否重绘,viewBox的图元属性逻辑\n// IVisactorGraphic-render:实际的 draw 入口,处理绘图过程,主要是处理变换矩阵。\n// graphic 部分 end\n\n// Visactor-role:编辑元素,包含一个 specProcess、IVisactorGraphic\n\nexport interface IDataTempTransform {\n readonly specTemp: IVisactorTemp;\n\n readonly nextTemp: IVisactorTemp;\n emitter: EventEmitter;\n\n updateChartTemp: (temp?: string) => void;\n\n // 得到没有经过编辑器配置加工过的基础spec\n getBaseSpec: () => any;\n\n // 释放\n release: () => void;\n\n dataParser?: IDataParser;\n}\n\nexport interface IDataTempTransformConstructor {\n new ({ specProcess, character }: { character: ICharacterVisactor; specProcess: ISpecProcess }): IDataTempTransform;\n}\n\nexport interface ISpecProcess {\n dataTempTransform: IDataTempTransform;\n emitter: EventEmitter;\n\n // 得到visactor元素的spec\n getVisSpec: () => ISpec;\n // 得到角色的spec\n getCharacterSpec: () => IChartCharacterSpec;\n\n // temp\n getCharacterType: () => string;\n\n release: () => void;\n}\n\nexport type IDataType = any;\n\nexport interface IDataValue {\n id: string;\n sourceKey: string;\n values: IDataType[];\n}\n\nexport type DataInfo = {\n [key: string]: {\n type: 'ordinal' | 'linear';\n };\n};\n\nexport type DataSave = {\n type: string;\n value: any;\n};\n\nexport interface IDataParser {\n type: string;\n getData: () => StandardData;\n getDataValue: () => IParserValue;\n getDataInfo?: () => DataInfo;\n getSpecOption?: () => any;\n getSave: () => DataSave;\n updateValue: (value: IParserValue) => void;\n setDataUpdateHandler: (call: DataUpdateCall) => void;\n setDataErrorHandler: (call: DataErrorCall) => void;\n clear: () => void;\n}\n\nexport interface IDataParserConstructor {\n type: string;\n new (\n value: any,\n option: {\n updateCall: DataUpdateCall;\n errorCall: DataErrorCall;\n currentData?: IDataParser;\n emitter: EventEmitter;\n }\n ): IDataParser;\n}\n\n// chart & table 都是用这个模版接口\nexport interface IVisactorTemp {\n type: string;\n getSpec: (data: StandardData, ctx: any, opt?: any) => ISpec | null;\n standardizedSpec: (spec: any, ctx: any, opt?: any) => void;\n getChartType: () => string;\n checkDataEnable: (data: StandardData, opt?: any) => boolean;\n getTempInfo?: () => any;\n clear: () => void;\n}\n\nexport interface IVisactorTempConstructor {\n new (): IVisactorTemp;\n}\n\n// 绘图元素\nexport interface IVisactorGraphic extends IGroup {\n readonly vProduct: IVChart;\n\n updateSpec: (spec: any) => void;\n release: () => void;\n}\n\n// 编辑元素\nexport interface ICharacterVisactor extends ICharacter {\n // 清除编辑数据\n clearConfig: (opt: { clearCurrent: false | { [key: string]: any } }) => void;\n getGraphicParent: () => IVisactorGraphic;\n}\n\nexport interface IUpdateAttributeOption {\n triggerHistory?: boolean;\n saveData?: boolean;\n actionType?: 'data-add' | 'data-change' | 'data-replace' | string;\n}\n"]}
@@ -12,4 +12,5 @@ export declare class CharacterTree implements ICharacterTree {
12
12
  getCharactersById(key: string): ICharacter;
13
13
  addCharacter(spec: ICharacterSpec): ICharacter;
14
14
  initCharacters(specs: ICharacterSpec[]): void;
15
+ releaseOldCharacters(): void;
15
16
  }
@@ -26,6 +26,7 @@ class CharacterTree {
26
26
  this._characters[spec.id]) : null;
27
27
  }
28
28
  initCharacters(specs) {
29
+ this.releaseOldCharacters(), this._characters = {};
29
30
  const option = {
30
31
  story: this._story,
31
32
  canvas: this._story.canvas,
@@ -35,6 +36,11 @@ class CharacterTree {
35
36
  spec.id && (this._characters[spec.id] || (this._characters[spec.id] = factory_1.StoryFactory.createCharacter(spec, option)));
36
37
  }));
37
38
  }
39
+ releaseOldCharacters() {
40
+ Object.keys(this._characters).forEach((k => {
41
+ this._characters[k].release();
42
+ }));
43
+ }
38
44
  }
39
45
 
40
46
  exports.CharacterTree = CharacterTree;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character-tree/character-tree.ts"],"names":[],"mappings":";;;AACA,gDAAkD;AAGlD,MAAa,aAAa;IAIxB,YAAY,KAAa;QAHf,gBAAW,GAAkC,EAAE,CAAC;QAIxD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,iBAAiB,CAAC,GAAW;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;IACvC,CAAC;IAED,YAAY,CAAC,IAAoB;QAC/B,MAAM,MAAM,GAAG;YACb,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC1B,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,YAAY;SAC1D,CAAC;QACF,IAAqB,IAAK,CAAC,EAAE,EAAE;YAC7B,IAAI,CAAC,IAAI,CAAC,WAAW,CAAkB,IAAK,CAAC,EAAE,CAAC,EAAE;gBAChD,IAAI,CAAC,WAAW,CAAkB,IAAK,CAAC,EAAE,CAAC,GAAG,sBAAY,CAAC,eAAe,CAAiB,IAAI,EAAE,MAAM,CAAC,CAAC;aAC1G;YACD,OAAO,IAAI,CAAC,WAAW,CAAkB,IAAK,CAAC,EAAE,CAAC,CAAC;SACpD;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,cAAc,CAAC,KAAuB;QACpC,MAAM,MAAM,GAAG;YACb,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC1B,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,YAAY;SAC1D,CAAC;QAEF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnB,IAAqB,IAAK,CAAC,EAAE,EAAE;gBAC7B,IAAI,CAAC,IAAI,CAAC,WAAW,CAAkB,IAAK,CAAC,EAAE,CAAC,EAAE;oBAChD,IAAI,CAAC,WAAW,CAAkB,IAAK,CAAC,EAAE,CAAC,GAAG,sBAAY,CAAC,eAAe,CAAiB,IAAI,EAAE,MAAM,CAAC,CAAC;iBAC1G;aAEF;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/CD,sCA+CC","file":"character-tree.js","sourcesContent":["import type { ICharacter, ICharacterSpec } from '../character';\nimport { StoryFactory } from '../factory/factory';\nimport type { ICharacterTree, IStory } from '../interface';\n\nexport class CharacterTree implements ICharacterTree {\n protected _characters: { [key: string]: ICharacter } = {};\n protected _story: IStory;\n\n constructor(story: IStory) {\n this._story = story;\n }\n\n getCharacters(): { [key: string]: ICharacter } {\n return this._characters;\n }\n\n getCharactersById(key: string) {\n return this._characters[key] || null;\n }\n\n addCharacter(spec: ICharacterSpec) {\n const option = {\n story: this._story,\n canvas: this._story.canvas,\n graphicParent: this._story.canvas.getStage().defaultLayer\n };\n if ((<ICharacterSpec>spec).id) {\n if (!this._characters[(<ICharacterSpec>spec).id]) {\n this._characters[(<ICharacterSpec>spec).id] = StoryFactory.createCharacter(<ICharacterSpec>spec, option);\n }\n return this._characters[(<ICharacterSpec>spec).id];\n }\n return null;\n }\n\n initCharacters(specs: ICharacterSpec[]): void {\n const option = {\n story: this._story,\n canvas: this._story.canvas,\n graphicParent: this._story.canvas.getStage().defaultLayer\n };\n\n specs.forEach(spec => {\n if ((<ICharacterSpec>spec).id) {\n if (!this._characters[(<ICharacterSpec>spec).id]) {\n this._characters[(<ICharacterSpec>spec).id] = StoryFactory.createCharacter(<ICharacterSpec>spec, option);\n }\n // return this._characters[(<ICharacterSpec>spec).id];\n }\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character-tree/character-tree.ts"],"names":[],"mappings":";;;AACA,gDAAkD;AAGlD,MAAa,aAAa;IAIxB,YAAY,KAAa;QAHf,gBAAW,GAAkC,EAAE,CAAC;QAIxD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,iBAAiB,CAAC,GAAW;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;IACvC,CAAC;IAED,YAAY,CAAC,IAAoB;QAC/B,MAAM,MAAM,GAAG;YACb,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC1B,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,YAAY;SAC1D,CAAC;QACF,IAAqB,IAAK,CAAC,EAAE,EAAE;YAC7B,IAAI,CAAC,IAAI,CAAC,WAAW,CAAkB,IAAK,CAAC,EAAE,CAAC,EAAE;gBAChD,IAAI,CAAC,WAAW,CAAkB,IAAK,CAAC,EAAE,CAAC,GAAG,sBAAY,CAAC,eAAe,CAAiB,IAAI,EAAE,MAAM,CAAC,CAAC;aAC1G;YACD,OAAO,IAAI,CAAC,WAAW,CAAkB,IAAK,CAAC,EAAE,CAAC,CAAC;SACpD;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,cAAc,CAAC,KAAuB;QACpC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG;YACb,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC1B,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,YAAY;SAC1D,CAAC;QAEF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnB,IAAqB,IAAK,CAAC,EAAE,EAAE;gBAC7B,IAAI,CAAC,IAAI,CAAC,WAAW,CAAkB,IAAK,CAAC,EAAE,CAAC,EAAE;oBAChD,IAAI,CAAC,WAAW,CAAkB,IAAK,CAAC,EAAE,CAAC,GAAG,sBAAY,CAAC,eAAe,CAAiB,IAAI,EAAE,MAAM,CAAC,CAAC;iBAC1G;aAEF;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB;QAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACxC,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC9B,CAAC,CAAC,OAAO,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxDD,sCAwDC","file":"character-tree.js","sourcesContent":["import type { ICharacter, ICharacterSpec } from '../character';\nimport { StoryFactory } from '../factory/factory';\nimport type { ICharacterTree, IStory } from '../interface';\n\nexport class CharacterTree implements ICharacterTree {\n protected _characters: { [key: string]: ICharacter } = {};\n protected _story: IStory;\n\n constructor(story: IStory) {\n this._story = story;\n }\n\n getCharacters(): { [key: string]: ICharacter } {\n return this._characters;\n }\n\n getCharactersById(key: string) {\n return this._characters[key] || null;\n }\n\n addCharacter(spec: ICharacterSpec) {\n const option = {\n story: this._story,\n canvas: this._story.canvas,\n graphicParent: this._story.canvas.getStage().defaultLayer\n };\n if ((<ICharacterSpec>spec).id) {\n if (!this._characters[(<ICharacterSpec>spec).id]) {\n this._characters[(<ICharacterSpec>spec).id] = StoryFactory.createCharacter(<ICharacterSpec>spec, option);\n }\n return this._characters[(<ICharacterSpec>spec).id];\n }\n return null;\n }\n\n initCharacters(specs: ICharacterSpec[]): void {\n this.releaseOldCharacters();\n this._characters = {};\n const option = {\n story: this._story,\n canvas: this._story.canvas,\n graphicParent: this._story.canvas.getStage().defaultLayer\n };\n\n specs.forEach(spec => {\n if ((<ICharacterSpec>spec).id) {\n if (!this._characters[(<ICharacterSpec>spec).id]) {\n this._characters[(<ICharacterSpec>spec).id] = StoryFactory.createCharacter(<ICharacterSpec>spec, option);\n }\n // return this._characters[(<ICharacterSpec>spec).id];\n }\n });\n }\n\n releaseOldCharacters() {\n Object.keys(this._characters).forEach(k => {\n const c = this._characters[k];\n c.release();\n });\n }\n}\n"]}