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