@visactor/vrender-core 1.1.0-alpha.24 → 1.1.0-alpha.25

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 (322) hide show
  1. package/cjs/allocator/bounds-allocate.js +1 -2
  2. package/cjs/canvas/constants.js +2 -1
  3. package/cjs/common/bezier-utils.js +1 -2
  4. package/cjs/common/event-transformer.js +2 -1
  5. package/cjs/common/performance-raf.js +1 -2
  6. package/cjs/common/polygon.js +2 -2
  7. package/cjs/common/rect-utils.js +1 -1
  8. package/cjs/common/render-area.js +1 -1
  9. package/cjs/common/render-command-list.js +1 -1
  10. package/cjs/common/render-curve.js +1 -1
  11. package/cjs/common/render-utils.js +1 -1
  12. package/cjs/common/seg-context.js +1 -1
  13. package/cjs/container.d.ts +2 -0
  14. package/cjs/container.js +50 -0
  15. package/cjs/container.js.map +1 -0
  16. package/cjs/core/application.js +1 -1
  17. package/cjs/core/camera.js +1 -1
  18. package/cjs/core/constants.js +1 -1
  19. package/cjs/core/core-modules.js +1 -1
  20. package/cjs/core/global-module.js +2 -0
  21. package/cjs/core/global.js +1 -1
  22. package/cjs/core/graphic-utils.js +1 -1
  23. package/cjs/core/index.js +1 -1
  24. package/cjs/core/layer-service.js +2 -1
  25. package/cjs/core/layer.js +1 -1
  26. package/cjs/core/light.js +1 -1
  27. package/cjs/core/stage.d.ts +0 -9
  28. package/cjs/core/stage.js +12 -30
  29. package/cjs/core/stage.js.map +1 -1
  30. package/cjs/core/window.js +1 -1
  31. package/cjs/entries/miniapp.d.ts +0 -1
  32. package/cjs/entries/miniapp.js +1 -5
  33. package/cjs/entries/miniapp.js.map +1 -1
  34. package/cjs/entries/node.d.ts +0 -1
  35. package/cjs/entries/node.js +1 -5
  36. package/cjs/entries/node.js.map +1 -1
  37. package/cjs/env.d.ts +1 -0
  38. package/cjs/env.js +25 -0
  39. package/cjs/env.js.map +1 -0
  40. package/cjs/event/public-constant.d.ts +7 -0
  41. package/cjs/event/public-constant.js +100 -0
  42. package/cjs/event/public-constant.js.map +1 -0
  43. package/cjs/event/util.d.ts +1 -1
  44. package/cjs/graphic/base.d.ts +2 -0
  45. package/cjs/graphic/base.js +15 -0
  46. package/cjs/graphic/base.js.map +1 -0
  47. package/cjs/graphic/creator.d.ts +16 -0
  48. package/cjs/graphic/creator.js +160 -0
  49. package/cjs/graphic/creator.js.map +1 -0
  50. package/cjs/graphic/glyph.js +4 -8
  51. package/cjs/graphic/glyph.js.map +1 -1
  52. package/cjs/graphic/graphic.d.ts +19 -29
  53. package/cjs/graphic/graphic.js +121 -199
  54. package/cjs/graphic/graphic.js.map +1 -1
  55. package/cjs/graphic/group.d.ts +1 -3
  56. package/cjs/graphic/group.js +22 -28
  57. package/cjs/graphic/group.js.map +1 -1
  58. package/cjs/graphic/modules.d.ts +16 -0
  59. package/cjs/graphic/modules.js +150 -0
  60. package/cjs/graphic/modules.js.map +1 -0
  61. package/cjs/graphic/node-tree.d.ts +3 -3
  62. package/cjs/graphic/node-tree.js +1 -0
  63. package/cjs/graphic/node-tree.js.map +1 -1
  64. package/cjs/graphic/state/shared-state-refresh.js +11 -32
  65. package/cjs/graphic/state/shared-state-refresh.js.map +1 -1
  66. package/cjs/graphic/state/shared-state-scope.d.ts +2 -5
  67. package/cjs/graphic/state/shared-state-scope.js +8 -27
  68. package/cjs/graphic/state/shared-state-scope.js.map +1 -1
  69. package/cjs/graphic/state/state-definition-compiler.js +4 -5
  70. package/cjs/graphic/state/state-definition-compiler.js.map +1 -1
  71. package/cjs/graphic/state/state-definition.d.ts +2 -5
  72. package/cjs/graphic/state/state-definition.js.map +1 -1
  73. package/cjs/graphic/state/state-engine.d.ts +0 -5
  74. package/cjs/graphic/state/state-engine.js +20 -70
  75. package/cjs/graphic/state/state-engine.js.map +1 -1
  76. package/cjs/graphic/state/state-transition-orchestrator.d.ts +7 -9
  77. package/cjs/graphic/state/state-transition-orchestrator.js +10 -13
  78. package/cjs/graphic/state/state-transition-orchestrator.js.map +1 -1
  79. package/cjs/interface/graphic/group.d.ts +0 -2
  80. package/cjs/interface/graphic/group.js.map +1 -1
  81. package/cjs/interface/graphic.d.ts +1 -5
  82. package/cjs/interface/graphic.js.map +1 -1
  83. package/cjs/interface/index.js.map +1 -1
  84. package/cjs/interface/node-tree.d.ts +3 -0
  85. package/cjs/interface/node-tree.js.map +1 -1
  86. package/cjs/interface/stage.d.ts +0 -7
  87. package/cjs/interface/stage.js.map +1 -1
  88. package/cjs/interpolate.d.ts +2 -0
  89. package/cjs/interpolate.js +34 -0
  90. package/cjs/interpolate.js.map +1 -0
  91. package/cjs/modules.js.map +1 -1
  92. package/cjs/path.d.ts +4 -0
  93. package/cjs/path.js +33 -0
  94. package/cjs/path.js.map +1 -0
  95. package/cjs/plugin/3d.d.ts +3 -0
  96. package/cjs/plugin/3d.js +33 -0
  97. package/cjs/plugin/3d.js.map +1 -0
  98. package/cjs/plugin/attribute.d.ts +2 -0
  99. package/cjs/plugin/attribute.js +24 -0
  100. package/cjs/plugin/attribute.js.map +1 -0
  101. package/cjs/plugin/flex-layout.d.ts +1 -0
  102. package/cjs/plugin/flex-layout.js +15 -0
  103. package/cjs/plugin/flex-layout.js.map +1 -0
  104. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
  105. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  106. package/cjs/plugins/index.d.ts +0 -4
  107. package/cjs/plugins/index.js +1 -3
  108. package/cjs/plugins/index.js.map +1 -1
  109. package/cjs/plugins/plugin-service.d.ts +0 -1
  110. package/cjs/plugins/plugin-service.js +2 -3
  111. package/cjs/plugins/plugin-service.js.map +1 -1
  112. package/cjs/plugins/types.d.ts +1 -8
  113. package/cjs/plugins/types.js.map +1 -1
  114. package/cjs/register/graphic.d.ts +19 -0
  115. package/cjs/register/graphic.js +177 -0
  116. package/cjs/register/graphic.js.map +1 -0
  117. package/cjs/registry/contribution-registry.d.ts +0 -1
  118. package/cjs/registry/contribution-registry.js +0 -3
  119. package/cjs/registry/contribution-registry.js.map +1 -1
  120. package/cjs/registry/picker-registry.d.ts +0 -1
  121. package/cjs/registry/picker-registry.js +0 -3
  122. package/cjs/registry/picker-registry.js.map +1 -1
  123. package/cjs/registry/renderer-registry.d.ts +0 -1
  124. package/cjs/registry/renderer-registry.js +0 -3
  125. package/cjs/registry/renderer-registry.js.map +1 -1
  126. package/cjs/registry/types.d.ts +0 -3
  127. package/cjs/registry/types.js.map +1 -1
  128. package/cjs/svg.d.ts +1 -0
  129. package/cjs/svg.js +15 -0
  130. package/cjs/svg.js.map +1 -0
  131. package/cjs/text.d.ts +2 -0
  132. package/cjs/text.js +29 -0
  133. package/cjs/text.js.map +1 -0
  134. package/dist/index.es.js +279 -1591
  135. package/es/allocator/bounds-allocate.js +1 -2
  136. package/es/canvas/constants.js +2 -1
  137. package/es/common/bezier-utils.js +1 -2
  138. package/es/common/event-transformer.js +2 -1
  139. package/es/common/performance-raf.js +1 -2
  140. package/es/common/polygon.js +1 -1
  141. package/es/common/rect-utils.js +1 -1
  142. package/es/common/render-area.js +1 -1
  143. package/es/common/render-command-list.js +1 -1
  144. package/es/common/render-curve.js +1 -1
  145. package/es/common/render-utils.js +1 -1
  146. package/es/common/seg-context.js +1 -1
  147. package/es/container.d.ts +2 -0
  148. package/es/container.js +2 -0
  149. package/es/container.js.map +1 -0
  150. package/es/core/application.js +1 -1
  151. package/es/core/camera.js +1 -1
  152. package/es/core/constants.js +1 -1
  153. package/es/core/core-modules.js +1 -1
  154. package/es/core/global-module.js +2 -0
  155. package/es/core/global.js +1 -1
  156. package/es/core/graphic-utils.js +1 -1
  157. package/es/core/index.js +1 -1
  158. package/es/core/layer-service.js +2 -1
  159. package/es/core/layer.js +1 -1
  160. package/es/core/light.js +1 -1
  161. package/es/core/stage.d.ts +0 -9
  162. package/es/core/stage.js +10 -31
  163. package/es/core/stage.js.map +1 -1
  164. package/es/core/window.js +1 -1
  165. package/es/entries/miniapp.d.ts +0 -1
  166. package/es/entries/miniapp.js +1 -5
  167. package/es/entries/miniapp.js.map +1 -1
  168. package/es/entries/node.d.ts +0 -1
  169. package/es/entries/node.js +1 -5
  170. package/es/entries/node.js.map +1 -1
  171. package/es/env.d.ts +1 -0
  172. package/es/env.js +2 -0
  173. package/es/env.js.map +1 -0
  174. package/es/event/public-constant.d.ts +7 -0
  175. package/es/event/public-constant.js +12 -0
  176. package/es/event/public-constant.js.map +1 -0
  177. package/es/event/util.d.ts +1 -1
  178. package/es/graphic/base.d.ts +2 -0
  179. package/es/graphic/base.js +2 -0
  180. package/es/graphic/base.js.map +1 -0
  181. package/es/graphic/creator.d.ts +16 -0
  182. package/es/graphic/creator.js +32 -0
  183. package/es/graphic/creator.js.map +1 -0
  184. package/es/graphic/glyph.js +4 -8
  185. package/es/graphic/glyph.js.map +1 -1
  186. package/es/graphic/graphic.d.ts +19 -29
  187. package/es/graphic/graphic.js +120 -204
  188. package/es/graphic/graphic.js.map +1 -1
  189. package/es/graphic/group.d.ts +1 -3
  190. package/es/graphic/group.js +22 -28
  191. package/es/graphic/group.js.map +1 -1
  192. package/es/graphic/modules.d.ts +16 -0
  193. package/es/graphic/modules.js +32 -0
  194. package/es/graphic/modules.js.map +1 -0
  195. package/es/graphic/node-tree.d.ts +3 -3
  196. package/es/graphic/node-tree.js +1 -0
  197. package/es/graphic/node-tree.js.map +1 -1
  198. package/es/graphic/state/shared-state-refresh.js +8 -28
  199. package/es/graphic/state/shared-state-refresh.js.map +1 -1
  200. package/es/graphic/state/shared-state-scope.d.ts +2 -5
  201. package/es/graphic/state/shared-state-scope.js +7 -28
  202. package/es/graphic/state/shared-state-scope.js.map +1 -1
  203. package/es/graphic/state/state-definition-compiler.js +4 -5
  204. package/es/graphic/state/state-definition-compiler.js.map +1 -1
  205. package/es/graphic/state/state-definition.d.ts +2 -5
  206. package/es/graphic/state/state-definition.js.map +1 -1
  207. package/es/graphic/state/state-engine.d.ts +0 -5
  208. package/es/graphic/state/state-engine.js +17 -67
  209. package/es/graphic/state/state-engine.js.map +1 -1
  210. package/es/graphic/state/state-transition-orchestrator.d.ts +7 -9
  211. package/es/graphic/state/state-transition-orchestrator.js +10 -13
  212. package/es/graphic/state/state-transition-orchestrator.js.map +1 -1
  213. package/es/interface/graphic/group.d.ts +0 -2
  214. package/es/interface/graphic/group.js.map +1 -1
  215. package/es/interface/graphic.d.ts +1 -5
  216. package/es/interface/graphic.js.map +1 -1
  217. package/es/interface/index.js.map +1 -1
  218. package/es/interface/node-tree.d.ts +3 -0
  219. package/es/interface/node-tree.js.map +1 -1
  220. package/es/interface/stage.d.ts +0 -7
  221. package/es/interface/stage.js.map +1 -1
  222. package/es/interpolate.d.ts +2 -0
  223. package/es/interpolate.js +4 -0
  224. package/es/interpolate.js.map +1 -0
  225. package/es/modules.js.map +1 -1
  226. package/es/path.d.ts +4 -0
  227. package/es/path.js +6 -0
  228. package/es/path.js.map +1 -0
  229. package/es/plugin/3d.d.ts +3 -0
  230. package/es/plugin/3d.js +6 -0
  231. package/es/plugin/3d.js.map +1 -0
  232. package/es/plugin/attribute.d.ts +2 -0
  233. package/es/plugin/attribute.js +4 -0
  234. package/es/plugin/attribute.js.map +1 -0
  235. package/es/plugin/flex-layout.d.ts +1 -0
  236. package/es/plugin/flex-layout.js +2 -0
  237. package/es/plugin/flex-layout.js.map +1 -0
  238. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +8 -8
  239. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  240. package/es/plugins/index.d.ts +0 -4
  241. package/es/plugins/index.js +0 -8
  242. package/es/plugins/index.js.map +1 -1
  243. package/es/plugins/plugin-service.d.ts +0 -1
  244. package/es/plugins/plugin-service.js +2 -3
  245. package/es/plugins/plugin-service.js.map +1 -1
  246. package/es/plugins/types.d.ts +1 -8
  247. package/es/plugins/types.js.map +1 -1
  248. package/es/register/graphic.d.ts +19 -0
  249. package/es/register/graphic.js +38 -0
  250. package/es/register/graphic.js.map +1 -0
  251. package/es/registry/contribution-registry.d.ts +0 -1
  252. package/es/registry/contribution-registry.js +0 -3
  253. package/es/registry/contribution-registry.js.map +1 -1
  254. package/es/registry/picker-registry.d.ts +0 -1
  255. package/es/registry/picker-registry.js +0 -3
  256. package/es/registry/picker-registry.js.map +1 -1
  257. package/es/registry/renderer-registry.d.ts +0 -1
  258. package/es/registry/renderer-registry.js +0 -3
  259. package/es/registry/renderer-registry.js.map +1 -1
  260. package/es/registry/types.d.ts +0 -3
  261. package/es/registry/types.js.map +1 -1
  262. package/es/svg.d.ts +1 -0
  263. package/es/svg.js +2 -0
  264. package/es/svg.js.map +1 -0
  265. package/es/text.d.ts +2 -0
  266. package/es/text.js +4 -0
  267. package/es/text.js.map +1 -0
  268. package/package.json +247 -3
  269. package/cjs/graphic/state/state-batch-scheduler.d.ts +0 -42
  270. package/cjs/graphic/state/state-batch-scheduler.js +0 -285
  271. package/cjs/graphic/state/state-batch-scheduler.js.map +0 -1
  272. package/cjs/graphic/state/state-model.d.ts +0 -43
  273. package/cjs/graphic/state/state-model.js +0 -143
  274. package/cjs/graphic/state/state-model.js.map +0 -1
  275. package/cjs/graphic/state/state-perf-monitor.d.ts +0 -120
  276. package/cjs/graphic/state/state-perf-monitor.js +0 -224
  277. package/cjs/graphic/state/state-perf-monitor.js.map +0 -1
  278. package/cjs/graphic/state/state-style-resolver.d.ts +0 -13
  279. package/cjs/graphic/state/state-style-resolver.js +0 -50
  280. package/cjs/graphic/state/state-style-resolver.js.map +0 -1
  281. package/cjs/interface/animate.d.ts +0 -1
  282. package/cjs/interface/animate.js +0 -3
  283. package/cjs/interface/animate.js.map +0 -1
  284. package/cjs/plugins/base-plugin.d.ts +0 -8
  285. package/cjs/plugins/base-plugin.js +0 -15
  286. package/cjs/plugins/base-plugin.js.map +0 -1
  287. package/cjs/plugins/browser-env-plugin.d.ts +0 -8
  288. package/cjs/plugins/browser-env-plugin.js +0 -24
  289. package/cjs/plugins/browser-env-plugin.js.map +0 -1
  290. package/cjs/plugins/picker-plugin.d.ts +0 -7
  291. package/cjs/plugins/picker-plugin.js +0 -19
  292. package/cjs/plugins/picker-plugin.js.map +0 -1
  293. package/cjs/plugins/renderer-plugin.d.ts +0 -7
  294. package/cjs/plugins/renderer-plugin.js +0 -19
  295. package/cjs/plugins/renderer-plugin.js.map +0 -1
  296. package/es/graphic/state/state-batch-scheduler.d.ts +0 -42
  297. package/es/graphic/state/state-batch-scheduler.js +0 -278
  298. package/es/graphic/state/state-batch-scheduler.js.map +0 -1
  299. package/es/graphic/state/state-model.d.ts +0 -43
  300. package/es/graphic/state/state-model.js +0 -135
  301. package/es/graphic/state/state-model.js.map +0 -1
  302. package/es/graphic/state/state-perf-monitor.d.ts +0 -120
  303. package/es/graphic/state/state-perf-monitor.js +0 -214
  304. package/es/graphic/state/state-perf-monitor.js.map +0 -1
  305. package/es/graphic/state/state-style-resolver.d.ts +0 -13
  306. package/es/graphic/state/state-style-resolver.js +0 -42
  307. package/es/graphic/state/state-style-resolver.js.map +0 -1
  308. package/es/interface/animate.d.ts +0 -1
  309. package/es/interface/animate.js +0 -3
  310. package/es/interface/animate.js.map +0 -1
  311. package/es/plugins/base-plugin.d.ts +0 -8
  312. package/es/plugins/base-plugin.js +0 -7
  313. package/es/plugins/base-plugin.js.map +0 -1
  314. package/es/plugins/browser-env-plugin.d.ts +0 -8
  315. package/es/plugins/browser-env-plugin.js +0 -16
  316. package/es/plugins/browser-env-plugin.js.map +0 -1
  317. package/es/plugins/picker-plugin.d.ts +0 -7
  318. package/es/plugins/picker-plugin.js +0 -11
  319. package/es/plugins/picker-plugin.js.map +0 -1
  320. package/es/plugins/renderer-plugin.d.ts +0 -7
  321. package/es/plugins/renderer-plugin.js +0 -11
  322. package/es/plugins/renderer-plugin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA+CA,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,kDAAgC;AAChC,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,oDAAkC;AAClC,8CAA4B;AAC5B,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,iDAA+B;AAC/B,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB;AACzB,8CAA4B","file":"index.js","sourcesContent":["// export type MaybePromise<T> = T | PromiseLike<T>;\n\n// // 所有的接口都应当继承这个,避免内存没有释放\n// export interface Disposable {\n// dispose: (params?: any) => void;\n// }\n\n// export { INode } from './node-tree';\n// export { IGraphic, IGraphicAttribute, IFillStyle, IStrokeStyle, IStyle, ITransform } from './graphic';\n// export { IArc, IArcAttribute, IArcGraphicAttribute, IArcCache } from './graphic/arc';\n// export { IArea, IAreaAttribute, IAreaGraphicAttribute, IAreaCacheItem, IAreaSegment } from './graphic/area';\n// export { ICircle, ICircleAttribute, ICircleGraphicAttribute } from './graphic/circle';\n// export { IGroup, IGroupAttribute } from './graphic/group';\n// export { IImage, IImageAttribute, IImageGraphicAttribute, IRepeatType } from './graphic/image';\n// export { ILine, ILineAttribute, ILineGraphicAttribute, ISegment } from './graphic/line';\n// export { IPath, IPathAttribute, IPathGraphicAttribute } from './graphic/path';\n// export { IRect, IRectAttribute, IRectGraphicAttribute } from './graphic/rect';\n// export {\n// IRichText,\n// IRichTextAttribute,\n// RichTextCharacter,\n// RichTextFontStyle,\n// RichTextGlobalAlignType,\n// RichTextGlobalBaselineType,\n// RichTextScript,\n// RichTextTextAlign,\n// RichTextTextDecoration,\n// RichTextVerticalDirection,\n// RichTextWordBreak,\n// IRichTextGraphicAttribute\n// } from './graphic/richText';\n// export { ISymbol, ISymbolAttribute, ISymbolGraphicAttribute, SymbolType } from './graphic/symbol';\n// export { IText, ITextAttribute, ITextGraphicAttribute, ITextCache } from './graphic/text';\n// export { ILayer, ILayerDrawParams } from './layer';\n// export { IStage, IStageParams, IExportType } from './stage';\n\n// // export * from './graphic';\n// export { ICanvas, ICanvasLike } from './canvas';\n// export { IContext2d, IContextLike, ICommonStyleParams, IStrokeStyleParams, ITextStyleParams } from './context';\n\n// export { IPath2D, ICustomPath2D, CommandType, ICurvePath, ICurve } from './path';\n\n// export { IColor, IColorStop, IConicalGradient, ILinearGradient, IRadialGradient } from './color';\n\n// export { ICurveType } from './common';\n// // export { IAreaCacheItem } from './graphic';\n\nexport * from './global';\nexport * from './common';\nexport * from './node-tree';\nexport * from './graphic';\nexport * from './graphic/index';\nexport * from './layer';\nexport * from './stage';\nexport * from './canvas';\nexport * from './context';\nexport * from './path';\nexport * from './color';\nexport * from './common';\nexport * from './camera';\nexport * from './matrix';\nexport * from './light';\nexport * from './curve';\nexport * from './graphic-service';\nexport * from './sync-hook';\nexport * from './allocator';\nexport * from './core';\nexport * from './event';\nexport * from './loader';\nexport * from './contribution';\nexport * from './render';\nexport * from './plugin';\nexport * from './picker';\nexport * from './text';\nexport * from './window';\nexport * from './animation';\n"]}
1
+ {"version":3,"sources":["../src/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,kDAAgC;AAChC,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,oDAAkC;AAClC,8CAA4B;AAC5B,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,iDAA+B;AAC/B,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB;AACzB,8CAA4B","file":"index.js","sourcesContent":["export * from './global';\nexport * from './common';\nexport * from './node-tree';\nexport * from './graphic';\nexport * from './graphic/index';\nexport * from './layer';\nexport * from './stage';\nexport * from './canvas';\nexport * from './context';\nexport * from './path';\nexport * from './color';\nexport * from './common';\nexport * from './camera';\nexport * from './matrix';\nexport * from './light';\nexport * from './curve';\nexport * from './graphic-service';\nexport * from './sync-hook';\nexport * from './allocator';\nexport * from './core';\nexport * from './event';\nexport * from './loader';\nexport * from './contribution';\nexport * from './render';\nexport * from './plugin';\nexport * from './picker';\nexport * from './text';\nexport * from './window';\nexport * from './animation';\n"]}
@@ -1,4 +1,6 @@
1
1
  import type { IEventElement, Releaseable } from './common';
2
+ import type { ILayer } from './layer';
3
+ import type { IStage } from './stage';
2
4
  export interface INode extends Releaseable, IEventElement {
3
5
  _prev?: INode;
4
6
  _next?: INode;
@@ -22,6 +24,7 @@ export interface INode extends Releaseable, IEventElement {
22
24
  forEachChildrenAsync: (cb: (n: INode, i: number) => Promise<void | boolean> | void | boolean, reverse?: boolean) => Promise<void>;
23
25
  appendChild: (node: INode, highPerformance?: boolean) => INode | null;
24
26
  add: (node: INode, highPerformance?: boolean) => INode | null;
27
+ onParentSharedStateTreeChanged: (stage?: IStage, layer?: ILayer) => void;
25
28
  delete: () => void;
26
29
  removeChild: (node: INode, highPerformance?: boolean) => INode | null;
27
30
  removeAllChild: (deep?: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/node-tree.ts"],"names":[],"mappings":"","file":"node-tree.js","sourcesContent":["import type { IEventElement, Releaseable } from './common';\n\nexport interface INode extends Releaseable, IEventElement {\n _prev?: INode;\n _next?: INode;\n /**\n * 内部图形的唯一标识\n */\n _uid: number;\n\n /**\n * 用户配置的图形唯一标识\n */\n id?: number | string;\n /** 图形名称标识 */\n name?: string;\n /**\n * 图形类型\n */\n type?: string;\n parent: INode | null;\n // dirty: boolean; // 脏位,标记当前节点和子节点是否有修改\n count: number;\n childrenCount: number;\n firstChild: INode | null;\n lastChild: INode | null;\n /**\n * 获取子节点数组\n */\n getChildren: () => INode[];\n /**\n * 获取某个idx的节点\n */\n getChildAt: (idx: number) => INode | null;\n at: (idx: number) => INode | null;\n\n insertBefore: (newNode: INode, referenceNode: INode) => INode | null;\n insertAfter: (newNode: INode, referenceNode: INode) => INode | null;\n\n /**\n * 向某个位置插入\n */\n insertInto: (ele: INode, idx: number) => INode | null;\n\n insertIntoKeepIdx: (ele: INode, idx: number) => INode | null;\n /**\n * 遍历子节点\n * @param cb 返回true则停止遍历\n */\n forEachChildren: (cb: (n: INode, i: number) => void | boolean, reverse?: boolean) => void;\n forEachChildrenAsync: (\n cb: (n: INode, i: number) => Promise<void | boolean> | void | boolean,\n reverse?: boolean\n ) => Promise<void>;\n /**\n * 添加子节点\n * @param node\n * @param highPerformance 是否高性能模式(不检查是否合法)\n */\n appendChild: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * 添加子节点\n * @param node\n * @param highPerformance 是否高性能模式(不检查是否合法)\n */\n add: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * 从当前节点的父节点删除当前节点\n */\n delete: () => void;\n /**\n * 删除节点\n * @param node\n * @param highPerformance 是否高性能模式;仅用于释放/批量清理,跳过更新和通知链路\n */\n removeChild: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * 移除所有节点\n */\n removeAllChild: (deep?: boolean) => void;\n /**\n * 判断该节点是否是node的子节点\n * @param node\n */\n isChildOf: (node: INode) => boolean;\n /**\n * 判断该节点是否是node的父节点\n * @param node\n */\n isParentOf: (node: INode) => boolean;\n /**\n * 判断节点是否是node的后代节点\n * @param node\n */\n isDescendantsOf: (node: INode) => boolean;\n /**\n * 判断节点是否是node的祖先节点\n * @param node\n */\n isAncestorsOf: (node: INode) => boolean;\n\n // 事件相关的别名\n /**\n * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\n * */\n dispatchEvent: (event: Event) => boolean;\n\n /**\n * 返回的是一个布尔值,来表示传入的节点是否为该节点的后代节点。\n * @param node 判断是否包含的节点\n */\n containNode: (node: INode) => boolean;\n\n /**\n * 设置该节点的所有后代节点某个属性\n * @param propsName 属性名\n * @param propsValue 属性值\n */\n setAllDescendantsProps: (propsName: string, propsValue: any) => any;\n\n // 查找相关的接口\n /**\n * 根据自定义逻辑查找元素,返回单一图形元素\n * @param callback 自定义查找过滤器\n * @param deep 是否进行深度查找,默认为 false\n * @returns 返回匹配的图形元素\n */\n find: (callback: (node: INode, index: number) => boolean, deep: boolean) => INode | null;\n /**\n * 根据自定义逻辑查找元素,返回匹配的元素集合\n * @param callback 自定义查找过滤器\n * @param deep 是否进行深度查找,默认为 false\n * @returns 返回匹配的图形元素集合\n */\n findAll: (callback: (node: INode, index: number) => boolean, deep: boolean) => INode[];\n /**\n * 通过用户设置的 id 查找对应的图形元素\n * @param id 子节点的 id\n */\n getElementById: (id: string | number) => INode | null;\n /**\n * @alias getElementById\n * 通过用户设置的 id 查找对应的图形元素\n * @param id 子节点的 id\n */\n findChildById: (id: string | number) => INode | null;\n /**\n * 通过内部生成的节点 id:_uid 查找对应的图形元素\n * @param id 子节点的key\n */\n findChildByUid: (uid: number) => INode | null;\n /**\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n getElementsByName: (name: string) => INode[];\n /**\n * @alias getElementsByName\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n findChildrenByName: (name: string) => INode[];\n /**\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n getElementsByType: (type: string) => INode[];\n // 其他不常用\n\n [key: string]: any;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/node-tree.ts"],"names":[],"mappings":"","file":"node-tree.js","sourcesContent":["import type { IEventElement, Releaseable } from './common';\nimport type { ILayer } from './layer';\nimport type { IStage } from './stage';\n\nexport interface INode extends Releaseable, IEventElement {\n _prev?: INode;\n _next?: INode;\n /**\n * 内部图形的唯一标识\n */\n _uid: number;\n\n /**\n * 用户配置的图形唯一标识\n */\n id?: number | string;\n /** 图形名称标识 */\n name?: string;\n /**\n * 图形类型\n */\n type?: string;\n parent: INode | null;\n // dirty: boolean; // 脏位,标记当前节点和子节点是否有修改\n count: number;\n childrenCount: number;\n firstChild: INode | null;\n lastChild: INode | null;\n /**\n * 获取子节点数组\n */\n getChildren: () => INode[];\n /**\n * 获取某个idx的节点\n */\n getChildAt: (idx: number) => INode | null;\n at: (idx: number) => INode | null;\n\n insertBefore: (newNode: INode, referenceNode: INode) => INode | null;\n insertAfter: (newNode: INode, referenceNode: INode) => INode | null;\n\n /**\n * 向某个位置插入\n */\n insertInto: (ele: INode, idx: number) => INode | null;\n\n insertIntoKeepIdx: (ele: INode, idx: number) => INode | null;\n /**\n * 遍历子节点\n * @param cb 返回true则停止遍历\n */\n forEachChildren: (cb: (n: INode, i: number) => void | boolean, reverse?: boolean) => void;\n forEachChildrenAsync: (\n cb: (n: INode, i: number) => Promise<void | boolean> | void | boolean,\n reverse?: boolean\n ) => Promise<void>;\n /**\n * 添加子节点\n * @param node\n * @param highPerformance 是否高性能模式(不检查是否合法)\n */\n appendChild: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * 添加子节点\n * @param node\n * @param highPerformance 是否高性能模式(不检查是否合法)\n */\n add: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * Rebinds stage/layer derived state when this node is attached to a different parent tree.\n */\n onParentSharedStateTreeChanged: (stage?: IStage, layer?: ILayer) => void;\n /**\n * 从当前节点的父节点删除当前节点\n */\n delete: () => void;\n /**\n * 删除节点\n * @param node\n * @param highPerformance 是否高性能模式;仅用于释放/批量清理,跳过更新和通知链路\n */\n removeChild: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * 移除所有节点\n */\n removeAllChild: (deep?: boolean) => void;\n /**\n * 判断该节点是否是node的子节点\n * @param node\n */\n isChildOf: (node: INode) => boolean;\n /**\n * 判断该节点是否是node的父节点\n * @param node\n */\n isParentOf: (node: INode) => boolean;\n /**\n * 判断节点是否是node的后代节点\n * @param node\n */\n isDescendantsOf: (node: INode) => boolean;\n /**\n * 判断节点是否是node的祖先节点\n * @param node\n */\n isAncestorsOf: (node: INode) => boolean;\n\n // 事件相关的别名\n /**\n * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\n * */\n dispatchEvent: (event: Event) => boolean;\n\n /**\n * 返回的是一个布尔值,来表示传入的节点是否为该节点的后代节点。\n * @param node 判断是否包含的节点\n */\n containNode: (node: INode) => boolean;\n\n /**\n * 设置该节点的所有后代节点某个属性\n * @param propsName 属性名\n * @param propsValue 属性值\n */\n setAllDescendantsProps: (propsName: string, propsValue: any) => any;\n\n // 查找相关的接口\n /**\n * 根据自定义逻辑查找元素,返回单一图形元素\n * @param callback 自定义查找过滤器\n * @param deep 是否进行深度查找,默认为 false\n * @returns 返回匹配的图形元素\n */\n find: (callback: (node: INode, index: number) => boolean, deep: boolean) => INode | null;\n /**\n * 根据自定义逻辑查找元素,返回匹配的元素集合\n * @param callback 自定义查找过滤器\n * @param deep 是否进行深度查找,默认为 false\n * @returns 返回匹配的图形元素集合\n */\n findAll: (callback: (node: INode, index: number) => boolean, deep: boolean) => INode[];\n /**\n * 通过用户设置的 id 查找对应的图形元素\n * @param id 子节点的 id\n */\n getElementById: (id: string | number) => INode | null;\n /**\n * @alias getElementById\n * 通过用户设置的 id 查找对应的图形元素\n * @param id 子节点的 id\n */\n findChildById: (id: string | number) => INode | null;\n /**\n * 通过内部生成的节点 id:_uid 查找对应的图形元素\n * @param id 子节点的key\n */\n findChildByUid: (uid: number) => INode | null;\n /**\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n getElementsByName: (name: string) => INode[];\n /**\n * @alias getElementsByName\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n findChildrenByName: (name: string) => INode[];\n /**\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n getElementsByType: (type: string) => INode[];\n // 其他不常用\n\n [key: string]: any;\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import type { INode } from './node-tree';
2
2
  import type { ILayer, LayerMode } from './layer';
3
3
  import type { IColor } from './color';
4
- import type { IGraphic } from './graphic';
5
4
  import type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';
6
5
  import type { ICamera } from './camera';
7
6
  import type { vec3 } from './matrix';
@@ -16,7 +15,6 @@ import type { ILayerService } from './core';
16
15
  import type { IFullThemeSpec } from './graphic/theme';
17
16
  import type { IGraphicService } from './graphic-service';
18
17
  import type { SharedStateScope } from '../graphic/state/shared-state-scope';
19
- import type { IDeferredStateOwnerConfig, IStatePerfConfig, IStatePerfSnapshot } from '../graphic/state/state-perf-monitor';
20
18
  export type IExportType = 'canvas' | 'imageData';
21
19
  export type IStageCreateContext = {
22
20
  appName?: 'vchart' | 'vgrammar' | 'vtable' | string;
@@ -101,8 +99,6 @@ export interface IStage extends INode {
101
99
  dirtyBounds: IBounds | null;
102
100
  autoRender: boolean;
103
101
  renderCount: number;
104
- statePerfConfig?: IStatePerfConfig;
105
- deferredStateConfig?: IDeferredStateOwnerConfig;
106
102
  hooks: {
107
103
  beforeRender: ISyncHook<[IStage]>;
108
104
  afterRender: ISyncHook<[IStage]>;
@@ -131,9 +127,6 @@ export interface IStage extends INode {
131
127
  getTimeline: () => ITimeline;
132
128
  render: (layers?: ILayer[], params?: Partial<IDrawContext>) => void;
133
129
  renderNextFrame: (layers?: ILayer[], force?: boolean) => void;
134
- scheduleStateBatch: (graphics: IGraphic[], targetStates: string[]) => void;
135
- getStatePerfSnapshot: () => IStatePerfSnapshot;
136
- resetStatePerfSnapshot: () => void;
137
130
  tryInitInteractiveLayer: () => void;
138
131
  resize: (w: number, h: number, rerender?: boolean) => void;
139
132
  resizeWindow: (w: number, h: number, rerender?: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/stage.ts"],"names":[],"mappings":"","file":"stage.js","sourcesContent":["import type { INode } from './node-tree';\nimport type { ILayer, LayerMode } from './layer';\nimport type { IColor } from './color';\nimport type { IGraphic } from './graphic';\nimport type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport type { ICamera } from './camera';\nimport type { vec3 } from './matrix';\nimport type { IDirectionLight } from './light';\nimport type { ISyncHook } from './sync-hook';\nimport type { IDrawContext, IRenderService, IRenderServiceDrawParams } from './render';\nimport type { ITicker, ITimeline } from './animation';\nimport type { IPickerService, PickResult } from './picker';\nimport type { IPlugin, IPluginService } from './plugin';\nimport type { IWindow } from './window';\nimport type { ILayerService } from './core';\nimport type { IFullThemeSpec } from './graphic/theme';\nimport type { IGraphicService } from './graphic-service';\nimport type { SharedStateScope } from '../graphic/state/shared-state-scope';\nimport type {\n IDeferredStateOwnerConfig,\n IStatePerfConfig,\n IStatePerfSnapshot\n} from '../graphic/state/state-perf-monitor';\n\nexport type IExportType = 'canvas' | 'imageData';\n\nexport type IStageCreateContext = {\n appName?: 'vchart' | 'vgrammar' | 'vtable' | string;\n};\nexport interface IStageParams {\n // x: number;\n // y: number;\n // // 视口的宽高\n // viewWidth: number;\n // viewHeight: number;\n\n // 视口的宽高\n viewBox: IBoundsLike;\n // 总的宽高\n width: number;\n height: number;\n dpr: number;\n // stage的背景\n background: string | IColor;\n // 外部的canvas\n canvas: string | HTMLCanvasElement;\n // canvas的container容器,如果不传入canvas,那就会在容器中创建canvas\n container: string | HTMLElement;\n // 是否是受控制的canvas,如果不是的话,不会进行resize等操作,也不会修改canvas的样式\n canvasControled: boolean;\n title: string;\n // 是否开启自动渲染\n autoRender: boolean;\n // 是否开启自动刷新\n autoRefresh: boolean;\n // 是否开启布局支持\n enableLayout: boolean;\n // 是否关闭脏矩形检测\n disableDirtyBounds: boolean;\n // 是否支持interactiveLayer,默认为true\n interactiveLayer: boolean;\n // 是否支持HTML属性\n enableHtmlAttribute: string | boolean | HTMLElement;\n // 是否支持react-dom(传入ReactDOM)\n ReactDOM: any;\n // 是否支持滚动条\n enableScroll: boolean;\n poptip: boolean;\n // 绘制之前的钩子函数\n beforeRender: (stage: IStage) => void;\n // 绘制之后的钩子函数\n afterRender: (stage: IStage) => void;\n // 清屏之后的钩子函数\n afterClearScreen: (drawParams: any) => void;\n // 清除矩形区域之后的钩子函数\n afterClearRect: (drawParams: any) => void;\n\n renderStyle?: string;\n ticker?: ITicker;\n pluginList?: string[];\n // 优化配置\n optimize?: IOptimizeType;\n /**\n * 事件系统相关配置\n */\n event?: EventConfig;\n\n /**\n * @since 0.17.15\n * 是否支持touch事件,不支持就不监听touch事件\n */\n supportsTouchEvents?: boolean;\n\n /**\n * @since 0.17.15\n * 是否支持pointer事件,不支持就监听mouse事件\n */\n supportsPointerEvents?: boolean;\n\n context?: IStageCreateContext;\n\n // 被分配的rafId,用于renderNextFrame,避免使用大量原生的RAF\n rafId?: number;\n}\n\nexport type EventConfig = {\n /** 是否自动阻止事件 */\n autoPreventDefault?: boolean;\n /**\n * 多次点击之间的最大时间,默认为 200 ms\n * @default 200\n */\n clickInterval?: number;\n [key: string]: any;\n};\n\nexport type IOptimizeType = {\n // 视口不在可视区,跳过渲染,默认为true\n skipRenderWithOutRange?: boolean;\n // 跳过图元在区间外的判断\n // 不存在dirtyBounds的时候,根据该配置判断是否关闭图元的超出边界判定\n // 如果有dirtyBounds那么该配置不生效\n disableCheckGraphicWidthOutRange?: boolean;\n // tick渲染模式,effect会在tick之后立刻执行render,保证动画效果正常。performance模式中tick和render均是RAF,属性可能会被篡改\n // 是否开启高性能动画,默认开启\n // 开启后不会执行某些安全校验,比如跳帧处理\n // 开启后会自动降帧,最高60fps\n tickRenderMode?: 'effect' | 'performance';\n};\n\nexport interface IOption3D {\n enableView3dTransform?: boolean; // 是否开启view3d自动旋转\n alpha?: number; // x轴的转角\n beta?: number; // y轴的转角\n gama?: number; // z轴的转角\n center?: { x?: number; y?: number; z?: number; dx?: number; dy?: number; dz?: number }; // 中心位置\n fieldRatio?: number; // 透视的视域缩放比例\n fieldDepth?: number;\n light?: {\n dir?: vec3;\n color?: string;\n ambient?: number;\n };\n // 配置相机后,alpha、beta、gamma配置会失效\n camera?: any; // 相机配置\n}\n\n// TODO 命名方式\nexport interface IStage extends INode {\n stage?: IStage;\n parent: IStage | null;\n // rootNode: IStage;\n x: number;\n y: number;\n\n params: Partial<IStageParams>;\n\n window: IWindow;\n\n width: number;\n height: number;\n viewWidth: number;\n viewHeight: number;\n defaultLayer: ILayer;\n dirtyBounds: IBounds | null;\n\n autoRender: boolean;\n renderCount: number;\n statePerfConfig?: IStatePerfConfig;\n deferredStateConfig?: IDeferredStateOwnerConfig;\n\n hooks: {\n beforeRender: ISyncHook<[IStage]>;\n afterRender: ISyncHook<[IStage]>;\n afterClearScreen: ISyncHook<[IRenderServiceDrawParams]>;\n afterClearRect: ISyncHook<[IRenderServiceDrawParams]>;\n };\n\n option3d?: IOption3D;\n\n set3dOptions: (options: IOption3D) => void;\n light?: IDirectionLight;\n camera?: ICamera;\n\n dpr: number;\n\n viewBox: IBoundsLike;\n background: string | IColor;\n ticker: ITicker;\n increaseAutoRender: boolean;\n readonly renderService: IRenderService;\n readonly graphicService: IGraphicService;\n getPickerService: () => IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n rootSharedStateScope?: SharedStateScope<Record<string, any>>;\n // 如果传入CanvasId,如果存在相同Id,说明这两个图层使用相同的Canvas绘制\n // 但需要注意的是依然是两个图层(用于解决Table嵌入ChartSpace不影响Table的绘制)\n createLayer: (canvasId?: string, layerMode?: LayerMode) => ILayer;\n getLayer: (name: string) => ILayer;\n sortLayer: (cb: (layer1: ILayer, layer2: ILayer) => number) => void;\n removeLayer: (layerId: number) => ILayer | false;\n\n getTimeline: () => ITimeline;\n\n render: (layers?: ILayer[], params?: Partial<IDrawContext>) => void;\n /**\n * 下一帧渲染\n * @param layers 渲染的图层\n * @param force 是否强行下一帧渲染,不采取优化方案\n * @returns\n */\n renderNextFrame: (layers?: ILayer[], force?: boolean) => void;\n scheduleStateBatch: (graphics: IGraphic[], targetStates: string[]) => void;\n getStatePerfSnapshot: () => IStatePerfSnapshot;\n resetStatePerfSnapshot: () => void;\n tryInitInteractiveLayer: () => void;\n\n // 画布操作\n resize: (w: number, h: number, rerender?: boolean) => void;\n resizeWindow: (w: number, h: number, rerender?: boolean) => void;\n resizeView: (w: number, h: number, rerender?: boolean) => void;\n setViewBox:\n | ((viewBox: IBoundsLike, rerender: boolean) => void)\n | ((x: number, y: number, w: number, h: number, rerender: boolean) => void)\n | ((x: number | IBoundsLike, y: number | boolean, w?: number, h?: number, rerender?: boolean) => void);\n setDpr: (dpr: number, rerender?: boolean) => void;\n setOrigin: (x: number, y: number) => void;\n export: (type: IExportType) => HTMLCanvasElement | ImageData;\n pick: (x: number, y: number) => PickResult | false;\n\n // 动画相关\n startAnimate: (t: number) => void;\n setToFrame: (t: number) => void;\n dirty: (b: IBounds, matrix?: IMatrix) => void;\n // 考虑操作回放\n\n renderTo: (window: IWindow, params: { x: number; y: number; width: number; height: number }) => void;\n\n renderToNewWindow: (fullImage?: boolean) => IWindow;\n\n toCanvas: (fullImage?: boolean, viewBox?: IAABBBounds) => HTMLCanvasElement | null;\n\n setBeforeRender: (cb: (stage: IStage) => void) => void;\n removeBeforeRender: (cb: (stage: IStage) => void) => void;\n setAfterRender: (cb: (stage: IStage) => void) => void;\n removeAfterRender: (cb: (stage: IStage) => void) => void;\n afterNextRender: (cb: (stage: IStage) => void) => void;\n enableAutoRender: () => void;\n disableAutoRender: () => void;\n enableIncrementalAutoRender: () => void;\n disableIncrementalAutoRender: () => void;\n enableDirtyBounds: () => void;\n disableDirtyBounds: () => void;\n enableView3dTransform: () => void;\n disableView3dTranform: () => void;\n getPluginsByName: (name: string) => IPlugin[];\n clearViewBox: (color?: string) => void;\n release: () => void;\n setStage: (stage?: IStage) => void;\n\n pauseRender: (sk?: number) => void;\n resumeRender: () => void;\n\n setCursor: (mode?: string) => void;\n\n getTheme: () => IFullThemeSpec;\n eventPointTransform: (e: PointerEvent | WheelEvent | TouchEvent) => { x: number; y: number };\n pauseTriggerEvent: () => void;\n resumeTriggerEvent: () => void;\n\n pauseAnimation?: (deep?: boolean) => void;\n resumeAnimation?: (deep?: boolean) => void;\n stopAnimation?: (deep?: boolean) => void;\n reApplyAnimationState?: (state: string, deep?: boolean) => this;\n}\n\nexport declare function combineStage(srages: IStage[], params: { canvas: string | HTMLCanvasElement }): IStage;\n"]}
1
+ {"version":3,"sources":["../src/interface/stage.ts"],"names":[],"mappings":"","file":"stage.js","sourcesContent":["import type { INode } from './node-tree';\nimport type { ILayer, LayerMode } from './layer';\nimport type { IColor } from './color';\nimport type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport type { ICamera } from './camera';\nimport type { vec3 } from './matrix';\nimport type { IDirectionLight } from './light';\nimport type { ISyncHook } from './sync-hook';\nimport type { IDrawContext, IRenderService, IRenderServiceDrawParams } from './render';\nimport type { ITicker, ITimeline } from './animation';\nimport type { IPickerService, PickResult } from './picker';\nimport type { IPlugin, IPluginService } from './plugin';\nimport type { IWindow } from './window';\nimport type { ILayerService } from './core';\nimport type { IFullThemeSpec } from './graphic/theme';\nimport type { IGraphicService } from './graphic-service';\nimport type { SharedStateScope } from '../graphic/state/shared-state-scope';\n\nexport type IExportType = 'canvas' | 'imageData';\n\nexport type IStageCreateContext = {\n appName?: 'vchart' | 'vgrammar' | 'vtable' | string;\n};\nexport interface IStageParams {\n // x: number;\n // y: number;\n // // 视口的宽高\n // viewWidth: number;\n // viewHeight: number;\n\n // 视口的宽高\n viewBox: IBoundsLike;\n // 总的宽高\n width: number;\n height: number;\n dpr: number;\n // stage的背景\n background: string | IColor;\n // 外部的canvas\n canvas: string | HTMLCanvasElement;\n // canvas的container容器,如果不传入canvas,那就会在容器中创建canvas\n container: string | HTMLElement;\n // 是否是受控制的canvas,如果不是的话,不会进行resize等操作,也不会修改canvas的样式\n canvasControled: boolean;\n title: string;\n // 是否开启自动渲染\n autoRender: boolean;\n // 是否开启自动刷新\n autoRefresh: boolean;\n // 是否开启布局支持\n enableLayout: boolean;\n // 是否关闭脏矩形检测\n disableDirtyBounds: boolean;\n // 是否支持interactiveLayer,默认为true\n interactiveLayer: boolean;\n // 是否支持HTML属性\n enableHtmlAttribute: string | boolean | HTMLElement;\n // 是否支持react-dom(传入ReactDOM)\n ReactDOM: any;\n // 是否支持滚动条\n enableScroll: boolean;\n poptip: boolean;\n // 绘制之前的钩子函数\n beforeRender: (stage: IStage) => void;\n // 绘制之后的钩子函数\n afterRender: (stage: IStage) => void;\n // 清屏之后的钩子函数\n afterClearScreen: (drawParams: any) => void;\n // 清除矩形区域之后的钩子函数\n afterClearRect: (drawParams: any) => void;\n\n renderStyle?: string;\n ticker?: ITicker;\n pluginList?: string[];\n // 优化配置\n optimize?: IOptimizeType;\n /**\n * 事件系统相关配置\n */\n event?: EventConfig;\n\n /**\n * @since 0.17.15\n * 是否支持touch事件,不支持就不监听touch事件\n */\n supportsTouchEvents?: boolean;\n\n /**\n * @since 0.17.15\n * 是否支持pointer事件,不支持就监听mouse事件\n */\n supportsPointerEvents?: boolean;\n\n context?: IStageCreateContext;\n\n // 被分配的rafId,用于renderNextFrame,避免使用大量原生的RAF\n rafId?: number;\n}\n\nexport type EventConfig = {\n /** 是否自动阻止事件 */\n autoPreventDefault?: boolean;\n /**\n * 多次点击之间的最大时间,默认为 200 ms\n * @default 200\n */\n clickInterval?: number;\n [key: string]: any;\n};\n\nexport type IOptimizeType = {\n // 视口不在可视区,跳过渲染,默认为true\n skipRenderWithOutRange?: boolean;\n // 跳过图元在区间外的判断\n // 不存在dirtyBounds的时候,根据该配置判断是否关闭图元的超出边界判定\n // 如果有dirtyBounds那么该配置不生效\n disableCheckGraphicWidthOutRange?: boolean;\n // tick渲染模式,effect会在tick之后立刻执行render,保证动画效果正常。performance模式中tick和render均是RAF,属性可能会被篡改\n // 是否开启高性能动画,默认开启\n // 开启后不会执行某些安全校验,比如跳帧处理\n // 开启后会自动降帧,最高60fps\n tickRenderMode?: 'effect' | 'performance';\n};\n\nexport interface IOption3D {\n enableView3dTransform?: boolean; // 是否开启view3d自动旋转\n alpha?: number; // x轴的转角\n beta?: number; // y轴的转角\n gama?: number; // z轴的转角\n center?: { x?: number; y?: number; z?: number; dx?: number; dy?: number; dz?: number }; // 中心位置\n fieldRatio?: number; // 透视的视域缩放比例\n fieldDepth?: number;\n light?: {\n dir?: vec3;\n color?: string;\n ambient?: number;\n };\n // 配置相机后,alpha、beta、gamma配置会失效\n camera?: any; // 相机配置\n}\n\n// TODO 命名方式\nexport interface IStage extends INode {\n stage?: IStage;\n parent: IStage | null;\n // rootNode: IStage;\n x: number;\n y: number;\n\n params: Partial<IStageParams>;\n\n window: IWindow;\n\n width: number;\n height: number;\n viewWidth: number;\n viewHeight: number;\n defaultLayer: ILayer;\n dirtyBounds: IBounds | null;\n\n autoRender: boolean;\n renderCount: number;\n\n hooks: {\n beforeRender: ISyncHook<[IStage]>;\n afterRender: ISyncHook<[IStage]>;\n afterClearScreen: ISyncHook<[IRenderServiceDrawParams]>;\n afterClearRect: ISyncHook<[IRenderServiceDrawParams]>;\n };\n\n option3d?: IOption3D;\n\n set3dOptions: (options: IOption3D) => void;\n light?: IDirectionLight;\n camera?: ICamera;\n\n dpr: number;\n\n viewBox: IBoundsLike;\n background: string | IColor;\n ticker: ITicker;\n increaseAutoRender: boolean;\n readonly renderService: IRenderService;\n readonly graphicService: IGraphicService;\n getPickerService: () => IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n rootSharedStateScope?: SharedStateScope<Record<string, any>>;\n // 如果传入CanvasId,如果存在相同Id,说明这两个图层使用相同的Canvas绘制\n // 但需要注意的是依然是两个图层(用于解决Table嵌入ChartSpace不影响Table的绘制)\n createLayer: (canvasId?: string, layerMode?: LayerMode) => ILayer;\n getLayer: (name: string) => ILayer;\n sortLayer: (cb: (layer1: ILayer, layer2: ILayer) => number) => void;\n removeLayer: (layerId: number) => ILayer | false;\n\n getTimeline: () => ITimeline;\n\n render: (layers?: ILayer[], params?: Partial<IDrawContext>) => void;\n /**\n * 下一帧渲染\n * @param layers 渲染的图层\n * @param force 是否强行下一帧渲染,不采取优化方案\n * @returns\n */\n renderNextFrame: (layers?: ILayer[], force?: boolean) => void;\n tryInitInteractiveLayer: () => void;\n\n // 画布操作\n resize: (w: number, h: number, rerender?: boolean) => void;\n resizeWindow: (w: number, h: number, rerender?: boolean) => void;\n resizeView: (w: number, h: number, rerender?: boolean) => void;\n setViewBox:\n | ((viewBox: IBoundsLike, rerender: boolean) => void)\n | ((x: number, y: number, w: number, h: number, rerender: boolean) => void)\n | ((x: number | IBoundsLike, y: number | boolean, w?: number, h?: number, rerender?: boolean) => void);\n setDpr: (dpr: number, rerender?: boolean) => void;\n setOrigin: (x: number, y: number) => void;\n export: (type: IExportType) => HTMLCanvasElement | ImageData;\n pick: (x: number, y: number) => PickResult | false;\n\n // 动画相关\n startAnimate: (t: number) => void;\n setToFrame: (t: number) => void;\n dirty: (b: IBounds, matrix?: IMatrix) => void;\n // 考虑操作回放\n\n renderTo: (window: IWindow, params: { x: number; y: number; width: number; height: number }) => void;\n\n renderToNewWindow: (fullImage?: boolean) => IWindow;\n\n toCanvas: (fullImage?: boolean, viewBox?: IAABBBounds) => HTMLCanvasElement | null;\n\n setBeforeRender: (cb: (stage: IStage) => void) => void;\n removeBeforeRender: (cb: (stage: IStage) => void) => void;\n setAfterRender: (cb: (stage: IStage) => void) => void;\n removeAfterRender: (cb: (stage: IStage) => void) => void;\n afterNextRender: (cb: (stage: IStage) => void) => void;\n enableAutoRender: () => void;\n disableAutoRender: () => void;\n enableIncrementalAutoRender: () => void;\n disableIncrementalAutoRender: () => void;\n enableDirtyBounds: () => void;\n disableDirtyBounds: () => void;\n enableView3dTransform: () => void;\n disableView3dTranform: () => void;\n getPluginsByName: (name: string) => IPlugin[];\n clearViewBox: (color?: string) => void;\n release: () => void;\n setStage: (stage?: IStage) => void;\n\n pauseRender: (sk?: number) => void;\n resumeRender: () => void;\n\n setCursor: (mode?: string) => void;\n\n getTheme: () => IFullThemeSpec;\n eventPointTransform: (e: PointerEvent | WheelEvent | TouchEvent) => { x: number; y: number };\n pauseTriggerEvent: () => void;\n resumeTriggerEvent: () => void;\n\n pauseAnimation?: (deep?: boolean) => void;\n resumeAnimation?: (deep?: boolean) => void;\n stopAnimation?: (deep?: boolean) => void;\n reApplyAnimationState?: (state: string, deep?: boolean) => this;\n}\n\nexport declare function combineStage(srages: IStage[], params: { canvas: string | HTMLCanvasElement }): IStage;\n"]}
@@ -0,0 +1,2 @@
1
+ export { interpolateColor, interpolatePureColorArrayToStr } from './color-string';
2
+ export { pointInterpolation, pointsInterpolation } from './common/utils';
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.pointsInterpolation = exports.pointInterpolation = exports.interpolatePureColorArrayToStr = exports.interpolateColor = void 0;
6
+
7
+ var color_string_1 = require("./color-string");
8
+
9
+ Object.defineProperty(exports, "interpolateColor", {
10
+ enumerable: !0,
11
+ get: function() {
12
+ return color_string_1.interpolateColor;
13
+ }
14
+ }), Object.defineProperty(exports, "interpolatePureColorArrayToStr", {
15
+ enumerable: !0,
16
+ get: function() {
17
+ return color_string_1.interpolatePureColorArrayToStr;
18
+ }
19
+ });
20
+
21
+ var utils_1 = require("./common/utils");
22
+
23
+ Object.defineProperty(exports, "pointInterpolation", {
24
+ enumerable: !0,
25
+ get: function() {
26
+ return utils_1.pointInterpolation;
27
+ }
28
+ }), Object.defineProperty(exports, "pointsInterpolation", {
29
+ enumerable: !0,
30
+ get: function() {
31
+ return utils_1.pointsInterpolation;
32
+ }
33
+ });
34
+ //# sourceMappingURL=interpolate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/interpolate.ts"],"names":[],"mappings":";;;AAAA,+CAAkF;AAAzE,gHAAA,gBAAgB,OAAA;AAAE,8HAAA,8BAA8B,OAAA;AACzD,wCAAyE;AAAhE,2GAAA,kBAAkB,OAAA;AAAE,4GAAA,mBAAmB,OAAA","file":"interpolate.js","sourcesContent":["export { interpolateColor, interpolatePureColorArrayToStr } from './color-string';\nexport { pointInterpolation, pointsInterpolation } from './common/utils';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/modules.ts"],"names":[],"mappings":";;;AAWA,+CAA4C;AAE5C,mDAAqD;AACrD,gDAO0B;AAC1B,kDAAmD;AACnD,mDAAoD;AACpD,kDAAmD;AACnD,kDAAqE;AACrE,iEAAmF;AACnF,0CAAyE;AACzE,qCAAmC;AACnC,kDAK4B;AAI5B,mCAAmC;AAA1B,iGAAA,OAAO,OAAA;AAChB,gDAK4B;AAJ1B,6GAAA,gBAAgB,OAAA;AAChB,oHAAA,uBAAuB,OAAA;AAIZ,QAAA,SAAS,GAAG,IAAA,mCAAuB,GAAE,CAAC;AACtC,QAAA,WAAW,GAAG,IAAA,sCAA0B,EAAe,GAAG,EAAE,CACvE,IAAA,kCAAsB,EAAe,uBAAW,CAAC,CAClD,CAAC;AACW,QAAA,aAAa,GAAG,IAAA,sCAA0B,EAAiB,GAAG,EAAE,CAC3E,IAAA,kCAAsB,EAAiB,yBAAa,CAAC,CACtD,CAAC;AACW,QAAA,cAAc,GAAG,IAAA,sCAA0B,EAAkB,GAAG,EAAE,CAC7E,IAAA,kCAAsB,EAAkB,0BAAc,CAAC,CACxD,CAAC;AACW,QAAA,YAAY,GAAG,IAAA,sCAA0B,EAAgB,GAAG,EAAE,CACzE,IAAA,kCAAsB,EAAgB,wBAAY,CAAC,CACpD,CAAC;AAEF,SAAS,0BAA0B,C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,EAAiB,GAAG,EAAE,CAC1E,IAAA,kCAAsB,EAAiB,yBAAa,CAAC,CACtD,CAAC;IACF,yBAAW,CAAC,oBAAoB,GAAG,GAAG,EAAE,CAAC,IAAA,kCAAsB,EAAC,yBAAa,CAAC,CAAC;IAC/E,yBAAW,CAAC,mBAAmB,GAAG,SAAS,CAAC,EAAE;QAC5C,IAAI,SAAS,KAAK,QAAQ,EAAE;YAC1B,OAAO,IAAA,kCAAsB,EAAC,0CAA8B,CAAC,CAAC;SAC/D;QACD,IAAI,SAAS,KAAK,SAAS,EAAE;YAC3B,OAAO,IAAA,kCAAsB,EAAC,2CAA+B,CAAC,CAAC;SAChE;QACD,OAAO,IAAA,kCAAsB,EAAC,2CAA+B,CAAC,CAAC;IACjE,CAAC,CAAC;IACF,yBAAW,CAAC,kCAAkC,GAAG,GAAG,EAAE,CAAC,IAAA,kCAAsB,EAAC,oCAA2B,CAAC,CAAC;AAC7G,CAAC;AA7BD,gEA6BC;AAED,0BAA0B,EAAE,CAAC","file":"modules.js","sourcesContent":["/**\n * @deprecated Legacy global module bootstrap retained for compatibility.\n * Prefer `createBrowserApp()`, `createNodeApp()`, or `createMiniappApp()` from `./entries`\n * instead of relying on the shared global container/module initialization path.\n */\n// import allocatorModule from './allocator/allocator-modules';\n// import loadPickContributions from './picker/contributions/modules';\n// import loadCanvasContributions from './canvas/contributions/modules';\n// import { IMat4Allocate, IMatrixAllocate, Mat4Allocate, MatrixAllocate } from './allocator/matrix-allocate';\n// import { GlobalPickerService } from './picker/constants';\nimport type { IGraphicService, IPluginService, IRenderService, IWindowHandlerContribution } from './interface';\nimport { application } from './application';\nimport type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';\nimport { GraphicService } from './graphic/constants';\nimport {\n DynamicLayerHandlerContribution,\n GraphicUtil,\n LayerService,\n StaticLayerHandlerContribution,\n TransformUtil,\n VirtualLayerHandlerContribution\n} from './core/constants';\nimport { RenderService } from './render/constants';\nimport { PluginService } from './plugins/constants';\nimport { PickerService } from './picker/constants';\nimport { CanvasFactory, Context2dFactory } from './canvas/constants';\nimport { IncrementalDrawContribution } from './render/contributions/render/symbol';\nimport { DefaultWindow, WindowHandlerContribution } from './core/window';\nimport { vglobal } from './global';\nimport {\n createLegacySingletonProxy,\n getLegacyBindingContext,\n resolveLegacyNamed,\n resolveLegacySingleton\n} from './legacy/bootstrap';\n// loadPickContributions(container);\n// loadCanvasContributions(container);\n\nexport { vglobal } from './global';\nexport {\n preLoadAllModule,\n getLegacyBindingContext,\n type ILegacyBindContext,\n type ILegacyBindingContext\n} from './legacy/bootstrap';\nexport const container = getLegacyBindingContext();\nexport const graphicUtil = createLegacySingletonProxy<IGraphicUtil>(() =>\n resolveLegacySingleton<IGraphicUtil>(GraphicUtil)\n);\nexport const transformUtil = createLegacySingletonProxy<ITransformUtil>(() =>\n resolveLegacySingleton<ITransformUtil>(TransformUtil)\n);\nexport const graphicService = createLegacySingletonProxy<IGraphicService>(() =>\n resolveLegacySingleton<IGraphicService>(GraphicService)\n);\nexport const layerService = createLegacySingletonProxy<ILayerService>(() =>\n resolveLegacySingleton<ILayerService>(LayerService)\n);\n\nfunction resolveLegacyWindowHandler(env: string): IWindowHandlerContribution {\n const handler = resolveLegacyNamed<IWindowHandlerContribution>(WindowHandlerContribution, env);\n if (!handler) {\n throw new Error(`Window handler is not configured for env: ${env}`);\n }\n return handler;\n}\n\nexport function configureLegacyApplication(): void {\n application.global = vglobal;\n application.graphicUtil = graphicUtil;\n application.transformUtil = transformUtil;\n application.graphicService = graphicService;\n application.layerService = layerService;\n application.canvasFactory = env => resolveLegacyNamed(CanvasFactory, env);\n application.context2dFactory = env => resolveLegacyNamed(Context2dFactory, env);\n application.windowFactory = () => new DefaultWindow(application.global);\n application.windowHandlerFactory = env => resolveLegacyWindowHandler(env);\n application.renderServiceFactory = () => resolveLegacySingleton<IRenderService>(RenderService);\n application.renderService = createLegacySingletonProxy<IRenderService>(() =>\n resolveLegacySingleton<IRenderService>(RenderService)\n );\n application.pluginServiceFactory = () => resolveLegacySingleton<IPluginService>(PluginService);\n application.pluginService = createLegacySingletonProxy<IPluginService>(() =>\n resolveLegacySingleton<IPluginService>(PluginService)\n );\n application.pickerServiceFactory = () => resolveLegacySingleton(PickerService);\n application.layerHandlerFactory = layerMode => {\n if (layerMode === 'static') {\n return resolveLegacySingleton(StaticLayerHandlerContribution);\n }\n if (layerMode === 'dynamic') {\n return resolveLegacySingleton(DynamicLayerHandlerContribution);\n }\n return resolveLegacySingleton(VirtualLayerHandlerContribution);\n };\n application.incrementalDrawContributionFactory = () => resolveLegacySingleton(IncrementalDrawContribution);\n}\n\nconfigureLegacyApplication();\n// export const matrixAllocate = container.get<IMatrixAllocate>(MatrixAllocate);\n// export const mat4Allocate = container.get<IMat4Allocate>(Mat4Allocate);\n// export const canvasAllocate = container.get<ICanvasAllocate>(CanvasAllocate);\n// export const arcAllocate = container.get<IArcAllocate>(ArcAllocate);\n// export const areaAllocate = container.get<IAreaAllocate>(AreaAllocate);\n// export const circleAllocate = container.get<ICircleAllocate>(CircleAllocate);\n// export const lineAllocate = container.get<ILineAllocate>(LineAllocate);\n// export const pathAllocate = container.get<IPathAllocate>(PathAllocate);\n// export const rectAllocate = container.get<IRectAllocate>(RectAllocate);\n// export const symbolAllocate = container.get<ISymbolAllocate>(SymbolAllocate);\n// export const textAllocate = container.get<ITextAllocate>(TextAllocate);\n// export const pickerService = container.get<IPickerService>(GlobalPickerService);\n"]}
1
+ {"version":3,"sources":["../src/modules.ts"],"names":[],"mappings":";;;AAMA,+CAA4C;AAE5C,mDAAqD;AACrD,gDAO0B;AAC1B,kDAAmD;AACnD,mDAAoD;AACpD,kDAAmD;AACnD,kDAAqE;AACrE,iEAAmF;AACnF,0CAAyE;AACzE,qCAAmC;AACnC,kDAK4B;AAE5B,mCAAmC;AAA1B,iGAAA,OAAO,OAAA;AAChB,gDAK4B;AAJ1B,6GAAA,gBAAgB,OAAA;AAChB,oHAAA,uBAAuB,OAAA;AAIZ,QAA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AE,CAAC,IAAI,sBAAa,CAAC,yBAAW,CAAC,MAAM,CAAC,CAAC;IACxE,yBAAW,CAAC,oBAAoB,GAAG,GAAG,CAAC,EAAE,CAAC,0BAA0B,CAAC,GAAG,CAAC,CAAC;IAC1E,yBAAW,CAAC,oBAAoB,GAAG,GAAG,EAAE,CAAC,IAAA,kCAAsB,EAAiB,yBAAa,CAAC,CAAC;IAC/F,yBAAW,CAAC,aAAa,GAAG,IAAA,sCAA0B,EAAiB,GAAG,EAAE,CAC1E,IAAA,kCAAsB,EAAiB,yBAAa,CAAC,CACtD,CAAC;IACF,yBAAW,CAAC,oBAAoB,GAAG,GAAG,EAAE,CAAC,IAAA,kCAAsB,EAAiB,yBAAa,CAAC,CAAC;IAC/F,yBAAW,CAAC,aAAa,GAAG,IAAA,sCAA0B,EAAiB,GAAG,EAAE,CAC1E,IAAA,kCAAsB,EAAiB,yBAAa,CAAC,CACtD,CAAC;IACF,yBAAW,CAAC,oBAAoB,GAAG,GAAG,EAAE,CAAC,IAAA,kCAAsB,EAAC,yBAAa,CAAC,CAAC;IAC/E,yBAAW,CAAC,mBAAmB,GAAG,SAAS,CAAC,EAAE;QAC5C,IAAI,SAAS,KAAK,QAAQ,EAAE;YAC1B,OAAO,IAAA,kCAAsB,EAAC,0CAA8B,CAAC,CAAC;SAC/D;QACD,IAAI,SAAS,KAAK,SAAS,EAAE;YAC3B,OAAO,IAAA,kCAAsB,EAAC,2CAA+B,CAAC,CAAC;SAChE;QACD,OAAO,IAAA,kCAAsB,EAAC,2CAA+B,CAAC,CAAC;IACjE,CAAC,CAAC;IACF,yBAAW,CAAC,kCAAkC,GAAG,GAAG,EAAE,CAAC,IAAA,kCAAsB,EAAC,oCAA2B,CAAC,CAAC;AAC7G,CAAC;AA7BD,gEA6BC;AAED,0BAA0B,EAAE,CAAC","file":"modules.js","sourcesContent":["/**\n * @deprecated Legacy global module bootstrap retained for compatibility.\n * Prefer `createBrowserApp()`, `createNodeApp()`, or `createMiniappApp()` from `./entries`\n * instead of relying on the shared global container/module initialization path.\n */\nimport type { IGraphicService, IPluginService, IRenderService, IWindowHandlerContribution } from './interface';\nimport { application } from './application';\nimport type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';\nimport { GraphicService } from './graphic/constants';\nimport {\n DynamicLayerHandlerContribution,\n GraphicUtil,\n LayerService,\n StaticLayerHandlerContribution,\n TransformUtil,\n VirtualLayerHandlerContribution\n} from './core/constants';\nimport { RenderService } from './render/constants';\nimport { PluginService } from './plugins/constants';\nimport { PickerService } from './picker/constants';\nimport { CanvasFactory, Context2dFactory } from './canvas/constants';\nimport { IncrementalDrawContribution } from './render/contributions/render/symbol';\nimport { DefaultWindow, WindowHandlerContribution } from './core/window';\nimport { vglobal } from './global';\nimport {\n createLegacySingletonProxy,\n getLegacyBindingContext,\n resolveLegacyNamed,\n resolveLegacySingleton\n} from './legacy/bootstrap';\n\nexport { vglobal } from './global';\nexport {\n preLoadAllModule,\n getLegacyBindingContext,\n type ILegacyBindContext,\n type ILegacyBindingContext\n} from './legacy/bootstrap';\nexport const container = getLegacyBindingContext();\nexport const graphicUtil = createLegacySingletonProxy<IGraphicUtil>(() =>\n resolveLegacySingleton<IGraphicUtil>(GraphicUtil)\n);\nexport const transformUtil = createLegacySingletonProxy<ITransformUtil>(() =>\n resolveLegacySingleton<ITransformUtil>(TransformUtil)\n);\nexport const graphicService = createLegacySingletonProxy<IGraphicService>(() =>\n resolveLegacySingleton<IGraphicService>(GraphicService)\n);\nexport const layerService = createLegacySingletonProxy<ILayerService>(() =>\n resolveLegacySingleton<ILayerService>(LayerService)\n);\n\nfunction resolveLegacyWindowHandler(env: string): IWindowHandlerContribution {\n const handler = resolveLegacyNamed<IWindowHandlerContribution>(WindowHandlerContribution, env);\n if (!handler) {\n throw new Error(`Window handler is not configured for env: ${env}`);\n }\n return handler;\n}\n\nexport function configureLegacyApplication(): void {\n application.global = vglobal;\n application.graphicUtil = graphicUtil;\n application.transformUtil = transformUtil;\n application.graphicService = graphicService;\n application.layerService = layerService;\n application.canvasFactory = env => resolveLegacyNamed(CanvasFactory, env);\n application.context2dFactory = env => resolveLegacyNamed(Context2dFactory, env);\n application.windowFactory = () => new DefaultWindow(application.global);\n application.windowHandlerFactory = env => resolveLegacyWindowHandler(env);\n application.renderServiceFactory = () => resolveLegacySingleton<IRenderService>(RenderService);\n application.renderService = createLegacySingletonProxy<IRenderService>(() =>\n resolveLegacySingleton<IRenderService>(RenderService)\n );\n application.pluginServiceFactory = () => resolveLegacySingleton<IPluginService>(PluginService);\n application.pluginService = createLegacySingletonProxy<IPluginService>(() =>\n resolveLegacySingleton<IPluginService>(PluginService)\n );\n application.pickerServiceFactory = () => resolveLegacySingleton(PickerService);\n application.layerHandlerFactory = layerMode => {\n if (layerMode === 'static') {\n return resolveLegacySingleton(StaticLayerHandlerContribution);\n }\n if (layerMode === 'dynamic') {\n return resolveLegacySingleton(DynamicLayerHandlerContribution);\n }\n return resolveLegacySingleton(VirtualLayerHandlerContribution);\n };\n application.incrementalDrawContributionFactory = () => resolveLegacySingleton(IncrementalDrawContribution);\n}\n\nconfigureLegacyApplication();\n"]}
package/cjs/path.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { CustomPath2D } from './common/custom-path2d';
2
+ export { divideCubic } from './common/segment/curve/cubic-bezier';
3
+ export { CurveContext } from './common/segment/curve/curve-context';
4
+ export type { ICustomPath2D, IPath2D } from './interface/path';
package/cjs/path.js ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.CurveContext = exports.divideCubic = exports.CustomPath2D = void 0;
6
+
7
+ var custom_path2d_1 = require("./common/custom-path2d");
8
+
9
+ Object.defineProperty(exports, "CustomPath2D", {
10
+ enumerable: !0,
11
+ get: function() {
12
+ return custom_path2d_1.CustomPath2D;
13
+ }
14
+ });
15
+
16
+ var cubic_bezier_1 = require("./common/segment/curve/cubic-bezier");
17
+
18
+ Object.defineProperty(exports, "divideCubic", {
19
+ enumerable: !0,
20
+ get: function() {
21
+ return cubic_bezier_1.divideCubic;
22
+ }
23
+ });
24
+
25
+ var curve_context_1 = require("./common/segment/curve/curve-context");
26
+
27
+ Object.defineProperty(exports, "CurveContext", {
28
+ enumerable: !0,
29
+ get: function() {
30
+ return curve_context_1.CurveContext;
31
+ }
32
+ });
33
+ //# sourceMappingURL=path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/path.ts"],"names":[],"mappings":";;;AAAA,wDAAsD;AAA7C,6GAAA,YAAY,OAAA;AACrB,oEAAkE;AAAzD,2GAAA,WAAW,OAAA;AACpB,sEAAoE;AAA3D,6GAAA,YAAY,OAAA","file":"path.js","sourcesContent":["export { CustomPath2D } from './common/custom-path2d';\nexport { divideCubic } from './common/segment/curve/cubic-bezier';\nexport { CurveContext } from './common/segment/curve/curve-context';\nexport type { ICustomPath2D, IPath2D } from './interface/path';\n"]}
@@ -0,0 +1,3 @@
1
+ export { registerDirectionalLight } from '../core/light';
2
+ export { registerOrthoCamera } from '../core/camera';
3
+ export { registerViewTransform3dPlugin } from '../plugins/builtin-plugin/3dview-transform-plugin';
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.registerViewTransform3dPlugin = exports.registerOrthoCamera = exports.registerDirectionalLight = void 0;
6
+
7
+ var light_1 = require("../core/light");
8
+
9
+ Object.defineProperty(exports, "registerDirectionalLight", {
10
+ enumerable: !0,
11
+ get: function() {
12
+ return light_1.registerDirectionalLight;
13
+ }
14
+ });
15
+
16
+ var camera_1 = require("../core/camera");
17
+
18
+ Object.defineProperty(exports, "registerOrthoCamera", {
19
+ enumerable: !0,
20
+ get: function() {
21
+ return camera_1.registerOrthoCamera;
22
+ }
23
+ });
24
+
25
+ var _3dview_transform_plugin_1 = require("../plugins/builtin-plugin/3dview-transform-plugin");
26
+
27
+ Object.defineProperty(exports, "registerViewTransform3dPlugin", {
28
+ enumerable: !0,
29
+ get: function() {
30
+ return _3dview_transform_plugin_1.registerViewTransform3dPlugin;
31
+ }
32
+ });
33
+ //# sourceMappingURL=3d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/3d.ts"],"names":[],"mappings":";;;AAAA,uCAAyD;AAAhD,iHAAA,wBAAwB,OAAA;AACjC,yCAAqD;AAA5C,6GAAA,mBAAmB,OAAA;AAC5B,8FAAkG;AAAzF,yIAAA,6BAA6B,OAAA","file":"3d.js","sourcesContent":["export { registerDirectionalLight } from '../core/light';\nexport { registerOrthoCamera } from '../core/camera';\nexport { registerViewTransform3dPlugin } from '../plugins/builtin-plugin/3dview-transform-plugin';\n"]}
@@ -0,0 +1,2 @@
1
+ export { registerHtmlAttributePlugin } from '../plugins/builtin-plugin/html-attribute-plugin';
2
+ export { registerReactAttributePlugin } from '../plugins/builtin-plugin/react-attribute-plugin';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.registerReactAttributePlugin = exports.registerHtmlAttributePlugin = void 0;
6
+
7
+ var html_attribute_plugin_1 = require("../plugins/builtin-plugin/html-attribute-plugin");
8
+
9
+ Object.defineProperty(exports, "registerHtmlAttributePlugin", {
10
+ enumerable: !0,
11
+ get: function() {
12
+ return html_attribute_plugin_1.registerHtmlAttributePlugin;
13
+ }
14
+ });
15
+
16
+ var react_attribute_plugin_1 = require("../plugins/builtin-plugin/react-attribute-plugin");
17
+
18
+ Object.defineProperty(exports, "registerReactAttributePlugin", {
19
+ enumerable: !0,
20
+ get: function() {
21
+ return react_attribute_plugin_1.registerReactAttributePlugin;
22
+ }
23
+ });
24
+ //# sourceMappingURL=attribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/attribute.ts"],"names":[],"mappings":";;;AAAA,yFAA8F;AAArF,oIAAA,2BAA2B,OAAA;AACpC,2FAAgG;AAAvF,sIAAA,4BAA4B,OAAA","file":"attribute.js","sourcesContent":["export { registerHtmlAttributePlugin } from '../plugins/builtin-plugin/html-attribute-plugin';\nexport { registerReactAttributePlugin } from '../plugins/builtin-plugin/react-attribute-plugin';\n"]}
@@ -0,0 +1 @@
1
+ export { registerFlexLayoutPlugin } from '../plugins/builtin-plugin/flex-layout-plugin';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.registerFlexLayoutPlugin = void 0;
6
+
7
+ var flex_layout_plugin_1 = require("../plugins/builtin-plugin/flex-layout-plugin");
8
+
9
+ Object.defineProperty(exports, "registerFlexLayoutPlugin", {
10
+ enumerable: !0,
11
+ get: function() {
12
+ return flex_layout_plugin_1.registerFlexLayoutPlugin;
13
+ }
14
+ });
15
+ //# sourceMappingURL=flex-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/flex-layout.ts"],"names":[],"mappings":";;;AAAA,mFAAwF;AAA/E,8HAAA,wBAAwB,OAAA","file":"flex-layout.js","sourcesContent":["export { registerFlexLayoutPlugin } from '../plugins/builtin-plugin/flex-layout-plugin';\n"]}
@@ -10,30 +10,30 @@ class DirtyBoundsPlugin {
10
10
  constructor() {
11
11
  this.name = "DirtyBoundsPlugin", this.activeEvent = "onRegister", this._uid = generator_1.Generator.GenAutoIncrementId(),
12
12
  this.key = this.name + this._uid, this.dirtyBoundsHooksRegistered = !1, this.handlePaintOnlyUpdate = graphic => {
13
- var _a, _b, _c, _d;
13
+ var _a;
14
14
  const stage = this.pluginService.stage;
15
15
  if (!stage || stage !== graphic.stage || !stage.renderCount) return;
16
16
  const owner = null !== (_a = graphic.glyphHost) && void 0 !== _a ? _a : graphic;
17
17
  if (!(owner._updateTag & enums_1.UpdateTag.UPDATE_PAINT) || owner._updateTag & enums_1.UpdateTag.UPDATE_BOUNDS) return;
18
18
  const ownerBounds = this.ensurePaintDirtyBoundsCache(owner);
19
- ownerBounds && !ownerBounds.empty() && stage.dirty(ownerBounds), null === (_b = owner.clearUpdatePaintTag) || void 0 === _b || _b.call(owner);
19
+ ownerBounds && !ownerBounds.empty() && stage.dirty(ownerBounds), owner.clearUpdatePaintTag();
20
20
  const shadowRoot = owner.shadowRoot;
21
21
  if (!shadowRoot) return;
22
22
  const shadowBounds = this.ensurePaintDirtyBoundsCache(shadowRoot);
23
- shadowBounds && !shadowBounds.empty() && stage.dirty(shadowBounds), null === (_d = (_c = shadowRoot).clearUpdatePaintTag) || void 0 === _d || _d.call(_c);
23
+ shadowBounds && !shadowBounds.empty() && stage.dirty(shadowBounds), shadowRoot.clearUpdatePaintTag();
24
24
  };
25
25
  }
26
26
  ensurePaintDirtyBoundsCache(graphic) {
27
- var _a, _b;
27
+ var _a;
28
28
  const owner = graphic;
29
- owner._AABBBounds && "function" == typeof owner._AABBBounds.empty && !owner._AABBBounds.empty() || "function" != typeof owner.doUpdateAABBBounds || owner.doUpdateAABBBounds("imprecise" === (null === (_a = owner.attribute) || void 0 === _a ? void 0 : _a.boundsMode));
30
- return owner._globalAABBBounds && "function" == typeof owner._globalAABBBounds.empty && !owner._globalAABBBounds.empty() || "function" != typeof owner.tryUpdateGlobalAABBBounds || owner.tryUpdateGlobalAABBBounds(),
31
- null !== (_b = owner._globalAABBBounds) && void 0 !== _b ? _b : owner.globalAABBBounds;
29
+ return owner._AABBBounds.empty() && owner.doUpdateAABBBounds("imprecise" === (null === (_a = owner.attribute) || void 0 === _a ? void 0 : _a.boundsMode)),
30
+ owner._globalAABBBounds && !owner._globalAABBBounds.empty() || owner.tryUpdateGlobalAABBBounds(),
31
+ owner._globalAABBBounds;
32
32
  }
33
33
  getRemoveDirtyBounds(graphic) {
34
34
  var _a;
35
35
  const cachedBounds = (null !== (_a = graphic.glyphHost) && void 0 !== _a ? _a : graphic)._globalAABBBounds;
36
- if (cachedBounds && "function" == typeof cachedBounds.empty && !cachedBounds.empty()) return cachedBounds;
36
+ if (cachedBounds && !cachedBounds.empty()) return cachedBounds;
37
37
  }
38
38
  registerDirtyBoundsHooks(stage) {
39
39
  this.dirtyBoundsHooksRegistered || (stage.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handlePaintOnlyUpdate),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugins/builtin-plugin/dirty-bounds-plugin.ts"],"names":[],"mappings":";;;AAAA,6CAAgE;AAChE,8CAA+C;AAC/C,sDAAmD;AAGnD,MAAM,YAAY,GAAG,IAAI,mBAAU,EAAE,CAAC;AAEtC,MAAa,iBAAiB;IAA9B;QACE,SAAI,GAAwB,mBAAmB,CAAC;QAChD,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,qBAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,+BAA0B,GAAY,KAAK,CAAC;QA6B5C,0BAAqB,GAAG,CAAC,OAAiB,EAAE,EAAE;;YACtD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;YACvC,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW,CAAC,EAAE;gBAC5D,OAAO;aACR;YAED,MAAM,KAAK,GAAG,CAAC,MAAA,OAAO,CAAC,SAAS,mCAAI,OAAO,CAAQ,CAAC;YACpD,IAAI,CAAC,CAAC,KAAK,CAAC,UAAU,GAAG,iBAAS,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,UAAU,GAAG,iBAAS,CAAC,aAAa,EAAE;gBAC9F,OAAO;aACR;YAED,MAAM,WAAW,GAAG,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;YAC5D,IAAI,WAAW,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE;gBACvC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;aAC1B;YACD,MAAA,KAAK,CAAC,mBAAmB,qDA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,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBACnE,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;YAChC,CAAC,CAAC,CAAC;QACL,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI;YACnD,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBAClE,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;YAChC,CAAC,CAAC,CAAC;QACL,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YAC9G,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACxE,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YAChG,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAjLD,8CAiLC","file":"dirty-bounds-plugin.js","sourcesContent":["import { AABBBounds, type IAABBBounds } from '@visactor/vutils';\nimport { UpdateTag } from '../../common/enums';\nimport { Generator } from '../../common/generator';\nimport type { IGraphic, IStage, IPlugin, IPluginService } from '../../interface';\n\nconst globalBounds = new AABBBounds();\n\nexport class DirtyBoundsPlugin implements IPlugin {\n name: 'DirtyBoundsPlugin' = 'DirtyBoundsPlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n protected dirtyBoundsHooksRegistered: boolean = false;\n\n protected ensurePaintDirtyBoundsCache(graphic: IGraphic): IAABBBounds {\n const owner = graphic as any;\n const hasLocalBounds =\n owner._AABBBounds && typeof owner._AABBBounds.empty === 'function' && !owner._AABBBounds.empty();\n if (!hasLocalBounds && typeof owner.doUpdateAABBBounds === 'function') {\n owner.doUpdateAABBBounds(owner.attribute?.boundsMode === 'imprecise');\n }\n\n const hasGlobalBounds =\n owner._globalAABBBounds &&\n typeof owner._globalAABBBounds.empty === 'function' &&\n !owner._globalAABBBounds.empty();\n if (!hasGlobalBounds && typeof owner.tryUpdateGlobalAABBBounds === 'function') {\n owner.tryUpdateGlobalAABBBounds();\n }\n\n return owner._globalAABBBounds ?? owner.globalAABBBounds;\n }\n\n protected getRemoveDirtyBounds(graphic: IGraphic): IAABBBounds | undefined {\n const owner = (graphic.glyphHost ?? graphic) as any;\n const cachedBounds = owner._globalAABBBounds as IAABBBounds | undefined;\n if (cachedBounds && typeof cachedBounds.empty === 'function' && !cachedBounds.empty()) {\n return cachedBounds;\n }\n }\n\n protected handlePaintOnlyUpdate = (graphic: IGraphic) => {\n const stage = this.pluginService.stage;\n if (!(stage && stage === graphic.stage && stage.renderCount)) {\n return;\n }\n\n const owner = (graphic.glyphHost ?? graphic) as any;\n if (!(owner._updateTag & UpdateTag.UPDATE_PAINT) || owner._updateTag & UpdateTag.UPDATE_BOUNDS) {\n return;\n }\n\n const ownerBounds = this.ensurePaintDirtyBoundsCache(owner);\n if (ownerBounds && !ownerBounds.empty()) {\n stage.dirty(ownerBounds);\n }\n owner.clearUpdatePaintTag?.();\n\n const shadowRoot = owner.shadowRoot as IGraphic | undefined;\n if (!shadowRoot) {\n return;\n }\n\n const shadowBounds = this.ensurePaintDirtyBoundsCache(shadowRoot);\n if (shadowBounds && !shadowBounds.empty()) {\n stage.dirty(shadowBounds);\n }\n (shadowRoot as any).clearUpdatePaintTag?.();\n };\n\n protected registerDirtyBoundsHooks(stage: IStage): void {\n if (this.dirtyBoundsHooksRegistered) {\n return;\n }\n stage.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handlePaintOnlyUpdate);\n stage.graphicService.hooks.beforeUpdateAABBBounds.tap(\n this.key,\n (graphic: IGraphic, stage: IStage, willUpdate: boolean, bounds: IAABBBounds) => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n // group的子元素导致的bounds更新不用做dirtyBounds\n if (graphic.isContainer && !graphic.shouldSelfChangeUpdateAABBBounds()) {\n return;\n }\n if (willUpdate) {\n globalBounds.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2);\n stage.dirty(globalBounds, graphic.parent && graphic.parent.globalTransMatrix);\n }\n }\n );\n stage.graphicService.hooks.afterUpdateAABBBounds.tap(\n this.key,\n (\n graphic: IGraphic,\n stage: IStage,\n bounds: IAABBBounds,\n params: { globalAABBBounds: IAABBBounds },\n selfChange: boolean\n ) => {\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n // group的子元素导致的bounds更新不用做dirtyBounds\n if (graphic.isContainer && !selfChange) {\n return;\n }\n stage.dirty(params.globalAABBBounds);\n }\n );\n stage.graphicService.hooks.clearAABBBounds.tap(\n this.key,\n (graphic: IGraphic, stage: IStage, bounds: IAABBBounds) => {\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n if (stage) {\n stage.dirty(bounds);\n }\n }\n );\n stage.graphicService.hooks.onRemove.tap(this.key, (graphic: IGraphic) => {\n const stage = graphic.stage;\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n const bounds = this.getRemoveDirtyBounds(graphic);\n if (bounds && !bounds.empty()) {\n stage.dirty(bounds);\n }\n });\n this.dirtyBoundsHooksRegistered = true;\n }\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n context.stage.hooks.afterRender.tap(this.key, stage => {\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n stage.dirtyBounds.clear();\n this.registerDirtyBoundsHooks(stage);\n });\n const stage = this.pluginService.stage;\n if (!stage) {\n return;\n }\n if (stage.renderCount) {\n this.registerDirtyBoundsHooks(stage);\n }\n }\n deactivate(context: IPluginService): void {\n const stage = this.pluginService.stage;\n if (!stage) {\n return;\n }\n stage.graphicService.hooks.onAttributeUpdate.taps = stage.graphicService.hooks.onAttributeUpdate.taps.filter(\n item => {\n return item.name !== this.key;\n }\n );\n this.dirtyBoundsHooksRegistered = false;\n stage.graphicService.hooks.beforeUpdateAABBBounds.taps =\n stage.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.graphicService.hooks.afterUpdateAABBBounds.taps =\n stage.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.graphicService.hooks.clearAABBBounds.taps = stage.graphicService.hooks.clearAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.hooks.afterRender.taps = stage.hooks.afterRender.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.graphicService.hooks.onRemove.taps = stage.graphicService.hooks.onRemove.taps.filter(item => {\n return item.name !== this.key;\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/plugins/builtin-plugin/dirty-bounds-plugin.ts"],"names":[],"mappings":";;;AAAA,6CAAgE;AAChE,8CAA+C;AAC/C,sDAAmD;AAGnD,MAAM,YAAY,GAAG,IAAI,mBAAU,EAAE,CAAC;AAEtC,MAAa,iBAAiB;IAA9B;QACE,SAAI,GAAwB,mBAAmB,CAAC;QAChD,gBAAW,GAAiB,Y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AI,CAAC,GAAG,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YAChG,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA3KD,8CA2KC","file":"dirty-bounds-plugin.js","sourcesContent":["import { AABBBounds, type IAABBBounds } from '@visactor/vutils';\nimport { UpdateTag } from '../../common/enums';\nimport { Generator } from '../../common/generator';\nimport type { IGraphic, IStage, IPlugin, IPluginService } from '../../interface';\n\nconst globalBounds = new AABBBounds();\n\nexport class DirtyBoundsPlugin implements IPlugin {\n name: 'DirtyBoundsPlugin' = 'DirtyBoundsPlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n protected dirtyBoundsHooksRegistered = false;\n\n protected ensurePaintDirtyBoundsCache(graphic: IGraphic): IAABBBounds {\n const owner = graphic as any;\n if (owner._AABBBounds.empty()) {\n owner.doUpdateAABBBounds(owner.attribute?.boundsMode === 'imprecise');\n }\n\n if (!owner._globalAABBBounds || owner._globalAABBBounds.empty()) {\n owner.tryUpdateGlobalAABBBounds();\n }\n\n return owner._globalAABBBounds;\n }\n\n protected getRemoveDirtyBounds(graphic: IGraphic): IAABBBounds | undefined {\n const owner = (graphic.glyphHost ?? graphic) as any;\n const cachedBounds = owner._globalAABBBounds as IAABBBounds | undefined;\n if (cachedBounds && !cachedBounds.empty()) {\n return cachedBounds;\n }\n }\n\n protected handlePaintOnlyUpdate = (graphic: IGraphic) => {\n const stage = this.pluginService.stage;\n if (!(stage && stage === graphic.stage && stage.renderCount)) {\n return;\n }\n\n const owner = (graphic.glyphHost ?? graphic) as any;\n if (!(owner._updateTag & UpdateTag.UPDATE_PAINT) || owner._updateTag & UpdateTag.UPDATE_BOUNDS) {\n return;\n }\n\n const ownerBounds = this.ensurePaintDirtyBoundsCache(owner);\n if (ownerBounds && !ownerBounds.empty()) {\n stage.dirty(ownerBounds);\n }\n owner.clearUpdatePaintTag();\n\n const shadowRoot = owner.shadowRoot as IGraphic | undefined;\n if (!shadowRoot) {\n return;\n }\n\n const shadowBounds = this.ensurePaintDirtyBoundsCache(shadowRoot);\n if (shadowBounds && !shadowBounds.empty()) {\n stage.dirty(shadowBounds);\n }\n (shadowRoot as any).clearUpdatePaintTag();\n };\n\n protected registerDirtyBoundsHooks(stage: IStage): void {\n if (this.dirtyBoundsHooksRegistered) {\n return;\n }\n stage.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handlePaintOnlyUpdate);\n stage.graphicService.hooks.beforeUpdateAABBBounds.tap(\n this.key,\n (graphic: IGraphic, stage: IStage, willUpdate: boolean, bounds: IAABBBounds) => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n // group的子元素导致的bounds更新不用做dirtyBounds\n if (graphic.isContainer && !graphic.shouldSelfChangeUpdateAABBBounds()) {\n return;\n }\n if (willUpdate) {\n globalBounds.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2);\n stage.dirty(globalBounds, graphic.parent && graphic.parent.globalTransMatrix);\n }\n }\n );\n stage.graphicService.hooks.afterUpdateAABBBounds.tap(\n this.key,\n (\n graphic: IGraphic,\n stage: IStage,\n bounds: IAABBBounds,\n params: { globalAABBBounds: IAABBBounds },\n selfChange: boolean\n ) => {\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n // group的子元素导致的bounds更新不用做dirtyBounds\n if (graphic.isContainer && !selfChange) {\n return;\n }\n stage.dirty(params.globalAABBBounds);\n }\n );\n stage.graphicService.hooks.clearAABBBounds.tap(\n this.key,\n (graphic: IGraphic, stage: IStage, bounds: IAABBBounds) => {\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n if (stage) {\n stage.dirty(bounds);\n }\n }\n );\n stage.graphicService.hooks.onRemove.tap(this.key, (graphic: IGraphic) => {\n const stage = graphic.stage;\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n const bounds = this.getRemoveDirtyBounds(graphic);\n if (bounds && !bounds.empty()) {\n stage.dirty(bounds);\n }\n });\n this.dirtyBoundsHooksRegistered = true;\n }\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n context.stage.hooks.afterRender.tap(this.key, stage => {\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n stage.dirtyBounds.clear();\n this.registerDirtyBoundsHooks(stage);\n });\n const stage = this.pluginService.stage;\n if (!stage) {\n return;\n }\n if (stage.renderCount) {\n this.registerDirtyBoundsHooks(stage);\n }\n }\n deactivate(context: IPluginService): void {\n const stage = this.pluginService.stage;\n if (!stage) {\n return;\n }\n stage.graphicService.hooks.onAttributeUpdate.taps = stage.graphicService.hooks.onAttributeUpdate.taps.filter(\n item => {\n return item.name !== this.key;\n }\n );\n this.dirtyBoundsHooksRegistered = false;\n stage.graphicService.hooks.beforeUpdateAABBBounds.taps =\n stage.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.graphicService.hooks.afterUpdateAABBBounds.taps =\n stage.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.graphicService.hooks.clearAABBBounds.taps = stage.graphicService.hooks.clearAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.hooks.afterRender.taps = stage.hooks.afterRender.taps.filter(item => {\n return item.name !== this.key;\n });\n stage.graphicService.hooks.onRemove.taps = stage.graphicService.hooks.onRemove.taps.filter(item => {\n return item.name !== this.key;\n });\n }\n}\n"]}
@@ -1,5 +1 @@
1
1
  export * from './types';
2
- export * from './base-plugin';
3
- export * from './browser-env-plugin';
4
- export * from './renderer-plugin';
5
- export * from './picker-plugin';
@@ -17,7 +17,5 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), __exportStar(require("./types"), exports), __exportStar(require("./base-plugin"), exports),
21
- __exportStar(require("./browser-env-plugin"), exports), __exportStar(require("./renderer-plugin"), exports),
22
- __exportStar(require("./picker-plugin"), exports);
20
+ }), __exportStar(require("./types"), exports);
23
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugins/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,gDAA8B;AAC9B,uDAAqC;AACrC,oDAAkC;AAClC,kDAAgC","file":"index.js","sourcesContent":["export * from './types';\nexport * from './base-plugin';\nexport * from './browser-env-plugin';\nexport * from './renderer-plugin';\nexport * from './picker-plugin';\n"]}
1
+ {"version":3,"sources":["../src/plugins/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB","file":"index.js","sourcesContent":["export * from './types';\n"]}
@@ -7,7 +7,6 @@ interface ILegacyPluginRegistry {
7
7
  }
8
8
  interface IPluginServiceDeps {
9
9
  pluginRegistry?: ILegacyPluginRegistry;
10
- autoEnablePlugins?: IContributionProvider<IPlugin>;
11
10
  }
12
11
  export declare class DefaultPluginService implements IPluginService {
13
12
  protected autoEnablePlugins: IContributionProvider<IPlugin>;
@@ -10,10 +10,9 @@ const registry_1 = require("../registry"), EMPTY_AUTO_ENABLE_PROVIDER = {
10
10
 
11
11
  class DefaultPluginService {
12
12
  constructor(autoEnablePlugins = EMPTY_AUTO_ENABLE_PROVIDER, deps = {}) {
13
- var _a, _b, _c;
13
+ var _a;
14
14
  this.autoEnablePlugins = autoEnablePlugins, this.onStartupFinishedPlugin = [], this.onRegisterPlugin = [],
15
- this.actived = !1, this.pluginRegistry = null !== (_a = deps.pluginRegistry) && void 0 !== _a ? _a : new registry_1.PluginRegistry,
16
- this.autoEnablePlugins = null !== (_c = null !== (_b = deps.autoEnablePlugins) && void 0 !== _b ? _b : this.autoEnablePlugins) && void 0 !== _c ? _c : EMPTY_AUTO_ENABLE_PROVIDER;
15
+ this.actived = !1, this.pluginRegistry = null !== (_a = deps.pluginRegistry) && void 0 !== _a ? _a : new registry_1.PluginRegistry;
17
16
  }
18
17
  active(stage, params) {
19
18
  this.stage = stage, this.actived = !0;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugins/plugin-service.ts"],"names":[],"mappings":";;;AACA,0CAA6C;AAc7C,MAAM,0BAA0B,GAAmC;IACjE,gBAAgB,EAAE,GAAG,EAAE,CAAC,EAAE;CAC3B,CAAC;AAEF,MAAa,oBAAoB;IAO/B,YACY,oBAAoD,0BAA0B,EACxF,OAA2B,EAAE;;QADnB,sBAAiB,GAAjB,iBAAiB,CAA6D;QAGxF,IAAI,CAAC,uBAAuB,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,MAAA,IAAI,CAAC,cAAc,mCAAK,IAAI,yBAAc,EAAuC,CAAC;QACxG,IAAI,CAAC,iBAAiB,GAAG,MAAA,MAAA,IAAI,CAAC,iBAAiB,mCAAI,IAAI,CAAC,iBAAiB,mCAAI,0BAA0B,CAAC;IAC1G,CAAC;IAED,MAAM,CAAC,KAAa,EAAE,MAAiC;QACrD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAGpB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,EAAE;YACtB,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gB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,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;CACF;AAhGD,oDAgGC","file":"plugin-service.js","sourcesContent":["import type { IContributionProvider, IPlugin, IPluginService, IStage } from '../interface';\nimport { PluginRegistry } from '../registry';\n\ninterface ILegacyPluginRegistry {\n install: (plugin: IPlugin) => void;\n uninstall: (name: string) => void;\n get: (name: string) => IPlugin | undefined;\n clear: () => void;\n}\n\ninterface IPluginServiceDeps {\n pluginRegistry?: ILegacyPluginRegistry;\n autoEnablePlugins?: IContributionProvider<IPlugin>;\n}\n\nconst EMPTY_AUTO_ENABLE_PROVIDER: IContributionProvider<IPlugin> = {\n getContributions: () => []\n};\n\nexport class DefaultPluginService implements IPluginService {\n declare onStartupFinishedPlugin: IPlugin[];\n declare onRegisterPlugin: IPlugin[];\n declare stage: IStage;\n declare actived: boolean;\n readonly pluginRegistry: ILegacyPluginRegistry;\n\n constructor(\n protected autoEnablePlugins: IContributionProvider<IPlugin> = EMPTY_AUTO_ENABLE_PROVIDER,\n deps: IPluginServiceDeps = {}\n ) {\n this.onStartupFinishedPlugin = [];\n this.onRegisterPlugin = [];\n this.actived = false;\n this.pluginRegistry = deps.pluginRegistry ?? (new PluginRegistry() as unknown as ILegacyPluginRegistry);\n this.autoEnablePlugins = deps.autoEnablePlugins ?? this.autoEnablePlugins ?? EMPTY_AUTO_ENABLE_PROVIDER;\n }\n\n active(stage: IStage, params: { pluginList?: string[] }) {\n this.stage = stage;\n this.actived = true;\n\n // 启动插件\n const { pluginList } = params;\n if (pluginList?.length) {\n this.autoEnablePlugins.getContributions().forEach(p => {\n if (pluginList.includes(p.name)) {\n this.install(p);\n }\n });\n }\n }\n\n findPluginsByName(name: string): IPlugin[] {\n const arr: IPlugin[] = [];\n this.onStartupFinishedPlugin.forEach(plugin => {\n if (plugin.name === name) {\n arr.push(plugin);\n }\n });\n this.onRegisterPlugin.forEach(plugin => {\n if (plugin.name === name) {\n arr.push(plugin);\n }\n });\n return arr;\n }\n\n install(plugin: IPlugin) {\n this.register(plugin);\n }\n\n uninstall(name: string) {\n const plugins = this.findPluginsByName(name);\n plugins.forEach(plugin => {\n this.unRegister(plugin);\n });\n this.pluginRegistry.uninstall(name);\n }\n\n register(plugin: IPlugin) {\n this.pluginRegistry.install(plugin);\n if (plugin.activeEvent === 'onStartupFinished') {\n if (!this.onStartupFinishedPlugin.includes(plugin)) {\n this.onStartupFinishedPlugin.push(plugin);\n }\n } else if (plugin.activeEvent === 'onRegister') {\n if (!this.onRegisterPlugin.includes(plugin)) {\n this.onRegisterPlugin.push(plugin);\n plugin.activate(this);\n }\n }\n }\n unRegister(plugin: IPlugin) {\n if (plugin.activeEvent === 'onStartupFinished') {\n this.onStartupFinishedPlugin = this.onStartupFinishedPlugin.filter(item => item !== plugin);\n } else if (plugin.activeEvent === 'onRegister') {\n this.onRegisterPlugin = this.onRegisterPlugin.filter(item => item !== plugin);\n }\n if (this.pluginRegistry.get(plugin.name) === plugin) {\n this.pluginRegistry.uninstall(plugin.name);\n }\n plugin.deactivate(this);\n }\n\n release(...params: any): void {\n this.onStartupFinishedPlugin.forEach(plugin => {\n plugin.deactivate(this);\n });\n this.onStartupFinishedPlugin = [];\n this.onRegisterPlugin.forEach(plugin => {\n plugin.deactivate(this);\n });\n this.onRegisterPlugin = [];\n this.pluginRegistry.clear();\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/plugins/plugin-service.ts"],"names":[],"mappings":";;;AACA,0CAA6C;AAa7C,MAAM,0BAA0B,GAAmC;IACjE,gBAAgB,EAAE,GAAG,EAAE,CAAC,EAAE;CAC3B,CAAC;AAEF,MAAa,oBAAoB;IAO/B,YACY,oBAAoD,0BAA0B,EACxF,OAA2B,EAAE;;QADnB,sBAAiB,GAAjB,iBAAiB,CAA6D;QAGxF,IAAI,CAAC,uBAAu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C;SAC/E;QACD,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE;YACnD,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC5C;QACD,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,CAAC,GAAG,MAAW;QACpB,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC5C,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,uBAAuB,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACrC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;CACF;AA/FD,oDA+FC","file":"plugin-service.js","sourcesContent":["import type { IContributionProvider, IPlugin, IPluginService, IStage } from '../interface';\nimport { PluginRegistry } from '../registry';\n\ninterface ILegacyPluginRegistry {\n install: (plugin: IPlugin) => void;\n uninstall: (name: string) => void;\n get: (name: string) => IPlugin | undefined;\n clear: () => void;\n}\n\ninterface IPluginServiceDeps {\n pluginRegistry?: ILegacyPluginRegistry;\n}\n\nconst EMPTY_AUTO_ENABLE_PROVIDER: IContributionProvider<IPlugin> = {\n getContributions: () => []\n};\n\nexport class DefaultPluginService implements IPluginService {\n declare onStartupFinishedPlugin: IPlugin[];\n declare onRegisterPlugin: IPlugin[];\n declare stage: IStage;\n declare actived: boolean;\n readonly pluginRegistry: ILegacyPluginRegistry;\n\n constructor(\n protected autoEnablePlugins: IContributionProvider<IPlugin> = EMPTY_AUTO_ENABLE_PROVIDER,\n deps: IPluginServiceDeps = {}\n ) {\n this.onStartupFinishedPlugin = [];\n this.onRegisterPlugin = [];\n this.actived = false;\n this.pluginRegistry = deps.pluginRegistry ?? (new PluginRegistry() as unknown as ILegacyPluginRegistry);\n }\n\n active(stage: IStage, params: { pluginList?: string[] }) {\n this.stage = stage;\n this.actived = true;\n\n // 启动插件\n const { pluginList } = params;\n if (pluginList?.length) {\n this.autoEnablePlugins.getContributions().forEach(p => {\n if (pluginList.includes(p.name)) {\n this.install(p);\n }\n });\n }\n }\n\n findPluginsByName(name: string): IPlugin[] {\n const arr: IPlugin[] = [];\n this.onStartupFinishedPlugin.forEach(plugin => {\n if (plugin.name === name) {\n arr.push(plugin);\n }\n });\n this.onRegisterPlugin.forEach(plugin => {\n if (plugin.name === name) {\n arr.push(plugin);\n }\n });\n return arr;\n }\n\n install(plugin: IPlugin) {\n this.register(plugin);\n }\n\n uninstall(name: string) {\n const plugins = this.findPluginsByName(name);\n plugins.forEach(plugin => {\n this.unRegister(plugin);\n });\n this.pluginRegistry.uninstall(name);\n }\n\n register(plugin: IPlugin) {\n this.pluginRegistry.install(plugin);\n if (plugin.activeEvent === 'onStartupFinished') {\n if (!this.onStartupFinishedPlugin.includes(plugin)) {\n this.onStartupFinishedPlugin.push(plugin);\n }\n } else if (plugin.activeEvent === 'onRegister') {\n if (!this.onRegisterPlugin.includes(plugin)) {\n this.onRegisterPlugin.push(plugin);\n plugin.activate(this);\n }\n }\n }\n unRegister(plugin: IPlugin) {\n if (plugin.activeEvent === 'onStartupFinished') {\n this.onStartupFinishedPlugin = this.onStartupFinishedPlugin.filter(item => item !== plugin);\n } else if (plugin.activeEvent === 'onRegister') {\n this.onRegisterPlugin = this.onRegisterPlugin.filter(item => item !== plugin);\n }\n if (this.pluginRegistry.get(plugin.name) === plugin) {\n this.pluginRegistry.uninstall(plugin.name);\n }\n plugin.deactivate(this);\n }\n\n release(...params: any): void {\n this.onStartupFinishedPlugin.forEach(plugin => {\n plugin.deactivate(this);\n });\n this.onStartupFinishedPlugin = [];\n this.onRegisterPlugin.forEach(plugin => {\n plugin.deactivate(this);\n });\n this.onRegisterPlugin = [];\n this.pluginRegistry.clear();\n }\n}\n"]}
@@ -1,6 +1,5 @@
1
- import type { IGraphicPicker } from '../interface/picker';
2
1
  import type { IGraphicFactory, ILayerFactory, IStageFactory } from '../factory';
3
- import type { IContributionRegistry, IPickerRegistry, IPluginRegistry, IRendererRegistry, IRendererRegistryEntry, RegistryKey } from '../registry';
2
+ import type { IContributionRegistry, IPickerRegistry, IPluginRegistry, IRendererRegistry } from '../registry';
4
3
  export interface IPlugin {
5
4
  readonly name: string;
6
5
  readonly version: string;
@@ -20,9 +19,3 @@ export interface IPluginContext {
20
19
  graphic: IGraphicFactory;
21
20
  };
22
21
  }
23
- export interface IBrowserEnvPluginHooks {
24
- install?: (context: IPluginContext) => void;
25
- uninstall?: () => void;
26
- }
27
- export type IRendererPluginEntries = Iterable<[RegistryKey, IRendererRegistryEntry]>;
28
- export type IPickerPluginEntries = Iterable<[RegistryKey, IGraphicPicker]>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugins/types.ts"],"names":[],"mappings":"","file":"types.js","sourcesContent":["import type { IGraphicPicker } from '../interface/picker';\nimport type { IGraphicFactory, ILayerFactory, IStageFactory } from '../factory';\nimport type {\n IContributionRegistry,\n IPickerRegistry,\n IPluginRegistry,\n IRendererRegistry,\n IRendererRegistryEntry,\n RegistryKey\n} from '../registry';\n\nexport interface IPlugin {\n readonly name: string;\n readonly version: string;\n install: (context: IPluginContext) => void;\n uninstall?: () => void;\n}\n\nexport interface IPluginContext {\n registry: {\n renderer: IRendererRegistry;\n picker: IPickerRegistry;\n contribution: IContributionRegistry;\n plugin: IPluginRegistry;\n };\n factory: {\n stage: IStageFactory;\n layer: ILayerFactory;\n graphic: IGraphicFactory;\n };\n}\n\nexport interface IBrowserEnvPluginHooks {\n install?: (context: IPluginContext) => void;\n uninstall?: () => void;\n}\n\nexport type IRendererPluginEntries = Iterable<[RegistryKey, IRendererRegistryEntry]>;\nexport type IPickerPluginEntries = Iterable<[RegistryKey, IGraphicPicker]>;\n"]}
1
+ {"version":3,"sources":["../src/plugins/types.ts"],"names":[],"mappings":"","file":"types.js","sourcesContent":["import type { IGraphicFactory, ILayerFactory, IStageFactory } from '../factory';\nimport type { IContributionRegistry, IPickerRegistry, IPluginRegistry, IRendererRegistry } from '../registry';\n\nexport interface IPlugin {\n readonly name: string;\n readonly version: string;\n install: (context: IPluginContext) => void;\n uninstall?: () => void;\n}\n\nexport interface IPluginContext {\n registry: {\n renderer: IRendererRegistry;\n picker: IPickerRegistry;\n contribution: IContributionRegistry;\n plugin: IPluginRegistry;\n };\n factory: {\n stage: IStageFactory;\n layer: ILayerFactory;\n graphic: IGraphicFactory;\n };\n}\n"]}