@webx-ui/module-blocks 0.1.0 → 0.1.1

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