@visactor/vrender-kits 1.1.0-alpha.24 → 1.1.0-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/canvas/contributions/create-canvas-module.js +1 -1
- package/cjs/canvas/contributions/modules.js +1 -1
- package/cjs/env/contributions/browser-contribution.js +1 -1
- package/cjs/env/contributions/canvas-wrap.js +1 -1
- package/cjs/installers/browser-lite.d.ts +3 -0
- package/cjs/installers/browser-lite.js +63 -0
- package/cjs/installers/browser-lite.js.map +1 -0
- package/cjs/installers/browser.d.ts +3 -0
- package/cjs/installers/browser.js +75 -0
- package/cjs/installers/browser.js.map +1 -0
- package/cjs/installers/graphics-lite.d.ts +2 -0
- package/cjs/installers/graphics-lite.js +54 -0
- package/cjs/installers/graphics-lite.js.map +1 -0
- package/cjs/installers/graphics.d.ts +2 -0
- package/cjs/installers/graphics.js +81 -0
- package/cjs/installers/graphics.js.map +1 -0
- package/cjs/jsx/graphicType.d.ts +4 -4
- package/cjs/jsx/graphicType.js.map +1 -1
- package/cjs/jsx/jsx-classic.js +3 -3
- package/cjs/jsx/jsx-classic.js.map +1 -1
- package/cjs/picker/math-module.js +1 -2
- package/cjs/react-tree.js +3 -3
- package/cjs/react-tree.js.map +1 -1
- package/cjs/register/env.js +2 -2
- package/cjs/register/env.js.map +1 -1
- package/cjs/register/register-arc.js +3 -3
- package/cjs/register/register-arc.js.map +1 -1
- package/cjs/register/register-arc3d.js +4 -4
- package/cjs/register/register-arc3d.js.map +1 -1
- package/cjs/register/register-area.js +3 -3
- package/cjs/register/register-area.js.map +1 -1
- package/cjs/register/register-circle.js +3 -3
- package/cjs/register/register-circle.js.map +1 -1
- package/cjs/register/register-gif.js +2 -1
- package/cjs/register/register-glyph.js +3 -3
- package/cjs/register/register-glyph.js.map +1 -1
- package/cjs/register/register-group.js +2 -2
- package/cjs/register/register-group.js.map +1 -1
- package/cjs/register/register-image.js +3 -3
- package/cjs/register/register-image.js.map +1 -1
- package/cjs/register/register-line.js +3 -3
- package/cjs/register/register-line.js.map +1 -1
- package/cjs/register/register-path.js +3 -3
- package/cjs/register/register-path.js.map +1 -1
- package/cjs/register/register-polygon.js +3 -3
- package/cjs/register/register-polygon.js.map +1 -1
- package/cjs/register/register-pyramid3d.js +4 -4
- package/cjs/register/register-pyramid3d.js.map +1 -1
- package/cjs/register/register-rect.js +3 -3
- package/cjs/register/register-rect.js.map +1 -1
- package/cjs/register/register-rect3d.js +4 -5
- package/cjs/register/register-rect3d.js.map +1 -1
- package/cjs/register/register-richtext.js +3 -3
- package/cjs/register/register-richtext.js.map +1 -1
- package/cjs/register/register-shadowRoot.js +2 -2
- package/cjs/register/register-shadowRoot.js.map +1 -1
- package/cjs/register/register-star.js +3 -3
- package/cjs/register/register-star.js.map +1 -1
- package/cjs/register/register-symbol.js +3 -3
- package/cjs/register/register-symbol.js.map +1 -1
- package/cjs/register/register-text.js +3 -3
- package/cjs/register/register-text.js.map +1 -1
- package/cjs/register/register-wraptext.js +2 -2
- package/cjs/register/register-wraptext.js.map +1 -1
- package/cjs/tools/dynamicTexture.js +0 -2
- package/dist/index.es.js +13392 -267
- package/es/canvas/contributions/create-canvas-module.js +1 -1
- package/es/canvas/contributions/modules.js +1 -1
- package/es/env/contributions/browser-contribution.js +1 -1
- package/es/env/contributions/canvas-wrap.js +1 -1
- package/es/installers/browser-lite.d.ts +3 -0
- package/es/installers/browser-lite.js +86 -0
- package/es/installers/browser-lite.js.map +1 -0
- package/es/installers/browser.d.ts +3 -0
- package/es/installers/browser.js +115 -0
- package/es/installers/browser.js.map +1 -0
- package/es/installers/graphics-lite.d.ts +2 -0
- package/es/installers/graphics-lite.js +52 -0
- package/es/installers/graphics-lite.js.map +1 -0
- package/es/installers/graphics.d.ts +2 -0
- package/es/installers/graphics.js +79 -0
- package/es/installers/graphics.js.map +1 -0
- package/es/jsx/graphicType.d.ts +4 -4
- package/es/jsx/graphicType.js.map +1 -1
- package/es/jsx/jsx-classic.js +3 -3
- package/es/jsx/jsx-classic.js.map +1 -1
- package/es/picker/math-module.js +1 -2
- package/es/react-tree.js +3 -3
- package/es/react-tree.js.map +1 -1
- package/es/register/env.js +1 -1
- package/es/register/env.js.map +1 -1
- package/es/register/register-arc.js +5 -1
- package/es/register/register-arc.js.map +1 -1
- package/es/register/register-arc3d.js +7 -1
- package/es/register/register-arc3d.js.map +1 -1
- package/es/register/register-area.js +5 -1
- package/es/register/register-area.js.map +1 -1
- package/es/register/register-circle.js +5 -1
- package/es/register/register-circle.js.map +1 -1
- package/es/register/register-gif.js +2 -1
- package/es/register/register-glyph.js +5 -1
- package/es/register/register-glyph.js.map +1 -1
- package/es/register/register-group.js +1 -1
- package/es/register/register-group.js.map +1 -1
- package/es/register/register-image.js +5 -1
- package/es/register/register-image.js.map +1 -1
- package/es/register/register-line.js +5 -1
- package/es/register/register-line.js.map +1 -1
- package/es/register/register-path.js +5 -1
- package/es/register/register-path.js.map +1 -1
- package/es/register/register-polygon.js +5 -1
- package/es/register/register-polygon.js.map +1 -1
- package/es/register/register-pyramid3d.js +7 -1
- package/es/register/register-pyramid3d.js.map +1 -1
- package/es/register/register-rect.js +5 -1
- package/es/register/register-rect.js.map +1 -1
- package/es/register/register-rect3d.js +6 -3
- package/es/register/register-rect3d.js.map +1 -1
- package/es/register/register-richtext.js +5 -1
- package/es/register/register-richtext.js.map +1 -1
- package/es/register/register-shadowRoot.js +1 -1
- package/es/register/register-shadowRoot.js.map +1 -1
- package/es/register/register-star.js +5 -1
- package/es/register/register-star.js.map +1 -1
- package/es/register/register-symbol.js +5 -1
- package/es/register/register-symbol.js.map +1 -1
- package/es/register/register-text.js +5 -1
- package/es/register/register-text.js.map +1 -1
- package/es/register/register-wraptext.js +1 -1
- package/es/register/register-wraptext.js.map +1 -1
- package/es/tools/dynamicTexture.js +0 -2
- package/package.json +24 -4
|
@@ -45,4 +45,4 @@ exports.loadAllCavnvas = loadAllCavnvas, exports.loadBrowserCanvas = loadBrowser
|
|
|
45
45
|
exports.loadFeishuCanvas = loadFeishuCanvas, exports.loadLynxCanvas = loadLynxCanvas,
|
|
46
46
|
exports.loadNodeCanvas = loadNodeCanvas, exports.loadTaroCanvas = loadTaroCanvas,
|
|
47
47
|
exports.loadTTCanvas = loadTTCanvas, exports.loadWxCanvas = loadWxCanvas;
|
|
48
|
-
//# sourceMappingURL=modules.js.map
|
|
48
|
+
//# sourceMappingURL=modules.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.installBrowserLitePickersToApp = exports.installBrowserLiteEnvToApp = void 0;
|
|
6
|
+
|
|
7
|
+
const runtime_installer_1 = require("@visactor/vrender-core/entries/runtime-installer"), application_1 = require("@visactor/vrender-core/application"), constants_1 = require("@visactor/vrender-core/constants"), constants_2 = require("@visactor/vrender-core/picker/constants"), symbol_1 = require("@visactor/vrender-core/render/symbol"), modules_1 = require("../canvas/contributions/browser/modules"), explicit_binding_1 = require("../common/explicit-binding"), browser_contribution_1 = require("../env/contributions/browser-contribution"), canvas_picker_service_1 = require("../picker/canvas-picker-service"), area_module_1 = require("../picker/contributions/canvas-picker/area-module"), circle_module_1 = require("../picker/contributions/canvas-picker/circle-module"), glyph_module_1 = require("../picker/contributions/canvas-picker/glyph-module"), line_module_1 = require("../picker/contributions/canvas-picker/line-module"), rect_module_1 = require("../picker/contributions/canvas-picker/rect-module"), symbol_module_1 = require("../picker/contributions/canvas-picker/symbol-module"), text_module_1 = require("../picker/contributions/canvas-picker/text-module"), constants_3 = require("../picker/contributions/constants"), browser_contribution_2 = require("../window/contributions/browser-contribution"), browserLitePickerInstallers = [ area_module_1.bindAreaCanvasPickerContribution, circle_module_1.bindCircleCanvasPickerContribution, glyph_module_1.bindGlyphCanvasPickerContribution, line_module_1.bindLineCanvasPickerContribution, rect_module_1.bindRectCanvasPickerContribution, symbol_module_1.bindSymbolCanvasPickerContribution, text_module_1.bindTextCanvasPickerContribution ];
|
|
8
|
+
|
|
9
|
+
function createRegistryContributionProvider(entries) {
|
|
10
|
+
return {
|
|
11
|
+
getContributions: entries
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function bindBrowserLiteEnv(container) {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
(null === (_b = (_a = container).isBound) || void 0 === _b ? void 0 : _b.call(_a, browser_contribution_1.BrowserEnvContribution)) || (container.bind(browser_contribution_1.BrowserEnvContribution).toSelf().inSingletonScope(),
|
|
18
|
+
container.bind(constants_1.EnvContribution).toService(browser_contribution_1.BrowserEnvContribution));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function bindBrowserLiteCanvasPicker(container) {
|
|
22
|
+
container.isBound(canvas_picker_service_1.DefaultCanvasPickerService) || container.bind(canvas_picker_service_1.DefaultCanvasPickerService).toDynamicValue((() => new canvas_picker_service_1.DefaultCanvasPickerService((0,
|
|
23
|
+
explicit_binding_1.createContributionProvider)(constants_3.CanvasPickerContribution, container), (0,
|
|
24
|
+
explicit_binding_1.resolveContainerBinding)(container, symbol_1.DrawContribution), (0,
|
|
25
|
+
explicit_binding_1.createContributionProvider)(constants_2.PickItemInterceptor, container), (0,
|
|
26
|
+
explicit_binding_1.createContributionProvider)(constants_2.PickServiceInterceptor, container)))).inSingletonScope(),
|
|
27
|
+
container.isBound(constants_2.PickerService) ? container.rebind(constants_2.PickerService).toService(canvas_picker_service_1.DefaultCanvasPickerService) : container.bind(constants_2.PickerService).toService(canvas_picker_service_1.DefaultCanvasPickerService);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createForcedEnvParams(envParams) {
|
|
31
|
+
if (null != envParams && ("object" == typeof envParams || "function" == typeof envParams)) {
|
|
32
|
+
const forcedEnvParams = Object.create(envParams);
|
|
33
|
+
return forcedEnvParams.force = !0, forcedEnvParams;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
force: !0
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function configureBrowserLitePickerFactory(app) {
|
|
41
|
+
const bindingContext = (0, runtime_installer_1.getRuntimeInstallerBindingContext)(), pickerContributions = createRegistryContributionProvider((() => app.registry.picker.getAll())), pickItemInterceptors = createRegistryContributionProvider((() => bindingContext.isBound(constants_2.PickItemInterceptor) ? bindingContext.getAll(constants_2.PickItemInterceptor) : [])), pickServiceInterceptors = createRegistryContributionProvider((() => bindingContext.isBound(constants_2.PickServiceInterceptor) ? bindingContext.getAll(constants_2.PickServiceInterceptor) : []));
|
|
42
|
+
application_1.application.pickerServiceFactory = () => new canvas_picker_service_1.DefaultCanvasPickerService(pickerContributions, {}, pickItemInterceptors, pickServiceInterceptors),
|
|
43
|
+
application_1.application.global = (0, runtime_installer_1.getRuntimeInstallerGlobal)();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function installBrowserLiteEnvToApp(app, envParams) {
|
|
47
|
+
(0, runtime_installer_1.configureRuntimeApplicationForApp)(app);
|
|
48
|
+
const bindingContext = (0, runtime_installer_1.getRuntimeInstallerBindingContext)();
|
|
49
|
+
bindBrowserLiteEnv(bindingContext), (0, modules_1.bindBrowserCanvasModules)(bindingContext),
|
|
50
|
+
(0, browser_contribution_2.bindBrowserWindowContribution)(bindingContext), (0, runtime_installer_1.refreshRuntimeInstallerContributions)(),
|
|
51
|
+
(0, runtime_installer_1.getRuntimeInstallerGlobal)().setEnv("browser", createForcedEnvParams(envParams));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function installBrowserLitePickersToApp(app) {
|
|
55
|
+
(0, runtime_installer_1.configureRuntimeApplicationForApp)(app);
|
|
56
|
+
const bindingContext = (0, runtime_installer_1.getRuntimeInstallerBindingContext)();
|
|
57
|
+
browserLitePickerInstallers.forEach((bindPicker => bindPicker(bindingContext))),
|
|
58
|
+
bindBrowserLiteCanvasPicker(bindingContext), (0, runtime_installer_1.installRuntimePickersToApp)(app, constants_3.CanvasPickerContribution),
|
|
59
|
+
configureBrowserLitePickerFactory(app);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
exports.installBrowserLiteEnvToApp = installBrowserLiteEnvToApp, exports.installBrowserLitePickersToApp = installBrowserLitePickersToApp;
|
|
63
|
+
//# sourceMappingURL=browser-lite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/installers/browser-lite.ts"],"names":[],"mappings":";;;AAAA,wFAM0D;AAS1D,oEAAiE;AACjE,gEAAmE;AACnE,uEAAqH;AACrH,iEAAwE;AACxE,qEAAmF;AACnF,iEAAiG;AACjG,oFAAmF;AACnF,2EAA6E;AAC7E,mFAAqG;AACrG,uFAAyG;AACzG,qFAAuG;AACvG,mFAAqG;AACrG,mFAAqG;AACrG,uFAAyG;AACzG,mFAAqG;AACrG,iEAA6E;AAC7E,uFAA6F;AAI7F,MAAM,2BAA2B,GAAG;IAClC,8CAAgC;IAChC,kDAAkC;IAClC,gDAAiC;IACjC,8CAAgC;IAChC,8CAAgC;IAChC,kDAAkC;IAClC,8CAAgC;CACjC,CAAC;AAEF,SAAS,kCAAkC,CAAI,OAAkB;IAC/D,OAAO;QACL,gBAAgB,EAAE,OAAO;KAC1B,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,SAAgC;;IAC1D,IAAI,CAAC,CAAA,MAAA,MAAC,SAAiB,EAAC,OAAO,mDAAG,6CAAsB,CAAC,CAAA,EAAE;QACzD,SAAS,CAAC,IAAI,CAAC,6CAAsB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACnE,SAAS,CAAC,IAAI,CAAC,2BAAe,CAAC,CAAC,SAAS,CAAC,6CAAsB,CAAC,CAAC;KACnE;AACH,CAAC;AAED,SAAS,2BAA2B,CAAC,SAAgC;IACnE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,kDAA0B,CAAC,EAAE;QAClD,SAAS;aACN,IAAI,CAAC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AAiC,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC;AARD,wEAQC","file":"browser-lite.js","sourcesContent":["import {\n configureRuntimeApplicationForApp,\n getRuntimeInstallerBindingContext,\n getRuntimeInstallerGlobal,\n installRuntimePickersToApp,\n refreshRuntimeInstallerContributions\n} from '@visactor/vrender-core/entries/runtime-installer';\nimport type {\n IApp,\n IContributionProvider,\n IEnvParamsMap,\n IGraphicPicker,\n IPickItemInterceptorContribution,\n IPickServiceInterceptorContribution\n} from '@visactor/vrender-core';\nimport { application } from '@visactor/vrender-core/application';\nimport { EnvContribution } from '@visactor/vrender-core/constants';\nimport { PickItemInterceptor, PickerService, PickServiceInterceptor } from '@visactor/vrender-core/picker/constants';\nimport { DrawContribution } from '@visactor/vrender-core/render/symbol';\nimport { bindBrowserCanvasModules } from '../canvas/contributions/browser/modules';\nimport { createContributionProvider, resolveContainerBinding } from '../common/explicit-binding';\nimport { BrowserEnvContribution } from '../env/contributions/browser-contribution';\nimport { DefaultCanvasPickerService } from '../picker/canvas-picker-service';\nimport { bindAreaCanvasPickerContribution } from '../picker/contributions/canvas-picker/area-module';\nimport { bindCircleCanvasPickerContribution } from '../picker/contributions/canvas-picker/circle-module';\nimport { bindGlyphCanvasPickerContribution } from '../picker/contributions/canvas-picker/glyph-module';\nimport { bindLineCanvasPickerContribution } from '../picker/contributions/canvas-picker/line-module';\nimport { bindRectCanvasPickerContribution } from '../picker/contributions/canvas-picker/rect-module';\nimport { bindSymbolCanvasPickerContribution } from '../picker/contributions/canvas-picker/symbol-module';\nimport { bindTextCanvasPickerContribution } from '../picker/contributions/canvas-picker/text-module';\nimport { CanvasPickerContribution } from '../picker/contributions/constants';\nimport { bindBrowserWindowContribution } from '../window/contributions/browser-contribution';\n\ntype RuntimeBindingContext = ReturnType<typeof getRuntimeInstallerBindingContext>;\n\nconst browserLitePickerInstallers = [\n bindAreaCanvasPickerContribution,\n bindCircleCanvasPickerContribution,\n bindGlyphCanvasPickerContribution,\n bindLineCanvasPickerContribution,\n bindRectCanvasPickerContribution,\n bindSymbolCanvasPickerContribution,\n bindTextCanvasPickerContribution\n];\n\nfunction createRegistryContributionProvider<T>(entries: () => T[]): IContributionProvider<T> {\n return {\n getContributions: entries\n };\n}\n\nfunction bindBrowserLiteEnv(container: RuntimeBindingContext): void {\n if (!(container as any).isBound?.(BrowserEnvContribution)) {\n container.bind(BrowserEnvContribution).toSelf().inSingletonScope();\n container.bind(EnvContribution).toService(BrowserEnvContribution);\n }\n}\n\nfunction bindBrowserLiteCanvasPicker(container: RuntimeBindingContext): void {\n if (!container.isBound(DefaultCanvasPickerService)) {\n container\n .bind(DefaultCanvasPickerService)\n .toDynamicValue(\n () =>\n new DefaultCanvasPickerService(\n createContributionProvider(CanvasPickerContribution, container as any),\n resolveContainerBinding(container as any, DrawContribution),\n createContributionProvider(PickItemInterceptor, container as any),\n createContributionProvider(PickServiceInterceptor, container as any)\n )\n )\n .inSingletonScope();\n }\n\n if (container.isBound(PickerService)) {\n container.rebind(PickerService).toService(DefaultCanvasPickerService);\n } else {\n container.bind(PickerService).toService(DefaultCanvasPickerService);\n }\n}\n\nfunction createForcedEnvParams<TEnvParams>(envParams: TEnvParams | undefined): TEnvParams {\n if (envParams != null && (typeof envParams === 'object' || typeof envParams === 'function')) {\n const forcedEnvParams = Object.create(envParams as object);\n forcedEnvParams.force = true;\n return forcedEnvParams as TEnvParams;\n }\n\n return { force: true } as TEnvParams;\n}\n\nfunction configureBrowserLitePickerFactory(app: IApp): void {\n const bindingContext = getRuntimeInstallerBindingContext();\n const pickerContributions = createRegistryContributionProvider<IGraphicPicker>(\n () => app.registry.picker.getAll() as IGraphicPicker[]\n );\n const pickItemInterceptors = createRegistryContributionProvider<IPickItemInterceptorContribution>(() =>\n bindingContext.isBound(PickItemInterceptor)\n ? (bindingContext.getAll(PickItemInterceptor) as IPickItemInterceptorContribution[])\n : []\n );\n const pickServiceInterceptors = createRegistryContributionProvider<IPickServiceInterceptorContribution>(() =>\n bindingContext.isBound(PickServiceInterceptor)\n ? (bindingContext.getAll(PickServiceInterceptor) as IPickServiceInterceptorContribution[])\n : []\n );\n\n application.pickerServiceFactory = () =>\n new DefaultCanvasPickerService(pickerContributions, {} as any, pickItemInterceptors, pickServiceInterceptors);\n application.global = getRuntimeInstallerGlobal();\n}\n\nexport function installBrowserLiteEnvToApp(app: IApp, envParams?: IEnvParamsMap['browser']): void {\n configureRuntimeApplicationForApp(app);\n const bindingContext = getRuntimeInstallerBindingContext();\n\n bindBrowserLiteEnv(bindingContext);\n bindBrowserCanvasModules(bindingContext);\n bindBrowserWindowContribution(bindingContext);\n refreshRuntimeInstallerContributions();\n getRuntimeInstallerGlobal().setEnv('browser', createForcedEnvParams(envParams));\n}\n\nexport function installBrowserLitePickersToApp(app: IApp): void {\n configureRuntimeApplicationForApp(app);\n const bindingContext = getRuntimeInstallerBindingContext();\n\n browserLitePickerInstallers.forEach(bindPicker => bindPicker(bindingContext));\n bindBrowserLiteCanvasPicker(bindingContext);\n installRuntimePickersToApp(app, CanvasPickerContribution);\n configureBrowserLitePickerFactory(app);\n}\n"]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.installBrowserPickersToApp = exports.installBrowserEnvToApp = void 0;
|
|
6
|
+
|
|
7
|
+
const runtime_installer_1 = require("@visactor/vrender-core/entries/runtime-installer"), application_1 = require("@visactor/vrender-core/application"), constants_1 = require("@visactor/vrender-core/constants"), constants_2 = require("@visactor/vrender-core/picker/constants"), symbol_1 = require("@visactor/vrender-core/render/symbol"), modules_1 = require("../canvas/contributions/browser/modules"), explicit_binding_1 = require("../common/explicit-binding"), browser_contribution_1 = require("../env/contributions/browser-contribution"), arc3d_module_1 = require("../picker/contributions/canvas-picker/arc3d-module"), arc_module_1 = require("../picker/contributions/canvas-picker/arc-module"), area_module_1 = require("../picker/contributions/canvas-picker/area-module"), circle_module_1 = require("../picker/contributions/canvas-picker/circle-module"), glyph_module_1 = require("../picker/contributions/canvas-picker/glyph-module"), image_module_1 = require("../picker/contributions/canvas-picker/image-module"), line_module_1 = require("../picker/contributions/canvas-picker/line-module"), path_module_1 = require("../picker/contributions/canvas-picker/path-module"), polygon_module_1 = require("../picker/contributions/canvas-picker/polygon-module"), pyramid3d_module_1 = require("../picker/contributions/canvas-picker/pyramid3d-module"), rect3d_module_1 = require("../picker/contributions/canvas-picker/rect3d-module"), rect_module_1 = require("../picker/contributions/canvas-picker/rect-module"), richtext_module_1 = require("../picker/contributions/canvas-picker/richtext-module"), star_module_1 = require("../picker/contributions/canvas-picker/star-module"), symbol_module_1 = require("../picker/contributions/canvas-picker/symbol-module"), text_module_1 = require("../picker/contributions/canvas-picker/text-module"), constants_3 = require("../picker/contributions/constants"), canvas_picker_service_1 = require("../picker/canvas-picker-service"), browser_contribution_2 = require("../window/contributions/browser-contribution"), browserPickerInstallers = [ arc_module_1.bindArcCanvasPickerContribution, arc3d_module_1.bindArc3dCanvasPickerContribution, area_module_1.bindAreaCanvasPickerContribution, circle_module_1.bindCircleCanvasPickerContribution, glyph_module_1.bindGlyphCanvasPickerContribution, image_module_1.bindImageCanvasPickerContribution, line_module_1.bindLineCanvasPickerContribution, path_module_1.bindPathCanvasPickerContribution, polygon_module_1.bindPolygonCanvasPickerContribution, pyramid3d_module_1.bindPyramid3dCanvasPickerContribution, rect_module_1.bindRectCanvasPickerContribution, rect3d_module_1.bindRect3dCanvasPickerContribution, richtext_module_1.bindRichtextCanvasPickerContribution, star_module_1.bindStarCanvasPickerContribution, symbol_module_1.bindSymbolCanvasPickerContribution, text_module_1.bindTextCanvasPickerContribution ];
|
|
8
|
+
|
|
9
|
+
function createRegistryContributionProvider(entries) {
|
|
10
|
+
return {
|
|
11
|
+
getContributions: entries
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function bindBrowserEnv(container) {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
(null === (_b = (_a = container).isBound) || void 0 === _b ? void 0 : _b.call(_a, browser_contribution_1.BrowserEnvContribution)) || (container.bind(browser_contribution_1.BrowserEnvContribution).toSelf().inSingletonScope(),
|
|
18
|
+
container.bind(constants_1.EnvContribution).toService(browser_contribution_1.BrowserEnvContribution));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function bindBrowserCanvasPicker(container) {
|
|
22
|
+
container.isBound(canvas_picker_service_1.DefaultCanvasPickerService) || container.bind(canvas_picker_service_1.DefaultCanvasPickerService).toDynamicValue((() => new canvas_picker_service_1.DefaultCanvasPickerService((0,
|
|
23
|
+
explicit_binding_1.createContributionProvider)(constants_3.CanvasPickerContribution, container), (0,
|
|
24
|
+
explicit_binding_1.resolveContainerBinding)(container, symbol_1.DrawContribution), (0,
|
|
25
|
+
explicit_binding_1.createContributionProvider)(constants_2.PickItemInterceptor, container), (0,
|
|
26
|
+
explicit_binding_1.createContributionProvider)(constants_2.PickServiceInterceptor, container)))).inSingletonScope(),
|
|
27
|
+
container.isBound(constants_2.PickerService) ? container.rebind(constants_2.PickerService).toService(canvas_picker_service_1.DefaultCanvasPickerService) : container.bind(constants_2.PickerService).toService(canvas_picker_service_1.DefaultCanvasPickerService);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createForcedEnvParams(envParams) {
|
|
31
|
+
if (null != envParams && ("object" == typeof envParams || "function" == typeof envParams)) {
|
|
32
|
+
const forcedEnvParams = Object.create(envParams);
|
|
33
|
+
return forcedEnvParams.force = !0, forcedEnvParams;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
force: !0
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function activateBrowserRuntimeEnv(envParams) {
|
|
41
|
+
(0, runtime_installer_1.getRuntimeInstallerGlobal)().setEnv("browser", createForcedEnvParams(envParams));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function installBrowserRuntimeEnvToApp(app, {bindEnv: bindEnv, bindCanvasModules: bindCanvasModules, bindWindowContribution: bindWindowContribution}, envParams) {
|
|
45
|
+
(0, runtime_installer_1.configureRuntimeApplicationForApp)(app);
|
|
46
|
+
const bindingContext = (0, runtime_installer_1.getRuntimeInstallerBindingContext)();
|
|
47
|
+
bindEnv(bindingContext), bindCanvasModules(bindingContext), bindWindowContribution(bindingContext),
|
|
48
|
+
(0, runtime_installer_1.refreshRuntimeInstallerContributions)(), activateBrowserRuntimeEnv(envParams);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function configureBrowserPickerFactory(app) {
|
|
52
|
+
const bindingContext = (0, runtime_installer_1.getRuntimeInstallerBindingContext)(), pickerContributions = createRegistryContributionProvider((() => app.registry.picker.getAll())), pickItemInterceptors = createRegistryContributionProvider((() => bindingContext.isBound(constants_2.PickItemInterceptor) ? bindingContext.getAll(constants_2.PickItemInterceptor) : [])), pickServiceInterceptors = createRegistryContributionProvider((() => bindingContext.isBound(constants_2.PickServiceInterceptor) ? bindingContext.getAll(constants_2.PickServiceInterceptor) : [])), global = (0,
|
|
53
|
+
runtime_installer_1.getRuntimeInstallerGlobal)();
|
|
54
|
+
application_1.application.pickerServiceFactory = () => new canvas_picker_service_1.DefaultCanvasPickerService(pickerContributions, {}, pickItemInterceptors, pickServiceInterceptors),
|
|
55
|
+
application_1.application.global = global;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function installBrowserEnvToApp(app, envParams) {
|
|
59
|
+
installBrowserRuntimeEnvToApp(app, {
|
|
60
|
+
bindEnv: bindBrowserEnv,
|
|
61
|
+
bindCanvasModules: modules_1.bindBrowserCanvasModules,
|
|
62
|
+
bindWindowContribution: browser_contribution_2.bindBrowserWindowContribution
|
|
63
|
+
}, envParams);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function installBrowserPickersToApp(app) {
|
|
67
|
+
(0, runtime_installer_1.configureRuntimeApplicationForApp)(app);
|
|
68
|
+
const bindingContext = (0, runtime_installer_1.getRuntimeInstallerBindingContext)();
|
|
69
|
+
browserPickerInstallers.forEach((bindPicker => bindPicker(bindingContext))), bindBrowserCanvasPicker(bindingContext),
|
|
70
|
+
(0, runtime_installer_1.installRuntimePickersToApp)(app, constants_3.CanvasPickerContribution),
|
|
71
|
+
configureBrowserPickerFactory(app);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
exports.installBrowserEnvToApp = installBrowserEnvToApp, exports.installBrowserPickersToApp = installBrowserPickersToApp;
|
|
75
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/installers/browser.ts"],"names":[],"mappings":";;;AAAA,wFAM0D;AAS1D,oEAAiE;AACjE,gEAAmE;AACnE,uEAAqH;AACrH,iEAAwE;AACxE,qEAAmF;AACnF,iEAAiG;AACjG,oFAAmF;AACnF,qFAAuG;AACvG,iFAAmG;AACnG,mFAAqG;AACrG,uFAAyG;AACzG,qFAAuG;AACvG,qFAAuG;AACvG,mFAAqG;AACrG,mFAAqG;AACrG,yFAA2G;AAC3G,6FAA+G;AAC/G,uFAAyG;AACzG,mFAAqG;AACrG,2FAA6G;AAC7G,mFAAqG;AACrG,uFAAyG;AACzG,mFAAqG;AACrG,iEAA6E;AAC7E,2EAA6E;AAC7E,uFAA6F;AAS7F,MAAM,uBAAuB,GAAG;IAC9B,4CAA+B;IAC/B,gDAAiC;IACjC,8CAAgC;IAChC,kDAAkC;IAClC,gDAAiC;IACjC,gDAAiC;IACjC,8CAAgC;IAChC,8CAAgC;IAChC,oDAAmC;IACnC,wDAAqC;IACrC,8CAAgC;IAChC,kDAAkC;IAClC,sDAAoC;IACpC,8CAAgC;IAChC,kDAAkC;IAClC,8CAAgC;CACjC,CAAC;AAEF,SAAS,kCAAkC,CAAI,OAAkB;IAC/D,OAAO;QACL,gBAAgB,EAAE,OAAO;KAC1B,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,SAAgC;;IACtD,IAAI,CAAC,CAA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,CAAC;IAC3C,yBAAW,CAAC,oBAAoB,GAAG,GAAG,EAAE,CACtC,IAAI,kDAA0B,CAAC,mBAAmB,EAAE,EAAS,EAAE,oBAAoB,EAAE,uBAAuB,CAAC,CAAC;IAChH,yBAAW,CAAC,MAAM,GAAG,MAAM,CAAC;AAC9B,CAAC;AAED,SAAgB,sBAAsB,CAAC,GAAS,EAAE,SAAoC;IACpF,6BAA6B,CAC3B,GAAG,EACH;QACE,OAAO,EAAE,cAAc;QACvB,iBAAiB,EAAE,kCAAwB;QAC3C,sBAAsB,EAAE,oDAA6B;KACtD,EACD,SAAS,CACV,CAAC;AACJ,CAAC;AAVD,wDAUC;AAED,SAAgB,0BAA0B,CAAC,GAAS;IAClD,IAAA,qDAAiC,EAAC,GAAG,CAAC,CAAC;IACvC,MAAM,cAAc,GAAG,IAAA,qDAAiC,GAAE,CAAC;IAC3D,uBAAuB,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1E,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACxC,IAAA,8CAA0B,EAAC,GAAG,EAAE,oCAAwB,CAAC,CAAC;IAC1D,6BAA6B,CAAC,GAAG,CAAC,CAAC;AACrC,CAAC;AAPD,gEAOC","file":"browser.js","sourcesContent":["import {\n configureRuntimeApplicationForApp,\n getRuntimeInstallerBindingContext,\n getRuntimeInstallerGlobal,\n installRuntimePickersToApp,\n refreshRuntimeInstallerContributions\n} from '@visactor/vrender-core/entries/runtime-installer';\nimport type {\n IApp,\n IContributionProvider,\n IEnvParamsMap,\n IGraphicPicker,\n IPickItemInterceptorContribution,\n IPickServiceInterceptorContribution\n} from '@visactor/vrender-core';\nimport { application } from '@visactor/vrender-core/application';\nimport { EnvContribution } from '@visactor/vrender-core/constants';\nimport { PickItemInterceptor, PickerService, PickServiceInterceptor } from '@visactor/vrender-core/picker/constants';\nimport { DrawContribution } from '@visactor/vrender-core/render/symbol';\nimport { bindBrowserCanvasModules } from '../canvas/contributions/browser/modules';\nimport { createContributionProvider, resolveContainerBinding } from '../common/explicit-binding';\nimport { BrowserEnvContribution } from '../env/contributions/browser-contribution';\nimport { bindArc3dCanvasPickerContribution } from '../picker/contributions/canvas-picker/arc3d-module';\nimport { bindArcCanvasPickerContribution } from '../picker/contributions/canvas-picker/arc-module';\nimport { bindAreaCanvasPickerContribution } from '../picker/contributions/canvas-picker/area-module';\nimport { bindCircleCanvasPickerContribution } from '../picker/contributions/canvas-picker/circle-module';\nimport { bindGlyphCanvasPickerContribution } from '../picker/contributions/canvas-picker/glyph-module';\nimport { bindImageCanvasPickerContribution } from '../picker/contributions/canvas-picker/image-module';\nimport { bindLineCanvasPickerContribution } from '../picker/contributions/canvas-picker/line-module';\nimport { bindPathCanvasPickerContribution } from '../picker/contributions/canvas-picker/path-module';\nimport { bindPolygonCanvasPickerContribution } from '../picker/contributions/canvas-picker/polygon-module';\nimport { bindPyramid3dCanvasPickerContribution } from '../picker/contributions/canvas-picker/pyramid3d-module';\nimport { bindRect3dCanvasPickerContribution } from '../picker/contributions/canvas-picker/rect3d-module';\nimport { bindRectCanvasPickerContribution } from '../picker/contributions/canvas-picker/rect-module';\nimport { bindRichtextCanvasPickerContribution } from '../picker/contributions/canvas-picker/richtext-module';\nimport { bindStarCanvasPickerContribution } from '../picker/contributions/canvas-picker/star-module';\nimport { bindSymbolCanvasPickerContribution } from '../picker/contributions/canvas-picker/symbol-module';\nimport { bindTextCanvasPickerContribution } from '../picker/contributions/canvas-picker/text-module';\nimport { CanvasPickerContribution } from '../picker/contributions/constants';\nimport { DefaultCanvasPickerService } from '../picker/canvas-picker-service';\nimport { bindBrowserWindowContribution } from '../window/contributions/browser-contribution';\n\ntype RuntimeBindingContext = ReturnType<typeof getRuntimeInstallerBindingContext>;\ntype RuntimeEnvBindingStep = {\n bindEnv: (context: RuntimeBindingContext) => void;\n bindCanvasModules: (context: RuntimeBindingContext) => void;\n bindWindowContribution: (context: RuntimeBindingContext) => void;\n};\n\nconst browserPickerInstallers = [\n bindArcCanvasPickerContribution,\n bindArc3dCanvasPickerContribution,\n bindAreaCanvasPickerContribution,\n bindCircleCanvasPickerContribution,\n bindGlyphCanvasPickerContribution,\n bindImageCanvasPickerContribution,\n bindLineCanvasPickerContribution,\n bindPathCanvasPickerContribution,\n bindPolygonCanvasPickerContribution,\n bindPyramid3dCanvasPickerContribution,\n bindRectCanvasPickerContribution,\n bindRect3dCanvasPickerContribution,\n bindRichtextCanvasPickerContribution,\n bindStarCanvasPickerContribution,\n bindSymbolCanvasPickerContribution,\n bindTextCanvasPickerContribution\n];\n\nfunction createRegistryContributionProvider<T>(entries: () => T[]): IContributionProvider<T> {\n return {\n getContributions: entries\n };\n}\n\nfunction bindBrowserEnv(container: RuntimeBindingContext): void {\n if (!(container as any).isBound?.(BrowserEnvContribution)) {\n container.bind(BrowserEnvContribution).toSelf().inSingletonScope();\n container.bind(EnvContribution).toService(BrowserEnvContribution);\n }\n}\n\nfunction bindBrowserCanvasPicker(container: RuntimeBindingContext): void {\n if (!container.isBound(DefaultCanvasPickerService)) {\n container\n .bind(DefaultCanvasPickerService)\n .toDynamicValue(\n () =>\n new DefaultCanvasPickerService(\n createContributionProvider(CanvasPickerContribution, container as any),\n resolveContainerBinding(container as any, DrawContribution),\n createContributionProvider(PickItemInterceptor, container as any),\n createContributionProvider(PickServiceInterceptor, container as any)\n )\n )\n .inSingletonScope();\n }\n\n if (container.isBound(PickerService)) {\n container.rebind(PickerService).toService(DefaultCanvasPickerService);\n } else {\n container.bind(PickerService).toService(DefaultCanvasPickerService);\n }\n}\n\nfunction createForcedEnvParams<TEnvParams>(envParams: TEnvParams | undefined): TEnvParams {\n if (envParams != null && (typeof envParams === 'object' || typeof envParams === 'function')) {\n const forcedEnvParams = Object.create(envParams as object);\n forcedEnvParams.force = true;\n return forcedEnvParams as TEnvParams;\n }\n\n return { force: true } as TEnvParams;\n}\n\nfunction activateBrowserRuntimeEnv(envParams?: IEnvParamsMap['browser']): void {\n getRuntimeInstallerGlobal().setEnv('browser', createForcedEnvParams(envParams));\n}\n\nfunction installBrowserRuntimeEnvToApp(\n app: IApp,\n { bindEnv, bindCanvasModules, bindWindowContribution }: RuntimeEnvBindingStep,\n envParams?: IEnvParamsMap['browser']\n): void {\n configureRuntimeApplicationForApp(app);\n const bindingContext = getRuntimeInstallerBindingContext();\n bindEnv(bindingContext);\n bindCanvasModules(bindingContext);\n bindWindowContribution(bindingContext);\n refreshRuntimeInstallerContributions();\n activateBrowserRuntimeEnv(envParams);\n}\n\nfunction configureBrowserPickerFactory(app: IApp): void {\n const bindingContext = getRuntimeInstallerBindingContext();\n const pickerContributions = createRegistryContributionProvider<IGraphicPicker>(\n () => app.registry.picker.getAll() as IGraphicPicker[]\n );\n const pickItemInterceptors = createRegistryContributionProvider<IPickItemInterceptorContribution>(() =>\n bindingContext.isBound(PickItemInterceptor)\n ? (bindingContext.getAll(PickItemInterceptor) as IPickItemInterceptorContribution[])\n : []\n );\n const pickServiceInterceptors = createRegistryContributionProvider<IPickServiceInterceptorContribution>(() =>\n bindingContext.isBound(PickServiceInterceptor)\n ? (bindingContext.getAll(PickServiceInterceptor) as IPickServiceInterceptorContribution[])\n : []\n );\n\n const global = getRuntimeInstallerGlobal();\n application.pickerServiceFactory = () =>\n new DefaultCanvasPickerService(pickerContributions, {} as any, pickItemInterceptors, pickServiceInterceptors);\n application.global = global;\n}\n\nexport function installBrowserEnvToApp(app: IApp, envParams?: IEnvParamsMap['browser']): void {\n installBrowserRuntimeEnvToApp(\n app,\n {\n bindEnv: bindBrowserEnv,\n bindCanvasModules: bindBrowserCanvasModules,\n bindWindowContribution: bindBrowserWindowContribution\n },\n envParams\n );\n}\n\nexport function installBrowserPickersToApp(app: IApp): void {\n configureRuntimeApplicationForApp(app);\n const bindingContext = getRuntimeInstallerBindingContext();\n browserPickerInstallers.forEach(bindPicker => bindPicker(bindingContext));\n bindBrowserCanvasPicker(bindingContext);\n installRuntimePickersToApp(app, CanvasPickerContribution);\n configureBrowserPickerFactory(app);\n}\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.installLiteGraphicsToApp = void 0;
|
|
6
|
+
|
|
7
|
+
const runtime_installer_1 = require("@visactor/vrender-core/entries/runtime-installer"), graphic_1 = require("@visactor/vrender-core/register/graphic"), modules_1 = require("@visactor/vrender-core/graphic/modules"), liteGraphicInstallSteps = [ {
|
|
8
|
+
register: graphic_1.registerAreaGraphic,
|
|
9
|
+
bindModule: modules_1.areaModule
|
|
10
|
+
}, {
|
|
11
|
+
register: graphic_1.registerCircleGraphic,
|
|
12
|
+
bindModule: modules_1.circleModule
|
|
13
|
+
}, {
|
|
14
|
+
register: graphic_1.registerGlyphGraphic,
|
|
15
|
+
bindModule: modules_1.glyphModule
|
|
16
|
+
}, {
|
|
17
|
+
register: graphic_1.registerGroupGraphic
|
|
18
|
+
}, {
|
|
19
|
+
register: graphic_1.registerLineGraphic,
|
|
20
|
+
bindModule: modules_1.lineModule
|
|
21
|
+
}, {
|
|
22
|
+
register: graphic_1.registerRectGraphic,
|
|
23
|
+
bindModule: modules_1.rectModule
|
|
24
|
+
}, {
|
|
25
|
+
register: graphic_1.registerShadowRootGraphic
|
|
26
|
+
}, {
|
|
27
|
+
register: graphic_1.registerSymbolGraphic,
|
|
28
|
+
bindModule: modules_1.symbolModule
|
|
29
|
+
}, {
|
|
30
|
+
register: graphic_1.registerTextGraphic,
|
|
31
|
+
bindModule: modules_1.textModule
|
|
32
|
+
}, {
|
|
33
|
+
register: graphic_1.registerWrapTextGraphic
|
|
34
|
+
} ];
|
|
35
|
+
|
|
36
|
+
let liteGraphicsInstalled = !1;
|
|
37
|
+
|
|
38
|
+
function ensureLiteGraphicsInstalled() {
|
|
39
|
+
if (liteGraphicsInstalled) return;
|
|
40
|
+
const bindingContext = (0, runtime_installer_1.getRuntimeInstallerBindingContext)();
|
|
41
|
+
liteGraphicsInstalled = !0, liteGraphicInstallSteps.forEach((({register: register, bindModule: bindModule}) => {
|
|
42
|
+
register(), null == bindModule || bindModule({
|
|
43
|
+
bind: bindingContext.bind
|
|
44
|
+
});
|
|
45
|
+
})), (0, runtime_installer_1.refreshRuntimeInstallerContributions)();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function installLiteGraphicsToApp(app) {
|
|
49
|
+
(0, runtime_installer_1.configureRuntimeApplicationForApp)(app), ensureLiteGraphicsInstalled(),
|
|
50
|
+
(0, runtime_installer_1.installRuntimeDrawContributionsToApp)(app), (0, runtime_installer_1.installRuntimeGraphicRenderersToApp)(app);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
exports.installLiteGraphicsToApp = installLiteGraphicsToApp;
|
|
54
|
+
//# sourceMappingURL=graphics-lite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/installers/graphics-lite.ts"],"names":[],"mappings":";;;AAAA,wFAM0D;AAC1D,qEAWiD;AACjD,oEAQgD;AAShD,MAAM,uBAAuB,GAAgC;IAC3D,EAAE,QAAQ,EAAE,6BAAmB,EAAE,UAAU,EAAE,oBAAiB,EAAE;IAChE,EAAE,QAAQ,EAAE,+BAAqB,EAAE,UAAU,EAAE,sBAAmB,EAAE;IACpE,EAAE,QAAQ,EAAE,8BAAoB,EAAE,UAAU,EAAE,qBAAkB,EAAE;IAClE,EAAE,QAAQ,EAAE,8BAAoB,EAAE;IAClC,EAAE,QAAQ,EAAE,6BAAmB,EAAE,UAAU,EAAE,oBAAiB,EAAE;IAChE,EAAE,QAAQ,EAAE,6BAAmB,EAAE,UAAU,EAAE,oBAAiB,EAAE;IAChE,EAAE,QAAQ,EAAE,mCAAyB,EAAE;IACvC,EAAE,QAAQ,EAAE,+BAAqB,EAAE,UAAU,EAAE,sBAAmB,EAAE;IACpE,EAAE,QAAQ,EAAE,6BAAmB,EAAE,UAAU,EAAE,oBAAiB,EAAE;IAChE,EAAE,QAAQ,EAAE,iCAAuB,EAAE;CACtC,CAAC;AAEF,IAAI,qBAAqB,GAAG,KAAK,CAAC;AAElC,SAAS,2BAA2B;IAClC,IAAI,qBAAqB,EAAE;QACzB,OAAO;KACR;IAED,MAAM,cAAc,GAAG,IAAA,qDAAiC,GAAE,CAAC;IAC3D,qBAAqB,GAAG,IAAI,CAAC;IAC7B,uBAAuB,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;QAC3D,QAAQ,EAAE,CAAC;QACX,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,IAAA,wDAAoC,GAAE,CAAC;AACzC,CAAC;AAED,SAAgB,wBAAwB,CAAC,GAAS;IAChD,IAAA,qDAAiC,EAAC,GAAG,CAAC,CAAC;IACvC,2BAA2B,EAAE,CAAC;IAC9B,IAAA,wDAAoC,EAAC,GAAG,CAAC,CAAC;IAC1C,IAAA,uDAAmC,EAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AALD,4DAKC","file":"graphics-lite.js","sourcesContent":["import {\n configureRuntimeApplicationForApp,\n getRuntimeInstallerBindingContext,\n installRuntimeDrawContributionsToApp,\n installRuntimeGraphicRenderersToApp,\n refreshRuntimeInstallerContributions\n} from '@visactor/vrender-core/entries/runtime-installer';\nimport {\n registerAreaGraphic,\n registerCircleGraphic,\n registerGlyphGraphic,\n registerGroupGraphic,\n registerLineGraphic,\n registerRectGraphic,\n registerShadowRootGraphic,\n registerSymbolGraphic,\n registerTextGraphic,\n registerWrapTextGraphic\n} from '@visactor/vrender-core/register/graphic';\nimport {\n areaModule,\n circleModule,\n glyphModule,\n lineModule,\n rectModule,\n symbolModule,\n textModule\n} from '@visactor/vrender-core/graphic/modules';\nimport type { IApp } from '@visactor/vrender-core';\n\ntype RuntimeBindingContext = ReturnType<typeof getRuntimeInstallerBindingContext>;\ntype RuntimeGraphicInstallStep = {\n register: () => void;\n bindModule?: (context: { bind: RuntimeBindingContext['bind'] }) => void;\n};\n\nconst liteGraphicInstallSteps: RuntimeGraphicInstallStep[] = [\n { register: registerAreaGraphic, bindModule: areaModule as any },\n { register: registerCircleGraphic, bindModule: circleModule as any },\n { register: registerGlyphGraphic, bindModule: glyphModule as any },\n { register: registerGroupGraphic },\n { register: registerLineGraphic, bindModule: lineModule as any },\n { register: registerRectGraphic, bindModule: rectModule as any },\n { register: registerShadowRootGraphic },\n { register: registerSymbolGraphic, bindModule: symbolModule as any },\n { register: registerTextGraphic, bindModule: textModule as any },\n { register: registerWrapTextGraphic }\n];\n\nlet liteGraphicsInstalled = false;\n\nfunction ensureLiteGraphicsInstalled(): void {\n if (liteGraphicsInstalled) {\n return;\n }\n\n const bindingContext = getRuntimeInstallerBindingContext();\n liteGraphicsInstalled = true;\n liteGraphicInstallSteps.forEach(({ register, bindModule }) => {\n register();\n bindModule?.({ bind: bindingContext.bind });\n });\n refreshRuntimeInstallerContributions();\n}\n\nexport function installLiteGraphicsToApp(app: IApp): void {\n configureRuntimeApplicationForApp(app);\n ensureLiteGraphicsInstalled();\n installRuntimeDrawContributionsToApp(app);\n installRuntimeGraphicRenderersToApp(app);\n}\n"]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.installStandardGraphicsToApp = void 0;
|
|
6
|
+
|
|
7
|
+
const runtime_installer_1 = require("@visactor/vrender-core/entries/runtime-installer"), graphic_1 = require("@visactor/vrender-core/register/graphic"), modules_1 = require("@visactor/vrender-core/graphic/modules"), standardGraphicInstallSteps = [ {
|
|
8
|
+
register: graphic_1.registerArcGraphic,
|
|
9
|
+
bindModule: modules_1.arcModule
|
|
10
|
+
}, {
|
|
11
|
+
register: graphic_1.registerArc3dGraphic,
|
|
12
|
+
bindModule: modules_1.arc3dModule
|
|
13
|
+
}, {
|
|
14
|
+
register: graphic_1.registerAreaGraphic,
|
|
15
|
+
bindModule: modules_1.areaModule
|
|
16
|
+
}, {
|
|
17
|
+
register: graphic_1.registerCircleGraphic,
|
|
18
|
+
bindModule: modules_1.circleModule
|
|
19
|
+
}, {
|
|
20
|
+
register: graphic_1.registerGlyphGraphic,
|
|
21
|
+
bindModule: modules_1.glyphModule
|
|
22
|
+
}, {
|
|
23
|
+
register: graphic_1.registerGroupGraphic
|
|
24
|
+
}, {
|
|
25
|
+
register: graphic_1.registerImageGraphic,
|
|
26
|
+
bindModule: modules_1.imageModule
|
|
27
|
+
}, {
|
|
28
|
+
register: graphic_1.registerLineGraphic,
|
|
29
|
+
bindModule: modules_1.lineModule
|
|
30
|
+
}, {
|
|
31
|
+
register: graphic_1.registerPathGraphic,
|
|
32
|
+
bindModule: modules_1.pathModule
|
|
33
|
+
}, {
|
|
34
|
+
register: graphic_1.registerPolygonGraphic,
|
|
35
|
+
bindModule: modules_1.polygonModule
|
|
36
|
+
}, {
|
|
37
|
+
register: graphic_1.registerPyramid3dGraphic,
|
|
38
|
+
bindModule: modules_1.pyramid3dModule
|
|
39
|
+
}, {
|
|
40
|
+
register: graphic_1.registerRectGraphic,
|
|
41
|
+
bindModule: modules_1.rectModule
|
|
42
|
+
}, {
|
|
43
|
+
register: graphic_1.registerRect3dGraphic,
|
|
44
|
+
bindModule: modules_1.rect3dModule
|
|
45
|
+
}, {
|
|
46
|
+
register: graphic_1.registerRichtextGraphic,
|
|
47
|
+
bindModule: modules_1.richtextModule
|
|
48
|
+
}, {
|
|
49
|
+
register: graphic_1.registerShadowRootGraphic
|
|
50
|
+
}, {
|
|
51
|
+
register: graphic_1.registerStarGraphic,
|
|
52
|
+
bindModule: modules_1.starModule
|
|
53
|
+
}, {
|
|
54
|
+
register: graphic_1.registerSymbolGraphic,
|
|
55
|
+
bindModule: modules_1.symbolModule
|
|
56
|
+
}, {
|
|
57
|
+
register: graphic_1.registerTextGraphic,
|
|
58
|
+
bindModule: modules_1.textModule
|
|
59
|
+
}, {
|
|
60
|
+
register: graphic_1.registerWrapTextGraphic
|
|
61
|
+
} ];
|
|
62
|
+
|
|
63
|
+
let standardGraphicsInstalled = !1;
|
|
64
|
+
|
|
65
|
+
function ensureStandardGraphicsInstalled() {
|
|
66
|
+
if (standardGraphicsInstalled) return;
|
|
67
|
+
const bindingContext = (0, runtime_installer_1.getRuntimeInstallerBindingContext)();
|
|
68
|
+
standardGraphicsInstalled = !0, standardGraphicInstallSteps.forEach((({register: register, bindModule: bindModule}) => {
|
|
69
|
+
register(), null == bindModule || bindModule({
|
|
70
|
+
bind: bindingContext.bind
|
|
71
|
+
});
|
|
72
|
+
})), (0, runtime_installer_1.refreshRuntimeInstallerContributions)();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function installStandardGraphicsToApp(app) {
|
|
76
|
+
(0, runtime_installer_1.configureRuntimeApplicationForApp)(app), ensureStandardGraphicsInstalled(),
|
|
77
|
+
(0, runtime_installer_1.installRuntimeDrawContributionsToApp)(app), (0, runtime_installer_1.installRuntimeGraphicRenderersToApp)(app);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
exports.installStandardGraphicsToApp = installStandardGraphicsToApp;
|
|
81
|
+
//# sourceMappingURL=graphics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/installers/graphics.ts"],"names":[],"mappings":";;;AAAA,wFAM0D;AAC1D,qEAoBiD;AACjD,oEAiBgD;AAShD,MAAM,2BAA2B,GAAgC;IAC/D,EAAE,QAAQ,EAAE,4BAAkB,EAAE,UAAU,EAAE,mBAAgB,EAAE;IAC9D,EAAE,QAAQ,EAAE,8BAAoB,EAAE,UAAU,EAAE,qBAAkB,EAAE;IAClE,EAAE,QAAQ,EAAE,6BAAmB,EAAE,UAAU,EAAE,oBAAiB,EAAE;IAChE,EAAE,QAAQ,EAAE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EAAE;QAC/D,QAAQ,EAAE,CAAC;QACX,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,IAAA,wDAAoC,GAAE,CAAC;AACzC,CAAC;AAED,SAAgB,4BAA4B,CAAC,GAAS;IACpD,IAAA,qDAAiC,EAAC,GAAG,CAAC,CAAC;IACvC,+BAA+B,EAAE,CAAC;IAClC,IAAA,wDAAoC,EAAC,GAAG,CAAC,CAAC;IAC1C,IAAA,uDAAmC,EAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AALD,oEAKC","file":"graphics.js","sourcesContent":["import {\n configureRuntimeApplicationForApp,\n getRuntimeInstallerBindingContext,\n installRuntimeDrawContributionsToApp,\n installRuntimeGraphicRenderersToApp,\n refreshRuntimeInstallerContributions\n} from '@visactor/vrender-core/entries/runtime-installer';\nimport {\n registerArc3dGraphic,\n registerArcGraphic,\n registerAreaGraphic,\n registerCircleGraphic,\n registerGlyphGraphic,\n registerGroupGraphic,\n registerImageGraphic,\n registerLineGraphic,\n registerPathGraphic,\n registerPolygonGraphic,\n registerPyramid3dGraphic,\n registerRect3dGraphic,\n registerRectGraphic,\n registerRichtextGraphic,\n registerShadowRootGraphic,\n registerStarGraphic,\n registerSymbolGraphic,\n registerTextGraphic,\n registerWrapTextGraphic\n} from '@visactor/vrender-core/register/graphic';\nimport {\n arc3dModule,\n arcModule,\n areaModule,\n circleModule,\n glyphModule,\n imageModule,\n lineModule,\n pathModule,\n polygonModule,\n pyramid3dModule,\n rect3dModule,\n rectModule,\n richtextModule,\n starModule,\n symbolModule,\n textModule\n} from '@visactor/vrender-core/graphic/modules';\nimport type { IApp } from '@visactor/vrender-core';\n\ntype RuntimeBindingContext = ReturnType<typeof getRuntimeInstallerBindingContext>;\ntype RuntimeGraphicInstallStep = {\n register: () => void;\n bindModule?: (context: { bind: RuntimeBindingContext['bind'] }) => void;\n};\n\nconst standardGraphicInstallSteps: RuntimeGraphicInstallStep[] = [\n { register: registerArcGraphic, bindModule: arcModule as any },\n { register: registerArc3dGraphic, bindModule: arc3dModule as any },\n { register: registerAreaGraphic, bindModule: areaModule as any },\n { register: registerCircleGraphic, bindModule: circleModule as any },\n { register: registerGlyphGraphic, bindModule: glyphModule as any },\n { register: registerGroupGraphic },\n { register: registerImageGraphic, bindModule: imageModule as any },\n { register: registerLineGraphic, bindModule: lineModule as any },\n { register: registerPathGraphic, bindModule: pathModule as any },\n { register: registerPolygonGraphic, bindModule: polygonModule as any },\n { register: registerPyramid3dGraphic, bindModule: pyramid3dModule as any },\n { register: registerRectGraphic, bindModule: rectModule as any },\n { register: registerRect3dGraphic, bindModule: rect3dModule as any },\n { register: registerRichtextGraphic, bindModule: richtextModule as any },\n { register: registerShadowRootGraphic },\n { register: registerStarGraphic, bindModule: starModule as any },\n { register: registerSymbolGraphic, bindModule: symbolModule as any },\n { register: registerTextGraphic, bindModule: textModule as any },\n { register: registerWrapTextGraphic }\n];\n\nlet standardGraphicsInstalled = false;\n\nfunction ensureStandardGraphicsInstalled(): void {\n if (standardGraphicsInstalled) {\n return;\n }\n\n const bindingContext = getRuntimeInstallerBindingContext();\n standardGraphicsInstalled = true;\n standardGraphicInstallSteps.forEach(({ register, bindModule }) => {\n register();\n bindModule?.({ bind: bindingContext.bind });\n });\n refreshRuntimeInstallerContributions();\n}\n\nexport function installStandardGraphicsToApp(app: IApp): void {\n configureRuntimeApplicationForApp(app);\n ensureStandardGraphicsInstalled();\n installRuntimeDrawContributionsToApp(app);\n installRuntimeGraphicRenderersToApp(app);\n}\n"]}
|
package/cjs/jsx/graphicType.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IArc3dGraphicAttribute, type IArcGraphicAttribute, type IAreaGraphicAttribute, type ICircleGraphicAttribute, type IGlyphGraphicAttribute, type IGroupGraphicAttribute, type IImageGraphicAttribute, type ILineGraphicAttribute, type IPathGraphicAttribute, type IPolygonGraphicAttribute, type IPyramid3dGraphicAttribute, type IRect3dGraphicAttribute, type IRectGraphicAttribute, type IRichTextCharacter, type IRichTextGraphicAttribute, type IRichTextImageCharacter, type ISymbolGraphicAttribute, type ITextGraphicAttribute } from '@visactor/vrender-core';
|
|
1
|
+
import { type IArc3dGraphicAttribute, type IArcGraphicAttribute, type IAreaGraphicAttribute, type ICircleGraphicAttribute, type IGlyphGraphicAttribute, type IGroupGraphicAttribute, type IImageGraphicAttribute, type ILineGraphicAttribute, type IPathGraphicAttribute, type IPolygonGraphicAttribute, type IPyramid3dGraphicAttribute, type IRect3dGraphicAttribute, type IRectGraphicAttribute, type IRichTextCharacter, type IRichTextGraphicAttribute, type IRichTextImageCharacter, type StateDefinitionsInput, type ISymbolGraphicAttribute, type ITextGraphicAttribute } from '@visactor/vrender-core';
|
|
2
2
|
export declare const REACT_TO_CANOPUS_EVENTS: {
|
|
3
3
|
onPointerDown: string;
|
|
4
4
|
onPointerUp: string;
|
|
@@ -52,7 +52,7 @@ export type IEventParamsType = {
|
|
|
52
52
|
};
|
|
53
53
|
export type IDefaultGraphicParamsType<T> = {
|
|
54
54
|
attribute?: T;
|
|
55
|
-
|
|
55
|
+
states?: StateDefinitionsInput<T>;
|
|
56
56
|
children?: any;
|
|
57
57
|
name?: string;
|
|
58
58
|
id?: string;
|
|
@@ -76,7 +76,7 @@ export declare function VRichText(params: IDefaultGraphicParamsType<IRichTextGra
|
|
|
76
76
|
export declare namespace VRichText {
|
|
77
77
|
var Text: (params: IDefaultGraphicParamsType<IRichTextCharacter>) => {
|
|
78
78
|
attribute?: IRichTextCharacter;
|
|
79
|
-
|
|
79
|
+
states?: StateDefinitionsInput<IRichTextCharacter>;
|
|
80
80
|
children?: any;
|
|
81
81
|
name?: string;
|
|
82
82
|
id?: string;
|
|
@@ -129,7 +129,7 @@ export declare namespace VRichText {
|
|
|
129
129
|
};
|
|
130
130
|
var Image: (params: IDefaultGraphicParamsType<IRichTextImageCharacter>) => {
|
|
131
131
|
attribute?: IRichTextImageCharacter;
|
|
132
|
-
|
|
132
|
+
states?: StateDefinitionsInput<IRichTextImageCharacter>;
|
|
133
133
|
children?: any;
|
|
134
134
|
name?: string;
|
|
135
135
|
id?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/jsx/graphicType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/jsx/graphicType.ts"],"names":[],"mappings":";;;AAAA,yDAqBgC;AAEnB,QAAA,uBAAuB,GAAG;IACrC,aAAa,EAAE,aAAa;IAC5B,WAAW,EAAE,WAAW;IACxB,kBAAkB,EAAE,kBAAkB;IACtC,YAAY,EAAE,YAAY;IAC1B,aAAa,EAAE,aAAa;IAC5B,aAAa,EAAE,aAAa;IAC5B,cAAc,EAAE,cAAc;IAC9B,cAAc,EAAE,cAAc;IAC9B,YAAY,EAAE,YAAY;IAC1B,WAAW,EAAE,WAAW;IACxB,SAAS,EAAE,SAAS;IACpB,gBAAgB,EAAE,gBAAgB;IAClC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,YAAY;IAC1B,YAAY,EAAE,YAAY;IAC1B,OAAO,EAAE,OAAO;IAChB,YAAY,EAAE,YAAY;IAC1B,UAAU,EAAE,UAAU;IACtB,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,MAAM;IACd,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,UAAU;IACtB,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,WAAW;IACxB,SAAS,EAAE,SAAS;IACpB,gBAAgB,EAAE,gBAAgB;IAClC,YAAY,EAAE,YAAY;IAC1B,UAAU,EAAE,UAAU;IACtB,iBAAiB,EAAE,iBAAiB;IACpC,WAAW,E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AAsB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC;AAFD,0BAEC;AACD,SAAgB,OAAO,CAAC,MAA0D;IAChF,OAAQ,6BAAsB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC;AAFD,0BAEC;AACD,SAAgB,KAAK,CAAC,MAAwD;IAC5E,OAAQ,6BAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACtE,CAAC;AAFD,sBAEC;AACD,SAAgB,SAAS,CAAC,MAA4D;IACpF,OAAQ,6BAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC1E,CAAC;AAFD,8BAEC;AAED,SAAS,CAAC,IAAI,GAAG,UAAU,MAAqD;IAC9E,uBACE,IAAI,EAAE,WAAW,IACd,MAAM,EACT;AACJ,CAAC,CAAC;AAEF,SAAS,CAAC,KAAK,GAAG,UAAU,MAA0D;IACpF,uBACE,IAAI,EAAE,YAAY,IACf,MAAM,EACT;AACJ,CAAC,CAAC","file":"graphicType.js","sourcesContent":["import {\n graphicCreator,\n type IArc3dGraphicAttribute,\n type IArcGraphicAttribute,\n type IAreaGraphicAttribute,\n type ICircleGraphicAttribute,\n type IGlyphGraphicAttribute,\n type IGroupGraphicAttribute,\n type IImageGraphicAttribute,\n type ILineGraphicAttribute,\n type IPathGraphicAttribute,\n type IPolygonGraphicAttribute,\n type IPyramid3dGraphicAttribute,\n type IRect3dGraphicAttribute,\n type IRectGraphicAttribute,\n type IRichTextCharacter,\n type IRichTextGraphicAttribute,\n type IRichTextImageCharacter,\n type StateDefinitionsInput,\n type ISymbolGraphicAttribute,\n type ITextGraphicAttribute\n} from '@visactor/vrender-core';\n\nexport const REACT_TO_CANOPUS_EVENTS = {\n onPointerDown: 'pointerdown',\n onPointerUp: 'pointerup',\n onPointerUpOutside: 'pointerupoutside',\n onPointerTap: 'pointertap',\n onPointerOver: 'pointerover',\n onPointerMove: 'pointermove',\n onPointerEnter: 'pointerenter',\n onPointerLeave: 'pointerleave',\n onPointerOut: 'pointerout',\n onMouseDown: 'mousedown',\n onMouseUp: 'mouseup',\n onMouseUpOutside: 'mouseupoutside',\n onMouseMove: 'mousemove',\n onMouseOver: 'mouseover',\n onMouseOut: 'mouseout',\n onMouseEnter: 'mouseenter',\n onMouseLeave: 'mouseleave',\n onPinch: 'pinch',\n onPinchStart: 'pinchstart',\n onPinchEnd: 'pinchend',\n onPan: 'pan',\n onPanStart: 'panstart',\n onPanEnd: 'panend',\n onDrag: 'drag',\n onDragStart: 'dragstart',\n onDragEnter: 'dragenter',\n onDragLeave: 'dragleave',\n onDragOver: 'dragover',\n onDragEnd: 'dragend',\n onRightDown: 'rightdown',\n onRightUp: 'rightup',\n onRightUpOutside: 'rightupoutside',\n onTouchStart: 'touchstart',\n onTouchEnd: 'touchend',\n onTouchEndOutside: 'touchendoutside',\n onTouchMove: 'touchmove',\n onTouchCancel: 'touchcancel',\n onPress: 'press',\n onPressUp: 'pressup',\n onPressEnd: 'pressend',\n onSwipe: 'swipe',\n onDrop: 'drop',\n onWeel: 'wheel',\n onClick: 'click',\n onDblClick: 'dblclick'\n};\n\nexport const REACT_TO_CANOPUS_EVENTS_LIST = Object.keys(REACT_TO_CANOPUS_EVENTS);\n\nexport type IEventParamsType = {\n [t in keyof typeof REACT_TO_CANOPUS_EVENTS]?: (d: any) => void;\n};\n\nexport type IDefaultGraphicParamsType<T> = {\n attribute?: T;\n states?: StateDefinitionsInput<T>;\n // react可能类型报错\n children?: any;\n name?: string;\n id?: string;\n} & IEventParamsType;\n\nexport function VArc(params: IDefaultGraphicParamsType<IArcGraphicAttribute>) {\n return (graphicCreator as any).arc(params ? params.attribute : {});\n}\nexport function VArc3d(params: IDefaultGraphicParamsType<IArc3dGraphicAttribute>) {\n return (graphicCreator as any).arc3d(params ? params.attribute : {});\n}\nexport function VArea(params: IDefaultGraphicParamsType<IAreaGraphicAttribute>) {\n return (graphicCreator as any).area(params ? params.attribute : {});\n}\nexport function VCircle(params: IDefaultGraphicParamsType<ICircleGraphicAttribute>) {\n return (graphicCreator as any).circle(params ? params.attribute : {});\n}\nexport function VGroup(params: IDefaultGraphicParamsType<IGroupGraphicAttribute>) {\n return (graphicCreator as any).group(params ? params.attribute : {});\n}\nexport function VGlyph(params: IDefaultGraphicParamsType<IGlyphGraphicAttribute>) {\n return (graphicCreator as any).glyph(params ? params.attribute : {});\n}\nexport function VImage(params: IDefaultGraphicParamsType<IImageGraphicAttribute>) {\n return (graphicCreator as any).image(params ? params.attribute : {});\n}\nexport function VLine(params: IDefaultGraphicParamsType<ILineGraphicAttribute>) {\n return (graphicCreator as any).line(params ? params.attribute : {});\n}\nexport function VPath(params: IDefaultGraphicParamsType<IPathGraphicAttribute>) {\n return (graphicCreator as any).path(params ? params.attribute : {});\n}\nexport function VPolygon(params: IDefaultGraphicParamsType<IPolygonGraphicAttribute>) {\n return (graphicCreator as any).polygon(params ? params.attribute : {});\n}\nexport function VPyramid3d(params: IDefaultGraphicParamsType<IPyramid3dGraphicAttribute>) {\n return (graphicCreator as any).pyramid3d(params ? params.attribute : {});\n}\nexport function VRect(params: IDefaultGraphicParamsType<IRectGraphicAttribute>) {\n return (graphicCreator as any).rect(params ? params.attribute : {});\n}\nexport function VRect3d(params: IDefaultGraphicParamsType<IRect3dGraphicAttribute>) {\n return (graphicCreator as any).rect3d(params ? params.attribute : {});\n}\nexport function VSymbol(params: IDefaultGraphicParamsType<ISymbolGraphicAttribute>) {\n return (graphicCreator as any).symbol(params ? params.attribute : {});\n}\nexport function VText(params: IDefaultGraphicParamsType<ITextGraphicAttribute>) {\n return (graphicCreator as any).text(params ? params.attribute : {});\n}\nexport function VRichText(params: IDefaultGraphicParamsType<IRichTextGraphicAttribute>) {\n return (graphicCreator as any).richtext(params ? params.attribute : {});\n}\n\nVRichText.Text = function (params: IDefaultGraphicParamsType<IRichTextCharacter>) {\n return {\n type: 'rich/text',\n ...params\n };\n};\n\nVRichText.Image = function (params: IDefaultGraphicParamsType<IRichTextImageCharacter>) {\n return {\n type: 'rich/image',\n ...params\n };\n};\n"]}
|
package/cjs/jsx/jsx-classic.js
CHANGED
|
@@ -22,14 +22,14 @@ function flatten(list, out) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function jsx(type, config, ...children) {
|
|
25
|
-
const _a = config || {}, {
|
|
25
|
+
const _a = config || {}, {name: name, id: id, attribute: attribute, states: states, animation: animation, timeline: timeline} = _a, props = __rest(_a, [ "name", "id", "attribute", "states", "animation", "timeline" ]);
|
|
26
26
|
let c = type;
|
|
27
27
|
(0, vutils_1.isString)(type) && (c = vrender_core_1.graphicCreator[type]);
|
|
28
28
|
const childrenList = [];
|
|
29
29
|
children.length && flatten(1 === children.length ? children[0] : children, childrenList);
|
|
30
30
|
const g = "Group" === c.name ? new c(attribute) : c(config);
|
|
31
|
-
if (parseToGraphic(g, childrenList, props),
|
|
32
|
-
|
|
31
|
+
if (parseToGraphic(g, childrenList, props), name && (g.name = name), id && (g.id = id),
|
|
32
|
+
states && (g.states = states), (0, vutils_1.isArray)(animation)) {
|
|
33
33
|
const animate = g.animate();
|
|
34
34
|
timeline && animate.setTimeline(timeline), animation.forEach((item => {
|
|
35
35
|
animate[item[0]](...item.slice(1));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/jsx/jsx-classic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAAqD;AACrD,yDAA+D;AAC/D,+CAAwD;AAExD,SAAS,OAAO,CAAC,IAAS,EAAE,GAAU;IACpC,IAAI,IAAA,gBAAO,EAAC,IAAI,CAAC,EAAE;QAC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S,GAAG,IAAI,CAAC;KACpB;IAED,IAAI,SAAS,EAAE;QACb,YAAY,CAAC,OAAO,CAAC,CAAC,CAAM,EAAE,EAAE;YAC9B,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC7B,MAAM,EAAE,GAAG,qCAAuB,CAAC,CAAC,CAAC,CAAC;YACtC,IAAI,EAAE,EAAE;gBACN,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aACpB;QACH,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE;YACzB,CAAC,CAAC,SAAS,CAAC,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;SACxF;KACF;AACH,CAAC;AAEY,QAAA,QAAQ,GAAG,oBAAK,CAAC","file":"jsx-classic.js","sourcesContent":["import { isArray, isString } from '@visactor/vutils';\nimport { Group, graphicCreator } from '@visactor/vrender-core';\nimport { REACT_TO_CANOPUS_EVENTS } from './graphicType';\n\nfunction flatten(list: any, out: any[]): void {\n if (isArray(list)) {\n return list.forEach(i => flatten(i, out));\n }\n out.push(list);\n}\n\nexport function jsx(type: string | any, config: Record<string, any>, ...children: any) {\n const { name, id, attribute, states, animation, timeline, ...props } = config || {};\n\n let c = type;\n if (isString(type)) {\n c = graphicCreator[type];\n }\n\n const childrenList: any[] = [];\n if (children.length) {\n flatten(children.length === 1 ? children[0] : children, childrenList);\n }\n\n const g = c.name === 'Group' ? new c(attribute) : c(config);\n parseToGraphic(g, childrenList, props);\n\n if (name) {\n g.name = name;\n }\n\n if (id) {\n g.id = id;\n }\n\n if (states) {\n g.states = states;\n }\n\n if (isArray(animation)) {\n // animation={[\n // ['to', { angle: 2 * Math.PI }, 1000, 'linear'],\n // ['loop', Infinity]\n // ]}\n const animate = g.animate();\n timeline && animate.setTimeline(timeline);\n animation.forEach((item: any[]) => {\n animate[item[0]](...item.slice(1));\n });\n }\n\n return g;\n}\n\nfunction parseToGraphic(g: any, childrenList: any[], props: any) {\n let isGraphic: boolean = false;\n let out: any;\n switch (g.type) {\n case 'richtext':\n break;\n case 'rich/text':\n out = g.attribute || {};\n childrenList[0] && (out.text = childrenList[0]);\n break;\n case 'rich/image':\n break;\n default:\n isGraphic = true;\n }\n\n if (isGraphic) {\n childrenList.forEach((c: any) => {\n c && g.add(c);\n });\n\n Object.keys(props).forEach(k => {\n const en = REACT_TO_CANOPUS_EVENTS[k];\n if (en) {\n g.on(en, props[k]);\n }\n });\n } else {\n if (g.type === 'richtext') {\n g.attribute.textConfig = childrenList.map(item => item.attribute).filter(item => item);\n }\n }\n}\n\nexport const Fragment = Group;\n"]}
|
|
@@ -24,5 +24,4 @@ function loadMathPicker(c) {
|
|
|
24
24
|
(0, text_module_1.bindTextMathPickerContribution)(c);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
exports.bindMathPicker = bindMathPicker, exports.loadMathPicker = loadMathPicker;
|
|
28
|
-
//# sourceMappingURL=math-module.js.map
|
|
27
|
+
exports.bindMathPicker = bindMathPicker, exports.loadMathPicker = loadMathPicker;
|
package/cjs/react-tree.js
CHANGED
|
@@ -8,11 +8,11 @@ const vutils_1 = require("@visactor/vutils"), jsx_1 = require("./jsx");
|
|
|
8
8
|
|
|
9
9
|
function decodeReactDom(dom) {
|
|
10
10
|
if (!dom || !dom.$$typeof) return dom;
|
|
11
|
-
const type = dom.type, {attribute: attribute, children: children,
|
|
11
|
+
const type = dom.type, {attribute: attribute, children: children, states: states, id: id, name: name} = dom.props, g = type({
|
|
12
12
|
attribute: attribute
|
|
13
13
|
}), out = parseToGraphic(g, dom.props, children);
|
|
14
|
-
return out || (
|
|
15
|
-
|
|
14
|
+
return out || (g.id = id, g.name = name, states && (g.states = states), parseChildren(children, g),
|
|
15
|
+
g);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function parseChildren(children, g) {
|
package/cjs/react-tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react-tree.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,+BAAgD;AAGhD,SAAgB,cAAc,CAAC,GAAQ;IACrC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;QAEzB,OAAO,GAAG,CAAC;KACZ;IACD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACtB,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/react-tree.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,+BAAgD;AAGhD,SAAgB,cAAc,CAAC,GAAQ;IACrC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;QAEzB,OAAO,GAAG,CAAC;KACZ;IACD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACtB,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC;IAC5D,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,cAAc,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACnD,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAC;KACZ;IAED,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;IACV,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;IACd,IAAI,MAAM,EAAE;QACV,CAAC,CAAC,MAAM,G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AAO,CAAC,CAAC,CAAC,EAAE;YAC7B,MAAM,EAAE,GAAG,6BAAuB,CAAC,CAAC,CAAC,CAAC;YACtC,IAAI,EAAE,EAAE;gBACN,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aACpB;QACH,CAAC,CAAC,CAAC;KACJ;SAAM,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE;QAChC,CAAC,CAAC,SAAS,CAAC,UAAU,GAAG,YAAY;aAClC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;KAChC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","file":"react-tree.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { REACT_TO_CANOPUS_EVENTS } from './jsx';\n\n// temp devode for react jsx customLayout\nexport function decodeReactDom(dom: any) {\n if (!dom || !dom.$$typeof) {\n // not react\n return dom;\n }\n const type = dom.type;\n const { attribute, children, states, id, name } = dom.props;\n const g = type({ attribute });\n const out = parseToGraphic(g, dom.props, children);\n if (out) {\n return out;\n }\n\n g.id = id;\n g.name = name;\n if (states) {\n g.states = states;\n }\n parseChildren(children, g);\n return g;\n}\n\nfunction parseChildren(children: any, g: any) {\n if (isArray(children)) {\n children.forEach((item: any) => {\n if (isArray(item)) {\n parseChildren(item, g);\n } else {\n const c = decodeReactDom(item);\n c && c.type && g.add(c);\n }\n });\n } else if (children) {\n g.add(decodeReactDom(children));\n }\n}\n\nfunction parseToGraphic(g: any, props: any, childrenList: any): any {\n let isGraphic: boolean = false;\n let out;\n switch (g.type) {\n case 'richtext':\n break;\n case 'rich/text':\n out = g.attribute || {};\n childrenList && (out.text = childrenList);\n g.attribute = out;\n break;\n case 'rich/image':\n out = g.attribute || {};\n break;\n default:\n isGraphic = true;\n }\n\n if (isGraphic) {\n Object.keys(props).forEach(k => {\n const en = REACT_TO_CANOPUS_EVENTS[k];\n if (en) {\n g.on(en, props[k]);\n }\n });\n } else if (g.type === 'richtext') {\n g.attribute.textConfig = childrenList\n .map((item: any) => {\n return decodeReactDom(item);\n })\n .filter((item: any) => item);\n }\n return out;\n}\n"]}
|
package/cjs/register/env.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.browser = void 0;
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const env_1 = require("@visactor/vrender-core/env");
|
|
8
8
|
|
|
9
|
-
exports.browser = (0,
|
|
9
|
+
exports.browser = (0, env_1.isBrowserEnv)();
|
|
10
10
|
//# sourceMappingURL=env.js.map
|
package/cjs/register/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/register/env.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/register/env.ts"],"names":[],"mappings":";;;AAAA,oDAA0D;AAE7C,QAAA,OAAO,GAAG,IAAA,kBAAY,GAAE,CAAC","file":"env.js","sourcesContent":["import { isBrowserEnv } from '@visactor/vrender-core/env';\n\nexport const browser = isBrowserEnv();\n"]}
|