@xfe-repo/web-micro 1.1.4 → 1.1.5

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.js CHANGED
@@ -330,7 +330,7 @@ var MicroAppRoute = (0, import_react.memo)(function(props) {
330
330
  }, []);
331
331
  return /* @__PURE__ */ (0, import_jsx_custom_event.default)("div", {
332
332
  className: className
333
- }, microAppIsError && errorFallback, !microAppIsShow && loadingFallback, /* @__PURE__ */ (0, import_jsx_custom_event.default)("micro-app", {
333
+ }, microAppIsError && errorFallback, !microAppIsShow && !microAppIsError && loadingFallback, /* @__PURE__ */ (0, import_jsx_custom_event.default)("micro-app", {
334
334
  style: {
335
335
  display: microAppIsShow ? "block" : "none"
336
336
  },
@@ -359,6 +359,7 @@ var MicroAppEventCenter = /*#__PURE__*/ function() {
359
359
  this._globalState = {};
360
360
  this.config = config;
361
361
  if (config.isMain) window.microGlobalEventCenter = new import_micro_app2.EventCenterForMicroApp("global");
362
+ if (!window.microGlobalEventCenter) throw new Error("microGlobalEventCenter is not defined, please check if the main app is loaded first");
362
363
  window.microGlobalEventCenter.addGlobalDataListener(function(globalData) {
363
364
  return _this.listener(globalData);
364
365
  });
package/dist/index.mjs CHANGED
@@ -252,7 +252,7 @@ var MicroAppRoute = memo(function(props) {
252
252
  }, []);
253
253
  return /* @__PURE__ */ jsxCustomEvent("div", {
254
254
  className: className
255
- }, microAppIsError && errorFallback, !microAppIsShow && loadingFallback, /* @__PURE__ */ jsxCustomEvent("micro-app", {
255
+ }, microAppIsError && errorFallback, !microAppIsShow && !microAppIsError && loadingFallback, /* @__PURE__ */ jsxCustomEvent("micro-app", {
256
256
  style: {
257
257
  display: microAppIsShow ? "block" : "none"
258
258
  },
@@ -282,6 +282,7 @@ var MicroAppEventCenter = /*#__PURE__*/ function() {
282
282
  this._globalState = {};
283
283
  this.config = config;
284
284
  if (config.isMain) window.microGlobalEventCenter = new EventCenterForMicroApp("global");
285
+ if (!window.microGlobalEventCenter) throw new Error("microGlobalEventCenter is not defined, please check if the main app is loaded first");
285
286
  window.microGlobalEventCenter.addGlobalDataListener(function(globalData) {
286
287
  return _this.listener(globalData);
287
288
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfe-repo/web-micro",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "sideEffects": false,
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,14 +21,14 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@micro-zoe/micro-app": "1.0.0-rc.13",
24
- "@xfe-repo/web-router": "1.1.5",
25
- "@xfe-repo/web-utils": "1.1.3"
24
+ "@xfe-repo/web-utils": "1.1.3",
25
+ "@xfe-repo/web-router": "1.1.5"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^20.16.5",
29
29
  "@types/react": "^18",
30
- "@xfe-repo/typescript-config": "0.0.6",
31
- "@xfe-repo/eslint-config": "0.0.4"
30
+ "@xfe-repo/eslint-config": "0.0.4",
31
+ "@xfe-repo/typescript-config": "0.0.6"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "tsup",