@visactor/vrender-core 0.21.0-alpha.3 → 0.21.0-vstory.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/cjs/animate/Ticker/default-ticker.d.ts +4 -1
  2. package/cjs/animate/Ticker/default-ticker.js +9 -3
  3. package/cjs/animate/Ticker/default-ticker.js.map +1 -1
  4. package/cjs/animate/animate.js +1 -1
  5. package/cjs/animate/animate.js.map +1 -1
  6. package/cjs/animate/easing-func.d.ts +1 -0
  7. package/cjs/animate/easing-func.js +16 -0
  8. package/cjs/animate/easing-func.js.map +1 -0
  9. package/cjs/animate/easing.d.ts +3 -0
  10. package/cjs/animate/easing.js +9 -1
  11. package/cjs/animate/easing.js.map +1 -1
  12. package/cjs/color-string/store.js +1 -2
  13. package/cjs/common/bezier-utils.d.ts +3 -0
  14. package/cjs/common/bezier-utils.js +17 -2
  15. package/cjs/common/bezier-utils.js.map +1 -1
  16. package/cjs/common/bounds-context.js +2 -1
  17. package/cjs/common/custom-path2d.d.ts +4 -0
  18. package/cjs/common/custom-path2d.js +43 -11
  19. package/cjs/common/custom-path2d.js.map +1 -1
  20. package/cjs/common/morphing-utils.js +1 -1
  21. package/cjs/common/path-svg.js +1 -1
  22. package/cjs/common/polygon.js +2 -2
  23. package/cjs/common/rect-utils.js +1 -1
  24. package/cjs/common/render-area.js +1 -2
  25. package/cjs/common/render-command-list.js +1 -1
  26. package/cjs/common/render-curve.js +1 -1
  27. package/cjs/common/render-utils.js +1 -1
  28. package/cjs/common/seg-context.js +1 -1
  29. package/cjs/common/segment/curve/arc.d.ts +4 -1
  30. package/cjs/common/segment/curve/arc.js +10 -1
  31. package/cjs/common/segment/curve/arc.js.map +1 -1
  32. package/cjs/common/segment/curve/base.d.ts +4 -1
  33. package/cjs/common/segment/curve/base.js.map +1 -1
  34. package/cjs/common/segment/curve/cubic-bezier.d.ts +5 -1
  35. package/cjs/common/segment/curve/cubic-bezier.js +24 -3
  36. package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
  37. package/cjs/common/segment/curve/curve-context.js +5 -4
  38. package/cjs/common/segment/curve/curve-context.js.map +1 -1
  39. package/cjs/common/segment/curve/ellipse.d.ts +4 -1
  40. package/cjs/common/segment/curve/ellipse.js +9 -0
  41. package/cjs/common/segment/curve/ellipse.js.map +1 -1
  42. package/cjs/common/segment/curve/line.d.ts +4 -1
  43. package/cjs/common/segment/curve/line.js +18 -0
  44. package/cjs/common/segment/curve/line.js.map +1 -1
  45. package/cjs/common/segment/curve/move.d.ts +4 -1
  46. package/cjs/common/segment/curve/move.js +9 -0
  47. package/cjs/common/segment/curve/move.js.map +1 -1
  48. package/cjs/common/segment/curve/path.d.ts +2 -1
  49. package/cjs/common/segment/curve/path.js +5 -2
  50. package/cjs/common/segment/curve/path.js.map +1 -1
  51. package/cjs/common/segment/curve/quadratic-bezier.d.ts +6 -2
  52. package/cjs/common/segment/curve/quadratic-bezier.js +23 -5
  53. package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
  54. package/cjs/common/simplify.js +1 -1
  55. package/cjs/common/sort.js +1 -1
  56. package/cjs/common/split-path.js +1 -1
  57. package/cjs/common/text.js.map +1 -1
  58. package/cjs/core/application.js +2 -1
  59. package/cjs/core/camera.js +1 -1
  60. package/cjs/core/constants.js +1 -1
  61. package/cjs/core/contributions/textMeasure/AtextMeasure.d.ts +4 -55
  62. package/cjs/core/contributions/textMeasure/AtextMeasure.js +18 -105
  63. package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  64. package/cjs/core/contributions/textMeasure/layout.d.ts +1 -0
  65. package/cjs/core/contributions/textMeasure/layout.js +30 -20
  66. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  67. package/cjs/core/core-modules.js +1 -1
  68. package/cjs/core/global-module.js +2 -0
  69. package/cjs/core/global.js +1 -1
  70. package/cjs/core/graphic-utils.js +1 -1
  71. package/cjs/core/index.js +1 -1
  72. package/cjs/core/layer-service.js +1 -1
  73. package/cjs/core/layer.js +1 -1
  74. package/cjs/core/light.js +1 -1
  75. package/cjs/core/stage.d.ts +0 -3
  76. package/cjs/core/stage.js +3 -12
  77. package/cjs/core/stage.js.map +1 -1
  78. package/cjs/core/window.js +1 -1
  79. package/cjs/event/event-manager.d.ts +0 -1
  80. package/cjs/event/event-manager.js +1 -1
  81. package/cjs/event/event-manager.js.map +1 -1
  82. package/cjs/event/event-system.js +1 -2
  83. package/cjs/event/event-system.js.map +1 -1
  84. package/cjs/graphic/builtin-symbol/arrow.js +2 -2
  85. package/cjs/graphic/builtin-symbol/arrow.js.map +1 -1
  86. package/cjs/graphic/builtin-symbol/arrow2-down.js +2 -2
  87. package/cjs/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  88. package/cjs/graphic/builtin-symbol/arrow2-left.js +2 -2
  89. package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  90. package/cjs/graphic/builtin-symbol/arrow2-right.js +2 -2
  91. package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  92. package/cjs/graphic/builtin-symbol/arrow2-up.js +2 -2
  93. package/cjs/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  94. package/cjs/graphic/builtin-symbol/base.d.ts +1 -0
  95. package/cjs/graphic/builtin-symbol/base.js +3 -0
  96. package/cjs/graphic/builtin-symbol/base.js.map +1 -1
  97. package/cjs/graphic/builtin-symbol/circle.js +3 -3
  98. package/cjs/graphic/builtin-symbol/circle.js.map +1 -1
  99. package/cjs/graphic/builtin-symbol/close.js +3 -3
  100. package/cjs/graphic/builtin-symbol/close.js.map +1 -1
  101. package/cjs/graphic/builtin-symbol/cross.js +2 -2
  102. package/cjs/graphic/builtin-symbol/cross.js.map +1 -1
  103. package/cjs/graphic/builtin-symbol/diamond.js +3 -3
  104. package/cjs/graphic/builtin-symbol/diamond.js.map +1 -1
  105. package/cjs/graphic/builtin-symbol/line-h.js +3 -3
  106. package/cjs/graphic/builtin-symbol/line-h.js.map +1 -1
  107. package/cjs/graphic/builtin-symbol/line-v.js +3 -3
  108. package/cjs/graphic/builtin-symbol/line-v.js.map +1 -1
  109. package/cjs/graphic/builtin-symbol/rect.d.ts +2 -1
  110. package/cjs/graphic/builtin-symbol/rect.js +28 -0
  111. package/cjs/graphic/builtin-symbol/rect.js.map +1 -1
  112. package/cjs/graphic/builtin-symbol/square.js +2 -2
  113. package/cjs/graphic/builtin-symbol/square.js.map +1 -1
  114. package/cjs/graphic/builtin-symbol/star.js +2 -2
  115. package/cjs/graphic/builtin-symbol/star.js.map +1 -1
  116. package/cjs/graphic/builtin-symbol/stroke.js +2 -2
  117. package/cjs/graphic/builtin-symbol/stroke.js.map +1 -1
  118. package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -2
  119. package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  120. package/cjs/graphic/builtin-symbol/triangle-down.js +2 -2
  121. package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
  122. package/cjs/graphic/builtin-symbol/triangle-left.js +2 -2
  123. package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
  124. package/cjs/graphic/builtin-symbol/triangle-right.js +2 -2
  125. package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
  126. package/cjs/graphic/builtin-symbol/triangle-up.js +2 -2
  127. package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
  128. package/cjs/graphic/builtin-symbol/utils.d.ts +3 -1
  129. package/cjs/graphic/builtin-symbol/utils.js +11 -3
  130. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  131. package/cjs/graphic/builtin-symbol/wedge.js +2 -2
  132. package/cjs/graphic/builtin-symbol/wedge.js.map +1 -1
  133. package/cjs/graphic/builtin-symbol/wye.js +2 -2
  134. package/cjs/graphic/builtin-symbol/wye.js.map +1 -1
  135. package/cjs/graphic/config.js +6 -2
  136. package/cjs/graphic/config.js.map +1 -1
  137. package/cjs/graphic/graphic.js +2 -1
  138. package/cjs/graphic/graphic.js.map +1 -1
  139. package/cjs/graphic/richtext/wrapper.d.ts +1 -0
  140. package/cjs/graphic/richtext/wrapper.js +1 -1
  141. package/cjs/graphic/richtext/wrapper.js.map +1 -1
  142. package/cjs/graphic/richtext.js +2 -1
  143. package/cjs/graphic/richtext.js.map +1 -1
  144. package/cjs/graphic/text.d.ts +11 -10
  145. package/cjs/graphic/text.js +174 -91
  146. package/cjs/graphic/text.js.map +1 -1
  147. package/cjs/graphic/wrap-text.js +4 -12
  148. package/cjs/graphic/wrap-text.js.map +1 -1
  149. package/cjs/index.d.ts +1 -0
  150. package/cjs/index.js +1 -1
  151. package/cjs/index.js.map +1 -1
  152. package/cjs/interface/animate.d.ts +7 -2
  153. package/cjs/interface/animate.js.map +1 -1
  154. package/cjs/interface/graphic/path.d.ts +1 -0
  155. package/cjs/interface/graphic/path.js.map +1 -1
  156. package/cjs/interface/graphic/symbol.d.ts +2 -0
  157. package/cjs/interface/graphic/symbol.js.map +1 -1
  158. package/cjs/interface/graphic/text.d.ts +3 -3
  159. package/cjs/interface/graphic/text.js.map +1 -1
  160. package/cjs/interface/graphic.d.ts +6 -2
  161. package/cjs/interface/graphic.js.map +1 -1
  162. package/cjs/interface/path.d.ts +5 -0
  163. package/cjs/interface/path.js.map +1 -1
  164. package/cjs/interface/picker.d.ts +13 -0
  165. package/cjs/interface/picker.js.map +1 -1
  166. package/cjs/interface/stage.d.ts +0 -1
  167. package/cjs/interface/stage.js.map +1 -1
  168. package/cjs/interface/text.d.ts +1 -6
  169. package/cjs/interface/text.js.map +1 -1
  170. package/cjs/picker/constants.d.ts +2 -0
  171. package/cjs/picker/constants.js +3 -2
  172. package/cjs/picker/constants.js.map +1 -1
  173. package/cjs/picker/pick-interceptor.d.ts +7 -2
  174. package/cjs/picker/pick-interceptor.js +19 -2
  175. package/cjs/picker/pick-interceptor.js.map +1 -1
  176. package/cjs/picker/pick-modules.js +7 -4
  177. package/cjs/picker/pick-modules.js.map +1 -1
  178. package/cjs/picker/picker-service.d.ts +4 -2
  179. package/cjs/picker/picker-service.js +13 -12
  180. package/cjs/picker/picker-service.js.map +1 -1
  181. package/cjs/plugins/builtin-plugin/edit-module.d.ts +6 -5
  182. package/cjs/plugins/builtin-plugin/edit-module.js +84 -28
  183. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  184. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
  185. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
  186. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
  187. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +49 -30
  188. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +280 -217
  189. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  190. package/cjs/render/contributions/render/arc3d-render.js.map +1 -1
  191. package/cjs/render/contributions/render/base-render.d.ts +1 -0
  192. package/cjs/render/contributions/render/base-render.js +20 -2
  193. package/cjs/render/contributions/render/base-render.js.map +1 -1
  194. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  195. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +29 -2
  196. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  197. package/cjs/render/contributions/render/contributions/symbol-contribution-render.d.ts +8 -1
  198. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +30 -2
  199. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  200. package/cjs/render/contributions/render/path-render.js.map +1 -1
  201. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  202. package/cjs/render/contributions/render/symbol-render.js +15 -12
  203. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  204. package/cjs/render/contributions/render/text-render.js +23 -1
  205. package/cjs/render/contributions/render/text-render.js.map +1 -1
  206. package/cjs/render/contributions/render/utils.d.ts +1 -2
  207. package/cjs/render/contributions/render/utils.js +4 -20
  208. package/cjs/render/contributions/render/utils.js.map +1 -1
  209. package/dist/index.es.js +8796 -8187
  210. package/es/animate/Ticker/default-ticker.d.ts +4 -1
  211. package/es/animate/Ticker/default-ticker.js +10 -4
  212. package/es/animate/Ticker/default-ticker.js.map +1 -1
  213. package/es/animate/animate.js +1 -1
  214. package/es/animate/animate.js.map +1 -1
  215. package/es/animate/easing-func.d.ts +1 -0
  216. package/es/animate/easing-func.js +10 -0
  217. package/es/animate/easing-func.js.map +1 -0
  218. package/es/animate/easing.d.ts +3 -0
  219. package/es/animate/easing.js +9 -1
  220. package/es/animate/easing.js.map +1 -1
  221. package/es/color-string/store.js +1 -2
  222. package/es/common/bezier-utils.d.ts +3 -0
  223. package/es/common/bezier-utils.js +14 -0
  224. package/es/common/bezier-utils.js.map +1 -1
  225. package/es/common/bounds-context.js +2 -1
  226. package/es/common/custom-path2d.d.ts +4 -0
  227. package/es/common/custom-path2d.js +44 -12
  228. package/es/common/custom-path2d.js.map +1 -1
  229. package/es/common/morphing-utils.js +1 -1
  230. package/es/common/path-svg.js +1 -1
  231. package/es/common/polygon.js +1 -1
  232. package/es/common/rect-utils.js +1 -1
  233. package/es/common/render-area.js +1 -2
  234. package/es/common/render-command-list.js +1 -1
  235. package/es/common/render-curve.js +1 -1
  236. package/es/common/render-utils.js +1 -1
  237. package/es/common/seg-context.js +1 -1
  238. package/es/common/segment/curve/arc.d.ts +4 -1
  239. package/es/common/segment/curve/arc.js +10 -1
  240. package/es/common/segment/curve/arc.js.map +1 -1
  241. package/es/common/segment/curve/base.d.ts +4 -1
  242. package/es/common/segment/curve/base.js.map +1 -1
  243. package/es/common/segment/curve/cubic-bezier.d.ts +5 -1
  244. package/es/common/segment/curve/cubic-bezier.js +22 -1
  245. package/es/common/segment/curve/cubic-bezier.js.map +1 -1
  246. package/es/common/segment/curve/curve-context.js +6 -3
  247. package/es/common/segment/curve/curve-context.js.map +1 -1
  248. package/es/common/segment/curve/ellipse.d.ts +4 -1
  249. package/es/common/segment/curve/ellipse.js +9 -0
  250. package/es/common/segment/curve/ellipse.js.map +1 -1
  251. package/es/common/segment/curve/line.d.ts +4 -1
  252. package/es/common/segment/curve/line.js +18 -0
  253. package/es/common/segment/curve/line.js.map +1 -1
  254. package/es/common/segment/curve/move.d.ts +4 -1
  255. package/es/common/segment/curve/move.js +9 -0
  256. package/es/common/segment/curve/move.js.map +1 -1
  257. package/es/common/segment/curve/path.d.ts +2 -1
  258. package/es/common/segment/curve/path.js +5 -2
  259. package/es/common/segment/curve/path.js.map +1 -1
  260. package/es/common/segment/curve/quadratic-bezier.d.ts +6 -2
  261. package/es/common/segment/curve/quadratic-bezier.js +28 -5
  262. package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
  263. package/es/common/simplify.js +1 -1
  264. package/es/common/sort.js +1 -1
  265. package/es/common/split-path.js +1 -1
  266. package/es/common/text.js.map +1 -1
  267. package/es/core/application.js +2 -1
  268. package/es/core/camera.js +1 -1
  269. package/es/core/constants.js +1 -1
  270. package/es/core/contributions/textMeasure/AtextMeasure.d.ts +4 -55
  271. package/es/core/contributions/textMeasure/AtextMeasure.js +17 -106
  272. package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  273. package/es/core/contributions/textMeasure/layout.d.ts +1 -0
  274. package/es/core/contributions/textMeasure/layout.js +30 -20
  275. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  276. package/es/core/core-modules.js +1 -1
  277. package/es/core/global-module.js +2 -0
  278. package/es/core/global.js +1 -1
  279. package/es/core/graphic-utils.js +1 -1
  280. package/es/core/index.js +1 -1
  281. package/es/core/layer-service.js +1 -1
  282. package/es/core/layer.js +1 -1
  283. package/es/core/light.js +1 -1
  284. package/es/core/stage.d.ts +0 -3
  285. package/es/core/stage.js +2 -13
  286. package/es/core/stage.js.map +1 -1
  287. package/es/core/window.js +1 -1
  288. package/es/event/event-manager.d.ts +0 -1
  289. package/es/event/event-manager.js +1 -1
  290. package/es/event/event-manager.js.map +1 -1
  291. package/es/event/event-system.js +1 -2
  292. package/es/event/event-system.js.map +1 -1
  293. package/es/graphic/builtin-symbol/arrow.js +2 -2
  294. package/es/graphic/builtin-symbol/arrow.js.map +1 -1
  295. package/es/graphic/builtin-symbol/arrow2-down.js +2 -2
  296. package/es/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  297. package/es/graphic/builtin-symbol/arrow2-left.js +2 -2
  298. package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  299. package/es/graphic/builtin-symbol/arrow2-right.js +2 -2
  300. package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  301. package/es/graphic/builtin-symbol/arrow2-up.js +2 -2
  302. package/es/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  303. package/es/graphic/builtin-symbol/base.d.ts +1 -0
  304. package/es/graphic/builtin-symbol/base.js +3 -0
  305. package/es/graphic/builtin-symbol/base.js.map +1 -1
  306. package/es/graphic/builtin-symbol/circle.js +3 -3
  307. package/es/graphic/builtin-symbol/circle.js.map +1 -1
  308. package/es/graphic/builtin-symbol/close.js +3 -3
  309. package/es/graphic/builtin-symbol/close.js.map +1 -1
  310. package/es/graphic/builtin-symbol/cross.js +2 -2
  311. package/es/graphic/builtin-symbol/cross.js.map +1 -1
  312. package/es/graphic/builtin-symbol/diamond.js +3 -3
  313. package/es/graphic/builtin-symbol/diamond.js.map +1 -1
  314. package/es/graphic/builtin-symbol/line-h.js +3 -3
  315. package/es/graphic/builtin-symbol/line-h.js.map +1 -1
  316. package/es/graphic/builtin-symbol/line-v.js +3 -3
  317. package/es/graphic/builtin-symbol/line-v.js.map +1 -1
  318. package/es/graphic/builtin-symbol/rect.d.ts +2 -1
  319. package/es/graphic/builtin-symbol/rect.js +28 -0
  320. package/es/graphic/builtin-symbol/rect.js.map +1 -1
  321. package/es/graphic/builtin-symbol/square.js +2 -2
  322. package/es/graphic/builtin-symbol/square.js.map +1 -1
  323. package/es/graphic/builtin-symbol/star.js +2 -2
  324. package/es/graphic/builtin-symbol/star.js.map +1 -1
  325. package/es/graphic/builtin-symbol/stroke.js +2 -2
  326. package/es/graphic/builtin-symbol/stroke.js.map +1 -1
  327. package/es/graphic/builtin-symbol/thin-triangle.js +2 -2
  328. package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  329. package/es/graphic/builtin-symbol/triangle-down.js +2 -2
  330. package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
  331. package/es/graphic/builtin-symbol/triangle-left.js +2 -2
  332. package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
  333. package/es/graphic/builtin-symbol/triangle-right.js +2 -2
  334. package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
  335. package/es/graphic/builtin-symbol/triangle-up.js +2 -2
  336. package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
  337. package/es/graphic/builtin-symbol/utils.d.ts +3 -1
  338. package/es/graphic/builtin-symbol/utils.js +12 -4
  339. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  340. package/es/graphic/builtin-symbol/wedge.js +2 -2
  341. package/es/graphic/builtin-symbol/wedge.js.map +1 -1
  342. package/es/graphic/builtin-symbol/wye.js +2 -2
  343. package/es/graphic/builtin-symbol/wye.js.map +1 -1
  344. package/es/graphic/config.js +6 -2
  345. package/es/graphic/config.js.map +1 -1
  346. package/es/graphic/graphic.js +2 -1
  347. package/es/graphic/graphic.js.map +1 -1
  348. package/es/graphic/richtext/wrapper.d.ts +1 -0
  349. package/es/graphic/richtext/wrapper.js +1 -1
  350. package/es/graphic/richtext/wrapper.js.map +1 -1
  351. package/es/graphic/richtext.js +2 -1
  352. package/es/graphic/richtext.js.map +1 -1
  353. package/es/graphic/text.d.ts +11 -10
  354. package/es/graphic/text.js +169 -90
  355. package/es/graphic/text.js.map +1 -1
  356. package/es/graphic/wrap-text.js +4 -12
  357. package/es/graphic/wrap-text.js.map +1 -1
  358. package/es/index.d.ts +1 -0
  359. package/es/index.js +2 -0
  360. package/es/index.js.map +1 -1
  361. package/es/interface/animate.d.ts +7 -2
  362. package/es/interface/animate.js.map +1 -1
  363. package/es/interface/graphic/path.d.ts +1 -0
  364. package/es/interface/graphic/path.js.map +1 -1
  365. package/es/interface/graphic/symbol.d.ts +2 -0
  366. package/es/interface/graphic/symbol.js.map +1 -1
  367. package/es/interface/graphic/text.d.ts +3 -3
  368. package/es/interface/graphic/text.js.map +1 -1
  369. package/es/interface/graphic.d.ts +6 -2
  370. package/es/interface/graphic.js.map +1 -1
  371. package/es/interface/path.d.ts +5 -0
  372. package/es/interface/path.js.map +1 -1
  373. package/es/interface/picker.d.ts +13 -0
  374. package/es/interface/picker.js.map +1 -1
  375. package/es/interface/stage.d.ts +0 -1
  376. package/es/interface/stage.js.map +1 -1
  377. package/es/interface/text.d.ts +1 -6
  378. package/es/interface/text.js.map +1 -1
  379. package/es/picker/constants.d.ts +2 -0
  380. package/es/picker/constants.js +4 -0
  381. package/es/picker/constants.js.map +1 -1
  382. package/es/picker/pick-interceptor.d.ts +7 -2
  383. package/es/picker/pick-interceptor.js +19 -1
  384. package/es/picker/pick-interceptor.js.map +1 -1
  385. package/es/picker/pick-modules.js +5 -3
  386. package/es/picker/pick-modules.js.map +1 -1
  387. package/es/picker/picker-service.d.ts +4 -2
  388. package/es/picker/picker-service.js +13 -13
  389. package/es/picker/picker-service.js.map +1 -1
  390. package/es/plugins/builtin-plugin/edit-module.d.ts +6 -5
  391. package/es/plugins/builtin-plugin/edit-module.js +79 -25
  392. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  393. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
  394. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
  395. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
  396. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +49 -30
  397. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +283 -214
  398. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  399. package/es/render/contributions/render/arc3d-render.js.map +1 -1
  400. package/es/render/contributions/render/base-render.d.ts +1 -0
  401. package/es/render/contributions/render/base-render.js +21 -2
  402. package/es/render/contributions/render/base-render.js.map +1 -1
  403. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  404. package/es/render/contributions/render/contributions/base-texture-contribution-render.js +29 -2
  405. package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  406. package/es/render/contributions/render/contributions/symbol-contribution-render.d.ts +8 -1
  407. package/es/render/contributions/render/contributions/symbol-contribution-render.js +26 -0
  408. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  409. package/es/render/contributions/render/path-render.js.map +1 -1
  410. package/es/render/contributions/render/polygon-render.js.map +1 -1
  411. package/es/render/contributions/render/symbol-render.js +16 -13
  412. package/es/render/contributions/render/symbol-render.js.map +1 -1
  413. package/es/render/contributions/render/text-render.js +23 -1
  414. package/es/render/contributions/render/text-render.js.map +1 -1
  415. package/es/render/contributions/render/utils.d.ts +1 -2
  416. package/es/render/contributions/render/utils.js +0 -18
  417. package/es/render/contributions/render/utils.js.map +1 -1
  418. package/package.json +3 -3
  419. package/cjs/graphic/text2.d.ts +0 -81
  420. package/cjs/graphic/text2.js +0 -288
  421. package/cjs/graphic/text2.js.map +0 -1
  422. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.d.ts +0 -16
  423. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js +0 -48
  424. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js.map +0 -1
  425. package/es/graphic/text2.d.ts +0 -81
  426. package/es/graphic/text2.js +0 -293
  427. package/es/graphic/text2.js.map +0 -1
  428. package/es/plugins/builtin-plugin/auto-refresh-plugin.d.ts +0 -16
  429. package/es/plugins/builtin-plugin/auto-refresh-plugin.js +0 -41
  430. package/es/plugins/builtin-plugin/auto-refresh-plugin.js.map +0 -1
@@ -206,7 +206,8 @@ class RichText extends graphic_1.Graphic {
206
206
  p.overflow = !0, p.left = 1e3, p.top = 1e3, frame.lines[frame.lines.length - 1].paragraphs.push(p),
207
207
  skip = !0), p.newLine && (skip = !1, wrapper.lineWidth = 0), wrapper.send();
208
208
  }
209
- } else for (let i = 0; i < paragraphs.length; i++) wrapper.deal(paragraphs[i]);
209
+ } else for (let i = 0; i < paragraphs.length; i++) i === paragraphs.length - 1 && (wrapper.newLine = !0),
210
+ wrapper.deal(paragraphs[i]), wrapper.newLine = !1;
210
211
  wrapper.send();
211
212
  if (!("horizontal" === frame.layoutDirection ? richTextWidthEnable : richTextHeightEnable)) {
212
213
  const frameSize = frame.getActualSizeWidthEllipsis();
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/richtext.ts"],"names":[],"mappings":";;;;;;AACA,6CAA4C;AAgB5C,uCAAiF;AACjF,qCAAoD;AACpD,6DAAqC;AACrC,qEAA6C;AAC7C,iEAAyC;AACzC,mCAAmC;AACnC,0CAA+C;AAE/C,gDAA6C;AAC7C,2CAAmD;AAEnD,MAAM,uBAAuB,GAAG;IAC9B,OAAO;IACP,QAAQ;IACR,UAAU;IACV,WAAW;IACX,mBAAmB;IACnB,WAAW;IACX,UAAU;IACV,WAAW;IACX,cAAc;IACd,YAAY;IACZ,iBAAiB;IACjB,MAAM;IACN,QAAQ;IACR,UAAU;IACV,GAAG,gCAAsB;CAC1B,CAAC;AAEF,MAAa,QAAS,SAAQ,iBAAkC;IAiB9D,YAAY,MAAkC;QAC5C,KAAK,CAAC,MAAM,CAAC,CAAC;QAjBhB,SAAI,GAAe,UAAU,CAAC;QAG9B,sBAAiB,GAAyB,IAAI,CAAC;QAe7C,IAAI,CAAC,UAAU,GAAG,gCAAoB,CAAC;QAEvC,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC,GAAQ,EAAE,UAAe,EAAE,GAA6B,EAAE,EAAE;YAC3F,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;gBACrB,IAAI,GAAG,KAAK,aAAa,EAAE;oBACzB,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,UAAU,CA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Number } from '@visactor/vutils';\nimport type {\n IRichText,\n IRichTextCharacter,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n RichTextVerticalDirection,\n RichTextWordBreak,\n IRichTextGraphicAttribute,\n IRichTextImageCharacter,\n IRichTextParagraphCharacter,\n IStage,\n ILayer,\n IRichTextIcon,\n EventPoint\n} from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { DefaultRichTextAttribute } from './config';\nimport Frame from './richtext/frame';\nimport Paragraph from './richtext/paragraph';\nimport Wrapper from './richtext/wrapper';\nimport { getTheme } from './theme';\nimport { RichTextIcon } from './richtext/icon';\nimport type { FederatedMouseEvent } from '../event';\nimport { application } from '../application';\nimport { RICHTEXT_NUMBER_TYPE } from './constants';\n\nconst RICHTEXT_UPDATE_TAG_KEY = [\n 'width',\n 'height',\n 'ellipsis',\n 'wordBreak',\n 'verticalDirection',\n 'maxHeight',\n 'maxWidth',\n 'textAlign',\n 'textBaseline',\n 'textConfig',\n 'layoutDirection',\n 'fill',\n 'stroke',\n 'fontSize',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\nexport class RichText extends Graphic<IRichTextGraphicAttribute> implements IRichText {\n type: 'richtext' = 'richtext';\n\n _frameCache: Frame; // 富文本布局画布\n _currentHoverIcon: IRichTextIcon | null = null;\n\n static NOWORK_ANIMATE_ATTR = {\n ellipsis: 1,\n wordBreak: 1,\n verticalDirection: 1,\n textAlign: 1,\n textBaseline: 1,\n textConfig: 1,\n layoutDirection: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n constructor(params?: IRichTextGraphicAttribute) {\n super(params);\n this.numberType = RICHTEXT_NUMBER_TYPE;\n\n this.onBeforeAttributeUpdate = ((val: any, attributes: any, key: null | string | string[]) => {\n for (const key in val) {\n if (key === 'hoverIconId') {\n if (val[key] === attributes[key]) {\n continue;\n }\n const icon = this._frameCache.icons.get(val[key]);\n this.updateHoverIconState(icon);\n }\n }\n }) as any;\n }\n\n get width(): number {\n return this.attribute.width ?? DefaultRichTextAttribute.width;\n }\n set width(w: number) {\n if (this.attribute.width === w) {\n return;\n }\n this.attribute.width = w;\n this.addUpdateShapeAndBoundsTag();\n }\n get height(): number {\n return this.attribute.height ?? DefaultRichTextAttribute.height;\n }\n set height(h: number) {\n if (this.attribute.height === h) {\n return;\n }\n this.attribute.height = h;\n this.addUpdateShapeAndBoundsTag();\n }\n get maxWidth(): number | undefined {\n return this.attribute.maxWidth;\n }\n set maxWidth(mw: number | undefined) {\n if (this.attribute.maxWidth === mw) {\n return;\n }\n this.attribute.maxWidth = mw;\n this.addUpdateShapeAndBoundsTag();\n }\n get maxHeight(): number | undefined {\n return this.attribute.maxHeight;\n }\n set maxHeight(mh: number | undefined) {\n if (this.attribute.maxHeight === mh) {\n return;\n }\n this.attribute.maxHeight = mh;\n this.addUpdateShapeAndBoundsTag();\n }\n get ellipsis(): boolean | string {\n return this.attribute.ellipsis ?? DefaultRichTextAttribute.ellipsis;\n }\n set ellipsis(e: boolean | string) {\n if (this.attribute.ellipsis === e) {\n return;\n }\n this.attribute.ellipsis = e;\n this.addUpdateShapeAndBoundsTag();\n }\n get wordBreak(): RichTextWordBreak {\n return this.attribute.wordBreak ?? DefaultRichTextAttribute.wordBreak;\n }\n set wordBreak(wb: RichTextWordBreak) {\n if (this.attribute.wordBreak === wb) {\n return;\n }\n this.attribute.wordBreak = wb;\n this.addUpdateShapeAndBoundsTag();\n }\n get verticalDirection(): RichTextVerticalDirection {\n return this.attribute.verticalDirection ?? DefaultRichTextAttribute.verticalDirection;\n }\n set verticalDirection(vd: RichTextVerticalDirection) {\n if (this.attribute.verticalDirection === vd) {\n return;\n }\n this.attribute.verticalDirection = vd;\n this.addUpdateShapeAndBoundsTag();\n }\n get textAlign(): RichTextGlobalAlignType {\n return this.attribute.textAlign ?? DefaultRichTextAttribute.textAlign;\n }\n set textAlign(align: RichTextGlobalAlignType) {\n if (this.attribute.textAlign === align) {\n return;\n }\n this.attribute.textAlign = align;\n this.addUpdateShapeAndBoundsTag();\n }\n get textBaseline(): RichTextGlobalBaselineType {\n return this.attribute.textBaseline ?? DefaultRichTextAttribute.textBaseline;\n }\n set textBaseline(baseline: RichTextGlobalBaselineType) {\n if (this.attribute.textBaseline === baseline) {\n return;\n }\n this.attribute.textBaseline = baseline;\n this.addUpdateShapeAndBoundsTag();\n }\n get textConfig(): IRichTextCharacter[] {\n return this.attribute.textConfig ?? DefaultRichTextAttribute.textConfig;\n }\n set textConfig(config: IRichTextCharacter[]) {\n this.attribute.textConfig = config;\n this.addUpdateShapeAndBoundsTag();\n }\n\n getGraphicTheme(): Required<IRichTextGraphicAttribute> {\n return getTheme(this).richtext;\n }\n\n protected updateAABBBounds(\n attribute: IRichTextGraphicAttribute,\n richtextTheme: Required<IRichTextGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n const {\n width = richtextTheme.width,\n height = richtextTheme.height,\n maxWidth = richtextTheme.maxWidth,\n maxHeight = richtextTheme.maxHeight,\n textAlign = richtextTheme.textAlign,\n textBaseline = richtextTheme.textBaseline\n } = attribute;\n\n if (width > 0 && height > 0) {\n // 外部设置宽高\n aabbBounds.set(0, 0, width, height);\n } else {\n // 获取内容宽高\n const frameCache = this.getFrameCache();\n const { width: actualWidth, height: actualHeight } = frameCache.getActualSize();\n let contentWidth = width || actualWidth || 0;\n let contentHeight = height || actualHeight || 0;\n\n contentHeight = typeof maxHeight === 'number' && contentHeight > maxHeight ? maxHeight : contentHeight || 0;\n contentWidth = typeof maxWidth === 'number' && contentWidth > maxWidth ? maxWidth : contentWidth || 0;\n\n aabbBounds.set(0, 0, contentWidth, contentHeight);\n }\n\n // 调整对齐方式\n let deltaY = 0;\n switch (textBaseline) {\n case 'top':\n deltaY = 0;\n break;\n case 'middle':\n deltaY = -aabbBounds.height() / 2;\n break;\n case 'bottom':\n deltaY = -aabbBounds.height();\n break;\n default:\n break;\n }\n let deltaX = 0;\n switch (textAlign) {\n case 'left':\n deltaX = 0;\n break;\n case 'center':\n deltaX = -aabbBounds.width() / 2;\n break;\n case 'right':\n deltaX = -aabbBounds.width();\n break;\n default:\n break;\n }\n aabbBounds.translate(deltaX, deltaY);\n\n application.graphicService.updateTempAABBBounds(aabbBounds);\n\n if (attribute.forceBoundsHeight != null || attribute.forceBoundsWidth != null) {\n application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds);\n }\n application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, false, this);\n return aabbBounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, RICHTEXT_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, RICHTEXT_UPDATE_TAG_KEY);\n }\n getFrameCache(): Frame {\n if (this.shouldUpdateShape()) {\n this.doUpdateFrameCache();\n this.clearUpdateShapeTag();\n }\n return this._frameCache;\n }\n\n get cliped() {\n const frameCache = this.getFrameCache();\n if (frameCache.actualHeight > frameCache.height) {\n return true;\n }\n const { disableAutoWrapLine } = this.attribute;\n if (disableAutoWrapLine) {\n for (let i = 0; i < frameCache.lines.length; i++) {\n const l = frameCache.lines[i];\n for (let j = 0; j < l.paragraphs.length; j++) {\n const p = l.paragraphs[j];\n if ((p as any).overflow && (p as any).text !== '') {\n return true;\n }\n }\n }\n }\n return false;\n // if (height < this.attribute.height || )\n }\n combinedStyleToCharacter(config: IRichTextImageCharacter | IRichTextParagraphCharacter) {\n const {\n fill,\n stroke,\n fontSize,\n fontFamily,\n fontStyle,\n fontWeight,\n lineWidth,\n opacity,\n fillOpacity,\n strokeOpacity\n } = this.attribute;\n return {\n fill,\n stroke,\n fontSize,\n fontFamily,\n fontStyle,\n fontWeight,\n lineWidth,\n opacity,\n fillOpacity,\n strokeOpacity,\n ...config\n };\n }\n doUpdateFrameCache(tc?: IRichTextCharacter[]) {\n // 1. 测量,生成paragraph\n const {\n textConfig: _tc = [],\n maxWidth,\n maxHeight,\n width,\n height,\n ellipsis,\n wordBreak,\n verticalDirection,\n textAlign,\n textBaseline,\n layoutDirection,\n singleLine,\n disableAutoWrapLine\n } = this.attribute;\n const paragraphs: (Paragraph | RichTextIcon)[] = [];\n\n const textConfig = tc ?? _tc;\n\n for (let i = 0; i < textConfig.length; i++) {\n if ('image' in textConfig[i]) {\n const config = this.combinedStyleToCharacter(\n textConfig[i] as IRichTextImageCharacter\n ) as IRichTextImageCharacter;\n (config as any).lineWidth = undefined; // for icon bounds\n // 直接创建icon Mark\n const iconCache =\n config.id && this._frameCache && this._frameCache.icons && this._frameCache.icons.get(config.id);\n if (iconCache) {\n paragraphs.push(iconCache as RichTextIcon);\n } else {\n const icon = new RichTextIcon(config);\n icon.successCallback = () => {\n this.addUpdateBoundTag();\n this.stage?.renderNextFrame();\n };\n icon.richtextId = config.id;\n paragraphs.push(icon);\n }\n } else {\n const richTextConfig = this.combinedStyleToCharacter(\n textConfig[i] as IRichTextParagraphCharacter\n ) as IRichTextParagraphCharacter;\n if (isNumber(richTextConfig.text)) {\n richTextConfig.text = `${richTextConfig.text}`;\n }\n if (richTextConfig.text && richTextConfig.text.includes('\\n')) {\n // 如果有文字内有换行符,将该段文字切为多段,并在后一段加入newLine标记\n const textParts = richTextConfig.text.split('\\n');\n for (let j = 0; j < textParts.length; j++) {\n paragraphs.push(new Paragraph(textParts[j], j !== 0, richTextConfig));\n }\n } else if (richTextConfig.text) {\n paragraphs.push(new Paragraph(richTextConfig.text, false, richTextConfig));\n }\n }\n }\n\n // 2. 布局,生成frame\n // const frameHeight =\n // typeof maxHeight === 'number' && (!height || height > maxHeight) // height = 0或height>maxHeight,使用maxHeight布局\n // ? maxHeight\n // : height;\n // const frameWidth =\n // typeof maxWidth === 'number' && (!width || width > maxWidth) // height = 0或height>maxWidth,使用maxWidth布局\n // ? maxWidth\n // : width;\n\n const maxWidthFinite = typeof maxWidth === 'number' && Number.isFinite(maxWidth) && maxWidth > 0;\n const maxHeightFinite = typeof maxHeight === 'number' && Number.isFinite(maxHeight) && maxHeight > 0;\n\n const richTextWidthEnable =\n typeof width === 'number' &&\n Number.isFinite(width) &&\n width > 0 &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (!maxWidthFinite || width <= maxWidth);\n const richTextHeightEnable =\n typeof height === 'number' &&\n Number.isFinite(height) &&\n height > 0 &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (!maxHeightFinite || height <= maxHeight);\n\n const frameWidth = richTextWidthEnable ? width : maxWidthFinite ? maxWidth : 0;\n const frameHeight = richTextHeightEnable ? height : maxHeightFinite ? maxHeight : 0;\n\n const frame = new Frame(\n 0,\n 0,\n frameWidth || 0,\n frameHeight || 0,\n ellipsis,\n wordBreak,\n verticalDirection,\n textAlign,\n textBaseline,\n layoutDirection || 'horizontal',\n // typeof maxWidth === 'number' && (!width || width > maxWidth),\n // typeof maxHeight === 'number' && (!height || height > maxHeight),\n !richTextWidthEnable && maxWidthFinite,\n !richTextHeightEnable && maxHeightFinite,\n singleLine || false,\n this._frameCache?.icons\n );\n const wrapper = new Wrapper(frame);\n if (disableAutoWrapLine) {\n let lineCount = 0;\n let skip = false;\n for (let i = 0; i < paragraphs.length; i++) {\n const p = paragraphs[i];\n if (skip) {\n (p as Paragraph).overflow = true;\n (p as Paragraph).left = Infinity;\n (p as Paragraph).top = Infinity;\n !(p as Paragraph).newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p);\n } else {\n wrapper.deal(p, true);\n }\n if (frame.lines.length !== lineCount) {\n lineCount = frame.lines.length;\n wrapper.lineBuffer.length = 0;\n (p as Paragraph).overflow = true;\n (p as Paragraph).left = 1000;\n (p as Paragraph).top = 1000;\n frame.lines[frame.lines.length - 1].paragraphs.push(p);\n skip = true;\n }\n if ((p as Paragraph).newLine) {\n skip = false;\n wrapper.lineWidth = 0;\n }\n wrapper.send();\n }\n } else {\n for (let i = 0; i < paragraphs.length; i++) {\n wrapper.deal(paragraphs[i]);\n }\n }\n\n wrapper.send(); // 最后一行手动输出\n\n // 如果对应的配置宽度不可用,那么需要额外进行一次对齐\n const directionEnable = frame.layoutDirection === 'horizontal' ? richTextWidthEnable : richTextHeightEnable;\n if (!directionEnable) {\n // 使用实际宽度\n const frameSize = frame.getActualSizeWidthEllipsis();\n let offsetSize = frame.layoutDirection === 'horizontal' ? frameSize.width : frameSize.height;\n // 如果最大值可用\n if (frame.layoutDirection === 'horizontal' ? maxWidthFinite : maxHeightFinite) {\n // 取2者中的较小值\n offsetSize = Math.min(\n offsetSize,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n frame.layoutDirection === 'horizontal' ? maxWidth : maxHeight\n );\n }\n\n frame.lines.forEach(function (l) {\n l.calcOffset(offsetSize, false);\n });\n }\n\n this._frameCache = frame;\n\n // this.bindIconEvent();\n }\n\n clone() {\n return new RichText({ ...this.attribute });\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n super.setStage(stage, layer);\n const frameCache = this.getFrameCache();\n // for (let i = 0; i < frameCache.icons.length; i++) {\n // const icon = frameCache.icons[i];\n // icon.setStage(stage, layer);\n // }\n frameCache.icons.forEach(icon => {\n icon.setStage(stage, layer);\n });\n }\n\n // richtext绑定icon交互事件,供外部调用\n bindIconEvent() {\n this.addEventListener('pointermove', (e: FederatedMouseEvent) => {\n const pickedIcon = this.pickIcon(e.global);\n if (pickedIcon && pickedIcon === this._currentHoverIcon) {\n // do nothing\n } else if (pickedIcon) {\n this.setAttribute('hoverIconId', pickedIcon.richtextId);\n\n // this._currentHoverIcon?.setHoverState(false);\n // this._currentHoverIcon = pickedIcon;\n // this._currentHoverIcon.setHoverState(true);\n // this.stage?.setCursor(pickedIcon.attribute.cursor);\n // this.stage?.renderNextFrame();\n } else if (!pickedIcon && this._currentHoverIcon) {\n this.setAttribute('hoverIconId', undefined);\n\n // this._currentHoverIcon.setHoverState(false);\n // this._currentHoverIcon = null;\n // this.stage?.setCursor();\n // this.stage?.renderNextFrame();\n }\n });\n\n this.addEventListener('pointerleave', (e: FederatedMouseEvent) => {\n if (this._currentHoverIcon) {\n this.setAttribute('hoverIconId', undefined);\n\n // this._currentHoverIcon.setHoverState(false);\n // this._currentHoverIcon = null;\n // this.stage?.setCursor();\n // this.stage?.renderNextFrame();\n }\n });\n }\n\n updateHoverIconState(pickedIcon?: IRichTextIcon) {\n if (pickedIcon) {\n this._currentHoverIcon?.setHoverState(false);\n this._currentHoverIcon = pickedIcon;\n this._currentHoverIcon.setHoverState(true);\n this.stage?.setCursor(pickedIcon.attribute.cursor);\n this.stage?.renderNextFrame();\n } else {\n this._currentHoverIcon.setHoverState(false);\n this._currentHoverIcon = null;\n this.stage?.setCursor();\n this.stage?.renderNextFrame();\n }\n }\n\n pickIcon(point: EventPoint): IRichTextIcon | undefined {\n const frameCache = this.getFrameCache();\n const { e: x, f: y } = this.globalTransMatrix;\n // for (let i = 0; i < frameCache.icons.length; i++) {\n // const icon = frameCache.icons[i];\n // if (icon.containsPoint(point.x - x, point.y - y)) {\n // return icon;\n // }\n // }\n let pickIcon: IRichTextIcon | undefined;\n frameCache.icons.forEach((icon, key) => {\n const bounds = icon.AABBBounds.clone();\n bounds.translate(icon._marginArray[3], icon._marginArray[0]);\n if (bounds.containsPoint({ x: point.x - x, y: point.y - y })) {\n pickIcon = icon;\n\n pickIcon.globalX = (pickIcon.attribute.x ?? 0) + x + icon._marginArray[3];\n pickIcon.globalY = (pickIcon.attribute.y ?? 0) + y + icon._marginArray[0];\n }\n });\n\n return pickIcon;\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return RichText.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createRichText(attributes: IRichTextGraphicAttribute): IRichText {\n return new RichText(attributes);\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/richtext.ts"],"names":[],"mappings":";;;;;;AACA,6CAA4C;AAgB5C,uCAAiF;AACjF,qCAAoD;AACpD,6DAAqC;AACrC,qEAA6C;AAC7C,iEAAyC;AAC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gBAC5D,QAAQ,GAAG,IAAI,CAAC;gBAEhB,QAAQ,CAAC,OAAO,GAAG,CAAC,MAAA,QAAQ,CAAC,SAAS,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBAC1E,QAAQ,CAAC,OAAO,GAAG,CAAC,MAAA,QAAQ,CAAC,SAAS,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;aAC3E;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,oBAAoB;QAClB,OAAO,QAAQ,CAAC,mBAAmB,CAAC;IACtC,CAAC;;AAzhBH,4BA0hBC;AAphBQ,4BAAmB,mBACxB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,EACZ,iBAAiB,EAAE,CAAC,EACpB,SAAS,EAAE,CAAC,EACZ,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,CAAC,EACb,eAAe,EAAE,CAAC,IACf,6BAAmB,EACtB;AA6gBJ,SAAgB,cAAc,CAAC,UAAqC;IAClE,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC;AAFD,wCAEC","file":"richtext.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { isNumber } from '@visactor/vutils';\nimport type {\n IRichText,\n IRichTextCharacter,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n RichTextVerticalDirection,\n RichTextWordBreak,\n IRichTextGraphicAttribute,\n IRichTextImageCharacter,\n IRichTextParagraphCharacter,\n IStage,\n ILayer,\n IRichTextIcon,\n EventPoint\n} from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { DefaultRichTextAttribute } from './config';\nimport Frame from './richtext/frame';\nimport Paragraph from './richtext/paragraph';\nimport Wrapper from './richtext/wrapper';\nimport { getTheme } from './theme';\nimport { RichTextIcon } from './richtext/icon';\nimport type { FederatedMouseEvent } from '../event';\nimport { application } from '../application';\nimport { RICHTEXT_NUMBER_TYPE } from './constants';\n\nconst RICHTEXT_UPDATE_TAG_KEY = [\n 'width',\n 'height',\n 'ellipsis',\n 'wordBreak',\n 'verticalDirection',\n 'maxHeight',\n 'maxWidth',\n 'textAlign',\n 'textBaseline',\n 'textConfig',\n 'layoutDirection',\n 'fill',\n 'stroke',\n 'fontSize',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\nexport class RichText extends Graphic<IRichTextGraphicAttribute> implements IRichText {\n type: 'richtext' = 'richtext';\n\n _frameCache: Frame; // 富文本布局画布\n _currentHoverIcon: IRichTextIcon | null = null;\n\n static NOWORK_ANIMATE_ATTR = {\n ellipsis: 1,\n wordBreak: 1,\n verticalDirection: 1,\n textAlign: 1,\n textBaseline: 1,\n textConfig: 1,\n layoutDirection: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n constructor(params?: IRichTextGraphicAttribute) {\n super(params);\n this.numberType = RICHTEXT_NUMBER_TYPE;\n\n this.onBeforeAttributeUpdate = ((val: any, attributes: any, key: null | string | string[]) => {\n for (const key in val) {\n if (key === 'hoverIconId') {\n if (val[key] === attributes[key]) {\n continue;\n }\n const icon = this._frameCache.icons.get(val[key]);\n this.updateHoverIconState(icon);\n }\n }\n }) as any;\n }\n\n get width(): number {\n return this.attribute.width ?? DefaultRichTextAttribute.width;\n }\n set width(w: number) {\n if (this.attribute.width === w) {\n return;\n }\n this.attribute.width = w;\n this.addUpdateShapeAndBoundsTag();\n }\n get height(): number {\n return this.attribute.height ?? DefaultRichTextAttribute.height;\n }\n set height(h: number) {\n if (this.attribute.height === h) {\n return;\n }\n this.attribute.height = h;\n this.addUpdateShapeAndBoundsTag();\n }\n get maxWidth(): number | undefined {\n return this.attribute.maxWidth;\n }\n set maxWidth(mw: number | undefined) {\n if (this.attribute.maxWidth === mw) {\n return;\n }\n this.attribute.maxWidth = mw;\n this.addUpdateShapeAndBoundsTag();\n }\n get maxHeight(): number | undefined {\n return this.attribute.maxHeight;\n }\n set maxHeight(mh: number | undefined) {\n if (this.attribute.maxHeight === mh) {\n return;\n }\n this.attribute.maxHeight = mh;\n this.addUpdateShapeAndBoundsTag();\n }\n get ellipsis(): boolean | string {\n return this.attribute.ellipsis ?? DefaultRichTextAttribute.ellipsis;\n }\n set ellipsis(e: boolean | string) {\n if (this.attribute.ellipsis === e) {\n return;\n }\n this.attribute.ellipsis = e;\n this.addUpdateShapeAndBoundsTag();\n }\n get wordBreak(): RichTextWordBreak {\n return this.attribute.wordBreak ?? DefaultRichTextAttribute.wordBreak;\n }\n set wordBreak(wb: RichTextWordBreak) {\n if (this.attribute.wordBreak === wb) {\n return;\n }\n this.attribute.wordBreak = wb;\n this.addUpdateShapeAndBoundsTag();\n }\n get verticalDirection(): RichTextVerticalDirection {\n return this.attribute.verticalDirection ?? DefaultRichTextAttribute.verticalDirection;\n }\n set verticalDirection(vd: RichTextVerticalDirection) {\n if (this.attribute.verticalDirection === vd) {\n return;\n }\n this.attribute.verticalDirection = vd;\n this.addUpdateShapeAndBoundsTag();\n }\n get textAlign(): RichTextGlobalAlignType {\n return this.attribute.textAlign ?? DefaultRichTextAttribute.textAlign;\n }\n set textAlign(align: RichTextGlobalAlignType) {\n if (this.attribute.textAlign === align) {\n return;\n }\n this.attribute.textAlign = align;\n this.addUpdateShapeAndBoundsTag();\n }\n get textBaseline(): RichTextGlobalBaselineType {\n return this.attribute.textBaseline ?? DefaultRichTextAttribute.textBaseline;\n }\n set textBaseline(baseline: RichTextGlobalBaselineType) {\n if (this.attribute.textBaseline === baseline) {\n return;\n }\n this.attribute.textBaseline = baseline;\n this.addUpdateShapeAndBoundsTag();\n }\n get textConfig(): IRichTextCharacter[] {\n return this.attribute.textConfig ?? DefaultRichTextAttribute.textConfig;\n }\n set textConfig(config: IRichTextCharacter[]) {\n this.attribute.textConfig = config;\n this.addUpdateShapeAndBoundsTag();\n }\n\n getGraphicTheme(): Required<IRichTextGraphicAttribute> {\n return getTheme(this).richtext;\n }\n\n protected updateAABBBounds(\n attribute: IRichTextGraphicAttribute,\n richtextTheme: Required<IRichTextGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n const {\n width = richtextTheme.width,\n height = richtextTheme.height,\n maxWidth = richtextTheme.maxWidth,\n maxHeight = richtextTheme.maxHeight,\n textAlign = richtextTheme.textAlign,\n textBaseline = richtextTheme.textBaseline\n } = attribute;\n\n if (width > 0 && height > 0) {\n // 外部设置宽高\n aabbBounds.set(0, 0, width, height);\n } else {\n // 获取内容宽高\n const frameCache = this.getFrameCache();\n const { width: actualWidth, height: actualHeight } = frameCache.getActualSize();\n let contentWidth = width || actualWidth || 0;\n let contentHeight = height || actualHeight || 0;\n\n contentHeight = typeof maxHeight === 'number' && contentHeight > maxHeight ? maxHeight : contentHeight || 0;\n contentWidth = typeof maxWidth === 'number' && contentWidth > maxWidth ? maxWidth : contentWidth || 0;\n\n aabbBounds.set(0, 0, contentWidth, contentHeight);\n }\n\n // 调整对齐方式\n let deltaY = 0;\n switch (textBaseline) {\n case 'top':\n deltaY = 0;\n break;\n case 'middle':\n deltaY = -aabbBounds.height() / 2;\n break;\n case 'bottom':\n deltaY = -aabbBounds.height();\n break;\n default:\n break;\n }\n let deltaX = 0;\n switch (textAlign) {\n case 'left':\n deltaX = 0;\n break;\n case 'center':\n deltaX = -aabbBounds.width() / 2;\n break;\n case 'right':\n deltaX = -aabbBounds.width();\n break;\n default:\n break;\n }\n aabbBounds.translate(deltaX, deltaY);\n\n application.graphicService.updateTempAABBBounds(aabbBounds);\n\n if (attribute.forceBoundsHeight != null || attribute.forceBoundsWidth != null) {\n application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds);\n }\n application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, false, this);\n return aabbBounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, RICHTEXT_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, RICHTEXT_UPDATE_TAG_KEY);\n }\n getFrameCache(): Frame {\n if (this.shouldUpdateShape()) {\n this.doUpdateFrameCache();\n this.clearUpdateShapeTag();\n }\n return this._frameCache;\n }\n\n get cliped() {\n const frameCache = this.getFrameCache();\n if (frameCache.actualHeight > frameCache.height) {\n return true;\n }\n const { disableAutoWrapLine } = this.attribute;\n if (disableAutoWrapLine) {\n for (let i = 0; i < frameCache.lines.length; i++) {\n const l = frameCache.lines[i];\n for (let j = 0; j < l.paragraphs.length; j++) {\n const p = l.paragraphs[j];\n if ((p as any).overflow && (p as any).text !== '') {\n return true;\n }\n }\n }\n }\n return false;\n // if (height < this.attribute.height || )\n }\n combinedStyleToCharacter(config: IRichTextImageCharacter | IRichTextParagraphCharacter) {\n const {\n fill,\n stroke,\n fontSize,\n fontFamily,\n fontStyle,\n fontWeight,\n lineWidth,\n opacity,\n fillOpacity,\n strokeOpacity\n } = this.attribute;\n return {\n fill,\n stroke,\n fontSize,\n fontFamily,\n fontStyle,\n fontWeight,\n lineWidth,\n opacity,\n fillOpacity,\n strokeOpacity,\n ...config\n };\n }\n doUpdateFrameCache(tc?: IRichTextCharacter[]) {\n // 1. 测量,生成paragraph\n const {\n textConfig: _tc = [],\n maxWidth,\n maxHeight,\n width,\n height,\n ellipsis,\n wordBreak,\n verticalDirection,\n textAlign,\n textBaseline,\n layoutDirection,\n singleLine,\n disableAutoWrapLine\n } = this.attribute;\n const paragraphs: (Paragraph | RichTextIcon)[] = [];\n\n const textConfig = tc ?? _tc;\n\n for (let i = 0; i < textConfig.length; i++) {\n if ('image' in textConfig[i]) {\n const config = this.combinedStyleToCharacter(\n textConfig[i] as IRichTextImageCharacter\n ) as IRichTextImageCharacter;\n (config as any).lineWidth = undefined; // for icon bounds\n // 直接创建icon Mark\n const iconCache =\n config.id && this._frameCache && this._frameCache.icons && this._frameCache.icons.get(config.id);\n if (iconCache) {\n paragraphs.push(iconCache as RichTextIcon);\n } else {\n const icon = new RichTextIcon(config);\n icon.successCallback = () => {\n this.addUpdateBoundTag();\n this.stage?.renderNextFrame();\n };\n icon.richtextId = config.id;\n paragraphs.push(icon);\n }\n } else {\n const richTextConfig = this.combinedStyleToCharacter(\n textConfig[i] as IRichTextParagraphCharacter\n ) as IRichTextParagraphCharacter;\n if (isNumber(richTextConfig.text)) {\n richTextConfig.text = `${richTextConfig.text}`;\n }\n if (richTextConfig.text && richTextConfig.text.includes('\\n')) {\n // 如果有文字内有换行符,将该段文字切为多段,并在后一段加入newLine标记\n const textParts = richTextConfig.text.split('\\n');\n for (let j = 0; j < textParts.length; j++) {\n paragraphs.push(new Paragraph(textParts[j], j !== 0, richTextConfig));\n }\n } else if (richTextConfig.text) {\n paragraphs.push(new Paragraph(richTextConfig.text, false, richTextConfig));\n }\n }\n }\n\n // 2. 布局,生成frame\n // const frameHeight =\n // typeof maxHeight === 'number' && (!height || height > maxHeight) // height = 0或height>maxHeight,使用maxHeight布局\n // ? maxHeight\n // : height;\n // const frameWidth =\n // typeof maxWidth === 'number' && (!width || width > maxWidth) // height = 0或height>maxWidth,使用maxWidth布局\n // ? maxWidth\n // : width;\n\n const maxWidthFinite = typeof maxWidth === 'number' && Number.isFinite(maxWidth) && maxWidth > 0;\n const maxHeightFinite = typeof maxHeight === 'number' && Number.isFinite(maxHeight) && maxHeight > 0;\n\n const richTextWidthEnable =\n typeof width === 'number' &&\n Number.isFinite(width) &&\n width > 0 &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (!maxWidthFinite || width <= maxWidth);\n const richTextHeightEnable =\n typeof height === 'number' &&\n Number.isFinite(height) &&\n height > 0 &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (!maxHeightFinite || height <= maxHeight);\n\n const frameWidth = richTextWidthEnable ? width : maxWidthFinite ? maxWidth : 0;\n const frameHeight = richTextHeightEnable ? height : maxHeightFinite ? maxHeight : 0;\n\n const frame = new Frame(\n 0,\n 0,\n frameWidth || 0,\n frameHeight || 0,\n ellipsis,\n wordBreak,\n verticalDirection,\n textAlign,\n textBaseline,\n layoutDirection || 'horizontal',\n // typeof maxWidth === 'number' && (!width || width > maxWidth),\n // typeof maxHeight === 'number' && (!height || height > maxHeight),\n !richTextWidthEnable && maxWidthFinite,\n !richTextHeightEnable && maxHeightFinite,\n singleLine || false,\n this._frameCache?.icons\n );\n const wrapper = new Wrapper(frame);\n if (disableAutoWrapLine) {\n let lineCount = 0;\n let skip = false;\n for (let i = 0; i < paragraphs.length; i++) {\n const p = paragraphs[i];\n if (skip) {\n (p as Paragraph).overflow = true;\n (p as Paragraph).left = Infinity;\n (p as Paragraph).top = Infinity;\n !(p as Paragraph).newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p);\n } else {\n wrapper.deal(p, true);\n }\n if (frame.lines.length !== lineCount) {\n lineCount = frame.lines.length;\n wrapper.lineBuffer.length = 0;\n (p as Paragraph).overflow = true;\n (p as Paragraph).left = 1000;\n (p as Paragraph).top = 1000;\n frame.lines[frame.lines.length - 1].paragraphs.push(p);\n skip = true;\n }\n if ((p as Paragraph).newLine) {\n skip = false;\n wrapper.lineWidth = 0;\n }\n wrapper.send();\n }\n } else {\n for (let i = 0; i < paragraphs.length; i++) {\n if (i === paragraphs.length - 1) {\n wrapper.newLine = true;\n }\n wrapper.deal(paragraphs[i]);\n wrapper.newLine = false;\n }\n }\n\n wrapper.send(); // 最后一行手动输出\n\n // 如果对应的配置宽度不可用,那么需要额外进行一次对齐\n const directionEnable = frame.layoutDirection === 'horizontal' ? richTextWidthEnable : richTextHeightEnable;\n if (!directionEnable) {\n // 使用实际宽度\n const frameSize = frame.getActualSizeWidthEllipsis();\n let offsetSize = frame.layoutDirection === 'horizontal' ? frameSize.width : frameSize.height;\n // 如果最大值可用\n if (frame.layoutDirection === 'horizontal' ? maxWidthFinite : maxHeightFinite) {\n // 取2者中的较小值\n offsetSize = Math.min(\n offsetSize,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n frame.layoutDirection === 'horizontal' ? maxWidth : maxHeight\n );\n }\n\n frame.lines.forEach(function (l) {\n l.calcOffset(offsetSize, false);\n });\n }\n\n this._frameCache = frame;\n\n // this.bindIconEvent();\n }\n\n clone() {\n return new RichText({ ...this.attribute });\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n super.setStage(stage, layer);\n const frameCache = this.getFrameCache();\n // for (let i = 0; i < frameCache.icons.length; i++) {\n // const icon = frameCache.icons[i];\n // icon.setStage(stage, layer);\n // }\n frameCache.icons.forEach(icon => {\n icon.setStage(stage, layer);\n });\n }\n\n // richtext绑定icon交互事件,供外部调用\n bindIconEvent() {\n this.addEventListener('pointermove', (e: FederatedMouseEvent) => {\n const pickedIcon = this.pickIcon(e.global);\n if (pickedIcon && pickedIcon === this._currentHoverIcon) {\n // do nothing\n } else if (pickedIcon) {\n this.setAttribute('hoverIconId', pickedIcon.richtextId);\n\n // this._currentHoverIcon?.setHoverState(false);\n // this._currentHoverIcon = pickedIcon;\n // this._currentHoverIcon.setHoverState(true);\n // this.stage?.setCursor(pickedIcon.attribute.cursor);\n // this.stage?.renderNextFrame();\n } else if (!pickedIcon && this._currentHoverIcon) {\n this.setAttribute('hoverIconId', undefined);\n\n // this._currentHoverIcon.setHoverState(false);\n // this._currentHoverIcon = null;\n // this.stage?.setCursor();\n // this.stage?.renderNextFrame();\n }\n });\n\n this.addEventListener('pointerleave', (e: FederatedMouseEvent) => {\n if (this._currentHoverIcon) {\n this.setAttribute('hoverIconId', undefined);\n\n // this._currentHoverIcon.setHoverState(false);\n // this._currentHoverIcon = null;\n // this.stage?.setCursor();\n // this.stage?.renderNextFrame();\n }\n });\n }\n\n updateHoverIconState(pickedIcon?: IRichTextIcon) {\n if (pickedIcon) {\n this._currentHoverIcon?.setHoverState(false);\n this._currentHoverIcon = pickedIcon;\n this._currentHoverIcon.setHoverState(true);\n this.stage?.setCursor(pickedIcon.attribute.cursor);\n this.stage?.renderNextFrame();\n } else {\n this._currentHoverIcon.setHoverState(false);\n this._currentHoverIcon = null;\n this.stage?.setCursor();\n this.stage?.renderNextFrame();\n }\n }\n\n pickIcon(point: EventPoint): IRichTextIcon | undefined {\n const frameCache = this.getFrameCache();\n const { e: x, f: y } = this.globalTransMatrix;\n // for (let i = 0; i < frameCache.icons.length; i++) {\n // const icon = frameCache.icons[i];\n // if (icon.containsPoint(point.x - x, point.y - y)) {\n // return icon;\n // }\n // }\n let pickIcon: IRichTextIcon | undefined;\n frameCache.icons.forEach((icon, key) => {\n const bounds = icon.AABBBounds.clone();\n bounds.translate(icon._marginArray[3], icon._marginArray[0]);\n if (bounds.containsPoint({ x: point.x - x, y: point.y - y })) {\n pickIcon = icon;\n\n pickIcon.globalX = (pickIcon.attribute.x ?? 0) + x + icon._marginArray[3];\n pickIcon.globalY = (pickIcon.attribute.y ?? 0) + y + icon._marginArray[0];\n }\n });\n\n return pickIcon;\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return RichText.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createRichText(attributes: IRichTextGraphicAttribute): IRichText {\n return new RichText(attributes);\n}\n"]}
@@ -48,6 +48,7 @@ export declare class Text extends Graphic<ITextGraphicAttribute> implements ITex
48
48
  get clipedWidth(): number | undefined;
49
49
  get cliped(): boolean | undefined;
50
50
  get multilineLayout(): LayoutType | undefined;
51
+ private isSimplify;
51
52
  get isMultiLine(): boolean;
52
53
  constructor(params?: ITextGraphicAttribute);
53
54
  isValid(): boolean;
@@ -55,17 +56,10 @@ export declare class Text extends Graphic<ITextGraphicAttribute> implements ITex
55
56
  getGraphicTheme(): Required<ITextGraphicAttribute>;
56
57
  protected doUpdateOBBBounds(): IOBBBounds;
57
58
  protected updateAABBBounds(attribute: ITextGraphicAttribute, textTheme: Required<ITextGraphicAttribute>, aabbBounds: IAABBBounds): import("@visactor/vutils").IBounds;
58
- updateSingallineAABBBounds(text: number | string): IAABBBounds;
59
- protected updateMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
60
- updateHorizontalMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
61
59
  updateWrapAABBBounds(text: (number | string) | (number | string)[]): import("@visactor/vutils").IBounds;
62
- updateVerticalMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
63
- protected getMaxWidth(theme: ITextGraphicAttribute): number;
64
- protected getLineHeight(attribute: ITextGraphicAttribute, textTheme: ITextGraphicAttribute): number;
65
- protected needUpdateTags(keys: string[], k?: string[]): boolean;
66
- protected needUpdateTag(key: string, k?: string[]): boolean;
67
- clone(): Text;
68
- getNoWorkAnimateAttr(): Record<string, number>;
60
+ updateSingallineAABBBounds(text: number | string): IAABBBounds;
61
+ updateMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
62
+ updateHorizontalSinglelineAABBBounds(text: number | string): IAABBBounds;
69
63
  getBaselineMapAlign(): Record<string, string>;
70
64
  getAlignMapBaseline(): Record<string, string>;
71
65
  static baselineMapAlign: {
@@ -78,5 +72,12 @@ export declare class Text extends Graphic<ITextGraphicAttribute> implements ITex
78
72
  right: string;
79
73
  center: string;
80
74
  };
75
+ updateVerticalSinglelineAABBBounds(text: number | string): IAABBBounds;
76
+ updateHorizontalMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
77
+ updateVerticalMultilineAABBBounds(text: (number | string)[]): IAABBBounds;
78
+ protected needUpdateTags(keys: string[], k?: string[]): boolean;
79
+ protected needUpdateTag(key: string, k?: string[]): boolean;
80
+ clone(): Text;
81
+ getNoWorkAnimateAttr(): Record<string, number>;
81
82
  }
82
83
  export declare function createText(attributes: ITextGraphicAttribute): IText;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.createText = exports.Text = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), text_1 = require("../common/text"), layout_1 = require("../core/contributions/textMeasure/layout"), application_1 = require("../application"), graphic_1 = require("./graphic"), theme_1 = require("./theme"), utils_1 = require("../common/utils"), constants_1 = require("./constants"), tools_1 = require("./tools"), TEXT_UPDATE_TAG_KEY = [ "text", "maxLineWidth", "maxWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...graphic_1.GRAPHIC_UPDATE_TAG_KEY ];
7
+ const vutils_1 = require("@visactor/vutils"), text_1 = require("../common/text"), layout_1 = require("../core/contributions/textMeasure/layout"), application_1 = require("../application"), graphic_1 = require("./graphic"), theme_1 = require("./theme"), utils_1 = require("../common/utils"), constants_1 = require("./constants"), tools_1 = require("./tools"), TEXT_UPDATE_TAG_KEY = [ "text", "maxLineWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...graphic_1.GRAPHIC_UPDATE_TAG_KEY ];
8
8
 
9
9
  class Text extends graphic_1.Graphic {
10
10
  get font() {
@@ -14,17 +14,18 @@ class Text extends graphic_1.Graphic {
14
14
  }
15
15
  get clipedText() {
16
16
  var _a;
17
- const attribute = this.attribute, textTheme = this.getGraphicTheme(), maxWidth = this.getMaxWidth(textTheme);
18
- return Number.isFinite(maxWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
17
+ const attribute = this.attribute, textTheme = this.getGraphicTheme();
18
+ if (!this.isSimplify()) return;
19
+ const {maxLineWidth: maxLineWidth = textTheme.maxLineWidth} = attribute;
20
+ return Number.isFinite(maxLineWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
19
21
  }
20
22
  get clipedWidth() {
21
- return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
23
+ if (this.isSimplify()) return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
22
24
  }
23
25
  get cliped() {
24
26
  var _a, _b;
25
- const textTheme = this.getGraphicTheme(), attribute = this.attribute, maxWidth = this.getMaxWidth(textTheme);
26
- if (!Number.isFinite(maxWidth)) return !1;
27
- const {text: text} = this.attribute;
27
+ const textTheme = this.getGraphicTheme(), attribute = this.attribute, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, text: text, whiteSpace: whiteSpace = textTheme.whiteSpace} = attribute;
28
+ if (!Number.isFinite(maxLineWidth)) return !1;
28
29
  if (this.tryUpdateAABBBounds(), null === (_b = null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData) || void 0 === _b ? void 0 : _b.lines) {
29
30
  let mergedText = "";
30
31
  this.cache.layoutData.lines.forEach((item => {
@@ -35,7 +36,10 @@ class Text extends graphic_1.Graphic {
35
36
  return "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map((item => item.text)).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
36
37
  }
37
38
  get multilineLayout() {
38
- return this.tryUpdateAABBBounds(), this.cache.layoutData;
39
+ if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
40
+ }
41
+ isSimplify() {
42
+ return !this.isMultiLine && "vertical" !== this.attribute.direction;
39
43
  }
40
44
  get isMultiLine() {
41
45
  return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
@@ -91,51 +95,20 @@ class Text extends graphic_1.Graphic {
91
95
  (0, vutils_1.transformBoundsWithMatrix)(aabbBounds, aabbBounds, this.transMatrix),
92
96
  aabbBounds;
93
97
  }
94
- updateSingallineAABBBounds(text) {
95
- this.updateMultilineAABBBounds([ text ]);
96
- const layoutData = this.cache.layoutData;
97
- if (layoutData) {
98
- const line = layoutData.lines[0];
99
- this.cache.clipedText = line.str, this.cache.clipedWidth = line.width;
100
- }
101
- return this._AABBBounds;
102
- }
103
- updateMultilineAABBBounds(text) {
104
- const textTheme = this.getGraphicTheme(), {direction: direction = textTheme.direction, underlineOffset: underlineOffset = textTheme.underlineOffset} = this.attribute, b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
105
- return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset),
106
- b;
107
- }
108
- updateHorizontalMultilineAABBBounds(text) {
109
- var _a;
110
- const textTheme = this.getGraphicTheme(), attribute = this.attribute, {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, wrap: wrap = textTheme.wrap, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, lineWidth: lineWidth = textTheme.lineWidth, whiteSpace: whiteSpace = textTheme.whiteSpace, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, buf = ignoreBuf ? 0 : 2, lineHeight = this.getLineHeight(attribute, textTheme) + buf;
111
- if ("normal" === whiteSpace || wrap) return this.updateWrapAABBBounds(text);
112
- if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
113
- const bbox = this.cache.layoutData.bbox;
114
- return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
115
- stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
116
- }
117
- const textMeasure = application_1.application.graphicUtil.textMeasure, layoutData = new layout_1.CanvasTextLayout(fontFamily, {
118
- fontSize: fontSize,
119
- fontWeight: fontWeight,
120
- fontFamily: fontFamily
121
- }, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, maxLineWidth, suffixPosition), {bbox: bbox} = layoutData;
122
- return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
123
- stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
124
- }
125
98
  updateWrapAABBBounds(text) {
126
- var _a, _b, _c;
127
- const textTheme = this.getGraphicTheme(), {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, wordBreak: wordBreak = textTheme.wordBreak, fontWeight: fontWeight = textTheme.fontWeight, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, suffixPosition: suffixPosition = textTheme.suffixPosition, heightLimit: heightLimit = 0, lineClamp: lineClamp} = this.attribute, buf = ignoreBuf ? 0 : 2, lineHeight = this.getLineHeight(this.attribute, textTheme) + buf;
128
- if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
99
+ var _a, _b, _c, _d;
100
+ const textTheme = this.getGraphicTheme(), {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, wordBreak: wordBreak = textTheme.wordBreak, fontWeight: fontWeight = textTheme.fontWeight, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, suffixPosition: suffixPosition = textTheme.suffixPosition, heightLimit: heightLimit = 0, lineClamp: lineClamp} = this.attribute, lineHeight = null !== (_a = (0,
101
+ utils_1.calculateLineHeight)(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize, buf = ignoreBuf ? 0 : 2;
102
+ if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
129
103
  const bbox = this.cache.layoutData.bbox;
130
104
  return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
131
105
  stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
132
106
  }
133
- const textMeasure = application_1.application.graphicUtil.textMeasure, textOptions = {
107
+ const textMeasure = application_1.application.graphicUtil.textMeasure, layoutObj = new layout_1.CanvasTextLayout(fontFamily, {
134
108
  fontSize: fontSize,
135
109
  fontWeight: fontWeight,
136
110
  fontFamily: fontFamily
137
- }, layoutObj = new layout_1.CanvasTextLayout(fontFamily, textOptions, textMeasure), lines = (0,
138
- vutils_1.isArray)(text) ? text.map((l => l.toString())) : [ text.toString() ], linesLayout = [], bboxWH = [ 0, 0 ];
111
+ }, textMeasure), lines = (0, vutils_1.isArray)(text) ? text.map((l => l.toString())) : [ text.toString() ], linesLayout = [], bboxWH = [ 0, 0 ];
139
112
  let lineCountLimit = 1 / 0;
140
113
  if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)),
141
114
  lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
@@ -143,32 +116,30 @@ class Text extends graphic_1.Graphic {
143
116
  const str = lines[i];
144
117
  let needCut = !0;
145
118
  if (i === lineCountLimit - 1) {
146
- const clip = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition, i !== lines.length - 1), matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions);
119
+ const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition, i !== lines.length - 1);
147
120
  linesLayout.push({
148
121
  str: clip.str,
149
- width: clip.width,
150
- ascent: matrics.ascent,
151
- descent: matrics.descent
122
+ width: clip.width
152
123
  });
153
124
  break;
154
125
  }
155
- const clip = textMeasure.clipText(str, textOptions, maxLineWidth, "break-word" === wordBreak);
156
- if ("" !== str && "" === clip.str) {
126
+ const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
127
+ if ("" !== str && "" === clip.str || clip.wordBreaked) {
157
128
  if (ellipsis) {
158
- const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
159
- clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
129
+ const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
130
+ clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
160
131
  } else clip.str = "", clip.width = 0;
161
132
  needCut = !1;
162
133
  }
163
- const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions);
164
- if (linesLayout.push({
134
+ linesLayout.push({
165
135
  str: clip.str,
166
- width: clip.width,
167
- ascent: matrics.ascent,
168
- descent: matrics.descent
169
- }), clip.str.length === str.length) ; else if (needCut) {
170
- const newStr = str.substring(clip.str.length);
171
- lines.splice(i + 1, 0, newStr);
136
+ width: clip.width
137
+ });
138
+ let cutLength = clip.str.length;
139
+ if (!clip.wordBreaked || "" !== str && "" === clip.str || (needCut = !0, cutLength = clip.wordBreaked),
140
+ clip.str.length === str.length) ; else if (needCut) {
141
+ let newStr = str.substring(cutLength);
142
+ "keep-all" === wordBreak && (newStr = newStr.replace(/^\s+/g, "")), lines.splice(i + 1, 0, newStr);
172
143
  }
173
144
  }
174
145
  let maxWidth = 0;
@@ -179,27 +150,22 @@ class Text extends graphic_1.Graphic {
179
150
  let width, text, lineWidth = 0;
180
151
  for (let i = 0, len = lines.length; i < len; i++) {
181
152
  if (i === lineCountLimit - 1) {
182
- const clip = textMeasure.clipTextWithSuffix(lines[i], textOptions, maxLineWidth, ellipsis, !1, suffixPosition), matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions);
153
+ const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
183
154
  linesLayout.push({
184
155
  str: clip.str,
185
- width: clip.width,
186
- ascent: matrics.ascent,
187
- descent: matrics.descent
156
+ width: clip.width
188
157
  }), lineWidth = Math.max(lineWidth, clip.width);
189
158
  break;
190
159
  }
191
- text = lines[i], width = textMeasure.measureTextWidth(text, textOptions), lineWidth = Math.max(lineWidth, width);
192
- const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions);
193
- linesLayout.push({
160
+ text = lines[i], width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, "break-word" === wordBreak),
161
+ lineWidth = Math.max(lineWidth, width), linesLayout.push({
194
162
  str: text,
195
- width: width,
196
- ascent: matrics.ascent,
197
- descent: matrics.descent
163
+ width: width
198
164
  });
199
165
  }
200
166
  bboxWH[0] = lineWidth;
201
167
  }
202
- bboxWH[1] = linesLayout.length * lineHeight;
168
+ bboxWH[1] = linesLayout.length * (lineHeight + buf);
203
169
  const bbox = {
204
170
  xOffset: 0,
205
171
  yOffset: 0,
@@ -211,16 +177,148 @@ class Text extends graphic_1.Graphic {
211
177
  return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
212
178
  stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
213
179
  }
214
- updateVerticalMultilineAABBBounds(text) {
180
+ updateSingallineAABBBounds(text) {
181
+ const textTheme = this.getGraphicTheme(), {direction: direction = textTheme.direction, underlineOffset: underlineOffset = textTheme.underlineOffset} = this.attribute, b = "horizontal" === direction ? this.updateHorizontalSinglelineAABBBounds(text) : this.updateVerticalSinglelineAABBBounds(text);
182
+ return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset),
183
+ b;
184
+ }
185
+ updateMultilineAABBBounds(text) {
186
+ const textTheme = this.getGraphicTheme(), {direction: direction = textTheme.direction, underlineOffset: underlineOffset = textTheme.underlineOffset} = this.attribute, b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
187
+ return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset),
188
+ b;
189
+ }
190
+ updateHorizontalSinglelineAABBBounds(text) {
191
+ var _a, _b;
192
+ const textTheme = this.getGraphicTheme(), {wrap: wrap = textTheme.wrap} = this.attribute;
193
+ if (wrap) return this.updateWrapAABBBounds([ text ]);
194
+ const textMeasure = application_1.application.graphicUtil.textMeasure;
195
+ let width, str;
196
+ const attribute = this.attribute, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontFamily: fontFamily = textTheme.fontFamily, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, whiteSpace: whiteSpace = textTheme.whiteSpace, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute;
197
+ if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
198
+ const buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize), textFontSize = attribute.fontSize || textTheme.fontSize, lineHeight = null !== (_a = (0,
199
+ utils_1.calculateLineHeight)(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
200
+ if (!this.shouldUpdateShape() && this.cache) {
201
+ width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
202
+ const dx = (0, text_1.textDrawOffsetX)(textAlign, width), dy = (0, text_1.textLayoutOffsetY)(textBaseline, lineHeight, fontSize);
203
+ return this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight), stroke && this._AABBBounds.expand(lineWidth / 2),
204
+ this._AABBBounds;
205
+ }
206
+ if (Number.isFinite(maxLineWidth)) {
207
+ if (ellipsis) {
208
+ const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis, data = textMeasure.clipTextWithSuffix(text.toString(), {
209
+ fontSize: fontSize,
210
+ fontWeight: fontWeight,
211
+ fontFamily: fontFamily
212
+ }, maxLineWidth, strEllipsis, !1, suffixPosition);
213
+ str = data.str, width = data.width;
214
+ } else {
215
+ const data = textMeasure.clipText(text.toString(), {
216
+ fontSize: fontSize,
217
+ fontWeight: fontWeight,
218
+ fontFamily: fontFamily
219
+ }, maxLineWidth, !1);
220
+ str = data.str, width = data.width;
221
+ }
222
+ this.cache.clipedText = str, this.cache.clipedWidth = width;
223
+ } else width = textMeasure.measureTextWidth(text.toString(), {
224
+ fontSize: fontSize,
225
+ fontWeight: fontWeight,
226
+ fontFamily: fontFamily
227
+ }), this.cache.clipedText = text.toString(), this.cache.clipedWidth = width;
228
+ this.clearUpdateShapeTag();
229
+ const dx = (0, text_1.textDrawOffsetX)(textAlign, width);
230
+ let lh = lineHeight;
231
+ application_1.application.global && application_1.application.global.isSafari() && (lh += .2 * fontSize);
232
+ const dy = (0, text_1.textLayoutOffsetY)(textBaseline, lh, fontSize, buf);
233
+ return this._AABBBounds.set(dx, dy, dx + width, dy + lh), stroke && this._AABBBounds.expand(lineWidth / 2),
234
+ this._AABBBounds;
235
+ }
236
+ getBaselineMapAlign() {
237
+ return Text.baselineMapAlign;
238
+ }
239
+ getAlignMapBaseline() {
240
+ return Text.alignMapBaseline;
241
+ }
242
+ updateVerticalSinglelineAABBBounds(text) {
243
+ var _a, _b, _c;
244
+ const textTheme = this.getGraphicTheme(), textMeasure = application_1.application.graphicUtil.textMeasure;
245
+ let width;
246
+ const attribute = this.attribute, {ignoreBuf: ignoreBuf = textTheme.ignoreBuf} = attribute, buf = ignoreBuf ? 0 : 2, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, fontFamily: fontFamily = textTheme.fontFamily, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, verticalMode: verticalMode = textTheme.verticalMode, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = null !== (_a = (0,
247
+ utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
248
+ let {textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline} = attribute;
249
+ if (!verticalMode) {
250
+ const t = textAlign;
251
+ textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left",
252
+ textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
253
+ }
254
+ if (!this.shouldUpdateShape() && this.cache) {
255
+ width = this.cache.clipedWidth;
256
+ const dx = (0, text_1.textDrawOffsetX)(textAlign, width), dy = (0, text_1.textLayoutOffsetY)(textBaseline, lineHeight, fontSize);
257
+ return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2),
258
+ this._AABBBounds;
259
+ }
260
+ let verticalList = [ (0, tools_1.verticalLayout)(text.toString()) ];
261
+ if (Number.isFinite(maxLineWidth)) {
262
+ if (ellipsis) {
263
+ const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis, data = textMeasure.clipTextWithSuffixVertical(verticalList[0], {
264
+ fontSize: fontSize,
265
+ fontWeight: fontWeight,
266
+ fontFamily: fontFamily
267
+ }, maxLineWidth, strEllipsis, !1, suffixPosition);
268
+ verticalList = [ data.verticalList ], width = data.width;
269
+ } else {
270
+ const data = textMeasure.clipTextVertical(verticalList[0], {
271
+ fontSize: fontSize,
272
+ fontWeight: fontWeight,
273
+ fontFamily: fontFamily
274
+ }, maxLineWidth, !1);
275
+ verticalList = [ data.verticalList ], width = data.width;
276
+ }
277
+ this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
278
+ } else width = 0, verticalList[0].forEach((t => {
279
+ const w = t.direction === tools_1.TextDirection.HORIZONTAL ? fontSize : textMeasure.measureTextWidth(t.text, {
280
+ fontSize: fontSize,
281
+ fontWeight: fontWeight,
282
+ fontFamily: fontFamily
283
+ });
284
+ width += w, t.width = w;
285
+ })), this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
286
+ this.clearUpdateShapeTag();
287
+ const dx = (0, text_1.textDrawOffsetX)(textAlign, width), dy = (0, text_1.textLayoutOffsetY)(textBaseline, lineHeight, fontSize);
288
+ return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2),
289
+ this._AABBBounds;
290
+ }
291
+ updateHorizontalMultilineAABBBounds(text) {
215
292
  var _a, _b;
293
+ const textTheme = this.getGraphicTheme(), {wrap: wrap = textTheme.wrap} = this.attribute;
294
+ if (wrap) return this.updateWrapAABBBounds(text);
295
+ const attribute = this.attribute, {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, whiteSpace: whiteSpace = textTheme.whiteSpace, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = null !== (_a = (0,
296
+ utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
297
+ if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
298
+ if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
299
+ const bbox = this.cache.layoutData.bbox;
300
+ return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
301
+ stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
302
+ }
303
+ const textMeasure = application_1.application.graphicUtil.textMeasure, layoutData = new layout_1.CanvasTextLayout(fontFamily, {
304
+ fontSize: fontSize,
305
+ fontWeight: fontWeight,
306
+ fontFamily: fontFamily
307
+ }, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, maxLineWidth, suffixPosition), {bbox: bbox} = layoutData;
308
+ return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
309
+ stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
310
+ }
311
+ updateVerticalMultilineAABBBounds(text) {
312
+ var _a, _b, _c;
216
313
  const textTheme = this.getGraphicTheme(), textMeasure = application_1.application.graphicUtil.textMeasure;
217
314
  let width;
218
- const attribute = this.attribute, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, fontFamily: fontFamily = textTheme.fontFamily, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, verticalMode: verticalMode = textTheme.verticalMode, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = this.getLineHeight(attribute, textTheme);
315
+ const attribute = this.attribute, {ignoreBuf: ignoreBuf = textTheme.ignoreBuf} = attribute, buf = ignoreBuf ? 0 : 2, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, fontFamily: fontFamily = textTheme.fontFamily, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, verticalMode: verticalMode = textTheme.verticalMode, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = null !== (_a = (0,
316
+ utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
219
317
  let {textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline} = attribute;
220
318
  if (!verticalMode) {
221
319
  const t = textAlign;
222
- textAlign = null !== (_a = Text.baselineMapAlign[textBaseline]) && void 0 !== _a ? _a : "left",
223
- textBaseline = null !== (_b = Text.alignMapBaseline[t]) && void 0 !== _b ? _b : "top";
320
+ textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left",
321
+ textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
224
322
  }
225
323
  if (width = 0, !this.shouldUpdateShape() && this.cache) {
226
324
  this.cache.verticalList.forEach((item => {
@@ -265,15 +363,6 @@ class Text extends graphic_1.Graphic {
265
363
  return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2),
266
364
  this._AABBBounds;
267
365
  }
268
- getMaxWidth(theme) {
269
- var _a, _b;
270
- const attribute = this.attribute;
271
- return null !== (_b = null !== (_a = attribute.maxLineWidth) && void 0 !== _a ? _a : attribute.maxWidth) && void 0 !== _b ? _b : theme.maxWidth;
272
- }
273
- getLineHeight(attribute, textTheme) {
274
- var _a;
275
- return null !== (_a = (0, utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
276
- }
277
366
  needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
278
367
  return super.needUpdateTags(keys, k);
279
368
  }
@@ -286,12 +375,6 @@ class Text extends graphic_1.Graphic {
286
375
  getNoWorkAnimateAttr() {
287
376
  return Text.NOWORK_ANIMATE_ATTR;
288
377
  }
289
- getBaselineMapAlign() {
290
- return Text.baselineMapAlign;
291
- }
292
- getAlignMapBaseline() {
293
- return Text.alignMapBaseline;
294
- }
295
378
  }
296
379
 
297
380
  function createText(attributes) {