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