@webx-ui/module-admin 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Screen.d.ts +7 -1
- package/dist/index.js +390 -387
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject as be, reactive as ot, defineComponent as X, useModel as ze, ref as E, watch as ue, computed as
|
|
1
|
+
import { inject as be, reactive as ot, defineComponent as X, useModel as ze, ref as E, watch as ue, computed as _, openBlock as c, createElementBlock as C, createVNode as $, unref as a, withCtx as b, createElementVNode as D, toDisplayString as T, createBlock as N, createTextVNode as M, createCommentVNode as B, mergeModels as Ae, mergeProps as Nt, provide as ut, normalizeClass as ke, createSlots as Ue, nextTick as dt, useId as In, Fragment as G, onMounted as Ee, renderList as ce, withModifiers as Rt, useSlots as Mn, useTemplateRef as Vt, renderSlot as me, useAttrs as On, normalizeProps as Pn, guardReactiveProps as Bn, resolveComponent as ve, watchEffect as jn, onUnmounted as Dn, isRef as mn, createApp as Fn, h as Oe, onBeforeUnmount as ct, shallowRef as st, getCurrentScope as Hn, onScopeDispose as Kn, readonly as Ve, withKeys as hn } from "vue";
|
|
2
2
|
import { RouterLink as qn, useRouter as He, useRoute as pn, createRouter as Yn, createWebHistory as Jn, onBeforeRouteLeave as Xn } from "vue-router";
|
|
3
3
|
import { WxSortableList as Ut, WxAction as Ne, WxBadge as Ke, WxSelect as je, WxAutocomplete as xt, WxSwitch as pt, WxInputNumber as Gn, WxButton as re, WxSegmented as Qn, WxText as ne, WxInput as qe, WxCheckbox as Gt, WxTooltip as It, WxEmpty as it, WxSkeleton as Ce, WxAvatar as gn, WxDialog as Mt, toast as Z, WxActions as Zn, WxDropdownItem as el, useElementWidth as tl, WxHeading as yn, WxIcon as ft, WxTabs as nl, WxCard as $t, WxRichText as ll, useLocales as Ot, WxAlert as ye, WxResult as bn, useResponsiveShell as al, shellLayoutFor as ol, WxToaster as sl, WebxUI as il, dateLocaleKey as rl, dateTimezoneKey as ul, localesKey as dl, confirm as We, useModal as cl, WxFormItem as fl, WxSpace as vl, createModal as ml, localizedValue as hl, WxBreadcrumb as pl, WxBreadcrumbItem as Qt, WxActionBar as gl, WxPopover as yl, WxTextarea as Zt } from "@webx-ui/core";
|
|
4
4
|
import { watchSystemTheme as bl, applyTheme as wl, systemTheme as _l } from "@webx-ui/tokens";
|
|
@@ -34,7 +34,7 @@ function Pt(e = {}) {
|
|
|
34
34
|
return typeof m == "string" ? m : null;
|
|
35
35
|
}
|
|
36
36
|
function i(r, u, v) {
|
|
37
|
-
const [m, f] = u.includes("::") ? u.split("::", 2) : [r, u],
|
|
37
|
+
const [m, f] = u.includes("::") ? u.split("::", 2) : [r, u], d = f.split("."), y = s(l.value, m, d) ?? s(o, m, d) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
|
|
38
38
|
// label says nothing to anybody trying to fix it.
|
|
39
39
|
u;
|
|
40
40
|
return v === void 0 ? y : Sl(y, v);
|
|
@@ -102,34 +102,34 @@ const Al = { class: "wx-categories-field" }, Cl = { class: "wx-categories-field_
|
|
|
102
102
|
const t = e, n = ze(e, "modelValue"), o = oe(), l = ee("webx-admin"), s = E([]);
|
|
103
103
|
ue(
|
|
104
104
|
() => t.source,
|
|
105
|
-
async (
|
|
105
|
+
async (d) => {
|
|
106
106
|
try {
|
|
107
|
-
const y = await Ie(o,
|
|
108
|
-
s.value = y.data.map((
|
|
107
|
+
const y = await Ie(o, d).list();
|
|
108
|
+
s.value = y.data.map((w) => ({ id: w.id, name: w.name }));
|
|
109
109
|
} catch {
|
|
110
110
|
s.value = [];
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
{ immediate: !0 }
|
|
114
114
|
);
|
|
115
|
-
const i =
|
|
116
|
-
get: () => i.value.map((
|
|
117
|
-
set: (
|
|
118
|
-
n.value =
|
|
115
|
+
const i = _(() => Array.isArray(n.value) ? n.value : []), r = _(() => new Map(s.value.map((d) => [d.id, d.name]))), u = _({
|
|
116
|
+
get: () => i.value.map((d) => ({ id: d, name: r.value.get(d) ?? `#${d}` })),
|
|
117
|
+
set: (d) => {
|
|
118
|
+
n.value = d.map((y) => y.id);
|
|
119
119
|
}
|
|
120
|
-
}), v =
|
|
121
|
-
() => s.value.filter((
|
|
120
|
+
}), v = _(
|
|
121
|
+
() => s.value.filter((d) => !i.value.includes(d.id)).map((d) => ({ label: d.name, value: d.id }))
|
|
122
122
|
);
|
|
123
|
-
function m(
|
|
124
|
-
typeof
|
|
123
|
+
function m(d) {
|
|
124
|
+
typeof d != "number" || i.value.includes(d) || (n.value = [...i.value, d]);
|
|
125
125
|
}
|
|
126
|
-
function f(
|
|
127
|
-
n.value = i.value.filter((y) => y !==
|
|
126
|
+
function f(d) {
|
|
127
|
+
n.value = i.value.filter((y) => y !== d);
|
|
128
128
|
}
|
|
129
|
-
return (
|
|
129
|
+
return (d, y) => (c(), C("div", Al, [
|
|
130
130
|
$(a(Ut), {
|
|
131
131
|
modelValue: u.value,
|
|
132
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
132
|
+
"onUpdate:modelValue": y[0] || (y[0] = (w) => u.value = w),
|
|
133
133
|
plain: "",
|
|
134
134
|
size: "sm",
|
|
135
135
|
"item-key": "id",
|
|
@@ -137,9 +137,9 @@ const Al = { class: "wx-categories-field" }, Cl = { class: "wx-categories-field_
|
|
|
137
137
|
disabled: t.disabled,
|
|
138
138
|
"empty-text": t.emptyText ?? a(l)("categories.field-empty")
|
|
139
139
|
}, {
|
|
140
|
-
default: b(({ item:
|
|
141
|
-
D("span", Cl, T(
|
|
142
|
-
t.main && h === 0 ? (
|
|
140
|
+
default: b(({ item: w, index: h }) => [
|
|
141
|
+
D("span", Cl, T(w.name), 1),
|
|
142
|
+
t.main && h === 0 ? (c(), N(a(Ke), {
|
|
143
143
|
key: 0,
|
|
144
144
|
type: "primary"
|
|
145
145
|
}, {
|
|
@@ -149,13 +149,13 @@ const Al = { class: "wx-categories-field" }, Cl = { class: "wx-categories-field_
|
|
|
149
149
|
_: 1
|
|
150
150
|
})) : B("", !0)
|
|
151
151
|
]),
|
|
152
|
-
actions: b(({ item:
|
|
152
|
+
actions: b(({ item: w }) => [
|
|
153
153
|
$(a(Ne), {
|
|
154
154
|
type: "remove",
|
|
155
155
|
size: "sm",
|
|
156
156
|
disabled: t.disabled,
|
|
157
157
|
title: t.removeText ?? a(l)("categories.field-remove"),
|
|
158
|
-
onClick: (h) => f(
|
|
158
|
+
onClick: (h) => f(w.id)
|
|
159
159
|
}, null, 8, ["disabled", "title", "onClick"])
|
|
160
160
|
]),
|
|
161
161
|
_: 1
|
|
@@ -204,8 +204,8 @@ const Al = { class: "wx-categories-field" }, Cl = { class: "wx-categories-field_
|
|
|
204
204
|
},
|
|
205
205
|
{ immediate: !0 }
|
|
206
206
|
);
|
|
207
|
-
const l =
|
|
208
|
-
return (s, i) => (
|
|
207
|
+
const l = _(() => t.source ? o.value : t.options);
|
|
208
|
+
return (s, i) => (c(), N(a(je), Nt(s.$attrs, { options: l.value }), null, 16, ["options"]));
|
|
209
209
|
}
|
|
210
210
|
});
|
|
211
211
|
class De extends Error {
|
|
@@ -234,48 +234,48 @@ function Nl(e = {}) {
|
|
|
234
234
|
async function r(m = !1) {
|
|
235
235
|
i && !m && en("XSRF-TOKEN") !== null || (await o(n, { credentials: "same-origin" }), i = !0);
|
|
236
236
|
}
|
|
237
|
-
async function u(m, f,
|
|
238
|
-
const
|
|
239
|
-
|
|
237
|
+
async function u(m, f, d = {}, y = !1) {
|
|
238
|
+
const w = El.has(m);
|
|
239
|
+
w && await r();
|
|
240
240
|
const h = {
|
|
241
241
|
Accept: "application/json",
|
|
242
242
|
"X-Requested-With": "XMLHttpRequest",
|
|
243
243
|
// Standing headers first, so a caller can still override one for a single request.
|
|
244
244
|
...s?.(),
|
|
245
|
-
...
|
|
245
|
+
...d.headers
|
|
246
246
|
};
|
|
247
|
-
if (
|
|
247
|
+
if (w) {
|
|
248
248
|
const p = en("XSRF-TOKEN");
|
|
249
249
|
p !== null && (h["X-XSRF-TOKEN"] = p);
|
|
250
250
|
}
|
|
251
|
-
|
|
252
|
-
const W = await o(Rl(t, f,
|
|
251
|
+
d.json === !0 && (h["Content-Type"] = "application/json");
|
|
252
|
+
const W = await o(Rl(t, f, d.query), {
|
|
253
253
|
method: m,
|
|
254
254
|
credentials: "same-origin",
|
|
255
255
|
headers: h,
|
|
256
|
-
signal:
|
|
257
|
-
body:
|
|
256
|
+
signal: d.signal,
|
|
257
|
+
body: d.body ?? void 0
|
|
258
258
|
});
|
|
259
|
-
return W.status === 419 &&
|
|
259
|
+
return W.status === 419 && w && !y ? (await r(!0), u(m, f, d, !0)) : (W.status === 401 && l?.(), W);
|
|
260
260
|
}
|
|
261
|
-
async function v(m, f,
|
|
262
|
-
const
|
|
261
|
+
async function v(m, f, d, y = {}) {
|
|
262
|
+
const w = await u(m, f, {
|
|
263
263
|
...y,
|
|
264
|
-
json:
|
|
265
|
-
body:
|
|
264
|
+
json: d !== void 0,
|
|
265
|
+
body: d === void 0 ? void 0 : JSON.stringify(d)
|
|
266
266
|
});
|
|
267
|
-
if (!
|
|
268
|
-
throw await St(
|
|
269
|
-
if (
|
|
270
|
-
return await
|
|
267
|
+
if (!w.ok)
|
|
268
|
+
throw await St(w);
|
|
269
|
+
if (w.status !== 204)
|
|
270
|
+
return await w.json();
|
|
271
271
|
}
|
|
272
272
|
return {
|
|
273
273
|
get: (m, f) => v("GET", m, void 0, f),
|
|
274
|
-
post: (m, f,
|
|
275
|
-
put: (m, f,
|
|
276
|
-
patch: (m, f,
|
|
274
|
+
post: (m, f, d) => v("POST", m, f, d),
|
|
275
|
+
put: (m, f, d) => v("PUT", m, f, d),
|
|
276
|
+
patch: (m, f, d) => v("PATCH", m, f, d),
|
|
277
277
|
delete: (m, f) => v("DELETE", m, void 0, f),
|
|
278
|
-
send: (m, f,
|
|
278
|
+
send: (m, f, d) => u(m.toUpperCase(), f, d)
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
async function St(e) {
|
|
@@ -355,8 +355,8 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
355
355
|
}),
|
|
356
356
|
emits: ["update:modelValue"],
|
|
357
357
|
setup(e) {
|
|
358
|
-
const t = e, n = ze(e, "modelValue"), o = oe(), l = Il(), s = ee("webx-admin"), i =
|
|
359
|
-
function
|
|
358
|
+
const t = e, n = ze(e, "modelValue"), o = oe(), l = Il(), s = ee("webx-admin"), i = _(() => Vl(o, t.target)), r = E(/* @__PURE__ */ new Map()), u = E(/* @__PURE__ */ new Set()), v = E(!1), m = E([]), f = E(!1), d = E(""), y = _(() => Ul(n.value));
|
|
359
|
+
function w(U) {
|
|
360
360
|
const L = new Map(r.value);
|
|
361
361
|
for (const j of U) L.set(j.id, j);
|
|
362
362
|
r.value = L;
|
|
@@ -366,7 +366,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
366
366
|
if (!(L.length === 0 || v.value))
|
|
367
367
|
try {
|
|
368
368
|
const j = await i.value.named(L);
|
|
369
|
-
|
|
369
|
+
w(j);
|
|
370
370
|
const J = new Set(j.map((le) => le.id));
|
|
371
371
|
u.value = /* @__PURE__ */ new Set([...u.value, ...L.filter((le) => !J.has(le))]);
|
|
372
372
|
} catch (j) {
|
|
@@ -381,7 +381,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
381
381
|
), ue(y, (U) => {
|
|
382
382
|
h(U);
|
|
383
383
|
}, { immediate: !0 });
|
|
384
|
-
const W =
|
|
384
|
+
const W = _({
|
|
385
385
|
get: () => y.value.map((U) => {
|
|
386
386
|
const L = r.value.get(U) ?? null;
|
|
387
387
|
return { id: U, title: L?.title || `#${U}`, candidate: L };
|
|
@@ -389,7 +389,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
389
389
|
set: (U) => {
|
|
390
390
|
n.value = U.map((L) => L.id);
|
|
391
391
|
}
|
|
392
|
-
}), p =
|
|
392
|
+
}), p = _(() => t.max !== null && y.value.length >= t.max), V = _(() => l !== null && l.type === t.target ? l.id.value : null), H = _(
|
|
393
393
|
() => m.value.filter((U) => U.id !== V.value && !y.value.includes(U.id)).map((U) => ({
|
|
394
394
|
value: U.title,
|
|
395
395
|
description: [U.subtitle, U.visible ? null : s("relations.field-hidden")].filter((L) => typeof L == "string" && L !== "").join(" · "),
|
|
@@ -400,7 +400,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
400
400
|
f.value = !0;
|
|
401
401
|
try {
|
|
402
402
|
const L = await i.value.search(U);
|
|
403
|
-
m.value = L,
|
|
403
|
+
m.value = L, w(L);
|
|
404
404
|
} catch (L) {
|
|
405
405
|
m.value = [], L instanceof De && L.status === 403 && (v.value = !0);
|
|
406
406
|
} finally {
|
|
@@ -410,19 +410,19 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
410
410
|
function O(U) {
|
|
411
411
|
const L = Number(U.id);
|
|
412
412
|
!Number.isInteger(L) || y.value.includes(L) || p.value || (n.value = [...y.value, L], dt(() => {
|
|
413
|
-
|
|
413
|
+
d.value = "";
|
|
414
414
|
}));
|
|
415
415
|
}
|
|
416
416
|
function g(U) {
|
|
417
417
|
n.value = y.value.filter((L) => L !== U);
|
|
418
418
|
}
|
|
419
|
-
const S =
|
|
419
|
+
const S = _(() => t.disabled || v.value), k = _(
|
|
420
420
|
() => p.value ? s("relations.field-full", { max: String(t.max) }) : t.addText ?? s("relations.field-add")
|
|
421
421
|
);
|
|
422
422
|
function I(U) {
|
|
423
423
|
return U.candidate === null ? u.value.has(U.id) ? s("relations.field-missing") : null : U.candidate.trashed === !0 ? s("relations.field-trashed") : U.candidate.visible ? null : s("relations.field-hidden");
|
|
424
424
|
}
|
|
425
|
-
return (U, L) => (
|
|
425
|
+
return (U, L) => (c(), C("div", {
|
|
426
426
|
class: ke(["wx-relations-field", { "is-unordered": !t.sortable }])
|
|
427
427
|
}, [
|
|
428
428
|
$(a(Ut), {
|
|
@@ -437,7 +437,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
437
437
|
"drag-label": a(s)("relations.field-drag")
|
|
438
438
|
}, Ue({
|
|
439
439
|
default: b(({ item: j }) => [
|
|
440
|
-
j.candidate?.thumb ? (
|
|
440
|
+
j.candidate?.thumb ? (c(), C("img", {
|
|
441
441
|
key: 0,
|
|
442
442
|
class: "wx-relations-field__thumb",
|
|
443
443
|
src: j.candidate.thumb,
|
|
@@ -445,9 +445,9 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
445
445
|
}, null, 8, Ml)) : B("", !0),
|
|
446
446
|
D("span", Ol, [
|
|
447
447
|
D("span", Pl, T(j.title), 1),
|
|
448
|
-
j.candidate?.subtitle ? (
|
|
448
|
+
j.candidate?.subtitle ? (c(), C("span", Bl, T(j.candidate.subtitle), 1)) : B("", !0)
|
|
449
449
|
]),
|
|
450
|
-
I(j) ? (
|
|
450
|
+
I(j) ? (c(), N(a(Ke), {
|
|
451
451
|
key: 1,
|
|
452
452
|
type: "warning"
|
|
453
453
|
}, {
|
|
@@ -472,10 +472,10 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
472
472
|
key: "0"
|
|
473
473
|
}
|
|
474
474
|
]), 1032, ["modelValue", "disabled", "empty-text", "drag-label"]),
|
|
475
|
-
v.value ? (
|
|
475
|
+
v.value ? (c(), C("p", jl, T(a(s)("relations.field-forbidden")), 1)) : (c(), C("div", Dl, [
|
|
476
476
|
$(a(xt), {
|
|
477
|
-
modelValue:
|
|
478
|
-
"onUpdate:modelValue": L[1] || (L[1] = (j) =>
|
|
477
|
+
modelValue: d.value,
|
|
478
|
+
"onUpdate:modelValue": L[1] || (L[1] = (j) => d.value = j),
|
|
479
479
|
options: H.value,
|
|
480
480
|
remote: "",
|
|
481
481
|
teleport: "",
|
|
@@ -580,23 +580,23 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
580
580
|
},
|
|
581
581
|
{ immediate: !0 }
|
|
582
582
|
);
|
|
583
|
-
const u =
|
|
583
|
+
const u = _(() => tn(n.value));
|
|
584
584
|
function v(g) {
|
|
585
585
|
n.value = tn({ ...u.value, ...g });
|
|
586
586
|
}
|
|
587
|
-
const m =
|
|
587
|
+
const m = _(() => {
|
|
588
588
|
const g = new Set(r.value.map((k) => k.value)), S = u.value.categories.filter((k) => !g.has(k)).map((k) => ({ label: `#${k}`, value: k }));
|
|
589
589
|
return [...r.value, ...S];
|
|
590
590
|
});
|
|
591
591
|
function f(g) {
|
|
592
592
|
v({ categories: Array.isArray(g) ? g.map(Number) : [] });
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function d(g) {
|
|
595
595
|
v({ limit: g ?? null });
|
|
596
596
|
}
|
|
597
|
-
const y = E(null),
|
|
597
|
+
const y = E(null), w = _(
|
|
598
598
|
() => (i.value?.relations ?? []).map((g) => ({ label: g.title, value: g.key }))
|
|
599
|
-
), h =
|
|
599
|
+
), h = _(() => {
|
|
600
600
|
const g = i.value?.relations ?? [];
|
|
601
601
|
if (g.length === 1) return g[0];
|
|
602
602
|
const S = u.value.related?.type ?? y.value;
|
|
@@ -613,22 +613,22 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
613
613
|
const S = h.value?.key;
|
|
614
614
|
v({ related: g && S ? { type: S, ids: [], current: !0 } : null });
|
|
615
615
|
}
|
|
616
|
-
const H =
|
|
616
|
+
const H = _(() => u.value.markup ?? nn(u.value));
|
|
617
617
|
function z(g) {
|
|
618
618
|
v({ markup: g === !0 });
|
|
619
619
|
}
|
|
620
|
-
const O =
|
|
620
|
+
const O = _(
|
|
621
621
|
() => l(
|
|
622
622
|
nn(u.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
|
|
623
623
|
)
|
|
624
624
|
);
|
|
625
|
-
return (g, S) => (
|
|
625
|
+
return (g, S) => (c(), C("div", {
|
|
626
626
|
class: "wx-collection-field",
|
|
627
627
|
"aria-busy": i.value === void 0
|
|
628
628
|
}, [
|
|
629
|
-
i.value === null ? (
|
|
629
|
+
i.value === null ? (c(), C("p", Jl, T(a(l)("collections.field-unavailable", { source: t.source })), 1)) : i.value ? (c(), C(G, { key: 1 }, [
|
|
630
630
|
D("p", Xl, T(a(l)("collections.field-source", { source: i.value.title })), 1),
|
|
631
|
-
i.value.categories ? (
|
|
631
|
+
i.value.categories ? (c(), C("div", Gl, [
|
|
632
632
|
D("label", {
|
|
633
633
|
class: "wx-collection-field__label",
|
|
634
634
|
for: `${a(s)}-categories`
|
|
@@ -647,12 +647,12 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
647
647
|
"onUpdate:modelValue": f
|
|
648
648
|
}, null, 8, ["id", "model-value", "options", "placeholder", "empty-text", "disabled"])
|
|
649
649
|
])) : B("", !0),
|
|
650
|
-
i.value.relations.length > 0 ? (
|
|
650
|
+
i.value.relations.length > 0 ? (c(), C("div", Zl, [
|
|
651
651
|
D("span", ea, T(i.value.relations.length === 1 ? a(l)("relations.collection-related-to", { target: i.value.relations[0].title }) : a(l)("relations.collection-related")), 1),
|
|
652
|
-
i.value.relations.length > 1 ? (
|
|
652
|
+
i.value.relations.length > 1 ? (c(), N(a(je), {
|
|
653
653
|
key: 0,
|
|
654
654
|
"model-value": h.value?.key ?? null,
|
|
655
|
-
options:
|
|
655
|
+
options: w.value,
|
|
656
656
|
placeholder: a(l)("relations.collection-related-type"),
|
|
657
657
|
"aria-label": a(l)("relations.collection-related-type"),
|
|
658
658
|
disabled: t.disabled,
|
|
@@ -660,7 +660,7 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
660
660
|
teleport: "",
|
|
661
661
|
"onUpdate:modelValue": W
|
|
662
662
|
}, null, 8, ["model-value", "options", "placeholder", "aria-label", "disabled"])) : B("", !0),
|
|
663
|
-
h.value ? (
|
|
663
|
+
h.value ? (c(), C(G, { key: 1 }, [
|
|
664
664
|
$(a(pt), {
|
|
665
665
|
"model-value": u.value.related?.current === !0,
|
|
666
666
|
label: a(l)("relations.collection-related-current"),
|
|
@@ -669,7 +669,7 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
669
669
|
}, null, 8, ["model-value", "label", "disabled"]),
|
|
670
670
|
D("p", ta, T(a(l)("relations.collection-related-current-hint", { target: h.value.title })), 1)
|
|
671
671
|
], 64)) : B("", !0),
|
|
672
|
-
h.value && u.value.related?.current !== !0 ? (
|
|
672
|
+
h.value && u.value.related?.current !== !0 ? (c(), N(_n, {
|
|
673
673
|
key: 2,
|
|
674
674
|
"model-value": u.value.related?.ids ?? [],
|
|
675
675
|
target: h.value.key,
|
|
@@ -694,18 +694,18 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
694
694
|
precision: 0,
|
|
695
695
|
placeholder: a(l)("collections.field-limit-all"),
|
|
696
696
|
disabled: t.disabled,
|
|
697
|
-
"onUpdate:modelValue":
|
|
697
|
+
"onUpdate:modelValue": d
|
|
698
698
|
}, null, 8, ["id", "model-value", "max", "placeholder", "disabled"])
|
|
699
699
|
])
|
|
700
700
|
]),
|
|
701
|
-
i.value.categories ? (
|
|
701
|
+
i.value.categories ? (c(), N(a(pt), {
|
|
702
702
|
key: 2,
|
|
703
703
|
"model-value": u.value.filter,
|
|
704
704
|
label: a(l)("collections.field-filter"),
|
|
705
705
|
disabled: t.disabled,
|
|
706
706
|
"onUpdate:modelValue": S[1] || (S[1] = (k) => v({ filter: k === !0 }))
|
|
707
707
|
}, null, 8, ["model-value", "label", "disabled"])) : B("", !0),
|
|
708
|
-
i.value.markup ? (
|
|
708
|
+
i.value.markup ? (c(), C("div", oa, [
|
|
709
709
|
$(a(pt), {
|
|
710
710
|
"model-value": H.value,
|
|
711
711
|
label: a(l)("collections.field-markup"),
|
|
@@ -713,7 +713,7 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
713
713
|
"onUpdate:modelValue": z
|
|
714
714
|
}, null, 8, ["model-value", "label", "disabled"]),
|
|
715
715
|
D("p", sa, T(O.value), 1),
|
|
716
|
-
u.value.markup !== null ? (
|
|
716
|
+
u.value.markup !== null ? (c(), N(a(re), {
|
|
717
717
|
key: 0,
|
|
718
718
|
class: "wx-collection-field__reset",
|
|
719
719
|
variant: "text",
|
|
@@ -776,23 +776,23 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
776
776
|
}),
|
|
777
777
|
emits: ["update:modelValue"],
|
|
778
778
|
setup(e) {
|
|
779
|
-
const t = e, n = ze(e, "modelValue"), o = oe(), l = xl(), s = da(o), i = ee("webx-admin"), r = E([]), u = E([]), v = E([]), m = E(!1), f = E(null),
|
|
780
|
-
let
|
|
781
|
-
const h =
|
|
779
|
+
const t = e, n = ze(e, "modelValue"), o = oe(), l = xl(), s = da(o), i = ee("webx-admin"), r = E([]), u = E([]), v = E([]), m = E(!1), f = E(null), d = E(""), y = E(null);
|
|
780
|
+
let w = null;
|
|
781
|
+
const h = _(() => n.value ?? ua()), W = _(() => {
|
|
782
782
|
const x = [
|
|
783
783
|
{ value: "entity", label: i("links.target-entity") },
|
|
784
784
|
{ value: "url", label: i("links.target-url") }
|
|
785
785
|
];
|
|
786
786
|
return t.allowNone ? [...x, { value: "none", label: i("links.target-none") }] : x;
|
|
787
|
-
}), p =
|
|
787
|
+
}), p = _(
|
|
788
788
|
() => r.value.map((x) => ({ value: x.type, label: x.title }))
|
|
789
|
-
), V =
|
|
789
|
+
), V = _(
|
|
790
790
|
() => u.value.map((x) => ({
|
|
791
791
|
value: x.title,
|
|
792
792
|
description: fe(x),
|
|
793
793
|
id: x.id
|
|
794
794
|
}))
|
|
795
|
-
), H =
|
|
795
|
+
), H = _(
|
|
796
796
|
() => v.value.map((x) => ({ value: x.path, description: x.name }))
|
|
797
797
|
);
|
|
798
798
|
Ee(async () => {
|
|
@@ -806,23 +806,23 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
806
806
|
async function z() {
|
|
807
807
|
const { entity_type: x, entity_id: P } = h.value;
|
|
808
808
|
if (x === null || P === null) {
|
|
809
|
-
y.value = null,
|
|
809
|
+
y.value = null, d.value = "";
|
|
810
810
|
return;
|
|
811
811
|
}
|
|
812
812
|
if (y.value?.id === P)
|
|
813
813
|
return;
|
|
814
814
|
const [F] = await s.resolve([{ type: x, id: P }], l.state.locale);
|
|
815
|
-
y.value = F ?? null,
|
|
815
|
+
y.value = F ?? null, d.value = F?.title ?? i("links.missing"), w = d.value;
|
|
816
816
|
}
|
|
817
817
|
async function O() {
|
|
818
818
|
v.value = await s.routes();
|
|
819
819
|
}
|
|
820
820
|
async function g(x) {
|
|
821
|
-
if (x ===
|
|
822
|
-
|
|
821
|
+
if (x === w) {
|
|
822
|
+
w = null;
|
|
823
823
|
return;
|
|
824
824
|
}
|
|
825
|
-
if (
|
|
825
|
+
if (w = null, f.value !== null) {
|
|
826
826
|
m.value = !0;
|
|
827
827
|
try {
|
|
828
828
|
u.value = await s.search(f.value, x, l.state.locale);
|
|
@@ -839,10 +839,10 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
839
839
|
}
|
|
840
840
|
function I(x) {
|
|
841
841
|
const P = u.value.find((F) => F.id === x.id);
|
|
842
|
-
P === void 0 || f.value === null || (y.value = P,
|
|
842
|
+
P === void 0 || f.value === null || (y.value = P, d.value = P.title, n.value = { ...h.value, entity_type: f.value, entity_id: P.id });
|
|
843
843
|
}
|
|
844
844
|
function U() {
|
|
845
|
-
y.value = null,
|
|
845
|
+
y.value = null, d.value = "", u.value = [], n.value = { ...h.value, entity_type: null, entity_id: null };
|
|
846
846
|
}
|
|
847
847
|
function L(x) {
|
|
848
848
|
n.value = { ...h.value, url: x === "" ? null : x };
|
|
@@ -865,7 +865,7 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
865
865
|
return x.available || P.push(i("links.unavailable")), P.join(" · ");
|
|
866
866
|
}
|
|
867
867
|
const K = ["nofollow", "sponsored", "ugc"];
|
|
868
|
-
return (x, P) => (
|
|
868
|
+
return (x, P) => (c(), C("div", ca, [
|
|
869
869
|
$(a(Qn), {
|
|
870
870
|
options: W.value,
|
|
871
871
|
"model-value": h.value.target,
|
|
@@ -873,8 +873,8 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
873
873
|
"aria-label": a(i)("links.target-entity"),
|
|
874
874
|
"onUpdate:modelValue": S
|
|
875
875
|
}, null, 8, ["options", "model-value", "disabled", "aria-label"]),
|
|
876
|
-
h.value.target === "entity" ? (
|
|
877
|
-
p.value.length > 1 ? (
|
|
876
|
+
h.value.target === "entity" ? (c(), C("div", fa, [
|
|
877
|
+
p.value.length > 1 ? (c(), N(a(je), {
|
|
878
878
|
key: 0,
|
|
879
879
|
class: "wx-link-picker__section",
|
|
880
880
|
options: p.value,
|
|
@@ -885,7 +885,7 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
885
885
|
}, null, 8, ["options", "model-value", "disabled", "aria-label"])) : B("", !0),
|
|
886
886
|
$(a(xt), {
|
|
887
887
|
class: "wx-link-picker__search",
|
|
888
|
-
"model-value":
|
|
888
|
+
"model-value": d.value,
|
|
889
889
|
options: V.value,
|
|
890
890
|
remote: "",
|
|
891
891
|
clearable: "",
|
|
@@ -895,12 +895,12 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
895
895
|
placeholder: a(i)("links.search"),
|
|
896
896
|
"aria-label": a(i)("links.search"),
|
|
897
897
|
disabled: t.disabled,
|
|
898
|
-
"onUpdate:modelValue": P[0] || (P[0] = (F) =>
|
|
898
|
+
"onUpdate:modelValue": P[0] || (P[0] = (F) => d.value = F),
|
|
899
899
|
onSearch: g,
|
|
900
900
|
onSelect: I,
|
|
901
901
|
onClear: U
|
|
902
902
|
}, null, 8, ["model-value", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
903
|
-
])) : h.value.target === "url" ? (
|
|
903
|
+
])) : h.value.target === "url" ? (c(), C("div", va, [
|
|
904
904
|
$(a(xt), {
|
|
905
905
|
"model-value": h.value.url ?? "",
|
|
906
906
|
options: H.value,
|
|
@@ -913,7 +913,7 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
913
913
|
"onUpdate:modelValue": L
|
|
914
914
|
}, null, 8, ["model-value", "options", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
915
915
|
])) : B("", !0),
|
|
916
|
-
h.value.target !== "none" ? (
|
|
916
|
+
h.value.target !== "none" ? (c(), C("label", ma, [
|
|
917
917
|
$(a(ne), {
|
|
918
918
|
size: "sm",
|
|
919
919
|
tone: "muted"
|
|
@@ -936,7 +936,7 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
936
936
|
"onUpdate:modelValue": j
|
|
937
937
|
}, null, 8, ["model-value", "placeholder", "aria-label", "disabled"])
|
|
938
938
|
])) : B("", !0),
|
|
939
|
-
t.attributes && h.value.target !== "none" ? (
|
|
939
|
+
t.attributes && h.value.target !== "none" ? (c(), C("div", ha, [
|
|
940
940
|
$(a(Gt), {
|
|
941
941
|
"model-value": h.value.new_tab,
|
|
942
942
|
disabled: t.disabled,
|
|
@@ -957,7 +957,7 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
957
957
|
]),
|
|
958
958
|
_: 1
|
|
959
959
|
}),
|
|
960
|
-
(
|
|
960
|
+
(c(), C(G, null, ce(K, (F) => $(a(Gt), {
|
|
961
961
|
key: F,
|
|
962
962
|
"model-value": h.value.rel.includes(F),
|
|
963
963
|
disabled: t.disabled,
|
|
@@ -987,7 +987,7 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
987
987
|
emits: ["update:modelValue"],
|
|
988
988
|
setup(e) {
|
|
989
989
|
const t = e, n = ze(e, "modelValue");
|
|
990
|
-
return (o, l) => (
|
|
990
|
+
return (o, l) => (c(), N(ya, Nt({
|
|
991
991
|
modelValue: n.value,
|
|
992
992
|
"onUpdate:modelValue": l[0] || (l[0] = (s) => n.value = s)
|
|
993
993
|
}, o.$attrs, {
|
|
@@ -1460,8 +1460,8 @@ const Fe = /* @__PURE__ */ X({
|
|
|
1460
1460
|
tone: { default: "muted" }
|
|
1461
1461
|
},
|
|
1462
1462
|
setup(e) {
|
|
1463
|
-
const t = e, n = mt(), o =
|
|
1464
|
-
return (i, r) => l.value ? (
|
|
1463
|
+
const t = e, n = mt(), o = _(() => t.compact ? n.compact(t.value) : n.short(t.value)), l = _(() => n.exact(t.value)), s = _(() => n.iso(t.value));
|
|
1464
|
+
return (i, r) => l.value ? (c(), N(a(It), {
|
|
1465
1465
|
key: 0,
|
|
1466
1466
|
content: l.value
|
|
1467
1467
|
}, {
|
|
@@ -1479,7 +1479,7 @@ const Fe = /* @__PURE__ */ X({
|
|
|
1479
1479
|
}, 8, ["datetime", "size", "tone"])
|
|
1480
1480
|
]),
|
|
1481
1481
|
_: 1
|
|
1482
|
-
}, 8, ["content"])) : (
|
|
1482
|
+
}, 8, ["content"])) : (c(), N(a(ne), {
|
|
1483
1483
|
key: 1,
|
|
1484
1484
|
size: e.size,
|
|
1485
1485
|
tone: e.tone
|
|
@@ -1571,9 +1571,9 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1571
1571
|
title: { default: void 0 }
|
|
1572
1572
|
},
|
|
1573
1573
|
setup(e, { expose: t }) {
|
|
1574
|
-
const n = e, o = oe(), l = ee("webx-admin"), s = Ye(), i = Aa(), r = E([]), u = E(1), v = E(1), m = E(!1), f = E(!1),
|
|
1575
|
-
() =>
|
|
1576
|
-
),
|
|
1574
|
+
const n = e, o = oe(), l = ee("webx-admin"), s = Ye(), i = Aa(), r = E([]), u = E(1), v = E(1), m = E(!1), f = E(!1), d = _(() => n.id ?? i?.id.value ?? null), y = _(
|
|
1575
|
+
() => d.value === null ? null : Sa(o, n.type, d.value)
|
|
1576
|
+
), w = _(() => n.title ?? l("history.title"));
|
|
1577
1577
|
async function h() {
|
|
1578
1578
|
if (r.value = [], u.value = 1, v.value = 1, y.value !== null) {
|
|
1579
1579
|
m.value = !0;
|
|
@@ -1600,7 +1600,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
1602
|
}
|
|
1603
|
-
ue([() => n.type,
|
|
1603
|
+
ue([() => n.type, d], () => {
|
|
1604
1604
|
h();
|
|
1605
1605
|
}, { immediate: !0 }), t({ reload: h });
|
|
1606
1606
|
function p(x) {
|
|
@@ -1650,37 +1650,37 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1650
1650
|
ue(U, () => {
|
|
1651
1651
|
I.value !== null && S.value && J(I.value);
|
|
1652
1652
|
});
|
|
1653
|
-
const fe =
|
|
1653
|
+
const fe = _(() => {
|
|
1654
1654
|
const x = k.value?.run.summary ?? {};
|
|
1655
1655
|
return Object.entries(x).filter(([P]) => P !== "rows" && P !== "failed").map(([P, F]) => ({ key: P, value: yt(F, l("history.empty-value")) }));
|
|
1656
|
-
}), K =
|
|
1656
|
+
}), K = _(() => {
|
|
1657
1657
|
const x = k.value?.run.summary?.failed;
|
|
1658
1658
|
return typeof x == "string" ? x : null;
|
|
1659
1659
|
});
|
|
1660
|
-
return (x, P) => (
|
|
1661
|
-
|
|
1660
|
+
return (x, P) => (c(), C("section", Ca, [
|
|
1661
|
+
w.value ? (c(), N(a(ne), {
|
|
1662
1662
|
key: 0,
|
|
1663
1663
|
weight: "medium",
|
|
1664
1664
|
class: "wx-history__title"
|
|
1665
1665
|
}, {
|
|
1666
1666
|
default: b(() => [
|
|
1667
|
-
M(T(
|
|
1667
|
+
M(T(w.value), 1)
|
|
1668
1668
|
]),
|
|
1669
1669
|
_: 1
|
|
1670
1670
|
})) : B("", !0),
|
|
1671
|
-
|
|
1671
|
+
d.value === null ? (c(), N(a(it), {
|
|
1672
1672
|
key: 1,
|
|
1673
1673
|
size: "sm",
|
|
1674
1674
|
description: a(l)("history.unsaved")
|
|
1675
|
-
}, null, 8, ["description"])) : m.value ? (
|
|
1675
|
+
}, null, 8, ["description"])) : m.value ? (c(), N(a(Ce), {
|
|
1676
1676
|
key: 2,
|
|
1677
1677
|
rows: 3
|
|
1678
|
-
})) : r.value.length === 0 ? (
|
|
1678
|
+
})) : r.value.length === 0 ? (c(), N(a(it), {
|
|
1679
1679
|
key: 3,
|
|
1680
1680
|
size: "sm",
|
|
1681
1681
|
description: a(l)("history.empty")
|
|
1682
|
-
}, null, 8, ["description"])) : (
|
|
1683
|
-
(
|
|
1682
|
+
}, null, 8, ["description"])) : (c(), C("ul", La, [
|
|
1683
|
+
(c(!0), C(G, null, ce(r.value, (F) => (c(), C("li", {
|
|
1684
1684
|
key: F.id,
|
|
1685
1685
|
class: "wx-history-entry"
|
|
1686
1686
|
}, [
|
|
@@ -1714,13 +1714,13 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1714
1714
|
]),
|
|
1715
1715
|
_: 2
|
|
1716
1716
|
}, 1024),
|
|
1717
|
-
F.changes.length > 0 ? (
|
|
1718
|
-
(
|
|
1717
|
+
F.changes.length > 0 ? (c(), C("ul", Ea, [
|
|
1718
|
+
(c(!0), C(G, null, ce(F.changes, (te) => (c(), C("li", {
|
|
1719
1719
|
key: te.field,
|
|
1720
1720
|
class: "wx-history-change"
|
|
1721
1721
|
}, [
|
|
1722
1722
|
D("span", Na, T(te.label) + ":", 1),
|
|
1723
|
-
te.long ? (
|
|
1723
|
+
te.long ? (c(), C("span", Ra, T(O(te)), 1)) : (c(), C(G, { key: 1 }, [
|
|
1724
1724
|
D("span", Va, T(H(te)), 1),
|
|
1725
1725
|
P[3] || (P[3] = D("span", {
|
|
1726
1726
|
class: "wx-history-change__arrow",
|
|
@@ -1730,7 +1730,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1730
1730
|
], 64))
|
|
1731
1731
|
]))), 128))
|
|
1732
1732
|
])) : B("", !0),
|
|
1733
|
-
F.run ? (
|
|
1733
|
+
F.run ? (c(), C("button", {
|
|
1734
1734
|
key: 1,
|
|
1735
1735
|
type: "button",
|
|
1736
1736
|
class: "wx-history-entry__run",
|
|
@@ -1739,7 +1739,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1739
1739
|
])
|
|
1740
1740
|
]))), 128))
|
|
1741
1741
|
])),
|
|
1742
|
-
u.value < v.value ? (
|
|
1742
|
+
u.value < v.value ? (c(), C("div", Ma, [
|
|
1743
1743
|
$(a(re), {
|
|
1744
1744
|
size: "sm",
|
|
1745
1745
|
loading: f.value,
|
|
@@ -1758,10 +1758,10 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1758
1758
|
width: 640
|
|
1759
1759
|
}, {
|
|
1760
1760
|
default: b(() => [
|
|
1761
|
-
k.value === null ? (
|
|
1761
|
+
k.value === null ? (c(), N(a(Ce), {
|
|
1762
1762
|
key: 0,
|
|
1763
1763
|
rows: 4
|
|
1764
|
-
})) : (
|
|
1764
|
+
})) : (c(), C("div", Oa, [
|
|
1765
1765
|
D("div", Pa, [
|
|
1766
1766
|
$(a(ne), {
|
|
1767
1767
|
size: "sm",
|
|
@@ -1785,8 +1785,8 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1785
1785
|
]),
|
|
1786
1786
|
_: 1
|
|
1787
1787
|
}),
|
|
1788
|
-
fe.value.length > 0 ? (
|
|
1789
|
-
(
|
|
1788
|
+
fe.value.length > 0 ? (c(), C("dl", Ba, [
|
|
1789
|
+
(c(!0), C(G, null, ce(fe.value, (F) => (c(), C(G, {
|
|
1790
1790
|
key: F.key
|
|
1791
1791
|
}, [
|
|
1792
1792
|
D("dt", null, T(F.key), 1),
|
|
@@ -1799,7 +1799,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1799
1799
|
]),
|
|
1800
1800
|
_: 1
|
|
1801
1801
|
}),
|
|
1802
|
-
K.value ? (
|
|
1802
|
+
K.value ? (c(), N(a(ne), {
|
|
1803
1803
|
key: 1,
|
|
1804
1804
|
size: "sm",
|
|
1805
1805
|
tone: "danger"
|
|
@@ -1818,7 +1818,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1818
1818
|
clearable: ""
|
|
1819
1819
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
1820
1820
|
D("ul", ja, [
|
|
1821
|
-
(
|
|
1821
|
+
(c(!0), C(G, null, ce(k.value.rows.data, (F) => (c(), C("li", {
|
|
1822
1822
|
key: F.id,
|
|
1823
1823
|
class: "wx-history-run__row"
|
|
1824
1824
|
}, [
|
|
@@ -1832,12 +1832,12 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1832
1832
|
_: 2
|
|
1833
1833
|
}, 1024),
|
|
1834
1834
|
D("ul", Da, [
|
|
1835
|
-
(
|
|
1835
|
+
(c(!0), C(G, null, ce(F.changes, (te) => (c(), C("li", {
|
|
1836
1836
|
key: te.field,
|
|
1837
1837
|
class: "wx-history-change"
|
|
1838
1838
|
}, [
|
|
1839
1839
|
D("span", Fa, T(te.label) + ":", 1),
|
|
1840
|
-
te.long ? (
|
|
1840
|
+
te.long ? (c(), C("span", Ha, T(O(te)), 1)) : (c(), C(G, { key: 1 }, [
|
|
1841
1841
|
D("span", Ka, T(H(te)), 1),
|
|
1842
1842
|
P[4] || (P[4] = D("span", {
|
|
1843
1843
|
class: "wx-history-change__arrow",
|
|
@@ -1849,7 +1849,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1849
1849
|
])
|
|
1850
1850
|
]))), 128))
|
|
1851
1851
|
]),
|
|
1852
|
-
k.value.rows.current_page < k.value.rows.last_page ? (
|
|
1852
|
+
k.value.rows.current_page < k.value.rows.last_page ? (c(), C("div", Ya, [
|
|
1853
1853
|
$(a(re), {
|
|
1854
1854
|
size: "sm",
|
|
1855
1855
|
loading: L.value,
|
|
@@ -1875,8 +1875,8 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1875
1875
|
size: { default: "sm" }
|
|
1876
1876
|
},
|
|
1877
1877
|
setup(e) {
|
|
1878
|
-
const t = e, n = ee("webx-admin"), o =
|
|
1879
|
-
return (l, s) => (
|
|
1878
|
+
const t = e, n = ee("webx-admin"), o = _(() => t.label ?? n("editor.back"));
|
|
1879
|
+
return (l, s) => (c(), N(a(Ne), {
|
|
1880
1880
|
icon: "arrow-left",
|
|
1881
1881
|
class: "wx-back-button",
|
|
1882
1882
|
as: a(qn),
|
|
@@ -1897,14 +1897,14 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1897
1897
|
size: { default: "sm" }
|
|
1898
1898
|
},
|
|
1899
1899
|
setup(e) {
|
|
1900
|
-
const t = ee("webx-admin"), n = e, o =
|
|
1900
|
+
const t = ee("webx-admin"), n = e, o = _(() => [
|
|
1901
1901
|
...n.actions.filter((s) => !s.danger),
|
|
1902
1902
|
...n.actions.filter((s) => s.danger)
|
|
1903
|
-
]), l =
|
|
1903
|
+
]), l = _(() => {
|
|
1904
1904
|
const s = o.value.find((i) => i.danger);
|
|
1905
1905
|
return s && o.value[0] !== s ? s.key : null;
|
|
1906
1906
|
});
|
|
1907
|
-
return (s, i) => o.value.length > 0 ? (
|
|
1907
|
+
return (s, i) => o.value.length > 0 ? (c(), N(a(Zn), {
|
|
1908
1908
|
key: 0,
|
|
1909
1909
|
class: "wx-row-menu",
|
|
1910
1910
|
collapse: "always",
|
|
@@ -1922,10 +1922,10 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1922
1922
|
}, null, 8, ["size", "title"])
|
|
1923
1923
|
]),
|
|
1924
1924
|
collapsed: b(() => [
|
|
1925
|
-
(
|
|
1925
|
+
(c(!0), C(G, null, ce(o.value, (r) => (c(), C(G, {
|
|
1926
1926
|
key: r.key
|
|
1927
1927
|
}, [
|
|
1928
|
-
r.key === l.value ? (
|
|
1928
|
+
r.key === l.value ? (c(), C("hr", Qa)) : B("", !0),
|
|
1929
1929
|
$(a(el), {
|
|
1930
1930
|
icon: r.icon,
|
|
1931
1931
|
tone: r.danger ? "danger" : "default",
|
|
@@ -1964,14 +1964,14 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1964
1964
|
},
|
|
1965
1965
|
emits: ["back"],
|
|
1966
1966
|
setup(e, { emit: t }) {
|
|
1967
|
-
const n = e, o = t, l = ee("webx-admin"), s = Mn(), i = Vt("root"), r = tl(i), u =
|
|
1967
|
+
const n = e, o = t, l = ee("webx-admin"), s = Mn(), i = Vt("root"), r = tl(i), u = _(() => r.value > 0 && r.value < n.collapseBelow), v = _(() => n.actions ?? []), m = _(
|
|
1968
1968
|
() => v.value.find((h) => h.primary) ?? null
|
|
1969
|
-
), f =
|
|
1969
|
+
), f = _(() => u.value ? m.value ? [m.value] : [] : v.value.filter((h) => !h.menu && !h.danger)), d = _(() => u.value ? v.value.filter((h) => h !== m.value) : v.value.filter((h) => h.menu || h.danger)), y = _(
|
|
1970
1970
|
() => n.back && n.back !== !0 ? n.back : null
|
|
1971
|
-
),
|
|
1972
|
-
() => f.value.length > 0 ||
|
|
1971
|
+
), w = _(
|
|
1972
|
+
() => f.value.length > 0 || d.value.length > 0 || !!s.extra
|
|
1973
1973
|
);
|
|
1974
|
-
return (h, W) => (
|
|
1974
|
+
return (h, W) => (c(), C("div", {
|
|
1975
1975
|
ref_key: "root",
|
|
1976
1976
|
ref: i,
|
|
1977
1977
|
class: ke(["wx-screen-head", {
|
|
@@ -1982,16 +1982,16 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1982
1982
|
}]),
|
|
1983
1983
|
"data-level": e.level
|
|
1984
1984
|
}, [
|
|
1985
|
-
h.$slots.trail ? (
|
|
1985
|
+
h.$slots.trail ? (c(), C("div", to, [
|
|
1986
1986
|
me(h.$slots, "trail", {}, void 0, !0)
|
|
1987
1987
|
])) : B("", !0),
|
|
1988
|
-
y.value ? (
|
|
1988
|
+
y.value ? (c(), N(Ga, {
|
|
1989
1989
|
key: 1,
|
|
1990
1990
|
class: "wx-screen-head__back",
|
|
1991
1991
|
to: y.value,
|
|
1992
1992
|
label: e.backLabel,
|
|
1993
1993
|
"tooltip-side": "bottom"
|
|
1994
|
-
}, null, 8, ["to", "label"])) : e.back ? (
|
|
1994
|
+
}, null, 8, ["to", "label"])) : e.back ? (c(), N(a(Ne), {
|
|
1995
1995
|
key: 2,
|
|
1996
1996
|
class: "wx-screen-head__back",
|
|
1997
1997
|
icon: "arrow-left",
|
|
@@ -2001,7 +2001,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2001
2001
|
onClick: W[0] || (W[0] = (p) => o("back"))
|
|
2002
2002
|
}, null, 8, ["title"])) : B("", !0),
|
|
2003
2003
|
D("div", no, [
|
|
2004
|
-
e.title ? (
|
|
2004
|
+
e.title ? (c(), N(a(yn), {
|
|
2005
2005
|
key: 0,
|
|
2006
2006
|
level: e.level,
|
|
2007
2007
|
truncate: "",
|
|
@@ -2014,7 +2014,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2014
2014
|
}, 8, ["level"])) : B("", !0),
|
|
2015
2015
|
me(h.$slots, "title-after", {}, void 0, !0)
|
|
2016
2016
|
]),
|
|
2017
|
-
e.subtitle || h.$slots.subtitle ? (
|
|
2017
|
+
e.subtitle || h.$slots.subtitle ? (c(), N(a(ne), {
|
|
2018
2018
|
key: 3,
|
|
2019
2019
|
class: "wx-screen-head__subtitle",
|
|
2020
2020
|
size: "sm",
|
|
@@ -2028,9 +2028,9 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2028
2028
|
]),
|
|
2029
2029
|
_: 3
|
|
2030
2030
|
})) : B("", !0),
|
|
2031
|
-
|
|
2031
|
+
w.value ? (c(), C("div", lo, [
|
|
2032
2032
|
me(h.$slots, "extra", {}, void 0, !0),
|
|
2033
|
-
(
|
|
2033
|
+
(c(!0), C(G, null, ce(f.value, (p) => (c(), N(a(re), {
|
|
2034
2034
|
key: p.key,
|
|
2035
2035
|
class: ke(["wx-screen-head__button", { "is-primary": p.primary }]),
|
|
2036
2036
|
type: p.primary ? "primary" : "default",
|
|
@@ -2057,9 +2057,9 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2057
2057
|
key: "0"
|
|
2058
2058
|
} : void 0
|
|
2059
2059
|
]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
|
|
2060
|
-
|
|
2060
|
+
d.value.length > 0 ? (c(), N(Bt, {
|
|
2061
2061
|
key: 0,
|
|
2062
|
-
actions:
|
|
2062
|
+
actions: d.value,
|
|
2063
2063
|
size: "lg",
|
|
2064
2064
|
label: e.title ?? a(l)("editor.more")
|
|
2065
2065
|
}, null, 8, ["actions", "label"])) : B("", !0)
|
|
@@ -2086,11 +2086,11 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2086
2086
|
emits: ["update:view"],
|
|
2087
2087
|
setup(e) {
|
|
2088
2088
|
const t = ze(e, "view");
|
|
2089
|
-
return (n, o) => (
|
|
2089
|
+
return (n, o) => (c(), C("div", {
|
|
2090
2090
|
class: ke(["wx-list-screen", { "is-fill": e.fill }]),
|
|
2091
2091
|
"data-wx-fill": e.fill ? "" : void 0
|
|
2092
2092
|
}, [
|
|
2093
|
-
e.title || e.actions || n.$slots.actions ? (
|
|
2093
|
+
e.title || e.actions || n.$slots.actions ? (c(), N(Tn, {
|
|
2094
2094
|
key: 0,
|
|
2095
2095
|
class: "wx-list-screen__head",
|
|
2096
2096
|
title: e.title,
|
|
@@ -2108,7 +2108,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2108
2108
|
key: "0"
|
|
2109
2109
|
} : void 0
|
|
2110
2110
|
]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : B("", !0),
|
|
2111
|
-
e.views && e.views.length > 0 ? (
|
|
2111
|
+
e.views && e.views.length > 0 ? (c(), N(a(nl), {
|
|
2112
2112
|
key: 1,
|
|
2113
2113
|
modelValue: t.value,
|
|
2114
2114
|
"onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
|
|
@@ -2118,7 +2118,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2118
2118
|
"aria-label": e.title
|
|
2119
2119
|
}, {
|
|
2120
2120
|
default: b(() => [
|
|
2121
|
-
e.card ? (
|
|
2121
|
+
e.card ? (c(), N(a($t), {
|
|
2122
2122
|
key: 0,
|
|
2123
2123
|
class: "wx-list-screen__card",
|
|
2124
2124
|
padding: e.padding
|
|
@@ -2130,8 +2130,8 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2130
2130
|
}, 8, ["padding"])) : me(n.$slots, "default", {}, void 0, !0, 1)
|
|
2131
2131
|
]),
|
|
2132
2132
|
_: 3
|
|
2133
|
-
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (
|
|
2134
|
-
e.card ? (
|
|
2133
|
+
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (c(), C(G, { key: 2 }, [
|
|
2134
|
+
e.card ? (c(), N(a($t), {
|
|
2135
2135
|
key: 0,
|
|
2136
2136
|
class: "wx-list-screen__card",
|
|
2137
2137
|
padding: e.padding
|
|
@@ -2186,7 +2186,7 @@ const fo = /* @__PURE__ */ X({
|
|
|
2186
2186
|
inheritAttrs: !1,
|
|
2187
2187
|
__name: "RichTextField",
|
|
2188
2188
|
setup(e) {
|
|
2189
|
-
const t = oe(), n = ee("webx-admin"), o =
|
|
2189
|
+
const t = oe(), n = ee("webx-admin"), o = _(() => t.pickImage ?? void 0), l = On(), s = E(l.modelValue);
|
|
2190
2190
|
let i;
|
|
2191
2191
|
ue(
|
|
2192
2192
|
() => l.modelValue,
|
|
@@ -2194,15 +2194,15 @@ const fo = /* @__PURE__ */ X({
|
|
|
2194
2194
|
s.value = v;
|
|
2195
2195
|
const m = t.assetUrls, f = v === i || !m ? [] : ro(v);
|
|
2196
2196
|
if (!m || f.length === 0) return;
|
|
2197
|
-
const
|
|
2198
|
-
|
|
2197
|
+
const d = await m(f).catch(() => null);
|
|
2198
|
+
d && l.modelValue === v && (s.value = co(v, d));
|
|
2199
2199
|
},
|
|
2200
2200
|
{ immediate: !0 }
|
|
2201
2201
|
);
|
|
2202
2202
|
function r(v) {
|
|
2203
2203
|
i = v;
|
|
2204
2204
|
}
|
|
2205
|
-
const u =
|
|
2205
|
+
const u = _(() => ({
|
|
2206
2206
|
bold: n("rich-text.bold"),
|
|
2207
2207
|
italic: n("rich-text.italic"),
|
|
2208
2208
|
accent: n("rich-text.accent"),
|
|
@@ -2240,7 +2240,7 @@ const fo = /* @__PURE__ */ X({
|
|
|
2240
2240
|
sourceDrop: n("rich-text.source-drop"),
|
|
2241
2241
|
sourceKeep: n("rich-text.source-keep")
|
|
2242
2242
|
}));
|
|
2243
|
-
return (v, m) => (
|
|
2243
|
+
return (v, m) => (c(), N(a(ll), Nt(v.$attrs, {
|
|
2244
2244
|
"model-value": s.value,
|
|
2245
2245
|
labels: u.value,
|
|
2246
2246
|
"pick-image": o.value,
|
|
@@ -2259,17 +2259,17 @@ const ho = { class: "wx-slug" }, po = { class: "wx-slug__prefix" }, go = /* @__P
|
|
|
2259
2259
|
inheritAttrs: !1,
|
|
2260
2260
|
__name: "SlugField",
|
|
2261
2261
|
setup(e) {
|
|
2262
|
-
const t = mo(), n = Ot(), o =
|
|
2262
|
+
const t = mo(), n = Ot(), o = _(() => t?.prefix.value === null && t.missing !== void 0), l = _(() => {
|
|
2263
2263
|
const r = t?.prefix.value ?? "";
|
|
2264
2264
|
return r === "" ? "/" : `/${r}/`;
|
|
2265
|
-
}), s =
|
|
2265
|
+
}), s = _(() => {
|
|
2266
2266
|
const r = t?.values.value.slug;
|
|
2267
2267
|
return typeof r == "string" ? r : r?.[n.active.value] ?? "";
|
|
2268
|
-
}), i =
|
|
2268
|
+
}), i = _(() => {
|
|
2269
2269
|
const r = t?.path.value;
|
|
2270
2270
|
return !o.value && typeof r == "string" && s.value !== "" && `${l.value}${s.value}` != `/${r}`;
|
|
2271
2271
|
});
|
|
2272
|
-
return (r, u) => (
|
|
2272
|
+
return (r, u) => (c(), C("div", ho, [
|
|
2273
2273
|
$(a(qe), Pn(Bn(r.$attrs)), Ue({ _: 2 }, [
|
|
2274
2274
|
o.value ? void 0 : {
|
|
2275
2275
|
name: "prefix",
|
|
@@ -2279,12 +2279,12 @@ const ho = { class: "wx-slug" }, po = { class: "wx-slug__prefix" }, go = /* @__P
|
|
|
2279
2279
|
key: "0"
|
|
2280
2280
|
}
|
|
2281
2281
|
]), 1040),
|
|
2282
|
-
o.value && a(t)?.missing ? (
|
|
2282
|
+
o.value && a(t)?.missing ? (c(), N(a(ye), {
|
|
2283
2283
|
key: 0,
|
|
2284
2284
|
type: "info",
|
|
2285
2285
|
variant: "soft",
|
|
2286
2286
|
description: a(t).missing()
|
|
2287
|
-
}, null, 8, ["description"])) : i.value && a(t) ? (
|
|
2287
|
+
}, null, 8, ["description"])) : i.value && a(t) ? (c(), N(a(ye), {
|
|
2288
2288
|
key: 1,
|
|
2289
2289
|
type: "info",
|
|
2290
2290
|
variant: "soft",
|
|
@@ -2324,7 +2324,7 @@ function bo(e) {
|
|
|
2324
2324
|
manifest: null,
|
|
2325
2325
|
user: null,
|
|
2326
2326
|
error: null
|
|
2327
|
-
}), n =
|
|
2327
|
+
}), n = _(() => {
|
|
2328
2328
|
const z = t.manifest;
|
|
2329
2329
|
if (z === null)
|
|
2330
2330
|
return [];
|
|
@@ -2344,7 +2344,7 @@ function bo(e) {
|
|
|
2344
2344
|
});
|
|
2345
2345
|
}
|
|
2346
2346
|
return O;
|
|
2347
|
-
}), o =
|
|
2347
|
+
}), o = _(() => {
|
|
2348
2348
|
const z = t.manifest?.groups ?? [], O = [], g = /* @__PURE__ */ new Map();
|
|
2349
2349
|
for (const S of n.value)
|
|
2350
2350
|
if (S.group !== null && z.some((k) => k.id === S.group)) {
|
|
@@ -2386,10 +2386,10 @@ function bo(e) {
|
|
|
2386
2386
|
}), v.set(O, g)), g;
|
|
2387
2387
|
}
|
|
2388
2388
|
let f = null;
|
|
2389
|
-
async function
|
|
2389
|
+
async function d() {
|
|
2390
2390
|
t.status = "loading", t.error = null;
|
|
2391
2391
|
try {
|
|
2392
|
-
if (f !== null && (t.user = await f(),
|
|
2392
|
+
if (f !== null && (t.user = await f(), w(t.user), t.user === null)) {
|
|
2393
2393
|
t.manifest = null, t.status = "unauthenticated";
|
|
2394
2394
|
return;
|
|
2395
2395
|
}
|
|
@@ -2410,7 +2410,7 @@ function bo(e) {
|
|
|
2410
2410
|
} catch {
|
|
2411
2411
|
}
|
|
2412
2412
|
}
|
|
2413
|
-
function
|
|
2413
|
+
function w(z) {
|
|
2414
2414
|
z !== null && e.theme?.adopt(z.theme);
|
|
2415
2415
|
}
|
|
2416
2416
|
function h(z) {
|
|
@@ -2456,11 +2456,11 @@ function bo(e) {
|
|
|
2456
2456
|
blockLabels() {
|
|
2457
2457
|
return u ??= r ? r(H).catch(() => (u = null, null)) : Promise.resolve(null), u;
|
|
2458
2458
|
},
|
|
2459
|
-
reload:
|
|
2459
|
+
reload: d,
|
|
2460
2460
|
refreshManifest: y,
|
|
2461
2461
|
setLocale: h,
|
|
2462
2462
|
setUser(z) {
|
|
2463
|
-
t.user = z,
|
|
2463
|
+
t.user = z, w(z);
|
|
2464
2464
|
},
|
|
2465
2465
|
useSessionLoader(z) {
|
|
2466
2466
|
f = z;
|
|
@@ -2488,7 +2488,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2488
2488
|
landing: { default: null }
|
|
2489
2489
|
},
|
|
2490
2490
|
setup(e) {
|
|
2491
|
-
const t = e, n = oe(), o = He(), l = ee("webx-admin"), s =
|
|
2491
|
+
const t = e, n = oe(), o = He(), l = ee("webx-admin"), s = _(() => {
|
|
2492
2492
|
const i = n.nav.value;
|
|
2493
2493
|
return i.length === 0 ? null : ((t.landing === null ? void 0 : i.find((u) => u.path === t.landing)) ?? i[0])?.path ?? null;
|
|
2494
2494
|
});
|
|
@@ -2498,7 +2498,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2498
2498
|
i !== null && o.replace(i);
|
|
2499
2499
|
},
|
|
2500
2500
|
{ immediate: !0 }
|
|
2501
|
-
), (i, r) => s.value === null && a(n).state.status === "ready" ? (
|
|
2501
|
+
), (i, r) => s.value === null && a(n).state.status === "ready" ? (c(), N(a(bn), {
|
|
2502
2502
|
key: 0,
|
|
2503
2503
|
status: "info",
|
|
2504
2504
|
title: a(l)("shell.empty-title"),
|
|
@@ -2512,60 +2512,60 @@ const ko = /* @__PURE__ */ X({
|
|
|
2512
2512
|
},
|
|
2513
2513
|
emits: ["select"],
|
|
2514
2514
|
setup(e, { emit: t }) {
|
|
2515
|
-
const n = t, o = oe(), l = ee("webx-admin"), s = He(), i = pn(), r =
|
|
2515
|
+
const n = t, o = oe(), l = ee("webx-admin"), s = He(), i = pn(), r = _({
|
|
2516
2516
|
/*
|
|
2517
2517
|
* The longest path that contains this one, on a segment boundary: a section may live inside
|
|
2518
2518
|
* another's path (`/services/categories` under `/services`), and the first match in the order
|
|
2519
2519
|
* of the menu would light up the outer one.
|
|
2520
2520
|
*/
|
|
2521
|
-
get: () => o.nav.value.filter((
|
|
2521
|
+
get: () => o.nav.value.filter((d) => i.path === d.path || i.path.startsWith(`${d.path}/`)).sort((d, y) => y.path.length - d.path.length)[0]?.id ?? "",
|
|
2522
2522
|
set: (f) => {
|
|
2523
|
-
const
|
|
2524
|
-
|
|
2523
|
+
const d = o.nav.value.find((y) => y.id === f);
|
|
2524
|
+
d !== void 0 && s.push(d.path);
|
|
2525
2525
|
}
|
|
2526
2526
|
}), u = Vt("root");
|
|
2527
2527
|
let v = !1;
|
|
2528
2528
|
async function m() {
|
|
2529
2529
|
const f = u.value?.$el;
|
|
2530
|
-
v || r.value === "" || !(f instanceof HTMLElement) || (v = !0, await Promise.allSettled((f.getAnimations?.({ subtree: !0 }) ?? []).map((
|
|
2530
|
+
v || r.value === "" || !(f instanceof HTMLElement) || (v = !0, await Promise.allSettled((f.getAnimations?.({ subtree: !0 }) ?? []).map((d) => d.finished)), f.querySelector(".wx-menu-row.is-active")?.scrollIntoView?.({ block: "center" }));
|
|
2531
2531
|
}
|
|
2532
|
-
return Ee(m), ue(r, m, { flush: "post" }), (f,
|
|
2533
|
-
const y = ve("wx-menu-item"),
|
|
2534
|
-
return
|
|
2532
|
+
return Ee(m), ue(r, m, { flush: "post" }), (f, d) => {
|
|
2533
|
+
const y = ve("wx-menu-item"), w = ve("wx-menu-group"), h = ve("wx-submenu"), W = ve("wx-menu");
|
|
2534
|
+
return c(), N(W, {
|
|
2535
2535
|
ref_key: "root",
|
|
2536
2536
|
ref: u,
|
|
2537
2537
|
modelValue: r.value,
|
|
2538
|
-
"onUpdate:modelValue":
|
|
2538
|
+
"onUpdate:modelValue": d[0] || (d[0] = (p) => r.value = p),
|
|
2539
2539
|
collapsed: e.collapsed,
|
|
2540
2540
|
label: a(l)("nav.sections"),
|
|
2541
|
-
onSelect:
|
|
2541
|
+
onSelect: d[1] || (d[1] = (p) => n("select"))
|
|
2542
2542
|
}, {
|
|
2543
2543
|
default: b(() => [
|
|
2544
|
-
(
|
|
2544
|
+
(c(!0), C(G, null, ce(a(o).groups.value.top, (p) => (c(), N(y, {
|
|
2545
2545
|
key: p.id,
|
|
2546
2546
|
value: p.id,
|
|
2547
2547
|
icon: p.icon ?? void 0,
|
|
2548
2548
|
label: p.title
|
|
2549
2549
|
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
2550
|
-
(
|
|
2550
|
+
(c(!0), C(G, null, ce(a(o).groups.value.groups, (p) => (c(), N(h, {
|
|
2551
2551
|
key: p.id,
|
|
2552
2552
|
value: `group:${p.id}`,
|
|
2553
2553
|
title: p.title,
|
|
2554
2554
|
icon: p.icon ?? "gear"
|
|
2555
2555
|
}, {
|
|
2556
2556
|
default: b(() => [
|
|
2557
|
-
(
|
|
2557
|
+
(c(!0), C(G, null, ce(p.entries, (V) => (c(), N(y, {
|
|
2558
2558
|
key: V.id,
|
|
2559
2559
|
value: V.id,
|
|
2560
2560
|
icon: V.icon ?? void 0,
|
|
2561
2561
|
label: V.title
|
|
2562
2562
|
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
2563
|
-
(
|
|
2563
|
+
(c(!0), C(G, null, ce(p.sections, (V) => (c(), N(w, {
|
|
2564
2564
|
key: V.id,
|
|
2565
2565
|
title: V.title
|
|
2566
2566
|
}, {
|
|
2567
2567
|
default: b(() => [
|
|
2568
|
-
(
|
|
2568
|
+
(c(!0), C(G, null, ce(V.entries, (H) => (c(), N(y, {
|
|
2569
2569
|
key: H.id,
|
|
2570
2570
|
value: H.id,
|
|
2571
2571
|
icon: H.icon ?? void 0,
|
|
@@ -2586,7 +2586,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2586
2586
|
__name: "AdminNotFound",
|
|
2587
2587
|
setup(e) {
|
|
2588
2588
|
const t = oe(), n = He(), o = ee("webx-admin");
|
|
2589
|
-
return (l, s) => a(t).state.status === "ready" ? (
|
|
2589
|
+
return (l, s) => a(t).state.status === "ready" ? (c(), N(a(bn), {
|
|
2590
2590
|
key: 0,
|
|
2591
2591
|
class: "wx-admin-not-found",
|
|
2592
2592
|
status: "404",
|
|
@@ -2622,22 +2622,22 @@ const ko = /* @__PURE__ */ X({
|
|
|
2622
2622
|
const t = oe(), n = ee("webx-admin"), o = E(null), { width: l, layout: s, collapsed: i, showAside: r, drawerOpen: u, toggle: v, close: m } = al(
|
|
2623
2623
|
o,
|
|
2624
2624
|
{ persist: "webx-admin-shell" }
|
|
2625
|
-
), f =
|
|
2625
|
+
), f = _(() => t.state.manifest?.title ?? ""), d = _(() => t.state.manifest?.branding?.logo ?? null), y = _(() => t.state.manifest?.branding?.mark ?? null), w = _(() => ol(l.value, null));
|
|
2626
2626
|
return jn(() => {
|
|
2627
|
-
typeof document > "u" || (document.documentElement.dataset.wxShell =
|
|
2627
|
+
typeof document > "u" || (document.documentElement.dataset.wxShell = w.value);
|
|
2628
2628
|
}), Dn(() => {
|
|
2629
2629
|
typeof document < "u" && delete document.documentElement.dataset.wxShell;
|
|
2630
2630
|
}), (h, W) => {
|
|
2631
2631
|
const p = ve("router-view"), V = ve("wx-loading"), H = ve("wx-button"), z = ve("wx-result"), O = ve("wx-action"), g = ve("wx-text"), S = ve("wx-header"), k = ve("wx-aside"), I = ve("wx-main"), U = ve("wx-container"), L = ve("wx-drawer");
|
|
2632
|
-
return
|
|
2632
|
+
return c(), C(G, null, [
|
|
2633
2633
|
$(a(sl), { placement: "bottom-center" }),
|
|
2634
|
-
a(t).state.status === "unauthenticated" ? (
|
|
2634
|
+
a(t).state.status === "unauthenticated" ? (c(), C("div", So, [
|
|
2635
2635
|
$(p)
|
|
2636
|
-
])) : a(t).state.status === "loading" ? (
|
|
2636
|
+
])) : a(t).state.status === "loading" ? (c(), C("div", To, [
|
|
2637
2637
|
$(V, {
|
|
2638
2638
|
label: a(n)("shell.loading")
|
|
2639
2639
|
}, null, 8, ["label"])
|
|
2640
|
-
])) : a(t).state.status === "error" ? (
|
|
2640
|
+
])) : a(t).state.status === "error" ? (c(), C("div", Ao, [
|
|
2641
2641
|
$(z, {
|
|
2642
2642
|
status: "error",
|
|
2643
2643
|
title: a(n)("shell.error-title"),
|
|
@@ -2656,11 +2656,11 @@ const ko = /* @__PURE__ */ X({
|
|
|
2656
2656
|
]),
|
|
2657
2657
|
_: 1
|
|
2658
2658
|
}, 8, ["title", "description"])
|
|
2659
|
-
])) : (
|
|
2659
|
+
])) : (c(), C("div", {
|
|
2660
2660
|
key: 3,
|
|
2661
2661
|
ref_key: "shellEl",
|
|
2662
2662
|
ref: o,
|
|
2663
|
-
class: ke(["wx-root wx-admin", `wx-admin--${
|
|
2663
|
+
class: ke(["wx-root wx-admin", `wx-admin--${w.value}`])
|
|
2664
2664
|
}, [
|
|
2665
2665
|
$(U, {
|
|
2666
2666
|
direction: a(s) === "drawer" ? "vertical" : "horizontal",
|
|
@@ -2668,7 +2668,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2668
2668
|
class: "wx-admin__frame"
|
|
2669
2669
|
}, {
|
|
2670
2670
|
default: b(() => [
|
|
2671
|
-
a(s) === "drawer" ? (
|
|
2671
|
+
a(s) === "drawer" ? (c(), N(S, {
|
|
2672
2672
|
key: 0,
|
|
2673
2673
|
class: "wx-admin__header",
|
|
2674
2674
|
floating: "",
|
|
@@ -2687,14 +2687,14 @@ const ko = /* @__PURE__ */ X({
|
|
|
2687
2687
|
onClick: a(v)
|
|
2688
2688
|
}, null, 8, ["title", "onClick"]),
|
|
2689
2689
|
me(h.$slots, "brand", {}, () => [
|
|
2690
|
-
|
|
2690
|
+
d.value ? (c(), C("img", {
|
|
2691
2691
|
key: 0,
|
|
2692
2692
|
class: "wx-admin__logo",
|
|
2693
|
-
src:
|
|
2693
|
+
src: d.value.url,
|
|
2694
2694
|
alt: f.value,
|
|
2695
|
-
width:
|
|
2696
|
-
height:
|
|
2697
|
-
}, null, 8, Co)) : (
|
|
2695
|
+
width: d.value.width ?? void 0,
|
|
2696
|
+
height: d.value.height ?? void 0
|
|
2697
|
+
}, null, 8, Co)) : (c(), N(g, {
|
|
2698
2698
|
key: 1,
|
|
2699
2699
|
weight: "semibold",
|
|
2700
2700
|
truncate: ""
|
|
@@ -2708,7 +2708,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2708
2708
|
]),
|
|
2709
2709
|
_: 3
|
|
2710
2710
|
})) : B("", !0),
|
|
2711
|
-
a(r) ? (
|
|
2711
|
+
a(r) ? (c(), N(k, {
|
|
2712
2712
|
key: 1,
|
|
2713
2713
|
class: "wx-admin__aside",
|
|
2714
2714
|
sticky: "",
|
|
@@ -2723,20 +2723,20 @@ const ko = /* @__PURE__ */ X({
|
|
|
2723
2723
|
D("div", {
|
|
2724
2724
|
class: ke(["wx-admin__brand", { "wx-admin__brand--stacked": a(i) && y.value }])
|
|
2725
2725
|
}, [
|
|
2726
|
-
a(i) ? y.value ? (
|
|
2726
|
+
a(i) ? y.value ? (c(), C("img", {
|
|
2727
2727
|
key: 1,
|
|
2728
2728
|
class: "wx-admin__mark",
|
|
2729
2729
|
src: y.value.url,
|
|
2730
2730
|
alt: f.value
|
|
2731
2731
|
}, null, 8, Wo)) : B("", !0) : me(h.$slots, "brand", {}, () => [
|
|
2732
|
-
|
|
2732
|
+
d.value ? (c(), C("img", {
|
|
2733
2733
|
key: 0,
|
|
2734
2734
|
class: "wx-admin__logo",
|
|
2735
|
-
src:
|
|
2735
|
+
src: d.value.url,
|
|
2736
2736
|
alt: f.value,
|
|
2737
|
-
width:
|
|
2738
|
-
height:
|
|
2739
|
-
}, null, 8, Lo)) : (
|
|
2737
|
+
width: d.value.width ?? void 0,
|
|
2738
|
+
height: d.value.height ?? void 0
|
|
2739
|
+
}, null, 8, Lo)) : (c(), N(g, {
|
|
2740
2740
|
key: 1,
|
|
2741
2741
|
weight: "semibold",
|
|
2742
2742
|
truncate: "",
|
|
@@ -2878,7 +2878,7 @@ function si(e = {}) {
|
|
|
2878
2878
|
baseUrl: "",
|
|
2879
2879
|
csrfUrl: `${n}/auth/csrf-cookie`,
|
|
2880
2880
|
onUnauthenticated: () => {
|
|
2881
|
-
|
|
2881
|
+
d.setUser(null), d.state.status = "unauthenticated";
|
|
2882
2882
|
},
|
|
2883
2883
|
// Every request says which language the panel is currently showing. It decides what
|
|
2884
2884
|
// the server writes its own messages in — a 422 under a field — for anybody who has
|
|
@@ -2894,7 +2894,7 @@ function si(e = {}) {
|
|
|
2894
2894
|
const H = await V;
|
|
2895
2895
|
r.load(H.data.namespaces, H.data.locale, H.data.fallback), Bo(H.data.locale), Do(H.data.locale, r.state.panelLocales);
|
|
2896
2896
|
}
|
|
2897
|
-
const
|
|
2897
|
+
const d = bo({
|
|
2898
2898
|
http: v,
|
|
2899
2899
|
theme: u,
|
|
2900
2900
|
basePath: o,
|
|
@@ -2906,37 +2906,37 @@ function si(e = {}) {
|
|
|
2906
2906
|
screens: e.screens,
|
|
2907
2907
|
loadManifest: async () => (await v.get(t)).data
|
|
2908
2908
|
}), y = Fn(Oo(e));
|
|
2909
|
-
y.use(il), wo(y,
|
|
2910
|
-
const
|
|
2909
|
+
y.use(il), wo(y, d), $l(y, r), Uo(y, u);
|
|
2910
|
+
const w = E("");
|
|
2911
2911
|
y.provide(
|
|
2912
2912
|
rl,
|
|
2913
|
-
|
|
2913
|
+
_(() => r.state.locale)
|
|
2914
2914
|
), y.provide(
|
|
2915
2915
|
ul,
|
|
2916
|
-
|
|
2916
|
+
_(() => d.state.manifest?.timezone)
|
|
2917
2917
|
), y.provide(dl, {
|
|
2918
|
-
list:
|
|
2918
|
+
list: _(
|
|
2919
2919
|
() => r.state.contentLocales.map((p) => ({
|
|
2920
2920
|
code: p.code,
|
|
2921
2921
|
label: p.code.toUpperCase()
|
|
2922
2922
|
}))
|
|
2923
2923
|
),
|
|
2924
|
-
active:
|
|
2925
|
-
get: () =>
|
|
2924
|
+
active: _({
|
|
2925
|
+
get: () => w.value || (r.state.contentLocales[0]?.code ?? ""),
|
|
2926
2926
|
set: (p) => {
|
|
2927
|
-
|
|
2927
|
+
w.value = p;
|
|
2928
2928
|
}
|
|
2929
2929
|
})
|
|
2930
2930
|
});
|
|
2931
2931
|
const h = {
|
|
2932
2932
|
app: y,
|
|
2933
2933
|
router: i,
|
|
2934
|
-
context:
|
|
2934
|
+
context: d,
|
|
2935
2935
|
i18n: r,
|
|
2936
2936
|
theme: u,
|
|
2937
2937
|
async mount() {
|
|
2938
2938
|
await Promise.all([W(), f(r.state.locale)]).catch(() => {
|
|
2939
|
-
}), y.mount(e.el ?? "#webx-app"), await
|
|
2939
|
+
}), y.mount(e.el ?? "#webx-app"), await d.reload();
|
|
2940
2940
|
}
|
|
2941
2941
|
};
|
|
2942
2942
|
async function W() {
|
|
@@ -3099,12 +3099,12 @@ function Yo(e, t, n, o, l) {
|
|
|
3099
3099
|
function Jo(e, t, n, o, l) {
|
|
3100
3100
|
const s = Pe(e), i = Pe(t), r = Pe(n), u = /* @__PURE__ */ new Map();
|
|
3101
3101
|
for (const y of /* @__PURE__ */ new Set([...i.keys(), ...r.keys()])) {
|
|
3102
|
-
const
|
|
3102
|
+
const w = s.get(y), h = i.get(y), W = r.get(y), p = [...o, { block: y, type: zn(h ?? W) }];
|
|
3103
3103
|
let V;
|
|
3104
|
-
h && W ? V = Dt(
|
|
3104
|
+
h && W ? V = Dt(w, h, W, p, l) : h ? w === void 0 ? V = h : ge(w, h) ? V = Se : V = Ct(l, p, "removed-theirs", w, h, Se, h, Se) : W && (w === void 0 ? V = W : ge(w, W) ? V = Se : V = Ct(l, p, "removed-mine", w, Se, W, Se, W)), V !== Se && u.set(y, V);
|
|
3105
3105
|
}
|
|
3106
|
-
const v = !Wt(e, n), m = !Wt(e, t), [f,
|
|
3107
|
-
return Xo(f,
|
|
3106
|
+
const v = !Wt(e, n), m = !Wt(e, t), [f, d] = v && !m ? [n, t] : [t, n];
|
|
3107
|
+
return Xo(f, d, u);
|
|
3108
3108
|
}
|
|
3109
3109
|
function Xo(e, t, n) {
|
|
3110
3110
|
const o = e.map((s) => s.key).filter((s) => n.has(s)), l = new Set(o);
|
|
@@ -3174,24 +3174,24 @@ function En(e = {}) {
|
|
|
3174
3174
|
return e.block?.(u) ?? s.value?.type(u) ?? zt(u || n("editing.block"));
|
|
3175
3175
|
}
|
|
3176
3176
|
function r(u) {
|
|
3177
|
-
const v = new Set(o.list.value.map((
|
|
3178
|
-
let f = "",
|
|
3179
|
-
u.forEach((
|
|
3180
|
-
if ("block" in
|
|
3181
|
-
m.push(i(
|
|
3177
|
+
const v = new Set(o.list.value.map((w) => w.code)), m = [];
|
|
3178
|
+
let f = "", d = null;
|
|
3179
|
+
u.forEach((w, h) => {
|
|
3180
|
+
if ("block" in w) {
|
|
3181
|
+
m.push(i(w.type)), d = w.type;
|
|
3182
3182
|
return;
|
|
3183
3183
|
}
|
|
3184
|
-
if (
|
|
3184
|
+
if (w.field === "values" && h > 0 && "block" in u[h - 1]) return;
|
|
3185
3185
|
const W = u[h + 1];
|
|
3186
3186
|
if (W !== void 0 && "block" in W) return;
|
|
3187
|
-
if (h === u.length - 1 && h > 0 && v.has(
|
|
3188
|
-
f =
|
|
3187
|
+
if (h === u.length - 1 && h > 0 && v.has(w.field)) {
|
|
3188
|
+
f = w.field.toUpperCase();
|
|
3189
3189
|
return;
|
|
3190
3190
|
}
|
|
3191
|
-
const p =
|
|
3192
|
-
|
|
3193
|
-
const V = p !== null ? s.value?.field(p,
|
|
3194
|
-
m.push(V ?? zt(
|
|
3191
|
+
const p = d;
|
|
3192
|
+
d = null;
|
|
3193
|
+
const V = p !== null ? s.value?.field(p, w.field) : h === 0 ? e.field?.(w.field) ?? l.value.get(w.field) : void 0;
|
|
3194
|
+
m.push(V ?? zt(w.field));
|
|
3195
3195
|
});
|
|
3196
3196
|
const y = m.length === 0 ? n("editing.order") : m.join(" › ");
|
|
3197
3197
|
return f === "" ? y : `${y} · ${f}`;
|
|
@@ -3217,13 +3217,13 @@ function ri(e) {
|
|
|
3217
3217
|
screen: e.screen,
|
|
3218
3218
|
field: e.field,
|
|
3219
3219
|
block: e.block
|
|
3220
|
-
}), s = st(tt(e.values.value)), i = E(null), r = E(null), u = E([]), v = E(null), m = E(null), f = E([]),
|
|
3220
|
+
}), s = st(tt(e.values.value)), i = E(null), r = E(null), u = E([]), v = E(null), m = E(null), f = E([]), d = E([]);
|
|
3221
3221
|
let y = null;
|
|
3222
|
-
const
|
|
3222
|
+
const w = () => e.canWrite?.() ?? !0, h = _(() => v.value?.trashed === !0), W = E(null), p = _(() => h.value || W.value !== null), V = _(
|
|
3223
3223
|
() => W.value !== null ? n("editing.blocked-purged") : h.value ? n("editing.blocked-trashed") : void 0
|
|
3224
|
-
), H =
|
|
3225
|
-
() => [...
|
|
3226
|
-
), z =
|
|
3224
|
+
), H = _(
|
|
3225
|
+
() => [...d.value].reverse().find((A) => A.kind === "trashed") ?? null
|
|
3226
|
+
), z = _(() => !ge(e.values.value, s.value));
|
|
3227
3227
|
let O = !1, g = !1;
|
|
3228
3228
|
function S(A) {
|
|
3229
3229
|
s.value = tt(A), r.value = null, O || (O = !0, g && e.heartbeat !== !1 && Le());
|
|
@@ -3337,7 +3337,7 @@ function ri(e) {
|
|
|
3337
3337
|
const R = A;
|
|
3338
3338
|
return R?.status === 410 && he(R.body?.gone) ? !0 : R?.status === 404 || R?.status === 410 ? (await Le(), p.value) : R?.status === 409 && typeof R.body?.revision == "string" ? (Z.warning(R.body.message || n("editing.publish-moved")), await Le(), !0) : !1;
|
|
3339
3339
|
}
|
|
3340
|
-
const q = () => e.restore !== void 0 &&
|
|
3340
|
+
const q = () => e.restore !== void 0 && w();
|
|
3341
3341
|
async function Q() {
|
|
3342
3342
|
if (!e.restore) return !1;
|
|
3343
3343
|
try {
|
|
@@ -3391,7 +3391,7 @@ ${R}`).join(`
|
|
|
3391
3391
|
function Vn(A) {
|
|
3392
3392
|
const R = Array.isArray(A.events) ? A.events : [], Y = R.reduce((Me, $e) => Math.max(Me, $e.id), Re ?? 0);
|
|
3393
3393
|
let ie = [];
|
|
3394
|
-
if (
|
|
3394
|
+
if (d.value = R, Re === null)
|
|
3395
3395
|
Re = Y;
|
|
3396
3396
|
else {
|
|
3397
3397
|
const Me = Re;
|
|
@@ -3419,7 +3419,7 @@ ${R}`).join(`
|
|
|
3419
3419
|
}
|
|
3420
3420
|
return;
|
|
3421
3421
|
}
|
|
3422
|
-
if (typeof Y?.revision == "string" && (u.value = Array.isArray(Y.editors) ? Y.editors : [], y = Y.changed ?? null, Vn(Y), !!O && !(R !== e.revision.value || e.busy?.()) && !(Y.revision === R || !
|
|
3422
|
+
if (typeof Y?.revision == "string" && (u.value = Array.isArray(Y.editors) ? Y.editors : [], y = Y.changed ?? null, Vn(Y), !!O && !(R !== e.revision.value || e.busy?.()) && !(Y.revision === R || !w() || i.value || ht) && r.value?.theirs.revision !== Y.revision)) {
|
|
3423
3423
|
ht = !0;
|
|
3424
3424
|
try {
|
|
3425
3425
|
const ie = await e.read();
|
|
@@ -3579,10 +3579,10 @@ function as(e, t, n = Ft()) {
|
|
|
3579
3579
|
);
|
|
3580
3580
|
}
|
|
3581
3581
|
function fi(e = {}) {
|
|
3582
|
-
const t = e.admin ?? oe(), n = e.storage === void 0 ? Ft() : e.storage, o = e.retries ?? 3, l = e.retryDelay ?? 1e3, s = `${t.apiPath}/uploads`, i = E("idle"), r = E(0), u = E(0), v = E(0), m = E(null), f = E(null),
|
|
3582
|
+
const t = e.admin ?? oe(), n = e.storage === void 0 ? Ft() : e.storage, o = e.retries ?? 3, l = e.retryDelay ?? 1e3, s = `${t.apiPath}/uploads`, i = E("idle"), r = E(0), u = E(0), v = E(0), m = E(null), f = E(null), d = _(() => u.value > 0 ? Math.min(1, r.value / u.value) : 0), y = _(
|
|
3583
3583
|
() => v.value > 0 ? Math.ceil((u.value - r.value) / v.value) : null
|
|
3584
3584
|
);
|
|
3585
|
-
let
|
|
3585
|
+
let w = null, h = "", W = nt, p = 0, V = null, H = [], z = null, O = null;
|
|
3586
3586
|
function g(q, Q, ae = {}) {
|
|
3587
3587
|
return os(t.http, q, Q, ae);
|
|
3588
3588
|
}
|
|
@@ -3604,7 +3604,7 @@ function fi(e = {}) {
|
|
|
3604
3604
|
const Q = Date.now();
|
|
3605
3605
|
H.push({ at: Q, bytes: r.value }), H = H.filter((se) => Q - se.at <= ls);
|
|
3606
3606
|
const ae = H[0], he = ae === void 0 ? 0 : (Q - ae.at) / 1e3;
|
|
3607
|
-
v.value = ae !== void 0 && he > 0 ? (r.value - ae.bytes) / he : 0,
|
|
3607
|
+
v.value = ae !== void 0 && he > 0 ? (r.value - ae.bytes) / he : 0, w !== null && L(w, h, r.value);
|
|
3608
3608
|
}
|
|
3609
3609
|
function L(q, Q, ae) {
|
|
3610
3610
|
const he = _t(q), se = Ht(n).filter(
|
|
@@ -3623,7 +3623,7 @@ function fi(e = {}) {
|
|
|
3623
3623
|
]);
|
|
3624
3624
|
}
|
|
3625
3625
|
function j() {
|
|
3626
|
-
|
|
3626
|
+
w !== null && as(_t(w), h, n);
|
|
3627
3627
|
}
|
|
3628
3628
|
function J() {
|
|
3629
3629
|
p += 1, V?.abort(), V = null, v.value = 0, H = [];
|
|
@@ -3631,7 +3631,7 @@ function fi(e = {}) {
|
|
|
3631
3631
|
async function le(q, Q) {
|
|
3632
3632
|
if (i.value === "uploading" || i.value === "paused" || i.value === "offline")
|
|
3633
3633
|
throw new Error("This upload is still going; cancel it before starting another.");
|
|
3634
|
-
J(),
|
|
3634
|
+
J(), w = q, h = Q, m.value = null, f.value = null, r.value = 0, u.value = q.size, i.value = "uploading";
|
|
3635
3635
|
const ae = S(), he = p;
|
|
3636
3636
|
try {
|
|
3637
3637
|
const se = await t.http.post(s, {
|
|
@@ -3659,7 +3659,7 @@ function fi(e = {}) {
|
|
|
3659
3659
|
async function K() {
|
|
3660
3660
|
const q = p;
|
|
3661
3661
|
let Q = 0;
|
|
3662
|
-
for (i.value = "uploading"; q === p &&
|
|
3662
|
+
for (i.value = "uploading"; q === p && w !== null && m.value !== null; ) {
|
|
3663
3663
|
if (r.value >= u.value) {
|
|
3664
3664
|
i.value = "done", v.value = 0, j(), k(m.value);
|
|
3665
3665
|
return;
|
|
@@ -3669,7 +3669,7 @@ function fi(e = {}) {
|
|
|
3669
3669
|
let se;
|
|
3670
3670
|
try {
|
|
3671
3671
|
se = await g("PATCH", `${s}/${m.value}`, {
|
|
3672
|
-
body:
|
|
3672
|
+
body: w.slice(ae, he),
|
|
3673
3673
|
headers: {
|
|
3674
3674
|
"Upload-Offset": String(ae),
|
|
3675
3675
|
"Content-Type": "application/offset+octet-stream"
|
|
@@ -3726,10 +3726,10 @@ function fi(e = {}) {
|
|
|
3726
3726
|
async function F() {
|
|
3727
3727
|
if (i.value === "uploading" || i.value === "done" || i.value === "idle")
|
|
3728
3728
|
return O ?? Promise.resolve(i.value === "done" ? m.value : null);
|
|
3729
|
-
if (
|
|
3729
|
+
if (w === null)
|
|
3730
3730
|
return Promise.resolve(null);
|
|
3731
3731
|
if (m.value === null)
|
|
3732
|
-
return i.value = "idle", le(
|
|
3732
|
+
return i.value = "idle", le(w, h);
|
|
3733
3733
|
J(), f.value = null, i.value = "uploading";
|
|
3734
3734
|
const q = S(), Q = p;
|
|
3735
3735
|
try {
|
|
@@ -3757,7 +3757,7 @@ function fi(e = {}) {
|
|
|
3757
3757
|
typeof window < "u" && (window.removeEventListener("offline", we), window.removeEventListener("online", Je)), x();
|
|
3758
3758
|
}), {
|
|
3759
3759
|
state: Ve(i),
|
|
3760
|
-
progress:
|
|
3760
|
+
progress: d,
|
|
3761
3761
|
uploaded: Ve(r),
|
|
3762
3762
|
total: Ve(u),
|
|
3763
3763
|
speed: Ve(v),
|
|
@@ -3824,11 +3824,11 @@ function rs(e) {
|
|
|
3824
3824
|
return (e.q ?? "").trim() !== "" || e.filtered ? "locked" : e.category == null ? "all" : "category";
|
|
3825
3825
|
}
|
|
3826
3826
|
function mi(e, t) {
|
|
3827
|
-
const n = oe(), o = ee("webx-admin"), l =
|
|
3827
|
+
const n = oe(), o = ee("webx-admin"), l = _(() => rs(t()));
|
|
3828
3828
|
return {
|
|
3829
3829
|
mode: l,
|
|
3830
|
-
sortable:
|
|
3831
|
-
hint:
|
|
3830
|
+
sortable: _(() => l.value !== "locked"),
|
|
3831
|
+
hint: _(() => o(`categories.order-${l.value}`)),
|
|
3832
3832
|
move: (s) => Tl(n, e, s, l.value === "category" ? t().category ?? null : null)
|
|
3833
3833
|
};
|
|
3834
3834
|
}
|
|
@@ -3839,7 +3839,7 @@ const us = /* @__PURE__ */ X({
|
|
|
3839
3839
|
},
|
|
3840
3840
|
setup(e) {
|
|
3841
3841
|
const t = e, n = ee("webx-admin");
|
|
3842
|
-
return (o, l) => t.locale ? (
|
|
3842
|
+
return (o, l) => t.locale ? (c(), N(a(It), {
|
|
3843
3843
|
key: 0,
|
|
3844
3844
|
content: a(n)("links.address-fallback", { locale: t.locale.toUpperCase() }),
|
|
3845
3845
|
"max-width": 280
|
|
@@ -3878,10 +3878,10 @@ const cs = /* @__PURE__ */ X({
|
|
|
3878
3878
|
await dt(), m.value?.querySelector("input")?.focus();
|
|
3879
3879
|
});
|
|
3880
3880
|
function f(y) {
|
|
3881
|
-
const
|
|
3882
|
-
return
|
|
3881
|
+
const w = Object.keys(v.value).find((h) => h === y || h.startsWith(`${y}.`));
|
|
3882
|
+
return w === void 0 ? void 0 : v.value[w]?.[0];
|
|
3883
3883
|
}
|
|
3884
|
-
async function
|
|
3884
|
+
async function d() {
|
|
3885
3885
|
if (!(r.value.trim() === "" || u.value)) {
|
|
3886
3886
|
u.value = !0, v.value = {};
|
|
3887
3887
|
try {
|
|
@@ -3893,9 +3893,9 @@ const cs = /* @__PURE__ */ X({
|
|
|
3893
3893
|
}
|
|
3894
3894
|
}
|
|
3895
3895
|
}
|
|
3896
|
-
return (y,
|
|
3896
|
+
return (y, w) => (c(), N(a(Mt), {
|
|
3897
3897
|
open: a(n),
|
|
3898
|
-
"onUpdate:open":
|
|
3898
|
+
"onUpdate:open": w[2] || (w[2] = (h) => mn(n) ? n.value = h : null),
|
|
3899
3899
|
title: a(i)("new"),
|
|
3900
3900
|
width: 440
|
|
3901
3901
|
}, {
|
|
@@ -3904,7 +3904,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
3904
3904
|
default: b(() => [
|
|
3905
3905
|
$(a(re), {
|
|
3906
3906
|
variant: "outline",
|
|
3907
|
-
onClick:
|
|
3907
|
+
onClick: w[1] || (w[1] = (h) => a(l)())
|
|
3908
3908
|
}, {
|
|
3909
3909
|
default: b(() => [
|
|
3910
3910
|
M(T(a(i)("cancel")), 1)
|
|
@@ -3915,7 +3915,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
3915
3915
|
type: "primary",
|
|
3916
3916
|
loading: u.value,
|
|
3917
3917
|
disabled: r.value.trim() === "",
|
|
3918
|
-
onClick:
|
|
3918
|
+
onClick: d
|
|
3919
3919
|
}, {
|
|
3920
3920
|
default: b(() => [
|
|
3921
3921
|
M(T(a(i)("create")), 1)
|
|
@@ -3939,9 +3939,9 @@ const cs = /* @__PURE__ */ X({
|
|
|
3939
3939
|
}, [
|
|
3940
3940
|
$(a(qe), {
|
|
3941
3941
|
modelValue: r.value,
|
|
3942
|
-
"onUpdate:modelValue":
|
|
3942
|
+
"onUpdate:modelValue": w[0] || (w[0] = (h) => r.value = h),
|
|
3943
3943
|
"aria-label": a(i)("field-title"),
|
|
3944
|
-
onKeyup: hn(
|
|
3944
|
+
onKeyup: hn(d, ["enter"])
|
|
3945
3945
|
}, null, 8, ["modelValue", "aria-label"])
|
|
3946
3946
|
], 512)
|
|
3947
3947
|
]),
|
|
@@ -3958,9 +3958,9 @@ const cs = /* @__PURE__ */ X({
|
|
|
3958
3958
|
options: {}
|
|
3959
3959
|
},
|
|
3960
3960
|
setup(e) {
|
|
3961
|
-
const t = e, n = oe(), o = Ie(n, t.options.api), l = He(), s = Kt(t.options.words), i = ee("webx-admin"), r = Ye(), u = E([]), v = E(!0), m = E(!0), f =
|
|
3961
|
+
const t = e, n = oe(), o = Ie(n, t.options.api), l = He(), s = Kt(t.options.words), i = ee("webx-admin"), r = Ye(), u = E([]), v = E(!0), m = E(!0), f = _(() => n.can(t.options.manage)), d = _(
|
|
3962
3962
|
() => t.options.title ? i(t.options.title) : n.state.manifest?.modules.find((g) => g.id === t.options.module)?.title ?? ""
|
|
3963
|
-
), y = ml(cs),
|
|
3963
|
+
), y = ml(cs), w = _(
|
|
3964
3964
|
() => f.value ? [{ key: "new", label: s("new"), icon: "plus", primary: !0, run: () => {
|
|
3965
3965
|
V();
|
|
3966
3966
|
} }] : []
|
|
@@ -4033,24 +4033,24 @@ const cs = /* @__PURE__ */ X({
|
|
|
4033
4033
|
}
|
|
4034
4034
|
return (g, S) => {
|
|
4035
4035
|
const k = ve("router-link");
|
|
4036
|
-
return
|
|
4036
|
+
return c(), N(An, {
|
|
4037
4037
|
class: "wx-categories",
|
|
4038
|
-
title:
|
|
4038
|
+
title: d.value,
|
|
4039
4039
|
back: t.options.back?.path,
|
|
4040
4040
|
"back-label": t.options.back ? a(i)(t.options.back.label) : void 0,
|
|
4041
|
-
actions:
|
|
4041
|
+
actions: w.value,
|
|
4042
4042
|
padding: "sm"
|
|
4043
4043
|
}, {
|
|
4044
4044
|
default: b(() => [
|
|
4045
|
-
v.value ? (
|
|
4045
|
+
v.value ? (c(), N(a(Ce), {
|
|
4046
4046
|
key: 0,
|
|
4047
4047
|
class: "wx-categories__loading",
|
|
4048
4048
|
rows: 5
|
|
4049
|
-
})) : u.value.length === 0 ? (
|
|
4049
|
+
})) : u.value.length === 0 ? (c(), N(a(it), {
|
|
4050
4050
|
key: 1,
|
|
4051
4051
|
title: a(s)("empty"),
|
|
4052
4052
|
description: a(s)("empty-help")
|
|
4053
|
-
}, null, 8, ["title", "description"])) : (
|
|
4053
|
+
}, null, 8, ["title", "description"])) : (c(), C(G, { key: 2 }, [
|
|
4054
4054
|
$(a(Ut), {
|
|
4055
4055
|
modelValue: u.value,
|
|
4056
4056
|
"onUpdate:modelValue": S[0] || (S[0] = (I) => u.value = I),
|
|
@@ -4077,7 +4077,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
4077
4077
|
]),
|
|
4078
4078
|
_: 2
|
|
4079
4079
|
}, 1024),
|
|
4080
|
-
I.is_visible ? B("", !0) : (
|
|
4080
|
+
I.is_visible ? B("", !0) : (c(), N(a(It), {
|
|
4081
4081
|
key: 0,
|
|
4082
4082
|
content: a(s)("hidden")
|
|
4083
4083
|
}, {
|
|
@@ -4090,7 +4090,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
4090
4090
|
_: 1
|
|
4091
4091
|
}, 8, ["content"]))
|
|
4092
4092
|
]),
|
|
4093
|
-
m.value ? (
|
|
4093
|
+
m.value ? (c(), N(a(ne), {
|
|
4094
4094
|
key: 0,
|
|
4095
4095
|
size: "sm",
|
|
4096
4096
|
tone: "muted",
|
|
@@ -4098,7 +4098,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
4098
4098
|
}, {
|
|
4099
4099
|
default: b(() => [
|
|
4100
4100
|
M(T(I.path === null ? a(s)("no-address") : `/${I.path}`) + " ", 1),
|
|
4101
|
-
I.path !== null ? (
|
|
4101
|
+
I.path !== null ? (c(), N(ds, {
|
|
4102
4102
|
key: 0,
|
|
4103
4103
|
locale: I.address_locale
|
|
4104
4104
|
}, null, 8, ["locale"])) : B("", !0)
|
|
@@ -4159,13 +4159,13 @@ const cs = /* @__PURE__ */ X({
|
|
|
4159
4159
|
}, t.linger));
|
|
4160
4160
|
}
|
|
4161
4161
|
);
|
|
4162
|
-
const s =
|
|
4162
|
+
const s = _(
|
|
4163
4163
|
() => t.state === "saving" ? "saving" : o.value ? "saved" : null
|
|
4164
4164
|
);
|
|
4165
4165
|
return ct(() => {
|
|
4166
4166
|
l !== null && clearTimeout(l);
|
|
4167
|
-
}), (i, r) => (
|
|
4168
|
-
s.value ? (
|
|
4167
|
+
}), (i, r) => (c(), C("span", ms, [
|
|
4168
|
+
s.value ? (c(), N(a(ft), {
|
|
4169
4169
|
key: 0,
|
|
4170
4170
|
class: ke(["wx-save-state__mark", { "is-saved": s.value === "saved" }]),
|
|
4171
4171
|
name: s.value === "saving" ? "loader" : "check",
|
|
@@ -4182,7 +4182,8 @@ const cs = /* @__PURE__ */ X({
|
|
|
4182
4182
|
disabled: { type: Boolean, default: !1 },
|
|
4183
4183
|
labelPosition: { default: void 0 },
|
|
4184
4184
|
labelWidth: { default: void 0 },
|
|
4185
|
-
size: { default: void 0 }
|
|
4185
|
+
size: { default: void 0 },
|
|
4186
|
+
patch: { default: () => [] }
|
|
4186
4187
|
}, {
|
|
4187
4188
|
modelValue: { default: () => ({}) },
|
|
4188
4189
|
modelModifiers: {}
|
|
@@ -4193,29 +4194,31 @@ const cs = /* @__PURE__ */ X({
|
|
|
4193
4194
|
async function m() {
|
|
4194
4195
|
u.value = null, v.value = null;
|
|
4195
4196
|
try {
|
|
4196
|
-
const
|
|
4197
|
-
u.value =
|
|
4198
|
-
} catch (
|
|
4199
|
-
v.value =
|
|
4197
|
+
const d = await i.loadScreen(o.name);
|
|
4198
|
+
u.value = d, l("loaded", d);
|
|
4199
|
+
} catch (d) {
|
|
4200
|
+
v.value = d instanceof Error ? d.message : String(d);
|
|
4200
4201
|
}
|
|
4201
4202
|
}
|
|
4202
|
-
|
|
4203
|
+
ue([() => o.name, () => i.i18n.state.locale], () => {
|
|
4203
4204
|
m();
|
|
4204
|
-
}, { immediate: !0 })
|
|
4205
|
-
|
|
4205
|
+
}, { immediate: !0 });
|
|
4206
|
+
const f = _(() => [...o.patch, ...i.screenPatch(o.name)]);
|
|
4207
|
+
return t({ reload: m }), (d, y) => (c(), C("div", gs, [
|
|
4208
|
+
v.value ? (c(), N(a(ye), {
|
|
4206
4209
|
key: 0,
|
|
4207
4210
|
type: "danger",
|
|
4208
4211
|
title: a(r)("shell.error-title"),
|
|
4209
4212
|
description: v.value
|
|
4210
|
-
}, null, 8, ["title", "description"])) : u.value === null ? (
|
|
4213
|
+
}, null, 8, ["title", "description"])) : u.value === null ? (c(), N(a(Ce), {
|
|
4211
4214
|
key: 1,
|
|
4212
4215
|
rows: 4
|
|
4213
|
-
})) : (
|
|
4216
|
+
})) : (c(), N(a(kl), {
|
|
4214
4217
|
key: 2,
|
|
4215
4218
|
modelValue: s.value,
|
|
4216
|
-
"onUpdate:modelValue":
|
|
4219
|
+
"onUpdate:modelValue": y[0] || (y[0] = (w) => s.value = w),
|
|
4217
4220
|
root: u.value,
|
|
4218
|
-
patch:
|
|
4221
|
+
patch: f.value,
|
|
4219
4222
|
types: a(i).types,
|
|
4220
4223
|
errors: e.errors,
|
|
4221
4224
|
translate: a(i).i18n.t,
|
|
@@ -4234,20 +4237,20 @@ const cs = /* @__PURE__ */ X({
|
|
|
4234
4237
|
options: {}
|
|
4235
4238
|
},
|
|
4236
4239
|
setup(e) {
|
|
4237
|
-
const t = e, n = oe(), o = Ie(n, t.options.api), l = pn(), s = He(), i = Ot(), r = Kt(t.options.words), u = ee("webx-admin"), v = Ye(), m =
|
|
4240
|
+
const t = e, n = oe(), o = Ie(n, t.options.api), l = pn(), s = He(), i = Ot(), r = Kt(t.options.words), u = ee("webx-admin"), v = Ye(), m = _(() => Number(l.params.id)), f = _(() => t.options.path), d = E(null), y = E({}), w = E(null), h = E(""), W = E(!0), p = E(!1), V = E({}), H = _(() => n.can(t.options.manage)), z = _(() => JSON.stringify(y.value)), O = _(() => h.value !== "" && z.value !== h.value), g = _(() => p.value ? "saving" : O.value ? "unsaved" : "saved"), S = _(
|
|
4238
4241
|
() => t.options.title ? u(t.options.title) : n.state.manifest?.modules.find((K) => K.id === t.options.module)?.title ?? ""
|
|
4239
|
-
), k =
|
|
4242
|
+
), k = _(() => {
|
|
4240
4243
|
const K = y.value.title;
|
|
4241
|
-
return hl(K, i.active.value,
|
|
4244
|
+
return hl(K, i.active.value, d.value?.name ?? "") || r("untitled");
|
|
4242
4245
|
});
|
|
4243
|
-
is({ category:
|
|
4246
|
+
is({ category: d, values: y, prefix: w, moving: () => r("address-moving") }), Ta({ id: _(() => d.value?.id ?? null) }), vo({
|
|
4244
4247
|
values: y,
|
|
4245
|
-
prefix:
|
|
4246
|
-
path:
|
|
4248
|
+
prefix: w,
|
|
4249
|
+
path: _(() => d.value?.path),
|
|
4247
4250
|
moving: () => r("address-moving")
|
|
4248
4251
|
});
|
|
4249
4252
|
function I(K) {
|
|
4250
|
-
|
|
4253
|
+
d.value = K.category, y.value = K.values, w.value = K.prefix, h.value = JSON.stringify(K.values);
|
|
4251
4254
|
}
|
|
4252
4255
|
async function U() {
|
|
4253
4256
|
W.value = !0;
|
|
@@ -4260,10 +4263,10 @@ const cs = /* @__PURE__ */ X({
|
|
|
4260
4263
|
}
|
|
4261
4264
|
}
|
|
4262
4265
|
async function L() {
|
|
4263
|
-
if (!(!
|
|
4266
|
+
if (!(!d.value || p.value || !H.value)) {
|
|
4264
4267
|
p.value = !0, V.value = {};
|
|
4265
4268
|
try {
|
|
4266
|
-
I(await o.save(
|
|
4269
|
+
I(await o.save(d.value.id, y.value)), Z.success(r("saved"));
|
|
4267
4270
|
} catch (K) {
|
|
4268
4271
|
const x = K.body;
|
|
4269
4272
|
x?.errors ? (V.value = x.errors, Z.danger(r("save-failed"))) : Z.danger(v(K));
|
|
@@ -4273,7 +4276,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
4273
4276
|
}
|
|
4274
4277
|
}
|
|
4275
4278
|
async function j() {
|
|
4276
|
-
const K =
|
|
4279
|
+
const K = d.value;
|
|
4277
4280
|
if (!(!K || !await We({
|
|
4278
4281
|
title: r("delete-title", { name: K.name }),
|
|
4279
4282
|
message: r("delete-text"),
|
|
@@ -4306,8 +4309,8 @@ const cs = /* @__PURE__ */ X({
|
|
|
4306
4309
|
cancelText: r("cancel"),
|
|
4307
4310
|
tone: "danger"
|
|
4308
4311
|
}));
|
|
4309
|
-
const fe =
|
|
4310
|
-
const K =
|
|
4312
|
+
const fe = _(() => {
|
|
4313
|
+
const K = d.value, x = [];
|
|
4311
4314
|
return K && (K.url && K.is_visible && x.push({ key: "site", label: r("open-on-site"), icon: "link", href: K.url }), H.value && x.push({
|
|
4312
4315
|
key: "delete",
|
|
4313
4316
|
label: r("delete"),
|
|
@@ -4319,11 +4322,11 @@ const cs = /* @__PURE__ */ X({
|
|
|
4319
4322
|
}
|
|
4320
4323
|
})), x;
|
|
4321
4324
|
});
|
|
4322
|
-
return (K, x) => (
|
|
4325
|
+
return (K, x) => (c(), C("div", {
|
|
4323
4326
|
class: "wx-category-editor",
|
|
4324
4327
|
onKeydown: le
|
|
4325
4328
|
}, [
|
|
4326
|
-
W.value || !
|
|
4329
|
+
W.value || !d.value ? (c(), C(G, { key: 0 }, [
|
|
4327
4330
|
$(a(Ce), {
|
|
4328
4331
|
class: "wx-category-editor__ghost",
|
|
4329
4332
|
title: "",
|
|
@@ -4335,13 +4338,13 @@ const cs = /* @__PURE__ */ X({
|
|
|
4335
4338
|
]),
|
|
4336
4339
|
_: 1
|
|
4337
4340
|
})
|
|
4338
|
-
], 64)) : (
|
|
4341
|
+
], 64)) : (c(), C(G, { key: 1 }, [
|
|
4339
4342
|
$(Tn, {
|
|
4340
4343
|
divider: "",
|
|
4341
4344
|
back: f.value,
|
|
4342
4345
|
"back-label": S.value,
|
|
4343
4346
|
title: k.value,
|
|
4344
|
-
subtitle:
|
|
4347
|
+
subtitle: d.value.path === null ? void 0 : `/${d.value.path}`,
|
|
4345
4348
|
actions: fe.value
|
|
4346
4349
|
}, Ue({
|
|
4347
4350
|
trail: b(() => [
|
|
@@ -4371,7 +4374,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
4371
4374
|
]),
|
|
4372
4375
|
_: 2
|
|
4373
4376
|
}, [
|
|
4374
|
-
|
|
4377
|
+
d.value.is_visible ? void 0 : {
|
|
4375
4378
|
name: "title-after",
|
|
4376
4379
|
fn: b(() => [
|
|
4377
4380
|
$(a(Ke), { dot: "" }, {
|
|
@@ -4391,7 +4394,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
4391
4394
|
errors: V.value,
|
|
4392
4395
|
disabled: !H.value || p.value
|
|
4393
4396
|
}, null, 8, ["modelValue", "name", "errors", "disabled"]),
|
|
4394
|
-
H.value ? (
|
|
4397
|
+
H.value ? (c(), N(a(gl), { key: 0 }, {
|
|
4395
4398
|
state: b(() => [
|
|
4396
4399
|
$(ps, { state: g.value }, null, 8, ["state"])
|
|
4397
4400
|
]),
|
|
@@ -4436,7 +4439,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4436
4439
|
filters: {}
|
|
4437
4440
|
},
|
|
4438
4441
|
setup(e) {
|
|
4439
|
-
return (t, n) => (
|
|
4442
|
+
return (t, n) => (c(!0), C(G, null, ce(e.filters, (o) => (c(), N(a(Ke), {
|
|
4440
4443
|
key: o.key,
|
|
4441
4444
|
class: "wx-filter-chip",
|
|
4442
4445
|
size: "sm",
|
|
@@ -4461,7 +4464,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4461
4464
|
},
|
|
4462
4465
|
emits: ["rename"],
|
|
4463
4466
|
setup(e, { emit: t }) {
|
|
4464
|
-
const n = e, o = t, l = ee("webx-admin"), s = E(!1), i = E(n.name), r = E(null), u =
|
|
4467
|
+
const n = e, o = t, l = ee("webx-admin"), s = E(!1), i = E(n.name), r = E(null), u = _(() => n.label ?? l("editor.rename"));
|
|
4465
4468
|
ue(s, async (m) => {
|
|
4466
4469
|
m && (i.value = n.name, await dt(), r.value?.focus(), r.value?.select());
|
|
4467
4470
|
});
|
|
@@ -4473,9 +4476,9 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4473
4476
|
}
|
|
4474
4477
|
o("rename", m), s.value = !1;
|
|
4475
4478
|
}
|
|
4476
|
-
return (m, f) => (
|
|
4479
|
+
return (m, f) => (c(), N(a(yl), {
|
|
4477
4480
|
open: s.value,
|
|
4478
|
-
"onUpdate:open": f[2] || (f[2] = (
|
|
4481
|
+
"onUpdate:open": f[2] || (f[2] = (d) => s.value = d),
|
|
4479
4482
|
title: u.value,
|
|
4480
4483
|
width: 320,
|
|
4481
4484
|
side: "bottom",
|
|
@@ -4499,10 +4502,10 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4499
4502
|
ref_key: "field",
|
|
4500
4503
|
ref: r,
|
|
4501
4504
|
modelValue: i.value,
|
|
4502
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
4505
|
+
"onUpdate:modelValue": f[0] || (f[0] = (d) => i.value = d),
|
|
4503
4506
|
"aria-label": u.value,
|
|
4504
4507
|
placeholder: e.placeholder,
|
|
4505
|
-
onKeydown: f[1] || (f[1] = hn((
|
|
4508
|
+
onKeydown: f[1] || (f[1] = hn((d) => s.value = !1, ["esc"]))
|
|
4506
4509
|
}, null, 8, ["modelValue", "aria-label", "placeholder"]),
|
|
4507
4510
|
D("div", _s, [
|
|
4508
4511
|
$(a(re), {
|
|
@@ -4531,8 +4534,8 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4531
4534
|
width: { default: 720 }
|
|
4532
4535
|
},
|
|
4533
4536
|
setup(e) {
|
|
4534
|
-
const t = e, n = ee("webx-admin"), o = E(!1), l =
|
|
4535
|
-
return (i, r) => (
|
|
4537
|
+
const t = e, n = ee("webx-admin"), o = E(!1), l = _(() => t.title ?? n("help.title")), s = _(() => Ho(t.body));
|
|
4538
|
+
return (i, r) => (c(), C(G, null, [
|
|
4536
4539
|
$(a(Ne), {
|
|
4537
4540
|
type: "details",
|
|
4538
4541
|
icon: "question",
|
|
@@ -4577,7 +4580,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4577
4580
|
},
|
|
4578
4581
|
emits: ["change"],
|
|
4579
4582
|
setup(e, { emit: t }) {
|
|
4580
|
-
const n = e, o = t, l = oe(), s = ee("webx-admin"), i = Ye(), r = E([]), u = E(!0), v = E(""), m = E(!1), f = E(null),
|
|
4583
|
+
const n = e, o = t, l = oe(), s = ee("webx-admin"), i = Ye(), r = E([]), u = E(!0), v = E(""), m = E(!1), f = E(null), d = E(""), y = _(() => es(l, n.type, n.id)), w = _(() => n.title ?? s("notes.title"));
|
|
4581
4584
|
async function h() {
|
|
4582
4585
|
u.value = !0;
|
|
4583
4586
|
try {
|
|
@@ -4609,10 +4612,10 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4609
4612
|
}
|
|
4610
4613
|
}
|
|
4611
4614
|
function p(g) {
|
|
4612
|
-
f.value = g.id,
|
|
4615
|
+
f.value = g.id, d.value = g.body;
|
|
4613
4616
|
}
|
|
4614
4617
|
async function V(g) {
|
|
4615
|
-
const S =
|
|
4618
|
+
const S = d.value.trim();
|
|
4616
4619
|
if (S !== "")
|
|
4617
4620
|
try {
|
|
4618
4621
|
const k = await y.value.save(g.id, S);
|
|
@@ -4652,26 +4655,26 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4652
4655
|
function O(g) {
|
|
4653
4656
|
return g.author?.name ?? s("notes.unknown-author");
|
|
4654
4657
|
}
|
|
4655
|
-
return (g, S) => (
|
|
4656
|
-
|
|
4658
|
+
return (g, S) => (c(), C("section", Ss, [
|
|
4659
|
+
w.value ? (c(), N(a(ne), {
|
|
4657
4660
|
key: 0,
|
|
4658
4661
|
weight: "medium",
|
|
4659
4662
|
class: "wx-notes__title"
|
|
4660
4663
|
}, {
|
|
4661
4664
|
default: b(() => [
|
|
4662
|
-
M(T(
|
|
4665
|
+
M(T(w.value), 1)
|
|
4663
4666
|
]),
|
|
4664
4667
|
_: 1
|
|
4665
4668
|
})) : B("", !0),
|
|
4666
|
-
u.value ? (
|
|
4669
|
+
u.value ? (c(), N(a(Ce), {
|
|
4667
4670
|
key: 1,
|
|
4668
4671
|
rows: 2
|
|
4669
|
-
})) : r.value.length === 0 ? (
|
|
4672
|
+
})) : r.value.length === 0 ? (c(), N(a(it), {
|
|
4670
4673
|
key: 2,
|
|
4671
4674
|
size: "sm",
|
|
4672
4675
|
description: a(s)("notes.empty")
|
|
4673
|
-
}, null, 8, ["description"])) : (
|
|
4674
|
-
(
|
|
4676
|
+
}, null, 8, ["description"])) : (c(), C("ul", Ts, [
|
|
4677
|
+
(c(!0), C(G, null, ce(r.value, (k) => (c(), C("li", {
|
|
4675
4678
|
key: k.id,
|
|
4676
4679
|
class: "wx-note"
|
|
4677
4680
|
}, [
|
|
@@ -4700,10 +4703,10 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4700
4703
|
label: O(k)
|
|
4701
4704
|
}, null, 8, ["actions", "label"])
|
|
4702
4705
|
]),
|
|
4703
|
-
f.value === k.id ? (
|
|
4706
|
+
f.value === k.id ? (c(), C(G, { key: 0 }, [
|
|
4704
4707
|
$(a(Zt), {
|
|
4705
|
-
modelValue:
|
|
4706
|
-
"onUpdate:modelValue": S[0] || (S[0] = (I) =>
|
|
4708
|
+
modelValue: d.value,
|
|
4709
|
+
"onUpdate:modelValue": S[0] || (S[0] = (I) => d.value = I),
|
|
4707
4710
|
autosize: { minRows: 2, maxRows: 10 }
|
|
4708
4711
|
}, null, 8, ["modelValue"]),
|
|
4709
4712
|
D("div", Ls, [
|
|
@@ -4728,11 +4731,11 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4728
4731
|
_: 1
|
|
4729
4732
|
})
|
|
4730
4733
|
])
|
|
4731
|
-
], 64)) : (
|
|
4734
|
+
], 64)) : (c(), C("p", Ws, T(k.body), 1))
|
|
4732
4735
|
])
|
|
4733
4736
|
]))), 128))
|
|
4734
4737
|
])),
|
|
4735
|
-
e.can ? (
|
|
4738
|
+
e.can ? (c(), C("div", zs, [
|
|
4736
4739
|
$(a(Zt), {
|
|
4737
4740
|
modelValue: v.value,
|
|
4738
4741
|
"onUpdate:modelValue": S[2] || (S[2] = (k) => v.value = k),
|
|
@@ -4767,7 +4770,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4767
4770
|
},
|
|
4768
4771
|
emits: ["save", "theirs", "pulled"],
|
|
4769
4772
|
setup(e, { emit: t }) {
|
|
4770
|
-
const n = e, o = t, l = ee("webx-admin"), s = mt(), i =
|
|
4773
|
+
const n = e, o = t, l = ee("webx-admin"), s = mt(), i = _(() => n.editing.conflict.value), r = _(() => n.editing.incoming.value), u = _(() => n.editing.editors.value), v = _(
|
|
4771
4774
|
() => l("editing.conflict-title", { who: n.editing.who(i.value?.theirs.changed) })
|
|
4772
4775
|
), m = E(null);
|
|
4773
4776
|
ue(
|
|
@@ -4779,23 +4782,23 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4779
4782
|
function f(L) {
|
|
4780
4783
|
return L ? s.short(L) : "";
|
|
4781
4784
|
}
|
|
4782
|
-
const
|
|
4783
|
-
() =>
|
|
4784
|
-
),
|
|
4785
|
+
const d = _(() => n.editing.events.value), y = _(
|
|
4786
|
+
() => d.value.some((L) => L.kind === "restored_version" || L.kind === "discarded")
|
|
4787
|
+
), w = _(() => {
|
|
4785
4788
|
const L = r.value;
|
|
4786
|
-
return L ? y.value ? n.editing.describe(
|
|
4789
|
+
return L ? y.value ? n.editing.describe(d.value) : rt(
|
|
4787
4790
|
l("editing.incoming", {
|
|
4788
4791
|
who: n.editing.who(L.theirs.changed),
|
|
4789
4792
|
what: n.editing.places(L.paths),
|
|
4790
4793
|
when: f(L.theirs.changed?.at)
|
|
4791
4794
|
})
|
|
4792
4795
|
) : "";
|
|
4793
|
-
}), h =
|
|
4796
|
+
}), h = _(() => n.editing.describe(d.value)), W = _(() => n.editing.trashed.value), p = _(() => {
|
|
4794
4797
|
const L = n.editing.trashedBy.value;
|
|
4795
4798
|
return L ? l("editing.trashed-title", { who: n.editing.who(L), when: f(L.at) }) : l("editing.trashed-anonymous", {
|
|
4796
4799
|
when: f(n.editing.state.value?.deleted_at)
|
|
4797
4800
|
});
|
|
4798
|
-
}), V =
|
|
4801
|
+
}), V = _(() => n.editing.gone.value), H = _(() => {
|
|
4799
4802
|
const L = V.value;
|
|
4800
4803
|
return L?.at ? rt(l("editing.purged-title", { who: n.editing.who(L), when: f(L.at) })) : l("editing.purged-anonymous");
|
|
4801
4804
|
}), z = E(!1);
|
|
@@ -4829,7 +4832,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4829
4832
|
async function U() {
|
|
4830
4833
|
await n.editing.pull() && o("pulled");
|
|
4831
4834
|
}
|
|
4832
|
-
return (L, j) => V.value ? (
|
|
4835
|
+
return (L, j) => V.value ? (c(), N(a(ye), {
|
|
4833
4836
|
key: 0,
|
|
4834
4837
|
class: "wx-editing-alerts",
|
|
4835
4838
|
type: "danger",
|
|
@@ -4850,7 +4853,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4850
4853
|
})
|
|
4851
4854
|
]),
|
|
4852
4855
|
_: 1
|
|
4853
|
-
}, 8, ["title", "description"])) : W.value ? (
|
|
4856
|
+
}, 8, ["title", "description"])) : W.value ? (c(), N(a(ye), {
|
|
4854
4857
|
key: 1,
|
|
4855
4858
|
class: "wx-editing-alerts",
|
|
4856
4859
|
type: "danger",
|
|
@@ -4875,7 +4878,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4875
4878
|
]),
|
|
4876
4879
|
key: "0"
|
|
4877
4880
|
} : void 0
|
|
4878
|
-
]), 1032, ["title", "description"])) : i.value ? (
|
|
4881
|
+
]), 1032, ["title", "description"])) : i.value ? (c(), N(a(ye), {
|
|
4879
4882
|
key: 2,
|
|
4880
4883
|
ref_key: "conflictAlert",
|
|
4881
4884
|
ref: m,
|
|
@@ -4909,13 +4912,13 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4909
4912
|
default: b(() => [
|
|
4910
4913
|
D("p", Ns, T(a(l)("editing.conflict-text")), 1),
|
|
4911
4914
|
D("ul", Rs, [
|
|
4912
|
-
(
|
|
4915
|
+
(c(!0), C(G, null, ce(i.value.conflicts, (J) => (c(), C("li", {
|
|
4913
4916
|
key: J.id,
|
|
4914
4917
|
class: "wx-editing-alerts__item"
|
|
4915
4918
|
}, [
|
|
4916
4919
|
D("div", Vs, [
|
|
4917
4920
|
M(T(e.editing.label(J.path)) + " ", 1),
|
|
4918
|
-
J.kind !== "changed" ? (
|
|
4921
|
+
J.kind !== "changed" ? (c(), C("span", Us, T(a(l)(`editing.${J.kind}`)), 1)) : B("", !0)
|
|
4919
4922
|
]),
|
|
4920
4923
|
D("div", Is, [
|
|
4921
4924
|
D("span", Ms, T(a(l)("editing.base")), 1),
|
|
@@ -4926,7 +4929,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4926
4929
|
role: "radiogroup",
|
|
4927
4930
|
"aria-label": e.editing.label(J.path)
|
|
4928
4931
|
}, [
|
|
4929
|
-
(
|
|
4932
|
+
(c(), C(G, null, ce(["mine", "theirs"], (le) => D("button", {
|
|
4930
4933
|
key: le,
|
|
4931
4934
|
type: "button",
|
|
4932
4935
|
role: "radio",
|
|
@@ -4942,11 +4945,11 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4942
4945
|
])
|
|
4943
4946
|
]),
|
|
4944
4947
|
_: 1
|
|
4945
|
-
}, 8, ["title"])) : r.value ? (
|
|
4948
|
+
}, 8, ["title"])) : r.value ? (c(), N(a(ye), {
|
|
4946
4949
|
key: 3,
|
|
4947
4950
|
class: "wx-editing-alerts",
|
|
4948
4951
|
type: "info",
|
|
4949
|
-
title:
|
|
4952
|
+
title: w.value,
|
|
4950
4953
|
live: ""
|
|
4951
4954
|
}, {
|
|
4952
4955
|
actions: b(() => [
|
|
@@ -4962,7 +4965,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4962
4965
|
})
|
|
4963
4966
|
]),
|
|
4964
4967
|
_: 1
|
|
4965
|
-
}, 8, ["title"])) :
|
|
4968
|
+
}, 8, ["title"])) : d.value.length > 0 ? (c(), N(a(ye), {
|
|
4966
4969
|
key: 4,
|
|
4967
4970
|
class: "wx-editing-alerts",
|
|
4968
4971
|
type: "info",
|
|
@@ -4982,7 +4985,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4982
4985
|
})
|
|
4983
4986
|
]),
|
|
4984
4987
|
_: 1
|
|
4985
|
-
}, 8, ["title"])) : u.value.length > 0 ? (
|
|
4988
|
+
}, 8, ["title"])) : u.value.length > 0 ? (c(), C("p", Ds, T(a(l)("editing.others", { names: u.value.map((J) => J.name).join(", ") })), 1)) : B("", !0);
|
|
4986
4989
|
}
|
|
4987
4990
|
}), _i = /* @__PURE__ */ de(Fs, [["__scopeId", "data-v-4d019f39"]]), Hs = {
|
|
4988
4991
|
key: 0,
|
|
@@ -5000,23 +5003,23 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5000
5003
|
emits: ["restored"],
|
|
5001
5004
|
setup(e, { emit: t }) {
|
|
5002
5005
|
const n = e, o = t, l = oe(), s = ee("webx-admin"), i = Ye(), r = E(null), u = En({ screen: n.screen });
|
|
5003
|
-
function v(
|
|
5004
|
-
const h = [...new Set((
|
|
5006
|
+
function v(w) {
|
|
5007
|
+
const h = [...new Set((w.paths ?? []).map((p) => u.label(p)))];
|
|
5005
5008
|
if (h.length === 0) return "";
|
|
5006
5009
|
const W = h.slice(0, 3).join(", ");
|
|
5007
5010
|
return h.length > 3 ? s("editing.and-more", { what: W }) : W;
|
|
5008
5011
|
}
|
|
5009
5012
|
const m = E(!1), f = () => n.id === null || n.id === void 0 || n.id === "" ? null : `${l.apiPath}/editing/${n.entity}/${encodeURIComponent(String(n.id))}/drafts`;
|
|
5010
|
-
async function
|
|
5011
|
-
const
|
|
5012
|
-
if (
|
|
5013
|
+
async function d() {
|
|
5014
|
+
const w = f();
|
|
5015
|
+
if (w !== null)
|
|
5013
5016
|
try {
|
|
5014
|
-
r.value = (await l.http.get(
|
|
5017
|
+
r.value = (await l.http.get(w)).data;
|
|
5015
5018
|
} catch {
|
|
5016
5019
|
r.value = [];
|
|
5017
5020
|
}
|
|
5018
5021
|
}
|
|
5019
|
-
async function y(
|
|
5022
|
+
async function y(w) {
|
|
5020
5023
|
const h = f();
|
|
5021
5024
|
if (!(h === null || !await We({
|
|
5022
5025
|
title: s("editing.restore-title"),
|
|
@@ -5026,7 +5029,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5026
5029
|
}))) {
|
|
5027
5030
|
m.value = !0;
|
|
5028
5031
|
try {
|
|
5029
|
-
await l.http.post(`${h}/${
|
|
5032
|
+
await l.http.post(`${h}/${w.id}/restore`), o("restored"), Z.success(s("editing.restored")), await d();
|
|
5030
5033
|
} catch (p) {
|
|
5031
5034
|
Z.danger(i(p));
|
|
5032
5035
|
} finally {
|
|
@@ -5037,10 +5040,10 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5037
5040
|
return ue(
|
|
5038
5041
|
() => [n.entity, n.id, n.stamp],
|
|
5039
5042
|
() => {
|
|
5040
|
-
|
|
5043
|
+
d();
|
|
5041
5044
|
},
|
|
5042
5045
|
{ immediate: !0 }
|
|
5043
|
-
), (
|
|
5046
|
+
), (w, h) => r.value === null || r.value.length > 0 ? (c(), C("section", Hs, [
|
|
5044
5047
|
D("header", Ks, [
|
|
5045
5048
|
$(a(yn), {
|
|
5046
5049
|
level: 3,
|
|
@@ -5062,17 +5065,17 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5062
5065
|
})
|
|
5063
5066
|
]),
|
|
5064
5067
|
D("div", qs, [
|
|
5065
|
-
r.value === null ? (
|
|
5068
|
+
r.value === null ? (c(), N(a(Ce), {
|
|
5066
5069
|
key: 0,
|
|
5067
5070
|
class: "wx-drafts__ghost",
|
|
5068
5071
|
rows: 2
|
|
5069
5072
|
})) : B("", !0),
|
|
5070
|
-
(
|
|
5073
|
+
(c(!0), C(G, null, ce(r.value ?? [], (W) => (c(), C("div", {
|
|
5071
5074
|
key: W.id,
|
|
5072
5075
|
class: "wx-drafts__row"
|
|
5073
5076
|
}, [
|
|
5074
5077
|
D("div", Ys, [
|
|
5075
|
-
W.created_at ? (
|
|
5078
|
+
W.created_at ? (c(), N(Fe, {
|
|
5076
5079
|
key: 0,
|
|
5077
5080
|
value: W.created_at,
|
|
5078
5081
|
size: "md",
|
|
@@ -5087,7 +5090,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5087
5090
|
]),
|
|
5088
5091
|
_: 2
|
|
5089
5092
|
}, 1024),
|
|
5090
|
-
v(W) ? (
|
|
5093
|
+
v(W) ? (c(), N(a(ne), {
|
|
5091
5094
|
key: 1,
|
|
5092
5095
|
size: "sm",
|
|
5093
5096
|
class: "wx-drafts__changed"
|
|
@@ -5107,7 +5110,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5107
5110
|
]),
|
|
5108
5111
|
_: 2
|
|
5109
5112
|
}, 1032, ["type"]),
|
|
5110
|
-
e.canRestore ? (
|
|
5113
|
+
e.canRestore ? (c(), N(a(re), {
|
|
5111
5114
|
key: 0,
|
|
5112
5115
|
size: "sm",
|
|
5113
5116
|
variant: "outline",
|
|
@@ -5130,33 +5133,33 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5130
5133
|
name: "WxBackupNote",
|
|
5131
5134
|
__name: "BackupNote",
|
|
5132
5135
|
setup(e) {
|
|
5133
|
-
const t = oe(), n = mt(), o = ee("webx-admin"), l =
|
|
5136
|
+
const t = oe(), n = mt(), o = ee("webx-admin"), l = _(() => t.state.manifest?.backup ?? null), s = _(() => l.value !== null && t.can("settings.view")), i = _(() => {
|
|
5134
5137
|
const v = l.value?.at;
|
|
5135
5138
|
if (v == null) return !0;
|
|
5136
5139
|
const m = new Date(v).getTime();
|
|
5137
5140
|
return Number.isNaN(m) || Date.now() - m > Gs * 36e5;
|
|
5138
|
-
}), r =
|
|
5141
|
+
}), r = _(() => {
|
|
5139
5142
|
const v = l.value?.bytes;
|
|
5140
5143
|
if (v == null) return "";
|
|
5141
5144
|
const m = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte"];
|
|
5142
|
-
let f = v,
|
|
5143
|
-
for (; f >= 1024 &&
|
|
5144
|
-
f /= 1024,
|
|
5145
|
+
let f = v, d = 0;
|
|
5146
|
+
for (; f >= 1024 && d < m.length - 1; )
|
|
5147
|
+
f /= 1024, d++;
|
|
5145
5148
|
return new Intl.NumberFormat(t.i18n.state.locale, {
|
|
5146
5149
|
style: "unit",
|
|
5147
|
-
unit: m[
|
|
5150
|
+
unit: m[d],
|
|
5148
5151
|
unitDisplay: "short",
|
|
5149
|
-
maximumFractionDigits: f >= 10 ||
|
|
5152
|
+
maximumFractionDigits: f >= 10 || d === 0 ? 0 : 1
|
|
5150
5153
|
}).format(f);
|
|
5151
|
-
}), u =
|
|
5154
|
+
}), u = _(
|
|
5152
5155
|
() => l.value?.at == null ? o("backup.never") : o("backup.stale", { date: n.short(l.value.at) })
|
|
5153
5156
|
);
|
|
5154
|
-
return (v, m) => s.value && i.value ? (
|
|
5157
|
+
return (v, m) => s.value && i.value ? (c(), N(a(ye), {
|
|
5155
5158
|
key: 0,
|
|
5156
5159
|
type: "warning",
|
|
5157
5160
|
variant: "soft",
|
|
5158
5161
|
description: u.value
|
|
5159
|
-
}, null, 8, ["description"])) : s.value ? (
|
|
5162
|
+
}, null, 8, ["description"])) : s.value ? (c(), C("p", Xs, [
|
|
5160
5163
|
$(a(ne), {
|
|
5161
5164
|
size: "sm",
|
|
5162
5165
|
tone: "muted"
|
|
@@ -5169,7 +5172,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5169
5172
|
$(Fe, {
|
|
5170
5173
|
value: l.value?.at
|
|
5171
5174
|
}, null, 8, ["value"]),
|
|
5172
|
-
r.value ? (
|
|
5175
|
+
r.value ? (c(), N(a(ne), {
|
|
5173
5176
|
key: 0,
|
|
5174
5177
|
size: "sm",
|
|
5175
5178
|
tone: "muted"
|