@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
@@ -1,4 +1,14 @@
1
- import { GraphicText } from "./graphic/graphic-text";
1
+ var __rest = this && this.__rest || function(s, e) {
2
+ var t = {};
3
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
4
+ if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
5
+ var i = 0;
6
+ for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
7
+ }
8
+ return t;
9
+ };
10
+
11
+ import { GraphicBaseText } from "./graphic/graphic-base-text";
2
12
 
3
13
  import { CharacterBase } from "../base/base";
4
14
 
@@ -16,6 +26,9 @@ export class CharacterComponent extends CharacterBase {
16
26
  get text() {
17
27
  return this._text;
18
28
  }
29
+ get textGraphic() {
30
+ return this._text.graphic;
31
+ }
19
32
  get group() {
20
33
  return this._group;
21
34
  }
@@ -25,11 +38,13 @@ export class CharacterComponent extends CharacterBase {
25
38
  angle: this._spec.options.angle,
26
39
  zIndex: this._spec.zIndex
27
40
  })), this.option.graphicParent.add(this._group), this._graphic = this._createGraphic(),
28
- this._text = new GraphicText(this), this._graphic.init(), this._text.init(), this._graphic.applyGraphicAttribute(this._spec.options.graphic),
29
- this._text.applyGraphicAttribute(this._spec.options.text), this._graphic.applyLayoutData(this._spec.position),
30
- this._text.applyLayoutData(this._spec.position), this.hide();
41
+ this._text = new GraphicBaseText(this), this._graphic.init(), this._text.init(),
42
+ this._graphic.applyGraphicAttribute(this._spec.options.graphic), this._text.applyGraphicAttribute(this._spec.options.text),
43
+ this._graphic.applyLayoutData(this._spec.position), this._text.applyLayoutData(this._spec.position),
44
+ this.hide();
31
45
  }
32
- setAttributes(attr) {
46
+ setAttributes(updateAttr) {
47
+ const {position: position} = updateAttr, rest = __rest(updateAttr, [ "position" ]), attr = Object.assign(Object.assign({}, null != position ? position : {}), rest);
33
48
  this.group.setAttributes(attr), this._graphic.setAttributes(Object.assign(Object.assign({}, attr), {
34
49
  x: 0,
35
50
  y: 0,
@@ -58,6 +73,9 @@ export class CharacterComponent extends CharacterBase {
58
73
  getGraphicParent() {
59
74
  return this._group;
60
75
  }
76
+ getLayoutBounds() {
77
+ return this._group.AABBBounds;
78
+ }
61
79
  checkEvent(event) {
62
80
  var _a;
63
81
  return !!(null !== (_a = event.detailPath) && void 0 !== _a ? _a : event.path).some((g => g === this._group)) && {
@@ -65,5 +83,8 @@ export class CharacterComponent extends CharacterBase {
65
83
  graphicType: this.graphicType
66
84
  };
67
85
  }
86
+ release() {
87
+ this.option.graphicParent.removeChild(this._group);
88
+ }
68
89
  }
69
90
  //# sourceMappingURL=character.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/character.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,MAAM,OAAgB,kBAAmB,SAAQ,aAAa;IAA9D;;QAeW,gBAAW,GAAW,MAAM,CAAC;IAwExC,CAAC;IArFC,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAGD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAIS,WAAW;QACnB,OAAO;IACT,CAAC;IAES,aAAa;QACrB,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,iCAC3B,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAC3C,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAC/B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,IACzB,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM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AAa,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAED,kBAAkB;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC;IAC5C,CAAC;IAED,cAAc;;QACZ,MAAA,IAAI,CAAC,MAAM,0CAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,UAAU,CAAC,KAAiB;;QAC1B,IAAI,CAAC,CAAC,MAAA,KAAK,CAAC,UAAU,mCAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE;YAClE,OAAO,KAAK,CAAC;SACd;QACD,OAAO;YACL,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;YACtF,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;IACJ,CAAC;CACF","file":"character.js","sourcesContent":["import type { IGroup } from '@visactor/vrender';\nimport { createGroup } from '@visactor/vrender';\nimport { GraphicText } from './graphic/graphic-text';\nimport type { IComponentCharacterSpec } from '../dsl-interface';\nimport { CharacterBase } from '../base/base';\nimport type { Graphic } from './graphic/graphic';\nimport { getLayoutFromWidget } from '../../utils/layout';\nimport type { StoryEvent } from '../../interface/runtime-interface';\nimport type { ICharacterPickInfo } from '../runtime-interface';\nimport { ComponentGroup } from './character-group/component-group-graphic';\n\nexport abstract class CharacterComponent extends CharacterBase {\n protected declare _spec: IComponentCharacterSpec;\n get spec() {\n return this._spec;\n }\n protected declare _text: GraphicText;\n get text() {\n return this._text;\n }\n\n protected declare _group: IGroup;\n get group() {\n return this._group;\n }\n\n readonly graphicType: string = 'rect';\n\n protected _parserSpec(): void {\n return;\n }\n\n protected _initGraphics(): void {\n this._group = new ComponentGroup({\n ...getLayoutFromWidget(this._spec.position),\n angle: this._spec.options.angle,\n zIndex: this._spec.zIndex\n });\n this.option.graphicParent.add(this._group);\n\n this._graphic = this._createGraphic();\n this._text = new GraphicText(this);\n this._graphic.init();\n this._text.init();\n\n this._graphic.applyGraphicAttribute(this._spec.options.graphic);\n this._text.applyGraphicAttribute(this._spec.options.text);\n\n this._graphic.applyLayoutData(this._spec.position);\n this._text.applyLayoutData(this._spec.position);\n this.hide();\n }\n\n setAttributes(attr: Record<string, any>): void {\n this.group.setAttributes(attr);\n this._graphic.setAttributes({ ...attr, x: 0, y: 0, angle: 0 });\n this._text.updateAttribute({});\n }\n\n protected abstract _createGraphic(): Graphic;\n\n protected _initRuntime(): void {\n return;\n }\n\n show(): void {\n this._group.setAttributes({ visible: true });\n this._text.show();\n this._graphic.show();\n }\n hide(): void {\n this._group.setAttributes({ visible: false });\n this._text.hide();\n this._graphic.hide();\n }\n\n getTextLayoutRatio(): { left: number; right: number; top: number; bottom: number } {\n return this._graphic.getTextLayoutRatio();\n }\n\n clearCharacter(): void {\n this._group?.parent.removeChild(this._group);\n this._group = null;\n }\n\n getGraphicParent() {\n return this._group;\n }\n\n checkEvent(event: StoryEvent): false | ICharacterPickInfo {\n if (!(event.detailPath ?? event.path).some(g => g === this._group)) {\n return false;\n }\n return {\n part: event.path[event.path.length - 1] === this._graphic.graphic ? 'graphic' : 'text',\n graphicType: this.graphicType\n };\n }\n}\n\n// export abstract class CharacterGraphicComponent extends CharacterBase {\n// protected declare _spec: IComponentCharacterSpec;\n\n// get spec() {\n// return this._spec;\n// }\n// protected declare _graphic: Graphic;\n// get graphic() {\n// return this._graphic;\n// }\n\n// protected declare _group: IGroup;\n// get group() {\n// return this._group;\n// }\n\n// protected abstract _createGraphic(): Graphic;\n\n// protected _initRuntime(): void {\n// return;\n// }\n\n// protected _parserSpec(): void {\n// return;\n// }\n\n// protected _initGraphics(): void {\n// this._group = createGroup({\n// ...getLayoutFromWidget(this._spec.position),\n// angle: this._spec.options.angle,\n// zIndex: this._spec.zIndex\n// });\n// this.option.graphicParent.add(this._group);\n\n// this._graphic = this._createGraphic();\n// this._graphic.init();\n\n// this._graphic.applyGraphicAttribute(this._spec.options.graphic);\n\n// this._graphic.applyLayoutData(this._spec.position);\n// this.hide();\n// }\n\n// show(): void {\n// this._graphic?.show();\n// }\n// hide(): void {\n// this._graphic?.hide();\n// }\n\n// getGraphicParent() {\n// return this._group;\n// }\n\n// clearCharacter(): void {\n// if (this._group) {\n// this._group.parent.removeChild(this._group);\n// this._graphic = null;\n// }\n// }\n// }\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/character.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,MAAM,OAAgB,kBAAmB,SAAQ,aAAa;IAA9D;;QAwBW,gBAAW,GAAW,MAAM,CAAC;IAkFxC,CAAC;IAvGC,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAMD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAC5B,CAAC;IAGD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,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,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE;YAClE,OAAO,KAAK,CAAC;SACd;QACD,OAAO;YACL,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;YACtF,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;CACF","file":"character.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { IGroup } from '@visactor/vrender';\nimport { GraphicBaseText } from './graphic/graphic-base-text';\nimport type { IComponentCharacterSpec } from '../dsl-interface';\nimport { CharacterBase } from '../base/base';\nimport type { Graphic } from './graphic/graphic';\nimport { getLayoutFromWidget } from '../../utils/layout';\nimport type { StoryEvent } from '../../interface/runtime-interface';\nimport type { ICharacterPickInfo } from '../runtime-interface';\nimport { ComponentGroup } from './character-group/component-group-graphic';\n\nexport abstract class CharacterComponent extends CharacterBase {\n visActorType: 'component';\n protected declare _spec: IComponentCharacterSpec;\n get spec() {\n return this._spec;\n }\n // protected declare _graphic: Graphic;\n // get graphic() {\n // return this._graphic;\n // }\n protected declare _text: GraphicBaseText;\n get text() {\n return this._text;\n }\n\n get textGraphic() {\n return this._text.graphic;\n }\n\n protected declare _group: IGroup;\n get group() {\n return this._group;\n }\n\n readonly graphicType: string = 'rect';\n\n protected _parserSpec(): void {\n return;\n }\n\n protected _initGraphics(): void {\n this._group = new ComponentGroup({\n ...getLayoutFromWidget(this._spec.position),\n angle: this._spec.options.angle,\n zIndex: this._spec.zIndex\n });\n this.option.graphicParent.add(this._group);\n\n this._graphic = this._createGraphic();\n this._text = new GraphicBaseText(this);\n this._graphic.init();\n this._text.init();\n\n this._graphic.applyGraphicAttribute(this._spec.options.graphic);\n this._text.applyGraphicAttribute(this._spec.options.text);\n\n this._graphic.applyLayoutData(this._spec.position);\n this._text.applyLayoutData(this._spec.position);\n this.hide();\n }\n\n setAttributes(updateAttr: Record<string, any>): void {\n const { position, ...rest } = updateAttr;\n const attr = { ...(position ?? {}), ...rest };\n this.group.setAttributes(attr);\n this._graphic.setAttributes({ ...attr, x: 0, y: 0, angle: 0 });\n this._text.updateAttribute({});\n }\n\n protected abstract _createGraphic(): Graphic;\n\n protected _initRuntime(): void {\n return;\n }\n\n show(): void {\n this._group.setAttributes({ visible: true });\n this._text.show();\n this._graphic.show();\n }\n hide(): void {\n this._group.setAttributes({ visible: false });\n this._text.hide();\n this._graphic.hide();\n }\n\n getTextLayoutRatio(): { left: number; right: number; top: number; bottom: number } {\n return this._graphic.getTextLayoutRatio();\n }\n\n clearCharacter(): void {\n this._group?.parent.removeChild(this._group);\n this._group = null;\n }\n\n getGraphicParent() {\n return this._group;\n }\n\n getLayoutBounds() {\n return this._group.AABBBounds as IBoundsLike;\n }\n\n checkEvent(event: StoryEvent): false | ICharacterPickInfo {\n if (!(event.detailPath ?? event.path).some(g => g === this._group)) {\n return false;\n }\n return {\n part: event.path[event.path.length - 1] === this._graphic.graphic ? 'graphic' : 'text',\n graphicType: this.graphicType\n };\n }\n\n release() {\n this.option.graphicParent.removeChild(this._group);\n }\n}\n\n// export abstract class CharacterGraphicComponent extends CharacterBase {\n// protected declare _spec: IComponentCharacterSpec;\n\n// get spec() {\n// return this._spec;\n// }\n// protected declare _graphic: Graphic;\n// get graphic() {\n// return this._graphic;\n// }\n\n// protected declare _group: IGroup;\n// get group() {\n// return this._group;\n// }\n\n// protected abstract _createGraphic(): Graphic;\n\n// protected _initRuntime(): void {\n// return;\n// }\n\n// protected _parserSpec(): void {\n// return;\n// }\n\n// protected _initGraphics(): void {\n// this._group = createGroup({\n// ...getLayoutFromWidget(this._spec.position),\n// angle: this._spec.options.angle,\n// zIndex: this._spec.zIndex\n// });\n// this.option.graphicParent.add(this._group);\n\n// this._graphic = this._createGraphic();\n// this._graphic.init();\n\n// this._graphic.applyGraphicAttribute(this._spec.options.graphic);\n\n// this._graphic.applyLayoutData(this._spec.position);\n// this.hide();\n// }\n\n// show(): void {\n// this._graphic?.show();\n// }\n// hide(): void {\n// this._graphic?.hide();\n// }\n\n// getGraphicParent() {\n// return this._group;\n// }\n\n// clearCharacter(): void {\n// if (this._group) {\n// this._group.parent.removeChild(this._group);\n// this._graphic = null;\n// }\n// }\n// }\n"]}
@@ -1,6 +1,9 @@
1
1
  import type { Graphic } from '../graphic/graphic';
2
2
  import { CharacterComponent } from '../character';
3
+ import type { StoryEvent } from '../../../interface';
4
+ import type { ICharacterPickInfo } from '../../runtime-interface';
3
5
  export declare class CharacterComponentImage extends CharacterComponent {
4
6
  readonly graphicType: string;
5
7
  protected _createGraphic(): Graphic;
8
+ checkEvent(event: StoryEvent): false | ICharacterPickInfo;
6
9
  }
@@ -11,5 +11,9 @@ export class CharacterComponentImage extends CharacterComponent {
11
11
  _createGraphic() {
12
12
  return new GraphicImage(StoryComponentType.IMAGE, this);
13
13
  }
14
+ checkEvent(event) {
15
+ const info = super.checkEvent(event);
16
+ return (!info || event.path[event.path.length - 1] !== this._group) && info;
17
+ }
14
18
  }
15
19
  //# sourceMappingURL=character-image.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/characters/character-image.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,OAAO,uBAAwB,SAAQ,kBAAkB;IAA/D;;QACW,gBAAW,GAAW,OAAO,CAAC;IAIzC,CAAC;IAHW,cAAc;QACtB,OAAO,IAAI,YAAY,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAW,CAAC,CAAC;IACjE,CAAC;CACF","file":"character-image.js","sourcesContent":["import type { Graphic } from '../graphic/graphic';\nimport { CharacterComponent } from '../character';\nimport { StoryComponentType } from '../../../../constants/character';\nimport { GraphicImage } from '../graphic/image';\n\nexport class CharacterComponentImage extends CharacterComponent {\n readonly graphicType: string = 'image';\n protected _createGraphic(): Graphic {\n return new GraphicImage(StoryComponentType.IMAGE, this as any);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/characters/character-image.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,MAAM,OAAO,uBAAwB,SAAQ,kBAAkB;IAA/D;;QACW,gBAAW,GAAW,OAAO,CAAC;IAYzC,CAAC;IAXW,cAAc;QACtB,OAAO,IAAI,YAAY,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAW,CAAC,CAAC;IACjE,CAAC;IAED,UAAU,CAAC,KAAiB;QAC1B,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE;YAC7D,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","file":"character-image.js","sourcesContent":["import type { Graphic } from '../graphic/graphic';\nimport { CharacterComponent } from '../character';\nimport { StoryComponentType } from '../../../../constants/character';\nimport { GraphicImage } from '../graphic/image';\nimport type { StoryEvent } from '../../../interface';\nimport type { ICharacterPickInfo } from '../../runtime-interface';\n\nexport class CharacterComponentImage extends CharacterComponent {\n readonly graphicType: string = 'image';\n protected _createGraphic(): Graphic {\n return new GraphicImage(StoryComponentType.IMAGE, this as any);\n }\n\n checkEvent(event: StoryEvent): false | ICharacterPickInfo {\n const info = super.checkEvent(event);\n if (info && event.path[event.path.length - 1] === this._group) {\n return false;\n }\n return info;\n }\n}\n"]}
@@ -1,6 +1,9 @@
1
1
  import type { Graphic } from '../graphic/graphic';
2
2
  import { CharacterComponent } from '../character';
3
+ import type { StoryEvent } from '../../../interface';
4
+ import type { ICharacterPickInfo } from '../../runtime-interface';
3
5
  export declare class CharacterComponentRect extends CharacterComponent {
4
6
  readonly graphicType: string;
5
7
  protected _createGraphic(): Graphic;
8
+ checkEvent(event: StoryEvent): false | ICharacterPickInfo;
6
9
  }
@@ -11,5 +11,9 @@ export class CharacterComponentRect extends CharacterComponent {
11
11
  _createGraphic() {
12
12
  return new GraphicRect(StoryComponentType.RECT, this);
13
13
  }
14
+ checkEvent(event) {
15
+ const info = super.checkEvent(event);
16
+ return (!info || event.path[event.path.length - 1] !== this._group) && info;
17
+ }
14
18
  }
15
19
  //# sourceMappingURL=character-rect.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/characters/character-rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAA9D;;QACW,gBAAW,GAAW,MAAM,CAAC;IAIxC,CAAC;IAHW,cAAc;QACtB,OAAO,IAAI,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;CACF","file":"character-rect.js","sourcesContent":["import type { Graphic } from '../graphic/graphic';\nimport { GraphicRect } from '../graphic/rect';\nimport { CharacterComponent } from '../character';\nimport { StoryComponentType } from '../../../../constants/character';\n\nexport class CharacterComponentRect extends CharacterComponent {\n readonly graphicType: string = 'rect';\n protected _createGraphic(): Graphic {\n return new GraphicRect(StoryComponentType.RECT, this);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/characters/character-rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAIrE,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAA9D;;QACW,gBAAW,GAAW,MAAM,CAAC;IAYxC,CAAC;IAXW,cAAc;QACtB,OAAO,IAAI,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;IAED,UAAU,CAAC,KAAiB;QAC1B,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE;YAC7D,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","file":"character-rect.js","sourcesContent":["import type { Graphic } from '../graphic/graphic';\nimport { GraphicRect } from '../graphic/rect';\nimport { CharacterComponent } from '../character';\nimport { StoryComponentType } from '../../../../constants/character';\nimport type { StoryEvent } from '../../../interface';\nimport type { ICharacterPickInfo } from '../../runtime-interface';\n\nexport class CharacterComponentRect extends CharacterComponent {\n readonly graphicType: string = 'rect';\n protected _createGraphic(): Graphic {\n return new GraphicRect(StoryComponentType.RECT, this);\n }\n\n checkEvent(event: StoryEvent): false | ICharacterPickInfo {\n const info = super.checkEvent(event);\n if (info && event.path[event.path.length - 1] === this._group) {\n return false;\n }\n return info;\n }\n}\n"]}
@@ -1,6 +1 @@
1
- import type { Graphic } from '../graphic/graphic';
2
- import { CharacterComponent } from '../character';
3
- export declare class CharacterComponentRichText extends CharacterComponent {
4
- readonly graphicType: string;
5
- protected _createGraphic(): Graphic;
6
- }
1
+
@@ -1,15 +1,3 @@
1
- import { GraphicRichText } from "../graphic/richtext";
2
1
 
3
- import { CharacterComponent } from "../character";
4
2
 
5
- import { StoryComponentType } from "../../../../constants/character";
6
-
7
- export class CharacterComponentRichText extends CharacterComponent {
8
- constructor() {
9
- super(...arguments), this.graphicType = "richtext";
10
- }
11
- _createGraphic() {
12
- return new GraphicRichText(StoryComponentType.RICH_TEXT, this);
13
- }
14
- }
15
3
  //# sourceMappingURL=character-richtext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/characters/character-richtext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAAlE;;QACW,gBAAW,GAAW,UAAU,CAAC;IAI5C,CAAC;IAHW,cAAc;QACtB,OAAO,IAAI,eAAe,CAAC,kBAAkB,CAAC,SAAS,EAAE,IAAW,CAAC,CAAC;IACxE,CAAC;CACF","file":"character-richtext.js","sourcesContent":["import type { Graphic } from '../graphic/graphic';\nimport { GraphicRichText } from '../graphic/richtext';\nimport { CharacterComponent } from '../character';\nimport { StoryComponentType } from '../../../../constants/character';\n\nexport class CharacterComponentRichText extends CharacterComponent {\n readonly graphicType: string = 'richtext';\n protected _createGraphic(): Graphic {\n return new GraphicRichText(StoryComponentType.RICH_TEXT, this as any);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/characters/character-richtext.ts"],"names":[],"mappings":"","file":"character-richtext.js","sourcesContent":["// import type { Graphic } from '../graphic/graphic';\n// import { GraphicRichText } from '../graphic/richtext';\n// import { CharacterComponent } from '../character';\n// import { StoryComponentType } from '../../../../constants/character';\n\n// export class CharacterComponentRichText extends CharacterComponent {\n// readonly graphicType: string = 'richtext';\n// protected _createGraphic(): Graphic {\n// return new GraphicRichText(StoryComponentType.RICH_TEXT, this as any);\n// }\n// }\n"]}
@@ -1,6 +1,10 @@
1
1
  import type { Graphic } from '../graphic/graphic';
2
2
  import { CharacterComponent } from '../character';
3
+ import type { StoryEvent } from '../../../interface';
4
+ import type { ICharacterPickInfo } from '../../runtime-interface';
3
5
  export declare class CharacterComponentShape extends CharacterComponent {
4
6
  readonly graphicType: string;
5
7
  protected _createGraphic(): Graphic;
8
+ setAttributes(attr: Record<string, any>): void;
9
+ checkEvent(event: StoryEvent): false | ICharacterPickInfo;
6
10
  }
@@ -11,5 +11,20 @@ export class CharacterComponentShape extends CharacterComponent {
11
11
  _createGraphic() {
12
12
  return new GraphicSymbol(StoryComponentType.SHAPE, this);
13
13
  }
14
+ setAttributes(attr) {
15
+ this.group.setAttributes(Object.assign(Object.assign({}, attr), {
16
+ x: attr.x - attr.width / 2,
17
+ y: attr.y - attr.height / 2
18
+ })), this._graphic.setAttributes(Object.assign(Object.assign({}, attr), {
19
+ x: attr.width / 2,
20
+ y: attr.height / 2,
21
+ angle: 0,
22
+ size: Math.min(attr.width, attr.height)
23
+ })), this._text.updateAttribute({});
24
+ }
25
+ checkEvent(event) {
26
+ const info = super.checkEvent(event);
27
+ return (!info || event.path[event.path.length - 1] !== this._group) && info;
28
+ }
14
29
  }
15
30
  //# sourceMappingURL=character-shape.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/characters/character-shape.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,OAAO,uBAAwB,SAAQ,kBAAkB;IAA/D;;QACW,gBAAW,GAAW,OAAO,CAAC;IAIzC,CAAC;IAHW,cAAc;QACtB,OAAO,IAAI,aAAa,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;CACF","file":"character-shape.js","sourcesContent":["import type { Graphic } from '../graphic/graphic';\nimport { CharacterComponent } from '../character';\nimport { StoryComponentType } from '../../../../constants/character';\nimport { GraphicSymbol } from '../graphic/symbol';\n\nexport class CharacterComponentShape extends CharacterComponent {\n readonly graphicType: string = 'shape';\n protected _createGraphic(): Graphic {\n return new GraphicSymbol(StoryComponentType.SHAPE, this);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/characters/character-shape.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD,MAAM,OAAO,uBAAwB,SAAQ,kBAAkB;IAA/D;;QACW,gBAAW,GAAW,OAAO,CAAC;IA4BzC,CAAC;IA3BW,cAAc;QACtB,OAAO,IAAI,aAAa,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED,aAAa,CAAC,IAAyB;QACrC,IAAI,CAAC,KAAK,CAAC,aAAa,iCACnB,IAAI,KACP,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,EAC1B,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,IAC3B,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,aAAa,iCACtB,IAAI,KACP,CAAC,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,EACjB,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,EAClB,KAAK,EAAE,CAAC,EACR,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,IACvC,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,UAAU,CAAC,KAAiB;QAC1B,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE;YAC7D,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","file":"character-shape.js","sourcesContent":["import type { Graphic } from '../graphic/graphic';\nimport { CharacterComponent } from '../character';\nimport { StoryComponentType } from '../../../../constants/character';\nimport { GraphicSymbol } from '../graphic/symbol';\nimport type { StoryEvent } from '../../../interface';\nimport type { ICharacterPickInfo } from '../../runtime-interface';\n\nexport class CharacterComponentShape extends CharacterComponent {\n readonly graphicType: string = 'shape';\n protected _createGraphic(): Graphic {\n return new GraphicSymbol(StoryComponentType.SHAPE, this);\n }\n\n setAttributes(attr: Record<string, any>): void {\n this.group.setAttributes({\n ...attr,\n x: attr.x - attr.width / 2,\n y: attr.y - attr.height / 2\n });\n this._graphic.setAttributes({\n ...attr,\n x: attr.width / 2,\n y: attr.height / 2,\n angle: 0,\n size: Math.min(attr.width, attr.height)\n });\n this._text.updateAttribute({});\n }\n\n checkEvent(event: StoryEvent): false | ICharacterPickInfo {\n const info = super.checkEvent(event);\n if (info && event.path[event.path.length - 1] === this._group) {\n return false;\n }\n return info;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { GraphicPureText } from "../graphic/text";
1
+ import { GraphicText } from "../graphic/text";
2
2
 
3
3
  import { CharacterComponent } from "../character";
4
4
 
@@ -9,7 +9,7 @@ export class CharacterComponentText extends CharacterComponent {
9
9
  super(...arguments), this.graphicType = "text";
10
10
  }
11
11
  _createGraphic() {
12
- return new GraphicPureText(StoryComponentType.TEXT, this);
12
+ return new GraphicText(StoryComponentType.TEXT, this);
13
13
  }
14
14
  }
15
15
  //# sourceMappingURL=character-text.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/characters/character-text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAKrE,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAA9D;;QACW,gBAAW,GAAW,MAAM,CAAC;IAIxC,CAAC;IAHW,cAAc;QACtB,OAAO,IAAI,eAAe,CAAC,kBAAkB,CAAC,IAAI,EAAE,IAAW,CAAC,CAAC;IACnE,CAAC;CACF","file":"character-text.js","sourcesContent":["import type { Graphic } from '../graphic/graphic';\nimport { GraphicPureText } from '../graphic/text';\nimport { CharacterComponent } from '../character';\nimport { StoryComponentType } from '../../../../constants/character';\n\n/**\n * text component 没有关联 graphic,逻辑与 GraphicText 有所不同\n */\nexport class CharacterComponentText extends CharacterComponent {\n readonly graphicType: string = 'text';\n protected _createGraphic(): Graphic {\n return new GraphicPureText(StoryComponentType.TEXT, this as any);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/story/character/component/characters/character-text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAKrE,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAA9D;;QACW,gBAAW,GAAW,MAAM,CAAC;IAIxC,CAAC;IAHW,cAAc;QACtB,OAAO,IAAI,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE,IAAW,CAAC,CAAC;IAC/D,CAAC;CACF","file":"character-text.js","sourcesContent":["import type { Graphic } from '../graphic/graphic';\nimport { GraphicText } from '../graphic/text';\nimport { CharacterComponent } from '../character';\nimport { StoryComponentType } from '../../../../constants/character';\n\n/**\n * text component 没有关联 graphic,逻辑与 GraphicText 有所不同\n */\nexport class CharacterComponentText extends CharacterComponent {\n readonly graphicType: string = 'text';\n protected _createGraphic(): Graphic {\n return new GraphicText(StoryComponentType.TEXT, this as any);\n }\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import type { IWidgetData } from '../../dsl-interface';
2
+ import type { IRichText, IRichTextGraphicAttribute } from '@visactor/vrender';
3
+ import type { CharacterComponent } from '../character';
4
+ export declare const MAX_LAYOUT_SIZE = 999999;
5
+ export declare class GraphicBaseText {
6
+ private _character;
7
+ private _graphic;
8
+ get graphic(): IRichText;
9
+ constructor(graphicCharacter: CharacterComponent);
10
+ getInitialAttributes(): IRichTextGraphicAttribute & {
11
+ graphicAlign: string;
12
+ graphicBaseline: string;
13
+ };
14
+ show(): void;
15
+ hide(): void;
16
+ transformTextAttrsToRichTextConfig(): import("@visactor/vrender").IRichTextCharacter[];
17
+ init(): void;
18
+ applyGraphicAttribute(graphicAttribute: Partial<IRichTextGraphicAttribute>): void;
19
+ getGraphicAttribute(): IRichTextGraphicAttribute;
20
+ updateAttribute: (attribute: Partial<IRichTextGraphicAttribute>) => void;
21
+ applyLayoutData(w: Partial<IWidgetData>): void;
22
+ private _updateGraphicCharacterSize;
23
+ private _transformTextAttributes;
24
+ }
@@ -1,16 +1,37 @@
1
1
  import { getLayoutFromWidget } from "../../../utils/layout";
2
2
 
3
- import { createText } from "@visactor/vrender";
3
+ import { createRichText } from "@visactor/vrender";
4
4
 
5
5
  export const MAX_LAYOUT_SIZE = 999999;
6
6
 
7
- export class GraphicText {
7
+ export class GraphicBaseText {
8
+ get graphic() {
9
+ return this._graphic;
10
+ }
8
11
  constructor(graphicCharacter) {
9
12
  this.updateAttribute = attribute => {
10
13
  attribute && (this._graphic.setAttributes(this._transformTextAttributes(attribute)),
11
14
  this._updateGraphicCharacterSize());
12
15
  }, this._character = graphicCharacter;
13
16
  }
17
+ getInitialAttributes() {
18
+ return {
19
+ visible: !0,
20
+ x: 0,
21
+ y: 0,
22
+ textAlign: "center",
23
+ textBaseline: "middle",
24
+ textConfig: [],
25
+ fontSize: 16,
26
+ graphicAlign: "center",
27
+ graphicBaseline: "middle",
28
+ ignoreBuf: !0,
29
+ height: 0,
30
+ width: 0,
31
+ maxLineWidth: 999999,
32
+ heightLimit: 999999
33
+ };
34
+ }
14
35
  show() {
15
36
  this._graphic.setAttributes({
16
37
  visible: !0
@@ -21,24 +42,23 @@ export class GraphicText {
21
42
  visible: !1
22
43
  });
23
44
  }
24
- init() {
45
+ transformTextAttrsToRichTextConfig() {
25
46
  var _a, _b;
26
- this._graphic = createText(this._transformTextAttributes(Object.assign(Object.assign({
27
- visible: !0,
28
- x: 0,
29
- y: 0,
30
- textAlign: "center",
31
- textBaseline: "middle",
32
- text: null,
33
- fontSize: 16,
34
- whiteSpace: "normal",
35
- graphicAlign: "center",
36
- graphicBaseline: "middle",
37
- fill: "#000000",
38
- ignoreBuf: !0
39
- }, null !== (_b = null === (_a = this._character.spec.options) || void 0 === _a ? void 0 : _a.text) && void 0 !== _b ? _b : {}), {
40
- maxLineWidth: 999999,
41
- heightLimit: 999999
47
+ const textAttr = null !== (_b = null === (_a = this._character.spec.options) || void 0 === _a ? void 0 : _a.text) && void 0 !== _b ? _b : {};
48
+ let textConfig = textAttr.textConfig;
49
+ if ((!textConfig || !textConfig.length) && textAttr.text) {
50
+ const textList = Array.isArray(textAttr.text) ? textAttr.text : [ textAttr.text ];
51
+ textConfig = textList.map(((item, i) => ({
52
+ textAlign: "center",
53
+ textBaseline: "middle",
54
+ text: item + (i < textList.length - 1 ? "\n" : "")
55
+ })));
56
+ }
57
+ return textConfig;
58
+ }
59
+ init() {
60
+ this._graphic = createRichText(this._transformTextAttributes(Object.assign(Object.assign({}, this.getInitialAttributes()), {
61
+ textConfig: this.transformTextAttrsToRichTextConfig()
42
62
  }))), this._character.getGraphicParent().add(this._graphic);
43
63
  }
44
64
  applyGraphicAttribute(graphicAttribute) {
@@ -78,12 +98,13 @@ export class GraphicText {
78
98
  this._graphic.setAttributes(this._transformTextAttributes({
79
99
  x: x,
80
100
  y: y,
81
- textAlign: align,
82
- textBaseline: baseline,
101
+ textAlign: graphicAlign,
102
+ textBaseline: graphicBaseline,
83
103
  angle: layoutData.angle,
84
104
  anchor: [ layoutData.width / 2, layoutData.height / 2 ],
85
105
  scaleCenter: [ layoutData.width / 2, layoutData.height / 2 ],
86
- maxLineWidth: right - left,
106
+ maxWidth: layoutData.width,
107
+ maxHeight: layoutData.height,
87
108
  heightLimit: this._character.graphic.getGraphicAttribute().isResized ? bottom - top : 999999
88
109
  }));
89
110
  }
@@ -94,4 +115,4 @@ export class GraphicText {
94
115
  return attributes;
95
116
  }
96
117
  }
97
- //# sourceMappingURL=graphic-text.js.map
118
+ //# sourceMappingURL=graphic-base-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/story/character/component/graphic/graphic-base-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAc,MAAM,mBAAmB,CAAC;AAG/D,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AAEtC,MAAM,OAAO,eAAe;IAG1B,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IACD,YAAY,gBAAoC;QA6EhD,oBAAe,GAAG,CAAC,SAA6C,EAAQ,EAAE;YACxE,IAAI,SAAS,EAAE;gBACb,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,CAAC;gBACtE,IAAI,CAAC,2BAA2B,EAAE,CAAC;aACpC;QACH,CAAC,CAAC;QAjFA,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC;IAC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AAC,KAAK,GAAG,CAAC,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;YAC1D,QAAQ,EAAE,UAAU,CAAC,KAAK;YAC1B,SAAS,EAAE,UAAU,CAAC,MAAM;YAC5B,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,eAAe;SACtG,CAAC,CACH,CAAC;IACJ,CAAC;IAEO,2BAA2B;QACjC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,SAAS,EAAE;YAQ5D,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;SACjE;IACH,CAAC;IAEO,wBAAwB,CAAC,UAAqC;QACpE,OAAO,UAAU,CAAC;IACpB,CAAC;CACF","file":"graphic-base-text.js","sourcesContent":["import { getLayoutFromWidget } from '../../../utils/layout';\nimport type { IWidgetData } from '../../dsl-interface';\nimport type { IRichText, IRichTextGraphicAttribute, TextAlignType, TextBaselineType } from '@visactor/vrender';\nimport { createRichText, createText } from '@visactor/vrender';\nimport type { CharacterComponent } from '../character';\n\nexport const MAX_LAYOUT_SIZE = 999999;\n\nexport class GraphicBaseText {\n private _character: CharacterComponent;\n private _graphic: IRichText;\n get graphic() {\n return this._graphic;\n }\n constructor(graphicCharacter: CharacterComponent) {\n this._character = graphicCharacter;\n }\n\n getInitialAttributes(): IRichTextGraphicAttribute & { graphicAlign: string; graphicBaseline: string } {\n return {\n visible: true,\n x: 0,\n y: 0,\n textAlign: 'center',\n textBaseline: 'middle',\n textConfig: [],\n fontSize: 16,\n // fill: '#000000',\n // whiteSpace: 'normal',\n graphicAlign: 'center',\n graphicBaseline: 'middle',\n // // compute real height without vrender buffer\n ignoreBuf: true,\n height: 0,\n width: 0,\n maxLineWidth: MAX_LAYOUT_SIZE,\n heightLimit: MAX_LAYOUT_SIZE\n };\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 transformTextAttrsToRichTextConfig() {\n const textAttr = (this._character.spec.options?.text ?? {}) 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: 'center',\n textBaseline: 'middle',\n // ...((textAttr || {}) as any),\n text: item + (i < textList.length - 1 ? '\\n' : '')\n };\n });\n }\n\n return textConfig;\n }\n\n init() {\n this._graphic = createRichText(\n this._transformTextAttributes({\n ...this.getInitialAttributes(),\n textConfig: this.transformTextAttrsToRichTextConfig()\n } as any)\n );\n this._character.getGraphicParent().add(this._graphic);\n }\n\n applyGraphicAttribute(graphicAttribute: Partial<IRichTextGraphicAttribute>): void {\n this._graphic.setAttributes({ ...graphicAttribute });\n }\n\n getGraphicAttribute(): IRichTextGraphicAttribute {\n return this._graphic?.attribute;\n }\n\n updateAttribute = (attribute: Partial<IRichTextGraphicAttribute>): void => {\n if (attribute) {\n this._graphic.setAttributes(this._transformTextAttributes(attribute));\n this._updateGraphicCharacterSize();\n }\n };\n\n applyLayoutData(w: Partial<IWidgetData>): void {\n const layoutData = getLayoutFromWidget(w);\n const layoutRatio = this._character.getTextLayoutRatio();\n const graphicAlign = (this._graphic.attribute as any).graphicAlign;\n const graphicBaseline = (this._graphic.attribute as any).graphicBaseline;\n const left = layoutData.width * layoutRatio.left;\n const right = layoutData.width * layoutRatio.right;\n const center = (left + right) / 2;\n const top = layoutData.height * layoutRatio.top;\n const bottom = layoutData.height * layoutRatio.bottom;\n const middle = (top + bottom) / 2;\n let x = center;\n let align: TextAlignType = 'center';\n let y = middle;\n let baseline: TextBaselineType = 'middle';\n switch (graphicAlign) {\n case 'left':\n x = left;\n align = 'left';\n break;\n case 'center':\n x = center;\n align = 'center';\n break;\n case 'right':\n x = right;\n align = 'right';\n break;\n }\n switch (graphicBaseline) {\n case 'top':\n y = top;\n baseline = 'top';\n break;\n case 'middle':\n y = middle;\n baseline = 'middle';\n break;\n case 'bottom':\n y = bottom;\n baseline = 'bottom';\n break;\n }\n\n this._graphic.setAttributes(\n this._transformTextAttributes({\n x,\n y,\n textAlign: graphicAlign,\n textBaseline: graphicBaseline,\n angle: layoutData.angle,\n anchor: [layoutData.width / 2, layoutData.height / 2],\n scaleCenter: [layoutData.width / 2, layoutData.height / 2],\n maxWidth: layoutData.width,\n maxHeight: layoutData.height,\n heightLimit: this._character.graphic.getGraphicAttribute().isResized ? bottom - top : MAX_LAYOUT_SIZE\n })\n );\n }\n\n private _updateGraphicCharacterSize() {\n if (!this._character.graphic.getGraphicAttribute().isResized) {\n // const layoutRatio = this._character.graphic.getTextLayoutRatio();\n // const textHeight = this._graphic.AABBBounds.height();\n // const minGraphicHeight = this._character.graphic.getInitialAttributes().height;\n // const graphicHeight = Math.max(textHeight / (layoutRatio.bottom - layoutRatio.top), minGraphicHeight);\n // this._character.graphic.applyLayoutData({\n // height: graphicHeight\n // });\n this.applyLayoutData(this._character.graphic.getPositionData());\n }\n }\n\n private _transformTextAttributes(attributes: IRichTextGraphicAttribute): IRichTextGraphicAttribute {\n return attributes;\n }\n}\n"]}
@@ -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":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;A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CAAI,MAAA,IAAI,CAAC,QAAQ,0CAAE,SAAS,CAAC,MAAM,CAAC;QAEpE,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC5D,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC/C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;gBAC7B,OAAO,qBAAqB,CAAC,GAAG,CAAC,CAAC;aACnC;QACH,CAAC,CAAC,CAAC;QACH,qBAAqB,CAAC,MAAM,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;QACvD,qBAAqB,CAAC,WAAW,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;QAC5D,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC;QAC5B,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,qBAAqB,CAAC;IAC/B,CAAC;CACF","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.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AAG,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,IAAI,CAAC,QAAQ,0CAAE,SAAS,CAAC,KAAK,CAAC;QACjE,MAAM,MAAM,GAAG,MAAA,UAAU,CAAC,MAAM,mCAAI,MAAA,IAAI,CAAC,QAAQ,0CAAE,SAAS,CAAC,MAAM,CAAC;QAEpE,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC5D,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC/C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;gBAC7B,OAAO,qBAAqB,CAAC,GAAG,CAAC,CAAC;aACnC;QACH,CAAC,CAAC,CAAC;QACH,qBAAqB,CAAC,MAAM,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;QACvD,qBAAqB,CAAC,WAAW,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;QAC5D,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC;QAC5B,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,qBAAqB,CAAC;IAC/B,CAAC;CACF","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,44 +1,3 @@
1
- import { createRichText } from "@visactor/vrender";
2
1
 
3
- import { Graphic } from "./graphic";
4
2
 
5
- import { getLayoutFromWidget } from "../../../utils/layout";
6
-
7
- export class GraphicRichText extends Graphic {
8
- getInitialAttributes() {
9
- return {
10
- x: 0,
11
- y: 0,
12
- width: 120,
13
- height: 80,
14
- maxWidth: 120,
15
- maxHeight: 80,
16
- angle: 0,
17
- fontSize: 16,
18
- textAlign: "center",
19
- textBaseline: "middle",
20
- fill: "#000000",
21
- lineWidth: 2,
22
- ignoreBuf: !0,
23
- stroke: !1,
24
- ellipsis: !0,
25
- textConfig: []
26
- };
27
- }
28
- init() {
29
- var _a, _b;
30
- this._graphic || (this._graphic = 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 : {}))),
31
- this._graphic.name = `graphic-richtext-${this._character.id}`, this._character.getGraphicParent().add(this._graphic));
32
- }
33
- applyLayoutData(w) {
34
- const {x: x, y: y, width: width, height: height, angle: angle} = getLayoutFromWidget(w);
35
- this._graphic.setAttributes(this._transformAttributes({
36
- x: x,
37
- y: y,
38
- angle: angle,
39
- maxWidth: width,
40
- maxHeight: height
41
- }));
42
- }
43
- }
44
3
  //# sour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EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,mBAAmB,CAAC,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","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
  }
@@ -2,6 +2,8 @@ import { createSymbol } from "@visactor/vrender";
2
2
 
3
3
  import { Graphic } from "./graphic";
4
4
 
5
+ import { getLayoutFromWidget } from "../../../utils/layout";
6
+
5
7
  export class GraphicSymbol extends Graphic {
6
8
  getInitialAttributes() {
7
9
  return {
@@ -19,8 +21,21 @@ export class GraphicSymbol extends Graphic {
19
21
  }
20
22
  init() {
21
23
  var _a, _b;
22
- this._graphic || (this._graphic = 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 : {}))),
23
- this._graphic.name = `graphic-symbol-${this._character.id}`, this._character.getGraphicParent().add(this._graphic));
24
+ if (!this._graphic) {
25
+ 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 : {}));
26
+ this._graphic = createSymbol(attributes), this._graphic.name = `graphic-symbol-${this._character.id}`,
27
+ this._character.getGraphicParent().add(this._graphic);
28
+ }
29
+ }
30
+ applyLayoutData(layoutData) {
31
+ const attributes = this._transformAttributes(Object.assign(Object.assign({}, getLayoutFromWidget(layoutData)), {
32
+ shapePoints: this._character.spec.options.shapePoints
33
+ }));
34
+ attributes.size = Math.min(attributes.width, attributes.height), this._graphic.setAttributes(attributes);
35
+ }
36
+ _transformAttributes(attributes) {
37
+ const data = super._transformAttributes(attributes), {width: width, height: height} = attributes;
38
+ return data.x = width / 2, data.y = height / 2, data;
24
39
  }
25
40
  }
26
41
  //# sourceMappingURL=symbol.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/story/character/component/graphic/symbol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,aAAc,SAAQ,OAAO;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,YAAY,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,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","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,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEj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,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","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"]}