labull-framework 0.1.32 → 0.1.33
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/magic-block.js +1386 -1317
- package/dist/style.css +1 -1
- package/package.json +67 -67
package/dist/magic-block.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { b as at, c as
|
|
4
|
-
import { s as
|
|
5
|
-
import { u as
|
|
6
|
-
const ft = "__mb",
|
|
1
|
+
import { defineComponent as Le, ref as x, computed as j, watch as Pt, nextTick as on, onMounted as mn, onBeforeUnmount as vn, openBlock as d, createElementBlock as p, normalizeStyle as hn, normalizeClass as K, unref as it, createElementVNode as l, toDisplayString as f, createCommentVNode as k, Fragment as B, renderList as I, withModifiers as Te, getCurrentInstance as hs, createBlock as _s, createTextVNode as $, withDirectives as vt, vModelCheckbox as gs, vModelText as Qt, withKeys as ys, vShow as te } from "vue";
|
|
2
|
+
import { useRouter as _n, useRoute as ks } from "vue-router";
|
|
3
|
+
import { b as at, c as se, A as Be, u as gn } from "./chunk-index-BVIJeFeJ.js";
|
|
4
|
+
import { s as Oc } from "./chunk-index-BVIJeFeJ.js";
|
|
5
|
+
import { u as $s, o as Me, b as yn, _ as kn, d as ws } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-Fky1ghd2.js";
|
|
6
|
+
const ft = "__mb", $n = "call", Ae = "reply", wn = "host-ready", xn = "height", xs = "html, body { overflow: hidden !important; }", Cs = `
|
|
7
7
|
(function () {
|
|
8
8
|
var seq = 0, waiting = {}, queue = [], ready = false, last = -1;
|
|
9
9
|
function call(method, args) {
|
|
@@ -11,7 +11,7 @@ const ft = "__mb", gn = "call", Me = "reply", _n = "host-ready", yn = "height",
|
|
|
11
11
|
function run() {
|
|
12
12
|
var id = ++seq;
|
|
13
13
|
waiting[id] = { resolve: resolve, reject: reject };
|
|
14
|
-
parent.postMessage({ '${ft}': '${
|
|
14
|
+
parent.postMessage({ '${ft}': '${$n}', id: id, method: method, args: args }, '*');
|
|
15
15
|
}
|
|
16
16
|
if (ready) run(); else queue.push(run);
|
|
17
17
|
});
|
|
@@ -19,8 +19,8 @@ const ft = "__mb", gn = "call", Me = "reply", _n = "host-ready", yn = "height",
|
|
|
19
19
|
window.addEventListener('message', function (event) {
|
|
20
20
|
var data = event.data, pending;
|
|
21
21
|
if (!data || data['${ft}'] === undefined) return;
|
|
22
|
-
if (data['${ft}'] === '${
|
|
23
|
-
if (data['${ft}'] !== '${
|
|
22
|
+
if (data['${ft}'] === '${wn}') { ready = true; queue.splice(0).forEach(function (run) { run(); }); return; }
|
|
23
|
+
if (data['${ft}'] !== '${Ae}') return;
|
|
24
24
|
if (!(pending = waiting[data.id])) return;
|
|
25
25
|
delete waiting[data.id];
|
|
26
26
|
if (data.ok) pending.resolve(data.value); else pending.reject(new Error(data.error || '调用失败'));
|
|
@@ -61,7 +61,7 @@ const ft = "__mb", gn = "call", Me = "reply", _n = "host-ready", yn = "height",
|
|
|
61
61
|
if (height > 0) height += 1;
|
|
62
62
|
if (height === last) return; /* 一样高就不再发:否则「宿主改高度 → 触发观察 → 又发一次」会转个不停 */
|
|
63
63
|
last = height;
|
|
64
|
-
parent.postMessage({ '${ft}': '${
|
|
64
|
+
parent.postMessage({ '${ft}': '${xn}', height: height }, '*');
|
|
65
65
|
}
|
|
66
66
|
function start() {
|
|
67
67
|
report();
|
|
@@ -70,380 +70,380 @@ const ft = "__mb", gn = "call", Me = "reply", _n = "host-ready", yn = "height",
|
|
|
70
70
|
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();
|
|
71
71
|
setInterval(report, 500);
|
|
72
72
|
})();
|
|
73
|
-
`,
|
|
74
|
-
function
|
|
73
|
+
`, Es = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/;
|
|
74
|
+
function Cn(o) {
|
|
75
75
|
const s = typeof window > "u" ? "http://localhost" : window.location.href;
|
|
76
|
-
return new URL(`${
|
|
76
|
+
return new URL(`${Be}${o}`, s);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Ss() {
|
|
79
79
|
try {
|
|
80
|
-
return
|
|
80
|
+
return Cn("").origin;
|
|
81
81
|
} catch {
|
|
82
82
|
return typeof window > "u" ? "" : window.location.origin;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
async function
|
|
86
|
-
if (
|
|
87
|
-
const i =
|
|
88
|
-
if (i.origin !==
|
|
89
|
-
const m =
|
|
85
|
+
async function Ts(o, s, a) {
|
|
86
|
+
if (!Es.test(s)) throw new Error(`路由名不合法:${s}(要写成 类名.方法名,例如 Customer.create)`);
|
|
87
|
+
const i = Cn(`/bx/${o}/${s}`), c = Ss();
|
|
88
|
+
if (i.origin !== c) throw new Error(`后端地址必须是本应用的(${c}):${i.origin}`);
|
|
89
|
+
const m = a instanceof Blob ? a : null, b = await fetch(i.toString(), {
|
|
90
90
|
method: "POST",
|
|
91
91
|
credentials: "include",
|
|
92
92
|
// 带上 HttpOnly 会话 cookie;authHeaders('POST') 给 CSRF 头(缺了 403)
|
|
93
|
-
headers: m ? { "Content-Type": m.type || "application/octet-stream", ...
|
|
94
|
-
body: m ?? JSON.stringify(
|
|
95
|
-
}),
|
|
96
|
-
if (
|
|
97
|
-
if (!
|
|
93
|
+
headers: m ? { "Content-Type": m.type || "application/octet-stream", ...se("POST") } : { "Content-Type": "application/json", ...se("POST") },
|
|
94
|
+
body: m ?? JSON.stringify(a ?? {})
|
|
95
|
+
}), r = await b.text().catch(() => "");
|
|
96
|
+
if (b.ok) {
|
|
97
|
+
if (!r) return null;
|
|
98
98
|
try {
|
|
99
|
-
return JSON.parse(
|
|
99
|
+
return JSON.parse(r);
|
|
100
100
|
} catch {
|
|
101
|
-
return
|
|
101
|
+
return r;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
let h =
|
|
104
|
+
let h = r;
|
|
105
105
|
try {
|
|
106
|
-
const v = JSON.parse(
|
|
106
|
+
const v = JSON.parse(r);
|
|
107
107
|
typeof v?.message == "string" && (h = v.message);
|
|
108
108
|
} catch {
|
|
109
|
-
h =
|
|
109
|
+
h = r;
|
|
110
110
|
}
|
|
111
|
-
throw new Error(h ? `${s} 调用失败:${h.slice(0, 300)}` : `${s} 调用失败(${
|
|
111
|
+
throw new Error(h ? `${s} 调用失败:${h.slice(0, 300)}` : `${s} 调用失败(${b.status})`);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
const
|
|
113
|
+
function Bs(o, s) {
|
|
114
|
+
const a = (b) => {
|
|
115
115
|
try {
|
|
116
|
-
o.contentWindow?.postMessage(
|
|
117
|
-
} catch (
|
|
118
|
-
console.warn("[magic-block] 有一条宿主消息没能发给块(协议继续走):",
|
|
116
|
+
o.contentWindow?.postMessage(b, "*");
|
|
117
|
+
} catch (r) {
|
|
118
|
+
console.warn("[magic-block] 有一条宿主消息没能发给块(协议继续走):", r);
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
|
-
async function i(
|
|
122
|
-
if (
|
|
123
|
-
if (
|
|
124
|
-
const h = typeof
|
|
121
|
+
async function i(b, r) {
|
|
122
|
+
if (b === "getMe") return await at("/auth/me");
|
|
123
|
+
if (b === "navigateTab") {
|
|
124
|
+
const h = typeof r[0] == "string" ? r[0].trim() : "";
|
|
125
125
|
if (!h || !s.onNavigateTab) throw new Error(`跳不了 ${h || "(空地址)"}:这个页面没有把宿主接到路由上`);
|
|
126
126
|
return await s.onNavigateTab(h);
|
|
127
127
|
}
|
|
128
|
-
if (
|
|
129
|
-
if (
|
|
130
|
-
const h = typeof
|
|
128
|
+
if (b === "context") return s.context ? s.context() : {};
|
|
129
|
+
if (b === "setTabTitle") {
|
|
130
|
+
const h = typeof r[0] == "string" ? r[0].trim() : "", v = typeof r[1] == "string" ? r[1].trim() : "";
|
|
131
131
|
if (!h) throw new Error("setTabTitle 要给一个非空的名字");
|
|
132
132
|
return s.onTabTitle?.(h, v || void 0), !0;
|
|
133
133
|
}
|
|
134
|
-
if (
|
|
135
|
-
const h = typeof
|
|
134
|
+
if (b === "backend") {
|
|
135
|
+
const h = typeof r[0] == "string" ? r[0].trim() : "", v = r[1];
|
|
136
136
|
if (!h) throw new Error("后端调用的路由名是空的:要写成 magicBackendApi.类名.方法名(参数)");
|
|
137
137
|
if (!v || typeof v != "object" || Array.isArray(v)) throw new Error(`magicBackendApi.${h}(params) 的参数要么是一个对象,要么是一个文件(File / Blob)`);
|
|
138
|
-
return await
|
|
138
|
+
return await Ts(s.uuid, h, v);
|
|
139
139
|
}
|
|
140
|
-
throw new Error(`不认识的方法:${String(
|
|
140
|
+
throw new Error(`不认识的方法:${String(b)}(这块桥只有 getMe / navigateTab / context / setTabTitle / backend 五个)`);
|
|
141
141
|
}
|
|
142
|
-
const
|
|
143
|
-
if (
|
|
144
|
-
const
|
|
145
|
-
if (!
|
|
146
|
-
if (
|
|
147
|
-
const v = typeof
|
|
142
|
+
const c = (b) => {
|
|
143
|
+
if (b.source !== o.contentWindow) return;
|
|
144
|
+
const r = b.data;
|
|
145
|
+
if (!r) return;
|
|
146
|
+
if (r[ft] === xn) {
|
|
147
|
+
const v = typeof r.height == "number" ? r.height : NaN;
|
|
148
148
|
Number.isFinite(v) && v > 0 && s.onHeight?.(v);
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
|
-
if (
|
|
152
|
-
const h =
|
|
151
|
+
if (r[ft] !== $n) return;
|
|
152
|
+
const h = r.id;
|
|
153
153
|
(async () => {
|
|
154
154
|
try {
|
|
155
|
-
|
|
155
|
+
a({ [ft]: Ae, id: h, ok: !0, value: await i(String(r.method), r.args ?? []) });
|
|
156
156
|
} catch (v) {
|
|
157
|
-
|
|
157
|
+
a({ [ft]: Ae, id: h, ok: !1, error: v instanceof Error ? v.message : String(v) });
|
|
158
158
|
}
|
|
159
159
|
})();
|
|
160
160
|
};
|
|
161
|
-
window.addEventListener("message",
|
|
162
|
-
const m = () =>
|
|
161
|
+
window.addEventListener("message", c);
|
|
162
|
+
const m = () => a({ [ft]: wn });
|
|
163
163
|
return m(), o.addEventListener("load", m), () => {
|
|
164
|
-
window.removeEventListener("message",
|
|
164
|
+
window.removeEventListener("message", c), o.removeEventListener("load", m);
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
|
-
const Ht = "index.open.html",
|
|
168
|
-
function
|
|
169
|
-
return String(o ?? "").split("/").some((s) => s.startsWith(
|
|
167
|
+
const Ht = "index.open.html", ke = "magic-block.open.yaml", $e = ["id", "module", "name", "brief", "detail"], ln = ["id", "module", "name", "brief"], Ie = 40, Ms = /^(?![A-Za-z]:)(?!\/)[A-Za-z0-9._\-/]+$/, As = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, Os = /^[a-z][a-z0-9]*$/, Rs = /^[A-Za-z_][A-Za-z0-9_]*$/, Ps = /^([|>])([-+]?)$/, js = "_";
|
|
168
|
+
function an(o) {
|
|
169
|
+
return String(o ?? "").split("/").some((s) => s.startsWith(js));
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
return o.length > 0 && o.length <=
|
|
171
|
+
function Ls(o) {
|
|
172
|
+
return o.length > 0 && o.length <= Ie && !/[\u0000-\u001f\u007f]/.test(o);
|
|
173
173
|
}
|
|
174
|
-
const
|
|
174
|
+
const Is = {
|
|
175
175
|
id: "块的 uuid,必须与页面里挂载它时写死的那个 uuid 逐字一致",
|
|
176
176
|
module: "模块名(小写字母与数字,必须以字母开头),例如 home",
|
|
177
|
-
name: `可读名:可以用中文,不超过 ${
|
|
177
|
+
name: `可读名:可以用中文,不超过 ${Ie} 个字符`,
|
|
178
178
|
brief: "一句话说明这个块解决什么问题",
|
|
179
179
|
// 可选键:这一句不会出现在"缺少 xxx"的报文里(它不在 MANIFEST_REQUIRED 里),
|
|
180
180
|
// 留着是为了让这份 Map 与 MANIFEST_KEYS 一一对上(少一个键 `tsc` 就会报)。
|
|
181
181
|
detail: "业务功能说明(可选,建议都写):这个块在业务上解决什么、谁怎么用、输入输出是什么业务含义、有什么前提与边界;**用 Markdown 写**(多行用 `detail: |` 块标量),**别写**路由 / 字段 / 实现方式"
|
|
182
182
|
};
|
|
183
|
-
function
|
|
183
|
+
function cn(o) {
|
|
184
184
|
const s = Object.keys(o);
|
|
185
185
|
return s.length > 0 ? `现在包里有:${s.join(" / ")}` : "现在这个包是空的";
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function Ds(o) {
|
|
188
188
|
let s = "";
|
|
189
|
-
for (let
|
|
190
|
-
const i = o[
|
|
189
|
+
for (let a = 0; a < o.length; a += 1) {
|
|
190
|
+
const i = o[a];
|
|
191
191
|
if (s)
|
|
192
192
|
i === s && (s = "");
|
|
193
193
|
else if (i === '"' || i === "'") s = i;
|
|
194
|
-
else if (i === "#") return o.slice(0,
|
|
194
|
+
else if (i === "#") return o.slice(0, a);
|
|
195
195
|
}
|
|
196
196
|
return o;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Ns(o) {
|
|
199
199
|
let s = "";
|
|
200
|
-
for (let
|
|
201
|
-
const i = o[
|
|
200
|
+
for (let a = 0; a < o.length; a += 1) {
|
|
201
|
+
const i = o[a];
|
|
202
202
|
if (s)
|
|
203
203
|
i === s && (s = "");
|
|
204
204
|
else if (i === '"' || i === "'") s = i;
|
|
205
|
-
else if (i === ":") return
|
|
205
|
+
else if (i === ":") return a;
|
|
206
206
|
}
|
|
207
207
|
return -1;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Fs(o) {
|
|
210
210
|
return !o || o[0] !== '"' && o[0] !== "'" ? o : o.length >= 2 && o[o.length - 1] === o[0] ? o.slice(1, -1).trim() : o;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function Us(o) {
|
|
213
213
|
const s = [...o];
|
|
214
214
|
for (; s.length > 0 && !s[0].trim(); ) s.shift();
|
|
215
215
|
for (; s.length > 0 && !s[s.length - 1].trim(); ) s.pop();
|
|
216
|
-
const
|
|
217
|
-
return s.map((
|
|
216
|
+
const a = s.filter((c) => c.trim()).map((c) => c.length - c.trimStart().length), i = a.length > 0 ? Math.min(...a) : 0;
|
|
217
|
+
return s.map((c) => c.trim() ? c.slice(i) : "").join(`
|
|
218
218
|
`);
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
const s = [],
|
|
220
|
+
function zs(o) {
|
|
221
|
+
const s = [], a = {}, i = {}, c = o.split(/\r?\n/);
|
|
222
222
|
let m = 0;
|
|
223
|
-
for (; m <
|
|
224
|
-
const
|
|
223
|
+
for (; m < c.length; ) {
|
|
224
|
+
const b = c[m], r = m + 1;
|
|
225
225
|
m += 1;
|
|
226
|
-
const h =
|
|
226
|
+
const h = Ds(b).trim();
|
|
227
227
|
if (!h) continue;
|
|
228
228
|
if (h.startsWith("-")) {
|
|
229
|
-
s.push(`第 ${
|
|
229
|
+
s.push(`第 ${r} 行是列表写法(${h}):清单只认「键: 值」,每个键各占一行 —— 例如 name: 客户档案(长文本用 detail: | 起一个块,块里想写几行就写几行)`);
|
|
230
230
|
continue;
|
|
231
231
|
}
|
|
232
|
-
const v =
|
|
232
|
+
const v = Ns(h);
|
|
233
233
|
if (v < 0) {
|
|
234
|
-
s.push(`第 ${
|
|
234
|
+
s.push(`第 ${r} 行不是「键: 值」(${h}):清单只认「键: 值」与 # 注释 —— 要么删掉这一行,要么照 name: 客户档案 写(长文本用 detail: | 起一个块,块的正文是**缩进**的几行)`);
|
|
235
235
|
continue;
|
|
236
236
|
}
|
|
237
|
-
const
|
|
238
|
-
if (!
|
|
239
|
-
s.push(`第 ${
|
|
237
|
+
const g = h.slice(0, v).trim();
|
|
238
|
+
if (!Rs.test(g)) {
|
|
239
|
+
s.push(`第 ${r} 行的键名不合法(${g}):键名只许字母或下划线开头,认得的键只有 ${$e.join(" / ")}`);
|
|
240
240
|
continue;
|
|
241
241
|
}
|
|
242
|
-
if (
|
|
242
|
+
if (!$e.includes(g)) {
|
|
243
243
|
s.push(
|
|
244
|
-
`第 ${
|
|
244
|
+
`第 ${r} 行的键不认识(${g}):清单只有 ${$e.join(" / ")} 这几个键(其中 ${ln.join(" / ")} 必填,detail 可以不写)`
|
|
245
245
|
);
|
|
246
246
|
continue;
|
|
247
247
|
}
|
|
248
|
-
if (
|
|
249
|
-
s.push(`第 ${
|
|
248
|
+
if (g in i) {
|
|
249
|
+
s.push(`第 ${r} 行重复写了 ${g}(第 ${i[g]} 行已经写过):一个键只许出现一次`);
|
|
250
250
|
continue;
|
|
251
251
|
}
|
|
252
|
-
i[
|
|
253
|
-
const
|
|
252
|
+
i[g] = r;
|
|
253
|
+
const _ = h.slice(v + 1).trim(), y = Ps.exec(_);
|
|
254
254
|
if (y) {
|
|
255
|
-
const
|
|
256
|
-
for (; m <
|
|
257
|
-
const C =
|
|
255
|
+
const S = [];
|
|
256
|
+
for (; m < c.length; ) {
|
|
257
|
+
const C = c[m];
|
|
258
258
|
if (C.trim() && !/^\s/.test(C)) break;
|
|
259
|
-
|
|
259
|
+
S.push(C), m += 1;
|
|
260
260
|
}
|
|
261
|
-
let A =
|
|
261
|
+
let A = Us(S);
|
|
262
262
|
y[1] === ">" && (A = A.split(`
|
|
263
|
-
`).map((C) => C.trim()).filter(Boolean).join(" ")),
|
|
263
|
+
`).map((C) => C.trim()).filter(Boolean).join(" ")), a[g] = A;
|
|
264
264
|
continue;
|
|
265
265
|
}
|
|
266
|
-
|
|
266
|
+
a[g] = Fs(_);
|
|
267
267
|
}
|
|
268
|
-
for (const
|
|
269
|
-
const
|
|
270
|
-
if (
|
|
271
|
-
s.push(`清单里缺少 ${
|
|
268
|
+
for (const b of ln) {
|
|
269
|
+
const r = a[b] ?? "";
|
|
270
|
+
if (r === "") {
|
|
271
|
+
s.push(`清单里缺少 ${b}(或者是空的):${Is[b]}`);
|
|
272
272
|
continue;
|
|
273
273
|
}
|
|
274
|
-
|
|
275
|
-
`清单里的 module 不合法:${
|
|
276
|
-
) :
|
|
274
|
+
b === "id" && !As.test(r) ? s.push(`清单里的 id 不是 uuid:${r} —— 要 8-4-4-4-12 那种十六进制`) : b === "module" && !Os.test(r) ? s.push(
|
|
275
|
+
`清单里的 module 不合法:${r} —— 它同时是 Django 的 app label,所以只许小写字母与数字、必须以字母开头(不能有横线与下划线),例如 home / orders`
|
|
276
|
+
) : b === "name" && !Ls(r) && s.push(`清单里的 name 不合法:${r} —— 不能超过 ${Ie} 个字符、不能含控制字符(中文可以)`);
|
|
277
277
|
}
|
|
278
|
-
return [
|
|
278
|
+
return [a, s];
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function Hs(o) {
|
|
281
|
+
return Ms.test(o) && !o.split("/").includes("..");
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
const s = [],
|
|
285
|
-
|
|
286
|
-
const i = o[
|
|
287
|
-
let
|
|
283
|
+
function Ks(o) {
|
|
284
|
+
const s = [], a = o[Ht];
|
|
285
|
+
a === void 0 ? s.push(`包里缺入口:必须有 ${Ht}(${cn(o)})`) : a.trim() || s.push(`${Ht} 不能是空文件`);
|
|
286
|
+
const i = o[ke];
|
|
287
|
+
let c = {};
|
|
288
288
|
if (i === void 0)
|
|
289
|
-
s.push(`包里缺清单:必须有 ${
|
|
289
|
+
s.push(`包里缺清单:必须有 ${ke}(${cn(o)})`);
|
|
290
290
|
else if (!i.trim())
|
|
291
|
-
s.push(`${
|
|
291
|
+
s.push(`${ke} 不能是空文件`);
|
|
292
292
|
else {
|
|
293
|
-
const [m,
|
|
294
|
-
|
|
293
|
+
const [m, b] = zs(i);
|
|
294
|
+
c = m, s.push(...b);
|
|
295
295
|
}
|
|
296
296
|
for (const m of Object.keys(o))
|
|
297
|
-
|
|
298
|
-
return { manifest:
|
|
297
|
+
Hs(m) || s.push(`文件名不合法:${m}(只许字母数字与 . _ - /,且不许 .. 与绝对路径)`);
|
|
298
|
+
return { manifest: c, issues: s };
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function qs(o) {
|
|
301
301
|
const s = [];
|
|
302
302
|
if (o.length === 0)
|
|
303
303
|
return s.push("一个块都没勾:请在「读回改动」的结果里勾上要保存的块"), { selected: 0, issues: s };
|
|
304
|
-
for (const
|
|
305
|
-
const i =
|
|
306
|
-
for (const
|
|
304
|
+
for (const a of o) {
|
|
305
|
+
const i = a.name?.trim() || "(没有名字的块)";
|
|
306
|
+
for (const c of Ks(a.files ?? {}).issues) s.push(`${i}:${c}`);
|
|
307
307
|
}
|
|
308
308
|
return { selected: o.length, issues: s };
|
|
309
309
|
}
|
|
310
|
-
const
|
|
311
|
-
function
|
|
312
|
-
if (
|
|
313
|
-
const
|
|
314
|
-
if (
|
|
315
|
-
const i =
|
|
316
|
-
return i ? Object.keys(s).find((
|
|
317
|
-
}
|
|
318
|
-
const
|
|
319
|
-
function
|
|
320
|
-
return `${
|
|
321
|
-
}
|
|
322
|
-
const
|
|
323
|
-
function
|
|
324
|
-
const
|
|
325
|
-
return { html: o.replace(
|
|
326
|
-
const
|
|
327
|
-
return
|
|
328
|
-
${
|
|
310
|
+
const Vs = "backend_open.py", Js = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
311
|
+
function un(o, s) {
|
|
312
|
+
if (Js.test(o)) return;
|
|
313
|
+
const a = (o.split(/[?#]/)[0] ?? "").replace(/^\.\//, "").replace(/^\/+/, "");
|
|
314
|
+
if (a in s) return an(a) ? void 0 : a;
|
|
315
|
+
const i = a.split("/").pop() ?? "";
|
|
316
|
+
return i ? Object.keys(s).find((c) => !an(c) && (c.split("/").pop() ?? "") === i) : void 0;
|
|
317
|
+
}
|
|
318
|
+
const En = "\0mb:";
|
|
319
|
+
function Ws(o) {
|
|
320
|
+
return `${En}${o}\0`;
|
|
321
|
+
}
|
|
322
|
+
const Gs = /<script\b([^>]*?)\bsrc\s*=\s*(["'])(.*?)\2([^>]*)>\s*<\/script\s*>/gi, Ys = /<link\b([^>]*?)\bhref\s*=\s*(["'])(.*?)\2([^>]*?)\/?>/gi;
|
|
323
|
+
function Zs(o, s) {
|
|
324
|
+
const a = [], i = (b) => (a.push(b), Ws(a.length - 1));
|
|
325
|
+
return { html: o.replace(Gs, (b, r, h, v, g) => {
|
|
326
|
+
const _ = un(v, s);
|
|
327
|
+
return _ === void 0 ? b : i(`<script${r}${g}>
|
|
328
|
+
${Sn(s[_] ?? "")}
|
|
329
329
|
<\/script>`);
|
|
330
|
-
}).replace(
|
|
331
|
-
if (!/\brel\s*=\s*(?:"|')?stylesheet/i.test(`${
|
|
332
|
-
const
|
|
333
|
-
return
|
|
334
|
-
${s[
|
|
330
|
+
}).replace(Ys, (b, r, h, v, g) => {
|
|
331
|
+
if (!/\brel\s*=\s*(?:"|')?stylesheet/i.test(`${r}${g}`)) return b;
|
|
332
|
+
const _ = un(v, s);
|
|
333
|
+
return _ === void 0 ? b : i(`<style>
|
|
334
|
+
${s[_]}
|
|
335
335
|
</style>`);
|
|
336
|
-
}), slots:
|
|
336
|
+
}), slots: a };
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Sn(o) {
|
|
339
339
|
return o.replace(/<\/(script)/gi, "<\\/$1");
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
const
|
|
343
|
-
return
|
|
341
|
+
function Tn(o, s) {
|
|
342
|
+
const a = /<\/head\s*>/i.exec(o);
|
|
343
|
+
return a ? `${o.slice(0, a.index)}${s}${o.slice(a.index)}` : `${s}${o}`;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
return s ?
|
|
347
|
-
${
|
|
345
|
+
function Xs(o, s) {
|
|
346
|
+
return s ? Tn(o, `<script>
|
|
347
|
+
${Sn(s)}
|
|
348
348
|
<\/script>
|
|
349
349
|
`) : o;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
return s ?
|
|
351
|
+
function rn(o, s) {
|
|
352
|
+
return s ? Tn(o, `<style data-magic-block="host">
|
|
353
353
|
${s}
|
|
354
354
|
</style>
|
|
355
355
|
`) : o;
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
const
|
|
357
|
+
function Qs(o, s = {}) {
|
|
358
|
+
const a = s.bootstrap ?? "", i = s.css ?? "", c = s.themeCss ?? "", m = o[Ht];
|
|
359
359
|
if (m === void 0) return "";
|
|
360
|
-
const { html:
|
|
360
|
+
const { html: b, slots: r } = Zs(m, o), h = Xs(rn(rn(b, c), i), a), v = h.split(En);
|
|
361
361
|
if (v.length === 1) return h;
|
|
362
|
-
let
|
|
363
|
-
for (let
|
|
364
|
-
const y = v[
|
|
365
|
-
|
|
362
|
+
let g = v[0] ?? "";
|
|
363
|
+
for (let _ = 1; _ < v.length; _ += 1) {
|
|
364
|
+
const y = v[_] ?? "", S = y.indexOf("\0"), A = Number(y.slice(0, S));
|
|
365
|
+
g += (r[A] ?? "") + y.slice(S + 1);
|
|
366
366
|
}
|
|
367
|
-
return
|
|
367
|
+
return g;
|
|
368
368
|
}
|
|
369
369
|
const zt = /* @__PURE__ */ new Map();
|
|
370
370
|
let jt = null;
|
|
371
|
-
const
|
|
372
|
-
function
|
|
373
|
-
return
|
|
374
|
-
|
|
371
|
+
const Oe = /* @__PURE__ */ new Set();
|
|
372
|
+
function to(o) {
|
|
373
|
+
return Oe.add(o), () => {
|
|
374
|
+
Oe.delete(o);
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function eo() {
|
|
378
378
|
zt.clear(), jt = null;
|
|
379
|
-
for (const o of
|
|
379
|
+
for (const o of Oe) o();
|
|
380
380
|
}
|
|
381
|
-
async function
|
|
381
|
+
async function no(o) {
|
|
382
382
|
const s = [...new Set(o)].filter(Boolean);
|
|
383
|
-
if (s.some((
|
|
383
|
+
if (s.some((a) => !zt.has(a))) {
|
|
384
384
|
jt && await jt.catch(() => {
|
|
385
385
|
});
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
for (const
|
|
386
|
+
const a = s.filter((i) => !zt.has(i));
|
|
387
|
+
a.length > 0 && (jt = at(`/magic-blocks/render?ids=${a.map(encodeURIComponent).join(",")}`).then((i) => {
|
|
388
|
+
for (const c of i) c?.id && zt.set(c.id, c);
|
|
389
389
|
return i;
|
|
390
390
|
}).catch(() => []).finally(() => {
|
|
391
391
|
jt = null;
|
|
392
392
|
}), await jt.catch(() => {
|
|
393
393
|
}));
|
|
394
394
|
}
|
|
395
|
-
return s.map((
|
|
395
|
+
return s.map((a) => zt.get(a)).filter((a) => !!a);
|
|
396
396
|
}
|
|
397
|
-
const Bt = "labull.css",
|
|
398
|
-
function
|
|
399
|
-
const
|
|
400
|
-
if (/@font-face|@keyframes/i.test(
|
|
397
|
+
const Bt = "labull.css", ne = "CONTROLS.lock.html";
|
|
398
|
+
function so(o, s) {
|
|
399
|
+
const a = String(s || "");
|
|
400
|
+
if (/@font-face|@keyframes/i.test(a)) return !0;
|
|
401
401
|
const i = String(o || "");
|
|
402
|
-
return /(^|[\s,>+~])(\.p-|\.pi(?![a-z])|\.pi-|\.labull-|:root|html(?![a-z-])|body(?![a-z-])|\*|:where\()/.test(i) ? !0 : /--(?:sp|surface|primary|text-color|content|highlight|focus-ring|p-)/.test(
|
|
402
|
+
return /(^|[\s,>+~])(\.p-|\.pi(?![a-z])|\.pi-|\.labull-|:root|html(?![a-z-])|body(?![a-z-])|\*|:where\()/.test(i) ? !0 : /--(?:sp|surface|primary|text-color|content|highlight|focus-ring|p-)/.test(a);
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function Bn(o, s, a) {
|
|
405
405
|
for (let i = 0; i < o.length; i += 1) {
|
|
406
|
-
const
|
|
407
|
-
if (
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
406
|
+
const c = o[i], m = String(c.cssText || ""), b = String(c.selectorText || "");
|
|
407
|
+
if (c.cssRules && c.cssRules.length > 0) {
|
|
408
|
+
const r = [];
|
|
409
|
+
if (Bn(c.cssRules, r, a), r.length === 0) continue;
|
|
410
410
|
const h = m.slice(0, m.indexOf("{")).trim();
|
|
411
411
|
s.push(`${h} {
|
|
412
|
-
${
|
|
412
|
+
${r.map((v) => " " + v).join(`
|
|
413
413
|
`)}
|
|
414
414
|
}`);
|
|
415
415
|
continue;
|
|
416
416
|
}
|
|
417
|
-
|
|
417
|
+
so(b, m) && (s.push(m), a.n += 1);
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
const o = [], s = [],
|
|
420
|
+
function Mn() {
|
|
421
|
+
const o = [], s = [], a = { n: 0 };
|
|
422
422
|
let i = 0;
|
|
423
|
-
const
|
|
424
|
-
for (const
|
|
425
|
-
const
|
|
423
|
+
const c = typeof document > "u" ? [] : Array.from(document.styleSheets);
|
|
424
|
+
for (const b of c) {
|
|
425
|
+
const r = b.href || "(内联 <style>)";
|
|
426
426
|
let h = null;
|
|
427
427
|
try {
|
|
428
|
-
h =
|
|
428
|
+
h = b.cssRules;
|
|
429
429
|
} catch {
|
|
430
|
-
s.push(
|
|
430
|
+
s.push(r);
|
|
431
431
|
continue;
|
|
432
432
|
}
|
|
433
433
|
if (!h || h.length === 0) continue;
|
|
434
434
|
const v = [];
|
|
435
|
-
|
|
435
|
+
Bn(h, v, a), v.length !== 0 && (i += 1, o.push(`/* ── ${r} ── */`, ...v));
|
|
436
436
|
}
|
|
437
437
|
return { css: [
|
|
438
438
|
"/* 生成物:每次导出都会重写,别手改。",
|
|
439
439
|
" *",
|
|
440
440
|
" * 这是这个应用此刻真正在用的 **labull 主题 + 控件样式**(token / PrimeVue 控件 / 结构类 / 图标)。",
|
|
441
|
-
` * 收自 ${i} 张样式表、${
|
|
441
|
+
` * 收自 ${i} 张样式表、${a.n} 条规则。`,
|
|
442
442
|
s.length > 0 ? ` * ⚠️ 有 ${s.length} 张样式表读不到规则(跨源,浏览器不让读):${s.join(" / ")} —— 需要的话手动补一份。` : " * (没有读不到的样式表:收全了。)",
|
|
443
443
|
" *",
|
|
444
444
|
" * 怎么用(块里):**什么都不用加** —— 宿主会把这一份注入每个块的 iframe(`MagicBlockHost` 的 `theme` prop),",
|
|
445
445
|
' * 所以直接写类名就行:`<button class="p-button">` / `<input class="p-inputtext">` / `<span class="p-tag">`。',
|
|
446
|
-
" * 这一份放在开发包里是给你**查 / 对照 / 抄**用的(`" +
|
|
446
|
+
" * 这一份放在开发包里是给你**查 / 对照 / 抄**用的(`" + ne + "` 里的每一块 markup 都能直接用)。",
|
|
447
447
|
" * ⚠️ 别把它当块包文件塞进块里:它 500 KB 上下,而且宿主已经注入了一份(重复只会更慢)。",
|
|
448
448
|
" * ⚠️ 块里**只有 CSS,没有 JS 组件**:下拉 / 日期 / 弹窗那些要装了 PrimeVue 才有行为,",
|
|
449
449
|
" * 这里能用的是类名(按钮、输入框、标签、面板、表格、图标)。",
|
|
@@ -452,17 +452,17 @@ function Sn() {
|
|
|
452
452
|
].join(`
|
|
453
453
|
`) + o.join(`
|
|
454
454
|
`) + `
|
|
455
|
-
`, sheets: i, skipped: s, rules:
|
|
455
|
+
`, sheets: i, skipped: s, rules: a.n };
|
|
456
456
|
}
|
|
457
|
-
function
|
|
458
|
-
const o = '<button class="p-button" type="button">主要按钮</button>', s = (
|
|
457
|
+
function oo() {
|
|
458
|
+
const o = '<button class="p-button" type="button">主要按钮</button>', s = (b, r, h) => ` <li class="labull-step${b ? ` ${b}` : ""}">
|
|
459
459
|
<span class="labull-step-node"></span>
|
|
460
|
-
<span class="labull-step-label">${
|
|
460
|
+
<span class="labull-step-label">${r}</span>
|
|
461
461
|
<span class="labull-step-desc">${h}</span>
|
|
462
|
-
</li>`,
|
|
463
|
-
` +
|
|
462
|
+
</li>`, a = (b, r = "") => `<ol class="labull-steps${r ? ` ${r}` : ""}">
|
|
463
|
+
` + b.map(([h, v, g]) => s(h, v, g)).join(`
|
|
464
464
|
`) + `
|
|
465
|
-
</ol>`, i =
|
|
465
|
+
</ol>`, i = a([
|
|
466
466
|
["is-done", "草稿", "需求已创建"],
|
|
467
467
|
["is-current", "待审批", "等管理员审批"],
|
|
468
468
|
["", "审批通过", "待处理"],
|
|
@@ -486,19 +486,19 @@ function to() {
|
|
|
486
486
|
/* 🔴 流程链条:**纯 CSS**(没有 JS),状态加在 `<li>` 上;桌面横向、手机自动转纵向。
|
|
487
487
|
* 三行分别是:默认那条链 / 强制纵向那个参数 / 四个状态各长什么样。 */
|
|
488
488
|
["流程链条(工作流步骤条):桌面横向、手机自动纵向;节点空着会自动编号,已完成自动显示 ✓", i],
|
|
489
|
-
["流程链条 · 参数 <code>labull-steps--vertical</code>(强制纵向:手机那一套,侧栏那种窄容器也用它)",
|
|
489
|
+
["流程链条 · 参数 <code>labull-steps--vertical</code>(强制纵向:手机那一套,侧栏那种窄容器也用它)", a([
|
|
490
490
|
["is-done", "草稿", "需求已创建"],
|
|
491
491
|
["is-current", "待审批", "等管理员审批"],
|
|
492
492
|
["", "审批通过", "待处理"],
|
|
493
493
|
["", "开发完成", "待处理"],
|
|
494
494
|
["", "验收完成", "待处理"]
|
|
495
495
|
], "labull-steps--vertical")],
|
|
496
|
-
["流程链条 · 参数 <code>labull-steps--horizontal</code>(强制横向:在手机上也横着排;⚠️ 手机上只适合 2-4 步,5 步以上用默认或 --vertical)",
|
|
496
|
+
["流程链条 · 参数 <code>labull-steps--horizontal</code>(强制横向:在手机上也横着排;⚠️ 手机上只适合 2-4 步,5 步以上用默认或 --vertical)", a([
|
|
497
497
|
["is-done", "提交", "10-05"],
|
|
498
498
|
["is-current", "审批", "进行中"],
|
|
499
499
|
["", "完成", "待处理"]
|
|
500
500
|
], "labull-steps--horizontal")],
|
|
501
|
-
["流程链条 · 状态:<code>is-done</code> / <code>is-current</code> / 不写(待处理)/ <code>is-danger</code>(退回 · 终止)",
|
|
501
|
+
["流程链条 · 状态:<code>is-done</code> / <code>is-current</code> / 不写(待处理)/ <code>is-danger</code>(退回 · 终止)", a([
|
|
502
502
|
["is-done", "已修复", "张三 10-05"],
|
|
503
503
|
["is-current", "待验收", "等提出人确认"],
|
|
504
504
|
["is-danger", "被退回", "原因:信息不全"],
|
|
@@ -506,10 +506,10 @@ function to() {
|
|
|
506
506
|
])],
|
|
507
507
|
["表格", "<table><thead><tr><th>列 A</th><th>列 B</th></tr></thead><tbody><tr><td>值</td><td>值</td></tr></tbody></table>"]
|
|
508
508
|
].map(
|
|
509
|
-
([
|
|
510
|
-
<h3>${
|
|
511
|
-
<div class="demo">${
|
|
512
|
-
<pre>${
|
|
509
|
+
([b, r]) => ` <section>
|
|
510
|
+
<h3>${b}</h3>
|
|
511
|
+
<div class="demo">${r}</div>
|
|
512
|
+
<pre>${r.replace(/&/g, "&").replace(/</g, "<")}</pre>
|
|
513
513
|
</section>`
|
|
514
514
|
).join(`
|
|
515
515
|
`);
|
|
@@ -549,60 +549,60 @@ ${m}
|
|
|
549
549
|
</html>
|
|
550
550
|
`;
|
|
551
551
|
}
|
|
552
|
-
const Mt = /* @__PURE__ */ new Map(),
|
|
553
|
-
let
|
|
554
|
-
function
|
|
555
|
-
for (const o of
|
|
552
|
+
const Mt = /* @__PURE__ */ new Map(), Re = /* @__PURE__ */ new Set(), lo = 4e3;
|
|
553
|
+
let Pe = "", ee = null;
|
|
554
|
+
function dn() {
|
|
555
|
+
for (const o of Re) o();
|
|
556
556
|
}
|
|
557
|
-
function
|
|
558
|
-
return
|
|
559
|
-
|
|
557
|
+
function ao(o) {
|
|
558
|
+
return Re.add(o), () => {
|
|
559
|
+
Re.delete(o);
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
function
|
|
563
|
-
return
|
|
562
|
+
function we() {
|
|
563
|
+
return Pe;
|
|
564
564
|
}
|
|
565
|
-
function
|
|
566
|
-
const
|
|
567
|
-
if (!
|
|
565
|
+
function io(o, s) {
|
|
566
|
+
const a = String(o || "").trim(), i = String(s || "").trim();
|
|
567
|
+
if (!a || !i) return () => {
|
|
568
568
|
};
|
|
569
|
-
let
|
|
570
|
-
return
|
|
571
|
-
const m = Mt.get(
|
|
572
|
-
m && (m.delete(i), m.size === 0 && Mt.delete(
|
|
569
|
+
let c = Mt.get(a);
|
|
570
|
+
return c || (c = /* @__PURE__ */ new Set(), Mt.set(a, c)), c.add(i), () => {
|
|
571
|
+
const m = Mt.get(a);
|
|
572
|
+
m && (m.delete(i), m.size === 0 && Mt.delete(a));
|
|
573
573
|
};
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function je(o, s, a) {
|
|
576
576
|
const i = Mt.get(String(o || ""));
|
|
577
577
|
if (!i) return null;
|
|
578
|
-
for (const
|
|
579
|
-
if (
|
|
580
|
-
return
|
|
578
|
+
for (const c of i)
|
|
579
|
+
if (c !== s && !(a && !a(c)))
|
|
580
|
+
return c;
|
|
581
581
|
return null;
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function co(o) {
|
|
584
584
|
return [...Mt.get(String(o || "")) ?? []];
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function uo(o, s, a) {
|
|
587
587
|
const i = Mt.get(String(o || ""));
|
|
588
|
-
return !i || i.size === 0 || i.has(s) ? null :
|
|
588
|
+
return !i || i.size === 0 || i.has(s) ? null : je(o, s, a);
|
|
589
589
|
}
|
|
590
|
-
function
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
}, Math.max(1, s)),
|
|
590
|
+
function An(o, s = lo) {
|
|
591
|
+
Pe = String(o || ""), ee !== null && clearTimeout(ee), ee = setTimeout(() => {
|
|
592
|
+
ee = null, Pe = "", dn();
|
|
593
|
+
}, Math.max(1, s)), dn();
|
|
594
594
|
}
|
|
595
|
-
const
|
|
595
|
+
const ro = ["data-magic-block", "data-magic-module"], po = ["srcdoc", "title"], fo = { class: "mb__state" }, bo = { class: "mb__brief" }, mo = {
|
|
596
596
|
key: 0,
|
|
597
597
|
class: "mb__reason"
|
|
598
|
-
},
|
|
598
|
+
}, vo = {
|
|
599
599
|
key: 1,
|
|
600
600
|
class: "mb__issues"
|
|
601
|
-
},
|
|
601
|
+
}, ho = {
|
|
602
602
|
key: 2,
|
|
603
603
|
class: "mb__ring",
|
|
604
604
|
"aria-hidden": "true"
|
|
605
|
-
},
|
|
605
|
+
}, _o = ["title", "aria-label"], go = ["title", "aria-label"], yo = ["title", "aria-label"], ko = ["title", "aria-label"], $o = /* @__PURE__ */ Le({
|
|
606
606
|
__name: "MagicBlockHost",
|
|
607
607
|
props: {
|
|
608
608
|
uuid: {},
|
|
@@ -611,19 +611,19 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
|
|
|
611
611
|
theme: { type: Boolean, default: !0 }
|
|
612
612
|
},
|
|
613
613
|
setup(o) {
|
|
614
|
-
const s = o,
|
|
615
|
-
let
|
|
616
|
-
const P = j(() => s.name.trim() || s.uuid), U = j(() =>
|
|
614
|
+
const s = o, a = $s(), i = _n(), { isStaff: c } = gn(), m = x(null), b = x(null), r = x(null), h = x(!1), v = x(0), g = x(0);
|
|
615
|
+
let _ = null, y = null, S = null, A = null, C = null, O = null;
|
|
616
|
+
const P = j(() => s.name.trim() || s.uuid), U = j(() => r.value?.state ?? ""), Z = j(() => U.value === "invalid" ? "校验不通过" : U.value === "draft" ? "未开发" : P.value), X = j(() => (r.value?.brief ?? "").trim() || (r.value?.name ?? "").trim() || P.value), yt = j(() => (r.value?.reason ?? "").trim()), kt = j(() => r.value?.issues ?? []), E = j(() => Math.max(g.value, v.value, 1)), It = j(() => ({ height: `${E.value}px` })), ct = j(() => {
|
|
617
617
|
const w = {};
|
|
618
|
-
for (const [T,
|
|
618
|
+
for (const [T, D] of Object.entries(r.value?.files ?? {})) T !== Vs && (w[T] = D);
|
|
619
619
|
return w;
|
|
620
|
-
}), $t = j(() => U.value === "ok" && typeof
|
|
620
|
+
}), $t = j(() => U.value === "ok" && typeof ct.value[Ht] == "string");
|
|
621
621
|
let st = null;
|
|
622
622
|
function q() {
|
|
623
623
|
if (!s.theme) return "";
|
|
624
624
|
if (st !== null || (st = "", typeof document > "u")) return st;
|
|
625
625
|
try {
|
|
626
|
-
st =
|
|
626
|
+
st = Mn().css;
|
|
627
627
|
} catch {
|
|
628
628
|
st = "";
|
|
629
629
|
}
|
|
@@ -631,24 +631,24 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
|
|
|
631
631
|
}
|
|
632
632
|
const z = j(() => {
|
|
633
633
|
if (!$t.value) return "";
|
|
634
|
-
const w = { bootstrap:
|
|
635
|
-
return T && (w.themeCss = T),
|
|
634
|
+
const w = { bootstrap: Cs, css: xs }, T = q();
|
|
635
|
+
return T && (w.themeCss = T), Qs(ct.value, w);
|
|
636
636
|
});
|
|
637
637
|
function Q() {
|
|
638
|
-
return { key:
|
|
638
|
+
return { key: a.key, path: a.path, params: a.params, query: a.query };
|
|
639
639
|
}
|
|
640
640
|
async function wt(w) {
|
|
641
641
|
const T = i.resolve(w);
|
|
642
642
|
if (T.matched.length === 0) {
|
|
643
|
-
const
|
|
644
|
-
throw new Error(`这个应用里没有页面 ${w}。能跳的页面只有:${
|
|
643
|
+
const D = i.getRoutes().map((rt) => rt.path);
|
|
644
|
+
throw new Error(`这个应用里没有页面 ${w}。能跳的页面只有:${D.length > 0 ? D.join(" / ") : "(还没有配路由)"}`);
|
|
645
645
|
}
|
|
646
|
-
return
|
|
646
|
+
return Me(w) || T.fullPath;
|
|
647
647
|
}
|
|
648
648
|
function bt() {
|
|
649
|
-
|
|
650
|
-
const w =
|
|
651
|
-
w && (
|
|
649
|
+
S?.(), S = null;
|
|
650
|
+
const w = b.value;
|
|
651
|
+
w && (S = Bs(w, {
|
|
652
652
|
uuid: s.uuid,
|
|
653
653
|
onHeight: (T) => {
|
|
654
654
|
v.value = T;
|
|
@@ -657,30 +657,30 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
|
|
|
657
657
|
context: Q,
|
|
658
658
|
/* 🔴 块给**自己所属那条标签**起名:整页就是一个块时(`MagicBlockPage`),标签栏上那条
|
|
659
659
|
* 默认只有路由的 `meta.title`("订单详情"),而"订单 SO-42"只有块自己知道。 */
|
|
660
|
-
onTabTitle: (T,
|
|
660
|
+
onTabTitle: (T, D) => a.setTitle(T, D)
|
|
661
661
|
}));
|
|
662
662
|
}
|
|
663
663
|
async function xt() {
|
|
664
|
-
const w = s.uuid, T = await
|
|
665
|
-
w === s.uuid && (
|
|
664
|
+
const w = s.uuid, T = await no([w]);
|
|
665
|
+
w === s.uuid && (r.value = T.find((D) => D.id === w) ?? null);
|
|
666
666
|
}
|
|
667
667
|
function Kt() {
|
|
668
668
|
window.dispatchEvent(new CustomEvent("magic-block:open-console", { detail: { uuid: s.uuid } }));
|
|
669
669
|
}
|
|
670
670
|
function qt(w = !1) {
|
|
671
|
-
w && C?.(), C =
|
|
671
|
+
w && C?.(), C = io(s.uuid, a.key);
|
|
672
672
|
}
|
|
673
|
-
const tt = (w) => !
|
|
674
|
-
if (!
|
|
675
|
-
const w =
|
|
673
|
+
const tt = (w) => !yn(w, i), V = j(() => {
|
|
674
|
+
if (!c.value) return "";
|
|
675
|
+
const w = je(s.uuid, a.key, tt);
|
|
676
676
|
return w ? `管理员:切到还挂着这个块的标签 ${w}(点一下这一块会亮红框)` : "管理员:这个块只在这一条标签里挂着 —— 点一下会亮几秒红框";
|
|
677
677
|
});
|
|
678
678
|
function R() {
|
|
679
|
-
if (!
|
|
680
|
-
const w =
|
|
681
|
-
|
|
679
|
+
if (!c.value) return;
|
|
680
|
+
const w = je(s.uuid, a.key, tt);
|
|
681
|
+
An(s.uuid), w && Me(w);
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function ut(w) {
|
|
684
684
|
let T = w.parentElement;
|
|
685
685
|
for (; T; ) {
|
|
686
686
|
if (getComputedStyle(T).overflowY !== "visible" && T.clientHeight > 0) return T;
|
|
@@ -691,172 +691,172 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
|
|
|
691
691
|
function G() {
|
|
692
692
|
const w = m.value;
|
|
693
693
|
if (!w) return 0;
|
|
694
|
-
const T =
|
|
695
|
-
return Math.max(0, Math.floor(
|
|
694
|
+
const T = ut(w), D = getComputedStyle(T), rt = parseFloat(D.paddingTop) || 0, Dt = parseFloat(D.paddingBottom) || 0, H = parseFloat(D.borderTopWidth) || 0, Nt = T === document.documentElement, le = Nt ? Math.max(0, window.innerHeight - rt - Dt) : Math.max(0, T.clientHeight - rt - Dt), ae = Nt ? rt : T.getBoundingClientRect().top + H + rt, ie = Nt ? window.scrollY || 0 : T.scrollTop, J = w.getBoundingClientRect().top - ae + ie;
|
|
695
|
+
return Math.max(0, Math.floor(le - J));
|
|
696
696
|
}
|
|
697
697
|
function Y() {
|
|
698
|
-
if (!
|
|
698
|
+
if (!a.active.value || !m.value) return;
|
|
699
699
|
const w = G();
|
|
700
|
-
w > 0 && Math.abs(w -
|
|
700
|
+
w > 0 && Math.abs(w - g.value) > 1 && (g.value = w);
|
|
701
701
|
}
|
|
702
702
|
function ot() {
|
|
703
703
|
if (!m.value) return;
|
|
704
|
-
const w =
|
|
705
|
-
|
|
704
|
+
const w = ut(m.value);
|
|
705
|
+
_ !== w && (_ = w, y?.disconnect(), y = null), Y(), !(y || typeof ResizeObserver > "u") && (y = new ResizeObserver(() => Y()), y.observe(w));
|
|
706
706
|
}
|
|
707
|
-
return Pt(
|
|
708
|
-
v.value = 0,
|
|
707
|
+
return Pt(b, () => bt()), Pt(z, () => {
|
|
708
|
+
v.value = 0, g.value = 0, ot();
|
|
709
709
|
}, { flush: "post" }), Pt(() => s.uuid, () => {
|
|
710
|
-
|
|
711
|
-
}), Pt(() =>
|
|
712
|
-
w &&
|
|
710
|
+
on().then(() => ot());
|
|
711
|
+
}), Pt(() => a.active.value, (w) => {
|
|
712
|
+
w && on().then(() => {
|
|
713
713
|
ot();
|
|
714
714
|
const T = m.value;
|
|
715
715
|
!T || !T.isConnected || T.offsetParent === null || h.value && T.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
716
716
|
});
|
|
717
717
|
}), Pt(() => s.uuid, () => {
|
|
718
|
-
v.value = 0,
|
|
719
|
-
}),
|
|
720
|
-
A =
|
|
721
|
-
h.value =
|
|
722
|
-
}), h.value =
|
|
723
|
-
}),
|
|
724
|
-
y?.disconnect(), y = null, A?.(), A = null, O?.(), O = null, C?.(), C = null,
|
|
718
|
+
v.value = 0, r.value = null, qt(!0), h.value = we() === s.uuid, xt();
|
|
719
|
+
}), mn(() => {
|
|
720
|
+
A = to(() => void xt()), O = ao(() => {
|
|
721
|
+
h.value = we() === s.uuid;
|
|
722
|
+
}), h.value = we() === s.uuid, qt(), ot(), xt();
|
|
723
|
+
}), vn(() => {
|
|
724
|
+
y?.disconnect(), y = null, A?.(), A = null, O?.(), O = null, C?.(), C = null, S?.(), S = null;
|
|
725
725
|
}), (w, T) => (d(), p("div", {
|
|
726
726
|
ref_key: "el",
|
|
727
727
|
ref: m,
|
|
728
|
-
class: K(["mb", { "mb--admin": it(
|
|
729
|
-
style:
|
|
728
|
+
class: K(["mb", { "mb--admin": it(c), "mb--lit": it(c) && h.value }]),
|
|
729
|
+
style: hn(It.value),
|
|
730
730
|
"data-magic-block": o.uuid,
|
|
731
731
|
"data-magic-module": o.module
|
|
732
732
|
}, [
|
|
733
733
|
$t.value ? (d(), p("iframe", {
|
|
734
734
|
key: 0,
|
|
735
735
|
ref_key: "frame",
|
|
736
|
-
ref:
|
|
736
|
+
ref: b,
|
|
737
737
|
class: "mb__frame",
|
|
738
738
|
srcdoc: z.value,
|
|
739
739
|
title: P.value,
|
|
740
740
|
scrolling: "no",
|
|
741
741
|
sandbox: "allow-scripts allow-forms allow-modals allow-popups allow-downloads"
|
|
742
|
-
}, null, 8,
|
|
742
|
+
}, null, 8, po)) : (d(), p("div", {
|
|
743
743
|
key: 1,
|
|
744
744
|
class: K(["mb__empty", { "mb__empty--off": U.value === "invalid", "mb__empty--draft": U.value === "draft" }]),
|
|
745
745
|
onClick: R
|
|
746
746
|
}, [
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
U.value === "invalid" && yt.value ? (d(), p("p",
|
|
750
|
-
U.value === "invalid" && kt.value.length > 0 ? (d(), p("ul",
|
|
751
|
-
(d(!0), p(
|
|
747
|
+
l("p", fo, f(Z.value), 1),
|
|
748
|
+
l("p", bo, f(X.value), 1),
|
|
749
|
+
U.value === "invalid" && yt.value ? (d(), p("p", mo, f(yt.value), 1)) : k("", !0),
|
|
750
|
+
U.value === "invalid" && kt.value.length > 0 ? (d(), p("ul", vo, [
|
|
751
|
+
(d(!0), p(B, null, I(kt.value, (D, rt) => (d(), p("li", {
|
|
752
752
|
key: rt,
|
|
753
753
|
class: "mb__issue"
|
|
754
|
-
},
|
|
754
|
+
}, f(D.message), 1))), 128))
|
|
755
755
|
])) : k("", !0),
|
|
756
|
-
|
|
756
|
+
l("button", {
|
|
757
757
|
class: "mb__go",
|
|
758
758
|
type: "button",
|
|
759
|
-
onClick:
|
|
759
|
+
onClick: Te(Kt, ["stop"])
|
|
760
760
|
}, "去控制台")
|
|
761
761
|
], 2)),
|
|
762
|
-
it(
|
|
763
|
-
it(
|
|
764
|
-
|
|
762
|
+
it(c) ? (d(), p("span", ho)) : k("", !0),
|
|
763
|
+
it(c) && $t.value ? (d(), p(B, { key: 3 }, [
|
|
764
|
+
l("button", {
|
|
765
765
|
class: "mb__grab mb__grab--top",
|
|
766
766
|
type: "button",
|
|
767
767
|
title: V.value,
|
|
768
768
|
"aria-label": V.value,
|
|
769
769
|
onClick: R
|
|
770
|
-
}, null, 8,
|
|
771
|
-
|
|
770
|
+
}, null, 8, _o),
|
|
771
|
+
l("button", {
|
|
772
772
|
class: "mb__grab mb__grab--right",
|
|
773
773
|
type: "button",
|
|
774
774
|
title: V.value,
|
|
775
775
|
"aria-label": V.value,
|
|
776
776
|
onClick: R
|
|
777
|
-
}, null, 8,
|
|
778
|
-
|
|
777
|
+
}, null, 8, go),
|
|
778
|
+
l("button", {
|
|
779
779
|
class: "mb__grab mb__grab--bottom",
|
|
780
780
|
type: "button",
|
|
781
781
|
title: V.value,
|
|
782
782
|
"aria-label": V.value,
|
|
783
783
|
onClick: R
|
|
784
|
-
}, null, 8,
|
|
785
|
-
|
|
784
|
+
}, null, 8, yo),
|
|
785
|
+
l("button", {
|
|
786
786
|
class: "mb__grab mb__grab--left",
|
|
787
787
|
type: "button",
|
|
788
788
|
title: V.value,
|
|
789
789
|
"aria-label": V.value,
|
|
790
790
|
onClick: R
|
|
791
|
-
}, null, 8,
|
|
791
|
+
}, null, 8, ko)
|
|
792
792
|
], 64)) : k("", !0)
|
|
793
|
-
], 14,
|
|
793
|
+
], 14, ro));
|
|
794
794
|
}
|
|
795
|
-
}),
|
|
795
|
+
}), wo = /* @__PURE__ */ kn($o, [["__scopeId", "data-v-8e1e849f"]]);
|
|
796
796
|
function ht(o) {
|
|
797
797
|
return typeof o == "string" ? o.trim() : "";
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function On(o) {
|
|
800
800
|
const s = ht(o?.meta?.blockUuid);
|
|
801
801
|
if (s) return s;
|
|
802
|
-
const
|
|
803
|
-
if (!
|
|
804
|
-
const i =
|
|
802
|
+
const a = o?.props;
|
|
803
|
+
if (!a || typeof a != "object" || Array.isArray(a)) return "";
|
|
804
|
+
const i = a.default;
|
|
805
805
|
return !i || typeof i != "object" || Array.isArray(i) ? "" : ht(i.uuid);
|
|
806
806
|
}
|
|
807
|
-
function
|
|
808
|
-
const
|
|
809
|
-
for (const
|
|
810
|
-
if (!
|
|
811
|
-
const m =
|
|
807
|
+
function xo(o, s) {
|
|
808
|
+
const a = [], i = /* @__PURE__ */ new Set();
|
|
809
|
+
for (const c of o ?? []) {
|
|
810
|
+
if (!c || c.redirect || c.components?.default !== s) continue;
|
|
811
|
+
const m = On(c);
|
|
812
812
|
if (!m || i.has(m)) continue;
|
|
813
813
|
i.add(m);
|
|
814
|
-
const
|
|
815
|
-
|
|
814
|
+
const b = ht(c.path), r = ht(c.meta?.title) || ht(c.meta?.sub) || b;
|
|
815
|
+
a.push({ uuid: m, path: b, title: r, module: ht(c.meta?.module), brief: ht(c.meta?.brief) });
|
|
816
816
|
}
|
|
817
|
-
return
|
|
817
|
+
return a;
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function Co(o, s, a) {
|
|
820
820
|
const i = /* @__PURE__ */ new Set();
|
|
821
|
-
for (const
|
|
822
|
-
return
|
|
821
|
+
for (const c of a ?? []) i.add(ht(c));
|
|
822
|
+
return xo(o, s).filter((c) => !i.has(c.uuid));
|
|
823
823
|
}
|
|
824
|
-
const
|
|
825
|
-
function
|
|
826
|
-
return typeof o == "object" && o !== null && o[
|
|
824
|
+
const Rn = "__labullBlockPage";
|
|
825
|
+
function Eo(o) {
|
|
826
|
+
return typeof o == "object" && o !== null && o[Rn] === !0;
|
|
827
827
|
}
|
|
828
|
-
const
|
|
829
|
-
function
|
|
830
|
-
const
|
|
831
|
-
return
|
|
828
|
+
const pn = '块标签里的东西(标题 / 按钮 / 参数展示 / 第二块区域)全部写进块自己的 index.open.html:页面这一层只回答"哪条地址是哪个块"。';
|
|
829
|
+
function So(o, s) {
|
|
830
|
+
const a = o?.components?.default;
|
|
831
|
+
return a == null ? !1 : Eo(a) ? !0 : s != null && a === s;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
834
|
-
const
|
|
835
|
-
if (!o || o.length === 0) return
|
|
836
|
-
const i = o[o.length - 1],
|
|
837
|
-
if (o.findIndex((
|
|
838
|
-
return
|
|
833
|
+
function To(o, s) {
|
|
834
|
+
const a = [];
|
|
835
|
+
if (!o || o.length === 0) return a;
|
|
836
|
+
const i = o[o.length - 1], c = ht(i?.path);
|
|
837
|
+
if (o.findIndex((r) => So(r, s)) !== o.length - 1)
|
|
838
|
+
return a.push({
|
|
839
839
|
code: "wrapped",
|
|
840
|
-
path:
|
|
841
|
-
message: `这条路由(${
|
|
842
|
-
}),
|
|
843
|
-
o.length > 1 &&
|
|
840
|
+
path: c,
|
|
841
|
+
message: `这条路由(${c || "拿不到路径"})渲染的不是块页本身:块页被包在别的组件里(包装页 / 渲染函数),或者被当成了某一层的布局。${pn}`
|
|
842
|
+
}), a;
|
|
843
|
+
o.length > 1 && a.push({
|
|
844
844
|
code: "nested",
|
|
845
|
-
path:
|
|
846
|
-
message: `块路由(${
|
|
845
|
+
path: c,
|
|
846
|
+
message: `块路由(${c})挂在别的路由下面:父级 template 里除了 <RouterView> 还有别的东西。块路由必须是顶层那一条。`
|
|
847
847
|
});
|
|
848
|
-
const
|
|
849
|
-
return
|
|
848
|
+
const b = Object.keys(i?.components ?? {}).filter((r) => r !== "default");
|
|
849
|
+
return b.length > 0 && a.push({
|
|
850
850
|
code: "extra-views",
|
|
851
|
-
path:
|
|
852
|
-
message: `这条路由(${
|
|
853
|
-
}),
|
|
851
|
+
path: c,
|
|
852
|
+
message: `这条路由(${c})除了默认视图还挂了具名视图(${b.join(" / ")})—— 那正是"在块旁边摆第二块内容"。${pn}`
|
|
853
|
+
}), On(i) || a.push({
|
|
854
854
|
code: "no-uuid",
|
|
855
|
-
path:
|
|
856
|
-
message: `这条路由(${
|
|
857
|
-
}),
|
|
855
|
+
path: c,
|
|
856
|
+
message: `这条路由(${c})挂了块页却没说这是哪个块:写 meta.blockUuid(推荐)或 props: { uuid },否则这一页渲染出来是"未开发"。`
|
|
857
|
+
}), a;
|
|
858
858
|
}
|
|
859
|
-
const
|
|
859
|
+
const Pn = /* @__PURE__ */ Le({
|
|
860
860
|
__name: "MagicBlockPage",
|
|
861
861
|
props: {
|
|
862
862
|
uuid: { default: "" },
|
|
@@ -865,16 +865,16 @@ const Mn = /* @__PURE__ */ je({
|
|
|
865
865
|
theme: { type: Boolean, default: !0 }
|
|
866
866
|
},
|
|
867
867
|
setup(o) {
|
|
868
|
-
const s = o,
|
|
869
|
-
const
|
|
870
|
-
return typeof
|
|
871
|
-
}),
|
|
868
|
+
const s = o, a = ks(), i = j(() => {
|
|
869
|
+
const b = a.meta?.blockUuid;
|
|
870
|
+
return typeof b == "string" && b.trim() ? b.trim() : s.uuid;
|
|
871
|
+
}), c = hs()?.type, m = To(a.matched, c);
|
|
872
872
|
if (m.length > 0) {
|
|
873
|
-
const
|
|
873
|
+
const b = m.map((r) => `[labull] ${r.message}`).join(`
|
|
874
874
|
`);
|
|
875
|
-
console.error(
|
|
875
|
+
console.error(b);
|
|
876
876
|
}
|
|
877
|
-
return (
|
|
877
|
+
return (b, r) => (d(), _s(wo, {
|
|
878
878
|
uuid: i.value,
|
|
879
879
|
name: o.name,
|
|
880
880
|
module: o.module,
|
|
@@ -882,136 +882,136 @@ const Mn = /* @__PURE__ */ je({
|
|
|
882
882
|
}, null, 8, ["uuid", "name", "module", "theme"]));
|
|
883
883
|
}
|
|
884
884
|
});
|
|
885
|
-
function
|
|
885
|
+
function gt(o) {
|
|
886
886
|
return String(o ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function Bo(o) {
|
|
889
889
|
return /^(https?:\/\/|mailto:|\/(?!\/))/i.test(String(o ?? "").trim());
|
|
890
890
|
}
|
|
891
891
|
function Lt(o) {
|
|
892
892
|
const s = String(o ?? "");
|
|
893
|
-
let
|
|
893
|
+
let a = "", i = 0;
|
|
894
894
|
for (; i < s.length; ) {
|
|
895
|
-
const
|
|
895
|
+
const c = s.slice(i), m = /^`([^`]+)`/.exec(c);
|
|
896
896
|
if (m) {
|
|
897
|
-
|
|
897
|
+
a += `<code>${gt(m[1])}</code>`, i += m[0].length;
|
|
898
898
|
continue;
|
|
899
899
|
}
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
902
|
-
|
|
900
|
+
const b = /^!\[[^\]]*\]\([^)\s]*\)/.exec(c);
|
|
901
|
+
if (b) {
|
|
902
|
+
a += gt(b[0]), i += b[0].length;
|
|
903
903
|
continue;
|
|
904
904
|
}
|
|
905
|
-
const
|
|
906
|
-
if (
|
|
907
|
-
|
|
905
|
+
const r = /^\[([^\]]*)\]\(([^)\s]*)\)/.exec(c);
|
|
906
|
+
if (r && Bo(r[2])) {
|
|
907
|
+
a += `<a href="${gt(r[2])}" target="_blank" rel="noopener noreferrer">${Lt(r[1])}</a>`, i += r[0].length;
|
|
908
908
|
continue;
|
|
909
909
|
}
|
|
910
|
-
const h = /^\*\*([^*]+)\*\*/.exec(
|
|
910
|
+
const h = /^\*\*([^*]+)\*\*/.exec(c);
|
|
911
911
|
if (h) {
|
|
912
|
-
|
|
912
|
+
a += `<strong>${gt(h[1])}</strong>`, i += h[0].length;
|
|
913
913
|
continue;
|
|
914
914
|
}
|
|
915
|
-
const v = /^\*([^*\n]+)\*/.exec(
|
|
915
|
+
const v = /^\*([^*\n]+)\*/.exec(c) ?? /^_([^_\n]+)_/.exec(c);
|
|
916
916
|
if (v) {
|
|
917
|
-
|
|
917
|
+
a += `<em>${gt(v[1])}</em>`, i += v[0].length;
|
|
918
918
|
continue;
|
|
919
919
|
}
|
|
920
|
-
|
|
920
|
+
a += gt(s[i]), i += 1;
|
|
921
921
|
}
|
|
922
|
-
return
|
|
922
|
+
return a;
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function Mo(o) {
|
|
925
925
|
const s = String(o ?? "").replace(/\r\n?/g, `
|
|
926
926
|
`).split(`
|
|
927
|
-
`),
|
|
928
|
-
let i = "",
|
|
927
|
+
`), a = [];
|
|
928
|
+
let i = "", c = [], m = [], b = !1, r = [];
|
|
929
929
|
const h = () => {
|
|
930
|
-
|
|
930
|
+
c.length > 0 && (a.push(`<p>${c.map((S) => Lt(S)).join("<br>")}</p>`), c = []);
|
|
931
931
|
}, v = () => {
|
|
932
|
-
m.length > 0 && (
|
|
933
|
-
}, _ = () => {
|
|
934
|
-
i && (l.push(`</${i}>`), i = "");
|
|
932
|
+
m.length > 0 && (a.push(`<blockquote>${m.map((S) => Lt(S)).join("<br>")}</blockquote>`), m = []);
|
|
935
933
|
}, g = () => {
|
|
936
|
-
|
|
937
|
-
},
|
|
938
|
-
|
|
934
|
+
i && (a.push(`</${i}>`), i = "");
|
|
935
|
+
}, _ = () => {
|
|
936
|
+
h(), v(), g();
|
|
937
|
+
}, y = (S) => {
|
|
938
|
+
i !== S && (g(), a.push(`<${S}>`), i = S);
|
|
939
939
|
};
|
|
940
|
-
for (const
|
|
941
|
-
const A =
|
|
940
|
+
for (const S of s) {
|
|
941
|
+
const A = S.replace(/\s+$/, "");
|
|
942
942
|
if (/^\s*```/.test(A)) {
|
|
943
|
-
|
|
944
|
-
`))}</code></pre>`),
|
|
943
|
+
b ? (a.push(`<pre><code>${gt(r.join(`
|
|
944
|
+
`))}</code></pre>`), r = [], b = !1) : (_(), b = !0);
|
|
945
945
|
continue;
|
|
946
946
|
}
|
|
947
|
-
if (
|
|
948
|
-
|
|
947
|
+
if (b) {
|
|
948
|
+
r.push(S);
|
|
949
949
|
continue;
|
|
950
950
|
}
|
|
951
951
|
if (!A.trim()) {
|
|
952
|
-
|
|
952
|
+
_();
|
|
953
953
|
continue;
|
|
954
954
|
}
|
|
955
955
|
const C = /^(#{1,6})\s+(.*)$/.exec(A);
|
|
956
956
|
if (C) {
|
|
957
|
-
|
|
957
|
+
_();
|
|
958
958
|
const Z = C[1].length;
|
|
959
|
-
|
|
959
|
+
a.push(`<h${Z}>${Lt(C[2])}</h${Z}>`);
|
|
960
960
|
continue;
|
|
961
961
|
}
|
|
962
962
|
if (/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(A)) {
|
|
963
|
-
|
|
963
|
+
_(), a.push("<hr>");
|
|
964
964
|
continue;
|
|
965
965
|
}
|
|
966
966
|
const O = /^\s*[-*+]\s+(.*)$/.exec(A);
|
|
967
967
|
if (O) {
|
|
968
|
-
h(), v(), y("ul"),
|
|
968
|
+
h(), v(), y("ul"), a.push(`<li>${Lt(O[1])}</li>`);
|
|
969
969
|
continue;
|
|
970
970
|
}
|
|
971
971
|
const P = /^\s*\d+[.)]\s+(.*)$/.exec(A);
|
|
972
972
|
if (P) {
|
|
973
|
-
h(), v(), y("ol"),
|
|
973
|
+
h(), v(), y("ol"), a.push(`<li>${Lt(P[1])}</li>`);
|
|
974
974
|
continue;
|
|
975
975
|
}
|
|
976
976
|
const U = /^\s*>\s?(.*)$/.exec(A);
|
|
977
977
|
if (U) {
|
|
978
|
-
h(),
|
|
978
|
+
h(), g(), m.push(U[1]);
|
|
979
979
|
continue;
|
|
980
980
|
}
|
|
981
|
-
v(),
|
|
981
|
+
v(), g(), c.push(A);
|
|
982
982
|
}
|
|
983
|
-
return
|
|
984
|
-
`))}</code></pre>`),
|
|
983
|
+
return b && a.push(`<pre><code>${gt(r.join(`
|
|
984
|
+
`))}</code></pre>`), _(), a.join("");
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function fn(o, s = 120) {
|
|
987
987
|
const i = (String(o ?? "").replace(/\r\n?/g, `
|
|
988
988
|
`).split(`
|
|
989
|
-
`).map((
|
|
989
|
+
`).map((c) => c.trim()).find((c) => c.length > 0) ?? "").replace(/^#{1,6}\s+/, "").replace(/^\s*[-*+]\s+/, "").replace(/^\s*\d+[.)]\s+/, "").replace(/^>\s?/, "").replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/_([^_]+)_/g, "$1").replace(/\s+/g, " ").trim();
|
|
990
990
|
return i.length > s ? `${i.slice(0, s)}…` : i;
|
|
991
991
|
}
|
|
992
|
-
const
|
|
993
|
-
function
|
|
994
|
-
const
|
|
995
|
-
if (
|
|
996
|
-
const i =
|
|
992
|
+
const xe = "pages.lock.ts";
|
|
993
|
+
function Ao(o, s) {
|
|
994
|
+
const a = String(o || "").split(/[^A-Za-z0-9]+/).filter(Boolean);
|
|
995
|
+
if (a.length === 0) return `Page${s + 1}`;
|
|
996
|
+
const i = a.map((c) => c[0].toUpperCase() + c.slice(1)).join("");
|
|
997
997
|
return /^[0-9]/.test(i) ? `P${i}` : i;
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function Oo(o, s) {
|
|
1000
1000
|
if (!s.has(o))
|
|
1001
1001
|
return s.add(o), o;
|
|
1002
|
-
let
|
|
1003
|
-
for (; s.has(`${o}${
|
|
1004
|
-
const i = `${o}${
|
|
1002
|
+
let a = 2;
|
|
1003
|
+
for (; s.has(`${o}${a}`); ) a += 1;
|
|
1004
|
+
const i = `${o}${a}`;
|
|
1005
1005
|
return s.add(i), i;
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1008
|
-
const s = (o ?? []).filter((m) => m && typeof m.path == "string" && m.path.trim() !== ""),
|
|
1009
|
-
s.forEach((m,
|
|
1010
|
-
const
|
|
1011
|
-
let h = i.find((v) => v.title ===
|
|
1012
|
-
h || (h = { title:
|
|
1007
|
+
function Ro(o) {
|
|
1008
|
+
const s = (o ?? []).filter((m) => m && typeof m.path == "string" && m.path.trim() !== ""), a = /* @__PURE__ */ new Set(), i = [];
|
|
1009
|
+
s.forEach((m, b) => {
|
|
1010
|
+
const r = m.group?.trim() || "(没写 meta.group)";
|
|
1011
|
+
let h = i.find((v) => v.title === r);
|
|
1012
|
+
h || (h = { title: r, rows: [] }, i.push(h)), h.rows.push({ key: Oo(Ao(m.path, b), a), row: m });
|
|
1013
1013
|
});
|
|
1014
|
-
const
|
|
1014
|
+
const c = [
|
|
1015
1015
|
"/* 生成物:**每次导出都会重写**,别手改 —— 改了下次导出就没了。",
|
|
1016
1016
|
" *",
|
|
1017
1017
|
" * 这个文件回答「块的前端(index.open.html 那一侧)里我能跳哪些页面、能调什么」。",
|
|
@@ -1037,17 +1037,17 @@ function Bo(o) {
|
|
|
1037
1037
|
""
|
|
1038
1038
|
];
|
|
1039
1039
|
if (i.length === 0)
|
|
1040
|
-
|
|
1040
|
+
c.push("/* ⚠️ 这次导出没拿到路由表(这个应用没装 vue-router,或者一条页面路由都没有)。 */", "export const Page = {} as const", "");
|
|
1041
1041
|
else {
|
|
1042
|
-
|
|
1042
|
+
c.push("export const Page = {");
|
|
1043
1043
|
for (const m of i) {
|
|
1044
|
-
|
|
1045
|
-
for (const
|
|
1046
|
-
|
|
1044
|
+
c.push(` // ── ${m.title} ──`);
|
|
1045
|
+
for (const b of m.rows)
|
|
1046
|
+
c.push(` /** ${b.row.title?.trim() || b.row.path}(${b.row.path}) */`), c.push(` ${b.key}: '${b.row.path}',`);
|
|
1047
1047
|
}
|
|
1048
|
-
|
|
1048
|
+
c.push("} as const", "");
|
|
1049
1049
|
}
|
|
1050
|
-
return
|
|
1050
|
+
return c.push(
|
|
1051
1051
|
"/** `Page` 里那些路径的联合类型(只想收页面路径的参数可以写它)。 */",
|
|
1052
1052
|
"export type PagePath = (typeof Page)[keyof typeof Page]",
|
|
1053
1053
|
"",
|
|
@@ -1099,88 +1099,88 @@ function Bo(o) {
|
|
|
1099
1099
|
"",
|
|
1100
1100
|
"export {}",
|
|
1101
1101
|
""
|
|
1102
|
-
),
|
|
1102
|
+
), c.join(`
|
|
1103
1103
|
`);
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function jn() {
|
|
1106
1106
|
return typeof window < "u" && typeof window.showDirectoryPicker == "function";
|
|
1107
1107
|
}
|
|
1108
|
-
const
|
|
1109
|
-
async function
|
|
1110
|
-
if (!
|
|
1108
|
+
const Po = "这个浏览器没法直接写你本机的文件夹(少了 File System Access API):请用 Chrome / Edge,并且从 https 或 http://localhost 打开这个页面(内网 http 会更少 API)。";
|
|
1109
|
+
async function Ce() {
|
|
1110
|
+
if (!jn()) throw new Error(Po);
|
|
1111
1111
|
try {
|
|
1112
1112
|
const o = await window.showDirectoryPicker({ mode: "readwrite", id: "labull-magic-block" });
|
|
1113
1113
|
return { name: o.name, handle: o };
|
|
1114
1114
|
} catch (o) {
|
|
1115
1115
|
const s = o instanceof Error ? o.name : "";
|
|
1116
|
-
throw s === "AbortError" ? new Error("取消选目录了:想导出就再点一次「选择文件夹」") : s === "SecurityError" ? new Error(`选不了这个目录:浏览器不让(${
|
|
1116
|
+
throw s === "AbortError" ? new Error("取消选目录了:想导出就再点一次「选择文件夹」") : s === "SecurityError" ? new Error(`选不了这个目录:浏览器不让(${oe(o)})—— 换一个目录,或确认页面是 https / localhost`) : new Error(`选目录失败:${oe(o)}`);
|
|
1117
1117
|
}
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function oe(o) {
|
|
1120
1120
|
return (o instanceof Error ? o.message.trim() : String(o)) || "没有说原因";
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1122
|
+
function De(o) {
|
|
1123
1123
|
const s = String(o ?? "").split("/");
|
|
1124
|
-
for (const
|
|
1125
|
-
if (!
|
|
1124
|
+
for (const a of s)
|
|
1125
|
+
if (!a || a === "." || a === ".." || a.includes("\\") || /^[A-Za-z]:/.test(a))
|
|
1126
1126
|
throw new Error(`路径不合法:${o}(要相对路径,不许 .. / 盘符 / 反斜杠)`);
|
|
1127
1127
|
return s;
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1129
|
+
function jo(o) {
|
|
1130
1130
|
const s = String(o ?? "");
|
|
1131
|
-
let
|
|
1132
|
-
for (let
|
|
1133
|
-
const m = s.charCodeAt(
|
|
1134
|
-
|
|
1131
|
+
let a = 3735928559, i = 1103547991;
|
|
1132
|
+
for (let c = 0; c < s.length; c += 1) {
|
|
1133
|
+
const m = s.charCodeAt(c);
|
|
1134
|
+
a = Math.imul(a ^ m, 2654435761), i = Math.imul(i ^ m, 1597334677);
|
|
1135
1135
|
}
|
|
1136
|
-
return
|
|
1136
|
+
return a = Math.imul(a ^ a >>> 16, 2246822507) ^ Math.imul(i ^ i >>> 13, 3266489909), i = Math.imul(i ^ i >>> 16, 2246822507) ^ Math.imul(a ^ a >>> 13, 3266489909), `${(4294967296 * (2097151 & i) + (a >>> 0)).toString(36)}:${s.length}`;
|
|
1137
1137
|
}
|
|
1138
|
-
const
|
|
1139
|
-
async function
|
|
1140
|
-
let
|
|
1138
|
+
const Lo = 8;
|
|
1139
|
+
async function _t(o, s) {
|
|
1140
|
+
let a = 0;
|
|
1141
1141
|
const i = async () => {
|
|
1142
1142
|
for (; ; ) {
|
|
1143
|
-
const
|
|
1144
|
-
if (
|
|
1145
|
-
await s(o[
|
|
1143
|
+
const c = a;
|
|
1144
|
+
if (a += 1, c >= o.length) return;
|
|
1145
|
+
await s(o[c], c);
|
|
1146
1146
|
}
|
|
1147
1147
|
};
|
|
1148
|
-
await Promise.all(Array.from({ length: Math.max(1, Math.min(
|
|
1148
|
+
await Promise.all(Array.from({ length: Math.max(1, Math.min(Lo, o.length)) }, () => i()));
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1150
|
+
function Io(o) {
|
|
1151
1151
|
const s = /* @__PURE__ */ new Map();
|
|
1152
|
-
return (
|
|
1153
|
-
const i =
|
|
1154
|
-
if (
|
|
1152
|
+
return (a) => {
|
|
1153
|
+
const i = a.join("\0"), c = s.get(i);
|
|
1154
|
+
if (c) return c;
|
|
1155
1155
|
let m = Promise.resolve(o);
|
|
1156
|
-
for (let
|
|
1157
|
-
const
|
|
1158
|
-
m = v ?? m.then((
|
|
1156
|
+
for (let b = 0; b < a.length; b += 1) {
|
|
1157
|
+
const r = a[b], h = a.slice(0, b + 1).join("\0"), v = s.get(h);
|
|
1158
|
+
m = v ?? m.then((g) => g.getDirectoryHandle(r, { create: !0 })), v || s.set(h, m);
|
|
1159
1159
|
}
|
|
1160
1160
|
return m;
|
|
1161
1161
|
};
|
|
1162
1162
|
}
|
|
1163
|
-
async function
|
|
1163
|
+
async function Do(o, s, a) {
|
|
1164
1164
|
try {
|
|
1165
|
-
return await (await (await o.getFileHandle(s)).getFile()).text() ===
|
|
1165
|
+
return await (await (await o.getFileHandle(s)).getFile()).text() === a;
|
|
1166
1166
|
} catch {
|
|
1167
1167
|
return !1;
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
|
-
async function
|
|
1171
|
-
const
|
|
1170
|
+
async function No(o, s, a, i = {}) {
|
|
1171
|
+
const c = Object.entries(s ?? {}).map(([C, O]) => {
|
|
1172
1172
|
const P = String(O ?? "");
|
|
1173
|
-
return { path: C, parts:
|
|
1174
|
-
}), m =
|
|
1175
|
-
let y = 0,
|
|
1176
|
-
return
|
|
1173
|
+
return { path: C, parts: De(C), body: P, digest: jo(P) };
|
|
1174
|
+
}), m = c.length, b = [], r = Io(o.handle), h = i.verify === !0, v = i.trust, g = i.existing, _ = /* @__PURE__ */ new Map();
|
|
1175
|
+
let y = 0, S = 0, A = 0;
|
|
1176
|
+
return a?.(0, m), await _t(c, async (C) => {
|
|
1177
1177
|
try {
|
|
1178
|
-
if (v?.get(C.path) === C.digest && (
|
|
1179
|
-
A += 1,
|
|
1178
|
+
if (v?.get(C.path) === C.digest && (g?.has(C.path) ?? !1))
|
|
1179
|
+
A += 1, _.set(C.path, C.digest);
|
|
1180
1180
|
else {
|
|
1181
|
-
const O = await
|
|
1182
|
-
if (h && await
|
|
1183
|
-
|
|
1181
|
+
const O = await r(C.parts.slice(0, -1)), P = C.parts[C.parts.length - 1];
|
|
1182
|
+
if (h && await Do(O, P, C.body))
|
|
1183
|
+
S += 1, _.set(C.path, C.digest);
|
|
1184
1184
|
else {
|
|
1185
1185
|
const Z = await (await O.getFileHandle(P, { create: !0 })).createWritable();
|
|
1186
1186
|
try {
|
|
@@ -1188,87 +1188,87 @@ async function jo(o, s, l, i = {}) {
|
|
|
1188
1188
|
} finally {
|
|
1189
1189
|
await Z.close();
|
|
1190
1190
|
}
|
|
1191
|
-
y += 1,
|
|
1191
|
+
y += 1, _.set(C.path, C.digest);
|
|
1192
1192
|
}
|
|
1193
1193
|
}
|
|
1194
1194
|
} catch (O) {
|
|
1195
|
-
|
|
1195
|
+
b.push({ path: C.path, message: oe(O) });
|
|
1196
1196
|
}
|
|
1197
|
-
|
|
1198
|
-
}),
|
|
1197
|
+
a?.(y + S + A + b.length, m);
|
|
1198
|
+
}), b.sort((C, O) => C.path < O.path ? -1 : C.path > O.path ? 1 : 0), { written: y, failed: b, total: m, skipped: S, trusted: A, fingerprints: _ };
|
|
1199
1199
|
}
|
|
1200
|
-
async function
|
|
1201
|
-
const
|
|
1200
|
+
async function Ee(o, s) {
|
|
1201
|
+
const a = { items: [], topCount: 0, files: 0, dirs: 0 }, i = async (b, r) => {
|
|
1202
1202
|
const h = [];
|
|
1203
|
-
for (const v of await At(
|
|
1203
|
+
for (const v of await At(b)) {
|
|
1204
1204
|
if (v.kind === "file") {
|
|
1205
|
-
|
|
1205
|
+
a.files += 1;
|
|
1206
1206
|
continue;
|
|
1207
1207
|
}
|
|
1208
|
-
|
|
1208
|
+
a.dirs += 1, !(r >= s.maxDepth) && (s.skipDirs.includes(v.name) || h.push(v));
|
|
1209
1209
|
}
|
|
1210
|
-
await
|
|
1211
|
-
},
|
|
1212
|
-
for (const
|
|
1213
|
-
if (
|
|
1210
|
+
await _t(h, (v) => i(v, r + 1));
|
|
1211
|
+
}, c = await At(o.handle), m = [];
|
|
1212
|
+
for (const b of c)
|
|
1213
|
+
if (a.items.push({ name: b.name, dir: b.kind === "directory" }), b.kind === "file") a.files += 1;
|
|
1214
1214
|
else {
|
|
1215
|
-
if (
|
|
1216
|
-
m.push(
|
|
1215
|
+
if (a.dirs += 1, s.skipDirs.includes(b.name) || s.maxDepth <= 0) continue;
|
|
1216
|
+
m.push(b);
|
|
1217
1217
|
}
|
|
1218
|
-
return await
|
|
1218
|
+
return await _t(m, (b) => i(b, 1)), a.topCount = a.items.length, a;
|
|
1219
1219
|
}
|
|
1220
|
-
async function
|
|
1220
|
+
async function Fo(o) {
|
|
1221
1221
|
const s = [];
|
|
1222
1222
|
for (const i of await At(o.handle)) s.push(i.name);
|
|
1223
|
-
let
|
|
1224
|
-
return await
|
|
1225
|
-
await o.handle.removeEntry(i, { recursive: !0 }),
|
|
1226
|
-
}),
|
|
1223
|
+
let a = 0;
|
|
1224
|
+
return await _t(s, async (i) => {
|
|
1225
|
+
await o.handle.removeEntry(i, { recursive: !0 }), a += 1;
|
|
1226
|
+
}), a;
|
|
1227
1227
|
}
|
|
1228
|
-
async function
|
|
1229
|
-
const { wantedFiles:
|
|
1228
|
+
async function Uo(o, s) {
|
|
1229
|
+
const { wantedFiles: a, wantedDirs: i } = Ln(s), c = /* @__PURE__ */ new Set();
|
|
1230
1230
|
let m = 0;
|
|
1231
|
-
const
|
|
1232
|
-
const v = [],
|
|
1233
|
-
for (const
|
|
1234
|
-
const y = h ? `${h}/${
|
|
1235
|
-
if (
|
|
1236
|
-
|
|
1231
|
+
const b = async (r, h) => {
|
|
1232
|
+
const v = [], g = [];
|
|
1233
|
+
for (const _ of await At(r)) {
|
|
1234
|
+
const y = h ? `${h}/${_.name}` : _.name;
|
|
1235
|
+
if (_.kind === "file") {
|
|
1236
|
+
a.has(y) ? c.add(y) : v.push(_.name);
|
|
1237
1237
|
continue;
|
|
1238
1238
|
}
|
|
1239
|
-
i.has(y) ?
|
|
1239
|
+
i.has(y) ? g.push([y, _]) : v.push(_.name);
|
|
1240
1240
|
}
|
|
1241
|
-
await
|
|
1242
|
-
await
|
|
1243
|
-
}), await
|
|
1241
|
+
await _t(v, async (_) => {
|
|
1242
|
+
await r.removeEntry(_, { recursive: !0 }), m += 1;
|
|
1243
|
+
}), await _t(g, ([_, y]) => b(y, _));
|
|
1244
1244
|
};
|
|
1245
|
-
return await
|
|
1245
|
+
return await b(o.handle, ""), { removed: m, existing: c };
|
|
1246
1246
|
}
|
|
1247
|
-
function
|
|
1248
|
-
const s = /* @__PURE__ */ new Set(),
|
|
1247
|
+
function Ln(o) {
|
|
1248
|
+
const s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
1249
1249
|
for (const i of Object.keys(o ?? {})) {
|
|
1250
|
-
const
|
|
1251
|
-
s.add(
|
|
1252
|
-
for (let m = 1; m <
|
|
1250
|
+
const c = De(i);
|
|
1251
|
+
s.add(c.join("/"));
|
|
1252
|
+
for (let m = 1; m < c.length; m += 1) a.add(c.slice(0, m).join("/"));
|
|
1253
1253
|
}
|
|
1254
|
-
return { wantedFiles: s, wantedDirs:
|
|
1254
|
+
return { wantedFiles: s, wantedDirs: a };
|
|
1255
1255
|
}
|
|
1256
|
-
async function
|
|
1257
|
-
const { wantedFiles:
|
|
1256
|
+
async function zo(o, s) {
|
|
1257
|
+
const { wantedFiles: a, wantedDirs: i } = Ln(s), c = /* @__PURE__ */ new Set(), m = async (b, r) => {
|
|
1258
1258
|
const h = [];
|
|
1259
|
-
for (const v of await At(
|
|
1260
|
-
const
|
|
1259
|
+
for (const v of await At(b)) {
|
|
1260
|
+
const g = r ? `${r}/${v.name}` : v.name;
|
|
1261
1261
|
if (v.kind === "file") {
|
|
1262
|
-
|
|
1262
|
+
a.has(g) && c.add(g);
|
|
1263
1263
|
continue;
|
|
1264
1264
|
}
|
|
1265
|
-
i.has(
|
|
1265
|
+
i.has(g) && h.push([g, v]);
|
|
1266
1266
|
}
|
|
1267
|
-
await
|
|
1267
|
+
await _t(h, ([v, g]) => m(g, v));
|
|
1268
1268
|
};
|
|
1269
|
-
return await m(o.handle, ""),
|
|
1269
|
+
return await m(o.handle, ""), c;
|
|
1270
1270
|
}
|
|
1271
|
-
function
|
|
1271
|
+
function Ho(o, s) {
|
|
1272
1272
|
if (o.name === s.blocksDir)
|
|
1273
1273
|
throw new Error(
|
|
1274
1274
|
`你选中的是「${s.blocksDir}」这一层(它就是放代码的那一层):导出会铺成 ${s.blocksDir}/${s.blocksDir}/…。请选它**上面**那一层 —— 也就是开发目录本身。`
|
|
@@ -1276,239 +1276,239 @@ function No(o, s) {
|
|
|
1276
1276
|
}
|
|
1277
1277
|
async function At(o) {
|
|
1278
1278
|
const s = [];
|
|
1279
|
-
for await (const
|
|
1280
|
-
return s.sort((
|
|
1279
|
+
for await (const a of o.values()) s.push(a);
|
|
1280
|
+
return s.sort((a, i) => a.name < i.name ? -1 : a.name > i.name ? 1 : 0), s;
|
|
1281
1281
|
}
|
|
1282
|
-
function
|
|
1282
|
+
function Ko(o) {
|
|
1283
1283
|
return o.charCodeAt(0) === 65279 ? o.slice(1) : o;
|
|
1284
1284
|
}
|
|
1285
|
-
function
|
|
1285
|
+
function qo(o) {
|
|
1286
1286
|
const s = o.lastIndexOf(".");
|
|
1287
1287
|
return s <= 0 ? "" : o.slice(s).toLowerCase();
|
|
1288
1288
|
}
|
|
1289
|
-
const
|
|
1290
|
-
async function
|
|
1291
|
-
const i = await At(o),
|
|
1292
|
-
await
|
|
1293
|
-
const v = s ? `${s}/${
|
|
1294
|
-
if (
|
|
1295
|
-
if (
|
|
1296
|
-
const y = await
|
|
1297
|
-
for (const [
|
|
1298
|
-
|
|
1299
|
-
|
|
1289
|
+
const Vo = { folders: [], failures: [], truncated: !1 };
|
|
1290
|
+
async function In(o, s, a) {
|
|
1291
|
+
const i = await At(o), c = new Array(i.length);
|
|
1292
|
+
await _t(i, async (r, h) => {
|
|
1293
|
+
const v = s ? `${s}/${r.name}` : r.name, g = { files: {}, failures: [] };
|
|
1294
|
+
if (c[h] = g, r.kind === "directory") {
|
|
1295
|
+
if (a.skipDirs.includes(r.name)) return;
|
|
1296
|
+
const y = await In(r, v, a);
|
|
1297
|
+
for (const [S, A] of Object.entries(y.files))
|
|
1298
|
+
g.files[`${r.name}/${S}`] = A;
|
|
1299
|
+
g.failures.push(...y.failures);
|
|
1300
1300
|
return;
|
|
1301
1301
|
}
|
|
1302
|
-
if (!
|
|
1303
|
-
if (!
|
|
1304
|
-
|
|
1302
|
+
if (!a.platformFiles.includes(r.name)) {
|
|
1303
|
+
if (!a.textExt.includes(qo(r.name))) {
|
|
1304
|
+
g.failures.push({
|
|
1305
1305
|
kind: "file",
|
|
1306
1306
|
where: v,
|
|
1307
|
-
message: `不是文本文件(认得的扩展名:${
|
|
1307
|
+
message: `不是文本文件(认得的扩展名:${a.textExt.join(" ")}),已跳过`
|
|
1308
1308
|
});
|
|
1309
1309
|
return;
|
|
1310
1310
|
}
|
|
1311
1311
|
try {
|
|
1312
|
-
const
|
|
1313
|
-
if (
|
|
1314
|
-
|
|
1312
|
+
const _ = await r.getFile();
|
|
1313
|
+
if (_.size > a.maxFileBytes) {
|
|
1314
|
+
g.failures.push({
|
|
1315
1315
|
kind: "file",
|
|
1316
1316
|
where: v,
|
|
1317
|
-
message: `文件 ${Math.round(
|
|
1317
|
+
message: `文件 ${Math.round(_.size / 1024)} KB 超过上限 ${Math.floor(a.maxFileBytes / 1024)} KB,已跳过`
|
|
1318
1318
|
});
|
|
1319
1319
|
return;
|
|
1320
1320
|
}
|
|
1321
|
-
|
|
1322
|
-
} catch (
|
|
1323
|
-
|
|
1321
|
+
g.files[r.name] = Ko(await _.text());
|
|
1322
|
+
} catch (_) {
|
|
1323
|
+
g.failures.push({ kind: "file", where: v, message: `读不了这个文件:${oe(_)}` });
|
|
1324
1324
|
}
|
|
1325
1325
|
}
|
|
1326
1326
|
});
|
|
1327
|
-
const m = {},
|
|
1328
|
-
for (const
|
|
1329
|
-
|
|
1330
|
-
return { files: m, failures:
|
|
1331
|
-
}
|
|
1332
|
-
async function
|
|
1333
|
-
const
|
|
1334
|
-
if (m.length === 0 ||
|
|
1335
|
-
const
|
|
1336
|
-
return h.folders.push({ where:
|
|
1327
|
+
const m = {}, b = [];
|
|
1328
|
+
for (const r of c)
|
|
1329
|
+
r && (Object.assign(m, r.files), b.push(...r.failures));
|
|
1330
|
+
return { files: m, failures: b };
|
|
1331
|
+
}
|
|
1332
|
+
async function Dn(o, s, a, i) {
|
|
1333
|
+
const c = await At(o), m = c.filter((_) => _.kind === "directory"), b = c.filter((_) => _.kind === "file"), r = s.join("/"), h = { folders: [], failures: [], truncated: !1 };
|
|
1334
|
+
if (m.length === 0 || b.some((_) => _.name === i.entry)) {
|
|
1335
|
+
const _ = await In(o, r, i);
|
|
1336
|
+
return h.folders.push({ where: r, files: _.files }), h.failures.push(..._.failures), h;
|
|
1337
1337
|
}
|
|
1338
|
-
for (const
|
|
1339
|
-
s.length === 0 && i.rootSkipFiles.includes(
|
|
1338
|
+
for (const _ of b)
|
|
1339
|
+
s.length === 0 && i.rootSkipFiles.includes(_.name.toLowerCase()) || h.failures.push({
|
|
1340
1340
|
kind: "file",
|
|
1341
|
-
where: [...s,
|
|
1341
|
+
where: [...s, _.name].join("/"),
|
|
1342
1342
|
message: `这一层直接放着一份文件,但它自己不是块文件夹、也没有 ${i.entry},文件没有归属`
|
|
1343
1343
|
});
|
|
1344
|
-
const v = m.map((
|
|
1344
|
+
const v = m.map((_) => async () => i.skipDirs.includes(_.name) ? Vo : a >= i.maxDepth ? {
|
|
1345
1345
|
folders: [],
|
|
1346
1346
|
failures: [{
|
|
1347
1347
|
kind: "dir",
|
|
1348
|
-
where: [...s,
|
|
1348
|
+
where: [...s, _.name].join("/"),
|
|
1349
1349
|
message: `超过最大层数 ${i.maxDepth} 层还没见到 ${i.entry},没有继续往下找`
|
|
1350
1350
|
}],
|
|
1351
1351
|
truncated: !0
|
|
1352
|
-
} :
|
|
1353
|
-
await
|
|
1354
|
-
|
|
1352
|
+
} : Dn(_, [...s, _.name], a + 1, i)), g = new Array(v.length);
|
|
1353
|
+
await _t(v, async (_, y) => {
|
|
1354
|
+
g[y] = await _();
|
|
1355
1355
|
});
|
|
1356
|
-
for (const
|
|
1357
|
-
|
|
1356
|
+
for (const _ of g)
|
|
1357
|
+
_ && (h.folders.push(..._.folders), h.failures.push(..._.failures), _.truncated && (h.truncated = !0));
|
|
1358
1358
|
return h;
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1360
|
+
function bn(o) {
|
|
1361
1361
|
return o >= 1024 * 1024 ? `${(o / 1024 / 1024).toFixed(1)} MB` : `${Math.max(1, Math.round(o / 1024))} KB`;
|
|
1362
1362
|
}
|
|
1363
|
-
async function
|
|
1364
|
-
const
|
|
1363
|
+
async function Jo(o, s) {
|
|
1364
|
+
const a = await Dn(o.handle, [], 0, s), i = {
|
|
1365
1365
|
root: o.name,
|
|
1366
|
-
folders:
|
|
1367
|
-
failures:
|
|
1368
|
-
truncated:
|
|
1369
|
-
},
|
|
1370
|
-
(m,
|
|
1366
|
+
folders: a.folders,
|
|
1367
|
+
failures: a.failures,
|
|
1368
|
+
truncated: a.truncated
|
|
1369
|
+
}, c = i.folders.reduce(
|
|
1370
|
+
(m, b) => m + Object.values(b.files).reduce((r, h) => r + h.length, 0),
|
|
1371
1371
|
0
|
|
1372
1372
|
);
|
|
1373
|
-
if (
|
|
1373
|
+
if (c > s.maxBodyBytes)
|
|
1374
1374
|
throw new Error(
|
|
1375
|
-
`这个目录读到的正文有 ${
|
|
1375
|
+
`这个目录读到的正文有 ${bn(c)},超过一次读回的上限 ${bn(s.maxBodyBytes)}:请先只留要改的那几个块,或者把大文件挪走。`
|
|
1376
1376
|
);
|
|
1377
1377
|
return i;
|
|
1378
1378
|
}
|
|
1379
|
-
const
|
|
1379
|
+
const Wo = { class: "mbc__head" }, Go = ["title"], Yo = ["title"], Zo = {
|
|
1380
1380
|
class: "mbc__tabs",
|
|
1381
1381
|
role: "tablist"
|
|
1382
|
-
},
|
|
1382
|
+
}, Xo = ["aria-selected"], Qo = { class: "mbc__count" }, tl = ["title"], el = ["aria-selected"], nl = ["title"], sl = {
|
|
1383
1383
|
key: 1,
|
|
1384
1384
|
class: "mbc__chip is-ok"
|
|
1385
|
-
},
|
|
1385
|
+
}, ol = { class: "mbc__body" }, ll = {
|
|
1386
1386
|
key: 0,
|
|
1387
1387
|
class: "mbc__running"
|
|
1388
|
-
},
|
|
1388
|
+
}, al = ["aria-valuenow"], il = {
|
|
1389
1389
|
key: 1,
|
|
1390
1390
|
class: "mbc__confirm"
|
|
1391
|
-
},
|
|
1391
|
+
}, cl = { class: "mbc__confirm-title" }, ul = { class: "mbc__confirm-body" }, rl = {
|
|
1392
1392
|
key: 0,
|
|
1393
1393
|
class: "mbc__mono"
|
|
1394
|
-
},
|
|
1394
|
+
}, dl = { class: "mbc__confirm-check" }, pl = { class: "mbc__actions" }, fl = ["disabled"], bl = ["disabled"], ml = ["disabled"], vl = {
|
|
1395
1395
|
key: 2,
|
|
1396
1396
|
class: "mbc__confirm"
|
|
1397
|
-
},
|
|
1397
|
+
}, hl = { class: "mbc__confirm-title" }, _l = { class: "mbc__confirm-body" }, gl = { class: "mbc__mono" }, yl = { class: "mbc__actions" }, kl = ["disabled"], $l = ["disabled"], wl = { class: "mbc__panel mbc__panel--blocks" }, xl = { class: "mbc__title" }, Cl = { class: "mbc__count" }, El = {
|
|
1398
1398
|
key: 0,
|
|
1399
1399
|
class: "mbc__count mbc__count--tag"
|
|
1400
|
-
},
|
|
1400
|
+
}, Sl = {
|
|
1401
1401
|
key: 0,
|
|
1402
1402
|
class: "mbc__tagbar"
|
|
1403
|
-
},
|
|
1404
|
-
key:
|
|
1403
|
+
}, Tl = ["title", "onClick"], Bl = { class: "mbc__list" }, Ml = ["title", "onClick"], Al = { class: "mbc__module" }, Ol = { class: "mbc__name" }, Rl = ["title"], Pl = ["title"], jl = ["title"], Ll = {
|
|
1404
|
+
key: 2,
|
|
1405
1405
|
class: "mbc__where"
|
|
1406
|
-
},
|
|
1406
|
+
}, Il = ["title"], Dl = {
|
|
1407
1407
|
key: 0,
|
|
1408
1408
|
class: "mbc__detail"
|
|
1409
|
-
},
|
|
1409
|
+
}, Nl = {
|
|
1410
1410
|
key: 0,
|
|
1411
1411
|
class: "mbc__hint"
|
|
1412
|
-
},
|
|
1412
|
+
}, Fl = { class: "mbc__meta" }, Ul = ["innerHTML"], zl = {
|
|
1413
1413
|
key: 1,
|
|
1414
1414
|
class: "mbc__hint"
|
|
1415
|
-
},
|
|
1415
|
+
}, Hl = ["disabled", "onClick"], Kl = ["disabled", "onClick"], ql = ["disabled"], Vl = { class: "mbc__hint" }, Jl = { class: "mbc__loclist" }, Wl = { class: "mbc__mono" }, Gl = { class: "mbc__hint" }, Yl = { class: "mbc__loclist mbc__loclist--inert" }, Zl = { class: "mbc__mono" }, Xl = { class: "mbc__hint" }, Ql = {
|
|
1416
1416
|
key: 0,
|
|
1417
1417
|
class: "mbc__hint"
|
|
1418
|
-
},
|
|
1418
|
+
}, ta = ["disabled", "onClick"], ea = ["onKeyup"], na = ["disabled", "onClick"], sa = ["disabled"], oa = {
|
|
1419
1419
|
key: 0,
|
|
1420
1420
|
class: "mbc__tagbar"
|
|
1421
|
-
},
|
|
1421
|
+
}, la = ["title", "onClick"], aa = {
|
|
1422
1422
|
key: 1,
|
|
1423
1423
|
class: "mbc__tagbar"
|
|
1424
|
-
},
|
|
1424
|
+
}, ia = ["title", "onClick"], ca = { class: "mbc__mono" }, ua = { class: "mbc__actions mbc__actions--row" }, ra = ["disabled", "onClick"], da = { class: "mbc__versions" }, pa = { class: "mbc__versions-head" }, fa = ["disabled", "onClick"], ba = {
|
|
1425
1425
|
key: 0,
|
|
1426
1426
|
class: "mbc__hint"
|
|
1427
|
-
},
|
|
1427
|
+
}, ma = {
|
|
1428
1428
|
key: 1,
|
|
1429
1429
|
class: "mbc__versions-list"
|
|
1430
|
-
},
|
|
1430
|
+
}, va = { class: "mbc__mono" }, ha = { class: "mbc__hint" }, _a = { class: "mbc__actions" }, ga = ["disabled", "onClick", "title"], ya = ["disabled", "onClick", "title"], ka = ["disabled", "onClick", "title"], $a = ["disabled", "onClick", "title"], wa = {
|
|
1431
1431
|
key: 2,
|
|
1432
1432
|
class: "mbc__hint"
|
|
1433
|
-
},
|
|
1433
|
+
}, xa = {
|
|
1434
1434
|
key: 3,
|
|
1435
1435
|
class: "mbc__viewer"
|
|
1436
|
-
},
|
|
1436
|
+
}, Ca = { class: "mbc__versions-head" }, Ea = { class: "mbc__mono" }, Sa = { class: "mbc__viewer-body" }, Ta = { class: "mbc__panel mbc__panel--export" }, Ba = { class: "mbc__field" }, Ma = ["disabled"], Aa = { class: "mbc__field" }, Oa = { class: "mbc__radio" }, Ra = ["checked"], Pa = { class: "mbc__radio" }, ja = ["checked"], La = ["value", "disabled"], Ia = {
|
|
1437
1437
|
key: 0,
|
|
1438
1438
|
value: ""
|
|
1439
|
-
},
|
|
1439
|
+
}, Da = ["value"], Na = { class: "mbc__field" }, Fa = ["value"], Ua = ["disabled"], za = ["disabled", "title"], Ha = { class: "mbc__hint" }, Ka = {
|
|
1440
1440
|
key: 0,
|
|
1441
1441
|
class: "mbc__hint"
|
|
1442
|
-
},
|
|
1442
|
+
}, qa = { class: "mbc__panel mbc__panel--read" }, Va = { class: "mbc__field" }, Ja = ["value"], Wa = ["disabled"], Ga = ["disabled"], Ya = {
|
|
1443
1443
|
key: 0,
|
|
1444
1444
|
class: "mbc__hint"
|
|
1445
|
-
},
|
|
1445
|
+
}, Za = {
|
|
1446
1446
|
key: 1,
|
|
1447
1447
|
class: "mbc__hint"
|
|
1448
|
-
},
|
|
1448
|
+
}, Xa = {
|
|
1449
1449
|
key: 0,
|
|
1450
1450
|
class: "mbc__hint"
|
|
1451
|
-
},
|
|
1451
|
+
}, Qa = { class: "mbc__ok-text" }, ti = ["disabled"], ei = ["disabled"], ni = {
|
|
1452
1452
|
key: 1,
|
|
1453
1453
|
class: "mbc__scan"
|
|
1454
|
-
},
|
|
1454
|
+
}, si = { class: "mbc__pick" }, oi = ["disabled", "checked", "onChange"], li = { class: "mbc__name" }, ai = { class: "mbc__module" }, ii = { class: "mbc__hint" }, ci = { class: "mbc__mono" }, ui = {
|
|
1455
1455
|
key: 0,
|
|
1456
1456
|
class: "mbc__problem"
|
|
1457
|
-
},
|
|
1457
|
+
}, ri = { class: "mbc__hint mbc__mono" }, di = {
|
|
1458
1458
|
key: 2,
|
|
1459
1459
|
class: "mbc__hint"
|
|
1460
|
-
},
|
|
1460
|
+
}, pi = { class: "mbc__field" }, fi = ["title"], bi = {
|
|
1461
1461
|
key: 1,
|
|
1462
1462
|
class: "mbc__chip is-ok"
|
|
1463
|
-
},
|
|
1463
|
+
}, mi = ["title"], vi = {
|
|
1464
1464
|
key: 3,
|
|
1465
1465
|
class: "mbc__hint"
|
|
1466
|
-
},
|
|
1466
|
+
}, hi = { class: "mbc__field mbc__field--end" }, _i = ["disabled"], gi = { class: "mbc__panel mbc__panel--declared" }, yi = { class: "mbc__title" }, ki = { class: "p-tag p-tag-info" }, $i = { class: "mbc__count" }, wi = {
|
|
1467
1467
|
key: 0,
|
|
1468
1468
|
class: "mbc__hint"
|
|
1469
|
-
},
|
|
1469
|
+
}, xi = { class: "mbc__hint" }, Ci = { class: "mbc__scan" }, Ei = { class: "mbc__pick" }, Si = { class: "mbc__name" }, Ti = { class: "p-tag p-tag-info" }, Bi = { class: "mbc__module" }, Mi = { class: "mbc__hint" }, Ai = { class: "mbc__mono" }, Oi = { class: "mbc__hint mbc__mono" }, Ri = {
|
|
1470
1470
|
key: 3,
|
|
1471
1471
|
class: "mbc__panel mbc__panel--result"
|
|
1472
|
-
},
|
|
1472
|
+
}, Pi = { class: "mbc__summary" }, ji = { class: "mbc__chip is-ok" }, Li = {
|
|
1473
1473
|
key: 0,
|
|
1474
1474
|
class: "mbc__chip is-bad"
|
|
1475
|
-
},
|
|
1475
|
+
}, Ii = {
|
|
1476
1476
|
key: 1,
|
|
1477
1477
|
class: "mbc__chip is-bad"
|
|
1478
|
-
},
|
|
1478
|
+
}, Di = {
|
|
1479
1479
|
key: 2,
|
|
1480
1480
|
class: "mbc__hint"
|
|
1481
|
-
},
|
|
1481
|
+
}, Ni = { class: "mbc__actions" }, Fi = { class: "mbc__foot" }, Ui = ["title"], zi = {
|
|
1482
1482
|
key: 1,
|
|
1483
1483
|
class: "mbc__error"
|
|
1484
|
-
},
|
|
1484
|
+
}, Hi = {
|
|
1485
1485
|
key: 2,
|
|
1486
1486
|
class: "mbc__notice"
|
|
1487
|
-
},
|
|
1487
|
+
}, Ki = {
|
|
1488
1488
|
key: 3,
|
|
1489
1489
|
class: "mbc__hint mbc__foot-idle"
|
|
1490
|
-
},
|
|
1490
|
+
}, qi = { class: "mbc__modal-box" }, Vi = { class: "mbc__modal-head" }, Ji = { class: "mbc__modal-body" }, Wi = {
|
|
1491
1491
|
key: 0,
|
|
1492
1492
|
class: "mbc__issues-group"
|
|
1493
|
-
},
|
|
1493
|
+
}, Gi = { class: "mbc__title" }, Yi = { class: "mbc__failures" }, Zi = {
|
|
1494
1494
|
key: 1,
|
|
1495
1495
|
class: "mbc__issues-group"
|
|
1496
|
-
},
|
|
1496
|
+
}, Xi = { class: "mbc__title" }, Qi = { class: "mbc__failures" }, tc = { class: "mbc__kind" }, ec = { class: "mbc__mono" }, nc = {
|
|
1497
1497
|
key: 2,
|
|
1498
1498
|
class: "mbc__issues-group"
|
|
1499
|
-
},
|
|
1499
|
+
}, sc = { class: "mbc__title" }, oc = { class: "mbc__failures" }, lc = { class: "mbc__mono" }, ac = {
|
|
1500
1500
|
key: 3,
|
|
1501
1501
|
class: "mbc__issues-group"
|
|
1502
|
-
},
|
|
1502
|
+
}, ic = { class: "mbc__title" }, cc = { class: "mbc__failures" }, uc = { key: 0 }, rc = {
|
|
1503
1503
|
key: 1,
|
|
1504
1504
|
class: "mbc__failures mbc__failures--nested"
|
|
1505
|
-
},
|
|
1505
|
+
}, dc = {
|
|
1506
1506
|
key: 4,
|
|
1507
1507
|
class: "mbc__hint"
|
|
1508
|
-
},
|
|
1508
|
+
}, pc = { class: "mbc__modal-foot" }, fc = { class: "mbc__modal-box" }, bc = { class: "mbc__modal-head" }, mc = { class: "mbc__modal-body" }, vc = { class: "mbc__reports" }, hc = { class: "mbc__report-head" }, _c = { class: "mbc__mono" }, gc = { class: "mbc__report-text" }, yc = {
|
|
1509
1509
|
key: 0,
|
|
1510
1510
|
class: "mbc__hint"
|
|
1511
|
-
},
|
|
1511
|
+
}, kc = { class: "mbc__modal-foot" }, Se = 2, $c = 100, wc = 250, xc = /* @__PURE__ */ Le({
|
|
1512
1512
|
__name: "MagicBlockConsole",
|
|
1513
1513
|
setup(o) {
|
|
1514
1514
|
const s = {
|
|
@@ -1519,7 +1519,7 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
|
|
|
1519
1519
|
两种情形共用它(前端声明了、手里却还没有那个文件夹 / 手里那个文件夹的清单 id 库里没有)
|
|
1520
1520
|
—— 对用户是同一件事:这个块不在库里。 */
|
|
1521
1521
|
"not-in-db": "不在数据库"
|
|
1522
|
-
},
|
|
1522
|
+
}, a = s["not-in-db"], { isStaff: i } = gn(), c = _n(), { active: m } = ws(), b = (n) => !yn(n, c), r = x(!1), h = x(""), v = x([]), g = x(""), _ = x(""), y = x(""), S = x([]), A = x(!1), C = x(!1), O = x("blocks"), P = x(""), U = x([]), Z = x(""), X = x(""), yt = x(""), kt = x(""), E = x(!1), It = x(!1), ct = x(!1), $t = x(!1), st = x(!1), q = x(null), z = x(null), Q = x("one"), wt = x(qt()), bt = j(() => v.value.find((n) => n.id === wt.value) ?? null), xt = () => Q.value === "all" ? {} : { blocks: [wt.value] };
|
|
1523
1523
|
function Kt(n) {
|
|
1524
1524
|
wt.value = n;
|
|
1525
1525
|
try {
|
|
@@ -1537,8 +1537,8 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
|
|
|
1537
1537
|
Pt(v, (n) => {
|
|
1538
1538
|
n.length !== 0 && (n.some((t) => t.id === wt.value) || Kt(n[0].id));
|
|
1539
1539
|
});
|
|
1540
|
-
const tt = x(null), V = x(""), R = x(null),
|
|
1541
|
-
async function
|
|
1540
|
+
const tt = x(null), V = x(""), R = x(null), ut = x({}), G = x([]), Y = x([]), ot = x({}), w = x(""), T = x(null);
|
|
1541
|
+
async function D(n) {
|
|
1542
1542
|
w.value = n;
|
|
1543
1543
|
try {
|
|
1544
1544
|
const t = await at(`/magic-blocks/${encodeURIComponent(n)}/versions`);
|
|
@@ -1560,204 +1560,231 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
|
|
|
1560
1560
|
function Nt(n, t) {
|
|
1561
1561
|
return `${String(t || "").replace(/[\\/:*?"<>|]/g, "").trim() || "block"}-${n}`;
|
|
1562
1562
|
}
|
|
1563
|
-
const
|
|
1563
|
+
const le = (n) => W(async () => {
|
|
1564
1564
|
const t = Nt(n.id, n.name || n.module);
|
|
1565
|
-
let e = q.value,
|
|
1565
|
+
let e = q.value, u = null;
|
|
1566
1566
|
if (e)
|
|
1567
1567
|
try {
|
|
1568
|
-
|
|
1568
|
+
u = await Ee(e, tt.value ?? await me());
|
|
1569
1569
|
} catch {
|
|
1570
|
-
e = null,
|
|
1570
|
+
e = null, u = null;
|
|
1571
1571
|
}
|
|
1572
|
-
H.value = { row: n, target: e, folder: t, inventory:
|
|
1573
|
-
},
|
|
1572
|
+
H.value = { row: n, target: e, folder: t, inventory: u };
|
|
1573
|
+
}, E), ae = () => W(async () => {
|
|
1574
1574
|
const n = H.value;
|
|
1575
1575
|
if (H.value = null, !n) return;
|
|
1576
1576
|
const t = `「${n.row.module} / ${n.row.name || n.row.id}」`;
|
|
1577
|
-
|
|
1577
|
+
Fe(), F.value = { active: !0, percent: 0, stage: "清本机那个文件夹…", failed: !1 };
|
|
1578
1578
|
let e = "";
|
|
1579
1579
|
if (n.target)
|
|
1580
1580
|
try {
|
|
1581
|
-
const
|
|
1582
|
-
e = `清掉了本机「${n.target.name}/${n.folder}」里的 ${
|
|
1583
|
-
} catch (
|
|
1584
|
-
e = `本机那份没清成(${Rt(
|
|
1581
|
+
const u = await ie(n.target, n.folder), M = await Fo(u);
|
|
1582
|
+
e = `清掉了本机「${n.target.name}/${n.folder}」里的 ${M} 项`;
|
|
1583
|
+
} catch (u) {
|
|
1584
|
+
e = `本机那份没清成(${Rt(u)})`;
|
|
1585
1585
|
}
|
|
1586
1586
|
else
|
|
1587
1587
|
e = "没选开发目录 ⇒ 本机那份没动";
|
|
1588
1588
|
lt(60, "清库里那份代码…");
|
|
1589
1589
|
try {
|
|
1590
1590
|
await at(`/magic-blocks/${n.row.id}`, { method: "DELETE" });
|
|
1591
|
-
} catch (
|
|
1592
|
-
throw Ct(!1, "本机清了,但库里那份代码没清成"), new Error(`${e};但**库里那份代码没清成**(${Rt(
|
|
1591
|
+
} catch (u) {
|
|
1592
|
+
throw Ct(!1, "本机清了,但库里那份代码没清成"), new Error(`${e};但**库里那份代码没清成**(${Rt(u)})—— 再点一次「删除代码文件」`);
|
|
1593
1593
|
}
|
|
1594
|
-
await
|
|
1595
|
-
},
|
|
1596
|
-
async function
|
|
1594
|
+
await St(), V.value = `${t}的代码文件已删除:${e};库里那一份也清空了 ——**块还在**(页面上会显示成占位框)。想找回来:上面「块」那一屏点开这一块 → 版本史 → 对上一版点「切回」`, y.value = `删掉了${t}的代码文件(块本身还在)`, Ct(!0, "完成");
|
|
1595
|
+
}, E);
|
|
1596
|
+
async function ie(n, t) {
|
|
1597
1597
|
let e = n.handle;
|
|
1598
|
-
for (const
|
|
1599
|
-
e = await e.getDirectoryHandle(
|
|
1598
|
+
for (const u of De(t))
|
|
1599
|
+
e = await e.getDirectoryHandle(u, { create: !0 });
|
|
1600
1600
|
return { handle: e, name: `${n.name}/${t}` };
|
|
1601
1601
|
}
|
|
1602
|
-
const J = x(null), Vt = x(!1), F = x({ active: !1, percent: 0, stage: "", failed: !1 }),
|
|
1602
|
+
const J = x(null), Vt = x(!1), F = x({ active: !1, percent: 0, stage: "", failed: !1 }), Nn = j(() => ({
|
|
1603
1603
|
width: `${Math.max(0, Math.min(100, F.value.percent))}%`,
|
|
1604
1604
|
background: F.value.failed ? "var(--sp-color-danger)" : "var(--sp-color-primary, var(--primary-color))"
|
|
1605
1605
|
}));
|
|
1606
|
-
let
|
|
1606
|
+
let ce = [], Ne = 0;
|
|
1607
1607
|
function ue(n = !1) {
|
|
1608
|
-
if (!(!n && performance.now() -
|
|
1609
|
-
|
|
1608
|
+
if (!(!n && performance.now() - Ne < wc)) {
|
|
1609
|
+
Ne = performance.now();
|
|
1610
1610
|
try {
|
|
1611
|
-
window.localStorage.setItem("mb:progress", JSON.stringify(
|
|
1611
|
+
window.localStorage.setItem("mb:progress", JSON.stringify(ce));
|
|
1612
1612
|
} catch {
|
|
1613
1613
|
}
|
|
1614
1614
|
}
|
|
1615
1615
|
}
|
|
1616
1616
|
function lt(n, t) {
|
|
1617
|
-
F.value = { active: !0, percent: Math.max(F.value.percent, n), stage: t, failed: !1 },
|
|
1617
|
+
F.value = { active: !0, percent: Math.max(F.value.percent, n), stage: t, failed: !1 }, ce.push({ p: F.value.percent, s: t, t: Math.round(performance.now()) }), ue();
|
|
1618
1618
|
}
|
|
1619
1619
|
function Ct(n, t) {
|
|
1620
1620
|
lt(n ? 100 : F.value.percent, t), F.value = { active: !n, percent: n ? 100 : F.value.percent, stage: t, failed: !n }, ue(!0);
|
|
1621
1621
|
}
|
|
1622
|
-
function
|
|
1623
|
-
|
|
1622
|
+
function Fe() {
|
|
1623
|
+
ce = [], ue(!0);
|
|
1624
1624
|
}
|
|
1625
|
-
const
|
|
1626
|
-
function
|
|
1627
|
-
|
|
1625
|
+
const Ue = (n) => (n.disabledReason ?? "").trim(), re = (n) => (n.issues ?? []).map((t) => String(t?.message ?? "")).filter(Boolean), Jt = (n) => co(n.id);
|
|
1626
|
+
function Fn(n) {
|
|
1627
|
+
g.value = g.value === n.id ? "" : n.id, g.value === n.id && D(n.id);
|
|
1628
1628
|
const t = m.value;
|
|
1629
|
-
|
|
1630
|
-
const e = n.name || n.id,
|
|
1631
|
-
if (
|
|
1629
|
+
An(n.id);
|
|
1630
|
+
const e = n.name || n.id, u = Jt(n);
|
|
1631
|
+
if (u.length === 0) {
|
|
1632
1632
|
y.value = `「${e}」这次会话里还没在哪条标签上露过面:先打开挂着它的那一页,再点一次`;
|
|
1633
1633
|
return;
|
|
1634
1634
|
}
|
|
1635
|
-
if (
|
|
1636
|
-
y.value = `「${e}」就在这一条标签上(${
|
|
1635
|
+
if (u.includes(t)) {
|
|
1636
|
+
y.value = `「${e}」就在这一条标签上(${u.join(" / ")}):已经把它标红`;
|
|
1637
1637
|
return;
|
|
1638
1638
|
}
|
|
1639
|
-
const
|
|
1640
|
-
if (
|
|
1641
|
-
y.value = `「${e}」不在这一条标签上:正在切到 ${
|
|
1639
|
+
const M = uo(n.id, t, b);
|
|
1640
|
+
if (M) {
|
|
1641
|
+
y.value = `「${e}」不在这一条标签上:正在切到 ${M} 那条标签`, Me(M);
|
|
1642
1642
|
return;
|
|
1643
1643
|
}
|
|
1644
|
-
y.value = `「${e}」只挂在带参数的实例标签上(${
|
|
1644
|
+
y.value = `「${e}」只挂在带参数的实例标签上(${u.join(" / ")}):不替你挑一单 —— 自己打开要看的那一页再点`;
|
|
1645
1645
|
}
|
|
1646
|
-
const
|
|
1646
|
+
const Un = (n, t) => W(async () => {
|
|
1647
1647
|
const e = await at(
|
|
1648
1648
|
`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`
|
|
1649
1649
|
);
|
|
1650
1650
|
T.value = { id: n.id, number: t, files: e.files ?? {} }, y.value = `正在看「${n.name || n.id}」的 v${t}(只读:不会改库里任何东西)`;
|
|
1651
|
-
},
|
|
1651
|
+
}, E), zn = (n, t) => W(async () => {
|
|
1652
1652
|
window.confirm(`把「${n.name || n.id}」切回 v${t}?
|
|
1653
1653
|
|
|
1654
|
-
这会把那一版的代码变成**当前版**,并且记成一个**新版本**(号继续 +1):历史只追加,旧版本一个都不会没。`) && (await
|
|
1655
|
-
},
|
|
1654
|
+
这会把那一版的代码变成**当前版**,并且记成一个**新版本**(号继续 +1):历史只追加,旧版本一个都不会没。`) && (await Et(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { updatedBy: "" }), y.value = `「${n.name || n.id}」已切回 v${t}(并记成了一个新版本)`, await St(), await D(n.id));
|
|
1655
|
+
}, E), Hn = (n, t) => W(async () => {
|
|
1656
1656
|
window.confirm(`删掉「${n.name || n.id}」的 v${t}?
|
|
1657
1657
|
|
|
1658
|
-
这一版的代码就找不回来了(别的版本不受影响)。`) && (await at(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { method: "DELETE" }), y.value = `删掉了「${n.name || n.id}」的 v${t}`, await
|
|
1659
|
-
},
|
|
1658
|
+
这一版的代码就找不回来了(别的版本不受影响)。`) && (await at(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { method: "DELETE" }), y.value = `删掉了「${n.name || n.id}」的 v${t}`, await D(n.id));
|
|
1659
|
+
}, E), Kn = (n, t) => W(async () => {
|
|
1660
1660
|
const e = await fetch(
|
|
1661
|
-
`${
|
|
1662
|
-
{ credentials: "include", headers:
|
|
1661
|
+
`${Be}/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}?download=1`,
|
|
1662
|
+
{ credentials: "include", headers: se("GET", !1) }
|
|
1663
1663
|
);
|
|
1664
1664
|
if (!e.ok) throw new Error(`下载失败(HTTP ${e.status})`);
|
|
1665
|
-
const
|
|
1665
|
+
const u = await e.blob(), M = URL.createObjectURL(u);
|
|
1666
1666
|
try {
|
|
1667
|
-
const
|
|
1668
|
-
|
|
1667
|
+
const N = document.createElement("a");
|
|
1668
|
+
N.href = M, N.download = `magic-block-${n.name || n.id}-v${t}.zip`, document.body.appendChild(N), N.click(), N.remove();
|
|
1669
1669
|
} finally {
|
|
1670
|
-
setTimeout(() => URL.revokeObjectURL(
|
|
1670
|
+
setTimeout(() => URL.revokeObjectURL(M), 0);
|
|
1671
1671
|
}
|
|
1672
1672
|
y.value = `已下载「${n.name || n.id}」的 v${t}`;
|
|
1673
|
-
},
|
|
1674
|
-
function
|
|
1673
|
+
}, E);
|
|
1674
|
+
function qn(n) {
|
|
1675
1675
|
Z.value = n.id, X.value = (n.tags ?? []).join(", ");
|
|
1676
1676
|
}
|
|
1677
|
-
const
|
|
1678
|
-
const t = X.value.split(/[,,\s]+/).map((
|
|
1679
|
-
Z.value = "", y.value = `「${n.name || n.id}」的标签已存:${(e.tags ?? []).join(" / ") || "(一个都不剩)"}`, await
|
|
1680
|
-
},
|
|
1681
|
-
const t = await
|
|
1682
|
-
yt.value = "", y.value = `「${n.name || n.id}」的详情已存${(t.detail ?? "").trim() ? "" : "(清掉了)"};下次导出会写进它的 magic-block.open.yaml`, await
|
|
1683
|
-
},
|
|
1684
|
-
function
|
|
1677
|
+
const ze = (n) => W(async () => {
|
|
1678
|
+
const t = X.value.split(/[,,\s]+/).map((u) => u.trim()).filter(Boolean), e = await Et(`/magic-blocks/${encodeURIComponent(n.id)}/tags`, { tags: t });
|
|
1679
|
+
Z.value = "", y.value = `「${n.name || n.id}」的标签已存:${(e.tags ?? []).join(" / ") || "(一个都不剩)"}`, await St();
|
|
1680
|
+
}, E, "存标签"), Vn = (n) => W(async () => {
|
|
1681
|
+
const t = await Et(`/magic-blocks/${encodeURIComponent(n.id)}/detail`, { detail: kt.value });
|
|
1682
|
+
yt.value = "", y.value = `「${n.name || n.id}」的详情已存${(t.detail ?? "").trim() ? "" : "(清掉了)"};下次导出会写进它的 magic-block.open.yaml`, await St();
|
|
1683
|
+
}, E, "存详情");
|
|
1684
|
+
function Jn(n) {
|
|
1685
1685
|
yt.value = n.id, kt.value = (n.detail ?? "").trim();
|
|
1686
1686
|
}
|
|
1687
|
-
function
|
|
1687
|
+
function Wn(n) {
|
|
1688
1688
|
const t = X.value.split(/[,,\s]+/).map((e) => e.trim()).filter(Boolean);
|
|
1689
1689
|
t.some((e) => e.toLowerCase() === n.toLowerCase()) || t.push(n), X.value = t.join(", ");
|
|
1690
1690
|
}
|
|
1691
|
-
function
|
|
1691
|
+
function Gn(n) {
|
|
1692
1692
|
X.value = X.value.split(/[,,\s]+/).map((t) => t.trim()).filter((t) => t && t.toLowerCase() !== n.toLowerCase()).join(", ");
|
|
1693
1693
|
}
|
|
1694
|
-
function
|
|
1694
|
+
function Yn(n) {
|
|
1695
1695
|
const t = P.value.trim().toLowerCase();
|
|
1696
1696
|
return t ? (n.tags ?? []).some((e) => e.toLowerCase().includes(t)) : !0;
|
|
1697
1697
|
}
|
|
1698
|
-
function
|
|
1699
|
-
const t =
|
|
1700
|
-
return
|
|
1698
|
+
function Wt(n) {
|
|
1699
|
+
const t = n.code;
|
|
1700
|
+
return t && typeof t.total == "number" ? t : null;
|
|
1701
|
+
}
|
|
1702
|
+
function He(n) {
|
|
1703
|
+
const t = Wt(n);
|
|
1704
|
+
return t ? `${t.total} 行` : "";
|
|
1705
|
+
}
|
|
1706
|
+
function Ke(n) {
|
|
1707
|
+
const t = Wt(n);
|
|
1708
|
+
return t && t.nonEffective > 0 ? `另有 ${t.nonEffective} 行不生效` : "";
|
|
1709
|
+
}
|
|
1710
|
+
function qe(n) {
|
|
1711
|
+
const t = Wt(n);
|
|
1712
|
+
if (!t) return "";
|
|
1713
|
+
const e = [
|
|
1714
|
+
`生效代码 ${t.total} 行 · ${t.files} 个文件(含注释与空行)`,
|
|
1715
|
+
"“生效”= 会被平台执行的那些文件;路径里任一段以 _ 开头的不算。.md / .txt / .svg 也不算。"
|
|
1716
|
+
];
|
|
1717
|
+
for (const u of t.byFile) e.push(`${String(u.lines).padStart(5, " ")} ${u.name}`);
|
|
1718
|
+
if (t.byFile.length === 0 && e.push("(这一块还没有生效的代码文件)"), t.nonEffective > 0) {
|
|
1719
|
+
e.push(""), e.push(`不生效 ${t.nonEffective} 行 · ${t.nonEffectiveFiles.length} 个文件(照样进库、存进版本史,但执行时被忽略)`);
|
|
1720
|
+
for (const u of t.nonEffectiveFiles) e.push(`${String(u.lines).padStart(5, " ")} ${u.name}`);
|
|
1721
|
+
}
|
|
1722
|
+
return e.join(`
|
|
1723
|
+
`);
|
|
1724
|
+
}
|
|
1725
|
+
function Zn(n) {
|
|
1726
|
+
const t = Jt(n), e = t.length === 0 ? "点一下:这次会话里它还没在哪条标签上露过面" : `点一下:把「${n.name || n.id}」标红,并在需要时切到挂着它的标签(${t.join(" / ")})`, u = Ue(n);
|
|
1727
|
+
return u ? `${u}
|
|
1701
1728
|
${e}` : e;
|
|
1702
1729
|
}
|
|
1703
|
-
const
|
|
1730
|
+
const Ve = j(() => {
|
|
1704
1731
|
const n = h.value.trim().toLowerCase();
|
|
1705
|
-
return v.value.filter((t) =>
|
|
1706
|
-
}),
|
|
1707
|
-
function
|
|
1732
|
+
return v.value.filter((t) => Yn(t) ? n ? `${t.module} ${t.name} ${t.brief} ${t.detail ?? ""} ${t.id} v${t.version ?? ""} ${(t.tags ?? []).join(" ")}`.toLowerCase().includes(n) : !0 : !1);
|
|
1733
|
+
}), Gt = j(() => (R.value?.blocks ?? []).filter((n) => n.canApply)), Yt = j(() => Gt.value.filter((n) => ut.value[n.id] === !0)), Ot = x(!1), dt = j(() => G.value.length + (R.value?.failures ?? []).length + Y.value.filter((n) => !n.ok).length), Ft = j(() => Y.value.filter((n) => !n.ok)), de = j(() => Y.value.filter((n) => n.ok).length), pe = j(() => v.value.filter((n) => n.enabled === !1).length);
|
|
1734
|
+
function Xn() {
|
|
1708
1735
|
const n = /* @__PURE__ */ new Set(), t = [];
|
|
1709
|
-
for (const e of
|
|
1710
|
-
const
|
|
1711
|
-
if (!
|
|
1712
|
-
n.add(
|
|
1713
|
-
const
|
|
1736
|
+
for (const e of Je()) {
|
|
1737
|
+
const u = typeof e?.path == "string" ? e.path.trim() : "";
|
|
1738
|
+
if (!u || n.has(u) || u.includes(":") || u.includes("*") || e.redirect || !e.components?.default || e.meta?.tab === !1) continue;
|
|
1739
|
+
n.add(u);
|
|
1740
|
+
const M = e.meta?.title ?? e.meta?.sub, N = e.meta?.group;
|
|
1714
1741
|
t.push({
|
|
1715
|
-
path:
|
|
1716
|
-
title: typeof
|
|
1717
|
-
group: typeof
|
|
1742
|
+
path: u,
|
|
1743
|
+
title: typeof M == "string" && M.trim() ? M.trim() : u,
|
|
1744
|
+
group: typeof N == "string" ? N.trim() : ""
|
|
1718
1745
|
});
|
|
1719
1746
|
}
|
|
1720
1747
|
return t;
|
|
1721
1748
|
}
|
|
1722
|
-
function
|
|
1723
|
-
return
|
|
1749
|
+
function Je() {
|
|
1750
|
+
return c?.getRoutes?.() ?? [];
|
|
1724
1751
|
}
|
|
1725
|
-
const
|
|
1752
|
+
const fe = j(() => Co(Je(), Pn, v.value.map((n) => n.id)));
|
|
1726
1753
|
function Rt(n) {
|
|
1727
1754
|
return (n instanceof Error ? n.message.trim() : String(n)) || "请求没有到达后端(网络或登录态的问题),请重试";
|
|
1728
1755
|
}
|
|
1729
|
-
function
|
|
1756
|
+
function Qn(n) {
|
|
1730
1757
|
const t = n?.issues;
|
|
1731
1758
|
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : String(e?.message ?? "")).filter(Boolean) : [];
|
|
1732
1759
|
}
|
|
1733
|
-
async function
|
|
1760
|
+
async function Et(n, t) {
|
|
1734
1761
|
const e = JSON.stringify(t);
|
|
1735
1762
|
try {
|
|
1736
1763
|
return await at(n, { method: "POST", body: e });
|
|
1737
|
-
} catch (
|
|
1738
|
-
const
|
|
1764
|
+
} catch (u) {
|
|
1765
|
+
const M = Rt(u), N = await fetch(`${Be}${n}`, {
|
|
1739
1766
|
method: "POST",
|
|
1740
1767
|
credentials: "include",
|
|
1741
|
-
headers: { "Content-Type": "application/json", ...
|
|
1768
|
+
headers: { "Content-Type": "application/json", ...se("POST", !0) },
|
|
1742
1769
|
body: e
|
|
1743
|
-
}).then((mt) => mt.json()).catch(() => null), L =
|
|
1744
|
-
throw L.length === 0 ? new Error(
|
|
1770
|
+
}).then((mt) => mt.json()).catch(() => null), L = Qn(N);
|
|
1771
|
+
throw L.length === 0 ? new Error(M) : new Error(`${String(N?.message ?? M)}
|
|
1745
1772
|
- ${L.join(`
|
|
1746
1773
|
- `)}`);
|
|
1747
1774
|
}
|
|
1748
1775
|
}
|
|
1749
|
-
async function
|
|
1750
|
-
const n =
|
|
1776
|
+
async function ts() {
|
|
1777
|
+
const n = S.value.map((t) => `[${t.at}] ${t.where}
|
|
1751
1778
|
${t.text}`).join(`
|
|
1752
1779
|
|
|
1753
1780
|
`);
|
|
1754
1781
|
try {
|
|
1755
|
-
await navigator.clipboard.writeText(n), y.value = `已复制 ${
|
|
1782
|
+
await navigator.clipboard.writeText(n), y.value = `已复制 ${S.value.length} 条报错`;
|
|
1756
1783
|
} catch (t) {
|
|
1757
1784
|
Ut(t, "复制报错");
|
|
1758
1785
|
}
|
|
1759
1786
|
}
|
|
1760
|
-
function
|
|
1787
|
+
function es() {
|
|
1761
1788
|
const n = [];
|
|
1762
1789
|
G.value.length > 0 && n.push("【前端校验拦下的】", ...G.value.map((t) => `- ${t}`), "");
|
|
1763
1790
|
for (const t of R.value?.failures ?? [])
|
|
@@ -1772,21 +1799,21 @@ ${t.text}`).join(`
|
|
|
1772
1799
|
return n.join(`
|
|
1773
1800
|
`).trim() || "这一趟没有问题。";
|
|
1774
1801
|
}
|
|
1775
|
-
async function
|
|
1802
|
+
async function ns() {
|
|
1776
1803
|
try {
|
|
1777
|
-
await navigator.clipboard.writeText(
|
|
1804
|
+
await navigator.clipboard.writeText(es()), y.value = `已复制这一趟的 ${dt.value} 条问题`;
|
|
1778
1805
|
} catch (n) {
|
|
1779
1806
|
Ut(n, "复制问题");
|
|
1780
1807
|
}
|
|
1781
1808
|
}
|
|
1782
1809
|
function Ut(n, t) {
|
|
1783
1810
|
const e = Rt(n);
|
|
1784
|
-
|
|
1811
|
+
_.value = e, S.value = [...S.value, { at: (/* @__PURE__ */ new Date()).toLocaleTimeString(), where: t, text: e }];
|
|
1785
1812
|
}
|
|
1786
|
-
function
|
|
1787
|
-
|
|
1813
|
+
function be() {
|
|
1814
|
+
_.value = "", S.value = [];
|
|
1788
1815
|
}
|
|
1789
|
-
async function
|
|
1816
|
+
async function St() {
|
|
1790
1817
|
try {
|
|
1791
1818
|
const n = await at("/magic-blocks/index");
|
|
1792
1819
|
v.value = n.blocks ?? [], U.value = n.tags ?? [];
|
|
@@ -1795,240 +1822,240 @@ ${t.text}`).join(`
|
|
|
1795
1822
|
}
|
|
1796
1823
|
}
|
|
1797
1824
|
async function W(n, t, e = "") {
|
|
1798
|
-
t.value = !0,
|
|
1825
|
+
t.value = !0, be();
|
|
1799
1826
|
try {
|
|
1800
|
-
await n(),
|
|
1801
|
-
} catch (
|
|
1802
|
-
Ut(
|
|
1827
|
+
await n(), eo();
|
|
1828
|
+
} catch (u) {
|
|
1829
|
+
Ut(u, e || "这个动作");
|
|
1803
1830
|
} finally {
|
|
1804
1831
|
t.value = !1;
|
|
1805
1832
|
}
|
|
1806
1833
|
}
|
|
1807
|
-
const
|
|
1834
|
+
const ss = () => W(async () => {
|
|
1808
1835
|
It.value = !0;
|
|
1809
1836
|
try {
|
|
1810
|
-
await at("/magic-blocks/check", { method: "POST", body: JSON.stringify({}) }), y.value = "全部魔法块重新校验完了", await
|
|
1837
|
+
await at("/magic-blocks/check", { method: "POST", body: JSON.stringify({}) }), y.value = "全部魔法块重新校验完了", await St();
|
|
1811
1838
|
} finally {
|
|
1812
1839
|
It.value = !1;
|
|
1813
1840
|
}
|
|
1814
|
-
},
|
|
1815
|
-
const t = await
|
|
1841
|
+
}, E), We = (n) => W(async () => {
|
|
1842
|
+
const t = await Ce();
|
|
1816
1843
|
n === "export" ? (q.value = t, z.value || (z.value = t)) : (z.value = t, q.value || (q.value = t)), y.value = n === "export" ? `导出目录:${t.name}${z.value === t ? "(读回目录也填成它了)" : ""}` : `读回目录:${t.name}`;
|
|
1817
|
-
},
|
|
1818
|
-
async function
|
|
1844
|
+
}, E);
|
|
1845
|
+
async function me() {
|
|
1819
1846
|
if (tt.value) return tt.value;
|
|
1820
1847
|
const n = await at("/magic-blocks/rules");
|
|
1821
1848
|
return tt.value = n.rules, n.rules;
|
|
1822
1849
|
}
|
|
1823
|
-
const
|
|
1824
|
-
if (!
|
|
1850
|
+
const os = () => W(async () => {
|
|
1851
|
+
if (!jn()) throw new Error("这个浏览器没法直接写你本机的文件夹:请用 Chrome / Edge,并从 https 或 localhost 打开");
|
|
1825
1852
|
if (Q.value === "one" && !bt.value)
|
|
1826
1853
|
throw new Error("还没挑块:上面选「仅这一个块」时要先在下拉里挑一个块(或者把范围改成「全部块」)");
|
|
1827
|
-
|
|
1854
|
+
ct.value = !0, y.value = "", V.value = "", be(), Fe(), Zt.length = 0, F.value = { active: !0, percent: 0, stage: "准备…", failed: !1 };
|
|
1828
1855
|
try {
|
|
1829
|
-
const n = q.value ?? await
|
|
1856
|
+
const n = q.value ?? await Ce();
|
|
1830
1857
|
q.value = n, z.value || (z.value = n);
|
|
1831
|
-
const t =
|
|
1832
|
-
tt.value =
|
|
1833
|
-
const
|
|
1834
|
-
if (
|
|
1835
|
-
lt(5, "等你确认要不要先清空"), J.value = { target: n, inventory:
|
|
1858
|
+
const t = Et("/magic-blocks/export", xt()), e = ve(), u = tt.value ? Ee(n, tt.value) : null, M = await Tt("取包", t);
|
|
1859
|
+
tt.value = M.rules, Ho(n, M.rules);
|
|
1860
|
+
const N = u ? await Tt("数目录", u) : await Tt("数目录", Ee(n, M.rules));
|
|
1861
|
+
if (N.topCount > 0) {
|
|
1862
|
+
lt(5, "等你确认要不要先清空"), J.value = { target: n, inventory: N };
|
|
1836
1863
|
return;
|
|
1837
1864
|
}
|
|
1838
|
-
await
|
|
1865
|
+
await he(n, M, { clean: !1, verify: !1, front: e });
|
|
1839
1866
|
} catch (n) {
|
|
1840
1867
|
throw Ct(!1, "导出失败"), n;
|
|
1841
1868
|
} finally {
|
|
1842
|
-
|
|
1869
|
+
ct.value = !1;
|
|
1843
1870
|
}
|
|
1844
|
-
},
|
|
1845
|
-
function
|
|
1846
|
-
|
|
1871
|
+
}, E), Ge = /* @__PURE__ */ new WeakMap(), Zt = [];
|
|
1872
|
+
function Ye(n, t) {
|
|
1873
|
+
Zt.push([n, Math.round(performance.now() - t)]);
|
|
1847
1874
|
}
|
|
1848
1875
|
async function Tt(n, t) {
|
|
1849
1876
|
const e = performance.now();
|
|
1850
1877
|
try {
|
|
1851
1878
|
return await t;
|
|
1852
1879
|
} finally {
|
|
1853
|
-
|
|
1880
|
+
Ye(n, e);
|
|
1854
1881
|
}
|
|
1855
1882
|
}
|
|
1856
|
-
function
|
|
1857
|
-
return
|
|
1883
|
+
function ls() {
|
|
1884
|
+
return Zt.length > 0 ? `;耗时:${Zt.map(([n, t]) => `${n} ${t}ms`).join(" · ")}` : "";
|
|
1858
1885
|
}
|
|
1859
|
-
function
|
|
1886
|
+
function ve() {
|
|
1860
1887
|
try {
|
|
1861
|
-
const n =
|
|
1888
|
+
const n = Mn();
|
|
1862
1889
|
return {
|
|
1863
1890
|
css: n.css,
|
|
1864
|
-
controls:
|
|
1891
|
+
controls: oo(),
|
|
1865
1892
|
note: n.skipped.length > 0 ? `;⚠️ 有 ${n.skipped.length} 张样式表读不到规则(跨源):${n.skipped.join(" / ")}` : ""
|
|
1866
1893
|
};
|
|
1867
1894
|
} catch (n) {
|
|
1868
1895
|
return { css: "", controls: "", note: `;主题 CSS 没收成(${Rt(n)}):${Bt} 没写,其余照旧` };
|
|
1869
1896
|
}
|
|
1870
1897
|
}
|
|
1871
|
-
async function
|
|
1872
|
-
const { clean:
|
|
1898
|
+
async function he(n, t, e) {
|
|
1899
|
+
const { clean: u, verify: M, thorough: N, front: L } = e;
|
|
1873
1900
|
try {
|
|
1874
1901
|
lt(20, "准备写盘…");
|
|
1875
|
-
const mt =
|
|
1876
|
-
pt[
|
|
1877
|
-
const
|
|
1902
|
+
const mt = Ro(Xn()), pt = { ...t.files };
|
|
1903
|
+
pt[xe] = mt, L.css && (pt[Bt] = L.css), L.controls && (pt[ne] = L.controls), t.exampleDir && (pt[`${t.exampleDir}/${xe}`] = mt, L.css && (pt[`${t.exampleDir}/${Bt}`] = L.css), L.controls && (pt[`${t.exampleDir}/${ne}`] = L.controls));
|
|
1904
|
+
const ds = L.note;
|
|
1878
1905
|
await new Promise((nt) => {
|
|
1879
1906
|
setTimeout(nt, 0);
|
|
1880
1907
|
});
|
|
1881
|
-
let
|
|
1882
|
-
if (
|
|
1908
|
+
let en = "", _e;
|
|
1909
|
+
if (u) {
|
|
1883
1910
|
lt(35, "清掉这一包不要的东西…");
|
|
1884
|
-
const nt = await Tt("清多余",
|
|
1885
|
-
|
|
1911
|
+
const nt = await Tt("清多余", Uo(n, pt));
|
|
1912
|
+
_e = nt.existing, en = nt.removed > 0 ? `,先清掉了 ${nt.removed} 项` : ",没有多余的东西要清";
|
|
1886
1913
|
} else
|
|
1887
|
-
lt(35, "看一眼目录里有什么…"),
|
|
1888
|
-
const
|
|
1889
|
-
lt(ge, `写文件 0/${
|
|
1890
|
-
let
|
|
1891
|
-
const
|
|
1892
|
-
const
|
|
1893
|
-
nt <
|
|
1914
|
+
lt(35, "看一眼目录里有什么…"), _e = await Tt("看目录", zo(n, pt));
|
|
1915
|
+
const ps = Ge.get(n.handle), fs = Object.keys(pt).length, ge = u ? 45 : 30;
|
|
1916
|
+
lt(ge, `写文件 0/${fs}…`);
|
|
1917
|
+
let nn = 0;
|
|
1918
|
+
const bs = performance.now(), et = await No(n, pt, (nt, ye) => {
|
|
1919
|
+
const sn = Date.now();
|
|
1920
|
+
nt < ye && sn - nn < $c || (nn = sn, lt(ge + Math.round(nt / Math.max(1, ye) * (95 - ge)), `写文件 ${nt}/${ye}…`));
|
|
1894
1921
|
}, {
|
|
1895
|
-
verify:
|
|
1922
|
+
verify: M,
|
|
1896
1923
|
// 🔴 账本:勾了「逐个核对磁盘」就不给它 —— 那样连上一趟铺过的也重新核对一遍。
|
|
1897
|
-
trust:
|
|
1898
|
-
existing:
|
|
1924
|
+
trust: N ? void 0 : ps,
|
|
1925
|
+
existing: _e
|
|
1899
1926
|
});
|
|
1900
|
-
|
|
1901
|
-
const
|
|
1902
|
-
et.skipped > 0 &&
|
|
1903
|
-
const
|
|
1904
|
-
V.value = `铺到「${n.name}」:${t.blocks} 个块、写了 ${et.written} 个文件${
|
|
1927
|
+
Ye("写盘", bs), Ge.set(n.handle, et.fingerprints), lt(98, "收尾…");
|
|
1928
|
+
const ms = et.failed.length > 0 ? `;⚠️ ${et.failed.length} 个文件没写成:${et.failed.slice(0, 3).map((nt) => `${nt.path}(${nt.message})`).join("、")}` + (et.failed.length > 3 ? ` 等 ${et.failed.length} 条` : "") : "", Xt = [];
|
|
1929
|
+
et.skipped > 0 && Xt.push(`${et.skipped} 个与库里一字不差(逐字节比过)`), et.trusted > 0 && Xt.push(`${et.trusted} 个按上一趟的账本跳过(没再碰磁盘)`);
|
|
1930
|
+
const vs = Xt.length > 0 ? `,跳过 ${Xt.join(" / ")}` : "";
|
|
1931
|
+
V.value = `铺到「${n.name}」:${t.blocks} 个块、写了 ${et.written} 个文件${vs}(含 ${xe} / ${Bt} / ${ne})${en}${ms}${ds}${ls()}`, y.value = et.failed.length > 0 ? "导出完了,但有文件没写成(见下面那句)" : "导出完了:用你自己的编辑器改,改完回这里「读回改动」", Ct(!0, "完成");
|
|
1905
1932
|
} catch (mt) {
|
|
1906
1933
|
throw Ct(!1, "导出中途失败(已经铺进去的文件不会自己删掉)"), mt;
|
|
1907
1934
|
}
|
|
1908
1935
|
}
|
|
1909
|
-
const
|
|
1936
|
+
const as = () => W(async () => {
|
|
1910
1937
|
const n = J.value;
|
|
1911
1938
|
if (J.value = null, !!n) {
|
|
1912
|
-
|
|
1939
|
+
ct.value = !0;
|
|
1913
1940
|
try {
|
|
1914
1941
|
lt(15, "重新取一份开发包…");
|
|
1915
|
-
const t =
|
|
1916
|
-
tt.value =
|
|
1942
|
+
const t = Et("/magic-blocks/export", xt()), e = ve(), u = await Tt("取包", t);
|
|
1943
|
+
tt.value = u.rules, await he(n.target, u, { clean: !0, verify: !0, thorough: Vt.value, front: e });
|
|
1917
1944
|
} catch (t) {
|
|
1918
1945
|
throw Ct(!1, "导出失败"), t;
|
|
1919
1946
|
} finally {
|
|
1920
|
-
|
|
1947
|
+
ct.value = !1;
|
|
1921
1948
|
}
|
|
1922
1949
|
}
|
|
1923
|
-
},
|
|
1950
|
+
}, E), is = () => W(async () => {
|
|
1924
1951
|
const n = J.value;
|
|
1925
1952
|
if (J.value = null, !!n) {
|
|
1926
|
-
|
|
1953
|
+
ct.value = !0;
|
|
1927
1954
|
try {
|
|
1928
1955
|
lt(15, "重新取一份开发包…");
|
|
1929
|
-
const t =
|
|
1930
|
-
tt.value =
|
|
1956
|
+
const t = Et("/magic-blocks/export", xt()), e = ve(), u = await Tt("取包", t);
|
|
1957
|
+
tt.value = u.rules, await he(n.target, u, { clean: !1, verify: !0, thorough: Vt.value, front: e });
|
|
1931
1958
|
} catch (t) {
|
|
1932
1959
|
throw Ct(!1, "导出失败"), t;
|
|
1933
1960
|
} finally {
|
|
1934
|
-
|
|
1961
|
+
ct.value = !1;
|
|
1935
1962
|
}
|
|
1936
1963
|
}
|
|
1937
|
-
},
|
|
1938
|
-
function
|
|
1964
|
+
}, E);
|
|
1965
|
+
function cs() {
|
|
1939
1966
|
J.value = null, F.value = { active: !1, percent: 0, stage: "", failed: !1 }, y.value = "这次没有导出(目录里的东西一个字节都没动)", V.value = "";
|
|
1940
1967
|
}
|
|
1941
|
-
const
|
|
1942
|
-
const n = z.value ?? await
|
|
1968
|
+
const Ze = () => W(async () => {
|
|
1969
|
+
const n = z.value ?? await Ce();
|
|
1943
1970
|
z.value = n, q.value || (q.value = n), $t.value = !0, y.value = "", G.value = [], Y.value = [];
|
|
1944
1971
|
try {
|
|
1945
|
-
const t = await
|
|
1972
|
+
const t = await me().catch((L) => {
|
|
1946
1973
|
throw new Error(`取不到扫描规则(GET /magic-blocks/rules):${Rt(L)}`);
|
|
1947
|
-
}), e = await
|
|
1974
|
+
}), e = await Jo(n, t), u = await at("/magic-blocks/read", {
|
|
1948
1975
|
method: "POST",
|
|
1949
1976
|
body: JSON.stringify({ ...e, includeMissing: !1 })
|
|
1950
1977
|
});
|
|
1951
|
-
R.value =
|
|
1952
|
-
const
|
|
1953
|
-
for (const L of
|
|
1954
|
-
|
|
1955
|
-
const
|
|
1956
|
-
y.value = `扫到 ${
|
|
1978
|
+
R.value = u;
|
|
1979
|
+
const M = {};
|
|
1980
|
+
for (const L of u.blocks ?? []) M[L.id] = L.status === "modified" && L.canApply;
|
|
1981
|
+
ut.value = M;
|
|
1982
|
+
const N = (u.blocks ?? []).reduce((L, mt) => ({ ...L, [mt.status]: (L[mt.status] ?? 0) + 1 }), {});
|
|
1983
|
+
y.value = `扫到 ${u.folders} 个文件夹、${u.files} 个文件:有改动 ${N.modified ?? 0} / 没改动 ${N.unchanged ?? 0}` + (u.complete ? "" : "(层数到了上限,没走完,可能还有块没扫到)");
|
|
1957
1984
|
} finally {
|
|
1958
1985
|
$t.value = !1;
|
|
1959
1986
|
}
|
|
1960
|
-
},
|
|
1961
|
-
const n =
|
|
1987
|
+
}, E), us = () => W(async () => {
|
|
1988
|
+
const n = Yt.value, t = qs(n);
|
|
1962
1989
|
if (G.value = t.issues, Y.value = [], t.issues.length > 0)
|
|
1963
1990
|
throw y.value = "", new Error(`前端校验没过(${t.issues.length} 条),没有发请求:
|
|
1964
1991
|
- ${t.issues.join(`
|
|
1965
1992
|
- `)}`);
|
|
1966
1993
|
st.value = !0, y.value = "";
|
|
1967
1994
|
try {
|
|
1968
|
-
const e = await
|
|
1969
|
-
Y.value = e.results ?? [], y.value = `保存:成功 ${e.saved} 个、失败 ${e.failed} 个`, await
|
|
1970
|
-
const
|
|
1971
|
-
await
|
|
1995
|
+
const e = await Et("/magic-blocks/import", { updatedBy: "", blocks: n });
|
|
1996
|
+
Y.value = e.results ?? [], y.value = `保存:成功 ${e.saved} 个、失败 ${e.failed} 个`, await St();
|
|
1997
|
+
const u = y.value;
|
|
1998
|
+
await Ze(), y.value = `${u};已重新读回该目录`;
|
|
1972
1999
|
} finally {
|
|
1973
2000
|
st.value = !1;
|
|
1974
2001
|
}
|
|
1975
|
-
},
|
|
1976
|
-
function
|
|
2002
|
+
}, E);
|
|
2003
|
+
function rs(n, t) {
|
|
1977
2004
|
const e = t.target;
|
|
1978
|
-
|
|
2005
|
+
ut.value[n] = e?.checked === !0;
|
|
1979
2006
|
}
|
|
1980
|
-
function
|
|
1981
|
-
const t = { ...
|
|
1982
|
-
for (const e of
|
|
1983
|
-
|
|
2007
|
+
function Xe(n) {
|
|
2008
|
+
const t = { ...ut.value };
|
|
2009
|
+
for (const e of Gt.value) t[e.id] = n;
|
|
2010
|
+
ut.value = t;
|
|
1984
2011
|
}
|
|
1985
|
-
function
|
|
2012
|
+
function Qe(n) {
|
|
1986
2013
|
const t = n.detail?.uuid ?? "";
|
|
1987
|
-
|
|
2014
|
+
r.value = !0, g.value = t;
|
|
1988
2015
|
}
|
|
1989
|
-
function
|
|
1990
|
-
n.key === "Escape" &&
|
|
2016
|
+
function tn(n) {
|
|
2017
|
+
n.key === "Escape" && r.value && (r.value = !1);
|
|
1991
2018
|
}
|
|
1992
|
-
return
|
|
1993
|
-
window.addEventListener("magic-block:open-console",
|
|
2019
|
+
return mn(() => {
|
|
2020
|
+
window.addEventListener("magic-block:open-console", Qe), window.addEventListener("keydown", tn), St(), me().catch(() => {
|
|
1994
2021
|
});
|
|
1995
|
-
}),
|
|
1996
|
-
window.removeEventListener("magic-block:open-console",
|
|
2022
|
+
}), vn(() => {
|
|
2023
|
+
window.removeEventListener("magic-block:open-console", Qe), window.removeEventListener("keydown", tn);
|
|
1997
2024
|
}), (n, t) => it(i) ? (d(), p("div", {
|
|
1998
2025
|
key: 0,
|
|
1999
2026
|
class: K(["mbc__shell", { "is-wide": C.value }])
|
|
2000
2027
|
}, [
|
|
2001
|
-
|
|
2028
|
+
l("button", {
|
|
2002
2029
|
class: "fab",
|
|
2003
2030
|
type: "button",
|
|
2004
2031
|
title: "magic block 控制台",
|
|
2005
|
-
onClick: t[0] || (t[0] = (e) =>
|
|
2032
|
+
onClick: t[0] || (t[0] = (e) => r.value = !0)
|
|
2006
2033
|
}, "块"),
|
|
2007
|
-
|
|
2034
|
+
r.value ? (d(), p("aside", {
|
|
2008
2035
|
key: 0,
|
|
2009
2036
|
class: K(["mbc", { "is-wide": C.value }])
|
|
2010
2037
|
}, [
|
|
2011
|
-
|
|
2012
|
-
t[43] || (t[43] =
|
|
2013
|
-
|
|
2038
|
+
l("header", Wo, [
|
|
2039
|
+
t[43] || (t[43] = l("strong", { class: "mbc__brand" }, "magic block", -1)),
|
|
2040
|
+
l("span", {
|
|
2014
2041
|
class: "mbc__count",
|
|
2015
2042
|
title: `库里一共 ${v.value.length} 个块`
|
|
2016
|
-
},
|
|
2017
|
-
t[44] || (t[44] =
|
|
2018
|
-
|
|
2043
|
+
}, f(v.value.length) + " 个块", 9, Go),
|
|
2044
|
+
t[44] || (t[44] = l("span", { class: "mbc__grow" }, null, -1)),
|
|
2045
|
+
l("button", {
|
|
2019
2046
|
class: "p-button p-button-sm p-button-text",
|
|
2020
2047
|
type: "button",
|
|
2021
2048
|
title: C.value ? "收起(回到右侧那条窄抽屉)" : "展开:整屏(块 / 工作区两个页签)",
|
|
2022
2049
|
onClick: t[1] || (t[1] = (e) => C.value = !C.value)
|
|
2023
|
-
},
|
|
2024
|
-
|
|
2050
|
+
}, f(C.value ? "收起" : "展开全屏"), 9, Yo),
|
|
2051
|
+
l("button", {
|
|
2025
2052
|
class: "p-button p-button-sm p-button-text",
|
|
2026
2053
|
type: "button",
|
|
2027
|
-
onClick: t[2] || (t[2] = (e) =>
|
|
2054
|
+
onClick: t[2] || (t[2] = (e) => r.value = !1)
|
|
2028
2055
|
}, "关闭")
|
|
2029
2056
|
]),
|
|
2030
|
-
|
|
2031
|
-
|
|
2057
|
+
l("div", Zo, [
|
|
2058
|
+
l("button", {
|
|
2032
2059
|
class: K(["mbc__tab", { "is-on": O.value === "blocks" }]),
|
|
2033
2060
|
type: "button",
|
|
2034
2061
|
role: "tab",
|
|
@@ -2036,14 +2063,14 @@ ${t.text}`).join(`
|
|
|
2036
2063
|
onClick: t[3] || (t[3] = (e) => O.value = "blocks")
|
|
2037
2064
|
}, [
|
|
2038
2065
|
t[45] || (t[45] = $(" 块 ", -1)),
|
|
2039
|
-
|
|
2040
|
-
|
|
2066
|
+
l("span", Qo, f(v.value.length), 1),
|
|
2067
|
+
pe.value > 0 ? (d(), p("span", {
|
|
2041
2068
|
key: 0,
|
|
2042
2069
|
class: "mbc__chip is-bad",
|
|
2043
|
-
title: `${
|
|
2044
|
-
},
|
|
2045
|
-
], 10,
|
|
2046
|
-
|
|
2070
|
+
title: `${pe.value} 个块被停用(体检没过)`
|
|
2071
|
+
}, f(pe.value) + " 停用", 9, tl)) : k("", !0)
|
|
2072
|
+
], 10, Xo),
|
|
2073
|
+
l("button", {
|
|
2047
2074
|
class: K(["mbc__tab", { "is-on": O.value === "workspace" }]),
|
|
2048
2075
|
type: "button",
|
|
2049
2076
|
role: "tab",
|
|
@@ -2055,146 +2082,146 @@ ${t.text}`).join(`
|
|
|
2055
2082
|
key: 0,
|
|
2056
2083
|
class: "mbc__chip is-bad",
|
|
2057
2084
|
title: `这一趟有 ${dt.value} 条问题`
|
|
2058
|
-
},
|
|
2059
|
-
], 10,
|
|
2085
|
+
}, f(dt.value), 9, nl)) : Y.value.length > 0 ? (d(), p("span", sl, f(de.value) + " 存成", 1)) : k("", !0)
|
|
2086
|
+
], 10, el)
|
|
2060
2087
|
]),
|
|
2061
|
-
|
|
2062
|
-
F.value.active ? (d(), p("div",
|
|
2063
|
-
|
|
2088
|
+
l("div", ol, [
|
|
2089
|
+
F.value.active ? (d(), p("div", ll, [
|
|
2090
|
+
l("div", {
|
|
2064
2091
|
class: K(["mbc__progress", { "is-failed": F.value.failed }]),
|
|
2065
2092
|
role: "progressbar",
|
|
2066
2093
|
"aria-valuenow": F.value.percent,
|
|
2067
2094
|
"aria-valuemin": "0",
|
|
2068
2095
|
"aria-valuemax": "100"
|
|
2069
2096
|
}, [
|
|
2070
|
-
|
|
2097
|
+
l("div", {
|
|
2071
2098
|
class: "mbc__progress-bar",
|
|
2072
|
-
style:
|
|
2099
|
+
style: hn(Nn.value)
|
|
2073
2100
|
}, null, 4)
|
|
2074
|
-
], 10,
|
|
2075
|
-
|
|
2101
|
+
], 10, al),
|
|
2102
|
+
l("p", {
|
|
2076
2103
|
class: K(["mbc__hint", { "mbc__progress-note": F.value.failed }])
|
|
2077
|
-
},
|
|
2104
|
+
}, f(F.value.failed ? "✗" : "") + " " + f(F.value.percent) + "% · " + f(F.value.stage), 3)
|
|
2078
2105
|
])) : k("", !0),
|
|
2079
|
-
J.value ? (d(), p("div",
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
t[47] || (t[47] =
|
|
2106
|
+
J.value ? (d(), p("div", il, [
|
|
2107
|
+
l("p", cl, "「" + f(J.value.target.name) + "」里现在有 " + f(J.value.inventory.dirs) + " 个文件夹 / " + f(J.value.inventory.files) + " 个文件", 1),
|
|
2108
|
+
l("p", ul, [
|
|
2109
|
+
t[47] || (t[47] = l("b", null, "只覆盖", -1)),
|
|
2083
2110
|
t[48] || (t[48] = $("(天天用这个):只把库里", -1)),
|
|
2084
|
-
t[49] || (t[49] =
|
|
2111
|
+
t[49] || (t[49] = l("b", null, "改过 / 缺了", -1)),
|
|
2085
2112
|
t[50] || (t[50] = $("的那些写下去 —— 上一趟铺过、 这一趟一字没变的**一概不碰**(所以很快;代价是你自己在编辑器里改过、还没读回库的那些 ", -1)),
|
|
2086
|
-
t[51] || (t[51] =
|
|
2113
|
+
t[51] || (t[51] = l("b", null, "会留着", -1)),
|
|
2087
2114
|
t[52] || (t[52] = $(")。 ", -1)),
|
|
2088
|
-
t[53] || (t[53] =
|
|
2115
|
+
t[53] || (t[53] = l("b", null, "清空并导出", -1)),
|
|
2089
2116
|
t[54] || (t[54] = $(":先删掉这一包没有的东西,其余同上。 两种都只动这个目录", -1)),
|
|
2090
|
-
t[55] || (t[55] =
|
|
2117
|
+
t[55] || (t[55] = l("b", null, "里面", -1)),
|
|
2091
2118
|
t[56] || (t[56] = $("的子项:目录本身、以及它外面的任何东西都不会被碰。", -1)),
|
|
2092
|
-
J.value.inventory.items.length > 0 ? (d(), p("span",
|
|
2119
|
+
J.value.inventory.items.length > 0 ? (d(), p("span", rl, "(" + f(J.value.inventory.items.slice(0, 6).map((e) => e.name).join(" / ")) + f(J.value.inventory.items.length > 6 ? " …" : "") + ")", 1)) : k("", !0)
|
|
2093
2120
|
]),
|
|
2094
|
-
|
|
2095
|
-
vt(
|
|
2121
|
+
l("label", dl, [
|
|
2122
|
+
vt(l("input", {
|
|
2096
2123
|
"onUpdate:modelValue": t[5] || (t[5] = (e) => Vt.value = e),
|
|
2097
2124
|
type: "checkbox"
|
|
2098
2125
|
}, null, 512), [
|
|
2099
|
-
[
|
|
2126
|
+
[gs, Vt.value]
|
|
2100
2127
|
]),
|
|
2101
|
-
t[57] || (t[57] =
|
|
2128
|
+
t[57] || (t[57] = l("span", null, [
|
|
2102
2129
|
$("逐个核对磁盘(慢):把上一趟铺过的也重新读一遍比对,"),
|
|
2103
|
-
|
|
2130
|
+
l("b", null, "你在编辑器里改过、还没读回库的那些会被库里的那份盖掉")
|
|
2104
2131
|
], -1))
|
|
2105
2132
|
]),
|
|
2106
|
-
|
|
2107
|
-
|
|
2133
|
+
l("div", pl, [
|
|
2134
|
+
l("button", {
|
|
2108
2135
|
class: "p-button p-button-sm",
|
|
2109
2136
|
type: "button",
|
|
2110
|
-
disabled:
|
|
2111
|
-
onClick: t[6] || (t[6] = (e) =>
|
|
2112
|
-
}, "清空并导出", 8,
|
|
2113
|
-
|
|
2137
|
+
disabled: E.value,
|
|
2138
|
+
onClick: t[6] || (t[6] = (e) => as())
|
|
2139
|
+
}, "清空并导出", 8, fl),
|
|
2140
|
+
l("button", {
|
|
2114
2141
|
class: "p-button p-button-sm p-button-outlined",
|
|
2115
2142
|
type: "button",
|
|
2116
|
-
disabled:
|
|
2117
|
-
onClick: t[7] || (t[7] = (e) =>
|
|
2118
|
-
}, "只覆盖", 8,
|
|
2119
|
-
|
|
2143
|
+
disabled: E.value,
|
|
2144
|
+
onClick: t[7] || (t[7] = (e) => is())
|
|
2145
|
+
}, "只覆盖", 8, bl),
|
|
2146
|
+
l("button", {
|
|
2120
2147
|
class: "p-button p-button-sm p-button-text",
|
|
2121
2148
|
type: "button",
|
|
2122
|
-
disabled:
|
|
2123
|
-
onClick: t[8] || (t[8] = (e) =>
|
|
2124
|
-
}, "取消", 8,
|
|
2149
|
+
disabled: E.value,
|
|
2150
|
+
onClick: t[8] || (t[8] = (e) => cs())
|
|
2151
|
+
}, "取消", 8, ml)
|
|
2125
2152
|
])
|
|
2126
2153
|
])) : k("", !0),
|
|
2127
|
-
H.value ? (d(), p("div",
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
t[66] || (t[66] =
|
|
2154
|
+
H.value ? (d(), p("div", vl, [
|
|
2155
|
+
l("p", hl, "删掉「" + f(H.value.row.module) + " / " + f(H.value.row.name || H.value.row.id) + "」的代码文件", 1),
|
|
2156
|
+
l("p", _l, [
|
|
2157
|
+
t[66] || (t[66] = l("b", null, "库里那一份代码正文会被清空", -1)),
|
|
2131
2158
|
t[67] || (t[67] = $("(入口 / 清单 / 后端一起); ", -1)),
|
|
2132
|
-
H.value.target ? (d(), p(
|
|
2159
|
+
H.value.target ? (d(), p(B, { key: 0 }, [
|
|
2133
2160
|
t[58] || (t[58] = $(" 同时清掉你本机那个块文件夹 ", -1)),
|
|
2134
|
-
|
|
2135
|
-
H.value.inventory && H.value.inventory.items.some((e) => e.name === H.value?.folder) ? (d(), p(
|
|
2161
|
+
l("span", gl, f(H.value.target.name) + "/" + f(H.value.folder), 1),
|
|
2162
|
+
H.value.inventory && H.value.inventory.items.some((e) => e.name === H.value?.folder) ? (d(), p(B, { key: 0 }, [
|
|
2136
2163
|
$(" (它现在在顶层,里面有东西:本次会先清空)。 ")
|
|
2137
2164
|
], 64)) : k("", !0),
|
|
2138
|
-
t[59] || (t[59] =
|
|
2165
|
+
t[59] || (t[59] = l("b", null, "只动这一个块的文件夹", -1)),
|
|
2139
2166
|
t[60] || (t[60] = $(":别的块、", -1)),
|
|
2140
|
-
t[61] || (t[61] =
|
|
2167
|
+
t[61] || (t[61] = l("span", { class: "mbc__mono" }, "example/", -1)),
|
|
2141
2168
|
t[62] || (t[62] = $("、以及目录外面的一切都不会被碰。 ", -1))
|
|
2142
|
-
], 64)) : (d(), p(
|
|
2169
|
+
], 64)) : (d(), p(B, { key: 1 }, [
|
|
2143
2170
|
t[63] || (t[63] = $(" 现在没有选中开发目录 / 或者读不到它,所以", -1)),
|
|
2144
|
-
t[64] || (t[64] =
|
|
2171
|
+
t[64] || (t[64] = l("b", null, "本机那份不动", -1)),
|
|
2145
2172
|
t[65] || (t[65] = $(",只清库里那份。 ", -1))
|
|
2146
2173
|
], 64)),
|
|
2147
|
-
t[68] || (t[68] =
|
|
2174
|
+
t[68] || (t[68] = l("br", null, null, -1)),
|
|
2148
2175
|
t[69] || (t[69] = $(" 🔴 ", -1)),
|
|
2149
|
-
t[70] || (t[70] =
|
|
2176
|
+
t[70] || (t[70] = l("b", null, "块本身留着", -1)),
|
|
2150
2177
|
t[71] || (t[71] = $('(这一行不动):页面上那块会显示成占位框,而不是"库里没有这个块"; 删错了也能救回来:展开这一块 → 版本史 → 「切回」删之前那一版。 ', -1))
|
|
2151
2178
|
]),
|
|
2152
|
-
|
|
2153
|
-
|
|
2179
|
+
l("div", yl, [
|
|
2180
|
+
l("button", {
|
|
2154
2181
|
class: "p-button p-button-sm",
|
|
2155
2182
|
type: "button",
|
|
2156
|
-
disabled:
|
|
2157
|
-
onClick: t[9] || (t[9] = (e) =>
|
|
2158
|
-
}, "确认删除代码文件", 8,
|
|
2159
|
-
|
|
2183
|
+
disabled: E.value,
|
|
2184
|
+
onClick: t[9] || (t[9] = (e) => ae())
|
|
2185
|
+
}, "确认删除代码文件", 8, kl),
|
|
2186
|
+
l("button", {
|
|
2160
2187
|
class: "p-button p-button-sm p-button-text",
|
|
2161
2188
|
type: "button",
|
|
2162
|
-
disabled:
|
|
2189
|
+
disabled: E.value,
|
|
2163
2190
|
onClick: t[10] || (t[10] = (e) => H.value = null)
|
|
2164
|
-
}, "取消", 8,
|
|
2191
|
+
}, "取消", 8, $l)
|
|
2165
2192
|
])
|
|
2166
2193
|
])) : k("", !0),
|
|
2167
|
-
vt(
|
|
2168
|
-
|
|
2194
|
+
vt(l("section", wl, [
|
|
2195
|
+
l("h3", xl, [
|
|
2169
2196
|
t[72] || (t[72] = $(" 库里的块 ", -1)),
|
|
2170
|
-
|
|
2171
|
-
P.value.trim() ? (d(), p("span",
|
|
2197
|
+
l("span", Cl, f(Ve.value.length) + " / " + f(v.value.length), 1),
|
|
2198
|
+
P.value.trim() ? (d(), p("span", El, "标签:" + f(P.value), 1)) : k("", !0)
|
|
2172
2199
|
]),
|
|
2173
|
-
vt(
|
|
2200
|
+
vt(l("input", {
|
|
2174
2201
|
"onUpdate:modelValue": t[11] || (t[11] = (e) => h.value = e),
|
|
2175
2202
|
class: "p-inputtext p-component mbc__search",
|
|
2176
2203
|
type: "search",
|
|
2177
2204
|
placeholder: "筛选 module / 名字 / 备注 / 详情 / id / 版本号 / 标签"
|
|
2178
2205
|
}, null, 512), [
|
|
2179
|
-
[
|
|
2206
|
+
[Qt, h.value]
|
|
2180
2207
|
]),
|
|
2181
|
-
U.value.length > 0 ? (d(), p("div",
|
|
2182
|
-
t[73] || (t[73] =
|
|
2183
|
-
vt(
|
|
2208
|
+
U.value.length > 0 ? (d(), p("div", Sl, [
|
|
2209
|
+
t[73] || (t[73] = l("span", { class: "mbc__label" }, "标签", -1)),
|
|
2210
|
+
vt(l("input", {
|
|
2184
2211
|
"onUpdate:modelValue": t[12] || (t[12] = (e) => P.value = e),
|
|
2185
2212
|
class: "p-inputtext p-component mbc__tagfilter",
|
|
2186
2213
|
type: "search",
|
|
2187
2214
|
placeholder: "只看贴了…的块"
|
|
2188
2215
|
}, null, 512), [
|
|
2189
|
-
[
|
|
2216
|
+
[Qt, P.value]
|
|
2190
2217
|
]),
|
|
2191
|
-
(d(!0), p(
|
|
2218
|
+
(d(!0), p(B, null, I(U.value.slice(0, 24), (e) => (d(), p("button", {
|
|
2192
2219
|
key: e.tag,
|
|
2193
2220
|
class: K(["p-tag mbc__tag", { "is-on": P.value.trim().toLowerCase() === e.tag.toLowerCase() }]),
|
|
2194
2221
|
type: "button",
|
|
2195
2222
|
title: `只看贴了「${e.tag}」的块(${e.count} 个)`,
|
|
2196
|
-
onClick: (
|
|
2197
|
-
},
|
|
2223
|
+
onClick: (u) => P.value = P.value.trim().toLowerCase() === e.tag.toLowerCase() ? "" : e.tag
|
|
2224
|
+
}, f(e.tag) + " " + f(e.count), 11, Tl))), 128)),
|
|
2198
2225
|
P.value ? (d(), p("button", {
|
|
2199
2226
|
key: 0,
|
|
2200
2227
|
class: "p-button p-button-sm p-button-text",
|
|
@@ -2202,65 +2229,75 @@ ${t.text}`).join(`
|
|
|
2202
2229
|
onClick: t[13] || (t[13] = (e) => P.value = "")
|
|
2203
2230
|
}, "清掉标签筛选")) : k("", !0)
|
|
2204
2231
|
])) : k("", !0),
|
|
2205
|
-
|
|
2206
|
-
(d(!0), p(
|
|
2232
|
+
l("ul", Bl, [
|
|
2233
|
+
(d(!0), p(B, null, I(Ve.value, (e) => (d(), p("li", {
|
|
2207
2234
|
key: e.id
|
|
2208
2235
|
}, [
|
|
2209
|
-
|
|
2236
|
+
l("button", {
|
|
2210
2237
|
type: "button",
|
|
2211
|
-
class: K(["mbc__row", { "is-active": e.id ===
|
|
2212
|
-
title:
|
|
2213
|
-
onClick: (
|
|
2238
|
+
class: K(["mbc__row", { "is-active": e.id === g.value, "is-off": e.enabled === !1 }]),
|
|
2239
|
+
title: Zn(e),
|
|
2240
|
+
onClick: (u) => Fn(e)
|
|
2214
2241
|
}, [
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2242
|
+
l("span", Al, f(e.module || "unassigned"), 1),
|
|
2243
|
+
l("span", Ol, f(e.name || e.id), 1),
|
|
2244
|
+
l("span", {
|
|
2218
2245
|
class: "mbc__version-badge",
|
|
2219
2246
|
title: `当前是第 ${e.version || 1} 版,一共留着 ${e.versionCount ?? 1} 版`
|
|
2220
2247
|
}, [
|
|
2221
|
-
$("v" +
|
|
2222
|
-
(e.versionCount ?? 1) > 1 ? (d(), p(
|
|
2223
|
-
$("/" +
|
|
2248
|
+
$("v" + f(e.version || 1), 1),
|
|
2249
|
+
(e.versionCount ?? 1) > 1 ? (d(), p(B, { key: 0 }, [
|
|
2250
|
+
$("/" + f(e.versionCount), 1)
|
|
2224
2251
|
], 64)) : k("", !0)
|
|
2225
|
-
], 8,
|
|
2226
|
-
(d(!0), p(
|
|
2227
|
-
key:
|
|
2252
|
+
], 8, Rl),
|
|
2253
|
+
(d(!0), p(B, null, I(e.tags ?? [], (u) => (d(), p("span", {
|
|
2254
|
+
key: u,
|
|
2228
2255
|
class: "p-tag mbc__tag mbc__tag--on-row"
|
|
2229
|
-
},
|
|
2230
|
-
|
|
2231
|
-
|
|
2256
|
+
}, f(u), 1))), 128)),
|
|
2257
|
+
He(e) ? (d(), p("span", {
|
|
2258
|
+
key: 0,
|
|
2259
|
+
class: "mbc__loc",
|
|
2260
|
+
title: qe(e)
|
|
2261
|
+
}, f(He(e)), 9, Pl)) : k("", !0),
|
|
2262
|
+
Ke(e) ? (d(), p("span", {
|
|
2263
|
+
key: 1,
|
|
2264
|
+
class: "mbc__loc mbc__loc--inert",
|
|
2265
|
+
title: qe(e)
|
|
2266
|
+
}, f(Ke(e)), 9, jl)) : k("", !0),
|
|
2267
|
+
Jt(e).length > 0 ? (d(), p("span", Ll, f(Jt(e).join(" / ")), 1)) : k("", !0),
|
|
2268
|
+
l("em", {
|
|
2232
2269
|
class: K({ "is-off": e.enabled === !1 })
|
|
2233
|
-
},
|
|
2270
|
+
}, f(e.enabled === !1 ? Ue(e) || "校验失败已停用" : "可用"), 3),
|
|
2234
2271
|
(e.detail ?? "").trim() ? (d(), p("span", {
|
|
2235
|
-
key:
|
|
2272
|
+
key: 3,
|
|
2236
2273
|
class: "mbc__detail-line",
|
|
2237
|
-
title: it(
|
|
2238
|
-
},
|
|
2239
|
-
], 10,
|
|
2240
|
-
|
|
2241
|
-
(d(!0), p(
|
|
2242
|
-
key:
|
|
2274
|
+
title: it(fn)(e.detail ?? "", 240)
|
|
2275
|
+
}, f(it(fn)(e.detail ?? "")), 9, Il)) : k("", !0)
|
|
2276
|
+
], 10, Ml),
|
|
2277
|
+
g.value === e.id ? (d(), p("div", Dl, [
|
|
2278
|
+
(d(!0), p(B, null, I(re(e).slice(0, Se), (u, M) => (d(), p("p", {
|
|
2279
|
+
key: M,
|
|
2243
2280
|
class: "mbc__problem"
|
|
2244
|
-
},
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
t[
|
|
2248
|
-
|
|
2249
|
-
yt.value !== e.id ? (d(), p(
|
|
2281
|
+
}, f(u), 1))), 128)),
|
|
2282
|
+
re(e).length > Se ? (d(), p("p", Nl, "还有 " + f(re(e).length - Se) + " 条问题没显示出来:点上面的「校验全部魔法块」重算一遍(这几条是上次校验的结论)", 1)) : k("", !0),
|
|
2283
|
+
l("dl", Fl, [
|
|
2284
|
+
t[80] || (t[80] = l("dt", null, "详情", -1)),
|
|
2285
|
+
l("dd", null, [
|
|
2286
|
+
yt.value !== e.id ? (d(), p(B, { key: 0 }, [
|
|
2250
2287
|
(e.detail ?? "").trim() ? (d(), p("div", {
|
|
2251
2288
|
key: 0,
|
|
2252
2289
|
class: "mbc__blockdetail",
|
|
2253
|
-
innerHTML: it(
|
|
2254
|
-
}, null, 8,
|
|
2255
|
-
|
|
2290
|
+
innerHTML: it(Mo)(e.detail ?? "")
|
|
2291
|
+
}, null, 8, Ul)) : (d(), p("span", zl, "(这一块没写详情 —— 点右边「写详情」写一段**业务功能说明**:谁能用、什么场景、解决什么、输入输出是什么业务含义;用 Markdown 写,**别写路由 / 字段 / 实现方式**)")),
|
|
2292
|
+
l("button", {
|
|
2256
2293
|
class: "p-button p-button-sm p-button-text",
|
|
2257
2294
|
type: "button",
|
|
2258
|
-
disabled:
|
|
2259
|
-
onClick: (
|
|
2260
|
-
},
|
|
2261
|
-
], 64)) : (d(), p(
|
|
2262
|
-
vt(
|
|
2263
|
-
"onUpdate:modelValue": t[14] || (t[14] = (
|
|
2295
|
+
disabled: E.value,
|
|
2296
|
+
onClick: (u) => Jn(e)
|
|
2297
|
+
}, f((e.detail ?? "").trim() ? "改详情" : "写详情"), 9, Hl)
|
|
2298
|
+
], 64)) : (d(), p(B, { key: 1 }, [
|
|
2299
|
+
vt(l("textarea", {
|
|
2300
|
+
"onUpdate:modelValue": t[14] || (t[14] = (u) => kt.value = u),
|
|
2264
2301
|
class: "p-inputtext p-component mbc__detailinput",
|
|
2265
2302
|
rows: "6",
|
|
2266
2303
|
placeholder: `业务功能说明,用 Markdown 写 —— 例如:
|
|
@@ -2272,171 +2309,203 @@ ${t.text}`).join(`
|
|
|
2272
2309
|
- 怎么用:搜手机号 → 打开档案
|
|
2273
2310
|
(**别写**路由名 / 字段名 / 实现方式)`
|
|
2274
2311
|
}, null, 512), [
|
|
2275
|
-
[
|
|
2312
|
+
[Qt, kt.value]
|
|
2276
2313
|
]),
|
|
2277
|
-
|
|
2314
|
+
l("button", {
|
|
2278
2315
|
class: "p-button p-button-sm",
|
|
2279
2316
|
type: "button",
|
|
2280
|
-
disabled:
|
|
2281
|
-
onClick: (
|
|
2282
|
-
}, "存详情", 8,
|
|
2283
|
-
|
|
2317
|
+
disabled: E.value,
|
|
2318
|
+
onClick: (u) => Vn(e)
|
|
2319
|
+
}, "存详情", 8, Kl),
|
|
2320
|
+
l("button", {
|
|
2284
2321
|
class: "p-button p-button-sm p-button-text",
|
|
2285
2322
|
type: "button",
|
|
2286
|
-
disabled:
|
|
2287
|
-
onClick: t[15] || (t[15] = (
|
|
2288
|
-
}, "取消", 8,
|
|
2323
|
+
disabled: E.value,
|
|
2324
|
+
onClick: t[15] || (t[15] = (u) => yt.value = "")
|
|
2325
|
+
}, "取消", 8, ql)
|
|
2289
2326
|
], 64))
|
|
2290
2327
|
]),
|
|
2291
|
-
t[
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2328
|
+
t[81] || (t[81] = l("dt", null, "文件", -1)),
|
|
2329
|
+
l("dd", null, f((e.fileNames || []).join(" / ") || "(没有文件)"), 1),
|
|
2330
|
+
Wt(e) ? (d(), p(B, { key: 0 }, [
|
|
2331
|
+
t[77] || (t[77] = l("dt", null, "代码", -1)),
|
|
2332
|
+
l("dd", null, [
|
|
2333
|
+
l("b", null, f(e.code?.total ?? 0), 1),
|
|
2334
|
+
t[74] || (t[74] = $(" 行生效 ", -1)),
|
|
2335
|
+
l("span", Vl, "(" + f(e.code?.files ?? 0) + " 个文件,含注释与空行)", 1),
|
|
2336
|
+
l("ul", Jl, [
|
|
2337
|
+
(d(!0), p(B, null, I(e.code?.byFile ?? [], (u) => (d(), p("li", {
|
|
2338
|
+
key: u.name
|
|
2339
|
+
}, [
|
|
2340
|
+
l("span", Wl, f(u.lines), 1),
|
|
2341
|
+
$(" 行 · " + f(u.name), 1)
|
|
2342
|
+
]))), 128))
|
|
2343
|
+
])
|
|
2344
|
+
]),
|
|
2345
|
+
(e.code?.nonEffective ?? 0) > 0 ? (d(), p(B, { key: 0 }, [
|
|
2346
|
+
t[76] || (t[76] = l("dt", null, "不生效", -1)),
|
|
2347
|
+
l("dd", null, [
|
|
2348
|
+
l("b", null, f(e.code?.nonEffective ?? 0), 1),
|
|
2349
|
+
t[75] || (t[75] = $(" 行 ", -1)),
|
|
2350
|
+
l("span", Gl, "(" + f(e.code?.nonEffectiveFiles?.length ?? 0) + " 个文件 —— `excluded/` 里那些:照样进库、进版本史,但执行时被忽略)", 1),
|
|
2351
|
+
l("ul", Yl, [
|
|
2352
|
+
(d(!0), p(B, null, I(e.code?.nonEffectiveFiles ?? [], (u) => (d(), p("li", {
|
|
2353
|
+
key: u.name
|
|
2354
|
+
}, [
|
|
2355
|
+
l("span", Zl, f(u.lines), 1),
|
|
2356
|
+
$(" 行 · " + f(u.name), 1)
|
|
2357
|
+
]))), 128))
|
|
2358
|
+
])
|
|
2359
|
+
])
|
|
2360
|
+
], 64)) : k("", !0)
|
|
2361
|
+
], 64)) : k("", !0),
|
|
2362
|
+
t[82] || (t[82] = l("dt", null, "版本", -1)),
|
|
2363
|
+
l("dd", null, [
|
|
2364
|
+
$("v" + f(e.version || 1), 1),
|
|
2365
|
+
l("span", Xl, "(一共留着 " + f(e.versionCount ?? ot.value[e.id]?.length ?? 1) + " 版)", 1)
|
|
2297
2366
|
]),
|
|
2298
|
-
t[
|
|
2299
|
-
|
|
2300
|
-
Z.value !== e.id ? (d(), p(
|
|
2301
|
-
(d(!0), p(
|
|
2302
|
-
key:
|
|
2367
|
+
t[83] || (t[83] = l("dt", null, "标签", -1)),
|
|
2368
|
+
l("dd", null, [
|
|
2369
|
+
Z.value !== e.id ? (d(), p(B, { key: 0 }, [
|
|
2370
|
+
(d(!0), p(B, null, I(e.tags ?? [], (u) => (d(), p("span", {
|
|
2371
|
+
key: u,
|
|
2303
2372
|
class: "p-tag mbc__tag"
|
|
2304
|
-
},
|
|
2305
|
-
(e.tags ?? []).length === 0 ? (d(), p("span",
|
|
2306
|
-
|
|
2373
|
+
}, f(u), 1))), 128)),
|
|
2374
|
+
(e.tags ?? []).length === 0 ? (d(), p("span", Ql, "(没贴标签)")) : k("", !0),
|
|
2375
|
+
l("button", {
|
|
2307
2376
|
class: "p-button p-button-sm p-button-text",
|
|
2308
2377
|
type: "button",
|
|
2309
|
-
disabled:
|
|
2310
|
-
onClick: (
|
|
2311
|
-
}, "改标签", 8,
|
|
2312
|
-
], 64)) : (d(), p(
|
|
2313
|
-
vt(
|
|
2314
|
-
"onUpdate:modelValue": t[16] || (t[16] = (
|
|
2378
|
+
disabled: E.value,
|
|
2379
|
+
onClick: (u) => qn(e)
|
|
2380
|
+
}, "改标签", 8, ta)
|
|
2381
|
+
], 64)) : (d(), p(B, { key: 1 }, [
|
|
2382
|
+
vt(l("input", {
|
|
2383
|
+
"onUpdate:modelValue": t[16] || (t[16] = (u) => X.value = u),
|
|
2315
2384
|
class: "p-inputtext p-component mbc__taginput",
|
|
2316
2385
|
type: "text",
|
|
2317
2386
|
placeholder: "逗号分隔,例如:订单, 报表",
|
|
2318
|
-
onKeyup:
|
|
2319
|
-
}, null, 40,
|
|
2320
|
-
[
|
|
2387
|
+
onKeyup: ys((u) => ze(e), ["enter"])
|
|
2388
|
+
}, null, 40, ea), [
|
|
2389
|
+
[Qt, X.value]
|
|
2321
2390
|
]),
|
|
2322
|
-
|
|
2391
|
+
l("button", {
|
|
2323
2392
|
class: "p-button p-button-sm",
|
|
2324
2393
|
type: "button",
|
|
2325
|
-
disabled:
|
|
2326
|
-
onClick: (
|
|
2327
|
-
}, "存标签", 8,
|
|
2328
|
-
|
|
2394
|
+
disabled: E.value,
|
|
2395
|
+
onClick: (u) => ze(e)
|
|
2396
|
+
}, "存标签", 8, na),
|
|
2397
|
+
l("button", {
|
|
2329
2398
|
class: "p-button p-button-sm p-button-text",
|
|
2330
2399
|
type: "button",
|
|
2331
|
-
disabled:
|
|
2332
|
-
onClick: t[17] || (t[17] = (
|
|
2333
|
-
}, "取消", 8,
|
|
2334
|
-
U.value.length > 0 ? (d(), p("div",
|
|
2335
|
-
t[
|
|
2336
|
-
(d(!0), p(
|
|
2337
|
-
key:
|
|
2400
|
+
disabled: E.value,
|
|
2401
|
+
onClick: t[17] || (t[17] = (u) => Z.value = "")
|
|
2402
|
+
}, "取消", 8, sa),
|
|
2403
|
+
U.value.length > 0 ? (d(), p("div", oa, [
|
|
2404
|
+
t[78] || (t[78] = l("span", { class: "mbc__hint" }, "点现成的加进去:", -1)),
|
|
2405
|
+
(d(!0), p(B, null, I(U.value.slice(0, 16), (u) => (d(), p("button", {
|
|
2406
|
+
key: u.tag,
|
|
2338
2407
|
class: "p-tag mbc__tag",
|
|
2339
2408
|
type: "button",
|
|
2340
|
-
title: `把「${
|
|
2341
|
-
onClick: (
|
|
2342
|
-
},
|
|
2409
|
+
title: `把「${u.tag}」加进去`,
|
|
2410
|
+
onClick: (M) => Wn(u.tag)
|
|
2411
|
+
}, f(u.tag), 9, la))), 128))
|
|
2343
2412
|
])) : k("", !0),
|
|
2344
|
-
X.value.trim() ? (d(), p("div",
|
|
2345
|
-
t[
|
|
2346
|
-
(d(!0), p(
|
|
2347
|
-
key:
|
|
2413
|
+
X.value.trim() ? (d(), p("div", aa, [
|
|
2414
|
+
t[79] || (t[79] = l("span", { class: "mbc__hint" }, "这一块会贴:", -1)),
|
|
2415
|
+
(d(!0), p(B, null, I(X.value.split(/[,,\s]+/).filter(Boolean), (u) => (d(), p("button", {
|
|
2416
|
+
key: u,
|
|
2348
2417
|
class: "p-tag mbc__tag",
|
|
2349
2418
|
type: "button",
|
|
2350
|
-
title: `从这一块上摘掉「${
|
|
2351
|
-
onClick: (
|
|
2352
|
-
},
|
|
2419
|
+
title: `从这一块上摘掉「${u}」`,
|
|
2420
|
+
onClick: (M) => Gn(u)
|
|
2421
|
+
}, f(u) + " ×", 9, ia))), 128))
|
|
2353
2422
|
])) : k("", !0)
|
|
2354
2423
|
], 64))
|
|
2355
2424
|
]),
|
|
2356
|
-
t[
|
|
2357
|
-
|
|
2358
|
-
t[
|
|
2359
|
-
|
|
2425
|
+
t[84] || (t[84] = l("dt", null, "更新", -1)),
|
|
2426
|
+
l("dd", null, f(e.updatedAt || "—"), 1),
|
|
2427
|
+
t[85] || (t[85] = l("dt", null, "id", -1)),
|
|
2428
|
+
l("dd", ca, f(e.id), 1)
|
|
2360
2429
|
]),
|
|
2361
|
-
|
|
2362
|
-
|
|
2430
|
+
l("div", ua, [
|
|
2431
|
+
l("button", {
|
|
2363
2432
|
class: "p-button p-button-sm p-button-outlined",
|
|
2364
2433
|
type: "button",
|
|
2365
|
-
disabled:
|
|
2366
|
-
onClick: (
|
|
2434
|
+
disabled: E.value,
|
|
2435
|
+
onClick: (u) => le(e),
|
|
2367
2436
|
title: "删掉这一块的代码文件:本机的文件夹 + 库里那份代码正文(点下去会先问你确认)。块本身留着,页面上会显示成占位框"
|
|
2368
|
-
}, "删除代码文件", 8,
|
|
2437
|
+
}, "删除代码文件", 8, ra)
|
|
2369
2438
|
]),
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
t[
|
|
2373
|
-
|
|
2439
|
+
l("div", da, [
|
|
2440
|
+
l("div", pa, [
|
|
2441
|
+
t[86] || (t[86] = l("strong", null, "版本(每次上传 +1,旧的都留着)", -1)),
|
|
2442
|
+
l("button", {
|
|
2374
2443
|
class: "p-button p-button-sm p-button-text",
|
|
2375
2444
|
type: "button",
|
|
2376
|
-
disabled:
|
|
2377
|
-
onClick: (
|
|
2378
|
-
},
|
|
2445
|
+
disabled: E.value,
|
|
2446
|
+
onClick: (u) => D(e.id)
|
|
2447
|
+
}, f(w.value === e.id ? "读版本中…" : "刷新版本"), 9, fa)
|
|
2379
2448
|
]),
|
|
2380
|
-
ot.value[e.id] ? ot.value[e.id].length > 0 ? (d(), p("ul",
|
|
2381
|
-
(d(!0), p(
|
|
2382
|
-
key:
|
|
2383
|
-
class: K({ "is-current":
|
|
2449
|
+
ot.value[e.id] ? ot.value[e.id].length > 0 ? (d(), p("ul", ma, [
|
|
2450
|
+
(d(!0), p(B, null, I(ot.value[e.id], (u) => (d(), p("li", {
|
|
2451
|
+
key: u.number,
|
|
2452
|
+
class: K({ "is-current": u.current })
|
|
2384
2453
|
}, [
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
$(
|
|
2388
|
-
|
|
2389
|
-
$(" · " +
|
|
2454
|
+
l("span", va, f(rt(u)), 1),
|
|
2455
|
+
l("span", ha, [
|
|
2456
|
+
$(f(u.fileCount) + " 个文件 · " + f(Dt(u.sizeBytes)), 1),
|
|
2457
|
+
u.createdBy ? (d(), p(B, { key: 0 }, [
|
|
2458
|
+
$(" · " + f(u.createdBy), 1)
|
|
2390
2459
|
], 64)) : k("", !0),
|
|
2391
|
-
$(" · " +
|
|
2460
|
+
$(" · " + f(u.createdAt || "—"), 1)
|
|
2392
2461
|
]),
|
|
2393
|
-
|
|
2394
|
-
|
|
2462
|
+
l("span", _a, [
|
|
2463
|
+
l("button", {
|
|
2395
2464
|
class: "p-button p-button-sm p-button-text",
|
|
2396
2465
|
type: "button",
|
|
2397
|
-
disabled:
|
|
2398
|
-
onClick: (
|
|
2399
|
-
title:
|
|
2400
|
-
}, "查看", 8,
|
|
2401
|
-
|
|
2466
|
+
disabled: E.value || u.empty,
|
|
2467
|
+
onClick: (M) => Un(e, u.number),
|
|
2468
|
+
title: u.empty ? "这一版是空包(代码被删过),没有正文可看" : "看这一版的正文(只读)"
|
|
2469
|
+
}, "查看", 8, ga),
|
|
2470
|
+
l("button", {
|
|
2402
2471
|
class: "p-button p-button-sm p-button-text",
|
|
2403
2472
|
type: "button",
|
|
2404
|
-
disabled:
|
|
2405
|
-
onClick: (
|
|
2406
|
-
title:
|
|
2407
|
-
}, "切回", 8,
|
|
2408
|
-
|
|
2473
|
+
disabled: E.value || u.current || u.empty,
|
|
2474
|
+
onClick: (M) => zn(e, u.number),
|
|
2475
|
+
title: u.current ? "这一版正在跑" : "把这一版变成当前版(会记成一个新版本)"
|
|
2476
|
+
}, "切回", 8, ya),
|
|
2477
|
+
l("button", {
|
|
2409
2478
|
class: "p-button p-button-sm p-button-text",
|
|
2410
2479
|
type: "button",
|
|
2411
|
-
disabled:
|
|
2412
|
-
onClick: (
|
|
2413
|
-
title:
|
|
2414
|
-
}, "下载", 8,
|
|
2415
|
-
|
|
2480
|
+
disabled: E.value || u.empty,
|
|
2481
|
+
onClick: (M) => Kn(e, u.number),
|
|
2482
|
+
title: u.empty ? "空包没什么可下的" : "下载这一版(一个 zip)"
|
|
2483
|
+
}, "下载", 8, ka),
|
|
2484
|
+
l("button", {
|
|
2416
2485
|
class: "p-button p-button-sm p-button-text",
|
|
2417
2486
|
type: "button",
|
|
2418
|
-
disabled:
|
|
2419
|
-
onClick: (
|
|
2420
|
-
title:
|
|
2421
|
-
}, "删", 8,
|
|
2487
|
+
disabled: E.value || u.current,
|
|
2488
|
+
onClick: (M) => Hn(e, u.number),
|
|
2489
|
+
title: u.current ? "当前那一版不许删:先切到别的版本" : "删掉这一版(别的版本不受影响)"
|
|
2490
|
+
}, "删", 8, $a)
|
|
2422
2491
|
])
|
|
2423
2492
|
], 2))), 128))
|
|
2424
|
-
])) : (d(), p("p",
|
|
2425
|
-
T.value && T.value.id === e.id ? (d(), p("div",
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2493
|
+
])) : (d(), p("p", wa, "这个块还没有版本记录(它从没被保存过)。")) : (d(), p("p", ba, "正在读版本…(没读到时点「刷新版本」)")),
|
|
2494
|
+
T.value && T.value.id === e.id ? (d(), p("div", xa, [
|
|
2495
|
+
l("div", Ca, [
|
|
2496
|
+
l("strong", null, "看 v" + f(T.value.number) + " 的正文(只读)", 1),
|
|
2497
|
+
l("button", {
|
|
2429
2498
|
class: "p-button p-button-sm p-button-text",
|
|
2430
2499
|
type: "button",
|
|
2431
|
-
onClick: t[18] || (t[18] = (
|
|
2500
|
+
onClick: t[18] || (t[18] = (u) => T.value = null)
|
|
2432
2501
|
}, "收起")
|
|
2433
2502
|
]),
|
|
2434
|
-
(d(!0), p(
|
|
2435
|
-
key:
|
|
2503
|
+
(d(!0), p(B, null, I(T.value.files, (u, M) => (d(), p("details", {
|
|
2504
|
+
key: M,
|
|
2436
2505
|
class: "mbc__viewer-file"
|
|
2437
2506
|
}, [
|
|
2438
|
-
|
|
2439
|
-
|
|
2507
|
+
l("summary", Ea, f(M) + "(" + f(Dt(u.length)) + ")", 1),
|
|
2508
|
+
l("pre", Sa, f(u), 1)
|
|
2440
2509
|
]))), 128))
|
|
2441
2510
|
])) : k("", !0)
|
|
2442
2511
|
])
|
|
@@ -2444,352 +2513,352 @@ ${t.text}`).join(`
|
|
|
2444
2513
|
]))), 128))
|
|
2445
2514
|
])
|
|
2446
2515
|
], 512), [
|
|
2447
|
-
[
|
|
2516
|
+
[te, O.value === "blocks"]
|
|
2448
2517
|
]),
|
|
2449
|
-
vt(
|
|
2450
|
-
t[
|
|
2451
|
-
|
|
2452
|
-
t[
|
|
2453
|
-
|
|
2518
|
+
vt(l("section", Ta, [
|
|
2519
|
+
t[96] || (t[96] = l("h3", { class: "mbc__title" }, "导出去改(用你自己的编辑器)", -1)),
|
|
2520
|
+
l("div", Ba, [
|
|
2521
|
+
t[87] || (t[87] = l("span", { class: "mbc__label" }, "体检", -1)),
|
|
2522
|
+
l("button", {
|
|
2454
2523
|
class: "p-button p-button-sm",
|
|
2455
2524
|
type: "button",
|
|
2456
|
-
disabled:
|
|
2457
|
-
onClick: t[19] || (t[19] = (e) =>
|
|
2458
|
-
},
|
|
2459
|
-
t[
|
|
2525
|
+
disabled: E.value,
|
|
2526
|
+
onClick: t[19] || (t[19] = (e) => ss())
|
|
2527
|
+
}, f(It.value ? "校验中…" : "校验全部魔法块"), 9, Ma),
|
|
2528
|
+
t[88] || (t[88] = l("span", { class: "mbc__hint" }, "重新跑一遍逐块判据(试加载 + 引用深检),过不了的整块停用;改好再点一次就恢复。", -1))
|
|
2460
2529
|
]),
|
|
2461
|
-
t[
|
|
2462
|
-
|
|
2463
|
-
t[
|
|
2464
|
-
|
|
2465
|
-
|
|
2530
|
+
t[97] || (t[97] = l("hr", { class: "mbc__rule" }, null, -1)),
|
|
2531
|
+
l("div", Aa, [
|
|
2532
|
+
t[90] || (t[90] = l("span", { class: "mbc__label" }, "导出范围", -1)),
|
|
2533
|
+
l("label", Oa, [
|
|
2534
|
+
l("input", {
|
|
2466
2535
|
type: "radio",
|
|
2467
2536
|
name: "mbc-scope",
|
|
2468
2537
|
value: "one",
|
|
2469
2538
|
checked: Q.value === "one",
|
|
2470
2539
|
onChange: t[20] || (t[20] = (e) => Q.value = "one")
|
|
2471
|
-
}, null, 40,
|
|
2472
|
-
t[
|
|
2540
|
+
}, null, 40, Ra),
|
|
2541
|
+
t[89] || (t[89] = $(" 仅这一个块 ", -1))
|
|
2473
2542
|
]),
|
|
2474
|
-
|
|
2475
|
-
|
|
2543
|
+
l("label", Pa, [
|
|
2544
|
+
l("input", {
|
|
2476
2545
|
type: "radio",
|
|
2477
2546
|
name: "mbc-scope",
|
|
2478
2547
|
value: "all",
|
|
2479
2548
|
checked: Q.value === "all",
|
|
2480
2549
|
onChange: t[21] || (t[21] = (e) => Q.value = "all")
|
|
2481
|
-
}, null, 40,
|
|
2482
|
-
$(" 全部块(" +
|
|
2550
|
+
}, null, 40, ja),
|
|
2551
|
+
$(" 全部块(" + f(v.value.length) + " 个) ", 1)
|
|
2483
2552
|
]),
|
|
2484
2553
|
Q.value === "one" ? (d(), p("select", {
|
|
2485
2554
|
key: 0,
|
|
2486
2555
|
class: "p-inputtext p-component mbc__grow",
|
|
2487
2556
|
value: wt.value,
|
|
2488
|
-
disabled:
|
|
2557
|
+
disabled: E.value || v.value.length === 0,
|
|
2489
2558
|
onChange: t[22] || (t[22] = (e) => Kt(e.target.value))
|
|
2490
2559
|
}, [
|
|
2491
|
-
v.value.length === 0 ? (d(), p("option",
|
|
2492
|
-
(d(!0), p(
|
|
2560
|
+
v.value.length === 0 ? (d(), p("option", Ia, "(库里还没有块)")) : k("", !0),
|
|
2561
|
+
(d(!0), p(B, null, I(v.value, (e) => (d(), p("option", {
|
|
2493
2562
|
key: e.id,
|
|
2494
2563
|
value: e.id
|
|
2495
|
-
},
|
|
2496
|
-
], 40,
|
|
2564
|
+
}, f(e.module) + " / " + f(e.name || e.id), 9, Da))), 128))
|
|
2565
|
+
], 40, La)) : k("", !0)
|
|
2497
2566
|
]),
|
|
2498
|
-
|
|
2499
|
-
t[
|
|
2500
|
-
|
|
2567
|
+
l("div", Na, [
|
|
2568
|
+
t[91] || (t[91] = l("label", { for: "mbc-dir" }, "导出目录", -1)),
|
|
2569
|
+
l("input", {
|
|
2501
2570
|
id: "mbc-dir",
|
|
2502
2571
|
class: "p-inputtext p-component mbc__grow mbc__mono",
|
|
2503
2572
|
type: "text",
|
|
2504
2573
|
readonly: "",
|
|
2505
2574
|
value: q.value ? q.value.name : "(还没选:点右边那个按钮选一个文件夹)"
|
|
2506
|
-
}, null, 8,
|
|
2507
|
-
|
|
2575
|
+
}, null, 8, Fa),
|
|
2576
|
+
l("button", {
|
|
2508
2577
|
class: "p-button p-button-sm p-button-outlined",
|
|
2509
2578
|
type: "button",
|
|
2510
|
-
disabled:
|
|
2511
|
-
onClick: t[23] || (t[23] = (e) =>
|
|
2512
|
-
}, "选择文件夹", 8,
|
|
2513
|
-
|
|
2579
|
+
disabled: E.value,
|
|
2580
|
+
onClick: t[23] || (t[23] = (e) => We("export"))
|
|
2581
|
+
}, "选择文件夹", 8, Ua),
|
|
2582
|
+
l("button", {
|
|
2514
2583
|
class: "p-button p-button-sm mbc__act-export",
|
|
2515
2584
|
type: "button",
|
|
2516
|
-
disabled:
|
|
2585
|
+
disabled: E.value || Q.value === "one" && !bt.value,
|
|
2517
2586
|
title: Q.value === "one" && !bt.value ? "先在左边挑一个块(或者把范围改成「全部块」)" : "把库里的块铺到你选的文件夹",
|
|
2518
|
-
onClick: t[24] || (t[24] = (e) =>
|
|
2519
|
-
},
|
|
2587
|
+
onClick: t[24] || (t[24] = (e) => os())
|
|
2588
|
+
}, f(ct.value ? "导出中…" : "导出"), 9, za)
|
|
2520
2589
|
]),
|
|
2521
|
-
|
|
2522
|
-
$(
|
|
2523
|
-
t[
|
|
2524
|
-
t[
|
|
2525
|
-
t[
|
|
2526
|
-
t[
|
|
2590
|
+
l("p", Ha, [
|
|
2591
|
+
$(f(Q.value === "all" ? `这一趟铺全部 ${v.value.length} 个块` : bt.value ? `这一趟只铺「${bt.value.module} / ${bt.value.name || bt.value.id}」` : "先挑一个块") + " ⇒ ", 1),
|
|
2592
|
+
t[92] || (t[92] = l("span", { class: "mbc__mono" }, "workspace/<可读名>-<块 uuid>/", -1)),
|
|
2593
|
+
t[93] || (t[93] = $(",顶层另附开发说明与 ", -1)),
|
|
2594
|
+
t[94] || (t[94] = l("span", { class: "mbc__mono" }, "example/", -1)),
|
|
2595
|
+
t[95] || (t[95] = $("。 ", -1))
|
|
2527
2596
|
]),
|
|
2528
|
-
V.value ? (d(), p("p",
|
|
2597
|
+
V.value ? (d(), p("p", Ka, f(V.value), 1)) : k("", !0)
|
|
2529
2598
|
], 512), [
|
|
2530
|
-
[
|
|
2599
|
+
[te, O.value === "workspace"]
|
|
2531
2600
|
]),
|
|
2532
|
-
vt(
|
|
2533
|
-
t[
|
|
2534
|
-
|
|
2535
|
-
t[
|
|
2536
|
-
|
|
2601
|
+
vt(l("section", qa, [
|
|
2602
|
+
t[106] || (t[106] = l("h3", { class: "mbc__title" }, "读回改动", -1)),
|
|
2603
|
+
l("div", Va, [
|
|
2604
|
+
t[98] || (t[98] = l("label", { for: "mbc-read-dir" }, "读回目录", -1)),
|
|
2605
|
+
l("input", {
|
|
2537
2606
|
id: "mbc-read-dir",
|
|
2538
2607
|
class: "p-inputtext p-component mbc__grow mbc__mono",
|
|
2539
2608
|
type: "text",
|
|
2540
2609
|
readonly: "",
|
|
2541
2610
|
value: z.value ? z.value.name : "(还没选:导出会自动填上,也可以自己选一个)"
|
|
2542
|
-
}, null, 8,
|
|
2543
|
-
|
|
2611
|
+
}, null, 8, Ja),
|
|
2612
|
+
l("button", {
|
|
2544
2613
|
class: "p-button p-button-sm p-button-outlined",
|
|
2545
2614
|
type: "button",
|
|
2546
|
-
disabled:
|
|
2547
|
-
onClick: t[25] || (t[25] = (e) =>
|
|
2548
|
-
}, "选择文件夹", 8,
|
|
2549
|
-
|
|
2615
|
+
disabled: E.value,
|
|
2616
|
+
onClick: t[25] || (t[25] = (e) => We("read"))
|
|
2617
|
+
}, "选择文件夹", 8, Wa),
|
|
2618
|
+
l("button", {
|
|
2550
2619
|
class: "p-button p-button-sm p-button-outlined",
|
|
2551
2620
|
type: "button",
|
|
2552
|
-
disabled:
|
|
2553
|
-
onClick: t[26] || (t[26] = (e) =>
|
|
2554
|
-
},
|
|
2621
|
+
disabled: E.value,
|
|
2622
|
+
onClick: t[26] || (t[26] = (e) => Ze())
|
|
2623
|
+
}, f($t.value ? "读回中…" : "读回改动"), 9, Ga)
|
|
2555
2624
|
]),
|
|
2556
|
-
z.value && q.value && z.value.name !== q.value.name ? (d(), p("p",
|
|
2557
|
-
R.value ? (d(), p(
|
|
2558
|
-
|
|
2559
|
-
t[
|
|
2560
|
-
|
|
2561
|
-
t[
|
|
2562
|
-
|
|
2563
|
-
t[
|
|
2564
|
-
|
|
2565
|
-
t[
|
|
2566
|
-
|
|
2625
|
+
z.value && q.value && z.value.name !== q.value.name ? (d(), p("p", Ya, " 读回的是「" + f(z.value.name) + "」(与导出目录「" + f(q.value.name) + "」不是同一个 —— 想同步就再选一次)。 ", 1)) : (d(), p("p", Za, "读回目录默认跟着导出目录;要读别的文件夹就点「选择文件夹」单独选一个。")),
|
|
2626
|
+
R.value ? (d(), p(B, { key: 2 }, [
|
|
2627
|
+
Gt.value.length > 0 ? (d(), p("p", Xa, [
|
|
2628
|
+
t[99] || (t[99] = $(" 扫到 ", -1)),
|
|
2629
|
+
l("b", null, f(R.value.blocks.length), 1),
|
|
2630
|
+
t[100] || (t[100] = $(" 个块,其中 ", -1)),
|
|
2631
|
+
l("b", Qa, f(Gt.value.length), 1),
|
|
2632
|
+
t[101] || (t[101] = $(" 个可以存;已经勾了 ", -1)),
|
|
2633
|
+
l("b", null, f(Yt.value.length), 1),
|
|
2634
|
+
t[102] || (t[102] = $(" 个。 ", -1)),
|
|
2635
|
+
l("button", {
|
|
2567
2636
|
class: "p-button p-button-sm p-button-text",
|
|
2568
2637
|
type: "button",
|
|
2569
|
-
disabled:
|
|
2570
|
-
onClick: t[27] || (t[27] = (e) =>
|
|
2571
|
-
}, "全选可存的", 8,
|
|
2572
|
-
|
|
2638
|
+
disabled: E.value,
|
|
2639
|
+
onClick: t[27] || (t[27] = (e) => Xe(!0))
|
|
2640
|
+
}, "全选可存的", 8, ti),
|
|
2641
|
+
l("button", {
|
|
2573
2642
|
class: "p-button p-button-sm p-button-text",
|
|
2574
2643
|
type: "button",
|
|
2575
|
-
disabled:
|
|
2576
|
-
onClick: t[28] || (t[28] = (e) =>
|
|
2577
|
-
}, "全不选", 8,
|
|
2644
|
+
disabled: E.value || Yt.value.length === 0,
|
|
2645
|
+
onClick: t[28] || (t[28] = (e) => Xe(!1))
|
|
2646
|
+
}, "全不选", 8, ei)
|
|
2578
2647
|
])) : k("", !0),
|
|
2579
|
-
R.value.blocks.length > 0 ? (d(), p("ul",
|
|
2580
|
-
(d(!0), p(
|
|
2648
|
+
R.value.blocks.length > 0 ? (d(), p("ul", ni, [
|
|
2649
|
+
(d(!0), p(B, null, I(R.value.blocks, (e) => (d(), p("li", {
|
|
2581
2650
|
key: e.id,
|
|
2582
|
-
class: K(["mbc__block", { "is-picked":
|
|
2651
|
+
class: K(["mbc__block", { "is-picked": ut.value[e.id] === !0, "is-blocked": !e.canApply }])
|
|
2583
2652
|
}, [
|
|
2584
|
-
|
|
2585
|
-
|
|
2653
|
+
l("label", si, [
|
|
2654
|
+
l("span", {
|
|
2586
2655
|
class: K(["p-checkbox p-component", { "p-disabled": !e.canApply }])
|
|
2587
2656
|
}, [
|
|
2588
|
-
|
|
2657
|
+
l("input", {
|
|
2589
2658
|
class: "p-checkbox-input",
|
|
2590
2659
|
type: "checkbox",
|
|
2591
2660
|
disabled: !e.canApply,
|
|
2592
|
-
checked:
|
|
2593
|
-
onChange: (
|
|
2594
|
-
}, null, 40,
|
|
2595
|
-
t[
|
|
2661
|
+
checked: ut.value[e.id] === !0,
|
|
2662
|
+
onChange: (u) => rs(e.id, u)
|
|
2663
|
+
}, null, 40, oi),
|
|
2664
|
+
t[103] || (t[103] = l("span", { class: "p-checkbox-box" }, null, -1))
|
|
2596
2665
|
], 2),
|
|
2597
|
-
|
|
2598
|
-
|
|
2666
|
+
l("span", li, f(e.name || e.id), 1),
|
|
2667
|
+
l("span", {
|
|
2599
2668
|
class: K(["p-tag", e.status === "modified" ? "p-tag-success" : e.status === "missing" ? "p-tag-warning" : e.status === "not-in-db" ? "p-tag-info" : ""])
|
|
2600
|
-
},
|
|
2601
|
-
|
|
2669
|
+
}, f(s[e.status]), 3),
|
|
2670
|
+
l("span", ai, f(e.module || "—"), 1)
|
|
2602
2671
|
]),
|
|
2603
|
-
|
|
2604
|
-
e.status === "missing" ? (d(), p(
|
|
2672
|
+
l("p", ii, [
|
|
2673
|
+
e.status === "missing" ? (d(), p(B, { key: 0 }, [
|
|
2605
2674
|
$("目录里没有这一块,勾不上")
|
|
2606
|
-
], 64)) : e.status === "not-in-db" ? (d(), p(
|
|
2675
|
+
], 64)) : e.status === "not-in-db" ? (d(), p(B, { key: 1 }, [
|
|
2607
2676
|
$("库里还没有这一块 —— 勾上它保存,就是按这一包新建")
|
|
2608
|
-
], 64)) : e.changedFiles.length > 0 ? (d(), p(
|
|
2609
|
-
t[
|
|
2610
|
-
|
|
2611
|
-
], 64)) : (d(), p(
|
|
2677
|
+
], 64)) : e.changedFiles.length > 0 ? (d(), p(B, { key: 2 }, [
|
|
2678
|
+
t[104] || (t[104] = $("改了:", -1)),
|
|
2679
|
+
l("span", ci, f(e.changedFiles.join(" / ")), 1)
|
|
2680
|
+
], 64)) : (d(), p(B, { key: 3 }, [
|
|
2612
2681
|
$("内容与库里一致")
|
|
2613
2682
|
], 64))
|
|
2614
2683
|
]),
|
|
2615
|
-
e.blockedWhy ? (d(), p("p",
|
|
2616
|
-
|
|
2684
|
+
e.blockedWhy ? (d(), p("p", ui, "不能存:" + f(e.blockedWhy), 1)) : k("", !0),
|
|
2685
|
+
l("p", ri, f(e.folder || e.where), 1)
|
|
2617
2686
|
], 2))), 128))
|
|
2618
|
-
])) : (d(), p("p",
|
|
2619
|
-
|
|
2687
|
+
])) : (d(), p("p", di, "这个目录里没有认出任何块(点上面那个按钮再扫一次,或者确认文件夹名里有那个块的 uuid)。")),
|
|
2688
|
+
l("div", pi, [
|
|
2620
2689
|
dt.value > 0 ? (d(), p("button", {
|
|
2621
2690
|
key: 0,
|
|
2622
2691
|
class: "p-button p-button-sm mbc__report-btn",
|
|
2623
2692
|
type: "button",
|
|
2624
2693
|
title: "点开看这一趟的全部问题(" + dt.value + " 条)",
|
|
2625
2694
|
onClick: t[29] || (t[29] = (e) => Ot.value = !0)
|
|
2626
|
-
}, "查看问题(" +
|
|
2695
|
+
}, "查看问题(" + f(dt.value) + ")⚠", 9, fi)) : (d(), p("span", bi, "这一趟没有问题")),
|
|
2627
2696
|
R.value.unmatched.length > 0 ? (d(), p("span", {
|
|
2628
2697
|
key: 2,
|
|
2629
2698
|
class: "mbc__chip is-bad",
|
|
2630
2699
|
title: R.value.unmatched.join(" / ")
|
|
2631
|
-
}, "认不出归属的文件夹 " +
|
|
2700
|
+
}, "认不出归属的文件夹 " + f(R.value.unmatched.length), 9, mi)) : k("", !0)
|
|
2632
2701
|
]),
|
|
2633
|
-
(R.value.skipped ?? []).length > 0 ? (d(), p("p",
|
|
2634
|
-
$(" 忽略了 " +
|
|
2635
|
-
t[
|
|
2636
|
-
$(" 同一个规矩):" +
|
|
2702
|
+
(R.value.skipped ?? []).length > 0 ? (d(), p("p", vi, [
|
|
2703
|
+
$(" 忽略了 " + f((R.value.skipped ?? []).length) + " 个文件夹(名字里没有 uuid,当测试文件处理 —— 与忽略 ", 1),
|
|
2704
|
+
t[105] || (t[105] = l("span", { class: "mbc__mono" }, "example/", -1)),
|
|
2705
|
+
$(" 同一个规矩):" + f((R.value.skipped ?? []).join(" / ")), 1)
|
|
2637
2706
|
])) : k("", !0),
|
|
2638
|
-
|
|
2639
|
-
|
|
2707
|
+
l("div", hi, [
|
|
2708
|
+
l("button", {
|
|
2640
2709
|
class: "p-button p-button-sm mbc__act-import",
|
|
2641
2710
|
type: "button",
|
|
2642
|
-
disabled:
|
|
2643
|
-
onClick: t[30] || (t[30] = (e) =>
|
|
2644
|
-
},
|
|
2711
|
+
disabled: E.value,
|
|
2712
|
+
onClick: t[30] || (t[30] = (e) => us())
|
|
2713
|
+
}, f(st.value ? "保存中…" : `保存选中的块(${Yt.value.length})`), 9, _i)
|
|
2645
2714
|
])
|
|
2646
2715
|
], 64)) : k("", !0)
|
|
2647
2716
|
], 512), [
|
|
2648
|
-
[
|
|
2717
|
+
[te, O.value === "workspace"]
|
|
2649
2718
|
]),
|
|
2650
|
-
vt(
|
|
2651
|
-
|
|
2652
|
-
t[
|
|
2653
|
-
|
|
2654
|
-
|
|
2719
|
+
vt(l("section", gi, [
|
|
2720
|
+
l("h3", yi, [
|
|
2721
|
+
t[107] || (t[107] = $(" 不在数据库 ", -1)),
|
|
2722
|
+
l("span", ki, f(it(a)), 1),
|
|
2723
|
+
l("span", $i, f(fe.value.length), 1)
|
|
2655
2724
|
]),
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
t[
|
|
2659
|
-
t[
|
|
2660
|
-
t[
|
|
2661
|
-
t[
|
|
2662
|
-
t[
|
|
2663
|
-
t[
|
|
2664
|
-
$(":在上面「读回改动」里选中放这一块的文件夹(文件夹名里有 uuid), 扫出来就是一条标签写着「" +
|
|
2725
|
+
fe.value.length === 0 ? (d(), p("p", wi, "路由表里声明的块,库里都有那一行。")) : (d(), p(B, { key: 1 }, [
|
|
2726
|
+
l("p", xi, [
|
|
2727
|
+
t[108] || (t[108] = $(" 这些页面的路由(", -1)),
|
|
2728
|
+
t[109] || (t[109] = l("span", { class: "mbc__mono" }, "component: MagicBlockPage", -1)),
|
|
2729
|
+
t[110] || (t[110] = $(")声明了块的 uuid, ", -1)),
|
|
2730
|
+
t[111] || (t[111] = l("span", { class: "mbc__mono" }, "/magic-blocks/index", -1)),
|
|
2731
|
+
t[112] || (t[112] = $(" 里却没有这一行 —— 页面上那一块现在是占位框。 ", -1)),
|
|
2732
|
+
t[113] || (t[113] = l("b", null, "要建进库", -1)),
|
|
2733
|
+
$(":在上面「读回改动」里选中放这一块的文件夹(文件夹名里有 uuid), 扫出来就是一条标签写着「" + f(it(a)) + "」、能勾能存的条目。 ", 1)
|
|
2665
2734
|
]),
|
|
2666
|
-
|
|
2667
|
-
(d(!0), p(
|
|
2735
|
+
l("ul", Ci, [
|
|
2736
|
+
(d(!0), p(B, null, I(fe.value, (e) => (d(), p("li", {
|
|
2668
2737
|
key: e.uuid,
|
|
2669
2738
|
class: "mbc__block is-blocked"
|
|
2670
2739
|
}, [
|
|
2671
|
-
|
|
2672
|
-
t[
|
|
2673
|
-
|
|
2740
|
+
l("label", Ei, [
|
|
2741
|
+
t[114] || (t[114] = l("span", { class: "p-checkbox p-component p-disabled" }, [
|
|
2742
|
+
l("input", {
|
|
2674
2743
|
class: "p-checkbox-input",
|
|
2675
2744
|
type: "checkbox",
|
|
2676
2745
|
disabled: ""
|
|
2677
2746
|
}),
|
|
2678
|
-
|
|
2747
|
+
l("span", { class: "p-checkbox-box" })
|
|
2679
2748
|
], -1)),
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2749
|
+
l("span", Si, f(e.title || e.uuid), 1),
|
|
2750
|
+
l("span", Ti, f(it(a)), 1),
|
|
2751
|
+
l("span", Bi, f(e.module || "—"), 1)
|
|
2683
2752
|
]),
|
|
2684
|
-
|
|
2685
|
-
t[
|
|
2686
|
-
|
|
2687
|
-
t[
|
|
2753
|
+
l("p", Mi, [
|
|
2754
|
+
t[115] || (t[115] = $(" 路由 ", -1)),
|
|
2755
|
+
l("span", Ai, f(e.path), 1),
|
|
2756
|
+
t[116] || (t[116] = $(" 声明了它,库里没有这个块 —— 手里还没有放这个块的文件夹,所以这里勾不上(勾上了也没有正文可存)。 ", -1))
|
|
2688
2757
|
]),
|
|
2689
|
-
|
|
2758
|
+
l("p", Oi, f(e.uuid), 1)
|
|
2690
2759
|
]))), 128))
|
|
2691
2760
|
])
|
|
2692
2761
|
], 64))
|
|
2693
2762
|
], 512), [
|
|
2694
|
-
[
|
|
2763
|
+
[te, O.value === "workspace"]
|
|
2695
2764
|
]),
|
|
2696
|
-
O.value === "workspace" && (G.value.length > 0 || Y.value.length > 0) ? (d(), p("section",
|
|
2697
|
-
t[
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
Ft.value.length > 0 ? (d(), p("span",
|
|
2701
|
-
G.value.length > 0 ? (d(), p("span",
|
|
2702
|
-
Ft.value.length === 0 && G.value.length === 0 ? (d(), p("span",
|
|
2765
|
+
O.value === "workspace" && (G.value.length > 0 || Y.value.length > 0) ? (d(), p("section", Ri, [
|
|
2766
|
+
t[117] || (t[117] = l("h3", { class: "mbc__title" }, "保存结果", -1)),
|
|
2767
|
+
l("p", Pi, [
|
|
2768
|
+
l("span", ji, "存成 " + f(de.value), 1),
|
|
2769
|
+
Ft.value.length > 0 ? (d(), p("span", Li, "没存成 " + f(Ft.value.length), 1)) : k("", !0),
|
|
2770
|
+
G.value.length > 0 ? (d(), p("span", Ii, "前端拦下 " + f(G.value.length), 1)) : k("", !0),
|
|
2771
|
+
Ft.value.length === 0 && G.value.length === 0 ? (d(), p("span", Di, "明细在下面那个「查看问题」里(没问题时是空的)。")) : k("", !0)
|
|
2703
2772
|
]),
|
|
2704
|
-
|
|
2705
|
-
|
|
2773
|
+
l("div", Ni, [
|
|
2774
|
+
l("button", {
|
|
2706
2775
|
class: "p-button p-button-sm mbc__report-btn",
|
|
2707
2776
|
type: "button",
|
|
2708
2777
|
onClick: t[31] || (t[31] = (e) => Ot.value = !0)
|
|
2709
|
-
}, "查看问题(" +
|
|
2778
|
+
}, "查看问题(" + f(dt.value) + ")⚠", 1)
|
|
2710
2779
|
])
|
|
2711
2780
|
])) : k("", !0),
|
|
2712
|
-
t[
|
|
2781
|
+
t[118] || (t[118] = l("div", {
|
|
2713
2782
|
class: "mbc__tailspace",
|
|
2714
2783
|
"aria-hidden": "true"
|
|
2715
2784
|
}, null, -1))
|
|
2716
2785
|
]),
|
|
2717
|
-
|
|
2718
|
-
|
|
2786
|
+
l("footer", Fi, [
|
|
2787
|
+
S.value.length > 0 ? (d(), p("button", {
|
|
2719
2788
|
key: 0,
|
|
2720
2789
|
class: "p-button p-button-sm mbc__report-btn",
|
|
2721
2790
|
type: "button",
|
|
2722
|
-
title: "点开看全部报错(" +
|
|
2791
|
+
title: "点开看全部报错(" + S.value.length + " 条)",
|
|
2723
2792
|
onClick: t[32] || (t[32] = (e) => A.value = !0)
|
|
2724
|
-
}, "查看报错(" +
|
|
2725
|
-
|
|
2793
|
+
}, "查看报错(" + f(S.value.length) + " 条)⚠", 9, Ui)) : k("", !0),
|
|
2794
|
+
_.value ? (d(), p("p", zi, f(_.value), 1)) : y.value ? (d(), p("p", Hi, f(y.value), 1)) : (d(), p("p", Ki, "—"))
|
|
2726
2795
|
])
|
|
2727
2796
|
], 2)) : k("", !0),
|
|
2728
|
-
|
|
2797
|
+
r.value && Ot.value ? (d(), p("div", {
|
|
2729
2798
|
key: 1,
|
|
2730
2799
|
class: "mbc__modal",
|
|
2731
2800
|
role: "dialog",
|
|
2732
2801
|
"aria-modal": "true",
|
|
2733
|
-
onClick: t[36] || (t[36] =
|
|
2802
|
+
onClick: t[36] || (t[36] = Te((e) => Ot.value = !1, ["self"]))
|
|
2734
2803
|
}, [
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2804
|
+
l("div", qi, [
|
|
2805
|
+
l("header", Vi, [
|
|
2806
|
+
l("strong", null, "读回 / 保存的问题(" + f(dt.value) + " 条)", 1),
|
|
2807
|
+
l("button", {
|
|
2739
2808
|
class: "p-button p-button-sm p-button-text",
|
|
2740
2809
|
type: "button",
|
|
2741
2810
|
onClick: t[33] || (t[33] = (e) => Ot.value = !1)
|
|
2742
2811
|
}, "收起")
|
|
2743
2812
|
]),
|
|
2744
|
-
|
|
2745
|
-
G.value.length > 0 ? (d(), p("section",
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
(d(!0), p(
|
|
2813
|
+
l("div", Ji, [
|
|
2814
|
+
G.value.length > 0 ? (d(), p("section", Wi, [
|
|
2815
|
+
l("h4", Gi, "前端校验拦下的(" + f(G.value.length) + ")", 1),
|
|
2816
|
+
l("ul", Yi, [
|
|
2817
|
+
(d(!0), p(B, null, I(G.value, (e, u) => (d(), p("li", { key: u }, f(e), 1))), 128))
|
|
2749
2818
|
])
|
|
2750
2819
|
])) : k("", !0),
|
|
2751
|
-
(R.value?.failures ?? []).length > 0 ? (d(), p("section",
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
(d(!0), p(
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
$(" " +
|
|
2820
|
+
(R.value?.failures ?? []).length > 0 ? (d(), p("section", Zi, [
|
|
2821
|
+
l("h4", Xi, "读回时逐条回的(" + f((R.value?.failures ?? []).length) + ")", 1),
|
|
2822
|
+
l("ul", Qi, [
|
|
2823
|
+
(d(!0), p(B, null, I(R.value?.failures ?? [], (e, u) => (d(), p("li", { key: u }, [
|
|
2824
|
+
l("span", tc, f(e.kind || "问题"), 1),
|
|
2825
|
+
l("span", ec, f(e.where), 1),
|
|
2826
|
+
$(" " + f(e.message), 1)
|
|
2758
2827
|
]))), 128))
|
|
2759
2828
|
])
|
|
2760
2829
|
])) : k("", !0),
|
|
2761
|
-
(R.value?.unmatched ?? []).length > 0 ? (d(), p("section",
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
(d(!0), p(
|
|
2765
|
-
|
|
2830
|
+
(R.value?.unmatched ?? []).length > 0 ? (d(), p("section", nc, [
|
|
2831
|
+
l("h4", sc, "认不出归属的文件夹(" + f((R.value?.unmatched ?? []).length) + ")", 1),
|
|
2832
|
+
l("ul", oc, [
|
|
2833
|
+
(d(!0), p(B, null, I(R.value?.unmatched ?? [], (e, u) => (d(), p("li", { key: u }, [
|
|
2834
|
+
l("span", lc, f(e), 1)
|
|
2766
2835
|
]))), 128))
|
|
2767
2836
|
])
|
|
2768
2837
|
])) : k("", !0),
|
|
2769
|
-
Y.value.length > 0 ? (d(), p("section",
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
(d(!0), p(
|
|
2838
|
+
Y.value.length > 0 ? (d(), p("section", ac, [
|
|
2839
|
+
l("h4", ic, "保存结果(" + f(Y.value.length) + ":存成 " + f(de.value) + ",没存成 " + f(Ft.value.length) + ")", 1),
|
|
2840
|
+
l("ul", cc, [
|
|
2841
|
+
(d(!0), p(B, null, I(Y.value, (e) => (d(), p("li", {
|
|
2773
2842
|
key: e.id,
|
|
2774
2843
|
class: K({ "is-ok": e.ok })
|
|
2775
2844
|
}, [
|
|
2776
|
-
|
|
2777
|
-
!e.ok && e.error ? (d(), p("span",
|
|
2778
|
-
!e.ok && (e.issues ?? []).length > 0 ? (d(), p("ul",
|
|
2779
|
-
(d(!0), p(
|
|
2845
|
+
l("strong", null, f(e.name || e.id) + ":" + f(e.ok ? "已保存" : "没保存"), 1),
|
|
2846
|
+
!e.ok && e.error ? (d(), p("span", uc, f(e.error), 1)) : k("", !0),
|
|
2847
|
+
!e.ok && (e.issues ?? []).length > 0 ? (d(), p("ul", rc, [
|
|
2848
|
+
(d(!0), p(B, null, I(e.issues, (u, M) => (d(), p("li", { key: M }, f(u), 1))), 128))
|
|
2780
2849
|
])) : k("", !0)
|
|
2781
2850
|
], 2))), 128))
|
|
2782
2851
|
])
|
|
2783
2852
|
])) : k("", !0),
|
|
2784
|
-
dt.value === 0 ? (d(), p("p",
|
|
2853
|
+
dt.value === 0 ? (d(), p("p", dc, "这一趟没有问题。")) : k("", !0)
|
|
2785
2854
|
]),
|
|
2786
|
-
|
|
2787
|
-
|
|
2855
|
+
l("footer", pc, [
|
|
2856
|
+
l("button", {
|
|
2788
2857
|
class: "p-button p-button-sm p-button-outlined",
|
|
2789
2858
|
type: "button",
|
|
2790
|
-
onClick: t[34] || (t[34] = (e) =>
|
|
2859
|
+
onClick: t[34] || (t[34] = (e) => ns())
|
|
2791
2860
|
}, "复制全部"),
|
|
2792
|
-
|
|
2861
|
+
l("button", {
|
|
2793
2862
|
class: "p-button p-button-sm",
|
|
2794
2863
|
type: "button",
|
|
2795
2864
|
onClick: t[35] || (t[35] = (e) => Ot.value = !1)
|
|
@@ -2797,46 +2866,46 @@ ${t.text}`).join(`
|
|
|
2797
2866
|
])
|
|
2798
2867
|
])
|
|
2799
2868
|
])) : k("", !0),
|
|
2800
|
-
|
|
2869
|
+
r.value && A.value ? (d(), p("div", {
|
|
2801
2870
|
key: 2,
|
|
2802
2871
|
class: "mbc__modal",
|
|
2803
2872
|
role: "dialog",
|
|
2804
2873
|
"aria-modal": "true",
|
|
2805
|
-
onClick: t[41] || (t[41] =
|
|
2874
|
+
onClick: t[41] || (t[41] = Te((e) => A.value = !1, ["self"]))
|
|
2806
2875
|
}, [
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2876
|
+
l("div", fc, [
|
|
2877
|
+
l("header", bc, [
|
|
2878
|
+
l("strong", null, "报错(" + f(S.value.length) + " 条)", 1),
|
|
2879
|
+
l("button", {
|
|
2811
2880
|
class: "p-button p-button-sm p-button-text",
|
|
2812
2881
|
type: "button",
|
|
2813
2882
|
onClick: t[37] || (t[37] = (e) => A.value = !1)
|
|
2814
2883
|
}, "收起")
|
|
2815
2884
|
]),
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
(d(!0), p(
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
$(" · " +
|
|
2885
|
+
l("div", mc, [
|
|
2886
|
+
l("ol", vc, [
|
|
2887
|
+
(d(!0), p(B, null, I(S.value, (e, u) => (d(), p("li", { key: u }, [
|
|
2888
|
+
l("div", hc, [
|
|
2889
|
+
l("span", _c, f(e.at), 1),
|
|
2890
|
+
$(" · " + f(e.where), 1)
|
|
2822
2891
|
]),
|
|
2823
|
-
|
|
2892
|
+
l("pre", gc, f(e.text), 1)
|
|
2824
2893
|
]))), 128))
|
|
2825
2894
|
]),
|
|
2826
|
-
|
|
2895
|
+
S.value.length === 0 ? (d(), p("p", yc, "这一轮没有报错。")) : k("", !0)
|
|
2827
2896
|
]),
|
|
2828
|
-
|
|
2829
|
-
|
|
2897
|
+
l("footer", kc, [
|
|
2898
|
+
l("button", {
|
|
2830
2899
|
class: "p-button p-button-sm p-button-outlined",
|
|
2831
2900
|
type: "button",
|
|
2832
|
-
onClick: t[38] || (t[38] = (e) =>
|
|
2901
|
+
onClick: t[38] || (t[38] = (e) => ts())
|
|
2833
2902
|
}, "复制全部"),
|
|
2834
|
-
|
|
2903
|
+
l("button", {
|
|
2835
2904
|
class: "p-button p-button-sm p-button-text",
|
|
2836
2905
|
type: "button",
|
|
2837
|
-
onClick: t[39] || (t[39] = (e) =>
|
|
2906
|
+
onClick: t[39] || (t[39] = (e) => be())
|
|
2838
2907
|
}, "清空报错"),
|
|
2839
|
-
|
|
2908
|
+
l("button", {
|
|
2840
2909
|
class: "p-button p-button-sm",
|
|
2841
2910
|
type: "button",
|
|
2842
2911
|
onClick: t[40] || (t[40] = (e) => A.value = !1)
|
|
@@ -2844,43 +2913,43 @@ ${t.text}`).join(`
|
|
|
2844
2913
|
])
|
|
2845
2914
|
])
|
|
2846
2915
|
])) : k("", !0),
|
|
2847
|
-
|
|
2916
|
+
r.value ? (d(), p("button", {
|
|
2848
2917
|
key: 3,
|
|
2849
2918
|
class: "mbc__close",
|
|
2850
2919
|
type: "button",
|
|
2851
2920
|
title: "关掉 magic block 控制台(Esc)",
|
|
2852
|
-
onClick: t[42] || (t[42] = (e) =>
|
|
2921
|
+
onClick: t[42] || (t[42] = (e) => r.value = !1)
|
|
2853
2922
|
}, "×")) : k("", !0)
|
|
2854
2923
|
], 2)) : k("", !0);
|
|
2855
2924
|
}
|
|
2856
|
-
}),
|
|
2857
|
-
Object.assign(
|
|
2925
|
+
}), Bc = /* @__PURE__ */ kn(xc, [["__scopeId", "data-v-3d42c258"]]);
|
|
2926
|
+
Object.assign(Pn, { [Rn]: !0 });
|
|
2858
2927
|
export {
|
|
2859
|
-
|
|
2860
|
-
|
|
2928
|
+
Be as API_BASE,
|
|
2929
|
+
Vs as BLOCK_BACKEND_FILE,
|
|
2861
2930
|
Ht as BLOCK_ENTRY,
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2931
|
+
ke as BLOCK_MANIFEST,
|
|
2932
|
+
Rn as BLOCK_PAGE_MARK,
|
|
2933
|
+
Cs as CLIENT_SOURCE,
|
|
2934
|
+
$e as MANIFEST_KEYS,
|
|
2935
|
+
ln as MANIFEST_REQUIRED,
|
|
2936
|
+
Bc as MagicBlockConsole,
|
|
2937
|
+
Pn as MagicBlockPage,
|
|
2938
|
+
Ie as NAME_MAX,
|
|
2939
|
+
To as blockPlacementProblems,
|
|
2940
|
+
Qs as buildPreview,
|
|
2941
|
+
qs as checkSelection,
|
|
2942
|
+
Co as declaredMissing,
|
|
2943
|
+
On as declaredUuidOf,
|
|
2944
|
+
xo as declaredUuidsOf,
|
|
2945
|
+
Bs as installBridge,
|
|
2946
|
+
Eo as isBlockPage,
|
|
2947
|
+
no as loadBlockRender,
|
|
2948
|
+
to as onBlockRenderRefresh,
|
|
2949
|
+
zs as parseManifest,
|
|
2950
|
+
eo as refreshBlockRender,
|
|
2951
|
+
Oc as setApiBase,
|
|
2952
|
+
Hs as validFileName,
|
|
2953
|
+
Ls as validName,
|
|
2954
|
+
Ks as validateBlock
|
|
2886
2955
|
};
|