@webx-ui/module-blocks 0.4.1 → 0.5.0

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