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