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