@webx-ui/module-pages 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +222 -233
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { inject as Ae, provide as Ie, defineComponent as F, ref as
|
|
1
|
+
import { inject as Ae, provide as Ie, defineComponent as F, ref as _, computed as W, openBlock as f, createBlock as C, unref as e, withCtx as i, createElementVNode as K, createElementBlock as N, createVNode as v, createTextVNode as $, toDisplayString as x, createCommentVNode as I, watch as ae, onMounted as ce, onBeforeUnmount as Ue, Fragment as Z, renderList as Ce, normalizeClass as Re, useModel as Le, mergeModels as Oe, useTemplateRef as Ke, nextTick as Fe, isRef as Me, withKeys as Pe, withModifiers as He } from "vue";
|
|
2
2
|
import { useRouter as _e, useRoute as je, onBeforeRouteLeave as Ge } from "vue-router";
|
|
3
|
-
import { useAdmin as Q, useTranslate as H, useErrorText as ie, WxScreenHead as Je, WxScreen as Qe, WxDate as be, WxRowMenu as
|
|
4
|
-
import { WxCard as
|
|
5
|
-
import { provideBlocksPreview as
|
|
3
|
+
import { useAdmin as Q, useTranslate as H, useErrorText as ie, WxScreenHead as Je, WxScreen as Qe, WxSaveState as Xe, WxDate as be, WxRowMenu as Ye, rowMenuWidth as Ze, WxListScreen as qe } from "@webx-ui/module-admin";
|
|
4
|
+
import { WxCard as et, WxText as U, WxButton as R, confirm as L, toast as V, useLocales as Se, localizedValue as tt, WxSkeleton as ye, WxBadge as xe, WxBreadcrumb as at, WxBreadcrumbItem as fe, WxAlert as ke, WxActionBar as lt, WxEmpty as st, WxTreeSelect as nt, WxFormItem as ne, useModal as Be, WxDialog as De, WxInput as We, WxSpace as we, createModal as Ve, WxTable as it } from "@webx-ui/core";
|
|
5
|
+
import { provideBlocksPreview as ot } from "@webx-ui/module-blocks";
|
|
6
6
|
function q(u) {
|
|
7
|
-
const o = `${u.apiPath}/pages`, g = (
|
|
7
|
+
const o = `${u.apiPath}/pages`, g = (a) => a.data;
|
|
8
8
|
return {
|
|
9
|
-
list: (
|
|
9
|
+
list: (a = {}) => {
|
|
10
10
|
const s = new URLSearchParams();
|
|
11
|
-
|
|
11
|
+
a.parent != null && s.set("parent", String(a.parent)), a.search && s.set("search", a.search), a.status && s.set("status", a.status), a.trashed && s.set("trashed", "1"), a.flat && s.set("flat", "1");
|
|
12
12
|
const t = s.size > 0 ? `?${s}` : "";
|
|
13
13
|
return u.http.get(`${o}${t}`).then(g);
|
|
14
14
|
},
|
|
15
|
-
get: (
|
|
16
|
-
create: (
|
|
17
|
-
save: (
|
|
18
|
-
move: (
|
|
19
|
-
duplicate: (
|
|
20
|
-
publish: (
|
|
21
|
-
unpublish: (
|
|
22
|
-
remove: (
|
|
23
|
-
restore: (
|
|
24
|
-
versions: (
|
|
25
|
-
restoreVersion: (
|
|
15
|
+
get: (a) => u.http.get(`${o}/${a}`).then(g),
|
|
16
|
+
create: (a) => u.http.post(o, a).then(g),
|
|
17
|
+
save: (a, s) => u.http.put(`${o}/${a}`, s).then(g),
|
|
18
|
+
move: (a, s, t) => u.http.post(`${o}/${a}/move`, { target: s, zone: t }).then(g),
|
|
19
|
+
duplicate: (a) => u.http.post(`${o}/${a}/duplicate`, {}).then(g),
|
|
20
|
+
publish: (a) => u.http.post(`${o}/${a}/publish`, {}).then(g),
|
|
21
|
+
unpublish: (a) => u.http.post(`${o}/${a}/unpublish`, {}).then(g),
|
|
22
|
+
remove: (a) => u.http.delete(`${o}/${a}`).then((s) => s.data.trashed),
|
|
23
|
+
restore: (a) => u.http.post(`${o}/${a}/restore`, {}).then((s) => s.data.restored),
|
|
24
|
+
versions: (a) => u.http.get(`${o}/${a}/versions`).then(g),
|
|
25
|
+
restoreVersion: (a, s) => u.http.post(`${o}/${a}/versions/${s}/restore`, {}).then(g)
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
const Ne = /* @__PURE__ */ Symbol("wx-page-editor");
|
|
29
|
-
function
|
|
29
|
+
function rt(u) {
|
|
30
30
|
Ie(Ne, u);
|
|
31
31
|
}
|
|
32
32
|
function Te() {
|
|
33
33
|
return Ae(Ne, null);
|
|
34
34
|
}
|
|
35
|
-
const
|
|
35
|
+
const ut = {
|
|
36
36
|
module: {
|
|
37
37
|
title: "Pages"
|
|
38
38
|
},
|
|
@@ -96,9 +96,6 @@ const rt = {
|
|
|
96
96
|
// The editor.
|
|
97
97
|
trail: "Where this page sits",
|
|
98
98
|
untitled: "Untitled",
|
|
99
|
-
"state-saved": "Saved",
|
|
100
|
-
"state-saving": "Saving…",
|
|
101
|
-
"state-unsaved": "Not saved yet",
|
|
102
99
|
save: "Save",
|
|
103
100
|
"save-failed": "The page was not saved.",
|
|
104
101
|
publish: "Publish",
|
|
@@ -141,71 +138,71 @@ const rt = {
|
|
|
141
138
|
function j() {
|
|
142
139
|
try {
|
|
143
140
|
const { i18n: u } = Q();
|
|
144
|
-
ze.has(u) || (u.defaults("webx-pages",
|
|
141
|
+
ze.has(u) || (u.defaults("webx-pages", ut), ze.add(u));
|
|
145
142
|
} catch {
|
|
146
143
|
}
|
|
147
144
|
}
|
|
148
|
-
const
|
|
145
|
+
const dt = { class: "wx-page-danger" }, ct = {
|
|
149
146
|
key: 0,
|
|
150
147
|
class: "wx-page-danger__row"
|
|
151
|
-
},
|
|
148
|
+
}, pt = { class: "wx-page-danger__what" }, gt = { class: "wx-page-danger__row" }, vt = { class: "wx-page-danger__what" }, ht = /* @__PURE__ */ F({
|
|
152
149
|
name: "WxPageDanger",
|
|
153
150
|
__name: "PageDanger",
|
|
154
151
|
setup(u) {
|
|
155
|
-
const o = Q(), g = q(o),
|
|
152
|
+
const o = Q(), g = q(o), a = _e(), s = Te();
|
|
156
153
|
j();
|
|
157
|
-
const t = H("webx-pages"), d = ie(),
|
|
154
|
+
const t = H("webx-pages"), d = ie(), l = _(!1), c = W(() => s?.page.value ?? null), h = W(() => o.can("pages.manage"));
|
|
158
155
|
async function r() {
|
|
159
|
-
const
|
|
160
|
-
if (!(!
|
|
161
|
-
title: t("page.unpublish-title", { title:
|
|
156
|
+
const w = c.value;
|
|
157
|
+
if (!(!w || !await L({
|
|
158
|
+
title: t("page.unpublish-title", { title: w.title }),
|
|
162
159
|
message: t("page.unpublish-text"),
|
|
163
160
|
confirmText: t("page.unpublish"),
|
|
164
161
|
cancelText: t("page.cancel"),
|
|
165
162
|
tone: "danger"
|
|
166
163
|
}))) {
|
|
167
|
-
|
|
164
|
+
l.value = !0;
|
|
168
165
|
try {
|
|
169
|
-
await g.unpublish(
|
|
166
|
+
await g.unpublish(w.id), await s?.reload(), V.success(t("page.unpublished"));
|
|
170
167
|
} catch (b) {
|
|
171
168
|
V.danger(d(b));
|
|
172
169
|
} finally {
|
|
173
|
-
|
|
170
|
+
l.value = !1;
|
|
174
171
|
}
|
|
175
172
|
}
|
|
176
173
|
}
|
|
177
174
|
async function k() {
|
|
178
|
-
const
|
|
179
|
-
if (!(!
|
|
180
|
-
title: t("page.delete-title", { title:
|
|
175
|
+
const w = c.value;
|
|
176
|
+
if (!(!w || !await L({
|
|
177
|
+
title: t("page.delete-title", { title: w.title }),
|
|
181
178
|
// The whole branch, not the level under it (§7): a catalogue with two sections and forty
|
|
182
179
|
// products is forty-two pages leaving the site at once.
|
|
183
|
-
message:
|
|
180
|
+
message: w.descendants_count > 0 ? `${t("page.delete-text")} ${t("page.delete-branch", { count: w.descendants_count })}` : t("page.delete-text"),
|
|
184
181
|
confirmText: t("page.delete"),
|
|
185
182
|
cancelText: t("page.cancel"),
|
|
186
183
|
tone: "danger"
|
|
187
184
|
}))) {
|
|
188
|
-
|
|
185
|
+
l.value = !0;
|
|
189
186
|
try {
|
|
190
|
-
await g.remove(
|
|
187
|
+
await g.remove(w.id), V.success(t("page.deleted")), a.push(s?.base ?? "/pages");
|
|
191
188
|
} catch (b) {
|
|
192
189
|
V.danger(d(b));
|
|
193
190
|
} finally {
|
|
194
|
-
|
|
191
|
+
l.value = !1;
|
|
195
192
|
}
|
|
196
193
|
}
|
|
197
194
|
}
|
|
198
|
-
return (
|
|
195
|
+
return (w, z) => c.value && h.value ? (f(), C(e(et), {
|
|
199
196
|
key: 0,
|
|
200
197
|
title: e(t)("page.danger")
|
|
201
198
|
}, {
|
|
202
199
|
default: i(() => [
|
|
203
|
-
K("div",
|
|
204
|
-
c.value.status !== "draft" ? (f(), N("div",
|
|
205
|
-
K("div",
|
|
200
|
+
K("div", dt, [
|
|
201
|
+
c.value.status !== "draft" ? (f(), N("div", ct, [
|
|
202
|
+
K("div", pt, [
|
|
206
203
|
v(e(U), { weight: "medium" }, {
|
|
207
204
|
default: i(() => [
|
|
208
|
-
$(
|
|
205
|
+
$(x(e(t)("page.unpublish")), 1)
|
|
209
206
|
]),
|
|
210
207
|
_: 1
|
|
211
208
|
}),
|
|
@@ -214,27 +211,27 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
214
211
|
tone: "muted"
|
|
215
212
|
}, {
|
|
216
213
|
default: i(() => [
|
|
217
|
-
$(
|
|
214
|
+
$(x(e(t)("page.unpublish-help")), 1)
|
|
218
215
|
]),
|
|
219
216
|
_: 1
|
|
220
217
|
})
|
|
221
218
|
]),
|
|
222
219
|
v(e(R), {
|
|
223
220
|
variant: "outline",
|
|
224
|
-
loading:
|
|
221
|
+
loading: l.value,
|
|
225
222
|
onClick: r
|
|
226
223
|
}, {
|
|
227
224
|
default: i(() => [
|
|
228
|
-
$(
|
|
225
|
+
$(x(e(t)("page.unpublish")), 1)
|
|
229
226
|
]),
|
|
230
227
|
_: 1
|
|
231
228
|
}, 8, ["loading"])
|
|
232
229
|
])) : I("", !0),
|
|
233
|
-
K("div",
|
|
234
|
-
K("div",
|
|
230
|
+
K("div", gt, [
|
|
231
|
+
K("div", vt, [
|
|
235
232
|
v(e(U), { weight: "medium" }, {
|
|
236
233
|
default: i(() => [
|
|
237
|
-
$(
|
|
234
|
+
$(x(e(t)("page.delete")), 1)
|
|
238
235
|
]),
|
|
239
236
|
_: 1
|
|
240
237
|
}),
|
|
@@ -243,7 +240,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
243
240
|
tone: "muted"
|
|
244
241
|
}, {
|
|
245
242
|
default: i(() => [
|
|
246
|
-
$(
|
|
243
|
+
$(x(c.value.can.delete ? e(t)("page.delete-help") : e(t)("page.delete-home")), 1)
|
|
247
244
|
]),
|
|
248
245
|
_: 1
|
|
249
246
|
})
|
|
@@ -252,11 +249,11 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
252
249
|
type: "danger",
|
|
253
250
|
variant: "outline",
|
|
254
251
|
disabled: !c.value.can.delete,
|
|
255
|
-
loading:
|
|
252
|
+
loading: l.value,
|
|
256
253
|
onClick: k
|
|
257
254
|
}, {
|
|
258
255
|
default: i(() => [
|
|
259
|
-
$(
|
|
256
|
+
$(x(e(t)("page.delete")), 1)
|
|
260
257
|
]),
|
|
261
258
|
_: 1
|
|
262
259
|
}, 8, ["disabled", "loading"])
|
|
@@ -268,30 +265,30 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
268
265
|
}
|
|
269
266
|
}), oe = (u, o) => {
|
|
270
267
|
const g = u.__vccOpts || u;
|
|
271
|
-
for (const [
|
|
272
|
-
g[
|
|
268
|
+
for (const [a, s] of o)
|
|
269
|
+
g[a] = s;
|
|
273
270
|
return g;
|
|
274
|
-
},
|
|
271
|
+
}, mt = /* @__PURE__ */ oe(ht, [["__scopeId", "data-v-d4a9083f"]]), ft = { class: "wx-page-editor__screen" }, bt = 1200, yt = /* @__PURE__ */ F({
|
|
275
272
|
__name: "PageEditorPage",
|
|
276
273
|
props: {
|
|
277
274
|
base: { default: "/pages" }
|
|
278
275
|
},
|
|
279
276
|
setup(u) {
|
|
280
|
-
const o = u, g = Q(),
|
|
277
|
+
const o = u, g = Q(), a = q(g), s = je(), t = _e(), d = Se();
|
|
281
278
|
j();
|
|
282
|
-
const
|
|
283
|
-
const y =
|
|
284
|
-
return
|
|
279
|
+
const l = H("webx-pages"), c = ie(), h = W(() => Number(s.params.id)), r = _(null), k = _([]), w = _({}), z = _(""), b = _(null), p = _({}), M = _(!0), P = _(!1), B = _(!1), le = _({}), A = _(null), ee = _(""), re = _(0), S = W(() => g.can("pages.manage")), te = W(() => JSON.stringify(w.value)), E = W(() => ee.value !== "" && te.value !== ee.value), ue = W(() => P.value ? "saving" : E.value ? "unsaved" : "saved"), de = W(() => {
|
|
280
|
+
const y = w.value.title;
|
|
281
|
+
return tt(y, d.active.value, r.value?.title ?? "");
|
|
285
282
|
}), pe = W(
|
|
286
283
|
() => k.value.map((y) => ({
|
|
287
284
|
id: y.id,
|
|
288
|
-
label: y.is_home ?
|
|
285
|
+
label: y.is_home ? l("pages.home") : y.title
|
|
289
286
|
}))
|
|
290
287
|
);
|
|
291
|
-
|
|
288
|
+
ot({ url: W(() => b.value), reload: re }), rt({
|
|
292
289
|
page: r,
|
|
293
290
|
ancestors: k,
|
|
294
|
-
values:
|
|
291
|
+
values: w,
|
|
295
292
|
prefixes: p,
|
|
296
293
|
base: o.base,
|
|
297
294
|
canManage: S.value,
|
|
@@ -299,12 +296,12 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
299
296
|
save: () => O()
|
|
300
297
|
});
|
|
301
298
|
function ge(y) {
|
|
302
|
-
r.value = y.page, k.value = y.ancestors,
|
|
299
|
+
r.value = y.page, k.value = y.ancestors, w.value = y.values, z.value = y.revision, b.value = y.preview_url, p.value = y.address_prefix, ee.value = JSON.stringify(y.values), A.value = null;
|
|
303
300
|
}
|
|
304
301
|
async function G(y = !1) {
|
|
305
302
|
y || (M.value = !0);
|
|
306
303
|
try {
|
|
307
|
-
ge(await
|
|
304
|
+
ge(await a.get(h.value));
|
|
308
305
|
} catch (Y) {
|
|
309
306
|
V.danger(c(Y)), t.push(o.base);
|
|
310
307
|
} finally {
|
|
@@ -315,7 +312,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
315
312
|
function ve() {
|
|
316
313
|
!S.value || A.value || !E.value || (clearTimeout(X), X = setTimeout(() => {
|
|
317
314
|
O();
|
|
318
|
-
},
|
|
315
|
+
}, bt));
|
|
319
316
|
}
|
|
320
317
|
function he() {
|
|
321
318
|
!S.value || A.value || !E.value || P.value || (clearTimeout(X), O());
|
|
@@ -323,24 +320,24 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
323
320
|
async function O() {
|
|
324
321
|
if (!r.value || P.value || !S.value) return;
|
|
325
322
|
clearTimeout(X);
|
|
326
|
-
const y = te.value, Y =
|
|
323
|
+
const y = te.value, Y = w.value;
|
|
327
324
|
P.value = !0, le.value = {};
|
|
328
325
|
try {
|
|
329
|
-
const D = await
|
|
326
|
+
const D = await a.save(r.value.id, { values: Y, revision: z.value });
|
|
330
327
|
r.value = D.page, k.value = D.ancestors, z.value = D.revision, b.value = D.preview_url, p.value = D.address_prefix, A.value = null, te.value === y && (ee.value = y), re.value += 1;
|
|
331
328
|
} catch (D) {
|
|
332
329
|
const se = D;
|
|
333
|
-
se.status === 409 && se.body?.data ? A.value = se.body : se.body?.errors ? (le.value = se.body.errors, V.danger(
|
|
330
|
+
se.status === 409 && se.body?.data ? A.value = se.body : se.body?.errors ? (le.value = se.body.errors, V.danger(l("page.save-failed"))) : V.danger(c(D));
|
|
334
331
|
} finally {
|
|
335
332
|
P.value = !1;
|
|
336
333
|
}
|
|
337
334
|
}
|
|
338
335
|
async function me() {
|
|
339
336
|
await L({
|
|
340
|
-
title:
|
|
341
|
-
message:
|
|
342
|
-
confirmText:
|
|
343
|
-
cancelText:
|
|
337
|
+
title: l("page.conflict-theirs-title"),
|
|
338
|
+
message: l("page.conflict-theirs-text"),
|
|
339
|
+
confirmText: l("page.conflict-theirs"),
|
|
340
|
+
cancelText: l("page.cancel"),
|
|
344
341
|
tone: "danger"
|
|
345
342
|
}) && await G(!0);
|
|
346
343
|
}
|
|
@@ -352,14 +349,14 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
352
349
|
if (!r.value) return;
|
|
353
350
|
const y = r.value.path === null ? null : `/${r.value.path}`;
|
|
354
351
|
if (await L({
|
|
355
|
-
title:
|
|
356
|
-
message: y === null ?
|
|
357
|
-
confirmText:
|
|
358
|
-
cancelText:
|
|
352
|
+
title: l("page.publish-title", { title: r.value.title }),
|
|
353
|
+
message: y === null ? l("page.publish-text-nowhere") : l("page.publish-text", { address: y }),
|
|
354
|
+
confirmText: l("page.publish"),
|
|
355
|
+
cancelText: l("page.cancel")
|
|
359
356
|
}) && (E.value && await O(), !A.value)) {
|
|
360
357
|
B.value = !0;
|
|
361
358
|
try {
|
|
362
|
-
await
|
|
359
|
+
await a.publish(r.value.id), await G(!0), V.success(l("page.published"));
|
|
363
360
|
} catch (D) {
|
|
364
361
|
V.danger(c(D));
|
|
365
362
|
} finally {
|
|
@@ -380,15 +377,15 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
380
377
|
}), Ue(() => {
|
|
381
378
|
clearTimeout(X), window.removeEventListener("beforeunload", J);
|
|
382
379
|
}), Ge(async () => !E.value || !S.value || (await O(), !E.value) ? !0 : await L({
|
|
383
|
-
title:
|
|
384
|
-
message:
|
|
385
|
-
confirmText:
|
|
386
|
-
cancelText:
|
|
380
|
+
title: l("page.leave-title"),
|
|
381
|
+
message: l("page.leave-text"),
|
|
382
|
+
confirmText: l("page.leave"),
|
|
383
|
+
cancelText: l("page.cancel"),
|
|
387
384
|
tone: "danger"
|
|
388
385
|
}));
|
|
389
386
|
const Ee = W(() => {
|
|
390
387
|
const y = [];
|
|
391
|
-
return b.value && y.push({ key: "preview", label:
|
|
388
|
+
return b.value && y.push({ key: "preview", label: l("page.preview"), icon: "eye", href: b.value }), r.value?.url && r.value.status !== "draft" && y.push({ key: "site", label: l("page.open-on-site"), icon: "link", href: r.value.url }), y;
|
|
392
389
|
});
|
|
393
390
|
return (y, Y) => (f(), N("div", {
|
|
394
391
|
class: "wx-page-editor",
|
|
@@ -405,14 +402,14 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
405
402
|
v(e(Je), {
|
|
406
403
|
divider: "",
|
|
407
404
|
back: u.base,
|
|
408
|
-
"back-label": e(
|
|
409
|
-
title: r.value.is_home ? e(
|
|
405
|
+
"back-label": e(l)("module.title"),
|
|
406
|
+
title: r.value.is_home ? e(l)("pages.home") : de.value || e(l)("page.untitled"),
|
|
410
407
|
actions: Ee.value
|
|
411
408
|
}, {
|
|
412
409
|
trail: i(() => [
|
|
413
|
-
v(e(
|
|
410
|
+
v(e(at), {
|
|
414
411
|
size: "sm",
|
|
415
|
-
label: e(
|
|
412
|
+
label: e(l)("page.trail")
|
|
416
413
|
}, {
|
|
417
414
|
default: i(() => [
|
|
418
415
|
v(e(fe), {
|
|
@@ -420,7 +417,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
420
417
|
to: u.base
|
|
421
418
|
}, {
|
|
422
419
|
default: i(() => [
|
|
423
|
-
$(
|
|
420
|
+
$(x(e(l)("module.title")), 1)
|
|
424
421
|
]),
|
|
425
422
|
_: 1
|
|
426
423
|
}, 8, ["to"]),
|
|
@@ -430,13 +427,13 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
430
427
|
to: `${u.base}/${D.id}`
|
|
431
428
|
}, {
|
|
432
429
|
default: i(() => [
|
|
433
|
-
$(
|
|
430
|
+
$(x(D.label), 1)
|
|
434
431
|
]),
|
|
435
432
|
_: 2
|
|
436
433
|
}, 1032, ["to"]))), 128)),
|
|
437
434
|
v(e(fe), { current: "" }, {
|
|
438
435
|
default: i(() => [
|
|
439
|
-
$(
|
|
436
|
+
$(x(r.value.is_home ? e(l)("pages.home") : de.value), 1)
|
|
440
437
|
]),
|
|
441
438
|
_: 1
|
|
442
439
|
})
|
|
@@ -450,7 +447,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
450
447
|
dot: ""
|
|
451
448
|
}, {
|
|
452
449
|
default: i(() => [
|
|
453
|
-
$(
|
|
450
|
+
$(x(e(l)(`page.status-${r.value.status}`)), 1)
|
|
454
451
|
]),
|
|
455
452
|
_: 1
|
|
456
453
|
}, 8, ["type"])
|
|
@@ -460,7 +457,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
460
457
|
A.value ? (f(), C(e(ke), {
|
|
461
458
|
key: 0,
|
|
462
459
|
type: "warning",
|
|
463
|
-
title: e(
|
|
460
|
+
title: e(l)("page.conflict-title"),
|
|
464
461
|
description: A.value.message
|
|
465
462
|
}, {
|
|
466
463
|
actions: i(() => [
|
|
@@ -470,7 +467,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
470
467
|
onClick: me
|
|
471
468
|
}, {
|
|
472
469
|
default: i(() => [
|
|
473
|
-
$(
|
|
470
|
+
$(x(e(l)("page.conflict-theirs")), 1)
|
|
474
471
|
]),
|
|
475
472
|
_: 1
|
|
476
473
|
}),
|
|
@@ -480,33 +477,25 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
480
477
|
onClick: n
|
|
481
478
|
}, {
|
|
482
479
|
default: i(() => [
|
|
483
|
-
$(
|
|
480
|
+
$(x(e(l)("page.conflict-mine")), 1)
|
|
484
481
|
]),
|
|
485
482
|
_: 1
|
|
486
483
|
})
|
|
487
484
|
]),
|
|
488
485
|
_: 1
|
|
489
486
|
}, 8, ["title", "description"])) : I("", !0),
|
|
490
|
-
K("div",
|
|
487
|
+
K("div", ft, [
|
|
491
488
|
v(e(Qe), {
|
|
492
|
-
modelValue:
|
|
493
|
-
"onUpdate:modelValue": Y[0] || (Y[0] = (D) =>
|
|
489
|
+
modelValue: w.value,
|
|
490
|
+
"onUpdate:modelValue": Y[0] || (Y[0] = (D) => w.value = D),
|
|
494
491
|
name: "pages.form",
|
|
495
492
|
errors: le.value,
|
|
496
493
|
disabled: !S.value || B.value
|
|
497
494
|
}, null, 8, ["modelValue", "errors", "disabled"])
|
|
498
495
|
]),
|
|
499
|
-
S.value ? (f(), C(e(
|
|
496
|
+
S.value ? (f(), C(e(lt), { key: 1 }, {
|
|
500
497
|
state: i(() => [
|
|
501
|
-
v(e(
|
|
502
|
-
size: "sm",
|
|
503
|
-
tone: "muted"
|
|
504
|
-
}, {
|
|
505
|
-
default: i(() => [
|
|
506
|
-
$(w(e(a)(`page.state-${ue.value}`)), 1)
|
|
507
|
-
]),
|
|
508
|
-
_: 1
|
|
509
|
-
})
|
|
498
|
+
v(e(Xe), { state: ue.value }, null, 8, ["state"])
|
|
510
499
|
]),
|
|
511
500
|
default: i(() => [
|
|
512
501
|
v(e(R), {
|
|
@@ -516,7 +505,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
516
505
|
onClick: O
|
|
517
506
|
}, {
|
|
518
507
|
default: i(() => [
|
|
519
|
-
$(
|
|
508
|
+
$(x(e(l)("page.save")), 1)
|
|
520
509
|
]),
|
|
521
510
|
_: 1
|
|
522
511
|
}, 8, ["loading", "disabled"]),
|
|
@@ -527,7 +516,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
527
516
|
onClick: T
|
|
528
517
|
}, {
|
|
529
518
|
default: i(() => [
|
|
530
|
-
$(
|
|
519
|
+
$(x(e(l)("page.publish")), 1)
|
|
531
520
|
]),
|
|
532
521
|
_: 1
|
|
533
522
|
}, 8, ["loading", "disabled"])
|
|
@@ -537,13 +526,13 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
537
526
|
], 64))
|
|
538
527
|
], 32));
|
|
539
528
|
}
|
|
540
|
-
}),
|
|
529
|
+
}), wt = /* @__PURE__ */ oe(yt, [["__scopeId", "data-v-653d5926"]]), _t = { class: "wx-page-history" }, xt = { class: "wx-page-history__number" }, kt = { class: "wx-page-history__who" }, Tt = /* @__PURE__ */ F({
|
|
541
530
|
name: "WxPageHistory",
|
|
542
531
|
__name: "PageHistory",
|
|
543
532
|
setup(u) {
|
|
544
|
-
const o = Q(), g = q(o),
|
|
533
|
+
const o = Q(), g = q(o), a = Te();
|
|
545
534
|
j();
|
|
546
|
-
const s = H("webx-pages"), t = ie(), d =
|
|
535
|
+
const s = H("webx-pages"), t = ie(), d = _(null), l = _(!1), c = W(() => a?.page.value ?? null), h = W(() => o.can("pages.manage")), r = W(
|
|
547
536
|
() => c.value?.published_at ? d.value?.[0]?.number ?? null : null
|
|
548
537
|
);
|
|
549
538
|
async function k() {
|
|
@@ -555,7 +544,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
555
544
|
d.value = [], V.danger(t(b));
|
|
556
545
|
}
|
|
557
546
|
}
|
|
558
|
-
async function
|
|
547
|
+
async function w(z) {
|
|
559
548
|
const b = c.value;
|
|
560
549
|
if (!(!b || !await L({
|
|
561
550
|
title: s("page.restore-title", { number: z.number }),
|
|
@@ -563,13 +552,13 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
563
552
|
confirmText: s("page.restore"),
|
|
564
553
|
cancelText: s("page.cancel")
|
|
565
554
|
}))) {
|
|
566
|
-
|
|
555
|
+
l.value = !0;
|
|
567
556
|
try {
|
|
568
|
-
await g.restoreVersion(b.id, z.number), await
|
|
557
|
+
await g.restoreVersion(b.id, z.number), await a?.reload(), V.success(s("page.restored-version", { number: z.number }));
|
|
569
558
|
} catch (M) {
|
|
570
559
|
V.danger(t(M));
|
|
571
560
|
} finally {
|
|
572
|
-
|
|
561
|
+
l.value = !1;
|
|
573
562
|
}
|
|
574
563
|
}
|
|
575
564
|
}
|
|
@@ -581,20 +570,20 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
581
570
|
{
|
|
582
571
|
immediate: !0
|
|
583
572
|
}
|
|
584
|
-
), (z, b) => (f(), N("div",
|
|
573
|
+
), (z, b) => (f(), N("div", _t, [
|
|
585
574
|
d.value === null ? (f(), C(e(ye), {
|
|
586
575
|
key: 0,
|
|
587
576
|
class: "wx-page-history__ghost",
|
|
588
577
|
rows: 3
|
|
589
|
-
})) : d.value.length === 0 ? (f(), C(e(
|
|
578
|
+
})) : d.value.length === 0 ? (f(), C(e(st), {
|
|
590
579
|
key: 1,
|
|
591
580
|
description: e(s)("page.history-empty")
|
|
592
581
|
}, null, 8, ["description"])) : (f(!0), N(Z, { key: 2 }, Ce(d.value, (p) => (f(), N("div", {
|
|
593
582
|
key: p.number,
|
|
594
583
|
class: Re(["wx-page-history__row", { "is-live": p.number === r.value }])
|
|
595
584
|
}, [
|
|
596
|
-
K("code",
|
|
597
|
-
K("div",
|
|
585
|
+
K("code", xt, x(e(s)("page.version", { number: p.number })), 1),
|
|
586
|
+
K("div", kt, [
|
|
598
587
|
p.created_at ? (f(), C(e(be), {
|
|
599
588
|
key: 0,
|
|
600
589
|
value: p.created_at,
|
|
@@ -606,9 +595,9 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
606
595
|
tone: "muted"
|
|
607
596
|
}, {
|
|
608
597
|
default: i(() => [
|
|
609
|
-
$(
|
|
598
|
+
$(x(p.author ?? e(s)(`page.source-${p.source}`)) + " ", 1),
|
|
610
599
|
p.comment ? (f(), N(Z, { key: 0 }, [
|
|
611
|
-
$(" · " +
|
|
600
|
+
$(" · " + x(p.comment), 1)
|
|
612
601
|
], 64)) : I("", !0)
|
|
613
602
|
]),
|
|
614
603
|
_: 2
|
|
@@ -620,7 +609,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
620
609
|
dot: ""
|
|
621
610
|
}, {
|
|
622
611
|
default: i(() => [
|
|
623
|
-
$(
|
|
612
|
+
$(x(e(s)("page.version-live")), 1)
|
|
624
613
|
]),
|
|
625
614
|
_: 1
|
|
626
615
|
})) : I("", !0),
|
|
@@ -628,18 +617,18 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
628
617
|
key: 1,
|
|
629
618
|
size: "sm",
|
|
630
619
|
variant: "outline",
|
|
631
|
-
loading:
|
|
632
|
-
onClick: (M) =>
|
|
620
|
+
loading: l.value,
|
|
621
|
+
onClick: (M) => w(p)
|
|
633
622
|
}, {
|
|
634
623
|
default: i(() => [
|
|
635
|
-
$(
|
|
624
|
+
$(x(e(s)("page.restore")), 1)
|
|
636
625
|
]),
|
|
637
626
|
_: 1
|
|
638
627
|
}, 8, ["loading", "onClick"])) : I("", !0)
|
|
639
628
|
], 2))), 128))
|
|
640
629
|
]));
|
|
641
630
|
}
|
|
642
|
-
}),
|
|
631
|
+
}), $t = /* @__PURE__ */ oe(Tt, [["__scopeId", "data-v-41bcd106"]]), $e = /* @__PURE__ */ F({
|
|
643
632
|
__name: "PagePicker",
|
|
644
633
|
props: /* @__PURE__ */ Oe({
|
|
645
634
|
exclude: { default: () => [] },
|
|
@@ -651,19 +640,19 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
651
640
|
}),
|
|
652
641
|
emits: ["update:modelValue"],
|
|
653
642
|
setup(u) {
|
|
654
|
-
const o = u, g = Le(u, "modelValue"),
|
|
643
|
+
const o = u, g = Le(u, "modelValue"), a = Q(), s = q(a);
|
|
655
644
|
j();
|
|
656
|
-
const t = H("webx-pages"), d =
|
|
645
|
+
const t = H("webx-pages"), d = _([]);
|
|
657
646
|
ce(async () => {
|
|
658
647
|
const h = await s.list();
|
|
659
648
|
h.home && (d.value = [
|
|
660
|
-
|
|
649
|
+
l(
|
|
661
650
|
h.home,
|
|
662
|
-
h.items.map((r) =>
|
|
651
|
+
h.items.map((r) => l(r))
|
|
663
652
|
)
|
|
664
653
|
]);
|
|
665
654
|
});
|
|
666
|
-
function
|
|
655
|
+
function l(h, r) {
|
|
667
656
|
return {
|
|
668
657
|
id: h.id,
|
|
669
658
|
label: h.is_home ? t("pages.home") : h.title,
|
|
@@ -673,9 +662,9 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
673
662
|
};
|
|
674
663
|
}
|
|
675
664
|
async function c(h) {
|
|
676
|
-
return (await s.list({ parent: Number(h.id) })).items.map((k) =>
|
|
665
|
+
return (await s.list({ parent: Number(h.id) })).items.map((k) => l(k));
|
|
677
666
|
}
|
|
678
|
-
return (h, r) => (f(), C(e(
|
|
667
|
+
return (h, r) => (f(), C(e(nt), {
|
|
679
668
|
modelValue: g.value,
|
|
680
669
|
"onUpdate:modelValue": r[0] || (r[0] = (k) => g.value = k),
|
|
681
670
|
nodes: d.value,
|
|
@@ -692,19 +681,19 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
692
681
|
teleport: ""
|
|
693
682
|
}, null, 8, ["modelValue", "nodes", "selected-path", "placeholder", "aria-label"]));
|
|
694
683
|
}
|
|
695
|
-
}),
|
|
684
|
+
}), Pt = {
|
|
696
685
|
key: 0,
|
|
697
686
|
class: "wx-page-place"
|
|
698
|
-
},
|
|
687
|
+
}, Wt = /* @__PURE__ */ F({
|
|
699
688
|
name: "WxPagePlace",
|
|
700
689
|
__name: "PagePlace",
|
|
701
690
|
setup(u) {
|
|
702
|
-
const o = Q(), g = q(o),
|
|
691
|
+
const o = Q(), g = q(o), a = Te(), s = Se();
|
|
703
692
|
j();
|
|
704
|
-
const t = H("webx-pages"), d = ie(),
|
|
705
|
-
const b =
|
|
693
|
+
const t = H("webx-pages"), d = ie(), l = _(!1), c = _(null), h = W(() => a?.page.value ?? null), r = W(() => a?.ancestors.value.length === 0 ? null : a?.prefixes.value[s.active.value] ?? null), k = W(() => {
|
|
694
|
+
const b = a?.values.value.slug;
|
|
706
695
|
return typeof b == "string" ? b : b?.[s.active.value] ?? "";
|
|
707
|
-
}),
|
|
696
|
+
}), w = W(() => h.value?.is_home ? "/" : r.value === null || k.value === "" ? null : `/${[r.value, k.value].filter(Boolean).join("/")}`);
|
|
708
697
|
ae(
|
|
709
698
|
h,
|
|
710
699
|
(b) => {
|
|
@@ -714,7 +703,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
714
703
|
);
|
|
715
704
|
async function z(b) {
|
|
716
705
|
const p = h.value;
|
|
717
|
-
if (!p || b === null || b === p.parent_id ||
|
|
706
|
+
if (!p || b === null || b === p.parent_id || l.value) return;
|
|
718
707
|
const M = p.descendants_count + 1;
|
|
719
708
|
if (M > 1 && !await L({
|
|
720
709
|
title: t("page.move-title", { title: p.title }),
|
|
@@ -725,30 +714,30 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
725
714
|
c.value = p.parent_id;
|
|
726
715
|
return;
|
|
727
716
|
}
|
|
728
|
-
|
|
717
|
+
l.value = !0;
|
|
729
718
|
try {
|
|
730
719
|
const P = await g.move(p.id, b, "inside");
|
|
731
720
|
V.success(
|
|
732
721
|
P.addresses_changed > 1 ? t("page.moved", { count: P.addresses_changed }) : t("page.moved-one")
|
|
733
|
-
), await
|
|
722
|
+
), await a?.reload();
|
|
734
723
|
} catch (P) {
|
|
735
724
|
V.danger(d(P)), c.value = p.parent_id;
|
|
736
725
|
} finally {
|
|
737
|
-
|
|
726
|
+
l.value = !1;
|
|
738
727
|
}
|
|
739
728
|
}
|
|
740
|
-
return (b, p) => h.value ? (f(), N("div",
|
|
729
|
+
return (b, p) => h.value ? (f(), N("div", Pt, [
|
|
741
730
|
v(e(ne), {
|
|
742
731
|
label: e(t)("page.address")
|
|
743
732
|
}, {
|
|
744
733
|
default: i(() => [
|
|
745
|
-
|
|
734
|
+
w.value ? (f(), C(e(U), {
|
|
746
735
|
key: 0,
|
|
747
736
|
mono: "",
|
|
748
737
|
class: "wx-page-place__address"
|
|
749
738
|
}, {
|
|
750
739
|
default: i(() => [
|
|
751
|
-
$(w
|
|
740
|
+
$(x(w.value), 1)
|
|
752
741
|
]),
|
|
753
742
|
_: 1
|
|
754
743
|
})) : (f(), C(e(U), {
|
|
@@ -757,7 +746,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
757
746
|
tone: "muted"
|
|
758
747
|
}, {
|
|
759
748
|
default: i(() => [
|
|
760
|
-
$(
|
|
749
|
+
$(x(e(t)("page.no-address")), 1)
|
|
761
750
|
]),
|
|
762
751
|
_: 1
|
|
763
752
|
}))
|
|
@@ -777,7 +766,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
777
766
|
z
|
|
778
767
|
],
|
|
779
768
|
exclude: [h.value.id],
|
|
780
|
-
selected: e(
|
|
769
|
+
selected: e(a)?.ancestors.value ?? []
|
|
781
770
|
}, null, 8, ["modelValue", "exclude", "selected"])
|
|
782
771
|
]),
|
|
783
772
|
_: 1
|
|
@@ -790,7 +779,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
790
779
|
], 64)) : I("", !0)
|
|
791
780
|
])) : I("", !0);
|
|
792
781
|
}
|
|
793
|
-
}),
|
|
782
|
+
}), Vt = /* @__PURE__ */ oe(Wt, [["__scopeId", "data-v-bf094be2"]]), zt = /* @__PURE__ */ F({
|
|
794
783
|
__name: "PageActions",
|
|
795
784
|
props: {
|
|
796
785
|
page: {},
|
|
@@ -798,7 +787,7 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
798
787
|
},
|
|
799
788
|
emits: ["open", "add", "duplicate", "move", "copy", "remove", "restore"],
|
|
800
789
|
setup(u, { emit: o }) {
|
|
801
|
-
const g = u,
|
|
790
|
+
const g = u, a = o;
|
|
802
791
|
j();
|
|
803
792
|
const s = H("webx-pages"), t = W(() => {
|
|
804
793
|
const d = g.page;
|
|
@@ -808,25 +797,25 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
808
797
|
key: "restore",
|
|
809
798
|
icon: "refresh",
|
|
810
799
|
label: s("page.restore"),
|
|
811
|
-
run: () =>
|
|
800
|
+
run: () => a("restore", d)
|
|
812
801
|
}
|
|
813
802
|
];
|
|
814
|
-
const
|
|
815
|
-
{ key: "open", icon: "edit", label: s("page.open"), run: () =>
|
|
816
|
-
{ key: "add", icon: "plus", label: s("page.add-child"), run: () =>
|
|
803
|
+
const l = [
|
|
804
|
+
{ key: "open", icon: "edit", label: s("page.open"), run: () => a("open", d) },
|
|
805
|
+
{ key: "add", icon: "plus", label: s("page.add-child"), run: () => a("add", d) }
|
|
817
806
|
];
|
|
818
|
-
return d.is_home ||
|
|
807
|
+
return d.is_home || l.push({
|
|
819
808
|
key: "duplicate",
|
|
820
809
|
icon: "copy",
|
|
821
810
|
label: s("page.duplicate"),
|
|
822
|
-
run: () =>
|
|
823
|
-
}), d.can.move &&
|
|
811
|
+
run: () => a("duplicate", d)
|
|
812
|
+
}), d.can.move && l.push({ key: "move", icon: "drag", label: s("page.move"), run: () => a("move", d) }), l.push(
|
|
824
813
|
{
|
|
825
814
|
key: "copy-address",
|
|
826
815
|
icon: "link",
|
|
827
816
|
label: s("page.copy-address"),
|
|
828
817
|
disabled: !d.url,
|
|
829
|
-
run: () =>
|
|
818
|
+
run: () => a("copy", d)
|
|
830
819
|
},
|
|
831
820
|
{
|
|
832
821
|
key: "on-site",
|
|
@@ -835,20 +824,20 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
835
824
|
disabled: !d.url,
|
|
836
825
|
href: d.url ?? void 0
|
|
837
826
|
}
|
|
838
|
-
), d.can.delete &&
|
|
827
|
+
), d.can.delete && l.push({
|
|
839
828
|
key: "delete",
|
|
840
829
|
icon: "trash",
|
|
841
830
|
label: s("page.delete"),
|
|
842
831
|
danger: !0,
|
|
843
|
-
run: () =>
|
|
844
|
-
}),
|
|
832
|
+
run: () => a("remove", d)
|
|
833
|
+
}), l;
|
|
845
834
|
});
|
|
846
|
-
return (d,
|
|
835
|
+
return (d, l) => (f(), C(e(Ye), {
|
|
847
836
|
actions: t.value,
|
|
848
837
|
label: g.page.title
|
|
849
838
|
}, null, 8, ["actions", "label"]));
|
|
850
839
|
}
|
|
851
|
-
}),
|
|
840
|
+
}), Ct = {
|
|
852
841
|
а: "a",
|
|
853
842
|
б: "b",
|
|
854
843
|
в: "v",
|
|
@@ -907,28 +896,28 @@ const ut = { class: "wx-page-danger" }, dt = {
|
|
|
907
896
|
ź: "z",
|
|
908
897
|
ż: "z"
|
|
909
898
|
};
|
|
910
|
-
function
|
|
911
|
-
return u.toLowerCase().split("").map((o) =>
|
|
899
|
+
function Mt(u) {
|
|
900
|
+
return u.toLowerCase().split("").map((o) => Ct[o] ?? o).join("").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
912
901
|
}
|
|
913
|
-
const
|
|
902
|
+
const St = /* @__PURE__ */ F({
|
|
914
903
|
__name: "PageCreateDialog",
|
|
915
904
|
props: {
|
|
916
905
|
parent: { default: null }
|
|
917
906
|
},
|
|
918
907
|
setup(u) {
|
|
919
|
-
const o = u, { open: g, resolve:
|
|
908
|
+
const o = u, { open: g, resolve: a, dismiss: s } = Be(), t = Q(), d = q(t);
|
|
920
909
|
j();
|
|
921
|
-
const
|
|
910
|
+
const l = H("webx-pages"), c = _(""), h = _(""), r = _(o.parent?.id ?? null), k = _(!1), w = _({}), z = Ke("field"), b = _(!1);
|
|
922
911
|
ae(c, (M) => {
|
|
923
|
-
b.value || (h.value =
|
|
912
|
+
b.value || (h.value = Mt(M));
|
|
924
913
|
}), ce(async () => {
|
|
925
914
|
await Fe(), z.value?.querySelector("input")?.focus();
|
|
926
915
|
});
|
|
927
916
|
async function p() {
|
|
928
917
|
if (!(c.value.trim() === "" || k.value)) {
|
|
929
|
-
k.value = !0,
|
|
918
|
+
k.value = !0, w.value = {};
|
|
930
919
|
try {
|
|
931
|
-
|
|
920
|
+
a(
|
|
932
921
|
await d.create({
|
|
933
922
|
title: c.value.trim(),
|
|
934
923
|
slug: h.value.trim(),
|
|
@@ -936,7 +925,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
936
925
|
})
|
|
937
926
|
);
|
|
938
927
|
} catch (M) {
|
|
939
|
-
|
|
928
|
+
w.value = M.body?.errors ?? {};
|
|
940
929
|
} finally {
|
|
941
930
|
k.value = !1;
|
|
942
931
|
}
|
|
@@ -945,7 +934,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
945
934
|
return (M, P) => (f(), C(e(De), {
|
|
946
935
|
open: e(g),
|
|
947
936
|
"onUpdate:open": P[5] || (P[5] = (B) => Me(g) ? g.value = B : null),
|
|
948
|
-
title: e(
|
|
937
|
+
title: e(l)("page.new-title"),
|
|
949
938
|
width: 460
|
|
950
939
|
}, {
|
|
951
940
|
footer: i(() => [
|
|
@@ -956,7 +945,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
956
945
|
onClick: P[4] || (P[4] = (B) => e(s)())
|
|
957
946
|
}, {
|
|
958
947
|
default: i(() => [
|
|
959
|
-
$(
|
|
948
|
+
$(x(e(l)("page.cancel")), 1)
|
|
960
949
|
]),
|
|
961
950
|
_: 1
|
|
962
951
|
}),
|
|
@@ -967,7 +956,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
967
956
|
onClick: p
|
|
968
957
|
}, {
|
|
969
958
|
default: i(() => [
|
|
970
|
-
$(
|
|
959
|
+
$(x(e(l)("page.create")), 1)
|
|
971
960
|
]),
|
|
972
961
|
_: 1
|
|
973
962
|
}, 8, ["loading", "disabled"])
|
|
@@ -977,8 +966,8 @@ const Mt = /* @__PURE__ */ F({
|
|
|
977
966
|
]),
|
|
978
967
|
default: i(() => [
|
|
979
968
|
v(e(ne), {
|
|
980
|
-
label: e(
|
|
981
|
-
error:
|
|
969
|
+
label: e(l)("page.field-title"),
|
|
970
|
+
error: w.value.title?.[0],
|
|
982
971
|
required: ""
|
|
983
972
|
}, {
|
|
984
973
|
default: i(() => [
|
|
@@ -989,7 +978,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
989
978
|
v(e(We), {
|
|
990
979
|
modelValue: c.value,
|
|
991
980
|
"onUpdate:modelValue": P[0] || (P[0] = (B) => c.value = B),
|
|
992
|
-
"aria-label": e(
|
|
981
|
+
"aria-label": e(l)("page.field-title"),
|
|
993
982
|
onKeyup: Pe(p, ["enter"])
|
|
994
983
|
}, null, 8, ["modelValue", "aria-label"])
|
|
995
984
|
], 512)
|
|
@@ -997,15 +986,15 @@ const Mt = /* @__PURE__ */ F({
|
|
|
997
986
|
_: 1
|
|
998
987
|
}, 8, ["label", "error"]),
|
|
999
988
|
v(e(ne), {
|
|
1000
|
-
label: e(
|
|
1001
|
-
error:
|
|
1002
|
-
help: e(
|
|
989
|
+
label: e(l)("page.field-slug"),
|
|
990
|
+
error: w.value.slug?.[0],
|
|
991
|
+
help: e(l)("page.slug-help")
|
|
1003
992
|
}, {
|
|
1004
993
|
default: i(() => [
|
|
1005
994
|
v(e(We), {
|
|
1006
995
|
modelValue: h.value,
|
|
1007
996
|
"onUpdate:modelValue": P[1] || (P[1] = (B) => h.value = B),
|
|
1008
|
-
"aria-label": e(
|
|
997
|
+
"aria-label": e(l)("page.field-slug"),
|
|
1009
998
|
onInput: P[2] || (P[2] = (B) => b.value = !0),
|
|
1010
999
|
onKeyup: Pe(p, ["enter"])
|
|
1011
1000
|
}, null, 8, ["modelValue", "aria-label"])
|
|
@@ -1013,8 +1002,8 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1013
1002
|
_: 1
|
|
1014
1003
|
}, 8, ["label", "error", "help"]),
|
|
1015
1004
|
v(e(ne), {
|
|
1016
|
-
label: e(
|
|
1017
|
-
error:
|
|
1005
|
+
label: e(l)("page.field-parent"),
|
|
1006
|
+
error: w.value.parent_id?.[0]
|
|
1018
1007
|
}, {
|
|
1019
1008
|
default: i(() => [
|
|
1020
1009
|
v($e, {
|
|
@@ -1029,16 +1018,16 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1029
1018
|
_: 1
|
|
1030
1019
|
}, 8, ["open", "title"]));
|
|
1031
1020
|
}
|
|
1032
|
-
}),
|
|
1021
|
+
}), Bt = /* @__PURE__ */ F({
|
|
1033
1022
|
__name: "PageMoveDialog",
|
|
1034
1023
|
props: {
|
|
1035
1024
|
page: {}
|
|
1036
1025
|
},
|
|
1037
1026
|
setup(u) {
|
|
1038
|
-
const o = u, { open: g, resolve:
|
|
1027
|
+
const o = u, { open: g, resolve: a, dismiss: s } = Be();
|
|
1039
1028
|
j();
|
|
1040
|
-
const t = H("webx-pages"), d =
|
|
1041
|
-
return (
|
|
1029
|
+
const t = H("webx-pages"), d = _(o.page.parent_id);
|
|
1030
|
+
return (l, c) => (f(), C(e(De), {
|
|
1042
1031
|
open: e(g),
|
|
1043
1032
|
"onUpdate:open": c[3] || (c[3] = (h) => Me(g) ? g.value = h : null),
|
|
1044
1033
|
title: e(t)("page.move-title", { title: o.page.title }),
|
|
@@ -1052,17 +1041,17 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1052
1041
|
onClick: c[1] || (c[1] = (h) => e(s)())
|
|
1053
1042
|
}, {
|
|
1054
1043
|
default: i(() => [
|
|
1055
|
-
$(
|
|
1044
|
+
$(x(e(t)("page.cancel")), 1)
|
|
1056
1045
|
]),
|
|
1057
1046
|
_: 1
|
|
1058
1047
|
}),
|
|
1059
1048
|
v(e(R), {
|
|
1060
1049
|
type: "primary",
|
|
1061
1050
|
disabled: d.value === null || d.value === o.page.parent_id,
|
|
1062
|
-
onClick: c[2] || (c[2] = (h) => e(
|
|
1051
|
+
onClick: c[2] || (c[2] = (h) => e(a)(d.value))
|
|
1063
1052
|
}, {
|
|
1064
1053
|
default: i(() => [
|
|
1065
|
-
$(
|
|
1054
|
+
$(x(e(t)("page.move-confirm")), 1)
|
|
1066
1055
|
]),
|
|
1067
1056
|
_: 1
|
|
1068
1057
|
}, 8, ["disabled"])
|
|
@@ -1094,15 +1083,15 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1094
1083
|
_: 1
|
|
1095
1084
|
}, 8, ["open", "title"]));
|
|
1096
1085
|
}
|
|
1097
|
-
}),
|
|
1086
|
+
}), Dt = { class: "wx-pages" }, Nt = { class: "wx-pages__title" }, Et = ["href"], At = /* @__PURE__ */ F({
|
|
1098
1087
|
__name: "PagesPage",
|
|
1099
1088
|
props: {
|
|
1100
1089
|
base: { default: "/pages" }
|
|
1101
1090
|
},
|
|
1102
1091
|
setup(u) {
|
|
1103
|
-
const o = u, g = Q(),
|
|
1092
|
+
const o = u, g = Q(), a = q(g), s = _e();
|
|
1104
1093
|
j();
|
|
1105
|
-
const t = H("webx-pages"), d = ie(),
|
|
1094
|
+
const t = H("webx-pages"), d = ie(), l = _(null), c = _([]), h = _(!0), r = _(""), k = _(""), w = Ve(St), z = Ve(Bt), b = W(() => g.can("pages.manage")), p = W(() => k.value === "trashed"), M = W(() => !p.value && r.value.trim() === ""), P = W(
|
|
1106
1095
|
() => g.state.manifest?.modules.find((n) => n.id === "pages")?.title ?? t("module.title")
|
|
1107
1096
|
), B = W(() => [
|
|
1108
1097
|
{ value: "", label: t("page.filter-all") },
|
|
@@ -1111,7 +1100,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1111
1100
|
{ value: "modified", label: t("page.filter-modified") },
|
|
1112
1101
|
{ value: "trashed", label: t("page.bin"), icon: "trash" }
|
|
1113
1102
|
]), le = W(
|
|
1114
|
-
() => M.value &&
|
|
1103
|
+
() => M.value && l.value ? [{ ...l.value, children_count: 0 }, ...c.value] : c.value
|
|
1115
1104
|
), A = W(() => [
|
|
1116
1105
|
{ key: "title", label: t("page.column-title"), minWidth: 200 },
|
|
1117
1106
|
{ key: "path", label: t("page.column-address"), width: 200, hideBelow: 560 },
|
|
@@ -1131,13 +1120,13 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1131
1120
|
hideBelow: 900,
|
|
1132
1121
|
hidden: p.value
|
|
1133
1122
|
},
|
|
1134
|
-
{ key: "actions", label: "", width:
|
|
1123
|
+
{ key: "actions", label: "", width: Ze, align: "right" }
|
|
1135
1124
|
]), ee = W(
|
|
1136
1125
|
() => M.value ? {
|
|
1137
1126
|
childrenKey: "children",
|
|
1138
1127
|
hasChildrenKey: "children_count",
|
|
1139
1128
|
lazy: !0,
|
|
1140
|
-
load: (n) =>
|
|
1129
|
+
load: (n) => a.list({ parent: n.id }).then((T) => T.items),
|
|
1141
1130
|
draggable: b.value,
|
|
1142
1131
|
allowDrag: (n) => n.can.move,
|
|
1143
1132
|
allowDrop: re
|
|
@@ -1149,12 +1138,12 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1149
1138
|
async function S() {
|
|
1150
1139
|
h.value = !0;
|
|
1151
1140
|
try {
|
|
1152
|
-
const n = await
|
|
1141
|
+
const n = await a.list({
|
|
1153
1142
|
search: r.value.trim(),
|
|
1154
1143
|
status: p.value ? "" : k.value,
|
|
1155
1144
|
trashed: p.value
|
|
1156
1145
|
});
|
|
1157
|
-
|
|
1146
|
+
l.value = n.home, c.value = n.items;
|
|
1158
1147
|
} catch (n) {
|
|
1159
1148
|
V.danger(d(n));
|
|
1160
1149
|
} finally {
|
|
@@ -1169,12 +1158,12 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1169
1158
|
s.resolve(T).matched.length > 0 && s.push(T);
|
|
1170
1159
|
}
|
|
1171
1160
|
async function ue(n) {
|
|
1172
|
-
const T = await
|
|
1161
|
+
const T = await w({ parent: n });
|
|
1173
1162
|
T && (await S(), E(T));
|
|
1174
1163
|
}
|
|
1175
1164
|
async function de(n) {
|
|
1176
1165
|
try {
|
|
1177
|
-
await
|
|
1166
|
+
await a.duplicate(n.id), V.success(t("page.duplicated")), await S();
|
|
1178
1167
|
} catch (T) {
|
|
1179
1168
|
V.danger(d(T));
|
|
1180
1169
|
}
|
|
@@ -1198,7 +1187,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1198
1187
|
}
|
|
1199
1188
|
async function G(n, T, m) {
|
|
1200
1189
|
try {
|
|
1201
|
-
const J = await
|
|
1190
|
+
const J = await a.move(n.id, T, m);
|
|
1202
1191
|
V.success(
|
|
1203
1192
|
J.addresses_changed > 1 ? t("page.moved", { count: J.addresses_changed }) : t("page.moved-one")
|
|
1204
1193
|
);
|
|
@@ -1221,7 +1210,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1221
1210
|
tone: "danger"
|
|
1222
1211
|
}))
|
|
1223
1212
|
try {
|
|
1224
|
-
await
|
|
1213
|
+
await a.remove(n.id), V.success(t("page.deleted")), await S();
|
|
1225
1214
|
} catch (m) {
|
|
1226
1215
|
V.danger(d(m));
|
|
1227
1216
|
}
|
|
@@ -1234,7 +1223,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1234
1223
|
cancelText: t("page.cancel")
|
|
1235
1224
|
}))
|
|
1236
1225
|
try {
|
|
1237
|
-
const m = await
|
|
1226
|
+
const m = await a.restore(n.id);
|
|
1238
1227
|
V.success(
|
|
1239
1228
|
m > 1 ? t("page.restored-branch", { count: m }) : t("page.restored")
|
|
1240
1229
|
), await S();
|
|
@@ -1260,8 +1249,8 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1260
1249
|
ue(null);
|
|
1261
1250
|
} }] : []
|
|
1262
1251
|
);
|
|
1263
|
-
return (n, T) => (f(), N("div",
|
|
1264
|
-
v(e(
|
|
1252
|
+
return (n, T) => (f(), N("div", Dt, [
|
|
1253
|
+
v(e(qe), {
|
|
1265
1254
|
view: k.value,
|
|
1266
1255
|
"onUpdate:view": T[1] || (T[1] = (m) => k.value = m),
|
|
1267
1256
|
title: P.value,
|
|
@@ -1269,7 +1258,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1269
1258
|
actions: me.value
|
|
1270
1259
|
}, {
|
|
1271
1260
|
default: i(() => [
|
|
1272
|
-
v(e(
|
|
1261
|
+
v(e(it), {
|
|
1273
1262
|
data: le.value,
|
|
1274
1263
|
columns: A.value,
|
|
1275
1264
|
"row-key": "id",
|
|
@@ -1289,7 +1278,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1289
1278
|
onNodeDrop: ge
|
|
1290
1279
|
}, {
|
|
1291
1280
|
"cell-title": i(({ row: m }) => [
|
|
1292
|
-
K("span",
|
|
1281
|
+
K("span", Nt, x(m.is_home ? e(t)("pages.home") : m.title), 1)
|
|
1293
1282
|
]),
|
|
1294
1283
|
"cell-path": i(({ row: m }) => [
|
|
1295
1284
|
p.value ? (f(), C(e(U), {
|
|
@@ -1309,14 +1298,14 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1309
1298
|
rel: "noopener",
|
|
1310
1299
|
onClick: T[0] || (T[0] = He(() => {
|
|
1311
1300
|
}, ["stop"]))
|
|
1312
|
-
}, " /" +
|
|
1301
|
+
}, " /" + x(m.path), 9, Et)) : m.path !== null ? (f(), C(e(U), {
|
|
1313
1302
|
key: 2,
|
|
1314
1303
|
mono: "",
|
|
1315
1304
|
size: "sm",
|
|
1316
1305
|
tone: "muted"
|
|
1317
1306
|
}, {
|
|
1318
1307
|
default: i(() => [
|
|
1319
|
-
$("/" +
|
|
1308
|
+
$("/" + x(m.path), 1)
|
|
1320
1309
|
]),
|
|
1321
1310
|
_: 2
|
|
1322
1311
|
}, 1024)) : (f(), C(e(U), {
|
|
@@ -1325,7 +1314,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1325
1314
|
tone: "muted"
|
|
1326
1315
|
}, {
|
|
1327
1316
|
default: i(() => [
|
|
1328
|
-
$(
|
|
1317
|
+
$(x(e(t)("page.no-address")), 1)
|
|
1329
1318
|
]),
|
|
1330
1319
|
_: 1
|
|
1331
1320
|
}))
|
|
@@ -1340,7 +1329,7 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1340
1329
|
dot: ""
|
|
1341
1330
|
}, {
|
|
1342
1331
|
default: i(() => [
|
|
1343
|
-
$(
|
|
1332
|
+
$(x(e(t)(`page.status-${m.status}`)), 1)
|
|
1344
1333
|
]),
|
|
1345
1334
|
_: 2
|
|
1346
1335
|
}, 1032, ["type"]))
|
|
@@ -1356,14 +1345,14 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1356
1345
|
compact: ""
|
|
1357
1346
|
}, null, 8, ["value"]),
|
|
1358
1347
|
m.edited_by && !p.value ? (f(), N(Z, { key: 0 }, [
|
|
1359
|
-
$(", " +
|
|
1348
|
+
$(", " + x(m.edited_by), 1)
|
|
1360
1349
|
], 64)) : I("", !0)
|
|
1361
1350
|
]),
|
|
1362
1351
|
_: 2
|
|
1363
1352
|
}, 1024)
|
|
1364
1353
|
]),
|
|
1365
1354
|
"cell-actions": i(({ row: m }) => [
|
|
1366
|
-
b.value ? (f(), C(
|
|
1355
|
+
b.value ? (f(), C(zt, {
|
|
1367
1356
|
key: 0,
|
|
1368
1357
|
page: m,
|
|
1369
1358
|
"in-bin": p.value,
|
|
@@ -1383,18 +1372,18 @@ const Mt = /* @__PURE__ */ F({
|
|
|
1383
1372
|
}, 8, ["view", "title", "views", "actions"])
|
|
1384
1373
|
]));
|
|
1385
1374
|
}
|
|
1386
|
-
}),
|
|
1387
|
-
function
|
|
1375
|
+
}), It = /* @__PURE__ */ oe(At, [["__scopeId", "data-v-9f11d1cb"]]);
|
|
1376
|
+
function Ft(u = {}) {
|
|
1388
1377
|
const o = u.path ?? "/pages";
|
|
1389
1378
|
return {
|
|
1390
1379
|
id: "pages",
|
|
1391
1380
|
path: o,
|
|
1392
1381
|
routes: [
|
|
1393
|
-
{ path: o, name: "webx.pages", component:
|
|
1382
|
+
{ path: o, name: "webx.pages", component: It, props: { base: o } },
|
|
1394
1383
|
{
|
|
1395
1384
|
path: `${o}/:id(\\d+)`,
|
|
1396
1385
|
name: "webx.pages.edit",
|
|
1397
|
-
component:
|
|
1386
|
+
component: wt,
|
|
1398
1387
|
props: { base: o }
|
|
1399
1388
|
}
|
|
1400
1389
|
],
|
|
@@ -1407,25 +1396,25 @@ function Kt(u = {}) {
|
|
|
1407
1396
|
* page from the editor above it rather than from the description.
|
|
1408
1397
|
*/
|
|
1409
1398
|
types: {
|
|
1410
|
-
"wx-page-place": { component:
|
|
1411
|
-
"wx-page-danger": { component:
|
|
1412
|
-
"wx-page-history": { component:
|
|
1399
|
+
"wx-page-place": { component: Vt, kind: "display" },
|
|
1400
|
+
"wx-page-danger": { component: mt, kind: "display" },
|
|
1401
|
+
"wx-page-history": { component: $t, kind: "display" }
|
|
1413
1402
|
}
|
|
1414
1403
|
};
|
|
1415
1404
|
}
|
|
1416
1405
|
export {
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1406
|
+
mt as WxPageDanger,
|
|
1407
|
+
wt as WxPageEditorPage,
|
|
1408
|
+
$t as WxPageHistory,
|
|
1420
1409
|
$e as WxPagePicker,
|
|
1421
|
-
|
|
1422
|
-
|
|
1410
|
+
Vt as WxPagePlace,
|
|
1411
|
+
It as WxPagesPage,
|
|
1423
1412
|
q as createPagesApi,
|
|
1424
1413
|
Ne as pageEditorKey,
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1414
|
+
Ft as pages,
|
|
1415
|
+
ut as pagesMessages,
|
|
1416
|
+
rt as providePageEditor,
|
|
1417
|
+
Mt as slugify,
|
|
1429
1418
|
Te as usePageEditor
|
|
1430
1419
|
};
|
|
1431
1420
|
//# sourceMappingURL=index.js.map
|