@visactor/vrender-core 1.1.3 → 1.1.4-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/allocator/bounds-allocate.js +1 -2
- package/cjs/allocator/graphic-allocate.js +2 -1
- package/cjs/animate/config.js +1 -1
- package/cjs/application-state.d.ts +27 -0
- package/cjs/application-state.js +22 -0
- package/cjs/application-state.js.map +1 -0
- package/cjs/application.d.ts +2 -22
- package/cjs/application.js +24 -3
- package/cjs/application.js.map +1 -1
- package/cjs/common/bounds-context.js +1 -2
- package/cjs/common/contribution-provider.d.ts +2 -1
- package/cjs/common/contribution-provider.js +20 -2
- package/cjs/common/contribution-provider.js.map +1 -1
- package/cjs/common/contribution-store-state.d.ts +6 -0
- package/cjs/common/contribution-store-state.js +20 -0
- package/cjs/common/contribution-store-state.js.map +1 -0
- package/cjs/common/performance-raf.js +1 -2
- package/cjs/common/render-command-list.js +2 -1
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/entries/runtime-installer-state.d.ts +12 -0
- package/cjs/entries/runtime-installer-state.js +27 -0
- package/cjs/entries/runtime-installer-state.js.map +1 -0
- package/cjs/entries/runtime-installer.d.ts +3 -1
- package/cjs/entries/runtime-installer.js +23 -13
- package/cjs/entries/runtime-installer.js.map +1 -1
- package/cjs/factory-state.d.ts +5 -0
- package/cjs/factory-state.js +19 -0
- package/cjs/factory-state.js.map +1 -0
- package/cjs/factory.d.ts +2 -0
- package/cjs/factory.js +18 -2
- package/cjs/factory.js.map +1 -1
- package/cjs/graphic/graphic-creator.d.ts +2 -29
- package/cjs/graphic/graphic-creator.js +24 -38
- package/cjs/graphic/graphic-creator.js.map +1 -1
- package/cjs/graphic/graphic-registry.d.ts +36 -0
- package/cjs/graphic/graphic-registry.js +65 -0
- package/cjs/graphic/graphic-registry.js.map +1 -0
- package/cjs/graphic/index.d.ts +2 -0
- package/cjs/graphic/index.js +29 -16
- package/cjs/graphic/index.js.map +1 -1
- package/cjs/legacy/bootstrap-state.d.ts +7 -0
- package/cjs/legacy/bootstrap-state.js +24 -0
- package/cjs/legacy/bootstrap-state.js.map +1 -0
- package/cjs/legacy/bootstrap.d.ts +3 -4
- package/cjs/legacy/bootstrap.js +20 -7
- package/cjs/legacy/bootstrap.js.map +1 -1
- package/dist/index.es.js +110 -22
- package/es/allocator/bounds-allocate.js +1 -2
- package/es/allocator/graphic-allocate.js +2 -1
- package/es/animate/config.js +1 -1
- package/es/application-state.d.ts +27 -0
- package/es/application-state.js +17 -0
- package/es/application-state.js.map +1 -0
- package/es/application.d.ts +2 -22
- package/es/application.js +2 -3
- package/es/application.js.map +1 -1
- package/es/common/bounds-context.js +1 -2
- package/es/common/contribution-provider.d.ts +2 -1
- package/es/common/contribution-provider.js +6 -1
- package/es/common/contribution-provider.js.map +1 -1
- package/es/common/contribution-store-state.d.ts +6 -0
- package/es/common/contribution-store-state.js +14 -0
- package/es/common/contribution-store-state.js.map +1 -0
- package/es/common/performance-raf.js +1 -2
- package/es/common/render-command-list.js +2 -1
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/text.js +1 -1
- package/es/entries/runtime-installer-state.d.ts +12 -0
- package/es/entries/runtime-installer-state.js +20 -0
- package/es/entries/runtime-installer-state.js.map +1 -0
- package/es/entries/runtime-installer.d.ts +3 -1
- package/es/entries/runtime-installer.js +8 -9
- package/es/entries/runtime-installer.js.map +1 -1
- package/es/factory-state.d.ts +5 -0
- package/es/factory-state.js +14 -0
- package/es/factory-state.js.map +1 -0
- package/es/factory.d.ts +2 -0
- package/es/factory.js +5 -1
- package/es/factory.js.map +1 -1
- package/es/graphic/graphic-creator.d.ts +2 -29
- package/es/graphic/graphic-creator.js +1 -41
- package/es/graphic/graphic-creator.js.map +1 -1
- package/es/graphic/graphic-registry.d.ts +36 -0
- package/es/graphic/graphic-registry.js +57 -0
- package/es/graphic/graphic-registry.js.map +1 -0
- package/es/graphic/index.d.ts +2 -0
- package/es/graphic/index.js +2 -0
- package/es/graphic/index.js.map +1 -1
- package/es/legacy/bootstrap-state.d.ts +7 -0
- package/es/legacy/bootstrap-state.js +17 -0
- package/es/legacy/bootstrap-state.js.map +1 -0
- package/es/legacy/bootstrap.d.ts +3 -4
- package/es/legacy/bootstrap.js +5 -5
- package/es/legacy/bootstrap.js.map +1 -1
- package/package.json +11 -3
|
@@ -34,5 +34,4 @@ class DefaultBoundsAllocate {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
exports.DefaultBoundsAllocate = DefaultBoundsAllocate, exports.boundsAllocate = new DefaultBoundsAllocate;
|
|
38
|
-
//# sourceMappingURL=bounds-allocate.js.map
|
|
37
|
+
exports.DefaultBoundsAllocate = DefaultBoundsAllocate, exports.boundsAllocate = new DefaultBoundsAllocate;
|
|
@@ -159,4 +159,5 @@ class DefaultGraphicMemoryManager {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
exports.DefaultGraphicMemoryManager = DefaultGraphicMemoryManager, exports.defaultGraphicMemoryManager = new DefaultGraphicMemoryManager;
|
|
162
|
+
exports.DefaultGraphicMemoryManager = DefaultGraphicMemoryManager, exports.defaultGraphicMemoryManager = new DefaultGraphicMemoryManager;
|
|
163
|
+
//# sourceMappingURL=graphic-allocate.js.map
|
package/cjs/animate/config.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
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_STATE_SYMBOL: unique symbol;
|
|
23
|
+
export interface IApplicationState {
|
|
24
|
+
application: Application;
|
|
25
|
+
}
|
|
26
|
+
export declare function getApplicationState(): IApplicationState;
|
|
27
|
+
export declare const application: Application;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.application = exports.getApplicationState = exports.APPLICATION_STATE_SYMBOL = exports.Application = void 0;
|
|
6
|
+
|
|
7
|
+
class Application {}
|
|
8
|
+
|
|
9
|
+
function createApplicationState() {
|
|
10
|
+
return {
|
|
11
|
+
application: new Application
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function getApplicationState() {
|
|
16
|
+
const scope = globalThis;
|
|
17
|
+
return scope[exports.APPLICATION_STATE_SYMBOL] || (scope[exports.APPLICATION_STATE_SYMBOL] = createApplicationState()),
|
|
18
|
+
scope[exports.APPLICATION_STATE_SYMBOL];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.Application = Application, exports.APPLICATION_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/application-state"),
|
|
22
|
+
exports.getApplicationState = getApplicationState, exports.application = getApplicationState().application;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/application-state.ts"],"names":[],"mappings":";;;AAgBA,MAAa,WAAW;CAiBvB;AAjBD,kCAiBC;AAEY,QAAA,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;AAM/F,SAAS,sBAAsB;IAC7B,OAAO;QACL,WAAW,EAAE,IAAI,WAAW,EAAE;KAC/B,CAAC;AACJ,CAAC;AAED,SAAgB,mBAAmB;IACjC,MAAM,KAAK,GAAG,UAAoF,CAAC;IAEnG,IAAI,CAAC,KAAK,CAAC,gCAAwB,CAAC,EAAE;QACpC,KAAK,CAAC,gCAAwB,CAAC,GAAG,sBAAsB,EAAE,CAAC;KAC5D;IAED,OAAO,KAAK,CAAC,gCAAwB,CAAsB,CAAC;AAC9D,CAAC;AARD,kDAQC;AAEY,QAAA,WAAW,GAAG,mBAAmB,EAAE,CAAC,WAAW,CAAC","file":"application-state.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_STATE_SYMBOL = Symbol.for('@visactor/vrender-core/application-state');\n\nexport interface IApplicationState {\n application: Application;\n}\n\nfunction createApplicationState(): IApplicationState {\n return {\n application: new Application()\n };\n}\n\nexport function getApplicationState(): IApplicationState {\n const scope = globalThis as typeof globalThis & { [APPLICATION_STATE_SYMBOL]?: IApplicationState };\n\n if (!scope[APPLICATION_STATE_SYMBOL]) {\n scope[APPLICATION_STATE_SYMBOL] = createApplicationState();\n }\n\n return scope[APPLICATION_STATE_SYMBOL] as IApplicationState;\n}\n\nexport const application = getApplicationState().application;\n"]}
|
package/cjs/application.d.ts
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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/cjs/application.js
CHANGED
|
@@ -2,8 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.
|
|
5
|
+
}), exports.getApplicationState = exports.APPLICATION_STATE_SYMBOL = exports.Application = exports.application = void 0;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
var application_state_1 = require("./application-state");
|
|
8
8
|
|
|
9
|
-
exports
|
|
9
|
+
Object.defineProperty(exports, "application", {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: function() {
|
|
12
|
+
return application_state_1.application;
|
|
13
|
+
}
|
|
14
|
+
}), Object.defineProperty(exports, "Application", {
|
|
15
|
+
enumerable: !0,
|
|
16
|
+
get: function() {
|
|
17
|
+
return application_state_1.Application;
|
|
18
|
+
}
|
|
19
|
+
}), Object.defineProperty(exports, "APPLICATION_STATE_SYMBOL", {
|
|
20
|
+
enumerable: !0,
|
|
21
|
+
get: function() {
|
|
22
|
+
return application_state_1.APPLICATION_STATE_SYMBOL;
|
|
23
|
+
}
|
|
24
|
+
}), Object.defineProperty(exports, "getApplicationState", {
|
|
25
|
+
enumerable: !0,
|
|
26
|
+
get: function() {
|
|
27
|
+
return application_state_1.getApplicationState;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=application.js.map
|
package/cjs/application.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/application.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/application.ts"],"names":[],"mappings":";;;AAAA,yDAA8G;AAArG,gHAAA,WAAW,OAAA;AAAE,gHAAA,WAAW,OAAA;AAAE,6HAAA,wBAAwB,OAAA;AAAE,wHAAA,mBAAmB,OAAA","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';
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.ContributionStore = exports.bindContributionProviderNoSingletonScope = exports.bindContributionProvider = exports.createContributionProvider = exports.ContributionProvider = void 0
|
|
5
|
+
}), exports.getContributionStoreState = exports.CONTRIBUTION_STORE_STATE_SYMBOL = exports.ContributionStore = exports.bindContributionProviderNoSingletonScope = exports.bindContributionProvider = exports.createContributionProvider = exports.ContributionProvider = void 0;
|
|
6
|
+
|
|
7
|
+
const contribution_store_state_1 = require("./contribution-store-state");
|
|
8
|
+
|
|
6
9
|
exports.ContributionProvider = Symbol("ContributionProvider");
|
|
7
10
|
|
|
8
11
|
class ContributionProviderCache {
|
|
@@ -51,4 +54,19 @@ class ContributionStore {
|
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
|
|
54
|
-
exports.ContributionStore = ContributionStore, ContributionStore.store =
|
|
57
|
+
exports.ContributionStore = ContributionStore, ContributionStore.store = (0, contribution_store_state_1.getContributionStoreState)().store;
|
|
58
|
+
|
|
59
|
+
var contribution_store_state_2 = require("./contribution-store-state");
|
|
60
|
+
|
|
61
|
+
Object.defineProperty(exports, "CONTRIBUTION_STORE_STATE_SYMBOL", {
|
|
62
|
+
enumerable: !0,
|
|
63
|
+
get: function() {
|
|
64
|
+
return contribution_store_state_2.CONTRIBUTION_STORE_STATE_SYMBOL;
|
|
65
|
+
}
|
|
66
|
+
}), Object.defineProperty(exports, "getContributionStoreState", {
|
|
67
|
+
enumerable: !0,
|
|
68
|
+
get: function() {
|
|
69
|
+
return contribution_store_state_2.getContributionStoreState;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=contribution-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/contribution-provider.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/common/contribution-provider.ts"],"names":[],"mappings":";;;AAEA,yEAAuE;AAE1D,QAAA,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,CAAC;SACtE;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,OAAO;SACR;QACD,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,SAAS;YACZ,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAA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,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;;AAtBH,8CAuBC;AAtBQ,uBAAK,GAAG,IAAA,oDAAyB,GAAE,CAAC,KAAyE,CAAC;AAwBvH,uEAAwG;AAA/F,2IAAA,+BAA+B,OAAA;AAAE,qIAAA,yBAAyB,OAAA","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,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function createContributionStoreState() {
|
|
4
|
+
return {
|
|
5
|
+
store: new Map
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function getContributionStoreState() {
|
|
10
|
+
const scope = globalThis;
|
|
11
|
+
return scope[exports.CONTRIBUTION_STORE_STATE_SYMBOL] || (scope[exports.CONTRIBUTION_STORE_STATE_SYMBOL] = createContributionStoreState()),
|
|
12
|
+
scope[exports.CONTRIBUTION_STORE_STATE_SYMBOL];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
Object.defineProperty(exports, "__esModule", {
|
|
16
|
+
value: !0
|
|
17
|
+
}), exports.getContributionStoreState = exports.CONTRIBUTION_STORE_STATE_SYMBOL = void 0,
|
|
18
|
+
exports.CONTRIBUTION_STORE_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/contribution-store-state"),
|
|
19
|
+
exports.getContributionStoreState = getContributionStoreState;
|
|
20
|
+
//# sourceMappingURL=contribution-store-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/contribution-store-state.ts"],"names":[],"mappings":";;;AAEa,QAAA,+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,SAAgB,yBAAyB;IACvC,MAAM,KAAK,GAAG,UAAiG,CAAC;IAEhH,IAAI,CAAC,KAAK,CAAC,uCAA+B,CAAC,EAAE;QAC3C,KAAK,CAAC,uCAA+B,CAAC,GAAG,4BAA4B,EAAE,CAAC;KACzE;IAED,OAAO,KAAK,CAAC,uCAA+B,CAA4B,CAAC;AAC3E,CAAC;AARD,8DAQC","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"]}
|
package/cjs/common/simplify.js
CHANGED
|
@@ -36,4 +36,4 @@ function flatten_simplify(points, tolerance, highestQuality) {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", {
|
|
37
37
|
value: !0
|
|
38
38
|
}), exports.flatten_simplify = void 0, exports.flatten_simplify = flatten_simplify;
|
|
39
|
-
//# sourceMappingURL=simplify.js.map
|
|
39
|
+
//# sourceMappingURL=simplify.js.map
|
package/cjs/common/sort.js
CHANGED
|
@@ -101,4 +101,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
101
101
|
value: !0
|
|
102
102
|
}), exports.findNextGraphic = exports.foreachAsync = exports.foreach = void 0, exports.foreach = foreach,
|
|
103
103
|
exports.foreachAsync = foreachAsync, exports.findNextGraphic = findNextGraphic;
|
|
104
|
-
//# sourceMappingURL=sort.js.map
|
|
104
|
+
//# sourceMappingURL=sort.js.map
|
package/cjs/common/split-path.js
CHANGED
package/cjs/common/text.js
CHANGED
|
@@ -34,4 +34,4 @@ function textAttributesToStyle(attrs) {
|
|
|
34
34
|
|
|
35
35
|
exports.textDrawOffsetY = textDrawOffsetY, exports.textDrawOffsetX = textDrawOffsetX,
|
|
36
36
|
exports.textLayoutOffsetY = textLayoutOffsetY, exports.textAttributesToStyle = textAttributesToStyle;
|
|
37
|
-
//# sourceMappingURL=text.js.map
|
|
37
|
+
//# sourceMappingURL=text.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,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.getRuntimeInstallerState = exports.RUNTIME_INSTALLER_STATE_SYMBOL = void 0;
|
|
6
|
+
|
|
7
|
+
const binding_context_1 = require("../legacy/binding-context");
|
|
8
|
+
|
|
9
|
+
function createRuntimeInstallerState() {
|
|
10
|
+
return {
|
|
11
|
+
runtimeInstallerContext: (0, binding_context_1.createLegacyBindingContext)(),
|
|
12
|
+
preloaded: !1,
|
|
13
|
+
runtimeEntryKeys: new WeakMap,
|
|
14
|
+
runtimeDrawContributions: new WeakMap,
|
|
15
|
+
loadedRuntimeContributionModules: new WeakMap
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function getRuntimeInstallerState() {
|
|
20
|
+
const scope = globalThis;
|
|
21
|
+
return scope[exports.RUNTIME_INSTALLER_STATE_SYMBOL] || (scope[exports.RUNTIME_INSTALLER_STATE_SYMBOL] = createRuntimeInstallerState()),
|
|
22
|
+
scope[exports.RUNTIME_INSTALLER_STATE_SYMBOL];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.RUNTIME_INSTALLER_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/runtime-installer-state"),
|
|
26
|
+
exports.getRuntimeInstallerState = getRuntimeInstallerState;
|
|
27
|
+
//# sourceMappingURL=runtime-installer-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/entries/runtime-installer-state.ts"],"names":[],"mappings":";;;AACA,+DAAmG;AAEtF,QAAA,8BAA8B,GAAG,MAAM,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;AAW3G,SAAS,2BAA2B;IAClC,OAAO;QACL,uBAAuB,EAAE,IAAA,4CAA0B,GAAE;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,SAAgB,wBAAwB;IACtC,MAAM,KAAK,GAAG,UAA+F,CAAC;IAE9G,IAAI,CAAC,KAAK,CAAC,sCAA8B,CAAC,EAAE;QAC1C,KAAK,CAAC,sCAA8B,CAAC,GAAG,2BAA2B,EAAE,CAAC;KACvE;IAED,OAAO,KAAK,CAAC,sCAA8B,CAA2B,CAAC;AACzE,CAAC;AARD,4DAQC","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 {
|
|
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;
|
|
@@ -8,17 +8,13 @@ var __importDefault = this && this.__importDefault || function(mod) {
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", {
|
|
10
10
|
value: !0
|
|
11
|
-
}), exports.installRuntimeContributionModule = exports.installRuntimePickersToApp = exports.installRuntimeDrawContributionsToApp = exports.installRuntimeGraphicRenderersToApp = exports.configureRuntimeApplicationForApp = exports.getRuntimeInstallerGlobal = exports.refreshRuntimeInstallerContributions = exports.getRuntimeInstallerBindingContext = void 0;
|
|
11
|
+
}), exports.installRuntimeContributionModule = exports.installRuntimePickersToApp = exports.installRuntimeDrawContributionsToApp = exports.installRuntimeGraphicRenderersToApp = exports.getRuntimeInstallerState = exports.RUNTIME_INSTALLER_STATE_SYMBOL = exports.configureRuntimeApplicationForApp = exports.getRuntimeInstallerGlobal = exports.refreshRuntimeInstallerContributions = exports.getRuntimeInstallerBindingContext = void 0;
|
|
12
12
|
|
|
13
|
-
const application_1 = require("../application"), constants_1 = require("../canvas/constants"), contribution_provider_1 = require("../common/contribution-provider"), constants_2 = require("../constants"), modules_1 = __importDefault(require("../core/contributions/modules")), global_1 = require("../core/global"), window_1 = require("../core/window"), core_modules_1 = __importDefault(require("../core/core-modules")), graphic_module_1 = __importDefault(require("../graphic/graphic-service/graphic-module")),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let runtimeGlobal, runtimeInstallerPreloaded = !1;
|
|
17
|
-
|
|
18
|
-
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 = () => {};
|
|
13
|
+
const application_1 = require("../application"), constants_1 = require("../canvas/constants"), contribution_provider_1 = require("../common/contribution-provider"), constants_2 = require("../constants"), modules_1 = __importDefault(require("../core/contributions/modules")), global_1 = require("../core/global"), window_1 = require("../core/window"), core_modules_1 = __importDefault(require("../core/core-modules")), graphic_module_1 = __importDefault(require("../graphic/graphic-service/graphic-module")), bootstrap_1 = require("../legacy/bootstrap"), pick_modules_1 = __importDefault(require("../picker/pick-modules")), constants_3 = require("../render/contributions/render/contributions/constants"), draw_interceptor_1 = require("../render/contributions/render/draw-interceptor"), incremental_area_render_1 = require("../render/contributions/render/incremental-area-render"), incremental_draw_contribution_1 = require("../render/contributions/render/incremental-draw-contribution"), incremental_line_render_1 = require("../render/contributions/render/incremental-line-render"), render_modules_1 = __importDefault(require("../render/render-modules")), symbol_1 = require("../render/contributions/render/symbol"), modules_2 = __importDefault(require("../render/contributions/modules")), constants_4 = require("../plugins/constants"), plugin_service_1 = require("../plugins/plugin-service"), runtime_installer_state_1 = require("./runtime-installer-state"), runtimeInstallerState = (0,
|
|
14
|
+
runtime_installer_state_1.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 = () => {};
|
|
19
15
|
|
|
20
16
|
function ensureRuntimeInstallerPreloaded() {
|
|
21
|
-
|
|
17
|
+
runtimeInstallerState.preloaded || (runtimeInstallerState.preloaded = !0, (0, core_modules_1.default)({
|
|
22
18
|
bind: runtimeInstallerContext.bind
|
|
23
19
|
}), (0, graphic_module_1.default)({
|
|
24
20
|
bind: runtimeInstallerContext.bind
|
|
@@ -71,9 +67,10 @@ function refreshRuntimeInstallerContributions() {
|
|
|
71
67
|
}
|
|
72
68
|
|
|
73
69
|
function getRuntimeInstallerGlobal() {
|
|
74
|
-
|
|
70
|
+
var _a;
|
|
71
|
+
return ensureRuntimeInstallerPreloaded(), null !== (_a = runtimeInstallerState.runtimeGlobal) && void 0 !== _a || (runtimeInstallerState.runtimeGlobal = new global_1.DefaultGlobal((0,
|
|
75
72
|
contribution_provider_1.createContributionProvider)(constants_2.EnvContribution, runtimeInstallerContext))),
|
|
76
|
-
runtimeGlobal;
|
|
73
|
+
runtimeInstallerState.runtimeGlobal;
|
|
77
74
|
}
|
|
78
75
|
|
|
79
76
|
function configureRuntimeApplicationForApp(app) {
|
|
@@ -89,6 +86,11 @@ function configureRuntimeApplicationForApp(app) {
|
|
|
89
86
|
contribution_provider_1.createContributionProvider)(constants_3.AreaRenderContribution, bindingContext)), createAppRegistryContributionProvider(app, draw_interceptor_1.DrawItemInterceptor));
|
|
90
87
|
}
|
|
91
88
|
|
|
89
|
+
exports.getRuntimeInstallerBindingContext = getRuntimeInstallerBindingContext, exports.refreshRuntimeInstallerContributions = refreshRuntimeInstallerContributions,
|
|
90
|
+
exports.getRuntimeInstallerGlobal = getRuntimeInstallerGlobal, exports.configureRuntimeApplicationForApp = configureRuntimeApplicationForApp;
|
|
91
|
+
|
|
92
|
+
var runtime_installer_state_2 = require("./runtime-installer-state");
|
|
93
|
+
|
|
92
94
|
function installRuntimeGraphicRenderersToApp(app) {
|
|
93
95
|
var _a;
|
|
94
96
|
const bindingContext = getRuntimeInstallerBindingContext();
|
|
@@ -172,9 +174,17 @@ function installRuntimeContributionModule(module, {app: app, legacy: legacy = !0
|
|
|
172
174
|
app && installRuntimeContributionTargetsToApp(app, targets);
|
|
173
175
|
}
|
|
174
176
|
|
|
175
|
-
exports
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
Object.defineProperty(exports, "RUNTIME_INSTALLER_STATE_SYMBOL", {
|
|
178
|
+
enumerable: !0,
|
|
179
|
+
get: function() {
|
|
180
|
+
return runtime_installer_state_2.RUNTIME_INSTALLER_STATE_SYMBOL;
|
|
181
|
+
}
|
|
182
|
+
}), Object.defineProperty(exports, "getRuntimeInstallerState", {
|
|
183
|
+
enumerable: !0,
|
|
184
|
+
get: function() {
|
|
185
|
+
return runtime_installer_state_2.getRuntimeInstallerState;
|
|
186
|
+
}
|
|
187
|
+
}), exports.installRuntimeGraphicRenderersToApp = installRuntimeGraphicRenderersToApp,
|
|
178
188
|
exports.installRuntimeDrawContributionsToApp = installRuntimeDrawContributionsToApp,
|
|
179
189
|
exports.installRuntimePickersToApp = installRuntimePickersToApp, exports.installRuntimeContributionModule = installRuntimeContributionModule;
|
|
180
190
|
//# sourceMappingURL=runtime-installer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/entries/runtime-installer.ts"],"names":[],"mappings":";;;;;;AAUA,gDAA6C;AAC7C,mDAAsE;AACtE,2EAAgG;AAEhG,4CAA+C;AAC/C,4EAAqE;AACrE,2CAA+C;AAC/C,2CAA0E;AAC1E,wEAA8C;AAC9C,+FAAsE;AACtE,+DAAmG;AACnG,mDAAgF;AAChF,0EAAgD;AAChD,sFAAgG;AAChG,sFAAsF;AACtF,oGAA4G;AAC5G,gHAAkH;AAClH,oGAA4G;AAC5G,8EAAoD;AACpD,kEAAsE;AACtE,8EAAsE;AACtE,oDAAyD;AACzD,8DAAiE;AA4BjE,MAAM,uBAAuB,GAAG,IAAA,4CAA0B,GAAE,CAAC;AAC7D,IAAI,yBAAyB,GAAG,KAAK,CAAC;AACtC,IAAI,aAAkC,CAAC;AACvC,MAAM,0BAA0B,GAAG,0BAA0B,CAAC;A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H,CAAC,CAAC,CAAC;IAEH,IAAI,wBAAwB,EAAE;QAC5B,oCAAoC,CAAC,GAAG,CAAC,CAAC;KAC3C;IACD,IAAI,uBAAuB,EAAE;QAC3B,mCAAmC,CAAC,GAAG,CAAC,CAAC;KAC1C;IACD,aAAa,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE;QACxC,0BAA0B,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,gCAAgC,CAC9C,MAAkC,EAClC,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,IAAA,4BAAgB,GAAE,CAAC;QACnB,sCAAsC,CAAC,IAAA,mCAAuB,GAAE,EAAE,MAAM,CAAC,CAAC;KAC3E;IAED,oCAAoC,EAAE,CAAC;IAEvC,IAAI,GAAG,EAAE;QACP,sCAAsC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACtD;AACH,CAAC;AAjBD,4EAiBC","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,gDAA6C;AAC7C,mDAAsE;AACtE,2EAAgG;AAEhG,4CAA+C;AAC/C,4EAAqE;AACrE,2CAA+C;AAC/C,2CAA0E;AAC1E,wEAA8C;AAC9C,+FAAsE;AAEtE,mDAAgF;AAChF,0EAAgD;AAChD,sFAAgG;AAChG,sFAAsF;AACtF,oGAA4G;AAC5G,gHAAkH;AAClH,oGAA4G;AAC5G,8EAAoD;AACpD,kEAAsE;AACtE,8EAAsE;AACtE,oDAAyD;AACzD,8DAAiE;AACjE,uEAAqE;AA4BrE,MAAM,qBAAqB,GAAG,IAAA,kDAAwB,GAAE,CAAC;AACzD,MAAM,uBAAuB,GAAG,qBAAqB,CAAC,uBAAuB,CAAC;AAC9E,MAAM,0BAA0B,GAAG,0BAA0B,CAAC;AAC9D,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AAC1D,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,gBAAgB,CAAC;AAChE,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,wBAAwB,CAAC;AAChF,MAAM,gCAAgC,GAAG,qBAAqB,CAAC,gCAAgC,CAAC;AAChG,MAAM,oCAAoC,GAAwC,CAAC,kBAAkB,CAAC,CAAC;AACvG,MAAM,oCAAoC,GAAG,GAAS,EAAE,CAAC,SAAS,CAAC;AAEnE,SAAS,+BAA+B;IACtC,IAAI,qBAAqB,CAAC,SAAS,EAAE;QACnC,OAAO;KACR;IAED,qBAAqB,CAAC,SAAS,GAAG,IAAI,CAAC;IACvC,IAAA,sBAAU,EAAC,EAAE,IAAI,EAAE,uBAAuB,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,IAAA,wBAAa,EAAC,EAAE,IAAI,EAAE,uBAAuB,CAAC,IAAI,EAAE,CA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sCAAsC,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAE/D,IAAI,MAAM,EAAE;QACV,IAAA,4BAAgB,GAAE,CAAC;QACnB,sCAAsC,CAAC,IAAA,mCAAuB,GAAE,EAAE,MAAM,CAAC,CAAC;KAC3E;IAED,oCAAoC,EAAE,CAAC;IAEvC,IAAI,GAAG,EAAE;QACP,sCAAsC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACtD;AACH,CAAC;AAjBD,4EAiBC","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,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function createFactoryState() {
|
|
4
|
+
return {
|
|
5
|
+
pluginClasses: {}
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function getFactoryState() {
|
|
10
|
+
const scope = globalThis;
|
|
11
|
+
return scope[exports.FACTORY_STATE_SYMBOL] || (scope[exports.FACTORY_STATE_SYMBOL] = createFactoryState()),
|
|
12
|
+
scope[exports.FACTORY_STATE_SYMBOL];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
Object.defineProperty(exports, "__esModule", {
|
|
16
|
+
value: !0
|
|
17
|
+
}), exports.getFactoryState = exports.FACTORY_STATE_SYMBOL = void 0, exports.FACTORY_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/factory-state"),
|
|
18
|
+
exports.getFactoryState = getFactoryState;
|
|
19
|
+
//# sourceMappingURL=factory-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/factory-state.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;AAMvF,SAAS,kBAAkB;IACzB,OAAO;QACL,aAAa,EAAE,EAAE;KAClB,CAAC;AACJ,CAAC;AAED,SAAgB,eAAe;IAC7B,MAAM,KAAK,GAAG,UAA4E,CAAC;IAE3F,IAAI,CAAC,KAAK,CAAC,4BAAoB,CAAC,EAAE;QAChC,KAAK,CAAC,4BAAoB,CAAC,GAAG,kBAAkB,EAAE,CAAC;KACpD;IAED,OAAO,KAAK,CAAC,4BAAoB,CAAkB,CAAC;AACtD,CAAC;AARD,0CAQC","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/cjs/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';
|