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