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