@visactor/vrender-core 1.1.3-alpha.5 → 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/canvas-allocate.js +2 -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 +19 -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/event-listener-manager.js +2 -1
- package/cjs/common/performance-raf.js +1 -2
- package/cjs/common/polygon.js +2 -2
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +1 -1
- package/cjs/common/render-curve.js +1 -1
- package/cjs/common/render-utils.js +1 -1
- package/cjs/common/seg-context.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +2 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +1 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.js +1 -1
- package/cjs/core/window.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/canvas-allocate.js +2 -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 +5 -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/event-listener-manager.js +2 -1
- package/es/common/performance-raf.js +1 -2
- package/es/common/polygon.js +1 -1
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +1 -1
- package/es/common/render-curve.js +1 -1
- package/es/common/render-utils.js +1 -1
- package/es/common/seg-context.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +2 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +1 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.js +1 -1
- package/es/core/window.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 +9 -1
|
@@ -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,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EAAE;QAC/B,IAAI,MAAM,KAAK,kBAAkB,EAAE;YACjC,uBAAuB,GAAG,IAAI,CAAC;SAChC;aAAM,IAAI,MAAM,KAAK,mBAAmB,EAAE;YACzC,wBAAwB,GAAG,IAAI,CAAC;SACjC;aAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE;YACxC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAClC;IACH,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;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AAO,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 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';
|
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
|
+
//# sourceMappingURL=graphic-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graphic/graphic-registry.ts"],"names":[],"mappings":";;;AAAA,gEAA4D;AAqC5D,SAAS,iBAAiB,CACxB,OAAsD;IAEtD,OAAO,MAAM,qBAAqB;QAChC,YAAY,UAAuB;YACjC,IAAI;gBACF,OAAO,IAAK,OAAe,CAAC,UAAU,CAAC,CAAC;aACzC;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;aAC5B;QACH,CAAC;KACK,CAAC;AACX,CAAC;AAED,MAAM,cAAc;IAkBlB;QACE,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;IACzB,CAAC;IAED,aAAa,CAAC,IAAY,EAAE,OAA+B;QACzD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC7B,IAAY,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;IAChC,CAAC;IAED,sBAAsB,CAAC,IAAY,EAAE,OAA+B;QAClE,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,aAAa,CACX,IAAY,EACZ,UAAuB;QAEvB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACzB,OAAO,IAAI,CAAC;SACb;QAED,OAAO,aAAa,CAAwB,IAAI,EAAE,UAAU,CAAC,CAAC;IAChE,CAAC;CACF;AAEY,QAAA,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;AAO7F,SAAS,0BAA0B;IACjC,OAAO;QACL,cAAc,EAAE,IAAI,cAAc,EAAE;QACpC,cAAc,EAAE,IAAI,gCAAc,EAAE;KACrC,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB;IACrC,MAAM,KAAK,GAAG,UAAuF,CAAC;IAEtG,IAAI,CAAC,KAAK,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;
|