@ibiz-template/runtime 0.7.41-alpha.126 → 0.7.41-alpha.128

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.
Files changed (60) hide show
  1. package/dist/index.esm.js +88 -56
  2. package/dist/index.system.min.js +1 -1
  3. package/out/app-hub.d.ts +8 -0
  4. package/out/app-hub.d.ts.map +1 -1
  5. package/out/app-hub.js +25 -0
  6. package/out/application.d.ts +0 -7
  7. package/out/application.d.ts.map +1 -1
  8. package/out/application.js +0 -21
  9. package/out/config/global-config.d.ts +7 -1
  10. package/out/config/global-config.d.ts.map +1 -1
  11. package/out/config/global-config.js +20 -0
  12. package/out/interface/api/app/i-api-app-hub-service.d.ts +7 -0
  13. package/out/interface/api/app/i-api-app-hub-service.d.ts.map +1 -1
  14. package/out/interface/api/common/global-config/i-api-global-common-config.d.ts +8 -0
  15. package/out/interface/api/common/global-config/i-api-global-common-config.d.ts.map +1 -1
  16. package/out/interface/api/common/global-config/i-api-global-config.d.ts +7 -0
  17. package/out/interface/api/common/global-config/i-api-global-config.d.ts.map +1 -1
  18. package/out/interface/api/common/global-config/i-api-global-img-assets.d.ts +92 -0
  19. package/out/interface/api/common/global-config/i-api-global-img-assets.d.ts.map +1 -0
  20. package/out/interface/api/common/global-config/i-api-global-img-assets.js +1 -0
  21. package/out/interface/api/common/global-config/index.d.ts +1 -0
  22. package/out/interface/api/common/global-config/index.d.ts.map +1 -1
  23. package/out/interface/common/i-global-config/i-global-img-assets.d.ts +10 -0
  24. package/out/interface/common/i-global-config/i-global-img-assets.d.ts.map +1 -0
  25. package/out/interface/common/i-global-config/i-global-img-assets.js +1 -0
  26. package/out/interface/common/i-global-config/index.d.ts +1 -0
  27. package/out/interface/common/i-global-config/index.d.ts.map +1 -1
  28. package/out/interface/common/i-global-config/index.js +1 -0
  29. package/out/interface/common/index.d.ts +1 -1
  30. package/out/interface/common/index.d.ts.map +1 -1
  31. package/out/locale/en/index.d.ts +1 -3
  32. package/out/locale/en/index.d.ts.map +1 -1
  33. package/out/locale/en/index.js +1 -3
  34. package/out/locale/zh-CN/index.d.ts +1 -3
  35. package/out/locale/zh-CN/index.d.ts.map +1 -1
  36. package/out/locale/zh-CN/index.js +1 -3
  37. package/out/register/custom-register.d.ts.map +1 -1
  38. package/out/register/custom-register.js +5 -0
  39. package/out/register/helper/app-menu-item-register.d.ts.map +1 -1
  40. package/out/register/helper/app-menu-item-register.js +14 -11
  41. package/out/utils/theme-util/theme-util.d.ts +9 -1
  42. package/out/utils/theme-util/theme-util.d.ts.map +1 -1
  43. package/out/utils/theme-util/theme-util.js +38 -12
  44. package/package.json +2 -2
  45. package/src/app-hub.ts +28 -0
  46. package/src/application.ts +0 -23
  47. package/src/config/global-config.ts +22 -0
  48. package/src/interface/api/app/i-api-app-hub-service.ts +8 -0
  49. package/src/interface/api/common/global-config/i-api-global-common-config.ts +9 -0
  50. package/src/interface/api/common/global-config/i-api-global-config.ts +8 -0
  51. package/src/interface/api/common/global-config/i-api-global-img-assets.ts +102 -0
  52. package/src/interface/api/common/global-config/index.ts +1 -0
  53. package/src/interface/common/i-global-config/i-global-img-assets.ts +9 -0
  54. package/src/interface/common/i-global-config/index.ts +1 -0
  55. package/src/interface/common/index.ts +1 -0
  56. package/src/locale/en/index.ts +2 -4
  57. package/src/locale/zh-CN/index.ts +1 -3
  58. package/src/register/custom-register.ts +5 -0
  59. package/src/register/helper/app-menu-item-register.ts +15 -15
  60. package/src/utils/theme-util/theme-util.ts +39 -12
package/dist/index.esm.js CHANGED
@@ -19990,6 +19990,7 @@ var GlobalConfig = class {
19990
19990
  mergeAppMenu: "default",
19991
19991
  enableAIMinimize: true,
19992
19992
  aiChatTopicCaptionMode: "default",
19993
+ aiChatTopicCaptionComputedMode: "question",
19993
19994
  aiResourceMode: void 0,
19994
19995
  enableAIAgentChange: true,
19995
19996
  globalDownloadPrifix: false,
@@ -20075,6 +20076,25 @@ var GlobalConfig = class {
20075
20076
  quality: 0,
20076
20077
  maxWidth: 1280
20077
20078
  };
20079
+ /**
20080
+ * @description 静态图片资源
20081
+ * @type {IGlobalImgAssets}
20082
+ * @memberof GlobalConfig
20083
+ */
20084
+ this.imageAssets = {
20085
+ noPermission: "".concat(ibiz.env.assetsUrl, "/images/403.png"),
20086
+ noFind: "".concat(ibiz.env.assetsUrl, "/images/404.png"),
20087
+ loginAvatar: "".concat(ibiz.env.assetsUrl, "/images/login-avatar.png"),
20088
+ loginHeader: "".concat(ibiz.env.assetsUrl, "/images/login-header.png"),
20089
+ poiMarker: "".concat(ibiz.env.assetsUrl, "/images/poi-marker-default.png"),
20090
+ userAvatar: "".concat(ibiz.env.assetsUrl, "/images/user-avatar.png"),
20091
+ chat: "".concat(ibiz.env.assetsUrl, "/images/svg/chat.svg"),
20092
+ customWorkbench: "".concat(ibiz.env.assetsUrl, "/images/svg/custom-workbench.svg"),
20093
+ helper: "".concat(ibiz.env.assetsUrl, "/images/svg/helper.svg"),
20094
+ iconImport: "".concat(ibiz.env.assetsUrl, "/images/svg/icon-import.svg"),
20095
+ message: "".concat(ibiz.env.assetsUrl, "/images/svg/message.svg"),
20096
+ setting: "".concat(ibiz.env.assetsUrl, "/images/svg/setting.svg")
20097
+ };
20078
20098
  }
20079
20099
  };
20080
20100
 
@@ -24128,6 +24148,10 @@ var CustomRegister = class {
24128
24148
  * @memberof CustomRegister
24129
24149
  */
24130
24150
  static getRegisterKey(registerType, opts) {
24151
+ const { mainModel } = opts;
24152
+ if (mainModel && mainModel.customExtTag) {
24153
+ return mainModel.customExtTag;
24154
+ }
24131
24155
  switch (registerType) {
24132
24156
  case VIEW_PROVIDER_PREFIX:
24133
24157
  return this.calcExtensionViewKey(opts);
@@ -65878,21 +65902,6 @@ function getProvider15(key) {
65878
65902
  async function getAppMenuItemProvider(model, control) {
65879
65903
  let provider;
65880
65904
  const { sysPFPluginId, appId: appId2, itemType } = model;
65881
- const registerKey = CustomRegister.getRegisterKey(
65882
- APPMENUITEM_PROVIDER_PREFIX,
65883
- {
65884
- mainModel: model,
65885
- control
65886
- }
65887
- );
65888
- provider = getProvider15(registerKey);
65889
- if (provider)
65890
- return provider;
65891
- ibiz.log.debug(
65892
- ibiz.i18n.t("runtime.register.helper.menuItemCustomRegistration", {
65893
- registerKey
65894
- })
65895
- );
65896
65905
  if (sysPFPluginId) {
65897
65906
  const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
65898
65907
  if (pluginKey)
@@ -73783,7 +73792,7 @@ var ThemeUtil = class {
73783
73792
  /**
73784
73793
  * @description 加载主题插件
73785
73794
  * @param {IAppUITheme} theme
73786
- * @param {('COLOR' | 'ICON')} [type='COLOR'] 颜色主题|图标主题,默认值为颜色主题
73795
+ * @param {('COLOR' | 'ICON')} [type='COLOR'] 颜色主题|图标主题,默认值为颜色主题,颜色主题包含远程插件和主题变量共存的情况,主题变量的优先级大于远程插件的优先级
73787
73796
  * @returns {*} {Promise<void>}
73788
73797
  * @memberof ThemeUtil
73789
73798
  */
@@ -73792,19 +73801,43 @@ var ThemeUtil = class {
73792
73801
  const path2 = data["theme-package-path"] || theme.themeUrl;
73793
73802
  delete data.appId;
73794
73803
  delete data["theme-package-path"];
73795
- await ibiz.plugin.loadPlugin({
73796
- runtimeObject: true,
73797
- rtobjectName: theme.themeTag,
73798
- rtobjectRepo: path2
73799
- });
73804
+ if (path2) {
73805
+ await ibiz.plugin.loadPlugin({
73806
+ runtimeObject: true,
73807
+ rtobjectName: theme.themeTag,
73808
+ rtobjectRepo: path2
73809
+ });
73810
+ }
73800
73811
  if (type === "COLOR") {
73801
73812
  this.setThemeParams(theme, data);
73813
+ if (theme.cssStyle) {
73814
+ this.setThemeCssStyle(theme);
73815
+ }
73802
73816
  this.setTheme(theme.themeTag);
73803
73817
  this.pluginTheme.push(theme);
73804
73818
  } else {
73805
73819
  this.html.classList.add(theme.themeTag);
73806
73820
  }
73807
73821
  }
73822
+ /**
73823
+ * @description 设置主题变量
73824
+ * @protected
73825
+ * @param {IAppUITheme} theme
73826
+ * @returns {*} {void}
73827
+ * @memberof ThemeUtil
73828
+ */
73829
+ setThemeCssStyle(theme) {
73830
+ const styleId = "".concat(theme.themeTag, "-var-css");
73831
+ const themeStyle = document.getElementById(styleId);
73832
+ if (themeStyle) {
73833
+ return;
73834
+ }
73835
+ const style = document.createElement("style");
73836
+ style.id = styleId;
73837
+ style.type = "text/css";
73838
+ style.innerHTML = theme.cssStyle;
73839
+ document.head.appendChild(style);
73840
+ }
73808
73841
  /**
73809
73842
  * @description 设置额外修改的主题参数
73810
73843
  * @protected
@@ -73826,11 +73859,11 @@ var ThemeUtil = class {
73826
73859
  }
73827
73860
  }
73828
73861
  content += "}";
73829
- const script = document.createElement("style");
73830
- script.id = theme.themeTag;
73831
- script.type = "text/css";
73832
- script.innerHTML = content;
73833
- document.head.appendChild(script);
73862
+ const style = document.createElement("style");
73863
+ style.id = theme.themeTag;
73864
+ style.type = "text/css";
73865
+ style.innerHTML = content;
73866
+ document.head.appendChild(style);
73834
73867
  }
73835
73868
  /**
73836
73869
  * @description 设置主题
@@ -83875,7 +83908,6 @@ var Application = class {
83875
83908
  await this.loadAppModelStyle();
83876
83909
  await this.loadAppLang();
83877
83910
  await this.loadGlobalAppUtil();
83878
- await this.loadExtensionPlugin();
83879
83911
  await this.loadReplaceDefaultPlugin();
83880
83912
  }
83881
83913
  /**
@@ -83937,27 +83969,6 @@ var Application = class {
83937
83969
  return;
83938
83970
  await ibiz.plugin.loadPlugin(globalAppUtilPlugin);
83939
83971
  }
83940
- /**
83941
- * @description 加载扩展插件
83942
- * @protected
83943
- * @returns {*} {Promise<void>}
83944
- * @memberof Application
83945
- */
83946
- async loadExtensionPlugin() {
83947
- try {
83948
- await ibiz.plugin.loadPlugin({
83949
- runtimeObject: true,
83950
- rtobjectName: "ExtensionPlugin",
83951
- rtobjectRepo: "".concat(ibiz.env.baseUrl, "/").concat(this.appId).concat(ibiz.env.remoteModelUrl, "/ext")
83952
- });
83953
- } catch (error) {
83954
- ibiz.log.warn(
83955
- ibiz.i18n.t("runtime.application.noExtensionPlugin", {
83956
- appId: this.appId
83957
- })
83958
- );
83959
- }
83960
- }
83961
83972
  /**
83962
83973
  * @description 加载替换默认插件(仅主应用执行)
83963
83974
  * @protected
@@ -85416,6 +85427,28 @@ var AppHub = class {
85416
85427
  const targetCodeListMap = this.codeLists.get(appId2);
85417
85428
  return targetCodeListMap == null ? void 0 : targetCodeListMap.get(id);
85418
85429
  }
85430
+ /**
85431
+ * @description 加载扩展插件
85432
+ * @public
85433
+ * @param {string} appId
85434
+ * @returns {*} {Promise<void>}
85435
+ * @memberof AppHub
85436
+ */
85437
+ async loadExtensionPlugin(appId2) {
85438
+ try {
85439
+ await ibiz.plugin.loadPlugin({
85440
+ runtimeObject: true,
85441
+ rtobjectName: "ExtensionPlugin",
85442
+ rtobjectRepo: "".concat(ibiz.env.baseUrl, "/").concat(appId2).concat(ibiz.env.remoteModelUrl, "/ext")
85443
+ });
85444
+ } catch (error) {
85445
+ ibiz.log.warn(
85446
+ ibiz.i18n.t("runtime.application.noExtensionPlugin", {
85447
+ appId: ibiz.env.appId
85448
+ })
85449
+ );
85450
+ }
85451
+ }
85419
85452
  /**
85420
85453
  * 新建 hub 应用
85421
85454
  *
@@ -85431,6 +85464,9 @@ var AppHub = class {
85431
85464
  if (!this.modelLoaderProvider) {
85432
85465
  throw new RuntimeError73(ibiz.i18n.t("runtime.utils.firstregister"));
85433
85466
  }
85467
+ if (id !== ibiz.env.appId) {
85468
+ await this.loadExtensionPlugin(id);
85469
+ }
85434
85470
  const appModel = await this.modelLoaderProvider.getApp(id);
85435
85471
  const subAppRef = await this.modelLoaderProvider.getSubAppRef(id);
85436
85472
  const app = new Application(appModel, subAppRef);
@@ -92197,12 +92233,10 @@ var en = {
92197
92233
  noImplemented: "Getting application global variables is not implemented",
92198
92234
  noImplementedRouting: "Getting view routing parameter variables is not implemented"
92199
92235
  },
92200
- application: {
92201
- noExtensionPlugin: "Attempted to load application [{appId}] extension plugin, but no extension plugin was found"
92202
- },
92203
92236
  hub: {
92204
92237
  failedParse: "View parameter {paramsName} failed to parse: {error}",
92205
- noExist: "View [{id}] does not exist"
92238
+ noExist: "View [{id}] does not exist",
92239
+ noExtensionPlugin: "Attempted to load application [{appId}] extension plugin, but no extension plugin was found"
92206
92240
  },
92207
92241
  logicScheduler: {
92208
92242
  executor: {
@@ -92907,12 +92941,10 @@ var zhCn = {
92907
92941
  global: {
92908
92942
  noImplemented: "\u83B7\u53D6\u5E94\u7528\u5168\u5C40\u53D8\u91CF\u6CA1\u6709\u5B9E\u73B0"
92909
92943
  },
92910
- application: {
92911
- noExtensionPlugin: "\u5C1D\u8BD5\u52A0\u8F7D\u5E94\u7528[{appId}]\u6269\u5C55\u63D2\u4EF6\uFF0C\u6682\u672A\u627E\u5230\u6269\u5C55\u63D2\u4EF6"
92912
- },
92913
92944
  hub: {
92914
92945
  failedParse: "\u89C6\u56FE\u53C2\u6570 {paramsName} \u89E3\u6790\u5931\u8D25\uFF1A{error}",
92915
- noExist: "\u89C6\u56FE[{id}]\u4E0D\u5B58\u5728"
92946
+ noExist: "\u89C6\u56FE[{id}]\u4E0D\u5B58\u5728",
92947
+ noExtensionPlugin: "\u5C1D\u8BD5\u52A0\u8F7D\u5E94\u7528[{appId}]\u6269\u5C55\u63D2\u4EF6\uFF0C\u6682\u672A\u627E\u5230\u6269\u5C55\u63D2\u4EF6"
92916
92948
  },
92917
92949
  logicScheduler: {
92918
92950
  executor: {