@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
package/cjs/factory.js
CHANGED
|
@@ -17,7 +17,9 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
|
-
}), exports.Factory = void 0;
|
|
20
|
+
}), exports.getFactoryState = exports.FACTORY_STATE_SYMBOL = exports.Factory = void 0;
|
|
21
|
+
|
|
22
|
+
const factory_state_1 = require("./factory-state");
|
|
21
23
|
|
|
22
24
|
class Factory {
|
|
23
25
|
static registerPlugin(pluginKey, pluginClass) {
|
|
@@ -28,5 +30,19 @@ class Factory {
|
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
exports.Factory = Factory, Factory._pluginClasses =
|
|
33
|
+
exports.Factory = Factory, Factory._pluginClasses = (0, factory_state_1.getFactoryState)().pluginClasses;
|
|
34
|
+
|
|
35
|
+
var factory_state_2 = require("./factory-state");
|
|
36
|
+
|
|
37
|
+
Object.defineProperty(exports, "FACTORY_STATE_SYMBOL", {
|
|
38
|
+
enumerable: !0,
|
|
39
|
+
get: function() {
|
|
40
|
+
return factory_state_2.FACTORY_STATE_SYMBOL;
|
|
41
|
+
}
|
|
42
|
+
}), Object.defineProperty(exports, "getFactoryState", {
|
|
43
|
+
enumerable: !0,
|
|
44
|
+
get: function() {
|
|
45
|
+
return factory_state_2.getFactoryState;
|
|
46
|
+
}
|
|
47
|
+
}), __exportStar(require("./factory/index"), exports);
|
|
32
48
|
//# sourceMappingURL=factory.js.map
|
package/cjs/factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,MAAa,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;;AATH,0BAUC;AATgB,sBAAc,
|
|
1
|
+
{"version":3,"sources":["../src/factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAkD;AAElD,MAAa,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;;AATH,0BAUC;AATgB,sBAAc,GAAG,IAAA,+BAAe,GAAE,CAAC,aAAa,CAAC;AAWlE,iDAAwE;AAA/D,qHAAA,oBAAoB,OAAA;AAAE,gHAAA,eAAe,OAAA;AAE9C,kDAAgC","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"]}
|
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type IGraphicCreateCallback<TGraphic extends IGraphic = IGraphic, TAttributes = any> = (attributes: TAttributes) => TGraphic;
|
|
4
|
-
declare class GraphicCreator {
|
|
5
|
-
store: Map<string, IGraphicCreateCallback>;
|
|
6
|
-
arc?: (attribute: IArcGraphicAttribute) => IArc;
|
|
7
|
-
area?: (attribute: IAreaGraphicAttribute) => IArea;
|
|
8
|
-
circle?: (attribute: ICircleGraphicAttribute) => ICircle;
|
|
9
|
-
group?: (attribute: IGroupGraphicAttribute) => IGroup;
|
|
10
|
-
image?: (attribute: IImageGraphicAttribute) => IImage;
|
|
11
|
-
line?: (attribute: ILineGraphicAttribute) => ILine;
|
|
12
|
-
path?: (attribute: IPathGraphicAttribute) => IPath;
|
|
13
|
-
rect?: (attribute: IRectGraphicAttribute) => IRect;
|
|
14
|
-
rect3d?: (attribute: IRect3dGraphicAttribute) => IRect3d;
|
|
15
|
-
symbol?: (attribute: ISymbolGraphicAttribute) => ISymbol;
|
|
16
|
-
text?: (attribute: ITextGraphicAttribute) => IText;
|
|
17
|
-
richtext?: (attribute: IRichTextGraphicAttribute) => IRichText;
|
|
18
|
-
polygon?: (attribute: IPolygonGraphicAttribute) => IPolygon;
|
|
19
|
-
shadowRoot?: (attribute: IGroupGraphicAttribute) => IShadowRoot;
|
|
20
|
-
wrapText?: (attribute: IWrapTextGraphicAttribute) => IText;
|
|
21
|
-
constructor();
|
|
22
|
-
registerStore(name: string, creator: IGraphicCreateCallback): void;
|
|
23
|
-
RegisterGraphicCreator(name: string, creator: IGraphicCreateCallback): void;
|
|
24
|
-
CreateGraphic<TGraphic extends IGraphic = IGraphic, TAttributes = any>(name: string, attributes: TAttributes): TGraphic | null;
|
|
25
|
-
}
|
|
26
|
-
export declare const graphicCreator: GraphicCreator;
|
|
27
|
-
export declare function registerGraphic<TGraphic extends IGraphic = IGraphic, TAttributes = any>(name: string, creator: IGraphicCreateCallback<TGraphic, TAttributes>): void;
|
|
28
|
-
export declare function createGraphic<TGraphic extends IGraphic = IGraphic, TAttributes = any>(name: string, attributes: TAttributes): TGraphic;
|
|
29
|
-
export {};
|
|
1
|
+
export { createGraphic, GRAPHIC_REGISTRY_SYMBOL, graphicCreator, getGraphicRegistryState, registerGraphic } from './graphic-registry';
|
|
2
|
+
export type { IGraphicCreateCallback, IGraphicRegistryState } from './graphic-registry';
|
|
@@ -2,48 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.
|
|
5
|
+
}), exports.registerGraphic = exports.getGraphicRegistryState = exports.graphicCreator = exports.GRAPHIC_REGISTRY_SYMBOL = exports.createGraphic = void 0;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
var graphic_registry_1 = require("./graphic-registry");
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return new creator(attributes);
|
|
14
|
-
} catch (error) {
|
|
15
|
-
return creator(attributes);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const sharedGraphicFactory = new graphic_factory_1.GraphicFactory;
|
|
22
|
-
|
|
23
|
-
class GraphicCreator {
|
|
24
|
-
constructor() {
|
|
25
|
-
this.store = new Map;
|
|
9
|
+
Object.defineProperty(exports, "createGraphic", {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: function() {
|
|
12
|
+
return graphic_registry_1.createGraphic;
|
|
26
13
|
}
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
}), Object.defineProperty(exports, "GRAPHIC_REGISTRY_SYMBOL", {
|
|
15
|
+
enumerable: !0,
|
|
16
|
+
get: function() {
|
|
17
|
+
return graphic_registry_1.GRAPHIC_REGISTRY_SYMBOL;
|
|
29
18
|
}
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
}), Object.defineProperty(exports, "graphicCreator", {
|
|
20
|
+
enumerable: !0,
|
|
21
|
+
get: function() {
|
|
22
|
+
return graphic_registry_1.graphicCreator;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
}), Object.defineProperty(exports, "getGraphicRegistryState", {
|
|
25
|
+
enumerable: !0,
|
|
26
|
+
get: function() {
|
|
27
|
+
return graphic_registry_1.getGraphicRegistryState;
|
|
35
28
|
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function createGraphic(name, attributes) {
|
|
44
|
-
return sharedGraphicFactory.create(name, attributes);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
exports.graphicCreator = new GraphicCreator, exports.registerGraphic = registerGraphic,
|
|
48
|
-
exports.createGraphic = createGraphic;
|
|
29
|
+
}), Object.defineProperty(exports, "registerGraphic", {
|
|
30
|
+
enumerable: !0,
|
|
31
|
+
get: function() {
|
|
32
|
+
return graphic_registry_1.registerGraphic;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
49
35
|
//# sourceMappingURL=graphic-creator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/graphic-creator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/graphic/graphic-creator.ts"],"names":[],"mappings":";;;AAAA,uDAM4B;AAL1B,iHAAA,aAAa,OAAA;AACb,2HAAA,uBAAuB,OAAA;AACvB,kHAAA,cAAc,OAAA;AACd,2HAAA,uBAAuB,OAAA;AACvB,mHAAA,eAAe,OAAA","file":"graphic-creator.js","sourcesContent":["export {\n createGraphic,\n GRAPHIC_REGISTRY_SYMBOL,\n graphicCreator,\n getGraphicRegistryState,\n registerGraphic\n} from './graphic-registry';\nexport type { IGraphicCreateCallback, IGraphicRegistryState } from './graphic-registry';\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { GraphicFactory } from '../factory/graphic-factory';
|
|
2
|
+
import type { IArc, IArcGraphicAttribute, IArea, IAreaGraphicAttribute, ICircle, ICircleGraphicAttribute, IGroup, IGroupGraphicAttribute, IImage, IImageGraphicAttribute, ILine, ILineGraphicAttribute, IPath, IPathGraphicAttribute, IPolygon, IPolygonGraphicAttribute, IRect, IRect3d, IRect3dGraphicAttribute, IRectGraphicAttribute, IRichText, IRichTextGraphicAttribute, IShadowRoot, ISymbol, ISymbolGraphicAttribute, IText, ITextGraphicAttribute, IWrapTextGraphicAttribute } from '../interface';
|
|
3
|
+
import type { IGraphic } from '../interface/graphic';
|
|
4
|
+
export type IGraphicCreateCallback<TGraphic extends IGraphic = IGraphic, TAttributes = any> = (attributes: TAttributes) => TGraphic;
|
|
5
|
+
declare class GraphicCreator {
|
|
6
|
+
store: Map<string, IGraphicCreateCallback>;
|
|
7
|
+
arc?: (attribute: IArcGraphicAttribute) => IArc;
|
|
8
|
+
area?: (attribute: IAreaGraphicAttribute) => IArea;
|
|
9
|
+
circle?: (attribute: ICircleGraphicAttribute) => ICircle;
|
|
10
|
+
group?: (attribute: IGroupGraphicAttribute) => IGroup;
|
|
11
|
+
image?: (attribute: IImageGraphicAttribute) => IImage;
|
|
12
|
+
line?: (attribute: ILineGraphicAttribute) => ILine;
|
|
13
|
+
path?: (attribute: IPathGraphicAttribute) => IPath;
|
|
14
|
+
rect?: (attribute: IRectGraphicAttribute) => IRect;
|
|
15
|
+
rect3d?: (attribute: IRect3dGraphicAttribute) => IRect3d;
|
|
16
|
+
symbol?: (attribute: ISymbolGraphicAttribute) => ISymbol;
|
|
17
|
+
text?: (attribute: ITextGraphicAttribute) => IText;
|
|
18
|
+
richtext?: (attribute: IRichTextGraphicAttribute) => IRichText;
|
|
19
|
+
polygon?: (attribute: IPolygonGraphicAttribute) => IPolygon;
|
|
20
|
+
shadowRoot?: (attribute: IGroupGraphicAttribute) => IShadowRoot;
|
|
21
|
+
wrapText?: (attribute: IWrapTextGraphicAttribute) => IText;
|
|
22
|
+
constructor();
|
|
23
|
+
registerStore(name: string, creator: IGraphicCreateCallback): void;
|
|
24
|
+
RegisterGraphicCreator(name: string, creator: IGraphicCreateCallback): void;
|
|
25
|
+
CreateGraphic<TGraphic extends IGraphic = IGraphic, TAttributes = any>(name: string, attributes: TAttributes): TGraphic | null;
|
|
26
|
+
}
|
|
27
|
+
export declare const GRAPHIC_REGISTRY_SYMBOL: unique symbol;
|
|
28
|
+
export interface IGraphicRegistryState {
|
|
29
|
+
graphicCreator: GraphicCreator;
|
|
30
|
+
graphicFactory: GraphicFactory;
|
|
31
|
+
}
|
|
32
|
+
export declare function getGraphicRegistryState(): IGraphicRegistryState;
|
|
33
|
+
export declare const graphicCreator: GraphicCreator;
|
|
34
|
+
export declare function registerGraphic<TGraphic extends IGraphic = IGraphic, TAttributes = any>(name: string, creator: IGraphicCreateCallback<TGraphic, TAttributes>): void;
|
|
35
|
+
export declare function createGraphic<TGraphic extends IGraphic = IGraphic, TAttributes = any>(name: string, attributes: TAttributes): TGraphic;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.createGraphic = exports.registerGraphic = exports.graphicCreator = exports.getGraphicRegistryState = exports.GRAPHIC_REGISTRY_SYMBOL = void 0;
|
|
6
|
+
|
|
7
|
+
const graphic_factory_1 = require("../factory/graphic-factory");
|
|
8
|
+
|
|
9
|
+
function createGraphicCtor(creator) {
|
|
10
|
+
return class {
|
|
11
|
+
constructor(attributes) {
|
|
12
|
+
try {
|
|
13
|
+
return new creator(attributes);
|
|
14
|
+
} catch (error) {
|
|
15
|
+
return creator(attributes);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
class GraphicCreator {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.store = new Map;
|
|
24
|
+
}
|
|
25
|
+
registerStore(name, creator) {
|
|
26
|
+
this.store.set(name, creator), this[name] = creator;
|
|
27
|
+
}
|
|
28
|
+
RegisterGraphicCreator(name, creator) {
|
|
29
|
+
registerGraphic(name, creator);
|
|
30
|
+
}
|
|
31
|
+
CreateGraphic(name, attributes) {
|
|
32
|
+
return this.store.has(name) ? createGraphic(name, attributes) : null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function createGraphicRegistryState() {
|
|
37
|
+
return {
|
|
38
|
+
graphicCreator: new GraphicCreator,
|
|
39
|
+
graphicFactory: new graphic_factory_1.GraphicFactory
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getGraphicRegistryState() {
|
|
44
|
+
const scope = globalThis;
|
|
45
|
+
return scope[exports.GRAPHIC_REGISTRY_SYMBOL] || (scope[exports.GRAPHIC_REGISTRY_SYMBOL] = createGraphicRegistryState()),
|
|
46
|
+
scope[exports.GRAPHIC_REGISTRY_SYMBOL];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
exports.GRAPHIC_REGISTRY_SYMBOL = Symbol.for("@visactor/vrender-core/graphic-registry"),
|
|
50
|
+
exports.getGraphicRegistryState = getGraphicRegistryState;
|
|
51
|
+
|
|
52
|
+
const sharedGraphicRegistry = getGraphicRegistryState();
|
|
53
|
+
|
|
54
|
+
function registerGraphic(name, creator) {
|
|
55
|
+
if (!name) throw new Error("Graphic registration requires a non-empty graphic type");
|
|
56
|
+
exports.graphicCreator.registerStore(name, creator), sharedGraphicRegistry.graphicFactory.register(name, createGraphicCtor(creator));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function createGraphic(name, attributes) {
|
|
60
|
+
return sharedGraphicRegistry.graphicFactory.create(name, attributes);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
exports.graphicCreator = sharedGraphicRegistry.graphicCreator, exports.registerGraphic = registerGraphic,
|
|
64
|
+
exports.createGraphic = createGraphic;
|
|
65
|
+
//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CAAC,+BAAuB,CAAC,EAAE;QACnC,KAAK,CAAC,+BAAuB,CAAC,GAAG,0BAA0B,EAAE,CAAC;KAC/D;IAED,OAAO,KAAK,CAAC,+BAAuB,CAA0B,CAAC;AACjE,CAAC;AARD,0DAQC;AAED,MAAM,qBAAqB,GAAG,uBAAuB,EAAE,CAAC;AAE3C,QAAA,cAAc,GAAG,qBAAqB,CAAC,cAAc,CAAC;AAEnE,SAAgB,eAAe,CAC7B,IAAY,EACZ,OAAsD;IAEtD,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;KAC3E;IAED,sBAAc,CAAC,aAAa,CAAC,IAAI,EAAE,OAAiC,CAAC,CAAC;IACtE,qBAAqB,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;AAClF,CAAC;AAVD,0CAUC;AAED,SAAgB,aAAa,CAC3B,IAAY,EACZ,UAAuB;IAEvB,OAAO,qBAAqB,CAAC,cAAc,CAAC,MAAM,CAAwB,IAAI,EAAE,UAAU,CAAC,CAAC;AAC9F,CAAC;AALD,sCAKC","file":"graphic-registry.js","sourcesContent":["import { GraphicFactory } from '../factory/graphic-factory';\nimport type {\n IArc,\n IArcGraphicAttribute,\n IArea,\n IAreaGraphicAttribute,\n ICircle,\n ICircleGraphicAttribute,\n IGroup,\n IGroupGraphicAttribute,\n IImage,\n IImageGraphicAttribute,\n ILine,\n ILineGraphicAttribute,\n IPath,\n IPathGraphicAttribute,\n IPolygon,\n IPolygonGraphicAttribute,\n IRect,\n IRect3d,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IRichText,\n IRichTextGraphicAttribute,\n IShadowRoot,\n ISymbol,\n ISymbolGraphicAttribute,\n IText,\n ITextGraphicAttribute,\n IWrapTextGraphicAttribute\n} from '../interface';\nimport type { IGraphic } from '../interface/graphic';\n\nexport type IGraphicCreateCallback<TGraphic extends IGraphic = IGraphic, TAttributes = any> = (\n attributes: TAttributes\n) => TGraphic;\n\nfunction createGraphicCtor<TGraphic extends IGraphic = IGraphic, TAttributes = any>(\n creator: IGraphicCreateCallback<TGraphic, TAttributes>\n) {\n return class RegisteredGraphicCtor {\n constructor(attributes: TAttributes) {\n try {\n return new (creator as any)(attributes);\n } catch (error) {\n return creator(attributes);\n }\n }\n } as any;\n}\n\nclass GraphicCreator {\n declare store: Map<string, IGraphicCreateCallback>;\n declare arc?: (attribute: IArcGraphicAttribute) => IArc;\n declare area?: (attribute: IAreaGraphicAttribute) => IArea;\n declare circle?: (attribute: ICircleGraphicAttribute) => ICircle;\n declare group?: (attribute: IGroupGraphicAttribute) => IGroup;\n declare image?: (attribute: IImageGraphicAttribute) => IImage;\n declare line?: (attribute: ILineGraphicAttribute) => ILine;\n declare path?: (attribute: IPathGraphicAttribute) => IPath;\n declare rect?: (attribute: IRectGraphicAttribute) => IRect;\n declare rect3d?: (attribute: IRect3dGraphicAttribute) => IRect3d;\n declare symbol?: (attribute: ISymbolGraphicAttribute) => ISymbol;\n declare text?: (attribute: ITextGraphicAttribute) => IText;\n declare richtext?: (attribute: IRichTextGraphicAttribute) => IRichText;\n declare polygon?: (attribute: IPolygonGraphicAttribute) => IPolygon;\n declare shadowRoot?: (attribute: IGroupGraphicAttribute) => IShadowRoot;\n declare wrapText?: (attribute: IWrapTextGraphicAttribute) => IText;\n\n constructor() {\n this.store = new Map();\n }\n\n registerStore(name: string, creator: IGraphicCreateCallback) {\n this.store.set(name, creator);\n (this as any)[name] = creator;\n }\n\n RegisterGraphicCreator(name: string, creator: IGraphicCreateCallback) {\n registerGraphic(name, creator);\n }\n\n CreateGraphic<TGraphic extends IGraphic = IGraphic, TAttributes = any>(\n name: string,\n attributes: TAttributes\n ): TGraphic | null {\n if (!this.store.has(name)) {\n return null;\n }\n\n return createGraphic<TGraphic, TAttributes>(name, attributes);\n }\n}\n\nexport const GRAPHIC_REGISTRY_SYMBOL = Symbol.for('@visactor/vrender-core/graphic-registry');\n\nexport interface IGraphicRegistryState {\n graphicCreator: GraphicCreator;\n graphicFactory: GraphicFactory;\n}\n\nfunction createGraphicRegistryState(): IGraphicRegistryState {\n return {\n graphicCreator: new GraphicCreator(),\n graphicFactory: new GraphicFactory()\n };\n}\n\nexport function getGraphicRegistryState(): IGraphicRegistryState {\n const scope = globalThis as typeof globalThis & { [GRAPHIC_REGISTRY_SYMBOL]?: IGraphicRegistryState };\n\n if (!scope[GRAPHIC_REGISTRY_SYMBOL]) {\n scope[GRAPHIC_REGISTRY_SYMBOL] = createGraphicRegistryState();\n }\n\n return scope[GRAPHIC_REGISTRY_SYMBOL] as IGraphicRegistryState;\n}\n\nconst sharedGraphicRegistry = getGraphicRegistryState();\n\nexport const graphicCreator = sharedGraphicRegistry.graphicCreator;\n\nexport function registerGraphic<TGraphic extends IGraphic = IGraphic, TAttributes = any>(\n name: string,\n creator: IGraphicCreateCallback<TGraphic, TAttributes>\n) {\n if (!name) {\n throw new Error('Graphic registration requires a non-empty graphic type');\n }\n\n graphicCreator.registerStore(name, creator as IGraphicCreateCallback);\n sharedGraphicRegistry.graphicFactory.register(name, createGraphicCtor(creator));\n}\n\nexport function createGraphic<TGraphic extends IGraphic = IGraphic, TAttributes = any>(\n name: string,\n attributes: TAttributes\n): TGraphic {\n return sharedGraphicRegistry.graphicFactory.create<TGraphic, TAttributes>(name, attributes);\n}\n"]}
|
package/cjs/graphic/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export * from './shadow-root';
|
|
|
22
22
|
export * from './config';
|
|
23
23
|
export * from './graphic-service/graphic-service';
|
|
24
24
|
export * from './graphic-creator';
|
|
25
|
+
export { GRAPHIC_REGISTRY_SYMBOL, getGraphicRegistryState } from './graphic-registry';
|
|
26
|
+
export type { IGraphicRegistryState } from './graphic-registry';
|
|
25
27
|
export * from './builtin-symbol';
|
|
26
28
|
export * from './graphic';
|
|
27
29
|
export * from './bounds';
|
package/cjs/graphic/index.js
CHANGED
|
@@ -17,22 +17,35 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
|
-
}), exports.StateDefinitionCompiler = exports.StateEngine = void 0,
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./
|
|
24
|
-
__exportStar(require("./
|
|
25
|
-
__exportStar(require("./
|
|
26
|
-
__exportStar(require("./
|
|
27
|
-
__exportStar(require("./
|
|
28
|
-
__exportStar(require("./
|
|
29
|
-
__exportStar(require("./
|
|
30
|
-
__exportStar(require("./
|
|
31
|
-
__exportStar(require("./
|
|
32
|
-
__exportStar(require("./graphic-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
}), exports.StateDefinitionCompiler = exports.StateEngine = exports.getGraphicRegistryState = exports.GRAPHIC_REGISTRY_SYMBOL = void 0,
|
|
21
|
+
__exportStar(require("./node-tree"), exports), __exportStar(require("./circle"), exports),
|
|
22
|
+
__exportStar(require("./text"), exports), __exportStar(require("./wrap-text"), exports),
|
|
23
|
+
__exportStar(require("./symbol"), exports), __exportStar(require("./builtin-symbol"), exports),
|
|
24
|
+
__exportStar(require("./line"), exports), __exportStar(require("./rect"), exports),
|
|
25
|
+
__exportStar(require("./rect3d"), exports), __exportStar(require("./glyph"), exports),
|
|
26
|
+
__exportStar(require("./richtext"), exports), __exportStar(require("./path"), exports),
|
|
27
|
+
__exportStar(require("./area"), exports), __exportStar(require("./image"), exports),
|
|
28
|
+
__exportStar(require("./arc"), exports), __exportStar(require("./star"), exports),
|
|
29
|
+
__exportStar(require("./arc3d"), exports), __exportStar(require("./group"), exports),
|
|
30
|
+
__exportStar(require("./polygon"), exports), __exportStar(require("./pyramid3d"), exports),
|
|
31
|
+
__exportStar(require("./shadow-root"), exports), __exportStar(require("./config"), exports),
|
|
32
|
+
__exportStar(require("./graphic-service/graphic-service"), exports), __exportStar(require("./graphic-creator"), exports);
|
|
33
|
+
|
|
34
|
+
var graphic_registry_1 = require("./graphic-registry");
|
|
35
|
+
|
|
36
|
+
Object.defineProperty(exports, "GRAPHIC_REGISTRY_SYMBOL", {
|
|
37
|
+
enumerable: !0,
|
|
38
|
+
get: function() {
|
|
39
|
+
return graphic_registry_1.GRAPHIC_REGISTRY_SYMBOL;
|
|
40
|
+
}
|
|
41
|
+
}), Object.defineProperty(exports, "getGraphicRegistryState", {
|
|
42
|
+
enumerable: !0,
|
|
43
|
+
get: function() {
|
|
44
|
+
return graphic_registry_1.getGraphicRegistryState;
|
|
45
|
+
}
|
|
46
|
+
}), __exportStar(require("./builtin-symbol"), exports), __exportStar(require("./graphic"), exports),
|
|
47
|
+
__exportStar(require("./bounds"), exports), __exportStar(require("./theme"), exports),
|
|
48
|
+
__exportStar(require("./tools"), exports), __exportStar(require("./constants"), exports);
|
|
36
49
|
|
|
37
50
|
var state_engine_1 = require("./state/state-engine");
|
|
38
51
|
|
package/cjs/graphic/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB;AACzB,yCAAuB;AACvB,8CAA4B;AAC5B,2CAAyB;AACzB,mDAAiC;AACjC,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,0CAAwB;AACxB,6CAA2B;AAC3B,yCAAuB;AACvB,yCAAuB;AACvB,0CAAwB;AACxB,wCAAsB;AACtB,yCAAuB;AACvB,0CAAwB;AACxB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,gDAA8B;AAC9B,2CAAyB;AACzB,oEAAkD;AAClD,oDAAkC;AAClC,mDAAiC;AACjC,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,8CAA4B;AAC5B,qDAAmD;AAA1C,2GAAA,WAAW,OAAA;AACpB,+EAA4E;AAAnE,oIAAA,uBAAuB,OAAA","file":"index.js","sourcesContent":["export * from './node-tree';\nexport * from './circle';\nexport * from './text';\nexport * from './wrap-text';\nexport * from './symbol';\nexport * from './builtin-symbol';\nexport * from './line';\nexport * from './rect';\nexport * from './rect3d';\nexport * from './glyph';\nexport * from './richtext';\nexport * from './path';\nexport * from './area';\nexport * from './image';\nexport * from './arc';\nexport * from './star';\nexport * from './arc3d';\nexport * from './group';\nexport * from './polygon';\nexport * from './pyramid3d';\nexport * from './shadow-root';\nexport * from './config';\nexport * from './graphic-service/graphic-service';\nexport * from './graphic-creator';\nexport * from './builtin-symbol';\nexport * from './graphic';\nexport * from './bounds';\nexport * from './theme';\nexport * from './tools';\nexport * from './constants';\nexport { StateEngine } from './state/state-engine';\nexport { StateDefinitionCompiler } from './state/state-definition-compiler';\nexport type {\n StateDefinition,\n CompiledStateDefinition,\n StateResolveContext,\n StateDefinitionsInput,\n StateTransitionResult,\n IStateEngineOptions\n} from './state/state-definition';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB;AACzB,yCAAuB;AACvB,8CAA4B;AAC5B,2CAAyB;AACzB,mDAAiC;AACjC,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,0CAAwB;AACxB,6CAA2B;AAC3B,yCAAuB;AACvB,yCAAuB;AACvB,0CAAwB;AACxB,wCAAsB;AACtB,yCAAuB;AACvB,0CAAwB;AACxB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,gDAA8B;AAC9B,2CAAyB;AACzB,oEAAkD;AAClD,oDAAkC;AAClC,uDAAsF;AAA7E,2HAAA,uBAAuB,OAAA;AAAE,2HAAA,uBAAuB,OAAA;AAEzD,mDAAiC;AACjC,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,8CAA4B;AAC5B,qDAAmD;AAA1C,2GAAA,WAAW,OAAA;AACpB,+EAA4E;AAAnE,oIAAA,uBAAuB,OAAA","file":"index.js","sourcesContent":["export * from './node-tree';\nexport * from './circle';\nexport * from './text';\nexport * from './wrap-text';\nexport * from './symbol';\nexport * from './builtin-symbol';\nexport * from './line';\nexport * from './rect';\nexport * from './rect3d';\nexport * from './glyph';\nexport * from './richtext';\nexport * from './path';\nexport * from './area';\nexport * from './image';\nexport * from './arc';\nexport * from './star';\nexport * from './arc3d';\nexport * from './group';\nexport * from './polygon';\nexport * from './pyramid3d';\nexport * from './shadow-root';\nexport * from './config';\nexport * from './graphic-service/graphic-service';\nexport * from './graphic-creator';\nexport { GRAPHIC_REGISTRY_SYMBOL, getGraphicRegistryState } from './graphic-registry';\nexport type { IGraphicRegistryState } from './graphic-registry';\nexport * from './builtin-symbol';\nexport * from './graphic';\nexport * from './bounds';\nexport * from './theme';\nexport * from './tools';\nexport * from './constants';\nexport { StateEngine } from './state/state-engine';\nexport { StateDefinitionCompiler } from './state/state-definition-compiler';\nexport type {\n StateDefinition,\n CompiledStateDefinition,\n StateResolveContext,\n StateDefinitionsInput,\n StateTransitionResult,\n IStateEngineOptions\n} from './state/state-definition';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ILegacyBindingContext } from './binding-context';
|
|
2
|
+
export declare const LEGACY_BOOTSTRAP_STATE_SYMBOL: unique symbol;
|
|
3
|
+
export interface ILegacyBootstrapState {
|
|
4
|
+
legacyBindingContext: ILegacyBindingContext;
|
|
5
|
+
preloaded: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function getLegacyBootstrapState(): ILegacyBootstrapState;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.getLegacyBootstrapState = exports.LEGACY_BOOTSTRAP_STATE_SYMBOL = void 0;
|
|
6
|
+
|
|
7
|
+
const binding_context_1 = require("./binding-context");
|
|
8
|
+
|
|
9
|
+
function createLegacyBootstrapState() {
|
|
10
|
+
return {
|
|
11
|
+
legacyBindingContext: (0, binding_context_1.createLegacyBindingContext)(),
|
|
12
|
+
preloaded: !1
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getLegacyBootstrapState() {
|
|
17
|
+
const scope = globalThis;
|
|
18
|
+
return scope[exports.LEGACY_BOOTSTRAP_STATE_SYMBOL] || (scope[exports.LEGACY_BOOTSTRAP_STATE_SYMBOL] = createLegacyBootstrapState()),
|
|
19
|
+
scope[exports.LEGACY_BOOTSTRAP_STATE_SYMBOL];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.LEGACY_BOOTSTRAP_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/legacy-bootstrap-state"),
|
|
23
|
+
exports.getLegacyBootstrapState = getLegacyBootstrapState;
|
|
24
|
+
//# sourceMappingURL=bootstrap-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/legacy/bootstrap-state.ts"],"names":[],"mappings":";;;AAAA,uDAA2F;AAE9E,QAAA,6BAA6B,GAAG,MAAM,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;AAOzG,SAAS,0BAA0B;IACjC,OAAO;QACL,oBAAoB,EAAE,IAAA,4CAA0B,GAAE;QAClD,SAAS,EAAE,KAAK;KACjB,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB;IACrC,MAAM,KAAK,GAAG,UAA6F,CAAC;IAE5G,IAAI,CAAC,KAAK,CAAC,qCAA6B,CAAC,EAAE;QACzC,KAAK,CAAC,qCAA6B,CAAC,GAAG,0BAA0B,EAAE,CAAC;KACrE;IAED,OAAO,KAAK,CAAC,qCAA6B,CAA0B,CAAC;AACvE,CAAC;AARD,0DAQC","file":"bootstrap-state.js","sourcesContent":["import { createLegacyBindingContext, type ILegacyBindingContext } from './binding-context';\n\nexport const LEGACY_BOOTSTRAP_STATE_SYMBOL = Symbol.for('@visactor/vrender-core/legacy-bootstrap-state');\n\nexport interface ILegacyBootstrapState {\n legacyBindingContext: ILegacyBindingContext;\n preloaded: boolean;\n}\n\nfunction createLegacyBootstrapState(): ILegacyBootstrapState {\n return {\n legacyBindingContext: createLegacyBindingContext(),\n preloaded: false\n };\n}\n\nexport function getLegacyBootstrapState(): ILegacyBootstrapState {\n const scope = globalThis as typeof globalThis & { [LEGACY_BOOTSTRAP_STATE_SYMBOL]?: ILegacyBootstrapState };\n\n if (!scope[LEGACY_BOOTSTRAP_STATE_SYMBOL]) {\n scope[LEGACY_BOOTSTRAP_STATE_SYMBOL] = createLegacyBootstrapState();\n }\n\n return scope[LEGACY_BOOTSTRAP_STATE_SYMBOL] as ILegacyBootstrapState;\n}\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ILegacyBindingContext } from './binding-context';
|
|
2
2
|
export type { ILegacyBindContext, ILegacyBindingContext } from './binding-context';
|
|
3
3
|
export declare function preLoadAllModule(): void;
|
|
4
|
-
export declare namespace preLoadAllModule {
|
|
5
|
-
var __loaded: boolean;
|
|
6
|
-
}
|
|
7
4
|
export declare function getLegacyBindingContext(): ILegacyBindingContext;
|
|
8
5
|
export declare function resolveLegacySingleton<T>(serviceIdentifier: any): T;
|
|
6
|
+
export { LEGACY_BOOTSTRAP_STATE_SYMBOL, getLegacyBootstrapState } from './bootstrap-state';
|
|
7
|
+
export type { ILegacyBootstrapState } from './bootstrap-state';
|
|
9
8
|
export declare function resolveLegacyNamed<T>(serviceIdentifier: any, name: string): T | undefined;
|
|
10
9
|
export declare function createLegacySingletonProxy<T extends object>(resolver: () => T): T;
|
package/cjs/legacy/bootstrap.js
CHANGED
|
@@ -8,10 +8,10 @@ var __importDefault = this && this.__importDefault || function(mod) {
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", {
|
|
10
10
|
value: !0
|
|
11
|
-
}), exports.createLegacySingletonProxy = exports.resolveLegacyNamed = exports.resolveLegacySingleton = exports.getLegacyBindingContext = exports.preLoadAllModule = void 0;
|
|
11
|
+
}), exports.createLegacySingletonProxy = exports.resolveLegacyNamed = exports.getLegacyBootstrapState = exports.LEGACY_BOOTSTRAP_STATE_SYMBOL = exports.resolveLegacySingleton = exports.getLegacyBindingContext = exports.preLoadAllModule = void 0;
|
|
12
12
|
|
|
13
|
-
const core_modules_1 = __importDefault(require("../core/core-modules")), render_modules_1 = __importDefault(require("../render/render-modules")), pick_modules_1 = __importDefault(require("../picker/pick-modules")), graphic_module_1 = __importDefault(require("../graphic/graphic-service/graphic-module")), plugin_modules_1 = __importDefault(require("../plugins/plugin-modules")), modules_1 = __importDefault(require("../core/contributions/modules")), modules_2 = __importDefault(require("../render/contributions/modules")),
|
|
14
|
-
|
|
13
|
+
const core_modules_1 = __importDefault(require("../core/core-modules")), render_modules_1 = __importDefault(require("../render/render-modules")), pick_modules_1 = __importDefault(require("../picker/pick-modules")), graphic_module_1 = __importDefault(require("../graphic/graphic-service/graphic-module")), plugin_modules_1 = __importDefault(require("../plugins/plugin-modules")), modules_1 = __importDefault(require("../core/contributions/modules")), modules_2 = __importDefault(require("../render/contributions/modules")), bootstrap_state_1 = require("./bootstrap-state"), legacyBootstrapState = (0,
|
|
14
|
+
bootstrap_state_1.getLegacyBootstrapState)(), legacyBindingContext = legacyBootstrapState.legacyBindingContext;
|
|
15
15
|
|
|
16
16
|
function getLegacyTarget(resolver) {
|
|
17
17
|
let target;
|
|
@@ -19,7 +19,7 @@ function getLegacyTarget(resolver) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function preLoadAllModule() {
|
|
22
|
-
|
|
22
|
+
legacyBootstrapState.preloaded || (legacyBootstrapState.preloaded = !0, (0, core_modules_1.default)({
|
|
23
23
|
bind: legacyBindingContext.bind
|
|
24
24
|
}), (0, graphic_module_1.default)({
|
|
25
25
|
bind: legacyBindingContext.bind
|
|
@@ -43,6 +43,11 @@ function resolveLegacySingleton(serviceIdentifier) {
|
|
|
43
43
|
return instance;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
exports.preLoadAllModule = preLoadAllModule, exports.getLegacyBindingContext = getLegacyBindingContext,
|
|
47
|
+
exports.resolveLegacySingleton = resolveLegacySingleton;
|
|
48
|
+
|
|
49
|
+
var bootstrap_state_2 = require("./bootstrap-state");
|
|
50
|
+
|
|
46
51
|
function resolveLegacyNamed(serviceIdentifier, name) {
|
|
47
52
|
return preLoadAllModule(), legacyBindingContext.getNamed(serviceIdentifier, name);
|
|
48
53
|
}
|
|
@@ -66,7 +71,15 @@ function createLegacySingletonProxy(resolver) {
|
|
|
66
71
|
});
|
|
67
72
|
}
|
|
68
73
|
|
|
69
|
-
exports
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
Object.defineProperty(exports, "LEGACY_BOOTSTRAP_STATE_SYMBOL", {
|
|
75
|
+
enumerable: !0,
|
|
76
|
+
get: function() {
|
|
77
|
+
return bootstrap_state_2.LEGACY_BOOTSTRAP_STATE_SYMBOL;
|
|
78
|
+
}
|
|
79
|
+
}), Object.defineProperty(exports, "getLegacyBootstrapState", {
|
|
80
|
+
enumerable: !0,
|
|
81
|
+
get: function() {
|
|
82
|
+
return bootstrap_state_2.getLegacyBootstrapState;
|
|
83
|
+
}
|
|
84
|
+
}), exports.resolveLegacyNamed = resolveLegacyNamed, exports.createLegacySingletonProxy = createLegacySingletonProxy;
|
|
72
85
|
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/legacy/bootstrap.ts"],"names":[],"mappings":";;;;;;AAAA,wEAA8C;AAC9C,8EAAoD;AACpD,0EAAgD;AAChD,+FAAsE;AACtE,+EAAqD;AACrD,4EAAqE;AACrE,8EAAsE;
|
|
1
|
+
{"version":3,"sources":["../src/legacy/bootstrap.ts"],"names":[],"mappings":";;;;;;AAAA,wEAA8C;AAC9C,8EAAoD;AACpD,0EAAgD;AAChD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aAClB;YAED,uCACK,UAAU,KACb,YAAY,EAAE,IAAI,IAClB;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA/BD,gEA+BC","file":"bootstrap.js","sourcesContent":["import coreModule from '../core/core-modules';\nimport renderModule from '../render/render-modules';\nimport pickModule from '../picker/pick-modules';\nimport graphicModule from '../graphic/graphic-service/graphic-module';\nimport pluginModule from '../plugins/plugin-modules';\nimport loadBuiltinContributions from '../core/contributions/modules';\nimport loadRenderContributions from '../render/contributions/modules';\nimport type { ILegacyBindContext, ILegacyBindingContext } from './binding-context';\nimport { getLegacyBootstrapState } from './bootstrap-state';\n\nexport type { ILegacyBindContext, ILegacyBindingContext } from './binding-context';\n\nconst legacyBootstrapState = getLegacyBootstrapState();\nconst legacyBindingContext = legacyBootstrapState.legacyBindingContext;\n\nfunction getLegacyTarget<T>(resolver: () => T): () => T {\n let target: T | undefined;\n\n return () => {\n if (target === undefined) {\n target = resolver();\n }\n\n return target;\n };\n}\n\nexport function preLoadAllModule() {\n if (legacyBootstrapState.preloaded) {\n return;\n }\n legacyBootstrapState.preloaded = true;\n coreModule({ bind: legacyBindingContext.bind });\n graphicModule({ bind: legacyBindingContext.bind });\n renderModule({ bind: legacyBindingContext.bind });\n pickModule({ bind: legacyBindingContext.bind, isBound: legacyBindingContext.isBound });\n pluginModule({ bind: legacyBindingContext.bind });\n loadBuiltinContributions(legacyBindingContext);\n loadRenderContributions(legacyBindingContext);\n}\n\nexport function getLegacyBindingContext(): ILegacyBindingContext {\n return legacyBindingContext;\n}\n\nexport function resolveLegacySingleton<T>(serviceIdentifier: any): T {\n preLoadAllModule();\n const [instance] = legacyBindingContext.getAll<T>(serviceIdentifier);\n return instance;\n}\n\nexport { LEGACY_BOOTSTRAP_STATE_SYMBOL, getLegacyBootstrapState } from './bootstrap-state';\nexport type { ILegacyBootstrapState } from './bootstrap-state';\n\nexport function resolveLegacyNamed<T>(serviceIdentifier: any, name: string): T | undefined {\n preLoadAllModule();\n return legacyBindingContext.getNamed<T>(serviceIdentifier, name);\n}\n\nexport function createLegacySingletonProxy<T extends object>(resolver: () => T): T {\n const getTarget = getLegacyTarget(resolver);\n\n return new Proxy({} as T, {\n get(_target, property) {\n const value = (getTarget() as any)[property];\n return typeof value === 'function' ? value.bind(getTarget()) : value;\n },\n set(_target, property, value) {\n (getTarget() as any)[property] = value;\n return true;\n },\n has(_target, property) {\n return property in (getTarget() as any);\n },\n ownKeys() {\n return Reflect.ownKeys(getTarget() as any);\n },\n getOwnPropertyDescriptor(_target, property) {\n const descriptor = Object.getOwnPropertyDescriptor(getTarget() as any, property);\n\n if (!descriptor) {\n return undefined;\n }\n\n return {\n ...descriptor,\n configurable: true\n };\n }\n });\n}\n"]}
|