@morningfast/platform 0.0.7 → 0.0.9
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/assets/main/style.css +6 -3
- package/dist/chunks/{application-config-kHggv6q1.js → application-config-DLHtmY_2.js} +1 -1
- package/dist/chunks/{config-MbLdbbb7.js → config-Cd-9BYBy.js} +12 -16
- package/dist/chunks/{main-B00aDVlh.js → main-DfxJwsLt.js} +31 -52
- package/dist/chunks/route-items-Du868zKV.js +486 -0
- package/dist/index.js +5 -4
- package/dist/main/index.d.ts +4 -0
- package/dist/main/micro-apps/config.d.ts +1 -1
- package/dist/main/router/route-items.d.ts +15 -0
- package/dist/main.js +4 -3
- package/dist/sub/index.d.ts +2 -0
- package/dist/sub.js +3 -2
- package/package.json +1 -1
- package/dist/assets/main.css +0 -1
- package/dist/chunks/MicroAppView-P0ma5ujY.js +0 -253
- package/dist/chunks/app-Cn5iHmfI.js +0 -221
- /package/dist/chunks/{Forbidden-gf6y5Zsh.js → Forbidden-Cu2QQ-FY.js} +0 -0
- /package/dist/chunks/{Login-rBkUOl6l.js → Login-BivuNuD7.js} +0 -0
- /package/dist/chunks/{NotFound-D0ybyfbK.js → NotFound-VRL7_aMx.js} +0 -0
- /package/dist/chunks/{SystemConfig-DxkDxCnC.js → SystemConfig-C7yyDmB8.js} +0 -0
- /package/dist/chunks/{sub-DlD5e1ys.js → sub-D7y3UaHp.js} +0 -0
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./app-Cn5iHmfI.js";
|
|
2
|
-
import { t } from "./_plugin-vue_export-helper-DvRHjpsZ.js";
|
|
3
|
-
import { n, o as r, r as i, t as a } from "./config-MbLdbbb7.js";
|
|
4
|
-
import { useRoute as o } from "vue-router";
|
|
5
|
-
import { computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, nextTick as h, onBeforeUnmount as g, onMounted as _, openBlock as v, reactive as y, ref as b, resolveComponent as x, toDisplayString as S, unref as C, watch as w, withCtx as T } from "vue";
|
|
6
|
-
import { Link as ee, RefreshRight as te, WarningFilled as E } from "@element-plus/icons-vue";
|
|
7
|
-
import { addGlobalUncaughtErrorHandler as D, registerMicroApps as O, start as k } from "qiankun";
|
|
8
|
-
//#region src/main/micro-apps/status.ts
|
|
9
|
-
var A = y({}), j = y({});
|
|
10
|
-
function ne() {
|
|
11
|
-
return A;
|
|
12
|
-
}
|
|
13
|
-
function re(e) {
|
|
14
|
-
return j[e];
|
|
15
|
-
}
|
|
16
|
-
function M(e) {
|
|
17
|
-
return i(n()).find((t) => e === t.activeRule || e.startsWith(`${t.activeRule}/`));
|
|
18
|
-
}
|
|
19
|
-
function N(e) {
|
|
20
|
-
return A[e.name] || (A[e.name] = {
|
|
21
|
-
name: e.name,
|
|
22
|
-
title: e.title,
|
|
23
|
-
entry: e.entry,
|
|
24
|
-
activeRule: e.activeRule,
|
|
25
|
-
status: "idle",
|
|
26
|
-
updatedAt: Date.now()
|
|
27
|
-
}, A[e.name]);
|
|
28
|
-
}
|
|
29
|
-
function P(e) {
|
|
30
|
-
B(e, {
|
|
31
|
-
status: "loading",
|
|
32
|
-
message: void 0
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function F(e) {
|
|
36
|
-
B(e, {
|
|
37
|
-
status: "mounted",
|
|
38
|
-
message: void 0
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function I(e, t) {
|
|
42
|
-
V(e, {
|
|
43
|
-
status: "error",
|
|
44
|
-
message: H(t)
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function L(e, t) {
|
|
48
|
-
let n = A[e];
|
|
49
|
-
return n ? (n.status = "error", n.message = H(t), n.updatedAt = Date.now(), !0) : !1;
|
|
50
|
-
}
|
|
51
|
-
function R(e, t, n) {
|
|
52
|
-
j[t] = {
|
|
53
|
-
path: t,
|
|
54
|
-
name: e.name,
|
|
55
|
-
title: e.title,
|
|
56
|
-
entry: e.entry,
|
|
57
|
-
activeRule: e.activeRule,
|
|
58
|
-
message: H(n),
|
|
59
|
-
updatedAt: Date.now()
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function z(e) {
|
|
63
|
-
delete j[e];
|
|
64
|
-
}
|
|
65
|
-
function B(e, t) {
|
|
66
|
-
let n = A[e];
|
|
67
|
-
n && (n.status = t.status, n.message = t.message, n.updatedAt = Date.now());
|
|
68
|
-
}
|
|
69
|
-
function V(e, t) {
|
|
70
|
-
let n = N(e);
|
|
71
|
-
n.title = e.title, n.entry = e.entry, n.activeRule = e.activeRule, n.status = t.status, n.message = t.message, n.updatedAt = Date.now();
|
|
72
|
-
}
|
|
73
|
-
function H(e) {
|
|
74
|
-
let t = U(e);
|
|
75
|
-
return t ? G(W(t)) : "子应用入口不可访问、服务未启动,或加载过程中发生异常。";
|
|
76
|
-
}
|
|
77
|
-
function U(e) {
|
|
78
|
-
return e instanceof Error ? e.message : typeof e == "string" ? e : "";
|
|
79
|
-
}
|
|
80
|
-
function W(e) {
|
|
81
|
-
return e.trim().replace(/^(application ['"][^'"]+['"] died in status [A-Z_]+:\s*)\1+/, "$1");
|
|
82
|
-
}
|
|
83
|
-
function G(e) {
|
|
84
|
-
let t = e.trim(), n = t.toLowerCase(), r = t.match(/application ['"]([^'"]+)['"]/)?.[1], i = r ? `子应用“${r}”` : "子应用";
|
|
85
|
-
return n.includes("cannot use import statement outside a module") ? `${i}入口已响应,但脚本格式不是 qiankun 当前加载方式可执行的格式。请确认子应用使用 qiankun dev 模式启动,或检查子应用构建配置是否输出 qiankun 需要的入口格式;同时确认主应用配置的入口地址指向子应用 dev server,而不是普通静态文件地址。` : 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;
|
|
86
|
-
}
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region src/main/micro-apps/types.ts
|
|
89
|
-
var K = "morningfast:theme-change", q = !1, J = !1;
|
|
90
|
-
function Y() {
|
|
91
|
-
if (q) {
|
|
92
|
-
X();
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
q = !0;
|
|
96
|
-
let e = i(n());
|
|
97
|
-
e.forEach(N), O(e.map((e) => ({
|
|
98
|
-
name: e.name,
|
|
99
|
-
entry: e.entry,
|
|
100
|
-
container: e.container,
|
|
101
|
-
activeRule: e.activeRule,
|
|
102
|
-
props: ie(e)
|
|
103
|
-
})), {
|
|
104
|
-
beforeLoad: [async (e) => {
|
|
105
|
-
z(window.location.pathname), P(e.name);
|
|
106
|
-
}],
|
|
107
|
-
afterMount: [async (e) => {
|
|
108
|
-
z(window.location.pathname), F(e.name);
|
|
109
|
-
}]
|
|
110
|
-
}), D((t) => {
|
|
111
|
-
let n = t instanceof ErrorEvent ? t.error || t.message : t, r = Z(n) || Z(t);
|
|
112
|
-
if (r && L(r, n)) {
|
|
113
|
-
let t = e.find((e) => e.name === r);
|
|
114
|
-
t && R(t, window.location.pathname, n);
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
e.forEach((e) => {
|
|
118
|
-
(window.location.pathname === e.activeRule || window.location.pathname.startsWith(`${e.activeRule}/`)) && (I(e, n), R(e, window.location.pathname, n));
|
|
119
|
-
});
|
|
120
|
-
}), X(), ae();
|
|
121
|
-
}
|
|
122
|
-
function X() {
|
|
123
|
-
J || document.querySelector("#micro-app-container") && (J = !0, k({
|
|
124
|
-
prefetch: !1,
|
|
125
|
-
sandbox: { experimentalStyleIsolation: !0 },
|
|
126
|
-
urlRerouteOnly: !0
|
|
127
|
-
}));
|
|
128
|
-
}
|
|
129
|
-
function Z(e) {
|
|
130
|
-
return (e instanceof Error ? e.message : String(e || "")).match(/application ['"]?([^'"\s]+)['"]?/i)?.[1];
|
|
131
|
-
}
|
|
132
|
-
function ie(t) {
|
|
133
|
-
let n = e();
|
|
134
|
-
return {
|
|
135
|
-
basePath: t.activeRule,
|
|
136
|
-
app: r(t),
|
|
137
|
-
runtime: {
|
|
138
|
-
env: "production",
|
|
139
|
-
apiBaseUrl: "/api"
|
|
140
|
-
},
|
|
141
|
-
theme: Q(n.isDark),
|
|
142
|
-
getRuntimeProps: () => ({ theme: Q(n.isDark) })
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function ae() {
|
|
146
|
-
let t = e();
|
|
147
|
-
w(() => [
|
|
148
|
-
t.isDark,
|
|
149
|
-
t.themeColor,
|
|
150
|
-
t.themeColorPosition
|
|
151
|
-
], () => {
|
|
152
|
-
window.setTimeout(() => {
|
|
153
|
-
oe(Q(t.isDark));
|
|
154
|
-
}, 0);
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
function oe(e) {
|
|
158
|
-
window.dispatchEvent(new CustomEvent(K, { detail: e }));
|
|
159
|
-
}
|
|
160
|
-
function Q(e) {
|
|
161
|
-
let t = getComputedStyle(document.documentElement);
|
|
162
|
-
return {
|
|
163
|
-
colorPrimary: $(t, "--el-color-primary", "#409EFF"),
|
|
164
|
-
colorPrimaryLight3: $(t, "--el-color-primary-light-3", "#79bbff"),
|
|
165
|
-
colorPrimaryLight5: $(t, "--el-color-primary-light-5", "#a0cfff"),
|
|
166
|
-
colorPrimaryLight7: $(t, "--el-color-primary-light-7", "#c6e2ff"),
|
|
167
|
-
colorPrimaryLight8: $(t, "--el-color-primary-light-8", "#d9ecff"),
|
|
168
|
-
colorPrimaryLight9: $(t, "--el-color-primary-light-9", "#ecf5ff"),
|
|
169
|
-
colorPrimaryDark2: $(t, "--el-color-primary-dark-2", "#337ecc"),
|
|
170
|
-
mode: e ? "dark" : "light"
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
function $(e, t, n) {
|
|
174
|
-
return e.getPropertyValue(t).trim() || n;
|
|
175
|
-
}
|
|
176
|
-
//#endregion
|
|
177
|
-
//#region src/main/pages/micro/MicroAppView.vue?vue&type=script&setup=true&lang.ts
|
|
178
|
-
var se = { class: "micro-app-page" }, ce = {
|
|
179
|
-
key: 0,
|
|
180
|
-
class: "micro-app-page__state micro-app-page__state--error"
|
|
181
|
-
}, le = { class: "micro-app-page__body" }, ue = { class: "micro-app-page__desc" }, de = { class: "micro-app-page__meta" }, fe = { key: 0 }, pe = { key: 1 }, me = { key: 2 }, he = { class: "micro-app-page__actions" }, ge = ["id"], _e = /* @__PURE__ */ t(/* @__PURE__ */ m({
|
|
182
|
-
name: "MicroAppView",
|
|
183
|
-
__name: "MicroAppView",
|
|
184
|
-
setup(e) {
|
|
185
|
-
let t = o(), n = ne(), r = b(""), i = null, m = s(() => M(t.path)), y = s(() => {
|
|
186
|
-
let e = m.value;
|
|
187
|
-
return e ? n[e.name] : void 0;
|
|
188
|
-
}), D = s(() => re(t.path)), O = s(() => y.value?.title || m.value?.title || D.value?.title || "未知子应用"), k = s(() => y.value?.entry || m.value?.entry || D.value?.entry || "-"), A = s(() => y.value?.message ? y.value.message : D.value?.message ? D.value.message : m.value ? "子应用暂时无法访问,请稍后重试。" : "当前路径没有匹配到子应用配置,请检查应用配置里的路由前缀。"), j = s(() => t.path.startsWith("/micro/")), N = s(() => y.value?.status === "error" || !!D.value || !!r.value || j.value && !m.value);
|
|
189
|
-
w(() => t.path, () => {
|
|
190
|
-
h(() => {
|
|
191
|
-
Y(), P();
|
|
192
|
-
});
|
|
193
|
-
}, { immediate: !0 }), _(() => {
|
|
194
|
-
h(() => {
|
|
195
|
-
Y(), P();
|
|
196
|
-
});
|
|
197
|
-
}), w(() => y.value?.status, (e) => {
|
|
198
|
-
e === "mounted" && (F(), r.value = "");
|
|
199
|
-
}), g(() => {
|
|
200
|
-
F();
|
|
201
|
-
});
|
|
202
|
-
function P() {
|
|
203
|
-
F(), r.value = "", !(!j.value || !m.value) && (i = window.setTimeout(() => {
|
|
204
|
-
y.value?.status !== "mounted" && (r.value = "子应用暂时无法访问,请稍后重试。");
|
|
205
|
-
}, 15e3));
|
|
206
|
-
}
|
|
207
|
-
function F() {
|
|
208
|
-
i !== null && (window.clearTimeout(i), i = null);
|
|
209
|
-
}
|
|
210
|
-
function I() {
|
|
211
|
-
window.location.reload();
|
|
212
|
-
}
|
|
213
|
-
function L() {
|
|
214
|
-
let e = k.value;
|
|
215
|
-
e && e !== "-" && window.open(e, "_blank", "noopener,noreferrer");
|
|
216
|
-
}
|
|
217
|
-
return (e, t) => {
|
|
218
|
-
let n = x("el-icon"), i = x("el-button");
|
|
219
|
-
return v(), u("div", se, [N.value ? (v(), u("div", ce, [p(n, { class: "micro-app-page__icon" }, {
|
|
220
|
-
default: T(() => [p(C(E))]),
|
|
221
|
-
_: 1
|
|
222
|
-
}), d("div", le, [
|
|
223
|
-
t[6] ||= d("p", { class: "micro-app-page__title" }, "子应用加载失败", -1),
|
|
224
|
-
d("p", ue, S(A.value), 1),
|
|
225
|
-
d("dl", de, [
|
|
226
|
-
d("div", null, [t[0] ||= d("dt", null, "应用", -1), d("dd", null, S(O.value), 1)]),
|
|
227
|
-
C(!1) ? (v(), u("div", fe, [t[1] ||= d("dt", null, "入口", -1), d("dd", null, S(k.value), 1)])) : l("", !0),
|
|
228
|
-
y.value?.message ? (v(), u("div", pe, [t[2] ||= d("dt", null, "原因", -1), d("dd", null, S(y.value.message), 1)])) : r.value ? (v(), u("div", me, [t[3] ||= d("dt", null, "原因", -1), d("dd", null, S(r.value), 1)])) : l("", !0)
|
|
229
|
-
]),
|
|
230
|
-
d("div", he, [p(i, {
|
|
231
|
-
type: "primary",
|
|
232
|
-
icon: C(te),
|
|
233
|
-
onClick: I
|
|
234
|
-
}, {
|
|
235
|
-
default: T(() => [...t[4] ||= [f("重新加载", -1)]]),
|
|
236
|
-
_: 1
|
|
237
|
-
}, 8, ["icon"]), C(!1) && (y.value?.entry || m.value?.entry) ? (v(), c(i, {
|
|
238
|
-
key: 0,
|
|
239
|
-
icon: C(ee),
|
|
240
|
-
onClick: L
|
|
241
|
-
}, {
|
|
242
|
-
default: T(() => [...t[5] ||= [f(" 打开入口 ", -1)]]),
|
|
243
|
-
_: 1
|
|
244
|
-
}, 8, ["icon"])) : l("", !0)])
|
|
245
|
-
])])) : l("", !0), d("section", {
|
|
246
|
-
id: C(a),
|
|
247
|
-
class: "micro-app-page__container"
|
|
248
|
-
}, null, 8, ge)]);
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
}), [["__scopeId", "data-v-90c11f85"]]);
|
|
252
|
-
//#endregion
|
|
253
|
-
export { _e as default };
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { computed as e, ref as t } from "vue";
|
|
2
|
-
import { defineStore as n } from "pinia";
|
|
3
|
-
//#region src/main/utils/theme.ts
|
|
4
|
-
var r = "theme-color", i = "theme-mode", a = "theme-position", o = [
|
|
5
|
-
{
|
|
6
|
-
label: "默认蓝",
|
|
7
|
-
value: "#409EFF"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
label: "深蓝色",
|
|
11
|
-
value: "#0960BE"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
label: "靛蓝色",
|
|
15
|
-
value: "#045277"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
label: "天空蓝",
|
|
19
|
-
value: "#78B5FE"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
label: "深绿色",
|
|
23
|
-
value: "#0C522B"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
label: "翡翠绿",
|
|
27
|
-
value: "#009773"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
label: "浅绿色",
|
|
31
|
-
value: "#0BD092"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
label: "紫罗兰",
|
|
35
|
-
value: "#7166F0"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
label: "樱花粉",
|
|
39
|
-
value: "#FFB7C5"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
label: "柠檬黄",
|
|
43
|
-
value: "#EFBD48"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
label: "橙黄色",
|
|
47
|
-
value: "#C1420B"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
label: "玫瑰红",
|
|
51
|
-
value: "#BB1B1B"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
label: "锌色灰",
|
|
55
|
-
value: "#3F3F46"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
label: "中性灰",
|
|
59
|
-
value: "#404040"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: "石板灰",
|
|
63
|
-
value: "#344256"
|
|
64
|
-
}
|
|
65
|
-
];
|
|
66
|
-
function s() {
|
|
67
|
-
return localStorage.getItem(r) || "#409EFF";
|
|
68
|
-
}
|
|
69
|
-
function c() {
|
|
70
|
-
let e = localStorage.getItem(i);
|
|
71
|
-
return e === "light" || e === "dark" || e === "system" ? e : "light";
|
|
72
|
-
}
|
|
73
|
-
function l(e) {
|
|
74
|
-
localStorage.setItem(r, e);
|
|
75
|
-
}
|
|
76
|
-
function u(e) {
|
|
77
|
-
localStorage.setItem(i, e);
|
|
78
|
-
}
|
|
79
|
-
function d() {
|
|
80
|
-
let e = localStorage.getItem(a);
|
|
81
|
-
return e === "none" || e === "header" || e === "sidebar" ? e : "none";
|
|
82
|
-
}
|
|
83
|
-
function f(e) {
|
|
84
|
-
localStorage.setItem(a, e);
|
|
85
|
-
}
|
|
86
|
-
function p() {
|
|
87
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
88
|
-
}
|
|
89
|
-
function m(e) {
|
|
90
|
-
return e === "dark" || e === "system" && p();
|
|
91
|
-
}
|
|
92
|
-
function h(e) {
|
|
93
|
-
let t = m(e);
|
|
94
|
-
document.documentElement.classList.toggle("dark", t), document.documentElement.style.colorScheme = t ? "dark" : "light";
|
|
95
|
-
}
|
|
96
|
-
function g(e) {
|
|
97
|
-
let t = document.documentElement, n = t.classList.contains("dark");
|
|
98
|
-
t.style.setProperty("--el-color-primary", e), t.style.setProperty("--el-color-primary-light-3", x(e, n ? "#000000" : "#ffffff", .3)), t.style.setProperty("--el-color-primary-light-5", x(e, n ? "#000000" : "#ffffff", .5)), t.style.setProperty("--el-color-primary-light-7", x(e, n ? "#000000" : "#ffffff", .7)), t.style.setProperty("--el-color-primary-light-8", x(e, n ? "#000000" : "#ffffff", .8)), t.style.setProperty("--el-color-primary-light-9", x(e, n ? "#000000" : "#ffffff", .9)), t.style.setProperty("--el-color-primary-dark-2", x(e, n ? "#ffffff" : "#000000", .2));
|
|
99
|
-
}
|
|
100
|
-
function _() {
|
|
101
|
-
h(c()), g(s()), v(d());
|
|
102
|
-
}
|
|
103
|
-
function v(e) {
|
|
104
|
-
document.documentElement.setAttribute("data-theme-position", e);
|
|
105
|
-
}
|
|
106
|
-
function y(e = 50) {
|
|
107
|
-
return new Promise((t) => {
|
|
108
|
-
setTimeout(() => {
|
|
109
|
-
g(s()), t();
|
|
110
|
-
}, e);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
async function b(e, t) {
|
|
114
|
-
if (!document.startViewTransition) {
|
|
115
|
-
t(), await y();
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
let n = e.clientX, r = e.clientY, i = Math.hypot(Math.max(n, innerWidth - n), Math.max(r, innerHeight - r));
|
|
119
|
-
try {
|
|
120
|
-
document.startViewTransition(() => {
|
|
121
|
-
t();
|
|
122
|
-
}).ready.then(() => {
|
|
123
|
-
let e = 100 * n / innerWidth, t = 100 * r / innerHeight, a = Math.hypot(innerWidth, innerHeight) / Math.SQRT2, o = 100 * i / a, s = [`circle(0% at ${e}% ${t}%)`, `circle(${o}% at ${e}% ${t}%)`], c = document.documentElement.classList.contains("dark");
|
|
124
|
-
document.documentElement.animate({ clipPath: c ? s.reverse() : s }, {
|
|
125
|
-
duration: 400,
|
|
126
|
-
easing: "ease-in",
|
|
127
|
-
fill: "both",
|
|
128
|
-
pseudoElement: c ? "::view-transition-old(root)" : "::view-transition-new(root)"
|
|
129
|
-
});
|
|
130
|
-
}), await y();
|
|
131
|
-
} catch {
|
|
132
|
-
t(), await y();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
function x(e, t, n) {
|
|
136
|
-
let [r, i, a] = S(e), [o, s, c] = S(t), l = (e, t) => Math.round(e * (1 - n) + t * n);
|
|
137
|
-
return `rgb(${l(r, o)}, ${l(i, s)}, ${l(a, c)})`;
|
|
138
|
-
}
|
|
139
|
-
function S(e) {
|
|
140
|
-
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = Number.parseInt(n, 16);
|
|
141
|
-
return [
|
|
142
|
-
r >> 16 & 255,
|
|
143
|
-
r >> 8 & 255,
|
|
144
|
-
r & 255
|
|
145
|
-
];
|
|
146
|
-
}
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region src/main/stores/app.ts
|
|
149
|
-
var C = "sidebar-collapsed", w = "menu-search-placement", T = "layout-mode", E = "top-menu-path", D = n("app", () => {
|
|
150
|
-
let n = t(localStorage.getItem(C) === "true"), r = t(!1), i = t("theme"), a = t(c()), o = t(s()), y = t(d()), b = t(localStorage.getItem(T) || "side"), x = t(localStorage.getItem(w) || "header"), S = t(localStorage.getItem(E) || ""), D = t(!0), O = e(() => m(a.value)), k = e(() => b.value === "top" ? ["header"] : ["header", "sidebar"]), A = e(() => b.value !== "top" && x.value === "sidebar");
|
|
151
|
-
function j() {
|
|
152
|
-
n.value = !n.value;
|
|
153
|
-
}
|
|
154
|
-
function M(e) {
|
|
155
|
-
n.value = e, localStorage.setItem(C, String(n.value));
|
|
156
|
-
}
|
|
157
|
-
function N(e = "theme") {
|
|
158
|
-
i.value = e, r.value = !0;
|
|
159
|
-
}
|
|
160
|
-
function P() {
|
|
161
|
-
r.value = !1;
|
|
162
|
-
}
|
|
163
|
-
function F(e) {
|
|
164
|
-
r.value = e;
|
|
165
|
-
}
|
|
166
|
-
function I(e) {
|
|
167
|
-
a.value = e, u(e), h(e), g(o.value);
|
|
168
|
-
}
|
|
169
|
-
function L() {
|
|
170
|
-
I(p() && a.value === "system" || O.value ? "light" : "dark");
|
|
171
|
-
}
|
|
172
|
-
function R(e) {
|
|
173
|
-
o.value = e, l(e), g(e);
|
|
174
|
-
}
|
|
175
|
-
function z(e) {
|
|
176
|
-
y.value = e, f(e), v(e);
|
|
177
|
-
}
|
|
178
|
-
function B(e) {
|
|
179
|
-
b.value = e, localStorage.setItem(T, e), e === "top" && x.value === "sidebar" && V("header");
|
|
180
|
-
}
|
|
181
|
-
function V(e) {
|
|
182
|
-
let t = b.value === "top" ? "header" : e;
|
|
183
|
-
x.value = t, localStorage.setItem(w, t);
|
|
184
|
-
}
|
|
185
|
-
function H(e) {
|
|
186
|
-
S.value = e, localStorage.setItem(E, e);
|
|
187
|
-
}
|
|
188
|
-
function U() {
|
|
189
|
-
_();
|
|
190
|
-
}
|
|
191
|
-
return {
|
|
192
|
-
closeSettings: P,
|
|
193
|
-
initializePreferences: U,
|
|
194
|
-
isDark: O,
|
|
195
|
-
layoutMode: b,
|
|
196
|
-
menuSearchPlacement: x,
|
|
197
|
-
menuSearchPlacementOptions: k,
|
|
198
|
-
openSettings: N,
|
|
199
|
-
isSidebarMenuSearch: A,
|
|
200
|
-
settingsActiveTab: i,
|
|
201
|
-
selectedTopMenuPath: S,
|
|
202
|
-
setLayoutMode: B,
|
|
203
|
-
setMenuSearchPlacement: V,
|
|
204
|
-
setSelectedTopMenuPath: H,
|
|
205
|
-
setSettingsVisible: F,
|
|
206
|
-
setSidebarCollapsed: M,
|
|
207
|
-
setThemeColor: R,
|
|
208
|
-
setThemeColorPosition: z,
|
|
209
|
-
setThemeMode: I,
|
|
210
|
-
settingsVisible: r,
|
|
211
|
-
sidebarCollapsed: n,
|
|
212
|
-
shortcutTipVisible: D,
|
|
213
|
-
themeColor: o,
|
|
214
|
-
themeColorPosition: y,
|
|
215
|
-
themeMode: a,
|
|
216
|
-
toggleDarkMode: L,
|
|
217
|
-
toggleSidebar: j
|
|
218
|
-
};
|
|
219
|
-
});
|
|
220
|
-
//#endregion
|
|
221
|
-
export { b as n, o as r, D as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|