@webx-ui/module-blocks 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,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 me, 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 we, 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 ve, 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 he(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 = we(), i = he(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 _(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(_(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);
208
+ const p = i.content, S = Array.from(p.childNodes);
209
+ o.insertBefore(p, n);
210
210
  const _ = t.defaultView?.webx;
211
211
  if (_?.mount)
212
- for (const k of $)
212
+ for (const k of S)
213
213
  k.nodeType === 1 && _.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)), _ = C(
258
+ () => kt({
259
259
  html: l.html,
260
260
  styles: l.styles,
261
261
  script: l.script,
@@ -265,136 +265,136 @@ 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] = (w) => o.value = w),
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
308
  srcdoc: _.value,
309
- style: de(m.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 wt() {
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: wt(), type: t, values: l };
330
330
  }
331
331
  function oe(t, l) {
332
- return wt(t, l, null, null);
332
+ return _t(t, l, null, null);
333
333
  }
334
- function wt(t, l, a, s) {
334
+ function _t(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 = _t(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 Fn(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: wt(), 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,19 +541,19 @@ 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 _e() {
546
546
  try {
547
- const { i18n: t } = ke();
548
- nt.has(t) || (t.defaults("webx-blocks", cl), nt.add(t));
547
+ const { i18n: t } = we();
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",
@@ -562,36 +562,36 @@ function pl(t, l, a) {
562
562
  variables: o.map((_) => `$${_}`).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 [_, k] of vl(l.styles))
567
+ _.startsWith(h) || _.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(_) ? n.push([_, k]) : i.push([_, 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"], wl = { class: "wx-block-editor__actions" }, _l = { 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 = we(), s = he(a), o = It(), i = ut();
656
+ _e();
657
+ const n = Q("webx-blocks"), h = C(() => Number(o.params.id)), p = U(null), S = U([]), _ = 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
+ }), w = 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: w })), ie = C(() => N.value !== "" && xe.value !== N.value), $e = C(() => fl(d.slug, w, 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({
689
+ return T.includes(d.group) || T.push(d.group), T.map((v) => ({ value: v, label: ke(v, n) }));
690
+ }), be = C({
691
691
  get: () => w.sample,
692
692
  set: (T) => {
693
693
  w.sample = T;
694
694
  }
695
- }), xe = C(() => re(w.schema));
695
+ }), Ve = C(() => re(w.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,19 +719,19 @@ 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(w, ae(v)), B.value = JSON.stringify(v.schema, null, 2), M.value = null, N.value = xe.value;
723
723
  }
724
- async function $e() {
724
+ async function Se() {
725
725
  _.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
731
  _.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);
@@ -742,17 +742,17 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
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, {
755
+ const v = await s.render(p.value.id, {
756
756
  values: w.sample,
757
757
  content: g.value ? {
758
758
  template: w.template,
@@ -771,15 +771,15 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
771
771
  }
772
772
  le(
773
773
  () => [w.template, w.styles, w.script, w.schema, w.sample],
774
- Q,
774
+ X,
775
775
  { deep: !0 }
776
776
  );
777
- const Ve = U(null);
778
- function ve(T) {
777
+ const Te = U(null);
778
+ function ge(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
784
  w.template += `{{ $${T} }}`;
785
785
  return;
@@ -787,16 +787,16 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
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,
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
800
  content: M.value ? { ...w, schema: void 0 } : w
801
801
  });
802
802
  se(v), F.success(
@@ -804,44 +804,44 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
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,143 +849,160 @@ 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
+ _.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", wl, [
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", _l, [
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,
1005
+ ref: Te,
989
1006
  modelValue: w.template,
990
1007
  "onUpdate:modelValue": v[1] || (v[1] = (z) => w.template = z),
991
1008
  language: "php",
@@ -994,42 +1011,42 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
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: (Pn) => Ce(z),
1030
+ textContent: f(ge(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), {
1047
+ default: c(() => [
1048
+ x("div", Tl, [
1049
+ u(e(We), {
1033
1050
  modelValue: w.styles,
1034
1051
  "onUpdate:modelValue": v[2] || (v[2] = (z) => w.styles = z),
1035
1052
  language: "css",
@@ -1037,22 +1054,22 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
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), {
1070
+ default: c(() => [
1071
+ x("div", Cl, [
1072
+ u(e(We), {
1056
1073
  "model-value": w.script ?? "",
1057
1074
  language: "javascript",
1058
1075
  readonly: !g.value,
@@ -1060,13 +1077,13 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
1060
1077
  "max-height": "70vh",
1061
1078
  "onUpdate:modelValue": v[3] || (v[3] = (z) => w.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(ve), {
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(ve), {
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
+ w.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: be.value,
1363
+ "onUpdate:modelValue": v[14] || (v[14] = (z) => be.value = z),
1364
+ root: e(Je)(w.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
+ _e();
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
1503
  }), _ = 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) => ({
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(ve), {
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(_.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: me(["wx-block-picker__card", { "is-disabled": d.reason !== null }]),
1581
+ disabled: d.reason !== null,
1582
+ title: d.reason ?? void 0,
1583
+ onClick: (w) => 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,24 +1617,25 @@ 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: {},
1594
1624
  selected: { default: null },
1595
1625
  mode: { default: "wide" },
1596
- reload: { default: 0 }
1626
+ reload: { default: 0 },
1627
+ fill: { type: Boolean, default: !1 }
1597
1628
  },
1598
1629
  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(() => [
1630
+ 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), _ = C(() => [
1600
1631
  { value: 1280, label: s("field.width-desktop") },
1601
1632
  { value: 834, label: s("field.width-tablet") },
1602
1633
  { value: 390, label: s("field.width-phone") }
1603
1634
  ]), 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(() => ({
1635
+ () => h.value ? p.value : a.mode === "phone" ? 390 : 1280
1636
+ ), b = C(() => h.value || a.mode === "phone" || n.value === 0 ? 1 : Math.min(1, n.value / k.value)), m = C(() => ({
1606
1637
  width: `${k.value}px`,
1607
- transform: `scale(${h.value})`
1638
+ transform: `scale(${b.value})`
1608
1639
  })), y = C(() => {
1609
1640
  if (!a.url) return "";
1610
1641
  try {
@@ -1620,56 +1651,56 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
1620
1651
  return null;
1621
1652
  }
1622
1653
  }
1623
- function c() {
1624
- $.value = !0;
1625
- const I = g();
1626
- I && Me(I, a.selected ?? null);
1654
+ function d() {
1655
+ S.value = !0;
1656
+ const N = g();
1657
+ N && De(N, a.selected ?? null);
1627
1658
  }
1628
- function w(I, N) {
1659
+ function w(N, I) {
1629
1660
  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;
1661
+ if (!P || !S.value) return !1;
1662
+ const H = Yt(P, N, I);
1663
+ return H && De(P, a.selected ?? null), H;
1633
1664
  }
1634
1665
  function B() {
1635
- $.value = !1, o.value && a.url && (o.value.src = a.url);
1666
+ S.value = !1, o.value && a.url && (o.value.src = a.url);
1636
1667
  }
1637
- function M(I) {
1638
- I.key === "Escape" && b.value && (b.value = !1, I.stopPropagation());
1668
+ function M(N) {
1669
+ N.key === "Escape" && h.value && (h.value = !1, N.stopPropagation());
1639
1670
  }
1640
1671
  return le(
1641
1672
  () => a.selected,
1642
- (I) => {
1643
- const N = g();
1644
- N && $.value && Me(N, I ?? null);
1673
+ (N) => {
1674
+ const I = g();
1675
+ I && S.value && De(I, N ?? null);
1645
1676
  }
1646
1677
  ), le(() => a.reload, B), le(
1647
1678
  () => 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" }])
1679
+ () => S.value = !1
1680
+ ), ye(() => window.addEventListener("keydown", M)), Re(() => window.removeEventListener("keydown", M)), l({ replace: w, refresh: B, open: () => h.value = !0 }), (N, I) => (r(), V("div", {
1681
+ class: me(["wx-blocks-preview", { "is-fullscreen": h.value, "is-phone": t.mode === "phone", "is-fill": t.fill }])
1651
1682
  }, [
1652
- V("div", Jl, [
1683
+ x("div", Zl, [
1653
1684
  u(e(R), {
1654
1685
  size: "xs",
1655
1686
  tone: "muted",
1656
1687
  class: "wx-blocks-preview__label",
1657
1688
  truncate: ""
1658
1689
  }, {
1659
- default: p(() => [
1660
- x(f(y.value), 1)
1690
+ default: c(() => [
1691
+ $(f(y.value), 1)
1661
1692
  ]),
1662
1693
  _: 1
1663
1694
  }),
1664
- V("div", Kl, [
1665
- b.value ? (r(), A(e(ut), {
1695
+ x("div", Gl, [
1696
+ h.value ? (r(), W(e(ct), {
1666
1697
  key: 0,
1667
- modelValue: d.value,
1668
- "onUpdate:modelValue": N[0] || (N[0] = (P) => d.value = P),
1698
+ modelValue: p.value,
1699
+ "onUpdate:modelValue": I[0] || (I[0] = (P) => p.value = P),
1669
1700
  options: _.value,
1670
1701
  size: "sm"
1671
1702
  }, null, 8, ["modelValue", "options"])) : E("", !0),
1672
- t.url ? (r(), A(e(q), {
1703
+ t.url ? (r(), W(e(q), {
1673
1704
  key: 1,
1674
1705
  size: "sm",
1675
1706
  variant: "outline",
@@ -1677,47 +1708,47 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
1677
1708
  target: "_blank",
1678
1709
  rel: "noopener"
1679
1710
  }, {
1680
- default: p(() => [
1681
- x(f(e(s)("field.open-site")), 1)
1711
+ default: c(() => [
1712
+ $(f(e(s)("field.open-site")), 1)
1682
1713
  ]),
1683
1714
  _: 1
1684
1715
  }, 8, ["href"])) : E("", !0),
1685
1716
  u(e(q), {
1686
1717
  size: "sm",
1687
1718
  variant: "outline",
1688
- onClick: N[1] || (N[1] = (P) => b.value = !b.value)
1719
+ onClick: I[1] || (I[1] = (P) => h.value = !h.value)
1689
1720
  }, {
1690
- default: p(() => [
1691
- x(f(b.value ? e(s)("field.close") : e(s)("field.fullscreen")), 1)
1721
+ default: c(() => [
1722
+ $(f(h.value ? e(s)("field.close") : e(s)("field.fullscreen")), 1)
1692
1723
  ]),
1693
1724
  _: 1
1694
1725
  })
1695
1726
  ])
1696
1727
  ]),
1697
- V("div", {
1728
+ x("div", {
1698
1729
  ref_key: "box",
1699
1730
  ref: i,
1700
1731
  class: "wx-blocks-preview__ground"
1701
1732
  }, [
1702
- V("div", {
1733
+ x("div", {
1703
1734
  class: "wx-blocks-preview__clip",
1704
- style: de({ width: `${Math.round(k.value * h.value)}px` })
1735
+ style: fe({ width: `${Math.round(k.value * b.value)}px` })
1705
1736
  }, [
1706
- t.url ? (r(), S("iframe", {
1737
+ t.url ? (r(), V("iframe", {
1707
1738
  key: 0,
1708
1739
  ref_key: "frame",
1709
1740
  ref: o,
1710
1741
  class: "wx-blocks-preview__frame",
1711
1742
  src: t.url,
1712
- style: de(m.value),
1743
+ style: fe(m.value),
1713
1744
  title: e(s)("field.preview"),
1714
- onLoad: c
1715
- }, null, 44, Zl)) : E("", !0)
1745
+ onLoad: d
1746
+ }, null, 44, Yl)) : E("", !0)
1716
1747
  ], 4)
1717
1748
  ], 512)
1718
1749
  ], 2));
1719
1750
  }
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({
1751
+ }), Xl = /* @__PURE__ */ Z(Ql, [["__scopeId", "data-v-2482da45"]]), 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
1752
  __name: "BlocksTree",
1722
1753
  props: {
1723
1754
  nodes: {},
@@ -1730,27 +1761,27 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
1730
1761
  },
1731
1762
  emits: ["select", "add", "remove", "duplicate", "reorder"],
1732
1763
  setup(t, { emit: l }) {
1733
- const a = t, s = l, o = Y("webx-blocks");
1764
+ const a = t, s = l, o = Q("webx-blocks");
1734
1765
  function i(_) {
1735
1766
  return a.catalog.find((k) => k.slug === _.type) ?? null;
1736
1767
  }
1737
1768
  function n(_) {
1738
1769
  return i(_)?.title ?? _.type;
1739
1770
  }
1740
- function b(_) {
1771
+ function h(_) {
1741
1772
  const k = i(_);
1742
- return k?.content ? _t(k.content.schema) : [];
1773
+ return k?.content ? xt(k.content.schema) : [];
1743
1774
  }
1744
- function d(_, k) {
1745
- const h = _.values[k.id];
1746
- return Array.isArray(h) ? h : [];
1775
+ function p(_, k) {
1776
+ const b = _.values[k.id];
1777
+ return Array.isArray(b) ? b : [];
1747
1778
  }
1748
- function $(_) {
1779
+ function S(_) {
1749
1780
  return i(_)?.icon ?? "grid";
1750
1781
  }
1751
1782
  return (_, k) => {
1752
- const h = Oe("blocks-tree", !0);
1753
- return r(), A(e(Pt), {
1783
+ const b = je("blocks-tree", !0);
1784
+ return r(), W(e(Dt), {
1754
1785
  "model-value": t.nodes,
1755
1786
  "item-key": "key",
1756
1787
  "item-label": (m) => n(m),
@@ -1758,59 +1789,59 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
1758
1789
  plain: "",
1759
1790
  size: "sm",
1760
1791
  "empty-text": t.depth === 0 ? e(o)("field.empty") : "",
1761
- class: he(["wx-blocks-tree", { "is-nested": t.depth > 0 }]),
1792
+ class: me(["wx-blocks-tree", { "is-nested": t.depth > 0 }]),
1762
1793
  "onUpdate:modelValue": k[6] || (k[6] = (m) => s("reorder", t.parentKey, t.field, m))
1763
1794
  }, {
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 }]),
1795
+ default: c(({ item: m }) => [
1796
+ x("div", en, [
1797
+ x("div", {
1798
+ class: me(["wx-blocks-tree__row", { "is-selected": t.selected === m.key }]),
1768
1799
  role: "button",
1769
1800
  tabindex: "0",
1770
1801
  onClick: (y) => s("select", m.key),
1771
1802
  onKeydown: [
1772
- Ke(Ie((y) => s("select", m.key), ["prevent"]), ["enter"]),
1773
- Ke(Ie((y) => s("select", m.key), ["prevent"]), ["space"])
1803
+ Ge(Me((y) => s("select", m.key), ["prevent"]), ["enter"]),
1804
+ Ge(Me((y) => s("select", m.key), ["prevent"]), ["space"])
1774
1805
  ]
1775
1806
  }, [
1776
- V("span", en, [
1807
+ x("span", ln, [
1777
1808
  u(e(ne), {
1778
- name: $(m)
1809
+ name: S(m)
1779
1810
  }, null, 8, ["name"])
1780
1811
  ]),
1781
- V("span", tn, f(n(m)), 1),
1782
- i(m) ? i(m)?.draft ? (r(), S("span", {
1812
+ x("span", nn, f(n(m)), 1),
1813
+ i(m) ? i(m)?.draft ? (r(), V("span", {
1783
1814
  key: 1,
1784
1815
  class: "wx-blocks-tree__flag is-warning",
1785
1816
  title: e(o)("field.draft-type")
1786
1817
  }, [
1787
1818
  u(e(ne), { name: "warning" })
1788
- ], 8, nn)) : i(m)?.is_enabled === !1 ? (r(), S("span", {
1819
+ ], 8, sn)) : i(m)?.is_enabled === !1 ? (r(), V("span", {
1789
1820
  key: 2,
1790
1821
  class: "wx-blocks-tree__flag",
1791
1822
  title: e(o)("field.disabled-type")
1792
1823
  }, [
1793
1824
  u(e(ne), { name: "eye-off" })
1794
- ], 8, an)) : E("", !0) : (r(), S("span", {
1825
+ ], 8, on)) : E("", !0) : (r(), V("span", {
1795
1826
  key: 0,
1796
1827
  class: "wx-blocks-tree__flag is-danger",
1797
1828
  title: e(o)("field.unknown-type", { type: m.type })
1798
1829
  }, [
1799
1830
  u(e(ne), { name: "close-circle" })
1800
- ], 8, ln)),
1801
- t.disabled ? E("", !0) : (r(), S("span", {
1831
+ ], 8, an)),
1832
+ t.disabled ? E("", !0) : (r(), V("span", {
1802
1833
  key: 3,
1803
1834
  class: "wx-blocks-tree__actions",
1804
- onClick: k[0] || (k[0] = Ie(() => {
1835
+ onClick: k[0] || (k[0] = Me(() => {
1805
1836
  }, ["stop"]))
1806
1837
  }, [
1807
- u(e(Qe), {
1838
+ u(e(Xe), {
1808
1839
  icon: "copy",
1809
1840
  size: "sm",
1810
1841
  title: e(o)("field.duplicate"),
1811
1842
  onClick: (y) => s("duplicate", m.key)
1812
1843
  }, null, 8, ["title", "onClick"]),
1813
- u(e(Qe), {
1844
+ u(e(Xe), {
1814
1845
  icon: "trash",
1815
1846
  size: "sm",
1816
1847
  tone: "danger",
@@ -1818,13 +1849,13 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
1818
1849
  onClick: (y) => s("remove", m.key)
1819
1850
  }, null, 8, ["title", "onClick"])
1820
1851
  ]))
1821
- ], 42, Xl),
1822
- (r(!0), S(j, null, te(b(m), (y) => (r(), S("div", {
1852
+ ], 42, tn),
1853
+ (r(!0), V(j, null, Y(h(m), (y) => (r(), V("div", {
1823
1854
  key: y.id,
1824
1855
  class: "wx-blocks-tree__kids"
1825
1856
  }, [
1826
- u(h, {
1827
- nodes: d(m, y),
1857
+ u(b, {
1858
+ nodes: p(m, y),
1828
1859
  catalog: t.catalog,
1829
1860
  "parent-key": m.key,
1830
1861
  field: y.id,
@@ -1832,22 +1863,22 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
1832
1863
  disabled: t.disabled,
1833
1864
  depth: t.depth + 1,
1834
1865
  onSelect: k[1] || (k[1] = (g) => s("select", g)),
1835
- onAdd: k[2] || (k[2] = (g, c, w) => s("add", g, c, w)),
1866
+ onAdd: k[2] || (k[2] = (g, d, w) => s("add", g, d, w)),
1836
1867
  onRemove: k[3] || (k[3] = (g) => s("remove", g)),
1837
1868
  onDuplicate: k[4] || (k[4] = (g) => s("duplicate", g)),
1838
- onReorder: k[5] || (k[5] = (g, c, w) => s("reorder", g, c, w))
1869
+ onReorder: k[5] || (k[5] = (g, d, w) => s("reorder", g, d, w))
1839
1870
  }, null, 8, ["nodes", "catalog", "parent-key", "field", "selected", "disabled", "depth"]),
1840
- t.disabled ? E("", !0) : (r(), S("button", {
1871
+ t.disabled ? E("", !0) : (r(), V("button", {
1841
1872
  key: 0,
1842
1873
  type: "button",
1843
1874
  class: "wx-blocks-tree__add is-inner",
1844
1875
  onClick: (g) => s("add", m.key, y.id, y)
1845
1876
  }, [
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)
1877
+ $(" + " + f(e(o)("field.add-inside")), 1),
1878
+ h(m).length > 1 ? (r(), V(j, { key: 0 }, [
1879
+ $(" · " + f(y.label ?? y.id), 1)
1849
1880
  ], 64)) : E("", !0)
1850
- ], 8, sn))
1881
+ ], 8, rn))
1851
1882
  ]))), 128))
1852
1883
  ])
1853
1884
  ]),
@@ -1855,30 +1886,27 @@ const vl = { class: "wx-block-editor" }, hl = { class: "wx-block-editor__head" }
1855
1886
  }, 8, ["model-value", "item-label", "disabled", "empty-text", "class"]);
1856
1887
  };
1857
1888
  }
1858
- }), rn = /* @__PURE__ */ Z(on, [["__scopeId", "data-v-5d559d85"]]), qe = /* @__PURE__ */ Symbol("wx-blocks-preview");
1859
- function Hn(t) {
1860
- it(qe, t);
1889
+ }), cn = /* @__PURE__ */ Z(un, [["__scopeId", "data-v-5d559d85"]]), Ke = /* @__PURE__ */ Symbol("wx-blocks-preview");
1890
+ function qn(t) {
1891
+ rt(Ke, t);
1861
1892
  }
1862
- function Fn() {
1863
- return Be(qe, null);
1893
+ function Jn() {
1894
+ return ze(Ke, null);
1864
1895
  }
1865
- const st = /* @__PURE__ */ Symbol("wx-blocks-root"), un = {
1896
+ const ot = /* @__PURE__ */ Symbol("wx-blocks-root"), dn = {
1866
1897
  key: 0,
1867
1898
  class: "wx-blocks-nested"
1868
- }, cn = {
1869
- key: 1,
1870
- class: "wx-blocks-host"
1871
- }, dn = { class: "wx-blocks__tree" }, pn = { class: "wx-blocks__panel-head" }, fn = { class: "wx-blocks__panel-title" }, mn = {
1899
+ }, pn = { class: "wx-blocks__tree" }, fn = { class: "wx-blocks__panel-head" }, mn = { class: "wx-blocks__panel-title" }, vn = {
1872
1900
  key: 0,
1873
1901
  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 = {
1902
+ }, hn = { class: "wx-blocks__panel-head" }, bn = { class: "wx-blocks__panel-title" }, gn = { class: "wx-blocks__panel-extra" }, kn = { class: "wx-blocks__form" }, yn = {
1875
1903
  key: 1,
1876
1904
  class: "wx-blocks__preview"
1877
- }, yn = /* @__PURE__ */ K({
1905
+ }, wn = /* @__PURE__ */ K({
1878
1906
  name: "WxBlocks",
1879
1907
  inheritAttrs: !1,
1880
1908
  __name: "BlocksField",
1881
- props: /* @__PURE__ */ Et({
1909
+ props: /* @__PURE__ */ Ut({
1882
1910
  node: { default: void 0 },
1883
1911
  context: { default: void 0 },
1884
1912
  name: { default: void 0 },
@@ -1887,144 +1915,148 @@ const st = /* @__PURE__ */ Symbol("wx-blocks-root"), un = {
1887
1915
  max: { default: null },
1888
1916
  catalog: { default: null },
1889
1917
  disabled: { type: Boolean, default: !1 },
1890
- blocksPath: { default: "/blocks" }
1918
+ blocksPath: { default: "/blocks" },
1919
+ fill: { type: Boolean, default: !1 }
1891
1920
  }, {
1892
1921
  modelValue: { default: () => [] },
1893
1922
  modelModifiers: {}
1894
1923
  }),
1895
1924
  emits: ["update:modelValue"],
1896
1925
  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);
1926
+ const l = t, a = zt(t, "modelValue"), s = ze(ot, !1);
1927
+ rt(ot, !0), _e();
1928
+ const o = Q("webx-blocks"), i = ze(Nt, null);
1900
1929
  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;
1930
+ const h = U([]), p = C(() => l.catalog ?? h.value), S = C(() => Array.isArray(a.value) ? a.value : []), _ = U(null), k = C(() => _.value ? oe(S.value, _.value) : null), b = C(
1931
+ () => k.value ? p.value.find((A) => A.slug === k.value?.node.type) ?? null : null
1932
+ ), m = ze(Ke, null), y = U(null), g = C(
1933
+ () => i?.state.manifest?.modules.find((A) => A.id === "blocks")?.meta?.groups ?? []
1934
+ ), d = Et()?.type, w = 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(
1935
+ () => l.context?.translate ?? i?.i18n.t ?? ((A) => A)
1936
+ ), M = C(() => l.context?.can ?? i?.can ?? (() => !0)), N = ht(Kl);
1937
+ function I(A) {
1938
+ a.value = A;
1910
1939
  }
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,
1940
+ async function P(A, L, D) {
1941
+ 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, ge = A === null ? l.max : D?.props?.max ?? null, Ce = A === null ? S.value : X && L ? X.node.values[L] ?? [] : [];
1942
+ if (ge != null && Ce.length >= ge) return;
1943
+ const ue = await N({
1944
+ catalog: p.value,
1945
+ parent: ee,
1946
+ allow: Te,
1947
+ tree: S.value,
1919
1948
  groups: g.value,
1920
1949
  blocksPath: l.blocksPath
1921
1950
  });
1922
1951
  if (!ue) return;
1923
- const Te = al(ue.slug, H(ue));
1924
- N(lt($.value, W, L, Se.length, Te)), _.value = Te.key;
1952
+ const Be = sl(ue.slug, H(ue));
1953
+ I(nt(S.value, A, L, Ce.length, Be)), _.value = Be.key;
1925
1954
  }
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);
1955
+ function H(A) {
1956
+ const L = A.content?.sample ?? {}, D = {};
1957
+ for (const [X, ee] of Object.entries(L))
1958
+ (!Array.isArray(ee) || ee.length === 0 || typeof ee[0] != "object") && (D[X] = ee);
1930
1959
  return D;
1931
1960
  }
1932
- function we(W) {
1933
- _.value === W && (_.value = null), N(il($.value, W));
1961
+ function xe(A) {
1962
+ _.value === A && (_.value = null), I(rl(S.value, A));
1934
1963
  }
1935
- function ie(W) {
1936
- const L = oe($.value, W);
1964
+ function ie(A) {
1965
+ const L = oe(S.value, A);
1937
1966
  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;
1967
+ const D = $t(L.node);
1968
+ I(nt(S.value, L.parent?.key ?? null, L.field, L.index + 1, D)), _.value = D.key;
1940
1969
  }
1941
- function _e(W, L, D) {
1942
- N(ul($.value, W, L, D));
1970
+ function $e(A, L, D) {
1971
+ I(cl(S.value, A, L, D));
1943
1972
  }
1944
- function ze(W) {
1945
- _.value = _.value === W ? null : W;
1973
+ function Ue(A) {
1974
+ _.value = _.value === A ? null : A;
1946
1975
  }
1947
- function me() {
1976
+ function be() {
1948
1977
  _.value = null;
1949
1978
  }
1950
- function xe(W) {
1951
- _.value && N(rl($.value, _.value, W));
1979
+ function Ve(A) {
1980
+ _.value && I(ul(S.value, _.value, A));
1952
1981
  }
1953
1982
  let re;
1954
1983
  le(
1955
1984
  () => k.value?.node.values,
1956
- (W, L) => {
1957
- if (!W || !L || !h.value || !n || !m) return;
1958
- const D = _.value, Q = h.value.id;
1985
+ (A, L) => {
1986
+ if (!A || !L || !b.value || !n || !m) return;
1987
+ const D = _.value, X = b.value.id;
1959
1988
  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();
1989
+ !D || !n || n.render(X, { values: A, key: D }).then((ee) => {
1990
+ y.value?.replace(D, ee.html) || y.value?.refresh();
1962
1991
  }).catch(() => {
1963
1992
  });
1964
1993
  }, 300);
1965
1994
  },
1966
1995
  { deep: !0 }
1967
1996
  );
1968
- function se(W) {
1969
- W.key === "Escape" && _.value && me();
1997
+ function se(A) {
1998
+ A.key === "Escape" && _.value && be();
1970
1999
  }
1971
- ge(async () => {
2000
+ ye(async () => {
1972
2001
  if (window.addEventListener("keydown", se), l.catalog === null && i) {
1973
- n = fe(i);
2002
+ n = he(i);
1974
2003
  try {
1975
- b.value = await n.catalog();
1976
- } catch (W) {
1977
- F.danger(W.body?.message ?? String(W));
2004
+ h.value = await n.catalog();
2005
+ } catch (A) {
2006
+ F.danger(A.body?.message ?? String(A));
1978
2007
  }
1979
- } else i && (n = fe(i));
1980
- }), De(() => {
2008
+ } else i && (n = he(i));
2009
+ }), Re(() => {
1981
2010
  clearTimeout(re), window.removeEventListener("keydown", se);
1982
2011
  });
1983
- const $e = C(
1984
- () => h.value?.content ? Fe(h.value.content.schema) : []
2012
+ const Se = C(
2013
+ () => b.value?.content ? Je(b.value.content.schema) : []
1985
2014
  );
1986
- return (W, L) => e(s) ? (r(), S("div", un, [
2015
+ return (A, L) => e(s) ? (r(), V("div", dn, [
1987
2016
  u(e(R), {
1988
2017
  size: "sm",
1989
2018
  tone: "muted"
1990
2019
  }, {
1991
- default: p(() => [
1992
- x(f(e(o)("field.nested-note")), 1)
2020
+ default: c(() => [
2021
+ $(f(e(o)("field.nested-note")), 1)
1993
2022
  ]),
1994
2023
  _: 1
1995
2024
  })
1996
- ])) : (r(), S("div", cn, [
1997
- V("div", {
1998
- class: he(["wx-blocks", {
2025
+ ])) : (r(), V("div", {
2026
+ key: 1,
2027
+ class: me(["wx-blocks-host", { "is-fill": t.fill }])
2028
+ }, [
2029
+ x("div", {
2030
+ class: me(["wx-blocks", {
1999
2031
  "is-editing": k.value !== null,
2000
2032
  "has-preview": e(m) !== null && e(m).url.value !== null
2001
2033
  }])
2002
2034
  }, [
2003
- V("div", dn, [
2004
- V("div", pn, [
2005
- V("span", fn, f(e(o)("field.blocks")), 1),
2035
+ x("div", pn, [
2036
+ x("div", fn, [
2037
+ x("span", mn, f(e(o)("field.blocks")), 1),
2006
2038
  u(e(R), {
2007
2039
  size: "sm",
2008
2040
  tone: "muted"
2009
2041
  }, {
2010
- default: p(() => [
2011
- x(f($.value.length), 1)
2042
+ default: c(() => [
2043
+ $(f(S.value.length), 1)
2012
2044
  ]),
2013
2045
  _: 1
2014
2046
  })
2015
2047
  ]),
2016
- u(rn, {
2017
- nodes: $.value,
2018
- catalog: d.value,
2048
+ u(cn, {
2049
+ nodes: S.value,
2050
+ catalog: p.value,
2019
2051
  selected: _.value,
2020
2052
  disabled: t.disabled,
2021
- onSelect: ze,
2053
+ onSelect: Ue,
2022
2054
  onAdd: P,
2023
- onRemove: we,
2055
+ onRemove: xe,
2024
2056
  onDuplicate: ie,
2025
- onReorder: _e
2057
+ onReorder: $e
2026
2058
  }, null, 8, ["nodes", "catalog", "selected", "disabled"]),
2027
- !t.disabled && (t.max === null || $.value.length < t.max) ? (r(), A(e(q), {
2059
+ !t.disabled && (t.max === null || S.value.length < t.max) ? (r(), W(e(q), {
2028
2060
  key: 0,
2029
2061
  variant: "outline",
2030
2062
  block: "",
@@ -2032,141 +2064,142 @@ const st = /* @__PURE__ */ Symbol("wx-blocks-root"), un = {
2032
2064
  class: "wx-blocks__add",
2033
2065
  onClick: L[0] || (L[0] = (D) => P(null, null, null))
2034
2066
  }, {
2035
- default: p(() => [
2036
- x(f(e(o)("field.add")), 1)
2067
+ default: c(() => [
2068
+ $(f(e(o)("field.add")), 1)
2037
2069
  ]),
2038
2070
  _: 1
2039
2071
  })) : E("", !0),
2040
- e(m) && e(m).url.value ? (r(), A(e(q), {
2072
+ e(m) && e(m).url.value ? (r(), W(e(q), {
2041
2073
  key: 1,
2042
2074
  variant: "text",
2043
2075
  block: "",
2044
2076
  class: "wx-blocks__preview-button",
2045
2077
  onClick: L[1] || (L[1] = (D) => y.value?.open())
2046
2078
  }, {
2047
- default: p(() => [
2048
- x(f(e(o)("field.preview")), 1)
2079
+ default: c(() => [
2080
+ $(f(e(o)("field.preview")), 1)
2049
2081
  ]),
2050
2082
  _: 1
2051
2083
  })) : E("", !0)
2052
2084
  ]),
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),
2085
+ k.value ? (r(), V("div", vn, [
2086
+ x("div", hn, [
2087
+ x("span", bn, f(b.value?.title ?? k.value.node.type), 1),
2088
+ x("span", gn, [
2089
+ x("code", null, f(k.value.node.type), 1),
2058
2090
  u(e(q), {
2059
2091
  size: "sm",
2060
2092
  variant: "outline",
2061
- onClick: me
2093
+ onClick: be
2062
2094
  }, {
2063
- default: p(() => [
2064
- x(f(e(o)("field.done")) + " · Esc", 1)
2095
+ default: c(() => [
2096
+ $(f(e(o)("field.done")) + " · Esc", 1)
2065
2097
  ]),
2066
2098
  _: 1
2067
2099
  })
2068
2100
  ])
2069
2101
  ]),
2070
- V("div", gn, [
2071
- h.value?.content ? (r(), A(e(ht), {
2102
+ x("div", kn, [
2103
+ b.value?.content ? (r(), W(e(bt), {
2072
2104
  key: k.value.node.key,
2073
2105
  "model-value": k.value.node.values,
2074
- root: $e.value,
2106
+ root: Se.value,
2075
2107
  types: w.value,
2076
2108
  translate: B.value,
2077
2109
  can: M.value,
2078
2110
  disabled: t.disabled,
2079
- "onUpdate:modelValue": xe
2080
- }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (r(), A(e(R), {
2111
+ "onUpdate:modelValue": Ve
2112
+ }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (r(), W(e(R), {
2081
2113
  key: 1,
2082
2114
  size: "sm",
2083
2115
  tone: "danger"
2084
2116
  }, {
2085
- default: p(() => [
2086
- x(f(e(o)("field.unknown-type", { type: k.value.node.type })), 1)
2117
+ default: c(() => [
2118
+ $(f(e(o)("field.unknown-type", { type: k.value.node.type })), 1)
2087
2119
  ]),
2088
2120
  _: 1
2089
2121
  }))
2090
2122
  ])
2091
2123
  ])) : E("", !0),
2092
- e(m) && e(m).url.value ? (r(), S("div", kn, [
2093
- u(Yl, {
2124
+ e(m) && e(m).url.value ? (r(), V("div", yn, [
2125
+ u(Xl, {
2094
2126
  ref_key: "previewEl",
2095
2127
  ref: y,
2096
2128
  url: e(m).url.value,
2097
2129
  selected: _.value,
2098
2130
  mode: k.value ? "phone" : "wide",
2099
- reload: e(m).reload?.value ?? 0
2100
- }, null, 8, ["url", "selected", "mode", "reload"])
2131
+ reload: e(m).reload?.value ?? 0,
2132
+ fill: t.fill
2133
+ }, null, 8, ["url", "selected", "mode", "reload", "fill"])
2101
2134
  ])) : E("", !0)
2102
2135
  ], 2)
2103
- ]));
2136
+ ], 2));
2104
2137
  }
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({
2138
+ }), _n = /* @__PURE__ */ Z(wn, [["__scopeId", "data-v-3f14c6c6"]]), xn = { class: "wx-block-card__body" }, $n = { class: "wx-block-card__title" }, Vn = { class: "wx-block-card__chips" }, Sn = /* @__PURE__ */ K({
2106
2139
  __name: "BlockCard",
2107
2140
  props: {
2108
2141
  block: {}
2109
2142
  },
2110
2143
  emits: ["open"],
2111
2144
  setup(t, { emit: l }) {
2112
- const a = l, s = Y("webx-blocks");
2113
- return (o, i) => (r(), S("button", {
2145
+ const a = l, s = Q("webx-blocks");
2146
+ return (o, i) => (r(), V("button", {
2114
2147
  type: "button",
2115
2148
  class: "wx-block-card",
2116
2149
  onClick: i[0] || (i[0] = (n) => a("open", t.block))
2117
2150
  }, [
2118
- u(Tt, {
2151
+ u(Ct, {
2119
2152
  thumbnail: t.block.thumbnail,
2120
2153
  height: 120
2121
2154
  }, null, 8, ["thumbnail"]),
2122
- V("div", _n, [
2123
- V("div", xn, f(t.block.title), 1),
2155
+ x("div", xn, [
2156
+ x("div", $n, f(t.block.title), 1),
2124
2157
  u(e(R), {
2125
2158
  size: "sm",
2126
2159
  tone: "muted"
2127
2160
  }, {
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)
2161
+ default: c(() => [
2162
+ x("code", null, f(t.block.slug), 1),
2163
+ $(" · " + f(t.block.usage_count > 0 ? e(s)("page.on-pages", { count: t.block.usage_count }) : e(s)("page.not-used")), 1)
2131
2164
  ]),
2132
2165
  _: 1
2133
2166
  }),
2134
- V("div", $n, [
2135
- t.block.draft ? (r(), A(e(G), {
2167
+ x("div", Vn, [
2168
+ t.block.draft ? (r(), W(e(G), {
2136
2169
  key: 0,
2137
2170
  type: "warning",
2138
2171
  dot: ""
2139
2172
  }, {
2140
- default: p(() => [
2141
- x(f(e(s)("page.draft", { number: t.block.draft.number })), 1)
2173
+ default: c(() => [
2174
+ $(f(e(s)("page.draft", { number: t.block.draft.number })), 1)
2142
2175
  ]),
2143
2176
  _: 1
2144
2177
  })) : E("", !0),
2145
- t.block.published ? (r(), A(e(G), {
2178
+ t.block.published ? (r(), W(e(G), {
2146
2179
  key: 1,
2147
2180
  type: "success",
2148
2181
  dot: ""
2149
2182
  }, {
2150
- default: p(() => [
2151
- x(f(e(s)("page.live", { number: t.block.published.number })), 1)
2183
+ default: c(() => [
2184
+ $(f(e(s)("page.live", { number: t.block.published.number })), 1)
2152
2185
  ]),
2153
2186
  _: 1
2154
- })) : (r(), A(e(G), {
2187
+ })) : (r(), W(e(G), {
2155
2188
  key: 2,
2156
2189
  type: "default"
2157
2190
  }, {
2158
- default: p(() => [
2159
- x(f(e(s)("page.never-published")), 1)
2191
+ default: c(() => [
2192
+ $(f(e(s)("page.never-published")), 1)
2160
2193
  ]),
2161
2194
  _: 1
2162
2195
  })),
2163
- t.block.is_enabled ? E("", !0) : (r(), A(e(G), {
2196
+ t.block.is_enabled ? E("", !0) : (r(), W(e(G), {
2164
2197
  key: 3,
2165
2198
  type: "default",
2166
2199
  variant: "outline"
2167
2200
  }, {
2168
- default: p(() => [
2169
- x(f(e(s)("page.hidden")), 1)
2201
+ default: c(() => [
2202
+ $(f(e(s)("page.hidden")), 1)
2170
2203
  ]),
2171
2204
  _: 1
2172
2205
  }))
@@ -2174,52 +2207,52 @@ const st = /* @__PURE__ */ Symbol("wx-blocks-root"), un = {
2174
2207
  ])
2175
2208
  ]));
2176
2209
  }
2177
- }), Sn = /* @__PURE__ */ Z(Vn, [["__scopeId", "data-v-daa12de4"]]), Tn = { class: "wx-block-create" }, Cn = /* @__PURE__ */ K({
2210
+ }), Tn = /* @__PURE__ */ Z(Sn, [["__scopeId", "data-v-daa12de4"]]), Cn = { class: "wx-block-create" }, Bn = /* @__PURE__ */ K({
2178
2211
  __name: "BlockCreateDialog",
2179
2212
  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) }))
2213
+ const { resolve: l, dismiss: a, open: s } = ft(), o = we(), i = he(o);
2214
+ _e();
2215
+ const n = Q("webx-blocks"), h = C(() => o.state.manifest?.modules.find((w) => w.id === "blocks")?.meta?.groups ?? ["content"]), p = U({ title: "", slug: "", group: h.value[0] ?? "content" }), S = U({}), _ = U(!1), k = U(!1), b = C(
2216
+ () => h.value.map((d) => ({ value: d, label: ke(d, n) }))
2184
2217
  );
2185
- function m(c) {
2186
- return c.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "").slice(0, 64);
2218
+ function m(d) {
2219
+ return d.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "").slice(0, 64);
2187
2220
  }
2188
2221
  le(
2189
- () => d.value.title,
2190
- (c) => {
2191
- k.value || (d.value.slug = m(c));
2222
+ () => p.value.title,
2223
+ (d) => {
2224
+ k.value || (p.value.slug = m(d));
2192
2225
  }
2193
2226
  );
2194
- function y(c) {
2195
- return $.value[c]?.[0];
2227
+ function y(d) {
2228
+ return S.value[d]?.[0];
2196
2229
  }
2197
2230
  async function g() {
2198
- _.value = !0, $.value = {};
2231
+ _.value = !0, S.value = {};
2199
2232
  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"));
2233
+ l(await i.create(p.value));
2234
+ } catch (d) {
2235
+ const w = d.body;
2236
+ w?.errors ? S.value = w.errors : F.danger(w?.message ?? n("page.failed"));
2204
2237
  } finally {
2205
2238
  _.value = !1;
2206
2239
  }
2207
2240
  }
2208
- return (c, w) => (r(), A(e(ft), {
2241
+ return (d, w) => (r(), W(e(mt), {
2209
2242
  open: e(s),
2210
- "onUpdate:open": w[5] || (w[5] = (B) => ot(s) ? s.value = B : null),
2243
+ "onUpdate:open": w[5] || (w[5] = (B) => it(s) ? s.value = B : null),
2211
2244
  title: e(n)("page.new"),
2212
2245
  width: 520
2213
2246
  }, {
2214
- footer: p(() => [
2215
- u(e(Dt), { size: "sm" }, {
2216
- default: p(() => [
2247
+ footer: c(() => [
2248
+ u(e(Ot), { size: "sm" }, {
2249
+ default: c(() => [
2217
2250
  u(e(q), {
2218
2251
  variant: "outline",
2219
2252
  onClick: w[4] || (w[4] = (B) => e(a)())
2220
2253
  }, {
2221
- default: p(() => [
2222
- x(f(e(n)("page.cancel")), 1)
2254
+ default: c(() => [
2255
+ $(f(e(n)("page.cancel")), 1)
2223
2256
  ]),
2224
2257
  _: 1
2225
2258
  }),
@@ -2228,8 +2261,8 @@ const st = /* @__PURE__ */ Symbol("wx-blocks-root"), un = {
2228
2261
  loading: _.value,
2229
2262
  onClick: g
2230
2263
  }, {
2231
- default: p(() => [
2232
- x(f(e(n)("page.create")), 1)
2264
+ default: c(() => [
2265
+ $(f(e(n)("page.create")), 1)
2233
2266
  ]),
2234
2267
  _: 1
2235
2268
  }, 8, ["loading"])
@@ -2237,16 +2270,16 @@ const st = /* @__PURE__ */ Symbol("wx-blocks-root"), un = {
2237
2270
  _: 1
2238
2271
  })
2239
2272
  ]),
2240
- default: p(() => [
2241
- V("div", Tn, [
2273
+ default: c(() => [
2274
+ x("div", Cn, [
2242
2275
  u(e(J), {
2243
2276
  label: e(n)("page.title"),
2244
2277
  error: y("title")
2245
2278
  }, {
2246
- default: p(() => [
2247
- u(e(pe), {
2248
- modelValue: d.value.title,
2249
- "onUpdate:modelValue": w[0] || (w[0] = (B) => d.value.title = B),
2279
+ default: c(() => [
2280
+ u(e(ve), {
2281
+ modelValue: p.value.title,
2282
+ "onUpdate:modelValue": w[0] || (w[0] = (B) => p.value.title = B),
2250
2283
  autofocus: ""
2251
2284
  }, null, 8, ["modelValue"])
2252
2285
  ]),
@@ -2257,10 +2290,10 @@ const st = /* @__PURE__ */ Symbol("wx-blocks-root"), un = {
2257
2290
  help: e(n)("page.identifier-help"),
2258
2291
  error: y("slug")
2259
2292
  }, {
2260
- default: p(() => [
2261
- u(e(pe), {
2262
- modelValue: d.value.slug,
2263
- "onUpdate:modelValue": w[1] || (w[1] = (B) => d.value.slug = B),
2293
+ default: c(() => [
2294
+ u(e(ve), {
2295
+ modelValue: p.value.slug,
2296
+ "onUpdate:modelValue": w[1] || (w[1] = (B) => p.value.slug = B),
2264
2297
  placeholder: "hero",
2265
2298
  onInput: w[2] || (w[2] = (B) => k.value = !0)
2266
2299
  }, null, 8, ["modelValue"])
@@ -2272,11 +2305,11 @@ const st = /* @__PURE__ */ Symbol("wx-blocks-root"), un = {
2272
2305
  help: e(n)("page.group-help"),
2273
2306
  error: y("group")
2274
2307
  }, {
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
2308
+ default: c(() => [
2309
+ u(e(pt), {
2310
+ modelValue: p.value.group,
2311
+ "onUpdate:modelValue": w[3] || (w[3] = (B) => p.value.group = B),
2312
+ options: b.value
2280
2313
  }, null, 8, ["modelValue", "options"])
2281
2314
  ]),
2282
2315
  _: 1
@@ -2286,128 +2319,156 @@ const st = /* @__PURE__ */ Symbol("wx-blocks-root"), un = {
2286
2319
  _: 1
2287
2320
  }, 8, ["open", "title"]));
2288
2321
  }
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 = {
2322
+ }), Wn = /* @__PURE__ */ Z(Bn, [["__scopeId", "data-v-274bc88a"]]), An = { class: "wx-blocks-page" }, zn = { class: "wx-blocks-page__head" }, En = { class: "wx-blocks-page__cards" }, Un = { class: "wx-blocks-page__ghost-body" }, In = {
2290
2323
  key: 0,
2291
2324
  class: "wx-blocks-page__group-title"
2292
- }, Un = { class: "wx-blocks-page__cards" }, Nn = /* @__PURE__ */ K({
2325
+ }, Nn = { class: "wx-blocks-page__cards" }, Ln = /* @__PURE__ */ K({
2293
2326
  __name: "BlocksPage",
2294
2327
  props: {
2295
2328
  base: { default: "/blocks" }
2296
2329
  },
2297
2330
  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(() => {
2331
+ const l = t, a = we(), s = he(a), o = ut();
2332
+ _e();
2333
+ const i = Q("webx-blocks"), n = U([]), h = U(!0), p = U(""), S = ht(Wn), _ = C(() => {
2301
2334
  const B = a.state.manifest?.modules.find((M) => M.id === "blocks")?.meta;
2302
2335
  return {
2303
2336
  groups: B?.groups ?? [],
2304
2337
  editing: B?.editing ?? !0,
2305
2338
  provides: B?.provides ?? []
2306
2339
  };
2307
- }), k = C(() => a.can("blocks.manage") && _.value.editing), h = C(
2340
+ }), k = C(() => a.can("blocks.manage") && _.value.editing), b = C(
2308
2341
  () => a.state.manifest?.modules.find((B) => B.id === "blocks")?.title ?? i("module.title")
2309
2342
  ), m = C(() => {
2310
- const B = d.value.trim().toLowerCase();
2343
+ const B = p.value.trim().toLowerCase();
2311
2344
  return B === "" ? n.value : n.value.filter(
2312
2345
  (M) => M.title.toLowerCase().includes(B) || M.slug.includes(B) || (M.description ?? "").toLowerCase().includes(B)
2313
2346
  );
2314
2347
  }), y = C(() => {
2315
2348
  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;
2349
+ for (const I of m.value)
2350
+ B.includes(I.group) || B.push(I.group);
2351
+ const M = B.map((I) => ({
2352
+ id: I,
2353
+ label: ke(I, i),
2354
+ blocks: m.value.filter((P) => P.group === I)
2355
+ })).filter((I) => I.blocks.length > 0);
2356
+ return m.value.length <= 5 || p.value.trim() !== "" || M.length < 2 ? [{ id: "", label: "", blocks: m.value }] : M;
2324
2357
  });
2325
2358
  async function g() {
2326
- b.value = !0;
2359
+ h.value = !0;
2327
2360
  try {
2328
2361
  n.value = await s.list();
2329
2362
  } catch (B) {
2330
2363
  F.danger(B.body?.message ?? String(B));
2331
2364
  } finally {
2332
- b.value = !1;
2365
+ h.value = !1;
2333
2366
  }
2334
2367
  }
2335
- function c(B) {
2368
+ function d(B) {
2336
2369
  o.push(`${l.base}/${B.id}`);
2337
2370
  }
2338
2371
  async function w() {
2339
- const B = await $({});
2340
- B && c(B);
2372
+ const B = await S({});
2373
+ B && d(B);
2341
2374
  }
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)
2375
+ return ye(g), (B, M) => (r(), V("div", An, [
2376
+ x("div", zn, [
2377
+ u(e(Rt), { level: 2 }, {
2378
+ default: c(() => [
2379
+ $(f(b.value), 1)
2347
2380
  ]),
2348
2381
  _: 1
2349
2382
  }),
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
- ])
2383
+ k.value ? (r(), W(e(q), {
2384
+ key: 0,
2385
+ type: "primary",
2386
+ icon: "plus",
2387
+ onClick: w
2388
+ }, {
2389
+ default: c(() => [
2390
+ $(f(e(i)("page.new")), 1)
2391
+ ]),
2392
+ _: 1
2393
+ })) : E("", !0)
2369
2394
  ]),
2370
- _.value.editing ? E("", !0) : (r(), A(e(ct), {
2395
+ _.value.editing ? E("", !0) : (r(), W(e(dt), {
2371
2396
  key: 0,
2372
2397
  type: "info",
2373
2398
  variant: "soft",
2374
2399
  description: e(i)("page.editing-off")
2375
2400
  }, null, 8, ["description"])),
2376
- b.value ? (r(), A(e(We), {
2401
+ h.value || n.value.length > 0 ? (r(), W(e(ve), {
2377
2402
  key: 1,
2378
- rows: 4
2379
- })) : n.value.length === 0 ? (r(), A(e(mt), {
2380
- key: 2,
2403
+ modelValue: p.value,
2404
+ "onUpdate:modelValue": M[0] || (M[0] = (N) => p.value = N),
2405
+ class: "wx-blocks-page__search",
2406
+ placeholder: e(i)("page.search"),
2407
+ clearable: ""
2408
+ }, null, 8, ["modelValue", "placeholder"])) : E("", !0),
2409
+ h.value ? (r(), W(e(pe), { key: 2 }, {
2410
+ template: c(() => [
2411
+ x("div", En, [
2412
+ (r(), V(j, null, Y(4, (N) => x("div", {
2413
+ key: N,
2414
+ class: "wx-blocks-page__ghost"
2415
+ }, [
2416
+ u(e(Ae), {
2417
+ variant: "image",
2418
+ height: 120,
2419
+ class: "wx-blocks-page__ghost-thumb"
2420
+ }),
2421
+ x("div", Un, [
2422
+ u(e(Ae), {
2423
+ variant: "title",
2424
+ width: "45%"
2425
+ }),
2426
+ u(e(Ae), {
2427
+ variant: "text",
2428
+ width: "70%"
2429
+ }),
2430
+ u(e(Ae), {
2431
+ variant: "button",
2432
+ width: "64px",
2433
+ height: "22px"
2434
+ })
2435
+ ])
2436
+ ])), 64))
2437
+ ])
2438
+ ]),
2439
+ _: 1
2440
+ })) : n.value.length === 0 ? (r(), W(e(vt), {
2441
+ key: 3,
2381
2442
  icon: "grid",
2382
2443
  title: e(i)("page.empty"),
2383
2444
  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,
2445
+ }, null, 8, ["title", "description"])) : (r(!0), V(j, { key: 4 }, Y(y.value, (N) => (r(), V("section", {
2446
+ key: N.id,
2386
2447
  class: "wx-blocks-page__group"
2387
2448
  }, [
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
2449
+ N.label ? (r(), V("div", In, f(N.label), 1)) : E("", !0),
2450
+ x("div", Nn, [
2451
+ (r(!0), V(j, null, Y(N.blocks, (I) => (r(), W(Tn, {
2452
+ key: I.id,
2453
+ block: I,
2454
+ onOpen: d
2394
2455
  }, null, 8, ["block"]))), 128))
2395
2456
  ])
2396
2457
  ]))), 128))
2397
2458
  ]));
2398
2459
  }
2399
- }), In = /* @__PURE__ */ Z(Nn, [["__scopeId", "data-v-2dffcfb4"]]);
2400
- function qn(t = {}) {
2460
+ }), Mn = /* @__PURE__ */ Z(Ln, [["__scopeId", "data-v-6e58b664"]]);
2461
+ function Kn(t = {}) {
2401
2462
  const l = t.path ?? "/blocks";
2402
2463
  return {
2403
2464
  id: "blocks",
2404
2465
  path: l,
2405
2466
  routes: [
2406
- { path: l, name: "webx.blocks", component: In, props: { base: l } },
2467
+ { path: l, name: "webx.blocks", component: Mn, props: { base: l } },
2407
2468
  {
2408
2469
  path: `${l}/:id(\\d+)`,
2409
2470
  name: "webx.blocks.edit",
2410
- component: Nl,
2471
+ component: Ll,
2411
2472
  props: { base: l }
2412
2473
  }
2413
2474
  ],
@@ -2416,7 +2477,7 @@ function qn(t = {}) {
2416
2477
  // draws its children through the renderer; it needs the node for `props.allow` alone.
2417
2478
  types: {
2418
2479
  "wx-blocks": {
2419
- component: wn,
2480
+ component: _n,
2420
2481
  kind: "field",
2421
2482
  nested: !0,
2422
2483
  bind: () => ({ blocksPath: l })
@@ -2425,37 +2486,37 @@ function qn(t = {}) {
2425
2486
  };
2426
2487
  }
2427
2488
  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,
2489
+ Ll as WxBlockEditorPage,
2490
+ Kl as WxBlockPicker,
2491
+ al as WxBlockStage,
2492
+ Ct as WxBlockThumb,
2493
+ _n as WxBlocks,
2494
+ Mn as WxBlocksPage,
2495
+ Kn as blocks,
2496
+ dl as blocksMessages,
2497
+ Ke as blocksPreviewKey,
2498
+ $t as cloneNode,
2499
+ ol as countType,
2500
+ he as createBlocksApi,
2501
+ gt as findRange,
2502
+ Je as formSchema,
2503
+ De as highlightBlock,
2504
+ nt as insertNode,
2505
+ yt as isNode,
2506
+ Fe as isNodeList,
2507
+ fl as lintBlock,
2447
2508
  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
2509
+ sl as makeNode,
2510
+ wt as newKey,
2511
+ qn as provideBlocksPreview,
2512
+ rl as removeNode,
2513
+ Yt as replaceBlock,
2514
+ cl as replaceList,
2515
+ kt as stageDocument,
2516
+ Fn as typesIn,
2517
+ ml as undeclared,
2518
+ ul as updateValues,
2519
+ Jn as useBlocksPreview,
2520
+ qe as walk
2460
2521
  };
2461
2522
  //# sourceMappingURL=index.js.map