@visactor/vrender 0.15.0-alpha.16 → 0.15.0-alpha.17

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 (375) hide show
  1. package/cjs/animate/animate.d.ts +1 -0
  2. package/cjs/animate/animate.js +3 -0
  3. package/cjs/animate/animate.js.map +1 -1
  4. package/cjs/animate/timeline.d.ts +1 -1
  5. package/cjs/animate/timeline.js +2 -2
  6. package/cjs/animate/timeline.js.map +1 -1
  7. package/cjs/canvas/contributions/browser/context.d.ts +1 -0
  8. package/cjs/common/contribution-provider.d.ts +1 -0
  9. package/cjs/common/contribution-provider.js +7 -2
  10. package/cjs/common/contribution-provider.js.map +1 -1
  11. package/cjs/common/enums.d.ts +4 -2
  12. package/cjs/common/enums.js +3 -2
  13. package/cjs/common/enums.js.map +1 -1
  14. package/cjs/core/contributions/env/base-contribution.d.ts +11 -1
  15. package/cjs/core/contributions/env/base-contribution.js +22 -1
  16. package/cjs/core/contributions/env/base-contribution.js.map +1 -1
  17. package/cjs/core/contributions/env/browser-contribution.d.ts +11 -2
  18. package/cjs/core/contributions/env/browser-contribution.js +66 -0
  19. package/cjs/core/contributions/env/browser-contribution.js.map +1 -1
  20. package/cjs/core/contributions/textMeasure/layout.js +1 -1
  21. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  22. package/cjs/core/contributions/window/base-contribution.d.ts +11 -5
  23. package/cjs/core/contributions/window/base-contribution.js +10 -0
  24. package/cjs/core/contributions/window/base-contribution.js.map +1 -1
  25. package/cjs/core/contributions/window/browser-contribution.d.ts +11 -0
  26. package/cjs/core/contributions/window/browser-contribution.js +33 -2
  27. package/cjs/core/contributions/window/browser-contribution.js.map +1 -1
  28. package/cjs/core/global.d.ts +11 -1
  29. package/cjs/core/global.js +18 -0
  30. package/cjs/core/global.js.map +1 -1
  31. package/cjs/core/graphic-utils.d.ts +2 -0
  32. package/cjs/core/graphic-utils.js +13 -0
  33. package/cjs/core/graphic-utils.js.map +1 -1
  34. package/cjs/core/layer.js +6 -6
  35. package/cjs/core/layer.js.map +1 -1
  36. package/cjs/core/stage.d.ts +13 -4
  37. package/cjs/core/stage.js +54 -25
  38. package/cjs/core/stage.js.map +1 -1
  39. package/cjs/core/window.d.ts +6 -0
  40. package/cjs/core/window.js +10 -1
  41. package/cjs/core/window.js.map +1 -1
  42. package/cjs/event/event-manager.js +8 -8
  43. package/cjs/event/event-manager.js.map +1 -1
  44. package/cjs/event/event-system.js.map +1 -1
  45. package/cjs/event/federated-event/pointer-event.d.ts +1 -0
  46. package/cjs/event/federated-event/pointer-event.js.map +1 -1
  47. package/cjs/graphic/builtin-symbol/arrow2-down.d.ts +12 -0
  48. package/cjs/graphic/builtin-symbol/arrow2-down.js +30 -0
  49. package/cjs/graphic/builtin-symbol/arrow2-down.js.map +1 -0
  50. package/cjs/graphic/builtin-symbol/arrow2-left.js +1 -1
  51. package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  52. package/cjs/graphic/builtin-symbol/arrow2-right.js +1 -1
  53. package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  54. package/cjs/graphic/builtin-symbol/arrow2-up.d.ts +12 -0
  55. package/cjs/graphic/builtin-symbol/arrow2-up.js +30 -0
  56. package/cjs/graphic/builtin-symbol/arrow2-up.js.map +1 -0
  57. package/cjs/graphic/builtin-symbol/close.d.ts +13 -0
  58. package/cjs/graphic/builtin-symbol/close.js +33 -0
  59. package/cjs/graphic/builtin-symbol/close.js.map +1 -0
  60. package/cjs/graphic/builtin-symbol/index.d.ts +1 -1
  61. package/cjs/graphic/builtin-symbol/index.js +2 -2
  62. package/cjs/graphic/builtin-symbol/index.js.map +1 -1
  63. package/cjs/graphic/builtin-symbol/line-h.d.ts +13 -0
  64. package/cjs/graphic/builtin-symbol/line-h.js +32 -0
  65. package/cjs/graphic/builtin-symbol/line-h.js.map +1 -0
  66. package/cjs/graphic/builtin-symbol/line-v.d.ts +13 -0
  67. package/cjs/graphic/builtin-symbol/line-v.js +32 -0
  68. package/cjs/graphic/builtin-symbol/line-v.js.map +1 -0
  69. package/cjs/graphic/builtin-symbol/utils.d.ts +13 -5
  70. package/cjs/graphic/builtin-symbol/utils.js +23 -9
  71. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  72. package/cjs/graphic/config.js +8 -4
  73. package/cjs/graphic/config.js.map +1 -1
  74. package/cjs/graphic/constants.d.ts +22 -0
  75. package/cjs/graphic/constants.js +20 -2
  76. package/cjs/graphic/constants.js.map +1 -1
  77. package/cjs/graphic/graphic.d.ts +4 -1
  78. package/cjs/graphic/graphic.js +49 -21
  79. package/cjs/graphic/graphic.js.map +1 -1
  80. package/cjs/graphic/group.js +1 -1
  81. package/cjs/graphic/group.js.map +1 -1
  82. package/cjs/graphic/index.d.ts +1 -0
  83. package/cjs/graphic/index.js +13 -13
  84. package/cjs/graphic/index.js.map +1 -1
  85. package/cjs/graphic/richtext/utils.d.ts +1 -1
  86. package/cjs/graphic/richtext/utils.js +1 -1
  87. package/cjs/graphic/richtext/utils.js.map +1 -1
  88. package/cjs/graphic/symbol.d.ts +2 -1
  89. package/cjs/graphic/symbol.js +27 -4
  90. package/cjs/graphic/symbol.js.map +1 -1
  91. package/cjs/graphic/text.js +33 -23
  92. package/cjs/graphic/text.js.map +1 -1
  93. package/cjs/graphic/tools.d.ts +3 -2
  94. package/cjs/graphic/tools.js +58 -3
  95. package/cjs/graphic/tools.js.map +1 -1
  96. package/cjs/graphic/wrap-text.js +10 -8
  97. package/cjs/graphic/wrap-text.js.map +1 -1
  98. package/cjs/index.d.ts +3 -1
  99. package/cjs/index.js +3 -3
  100. package/cjs/index.js.map +1 -1
  101. package/cjs/interface/animate.d.ts +3 -1
  102. package/cjs/interface/animate.js.map +1 -1
  103. package/cjs/interface/core.d.ts +1 -0
  104. package/cjs/interface/core.js.map +1 -1
  105. package/cjs/interface/global.d.ts +25 -1
  106. package/cjs/interface/global.js.map +1 -1
  107. package/cjs/interface/graphic/image.d.ts +1 -0
  108. package/cjs/interface/graphic/image.js.map +1 -1
  109. package/cjs/interface/graphic/symbol.d.ts +3 -2
  110. package/cjs/interface/graphic/symbol.js.map +1 -1
  111. package/cjs/interface/graphic/text.d.ts +1 -0
  112. package/cjs/interface/graphic/text.js.map +1 -1
  113. package/cjs/interface/graphic.d.ts +27 -3
  114. package/cjs/interface/graphic.js.map +1 -1
  115. package/cjs/interface/picker.d.ts +9 -1
  116. package/cjs/interface/picker.js.map +1 -1
  117. package/cjs/interface/render.d.ts +1 -0
  118. package/cjs/interface/render.js.map +1 -1
  119. package/cjs/interface/stage.d.ts +10 -3
  120. package/cjs/interface/stage.js.map +1 -1
  121. package/cjs/interface/window.d.ts +12 -0
  122. package/cjs/interface/window.js.map +1 -1
  123. package/cjs/jsx/graphicType.d.ts +172 -0
  124. package/cjs/jsx/graphicType.js +133 -0
  125. package/cjs/jsx/graphicType.js.map +1 -0
  126. package/cjs/jsx/index.d.ts +2 -0
  127. package/cjs/jsx/index.js +21 -0
  128. package/cjs/jsx/index.js.map +1 -0
  129. package/cjs/jsx/jsx-classic.d.ts +3 -0
  130. package/cjs/jsx/jsx-classic.js +58 -0
  131. package/cjs/jsx/jsx-classic.js.map +1 -0
  132. package/cjs/picker/canvas-picker-service.d.ts +2 -2
  133. package/cjs/picker/canvas-picker-service.js +20 -3
  134. package/cjs/picker/canvas-picker-service.js.map +1 -1
  135. package/cjs/picker/contributions/canvas-picker/glyph-picker.js +1 -1
  136. package/cjs/picker/contributions/canvas-picker/glyph-picker.js.map +1 -1
  137. package/cjs/picker/contributions/canvas-picker/group-picker.d.ts +7 -0
  138. package/cjs/picker/contributions/canvas-picker/group-picker.js +26 -0
  139. package/cjs/picker/contributions/canvas-picker/group-picker.js.map +1 -0
  140. package/cjs/picker/contributions/canvas-picker/module.js +3 -1
  141. package/cjs/picker/contributions/canvas-picker/module.js.map +1 -1
  142. package/cjs/picker/contributions/canvas-picker/symbol-picker.js +4 -2
  143. package/cjs/picker/contributions/canvas-picker/symbol-picker.js.map +1 -1
  144. package/cjs/picker/contributions/constants.d.ts +1 -0
  145. package/cjs/picker/contributions/constants.js +9 -8
  146. package/cjs/picker/contributions/constants.js.map +1 -1
  147. package/cjs/picker/contributions/math-picker/glyph-picker.js +1 -1
  148. package/cjs/picker/contributions/math-picker/glyph-picker.js.map +1 -1
  149. package/cjs/picker/global-picker-service.d.ts +1 -1
  150. package/cjs/picker/global-picker-service.js +12 -5
  151. package/cjs/picker/global-picker-service.js.map +1 -1
  152. package/cjs/picker/math-picker-service.d.ts +2 -2
  153. package/cjs/picker/math-picker-service.js +1 -1
  154. package/cjs/picker/math-picker-service.js.map +1 -1
  155. package/cjs/picker/pick-interceptor.d.ts +12 -0
  156. package/cjs/picker/pick-interceptor.js +32 -5
  157. package/cjs/picker/pick-interceptor.js.map +1 -1
  158. package/cjs/picker/pick-modules.js +2 -0
  159. package/cjs/picker/pick-modules.js.map +1 -1
  160. package/cjs/picker/picker-service.d.ts +1 -1
  161. package/cjs/picker/picker-service.js +15 -6
  162. package/cjs/picker/picker-service.js.map +1 -1
  163. package/cjs/plugins/builtin-plugin/flex-layout-plugin.d.ts +2 -0
  164. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +42 -21
  165. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  166. package/cjs/plugins/builtin-plugin/html-attribute-plugin.d.ts +13 -0
  167. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +79 -0
  168. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -0
  169. package/cjs/plugins/plugin-modules.js +1 -1
  170. package/cjs/plugins/plugin-modules.js.map +1 -1
  171. package/cjs/render/contributions/render/contributions/image-contribution-render.js +23 -1
  172. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  173. package/cjs/render/contributions/render/draw-contribution.d.ts +3 -1
  174. package/cjs/render/contributions/render/draw-contribution.js +3 -1
  175. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  176. package/cjs/render/contributions/render/draw-interceptor.d.ts +2 -0
  177. package/cjs/render/contributions/render/draw-interceptor.js +8 -0
  178. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  179. package/cjs/render/contributions/render/image-render.js +7 -3
  180. package/cjs/render/contributions/render/image-render.js.map +1 -1
  181. package/cjs/render/contributions/render/symbol-render.js +12 -5
  182. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  183. package/cjs/render/contributions/render/utils.d.ts +2 -2
  184. package/cjs/render/contributions/render/utils.js.map +1 -1
  185. package/cjs/render/render-service.js +3 -1
  186. package/cjs/render/render-service.js.map +1 -1
  187. package/dist/index.js +3686 -428
  188. package/dist/index.min.js +1 -1
  189. package/es/animate/animate.d.ts +1 -0
  190. package/es/animate/animate.js +3 -0
  191. package/es/animate/animate.js.map +1 -1
  192. package/es/animate/timeline.d.ts +1 -1
  193. package/es/animate/timeline.js +2 -2
  194. package/es/animate/timeline.js.map +1 -1
  195. package/es/canvas/contributions/browser/context.d.ts +1 -0
  196. package/es/common/contribution-provider.d.ts +1 -0
  197. package/es/common/contribution-provider.js +4 -0
  198. package/es/common/contribution-provider.js.map +1 -1
  199. package/es/common/enums.d.ts +4 -2
  200. package/es/common/enums.js +3 -2
  201. package/es/common/enums.js.map +1 -1
  202. package/es/core/contributions/env/base-contribution.d.ts +11 -1
  203. package/es/core/contributions/env/base-contribution.js +23 -0
  204. package/es/core/contributions/env/base-contribution.js.map +1 -1
  205. package/es/core/contributions/env/browser-contribution.d.ts +11 -2
  206. package/es/core/contributions/env/browser-contribution.js +67 -1
  207. package/es/core/contributions/env/browser-contribution.js.map +1 -1
  208. package/es/core/contributions/textMeasure/layout.js +1 -1
  209. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  210. package/es/core/contributions/window/base-contribution.d.ts +11 -5
  211. package/es/core/contributions/window/base-contribution.js +10 -0
  212. package/es/core/contributions/window/base-contribution.js.map +1 -1
  213. package/es/core/contributions/window/browser-contribution.d.ts +11 -0
  214. package/es/core/contributions/window/browser-contribution.js +33 -2
  215. package/es/core/contributions/window/browser-contribution.js.map +1 -1
  216. package/es/core/global.d.ts +11 -1
  217. package/es/core/global.js +18 -0
  218. package/es/core/global.js.map +1 -1
  219. package/es/core/graphic-utils.d.ts +2 -0
  220. package/es/core/graphic-utils.js +13 -0
  221. package/es/core/graphic-utils.js.map +1 -1
  222. package/es/core/layer.js +6 -6
  223. package/es/core/layer.js.map +1 -1
  224. package/es/core/stage.d.ts +13 -4
  225. package/es/core/stage.js +57 -24
  226. package/es/core/stage.js.map +1 -1
  227. package/es/core/window.d.ts +6 -0
  228. package/es/core/window.js +10 -1
  229. package/es/core/window.js.map +1 -1
  230. package/es/event/event-manager.js +8 -8
  231. package/es/event/event-manager.js.map +1 -1
  232. package/es/event/event-system.js.map +1 -1
  233. package/es/event/federated-event/pointer-event.d.ts +1 -0
  234. package/es/event/federated-event/pointer-event.js.map +1 -1
  235. package/es/graphic/builtin-symbol/arrow2-down.d.ts +12 -0
  236. package/es/graphic/builtin-symbol/arrow2-down.js +24 -0
  237. package/es/graphic/builtin-symbol/arrow2-down.js.map +1 -0
  238. package/es/graphic/builtin-symbol/arrow2-left.js +1 -1
  239. package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  240. package/es/graphic/builtin-symbol/arrow2-right.js +1 -1
  241. package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  242. package/es/graphic/builtin-symbol/arrow2-up.d.ts +12 -0
  243. package/es/graphic/builtin-symbol/arrow2-up.js +24 -0
  244. package/es/graphic/builtin-symbol/arrow2-up.js.map +1 -0
  245. package/es/graphic/builtin-symbol/close.d.ts +13 -0
  246. package/es/graphic/builtin-symbol/close.js +27 -0
  247. package/es/graphic/builtin-symbol/close.js.map +1 -0
  248. package/es/graphic/builtin-symbol/index.d.ts +1 -1
  249. package/es/graphic/builtin-symbol/index.js +11 -1
  250. package/es/graphic/builtin-symbol/index.js.map +1 -1
  251. package/es/graphic/builtin-symbol/line-h.d.ts +13 -0
  252. package/es/graphic/builtin-symbol/line-h.js +26 -0
  253. package/es/graphic/builtin-symbol/line-h.js.map +1 -0
  254. package/es/graphic/builtin-symbol/line-v.d.ts +13 -0
  255. package/es/graphic/builtin-symbol/line-v.js +26 -0
  256. package/es/graphic/builtin-symbol/line-v.js.map +1 -0
  257. package/es/graphic/builtin-symbol/utils.d.ts +13 -5
  258. package/es/graphic/builtin-symbol/utils.js +25 -7
  259. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  260. package/es/graphic/config.js +8 -4
  261. package/es/graphic/config.js.map +1 -1
  262. package/es/graphic/constants.d.ts +22 -0
  263. package/es/graphic/constants.js +26 -0
  264. package/es/graphic/constants.js.map +1 -1
  265. package/es/graphic/graphic.d.ts +4 -1
  266. package/es/graphic/graphic.js +48 -21
  267. package/es/graphic/graphic.js.map +1 -1
  268. package/es/graphic/group.js +1 -1
  269. package/es/graphic/group.js.map +1 -1
  270. package/es/graphic/index.d.ts +1 -0
  271. package/es/graphic/index.js +2 -0
  272. package/es/graphic/index.js.map +1 -1
  273. package/es/graphic/richtext/utils.d.ts +1 -1
  274. package/es/graphic/richtext/utils.js +1 -1
  275. package/es/graphic/richtext/utils.js.map +1 -1
  276. package/es/graphic/symbol.d.ts +2 -1
  277. package/es/graphic/symbol.js +28 -1
  278. package/es/graphic/symbol.js.map +1 -1
  279. package/es/graphic/text.js +33 -23
  280. package/es/graphic/text.js.map +1 -1
  281. package/es/graphic/tools.d.ts +3 -2
  282. package/es/graphic/tools.js +59 -0
  283. package/es/graphic/tools.js.map +1 -1
  284. package/es/graphic/wrap-text.js +10 -8
  285. package/es/graphic/wrap-text.js.map +1 -1
  286. package/es/index.d.ts +3 -1
  287. package/es/index.js +5 -1
  288. package/es/index.js.map +1 -1
  289. package/es/interface/animate.d.ts +3 -1
  290. package/es/interface/animate.js.map +1 -1
  291. package/es/interface/core.d.ts +1 -0
  292. package/es/interface/core.js.map +1 -1
  293. package/es/interface/global.d.ts +25 -1
  294. package/es/interface/global.js.map +1 -1
  295. package/es/interface/graphic/image.d.ts +1 -0
  296. package/es/interface/graphic/image.js.map +1 -1
  297. package/es/interface/graphic/symbol.d.ts +3 -2
  298. package/es/interface/graphic/symbol.js.map +1 -1
  299. package/es/interface/graphic/text.d.ts +1 -0
  300. package/es/interface/graphic/text.js.map +1 -1
  301. package/es/interface/graphic.d.ts +27 -3
  302. package/es/interface/graphic.js.map +1 -1
  303. package/es/interface/picker.d.ts +9 -1
  304. package/es/interface/picker.js.map +1 -1
  305. package/es/interface/render.d.ts +1 -0
  306. package/es/interface/render.js.map +1 -1
  307. package/es/interface/stage.d.ts +10 -3
  308. package/es/interface/stage.js.map +1 -1
  309. package/es/interface/window.d.ts +12 -0
  310. package/es/interface/window.js.map +1 -1
  311. package/es/jsx/graphicType.d.ts +172 -0
  312. package/es/jsx/graphicType.js +126 -0
  313. package/es/jsx/graphicType.js.map +1 -0
  314. package/es/jsx/index.d.ts +2 -0
  315. package/es/jsx/index.js +4 -0
  316. package/es/jsx/index.js.map +1 -0
  317. package/es/jsx/jsx-classic.d.ts +3 -0
  318. package/es/jsx/jsx-classic.js +56 -0
  319. package/es/jsx/jsx-classic.js.map +1 -0
  320. package/es/picker/canvas-picker-service.d.ts +2 -2
  321. package/es/picker/canvas-picker-service.js +20 -3
  322. package/es/picker/canvas-picker-service.js.map +1 -1
  323. package/es/picker/contributions/canvas-picker/glyph-picker.js +1 -1
  324. package/es/picker/contributions/canvas-picker/glyph-picker.js.map +1 -1
  325. package/es/picker/contributions/canvas-picker/group-picker.d.ts +7 -0
  326. package/es/picker/contributions/canvas-picker/group-picker.js +23 -0
  327. package/es/picker/contributions/canvas-picker/group-picker.js.map +1 -0
  328. package/es/picker/contributions/canvas-picker/module.js +6 -2
  329. package/es/picker/contributions/canvas-picker/module.js.map +1 -1
  330. package/es/picker/contributions/canvas-picker/symbol-picker.js +6 -1
  331. package/es/picker/contributions/canvas-picker/symbol-picker.js.map +1 -1
  332. package/es/picker/contributions/constants.d.ts +1 -0
  333. package/es/picker/contributions/constants.js +2 -0
  334. package/es/picker/contributions/constants.js.map +1 -1
  335. package/es/picker/contributions/math-picker/glyph-picker.js +1 -1
  336. package/es/picker/contributions/math-picker/glyph-picker.js.map +1 -1
  337. package/es/picker/global-picker-service.d.ts +1 -1
  338. package/es/picker/global-picker-service.js +12 -5
  339. package/es/picker/global-picker-service.js.map +1 -1
  340. package/es/picker/math-picker-service.d.ts +2 -2
  341. package/es/picker/math-picker-service.js +1 -1
  342. package/es/picker/math-picker-service.js.map +1 -1
  343. package/es/picker/pick-interceptor.d.ts +12 -0
  344. package/es/picker/pick-interceptor.js +34 -4
  345. package/es/picker/pick-interceptor.js.map +1 -1
  346. package/es/picker/pick-modules.js +4 -2
  347. package/es/picker/pick-modules.js.map +1 -1
  348. package/es/picker/picker-service.d.ts +1 -1
  349. package/es/picker/picker-service.js +15 -6
  350. package/es/picker/picker-service.js.map +1 -1
  351. package/es/plugins/builtin-plugin/flex-layout-plugin.d.ts +2 -0
  352. package/es/plugins/builtin-plugin/flex-layout-plugin.js +47 -20
  353. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  354. package/es/plugins/builtin-plugin/html-attribute-plugin.d.ts +13 -0
  355. package/es/plugins/builtin-plugin/html-attribute-plugin.js +75 -0
  356. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -0
  357. package/es/plugins/plugin-modules.js +2 -2
  358. package/es/plugins/plugin-modules.js.map +1 -1
  359. package/es/render/contributions/render/contributions/image-contribution-render.js +27 -0
  360. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  361. package/es/render/contributions/render/draw-contribution.d.ts +3 -1
  362. package/es/render/contributions/render/draw-contribution.js +4 -0
  363. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  364. package/es/render/contributions/render/draw-interceptor.d.ts +2 -0
  365. package/es/render/contributions/render/draw-interceptor.js +8 -0
  366. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  367. package/es/render/contributions/render/image-render.js +10 -2
  368. package/es/render/contributions/render/image-render.js.map +1 -1
  369. package/es/render/contributions/render/symbol-render.js +12 -5
  370. package/es/render/contributions/render/symbol-render.js.map +1 -1
  371. package/es/render/contributions/render/utils.d.ts +2 -2
  372. package/es/render/contributions/render/utils.js.map +1 -1
  373. package/es/render/render-service.js +3 -1
  374. package/es/render/render-service.js.map +1 -1
  375. package/package.json +11 -14
@@ -1,11 +1,19 @@
1
- import type { IBounds } from '@visactor/vutils';
2
- import type { IContext2d, ICustomPath2D, ISymbolClass } from '../../interface';
1
+ import { type IBounds } from '@visactor/vutils';
2
+ import type { IContext2d, ICustomPath2D, IGraphicAttribute, ISymbolClass } from '../../interface';
3
3
  export declare class CustomSymbolClass implements ISymbolClass {
4
4
  type: string;
5
5
  path: ICustomPath2D;
6
6
  pathStr: string;
7
- constructor(type: string, path: ICustomPath2D);
8
- drawOffset(ctx: IContext2d, size: number, x: number, y: number, offset: number): boolean;
9
- draw(ctx: IContext2d, size: number, x: number, y: number): boolean;
7
+ isSvg: boolean;
8
+ svgCache?: {
9
+ path: ICustomPath2D;
10
+ attribute: Partial<IGraphicAttribute>;
11
+ }[];
12
+ constructor(type: string, path: ICustomPath2D | {
13
+ path: ICustomPath2D;
14
+ attribute: Partial<IGraphicAttribute>;
15
+ }[], isSvg?: boolean);
16
+ drawOffset(ctx: IContext2d, size: number, x: number, y: number, offset: number, z?: number, cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void): boolean;
17
+ draw(ctx: IContext2d, size: number, x: number, y: number, z?: number, cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void): boolean;
10
18
  bounds(size: number, bounds: IBounds): void;
11
19
  }
@@ -4,21 +4,35 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.CustomSymbolClass = void 0;
6
6
 
7
- const render_command_list_1 = require("../../common/render-command-list");
7
+ const vutils_1 = require("@visactor/vutils"), render_command_list_1 = require("../../common/render-command-list"), tempBounds = new vutils_1.AABBBounds;
8
8
 
9
9
  class CustomSymbolClass {
10
- constructor(type, path) {
11
- this.pathStr = "", this.type = type, this.path = path;
10
+ constructor(type, path, isSvg = !1) {
11
+ this.pathStr = "", this.type = type, (0, vutils_1.isArray)(path) ? this.svgCache = path : this.path = path,
12
+ this.isSvg = isSvg;
12
13
  }
13
- drawOffset(ctx, size, x, y, offset) {
14
- return (0, render_command_list_1.renderCommandList)(this.path.commandList, ctx, x, y, size + offset, size + offset),
15
- !1;
14
+ drawOffset(ctx, size, x, y, offset, z, cb) {
15
+ return this.isSvg ? !!this.svgCache && (this.svgCache.forEach((item => {
16
+ ctx.beginPath(), (0, render_command_list_1.renderCommandList)(item.path.commandList, ctx, x, y, size, size),
17
+ cb && cb(item.path, item.attribute);
18
+ })), !1) : ((0, render_command_list_1.renderCommandList)(this.path.commandList, ctx, x, y, size + offset, size + offset),
19
+ !1);
16
20
  }
17
- draw(ctx, size, x, y) {
18
- return (0, render_command_list_1.renderCommandList)(this.path.commandList, ctx, x, y, size, size),
19
- !1;
21
+ draw(ctx, size, x, y, z, cb) {
22
+ return this.isSvg ? !!this.svgCache && (this.svgCache.forEach((item => {
23
+ ctx.beginPath(), (0, render_command_list_1.renderCommandList)(item.path.commandList, ctx, x, y, size, size),
24
+ cb && cb(item.path, item.attribute);
25
+ })), !1) : ((0, render_command_list_1.renderCommandList)(this.path.commandList, ctx, x, y, size, size),
26
+ !1);
20
27
  }
21
28
  bounds(size, bounds) {
29
+ if (this.isSvg) {
30
+ if (!this.svgCache) return;
31
+ return bounds.clear(), void this.svgCache.forEach((({path: path}) => {
32
+ tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size,
33
+ tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
34
+ }));
35
+ }
22
36
  this.path.bounds && (bounds.x1 = this.path.bounds.x1 * size, bounds.y1 = this.path.bounds.y1 * size,
23
37
  bounds.x2 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AC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACzC,CAAC;CACF;AA7BD,8CA6BC","file":"utils.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport { renderCommandList } from '../../common/render-command-list';\nimport type { IContext2d, ICustomPath2D, ISymbolClass } from '../../interface';\n\nexport class CustomSymbolClass implements ISymbolClass {\n type: string;\n path: ICustomPath2D;\n pathStr: string = '';\n\n constructor(type: string, path: ICustomPath2D) {\n this.type = type;\n this.path = path;\n }\n\n drawOffset(ctx: IContext2d, size: number, x: number, y: number, offset: number) {\n renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n draw(ctx: IContext2d, size: number, x: number, y: number) {\n renderCommandList(this.path.commandList, ctx, x, y, size, size);\n return false;\n }\n\n bounds(size: number, bounds: IBounds) {\n if (!this.path.bounds) {\n return;\n }\n bounds.x1 = this.path.bounds.x1 * size;\n bounds.y1 = this.path.bounds.y1 * size;\n bounds.x2 = this.path.bounds.x2 * size;\n bounds.y2 = this.path.bounds.y2 * size;\n }\n}\n\n// export function CustomSymbol(): ISymbolClass {\n\n// }\n"]}
1
+ {"version":3,"sources":["../src/graphic/builtin-symbol/utils.ts"],"names":[],"mappings":";;;AAAA,6CAAqE;AACrE,0EAAqE;AAGrE,MAAM,UAAU,GAAG,IAAI,mBAAU,EAAE,CAAC;AACpC,MAAa,iBAAiB;IAO5B,YACE,IAAY,EACZ,IAAsF,EACtF,QAAiB,KAAK;QAPxB,YAAO,GAAW,EAAE,CAAC;QASnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,IAAA,gBAAO,EAAC,IAAI,CAAC,EAAE;YACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;SACtB;aAAM;YACL,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SAClB;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,UAAU,CACR,GAAe,EACf,IAAY,EACZ,CAA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CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACzC,CAAC;CACF;AA3FD,8CA2FC","file":"utils.js","sourcesContent":["import { isArray, type IBounds, AABBBounds } from '@visactor/vutils';\nimport { renderCommandList } from '../../common/render-command-list';\nimport type { IContext2d, ICustomPath2D, IGraphicAttribute, ISymbolClass } from '../../interface';\n\nconst tempBounds = new AABBBounds();\nexport class CustomSymbolClass implements ISymbolClass {\n type: string;\n path: ICustomPath2D;\n pathStr: string = '';\n isSvg: boolean;\n svgCache?: { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[];\n\n constructor(\n type: string,\n path: ICustomPath2D | { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[],\n isSvg: boolean = false\n ) {\n this.type = type;\n if (isArray(path)) {\n this.svgCache = path;\n } else {\n this.path = path;\n }\n this.isSvg = isSvg;\n }\n\n drawOffset(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n offset: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n ctx.beginPath();\n renderCommandList(item.path.commandList, ctx, x, y, size, size);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n draw(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n ctx.beginPath();\n renderCommandList(item.path.commandList, ctx, x, y, size, size);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n renderCommandList(this.path.commandList, ctx, x, y, size, size);\n return false;\n }\n\n bounds(size: number, bounds: IBounds) {\n if (this.isSvg) {\n if (!this.svgCache) {\n return;\n }\n bounds.clear();\n this.svgCache.forEach(({ path }) => {\n tempBounds.x1 = path.bounds.x1 * size;\n tempBounds.y1 = path.bounds.y1 * size;\n tempBounds.x2 = path.bounds.x2 * size;\n tempBounds.y2 = path.bounds.y2 * size;\n bounds.union(tempBounds);\n });\n return;\n }\n if (!this.path.bounds) {\n return;\n }\n bounds.x1 = this.path.bounds.x1 * size;\n bounds.y1 = this.path.bounds.y1 * size;\n bounds.x2 = this.path.bounds.x2 * size;\n bounds.y2 = this.path.bounds.y2 * size;\n }\n}\n\n// export function CustomSymbol(): ISymbolClass {\n\n// }\n"]}
@@ -81,7 +81,8 @@ exports.DefaultStrokeStyle = Object.assign({
81
81
  lineThrough: 0,
82
82
  scaleIn3d: !1,
83
83
  direction: "horizontal",
84
- wordBreak: "break-all"
84
+ wordBreak: "break-all",
85
+ ignoreBuf: !1
85
86
  }, exports.DefaultStyle = Object.assign(Object.assign(Object.assign({
86
87
  opacity: 1,
87
88
  background: null,
@@ -91,7 +92,8 @@ exports.DefaultStrokeStyle = Object.assign({
91
92
  texturePadding: 2,
92
93
  backgroundMode: 0,
93
94
  blur: 0,
94
- cursor: null
95
+ cursor: null,
96
+ html: null
95
97
  }, exports.DefaultFillStyle), exports.DefaultStrokeStyle), exports.DefaultLayout),
96
98
  exports.DefaultConnectAttribute = {
97
99
  connectedType: "none",
@@ -109,7 +111,8 @@ exports.DefaultConnectAttribute = {
109
111
  pickMode: "accurate",
110
112
  customPickShape: null,
111
113
  boundsMode: "accurate",
112
- keepDirIn3d: !0
114
+ keepDirIn3d: !0,
115
+ shadowRootIdx: 1
113
116
  }, exports.DefaultStyle), exports.DefaultTransform), exports.addAttributeToPrototype = addAttributeToPrototype,
114
117
  exports.rewriteProto = rewriteProto, exports.DefaultArcAttribute = Object.assign(Object.assign({}, exports.DefaultAttribute), {
115
118
  startAngle: 0,
@@ -201,7 +204,8 @@ exports.rewriteProto = rewriteProto, exports.DefaultArcAttribute = Object.assign
201
204
  width: 0,
202
205
  height: 0
203
206
  }, exports.DefaultAttribute), {
204
- fill: !0
207
+ fill: !0,
208
+ cornerRadius: 0
205
209
  }), exports.DefaultRichTextIconAttribute = Object.assign(Object.assign({}, exports.DefaultImageAttribute), {
206
210
  backgroundShowMode: "never",
207
211
  backgroundWidth: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":";;;AACA,6CAA+C;AAC/C,2DAAuD;AA+B1C,QAAA,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEW,QAAA,gBAAgB,GAAe;IAC1C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAChB,UAAU,EAAE,IAAI,eAAM,EAAE;CACzB,CAAC;AAEW,QAAA,gBAAgB,GAAe;IAC1C,WAAW,EAAE,CAAC;IACd,IAAI,EAAE,KAAK;IACX,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,OAAO;IACpB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,YAAY,GAAsD;IACtE,aAAa,EAAE,CAAC;IAChB,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,CAAC;IACjB,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE;IACd,kBAAkB,EAAE,CAAC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CAChC,wBAAgB,KACnB,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,GAAG,EACX,QAAQ,EAAE,IAAI,EACd,SAAS,EAAE,YAAiC,EAC5C,iBAAiB,EAAE,KAAkC,EACrD,SAAS,EAAE,MAAiC,EAC5C,YAAY,EAAE,KAAmC,EACjD,eAAe,EAAE,YAAY,EAC7B,UAAU,EAAE,EAAE,EACd,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,KAAK,IACjB;AAEW,QAAA,qBAAqB,iCAChC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,EAAE,EACT,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,IACN,wBAAgB,KACnB,IAAI,EAAE,IAAI,IACV;AAEW,QAAA,4BAA4B,mCACpC,6BAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,IACV","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport type {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute,\n IConnectedStyle,\n ILayout\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all'\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n opacity: 1,\n background: null,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 0,\n blur: 0,\n cursor: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n pickable: true,\n childrenPickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start'\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n console.warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
1
+ {"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":";;;AACA,6CAA+C;AAC/C,2DAAuD;AA+B1C,QAAA,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEW,QAAA,gBAAgB,GAAe;IAC1C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,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ACnB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,CAAC,IACf;AAEW,QAAA,4BAA4B,mCACpC,6BAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,IACV","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport type {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute,\n IConnectedStyle,\n ILayout\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n opacity: 1,\n background: null,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 0,\n blur: 0,\n cursor: null,\n html: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n pickable: true,\n childrenPickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start'\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n console.warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
@@ -16,3 +16,25 @@ export declare const SYMBOL_NUMBER_TYPE: number;
16
16
  export declare const TEXT_NUMBER_TYPE: number;
17
17
  export declare const GraphicService: unique symbol;
18
18
  export declare const GraphicCreator: unique symbol;
19
+ export declare const SVG_ATTRIBUTE_MAP: {
20
+ 'stroke-linecap': string;
21
+ 'stroke-linejoin': string;
22
+ 'stroke-dasharray': string;
23
+ 'stroke-dashoffset': string;
24
+ 'stroke-width': string;
25
+ 'fill-opacity': string;
26
+ 'stroke-opacity': string;
27
+ };
28
+ export declare const SVG_ATTRIBUTE_MAP_KEYS: string[];
29
+ export declare const SVG_PARSE_ATTRIBUTE_MAP: {
30
+ '@_stroke-linecap': string;
31
+ '@_stroke-linejoin': string;
32
+ '@_stroke-dasharray': string;
33
+ '@_stroke-dashoffset': string;
34
+ '@_stroke-width': string;
35
+ '@_fill-opacity': string;
36
+ '@_stroke-opacity': string;
37
+ '@_stroke': string;
38
+ '@_fill': string;
39
+ };
40
+ export declare const SVG_PARSE_ATTRIBUTE_MAP_KEYS: string[];
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.GraphicCreator = exports.GraphicService = exports.TEXT_NUMBER_TYPE = exports.SYMBOL_NUMBER_TYPE = exports.RICHTEXT_NUMBER_TYPE = exports.RECT3D_NUMBER_TYPE = exports.RECT_NUMBER_TYPE = exports.PYRAMID3D_NUMBER_TYPE = exports.POLYGON_NUMBER_TYPE = exports.PATH_NUMBER_TYPE = exports.LINE_NUMBER_TYPE = exports.IMAGE_NUMBER_TYPE = exports.GROUP_NUMBER_TYPE = exports.GLYPH_NUMBER_TYPE = exports.CIRCLE_NUMBER_TYPE = exports.AREA_NUMBER_TYPE = exports.ARC3D_NUMBER_TYPE = exports.ARC_NUMBER_TYPE = void 0;
5
+ }), exports.SVG_PARSE_ATTRIBUTE_MAP_KEYS = exports.SVG_PARSE_ATTRIBUTE_MAP = exports.SVG_ATTRIBUTE_MAP_KEYS = exports.SVG_ATTRIBUTE_MAP = exports.GraphicCreator = exports.GraphicService = exports.TEXT_NUMBER_TYPE = exports.SYMBOL_NUMBER_TYPE = exports.RICHTEXT_NUMBER_TYPE = exports.RECT3D_NUMBER_TYPE = exports.RECT_NUMBER_TYPE = exports.PYRAMID3D_NUMBER_TYPE = exports.POLYGON_NUMBER_TYPE = exports.PATH_NUMBER_TYPE = exports.LINE_NUMBER_TYPE = exports.IMAGE_NUMBER_TYPE = exports.GROUP_NUMBER_TYPE = exports.GLYPH_NUMBER_TYPE = exports.CIRCLE_NUMBER_TYPE = exports.AREA_NUMBER_TYPE = exports.ARC3D_NUMBER_TYPE = exports.ARC_NUMBER_TYPE = void 0;
6
6
 
7
7
  const tools_1 = require("./tools");
8
8
 
@@ -17,5 +17,23 @@ tools_1.genNumberType)(), exports.RECT_NUMBER_TYPE = (0, tools_1.genNumberType)(
17
17
  exports.RECT3D_NUMBER_TYPE = (0, tools_1.genNumberType)(), exports.RICHTEXT_NUMBER_TYPE = (0,
18
18
  tools_1.genNumberType)(), exports.SYMBOL_NUMBER_TYPE = (0, tools_1.genNumberType)(),
19
19
  exports.TEXT_NUMBER_TYPE = (0, tools_1.genNumberType)(), exports.GraphicService = Symbol.for("GraphicService"),
20
- exports.GraphicCreator = Symbol.for("GraphicCreator");
20
+ exports.GraphicCreator = Symbol.for("GraphicCreator"), exports.SVG_ATTRIBUTE_MAP = {
21
+ "stroke-linecap": "lineCap",
22
+ "stroke-linejoin": "lineJoin",
23
+ "stroke-dasharray": "lineDash",
24
+ "stroke-dashoffset": "lineDashOffset",
25
+ "stroke-width": "lineWidth",
26
+ "fill-opacity": "fillOpacity",
27
+ "stroke-opacity": "strokeOpacity"
28
+ }, exports.SVG_ATTRIBUTE_MAP_KEYS = Object.keys(exports.SVG_ATTRIBUTE_MAP), exports.SVG_PARSE_ATTRIBUTE_MAP = {
29
+ "@_stroke-linecap": "lineCap",
30
+ "@_stroke-linejoin": "lineJoin",
31
+ "@_stroke-dasharray": "lineDash",
32
+ "@_stroke-dashoffset": "lineDashOffset",
33
+ "@_stroke-width": "lineWidth",
34
+ "@_fill-opacity": "fillOpacity",
35
+ "@_stroke-opacity": "strokeOpacity",
36
+ "@_stroke": "stroke",
37
+ "@_fill": "fill"
38
+ }, exports.SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(exports.SVG_PARSE_ATTRIBUTE_MAP);
21
39
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/constants.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAE3B,QAAA,eAAe,GAAG,IAAA,qBAAa,GAAE,CAAC;AAClC,QAAA,iBAAiB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACpC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACnC,QAAA,kBAAkB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACrC,QAAA,iBAAiB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACpC,QAAA,iBAAiB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACpC,QAAA,iBAAiB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACpC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACnC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACnC,QAAA,mBAAmB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACtC,QAAA,qBAAqB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACxC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACnC,QAAA,kBAAkB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACrC,QAAA,oBAAoB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACvC,QAAA,kBAAkB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACrC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AAEnC,QAAA,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC9C,QAAA,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC","file":"constants.js","sourcesContent":["import { genNumberType } from './tools';\n\nexport const ARC_NUMBER_TYPE = genNumberType();\nexport const ARC3D_NUMBER_TYPE = genNumberType();\nexport const AREA_NUMBER_TYPE = genNumberType();\nexport const CIRCLE_NUMBER_TYPE = genNumberType();\nexport const GLYPH_NUMBER_TYPE = genNumberType();\nexport const GROUP_NUMBER_TYPE = genNumberType();\nexport const IMAGE_NUMBER_TYPE = genNumberType();\nexport const LINE_NUMBER_TYPE = genNumberType();\nexport const PATH_NUMBER_TYPE = genNumberType();\nexport const POLYGON_NUMBER_TYPE = genNumberType();\nexport const PYRAMID3D_NUMBER_TYPE = genNumberType();\nexport const RECT_NUMBER_TYPE = genNumberType();\nexport const RECT3D_NUMBER_TYPE = genNumberType();\nexport const RICHTEXT_NUMBER_TYPE = genNumberType();\nexport const SYMBOL_NUMBER_TYPE = genNumberType();\nexport const TEXT_NUMBER_TYPE = genNumberType();\n\nexport const GraphicService = Symbol.for('GraphicService');\nexport const GraphicCreator = Symbol.for('GraphicCreator');\n"]}
1
+ {"version":3,"sources":["../src/graphic/constants.ts"],"names":[],"mappings":";;;AAAA,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AAM,CAAC,IAAI,CAAC,yBAAiB,CAAC,CAAC;AAExD,QAAA,uBAAuB,GAAG;IACrC,kBAAkB,EAAE,SAAS;IAC7B,mBAAmB,EAAE,UAAU;IAC/B,oBAAoB,EAAE,UAAU;IAChC,qBAAqB,EAAE,gBAAgB;IACvC,gBAAgB,EAAE,WAAW;IAC7B,gBAAgB,EAAE,aAAa;IAC/B,kBAAkB,EAAE,eAAe;IACnC,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEW,QAAA,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,+BAAuB,CAAC,CAAC","file":"constants.js","sourcesContent":["import { genNumberType } from './tools';\n\nexport const ARC_NUMBER_TYPE = genNumberType();\nexport const ARC3D_NUMBER_TYPE = genNumberType();\nexport const AREA_NUMBER_TYPE = genNumberType();\nexport const CIRCLE_NUMBER_TYPE = genNumberType();\nexport const GLYPH_NUMBER_TYPE = genNumberType();\nexport const GROUP_NUMBER_TYPE = genNumberType();\nexport const IMAGE_NUMBER_TYPE = genNumberType();\nexport const LINE_NUMBER_TYPE = genNumberType();\nexport const PATH_NUMBER_TYPE = genNumberType();\nexport const POLYGON_NUMBER_TYPE = genNumberType();\nexport const PYRAMID3D_NUMBER_TYPE = genNumberType();\nexport const RECT_NUMBER_TYPE = genNumberType();\nexport const RECT3D_NUMBER_TYPE = genNumberType();\nexport const RICHTEXT_NUMBER_TYPE = genNumberType();\nexport const SYMBOL_NUMBER_TYPE = genNumberType();\nexport const TEXT_NUMBER_TYPE = genNumberType();\n\nexport const GraphicService = Symbol.for('GraphicService');\nexport const GraphicCreator = Symbol.for('GraphicCreator');\n\nexport const SVG_ATTRIBUTE_MAP = {\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-width': 'lineWidth',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity'\n};\n\nexport const SVG_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_ATTRIBUTE_MAP);\n\nexport const SVG_PARSE_ATTRIBUTE_MAP = {\n '@_stroke-linecap': 'lineCap',\n '@_stroke-linejoin': 'lineJoin',\n '@_stroke-dasharray': 'lineDash',\n '@_stroke-dashoffset': 'lineDashOffset',\n '@_stroke-width': 'lineWidth',\n '@_fill-opacity': 'fillOpacity',\n '@_stroke-opacity': 'strokeOpacity',\n '@_stroke': 'stroke',\n '@_fill': 'fill'\n};\n\nexport const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);\n"]}
@@ -86,7 +86,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
86
86
  translateTo(x: number, y: number): this;
87
87
  scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike): this;
88
88
  scaleTo(scaleX: number, scaleY: number): this;
89
- rotate(angle: number): this;
89
+ rotate(angle: number, rotateCenter?: IPointLike): this;
90
90
  rotateTo(angle: number): this;
91
91
  skewTo(b: number, c: number): this;
92
92
  animate(params?: IGraphicAnimateParams): Animate;
@@ -114,6 +114,9 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
114
114
  addUpdateGlobalPositionTag(): void;
115
115
  protected clearUpdateLocalPositionTag(): void;
116
116
  protected clearUpdateGlobalPositionTag(): void;
117
+ addUpdateLayoutTag(): void;
118
+ protected clearUpdateLayoutTag(): void;
119
+ protected needUpdateLayout(): boolean;
117
120
  protected doUpdateLocalMatrix(): void;
118
121
  protected doUpdateGlobalMatrix(): void;
119
122
  setStage(stage?: IStage, layer?: ILayer): void;
@@ -63,7 +63,7 @@ class Graphic extends node_tree_1.Node {
63
63
  if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
64
64
  application_1.application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
65
65
  const bounds = this.doUpdateAABBBounds(full);
66
- return application_1.application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
66
+ return this.addUpdateLayoutTag(), application_1.application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
67
67
  bounds;
68
68
  }
69
69
  combindShadowAABBBounds(bounds) {
@@ -139,7 +139,7 @@ class Graphic extends node_tree_1.Node {
139
139
  this.attribute[key] = params[key];
140
140
  }
141
141
  this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTags(keys) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
142
- this.addUpdatePositionTag(), this.onAttributeUpdate(context);
142
+ this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context);
143
143
  }
144
144
  setAttribute(key, value, forceUpdateTag, context) {
145
145
  var _a;
@@ -148,7 +148,7 @@ class Graphic extends node_tree_1.Node {
148
148
  }, this.attribute, key, context);
149
149
  params ? this._setAttributes(params, forceUpdateTag, context) : (0, vutils_1.isNil)(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value,
150
150
  this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
151
- this.addUpdatePositionTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value,
151
+ this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value,
152
152
  "background" === key && this.loadImage(value, !0);
153
153
  }
154
154
  needUpdateTags(keys) {
@@ -185,8 +185,8 @@ class Graphic extends node_tree_1.Node {
185
185
  const attribute = this.attribute, postMatrix = attribute.postMatrix;
186
186
  return postMatrix ? application_1.application.transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y) : (attribute.x = (null !== (_a = attribute.x) && void 0 !== _a ? _a : config_1.DefaultTransform.x) + x,
187
187
  attribute.y = (null !== (_b = attribute.y) && void 0 !== _b ? _b : config_1.DefaultTransform.y) + y),
188
- this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.onAttributeUpdate(context),
189
- this;
188
+ this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.addUpdateLayoutTag(),
189
+ this.onAttributeUpdate(context), this;
190
190
  }
191
191
  translateTo(x, y) {
192
192
  const attribute = this.attribute;
@@ -198,8 +198,8 @@ class Graphic extends node_tree_1.Node {
198
198
  y: y
199
199
  }, this.attribute, tempConstantXYKey, context);
200
200
  return params ? (this._setAttributes(params, !1, context), this) : (attribute.x = x,
201
- attribute.y = y, this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.onAttributeUpdate(context),
202
- this);
201
+ attribute.y = y, this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.addUpdateLayoutTag(),
202
+ this.onAttributeUpdate(context), this);
203
203
  }
204
204
  scale(scaleX, scaleY, scaleCenter) {
205
205
  var _a, _b;
@@ -220,8 +220,8 @@ class Graphic extends node_tree_1.Node {
220
220
  application_1.application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);
221
221
  } else attribute.scaleX = (null !== (_a = attribute.scaleX) && void 0 !== _a ? _a : config_1.DefaultTransform.scaleX) * scaleX,
222
222
  attribute.scaleY = (null !== (_b = attribute.scaleY) && void 0 !== _b ? _b : config_1.DefaultTransform.scaleY) * scaleY;
223
- return this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.onAttributeUpdate(context),
224
- this;
223
+ return this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.addUpdateLayoutTag(),
224
+ this.onAttributeUpdate(context), this;
225
225
  }
226
226
  scaleTo(scaleX, scaleY) {
227
227
  const attribute = this.attribute;
@@ -234,19 +234,26 @@ class Graphic extends node_tree_1.Node {
234
234
  }, this.attribute, tempConstantScaleXYKey, context);
235
235
  return params ? (this._setAttributes(params, !1, context), this) : (attribute.scaleX = scaleX,
236
236
  attribute.scaleY = scaleY, this.addUpdatePositionTag(), this.addUpdateBoundTag(),
237
- this.onAttributeUpdate(context), this);
237
+ this.addUpdateLayoutTag(), this.onAttributeUpdate(context), this);
238
238
  }
239
- rotate(angle) {
239
+ rotate(angle, rotateCenter) {
240
240
  var _a;
241
241
  if (0 === angle) return this;
242
242
  const context = {
243
243
  type: enums_1.AttributeUpdateType.ROTATE
244
- }, params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);
245
- if (params) return this._setAttributes(params, !1, context), this;
244
+ }, params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
245
+ angle: angle,
246
+ rotateCenter: rotateCenter
247
+ }, this.attribute, tempConstantAngleKey, context);
248
+ params && (delete params.angle, this._setAttributes(params, !1, context));
246
249
  const attribute = this.attribute;
247
- return attribute.angle = (null !== (_a = attribute.angle) && void 0 !== _a ? _a : config_1.DefaultTransform.angle) + angle,
248
- this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.onAttributeUpdate(context),
249
- this;
250
+ if (rotateCenter) {
251
+ let {postMatrix: postMatrix} = this.attribute;
252
+ postMatrix || (postMatrix = new vutils_1.Matrix, attribute.postMatrix = postMatrix),
253
+ application_1.application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);
254
+ } else attribute.angle = (null !== (_a = attribute.angle) && void 0 !== _a ? _a : config_1.DefaultTransform.angle) + angle;
255
+ return this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.addUpdateLayoutTag(),
256
+ this.onAttributeUpdate(context), this;
250
257
  }
251
258
  rotateTo(angle) {
252
259
  const attribute = this.attribute;
@@ -255,8 +262,8 @@ class Graphic extends node_tree_1.Node {
255
262
  type: enums_1.AttributeUpdateType.ROTATE_TO
256
263
  }, params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);
257
264
  return params ? (this._setAttributes(params, !1, context), this) : (attribute.angle = angle,
258
- this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.onAttributeUpdate(context),
259
- this);
265
+ this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.addUpdateLayoutTag(),
266
+ this.onAttributeUpdate(context), this);
260
267
  }
261
268
  skewTo(b, c) {
262
269
  return this;
@@ -382,6 +389,15 @@ class Graphic extends node_tree_1.Node {
382
389
  clearUpdateGlobalPositionTag() {
383
390
  this._updateTag &= enums_1.UpdateTag.CLEAR_GLOBAL_MATRIX;
384
391
  }
392
+ addUpdateLayoutTag() {
393
+ this._updateTag |= enums_1.UpdateTag.UPDATE_LAYOUT;
394
+ }
395
+ clearUpdateLayoutTag() {
396
+ this._updateTag &= enums_1.UpdateTag.CLEAR_LAYOUT;
397
+ }
398
+ needUpdateLayout() {
399
+ return !!(this._updateTag & enums_1.UpdateTag.UPDATE_LAYOUT);
400
+ }
385
401
  doUpdateLocalMatrix() {
386
402
  const {x: x = config_1.DefaultTransform.x, y: y = config_1.DefaultTransform.y, scaleX: scaleX = config_1.DefaultTransform.scaleX, scaleY: scaleY = config_1.DefaultTransform.scaleY, angle: angle = config_1.DefaultTransform.angle, scaleCenter: scaleCenter, anchor: anchor, postMatrix: postMatrix} = this.attribute, _anchor = [ 0, 0 ];
387
403
  if (anchor) {
@@ -416,8 +432,16 @@ class Graphic extends node_tree_1.Node {
416
432
  }
417
433
  }
418
434
  setStage(stage, layer) {
419
- this.stage !== stage && (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
420
- this._onSetStage && this._onSetStage(this, stage, layer), application_1.application.graphicService.onSetStage(this, stage));
435
+ if (this.stage !== stage) {
436
+ if (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
437
+ this.animates && this.animates.size) {
438
+ const timeline = stage.getTimeline();
439
+ this.animates.forEach((a => {
440
+ a.setTimeline(timeline);
441
+ }));
442
+ }
443
+ this._onSetStage && this._onSetStage(this, stage, layer), application_1.application.graphicService.onSetStage(this, stage);
444
+ }
421
445
  }
422
446
  setStageToShadowRoot(stage, layer) {
423
447
  this.shadowRoot && this.shadowRoot.setStage(stage, layer);
@@ -515,7 +539,7 @@ class Graphic extends node_tree_1.Node {
515
539
  this.pathProxy;
516
540
  }
517
541
  loadImage(image, background = !1) {
518
- if (!image) return;
542
+ if (!image || background && backgroundNotImage(image)) return;
519
543
  const url = image;
520
544
  this.resources || (this.resources = new Map);
521
545
  const cache = {
@@ -563,5 +587,9 @@ class Graphic extends node_tree_1.Node {
563
587
  }
564
588
  }
565
589
 
590
+ function backgroundNotImage(image) {
591
+ return !(!image.fill && !image.stroke);
592
+ }
593
+
566
594
  exports.Graphic = Graphic, Graphic.mixin(event_1.EventTarget);
567
595
  //# sourceMappingURL=graphic.js.map