@webx-ui/module-blocks 0.6.2 → 0.6.3

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