@gct-paas/core 0.0.1-dev.28 → 0.0.1-dev.29
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.min.cjs +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/register/designer-register/designer-register.d.ts +2 -2
- package/es/register/designer-register/designer-register.mjs +2 -2
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +3 -3
- package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +26 -30
- package/package.json +4 -4
|
@@ -15,8 +15,8 @@ export declare class DesignerRegister {
|
|
|
15
15
|
protected map: Map<string, () => IDesignerProvider>;
|
|
16
16
|
private providers;
|
|
17
17
|
readonly hooks: {
|
|
18
|
-
register: SyncSeriesHook<IDesignerProvider, null>;
|
|
19
|
-
unregister: SyncSeriesHook<IDesignerProvider, null>;
|
|
18
|
+
register: SyncSeriesHook<[string, IDesignerProvider], null>;
|
|
19
|
+
unregister: SyncSeriesHook<[string, IDesignerProvider], null>;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* 设计器项适配器注册
|
|
@@ -24,7 +24,7 @@ class DesignerRegister {
|
|
|
24
24
|
this.map.set(tag, provider);
|
|
25
25
|
const instance = provider();
|
|
26
26
|
this.providers.set(tag, instance);
|
|
27
|
-
this.hooks.register.callSync(null, instance);
|
|
27
|
+
this.hooks.register.callSync(null, tag, instance);
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* 设计器项适配器注销
|
|
@@ -35,7 +35,7 @@ class DesignerRegister {
|
|
|
35
35
|
this.map.delete(tag);
|
|
36
36
|
const instance = this.providers.get(tag);
|
|
37
37
|
if (instance) {
|
|
38
|
-
this.hooks.unregister.callSync(null, instance);
|
|
38
|
+
this.hooks.unregister.callSync(null, tag, instance);
|
|
39
39
|
this.providers.delete(tag);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -83,14 +83,14 @@ export declare class PluginPgkUtil {
|
|
|
83
83
|
* @param {IObject[]} configs 界面用到的插件集合
|
|
84
84
|
* @returns {*} {Promise<void>}
|
|
85
85
|
*/
|
|
86
|
-
static loadMobilePlugin(
|
|
86
|
+
static loadMobilePlugin(configs?: IObject[]): Promise<void>;
|
|
87
87
|
/**
|
|
88
88
|
* 加载设计态网页端插件包
|
|
89
89
|
*
|
|
90
90
|
* @static
|
|
91
91
|
* @param {App} app
|
|
92
92
|
* @param {IObject[]} configs 界面用到的插件集合
|
|
93
|
-
* @returns {*} {Promise<
|
|
93
|
+
* @returns {*} {Promise<void>}
|
|
94
94
|
*/
|
|
95
|
-
static loadWebPlugin(
|
|
95
|
+
static loadWebPlugin(configs?: IObject[]): Promise<void>;
|
|
96
96
|
}
|
|
@@ -172,22 +172,19 @@ class PluginPgkUtil {
|
|
|
172
172
|
static async loadDesignDeletedPlugins(platform, configs = []) {
|
|
173
173
|
try {
|
|
174
174
|
const moduleMap = await this.loadPlugins(PluginModeEnum.DESIGN, configs);
|
|
175
|
-
configs.forEach((
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
});
|
|
175
|
+
configs.forEach((plugin) => {
|
|
176
|
+
const module = moduleMap[plugin.key];
|
|
177
|
+
if (platform === Platform.WEB) {
|
|
178
|
+
_gct.register.designer.web.register(
|
|
179
|
+
plugin.key,
|
|
180
|
+
() => new module.default()
|
|
181
|
+
);
|
|
182
|
+
} else {
|
|
183
|
+
_gct.register.designer.mobile.register(
|
|
184
|
+
plugin.key,
|
|
185
|
+
() => new module.default()
|
|
186
|
+
);
|
|
187
|
+
}
|
|
191
188
|
});
|
|
192
189
|
} catch (error) {
|
|
193
190
|
console.error(error);
|
|
@@ -201,14 +198,14 @@ class PluginPgkUtil {
|
|
|
201
198
|
* @param {IObject[]} configs 界面用到的插件集合
|
|
202
199
|
* @returns {*} {Promise<void>}
|
|
203
200
|
*/
|
|
204
|
-
static async loadMobilePlugin(
|
|
201
|
+
static async loadMobilePlugin(configs = []) {
|
|
205
202
|
try {
|
|
206
203
|
const moduleMap = await this.loadPlugins(PluginModeEnum.MOBILE, configs);
|
|
207
|
-
configs.forEach((
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
204
|
+
configs.forEach((plugin) => {
|
|
205
|
+
_gct.register.render.mobile.register(
|
|
206
|
+
plugin.key,
|
|
207
|
+
moduleMap[plugin.key].default
|
|
208
|
+
);
|
|
212
209
|
});
|
|
213
210
|
} catch (error) {
|
|
214
211
|
console.error(error);
|
|
@@ -220,21 +217,20 @@ class PluginPgkUtil {
|
|
|
220
217
|
* @static
|
|
221
218
|
* @param {App} app
|
|
222
219
|
* @param {IObject[]} configs 界面用到的插件集合
|
|
223
|
-
* @returns {*} {Promise<
|
|
220
|
+
* @returns {*} {Promise<void>}
|
|
224
221
|
*/
|
|
225
|
-
static async loadWebPlugin(
|
|
222
|
+
static async loadWebPlugin(configs = []) {
|
|
226
223
|
try {
|
|
227
224
|
const moduleMap = await this.loadPlugins(PluginModeEnum.WEB, configs);
|
|
228
|
-
configs.forEach((
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
225
|
+
configs.forEach((plugin) => {
|
|
226
|
+
_gct.register.render.web.register(
|
|
227
|
+
plugin.key,
|
|
228
|
+
moduleMap[plugin.key].default
|
|
229
|
+
);
|
|
233
230
|
});
|
|
234
231
|
} catch (error) {
|
|
235
232
|
console.error(error);
|
|
236
233
|
}
|
|
237
|
-
return [[], {}];
|
|
238
234
|
}
|
|
239
235
|
}
|
|
240
236
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/core",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.29",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心包",
|
|
6
6
|
"main": "dist/index.min.cjs",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"vue-i18n": "9.6.5"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@gct-paas/build": "0.0.1-dev.
|
|
60
|
-
"@gct-paas/cli": "0.0.1-dev.
|
|
59
|
+
"@gct-paas/build": "0.0.1-dev.29",
|
|
60
|
+
"@gct-paas/cli": "0.0.1-dev.29",
|
|
61
61
|
"@types/path-browserify": "^1.0.3",
|
|
62
62
|
"@types/qs": "^6.9.18",
|
|
63
63
|
"fs-extra": "^11.3.0"
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"vue": "^3.x"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "884374c8d6a2997b5138ac65d12e8dd2672cbcfa"
|
|
69
69
|
}
|