@webx-ui/module-blocks 0.5.1 → 0.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
- import { defineComponent as Q, computed as C, openBlock as i, createElementBlock as V, createVNode as u, unref as e, createElementVNode as $, createTextVNode as _, toDisplayString as v, Fragment as H, createCommentVNode as L, renderList as te, ref as U, onMounted as Te, watch as ie, createBlock as W, withCtx as d, normalizeStyle as ce, reactive as je, onBeforeUnmount as Je, resolveComponent as ft, isRef as vt, normalizeClass as be, withKeys as et, withModifiers as tt, provide as mt, inject as Ne, useModel as It, getCurrentInstance as Ut, mergeModels as Nt, createSlots as Pt } from "vue";
1
+ import { defineComponent as Q, computed as B, openBlock as i, createElementBlock as V, createVNode as u, unref as e, createElementVNode as S, createTextVNode as $, toDisplayString as m, Fragment as j, createCommentVNode as I, renderList as te, ref as U, onMounted as Te, watch as ie, createBlock as W, withCtx as p, normalizeStyle as ce, reactive as je, onBeforeUnmount as Je, resolveComponent as ft, isRef as vt, normalizeClass as be, withKeys as et, withModifiers as tt, provide as mt, inject as Ne, useModel as Ut, getCurrentInstance as Nt, mergeModels as Pt } from "vue";
2
2
  import { useRoute as Mt, useRouter as ht } from "vue-router";
3
- import { useTranslate as le, useAdmin as Be, useErrorText as Ce, WxDate as Ot, WxBackButton as Dt, WxRenameButton as Rt, WxHelpButton as jt, WxRowMenu as Ht, adminKey as Ft, WxListScreen as qt } from "@webx-ui/module-admin";
4
- import { WxIcon as oe, WxSkeleton as he, WxText as j, WxBadge as J, WxButton as q, confirm as Me, toast as F, useElementWidth as Ke, WxSegmented as bt, WxCard as ve, WxAlert as gt, WxTabs as Jt, WxTab as me, WxCodeEditor as Ie, WxFormItem as Y, WxInput as ge, WxSelect as kt, WxTextarea as Kt, WxInputNumber as lt, WxTagsInput as nt, WxSwitch as Zt, WxActionBar as Gt, useModal as yt, WxDialog as wt, WxEmpty as _t, WxSortableList as Yt, createModal as xt, WxSpace as Qt, WxSkeletonItem as Ue } from "@webx-ui/core";
3
+ import { useTranslate as le, useAdmin as Be, useErrorText as Ce, WxDate as Ot, WxScreenHead as Dt, WxRenameButton as Rt, WxHelpButton as jt, WxRowMenu as Ht, adminKey as Ft, WxListScreen as qt } from "@webx-ui/module-admin";
4
+ import { WxIcon as oe, WxSkeleton as he, WxText as R, WxBadge as q, WxButton as Y, confirm as Me, toast as H, useElementWidth as Ke, WxSegmented as bt, WxCard as ve, WxAlert as gt, WxTabs as Jt, WxTab as me, WxCodeEditor as Ie, WxFormItem as G, WxInput as ge, WxSelect as kt, WxTextarea as Kt, WxInputNumber as lt, WxTagsInput as nt, WxSwitch as Zt, WxActionBar as Gt, useModal as yt, WxDialog as wt, WxEmpty as _t, WxSortableList as Yt, createModal as xt, WxSpace as Qt, WxSkeletonItem as Ue } from "@webx-ui/core";
5
5
  import { WxScreenRenderer as $t, coreTypes as He } from "@webx-ui/schema";
6
6
  function ke(t) {
7
7
  const l = `${t.apiPath}/blocks`, s = (n) => n.data;
@@ -32,41 +32,41 @@ const Xt = { class: "wx-block-checks" }, el = {
32
32
  error: {}
33
33
  },
34
34
  setup(t) {
35
- const l = t, s = le("webx-blocks"), n = C(() => l.lints.filter((r) => r.file === l.file)), o = C(() => {
36
- const r = new Set(n.value.map((m) => m.code)), a = [];
35
+ const l = t, s = le("webx-blocks"), n = B(() => l.lints.filter((r) => r.file === l.file)), o = B(() => {
36
+ const r = new Set(n.value.map((v) => v.code)), a = [];
37
37
  return l.file === "template" && (r.has("no-marker") || a.push(s("checks.ok-marker")), r.has("variables-missing") || a.push(s("checks.ok-variables"))), l.file === "styles" && (r.has("stray-selectors") || a.push(s("checks.ok-prefix", { slug: l.slug })), r.has("bare-selectors") || a.push(s("checks.ok-bare")), r.has("media-query") || a.push(s("checks.ok-container"))), a;
38
38
  });
39
39
  return (r, a) => (i(), V("div", Xt, [
40
40
  t.error ? (i(), V("div", el, [
41
41
  u(e(oe), { name: "close-circle" }),
42
- $("span", null, [
43
- _(v(t.error.message) + " ", 1),
44
- t.error.line !== null ? (i(), V(H, { key: 0 }, [
45
- _(" · " + v(e(s)("page.line", { line: t.error.line })), 1)
46
- ], 64)) : L("", !0),
47
- t.error.where ? (i(), V(H, { key: 1 }, [
48
- _(" · " + v(t.error.where), 1)
49
- ], 64)) : L("", !0)
42
+ S("span", null, [
43
+ $(m(t.error.message) + " ", 1),
44
+ t.error.line !== null ? (i(), V(j, { key: 0 }, [
45
+ $(" · " + m(e(s)("page.line", { line: t.error.line })), 1)
46
+ ], 64)) : I("", !0),
47
+ t.error.where ? (i(), V(j, { key: 1 }, [
48
+ $(" · " + m(t.error.where), 1)
49
+ ], 64)) : I("", !0)
50
50
  ])
51
- ])) : L("", !0),
52
- (i(!0), V(H, null, te(n.value, (m) => (i(), V("div", {
53
- key: m.code,
51
+ ])) : I("", !0),
52
+ (i(!0), V(j, null, te(n.value, (v) => (i(), V("div", {
53
+ key: v.code,
54
54
  class: "wx-block-checks__line is-warning"
55
55
  }, [
56
56
  u(e(oe), { name: "warning" }),
57
- $("span", null, [
58
- _(v(m.message) + " ", 1),
59
- m.line !== null ? (i(), V(H, { key: 0 }, [
60
- _(" · " + v(e(s)("page.line", { line: m.line })), 1)
61
- ], 64)) : L("", !0)
57
+ S("span", null, [
58
+ $(m(v.message) + " ", 1),
59
+ v.line !== null ? (i(), V(j, { key: 0 }, [
60
+ $(" · " + m(e(s)("page.line", { line: v.line })), 1)
61
+ ], 64)) : I("", !0)
62
62
  ])
63
63
  ]))), 128)),
64
- (i(!0), V(H, null, te(o.value, (m) => (i(), V("div", {
65
- key: m,
64
+ (i(!0), V(j, null, te(o.value, (v) => (i(), V("div", {
65
+ key: v,
66
66
  class: "wx-block-checks__line is-ok"
67
67
  }, [
68
68
  u(e(oe), { name: "check" }),
69
- $("span", null, v(m), 1)
69
+ S("span", null, m(v), 1)
70
70
  ]))), 128))
71
71
  ]));
72
72
  }
@@ -83,8 +83,8 @@ const Xt = { class: "wx-block-checks" }, el = {
83
83
  },
84
84
  emits: ["restored"],
85
85
  setup(t, { emit: l }) {
86
- const s = t, n = l, o = Be(), r = ke(o), a = le("webx-blocks"), m = Ce(), A = U(null);
87
- async function p() {
86
+ const s = t, n = l, o = Be(), r = ke(o), a = le("webx-blocks"), v = Ce(), A = U(null);
87
+ async function d() {
88
88
  A.value = await r.versions(s.block.id);
89
89
  }
90
90
  function y(c) {
@@ -99,80 +99,80 @@ const Xt = { class: "wx-block-checks" }, el = {
99
99
  }))
100
100
  try {
101
101
  const f = await r.restore(s.block.id, c.number);
102
- F.success(a("page.restored", { number: f.draft?.number ?? c.number })), n("restored", f), await p();
102
+ H.success(a("page.restored", { number: f.draft?.number ?? c.number })), n("restored", f), await d();
103
103
  } catch (f) {
104
- F.danger(m(f));
104
+ H.danger(v(f));
105
105
  }
106
106
  }
107
- return Te(p), ie(
107
+ return Te(d), ie(
108
108
  () => [s.block.draft?.number, s.block.published?.number],
109
109
  () => {
110
- p();
110
+ d();
111
111
  }
112
112
  ), (c, T) => (i(), V("div", ll, [
113
113
  A.value === null ? (i(), W(e(he), {
114
114
  key: 0,
115
115
  class: "wx-block-history__ghost",
116
116
  rows: 3
117
- })) : (i(!0), V(H, { key: 1 }, te(A.value, (f) => (i(), V("div", {
117
+ })) : (i(!0), V(j, { key: 1 }, te(A.value, (f) => (i(), V("div", {
118
118
  key: f.number,
119
119
  class: "wx-block-history__row"
120
120
  }, [
121
- $("code", nl, v(e(a)("page.version", { number: f.number })), 1),
122
- $("div", al, [
123
- u(e(j), null, {
124
- default: d(() => [
125
- _(v(e(a)(`page.version-${y(f)}`)), 1)
121
+ S("code", nl, m(e(a)("page.version", { number: f.number })), 1),
122
+ S("div", al, [
123
+ u(e(R), null, {
124
+ default: p(() => [
125
+ $(m(e(a)(`page.version-${y(f)}`)), 1)
126
126
  ]),
127
127
  _: 2
128
128
  }, 1024),
129
- u(e(j), {
129
+ u(e(R), {
130
130
  size: "sm",
131
131
  tone: "muted"
132
132
  }, {
133
- default: d(() => [
133
+ default: p(() => [
134
134
  f.created_at ? (i(), W(e(Ot), {
135
135
  key: 0,
136
136
  value: f.created_at
137
- }, null, 8, ["value"])) : L("", !0),
138
- _(" · " + v(f.author ?? e(a)(`page.source-${f.source}`)) + " ", 1),
139
- f.comment ? (i(), V(H, { key: 1 }, [
140
- _(" · " + v(f.comment), 1)
141
- ], 64)) : L("", !0)
137
+ }, null, 8, ["value"])) : I("", !0),
138
+ $(" · " + m(f.author ?? e(a)(`page.source-${f.source}`)) + " ", 1),
139
+ f.comment ? (i(), V(j, { key: 1 }, [
140
+ $(" · " + m(f.comment), 1)
141
+ ], 64)) : I("", !0)
142
142
  ]),
143
143
  _: 2
144
144
  }, 1024)
145
145
  ]),
146
- y(f) === "draft" ? (i(), W(e(J), {
146
+ y(f) === "draft" ? (i(), W(e(q), {
147
147
  key: 0,
148
148
  type: "warning",
149
149
  dot: ""
150
150
  }, {
151
- default: d(() => [
152
- _(v(e(a)("page.version-draft")), 1)
151
+ default: p(() => [
152
+ $(m(e(a)("page.version-draft")), 1)
153
153
  ]),
154
154
  _: 1
155
- })) : y(f) === "live" ? (i(), W(e(J), {
155
+ })) : y(f) === "live" ? (i(), W(e(q), {
156
156
  key: 1,
157
157
  type: "success",
158
158
  dot: ""
159
159
  }, {
160
- default: d(() => [
161
- _(v(e(a)("page.version-live")), 1)
160
+ default: p(() => [
161
+ $(m(e(a)("page.version-live")), 1)
162
162
  ]),
163
163
  _: 1
164
- })) : L("", !0),
165
- t.canManage && y(f) === "replaced" ? (i(), W(e(q), {
164
+ })) : I("", !0),
165
+ t.canManage && y(f) === "replaced" ? (i(), W(e(Y), {
166
166
  key: 2,
167
167
  size: "sm",
168
168
  variant: "outline",
169
- onClick: (S) => g(f)
169
+ onClick: (x) => g(f)
170
170
  }, {
171
- default: d(() => [
172
- _(v(e(a)("page.restore")), 1)
171
+ default: p(() => [
172
+ $(m(e(a)("page.restore")), 1)
173
173
  ]),
174
174
  _: 1
175
- }, 8, ["onClick"])) : L("", !0)
175
+ }, 8, ["onClick"])) : I("", !0)
176
176
  ]))), 128))
177
177
  ]));
178
178
  }
@@ -201,17 +201,17 @@ function il(t, l, s) {
201
201
  const r = t.createElement("template");
202
202
  r.innerHTML = s;
203
203
  const a = n.end.nextSibling;
204
- let m = n.start;
205
- for (; m; ) {
206
- const g = m.nextSibling, c = m === n.end;
207
- if (o.removeChild(m), c) break;
208
- m = g;
204
+ let v = n.start;
205
+ for (; v; ) {
206
+ const g = v.nextSibling, c = v === n.end;
207
+ if (o.removeChild(v), c) break;
208
+ v = g;
209
209
  }
210
- const A = r.content, p = Array.from(A.childNodes);
210
+ const A = r.content, d = Array.from(A.childNodes);
211
211
  o.insertBefore(A, a);
212
212
  const y = t.defaultView?.webx;
213
213
  if (y?.mount)
214
- for (const g of p)
214
+ for (const g of d)
215
215
  g.nodeType === 1 && y.mount(g);
216
216
  return !0;
217
217
  }
@@ -257,14 +257,14 @@ function it(t) {
257
257
  function rl(t, l) {
258
258
  Ge(t);
259
259
  let s = null;
260
- function n(m) {
261
- m.preventDefault(), m.stopPropagation();
260
+ function n(v) {
261
+ v.preventDefault(), v.stopPropagation();
262
262
  }
263
- function o(m) {
264
- n(m), l.select(it(m.target));
263
+ function o(v) {
264
+ n(v), l.select(it(v.target));
265
265
  }
266
- function r(m) {
267
- const A = it(m.target);
266
+ function r(v) {
267
+ const A = it(v.target);
268
268
  A !== s && (s = A, ot(t, A));
269
269
  }
270
270
  function a() {
@@ -298,11 +298,11 @@ const ul = { class: "wx-block-stage" }, cl = { class: "wx-block-stage__bar" }, d
298
298
  loading: { type: Boolean, default: !1 }
299
299
  },
300
300
  setup(t) {
301
- const l = t, s = le("webx-blocks"), n = C(() => [
301
+ const l = t, s = le("webx-blocks"), n = B(() => [
302
302
  { value: 1280, label: s("page.width-desktop") },
303
303
  { value: 834, label: s("page.width-tablet") },
304
304
  { value: 390, label: s("page.width-phone") }
305
- ]), o = U(1280), r = U(null), a = U(null), m = Ke(r), A = U(360), p = C(() => m.value === 0 ? 1 : Math.min(1, m.value / o.value)), y = C(
305
+ ]), o = U(1280), r = U(null), a = U(null), v = Ke(r), A = U(360), d = B(() => v.value === 0 ? 1 : Math.min(1, v.value / o.value)), y = B(
306
306
  () => St({
307
307
  html: l.html,
308
308
  styles: l.styles,
@@ -312,23 +312,23 @@ const ul = { class: "wx-block-stage" }, cl = { class: "wx-block-stage__bar" }, d
312
312
  })
313
313
  );
314
314
  function g() {
315
- const S = a.value?.contentDocument;
316
- S?.documentElement && (A.value = Math.max(120, S.documentElement.scrollHeight));
315
+ const x = a.value?.contentDocument;
316
+ x?.documentElement && (A.value = Math.max(120, x.documentElement.scrollHeight));
317
317
  }
318
318
  function c() {
319
319
  g(), setTimeout(g, 300);
320
320
  }
321
321
  ie(o, () => setTimeout(g, 50));
322
- const T = C(() => ({
322
+ const T = B(() => ({
323
323
  width: `${o.value}px`,
324
324
  height: `${A.value}px`,
325
- transform: `scale(${p.value})`
326
- })), f = C(() => ({
327
- width: `${Math.round(o.value * p.value)}px`,
328
- height: `${Math.round(A.value * p.value)}px`
325
+ transform: `scale(${d.value})`
326
+ })), f = B(() => ({
327
+ width: `${Math.round(o.value * d.value)}px`,
328
+ height: `${Math.round(A.value * d.value)}px`
329
329
  }));
330
- return (S, k) => (i(), V("div", ul, [
331
- $("div", cl, [
330
+ return (x, k) => (i(), V("div", ul, [
331
+ S("div", cl, [
332
332
  u(e(bt), {
333
333
  modelValue: o.value,
334
334
  "onUpdate:modelValue": k[0] || (k[0] = (h) => o.value = h),
@@ -336,7 +336,7 @@ const ul = { class: "wx-block-stage" }, cl = { class: "wx-block-stage__bar" }, d
336
336
  size: "sm"
337
337
  }, null, 8, ["modelValue", "options"])
338
338
  ]),
339
- $("div", {
339
+ S("div", {
340
340
  ref_key: "box",
341
341
  ref: r,
342
342
  class: "wx-block-stage__ground"
@@ -349,7 +349,7 @@ const ul = { class: "wx-block-stage" }, cl = { class: "wx-block-stage__bar" }, d
349
349
  class: "wx-block-stage__clip",
350
350
  style: ce(f.value)
351
351
  }, [
352
- $("iframe", {
352
+ S("iframe", {
353
353
  ref_key: "frame",
354
354
  ref: a,
355
355
  class: "wx-block-stage__frame",
@@ -383,9 +383,9 @@ function Bt(t, l, s, n) {
383
383
  for (let o = 0; o < t.length; o++) {
384
384
  const r = t[o];
385
385
  if (r.key === l) return { node: r, parent: s, field: n, list: t, index: o };
386
- for (const [a, m] of Object.entries(r.values ?? {}))
387
- if (Oe(m)) {
388
- const A = Bt(m, l, r, a);
386
+ for (const [a, v] of Object.entries(r.values ?? {}))
387
+ if (Oe(v)) {
388
+ const A = Bt(v, l, r, a);
389
389
  if (A) return A;
390
390
  }
391
391
  }
@@ -411,7 +411,7 @@ function hl(t) {
411
411
  Oe(s) && De(s, () => l++);
412
412
  return l;
413
413
  }
414
- function sa(t) {
414
+ function ea(t) {
415
415
  const l = [];
416
416
  return De(t, (s) => {
417
417
  l.includes(s.type) || l.push(s.type);
@@ -625,9 +625,9 @@ function $l(t, l, s) {
625
625
  variables: o.map((y) => `$${y}`).join(", ")
626
626
  })
627
627
  });
628
- const r = [], a = [], m = `.b-${t}`;
628
+ const r = [], a = [], v = `.b-${t}`;
629
629
  for (const [y, g] of Sl(l.styles))
630
- y.startsWith(m) || y.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(y) ? a.push([y, g]) : r.push([y, g]));
630
+ y.startsWith(v) || y.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(y) ? a.push([y, g]) : r.push([y, g]));
631
631
  r.length > 0 && n.push({
632
632
  file: "styles",
633
633
  code: "stray-selectors",
@@ -639,11 +639,11 @@ function $l(t, l, s) {
639
639
  line: a[0][1],
640
640
  message: s("checks.bare-selectors", { selectors: dt(a) })
641
641
  });
642
- const A = At(l.styles), p = /@media\b/.exec(A);
643
- return p && n.push({
642
+ const A = At(l.styles), d = /@media\b/.exec(A);
643
+ return d && n.push({
644
644
  file: "styles",
645
645
  code: "media-query",
646
- line: Lt(A, p.index),
646
+ line: Lt(A, d.index),
647
647
  message: s("checks.media-query")
648
648
  }), n;
649
649
  }
@@ -672,8 +672,8 @@ function Sl(t) {
672
672
  const o = n[1], r = o.trim();
673
673
  if (!(r === "" || r.startsWith("@")))
674
674
  for (const a of o.split(",")) {
675
- const m = a.trim();
676
- m === "" || m === "from" || m === "to" || m.endsWith("%") || s.push([m, Lt(l, n.index + o.indexOf(m))]);
675
+ const v = a.trim();
676
+ v === "" || v === "from" || v === "to" || v.endsWith("%") || s.push([v, Lt(l, n.index + o.indexOf(v))]);
677
677
  }
678
678
  }
679
679
  return s;
@@ -700,16 +700,16 @@ function ye(t, l) {
700
700
  const s = `groups.${t}`, n = l(s);
701
701
  return n === s || n === `webx-blocks::${s}` ? t.charAt(0).toUpperCase() + t.slice(1) : n;
702
702
  }
703
- const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns" }, Cl = { class: "wx-block-editor__head" }, El = { class: "wx-block-editor__id" }, Wl = { class: "wx-block-editor__name" }, Al = { class: "wx-block-editor__title" }, Ll = { class: "wx-block-editor__actions" }, zl = { class: "wx-block-editor__columns" }, Il = { class: "wx-block-editor__files" }, Ul = { class: "wx-block-editor__pane" }, Nl = {
703
+ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns" }, Cl = { class: "wx-block-editor__columns" }, El = { class: "wx-block-editor__files" }, Wl = { class: "wx-block-editor__pane" }, Al = {
704
704
  key: 0,
705
705
  class: "wx-block-editor__pills"
706
- }, Pl = ["disabled", "onClick", "textContent"], Ml = { class: "wx-block-editor__pane" }, Ol = { class: "wx-block-editor__pane" }, Dl = { class: "wx-block-editor__note" }, Rl = { class: "wx-block-editor__pane" }, jl = { class: "wx-block-editor__note" }, Hl = { class: "wx-block-editor__settings" }, Fl = {
706
+ }, Ll = ["disabled", "onClick", "textContent"], zl = { class: "wx-block-editor__pane" }, Il = { class: "wx-block-editor__pane" }, Ul = { class: "wx-block-editor__note" }, Nl = { class: "wx-block-editor__pane" }, Pl = { class: "wx-block-editor__note" }, Ml = { class: "wx-block-editor__settings" }, Ol = {
707
707
  key: 0,
708
708
  class: "is-wide wx-block-editor__danger"
709
- }, ql = { class: "wx-block-editor__side" }, Jl = {
709
+ }, Dl = { class: "wx-block-editor__side" }, Rl = {
710
710
  key: 1,
711
711
  class: "wx-block-editor__usage"
712
- }, Kl = /* @__PURE__ */ Q({
712
+ }, jl = /* @__PURE__ */ Q({
713
713
  __name: "BlockEditorPage",
714
714
  props: {
715
715
  base: { default: "/blocks" }
@@ -717,14 +717,14 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
717
717
  setup(t) {
718
718
  const l = t, s = Be(), n = ke(s), o = Mt(), r = ht();
719
719
  Ee();
720
- const a = le("webx-blocks"), m = Ce(), A = C(() => Number(o.params.id)), p = U(null), y = U([]), g = U(!0), c = U(!1), T = U(!1), f = U("template"), S = C(() => {
720
+ const a = le("webx-blocks"), v = Ce(), A = B(() => Number(o.params.id)), d = U(null), y = U([]), g = U(!0), c = U(!1), T = U(!1), f = U("template"), x = B(() => {
721
721
  const E = s.state.manifest?.modules.find((b) => b.id === "blocks")?.meta;
722
722
  return {
723
723
  groups: E?.groups ?? [],
724
724
  editing: E?.editing ?? !0,
725
725
  provides: E?.provides ?? []
726
726
  };
727
- }), k = C(() => s.can("blocks.manage") && S.value.editing), h = je({
727
+ }), k = B(() => s.can("blocks.manage") && x.value.editing), h = je({
728
728
  slug: "",
729
729
  title: "",
730
730
  description: "",
@@ -741,29 +741,29 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
741
741
  styles: "",
742
742
  script: null,
743
743
  sample: {}
744
- }), D = U("[]"), K = U(null), ne = U(""), z = U({}), N = U(null), I = je({
744
+ }), O = U("[]"), J = U(null), ne = U(""), F = U({}), z = U(null), N = je({
745
745
  html: "",
746
746
  styles: "",
747
747
  script: null,
748
748
  runtime: null,
749
749
  loading: !1
750
- }), M = C(() => JSON.stringify({ settings: h, content: w })), O = C(() => ne.value !== "" && M.value !== ne.value), ee = C(() => $l(h.slug, w, a)), de = C(() => {
751
- const E = [...S.value.groups];
750
+ }), L = B(() => JSON.stringify({ settings: h, content: w })), P = B(() => ne.value !== "" && L.value !== ne.value), ee = B(() => $l(h.slug, w, a)), de = B(() => {
751
+ const E = [...x.value.groups];
752
752
  return E.includes(h.group) || E.push(h.group), E.map((b) => ({ value: b, label: ye(b, a) }));
753
- }), We = C({
753
+ }), We = B({
754
754
  get: () => w.sample,
755
755
  set: (E) => {
756
756
  w.sample = E;
757
757
  }
758
- }), Ae = C(() => we(w.schema));
758
+ }), Ae = B(() => we(w.schema));
759
759
  function we(E) {
760
760
  const b = [];
761
- for (const x of E)
762
- x.type !== "wx-blocks" && !(x.children?.length && !x.name) && b.push(x.id), x.children && b.push(...we(x.children));
761
+ for (const _ of E)
762
+ _.type !== "wx-blocks" && !(_.children?.length && !_.name) && b.push(_.id), _.children && b.push(...we(_.children));
763
763
  return b;
764
764
  }
765
765
  function pe(E) {
766
- p.value = E, Object.assign(h, {
766
+ d.value = E, Object.assign(h, {
767
767
  slug: E.slug,
768
768
  title: E.title,
769
769
  description: E.description,
@@ -782,40 +782,40 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
782
782
  script: null,
783
783
  sample: {}
784
784
  };
785
- Object.assign(w, re(b)), D.value = JSON.stringify(b.schema, null, 2), K.value = null, ne.value = M.value;
785
+ Object.assign(w, re(b)), O.value = JSON.stringify(b.schema, null, 2), J.value = null, ne.value = L.value;
786
786
  }
787
787
  async function fe() {
788
788
  g.value = !0;
789
789
  try {
790
790
  pe(await n.get(A.value)), y.value = await n.usage(A.value);
791
791
  } catch (E) {
792
- F.danger(m(E));
792
+ H.danger(v(E));
793
793
  } finally {
794
794
  g.value = !1;
795
795
  }
796
796
  }
797
797
  function Le(E) {
798
- D.value = E;
798
+ O.value = E;
799
799
  try {
800
800
  const b = JSON.parse(E);
801
801
  if (!Array.isArray(b)) throw new Error("not a list");
802
- w.schema = b, K.value = null;
802
+ w.schema = b, J.value = null;
803
803
  } catch (b) {
804
- K.value = a("page.schema-invalid", { error: b.message });
804
+ J.value = a("page.schema-invalid", { error: b.message });
805
805
  }
806
806
  }
807
- let _e, B = 0;
808
- function P() {
807
+ let _e, C = 0;
808
+ function M() {
809
809
  clearTimeout(_e), _e = setTimeout(() => {
810
- R();
810
+ D();
811
811
  }, 250);
812
812
  }
813
- async function R() {
814
- if (!p.value) return;
815
- const E = ++B;
816
- I.loading = !0;
813
+ async function D() {
814
+ if (!d.value) return;
815
+ const E = ++C;
816
+ N.loading = !0;
817
817
  try {
818
- const b = await n.render(p.value.id, {
818
+ const b = await n.render(d.value.id, {
819
819
  values: w.sample,
820
820
  content: k.value ? {
821
821
  template: w.template,
@@ -824,270 +824,255 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
824
824
  schema: w.schema
825
825
  } : void 0
826
826
  });
827
- if (E !== B) return;
828
- I.html = b.html, I.styles = b.styles, I.script = b.script, I.runtime = b.runtime;
827
+ if (E !== C) return;
828
+ N.html = b.html, N.styles = b.styles, N.script = b.script, N.runtime = b.runtime;
829
829
  } catch (b) {
830
- E === B && F.danger(m(b));
830
+ E === C && H.danger(v(b));
831
831
  } finally {
832
- E === B && (I.loading = !1);
832
+ E === C && (N.loading = !1);
833
833
  }
834
834
  }
835
835
  ie(
836
836
  () => [w.template, w.styles, w.script, w.schema, w.sample],
837
- P,
837
+ M,
838
838
  { deep: !0 }
839
839
  );
840
- const Z = U(null);
841
- function G(E) {
840
+ const K = U(null);
841
+ function Z(E) {
842
842
  return `{{ $${E} }}`;
843
843
  }
844
844
  function Re(E) {
845
- const x = Z.value?.view?.value;
846
- if (!x) {
845
+ const _ = K.value?.view?.value;
846
+ if (!_) {
847
847
  w.template += `{{ $${E} }}`;
848
848
  return;
849
849
  }
850
- x.dispatch(x.state.replaceSelection(`{{ $${E} }}`)), x.focus();
850
+ _.dispatch(_.state.replaceSelection(`{{ $${E} }}`)), _.focus();
851
851
  }
852
852
  async function ue() {
853
- if (!p.value) return;
854
- c.value = !0, z.value = {}, N.value = null;
855
- const E = p.value.draft?.number ?? null;
853
+ if (!d.value) return;
854
+ c.value = !0, F.value = {}, z.value = null;
855
+ const E = d.value.draft?.number ?? null;
856
856
  try {
857
- const b = await n.update(p.value.id, {
857
+ const b = await n.update(d.value.id, {
858
858
  ...h,
859
859
  allow: h.allow.length ? h.allow : null,
860
860
  allowed_in: h.allowed_in.length ? h.allowed_in : null,
861
861
  description: h.description || null,
862
862
  icon: h.icon || null,
863
- content: K.value ? { ...w, schema: void 0 } : w
863
+ content: J.value ? { ...w, schema: void 0 } : w
864
864
  });
865
- pe(b), F.success(
865
+ pe(b), H.success(
866
866
  b.draft && b.draft.number !== E ? a("page.saved", { number: b.draft.number }) : a("page.unchanged")
867
867
  );
868
868
  } catch (b) {
869
- const x = b.body;
870
- x?.errors ? (z.value = x.errors, F.danger(a("page.failed"))) : F.danger(m(b, a("page.failed")));
869
+ const _ = b.body;
870
+ _?.errors ? (F.value = _.errors, H.danger(a("page.failed"))) : H.danger(v(b, a("page.failed")));
871
871
  } finally {
872
872
  c.value = !1;
873
873
  }
874
874
  }
875
875
  async function xe() {
876
- if (!(!p.value?.draft || (O.value && await ue(), !p.value.draft) || !await Me({
877
- title: a("page.publish-title", { number: p.value.draft.number }),
878
- message: a("page.publish-text", { count: p.value.usage_count }),
876
+ if (!(!d.value?.draft || (P.value && await ue(), !d.value.draft) || !await Me({
877
+ title: a("page.publish-title", { number: d.value.draft.number }),
878
+ message: a("page.publish-text", { count: d.value.usage_count }),
879
879
  confirmText: a("page.publish"),
880
880
  cancelText: a("page.cancel")
881
881
  }))) {
882
- T.value = !0, N.value = null;
882
+ T.value = !0, z.value = null;
883
883
  try {
884
- pe(await n.publish(p.value.id)), F.success(a("page.published", { number: p.value.published?.number ?? 0 }));
884
+ pe(await n.publish(d.value.id)), H.success(a("page.published", { number: d.value.published?.number ?? 0 }));
885
885
  } catch (b) {
886
- const x = b.body;
887
- x?.errors ? (N.value = x, f.value = "template", F.danger(a("page.publish-failed"))) : F.danger(m(b, a("page.publish-failed")));
886
+ const _ = b.body;
887
+ _?.errors ? (z.value = _, f.value = "template", H.danger(a("page.publish-failed"))) : H.danger(v(b, a("page.publish-failed")));
888
888
  } finally {
889
889
  T.value = !1;
890
890
  }
891
891
  }
892
892
  }
893
893
  async function $e() {
894
- if (!(!p.value || !await Me({
895
- title: a("page.delete-title", { title: p.value.title }),
894
+ if (!(!d.value || !await Me({
895
+ title: a("page.delete-title", { title: d.value.title }),
896
896
  message: a("page.delete-text"),
897
897
  confirmText: a("page.delete"),
898
898
  cancelText: a("page.cancel"),
899
899
  tone: "danger"
900
900
  })))
901
901
  try {
902
- await n.remove(p.value.id), F.success(a("page.deleted")), r.push(l.base);
902
+ await n.remove(d.value.id), H.success(a("page.deleted")), r.push(l.base);
903
903
  } catch (b) {
904
- F.danger(m(b));
904
+ H.danger(v(b));
905
905
  }
906
906
  }
907
- const ze = C(
908
- () => N.value ? {
909
- message: N.value.errors.template?.[0] ?? N.value.message,
910
- line: N.value.line,
911
- where: N.value.entity ? a("page.failed-on", {
912
- title: N.value.entity.title ?? `#${N.value.entity.id}`
907
+ const ze = B(
908
+ () => z.value ? {
909
+ message: z.value.errors.template?.[0] ?? z.value.message,
910
+ line: z.value.line,
911
+ where: z.value.entity ? a("page.failed-on", {
912
+ title: z.value.entity.title ?? `#${z.value.entity.id}`
913
913
  }) : null
914
914
  } : null
915
- ), Ve = C(() => y.value.slice(0, 5));
915
+ ), Ve = B(() => y.value.slice(0, 5));
916
916
  function ae(E) {
917
- return z.value[E]?.[0];
917
+ return F.value[E]?.[0];
918
918
  }
919
919
  function Xe(E) {
920
- O.value && E.preventDefault();
920
+ P.value && E.preventDefault();
921
921
  }
922
- return Te(() => {
922
+ Te(() => {
923
923
  fe(), window.addEventListener("beforeunload", Xe);
924
924
  }), Je(() => {
925
925
  clearTimeout(_e), window.removeEventListener("beforeunload", Xe);
926
926
  }), ie(A, () => {
927
927
  fe();
928
- }), (E, b) => (i(), V("div", Tl, [
929
- g.value || !p.value ? (i(), V(H, { key: 0 }, [
928
+ });
929
+ const It = B(
930
+ () => k.value ? [
931
+ { key: "save", label: a("page.save"), loading: c.value, run: () => {
932
+ ue();
933
+ } },
934
+ {
935
+ key: "publish",
936
+ label: a("page.publish"),
937
+ primary: !0,
938
+ loading: T.value,
939
+ disabled: !d.value?.draft && !P.value,
940
+ run: () => {
941
+ xe();
942
+ }
943
+ }
944
+ ] : []
945
+ );
946
+ return (E, b) => (i(), V("div", Tl, [
947
+ g.value || !d.value ? (i(), V(j, { key: 0 }, [
930
948
  u(e(he), {
931
949
  class: "wx-block-editor__ghost-head",
932
950
  title: "",
933
951
  rows: 1
934
952
  }),
935
- $("div", Bl, [
953
+ S("div", Bl, [
936
954
  u(e(ve), null, {
937
- default: d(() => [
955
+ default: p(() => [
938
956
  u(e(he), { rows: 8 })
939
957
  ]),
940
958
  _: 1
941
959
  }),
942
960
  u(e(ve), null, {
943
- default: d(() => [
961
+ default: p(() => [
944
962
  u(e(he), { rows: 4 })
945
963
  ]),
946
964
  _: 1
947
965
  })
948
966
  ])
949
- ], 64)) : (i(), V(H, { key: 1 }, [
950
- $("div", Cl, [
951
- u(e(Dt), {
952
- class: "wx-block-editor__back",
953
- to: t.base,
954
- label: e(a)("page.back")
955
- }, null, 8, ["to", "label"]),
956
- $("div", El, [
957
- $("div", Wl, [
958
- $("h1", Al, v(h.title), 1),
959
- k.value ? (i(), W(e(Rt), {
960
- key: 0,
961
- name: h.title,
962
- placeholder: e(a)("page.title"),
963
- onRename: b[0] || (b[0] = (x) => h.title = x)
964
- }, null, 8, ["name", "placeholder"])) : L("", !0)
965
- ]),
966
- u(e(j), {
967
- size: "sm",
968
- tone: "muted"
969
- }, {
970
- default: d(() => [
971
- $("code", null, v(h.slug), 1),
972
- _(" · " + v(e(ye)(h.group, e(a))) + " · " + v(p.value.usage_count > 0 ? e(a)("page.on-pages", { count: p.value.usage_count }) : e(a)("page.not-used")), 1)
973
- ]),
974
- _: 1
975
- })
976
- ]),
977
- $("div", Ll, [
978
- O.value ? (i(), W(e(J), {
967
+ ], 64)) : (i(), V(j, { key: 1 }, [
968
+ u(e(Dt), {
969
+ title: h.title,
970
+ back: t.base,
971
+ "back-label": e(a)("page.back"),
972
+ actions: It.value
973
+ }, {
974
+ "title-after": p(() => [
975
+ k.value ? (i(), W(e(Rt), {
979
976
  key: 0,
977
+ name: h.title,
978
+ placeholder: e(a)("page.title"),
979
+ onRename: b[0] || (b[0] = (_) => h.title = _)
980
+ }, null, 8, ["name", "placeholder"])) : I("", !0),
981
+ P.value ? (i(), W(e(q), {
982
+ key: 1,
980
983
  type: "primary",
981
984
  dot: ""
982
985
  }, {
983
- default: d(() => [
984
- _(v(e(a)("page.unsaved")), 1)
986
+ default: p(() => [
987
+ $(m(e(a)("page.unsaved")), 1)
985
988
  ]),
986
989
  _: 1
987
- })) : L("", !0),
988
- p.value.draft ? (i(), W(e(J), {
989
- key: 1,
990
+ })) : I("", !0),
991
+ d.value.draft ? (i(), W(e(q), {
992
+ key: 2,
990
993
  type: "warning",
991
994
  dot: ""
992
995
  }, {
993
- default: d(() => [
994
- _(v(e(a)("page.draft", { number: p.value.draft.number })), 1)
996
+ default: p(() => [
997
+ $(m(e(a)("page.draft", { number: d.value.draft.number })), 1)
995
998
  ]),
996
999
  _: 1
997
- })) : L("", !0),
998
- p.value.published ? (i(), W(e(J), {
999
- key: 2,
1000
+ })) : I("", !0),
1001
+ d.value.published ? (i(), W(e(q), {
1002
+ key: 3,
1000
1003
  type: "success",
1001
1004
  dot: ""
1002
1005
  }, {
1003
- default: d(() => [
1004
- _(v(e(a)("page.live", { number: p.value.published.number })), 1)
1006
+ default: p(() => [
1007
+ $(m(e(a)("page.live", { number: d.value.published.number })), 1)
1005
1008
  ]),
1006
1009
  _: 1
1007
- })) : (i(), W(e(J), {
1008
- key: 3,
1010
+ })) : (i(), W(e(q), {
1011
+ key: 4,
1009
1012
  type: "default"
1010
1013
  }, {
1011
- default: d(() => [
1012
- _(v(e(a)("page.never-published")), 1)
1014
+ default: p(() => [
1015
+ $(m(e(a)("page.never-published")), 1)
1013
1016
  ]),
1014
1017
  _: 1
1015
- })),
1016
- k.value ? (i(), V(H, { key: 4 }, [
1017
- u(e(q), {
1018
- variant: "outline",
1019
- loading: c.value,
1020
- onClick: ue
1021
- }, {
1022
- default: d(() => [
1023
- _(v(e(a)("page.save")), 1)
1024
- ]),
1025
- _: 1
1026
- }, 8, ["loading"]),
1027
- u(e(q), {
1028
- type: "primary",
1029
- loading: T.value,
1030
- disabled: !p.value.draft && !O.value,
1031
- onClick: xe
1032
- }, {
1033
- default: d(() => [
1034
- _(v(e(a)("page.publish")), 1)
1035
- ]),
1036
- _: 1
1037
- }, 8, ["loading", "disabled"])
1038
- ], 64)) : L("", !0)
1039
- ])
1040
- ]),
1041
- S.value.editing ? L("", !0) : (i(), W(e(gt), {
1018
+ }))
1019
+ ]),
1020
+ subtitle: p(() => [
1021
+ S("code", null, m(h.slug), 1),
1022
+ $(" · " + m(e(ye)(h.group, e(a))) + " · " + m(d.value.usage_count > 0 ? e(a)("page.on-pages", { count: d.value.usage_count }) : e(a)("page.not-used")), 1)
1023
+ ]),
1024
+ _: 1
1025
+ }, 8, ["title", "back", "back-label", "actions"]),
1026
+ x.value.editing ? I("", !0) : (i(), W(e(gt), {
1042
1027
  key: 0,
1043
1028
  type: "info",
1044
1029
  variant: "soft",
1045
1030
  description: e(a)("page.editing-off")
1046
1031
  }, null, 8, ["description"])),
1047
- $("div", zl, [
1048
- $("div", Il, [
1032
+ S("div", Cl, [
1033
+ S("div", El, [
1049
1034
  u(e(Jt), {
1050
1035
  modelValue: f.value,
1051
- "onUpdate:modelValue": b[13] || (b[13] = (x) => f.value = x),
1036
+ "onUpdate:modelValue": b[13] || (b[13] = (_) => f.value = _),
1052
1037
  "keep-alive": ""
1053
1038
  }, {
1054
- default: d(() => [
1039
+ default: p(() => [
1055
1040
  u(e(me), {
1056
1041
  value: "template",
1057
1042
  label: e(a)("page.tab-template")
1058
1043
  }, {
1059
- default: d(() => [
1060
- $("div", Ul, [
1044
+ default: p(() => [
1045
+ S("div", Wl, [
1061
1046
  u(e(Ie), {
1062
1047
  ref_key: "templateEditor",
1063
- ref: Z,
1048
+ ref: K,
1064
1049
  modelValue: w.template,
1065
- "onUpdate:modelValue": b[1] || (b[1] = (x) => w.template = x),
1050
+ "onUpdate:modelValue": b[1] || (b[1] = (_) => w.template = _),
1066
1051
  language: "php",
1067
1052
  readonly: !k.value,
1068
1053
  "min-height": "340px",
1069
1054
  "max-height": "70vh",
1070
1055
  "line-wrapping": ""
1071
1056
  }, null, 8, ["modelValue", "readonly"]),
1072
- Ae.value.length ? (i(), V("div", Nl, [
1073
- u(e(j), {
1057
+ Ae.value.length ? (i(), V("div", Al, [
1058
+ u(e(R), {
1074
1059
  size: "sm",
1075
1060
  tone: "muted"
1076
1061
  }, {
1077
- default: d(() => [
1078
- _(v(e(a)("page.insert-field")), 1)
1062
+ default: p(() => [
1063
+ $(m(e(a)("page.insert-field")), 1)
1079
1064
  ]),
1080
1065
  _: 1
1081
1066
  }),
1082
- (i(!0), V(H, null, te(Ae.value, (x) => (i(), V("button", {
1083
- key: x,
1067
+ (i(!0), V(j, null, te(Ae.value, (_) => (i(), V("button", {
1068
+ key: _,
1084
1069
  type: "button",
1085
1070
  class: "wx-block-editor__pill",
1086
1071
  disabled: !k.value,
1087
- onClick: (Xn) => Re(x),
1088
- textContent: v(G(x))
1089
- }, null, 8, Pl))), 128))
1090
- ])) : L("", !0),
1072
+ onClick: (Kn) => Re(_),
1073
+ textContent: m(Z(_))
1074
+ }, null, 8, Ll))), 128))
1075
+ ])) : I("", !0),
1091
1076
  u(at, {
1092
1077
  file: "template",
1093
1078
  lints: ee.value,
@@ -1102,11 +1087,11 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1102
1087
  value: "styles",
1103
1088
  label: e(a)("page.tab-styles")
1104
1089
  }, {
1105
- default: d(() => [
1106
- $("div", Ml, [
1090
+ default: p(() => [
1091
+ S("div", zl, [
1107
1092
  u(e(Ie), {
1108
1093
  modelValue: w.styles,
1109
- "onUpdate:modelValue": b[2] || (b[2] = (x) => w.styles = x),
1094
+ "onUpdate:modelValue": b[2] || (b[2] = (_) => w.styles = _),
1110
1095
  language: "css",
1111
1096
  readonly: !k.value,
1112
1097
  "min-height": "340px",
@@ -1125,32 +1110,32 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1125
1110
  value: "script",
1126
1111
  label: e(a)("page.tab-script")
1127
1112
  }, {
1128
- default: d(() => [
1129
- $("div", Ol, [
1113
+ default: p(() => [
1114
+ S("div", Il, [
1130
1115
  u(e(Ie), {
1131
1116
  "model-value": w.script ?? "",
1132
1117
  language: "javascript",
1133
1118
  readonly: !k.value,
1134
1119
  "min-height": "340px",
1135
1120
  "max-height": "70vh",
1136
- "onUpdate:modelValue": b[3] || (b[3] = (x) => w.script = x || null)
1121
+ "onUpdate:modelValue": b[3] || (b[3] = (_) => w.script = _ || null)
1137
1122
  }, null, 8, ["model-value", "readonly"]),
1138
- $("div", Dl, [
1139
- u(e(j), {
1123
+ S("div", Ul, [
1124
+ u(e(R), {
1140
1125
  size: "sm",
1141
1126
  tone: "muted"
1142
1127
  }, {
1143
- default: d(() => [
1144
- _(v(e(a)("page.script-help")), 1)
1128
+ default: p(() => [
1129
+ $(m(e(a)("page.script-help")), 1)
1145
1130
  ]),
1146
1131
  _: 1
1147
1132
  }),
1148
- u(e(j), {
1133
+ u(e(R), {
1149
1134
  size: "sm",
1150
1135
  tone: "muted"
1151
1136
  }, {
1152
- default: d(() => [
1153
- _(v(S.value.provides.length ? e(a)("page.provides", { names: S.value.provides.join(", ") }) : e(a)("page.provides-none")), 1)
1137
+ default: p(() => [
1138
+ $(m(x.value.provides.length ? e(a)("page.provides", { names: x.value.provides.join(", ") }) : e(a)("page.provides-none")), 1)
1154
1139
  ]),
1155
1140
  _: 1
1156
1141
  })
@@ -1163,10 +1148,10 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1163
1148
  value: "fields",
1164
1149
  label: e(a)("page.tab-fields")
1165
1150
  }, {
1166
- default: d(() => [
1167
- $("div", Rl, [
1151
+ default: p(() => [
1152
+ S("div", Nl, [
1168
1153
  u(e(Ie), {
1169
- "model-value": D.value,
1154
+ "model-value": O.value,
1170
1155
  language: "json",
1171
1156
  lint: "",
1172
1157
  readonly: !k.value,
@@ -1174,32 +1159,32 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1174
1159
  "max-height": "70vh",
1175
1160
  "onUpdate:modelValue": Le
1176
1161
  }, null, 8, ["model-value", "readonly"]),
1177
- $("div", jl, [
1178
- K.value ? (i(), W(e(j), {
1162
+ S("div", Pl, [
1163
+ J.value ? (i(), W(e(R), {
1179
1164
  key: 0,
1180
1165
  size: "sm",
1181
1166
  tone: "danger"
1182
1167
  }, {
1183
- default: d(() => [
1184
- _(v(K.value), 1)
1168
+ default: p(() => [
1169
+ $(m(J.value), 1)
1185
1170
  ]),
1186
1171
  _: 1
1187
- })) : ae("content.schema") ? (i(), W(e(j), {
1172
+ })) : ae("content.schema") ? (i(), W(e(R), {
1188
1173
  key: 1,
1189
1174
  size: "sm",
1190
1175
  tone: "danger"
1191
1176
  }, {
1192
- default: d(() => [
1193
- _(v(ae("content.schema")), 1)
1177
+ default: p(() => [
1178
+ $(m(ae("content.schema")), 1)
1194
1179
  ]),
1195
1180
  _: 1
1196
- })) : (i(), W(e(j), {
1181
+ })) : (i(), W(e(R), {
1197
1182
  key: 2,
1198
1183
  size: "sm",
1199
1184
  tone: "muted"
1200
1185
  }, {
1201
- default: d(() => [
1202
- _(v(e(a)("page.fields-help")), 1)
1186
+ default: p(() => [
1187
+ $(m(e(a)("page.fields-help")), 1)
1203
1188
  ]),
1204
1189
  _: 1
1205
1190
  })),
@@ -1216,165 +1201,165 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1216
1201
  value: "settings",
1217
1202
  label: e(a)("page.tab-settings")
1218
1203
  }, {
1219
- default: d(() => [
1204
+ default: p(() => [
1220
1205
  u(e(ve), { class: "wx-block-editor__sheet" }, {
1221
- default: d(() => [
1222
- $("div", Hl, [
1223
- u(e(Y), {
1206
+ default: p(() => [
1207
+ S("div", Ml, [
1208
+ u(e(G), {
1224
1209
  label: e(a)("page.identifier"),
1225
1210
  help: e(a)("page.identifier-help"),
1226
1211
  error: ae("slug"),
1227
1212
  disabled: !k.value
1228
1213
  }, {
1229
- default: d(() => [
1214
+ default: p(() => [
1230
1215
  u(e(ge), {
1231
1216
  modelValue: h.slug,
1232
- "onUpdate:modelValue": b[4] || (b[4] = (x) => h.slug = x)
1217
+ "onUpdate:modelValue": b[4] || (b[4] = (_) => h.slug = _)
1233
1218
  }, null, 8, ["modelValue"])
1234
1219
  ]),
1235
1220
  _: 1
1236
1221
  }, 8, ["label", "help", "error", "disabled"]),
1237
- u(e(Y), {
1222
+ u(e(G), {
1238
1223
  label: e(a)("page.group"),
1239
1224
  help: e(a)("page.group-help"),
1240
1225
  error: ae("group"),
1241
1226
  disabled: !k.value
1242
1227
  }, {
1243
- default: d(() => [
1228
+ default: p(() => [
1244
1229
  u(e(kt), {
1245
1230
  modelValue: h.group,
1246
- "onUpdate:modelValue": b[5] || (b[5] = (x) => h.group = x),
1231
+ "onUpdate:modelValue": b[5] || (b[5] = (_) => h.group = _),
1247
1232
  options: de.value
1248
1233
  }, null, 8, ["modelValue", "options"])
1249
1234
  ]),
1250
1235
  _: 1
1251
1236
  }, 8, ["label", "help", "error", "disabled"]),
1252
- u(e(Y), {
1237
+ u(e(G), {
1253
1238
  class: "is-wide",
1254
1239
  label: e(a)("page.description"),
1255
1240
  help: e(a)("page.description-help"),
1256
1241
  error: ae("description"),
1257
1242
  disabled: !k.value
1258
1243
  }, {
1259
- default: d(() => [
1244
+ default: p(() => [
1260
1245
  u(e(Kt), {
1261
1246
  "model-value": h.description ?? "",
1262
1247
  rows: 2,
1263
- "onUpdate:modelValue": b[6] || (b[6] = (x) => h.description = String(x ?? ""))
1248
+ "onUpdate:modelValue": b[6] || (b[6] = (_) => h.description = String(_ ?? ""))
1264
1249
  }, null, 8, ["model-value"])
1265
1250
  ]),
1266
1251
  _: 1
1267
1252
  }, 8, ["label", "help", "error", "disabled"]),
1268
- u(e(Y), {
1253
+ u(e(G), {
1269
1254
  label: e(a)("page.icon"),
1270
1255
  error: ae("icon"),
1271
1256
  disabled: !k.value
1272
1257
  }, {
1273
- default: d(() => [
1258
+ default: p(() => [
1274
1259
  u(e(ge), {
1275
1260
  "model-value": h.icon ?? "",
1276
1261
  placeholder: "grid",
1277
- "onUpdate:modelValue": b[7] || (b[7] = (x) => h.icon = String(x ?? ""))
1262
+ "onUpdate:modelValue": b[7] || (b[7] = (_) => h.icon = String(_ ?? ""))
1278
1263
  }, null, 8, ["model-value"])
1279
1264
  ]),
1280
1265
  _: 1
1281
1266
  }, 8, ["label", "error", "disabled"]),
1282
- u(e(Y), {
1267
+ u(e(G), {
1283
1268
  label: e(a)("page.sort"),
1284
1269
  help: e(a)("page.sort-help"),
1285
1270
  error: ae("sort"),
1286
1271
  disabled: !k.value
1287
1272
  }, {
1288
- default: d(() => [
1273
+ default: p(() => [
1289
1274
  u(e(lt), {
1290
1275
  modelValue: h.sort,
1291
- "onUpdate:modelValue": b[8] || (b[8] = (x) => h.sort = x)
1276
+ "onUpdate:modelValue": b[8] || (b[8] = (_) => h.sort = _)
1292
1277
  }, null, 8, ["modelValue"])
1293
1278
  ]),
1294
1279
  _: 1
1295
1280
  }, 8, ["label", "help", "error", "disabled"]),
1296
- u(e(Y), {
1281
+ u(e(G), {
1297
1282
  label: e(a)("page.allow"),
1298
1283
  help: e(a)("page.allow-help"),
1299
1284
  error: ae("allow"),
1300
1285
  disabled: !k.value
1301
1286
  }, {
1302
- default: d(() => [
1287
+ default: p(() => [
1303
1288
  u(e(nt), {
1304
1289
  modelValue: h.allow,
1305
- "onUpdate:modelValue": b[9] || (b[9] = (x) => h.allow = x),
1290
+ "onUpdate:modelValue": b[9] || (b[9] = (_) => h.allow = _),
1306
1291
  "allow-create": ""
1307
1292
  }, null, 8, ["modelValue"])
1308
1293
  ]),
1309
1294
  _: 1
1310
1295
  }, 8, ["label", "help", "error", "disabled"]),
1311
- u(e(Y), {
1296
+ u(e(G), {
1312
1297
  label: e(a)("page.allowed-in"),
1313
1298
  help: e(a)("page.allowed-in-help"),
1314
1299
  error: ae("allowed_in"),
1315
1300
  disabled: !k.value
1316
1301
  }, {
1317
- default: d(() => [
1302
+ default: p(() => [
1318
1303
  u(e(nt), {
1319
1304
  modelValue: h.allowed_in,
1320
- "onUpdate:modelValue": b[10] || (b[10] = (x) => h.allowed_in = x),
1305
+ "onUpdate:modelValue": b[10] || (b[10] = (_) => h.allowed_in = _),
1321
1306
  "allow-create": "",
1322
1307
  suggestions: ["root"]
1323
1308
  }, null, 8, ["modelValue"])
1324
1309
  ]),
1325
1310
  _: 1
1326
1311
  }, 8, ["label", "help", "error", "disabled"]),
1327
- u(e(Y), {
1312
+ u(e(G), {
1328
1313
  label: e(a)("page.max-per-entity"),
1329
1314
  help: e(a)("page.max-per-entity-help"),
1330
1315
  error: ae("max_per_entity"),
1331
1316
  disabled: !k.value
1332
1317
  }, {
1333
- default: d(() => [
1318
+ default: p(() => [
1334
1319
  u(e(lt), {
1335
1320
  "model-value": h.max_per_entity ?? void 0,
1336
1321
  min: 1,
1337
- "onUpdate:modelValue": b[11] || (b[11] = (x) => h.max_per_entity = x ?? null)
1322
+ "onUpdate:modelValue": b[11] || (b[11] = (_) => h.max_per_entity = _ ?? null)
1338
1323
  }, null, 8, ["model-value"])
1339
1324
  ]),
1340
1325
  _: 1
1341
1326
  }, 8, ["label", "help", "error", "disabled"]),
1342
- u(e(Y), {
1327
+ u(e(G), {
1343
1328
  label: e(a)("page.enabled"),
1344
1329
  help: e(a)("page.enabled-help"),
1345
1330
  disabled: !k.value
1346
1331
  }, {
1347
- default: d(() => [
1332
+ default: p(() => [
1348
1333
  u(e(Zt), {
1349
1334
  modelValue: h.is_enabled,
1350
- "onUpdate:modelValue": b[12] || (b[12] = (x) => h.is_enabled = x)
1335
+ "onUpdate:modelValue": b[12] || (b[12] = (_) => h.is_enabled = _)
1351
1336
  }, null, 8, ["modelValue"])
1352
1337
  ]),
1353
1338
  _: 1
1354
1339
  }, 8, ["label", "help", "disabled"]),
1355
- k.value ? (i(), V("div", Fl, [
1356
- u(e(q), {
1340
+ k.value ? (i(), V("div", Ol, [
1341
+ u(e(Y), {
1357
1342
  type: "danger",
1358
1343
  variant: "outline",
1359
- disabled: p.value.usage_count > 0,
1344
+ disabled: d.value.usage_count > 0,
1360
1345
  onClick: $e
1361
1346
  }, {
1362
- default: d(() => [
1363
- _(v(e(a)("page.delete")), 1)
1347
+ default: p(() => [
1348
+ $(m(e(a)("page.delete")), 1)
1364
1349
  ]),
1365
1350
  _: 1
1366
1351
  }, 8, ["disabled"]),
1367
- p.value.usage_count > 0 ? (i(), W(e(j), {
1352
+ d.value.usage_count > 0 ? (i(), W(e(R), {
1368
1353
  key: 0,
1369
1354
  size: "sm",
1370
1355
  tone: "muted"
1371
1356
  }, {
1372
- default: d(() => [
1373
- _(v(e(a)("page.delete-used", { count: p.value.usage_count })), 1)
1357
+ default: p(() => [
1358
+ $(m(e(a)("page.delete-used", { count: d.value.usage_count })), 1)
1374
1359
  ]),
1375
1360
  _: 1
1376
- })) : L("", !0)
1377
- ])) : L("", !0)
1361
+ })) : I("", !0)
1362
+ ])) : I("", !0)
1378
1363
  ])
1379
1364
  ]),
1380
1365
  _: 1
@@ -1386,14 +1371,14 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1386
1371
  value: "history",
1387
1372
  label: e(a)("page.tab-history")
1388
1373
  }, {
1389
- default: d(() => [
1374
+ default: p(() => [
1390
1375
  u(e(ve), {
1391
1376
  class: "wx-block-editor__sheet",
1392
1377
  padding: "none"
1393
1378
  }, {
1394
- default: d(() => [
1379
+ default: p(() => [
1395
1380
  u(ol, {
1396
- block: p.value,
1381
+ block: d.value,
1397
1382
  "can-manage": k.value,
1398
1383
  onRestored: pe
1399
1384
  }, null, 8, ["block", "can-manage"])
@@ -1407,35 +1392,35 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1407
1392
  _: 1
1408
1393
  }, 8, ["modelValue"])
1409
1394
  ]),
1410
- $("div", ql, [
1395
+ S("div", Dl, [
1411
1396
  u(fl, {
1412
- html: I.html,
1413
- styles: I.styles,
1414
- script: I.script,
1415
- runtime: I.runtime,
1416
- loading: I.loading
1397
+ html: N.html,
1398
+ styles: N.styles,
1399
+ script: N.script,
1400
+ runtime: N.runtime,
1401
+ loading: N.loading
1417
1402
  }, null, 8, ["html", "styles", "script", "runtime", "loading"]),
1418
1403
  u(e(ve), {
1419
1404
  title: e(a)("page.sample")
1420
1405
  }, {
1421
- default: d(() => [
1406
+ default: p(() => [
1422
1407
  w.schema.length ? (i(), W(e($t), {
1423
1408
  key: 0,
1424
1409
  modelValue: We.value,
1425
- "onUpdate:modelValue": b[14] || (b[14] = (x) => We.value = x),
1410
+ "onUpdate:modelValue": b[14] || (b[14] = (_) => We.value = _),
1426
1411
  root: e(Ye)(w.schema),
1427
1412
  types: e(s).types,
1428
1413
  translate: e(s).i18n.t,
1429
1414
  can: e(s).can,
1430
1415
  disabled: !k.value,
1431
1416
  size: "sm"
1432
- }, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : L("", !0),
1433
- u(e(j), {
1417
+ }, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : I("", !0),
1418
+ u(e(R), {
1434
1419
  size: "sm",
1435
1420
  tone: "muted"
1436
1421
  }, {
1437
- default: d(() => [
1438
- _(v(e(a)("page.sample-help")), 1)
1422
+ default: p(() => [
1423
+ $(m(e(a)("page.sample-help")), 1)
1439
1424
  ]),
1440
1425
  _: 1
1441
1426
  })
@@ -1445,43 +1430,43 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1445
1430
  u(e(ve), {
1446
1431
  title: e(a)("page.usage")
1447
1432
  }, {
1448
- default: d(() => [
1449
- y.value.length === 0 ? (i(), W(e(j), {
1433
+ default: p(() => [
1434
+ y.value.length === 0 ? (i(), W(e(R), {
1450
1435
  key: 0,
1451
1436
  size: "sm",
1452
1437
  tone: "muted"
1453
1438
  }, {
1454
- default: d(() => [
1455
- _(v(e(a)("page.usage-empty")), 1)
1439
+ default: p(() => [
1440
+ $(m(e(a)("page.usage-empty")), 1)
1456
1441
  ]),
1457
1442
  _: 1
1458
- })) : (i(), V("div", Jl, [
1459
- (i(!0), V(H, null, te(Ve.value, (x) => (i(), V("div", {
1460
- key: `${x.model}:${x.id}`,
1443
+ })) : (i(), V("div", Rl, [
1444
+ (i(!0), V(j, null, te(Ve.value, (_) => (i(), V("div", {
1445
+ key: `${_.model}:${_.id}`,
1461
1446
  class: "wx-block-editor__use"
1462
1447
  }, [
1463
- $("span", null, v(x.title ?? `#${x.id}`), 1),
1464
- x.published ? L("", !0) : (i(), W(e(J), {
1448
+ S("span", null, m(_.title ?? `#${_.id}`), 1),
1449
+ _.published ? I("", !0) : (i(), W(e(q), {
1465
1450
  key: 0,
1466
1451
  type: "warning",
1467
1452
  size: "sm"
1468
1453
  }, {
1469
- default: d(() => [
1470
- _(v(e(a)("page.unpublished-page")), 1)
1454
+ default: p(() => [
1455
+ $(m(e(a)("page.unpublished-page")), 1)
1471
1456
  ]),
1472
1457
  _: 1
1473
1458
  }))
1474
1459
  ]))), 128)),
1475
- y.value.length > Ve.value.length ? (i(), W(e(j), {
1460
+ y.value.length > Ve.value.length ? (i(), W(e(R), {
1476
1461
  key: 0,
1477
1462
  size: "sm",
1478
1463
  tone: "muted"
1479
1464
  }, {
1480
- default: d(() => [
1481
- _(v(e(a)("page.usage-more", { count: y.value.length - Ve.value.length })), 1)
1465
+ default: p(() => [
1466
+ $(m(e(a)("page.usage-more", { count: y.value.length - Ve.value.length })), 1)
1482
1467
  ]),
1483
1468
  _: 1
1484
- })) : L("", !0)
1469
+ })) : I("", !0)
1485
1470
  ]))
1486
1471
  ]),
1487
1472
  _: 1
@@ -1489,70 +1474,70 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1489
1474
  ])
1490
1475
  ]),
1491
1476
  k.value ? (i(), W(e(Gt), { key: 1 }, {
1492
- state: d(() => [
1493
- O.value ? (i(), W(e(J), {
1477
+ state: p(() => [
1478
+ P.value ? (i(), W(e(q), {
1494
1479
  key: 0,
1495
1480
  type: "primary",
1496
1481
  dot: ""
1497
1482
  }, {
1498
- default: d(() => [
1499
- _(v(e(a)("page.unsaved")), 1)
1483
+ default: p(() => [
1484
+ $(m(e(a)("page.unsaved")), 1)
1500
1485
  ]),
1501
1486
  _: 1
1502
- })) : L("", !0),
1503
- p.value.draft ? (i(), W(e(J), {
1487
+ })) : I("", !0),
1488
+ d.value.draft ? (i(), W(e(q), {
1504
1489
  key: 1,
1505
1490
  type: "warning",
1506
1491
  dot: ""
1507
1492
  }, {
1508
- default: d(() => [
1509
- _(v(e(a)("page.draft", { number: p.value.draft.number })), 1)
1493
+ default: p(() => [
1494
+ $(m(e(a)("page.draft", { number: d.value.draft.number })), 1)
1510
1495
  ]),
1511
1496
  _: 1
1512
- })) : L("", !0),
1513
- p.value.published ? (i(), W(e(J), {
1497
+ })) : I("", !0),
1498
+ d.value.published ? (i(), W(e(q), {
1514
1499
  key: 2,
1515
1500
  type: "success",
1516
1501
  dot: ""
1517
1502
  }, {
1518
- default: d(() => [
1519
- _(v(e(a)("page.live", { number: p.value.published.number })), 1)
1503
+ default: p(() => [
1504
+ $(m(e(a)("page.live", { number: d.value.published.number })), 1)
1520
1505
  ]),
1521
1506
  _: 1
1522
- })) : L("", !0)
1507
+ })) : I("", !0)
1523
1508
  ]),
1524
- default: d(() => [
1525
- u(e(q), {
1509
+ default: p(() => [
1510
+ u(e(Y), {
1526
1511
  variant: "outline",
1527
1512
  loading: c.value,
1528
1513
  onClick: ue
1529
1514
  }, {
1530
- default: d(() => [
1531
- _(v(e(a)("page.save")), 1)
1515
+ default: p(() => [
1516
+ $(m(e(a)("page.save")), 1)
1532
1517
  ]),
1533
1518
  _: 1
1534
1519
  }, 8, ["loading"]),
1535
- u(e(q), {
1520
+ u(e(Y), {
1536
1521
  type: "primary",
1537
1522
  loading: T.value,
1538
- disabled: !p.value.draft && !O.value,
1523
+ disabled: !d.value.draft && !P.value,
1539
1524
  onClick: xe
1540
1525
  }, {
1541
- default: d(() => [
1542
- _(v(e(a)("page.publish")), 1)
1526
+ default: p(() => [
1527
+ $(m(e(a)("page.publish")), 1)
1543
1528
  ]),
1544
1529
  _: 1
1545
1530
  }, 8, ["loading", "disabled"])
1546
1531
  ]),
1547
1532
  _: 1
1548
- })) : L("", !0)
1533
+ })) : I("", !0)
1549
1534
  ], 64))
1550
1535
  ]));
1551
1536
  }
1552
- }), Zl = /* @__PURE__ */ X(Kl, [["__scopeId", "data-v-ae45e358"]]), Gl = ["srcdoc"], Yl = {
1537
+ }), Hl = /* @__PURE__ */ X(jl, [["__scopeId", "data-v-abef0165"]]), Fl = ["srcdoc"], ql = {
1553
1538
  key: 1,
1554
1539
  class: "wx-block-thumb__empty"
1555
- }, Ql = /* @__PURE__ */ Q({
1540
+ }, Jl = /* @__PURE__ */ Q({
1556
1541
  __name: "BlockThumb",
1557
1542
  props: {
1558
1543
  thumbnail: {},
@@ -1560,14 +1545,14 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1560
1545
  height: { default: 120 }
1561
1546
  },
1562
1547
  setup(t) {
1563
- const l = t, s = U(null), n = Ke(s), o = C(() => n.value > 0 ? n.value / l.width : 0.2), r = C(
1548
+ const l = t, s = U(null), n = Ke(s), o = B(() => n.value > 0 ? n.value / l.width : 0.2), r = B(
1564
1549
  () => l.thumbnail ? St({ html: l.thumbnail.html, styles: l.thumbnail.styles }) : ""
1565
- ), a = C(() => ({
1550
+ ), a = B(() => ({
1566
1551
  width: `${l.width}px`,
1567
1552
  height: `${Math.round(l.height / o.value)}px`,
1568
1553
  transform: `scale(${o.value})`
1569
1554
  }));
1570
- return (m, A) => (i(), V("div", {
1555
+ return (v, A) => (i(), V("div", {
1571
1556
  ref_key: "box",
1572
1557
  ref: s,
1573
1558
  class: "wx-block-thumb",
@@ -1581,15 +1566,15 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1581
1566
  sandbox: "allow-same-origin",
1582
1567
  tabindex: "-1",
1583
1568
  "aria-hidden": "true"
1584
- }, null, 12, Gl)) : (i(), V("div", Yl, [
1569
+ }, null, 12, Fl)) : (i(), V("div", ql, [
1585
1570
  u(e(oe), { name: "grid" })
1586
1571
  ]))
1587
1572
  ], 4));
1588
1573
  }
1589
- }), zt = /* @__PURE__ */ X(Ql, [["__scopeId", "data-v-615b818a"]]), Xl = { class: "wx-block-picker" }, en = {
1574
+ }), zt = /* @__PURE__ */ X(Jl, [["__scopeId", "data-v-615b818a"]]), Kl = { class: "wx-block-picker" }, Zl = {
1590
1575
  key: 0,
1591
1576
  class: "wx-block-picker__group-title"
1592
- }, tn = { class: "wx-block-picker__cards" }, ln = ["disabled", "title", "onClick"], nn = { class: "wx-block-picker__body" }, an = { class: "wx-block-picker__title" }, sn = /* @__PURE__ */ Q({
1577
+ }, Gl = { class: "wx-block-picker__cards" }, Yl = ["disabled", "title", "onClick"], Ql = { class: "wx-block-picker__body" }, Xl = { class: "wx-block-picker__title" }, en = /* @__PURE__ */ Q({
1593
1578
  __name: "BlockPicker",
1594
1579
  props: {
1595
1580
  catalog: {},
@@ -1603,33 +1588,33 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1603
1588
  const l = t, { resolve: s, dismiss: n, open: o } = yt();
1604
1589
  Ee();
1605
1590
  const r = le("webx-blocks"), a = U("");
1606
- function m(c) {
1591
+ function v(c) {
1607
1592
  if (l.parent === null)
1608
1593
  return c.allowed_in === null || c.allowed_in.includes("root");
1609
1594
  const T = l.allow ? l.allow.includes(c.slug) : l.parent.allow?.includes(c.slug) === !0, f = c.allowed_in === null || c.allowed_in.includes(l.parent.slug);
1610
1595
  return T && f;
1611
1596
  }
1612
- const A = C(
1613
- () => l.catalog.filter((c) => c.is_enabled && c.published !== null && m(c)).map((c) => {
1597
+ const A = B(
1598
+ () => l.catalog.filter((c) => c.is_enabled && c.published !== null && v(c)).map((c) => {
1614
1599
  const T = ml(l.tree, c.slug), f = c.max_per_entity !== null && T >= c.max_per_entity;
1615
1600
  return { type: c, reason: f ? r("field.limit-reached", { count: T }) : null };
1616
1601
  })
1617
- ), p = C(() => {
1602
+ ), d = B(() => {
1618
1603
  const c = a.value.trim().toLowerCase();
1619
1604
  return c === "" ? A.value : A.value.filter(
1620
1605
  ({ type: T }) => T.title.toLowerCase().includes(c) || T.slug.includes(c) || (T.description ?? "").toLowerCase().includes(c)
1621
1606
  );
1622
- }), y = C(() => {
1607
+ }), y = B(() => {
1623
1608
  const c = [...l.groups];
1624
- for (const { type: S } of p.value)
1625
- c.includes(S.group) || c.push(S.group);
1626
- const T = c.map((S) => ({
1627
- id: S,
1628
- label: ye(S, r),
1629
- options: p.value.filter((k) => k.type.group === S)
1630
- })).filter((S) => S.options.length > 0);
1631
- return p.value.length <= 5 || a.value.trim() !== "" || T.length < 2 ? [{ id: "", label: "", options: p.value }] : T;
1632
- }), g = C(() => {
1609
+ for (const { type: x } of d.value)
1610
+ c.includes(x.group) || c.push(x.group);
1611
+ const T = c.map((x) => ({
1612
+ id: x,
1613
+ label: ye(x, r),
1614
+ options: d.value.filter((k) => k.type.group === x)
1615
+ })).filter((x) => x.options.length > 0);
1616
+ return d.value.length <= 5 || a.value.trim() !== "" || T.length < 2 ? [{ id: "", label: "", options: d.value }] : T;
1617
+ }), g = B(() => {
1633
1618
  if (l.catalog.length === 0) return r("field.pick-none");
1634
1619
  if (A.value.length === 0 && l.parent) {
1635
1620
  const c = (l.allow ?? l.parent.allow ?? []).filter(
@@ -1643,57 +1628,57 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1643
1628
  const f = ft("router-link");
1644
1629
  return i(), W(e(wt), {
1645
1630
  open: e(o),
1646
- "onUpdate:open": T[2] || (T[2] = (S) => vt(o) ? o.value = S : null),
1631
+ "onUpdate:open": T[2] || (T[2] = (x) => vt(o) ? o.value = x : null),
1647
1632
  title: e(r)("field.pick"),
1648
1633
  width: 860
1649
1634
  }, {
1650
- footer: d(() => [
1651
- u(e(q), {
1635
+ footer: p(() => [
1636
+ u(e(Y), {
1652
1637
  variant: "outline",
1653
- onClick: T[1] || (T[1] = (S) => e(n)())
1638
+ onClick: T[1] || (T[1] = (x) => e(n)())
1654
1639
  }, {
1655
- default: d(() => [
1656
- _(v(e(r)("field.close")), 1)
1640
+ default: p(() => [
1641
+ $(m(e(r)("field.close")), 1)
1657
1642
  ]),
1658
1643
  _: 1
1659
1644
  })
1660
1645
  ]),
1661
- default: d(() => [
1662
- $("div", Xl, [
1646
+ default: p(() => [
1647
+ S("div", Kl, [
1663
1648
  A.value.length > 0 ? (i(), W(e(ge), {
1664
1649
  key: 0,
1665
1650
  modelValue: a.value,
1666
- "onUpdate:modelValue": T[0] || (T[0] = (S) => a.value = S),
1651
+ "onUpdate:modelValue": T[0] || (T[0] = (x) => a.value = x),
1667
1652
  placeholder: e(r)("field.search"),
1668
1653
  clearable: "",
1669
1654
  autofocus: ""
1670
- }, null, 8, ["modelValue", "placeholder"])) : L("", !0),
1671
- p.value.length === 0 ? (i(), W(e(_t), {
1655
+ }, null, 8, ["modelValue", "placeholder"])) : I("", !0),
1656
+ d.value.length === 0 ? (i(), W(e(_t), {
1672
1657
  key: 1,
1673
1658
  icon: "grid",
1674
1659
  title: g.value,
1675
1660
  size: "sm"
1676
1661
  }, {
1677
- default: d(() => [
1662
+ default: p(() => [
1678
1663
  t.catalog.length === 0 && t.blocksPath ? (i(), W(f, {
1679
1664
  key: 0,
1680
1665
  to: t.blocksPath
1681
1666
  }, {
1682
- default: d(() => [
1683
- _(v(e(r)("field.pick-none-link")), 1)
1667
+ default: p(() => [
1668
+ $(m(e(r)("field.pick-none-link")), 1)
1684
1669
  ]),
1685
1670
  _: 1
1686
- }, 8, ["to"])) : L("", !0)
1671
+ }, 8, ["to"])) : I("", !0)
1687
1672
  ]),
1688
1673
  _: 1
1689
- }, 8, ["title"])) : L("", !0),
1690
- (i(!0), V(H, null, te(y.value, (S) => (i(), V("section", {
1691
- key: S.id,
1674
+ }, 8, ["title"])) : I("", !0),
1675
+ (i(!0), V(j, null, te(y.value, (x) => (i(), V("section", {
1676
+ key: x.id,
1692
1677
  class: "wx-block-picker__group"
1693
1678
  }, [
1694
- S.label ? (i(), V("div", en, v(S.label), 1)) : L("", !0),
1695
- $("div", tn, [
1696
- (i(!0), V(H, null, te(S.options, (k) => (i(), V("button", {
1679
+ x.label ? (i(), V("div", Zl, m(x.label), 1)) : I("", !0),
1680
+ S("div", Gl, [
1681
+ (i(!0), V(j, null, te(x.options, (k) => (i(), V("button", {
1697
1682
  key: k.type.id,
1698
1683
  type: "button",
1699
1684
  class: be(["wx-block-picker__card", { "is-disabled": k.reason !== null }]),
@@ -1705,29 +1690,29 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1705
1690
  thumbnail: k.type.thumbnail,
1706
1691
  height: 96
1707
1692
  }, null, 8, ["thumbnail"]),
1708
- $("div", nn, [
1709
- $("div", an, v(k.type.title), 1),
1710
- k.reason ? (i(), W(e(j), {
1693
+ S("div", Ql, [
1694
+ S("div", Xl, m(k.type.title), 1),
1695
+ k.reason ? (i(), W(e(R), {
1711
1696
  key: 0,
1712
1697
  size: "sm",
1713
1698
  tone: "warning"
1714
1699
  }, {
1715
- default: d(() => [
1716
- _(v(k.reason), 1)
1700
+ default: p(() => [
1701
+ $(m(k.reason), 1)
1717
1702
  ]),
1718
1703
  _: 2
1719
- }, 1024)) : k.type.description ? (i(), W(e(j), {
1704
+ }, 1024)) : k.type.description ? (i(), W(e(R), {
1720
1705
  key: 1,
1721
1706
  size: "sm",
1722
1707
  tone: "muted"
1723
1708
  }, {
1724
- default: d(() => [
1725
- _(v(k.type.description), 1)
1709
+ default: p(() => [
1710
+ $(m(k.type.description), 1)
1726
1711
  ]),
1727
1712
  _: 2
1728
- }, 1024)) : L("", !0)
1713
+ }, 1024)) : I("", !0)
1729
1714
  ])
1730
- ], 10, ln))), 128))
1715
+ ], 10, Yl))), 128))
1731
1716
  ])
1732
1717
  ]))), 128))
1733
1718
  ])
@@ -1736,7 +1721,7 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1736
1721
  }, 8, ["open", "title"]);
1737
1722
  };
1738
1723
  }
1739
- }), on = /* @__PURE__ */ X(sn, [["__scopeId", "data-v-99f4090e"]]), rn = { class: "wx-blocks-preview__bar" }, un = { class: "wx-blocks-preview__tools" }, cn = ["src", "title"], dn = /* @__PURE__ */ Q({
1724
+ }), tn = /* @__PURE__ */ X(en, [["__scopeId", "data-v-99f4090e"]]), ln = { class: "wx-blocks-preview__bar" }, nn = { class: "wx-blocks-preview__tools" }, an = ["src", "title"], sn = /* @__PURE__ */ Q({
1740
1725
  __name: "BlocksPreview",
1741
1726
  props: {
1742
1727
  url: {},
@@ -1747,16 +1732,16 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1747
1732
  },
1748
1733
  emits: ["select"],
1749
1734
  setup(t, { expose: l, emit: s }) {
1750
- const n = t, o = s, r = le("webx-blocks"), a = U(null), m = U(null), A = Ke(m), p = U(!1), y = U(1280), g = U(!1), c = C(() => [
1735
+ const n = t, o = s, r = le("webx-blocks"), a = U(null), v = U(null), A = Ke(v), d = U(!1), y = U(1280), g = U(!1), c = B(() => [
1751
1736
  { value: 1280, label: r("field.width-desktop") },
1752
1737
  { value: 834, label: r("field.width-tablet") },
1753
1738
  { value: 390, label: r("field.width-phone") }
1754
- ]), T = C(
1755
- () => p.value ? y.value : n.mode === "phone" ? 390 : 1280
1756
- ), f = C(() => p.value || n.mode === "phone" || A.value === 0 ? 1 : Math.min(1, A.value / T.value)), S = C(() => ({
1739
+ ]), T = B(
1740
+ () => d.value ? y.value : n.mode === "phone" ? 390 : 1280
1741
+ ), f = B(() => d.value || n.mode === "phone" || A.value === 0 ? 1 : Math.min(1, A.value / T.value)), x = B(() => ({
1757
1742
  width: `${T.value}px`,
1758
1743
  transform: `scale(${f.value})`
1759
- })), k = C(() => {
1744
+ })), k = B(() => {
1760
1745
  if (!n.url) return "";
1761
1746
  try {
1762
1747
  return `${new URL(n.url, location.origin).pathname} · ${T.value} px`;
@@ -1771,67 +1756,67 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1771
1756
  return null;
1772
1757
  }
1773
1758
  }
1774
- let w = null, D = !1;
1775
- function K() {
1759
+ let w = null, O = !1;
1760
+ function J() {
1776
1761
  g.value = !0;
1777
- const M = h();
1778
- M && (w?.release(), w = rl(M, {
1779
- select: (O) => {
1780
- D = !0, o("select", O), D = !1;
1762
+ const L = h();
1763
+ L && (w?.release(), w = rl(L, {
1764
+ select: (P) => {
1765
+ O = !0, o("select", P), O = !1;
1781
1766
  }
1782
- }), Fe(M, n.selected ?? null), ne(M, n.selected ?? null));
1767
+ }), Fe(L, n.selected ?? null), ne(L, n.selected ?? null));
1783
1768
  }
1784
- function ne(M, O) {
1785
- O === null || D || Ze(M, O)?.scrollIntoView({ behavior: "smooth", block: "center" });
1769
+ function ne(L, P) {
1770
+ P === null || O || Ze(L, P)?.scrollIntoView({ behavior: "smooth", block: "center" });
1786
1771
  }
1787
- function z(M, O) {
1772
+ function F(L, P) {
1788
1773
  const ee = h();
1789
1774
  if (!ee || !g.value) return !1;
1790
- const de = il(ee, M, O);
1775
+ const de = il(ee, L, P);
1791
1776
  return de && Fe(ee, n.selected ?? null), de;
1792
1777
  }
1793
- function N() {
1778
+ function z() {
1794
1779
  g.value = !1, a.value && n.url && (a.value.src = n.url);
1795
1780
  }
1796
- function I(M) {
1797
- M.key === "Escape" && p.value && (p.value = !1, M.stopPropagation());
1781
+ function N(L) {
1782
+ L.key === "Escape" && d.value && (d.value = !1, L.stopPropagation());
1798
1783
  }
1799
1784
  return ie(
1800
1785
  () => n.selected,
1801
- (M) => {
1802
- const O = h();
1803
- !O || !g.value || (Fe(O, M ?? null), ne(O, M ?? null));
1786
+ (L) => {
1787
+ const P = h();
1788
+ !P || !g.value || (Fe(P, L ?? null), ne(P, L ?? null));
1804
1789
  }
1805
- ), ie(() => n.reload, N), ie(
1790
+ ), ie(() => n.reload, z), ie(
1806
1791
  () => n.url,
1807
1792
  () => g.value = !1
1808
- ), Te(() => window.addEventListener("keydown", I)), Je(() => {
1809
- window.removeEventListener("keydown", I), w?.release();
1810
- }), l({ replace: z, refresh: N, open: () => p.value = !0 }), (M, O) => (i(), V("div", {
1811
- class: be(["wx-blocks-preview", { "is-fullscreen": p.value, "is-phone": t.mode === "phone", "is-fill": t.fill }]),
1793
+ ), Te(() => window.addEventListener("keydown", N)), Je(() => {
1794
+ window.removeEventListener("keydown", N), w?.release();
1795
+ }), l({ replace: F, refresh: z, open: () => d.value = !0 }), (L, P) => (i(), V("div", {
1796
+ class: be(["wx-blocks-preview", { "is-fullscreen": d.value, "is-phone": t.mode === "phone", "is-fill": t.fill }]),
1812
1797
  style: ce({ "--wx-preview-scale": f.value })
1813
1798
  }, [
1814
- $("div", rn, [
1815
- u(e(j), {
1799
+ S("div", ln, [
1800
+ u(e(R), {
1816
1801
  size: "xs",
1817
1802
  tone: "muted",
1818
1803
  class: "wx-blocks-preview__label",
1819
1804
  truncate: ""
1820
1805
  }, {
1821
- default: d(() => [
1822
- _(v(k.value), 1)
1806
+ default: p(() => [
1807
+ $(m(k.value), 1)
1823
1808
  ]),
1824
1809
  _: 1
1825
1810
  }),
1826
- $("div", un, [
1827
- p.value ? (i(), W(e(bt), {
1811
+ S("div", nn, [
1812
+ d.value ? (i(), W(e(bt), {
1828
1813
  key: 0,
1829
1814
  modelValue: y.value,
1830
- "onUpdate:modelValue": O[0] || (O[0] = (ee) => y.value = ee),
1815
+ "onUpdate:modelValue": P[0] || (P[0] = (ee) => y.value = ee),
1831
1816
  options: c.value,
1832
1817
  size: "sm"
1833
- }, null, 8, ["modelValue", "options"])) : L("", !0),
1834
- t.url ? (i(), W(e(q), {
1818
+ }, null, 8, ["modelValue", "options"])) : I("", !0),
1819
+ t.url ? (i(), W(e(Y), {
1835
1820
  key: 1,
1836
1821
  size: "sm",
1837
1822
  variant: "outline",
@@ -1839,29 +1824,29 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1839
1824
  target: "_blank",
1840
1825
  rel: "noopener"
1841
1826
  }, {
1842
- default: d(() => [
1843
- _(v(e(r)("field.open-site")), 1)
1827
+ default: p(() => [
1828
+ $(m(e(r)("field.open-site")), 1)
1844
1829
  ]),
1845
1830
  _: 1
1846
- }, 8, ["href"])) : L("", !0),
1847
- u(e(q), {
1831
+ }, 8, ["href"])) : I("", !0),
1832
+ u(e(Y), {
1848
1833
  size: "sm",
1849
1834
  variant: "outline",
1850
- onClick: O[1] || (O[1] = (ee) => p.value = !p.value)
1835
+ onClick: P[1] || (P[1] = (ee) => d.value = !d.value)
1851
1836
  }, {
1852
- default: d(() => [
1853
- _(v(p.value ? e(r)("field.close") : e(r)("field.fullscreen")), 1)
1837
+ default: p(() => [
1838
+ $(m(d.value ? e(r)("field.close") : e(r)("field.fullscreen")), 1)
1854
1839
  ]),
1855
1840
  _: 1
1856
1841
  })
1857
1842
  ])
1858
1843
  ]),
1859
- $("div", {
1844
+ S("div", {
1860
1845
  ref_key: "box",
1861
- ref: m,
1846
+ ref: v,
1862
1847
  class: "wx-blocks-preview__ground"
1863
1848
  }, [
1864
- $("div", {
1849
+ S("div", {
1865
1850
  class: "wx-blocks-preview__clip",
1866
1851
  style: ce({ width: `${Math.round(T.value * f.value)}px` })
1867
1852
  }, [
@@ -1871,18 +1856,18 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1871
1856
  ref: a,
1872
1857
  class: "wx-blocks-preview__frame",
1873
1858
  src: t.url,
1874
- style: ce(S.value),
1859
+ style: ce(x.value),
1875
1860
  title: e(r)("field.preview"),
1876
- onLoad: K
1877
- }, null, 44, cn)) : L("", !0)
1861
+ onLoad: J
1862
+ }, null, 44, an)) : I("", !0)
1878
1863
  ], 4)
1879
1864
  ], 512)
1880
1865
  ], 6));
1881
1866
  }
1882
- }), pn = /* @__PURE__ */ X(dn, [["__scopeId", "data-v-1668a23e"]]), fn = { class: "wx-blocks-tree__node" }, vn = ["onClick", "onKeydown"], mn = { class: "wx-blocks-tree__icon" }, hn = { class: "wx-blocks-tree__name" }, bn = ["title"], gn = ["title"], kn = ["title"], yn = ["title"], wn = {
1867
+ }), on = /* @__PURE__ */ X(sn, [["__scopeId", "data-v-1668a23e"]]), rn = { class: "wx-blocks-tree__node" }, un = ["onClick", "onKeydown"], cn = { class: "wx-blocks-tree__icon" }, dn = { class: "wx-blocks-tree__name" }, pn = ["title"], fn = ["title"], vn = ["title"], mn = ["title"], hn = {
1883
1868
  key: 4,
1884
1869
  class: "wx-blocks-tree__actions"
1885
- }, _n = ["onClick"], xn = /* @__PURE__ */ Q({
1870
+ }, bn = ["onClick"], gn = /* @__PURE__ */ Q({
1886
1871
  __name: "BlocksTree",
1887
1872
  props: {
1888
1873
  nodes: {},
@@ -1902,7 +1887,7 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1902
1887
  function a(g) {
1903
1888
  return r(g)?.title ?? g.type;
1904
1889
  }
1905
- function m(g) {
1890
+ function v(g) {
1906
1891
  const c = r(g);
1907
1892
  return c?.content ? Ct(c.content.schema) : [];
1908
1893
  }
@@ -1910,7 +1895,7 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1910
1895
  const T = g.values[c.id];
1911
1896
  return Array.isArray(T) ? T : [];
1912
1897
  }
1913
- function p(g) {
1898
+ function d(g) {
1914
1899
  return r(g)?.icon ?? "grid";
1915
1900
  }
1916
1901
  function y(g) {
@@ -1949,66 +1934,66 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
1949
1934
  class: be(["wx-blocks-tree", { "is-nested": t.depth > 0 }]),
1950
1935
  "onUpdate:modelValue": c[6] || (c[6] = (f) => n("reorder", t.parentKey, t.field, f))
1951
1936
  }, {
1952
- default: d(({ item: f }) => [
1953
- $("div", fn, [
1954
- $("div", {
1937
+ default: p(({ item: f }) => [
1938
+ S("div", rn, [
1939
+ S("div", {
1955
1940
  class: be(["wx-blocks-tree__row", { "is-selected": t.selected === f.key, "is-hidden": f.hidden === !0 }]),
1956
1941
  role: "button",
1957
1942
  tabindex: "0",
1958
- onClick: (S) => n("select", f.key),
1943
+ onClick: (x) => n("select", f.key),
1959
1944
  onKeydown: [
1960
- et(tt((S) => n("select", f.key), ["prevent"]), ["enter"]),
1961
- et(tt((S) => n("select", f.key), ["prevent"]), ["space"])
1945
+ et(tt((x) => n("select", f.key), ["prevent"]), ["enter"]),
1946
+ et(tt((x) => n("select", f.key), ["prevent"]), ["space"])
1962
1947
  ]
1963
1948
  }, [
1964
- $("span", mn, [
1949
+ S("span", cn, [
1965
1950
  u(e(oe), {
1966
- name: p(f)
1951
+ name: d(f)
1967
1952
  }, null, 8, ["name"])
1968
1953
  ]),
1969
- $("span", hn, v(a(f)), 1),
1954
+ S("span", dn, m(a(f)), 1),
1970
1955
  r(f) ? r(f)?.draft ? (i(), V("span", {
1971
1956
  key: 1,
1972
1957
  class: "wx-blocks-tree__flag is-warning",
1973
1958
  title: e(o)("field.draft-type")
1974
1959
  }, [
1975
1960
  u(e(oe), { name: "warning" })
1976
- ], 8, gn)) : r(f)?.is_enabled === !1 ? (i(), V("span", {
1961
+ ], 8, fn)) : r(f)?.is_enabled === !1 ? (i(), V("span", {
1977
1962
  key: 2,
1978
1963
  class: "wx-blocks-tree__flag",
1979
1964
  title: e(o)("field.disabled-type")
1980
1965
  }, [
1981
1966
  u(e(oe), { name: "lock" })
1982
- ], 8, kn)) : L("", !0) : (i(), V("span", {
1967
+ ], 8, vn)) : I("", !0) : (i(), V("span", {
1983
1968
  key: 0,
1984
1969
  class: "wx-blocks-tree__flag is-danger",
1985
1970
  title: e(o)("field.unknown-type", { type: f.type })
1986
1971
  }, [
1987
1972
  u(e(oe), { name: "close-circle" })
1988
- ], 8, bn)),
1973
+ ], 8, pn)),
1989
1974
  f.hidden === !0 ? (i(), V("span", {
1990
1975
  key: 3,
1991
1976
  class: "wx-blocks-tree__flag",
1992
1977
  title: e(o)("field.hidden-note")
1993
1978
  }, [
1994
1979
  u(e(oe), { name: "eye-off" })
1995
- ], 8, yn)) : L("", !0),
1996
- t.disabled ? L("", !0) : (i(), V("span", wn, [
1980
+ ], 8, mn)) : I("", !0),
1981
+ t.disabled ? I("", !0) : (i(), V("span", hn, [
1997
1982
  u(e(Ht), {
1998
1983
  actions: y(f),
1999
1984
  label: a(f)
2000
1985
  }, null, 8, ["actions", "label"])
2001
1986
  ]))
2002
- ], 42, vn),
2003
- (i(!0), V(H, null, te(m(f), (S) => (i(), V("div", {
2004
- key: S.id,
1987
+ ], 42, un),
1988
+ (i(!0), V(j, null, te(v(f), (x) => (i(), V("div", {
1989
+ key: x.id,
2005
1990
  class: "wx-blocks-tree__kids"
2006
1991
  }, [
2007
1992
  u(T, {
2008
- nodes: A(f, S),
1993
+ nodes: A(f, x),
2009
1994
  catalog: t.catalog,
2010
1995
  "parent-key": f.key,
2011
- field: S.id,
1996
+ field: x.id,
2012
1997
  selected: t.selected,
2013
1998
  disabled: t.disabled,
2014
1999
  depth: t.depth + 1,
@@ -2019,17 +2004,17 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
2019
2004
  onVisibility: c[4] || (c[4] = (k, h) => n("visibility", k, h)),
2020
2005
  onReorder: c[5] || (c[5] = (k, h, w) => n("reorder", k, h, w))
2021
2006
  }, null, 8, ["nodes", "catalog", "parent-key", "field", "selected", "disabled", "depth"]),
2022
- t.disabled ? L("", !0) : (i(), V("button", {
2007
+ t.disabled ? I("", !0) : (i(), V("button", {
2023
2008
  key: 0,
2024
2009
  type: "button",
2025
2010
  class: "wx-blocks-tree__add is-inner",
2026
- onClick: (k) => n("add", f.key, S.id, S)
2011
+ onClick: (k) => n("add", f.key, x.id, x)
2027
2012
  }, [
2028
- _(" + " + v(e(o)("field.add-inside")), 1),
2029
- m(f).length > 1 ? (i(), V(H, { key: 0 }, [
2030
- _(" · " + v(S.label ?? S.id), 1)
2031
- ], 64)) : L("", !0)
2032
- ], 8, _n))
2013
+ $(" + " + m(e(o)("field.add-inside")), 1),
2014
+ v(f).length > 1 ? (i(), V(j, { key: 0 }, [
2015
+ $(" · " + m(x.label ?? x.id), 1)
2016
+ ], 64)) : I("", !0)
2017
+ ], 8, bn))
2033
2018
  ]))), 128))
2034
2019
  ])
2035
2020
  ]),
@@ -2037,27 +2022,27 @@ const Tl = { class: "wx-block-editor" }, Bl = { class: "wx-block-editor__columns
2037
2022
  }, 8, ["model-value", "item-label", "disabled", "empty-text", "class"]);
2038
2023
  };
2039
2024
  }
2040
- }), $n = /* @__PURE__ */ X(xn, [["__scopeId", "data-v-4c1e79ce"]]), Qe = /* @__PURE__ */ Symbol("wx-blocks-preview");
2041
- function oa(t) {
2025
+ }), kn = /* @__PURE__ */ X(gn, [["__scopeId", "data-v-4c1e79ce"]]), Qe = /* @__PURE__ */ Symbol("wx-blocks-preview");
2026
+ function ta(t) {
2042
2027
  mt(Qe, t);
2043
2028
  }
2044
- function ia() {
2029
+ function la() {
2045
2030
  return Ne(Qe, null);
2046
2031
  }
2047
- const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2032
+ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), yn = {
2048
2033
  key: 0,
2049
2034
  class: "wx-blocks-nested"
2050
- }, Sn = { class: "wx-blocks__tree" }, Tn = { class: "wx-blocks__panel-head" }, Bn = { class: "wx-blocks__panel-title" }, Cn = { class: "wx-blocks__tools" }, En = {
2035
+ }, wn = { class: "wx-blocks__tree" }, _n = { class: "wx-blocks__panel-head" }, xn = { class: "wx-blocks__panel-title" }, $n = { class: "wx-blocks__tools" }, Vn = {
2051
2036
  key: 0,
2052
2037
  class: "wx-blocks__fields"
2053
- }, Wn = { class: "wx-blocks__panel-head" }, An = { class: "wx-blocks__panel-title" }, Ln = { class: "wx-blocks__panel-extra" }, zn = { class: "wx-blocks__form" }, In = {
2038
+ }, Sn = { class: "wx-blocks__panel-head" }, Tn = { class: "wx-blocks__panel-title" }, Bn = { class: "wx-blocks__panel-extra" }, Cn = { class: "wx-blocks__form" }, En = {
2054
2039
  key: 1,
2055
2040
  class: "wx-blocks__preview"
2056
- }, Un = /* @__PURE__ */ Q({
2041
+ }, Wn = /* @__PURE__ */ Q({
2057
2042
  name: "WxBlocks",
2058
2043
  inheritAttrs: !1,
2059
2044
  __name: "BlocksField",
2060
- props: /* @__PURE__ */ Nt({
2045
+ props: /* @__PURE__ */ Pt({
2061
2046
  node: { default: void 0 },
2062
2047
  context: { default: void 0 },
2063
2048
  name: { default: void 0 },
@@ -2074,119 +2059,119 @@ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2074
2059
  }),
2075
2060
  emits: ["update:modelValue"],
2076
2061
  setup(t) {
2077
- const l = t, s = It(t, "modelValue"), n = Ne(pt, !1);
2062
+ const l = t, s = Ut(t, "modelValue"), n = Ne(pt, !1);
2078
2063
  mt(pt, !0), Ee();
2079
2064
  const o = le("webx-blocks"), r = Ce(), a = Ne(Ft, null);
2080
- let m = null;
2081
- const A = U([]), p = C(() => l.catalog ?? A.value), y = C(() => Array.isArray(s.value) ? s.value : []), g = U(null), c = C(() => g.value ? se(y.value, g.value) : null), T = C(
2082
- () => c.value ? p.value.find((B) => B.slug === c.value?.node.type) ?? null : null
2083
- ), f = Ne(Qe, null), S = U(null), k = C(
2084
- () => a?.state.manifest?.modules.find((B) => B.id === "blocks")?.meta?.groups ?? []
2085
- ), h = Ut()?.type, w = C(() => l.context?.types ? l.context.types : a?.types ? { ...He, ...a.types } : h ? { ...He, "wx-blocks": { component: h, kind: "field", nested: !0 } } : He), D = C(
2086
- () => l.context?.translate ?? a?.i18n.t ?? ((B) => B)
2087
- ), K = C(() => l.context?.can ?? a?.can ?? (() => !0)), ne = xt(on);
2088
- function z(B) {
2089
- s.value = B;
2065
+ let v = null;
2066
+ const A = U([]), d = B(() => l.catalog ?? A.value), y = B(() => Array.isArray(s.value) ? s.value : []), g = U(null), c = B(() => g.value ? se(y.value, g.value) : null), T = B(
2067
+ () => c.value ? d.value.find((C) => C.slug === c.value?.node.type) ?? null : null
2068
+ ), f = Ne(Qe, null), x = U(null), k = B(
2069
+ () => a?.state.manifest?.modules.find((C) => C.id === "blocks")?.meta?.groups ?? []
2070
+ ), h = Nt()?.type, w = B(() => l.context?.types ? l.context.types : a?.types ? { ...He, ...a.types } : h ? { ...He, "wx-blocks": { component: h, kind: "field", nested: !0 } } : He), O = B(
2071
+ () => l.context?.translate ?? a?.i18n.t ?? ((C) => C)
2072
+ ), J = B(() => l.context?.can ?? a?.can ?? (() => !0)), ne = xt(tn);
2073
+ function F(C) {
2074
+ s.value = C;
2090
2075
  }
2091
- async function N(B, P, R) {
2092
- const Z = B ? se(y.value, B) : null, G = Z ? p.value.find((Ve) => Ve.slug === Z.node.type) ?? null : null, Re = B === null ? l.allow : R?.props?.allow ?? null, ue = B === null ? l.max : R?.props?.max ?? null, xe = B === null ? y.value : Z && P ? Z.node.values[P] ?? [] : [];
2076
+ async function z(C, M, D) {
2077
+ const K = C ? se(y.value, C) : null, Z = K ? d.value.find((Ve) => Ve.slug === K.node.type) ?? null : null, Re = C === null ? l.allow : D?.props?.allow ?? null, ue = C === null ? l.max : D?.props?.max ?? null, xe = C === null ? y.value : K && M ? K.node.values[M] ?? [] : [];
2093
2078
  if (ue != null && xe.length >= ue) return;
2094
2079
  const $e = await ne({
2095
- catalog: p.value,
2096
- parent: G,
2080
+ catalog: d.value,
2081
+ parent: Z,
2097
2082
  allow: Re,
2098
2083
  tree: y.value,
2099
2084
  groups: k.value,
2100
2085
  blocksPath: l.blocksPath
2101
2086
  });
2102
2087
  if (!$e) return;
2103
- const ze = vl($e.slug, I($e));
2104
- z(ut(y.value, B, P, xe.length, ze)), g.value = ze.key;
2088
+ const ze = vl($e.slug, N($e));
2089
+ F(ut(y.value, C, M, xe.length, ze)), g.value = ze.key;
2105
2090
  }
2106
- function I(B) {
2107
- const P = B.content?.sample ?? {}, R = {};
2108
- for (const [Z, G] of Object.entries(P))
2109
- (!Array.isArray(G) || G.length === 0 || typeof G[0] != "object") && (R[Z] = G);
2110
- return R;
2091
+ function N(C) {
2092
+ const M = C.content?.sample ?? {}, D = {};
2093
+ for (const [K, Z] of Object.entries(M))
2094
+ (!Array.isArray(Z) || Z.length === 0 || typeof Z[0] != "object") && (D[K] = Z);
2095
+ return D;
2111
2096
  }
2112
- async function M(B) {
2113
- const P = se(y.value, B);
2114
- if (!P) return;
2115
- const R = hl(P.node);
2097
+ async function L(C) {
2098
+ const M = se(y.value, C);
2099
+ if (!M) return;
2100
+ const D = hl(M.node);
2116
2101
  await Me({
2117
2102
  title: o("field.remove-title", {
2118
- title: p.value.find((G) => G.slug === P.node.type)?.title ?? P.node.type
2103
+ title: d.value.find((Z) => Z.slug === M.node.type)?.title ?? M.node.type
2119
2104
  }),
2120
- message: R > 0 ? o("field.remove-text", { count: R }) : o("field.remove-alone"),
2105
+ message: D > 0 ? o("field.remove-text", { count: D }) : o("field.remove-alone"),
2121
2106
  confirmText: o("field.remove"),
2122
2107
  cancelText: o("page.cancel"),
2123
2108
  tone: "danger"
2124
- }) && (g.value === B && (g.value = null), z(kl(y.value, B)));
2109
+ }) && (g.value === C && (g.value = null), F(kl(y.value, C)));
2125
2110
  }
2126
- function O(B) {
2127
- const P = se(y.value, B);
2128
- if (!P) return;
2129
- const R = Et(P.node);
2130
- z(ut(y.value, P.parent?.key ?? null, P.field, P.index + 1, R)), g.value = R.key;
2111
+ function P(C) {
2112
+ const M = se(y.value, C);
2113
+ if (!M) return;
2114
+ const D = Et(M.node);
2115
+ F(ut(y.value, M.parent?.key ?? null, M.field, M.index + 1, D)), g.value = D.key;
2131
2116
  }
2132
- function ee(B, P) {
2133
- z(bl(y.value, B, P));
2117
+ function ee(C, M) {
2118
+ F(bl(y.value, C, M));
2134
2119
  }
2135
- function de(B, P, R) {
2136
- z(wl(y.value, B, P, R));
2120
+ function de(C, M, D) {
2121
+ F(wl(y.value, C, M, D));
2137
2122
  }
2138
- function We(B) {
2139
- g.value = g.value === B ? null : B;
2123
+ function We(C) {
2124
+ g.value = g.value === C ? null : C;
2140
2125
  }
2141
- function Ae(B) {
2142
- B === null || !se(y.value, B) || (g.value = B);
2126
+ function Ae(C) {
2127
+ C === null || !se(y.value, C) || (g.value = C);
2143
2128
  }
2144
2129
  function we() {
2145
2130
  g.value = null;
2146
2131
  }
2147
- function pe(B) {
2148
- g.value && z(yl(y.value, g.value, B));
2132
+ function pe(C) {
2133
+ g.value && F(yl(y.value, g.value, C));
2149
2134
  }
2150
2135
  let fe;
2151
2136
  ie(
2152
2137
  () => c.value?.node.values,
2153
- (B, P) => {
2154
- if (!B || !P || !T.value || !m || !f) return;
2155
- const R = g.value, Z = T.value.id;
2138
+ (C, M) => {
2139
+ if (!C || !M || !T.value || !v || !f) return;
2140
+ const D = g.value, K = T.value.id;
2156
2141
  clearTimeout(fe), fe = setTimeout(() => {
2157
- !R || !m || m.render(Z, { values: B, key: R }).then((G) => {
2158
- S.value?.replace(R, G.html) || S.value?.refresh();
2142
+ !D || !v || v.render(K, { values: C, key: D }).then((Z) => {
2143
+ x.value?.replace(D, Z.html) || x.value?.refresh();
2159
2144
  }).catch(() => {
2160
2145
  });
2161
2146
  }, 300);
2162
2147
  },
2163
2148
  { deep: !0 }
2164
2149
  );
2165
- function Le(B) {
2166
- B.key === "Escape" && g.value && we();
2150
+ function Le(C) {
2151
+ C.key === "Escape" && g.value && we();
2167
2152
  }
2168
2153
  Te(async () => {
2169
2154
  if (window.addEventListener("keydown", Le), l.catalog === null && a) {
2170
- m = ke(a);
2155
+ v = ke(a);
2171
2156
  try {
2172
- A.value = await m.catalog();
2173
- } catch (B) {
2174
- F.danger(r(B));
2157
+ A.value = await v.catalog();
2158
+ } catch (C) {
2159
+ H.danger(r(C));
2175
2160
  }
2176
- } else a && (m = ke(a));
2161
+ } else a && (v = ke(a));
2177
2162
  }), Je(() => {
2178
2163
  clearTimeout(fe), window.removeEventListener("keydown", Le);
2179
2164
  });
2180
- const _e = C(
2165
+ const _e = B(
2181
2166
  () => T.value?.content ? Ye(T.value.content.schema) : []
2182
2167
  );
2183
- return (B, P) => e(n) ? (i(), V("div", Vn, [
2184
- u(e(j), {
2168
+ return (C, M) => e(n) ? (i(), V("div", yn, [
2169
+ u(e(R), {
2185
2170
  size: "sm",
2186
2171
  tone: "muted"
2187
2172
  }, {
2188
- default: d(() => [
2189
- _(v(e(o)("field.nested-note")), 1)
2173
+ default: p(() => [
2174
+ $(m(e(o)("field.nested-note")), 1)
2190
2175
  ]),
2191
2176
  _: 1
2192
2177
  })
@@ -2194,107 +2179,107 @@ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2194
2179
  key: 1,
2195
2180
  class: be(["wx-blocks-host", { "is-fill": t.fill }])
2196
2181
  }, [
2197
- $("div", {
2182
+ S("div", {
2198
2183
  class: be(["wx-blocks", {
2199
2184
  "is-editing": c.value !== null,
2200
2185
  "has-preview": e(f) !== null && e(f).url.value !== null
2201
2186
  }])
2202
2187
  }, [
2203
- $("div", Sn, [
2204
- $("div", Tn, [
2205
- $("span", Bn, v(e(o)("field.blocks")), 1),
2206
- u(e(j), {
2188
+ S("div", wn, [
2189
+ S("div", _n, [
2190
+ S("span", xn, m(e(o)("field.blocks")), 1),
2191
+ u(e(R), {
2207
2192
  size: "sm",
2208
2193
  tone: "muted"
2209
2194
  }, {
2210
- default: d(() => [
2211
- _(v(y.value.length), 1)
2195
+ default: p(() => [
2196
+ $(m(y.value.length), 1)
2212
2197
  ]),
2213
2198
  _: 1
2214
2199
  })
2215
2200
  ]),
2216
- u($n, {
2201
+ u(kn, {
2217
2202
  nodes: y.value,
2218
- catalog: p.value,
2203
+ catalog: d.value,
2219
2204
  selected: g.value,
2220
2205
  disabled: t.disabled,
2221
2206
  onSelect: We,
2222
- onAdd: N,
2223
- onRemove: M,
2224
- onDuplicate: O,
2207
+ onAdd: z,
2208
+ onRemove: L,
2209
+ onDuplicate: P,
2225
2210
  onVisibility: ee,
2226
2211
  onReorder: de
2227
2212
  }, null, 8, ["nodes", "catalog", "selected", "disabled"]),
2228
- $("div", Cn, [
2229
- !t.disabled && (t.max === null || y.value.length < t.max) ? (i(), W(e(q), {
2213
+ S("div", $n, [
2214
+ !t.disabled && (t.max === null || y.value.length < t.max) ? (i(), W(e(Y), {
2230
2215
  key: 0,
2231
2216
  variant: "outline",
2232
2217
  icon: "plus",
2233
2218
  class: "wx-blocks__add",
2234
- onClick: P[0] || (P[0] = (R) => N(null, null, null))
2219
+ onClick: M[0] || (M[0] = (D) => z(null, null, null))
2235
2220
  }, {
2236
- default: d(() => [
2237
- _(v(e(o)("field.add")), 1)
2221
+ default: p(() => [
2222
+ $(m(e(o)("field.add")), 1)
2238
2223
  ]),
2239
2224
  _: 1
2240
- })) : L("", !0),
2241
- e(f) && e(f).url.value ? (i(), W(e(q), {
2225
+ })) : I("", !0),
2226
+ e(f) && e(f).url.value ? (i(), W(e(Y), {
2242
2227
  key: 1,
2243
2228
  variant: "outline",
2244
2229
  icon: "eye",
2245
2230
  class: "wx-blocks__preview-button",
2246
- onClick: P[1] || (P[1] = (R) => S.value?.open())
2231
+ onClick: M[1] || (M[1] = (D) => x.value?.open())
2247
2232
  }, {
2248
- default: d(() => [
2249
- _(v(e(o)("field.preview")), 1)
2233
+ default: p(() => [
2234
+ $(m(e(o)("field.preview")), 1)
2250
2235
  ]),
2251
2236
  _: 1
2252
- })) : L("", !0)
2237
+ })) : I("", !0)
2253
2238
  ])
2254
2239
  ]),
2255
- c.value ? (i(), V("div", En, [
2256
- $("div", Wn, [
2257
- $("span", An, v(T.value?.title ?? c.value.node.type), 1),
2258
- $("span", Ln, [
2259
- $("code", null, v(c.value.node.type), 1),
2260
- u(e(q), {
2240
+ c.value ? (i(), V("div", Vn, [
2241
+ S("div", Sn, [
2242
+ S("span", Tn, m(T.value?.title ?? c.value.node.type), 1),
2243
+ S("span", Bn, [
2244
+ S("code", null, m(c.value.node.type), 1),
2245
+ u(e(Y), {
2261
2246
  size: "sm",
2262
2247
  variant: "outline",
2263
2248
  onClick: we
2264
2249
  }, {
2265
- default: d(() => [
2266
- _(v(e(o)("field.done")) + " · Esc", 1)
2250
+ default: p(() => [
2251
+ $(m(e(o)("field.done")) + " · Esc", 1)
2267
2252
  ]),
2268
2253
  _: 1
2269
2254
  })
2270
2255
  ])
2271
2256
  ]),
2272
- $("div", zn, [
2257
+ S("div", Cn, [
2273
2258
  T.value?.content ? (i(), W(e($t), {
2274
2259
  key: c.value.node.key,
2275
2260
  "model-value": c.value.node.values,
2276
2261
  root: _e.value,
2277
2262
  types: w.value,
2278
- translate: D.value,
2279
- can: K.value,
2263
+ translate: O.value,
2264
+ can: J.value,
2280
2265
  disabled: t.disabled,
2281
2266
  "onUpdate:modelValue": pe
2282
- }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (i(), W(e(j), {
2267
+ }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (i(), W(e(R), {
2283
2268
  key: 1,
2284
2269
  size: "sm",
2285
2270
  tone: "danger"
2286
2271
  }, {
2287
- default: d(() => [
2288
- _(v(e(o)("field.unknown-type", { type: c.value.node.type })), 1)
2272
+ default: p(() => [
2273
+ $(m(e(o)("field.unknown-type", { type: c.value.node.type })), 1)
2289
2274
  ]),
2290
2275
  _: 1
2291
2276
  }))
2292
2277
  ])
2293
- ])) : L("", !0),
2294
- e(f) && e(f).url.value ? (i(), V("div", In, [
2295
- u(pn, {
2278
+ ])) : I("", !0),
2279
+ e(f) && e(f).url.value ? (i(), V("div", En, [
2280
+ u(on, {
2296
2281
  ref_key: "previewEl",
2297
- ref: S,
2282
+ ref: x,
2298
2283
  url: e(f).url.value,
2299
2284
  selected: g.value,
2300
2285
  mode: c.value ? "phone" : "wide",
@@ -2302,11 +2287,11 @@ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2302
2287
  fill: t.fill,
2303
2288
  onSelect: Ae
2304
2289
  }, null, 8, ["url", "selected", "mode", "reload", "fill"])
2305
- ])) : L("", !0)
2290
+ ])) : I("", !0)
2306
2291
  ], 2)
2307
2292
  ], 2));
2308
2293
  }
2309
- }), Nn = /* @__PURE__ */ X(Un, [["__scopeId", "data-v-ed183a09"]]), Pn = { class: "wx-block-card__body" }, Mn = { class: "wx-block-card__title" }, On = { class: "wx-block-card__chips" }, Dn = /* @__PURE__ */ Q({
2294
+ }), An = /* @__PURE__ */ X(Wn, [["__scopeId", "data-v-ed183a09"]]), Ln = { class: "wx-block-card__body" }, zn = { class: "wx-block-card__title" }, In = { class: "wx-block-card__chips" }, Un = /* @__PURE__ */ Q({
2310
2295
  __name: "BlockCard",
2311
2296
  props: {
2312
2297
  block: {}
@@ -2323,54 +2308,54 @@ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2323
2308
  thumbnail: t.block.thumbnail,
2324
2309
  height: 120
2325
2310
  }, null, 8, ["thumbnail"]),
2326
- $("div", Pn, [
2327
- $("div", Mn, v(t.block.title), 1),
2328
- u(e(j), {
2311
+ S("div", Ln, [
2312
+ S("div", zn, m(t.block.title), 1),
2313
+ u(e(R), {
2329
2314
  size: "sm",
2330
2315
  tone: "muted"
2331
2316
  }, {
2332
- default: d(() => [
2333
- $("code", null, v(t.block.slug), 1),
2334
- _(" · " + v(t.block.usage_count > 0 ? e(n)("page.on-pages", { count: t.block.usage_count }) : e(n)("page.not-used")), 1)
2317
+ default: p(() => [
2318
+ S("code", null, m(t.block.slug), 1),
2319
+ $(" · " + m(t.block.usage_count > 0 ? e(n)("page.on-pages", { count: t.block.usage_count }) : e(n)("page.not-used")), 1)
2335
2320
  ]),
2336
2321
  _: 1
2337
2322
  }),
2338
- $("div", On, [
2339
- t.block.draft ? (i(), W(e(J), {
2323
+ S("div", In, [
2324
+ t.block.draft ? (i(), W(e(q), {
2340
2325
  key: 0,
2341
2326
  type: "warning",
2342
2327
  dot: ""
2343
2328
  }, {
2344
- default: d(() => [
2345
- _(v(e(n)("page.draft", { number: t.block.draft.number })), 1)
2329
+ default: p(() => [
2330
+ $(m(e(n)("page.draft", { number: t.block.draft.number })), 1)
2346
2331
  ]),
2347
2332
  _: 1
2348
- })) : L("", !0),
2349
- t.block.published ? (i(), W(e(J), {
2333
+ })) : I("", !0),
2334
+ t.block.published ? (i(), W(e(q), {
2350
2335
  key: 1,
2351
2336
  type: "success",
2352
2337
  dot: ""
2353
2338
  }, {
2354
- default: d(() => [
2355
- _(v(e(n)("page.live", { number: t.block.published.number })), 1)
2339
+ default: p(() => [
2340
+ $(m(e(n)("page.live", { number: t.block.published.number })), 1)
2356
2341
  ]),
2357
2342
  _: 1
2358
- })) : (i(), W(e(J), {
2343
+ })) : (i(), W(e(q), {
2359
2344
  key: 2,
2360
2345
  type: "default"
2361
2346
  }, {
2362
- default: d(() => [
2363
- _(v(e(n)("page.never-published")), 1)
2347
+ default: p(() => [
2348
+ $(m(e(n)("page.never-published")), 1)
2364
2349
  ]),
2365
2350
  _: 1
2366
2351
  })),
2367
- t.block.is_enabled ? L("", !0) : (i(), W(e(J), {
2352
+ t.block.is_enabled ? I("", !0) : (i(), W(e(q), {
2368
2353
  key: 3,
2369
2354
  type: "default",
2370
2355
  variant: "outline"
2371
2356
  }, {
2372
- default: d(() => [
2373
- _(v(e(n)("page.hidden")), 1)
2357
+ default: p(() => [
2358
+ $(m(e(n)("page.hidden")), 1)
2374
2359
  ]),
2375
2360
  _: 1
2376
2361
  }))
@@ -2378,62 +2363,62 @@ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2378
2363
  ])
2379
2364
  ]));
2380
2365
  }
2381
- }), Rn = /* @__PURE__ */ X(Dn, [["__scopeId", "data-v-daa12de4"]]), jn = { class: "wx-block-create" }, Hn = /* @__PURE__ */ Q({
2366
+ }), Nn = /* @__PURE__ */ X(Un, [["__scopeId", "data-v-daa12de4"]]), Pn = { class: "wx-block-create" }, Mn = /* @__PURE__ */ Q({
2382
2367
  __name: "BlockCreateDialog",
2383
2368
  setup(t) {
2384
2369
  const { resolve: l, dismiss: s, open: n } = yt(), o = Be(), r = ke(o);
2385
2370
  Ee();
2386
- const a = le("webx-blocks"), m = Ce(), A = C(() => o.state.manifest?.modules.find((w) => w.id === "blocks")?.meta?.groups ?? ["content"]), p = U({ title: "", slug: "", group: A.value[0] ?? "content" }), y = U({}), g = U(!1), c = U(!1), T = C(
2371
+ const a = le("webx-blocks"), v = Ce(), A = B(() => o.state.manifest?.modules.find((w) => w.id === "blocks")?.meta?.groups ?? ["content"]), d = U({ title: "", slug: "", group: A.value[0] ?? "content" }), y = U({}), g = U(!1), c = U(!1), T = B(
2387
2372
  () => A.value.map((h) => ({ value: h, label: ye(h, a) }))
2388
2373
  );
2389
2374
  function f(h) {
2390
2375
  return h.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "").slice(0, 64);
2391
2376
  }
2392
2377
  ie(
2393
- () => p.value.title,
2378
+ () => d.value.title,
2394
2379
  (h) => {
2395
- c.value || (p.value.slug = f(h));
2380
+ c.value || (d.value.slug = f(h));
2396
2381
  }
2397
2382
  );
2398
- function S(h) {
2383
+ function x(h) {
2399
2384
  return y.value[h]?.[0];
2400
2385
  }
2401
2386
  async function k() {
2402
2387
  g.value = !0, y.value = {};
2403
2388
  try {
2404
- l(await r.create(p.value));
2389
+ l(await r.create(d.value));
2405
2390
  } catch (h) {
2406
2391
  const w = h.body;
2407
- w?.errors ? y.value = w.errors : F.danger(m(h, a("page.failed")));
2392
+ w?.errors ? y.value = w.errors : H.danger(v(h, a("page.failed")));
2408
2393
  } finally {
2409
2394
  g.value = !1;
2410
2395
  }
2411
2396
  }
2412
2397
  return (h, w) => (i(), W(e(wt), {
2413
2398
  open: e(n),
2414
- "onUpdate:open": w[5] || (w[5] = (D) => vt(n) ? n.value = D : null),
2399
+ "onUpdate:open": w[5] || (w[5] = (O) => vt(n) ? n.value = O : null),
2415
2400
  title: e(a)("page.new"),
2416
2401
  width: 520
2417
2402
  }, {
2418
- footer: d(() => [
2403
+ footer: p(() => [
2419
2404
  u(e(Qt), { size: "sm" }, {
2420
- default: d(() => [
2421
- u(e(q), {
2405
+ default: p(() => [
2406
+ u(e(Y), {
2422
2407
  variant: "outline",
2423
- onClick: w[4] || (w[4] = (D) => e(s)())
2408
+ onClick: w[4] || (w[4] = (O) => e(s)())
2424
2409
  }, {
2425
- default: d(() => [
2426
- _(v(e(a)("page.cancel")), 1)
2410
+ default: p(() => [
2411
+ $(m(e(a)("page.cancel")), 1)
2427
2412
  ]),
2428
2413
  _: 1
2429
2414
  }),
2430
- u(e(q), {
2415
+ u(e(Y), {
2431
2416
  type: "primary",
2432
2417
  loading: g.value,
2433
2418
  onClick: k
2434
2419
  }, {
2435
- default: d(() => [
2436
- _(v(e(a)("page.create")), 1)
2420
+ default: p(() => [
2421
+ $(m(e(a)("page.create")), 1)
2437
2422
  ]),
2438
2423
  _: 1
2439
2424
  }, 8, ["loading"])
@@ -2441,45 +2426,45 @@ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2441
2426
  _: 1
2442
2427
  })
2443
2428
  ]),
2444
- default: d(() => [
2445
- $("div", jn, [
2446
- u(e(Y), {
2429
+ default: p(() => [
2430
+ S("div", Pn, [
2431
+ u(e(G), {
2447
2432
  label: e(a)("page.title"),
2448
- error: S("title")
2433
+ error: x("title")
2449
2434
  }, {
2450
- default: d(() => [
2435
+ default: p(() => [
2451
2436
  u(e(ge), {
2452
- modelValue: p.value.title,
2453
- "onUpdate:modelValue": w[0] || (w[0] = (D) => p.value.title = D),
2437
+ modelValue: d.value.title,
2438
+ "onUpdate:modelValue": w[0] || (w[0] = (O) => d.value.title = O),
2454
2439
  autofocus: ""
2455
2440
  }, null, 8, ["modelValue"])
2456
2441
  ]),
2457
2442
  _: 1
2458
2443
  }, 8, ["label", "error"]),
2459
- u(e(Y), {
2444
+ u(e(G), {
2460
2445
  label: e(a)("page.identifier"),
2461
2446
  help: e(a)("page.identifier-help"),
2462
- error: S("slug")
2447
+ error: x("slug")
2463
2448
  }, {
2464
- default: d(() => [
2449
+ default: p(() => [
2465
2450
  u(e(ge), {
2466
- modelValue: p.value.slug,
2467
- "onUpdate:modelValue": w[1] || (w[1] = (D) => p.value.slug = D),
2451
+ modelValue: d.value.slug,
2452
+ "onUpdate:modelValue": w[1] || (w[1] = (O) => d.value.slug = O),
2468
2453
  placeholder: "hero",
2469
- onInput: w[2] || (w[2] = (D) => c.value = !0)
2454
+ onInput: w[2] || (w[2] = (O) => c.value = !0)
2470
2455
  }, null, 8, ["modelValue"])
2471
2456
  ]),
2472
2457
  _: 1
2473
2458
  }, 8, ["label", "help", "error"]),
2474
- u(e(Y), {
2459
+ u(e(G), {
2475
2460
  label: e(a)("page.group"),
2476
2461
  help: e(a)("page.group-help"),
2477
- error: S("group")
2462
+ error: x("group")
2478
2463
  }, {
2479
- default: d(() => [
2464
+ default: p(() => [
2480
2465
  u(e(kt), {
2481
- modelValue: p.value.group,
2482
- "onUpdate:modelValue": w[3] || (w[3] = (D) => p.value.group = D),
2466
+ modelValue: d.value.group,
2467
+ "onUpdate:modelValue": w[3] || (w[3] = (O) => d.value.group = O),
2483
2468
  options: T.value
2484
2469
  }, null, 8, ["modelValue", "options"])
2485
2470
  ]),
@@ -2490,13 +2475,13 @@ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2490
2475
  _: 1
2491
2476
  }, 8, ["open", "title"]));
2492
2477
  }
2493
- }), Fn = /* @__PURE__ */ X(Hn, [["__scopeId", "data-v-a4c0d44c"]]), qn = {
2478
+ }), On = /* @__PURE__ */ X(Mn, [["__scopeId", "data-v-a4c0d44c"]]), Dn = {
2494
2479
  key: 1,
2495
2480
  class: "wx-blocks-page__toolbar"
2496
- }, Jn = { class: "wx-blocks-page__cards" }, Kn = { class: "wx-blocks-page__ghost-body" }, Zn = {
2481
+ }, Rn = { class: "wx-blocks-page__cards" }, jn = { class: "wx-blocks-page__ghost-body" }, Hn = {
2497
2482
  key: 0,
2498
2483
  class: "wx-blocks-page__group-title"
2499
- }, Gn = { class: "wx-blocks-page__cards" }, Yn = /* @__PURE__ */ Q({
2484
+ }, Fn = { class: "wx-blocks-page__cards" }, qn = /* @__PURE__ */ Q({
2500
2485
  __name: "BlocksPage",
2501
2486
  props: {
2502
2487
  base: { default: "/blocks" }
@@ -2504,83 +2489,90 @@ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2504
2489
  setup(t) {
2505
2490
  const l = t, s = Be(), n = ke(s), o = ht();
2506
2491
  Ee();
2507
- const r = le("webx-blocks"), a = Ce(), m = U([]), A = U(!0), p = U(""), y = U(""), g = xt(Fn), c = C(() => {
2492
+ const r = le("webx-blocks"), a = Ce(), v = U([]), A = U(!0), d = U(""), y = U(""), g = xt(On), c = B(() => {
2508
2493
  const z = s.state.manifest?.modules.find((N) => N.id === "blocks")?.meta;
2509
2494
  return {
2510
2495
  groups: z?.groups ?? [],
2511
2496
  editing: z?.editing ?? !0,
2512
2497
  provides: z?.provides ?? []
2513
2498
  };
2514
- }), T = C(() => s.can("blocks.manage") && c.value.editing), f = C(
2499
+ }), T = B(() => s.can("blocks.manage") && c.value.editing), f = B(
2515
2500
  () => s.state.manifest?.modules.find((z) => z.id === "blocks")?.title ?? r("module.title")
2516
- ), S = C(() => {
2517
- const z = p.value.trim().toLowerCase(), N = y.value === "" ? m.value : m.value.filter((I) => I.group === y.value);
2501
+ ), x = B(() => {
2502
+ const z = d.value.trim().toLowerCase(), N = y.value === "" ? v.value : v.value.filter((L) => L.group === y.value);
2518
2503
  return z === "" ? N : N.filter(
2519
- (I) => I.title.toLowerCase().includes(z) || I.slug.includes(z) || (I.description ?? "").toLowerCase().includes(z)
2504
+ (L) => L.title.toLowerCase().includes(z) || L.slug.includes(z) || (L.description ?? "").toLowerCase().includes(z)
2520
2505
  );
2521
- }), k = C(() => {
2506
+ }), k = B(() => {
2522
2507
  const z = [...c.value.groups];
2523
- for (const N of m.value)
2508
+ for (const N of v.value)
2524
2509
  z.includes(N.group) || z.push(N.group);
2525
- return z.filter((N) => m.value.some((I) => I.group === N));
2526
- }), h = C(
2510
+ return z.filter((N) => v.value.some((L) => L.group === N));
2511
+ }), h = B(
2527
2512
  () => k.value.length < 2 ? [] : [
2528
2513
  { value: "", label: r("page.all-groups") },
2529
2514
  ...k.value.map((z) => ({ value: z, label: ye(z, r) }))
2530
2515
  ]
2531
- ), w = C(() => {
2532
- const z = k.value.map((I) => ({
2533
- id: I,
2534
- label: ye(I, r),
2535
- blocks: S.value.filter((M) => M.group === I)
2536
- })).filter((I) => I.blocks.length > 0);
2537
- return y.value !== "" || S.value.length <= 5 || p.value.trim() !== "" || z.length < 2 ? [{ id: "", label: "", blocks: S.value }] : z;
2516
+ ), w = B(() => {
2517
+ const z = k.value.map((L) => ({
2518
+ id: L,
2519
+ label: ye(L, r),
2520
+ blocks: x.value.filter((P) => P.group === L)
2521
+ })).filter((L) => L.blocks.length > 0);
2522
+ return y.value !== "" || x.value.length <= 5 || d.value.trim() !== "" || z.length < 2 ? [{ id: "", label: "", blocks: x.value }] : z;
2538
2523
  });
2539
- async function D() {
2524
+ async function O() {
2540
2525
  A.value = !0;
2541
2526
  try {
2542
- m.value = await n.list();
2527
+ v.value = await n.list();
2543
2528
  } catch (z) {
2544
- F.danger(a(z));
2529
+ H.danger(a(z));
2545
2530
  } finally {
2546
2531
  A.value = !1;
2547
2532
  }
2548
2533
  }
2549
- function K(z) {
2534
+ function J(z) {
2550
2535
  o.push(`${l.base}/${z.id}`);
2551
2536
  }
2552
2537
  async function ne() {
2553
2538
  const z = await g({});
2554
- z && K(z);
2539
+ z && J(z);
2555
2540
  }
2556
- return Te(D), (z, N) => (i(), W(e(qt), {
2541
+ Te(O);
2542
+ const F = B(
2543
+ () => T.value ? [{ key: "new", label: r("page.new"), icon: "plus", primary: !0, run: () => {
2544
+ ne();
2545
+ } }] : []
2546
+ );
2547
+ return (z, N) => (i(), W(e(qt), {
2557
2548
  view: y.value,
2558
- "onUpdate:view": N[1] || (N[1] = (I) => y.value = I),
2549
+ "onUpdate:view": N[1] || (N[1] = (L) => y.value = L),
2559
2550
  class: "wx-blocks-page",
2560
2551
  title: f.value,
2561
- views: h.value
2562
- }, Pt({
2563
- default: d(() => [
2564
- c.value.editing ? L("", !0) : (i(), W(e(gt), {
2552
+ views: h.value,
2553
+ actions: F.value
2554
+ }, {
2555
+ default: p(() => [
2556
+ c.value.editing ? I("", !0) : (i(), W(e(gt), {
2565
2557
  key: 0,
2566
2558
  type: "info",
2567
2559
  variant: "soft",
2568
2560
  description: e(r)("page.editing-off")
2569
2561
  }, null, 8, ["description"])),
2570
- A.value || m.value.length > 0 ? (i(), V("div", qn, [
2562
+ A.value || v.value.length > 0 ? (i(), V("div", Dn, [
2571
2563
  u(e(ge), {
2572
- modelValue: p.value,
2573
- "onUpdate:modelValue": N[0] || (N[0] = (I) => p.value = I),
2564
+ modelValue: d.value,
2565
+ "onUpdate:modelValue": N[0] || (N[0] = (L) => d.value = L),
2574
2566
  class: "wx-blocks-page__search",
2575
2567
  placeholder: e(r)("page.search"),
2576
2568
  clearable: ""
2577
2569
  }, null, 8, ["modelValue", "placeholder"])
2578
- ])) : L("", !0),
2570
+ ])) : I("", !0),
2579
2571
  A.value ? (i(), W(e(he), { key: 2 }, {
2580
- template: d(() => [
2581
- $("div", Jn, [
2582
- (i(), V(H, null, te(4, (I) => $("div", {
2583
- key: I,
2572
+ template: p(() => [
2573
+ S("div", Rn, [
2574
+ (i(), V(j, null, te(4, (L) => S("div", {
2575
+ key: L,
2584
2576
  class: "wx-blocks-page__ghost"
2585
2577
  }, [
2586
2578
  u(e(Ue), {
@@ -2588,7 +2580,7 @@ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2588
2580
  height: 120,
2589
2581
  class: "wx-blocks-page__ghost-thumb"
2590
2582
  }),
2591
- $("div", Kn, [
2583
+ S("div", jn, [
2592
2584
  u(e(Ue), {
2593
2585
  variant: "title",
2594
2586
  width: "45%"
@@ -2607,57 +2599,40 @@ const pt = /* @__PURE__ */ Symbol("wx-blocks-root"), Vn = {
2607
2599
  ])
2608
2600
  ]),
2609
2601
  _: 1
2610
- })) : m.value.length === 0 ? (i(), W(e(_t), {
2602
+ })) : v.value.length === 0 ? (i(), W(e(_t), {
2611
2603
  key: 3,
2612
2604
  icon: "grid",
2613
2605
  title: e(r)("page.empty"),
2614
2606
  description: e(r)("page.empty-help")
2615
- }, null, 8, ["title", "description"])) : (i(!0), V(H, { key: 4 }, te(w.value, (I) => (i(), V("section", {
2616
- key: I.id,
2607
+ }, null, 8, ["title", "description"])) : (i(!0), V(j, { key: 4 }, te(w.value, (L) => (i(), V("section", {
2608
+ key: L.id,
2617
2609
  class: "wx-blocks-page__group"
2618
2610
  }, [
2619
- I.label ? (i(), V("div", Zn, v(I.label), 1)) : L("", !0),
2620
- $("div", Gn, [
2621
- (i(!0), V(H, null, te(I.blocks, (M) => (i(), W(Rn, {
2622
- key: M.id,
2623
- block: M,
2624
- onOpen: K
2611
+ L.label ? (i(), V("div", Hn, m(L.label), 1)) : I("", !0),
2612
+ S("div", Fn, [
2613
+ (i(!0), V(j, null, te(L.blocks, (P) => (i(), W(Nn, {
2614
+ key: P.id,
2615
+ block: P,
2616
+ onOpen: J
2625
2617
  }, null, 8, ["block"]))), 128))
2626
2618
  ])
2627
2619
  ]))), 128))
2628
2620
  ]),
2629
- _: 2
2630
- }, [
2631
- T.value ? {
2632
- name: "actions",
2633
- fn: d(() => [
2634
- u(e(q), {
2635
- type: "primary",
2636
- icon: "plus",
2637
- onClick: ne
2638
- }, {
2639
- default: d(() => [
2640
- _(v(e(r)("page.new")), 1)
2641
- ]),
2642
- _: 1
2643
- })
2644
- ]),
2645
- key: "0"
2646
- } : void 0
2647
- ]), 1032, ["view", "title", "views"]));
2621
+ _: 1
2622
+ }, 8, ["view", "title", "views", "actions"]));
2648
2623
  }
2649
- }), Qn = /* @__PURE__ */ X(Yn, [["__scopeId", "data-v-3cb993d5"]]);
2650
- function ra(t = {}) {
2624
+ }), Jn = /* @__PURE__ */ X(qn, [["__scopeId", "data-v-553b680f"]]);
2625
+ function na(t = {}) {
2651
2626
  const l = t.path ?? "/blocks";
2652
2627
  return {
2653
2628
  id: "blocks",
2654
2629
  path: l,
2655
2630
  routes: [
2656
- { path: l, name: "webx.blocks", component: Qn, props: { base: l } },
2631
+ { path: l, name: "webx.blocks", component: Jn, props: { base: l } },
2657
2632
  {
2658
2633
  path: `${l}/:id(\\d+)`,
2659
2634
  name: "webx.blocks.edit",
2660
- component: Zl,
2635
+ component: Hl,
2661
2636
  props: { base: l }
2662
2637
  }
2663
2638
  ],
@@ -2666,7 +2641,7 @@ function ra(t = {}) {
2666
2641
  // draws its children through the renderer; it needs the node for `props.allow` alone.
2667
2642
  types: {
2668
2643
  "wx-blocks": {
2669
- component: Nn,
2644
+ component: An,
2670
2645
  kind: "field",
2671
2646
  nested: !0,
2672
2647
  wide: !0,
@@ -2676,13 +2651,13 @@ function ra(t = {}) {
2676
2651
  };
2677
2652
  }
2678
2653
  export {
2679
- Zl as WxBlockEditorPage,
2680
- on as WxBlockPicker,
2654
+ Hl as WxBlockEditorPage,
2655
+ tn as WxBlockPicker,
2681
2656
  fl as WxBlockStage,
2682
2657
  zt as WxBlockThumb,
2683
- Nn as WxBlocks,
2684
- Qn as WxBlocksPage,
2685
- ra as blocks,
2658
+ An as WxBlocks,
2659
+ Jn as WxBlocksPage,
2660
+ na as blocks,
2686
2661
  _l as blocksMessages,
2687
2662
  Qe as blocksPreviewKey,
2688
2663
  Et as cloneNode,
@@ -2698,15 +2673,15 @@ export {
2698
2673
  se as locate,
2699
2674
  vl as makeNode,
2700
2675
  qe as newKey,
2701
- oa as provideBlocksPreview,
2676
+ ta as provideBlocksPreview,
2702
2677
  kl as removeNode,
2703
2678
  il as replaceBlock,
2704
2679
  wl as replaceList,
2705
2680
  St as stageDocument,
2706
- sa as typesIn,
2681
+ ea as typesIn,
2707
2682
  Vl as undeclared,
2708
2683
  yl as updateValues,
2709
- ia as useBlocksPreview,
2684
+ la as useBlocksPreview,
2710
2685
  De as walk
2711
2686
  };
2712
2687
  //# sourceMappingURL=index.js.map