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