@gct-paas/core 0.0.1-dev.28 → 0.0.1-dev.30

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.
@@ -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(app: App, configs?: IObject[]): Promise<void>;
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<LoadPluginResult>}
93
+ * @returns {*} {Promise<void>}
94
94
  */
95
- static loadWebPlugin(app: App, configs?: IObject[]): Promise<LoadPluginResult>;
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((config) => {
176
- const plugins = config.plugins;
177
- plugins.forEach((plugin) => {
178
- const module = moduleMap[plugin.key];
179
- if (platform === Platform.WEB) {
180
- _gct.register.designer.web.register(
181
- plugin.key,
182
- () => new module.default()
183
- );
184
- } else {
185
- _gct.register.designer.mobile.register(
186
- plugin.key,
187
- () => new module.default()
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(app, configs = []) {
201
+ static async loadMobilePlugin(configs = []) {
205
202
  try {
206
203
  const moduleMap = await this.loadPlugins(PluginModeEnum.MOBILE, configs);
207
- configs.forEach((config) => {
208
- const plugins = config.plugins;
209
- plugins.forEach((plugin) => {
210
- app.use(moduleMap[plugin.key].default);
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<LoadPluginResult>}
220
+ * @returns {*} {Promise<void>}
224
221
  */
225
- static async loadWebPlugin(app, configs = []) {
222
+ static async loadWebPlugin(configs = []) {
226
223
  try {
227
224
  const moduleMap = await this.loadPlugins(PluginModeEnum.WEB, configs);
228
- configs.forEach((config) => {
229
- const plugins = config.plugins;
230
- plugins.forEach((plugin) => {
231
- app.use(moduleMap[plugin.key].default);
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.28",
3
+ "version": "0.0.1-dev.30",
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.28",
60
- "@gct-paas/cli": "0.0.1-dev.28",
59
+ "@gct-paas/build": "0.0.1-dev.30",
60
+ "@gct-paas/cli": "0.0.1-dev.30",
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": "1b551a067c28edb19d38da02baf56eb648784185"
68
+ "gitHead": "a5275f7e7d23ed1751cd0a5ad68893a9ce08d16d"
69
69
  }