@visactor/vrender-core 1.1.3 → 1.1.4-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/cjs/allocator/bounds-allocate.js +1 -2
  2. package/cjs/allocator/graphic-allocate.js +2 -1
  3. package/cjs/animate/config.js +1 -1
  4. package/cjs/application-state.d.ts +27 -0
  5. package/cjs/application-state.js +22 -0
  6. package/cjs/application-state.js.map +1 -0
  7. package/cjs/application.d.ts +2 -22
  8. package/cjs/application.js +24 -3
  9. package/cjs/application.js.map +1 -1
  10. package/cjs/common/contribution-provider.d.ts +2 -1
  11. package/cjs/common/contribution-provider.js +20 -2
  12. package/cjs/common/contribution-provider.js.map +1 -1
  13. package/cjs/common/contribution-store-state.d.ts +6 -0
  14. package/cjs/common/contribution-store-state.js +20 -0
  15. package/cjs/common/contribution-store-state.js.map +1 -0
  16. package/cjs/common/custom-path2d.js +1 -2
  17. package/cjs/common/module-guard.js +1 -1
  18. package/cjs/common/morphing-utils.js +1 -1
  19. package/cjs/common/path-svg.js +1 -1
  20. package/cjs/common/performance-raf.js +1 -1
  21. package/cjs/common/polygon.js +2 -2
  22. package/cjs/common/rect-utils.js +1 -1
  23. package/cjs/common/render-area.js +1 -1
  24. package/cjs/common/render-command-list.js +2 -1
  25. package/cjs/common/render-curve.js +1 -1
  26. package/cjs/common/render-utils.js +1 -1
  27. package/cjs/common/seg-context.js +1 -1
  28. package/cjs/common/simplify.js +1 -1
  29. package/cjs/common/sort.js +1 -1
  30. package/cjs/common/split-path.js +1 -1
  31. package/cjs/common/text.js +1 -1
  32. package/cjs/core/camera.js +1 -1
  33. package/cjs/core/constants.js +1 -1
  34. package/cjs/core/core-modules.js +1 -2
  35. package/cjs/core/global.js +1 -1
  36. package/cjs/core/graphic-utils.js +1 -1
  37. package/cjs/core/index.js +1 -1
  38. package/cjs/core/layer-service.js +1 -1
  39. package/cjs/core/layer.js +1 -1
  40. package/cjs/core/light.js +1 -1
  41. package/cjs/core/stage.js +1 -1
  42. package/cjs/core/window.js +1 -1
  43. package/cjs/entries/runtime-installer-state.d.ts +12 -0
  44. package/cjs/entries/runtime-installer-state.js +27 -0
  45. package/cjs/entries/runtime-installer-state.js.map +1 -0
  46. package/cjs/entries/runtime-installer.d.ts +3 -1
  47. package/cjs/entries/runtime-installer.js +23 -13
  48. package/cjs/entries/runtime-installer.js.map +1 -1
  49. package/cjs/factory-state.d.ts +5 -0
  50. package/cjs/factory-state.js +19 -0
  51. package/cjs/factory-state.js.map +1 -0
  52. package/cjs/factory.d.ts +2 -0
  53. package/cjs/factory.js +18 -2
  54. package/cjs/factory.js.map +1 -1
  55. package/cjs/graphic/graphic-creator.d.ts +2 -29
  56. package/cjs/graphic/graphic-creator.js +24 -38
  57. package/cjs/graphic/graphic-creator.js.map +1 -1
  58. package/cjs/graphic/graphic-registry.d.ts +36 -0
  59. package/cjs/graphic/graphic-registry.js +65 -0
  60. package/cjs/graphic/graphic-registry.js.map +1 -0
  61. package/cjs/graphic/graphic.d.ts +8 -1
  62. package/cjs/graphic/graphic.js +22 -7
  63. package/cjs/graphic/graphic.js.map +1 -1
  64. package/cjs/graphic/index.d.ts +2 -0
  65. package/cjs/graphic/index.js +29 -16
  66. package/cjs/graphic/index.js.map +1 -1
  67. package/cjs/legacy/bootstrap-state.d.ts +7 -0
  68. package/cjs/legacy/bootstrap-state.js +24 -0
  69. package/cjs/legacy/bootstrap-state.js.map +1 -0
  70. package/cjs/legacy/bootstrap.d.ts +3 -4
  71. package/cjs/legacy/bootstrap.js +20 -7
  72. package/cjs/legacy/bootstrap.js.map +1 -1
  73. package/dist/index.es.js +126 -25
  74. package/es/allocator/bounds-allocate.js +1 -2
  75. package/es/allocator/graphic-allocate.js +2 -1
  76. package/es/animate/config.js +1 -1
  77. package/es/application-state.d.ts +27 -0
  78. package/es/application-state.js +17 -0
  79. package/es/application-state.js.map +1 -0
  80. package/es/application.d.ts +2 -22
  81. package/es/application.js +2 -3
  82. package/es/application.js.map +1 -1
  83. package/es/common/contribution-provider.d.ts +2 -1
  84. package/es/common/contribution-provider.js +6 -1
  85. package/es/common/contribution-provider.js.map +1 -1
  86. package/es/common/contribution-store-state.d.ts +6 -0
  87. package/es/common/contribution-store-state.js +14 -0
  88. package/es/common/contribution-store-state.js.map +1 -0
  89. package/es/common/custom-path2d.js +1 -2
  90. package/es/common/module-guard.js +1 -1
  91. package/es/common/morphing-utils.js +1 -1
  92. package/es/common/path-svg.js +1 -1
  93. package/es/common/performance-raf.js +1 -1
  94. package/es/common/polygon.js +1 -1
  95. package/es/common/rect-utils.js +1 -1
  96. package/es/common/render-area.js +1 -1
  97. package/es/common/render-command-list.js +2 -1
  98. package/es/common/render-curve.js +1 -1
  99. package/es/common/render-utils.js +1 -1
  100. package/es/common/seg-context.js +1 -1
  101. package/es/common/simplify.js +1 -1
  102. package/es/common/sort.js +1 -1
  103. package/es/common/split-path.js +1 -1
  104. package/es/common/text.js +1 -1
  105. package/es/core/camera.js +1 -1
  106. package/es/core/constants.js +1 -1
  107. package/es/core/core-modules.js +1 -2
  108. package/es/core/global.js +1 -1
  109. package/es/core/graphic-utils.js +1 -1
  110. package/es/core/index.js +1 -1
  111. package/es/core/layer-service.js +1 -1
  112. package/es/core/layer.js +1 -1
  113. package/es/core/light.js +1 -1
  114. package/es/core/stage.js +1 -1
  115. package/es/core/window.js +1 -1
  116. package/es/entries/runtime-installer-state.d.ts +12 -0
  117. package/es/entries/runtime-installer-state.js +20 -0
  118. package/es/entries/runtime-installer-state.js.map +1 -0
  119. package/es/entries/runtime-installer.d.ts +3 -1
  120. package/es/entries/runtime-installer.js +8 -9
  121. package/es/entries/runtime-installer.js.map +1 -1
  122. package/es/factory-state.d.ts +5 -0
  123. package/es/factory-state.js +14 -0
  124. package/es/factory-state.js.map +1 -0
  125. package/es/factory.d.ts +2 -0
  126. package/es/factory.js +5 -1
  127. package/es/factory.js.map +1 -1
  128. package/es/graphic/graphic-creator.d.ts +2 -29
  129. package/es/graphic/graphic-creator.js +1 -41
  130. package/es/graphic/graphic-creator.js.map +1 -1
  131. package/es/graphic/graphic-registry.d.ts +36 -0
  132. package/es/graphic/graphic-registry.js +57 -0
  133. package/es/graphic/graphic-registry.js.map +1 -0
  134. package/es/graphic/graphic.d.ts +8 -1
  135. package/es/graphic/graphic.js +22 -3
  136. package/es/graphic/graphic.js.map +1 -1
  137. package/es/graphic/index.d.ts +2 -0
  138. package/es/graphic/index.js +2 -0
  139. package/es/graphic/index.js.map +1 -1
  140. package/es/legacy/bootstrap-state.d.ts +7 -0
  141. package/es/legacy/bootstrap-state.js +17 -0
  142. package/es/legacy/bootstrap-state.js.map +1 -0
  143. package/es/legacy/bootstrap.d.ts +3 -4
  144. package/es/legacy/bootstrap.js +5 -5
  145. package/es/legacy/bootstrap.js.map +1 -1
  146. package/package.json +11 -3
@@ -1,22 +1,2 @@
1
- import type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';
2
- import type { ICanvasFactory, IContext2dFactory, IGlobal, IGraphicService, ILayerHandlerContribution, IPickerService, IPluginService, IRenderService, IWindow, IWindowHandlerContribution, LayerMode } from './interface';
3
- import type { IDrawContribution } from './interface/render';
4
- export declare class Application {
5
- global: IGlobal;
6
- graphicUtil: IGraphicUtil;
7
- graphicService: IGraphicService;
8
- renderService: IRenderService;
9
- renderServiceFactory?: () => IRenderService;
10
- pluginService?: IPluginService;
11
- pluginServiceFactory?: () => IPluginService;
12
- pickerServiceFactory?: () => IPickerService;
13
- windowFactory?: () => IWindow;
14
- windowHandlerFactory?: (env: string) => IWindowHandlerContribution;
15
- layerHandlerFactory?: (layerMode: LayerMode) => ILayerHandlerContribution;
16
- incrementalDrawContributionFactory?: () => IDrawContribution;
17
- canvasFactory?: (env: string) => ICanvasFactory | undefined;
18
- context2dFactory?: (env: string) => IContext2dFactory | undefined;
19
- transformUtil: ITransformUtil;
20
- layerService: ILayerService;
21
- }
22
- export declare const application: Application;
1
+ export { application, Application, APPLICATION_STATE_SYMBOL, getApplicationState } from './application-state';
2
+ export type { IApplicationState } from './application-state';
package/es/application.js CHANGED
@@ -1,3 +1,2 @@
1
- export class Application {}
2
-
3
- export const application = new Application;
1
+ export { application, Application, APPLICATION_STATE_SYMBOL, getApplicationState } from "./application-state";
2
+ //# sourceMappingURL=application.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/application.ts"],"names":[],"mappings":"AAgBA,MAAM,OAAO,WAAW;CAiBvB;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","file":"application.js","sourcesContent":["import type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';\nimport type {\n ICanvasFactory,\n IContext2dFactory,\n IGlobal,\n IGraphicService,\n ILayerHandlerContribution,\n IPickerService,\n IPluginService,\n IRenderService,\n IWindow,\n IWindowHandlerContribution,\n LayerMode\n} from './interface';\nimport type { IDrawContribution } from './interface/render';\n\nexport class Application {\n global: IGlobal;\n graphicUtil: IGraphicUtil;\n graphicService: IGraphicService;\n renderService: IRenderService;\n renderServiceFactory?: () => IRenderService;\n pluginService?: IPluginService;\n pluginServiceFactory?: () => IPluginService;\n pickerServiceFactory?: () => IPickerService;\n windowFactory?: () => IWindow;\n windowHandlerFactory?: (env: string) => IWindowHandlerContribution;\n layerHandlerFactory?: (layerMode: LayerMode) => ILayerHandlerContribution;\n incrementalDrawContributionFactory?: () => IDrawContribution;\n canvasFactory?: (env: string) => ICanvasFactory | undefined;\n context2dFactory?: (env: string) => IContext2dFactory | undefined;\n transformUtil: ITransformUtil;\n layerService: ILayerService;\n}\n\nexport const application = new Application();\n"]}
1
+ {"version":3,"sources":["../src/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC","file":"application.js","sourcesContent":["export { application, Application, APPLICATION_STATE_SYMBOL, getApplicationState } from './application-state';\nexport type { IApplicationState } from './application-state';\n"]}
@@ -24,4 +24,5 @@ export declare class ContributionStore {
24
24
  static setStore(id: ServiceIdentifier<any>, cache: ContributionProviderCache<any>): void;
25
25
  static refreshAllContributions(): void;
26
26
  }
27
- export {};
27
+ export { CONTRIBUTION_STORE_STATE_SYMBOL, getContributionStoreState } from './contribution-store-state';
28
+ export type { IContributionStoreState } from './contribution-store-state';
@@ -1,3 +1,5 @@
1
+ import { getContributionStoreState } from "./contribution-store-state";
2
+
1
3
  export const ContributionProvider = Symbol("ContributionProvider");
2
4
 
3
5
  class ContributionProviderCache {
@@ -43,4 +45,7 @@ export class ContributionStore {
43
45
  }
44
46
  }
45
47
 
46
- ContributionStore.store = new Map;
48
+ ContributionStore.store = getContributionStoreState().store;
49
+
50
+ export { CONTRIBUTION_STORE_STATE_SYMBOL, getContributionStoreState } from "./contribution-store-state";
51
+ //# sourceMappingURL=contribution-provider.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common/contribution-provider.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAEnE,MAAM,yBAAyB;IAK7B,YACE,iBAAuC,EACvC,SAA+F;QAE/F,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,SAAS;gBACZ,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC;gBAC9C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CA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AAM,CAAC,QAAQ,CAAC,EAA0B,EAAE,KAAqC;QAC/E,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,IAAI,GAAG,EAAkC,CAAC;YACnD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;SAC5B;QACD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC1B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACrB,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;;AArBM,uBAAK,GAAqE,IAAI,GAAG,EAAE,CAAC","file":"contribution-provider.js","sourcesContent":["import type { IBindingResolver, ServiceIdentifier } from './explicit-binding';\nimport type { IContributionProvider } from '../interface';\n\nexport const ContributionProvider = Symbol('ContributionProvider');\n\nclass ContributionProviderCache<T> implements IContributionProvider<T> {\n protected caches?: T[];\n protected serviceIdentifier: ServiceIdentifier<T>;\n protected container: IBindingResolver & { isBound: (serviceIdentifier: ServiceIdentifier<T>) => boolean };\n\n constructor(\n serviceIdentifier: ServiceIdentifier<T>,\n container: IBindingResolver & { isBound: (serviceIdentifier: ServiceIdentifier<T>) => boolean }\n ) {\n this.serviceIdentifier = serviceIdentifier;\n this.container = container;\n ContributionStore.setStore(this.serviceIdentifier, this);\n }\n\n getContributions(): T[] {\n if (!this.caches) {\n this.caches = [];\n this.container &&\n this.container.isBound(this.serviceIdentifier) &&\n this.caches.push(...this.container.getAll(this.serviceIdentifier));\n }\n return this.caches;\n }\n\n refresh() {\n if (!this.caches) {\n return;\n }\n this.caches.length = 0;\n this.container &&\n this.container.isBound(this.serviceIdentifier) &&\n this.caches.push(...this.container.getAll(this.serviceIdentifier));\n }\n}\n\ntype IContributionProviderFactoryContext = {\n container: IBindingResolver & { isBound: (serviceIdentifier: ServiceIdentifier) => boolean };\n};\n\nexport function createContributionProvider<T>(\n serviceIdentifier: ServiceIdentifier<T>,\n container: IBindingResolver & { isBound: (serviceIdentifier: ServiceIdentifier<T>) => boolean }\n): IContributionProvider<T> {\n return new ContributionProviderCache(serviceIdentifier, container);\n}\n\nexport function bindContributionProvider(bind: any, id: ServiceIdentifier): void {\n bind(ContributionProvider)\n .toDynamicValue(({ container }: IContributionProviderFactoryContext) => createContributionProvider(id, container))\n .inSingletonScope()\n .whenTargetNamed(id);\n}\n\nexport function bindContributionProviderNoSingletonScope(bind: any, id: ServiceIdentifier): void {\n bind(ContributionProvider)\n .toDynamicValue(({ container }: IContributionProviderFactoryContext) => createContributionProvider(id, container))\n .whenTargetNamed(id);\n}\n\nexport class ContributionStore {\n static store: Map<ServiceIdentifier<any>, Set<ContributionProviderCache<any>>> = new Map();\n\n static getStore(id: ServiceIdentifier<any>): ContributionProviderCache<any> | undefined {\n return this.store.get(id)?.values().next().value;\n }\n\n static setStore(id: ServiceIdentifier<any>, cache: ContributionProviderCache<any>): void {\n let caches = this.store.get(id);\n if (!caches) {\n caches = new Set<ContributionProviderCache<any>>();\n this.store.set(id, caches);\n }\n caches.add(cache);\n }\n\n static refreshAllContributions(): void {\n this.store.forEach(caches => {\n caches.forEach(cache => {\n cache.refresh();\n });\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/common/contribution-provider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAEnE,MAAM,yBAAyB;IAK7B,YACE,iBAAuC,EACvC,SAA+F;QAE/F,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C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ACzB,CAAC;AAED,MAAM,UAAU,wCAAwC,CAAC,IAAS,EAAE,EAAqB;IACvF,IAAI,CAAC,oBAAoB,CAAC;SACvB,cAAc,CAAC,CAAC,EAAE,SAAS,EAAuC,EAAE,EAAE,CAAC,0BAA0B,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;SACjH,eAAe,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,OAAO,iBAAiB;IAG5B,MAAM,CAAC,QAAQ,CAAC,EAA0B;;QACxC,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,0CAAE,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC;IACnD,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,EAA0B,EAAE,KAAqC;QAC/E,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,IAAI,GAAG,EAAkC,CAAC;YACnD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;SAC5B;QACD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC1B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACrB,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;;AArBM,uBAAK,GAAG,yBAAyB,EAAE,CAAC,KAAyE,CAAC;AAwBvH,OAAO,EAAE,+BAA+B,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC","file":"contribution-provider.js","sourcesContent":["import type { IBindingResolver, ServiceIdentifier } from './explicit-binding';\nimport type { IContributionProvider } from '../interface';\nimport { getContributionStoreState } from './contribution-store-state';\n\nexport const ContributionProvider = Symbol('ContributionProvider');\n\nclass ContributionProviderCache<T> implements IContributionProvider<T> {\n protected caches?: T[];\n protected serviceIdentifier: ServiceIdentifier<T>;\n protected container: IBindingResolver & { isBound: (serviceIdentifier: ServiceIdentifier<T>) => boolean };\n\n constructor(\n serviceIdentifier: ServiceIdentifier<T>,\n container: IBindingResolver & { isBound: (serviceIdentifier: ServiceIdentifier<T>) => boolean }\n ) {\n this.serviceIdentifier = serviceIdentifier;\n this.container = container;\n ContributionStore.setStore(this.serviceIdentifier, this);\n }\n\n getContributions(): T[] {\n if (!this.caches) {\n this.caches = [];\n this.container &&\n this.container.isBound(this.serviceIdentifier) &&\n this.caches.push(...this.container.getAll(this.serviceIdentifier));\n }\n return this.caches;\n }\n\n refresh() {\n if (!this.caches) {\n return;\n }\n this.caches.length = 0;\n this.container &&\n this.container.isBound(this.serviceIdentifier) &&\n this.caches.push(...this.container.getAll(this.serviceIdentifier));\n }\n}\n\ntype IContributionProviderFactoryContext = {\n container: IBindingResolver & { isBound: (serviceIdentifier: ServiceIdentifier) => boolean };\n};\n\nexport function createContributionProvider<T>(\n serviceIdentifier: ServiceIdentifier<T>,\n container: IBindingResolver & { isBound: (serviceIdentifier: ServiceIdentifier<T>) => boolean }\n): IContributionProvider<T> {\n return new ContributionProviderCache(serviceIdentifier, container);\n}\n\nexport function bindContributionProvider(bind: any, id: ServiceIdentifier): void {\n bind(ContributionProvider)\n .toDynamicValue(({ container }: IContributionProviderFactoryContext) => createContributionProvider(id, container))\n .inSingletonScope()\n .whenTargetNamed(id);\n}\n\nexport function bindContributionProviderNoSingletonScope(bind: any, id: ServiceIdentifier): void {\n bind(ContributionProvider)\n .toDynamicValue(({ container }: IContributionProviderFactoryContext) => createContributionProvider(id, container))\n .whenTargetNamed(id);\n}\n\nexport class ContributionStore {\n static store = getContributionStoreState().store as Map<ServiceIdentifier<any>, Set<ContributionProviderCache<any>>>;\n\n static getStore(id: ServiceIdentifier<any>): ContributionProviderCache<any> | undefined {\n return this.store.get(id)?.values().next().value;\n }\n\n static setStore(id: ServiceIdentifier<any>, cache: ContributionProviderCache<any>): void {\n let caches = this.store.get(id);\n if (!caches) {\n caches = new Set<ContributionProviderCache<any>>();\n this.store.set(id, caches);\n }\n caches.add(cache);\n }\n\n static refreshAllContributions(): void {\n this.store.forEach(caches => {\n caches.forEach(cache => {\n cache.refresh();\n });\n });\n }\n}\n\nexport { CONTRIBUTION_STORE_STATE_SYMBOL, getContributionStoreState } from './contribution-store-state';\nexport type { IContributionStoreState } from './contribution-store-state';\n"]}
@@ -0,0 +1,6 @@
1
+ import type { ServiceIdentifier } from './explicit-binding';
2
+ export declare const CONTRIBUTION_STORE_STATE_SYMBOL: unique symbol;
3
+ export interface IContributionStoreState<T = any> {
4
+ store: Map<ServiceIdentifier<T>, Set<T>>;
5
+ }
6
+ export declare function getContributionStoreState(): IContributionStoreState;
@@ -0,0 +1,14 @@
1
+ export const CONTRIBUTION_STORE_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/contribution-store-state");
2
+
3
+ function createContributionStoreState() {
4
+ return {
5
+ store: new Map
6
+ };
7
+ }
8
+
9
+ export function getContributionStoreState() {
10
+ const scope = globalThis;
11
+ return scope[CONTRIBUTION_STORE_STATE_SYMBOL] || (scope[CONTRIBUTION_STORE_STATE_SYMBOL] = createContributionStoreState()),
12
+ scope[CONTRIBUTION_STORE_STATE_SYMBOL];
13
+ }
14
+ //# sourceMappingURL=contribution-store-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/common/contribution-store-state.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;AAM7G,SAAS,4BAA4B;IACnC,OAAO;QACL,KAAK,EAAE,IAAI,GAAG,EAAE;KACjB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,MAAM,KAAK,GAAG,UAAiG,CAAC;IAEhH,IAAI,CAAC,KAAK,CAAC,+BAA+B,CAAC,EAAE;QAC3C,KAAK,CAAC,+BAA+B,CAAC,GAAG,4BAA4B,EAAE,CAAC;KACzE;IAED,OAAO,KAAK,CAAC,+BAA+B,CAA4B,CAAC;AAC3E,CAAC","file":"contribution-store-state.js","sourcesContent":["import type { ServiceIdentifier } from './explicit-binding';\n\nexport const CONTRIBUTION_STORE_STATE_SYMBOL = Symbol.for('@visactor/vrender-core/contribution-store-state');\n\nexport interface IContributionStoreState<T = any> {\n store: Map<ServiceIdentifier<T>, Set<T>>;\n}\n\nfunction createContributionStoreState(): IContributionStoreState {\n return {\n store: new Map()\n };\n}\n\nexport function getContributionStoreState(): IContributionStoreState {\n const scope = globalThis as typeof globalThis & { [CONTRIBUTION_STORE_STATE_SYMBOL]?: IContributionStoreState };\n\n if (!scope[CONTRIBUTION_STORE_STATE_SYMBOL]) {\n scope[CONTRIBUTION_STORE_STATE_SYMBOL] = createContributionStoreState();\n }\n\n return scope[CONTRIBUTION_STORE_STATE_SYMBOL] as IContributionStoreState;\n}\n"]}
@@ -372,5 +372,4 @@ function scale(current, sX, sY) {
372
372
  temp[3] = current[3], temp[4] = current[4], temp[5] = current[5], temp[6] = sX * current[6],
373
373
  temp[7] = sY * current[7]; else if ("h" === c || "H" === c) temp[1] = sX * current[1]; else if ("v" === c || "V" === c) temp[1] = sY * current[1]; else for (let i = 1, n = current.length; i < n; ++i) temp[i] = (i % 2 == 1 ? sX : sY) * current[i];
374
374
  return temp;
375
- }
376
- //# sourceMappingURL=custom-path2d.js.map
375
+ }
@@ -2,4 +2,4 @@ export function isBindingContextLoaded(loadedContexts, context) {
2
2
  const key = "object" == typeof context && null !== context || "function" == typeof context ? context : loadedContexts;
3
3
  return !!loadedContexts.has(key) || (loadedContexts.add(key), !1);
4
4
  }
5
- //# sourceMappingURL=module-guard.js.map
5
+ //# sourceMappingURL=module-guard.js.map
@@ -189,4 +189,4 @@ export function bezierCurversToPath(bezierCurves) {
189
189
  }
190
190
  return path;
191
191
  }
192
- //# sourceMappingURL=morphing-utils.js.map
192
+ //# sourceMappingURL=morphing-utils.js.map
@@ -55,4 +55,4 @@ export function parseSvgPath(str) {
55
55
  } else result.push(currCommandData);
56
56
  return result;
57
57
  }
58
- //# sourceMappingURL=path-svg.js.map
58
+ //# sourceMappingURL=path-svg.js.map
@@ -26,4 +26,4 @@ export class PerformanceRAF {
26
26
  }));
27
27
  }
28
28
  }
29
- //# sourceMappingURL=performance-raf.js.map
29
+ //# sourceMappingURL=performance-raf.js.map
@@ -38,4 +38,4 @@ function getProportionPoint(point, segment, length, dx, dy) {
38
38
  y: point.y - dy * factor
39
39
  };
40
40
  }
41
- //# sourceMappingURL=polygon.js.map
41
+ //# sourceMappingURL=polygon.js.map
@@ -17,4 +17,4 @@ export const normalizeRectAttributes = attribute => {
17
17
  height: height
18
18
  };
19
19
  };
20
- //# sourceMappingURL=rect-utils.js.map
20
+ //# sourceMappingURL=rect-utils.js.map
@@ -61,4 +61,4 @@ function drawAreaBlock(path, topList, bottomList, params) {
61
61
  }
62
62
  path.closePath();
63
63
  }
64
- //# sourceMappingURL=render-area.js.map
64
+ //# sourceMappingURL=render-area.js.map
@@ -5,4 +5,5 @@ export function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy
5
5
  const command = commandList[i];
6
6
  commandFuncs[command[0]](command, context, x, y, sx, sy, z);
7
7
  }
8
- }
8
+ }
9
+ //# sourceMappingURL=render-command-list.js.map
@@ -93,4 +93,4 @@ export function drawIncrementalAreaSegments(path, lastSeg, segments, params) {
93
93
  path.closePath();
94
94
  }));
95
95
  }
96
- //# sourceMappingURL=render-curve.js.map
96
+ //# sourceMappingURL=render-curve.js.map
@@ -11,4 +11,4 @@ export function drawSegItem(ctx, curve, endPercent, params) {
11
11
  ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
12
12
  }
13
13
  }
14
- //# sourceMappingURL=render-utils.js.map
14
+ //# sourceMappingURL=render-utils.js.map
@@ -91,4 +91,4 @@ export class ReflectSegContext extends SegContext {
91
91
  return super.clear();
92
92
  }
93
93
  }
94
- //# sourceMappingURL=seg-context.js.map
94
+ //# sourceMappingURL=seg-context.js.map
@@ -30,4 +30,4 @@ export function flatten_simplify(points, tolerance, highestQuality) {
30
30
  if (points.length <= 10) return points;
31
31
  return points = highestQuality ? points : simplifyRadialDist(points, void 0 !== tolerance ? tolerance * tolerance : 1);
32
32
  }
33
- //# sourceMappingURL=simplify.js.map
33
+ //# sourceMappingURL=simplify.js.map
package/es/common/sort.js CHANGED
@@ -94,4 +94,4 @@ export function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
94
94
  !1)), reverse);
95
95
  return result;
96
96
  }
97
- //# sourceMappingURL=sort.js.map
97
+ //# sourceMappingURL=sort.js.map
@@ -248,4 +248,4 @@ export const splitPath = (path, count) => {
248
248
  }
249
249
  return res;
250
250
  };
251
- //# sourceMappingURL=split-path.js.map
251
+ //# sourceMappingURL=split-path.js.map
package/es/common/text.js CHANGED
@@ -24,4 +24,4 @@ export function textAttributesToStyle(attrs) {
24
24
  attrs.underline ? style["text-decoration"] = "underline" : attrs.lineThrough && (style["text-decoration"] = "line-through"),
25
25
  attrs.fill && isString(attrs.fill) && (style.color = attrs.fill), style;
26
26
  }
27
- //# sourceMappingURL=text.js.map
27
+ //# sourceMappingURL=text.js.map
package/es/core/camera.js CHANGED
@@ -66,4 +66,4 @@ export class OrthoCamera {
66
66
  export const registerOrthoCamera = () => {
67
67
  Factory.registerPlugin("OrthoCamera", OrthoCamera);
68
68
  };
69
- //# sourceMappingURL=camera.js.map
69
+ //# sourceMappingURL=camera.js.map
@@ -9,4 +9,4 @@ export const StaticLayerHandlerContribution = Symbol.for("StaticLayerHandlerCont
9
9
  export const DynamicLayerHandlerContribution = Symbol.for("DynamicLayerHandlerContribution");
10
10
 
11
11
  export const VirtualLayerHandlerContribution = Symbol.for("VirtualLayerHandlerContribution");
12
- //# sourceMappingURL=constants.js.map
12
+ //# sourceMappingURL=constants.js.map
@@ -20,5 +20,4 @@ export function bindCoreModules({bind: bind}) {
20
20
  bind(TransformUtil).to(DefaultTransformUtil).inSingletonScope(), bind(LayerService).to(DefaultLayerService).inSingletonScope();
21
21
  }
22
22
 
23
- export default bindCoreModules;
24
- //# sourceMappingURL=core-modules.js.map
23
+ export default bindCoreModules;
package/es/core/global.js CHANGED
@@ -222,4 +222,4 @@ export class DefaultGlobal extends EventListenerManager {
222
222
  return this._env || this.setEnv("browser"), this.envContribution.copyToClipBoard(text);
223
223
  }
224
224
  }
225
- //# sourceMappingURL=global.js.map
225
+ //# sourceMappingURL=global.js.map
@@ -162,4 +162,4 @@ export class DefaultTransformUtil {
162
162
  return this;
163
163
  }
164
164
  }
165
- //# sourceMappingURL=graphic-utils.js.map
165
+ //# sourceMappingURL=graphic-utils.js.map
package/es/core/index.js CHANGED
@@ -15,4 +15,4 @@ export * from "./layer-service";
15
15
  export * from "./constants";
16
16
 
17
17
  export * from "../interface/core";
18
- //# sourceMappingURL=index.js.map
18
+ //# sourceMappingURL=index.js.map
@@ -76,4 +76,4 @@ export class DefaultLayerService {
76
76
  }
77
77
 
78
78
  DefaultLayerService.idprefix = "visactor_layer", DefaultLayerService.prefix_count = 0;
79
- //# sourceMappingURL=layer-service.js.map
79
+ //# sourceMappingURL=layer-service.js.map
package/es/core/layer.js CHANGED
@@ -112,4 +112,4 @@ export class Layer extends Group {
112
112
  }, params)), this.afterDrawCbs.forEach((c => c(this)));
113
113
  }
114
114
  }
115
- //# sourceMappingURL=layer.js.map
115
+ //# sourceMappingURL=layer.js.map
package/es/core/light.js CHANGED
@@ -23,4 +23,4 @@ export class DirectionalLight {
23
23
  export const registerDirectionalLight = () => {
24
24
  Factory.registerPlugin("DirectionalLight", DirectionalLight);
25
25
  };
26
- //# sourceMappingURL=light.js.map
26
+ //# sourceMappingURL=light.js.map
package/es/core/stage.js CHANGED
@@ -595,4 +595,4 @@ export class Stage extends Group {
595
595
  this.renderService.reInit(), this.pickerService.reInit();
596
596
  }
597
597
  }
598
- //# sourceMappingURL=stage.js.map
598
+ //# sourceMappingURL=stage.js.map
package/es/core/window.js CHANGED
@@ -150,4 +150,4 @@ export class DefaultWindow extends EventListenerManager {
150
150
  return this._handler.getTopLeft(baseWindow);
151
151
  }
152
152
  }
153
- //# sourceMappingURL=window.js.map
153
+ //# sourceMappingURL=window.js.map
@@ -0,0 +1,12 @@
1
+ import type { IGlobal, IDrawItemInterceptorContribution } from '../interface';
2
+ import { type ILegacyBindingContext } from '../legacy/binding-context';
3
+ export declare const RUNTIME_INSTALLER_STATE_SYMBOL: unique symbol;
4
+ export interface IRuntimeInstallerState {
5
+ runtimeInstallerContext: ILegacyBindingContext;
6
+ preloaded: boolean;
7
+ runtimeGlobal?: IGlobal;
8
+ runtimeEntryKeys: WeakMap<object, Map<string, Set<string>>>;
9
+ runtimeDrawContributions: WeakMap<object, Set<IDrawItemInterceptorContribution>>;
10
+ loadedRuntimeContributionModules: WeakMap<object, WeakSet<object>>;
11
+ }
12
+ export declare function getRuntimeInstallerState(): IRuntimeInstallerState;
@@ -0,0 +1,20 @@
1
+ import { createLegacyBindingContext } from "../legacy/binding-context";
2
+
3
+ export const RUNTIME_INSTALLER_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/runtime-installer-state");
4
+
5
+ function createRuntimeInstallerState() {
6
+ return {
7
+ runtimeInstallerContext: createLegacyBindingContext(),
8
+ preloaded: !1,
9
+ runtimeEntryKeys: new WeakMap,
10
+ runtimeDrawContributions: new WeakMap,
11
+ loadedRuntimeContributionModules: new WeakMap
12
+ };
13
+ }
14
+
15
+ export function getRuntimeInstallerState() {
16
+ const scope = globalThis;
17
+ return scope[RUNTIME_INSTALLER_STATE_SYMBOL] || (scope[RUNTIME_INSTALLER_STATE_SYMBOL] = createRuntimeInstallerState()),
18
+ scope[RUNTIME_INSTALLER_STATE_SYMBOL];
19
+ }
20
+ //# sourceMappingURL=runtime-installer-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/entries/runtime-installer-state.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAA8B,MAAM,2BAA2B,CAAC;AAEnG,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;AAW3G,SAAS,2BAA2B;IAClC,OAAO;QACL,uBAAuB,EAAE,0BAA0B,EAAE;QACrD,SAAS,EAAE,KAAK;QAChB,gBAAgB,EAAE,IAAI,OAAO,EAAoC;QACjE,wBAAwB,EAAE,IAAI,OAAO,EAAiD;QACtF,gCAAgC,EAAE,IAAI,OAAO,EAA2B;KACzE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,MAAM,KAAK,GAAG,UAA+F,CAAC;IAE9G,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,EAAE;QAC1C,KAAK,CAAC,8BAA8B,CAAC,GAAG,2BAA2B,EAAE,CAAC;KACvE;IAED,OAAO,KAAK,CAAC,8BAA8B,CAA2B,CAAC;AACzE,CAAC","file":"runtime-installer-state.js","sourcesContent":["import type { IGlobal, IDrawItemInterceptorContribution } from '../interface';\nimport { createLegacyBindingContext, type ILegacyBindingContext } from '../legacy/binding-context';\n\nexport const RUNTIME_INSTALLER_STATE_SYMBOL = Symbol.for('@visactor/vrender-core/runtime-installer-state');\n\nexport interface IRuntimeInstallerState {\n runtimeInstallerContext: ILegacyBindingContext;\n preloaded: boolean;\n runtimeGlobal?: IGlobal;\n runtimeEntryKeys: WeakMap<object, Map<string, Set<string>>>;\n runtimeDrawContributions: WeakMap<object, Set<IDrawItemInterceptorContribution>>;\n loadedRuntimeContributionModules: WeakMap<object, WeakSet<object>>;\n}\n\nfunction createRuntimeInstallerState(): IRuntimeInstallerState {\n return {\n runtimeInstallerContext: createLegacyBindingContext(),\n preloaded: false,\n runtimeEntryKeys: new WeakMap<object, Map<string, Set<string>>>(),\n runtimeDrawContributions: new WeakMap<object, Set<IDrawItemInterceptorContribution>>(),\n loadedRuntimeContributionModules: new WeakMap<object, WeakSet<object>>()\n };\n}\n\nexport function getRuntimeInstallerState(): IRuntimeInstallerState {\n const scope = globalThis as typeof globalThis & { [RUNTIME_INSTALLER_STATE_SYMBOL]?: IRuntimeInstallerState };\n\n if (!scope[RUNTIME_INSTALLER_STATE_SYMBOL]) {\n scope[RUNTIME_INSTALLER_STATE_SYMBOL] = createRuntimeInstallerState();\n }\n\n return scope[RUNTIME_INSTALLER_STATE_SYMBOL] as IRuntimeInstallerState;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { IGlobal, IGraphicPicker } from '../interface';
2
2
  import type { IApp } from './types';
3
3
  import type { ServiceIdentifier } from '../common/explicit-binding';
4
- import { type ILegacyBindingContext } from '../legacy/binding-context';
4
+ import type { ILegacyBindingContext } from '../legacy/binding-context';
5
5
  export type TRuntimeContributionModuleRegistry = (bind: ILegacyBindingContext['bind'], unbind: (serviceIdentifier: ServiceIdentifier) => void, isBound: ILegacyBindingContext['isBound'], rebind: ILegacyBindingContext['rebind']) => void;
6
6
  export type TRuntimeContributionModule = ((context: ILegacyBindingContext) => void) | {
7
7
  registry: TRuntimeContributionModuleRegistry;
@@ -18,6 +18,8 @@ export declare function getRuntimeInstallerBindingContext(): ILegacyBindingConte
18
18
  export declare function refreshRuntimeInstallerContributions(): void;
19
19
  export declare function getRuntimeInstallerGlobal(): IGlobal;
20
20
  export declare function configureRuntimeApplicationForApp(app: IApp): void;
21
+ export { RUNTIME_INSTALLER_STATE_SYMBOL, getRuntimeInstallerState } from './runtime-installer-state';
22
+ export type { IRuntimeInstallerState } from './runtime-installer-state';
21
23
  export declare function installRuntimeGraphicRenderersToApp(app: IApp): void;
22
24
  export declare function installRuntimeDrawContributionsToApp(app: IApp): void;
23
25
  export declare function installRuntimePickersToApp<T extends IGraphicPicker>(app: IApp, serviceIdentifier: ServiceIdentifier<T>): void;
@@ -16,8 +16,6 @@ import coreModule from "../core/core-modules";
16
16
 
17
17
  import graphicModule from "../graphic/graphic-service/graphic-module";
18
18
 
19
- import { createLegacyBindingContext } from "../legacy/binding-context";
20
-
21
19
  import { getLegacyBindingContext, preLoadAllModule } from "../legacy/bootstrap";
22
20
 
23
21
  import pickModule from "../picker/pick-modules";
@@ -42,14 +40,12 @@ import { AutoEnablePlugins } from "../plugins/constants";
42
40
 
43
41
  import { DefaultPluginService } from "../plugins/plugin-service";
44
42
 
45
- const runtimeInstallerContext = createLegacyBindingContext();
46
-
47
- let runtimeGlobal, runtimeInstallerPreloaded = !1;
43
+ import { getRuntimeInstallerState } from "./runtime-installer-state";
48
44
 
49
- const RUNTIME_RENDERER_NAMESPACE = "vrender:runtime-renderer", RUNTIME_PICKER_NAMESPACE = "vrender:runtime-picker", runtimeEntryKeys = new WeakMap, runtimeDrawContributions = new WeakMap, loadedRuntimeContributionModules = new WeakMap, DEFAULT_RUNTIME_CONTRIBUTION_TARGETS = [ "graphic-renderer" ], noopUnbindRuntimeContributionService = () => {};
45
+ const runtimeInstallerState = getRuntimeInstallerState(), runtimeInstallerContext = runtimeInstallerState.runtimeInstallerContext, RUNTIME_RENDERER_NAMESPACE = "vrender:runtime-renderer", RUNTIME_PICKER_NAMESPACE = "vrender:runtime-picker", runtimeEntryKeys = runtimeInstallerState.runtimeEntryKeys, runtimeDrawContributions = runtimeInstallerState.runtimeDrawContributions, loadedRuntimeContributionModules = runtimeInstallerState.loadedRuntimeContributionModules, DEFAULT_RUNTIME_CONTRIBUTION_TARGETS = [ "graphic-renderer" ], noopUnbindRuntimeContributionService = () => {};
50
46
 
51
47
  function ensureRuntimeInstallerPreloaded() {
52
- runtimeInstallerPreloaded || (runtimeInstallerPreloaded = !0, coreModule({
48
+ runtimeInstallerState.preloaded || (runtimeInstallerState.preloaded = !0, coreModule({
53
49
  bind: runtimeInstallerContext.bind
54
50
  }), graphicModule({
55
51
  bind: runtimeInstallerContext.bind
@@ -102,8 +98,9 @@ export function refreshRuntimeInstallerContributions() {
102
98
  }
103
99
 
104
100
  export function getRuntimeInstallerGlobal() {
105
- return ensureRuntimeInstallerPreloaded(), null != runtimeGlobal || (runtimeGlobal = new DefaultGlobal(createContributionProvider(EnvContribution, runtimeInstallerContext))),
106
- runtimeGlobal;
101
+ var _a;
102
+ return ensureRuntimeInstallerPreloaded(), null !== (_a = runtimeInstallerState.runtimeGlobal) && void 0 !== _a || (runtimeInstallerState.runtimeGlobal = new DefaultGlobal(createContributionProvider(EnvContribution, runtimeInstallerContext))),
103
+ runtimeInstallerState.runtimeGlobal;
107
104
  }
108
105
 
109
106
  export function configureRuntimeApplicationForApp(app) {
@@ -117,6 +114,8 @@ export function configureRuntimeApplicationForApp(app) {
117
114
  }), application.incrementalDrawContributionFactory = () => new DefaultIncrementalDrawContribution([], new DefaultIncrementalCanvasLineRender, new DefaultIncrementalCanvasAreaRender(createContributionProvider(AreaRenderContribution, bindingContext)), createAppRegistryContributionProvider(app, DrawItemInterceptor));
118
115
  }
119
116
 
117
+ export { RUNTIME_INSTALLER_STATE_SYMBOL, getRuntimeInstallerState } from "./runtime-installer-state";
118
+
120
119
  export function installRuntimeGraphicRenderersToApp(app) {
121
120
  var _a;
122
121
  const bindingContext = getRuntimeInstallerBindingContext();
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/entries/runtime-installer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,UAAU,MAAM,sBAAsB,CA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IAE/D,IAAI,MAAM,EAAE;QACV,gBAAgB,EAAE,CAAC;QACnB,sCAAsC,CAAC,uBAAuB,EAAE,EAAE,MAAM,CAAC,CAAC;KAC3E;IAED,oCAAoC,EAAE,CAAC;IAEvC,IAAI,GAAG,EAAE;QACP,sCAAsC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACtD;AACH,CAAC","file":"runtime-installer.js","sourcesContent":["import type {\n IContributionProvider,\n IAreaRenderContribution,\n IDrawItemInterceptorContribution,\n IEnvContribution,\n IGlobal,\n IGraphicPicker,\n IPlugin\n} from '../interface';\nimport type { IApp } from './types';\nimport { application } from '../application';\nimport { CanvasFactory, Context2dFactory } from '../canvas/constants';\nimport { ContributionStore, createContributionProvider } from '../common/contribution-provider';\nimport type { ServiceIdentifier } from '../common/explicit-binding';\nimport { EnvContribution } from '../constants';\nimport loadBuiltinContributions from '../core/contributions/modules';\nimport { DefaultGlobal } from '../core/global';\nimport { WindowHandlerContribution, DefaultWindow } from '../core/window';\nimport coreModule from '../core/core-modules';\nimport graphicModule from '../graphic/graphic-service/graphic-module';\nimport { createLegacyBindingContext, type ILegacyBindingContext } from '../legacy/binding-context';\nimport { getLegacyBindingContext, preLoadAllModule } from '../legacy/bootstrap';\nimport pickModule from '../picker/pick-modules';\nimport { AreaRenderContribution } from '../render/contributions/render/contributions/constants';\nimport { DrawItemInterceptor } from '../render/contributions/render/draw-interceptor';\nimport { DefaultIncrementalCanvasAreaRender } from '../render/contributions/render/incremental-area-render';\nimport { DefaultIncrementalDrawContribution } from '../render/contributions/render/incremental-draw-contribution';\nimport { DefaultIncrementalCanvasLineRender } from '../render/contributions/render/incremental-line-render';\nimport renderModule from '../render/render-modules';\nimport { GraphicRender } from '../render/contributions/render/symbol';\nimport loadRenderContributions from '../render/contributions/modules';\nimport { AutoEnablePlugins } from '../plugins/constants';\nimport { DefaultPluginService } from '../plugins/plugin-service';\n\nexport type TRuntimeContributionModuleRegistry = (\n bind: ILegacyBindingContext['bind'],\n unbind: (serviceIdentifier: ServiceIdentifier) => void,\n isBound: ILegacyBindingContext['isBound'],\n rebind: ILegacyBindingContext['rebind']\n) => void;\n\nexport type TRuntimeContributionModule =\n | ((context: ILegacyBindingContext) => void)\n | {\n registry: TRuntimeContributionModuleRegistry;\n };\n\nexport type TRuntimeContributionInstallTarget =\n | 'graphic-renderer'\n | 'draw-contribution'\n | {\n picker: ServiceIdentifier<IGraphicPicker>;\n };\n\nexport interface IRuntimeContributionModuleInstallOptions {\n app?: IApp;\n legacy?: boolean;\n targets?: TRuntimeContributionInstallTarget[];\n}\n\nconst runtimeInstallerContext = createLegacyBindingContext();\nlet runtimeInstallerPreloaded = false;\nlet runtimeGlobal: IGlobal | undefined;\nconst RUNTIME_RENDERER_NAMESPACE = 'vrender:runtime-renderer';\nconst RUNTIME_PICKER_NAMESPACE = 'vrender:runtime-picker';\nconst runtimeEntryKeys = new WeakMap<object, Map<string, Set<string>>>();\nconst runtimeDrawContributions = new WeakMap<object, Set<IDrawItemInterceptorContribution>>();\nconst loadedRuntimeContributionModules = new WeakMap<object, WeakSet<object>>();\nconst DEFAULT_RUNTIME_CONTRIBUTION_TARGETS: TRuntimeContributionInstallTarget[] = ['graphic-renderer'];\nconst noopUnbindRuntimeContributionService = (): void => undefined;\n\nfunction ensureRuntimeInstallerPreloaded(): void {\n if (runtimeInstallerPreloaded) {\n return;\n }\n\n runtimeInstallerPreloaded = true;\n coreModule({ bind: runtimeInstallerContext.bind });\n graphicModule({ bind: runtimeInstallerContext.bind });\n renderModule({ bind: runtimeInstallerContext.bind });\n pickModule({ bind: runtimeInstallerContext.bind, isBound: runtimeInstallerContext.isBound });\n loadBuiltinContributions(runtimeInstallerContext);\n loadRenderContributions(runtimeInstallerContext);\n}\n\nfunction resolveRuntimeNamed<T>(serviceIdentifier: ServiceIdentifier<T>, name: string): T {\n const bindingContext = getRuntimeInstallerBindingContext();\n const instance = bindingContext.getNamed(serviceIdentifier, name);\n\n if (instance == null) {\n throw new Error(`${String(serviceIdentifier)} is not configured for ${name}`);\n }\n\n return instance;\n}\n\nfunction registerRuntimeEntries<T extends { type?: string }>(\n register: (key: string, value: T) => void,\n entries: T[],\n prefix: string\n): void {\n entries.forEach((entry, index) => {\n const name = entry?.type ?? entry?.constructor?.name ?? `${prefix}-entry`;\n register(`${prefix}:${String(name)}:${index}`, entry);\n });\n}\n\nfunction getTrackedEntryKeys(registry: object, namespace: string): Set<string> {\n let namespaces = runtimeEntryKeys.get(registry);\n if (!namespaces) {\n namespaces = new Map();\n runtimeEntryKeys.set(registry, namespaces);\n }\n\n let keys = namespaces.get(namespace);\n if (!keys) {\n keys = new Set();\n namespaces.set(namespace, keys);\n }\n\n return keys;\n}\n\nfunction clearTrackedEntryKeys(registry: object, namespace: string, unregister?: (key: string) => void): void {\n const keys = getTrackedEntryKeys(registry, namespace);\n if (unregister) {\n keys.forEach(key => unregister(key));\n }\n keys.clear();\n}\n\nfunction createAppRegistryContributionProvider<T>(app: IApp, key: ServiceIdentifier<T>): IContributionProvider<T> {\n return {\n getContributions: () => app.context.registry.contribution.get(key as any) as T[]\n };\n}\n\nexport function getRuntimeInstallerBindingContext(): ILegacyBindingContext {\n ensureRuntimeInstallerPreloaded();\n return runtimeInstallerContext;\n}\n\nexport function refreshRuntimeInstallerContributions(): void {\n ContributionStore.refreshAllContributions();\n}\n\nexport function getRuntimeInstallerGlobal(): IGlobal {\n ensureRuntimeInstallerPreloaded();\n runtimeGlobal ??= new DefaultGlobal(\n createContributionProvider<IEnvContribution>(EnvContribution, runtimeInstallerContext)\n );\n return runtimeGlobal;\n}\n\nexport function configureRuntimeApplicationForApp(app: IApp): void {\n const bindingContext = getRuntimeInstallerBindingContext();\n const global = getRuntimeInstallerGlobal();\n\n application.global = global;\n application.canvasFactory = env => bindingContext.getNamed(CanvasFactory, env);\n application.context2dFactory = env => bindingContext.getNamed(Context2dFactory, env);\n application.windowHandlerFactory = env => resolveRuntimeNamed(WindowHandlerContribution, env);\n application.windowFactory = () =>\n new DefaultWindow(global, env => resolveRuntimeNamed(WindowHandlerContribution, env));\n application.pluginServiceFactory = () =>\n new DefaultPluginService(createContributionProvider<IPlugin>(AutoEnablePlugins, bindingContext), {\n pluginRegistry: app.context.registry.plugin as any\n });\n application.incrementalDrawContributionFactory = () =>\n new DefaultIncrementalDrawContribution(\n [],\n new DefaultIncrementalCanvasLineRender(),\n new DefaultIncrementalCanvasAreaRender(\n createContributionProvider<IAreaRenderContribution>(AreaRenderContribution, bindingContext)\n ),\n createAppRegistryContributionProvider<IDrawItemInterceptorContribution>(app, DrawItemInterceptor)\n );\n}\n\nexport function installRuntimeGraphicRenderersToApp(app: IApp): void {\n const bindingContext = getRuntimeInstallerBindingContext();\n refreshRuntimeInstallerContributions();\n const renderers = bindingContext.getAll(GraphicRender);\n const registeredKeys = getTrackedEntryKeys(app.registry.renderer as object, RUNTIME_RENDERER_NAMESPACE);\n\n clearTrackedEntryKeys(\n app.registry.renderer as object,\n RUNTIME_RENDERER_NAMESPACE,\n app.registry.renderer.unregister?.bind(app.registry.renderer)\n );\n\n registerRuntimeEntries(\n (key, renderer) => {\n renderer?.reInit?.();\n app.registry.renderer.register(key, renderer);\n registeredKeys.add(key);\n },\n renderers as any[],\n RUNTIME_RENDERER_NAMESPACE\n );\n}\n\nexport function installRuntimeDrawContributionsToApp(app: IApp): void {\n const bindingContext = getRuntimeInstallerBindingContext();\n refreshRuntimeInstallerContributions();\n const contributions = bindingContext.getAll(DrawItemInterceptor) as IDrawItemInterceptorContribution[];\n const tracked =\n runtimeDrawContributions.get(app.context.registry.contribution as object) ??\n new Set<IDrawItemInterceptorContribution>();\n tracked.forEach(contribution => {\n app.context.registry.contribution.unregister?.(DrawItemInterceptor, contribution);\n });\n tracked.clear();\n runtimeDrawContributions.set(app.context.registry.contribution as object, tracked);\n const registered = new Set(app.context.registry.contribution.get(DrawItemInterceptor));\n\n contributions.forEach(contribution => {\n if (!registered.has(contribution)) {\n app.context.registry.contribution.register(DrawItemInterceptor, contribution);\n registered.add(contribution);\n }\n tracked.add(contribution);\n });\n}\n\nexport function installRuntimePickersToApp<T extends IGraphicPicker>(\n app: IApp,\n serviceIdentifier: ServiceIdentifier<T>\n): void {\n const bindingContext = getRuntimeInstallerBindingContext();\n refreshRuntimeInstallerContributions();\n const pickers = bindingContext.getAll(serviceIdentifier);\n const registeredKeys = getTrackedEntryKeys(app.registry.picker as object, RUNTIME_PICKER_NAMESPACE);\n\n clearTrackedEntryKeys(\n app.registry.picker as object,\n RUNTIME_PICKER_NAMESPACE,\n app.registry.picker.unregister?.bind(app.registry.picker)\n );\n\n registerRuntimeEntries(\n (key, picker) => {\n app.registry.picker.register(key, picker);\n registeredKeys.add(key);\n },\n pickers as any[],\n RUNTIME_PICKER_NAMESPACE\n );\n}\n\nfunction getRuntimeContributionModuleIdentity(module: TRuntimeContributionModule): object {\n return module as object;\n}\n\nfunction hasLoadedRuntimeContributionModule(\n context: ILegacyBindingContext,\n module: TRuntimeContributionModule\n): boolean {\n return loadedRuntimeContributionModules.get(context)?.has(getRuntimeContributionModuleIdentity(module)) ?? false;\n}\n\nfunction markRuntimeContributionModuleLoaded(context: ILegacyBindingContext, module: TRuntimeContributionModule): void {\n let modules = loadedRuntimeContributionModules.get(context);\n if (!modules) {\n modules = new WeakSet<object>();\n loadedRuntimeContributionModules.set(context, modules);\n }\n modules.add(getRuntimeContributionModuleIdentity(module));\n}\n\nfunction loadRuntimeContributionModuleToContext(\n context: ILegacyBindingContext,\n module: TRuntimeContributionModule\n): void {\n if (hasLoadedRuntimeContributionModule(context, module)) {\n return;\n }\n\n if (typeof module === 'function') {\n module(context);\n } else {\n module.registry(context.bind, noopUnbindRuntimeContributionService, context.isBound, context.rebind);\n }\n\n markRuntimeContributionModuleLoaded(context, module);\n}\n\nfunction isRuntimePickerTarget(\n target: TRuntimeContributionInstallTarget\n): target is { picker: ServiceIdentifier<IGraphicPicker> } {\n return typeof target === 'object' && target !== null && 'picker' in target;\n}\n\nfunction installRuntimeContributionTargetsToApp(\n app: IApp,\n targets: TRuntimeContributionInstallTarget[] | undefined\n): void {\n const resolvedTargets = targets ?? DEFAULT_RUNTIME_CONTRIBUTION_TARGETS;\n let installGraphicRenderers = false;\n let installDrawContributions = false;\n const pickerTargets = new Set<ServiceIdentifier<IGraphicPicker>>();\n\n resolvedTargets.forEach(target => {\n if (target === 'graphic-renderer') {\n installGraphicRenderers = true;\n } else if (target === 'draw-contribution') {\n installDrawContributions = true;\n } else if (isRuntimePickerTarget(target)) {\n pickerTargets.add(target.picker);\n }\n });\n\n if (installDrawContributions) {\n installRuntimeDrawContributionsToApp(app);\n }\n if (installGraphicRenderers) {\n installRuntimeGraphicRenderersToApp(app);\n }\n pickerTargets.forEach(serviceIdentifier => {\n installRuntimePickersToApp(app, serviceIdentifier);\n });\n}\n\nexport function installRuntimeContributionModule(\n module: TRuntimeContributionModule,\n { app, legacy = true, targets }: IRuntimeContributionModuleInstallOptions = {}\n): void {\n const runtimeContext = getRuntimeInstallerBindingContext();\n loadRuntimeContributionModuleToContext(runtimeContext, module);\n\n if (legacy) {\n preLoadAllModule();\n loadRuntimeContributionModuleToContext(getLegacyBindingContext(), module);\n }\n\n refreshRuntimeInstallerContributions();\n\n if (app) {\n installRuntimeContributionTargetsToApp(app, targets);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/entries/runtime-installer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,gBAAgB,C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AClC,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,KAA+C,EAAE;IAE9E,MAAM,cAAc,GAAG,iCAAiC,EAAE,CAAC;IAC3D,sCAAsC,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAE/D,IAAI,MAAM,EAAE;QACV,gBAAgB,EAAE,CAAC;QACnB,sCAAsC,CAAC,uBAAuB,EAAE,EAAE,MAAM,CAAC,CAAC;KAC3E;IAED,oCAAoC,EAAE,CAAC;IAEvC,IAAI,GAAG,EAAE;QACP,sCAAsC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACtD;AACH,CAAC","file":"runtime-installer.js","sourcesContent":["import type {\n IContributionProvider,\n IAreaRenderContribution,\n IDrawItemInterceptorContribution,\n IEnvContribution,\n IGlobal,\n IGraphicPicker,\n IPlugin\n} from '../interface';\nimport type { IApp } from './types';\nimport { application } from '../application';\nimport { CanvasFactory, Context2dFactory } from '../canvas/constants';\nimport { ContributionStore, createContributionProvider } from '../common/contribution-provider';\nimport type { ServiceIdentifier } from '../common/explicit-binding';\nimport { EnvContribution } from '../constants';\nimport loadBuiltinContributions from '../core/contributions/modules';\nimport { DefaultGlobal } from '../core/global';\nimport { WindowHandlerContribution, DefaultWindow } from '../core/window';\nimport coreModule from '../core/core-modules';\nimport graphicModule from '../graphic/graphic-service/graphic-module';\nimport type { ILegacyBindingContext } from '../legacy/binding-context';\nimport { getLegacyBindingContext, preLoadAllModule } from '../legacy/bootstrap';\nimport pickModule from '../picker/pick-modules';\nimport { AreaRenderContribution } from '../render/contributions/render/contributions/constants';\nimport { DrawItemInterceptor } from '../render/contributions/render/draw-interceptor';\nimport { DefaultIncrementalCanvasAreaRender } from '../render/contributions/render/incremental-area-render';\nimport { DefaultIncrementalDrawContribution } from '../render/contributions/render/incremental-draw-contribution';\nimport { DefaultIncrementalCanvasLineRender } from '../render/contributions/render/incremental-line-render';\nimport renderModule from '../render/render-modules';\nimport { GraphicRender } from '../render/contributions/render/symbol';\nimport loadRenderContributions from '../render/contributions/modules';\nimport { AutoEnablePlugins } from '../plugins/constants';\nimport { DefaultPluginService } from '../plugins/plugin-service';\nimport { getRuntimeInstallerState } from './runtime-installer-state';\n\nexport type TRuntimeContributionModuleRegistry = (\n bind: ILegacyBindingContext['bind'],\n unbind: (serviceIdentifier: ServiceIdentifier) => void,\n isBound: ILegacyBindingContext['isBound'],\n rebind: ILegacyBindingContext['rebind']\n) => void;\n\nexport type TRuntimeContributionModule =\n | ((context: ILegacyBindingContext) => void)\n | {\n registry: TRuntimeContributionModuleRegistry;\n };\n\nexport type TRuntimeContributionInstallTarget =\n | 'graphic-renderer'\n | 'draw-contribution'\n | {\n picker: ServiceIdentifier<IGraphicPicker>;\n };\n\nexport interface IRuntimeContributionModuleInstallOptions {\n app?: IApp;\n legacy?: boolean;\n targets?: TRuntimeContributionInstallTarget[];\n}\n\nconst runtimeInstallerState = getRuntimeInstallerState();\nconst runtimeInstallerContext = runtimeInstallerState.runtimeInstallerContext;\nconst RUNTIME_RENDERER_NAMESPACE = 'vrender:runtime-renderer';\nconst RUNTIME_PICKER_NAMESPACE = 'vrender:runtime-picker';\nconst runtimeEntryKeys = runtimeInstallerState.runtimeEntryKeys;\nconst runtimeDrawContributions = runtimeInstallerState.runtimeDrawContributions;\nconst loadedRuntimeContributionModules = runtimeInstallerState.loadedRuntimeContributionModules;\nconst DEFAULT_RUNTIME_CONTRIBUTION_TARGETS: TRuntimeContributionInstallTarget[] = ['graphic-renderer'];\nconst noopUnbindRuntimeContributionService = (): void => undefined;\n\nfunction ensureRuntimeInstallerPreloaded(): void {\n if (runtimeInstallerState.preloaded) {\n return;\n }\n\n runtimeInstallerState.preloaded = true;\n coreModule({ bind: runtimeInstallerContext.bind });\n graphicModule({ bind: runtimeInstallerContext.bind });\n renderModule({ bind: runtimeInstallerContext.bind });\n pickModule({ bind: runtimeInstallerContext.bind, isBound: runtimeInstallerContext.isBound });\n loadBuiltinContributions(runtimeInstallerContext);\n loadRenderContributions(runtimeInstallerContext);\n}\n\nfunction resolveRuntimeNamed<T>(serviceIdentifier: ServiceIdentifier<T>, name: string): T {\n const bindingContext = getRuntimeInstallerBindingContext();\n const instance = bindingContext.getNamed(serviceIdentifier, name);\n\n if (instance == null) {\n throw new Error(`${String(serviceIdentifier)} is not configured for ${name}`);\n }\n\n return instance;\n}\n\nfunction registerRuntimeEntries<T extends { type?: string }>(\n register: (key: string, value: T) => void,\n entries: T[],\n prefix: string\n): void {\n entries.forEach((entry, index) => {\n const name = entry?.type ?? entry?.constructor?.name ?? `${prefix}-entry`;\n register(`${prefix}:${String(name)}:${index}`, entry);\n });\n}\n\nfunction getTrackedEntryKeys(registry: object, namespace: string): Set<string> {\n let namespaces = runtimeEntryKeys.get(registry);\n if (!namespaces) {\n namespaces = new Map();\n runtimeEntryKeys.set(registry, namespaces);\n }\n\n let keys = namespaces.get(namespace);\n if (!keys) {\n keys = new Set();\n namespaces.set(namespace, keys);\n }\n\n return keys;\n}\n\nfunction clearTrackedEntryKeys(registry: object, namespace: string, unregister?: (key: string) => void): void {\n const keys = getTrackedEntryKeys(registry, namespace);\n if (unregister) {\n keys.forEach(key => unregister(key));\n }\n keys.clear();\n}\n\nfunction createAppRegistryContributionProvider<T>(app: IApp, key: ServiceIdentifier<T>): IContributionProvider<T> {\n return {\n getContributions: () => app.context.registry.contribution.get(key as any) as T[]\n };\n}\n\nexport function getRuntimeInstallerBindingContext(): ILegacyBindingContext {\n ensureRuntimeInstallerPreloaded();\n return runtimeInstallerContext;\n}\n\nexport function refreshRuntimeInstallerContributions(): void {\n ContributionStore.refreshAllContributions();\n}\n\nexport function getRuntimeInstallerGlobal(): IGlobal {\n ensureRuntimeInstallerPreloaded();\n runtimeInstallerState.runtimeGlobal ??= new DefaultGlobal(\n createContributionProvider<IEnvContribution>(EnvContribution, runtimeInstallerContext)\n );\n return runtimeInstallerState.runtimeGlobal;\n}\n\nexport function configureRuntimeApplicationForApp(app: IApp): void {\n const bindingContext = getRuntimeInstallerBindingContext();\n const global = getRuntimeInstallerGlobal();\n\n application.global = global;\n application.canvasFactory = env => bindingContext.getNamed(CanvasFactory, env);\n application.context2dFactory = env => bindingContext.getNamed(Context2dFactory, env);\n application.windowHandlerFactory = env => resolveRuntimeNamed(WindowHandlerContribution, env);\n application.windowFactory = () =>\n new DefaultWindow(global, env => resolveRuntimeNamed(WindowHandlerContribution, env));\n application.pluginServiceFactory = () =>\n new DefaultPluginService(createContributionProvider<IPlugin>(AutoEnablePlugins, bindingContext), {\n pluginRegistry: app.context.registry.plugin as any\n });\n application.incrementalDrawContributionFactory = () =>\n new DefaultIncrementalDrawContribution(\n [],\n new DefaultIncrementalCanvasLineRender(),\n new DefaultIncrementalCanvasAreaRender(\n createContributionProvider<IAreaRenderContribution>(AreaRenderContribution, bindingContext)\n ),\n createAppRegistryContributionProvider<IDrawItemInterceptorContribution>(app, DrawItemInterceptor)\n );\n}\n\nexport { RUNTIME_INSTALLER_STATE_SYMBOL, getRuntimeInstallerState } from './runtime-installer-state';\nexport type { IRuntimeInstallerState } from './runtime-installer-state';\n\nexport function installRuntimeGraphicRenderersToApp(app: IApp): void {\n const bindingContext = getRuntimeInstallerBindingContext();\n refreshRuntimeInstallerContributions();\n const renderers = bindingContext.getAll(GraphicRender);\n const registeredKeys = getTrackedEntryKeys(app.registry.renderer as object, RUNTIME_RENDERER_NAMESPACE);\n\n clearTrackedEntryKeys(\n app.registry.renderer as object,\n RUNTIME_RENDERER_NAMESPACE,\n app.registry.renderer.unregister?.bind(app.registry.renderer)\n );\n\n registerRuntimeEntries(\n (key, renderer) => {\n renderer?.reInit?.();\n app.registry.renderer.register(key, renderer);\n registeredKeys.add(key);\n },\n renderers as any[],\n RUNTIME_RENDERER_NAMESPACE\n );\n}\n\nexport function installRuntimeDrawContributionsToApp(app: IApp): void {\n const bindingContext = getRuntimeInstallerBindingContext();\n refreshRuntimeInstallerContributions();\n const contributions = bindingContext.getAll(DrawItemInterceptor) as IDrawItemInterceptorContribution[];\n const tracked =\n runtimeDrawContributions.get(app.context.registry.contribution as object) ??\n new Set<IDrawItemInterceptorContribution>();\n tracked.forEach(contribution => {\n app.context.registry.contribution.unregister?.(DrawItemInterceptor, contribution);\n });\n tracked.clear();\n runtimeDrawContributions.set(app.context.registry.contribution as object, tracked);\n const registered = new Set(app.context.registry.contribution.get(DrawItemInterceptor));\n\n contributions.forEach(contribution => {\n if (!registered.has(contribution)) {\n app.context.registry.contribution.register(DrawItemInterceptor, contribution);\n registered.add(contribution);\n }\n tracked.add(contribution);\n });\n}\n\nexport function installRuntimePickersToApp<T extends IGraphicPicker>(\n app: IApp,\n serviceIdentifier: ServiceIdentifier<T>\n): void {\n const bindingContext = getRuntimeInstallerBindingContext();\n refreshRuntimeInstallerContributions();\n const pickers = bindingContext.getAll(serviceIdentifier);\n const registeredKeys = getTrackedEntryKeys(app.registry.picker as object, RUNTIME_PICKER_NAMESPACE);\n\n clearTrackedEntryKeys(\n app.registry.picker as object,\n RUNTIME_PICKER_NAMESPACE,\n app.registry.picker.unregister?.bind(app.registry.picker)\n );\n\n registerRuntimeEntries(\n (key, picker) => {\n app.registry.picker.register(key, picker);\n registeredKeys.add(key);\n },\n pickers as any[],\n RUNTIME_PICKER_NAMESPACE\n );\n}\n\nfunction getRuntimeContributionModuleIdentity(module: TRuntimeContributionModule): object {\n return module as object;\n}\n\nfunction hasLoadedRuntimeContributionModule(\n context: ILegacyBindingContext,\n module: TRuntimeContributionModule\n): boolean {\n return loadedRuntimeContributionModules.get(context)?.has(getRuntimeContributionModuleIdentity(module)) ?? false;\n}\n\nfunction markRuntimeContributionModuleLoaded(context: ILegacyBindingContext, module: TRuntimeContributionModule): void {\n let modules = loadedRuntimeContributionModules.get(context);\n if (!modules) {\n modules = new WeakSet<object>();\n loadedRuntimeContributionModules.set(context, modules);\n }\n modules.add(getRuntimeContributionModuleIdentity(module));\n}\n\nfunction loadRuntimeContributionModuleToContext(\n context: ILegacyBindingContext,\n module: TRuntimeContributionModule\n): void {\n if (hasLoadedRuntimeContributionModule(context, module)) {\n return;\n }\n\n if (typeof module === 'function') {\n module(context);\n } else {\n module.registry(context.bind, noopUnbindRuntimeContributionService, context.isBound, context.rebind);\n }\n\n markRuntimeContributionModuleLoaded(context, module);\n}\n\nfunction isRuntimePickerTarget(\n target: TRuntimeContributionInstallTarget\n): target is { picker: ServiceIdentifier<IGraphicPicker> } {\n return typeof target === 'object' && target !== null && 'picker' in target;\n}\n\nfunction installRuntimeContributionTargetsToApp(\n app: IApp,\n targets: TRuntimeContributionInstallTarget[] | undefined\n): void {\n const resolvedTargets = targets ?? DEFAULT_RUNTIME_CONTRIBUTION_TARGETS;\n let installGraphicRenderers = false;\n let installDrawContributions = false;\n const pickerTargets = new Set<ServiceIdentifier<IGraphicPicker>>();\n\n resolvedTargets.forEach(target => {\n if (target === 'graphic-renderer') {\n installGraphicRenderers = true;\n } else if (target === 'draw-contribution') {\n installDrawContributions = true;\n } else if (isRuntimePickerTarget(target)) {\n pickerTargets.add(target.picker);\n }\n });\n\n if (installDrawContributions) {\n installRuntimeDrawContributionsToApp(app);\n }\n if (installGraphicRenderers) {\n installRuntimeGraphicRenderersToApp(app);\n }\n pickerTargets.forEach(serviceIdentifier => {\n installRuntimePickersToApp(app, serviceIdentifier);\n });\n}\n\nexport function installRuntimeContributionModule(\n module: TRuntimeContributionModule,\n { app, legacy = true, targets }: IRuntimeContributionModuleInstallOptions = {}\n): void {\n const runtimeContext = getRuntimeInstallerBindingContext();\n loadRuntimeContributionModuleToContext(runtimeContext, module);\n\n if (legacy) {\n preLoadAllModule();\n loadRuntimeContributionModuleToContext(getLegacyBindingContext(), module);\n }\n\n refreshRuntimeInstallerContributions();\n\n if (app) {\n installRuntimeContributionTargetsToApp(app, targets);\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export declare const FACTORY_STATE_SYMBOL: unique symbol;
2
+ export interface IFactoryState {
3
+ pluginClasses: Record<string, any>;
4
+ }
5
+ export declare function getFactoryState(): IFactoryState;
@@ -0,0 +1,14 @@
1
+ export const FACTORY_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/factory-state");
2
+
3
+ function createFactoryState() {
4
+ return {
5
+ pluginClasses: {}
6
+ };
7
+ }
8
+
9
+ export function getFactoryState() {
10
+ const scope = globalThis;
11
+ return scope[FACTORY_STATE_SYMBOL] || (scope[FACTORY_STATE_SYMBOL] = createFactoryState()),
12
+ scope[FACTORY_STATE_SYMBOL];
13
+ }
14
+ //# sourceMappingURL=factory-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/factory-state.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;AAMvF,SAAS,kBAAkB;IACzB,OAAO;QACL,aAAa,EAAE,EAAE;KAClB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,MAAM,KAAK,GAAG,UAA4E,CAAC;IAE3F,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE;QAChC,KAAK,CAAC,oBAAoB,CAAC,GAAG,kBAAkB,EAAE,CAAC;KACpD;IAED,OAAO,KAAK,CAAC,oBAAoB,CAAkB,CAAC;AACtD,CAAC","file":"factory-state.js","sourcesContent":["export const FACTORY_STATE_SYMBOL = Symbol.for('@visactor/vrender-core/factory-state');\n\nexport interface IFactoryState {\n pluginClasses: Record<string, any>;\n}\n\nfunction createFactoryState(): IFactoryState {\n return {\n pluginClasses: {}\n };\n}\n\nexport function getFactoryState(): IFactoryState {\n const scope = globalThis as typeof globalThis & { [FACTORY_STATE_SYMBOL]?: IFactoryState };\n\n if (!scope[FACTORY_STATE_SYMBOL]) {\n scope[FACTORY_STATE_SYMBOL] = createFactoryState();\n }\n\n return scope[FACTORY_STATE_SYMBOL] as IFactoryState;\n}\n"]}
package/es/factory.d.ts CHANGED
@@ -3,4 +3,6 @@ export declare class Factory {
3
3
  static registerPlugin(pluginKey: string, pluginClass: any): void;
4
4
  static getPlugin(pluginKey: string): any;
5
5
  }
6
+ export { FACTORY_STATE_SYMBOL, getFactoryState } from './factory-state';
7
+ export type { IFactoryState } from './factory-state';
6
8
  export * from './factory/index';
package/es/factory.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { getFactoryState } from "./factory-state";
2
+
1
3
  export class Factory {
2
4
  static registerPlugin(pluginKey, pluginClass) {
3
5
  Factory._pluginClasses[pluginKey] = pluginClass;
@@ -7,7 +9,9 @@ export class Factory {
7
9
  }
8
10
  }
9
11
 
10
- Factory._pluginClasses = {};
12
+ Factory._pluginClasses = getFactoryState().pluginClasses;
13
+
14
+ export { FACTORY_STATE_SYMBOL, getFactoryState } from "./factory-state";
11
15
 
12
16
  export * from "./factory/index";
13
17
  //# sourceMappingURL=factory.js.map
package/es/factory.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,OAAO;IAGlB,MAAM,CAAC,cAAc,CAAC,SAAiB,EAAE,WAAgB;QACvD,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,SAAiB;QAChC,OAAO,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;;AARc,sBAAc,GAAwB,EAAE,CAAC;AAW1D,cAAc,iBAAiB,CAAC","file":"factory.js","sourcesContent":["export class Factory {\n private static _pluginClasses: Record<string, any> = {};\n\n static registerPlugin(pluginKey: string, pluginClass: any) {\n Factory._pluginClasses[pluginKey] = pluginClass;\n }\n\n static getPlugin(pluginKey: string) {\n return Factory._pluginClasses[pluginKey];\n }\n}\n\nexport * from './factory/index';\n"]}
1
+ {"version":3,"sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,OAAO,OAAO;IAGlB,MAAM,CAAC,cAAc,CAAC,SAAiB,EAAE,WAAgB;QACvD,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,SAAiB;QAChC,OAAO,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;;AARc,sBAAc,GAAG,eAAe,EAAE,CAAC,aAAa,CAAC;AAWlE,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAExE,cAAc,iBAAiB,CAAC","file":"factory.js","sourcesContent":["import { getFactoryState } from './factory-state';\n\nexport class Factory {\n private static _pluginClasses = getFactoryState().pluginClasses;\n\n static registerPlugin(pluginKey: string, pluginClass: any) {\n Factory._pluginClasses[pluginKey] = pluginClass;\n }\n\n static getPlugin(pluginKey: string) {\n return Factory._pluginClasses[pluginKey];\n }\n}\n\nexport { FACTORY_STATE_SYMBOL, getFactoryState } from './factory-state';\nexport type { IFactoryState } from './factory-state';\nexport * from './factory/index';\n"]}