@webx-ui/module-blocks 0.10.3 → 0.10.5
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/index.js +1242 -1175
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { WxCodeEditor as Qe, WxText as
|
|
2
|
-
import { defineComponent as oe, ref as
|
|
3
|
-
import { useAdmin as at, useTranslate as de, useErrorText as it, WxDate as
|
|
4
|
-
import { useRoute as
|
|
5
|
-
import { WxScreenRenderer as
|
|
6
|
-
import { autocompletion as
|
|
7
|
-
import { EditorState as
|
|
8
|
-
import { VueDraggable as
|
|
9
|
-
const
|
|
1
|
+
import { WxCodeEditor as Qe, WxText as Y, WxIcon as we, WxSkeleton as He, WxBadge as ye, WxButton as ce, confirm as vt, toast as X, useElementWidth as gt, WxSegmented as al, WxCard as De, WxPopover as Ml, WxAlert as il, WxTabs as zl, WxTab as Re, WxFormItem as re, WxSelect as St, WxInput as nt, WxTextarea as rl, WxIconPicker as Dl, WxInputNumber as Ft, WxTagsInput as Ht, WxSwitch as Ol, WxActionBar as Il, useModal as Lt, WxDialog as Bt, WxEmpty as Wt, WxAction as et, WxSortableList as Pl, createModal as Et, WxDrawer as Ul, WxRadioGroup as Rl, WxRadio as Kt, WxSpace as jl, WxSkeletonItem as pt } from "@webx-ui/core";
|
|
2
|
+
import { defineComponent as oe, ref as P, watch as ue, openBlock as d, createElementBlock as w, createVNode as v, unref as n, createBlock as W, withCtx as g, createTextVNode as L, toDisplayString as k, createCommentVNode as B, computed as S, createElementVNode as C, Fragment as F, renderList as Z, onMounted as ot, onBeforeUnmount as st, normalizeStyle as Ie, provide as Nt, inject as Fe, reactive as kt, resolveComponent as Mt, normalizeClass as Ne, withDirectives as Fl, vShow as Hl, isRef as zt, watchEffect as Kl, nextTick as ql, withKeys as qt, withModifiers as Yt, useModel as Yl, getCurrentInstance as Jl, resolveDynamicComponent as Gl, mergeProps as Zl, mergeModels as Xl } from "vue";
|
|
3
|
+
import { useAdmin as at, useTranslate as de, useErrorText as it, WxDate as Ql, WxScreenHead as en, WxRenameButton as tn, WxHelpButton as ln, adminKey as ul, WxRowMenu as nn, WxListScreen as on } from "@webx-ui/module-admin";
|
|
4
|
+
import { useRoute as sn, useRouter as cl } from "vue-router";
|
|
5
|
+
import { WxScreenRenderer as dl, coreTypes as ft } from "@webx-ui/schema";
|
|
6
|
+
import { autocompletion as an, pickedCompletion as Ye, snippetCompletion as ke, startCompletion as rn } from "@codemirror/autocomplete";
|
|
7
|
+
import { EditorState as un } from "@codemirror/state";
|
|
8
|
+
import { VueDraggable as cn } from "vue-draggable-plus";
|
|
9
|
+
const dn = {
|
|
10
10
|
module: {
|
|
11
11
|
title: "Blocks"
|
|
12
12
|
},
|
|
@@ -207,14 +207,14 @@ const un = {
|
|
|
207
207
|
"ok-variables": "Every variable of the template is a field of the schema."
|
|
208
208
|
}
|
|
209
209
|
}, Jt = /* @__PURE__ */ new WeakSet();
|
|
210
|
-
function
|
|
210
|
+
function Me() {
|
|
211
211
|
try {
|
|
212
212
|
const { i18n: e } = at();
|
|
213
|
-
Jt.has(e) || (e.defaults("webx-blocks",
|
|
213
|
+
Jt.has(e) || (e.defaults("webx-blocks", dn), Jt.add(e));
|
|
214
214
|
} catch {
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
const
|
|
217
|
+
const pn = { class: "wx-block-data" }, fn = /* @__PURE__ */ oe({
|
|
218
218
|
__name: "BlockDataField",
|
|
219
219
|
props: {
|
|
220
220
|
modelValue: { default: void 0 },
|
|
@@ -224,36 +224,36 @@ const cn = { class: "wx-block-data" }, dn = /* @__PURE__ */ oe({
|
|
|
224
224
|
emits: ["update:modelValue"],
|
|
225
225
|
setup(e, { emit: l }) {
|
|
226
226
|
const t = e, o = l;
|
|
227
|
-
|
|
228
|
-
const a = de("webx-blocks"), i =
|
|
227
|
+
Me();
|
|
228
|
+
const a = de("webx-blocks"), i = P(r(t.modelValue)), s = P(null);
|
|
229
229
|
function r(m) {
|
|
230
230
|
return m == null ? "" : JSON.stringify(m, null, 2);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function c(m) {
|
|
233
233
|
return m.trim() === "" ? null : JSON.parse(m);
|
|
234
234
|
}
|
|
235
235
|
function u(m) {
|
|
236
236
|
i.value = m;
|
|
237
237
|
try {
|
|
238
|
-
const
|
|
239
|
-
s.value = null, o("update:modelValue",
|
|
240
|
-
} catch (
|
|
241
|
-
s.value = a("components.data-invalid", { error:
|
|
238
|
+
const p = c(m);
|
|
239
|
+
s.value = null, o("update:modelValue", p);
|
|
240
|
+
} catch (p) {
|
|
241
|
+
s.value = a("components.data-invalid", { error: p.message });
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
return ue(
|
|
245
245
|
() => t.modelValue,
|
|
246
246
|
(m) => {
|
|
247
|
-
let
|
|
247
|
+
let p = !1;
|
|
248
248
|
try {
|
|
249
|
-
|
|
249
|
+
p = JSON.stringify(c(i.value)) === JSON.stringify(m ?? null);
|
|
250
250
|
} catch {
|
|
251
|
-
|
|
251
|
+
p = !1;
|
|
252
252
|
}
|
|
253
|
-
|
|
253
|
+
p || (i.value = r(m), s.value = null);
|
|
254
254
|
},
|
|
255
255
|
{ deep: !0 }
|
|
256
|
-
), (m,
|
|
256
|
+
), (m, p) => (d(), w("div", pn, [
|
|
257
257
|
v(n(Qe), {
|
|
258
258
|
"model-value": i.value,
|
|
259
259
|
language: "json",
|
|
@@ -263,16 +263,16 @@ const cn = { class: "wx-block-data" }, dn = /* @__PURE__ */ oe({
|
|
|
263
263
|
"max-height": "320px",
|
|
264
264
|
"onUpdate:modelValue": u
|
|
265
265
|
}, null, 8, ["model-value", "lint", "readonly"]),
|
|
266
|
-
s.value ? (
|
|
266
|
+
s.value ? (d(), W(n(Y), {
|
|
267
267
|
key: 0,
|
|
268
268
|
size: "sm",
|
|
269
269
|
tone: "danger"
|
|
270
270
|
}, {
|
|
271
271
|
default: g(() => [
|
|
272
|
-
|
|
272
|
+
L(k(s.value), 1)
|
|
273
273
|
]),
|
|
274
274
|
_: 1
|
|
275
|
-
})) :
|
|
275
|
+
})) : B("", !0)
|
|
276
276
|
]));
|
|
277
277
|
}
|
|
278
278
|
}), se = (e, l) => {
|
|
@@ -280,7 +280,7 @@ const cn = { class: "wx-block-data" }, dn = /* @__PURE__ */ oe({
|
|
|
280
280
|
for (const [o, a] of l)
|
|
281
281
|
t[o] = a;
|
|
282
282
|
return t;
|
|
283
|
-
},
|
|
283
|
+
}, mn = /* @__PURE__ */ se(fn, [["__scopeId", "data-v-b994c835"]]);
|
|
284
284
|
function Ke(e) {
|
|
285
285
|
const l = `${e.apiPath}/blocks`, t = (o) => o.data;
|
|
286
286
|
return {
|
|
@@ -304,10 +304,10 @@ function Ke(e) {
|
|
|
304
304
|
})
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
const
|
|
307
|
+
const hn = { class: "wx-block-checks" }, vn = {
|
|
308
308
|
key: 0,
|
|
309
309
|
class: "wx-block-checks__line is-error"
|
|
310
|
-
},
|
|
310
|
+
}, bn = /* @__PURE__ */ oe({
|
|
311
311
|
__name: "BlockChecks",
|
|
312
312
|
props: {
|
|
313
313
|
file: {},
|
|
@@ -320,41 +320,41 @@ const fn = { class: "wx-block-checks" }, mn = {
|
|
|
320
320
|
const i = new Set(o.value.map((r) => r.code)), s = [];
|
|
321
321
|
return l.file === "template" && (i.has("no-marker") || s.push(t("checks.ok-marker")), i.has("variables-missing") || s.push(t("checks.ok-variables"))), l.file === "styles" && (i.has("stray-selectors") || s.push(t("checks.ok-prefix", { slug: l.slug })), i.has("bare-selectors") || s.push(t("checks.ok-bare")), i.has("media-query") || s.push(t("checks.ok-container"))), s;
|
|
322
322
|
});
|
|
323
|
-
return (i, s) => (
|
|
324
|
-
e.error ? (
|
|
325
|
-
v(n(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
e.error.line !== null ? (
|
|
329
|
-
|
|
330
|
-
], 64)) :
|
|
331
|
-
e.error.where ? (
|
|
332
|
-
|
|
333
|
-
], 64)) :
|
|
323
|
+
return (i, s) => (d(), w("div", hn, [
|
|
324
|
+
e.error ? (d(), w("div", vn, [
|
|
325
|
+
v(n(we), { name: "close-circle" }),
|
|
326
|
+
C("span", null, [
|
|
327
|
+
L(k(e.error.message) + " ", 1),
|
|
328
|
+
e.error.line !== null ? (d(), w(F, { key: 0 }, [
|
|
329
|
+
L(" · " + k(n(t)("page.line", { line: e.error.line })), 1)
|
|
330
|
+
], 64)) : B("", !0),
|
|
331
|
+
e.error.where ? (d(), w(F, { key: 1 }, [
|
|
332
|
+
L(" · " + k(e.error.where), 1)
|
|
333
|
+
], 64)) : B("", !0)
|
|
334
334
|
])
|
|
335
|
-
])) :
|
|
336
|
-
(
|
|
335
|
+
])) : B("", !0),
|
|
336
|
+
(d(!0), w(F, null, Z(o.value, (r) => (d(), w("div", {
|
|
337
337
|
key: r.code,
|
|
338
338
|
class: "wx-block-checks__line is-warning"
|
|
339
339
|
}, [
|
|
340
|
-
v(n(
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
r.line !== null ? (
|
|
344
|
-
|
|
345
|
-
], 64)) :
|
|
340
|
+
v(n(we), { name: "warning" }),
|
|
341
|
+
C("span", null, [
|
|
342
|
+
L(k(r.message) + " ", 1),
|
|
343
|
+
r.line !== null ? (d(), w(F, { key: 0 }, [
|
|
344
|
+
L(" · " + k(n(t)("page.line", { line: r.line })), 1)
|
|
345
|
+
], 64)) : B("", !0)
|
|
346
346
|
])
|
|
347
347
|
]))), 128)),
|
|
348
|
-
(
|
|
348
|
+
(d(!0), w(F, null, Z(a.value, (r) => (d(), w("div", {
|
|
349
349
|
key: r,
|
|
350
350
|
class: "wx-block-checks__line is-ok"
|
|
351
351
|
}, [
|
|
352
|
-
v(n(
|
|
353
|
-
|
|
352
|
+
v(n(we), { name: "check" }),
|
|
353
|
+
C("span", null, k(r), 1)
|
|
354
354
|
]))), 128))
|
|
355
355
|
]));
|
|
356
356
|
}
|
|
357
|
-
}),
|
|
357
|
+
}), Gt = /* @__PURE__ */ se(bn, [["__scopeId", "data-v-e56947a8"]]), gn = { class: "wx-block-history" }, kn = { class: "wx-block-history__number" }, yn = { class: "wx-block-history__who" }, wn = /* @__PURE__ */ oe({
|
|
358
358
|
__name: "BlockHistory",
|
|
359
359
|
props: {
|
|
360
360
|
block: {},
|
|
@@ -362,14 +362,14 @@ const fn = { class: "wx-block-checks" }, mn = {
|
|
|
362
362
|
},
|
|
363
363
|
emits: ["restored"],
|
|
364
364
|
setup(e, { emit: l }) {
|
|
365
|
-
const t = e, o = l, a = at(), i = Ke(a), s = de("webx-blocks"), r = it(),
|
|
365
|
+
const t = e, o = l, a = at(), i = Ke(a), s = de("webx-blocks"), r = it(), c = P(null);
|
|
366
366
|
async function u() {
|
|
367
|
-
|
|
367
|
+
c.value = await i.versions(t.block.id);
|
|
368
368
|
}
|
|
369
369
|
function m(f) {
|
|
370
370
|
return t.block.draft?.number === f.number ? "draft" : t.block.published?.number === f.number ? "live" : "replaced";
|
|
371
371
|
}
|
|
372
|
-
async function
|
|
372
|
+
async function p(f) {
|
|
373
373
|
if (await vt({
|
|
374
374
|
title: s("page.restore-title", { number: f.number }),
|
|
375
375
|
message: s("page.restore-text"),
|
|
@@ -388,75 +388,75 @@ const fn = { class: "wx-block-checks" }, mn = {
|
|
|
388
388
|
() => {
|
|
389
389
|
u();
|
|
390
390
|
}
|
|
391
|
-
), (f, h) => (
|
|
392
|
-
|
|
391
|
+
), (f, h) => (d(), w("div", gn, [
|
|
392
|
+
c.value === null ? (d(), W(n(He), {
|
|
393
393
|
key: 0,
|
|
394
394
|
class: "wx-block-history__ghost",
|
|
395
395
|
rows: 3
|
|
396
|
-
})) : (
|
|
396
|
+
})) : (d(!0), w(F, { key: 1 }, Z(c.value, (x) => (d(), w("div", {
|
|
397
397
|
key: x.number,
|
|
398
398
|
class: "wx-block-history__row"
|
|
399
399
|
}, [
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
v(n(
|
|
400
|
+
C("code", kn, k(n(s)("page.version", { number: x.number })), 1),
|
|
401
|
+
C("div", yn, [
|
|
402
|
+
v(n(Y), null, {
|
|
403
403
|
default: g(() => [
|
|
404
|
-
|
|
404
|
+
L(k(n(s)(`page.version-${m(x)}`)), 1)
|
|
405
405
|
]),
|
|
406
406
|
_: 2
|
|
407
407
|
}, 1024),
|
|
408
|
-
v(n(
|
|
408
|
+
v(n(Y), {
|
|
409
409
|
size: "sm",
|
|
410
410
|
tone: "muted"
|
|
411
411
|
}, {
|
|
412
412
|
default: g(() => [
|
|
413
|
-
x.created_at ? (
|
|
413
|
+
x.created_at ? (d(), W(n(Ql), {
|
|
414
414
|
key: 0,
|
|
415
415
|
value: x.created_at
|
|
416
|
-
}, null, 8, ["value"])) :
|
|
417
|
-
|
|
418
|
-
x.comment ? (
|
|
419
|
-
|
|
420
|
-
], 64)) :
|
|
416
|
+
}, null, 8, ["value"])) : B("", !0),
|
|
417
|
+
L(" · " + k(x.author ?? n(s)(`page.source-${x.source}`)) + " ", 1),
|
|
418
|
+
x.comment ? (d(), w(F, { key: 1 }, [
|
|
419
|
+
L(" · " + k(x.comment), 1)
|
|
420
|
+
], 64)) : B("", !0)
|
|
421
421
|
]),
|
|
422
422
|
_: 2
|
|
423
423
|
}, 1024)
|
|
424
424
|
]),
|
|
425
|
-
m(x) === "draft" ? (
|
|
425
|
+
m(x) === "draft" ? (d(), W(n(ye), {
|
|
426
426
|
key: 0,
|
|
427
427
|
type: "warning",
|
|
428
428
|
dot: ""
|
|
429
429
|
}, {
|
|
430
430
|
default: g(() => [
|
|
431
|
-
|
|
431
|
+
L(k(n(s)("page.version-draft")), 1)
|
|
432
432
|
]),
|
|
433
433
|
_: 1
|
|
434
|
-
})) : m(x) === "live" ? (
|
|
434
|
+
})) : m(x) === "live" ? (d(), W(n(ye), {
|
|
435
435
|
key: 1,
|
|
436
436
|
type: "success",
|
|
437
437
|
dot: ""
|
|
438
438
|
}, {
|
|
439
439
|
default: g(() => [
|
|
440
|
-
|
|
440
|
+
L(k(n(s)("page.version-live")), 1)
|
|
441
441
|
]),
|
|
442
442
|
_: 1
|
|
443
|
-
})) :
|
|
444
|
-
e.canManage && m(x) === "replaced" ? (
|
|
443
|
+
})) : B("", !0),
|
|
444
|
+
e.canManage && m(x) === "replaced" ? (d(), W(n(ce), {
|
|
445
445
|
key: 2,
|
|
446
446
|
size: "sm",
|
|
447
447
|
variant: "outline",
|
|
448
|
-
onClick: (T) =>
|
|
448
|
+
onClick: (T) => p(x)
|
|
449
449
|
}, {
|
|
450
450
|
default: g(() => [
|
|
451
|
-
|
|
451
|
+
L(k(n(s)("page.restore")), 1)
|
|
452
452
|
]),
|
|
453
453
|
_: 1
|
|
454
|
-
}, 8, ["onClick"])) :
|
|
454
|
+
}, 8, ["onClick"])) : B("", !0)
|
|
455
455
|
]))), 128))
|
|
456
456
|
]));
|
|
457
457
|
}
|
|
458
|
-
}),
|
|
459
|
-
function
|
|
458
|
+
}), xn = /* @__PURE__ */ se(wn, [["__scopeId", "data-v-42c6b7ad"]]), tt = "wx-preview-selected", mt = "wx-preview-hover", Zt = "wx-preview-style";
|
|
459
|
+
function pl(e, l) {
|
|
460
460
|
const o = (e.ownerDocument ?? e).createTreeWalker(
|
|
461
461
|
e,
|
|
462
462
|
128
|
|
@@ -472,8 +472,8 @@ function dl(e, l) {
|
|
|
472
472
|
}
|
|
473
473
|
return null;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
476
|
-
const o =
|
|
475
|
+
function fl(e, l, t) {
|
|
476
|
+
const o = pl(e, l);
|
|
477
477
|
if (!o) return !1;
|
|
478
478
|
const a = o.start.parentNode;
|
|
479
479
|
if (!a) return !1;
|
|
@@ -482,40 +482,40 @@ function pl(e, l, t) {
|
|
|
482
482
|
const s = o.end.nextSibling;
|
|
483
483
|
let r = o.start;
|
|
484
484
|
for (; r; ) {
|
|
485
|
-
const
|
|
485
|
+
const p = r.nextSibling, f = r === o.end;
|
|
486
486
|
if (a.removeChild(r), f) break;
|
|
487
|
-
r =
|
|
487
|
+
r = p;
|
|
488
488
|
}
|
|
489
|
-
const
|
|
490
|
-
a.insertBefore(
|
|
489
|
+
const c = i.content, u = Array.from(c.childNodes);
|
|
490
|
+
a.insertBefore(c, s);
|
|
491
491
|
const m = e.defaultView?.webx;
|
|
492
492
|
if (m?.mount)
|
|
493
|
-
for (const
|
|
494
|
-
|
|
493
|
+
for (const p of u)
|
|
494
|
+
p.nodeType === 1 && m.mount(p);
|
|
495
495
|
return !0;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
const t =
|
|
497
|
+
function Dt(e, l) {
|
|
498
|
+
const t = pl(e, l);
|
|
499
499
|
if (!t) return null;
|
|
500
500
|
for (let o = t.start.nextSibling; o && o !== t.end; o = o.nextSibling)
|
|
501
501
|
if (o.nodeType === 1) return o;
|
|
502
502
|
return null;
|
|
503
503
|
}
|
|
504
|
-
function
|
|
505
|
-
|
|
504
|
+
function yt(e, l) {
|
|
505
|
+
Ot(e);
|
|
506
506
|
for (const o of Array.from(e.querySelectorAll(`.${tt}`)))
|
|
507
507
|
o.classList.remove(tt);
|
|
508
508
|
if (l === null) return null;
|
|
509
|
-
const t =
|
|
509
|
+
const t = Dt(e, l);
|
|
510
510
|
return t?.classList.add(tt), t;
|
|
511
511
|
}
|
|
512
|
-
function
|
|
513
|
-
|
|
512
|
+
function Xt(e, l) {
|
|
513
|
+
Ot(e);
|
|
514
514
|
for (const t of Array.from(e.querySelectorAll(`.${mt}`)))
|
|
515
515
|
t.classList.remove(mt);
|
|
516
|
-
l !== null &&
|
|
516
|
+
l !== null && Dt(e, l)?.classList.add(mt);
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Qt(e) {
|
|
519
519
|
let l = e?.nodeType === 1 ? e : e?.parentElement ?? null;
|
|
520
520
|
for (; l; ) {
|
|
521
521
|
let t = 0;
|
|
@@ -533,19 +533,19 @@ function Xt(e) {
|
|
|
533
533
|
}
|
|
534
534
|
return null;
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
|
|
536
|
+
function _n(e, l) {
|
|
537
|
+
Ot(e);
|
|
538
538
|
let t = null;
|
|
539
539
|
function o(s) {
|
|
540
|
-
const r =
|
|
540
|
+
const r = Qt(s.target);
|
|
541
541
|
r === null ? lt(s) : Oe(s), l.select(r);
|
|
542
542
|
}
|
|
543
543
|
function a(s) {
|
|
544
|
-
const r =
|
|
545
|
-
r !== t && (t = r,
|
|
544
|
+
const r = Qt(s.target);
|
|
545
|
+
r !== t && (t = r, Xt(e, r));
|
|
546
546
|
}
|
|
547
547
|
function i() {
|
|
548
|
-
t = null,
|
|
548
|
+
t = null, Xt(e, null);
|
|
549
549
|
}
|
|
550
550
|
return e.addEventListener("click", o, !0), e.addEventListener("auxclick", lt, !0), e.addEventListener("submit", Oe, !0), e.addEventListener("dragstart", Oe, !0), e.addEventListener("mousemove", a, !0), e.addEventListener("mouseleave", i), {
|
|
551
551
|
release() {
|
|
@@ -560,7 +560,7 @@ function lt(e) {
|
|
|
560
560
|
const l = e.target;
|
|
561
561
|
(l?.nodeType === Node.ELEMENT_NODE ? l : l?.parentElement ?? null)?.closest("a[href], area[href]") && e.preventDefault();
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function $n(e) {
|
|
564
564
|
const l = [
|
|
565
565
|
["click", lt],
|
|
566
566
|
["auxclick", lt],
|
|
@@ -574,61 +574,61 @@ function xn(e) {
|
|
|
574
574
|
}
|
|
575
575
|
};
|
|
576
576
|
}
|
|
577
|
-
const ht = "sample",
|
|
578
|
-
function
|
|
579
|
-
let t = e.getElementById(
|
|
580
|
-
t === null && (t = e.createElement("style"), t.id =
|
|
577
|
+
const ht = "sample", Tt = "wx-stage-styles";
|
|
578
|
+
function Sn(e, l) {
|
|
579
|
+
let t = e.getElementById(Tt);
|
|
580
|
+
t === null && (t = e.createElement("style"), t.id = Tt, (e.head ?? e.documentElement).appendChild(t)), t.textContent = l.styles;
|
|
581
581
|
const o = `<!--wx:${ht}-->`, a = l.html.trimStart().startsWith(o) ? l.html : `${o}${l.html}<!--/wx:${ht}-->`;
|
|
582
|
-
return
|
|
582
|
+
return fl(e, ht, a);
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function En(e, l) {
|
|
585
585
|
const t = e.createElement("script");
|
|
586
586
|
t.textContent = l, e.body.appendChild(t);
|
|
587
587
|
}
|
|
588
|
-
function
|
|
589
|
-
if (e.getElementById(
|
|
588
|
+
function Ot(e) {
|
|
589
|
+
if (e.getElementById(Zt)) return;
|
|
590
590
|
const l = e.createElement("style");
|
|
591
|
-
l.id =
|
|
591
|
+
l.id = Zt, l.textContent = `.${tt}{outline:2px solid #427edd;outline-offset:-2px;}.${mt}:not(.${tt}){outline:1px solid #427edd;outline-offset:-1px;cursor:pointer;}`, (e.head ?? e.documentElement).appendChild(l);
|
|
592
592
|
}
|
|
593
|
-
function
|
|
594
|
-
const l = e.base ? `<base href="${
|
|
593
|
+
function ml(e) {
|
|
594
|
+
const l = e.base ? `<base href="${Ct(e.base)}">` : "", t = e.frame ? `<style>${e.frame}</style>` : "", o = e.script && e.runtime ? `<script src="${Ct(e.runtime)}"><\/script><script>${e.script}<\/script>` : "";
|
|
595
595
|
return `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${l}<style>html,body{margin:0}body{container-type:inline-size}</style>${t}<style>${e.styles}</style></head><body>${e.html}${o}</body></html>`;
|
|
596
596
|
}
|
|
597
|
-
const
|
|
598
|
-
function
|
|
599
|
-
const t = new DOMParser().parseFromString(e, "text/html"), o =
|
|
597
|
+
const hl = "<!--wx-thumb-->";
|
|
598
|
+
function Tn(e, l) {
|
|
599
|
+
const t = new DOMParser().parseFromString(e, "text/html"), o = An(t, `wx:${ht}`);
|
|
600
600
|
if (o === null) return null;
|
|
601
601
|
const a = (u) => u === null ? null : new URL(u, new URL(l, location.href)).href, i = [];
|
|
602
602
|
for (const u of Array.from(t.head.children)) {
|
|
603
|
-
const m = u.tagName.toLowerCase(),
|
|
604
|
-
if (m === "style" && u.id !==
|
|
603
|
+
const m = u.tagName.toLowerCase(), p = (u.getAttribute("rel") ?? "").toLowerCase().split(/\s+/);
|
|
604
|
+
if (m === "style" && u.id !== Tt)
|
|
605
605
|
i.push(u.outerHTML);
|
|
606
|
-
else if (m === "link" && (
|
|
606
|
+
else if (m === "link" && (p.includes("stylesheet") || p.includes("preload") && u.getAttribute("as") === "font")) {
|
|
607
607
|
const f = u.cloneNode(!1);
|
|
608
608
|
f.setAttribute("href", a(u.getAttribute("href")) ?? ""), i.push(f.outerHTML);
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
let s =
|
|
611
|
+
let s = hl, r = o.parentElement;
|
|
612
612
|
for (; r !== null && r !== t.body && r !== t.documentElement; ) {
|
|
613
613
|
const u = r.cloneNode(!1);
|
|
614
614
|
u.innerHTML = s, s = u.outerHTML, r = r.parentElement;
|
|
615
615
|
}
|
|
616
|
-
const
|
|
617
|
-
return `<!doctype html><html${
|
|
616
|
+
const c = (u) => Array.from(u.attributes).map((m) => ` ${m.name}="${Ct(m.value)}"`).join("");
|
|
617
|
+
return `<!doctype html><html${c(t.documentElement)}><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${i.join("")}</head><body${c(t.body)}>${s}</body></html>`;
|
|
618
618
|
}
|
|
619
619
|
function Cn(e, l) {
|
|
620
|
-
return e.replace("</head>", () => `<style>${l.styles}</style></head>`).replace(
|
|
620
|
+
return e.replace("</head>", () => `<style>${l.styles}</style></head>`).replace(hl, () => l.html);
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function An(e, l) {
|
|
623
623
|
const t = e.createTreeWalker(e.body ?? e.documentElement, NodeFilter.SHOW_COMMENT);
|
|
624
624
|
for (let o = t.nextNode(); o !== null; o = t.nextNode())
|
|
625
625
|
if (o.data.trim() === l) return o;
|
|
626
626
|
return null;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function Ct(e) {
|
|
629
629
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
630
630
|
}
|
|
631
|
-
const
|
|
631
|
+
const Vn = { class: "wx-block-stage" }, Ln = { class: "wx-block-stage__bar" }, Bn = ["src", "srcdoc", "title"], Wn = /* @__PURE__ */ oe({
|
|
632
632
|
__name: "BlockStage",
|
|
633
633
|
props: {
|
|
634
634
|
html: {},
|
|
@@ -643,24 +643,24 @@ const En = { class: "wx-block-stage" }, Vn = { class: "wx-block-stage__bar" }, A
|
|
|
643
643
|
{ value: 1280, icon: "monitor", ariaLabel: t("page.width-desktop") },
|
|
644
644
|
{ value: 834, icon: "tablet", ariaLabel: t("page.width-tablet") },
|
|
645
645
|
{ value: 390, icon: "smartphone", ariaLabel: t("page.width-phone") }
|
|
646
|
-
]), a =
|
|
646
|
+
]), a = P(1280), i = P(null), s = P(null), r = gt(i), c = P(360), u = P(!1);
|
|
647
647
|
ue([r, o], () => {
|
|
648
648
|
if (u.value || r.value === 0) return;
|
|
649
|
-
const D = o.value.find((
|
|
649
|
+
const D = o.value.find((U) => r.value / U.value >= 0.45);
|
|
650
650
|
a.value = (D ?? o.value[o.value.length - 1]).value;
|
|
651
651
|
});
|
|
652
652
|
function m(D) {
|
|
653
653
|
u.value = !0, a.value = D;
|
|
654
654
|
}
|
|
655
|
-
const
|
|
656
|
-
() => l.stage ? void 0 :
|
|
655
|
+
const p = S(() => r.value === 0 ? 1 : Math.min(1, r.value / a.value)), f = S(
|
|
656
|
+
() => l.stage ? void 0 : ml({
|
|
657
657
|
html: l.html,
|
|
658
658
|
styles: l.styles,
|
|
659
659
|
script: l.script,
|
|
660
660
|
runtime: l.runtime,
|
|
661
661
|
base: typeof location > "u" ? null : location.origin + "/"
|
|
662
662
|
})
|
|
663
|
-
), h =
|
|
663
|
+
), h = P(0);
|
|
664
664
|
let x = null;
|
|
665
665
|
ue(
|
|
666
666
|
() => l.script,
|
|
@@ -671,23 +671,23 @@ const En = { class: "wx-block-stage" }, Vn = { class: "wx-block-stage__bar" }, A
|
|
|
671
671
|
function T() {
|
|
672
672
|
const D = s.value?.contentDocument?.body;
|
|
673
673
|
if (!D) return;
|
|
674
|
-
const
|
|
675
|
-
|
|
674
|
+
const U = D.ownerDocument.defaultView, Q = U && parseFloat(U.getComputedStyle(D).marginBottom) || 0, le = D.getBoundingClientRect().bottom + Q + (U?.scrollY ?? 0);
|
|
675
|
+
c.value = Math.max(120, Math.ceil(Math.max(D.scrollHeight, le)));
|
|
676
676
|
}
|
|
677
677
|
let _ = null, b = null;
|
|
678
678
|
function $() {
|
|
679
679
|
_?.release(), _ = null, b?.disconnect(), b = null;
|
|
680
680
|
}
|
|
681
681
|
function R(D) {
|
|
682
|
-
l.stage && (l.script && x !== l.script && (x = l.script,
|
|
682
|
+
l.stage && (l.script && x !== l.script && (x = l.script, En(D, l.script)), Sn(D, { html: l.html, styles: l.styles }));
|
|
683
683
|
}
|
|
684
684
|
function G() {
|
|
685
685
|
$();
|
|
686
686
|
const D = s.value?.contentDocument;
|
|
687
687
|
if (!D?.body) return;
|
|
688
|
-
l.stage && (x = null, _ =
|
|
689
|
-
const
|
|
690
|
-
|
|
688
|
+
l.stage && (x = null, _ = $n(D), R(D)), T();
|
|
689
|
+
const U = D.defaultView?.ResizeObserver;
|
|
690
|
+
U && (b = new U(() => T()), b.observe(D.body));
|
|
691
691
|
}
|
|
692
692
|
ue(
|
|
693
693
|
() => [l.html, l.styles],
|
|
@@ -695,41 +695,41 @@ const En = { class: "wx-block-stage" }, Vn = { class: "wx-block-stage__bar" }, A
|
|
|
695
695
|
const D = s.value?.contentDocument;
|
|
696
696
|
l.stage && D?.body && _ !== null && R(D);
|
|
697
697
|
}
|
|
698
|
-
), ue(r, (D,
|
|
699
|
-
D > 0 &&
|
|
698
|
+
), ue(r, (D, U) => {
|
|
699
|
+
D > 0 && U === 0 && setTimeout(T, 50);
|
|
700
700
|
}), ue(a, () => setTimeout(T, 50)), st($);
|
|
701
701
|
const ee = S(() => ({
|
|
702
702
|
width: `${a.value}px`,
|
|
703
|
-
height: `${
|
|
704
|
-
transform: `scale(${
|
|
703
|
+
height: `${c.value}px`,
|
|
704
|
+
transform: `scale(${p.value})`
|
|
705
705
|
})), ae = S(() => ({
|
|
706
|
-
width: `${Math.round(a.value *
|
|
707
|
-
height: `${Math.round(
|
|
706
|
+
width: `${Math.round(a.value * p.value)}px`,
|
|
707
|
+
height: `${Math.round(c.value * p.value)}px`
|
|
708
708
|
}));
|
|
709
|
-
return (D,
|
|
710
|
-
|
|
711
|
-
v(n(
|
|
709
|
+
return (D, U) => (d(), w("div", Vn, [
|
|
710
|
+
C("div", Ln, [
|
|
711
|
+
v(n(al), {
|
|
712
712
|
"model-value": a.value,
|
|
713
713
|
options: o.value,
|
|
714
714
|
size: "sm",
|
|
715
715
|
"aria-label": n(t)("page.width"),
|
|
716
|
-
"onUpdate:modelValue":
|
|
716
|
+
"onUpdate:modelValue": U[0] || (U[0] = (Q) => m(Number(Q)))
|
|
717
717
|
}, null, 8, ["model-value", "options", "aria-label"])
|
|
718
718
|
]),
|
|
719
|
-
|
|
719
|
+
C("div", {
|
|
720
720
|
ref_key: "box",
|
|
721
721
|
ref: i,
|
|
722
722
|
class: "wx-block-stage__ground"
|
|
723
723
|
}, [
|
|
724
|
-
e.loading && !e.html ? (
|
|
724
|
+
e.loading && !e.html ? (d(), W(n(He), {
|
|
725
725
|
key: 0,
|
|
726
726
|
rows: 3
|
|
727
|
-
})) : (
|
|
727
|
+
})) : (d(), w("div", {
|
|
728
728
|
key: 1,
|
|
729
729
|
class: "wx-block-stage__clip",
|
|
730
730
|
style: Ie(ae.value)
|
|
731
731
|
}, [
|
|
732
|
-
(
|
|
732
|
+
(d(), w("iframe", {
|
|
733
733
|
ref_key: "frame",
|
|
734
734
|
ref: s,
|
|
735
735
|
key: h.value,
|
|
@@ -740,121 +740,121 @@ const En = { class: "wx-block-stage" }, Vn = { class: "wx-block-stage__bar" }, A
|
|
|
740
740
|
sandbox: "allow-same-origin allow-scripts",
|
|
741
741
|
title: n(t)("page.preview"),
|
|
742
742
|
onLoad: G
|
|
743
|
-
}, null, 44,
|
|
743
|
+
}, null, 44, Bn))
|
|
744
744
|
], 4))
|
|
745
745
|
], 512)
|
|
746
746
|
]));
|
|
747
747
|
}
|
|
748
|
-
}),
|
|
749
|
-
function
|
|
748
|
+
}), Nn = /* @__PURE__ */ se(Wn, [["__scopeId", "data-v-3185ee45"]]);
|
|
749
|
+
function vl(e) {
|
|
750
750
|
return typeof e == "object" && e !== null && typeof e.type == "string" && e.type !== "";
|
|
751
751
|
}
|
|
752
752
|
function rt(e) {
|
|
753
|
-
return Array.isArray(e) && e.length > 0 && e.every(
|
|
753
|
+
return Array.isArray(e) && e.length > 0 && e.every(vl);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function At() {
|
|
756
756
|
return (typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID().replace(/-/g, "") : Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2)).slice(0, 12);
|
|
757
757
|
}
|
|
758
|
-
function
|
|
759
|
-
return { key:
|
|
758
|
+
function Mn(e, l = {}) {
|
|
759
|
+
return { key: At(), type: e, values: l };
|
|
760
760
|
}
|
|
761
761
|
function me(e, l) {
|
|
762
|
-
return
|
|
762
|
+
return bl(e, l, null, null);
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function bl(e, l, t, o) {
|
|
765
765
|
for (let a = 0; a < e.length; a++) {
|
|
766
766
|
const i = e[a];
|
|
767
767
|
if (i.key === l) return { node: i, parent: t, field: o, list: e, index: a };
|
|
768
768
|
for (const [s, r] of Object.entries(i.values ?? {}))
|
|
769
769
|
if (rt(r)) {
|
|
770
|
-
const
|
|
771
|
-
if (
|
|
770
|
+
const c = bl(r, l, i, s);
|
|
771
|
+
if (c) return c;
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
774
|
return null;
|
|
775
775
|
}
|
|
776
776
|
function ut(e, l, t = 0, o = null) {
|
|
777
777
|
for (const a of e)
|
|
778
|
-
if (
|
|
778
|
+
if (vl(a)) {
|
|
779
779
|
l(a, t, o);
|
|
780
780
|
for (const i of Object.values(a.values ?? {}))
|
|
781
781
|
rt(i) && ut(i, l, t + 1, a);
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function zn(e, l) {
|
|
785
785
|
let t = 0;
|
|
786
786
|
return ut(e, (o) => {
|
|
787
787
|
o.type === l && t++;
|
|
788
788
|
}), t;
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function Dn(e) {
|
|
791
791
|
let l = 0;
|
|
792
792
|
for (const t of Object.values(e.values ?? {}))
|
|
793
793
|
rt(t) && ut(t, () => l++);
|
|
794
794
|
return l;
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function Ca(e) {
|
|
797
797
|
const l = [];
|
|
798
798
|
return ut(e, (t) => {
|
|
799
799
|
l.includes(t.type) || l.push(t.type);
|
|
800
800
|
}), l;
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function It(e) {
|
|
803
803
|
const l = [];
|
|
804
804
|
for (const t of e)
|
|
805
|
-
t.type === "wx-blocks" && l.push(t), t.children && l.push(...
|
|
805
|
+
t.type === "wx-blocks" && l.push(t), t.children && l.push(...It(t.children));
|
|
806
806
|
return l;
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function gl(e) {
|
|
809
809
|
const l = {};
|
|
810
810
|
for (const [t, o] of Object.entries(e.values ?? {}))
|
|
811
|
-
l[t] = rt(o) ? o.map(
|
|
812
|
-
return e.hidden === !0 ? { key:
|
|
811
|
+
l[t] = rt(o) ? o.map(gl) : Ve(o);
|
|
812
|
+
return e.hidden === !0 ? { key: At(), type: e.type, hidden: !0, values: l } : { key: At(), type: e.type, values: l };
|
|
813
813
|
}
|
|
814
|
-
function
|
|
815
|
-
const o =
|
|
814
|
+
function On(e, l, t) {
|
|
815
|
+
const o = Ve(e), a = me(o, l);
|
|
816
816
|
return a ? (t ? a.node.hidden = !0 : delete a.node.hidden, o) : e;
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function In(e, l, t) {
|
|
819
819
|
if (l === null) return e;
|
|
820
820
|
const o = me(e, l);
|
|
821
821
|
if (!o || t === null) return null;
|
|
822
822
|
const a = o.node.values[t];
|
|
823
823
|
return Array.isArray(a) || (o.node.values[t] = []), o.node.values[t];
|
|
824
824
|
}
|
|
825
|
-
function
|
|
826
|
-
const i =
|
|
825
|
+
function wt(e, l, t, o, a) {
|
|
826
|
+
const i = Ve(e), s = In(i, l, t);
|
|
827
827
|
return s ? (s.splice(Math.max(0, Math.min(o, s.length)), 0, a), i) : e;
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
const t =
|
|
829
|
+
function el(e, l) {
|
|
830
|
+
const t = Ve(e), o = me(t, l);
|
|
831
831
|
return o ? (o.list.splice(o.index, 1), t) : e;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
834
|
-
const o =
|
|
833
|
+
function Pn(e, l, t) {
|
|
834
|
+
const o = Ve(e), a = me(o, l);
|
|
835
835
|
return a ? (a.node.values = t, o) : e;
|
|
836
836
|
}
|
|
837
|
-
function
|
|
838
|
-
if (l === null) return
|
|
839
|
-
const a =
|
|
840
|
-
return !i || t === null ? e : (i.node.values[t] =
|
|
837
|
+
function Un(e, l, t, o) {
|
|
838
|
+
if (l === null) return Ve(o);
|
|
839
|
+
const a = Ve(e), i = me(a, l);
|
|
840
|
+
return !i || t === null ? e : (i.node.values[t] = Ve(o), a);
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function Ve(e) {
|
|
843
843
|
return e === void 0 ? e : JSON.parse(JSON.stringify(e));
|
|
844
844
|
}
|
|
845
|
-
function
|
|
845
|
+
function xt(e) {
|
|
846
846
|
return [
|
|
847
|
-
|
|
848
|
-
|
|
847
|
+
an({ icons: !1 }),
|
|
848
|
+
un.languageData.of(() => [{ autocomplete: e }])
|
|
849
849
|
];
|
|
850
850
|
}
|
|
851
|
-
const
|
|
851
|
+
const Rn = [
|
|
852
852
|
["block", "key, type, version, depth, value()"],
|
|
853
853
|
["entity", "the page or article the block stands on"]
|
|
854
|
-
],
|
|
854
|
+
], jn = ["key", "type", "version", "depth"], kl = ["url", "alt", "title", "path"], Fn = [...kl, "thumb", "name", "extension", "mime", "size", "width", "height"], Hn = ["wx-media"], Kn = ["wx-gallery", "wx-files"], qn = ["items", "groups", "filter"], Yn = {
|
|
855
855
|
items: ["id", "anchor", "categories"],
|
|
856
856
|
groups: ["id", "title", "items"]
|
|
857
|
-
},
|
|
857
|
+
}, Jn = {
|
|
858
858
|
faq: ["question", "answer"],
|
|
859
859
|
services: ["title", "url", "lead", "cover", "fields"],
|
|
860
860
|
reviews: [
|
|
@@ -881,9 +881,60 @@ const Un = [
|
|
|
881
881
|
"nutrients",
|
|
882
882
|
"fields"
|
|
883
883
|
],
|
|
884
|
-
team: ["name", "initials", "job_title", "text", "photo", "socials", "service_links", "fields"]
|
|
885
|
-
|
|
886
|
-
|
|
884
|
+
team: ["name", "initials", "job_title", "text", "photo", "socials", "service_links", "fields"],
|
|
885
|
+
tariffs: [
|
|
886
|
+
"name",
|
|
887
|
+
"badge",
|
|
888
|
+
"price",
|
|
889
|
+
"amount",
|
|
890
|
+
"currency",
|
|
891
|
+
"symbol",
|
|
892
|
+
"period",
|
|
893
|
+
"price_text",
|
|
894
|
+
"features",
|
|
895
|
+
"description",
|
|
896
|
+
"button",
|
|
897
|
+
"featured",
|
|
898
|
+
"service_links",
|
|
899
|
+
"fields"
|
|
900
|
+
]
|
|
901
|
+
}, yl = {
|
|
902
|
+
banners: [
|
|
903
|
+
"id",
|
|
904
|
+
"anchor",
|
|
905
|
+
"place",
|
|
906
|
+
"title",
|
|
907
|
+
"text",
|
|
908
|
+
"image",
|
|
909
|
+
"image_mobile",
|
|
910
|
+
"video",
|
|
911
|
+
"buttons",
|
|
912
|
+
"fields"
|
|
913
|
+
],
|
|
914
|
+
banners_layout: [
|
|
915
|
+
"layout",
|
|
916
|
+
"interval",
|
|
917
|
+
"autoplay",
|
|
918
|
+
"loop",
|
|
919
|
+
"arrows",
|
|
920
|
+
"dots",
|
|
921
|
+
"pause_on_hover",
|
|
922
|
+
"ratio",
|
|
923
|
+
"ratio_mobile",
|
|
924
|
+
"breakpoint",
|
|
925
|
+
"video_on_mobile"
|
|
926
|
+
]
|
|
927
|
+
}, bt = "helper:", Gn = {
|
|
928
|
+
banners: { buttons: ["label", "url", "new_tab", "rel", "variant"] }
|
|
929
|
+
}, Zn = [
|
|
930
|
+
[
|
|
931
|
+
"@foreach banners",
|
|
932
|
+
"@foreach (banners('${place}')->get() as $banner)\n ${}\n@endforeach",
|
|
933
|
+
"the banners of a place"
|
|
934
|
+
],
|
|
935
|
+
["@php banners_layout", "@php($layout = banners_layout('${place}'))", "its layout and options"]
|
|
936
|
+
];
|
|
937
|
+
function Xn({
|
|
887
938
|
schema: e,
|
|
888
939
|
styles: l,
|
|
889
940
|
types: t = () => [],
|
|
@@ -891,38 +942,38 @@ function Jn({
|
|
|
891
942
|
}) {
|
|
892
943
|
return (a) => {
|
|
893
944
|
const i = a.state.sliceDoc(Math.max(0, a.pos - 200), a.pos), s = /<x-webx-block\b[^<>]*?\btype\s*=\s*(["'])([\w-]*)$/.exec(i);
|
|
894
|
-
if (s) return
|
|
945
|
+
if (s) return Qn(a, s[1], s[2], t());
|
|
895
946
|
const r = /\$block->(\w*)$/.exec(i);
|
|
896
|
-
if (r) return
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
947
|
+
if (r) return ao(a, r[1]);
|
|
948
|
+
const c = /\$(\w+)\[\s*(['"]?)(\w*)$/.exec(i);
|
|
949
|
+
if (c) return io(a, c[1], c[2], c[3], e());
|
|
899
950
|
const u = /\$(\w*)$/.exec(i);
|
|
900
951
|
if (u)
|
|
901
952
|
return {
|
|
902
953
|
from: a.pos - u[0].length,
|
|
903
|
-
options:
|
|
954
|
+
options: oo(e(), a.state.doc.toString()),
|
|
904
955
|
validFor: /^\$\w*$/
|
|
905
956
|
};
|
|
906
957
|
const m = /(\{\{|\{!!)(\s*)(\w*)$/.exec(i);
|
|
907
|
-
if (m) return
|
|
908
|
-
const
|
|
909
|
-
if (
|
|
958
|
+
if (m) return so(a, m[1], m[2], m[3], e());
|
|
959
|
+
const p = eo(i);
|
|
960
|
+
if (p !== null) return to(a, p, t(), o);
|
|
910
961
|
const f = /<(x-[\w:-]*)$/.exec(i);
|
|
911
962
|
if (f) {
|
|
912
963
|
const T = a.state.sliceDoc(0, a.pos - f[0].length);
|
|
913
|
-
return
|
|
964
|
+
return lo(a, f[1], no(T), o);
|
|
914
965
|
}
|
|
915
966
|
const h = /\bclass\s*=\s*"([^"]*)$/.exec(i);
|
|
916
|
-
if (h) return
|
|
967
|
+
if (h) return uo(a, h[1], l());
|
|
917
968
|
const x = /(?:^|[\s>(])@(\w*)$/.exec(i);
|
|
918
969
|
return x ? {
|
|
919
970
|
from: a.pos - x[1].length - 1,
|
|
920
|
-
options:
|
|
971
|
+
options: co(e()),
|
|
921
972
|
validFor: /^@\w*$/
|
|
922
973
|
} : null;
|
|
923
974
|
};
|
|
924
975
|
}
|
|
925
|
-
function
|
|
976
|
+
function Qn(e, l, t, o) {
|
|
926
977
|
return o.length === 0 ? null : {
|
|
927
978
|
from: e.pos - t.length,
|
|
928
979
|
options: o.map((a, i) => ({
|
|
@@ -931,13 +982,13 @@ function Yn(e, l, t, o) {
|
|
|
931
982
|
info: a.title,
|
|
932
983
|
type: "type",
|
|
933
984
|
boost: (a.kind === "component" ? 50 : 0) - i / 100,
|
|
934
|
-
apply: (s, r,
|
|
935
|
-
const m = /^[\w-]*/.exec(s.state.sliceDoc(u, u + 64))[0],
|
|
985
|
+
apply: (s, r, c, u) => {
|
|
986
|
+
const m = /^[\w-]*/.exec(s.state.sliceDoc(u, u + 64))[0], p = u + m.length, f = s.state.sliceDoc(p, p + 1) === l, h = `${a.slug}${f ? "" : l}`;
|
|
936
987
|
s.dispatch({
|
|
937
|
-
changes: { from:
|
|
988
|
+
changes: { from: c, to: p, insert: h },
|
|
938
989
|
// Past the closing quote: the attributes come next.
|
|
939
|
-
selection: { anchor:
|
|
940
|
-
annotations:
|
|
990
|
+
selection: { anchor: c + h.length + (f ? 1 : 0) },
|
|
991
|
+
annotations: Ye.of(r),
|
|
941
992
|
userEvent: "input.complete"
|
|
942
993
|
});
|
|
943
994
|
}
|
|
@@ -945,7 +996,7 @@ function Yn(e, l, t, o) {
|
|
|
945
996
|
validFor: /^[\w-]*$/
|
|
946
997
|
};
|
|
947
998
|
}
|
|
948
|
-
function
|
|
999
|
+
function eo(e) {
|
|
949
1000
|
const l = e.lastIndexOf("<x-webx-block");
|
|
950
1001
|
if (l === -1) return null;
|
|
951
1002
|
const t = e.slice(l + 13);
|
|
@@ -957,25 +1008,25 @@ function Gn(e) {
|
|
|
957
1008
|
const i = /\btype\s*=\s*["']([\w-]+)["']/.exec(t);
|
|
958
1009
|
return { attributes: t, type: i?.[1] ?? null, bound: a[1] === ":", word: a[2] };
|
|
959
1010
|
}
|
|
960
|
-
function
|
|
1011
|
+
function to(e, l, t, o) {
|
|
961
1012
|
const a = new Set([...l.attributes.matchAll(/:?([\w-]+)\s*=/g)].map((u) => u[1])), i = e.pos - l.word.length - (l.bound ? 1 : 0), s = () => {
|
|
962
1013
|
const u = [];
|
|
963
|
-
if (a.has("type") || u.push(
|
|
964
|
-
const m = t.find((
|
|
965
|
-
u.push(
|
|
1014
|
+
if (a.has("type") || u.push(_t("type", !1, "reserved", null, 60)), !a.has("fallback") && l.type !== null) {
|
|
1015
|
+
const m = t.find((p) => p.slug === l.type)?.fallback ?? null;
|
|
1016
|
+
u.push(_t("fallback", !1, "reserved", m, -10, m));
|
|
966
1017
|
}
|
|
967
1018
|
return u;
|
|
968
1019
|
}, r = (u) => {
|
|
969
|
-
const
|
|
970
|
-
(f, h) =>
|
|
1020
|
+
const p = [...We(u ?? []).filter((f) => f.type !== "wx-slot" && f.type !== "wx-blocks").filter((f) => !a.has(f.id)).map(
|
|
1021
|
+
(f, h) => _t(f.id, f.type === "wx-data" || l.bound, f.type, f.label, 40 - h)
|
|
971
1022
|
), ...s()];
|
|
972
|
-
return
|
|
1023
|
+
return p.length === 0 || !e.explicit && l.word === "" && !l.bound ? null : { from: i, options: p, validFor: /^:?[\w-]*$/ };
|
|
973
1024
|
};
|
|
974
1025
|
if (l.type === null) return r(null);
|
|
975
|
-
const
|
|
976
|
-
return
|
|
1026
|
+
const c = o(l.type);
|
|
1027
|
+
return c instanceof Promise ? c.then(r, () => r(null)) : r(c);
|
|
977
1028
|
}
|
|
978
|
-
function
|
|
1029
|
+
function _t(e, l, t, o, a, i = null) {
|
|
979
1030
|
const s = `${l ? ":" : ""}${e}`;
|
|
980
1031
|
return {
|
|
981
1032
|
label: s,
|
|
@@ -983,50 +1034,50 @@ function xt(e, l, t, o, a, i = null) {
|
|
|
983
1034
|
info: o ?? void 0,
|
|
984
1035
|
type: "property",
|
|
985
1036
|
boost: a,
|
|
986
|
-
apply: (r,
|
|
987
|
-
const
|
|
1037
|
+
apply: (r, c, u, m) => {
|
|
1038
|
+
const p = `${s}="${i ?? (l ? "$" : "")}"`;
|
|
988
1039
|
r.dispatch({
|
|
989
|
-
changes: { from: u, to: m, insert:
|
|
990
|
-
selection: { anchor: u +
|
|
991
|
-
annotations:
|
|
1040
|
+
changes: { from: u, to: m, insert: p },
|
|
1041
|
+
selection: { anchor: u + p.length - 1 },
|
|
1042
|
+
annotations: Ye.of(c),
|
|
992
1043
|
userEvent: "input.complete"
|
|
993
1044
|
});
|
|
994
1045
|
}
|
|
995
1046
|
};
|
|
996
1047
|
}
|
|
997
|
-
function
|
|
1048
|
+
function lo(e, l, t, o) {
|
|
998
1049
|
const a = e.pos - l.length, i = (r) => {
|
|
999
|
-
const
|
|
1000
|
-
|
|
1050
|
+
const c = [
|
|
1051
|
+
ke('x-webx-block type="${type}" />', {
|
|
1001
1052
|
label: "x-webx-block",
|
|
1002
1053
|
detail: "call a block",
|
|
1003
1054
|
type: "keyword"
|
|
1004
1055
|
})
|
|
1005
1056
|
];
|
|
1006
1057
|
for (const u of We(r ?? []).filter((m) => m.type === "wx-slot"))
|
|
1007
|
-
|
|
1058
|
+
c.push({
|
|
1008
1059
|
label: `x-slot:${u.id}`,
|
|
1009
1060
|
detail: "slot",
|
|
1010
1061
|
info: u.label,
|
|
1011
1062
|
type: "keyword",
|
|
1012
1063
|
boost: 20,
|
|
1013
|
-
apply: (m,
|
|
1064
|
+
apply: (m, p, f, h) => {
|
|
1014
1065
|
const x = `x-slot:${u.id}>`;
|
|
1015
1066
|
m.dispatch({
|
|
1016
1067
|
changes: { from: f, to: h, insert: `${x}</x-slot:${u.id}>` },
|
|
1017
1068
|
selection: { anchor: f + x.length },
|
|
1018
|
-
annotations:
|
|
1069
|
+
annotations: Ye.of(p),
|
|
1019
1070
|
userEvent: "input.complete"
|
|
1020
1071
|
});
|
|
1021
1072
|
}
|
|
1022
1073
|
});
|
|
1023
|
-
return { from: a, options:
|
|
1074
|
+
return { from: a, options: c, validFor: /^x-[\w:-]*$/ };
|
|
1024
1075
|
};
|
|
1025
1076
|
if (t === null) return i(null);
|
|
1026
1077
|
const s = o(t);
|
|
1027
1078
|
return s instanceof Promise ? s.then(i, () => i(null)) : i(s);
|
|
1028
1079
|
}
|
|
1029
|
-
function
|
|
1080
|
+
function no(e) {
|
|
1030
1081
|
const l = [];
|
|
1031
1082
|
for (const t of e.matchAll(
|
|
1032
1083
|
/<x-webx-block\b((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>|<\/x-webx-block\s*>/g
|
|
@@ -1034,40 +1085,40 @@ function Qn(e) {
|
|
|
1034
1085
|
t[0].startsWith("</") ? l.pop() : t[2] !== "/" && l.push(/\btype\s*=\s*["']([\w-]+)["']/.exec(t[1] ?? "")?.[1] ?? null);
|
|
1035
1086
|
return l.at(-1) ?? null;
|
|
1036
1087
|
}
|
|
1037
|
-
function
|
|
1038
|
-
const t =
|
|
1088
|
+
function oo(e, l) {
|
|
1089
|
+
const t = _l(e).map((o, a) => ({
|
|
1039
1090
|
label: `$${o.id}`,
|
|
1040
1091
|
detail: o.type,
|
|
1041
1092
|
info: o.label,
|
|
1042
1093
|
type: "variable",
|
|
1043
1094
|
boost: 50 - a
|
|
1044
1095
|
}));
|
|
1045
|
-
for (const o of
|
|
1096
|
+
for (const o of wl(l).keys())
|
|
1046
1097
|
t.push({ label: `$${o}`, detail: "loop", type: "variable" });
|
|
1047
|
-
for (const [o, a] of
|
|
1098
|
+
for (const [o, a] of Rn)
|
|
1048
1099
|
t.push({ label: `$${o}`, detail: "given", info: a, type: "variable", boost: -10 });
|
|
1049
1100
|
return t.push({ label: "$slot", detail: "given", info: "what the calling tag held", boost: -15 }), t.push({ label: "$loop", detail: "given", info: "inside @foreach", boost: -20 }), t;
|
|
1050
1101
|
}
|
|
1051
|
-
function
|
|
1052
|
-
const i =
|
|
1102
|
+
function so(e, l, t, o, a) {
|
|
1103
|
+
const i = _l(a);
|
|
1053
1104
|
if (i.length === 0) return null;
|
|
1054
1105
|
const s = l === "{{" ? "}}" : "!!}";
|
|
1055
1106
|
return {
|
|
1056
1107
|
from: e.pos - o.length,
|
|
1057
|
-
options: i.map((r,
|
|
1108
|
+
options: i.map((r, c) => ({
|
|
1058
1109
|
label: r.id,
|
|
1059
1110
|
displayLabel: `$${r.id}`,
|
|
1060
1111
|
detail: r.type,
|
|
1061
1112
|
info: r.label,
|
|
1062
1113
|
type: "variable",
|
|
1063
|
-
boost: 50 -
|
|
1064
|
-
apply: (u, m,
|
|
1065
|
-
const h = u.state.sliceDoc(f, f + 8), x = new RegExp(`^\\s*${
|
|
1114
|
+
boost: 50 - c,
|
|
1115
|
+
apply: (u, m, p, f) => {
|
|
1116
|
+
const h = u.state.sliceDoc(f, f + 8), x = new RegExp(`^\\s*${go(s)}`).exec(h), T = x ? /^\s/.test(h) ? "" : " " : ` ${s}`, _ = `${t === "" ? " " : ""}$${r.id}${T}`;
|
|
1066
1117
|
u.dispatch({
|
|
1067
|
-
changes: { from:
|
|
1118
|
+
changes: { from: p, to: f, insert: _ },
|
|
1068
1119
|
// Past the closing braces: the echo is finished, the next thing is the markup.
|
|
1069
|
-
selection: { anchor:
|
|
1070
|
-
annotations:
|
|
1120
|
+
selection: { anchor: p + _.length + (x ? x[0].length : 0) },
|
|
1121
|
+
annotations: Ye.of(m),
|
|
1071
1122
|
userEvent: "input.complete"
|
|
1072
1123
|
});
|
|
1073
1124
|
}
|
|
@@ -1075,12 +1126,12 @@ function to(e, l, t, o, a) {
|
|
|
1075
1126
|
validFor: /^\w*$/
|
|
1076
1127
|
};
|
|
1077
1128
|
}
|
|
1078
|
-
function
|
|
1129
|
+
function ao(e, l) {
|
|
1079
1130
|
return {
|
|
1080
1131
|
from: e.pos - l.length,
|
|
1081
1132
|
options: [
|
|
1082
|
-
...
|
|
1083
|
-
|
|
1133
|
+
...jn.map((t) => ({ label: t, type: "property" })),
|
|
1134
|
+
ke("value('${name}', ${default})", {
|
|
1084
1135
|
label: "value",
|
|
1085
1136
|
detail: "('name', default)",
|
|
1086
1137
|
type: "method"
|
|
@@ -1089,20 +1140,20 @@ function lo(e, l) {
|
|
|
1089
1140
|
validFor: /^\w*$/
|
|
1090
1141
|
};
|
|
1091
1142
|
}
|
|
1092
|
-
function
|
|
1093
|
-
const i =
|
|
1143
|
+
function io(e, l, t, o, a) {
|
|
1144
|
+
const i = ro(l, a, e.state.doc.toString());
|
|
1094
1145
|
return i.length === 0 ? null : {
|
|
1095
1146
|
from: e.pos - o.length,
|
|
1096
1147
|
options: i.map(([s, r]) => ({
|
|
1097
1148
|
label: s,
|
|
1098
1149
|
detail: r,
|
|
1099
1150
|
type: "property",
|
|
1100
|
-
apply: (
|
|
1101
|
-
const f = t ? m - 1 : m, h =
|
|
1102
|
-
|
|
1151
|
+
apply: (c, u, m, p) => {
|
|
1152
|
+
const f = t ? m - 1 : m, h = c.state.sliceDoc(p, p + 2), x = t || "'", T = p + (h.startsWith(x) ? 1 : 0), _ = c.state.sliceDoc(T, T + 1) === "]", b = `${x}${s}${x}${_ ? "" : "]"}`;
|
|
1153
|
+
c.dispatch({
|
|
1103
1154
|
changes: { from: f, to: T, insert: b },
|
|
1104
1155
|
selection: { anchor: f + b.length + (_ ? 1 : 0) },
|
|
1105
|
-
annotations:
|
|
1156
|
+
annotations: Ye.of(u),
|
|
1106
1157
|
userEvent: "input.complete"
|
|
1107
1158
|
});
|
|
1108
1159
|
}
|
|
@@ -1110,99 +1161,115 @@ function no(e, l, t, o, a) {
|
|
|
1110
1161
|
validFor: /^\w*$/
|
|
1111
1162
|
};
|
|
1112
1163
|
}
|
|
1113
|
-
function
|
|
1114
|
-
const o = We(l).find((
|
|
1115
|
-
if (o &&
|
|
1116
|
-
if (o?.type === "wx-collection") return
|
|
1117
|
-
const a =
|
|
1164
|
+
function ro(e, l, t) {
|
|
1165
|
+
const o = We(l).find((c) => c.id === e);
|
|
1166
|
+
if (o && Hn.includes(o.type)) return kl.map((c) => [c, o.type]);
|
|
1167
|
+
if (o?.type === "wx-collection") return qn.map((c) => [c, o.type]);
|
|
1168
|
+
const a = wl(t).get(e), [i, s] = a?.split(".") ?? [];
|
|
1169
|
+
if (i?.startsWith(bt)) {
|
|
1170
|
+
const c = i.slice(bt.length);
|
|
1171
|
+
return ((s ? Gn[c]?.[s] : yl[c]) ?? []).map((m) => [m, `${c}()`]);
|
|
1172
|
+
}
|
|
1173
|
+
const r = i ? We(l).find((c) => c.id === i) : void 0;
|
|
1118
1174
|
if (!r) return [];
|
|
1119
1175
|
if (r.type === "wx-collection") {
|
|
1120
|
-
const
|
|
1121
|
-
return [...
|
|
1176
|
+
const c = typeof r.props?.source == "string" ? r.props.source : r.type, u = s === "items" ? Jn[c] ?? [] : [];
|
|
1177
|
+
return [...Yn[s ?? ""] ?? [], ...u].map((m) => [m, c]);
|
|
1122
1178
|
}
|
|
1123
|
-
return
|
|
1179
|
+
return Kn.includes(r.type) ? Fn.map((c) => [c, r.type]) : r.type === "wx-repeater" ? We(r.children ?? []).map((c) => [c.id, c.type]) : [];
|
|
1124
1180
|
}
|
|
1125
|
-
function
|
|
1181
|
+
function wl(e) {
|
|
1126
1182
|
const l = /* @__PURE__ */ new Map();
|
|
1183
|
+
for (const t of e.matchAll(
|
|
1184
|
+
/\b(\w+)\([^()]*\)(?:->\w+\([^()]*\))*\s+as\s+\$(\w+)|\$(\w+)\s*=\s*(\w+)\(/g
|
|
1185
|
+
)) {
|
|
1186
|
+
const o = t[1] ?? t[4];
|
|
1187
|
+
o in yl && l.set(t[2] ?? t[3], `${bt}${o}`);
|
|
1188
|
+
}
|
|
1127
1189
|
for (const t of e.matchAll(
|
|
1128
1190
|
/\$(\w+)(?:\[\s*['"](\w+)['"]\s*\])?\s+as\s+\$(\w+)(?:\s*=>\s*\$(\w+))?/g
|
|
1129
|
-
))
|
|
1130
|
-
|
|
1191
|
+
)) {
|
|
1192
|
+
const o = t[1], a = l.get(o), i = a?.startsWith(bt) ? a : o;
|
|
1193
|
+
l.set(t[4] ?? t[3], t[2] ? `${i}.${t[2]}` : i);
|
|
1194
|
+
}
|
|
1131
1195
|
return l;
|
|
1132
1196
|
}
|
|
1133
|
-
function
|
|
1197
|
+
function uo(e, l, t) {
|
|
1134
1198
|
const o = /[\w-]*$/.exec(l)[0], a = new Set(l.split(/\s+/));
|
|
1135
1199
|
return {
|
|
1136
1200
|
from: e.pos - o.length,
|
|
1137
|
-
options:
|
|
1201
|
+
options: xl(t).filter((i) => !a.has(i) || i === o).map((i) => ({ label: i, detail: "styles", type: "class" })),
|
|
1138
1202
|
validFor: /^[\w-]*$/
|
|
1139
1203
|
};
|
|
1140
1204
|
}
|
|
1141
|
-
function
|
|
1205
|
+
function co(e) {
|
|
1142
1206
|
const l = We(e).filter((t) => t.type === "wx-blocks");
|
|
1143
1207
|
return [
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1208
|
+
ke("@if (${condition})\n ${}\n@endif", { label: "@if", type: "keyword" }),
|
|
1209
|
+
ke("@isset(${value})\n ${}\n@endisset", { label: "@isset", type: "keyword" }),
|
|
1210
|
+
ke("@foreach (${items} as ${item})\n ${}\n@endforeach", {
|
|
1147
1211
|
label: "@foreach",
|
|
1148
1212
|
type: "keyword"
|
|
1149
1213
|
}),
|
|
1150
|
-
|
|
1214
|
+
ke("@forelse (${items} as ${item})\n ${}\n@empty\n ${}\n@endforelse", {
|
|
1151
1215
|
label: "@forelse",
|
|
1152
1216
|
type: "keyword"
|
|
1153
1217
|
}),
|
|
1154
|
-
|
|
1218
|
+
ke("@unless (${condition})\n ${}\n@endunless", {
|
|
1155
1219
|
label: "@unless",
|
|
1156
1220
|
type: "keyword"
|
|
1157
1221
|
}),
|
|
1158
|
-
|
|
1159
|
-
|
|
1222
|
+
ke("@class([${}])", { label: "@class", type: "keyword" }),
|
|
1223
|
+
ke("@style([${}])", { label: "@style", type: "keyword" }),
|
|
1160
1224
|
...l.map(
|
|
1161
|
-
(t) =>
|
|
1225
|
+
(t) => ke(`@blocks('${t.id}')`, {
|
|
1162
1226
|
label: "@blocks",
|
|
1163
1227
|
detail: `('${t.id}')`,
|
|
1164
1228
|
type: "keyword",
|
|
1165
1229
|
boost: 10
|
|
1166
1230
|
})
|
|
1167
1231
|
),
|
|
1232
|
+
...Zn.map(
|
|
1233
|
+
([t, o, a]) => ke(o, { label: t, info: a, type: "function", boost: -5 })
|
|
1234
|
+
),
|
|
1168
1235
|
...["@elseif", "@else", "@endif", "@endforeach", "@endisset", "@empty", "@endforelse"].map(
|
|
1169
1236
|
(t) => ({ label: t, type: "keyword", boost: -10 })
|
|
1170
1237
|
)
|
|
1171
1238
|
];
|
|
1172
1239
|
}
|
|
1173
|
-
function
|
|
1240
|
+
function po({ slug: e, template: l }) {
|
|
1174
1241
|
return (t) => {
|
|
1175
1242
|
const o = t.state.sliceDoc(Math.max(0, t.pos - 200), t.pos), a = /(?:^|[\s,>+~(}{])\.([\w-]*)$/.exec(o);
|
|
1176
1243
|
if (!a) return null;
|
|
1177
1244
|
const i = /[^{};]*$/.exec(o)[0];
|
|
1178
1245
|
if (/^\s*[\w-]+\s*:\s/.test(i)) return null;
|
|
1179
|
-
const s = `b-${e()}`, r = new Set(
|
|
1180
|
-
label: `.${
|
|
1246
|
+
const s = `b-${e()}`, r = new Set(xl(t.state.doc.toString())), c = fo(l()), u = [s, ...c.filter((p) => p !== s)], m = u.map((p, f) => ({
|
|
1247
|
+
label: `.${p}`,
|
|
1181
1248
|
// A class the template uses and nothing styles yet is the likeliest thing to write.
|
|
1182
|
-
detail: r.has(
|
|
1249
|
+
detail: r.has(p) ? "template" : "template · no rule yet",
|
|
1183
1250
|
type: "class",
|
|
1184
|
-
boost: (r.has(
|
|
1251
|
+
boost: (r.has(p) ? 0 : 20) + (p === s ? 30 : 0) - f / 100
|
|
1185
1252
|
}));
|
|
1186
|
-
for (const
|
|
1187
|
-
u.includes(
|
|
1253
|
+
for (const p of r)
|
|
1254
|
+
u.includes(p) || m.push({ label: `.${p}`, detail: "styles", type: "class" });
|
|
1188
1255
|
return { from: t.pos - a[1].length - 1, options: m, validFor: /^\.[\w-]*$/ };
|
|
1189
1256
|
};
|
|
1190
1257
|
}
|
|
1191
|
-
function
|
|
1258
|
+
function xl(e) {
|
|
1192
1259
|
const l = e.replace(/\/\*[\s\S]*?\*\//g, ""), t = /* @__PURE__ */ new Set(), o = [];
|
|
1193
1260
|
let a = "";
|
|
1194
1261
|
for (const i of l)
|
|
1195
1262
|
if (i === "{") {
|
|
1196
|
-
const s = o.at(-1) ?? [""], r = a.split(",").map((
|
|
1197
|
-
(
|
|
1263
|
+
const s = o.at(-1) ?? [""], r = a.split(",").map((c) => c.trim()).filter((c) => c !== "" && !c.startsWith("@")).flatMap(
|
|
1264
|
+
(c) => c.includes("&") ? s.map((u) => c.replaceAll("&", u)) : s.map((u) => u ? `${u} ${c}` : c)
|
|
1198
1265
|
);
|
|
1199
|
-
for (const
|
|
1200
|
-
for (const u of
|
|
1266
|
+
for (const c of r)
|
|
1267
|
+
for (const u of c.matchAll(/\.(-?[a-zA-Z_][\w-]*)/g)) t.add(u[1]);
|
|
1201
1268
|
o.push(a.trim().startsWith("@") ? s : r.length ? r : s), a = "";
|
|
1202
1269
|
} else i === "}" ? (o.pop(), a = "") : i === ";" ? a = "" : a += i;
|
|
1203
1270
|
return [...t];
|
|
1204
1271
|
}
|
|
1205
|
-
function
|
|
1272
|
+
function fo(e) {
|
|
1206
1273
|
const l = /* @__PURE__ */ new Set();
|
|
1207
1274
|
for (const t of e.matchAll(/\bclass\s*=\s*"([^"]*)"/g)) {
|
|
1208
1275
|
const o = t[1].replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}|@\w+(\([^)]*\))?/g, " ");
|
|
@@ -1211,7 +1278,7 @@ function ro(e) {
|
|
|
1211
1278
|
}
|
|
1212
1279
|
return [...l];
|
|
1213
1280
|
}
|
|
1214
|
-
const
|
|
1281
|
+
const mo = [
|
|
1215
1282
|
{ key: "id", value: '""', info: "The variable the template gets, in snake_case." },
|
|
1216
1283
|
{ key: "type", value: '""', info: "A type from the registry." },
|
|
1217
1284
|
{ key: "label", value: '""', info: "What the editor sees above the field." },
|
|
@@ -1223,49 +1290,49 @@ const uo = [
|
|
|
1223
1290
|
{ key: "slot", value: '""', info: "The parent's named slot to land in." },
|
|
1224
1291
|
{ key: "can", value: '""', info: "The permission the node needs." }
|
|
1225
1292
|
];
|
|
1226
|
-
function
|
|
1293
|
+
function ho({ types: e }) {
|
|
1227
1294
|
return (l) => {
|
|
1228
|
-
const t =
|
|
1295
|
+
const t = vo(l.state.doc.toString(), l.pos);
|
|
1229
1296
|
if (!t || !t.node) return null;
|
|
1230
1297
|
const o = t.string ? l.state.sliceDoc(t.string, l.pos) : /[\w-]*$/.exec(l.state.sliceDoc(Math.max(0, l.pos - 60), l.pos))[0];
|
|
1231
1298
|
if (!t.string && o === "" && !l.explicit) return null;
|
|
1232
1299
|
const a = l.pos - o.length, i = t.string !== null;
|
|
1233
1300
|
if (t.phase === "key") {
|
|
1234
|
-
const s =
|
|
1235
|
-
({ key: r, value:
|
|
1301
|
+
const s = mo.filter(({ key: r }) => !t.keys.has(r) || r === o).map(
|
|
1302
|
+
({ key: r, value: c, info: u }, m) => ({
|
|
1236
1303
|
label: r,
|
|
1237
1304
|
info: u,
|
|
1238
1305
|
type: "property",
|
|
1239
1306
|
boost: -m,
|
|
1240
|
-
apply: (
|
|
1307
|
+
apply: (p, f, h, x) => tl(p, f, h, x, i, `"${r}": ${c}`, c)
|
|
1241
1308
|
})
|
|
1242
1309
|
);
|
|
1243
1310
|
return { from: a, options: s, validFor: /^[\w-]*$/ };
|
|
1244
1311
|
}
|
|
1245
1312
|
if (t.phase === "value" && t.key === "type") {
|
|
1246
|
-
const s = Object.entries(e()).map(([r,
|
|
1313
|
+
const s = Object.entries(e()).map(([r, c]) => ({
|
|
1247
1314
|
label: r,
|
|
1248
|
-
detail:
|
|
1315
|
+
detail: c.kind,
|
|
1249
1316
|
type: "type",
|
|
1250
1317
|
// Fields first: a block's schema is mostly fields, the layout only groups them.
|
|
1251
|
-
boost:
|
|
1252
|
-
apply: (u, m,
|
|
1318
|
+
boost: c.kind === "field" ? 1 : 0,
|
|
1319
|
+
apply: (u, m, p, f) => tl(u, m, p, f, i, `"${r}"`, "")
|
|
1253
1320
|
}));
|
|
1254
1321
|
return { from: a, options: s, validFor: /^[\w-]*$/ };
|
|
1255
1322
|
}
|
|
1256
1323
|
return null;
|
|
1257
1324
|
};
|
|
1258
1325
|
}
|
|
1259
|
-
function
|
|
1260
|
-
const r = a ? t - 1 : t,
|
|
1326
|
+
function tl(e, l, t, o, a, i, s) {
|
|
1327
|
+
const r = a ? t - 1 : t, c = /^[\w-]*"?/.exec(e.state.sliceDoc(o, o + 60))[0], u = o + (a ? c.length : /^[\w-]*/.exec(c)[0].length), m = s === '""' || s === "{}" || s === "[]" ? 1 : 0;
|
|
1261
1328
|
e.dispatch({
|
|
1262
1329
|
changes: { from: r, to: u, insert: i },
|
|
1263
1330
|
selection: { anchor: r + i.length - m },
|
|
1264
|
-
annotations:
|
|
1331
|
+
annotations: Ye.of(l),
|
|
1265
1332
|
userEvent: "input.complete"
|
|
1266
|
-
}), i.startsWith('"type"') &&
|
|
1333
|
+
}), i.startsWith('"type"') && rn(e);
|
|
1267
1334
|
}
|
|
1268
|
-
function
|
|
1335
|
+
function vo(e, l) {
|
|
1269
1336
|
let t = null, o = null, a = null, i = !1;
|
|
1270
1337
|
const s = (r) => r?.kind === "object" && r.parent?.kind === "array" && (r.parent.parent === null || r.parent.under === "children");
|
|
1271
1338
|
for (let r = 0; r <= e.length && (r === l && (o = t?.kind === "object" ? {
|
|
@@ -1275,23 +1342,23 @@ function po(e, l) {
|
|
|
1275
1342
|
keys: t.keys,
|
|
1276
1343
|
string: a ? a.start + 1 : null
|
|
1277
1344
|
} : null), r !== e.length); r++) {
|
|
1278
|
-
const
|
|
1345
|
+
const c = e[r];
|
|
1279
1346
|
if (a) {
|
|
1280
1347
|
if (i) i = !1;
|
|
1281
|
-
else if (
|
|
1282
|
-
else if (
|
|
1348
|
+
else if (c === "\\") i = !0;
|
|
1349
|
+
else if (c === '"' || c === `
|
|
1283
1350
|
`) {
|
|
1284
1351
|
const u = e.slice(a.start + 1, r);
|
|
1285
1352
|
t?.kind === "object" && (a.key ? (t.keys.add(u), t.key = u, t.phase = "colon") : t.phase === "value" && (t.phase = "after")), a = null;
|
|
1286
1353
|
}
|
|
1287
1354
|
continue;
|
|
1288
1355
|
}
|
|
1289
|
-
if (!/\s/.test(
|
|
1290
|
-
if (
|
|
1356
|
+
if (!/\s/.test(c))
|
|
1357
|
+
if (c === '"')
|
|
1291
1358
|
a = { start: r, key: t?.kind === "object" && t.phase === "key" };
|
|
1292
|
-
else if (
|
|
1359
|
+
else if (c === "{" || c === "[") {
|
|
1293
1360
|
const u = {
|
|
1294
|
-
kind:
|
|
1361
|
+
kind: c === "{" ? "object" : "array",
|
|
1295
1362
|
parent: t,
|
|
1296
1363
|
under: t?.kind === "object" ? t.key : null,
|
|
1297
1364
|
keys: /* @__PURE__ */ new Set(),
|
|
@@ -1299,28 +1366,28 @@ function po(e, l) {
|
|
|
1299
1366
|
key: null
|
|
1300
1367
|
};
|
|
1301
1368
|
t?.kind === "object" && (t.phase = "after"), t = u;
|
|
1302
|
-
} else
|
|
1369
|
+
} else c === "}" || c === "]" ? t = t?.parent ?? null : c === ":" ? t?.kind === "object" && (t.phase = "value") : c === "," && t?.kind === "object" && (t.phase = "key", t.key = null);
|
|
1303
1370
|
}
|
|
1304
1371
|
return o;
|
|
1305
1372
|
}
|
|
1306
1373
|
function We(e) {
|
|
1307
1374
|
const l = [];
|
|
1308
1375
|
for (const t of e)
|
|
1309
|
-
!t || typeof t != "object" || (
|
|
1376
|
+
!t || typeof t != "object" || (bo.has(t.type) ? l.push(...We(t.children ?? [])) : typeof t.id == "string" && t.id !== "" && l.push(t));
|
|
1310
1377
|
return l;
|
|
1311
1378
|
}
|
|
1312
|
-
function
|
|
1379
|
+
function _l(e) {
|
|
1313
1380
|
return We(e).filter((l) => l.type !== "wx-blocks");
|
|
1314
1381
|
}
|
|
1315
|
-
const
|
|
1316
|
-
function
|
|
1382
|
+
const bo = /* @__PURE__ */ new Set(["wx-card", "wx-tabs", "wx-tab", "wx-row", "wx-col", "wx-divider"]);
|
|
1383
|
+
function go(e) {
|
|
1317
1384
|
return e.replace(/[.*+?^${}()|[\]\\!]/g, "\\$&");
|
|
1318
1385
|
}
|
|
1319
|
-
const
|
|
1320
|
-
function
|
|
1386
|
+
const ko = ["block", "entity", "loop", "slot", "__env", "errors", "app"];
|
|
1387
|
+
function yo(e, l, t) {
|
|
1321
1388
|
const o = [];
|
|
1322
1389
|
/data-wx-block\s*=/.test(l.template) || o.push({ file: "template", code: "no-marker", line: null, message: t("checks.no-marker") });
|
|
1323
|
-
const a =
|
|
1390
|
+
const a = wo(l.template, l.schema);
|
|
1324
1391
|
a.length > 0 && o.push({
|
|
1325
1392
|
file: "template",
|
|
1326
1393
|
code: "variables-missing",
|
|
@@ -1330,35 +1397,35 @@ function vo(e, l, t) {
|
|
|
1330
1397
|
})
|
|
1331
1398
|
});
|
|
1332
1399
|
const i = [], s = [], r = `.b-${e}`;
|
|
1333
|
-
for (const [m,
|
|
1334
|
-
m.startsWith(r) || m.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(m) ? s.push([m,
|
|
1400
|
+
for (const [m, p] of xo(l.styles))
|
|
1401
|
+
m.startsWith(r) || m.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(m) ? s.push([m, p]) : i.push([m, p]));
|
|
1335
1402
|
i.length > 0 && o.push({
|
|
1336
1403
|
file: "styles",
|
|
1337
1404
|
code: "stray-selectors",
|
|
1338
1405
|
line: i[0][1],
|
|
1339
|
-
message: t("checks.stray-selectors", { slug: e, selectors:
|
|
1406
|
+
message: t("checks.stray-selectors", { slug: e, selectors: ll(i) })
|
|
1340
1407
|
}), s.length > 0 && o.push({
|
|
1341
1408
|
file: "styles",
|
|
1342
1409
|
code: "bare-selectors",
|
|
1343
1410
|
line: s[0][1],
|
|
1344
|
-
message: t("checks.bare-selectors", { selectors:
|
|
1411
|
+
message: t("checks.bare-selectors", { selectors: ll(s) })
|
|
1345
1412
|
});
|
|
1346
|
-
const
|
|
1413
|
+
const c = Sl(l.styles), u = /@media\b/.exec(c);
|
|
1347
1414
|
return u && o.push({
|
|
1348
1415
|
file: "styles",
|
|
1349
1416
|
code: "media-query",
|
|
1350
|
-
line:
|
|
1417
|
+
line: El(c, u.index),
|
|
1351
1418
|
message: t("checks.media-query")
|
|
1352
1419
|
}), o;
|
|
1353
1420
|
}
|
|
1354
|
-
function
|
|
1421
|
+
function $l(e) {
|
|
1355
1422
|
const l = [];
|
|
1356
1423
|
for (const t of e)
|
|
1357
|
-
t.id && l.push(t.id), t.children && l.push(
|
|
1424
|
+
t.id && l.push(t.id), t.children && l.push(...$l(t.children));
|
|
1358
1425
|
return l;
|
|
1359
1426
|
}
|
|
1360
|
-
function
|
|
1361
|
-
const t = /* @__PURE__ */ new Set([
|
|
1427
|
+
function wo(e, l) {
|
|
1428
|
+
const t = /* @__PURE__ */ new Set([...$l(l), ...ko]);
|
|
1362
1429
|
for (const a of e.matchAll(/\bas\s+\$([a-zA-Z_]\w*)(?:\s*=>\s*\$([a-zA-Z_]\w*))?/g))
|
|
1363
1430
|
t.add(a[1]), a[2] && t.add(a[2]);
|
|
1364
1431
|
for (const a of e.matchAll(/\$([a-zA-Z_]\w*)\s*(?:=[^=]|\+\+|--|\.=|\+=|-=)/g))
|
|
@@ -1370,37 +1437,37 @@ function bo(e, l) {
|
|
|
1370
1437
|
}
|
|
1371
1438
|
return o;
|
|
1372
1439
|
}
|
|
1373
|
-
function
|
|
1374
|
-
const l =
|
|
1440
|
+
function xo(e) {
|
|
1441
|
+
const l = Sl(e), t = [];
|
|
1375
1442
|
for (const o of l.matchAll(/([^{};]+)\{/g)) {
|
|
1376
1443
|
const a = o[1], i = a.trim();
|
|
1377
1444
|
if (!(i === "" || i.startsWith("@")))
|
|
1378
1445
|
for (const s of a.split(",")) {
|
|
1379
1446
|
const r = s.trim();
|
|
1380
|
-
r === "" || r === "from" || r === "to" || r.endsWith("%") || t.push([r,
|
|
1447
|
+
r === "" || r === "from" || r === "to" || r.endsWith("%") || t.push([r, El(l, o.index + a.indexOf(r))]);
|
|
1381
1448
|
}
|
|
1382
1449
|
}
|
|
1383
1450
|
return t;
|
|
1384
1451
|
}
|
|
1385
|
-
function
|
|
1452
|
+
function Sl(e) {
|
|
1386
1453
|
return e.replace(/\/\*[\s\S]*?\*\//g, (l) => l.replace(/[^\n]/g, " "));
|
|
1387
1454
|
}
|
|
1388
|
-
function
|
|
1455
|
+
function El(e, l) {
|
|
1389
1456
|
return e.slice(0, Math.max(0, l)).split(`
|
|
1390
1457
|
`).length;
|
|
1391
1458
|
}
|
|
1392
|
-
function
|
|
1459
|
+
function ll(e) {
|
|
1393
1460
|
const l = [...new Set(e.map(([t]) => t))];
|
|
1394
1461
|
return l.slice(0, 3).join(", ") + (l.length > 3 ? ", …" : "");
|
|
1395
1462
|
}
|
|
1396
|
-
const
|
|
1397
|
-
function
|
|
1398
|
-
|
|
1463
|
+
const Pt = /* @__PURE__ */ Symbol("wx-blocks-preview");
|
|
1464
|
+
function Aa(e) {
|
|
1465
|
+
Nt(Pt, e);
|
|
1399
1466
|
}
|
|
1400
|
-
function
|
|
1401
|
-
return Fe(
|
|
1467
|
+
function Va() {
|
|
1468
|
+
return Fe(Pt, null);
|
|
1402
1469
|
}
|
|
1403
|
-
const
|
|
1470
|
+
const nl = /* @__PURE__ */ Symbol("wx-blocks-root"), Tl = /* @__PURE__ */ Symbol("wx-blocks-owner");
|
|
1404
1471
|
function Ut(e) {
|
|
1405
1472
|
return e.map((l) => ({
|
|
1406
1473
|
...l,
|
|
@@ -1418,68 +1485,68 @@ function qe(e, l) {
|
|
|
1418
1485
|
function $e(e) {
|
|
1419
1486
|
return e.kind ?? "block";
|
|
1420
1487
|
}
|
|
1421
|
-
function
|
|
1488
|
+
function Al(e, l) {
|
|
1422
1489
|
return e === 0 ? l("components.not-called") : e === 1 ? l("components.in-block") : l("components.in-blocks", { count: e });
|
|
1423
1490
|
}
|
|
1424
|
-
const
|
|
1425
|
-
function
|
|
1491
|
+
const _o = /* @__PURE__ */ new Set(["wx-card", "wx-tabs", "wx-tab", "wx-row", "wx-col", "wx-divider"]);
|
|
1492
|
+
function Rt(e) {
|
|
1426
1493
|
const l = [];
|
|
1427
1494
|
for (const t of e)
|
|
1428
|
-
!t || typeof t != "object" || (
|
|
1495
|
+
!t || typeof t != "object" || (_o.has(t.type) ? l.push(...Rt(t.children ?? [])) : typeof t.id == "string" && t.id !== "" && l.push(t));
|
|
1429
1496
|
return l;
|
|
1430
1497
|
}
|
|
1431
|
-
function
|
|
1432
|
-
const a =
|
|
1433
|
-
for (const
|
|
1434
|
-
if (
|
|
1435
|
-
const u = t[
|
|
1498
|
+
function $o(e, l, t = {}, o = null) {
|
|
1499
|
+
const a = Rt(l), i = [`type="${e}"`];
|
|
1500
|
+
for (const c of a) {
|
|
1501
|
+
if (c.type === "wx-slot" || c.type === "wx-blocks") continue;
|
|
1502
|
+
const u = t[c.id];
|
|
1436
1503
|
i.push(
|
|
1437
|
-
|
|
1504
|
+
c.type !== "wx-data" && (typeof u == "string" || typeof u == "number") ? `${c.id}="${String(u).replace(/"/g, """)}"` : `:${c.id}="$${So(c.id)}"`
|
|
1438
1505
|
);
|
|
1439
1506
|
}
|
|
1440
1507
|
o && i.push(`fallback="${o}"`);
|
|
1441
|
-
const s = a.filter((
|
|
1508
|
+
const s = a.filter((c) => c.type === "wx-slot"), r = `<x-webx-block ${i.join(" ")}`;
|
|
1442
1509
|
return s.length === 0 ? `${r} />` : [
|
|
1443
1510
|
`${r}>`,
|
|
1444
|
-
...s.map((
|
|
1511
|
+
...s.map((c) => ` <x-slot:${c.id}>…</x-slot:${c.id}>`),
|
|
1445
1512
|
"</x-webx-block>"
|
|
1446
1513
|
].join(`
|
|
1447
1514
|
`);
|
|
1448
1515
|
}
|
|
1449
|
-
function
|
|
1516
|
+
function So(e) {
|
|
1450
1517
|
return e.replace(/-(\w)/g, (l, t) => t.toUpperCase());
|
|
1451
1518
|
}
|
|
1452
|
-
const
|
|
1519
|
+
const Eo = { class: "wx-block-editor" }, To = { class: "wx-block-editor__split" }, Co = {
|
|
1453
1520
|
type: "button",
|
|
1454
1521
|
class: "wx-block-editor__uses"
|
|
1455
|
-
},
|
|
1522
|
+
}, Ao = { class: "wx-block-editor__usage" }, Vo = {
|
|
1456
1523
|
key: 0,
|
|
1457
1524
|
class: "wx-block-editor__use"
|
|
1458
|
-
},
|
|
1525
|
+
}, Lo = { class: "wx-block-editor__pane" }, Bo = {
|
|
1459
1526
|
key: 0,
|
|
1460
1527
|
class: "wx-block-editor__pills"
|
|
1461
|
-
},
|
|
1528
|
+
}, Wo = ["disabled", "onClick", "textContent"], No = { class: "wx-block-editor__call-tag" }, Mo = { key: 0 }, zo = {
|
|
1462
1529
|
key: 0,
|
|
1463
1530
|
class: "wx-block-editor__shape-fields"
|
|
1464
|
-
},
|
|
1531
|
+
}, Do = { class: "wx-block-editor__shape-type" }, Oo = { class: "wx-block-editor__pane" }, Io = { class: "wx-block-editor__pane" }, Po = { class: "wx-block-editor__note" }, Uo = { class: "wx-block-editor__split" }, Ro = { class: "wx-block-editor__pane" }, jo = { class: "wx-block-editor__note" }, Fo = { class: "wx-block-editor__settings" }, Ho = {
|
|
1465
1532
|
key: 5,
|
|
1466
1533
|
class: "is-wide wx-block-editor__danger"
|
|
1467
|
-
},
|
|
1534
|
+
}, Ko = /* @__PURE__ */ oe({
|
|
1468
1535
|
__name: "BlockEditorPage",
|
|
1469
1536
|
props: {
|
|
1470
1537
|
base: { default: "/blocks" }
|
|
1471
1538
|
},
|
|
1472
1539
|
setup(e) {
|
|
1473
|
-
const l = e, t = at(), o = Ke(t), a =
|
|
1474
|
-
|
|
1475
|
-
const s = de("webx-blocks"), r = it(),
|
|
1476
|
-
const
|
|
1540
|
+
const l = e, t = at(), o = Ke(t), a = sn(), i = cl();
|
|
1541
|
+
Me();
|
|
1542
|
+
const s = de("webx-blocks"), r = it(), c = S(() => Number(a.params.id)), u = P(null), m = P([]), p = P(!0), f = P(!1), h = P(!1), x = P("template"), T = S(() => {
|
|
1543
|
+
const E = t.state.manifest?.modules.find((y) => y.id === "blocks")?.meta;
|
|
1477
1544
|
return {
|
|
1478
|
-
groups:
|
|
1479
|
-
editing:
|
|
1480
|
-
provides:
|
|
1545
|
+
groups: E?.groups ?? [],
|
|
1546
|
+
editing: E?.editing ?? !0,
|
|
1547
|
+
provides: E?.provides ?? []
|
|
1481
1548
|
};
|
|
1482
|
-
}), _ = S(() => t.can("blocks.manage") && T.value.editing), b =
|
|
1549
|
+
}), _ = S(() => t.can("blocks.manage") && T.value.editing), b = kt({
|
|
1483
1550
|
kind: "block",
|
|
1484
1551
|
slug: "",
|
|
1485
1552
|
title: "",
|
|
@@ -1492,8 +1559,8 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
|
|
|
1492
1559
|
max_per_entity: null,
|
|
1493
1560
|
is_enabled: !0
|
|
1494
1561
|
});
|
|
1495
|
-
|
|
1496
|
-
|
|
1562
|
+
Nt(
|
|
1563
|
+
Tl,
|
|
1497
1564
|
S(
|
|
1498
1565
|
() => u.value ? {
|
|
1499
1566
|
...u.value,
|
|
@@ -1503,33 +1570,33 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
|
|
|
1503
1570
|
} : null
|
|
1504
1571
|
)
|
|
1505
1572
|
);
|
|
1506
|
-
const $ =
|
|
1573
|
+
const $ = kt({
|
|
1507
1574
|
schema: [],
|
|
1508
1575
|
template: "",
|
|
1509
1576
|
styles: "",
|
|
1510
1577
|
script: null,
|
|
1511
1578
|
sample: {}
|
|
1512
|
-
}), R =
|
|
1579
|
+
}), R = P("[]"), G = P(null), ee = P(""), ae = P({}), D = P(null), U = kt({
|
|
1513
1580
|
html: "",
|
|
1514
1581
|
styles: "",
|
|
1515
1582
|
script: null,
|
|
1516
1583
|
runtime: null,
|
|
1517
1584
|
stage: null,
|
|
1518
1585
|
loading: !1
|
|
1519
|
-
}), Q = S(() => JSON.stringify({ settings: b, content: $ })), le = S(() => ee.value !== "" && Q.value !== ee.value), Se = S(() =>
|
|
1520
|
-
async function
|
|
1586
|
+
}), Q = S(() => JSON.stringify({ settings: b, content: $ })), le = S(() => ee.value !== "" && Q.value !== ee.value), Se = S(() => yo(b.slug, $, s)), he = P([]), ne = /* @__PURE__ */ new Map(), xe = /* @__PURE__ */ new Map();
|
|
1587
|
+
async function Le() {
|
|
1521
1588
|
try {
|
|
1522
|
-
const
|
|
1589
|
+
const E = await o.index();
|
|
1523
1590
|
ne.clear();
|
|
1524
|
-
for (const y of
|
|
1591
|
+
for (const y of E.blocks) ne.set(y.slug, y.id);
|
|
1525
1592
|
he.value = [
|
|
1526
|
-
...
|
|
1593
|
+
...E.blocks.map((y) => ({
|
|
1527
1594
|
slug: y.slug,
|
|
1528
1595
|
title: y.title,
|
|
1529
1596
|
kind: $e(y),
|
|
1530
|
-
fallback:
|
|
1597
|
+
fallback: E.declared.find((K) => K.slug === y.slug)?.fallback ?? null
|
|
1531
1598
|
})),
|
|
1532
|
-
...
|
|
1599
|
+
...E.declared.filter((y) => !y.customised).map((y) => ({
|
|
1533
1600
|
slug: y.slug,
|
|
1534
1601
|
title: y.title,
|
|
1535
1602
|
kind: "component",
|
|
@@ -1539,20 +1606,20 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
|
|
|
1539
1606
|
} catch {
|
|
1540
1607
|
}
|
|
1541
1608
|
}
|
|
1542
|
-
function ze(
|
|
1543
|
-
if (
|
|
1544
|
-
const y = ne.get(
|
|
1609
|
+
function ze(E) {
|
|
1610
|
+
if (E === b.slug) return $.schema;
|
|
1611
|
+
const y = ne.get(E);
|
|
1545
1612
|
if (y === void 0) return null;
|
|
1546
|
-
let K =
|
|
1613
|
+
let K = xe.get(E);
|
|
1547
1614
|
return K === void 0 && (K = o.get(y).then(
|
|
1548
|
-
(
|
|
1615
|
+
(N) => N.content?.schema ?? null,
|
|
1549
1616
|
() => null
|
|
1550
|
-
),
|
|
1617
|
+
), xe.set(E, K)), K;
|
|
1551
1618
|
}
|
|
1552
|
-
const
|
|
1619
|
+
const _e = {
|
|
1553
1620
|
template: [
|
|
1554
|
-
|
|
1555
|
-
|
|
1621
|
+
xt(
|
|
1622
|
+
Xn({
|
|
1556
1623
|
schema: () => $.schema,
|
|
1557
1624
|
styles: () => $.styles,
|
|
1558
1625
|
types: () => he.value,
|
|
@@ -1561,78 +1628,78 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
|
|
|
1561
1628
|
)
|
|
1562
1629
|
],
|
|
1563
1630
|
styles: [
|
|
1564
|
-
|
|
1631
|
+
xt(po({ slug: () => b.slug, template: () => $.template }))
|
|
1565
1632
|
],
|
|
1566
1633
|
// The renderer's own types under the panel's, the same merge the sample form is drawn with.
|
|
1567
|
-
schema: [
|
|
1634
|
+
schema: [xt(ho({ types: () => ({ ...ft, ...t.types }) }))]
|
|
1568
1635
|
}, ie = S(() => {
|
|
1569
|
-
const
|
|
1570
|
-
return
|
|
1636
|
+
const E = [...T.value.groups];
|
|
1637
|
+
return E.includes(b.group) || E.push(b.group), E.map((y) => ({ value: y, label: qe(y, s) }));
|
|
1571
1638
|
}), ve = S({
|
|
1572
1639
|
get: () => $.sample,
|
|
1573
|
-
set: (
|
|
1574
|
-
$.sample =
|
|
1640
|
+
set: (E) => {
|
|
1641
|
+
$.sample = E;
|
|
1575
1642
|
}
|
|
1576
|
-
}),
|
|
1577
|
-
function
|
|
1643
|
+
}), Ee = S(() => M($.schema));
|
|
1644
|
+
function M(E) {
|
|
1578
1645
|
const y = [];
|
|
1579
|
-
for (const K of
|
|
1580
|
-
K.type !== "wx-blocks" && !(K.children?.length && !K.name) && y.push(K.id), K.children && y.push(...
|
|
1646
|
+
for (const K of E)
|
|
1647
|
+
K.type !== "wx-blocks" && !(K.children?.length && !K.name) && y.push(K.id), K.children && y.push(...M(K.children));
|
|
1581
1648
|
return y;
|
|
1582
1649
|
}
|
|
1583
|
-
function j(
|
|
1584
|
-
u.value =
|
|
1585
|
-
kind: $e(
|
|
1586
|
-
slug:
|
|
1587
|
-
title:
|
|
1588
|
-
description:
|
|
1589
|
-
icon:
|
|
1590
|
-
group:
|
|
1591
|
-
sort:
|
|
1592
|
-
allow:
|
|
1593
|
-
allowed_in:
|
|
1594
|
-
max_per_entity:
|
|
1595
|
-
is_enabled:
|
|
1650
|
+
function j(E) {
|
|
1651
|
+
u.value = E, Object.assign(b, {
|
|
1652
|
+
kind: $e(E),
|
|
1653
|
+
slug: E.slug,
|
|
1654
|
+
title: E.title,
|
|
1655
|
+
description: E.description,
|
|
1656
|
+
icon: E.icon,
|
|
1657
|
+
group: E.group,
|
|
1658
|
+
sort: E.sort,
|
|
1659
|
+
allow: E.allow ?? [],
|
|
1660
|
+
allowed_in: E.allowed_in ?? [],
|
|
1661
|
+
max_per_entity: E.max_per_entity,
|
|
1662
|
+
is_enabled: E.is_enabled
|
|
1596
1663
|
});
|
|
1597
|
-
const y =
|
|
1664
|
+
const y = E.content ?? {
|
|
1598
1665
|
schema: [],
|
|
1599
1666
|
template: "",
|
|
1600
1667
|
styles: "",
|
|
1601
1668
|
script: null,
|
|
1602
1669
|
sample: {}
|
|
1603
1670
|
};
|
|
1604
|
-
Object.assign($,
|
|
1671
|
+
Object.assign($, Ve(y)), R.value = JSON.stringify(y.schema, null, 2), G.value = null, ee.value = Q.value;
|
|
1605
1672
|
}
|
|
1606
1673
|
async function q() {
|
|
1607
|
-
|
|
1674
|
+
p.value = !0;
|
|
1608
1675
|
try {
|
|
1609
|
-
j(await o.get(
|
|
1610
|
-
} catch (
|
|
1611
|
-
X.danger(r(
|
|
1676
|
+
j(await o.get(c.value)), m.value = await o.usage(c.value), Le();
|
|
1677
|
+
} catch (E) {
|
|
1678
|
+
X.danger(r(E));
|
|
1612
1679
|
} finally {
|
|
1613
|
-
|
|
1680
|
+
p.value = !1;
|
|
1614
1681
|
}
|
|
1615
1682
|
}
|
|
1616
|
-
function pe(
|
|
1617
|
-
R.value =
|
|
1683
|
+
function pe(E) {
|
|
1684
|
+
R.value = E;
|
|
1618
1685
|
try {
|
|
1619
|
-
const y = JSON.parse(
|
|
1686
|
+
const y = JSON.parse(E);
|
|
1620
1687
|
if (!Array.isArray(y)) throw new Error("not a list");
|
|
1621
1688
|
$.schema = y, G.value = null;
|
|
1622
1689
|
} catch (y) {
|
|
1623
1690
|
G.value = s("page.schema-invalid", { error: y.message });
|
|
1624
1691
|
}
|
|
1625
1692
|
}
|
|
1626
|
-
let
|
|
1693
|
+
let A, O = 0;
|
|
1627
1694
|
function I() {
|
|
1628
|
-
clearTimeout(
|
|
1629
|
-
|
|
1695
|
+
clearTimeout(A), A = setTimeout(() => {
|
|
1696
|
+
J();
|
|
1630
1697
|
}, 250);
|
|
1631
1698
|
}
|
|
1632
|
-
async function
|
|
1699
|
+
async function J() {
|
|
1633
1700
|
if (!u.value) return;
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1701
|
+
const E = ++O;
|
|
1702
|
+
U.loading = !0;
|
|
1636
1703
|
try {
|
|
1637
1704
|
const y = await o.render(u.value.id, {
|
|
1638
1705
|
values: $.sample,
|
|
@@ -1643,12 +1710,12 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
|
|
|
1643
1710
|
schema: $.schema
|
|
1644
1711
|
} : void 0
|
|
1645
1712
|
});
|
|
1646
|
-
if (
|
|
1647
|
-
|
|
1713
|
+
if (E !== O) return;
|
|
1714
|
+
U.html = y.html, U.styles = y.styles, U.script = y.script, U.runtime = y.runtime, U.stage = y.stage ?? null;
|
|
1648
1715
|
} catch (y) {
|
|
1649
|
-
|
|
1716
|
+
E === O && X.danger(r(y));
|
|
1650
1717
|
} finally {
|
|
1651
|
-
|
|
1718
|
+
E === O && (U.loading = !1);
|
|
1652
1719
|
}
|
|
1653
1720
|
}
|
|
1654
1721
|
ue(
|
|
@@ -1656,22 +1723,22 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
|
|
|
1656
1723
|
I,
|
|
1657
1724
|
{ deep: !0 }
|
|
1658
1725
|
);
|
|
1659
|
-
const Te =
|
|
1660
|
-
function
|
|
1661
|
-
return `{{ $${
|
|
1726
|
+
const Te = P(null);
|
|
1727
|
+
function Je(E) {
|
|
1728
|
+
return `{{ $${E} }}`;
|
|
1662
1729
|
}
|
|
1663
|
-
function
|
|
1730
|
+
function Be(E) {
|
|
1664
1731
|
const K = Te.value?.view?.value;
|
|
1665
1732
|
if (!K) {
|
|
1666
|
-
$.template += `{{ $${
|
|
1733
|
+
$.template += `{{ $${E} }}`;
|
|
1667
1734
|
return;
|
|
1668
1735
|
}
|
|
1669
|
-
K.dispatch(K.state.replaceSelection(`{{ $${
|
|
1736
|
+
K.dispatch(K.state.replaceSelection(`{{ $${E} }}`)), K.focus();
|
|
1670
1737
|
}
|
|
1671
|
-
async function
|
|
1738
|
+
async function Pe() {
|
|
1672
1739
|
if (!u.value) return;
|
|
1673
1740
|
f.value = !0, ae.value = {}, D.value = null;
|
|
1674
|
-
const
|
|
1741
|
+
const E = u.value.draft?.number ?? null;
|
|
1675
1742
|
try {
|
|
1676
1743
|
const y = await o.update(u.value.id, {
|
|
1677
1744
|
...b,
|
|
@@ -1682,7 +1749,7 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
|
|
|
1682
1749
|
content: G.value ? { ...$, schema: void 0 } : $
|
|
1683
1750
|
});
|
|
1684
1751
|
j(y), X.success(
|
|
1685
|
-
y.draft && y.draft.number !==
|
|
1752
|
+
y.draft && y.draft.number !== E ? s("page.saved", { number: y.draft.number }) : s("page.unchanged")
|
|
1686
1753
|
);
|
|
1687
1754
|
} catch (y) {
|
|
1688
1755
|
const K = y.body;
|
|
@@ -1692,14 +1759,14 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
|
|
|
1692
1759
|
}
|
|
1693
1760
|
}
|
|
1694
1761
|
async function ct() {
|
|
1695
|
-
if (!(!u.value?.draft || (le.value && await
|
|
1762
|
+
if (!(!u.value?.draft || (le.value && await Pe(), !u.value.draft) || !await vt({
|
|
1696
1763
|
title: s("page.publish-title", { number: u.value.draft.number }),
|
|
1697
1764
|
// A component stands on no page itself; what a new version reaches is the blocks calling it.
|
|
1698
1765
|
// A declared place is also printed by the module's views, which the count does not see.
|
|
1699
|
-
message:
|
|
1700
|
-
module:
|
|
1701
|
-
count:
|
|
1702
|
-
}) : fe.value ? s("components.publish-text", { count:
|
|
1766
|
+
message: Ae.value ? s("components.publish-declared", {
|
|
1767
|
+
module: Ae.value,
|
|
1768
|
+
count: Ce.value.length
|
|
1769
|
+
}) : fe.value ? s("components.publish-text", { count: Ce.value.length }) : s("page.publish-text", { count: u.value.usage_count }),
|
|
1703
1770
|
confirmText: s("page.publish"),
|
|
1704
1771
|
cancelText: s("page.cancel")
|
|
1705
1772
|
}))) {
|
|
@@ -1714,13 +1781,13 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
|
|
|
1714
1781
|
}
|
|
1715
1782
|
}
|
|
1716
1783
|
}
|
|
1717
|
-
async function
|
|
1784
|
+
async function V() {
|
|
1718
1785
|
if (!u.value) return;
|
|
1719
|
-
const
|
|
1786
|
+
const E = u.value.declared != null;
|
|
1720
1787
|
if (await vt({
|
|
1721
|
-
title:
|
|
1722
|
-
message: s(
|
|
1723
|
-
confirmText: s(
|
|
1788
|
+
title: E ? s("components.delete-declared-title", { title: u.value.title }) : s("page.delete-title", { title: u.value.title }),
|
|
1789
|
+
message: s(E ? "components.delete-declared-text" : "page.delete-text"),
|
|
1790
|
+
confirmText: s(E ? "components.delete-declared" : "page.delete"),
|
|
1724
1791
|
cancelText: s("page.cancel"),
|
|
1725
1792
|
tone: "danger"
|
|
1726
1793
|
}))
|
|
@@ -1761,56 +1828,56 @@ setInterval(() => el.classList.toggle('is-second'), seconds * 1000)`
|
|
|
1761
1828
|
|
|
1762
1829
|
new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
1763
1830
|
}
|
|
1764
|
-
]), te = S(() => m.value.slice(0, 5)), fe = S(() => b.kind === "component"),
|
|
1765
|
-
const
|
|
1766
|
-
return
|
|
1831
|
+
]), te = S(() => m.value.slice(0, 5)), fe = S(() => b.kind === "component"), Ce = S(() => u.value?.used_by ?? []), Ae = S(() => {
|
|
1832
|
+
const E = u.value?.declared?.module;
|
|
1833
|
+
return E ? t.state.manifest?.modules.find((y) => y.id === E)?.title ?? E.charAt(0).toUpperCase() + E.slice(1) : null;
|
|
1767
1834
|
}), Ge = S(
|
|
1768
|
-
() => fe.value ?
|
|
1835
|
+
() => fe.value ? Al(Ce.value.length, s) : Cl(u.value?.usage_count ?? 0, s)
|
|
1769
1836
|
), Ze = S(
|
|
1770
|
-
() => (u.value?.usage_count ?? 0) > 0 ||
|
|
1771
|
-
),
|
|
1772
|
-
const
|
|
1773
|
-
return
|
|
1774
|
-
titles:
|
|
1837
|
+
() => (u.value?.usage_count ?? 0) > 0 || Ce.value.length > 0 || Ae.value !== null
|
|
1838
|
+
), Ue = S(() => {
|
|
1839
|
+
const E = u.value?.usage_count ?? 0;
|
|
1840
|
+
return E > 0 ? E === 1 ? s("page.delete-used-one") : s("page.delete-used", { count: E }) : Ce.value.length > 0 ? s("components.delete-called", {
|
|
1841
|
+
titles: Ce.value.map((y) => `"${y.title}"`).join(", ")
|
|
1775
1842
|
}) : null;
|
|
1776
1843
|
}), dt = S(
|
|
1777
|
-
() =>
|
|
1778
|
-
),
|
|
1779
|
-
() =>
|
|
1780
|
-
const y = typeof
|
|
1844
|
+
() => $o(b.slug, $.schema, $.sample, u.value?.declared?.fallback ?? null)
|
|
1845
|
+
), Ll = S(
|
|
1846
|
+
() => Rt($.schema).filter((E) => E.type === "wx-data").map((E) => {
|
|
1847
|
+
const y = typeof E.props?.shape == "string" ? E.props.shape : null;
|
|
1781
1848
|
return {
|
|
1782
|
-
id:
|
|
1849
|
+
id: E.id,
|
|
1783
1850
|
shape: y,
|
|
1784
1851
|
fields: y ? u.value?.shape?.[y]?.fields ?? [] : []
|
|
1785
1852
|
};
|
|
1786
1853
|
})
|
|
1787
1854
|
);
|
|
1788
|
-
async function
|
|
1855
|
+
async function Bl() {
|
|
1789
1856
|
try {
|
|
1790
1857
|
await navigator.clipboard.writeText(dt.value), X.success(s("components.copied"));
|
|
1791
1858
|
} catch {
|
|
1792
1859
|
}
|
|
1793
1860
|
}
|
|
1794
|
-
function ge(
|
|
1795
|
-
return ae.value[
|
|
1861
|
+
function ge(E) {
|
|
1862
|
+
return ae.value[E]?.[0];
|
|
1796
1863
|
}
|
|
1797
|
-
function
|
|
1798
|
-
le.value &&
|
|
1864
|
+
function jt(E) {
|
|
1865
|
+
le.value && E.preventDefault();
|
|
1799
1866
|
}
|
|
1800
1867
|
ot(() => {
|
|
1801
|
-
q(), window.addEventListener("beforeunload",
|
|
1868
|
+
q(), window.addEventListener("beforeunload", jt);
|
|
1802
1869
|
}), st(() => {
|
|
1803
|
-
clearTimeout(
|
|
1804
|
-
}), ue(
|
|
1870
|
+
clearTimeout(A), window.removeEventListener("beforeunload", jt);
|
|
1871
|
+
}), ue(c, () => {
|
|
1805
1872
|
q();
|
|
1806
1873
|
});
|
|
1807
|
-
const
|
|
1874
|
+
const Wl = S(() => [
|
|
1808
1875
|
{ value: "block", label: s("components.kind-block") },
|
|
1809
1876
|
{ value: "component", label: s("components.kind-component") }
|
|
1810
|
-
]),
|
|
1877
|
+
]), Nl = S(
|
|
1811
1878
|
() => _.value ? [
|
|
1812
1879
|
{ key: "save", label: s("page.save"), loading: f.value, run: () => {
|
|
1813
|
-
|
|
1880
|
+
Pe();
|
|
1814
1881
|
} },
|
|
1815
1882
|
{
|
|
1816
1883
|
key: "publish",
|
|
@@ -1824,16 +1891,16 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
1824
1891
|
}
|
|
1825
1892
|
] : []
|
|
1826
1893
|
);
|
|
1827
|
-
return (
|
|
1894
|
+
return (E, y) => {
|
|
1828
1895
|
const K = Mt("router-link");
|
|
1829
|
-
return
|
|
1830
|
-
|
|
1896
|
+
return d(), w("div", Eo, [
|
|
1897
|
+
p.value || !u.value ? (d(), w(F, { key: 0 }, [
|
|
1831
1898
|
v(n(He), {
|
|
1832
1899
|
class: "wx-block-editor__ghost-head",
|
|
1833
1900
|
title: "",
|
|
1834
1901
|
rows: 1
|
|
1835
1902
|
}),
|
|
1836
|
-
|
|
1903
|
+
C("div", To, [
|
|
1837
1904
|
v(n(De), null, {
|
|
1838
1905
|
default: g(() => [
|
|
1839
1906
|
v(n(He), { rows: 8 })
|
|
@@ -1847,131 +1914,131 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
1847
1914
|
_: 1
|
|
1848
1915
|
})
|
|
1849
1916
|
])
|
|
1850
|
-
], 64)) : (
|
|
1851
|
-
v(n(
|
|
1917
|
+
], 64)) : (d(), w(F, { key: 1 }, [
|
|
1918
|
+
v(n(en), {
|
|
1852
1919
|
title: b.title,
|
|
1853
1920
|
back: e.base,
|
|
1854
1921
|
"back-label": n(s)("page.back"),
|
|
1855
|
-
actions:
|
|
1922
|
+
actions: Nl.value
|
|
1856
1923
|
}, {
|
|
1857
1924
|
"title-after": g(() => [
|
|
1858
|
-
_.value ? (
|
|
1925
|
+
_.value ? (d(), W(n(tn), {
|
|
1859
1926
|
key: 0,
|
|
1860
1927
|
name: b.title,
|
|
1861
1928
|
placeholder: n(s)("page.title"),
|
|
1862
|
-
onRename: y[0] || (y[0] = (
|
|
1863
|
-
}, null, 8, ["name", "placeholder"])) :
|
|
1864
|
-
le.value ? (
|
|
1929
|
+
onRename: y[0] || (y[0] = (N) => b.title = N)
|
|
1930
|
+
}, null, 8, ["name", "placeholder"])) : B("", !0),
|
|
1931
|
+
le.value ? (d(), W(n(ye), {
|
|
1865
1932
|
key: 1,
|
|
1866
1933
|
type: "primary",
|
|
1867
1934
|
dot: ""
|
|
1868
1935
|
}, {
|
|
1869
1936
|
default: g(() => [
|
|
1870
|
-
|
|
1937
|
+
L(k(n(s)("page.unsaved")), 1)
|
|
1871
1938
|
]),
|
|
1872
1939
|
_: 1
|
|
1873
|
-
})) :
|
|
1874
|
-
u.value.draft ? (
|
|
1940
|
+
})) : B("", !0),
|
|
1941
|
+
u.value.draft ? (d(), W(n(ye), {
|
|
1875
1942
|
key: 2,
|
|
1876
1943
|
type: "warning",
|
|
1877
1944
|
dot: ""
|
|
1878
1945
|
}, {
|
|
1879
1946
|
default: g(() => [
|
|
1880
|
-
|
|
1947
|
+
L(k(n(s)("page.draft", { number: u.value.draft.number })), 1)
|
|
1881
1948
|
]),
|
|
1882
1949
|
_: 1
|
|
1883
|
-
})) :
|
|
1884
|
-
u.value.published ? (
|
|
1950
|
+
})) : B("", !0),
|
|
1951
|
+
u.value.published ? (d(), W(n(ye), {
|
|
1885
1952
|
key: 3,
|
|
1886
1953
|
type: "success",
|
|
1887
1954
|
dot: ""
|
|
1888
1955
|
}, {
|
|
1889
1956
|
default: g(() => [
|
|
1890
|
-
|
|
1957
|
+
L(k(n(s)("page.live", { number: u.value.published.number })), 1)
|
|
1891
1958
|
]),
|
|
1892
1959
|
_: 1
|
|
1893
|
-
})) : (
|
|
1960
|
+
})) : (d(), W(n(ye), {
|
|
1894
1961
|
key: 4,
|
|
1895
1962
|
type: "default"
|
|
1896
1963
|
}, {
|
|
1897
1964
|
default: g(() => [
|
|
1898
|
-
|
|
1965
|
+
L(k(n(s)("page.never-published")), 1)
|
|
1899
1966
|
]),
|
|
1900
1967
|
_: 1
|
|
1901
1968
|
}))
|
|
1902
1969
|
]),
|
|
1903
1970
|
subtitle: g(() => [
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
Ze.value ? (
|
|
1971
|
+
C("code", null, k(b.slug), 1),
|
|
1972
|
+
L(" · " + k(fe.value ? n(s)("components.kind-component") : n(qe)(b.group, n(s))) + " · ", 1),
|
|
1973
|
+
Ze.value ? (d(), W(n(Ml), {
|
|
1907
1974
|
key: 0,
|
|
1908
1975
|
title: n(s)("page.usage"),
|
|
1909
1976
|
width: 260,
|
|
1910
1977
|
align: "start"
|
|
1911
1978
|
}, {
|
|
1912
1979
|
trigger: g(() => [
|
|
1913
|
-
|
|
1980
|
+
C("button", Co, k(Ge.value), 1)
|
|
1914
1981
|
]),
|
|
1915
1982
|
default: g(() => [
|
|
1916
|
-
|
|
1917
|
-
(
|
|
1918
|
-
key: `type:${
|
|
1919
|
-
to: `${e.base}/${
|
|
1983
|
+
C("div", Ao, [
|
|
1984
|
+
(d(!0), w(F, null, Z(Ce.value, (N) => (d(), W(K, {
|
|
1985
|
+
key: `type:${N.id}`,
|
|
1986
|
+
to: `${e.base}/${N.id}`,
|
|
1920
1987
|
class: "wx-block-editor__use"
|
|
1921
1988
|
}, {
|
|
1922
1989
|
default: g(() => [
|
|
1923
|
-
|
|
1990
|
+
L(k(n(s)("components.called-by", { title: N.title })), 1)
|
|
1924
1991
|
]),
|
|
1925
1992
|
_: 2
|
|
1926
1993
|
}, 1032, ["to"]))), 128)),
|
|
1927
|
-
|
|
1928
|
-
(
|
|
1929
|
-
key: `${
|
|
1994
|
+
Ae.value ? (d(), w("div", Vo, k(n(s)("components.module-views", { module: Ae.value })), 1)) : B("", !0),
|
|
1995
|
+
(d(!0), w(F, null, Z(te.value, (N) => (d(), w("div", {
|
|
1996
|
+
key: `${N.model}:${N.id}`,
|
|
1930
1997
|
class: "wx-block-editor__use"
|
|
1931
1998
|
}, [
|
|
1932
|
-
|
|
1933
|
-
|
|
1999
|
+
C("span", null, k(N.title ?? `#${N.id}`), 1),
|
|
2000
|
+
N.published ? B("", !0) : (d(), W(n(ye), {
|
|
1934
2001
|
key: 0,
|
|
1935
2002
|
type: "warning",
|
|
1936
2003
|
size: "sm"
|
|
1937
2004
|
}, {
|
|
1938
2005
|
default: g(() => [
|
|
1939
|
-
|
|
2006
|
+
L(k(n(s)("page.unpublished-page")), 1)
|
|
1940
2007
|
]),
|
|
1941
2008
|
_: 1
|
|
1942
2009
|
}))
|
|
1943
2010
|
]))), 128)),
|
|
1944
|
-
m.value.length > te.value.length ? (
|
|
2011
|
+
m.value.length > te.value.length ? (d(), W(n(Y), {
|
|
1945
2012
|
key: 1,
|
|
1946
2013
|
size: "sm",
|
|
1947
2014
|
tone: "muted"
|
|
1948
2015
|
}, {
|
|
1949
2016
|
default: g(() => [
|
|
1950
|
-
|
|
2017
|
+
L(k(n(s)("page.usage-more", { count: m.value.length - te.value.length })), 1)
|
|
1951
2018
|
]),
|
|
1952
2019
|
_: 1
|
|
1953
|
-
})) :
|
|
2020
|
+
})) : B("", !0)
|
|
1954
2021
|
])
|
|
1955
2022
|
]),
|
|
1956
2023
|
_: 1
|
|
1957
|
-
}, 8, ["title"])) : (
|
|
1958
|
-
|
|
2024
|
+
}, 8, ["title"])) : (d(), w(F, { key: 1 }, [
|
|
2025
|
+
L(k(Ge.value), 1)
|
|
1959
2026
|
], 64))
|
|
1960
2027
|
]),
|
|
1961
2028
|
_: 1
|
|
1962
2029
|
}, 8, ["title", "back", "back-label", "actions"]),
|
|
1963
|
-
T.value.editing ?
|
|
2030
|
+
T.value.editing ? B("", !0) : (d(), W(n(il), {
|
|
1964
2031
|
key: 0,
|
|
1965
2032
|
type: "info",
|
|
1966
2033
|
variant: "soft",
|
|
1967
2034
|
description: n(s)("page.editing-off")
|
|
1968
2035
|
}, null, 8, ["description"])),
|
|
1969
|
-
|
|
1970
|
-
class:
|
|
2036
|
+
C("div", {
|
|
2037
|
+
class: Ne(["wx-block-editor__columns", { "is-alone": !H.value }])
|
|
1971
2038
|
}, [
|
|
1972
|
-
v(n(
|
|
2039
|
+
v(n(zl), {
|
|
1973
2040
|
modelValue: x.value,
|
|
1974
|
-
"onUpdate:modelValue": y[15] || (y[15] = (
|
|
2041
|
+
"onUpdate:modelValue": y[15] || (y[15] = (N) => x.value = N),
|
|
1975
2042
|
"keep-alive": ""
|
|
1976
2043
|
}, {
|
|
1977
2044
|
default: g(() => [
|
|
@@ -1980,113 +2047,113 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
1980
2047
|
label: n(s)("page.tab-template")
|
|
1981
2048
|
}, {
|
|
1982
2049
|
default: g(() => [
|
|
1983
|
-
|
|
2050
|
+
C("div", Lo, [
|
|
1984
2051
|
v(n(Qe), {
|
|
1985
2052
|
ref_key: "templateEditor",
|
|
1986
2053
|
ref: Te,
|
|
1987
2054
|
modelValue: $.template,
|
|
1988
|
-
"onUpdate:modelValue": y[1] || (y[1] = (
|
|
2055
|
+
"onUpdate:modelValue": y[1] || (y[1] = (N) => $.template = N),
|
|
1989
2056
|
language: "php",
|
|
1990
|
-
extensions:
|
|
2057
|
+
extensions: _e.template,
|
|
1991
2058
|
readonly: !_.value,
|
|
1992
2059
|
"min-height": "340px",
|
|
1993
2060
|
"max-height": "70vh",
|
|
1994
2061
|
"line-wrapping": ""
|
|
1995
2062
|
}, null, 8, ["modelValue", "extensions", "readonly"]),
|
|
1996
|
-
|
|
1997
|
-
v(n(
|
|
2063
|
+
Ee.value.length ? (d(), w("div", Bo, [
|
|
2064
|
+
v(n(Y), {
|
|
1998
2065
|
size: "sm",
|
|
1999
2066
|
tone: "muted"
|
|
2000
2067
|
}, {
|
|
2001
2068
|
default: g(() => [
|
|
2002
|
-
|
|
2069
|
+
L(k(n(s)("page.insert-field")), 1)
|
|
2003
2070
|
]),
|
|
2004
2071
|
_: 1
|
|
2005
2072
|
}),
|
|
2006
|
-
(
|
|
2007
|
-
key:
|
|
2073
|
+
(d(!0), w(F, null, Z(Ee.value, (N) => (d(), w("button", {
|
|
2074
|
+
key: N,
|
|
2008
2075
|
type: "button",
|
|
2009
2076
|
class: "wx-block-editor__pill",
|
|
2010
2077
|
disabled: !_.value,
|
|
2011
|
-
onClick: (Xe) =>
|
|
2012
|
-
textContent: k(
|
|
2013
|
-
}, null, 8,
|
|
2014
|
-
])) :
|
|
2015
|
-
v(
|
|
2078
|
+
onClick: (Xe) => Be(N),
|
|
2079
|
+
textContent: k(Je(N))
|
|
2080
|
+
}, null, 8, Wo))), 128))
|
|
2081
|
+
])) : B("", !0),
|
|
2082
|
+
v(Gt, {
|
|
2016
2083
|
file: "template",
|
|
2017
2084
|
lints: Se.value,
|
|
2018
2085
|
slug: b.slug,
|
|
2019
2086
|
error: z.value
|
|
2020
2087
|
}, null, 8, ["lints", "slug", "error"])
|
|
2021
2088
|
]),
|
|
2022
|
-
fe.value ? (
|
|
2089
|
+
fe.value ? (d(), W(n(De), {
|
|
2023
2090
|
key: 0,
|
|
2024
2091
|
class: "wx-block-editor__call",
|
|
2025
2092
|
title: n(s)("components.call")
|
|
2026
2093
|
}, {
|
|
2027
2094
|
default: g(() => [
|
|
2028
|
-
v(n(
|
|
2095
|
+
v(n(Y), {
|
|
2029
2096
|
size: "sm",
|
|
2030
2097
|
tone: "muted"
|
|
2031
2098
|
}, {
|
|
2032
2099
|
default: g(() => [
|
|
2033
|
-
|
|
2100
|
+
L(k(n(s)("components.call-help")), 1)
|
|
2034
2101
|
]),
|
|
2035
2102
|
_: 1
|
|
2036
2103
|
}),
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2104
|
+
C("div", No, [
|
|
2105
|
+
C("pre", null, [
|
|
2106
|
+
C("code", null, k(dt.value), 1)
|
|
2040
2107
|
]),
|
|
2041
2108
|
v(n(ce), {
|
|
2042
2109
|
size: "sm",
|
|
2043
2110
|
variant: "outline",
|
|
2044
|
-
onClick:
|
|
2111
|
+
onClick: Bl
|
|
2045
2112
|
}, {
|
|
2046
2113
|
default: g(() => [
|
|
2047
|
-
|
|
2114
|
+
L(k(n(s)("components.copy")), 1)
|
|
2048
2115
|
]),
|
|
2049
2116
|
_: 1
|
|
2050
2117
|
})
|
|
2051
2118
|
]),
|
|
2052
|
-
(
|
|
2053
|
-
key:
|
|
2119
|
+
(d(!0), w(F, null, Z(Ll.value, (N) => (d(), w("div", {
|
|
2120
|
+
key: N.id,
|
|
2054
2121
|
class: "wx-block-editor__shape"
|
|
2055
2122
|
}, [
|
|
2056
|
-
v(n(
|
|
2123
|
+
v(n(Y), {
|
|
2057
2124
|
size: "sm",
|
|
2058
2125
|
tone: "muted"
|
|
2059
2126
|
}, {
|
|
2060
2127
|
default: g(() => [
|
|
2061
|
-
|
|
2062
|
-
|
|
2128
|
+
L(k(N.fields.length ? n(s)("components.shape", { name: N.id }) : n(s)("components.shape-free", { name: N.id })) + " ", 1),
|
|
2129
|
+
N.shape ? (d(), w("code", Mo, k(N.shape), 1)) : B("", !0)
|
|
2063
2130
|
]),
|
|
2064
2131
|
_: 2
|
|
2065
2132
|
}, 1024),
|
|
2066
|
-
|
|
2067
|
-
(
|
|
2133
|
+
N.fields.length ? (d(), w("dl", zo, [
|
|
2134
|
+
(d(!0), w(F, null, Z(N.fields, (Xe) => (d(), w(F, {
|
|
2068
2135
|
key: Xe.name
|
|
2069
2136
|
}, [
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2137
|
+
C("dt", null, [
|
|
2138
|
+
C("code", null, k(Xe.name), 1),
|
|
2139
|
+
C("span", Do, k(Xe.type), 1)
|
|
2073
2140
|
]),
|
|
2074
|
-
|
|
2141
|
+
C("dd", null, k(Xe.description), 1)
|
|
2075
2142
|
], 64))), 128))
|
|
2076
|
-
])) :
|
|
2143
|
+
])) : B("", !0)
|
|
2077
2144
|
]))), 128)),
|
|
2078
|
-
v(n(
|
|
2145
|
+
v(n(Y), {
|
|
2079
2146
|
size: "sm",
|
|
2080
2147
|
tone: "muted"
|
|
2081
2148
|
}, {
|
|
2082
2149
|
default: g(() => [
|
|
2083
|
-
|
|
2150
|
+
L(k(n(s)("components.site-views")), 1)
|
|
2084
2151
|
]),
|
|
2085
2152
|
_: 1
|
|
2086
2153
|
})
|
|
2087
2154
|
]),
|
|
2088
2155
|
_: 1
|
|
2089
|
-
}, 8, ["title"])) :
|
|
2156
|
+
}, 8, ["title"])) : B("", !0)
|
|
2090
2157
|
]),
|
|
2091
2158
|
_: 1
|
|
2092
2159
|
}, 8, ["label"]),
|
|
@@ -2095,17 +2162,17 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2095
2162
|
label: n(s)("page.tab-styles")
|
|
2096
2163
|
}, {
|
|
2097
2164
|
default: g(() => [
|
|
2098
|
-
|
|
2165
|
+
C("div", Oo, [
|
|
2099
2166
|
v(n(Qe), {
|
|
2100
2167
|
modelValue: $.styles,
|
|
2101
|
-
"onUpdate:modelValue": y[2] || (y[2] = (
|
|
2168
|
+
"onUpdate:modelValue": y[2] || (y[2] = (N) => $.styles = N),
|
|
2102
2169
|
language: "css",
|
|
2103
|
-
extensions:
|
|
2170
|
+
extensions: _e.styles,
|
|
2104
2171
|
readonly: !_.value,
|
|
2105
2172
|
"min-height": "340px",
|
|
2106
2173
|
"max-height": "70vh"
|
|
2107
2174
|
}, null, 8, ["modelValue", "extensions", "readonly"]),
|
|
2108
|
-
v(
|
|
2175
|
+
v(Gt, {
|
|
2109
2176
|
file: "styles",
|
|
2110
2177
|
lints: Se.value,
|
|
2111
2178
|
slug: b.slug
|
|
@@ -2119,31 +2186,31 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2119
2186
|
label: n(s)("page.tab-script")
|
|
2120
2187
|
}, {
|
|
2121
2188
|
default: g(() => [
|
|
2122
|
-
|
|
2189
|
+
C("div", Io, [
|
|
2123
2190
|
v(n(Qe), {
|
|
2124
2191
|
"model-value": $.script ?? "",
|
|
2125
2192
|
language: "javascript",
|
|
2126
2193
|
readonly: !_.value,
|
|
2127
2194
|
"min-height": "340px",
|
|
2128
2195
|
"max-height": "70vh",
|
|
2129
|
-
"onUpdate:modelValue": y[3] || (y[3] = (
|
|
2196
|
+
"onUpdate:modelValue": y[3] || (y[3] = (N) => $.script = N || null)
|
|
2130
2197
|
}, null, 8, ["model-value", "readonly"]),
|
|
2131
|
-
|
|
2132
|
-
v(n(
|
|
2198
|
+
C("div", Po, [
|
|
2199
|
+
v(n(Y), {
|
|
2133
2200
|
size: "sm",
|
|
2134
2201
|
tone: "muted"
|
|
2135
2202
|
}, {
|
|
2136
2203
|
default: g(() => [
|
|
2137
|
-
|
|
2204
|
+
L(k(n(s)("page.script-help")), 1)
|
|
2138
2205
|
]),
|
|
2139
2206
|
_: 1
|
|
2140
2207
|
}),
|
|
2141
|
-
v(n(
|
|
2208
|
+
v(n(Y), {
|
|
2142
2209
|
size: "sm",
|
|
2143
2210
|
tone: "muted"
|
|
2144
2211
|
}, {
|
|
2145
2212
|
default: g(() => [
|
|
2146
|
-
|
|
2213
|
+
L(k(T.value.provides.length ? n(s)("page.provides", { names: T.value.provides.join(", ") }) : n(s)("page.provides-none")), 1)
|
|
2147
2214
|
]),
|
|
2148
2215
|
_: 1
|
|
2149
2216
|
})
|
|
@@ -2154,21 +2221,21 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2154
2221
|
title: n(s)("page.examples")
|
|
2155
2222
|
}, {
|
|
2156
2223
|
default: g(() => [
|
|
2157
|
-
(
|
|
2158
|
-
key:
|
|
2224
|
+
(d(!0), w(F, null, Z(be.value, (N) => (d(), w("div", {
|
|
2225
|
+
key: N.title,
|
|
2159
2226
|
class: "wx-block-editor__example"
|
|
2160
2227
|
}, [
|
|
2161
|
-
v(n(
|
|
2228
|
+
v(n(Y), {
|
|
2162
2229
|
size: "sm",
|
|
2163
2230
|
tone: "muted"
|
|
2164
2231
|
}, {
|
|
2165
2232
|
default: g(() => [
|
|
2166
|
-
|
|
2233
|
+
L(k(N.title), 1)
|
|
2167
2234
|
]),
|
|
2168
2235
|
_: 2
|
|
2169
2236
|
}, 1024),
|
|
2170
|
-
|
|
2171
|
-
|
|
2237
|
+
C("pre", null, [
|
|
2238
|
+
C("code", null, k(N.code), 1)
|
|
2172
2239
|
])
|
|
2173
2240
|
]))), 128))
|
|
2174
2241
|
]),
|
|
@@ -2182,48 +2249,48 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2182
2249
|
label: fe.value ? n(s)("components.tab-inputs") : n(s)("page.tab-fields")
|
|
2183
2250
|
}, {
|
|
2184
2251
|
default: g(() => [
|
|
2185
|
-
|
|
2186
|
-
|
|
2252
|
+
C("div", Uo, [
|
|
2253
|
+
C("div", Ro, [
|
|
2187
2254
|
v(n(Qe), {
|
|
2188
2255
|
"model-value": R.value,
|
|
2189
2256
|
language: "json",
|
|
2190
|
-
extensions:
|
|
2257
|
+
extensions: _e.schema,
|
|
2191
2258
|
lint: "",
|
|
2192
2259
|
readonly: !_.value,
|
|
2193
2260
|
"min-height": "340px",
|
|
2194
2261
|
"max-height": "70vh",
|
|
2195
2262
|
"onUpdate:modelValue": pe
|
|
2196
2263
|
}, null, 8, ["model-value", "extensions", "readonly"]),
|
|
2197
|
-
|
|
2198
|
-
G.value ? (
|
|
2264
|
+
C("div", jo, [
|
|
2265
|
+
G.value ? (d(), W(n(Y), {
|
|
2199
2266
|
key: 0,
|
|
2200
2267
|
size: "sm",
|
|
2201
2268
|
tone: "danger"
|
|
2202
2269
|
}, {
|
|
2203
2270
|
default: g(() => [
|
|
2204
|
-
|
|
2271
|
+
L(k(G.value), 1)
|
|
2205
2272
|
]),
|
|
2206
2273
|
_: 1
|
|
2207
|
-
})) : ge("content.schema") ? (
|
|
2274
|
+
})) : ge("content.schema") ? (d(), W(n(Y), {
|
|
2208
2275
|
key: 1,
|
|
2209
2276
|
size: "sm",
|
|
2210
2277
|
tone: "danger"
|
|
2211
2278
|
}, {
|
|
2212
2279
|
default: g(() => [
|
|
2213
|
-
|
|
2280
|
+
L(k(ge("content.schema")), 1)
|
|
2214
2281
|
]),
|
|
2215
2282
|
_: 1
|
|
2216
|
-
})) : (
|
|
2283
|
+
})) : (d(), W(n(Y), {
|
|
2217
2284
|
key: 2,
|
|
2218
2285
|
size: "sm",
|
|
2219
2286
|
tone: "muted"
|
|
2220
2287
|
}, {
|
|
2221
2288
|
default: g(() => [
|
|
2222
|
-
|
|
2289
|
+
L(k(fe.value ? n(s)("components.inputs-help") : n(s)("page.fields-help")), 1)
|
|
2223
2290
|
]),
|
|
2224
2291
|
_: 1
|
|
2225
2292
|
})),
|
|
2226
|
-
v(n(
|
|
2293
|
+
v(n(ln), {
|
|
2227
2294
|
title: n(s)("help.schema-title"),
|
|
2228
2295
|
body: n(s)("help.schema")
|
|
2229
2296
|
}, null, 8, ["title", "body"])
|
|
@@ -2234,17 +2301,17 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2234
2301
|
title: n(s)("page.sample")
|
|
2235
2302
|
}, {
|
|
2236
2303
|
default: g(() => [
|
|
2237
|
-
$.schema.length ? (
|
|
2304
|
+
$.schema.length ? (d(), W(n(dl), {
|
|
2238
2305
|
key: 0,
|
|
2239
2306
|
modelValue: ve.value,
|
|
2240
|
-
"onUpdate:modelValue": y[4] || (y[4] = (
|
|
2307
|
+
"onUpdate:modelValue": y[4] || (y[4] = (N) => ve.value = N),
|
|
2241
2308
|
root: n(Ut)($.schema),
|
|
2242
2309
|
types: n(t).types,
|
|
2243
2310
|
translate: n(t).i18n.t,
|
|
2244
2311
|
can: n(t).can,
|
|
2245
2312
|
disabled: !_.value,
|
|
2246
2313
|
size: "sm"
|
|
2247
|
-
}, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) :
|
|
2314
|
+
}, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : B("", !0)
|
|
2248
2315
|
]),
|
|
2249
2316
|
_: 1
|
|
2250
2317
|
}, 8, ["title"])
|
|
@@ -2259,7 +2326,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2259
2326
|
default: g(() => [
|
|
2260
2327
|
v(n(De), { class: "wx-block-editor__sheet" }, {
|
|
2261
2328
|
default: g(() => [
|
|
2262
|
-
|
|
2329
|
+
C("div", Fo, [
|
|
2263
2330
|
v(n(re), {
|
|
2264
2331
|
label: n(s)("components.kind"),
|
|
2265
2332
|
help: n(s)("components.kind-help"),
|
|
@@ -2267,10 +2334,10 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2267
2334
|
disabled: !_.value
|
|
2268
2335
|
}, {
|
|
2269
2336
|
default: g(() => [
|
|
2270
|
-
v(n(
|
|
2337
|
+
v(n(St), {
|
|
2271
2338
|
modelValue: b.kind,
|
|
2272
|
-
"onUpdate:modelValue": y[5] || (y[5] = (
|
|
2273
|
-
options:
|
|
2339
|
+
"onUpdate:modelValue": y[5] || (y[5] = (N) => b.kind = N),
|
|
2340
|
+
options: Wl.value
|
|
2274
2341
|
}, null, 8, ["modelValue", "options"])
|
|
2275
2342
|
]),
|
|
2276
2343
|
_: 1
|
|
@@ -2284,12 +2351,12 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2284
2351
|
default: g(() => [
|
|
2285
2352
|
v(n(nt), {
|
|
2286
2353
|
modelValue: b.slug,
|
|
2287
|
-
"onUpdate:modelValue": y[6] || (y[6] = (
|
|
2354
|
+
"onUpdate:modelValue": y[6] || (y[6] = (N) => b.slug = N)
|
|
2288
2355
|
}, null, 8, ["modelValue"])
|
|
2289
2356
|
]),
|
|
2290
2357
|
_: 1
|
|
2291
2358
|
}, 8, ["label", "help", "error", "disabled"]),
|
|
2292
|
-
fe.value ?
|
|
2359
|
+
fe.value ? B("", !0) : (d(), W(n(re), {
|
|
2293
2360
|
key: 0,
|
|
2294
2361
|
label: n(s)("page.group"),
|
|
2295
2362
|
help: n(s)("page.group-help"),
|
|
@@ -2297,9 +2364,9 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2297
2364
|
disabled: !_.value
|
|
2298
2365
|
}, {
|
|
2299
2366
|
default: g(() => [
|
|
2300
|
-
v(n(
|
|
2367
|
+
v(n(St), {
|
|
2301
2368
|
modelValue: b.group,
|
|
2302
|
-
"onUpdate:modelValue": y[7] || (y[7] = (
|
|
2369
|
+
"onUpdate:modelValue": y[7] || (y[7] = (N) => b.group = N),
|
|
2303
2370
|
options: ie.value
|
|
2304
2371
|
}, null, 8, ["modelValue", "options"])
|
|
2305
2372
|
]),
|
|
@@ -2313,10 +2380,10 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2313
2380
|
disabled: !_.value
|
|
2314
2381
|
}, {
|
|
2315
2382
|
default: g(() => [
|
|
2316
|
-
v(n(
|
|
2383
|
+
v(n(rl), {
|
|
2317
2384
|
"model-value": b.description ?? "",
|
|
2318
2385
|
rows: 2,
|
|
2319
|
-
"onUpdate:modelValue": y[8] || (y[8] = (
|
|
2386
|
+
"onUpdate:modelValue": y[8] || (y[8] = (N) => b.description = String(N ?? ""))
|
|
2320
2387
|
}, null, 8, ["model-value"])
|
|
2321
2388
|
]),
|
|
2322
2389
|
_: 1
|
|
@@ -2327,14 +2394,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2327
2394
|
disabled: !_.value
|
|
2328
2395
|
}, {
|
|
2329
2396
|
default: g(() => [
|
|
2330
|
-
v(n(
|
|
2397
|
+
v(n(Dl), {
|
|
2331
2398
|
"model-value": b.icon,
|
|
2332
2399
|
clearable: "",
|
|
2333
2400
|
placeholder: n(s)("page.icon-search"),
|
|
2334
2401
|
"empty-text": n(s)("page.icon-none"),
|
|
2335
2402
|
"unknown-text": n(s)("page.icon-unknown"),
|
|
2336
2403
|
"clear-label": n(s)("page.icon-clear"),
|
|
2337
|
-
"onUpdate:modelValue": y[9] || (y[9] = (
|
|
2404
|
+
"onUpdate:modelValue": y[9] || (y[9] = (N) => b.icon = N)
|
|
2338
2405
|
}, null, 8, ["model-value", "placeholder", "empty-text", "unknown-text", "clear-label"])
|
|
2339
2406
|
]),
|
|
2340
2407
|
_: 1
|
|
@@ -2346,14 +2413,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2346
2413
|
disabled: !_.value
|
|
2347
2414
|
}, {
|
|
2348
2415
|
default: g(() => [
|
|
2349
|
-
v(n(
|
|
2416
|
+
v(n(Ft), {
|
|
2350
2417
|
modelValue: b.sort,
|
|
2351
|
-
"onUpdate:modelValue": y[10] || (y[10] = (
|
|
2418
|
+
"onUpdate:modelValue": y[10] || (y[10] = (N) => b.sort = N)
|
|
2352
2419
|
}, null, 8, ["modelValue"])
|
|
2353
2420
|
]),
|
|
2354
2421
|
_: 1
|
|
2355
2422
|
}, 8, ["label", "help", "error", "disabled"]),
|
|
2356
|
-
fe.value ?
|
|
2423
|
+
fe.value ? B("", !0) : (d(), W(n(re), {
|
|
2357
2424
|
key: 1,
|
|
2358
2425
|
label: n(s)("page.allow"),
|
|
2359
2426
|
help: n(s)("page.allow-help"),
|
|
@@ -2361,15 +2428,15 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2361
2428
|
disabled: !_.value
|
|
2362
2429
|
}, {
|
|
2363
2430
|
default: g(() => [
|
|
2364
|
-
v(n(
|
|
2431
|
+
v(n(Ht), {
|
|
2365
2432
|
modelValue: b.allow,
|
|
2366
|
-
"onUpdate:modelValue": y[11] || (y[11] = (
|
|
2433
|
+
"onUpdate:modelValue": y[11] || (y[11] = (N) => b.allow = N),
|
|
2367
2434
|
"allow-create": ""
|
|
2368
2435
|
}, null, 8, ["modelValue"])
|
|
2369
2436
|
]),
|
|
2370
2437
|
_: 1
|
|
2371
2438
|
}, 8, ["label", "help", "error", "disabled"])),
|
|
2372
|
-
fe.value ?
|
|
2439
|
+
fe.value ? B("", !0) : (d(), W(n(re), {
|
|
2373
2440
|
key: 2,
|
|
2374
2441
|
label: n(s)("page.allowed-in"),
|
|
2375
2442
|
help: n(s)("page.allowed-in-help"),
|
|
@@ -2377,16 +2444,16 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2377
2444
|
disabled: !_.value
|
|
2378
2445
|
}, {
|
|
2379
2446
|
default: g(() => [
|
|
2380
|
-
v(n(
|
|
2447
|
+
v(n(Ht), {
|
|
2381
2448
|
modelValue: b.allowed_in,
|
|
2382
|
-
"onUpdate:modelValue": y[12] || (y[12] = (
|
|
2449
|
+
"onUpdate:modelValue": y[12] || (y[12] = (N) => b.allowed_in = N),
|
|
2383
2450
|
"allow-create": "",
|
|
2384
2451
|
suggestions: ["root"]
|
|
2385
2452
|
}, null, 8, ["modelValue"])
|
|
2386
2453
|
]),
|
|
2387
2454
|
_: 1
|
|
2388
2455
|
}, 8, ["label", "help", "error", "disabled"])),
|
|
2389
|
-
fe.value ?
|
|
2456
|
+
fe.value ? B("", !0) : (d(), W(n(re), {
|
|
2390
2457
|
key: 3,
|
|
2391
2458
|
label: n(s)("page.max-per-entity"),
|
|
2392
2459
|
help: n(s)("page.max-per-entity-help"),
|
|
@@ -2394,51 +2461,51 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2394
2461
|
disabled: !_.value
|
|
2395
2462
|
}, {
|
|
2396
2463
|
default: g(() => [
|
|
2397
|
-
v(n(
|
|
2464
|
+
v(n(Ft), {
|
|
2398
2465
|
"model-value": b.max_per_entity ?? void 0,
|
|
2399
2466
|
min: 1,
|
|
2400
|
-
"onUpdate:modelValue": y[13] || (y[13] = (
|
|
2467
|
+
"onUpdate:modelValue": y[13] || (y[13] = (N) => b.max_per_entity = N ?? null)
|
|
2401
2468
|
}, null, 8, ["model-value"])
|
|
2402
2469
|
]),
|
|
2403
2470
|
_: 1
|
|
2404
2471
|
}, 8, ["label", "help", "error", "disabled"])),
|
|
2405
|
-
fe.value ?
|
|
2472
|
+
fe.value ? B("", !0) : (d(), W(n(re), {
|
|
2406
2473
|
key: 4,
|
|
2407
2474
|
label: n(s)("page.enabled"),
|
|
2408
2475
|
help: n(s)("page.enabled-help"),
|
|
2409
2476
|
disabled: !_.value
|
|
2410
2477
|
}, {
|
|
2411
2478
|
default: g(() => [
|
|
2412
|
-
v(n(
|
|
2479
|
+
v(n(Ol), {
|
|
2413
2480
|
modelValue: b.is_enabled,
|
|
2414
|
-
"onUpdate:modelValue": y[14] || (y[14] = (
|
|
2481
|
+
"onUpdate:modelValue": y[14] || (y[14] = (N) => b.is_enabled = N)
|
|
2415
2482
|
}, null, 8, ["modelValue"])
|
|
2416
2483
|
]),
|
|
2417
2484
|
_: 1
|
|
2418
2485
|
}, 8, ["label", "help", "disabled"])),
|
|
2419
|
-
_.value ? (
|
|
2486
|
+
_.value ? (d(), w("div", Ho, [
|
|
2420
2487
|
v(n(ce), {
|
|
2421
2488
|
type: "danger",
|
|
2422
2489
|
variant: "outline",
|
|
2423
|
-
disabled:
|
|
2424
|
-
onClick:
|
|
2490
|
+
disabled: Ue.value !== null,
|
|
2491
|
+
onClick: V
|
|
2425
2492
|
}, {
|
|
2426
2493
|
default: g(() => [
|
|
2427
|
-
|
|
2494
|
+
L(k(u.value.declared ? n(s)("components.delete-declared") : n(s)("page.delete")), 1)
|
|
2428
2495
|
]),
|
|
2429
2496
|
_: 1
|
|
2430
2497
|
}, 8, ["disabled"]),
|
|
2431
|
-
|
|
2498
|
+
Ue.value ? (d(), W(n(Y), {
|
|
2432
2499
|
key: 0,
|
|
2433
2500
|
size: "sm",
|
|
2434
2501
|
tone: "muted"
|
|
2435
2502
|
}, {
|
|
2436
2503
|
default: g(() => [
|
|
2437
|
-
|
|
2504
|
+
L(k(Ue.value), 1)
|
|
2438
2505
|
]),
|
|
2439
2506
|
_: 1
|
|
2440
|
-
})) :
|
|
2441
|
-
])) :
|
|
2507
|
+
})) : B("", !0)
|
|
2508
|
+
])) : B("", !0)
|
|
2442
2509
|
])
|
|
2443
2510
|
]),
|
|
2444
2511
|
_: 1
|
|
@@ -2456,7 +2523,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2456
2523
|
padding: "none"
|
|
2457
2524
|
}, {
|
|
2458
2525
|
default: g(() => [
|
|
2459
|
-
v(
|
|
2526
|
+
v(xn, {
|
|
2460
2527
|
block: u.value,
|
|
2461
2528
|
"can-manage": _.value,
|
|
2462
2529
|
onRestored: j
|
|
@@ -2470,27 +2537,27 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2470
2537
|
]),
|
|
2471
2538
|
_: 1
|
|
2472
2539
|
}, 8, ["modelValue"]),
|
|
2473
|
-
|
|
2540
|
+
Fl(v(Nn, {
|
|
2474
2541
|
class: "wx-block-editor__stage",
|
|
2475
|
-
html:
|
|
2476
|
-
styles:
|
|
2477
|
-
script:
|
|
2478
|
-
runtime:
|
|
2479
|
-
stage:
|
|
2480
|
-
loading:
|
|
2542
|
+
html: U.html,
|
|
2543
|
+
styles: U.styles,
|
|
2544
|
+
script: U.script,
|
|
2545
|
+
runtime: U.runtime,
|
|
2546
|
+
stage: U.stage,
|
|
2547
|
+
loading: U.loading
|
|
2481
2548
|
}, null, 8, ["html", "styles", "script", "runtime", "stage", "loading"]), [
|
|
2482
|
-
[
|
|
2549
|
+
[Hl, H.value]
|
|
2483
2550
|
])
|
|
2484
2551
|
], 2),
|
|
2485
|
-
_.value ? (
|
|
2552
|
+
_.value ? (d(), W(n(Il), { key: 1 }, {
|
|
2486
2553
|
default: g(() => [
|
|
2487
2554
|
v(n(ce), {
|
|
2488
2555
|
variant: "outline",
|
|
2489
2556
|
loading: f.value,
|
|
2490
|
-
onClick:
|
|
2557
|
+
onClick: Pe
|
|
2491
2558
|
}, {
|
|
2492
2559
|
default: g(() => [
|
|
2493
|
-
|
|
2560
|
+
L(k(n(s)("page.save")), 1)
|
|
2494
2561
|
]),
|
|
2495
2562
|
_: 1
|
|
2496
2563
|
}, 8, ["loading"]),
|
|
@@ -2501,24 +2568,24 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2501
2568
|
onClick: ct
|
|
2502
2569
|
}, {
|
|
2503
2570
|
default: g(() => [
|
|
2504
|
-
|
|
2571
|
+
L(k(n(s)("page.publish")), 1)
|
|
2505
2572
|
]),
|
|
2506
2573
|
_: 1
|
|
2507
2574
|
}, 8, ["loading", "disabled"])
|
|
2508
2575
|
]),
|
|
2509
2576
|
_: 1
|
|
2510
|
-
})) :
|
|
2577
|
+
})) : B("", !0)
|
|
2511
2578
|
], 64))
|
|
2512
2579
|
]);
|
|
2513
2580
|
};
|
|
2514
2581
|
}
|
|
2515
|
-
}),
|
|
2582
|
+
}), qo = /* @__PURE__ */ se(Ko, [["__scopeId", "data-v-8201065d"]]), Yo = {
|
|
2516
2583
|
key: 1,
|
|
2517
2584
|
class: "wx-block-move"
|
|
2518
|
-
},
|
|
2585
|
+
}, Jo = ["disabled", "onClick"], Go = { class: "wx-block-move__trail" }, Zo = {
|
|
2519
2586
|
key: 0,
|
|
2520
2587
|
class: "wx-block-move__sep"
|
|
2521
|
-
},
|
|
2588
|
+
}, Xo = /* @__PURE__ */ oe({
|
|
2522
2589
|
__name: "BlockMoveDialog",
|
|
2523
2590
|
props: {
|
|
2524
2591
|
title: {},
|
|
@@ -2526,12 +2593,12 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2526
2593
|
topLabel: {}
|
|
2527
2594
|
},
|
|
2528
2595
|
setup(e) {
|
|
2529
|
-
const { resolve: l, dismiss: t, open: o } =
|
|
2530
|
-
|
|
2596
|
+
const { resolve: l, dismiss: t, open: o } = Lt();
|
|
2597
|
+
Me();
|
|
2531
2598
|
const a = de("webx-blocks");
|
|
2532
|
-
return (i, s) => (
|
|
2599
|
+
return (i, s) => (d(), W(n(Bt), {
|
|
2533
2600
|
open: n(o),
|
|
2534
|
-
"onUpdate:open": s[1] || (s[1] = (r) =>
|
|
2601
|
+
"onUpdate:open": s[1] || (s[1] = (r) => zt(o) ? o.value = r : null),
|
|
2535
2602
|
title: n(a)("field.move-title", { title: e.title }),
|
|
2536
2603
|
width: 520
|
|
2537
2604
|
}, {
|
|
@@ -2541,75 +2608,75 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
|
|
|
2541
2608
|
onClick: s[0] || (s[0] = (r) => n(t)())
|
|
2542
2609
|
}, {
|
|
2543
2610
|
default: g(() => [
|
|
2544
|
-
|
|
2611
|
+
L(k(n(a)("page.cancel")), 1)
|
|
2545
2612
|
]),
|
|
2546
2613
|
_: 1
|
|
2547
2614
|
})
|
|
2548
2615
|
]),
|
|
2549
2616
|
default: g(() => [
|
|
2550
|
-
e.destinations.length === 0 ? (
|
|
2617
|
+
e.destinations.length === 0 ? (d(), W(n(Wt), {
|
|
2551
2618
|
key: 0,
|
|
2552
2619
|
icon: "grid",
|
|
2553
2620
|
title: n(a)("field.move-none"),
|
|
2554
2621
|
size: "sm"
|
|
2555
|
-
}, null, 8, ["title"])) : (
|
|
2556
|
-
(
|
|
2622
|
+
}, null, 8, ["title"])) : (d(), w("div", Yo, [
|
|
2623
|
+
(d(!0), w(F, null, Z(e.destinations, (r) => (d(), w("button", {
|
|
2557
2624
|
key: `${r.parentKey}:${r.field}`,
|
|
2558
2625
|
type: "button",
|
|
2559
2626
|
class: "wx-block-move__place",
|
|
2560
2627
|
disabled: r.full,
|
|
2561
|
-
onClick: (
|
|
2628
|
+
onClick: (c) => n(l)(r)
|
|
2562
2629
|
}, [
|
|
2563
|
-
v(n(
|
|
2630
|
+
v(n(we), {
|
|
2564
2631
|
name: r.parentKey === null ? "file" : "folder"
|
|
2565
2632
|
}, null, 8, ["name"]),
|
|
2566
|
-
|
|
2567
|
-
r.trail.length === 0 ? (
|
|
2568
|
-
|
|
2569
|
-
], 64)) : (
|
|
2570
|
-
u > 0 ? (
|
|
2571
|
-
|
|
2572
|
-
class:
|
|
2573
|
-
}, k(
|
|
2633
|
+
C("span", Go, [
|
|
2634
|
+
r.trail.length === 0 ? (d(), w(F, { key: 0 }, [
|
|
2635
|
+
L(k(e.topLabel), 1)
|
|
2636
|
+
], 64)) : (d(!0), w(F, { key: 1 }, Z(r.trail, (c, u) => (d(), w(F, { key: u }, [
|
|
2637
|
+
u > 0 ? (d(), w("span", Zo, "/")) : B("", !0),
|
|
2638
|
+
C("span", {
|
|
2639
|
+
class: Ne({ "is-last": u === r.trail.length - 1 })
|
|
2640
|
+
}, k(c), 3)
|
|
2574
2641
|
], 64))), 128))
|
|
2575
2642
|
]),
|
|
2576
|
-
r.full ? (
|
|
2643
|
+
r.full ? (d(), W(n(Y), {
|
|
2577
2644
|
key: 0,
|
|
2578
2645
|
size: "sm",
|
|
2579
2646
|
tone: "muted"
|
|
2580
2647
|
}, {
|
|
2581
2648
|
default: g(() => [
|
|
2582
|
-
|
|
2649
|
+
L(k(n(a)("field.move-full")), 1)
|
|
2583
2650
|
]),
|
|
2584
2651
|
_: 1
|
|
2585
|
-
})) :
|
|
2586
|
-
], 8,
|
|
2652
|
+
})) : B("", !0)
|
|
2653
|
+
], 8, Jo))), 128))
|
|
2587
2654
|
]))
|
|
2588
2655
|
]),
|
|
2589
2656
|
_: 1
|
|
2590
2657
|
}, 8, ["open", "title"]));
|
|
2591
2658
|
}
|
|
2592
|
-
}),
|
|
2593
|
-
function
|
|
2594
|
-
let l =
|
|
2595
|
-
return l === void 0 && (l = fetch(e, { credentials: "same-origin", headers: { Accept: "text/html" } }).then((t) => t.ok ? t.text() : null).then((t) => t === null ? null :
|
|
2659
|
+
}), Qo = /* @__PURE__ */ se(Xo, [["__scopeId", "data-v-41c2ff3e"]]), ol = /* @__PURE__ */ new Map();
|
|
2660
|
+
function es(e) {
|
|
2661
|
+
let l = ol.get(e);
|
|
2662
|
+
return l === void 0 && (l = fetch(e, { credentials: "same-origin", headers: { Accept: "text/html" } }).then((t) => t.ok ? t.text() : null).then((t) => t === null ? null : Tn(t, e)).catch(() => null), ol.set(e, l)), l;
|
|
2596
2663
|
}
|
|
2597
|
-
function
|
|
2598
|
-
const e = Fe(
|
|
2664
|
+
function ts() {
|
|
2665
|
+
const e = Fe(ul, null), l = P(null), t = S(() => {
|
|
2599
2666
|
const a = e?.state.manifest?.modules.find((i) => i.id === "blocks")?.meta?.stage;
|
|
2600
2667
|
return typeof a == "string" && a !== "" ? a : null;
|
|
2601
2668
|
});
|
|
2602
|
-
return
|
|
2669
|
+
return Kl(() => {
|
|
2603
2670
|
const o = t.value;
|
|
2604
|
-
o !== null &&
|
|
2671
|
+
o !== null && es(o).then((a) => {
|
|
2605
2672
|
t.value === o && (l.value = a);
|
|
2606
2673
|
});
|
|
2607
2674
|
}), l;
|
|
2608
2675
|
}
|
|
2609
|
-
const
|
|
2676
|
+
const ls = ["srcdoc"], ns = {
|
|
2610
2677
|
key: 1,
|
|
2611
2678
|
class: "wx-block-thumb__empty"
|
|
2612
|
-
},
|
|
2679
|
+
}, $t = 1600, os = /* @__PURE__ */ oe({
|
|
2613
2680
|
__name: "BlockThumb",
|
|
2614
2681
|
props: {
|
|
2615
2682
|
thumbnail: {},
|
|
@@ -2618,7 +2685,7 @@ const Xo = ["srcdoc"], Qo = {
|
|
|
2618
2685
|
fit: { type: Boolean, default: !1 }
|
|
2619
2686
|
},
|
|
2620
2687
|
setup(e) {
|
|
2621
|
-
const l = e, t =
|
|
2688
|
+
const l = e, t = P(null), o = gt(t), a = P(null), i = S(() => o.value > 0 ? o.value / l.width : 0.2), s = S(() => {
|
|
2622
2689
|
const f = a.value;
|
|
2623
2690
|
if (!l.fit || !f || f.width <= 0 || f.height <= 0 || o.value <= 0)
|
|
2624
2691
|
return null;
|
|
@@ -2628,22 +2695,22 @@ const Xo = ["srcdoc"], Qo = {
|
|
|
2628
2695
|
x: (o.value - f.width * h) / 2 - f.left * h,
|
|
2629
2696
|
y: (l.height - f.height * h) / 2 - f.top * h
|
|
2630
2697
|
};
|
|
2631
|
-
}), r =
|
|
2698
|
+
}), r = ts(), c = S(() => {
|
|
2632
2699
|
if (!l.thumbnail) return "";
|
|
2633
2700
|
const f = { html: l.thumbnail.html, styles: l.thumbnail.styles };
|
|
2634
|
-
return r.value ? Cn(r.value, f) :
|
|
2701
|
+
return r.value ? Cn(r.value, f) : ml(f);
|
|
2635
2702
|
}), u = S(() => {
|
|
2636
2703
|
const f = s.value, h = a.value;
|
|
2637
2704
|
return f && h ? {
|
|
2638
2705
|
width: `${l.width}px`,
|
|
2639
|
-
height: `${
|
|
2706
|
+
height: `${$t}px`,
|
|
2640
2707
|
transform: `translate(${f.x}px, ${f.y}px) scale(${f.scale})`,
|
|
2641
2708
|
// The component alone: the rest of the frame is a white page around it, and moved off
|
|
2642
2709
|
// the corner it shows as a white slab beside a small badge.
|
|
2643
|
-
clipPath: `inset(${h.top}px ${l.width - h.left - h.width}px ${
|
|
2710
|
+
clipPath: `inset(${h.top}px ${l.width - h.left - h.width}px ${$t - h.top - h.height}px ${h.left}px)`
|
|
2644
2711
|
} : {
|
|
2645
2712
|
width: `${l.width}px`,
|
|
2646
|
-
height: l.fit ? `${
|
|
2713
|
+
height: l.fit ? `${$t}px` : `${Math.round(l.height / i.value)}px`,
|
|
2647
2714
|
transform: `scale(${i.value})`,
|
|
2648
2715
|
// Until it is measured, a fitted frame would flash its top at the wrong scale; measured and
|
|
2649
2716
|
// found to have no size (a root with `display: contents`), it is drawn the ordinary way.
|
|
@@ -2651,7 +2718,7 @@ const Xo = ["srcdoc"], Qo = {
|
|
|
2651
2718
|
};
|
|
2652
2719
|
});
|
|
2653
2720
|
let m = null;
|
|
2654
|
-
function
|
|
2721
|
+
function p(f) {
|
|
2655
2722
|
if (!l.fit) return;
|
|
2656
2723
|
m?.disconnect();
|
|
2657
2724
|
const h = f.target, x = h.contentWindow, T = h.contentDocument;
|
|
@@ -2662,34 +2729,34 @@ const Xo = ["srcdoc"], Qo = {
|
|
|
2662
2729
|
};
|
|
2663
2730
|
b(), m = new x.ResizeObserver(b), m.observe(_);
|
|
2664
2731
|
}
|
|
2665
|
-
return st(() => m?.disconnect()), (f, h) => (
|
|
2732
|
+
return st(() => m?.disconnect()), (f, h) => (d(), w("div", {
|
|
2666
2733
|
ref_key: "box",
|
|
2667
2734
|
ref: t,
|
|
2668
2735
|
class: "wx-block-thumb",
|
|
2669
2736
|
style: Ie({ height: `${e.height}px` })
|
|
2670
2737
|
}, [
|
|
2671
|
-
e.thumbnail ? (
|
|
2738
|
+
e.thumbnail ? (d(), w("iframe", {
|
|
2672
2739
|
key: 0,
|
|
2673
2740
|
class: "wx-block-thumb__frame",
|
|
2674
|
-
srcdoc:
|
|
2741
|
+
srcdoc: c.value,
|
|
2675
2742
|
style: Ie(u.value),
|
|
2676
2743
|
sandbox: "allow-same-origin",
|
|
2677
2744
|
tabindex: "-1",
|
|
2678
2745
|
"aria-hidden": "true",
|
|
2679
|
-
onLoad:
|
|
2680
|
-
}, null, 44,
|
|
2681
|
-
v(n(
|
|
2746
|
+
onLoad: p
|
|
2747
|
+
}, null, 44, ls)) : (d(), w("div", ns, [
|
|
2748
|
+
v(n(we), { name: "grid" })
|
|
2682
2749
|
]))
|
|
2683
2750
|
], 4));
|
|
2684
2751
|
}
|
|
2685
|
-
}),
|
|
2752
|
+
}), Vl = /* @__PURE__ */ se(os, [["__scopeId", "data-v-7421ce33"]]);
|
|
2686
2753
|
function Vt(e, l, t) {
|
|
2687
2754
|
if (l === null)
|
|
2688
2755
|
return (t === null || t.includes(e.slug)) && (e.allowed_in === null || e.allowed_in.includes("root"));
|
|
2689
2756
|
const o = t ? t.includes(e.slug) : l.allow?.includes(e.slug) === !0, a = e.allowed_in === null || e.allowed_in.includes(l.slug);
|
|
2690
2757
|
return o && a;
|
|
2691
2758
|
}
|
|
2692
|
-
function
|
|
2759
|
+
function ss(e, l, t, o) {
|
|
2693
2760
|
const a = me(e, l), i = a ? t.find((u) => u.slug === a.node.type) : void 0;
|
|
2694
2761
|
if (!a || !i) return [];
|
|
2695
2762
|
const s = [], r = (u, m) => (a.parent?.key ?? null) === u && a.field === m;
|
|
@@ -2699,27 +2766,27 @@ function ts(e, l, t, o) {
|
|
|
2699
2766
|
trail: [],
|
|
2700
2767
|
full: o.max !== null && e.length >= o.max
|
|
2701
2768
|
});
|
|
2702
|
-
const
|
|
2703
|
-
for (const
|
|
2704
|
-
if (
|
|
2705
|
-
const f = t.find((x) => x.slug ===
|
|
2769
|
+
const c = (u, m) => {
|
|
2770
|
+
for (const p of u) {
|
|
2771
|
+
if (p.key === l) continue;
|
|
2772
|
+
const f = t.find((x) => x.slug === p.type), h = f?.content ? It(f.content.schema) : [];
|
|
2706
2773
|
for (const x of h) {
|
|
2707
|
-
const T = f.title, _ = h.length > 1 ? `${T} · ${x.label ?? x.id}` : T, b =
|
|
2708
|
-
!r(
|
|
2709
|
-
parentKey:
|
|
2774
|
+
const T = f.title, _ = h.length > 1 ? `${T} · ${x.label ?? x.id}` : T, b = p.values[x.id], $ = rt(b) ? b : [], R = x.props?.max ?? null, G = x.props?.allow ?? null;
|
|
2775
|
+
!r(p.key, x.id) && Vt(i, f, G) && s.push({
|
|
2776
|
+
parentKey: p.key,
|
|
2710
2777
|
field: x.id,
|
|
2711
2778
|
trail: [...m, _],
|
|
2712
2779
|
full: R !== null && $.length >= R
|
|
2713
|
-
}),
|
|
2780
|
+
}), c($, [...m, _]);
|
|
2714
2781
|
}
|
|
2715
2782
|
}
|
|
2716
2783
|
};
|
|
2717
|
-
return
|
|
2784
|
+
return c(e, []), s;
|
|
2718
2785
|
}
|
|
2719
|
-
const
|
|
2786
|
+
const as = { class: "wx-block-picker" }, is = {
|
|
2720
2787
|
key: 0,
|
|
2721
2788
|
class: "wx-block-picker__group-title"
|
|
2722
|
-
},
|
|
2789
|
+
}, rs = { class: "wx-block-picker__cards" }, us = ["disabled", "title", "onClick"], cs = { class: "wx-block-picker__body" }, ds = { class: "wx-block-picker__title" }, ps = /* @__PURE__ */ oe({
|
|
2723
2790
|
__name: "BlockPicker",
|
|
2724
2791
|
props: {
|
|
2725
2792
|
catalog: {},
|
|
@@ -2730,22 +2797,22 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
2730
2797
|
blocksPath: { default: null }
|
|
2731
2798
|
},
|
|
2732
2799
|
setup(e) {
|
|
2733
|
-
const l = e, { resolve: t, dismiss: o, open: a } =
|
|
2734
|
-
|
|
2735
|
-
const i = de("webx-blocks"), s =
|
|
2800
|
+
const l = e, { resolve: t, dismiss: o, open: a } = Lt();
|
|
2801
|
+
Me();
|
|
2802
|
+
const i = de("webx-blocks"), s = P("");
|
|
2736
2803
|
function r(f) {
|
|
2737
2804
|
return Vt(f, l.parent, l.allow);
|
|
2738
2805
|
}
|
|
2739
|
-
const
|
|
2806
|
+
const c = S(
|
|
2740
2807
|
() => l.catalog.filter(
|
|
2741
2808
|
(f) => $e(f) !== "component" && f.is_enabled && f.published !== null && r(f)
|
|
2742
2809
|
).map((f) => {
|
|
2743
|
-
const h =
|
|
2810
|
+
const h = zn(l.tree, f.slug), x = f.max_per_entity !== null && h >= f.max_per_entity;
|
|
2744
2811
|
return { type: f, reason: x ? i("field.limit-reached", { count: h }) : null };
|
|
2745
2812
|
})
|
|
2746
2813
|
), u = S(() => {
|
|
2747
2814
|
const f = s.value.trim().toLowerCase();
|
|
2748
|
-
return f === "" ?
|
|
2815
|
+
return f === "" ? c.value : c.value.filter(
|
|
2749
2816
|
({ type: h }) => h.title.toLowerCase().includes(f) || h.slug.includes(f) || (h.description ?? "").toLowerCase().includes(f)
|
|
2750
2817
|
);
|
|
2751
2818
|
}), m = S(() => {
|
|
@@ -2758,9 +2825,9 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
2758
2825
|
options: u.value.filter((_) => _.type.group === T)
|
|
2759
2826
|
})).filter((T) => T.options.length > 0);
|
|
2760
2827
|
return u.value.length <= 5 || s.value.trim() !== "" || h.length < 2 ? [{ id: "", label: "", options: u.value }] : h;
|
|
2761
|
-
}),
|
|
2828
|
+
}), p = S(() => {
|
|
2762
2829
|
if (l.catalog.length === 0) return i("field.pick-none");
|
|
2763
|
-
if (
|
|
2830
|
+
if (c.value.length === 0 && l.parent) {
|
|
2764
2831
|
const f = (l.allow ?? l.parent.allow ?? []).filter(
|
|
2765
2832
|
(h) => l.catalog.some((x) => x.slug === h)
|
|
2766
2833
|
);
|
|
@@ -2770,9 +2837,9 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
2770
2837
|
});
|
|
2771
2838
|
return (f, h) => {
|
|
2772
2839
|
const x = Mt("router-link");
|
|
2773
|
-
return
|
|
2840
|
+
return d(), W(n(Bt), {
|
|
2774
2841
|
open: n(a),
|
|
2775
|
-
"onUpdate:open": h[2] || (h[2] = (T) =>
|
|
2842
|
+
"onUpdate:open": h[2] || (h[2] = (T) => zt(a) ? a.value = T : null),
|
|
2776
2843
|
title: n(i)("field.pick"),
|
|
2777
2844
|
width: 860
|
|
2778
2845
|
}, {
|
|
@@ -2782,81 +2849,81 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
2782
2849
|
onClick: h[1] || (h[1] = (T) => n(o)())
|
|
2783
2850
|
}, {
|
|
2784
2851
|
default: g(() => [
|
|
2785
|
-
|
|
2852
|
+
L(k(n(i)("field.close")), 1)
|
|
2786
2853
|
]),
|
|
2787
2854
|
_: 1
|
|
2788
2855
|
})
|
|
2789
2856
|
]),
|
|
2790
2857
|
default: g(() => [
|
|
2791
|
-
|
|
2792
|
-
|
|
2858
|
+
C("div", as, [
|
|
2859
|
+
c.value.length > 0 ? (d(), W(n(nt), {
|
|
2793
2860
|
key: 0,
|
|
2794
2861
|
modelValue: s.value,
|
|
2795
2862
|
"onUpdate:modelValue": h[0] || (h[0] = (T) => s.value = T),
|
|
2796
2863
|
placeholder: n(i)("field.search"),
|
|
2797
2864
|
clearable: "",
|
|
2798
2865
|
autofocus: ""
|
|
2799
|
-
}, null, 8, ["modelValue", "placeholder"])) :
|
|
2800
|
-
u.value.length === 0 ? (
|
|
2866
|
+
}, null, 8, ["modelValue", "placeholder"])) : B("", !0),
|
|
2867
|
+
u.value.length === 0 ? (d(), W(n(Wt), {
|
|
2801
2868
|
key: 1,
|
|
2802
2869
|
icon: "grid",
|
|
2803
|
-
title:
|
|
2870
|
+
title: p.value,
|
|
2804
2871
|
size: "sm"
|
|
2805
2872
|
}, {
|
|
2806
2873
|
default: g(() => [
|
|
2807
|
-
e.catalog.length === 0 && e.blocksPath ? (
|
|
2874
|
+
e.catalog.length === 0 && e.blocksPath ? (d(), W(x, {
|
|
2808
2875
|
key: 0,
|
|
2809
2876
|
to: e.blocksPath
|
|
2810
2877
|
}, {
|
|
2811
2878
|
default: g(() => [
|
|
2812
|
-
|
|
2879
|
+
L(k(n(i)("field.pick-none-link")), 1)
|
|
2813
2880
|
]),
|
|
2814
2881
|
_: 1
|
|
2815
|
-
}, 8, ["to"])) :
|
|
2882
|
+
}, 8, ["to"])) : B("", !0)
|
|
2816
2883
|
]),
|
|
2817
2884
|
_: 1
|
|
2818
|
-
}, 8, ["title"])) :
|
|
2819
|
-
(
|
|
2885
|
+
}, 8, ["title"])) : B("", !0),
|
|
2886
|
+
(d(!0), w(F, null, Z(m.value, (T) => (d(), w("section", {
|
|
2820
2887
|
key: T.id,
|
|
2821
2888
|
class: "wx-block-picker__group"
|
|
2822
2889
|
}, [
|
|
2823
|
-
T.label ? (
|
|
2824
|
-
|
|
2825
|
-
(
|
|
2890
|
+
T.label ? (d(), w("div", is, k(T.label), 1)) : B("", !0),
|
|
2891
|
+
C("div", rs, [
|
|
2892
|
+
(d(!0), w(F, null, Z(T.options, (_) => (d(), w("button", {
|
|
2826
2893
|
key: _.type.id,
|
|
2827
2894
|
type: "button",
|
|
2828
|
-
class:
|
|
2895
|
+
class: Ne(["wx-block-picker__card", { "is-disabled": _.reason !== null }]),
|
|
2829
2896
|
disabled: _.reason !== null,
|
|
2830
2897
|
title: _.reason ?? void 0,
|
|
2831
2898
|
onClick: (b) => n(t)(_.type)
|
|
2832
2899
|
}, [
|
|
2833
|
-
v(
|
|
2900
|
+
v(Vl, {
|
|
2834
2901
|
thumbnail: _.type.thumbnail,
|
|
2835
2902
|
height: 96
|
|
2836
2903
|
}, null, 8, ["thumbnail"]),
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
_.reason ? (
|
|
2904
|
+
C("div", cs, [
|
|
2905
|
+
C("div", ds, k(_.type.title), 1),
|
|
2906
|
+
_.reason ? (d(), W(n(Y), {
|
|
2840
2907
|
key: 0,
|
|
2841
2908
|
size: "sm",
|
|
2842
2909
|
tone: "warning"
|
|
2843
2910
|
}, {
|
|
2844
2911
|
default: g(() => [
|
|
2845
|
-
|
|
2912
|
+
L(k(_.reason), 1)
|
|
2846
2913
|
]),
|
|
2847
2914
|
_: 2
|
|
2848
|
-
}, 1024)) : _.type.description ? (
|
|
2915
|
+
}, 1024)) : _.type.description ? (d(), W(n(Y), {
|
|
2849
2916
|
key: 1,
|
|
2850
2917
|
size: "sm",
|
|
2851
2918
|
tone: "muted"
|
|
2852
2919
|
}, {
|
|
2853
2920
|
default: g(() => [
|
|
2854
|
-
|
|
2921
|
+
L(k(_.type.description), 1)
|
|
2855
2922
|
]),
|
|
2856
2923
|
_: 2
|
|
2857
|
-
}, 1024)) :
|
|
2924
|
+
}, 1024)) : B("", !0)
|
|
2858
2925
|
])
|
|
2859
|
-
], 10,
|
|
2926
|
+
], 10, us))), 128))
|
|
2860
2927
|
])
|
|
2861
2928
|
]))), 128))
|
|
2862
2929
|
])
|
|
@@ -2865,7 +2932,7 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
2865
2932
|
}, 8, ["open", "title"]);
|
|
2866
2933
|
};
|
|
2867
2934
|
}
|
|
2868
|
-
}),
|
|
2935
|
+
}), fs = /* @__PURE__ */ se(ps, [["__scopeId", "data-v-d04662fd"]]), ms = { class: "wx-blocks-preview__tools" }, hs = ["src", "title"], vs = /* @__PURE__ */ oe({
|
|
2869
2936
|
__name: "BlocksPreview",
|
|
2870
2937
|
props: {
|
|
2871
2938
|
url: {},
|
|
@@ -2875,7 +2942,7 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
2875
2942
|
},
|
|
2876
2943
|
emits: ["select", "edit"],
|
|
2877
2944
|
setup(e, { expose: l, emit: t }) {
|
|
2878
|
-
const o = e, a = t, i = de("webx-blocks"), s =
|
|
2945
|
+
const o = e, a = t, i = de("webx-blocks"), s = P(null), r = P(null), c = P(null), u = gt(c), m = P(!1), p = P(!1), f = P(null), h = P(0), x = S(() => h.value > 0), T = S(() => [
|
|
2879
2946
|
{ value: 1280, icon: "monitor", ariaLabel: i("field.width-desktop") },
|
|
2880
2947
|
{ value: 834, icon: "tablet", ariaLabel: i("field.width-tablet") },
|
|
2881
2948
|
{ value: 390, icon: "smartphone", ariaLabel: i("field.width-phone") }
|
|
@@ -2902,109 +2969,109 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
2902
2969
|
}
|
|
2903
2970
|
}
|
|
2904
2971
|
let ae = null, D = null;
|
|
2905
|
-
function
|
|
2906
|
-
|
|
2972
|
+
function U(M) {
|
|
2973
|
+
M.documentElement.scrollTop !== 0 && (M.documentElement.scrollTop = 0);
|
|
2907
2974
|
}
|
|
2908
2975
|
function Q() {
|
|
2909
|
-
const
|
|
2910
|
-
if (!j || !
|
|
2911
|
-
|
|
2912
|
-
const q =
|
|
2913
|
-
|
|
2976
|
+
const M = ee(), j = M?.body;
|
|
2977
|
+
if (!j || !M?.defaultView) return;
|
|
2978
|
+
U(M);
|
|
2979
|
+
const q = M.defaultView.getComputedStyle(j), pe = (parseFloat(q.marginTop) || 0) + (parseFloat(q.marginBottom) || 0), A = Math.ceil(j.scrollHeight + pe);
|
|
2980
|
+
A !== h.value && (h.value = A, he !== null && ql(() => requestAnimationFrame(_e)));
|
|
2914
2981
|
}
|
|
2915
|
-
function le(
|
|
2982
|
+
function le(M) {
|
|
2916
2983
|
D?.disconnect();
|
|
2917
|
-
const j =
|
|
2918
|
-
!j || !
|
|
2984
|
+
const j = M.defaultView;
|
|
2985
|
+
!j || !M.body || (D = new j.ResizeObserver(Q), D.observe(M.body), Q());
|
|
2919
2986
|
}
|
|
2920
2987
|
function Se() {
|
|
2921
|
-
|
|
2922
|
-
const
|
|
2923
|
-
|
|
2988
|
+
p.value = !0;
|
|
2989
|
+
const M = ee();
|
|
2990
|
+
M && (le(M), ae?.release(), ae = _n(M, {
|
|
2924
2991
|
/* No guard against answering a click with a scroll: `bring` moves nothing that is already
|
|
2925
2992
|
readable, and a block clicked at the very bottom of the window, half under the action
|
|
2926
2993
|
bar, is exactly the one worth moving. */
|
|
2927
2994
|
select: (j) => a("select", j)
|
|
2928
|
-
}),
|
|
2995
|
+
}), yt(M, o.selected ?? null), xe(o.selected ?? null));
|
|
2929
2996
|
}
|
|
2930
2997
|
let he = null, ne = null;
|
|
2931
|
-
function
|
|
2932
|
-
|
|
2998
|
+
function xe(M) {
|
|
2999
|
+
M !== null && (he = M, ne !== null && clearTimeout(ne), ne = window.setTimeout(() => {
|
|
2933
3000
|
he = null, ne = null;
|
|
2934
|
-
}, 400),
|
|
3001
|
+
}, 400), _e());
|
|
2935
3002
|
}
|
|
2936
|
-
function
|
|
3003
|
+
function Le(M) {
|
|
2937
3004
|
const j = s.value?.getBoundingClientRect();
|
|
2938
3005
|
if (!j) return null;
|
|
2939
|
-
const q =
|
|
3006
|
+
const q = M.getBoundingClientRect();
|
|
2940
3007
|
return { top: j.top + q.top * b.value, height: q.height * b.value };
|
|
2941
3008
|
}
|
|
2942
3009
|
function ze() {
|
|
2943
|
-
let
|
|
2944
|
-
for (;
|
|
2945
|
-
const j = getComputedStyle(
|
|
2946
|
-
if ((j === "auto" || j === "scroll") &&
|
|
2947
|
-
return
|
|
2948
|
-
|
|
3010
|
+
let M = s.value?.parentElement ?? null;
|
|
3011
|
+
for (; M; ) {
|
|
3012
|
+
const j = getComputedStyle(M).overflowY;
|
|
3013
|
+
if ((j === "auto" || j === "scroll") && M.scrollHeight > M.clientHeight)
|
|
3014
|
+
return M;
|
|
3015
|
+
M = M.parentElement;
|
|
2949
3016
|
}
|
|
2950
3017
|
return null;
|
|
2951
3018
|
}
|
|
2952
|
-
function
|
|
2953
|
-
const
|
|
2954
|
-
if (he === null || !
|
|
2955
|
-
|
|
2956
|
-
const j =
|
|
3019
|
+
function _e() {
|
|
3020
|
+
const M = ee();
|
|
3021
|
+
if (he === null || !M) return;
|
|
3022
|
+
U(M);
|
|
3023
|
+
const j = Dt(M, he), q = j ? Le(j) : null;
|
|
2957
3024
|
if (!q) return;
|
|
2958
|
-
const pe = ze(),
|
|
2959
|
-
top: (
|
|
2960
|
-
bottom: (
|
|
2961
|
-
},
|
|
2962
|
-
|
|
3025
|
+
const pe = ze(), A = pe?.getBoundingClientRect(), O = r.value?.getBoundingClientRect().height ?? 0, I = {
|
|
3026
|
+
top: (A?.top ?? 0) + O,
|
|
3027
|
+
bottom: (A ? A.bottom : window.innerHeight) - O
|
|
3028
|
+
}, J = q.top + q.height, Te = q.top < I.top, Je = q.height > I.bottom - I.top, Be = Te || Je ? q.top - I.top : J > I.bottom ? J - I.bottom : 0;
|
|
3029
|
+
Be !== 0 && (pe ?? window).scrollBy({ top: Be, behavior: "smooth" });
|
|
2963
3030
|
}
|
|
2964
|
-
function ie(
|
|
3031
|
+
function ie(M, j) {
|
|
2965
3032
|
const q = ee();
|
|
2966
|
-
if (!q || !
|
|
2967
|
-
const pe =
|
|
2968
|
-
return pe &&
|
|
3033
|
+
if (!q || !p.value) return !1;
|
|
3034
|
+
const pe = fl(q, M, j);
|
|
3035
|
+
return pe && yt(q, o.selected ?? null), pe;
|
|
2969
3036
|
}
|
|
2970
3037
|
function ve() {
|
|
2971
|
-
|
|
3038
|
+
p.value = !1, D?.disconnect(), D = null, s.value && o.url && (s.value.src = o.url);
|
|
2972
3039
|
}
|
|
2973
|
-
function
|
|
2974
|
-
|
|
3040
|
+
function Ee(M) {
|
|
3041
|
+
M.key === "Escape" && m.value && (m.value = !1, M.stopPropagation());
|
|
2975
3042
|
}
|
|
2976
3043
|
return ue(
|
|
2977
3044
|
() => o.selected,
|
|
2978
|
-
(
|
|
3045
|
+
(M) => {
|
|
2979
3046
|
const j = ee();
|
|
2980
|
-
!j || !
|
|
3047
|
+
!j || !p.value || (yt(j, M ?? null), xe(M ?? null));
|
|
2981
3048
|
}
|
|
2982
3049
|
), ue(() => o.reload, ve), ue(
|
|
2983
3050
|
() => o.url,
|
|
2984
|
-
() =>
|
|
2985
|
-
), ot(() => window.addEventListener("keydown",
|
|
2986
|
-
window.removeEventListener("keydown",
|
|
2987
|
-
}), l({ replace: ie, refresh: ve, open: () => m.value = !0 }), (
|
|
2988
|
-
class:
|
|
3051
|
+
() => p.value = !1
|
|
3052
|
+
), ot(() => window.addEventListener("keydown", Ee)), st(() => {
|
|
3053
|
+
window.removeEventListener("keydown", Ee), ne !== null && clearTimeout(ne), D?.disconnect(), ae?.release();
|
|
3054
|
+
}), l({ replace: ie, refresh: ve, open: () => m.value = !0 }), (M, j) => (d(), w("div", {
|
|
3055
|
+
class: Ne(["wx-blocks-preview", { "is-fullscreen": m.value, "is-grown": x.value, "is-compact": e.compact }]),
|
|
2989
3056
|
style: Ie({ "--wx-preview-scale": b.value })
|
|
2990
3057
|
}, [
|
|
2991
|
-
|
|
3058
|
+
C("div", {
|
|
2992
3059
|
ref_key: "bar",
|
|
2993
3060
|
ref: r,
|
|
2994
3061
|
class: "wx-blocks-preview__bar"
|
|
2995
3062
|
}, [
|
|
2996
|
-
v(n(
|
|
3063
|
+
v(n(Y), {
|
|
2997
3064
|
size: "xs",
|
|
2998
3065
|
tone: "muted",
|
|
2999
3066
|
class: "wx-blocks-preview__label",
|
|
3000
3067
|
truncate: ""
|
|
3001
3068
|
}, {
|
|
3002
3069
|
default: g(() => [
|
|
3003
|
-
|
|
3070
|
+
L(k(G.value), 1)
|
|
3004
3071
|
]),
|
|
3005
3072
|
_: 1
|
|
3006
3073
|
}),
|
|
3007
|
-
v(n(
|
|
3074
|
+
v(n(al), {
|
|
3008
3075
|
class: "wx-blocks-preview__widths",
|
|
3009
3076
|
"model-value": _.value,
|
|
3010
3077
|
options: T.value,
|
|
@@ -3012,16 +3079,16 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3012
3079
|
"aria-label": n(i)("field.width"),
|
|
3013
3080
|
"onUpdate:modelValue": j[0] || (j[0] = (q) => f.value = Number(q))
|
|
3014
3081
|
}, null, 8, ["model-value", "options", "aria-label"]),
|
|
3015
|
-
|
|
3016
|
-
e.compact ? (
|
|
3082
|
+
C("div", ms, [
|
|
3083
|
+
e.compact ? (d(), W(n(et), {
|
|
3017
3084
|
key: 0,
|
|
3018
3085
|
size: "sm",
|
|
3019
3086
|
tone: "primary",
|
|
3020
3087
|
icon: "edit",
|
|
3021
3088
|
title: n(i)("field.blocks"),
|
|
3022
3089
|
onClick: j[1] || (j[1] = (q) => a("edit"))
|
|
3023
|
-
}, null, 8, ["title"])) :
|
|
3024
|
-
e.url ? (
|
|
3090
|
+
}, null, 8, ["title"])) : B("", !0),
|
|
3091
|
+
e.url ? (d(), W(n(et), {
|
|
3025
3092
|
key: 1,
|
|
3026
3093
|
size: "sm",
|
|
3027
3094
|
icon: "external-link",
|
|
@@ -3030,7 +3097,7 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3030
3097
|
href: e.url,
|
|
3031
3098
|
target: "_blank",
|
|
3032
3099
|
rel: "noopener"
|
|
3033
|
-
}, null, 8, ["title", "href"])) :
|
|
3100
|
+
}, null, 8, ["title", "href"])) : B("", !0),
|
|
3034
3101
|
v(n(et), {
|
|
3035
3102
|
size: "sm",
|
|
3036
3103
|
icon: m.value ? "minimize" : "maximize",
|
|
@@ -3040,16 +3107,16 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3040
3107
|
}, null, 8, ["icon", "title"])
|
|
3041
3108
|
])
|
|
3042
3109
|
], 512),
|
|
3043
|
-
|
|
3110
|
+
C("div", {
|
|
3044
3111
|
ref_key: "box",
|
|
3045
|
-
ref:
|
|
3112
|
+
ref: c,
|
|
3046
3113
|
class: "wx-blocks-preview__ground"
|
|
3047
3114
|
}, [
|
|
3048
|
-
|
|
3115
|
+
C("div", {
|
|
3049
3116
|
class: "wx-blocks-preview__clip",
|
|
3050
3117
|
style: Ie(R.value)
|
|
3051
3118
|
}, [
|
|
3052
|
-
e.url ? (
|
|
3119
|
+
e.url ? (d(), w("iframe", {
|
|
3053
3120
|
key: 0,
|
|
3054
3121
|
ref_key: "frame",
|
|
3055
3122
|
ref: s,
|
|
@@ -3058,15 +3125,15 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3058
3125
|
style: Ie($.value),
|
|
3059
3126
|
title: n(i)("field.preview"),
|
|
3060
3127
|
onLoad: Se
|
|
3061
|
-
}, null, 44,
|
|
3128
|
+
}, null, 44, hs)) : B("", !0)
|
|
3062
3129
|
], 4)
|
|
3063
3130
|
], 512)
|
|
3064
3131
|
], 6));
|
|
3065
3132
|
}
|
|
3066
|
-
}),
|
|
3133
|
+
}), bs = /* @__PURE__ */ se(vs, [["__scopeId", "data-v-398e4cef"]]), gs = { class: "wx-blocks-tree__node" }, ks = ["onClick", "onKeydown"], ys = { class: "wx-blocks-tree__name" }, ws = ["title"], xs = ["title"], _s = ["title"], $s = ["title"], Ss = {
|
|
3067
3134
|
key: 4,
|
|
3068
3135
|
class: "wx-blocks-tree__actions"
|
|
3069
|
-
},
|
|
3136
|
+
}, Es = ["onClick"], Ts = /* @__PURE__ */ oe({
|
|
3070
3137
|
__name: "BlocksTree",
|
|
3071
3138
|
props: {
|
|
3072
3139
|
nodes: {},
|
|
@@ -3083,20 +3150,20 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3083
3150
|
setup(e, { emit: l }) {
|
|
3084
3151
|
const t = e, o = l, a = de("webx-blocks");
|
|
3085
3152
|
function i(m) {
|
|
3086
|
-
return t.catalog.find((
|
|
3153
|
+
return t.catalog.find((p) => p.slug === m.type) ?? null;
|
|
3087
3154
|
}
|
|
3088
3155
|
function s(m) {
|
|
3089
3156
|
return i(m)?.title ?? m.type;
|
|
3090
3157
|
}
|
|
3091
3158
|
function r(m) {
|
|
3092
|
-
const
|
|
3093
|
-
return
|
|
3159
|
+
const p = i(m);
|
|
3160
|
+
return p?.content ? It(p.content.schema) : [];
|
|
3094
3161
|
}
|
|
3095
|
-
function
|
|
3096
|
-
const f = m.values[
|
|
3162
|
+
function c(m, p) {
|
|
3163
|
+
const f = m.values[p.id];
|
|
3097
3164
|
return Array.isArray(f) ? f : [];
|
|
3098
3165
|
}
|
|
3099
|
-
function u(m,
|
|
3166
|
+
function u(m, p) {
|
|
3100
3167
|
const f = t.fieldNode ? t.fieldNode.props?.max ?? null : t.max;
|
|
3101
3168
|
return [
|
|
3102
3169
|
/*
|
|
@@ -3109,7 +3176,7 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3109
3176
|
icon: "plus",
|
|
3110
3177
|
label: a("field.add-after"),
|
|
3111
3178
|
disabled: f !== null && t.nodes.length >= f,
|
|
3112
|
-
run: () => o("add", t.parentKey, t.field, t.fieldNode,
|
|
3179
|
+
run: () => o("add", t.parentKey, t.field, t.fieldNode, p + 1)
|
|
3113
3180
|
},
|
|
3114
3181
|
{
|
|
3115
3182
|
key: "visibility",
|
|
@@ -3138,9 +3205,9 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3138
3205
|
}
|
|
3139
3206
|
];
|
|
3140
3207
|
}
|
|
3141
|
-
return (m,
|
|
3208
|
+
return (m, p) => {
|
|
3142
3209
|
const f = Mt("blocks-tree", !0);
|
|
3143
|
-
return
|
|
3210
|
+
return d(), W(n(Pl), {
|
|
3144
3211
|
"model-value": e.nodes,
|
|
3145
3212
|
"item-key": "key",
|
|
3146
3213
|
"item-label": (h) => s(h),
|
|
@@ -3148,61 +3215,61 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3148
3215
|
plain: "",
|
|
3149
3216
|
size: "sm",
|
|
3150
3217
|
"empty-text": e.depth === 0 ? n(a)("field.empty") : "",
|
|
3151
|
-
class:
|
|
3152
|
-
"onUpdate:modelValue":
|
|
3218
|
+
class: Ne(["wx-blocks-tree", { "is-nested": e.depth > 0 }]),
|
|
3219
|
+
"onUpdate:modelValue": p[7] || (p[7] = (h) => o("reorder", e.parentKey, e.field, h))
|
|
3153
3220
|
}, {
|
|
3154
3221
|
default: g(({ item: h, index: x }) => [
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
class:
|
|
3222
|
+
C("div", gs, [
|
|
3223
|
+
C("div", {
|
|
3224
|
+
class: Ne(["wx-blocks-tree__row", { "is-selected": e.selected === h.key, "is-hidden": h.hidden === !0 }]),
|
|
3158
3225
|
role: "button",
|
|
3159
3226
|
tabindex: "0",
|
|
3160
3227
|
onClick: (T) => o("select", h.key),
|
|
3161
3228
|
onKeydown: [
|
|
3162
|
-
|
|
3163
|
-
|
|
3229
|
+
qt(Yt((T) => o("select", h.key), ["prevent"]), ["enter"]),
|
|
3230
|
+
qt(Yt((T) => o("select", h.key), ["prevent"]), ["space"])
|
|
3164
3231
|
]
|
|
3165
3232
|
}, [
|
|
3166
|
-
|
|
3167
|
-
i(h) ? i(h)?.draft ? (
|
|
3233
|
+
C("span", ys, k(s(h)), 1),
|
|
3234
|
+
i(h) ? i(h)?.draft ? (d(), w("span", {
|
|
3168
3235
|
key: 1,
|
|
3169
3236
|
class: "wx-blocks-tree__flag is-warning",
|
|
3170
3237
|
title: n(a)("field.draft-type")
|
|
3171
3238
|
}, [
|
|
3172
|
-
v(n(
|
|
3173
|
-
], 8,
|
|
3239
|
+
v(n(we), { name: "warning" })
|
|
3240
|
+
], 8, xs)) : i(h)?.is_enabled === !1 ? (d(), w("span", {
|
|
3174
3241
|
key: 2,
|
|
3175
3242
|
class: "wx-blocks-tree__flag",
|
|
3176
3243
|
title: n(a)("field.disabled-type")
|
|
3177
3244
|
}, [
|
|
3178
|
-
v(n(
|
|
3179
|
-
], 8,
|
|
3245
|
+
v(n(we), { name: "lock" })
|
|
3246
|
+
], 8, _s)) : B("", !0) : (d(), w("span", {
|
|
3180
3247
|
key: 0,
|
|
3181
3248
|
class: "wx-blocks-tree__flag is-danger",
|
|
3182
3249
|
title: n(a)("field.unknown-type", { type: h.type })
|
|
3183
3250
|
}, [
|
|
3184
|
-
v(n(
|
|
3185
|
-
], 8,
|
|
3186
|
-
h.hidden === !0 ? (
|
|
3251
|
+
v(n(we), { name: "close-circle" })
|
|
3252
|
+
], 8, ws)),
|
|
3253
|
+
h.hidden === !0 ? (d(), w("span", {
|
|
3187
3254
|
key: 3,
|
|
3188
3255
|
class: "wx-blocks-tree__flag",
|
|
3189
3256
|
title: n(a)("field.hidden-note")
|
|
3190
3257
|
}, [
|
|
3191
|
-
v(n(
|
|
3192
|
-
], 8,
|
|
3193
|
-
e.disabled ?
|
|
3194
|
-
v(n(
|
|
3258
|
+
v(n(we), { name: "eye-off" })
|
|
3259
|
+
], 8, $s)) : B("", !0),
|
|
3260
|
+
e.disabled ? B("", !0) : (d(), w("span", Ss, [
|
|
3261
|
+
v(n(nn), {
|
|
3195
3262
|
actions: u(h, x),
|
|
3196
3263
|
label: s(h)
|
|
3197
3264
|
}, null, 8, ["actions", "label"])
|
|
3198
3265
|
]))
|
|
3199
|
-
], 42,
|
|
3200
|
-
(
|
|
3266
|
+
], 42, ks),
|
|
3267
|
+
(d(!0), w(F, null, Z(r(h), (T) => (d(), w("div", {
|
|
3201
3268
|
key: T.id,
|
|
3202
3269
|
class: "wx-blocks-tree__kids"
|
|
3203
3270
|
}, [
|
|
3204
3271
|
v(f, {
|
|
3205
|
-
nodes:
|
|
3272
|
+
nodes: c(h, T),
|
|
3206
3273
|
catalog: e.catalog,
|
|
3207
3274
|
"parent-key": h.key,
|
|
3208
3275
|
field: T.id,
|
|
@@ -3210,25 +3277,25 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3210
3277
|
selected: e.selected,
|
|
3211
3278
|
disabled: e.disabled,
|
|
3212
3279
|
depth: e.depth + 1,
|
|
3213
|
-
onSelect:
|
|
3214
|
-
onAdd:
|
|
3215
|
-
onRemove:
|
|
3216
|
-
onDuplicate:
|
|
3217
|
-
onMove:
|
|
3218
|
-
onVisibility:
|
|
3219
|
-
onReorder:
|
|
3280
|
+
onSelect: p[0] || (p[0] = (_) => o("select", _)),
|
|
3281
|
+
onAdd: p[1] || (p[1] = (_, b, $, R) => o("add", _, b, $, R)),
|
|
3282
|
+
onRemove: p[2] || (p[2] = (_) => o("remove", _)),
|
|
3283
|
+
onDuplicate: p[3] || (p[3] = (_) => o("duplicate", _)),
|
|
3284
|
+
onMove: p[4] || (p[4] = (_) => o("move", _)),
|
|
3285
|
+
onVisibility: p[5] || (p[5] = (_, b) => o("visibility", _, b)),
|
|
3286
|
+
onReorder: p[6] || (p[6] = (_, b, $) => o("reorder", _, b, $))
|
|
3220
3287
|
}, null, 8, ["nodes", "catalog", "parent-key", "field", "field-node", "selected", "disabled", "depth"]),
|
|
3221
|
-
e.disabled ?
|
|
3288
|
+
e.disabled ? B("", !0) : (d(), w("button", {
|
|
3222
3289
|
key: 0,
|
|
3223
3290
|
type: "button",
|
|
3224
3291
|
class: "wx-blocks-tree__add is-inner",
|
|
3225
3292
|
onClick: (_) => o("add", h.key, T.id, T)
|
|
3226
3293
|
}, [
|
|
3227
|
-
|
|
3228
|
-
r(h).length > 1 ? (
|
|
3229
|
-
|
|
3230
|
-
], 64)) :
|
|
3231
|
-
], 8,
|
|
3294
|
+
L(" + " + k(n(a)("field.add-inside")), 1),
|
|
3295
|
+
r(h).length > 1 ? (d(), w(F, { key: 0 }, [
|
|
3296
|
+
L(" · " + k(T.label ?? T.id), 1)
|
|
3297
|
+
], 64)) : B("", !0)
|
|
3298
|
+
], 8, Es))
|
|
3232
3299
|
]))), 128))
|
|
3233
3300
|
])
|
|
3234
3301
|
]),
|
|
@@ -3236,26 +3303,26 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3236
3303
|
}, 8, ["model-value", "item-label", "disabled", "empty-text", "class"]);
|
|
3237
3304
|
};
|
|
3238
3305
|
}
|
|
3239
|
-
}),
|
|
3306
|
+
}), Cs = /* @__PURE__ */ se(Ts, [["__scopeId", "data-v-3cef28cd"]]), As = {
|
|
3240
3307
|
key: 0,
|
|
3241
3308
|
class: "wx-blocks-nested"
|
|
3242
|
-
},
|
|
3309
|
+
}, Vs = {
|
|
3243
3310
|
key: 0,
|
|
3244
3311
|
class: "wx-blocks__tree"
|
|
3245
|
-
},
|
|
3312
|
+
}, Ls = { class: "wx-blocks__panel-head" }, Bs = { class: "wx-blocks__panel-title" }, Ws = { class: "wx-blocks__list" }, Ns = { class: "wx-blocks__tools" }, Ms = {
|
|
3246
3313
|
key: 1,
|
|
3247
3314
|
class: "wx-blocks__fields"
|
|
3248
|
-
},
|
|
3315
|
+
}, zs = { class: "wx-blocks__panel-head" }, Ds = { class: "wx-blocks__panel-title" }, Os = {
|
|
3249
3316
|
key: 0,
|
|
3250
3317
|
class: "wx-blocks__trail"
|
|
3251
|
-
},
|
|
3318
|
+
}, Is = ["onClick"], Ps = { class: "wx-blocks__panel-name" }, Us = { class: "wx-blocks__panel-extra" }, Rs = { key: 0 }, js = { class: "wx-blocks__form" }, Fs = {
|
|
3252
3319
|
key: 0,
|
|
3253
3320
|
class: "wx-blocks__preview"
|
|
3254
|
-
},
|
|
3321
|
+
}, Hs = /* @__PURE__ */ oe({
|
|
3255
3322
|
name: "WxBlocks",
|
|
3256
3323
|
inheritAttrs: !1,
|
|
3257
3324
|
__name: "BlocksField",
|
|
3258
|
-
props: /* @__PURE__ */
|
|
3325
|
+
props: /* @__PURE__ */ Xl({
|
|
3259
3326
|
node: { default: void 0 },
|
|
3260
3327
|
context: { default: void 0 },
|
|
3261
3328
|
name: { default: void 0 },
|
|
@@ -3271,37 +3338,37 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3271
3338
|
}),
|
|
3272
3339
|
emits: ["update:modelValue"],
|
|
3273
3340
|
setup(e) {
|
|
3274
|
-
const l = e, t =
|
|
3275
|
-
|
|
3276
|
-
const i = de("webx-blocks"), s = it(), r = Fe(
|
|
3277
|
-
let
|
|
3278
|
-
const u =
|
|
3279
|
-
() => h.value ? m.value.find((
|
|
3341
|
+
const l = e, t = Yl(e, "modelValue"), o = Fe(nl, !1), a = Fe(Tl, null);
|
|
3342
|
+
Nt(nl, !0), Me();
|
|
3343
|
+
const i = de("webx-blocks"), s = it(), r = Fe(ul, null);
|
|
3344
|
+
let c = null;
|
|
3345
|
+
const u = P([]), m = S(() => l.catalog ?? u.value), p = S(() => Array.isArray(t.value) ? t.value : []), f = P(null), h = S(() => f.value ? me(p.value, f.value) : null), x = S(
|
|
3346
|
+
() => h.value ? m.value.find((V) => V.slug === h.value?.node.type) ?? null : null
|
|
3280
3347
|
);
|
|
3281
|
-
function T(
|
|
3282
|
-
return m.value.find((z) => z.slug ===
|
|
3348
|
+
function T(V) {
|
|
3349
|
+
return m.value.find((z) => z.slug === V.type)?.title ?? V.type;
|
|
3283
3350
|
}
|
|
3284
3351
|
const _ = S(() => {
|
|
3285
|
-
const
|
|
3286
|
-
return ut(
|
|
3352
|
+
const V = [];
|
|
3353
|
+
return ut(p.value, (z) => V.push(z.key)), V;
|
|
3287
3354
|
}), b = S(() => {
|
|
3288
|
-
const
|
|
3355
|
+
const V = f.value ? _.value.indexOf(f.value) : -1;
|
|
3289
3356
|
return {
|
|
3290
|
-
previous:
|
|
3291
|
-
next:
|
|
3357
|
+
previous: V > 0 ? _.value[V - 1] : null,
|
|
3358
|
+
next: V >= 0 && V < _.value.length - 1 ? _.value[V + 1] : null
|
|
3292
3359
|
};
|
|
3293
3360
|
}), $ = S(() => {
|
|
3294
|
-
const
|
|
3361
|
+
const V = [];
|
|
3295
3362
|
let z = h.value?.parent ?? null;
|
|
3296
3363
|
for (; z; )
|
|
3297
|
-
|
|
3298
|
-
return
|
|
3299
|
-
}), R = Fe(
|
|
3364
|
+
V.unshift({ key: z.key, title: T(z) }), z = me(p.value, z.key)?.parent ?? null;
|
|
3365
|
+
return V;
|
|
3366
|
+
}), R = Fe(Pt, null), G = P(null), ee = P(null), ae = gt(ee), D = S(() => R !== null && R.url.value !== null), U = S(() => D.value && ae.value > 0 && ae.value <= 900), Q = P(!1), le = S(() => {
|
|
3300
3367
|
if (!h.value) return;
|
|
3301
|
-
const
|
|
3302
|
-
return [...$.value.map((z) => z.title),
|
|
3368
|
+
const V = x.value?.title ?? h.value.node.type;
|
|
3369
|
+
return [...$.value.map((z) => z.title), V].join(" / ");
|
|
3303
3370
|
}), Se = S(
|
|
3304
|
-
() =>
|
|
3371
|
+
() => U.value ? {
|
|
3305
3372
|
/* Up from the bottom, and not all the way: the strip of page left above it is what
|
|
3306
3373
|
says the sheet is over the page rather than instead of it. No heading of its own —
|
|
3307
3374
|
the panels inside carry theirs, and the × is the one thing the sheet has to add. */
|
|
@@ -3320,41 +3387,41 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3320
3387
|
which already says what it is and how many. */
|
|
3321
3388
|
title: le.value,
|
|
3322
3389
|
open: Q.value,
|
|
3323
|
-
"onUpdate:open": (
|
|
3390
|
+
"onUpdate:open": (V) => Q.value = V
|
|
3324
3391
|
} : {}
|
|
3325
3392
|
), he = S(
|
|
3326
|
-
() => r?.state.manifest?.modules.find((
|
|
3327
|
-
), ne =
|
|
3328
|
-
() => l.context?.translate ?? r?.i18n.t ?? ((
|
|
3329
|
-
), ze = S(() => l.context?.can ?? r?.can ?? (() => !0)),
|
|
3330
|
-
function ie(
|
|
3331
|
-
t.value =
|
|
3393
|
+
() => r?.state.manifest?.modules.find((V) => V.id === "blocks")?.meta?.groups ?? []
|
|
3394
|
+
), ne = Jl()?.type, xe = S(() => l.context?.types ? l.context.types : r?.types ? { ...ft, ...r.types } : ne ? { ...ft, "wx-blocks": { component: ne, kind: "field", nested: !0 } } : ft), Le = S(
|
|
3395
|
+
() => l.context?.translate ?? r?.i18n.t ?? ((V) => V)
|
|
3396
|
+
), ze = S(() => l.context?.can ?? r?.can ?? (() => !0)), _e = Et(fs);
|
|
3397
|
+
function ie(V) {
|
|
3398
|
+
t.value = V;
|
|
3332
3399
|
}
|
|
3333
|
-
async function ve(
|
|
3334
|
-
const te =
|
|
3335
|
-
if (
|
|
3336
|
-
const Ze = await
|
|
3400
|
+
async function ve(V, z, H, be) {
|
|
3401
|
+
const te = V ? me(p.value, V) : null, fe = te ? m.value.find((dt) => dt.slug === te.node.type) ?? null : a?.value ?? null, Ce = V === null ? l.allow : H?.props?.allow ?? null, Ae = V === null ? l.max : H?.props?.max ?? null, Ge = V === null ? p.value : te && z ? te.node.values[z] ?? [] : [];
|
|
3402
|
+
if (Ae != null && Ge.length >= Ae) return;
|
|
3403
|
+
const Ze = await _e({
|
|
3337
3404
|
catalog: m.value,
|
|
3338
3405
|
parent: fe,
|
|
3339
|
-
allow:
|
|
3340
|
-
tree:
|
|
3406
|
+
allow: Ce,
|
|
3407
|
+
tree: p.value,
|
|
3341
3408
|
groups: he.value,
|
|
3342
3409
|
blocksPath: l.blocksPath
|
|
3343
3410
|
});
|
|
3344
3411
|
if (!Ze) return;
|
|
3345
|
-
const
|
|
3346
|
-
ie(
|
|
3412
|
+
const Ue = Mn(Ze.slug, Ee(Ze));
|
|
3413
|
+
ie(wt(p.value, V, z, be ?? Ge.length, Ue)), f.value = Ue.key;
|
|
3347
3414
|
}
|
|
3348
|
-
function
|
|
3349
|
-
const z =
|
|
3415
|
+
function Ee(V) {
|
|
3416
|
+
const z = V.content?.sample ?? {}, H = {};
|
|
3350
3417
|
for (const [be, te] of Object.entries(z))
|
|
3351
3418
|
(!Array.isArray(te) || te.length === 0 || typeof te[0] != "object") && (H[be] = te);
|
|
3352
3419
|
return H;
|
|
3353
3420
|
}
|
|
3354
|
-
async function
|
|
3355
|
-
const z = me(
|
|
3421
|
+
async function M(V) {
|
|
3422
|
+
const z = me(p.value, V);
|
|
3356
3423
|
if (!z) return;
|
|
3357
|
-
const H =
|
|
3424
|
+
const H = Dn(z.node);
|
|
3358
3425
|
await vt({
|
|
3359
3426
|
title: i("field.remove-title", {
|
|
3360
3427
|
title: m.value.find((te) => te.slug === z.node.type)?.title ?? z.node.type
|
|
@@ -3363,21 +3430,21 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3363
3430
|
confirmText: i("field.remove"),
|
|
3364
3431
|
cancelText: i("page.cancel"),
|
|
3365
3432
|
tone: "danger"
|
|
3366
|
-
}) && (f.value ===
|
|
3433
|
+
}) && (f.value === V && (f.value = null), ie(el(p.value, V)));
|
|
3367
3434
|
}
|
|
3368
|
-
function j(
|
|
3369
|
-
const z = me(
|
|
3435
|
+
function j(V) {
|
|
3436
|
+
const z = me(p.value, V);
|
|
3370
3437
|
if (!z) return;
|
|
3371
|
-
const H =
|
|
3372
|
-
ie(
|
|
3438
|
+
const H = gl(z.node);
|
|
3439
|
+
ie(wt(p.value, z.parent?.key ?? null, z.field, z.index + 1, H)), f.value = H.key;
|
|
3373
3440
|
}
|
|
3374
|
-
const q =
|
|
3375
|
-
async function pe(
|
|
3376
|
-
const z = me(
|
|
3441
|
+
const q = Et(Qo);
|
|
3442
|
+
async function pe(V) {
|
|
3443
|
+
const z = me(p.value, V);
|
|
3377
3444
|
if (!z) return;
|
|
3378
3445
|
const H = await q({
|
|
3379
3446
|
title: T(z.node),
|
|
3380
|
-
destinations:
|
|
3447
|
+
destinations: ss(p.value, V, m.value, {
|
|
3381
3448
|
owner: a?.value ?? null,
|
|
3382
3449
|
allow: l.allow,
|
|
3383
3450
|
max: l.max
|
|
@@ -3385,35 +3452,35 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3385
3452
|
topLabel: a?.value?.title ?? i("field.move-page")
|
|
3386
3453
|
});
|
|
3387
3454
|
if (!H) return;
|
|
3388
|
-
const be =
|
|
3389
|
-
ie(
|
|
3455
|
+
const be = el(p.value, V);
|
|
3456
|
+
ie(wt(be, H.parentKey, H.field, Number.MAX_SAFE_INTEGER, z.node));
|
|
3390
3457
|
}
|
|
3391
|
-
function V
|
|
3392
|
-
ie(
|
|
3458
|
+
function A(V, z) {
|
|
3459
|
+
ie(On(p.value, V, z));
|
|
3393
3460
|
}
|
|
3394
|
-
function O(
|
|
3395
|
-
ie(
|
|
3461
|
+
function O(V, z, H) {
|
|
3462
|
+
ie(Un(p.value, V, z, H));
|
|
3396
3463
|
}
|
|
3397
|
-
function I(
|
|
3398
|
-
f.value = f.value ===
|
|
3464
|
+
function I(V) {
|
|
3465
|
+
f.value = f.value === V ? null : V;
|
|
3399
3466
|
}
|
|
3400
|
-
function
|
|
3401
|
-
|
|
3467
|
+
function J(V) {
|
|
3468
|
+
V === null || !me(p.value, V) || (f.value = V, U.value && (Q.value = !0));
|
|
3402
3469
|
}
|
|
3403
3470
|
function Te() {
|
|
3404
3471
|
f.value = null;
|
|
3405
3472
|
}
|
|
3406
|
-
function
|
|
3407
|
-
f.value && ie(
|
|
3473
|
+
function Je(V) {
|
|
3474
|
+
f.value && ie(Pn(p.value, f.value, V));
|
|
3408
3475
|
}
|
|
3409
|
-
let
|
|
3476
|
+
let Be;
|
|
3410
3477
|
ue(
|
|
3411
3478
|
() => h.value?.node.values,
|
|
3412
|
-
(
|
|
3413
|
-
if (!
|
|
3479
|
+
(V, z) => {
|
|
3480
|
+
if (!V || !z || !x.value || !c || !R) return;
|
|
3414
3481
|
const H = f.value, be = x.value.id;
|
|
3415
|
-
clearTimeout(
|
|
3416
|
-
!H || !
|
|
3482
|
+
clearTimeout(Be), Be = setTimeout(() => {
|
|
3483
|
+
!H || !c || c.render(be, { values: V, key: H }).then((te) => {
|
|
3417
3484
|
G.value?.replace(H, te.html) || G.value?.refresh();
|
|
3418
3485
|
}).catch(() => {
|
|
3419
3486
|
});
|
|
@@ -3421,79 +3488,79 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3421
3488
|
},
|
|
3422
3489
|
{ deep: !0 }
|
|
3423
3490
|
);
|
|
3424
|
-
function
|
|
3425
|
-
|
|
3491
|
+
function Pe(V) {
|
|
3492
|
+
V.key === "Escape" && f.value && Te();
|
|
3426
3493
|
}
|
|
3427
3494
|
ot(async () => {
|
|
3428
|
-
if (window.addEventListener("keydown",
|
|
3429
|
-
|
|
3495
|
+
if (window.addEventListener("keydown", Pe), l.catalog === null && r) {
|
|
3496
|
+
c = Ke(r);
|
|
3430
3497
|
try {
|
|
3431
|
-
u.value = await
|
|
3432
|
-
} catch (
|
|
3433
|
-
X.danger(s(
|
|
3498
|
+
u.value = await c.catalog();
|
|
3499
|
+
} catch (V) {
|
|
3500
|
+
X.danger(s(V));
|
|
3434
3501
|
}
|
|
3435
|
-
} else r && (
|
|
3502
|
+
} else r && (c = Ke(r));
|
|
3436
3503
|
}), st(() => {
|
|
3437
|
-
clearTimeout(
|
|
3504
|
+
clearTimeout(Be), window.removeEventListener("keydown", Pe);
|
|
3438
3505
|
});
|
|
3439
3506
|
const ct = S(
|
|
3440
3507
|
() => x.value?.content ? Ut(x.value.content.schema) : []
|
|
3441
3508
|
);
|
|
3442
|
-
return (
|
|
3443
|
-
v(n(
|
|
3509
|
+
return (V, z) => n(o) ? (d(), w("div", As, [
|
|
3510
|
+
v(n(Y), {
|
|
3444
3511
|
size: "sm",
|
|
3445
3512
|
tone: "muted"
|
|
3446
3513
|
}, {
|
|
3447
3514
|
default: g(() => [
|
|
3448
|
-
|
|
3515
|
+
L(k(n(i)("field.nested-note")), 1)
|
|
3449
3516
|
]),
|
|
3450
3517
|
_: 1
|
|
3451
3518
|
})
|
|
3452
|
-
])) : (
|
|
3519
|
+
])) : (d(), w("div", {
|
|
3453
3520
|
key: 1,
|
|
3454
3521
|
ref_key: "host",
|
|
3455
3522
|
ref: ee,
|
|
3456
|
-
class:
|
|
3523
|
+
class: Ne(["wx-blocks-host", { "is-compact": U.value }])
|
|
3457
3524
|
}, [
|
|
3458
|
-
|
|
3459
|
-
class:
|
|
3525
|
+
C("div", {
|
|
3526
|
+
class: Ne(["wx-blocks", {
|
|
3460
3527
|
"is-editing": h.value !== null,
|
|
3461
3528
|
"has-preview": n(R) !== null && n(R).url.value !== null
|
|
3462
3529
|
}])
|
|
3463
3530
|
}, [
|
|
3464
|
-
(
|
|
3531
|
+
(d(), W(Gl(U.value ? n(Ul) : "div"), Zl(Se.value, { class: "wx-blocks__side" }), {
|
|
3465
3532
|
default: g(() => [
|
|
3466
|
-
h.value ?
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
v(n(
|
|
3533
|
+
h.value ? B("", !0) : (d(), w("div", Vs, [
|
|
3534
|
+
C("div", Ls, [
|
|
3535
|
+
C("span", Bs, k(n(i)("field.blocks")), 1),
|
|
3536
|
+
v(n(Y), {
|
|
3470
3537
|
size: "sm",
|
|
3471
3538
|
tone: "muted"
|
|
3472
3539
|
}, {
|
|
3473
3540
|
default: g(() => [
|
|
3474
|
-
|
|
3541
|
+
L(k(p.value.length), 1)
|
|
3475
3542
|
]),
|
|
3476
3543
|
_: 1
|
|
3477
3544
|
})
|
|
3478
3545
|
]),
|
|
3479
|
-
|
|
3480
|
-
v(
|
|
3481
|
-
nodes:
|
|
3546
|
+
C("div", Ws, [
|
|
3547
|
+
v(Cs, {
|
|
3548
|
+
nodes: p.value,
|
|
3482
3549
|
catalog: m.value,
|
|
3483
3550
|
max: e.max,
|
|
3484
3551
|
selected: f.value,
|
|
3485
3552
|
disabled: e.disabled,
|
|
3486
3553
|
onSelect: I,
|
|
3487
3554
|
onAdd: ve,
|
|
3488
|
-
onRemove:
|
|
3555
|
+
onRemove: M,
|
|
3489
3556
|
onDuplicate: j,
|
|
3490
3557
|
onMove: pe,
|
|
3491
|
-
onVisibility:
|
|
3558
|
+
onVisibility: A,
|
|
3492
3559
|
onReorder: O
|
|
3493
3560
|
}, null, 8, ["nodes", "catalog", "max", "selected", "disabled"])
|
|
3494
3561
|
]),
|
|
3495
|
-
|
|
3496
|
-
!e.disabled && (e.max === null ||
|
|
3562
|
+
C("div", Ns, [
|
|
3563
|
+
!e.disabled && (e.max === null || p.value.length < e.max) ? (d(), W(n(ce), {
|
|
3497
3564
|
key: 0,
|
|
3498
3565
|
variant: "outline",
|
|
3499
3566
|
icon: "plus",
|
|
@@ -3501,11 +3568,11 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3501
3568
|
onClick: z[0] || (z[0] = (H) => ve(null, null, null))
|
|
3502
3569
|
}, {
|
|
3503
3570
|
default: g(() => [
|
|
3504
|
-
|
|
3571
|
+
L(k(n(i)("field.add")), 1)
|
|
3505
3572
|
]),
|
|
3506
3573
|
_: 1
|
|
3507
|
-
})) :
|
|
3508
|
-
!
|
|
3574
|
+
})) : B("", !0),
|
|
3575
|
+
!U.value && n(R) && n(R).url.value ? (d(), W(n(ce), {
|
|
3509
3576
|
key: 1,
|
|
3510
3577
|
variant: "outline",
|
|
3511
3578
|
icon: "eye",
|
|
@@ -3513,31 +3580,31 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3513
3580
|
onClick: z[1] || (z[1] = (H) => G.value?.open())
|
|
3514
3581
|
}, {
|
|
3515
3582
|
default: g(() => [
|
|
3516
|
-
|
|
3583
|
+
L(k(n(i)("field.preview")), 1)
|
|
3517
3584
|
]),
|
|
3518
3585
|
_: 1
|
|
3519
|
-
})) :
|
|
3586
|
+
})) : B("", !0)
|
|
3520
3587
|
])
|
|
3521
3588
|
])),
|
|
3522
|
-
h.value ? (
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
$.value.length ? (
|
|
3526
|
-
(
|
|
3589
|
+
h.value ? (d(), w("div", Ms, [
|
|
3590
|
+
C("div", zs, [
|
|
3591
|
+
C("span", Ds, [
|
|
3592
|
+
$.value.length ? (d(), w("span", Os, [
|
|
3593
|
+
(d(!0), w(F, null, Z($.value, (H) => (d(), w(F, {
|
|
3527
3594
|
key: H.key
|
|
3528
3595
|
}, [
|
|
3529
|
-
|
|
3596
|
+
C("button", {
|
|
3530
3597
|
type: "button",
|
|
3531
3598
|
class: "wx-blocks__trail-step",
|
|
3532
3599
|
onClick: (be) => I(H.key)
|
|
3533
|
-
}, k(H.title), 9,
|
|
3534
|
-
v(n(
|
|
3600
|
+
}, k(H.title), 9, Is),
|
|
3601
|
+
v(n(we), { name: "chevron-right" })
|
|
3535
3602
|
], 64))), 128))
|
|
3536
|
-
])) :
|
|
3537
|
-
|
|
3603
|
+
])) : B("", !0),
|
|
3604
|
+
C("span", Ps, k(x.value?.title ?? h.value.node.type), 1)
|
|
3538
3605
|
]),
|
|
3539
|
-
|
|
3540
|
-
|
|
3606
|
+
C("span", Us, [
|
|
3607
|
+
U.value ? B("", !0) : (d(), w("code", Rs, k(h.value.node.type), 1)),
|
|
3541
3608
|
v(n(et), {
|
|
3542
3609
|
size: "sm",
|
|
3543
3610
|
tone: "neutral",
|
|
@@ -3554,7 +3621,7 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3554
3621
|
disabled: b.value.next === null,
|
|
3555
3622
|
onClick: z[3] || (z[3] = (H) => b.value.next && I(b.value.next))
|
|
3556
3623
|
}, null, 8, ["title", "disabled"]),
|
|
3557
|
-
!
|
|
3624
|
+
!U.value && n(R) && n(R).url.value ? (d(), W(n(ce), {
|
|
3558
3625
|
key: 1,
|
|
3559
3626
|
size: "sm",
|
|
3560
3627
|
variant: "outline",
|
|
@@ -3562,60 +3629,60 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3562
3629
|
class: "wx-blocks__preview-button",
|
|
3563
3630
|
"aria-label": n(i)("field.preview"),
|
|
3564
3631
|
onClick: z[4] || (z[4] = (H) => G.value?.open())
|
|
3565
|
-
}, null, 8, ["aria-label"])) :
|
|
3632
|
+
}, null, 8, ["aria-label"])) : B("", !0),
|
|
3566
3633
|
v(n(ce), {
|
|
3567
3634
|
size: "sm",
|
|
3568
3635
|
variant: "outline",
|
|
3569
3636
|
onClick: Te
|
|
3570
3637
|
}, {
|
|
3571
3638
|
default: g(() => [
|
|
3572
|
-
|
|
3639
|
+
L(k(U.value ? n(i)("field.done") : `${n(i)("field.done")} · Esc`), 1)
|
|
3573
3640
|
]),
|
|
3574
3641
|
_: 1
|
|
3575
3642
|
})
|
|
3576
3643
|
])
|
|
3577
3644
|
]),
|
|
3578
|
-
|
|
3579
|
-
x.value?.content ? (
|
|
3645
|
+
C("div", js, [
|
|
3646
|
+
x.value?.content ? (d(), W(n(dl), {
|
|
3580
3647
|
key: h.value.node.key,
|
|
3581
3648
|
"model-value": h.value.node.values,
|
|
3582
3649
|
root: ct.value,
|
|
3583
|
-
types:
|
|
3584
|
-
translate:
|
|
3650
|
+
types: xe.value,
|
|
3651
|
+
translate: Le.value,
|
|
3585
3652
|
can: ze.value,
|
|
3586
3653
|
disabled: e.disabled,
|
|
3587
|
-
"onUpdate:modelValue":
|
|
3588
|
-
}, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (
|
|
3654
|
+
"onUpdate:modelValue": Je
|
|
3655
|
+
}, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (d(), W(n(Y), {
|
|
3589
3656
|
key: 1,
|
|
3590
3657
|
size: "sm",
|
|
3591
3658
|
tone: "danger"
|
|
3592
3659
|
}, {
|
|
3593
3660
|
default: g(() => [
|
|
3594
|
-
|
|
3661
|
+
L(k(n(i)("field.unknown-type", { type: h.value.node.type })), 1)
|
|
3595
3662
|
]),
|
|
3596
3663
|
_: 1
|
|
3597
3664
|
}))
|
|
3598
3665
|
])
|
|
3599
|
-
])) :
|
|
3666
|
+
])) : B("", !0)
|
|
3600
3667
|
]),
|
|
3601
3668
|
_: 1
|
|
3602
3669
|
}, 16)),
|
|
3603
|
-
n(R) && n(R).url.value ? (
|
|
3604
|
-
v(
|
|
3670
|
+
n(R) && n(R).url.value ? (d(), w("div", Fs, [
|
|
3671
|
+
v(bs, {
|
|
3605
3672
|
ref_key: "previewEl",
|
|
3606
3673
|
ref: G,
|
|
3607
3674
|
url: n(R).url.value,
|
|
3608
3675
|
selected: f.value,
|
|
3609
3676
|
reload: n(R).reload?.value ?? 0,
|
|
3610
|
-
compact:
|
|
3611
|
-
onSelect:
|
|
3677
|
+
compact: U.value,
|
|
3678
|
+
onSelect: J,
|
|
3612
3679
|
onEdit: z[5] || (z[5] = (H) => Q.value = !0)
|
|
3613
3680
|
}, null, 8, ["url", "selected", "reload", "compact"])
|
|
3614
|
-
])) :
|
|
3681
|
+
])) : B("", !0)
|
|
3615
3682
|
], 2)
|
|
3616
3683
|
], 2));
|
|
3617
3684
|
}
|
|
3618
|
-
}),
|
|
3685
|
+
}), Ks = /* @__PURE__ */ se(Hs, [["__scopeId", "data-v-9de2f53a"]]), qs = { class: "wx-block-card__body" }, Ys = { class: "wx-block-card__title" }, Js = { class: "wx-block-card__chips" }, Gs = /* @__PURE__ */ oe({
|
|
3619
3686
|
__name: "BlockCard",
|
|
3620
3687
|
props: {
|
|
3621
3688
|
block: {},
|
|
@@ -3624,92 +3691,92 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3624
3691
|
emits: ["open"],
|
|
3625
3692
|
setup(e, { emit: l }) {
|
|
3626
3693
|
const t = l, o = de("webx-blocks");
|
|
3627
|
-
return (a, i) => (
|
|
3694
|
+
return (a, i) => (d(), w("button", {
|
|
3628
3695
|
type: "button",
|
|
3629
3696
|
class: "wx-block-card",
|
|
3630
3697
|
onClick: i[0] || (i[0] = (s) => t("open", e.block))
|
|
3631
3698
|
}, [
|
|
3632
|
-
v(
|
|
3699
|
+
v(Vl, {
|
|
3633
3700
|
thumbnail: e.block.thumbnail,
|
|
3634
3701
|
height: n($e)(e.block) === "component" ? 180 : 120,
|
|
3635
3702
|
width: n($e)(e.block) === "component" ? 360 : void 0,
|
|
3636
3703
|
fit: n($e)(e.block) === "component"
|
|
3637
3704
|
}, null, 8, ["thumbnail", "height", "width", "fit"]),
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
v(n(
|
|
3705
|
+
C("div", qs, [
|
|
3706
|
+
C("div", Ys, k(e.block.title), 1),
|
|
3707
|
+
v(n(Y), {
|
|
3641
3708
|
size: "sm",
|
|
3642
3709
|
tone: "muted"
|
|
3643
3710
|
}, {
|
|
3644
3711
|
default: g(() => [
|
|
3645
|
-
|
|
3646
|
-
i[1] || (i[1] =
|
|
3647
|
-
n($e)(e.block) === "component" ? (
|
|
3648
|
-
|
|
3649
|
-
e.module ? (
|
|
3650
|
-
|
|
3651
|
-
], 64)) :
|
|
3652
|
-
], 64)) : (
|
|
3653
|
-
|
|
3712
|
+
C("code", null, k(e.block.slug), 1),
|
|
3713
|
+
i[1] || (i[1] = L(" · ", -1)),
|
|
3714
|
+
n($e)(e.block) === "component" ? (d(), w(F, { key: 0 }, [
|
|
3715
|
+
L(k(n(Al)(e.block.used_by?.length ?? 0, n(o))) + " ", 1),
|
|
3716
|
+
e.module ? (d(), w(F, { key: 0 }, [
|
|
3717
|
+
L("· " + k(n(o)("components.module", { module: e.module })), 1)
|
|
3718
|
+
], 64)) : B("", !0)
|
|
3719
|
+
], 64)) : (d(), w(F, { key: 1 }, [
|
|
3720
|
+
L(k(n(Cl)(e.block.usage_count, n(o))), 1)
|
|
3654
3721
|
], 64))
|
|
3655
3722
|
]),
|
|
3656
3723
|
_: 1
|
|
3657
3724
|
}),
|
|
3658
|
-
|
|
3659
|
-
e.block.draft ? (
|
|
3725
|
+
C("div", Js, [
|
|
3726
|
+
e.block.draft ? (d(), W(n(ye), {
|
|
3660
3727
|
key: 0,
|
|
3661
3728
|
type: "warning",
|
|
3662
3729
|
dot: ""
|
|
3663
3730
|
}, {
|
|
3664
3731
|
default: g(() => [
|
|
3665
|
-
|
|
3732
|
+
L(k(n(o)("page.draft", { number: e.block.draft.number })), 1)
|
|
3666
3733
|
]),
|
|
3667
3734
|
_: 1
|
|
3668
|
-
})) :
|
|
3669
|
-
e.block.published ? (
|
|
3735
|
+
})) : B("", !0),
|
|
3736
|
+
e.block.published ? (d(), W(n(ye), {
|
|
3670
3737
|
key: 1,
|
|
3671
3738
|
type: "success",
|
|
3672
3739
|
dot: ""
|
|
3673
3740
|
}, {
|
|
3674
3741
|
default: g(() => [
|
|
3675
|
-
|
|
3742
|
+
L(k(n(o)("page.live", { number: e.block.published.number })), 1)
|
|
3676
3743
|
]),
|
|
3677
3744
|
_: 1
|
|
3678
|
-
})) : (
|
|
3745
|
+
})) : (d(), W(n(ye), {
|
|
3679
3746
|
key: 2,
|
|
3680
3747
|
type: "default"
|
|
3681
3748
|
}, {
|
|
3682
3749
|
default: g(() => [
|
|
3683
|
-
|
|
3750
|
+
L(k(n(o)("page.never-published")), 1)
|
|
3684
3751
|
]),
|
|
3685
3752
|
_: 1
|
|
3686
3753
|
})),
|
|
3687
|
-
!e.block.is_enabled && n($e)(e.block) !== "component" ? (
|
|
3754
|
+
!e.block.is_enabled && n($e)(e.block) !== "component" ? (d(), W(n(ye), {
|
|
3688
3755
|
key: 3,
|
|
3689
3756
|
type: "default",
|
|
3690
3757
|
variant: "outline"
|
|
3691
3758
|
}, {
|
|
3692
3759
|
default: g(() => [
|
|
3693
|
-
|
|
3760
|
+
L(k(n(o)("page.hidden")), 1)
|
|
3694
3761
|
]),
|
|
3695
3762
|
_: 1
|
|
3696
|
-
})) :
|
|
3763
|
+
})) : B("", !0)
|
|
3697
3764
|
])
|
|
3698
3765
|
])
|
|
3699
3766
|
]));
|
|
3700
3767
|
}
|
|
3701
|
-
}),
|
|
3768
|
+
}), sl = /* @__PURE__ */ se(Gs, [["__scopeId", "data-v-1d29dfee"]]), Zs = { class: "wx-block-create" }, Xs = { class: "wx-block-create__kind" }, Qs = { class: "wx-block-create__kind-help" }, ea = { class: "wx-block-create__kind" }, ta = { class: "wx-block-create__kind-help" }, la = /* @__PURE__ */ oe({
|
|
3702
3769
|
__name: "BlockCreateDialog",
|
|
3703
3770
|
setup(e) {
|
|
3704
|
-
const { resolve: l, dismiss: t, open: o } =
|
|
3705
|
-
|
|
3706
|
-
const s = de("webx-blocks"), r = it(),
|
|
3771
|
+
const { resolve: l, dismiss: t, open: o } = Lt(), a = at(), i = Ke(a);
|
|
3772
|
+
Me();
|
|
3773
|
+
const s = de("webx-blocks"), r = it(), c = S(() => a.state.manifest?.modules.find(($) => $.id === "blocks")?.meta?.groups ?? ["content"]), u = P({
|
|
3707
3774
|
kind: "block",
|
|
3708
3775
|
title: "",
|
|
3709
3776
|
slug: "",
|
|
3710
|
-
group:
|
|
3711
|
-
}), m =
|
|
3712
|
-
() =>
|
|
3777
|
+
group: c.value[0] ?? "content"
|
|
3778
|
+
}), m = P({}), p = P(!1), f = P(!1), h = S(
|
|
3779
|
+
() => c.value.map((b) => ({ value: b, label: qe(b, s) }))
|
|
3713
3780
|
);
|
|
3714
3781
|
function x(b) {
|
|
3715
3782
|
return b.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "").slice(0, 64);
|
|
@@ -3724,7 +3791,7 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3724
3791
|
return m.value[b]?.[0];
|
|
3725
3792
|
}
|
|
3726
3793
|
async function _() {
|
|
3727
|
-
|
|
3794
|
+
p.value = !0, m.value = {};
|
|
3728
3795
|
try {
|
|
3729
3796
|
const { group: b, ...$ } = u.value;
|
|
3730
3797
|
l(await i.create(u.value.kind === "component" ? $ : { ...$, group: b }));
|
|
@@ -3732,34 +3799,34 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3732
3799
|
const $ = b.body;
|
|
3733
3800
|
$?.errors ? m.value = $.errors : X.danger(r(b, s("page.failed")));
|
|
3734
3801
|
} finally {
|
|
3735
|
-
|
|
3802
|
+
p.value = !1;
|
|
3736
3803
|
}
|
|
3737
3804
|
}
|
|
3738
|
-
return (b, $) => (
|
|
3805
|
+
return (b, $) => (d(), W(n(Bt), {
|
|
3739
3806
|
open: n(o),
|
|
3740
|
-
"onUpdate:open": $[6] || ($[6] = (R) =>
|
|
3807
|
+
"onUpdate:open": $[6] || ($[6] = (R) => zt(o) ? o.value = R : null),
|
|
3741
3808
|
title: n(s)("page.new"),
|
|
3742
3809
|
width: 520
|
|
3743
3810
|
}, {
|
|
3744
3811
|
footer: g(() => [
|
|
3745
|
-
v(n(
|
|
3812
|
+
v(n(jl), { size: "sm" }, {
|
|
3746
3813
|
default: g(() => [
|
|
3747
3814
|
v(n(ce), {
|
|
3748
3815
|
variant: "outline",
|
|
3749
3816
|
onClick: $[5] || ($[5] = (R) => n(t)())
|
|
3750
3817
|
}, {
|
|
3751
3818
|
default: g(() => [
|
|
3752
|
-
|
|
3819
|
+
L(k(n(s)("page.cancel")), 1)
|
|
3753
3820
|
]),
|
|
3754
3821
|
_: 1
|
|
3755
3822
|
}),
|
|
3756
3823
|
v(n(ce), {
|
|
3757
3824
|
type: "primary",
|
|
3758
|
-
loading:
|
|
3825
|
+
loading: p.value,
|
|
3759
3826
|
onClick: _
|
|
3760
3827
|
}, {
|
|
3761
3828
|
default: g(() => [
|
|
3762
|
-
|
|
3829
|
+
L(k(n(s)("page.create")), 1)
|
|
3763
3830
|
]),
|
|
3764
3831
|
_: 1
|
|
3765
3832
|
}, 8, ["loading"])
|
|
@@ -3768,29 +3835,29 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3768
3835
|
})
|
|
3769
3836
|
]),
|
|
3770
3837
|
default: g(() => [
|
|
3771
|
-
|
|
3838
|
+
C("div", Zs, [
|
|
3772
3839
|
v(n(re), {
|
|
3773
3840
|
label: n(s)("components.kind"),
|
|
3774
3841
|
error: T("kind")
|
|
3775
3842
|
}, {
|
|
3776
3843
|
default: g(() => [
|
|
3777
|
-
v(n(
|
|
3844
|
+
v(n(Rl), {
|
|
3778
3845
|
modelValue: u.value.kind,
|
|
3779
3846
|
"onUpdate:modelValue": $[0] || ($[0] = (R) => u.value.kind = R),
|
|
3780
3847
|
class: "wx-block-create__kinds"
|
|
3781
3848
|
}, {
|
|
3782
3849
|
default: g(() => [
|
|
3783
|
-
v(n(
|
|
3850
|
+
v(n(Kt), { value: "block" }, {
|
|
3784
3851
|
default: g(() => [
|
|
3785
|
-
|
|
3786
|
-
|
|
3852
|
+
C("span", Xs, k(n(s)("components.kind-block")), 1),
|
|
3853
|
+
C("span", Qs, k(n(s)("components.kind-block-help")), 1)
|
|
3787
3854
|
]),
|
|
3788
3855
|
_: 1
|
|
3789
3856
|
}),
|
|
3790
|
-
v(n(
|
|
3857
|
+
v(n(Kt), { value: "component" }, {
|
|
3791
3858
|
default: g(() => [
|
|
3792
|
-
|
|
3793
|
-
|
|
3859
|
+
C("span", ea, k(n(s)("components.kind-component")), 1),
|
|
3860
|
+
C("span", ta, k(n(s)("components.kind-component-help")), 1)
|
|
3794
3861
|
]),
|
|
3795
3862
|
_: 1
|
|
3796
3863
|
})
|
|
@@ -3828,33 +3895,33 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3828
3895
|
]),
|
|
3829
3896
|
_: 1
|
|
3830
3897
|
}, 8, ["label", "help", "error"]),
|
|
3831
|
-
u.value.kind === "block" ? (
|
|
3898
|
+
u.value.kind === "block" ? (d(), W(n(re), {
|
|
3832
3899
|
key: 0,
|
|
3833
3900
|
label: n(s)("page.group"),
|
|
3834
3901
|
help: n(s)("page.group-help"),
|
|
3835
3902
|
error: T("group")
|
|
3836
3903
|
}, {
|
|
3837
3904
|
default: g(() => [
|
|
3838
|
-
v(n(
|
|
3905
|
+
v(n(St), {
|
|
3839
3906
|
modelValue: u.value.group,
|
|
3840
3907
|
"onUpdate:modelValue": $[4] || ($[4] = (R) => u.value.group = R),
|
|
3841
3908
|
options: h.value
|
|
3842
3909
|
}, null, 8, ["modelValue", "options"])
|
|
3843
3910
|
]),
|
|
3844
3911
|
_: 1
|
|
3845
|
-
}, 8, ["label", "help", "error"])) :
|
|
3912
|
+
}, 8, ["label", "help", "error"])) : B("", !0)
|
|
3846
3913
|
])
|
|
3847
3914
|
]),
|
|
3848
3915
|
_: 1
|
|
3849
3916
|
}, 8, ["open", "title"]));
|
|
3850
3917
|
}
|
|
3851
|
-
}),
|
|
3918
|
+
}), na = /* @__PURE__ */ se(la, [["__scopeId", "data-v-585106f0"]]), oa = { class: "wx-block-declared" }, sa = {
|
|
3852
3919
|
class: "wx-block-declared__mark",
|
|
3853
3920
|
"aria-hidden": "true"
|
|
3854
|
-
},
|
|
3921
|
+
}, aa = { class: "wx-block-declared__body" }, ia = { class: "wx-block-declared__title" }, ra = {
|
|
3855
3922
|
key: 1,
|
|
3856
3923
|
class: "wx-block-declared__actions"
|
|
3857
|
-
},
|
|
3924
|
+
}, ua = /* @__PURE__ */ oe({
|
|
3858
3925
|
__name: "BlockDeclaredCard",
|
|
3859
3926
|
props: {
|
|
3860
3927
|
declared: {},
|
|
@@ -3865,164 +3932,164 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
3865
3932
|
emits: ["customise"],
|
|
3866
3933
|
setup(e, { emit: l }) {
|
|
3867
3934
|
const t = l;
|
|
3868
|
-
|
|
3935
|
+
Me();
|
|
3869
3936
|
const o = de("webx-blocks");
|
|
3870
|
-
return (a, i) => (
|
|
3871
|
-
|
|
3872
|
-
v(n(
|
|
3937
|
+
return (a, i) => (d(), w("div", oa, [
|
|
3938
|
+
C("div", sa, [
|
|
3939
|
+
v(n(we), { name: "sliders" })
|
|
3873
3940
|
]),
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
v(n(
|
|
3941
|
+
C("div", aa, [
|
|
3942
|
+
C("div", ia, k(e.declared.title), 1),
|
|
3943
|
+
v(n(Y), {
|
|
3877
3944
|
size: "sm",
|
|
3878
3945
|
tone: "muted"
|
|
3879
3946
|
}, {
|
|
3880
3947
|
default: g(() => [
|
|
3881
|
-
|
|
3882
|
-
|
|
3948
|
+
C("code", null, k(e.declared.slug), 1),
|
|
3949
|
+
L(" · " + k(n(o)("components.standard", { module: e.module })), 1)
|
|
3883
3950
|
]),
|
|
3884
3951
|
_: 1
|
|
3885
3952
|
}),
|
|
3886
|
-
e.declared.description ? (
|
|
3953
|
+
e.declared.description ? (d(), W(n(Y), {
|
|
3887
3954
|
key: 0,
|
|
3888
3955
|
size: "sm",
|
|
3889
3956
|
tone: "muted"
|
|
3890
3957
|
}, {
|
|
3891
3958
|
default: g(() => [
|
|
3892
|
-
|
|
3959
|
+
L(k(e.declared.description), 1)
|
|
3893
3960
|
]),
|
|
3894
3961
|
_: 1
|
|
3895
|
-
})) :
|
|
3896
|
-
v(n(
|
|
3962
|
+
})) : B("", !0),
|
|
3963
|
+
v(n(Y), {
|
|
3897
3964
|
size: "sm",
|
|
3898
3965
|
tone: "muted",
|
|
3899
3966
|
class: "wx-block-declared__help"
|
|
3900
3967
|
}, {
|
|
3901
3968
|
default: g(() => [
|
|
3902
|
-
|
|
3969
|
+
L(k(n(o)("components.standard-help")), 1)
|
|
3903
3970
|
]),
|
|
3904
3971
|
_: 1
|
|
3905
3972
|
}),
|
|
3906
|
-
e.canManage ? (
|
|
3973
|
+
e.canManage ? (d(), w("div", ra, [
|
|
3907
3974
|
v(n(ce), {
|
|
3908
3975
|
size: "sm",
|
|
3909
3976
|
loading: e.busy,
|
|
3910
3977
|
onClick: i[0] || (i[0] = (s) => t("customise", e.declared))
|
|
3911
3978
|
}, {
|
|
3912
3979
|
default: g(() => [
|
|
3913
|
-
|
|
3980
|
+
L(k(n(o)("components.customise")), 1)
|
|
3914
3981
|
]),
|
|
3915
3982
|
_: 1
|
|
3916
3983
|
}, 8, ["loading"])
|
|
3917
|
-
])) :
|
|
3984
|
+
])) : B("", !0)
|
|
3918
3985
|
])
|
|
3919
3986
|
]));
|
|
3920
3987
|
}
|
|
3921
|
-
}),
|
|
3988
|
+
}), ca = /* @__PURE__ */ se(ua, [["__scopeId", "data-v-3c4079a4"]]), da = {
|
|
3922
3989
|
key: 1,
|
|
3923
3990
|
class: "wx-blocks-page__toolbar"
|
|
3924
|
-
},
|
|
3991
|
+
}, pa = { class: "wx-blocks-page__cards" }, fa = { class: "wx-blocks-page__ghost-body" }, ma = {
|
|
3925
3992
|
key: 0,
|
|
3926
3993
|
class: "wx-blocks-page__group-title"
|
|
3927
|
-
},
|
|
3994
|
+
}, ha = {
|
|
3928
3995
|
key: 0,
|
|
3929
3996
|
class: "wx-blocks-page__group"
|
|
3930
|
-
},
|
|
3997
|
+
}, va = {
|
|
3931
3998
|
key: 0,
|
|
3932
3999
|
class: "wx-blocks-page__group-title"
|
|
3933
|
-
},
|
|
4000
|
+
}, ba = { class: "wx-blocks-page__cards" }, je = "@components", ga = /* @__PURE__ */ oe({
|
|
3934
4001
|
__name: "BlocksPage",
|
|
3935
4002
|
props: {
|
|
3936
4003
|
base: { default: "/blocks" }
|
|
3937
4004
|
},
|
|
3938
4005
|
setup(e) {
|
|
3939
|
-
const l = e, t = at(), o = Ke(t), a =
|
|
3940
|
-
|
|
3941
|
-
const i = de("webx-blocks"), s = it(), r =
|
|
3942
|
-
const
|
|
4006
|
+
const l = e, t = at(), o = Ke(t), a = cl();
|
|
4007
|
+
Me();
|
|
4008
|
+
const i = de("webx-blocks"), s = it(), r = P([]), c = P([]), u = P(!0), m = P(""), p = P(""), f = P(null), h = Et(na), x = S(() => {
|
|
4009
|
+
const A = t.state.manifest?.modules.find((O) => O.id === "blocks")?.meta;
|
|
3943
4010
|
return {
|
|
3944
|
-
groups:
|
|
3945
|
-
editing:
|
|
3946
|
-
provides:
|
|
4011
|
+
groups: A?.groups ?? [],
|
|
4012
|
+
editing: A?.editing ?? !0,
|
|
4013
|
+
provides: A?.provides ?? []
|
|
3947
4014
|
};
|
|
3948
4015
|
}), T = S(() => t.can("blocks.manage") && x.value.editing), _ = S(
|
|
3949
|
-
() => t.state.manifest?.modules.find((
|
|
3950
|
-
), b = S(() => r.value.filter((
|
|
3951
|
-
function ee(
|
|
3952
|
-
return t.state.manifest?.modules.find((O) => O.id ===
|
|
4016
|
+
() => t.state.manifest?.modules.find((A) => A.id === "blocks")?.title ?? i("module.title")
|
|
4017
|
+
), b = S(() => r.value.filter((A) => $e(A) === "block")), $ = S(() => r.value.filter((A) => $e(A) === "component")), R = S(() => c.value.filter((A) => !A.customised)), G = S(() => $.value.length > 0 || R.value.length > 0);
|
|
4018
|
+
function ee(A) {
|
|
4019
|
+
return t.state.manifest?.modules.find((O) => O.id === A)?.title ?? A.charAt(0).toUpperCase() + A.slice(1);
|
|
3953
4020
|
}
|
|
3954
|
-
function ae(
|
|
3955
|
-
const O =
|
|
4021
|
+
function ae(A) {
|
|
4022
|
+
const O = c.value.find((I) => I.slug === A);
|
|
3956
4023
|
return O ? ee(O.module) : null;
|
|
3957
4024
|
}
|
|
3958
|
-
function D(
|
|
4025
|
+
function D(A) {
|
|
3959
4026
|
const O = m.value.trim().toLowerCase();
|
|
3960
|
-
return O === "" ||
|
|
4027
|
+
return O === "" || A.some((I) => (I ?? "").toLowerCase().includes(O));
|
|
3961
4028
|
}
|
|
3962
|
-
const
|
|
3963
|
-
() =>
|
|
4029
|
+
const U = S(() => p.value === je ? [] : (p.value === "" ? b.value : b.value.filter((O) => O.group === p.value)).filter((O) => D([O.title, O.slug, O.description]))), Q = S(
|
|
4030
|
+
() => p.value === "" || p.value === je ? $.value.filter((A) => D([A.title, A.slug, A.description])) : []
|
|
3964
4031
|
), le = S(
|
|
3965
|
-
() =>
|
|
4032
|
+
() => p.value === "" || p.value === je ? R.value.filter((A) => D([A.title, A.slug, A.description])) : []
|
|
3966
4033
|
), Se = S(() => {
|
|
3967
|
-
const
|
|
4034
|
+
const A = [...x.value.groups];
|
|
3968
4035
|
for (const O of b.value)
|
|
3969
|
-
|
|
3970
|
-
return
|
|
4036
|
+
A.includes(O.group) || A.push(O.group);
|
|
4037
|
+
return A.filter((O) => b.value.some((I) => I.group === O));
|
|
3971
4038
|
}), he = S(() => {
|
|
3972
|
-
const
|
|
3973
|
-
return
|
|
4039
|
+
const A = Se.value.map((I) => ({ value: I, label: qe(I, i) })), O = G.value ? [{ value: je, label: i("components.components") }] : [];
|
|
4040
|
+
return A.length + O.length < 2 ? [] : [{ value: "", label: i("page.all-groups") }, ...A, ...O];
|
|
3974
4041
|
}), ne = S(() => {
|
|
3975
|
-
const
|
|
3976
|
-
id:
|
|
3977
|
-
label: qe(
|
|
3978
|
-
blocks:
|
|
3979
|
-
})).filter((
|
|
3980
|
-
return
|
|
3981
|
-
}),
|
|
3982
|
-
() =>
|
|
3983
|
-
),
|
|
3984
|
-
() => T.value &&
|
|
4042
|
+
const A = Se.value.map((J) => ({
|
|
4043
|
+
id: J,
|
|
4044
|
+
label: qe(J, i),
|
|
4045
|
+
blocks: U.value.filter((Te) => Te.group === J)
|
|
4046
|
+
})).filter((J) => J.blocks.length > 0);
|
|
4047
|
+
return p.value !== "" || U.value.length <= 5 || m.value.trim() !== "" || A.length < 2 ? U.value.length === 0 ? [] : [{ id: "", label: p.value === "" && Q.value.length + le.value.length > 0 ? i("components.blocks") : "", blocks: U.value }] : A;
|
|
4048
|
+
}), xe = S(
|
|
4049
|
+
() => p.value === je || U.value.length === 0 ? "" : i("components.components")
|
|
4050
|
+
), Le = S(() => r.value.length === 0 && R.value.length === 0), ze = S(
|
|
4051
|
+
() => T.value && p.value !== je && m.value.trim() === ""
|
|
3985
4052
|
);
|
|
3986
|
-
async function
|
|
3987
|
-
const O =
|
|
3988
|
-
r.value = r.value.map((
|
|
4053
|
+
async function _e(A) {
|
|
4054
|
+
const O = A.map((J) => J.id), I = [...A];
|
|
4055
|
+
r.value = r.value.map((J) => O.includes(J.id) ? I.shift() : J);
|
|
3989
4056
|
try {
|
|
3990
4057
|
await o.reorder(O);
|
|
3991
|
-
} catch (
|
|
3992
|
-
X.danger(s(
|
|
4058
|
+
} catch (J) {
|
|
4059
|
+
X.danger(s(J)), await ie();
|
|
3993
4060
|
}
|
|
3994
4061
|
}
|
|
3995
4062
|
async function ie() {
|
|
3996
4063
|
u.value = !0;
|
|
3997
4064
|
try {
|
|
3998
|
-
const
|
|
3999
|
-
r.value =
|
|
4000
|
-
} catch (
|
|
4001
|
-
X.danger(s(
|
|
4065
|
+
const A = await o.index();
|
|
4066
|
+
r.value = A.blocks, c.value = A.declared;
|
|
4067
|
+
} catch (A) {
|
|
4068
|
+
X.danger(s(A));
|
|
4002
4069
|
} finally {
|
|
4003
4070
|
u.value = !1;
|
|
4004
4071
|
}
|
|
4005
4072
|
}
|
|
4006
4073
|
let ve = 0;
|
|
4007
|
-
function
|
|
4074
|
+
function Ee() {
|
|
4008
4075
|
ve = Date.now();
|
|
4009
4076
|
}
|
|
4010
|
-
function
|
|
4011
|
-
Date.now() - ve < 400 || a.push(`${l.base}/${
|
|
4077
|
+
function M(A) {
|
|
4078
|
+
Date.now() - ve < 400 || a.push(`${l.base}/${A.id}`);
|
|
4012
4079
|
}
|
|
4013
4080
|
async function j() {
|
|
4014
|
-
const
|
|
4015
|
-
|
|
4081
|
+
const A = await h({});
|
|
4082
|
+
A && M(A);
|
|
4016
4083
|
}
|
|
4017
|
-
async function q(
|
|
4018
|
-
f.value =
|
|
4084
|
+
async function q(A) {
|
|
4085
|
+
f.value = A.slug;
|
|
4019
4086
|
try {
|
|
4020
|
-
const O = await o.customise(
|
|
4021
|
-
X.success(i("components.customised")),
|
|
4087
|
+
const O = await o.customise(A.slug);
|
|
4088
|
+
X.success(i("components.customised")), M(O);
|
|
4022
4089
|
} catch (O) {
|
|
4023
4090
|
const I = O.body;
|
|
4024
4091
|
if (O.status === 409 && typeof I?.id == "number") {
|
|
4025
|
-
|
|
4092
|
+
M({ id: I.id });
|
|
4026
4093
|
return;
|
|
4027
4094
|
}
|
|
4028
4095
|
X.danger(s(O, i("components.customise-failed")));
|
|
@@ -4036,22 +4103,22 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
4036
4103
|
j();
|
|
4037
4104
|
} }] : []
|
|
4038
4105
|
);
|
|
4039
|
-
return (
|
|
4040
|
-
view:
|
|
4041
|
-
"onUpdate:view": O[2] || (O[2] = (I) =>
|
|
4106
|
+
return (A, O) => (d(), W(n(on), {
|
|
4107
|
+
view: p.value,
|
|
4108
|
+
"onUpdate:view": O[2] || (O[2] = (I) => p.value = I),
|
|
4042
4109
|
class: "wx-blocks-page",
|
|
4043
4110
|
title: _.value,
|
|
4044
4111
|
views: he.value,
|
|
4045
4112
|
actions: pe.value
|
|
4046
4113
|
}, {
|
|
4047
4114
|
default: g(() => [
|
|
4048
|
-
x.value.editing ?
|
|
4115
|
+
x.value.editing ? B("", !0) : (d(), W(n(il), {
|
|
4049
4116
|
key: 0,
|
|
4050
4117
|
type: "info",
|
|
4051
4118
|
variant: "soft",
|
|
4052
4119
|
description: n(i)("page.editing-off")
|
|
4053
4120
|
}, null, 8, ["description"])),
|
|
4054
|
-
u.value || !
|
|
4121
|
+
u.value || !Le.value ? (d(), w("div", da, [
|
|
4055
4122
|
v(n(nt), {
|
|
4056
4123
|
modelValue: m.value,
|
|
4057
4124
|
"onUpdate:modelValue": O[0] || (O[0] = (I) => m.value = I),
|
|
@@ -4059,11 +4126,11 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
4059
4126
|
placeholder: n(i)("page.search"),
|
|
4060
4127
|
clearable: ""
|
|
4061
4128
|
}, null, 8, ["modelValue", "placeholder"])
|
|
4062
|
-
])) :
|
|
4063
|
-
u.value ? (
|
|
4129
|
+
])) : B("", !0),
|
|
4130
|
+
u.value ? (d(), W(n(He), { key: 2 }, {
|
|
4064
4131
|
template: g(() => [
|
|
4065
|
-
|
|
4066
|
-
(
|
|
4132
|
+
C("div", pa, [
|
|
4133
|
+
(d(), w(F, null, Z(4, (I) => C("div", {
|
|
4067
4134
|
key: I,
|
|
4068
4135
|
class: "wx-blocks-page__ghost"
|
|
4069
4136
|
}, [
|
|
@@ -4072,7 +4139,7 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
4072
4139
|
height: 120,
|
|
4073
4140
|
class: "wx-blocks-page__ghost-thumb"
|
|
4074
4141
|
}),
|
|
4075
|
-
|
|
4142
|
+
C("div", fa, [
|
|
4076
4143
|
v(n(pt), {
|
|
4077
4144
|
variant: "title",
|
|
4078
4145
|
width: "45%"
|
|
@@ -4091,18 +4158,18 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
4091
4158
|
])
|
|
4092
4159
|
]),
|
|
4093
4160
|
_: 1
|
|
4094
|
-
})) :
|
|
4161
|
+
})) : Le.value ? (d(), W(n(Wt), {
|
|
4095
4162
|
key: 3,
|
|
4096
4163
|
icon: "grid",
|
|
4097
4164
|
title: n(i)("page.empty"),
|
|
4098
4165
|
description: n(i)("page.empty-help")
|
|
4099
|
-
}, null, 8, ["title", "description"])) : (
|
|
4100
|
-
(
|
|
4166
|
+
}, null, 8, ["title", "description"])) : (d(), w(F, { key: 4 }, [
|
|
4167
|
+
(d(!0), w(F, null, Z(ne.value, (I) => (d(), w("section", {
|
|
4101
4168
|
key: I.id,
|
|
4102
4169
|
class: "wx-blocks-page__group"
|
|
4103
4170
|
}, [
|
|
4104
|
-
I.label ? (
|
|
4105
|
-
v(n(
|
|
4171
|
+
I.label ? (d(), w("div", ma, k(I.label), 1)) : B("", !0),
|
|
4172
|
+
v(n(cn), {
|
|
4106
4173
|
"model-value": I.blocks,
|
|
4107
4174
|
class: "wx-blocks-page__cards",
|
|
4108
4175
|
disabled: !ze.value,
|
|
@@ -4111,29 +4178,29 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
4111
4178
|
"delay-on-touch-only": !0,
|
|
4112
4179
|
"force-fallback": !0,
|
|
4113
4180
|
"ghost-class": "is-ghost",
|
|
4114
|
-
onEnd:
|
|
4115
|
-
"onUpdate:modelValue": O[1] || (O[1] = (
|
|
4181
|
+
onEnd: Ee,
|
|
4182
|
+
"onUpdate:modelValue": O[1] || (O[1] = (J) => _e(J))
|
|
4116
4183
|
}, {
|
|
4117
4184
|
default: g(() => [
|
|
4118
|
-
(
|
|
4119
|
-
key:
|
|
4120
|
-
block:
|
|
4121
|
-
onOpen:
|
|
4185
|
+
(d(!0), w(F, null, Z(I.blocks, (J) => (d(), W(sl, {
|
|
4186
|
+
key: J.id,
|
|
4187
|
+
block: J,
|
|
4188
|
+
onOpen: M
|
|
4122
4189
|
}, null, 8, ["block"]))), 128))
|
|
4123
4190
|
]),
|
|
4124
4191
|
_: 2
|
|
4125
4192
|
}, 1032, ["model-value", "disabled"])
|
|
4126
4193
|
]))), 128)),
|
|
4127
|
-
Q.value.length > 0 || le.value.length > 0 ? (
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
(
|
|
4194
|
+
Q.value.length > 0 || le.value.length > 0 ? (d(), w("section", ha, [
|
|
4195
|
+
xe.value ? (d(), w("div", va, k(xe.value), 1)) : B("", !0),
|
|
4196
|
+
C("div", ba, [
|
|
4197
|
+
(d(!0), w(F, null, Z(Q.value, (I) => (d(), W(sl, {
|
|
4131
4198
|
key: I.id,
|
|
4132
4199
|
block: I,
|
|
4133
4200
|
module: ae(I.slug),
|
|
4134
|
-
onOpen:
|
|
4201
|
+
onOpen: M
|
|
4135
4202
|
}, null, 8, ["block", "module"]))), 128)),
|
|
4136
|
-
(
|
|
4203
|
+
(d(!0), w(F, null, Z(le.value, (I) => (d(), W(ca, {
|
|
4137
4204
|
key: I.slug,
|
|
4138
4205
|
declared: I,
|
|
4139
4206
|
module: ee(I.module),
|
|
@@ -4142,24 +4209,24 @@ const ls = { class: "wx-block-picker" }, ns = {
|
|
|
4142
4209
|
onCustomise: q
|
|
4143
4210
|
}, null, 8, ["declared", "module", "can-manage", "busy"]))), 128))
|
|
4144
4211
|
])
|
|
4145
|
-
])) :
|
|
4212
|
+
])) : B("", !0)
|
|
4146
4213
|
], 64))
|
|
4147
4214
|
]),
|
|
4148
4215
|
_: 1
|
|
4149
4216
|
}, 8, ["view", "title", "views", "actions"]));
|
|
4150
4217
|
}
|
|
4151
|
-
}),
|
|
4152
|
-
function
|
|
4218
|
+
}), ka = /* @__PURE__ */ se(ga, [["__scopeId", "data-v-14d130be"]]);
|
|
4219
|
+
function La(e = {}) {
|
|
4153
4220
|
const l = e.path ?? "/blocks";
|
|
4154
4221
|
return {
|
|
4155
4222
|
id: "blocks",
|
|
4156
4223
|
path: l,
|
|
4157
4224
|
routes: [
|
|
4158
|
-
{ path: l, name: "webx.blocks", component:
|
|
4225
|
+
{ path: l, name: "webx.blocks", component: ka, props: { base: l } },
|
|
4159
4226
|
{
|
|
4160
4227
|
path: `${l}/:id(\\d+)`,
|
|
4161
4228
|
name: "webx.blocks.edit",
|
|
4162
|
-
component:
|
|
4229
|
+
component: qo,
|
|
4163
4230
|
props: { base: l }
|
|
4164
4231
|
}
|
|
4165
4232
|
],
|
|
@@ -4168,7 +4235,7 @@ function Ta(e = {}) {
|
|
|
4168
4235
|
// draws its children through the renderer; it needs the node for `props.allow` alone.
|
|
4169
4236
|
types: {
|
|
4170
4237
|
"wx-blocks": {
|
|
4171
|
-
component:
|
|
4238
|
+
component: Ks,
|
|
4172
4239
|
kind: "field",
|
|
4173
4240
|
nested: !0,
|
|
4174
4241
|
wide: !0,
|
|
@@ -4177,9 +4244,9 @@ function Ta(e = {}) {
|
|
|
4177
4244
|
// The two inputs only a component's schema has (§3.3): a structure passed from code,
|
|
4178
4245
|
// edited in the sample form as the JSON it is, and a piece of markup the caller puts
|
|
4179
4246
|
// between the tags, as HTML. Neither is a field an editor fills on a page.
|
|
4180
|
-
"wx-data": { component:
|
|
4247
|
+
"wx-data": { component: mn, kind: "field", wide: !0 },
|
|
4181
4248
|
"wx-slot": {
|
|
4182
|
-
component:
|
|
4249
|
+
component: rl,
|
|
4183
4250
|
kind: "field",
|
|
4184
4251
|
bind: () => ({ rows: 3, placeholder: "<p>…</p>" })
|
|
4185
4252
|
}
|
|
@@ -4187,39 +4254,39 @@ function Ta(e = {}) {
|
|
|
4187
4254
|
};
|
|
4188
4255
|
}
|
|
4189
4256
|
export {
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4257
|
+
qo as WxBlockEditorPage,
|
|
4258
|
+
fs as WxBlockPicker,
|
|
4259
|
+
Nn as WxBlockStage,
|
|
4260
|
+
Vl as WxBlockThumb,
|
|
4261
|
+
Ks as WxBlocks,
|
|
4262
|
+
ka as WxBlocksPage,
|
|
4263
|
+
La as blocks,
|
|
4264
|
+
dn as blocksMessages,
|
|
4265
|
+
Pt as blocksPreviewKey,
|
|
4266
|
+
$o as callTag,
|
|
4267
|
+
gl as cloneNode,
|
|
4268
|
+
zn as countType,
|
|
4202
4269
|
Ke as createBlocksApi,
|
|
4203
|
-
|
|
4270
|
+
pl as findRange,
|
|
4204
4271
|
Ut as formSchema,
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4272
|
+
yt as highlightBlock,
|
|
4273
|
+
wt as insertNode,
|
|
4274
|
+
vl as isNode,
|
|
4208
4275
|
rt as isNodeList,
|
|
4209
4276
|
$e as kindOf,
|
|
4210
|
-
|
|
4277
|
+
yo as lintBlock,
|
|
4211
4278
|
me as locate,
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4279
|
+
Mn as makeNode,
|
|
4280
|
+
At as newKey,
|
|
4281
|
+
Aa as provideBlocksPreview,
|
|
4282
|
+
el as removeNode,
|
|
4283
|
+
fl as replaceBlock,
|
|
4284
|
+
Un as replaceList,
|
|
4285
|
+
ml as stageDocument,
|
|
4286
|
+
Ca as typesIn,
|
|
4287
|
+
wo as undeclared,
|
|
4288
|
+
Pn as updateValues,
|
|
4289
|
+
Va as useBlocksPreview,
|
|
4223
4290
|
ut as walk
|
|
4224
4291
|
};
|
|
4225
4292
|
//# sourceMappingURL=index.js.map
|