@gct-paas/core 0.1.4-dev.7 → 0.1.4-dev.9
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/dist/index.esm.min.mjs +6520 -18715
- package/dist/index.min.cjs +386 -2
- package/dist/index.system.min.js +386 -2
- package/es/constants/core.mjs +0 -1
- package/es/constants/editor-register/editor-register.mjs +0 -1
- package/es/constants/editor-type/editor-type.d.ts +65 -1
- package/es/constants/editor-type/editor-type.mjs +14 -1
- package/es/constants/expression-type/BuiltOperators.d.ts +20 -0
- package/es/constants/expression-type/BuiltOperators.mjs +148 -0
- package/es/constants/expression-type/FunctionKeys.d.ts +1 -0
- package/es/constants/expression-type/FunctionKeys.mjs +81 -0
- package/es/constants/expression-type/editor.d.ts +8 -0
- package/es/constants/expression-type/editor.mjs +4 -0
- package/es/constants/expression-type/function.d.ts +7 -0
- package/es/constants/expression-type/function.mjs +875 -0
- package/es/constants/expression-type/index.d.ts +42 -0
- package/es/constants/expression-type/index.mjs +120 -0
- package/es/constants/expression-type/modeCfg.d.ts +30 -0
- package/es/constants/expression-type/modeCfg.mjs +268 -0
- package/es/constants/expression-type/variable.d.ts +12 -0
- package/es/constants/expression-type/variable.mjs +42 -0
- package/es/constants/form-container-type/form-container-type.mjs +0 -1
- package/es/constants/index.d.ts +5 -0
- package/es/constants/index.mjs +6 -6
- package/es/controller/edit-form/edit-form.controller.mjs +0 -1
- package/es/controller/editor/color-editor.controller.mjs +0 -1
- package/es/controller/editor/length-unit-editor.controller.mjs +0 -1
- package/es/controller/editor-item/editor-item.controller.mjs +0 -1
- package/es/controller/form/form.controller.mjs +5 -4
- package/es/controller/form-collapse/form-collapse.controller.mjs +4 -3
- package/es/controller/form-collapse-pane/form-collapse-pane.controller.mjs +4 -3
- package/es/controller/form-edit-item/form-edit-item.controller.d.ts +1 -0
- package/es/controller/form-edit-item/form-edit-item.controller.mjs +6 -2
- package/es/controller/form-group/form-group.controller.mjs +4 -3
- package/es/controller/form-item/form-item.controller.d.ts +1 -0
- package/es/controller/form-item/form-item.controller.mjs +7 -3
- package/es/controller/form-item-basic/form-item-basic.controller.mjs +3 -2
- package/es/controller/form-item-hidden/form-item-hidden.controller.mjs +0 -1
- package/es/controller/form-tab/form-tab.controller.mjs +4 -3
- package/es/controller/form-tab-pane/form-tab-pane.controller.mjs +4 -3
- package/es/controller/gct-form/gct-form.controller.mjs +5 -4
- package/es/create-app-vue.mjs +3 -9
- package/es/enums/app-designer/index.d.ts +13 -1
- package/es/enums/app-designer/index.mjs +8 -2
- package/es/enums/appEnum.d.ts +22 -66
- package/es/enums/appEnum.mjs +24 -15
- package/es/enums/appStateEnum.mjs +0 -1
- package/es/enums/authActionEnum.mjs +0 -1
- package/es/enums/breakpointEnum.mjs +0 -1
- package/es/enums/cacheEnum.mjs +0 -1
- package/es/enums/designEnum.d.ts +2 -2
- package/es/enums/designEnum.mjs +31 -32
- package/es/enums/developer-center/index.d.ts +1 -0
- package/es/enums/developer-center/integration.d.ts +4 -0
- package/es/enums/developer-center/integration.mjs +7 -0
- package/es/enums/exceptionEnum.mjs +0 -1
- package/es/enums/expressionEnum.d.ts +130 -0
- package/es/enums/expressionEnum.mjs +75 -0
- package/es/enums/globalEnum.d.ts +38 -0
- package/es/enums/globalEnum.mjs +25 -0
- package/es/enums/httpEnum.mjs +0 -1
- package/es/enums/index.d.ts +19 -0
- package/es/enums/index.mjs +13 -16
- package/es/enums/menuEnum.mjs +0 -1
- package/es/enums/page-designer/designer.d.ts +23 -3
- package/es/enums/page-designer/designer.mjs +90 -6
- package/es/enums/page-designer/panel.d.ts +78 -7
- package/es/enums/page-designer/panel.mjs +22 -4
- package/es/enums/page-designer/toolkit.mjs +0 -1
- package/es/enums/page-designer/widget.d.ts +2 -1
- package/es/enums/page-designer/widget.mjs +3 -3
- package/es/enums/pageEnum.mjs +0 -1
- package/es/enums/plugin-enum.mjs +0 -1
- package/es/enums/processEnum.d.ts +54 -0
- package/es/enums/processEnum.mjs +36 -2
- package/es/enums/roleEnum.mjs +0 -1
- package/es/enums/sizeEnum.mjs +0 -1
- package/es/global/gct/gct.d.ts +11 -28
- package/es/global/gct/gct.mjs +29 -32
- package/es/hooks/index.d.ts +2 -1
- package/es/hooks/use-app-inst/use-app-inst.d.ts +8 -0
- package/es/hooks/use-app-inst/use-app-inst.mjs +8 -0
- package/es/hooks/use-form/use-form.mjs +0 -1
- package/es/hooks/use-gct-form-value/use-gct-form-value.d.ts +1 -1
- package/es/hooks/use-gct-form-value/use-gct-form-value.mjs +0 -4
- package/es/hooks/use-modal/use-modal.mjs +0 -1
- package/es/hooks/use-overlay-scrollbars/use-overlay-scrollbars.d.ts +11 -0
- package/es/hooks/use-sub-app-utils/use-sub-app-utils.d.ts +31 -0
- package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +30 -0
- package/es/hooks/useCopyToClipboard.mjs +0 -1
- package/es/index.d.ts +6 -8
- package/es/index.mjs +98 -64
- package/es/interface/controller/form-edit-item/form-edit-item.controller.d.ts +5 -0
- package/es/interface/controller/index.d.ts +0 -1
- package/es/interface/form/i-editor/i-editor-basic.d.ts +2 -2
- package/es/interface/form/i-editor/i-model-field-select-editor.d.ts +18 -0
- package/es/interface/form/i-form/i-form-collapse-pane.d.ts +4 -0
- package/es/interface/form/i-form/i-form-item-basic.d.ts +1 -1
- package/es/interface/form/i-form/i-form-tab-pane.d.ts +4 -0
- package/es/interface/form/index.d.ts +1 -0
- package/es/interface/i-app-context/i-app-context.d.ts +34 -0
- package/es/interface/i-field-code-chain/i-field-code-chain.d.ts +17 -0
- package/es/interface/i-global-var/i-global-var.d.ts +15 -0
- package/es/interface/i-mobile-home-menu-item/i-mobile-home-menu-item.d.ts +94 -0
- package/es/interface/i-pinia-action/i-global-actions.d.ts +8 -20
- package/es/interface/i-pinia-getter/i-global-getters.d.ts +1 -1
- package/es/interface/i-pinia-state/i-global-state.d.ts +7 -14
- package/es/interface/index.d.ts +5 -5
- package/es/interface/open-util/i-message-util/i-message-util.d.ts +54 -0
- package/es/interface/{i-modal → open-util/i-modal}/i-modal.d.ts +9 -10
- package/es/interface/{i-modal-data → open-util/i-modal-data}/i-modal-data.d.ts +6 -0
- package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +12 -0
- package/es/interface/open-util/i-open-window-options/i-open-window-options.d.ts +59 -0
- package/es/interface/open-util/i-overlay-container/i-overlay-container.d.ts +36 -0
- package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +36 -0
- package/es/interface/open-util/index.d.ts +7 -0
- package/es/interface/state/index.d.ts +0 -1
- package/es/locale/index.mjs +2 -2
- package/es/modules/env-manager/env-manager.const.mjs +0 -1
- package/es/modules/env-manager/env-manager.interface.mjs +0 -1
- package/es/modules/env-manager/env-manager.mjs +7 -8
- package/es/modules/error-handler/error-handler.const.mjs +1 -30
- package/es/modules/error-handler/error-strategy.mjs +0 -1
- package/es/modules/error-handler/index.mjs +0 -1
- package/es/modules/platform-config/constants/index.d.ts +7 -0
- package/es/modules/platform-config/constants/login.const.d.ts +15 -0
- package/es/modules/platform-config/constants/login.const.mjs +50 -0
- package/es/modules/platform-config/constants/org.const.d.ts +9 -0
- package/es/modules/platform-config/constants/org.const.mjs +54 -0
- package/es/modules/platform-config/constants/theme.const.d.ts +9 -0
- package/es/modules/platform-config/constants/theme.const.mjs +5 -0
- package/es/modules/platform-config/constants/watermark.const.d.ts +16 -0
- package/es/modules/platform-config/constants/watermark.const.mjs +14 -0
- package/es/modules/platform-config/enums/deploy.enum.d.ts +10 -0
- package/es/modules/platform-config/enums/deploy.enum.mjs +7 -0
- package/es/modules/platform-config/enums/index.d.ts +6 -0
- package/es/modules/platform-config/{constants.d.ts → enums/login.enum.d.ts} +3 -7
- package/es/modules/platform-config/enums/login.enum.mjs +16 -0
- package/es/modules/platform-config/enums/platform.enum.d.ts +27 -0
- package/es/modules/platform-config/enums/platform.enum.mjs +26 -0
- package/es/modules/platform-config/index.d.ts +6 -17
- package/es/modules/platform-config/interfaces/global-setting.interface.d.ts +7 -0
- package/es/modules/platform-config/interfaces/index.d.ts +7 -0
- package/es/modules/platform-config/interfaces/login-config.interface.d.ts +17 -0
- package/es/modules/platform-config/interfaces/platform-map.interface.d.ts +8 -0
- package/es/modules/platform-config/interfaces/theme-setting.interface.d.ts +30 -0
- package/es/modules/platform-config/store.d.ts +221 -0
- package/es/modules/platform-config/store.mjs +78 -0
- package/es/modules/platform-config/useBasicSetting.d.ts +6 -2
- package/es/modules/platform-config/useBasicSetting.mjs +39 -0
- package/es/modules/platform-config/useDeploySetting.d.ts +9 -4
- package/es/modules/platform-config/useDeploySetting.mjs +27 -0
- package/es/modules/platform-config/useLoginSetting.d.ts +4 -14
- package/es/modules/platform-config/useLoginSetting.mjs +177 -0
- package/es/modules/platform-config/useOrgSetting.d.ts +5 -1
- package/es/modules/platform-config/useOrgSetting.mjs +66 -0
- package/es/modules/platform-config/useProjectSetting.d.ts +12 -0
- package/es/modules/platform-config/useProjectSetting.mjs +11 -0
- package/es/modules/platform-config/useSecuritySetting.d.ts +5 -1
- package/es/modules/platform-config/useSecuritySetting.mjs +60 -0
- package/es/modules/platform-config/useThemeSetting.d.ts +6 -3
- package/es/modules/platform-config/useThemeSetting.mjs +64 -0
- package/es/modules/platform-config/useWatermarkSetting.d.ts +4 -1
- package/es/modules/platform-config/useWatermarkSetting.mjs +26 -0
- package/es/modules/user-stores/index.d.ts +3 -0
- package/es/modules/user-stores/store/permission.store.d.ts +21 -0
- package/es/modules/user-stores/store/permission.store.mjs +38 -0
- package/es/modules/user-stores/store/tenant.store.d.ts +9 -0
- package/es/modules/user-stores/store/tenant.store.mjs +24 -0
- package/es/modules/user-stores/store/user.store.d.ts +154 -0
- package/es/modules/user-stores/store/user.store.mjs +107 -0
- package/es/modules/user-stores/types/permission.d.ts +1 -0
- package/es/modules/user-stores/types/tenant.d.ts +1 -0
- package/es/modules/user-stores/types/user.d.ts +14 -0
- package/es/register/editor-register/editor-register.d.ts +5 -13
- package/es/register/editor-register/editor-register.mjs +8 -17
- package/es/register/form-item-register/form-item-register.d.ts +4 -15
- package/es/register/form-item-register/form-item-register.mjs +7 -17
- package/es/register/index.d.ts +12 -2
- package/es/router/index.mjs +0 -1
- package/es/setup-app.d.ts +8 -0
- package/es/setup-app.mjs +30 -0
- package/es/state/form/form.state.mjs +0 -1
- package/es/state/form-collapse/form-collapse.state.mjs +0 -1
- package/es/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -1
- package/es/state/form-edit-item/form-edit-item.state.mjs +0 -1
- package/es/state/form-group/form-group.state.mjs +0 -1
- package/es/state/form-item/form-item.state.mjs +0 -1
- package/es/state/form-item-basic/form-item-basic.state.mjs +0 -1
- package/es/state/form-tab/form-tab.state.mjs +0 -1
- package/es/state/form-tab-pane/form-tab-pane.state.mjs +0 -1
- package/es/state/global-pinia-state/global-pinia-state.d.ts +8 -25
- package/es/state/global-pinia-state/global-pinia-state.mjs +30 -16
- package/es/store/global-store.d.ts +1 -0
- package/es/store/global-store.mjs +40 -37
- package/es/store/index.d.ts +2 -3
- package/es/store/index.mjs +0 -1
- package/es/types/index.d.ts +18 -1
- package/es/utils/axios/interceptors.mjs +2 -23
- package/es/utils/cache-adapter/cache-adapter.d.ts +2 -0
- package/es/utils/cache-adapter/cache-adapter.mjs +59 -0
- package/es/utils/deviceFingerprint.d.ts +17 -0
- package/es/utils/deviceFingerprint.mjs +73 -0
- package/es/utils/dictionary/dictionary.mjs +0 -1
- package/es/utils/i18n/index.d.ts +2 -1
- package/es/utils/i18n/index.mjs +3 -4
- package/es/utils/index.d.ts +17 -3
- package/es/utils/linked-list/linked-list.d.ts +72 -0
- package/es/utils/linked-list/linked-list.mjs +119 -0
- package/es/utils/linked-node/linked-node.d.ts +31 -0
- package/es/utils/linked-node/linked-node.mjs +32 -0
- package/es/utils/lowcode/utils.d.ts +1 -0
- package/es/utils/lowcode/utils.mjs +20 -0
- package/es/utils/lowcode/validate.d.ts +13 -0
- package/es/utils/lowcode/validate.mjs +29 -0
- package/es/utils/mitt/mitt.d.ts +1 -0
- package/es/utils/mitt/mitt.mjs +5 -0
- package/es/utils/model-loader/model-loader.d.ts +118 -0
- package/es/utils/model-loader/model-loader.mjs +326 -0
- package/es/utils/namespace/namespace.d.ts +8 -0
- package/es/utils/namespace/namespace.mjs +4 -2
- package/es/utils/openUtil/index.d.ts +2 -0
- package/es/utils/openUtil/modal/modal.d.ts +61 -0
- package/es/utils/openUtil/modal/modal.mjs +80 -0
- package/es/utils/openUtil/overlay-container/overlay-container.d.ts +100 -0
- package/es/utils/openUtil/overlay-container/overlay-container.mjs +139 -0
- package/es/utils/plugin-static-resource/plugin-static-resource.mjs +0 -1
- package/es/utils/props/gct-form-item/gct-form-item.props.d.ts +63 -0
- package/es/utils/props/gct-form-item/gct-form-item.props.mjs +66 -0
- package/es/utils/props/index.d.ts +1 -0
- package/es/utils/style/index.d.ts +16 -0
- package/es/utils/style/index.mjs +141 -0
- package/es/utils/tools/tools.d.ts +13 -10
- package/es/utils/tools/tools.mjs +23 -11
- package/es/utils/treeHelper/treeHelper.d.ts +124 -0
- package/es/utils/treeHelper/treeHelper.mjs +234 -0
- package/es/utils/util.d.ts +39 -0
- package/es/utils/util.mjs +40 -0
- package/es/utils/uuid/uuid.d.ts +3 -0
- package/es/utils/uuid/uuid.mjs +48 -0
- package/es/utils/value-helper/value-helper.d.ts +49 -0
- package/es/utils/value-helper/value-helper.mjs +111 -0
- package/es/utils/width-install/width-install.mjs +4 -2
- package/package.json +13 -16
- package/es/controller/index.mjs +0 -17
- package/es/enums/page-designer/index.mjs +0 -6
- package/es/global/index.mjs +0 -3
- package/es/hooks/index.mjs +0 -7
- package/es/hooks/use-namespace/use-namespace.d.ts +0 -9
- package/es/hooks/use-namespace/use-namespace.mjs +0 -9
- package/es/interface/controller/i-designer-controller.d.ts +0 -116
- package/es/interface/hooks/i-designer-hooks.d.ts +0 -26
- package/es/interface/hooks/index.d.ts +0 -1
- package/es/interface/i-message-util/i-message-util.d.ts +0 -78
- package/es/interface/index.mjs +0 -1
- package/es/interface/low-code-types/index.d.ts +0 -4
- package/es/interface/low-code-types/modal-types.d.ts +0 -67
- package/es/interface/low-code-types/model/index.d.ts +0 -5338
- package/es/interface/low-code-types/schema/index.d.ts +0 -12
- package/es/interface/low-code-types/widget-basic-types.d.ts +0 -667
- package/es/interface/state/i-designer-state.d.ts +0 -27
- package/es/modules/env-manager/index.mjs +0 -5
- package/es/modules/platform-config/index.mjs +0 -17
- package/es/modules/platform-config/types.d.ts +0 -67
- package/es/provider/i-designer-provider/i-designer-provider.d.ts +0 -102
- package/es/provider/index.d.ts +0 -1
- package/es/provider/index.mjs +0 -1
- package/es/register/designer-register/designer-register.d.ts +0 -53
- package/es/register/designer-register/designer-register.mjs +0 -68
- package/es/register/index.mjs +0 -6
- package/es/register/render-register/render-register.d.ts +0 -59
- package/es/register/render-register/render-register.mjs +0 -64
- package/es/state/index.mjs +0 -12
- package/es/utils/index.mjs +0 -10
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +0 -96
- package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +0 -260
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import path from 'path-browserify';
|
|
2
|
-
import { PLUGIN_BASE_URL } from '../../constants/index.mjs';
|
|
3
|
-
import '../../enums/index.mjs';
|
|
4
|
-
import { Platform } from '../../enums/page-designer/widget.mjs';
|
|
5
|
-
import { PluginModeEnum } from '../../enums/plugin-enum.mjs';
|
|
6
|
-
|
|
7
|
-
"use strict";
|
|
8
|
-
class PluginPgkUtil {
|
|
9
|
-
/**
|
|
10
|
-
* 插件配置缓存
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
13
|
-
* @type {Map<string, IObject[]>}
|
|
14
|
-
*/
|
|
15
|
-
static cache = /* @__PURE__ */ new Map();
|
|
16
|
-
/**
|
|
17
|
-
* 模块缓存
|
|
18
|
-
*
|
|
19
|
-
* @private
|
|
20
|
-
* @static
|
|
21
|
-
*/
|
|
22
|
-
static cacheModules = /* @__PURE__ */ new Map();
|
|
23
|
-
/**
|
|
24
|
-
* 已经加载的插件与模块的映射
|
|
25
|
-
*
|
|
26
|
-
* @static
|
|
27
|
-
*/
|
|
28
|
-
static module = /* @__PURE__ */ new Map();
|
|
29
|
-
/**
|
|
30
|
-
* 加载插件包配置
|
|
31
|
-
*
|
|
32
|
-
* @static
|
|
33
|
-
* @param {PluginModeEnum} mode 插件模式
|
|
34
|
-
* @param {Platform} platform
|
|
35
|
-
* @param {string[]} [kit]
|
|
36
|
-
* @returns {*} {Promise<IStyleIMportMap[]>}
|
|
37
|
-
*/
|
|
38
|
-
static async loadPluginConfig(mode, platform, kit = []) {
|
|
39
|
-
const tag = `${mode}-${platform}-${kit.join("_")}`;
|
|
40
|
-
if (this.cache.has(tag)) {
|
|
41
|
-
return this.cache.get(tag);
|
|
42
|
-
}
|
|
43
|
-
const cfg = {
|
|
44
|
-
client: platform === Platform.WEB ? "WEB" : "MOBILE"
|
|
45
|
-
};
|
|
46
|
-
if (kit.length > 0) {
|
|
47
|
-
cfg.tag = kit.join(",");
|
|
48
|
-
}
|
|
49
|
-
const res = await _api.platform.plugin.postGetTenantCompList(cfg);
|
|
50
|
-
const configs = res.data;
|
|
51
|
-
if (configs.length > 0) {
|
|
52
|
-
this.cache.set(tag, configs);
|
|
53
|
-
}
|
|
54
|
-
return configs;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* 批量加载平台界面 system js 插件包
|
|
58
|
-
*
|
|
59
|
-
* @static
|
|
60
|
-
* @param {IStyleIMportMap[]} plugins
|
|
61
|
-
* @returns {*} {Promise<System.Module[]>}
|
|
62
|
-
*/
|
|
63
|
-
static async loadPlugins(mode, configs = []) {
|
|
64
|
-
const moduleMap = {};
|
|
65
|
-
if (configs.length > 0) {
|
|
66
|
-
const plugins = configs.map((plugin) => {
|
|
67
|
-
const baseUrl = path.join(PLUGIN_BASE_URL, plugin.url, "dist");
|
|
68
|
-
return {
|
|
69
|
-
imports: {
|
|
70
|
-
[plugin.key]: `${baseUrl}/${mode}.system.min.js?version=${plugin.version}`
|
|
71
|
-
},
|
|
72
|
-
styles: {
|
|
73
|
-
[plugin.key]: `${baseUrl}/${mode}.min.css?version=${plugin.version}`
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
const all = [];
|
|
78
|
-
plugins.forEach((plugin) => {
|
|
79
|
-
System.addImportMap(plugin);
|
|
80
|
-
if (plugin.imports) {
|
|
81
|
-
Object.keys(plugin.imports).forEach((key) => {
|
|
82
|
-
const load = async () => {
|
|
83
|
-
try {
|
|
84
|
-
const module = await System.import(key);
|
|
85
|
-
moduleMap[key] = module;
|
|
86
|
-
this.module.set(key, module);
|
|
87
|
-
} catch (error) {
|
|
88
|
-
console.error(error);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
all.push(load());
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
await Promise.all(all);
|
|
96
|
-
}
|
|
97
|
-
return moduleMap;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* 加载插件包
|
|
101
|
-
*
|
|
102
|
-
* @private
|
|
103
|
-
* @static
|
|
104
|
-
* @param {PluginModeEnum} mode
|
|
105
|
-
* @param {Platform} platform
|
|
106
|
-
* @returns {*}
|
|
107
|
-
*/
|
|
108
|
-
static async loadPlugin(mode, platform, kit) {
|
|
109
|
-
kit = ["common", ...kit];
|
|
110
|
-
const tag = `${mode}-${platform}-${kit.join("_")}`;
|
|
111
|
-
try {
|
|
112
|
-
const configs = await this.loadPluginConfig(mode, platform, kit);
|
|
113
|
-
if (!this.cacheModules.has(tag)) {
|
|
114
|
-
const plugins = [];
|
|
115
|
-
configs.forEach((cfg) => {
|
|
116
|
-
if (cfg.plugins) {
|
|
117
|
-
plugins.push(...cfg.plugins);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
const moduleMap = await this.loadPlugins(mode, plugins);
|
|
121
|
-
this.cacheModules.set(tag, moduleMap);
|
|
122
|
-
}
|
|
123
|
-
return [configs, this.cacheModules.get(tag)];
|
|
124
|
-
} catch (error) {
|
|
125
|
-
console.error(error);
|
|
126
|
-
}
|
|
127
|
-
return [[], {}];
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* 加载设计态插件包
|
|
131
|
-
*
|
|
132
|
-
* @static
|
|
133
|
-
* @param {App} app
|
|
134
|
-
* @param {Platform} platform
|
|
135
|
-
* @returns {*} {Promise<LoadPluginResult>}
|
|
136
|
-
*/
|
|
137
|
-
static async loadDesignPlugin(_app, platform, kit = []) {
|
|
138
|
-
try {
|
|
139
|
-
const result = await this.loadPlugin(
|
|
140
|
-
PluginModeEnum.DESIGN,
|
|
141
|
-
platform,
|
|
142
|
-
kit
|
|
143
|
-
);
|
|
144
|
-
const [configs, moduleMap] = result;
|
|
145
|
-
configs.forEach((config) => {
|
|
146
|
-
const plugins = config.plugins;
|
|
147
|
-
plugins.forEach((plugin) => {
|
|
148
|
-
const module = moduleMap[plugin.key];
|
|
149
|
-
if (!module) {
|
|
150
|
-
console.error(`${plugin.key} \u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E\u662F\u5426\u6B63\u786E`);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
if (platform === Platform.WEB) {
|
|
154
|
-
const cls = module.web ?? module.default;
|
|
155
|
-
if (cls) {
|
|
156
|
-
_gct.register.designer.web.register(plugin.key, () => new cls());
|
|
157
|
-
}
|
|
158
|
-
} else {
|
|
159
|
-
const cls = module.mobile ?? module.default;
|
|
160
|
-
if (cls) {
|
|
161
|
-
_gct.register.designer.mobile.register(
|
|
162
|
-
plugin.key,
|
|
163
|
-
() => new cls()
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
return result;
|
|
170
|
-
} catch (error) {
|
|
171
|
-
console.error(error);
|
|
172
|
-
}
|
|
173
|
-
return [[], {}];
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* 加载设计态中,已经被从配置中移除的插件
|
|
177
|
-
*
|
|
178
|
-
* @static
|
|
179
|
-
* @param {Platform} platform
|
|
180
|
-
* @param {IObject[]} configs
|
|
181
|
-
* @returns {*} {Promise<void>}
|
|
182
|
-
*/
|
|
183
|
-
static async loadDesignDeletedPlugins(platform, configs = []) {
|
|
184
|
-
try {
|
|
185
|
-
const moduleMap = await this.loadPlugins(PluginModeEnum.DESIGN, configs);
|
|
186
|
-
configs.forEach((plugin) => {
|
|
187
|
-
const module = moduleMap[plugin.key];
|
|
188
|
-
if (!module) {
|
|
189
|
-
console.error(`${plugin.key} \u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E\u662F\u5426\u6B63\u786E`);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
if (platform === Platform.WEB) {
|
|
193
|
-
const cls = module.web ?? module.default;
|
|
194
|
-
if (cls) {
|
|
195
|
-
_gct.register.designer.web.register(plugin.key, () => new cls());
|
|
196
|
-
}
|
|
197
|
-
} else {
|
|
198
|
-
const cls = module.mobile ?? module.default;
|
|
199
|
-
if (cls) {
|
|
200
|
-
_gct.register.designer.mobile.register(plugin.key, () => new cls());
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
} catch (error) {
|
|
205
|
-
console.error(error);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* 加载设计态移动端插件包
|
|
210
|
-
*
|
|
211
|
-
* @static
|
|
212
|
-
* @param {App} app
|
|
213
|
-
* @param {IObject[]} configs 界面用到的插件集合
|
|
214
|
-
* @returns {*} {Promise<void>}
|
|
215
|
-
*/
|
|
216
|
-
static async loadMobilePlugin(configs = []) {
|
|
217
|
-
try {
|
|
218
|
-
const moduleMap = await this.loadPlugins(PluginModeEnum.MOBILE, configs);
|
|
219
|
-
configs.forEach((plugin) => {
|
|
220
|
-
if (!moduleMap[plugin.key]) {
|
|
221
|
-
console.error(`${plugin.key} \u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E\u662F\u5426\u6B63\u786E`);
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
_gct.register.render.mobile.register(
|
|
225
|
-
plugin.key,
|
|
226
|
-
moduleMap[plugin.key].default
|
|
227
|
-
);
|
|
228
|
-
});
|
|
229
|
-
} catch (error) {
|
|
230
|
-
console.error(error);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* 加载设计态网页端插件包
|
|
235
|
-
*
|
|
236
|
-
* @static
|
|
237
|
-
* @param {App} app
|
|
238
|
-
* @param {IObject[]} configs 界面用到的插件集合
|
|
239
|
-
* @returns {*} {Promise<void>}
|
|
240
|
-
*/
|
|
241
|
-
static async loadWebPlugin(configs = []) {
|
|
242
|
-
try {
|
|
243
|
-
const moduleMap = await this.loadPlugins(PluginModeEnum.WEB, configs);
|
|
244
|
-
configs.forEach((plugin) => {
|
|
245
|
-
if (!moduleMap[plugin.key]) {
|
|
246
|
-
console.error(`${plugin.key} \u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E\u662F\u5426\u6B63\u786E`);
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
_gct.register.render.web.register(
|
|
250
|
-
plugin.key,
|
|
251
|
-
moduleMap[plugin.key].default
|
|
252
|
-
);
|
|
253
|
-
});
|
|
254
|
-
} catch (error) {
|
|
255
|
-
console.error(error);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
export { PluginPgkUtil };
|