@morningfast/platform 0.0.11 → 0.0.12

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.
@@ -3,7 +3,7 @@ import { n as t, r as n, s as r, t as i } from "./config-Cd-9BYBy.js";
3
3
  import { useRoute as a } from "vue-router";
4
4
  import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, nextTick as m, onBeforeUnmount as h, onMounted as g, openBlock as _, reactive as v, ref as y, resolveComponent as b, toDisplayString as x, unref as S, watch as C, withCtx as w } from "vue";
5
5
  import { defineStore as T } from "pinia";
6
- import { Link as E, RefreshRight as D, WarningFilled as ee } from "@element-plus/icons-vue";
6
+ import { Link as ee, RefreshRight as E, WarningFilled as D } from "@element-plus/icons-vue";
7
7
  import { addGlobalUncaughtErrorHandler as O, registerMicroApps as k, start as A } from "qiankun";
8
8
  //#region src/main/utils/theme.ts
9
9
  var j = "theme-color", M = "theme-mode", N = "theme-position", P = [
@@ -91,33 +91,33 @@ function ie(e) {
91
91
  function ae() {
92
92
  return window.matchMedia("(prefers-color-scheme: dark)").matches;
93
93
  }
94
- function L(e) {
94
+ function oe(e) {
95
95
  return e === "dark" || e === "system" && ae();
96
96
  }
97
- function R(e) {
98
- let t = L(e);
97
+ function se(e) {
98
+ let t = oe(e);
99
99
  document.documentElement.classList.toggle("dark", t), document.documentElement.style.colorScheme = t ? "dark" : "light";
100
100
  }
101
- function z(e) {
101
+ function L(e) {
102
102
  let t = document.documentElement, n = t.classList.contains("dark");
103
- t.style.setProperty("--el-color-primary", e), t.style.setProperty("--el-color-primary-light-3", H(e, n ? "#000000" : "#ffffff", .3)), t.style.setProperty("--el-color-primary-light-5", H(e, n ? "#000000" : "#ffffff", .5)), t.style.setProperty("--el-color-primary-light-7", H(e, n ? "#000000" : "#ffffff", .7)), t.style.setProperty("--el-color-primary-light-8", H(e, n ? "#000000" : "#ffffff", .8)), t.style.setProperty("--el-color-primary-light-9", H(e, n ? "#000000" : "#ffffff", .9)), t.style.setProperty("--el-color-primary-dark-2", H(e, n ? "#ffffff" : "#000000", .2));
103
+ t.style.setProperty("--el-color-primary", e), t.style.setProperty("--el-color-primary-light-3", B(e, n ? "#000000" : "#ffffff", .3)), t.style.setProperty("--el-color-primary-light-5", B(e, n ? "#000000" : "#ffffff", .5)), t.style.setProperty("--el-color-primary-light-7", B(e, n ? "#000000" : "#ffffff", .7)), t.style.setProperty("--el-color-primary-light-8", B(e, n ? "#000000" : "#ffffff", .8)), t.style.setProperty("--el-color-primary-light-9", B(e, n ? "#000000" : "#ffffff", .9)), t.style.setProperty("--el-color-primary-dark-2", B(e, n ? "#ffffff" : "#000000", .2));
104
104
  }
105
- function oe() {
106
- R(I()), z(F()), B(re());
105
+ function ce() {
106
+ se(I()), L(F()), R(re());
107
107
  }
108
- function B(e) {
108
+ function R(e) {
109
109
  document.documentElement.setAttribute("data-theme-position", e);
110
110
  }
111
- function V(e = 50) {
111
+ function z(e = 50) {
112
112
  return new Promise((t) => {
113
113
  setTimeout(() => {
114
- z(F()), t();
114
+ L(F()), t();
115
115
  }, e);
116
116
  });
117
117
  }
118
- async function se(e, t) {
118
+ async function le(e, t) {
119
119
  if (!document.startViewTransition) {
120
- t(), await V();
120
+ t(), await z();
121
121
  return;
122
122
  }
123
123
  let n = e.clientX, r = e.clientY, i = Math.hypot(Math.max(n, innerWidth - n), Math.max(r, innerHeight - r));
@@ -132,16 +132,16 @@ async function se(e, t) {
132
132
  fill: "both",
133
133
  pseudoElement: c ? "::view-transition-old(root)" : "::view-transition-new(root)"
134
134
  });
135
- }), await V();
135
+ }), await z();
136
136
  } catch {
137
- t(), await V();
137
+ t(), await z();
138
138
  }
139
139
  }
140
- function H(e, t, n) {
141
- let [r, i, a] = U(e), [o, s, c] = U(t), l = (e, t) => Math.round(e * (1 - n) + t * n);
140
+ function B(e, t, n) {
141
+ let [r, i, a] = V(e), [o, s, c] = V(t), l = (e, t) => Math.round(e * (1 - n) + t * n);
142
142
  return `rgb(${l(r, o)}, ${l(i, s)}, ${l(a, c)})`;
143
143
  }
144
- function U(e) {
144
+ function V(e) {
145
145
  let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = Number.parseInt(n, 16);
146
146
  return [
147
147
  r >> 16 & 255,
@@ -151,207 +151,229 @@ function U(e) {
151
151
  }
152
152
  //#endregion
153
153
  //#region src/main/stores/app.ts
154
- var W = "sidebar-collapsed", G = "menu-search-placement", K = "layout-mode", q = "top-menu-path", J = T("app", () => {
155
- let e = y(localStorage.getItem(W) === "true"), t = y(!1), n = y("theme"), r = y(I()), i = y(F()), a = y(re()), s = y(ce(localStorage.getItem(K))), c = y(localStorage.getItem(G) || "header"), l = y(localStorage.getItem(q) || ""), u = y(!0), d = o(() => L(r.value)), f = o(() => s.value === "top" ? ["header"] : ["header", "sidebar"]), p = o(() => s.value !== "top" && c.value === "sidebar");
156
- function m() {
154
+ var H = "sidebar-collapsed", U = "menu-search-placement", W = "layout-mode", G = "top-menu-path", ue = "(max-width: 768px)", K = null, q = T("app", () => {
155
+ let e = y(localStorage.getItem(H) === "true"), t = y(!1), n = y(de()), r = y(!1), i = y("theme"), a = y(I()), s = y(F()), c = y(re()), l = y(pe(localStorage.getItem(W))), u = y(localStorage.getItem(U) || "header"), d = y(localStorage.getItem(G) || ""), f = y(!0), p = o(() => oe(a.value)), m = o(() => l.value === "top" ? ["header"] : ["header", "sidebar"]), h = o(() => l.value !== "top" && u.value === "sidebar");
156
+ function g() {
157
+ if (n.value) {
158
+ t.value = !t.value;
159
+ return;
160
+ }
157
161
  e.value = !e.value;
158
162
  }
159
- function h(t) {
160
- e.value = t, localStorage.setItem(W, String(e.value));
161
- }
162
- function g(e = "theme") {
163
- n.value = e, t.value = !0;
163
+ function _(t) {
164
+ e.value = t, localStorage.setItem(H, String(e.value));
164
165
  }
165
- function _() {
166
+ function v() {
166
167
  t.value = !1;
167
168
  }
168
- function v(e) {
169
- t.value = e;
170
- }
171
- function b(e) {
172
- r.value = e, ne(e), R(e), z(i.value);
169
+ function b(e = "theme") {
170
+ i.value = e, r.value = !0;
173
171
  }
174
172
  function x() {
175
- b(ae() && r.value === "system" || d.value ? "light" : "dark");
173
+ r.value = !1;
176
174
  }
177
175
  function S(e) {
178
- i.value = e, te(e), z(e);
176
+ r.value = e;
179
177
  }
180
178
  function C(e) {
181
- a.value = e, ie(e), B(e);
179
+ a.value = e, ne(e), se(e), L(s.value);
182
180
  }
183
- function w(e) {
184
- s.value = e, localStorage.setItem(K, e), e === "top" && c.value === "sidebar" && T("header");
181
+ function w() {
182
+ C(ae() && a.value === "system" || p.value ? "light" : "dark");
185
183
  }
186
184
  function T(e) {
187
- let t = s.value === "top" ? "header" : e;
188
- c.value = t, localStorage.setItem(G, t);
185
+ s.value = e, te(e), L(e);
186
+ }
187
+ function ee(e) {
188
+ c.value = e, ie(e), R(e);
189
189
  }
190
190
  function E(e) {
191
- l.value = e, localStorage.setItem(q, e);
191
+ l.value = e, localStorage.setItem(W, e), e === "top" && u.value === "sidebar" && D("header");
192
+ }
193
+ function D(e) {
194
+ let t = l.value === "top" ? "header" : e;
195
+ u.value = t, localStorage.setItem(U, t);
196
+ }
197
+ function O(e) {
198
+ d.value = e, localStorage.setItem(G, e);
192
199
  }
193
- function D() {
194
- oe();
200
+ function k() {
201
+ ce(), fe();
195
202
  }
196
203
  return {
197
- closeSettings: _,
198
- initializePreferences: D,
199
- isDark: d,
200
- layoutMode: s,
201
- menuSearchPlacement: c,
202
- menuSearchPlacementOptions: f,
203
- openSettings: g,
204
- isSidebarMenuSearch: p,
205
- settingsActiveTab: n,
206
- selectedTopMenuPath: l,
207
- setLayoutMode: w,
208
- setMenuSearchPlacement: T,
209
- setSelectedTopMenuPath: E,
210
- setSettingsVisible: v,
211
- setSidebarCollapsed: h,
212
- setThemeColor: S,
213
- setThemeColorPosition: C,
214
- setThemeMode: b,
215
- settingsVisible: t,
204
+ closeMobileSidebar: v,
205
+ closeSettings: x,
206
+ initializePreferences: k,
207
+ isDark: p,
208
+ isMobileViewport: n,
209
+ layoutMode: l,
210
+ menuSearchPlacement: u,
211
+ menuSearchPlacementOptions: m,
212
+ mobileSidebarVisible: t,
213
+ openSettings: b,
214
+ isSidebarMenuSearch: h,
215
+ settingsActiveTab: i,
216
+ selectedTopMenuPath: d,
217
+ setLayoutMode: E,
218
+ setMenuSearchPlacement: D,
219
+ setSelectedTopMenuPath: O,
220
+ setSettingsVisible: S,
221
+ setSidebarCollapsed: _,
222
+ setThemeColor: T,
223
+ setThemeColorPosition: ee,
224
+ setThemeMode: C,
225
+ settingsVisible: r,
216
226
  sidebarCollapsed: e,
217
- shortcutTipVisible: u,
218
- themeColor: i,
219
- themeColorPosition: a,
220
- themeMode: r,
221
- toggleDarkMode: x,
222
- toggleSidebar: m
227
+ shortcutTipVisible: f,
228
+ themeColor: s,
229
+ themeColorPosition: c,
230
+ themeMode: a,
231
+ toggleDarkMode: w,
232
+ toggleSidebar: g
223
233
  };
224
234
  });
225
- function ce(e) {
235
+ function de() {
236
+ return typeof window > "u" ? !1 : window.matchMedia(ue).matches;
237
+ }
238
+ function fe() {
239
+ if (typeof window > "u" || K) return;
240
+ let e = window.matchMedia(ue), t = q(), n = () => {
241
+ t.isMobileViewport = e.matches, e.matches || t.closeMobileSidebar();
242
+ };
243
+ n(), e.addEventListener("change", n), K = () => {
244
+ e.removeEventListener("change", n), K = null;
245
+ };
246
+ }
247
+ function pe(e) {
226
248
  return e === "side" || e === "top" || e === "mix" ? e : "default";
227
249
  }
228
250
  //#endregion
229
251
  //#region src/main/micro-apps/status.ts
230
- var Y = v({}), X = v({});
231
- function le() {
232
- return Y;
252
+ var J = v({}), Y = v({});
253
+ function me() {
254
+ return J;
233
255
  }
234
- function ue(e) {
235
- return X[e];
256
+ function he(e) {
257
+ return Y[e];
236
258
  }
237
- function de(e) {
259
+ function ge(e) {
238
260
  return n(t()).find((t) => e === t.activeRule || e.startsWith(`${t.activeRule}/`));
239
261
  }
240
- function fe(e) {
241
- return Y[e.name] || (Y[e.name] = {
262
+ function _e(e) {
263
+ return J[e.name] || (J[e.name] = {
242
264
  name: e.name,
243
265
  title: e.title,
244
266
  entry: e.entry,
245
267
  activeRule: e.activeRule,
246
268
  status: "idle",
247
269
  updatedAt: Date.now()
248
- }, Y[e.name]);
270
+ }, J[e.name]);
249
271
  }
250
- function pe(e) {
251
- ye(e, {
272
+ function ve(e) {
273
+ we(e, {
252
274
  status: "loading",
253
275
  message: void 0
254
276
  });
255
277
  }
256
- function me(e) {
257
- ye(e, {
278
+ function ye(e) {
279
+ we(e, {
258
280
  status: "mounted",
259
281
  message: void 0
260
282
  });
261
283
  }
262
- function he(e, t) {
263
- be(e, {
284
+ function be(e, t) {
285
+ Te(e, {
264
286
  status: "error",
265
- message: Z(t)
287
+ message: X(t)
266
288
  });
267
289
  }
268
- function ge(e, t) {
269
- let n = Y[e];
270
- return n ? (n.status = "error", n.message = Z(t), n.updatedAt = Date.now(), !0) : !1;
290
+ function xe(e, t) {
291
+ let n = J[e];
292
+ return n ? (n.status = "error", n.message = X(t), n.updatedAt = Date.now(), !0) : !1;
271
293
  }
272
- function _e(e, t, n) {
273
- X[t] = {
294
+ function Se(e, t, n) {
295
+ Y[t] = {
274
296
  path: t,
275
297
  name: e.name,
276
298
  title: e.title,
277
299
  entry: e.entry,
278
300
  activeRule: e.activeRule,
279
- message: Z(n),
301
+ message: X(n),
280
302
  updatedAt: Date.now()
281
303
  };
282
304
  }
283
- function ve(e) {
284
- delete X[e];
305
+ function Ce(e) {
306
+ delete Y[e];
285
307
  }
286
- function ye(e, t) {
287
- let n = Y[e];
308
+ function we(e, t) {
309
+ let n = J[e];
288
310
  n && (n.status = t.status, n.message = t.message, n.updatedAt = Date.now());
289
311
  }
290
- function be(e, t) {
291
- let n = fe(e);
312
+ function Te(e, t) {
313
+ let n = _e(e);
292
314
  n.title = e.title, n.entry = e.entry, n.activeRule = e.activeRule, n.status = t.status, n.message = t.message, n.updatedAt = Date.now();
293
315
  }
294
- function Z(e) {
295
- let t = xe(e);
296
- return t ? Ce(Se(t)) : "子应用入口不可访问、服务未启动,或加载过程中发生异常。";
316
+ function X(e) {
317
+ let t = Ee(e);
318
+ return t ? Oe(De(t)) : "子应用入口不可访问、服务未启动,或加载过程中发生异常。";
297
319
  }
298
- function xe(e) {
320
+ function Ee(e) {
299
321
  return e instanceof Error ? e.message : typeof e == "string" ? e : "";
300
322
  }
301
- function Se(e) {
323
+ function De(e) {
302
324
  return e.trim().replace(/^(application ['"][^'"]+['"] died in status [A-Z_]+:\s*)\1+/, "$1");
303
325
  }
304
- function Ce(e) {
326
+ function Oe(e) {
305
327
  let t = e.trim(), n = t.toLowerCase(), r = t.match(/application ['"]([^'"]+)['"]/)?.[1], i = r ? `子应用“${r}”` : "子应用";
306
328
  return n.includes("cannot use import statement outside a module") ? `${i}入口已响应,但加载失败。请确认子应用服务已启动,并确认入口地址指向子应用服务。` : n.includes("unexpected token <") ? `${i}入口返回了 HTML,但 qiankun 正在按脚本解析。请检查入口地址是否填错、子应用服务是否启动,以及访问入口时是否被重定向到了登录页或 404 页面。` : n.includes("failed to fetch") || n.includes("networkerror") || n.includes("load failed") || n.includes("loading source code") || n.includes("loading_source_code") ? `${i}入口资源加载失败。请确认子应用服务已启动、入口地址可直接访问,并检查浏览器控制台是否有跨域、404 或网络连接错误。` : n.includes("application died in status not_mounted") ? `${i}加载后挂载失败。请检查子应用是否正确导出了 qiankun 生命周期,并确认挂载容器和路由基座配置正确。` : t;
307
329
  }
308
330
  //#endregion
309
331
  //#region src/main/micro-apps/types.ts
310
- var we = "morningfast:theme-change", Te = !1, Ee = !1;
311
- function De() {
312
- if (Te) {
313
- Oe();
332
+ var ke = "morningfast:theme-change", Ae = !1, je = !1;
333
+ function Me() {
334
+ if (Ae) {
335
+ Ne();
314
336
  return;
315
337
  }
316
- Te = !0;
338
+ Ae = !0;
317
339
  let e = n(t());
318
- e.forEach(fe), k(e.map((e) => ({
340
+ e.forEach(_e), k(e.map((e) => ({
319
341
  name: e.name,
320
342
  entry: e.entry,
321
343
  container: e.container,
322
344
  activeRule: e.activeRule,
323
- props: Ae(e)
345
+ props: Fe(e)
324
346
  })), {
325
347
  beforeLoad: [async (e) => {
326
- ve(window.location.pathname), pe(e.name);
348
+ Ce(window.location.pathname), ve(e.name);
327
349
  }],
328
350
  afterMount: [async (e) => {
329
- ve(window.location.pathname), me(e.name);
351
+ Ce(window.location.pathname), ye(e.name);
330
352
  }]
331
353
  }), O((t) => {
332
- let n = t instanceof ErrorEvent ? t.error || t.message : t, r = ke(n) || ke(t);
333
- if (r && ge(r, n)) {
354
+ let n = t instanceof ErrorEvent ? t.error || t.message : t, r = Pe(n) || Pe(t);
355
+ if (r && xe(r, n)) {
334
356
  let t = e.find((e) => e.name === r);
335
- t && _e(t, window.location.pathname, n);
357
+ t && Se(t, window.location.pathname, n);
336
358
  return;
337
359
  }
338
360
  e.forEach((e) => {
339
- (window.location.pathname === e.activeRule || window.location.pathname.startsWith(`${e.activeRule}/`)) && (he(e, n), _e(e, window.location.pathname, n));
361
+ (window.location.pathname === e.activeRule || window.location.pathname.startsWith(`${e.activeRule}/`)) && (be(e, n), Se(e, window.location.pathname, n));
340
362
  });
341
- }), Oe(), je();
363
+ }), Ne(), Ie();
342
364
  }
343
- function Oe() {
344
- Ee || document.querySelector("#micro-app-container") && (Ee = !0, A({
365
+ function Ne() {
366
+ je || document.querySelector("#micro-app-container") && (je = !0, A({
345
367
  prefetch: !1,
346
368
  sandbox: { experimentalStyleIsolation: !0 },
347
369
  urlRerouteOnly: !0
348
370
  }));
349
371
  }
350
- function ke(e) {
372
+ function Pe(e) {
351
373
  return (e instanceof Error ? e.message : String(e || "")).match(/application ['"]?([^'"\s]+)['"]?/i)?.[1];
352
374
  }
353
- function Ae(e) {
354
- let t = J();
375
+ function Fe(e) {
376
+ let t = q();
355
377
  return {
356
378
  basePath: e.activeRule,
357
379
  app: r(e),
@@ -359,61 +381,61 @@ function Ae(e) {
359
381
  env: "production",
360
382
  apiBaseUrl: "/api"
361
383
  },
362
- theme: Q(t.isDark),
363
- getRuntimeProps: () => ({ theme: Q(t.isDark) })
384
+ theme: Z(t.isDark),
385
+ getRuntimeProps: () => ({ theme: Z(t.isDark) })
364
386
  };
365
387
  }
366
- function je() {
367
- let e = J();
388
+ function Ie() {
389
+ let e = q();
368
390
  C(() => [
369
391
  e.isDark,
370
392
  e.themeColor,
371
393
  e.themeColorPosition
372
394
  ], () => {
373
395
  window.setTimeout(() => {
374
- Me(Q(e.isDark));
396
+ Le(Z(e.isDark));
375
397
  }, 0);
376
398
  });
377
399
  }
378
- function Me(e) {
379
- window.dispatchEvent(new CustomEvent(we, { detail: e }));
400
+ function Le(e) {
401
+ window.dispatchEvent(new CustomEvent(ke, { detail: e }));
380
402
  }
381
- function Q(e) {
403
+ function Z(e) {
382
404
  let t = getComputedStyle(document.documentElement);
383
405
  return {
384
- colorPrimary: $(t, "--el-color-primary", "#409EFF"),
385
- colorPrimaryLight3: $(t, "--el-color-primary-light-3", "#79bbff"),
386
- colorPrimaryLight5: $(t, "--el-color-primary-light-5", "#a0cfff"),
387
- colorPrimaryLight7: $(t, "--el-color-primary-light-7", "#c6e2ff"),
388
- colorPrimaryLight8: $(t, "--el-color-primary-light-8", "#d9ecff"),
389
- colorPrimaryLight9: $(t, "--el-color-primary-light-9", "#ecf5ff"),
390
- colorPrimaryDark2: $(t, "--el-color-primary-dark-2", "#337ecc"),
406
+ colorPrimary: Q(t, "--el-color-primary", "#409EFF"),
407
+ colorPrimaryLight3: Q(t, "--el-color-primary-light-3", "#79bbff"),
408
+ colorPrimaryLight5: Q(t, "--el-color-primary-light-5", "#a0cfff"),
409
+ colorPrimaryLight7: Q(t, "--el-color-primary-light-7", "#c6e2ff"),
410
+ colorPrimaryLight8: Q(t, "--el-color-primary-light-8", "#d9ecff"),
411
+ colorPrimaryLight9: Q(t, "--el-color-primary-light-9", "#ecf5ff"),
412
+ colorPrimaryDark2: Q(t, "--el-color-primary-dark-2", "#337ecc"),
391
413
  mode: e ? "dark" : "light"
392
414
  };
393
415
  }
394
- function $(e, t, n) {
416
+ function Q(e, t, n) {
395
417
  return e.getPropertyValue(t).trim() || n;
396
418
  }
397
419
  //#endregion
398
420
  //#region src/main/pages/micro/MicroAppView.vue?vue&type=script&setup=true&lang.ts
399
- var Ne = { class: "micro-app-page" }, Pe = {
421
+ var Re = { class: "micro-app-page" }, ze = {
400
422
  key: 0,
401
423
  class: "micro-app-page__state micro-app-page__state--error"
402
- }, Fe = { class: "micro-app-page__body" }, Ie = { class: "micro-app-page__meta" }, Le = { key: 0 }, Re = { key: 1 }, ze = { class: "micro-app-page__actions" }, Be = ["id"], Ve = /* @__PURE__ */ e(/* @__PURE__ */ p({
424
+ }, Be = { class: "micro-app-page__body" }, Ve = { class: "micro-app-page__meta" }, He = { key: 0 }, Ue = { key: 1 }, We = { class: "micro-app-page__actions" }, Ge = ["id"], Ke = /* @__PURE__ */ e(/* @__PURE__ */ p({
403
425
  name: "MicroAppView",
404
426
  __name: "MicroAppView",
405
427
  setup(e) {
406
- let t = a(), n = le(), r = y(""), p = null, v = o(() => de(t.path)), T = o(() => {
428
+ let t = a(), n = me(), r = y(""), p = null, v = o(() => ge(t.path)), T = o(() => {
407
429
  let e = v.value;
408
430
  return e ? n[e.name] : void 0;
409
- }), O = o(() => ue(t.path)), k = o(() => T.value?.title || v.value?.title || O.value?.title || "未知子应用"), A = o(() => T.value?.entry || v.value?.entry || O.value?.entry || "-"), j = o(() => "子应用暂时无法访问,请稍后重试。"), M = o(() => T.value?.status === "error" || !!O.value || !!r.value || !v.value);
431
+ }), O = o(() => he(t.path)), k = o(() => T.value?.title || v.value?.title || O.value?.title || "未知子应用"), A = o(() => T.value?.entry || v.value?.entry || O.value?.entry || "-"), j = o(() => "子应用暂时无法访问,请稍后重试。"), M = o(() => T.value?.status === "error" || !!O.value || !!r.value || !v.value);
410
432
  C(() => t.path, () => {
411
433
  m(() => {
412
- De(), N();
434
+ Me(), N();
413
435
  });
414
436
  }, { immediate: !0 }), g(() => {
415
437
  m(() => {
416
- De(), N();
438
+ Me(), N();
417
439
  });
418
440
  }), C(() => T.value?.status, (e) => {
419
441
  e === "mounted" && (P(), r.value = "");
@@ -437,26 +459,26 @@ var Ne = { class: "micro-app-page" }, Pe = {
437
459
  }
438
460
  return (e, t) => {
439
461
  let n = b("el-icon"), r = b("el-button");
440
- return _(), l("div", Ne, [M.value ? (_(), l("div", Pe, [f(n, { class: "micro-app-page__icon" }, {
441
- default: w(() => [f(S(ee))]),
462
+ return _(), l("div", Re, [M.value ? (_(), l("div", ze, [f(n, { class: "micro-app-page__icon" }, {
463
+ default: w(() => [f(S(D))]),
442
464
  _: 1
443
- }), u("div", Fe, [
465
+ }), u("div", Be, [
444
466
  t[5] ||= u("p", { class: "micro-app-page__title" }, "子应用加载失败", -1),
445
- u("dl", Ie, [
467
+ u("dl", Ve, [
446
468
  u("div", null, [t[0] ||= u("dt", null, "应用", -1), u("dd", null, x(k.value), 1)]),
447
- S(!1) ? (_(), l("div", Le, [t[1] ||= u("dt", null, "入口", -1), u("dd", null, x(A.value), 1)])) : c("", !0),
448
- j.value ? (_(), l("div", Re, [t[2] ||= u("dt", null, "原因", -1), u("dd", null, x(j.value), 1)])) : c("", !0)
469
+ S(!1) ? (_(), l("div", He, [t[1] ||= u("dt", null, "入口", -1), u("dd", null, x(A.value), 1)])) : c("", !0),
470
+ j.value ? (_(), l("div", Ue, [t[2] ||= u("dt", null, "原因", -1), u("dd", null, x(j.value), 1)])) : c("", !0)
449
471
  ]),
450
- u("div", ze, [f(r, {
472
+ u("div", We, [f(r, {
451
473
  type: "primary",
452
- icon: S(D),
474
+ icon: S(E),
453
475
  onClick: F
454
476
  }, {
455
477
  default: w(() => [...t[3] ||= [d("重新加载", -1)]]),
456
478
  _: 1
457
479
  }, 8, ["icon"]), S(!1) && (T.value?.entry || v.value?.entry) ? (_(), s(r, {
458
480
  key: 0,
459
- icon: S(E),
481
+ icon: S(ee),
460
482
  onClick: I
461
483
  }, {
462
484
  default: w(() => [...t[4] ||= [d(" 打开入口 ", -1)]]),
@@ -465,16 +487,16 @@ var Ne = { class: "micro-app-page" }, Pe = {
465
487
  ])])) : c("", !0), u("section", {
466
488
  id: S(i),
467
489
  class: "micro-app-page__container"
468
- }, null, 8, Be)]);
490
+ }, null, 8, Ge)]);
469
491
  };
470
492
  }
471
493
  }), [["__scopeId", "data-v-944de23f"]]);
472
494
  //#endregion
473
495
  //#region src/main/router/route-items.ts
474
- function He(e, t) {
475
- return e.map((e) => Ue(e, t));
496
+ function $(e, t) {
497
+ return e.map((e) => qe(e, t));
476
498
  }
477
- function Ue(e, t) {
499
+ function qe(e, t) {
478
500
  let n = {
479
501
  path: e.path,
480
502
  name: e.name,
@@ -485,7 +507,7 @@ function Ue(e, t) {
485
507
  hidden: e.hidden
486
508
  }
487
509
  };
488
- return e.redirect && (n.redirect = e.redirect), e.componentKey && (n.component = t[e.componentKey]), e.microApp && (n.component = Ve), e.children?.length && (n.children = He(e.children, t)), n;
510
+ return e.redirect && (n.redirect = e.redirect), e.componentKey && (n.component = t[e.componentKey]), e.microApp && (n.component = Ke), e.children?.length && (n.children = $(e.children, t)), n;
489
511
  }
490
512
  //#endregion
491
- export { P as a, se as i, Ve as n, J as r, He as t };
513
+ export { P as a, le as i, Ke as n, q as r, $ as t };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { MICRO_AUTH_EXPIRED_EVENT as e } from "./micro-contract.js";
2
- import { a as t, c as n, d as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./chunks/main-CA2I4UGE.js";
2
+ import { a as t, c as n, d as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./chunks/main-BVdwJu-s.js";
3
3
  import { ApiError as f, RequestManager as p, createRequestClient as m, formatErrorMessage as h } from "./request.js";
4
4
  import { a as g, i as _, n as v, r as y, t as b } from "./chunks/auth-C3RvRgcW.js";
5
5
  import { i as x, n as S, r as C, t as w } from "./chunks/system-DZaKDrG6.js";
6
- import { n as T, r as E, t as D } from "./chunks/route-items-CIUjZc6w.js";
6
+ import { n as T, r as E, t as D } from "./chunks/route-items-84k92f3O.js";
7
7
  import { o as O } from "./chunks/config-Cd-9BYBy.js";
8
8
  import { a as k, c as A, d as j, i as M, l as N, n as P, o as F, r as I, s as L, t as R, u as z } from "./chunks/sub-D7y3UaHp.js";
9
9
  export { f as ApiError, F as DEFAULT_SUB_APP_BASE, t as HOME_TAB_PATH, e as MICRO_AUTH_EXPIRED_EVENT, T as MicroAppView, p as RequestManager, L as SUB_APP_NAME, A as SUB_APP_THEME_CHANGE_EVENT, M as applySubAppTheme, l as configureMorningfastRequestClient, n as createApi, v as createMockLoginResult, y as createMockUserProfile, c as createMorningfastBaseRoutes, o as createMorningfastRouter, m as createRequestClient, D as createRoutesFromItems, z as createSubAppContext, k as createSubAppRouter, h as formatErrorMessage, S as getPersistedValue, a as http, u as mountMorningfastApp, I as mountSubApp, _ as normalizeLoginResult, g as normalizeUserProfile, C as removePersistedValue, d as requestManager, N as resolveSubAppBasePath, O as setDefaultAppConfigs, x as setPersistedValue, r as setupAuthExpiredHandler, j as subAppContextKey, E as useAppStore, b as useAuthStore, R as useRequestClient, i as useSortable, P as useSubAppContext, w as useSystemStore, s as useTabsStore };
@@ -2,12 +2,15 @@ import { ThemeColorPosition, ThemeMode } from '../utils/theme';
2
2
  export type LayoutMode = 'default' | 'side' | 'top' | 'mix';
3
3
  export type MenuSearchPlacement = 'header' | 'sidebar';
4
4
  export declare const useAppStore: import('pinia').StoreDefinition<"app", Pick<{
5
+ closeMobileSidebar: () => void;
5
6
  closeSettings: () => void;
6
7
  initializePreferences: () => void;
7
8
  isDark: import('vue').ComputedRef<boolean>;
9
+ isMobileViewport: import('vue').Ref<boolean, boolean>;
8
10
  layoutMode: import('vue').Ref<LayoutMode, LayoutMode>;
9
11
  menuSearchPlacement: import('vue').Ref<MenuSearchPlacement, MenuSearchPlacement>;
10
12
  menuSearchPlacementOptions: import('vue').ComputedRef<MenuSearchPlacement[]>;
13
+ mobileSidebarVisible: import('vue').Ref<boolean, boolean>;
11
14
  openSettings: (tab?: "theme" | "layout" | "shortcut" | "general") => void;
12
15
  isSidebarMenuSearch: import('vue').ComputedRef<boolean>;
13
16
  settingsActiveTab: import('vue').Ref<"theme" | "layout" | "shortcut" | "general", "theme" | "layout" | "shortcut" | "general">;
@@ -28,13 +31,16 @@ export declare const useAppStore: import('pinia').StoreDefinition<"app", Pick<{
28
31
  themeMode: import('vue').Ref<ThemeMode, ThemeMode>;
29
32
  toggleDarkMode: () => void;
30
33
  toggleSidebar: () => void;
31
- }, "layoutMode" | "menuSearchPlacement" | "settingsActiveTab" | "selectedTopMenuPath" | "settingsVisible" | "sidebarCollapsed" | "shortcutTipVisible" | "themeColor" | "themeColorPosition" | "themeMode">, Pick<{
34
+ }, "isMobileViewport" | "layoutMode" | "menuSearchPlacement" | "mobileSidebarVisible" | "settingsActiveTab" | "selectedTopMenuPath" | "settingsVisible" | "sidebarCollapsed" | "shortcutTipVisible" | "themeColor" | "themeColorPosition" | "themeMode">, Pick<{
35
+ closeMobileSidebar: () => void;
32
36
  closeSettings: () => void;
33
37
  initializePreferences: () => void;
34
38
  isDark: import('vue').ComputedRef<boolean>;
39
+ isMobileViewport: import('vue').Ref<boolean, boolean>;
35
40
  layoutMode: import('vue').Ref<LayoutMode, LayoutMode>;
36
41
  menuSearchPlacement: import('vue').Ref<MenuSearchPlacement, MenuSearchPlacement>;
37
42
  menuSearchPlacementOptions: import('vue').ComputedRef<MenuSearchPlacement[]>;
43
+ mobileSidebarVisible: import('vue').Ref<boolean, boolean>;
38
44
  openSettings: (tab?: "theme" | "layout" | "shortcut" | "general") => void;
39
45
  isSidebarMenuSearch: import('vue').ComputedRef<boolean>;
40
46
  settingsActiveTab: import('vue').Ref<"theme" | "layout" | "shortcut" | "general", "theme" | "layout" | "shortcut" | "general">;
@@ -56,12 +62,15 @@ export declare const useAppStore: import('pinia').StoreDefinition<"app", Pick<{
56
62
  toggleDarkMode: () => void;
57
63
  toggleSidebar: () => void;
58
64
  }, "isDark" | "menuSearchPlacementOptions" | "isSidebarMenuSearch">, Pick<{
65
+ closeMobileSidebar: () => void;
59
66
  closeSettings: () => void;
60
67
  initializePreferences: () => void;
61
68
  isDark: import('vue').ComputedRef<boolean>;
69
+ isMobileViewport: import('vue').Ref<boolean, boolean>;
62
70
  layoutMode: import('vue').Ref<LayoutMode, LayoutMode>;
63
71
  menuSearchPlacement: import('vue').Ref<MenuSearchPlacement, MenuSearchPlacement>;
64
72
  menuSearchPlacementOptions: import('vue').ComputedRef<MenuSearchPlacement[]>;
73
+ mobileSidebarVisible: import('vue').Ref<boolean, boolean>;
65
74
  openSettings: (tab?: "theme" | "layout" | "shortcut" | "general") => void;
66
75
  isSidebarMenuSearch: import('vue').ComputedRef<boolean>;
67
76
  settingsActiveTab: import('vue').Ref<"theme" | "layout" | "shortcut" | "general", "theme" | "layout" | "shortcut" | "general">;
@@ -82,4 +91,4 @@ export declare const useAppStore: import('pinia').StoreDefinition<"app", Pick<{
82
91
  themeMode: import('vue').Ref<ThemeMode, ThemeMode>;
83
92
  toggleDarkMode: () => void;
84
93
  toggleSidebar: () => void;
85
- }, "closeSettings" | "initializePreferences" | "openSettings" | "setLayoutMode" | "setMenuSearchPlacement" | "setSelectedTopMenuPath" | "setSettingsVisible" | "setSidebarCollapsed" | "setThemeColor" | "setThemeColorPosition" | "setThemeMode" | "toggleDarkMode" | "toggleSidebar">>;
94
+ }, "closeMobileSidebar" | "closeSettings" | "initializePreferences" | "openSettings" | "setLayoutMode" | "setMenuSearchPlacement" | "setSelectedTopMenuPath" | "setSettingsVisible" | "setSidebarCollapsed" | "setThemeColor" | "setThemeColorPosition" | "setThemeMode" | "toggleDarkMode" | "toggleSidebar">>;
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./chunks/main-CA2I4UGE.js";
1
+ import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./chunks/main-BVdwJu-s.js";
2
2
  import { a as d, i as f, n as p, r as m, t as h } from "./chunks/auth-C3RvRgcW.js";
3
3
  import { i as g, n as _, r as v, t as y } from "./chunks/system-DZaKDrG6.js";
4
- import { n as b, r as x, t as S } from "./chunks/route-items-CIUjZc6w.js";
4
+ import { n as b, r as x, t as S } from "./chunks/route-items-84k92f3O.js";
5
5
  import { o as C } from "./chunks/config-Cd-9BYBy.js";
6
6
  export { e as HOME_TAB_PATH, b as MicroAppView, c as configureMorningfastRequestClient, t as createApi, p as createMockLoginResult, m as createMockUserProfile, s as createMorningfastBaseRoutes, a as createMorningfastRouter, S as createRoutesFromItems, _ as getPersistedValue, i as http, l as mountMorningfastApp, f as normalizeLoginResult, d as normalizeUserProfile, v as removePersistedValue, u as requestManager, C as setDefaultAppConfigs, g as setPersistedValue, n as setupAuthExpiredHandler, x as useAppStore, h as useAuthStore, r as useSortable, y as useSystemStore, o as useTabsStore };
package/dist/sub.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as e } from "./chunks/route-items-CIUjZc6w.js";
1
+ import { t as e } from "./chunks/route-items-84k92f3O.js";
2
2
  import { a as t, c as n, d as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./chunks/sub-D7y3UaHp.js";
3
3
  export { s as DEFAULT_SUB_APP_BASE, l as SUB_APP_NAME, n as SUB_APP_THEME_CHANGE_EVENT, i as applySubAppTheme, e as createRoutesFromItems, d as createSubAppContext, t as createSubAppRouter, c as mountSubApp, a as resolveSubAppBasePath, r as subAppContextKey, u as useRequestClient, o as useSubAppContext };