labull-framework 1.1.1 → 1.4.0
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/README.md +5 -1
- package/dist/magic-block.js +1165 -1184
- package/dist/style.css +1 -1
- package/dist/types/magic-block-localfs.d.ts +4 -1
- package/dist/types/magic-block-manifest.d.ts +0 -2
- package/package.json +1 -1
package/dist/magic-block.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { shallowRef as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { b as $t, c as
|
|
4
|
-
import { s as
|
|
5
|
-
import { u as
|
|
6
|
-
function
|
|
1
|
+
import { shallowRef as vl, ref as j, computed as z, defineComponent as Ce, watch as Dt, nextTick as on, onMounted as fn, onBeforeUnmount as hn, openBlock as d, createElementBlock as p, normalizeStyle as vn, normalizeClass as Z, unref as G, createElementVNode as a, toDisplayString as f, createCommentVNode as C, Fragment as A, renderList as F, withModifiers as an, getCurrentInstance as gl, createBlock as _l, createTextVNode as x, withDirectives as mt, vModelCheckbox as rs, vModelText as ae, withKeys as yl, vShow as ye, createStaticVNode as kl, vModelSelect as $l, vModelDynamic as xl } from "vue";
|
|
2
|
+
import { useRouter as cs, useRoute as wl } from "vue-router";
|
|
3
|
+
import { b as $t, c as ue, A as we, u as us } from "./chunk-index-BVIJeFeJ.js";
|
|
4
|
+
import { s as ed } from "./chunk-index-BVIJeFeJ.js";
|
|
5
|
+
import { u as Sl, o as rn, b as ds, _ as gn, d as Cl } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-Fky1ghd2.js";
|
|
6
|
+
function El(n) {
|
|
7
7
|
var e = {}, s = [];
|
|
8
8
|
function o(_) {
|
|
9
9
|
return String(_ ?? "");
|
|
@@ -33,8 +33,8 @@ function Tl(n) {
|
|
|
33
33
|
}
|
|
34
34
|
function h(_, y) {
|
|
35
35
|
if (_) {
|
|
36
|
-
for (var g = y && y.steps || [], k = y && y.step ? o(y.step.code) : "", w = -1,
|
|
37
|
-
o(g[
|
|
36
|
+
for (var g = y && y.steps || [], k = y && y.step ? o(y.step.code) : "", w = -1, E = 0; E < g.length; E += 1)
|
|
37
|
+
o(g[E] && g[E].code) === k && (w = E);
|
|
38
38
|
for (var R = '<ol class="labull-steps">', L = 0; L < g.length; L += 1) {
|
|
39
39
|
var $ = w >= 0 && L < w ? " is-done" : L === w ? " is-current" : "";
|
|
40
40
|
R += '<li class="labull-step' + $ + '"><span class="labull-step-node"></span><span class="labull-step-label">' + r(g[L] && g[L].label) + "</span></li>";
|
|
@@ -45,7 +45,7 @@ function Tl(n) {
|
|
|
45
45
|
var v = { register: c, registered: u, mount: b, renderBar: h };
|
|
46
46
|
return n && (n.MagicSteps = v), v;
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const ps = `(${El.toString()})(window)`, wt = "__mb", bs = "call", cn = "reply", ms = "host-ready", fs = "height", Bl = "html, body { overflow: hidden !important; }", hs = `
|
|
49
49
|
(function () {
|
|
50
50
|
var seq = 0, waiting = {}, queue = [], ready = false, last = -1;
|
|
51
51
|
function call(method, args) {
|
|
@@ -53,7 +53,7 @@ const fs = `(${Tl.toString()})(window)`, wt = "__mb", hs = "call", cn = "reply",
|
|
|
53
53
|
function run() {
|
|
54
54
|
var id = ++seq;
|
|
55
55
|
waiting[id] = { resolve: resolve, reject: reject };
|
|
56
|
-
parent.postMessage({ '${wt}': '${
|
|
56
|
+
parent.postMessage({ '${wt}': '${bs}', id: id, method: method, args: args }, '*');
|
|
57
57
|
}
|
|
58
58
|
if (ready) run(); else queue.push(run);
|
|
59
59
|
});
|
|
@@ -61,7 +61,7 @@ const fs = `(${Tl.toString()})(window)`, wt = "__mb", hs = "call", cn = "reply",
|
|
|
61
61
|
window.addEventListener('message', function (event) {
|
|
62
62
|
var data = event.data, pending;
|
|
63
63
|
if (!data || data['${wt}'] === undefined) return;
|
|
64
|
-
if (data['${wt}'] === '${
|
|
64
|
+
if (data['${wt}'] === '${ms}') { ready = true; queue.splice(0).forEach(function (run) { run(); }); return; }
|
|
65
65
|
if (data['${wt}'] !== '${cn}') return;
|
|
66
66
|
if (!(pending = waiting[data.id])) return;
|
|
67
67
|
delete waiting[data.id];
|
|
@@ -112,7 +112,7 @@ const fs = `(${Tl.toString()})(window)`, wt = "__mb", hs = "call", cn = "reply",
|
|
|
112
112
|
if (height > 0) height += 1;
|
|
113
113
|
if (height === last) return; /* 一样高就不再发:否则「宿主改高度 → 触发观察 → 又发一次」会转个不停 */
|
|
114
114
|
last = height;
|
|
115
|
-
parent.postMessage({ '${wt}': '${
|
|
115
|
+
parent.postMessage({ '${wt}': '${fs}', height: height }, '*');
|
|
116
116
|
}
|
|
117
117
|
function start() {
|
|
118
118
|
report();
|
|
@@ -121,34 +121,34 @@ const fs = `(${Tl.toString()})(window)`, wt = "__mb", hs = "call", cn = "reply",
|
|
|
121
121
|
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();
|
|
122
122
|
setInterval(report, 500);
|
|
123
123
|
})();
|
|
124
|
-
`,
|
|
124
|
+
`, Tl = `
|
|
125
125
|
(function () {
|
|
126
126
|
window.addEventListener('keydown', function (event) {
|
|
127
127
|
if (event.key !== 'Escape') return;
|
|
128
128
|
try { var sent = window.magicBlock.done({ closed: 'escape' }); if (sent && sent.catch) sent.catch(function () {}); } catch (error) {}
|
|
129
129
|
});
|
|
130
130
|
})();
|
|
131
|
-
`,
|
|
132
|
-
function
|
|
131
|
+
`, Al = `${hs}${ps}${Tl}`, Ml = `${hs}${ps}`, Ol = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/;
|
|
132
|
+
function vs(n) {
|
|
133
133
|
const e = typeof window > "u" ? "http://localhost" : window.location.href;
|
|
134
134
|
return new URL(`${we}${n}`, e);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function jl() {
|
|
137
137
|
try {
|
|
138
|
-
return
|
|
138
|
+
return vs("").origin;
|
|
139
139
|
} catch {
|
|
140
140
|
return typeof window > "u" ? "" : window.location.origin;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
async function
|
|
144
|
-
if (!
|
|
145
|
-
const o =
|
|
143
|
+
async function Dl(n, e, s) {
|
|
144
|
+
if (!Ol.test(e)) throw new Error(`路由名不合法:${e}(要写成 类名.方法名,例如 Customer.create)`);
|
|
145
|
+
const o = vs(`/bx/${n}/${e}`), r = jl();
|
|
146
146
|
if (o.origin !== r) throw new Error(`后端地址必须是本应用的(${r}):${o.origin}`);
|
|
147
147
|
const c = s instanceof Blob ? s : null, u = await fetch(o.toString(), {
|
|
148
148
|
method: "POST",
|
|
149
149
|
credentials: "include",
|
|
150
150
|
// 带上 HttpOnly 会话 cookie;authHeaders('POST') 给 CSRF 头(缺了 403)
|
|
151
|
-
headers: c ? { "Content-Type": c.type || "application/octet-stream", ...
|
|
151
|
+
headers: c ? { "Content-Type": c.type || "application/octet-stream", ...ue("POST") } : { "Content-Type": "application/json", ...ue("POST") },
|
|
152
152
|
body: c ?? JSON.stringify(s ?? {})
|
|
153
153
|
}), b = await u.text().catch(() => "");
|
|
154
154
|
if (u.ok) {
|
|
@@ -168,7 +168,7 @@ async function Ll(n, e, s) {
|
|
|
168
168
|
}
|
|
169
169
|
throw new Error(h ? `${e} 调用失败:${h.slice(0, 300)}` : `${e} 调用失败(${u.status})`);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Pn(n, e) {
|
|
172
172
|
const s = (u) => {
|
|
173
173
|
try {
|
|
174
174
|
n.contentWindow?.postMessage(u, "*");
|
|
@@ -201,7 +201,7 @@ function Nn(n, e) {
|
|
|
201
201
|
const h = typeof b[0] == "string" ? b[0].trim() : "", v = b[1];
|
|
202
202
|
if (!h) throw new Error("后端调用的路由名是空的:要写成 magicBackendApi.类名.方法名(参数)");
|
|
203
203
|
if (!v || typeof v != "object" || Array.isArray(v)) throw new Error(`magicBackendApi.${h}(params) 的参数要么是一个对象,要么是一个文件(File / Blob)`);
|
|
204
|
-
return await
|
|
204
|
+
return await Dl(e.uuid, h, v);
|
|
205
205
|
}
|
|
206
206
|
throw new Error(`不认识的方法:${String(u)}(这块桥只有 getMe / navigateTab / context / setTabTitle / dialog / backend 六个,外加只在弹窗文档里能用的 done)`);
|
|
207
207
|
}
|
|
@@ -209,12 +209,12 @@ function Nn(n, e) {
|
|
|
209
209
|
if (u.source !== n.contentWindow) return;
|
|
210
210
|
const b = u.data;
|
|
211
211
|
if (!b) return;
|
|
212
|
-
if (b[wt] ===
|
|
212
|
+
if (b[wt] === fs) {
|
|
213
213
|
const v = typeof b.height == "number" ? b.height : NaN;
|
|
214
214
|
Number.isFinite(v) && v > 0 && e.onHeight?.(v);
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
|
-
if (b[wt] !==
|
|
217
|
+
if (b[wt] !== bs) return;
|
|
218
218
|
const h = b.id;
|
|
219
219
|
(async () => {
|
|
220
220
|
try {
|
|
@@ -225,19 +225,19 @@ function Nn(n, e) {
|
|
|
225
225
|
})();
|
|
226
226
|
};
|
|
227
227
|
window.addEventListener("message", r);
|
|
228
|
-
const c = () => s({ [wt]:
|
|
228
|
+
const c = () => s({ [wt]: ms });
|
|
229
229
|
return c(), n.addEventListener("load", c), () => {
|
|
230
230
|
window.removeEventListener("message", r), n.removeEventListener("load", c);
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
|
-
const
|
|
234
|
-
function
|
|
233
|
+
const Rl = ["text", "textarea", "number", "checkbox", "select"], In = 4, un = 20, Nn = 5, qn = 512 * 1024, Ll = 200, gs = 4e3, Rt = 40, Pl = 200, _s = ["__proto__", "constructor", "prototype"];
|
|
234
|
+
function zn(n, e) {
|
|
235
235
|
return typeof n == "string" ? n.trim().slice(0, e) : "";
|
|
236
236
|
}
|
|
237
237
|
function xt(n, e) {
|
|
238
238
|
return typeof n == "string" ? n.trim().slice(0, e) : typeof n == "number" && Number.isFinite(n) ? String(n) : "";
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function Fn(n) {
|
|
241
241
|
if (typeof n != "string") return !1;
|
|
242
242
|
const e = n.trim();
|
|
243
243
|
if (e.length === 0 || e.length > 64 || !/^[a-z0-9.,%()\s+*/-]+$/i.test(e) || !/[0-9]/.test(e)) return !1;
|
|
@@ -248,11 +248,11 @@ function Hn(n) {
|
|
|
248
248
|
return !1;
|
|
249
249
|
return s !== 0 ? !1 : /^(?:min|max|calc)\(/.test(e) ? !0 : /^(?:0|[0-9.]+(?:px|rem|em|%|vh|vw|dvh|svh|ch))$/.test(e);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
const e = n && typeof n == "object" && !Array.isArray(n) ? n : {}, s =
|
|
251
|
+
function Il(n) {
|
|
252
|
+
const e = n && typeof n == "object" && !Array.isArray(n) ? n : {}, s = Fn(e.width) ? e.width.trim() : "", o = Fn(e.height) ? e.height.trim() : "";
|
|
253
253
|
return { width: s, height: o };
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function Nl(n) {
|
|
256
256
|
if (n === void 0) return [];
|
|
257
257
|
if (!Array.isArray(n)) throw new Error("magicBlock.dialog() 的 fields 要给一个数组");
|
|
258
258
|
if (n.length > un) throw new Error(`magicBlock.dialog() 一次最多 ${un} 个字段(给了 ${n.length} 个)`);
|
|
@@ -260,10 +260,10 @@ function zl(n) {
|
|
|
260
260
|
return n.map((s, o) => {
|
|
261
261
|
const r = s && typeof s == "object" && !Array.isArray(s) ? s : {}, c = xt(r.name, Rt);
|
|
262
262
|
if (!c) throw new Error(`magicBlock.dialog() 的第 ${o + 1} 个字段没有 name`);
|
|
263
|
-
if (
|
|
263
|
+
if (_s.includes(c)) throw new Error(`magicBlock.dialog() 的字段名不能叫 ${c}`);
|
|
264
264
|
if (e.has(c)) throw new Error(`magicBlock.dialog() 有两个同名字段:${c}`);
|
|
265
265
|
e.add(c);
|
|
266
|
-
const u =
|
|
266
|
+
const u = Rl.includes(String(r.type)) ? String(r.type) : "text", b = [];
|
|
267
267
|
if (u === "select") {
|
|
268
268
|
const h = Array.isArray(r.options) ? r.options : [];
|
|
269
269
|
for (const v of h) {
|
|
@@ -277,19 +277,19 @@ function zl(n) {
|
|
|
277
277
|
type: u,
|
|
278
278
|
label: xt(r.label, Rt) || c,
|
|
279
279
|
// checkbox 认布尔,其余一律字符串(`<input>` / `<select>` 的值本来就是字符串)。
|
|
280
|
-
value: u === "checkbox" ? r.value === !0 : xt(r.value,
|
|
280
|
+
value: u === "checkbox" ? r.value === !0 : xt(r.value, gs),
|
|
281
281
|
placeholder: xt(r.placeholder, Rt),
|
|
282
|
-
hint: xt(r.hint,
|
|
282
|
+
hint: xt(r.hint, Pl),
|
|
283
283
|
required: r.required === !0,
|
|
284
284
|
options: b
|
|
285
285
|
};
|
|
286
286
|
});
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function ql(n) {
|
|
289
289
|
if (n === void 0) return [{ id: "ok", label: "确定", primary: !0, danger: !1 }];
|
|
290
290
|
if (!Array.isArray(n)) throw new Error("magicBlock.dialog() 的 buttons 要给一个数组");
|
|
291
291
|
if (n.length === 0) throw new Error("magicBlock.dialog() 的 buttons 是空的:至少给一个按钮,不然用户关不掉");
|
|
292
|
-
if (n.length >
|
|
292
|
+
if (n.length > Nn) throw new Error(`magicBlock.dialog() 一次最多 ${Nn} 个按钮(给了 ${n.length} 个)`);
|
|
293
293
|
const e = /* @__PURE__ */ new Set();
|
|
294
294
|
return n.map((s, o) => {
|
|
295
295
|
const r = s && typeof s == "object" && !Array.isArray(s) ? s : {}, c = xt(r.id, Rt);
|
|
@@ -303,7 +303,7 @@ function Fl(n) {
|
|
|
303
303
|
};
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function zl(n) {
|
|
307
307
|
const e = n && typeof n == "object" && !Array.isArray(n) ? n : {};
|
|
308
308
|
if (e.html !== void 0 && typeof e.html != "string")
|
|
309
309
|
throw new Error("magicBlock.dialog() 的 html 要给字符串(块自己写的那一篇弹窗)");
|
|
@@ -312,7 +312,7 @@ function Ul(n) {
|
|
|
312
312
|
const b = ["title", "body", "fields", "buttons"].filter((h) => e[h] !== void 0);
|
|
313
313
|
if (b.length > 0)
|
|
314
314
|
throw new Error(`magicBlock.dialog({ html }) 是"块自己写整篇弹窗",不能再给 ${b.join(" / ")} —— 那些是数据型弹窗的键(长相由宿主定)`);
|
|
315
|
-
if (s.length >
|
|
315
|
+
if (s.length > qn) throw new Error(`magicBlock.dialog() 的 html 太大了(${Math.round(s.length / 1024)} KB,上限 ${qn / 1024} KB)`);
|
|
316
316
|
return {
|
|
317
317
|
mode: "html",
|
|
318
318
|
title: "",
|
|
@@ -320,23 +320,23 @@ function Ul(n) {
|
|
|
320
320
|
fields: [],
|
|
321
321
|
buttons: [],
|
|
322
322
|
html: s,
|
|
323
|
-
size:
|
|
323
|
+
size: Il(e.size),
|
|
324
324
|
dismissible: e.dismissible !== !1
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
327
|
if (e.size !== void 0) throw new Error("magicBlock.dialog() 的 size 只给 html 型弹窗用(数据型的长相由宿主定)");
|
|
328
|
-
const o =
|
|
328
|
+
const o = zn(e.title, Ll), r = zn(e.body, gs), c = Nl(e.fields), u = ql(e.buttons);
|
|
329
329
|
if (!o && !r && c.length === 0)
|
|
330
330
|
throw new Error("magicBlock.dialog() 什么都没给:至少要 title / body / fields 里的一个(要自己写整篇就传 html)");
|
|
331
331
|
return { mode: "data", title: o, body: r, fields: c, buttons: u, html: "", size: { width: "", height: "" }, dismissible: e.dismissible !== !1 };
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function ys(n) {
|
|
334
334
|
const e = {};
|
|
335
335
|
if (!n || typeof n != "object" || Array.isArray(n)) return e;
|
|
336
336
|
let s = 0;
|
|
337
337
|
for (const [o, r] of Object.entries(n)) {
|
|
338
338
|
if (s >= un * 2) break;
|
|
339
|
-
if (
|
|
339
|
+
if (!_s.includes(o)) {
|
|
340
340
|
if (typeof r == "string" || typeof r == "number" || typeof r == "boolean") e[o] = r;
|
|
341
341
|
else if (Array.isArray(r)) {
|
|
342
342
|
const c = r.filter((u) => typeof u == "string" || typeof u == "number" || typeof u == "boolean");
|
|
@@ -347,54 +347,54 @@ function xs(n) {
|
|
|
347
347
|
}
|
|
348
348
|
return e;
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function Fl(n) {
|
|
351
351
|
const e = n && typeof n == "object" && !Array.isArray(n) ? n : {}, s = xt(e.button, Rt) || null, o = e.closed === "escape" || e.closed === "backdrop" || e.closed === "host" ? e.closed : "button";
|
|
352
|
-
return { button: s, values:
|
|
352
|
+
return { button: s, values: ys(e.values), closed: o };
|
|
353
353
|
}
|
|
354
|
-
const At =
|
|
355
|
-
let
|
|
356
|
-
const
|
|
357
|
-
function
|
|
358
|
-
return { current:
|
|
354
|
+
const At = vl([]), _n = j(!1);
|
|
355
|
+
let Ul = 0;
|
|
356
|
+
const Hl = z(() => At.value[At.value.length - 1] ?? null);
|
|
357
|
+
function Wl() {
|
|
358
|
+
return { current: Hl, ready: _n };
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function Un(n) {
|
|
361
361
|
_n.value = n;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Kl(n) {
|
|
364
364
|
return At.value.some((e) => e.id === n);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Ee(n, e) {
|
|
367
367
|
n.answered || (n.answered = !0, At.value = At.value.filter((s) => s !== n), n.resolve(e));
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
|
|
369
|
+
function Vl(n, e, s = {}) {
|
|
370
|
+
Ee(n, { button: e, values: ys(s), closed: "button" });
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
n.options.dismissible &&
|
|
372
|
+
function Xe(n, e) {
|
|
373
|
+
n.options.dismissible && Ee(n, { button: null, values: {}, closed: e });
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
const s =
|
|
377
|
-
return (s.closed === "escape" || s.closed === "backdrop") && !n.options.dismissible ? !1 : (
|
|
375
|
+
function Gl(n, e) {
|
|
376
|
+
const s = Fl(e);
|
|
377
|
+
return (s.closed === "escape" || s.closed === "backdrop") && !n.options.dismissible ? !1 : (Ee(n, s), !0);
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Hn(n) {
|
|
380
380
|
for (const e of [...At.value])
|
|
381
|
-
e.uuid === n &&
|
|
381
|
+
e.uuid === n && Ee(e, { button: null, values: {}, closed: "host" });
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Jl(n, e) {
|
|
384
384
|
let s;
|
|
385
385
|
try {
|
|
386
|
-
s =
|
|
386
|
+
s = zl(n);
|
|
387
387
|
} catch (r) {
|
|
388
388
|
return Promise.reject(r);
|
|
389
389
|
}
|
|
390
390
|
if (!_n.value)
|
|
391
391
|
return Promise.reject(new Error("这个应用没挂 <MagicBlockDialogs />:弹窗宿主不在,magicBlock.dialog() 用不了"));
|
|
392
|
-
if (At.value.length >=
|
|
393
|
-
return Promise.reject(new Error(`已经有 ${
|
|
392
|
+
if (At.value.length >= In)
|
|
393
|
+
return Promise.reject(new Error(`已经有 ${In} 个弹窗没关了:先把上面的关掉(弹窗会排成一摞,只有最上面那个能点)`));
|
|
394
394
|
if (s.mode === "html" && !e.buildDoc)
|
|
395
395
|
return Promise.reject(new Error("宿主没给出弹窗文档的拼装方式(HostDialogContext.buildDoc):html 型弹窗用不了"));
|
|
396
396
|
const o = {
|
|
397
|
-
id:
|
|
397
|
+
id: Ul += 1,
|
|
398
398
|
uuid: e.uuid,
|
|
399
399
|
options: s,
|
|
400
400
|
doc: s.mode === "html" ? e.buildDoc(s.html) : "",
|
|
@@ -407,14 +407,11 @@ function Yl(n, e) {
|
|
|
407
407
|
o.resolve = r, At.value = [...At.value, o];
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
|
-
const
|
|
411
|
-
function
|
|
412
|
-
return String(n ?? "").split("/").some((e) => e.startsWith(ao));
|
|
413
|
-
}
|
|
414
|
-
function io(n) {
|
|
410
|
+
const Kt = "index.open.html", Ze = "magic-block.open.yaml", Wn = "README.open.md", Kn = "requires.open.yaml", Qe = ["id", "module", "name", "brief", "type", "requires"], Vn = ["id", "module", "name", "brief"], Yl = ["detail"], ie = ["models", "surface", "packages", "settings", "config", "routes", "opaque"], Xl = "surface", yn = 40, Zl = /^(?![A-Za-z]:)(?!\/)[^\\:*?"<>|\u0000-\u001f\u007f]+$/, Ql = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, to = /^[a-z][a-z0-9]*$/, eo = /^[a-z][A-Za-z0-9]*$/, no = /^[A-Za-z_][A-Za-z0-9_]*$/, so = /^([|>])([-+]?)$/;
|
|
411
|
+
function lo(n) {
|
|
415
412
|
return n.length > 0 && n.length <= yn && !/[\u0000-\u001f\u007f]/.test(n);
|
|
416
413
|
}
|
|
417
|
-
const
|
|
414
|
+
const oo = {
|
|
418
415
|
id: "块的 uuid,必须与页面里挂载它时写死的那个 uuid 逐字一致",
|
|
419
416
|
module: "模块名(小写字母与数字,必须以字母开头),例如 home",
|
|
420
417
|
name: `可读名:可以用中文,不超过 ${yn} 个字符`,
|
|
@@ -424,7 +421,7 @@ const ro = {
|
|
|
424
421
|
type: '块类型(可选):plain(缺省,一行都不写)/ workflow(流程块,必须有 flow.py)。它只回答"哪一类块",不回答"哪条流程"(流程声明住在 flow.py)',
|
|
425
422
|
requires: "依赖声明(可选):用了哪些项目模型 / 方法 / pip 包 / settings 键 / BLOCK_* 变量 / 跨块路由;草稿由导出铺的 requires.open.yaml 给(扫代码得出来的建议写在注释里)"
|
|
426
423
|
};
|
|
427
|
-
function
|
|
424
|
+
function Gn(n) {
|
|
428
425
|
const e = Object.keys(n);
|
|
429
426
|
return e.length > 0 ? `现在包里有:${e.join(" / ")}` : "现在这个包是空的";
|
|
430
427
|
}
|
|
@@ -453,7 +450,7 @@ function kn(n) {
|
|
|
453
450
|
function Te(n) {
|
|
454
451
|
return !n || n[0] !== '"' && n[0] !== "'" ? n : n.length >= 2 && n[n.length - 1] === n[0] ? n.slice(1, -1).trim() : n;
|
|
455
452
|
}
|
|
456
|
-
function
|
|
453
|
+
function ao(n) {
|
|
457
454
|
const e = [...n];
|
|
458
455
|
for (; e.length > 0 && !e[0].trim(); ) e.shift();
|
|
459
456
|
for (; e.length > 0 && !e[e.length - 1].trim(); ) e.pop();
|
|
@@ -461,7 +458,7 @@ function co(n) {
|
|
|
461
458
|
return e.map((r) => r.trim() ? r.slice(o) : "").join(`
|
|
462
459
|
`);
|
|
463
460
|
}
|
|
464
|
-
function
|
|
461
|
+
function ks(n) {
|
|
465
462
|
const e = n.trim();
|
|
466
463
|
if (!e.startsWith("[") || !e.endsWith("]")) return null;
|
|
467
464
|
const s = e.slice(1, -1).trim();
|
|
@@ -470,7 +467,7 @@ function ws(n) {
|
|
|
470
467
|
function Ae(n) {
|
|
471
468
|
return n.length - n.trimStart().length;
|
|
472
469
|
}
|
|
473
|
-
function
|
|
470
|
+
function $s(n, e, s, o, r) {
|
|
474
471
|
const c = [];
|
|
475
472
|
for (; e < n.length; ) {
|
|
476
473
|
const u = n[e];
|
|
@@ -494,7 +491,7 @@ function Ss(n, e, s, o, r) {
|
|
|
494
491
|
}
|
|
495
492
|
return [c, e];
|
|
496
493
|
}
|
|
497
|
-
function
|
|
494
|
+
function io(n, e, s, o) {
|
|
498
495
|
const r = {};
|
|
499
496
|
for (; e < n.length; ) {
|
|
500
497
|
const c = n[e];
|
|
@@ -524,7 +521,7 @@ function uo(n, e, s, o) {
|
|
|
524
521
|
o.push(`第 ${b} 行重复写了 requires.surface.${_}:一个模型只许出现一次`);
|
|
525
522
|
continue;
|
|
526
523
|
}
|
|
527
|
-
const g =
|
|
524
|
+
const g = ks(y);
|
|
528
525
|
if (g !== null) {
|
|
529
526
|
r[_] = g;
|
|
530
527
|
continue;
|
|
@@ -533,12 +530,12 @@ function uo(n, e, s, o) {
|
|
|
533
530
|
o.push(`第 ${b} 行:requires.surface.${_} 的值只许是 [方法名, …] 或下面每行一个 - 方法名(读到 ${y})`);
|
|
534
531
|
continue;
|
|
535
532
|
}
|
|
536
|
-
const [k, w] =
|
|
533
|
+
const [k, w] = $s(n, e, u, `requires.surface.${_}`, o);
|
|
537
534
|
e = w, r[_] = k;
|
|
538
535
|
}
|
|
539
536
|
return [r, e];
|
|
540
537
|
}
|
|
541
|
-
function
|
|
538
|
+
function ro(n, e, s, o) {
|
|
542
539
|
const r = {}, c = {};
|
|
543
540
|
for (; e < n.length; ) {
|
|
544
541
|
const u = n[e];
|
|
@@ -551,29 +548,29 @@ function po(n, e, s, o) {
|
|
|
551
548
|
const h = e + 1, v = Be(u).trim();
|
|
552
549
|
if (e += 1, !v) continue;
|
|
553
550
|
if (v.startsWith("-")) {
|
|
554
|
-
o.push(`第 ${h} 行:requires 下面第一层只许写七个键里的一个(${
|
|
551
|
+
o.push(`第 ${h} 行:requires 下面第一层只许写七个键里的一个(${ie.join(" / ")}),不是列表项(读到 ${v})`);
|
|
555
552
|
continue;
|
|
556
553
|
}
|
|
557
554
|
const _ = kn(v);
|
|
558
555
|
if (_ < 0) {
|
|
559
|
-
o.push(`第 ${h} 行不是「键: 值」(${v}):requires 下面要写 ${
|
|
556
|
+
o.push(`第 ${h} 行不是「键: 值」(${v}):requires 下面要写 ${ie.join(" / ")} 里的一个,值缩进在它下面`);
|
|
560
557
|
continue;
|
|
561
558
|
}
|
|
562
559
|
const y = v.slice(0, _).trim(), g = v.slice(_ + 1).trim();
|
|
563
|
-
if (!
|
|
564
|
-
o.push(`第 ${h} 行的键不认识(${y}):requires 只有 ${
|
|
560
|
+
if (!ie.includes(y)) {
|
|
561
|
+
o.push(`第 ${h} 行的键不认识(${y}):requires 只有 ${ie.join(" / ")} 这几个键`);
|
|
565
562
|
continue;
|
|
566
563
|
}
|
|
567
564
|
if (c[y]) {
|
|
568
565
|
o.push(`第 ${h} 行重复写了 requires.${y}:一个键只许出现一次`);
|
|
569
566
|
continue;
|
|
570
567
|
}
|
|
571
|
-
if (c[y] = !0, y ===
|
|
572
|
-
const [R, L] =
|
|
568
|
+
if (c[y] = !0, y === Xl) {
|
|
569
|
+
const [R, L] = io(n, e, b, o);
|
|
573
570
|
e = L, r.surface = R;
|
|
574
571
|
continue;
|
|
575
572
|
}
|
|
576
|
-
const k =
|
|
573
|
+
const k = ks(g);
|
|
577
574
|
if (k !== null) {
|
|
578
575
|
r[y] = k;
|
|
579
576
|
continue;
|
|
@@ -582,12 +579,12 @@ function po(n, e, s, o) {
|
|
|
582
579
|
o.push(`第 ${h} 行:requires.${y} 的值只许是每行一个 - 项 或一行写完的 [a, b](读到 ${g})`);
|
|
583
580
|
continue;
|
|
584
581
|
}
|
|
585
|
-
const [w,
|
|
586
|
-
e =
|
|
582
|
+
const [w, E] = $s(n, e, b, `requires.${y}`, o);
|
|
583
|
+
e = E, r[y] = w;
|
|
587
584
|
}
|
|
588
585
|
return [r, e];
|
|
589
586
|
}
|
|
590
|
-
function
|
|
587
|
+
function co(n, e = !0) {
|
|
591
588
|
const s = [], o = {}, r = {}, c = n.split(/\r?\n/);
|
|
592
589
|
let u = 0;
|
|
593
590
|
for (; u < c.length; ) {
|
|
@@ -605,13 +602,13 @@ function bo(n, e = !0) {
|
|
|
605
602
|
continue;
|
|
606
603
|
}
|
|
607
604
|
const g = _.slice(0, y).trim();
|
|
608
|
-
if (!
|
|
605
|
+
if (!no.test(g)) {
|
|
609
606
|
s.push(`第 ${h} 行的键名不合法(${g}):键名只许字母或下划线开头,认得的键只有 ${Qe.join(" / ")}`);
|
|
610
607
|
continue;
|
|
611
608
|
}
|
|
612
|
-
if (!(Qe.includes(g) ||
|
|
609
|
+
if (!(Qe.includes(g) || Yl.includes(g))) {
|
|
613
610
|
s.push(
|
|
614
|
-
`第 ${h} 行的键不认识(${g}):清单只有 ${Qe.join(" / ")} 这几个键(其中 ${
|
|
611
|
+
`第 ${h} 行的键不认识(${g}):清单只有 ${Qe.join(" / ")} 这几个键(其中 ${Vn.join(" / ")} 必填,type 与 requires 可以不写)`
|
|
615
612
|
);
|
|
616
613
|
continue;
|
|
617
614
|
}
|
|
@@ -623,98 +620,98 @@ function bo(n, e = !0) {
|
|
|
623
620
|
const w = _.slice(y + 1).trim();
|
|
624
621
|
if (g === "requires") {
|
|
625
622
|
if (w) {
|
|
626
|
-
s.push(`第 ${h} 行:requires 要写成下面缩进的那一块(不支持一行写完),例如 requires: 换行后缩进两格再写 ${
|
|
623
|
+
s.push(`第 ${h} 行:requires 要写成下面缩进的那一块(不支持一行写完),例如 requires: 换行后缩进两格再写 ${ie.join(" / ")} 里的一个`);
|
|
627
624
|
continue;
|
|
628
625
|
}
|
|
629
|
-
const [R, L] =
|
|
626
|
+
const [R, L] = ro(c, u, v, s);
|
|
630
627
|
u = L, o.requires = R;
|
|
631
628
|
continue;
|
|
632
629
|
}
|
|
633
|
-
const
|
|
634
|
-
if (
|
|
630
|
+
const E = so.exec(w);
|
|
631
|
+
if (E) {
|
|
635
632
|
const R = [];
|
|
636
633
|
for (; u < c.length; ) {
|
|
637
634
|
const $ = c[u];
|
|
638
635
|
if ($.trim() && !/^\s/.test($)) break;
|
|
639
636
|
R.push($), u += 1;
|
|
640
637
|
}
|
|
641
|
-
let L =
|
|
642
|
-
|
|
638
|
+
let L = ao(R);
|
|
639
|
+
E[1] === ">" && (L = L.split(`
|
|
643
640
|
`).map(($) => $.trim()).filter(Boolean).join(" ")), o[g] = L;
|
|
644
641
|
continue;
|
|
645
642
|
}
|
|
646
643
|
o[g] = Te(w);
|
|
647
644
|
}
|
|
648
645
|
if (!e) return [o, s];
|
|
649
|
-
for (const b of
|
|
646
|
+
for (const b of Vn) {
|
|
650
647
|
const h = o[b] ?? "";
|
|
651
648
|
if (h === "") {
|
|
652
|
-
s.push(`清单里缺少 ${b}(或者是空的):${
|
|
649
|
+
s.push(`清单里缺少 ${b}(或者是空的):${oo[b]}`);
|
|
653
650
|
continue;
|
|
654
651
|
}
|
|
655
|
-
b === "id" && !
|
|
652
|
+
b === "id" && !Ql.test(h) ? s.push(`清单里的 id 不是 uuid:${h} —— 要 8-4-4-4-12 那种十六进制`) : b === "module" && !to.test(h) ? s.push(
|
|
656
653
|
`清单里的 module 不合法:${h} —— 它同时是 Django 的 app label,所以只许小写字母与数字、必须以字母开头(不能有横线与下划线),例如 home / orders`
|
|
657
|
-
) : b === "name" && !
|
|
654
|
+
) : b === "name" && !lo(h) && s.push(`清单里的 name 不合法:${h} —— 不能超过 ${yn} 个字符、不能含控制字符(中文可以)`);
|
|
658
655
|
}
|
|
659
656
|
if (typeof o.type == "string") {
|
|
660
657
|
const b = o.type.trim(), h = r.type ?? 0;
|
|
661
|
-
b === "" ? s.push(`第 ${h} 行:type 是空的 —— 要么整行不写(缺省就是 plain),要么写一种类型(plain / workflow)`) :
|
|
658
|
+
b === "" ? s.push(`第 ${h} 行:type 是空的 —— 要么整行不写(缺省就是 plain),要么写一种类型(plain / workflow)`) : eo.test(b) || s.push(`第 ${h} 行:type 的写法不合法(${b})—— 只许小写字母开头、后面是字母与数字(plain / workflow)`);
|
|
662
659
|
}
|
|
663
660
|
return [o, s];
|
|
664
661
|
}
|
|
665
|
-
function
|
|
666
|
-
return
|
|
662
|
+
function uo(n) {
|
|
663
|
+
return Zl.test(n) && !n.split("/").includes("..");
|
|
667
664
|
}
|
|
668
|
-
function
|
|
669
|
-
const e = [], s = n[
|
|
670
|
-
s === void 0 ? e.push(`包里缺入口:必须有 ${
|
|
665
|
+
function po(n) {
|
|
666
|
+
const e = [], s = n[Kt];
|
|
667
|
+
s === void 0 ? e.push(`包里缺入口:必须有 ${Kt}(${Gn(n)})`) : s.trim() || e.push(`${Kt} 不能是空文件`);
|
|
671
668
|
const o = n[Ze];
|
|
672
669
|
let r = {};
|
|
673
670
|
if (o === void 0)
|
|
674
|
-
e.push(`包里缺清单:必须有 ${Ze}(${
|
|
671
|
+
e.push(`包里缺清单:必须有 ${Ze}(${Gn(n)})`);
|
|
675
672
|
else if (!o.trim())
|
|
676
673
|
e.push(`${Ze} 不能是空文件`);
|
|
677
674
|
else {
|
|
678
|
-
const [c, u] =
|
|
675
|
+
const [c, u] = co(o);
|
|
679
676
|
r = c, e.push(...u);
|
|
680
677
|
}
|
|
681
678
|
for (const c of Object.keys(n))
|
|
682
|
-
|
|
679
|
+
uo(c) || e.push(`文件名不合法:${c}(不许反斜杠 / 冒号 / 星号问号这类字符 / 控制字符,也不许 .. 与绝对路径;中文可以)`);
|
|
683
680
|
return { manifest: r, issues: e };
|
|
684
681
|
}
|
|
685
|
-
function
|
|
682
|
+
function bo(n) {
|
|
686
683
|
const e = [];
|
|
687
684
|
if (n.length === 0)
|
|
688
685
|
return e.push("一个块都没勾:请在「读回改动」的结果里勾上要保存的块"), { selected: 0, issues: e };
|
|
689
686
|
for (const s of n) {
|
|
690
687
|
const o = s.name?.trim() || "(没有名字的块)";
|
|
691
|
-
for (const r of
|
|
688
|
+
for (const r of po(s.files ?? {}).issues) e.push(`${o}:${r}`);
|
|
692
689
|
}
|
|
693
690
|
return { selected: n.length, issues: e };
|
|
694
691
|
}
|
|
695
|
-
const Lt = "labull.css",
|
|
696
|
-
function
|
|
692
|
+
const Lt = "labull.css", re = "CONTROLS.lock.html";
|
|
693
|
+
function mo(n, e) {
|
|
697
694
|
const s = String(e || "");
|
|
698
695
|
if (/@font-face|@keyframes/i.test(s)) return !0;
|
|
699
696
|
const o = String(n || "");
|
|
700
697
|
return /(^|[\s,>+~])(\.p-|\.pi(?![a-z])|\.pi-|\.labull-|\[hidden\]|:root|html(?![a-z-])|body(?![a-z-])|\*|:where\()/.test(o) ? !0 : /--(?:sp|surface|primary|text-color|content|highlight|focus-ring|p-)/.test(s);
|
|
701
698
|
}
|
|
702
|
-
function
|
|
699
|
+
function fo(n) {
|
|
703
700
|
return [...String(n || "").matchAll(/<style\b[^>]*>([\s\S]*?)<\/style\s*>/gi)].map((e) => e[1] ?? "");
|
|
704
701
|
}
|
|
705
|
-
function
|
|
702
|
+
function ho(n) {
|
|
706
703
|
return [...String(n || "").matchAll(/<link\b[^>]*>/gi)].filter((e) => /\brel\s*=\s*(?:"|')?stylesheet/i.test(e[0])).map((e) => e[0]);
|
|
707
704
|
}
|
|
708
|
-
function
|
|
705
|
+
function vo(n) {
|
|
709
706
|
return [
|
|
710
|
-
...
|
|
707
|
+
...fo(n).map((e) => `<style>
|
|
711
708
|
${e}
|
|
712
709
|
</style>`),
|
|
713
|
-
...
|
|
710
|
+
...ho(n)
|
|
714
711
|
].join(`
|
|
715
712
|
`);
|
|
716
713
|
}
|
|
717
|
-
function
|
|
714
|
+
function go(n, e) {
|
|
718
715
|
if (!e) return n;
|
|
719
716
|
const s = /<body\b[^>]*>/i.exec(n);
|
|
720
717
|
if (!s) return `${e}
|
|
@@ -724,7 +721,7 @@ ${n}`;
|
|
|
724
721
|
${e}
|
|
725
722
|
${n.slice(o)}`;
|
|
726
723
|
}
|
|
727
|
-
function
|
|
724
|
+
function _o(n) {
|
|
728
725
|
return /<!doctype|<html[\s>]/i.test(n) ? n : `<!doctype html>
|
|
729
726
|
<html lang="zh">
|
|
730
727
|
<head>
|
|
@@ -737,12 +734,12 @@ ${n}
|
|
|
737
734
|
</html>
|
|
738
735
|
`;
|
|
739
736
|
}
|
|
740
|
-
function
|
|
737
|
+
function xs(n, e, s) {
|
|
741
738
|
for (let o = 0; o < n.length; o += 1) {
|
|
742
739
|
const r = n[o], c = String(r.cssText || ""), u = String(r.selectorText || "");
|
|
743
740
|
if (r.cssRules && r.cssRules.length > 0) {
|
|
744
741
|
const b = [];
|
|
745
|
-
if (
|
|
742
|
+
if (xs(r.cssRules, b, s), b.length === 0) continue;
|
|
746
743
|
const h = c.slice(0, c.indexOf("{")).trim();
|
|
747
744
|
e.push(`${h} {
|
|
748
745
|
${b.map((v) => " " + v).join(`
|
|
@@ -750,10 +747,10 @@ ${b.map((v) => " " + v).join(`
|
|
|
750
747
|
}`);
|
|
751
748
|
continue;
|
|
752
749
|
}
|
|
753
|
-
|
|
750
|
+
mo(u, c) && (e.push(c), s.n += 1);
|
|
754
751
|
}
|
|
755
752
|
}
|
|
756
|
-
function
|
|
753
|
+
function ws() {
|
|
757
754
|
const n = [], e = [], s = { n: 0 };
|
|
758
755
|
let o = 0;
|
|
759
756
|
const r = typeof document > "u" ? [] : Array.from(document.styleSheets);
|
|
@@ -768,7 +765,7 @@ function Cs() {
|
|
|
768
765
|
}
|
|
769
766
|
if (!h || h.length === 0) continue;
|
|
770
767
|
const v = [];
|
|
771
|
-
|
|
768
|
+
xs(h, v, s), v.length !== 0 && (o += 1, n.push(`/* ── ${b} ── */`, ...v));
|
|
772
769
|
}
|
|
773
770
|
return { css: [
|
|
774
771
|
"/* 生成物:每次导出都会重写,别手改。",
|
|
@@ -782,7 +779,7 @@ function Cs() {
|
|
|
782
779
|
' * `<div class="labull-bar">` / `<section class="labull-card">` / `<div class="labull-table-wrap">`(工具类见下)。',
|
|
783
780
|
" *",
|
|
784
781
|
" * 怎么查(别在这一份里翻 —— 它是一段**按加载顺序拼起来的大 CSS**,没有目录):",
|
|
785
|
-
" * ① **要找一个类名 / token / 现成的 markup** ⇒ 打开同目录的 `" +
|
|
782
|
+
" * ① **要找一个类名 / token / 现成的 markup** ⇒ 打开同目录的 `" + re + "`:",
|
|
786
783
|
" * 顶上有搜索框(输「表格」「卡片」「--sp-space-3」「p-tag」都能命中),",
|
|
787
784
|
" * 下面依次是**照抄的配方** / **token 表** / **常见的写错的名字** / **全部类名(按家族)**。",
|
|
788
785
|
" * ② **要看某一条具体怎么写** ⇒ 在这一份里 Ctrl+F 搜选择器本身(`.p-tag` / `--sp-space-3`)。",
|
|
@@ -798,11 +795,11 @@ function Cs() {
|
|
|
798
795
|
`) + `
|
|
799
796
|
`, sheets: o, skipped: e, rules: s.n };
|
|
800
797
|
}
|
|
801
|
-
function
|
|
798
|
+
function Jn(n) {
|
|
802
799
|
const e = n.split("__")[0].split("--")[0].split("-");
|
|
803
800
|
return e[0] === "p" ? `p-${e[1] || ""}` : e[0] === "labull" ? `labull-${e[1] || ""}` : e[0] || n;
|
|
804
801
|
}
|
|
805
|
-
function
|
|
802
|
+
function yo(n) {
|
|
806
803
|
const e = String(n || ""), s = /* @__PURE__ */ new Map(), o = [], r = /* @__PURE__ */ new Set();
|
|
807
804
|
let c = 0;
|
|
808
805
|
const u = e.replace(/\/\*[\s\S]*?\*\//g, " ");
|
|
@@ -814,21 +811,21 @@ function xo(n) {
|
|
|
814
811
|
const w = k[1].trim();
|
|
815
812
|
if (!w.startsWith("@")) {
|
|
816
813
|
c += 1;
|
|
817
|
-
for (const
|
|
818
|
-
const R =
|
|
814
|
+
for (const E of w.matchAll(/\.(-?[A-Za-z_][\w-]*)/g)) {
|
|
815
|
+
const R = E[1];
|
|
819
816
|
s.set(R, (s.get(R) ?? 0) + 1);
|
|
820
817
|
}
|
|
821
818
|
}
|
|
822
819
|
}
|
|
823
820
|
const b = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Set();
|
|
824
821
|
let _ = 0;
|
|
825
|
-
const y = (k, w,
|
|
822
|
+
const y = (k, w, E) => {
|
|
826
823
|
const R = k.get(w);
|
|
827
|
-
R ? R.push(
|
|
824
|
+
R ? R.push(E) : k.set(w, [E]);
|
|
828
825
|
};
|
|
829
826
|
for (const [k, w] of s)
|
|
830
|
-
k.startsWith("labull-") ? y(b,
|
|
831
|
-
const g = (k) => [...k.entries()].map(([w,
|
|
827
|
+
k.startsWith("labull-") ? y(b, Jn(k), { name: k, count: w }) : k === "pi" || k.startsWith("pi-") ? k !== "pi" && v.add(k) : k.startsWith("p-") ? y(h, Jn(k), { name: k, count: w }) : _ += 1;
|
|
828
|
+
const g = (k) => [...k.entries()].map(([w, E]) => ({ family: w, members: E.slice().sort((R, L) => R.name.localeCompare(L.name)) })).sort((w, E) => E.members.length - w.members.length || w.family.localeCompare(E.family));
|
|
832
829
|
return {
|
|
833
830
|
tokens: o,
|
|
834
831
|
families: g(b),
|
|
@@ -839,25 +836,25 @@ function xo(n) {
|
|
|
839
836
|
rules: c
|
|
840
837
|
};
|
|
841
838
|
}
|
|
842
|
-
function
|
|
839
|
+
function bt(n) {
|
|
843
840
|
return String(n).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
844
841
|
}
|
|
845
842
|
function Ot(n) {
|
|
846
|
-
return
|
|
843
|
+
return bt(n).replace(/"/g, """);
|
|
847
844
|
}
|
|
848
845
|
function ke(n) {
|
|
849
846
|
return String(n).replace(/<[^>]+>/g, " ");
|
|
850
847
|
}
|
|
851
|
-
function
|
|
848
|
+
function Yn(n) {
|
|
852
849
|
return n.startsWith("--sp-space") ? "间距" : n.startsWith("--sp-radius") ? "圆角" : n.startsWith("--sp-color-border") ? "描边" : n.startsWith("--sp-color-surface") ? "面(底色 / 卡片 / 凹陷)" : n.startsWith("--sp-color-text") ? "文字色" : n.startsWith("--sp-color-primary") ? "主色" : n.startsWith("--sp-color-hover") ? "悬停底色" : n.startsWith("--sp-color-active") ? "选中底色" : n.startsWith("--sp-color-success") ? "成功" : n.startsWith("--sp-color-warn") ? "警告" : n.startsWith("--sp-color-danger") ? "危险 / 失败" : n.startsWith("--sp-color") ? "颜色" : n.startsWith("--sp-font-weight") ? "字重" : n.startsWith("--sp-font") ? "字号" : n.startsWith("--sp-line-height") ? "行高" : n.startsWith("--sp-layout") ? "外壳尺寸(app bar / 图标栏 / 标签栏)" : n.startsWith("--sp-shadow") ? "阴影" : n.startsWith("--sp-border") || n.startsWith("--sp-focus") ? "描边 / 焦点圈" : n.startsWith("--sp-control") ? "控件高度" : n.startsWith("--sp-transition") ? "过渡" : "";
|
|
853
850
|
}
|
|
854
|
-
function
|
|
855
|
-
const e =
|
|
851
|
+
function ko(n = "") {
|
|
852
|
+
const e = yo(n), s = e.total > 0, o = '<button class="p-button" type="button">主要按钮</button>', r = ($, N, V) => ` <li class="labull-step${$ ? ` ${$}` : ""}">
|
|
856
853
|
<span class="labull-step-node"></span>
|
|
857
854
|
<span class="labull-step-label">${N}</span>
|
|
858
855
|
<span class="labull-step-desc">${V}</span>
|
|
859
856
|
</li>`, c = ($, N = "") => `<ol class="labull-steps${N ? ` ${N}` : ""}">
|
|
860
|
-
` + $.map(([V, et,
|
|
857
|
+
` + $.map(([V, et, vt]) => r(V, et, vt)).join(`
|
|
861
858
|
`) + `
|
|
862
859
|
</ol>`, u = c([
|
|
863
860
|
["is-done", "草稿", "需求已创建"],
|
|
@@ -1156,13 +1153,13 @@ function wo(n = "") {
|
|
|
1156
1153
|
<h3>${$.title}</h3>
|
|
1157
1154
|
${$.note ? `<p class="ix-note">${$.note}</p>` : ""}
|
|
1158
1155
|
<div class="ix-demo">${$.markup}</div>
|
|
1159
|
-
<pre>${
|
|
1156
|
+
<pre>${bt($.markup)}</pre>
|
|
1160
1157
|
</section>`, v = b.map(
|
|
1161
1158
|
($, N) => `
|
|
1162
1159
|
<h2 id="ix-g${N}" data-search="${Ot(`${$.title} ${$.keys}`)}">${$.title}</h2>
|
|
1163
1160
|
${$.recipes.map(h).join("")}`
|
|
1164
1161
|
).join(""), _ = e.tokens.map(
|
|
1165
|
-
([$, N]) => `<tr data-search="${Ot(`${$} ${N} ${
|
|
1162
|
+
([$, N]) => `<tr data-search="${Ot(`${$} ${N} ${Yn($)}`)}"><td><code>${bt($)}</code><span class="ix-use">${bt(Yn($))}</span></td><td><code>${bt(N)}</code></td></tr>`
|
|
1166
1163
|
).join(`
|
|
1167
1164
|
`), y = s ? `<table class="ix-table ix-tokens"><thead><tr><th>token(${e.tokens.length} 个)</th><th>此刻的值</th></tr></thead><tbody>
|
|
1168
1165
|
${_}
|
|
@@ -1175,17 +1172,17 @@ function wo(n = "") {
|
|
|
1175
1172
|
["--sp-color-bg", "--sp-color-surface(灰底)/ --sp-color-surface-raised(白底)", "没有 <code>-bg</code>。"],
|
|
1176
1173
|
["--text-color-secondary 当作 <code>--sp-*</code>", "两者都在:<code>--text-color-secondary</code>(PrimeVue)与 <code>--sp-color-text-muted</code>(labull)", "指同一件事的两个名字,都认。<b>别在同一份 CSS 里两个都写</b>。"]
|
|
1177
1174
|
].map(
|
|
1178
|
-
([$, N, V]) => `<tr data-search="${Ot(`${$} ${ke(N)} 写错 正名 ${ke(V)}`)}"><td><code>${
|
|
1175
|
+
([$, N, V]) => `<tr data-search="${Ot(`${$} ${ke(N)} 写错 正名 ${ke(V)}`)}"><td><code>${bt($)}</code></td><td><code>${bt(N)}</code></td><td>${V}</td></tr>`
|
|
1179
1176
|
).join(`
|
|
1180
1177
|
`), w = e.families.map(
|
|
1181
|
-
($) => `<tr data-search="${Ot(`${$.family} ${$.members.map((N) => N.name).join(" ")}`)}"><td><code>${
|
|
1178
|
+
($) => `<tr data-search="${Ot(`${$.family} ${$.members.map((N) => N.name).join(" ")}`)}"><td><code>${bt($.family)}</code></td><td>${$.members.map((N) => `<code>${bt(N.name)}</code>`).join(" ")}</td><td class="ix-num">${$.members.length}</td></tr>`
|
|
1182
1179
|
).join(`
|
|
1183
|
-
`),
|
|
1184
|
-
const N = $.members.slice(0, 8).map((et) => `<code>${
|
|
1185
|
-
return `<tr data-search="${Ot(`${$.family} ${$.members.map((et) => et.name).join(" ")}`)}"><td><code>${
|
|
1180
|
+
`), E = e.prime.map(($) => {
|
|
1181
|
+
const N = $.members.slice(0, 8).map((et) => `<code>${bt(et.name)}</code>`).join(" "), V = $.members.length > 8 ? ` <span class="ix-more">…共 ${$.members.length} 个</span>` : "";
|
|
1182
|
+
return `<tr data-search="${Ot(`${$.family} ${$.members.map((et) => et.name).join(" ")}`)}"><td><code>${bt($.family)}</code></td><td>${N}${V}</td></tr>`;
|
|
1186
1183
|
}).join(`
|
|
1187
1184
|
`), R = e.icons.map(
|
|
1188
|
-
($) => `<span class="ix-icon" data-search="${Ot($)}" title="${Ot($)}"><i class="pi ${
|
|
1185
|
+
($) => `<span class="ix-icon" data-search="${Ot($)}" title="${Ot($)}"><i class="pi ${bt($)}"></i><code>${bt($)}</code></span>`
|
|
1189
1186
|
).join(""), L = s ? `<p class="ix-lead">这一份主题里有 <b>${e.rules}</b> 条规则、<b>${e.total}</b> 个类名:
|
|
1190
1187
|
<code>.labull-*</code> ${e.families.reduce(($, N) => $ + N.members.length, 0)} 个、<code>.p-*</code>
|
|
1191
1188
|
${e.prime.reduce(($, N) => $ + N.members.length, 0)} 个、图标 ${e.icons.length} 个。</p>
|
|
@@ -1203,7 +1200,7 @@ function wo(n = "") {
|
|
|
1203
1200
|
光靠 CSS 能看的是按钮 / 输入框 / 标签 / 面板 / 表格 / 图标 —— 见上面的配方。</p>
|
|
1204
1201
|
<table class="ix-table"><thead><tr><th>家族</th><th>成员</th></tr></thead>
|
|
1205
1202
|
<tbody>
|
|
1206
|
-
${
|
|
1203
|
+
${E}
|
|
1207
1204
|
</tbody></table>
|
|
1208
1205
|
|
|
1209
1206
|
<h3 id="ix-icons">图标(<code>pi pi-*</code>,${e.icons.length} 个)</h3>
|
|
@@ -1365,57 +1362,57 @@ function wo(n = "") {
|
|
|
1365
1362
|
</html>
|
|
1366
1363
|
`;
|
|
1367
1364
|
}
|
|
1368
|
-
const
|
|
1369
|
-
function
|
|
1370
|
-
if (
|
|
1365
|
+
const $o = "backend_open.py", xo = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
1366
|
+
function Xn(n, e) {
|
|
1367
|
+
if (xo.test(n)) return;
|
|
1371
1368
|
const s = (n.split(/[?#]/)[0] ?? "").replace(/^\.\//, "").replace(/^\/+/, "");
|
|
1372
|
-
if (s in e) return
|
|
1369
|
+
if (s in e) return s;
|
|
1373
1370
|
const o = s.split("/").pop() ?? "";
|
|
1374
|
-
return o ? Object.keys(e).find((r) =>
|
|
1371
|
+
return o ? Object.keys(e).find((r) => (r.split("/").pop() ?? "") === o) : void 0;
|
|
1375
1372
|
}
|
|
1376
|
-
const
|
|
1377
|
-
function
|
|
1378
|
-
return `${
|
|
1373
|
+
const Ss = "\0mb:";
|
|
1374
|
+
function wo(n) {
|
|
1375
|
+
return `${Ss}${n}\0`;
|
|
1379
1376
|
}
|
|
1380
|
-
const
|
|
1381
|
-
function
|
|
1382
|
-
const s = [], o = (u) => (s.push(u),
|
|
1383
|
-
return { html: n.replace(
|
|
1384
|
-
const y =
|
|
1377
|
+
const So = /<script\b([^>]*?)\bsrc\s*=\s*(["'])(.*?)\2([^>]*)>\s*<\/script\s*>/gi, Co = /<link\b([^>]*?)\bhref\s*=\s*(["'])(.*?)\2([^>]*?)\/?>/gi;
|
|
1378
|
+
function Eo(n, e) {
|
|
1379
|
+
const s = [], o = (u) => (s.push(u), wo(s.length - 1));
|
|
1380
|
+
return { html: n.replace(So, (u, b, h, v, _) => {
|
|
1381
|
+
const y = Xn(v, e);
|
|
1385
1382
|
return y === void 0 ? u : o(`<script${b}${_}>
|
|
1386
|
-
${
|
|
1383
|
+
${Cs(e[y] ?? "")}
|
|
1387
1384
|
<\/script>`);
|
|
1388
|
-
}).replace(
|
|
1385
|
+
}).replace(Co, (u, b, h, v, _) => {
|
|
1389
1386
|
if (!/\brel\s*=\s*(?:"|')?stylesheet/i.test(`${b}${_}`)) return u;
|
|
1390
|
-
const y =
|
|
1387
|
+
const y = Xn(v, e);
|
|
1391
1388
|
return y === void 0 ? u : o(`<style>
|
|
1392
1389
|
${e[y]}
|
|
1393
1390
|
</style>`);
|
|
1394
1391
|
}), slots: s };
|
|
1395
1392
|
}
|
|
1396
|
-
function
|
|
1393
|
+
function Cs(n) {
|
|
1397
1394
|
return n.replace(/<\/(script)/gi, "<\\/$1");
|
|
1398
1395
|
}
|
|
1399
|
-
function
|
|
1396
|
+
function Es(n, e) {
|
|
1400
1397
|
const s = /<\/head\s*>/i.exec(n);
|
|
1401
1398
|
return s ? `${n.slice(0, s.index)}${e}${n.slice(s.index)}` : `${e}${n}`;
|
|
1402
1399
|
}
|
|
1403
|
-
function
|
|
1404
|
-
return e ?
|
|
1405
|
-
${
|
|
1400
|
+
function Bo(n, e) {
|
|
1401
|
+
return e ? Es(n, `<script>
|
|
1402
|
+
${Cs(e)}
|
|
1406
1403
|
<\/script>
|
|
1407
1404
|
`) : n;
|
|
1408
1405
|
}
|
|
1409
|
-
function
|
|
1410
|
-
return e ?
|
|
1406
|
+
function Zn(n, e) {
|
|
1407
|
+
return e ? Es(n, `<style data-magic-block="host">
|
|
1411
1408
|
${e}
|
|
1412
1409
|
</style>
|
|
1413
1410
|
`) : n;
|
|
1414
1411
|
}
|
|
1415
|
-
function
|
|
1416
|
-
const s = e.bootstrap ?? "", o = e.css ?? "", r = e.themeCss ?? "", c = n[
|
|
1412
|
+
function Bs(n, e = {}) {
|
|
1413
|
+
const s = e.bootstrap ?? "", o = e.css ?? "", r = e.themeCss ?? "", c = n[Kt];
|
|
1417
1414
|
if (c === void 0) return "";
|
|
1418
|
-
const { html: u, slots: b } =
|
|
1415
|
+
const { html: u, slots: b } = Eo(c, n), h = Bo(Zn(Zn(u, r), o), s), v = h.split(Ss);
|
|
1419
1416
|
if (v.length === 1) return h;
|
|
1420
1417
|
let _ = v[0] ?? "";
|
|
1421
1418
|
for (let y = 1; y < v.length; y += 1) {
|
|
@@ -1424,48 +1421,48 @@ function Ms(n, e = {}) {
|
|
|
1424
1421
|
}
|
|
1425
1422
|
return _;
|
|
1426
1423
|
}
|
|
1427
|
-
const
|
|
1428
|
-
function
|
|
1429
|
-
const o =
|
|
1430
|
-
return
|
|
1431
|
-
{ ...n, [
|
|
1432
|
-
{ bootstrap: s.bootstrap ?? "", css:
|
|
1424
|
+
const To = "html, body { margin: 0; overflow: auto !important; }";
|
|
1425
|
+
function Ao(n, e, s = {}) {
|
|
1426
|
+
const o = go(_o(e), vo(n[Kt] ?? ""));
|
|
1427
|
+
return Bs(
|
|
1428
|
+
{ ...n, [Kt]: o },
|
|
1429
|
+
{ bootstrap: s.bootstrap ?? "", css: To, themeCss: s.themeCss ?? "" }
|
|
1433
1430
|
);
|
|
1434
1431
|
}
|
|
1435
|
-
const
|
|
1436
|
-
let
|
|
1432
|
+
const ce = /* @__PURE__ */ new Map();
|
|
1433
|
+
let Zt = null;
|
|
1437
1434
|
const dn = /* @__PURE__ */ new Set();
|
|
1438
|
-
function
|
|
1435
|
+
function Mo(n) {
|
|
1439
1436
|
return dn.add(n), () => {
|
|
1440
1437
|
dn.delete(n);
|
|
1441
1438
|
};
|
|
1442
1439
|
}
|
|
1443
|
-
function
|
|
1444
|
-
|
|
1440
|
+
function Oo() {
|
|
1441
|
+
ce.clear(), Zt = null;
|
|
1445
1442
|
for (const n of dn) n();
|
|
1446
1443
|
}
|
|
1447
|
-
async function
|
|
1444
|
+
async function jo(n) {
|
|
1448
1445
|
const e = [...new Set(n)].filter(Boolean);
|
|
1449
|
-
if (e.some((s) => !
|
|
1450
|
-
|
|
1446
|
+
if (e.some((s) => !ce.has(s))) {
|
|
1447
|
+
Zt && await Zt.catch(() => {
|
|
1451
1448
|
});
|
|
1452
|
-
const s = e.filter((o) => !
|
|
1453
|
-
s.length > 0 && (
|
|
1454
|
-
for (const r of o) r?.id &&
|
|
1449
|
+
const s = e.filter((o) => !ce.has(o));
|
|
1450
|
+
s.length > 0 && (Zt = $t(`/magic-blocks/render?ids=${s.map(encodeURIComponent).join(",")}`).then((o) => {
|
|
1451
|
+
for (const r of o) r?.id && ce.set(r.id, r);
|
|
1455
1452
|
return o;
|
|
1456
1453
|
}).catch(() => []).finally(() => {
|
|
1457
|
-
|
|
1458
|
-
}), await
|
|
1454
|
+
Zt = null;
|
|
1455
|
+
}), await Zt.catch(() => {
|
|
1459
1456
|
}));
|
|
1460
1457
|
}
|
|
1461
|
-
return e.map((s) =>
|
|
1458
|
+
return e.map((s) => ce.get(s)).filter((s) => !!s);
|
|
1462
1459
|
}
|
|
1463
|
-
const
|
|
1460
|
+
const Wt = /* @__PURE__ */ new Map(), pn = /* @__PURE__ */ new Set(), Do = 4e3;
|
|
1464
1461
|
let bn = "", $e = null;
|
|
1465
|
-
function
|
|
1462
|
+
function Qn() {
|
|
1466
1463
|
for (const n of pn) n();
|
|
1467
1464
|
}
|
|
1468
|
-
function
|
|
1465
|
+
function Ro(n) {
|
|
1469
1466
|
return pn.add(n), () => {
|
|
1470
1467
|
pn.delete(n);
|
|
1471
1468
|
};
|
|
@@ -1473,47 +1470,47 @@ function Io(n) {
|
|
|
1473
1470
|
function tn() {
|
|
1474
1471
|
return bn;
|
|
1475
1472
|
}
|
|
1476
|
-
function
|
|
1473
|
+
function Lo(n, e) {
|
|
1477
1474
|
const s = String(n || "").trim(), o = String(e || "").trim();
|
|
1478
1475
|
if (!s || !o) return () => {
|
|
1479
1476
|
};
|
|
1480
|
-
let r =
|
|
1481
|
-
return r || (r = /* @__PURE__ */ new Set(),
|
|
1482
|
-
const c =
|
|
1483
|
-
c && (c.delete(o), c.size === 0 &&
|
|
1477
|
+
let r = Wt.get(s);
|
|
1478
|
+
return r || (r = /* @__PURE__ */ new Set(), Wt.set(s, r)), r.add(o), () => {
|
|
1479
|
+
const c = Wt.get(s);
|
|
1480
|
+
c && (c.delete(o), c.size === 0 && Wt.delete(s));
|
|
1484
1481
|
};
|
|
1485
1482
|
}
|
|
1486
1483
|
function mn(n, e, s) {
|
|
1487
|
-
const o =
|
|
1484
|
+
const o = Wt.get(String(n || ""));
|
|
1488
1485
|
if (!o) return null;
|
|
1489
1486
|
for (const r of o)
|
|
1490
1487
|
if (r !== e && !(s && !s(r)))
|
|
1491
1488
|
return r;
|
|
1492
1489
|
return null;
|
|
1493
1490
|
}
|
|
1494
|
-
function
|
|
1495
|
-
return [...
|
|
1491
|
+
function Po(n) {
|
|
1492
|
+
return [...Wt.get(String(n || "")) ?? []];
|
|
1496
1493
|
}
|
|
1497
|
-
function
|
|
1498
|
-
const o =
|
|
1494
|
+
function Io(n, e, s) {
|
|
1495
|
+
const o = Wt.get(String(n || ""));
|
|
1499
1496
|
return !o || o.size === 0 || o.has(e) ? null : mn(n, e, s);
|
|
1500
1497
|
}
|
|
1501
|
-
function
|
|
1498
|
+
function Ts(n, e = Do) {
|
|
1502
1499
|
bn = String(n || ""), $e !== null && clearTimeout($e), $e = setTimeout(() => {
|
|
1503
|
-
$e = null, bn = "",
|
|
1504
|
-
}, Math.max(1, e)),
|
|
1500
|
+
$e = null, bn = "", Qn();
|
|
1501
|
+
}, Math.max(1, e)), Qn();
|
|
1505
1502
|
}
|
|
1506
|
-
const
|
|
1503
|
+
const No = ["data-magic-block", "data-magic-module"], qo = ["srcdoc", "title"], zo = { class: "mb__state" }, Fo = { class: "mb__brief" }, Uo = {
|
|
1507
1504
|
key: 0,
|
|
1508
1505
|
class: "mb__reason"
|
|
1509
|
-
},
|
|
1506
|
+
}, Ho = {
|
|
1510
1507
|
key: 1,
|
|
1511
1508
|
class: "mb__issues"
|
|
1512
|
-
},
|
|
1509
|
+
}, Wo = {
|
|
1513
1510
|
key: 2,
|
|
1514
1511
|
class: "mb__ring",
|
|
1515
1512
|
"aria-hidden": "true"
|
|
1516
|
-
},
|
|
1513
|
+
}, Ko = ["title", "aria-label"], Vo = ["title", "aria-label"], Go = ["title", "aria-label"], Jo = ["title", "aria-label"], Yo = /* @__PURE__ */ Ce({
|
|
1517
1514
|
__name: "MagicBlockHost",
|
|
1518
1515
|
props: {
|
|
1519
1516
|
uuid: {},
|
|
@@ -1522,33 +1519,33 @@ const Fo = ["data-magic-block", "data-magic-module"], Uo = ["srcdoc", "title"],
|
|
|
1522
1519
|
theme: { type: Boolean, default: !0 }
|
|
1523
1520
|
},
|
|
1524
1521
|
setup(n) {
|
|
1525
|
-
const e = n, s =
|
|
1526
|
-
let y = null, g = null, k = null, w = null,
|
|
1527
|
-
const L =
|
|
1522
|
+
const e = n, s = Sl(), o = cs(), { isStaff: r } = us(), c = j(null), u = j(null), b = j(null), h = j(!1), v = j(0), _ = j(0);
|
|
1523
|
+
let y = null, g = null, k = null, w = null, E = null, R = null;
|
|
1524
|
+
const L = z(() => e.name.trim() || e.uuid), $ = z(() => b.value?.state ?? ""), N = z(() => $.value === "invalid" ? "校验不通过" : $.value === "draft" ? "未开发" : L.value), V = z(() => (b.value?.brief ?? "").trim() || (b.value?.name ?? "").trim() || L.value), et = z(() => (b.value?.reason ?? "").trim()), vt = z(() => b.value?.issues ?? []), P = z(() => Math.max(_.value, v.value, 1)), Pt = z(() => ({ height: `${P.value}px` })), ft = z(() => {
|
|
1528
1525
|
const O = {};
|
|
1529
|
-
for (const [I, W] of Object.entries(b.value?.files ?? {})) I !==
|
|
1526
|
+
for (const [I, W] of Object.entries(b.value?.files ?? {})) I !== $o && (O[I] = W);
|
|
1530
1527
|
return O;
|
|
1531
|
-
}), St =
|
|
1528
|
+
}), St = z(() => $.value === "ok" && typeof ft.value[Kt] == "string");
|
|
1532
1529
|
let B = null;
|
|
1533
1530
|
function M() {
|
|
1534
1531
|
if (!e.theme) return "";
|
|
1535
1532
|
if (B !== null || (B = "", typeof document > "u")) return B;
|
|
1536
1533
|
try {
|
|
1537
|
-
B =
|
|
1534
|
+
B = ws().css;
|
|
1538
1535
|
} catch {
|
|
1539
1536
|
B = "";
|
|
1540
1537
|
}
|
|
1541
1538
|
return B;
|
|
1542
1539
|
}
|
|
1543
|
-
const S =
|
|
1540
|
+
const S = z(() => {
|
|
1544
1541
|
if (!St.value) return "";
|
|
1545
|
-
const O = { bootstrap:
|
|
1546
|
-
return I && (O.themeCss = I),
|
|
1542
|
+
const O = { bootstrap: Ml, css: Bl }, I = M();
|
|
1543
|
+
return I && (O.themeCss = I), Bs(ft.value, O);
|
|
1547
1544
|
});
|
|
1548
1545
|
function D() {
|
|
1549
1546
|
return { key: s.key, path: s.path, params: s.params, query: s.query };
|
|
1550
1547
|
}
|
|
1551
|
-
async function
|
|
1548
|
+
async function ht(O) {
|
|
1552
1549
|
const I = o.resolve(O);
|
|
1553
1550
|
if (I.matched.length === 0) {
|
|
1554
1551
|
const W = o.getRoutes().map((at) => at.path);
|
|
@@ -1559,56 +1556,56 @@ const Fo = ["data-magic-block", "data-magic-module"], Uo = ["srcdoc", "title"],
|
|
|
1559
1556
|
function lt() {
|
|
1560
1557
|
k?.(), k = null;
|
|
1561
1558
|
const O = u.value;
|
|
1562
|
-
O && (k =
|
|
1559
|
+
O && (k = Pn(O, {
|
|
1563
1560
|
uuid: e.uuid,
|
|
1564
1561
|
onHeight: (I) => {
|
|
1565
1562
|
v.value = I;
|
|
1566
1563
|
},
|
|
1567
|
-
onNavigateTab:
|
|
1564
|
+
onNavigateTab: ht,
|
|
1568
1565
|
context: D,
|
|
1569
|
-
onDialog:
|
|
1566
|
+
onDialog: Gt,
|
|
1570
1567
|
/* 🔴 块给**自己所属那条标签**起名:整页就是一个块时(`MagicBlockPage`),标签栏上那条
|
|
1571
1568
|
* 默认只有路由的 `meta.title`("订单详情"),而"订单 SO-42"只有块自己知道。 */
|
|
1572
1569
|
onTabTitle: (I, W) => s.setTitle(I, W)
|
|
1573
1570
|
}));
|
|
1574
1571
|
}
|
|
1575
|
-
function
|
|
1576
|
-
return
|
|
1572
|
+
function Gt(O) {
|
|
1573
|
+
return Jl(O, {
|
|
1577
1574
|
uuid: e.uuid,
|
|
1578
|
-
buildDoc: (I) =>
|
|
1579
|
-
mountBridge: (I, W) =>
|
|
1575
|
+
buildDoc: (I) => Ao(b.value?.files ?? {}, I, { bootstrap: Al, themeCss: M() }),
|
|
1576
|
+
mountBridge: (I, W) => Pn(I, {
|
|
1580
1577
|
uuid: e.uuid,
|
|
1581
1578
|
onDone: W.onDone,
|
|
1582
1579
|
onHeight: W.onHeight,
|
|
1583
|
-
onDialog:
|
|
1580
|
+
onDialog: Gt,
|
|
1584
1581
|
// 弹窗里还能再弹一个(排成一摞,只有最上面那个能点)
|
|
1585
|
-
onNavigateTab:
|
|
1582
|
+
onNavigateTab: ht,
|
|
1586
1583
|
context: D,
|
|
1587
|
-
onTabTitle: (at,
|
|
1584
|
+
onTabTitle: (at, Jt) => s.setTitle(at, Jt)
|
|
1588
1585
|
})
|
|
1589
1586
|
});
|
|
1590
1587
|
}
|
|
1591
|
-
async function
|
|
1592
|
-
const O = e.uuid, I = await
|
|
1588
|
+
async function te() {
|
|
1589
|
+
const O = e.uuid, I = await jo([O]);
|
|
1593
1590
|
O === e.uuid && (b.value = I.find((W) => W.id === O) ?? null);
|
|
1594
1591
|
}
|
|
1595
|
-
function
|
|
1592
|
+
function de() {
|
|
1596
1593
|
window.dispatchEvent(new CustomEvent("magic-block:open-console", { detail: { uuid: e.uuid } }));
|
|
1597
1594
|
}
|
|
1598
|
-
function
|
|
1599
|
-
O &&
|
|
1595
|
+
function pe(O = !1) {
|
|
1596
|
+
O && E?.(), E = Lo(e.uuid, s.key);
|
|
1600
1597
|
}
|
|
1601
|
-
const
|
|
1598
|
+
const ut = (O) => !ds(O, o), ot = z(() => {
|
|
1602
1599
|
if (!r.value) return "";
|
|
1603
|
-
const O = mn(e.uuid, s.key,
|
|
1600
|
+
const O = mn(e.uuid, s.key, ut);
|
|
1604
1601
|
return O ? `管理员:切到还挂着这个块的标签 ${O}(点一下这一块会亮红框)` : "管理员:这个块只在这一条标签里挂着 —— 点一下会亮几秒红框";
|
|
1605
1602
|
});
|
|
1606
1603
|
function H() {
|
|
1607
1604
|
if (!r.value) return;
|
|
1608
|
-
const O = mn(e.uuid, s.key,
|
|
1609
|
-
|
|
1605
|
+
const O = mn(e.uuid, s.key, ut);
|
|
1606
|
+
Ts(e.uuid), O && rn(O);
|
|
1610
1607
|
}
|
|
1611
|
-
function
|
|
1608
|
+
function _t(O) {
|
|
1612
1609
|
let I = O.parentElement;
|
|
1613
1610
|
for (; I; ) {
|
|
1614
1611
|
if (getComputedStyle(I).overflowY !== "visible" && I.clientHeight > 0) return I;
|
|
@@ -1619,7 +1616,7 @@ const Fo = ["data-magic-block", "data-magic-module"], Uo = ["srcdoc", "title"],
|
|
|
1619
1616
|
function rt() {
|
|
1620
1617
|
const O = c.value;
|
|
1621
1618
|
if (!O) return 0;
|
|
1622
|
-
const I =
|
|
1619
|
+
const I = _t(O), W = getComputedStyle(I), at = parseFloat(W.paddingTop) || 0, Jt = parseFloat(W.paddingBottom) || 0, be = parseFloat(W.borderTopWidth) || 0, Q = I === document.documentElement, Oe = Q ? Math.max(0, window.innerHeight - at - Jt) : Math.max(0, I.clientHeight - at - Jt), je = Q ? at : I.getBoundingClientRect().top + be + at, De = Q ? window.scrollY || 0 : I.scrollTop, Re = O.getBoundingClientRect().top - je + De;
|
|
1623
1620
|
return Math.max(0, Math.floor(Oe - Re));
|
|
1624
1621
|
}
|
|
1625
1622
|
function ct() {
|
|
@@ -1629,7 +1626,7 @@ const Fo = ["data-magic-block", "data-magic-module"], Uo = ["srcdoc", "title"],
|
|
|
1629
1626
|
}
|
|
1630
1627
|
function nt() {
|
|
1631
1628
|
if (!c.value) return;
|
|
1632
|
-
const O =
|
|
1629
|
+
const O = _t(c.value);
|
|
1633
1630
|
y !== O && (y = O, g?.disconnect(), g = null), ct(), !(g || typeof ResizeObserver > "u") && (g = new ResizeObserver(() => ct()), g.observe(O));
|
|
1634
1631
|
}
|
|
1635
1632
|
return Dt(u, () => lt()), Dt(S, () => {
|
|
@@ -1643,13 +1640,13 @@ const Fo = ["data-magic-block", "data-magic-module"], Uo = ["srcdoc", "title"],
|
|
|
1643
1640
|
!I || !I.isConnected || I.offsetParent === null || h.value && I.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
1644
1641
|
});
|
|
1645
1642
|
}), Dt(() => e.uuid, (O, I) => {
|
|
1646
|
-
I && I !== O &&
|
|
1643
|
+
I && I !== O && Hn(I), v.value = 0, b.value = null, pe(!0), h.value = tn() === e.uuid, te();
|
|
1647
1644
|
}), fn(() => {
|
|
1648
|
-
w =
|
|
1645
|
+
w = Mo(() => void te()), R = Ro(() => {
|
|
1649
1646
|
h.value = tn() === e.uuid;
|
|
1650
|
-
}), h.value = tn() === e.uuid,
|
|
1647
|
+
}), h.value = tn() === e.uuid, pe(), nt(), te();
|
|
1651
1648
|
}), hn(() => {
|
|
1652
|
-
|
|
1649
|
+
Hn(e.uuid), g?.disconnect(), g = null, w?.(), w = null, R?.(), R = null, E?.(), E = null, k?.(), k = null;
|
|
1653
1650
|
}), (O, I) => (d(), p("div", {
|
|
1654
1651
|
ref_key: "el",
|
|
1655
1652
|
ref: c,
|
|
@@ -1667,27 +1664,27 @@ const Fo = ["data-magic-block", "data-magic-module"], Uo = ["srcdoc", "title"],
|
|
|
1667
1664
|
title: L.value,
|
|
1668
1665
|
scrolling: "no",
|
|
1669
1666
|
sandbox: "allow-scripts allow-forms allow-modals allow-popups allow-downloads"
|
|
1670
|
-
}, null, 8,
|
|
1667
|
+
}, null, 8, qo)) : (d(), p("div", {
|
|
1671
1668
|
key: 1,
|
|
1672
1669
|
class: Z(["mb__empty", { "mb__empty--off": $.value === "invalid", "mb__empty--draft": $.value === "draft" }]),
|
|
1673
1670
|
onClick: H
|
|
1674
1671
|
}, [
|
|
1675
|
-
a("p",
|
|
1676
|
-
a("p",
|
|
1677
|
-
$.value === "invalid" && et.value ? (d(), p("p",
|
|
1678
|
-
$.value === "invalid" &&
|
|
1679
|
-
(d(!0), p(A, null,
|
|
1672
|
+
a("p", zo, f(N.value), 1),
|
|
1673
|
+
a("p", Fo, f(V.value), 1),
|
|
1674
|
+
$.value === "invalid" && et.value ? (d(), p("p", Uo, f(et.value), 1)) : C("", !0),
|
|
1675
|
+
$.value === "invalid" && vt.value.length > 0 ? (d(), p("ul", Ho, [
|
|
1676
|
+
(d(!0), p(A, null, F(vt.value, (W, at) => (d(), p("li", {
|
|
1680
1677
|
key: at,
|
|
1681
1678
|
class: "mb__issue"
|
|
1682
1679
|
}, f(W.message), 1))), 128))
|
|
1683
|
-
])) :
|
|
1680
|
+
])) : C("", !0),
|
|
1684
1681
|
a("button", {
|
|
1685
1682
|
class: "mb__go",
|
|
1686
1683
|
type: "button",
|
|
1687
|
-
onClick: an(
|
|
1684
|
+
onClick: an(de, ["stop"])
|
|
1688
1685
|
}, "去管理台")
|
|
1689
1686
|
], 2)),
|
|
1690
|
-
G(r) ? (d(), p("span",
|
|
1687
|
+
G(r) ? (d(), p("span", Wo)) : C("", !0),
|
|
1691
1688
|
G(r) && St.value ? (d(), p(A, { key: 3 }, [
|
|
1692
1689
|
a("button", {
|
|
1693
1690
|
class: "mb__grab mb__grab--top",
|
|
@@ -1695,78 +1692,78 @@ const Fo = ["data-magic-block", "data-magic-module"], Uo = ["srcdoc", "title"],
|
|
|
1695
1692
|
title: ot.value,
|
|
1696
1693
|
"aria-label": ot.value,
|
|
1697
1694
|
onClick: H
|
|
1698
|
-
}, null, 8,
|
|
1695
|
+
}, null, 8, Ko),
|
|
1699
1696
|
a("button", {
|
|
1700
1697
|
class: "mb__grab mb__grab--right",
|
|
1701
1698
|
type: "button",
|
|
1702
1699
|
title: ot.value,
|
|
1703
1700
|
"aria-label": ot.value,
|
|
1704
1701
|
onClick: H
|
|
1705
|
-
}, null, 8,
|
|
1702
|
+
}, null, 8, Vo),
|
|
1706
1703
|
a("button", {
|
|
1707
1704
|
class: "mb__grab mb__grab--bottom",
|
|
1708
1705
|
type: "button",
|
|
1709
1706
|
title: ot.value,
|
|
1710
1707
|
"aria-label": ot.value,
|
|
1711
1708
|
onClick: H
|
|
1712
|
-
}, null, 8,
|
|
1709
|
+
}, null, 8, Go),
|
|
1713
1710
|
a("button", {
|
|
1714
1711
|
class: "mb__grab mb__grab--left",
|
|
1715
1712
|
type: "button",
|
|
1716
1713
|
title: ot.value,
|
|
1717
1714
|
"aria-label": ot.value,
|
|
1718
1715
|
onClick: H
|
|
1719
|
-
}, null, 8,
|
|
1720
|
-
], 64)) :
|
|
1721
|
-
], 14,
|
|
1716
|
+
}, null, 8, Jo)
|
|
1717
|
+
], 64)) : C("", !0)
|
|
1718
|
+
], 14, No));
|
|
1722
1719
|
}
|
|
1723
|
-
}),
|
|
1724
|
-
function
|
|
1720
|
+
}), Xo = /* @__PURE__ */ gn(Yo, [["__scopeId", "data-v-7718e319"]]);
|
|
1721
|
+
function gt(n) {
|
|
1725
1722
|
return typeof n == "string" ? n.trim() : "";
|
|
1726
1723
|
}
|
|
1727
|
-
function
|
|
1728
|
-
const e =
|
|
1724
|
+
function As(n) {
|
|
1725
|
+
const e = gt(n?.meta?.blockUuid);
|
|
1729
1726
|
if (e) return e;
|
|
1730
1727
|
const s = n?.props;
|
|
1731
1728
|
if (!s || typeof s != "object" || Array.isArray(s)) return "";
|
|
1732
1729
|
const o = s.default;
|
|
1733
|
-
return !o || typeof o != "object" || Array.isArray(o) ? "" :
|
|
1730
|
+
return !o || typeof o != "object" || Array.isArray(o) ? "" : gt(o.uuid);
|
|
1734
1731
|
}
|
|
1735
|
-
function
|
|
1732
|
+
function Zo(n, e) {
|
|
1736
1733
|
const s = [], o = /* @__PURE__ */ new Set();
|
|
1737
1734
|
for (const r of n ?? []) {
|
|
1738
1735
|
if (!r || r.redirect || r.components?.default !== e) continue;
|
|
1739
|
-
const c =
|
|
1736
|
+
const c = As(r);
|
|
1740
1737
|
if (!c || o.has(c)) continue;
|
|
1741
1738
|
o.add(c);
|
|
1742
|
-
const u =
|
|
1743
|
-
s.push({ uuid: c, path: u, title: b, module:
|
|
1739
|
+
const u = gt(r.path), b = gt(r.meta?.title) || gt(r.meta?.sub) || u;
|
|
1740
|
+
s.push({ uuid: c, path: u, title: b, module: gt(r.meta?.module), brief: gt(r.meta?.brief) });
|
|
1744
1741
|
}
|
|
1745
1742
|
return s;
|
|
1746
1743
|
}
|
|
1747
|
-
function
|
|
1744
|
+
function Qo(n, e, s) {
|
|
1748
1745
|
const o = /* @__PURE__ */ new Set();
|
|
1749
|
-
for (const r of s ?? []) o.add(
|
|
1750
|
-
return
|
|
1746
|
+
for (const r of s ?? []) o.add(gt(r));
|
|
1747
|
+
return Zo(n, e).filter((r) => !o.has(r.uuid));
|
|
1751
1748
|
}
|
|
1752
|
-
const
|
|
1753
|
-
function
|
|
1754
|
-
return typeof n == "object" && n !== null && n[
|
|
1749
|
+
const Ms = "__labullBlockPage";
|
|
1750
|
+
function ta(n) {
|
|
1751
|
+
return typeof n == "object" && n !== null && n[Ms] === !0;
|
|
1755
1752
|
}
|
|
1756
|
-
const
|
|
1757
|
-
function
|
|
1753
|
+
const ts = '块标签里的东西(标题 / 按钮 / 参数展示 / 第二块区域)全部写进块自己的 index.open.html:页面这一层只回答"哪条地址是哪个块"。';
|
|
1754
|
+
function ea(n, e) {
|
|
1758
1755
|
const s = n?.components?.default;
|
|
1759
|
-
return s == null ? !1 :
|
|
1756
|
+
return s == null ? !1 : ta(s) ? !0 : e != null && s === e;
|
|
1760
1757
|
}
|
|
1761
|
-
function
|
|
1758
|
+
function na(n, e) {
|
|
1762
1759
|
const s = [];
|
|
1763
1760
|
if (!n || n.length === 0) return s;
|
|
1764
|
-
const o = n[n.length - 1], r =
|
|
1765
|
-
if (n.findIndex((b) =>
|
|
1761
|
+
const o = n[n.length - 1], r = gt(o?.path);
|
|
1762
|
+
if (n.findIndex((b) => ea(b, e)) !== n.length - 1)
|
|
1766
1763
|
return s.push({
|
|
1767
1764
|
code: "wrapped",
|
|
1768
1765
|
path: r,
|
|
1769
|
-
message: `这条路由(${r || "拿不到路径"})渲染的不是块页本身:块页被包在别的组件里(包装页 / 渲染函数),或者被当成了某一层的布局。${
|
|
1766
|
+
message: `这条路由(${r || "拿不到路径"})渲染的不是块页本身:块页被包在别的组件里(包装页 / 渲染函数),或者被当成了某一层的布局。${ts}`
|
|
1770
1767
|
}), s;
|
|
1771
1768
|
n.length > 1 && s.push({
|
|
1772
1769
|
code: "nested",
|
|
@@ -1777,38 +1774,38 @@ function oa(n, e) {
|
|
|
1777
1774
|
return u.length > 0 && s.push({
|
|
1778
1775
|
code: "extra-views",
|
|
1779
1776
|
path: r,
|
|
1780
|
-
message: `这条路由(${r})除了默认视图还挂了具名视图(${u.join(" / ")})—— 那正是"在块旁边摆第二块内容"。${
|
|
1781
|
-
}),
|
|
1777
|
+
message: `这条路由(${r})除了默认视图还挂了具名视图(${u.join(" / ")})—— 那正是"在块旁边摆第二块内容"。${ts}`
|
|
1778
|
+
}), As(o) || s.push({
|
|
1782
1779
|
code: "no-uuid",
|
|
1783
1780
|
path: r,
|
|
1784
1781
|
message: `这条路由(${r})挂了块页却没说这是哪个块:写 meta.blockUuid(推荐)或 props: { uuid },否则这一页渲染出来是"未开发"。`
|
|
1785
1782
|
}), s;
|
|
1786
1783
|
}
|
|
1787
|
-
function
|
|
1784
|
+
function es(n) {
|
|
1788
1785
|
const e = String(n ?? "").split(/[?#]/)[0];
|
|
1789
1786
|
return e.startsWith("/") ? e.split("/").filter(Boolean) : null;
|
|
1790
1787
|
}
|
|
1791
|
-
function
|
|
1788
|
+
function ns(n) {
|
|
1792
1789
|
return n.startsWith(":") || n === "*" || n.startsWith("{") && n.endsWith("}");
|
|
1793
1790
|
}
|
|
1794
|
-
function
|
|
1795
|
-
const s =
|
|
1791
|
+
function sa(n, e) {
|
|
1792
|
+
const s = es(n), o = es(e);
|
|
1796
1793
|
return s === null || o === null || s.length !== o.length ? !1 : s.every((r, c) => {
|
|
1797
1794
|
const u = o[c];
|
|
1798
|
-
return
|
|
1795
|
+
return ns(r) || ns(u) || r === u;
|
|
1799
1796
|
});
|
|
1800
1797
|
}
|
|
1801
|
-
function
|
|
1798
|
+
function la(n, e) {
|
|
1802
1799
|
const s = [];
|
|
1803
1800
|
for (const r of e ?? []) {
|
|
1804
|
-
const c =
|
|
1801
|
+
const c = gt(r?.path);
|
|
1805
1802
|
c && s.push(c);
|
|
1806
1803
|
}
|
|
1807
1804
|
if (s.length === 0) return [];
|
|
1808
1805
|
const o = [];
|
|
1809
1806
|
for (const r of n ?? []) {
|
|
1810
|
-
const c =
|
|
1811
|
-
c && (s.some((u) =>
|
|
1807
|
+
const c = gt(r);
|
|
1808
|
+
c && (s.some((u) => sa(c, u)) || o.push({
|
|
1812
1809
|
code: "no-page",
|
|
1813
1810
|
path: c,
|
|
1814
1811
|
message: `依赖声明里写了要跳到 ${c},但这个应用的路由表里没有这条地址 —— 那个页面一旦改名 / 搬走,这一步就是 404(而且不会报错)。改法:把声明改成真实存在的地址,或者去路由表里补上那一条。`
|
|
@@ -1816,7 +1813,7 @@ function ia(n, e) {
|
|
|
1816
1813
|
}
|
|
1817
1814
|
return o;
|
|
1818
1815
|
}
|
|
1819
|
-
const
|
|
1816
|
+
const Os = /* @__PURE__ */ Ce({
|
|
1820
1817
|
__name: "MagicBlockPage",
|
|
1821
1818
|
props: {
|
|
1822
1819
|
uuid: { default: "" },
|
|
@@ -1825,16 +1822,16 @@ const Rs = /* @__PURE__ */ Ee({
|
|
|
1825
1822
|
theme: { type: Boolean, default: !0 }
|
|
1826
1823
|
},
|
|
1827
1824
|
setup(n) {
|
|
1828
|
-
const e = n, s =
|
|
1825
|
+
const e = n, s = wl(), o = z(() => {
|
|
1829
1826
|
const u = s.meta?.blockUuid;
|
|
1830
1827
|
return typeof u == "string" && u.trim() ? u.trim() : e.uuid;
|
|
1831
|
-
}), r =
|
|
1828
|
+
}), r = gl()?.type, c = na(s.matched, r);
|
|
1832
1829
|
if (c.length > 0) {
|
|
1833
1830
|
const u = c.map((b) => `[labull] ${b.message}`).join(`
|
|
1834
1831
|
`);
|
|
1835
1832
|
console.error(u);
|
|
1836
1833
|
}
|
|
1837
|
-
return (u, b) => (d(),
|
|
1834
|
+
return (u, b) => (d(), _l(Xo, {
|
|
1838
1835
|
uuid: o.value,
|
|
1839
1836
|
name: n.name,
|
|
1840
1837
|
module: n.module,
|
|
@@ -1842,13 +1839,13 @@ const Rs = /* @__PURE__ */ Ee({
|
|
|
1842
1839
|
}, null, 8, ["uuid", "name", "module", "theme"]));
|
|
1843
1840
|
}
|
|
1844
1841
|
});
|
|
1845
|
-
function
|
|
1842
|
+
function oa(n, e) {
|
|
1846
1843
|
const o = `${n}${e}`.replace(/\r\n/g, `
|
|
1847
1844
|
`).split(`
|
|
1848
1845
|
`), r = o.pop() ?? "";
|
|
1849
1846
|
return { lines: o.filter((c) => c.trim() !== ""), rest: r };
|
|
1850
1847
|
}
|
|
1851
|
-
function
|
|
1848
|
+
function aa(n) {
|
|
1852
1849
|
const e = String(n ?? "").trim();
|
|
1853
1850
|
if (!e) return null;
|
|
1854
1851
|
let s;
|
|
@@ -1883,36 +1880,36 @@ function ca(n) {
|
|
|
1883
1880
|
return null;
|
|
1884
1881
|
}
|
|
1885
1882
|
}
|
|
1886
|
-
function
|
|
1883
|
+
function ia(n, e) {
|
|
1887
1884
|
const s = Math.max(0, Math.floor(e));
|
|
1888
1885
|
if (s <= 0) return 10;
|
|
1889
1886
|
const o = Math.max(0, Math.min(s, Math.floor(n)));
|
|
1890
1887
|
return Math.round(10 + 90 * o / s);
|
|
1891
1888
|
}
|
|
1892
|
-
function
|
|
1889
|
+
function ss(n) {
|
|
1893
1890
|
const e = [];
|
|
1894
1891
|
return typeof n.blocks == "number" && n.blocks > 0 ? e.push(`${n.blocks} 个块`) : typeof n.folders == "number" && n.folders > 0 && e.push(`${n.folders} 个文件夹`), typeof n.files == "number" && n.files > 0 && e.push(`${n.files} 个文件`), e.length > 0 ? e.join(" / ") : "整份目录";
|
|
1895
1892
|
}
|
|
1896
|
-
function
|
|
1893
|
+
function ls(n) {
|
|
1897
1894
|
const e = n.seconds;
|
|
1898
1895
|
return typeof e != "number" || !Number.isFinite(e) || e <= 0 ? "" : `这一趟已经跑了 ${Math.max(1, Math.round(e))} 秒`;
|
|
1899
1896
|
}
|
|
1900
1897
|
function en(n, e = {}) {
|
|
1901
|
-
const s = typeof e.status == "number" ? e.status : 0, o = e.path || "/magic-blocks/read", r = typeof e.detail == "string" && e.detail.trim() || (n instanceof Error ? n.message : "") || "(没有任何回话)", c = `${
|
|
1898
|
+
const s = typeof e.status == "number" ? e.status : 0, o = e.path || "/magic-blocks/read", r = typeof e.detail == "string" && e.detail.trim() || (n instanceof Error ? n.message : "") || "(没有任何回话)", c = `${ss(e)}${ls(e) ? "," + ls(e) : ""}`, u = [];
|
|
1902
1899
|
if (s === 504 || s === 408 || s === 502 || s === 503) {
|
|
1903
1900
|
const b = s === 502 || s === 503 ? `后端没答上来(${s}):这一趟请求送出去之后,前面的代理说"上游不可用" —— 多半是后面那个进程正在忙着算、或者刚重启。` : `网关等不及了(${s}):这一趟是「一次请求」把整个目录递上去,后端要「逐块」做保存前那套判据(试加载 + 引用深检,实测 0.8~3.7 秒/块)—— 算得越久越危险。`;
|
|
1904
1901
|
u.push(`${b}这一趟递上去的是 ${c}。`), (s === 504 || s === 408) && (u.push(""), u.push('换句话说:这不是你的块写错了 —— 是"一条请求算得太久、中间没有回话"被前置网关掐断了。'), u.push("这次可以这么办(从省事到彻底):"), u.push("1. 再点一次「读回改动」——但先把这次不动的块文件夹移出目录,只留要改的那几个:判据完全一样,只是分母小了。"), u.push("2. 调大网关的超时:nginx 的 `proxy_read_timeout 300s;` / `proxy_send_timeout 300s;`;云负载均衡上一般也有一个「后端响应超时」,一起调。"), u.push('3. 前端升到 1.0.3+:读回改成「流式」(算完一块就回一句话),只要字节一直在往回走,网关就不会因为"没回话"把它掐掉。'));
|
|
1905
|
-
} else s === 413 ? (u.push(`这一趟递上去的正文太大了(413):后端一次收不下这么多内容(这一趟是 ${
|
|
1902
|
+
} else s === 413 ? (u.push(`这一趟递上去的正文太大了(413):后端一次收不下这么多内容(这一趟是 ${ss(e)})。`), u.push("把这次不动的块文件夹移出目录,只留要改的那几个再读回。")) : s === 401 || s === 403 ? (u.push(`后端不认这次请求(${s}):读回要管理员(Django 的 is_staff)。`), u.push(s === 401 ? "登录态可能已经过期:刷新页面重新登录,再点「读回改动」。" : "这个账号不是管理员:换一个有 is_staff 的账号。")) : s === 0 ? (u.push(`没连上后端(${o}):请求还没到服务端就断了 —— 后端进程没起来 / 地址不对 / 网络或代理断了。`), u.push(`原文:${r}`)) : s >= 500 ? (u.push(`后端在这次读回里抛异常了(${s}):这是平台的问题,不是你块的问题。`), u.push(`原文:${r}`), u.push('把这一句连同"读回"贴给维护的人;后端日志里那一趟的 traceback 才是真原因。')) : s >= 400 ? u.push(`这一次读回被拒了(${s}):${r}`) : u.push(`读回没成功:${r}`);
|
|
1906
1903
|
return s === 0 && u.length === 0 && u.push(r), u.join(`
|
|
1907
1904
|
`);
|
|
1908
1905
|
}
|
|
1909
1906
|
function jt(n) {
|
|
1910
1907
|
return String(n ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1911
1908
|
}
|
|
1912
|
-
function
|
|
1909
|
+
function ra(n) {
|
|
1913
1910
|
return /^(https?:\/\/|mailto:|\/(?!\/))/i.test(String(n ?? "").trim());
|
|
1914
1911
|
}
|
|
1915
|
-
function
|
|
1912
|
+
function Qt(n) {
|
|
1916
1913
|
const e = String(n ?? "");
|
|
1917
1914
|
let s = "", o = 0;
|
|
1918
1915
|
for (; o < e.length; ) {
|
|
@@ -1927,8 +1924,8 @@ function Zt(n) {
|
|
|
1927
1924
|
continue;
|
|
1928
1925
|
}
|
|
1929
1926
|
const b = /^\[([^\]]*)\]\(([^)\s]*)\)/.exec(r);
|
|
1930
|
-
if (b &&
|
|
1931
|
-
s += `<a href="${jt(b[2])}" target="_blank" rel="noopener noreferrer">${
|
|
1927
|
+
if (b && ra(b[2])) {
|
|
1928
|
+
s += `<a href="${jt(b[2])}" target="_blank" rel="noopener noreferrer">${Qt(b[1])}</a>`, o += b[0].length;
|
|
1932
1929
|
continue;
|
|
1933
1930
|
}
|
|
1934
1931
|
const h = /^\*\*([^*]+)\*\*/.exec(r);
|
|
@@ -1945,15 +1942,15 @@ function Zt(n) {
|
|
|
1945
1942
|
}
|
|
1946
1943
|
return s;
|
|
1947
1944
|
}
|
|
1948
|
-
function
|
|
1945
|
+
function ca(n) {
|
|
1949
1946
|
const e = String(n ?? "").replace(/\r\n?/g, `
|
|
1950
1947
|
`).split(`
|
|
1951
1948
|
`), s = [];
|
|
1952
1949
|
let o = "", r = [], c = [], u = !1, b = [];
|
|
1953
1950
|
const h = () => {
|
|
1954
|
-
r.length > 0 && (s.push(`<p>${r.map((k) =>
|
|
1951
|
+
r.length > 0 && (s.push(`<p>${r.map((k) => Qt(k)).join("<br>")}</p>`), r = []);
|
|
1955
1952
|
}, v = () => {
|
|
1956
|
-
c.length > 0 && (s.push(`<blockquote>${c.map((k) =>
|
|
1953
|
+
c.length > 0 && (s.push(`<blockquote>${c.map((k) => Qt(k)).join("<br>")}</blockquote>`), c = []);
|
|
1957
1954
|
}, _ = () => {
|
|
1958
1955
|
o && (s.push(`</${o}>`), o = "");
|
|
1959
1956
|
}, y = () => {
|
|
@@ -1976,11 +1973,11 @@ function pa(n) {
|
|
|
1976
1973
|
y();
|
|
1977
1974
|
continue;
|
|
1978
1975
|
}
|
|
1979
|
-
const
|
|
1980
|
-
if (
|
|
1976
|
+
const E = /^(#{1,6})\s+(.*)$/.exec(w);
|
|
1977
|
+
if (E) {
|
|
1981
1978
|
y();
|
|
1982
|
-
const N =
|
|
1983
|
-
s.push(`<h${N}>${
|
|
1979
|
+
const N = E[1].length;
|
|
1980
|
+
s.push(`<h${N}>${Qt(E[2])}</h${N}>`);
|
|
1984
1981
|
continue;
|
|
1985
1982
|
}
|
|
1986
1983
|
if (/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(w)) {
|
|
@@ -1989,12 +1986,12 @@ function pa(n) {
|
|
|
1989
1986
|
}
|
|
1990
1987
|
const R = /^\s*[-*+]\s+(.*)$/.exec(w);
|
|
1991
1988
|
if (R) {
|
|
1992
|
-
h(), v(), g("ul"), s.push(`<li>${
|
|
1989
|
+
h(), v(), g("ul"), s.push(`<li>${Qt(R[1])}</li>`);
|
|
1993
1990
|
continue;
|
|
1994
1991
|
}
|
|
1995
1992
|
const L = /^\s*\d+[.)]\s+(.*)$/.exec(w);
|
|
1996
1993
|
if (L) {
|
|
1997
|
-
h(), v(), g("ol"), s.push(`<li>${
|
|
1994
|
+
h(), v(), g("ol"), s.push(`<li>${Qt(L[1])}</li>`);
|
|
1998
1995
|
continue;
|
|
1999
1996
|
}
|
|
2000
1997
|
const $ = /^\s*>\s?(.*)$/.exec(w);
|
|
@@ -2007,20 +2004,20 @@ function pa(n) {
|
|
|
2007
2004
|
return u && s.push(`<pre><code>${jt(b.join(`
|
|
2008
2005
|
`))}</code></pre>`), y(), s.join("");
|
|
2009
2006
|
}
|
|
2010
|
-
function
|
|
2007
|
+
function os(n, e = 120) {
|
|
2011
2008
|
const o = (String(n ?? "").replace(/\r\n?/g, `
|
|
2012
2009
|
`).split(`
|
|
2013
2010
|
`).map((r) => r.trim()).find((r) => r.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();
|
|
2014
2011
|
return o.length > e ? `${o.slice(0, e)}…` : o;
|
|
2015
2012
|
}
|
|
2016
2013
|
const xe = "pages.lock.ts";
|
|
2017
|
-
function
|
|
2014
|
+
function ua(n, e) {
|
|
2018
2015
|
const s = String(n || "").split(/[^A-Za-z0-9]+/).filter(Boolean);
|
|
2019
2016
|
if (s.length === 0) return `Page${e + 1}`;
|
|
2020
2017
|
const o = s.map((r) => r[0].toUpperCase() + r.slice(1)).join("");
|
|
2021
2018
|
return /^[0-9]/.test(o) ? `P${o}` : o;
|
|
2022
2019
|
}
|
|
2023
|
-
function
|
|
2020
|
+
function da(n, e) {
|
|
2024
2021
|
if (!e.has(n))
|
|
2025
2022
|
return e.add(n), n;
|
|
2026
2023
|
let s = 2;
|
|
@@ -2028,12 +2025,12 @@ function ma(n, e) {
|
|
|
2028
2025
|
const o = `${n}${s}`;
|
|
2029
2026
|
return e.add(o), o;
|
|
2030
2027
|
}
|
|
2031
|
-
function
|
|
2028
|
+
function pa(n) {
|
|
2032
2029
|
const e = (n ?? []).filter((c) => c && typeof c.path == "string" && c.path.trim() !== ""), s = /* @__PURE__ */ new Set(), o = [];
|
|
2033
2030
|
e.forEach((c, u) => {
|
|
2034
2031
|
const b = c.group?.trim() || "(没写 meta.group)";
|
|
2035
2032
|
let h = o.find((v) => v.title === b);
|
|
2036
|
-
h || (h = { title: b, rows: [] }, o.push(h)), h.rows.push({ key:
|
|
2033
|
+
h || (h = { title: b, rows: [] }, o.push(h)), h.rows.push({ key: da(ua(c.path, u), s), row: c });
|
|
2037
2034
|
});
|
|
2038
2035
|
const r = [
|
|
2039
2036
|
"/* 生成物:**每次导出都会重写**,别手改 —— 改了下次导出就没了。",
|
|
@@ -2136,12 +2133,12 @@ function fa(n) {
|
|
|
2136
2133
|
), r.join(`
|
|
2137
2134
|
`);
|
|
2138
2135
|
}
|
|
2139
|
-
function
|
|
2136
|
+
function js() {
|
|
2140
2137
|
return typeof window < "u" && typeof window.showDirectoryPicker == "function";
|
|
2141
2138
|
}
|
|
2142
|
-
const
|
|
2139
|
+
const ba = "这个浏览器没法直接写你本机的文件夹(少了 File System Access API):请用 Chrome / Edge,并且从 https 或 http://localhost 打开这个页面(内网 http 会更少 API)。";
|
|
2143
2140
|
async function nn() {
|
|
2144
|
-
if (!
|
|
2141
|
+
if (!js()) throw new Error(ba);
|
|
2145
2142
|
try {
|
|
2146
2143
|
const n = await window.showDirectoryPicker({ mode: "readwrite", id: "labull-magic-block" });
|
|
2147
2144
|
return { name: n.name, handle: n };
|
|
@@ -2160,7 +2157,7 @@ function Me(n) {
|
|
|
2160
2157
|
throw new Error(`路径不合法:${n}(要相对路径,不许 .. / 盘符 / 反斜杠)`);
|
|
2161
2158
|
return e;
|
|
2162
2159
|
}
|
|
2163
|
-
function
|
|
2160
|
+
function ma(n) {
|
|
2164
2161
|
const e = String(n ?? "");
|
|
2165
2162
|
let s = 3735928559, o = 1103547991;
|
|
2166
2163
|
for (let r = 0; r < e.length; r += 1) {
|
|
@@ -2169,7 +2166,7 @@ function va(n) {
|
|
|
2169
2166
|
}
|
|
2170
2167
|
return s = Math.imul(s ^ s >>> 16, 2246822507) ^ Math.imul(o ^ o >>> 13, 3266489909), o = Math.imul(o ^ o >>> 16, 2246822507) ^ Math.imul(s ^ s >>> 13, 3266489909), `${(4294967296 * (2097151 & o) + (s >>> 0)).toString(36)}:${e.length}`;
|
|
2171
2168
|
}
|
|
2172
|
-
const
|
|
2169
|
+
const fa = 8;
|
|
2173
2170
|
async function Mt(n, e) {
|
|
2174
2171
|
let s = 0;
|
|
2175
2172
|
const o = async () => {
|
|
@@ -2179,9 +2176,9 @@ async function Mt(n, e) {
|
|
|
2179
2176
|
await e(n[r], r);
|
|
2180
2177
|
}
|
|
2181
2178
|
};
|
|
2182
|
-
await Promise.all(Array.from({ length: Math.max(1, Math.min(
|
|
2179
|
+
await Promise.all(Array.from({ length: Math.max(1, Math.min(fa, n.length)) }, () => o()));
|
|
2183
2180
|
}
|
|
2184
|
-
function
|
|
2181
|
+
function ha(n) {
|
|
2185
2182
|
const e = /* @__PURE__ */ new Map();
|
|
2186
2183
|
return (s) => {
|
|
2187
2184
|
const o = s.join("\0"), r = e.get(o);
|
|
@@ -2194,47 +2191,47 @@ function _a(n) {
|
|
|
2194
2191
|
return c;
|
|
2195
2192
|
};
|
|
2196
2193
|
}
|
|
2197
|
-
async function
|
|
2194
|
+
async function va(n, e, s) {
|
|
2198
2195
|
try {
|
|
2199
2196
|
return await (await (await n.getFileHandle(e)).getFile()).text() === s;
|
|
2200
2197
|
} catch {
|
|
2201
2198
|
return !1;
|
|
2202
2199
|
}
|
|
2203
2200
|
}
|
|
2204
|
-
async function
|
|
2205
|
-
const r = Object.entries(e ?? {}).map(([
|
|
2201
|
+
async function ga(n, e, s, o = {}) {
|
|
2202
|
+
const r = Object.entries(e ?? {}).map(([E, R]) => {
|
|
2206
2203
|
const L = String(R ?? "");
|
|
2207
|
-
return { path:
|
|
2208
|
-
}), c = r.length, u = [], b =
|
|
2204
|
+
return { path: E, parts: Me(E), body: L, digest: ma(L) };
|
|
2205
|
+
}), c = r.length, u = [], b = ha(n.handle), h = o.verify === !0, v = o.trust, _ = o.existing, y = /* @__PURE__ */ new Map();
|
|
2209
2206
|
let g = 0, k = 0, w = 0;
|
|
2210
|
-
return s?.(0, c), await Mt(r, async (
|
|
2207
|
+
return s?.(0, c), await Mt(r, async (E) => {
|
|
2211
2208
|
try {
|
|
2212
|
-
if (v?.get(
|
|
2213
|
-
w += 1, y.set(
|
|
2209
|
+
if (v?.get(E.path) === E.digest && (_?.has(E.path) ?? !1))
|
|
2210
|
+
w += 1, y.set(E.path, E.digest);
|
|
2214
2211
|
else {
|
|
2215
|
-
const R = await b(
|
|
2216
|
-
if (h && await
|
|
2217
|
-
k += 1, y.set(
|
|
2212
|
+
const R = await b(E.parts.slice(0, -1)), L = E.parts[E.parts.length - 1];
|
|
2213
|
+
if (h && await va(R, L, E.body))
|
|
2214
|
+
k += 1, y.set(E.path, E.digest);
|
|
2218
2215
|
else {
|
|
2219
2216
|
const N = await (await R.getFileHandle(L, { create: !0 })).createWritable();
|
|
2220
2217
|
try {
|
|
2221
|
-
await N.write(
|
|
2218
|
+
await N.write(E.body);
|
|
2222
2219
|
} finally {
|
|
2223
2220
|
await N.close();
|
|
2224
2221
|
}
|
|
2225
|
-
g += 1, y.set(
|
|
2222
|
+
g += 1, y.set(E.path, E.digest);
|
|
2226
2223
|
}
|
|
2227
2224
|
}
|
|
2228
2225
|
} catch (R) {
|
|
2229
|
-
u.push({ path:
|
|
2226
|
+
u.push({ path: E.path, message: Se(R) });
|
|
2230
2227
|
}
|
|
2231
2228
|
s?.(g + k + w + u.length, c);
|
|
2232
|
-
}), u.sort((
|
|
2229
|
+
}), u.sort((E, R) => E.path < R.path ? -1 : E.path > R.path ? 1 : 0), { written: g, failed: u, total: c, skipped: k, trusted: w, fingerprints: y };
|
|
2233
2230
|
}
|
|
2234
2231
|
async function sn(n, e) {
|
|
2235
2232
|
const s = { items: [], topCount: 0, files: 0, dirs: 0 }, o = async (u, b) => {
|
|
2236
2233
|
const h = [];
|
|
2237
|
-
for (const v of await
|
|
2234
|
+
for (const v of await Vt(u)) {
|
|
2238
2235
|
if (v.kind === "file") {
|
|
2239
2236
|
s.files += 1;
|
|
2240
2237
|
continue;
|
|
@@ -2242,7 +2239,7 @@ async function sn(n, e) {
|
|
|
2242
2239
|
s.dirs += 1, !(b >= e.maxDepth) && (e.skipDirs.includes(v.name) || h.push(v));
|
|
2243
2240
|
}
|
|
2244
2241
|
await Mt(h, (v) => o(v, b + 1));
|
|
2245
|
-
}, r = await
|
|
2242
|
+
}, r = await Vt(n.handle), c = [];
|
|
2246
2243
|
for (const u of r)
|
|
2247
2244
|
if (s.items.push({ name: u.name, dir: u.kind === "directory" }), u.kind === "file") s.files += 1;
|
|
2248
2245
|
else {
|
|
@@ -2251,20 +2248,20 @@ async function sn(n, e) {
|
|
|
2251
2248
|
}
|
|
2252
2249
|
return await Mt(c, (u) => o(u, 1)), s.topCount = s.items.length, s;
|
|
2253
2250
|
}
|
|
2254
|
-
async function
|
|
2251
|
+
async function _a(n) {
|
|
2255
2252
|
const e = [];
|
|
2256
|
-
for (const o of await
|
|
2253
|
+
for (const o of await Vt(n.handle)) e.push(o.name);
|
|
2257
2254
|
let s = 0;
|
|
2258
2255
|
return await Mt(e, async (o) => {
|
|
2259
2256
|
await n.handle.removeEntry(o, { recursive: !0 }), s += 1;
|
|
2260
2257
|
}), s;
|
|
2261
2258
|
}
|
|
2262
|
-
async function
|
|
2263
|
-
const { wantedFiles: o, wantedDirs: r } =
|
|
2259
|
+
async function ya(n, e, s = []) {
|
|
2260
|
+
const { wantedFiles: o, wantedDirs: r } = Ds(e), c = new Set((s ?? []).map((v) => Me(v).join("/"))), u = /* @__PURE__ */ new Set();
|
|
2264
2261
|
let b = 0;
|
|
2265
2262
|
const h = async (v, _) => {
|
|
2266
2263
|
const y = [], g = [];
|
|
2267
|
-
for (const k of await
|
|
2264
|
+
for (const k of await Vt(v)) {
|
|
2268
2265
|
const w = _ ? `${_}/${k.name}` : k.name;
|
|
2269
2266
|
if (!(!_ && c.has(w))) {
|
|
2270
2267
|
if (k.kind === "file") {
|
|
@@ -2280,7 +2277,7 @@ async function xa(n, e, s = []) {
|
|
|
2280
2277
|
};
|
|
2281
2278
|
return await h(n.handle, ""), { removed: b, existing: u };
|
|
2282
2279
|
}
|
|
2283
|
-
function
|
|
2280
|
+
function Ds(n) {
|
|
2284
2281
|
const e = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
2285
2282
|
for (const o of Object.keys(n ?? {})) {
|
|
2286
2283
|
const r = Me(o);
|
|
@@ -2289,10 +2286,10 @@ function Ps(n) {
|
|
|
2289
2286
|
}
|
|
2290
2287
|
return { wantedFiles: e, wantedDirs: s };
|
|
2291
2288
|
}
|
|
2292
|
-
async function
|
|
2293
|
-
const { wantedFiles: s, wantedDirs: o } =
|
|
2289
|
+
async function ka(n, e) {
|
|
2290
|
+
const { wantedFiles: s, wantedDirs: o } = Ds(e), r = /* @__PURE__ */ new Set(), c = async (u, b) => {
|
|
2294
2291
|
const h = [];
|
|
2295
|
-
for (const v of await
|
|
2292
|
+
for (const v of await Vt(u)) {
|
|
2296
2293
|
const _ = b ? `${b}/${v.name}` : v.name;
|
|
2297
2294
|
if (v.kind === "file") {
|
|
2298
2295
|
s.has(_) && r.add(_);
|
|
@@ -2304,46 +2301,46 @@ async function wa(n, e) {
|
|
|
2304
2301
|
};
|
|
2305
2302
|
return await c(n.handle, ""), r;
|
|
2306
2303
|
}
|
|
2307
|
-
function
|
|
2304
|
+
function $a(n, e) {
|
|
2308
2305
|
if (n.name === e.blocksDir)
|
|
2309
2306
|
throw new Error(
|
|
2310
2307
|
`你选中的是「${e.blocksDir}」这一层(它就是放代码的那一层):导出会铺成 ${e.blocksDir}/${e.blocksDir}/…。请选它**上面**那一层 —— 也就是开发目录本身。`
|
|
2311
2308
|
);
|
|
2312
2309
|
}
|
|
2313
|
-
function
|
|
2310
|
+
function xa(n, e) {
|
|
2314
2311
|
const s = `${e.blocksDir}/`, o = Object.keys(n ?? {}).find((r) => r.startsWith(s));
|
|
2315
2312
|
if (o)
|
|
2316
2313
|
throw new Error(
|
|
2317
2314
|
`这一趟要铺的是"只导框架文件",但回话里带着块代码(${o}):后端还没支持这一档 —— 把后端升上去再试(照这份报文铺下去会把 ${e.blocksDir}/ 里的块代码整库覆盖)。`
|
|
2318
2315
|
);
|
|
2319
2316
|
}
|
|
2320
|
-
async function
|
|
2317
|
+
async function Vt(n) {
|
|
2321
2318
|
const e = [];
|
|
2322
2319
|
for await (const s of n.values()) e.push(s);
|
|
2323
2320
|
return e.sort((s, o) => s.name < o.name ? -1 : s.name > o.name ? 1 : 0), e;
|
|
2324
2321
|
}
|
|
2325
|
-
function
|
|
2322
|
+
function wa(n) {
|
|
2326
2323
|
return n.charCodeAt(0) === 65279 ? n.slice(1) : n;
|
|
2327
2324
|
}
|
|
2328
|
-
function
|
|
2325
|
+
function Sa(n) {
|
|
2329
2326
|
const e = n.lastIndexOf(".");
|
|
2330
2327
|
return e <= 0 ? "" : n.slice(e).toLowerCase();
|
|
2331
2328
|
}
|
|
2332
|
-
const
|
|
2333
|
-
async function
|
|
2334
|
-
const r = await
|
|
2329
|
+
const Ca = { folders: [], failures: [], truncated: !1 };
|
|
2330
|
+
async function Rs(n, e, s, o) {
|
|
2331
|
+
const r = await Vt(n), c = new Array(r.length);
|
|
2335
2332
|
await Mt(r, async (h, v) => {
|
|
2336
2333
|
const _ = e ? `${e}/${h.name}` : h.name, y = { files: {}, failures: [] };
|
|
2337
2334
|
if (c[v] = y, h.kind === "directory") {
|
|
2338
2335
|
if (s.skipDirs.includes(h.name)) return;
|
|
2339
|
-
const k = await
|
|
2340
|
-
for (const [w,
|
|
2341
|
-
y.files[`${h.name}/${w}`] =
|
|
2336
|
+
const k = await Rs(h, _, s, o);
|
|
2337
|
+
for (const [w, E] of Object.entries(k.files))
|
|
2338
|
+
y.files[`${h.name}/${w}`] = E;
|
|
2342
2339
|
y.failures.push(...k.failures);
|
|
2343
2340
|
return;
|
|
2344
2341
|
}
|
|
2345
2342
|
if (o?.(), !s.platformFiles.includes(h.name)) {
|
|
2346
|
-
if (!s.textExt.includes(
|
|
2343
|
+
if (!s.textExt.includes(Sa(h.name))) {
|
|
2347
2344
|
y.failures.push({
|
|
2348
2345
|
kind: "file",
|
|
2349
2346
|
where: _,
|
|
@@ -2361,7 +2358,7 @@ async function Is(n, e, s, o) {
|
|
|
2361
2358
|
});
|
|
2362
2359
|
return;
|
|
2363
2360
|
}
|
|
2364
|
-
y.files[h.name] =
|
|
2361
|
+
y.files[h.name] = wa(await g.text());
|
|
2365
2362
|
} catch (g) {
|
|
2366
2363
|
y.failures.push({ kind: "file", where: _, message: `读不了这个文件:${Se(g)}` });
|
|
2367
2364
|
}
|
|
@@ -2372,10 +2369,10 @@ async function Is(n, e, s, o) {
|
|
|
2372
2369
|
h && (Object.assign(u, h.files), b.push(...h.failures));
|
|
2373
2370
|
return { files: u, failures: b };
|
|
2374
2371
|
}
|
|
2375
|
-
async function
|
|
2376
|
-
const c = await
|
|
2372
|
+
async function Ls(n, e, s, o, r) {
|
|
2373
|
+
const c = await Vt(n), u = c.filter((g) => g.kind === "directory"), b = c.filter((g) => g.kind === "file"), h = e.join("/"), v = { folders: [], failures: [], truncated: !1 };
|
|
2377
2374
|
if (u.length === 0 || b.some((g) => g.name === o.entry)) {
|
|
2378
|
-
const g = await
|
|
2375
|
+
const g = await Rs(n, h, o, r);
|
|
2379
2376
|
return v.folders.push({ where: h, files: g.files }), v.failures.push(...g.failures), v;
|
|
2380
2377
|
}
|
|
2381
2378
|
for (const g of b)
|
|
@@ -2384,7 +2381,7 @@ async function Ns(n, e, s, o, r) {
|
|
|
2384
2381
|
where: [...e, g.name].join("/"),
|
|
2385
2382
|
message: `这一层直接放着一份文件,但它自己不是块文件夹、也没有 ${o.entry},文件没有归属`
|
|
2386
2383
|
});
|
|
2387
|
-
const _ = u.map((g) => async () => o.skipDirs.includes(g.name) ?
|
|
2384
|
+
const _ = u.map((g) => async () => o.skipDirs.includes(g.name) ? Ca : s >= o.maxDepth ? {
|
|
2388
2385
|
folders: [],
|
|
2389
2386
|
failures: [{
|
|
2390
2387
|
kind: "dir",
|
|
@@ -2392,7 +2389,7 @@ async function Ns(n, e, s, o, r) {
|
|
|
2392
2389
|
message: `超过最大层数 ${o.maxDepth} 层还没见到 ${o.entry},没有继续往下找`
|
|
2393
2390
|
}],
|
|
2394
2391
|
truncated: !0
|
|
2395
|
-
} :
|
|
2392
|
+
} : Ls(g, [...e, g.name], s + 1, o, r)), y = new Array(_.length);
|
|
2396
2393
|
await Mt(_, async (g, k) => {
|
|
2397
2394
|
y[k] = await g();
|
|
2398
2395
|
});
|
|
@@ -2400,14 +2397,14 @@ async function Ns(n, e, s, o, r) {
|
|
|
2400
2397
|
g && (v.folders.push(...g.folders), v.failures.push(...g.failures), g.truncated && (v.truncated = !0));
|
|
2401
2398
|
return v;
|
|
2402
2399
|
}
|
|
2403
|
-
function
|
|
2400
|
+
function as(n) {
|
|
2404
2401
|
return n >= 1024 * 1024 ? `${(n / 1024 / 1024).toFixed(1)} MB` : `${Math.max(1, Math.round(n / 1024))} KB`;
|
|
2405
2402
|
}
|
|
2406
|
-
async function
|
|
2403
|
+
async function Ea(n, e, s) {
|
|
2407
2404
|
let o = 0;
|
|
2408
2405
|
const r = s ? () => {
|
|
2409
2406
|
o += 1, s(o);
|
|
2410
|
-
} : void 0, c = await
|
|
2407
|
+
} : void 0, c = await Ls(n.handle, [], 0, e, r), u = {
|
|
2411
2408
|
root: n.name,
|
|
2412
2409
|
folders: c.folders,
|
|
2413
2410
|
failures: c.failures,
|
|
@@ -2418,173 +2415,173 @@ async function Aa(n, e, s) {
|
|
|
2418
2415
|
);
|
|
2419
2416
|
if (b > e.maxBodyBytes)
|
|
2420
2417
|
throw new Error(
|
|
2421
|
-
`这个目录读到的正文有 ${
|
|
2418
|
+
`这个目录读到的正文有 ${as(b)},超过一次读回的上限 ${as(e.maxBodyBytes)}:请先只留要改的那几个块,或者把大文件挪走。`
|
|
2422
2419
|
);
|
|
2423
2420
|
return u;
|
|
2424
2421
|
}
|
|
2425
|
-
const
|
|
2422
|
+
const Ba = { class: "mbc__head" }, Ta = ["title"], Aa = ["title"], Ma = {
|
|
2426
2423
|
class: "mbc__tabs",
|
|
2427
2424
|
role: "tablist"
|
|
2428
|
-
},
|
|
2425
|
+
}, Oa = ["aria-selected"], ja = { class: "mbc__count" }, Da = ["title"], Ra = ["aria-selected"], La = ["title"], Pa = {
|
|
2429
2426
|
key: 1,
|
|
2430
2427
|
class: "mbc__chip is-ok"
|
|
2431
|
-
},
|
|
2428
|
+
}, Ia = { class: "mbc__body" }, Na = {
|
|
2432
2429
|
key: 0,
|
|
2433
2430
|
class: "mbc__running"
|
|
2434
|
-
},
|
|
2431
|
+
}, qa = ["aria-valuenow"], za = {
|
|
2435
2432
|
key: 1,
|
|
2436
2433
|
class: "mbc__confirm"
|
|
2437
|
-
},
|
|
2434
|
+
}, Fa = { class: "mbc__confirm-title" }, Ua = {
|
|
2438
2435
|
key: 0,
|
|
2439
2436
|
class: "mbc__confirm-body"
|
|
2440
|
-
},
|
|
2437
|
+
}, Ha = { class: "mbc__mono" }, Wa = {
|
|
2441
2438
|
key: 1,
|
|
2442
2439
|
class: "mbc__mono"
|
|
2443
|
-
},
|
|
2440
|
+
}, Ka = {
|
|
2444
2441
|
key: 1,
|
|
2445
2442
|
class: "mbc__confirm-body"
|
|
2446
|
-
},
|
|
2443
|
+
}, Va = {
|
|
2447
2444
|
key: 0,
|
|
2448
2445
|
class: "mbc__mono"
|
|
2449
|
-
},
|
|
2446
|
+
}, Ga = { class: "mbc__confirm-check" }, Ja = { class: "mbc__actions" }, Ya = ["disabled"], Xa = ["disabled"], Za = ["disabled"], Qa = {
|
|
2450
2447
|
key: 2,
|
|
2451
2448
|
class: "mbc__confirm"
|
|
2452
|
-
},
|
|
2449
|
+
}, ti = { class: "mbc__confirm-title" }, ei = { class: "mbc__confirm-body" }, ni = { class: "mbc__mono" }, si = { class: "mbc__actions" }, li = ["disabled"], oi = ["disabled"], ai = { class: "mbc__panel mbc__panel--blocks" }, ii = { class: "mbc__title" }, ri = { class: "mbc__count" }, ci = {
|
|
2453
2450
|
key: 0,
|
|
2454
2451
|
class: "mbc__count mbc__count--tag"
|
|
2455
|
-
},
|
|
2452
|
+
}, ui = {
|
|
2456
2453
|
key: 0,
|
|
2457
2454
|
class: "mbc__tagbar"
|
|
2458
|
-
},
|
|
2459
|
-
key:
|
|
2455
|
+
}, di = ["title", "onClick"], pi = { class: "mbc__list" }, bi = ["title", "onClick"], mi = { class: "mbc__module" }, fi = { class: "mbc__name" }, hi = ["title"], vi = ["title"], gi = {
|
|
2456
|
+
key: 1,
|
|
2460
2457
|
class: "mbc__where"
|
|
2461
|
-
},
|
|
2458
|
+
}, _i = ["title"], yi = {
|
|
2462
2459
|
key: 0,
|
|
2463
2460
|
class: "mbc__detail"
|
|
2464
|
-
},
|
|
2461
|
+
}, ki = {
|
|
2465
2462
|
key: 0,
|
|
2466
2463
|
class: "mbc__hint"
|
|
2467
|
-
},
|
|
2464
|
+
}, $i = { class: "mbc__meta" }, xi = ["innerHTML"], wi = {
|
|
2468
2465
|
key: 1,
|
|
2469
2466
|
class: "mbc__hint"
|
|
2470
|
-
},
|
|
2467
|
+
}, Si = { class: "mbc__mono" }, Ci = ["disabled", "onClick"], Ei = ["disabled", "onClick"], Bi = ["disabled"], Ti = { class: "mbc__hint" }, Ai = { class: "mbc__loclist" }, Mi = { class: "mbc__mono" }, Oi = { class: "mbc__reqlist" }, ji = { class: "mbc__mono" }, Di = { class: "mbc__reqtitle" }, Ri = { class: "mbc__hint" }, Li = { class: "mbc__mono" }, Pi = {
|
|
2471
2468
|
key: 1,
|
|
2472
2469
|
class: "mbc__hint"
|
|
2473
|
-
},
|
|
2470
|
+
}, Ii = { class: "mbc__mono" }, Ni = { class: "mbc__hint" }, qi = {
|
|
2474
2471
|
key: 0,
|
|
2475
2472
|
class: "mbc__hint"
|
|
2476
|
-
},
|
|
2473
|
+
}, zi = ["disabled", "onClick"], Fi = ["onKeyup"], Ui = ["disabled", "onClick"], Hi = ["disabled"], Wi = {
|
|
2477
2474
|
key: 0,
|
|
2478
2475
|
class: "mbc__tagbar"
|
|
2479
|
-
},
|
|
2476
|
+
}, Ki = ["title", "onClick"], Vi = {
|
|
2480
2477
|
key: 1,
|
|
2481
2478
|
class: "mbc__tagbar"
|
|
2482
|
-
},
|
|
2479
|
+
}, Gi = ["title", "onClick"], Ji = { class: "mbc__mono" }, Yi = { class: "mbc__actions mbc__actions--row" }, Xi = ["disabled", "onClick"], Zi = { class: "mbc__versions" }, Qi = { class: "mbc__versions-head" }, tr = ["disabled", "onClick"], er = {
|
|
2483
2480
|
key: 0,
|
|
2484
2481
|
class: "mbc__hint"
|
|
2485
|
-
},
|
|
2482
|
+
}, nr = {
|
|
2486
2483
|
key: 1,
|
|
2487
2484
|
class: "mbc__versions-list"
|
|
2488
|
-
},
|
|
2485
|
+
}, sr = { class: "mbc__mono" }, lr = { class: "mbc__hint" }, or = { class: "mbc__actions" }, ar = ["disabled", "onClick", "title"], ir = ["disabled", "onClick", "title"], rr = ["disabled", "onClick", "title"], cr = ["disabled", "onClick", "title"], ur = {
|
|
2489
2486
|
key: 2,
|
|
2490
2487
|
class: "mbc__hint"
|
|
2491
|
-
},
|
|
2488
|
+
}, dr = {
|
|
2492
2489
|
key: 3,
|
|
2493
2490
|
class: "mbc__viewer"
|
|
2494
|
-
},
|
|
2491
|
+
}, pr = { class: "mbc__versions-head" }, br = { class: "mbc__mono" }, mr = { class: "mbc__viewer-body" }, fr = { class: "mbc__panel mbc__panel--export" }, hr = { class: "mbc__field" }, vr = ["disabled"], gr = {
|
|
2495
2492
|
key: 0,
|
|
2496
2493
|
class: "mbc__field mbc__field--end"
|
|
2497
|
-
},
|
|
2494
|
+
}, _r = { class: "mbc__hint" }, yr = { class: "mbc__ok-text" }, kr = {
|
|
2498
2495
|
key: 1,
|
|
2499
2496
|
class: "mbc__checknotes"
|
|
2500
|
-
},
|
|
2497
|
+
}, $r = { class: "mbc__mono" }, xr = { class: "mbc__field mbc__field--wrap" }, wr = { class: "mbc__radio" }, Sr = ["checked"], Cr = { class: "mbc__radio" }, Er = ["checked"], Br = { class: "mbc__radio" }, Tr = ["checked"], Ar = ["value", "disabled"], Mr = {
|
|
2501
2498
|
key: 0,
|
|
2502
2499
|
value: ""
|
|
2503
|
-
},
|
|
2500
|
+
}, Or = ["value"], jr = { class: "mbc__field" }, Dr = ["value"], Rr = ["disabled"], Lr = ["disabled", "title"], Pr = {
|
|
2504
2501
|
key: 2,
|
|
2505
2502
|
class: "mbc__hint"
|
|
2506
|
-
},
|
|
2503
|
+
}, Ir = {
|
|
2507
2504
|
key: 3,
|
|
2508
2505
|
class: "mbc__hint"
|
|
2509
|
-
},
|
|
2506
|
+
}, Nr = {
|
|
2510
2507
|
key: 4,
|
|
2511
2508
|
class: "mbc__hint"
|
|
2512
|
-
},
|
|
2509
|
+
}, qr = { class: "mbc__panel mbc__panel--read" }, zr = { class: "mbc__field" }, Fr = ["value"], Ur = ["disabled"], Hr = ["disabled"], Wr = {
|
|
2513
2510
|
key: 0,
|
|
2514
2511
|
class: "mbc__hint"
|
|
2515
|
-
},
|
|
2512
|
+
}, Kr = {
|
|
2516
2513
|
key: 1,
|
|
2517
2514
|
class: "mbc__hint"
|
|
2518
|
-
},
|
|
2515
|
+
}, Vr = { class: "mbc__field mbc__field--end" }, Gr = ["disabled", "title"], Jr = {
|
|
2519
2516
|
key: 0,
|
|
2520
2517
|
class: "mbc__hint"
|
|
2521
|
-
},
|
|
2518
|
+
}, Yr = { class: "mbc__ok-text" }, Xr = ["disabled"], Zr = ["disabled"], Qr = {
|
|
2522
2519
|
key: 1,
|
|
2523
2520
|
class: "mbc__scan"
|
|
2524
|
-
},
|
|
2521
|
+
}, tc = { class: "mbc__pick" }, ec = ["disabled", "checked", "onChange"], nc = { class: "mbc__name" }, sc = { class: "mbc__module" }, lc = { class: "mbc__hint" }, oc = { class: "mbc__mono" }, ac = { class: "mbc__mono" }, ic = {
|
|
2525
2522
|
key: 0,
|
|
2526
2523
|
class: "mbc__problem"
|
|
2527
|
-
},
|
|
2524
|
+
}, rc = {
|
|
2528
2525
|
key: 1,
|
|
2529
2526
|
class: "mbc__failures"
|
|
2530
|
-
},
|
|
2527
|
+
}, cc = { class: "mbc__hint mbc__mono" }, uc = {
|
|
2531
2528
|
key: 2,
|
|
2532
2529
|
class: "mbc__hint"
|
|
2533
|
-
},
|
|
2530
|
+
}, dc = { class: "mbc__field" }, pc = ["title"], bc = {
|
|
2534
2531
|
key: 1,
|
|
2535
2532
|
class: "mbc__chip is-ok"
|
|
2536
|
-
},
|
|
2533
|
+
}, mc = ["title"], fc = {
|
|
2537
2534
|
key: 3,
|
|
2538
2535
|
class: "mbc__hint"
|
|
2539
|
-
},
|
|
2536
|
+
}, hc = { class: "mbc__panel mbc__panel--declared" }, vc = { class: "mbc__title" }, gc = { class: "p-tag p-tag-info" }, _c = { class: "mbc__count" }, yc = {
|
|
2540
2537
|
key: 0,
|
|
2541
2538
|
class: "mbc__hint"
|
|
2542
|
-
},
|
|
2539
|
+
}, kc = { class: "mbc__hint" }, $c = { class: "mbc__scan" }, xc = { class: "mbc__pick" }, wc = { class: "mbc__name" }, Sc = { class: "p-tag p-tag-info" }, Cc = { class: "mbc__module" }, Ec = { class: "mbc__hint" }, Bc = { class: "mbc__mono" }, Tc = { class: "mbc__hint mbc__mono" }, Ac = {
|
|
2543
2540
|
key: 3,
|
|
2544
2541
|
class: "mbc__panel mbc__panel--result"
|
|
2545
|
-
},
|
|
2542
|
+
}, Mc = { class: "mbc__summary" }, Oc = { class: "mbc__chip is-ok" }, jc = {
|
|
2546
2543
|
key: 0,
|
|
2547
2544
|
class: "mbc__chip is-bad"
|
|
2548
|
-
},
|
|
2545
|
+
}, Dc = {
|
|
2549
2546
|
key: 1,
|
|
2550
2547
|
class: "mbc__chip is-bad"
|
|
2551
|
-
},
|
|
2548
|
+
}, Rc = {
|
|
2552
2549
|
key: 2,
|
|
2553
2550
|
class: "mbc__hint"
|
|
2554
|
-
},
|
|
2551
|
+
}, Lc = { class: "mbc__actions" }, Pc = { class: "mbc__foot" }, Ic = ["title"], Nc = {
|
|
2555
2552
|
key: 1,
|
|
2556
2553
|
class: "mbc__error"
|
|
2557
|
-
},
|
|
2554
|
+
}, qc = {
|
|
2558
2555
|
key: 2,
|
|
2559
2556
|
class: "mbc__notice"
|
|
2560
|
-
},
|
|
2557
|
+
}, zc = {
|
|
2561
2558
|
key: 3,
|
|
2562
2559
|
class: "mbc__hint mbc__foot-idle"
|
|
2563
|
-
},
|
|
2560
|
+
}, Fc = { class: "mbc__modal-box" }, Uc = { class: "mbc__modal-head" }, Hc = { class: "mbc__modal-body" }, Wc = {
|
|
2564
2561
|
key: 0,
|
|
2565
2562
|
class: "mbc__issues-group"
|
|
2566
|
-
},
|
|
2563
|
+
}, Kc = { class: "mbc__title" }, Vc = { class: "mbc__failures" }, Gc = {
|
|
2567
2564
|
key: 1,
|
|
2568
2565
|
class: "mbc__issues-group"
|
|
2569
|
-
},
|
|
2566
|
+
}, Jc = { class: "mbc__title" }, Yc = { class: "mbc__failures" }, Xc = { class: "mbc__kind" }, Zc = { class: "mbc__mono" }, Qc = {
|
|
2570
2567
|
key: 2,
|
|
2571
2568
|
class: "mbc__issues-group"
|
|
2572
|
-
},
|
|
2569
|
+
}, tu = { class: "mbc__title" }, eu = { class: "mbc__failures" }, nu = { class: "mbc__mono" }, su = {
|
|
2573
2570
|
key: 3,
|
|
2574
2571
|
class: "mbc__issues-group"
|
|
2575
|
-
},
|
|
2572
|
+
}, lu = { class: "mbc__title" }, ou = { class: "mbc__failures" }, au = { key: 0 }, iu = {
|
|
2576
2573
|
key: 1,
|
|
2577
2574
|
class: "mbc__failures"
|
|
2578
|
-
},
|
|
2575
|
+
}, ru = {
|
|
2579
2576
|
key: 4,
|
|
2580
2577
|
class: "mbc__issues-group"
|
|
2581
|
-
},
|
|
2578
|
+
}, cu = { class: "mbc__title" }, uu = { class: "mbc__failures" }, du = { class: "mbc__failures" }, pu = {
|
|
2582
2579
|
key: 5,
|
|
2583
2580
|
class: "mbc__hint"
|
|
2584
|
-
},
|
|
2581
|
+
}, bu = { class: "mbc__modal-foot" }, mu = { class: "mbc__modal-box" }, fu = { class: "mbc__modal-head" }, hu = { class: "mbc__modal-body" }, vu = { class: "mbc__reports" }, gu = { class: "mbc__report-head" }, _u = { class: "mbc__mono" }, yu = { class: "mbc__report-text" }, ku = {
|
|
2585
2582
|
key: 0,
|
|
2586
2583
|
class: "mbc__hint"
|
|
2587
|
-
},
|
|
2584
|
+
}, $u = { class: "mbc__modal-foot" }, ln = 2, xu = 100, wu = 250, is = '体检只做静态判据(引用 / 字段 / 枚举 / 属性在不在),**不执行任何块代码** —— 所以"通过"是静态通过,不等于"跑得起来"。', Su = /* @__PURE__ */ Ce({
|
|
2588
2585
|
__name: "MagicBlockConsole",
|
|
2589
2586
|
setup(n) {
|
|
2590
2587
|
const e = {
|
|
@@ -2595,15 +2592,15 @@ const Ma = { class: "mbc__head" }, Oa = ["title"], ja = ["title"], Da = {
|
|
|
2595
2592
|
两种情形共用它(前端声明了、手里却还没有那个文件夹 / 手里那个文件夹的清单 id 库里没有)
|
|
2596
2593
|
—— 对用户是同一件事:这个块不在库里。 */
|
|
2597
2594
|
"not-in-db": "不在数据库"
|
|
2598
|
-
}, s = e["not-in-db"], { isStaff: o } =
|
|
2599
|
-
function
|
|
2600
|
-
|
|
2595
|
+
}, s = e["not-in-db"], { isStaff: o } = us(), r = cs(), { active: c } = Cl(), u = (i) => !ds(i, r), b = j(!1), h = j(""), v = j([]), _ = j(""), y = j(""), g = j(""), k = j([]), w = j(!1), E = j(!1), R = j("blocks"), L = j(""), $ = j([]), N = j(""), V = j(""), et = j(""), vt = j(""), P = j(!1), Pt = j(!1), ft = j(!1), St = j(!1), B = j(!1), M = j(null), S = j(null), D = j("one"), ht = j(pe()), lt = z(() => v.value.find((i) => i.id === ht.value) ?? null), Gt = () => D.value === "framework" ? { framework: !0 } : D.value === "all" ? {} : { blocks: [ht.value] }, te = z(() => D.value === "framework" ? "只铺框架文件(顶层那几份生成物 + example/):workspace/ 里的块代码一个字节都不写、也不删" : D.value === "one" && !lt.value ? "先在左边挑一个块(或者把范围改成「全部块」/「只铺框架文件」)" : "把库里的块铺到你选的文件夹");
|
|
2596
|
+
function de(i) {
|
|
2597
|
+
ht.value = i;
|
|
2601
2598
|
try {
|
|
2602
2599
|
window.localStorage.setItem("mb:export-block", i);
|
|
2603
2600
|
} catch {
|
|
2604
2601
|
}
|
|
2605
2602
|
}
|
|
2606
|
-
function
|
|
2603
|
+
function pe() {
|
|
2607
2604
|
try {
|
|
2608
2605
|
return window.localStorage.getItem("mb:export-block") ?? "";
|
|
2609
2606
|
} catch {
|
|
@@ -2611,25 +2608,25 @@ const Ma = { class: "mbc__head" }, Oa = ["title"], ja = ["title"], Da = {
|
|
|
2611
2608
|
}
|
|
2612
2609
|
}
|
|
2613
2610
|
Dt(v, (i) => {
|
|
2614
|
-
i.length !== 0 && (i.some((t) => t.id ===
|
|
2611
|
+
i.length !== 0 && (i.some((t) => t.id === ht.value) || de(i[0].id));
|
|
2615
2612
|
});
|
|
2616
|
-
const
|
|
2613
|
+
const ut = j(null), ot = j(""), H = j(null), _t = j({}), rt = j([]), ct = j([]), nt = j(null), O = j({}), I = j(""), W = j(null);
|
|
2617
2614
|
async function at(i) {
|
|
2618
2615
|
I.value = i;
|
|
2619
2616
|
try {
|
|
2620
2617
|
const t = await $t(`/magic-blocks/${encodeURIComponent(i)}/versions`);
|
|
2621
2618
|
O.value = { ...O.value, [i]: t.versions ?? [] };
|
|
2622
2619
|
} catch (t) {
|
|
2623
|
-
|
|
2620
|
+
se(t, "读版本列表");
|
|
2624
2621
|
} finally {
|
|
2625
2622
|
I.value = "";
|
|
2626
2623
|
}
|
|
2627
2624
|
}
|
|
2628
|
-
function
|
|
2625
|
+
function Jt(i) {
|
|
2629
2626
|
const t = [i.current ? "当前" : "", i.empty ? "空包(代码被删过)" : ""].filter(Boolean).join("、");
|
|
2630
2627
|
return `v${i.number}${t ? ` · ${t}` : ""}`;
|
|
2631
2628
|
}
|
|
2632
|
-
function
|
|
2629
|
+
function be(i) {
|
|
2633
2630
|
return i < 1024 ? `${i} B` : i < 1024 * 1024 ? `${Math.round(i / 1024)} KB` : `${(i / 1024 / 1024).toFixed(1)} MB`;
|
|
2634
2631
|
}
|
|
2635
2632
|
const Q = j(null);
|
|
@@ -2641,7 +2638,7 @@ const Ma = { class: "mbc__head" }, Oa = ["title"], ja = ["title"], Da = {
|
|
|
2641
2638
|
let l = M.value, m = null;
|
|
2642
2639
|
if (l)
|
|
2643
2640
|
try {
|
|
2644
|
-
m = await sn(l,
|
|
2641
|
+
m = await sn(l, ut.value ?? await Ke());
|
|
2645
2642
|
} catch {
|
|
2646
2643
|
l = null, m = null;
|
|
2647
2644
|
}
|
|
@@ -2650,11 +2647,11 @@ const Ma = { class: "mbc__head" }, Oa = ["title"], ja = ["title"], Da = {
|
|
|
2650
2647
|
const i = Q.value;
|
|
2651
2648
|
if (Q.value = null, !i) return;
|
|
2652
2649
|
const t = `「${i.row.module} / ${i.row.name || i.row.id}」`;
|
|
2653
|
-
Ie(),
|
|
2650
|
+
Ie(), Y.value = { active: !0, percent: 0, stage: "清本机那个文件夹…", failed: !1 };
|
|
2654
2651
|
let l = "";
|
|
2655
2652
|
if (i.target)
|
|
2656
2653
|
try {
|
|
2657
|
-
const m = await Re(i.target, i.folder), T = await
|
|
2654
|
+
const m = await Re(i.target, i.folder), T = await _a(m);
|
|
2658
2655
|
l = `清掉了本机「${i.target.name}/${i.folder}」里的 ${T} 项`;
|
|
2659
2656
|
} catch (m) {
|
|
2660
2657
|
l = `本机那份没清成(${qt(m)})`;
|
|
@@ -2665,9 +2662,9 @@ const Ma = { class: "mbc__head" }, Oa = ["title"], ja = ["title"], Da = {
|
|
|
2665
2662
|
try {
|
|
2666
2663
|
await $t(`/magic-blocks/${i.row.id}`, { method: "DELETE" });
|
|
2667
2664
|
} catch (m) {
|
|
2668
|
-
throw
|
|
2665
|
+
throw Ct(!1, "本机清了,但库里那份代码没清成"), new Error(`${l};但**库里那份代码没清成**(${qt(m)})—— 再点一次「删除代码文件」`);
|
|
2669
2666
|
}
|
|
2670
|
-
await Ft(), ot.value = `${t}的代码文件已删除:${l};库里那一份也清空了 ——**块还在**(页面上会显示成占位框)。想找回来:上面「块」那一屏点开这一块 → 版本史 → 对上一版点「切回」`, g.value = `删掉了${t}的代码文件(块本身还在)`,
|
|
2667
|
+
await Ft(), ot.value = `${t}的代码文件已删除:${l};库里那一份也清空了 ——**块还在**(页面上会显示成占位框)。想找回来:上面「块」那一屏点开这一块 → 版本史 → 对上一版点「切回」`, g.value = `删掉了${t}的代码文件(块本身还在)`, Ct(!0, "完成");
|
|
2671
2668
|
}, P);
|
|
2672
2669
|
async function Re(i, t) {
|
|
2673
2670
|
let l = i.handle;
|
|
@@ -2675,13 +2672,13 @@ const Ma = { class: "mbc__head" }, Oa = ["title"], ja = ["title"], Da = {
|
|
|
2675
2672
|
l = await l.getDirectoryHandle(m, { create: !0 });
|
|
2676
2673
|
return { handle: l, name: `${i.name}/${t}` };
|
|
2677
2674
|
}
|
|
2678
|
-
const J = j(null),
|
|
2679
|
-
width: `${Math.max(0, Math.min(100,
|
|
2680
|
-
background:
|
|
2675
|
+
const J = j(null), me = j(!1), Y = j({ active: !1, percent: 0, stage: "", failed: !1 }), Ps = z(() => ({
|
|
2676
|
+
width: `${Math.max(0, Math.min(100, Y.value.percent))}%`,
|
|
2677
|
+
background: Y.value.failed ? "var(--sp-color-danger)" : "var(--sp-color-primary, var(--primary-color))"
|
|
2681
2678
|
}));
|
|
2682
2679
|
let Le = [], $n = 0;
|
|
2683
2680
|
function Pe(i = !1) {
|
|
2684
|
-
if (!(!i && performance.now() - $n <
|
|
2681
|
+
if (!(!i && performance.now() - $n < wu)) {
|
|
2685
2682
|
$n = performance.now();
|
|
2686
2683
|
try {
|
|
2687
2684
|
window.localStorage.setItem("mb:progress", JSON.stringify(Le));
|
|
@@ -2690,20 +2687,20 @@ const Ma = { class: "mbc__head" }, Oa = ["title"], ja = ["title"], Da = {
|
|
|
2690
2687
|
}
|
|
2691
2688
|
}
|
|
2692
2689
|
function st(i, t) {
|
|
2693
|
-
|
|
2690
|
+
Y.value = { active: !0, percent: Math.max(Y.value.percent, i), stage: t, failed: !1 }, Le.push({ p: Y.value.percent, s: t, t: Math.round(performance.now()) }), Pe();
|
|
2694
2691
|
}
|
|
2695
|
-
function
|
|
2696
|
-
st(i ? 100 :
|
|
2692
|
+
function Ct(i, t) {
|
|
2693
|
+
st(i ? 100 : Y.value.percent, t), Y.value = { active: !i, percent: i ? 100 : Y.value.percent, stage: t, failed: !i }, Pe(!0);
|
|
2697
2694
|
}
|
|
2698
2695
|
function Ie() {
|
|
2699
2696
|
Le = [], Pe(!0);
|
|
2700
2697
|
}
|
|
2701
|
-
const xn = (i) => (i.disabledReason ?? "").trim(), Ne = (i) => (i.issues ?? []).map((t) => String(t?.message ?? "")).filter(Boolean),
|
|
2702
|
-
function
|
|
2698
|
+
const xn = (i) => (i.disabledReason ?? "").trim(), Ne = (i) => (i.issues ?? []).map((t) => String(t?.message ?? "")).filter(Boolean), fe = (i) => Po(i.id);
|
|
2699
|
+
function Is(i) {
|
|
2703
2700
|
_.value = _.value === i.id ? "" : i.id, _.value === i.id && at(i.id);
|
|
2704
2701
|
const t = c.value;
|
|
2705
|
-
|
|
2706
|
-
const l = i.name || i.id, m =
|
|
2702
|
+
Ts(i.id);
|
|
2703
|
+
const l = i.name || i.id, m = fe(i);
|
|
2707
2704
|
if (m.length === 0) {
|
|
2708
2705
|
g.value = `「${l}」这次会话里还没在哪条标签上露过面:先打开挂着它的那一页,再点一次`;
|
|
2709
2706
|
return;
|
|
@@ -2712,30 +2709,30 @@ const Ma = { class: "mbc__head" }, Oa = ["title"], ja = ["title"], Da = {
|
|
|
2712
2709
|
g.value = `「${l}」就在这一条标签上(${m.join(" / ")}):已经把它标红`;
|
|
2713
2710
|
return;
|
|
2714
2711
|
}
|
|
2715
|
-
const T =
|
|
2712
|
+
const T = Io(i.id, t, u);
|
|
2716
2713
|
if (T) {
|
|
2717
2714
|
g.value = `「${l}」不在这一条标签上:正在切到 ${T} 那条标签`, rn(T);
|
|
2718
2715
|
return;
|
|
2719
2716
|
}
|
|
2720
2717
|
g.value = `「${l}」只挂在带参数的实例标签上(${m.join(" / ")}):不替你挑一单 —— 自己打开要看的那一页再点`;
|
|
2721
2718
|
}
|
|
2722
|
-
const
|
|
2719
|
+
const Ns = (i, t) => it(async () => {
|
|
2723
2720
|
const l = await $t(
|
|
2724
2721
|
`/magic-blocks/${encodeURIComponent(i.id)}/versions/${t}`
|
|
2725
2722
|
);
|
|
2726
2723
|
W.value = { id: i.id, number: t, files: l.files ?? {} }, g.value = `正在看「${i.name || i.id}」的 v${t}(只读:不会改库里任何东西)`;
|
|
2727
|
-
}, P),
|
|
2724
|
+
}, P), qs = (i, t) => it(async () => {
|
|
2728
2725
|
window.confirm(`把「${i.name || i.id}」切回 v${t}?
|
|
2729
2726
|
|
|
2730
2727
|
这会把那一版的代码变成**当前版**,并且记成一个**新版本**(号继续 +1):历史只追加,旧版本一个都不会没。`) && (await zt(`/magic-blocks/${encodeURIComponent(i.id)}/versions/${t}`, { updatedBy: "" }), g.value = `「${i.name || i.id}」已切回 v${t}(并记成了一个新版本)`, await Ft(), await at(i.id));
|
|
2731
|
-
}, P),
|
|
2728
|
+
}, P), zs = (i, t) => it(async () => {
|
|
2732
2729
|
window.confirm(`删掉「${i.name || i.id}」的 v${t}?
|
|
2733
2730
|
|
|
2734
2731
|
这一版的代码就找不回来了(别的版本不受影响)。`) && (await $t(`/magic-blocks/${encodeURIComponent(i.id)}/versions/${t}`, { method: "DELETE" }), g.value = `删掉了「${i.name || i.id}」的 v${t}`, await at(i.id));
|
|
2735
|
-
}, P),
|
|
2732
|
+
}, P), Fs = (i, t) => it(async () => {
|
|
2736
2733
|
const l = await fetch(
|
|
2737
2734
|
`${we}/magic-blocks/${encodeURIComponent(i.id)}/versions/${t}?download=1`,
|
|
2738
|
-
{ credentials: "include", headers:
|
|
2735
|
+
{ credentials: "include", headers: ue("GET", !1) }
|
|
2739
2736
|
);
|
|
2740
2737
|
if (!l.ok) throw new Error(`下载失败(HTTP ${l.status})`);
|
|
2741
2738
|
const m = await l.blob(), T = URL.createObjectURL(m);
|
|
@@ -2747,69 +2744,61 @@ const Ma = { class: "mbc__head" }, Oa = ["title"], ja = ["title"], Da = {
|
|
|
2747
2744
|
}
|
|
2748
2745
|
g.value = `已下载「${i.name || i.id}」的 v${t}`;
|
|
2749
2746
|
}, P);
|
|
2750
|
-
function
|
|
2747
|
+
function Us(i) {
|
|
2751
2748
|
N.value = i.id, V.value = (i.tags ?? []).join(", ");
|
|
2752
2749
|
}
|
|
2753
2750
|
const wn = (i) => it(async () => {
|
|
2754
2751
|
const t = V.value.split(/[,,\s]+/).map((m) => m.trim()).filter(Boolean), l = await zt(`/magic-blocks/${encodeURIComponent(i.id)}/tags`, { tags: t });
|
|
2755
2752
|
N.value = "", g.value = `「${i.name || i.id}」的标签已存:${(l.tags ?? []).join(" / ") || "(一个都不剩)"}`, await Ft();
|
|
2756
|
-
}, P, "存标签"),
|
|
2757
|
-
const t = await zt(`/magic-blocks/${encodeURIComponent(i.id)}/detail`, { detail:
|
|
2758
|
-
et.value = "", g.value = `「${i.name || i.id}」的详情已存${(t.detail ?? "").trim() ? "" : "(清掉了)"};块包里那份 ${
|
|
2753
|
+
}, P, "存标签"), Hs = (i) => it(async () => {
|
|
2754
|
+
const t = await zt(`/magic-blocks/${encodeURIComponent(i.id)}/detail`, { detail: vt.value });
|
|
2755
|
+
et.value = "", g.value = `「${i.name || i.id}」的详情已存${(t.detail ?? "").trim() ? "" : "(清掉了)"};块包里那份 ${Wn} 跟着一起写了`, await Ft();
|
|
2759
2756
|
}, P, "存详情");
|
|
2760
|
-
function
|
|
2761
|
-
et.value = i.id,
|
|
2757
|
+
function Ws(i) {
|
|
2758
|
+
et.value = i.id, vt.value = (i.detail ?? "").trim();
|
|
2762
2759
|
}
|
|
2763
|
-
function
|
|
2760
|
+
function Ks(i) {
|
|
2764
2761
|
const t = V.value.split(/[,,\s]+/).map((l) => l.trim()).filter(Boolean);
|
|
2765
2762
|
t.some((l) => l.toLowerCase() === i.toLowerCase()) || t.push(i), V.value = t.join(", ");
|
|
2766
2763
|
}
|
|
2767
|
-
function
|
|
2764
|
+
function Vs(i) {
|
|
2768
2765
|
V.value = V.value.split(/[,,\s]+/).map((t) => t.trim()).filter((t) => t && t.toLowerCase() !== i.toLowerCase()).join(", ");
|
|
2769
2766
|
}
|
|
2770
|
-
function
|
|
2767
|
+
function Gs(i) {
|
|
2771
2768
|
const t = L.value.trim().toLowerCase();
|
|
2772
2769
|
return t ? (i.tags ?? []).some((l) => l.toLowerCase().includes(t)) : !0;
|
|
2773
2770
|
}
|
|
2774
|
-
function
|
|
2771
|
+
function qe(i) {
|
|
2775
2772
|
const t = i.code;
|
|
2776
2773
|
return t && typeof t.total == "number" ? t : null;
|
|
2777
2774
|
}
|
|
2778
2775
|
function Sn(i) {
|
|
2779
|
-
const t =
|
|
2776
|
+
const t = qe(i);
|
|
2780
2777
|
return t ? `${t.total} 行` : "";
|
|
2781
2778
|
}
|
|
2782
|
-
function
|
|
2783
|
-
const t =
|
|
2784
|
-
return t && t.nonEffective > 0 ? `另有 ${t.nonEffective} 行不生效` : "";
|
|
2785
|
-
}
|
|
2786
|
-
function Cn(i) {
|
|
2787
|
-
const t = fe(i);
|
|
2779
|
+
function Js(i) {
|
|
2780
|
+
const t = qe(i);
|
|
2788
2781
|
if (!t) return "";
|
|
2789
2782
|
const l = [
|
|
2790
|
-
|
|
2791
|
-
"
|
|
2783
|
+
`代码 ${t.total} 行 · ${t.files} 个文件(含注释与空行)`,
|
|
2784
|
+
"只算块包里的代码文件:.md / .txt / .svg 不算;.exclude/ 里的草稿不进库、也不算。"
|
|
2792
2785
|
];
|
|
2793
2786
|
for (const m of t.byFile) l.push(`${String(m.lines).padStart(5, " ")} ${m.name}`);
|
|
2794
|
-
|
|
2795
|
-
l.push(""), l.push(`不生效 ${t.nonEffective} 行 · ${t.nonEffectiveFiles.length} 个文件(照样进库、存进版本史,但执行时被忽略)`);
|
|
2796
|
-
for (const m of t.nonEffectiveFiles) l.push(`${String(m.lines).padStart(5, " ")} ${m.name}`);
|
|
2797
|
-
}
|
|
2798
|
-
return l.join(`
|
|
2787
|
+
return t.byFile.length === 0 && l.push("(这一块还没有代码文件)"), l.join(`
|
|
2799
2788
|
`);
|
|
2800
2789
|
}
|
|
2801
|
-
function
|
|
2802
|
-
const t =
|
|
2790
|
+
function Ys(i) {
|
|
2791
|
+
const t = fe(i), l = t.length === 0 ? "点一下:这次会话里它还没在哪条标签上露过面" : `点一下:把「${i.name || i.id}」标红,并在需要时切到挂着它的标签(${t.join(" / ")})`, m = xn(i);
|
|
2803
2792
|
return m ? `${m}
|
|
2804
2793
|
${l}` : l;
|
|
2805
2794
|
}
|
|
2806
|
-
const
|
|
2795
|
+
const Cn = z(() => {
|
|
2807
2796
|
const i = h.value.trim().toLowerCase();
|
|
2808
|
-
return v.value.filter((t) =>
|
|
2809
|
-
}), he =
|
|
2810
|
-
function
|
|
2797
|
+
return v.value.filter((t) => Gs(t) ? i ? `${t.module} ${t.name} ${t.brief} ${t.detail ?? ""} ${t.id} v${t.version ?? ""} ${(t.tags ?? []).join(" ")}`.toLowerCase().includes(i) : !0 : !1);
|
|
2798
|
+
}), he = z(() => (H.value?.blocks ?? []).filter((i) => i.canApply)), It = z(() => he.value.filter((i) => _t.value[i.id] === !0)), Nt = j(!1), yt = z(() => rt.value.length + (H.value?.failures ?? []).length + ct.value.filter((i) => !i.ok).length), ee = z(() => ct.value.filter((i) => !i.ok)), ze = z(() => ct.value.filter((i) => i.ok).length), Fe = z(() => v.value.filter((i) => i.enabled === !1).length), ne = z(() => (nt.value?.results ?? []).filter((i) => (i.verifyNotes ?? []).length > 0)), Et = z(() => ne.value.reduce((i, t) => i + (t.verifyNotes ?? []).length, 0));
|
|
2799
|
+
function Xs() {
|
|
2811
2800
|
const i = /* @__PURE__ */ new Set(), t = [];
|
|
2812
|
-
for (const l of
|
|
2801
|
+
for (const l of Ue()) {
|
|
2813
2802
|
const m = typeof l?.path == "string" ? l.path.trim() : "";
|
|
2814
2803
|
if (!m || i.has(m) || m.includes(":") || m.includes("*") || l.redirect || !l.components?.default || l.meta?.tab === !1) continue;
|
|
2815
2804
|
i.add(m);
|
|
@@ -2822,10 +2811,10 @@ ${l}` : l;
|
|
|
2822
2811
|
}
|
|
2823
2812
|
return t;
|
|
2824
2813
|
}
|
|
2825
|
-
function
|
|
2814
|
+
function Ue() {
|
|
2826
2815
|
return r?.getRoutes?.() ?? [];
|
|
2827
2816
|
}
|
|
2828
|
-
const
|
|
2817
|
+
const He = z(() => Qo(Ue(), Os, v.value.map((i) => i.id))), Zs = {
|
|
2829
2818
|
models: "项目模型",
|
|
2830
2819
|
surface: "模型的行为表面(方法 / 属性)",
|
|
2831
2820
|
packages: "pip 包",
|
|
@@ -2834,28 +2823,28 @@ ${l}` : l;
|
|
|
2834
2823
|
routes: "跨块跳转的地址",
|
|
2835
2824
|
opaque: "豁免(只声明、不查它内部)"
|
|
2836
2825
|
};
|
|
2837
|
-
function
|
|
2826
|
+
function En(i) {
|
|
2838
2827
|
const t = i.requires;
|
|
2839
2828
|
if (!t || typeof t != "object") return [];
|
|
2840
2829
|
const l = [];
|
|
2841
|
-
for (const [m, T] of Object.entries(
|
|
2830
|
+
for (const [m, T] of Object.entries(Zs)) {
|
|
2842
2831
|
const q = t[m], tt = [];
|
|
2843
2832
|
if (m === "surface" && q && typeof q == "object")
|
|
2844
|
-
for (const [U,
|
|
2845
|
-
for (const
|
|
2833
|
+
for (const [U, dt] of Object.entries(q))
|
|
2834
|
+
for (const X of Array.isArray(dt) ? dt : []) tt.push(`${U}.${String(X)}`);
|
|
2846
2835
|
else if (Array.isArray(q))
|
|
2847
2836
|
for (const U of q) tt.push(String(U));
|
|
2848
2837
|
tt.length > 0 && l.push({ key: m, title: T, values: tt });
|
|
2849
2838
|
}
|
|
2850
2839
|
return l;
|
|
2851
2840
|
}
|
|
2852
|
-
function
|
|
2853
|
-
return
|
|
2841
|
+
function Qs(i) {
|
|
2842
|
+
return la(i.requires?.routes, Ue());
|
|
2854
2843
|
}
|
|
2855
2844
|
function qt(i) {
|
|
2856
2845
|
return (i instanceof Error ? i.message.trim() : String(i)) || "请求没有到达后端(网络或登录态的问题),请重试";
|
|
2857
2846
|
}
|
|
2858
|
-
function
|
|
2847
|
+
function tl(i) {
|
|
2859
2848
|
const t = i?.issues;
|
|
2860
2849
|
return Array.isArray(t) ? t.map((l) => typeof l == "string" ? l : String(l?.message ?? "")).filter(Boolean) : [];
|
|
2861
2850
|
}
|
|
@@ -2867,15 +2856,15 @@ ${l}` : l;
|
|
|
2867
2856
|
const T = qt(m), q = await fetch(`${we}${i}`, {
|
|
2868
2857
|
method: "POST",
|
|
2869
2858
|
credentials: "include",
|
|
2870
|
-
headers: { "Content-Type": "application/json", ...
|
|
2859
|
+
headers: { "Content-Type": "application/json", ...ue("POST", !0) },
|
|
2871
2860
|
body: l
|
|
2872
|
-
}).then((U) => U.json()).catch(() => null), tt =
|
|
2861
|
+
}).then((U) => U.json()).catch(() => null), tt = tl(q);
|
|
2873
2862
|
throw tt.length === 0 ? new Error(T) : new Error(`${String(q?.message ?? T)}
|
|
2874
2863
|
- ${tt.join(`
|
|
2875
2864
|
- `)}`);
|
|
2876
2865
|
}
|
|
2877
2866
|
}
|
|
2878
|
-
async function
|
|
2867
|
+
async function el() {
|
|
2879
2868
|
const i = k.value.map((t) => `[${t.at}] ${t.where}
|
|
2880
2869
|
${t.text}`).join(`
|
|
2881
2870
|
|
|
@@ -2883,23 +2872,23 @@ ${t.text}`).join(`
|
|
|
2883
2872
|
try {
|
|
2884
2873
|
await navigator.clipboard.writeText(i), g.value = `已复制 ${k.value.length} 条报错`;
|
|
2885
2874
|
} catch (t) {
|
|
2886
|
-
|
|
2875
|
+
se(t, "复制报错");
|
|
2887
2876
|
}
|
|
2888
2877
|
}
|
|
2889
|
-
function
|
|
2878
|
+
function nl() {
|
|
2890
2879
|
const i = [];
|
|
2891
2880
|
rt.value.length > 0 && i.push("【前端校验拦下的】", ...rt.value.map((t) => `- ${t}`), "");
|
|
2892
2881
|
for (const t of H.value?.failures ?? [])
|
|
2893
2882
|
i.push(`【读回:${t.kind || "问题"}】${t.where || ""}`, `- ${t.message || ""}`, "");
|
|
2894
|
-
for (const t of
|
|
2883
|
+
for (const t of ee.value)
|
|
2895
2884
|
i.push(
|
|
2896
2885
|
`【没存成】${t.name || t.id}`,
|
|
2897
2886
|
`- ${t.error || ""}`,
|
|
2898
2887
|
...(t.issues ?? []).map((l) => `- ${l}`),
|
|
2899
2888
|
""
|
|
2900
2889
|
);
|
|
2901
|
-
nt.value && nt.value.results.length > 0 && i.push(`【体检的边界(不是错)】${
|
|
2902
|
-
for (const t of
|
|
2890
|
+
nt.value && nt.value.results.length > 0 && i.push(`【体检的边界(不是错)】${is}`, "");
|
|
2891
|
+
for (const t of ne.value)
|
|
2903
2892
|
i.push(
|
|
2904
2893
|
`【体检说明:提示 / 没验到(不是错)】${t.name || t.id}`,
|
|
2905
2894
|
...(t.verifyNotes ?? []).map((l) => `- ${l}`),
|
|
@@ -2908,18 +2897,18 @@ ${t.text}`).join(`
|
|
|
2908
2897
|
return i.join(`
|
|
2909
2898
|
`).trim() || "这一趟没有问题。";
|
|
2910
2899
|
}
|
|
2911
|
-
async function
|
|
2900
|
+
async function sl() {
|
|
2912
2901
|
try {
|
|
2913
|
-
await navigator.clipboard.writeText(
|
|
2902
|
+
await navigator.clipboard.writeText(nl()), g.value = `已复制这一趟的 ${yt.value} 条问题`;
|
|
2914
2903
|
} catch (i) {
|
|
2915
|
-
|
|
2904
|
+
se(i, "复制问题");
|
|
2916
2905
|
}
|
|
2917
2906
|
}
|
|
2918
|
-
function
|
|
2907
|
+
function se(i, t) {
|
|
2919
2908
|
const l = qt(i);
|
|
2920
2909
|
y.value = l, k.value = [...k.value, { at: (/* @__PURE__ */ new Date()).toLocaleTimeString(), where: t, text: l }];
|
|
2921
2910
|
}
|
|
2922
|
-
function
|
|
2911
|
+
function We() {
|
|
2923
2912
|
y.value = "", k.value = [];
|
|
2924
2913
|
}
|
|
2925
2914
|
async function Ft() {
|
|
@@ -2927,188 +2916,188 @@ ${t.text}`).join(`
|
|
|
2927
2916
|
const i = await $t("/magic-blocks/index");
|
|
2928
2917
|
v.value = i.blocks ?? [], $.value = i.tags ?? [];
|
|
2929
2918
|
} catch (i) {
|
|
2930
|
-
|
|
2919
|
+
se(i, "读块清单");
|
|
2931
2920
|
}
|
|
2932
2921
|
}
|
|
2933
2922
|
async function it(i, t, l = "") {
|
|
2934
|
-
t.value = !0,
|
|
2923
|
+
t.value = !0, We();
|
|
2935
2924
|
try {
|
|
2936
|
-
await i(),
|
|
2925
|
+
await i(), Oo();
|
|
2937
2926
|
} catch (m) {
|
|
2938
|
-
|
|
2927
|
+
se(m, l || "这个动作");
|
|
2939
2928
|
} finally {
|
|
2940
2929
|
t.value = !1;
|
|
2941
2930
|
}
|
|
2942
2931
|
}
|
|
2943
|
-
const
|
|
2932
|
+
const ll = () => it(async () => {
|
|
2944
2933
|
Pt.value = !0;
|
|
2945
2934
|
try {
|
|
2946
2935
|
const i = await $t("/magic-blocks/check", { method: "POST", body: JSON.stringify({}) });
|
|
2947
2936
|
nt.value = i;
|
|
2948
|
-
const t =
|
|
2937
|
+
const t = Et.value;
|
|
2949
2938
|
g.value = `全部魔法块重新校验完了:查了 ${i.checked} 个块,通过 ${i.passed}、停用 ${i.disabled}(只做静态判据、不执行块代码)` + (t > 0 ? `;另有 ${t} 条"没验到 / 只提示"的说明,见下面那一段` : ""), await Ft();
|
|
2950
2939
|
} finally {
|
|
2951
2940
|
Pt.value = !1;
|
|
2952
2941
|
}
|
|
2953
|
-
}, P),
|
|
2942
|
+
}, P), Bn = (i) => it(async () => {
|
|
2954
2943
|
const t = await nn();
|
|
2955
2944
|
i === "export" ? (M.value = t, S.value || (S.value = t)) : (S.value = t, M.value || (M.value = t)), g.value = i === "export" ? `导出目录:${t.name}${S.value === t ? "(读回目录也填成它了)" : ""}` : `读回目录:${t.name}`;
|
|
2956
2945
|
}, P);
|
|
2957
|
-
async function
|
|
2958
|
-
if (
|
|
2946
|
+
async function Ke() {
|
|
2947
|
+
if (ut.value) return ut.value;
|
|
2959
2948
|
const i = await $t("/magic-blocks/rules");
|
|
2960
|
-
return
|
|
2949
|
+
return ut.value = i.rules, i.rules;
|
|
2961
2950
|
}
|
|
2962
|
-
const
|
|
2963
|
-
if (!
|
|
2951
|
+
const ol = () => it(async () => {
|
|
2952
|
+
if (!js()) throw new Error("这个浏览器没法直接写你本机的文件夹:请用 Chrome / Edge,并从 https 或 localhost 打开");
|
|
2964
2953
|
const i = D.value === "framework";
|
|
2965
2954
|
if (D.value === "one" && !lt.value)
|
|
2966
2955
|
throw new Error("还没挑块:上面选「仅这一个块」时要先在下拉里挑一个块(或者把范围改成「全部块」/「只铺框架文件」)");
|
|
2967
|
-
|
|
2956
|
+
ft.value = !0, g.value = "", ot.value = "", We(), Ie(), Ve.length = 0, ve = performance.now(), Yt = null, Xt = null, Y.value = { active: !0, percent: 0, stage: "准备…", failed: !1 };
|
|
2968
2957
|
try {
|
|
2969
2958
|
const t = M.value ?? await nn();
|
|
2970
2959
|
M.value = t, S.value || (S.value = t);
|
|
2971
|
-
const l = zt("/magic-blocks/export",
|
|
2972
|
-
|
|
2960
|
+
const l = zt("/magic-blocks/export", Gt()), m = Je(), T = ut.value ? sn(t, ut.value) : null, q = await Ut("取包", l);
|
|
2961
|
+
ut.value = q.rules, $a(t, q.rules);
|
|
2973
2962
|
const tt = T ? await Ut("数目录", T) : await Ut("数目录", sn(t, q.rules));
|
|
2974
2963
|
if (tt.topCount > 0) {
|
|
2975
|
-
st(5, "等你确认要不要先清空"),
|
|
2964
|
+
st(5, "等你确认要不要先清空"), Yt = q, Xt = m, J.value = { target: t, inventory: tt, framework: i, exampleDir: q.exampleDir ?? "" };
|
|
2976
2965
|
return;
|
|
2977
2966
|
}
|
|
2978
|
-
await
|
|
2967
|
+
await Ye(t, q, { clean: !1, verify: !1, front: m, framework: i });
|
|
2979
2968
|
} catch (t) {
|
|
2980
|
-
throw
|
|
2969
|
+
throw Ct(!1, "导出失败"), t;
|
|
2981
2970
|
} finally {
|
|
2982
|
-
|
|
2971
|
+
ft.value = !1;
|
|
2983
2972
|
}
|
|
2984
|
-
}, P),
|
|
2985
|
-
let ve = 0,
|
|
2986
|
-
function
|
|
2987
|
-
|
|
2973
|
+
}, P), Tn = /* @__PURE__ */ new WeakMap(), Ve = [];
|
|
2974
|
+
let ve = 0, Yt = null, Xt = null;
|
|
2975
|
+
function Ge(i, t) {
|
|
2976
|
+
Ve.push([i, Math.round(performance.now() - t)]);
|
|
2988
2977
|
}
|
|
2989
2978
|
async function Ut(i, t) {
|
|
2990
2979
|
const l = performance.now();
|
|
2991
2980
|
try {
|
|
2992
2981
|
return await t;
|
|
2993
2982
|
} finally {
|
|
2994
|
-
|
|
2983
|
+
Ge(i, l);
|
|
2995
2984
|
}
|
|
2996
2985
|
}
|
|
2997
|
-
function
|
|
2998
|
-
const i =
|
|
2986
|
+
function al() {
|
|
2987
|
+
const i = Ve.map(([t, l]) => `${t} ${l}ms`);
|
|
2999
2988
|
return ve > 0 && i.push(`总 ${Math.round(performance.now() - ve)}ms`), i.length > 0 ? `;耗时:${i.join(" · ")}` : "";
|
|
3000
2989
|
}
|
|
3001
|
-
function
|
|
2990
|
+
function Je() {
|
|
3002
2991
|
const i = performance.now();
|
|
3003
2992
|
let t;
|
|
3004
2993
|
try {
|
|
3005
|
-
const l =
|
|
2994
|
+
const l = ws();
|
|
3006
2995
|
t = {
|
|
3007
2996
|
css: l.css,
|
|
3008
2997
|
/* 🔴 把**这一趟收下来的那份 CSS** 交给索引页:`CONTROLS.lock.html` 里的 token 表与类名总表
|
|
3009
2998
|
* 是从它算出来的(不再手抄一份 —— 手抄的一定会跟主题漂开)。 */
|
|
3010
|
-
controls:
|
|
2999
|
+
controls: ko(l.css),
|
|
3011
3000
|
note: l.skipped.length > 0 ? `;⚠️ 有 ${l.skipped.length} 张样式表读不到规则(跨源):${l.skipped.join(" / ")}` : ""
|
|
3012
3001
|
};
|
|
3013
3002
|
} catch (l) {
|
|
3014
3003
|
t = { css: "", controls: "", note: `;主题 CSS 没收成(${qt(l)}):${Lt} 没写,其余照旧` };
|
|
3015
3004
|
}
|
|
3016
|
-
return
|
|
3005
|
+
return Ge("收主题", i), t;
|
|
3017
3006
|
}
|
|
3018
|
-
async function
|
|
3007
|
+
async function Ye(i, t, l) {
|
|
3019
3008
|
const { clean: m, verify: T, thorough: q, framework: tt, front: U } = l;
|
|
3020
|
-
tt &&
|
|
3009
|
+
tt && xa(t.files, t.rules);
|
|
3021
3010
|
try {
|
|
3022
3011
|
st(20, "准备写盘…");
|
|
3023
|
-
const
|
|
3024
|
-
|
|
3012
|
+
const dt = pa(Xs()), X = { ...t.files };
|
|
3013
|
+
X[xe] = dt, U.css && (X[Lt] = U.css), U.controls && (X[re] = U.controls), t.exampleDir && (X[`${t.exampleDir}/${xe}`] = dt, U.css && (X[`${t.exampleDir}/${Lt}`] = U.css), U.controls && (X[`${t.exampleDir}/${re}`] = U.controls));
|
|
3025
3014
|
const Bt = U.note;
|
|
3026
|
-
await new Promise((
|
|
3027
|
-
setTimeout(
|
|
3015
|
+
await new Promise((kt) => {
|
|
3016
|
+
setTimeout(kt, 0);
|
|
3028
3017
|
});
|
|
3029
|
-
let
|
|
3018
|
+
let le = "", Tt;
|
|
3030
3019
|
if (m) {
|
|
3031
3020
|
st(35, "清掉这一包不要的东西…");
|
|
3032
|
-
const
|
|
3033
|
-
Tt =
|
|
3021
|
+
const kt = [...t.rules.scratchDirs, ...tt ? [t.rules.blocksDir] : []], Ht = await Ut("清多余", ya(i, X, kt));
|
|
3022
|
+
Tt = Ht.existing, le = Ht.removed > 0 ? `,先清掉了 ${Ht.removed} 项` : ",没有多余的东西要清";
|
|
3034
3023
|
} else
|
|
3035
|
-
st(35, "看一眼目录里有什么…"), Tt = await Ut("看目录",
|
|
3036
|
-
const K =
|
|
3037
|
-
st(
|
|
3038
|
-
let
|
|
3039
|
-
const
|
|
3040
|
-
const
|
|
3041
|
-
|
|
3024
|
+
st(35, "看一眼目录里有什么…"), Tt = await Ut("看目录", ka(i, X));
|
|
3025
|
+
const K = Tn.get(i.handle), ge = Object.keys(X).length, oe = m ? 45 : 30;
|
|
3026
|
+
st(oe, `写文件 0/${ge}…`);
|
|
3027
|
+
let Dn = 0;
|
|
3028
|
+
const ml = performance.now(), pt = await ga(i, X, (kt, Ht) => {
|
|
3029
|
+
const Ln = Date.now();
|
|
3030
|
+
kt < Ht && Ln - Dn < xu || (Dn = Ln, st(oe + Math.round(kt / Math.max(1, Ht) * (95 - oe)), `写文件 ${kt}/${Ht}…`));
|
|
3042
3031
|
}, {
|
|
3043
3032
|
verify: T,
|
|
3044
3033
|
// 🔴 账本:勾了「逐个核对磁盘」就不给它 —— 那样连上一趟铺过的也重新核对一遍。
|
|
3045
3034
|
trust: q ? void 0 : K,
|
|
3046
3035
|
existing: Tt
|
|
3047
3036
|
});
|
|
3048
|
-
|
|
3049
|
-
const
|
|
3050
|
-
|
|
3051
|
-
const
|
|
3052
|
-
ot.value = (tt ? `只铺「${i.name}」里的**框架文件**:写了 ${
|
|
3053
|
-
} catch (
|
|
3054
|
-
throw
|
|
3037
|
+
Ge("写盘", ml), Tn.set(i.handle, pt.fingerprints), st(98, "收尾…");
|
|
3038
|
+
const fl = pt.failed.length > 0 ? `;⚠️ ${pt.failed.length} 个文件没写成:${pt.failed.slice(0, 3).map((kt) => `${kt.path}(${kt.message})`).join("、")}` + (pt.failed.length > 3 ? ` 等 ${pt.failed.length} 条` : "") : "", _e = [];
|
|
3039
|
+
pt.skipped > 0 && _e.push(`${pt.skipped} 个与库里一字不差(逐字节比过)`), pt.trusted > 0 && _e.push(`${pt.trusted} 个按上一趟的账本跳过(没再碰磁盘)`);
|
|
3040
|
+
const Rn = _e.length > 0 ? `,跳过 ${_e.join(" / ")}` : "", hl = `${xe} / ${Lt} / ${re}` + (t.exampleDir ? ` / ${t.exampleDir}/` : "") + " 与顶层另外那几份生成物";
|
|
3041
|
+
ot.value = (tt ? `只铺「${i.name}」里的**框架文件**:写了 ${pt.written} 个文件${Rn}(${hl};${t.rules.blocksDir}/ 里的块代码一个字节都没动)` : `铺到「${i.name}」:${t.blocks} 个块、写了 ${pt.written} 个文件${Rn}(含 ${xe} / ${Lt} / ${re})`) + `${le}${fl}${Bt}${al()}`, g.value = pt.failed.length > 0 ? "导出完了,但有文件没写成(见下面那句)" : "导出完了:用你自己的编辑器改,改完回这里「读回改动」", Ct(!0, "完成"), Yt = null, Xt = null;
|
|
3042
|
+
} catch (dt) {
|
|
3043
|
+
throw Ct(!1, "导出中途失败(已经铺进去的文件不会自己删掉)"), dt;
|
|
3055
3044
|
}
|
|
3056
3045
|
}
|
|
3057
|
-
const
|
|
3046
|
+
const il = () => it(async () => {
|
|
3058
3047
|
const i = J.value;
|
|
3059
3048
|
if (J.value = null, !!i) {
|
|
3060
|
-
|
|
3049
|
+
ft.value = !0;
|
|
3061
3050
|
try {
|
|
3062
|
-
const t =
|
|
3063
|
-
|
|
3051
|
+
const t = Yt ?? await Ut("取包", zt("/magic-blocks/export", Gt())), l = Xt ?? Je();
|
|
3052
|
+
ut.value = t.rules, await Ye(i.target, t, {
|
|
3064
3053
|
clean: !0,
|
|
3065
3054
|
verify: !0,
|
|
3066
|
-
thorough:
|
|
3055
|
+
thorough: me.value,
|
|
3067
3056
|
framework: i.framework,
|
|
3068
3057
|
front: l
|
|
3069
3058
|
});
|
|
3070
3059
|
} catch (t) {
|
|
3071
|
-
throw
|
|
3060
|
+
throw Ct(!1, "导出失败"), t;
|
|
3072
3061
|
} finally {
|
|
3073
|
-
|
|
3062
|
+
ft.value = !1;
|
|
3074
3063
|
}
|
|
3075
3064
|
}
|
|
3076
|
-
}, P),
|
|
3065
|
+
}, P), rl = () => it(async () => {
|
|
3077
3066
|
const i = J.value;
|
|
3078
3067
|
if (J.value = null, !!i) {
|
|
3079
|
-
|
|
3068
|
+
ft.value = !0;
|
|
3080
3069
|
try {
|
|
3081
|
-
const t =
|
|
3082
|
-
|
|
3070
|
+
const t = Yt ?? await Ut("取包", zt("/magic-blocks/export", Gt())), l = Xt ?? Je();
|
|
3071
|
+
ut.value = t.rules, await Ye(i.target, t, {
|
|
3083
3072
|
clean: !1,
|
|
3084
3073
|
verify: !0,
|
|
3085
|
-
thorough:
|
|
3074
|
+
thorough: me.value,
|
|
3086
3075
|
framework: i.framework,
|
|
3087
3076
|
front: l
|
|
3088
3077
|
});
|
|
3089
3078
|
} catch (t) {
|
|
3090
|
-
throw
|
|
3079
|
+
throw Ct(!1, "导出失败"), t;
|
|
3091
3080
|
} finally {
|
|
3092
|
-
|
|
3081
|
+
ft.value = !1;
|
|
3093
3082
|
}
|
|
3094
3083
|
}
|
|
3095
3084
|
}, P);
|
|
3096
|
-
function
|
|
3097
|
-
J.value = null,
|
|
3085
|
+
function cl() {
|
|
3086
|
+
J.value = null, Yt = null, Xt = null, ve = 0, Y.value = { active: !1, percent: 0, stage: "", failed: !1 }, g.value = "这次没有导出(目录里的东西一个字节都没动)", ot.value = "";
|
|
3098
3087
|
}
|
|
3099
|
-
function
|
|
3088
|
+
function ul(i) {
|
|
3100
3089
|
H.value = i;
|
|
3101
3090
|
const t = {};
|
|
3102
3091
|
for (const m of i.blocks ?? []) t[m.id] = m.status === "modified" && m.canApply;
|
|
3103
|
-
|
|
3092
|
+
_t.value = t;
|
|
3104
3093
|
const l = (i.blocks ?? []).reduce((m, T) => ({ ...m, [T.status]: (m[T.status] ?? 0) + 1 }), {});
|
|
3105
3094
|
g.value = `扫到 ${i.folders} 个文件夹、${i.files} 个文件:有改动 ${l.modified ?? 0} / 没改动 ${l.unchanged ?? 0}` + (i.complete ? "" : "(层数到了上限,没走完,可能还有块没扫到)");
|
|
3106
3095
|
}
|
|
3107
|
-
async function
|
|
3096
|
+
async function dl(i, t) {
|
|
3108
3097
|
const l = () => (performance.now() - t.startedAt) / 1e3, m = await fetch(`${we}/magic-blocks/read`, {
|
|
3109
3098
|
method: "POST",
|
|
3110
3099
|
credentials: "include",
|
|
3111
|
-
headers: { "Content-Type": "application/json", ...
|
|
3100
|
+
headers: { "Content-Type": "application/json", ...ue("POST", !0) },
|
|
3112
3101
|
body: JSON.stringify({ ...i, includeMissing: !1, stream: !0 })
|
|
3113
3102
|
}), T = (m.headers.get("content-type") ?? "").toLowerCase();
|
|
3114
3103
|
if (!m.ok) {
|
|
@@ -3119,20 +3108,20 @@ ${t.text}`).join(`
|
|
|
3119
3108
|
const q = m.body?.getReader();
|
|
3120
3109
|
if (!q) throw new Error("这个浏览器拿不到流式回话(response.body 是空的):换成 Chrome / Edge 再试;这一趟没有改动任何东西。");
|
|
3121
3110
|
const tt = new TextDecoder();
|
|
3122
|
-
let U = "",
|
|
3123
|
-
const
|
|
3124
|
-
const K =
|
|
3111
|
+
let U = "", dt = null, X = 0, Bt = "收到回话了,正在配对…";
|
|
3112
|
+
const le = (Tt) => {
|
|
3113
|
+
const K = aa(Tt);
|
|
3125
3114
|
if (K) {
|
|
3126
3115
|
if (K.type === "start")
|
|
3127
3116
|
Bt = `后端收到 ${K.folders} 个文件夹 / ${K.files} 个文件,正在配对…`, st(6, Bt);
|
|
3128
3117
|
else if (K.type === "judged")
|
|
3129
|
-
|
|
3118
|
+
X = K.checks, Bt = `配对完成:${K.blocks} 个块,要逐块校验 ${X} 个`, st(10, Bt);
|
|
3130
3119
|
else if (K.type === "check")
|
|
3131
|
-
|
|
3120
|
+
X = K.total || X, Bt = `校验 ${K.name || K.id}(${K.done}/${X})${K.ok ? "" : "· 没过"}`, st(ia(K.done, X), Bt);
|
|
3132
3121
|
else if (K.type === "ping")
|
|
3133
|
-
st(
|
|
3122
|
+
st(Y.value.percent, `${Bt}(已经 ${Math.max(1, Math.round(K.seconds))} 秒)`);
|
|
3134
3123
|
else if (K.type === "result")
|
|
3135
|
-
|
|
3124
|
+
dt = K.result;
|
|
3136
3125
|
else if (K.type === "error")
|
|
3137
3126
|
throw new Error(`后端在算的过程中抛了异常(这一趟没有结果):${K.message}`);
|
|
3138
3127
|
}
|
|
@@ -3140,35 +3129,35 @@ ${t.text}`).join(`
|
|
|
3140
3129
|
for (; ; ) {
|
|
3141
3130
|
const { value: Tt, done: K } = await q.read();
|
|
3142
3131
|
if (K) break;
|
|
3143
|
-
const ge =
|
|
3132
|
+
const ge = oa(U, tt.decode(Tt, { stream: !0 }));
|
|
3144
3133
|
U = ge.rest;
|
|
3145
|
-
for (const
|
|
3134
|
+
for (const oe of ge.lines) le(oe);
|
|
3146
3135
|
}
|
|
3147
|
-
if (U.trim() &&
|
|
3136
|
+
if (U.trim() && le(U), !dt)
|
|
3148
3137
|
throw new Error(en(
|
|
3149
3138
|
new Error("流式回话断在半路上:后端没有再发 result(连接被中途掐断了?)"),
|
|
3150
3139
|
{ status: 0, ...t, seconds: l(), detail: "连接被中途掐断(可能还是网关超时,只是这次连上了)" }
|
|
3151
3140
|
));
|
|
3152
|
-
return
|
|
3141
|
+
return dt;
|
|
3153
3142
|
}
|
|
3154
|
-
const
|
|
3143
|
+
const An = () => it(async () => {
|
|
3155
3144
|
const i = S.value ?? await nn();
|
|
3156
|
-
S.value = i, M.value || (M.value = i), St.value = !0, g.value = "", rt.value = [], ct.value = [], Ie(),
|
|
3145
|
+
S.value = i, M.value || (M.value = i), St.value = !0, g.value = "", rt.value = [], ct.value = [], Ie(), Y.value = { active: !0, percent: 0, stage: "扫描本地目录…", failed: !1 };
|
|
3157
3146
|
const t = performance.now();
|
|
3158
3147
|
let l = 0, m = 0;
|
|
3159
3148
|
try {
|
|
3160
|
-
const T = await
|
|
3149
|
+
const T = await Ke().catch((U) => {
|
|
3161
3150
|
throw new Error(`取不到扫描规则(GET /magic-blocks/rules):${qt(U)}`);
|
|
3162
3151
|
});
|
|
3163
3152
|
st(2, `扫描本地目录(${i.name})…`);
|
|
3164
|
-
const q = await
|
|
3153
|
+
const q = await Ea(i, T, (U) => {
|
|
3165
3154
|
st(2 + Math.min(6, U / 40), `读本地文件:已经读了 ${U} 个…`);
|
|
3166
3155
|
});
|
|
3167
|
-
l = q.folders.length, m = q.folders.reduce((U,
|
|
3168
|
-
const tt = await
|
|
3169
|
-
|
|
3156
|
+
l = q.folders.length, m = q.folders.reduce((U, dt) => U + Object.keys(dt.files).length, 0), st(10, `递给后端:${l} 个文件夹 / ${m} 个文件,等它逐块校验…`);
|
|
3157
|
+
const tt = await dl(q, { folders: l, files: m, startedAt: t });
|
|
3158
|
+
ul(tt), Ct(!0, "读回完成");
|
|
3170
3159
|
} catch (T) {
|
|
3171
|
-
throw
|
|
3160
|
+
throw Ct(!1, "读回失败"), T instanceof TypeError ? new Error(en(T, {
|
|
3172
3161
|
status: 0,
|
|
3173
3162
|
folders: l,
|
|
3174
3163
|
files: m,
|
|
@@ -3178,8 +3167,8 @@ ${t.text}`).join(`
|
|
|
3178
3167
|
} finally {
|
|
3179
3168
|
St.value = !1;
|
|
3180
3169
|
}
|
|
3181
|
-
}, P, "读回"),
|
|
3182
|
-
const i = It.value, t =
|
|
3170
|
+
}, P, "读回"), pl = () => it(async () => {
|
|
3171
|
+
const i = It.value, t = bo(i);
|
|
3183
3172
|
if (rt.value = t.issues, ct.value = [], t.issues.length > 0)
|
|
3184
3173
|
throw g.value = "", new Error(`前端校验没过(${t.issues.length} 条),没有发请求:
|
|
3185
3174
|
- ${t.issues.join(`
|
|
@@ -3189,35 +3178,35 @@ ${t.text}`).join(`
|
|
|
3189
3178
|
const l = await zt("/magic-blocks/import", { updatedBy: "", blocks: i });
|
|
3190
3179
|
ct.value = l.results ?? [], g.value = `保存:成功 ${l.saved} 个、失败 ${l.failed} 个`, await Ft();
|
|
3191
3180
|
const m = g.value;
|
|
3192
|
-
await
|
|
3181
|
+
await An(), g.value = `${m};已重新读回该目录`;
|
|
3193
3182
|
} finally {
|
|
3194
3183
|
B.value = !1;
|
|
3195
3184
|
}
|
|
3196
3185
|
}, P);
|
|
3197
|
-
function
|
|
3186
|
+
function bl(i, t) {
|
|
3198
3187
|
const l = t.target;
|
|
3199
|
-
|
|
3188
|
+
_t.value[i] = l?.checked === !0;
|
|
3200
3189
|
}
|
|
3201
|
-
function
|
|
3202
|
-
const t = { ...
|
|
3190
|
+
function Mn(i) {
|
|
3191
|
+
const t = { ..._t.value };
|
|
3203
3192
|
for (const l of he.value) t[l.id] = i;
|
|
3204
|
-
|
|
3193
|
+
_t.value = t;
|
|
3205
3194
|
}
|
|
3206
|
-
function
|
|
3195
|
+
function On(i) {
|
|
3207
3196
|
const t = i.detail?.uuid ?? "";
|
|
3208
3197
|
b.value = !0, _.value = t;
|
|
3209
3198
|
}
|
|
3210
|
-
function
|
|
3199
|
+
function jn(i) {
|
|
3211
3200
|
i.key === "Escape" && b.value && (b.value = !1);
|
|
3212
3201
|
}
|
|
3213
3202
|
return fn(() => {
|
|
3214
|
-
window.addEventListener("magic-block:open-console",
|
|
3203
|
+
window.addEventListener("magic-block:open-console", On), window.addEventListener("keydown", jn), Ft(), Ke().catch(() => {
|
|
3215
3204
|
});
|
|
3216
3205
|
}), hn(() => {
|
|
3217
|
-
window.removeEventListener("magic-block:open-console",
|
|
3206
|
+
window.removeEventListener("magic-block:open-console", On), window.removeEventListener("keydown", jn);
|
|
3218
3207
|
}), (i, t) => G(o) ? (d(), p("div", {
|
|
3219
3208
|
key: 0,
|
|
3220
|
-
class: Z(["mbc__shell", { "is-wide":
|
|
3209
|
+
class: Z(["mbc__shell", { "is-wide": E.value }])
|
|
3221
3210
|
}, [
|
|
3222
3211
|
a("button", {
|
|
3223
3212
|
class: "fab",
|
|
@@ -3227,28 +3216,28 @@ ${t.text}`).join(`
|
|
|
3227
3216
|
}, "块"),
|
|
3228
3217
|
b.value ? (d(), p("aside", {
|
|
3229
3218
|
key: 0,
|
|
3230
|
-
class: Z(["mbc", { "is-wide":
|
|
3219
|
+
class: Z(["mbc", { "is-wide": E.value }])
|
|
3231
3220
|
}, [
|
|
3232
|
-
a("header",
|
|
3221
|
+
a("header", Ba, [
|
|
3233
3222
|
t[45] || (t[45] = a("strong", { class: "mbc__brand" }, "magic block", -1)),
|
|
3234
3223
|
a("span", {
|
|
3235
3224
|
class: "mbc__count",
|
|
3236
3225
|
title: `库里一共 ${v.value.length} 个块`
|
|
3237
|
-
}, f(v.value.length) + " 个块", 9,
|
|
3226
|
+
}, f(v.value.length) + " 个块", 9, Ta),
|
|
3238
3227
|
t[46] || (t[46] = a("span", { class: "mbc__grow" }, null, -1)),
|
|
3239
3228
|
a("button", {
|
|
3240
3229
|
class: "p-button p-button-sm p-button-text",
|
|
3241
3230
|
type: "button",
|
|
3242
|
-
title:
|
|
3243
|
-
onClick: t[1] || (t[1] = (l) =>
|
|
3244
|
-
}, f(
|
|
3231
|
+
title: E.value ? "收起(回到右侧那条窄抽屉)" : "展开:整屏(块 / 工作区两个页签)",
|
|
3232
|
+
onClick: t[1] || (t[1] = (l) => E.value = !E.value)
|
|
3233
|
+
}, f(E.value ? "收起" : "展开全屏"), 9, Aa),
|
|
3245
3234
|
a("button", {
|
|
3246
3235
|
class: "p-button p-button-sm p-button-text",
|
|
3247
3236
|
type: "button",
|
|
3248
3237
|
onClick: t[2] || (t[2] = (l) => b.value = !1)
|
|
3249
3238
|
}, "关闭")
|
|
3250
3239
|
]),
|
|
3251
|
-
a("div",
|
|
3240
|
+
a("div", Ma, [
|
|
3252
3241
|
a("button", {
|
|
3253
3242
|
class: Z(["mbc__tab", { "is-on": R.value === "blocks" }]),
|
|
3254
3243
|
type: "button",
|
|
@@ -3257,13 +3246,13 @@ ${t.text}`).join(`
|
|
|
3257
3246
|
onClick: t[3] || (t[3] = (l) => R.value = "blocks")
|
|
3258
3247
|
}, [
|
|
3259
3248
|
t[47] || (t[47] = x(" 块 ", -1)),
|
|
3260
|
-
a("span",
|
|
3261
|
-
|
|
3249
|
+
a("span", ja, f(v.value.length), 1),
|
|
3250
|
+
Fe.value > 0 ? (d(), p("span", {
|
|
3262
3251
|
key: 0,
|
|
3263
3252
|
class: "mbc__chip is-bad",
|
|
3264
|
-
title: `${
|
|
3265
|
-
}, f(
|
|
3266
|
-
], 10,
|
|
3253
|
+
title: `${Fe.value} 个块被停用(体检没过)`
|
|
3254
|
+
}, f(Fe.value) + " 停用", 9, Da)) : C("", !0)
|
|
3255
|
+
], 10, Oa),
|
|
3267
3256
|
a("button", {
|
|
3268
3257
|
class: Z(["mbc__tab", { "is-on": R.value === "workspace" }]),
|
|
3269
3258
|
type: "button",
|
|
@@ -3272,40 +3261,40 @@ ${t.text}`).join(`
|
|
|
3272
3261
|
onClick: t[4] || (t[4] = (l) => R.value = "workspace")
|
|
3273
3262
|
}, [
|
|
3274
3263
|
t[48] || (t[48] = x(" 工作区(导出 / 读回 / 校验) ", -1)),
|
|
3275
|
-
|
|
3264
|
+
yt.value > 0 ? (d(), p("span", {
|
|
3276
3265
|
key: 0,
|
|
3277
3266
|
class: "mbc__chip is-bad",
|
|
3278
|
-
title: `这一趟有 ${
|
|
3279
|
-
}, f(
|
|
3280
|
-
], 10,
|
|
3267
|
+
title: `这一趟有 ${yt.value} 条问题`
|
|
3268
|
+
}, f(yt.value), 9, La)) : ct.value.length > 0 ? (d(), p("span", Pa, f(ze.value) + " 存成", 1)) : C("", !0)
|
|
3269
|
+
], 10, Ra)
|
|
3281
3270
|
]),
|
|
3282
|
-
a("div",
|
|
3283
|
-
|
|
3271
|
+
a("div", Ia, [
|
|
3272
|
+
Y.value.active ? (d(), p("div", Na, [
|
|
3284
3273
|
a("div", {
|
|
3285
|
-
class: Z(["mbc__progress", { "is-failed":
|
|
3274
|
+
class: Z(["mbc__progress", { "is-failed": Y.value.failed }]),
|
|
3286
3275
|
role: "progressbar",
|
|
3287
|
-
"aria-valuenow":
|
|
3276
|
+
"aria-valuenow": Y.value.percent,
|
|
3288
3277
|
"aria-valuemin": "0",
|
|
3289
3278
|
"aria-valuemax": "100"
|
|
3290
3279
|
}, [
|
|
3291
3280
|
a("div", {
|
|
3292
3281
|
class: "mbc__progress-bar",
|
|
3293
|
-
style: vn(
|
|
3282
|
+
style: vn(Ps.value)
|
|
3294
3283
|
}, null, 4)
|
|
3295
|
-
], 10,
|
|
3284
|
+
], 10, qa),
|
|
3296
3285
|
a("p", {
|
|
3297
|
-
class: Z(["mbc__hint", { "mbc__progress-note":
|
|
3298
|
-
}, f(
|
|
3299
|
-
])) :
|
|
3300
|
-
J.value ? (d(), p("div",
|
|
3301
|
-
a("p",
|
|
3302
|
-
J.value.framework ? (d(), p("p",
|
|
3286
|
+
class: Z(["mbc__hint", { "mbc__progress-note": Y.value.failed }])
|
|
3287
|
+
}, f(Y.value.failed ? "✗" : "") + " " + f(Y.value.percent) + "% · " + f(Y.value.stage), 3)
|
|
3288
|
+
])) : C("", !0),
|
|
3289
|
+
J.value ? (d(), p("div", za, [
|
|
3290
|
+
a("p", Fa, "「" + f(J.value.target.name) + "」里现在有 " + f(J.value.inventory.dirs) + " 个文件夹 / " + f(J.value.inventory.files) + " 个文件", 1),
|
|
3291
|
+
J.value.framework ? (d(), p("p", Ua, [
|
|
3303
3292
|
t[50] || (t[50] = a("b", null, "这一趟只铺框架文件", -1)),
|
|
3304
3293
|
t[51] || (t[51] = x("(顶层那几份生成物", -1)),
|
|
3305
3294
|
J.value.exampleDir ? (d(), p(A, { key: 0 }, [
|
|
3306
3295
|
t[49] || (t[49] = x(" + ", -1)),
|
|
3307
|
-
a("span",
|
|
3308
|
-
], 64)) :
|
|
3296
|
+
a("span", Ha, f(J.value.exampleDir) + "/", 1)
|
|
3297
|
+
], 64)) : C("", !0),
|
|
3309
3298
|
t[52] || (t[52] = x(")。 🔴 ", -1)),
|
|
3310
3299
|
t[53] || (t[53] = a("span", { class: "mbc__mono" }, "workspace/", -1)),
|
|
3311
3300
|
t[54] || (t[54] = x(" 里的块代码", -1)),
|
|
@@ -3313,8 +3302,8 @@ ${t.text}`).join(`
|
|
|
3313
3302
|
t[56] || (t[56] = x(': 连「清空并导出」都不进那一层(判据是"那一层整棵放行"),所以你改过、还没读回库的块代码不会被碰。 两种都只动这个目录', -1)),
|
|
3314
3303
|
t[57] || (t[57] = a("b", null, "里面", -1)),
|
|
3315
3304
|
t[58] || (t[58] = x("的子项:目录本身、以及它外面的任何东西都不会被碰。", -1)),
|
|
3316
|
-
J.value.inventory.items.length > 0 ? (d(), p("span",
|
|
3317
|
-
])) : (d(), p("p",
|
|
3305
|
+
J.value.inventory.items.length > 0 ? (d(), p("span", Wa, "(" + f(J.value.inventory.items.slice(0, 6).map((l) => l.name).join(" / ")) + f(J.value.inventory.items.length > 6 ? " …" : "") + ")", 1)) : C("", !0)
|
|
3306
|
+
])) : (d(), p("p", Ka, [
|
|
3318
3307
|
t[59] || (t[59] = a("b", null, "只覆盖", -1)),
|
|
3319
3308
|
t[60] || (t[60] = x("(天天用这个):只把库里", -1)),
|
|
3320
3309
|
t[61] || (t[61] = a("b", null, "改过 / 缺了", -1)),
|
|
@@ -3322,139 +3311,143 @@ ${t.text}`).join(`
|
|
|
3322
3311
|
t[63] || (t[63] = a("b", null, "会留着", -1)),
|
|
3323
3312
|
t[64] || (t[64] = x(")。 ", -1)),
|
|
3324
3313
|
t[65] || (t[65] = a("b", null, "清空并导出", -1)),
|
|
3325
|
-
t[66] || (t[66] = x(":先删掉这一包没有的东西,其余同上。
|
|
3326
|
-
|
|
3327
|
-
t[
|
|
3328
|
-
|
|
3314
|
+
t[66] || (t[66] = x(":先删掉这一包没有的东西,其余同上。 ", -1)),
|
|
3315
|
+
a("b", null, f((ut.value?.scratchDirs ?? []).join(" / ") || ".exclude") + "/", 1),
|
|
3316
|
+
t[67] || (t[67] = x("(你自己的地盘:测试 / 截图 / 日志)两种都", -1)),
|
|
3317
|
+
t[68] || (t[68] = a("b", null, "整棵不碰", -1)),
|
|
3318
|
+
t[69] || (t[69] = x("。 两种都只动这个目录", -1)),
|
|
3319
|
+
t[70] || (t[70] = a("b", null, "里面", -1)),
|
|
3320
|
+
t[71] || (t[71] = x("的子项:目录本身、以及它外面的任何东西都不会被碰。", -1)),
|
|
3321
|
+
J.value.inventory.items.length > 0 ? (d(), p("span", Va, "(" + f(J.value.inventory.items.slice(0, 6).map((l) => l.name).join(" / ")) + f(J.value.inventory.items.length > 6 ? " …" : "") + ")", 1)) : C("", !0)
|
|
3329
3322
|
])),
|
|
3330
|
-
a("label",
|
|
3331
|
-
|
|
3332
|
-
"onUpdate:modelValue": t[5] || (t[5] = (l) =>
|
|
3323
|
+
a("label", Ga, [
|
|
3324
|
+
mt(a("input", {
|
|
3325
|
+
"onUpdate:modelValue": t[5] || (t[5] = (l) => me.value = l),
|
|
3333
3326
|
type: "checkbox"
|
|
3334
3327
|
}, null, 512), [
|
|
3335
|
-
[
|
|
3328
|
+
[rs, me.value]
|
|
3336
3329
|
]),
|
|
3337
3330
|
a("span", null, [
|
|
3338
|
-
t[
|
|
3339
|
-
t[
|
|
3331
|
+
t[75] || (t[75] = x("逐个核对磁盘(慢):把上一趟铺过的也重新读一遍比对,", -1)),
|
|
3332
|
+
t[76] || (t[76] = a("b", null, "你在编辑器里改过、还没读回库的那些会被库里的那份盖掉", -1)),
|
|
3340
3333
|
J.value.framework ? (d(), p(A, { key: 0 }, [
|
|
3341
|
-
t[
|
|
3342
|
-
t[
|
|
3343
|
-
t[
|
|
3344
|
-
], 64)) :
|
|
3334
|
+
t[72] || (t[72] = x("(这一档只铺框架文件:", -1)),
|
|
3335
|
+
t[73] || (t[73] = a("span", { class: "mbc__mono" }, "workspace/", -1)),
|
|
3336
|
+
t[74] || (t[74] = x(" 里的块代码怎么勾都不会被碰)", -1))
|
|
3337
|
+
], 64)) : C("", !0)
|
|
3345
3338
|
])
|
|
3346
3339
|
]),
|
|
3347
|
-
a("div",
|
|
3340
|
+
a("div", Ja, [
|
|
3348
3341
|
a("button", {
|
|
3349
3342
|
class: "p-button p-button-sm",
|
|
3350
3343
|
type: "button",
|
|
3351
3344
|
disabled: P.value,
|
|
3352
|
-
onClick: t[6] || (t[6] = (l) =>
|
|
3353
|
-
}, "清空并导出", 8,
|
|
3345
|
+
onClick: t[6] || (t[6] = (l) => il())
|
|
3346
|
+
}, "清空并导出", 8, Ya),
|
|
3354
3347
|
a("button", {
|
|
3355
3348
|
class: "p-button p-button-sm p-button-outlined",
|
|
3356
3349
|
type: "button",
|
|
3357
3350
|
disabled: P.value,
|
|
3358
|
-
onClick: t[7] || (t[7] = (l) =>
|
|
3359
|
-
}, "只覆盖", 8,
|
|
3351
|
+
onClick: t[7] || (t[7] = (l) => rl())
|
|
3352
|
+
}, "只覆盖", 8, Xa),
|
|
3360
3353
|
a("button", {
|
|
3361
3354
|
class: "p-button p-button-sm p-button-text",
|
|
3362
3355
|
type: "button",
|
|
3363
3356
|
disabled: P.value,
|
|
3364
|
-
onClick: t[8] || (t[8] = (l) =>
|
|
3365
|
-
}, "取消", 8,
|
|
3357
|
+
onClick: t[8] || (t[8] = (l) => cl())
|
|
3358
|
+
}, "取消", 8, Za)
|
|
3366
3359
|
])
|
|
3367
|
-
])) :
|
|
3368
|
-
Q.value ? (d(), p("div",
|
|
3369
|
-
a("p",
|
|
3370
|
-
a("p",
|
|
3371
|
-
t[
|
|
3372
|
-
t[
|
|
3360
|
+
])) : C("", !0),
|
|
3361
|
+
Q.value ? (d(), p("div", Qa, [
|
|
3362
|
+
a("p", ti, "删掉「" + f(Q.value.row.module) + " / " + f(Q.value.row.name || Q.value.row.id) + "」的代码文件", 1),
|
|
3363
|
+
a("p", ei, [
|
|
3364
|
+
t[85] || (t[85] = a("b", null, "库里那一份代码正文会被清空", -1)),
|
|
3365
|
+
t[86] || (t[86] = x("(入口 / 清单 / 后端一起); ", -1)),
|
|
3373
3366
|
Q.value.target ? (d(), p(A, { key: 0 }, [
|
|
3374
|
-
t[
|
|
3375
|
-
a("span",
|
|
3367
|
+
t[77] || (t[77] = x(" 同时清掉你本机那个块文件夹 ", -1)),
|
|
3368
|
+
a("span", ni, f(Q.value.target.name) + "/" + f(Q.value.folder), 1),
|
|
3376
3369
|
Q.value.inventory && Q.value.inventory.items.some((l) => l.name === Q.value?.folder) ? (d(), p(A, { key: 0 }, [
|
|
3377
3370
|
x(" (它现在在顶层,里面有东西:本次会先清空)。 ")
|
|
3378
|
-
], 64)) :
|
|
3379
|
-
t[
|
|
3380
|
-
t[
|
|
3381
|
-
t[
|
|
3382
|
-
t[
|
|
3371
|
+
], 64)) : C("", !0),
|
|
3372
|
+
t[78] || (t[78] = a("b", null, "只动这一个块的文件夹", -1)),
|
|
3373
|
+
t[79] || (t[79] = x(":别的块、", -1)),
|
|
3374
|
+
t[80] || (t[80] = a("span", { class: "mbc__mono" }, "example/", -1)),
|
|
3375
|
+
t[81] || (t[81] = x("、以及目录外面的一切都不会被碰。 ", -1))
|
|
3383
3376
|
], 64)) : (d(), p(A, { key: 1 }, [
|
|
3384
|
-
t[
|
|
3385
|
-
t[
|
|
3386
|
-
t[
|
|
3377
|
+
t[82] || (t[82] = x(" 现在没有选中开发目录 / 或者读不到它,所以", -1)),
|
|
3378
|
+
t[83] || (t[83] = a("b", null, "本机那份不动", -1)),
|
|
3379
|
+
t[84] || (t[84] = x(",只清库里那份。 ", -1))
|
|
3387
3380
|
], 64)),
|
|
3388
|
-
t[
|
|
3389
|
-
t[
|
|
3390
|
-
t[
|
|
3391
|
-
t[
|
|
3381
|
+
t[87] || (t[87] = a("br", null, null, -1)),
|
|
3382
|
+
t[88] || (t[88] = x(" 🔴 ", -1)),
|
|
3383
|
+
t[89] || (t[89] = a("b", null, "块本身留着", -1)),
|
|
3384
|
+
t[90] || (t[90] = x('(这一行不动):页面上那块会显示成占位框,而不是"库里没有这个块"; 删错了也能救回来:展开这一块 → 版本史 → 「切回」删之前那一版。 ', -1))
|
|
3392
3385
|
]),
|
|
3393
|
-
a("div",
|
|
3386
|
+
a("div", si, [
|
|
3394
3387
|
a("button", {
|
|
3395
3388
|
class: "p-button p-button-sm",
|
|
3396
3389
|
type: "button",
|
|
3397
3390
|
disabled: P.value,
|
|
3398
3391
|
onClick: t[9] || (t[9] = (l) => De())
|
|
3399
|
-
}, "确认删除代码文件", 8,
|
|
3392
|
+
}, "确认删除代码文件", 8, li),
|
|
3400
3393
|
a("button", {
|
|
3401
3394
|
class: "p-button p-button-sm p-button-text",
|
|
3402
3395
|
type: "button",
|
|
3403
3396
|
disabled: P.value,
|
|
3404
3397
|
onClick: t[10] || (t[10] = (l) => Q.value = null)
|
|
3405
|
-
}, "取消", 8,
|
|
3398
|
+
}, "取消", 8, oi)
|
|
3406
3399
|
])
|
|
3407
|
-
])) :
|
|
3408
|
-
|
|
3409
|
-
a("h3",
|
|
3410
|
-
t[
|
|
3411
|
-
a("span",
|
|
3412
|
-
L.value.trim() ? (d(), p("span",
|
|
3400
|
+
])) : C("", !0),
|
|
3401
|
+
mt(a("section", ai, [
|
|
3402
|
+
a("h3", ii, [
|
|
3403
|
+
t[91] || (t[91] = x(" 库里的块 ", -1)),
|
|
3404
|
+
a("span", ri, f(Cn.value.length) + " / " + f(v.value.length), 1),
|
|
3405
|
+
L.value.trim() ? (d(), p("span", ci, "标签:" + f(L.value), 1)) : C("", !0)
|
|
3413
3406
|
]),
|
|
3414
|
-
|
|
3407
|
+
mt(a("input", {
|
|
3415
3408
|
"onUpdate:modelValue": t[11] || (t[11] = (l) => h.value = l),
|
|
3416
3409
|
class: "p-inputtext p-component mbc__search",
|
|
3417
3410
|
type: "search",
|
|
3418
3411
|
placeholder: "筛选 module / 名字 / 备注 / 详情 / id / 版本号 / 标签"
|
|
3419
3412
|
}, null, 512), [
|
|
3420
|
-
[
|
|
3413
|
+
[ae, h.value]
|
|
3421
3414
|
]),
|
|
3422
|
-
$.value.length > 0 ? (d(), p("div",
|
|
3423
|
-
t[
|
|
3424
|
-
|
|
3415
|
+
$.value.length > 0 ? (d(), p("div", ui, [
|
|
3416
|
+
t[92] || (t[92] = a("span", { class: "mbc__label" }, "标签", -1)),
|
|
3417
|
+
mt(a("input", {
|
|
3425
3418
|
"onUpdate:modelValue": t[12] || (t[12] = (l) => L.value = l),
|
|
3426
3419
|
class: "p-inputtext p-component mbc__tagfilter",
|
|
3427
3420
|
type: "search",
|
|
3428
3421
|
placeholder: "只看贴了…的块"
|
|
3429
3422
|
}, null, 512), [
|
|
3430
|
-
[
|
|
3423
|
+
[ae, L.value]
|
|
3431
3424
|
]),
|
|
3432
|
-
(d(!0), p(A, null,
|
|
3425
|
+
(d(!0), p(A, null, F($.value.slice(0, 24), (l) => (d(), p("button", {
|
|
3433
3426
|
key: l.tag,
|
|
3434
3427
|
class: Z(["p-tag mbc__tag", { "is-on": L.value.trim().toLowerCase() === l.tag.toLowerCase() }]),
|
|
3435
3428
|
type: "button",
|
|
3436
3429
|
title: `只看贴了「${l.tag}」的块(${l.count} 个)`,
|
|
3437
3430
|
onClick: (m) => L.value = L.value.trim().toLowerCase() === l.tag.toLowerCase() ? "" : l.tag
|
|
3438
|
-
}, f(l.tag) + " " + f(l.count), 11,
|
|
3431
|
+
}, f(l.tag) + " " + f(l.count), 11, di))), 128)),
|
|
3439
3432
|
L.value ? (d(), p("button", {
|
|
3440
3433
|
key: 0,
|
|
3441
3434
|
class: "p-button p-button-sm p-button-text",
|
|
3442
3435
|
type: "button",
|
|
3443
3436
|
onClick: t[13] || (t[13] = (l) => L.value = "")
|
|
3444
|
-
}, "清掉标签筛选")) :
|
|
3445
|
-
])) :
|
|
3446
|
-
a("ul",
|
|
3447
|
-
(d(!0), p(A, null,
|
|
3437
|
+
}, "清掉标签筛选")) : C("", !0)
|
|
3438
|
+
])) : C("", !0),
|
|
3439
|
+
a("ul", pi, [
|
|
3440
|
+
(d(!0), p(A, null, F(Cn.value, (l) => (d(), p("li", {
|
|
3448
3441
|
key: l.id
|
|
3449
3442
|
}, [
|
|
3450
3443
|
a("button", {
|
|
3451
3444
|
type: "button",
|
|
3452
3445
|
class: Z(["mbc__row", { "is-active": l.id === _.value, "is-off": l.enabled === !1 }]),
|
|
3453
|
-
title:
|
|
3454
|
-
onClick: (m) =>
|
|
3446
|
+
title: Ys(l),
|
|
3447
|
+
onClick: (m) => Is(l)
|
|
3455
3448
|
}, [
|
|
3456
|
-
a("span",
|
|
3457
|
-
a("span",
|
|
3449
|
+
a("span", mi, f(l.module || "unassigned"), 1),
|
|
3450
|
+
a("span", fi, f(l.name || l.id), 1),
|
|
3458
3451
|
a("span", {
|
|
3459
3452
|
class: "mbc__version-badge",
|
|
3460
3453
|
title: `当前是第 ${l.version || 1} 版,一共留着 ${l.versionCount ?? 1} 版`
|
|
@@ -3462,60 +3455,55 @@ ${t.text}`).join(`
|
|
|
3462
3455
|
x("v" + f(l.version || 1), 1),
|
|
3463
3456
|
(l.versionCount ?? 1) > 1 ? (d(), p(A, { key: 0 }, [
|
|
3464
3457
|
x("/" + f(l.versionCount), 1)
|
|
3465
|
-
], 64)) :
|
|
3466
|
-
], 8,
|
|
3467
|
-
(d(!0), p(A, null,
|
|
3458
|
+
], 64)) : C("", !0)
|
|
3459
|
+
], 8, hi),
|
|
3460
|
+
(d(!0), p(A, null, F(l.tags ?? [], (m) => (d(), p("span", {
|
|
3468
3461
|
key: m,
|
|
3469
3462
|
class: "p-tag mbc__tag mbc__tag--on-row"
|
|
3470
3463
|
}, f(m), 1))), 128)),
|
|
3471
3464
|
Sn(l) ? (d(), p("span", {
|
|
3472
3465
|
key: 0,
|
|
3473
3466
|
class: "mbc__loc",
|
|
3474
|
-
title:
|
|
3475
|
-
}, f(Sn(l)), 9,
|
|
3476
|
-
|
|
3477
|
-
key: 1,
|
|
3478
|
-
class: "mbc__loc mbc__loc--inert",
|
|
3479
|
-
title: Cn(l)
|
|
3480
|
-
}, f(En(l)), 9, ki)) : E("", !0),
|
|
3481
|
-
me(l).length > 0 ? (d(), p("span", $i, f(me(l).join(" / ")), 1)) : E("", !0),
|
|
3467
|
+
title: Js(l)
|
|
3468
|
+
}, f(Sn(l)), 9, vi)) : C("", !0),
|
|
3469
|
+
fe(l).length > 0 ? (d(), p("span", gi, f(fe(l).join(" / ")), 1)) : C("", !0),
|
|
3482
3470
|
a("em", {
|
|
3483
3471
|
class: Z({ "is-off": l.enabled === !1 })
|
|
3484
3472
|
}, f(l.enabled === !1 ? xn(l) || "校验失败已停用" : "可用"), 3),
|
|
3485
3473
|
(l.detail ?? "").trim() ? (d(), p("span", {
|
|
3486
|
-
key:
|
|
3474
|
+
key: 2,
|
|
3487
3475
|
class: "mbc__detail-line",
|
|
3488
|
-
title: G(
|
|
3489
|
-
}, f(G(
|
|
3490
|
-
], 10,
|
|
3491
|
-
_.value === l.id ? (d(), p("div",
|
|
3492
|
-
(d(!0), p(A, null,
|
|
3476
|
+
title: G(os)(l.detail ?? "", 240)
|
|
3477
|
+
}, f(G(os)(l.detail ?? "")), 9, _i)) : C("", !0)
|
|
3478
|
+
], 10, bi),
|
|
3479
|
+
_.value === l.id ? (d(), p("div", yi, [
|
|
3480
|
+
(d(!0), p(A, null, F(Ne(l).slice(0, ln), (m, T) => (d(), p("p", {
|
|
3493
3481
|
key: T,
|
|
3494
3482
|
class: "mbc__problem"
|
|
3495
3483
|
}, f(m), 1))), 128)),
|
|
3496
|
-
Ne(l).length > ln ? (d(), p("p",
|
|
3497
|
-
a("dl",
|
|
3498
|
-
t[
|
|
3484
|
+
Ne(l).length > ln ? (d(), p("p", ki, "还有 " + f(Ne(l).length - ln) + " 条问题没显示出来:点上面的「校验全部魔法块」重算一遍(这几条是上次校验的结论)", 1)) : C("", !0),
|
|
3485
|
+
a("dl", $i, [
|
|
3486
|
+
t[103] || (t[103] = a("dt", null, "详情", -1)),
|
|
3499
3487
|
a("dd", null, [
|
|
3500
3488
|
et.value !== l.id ? (d(), p(A, { key: 0 }, [
|
|
3501
3489
|
(l.detail ?? "").trim() ? (d(), p("div", {
|
|
3502
3490
|
key: 0,
|
|
3503
3491
|
class: "mbc__blockdetail",
|
|
3504
|
-
innerHTML: G(
|
|
3505
|
-
}, null, 8,
|
|
3506
|
-
t[
|
|
3507
|
-
a("span",
|
|
3508
|
-
t[
|
|
3492
|
+
innerHTML: G(ca)(l.detail ?? "")
|
|
3493
|
+
}, null, 8, xi)) : (d(), p("span", wi, [
|
|
3494
|
+
t[93] || (t[93] = x("(这一块没写详情 —— 点右边「写详情」写一段**业务功能说明**:谁能用、什么场景、解决什么、输入输出是什么业务含义;用 Markdown 写,**别写路由 / 字段 / 实现方式**。这段正文住在块包内的 ", -1)),
|
|
3495
|
+
a("span", Si, f(G(Wn)), 1),
|
|
3496
|
+
t[94] || (t[94] = x(",导出后会跟着包走)", -1))
|
|
3509
3497
|
])),
|
|
3510
3498
|
a("button", {
|
|
3511
3499
|
class: "p-button p-button-sm p-button-text",
|
|
3512
3500
|
type: "button",
|
|
3513
3501
|
disabled: P.value,
|
|
3514
|
-
onClick: (m) =>
|
|
3515
|
-
}, f((l.detail ?? "").trim() ? "改详情" : "写详情"), 9,
|
|
3502
|
+
onClick: (m) => Ws(l)
|
|
3503
|
+
}, f((l.detail ?? "").trim() ? "改详情" : "写详情"), 9, Ci)
|
|
3516
3504
|
], 64)) : (d(), p(A, { key: 1 }, [
|
|
3517
|
-
|
|
3518
|
-
"onUpdate:modelValue": t[14] || (t[14] = (m) =>
|
|
3505
|
+
mt(a("textarea", {
|
|
3506
|
+
"onUpdate:modelValue": t[14] || (t[14] = (m) => vt.value = m),
|
|
3519
3507
|
class: "p-inputtext p-component mbc__detailinput",
|
|
3520
3508
|
rows: "6",
|
|
3521
3509
|
placeholder: `业务功能说明,用 Markdown 写 —— 例如:
|
|
@@ -3527,220 +3515,204 @@ ${t.text}`).join(`
|
|
|
3527
3515
|
- 怎么用:搜手机号 → 打开档案
|
|
3528
3516
|
(**别写**路由名 / 字段名 / 实现方式)`
|
|
3529
3517
|
}, null, 512), [
|
|
3530
|
-
[
|
|
3518
|
+
[ae, vt.value]
|
|
3531
3519
|
]),
|
|
3532
3520
|
a("button", {
|
|
3533
3521
|
class: "p-button p-button-sm",
|
|
3534
3522
|
type: "button",
|
|
3535
3523
|
disabled: P.value,
|
|
3536
|
-
onClick: (m) =>
|
|
3537
|
-
}, "存详情", 8,
|
|
3524
|
+
onClick: (m) => Hs(l)
|
|
3525
|
+
}, "存详情", 8, Ei),
|
|
3538
3526
|
a("button", {
|
|
3539
3527
|
class: "p-button p-button-sm p-button-text",
|
|
3540
3528
|
type: "button",
|
|
3541
3529
|
disabled: P.value,
|
|
3542
3530
|
onClick: t[15] || (t[15] = (m) => et.value = "")
|
|
3543
|
-
}, "取消", 8,
|
|
3531
|
+
}, "取消", 8, Bi)
|
|
3544
3532
|
], 64))
|
|
3545
3533
|
]),
|
|
3546
|
-
t[
|
|
3534
|
+
t[104] || (t[104] = a("dt", null, "文件", -1)),
|
|
3547
3535
|
a("dd", null, f((l.fileNames || []).join(" / ") || "(没有文件)"), 1),
|
|
3548
|
-
|
|
3549
|
-
t[
|
|
3536
|
+
qe(l) ? (d(), p(A, { key: 0 }, [
|
|
3537
|
+
t[96] || (t[96] = a("dt", null, "代码", -1)),
|
|
3550
3538
|
a("dd", null, [
|
|
3551
3539
|
a("b", null, f(l.code?.total ?? 0), 1),
|
|
3552
|
-
t[
|
|
3553
|
-
a("span",
|
|
3554
|
-
a("ul",
|
|
3555
|
-
(d(!0), p(A, null,
|
|
3540
|
+
t[95] || (t[95] = x(" 行 ", -1)),
|
|
3541
|
+
a("span", Ti, "(" + f(l.code?.files ?? 0) + " 个文件,含注释与空行)", 1),
|
|
3542
|
+
a("ul", Ai, [
|
|
3543
|
+
(d(!0), p(A, null, F(l.code?.byFile ?? [], (m) => (d(), p("li", {
|
|
3556
3544
|
key: m.name
|
|
3557
3545
|
}, [
|
|
3558
|
-
a("span",
|
|
3546
|
+
a("span", Mi, f(m.lines), 1),
|
|
3559
3547
|
x(" 行 · " + f(m.name), 1)
|
|
3560
3548
|
]))), 128))
|
|
3561
3549
|
])
|
|
3562
|
-
])
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
a("dd", null, [
|
|
3566
|
-
a("b", null, f(l.code?.nonEffective ?? 0), 1),
|
|
3567
|
-
t[93] || (t[93] = x(" 行 ", -1)),
|
|
3568
|
-
a("span", Li, "(" + f(l.code?.nonEffectiveFiles?.length ?? 0) + " 个文件 —— `excluded/` 里那些:照样进库、进版本史,但执行时被忽略)", 1),
|
|
3569
|
-
a("ul", Pi, [
|
|
3570
|
-
(d(!0), p(A, null, z(l.code?.nonEffectiveFiles ?? [], (m) => (d(), p("li", {
|
|
3571
|
-
key: m.name
|
|
3572
|
-
}, [
|
|
3573
|
-
a("span", Ii, f(m.lines), 1),
|
|
3574
|
-
x(" 行 · " + f(m.name), 1)
|
|
3575
|
-
]))), 128))
|
|
3576
|
-
])
|
|
3577
|
-
])
|
|
3578
|
-
], 64)) : E("", !0)
|
|
3579
|
-
], 64)) : E("", !0),
|
|
3580
|
-
t[104] || (t[104] = a("dt", null, "依赖", -1)),
|
|
3550
|
+
])
|
|
3551
|
+
], 64)) : C("", !0),
|
|
3552
|
+
t[105] || (t[105] = a("dt", null, "依赖", -1)),
|
|
3581
3553
|
a("dd", null, [
|
|
3582
|
-
|
|
3583
|
-
a("ul",
|
|
3584
|
-
(d(!0), p(A, null,
|
|
3554
|
+
En(l).length ? (d(), p(A, { key: 0 }, [
|
|
3555
|
+
a("ul", Oi, [
|
|
3556
|
+
(d(!0), p(A, null, F(En(l), (m) => (d(), p("li", {
|
|
3585
3557
|
key: m.key
|
|
3586
3558
|
}, [
|
|
3587
|
-
a("span",
|
|
3588
|
-
a("span",
|
|
3589
|
-
(d(!0), p(A, null,
|
|
3559
|
+
a("span", ji, f(m.key), 1),
|
|
3560
|
+
a("span", Di, f(m.title), 1),
|
|
3561
|
+
(d(!0), p(A, null, F(m.values, (T) => (d(), p("span", {
|
|
3590
3562
|
key: T,
|
|
3591
3563
|
class: "mbc__reqitem"
|
|
3592
3564
|
}, f(T), 1))), 128))
|
|
3593
3565
|
]))), 128))
|
|
3594
3566
|
]),
|
|
3595
|
-
(d(!0), p(A, null,
|
|
3567
|
+
(d(!0), p(A, null, F(Qs(l), (m, T) => (d(), p("p", {
|
|
3596
3568
|
key: T,
|
|
3597
3569
|
class: "mbc__problem"
|
|
3598
3570
|
}, f(m.message), 1))), 128)),
|
|
3599
|
-
a("span",
|
|
3600
|
-
t[
|
|
3601
|
-
a("span",
|
|
3602
|
-
t[
|
|
3571
|
+
a("span", Ri, [
|
|
3572
|
+
t[97] || (t[97] = x("(这是块**自己声明**的:换一个项目时,这几样东西得跟着走 —— 要改就改块包里的 ", -1)),
|
|
3573
|
+
a("span", Li, f(G(Kn)), 1),
|
|
3574
|
+
t[98] || (t[98] = x(",导出时会给你一份带建议的草稿)", -1))
|
|
3603
3575
|
])
|
|
3604
|
-
], 64)) : (d(), p("span",
|
|
3605
|
-
t[
|
|
3606
|
-
a("span",
|
|
3607
|
-
t[
|
|
3576
|
+
], 64)) : (d(), p("span", Pi, [
|
|
3577
|
+
t[99] || (t[99] = x("(这一块没声明任何外部依赖 —— 只在包内写页面的块本来就一个字都不用写; 真用到了项目模型 / settings 键 / 跨块跳转,就在 ", -1)),
|
|
3578
|
+
a("span", Ii, f(G(Kn)), 1),
|
|
3579
|
+
t[100] || (t[100] = x(" 里写一份、读回即生效)", -1))
|
|
3608
3580
|
]))
|
|
3609
3581
|
]),
|
|
3610
|
-
t[
|
|
3582
|
+
t[106] || (t[106] = a("dt", null, "版本", -1)),
|
|
3611
3583
|
a("dd", null, [
|
|
3612
3584
|
x("v" + f(l.version || 1), 1),
|
|
3613
|
-
a("span",
|
|
3585
|
+
a("span", Ni, "(一共留着 " + f(l.versionCount ?? O.value[l.id]?.length ?? 1) + " 版)", 1)
|
|
3614
3586
|
]),
|
|
3615
|
-
t[
|
|
3587
|
+
t[107] || (t[107] = a("dt", null, "标签", -1)),
|
|
3616
3588
|
a("dd", null, [
|
|
3617
3589
|
N.value !== l.id ? (d(), p(A, { key: 0 }, [
|
|
3618
|
-
(d(!0), p(A, null,
|
|
3590
|
+
(d(!0), p(A, null, F(l.tags ?? [], (m) => (d(), p("span", {
|
|
3619
3591
|
key: m,
|
|
3620
3592
|
class: "p-tag mbc__tag"
|
|
3621
3593
|
}, f(m), 1))), 128)),
|
|
3622
|
-
(l.tags ?? []).length === 0 ? (d(), p("span",
|
|
3594
|
+
(l.tags ?? []).length === 0 ? (d(), p("span", qi, "(没贴标签)")) : C("", !0),
|
|
3623
3595
|
a("button", {
|
|
3624
3596
|
class: "p-button p-button-sm p-button-text",
|
|
3625
3597
|
type: "button",
|
|
3626
3598
|
disabled: P.value,
|
|
3627
|
-
onClick: (m) =>
|
|
3628
|
-
}, "改标签", 8,
|
|
3599
|
+
onClick: (m) => Us(l)
|
|
3600
|
+
}, "改标签", 8, zi)
|
|
3629
3601
|
], 64)) : (d(), p(A, { key: 1 }, [
|
|
3630
|
-
|
|
3602
|
+
mt(a("input", {
|
|
3631
3603
|
"onUpdate:modelValue": t[16] || (t[16] = (m) => V.value = m),
|
|
3632
3604
|
class: "p-inputtext p-component mbc__taginput",
|
|
3633
3605
|
type: "text",
|
|
3634
3606
|
placeholder: "逗号分隔,例如:订单, 报表",
|
|
3635
|
-
onKeyup:
|
|
3636
|
-
}, null, 40,
|
|
3637
|
-
[
|
|
3607
|
+
onKeyup: yl((m) => wn(l), ["enter"])
|
|
3608
|
+
}, null, 40, Fi), [
|
|
3609
|
+
[ae, V.value]
|
|
3638
3610
|
]),
|
|
3639
3611
|
a("button", {
|
|
3640
3612
|
class: "p-button p-button-sm",
|
|
3641
3613
|
type: "button",
|
|
3642
3614
|
disabled: P.value,
|
|
3643
3615
|
onClick: (m) => wn(l)
|
|
3644
|
-
}, "存标签", 8,
|
|
3616
|
+
}, "存标签", 8, Ui),
|
|
3645
3617
|
a("button", {
|
|
3646
3618
|
class: "p-button p-button-sm p-button-text",
|
|
3647
3619
|
type: "button",
|
|
3648
3620
|
disabled: P.value,
|
|
3649
3621
|
onClick: t[17] || (t[17] = (m) => N.value = "")
|
|
3650
|
-
}, "取消", 8,
|
|
3651
|
-
$.value.length > 0 ? (d(), p("div",
|
|
3652
|
-
t[
|
|
3653
|
-
(d(!0), p(A, null,
|
|
3622
|
+
}, "取消", 8, Hi),
|
|
3623
|
+
$.value.length > 0 ? (d(), p("div", Wi, [
|
|
3624
|
+
t[101] || (t[101] = a("span", { class: "mbc__hint" }, "点现成的加进去:", -1)),
|
|
3625
|
+
(d(!0), p(A, null, F($.value.slice(0, 16), (m) => (d(), p("button", {
|
|
3654
3626
|
key: m.tag,
|
|
3655
3627
|
class: "p-tag mbc__tag",
|
|
3656
3628
|
type: "button",
|
|
3657
3629
|
title: `把「${m.tag}」加进去`,
|
|
3658
|
-
onClick: (T) =>
|
|
3659
|
-
}, f(m.tag), 9,
|
|
3660
|
-
])) :
|
|
3661
|
-
V.value.trim() ? (d(), p("div",
|
|
3662
|
-
t[
|
|
3663
|
-
(d(!0), p(A, null,
|
|
3630
|
+
onClick: (T) => Ks(m.tag)
|
|
3631
|
+
}, f(m.tag), 9, Ki))), 128))
|
|
3632
|
+
])) : C("", !0),
|
|
3633
|
+
V.value.trim() ? (d(), p("div", Vi, [
|
|
3634
|
+
t[102] || (t[102] = a("span", { class: "mbc__hint" }, "这一块会贴:", -1)),
|
|
3635
|
+
(d(!0), p(A, null, F(V.value.split(/[,,\s]+/).filter(Boolean), (m) => (d(), p("button", {
|
|
3664
3636
|
key: m,
|
|
3665
3637
|
class: "p-tag mbc__tag",
|
|
3666
3638
|
type: "button",
|
|
3667
3639
|
title: `从这一块上摘掉「${m}」`,
|
|
3668
|
-
onClick: (T) =>
|
|
3669
|
-
}, f(m) + " ×", 9,
|
|
3670
|
-
])) :
|
|
3640
|
+
onClick: (T) => Vs(m)
|
|
3641
|
+
}, f(m) + " ×", 9, Gi))), 128))
|
|
3642
|
+
])) : C("", !0)
|
|
3671
3643
|
], 64))
|
|
3672
3644
|
]),
|
|
3673
|
-
t[
|
|
3645
|
+
t[108] || (t[108] = a("dt", null, "更新", -1)),
|
|
3674
3646
|
a("dd", null, f(l.updatedAt || "—"), 1),
|
|
3675
|
-
t[
|
|
3676
|
-
a("dd",
|
|
3647
|
+
t[109] || (t[109] = a("dt", null, "id", -1)),
|
|
3648
|
+
a("dd", Ji, f(l.id), 1)
|
|
3677
3649
|
]),
|
|
3678
|
-
a("div",
|
|
3650
|
+
a("div", Yi, [
|
|
3679
3651
|
a("button", {
|
|
3680
3652
|
class: "p-button p-button-sm p-button-outlined",
|
|
3681
3653
|
type: "button",
|
|
3682
3654
|
disabled: P.value,
|
|
3683
3655
|
onClick: (m) => je(l),
|
|
3684
3656
|
title: "删掉这一块的代码文件:本机的文件夹 + 库里那份代码正文(点下去会先问你确认)。块本身留着,页面上会显示成占位框"
|
|
3685
|
-
}, "删除代码文件", 8,
|
|
3657
|
+
}, "删除代码文件", 8, Xi)
|
|
3686
3658
|
]),
|
|
3687
|
-
a("div",
|
|
3688
|
-
a("div",
|
|
3689
|
-
t[
|
|
3659
|
+
a("div", Zi, [
|
|
3660
|
+
a("div", Qi, [
|
|
3661
|
+
t[110] || (t[110] = a("strong", null, "版本(每次上传 +1,旧的都留着)", -1)),
|
|
3690
3662
|
a("button", {
|
|
3691
3663
|
class: "p-button p-button-sm p-button-text",
|
|
3692
3664
|
type: "button",
|
|
3693
3665
|
disabled: P.value,
|
|
3694
3666
|
onClick: (m) => at(l.id)
|
|
3695
|
-
}, f(I.value === l.id ? "读版本中…" : "刷新版本"), 9,
|
|
3667
|
+
}, f(I.value === l.id ? "读版本中…" : "刷新版本"), 9, tr)
|
|
3696
3668
|
]),
|
|
3697
|
-
O.value[l.id] ? O.value[l.id].length > 0 ? (d(), p("ul",
|
|
3698
|
-
(d(!0), p(A, null,
|
|
3669
|
+
O.value[l.id] ? O.value[l.id].length > 0 ? (d(), p("ul", nr, [
|
|
3670
|
+
(d(!0), p(A, null, F(O.value[l.id], (m) => (d(), p("li", {
|
|
3699
3671
|
key: m.number,
|
|
3700
3672
|
class: Z({ "is-current": m.current })
|
|
3701
3673
|
}, [
|
|
3702
|
-
a("span",
|
|
3703
|
-
a("span",
|
|
3704
|
-
x(f(m.fileCount) + " 个文件 · " + f(
|
|
3674
|
+
a("span", sr, f(Jt(m)), 1),
|
|
3675
|
+
a("span", lr, [
|
|
3676
|
+
x(f(m.fileCount) + " 个文件 · " + f(be(m.sizeBytes)), 1),
|
|
3705
3677
|
m.createdBy ? (d(), p(A, { key: 0 }, [
|
|
3706
3678
|
x(" · " + f(m.createdBy), 1)
|
|
3707
|
-
], 64)) :
|
|
3679
|
+
], 64)) : C("", !0),
|
|
3708
3680
|
x(" · " + f(m.createdAt || "—"), 1)
|
|
3709
3681
|
]),
|
|
3710
|
-
a("span",
|
|
3682
|
+
a("span", or, [
|
|
3711
3683
|
a("button", {
|
|
3712
3684
|
class: "p-button p-button-sm p-button-text",
|
|
3713
3685
|
type: "button",
|
|
3714
3686
|
disabled: P.value || m.empty,
|
|
3715
|
-
onClick: (T) =>
|
|
3687
|
+
onClick: (T) => Ns(l, m.number),
|
|
3716
3688
|
title: m.empty ? "这一版是空包(代码被删过),没有正文可看" : "看这一版的正文(只读)"
|
|
3717
|
-
}, "查看", 8,
|
|
3689
|
+
}, "查看", 8, ar),
|
|
3718
3690
|
a("button", {
|
|
3719
3691
|
class: "p-button p-button-sm p-button-text",
|
|
3720
3692
|
type: "button",
|
|
3721
3693
|
disabled: P.value || m.current || m.empty,
|
|
3722
|
-
onClick: (T) =>
|
|
3694
|
+
onClick: (T) => qs(l, m.number),
|
|
3723
3695
|
title: m.current ? "这一版正在跑" : "把这一版变成当前版(会记成一个新版本)"
|
|
3724
|
-
}, "切回", 8,
|
|
3696
|
+
}, "切回", 8, ir),
|
|
3725
3697
|
a("button", {
|
|
3726
3698
|
class: "p-button p-button-sm p-button-text",
|
|
3727
3699
|
type: "button",
|
|
3728
3700
|
disabled: P.value || m.empty,
|
|
3729
|
-
onClick: (T) =>
|
|
3701
|
+
onClick: (T) => Fs(l, m.number),
|
|
3730
3702
|
title: m.empty ? "空包没什么可下的" : "下载这一版(一个 zip)"
|
|
3731
|
-
}, "下载", 8,
|
|
3703
|
+
}, "下载", 8, rr),
|
|
3732
3704
|
a("button", {
|
|
3733
3705
|
class: "p-button p-button-sm p-button-text",
|
|
3734
3706
|
type: "button",
|
|
3735
3707
|
disabled: P.value || m.current,
|
|
3736
|
-
onClick: (T) =>
|
|
3708
|
+
onClick: (T) => zs(l, m.number),
|
|
3737
3709
|
title: m.current ? "当前那一版不许删:先切到别的版本" : "删掉这一版(别的版本不受影响)"
|
|
3738
|
-
}, "删", 8,
|
|
3710
|
+
}, "删", 8, cr)
|
|
3739
3711
|
])
|
|
3740
3712
|
], 2))), 128))
|
|
3741
|
-
])) : (d(), p("p",
|
|
3742
|
-
W.value && W.value.id === l.id ? (d(), p("div",
|
|
3743
|
-
a("div",
|
|
3713
|
+
])) : (d(), p("p", ur, "这个块还没有版本记录(它从没被保存过)。")) : (d(), p("p", er, "正在读版本…(没读到时点「刷新版本」)")),
|
|
3714
|
+
W.value && W.value.id === l.id ? (d(), p("div", dr, [
|
|
3715
|
+
a("div", pr, [
|
|
3744
3716
|
a("strong", null, "看 v" + f(W.value.number) + " 的正文(只读)", 1),
|
|
3745
3717
|
a("button", {
|
|
3746
3718
|
class: "p-button p-button-sm p-button-text",
|
|
@@ -3748,216 +3720,216 @@ ${t.text}`).join(`
|
|
|
3748
3720
|
onClick: t[18] || (t[18] = (m) => W.value = null)
|
|
3749
3721
|
}, "收起")
|
|
3750
3722
|
]),
|
|
3751
|
-
(d(!0), p(A, null,
|
|
3723
|
+
(d(!0), p(A, null, F(W.value.files, (m, T) => (d(), p("details", {
|
|
3752
3724
|
key: T,
|
|
3753
3725
|
class: "mbc__viewer-file"
|
|
3754
3726
|
}, [
|
|
3755
|
-
a("summary",
|
|
3756
|
-
a("pre",
|
|
3727
|
+
a("summary", br, f(T) + "(" + f(be(m.length)) + ")", 1),
|
|
3728
|
+
a("pre", mr, f(m), 1)
|
|
3757
3729
|
]))), 128))
|
|
3758
|
-
])) :
|
|
3730
|
+
])) : C("", !0)
|
|
3759
3731
|
])
|
|
3760
|
-
])) :
|
|
3732
|
+
])) : C("", !0)
|
|
3761
3733
|
]))), 128))
|
|
3762
3734
|
])
|
|
3763
3735
|
], 512), [
|
|
3764
3736
|
[ye, R.value === "blocks"]
|
|
3765
3737
|
]),
|
|
3766
|
-
|
|
3767
|
-
t[
|
|
3768
|
-
a("div",
|
|
3769
|
-
t[
|
|
3738
|
+
mt(a("section", fr, [
|
|
3739
|
+
t[129] || (t[129] = a("h3", { class: "mbc__title" }, "导出去改(用你自己的编辑器)", -1)),
|
|
3740
|
+
a("div", hr, [
|
|
3741
|
+
t[111] || (t[111] = a("span", { class: "mbc__label" }, "体检", -1)),
|
|
3770
3742
|
a("button", {
|
|
3771
3743
|
class: "p-button p-button-sm",
|
|
3772
3744
|
type: "button",
|
|
3773
3745
|
disabled: P.value,
|
|
3774
|
-
onClick: t[19] || (t[19] = (l) =>
|
|
3775
|
-
}, f(Pt.value ? "校验中…" : "校验全部魔法块"), 9,
|
|
3776
|
-
t[
|
|
3746
|
+
onClick: t[19] || (t[19] = (l) => ll())
|
|
3747
|
+
}, f(Pt.value ? "校验中…" : "校验全部魔法块"), 9, vr),
|
|
3748
|
+
t[112] || (t[112] = a("span", { class: "mbc__hint" }, "重新跑一遍逐块判据(试加载 + 引用深检),过不了的整块停用;改好再点一次就恢复。", -1))
|
|
3777
3749
|
]),
|
|
3778
|
-
nt.value ? (d(), p("div",
|
|
3779
|
-
t[
|
|
3780
|
-
a("span",
|
|
3781
|
-
t[
|
|
3750
|
+
nt.value ? (d(), p("div", gr, [
|
|
3751
|
+
t[117] || (t[117] = a("span", { class: "mbc__label" }, "上一趟体检", -1)),
|
|
3752
|
+
a("span", _r, [
|
|
3753
|
+
t[113] || (t[113] = x(" 查了 ", -1)),
|
|
3782
3754
|
a("b", null, f(nt.value.checked), 1),
|
|
3783
|
-
t[
|
|
3784
|
-
a("b",
|
|
3785
|
-
t[
|
|
3755
|
+
t[114] || (t[114] = x(" 个块:通过 ", -1)),
|
|
3756
|
+
a("b", yr, f(nt.value.passed), 1),
|
|
3757
|
+
t[115] || (t[115] = x("、停用 ", -1)),
|
|
3786
3758
|
a("b", null, f(nt.value.disabled), 1),
|
|
3787
|
-
t[
|
|
3759
|
+
t[116] || (t[116] = x("。 ", -1))
|
|
3788
3760
|
]),
|
|
3789
|
-
|
|
3761
|
+
Et.value > 0 ? (d(), p("button", {
|
|
3790
3762
|
key: 0,
|
|
3791
3763
|
class: "p-button p-button-sm p-button-text",
|
|
3792
3764
|
type: "button",
|
|
3793
3765
|
onClick: t[20] || (t[20] = (l) => Nt.value = !0)
|
|
3794
|
-
}, "查看体检说明(" + f(
|
|
3795
|
-
])) :
|
|
3796
|
-
nt.value ? (d(), p("div",
|
|
3797
|
-
t[
|
|
3766
|
+
}, "查看体检说明(" + f(Et.value) + ")", 1)) : C("", !0)
|
|
3767
|
+
])) : C("", !0),
|
|
3768
|
+
nt.value ? (d(), p("div", kr, [
|
|
3769
|
+
t[119] || (t[119] = a("p", { class: "mbc__hint" }, [
|
|
3798
3770
|
a("span", { class: "mbc__chip mb-1" }, "ℹ️ 只做静态判据"),
|
|
3799
3771
|
a("b", null, '别把"通过"读成"跑得起来"'),
|
|
3800
3772
|
x(":体检**不执行任何块代码**,所以只在运行期才炸的那些 (字段用错、查询写错)这一次看不出来 —— 它们靠的是保存时那次试加载与引用深检。 ")
|
|
3801
3773
|
], -1)),
|
|
3802
|
-
|
|
3803
|
-
(d(!0), p(A, null,
|
|
3774
|
+
ne.value.length > 0 ? (d(), p(A, { key: 0 }, [
|
|
3775
|
+
(d(!0), p(A, null, F(ne.value, (l) => (d(), p("p", {
|
|
3804
3776
|
key: l.id,
|
|
3805
3777
|
class: "mbc__hint"
|
|
3806
3778
|
}, [
|
|
3807
|
-
a("span",
|
|
3808
|
-
(d(!0), p(A, null,
|
|
3779
|
+
a("span", $r, f(l.name || l.id), 1),
|
|
3780
|
+
(d(!0), p(A, null, F(l.verifyNotes ?? [], (m, T) => (d(), p("span", {
|
|
3809
3781
|
key: T,
|
|
3810
3782
|
class: "mbc__reqitem"
|
|
3811
3783
|
}, f(m), 1))), 128))
|
|
3812
3784
|
]))), 128)),
|
|
3813
|
-
t[
|
|
3814
|
-
], 64)) :
|
|
3815
|
-
])) :
|
|
3816
|
-
t[
|
|
3817
|
-
a("div",
|
|
3818
|
-
t[
|
|
3819
|
-
a("label",
|
|
3785
|
+
t[118] || (t[118] = a("p", { class: "mbc__hint" }, " 以上都是**没验到 / 只提示**,不是错:它们不拦保存、也不让块停用 (依赖声明那几条判据结论只在 `LABULL_REQUIRES` **显式写成 `warn`** 时才走这里; **默认档是 `error`**,那一档下它们进的是上面那个「问题」)。 ", -1))
|
|
3786
|
+
], 64)) : C("", !0)
|
|
3787
|
+
])) : C("", !0),
|
|
3788
|
+
t[130] || (t[130] = a("hr", { class: "mbc__rule" }, null, -1)),
|
|
3789
|
+
a("div", xr, [
|
|
3790
|
+
t[122] || (t[122] = a("span", { class: "mbc__label" }, "导出范围", -1)),
|
|
3791
|
+
a("label", wr, [
|
|
3820
3792
|
a("input", {
|
|
3821
3793
|
type: "radio",
|
|
3822
3794
|
name: "mbc-scope",
|
|
3823
3795
|
value: "one",
|
|
3824
3796
|
checked: D.value === "one",
|
|
3825
3797
|
onChange: t[21] || (t[21] = (l) => D.value = "one")
|
|
3826
|
-
}, null, 40,
|
|
3827
|
-
t[
|
|
3798
|
+
}, null, 40, Sr),
|
|
3799
|
+
t[120] || (t[120] = x(" 仅这一个块 ", -1))
|
|
3828
3800
|
]),
|
|
3829
|
-
a("label",
|
|
3801
|
+
a("label", Cr, [
|
|
3830
3802
|
a("input", {
|
|
3831
3803
|
type: "radio",
|
|
3832
3804
|
name: "mbc-scope",
|
|
3833
3805
|
value: "all",
|
|
3834
3806
|
checked: D.value === "all",
|
|
3835
3807
|
onChange: t[22] || (t[22] = (l) => D.value = "all")
|
|
3836
|
-
}, null, 40,
|
|
3808
|
+
}, null, 40, Er),
|
|
3837
3809
|
x(" 全部块(" + f(v.value.length) + " 个) ", 1)
|
|
3838
3810
|
]),
|
|
3839
|
-
a("label",
|
|
3811
|
+
a("label", Br, [
|
|
3840
3812
|
a("input", {
|
|
3841
3813
|
type: "radio",
|
|
3842
3814
|
name: "mbc-scope",
|
|
3843
3815
|
value: "framework",
|
|
3844
3816
|
checked: D.value === "framework",
|
|
3845
3817
|
onChange: t[23] || (t[23] = (l) => D.value = "framework")
|
|
3846
|
-
}, null, 40,
|
|
3847
|
-
t[
|
|
3818
|
+
}, null, 40, Tr),
|
|
3819
|
+
t[121] || (t[121] = x(" 只铺框架文件(不动块代码) ", -1))
|
|
3848
3820
|
]),
|
|
3849
3821
|
D.value === "one" ? (d(), p("select", {
|
|
3850
3822
|
key: 0,
|
|
3851
3823
|
class: "p-inputtext p-component mbc__grow",
|
|
3852
|
-
value:
|
|
3824
|
+
value: ht.value,
|
|
3853
3825
|
disabled: P.value || v.value.length === 0,
|
|
3854
|
-
onChange: t[24] || (t[24] = (l) =>
|
|
3826
|
+
onChange: t[24] || (t[24] = (l) => de(l.target.value))
|
|
3855
3827
|
}, [
|
|
3856
|
-
v.value.length === 0 ? (d(), p("option",
|
|
3857
|
-
(d(!0), p(A, null,
|
|
3828
|
+
v.value.length === 0 ? (d(), p("option", Mr, "(库里还没有块)")) : C("", !0),
|
|
3829
|
+
(d(!0), p(A, null, F(v.value, (l) => (d(), p("option", {
|
|
3858
3830
|
key: l.id,
|
|
3859
3831
|
value: l.id
|
|
3860
|
-
}, f(l.module) + " / " + f(l.name || l.id), 9,
|
|
3861
|
-
], 40,
|
|
3832
|
+
}, f(l.module) + " / " + f(l.name || l.id), 9, Or))), 128))
|
|
3833
|
+
], 40, Ar)) : C("", !0)
|
|
3862
3834
|
]),
|
|
3863
|
-
a("div",
|
|
3864
|
-
t[
|
|
3835
|
+
a("div", jr, [
|
|
3836
|
+
t[123] || (t[123] = a("label", { for: "mbc-dir" }, "导出目录", -1)),
|
|
3865
3837
|
a("input", {
|
|
3866
3838
|
id: "mbc-dir",
|
|
3867
3839
|
class: "p-inputtext p-component mbc__grow mbc__mono",
|
|
3868
3840
|
type: "text",
|
|
3869
3841
|
readonly: "",
|
|
3870
3842
|
value: M.value ? M.value.name : "(还没选:点右边那个按钮选一个文件夹)"
|
|
3871
|
-
}, null, 8,
|
|
3843
|
+
}, null, 8, Dr),
|
|
3872
3844
|
a("button", {
|
|
3873
3845
|
class: "p-button p-button-sm p-button-outlined",
|
|
3874
3846
|
type: "button",
|
|
3875
3847
|
disabled: P.value,
|
|
3876
|
-
onClick: t[25] || (t[25] = (l) =>
|
|
3877
|
-
}, "选择文件夹", 8,
|
|
3848
|
+
onClick: t[25] || (t[25] = (l) => Bn("export"))
|
|
3849
|
+
}, "选择文件夹", 8, Rr),
|
|
3878
3850
|
a("button", {
|
|
3879
3851
|
class: "p-button p-button-sm mbc__act-export",
|
|
3880
3852
|
type: "button",
|
|
3881
3853
|
disabled: P.value || D.value === "one" && !lt.value,
|
|
3882
|
-
title:
|
|
3883
|
-
onClick: t[26] || (t[26] = (l) =>
|
|
3884
|
-
}, f(
|
|
3854
|
+
title: te.value,
|
|
3855
|
+
onClick: t[26] || (t[26] = (l) => ol())
|
|
3856
|
+
}, f(ft.value ? "导出中…" : "导出"), 9, Lr)
|
|
3885
3857
|
]),
|
|
3886
|
-
D.value === "framework" ? (d(), p("p",
|
|
3887
|
-
|
|
3888
|
-
])])) : (d(), p("p",
|
|
3858
|
+
D.value === "framework" ? (d(), p("p", Pr, [...t[124] || (t[124] = [
|
|
3859
|
+
kl(' 这一趟只铺<b data-v-05c2e9c9>框架文件</b>:顶层那几份生成物(<span class="mbc__mono" data-v-05c2e9c9>AGENTS.lock.md</span> / <span class="mbc__mono" data-v-05c2e9c9>backend.lock.pyi</span> / <span class="mbc__mono" data-v-05c2e9c9>requirements.lock.txt</span> / <span class="mbc__mono" data-v-05c2e9c9>smoke.lock.mjs</span> / <span class="mbc__mono" data-v-05c2e9c9>pages.lock.ts</span> / <span class="mbc__mono" data-v-05c2e9c9>labull.css</span> / <span class="mbc__mono" data-v-05c2e9c9>CONTROLS.lock.html</span>) 与 <span class="mbc__mono" data-v-05c2e9c9>example/</span> 那一层。 🔴 <span class="mbc__mono" data-v-05c2e9c9>workspace/</span> 里的块代码<b data-v-05c2e9c9>一个字节都不写、也不删</b> (连「清空并导出」都不进那一层)—— 平台升级之后刷新框架就用这一档。 ', 23)
|
|
3860
|
+
])])) : (d(), p("p", Ir, [
|
|
3889
3861
|
x(f(D.value === "all" ? `这一趟铺全部 ${v.value.length} 个块` : lt.value ? `这一趟只铺「${lt.value.module} / ${lt.value.name || lt.value.id}」` : "先挑一个块") + " ⇒ ", 1),
|
|
3890
|
-
t[
|
|
3891
|
-
t[
|
|
3892
|
-
t[
|
|
3893
|
-
t[
|
|
3862
|
+
t[125] || (t[125] = a("span", { class: "mbc__mono" }, "workspace/<可读名>-<块 uuid>/", -1)),
|
|
3863
|
+
t[126] || (t[126] = x(",顶层另附开发说明与 ", -1)),
|
|
3864
|
+
t[127] || (t[127] = a("span", { class: "mbc__mono" }, "example/", -1)),
|
|
3865
|
+
t[128] || (t[128] = x("。 ", -1))
|
|
3894
3866
|
])),
|
|
3895
|
-
ot.value ? (d(), p("p",
|
|
3867
|
+
ot.value ? (d(), p("p", Nr, f(ot.value), 1)) : C("", !0)
|
|
3896
3868
|
], 512), [
|
|
3897
3869
|
[ye, R.value === "workspace"]
|
|
3898
3870
|
]),
|
|
3899
|
-
|
|
3900
|
-
t[
|
|
3901
|
-
a("div",
|
|
3902
|
-
t[
|
|
3871
|
+
mt(a("section", qr, [
|
|
3872
|
+
t[140] || (t[140] = a("h3", { class: "mbc__title" }, "读回改动", -1)),
|
|
3873
|
+
a("div", zr, [
|
|
3874
|
+
t[131] || (t[131] = a("label", { for: "mbc-read-dir" }, "读回目录", -1)),
|
|
3903
3875
|
a("input", {
|
|
3904
3876
|
id: "mbc-read-dir",
|
|
3905
3877
|
class: "p-inputtext p-component mbc__grow mbc__mono",
|
|
3906
3878
|
type: "text",
|
|
3907
3879
|
readonly: "",
|
|
3908
3880
|
value: S.value ? S.value.name : "(还没选:导出会自动填上,也可以自己选一个)"
|
|
3909
|
-
}, null, 8,
|
|
3881
|
+
}, null, 8, Fr),
|
|
3910
3882
|
a("button", {
|
|
3911
3883
|
class: "p-button p-button-sm p-button-outlined",
|
|
3912
3884
|
type: "button",
|
|
3913
3885
|
disabled: P.value,
|
|
3914
|
-
onClick: t[27] || (t[27] = (l) =>
|
|
3915
|
-
}, "选择文件夹", 8,
|
|
3886
|
+
onClick: t[27] || (t[27] = (l) => Bn("read"))
|
|
3887
|
+
}, "选择文件夹", 8, Ur),
|
|
3916
3888
|
a("button", {
|
|
3917
3889
|
class: "p-button p-button-sm p-button-outlined",
|
|
3918
3890
|
type: "button",
|
|
3919
3891
|
disabled: P.value,
|
|
3920
|
-
onClick: t[28] || (t[28] = (l) =>
|
|
3921
|
-
}, f(St.value ? "读回中…" : "读回改动"), 9,
|
|
3892
|
+
onClick: t[28] || (t[28] = (l) => An())
|
|
3893
|
+
}, f(St.value ? "读回中…" : "读回改动"), 9, Hr)
|
|
3922
3894
|
]),
|
|
3923
|
-
S.value && M.value && S.value.name !== M.value.name ? (d(), p("p",
|
|
3924
|
-
a("div",
|
|
3895
|
+
S.value && M.value && S.value.name !== M.value.name ? (d(), p("p", Wr, " 读回的是「" + f(S.value.name) + "」(与导出目录「" + f(M.value.name) + "」不是同一个 —— 想同步就再选一次)。 ", 1)) : (d(), p("p", Kr, "读回目录默认跟着导出目录;要读别的文件夹就点「选择文件夹」单独选一个。")),
|
|
3896
|
+
a("div", Vr, [
|
|
3925
3897
|
a("button", {
|
|
3926
3898
|
class: "p-button p-button-sm mbc__act-import",
|
|
3927
3899
|
type: "button",
|
|
3928
3900
|
disabled: P.value || It.value.length === 0,
|
|
3929
3901
|
title: It.value.length === 0 ? "先「读回改动」,再在清单里勾上要存的块(勾不上的是目录里缺的那一块)" : `存这 ${It.value.length} 个块:校验 + 体检 + 记一版`,
|
|
3930
|
-
onClick: t[29] || (t[29] = (l) =>
|
|
3931
|
-
}, f(B.value ? "保存中…" : `保存选中的块(${It.value.length})`), 9,
|
|
3902
|
+
onClick: t[29] || (t[29] = (l) => pl())
|
|
3903
|
+
}, f(B.value ? "保存中…" : `保存选中的块(${It.value.length})`), 9, Gr)
|
|
3932
3904
|
]),
|
|
3933
3905
|
H.value ? (d(), p(A, { key: 2 }, [
|
|
3934
|
-
he.value.length > 0 ? (d(), p("p",
|
|
3935
|
-
t[
|
|
3906
|
+
he.value.length > 0 ? (d(), p("p", Jr, [
|
|
3907
|
+
t[132] || (t[132] = x(" 扫到 ", -1)),
|
|
3936
3908
|
a("b", null, f(H.value.blocks.length), 1),
|
|
3937
|
-
t[
|
|
3938
|
-
a("b",
|
|
3939
|
-
t[
|
|
3909
|
+
t[133] || (t[133] = x(" 个块,其中 ", -1)),
|
|
3910
|
+
a("b", Yr, f(he.value.length), 1),
|
|
3911
|
+
t[134] || (t[134] = x(" 个可以存;已经勾了 ", -1)),
|
|
3940
3912
|
a("b", null, f(It.value.length), 1),
|
|
3941
|
-
t[
|
|
3913
|
+
t[135] || (t[135] = x(" 个。 ", -1)),
|
|
3942
3914
|
a("button", {
|
|
3943
3915
|
class: "p-button p-button-sm p-button-text",
|
|
3944
3916
|
type: "button",
|
|
3945
3917
|
disabled: P.value,
|
|
3946
|
-
onClick: t[30] || (t[30] = (l) =>
|
|
3947
|
-
}, "全选可存的", 8,
|
|
3918
|
+
onClick: t[30] || (t[30] = (l) => Mn(!0))
|
|
3919
|
+
}, "全选可存的", 8, Xr),
|
|
3948
3920
|
a("button", {
|
|
3949
3921
|
class: "p-button p-button-sm p-button-text",
|
|
3950
3922
|
type: "button",
|
|
3951
3923
|
disabled: P.value || It.value.length === 0,
|
|
3952
|
-
onClick: t[31] || (t[31] = (l) =>
|
|
3953
|
-
}, "全不选", 8,
|
|
3954
|
-
])) :
|
|
3955
|
-
H.value.blocks.length > 0 ? (d(), p("ul",
|
|
3956
|
-
(d(!0), p(A, null,
|
|
3924
|
+
onClick: t[31] || (t[31] = (l) => Mn(!1))
|
|
3925
|
+
}, "全不选", 8, Zr)
|
|
3926
|
+
])) : C("", !0),
|
|
3927
|
+
H.value.blocks.length > 0 ? (d(), p("ul", Qr, [
|
|
3928
|
+
(d(!0), p(A, null, F(H.value.blocks, (l) => (d(), p("li", {
|
|
3957
3929
|
key: l.id,
|
|
3958
|
-
class: Z(["mbc__block", { "is-picked":
|
|
3930
|
+
class: Z(["mbc__block", { "is-picked": _t.value[l.id] === !0, "is-blocked": !l.canApply }])
|
|
3959
3931
|
}, [
|
|
3960
|
-
a("label",
|
|
3932
|
+
a("label", tc, [
|
|
3961
3933
|
a("span", {
|
|
3962
3934
|
class: Z(["p-checkbox p-component", { "p-disabled": !l.canApply }])
|
|
3963
3935
|
}, [
|
|
@@ -3965,85 +3937,94 @@ ${t.text}`).join(`
|
|
|
3965
3937
|
class: "p-checkbox-input",
|
|
3966
3938
|
type: "checkbox",
|
|
3967
3939
|
disabled: !l.canApply,
|
|
3968
|
-
checked:
|
|
3969
|
-
onChange: (m) =>
|
|
3970
|
-
}, null, 40,
|
|
3971
|
-
t[
|
|
3940
|
+
checked: _t.value[l.id] === !0,
|
|
3941
|
+
onChange: (m) => bl(l.id, m)
|
|
3942
|
+
}, null, 40, ec),
|
|
3943
|
+
t[136] || (t[136] = a("span", { class: "p-checkbox-box" }, null, -1))
|
|
3972
3944
|
], 2),
|
|
3973
|
-
a("span",
|
|
3945
|
+
a("span", nc, f(l.name || l.id), 1),
|
|
3974
3946
|
a("span", {
|
|
3975
3947
|
class: Z(["p-tag", l.status === "modified" ? "p-tag-success" : l.status === "missing" ? "p-tag-warning" : l.status === "not-in-db" ? "p-tag-info" : ""])
|
|
3976
3948
|
}, f(e[l.status]), 3),
|
|
3977
|
-
a("span",
|
|
3949
|
+
a("span", sc, f(l.module || "—"), 1)
|
|
3978
3950
|
]),
|
|
3979
|
-
a("p",
|
|
3951
|
+
a("p", lc, [
|
|
3980
3952
|
l.status === "missing" ? (d(), p(A, { key: 0 }, [
|
|
3981
3953
|
x("目录里没有这一块,勾不上")
|
|
3982
3954
|
], 64)) : l.status === "not-in-db" ? (d(), p(A, { key: 1 }, [
|
|
3983
3955
|
x("库里还没有这一块 —— 勾上它保存,就是按这一包新建")
|
|
3984
|
-
], 64)) : l.changedFiles.length > 0 ? (d(), p(A, { key: 2 }, [
|
|
3985
|
-
|
|
3986
|
-
|
|
3956
|
+
], 64)) : l.changedFiles.length > 0 || (l.removedFiles ?? []).length > 0 ? (d(), p(A, { key: 2 }, [
|
|
3957
|
+
l.changedFiles.length > 0 ? (d(), p(A, { key: 0 }, [
|
|
3958
|
+
t[137] || (t[137] = x("改了:", -1)),
|
|
3959
|
+
a("span", oc, f(l.changedFiles.join(" / ")), 1)
|
|
3960
|
+
], 64)) : C("", !0),
|
|
3961
|
+
(l.removedFiles ?? []).length > 0 ? (d(), p(A, { key: 1 }, [
|
|
3962
|
+
l.changedFiles.length > 0 ? (d(), p(A, { key: 0 }, [
|
|
3963
|
+
x(";")
|
|
3964
|
+
], 64)) : C("", !0),
|
|
3965
|
+
t[138] || (t[138] = x(" 删了:", -1)),
|
|
3966
|
+
a("span", ac, f((l.removedFiles ?? []).join(" / ")), 1)
|
|
3967
|
+
], 64)) : C("", !0)
|
|
3987
3968
|
], 64)) : (d(), p(A, { key: 3 }, [
|
|
3988
3969
|
x("内容与库里一致")
|
|
3989
3970
|
], 64))
|
|
3990
3971
|
]),
|
|
3991
|
-
l.blockedWhy ? (d(), p("p",
|
|
3992
|
-
(l.verifyNotes ?? []).length > 0 ? (d(), p("ul",
|
|
3993
|
-
(d(!0), p(A, null,
|
|
3972
|
+
l.blockedWhy ? (d(), p("p", ic, "不能存:" + f(l.blockedWhy), 1)) : C("", !0),
|
|
3973
|
+
(l.verifyNotes ?? []).length > 0 ? (d(), p("ul", rc, [
|
|
3974
|
+
(d(!0), p(A, null, F(l.verifyNotes ?? [], (m, T) => (d(), p("li", {
|
|
3994
3975
|
key: T,
|
|
3995
3976
|
class: "mbc__note"
|
|
3996
3977
|
}, f(m), 1))), 128))
|
|
3997
|
-
])) :
|
|
3998
|
-
a("p",
|
|
3978
|
+
])) : C("", !0),
|
|
3979
|
+
a("p", cc, f(l.folder || l.where), 1)
|
|
3999
3980
|
], 2))), 128))
|
|
4000
|
-
])) : (d(), p("p",
|
|
4001
|
-
a("div",
|
|
4002
|
-
|
|
3981
|
+
])) : (d(), p("p", uc, "这个目录里没有认出任何块(点上面那个按钮再扫一次,或者确认文件夹名里有那个块的 uuid)。")),
|
|
3982
|
+
a("div", dc, [
|
|
3983
|
+
yt.value > 0 ? (d(), p("button", {
|
|
4003
3984
|
key: 0,
|
|
4004
3985
|
class: "p-button p-button-sm mbc__report-btn",
|
|
4005
3986
|
type: "button",
|
|
4006
|
-
title: "点开看这一趟的全部问题(" +
|
|
3987
|
+
title: "点开看这一趟的全部问题(" + yt.value + " 条)",
|
|
4007
3988
|
onClick: t[32] || (t[32] = (l) => Nt.value = !0)
|
|
4008
|
-
}, "查看问题(" + f(
|
|
3989
|
+
}, "查看问题(" + f(yt.value) + ")⚠", 9, pc)) : (d(), p("span", bc, "这一趟没有问题")),
|
|
4009
3990
|
H.value.unmatched.length > 0 ? (d(), p("span", {
|
|
4010
3991
|
key: 2,
|
|
4011
3992
|
class: "mbc__chip is-bad",
|
|
4012
3993
|
title: H.value.unmatched.join(" / ")
|
|
4013
|
-
}, "认不出归属的文件夹 " + f(H.value.unmatched.length), 9,
|
|
3994
|
+
}, "认不出归属的文件夹 " + f(H.value.unmatched.length), 9, mc)) : C("", !0)
|
|
4014
3995
|
]),
|
|
4015
|
-
(H.value.skipped ?? []).length > 0 ? (d(), p("p",
|
|
3996
|
+
(H.value.skipped ?? []).length > 0 ? (d(), p("p", fc, [
|
|
4016
3997
|
x(" 忽略了 " + f((H.value.skipped ?? []).length) + " 个文件夹(名字里没有 uuid,当测试文件处理 —— 与忽略 ", 1),
|
|
4017
|
-
t[
|
|
3998
|
+
t[139] || (t[139] = a("span", { class: "mbc__mono" }, "example/", -1)),
|
|
4018
3999
|
x(" 同一个规矩):" + f((H.value.skipped ?? []).join(" / ")), 1)
|
|
4019
|
-
])) :
|
|
4020
|
-
], 64)) :
|
|
4000
|
+
])) : C("", !0)
|
|
4001
|
+
], 64)) : C("", !0)
|
|
4021
4002
|
], 512), [
|
|
4022
4003
|
[ye, R.value === "workspace"]
|
|
4023
4004
|
]),
|
|
4024
|
-
|
|
4025
|
-
a("h3",
|
|
4026
|
-
t[
|
|
4027
|
-
a("span",
|
|
4028
|
-
a("span",
|
|
4005
|
+
mt(a("section", hc, [
|
|
4006
|
+
a("h3", vc, [
|
|
4007
|
+
t[141] || (t[141] = x(" 不在数据库 ", -1)),
|
|
4008
|
+
a("span", gc, f(G(s)), 1),
|
|
4009
|
+
a("span", _c, f(He.value.length), 1)
|
|
4029
4010
|
]),
|
|
4030
|
-
|
|
4031
|
-
a("p",
|
|
4032
|
-
t[
|
|
4033
|
-
t[
|
|
4034
|
-
t[
|
|
4035
|
-
t[
|
|
4036
|
-
t[
|
|
4037
|
-
t[
|
|
4011
|
+
He.value.length === 0 ? (d(), p("p", yc, "路由表里声明的块,库里都有那一行。")) : (d(), p(A, { key: 1 }, [
|
|
4012
|
+
a("p", kc, [
|
|
4013
|
+
t[142] || (t[142] = x(" 这些页面的路由(", -1)),
|
|
4014
|
+
t[143] || (t[143] = a("span", { class: "mbc__mono" }, "component: MagicBlockPage", -1)),
|
|
4015
|
+
t[144] || (t[144] = x(")声明了块的 uuid, ", -1)),
|
|
4016
|
+
t[145] || (t[145] = a("span", { class: "mbc__mono" }, "/magic-blocks/index", -1)),
|
|
4017
|
+
t[146] || (t[146] = x(" 里却没有这一行 —— 页面上那一块现在是占位框。 ", -1)),
|
|
4018
|
+
t[147] || (t[147] = a("b", null, "要建进库", -1)),
|
|
4038
4019
|
x(":在上面「读回改动」里选中放这一块的文件夹(文件夹名里有 uuid), 扫出来就是一条标签写着「" + f(G(s)) + "」、能勾能存的条目。 ", 1)
|
|
4039
4020
|
]),
|
|
4040
|
-
a("ul",
|
|
4041
|
-
(d(!0), p(A, null,
|
|
4021
|
+
a("ul", $c, [
|
|
4022
|
+
(d(!0), p(A, null, F(He.value, (l) => (d(), p("li", {
|
|
4042
4023
|
key: l.uuid,
|
|
4043
4024
|
class: "mbc__block is-blocked"
|
|
4044
4025
|
}, [
|
|
4045
|
-
a("label",
|
|
4046
|
-
t[
|
|
4026
|
+
a("label", xc, [
|
|
4027
|
+
t[148] || (t[148] = a("span", { class: "p-checkbox p-component p-disabled" }, [
|
|
4047
4028
|
a("input", {
|
|
4048
4029
|
class: "p-checkbox-input",
|
|
4049
4030
|
type: "checkbox",
|
|
@@ -4051,54 +4032,54 @@ ${t.text}`).join(`
|
|
|
4051
4032
|
}),
|
|
4052
4033
|
a("span", { class: "p-checkbox-box" })
|
|
4053
4034
|
], -1)),
|
|
4054
|
-
a("span",
|
|
4055
|
-
a("span",
|
|
4056
|
-
a("span",
|
|
4035
|
+
a("span", wc, f(l.title || l.uuid), 1),
|
|
4036
|
+
a("span", Sc, f(G(s)), 1),
|
|
4037
|
+
a("span", Cc, f(l.module || "—"), 1)
|
|
4057
4038
|
]),
|
|
4058
|
-
a("p",
|
|
4059
|
-
t[
|
|
4060
|
-
a("span",
|
|
4061
|
-
t[
|
|
4039
|
+
a("p", Ec, [
|
|
4040
|
+
t[149] || (t[149] = x(" 路由 ", -1)),
|
|
4041
|
+
a("span", Bc, f(l.path), 1),
|
|
4042
|
+
t[150] || (t[150] = x(" 声明了它,库里没有这个块 —— 手里还没有放这个块的文件夹,所以这里勾不上(勾上了也没有正文可存)。 ", -1))
|
|
4062
4043
|
]),
|
|
4063
|
-
a("p",
|
|
4044
|
+
a("p", Tc, f(l.uuid), 1)
|
|
4064
4045
|
]))), 128))
|
|
4065
4046
|
])
|
|
4066
4047
|
], 64))
|
|
4067
4048
|
], 512), [
|
|
4068
4049
|
[ye, R.value === "workspace"]
|
|
4069
4050
|
]),
|
|
4070
|
-
R.value === "workspace" && (rt.value.length > 0 || ct.value.length > 0) ? (d(), p("section",
|
|
4071
|
-
t[
|
|
4072
|
-
a("p",
|
|
4073
|
-
a("span",
|
|
4074
|
-
|
|
4075
|
-
rt.value.length > 0 ? (d(), p("span",
|
|
4076
|
-
|
|
4051
|
+
R.value === "workspace" && (rt.value.length > 0 || ct.value.length > 0) ? (d(), p("section", Ac, [
|
|
4052
|
+
t[151] || (t[151] = a("h3", { class: "mbc__title" }, "保存结果", -1)),
|
|
4053
|
+
a("p", Mc, [
|
|
4054
|
+
a("span", Oc, "存成 " + f(ze.value), 1),
|
|
4055
|
+
ee.value.length > 0 ? (d(), p("span", jc, "没存成 " + f(ee.value.length), 1)) : C("", !0),
|
|
4056
|
+
rt.value.length > 0 ? (d(), p("span", Dc, "前端拦下 " + f(rt.value.length), 1)) : C("", !0),
|
|
4057
|
+
ee.value.length === 0 && rt.value.length === 0 ? (d(), p("span", Rc, "明细在下面那个「查看问题」里(没问题时是空的)。")) : C("", !0)
|
|
4077
4058
|
]),
|
|
4078
|
-
a("div",
|
|
4059
|
+
a("div", Lc, [
|
|
4079
4060
|
a("button", {
|
|
4080
4061
|
class: "p-button p-button-sm mbc__report-btn",
|
|
4081
4062
|
type: "button",
|
|
4082
4063
|
onClick: t[33] || (t[33] = (l) => Nt.value = !0)
|
|
4083
|
-
}, " 查看问题(" + f(
|
|
4064
|
+
}, " 查看问题(" + f(yt.value) + f(Et.value > 0 ? ` + 提示 ${Et.value}` : "") + ")⚠ ", 1)
|
|
4084
4065
|
])
|
|
4085
|
-
])) :
|
|
4086
|
-
t[
|
|
4066
|
+
])) : C("", !0),
|
|
4067
|
+
t[152] || (t[152] = a("div", {
|
|
4087
4068
|
class: "mbc__tailspace",
|
|
4088
4069
|
"aria-hidden": "true"
|
|
4089
4070
|
}, null, -1))
|
|
4090
4071
|
]),
|
|
4091
|
-
a("footer",
|
|
4072
|
+
a("footer", Pc, [
|
|
4092
4073
|
k.value.length > 0 ? (d(), p("button", {
|
|
4093
4074
|
key: 0,
|
|
4094
4075
|
class: "p-button p-button-sm mbc__report-btn",
|
|
4095
4076
|
type: "button",
|
|
4096
4077
|
title: "点开看全部报错(" + k.value.length + " 条)",
|
|
4097
4078
|
onClick: t[34] || (t[34] = (l) => w.value = !0)
|
|
4098
|
-
}, "查看报错(" + f(k.value.length) + " 条)⚠", 9,
|
|
4099
|
-
y.value ? (d(), p("p",
|
|
4079
|
+
}, "查看报错(" + f(k.value.length) + " 条)⚠", 9, Ic)) : C("", !0),
|
|
4080
|
+
y.value ? (d(), p("p", Nc, f(y.value), 1)) : g.value ? (d(), p("p", qc, f(g.value), 1)) : (d(), p("p", zc, "—"))
|
|
4100
4081
|
])
|
|
4101
|
-
], 2)) :
|
|
4082
|
+
], 2)) : C("", !0),
|
|
4102
4083
|
b.value && Nt.value ? (d(), p("div", {
|
|
4103
4084
|
key: 1,
|
|
4104
4085
|
class: "mbc__modal",
|
|
@@ -4106,81 +4087,81 @@ ${t.text}`).join(`
|
|
|
4106
4087
|
"aria-modal": "true",
|
|
4107
4088
|
onClick: t[38] || (t[38] = an((l) => Nt.value = !1, ["self"]))
|
|
4108
4089
|
}, [
|
|
4109
|
-
a("div",
|
|
4110
|
-
a("header",
|
|
4111
|
-
a("strong", null, "读回 / 保存的问题(" + f(
|
|
4090
|
+
a("div", Fc, [
|
|
4091
|
+
a("header", Uc, [
|
|
4092
|
+
a("strong", null, "读回 / 保存的问题(" + f(yt.value) + " 条" + f(Et.value > 0 ? `,另有提示 / 没验到 ${Et.value} 条` : "") + ")", 1),
|
|
4112
4093
|
a("button", {
|
|
4113
4094
|
class: "p-button p-button-sm p-button-text",
|
|
4114
4095
|
type: "button",
|
|
4115
4096
|
onClick: t[35] || (t[35] = (l) => Nt.value = !1)
|
|
4116
4097
|
}, "收起")
|
|
4117
4098
|
]),
|
|
4118
|
-
a("div",
|
|
4119
|
-
rt.value.length > 0 ? (d(), p("section",
|
|
4120
|
-
a("h4",
|
|
4121
|
-
a("ul",
|
|
4122
|
-
(d(!0), p(A, null,
|
|
4099
|
+
a("div", Hc, [
|
|
4100
|
+
rt.value.length > 0 ? (d(), p("section", Wc, [
|
|
4101
|
+
a("h4", Kc, "前端校验拦下的(" + f(rt.value.length) + ")", 1),
|
|
4102
|
+
a("ul", Vc, [
|
|
4103
|
+
(d(!0), p(A, null, F(rt.value, (l, m) => (d(), p("li", { key: m }, f(l), 1))), 128))
|
|
4123
4104
|
])
|
|
4124
|
-
])) :
|
|
4125
|
-
(H.value?.failures ?? []).length > 0 ? (d(), p("section",
|
|
4126
|
-
a("h4",
|
|
4127
|
-
a("ul",
|
|
4128
|
-
(d(!0), p(A, null,
|
|
4129
|
-
a("span",
|
|
4130
|
-
a("span",
|
|
4105
|
+
])) : C("", !0),
|
|
4106
|
+
(H.value?.failures ?? []).length > 0 ? (d(), p("section", Gc, [
|
|
4107
|
+
a("h4", Jc, "读回时逐条回的(" + f((H.value?.failures ?? []).length) + ")", 1),
|
|
4108
|
+
a("ul", Yc, [
|
|
4109
|
+
(d(!0), p(A, null, F(H.value?.failures ?? [], (l, m) => (d(), p("li", { key: m }, [
|
|
4110
|
+
a("span", Xc, f(l.kind || "问题"), 1),
|
|
4111
|
+
a("span", Zc, f(l.where), 1),
|
|
4131
4112
|
x(" " + f(l.message), 1)
|
|
4132
4113
|
]))), 128))
|
|
4133
4114
|
])
|
|
4134
|
-
])) :
|
|
4135
|
-
(H.value?.unmatched ?? []).length > 0 ? (d(), p("section",
|
|
4136
|
-
a("h4",
|
|
4137
|
-
a("ul",
|
|
4138
|
-
(d(!0), p(A, null,
|
|
4139
|
-
a("span",
|
|
4115
|
+
])) : C("", !0),
|
|
4116
|
+
(H.value?.unmatched ?? []).length > 0 ? (d(), p("section", Qc, [
|
|
4117
|
+
a("h4", tu, "认不出归属的文件夹(" + f((H.value?.unmatched ?? []).length) + ")", 1),
|
|
4118
|
+
a("ul", eu, [
|
|
4119
|
+
(d(!0), p(A, null, F(H.value?.unmatched ?? [], (l, m) => (d(), p("li", { key: m }, [
|
|
4120
|
+
a("span", nu, f(l), 1)
|
|
4140
4121
|
]))), 128))
|
|
4141
4122
|
])
|
|
4142
|
-
])) :
|
|
4143
|
-
ct.value.length > 0 ? (d(), p("section",
|
|
4144
|
-
a("h4",
|
|
4145
|
-
a("ul",
|
|
4146
|
-
(d(!0), p(A, null,
|
|
4123
|
+
])) : C("", !0),
|
|
4124
|
+
ct.value.length > 0 ? (d(), p("section", su, [
|
|
4125
|
+
a("h4", lu, "保存结果(" + f(ct.value.length) + ":存成 " + f(ze.value) + ",没存成 " + f(ee.value.length) + ")", 1),
|
|
4126
|
+
a("ul", ou, [
|
|
4127
|
+
(d(!0), p(A, null, F(ct.value, (l) => (d(), p("li", {
|
|
4147
4128
|
key: l.id,
|
|
4148
4129
|
class: Z({ "is-ok": l.ok })
|
|
4149
4130
|
}, [
|
|
4150
4131
|
a("strong", null, f(l.name || l.id) + ":" + f(l.ok ? "已保存" : "没保存"), 1),
|
|
4151
|
-
!l.ok && l.error ? (d(), p("span",
|
|
4152
|
-
!l.ok && (l.issues ?? []).length > 0 ? (d(), p("ul",
|
|
4153
|
-
(d(!0), p(A, null,
|
|
4154
|
-
])) :
|
|
4132
|
+
!l.ok && l.error ? (d(), p("span", au, f(l.error), 1)) : C("", !0),
|
|
4133
|
+
!l.ok && (l.issues ?? []).length > 0 ? (d(), p("ul", iu, [
|
|
4134
|
+
(d(!0), p(A, null, F(l.issues, (m, T) => (d(), p("li", { key: T }, f(m), 1))), 128))
|
|
4135
|
+
])) : C("", !0)
|
|
4155
4136
|
], 2))), 128))
|
|
4156
4137
|
])
|
|
4157
|
-
])) :
|
|
4158
|
-
nt.value && nt.value.results.length > 0 ? (d(), p("section",
|
|
4159
|
-
a("h4",
|
|
4160
|
-
a("ul",
|
|
4138
|
+
])) : C("", !0),
|
|
4139
|
+
nt.value && nt.value.results.length > 0 ? (d(), p("section", ru, [
|
|
4140
|
+
a("h4", cu, "体检:提示 / 没验到(**不是错**," + f(Et.value) + " 条)", 1),
|
|
4141
|
+
a("ul", uu, [
|
|
4161
4142
|
a("li", { class: "mbc__note" }, [
|
|
4162
|
-
t[
|
|
4163
|
-
x(f(
|
|
4143
|
+
t[153] || (t[153] = a("strong", null, "这一层的边界:", -1)),
|
|
4144
|
+
x(f(is))
|
|
4164
4145
|
]),
|
|
4165
|
-
(d(!0), p(A, null,
|
|
4146
|
+
(d(!0), p(A, null, F(ne.value, (l) => (d(), p("li", {
|
|
4166
4147
|
key: l.id,
|
|
4167
4148
|
class: "mbc__note"
|
|
4168
4149
|
}, [
|
|
4169
4150
|
a("strong", null, f(l.name || l.id), 1),
|
|
4170
|
-
a("ul",
|
|
4171
|
-
(d(!0), p(A, null,
|
|
4151
|
+
a("ul", du, [
|
|
4152
|
+
(d(!0), p(A, null, F(l.verifyNotes ?? [], (m, T) => (d(), p("li", { key: T }, f(m), 1))), 128))
|
|
4172
4153
|
])
|
|
4173
4154
|
]))), 128))
|
|
4174
4155
|
]),
|
|
4175
|
-
t[
|
|
4176
|
-
])) :
|
|
4177
|
-
|
|
4156
|
+
t[154] || (t[154] = a("p", { class: "mbc__hint" }, ' 这一栏与"问题"分开:上面的都得改,这一栏**不拦保存、也不让块停用** (依赖声明那几条判据结论只在 `LABULL_REQUIRES` **显式写成 `warn`** 时才走这里; **默认档是 `error`**,那一档下它们进的是上面那个「问题」)。 ', -1))
|
|
4157
|
+
])) : C("", !0),
|
|
4158
|
+
yt.value === 0 && Et.value === 0 ? (d(), p("p", pu, "这一趟没有问题。")) : C("", !0)
|
|
4178
4159
|
]),
|
|
4179
|
-
a("footer",
|
|
4160
|
+
a("footer", bu, [
|
|
4180
4161
|
a("button", {
|
|
4181
4162
|
class: "p-button p-button-sm p-button-outlined",
|
|
4182
4163
|
type: "button",
|
|
4183
|
-
onClick: t[36] || (t[36] = (l) =>
|
|
4164
|
+
onClick: t[36] || (t[36] = (l) => sl())
|
|
4184
4165
|
}, "复制全部"),
|
|
4185
4166
|
a("button", {
|
|
4186
4167
|
class: "p-button p-button-sm",
|
|
@@ -4189,7 +4170,7 @@ ${t.text}`).join(`
|
|
|
4189
4170
|
}, "知道了")
|
|
4190
4171
|
])
|
|
4191
4172
|
])
|
|
4192
|
-
])) :
|
|
4173
|
+
])) : C("", !0),
|
|
4193
4174
|
b.value && w.value ? (d(), p("div", {
|
|
4194
4175
|
key: 2,
|
|
4195
4176
|
class: "mbc__modal",
|
|
@@ -4197,8 +4178,8 @@ ${t.text}`).join(`
|
|
|
4197
4178
|
"aria-modal": "true",
|
|
4198
4179
|
onClick: t[43] || (t[43] = an((l) => w.value = !1, ["self"]))
|
|
4199
4180
|
}, [
|
|
4200
|
-
a("div",
|
|
4201
|
-
a("header",
|
|
4181
|
+
a("div", mu, [
|
|
4182
|
+
a("header", fu, [
|
|
4202
4183
|
a("strong", null, "报错(" + f(k.value.length) + " 条)", 1),
|
|
4203
4184
|
a("button", {
|
|
4204
4185
|
class: "p-button p-button-sm p-button-text",
|
|
@@ -4206,28 +4187,28 @@ ${t.text}`).join(`
|
|
|
4206
4187
|
onClick: t[39] || (t[39] = (l) => w.value = !1)
|
|
4207
4188
|
}, "收起")
|
|
4208
4189
|
]),
|
|
4209
|
-
a("div",
|
|
4210
|
-
a("ol",
|
|
4211
|
-
(d(!0), p(A, null,
|
|
4212
|
-
a("div",
|
|
4213
|
-
a("span",
|
|
4190
|
+
a("div", hu, [
|
|
4191
|
+
a("ol", vu, [
|
|
4192
|
+
(d(!0), p(A, null, F(k.value, (l, m) => (d(), p("li", { key: m }, [
|
|
4193
|
+
a("div", gu, [
|
|
4194
|
+
a("span", _u, f(l.at), 1),
|
|
4214
4195
|
x(" · " + f(l.where), 1)
|
|
4215
4196
|
]),
|
|
4216
|
-
a("pre",
|
|
4197
|
+
a("pre", yu, f(l.text), 1)
|
|
4217
4198
|
]))), 128))
|
|
4218
4199
|
]),
|
|
4219
|
-
k.value.length === 0 ? (d(), p("p",
|
|
4200
|
+
k.value.length === 0 ? (d(), p("p", ku, "这一轮没有报错。")) : C("", !0)
|
|
4220
4201
|
]),
|
|
4221
|
-
a("footer",
|
|
4202
|
+
a("footer", $u, [
|
|
4222
4203
|
a("button", {
|
|
4223
4204
|
class: "p-button p-button-sm p-button-outlined",
|
|
4224
4205
|
type: "button",
|
|
4225
|
-
onClick: t[40] || (t[40] = (l) =>
|
|
4206
|
+
onClick: t[40] || (t[40] = (l) => el())
|
|
4226
4207
|
}, "复制全部"),
|
|
4227
4208
|
a("button", {
|
|
4228
4209
|
class: "p-button p-button-sm p-button-text",
|
|
4229
4210
|
type: "button",
|
|
4230
|
-
onClick: t[41] || (t[41] = (l) =>
|
|
4211
|
+
onClick: t[41] || (t[41] = (l) => We())
|
|
4231
4212
|
}, "清空报错"),
|
|
4232
4213
|
a("button", {
|
|
4233
4214
|
class: "p-button p-button-sm",
|
|
@@ -4236,46 +4217,46 @@ ${t.text}`).join(`
|
|
|
4236
4217
|
}, "知道了")
|
|
4237
4218
|
])
|
|
4238
4219
|
])
|
|
4239
|
-
])) :
|
|
4220
|
+
])) : C("", !0),
|
|
4240
4221
|
b.value ? (d(), p("button", {
|
|
4241
4222
|
key: 3,
|
|
4242
4223
|
class: "mbc__close",
|
|
4243
4224
|
type: "button",
|
|
4244
4225
|
title: "关掉 magic block 管理台(Esc)",
|
|
4245
4226
|
onClick: t[44] || (t[44] = (l) => b.value = !1)
|
|
4246
|
-
}, "×")) :
|
|
4247
|
-
], 2)) :
|
|
4227
|
+
}, "×")) : C("", !0)
|
|
4228
|
+
], 2)) : C("", !0);
|
|
4248
4229
|
}
|
|
4249
|
-
}),
|
|
4230
|
+
}), Xu = /* @__PURE__ */ gn(Su, [["__scopeId", "data-v-05c2e9c9"]]), Cu = ["aria-label"], Eu = ["srcdoc"], Bu = { class: "mbd__head" }, Tu = { class: "mbd__title" }, Au = {
|
|
4250
4231
|
key: 0,
|
|
4251
4232
|
class: "mbd__body"
|
|
4252
|
-
},
|
|
4233
|
+
}, Mu = {
|
|
4253
4234
|
key: 1,
|
|
4254
4235
|
class: "mbd__fields"
|
|
4255
|
-
},
|
|
4236
|
+
}, Ou = ["data-field"], ju = { class: "mbd__label" }, Du = {
|
|
4256
4237
|
key: 0,
|
|
4257
4238
|
class: "mbd__req"
|
|
4258
|
-
},
|
|
4239
|
+
}, Ru = ["onUpdate:modelValue", "placeholder"], Lu = ["onUpdate:modelValue"], Pu = ["value"], Iu = {
|
|
4259
4240
|
key: 2,
|
|
4260
4241
|
class: "mbd__check"
|
|
4261
|
-
},
|
|
4242
|
+
}, Nu = ["onUpdate:modelValue"], qu = { class: "mbd__checktext" }, zu = ["onUpdate:modelValue", "type", "placeholder"], Fu = {
|
|
4262
4243
|
key: 4,
|
|
4263
4244
|
class: "mbd__hint"
|
|
4264
|
-
},
|
|
4245
|
+
}, Uu = {
|
|
4265
4246
|
key: 5,
|
|
4266
4247
|
class: "mbd__hint mbd__hint--bad"
|
|
4267
|
-
},
|
|
4248
|
+
}, Hu = { class: "mbd__foot" }, Wu = ["onClick"], Ku = /* @__PURE__ */ Ce({
|
|
4268
4249
|
__name: "MagicBlockDialogs",
|
|
4269
4250
|
setup(n) {
|
|
4270
|
-
const { current: e } =
|
|
4251
|
+
const { current: e } = Wl(), s = j(null), o = j(null), r = j(null), c = j({}), u = j({}), b = j([]), h = /* @__PURE__ */ new Map(), v = j(0);
|
|
4271
4252
|
let _ = null, y = null;
|
|
4272
|
-
const g =
|
|
4253
|
+
const g = z(() => e.value?.options.mode === "html"), k = z(() => e.value?.options.fields ?? []), w = z(() => e.value?.options.buttons ?? []), E = z(() => {
|
|
4273
4254
|
const B = {}, M = e.value?.options.size;
|
|
4274
4255
|
return !g.value || !M || (M.width && (B.width = M.width), M.height ? B.height = M.height : v.value > 0 && (B.height = `${v.value}px`)), B;
|
|
4275
|
-
}), R =
|
|
4256
|
+
}), R = z(() => e.value?.options.title || "弹窗");
|
|
4276
4257
|
Dt(() => e.value?.id, (B, M) => {
|
|
4277
4258
|
M !== void 0 && h.set(M, { text: { ...c.value }, checked: { ...u.value } });
|
|
4278
|
-
for (const D of [...h.keys()])
|
|
4259
|
+
for (const D of [...h.keys()]) Kl(D) || h.delete(D);
|
|
4279
4260
|
b.value = [], v.value = 0, L();
|
|
4280
4261
|
const S = B === void 0 ? void 0 : h.get(B);
|
|
4281
4262
|
c.value = S ? { ...S.text } : Object.fromEntries(k.value.map((D) => [D.name, typeof D.value == "string" ? D.value : ""])), u.value = S ? { ...S.checked } : Object.fromEntries(k.value.map((D) => [D.name, D.value === !0])), M === void 0 && (_ = document.activeElement ?? null), on().then(() => {
|
|
@@ -4289,7 +4270,7 @@ ${t.text}`).join(`
|
|
|
4289
4270
|
const B = e.value, M = r.value;
|
|
4290
4271
|
!B || !M || !B.mountBridge || (y = B.mountBridge(M, {
|
|
4291
4272
|
onDone: (S) => {
|
|
4292
|
-
|
|
4273
|
+
Gl(B, S);
|
|
4293
4274
|
},
|
|
4294
4275
|
// 🔴 只认当前这一个弹窗报的高度(换弹窗之后旧那一格的最后一发才回来的话,不能拿去定新面板的高度)。
|
|
4295
4276
|
onHeight: (S) => {
|
|
@@ -4311,25 +4292,25 @@ ${t.text}`).join(`
|
|
|
4311
4292
|
if (!M) return;
|
|
4312
4293
|
if (B.key === "Escape") {
|
|
4313
4294
|
if (g.value) return;
|
|
4314
|
-
B.preventDefault(),
|
|
4295
|
+
B.preventDefault(), Xe(M, "escape");
|
|
4315
4296
|
return;
|
|
4316
4297
|
}
|
|
4317
4298
|
if (B.key !== "Tab" || g.value) return;
|
|
4318
4299
|
const S = V();
|
|
4319
4300
|
if (S.length === 0) return;
|
|
4320
|
-
const D = S[0],
|
|
4321
|
-
!B.shiftKey && lt ===
|
|
4301
|
+
const D = S[0], ht = S[S.length - 1], lt = document.activeElement;
|
|
4302
|
+
!B.shiftKey && lt === ht ? (B.preventDefault(), D.focus()) : B.shiftKey && (lt === D || lt === o.value) && (B.preventDefault(), ht.focus());
|
|
4322
4303
|
}
|
|
4323
|
-
function
|
|
4304
|
+
function vt(B) {
|
|
4324
4305
|
const M = e.value;
|
|
4325
|
-
!M || B.target !== s.value ||
|
|
4306
|
+
!M || B.target !== s.value || Xe(M, "backdrop");
|
|
4326
4307
|
}
|
|
4327
4308
|
function P(B) {
|
|
4328
4309
|
B.target === s.value && B.preventDefault();
|
|
4329
4310
|
}
|
|
4330
4311
|
function Pt(B, M) {
|
|
4331
4312
|
if (M.primary) {
|
|
4332
|
-
const S = k.value.filter((D) => D.required &&
|
|
4313
|
+
const S = k.value.filter((D) => D.required && ft(D));
|
|
4333
4314
|
if (S.length > 0) {
|
|
4334
4315
|
b.value = S.map((lt) => lt.name);
|
|
4335
4316
|
const D = S[0]?.name ?? "";
|
|
@@ -4337,9 +4318,9 @@ ${t.text}`).join(`
|
|
|
4337
4318
|
return;
|
|
4338
4319
|
}
|
|
4339
4320
|
}
|
|
4340
|
-
|
|
4321
|
+
Vl(B, M.id, St());
|
|
4341
4322
|
}
|
|
4342
|
-
function
|
|
4323
|
+
function ft(B) {
|
|
4343
4324
|
return B.type === "checkbox" ? u.value[B.name] !== !0 : (c.value[B.name] ?? "").trim() === "";
|
|
4344
4325
|
}
|
|
4345
4326
|
function St() {
|
|
@@ -4353,16 +4334,16 @@ ${t.text}`).join(`
|
|
|
4353
4334
|
return Dt(e, (B, M) => {
|
|
4354
4335
|
B || !M || (L(), _ && _.isConnected && _.focus(), _ = null);
|
|
4355
4336
|
}), fn(() => {
|
|
4356
|
-
|
|
4337
|
+
Un(!0), window.addEventListener("keydown", et);
|
|
4357
4338
|
}), hn(() => {
|
|
4358
|
-
window.removeEventListener("keydown", et), L(),
|
|
4339
|
+
window.removeEventListener("keydown", et), L(), Un(!1);
|
|
4359
4340
|
}), (B, M) => G(e) ? (d(), p("div", {
|
|
4360
4341
|
key: 0,
|
|
4361
4342
|
ref_key: "mask",
|
|
4362
4343
|
ref: s,
|
|
4363
4344
|
class: "mbd",
|
|
4364
4345
|
role: "presentation",
|
|
4365
|
-
onClick:
|
|
4346
|
+
onClick: vt,
|
|
4366
4347
|
onWheel: P
|
|
4367
4348
|
}, [
|
|
4368
4349
|
a("div", {
|
|
@@ -4379,138 +4360,138 @@ ${t.text}`).join(`
|
|
|
4379
4360
|
ref_key: "frame",
|
|
4380
4361
|
ref: r,
|
|
4381
4362
|
class: "mbd__frame",
|
|
4382
|
-
style: vn(
|
|
4363
|
+
style: vn(E.value),
|
|
4383
4364
|
srcdoc: G(e).doc,
|
|
4384
4365
|
sandbox: "allow-scripts allow-forms allow-modals allow-popups allow-downloads",
|
|
4385
4366
|
title: "magic block 的弹窗"
|
|
4386
|
-
}, null, 12,
|
|
4387
|
-
a("header",
|
|
4388
|
-
a("strong",
|
|
4367
|
+
}, null, 12, Eu)) : (d(), p(A, { key: 1 }, [
|
|
4368
|
+
a("header", Bu, [
|
|
4369
|
+
a("strong", Tu, f(G(e).options.title || "请确认"), 1),
|
|
4389
4370
|
G(e).options.dismissible ? (d(), p("button", {
|
|
4390
4371
|
key: 0,
|
|
4391
4372
|
class: "mbd__x",
|
|
4392
4373
|
type: "button",
|
|
4393
4374
|
title: "关闭(Esc)",
|
|
4394
4375
|
"aria-label": "关闭",
|
|
4395
|
-
onClick: M[0] || (M[0] = (S) => G(
|
|
4396
|
-
}, "×")) :
|
|
4376
|
+
onClick: M[0] || (M[0] = (S) => G(Xe)(G(e), "escape"))
|
|
4377
|
+
}, "×")) : C("", !0)
|
|
4397
4378
|
]),
|
|
4398
|
-
G(e).options.body ? (d(), p("p",
|
|
4399
|
-
k.value.length > 0 ? (d(), p("div",
|
|
4400
|
-
(d(!0), p(A, null,
|
|
4379
|
+
G(e).options.body ? (d(), p("p", Au, f(G(e).options.body), 1)) : C("", !0),
|
|
4380
|
+
k.value.length > 0 ? (d(), p("div", Mu, [
|
|
4381
|
+
(d(!0), p(A, null, F(k.value, (S) => (d(), p("label", {
|
|
4401
4382
|
key: S.name,
|
|
4402
4383
|
class: Z(["mbd__field", { "is-bad": b.value.includes(S.name) }]),
|
|
4403
4384
|
"data-field": S.name
|
|
4404
4385
|
}, [
|
|
4405
|
-
a("span",
|
|
4386
|
+
a("span", ju, [
|
|
4406
4387
|
x(f(S.label) + " ", 1),
|
|
4407
|
-
S.required ? (d(), p("span",
|
|
4388
|
+
S.required ? (d(), p("span", Du, "必填")) : C("", !0)
|
|
4408
4389
|
]),
|
|
4409
|
-
S.type === "textarea" ?
|
|
4390
|
+
S.type === "textarea" ? mt((d(), p("textarea", {
|
|
4410
4391
|
key: 0,
|
|
4411
4392
|
"onUpdate:modelValue": (D) => c.value[S.name] = D,
|
|
4412
4393
|
class: "p-inputtext mbd__input",
|
|
4413
4394
|
rows: "3",
|
|
4414
4395
|
placeholder: S.placeholder
|
|
4415
|
-
}, null, 8,
|
|
4416
|
-
[
|
|
4417
|
-
]) : S.type === "select" ?
|
|
4396
|
+
}, null, 8, Ru)), [
|
|
4397
|
+
[ae, c.value[S.name]]
|
|
4398
|
+
]) : S.type === "select" ? mt((d(), p("select", {
|
|
4418
4399
|
key: 1,
|
|
4419
4400
|
"onUpdate:modelValue": (D) => c.value[S.name] = D,
|
|
4420
4401
|
class: "p-inputtext mbd__input"
|
|
4421
4402
|
}, [
|
|
4422
|
-
(d(!0), p(A, null,
|
|
4403
|
+
(d(!0), p(A, null, F(S.options, (D) => (d(), p("option", {
|
|
4423
4404
|
key: D.value,
|
|
4424
4405
|
value: D.value
|
|
4425
|
-
}, f(D.label), 9,
|
|
4426
|
-
], 8,
|
|
4427
|
-
[
|
|
4428
|
-
]) : S.type === "checkbox" ? (d(), p("span",
|
|
4429
|
-
|
|
4406
|
+
}, f(D.label), 9, Pu))), 128))
|
|
4407
|
+
], 8, Lu)), [
|
|
4408
|
+
[$l, c.value[S.name]]
|
|
4409
|
+
]) : S.type === "checkbox" ? (d(), p("span", Iu, [
|
|
4410
|
+
mt(a("input", {
|
|
4430
4411
|
"onUpdate:modelValue": (D) => u.value[S.name] = D,
|
|
4431
4412
|
type: "checkbox",
|
|
4432
4413
|
class: "p-checkbox-box"
|
|
4433
|
-
}, null, 8,
|
|
4434
|
-
[
|
|
4414
|
+
}, null, 8, Nu), [
|
|
4415
|
+
[rs, u.value[S.name]]
|
|
4435
4416
|
]),
|
|
4436
|
-
a("span",
|
|
4437
|
-
])) :
|
|
4417
|
+
a("span", qu, f(S.hint || S.label), 1)
|
|
4418
|
+
])) : mt((d(), p("input", {
|
|
4438
4419
|
key: 3,
|
|
4439
4420
|
"onUpdate:modelValue": (D) => c.value[S.name] = D,
|
|
4440
4421
|
class: "p-inputtext mbd__input",
|
|
4441
4422
|
type: S.type === "number" ? "number" : "text",
|
|
4442
4423
|
placeholder: S.placeholder
|
|
4443
|
-
}, null, 8,
|
|
4444
|
-
[
|
|
4424
|
+
}, null, 8, zu)), [
|
|
4425
|
+
[xl, c.value[S.name]]
|
|
4445
4426
|
]),
|
|
4446
|
-
S.hint && S.type !== "checkbox" ? (d(), p("span",
|
|
4447
|
-
b.value.includes(S.name) ? (d(), p("span",
|
|
4448
|
-
], 10,
|
|
4449
|
-
])) :
|
|
4450
|
-
a("footer",
|
|
4451
|
-
(d(!0), p(A, null,
|
|
4427
|
+
S.hint && S.type !== "checkbox" ? (d(), p("span", Fu, f(S.hint), 1)) : C("", !0),
|
|
4428
|
+
b.value.includes(S.name) ? (d(), p("span", Uu, "这一项是必填的")) : C("", !0)
|
|
4429
|
+
], 10, Ou))), 128))
|
|
4430
|
+
])) : C("", !0),
|
|
4431
|
+
a("footer", Hu, [
|
|
4432
|
+
(d(!0), p(A, null, F(w.value, (S) => (d(), p("button", {
|
|
4452
4433
|
key: S.id,
|
|
4453
4434
|
type: "button",
|
|
4454
4435
|
class: Z(["p-button p-button-sm", { "p-button-text": !S.primary, "p-button-danger": S.danger }]),
|
|
4455
4436
|
onClick: (D) => Pt(G(e), S)
|
|
4456
|
-
}, f(S.label), 11,
|
|
4437
|
+
}, f(S.label), 11, Wu))), 128))
|
|
4457
4438
|
])
|
|
4458
4439
|
], 64))
|
|
4459
|
-
], 10,
|
|
4460
|
-
], 544)) :
|
|
4440
|
+
], 10, Cu)
|
|
4441
|
+
], 544)) : C("", !0);
|
|
4461
4442
|
}
|
|
4462
|
-
}),
|
|
4463
|
-
Object.assign(
|
|
4443
|
+
}), Zu = /* @__PURE__ */ gn(Ku, [["__scopeId", "data-v-ccbd4127"]]);
|
|
4444
|
+
Object.assign(Os, { [Ms]: !0 });
|
|
4464
4445
|
export {
|
|
4465
4446
|
we as API_BASE,
|
|
4466
|
-
|
|
4467
|
-
|
|
4447
|
+
$o as BLOCK_BACKEND_FILE,
|
|
4448
|
+
Kt as BLOCK_ENTRY,
|
|
4468
4449
|
Ze as BLOCK_MANIFEST,
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4450
|
+
Ms as BLOCK_PAGE_MARK,
|
|
4451
|
+
Ml as CLIENT_BOOTSTRAP,
|
|
4452
|
+
hs as CLIENT_SOURCE,
|
|
4453
|
+
Al as DIALOG_BOOTSTRAP,
|
|
4473
4454
|
Qe as MANIFEST_KEYS,
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4455
|
+
Yl as MANIFEST_MOVED,
|
|
4456
|
+
Vn as MANIFEST_REQUIRED,
|
|
4457
|
+
In as MAX_DIALOGS,
|
|
4458
|
+
Xu as MagicBlockConsole,
|
|
4459
|
+
Zu as MagicBlockDialogs,
|
|
4460
|
+
Os as MagicBlockPage,
|
|
4480
4461
|
yn as NAME_MAX,
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4462
|
+
Wn as README_OPEN,
|
|
4463
|
+
ie as REQUIRES_KEYS,
|
|
4464
|
+
Kn as REQUIRES_OPEN,
|
|
4465
|
+
ps as STEPS_SOURCE,
|
|
4466
|
+
na as blockPlacementProblems,
|
|
4467
|
+
Ao as buildDialogPreview,
|
|
4468
|
+
Bs as buildPreview,
|
|
4469
|
+
Hn as cancelDialogsOf,
|
|
4470
|
+
bo as checkSelection,
|
|
4471
|
+
Qo as declaredMissing,
|
|
4472
|
+
As as declaredUuidOf,
|
|
4473
|
+
Zo as declaredUuidsOf,
|
|
4474
|
+
Xe as dismissDialog,
|
|
4475
|
+
Fl as doneToResult,
|
|
4476
|
+
Pn as installBridge,
|
|
4477
|
+
El as installSteps,
|
|
4478
|
+
ta as isBlockPage,
|
|
4479
|
+
Kl as isOpenDialog,
|
|
4480
|
+
jo as loadBlockRender,
|
|
4481
|
+
zl as normalizeDialogOptions,
|
|
4482
|
+
Mo as onBlockRenderRefresh,
|
|
4483
|
+
Jl as openHostDialog,
|
|
4484
|
+
co as parseManifest,
|
|
4485
|
+
Oo as refreshBlockRender,
|
|
4486
|
+
Gl as reportFromDialogDoc,
|
|
4487
|
+
la as requiresRouteProblems,
|
|
4488
|
+
Vl as respondDialog,
|
|
4489
|
+
sa as sameRouteShape,
|
|
4490
|
+
ed as setApiBase,
|
|
4491
|
+
Un as setDialogHostReady,
|
|
4492
|
+
Wl as useHostDialogs,
|
|
4493
|
+
Fn as validCssLength,
|
|
4494
|
+
uo as validFileName,
|
|
4495
|
+
lo as validName,
|
|
4496
|
+
po as validateBlock
|
|
4516
4497
|
};
|