@webx-ui/module-admin 0.14.3 → 0.15.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/BackButton.d.ts +1 -1
- package/dist/DateText.d.ts +1 -1
- package/dist/HelpButton.d.ts +1 -1
- package/dist/LinkField.d.ts +1 -1
- package/dist/LinkPicker.d.ts +1 -1
- package/dist/RenameButton.d.ts +4 -4
- package/dist/RowMenu.d.ts +1 -1
- package/dist/Screen.d.ts +1 -1
- package/dist/categories/CategoriesField.d.ts +29 -0
- package/dist/categories/CategoriesPage.d.ts +6 -0
- package/dist/categories/CategoryCreateDialog.d.ts +8 -0
- package/dist/categories/CategoryEditorPage.d.ts +6 -0
- package/dist/categories/CategorySlug.d.ts +2 -0
- package/dist/categories/api.d.ts +38 -0
- package/dist/categories/editor.d.ts +22 -0
- package/dist/categories/index.d.ts +6 -0
- package/dist/categories/ordering.d.ts +41 -0
- package/dist/categories/routes.d.ts +12 -0
- package/dist/categories/types.d.ts +68 -0
- package/dist/categories/words.d.ts +9 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1642 -959
- package/dist/index.js.map +1 -1
- package/dist/screenTypes.d.ts +4 -0
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,65 +1,222 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { RouterLink as
|
|
3
|
-
import {
|
|
4
|
-
import { watchSystemTheme as
|
|
5
|
-
import { WxScreenRenderer as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const e =
|
|
1
|
+
import { inject as oe, reactive as pe, defineComponent as R, useModel as ue, ref as W, watch as ee, computed as x, openBlock as p, createElementBlock as T, createVNode as b, unref as n, withCtx as g, createElementVNode as O, toDisplayString as L, createBlock as $, createTextVNode as V, createCommentVNode as U, mergeModels as le, provide as vt, normalizeProps as ft, guardReactiveProps as pt, onMounted as Le, Fragment as H, renderList as Q, mergeProps as He, withModifiers as je, useSlots as ht, useTemplateRef as Ke, normalizeClass as ae, renderSlot as F, createSlots as Ae, resolveComponent as j, watchEffect as gt, onUnmounted as yt, isRef as qe, createApp as bt, h as de, nextTick as Ye, withKeys as Xe, onBeforeUnmount as Ge } from "vue";
|
|
2
|
+
import { RouterLink as wt, useRouter as ge, useRoute as Je, createRouter as xt, createWebHistory as kt, onBeforeRouteLeave as _t } from "vue-router";
|
|
3
|
+
import { WxSortableList as Qe, WxAction as se, WxBadge as ze, WxSelect as Ze, useLocales as et, WxInput as ye, WxAlert as be, WxSegmented as $t, WxAutocomplete as Be, WxText as G, WxCheckbox as Ie, WxActions as Tt, WxDropdownItem as St, useElementWidth as Ct, WxHeading as Wt, WxButton as Z, WxIcon as Ve, WxTabs as Lt, WxCard as Se, WxRichText as At, WxResult as zt, useResponsiveShell as Vt, shellLayoutFor as Et, WxToaster as Ut, WebxUI as Nt, dateLocaleKey as Rt, localesKey as Bt, useModal as It, WxDialog as tt, WxFormItem as Pt, WxSpace as Dt, createModal as Mt, WxSkeleton as re, WxEmpty as at, WxTooltip as nt, toast as D, confirm as he, localizedValue as Ft, WxBreadcrumb as Ot, WxBreadcrumbItem as Pe, WxActionBar as Ht, WxPopover as jt, WxAvatar as Kt, WxTextarea as De } from "@webx-ui/core";
|
|
4
|
+
import { watchSystemTheme as qt, applyTheme as Yt, systemTheme as Xt } from "@webx-ui/tokens";
|
|
5
|
+
import { WxScreenRenderer as Gt } from "@webx-ui/schema";
|
|
6
|
+
const we = /* @__PURE__ */ Symbol("webx-i18n");
|
|
7
|
+
function Jt() {
|
|
8
|
+
const e = oe(we, null);
|
|
9
9
|
if (e === null)
|
|
10
10
|
throw new Error("useI18n() was called outside a panel created by createAdmin().");
|
|
11
11
|
return e;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const t =
|
|
15
|
-
return t === null ?
|
|
13
|
+
function P(e) {
|
|
14
|
+
const t = oe(we, null);
|
|
15
|
+
return t === null ? Ee().scope(e) : t.scope(e);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
e.provide(
|
|
17
|
+
function Qt(e, t) {
|
|
18
|
+
e.provide(we, t);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const t = e.fallback ?? "en",
|
|
20
|
+
function Ee(e = {}) {
|
|
21
|
+
const t = e.fallback ?? "en", a = pe({
|
|
22
22
|
locale: e.locale ?? t,
|
|
23
23
|
fallback: t,
|
|
24
24
|
panelLocales: [],
|
|
25
25
|
contentLocales: []
|
|
26
|
-
}),
|
|
27
|
-
function s(r, u,
|
|
28
|
-
let
|
|
29
|
-
for (const m of
|
|
30
|
-
if (typeof
|
|
26
|
+
}), l = {}, i = pe({ value: {} });
|
|
27
|
+
function s(r, u, c) {
|
|
28
|
+
let h = r[u]?.[c[0] ?? ""];
|
|
29
|
+
for (const m of c.slice(1)) {
|
|
30
|
+
if (typeof h != "object" || h === null)
|
|
31
31
|
return null;
|
|
32
|
-
|
|
32
|
+
h = h[m];
|
|
33
33
|
}
|
|
34
|
-
return typeof
|
|
34
|
+
return typeof h == "string" ? h : null;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const [
|
|
36
|
+
function o(r, u, c) {
|
|
37
|
+
const [h, m] = u.includes("::") ? u.split("::", 2) : [r, u], v = m.split("."), d = s(i.value, h, v) ?? s(l, h, v) ?? // 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
|
-
return
|
|
40
|
+
return c === void 0 ? d : Zt(d, c);
|
|
41
41
|
}
|
|
42
42
|
return {
|
|
43
|
-
state:
|
|
43
|
+
state: a,
|
|
44
44
|
defaults(r, u) {
|
|
45
|
-
|
|
45
|
+
l[r] = { ...l[r], ...u };
|
|
46
46
|
},
|
|
47
|
-
load(r, u,
|
|
48
|
-
i.value = r ?? {},
|
|
47
|
+
load(r, u, c) {
|
|
48
|
+
i.value = r ?? {}, a.locale = u ?? a.locale, c !== void 0 && (a.fallback = c);
|
|
49
49
|
},
|
|
50
50
|
scope(r) {
|
|
51
|
-
return (u,
|
|
51
|
+
return (u, c) => o(r, u, c);
|
|
52
52
|
},
|
|
53
|
-
t: (r, u) =>
|
|
53
|
+
t: (r, u) => o("", r, u)
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
let
|
|
58
|
-
for (const [
|
|
59
|
-
|
|
60
|
-
return
|
|
56
|
+
function Zt(e, t) {
|
|
57
|
+
let a = e;
|
|
58
|
+
for (const [l, i] of Object.entries(t))
|
|
59
|
+
a = a.replaceAll(`:${l}`, String(i));
|
|
60
|
+
return a;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function xe(e, t) {
|
|
63
|
+
const a = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`, l = (i) => i.data;
|
|
64
|
+
return {
|
|
65
|
+
list: (i = {}) => {
|
|
66
|
+
const s = new URLSearchParams();
|
|
67
|
+
return i.q && s.set("q", i.q), i.visible && s.set("visible", "1"), e.http.get(s.size > 0 ? `${a}?${s}` : a);
|
|
68
|
+
},
|
|
69
|
+
create: (i) => e.http.post(a, i).then(l),
|
|
70
|
+
get: (i) => e.http.get(`${a}/${i}`).then(l),
|
|
71
|
+
save: (i, s) => e.http.put(`${a}/${i}`, { values: s }).then(l),
|
|
72
|
+
remove: (i) => e.http.delete(`${a}/${i}`).then(() => {
|
|
73
|
+
}),
|
|
74
|
+
restore: (i) => e.http.post(`${a}/${i}/restore`, {}).then(l),
|
|
75
|
+
reorder: (i) => e.http.post(`${a}/reorder`, { ids: i }).then(() => {
|
|
76
|
+
})
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function ea(e, t, a, l = null) {
|
|
80
|
+
const i = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`;
|
|
81
|
+
return e.http.post(`${i}/reorder`, l === null ? { ids: a } : { ids: a, category: l }).then(() => {
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const ta = { class: "wx-categories-field" }, aa = { class: "wx-categories-field__name" }, na = /* @__PURE__ */ R({
|
|
85
|
+
name: "WxCategoriesField",
|
|
86
|
+
__name: "CategoriesField",
|
|
87
|
+
props: /* @__PURE__ */ le({
|
|
88
|
+
source: {},
|
|
89
|
+
main: { type: Boolean, default: !0 },
|
|
90
|
+
disabled: { type: Boolean, default: !1 },
|
|
91
|
+
mainText: { default: void 0 },
|
|
92
|
+
addText: { default: void 0 },
|
|
93
|
+
removeText: { default: void 0 },
|
|
94
|
+
emptyText: { default: void 0 },
|
|
95
|
+
noneLeftText: { default: void 0 }
|
|
96
|
+
}, {
|
|
97
|
+
modelValue: { default: () => [] },
|
|
98
|
+
modelModifiers: {}
|
|
99
|
+
}),
|
|
100
|
+
emits: ["update:modelValue"],
|
|
101
|
+
setup(e) {
|
|
102
|
+
const t = e, a = ue(e, "modelValue"), l = X(), i = P("webx-admin"), s = W([]);
|
|
103
|
+
ee(
|
|
104
|
+
() => t.source,
|
|
105
|
+
async (v) => {
|
|
106
|
+
try {
|
|
107
|
+
const d = await xe(l, v).list();
|
|
108
|
+
s.value = d.data.map((w) => ({ id: w.id, name: w.name }));
|
|
109
|
+
} catch {
|
|
110
|
+
s.value = [];
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{ immediate: !0 }
|
|
114
|
+
);
|
|
115
|
+
const o = x(() => Array.isArray(a.value) ? a.value : []), r = x(() => new Map(s.value.map((v) => [v.id, v.name]))), u = x({
|
|
116
|
+
get: () => o.value.map((v) => ({ id: v, name: r.value.get(v) ?? `#${v}` })),
|
|
117
|
+
set: (v) => {
|
|
118
|
+
a.value = v.map((d) => d.id);
|
|
119
|
+
}
|
|
120
|
+
}), c = x(
|
|
121
|
+
() => s.value.filter((v) => !o.value.includes(v.id)).map((v) => ({ label: v.name, value: v.id }))
|
|
122
|
+
);
|
|
123
|
+
function h(v) {
|
|
124
|
+
typeof v != "number" || o.value.includes(v) || (a.value = [...o.value, v]);
|
|
125
|
+
}
|
|
126
|
+
function m(v) {
|
|
127
|
+
a.value = o.value.filter((d) => d !== v);
|
|
128
|
+
}
|
|
129
|
+
return (v, d) => (p(), T("div", ta, [
|
|
130
|
+
b(n(Qe), {
|
|
131
|
+
modelValue: u.value,
|
|
132
|
+
"onUpdate:modelValue": d[0] || (d[0] = (w) => u.value = w),
|
|
133
|
+
plain: "",
|
|
134
|
+
size: "sm",
|
|
135
|
+
"item-key": "id",
|
|
136
|
+
"item-label": "name",
|
|
137
|
+
disabled: t.disabled,
|
|
138
|
+
"empty-text": t.emptyText ?? n(i)("categories.field-empty")
|
|
139
|
+
}, {
|
|
140
|
+
default: g(({ item: w, index: f }) => [
|
|
141
|
+
O("span", aa, L(w.name), 1),
|
|
142
|
+
t.main && f === 0 ? (p(), $(n(ze), {
|
|
143
|
+
key: 0,
|
|
144
|
+
type: "primary"
|
|
145
|
+
}, {
|
|
146
|
+
default: g(() => [
|
|
147
|
+
V(L(t.mainText ?? n(i)("categories.field-main")), 1)
|
|
148
|
+
]),
|
|
149
|
+
_: 1
|
|
150
|
+
})) : U("", !0)
|
|
151
|
+
]),
|
|
152
|
+
actions: g(({ item: w }) => [
|
|
153
|
+
b(n(se), {
|
|
154
|
+
type: "remove",
|
|
155
|
+
size: "sm",
|
|
156
|
+
disabled: t.disabled,
|
|
157
|
+
title: t.removeText ?? n(i)("categories.field-remove"),
|
|
158
|
+
onClick: (f) => m(w.id)
|
|
159
|
+
}, null, 8, ["disabled", "title", "onClick"])
|
|
160
|
+
]),
|
|
161
|
+
_: 1
|
|
162
|
+
}, 8, ["modelValue", "disabled", "empty-text"]),
|
|
163
|
+
b(n(Ze), {
|
|
164
|
+
"model-value": null,
|
|
165
|
+
options: c.value,
|
|
166
|
+
placeholder: t.addText ?? n(i)("categories.field-add"),
|
|
167
|
+
disabled: t.disabled || c.value.length === 0,
|
|
168
|
+
"empty-text": t.noneLeftText ?? n(i)("categories.field-none-left"),
|
|
169
|
+
filterable: "",
|
|
170
|
+
teleport: "",
|
|
171
|
+
"aria-label": t.addText ?? n(i)("categories.field-add"),
|
|
172
|
+
"onUpdate:modelValue": h
|
|
173
|
+
}, null, 8, ["options", "placeholder", "disabled", "empty-text", "aria-label"])
|
|
174
|
+
]));
|
|
175
|
+
}
|
|
176
|
+
}), Y = (e, t) => {
|
|
177
|
+
const a = e.__vccOpts || e;
|
|
178
|
+
for (const [l, i] of t)
|
|
179
|
+
a[l] = i;
|
|
180
|
+
return a;
|
|
181
|
+
}, la = /* @__PURE__ */ Y(na, [["__scopeId", "data-v-640cd836"]]), lt = /* @__PURE__ */ Symbol("wx-category-editor");
|
|
182
|
+
function oa(e) {
|
|
183
|
+
vt(lt, e);
|
|
184
|
+
}
|
|
185
|
+
function sa() {
|
|
186
|
+
return oe(lt, null);
|
|
187
|
+
}
|
|
188
|
+
const ia = { class: "wx-category-slug" }, ra = { class: "wx-category-slug__prefix" }, ua = /* @__PURE__ */ R({
|
|
189
|
+
name: "WxCategorySlug",
|
|
190
|
+
inheritAttrs: !1,
|
|
191
|
+
__name: "CategorySlug",
|
|
192
|
+
setup(e) {
|
|
193
|
+
const t = sa(), a = et(), l = x(() => {
|
|
194
|
+
const o = t?.prefix.value ?? "";
|
|
195
|
+
return o === "" ? "/" : `/${o}/`;
|
|
196
|
+
}), i = x(() => {
|
|
197
|
+
const o = t?.values.value.slug;
|
|
198
|
+
return typeof o == "string" ? o : o?.[a.active.value] ?? "";
|
|
199
|
+
}), s = x(() => {
|
|
200
|
+
const o = t?.category.value?.path;
|
|
201
|
+
return typeof o == "string" && i.value !== "" && `${l.value}${i.value}` != `/${o}`;
|
|
202
|
+
});
|
|
203
|
+
return (o, r) => (p(), T("div", ia, [
|
|
204
|
+
b(n(ye), ft(pt(o.$attrs)), {
|
|
205
|
+
prefix: g(() => [
|
|
206
|
+
O("span", ra, L(l.value), 1)
|
|
207
|
+
]),
|
|
208
|
+
_: 1
|
|
209
|
+
}, 16),
|
|
210
|
+
s.value && n(t) ? (p(), $(n(be), {
|
|
211
|
+
key: 0,
|
|
212
|
+
type: "info",
|
|
213
|
+
variant: "soft",
|
|
214
|
+
description: n(t).moving()
|
|
215
|
+
}, null, 8, ["description"])) : U("", !0)
|
|
216
|
+
]));
|
|
217
|
+
}
|
|
218
|
+
}), da = /* @__PURE__ */ Y(ua, [["__scopeId", "data-v-0d22193a"]]);
|
|
219
|
+
function ca() {
|
|
63
220
|
return {
|
|
64
221
|
target: "entity",
|
|
65
222
|
entity_type: null,
|
|
@@ -70,31 +227,31 @@ function Et() {
|
|
|
70
227
|
rel: []
|
|
71
228
|
};
|
|
72
229
|
}
|
|
73
|
-
function
|
|
74
|
-
const t = `${e.apiPath}/links`,
|
|
230
|
+
function ma(e) {
|
|
231
|
+
const t = `${e.apiPath}/links`, a = (l) => l.data;
|
|
75
232
|
return {
|
|
76
|
-
sources: () => e.http.get(`${t}/sources`).then(
|
|
77
|
-
search: (
|
|
78
|
-
resolve: (
|
|
79
|
-
routes: () => e.http.get(`${t}/routes`).then(
|
|
233
|
+
sources: () => e.http.get(`${t}/sources`).then(a),
|
|
234
|
+
search: (l, i, s) => e.http.get(`${t}/search`, { query: { type: l, q: i, locale: s } }).then(a),
|
|
235
|
+
resolve: (l, i) => e.http.post(`${t}/resolve`, { links: l, locale: i }).then(a),
|
|
236
|
+
routes: () => e.http.get(`${t}/routes`).then(a)
|
|
80
237
|
};
|
|
81
238
|
}
|
|
82
|
-
const
|
|
239
|
+
const va = { class: "wx-link-picker" }, fa = {
|
|
83
240
|
key: 0,
|
|
84
241
|
class: "wx-link-picker__entity"
|
|
85
|
-
},
|
|
242
|
+
}, pa = {
|
|
86
243
|
key: 1,
|
|
87
244
|
class: "wx-link-picker__url"
|
|
88
|
-
},
|
|
245
|
+
}, ha = {
|
|
89
246
|
key: 2,
|
|
90
247
|
class: "wx-link-picker__hash"
|
|
91
|
-
},
|
|
248
|
+
}, ga = {
|
|
92
249
|
key: 3,
|
|
93
250
|
class: "wx-link-picker__attributes"
|
|
94
|
-
},
|
|
251
|
+
}, ya = { class: "wx-link-picker__rel" }, ba = /* @__PURE__ */ R({
|
|
95
252
|
name: "WxLinkPicker",
|
|
96
253
|
__name: "LinkPicker",
|
|
97
|
-
props: /* @__PURE__ */
|
|
254
|
+
props: /* @__PURE__ */ le({
|
|
98
255
|
allowNone: { type: Boolean, default: !0 },
|
|
99
256
|
attributes: { type: Boolean, default: !0 },
|
|
100
257
|
disabled: { type: Boolean, default: !1 }
|
|
@@ -104,212 +261,207 @@ const Nt = { class: "wx-link-picker" }, Vt = {
|
|
|
104
261
|
}),
|
|
105
262
|
emits: ["update:modelValue"],
|
|
106
263
|
setup(e) {
|
|
107
|
-
const t = e,
|
|
108
|
-
let
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
{ value: "entity", label:
|
|
112
|
-
{ value: "url", label:
|
|
264
|
+
const t = e, a = ue(e, "modelValue"), l = X(), i = Jt(), s = ma(l), o = P("webx-admin"), r = W([]), u = W([]), c = W([]), h = W(!1), m = W(null), v = W(""), d = W(null);
|
|
265
|
+
let w = null;
|
|
266
|
+
const f = x(() => a.value ?? ca()), y = x(() => {
|
|
267
|
+
const _ = [
|
|
268
|
+
{ value: "entity", label: o("links.target-entity") },
|
|
269
|
+
{ value: "url", label: o("links.target-url") }
|
|
113
270
|
];
|
|
114
|
-
return t.allowNone ? [...
|
|
115
|
-
}),
|
|
116
|
-
() => r.value.map((
|
|
117
|
-
),
|
|
118
|
-
() => u.value.map((
|
|
119
|
-
value:
|
|
120
|
-
description:
|
|
121
|
-
id:
|
|
271
|
+
return t.allowNone ? [..._, { value: "none", label: o("links.target-none") }] : _;
|
|
272
|
+
}), k = x(
|
|
273
|
+
() => r.value.map((_) => ({ value: _.type, label: _.title }))
|
|
274
|
+
), M = x(
|
|
275
|
+
() => u.value.map((_) => ({
|
|
276
|
+
value: _.title,
|
|
277
|
+
description: z(_),
|
|
278
|
+
id: _.id
|
|
122
279
|
}))
|
|
123
|
-
),
|
|
124
|
-
() =>
|
|
280
|
+
), J = x(
|
|
281
|
+
() => c.value.map((_) => ({ value: _.path, description: _.name }))
|
|
125
282
|
);
|
|
126
|
-
|
|
127
|
-
r.value = await s.sources(), m.value =
|
|
128
|
-
}),
|
|
129
|
-
() => [
|
|
283
|
+
Le(async () => {
|
|
284
|
+
r.value = await s.sources(), m.value = f.value.entity_type ?? r.value[0]?.type ?? null, await Promise.all([S(), B()]);
|
|
285
|
+
}), ee(
|
|
286
|
+
() => [f.value.entity_type, f.value.entity_id].join(":"),
|
|
130
287
|
() => {
|
|
131
|
-
|
|
288
|
+
S();
|
|
132
289
|
}
|
|
133
290
|
);
|
|
134
|
-
async function
|
|
135
|
-
const { entity_type:
|
|
136
|
-
if (
|
|
137
|
-
|
|
291
|
+
async function S() {
|
|
292
|
+
const { entity_type: _, entity_id: N } = f.value;
|
|
293
|
+
if (_ === null || N === null) {
|
|
294
|
+
d.value = null, v.value = "";
|
|
138
295
|
return;
|
|
139
296
|
}
|
|
140
|
-
if (
|
|
297
|
+
if (d.value?.id === N)
|
|
141
298
|
return;
|
|
142
|
-
const [
|
|
143
|
-
|
|
299
|
+
const [I] = await s.resolve([{ type: _, id: N }], i.state.locale);
|
|
300
|
+
d.value = I ?? null, v.value = I?.title ?? o("links.missing"), w = v.value;
|
|
144
301
|
}
|
|
145
|
-
async function
|
|
146
|
-
|
|
302
|
+
async function B() {
|
|
303
|
+
c.value = await s.routes();
|
|
147
304
|
}
|
|
148
|
-
async function
|
|
149
|
-
if (
|
|
150
|
-
|
|
305
|
+
async function C(_) {
|
|
306
|
+
if (_ === w) {
|
|
307
|
+
w = null;
|
|
151
308
|
return;
|
|
152
309
|
}
|
|
153
|
-
if (
|
|
154
|
-
|
|
310
|
+
if (w = null, m.value !== null) {
|
|
311
|
+
h.value = !0;
|
|
155
312
|
try {
|
|
156
|
-
u.value = await s.search(m.value,
|
|
313
|
+
u.value = await s.search(m.value, _, i.state.locale);
|
|
157
314
|
} finally {
|
|
158
|
-
|
|
315
|
+
h.value = !1;
|
|
159
316
|
}
|
|
160
317
|
}
|
|
161
318
|
}
|
|
162
|
-
function
|
|
163
|
-
|
|
319
|
+
function A(_) {
|
|
320
|
+
_ !== void 0 && (a.value = { ...f.value, target: _ });
|
|
164
321
|
}
|
|
165
|
-
function
|
|
166
|
-
m.value =
|
|
322
|
+
function E(_) {
|
|
323
|
+
m.value = _ == null ? null : String(_), u.value = [], C("");
|
|
167
324
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
170
|
-
|
|
325
|
+
function K(_) {
|
|
326
|
+
const N = u.value.find((I) => I.id === _.id);
|
|
327
|
+
N === void 0 || m.value === null || (d.value = N, v.value = N.title, a.value = { ...f.value, entity_type: m.value, entity_id: N.id });
|
|
171
328
|
}
|
|
172
|
-
function
|
|
173
|
-
|
|
329
|
+
function ne() {
|
|
330
|
+
d.value = null, v.value = "", u.value = [], a.value = { ...f.value, entity_type: null, entity_id: null };
|
|
174
331
|
}
|
|
175
|
-
function
|
|
176
|
-
|
|
332
|
+
function ie(_) {
|
|
333
|
+
a.value = { ...f.value, url: _ === "" ? null : _ };
|
|
177
334
|
}
|
|
178
|
-
function
|
|
179
|
-
const
|
|
180
|
-
|
|
335
|
+
function te(_) {
|
|
336
|
+
const N = (typeof _ == "string" || typeof _ == "number" ? String(_) : "").replace(/^#+/, "").trim();
|
|
337
|
+
a.value = { ...f.value, hash: N === "" ? null : N };
|
|
181
338
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
339
|
+
function ke(_) {
|
|
340
|
+
a.value = { ...f.value, new_tab: _ };
|
|
184
341
|
}
|
|
185
|
-
function
|
|
186
|
-
const
|
|
187
|
-
|
|
342
|
+
function _e(_, N) {
|
|
343
|
+
const I = f.value.rel.filter(($e) => $e !== _);
|
|
344
|
+
a.value = { ...f.value, rel: N ? [...I, _] : I };
|
|
188
345
|
}
|
|
189
|
-
function
|
|
190
|
-
const
|
|
191
|
-
(
|
|
346
|
+
function z(_) {
|
|
347
|
+
const N = [_.hint, _.url ?? void 0].filter(
|
|
348
|
+
(I) => typeof I == "string" && I !== ""
|
|
192
349
|
);
|
|
193
|
-
return
|
|
350
|
+
return _.available || N.push(o("links.unavailable")), N.join(" · ");
|
|
194
351
|
}
|
|
195
|
-
const
|
|
196
|
-
return (
|
|
197
|
-
|
|
198
|
-
options:
|
|
199
|
-
"model-value":
|
|
352
|
+
const q = ["nofollow", "sponsored", "ugc"];
|
|
353
|
+
return (_, N) => (p(), T("div", va, [
|
|
354
|
+
b(n($t), {
|
|
355
|
+
options: y.value,
|
|
356
|
+
"model-value": f.value.target,
|
|
200
357
|
disabled: t.disabled,
|
|
201
|
-
"aria-label": o
|
|
202
|
-
"onUpdate:modelValue":
|
|
358
|
+
"aria-label": n(o)("links.target-entity"),
|
|
359
|
+
"onUpdate:modelValue": A
|
|
203
360
|
}, null, 8, ["options", "model-value", "disabled", "aria-label"]),
|
|
204
|
-
|
|
205
|
-
|
|
361
|
+
f.value.target === "entity" ? (p(), T("div", fa, [
|
|
362
|
+
k.value.length > 1 ? (p(), $(n(Ze), {
|
|
206
363
|
key: 0,
|
|
207
364
|
class: "wx-link-picker__section",
|
|
208
|
-
options:
|
|
365
|
+
options: k.value,
|
|
209
366
|
"model-value": m.value,
|
|
210
367
|
disabled: t.disabled,
|
|
211
|
-
"aria-label": o
|
|
212
|
-
"onUpdate:modelValue":
|
|
213
|
-
}, null, 8, ["options", "model-value", "disabled", "aria-label"])) :
|
|
214
|
-
|
|
368
|
+
"aria-label": n(o)("links.section"),
|
|
369
|
+
"onUpdate:modelValue": E
|
|
370
|
+
}, null, 8, ["options", "model-value", "disabled", "aria-label"])) : U("", !0),
|
|
371
|
+
b(n(Be), {
|
|
215
372
|
class: "wx-link-picker__search",
|
|
216
|
-
"model-value":
|
|
217
|
-
options:
|
|
373
|
+
"model-value": v.value,
|
|
374
|
+
options: M.value,
|
|
218
375
|
remote: "",
|
|
219
376
|
clearable: "",
|
|
220
|
-
loading:
|
|
221
|
-
"loading-text": o
|
|
222
|
-
"empty-text": o
|
|
223
|
-
placeholder: o
|
|
224
|
-
"aria-label": o
|
|
377
|
+
loading: h.value,
|
|
378
|
+
"loading-text": n(o)("links.searching"),
|
|
379
|
+
"empty-text": n(o)("links.empty"),
|
|
380
|
+
placeholder: n(o)("links.search"),
|
|
381
|
+
"aria-label": n(o)("links.search"),
|
|
225
382
|
disabled: t.disabled,
|
|
226
|
-
"onUpdate:modelValue":
|
|
227
|
-
onSearch:
|
|
228
|
-
onSelect:
|
|
229
|
-
onClear:
|
|
383
|
+
"onUpdate:modelValue": N[0] || (N[0] = (I) => v.value = I),
|
|
384
|
+
onSearch: C,
|
|
385
|
+
onSelect: K,
|
|
386
|
+
onClear: ne
|
|
230
387
|
}, null, 8, ["model-value", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
231
|
-
])) :
|
|
232
|
-
|
|
233
|
-
"model-value":
|
|
234
|
-
options:
|
|
388
|
+
])) : f.value.target === "url" ? (p(), T("div", pa, [
|
|
389
|
+
b(n(Be), {
|
|
390
|
+
"model-value": f.value.url ?? "",
|
|
391
|
+
options: J.value,
|
|
235
392
|
clearable: "",
|
|
236
393
|
"open-on-focus": "",
|
|
237
|
-
"empty-text": o
|
|
238
|
-
placeholder: o
|
|
239
|
-
"aria-label": o
|
|
394
|
+
"empty-text": n(o)("links.url-routes"),
|
|
395
|
+
placeholder: n(o)("links.url-placeholder"),
|
|
396
|
+
"aria-label": n(o)("links.url-label"),
|
|
240
397
|
disabled: t.disabled,
|
|
241
|
-
"onUpdate:modelValue":
|
|
398
|
+
"onUpdate:modelValue": ie
|
|
242
399
|
}, null, 8, ["model-value", "options", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
243
|
-
])) :
|
|
244
|
-
|
|
245
|
-
|
|
400
|
+
])) : U("", !0),
|
|
401
|
+
f.value.target !== "none" ? (p(), T("label", ha, [
|
|
402
|
+
b(n(G), {
|
|
246
403
|
size: "sm",
|
|
247
404
|
tone: "muted"
|
|
248
405
|
}, {
|
|
249
406
|
default: g(() => [
|
|
250
|
-
|
|
407
|
+
V(L(n(o)("links.hash")), 1)
|
|
251
408
|
]),
|
|
252
409
|
_: 1
|
|
253
410
|
}),
|
|
254
|
-
|
|
411
|
+
N[2] || (N[2] = O("span", {
|
|
255
412
|
class: "wx-link-picker__sign",
|
|
256
413
|
"aria-hidden": "true"
|
|
257
414
|
}, "#", -1)),
|
|
258
|
-
|
|
259
|
-
"model-value":
|
|
260
|
-
placeholder: o
|
|
261
|
-
"aria-label": o
|
|
415
|
+
b(n(ye), {
|
|
416
|
+
"model-value": f.value.hash ?? "",
|
|
417
|
+
placeholder: n(o)("links.hash-placeholder"),
|
|
418
|
+
"aria-label": n(o)("links.hash"),
|
|
262
419
|
disabled: t.disabled,
|
|
263
420
|
clearable: "",
|
|
264
|
-
"onUpdate:modelValue":
|
|
421
|
+
"onUpdate:modelValue": te
|
|
265
422
|
}, null, 8, ["model-value", "placeholder", "aria-label", "disabled"])
|
|
266
|
-
])) :
|
|
267
|
-
t.attributes &&
|
|
268
|
-
|
|
269
|
-
"model-value":
|
|
423
|
+
])) : U("", !0),
|
|
424
|
+
t.attributes && f.value.target !== "none" ? (p(), T("div", ga, [
|
|
425
|
+
b(n(Ie), {
|
|
426
|
+
"model-value": f.value.new_tab,
|
|
270
427
|
disabled: t.disabled,
|
|
271
|
-
"onUpdate:modelValue":
|
|
428
|
+
"onUpdate:modelValue": N[1] || (N[1] = (I) => ke(I))
|
|
272
429
|
}, {
|
|
273
430
|
default: g(() => [
|
|
274
|
-
|
|
431
|
+
V(L(n(o)("links.new-tab")), 1)
|
|
275
432
|
]),
|
|
276
433
|
_: 1
|
|
277
434
|
}, 8, ["model-value", "disabled"]),
|
|
278
|
-
|
|
279
|
-
|
|
435
|
+
O("div", ya, [
|
|
436
|
+
b(n(G), {
|
|
280
437
|
size: "sm",
|
|
281
438
|
tone: "muted"
|
|
282
439
|
}, {
|
|
283
440
|
default: g(() => [
|
|
284
|
-
|
|
441
|
+
V(L(n(o)("links.rel")), 1)
|
|
285
442
|
]),
|
|
286
443
|
_: 1
|
|
287
444
|
}),
|
|
288
|
-
(
|
|
289
|
-
key:
|
|
290
|
-
"model-value":
|
|
445
|
+
(p(), T(H, null, Q(q, (I) => b(n(Ie), {
|
|
446
|
+
key: I,
|
|
447
|
+
"model-value": f.value.rel.includes(I),
|
|
291
448
|
disabled: t.disabled,
|
|
292
|
-
"onUpdate:modelValue": (
|
|
449
|
+
"onUpdate:modelValue": ($e) => _e(I, $e)
|
|
293
450
|
}, {
|
|
294
451
|
default: g(() => [
|
|
295
|
-
|
|
452
|
+
V(L(n(o)(`links.rel-${I}`)), 1)
|
|
296
453
|
]),
|
|
297
454
|
_: 2
|
|
298
455
|
}, 1032, ["model-value", "disabled", "onUpdate:modelValue"])), 64))
|
|
299
456
|
])
|
|
300
|
-
])) :
|
|
457
|
+
])) : U("", !0)
|
|
301
458
|
]));
|
|
302
459
|
}
|
|
303
|
-
}),
|
|
304
|
-
const n = e.__vccOpts || e;
|
|
305
|
-
for (const [a, i] of t)
|
|
306
|
-
n[a] = i;
|
|
307
|
-
return n;
|
|
308
|
-
}, Ht = /* @__PURE__ */ F(Ft, [["__scopeId", "data-v-e54022e5"]]), Ot = /* @__PURE__ */ E({
|
|
460
|
+
}), wa = /* @__PURE__ */ Y(ba, [["__scopeId", "data-v-e54022e5"]]), xa = /* @__PURE__ */ R({
|
|
309
461
|
name: "WxLinkField",
|
|
310
462
|
inheritAttrs: !1,
|
|
311
463
|
__name: "LinkField",
|
|
312
|
-
props: /* @__PURE__ */
|
|
464
|
+
props: /* @__PURE__ */ le({
|
|
313
465
|
allowNone: { type: Boolean, default: !0 },
|
|
314
466
|
attributes: { type: Boolean, default: !0 },
|
|
315
467
|
disabled: { type: Boolean, default: !1 }
|
|
@@ -319,17 +471,17 @@ const Nt = { class: "wx-link-picker" }, Vt = {
|
|
|
319
471
|
}),
|
|
320
472
|
emits: ["update:modelValue"],
|
|
321
473
|
setup(e) {
|
|
322
|
-
const t = e,
|
|
323
|
-
return (
|
|
324
|
-
modelValue:
|
|
325
|
-
"onUpdate:modelValue": i[0] || (i[0] = (s) =>
|
|
326
|
-
},
|
|
474
|
+
const t = e, a = ue(e, "modelValue");
|
|
475
|
+
return (l, i) => (p(), $(wa, He({
|
|
476
|
+
modelValue: a.value,
|
|
477
|
+
"onUpdate:modelValue": i[0] || (i[0] = (s) => a.value = s)
|
|
478
|
+
}, l.$attrs, {
|
|
327
479
|
"allow-none": t.allowNone,
|
|
328
480
|
attributes: t.attributes,
|
|
329
481
|
disabled: t.disabled
|
|
330
482
|
}), null, 16, ["modelValue", "allow-none", "attributes", "disabled"]));
|
|
331
483
|
}
|
|
332
|
-
}),
|
|
484
|
+
}), ka = /* @__PURE__ */ R({
|
|
333
485
|
__name: "BackButton",
|
|
334
486
|
props: {
|
|
335
487
|
to: {},
|
|
@@ -337,21 +489,21 @@ const Nt = { class: "wx-link-picker" }, Vt = {
|
|
|
337
489
|
size: { default: "sm" }
|
|
338
490
|
},
|
|
339
491
|
setup(e) {
|
|
340
|
-
const t = e,
|
|
341
|
-
return (i, s) => (
|
|
492
|
+
const t = e, a = P("webx-admin"), l = x(() => t.label ?? a("editor.back"));
|
|
493
|
+
return (i, s) => (p(), $(n(se), {
|
|
342
494
|
icon: "arrow-left",
|
|
343
495
|
class: "wx-back-button",
|
|
344
|
-
as:
|
|
496
|
+
as: n(wt),
|
|
345
497
|
to: e.to,
|
|
346
|
-
title:
|
|
498
|
+
title: l.value,
|
|
347
499
|
size: e.size,
|
|
348
500
|
"tooltip-side": "bottom"
|
|
349
501
|
}, null, 8, ["as", "to", "title", "size"]));
|
|
350
502
|
}
|
|
351
|
-
}),
|
|
503
|
+
}), _a = {
|
|
352
504
|
key: 0,
|
|
353
505
|
class: "wx-dropdown__divider"
|
|
354
|
-
},
|
|
506
|
+
}, $a = /* @__PURE__ */ R({
|
|
355
507
|
__name: "RowMenu",
|
|
356
508
|
props: {
|
|
357
509
|
actions: {},
|
|
@@ -359,36 +511,36 @@ const Nt = { class: "wx-link-picker" }, Vt = {
|
|
|
359
511
|
size: { default: "sm" }
|
|
360
512
|
},
|
|
361
513
|
setup(e) {
|
|
362
|
-
const t =
|
|
363
|
-
...
|
|
364
|
-
...
|
|
514
|
+
const t = P("webx-admin"), a = e, l = x(() => [
|
|
515
|
+
...a.actions.filter((s) => !s.danger),
|
|
516
|
+
...a.actions.filter((s) => s.danger)
|
|
365
517
|
]), i = x(() => {
|
|
366
|
-
const s =
|
|
367
|
-
return s &&
|
|
518
|
+
const s = l.value.find((o) => o.danger);
|
|
519
|
+
return s && l.value[0] !== s ? s.key : null;
|
|
368
520
|
});
|
|
369
|
-
return (s,
|
|
521
|
+
return (s, o) => l.value.length > 0 ? (p(), $(n(Tt), {
|
|
370
522
|
key: 0,
|
|
371
523
|
class: "wx-row-menu",
|
|
372
524
|
collapse: "always",
|
|
373
525
|
align: "end",
|
|
374
526
|
size: e.size,
|
|
375
527
|
"aria-label": e.label,
|
|
376
|
-
onClick:
|
|
528
|
+
onClick: o[0] || (o[0] = je(() => {
|
|
377
529
|
}, ["stop"]))
|
|
378
530
|
}, {
|
|
379
531
|
trigger: g(() => [
|
|
380
|
-
|
|
532
|
+
b(n(se), {
|
|
381
533
|
type: "more",
|
|
382
534
|
size: e.size,
|
|
383
|
-
title:
|
|
535
|
+
title: n(t)("editor.more")
|
|
384
536
|
}, null, 8, ["size", "title"])
|
|
385
537
|
]),
|
|
386
538
|
collapsed: g(() => [
|
|
387
|
-
(
|
|
539
|
+
(p(!0), T(H, null, Q(l.value, (r) => (p(), T(H, {
|
|
388
540
|
key: r.key
|
|
389
541
|
}, [
|
|
390
|
-
r.key === i.value ? (
|
|
391
|
-
|
|
542
|
+
r.key === i.value ? (p(), T("hr", _a)) : U("", !0),
|
|
543
|
+
b(n(St), {
|
|
392
544
|
icon: r.icon,
|
|
393
545
|
tone: r.danger ? "danger" : "default",
|
|
394
546
|
href: r.href,
|
|
@@ -397,22 +549,22 @@ const Nt = { class: "wx-link-picker" }, Vt = {
|
|
|
397
549
|
onClick: (u) => r.run?.()
|
|
398
550
|
}, {
|
|
399
551
|
default: g(() => [
|
|
400
|
-
|
|
552
|
+
V(L(r.label), 1)
|
|
401
553
|
]),
|
|
402
554
|
_: 2
|
|
403
555
|
}, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"])
|
|
404
556
|
], 64))), 128))
|
|
405
557
|
]),
|
|
406
558
|
_: 1
|
|
407
|
-
}, 8, ["size", "aria-label"])) :
|
|
559
|
+
}, 8, ["size", "aria-label"])) : U("", !0);
|
|
408
560
|
}
|
|
409
|
-
}),
|
|
561
|
+
}), Ue = /* @__PURE__ */ Y($a, [["__scopeId", "data-v-cab01f7f"]]), Ta = ["data-level"], Sa = {
|
|
410
562
|
key: 0,
|
|
411
563
|
class: "wx-screen-head__trail"
|
|
412
|
-
},
|
|
564
|
+
}, Ca = { class: "wx-screen-head__name" }, Wa = {
|
|
413
565
|
key: 4,
|
|
414
566
|
class: "wx-screen-head__actions"
|
|
415
|
-
},
|
|
567
|
+
}, La = /* @__PURE__ */ R({
|
|
416
568
|
__name: "ScreenHead",
|
|
417
569
|
props: {
|
|
418
570
|
title: { default: void 0 },
|
|
@@ -426,57 +578,57 @@ const Nt = { class: "wx-link-picker" }, Vt = {
|
|
|
426
578
|
},
|
|
427
579
|
emits: ["back"],
|
|
428
580
|
setup(e, { emit: t }) {
|
|
429
|
-
const
|
|
430
|
-
() =>
|
|
431
|
-
), m = x(() => u.value ?
|
|
432
|
-
() =>
|
|
433
|
-
),
|
|
434
|
-
() => m.value.length > 0 ||
|
|
581
|
+
const a = e, l = t, i = P("webx-admin"), s = ht(), o = Ke("root"), r = Ct(o), u = x(() => r.value > 0 && r.value < a.collapseBelow), c = x(() => a.actions ?? []), h = x(
|
|
582
|
+
() => c.value.find((f) => f.primary) ?? null
|
|
583
|
+
), m = x(() => u.value ? h.value ? [h.value] : [] : c.value.filter((f) => !f.menu && !f.danger)), v = x(() => u.value ? c.value.filter((f) => f !== h.value) : c.value.filter((f) => f.menu || f.danger)), d = x(
|
|
584
|
+
() => a.back && a.back !== !0 ? a.back : null
|
|
585
|
+
), w = x(
|
|
586
|
+
() => m.value.length > 0 || v.value.length > 0 || !!s.extra
|
|
435
587
|
);
|
|
436
|
-
return (
|
|
588
|
+
return (f, y) => (p(), T("div", {
|
|
437
589
|
ref_key: "root",
|
|
438
|
-
ref:
|
|
439
|
-
class:
|
|
590
|
+
ref: o,
|
|
591
|
+
class: ae(["wx-screen-head", {
|
|
440
592
|
"is-narrow": u.value,
|
|
441
593
|
"has-button": m.value.length > 0,
|
|
442
|
-
"has-trail": !!
|
|
594
|
+
"has-trail": !!f.$slots.trail,
|
|
443
595
|
"has-divider": e.divider
|
|
444
596
|
}]),
|
|
445
597
|
"data-level": e.level
|
|
446
598
|
}, [
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
])) :
|
|
450
|
-
|
|
599
|
+
f.$slots.trail ? (p(), T("div", Sa, [
|
|
600
|
+
F(f.$slots, "trail", {}, void 0, !0)
|
|
601
|
+
])) : U("", !0),
|
|
602
|
+
d.value ? (p(), $(ka, {
|
|
451
603
|
key: 1,
|
|
452
604
|
class: "wx-screen-head__back",
|
|
453
|
-
to:
|
|
605
|
+
to: d.value,
|
|
454
606
|
label: e.backLabel,
|
|
455
607
|
"tooltip-side": "bottom"
|
|
456
|
-
}, null, 8, ["to", "label"])) : e.back ? (
|
|
608
|
+
}, null, 8, ["to", "label"])) : e.back ? (p(), $(n(se), {
|
|
457
609
|
key: 2,
|
|
458
610
|
class: "wx-screen-head__back",
|
|
459
611
|
icon: "arrow-left",
|
|
460
612
|
size: "sm",
|
|
461
613
|
"tooltip-side": "bottom",
|
|
462
|
-
title: e.backLabel ??
|
|
463
|
-
onClick:
|
|
464
|
-
}, null, 8, ["title"])) :
|
|
465
|
-
|
|
466
|
-
e.title ? (
|
|
614
|
+
title: e.backLabel ?? n(i)("editor.back"),
|
|
615
|
+
onClick: y[0] || (y[0] = (k) => l("back"))
|
|
616
|
+
}, null, 8, ["title"])) : U("", !0),
|
|
617
|
+
O("div", Ca, [
|
|
618
|
+
e.title ? (p(), $(n(Wt), {
|
|
467
619
|
key: 0,
|
|
468
620
|
level: e.level,
|
|
469
621
|
truncate: "",
|
|
470
622
|
class: "wx-screen-head__title"
|
|
471
623
|
}, {
|
|
472
624
|
default: g(() => [
|
|
473
|
-
|
|
625
|
+
V(L(e.title), 1)
|
|
474
626
|
]),
|
|
475
627
|
_: 1
|
|
476
|
-
}, 8, ["level"])) :
|
|
477
|
-
|
|
628
|
+
}, 8, ["level"])) : U("", !0),
|
|
629
|
+
F(f.$slots, "title-after", {}, void 0, !0)
|
|
478
630
|
]),
|
|
479
|
-
e.subtitle ||
|
|
631
|
+
e.subtitle || f.$slots.subtitle ? (p(), $(n(G), {
|
|
480
632
|
key: 3,
|
|
481
633
|
class: "wx-screen-head__subtitle",
|
|
482
634
|
size: "sm",
|
|
@@ -484,53 +636,53 @@ const Nt = { class: "wx-link-picker" }, Vt = {
|
|
|
484
636
|
truncate: ""
|
|
485
637
|
}, {
|
|
486
638
|
default: g(() => [
|
|
487
|
-
|
|
488
|
-
|
|
639
|
+
F(f.$slots, "subtitle", {}, () => [
|
|
640
|
+
V(L(e.subtitle), 1)
|
|
489
641
|
], !0)
|
|
490
642
|
]),
|
|
491
643
|
_: 3
|
|
492
|
-
})) :
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
(
|
|
496
|
-
key:
|
|
497
|
-
class:
|
|
498
|
-
type:
|
|
499
|
-
variant:
|
|
500
|
-
loading:
|
|
501
|
-
disabled:
|
|
502
|
-
href:
|
|
503
|
-
target:
|
|
504
|
-
rel:
|
|
505
|
-
onClick: (
|
|
644
|
+
})) : U("", !0),
|
|
645
|
+
w.value ? (p(), T("div", Wa, [
|
|
646
|
+
F(f.$slots, "extra", {}, void 0, !0),
|
|
647
|
+
(p(!0), T(H, null, Q(m.value, (k) => (p(), $(n(Z), {
|
|
648
|
+
key: k.key,
|
|
649
|
+
class: ae(["wx-screen-head__button", { "is-primary": k.primary }]),
|
|
650
|
+
type: k.primary ? "primary" : "default",
|
|
651
|
+
variant: k.primary ? "solid" : k.variant ?? "outline",
|
|
652
|
+
loading: k.loading,
|
|
653
|
+
disabled: k.disabled,
|
|
654
|
+
href: k.href,
|
|
655
|
+
target: k.href ? k.target ?? "_blank" : void 0,
|
|
656
|
+
rel: k.href ? "noopener" : void 0,
|
|
657
|
+
onClick: (M) => k.run?.()
|
|
506
658
|
}, Ae({
|
|
507
659
|
default: g(() => [
|
|
508
|
-
|
|
660
|
+
V(" " + L(k.label), 1)
|
|
509
661
|
]),
|
|
510
662
|
_: 2
|
|
511
663
|
}, [
|
|
512
|
-
|
|
664
|
+
k.icon ? {
|
|
513
665
|
name: "icon",
|
|
514
666
|
fn: g(() => [
|
|
515
|
-
|
|
516
|
-
name:
|
|
667
|
+
b(n(Ve), {
|
|
668
|
+
name: k.icon
|
|
517
669
|
}, null, 8, ["name"])
|
|
518
670
|
]),
|
|
519
671
|
key: "0"
|
|
520
672
|
} : void 0
|
|
521
673
|
]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
|
|
522
|
-
|
|
674
|
+
v.value.length > 0 ? (p(), $(Ue, {
|
|
523
675
|
key: 0,
|
|
524
|
-
actions:
|
|
676
|
+
actions: v.value,
|
|
525
677
|
size: "lg",
|
|
526
|
-
label: e.title ??
|
|
527
|
-
}, null, 8, ["actions", "label"])) :
|
|
528
|
-
])) :
|
|
529
|
-
], 10,
|
|
678
|
+
label: e.title ?? n(i)("editor.more")
|
|
679
|
+
}, null, 8, ["actions", "label"])) : U("", !0)
|
|
680
|
+
])) : U("", !0)
|
|
681
|
+
], 10, Ta));
|
|
530
682
|
}
|
|
531
|
-
}),
|
|
683
|
+
}), ot = /* @__PURE__ */ Y(La, [["__scopeId", "data-v-e27d184e"]]), Aa = ["data-wx-fill"], za = /* @__PURE__ */ R({
|
|
532
684
|
__name: "ListScreen",
|
|
533
|
-
props: /* @__PURE__ */
|
|
685
|
+
props: /* @__PURE__ */ le({
|
|
534
686
|
title: { default: void 0 },
|
|
535
687
|
subtitle: { default: void 0 },
|
|
536
688
|
back: { default: void 0 },
|
|
@@ -547,12 +699,12 @@ const Nt = { class: "wx-link-picker" }, Vt = {
|
|
|
547
699
|
}),
|
|
548
700
|
emits: ["update:view"],
|
|
549
701
|
setup(e) {
|
|
550
|
-
const t =
|
|
551
|
-
return (
|
|
552
|
-
class:
|
|
702
|
+
const t = ue(e, "view");
|
|
703
|
+
return (a, l) => (p(), T("div", {
|
|
704
|
+
class: ae(["wx-list-screen", { "is-fill": e.fill }]),
|
|
553
705
|
"data-wx-fill": e.fill ? "" : void 0
|
|
554
706
|
}, [
|
|
555
|
-
e.title || e.actions ||
|
|
707
|
+
e.title || e.actions || a.$slots.actions ? (p(), $(ot, {
|
|
556
708
|
key: 0,
|
|
557
709
|
class: "wx-list-screen__head",
|
|
558
710
|
title: e.title,
|
|
@@ -562,196 +714,198 @@ const Nt = { class: "wx-link-picker" }, Vt = {
|
|
|
562
714
|
actions: e.actions,
|
|
563
715
|
"collapse-below": 480
|
|
564
716
|
}, Ae({ _: 2 }, [
|
|
565
|
-
|
|
717
|
+
a.$slots.actions ? {
|
|
566
718
|
name: "extra",
|
|
567
719
|
fn: g(() => [
|
|
568
|
-
|
|
720
|
+
F(a.$slots, "actions", {}, void 0, !0)
|
|
569
721
|
]),
|
|
570
722
|
key: "0"
|
|
571
723
|
} : void 0
|
|
572
|
-
]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) :
|
|
573
|
-
e.views && e.views.length > 0 ? (
|
|
724
|
+
]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : U("", !0),
|
|
725
|
+
e.views && e.views.length > 0 ? (p(), $(n(Lt), {
|
|
574
726
|
key: 1,
|
|
575
727
|
modelValue: t.value,
|
|
576
|
-
"onUpdate:modelValue":
|
|
728
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => t.value = i),
|
|
577
729
|
class: "wx-list-screen__views",
|
|
578
730
|
items: e.views,
|
|
579
731
|
"collapse-below": e.collapseBelow,
|
|
580
732
|
"aria-label": e.title
|
|
581
733
|
}, {
|
|
582
734
|
default: g(() => [
|
|
583
|
-
e.card ? (
|
|
735
|
+
e.card ? (p(), $(n(Se), {
|
|
584
736
|
key: 0,
|
|
585
737
|
class: "wx-list-screen__card",
|
|
586
738
|
padding: e.padding
|
|
587
739
|
}, {
|
|
588
740
|
default: g(() => [
|
|
589
|
-
|
|
741
|
+
F(a.$slots, "default", {}, void 0, !0)
|
|
590
742
|
]),
|
|
591
743
|
_: 3
|
|
592
|
-
}, 8, ["padding"])) :
|
|
744
|
+
}, 8, ["padding"])) : F(a.$slots, "default", {}, void 0, !0, 1)
|
|
593
745
|
]),
|
|
594
746
|
_: 3
|
|
595
|
-
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (
|
|
596
|
-
e.card ? (
|
|
747
|
+
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (p(), T(H, { key: 2 }, [
|
|
748
|
+
e.card ? (p(), $(n(Se), {
|
|
597
749
|
key: 0,
|
|
598
750
|
class: "wx-list-screen__card",
|
|
599
751
|
padding: e.padding
|
|
600
752
|
}, {
|
|
601
753
|
default: g(() => [
|
|
602
|
-
|
|
754
|
+
F(a.$slots, "default", {}, void 0, !0)
|
|
603
755
|
]),
|
|
604
756
|
_: 3
|
|
605
|
-
}, 8, ["padding"])) :
|
|
757
|
+
}, 8, ["padding"])) : F(a.$slots, "default", {}, void 0, !0, 1)
|
|
606
758
|
], 64))
|
|
607
|
-
], 10,
|
|
759
|
+
], 10, Aa));
|
|
608
760
|
}
|
|
609
|
-
}),
|
|
761
|
+
}), st = /* @__PURE__ */ Y(za, [["__scopeId", "data-v-8c7e5ad1"]]), Va = /* @__PURE__ */ R({
|
|
610
762
|
name: "WxRichTextField",
|
|
611
763
|
inheritAttrs: !1,
|
|
612
764
|
__name: "RichTextField",
|
|
613
765
|
setup(e) {
|
|
614
|
-
const t =
|
|
615
|
-
bold:
|
|
616
|
-
italic:
|
|
617
|
-
strike:
|
|
618
|
-
code:
|
|
619
|
-
h2:
|
|
620
|
-
h3:
|
|
621
|
-
h4:
|
|
622
|
-
bulletList:
|
|
623
|
-
orderedList:
|
|
624
|
-
blockquote:
|
|
625
|
-
hr:
|
|
626
|
-
link:
|
|
627
|
-
table:
|
|
628
|
-
image:
|
|
629
|
-
youtube:
|
|
630
|
-
undo:
|
|
631
|
-
redo:
|
|
632
|
-
addRowAfter:
|
|
633
|
-
addRowBefore:
|
|
634
|
-
addColumnAfter:
|
|
635
|
-
addColumnBefore:
|
|
636
|
-
deleteRow:
|
|
637
|
-
deleteColumn:
|
|
638
|
-
mergeOrSplit:
|
|
639
|
-
deleteTable:
|
|
640
|
-
toolbar:
|
|
641
|
-
linkAddress:
|
|
642
|
-
youtubeAddress:
|
|
643
|
-
apply:
|
|
644
|
-
cancel:
|
|
645
|
-
uploading:
|
|
766
|
+
const t = X(), a = P("webx-admin"), l = x(() => t.pickImage ?? void 0), i = x(() => ({
|
|
767
|
+
bold: a("rich-text.bold"),
|
|
768
|
+
italic: a("rich-text.italic"),
|
|
769
|
+
strike: a("rich-text.strike"),
|
|
770
|
+
code: a("rich-text.code"),
|
|
771
|
+
h2: a("rich-text.h2"),
|
|
772
|
+
h3: a("rich-text.h3"),
|
|
773
|
+
h4: a("rich-text.h4"),
|
|
774
|
+
bulletList: a("rich-text.bullet-list"),
|
|
775
|
+
orderedList: a("rich-text.ordered-list"),
|
|
776
|
+
blockquote: a("rich-text.blockquote"),
|
|
777
|
+
hr: a("rich-text.hr"),
|
|
778
|
+
link: a("rich-text.link"),
|
|
779
|
+
table: a("rich-text.table"),
|
|
780
|
+
image: a("rich-text.image"),
|
|
781
|
+
youtube: a("rich-text.youtube"),
|
|
782
|
+
undo: a("rich-text.undo"),
|
|
783
|
+
redo: a("rich-text.redo"),
|
|
784
|
+
addRowAfter: a("rich-text.row-below"),
|
|
785
|
+
addRowBefore: a("rich-text.row-above"),
|
|
786
|
+
addColumnAfter: a("rich-text.column-after"),
|
|
787
|
+
addColumnBefore: a("rich-text.column-before"),
|
|
788
|
+
deleteRow: a("rich-text.delete-row"),
|
|
789
|
+
deleteColumn: a("rich-text.delete-column"),
|
|
790
|
+
mergeOrSplit: a("rich-text.merge-cells"),
|
|
791
|
+
deleteTable: a("rich-text.delete-table"),
|
|
792
|
+
toolbar: a("rich-text.toolbar"),
|
|
793
|
+
linkAddress: a("rich-text.link-address"),
|
|
794
|
+
youtubeAddress: a("rich-text.youtube-address"),
|
|
795
|
+
apply: a("rich-text.apply"),
|
|
796
|
+
cancel: a("rich-text.cancel"),
|
|
797
|
+
uploading: a("rich-text.uploading")
|
|
646
798
|
}));
|
|
647
|
-
return (s,
|
|
799
|
+
return (s, o) => (p(), $(n(At), He(s.$attrs, {
|
|
648
800
|
labels: i.value,
|
|
649
|
-
"pick-image":
|
|
801
|
+
"pick-image": l.value
|
|
650
802
|
}), null, 16, ["labels", "pick-image"]));
|
|
651
803
|
}
|
|
652
|
-
}),
|
|
653
|
-
"wx-list": { component:
|
|
804
|
+
}), Ea = {
|
|
805
|
+
"wx-list": { component: st, kind: "layout", labelProp: "title" },
|
|
654
806
|
// Full width: an editor shares a row with nothing, and a form of two columns would give it
|
|
655
807
|
// half a line to write a page of text in.
|
|
656
|
-
"wx-rich-text": { component:
|
|
808
|
+
"wx-rich-text": { component: Va, kind: "field", wide: !0 },
|
|
657
809
|
// Wide as well: a row of the picker is a segmented switch, a section and a search box, and half
|
|
658
810
|
// a form's width leaves the search box too narrow to read a page title in.
|
|
659
|
-
"wx-link": { component:
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
811
|
+
"wx-link": { component: xa, kind: "field", wide: !0 },
|
|
812
|
+
"wx-categories": { component: la, kind: "field" },
|
|
813
|
+
"wx-category-slug": { component: da, kind: "field" }
|
|
814
|
+
}, it = /* @__PURE__ */ Symbol("webx-admin");
|
|
815
|
+
function X() {
|
|
816
|
+
const e = oe(it, null);
|
|
663
817
|
if (e === null)
|
|
664
818
|
throw new Error("useAdmin() was called outside a panel created by createAdmin().");
|
|
665
819
|
return e;
|
|
666
820
|
}
|
|
667
|
-
function
|
|
668
|
-
const t =
|
|
821
|
+
function Ua(e) {
|
|
822
|
+
const t = pe({
|
|
669
823
|
status: "loading",
|
|
670
824
|
manifest: null,
|
|
671
825
|
user: null,
|
|
672
826
|
error: null
|
|
673
|
-
}),
|
|
674
|
-
const
|
|
675
|
-
if (
|
|
827
|
+
}), a = x(() => {
|
|
828
|
+
const d = t.manifest;
|
|
829
|
+
if (d === null)
|
|
676
830
|
return [];
|
|
677
|
-
const
|
|
678
|
-
for (const
|
|
679
|
-
const
|
|
680
|
-
if (
|
|
831
|
+
const w = [];
|
|
832
|
+
for (const f of d.modules) {
|
|
833
|
+
const y = e.modules.find((M) => M.id === f.id);
|
|
834
|
+
if (y === void 0)
|
|
681
835
|
continue;
|
|
682
|
-
const
|
|
683
|
-
|
|
684
|
-
id:
|
|
685
|
-
title:
|
|
686
|
-
icon:
|
|
687
|
-
path:
|
|
688
|
-
group:
|
|
836
|
+
const k = y.path ?? y.routes?.[0]?.path;
|
|
837
|
+
k !== void 0 && w.push({
|
|
838
|
+
id: f.id,
|
|
839
|
+
title: f.title,
|
|
840
|
+
icon: f.icon,
|
|
841
|
+
path: k,
|
|
842
|
+
group: f.group ?? null
|
|
689
843
|
});
|
|
690
844
|
}
|
|
691
|
-
return
|
|
692
|
-
}),
|
|
693
|
-
const
|
|
694
|
-
for (const
|
|
695
|
-
if (
|
|
696
|
-
const
|
|
697
|
-
|
|
845
|
+
return w;
|
|
846
|
+
}), l = x(() => {
|
|
847
|
+
const d = t.manifest?.groups ?? [], w = [], f = /* @__PURE__ */ new Map();
|
|
848
|
+
for (const y of a.value)
|
|
849
|
+
if (y.group !== null && d.some((k) => k.id === y.group)) {
|
|
850
|
+
const k = f.get(y.group) ?? [];
|
|
851
|
+
k.push(y), f.set(y.group, k);
|
|
698
852
|
} else
|
|
699
|
-
|
|
853
|
+
w.push(y);
|
|
700
854
|
return {
|
|
701
|
-
top:
|
|
702
|
-
groups:
|
|
703
|
-
id:
|
|
704
|
-
title:
|
|
705
|
-
icon:
|
|
706
|
-
entries:
|
|
855
|
+
top: w,
|
|
856
|
+
groups: d.filter((y) => f.has(y.id)).map((y) => ({
|
|
857
|
+
id: y.id,
|
|
858
|
+
title: y.title,
|
|
859
|
+
icon: y.icon ?? null,
|
|
860
|
+
entries: f.get(y.id) ?? []
|
|
707
861
|
}))
|
|
708
862
|
};
|
|
709
|
-
}), i = { ...
|
|
710
|
-
for (const
|
|
711
|
-
Object.assign(i,
|
|
863
|
+
}), i = { ...Ea };
|
|
864
|
+
for (const d of e.modules)
|
|
865
|
+
Object.assign(i, d.types);
|
|
712
866
|
Object.assign(i, e.types);
|
|
713
|
-
const s = e.modules.find((
|
|
714
|
-
async function r(
|
|
715
|
-
const
|
|
716
|
-
let
|
|
717
|
-
return
|
|
718
|
-
throw
|
|
719
|
-
}),
|
|
867
|
+
const s = e.modules.find((d) => d.pickImage !== void 0)?.pickImage, o = /* @__PURE__ */ new Map();
|
|
868
|
+
async function r(d) {
|
|
869
|
+
const w = `${e.i18n.state.locale}:${d}`;
|
|
870
|
+
let f = o.get(w);
|
|
871
|
+
return f === void 0 && (f = e.http.get(`${e.apiPath}/screens/${d}`).then((y) => y.data.root).catch((y) => {
|
|
872
|
+
throw o.delete(w), y;
|
|
873
|
+
}), o.set(w, f)), f;
|
|
720
874
|
}
|
|
721
875
|
let u = null;
|
|
722
|
-
async function
|
|
876
|
+
async function c() {
|
|
723
877
|
t.status = "loading", t.error = null;
|
|
724
878
|
try {
|
|
725
879
|
if (u !== null && (t.user = await u(), m(t.user), t.user === null)) {
|
|
726
880
|
t.manifest = null, t.status = "unauthenticated";
|
|
727
881
|
return;
|
|
728
882
|
}
|
|
729
|
-
const
|
|
730
|
-
t.manifest =
|
|
731
|
-
} catch (
|
|
732
|
-
if (
|
|
883
|
+
const d = await e.loadManifest();
|
|
884
|
+
t.manifest = d, e.i18n.state.contentLocales = d.locales ?? [], e.i18n.state.panelLocales = d.panelLocales ?? e.i18n.state.panelLocales, d.locale !== void 0 && d.locale !== e.i18n.state.locale && await v(d.locale), t.status = "ready";
|
|
885
|
+
} catch (d) {
|
|
886
|
+
if (Ra(d)) {
|
|
733
887
|
t.manifest = null, t.user = null, t.status = "unauthenticated";
|
|
734
888
|
return;
|
|
735
889
|
}
|
|
736
|
-
t.error =
|
|
890
|
+
t.error = d instanceof Error ? d.message : String(d), t.status = "error";
|
|
737
891
|
}
|
|
738
892
|
}
|
|
739
|
-
async function
|
|
893
|
+
async function h() {
|
|
740
894
|
if (t.manifest !== null)
|
|
741
895
|
try {
|
|
742
896
|
t.manifest = await e.loadManifest();
|
|
743
897
|
} catch {
|
|
744
898
|
}
|
|
745
899
|
}
|
|
746
|
-
function m(
|
|
747
|
-
|
|
900
|
+
function m(d) {
|
|
901
|
+
d !== null && e.theme?.adopt(d.theme);
|
|
748
902
|
}
|
|
749
|
-
async function
|
|
903
|
+
async function v(d) {
|
|
750
904
|
if (e.loadDictionary === void 0) {
|
|
751
|
-
e.i18n.state.locale =
|
|
905
|
+
e.i18n.state.locale = d;
|
|
752
906
|
return;
|
|
753
907
|
}
|
|
754
|
-
await e.loadDictionary(
|
|
908
|
+
await e.loadDictionary(d), await h();
|
|
755
909
|
}
|
|
756
910
|
return {
|
|
757
911
|
http: e.http,
|
|
@@ -760,100 +914,100 @@ function sn(e) {
|
|
|
760
914
|
state: t,
|
|
761
915
|
i18n: e.i18n,
|
|
762
916
|
modules: e.modules,
|
|
763
|
-
nav:
|
|
764
|
-
groups:
|
|
917
|
+
nav: a,
|
|
918
|
+
groups: l,
|
|
765
919
|
types: i,
|
|
766
920
|
pickImage: s ?? null,
|
|
767
|
-
reload:
|
|
768
|
-
refreshManifest:
|
|
769
|
-
setLocale:
|
|
770
|
-
setUser(
|
|
771
|
-
t.user =
|
|
921
|
+
reload: c,
|
|
922
|
+
refreshManifest: h,
|
|
923
|
+
setLocale: v,
|
|
924
|
+
setUser(d) {
|
|
925
|
+
t.user = d, m(d);
|
|
772
926
|
},
|
|
773
|
-
useSessionLoader(
|
|
774
|
-
u =
|
|
927
|
+
useSessionLoader(d) {
|
|
928
|
+
u = d;
|
|
775
929
|
},
|
|
776
|
-
can(
|
|
777
|
-
const
|
|
778
|
-
return
|
|
930
|
+
can(d) {
|
|
931
|
+
const w = t.user;
|
|
932
|
+
return w === null ? !1 : w.isSuper || w.permissions.includes(d);
|
|
779
933
|
},
|
|
780
934
|
loadScreen: r,
|
|
781
|
-
screenPatch(
|
|
782
|
-
return e.screens?.[
|
|
935
|
+
screenPatch(d) {
|
|
936
|
+
return e.screens?.[d] ?? [];
|
|
783
937
|
}
|
|
784
938
|
};
|
|
785
939
|
}
|
|
786
|
-
function
|
|
787
|
-
e.provide(
|
|
940
|
+
function Na(e, t) {
|
|
941
|
+
e.provide(it, t);
|
|
788
942
|
}
|
|
789
|
-
function
|
|
943
|
+
function Ra(e) {
|
|
790
944
|
return typeof e == "object" && e !== null && "status" in e && e.status === 401;
|
|
791
945
|
}
|
|
792
|
-
const
|
|
946
|
+
const Ba = /* @__PURE__ */ R({
|
|
793
947
|
__name: "AdminLanding",
|
|
794
948
|
props: {
|
|
795
949
|
landing: { default: null }
|
|
796
950
|
},
|
|
797
951
|
setup(e) {
|
|
798
|
-
const t = e,
|
|
799
|
-
const
|
|
800
|
-
return
|
|
952
|
+
const t = e, a = X(), l = ge(), i = P("webx-admin"), s = x(() => {
|
|
953
|
+
const o = a.nav.value;
|
|
954
|
+
return o.length === 0 ? null : ((t.landing === null ? void 0 : o.find((u) => u.path === t.landing)) ?? o[0])?.path ?? null;
|
|
801
955
|
});
|
|
802
|
-
return
|
|
956
|
+
return ee(
|
|
803
957
|
s,
|
|
804
|
-
(
|
|
805
|
-
|
|
958
|
+
(o) => {
|
|
959
|
+
o !== null && l.replace(o);
|
|
806
960
|
},
|
|
807
961
|
{ immediate: !0 }
|
|
808
|
-
), (
|
|
962
|
+
), (o, r) => s.value === null && n(a).state.status === "ready" ? (p(), $(n(zt), {
|
|
809
963
|
key: 0,
|
|
810
964
|
status: "info",
|
|
811
|
-
title:
|
|
812
|
-
description:
|
|
813
|
-
}, null, 8, ["title", "description"])) :
|
|
965
|
+
title: n(i)("shell.empty-title"),
|
|
966
|
+
description: n(i)("shell.empty-description")
|
|
967
|
+
}, null, 8, ["title", "description"])) : U("", !0);
|
|
814
968
|
}
|
|
815
|
-
}),
|
|
969
|
+
}), Ia = /* @__PURE__ */ R({
|
|
816
970
|
__name: "AdminNav",
|
|
817
971
|
props: {
|
|
818
972
|
collapsed: { type: Boolean }
|
|
819
973
|
},
|
|
820
974
|
emits: ["select"],
|
|
821
975
|
setup(e, { emit: t }) {
|
|
822
|
-
const
|
|
823
|
-
get: () =>
|
|
976
|
+
const a = t, l = X(), i = P("webx-admin"), s = ge(), o = Je(), r = x({
|
|
977
|
+
get: () => l.nav.value.find((c) => o.path.startsWith(c.path))?.id ?? "",
|
|
824
978
|
set: (u) => {
|
|
825
|
-
const
|
|
826
|
-
|
|
979
|
+
const c = l.nav.value.find((h) => h.id === u);
|
|
980
|
+
c !== void 0 && s.push(c.path);
|
|
827
981
|
}
|
|
828
982
|
});
|
|
829
|
-
return (u,
|
|
830
|
-
const
|
|
831
|
-
return
|
|
983
|
+
return (u, c) => {
|
|
984
|
+
const h = j("wx-menu-item"), m = j("wx-submenu"), v = j("wx-menu");
|
|
985
|
+
return p(), $(v, {
|
|
832
986
|
modelValue: r.value,
|
|
833
|
-
"onUpdate:modelValue":
|
|
987
|
+
"onUpdate:modelValue": c[0] || (c[0] = (d) => r.value = d),
|
|
834
988
|
collapsed: e.collapsed,
|
|
835
|
-
label:
|
|
836
|
-
onSelect:
|
|
989
|
+
label: n(i)("nav.sections"),
|
|
990
|
+
onSelect: c[1] || (c[1] = (d) => a("select"))
|
|
837
991
|
}, {
|
|
838
992
|
default: g(() => [
|
|
839
|
-
(
|
|
840
|
-
key:
|
|
841
|
-
value:
|
|
842
|
-
icon:
|
|
843
|
-
label:
|
|
993
|
+
(p(!0), T(H, null, Q(n(l).groups.value.top, (d) => (p(), $(h, {
|
|
994
|
+
key: d.id,
|
|
995
|
+
value: d.id,
|
|
996
|
+
icon: d.icon ?? void 0,
|
|
997
|
+
label: d.title
|
|
844
998
|
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
845
|
-
(
|
|
846
|
-
key:
|
|
847
|
-
value: `group:${
|
|
848
|
-
title:
|
|
849
|
-
icon:
|
|
999
|
+
(p(!0), T(H, null, Q(n(l).groups.value.groups, (d) => (p(), $(m, {
|
|
1000
|
+
key: d.id,
|
|
1001
|
+
value: `group:${d.id}`,
|
|
1002
|
+
title: d.title,
|
|
1003
|
+
icon: d.icon ?? "gear"
|
|
850
1004
|
}, {
|
|
851
1005
|
default: g(() => [
|
|
852
|
-
(
|
|
853
|
-
key:
|
|
854
|
-
value:
|
|
855
|
-
icon:
|
|
856
|
-
label:
|
|
1006
|
+
(p(!0), T(H, null, Q(d.entries, (w) => (p(), $(h, {
|
|
1007
|
+
key: w.id,
|
|
1008
|
+
value: w.id,
|
|
1009
|
+
icon: w.icon ?? void 0,
|
|
1010
|
+
label: w.title
|
|
857
1011
|
}, null, 8, ["value", "icon", "label"]))), 128))
|
|
858
1012
|
]),
|
|
859
1013
|
_: 2
|
|
@@ -863,68 +1017,68 @@ const un = /* @__PURE__ */ E({
|
|
|
863
1017
|
}, 8, ["modelValue", "collapsed", "label"]);
|
|
864
1018
|
};
|
|
865
1019
|
}
|
|
866
|
-
}),
|
|
1020
|
+
}), Pa = {
|
|
867
1021
|
key: 0,
|
|
868
1022
|
class: "wx-root wx-admin-plain"
|
|
869
|
-
},
|
|
1023
|
+
}, Da = {
|
|
870
1024
|
key: 1,
|
|
871
1025
|
class: "wx-root wx-admin-plain"
|
|
872
|
-
},
|
|
1026
|
+
}, Ma = {
|
|
873
1027
|
key: 2,
|
|
874
1028
|
class: "wx-root wx-admin-plain"
|
|
875
|
-
},
|
|
1029
|
+
}, Fa = ["src", "alt", "width", "height"], Oa = ["src", "alt", "width", "height"], Ha = ["src", "alt"], ja = { class: "wx-admin__user" }, Ka = { class: "wx-admin__user wx-admin__user--drawer" }, qa = /* @__PURE__ */ R({
|
|
876
1030
|
__name: "AdminShell",
|
|
877
1031
|
setup(e) {
|
|
878
|
-
const t =
|
|
879
|
-
|
|
1032
|
+
const t = X(), a = P("webx-admin"), l = W(null), { width: i, layout: s, collapsed: o, showAside: r, drawerOpen: u, toggle: c, close: h } = Vt(
|
|
1033
|
+
l,
|
|
880
1034
|
{ persist: "webx-admin-shell" }
|
|
881
|
-
), m = x(() => t.state.manifest?.title ?? ""),
|
|
882
|
-
return
|
|
883
|
-
typeof document > "u" || (document.documentElement.dataset.wxShell =
|
|
884
|
-
}),
|
|
1035
|
+
), m = x(() => t.state.manifest?.title ?? ""), v = x(() => t.state.manifest?.branding?.logo ?? null), d = x(() => t.state.manifest?.branding?.mark ?? null), w = x(() => Et(i.value, null));
|
|
1036
|
+
return gt(() => {
|
|
1037
|
+
typeof document > "u" || (document.documentElement.dataset.wxShell = w.value);
|
|
1038
|
+
}), yt(() => {
|
|
885
1039
|
typeof document < "u" && delete document.documentElement.dataset.wxShell;
|
|
886
|
-
}), (
|
|
887
|
-
const
|
|
888
|
-
return
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
k
|
|
892
|
-
])) :
|
|
893
|
-
|
|
894
|
-
label:
|
|
1040
|
+
}), (f, y) => {
|
|
1041
|
+
const k = j("router-view"), M = j("wx-loading"), J = j("wx-button"), S = j("wx-result"), B = j("wx-action"), C = j("wx-text"), A = j("wx-header"), E = j("wx-aside"), K = j("wx-main"), ne = j("wx-container"), ie = j("wx-drawer");
|
|
1042
|
+
return p(), T(H, null, [
|
|
1043
|
+
b(n(Ut)),
|
|
1044
|
+
n(t).state.status === "unauthenticated" ? (p(), T("div", Pa, [
|
|
1045
|
+
b(k)
|
|
1046
|
+
])) : n(t).state.status === "loading" ? (p(), T("div", Da, [
|
|
1047
|
+
b(M, {
|
|
1048
|
+
label: n(a)("shell.loading")
|
|
895
1049
|
}, null, 8, ["label"])
|
|
896
|
-
])) :
|
|
897
|
-
|
|
1050
|
+
])) : n(t).state.status === "error" ? (p(), T("div", Ma, [
|
|
1051
|
+
b(S, {
|
|
898
1052
|
status: "error",
|
|
899
|
-
title:
|
|
900
|
-
description:
|
|
1053
|
+
title: n(a)("shell.error-title"),
|
|
1054
|
+
description: n(t).state.error
|
|
901
1055
|
}, {
|
|
902
1056
|
default: g(() => [
|
|
903
|
-
|
|
1057
|
+
b(J, {
|
|
904
1058
|
type: "primary",
|
|
905
|
-
onClick:
|
|
1059
|
+
onClick: y[0] || (y[0] = (te) => n(t).reload())
|
|
906
1060
|
}, {
|
|
907
1061
|
default: g(() => [
|
|
908
|
-
|
|
1062
|
+
V(L(n(a)("shell.retry")), 1)
|
|
909
1063
|
]),
|
|
910
1064
|
_: 1
|
|
911
1065
|
})
|
|
912
1066
|
]),
|
|
913
1067
|
_: 1
|
|
914
1068
|
}, 8, ["title", "description"])
|
|
915
|
-
])) : (
|
|
1069
|
+
])) : (p(), T("div", {
|
|
916
1070
|
key: 3,
|
|
917
1071
|
ref_key: "shellEl",
|
|
918
|
-
ref:
|
|
919
|
-
class:
|
|
1072
|
+
ref: l,
|
|
1073
|
+
class: ae(["wx-root wx-admin", `wx-admin--${w.value}`])
|
|
920
1074
|
}, [
|
|
921
|
-
|
|
922
|
-
direction:
|
|
1075
|
+
b(ne, {
|
|
1076
|
+
direction: n(s) === "drawer" ? "vertical" : "horizontal",
|
|
923
1077
|
"full-height": "",
|
|
924
1078
|
class: "wx-admin__frame"
|
|
925
1079
|
}, {
|
|
926
1080
|
default: g(() => [
|
|
927
|
-
|
|
1081
|
+
n(s) === "drawer" ? (p(), $(A, {
|
|
928
1082
|
key: 0,
|
|
929
1083
|
class: "wx-admin__header",
|
|
930
1084
|
floating: "",
|
|
@@ -934,126 +1088,126 @@ const un = /* @__PURE__ */ E({
|
|
|
934
1088
|
height: "var(--wx-admin-header-height)"
|
|
935
1089
|
}, {
|
|
936
1090
|
end: g(() => [
|
|
937
|
-
|
|
1091
|
+
F(f.$slots, "user", { expanded: !1 }, void 0, !0)
|
|
938
1092
|
]),
|
|
939
1093
|
default: g(() => [
|
|
940
|
-
|
|
1094
|
+
b(B, {
|
|
941
1095
|
icon: "menu",
|
|
942
|
-
title:
|
|
943
|
-
onClick:
|
|
1096
|
+
title: n(a)("nav.menu"),
|
|
1097
|
+
onClick: n(c)
|
|
944
1098
|
}, null, 8, ["title", "onClick"]),
|
|
945
|
-
|
|
946
|
-
|
|
1099
|
+
F(f.$slots, "brand", {}, () => [
|
|
1100
|
+
v.value ? (p(), T("img", {
|
|
947
1101
|
key: 0,
|
|
948
1102
|
class: "wx-admin__logo",
|
|
949
|
-
src:
|
|
1103
|
+
src: v.value.url,
|
|
950
1104
|
alt: m.value,
|
|
951
|
-
width:
|
|
952
|
-
height:
|
|
953
|
-
}, null, 8,
|
|
1105
|
+
width: v.value.width ?? void 0,
|
|
1106
|
+
height: v.value.height ?? void 0
|
|
1107
|
+
}, null, 8, Fa)) : (p(), $(C, {
|
|
954
1108
|
key: 1,
|
|
955
1109
|
weight: "semibold",
|
|
956
1110
|
truncate: ""
|
|
957
1111
|
}, {
|
|
958
1112
|
default: g(() => [
|
|
959
|
-
|
|
1113
|
+
V(L(m.value), 1)
|
|
960
1114
|
]),
|
|
961
1115
|
_: 1
|
|
962
1116
|
}))
|
|
963
1117
|
], !0)
|
|
964
1118
|
]),
|
|
965
1119
|
_: 3
|
|
966
|
-
})) :
|
|
967
|
-
|
|
1120
|
+
})) : U("", !0),
|
|
1121
|
+
n(r) ? (p(), $(E, {
|
|
968
1122
|
key: 1,
|
|
969
1123
|
class: "wx-admin__aside",
|
|
970
1124
|
sticky: "",
|
|
971
1125
|
floating: "",
|
|
972
1126
|
scroll: "",
|
|
973
1127
|
bordered: !1,
|
|
974
|
-
collapsed: o
|
|
1128
|
+
collapsed: n(o),
|
|
975
1129
|
width: 220,
|
|
976
1130
|
"collapsed-width": 56
|
|
977
1131
|
}, {
|
|
978
1132
|
top: g(() => [
|
|
979
|
-
|
|
980
|
-
class:
|
|
1133
|
+
O("div", {
|
|
1134
|
+
class: ae(["wx-admin__brand", { "wx-admin__brand--stacked": n(o) && d.value }])
|
|
981
1135
|
}, [
|
|
982
|
-
o
|
|
1136
|
+
n(o) ? d.value ? (p(), T("img", {
|
|
983
1137
|
key: 1,
|
|
984
1138
|
class: "wx-admin__mark",
|
|
985
|
-
src:
|
|
1139
|
+
src: d.value.url,
|
|
986
1140
|
alt: m.value
|
|
987
|
-
}, null, 8,
|
|
988
|
-
|
|
1141
|
+
}, null, 8, Ha)) : U("", !0) : F(f.$slots, "brand", {}, () => [
|
|
1142
|
+
v.value ? (p(), T("img", {
|
|
989
1143
|
key: 0,
|
|
990
1144
|
class: "wx-admin__logo",
|
|
991
|
-
src:
|
|
1145
|
+
src: v.value.url,
|
|
992
1146
|
alt: m.value,
|
|
993
|
-
width:
|
|
994
|
-
height:
|
|
995
|
-
}, null, 8,
|
|
1147
|
+
width: v.value.width ?? void 0,
|
|
1148
|
+
height: v.value.height ?? void 0
|
|
1149
|
+
}, null, 8, Oa)) : (p(), $(C, {
|
|
996
1150
|
key: 1,
|
|
997
1151
|
weight: "semibold",
|
|
998
1152
|
truncate: "",
|
|
999
1153
|
class: "wx-admin__title"
|
|
1000
1154
|
}, {
|
|
1001
1155
|
default: g(() => [
|
|
1002
|
-
|
|
1156
|
+
V(L(m.value), 1)
|
|
1003
1157
|
]),
|
|
1004
1158
|
_: 1
|
|
1005
1159
|
}))
|
|
1006
1160
|
], !0, 0),
|
|
1007
|
-
|
|
1161
|
+
b(B, {
|
|
1008
1162
|
icon: "sidebar",
|
|
1009
|
-
title: o
|
|
1010
|
-
onClick:
|
|
1163
|
+
title: n(o) ? n(a)("nav.expand") : n(a)("nav.collapse"),
|
|
1164
|
+
onClick: n(c)
|
|
1011
1165
|
}, null, 8, ["title", "onClick"])
|
|
1012
1166
|
], 2)
|
|
1013
1167
|
]),
|
|
1014
1168
|
bottom: g(() => [
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
expanded: !o
|
|
1169
|
+
O("div", ja, [
|
|
1170
|
+
F(f.$slots, "user", {
|
|
1171
|
+
expanded: !n(o)
|
|
1018
1172
|
}, void 0, !0)
|
|
1019
1173
|
])
|
|
1020
1174
|
]),
|
|
1021
1175
|
default: g(() => [
|
|
1022
|
-
|
|
1176
|
+
F(f.$slots, "nav", { collapsed: n(o) }, void 0, !0)
|
|
1023
1177
|
]),
|
|
1024
1178
|
_: 3
|
|
1025
|
-
}, 8, ["collapsed"])) :
|
|
1026
|
-
|
|
1179
|
+
}, 8, ["collapsed"])) : U("", !0),
|
|
1180
|
+
b(K, {
|
|
1027
1181
|
padding: "none",
|
|
1028
1182
|
class: "wx-admin__screen"
|
|
1029
1183
|
}, {
|
|
1030
1184
|
default: g(() => [
|
|
1031
|
-
k
|
|
1185
|
+
b(k)
|
|
1032
1186
|
]),
|
|
1033
1187
|
_: 1
|
|
1034
1188
|
})
|
|
1035
1189
|
]),
|
|
1036
1190
|
_: 3
|
|
1037
1191
|
}, 8, ["direction"]),
|
|
1038
|
-
|
|
1039
|
-
open:
|
|
1040
|
-
"onUpdate:open":
|
|
1192
|
+
b(ie, {
|
|
1193
|
+
open: n(u),
|
|
1194
|
+
"onUpdate:open": y[1] || (y[1] = (te) => qe(u) ? u.value = te : null),
|
|
1041
1195
|
class: "wx-admin__drawer",
|
|
1042
|
-
title: m.value === "" ?
|
|
1196
|
+
title: m.value === "" ? n(a)("nav.menu") : m.value,
|
|
1043
1197
|
side: "left",
|
|
1044
1198
|
size: 260,
|
|
1045
1199
|
"full-screen": !1,
|
|
1046
1200
|
closable: ""
|
|
1047
1201
|
}, {
|
|
1048
1202
|
footer: g(() => [
|
|
1049
|
-
|
|
1050
|
-
|
|
1203
|
+
O("div", Ka, [
|
|
1204
|
+
F(f.$slots, "user", { expanded: !0 }, void 0, !0)
|
|
1051
1205
|
])
|
|
1052
1206
|
]),
|
|
1053
1207
|
default: g(() => [
|
|
1054
|
-
|
|
1208
|
+
F(f.$slots, "nav", {
|
|
1055
1209
|
collapsed: !1,
|
|
1056
|
-
select:
|
|
1210
|
+
select: n(h)
|
|
1057
1211
|
}, void 0, !0)
|
|
1058
1212
|
]),
|
|
1059
1213
|
_: 3
|
|
@@ -1062,10 +1216,10 @@ const un = /* @__PURE__ */ E({
|
|
|
1062
1216
|
], 64);
|
|
1063
1217
|
};
|
|
1064
1218
|
}
|
|
1065
|
-
}),
|
|
1066
|
-
class
|
|
1067
|
-
constructor(t,
|
|
1068
|
-
super(t), this.status =
|
|
1219
|
+
}), Ya = /* @__PURE__ */ Y(qa, [["__scopeId", "data-v-309fdb9d"]]);
|
|
1220
|
+
class Ce extends Error {
|
|
1221
|
+
constructor(t, a, l = {}, i = null, s = null) {
|
|
1222
|
+
super(t), this.status = a, this.errors = l, this.retryAfter = i, this.body = s, this.name = "HttpError";
|
|
1069
1223
|
}
|
|
1070
1224
|
status;
|
|
1071
1225
|
errors;
|
|
@@ -1082,126 +1236,126 @@ class pe extends Error {
|
|
|
1082
1236
|
return this.status === 429;
|
|
1083
1237
|
}
|
|
1084
1238
|
}
|
|
1085
|
-
const
|
|
1086
|
-
function
|
|
1087
|
-
const t = (e.baseUrl ?? "").replace(/\/$/, ""),
|
|
1088
|
-
let
|
|
1089
|
-
async function r(
|
|
1090
|
-
|
|
1239
|
+
const Xa = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
1240
|
+
function Ga(e = {}) {
|
|
1241
|
+
const t = (e.baseUrl ?? "").replace(/\/$/, ""), a = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", l = e.fetch ?? globalThis.fetch.bind(globalThis), i = e.onUnauthenticated, s = e.headers;
|
|
1242
|
+
let o = !1;
|
|
1243
|
+
async function r(c = !1) {
|
|
1244
|
+
o && !c && Me("XSRF-TOKEN") !== null || (await l(a, { credentials: "same-origin" }), o = !0);
|
|
1091
1245
|
}
|
|
1092
|
-
async function u(
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
const
|
|
1246
|
+
async function u(c, h, m, v = {}, d = !1) {
|
|
1247
|
+
const w = Xa.has(c);
|
|
1248
|
+
w && await r();
|
|
1249
|
+
const f = {
|
|
1096
1250
|
Accept: "application/json",
|
|
1097
1251
|
"X-Requested-With": "XMLHttpRequest",
|
|
1098
1252
|
// Standing headers first, so a caller can still override one for a single request.
|
|
1099
1253
|
...s?.(),
|
|
1100
|
-
...
|
|
1254
|
+
...v.headers
|
|
1101
1255
|
};
|
|
1102
|
-
if (
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1256
|
+
if (w) {
|
|
1257
|
+
const k = Me("XSRF-TOKEN");
|
|
1258
|
+
k !== null && (f["X-XSRF-TOKEN"] = k);
|
|
1105
1259
|
}
|
|
1106
|
-
m !== void 0 && (
|
|
1107
|
-
const
|
|
1108
|
-
method:
|
|
1260
|
+
m !== void 0 && (f["Content-Type"] = "application/json");
|
|
1261
|
+
const y = await l(Qa(t, h, v.query), {
|
|
1262
|
+
method: c,
|
|
1109
1263
|
credentials: "same-origin",
|
|
1110
|
-
headers:
|
|
1111
|
-
signal:
|
|
1264
|
+
headers: f,
|
|
1265
|
+
signal: v.signal,
|
|
1112
1266
|
body: m === void 0 ? void 0 : JSON.stringify(m)
|
|
1113
1267
|
});
|
|
1114
|
-
if (
|
|
1115
|
-
return await r(!0), u(
|
|
1116
|
-
if (
|
|
1117
|
-
throw await
|
|
1118
|
-
if (
|
|
1119
|
-
return await
|
|
1268
|
+
if (y.status === 419 && w && !d)
|
|
1269
|
+
return await r(!0), u(c, h, m, v, !0);
|
|
1270
|
+
if (y.status === 401 && i?.(), !y.ok)
|
|
1271
|
+
throw await Ja(y);
|
|
1272
|
+
if (y.status !== 204)
|
|
1273
|
+
return await y.json();
|
|
1120
1274
|
}
|
|
1121
1275
|
return {
|
|
1122
|
-
get: (
|
|
1123
|
-
post: (
|
|
1124
|
-
put: (
|
|
1125
|
-
patch: (
|
|
1126
|
-
delete: (
|
|
1276
|
+
get: (c, h) => u("GET", c, void 0, h),
|
|
1277
|
+
post: (c, h, m) => u("POST", c, h, m),
|
|
1278
|
+
put: (c, h, m) => u("PUT", c, h, m),
|
|
1279
|
+
patch: (c, h, m) => u("PATCH", c, h, m),
|
|
1280
|
+
delete: (c, h) => u("DELETE", c, void 0, h)
|
|
1127
1281
|
};
|
|
1128
1282
|
}
|
|
1129
|
-
async function
|
|
1283
|
+
async function Ja(e) {
|
|
1130
1284
|
let t = null;
|
|
1131
1285
|
try {
|
|
1132
1286
|
t = await e.json();
|
|
1133
1287
|
} catch {
|
|
1134
1288
|
}
|
|
1135
|
-
const
|
|
1136
|
-
return new
|
|
1137
|
-
|
|
1289
|
+
const a = t ?? {}, l = typeof a.message == "string" && a.message !== "" ? a.message : e.statusText || `Request failed with ${e.status}`, i = a.errors !== null && typeof a.errors == "object" ? a.errors : {}, s = e.headers.get("Retry-After"), o = s === null ? null : Number.parseInt(s, 10);
|
|
1290
|
+
return new Ce(
|
|
1291
|
+
l,
|
|
1138
1292
|
e.status,
|
|
1139
1293
|
i,
|
|
1140
|
-
Number.isFinite(
|
|
1294
|
+
Number.isFinite(o) ? o : null,
|
|
1141
1295
|
t
|
|
1142
1296
|
);
|
|
1143
1297
|
}
|
|
1144
|
-
function
|
|
1298
|
+
function Qa(e, t, a) {
|
|
1145
1299
|
const i = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
|
|
1146
|
-
if (
|
|
1300
|
+
if (a === void 0)
|
|
1147
1301
|
return i;
|
|
1148
1302
|
const s = new URLSearchParams();
|
|
1149
|
-
for (const [r, u] of Object.entries(
|
|
1303
|
+
for (const [r, u] of Object.entries(a))
|
|
1150
1304
|
u != null && s.set(r, String(u));
|
|
1151
|
-
const
|
|
1152
|
-
return
|
|
1305
|
+
const o = s.toString();
|
|
1306
|
+
return o === "" ? i : `${i}${i.includes("?") ? "&" : "?"}${o}`;
|
|
1153
1307
|
}
|
|
1154
|
-
function
|
|
1308
|
+
function Me(e) {
|
|
1155
1309
|
if (typeof document > "u")
|
|
1156
1310
|
return null;
|
|
1157
1311
|
for (const t of document.cookie.split(";")) {
|
|
1158
|
-
const [
|
|
1159
|
-
if (
|
|
1160
|
-
return decodeURIComponent(
|
|
1312
|
+
const [a, ...l] = t.trim().split("=");
|
|
1313
|
+
if (a === e)
|
|
1314
|
+
return decodeURIComponent(l.join("="));
|
|
1161
1315
|
}
|
|
1162
1316
|
return null;
|
|
1163
1317
|
}
|
|
1164
|
-
const
|
|
1165
|
-
function
|
|
1166
|
-
const e =
|
|
1318
|
+
const Za = "webx.theme", rt = /* @__PURE__ */ Symbol("webx-theme");
|
|
1319
|
+
function Yn() {
|
|
1320
|
+
const e = oe(rt, null);
|
|
1167
1321
|
if (e === null)
|
|
1168
1322
|
throw new Error("useTheme() was called outside a panel created by createAdmin().");
|
|
1169
1323
|
return e;
|
|
1170
1324
|
}
|
|
1171
|
-
function
|
|
1172
|
-
e.provide(
|
|
1325
|
+
function en(e, t) {
|
|
1326
|
+
e.provide(rt, t);
|
|
1173
1327
|
}
|
|
1174
|
-
function
|
|
1175
|
-
const t = e.storageKey === void 0 ?
|
|
1176
|
-
preference:
|
|
1328
|
+
function tn(e = {}) {
|
|
1329
|
+
const t = e.storageKey === void 0 ? Za : e.storageKey, a = pe({
|
|
1330
|
+
preference: an(t) ?? "system",
|
|
1177
1331
|
resolved: "light"
|
|
1178
1332
|
});
|
|
1179
|
-
function
|
|
1180
|
-
|
|
1333
|
+
function l() {
|
|
1334
|
+
Yt(a.preference), a.resolved = a.preference === "system" ? Xt() : a.preference;
|
|
1181
1335
|
}
|
|
1182
|
-
return
|
|
1183
|
-
|
|
1336
|
+
return l(), qt((i) => {
|
|
1337
|
+
a.preference === "system" && (a.resolved = i);
|
|
1184
1338
|
}), {
|
|
1185
|
-
state:
|
|
1339
|
+
state: a,
|
|
1186
1340
|
set(i) {
|
|
1187
|
-
|
|
1341
|
+
a.preference = i, l(), Fe(t, i);
|
|
1188
1342
|
},
|
|
1189
1343
|
adopt(i) {
|
|
1190
1344
|
if (i === void 0)
|
|
1191
1345
|
return;
|
|
1192
1346
|
const s = i ?? "system";
|
|
1193
|
-
s !==
|
|
1347
|
+
s !== a.preference && (a.preference = s, l(), Fe(t, s));
|
|
1194
1348
|
}
|
|
1195
1349
|
};
|
|
1196
1350
|
}
|
|
1197
|
-
function
|
|
1351
|
+
function Fe(e, t) {
|
|
1198
1352
|
if (e !== null)
|
|
1199
1353
|
try {
|
|
1200
1354
|
localStorage.setItem(e, t);
|
|
1201
1355
|
} catch {
|
|
1202
1356
|
}
|
|
1203
1357
|
}
|
|
1204
|
-
function
|
|
1358
|
+
function an(e) {
|
|
1205
1359
|
if (e === null)
|
|
1206
1360
|
return null;
|
|
1207
1361
|
try {
|
|
@@ -1211,7 +1365,7 @@ function An(e) {
|
|
|
1211
1365
|
return null;
|
|
1212
1366
|
}
|
|
1213
1367
|
}
|
|
1214
|
-
const
|
|
1368
|
+
const ut = {
|
|
1215
1369
|
shell: {
|
|
1216
1370
|
loading: "Loading the panel…",
|
|
1217
1371
|
"error-title": "The panel could not start",
|
|
@@ -1381,27 +1535,71 @@ const Ve = {
|
|
|
1381
1535
|
"hash-length": "An anchor may be at most :max characters long.",
|
|
1382
1536
|
"hash-shape": "An anchor is a name on the page: no spaces in it.",
|
|
1383
1537
|
"not-localized": "A link is the same in every language and cannot be translated."
|
|
1538
|
+
},
|
|
1539
|
+
// The categories every module shares: the refusals the server says, and the words of the
|
|
1540
|
+
// shared screens under a module's own.
|
|
1541
|
+
categories: {
|
|
1542
|
+
"in-use": "There are :count entries in it. Move them to another category first.",
|
|
1543
|
+
"slug-shape": "Letters, digits and single hyphens between them.",
|
|
1544
|
+
new: "New category",
|
|
1545
|
+
empty: "No categories yet.",
|
|
1546
|
+
"empty-help": "A category groups entries. One entry can be in several of them.",
|
|
1547
|
+
order: "The order here is the order on the site",
|
|
1548
|
+
hidden: "Hidden from the site",
|
|
1549
|
+
"no-address": "No address in this language",
|
|
1550
|
+
count: "Entries: :count",
|
|
1551
|
+
"show-items": "Show its entries",
|
|
1552
|
+
edit: "Edit",
|
|
1553
|
+
"open-on-site": "Open on the site",
|
|
1554
|
+
delete: "Delete",
|
|
1555
|
+
"delete-blocked": "While it holds entries it cannot go — move them first.",
|
|
1556
|
+
"delete-title": "Delete “:name”?",
|
|
1557
|
+
"delete-text": "It goes to the bin and comes off the site, and its address is free again.",
|
|
1558
|
+
deleted: "The category is in the bin.",
|
|
1559
|
+
cancel: "Cancel",
|
|
1560
|
+
create: "Create",
|
|
1561
|
+
save: "Save",
|
|
1562
|
+
saved: "Saved.",
|
|
1563
|
+
"save-failed": "Not saved — look at the marked fields.",
|
|
1564
|
+
"reorder-failed": "The new order was not saved.",
|
|
1565
|
+
"field-title": "Name",
|
|
1566
|
+
"field-slug": "Address",
|
|
1567
|
+
"address-moving": "The address is changing. The old one keeps working and leads to the new one.",
|
|
1568
|
+
untitled: "Untitled",
|
|
1569
|
+
trail: "Where you are",
|
|
1570
|
+
"leave-title": "Leave without saving?",
|
|
1571
|
+
"leave-text": "What was changed here since the last save will be lost.",
|
|
1572
|
+
leave: "Leave",
|
|
1573
|
+
"field-main": "Main",
|
|
1574
|
+
"field-add": "Add a category",
|
|
1575
|
+
"field-remove": "Take out of this category",
|
|
1576
|
+
"field-empty": "In no category yet.",
|
|
1577
|
+
"field-none-left": "Every category is already chosen.",
|
|
1578
|
+
"order-all": "Drag to change the order on the site.",
|
|
1579
|
+
"order-category": "Drag to change the order inside this category. The rest of the list keeps its own.",
|
|
1580
|
+
"order-locked": "Clear the search and the filters to change the order — only a whole list, or one category, can be dragged.",
|
|
1581
|
+
unknown: "One of the chosen categories is not there any more."
|
|
1384
1582
|
}
|
|
1385
|
-
},
|
|
1386
|
-
function
|
|
1387
|
-
const t = e.manifestUrl ??
|
|
1388
|
-
for (const
|
|
1389
|
-
s.push(...
|
|
1390
|
-
if (!s.some((
|
|
1391
|
-
const
|
|
1583
|
+
}, dt = "webx.locale";
|
|
1584
|
+
function Xn(e = {}) {
|
|
1585
|
+
const t = e.manifestUrl ?? un() ?? "/api/cms/manifest", a = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), l = e.basePath ?? "/cms", i = e.modules ?? [], s = [...e.routes ?? []];
|
|
1586
|
+
for (const y of i)
|
|
1587
|
+
s.push(...y.routes ?? []);
|
|
1588
|
+
if (!s.some((y) => y.path === "/")) {
|
|
1589
|
+
const y = i.find((k) => k.landing === !0);
|
|
1392
1590
|
s.push({
|
|
1393
1591
|
path: "/",
|
|
1394
1592
|
name: "webx.home",
|
|
1395
|
-
component:
|
|
1396
|
-
props: { landing:
|
|
1593
|
+
component: Ba,
|
|
1594
|
+
props: { landing: y?.path ?? y?.routes?.[0]?.path ?? null }
|
|
1397
1595
|
});
|
|
1398
1596
|
}
|
|
1399
|
-
const
|
|
1400
|
-
history:
|
|
1597
|
+
const o = xt({
|
|
1598
|
+
history: kt(l),
|
|
1401
1599
|
routes: s
|
|
1402
|
-
}), r =
|
|
1600
|
+
}), r = Ee({ locale: e.locale ?? ln() }), u = tn(), c = e.http ?? Ga({
|
|
1403
1601
|
baseUrl: "",
|
|
1404
|
-
csrfUrl: `${
|
|
1602
|
+
csrfUrl: `${a}/auth/csrf-cookie`,
|
|
1405
1603
|
onUnauthenticated: () => {
|
|
1406
1604
|
m.setUser(null), m.state.status = "unauthenticated";
|
|
1407
1605
|
},
|
|
@@ -1411,174 +1609,174 @@ function fa(e = {}) {
|
|
|
1411
1609
|
// signing in on a Russian sign-in screen lands in an English panel.
|
|
1412
1610
|
headers: () => ({ "X-Webx-Locale": r.state.locale })
|
|
1413
1611
|
});
|
|
1414
|
-
r.defaults("webx-admin",
|
|
1415
|
-
async function
|
|
1416
|
-
const
|
|
1417
|
-
r.load(
|
|
1612
|
+
r.defaults("webx-admin", ut);
|
|
1613
|
+
async function h(y) {
|
|
1614
|
+
const k = await c.get(`${a}/translations/${y}`);
|
|
1615
|
+
r.load(k.data.namespaces, k.data.locale, k.data.fallback), on(k.data.locale), rn(k.data.locale, r.state.panelLocales);
|
|
1418
1616
|
}
|
|
1419
|
-
const m =
|
|
1420
|
-
http:
|
|
1617
|
+
const m = Ua({
|
|
1618
|
+
http: c,
|
|
1421
1619
|
theme: u,
|
|
1422
|
-
basePath:
|
|
1423
|
-
apiPath:
|
|
1620
|
+
basePath: l,
|
|
1621
|
+
apiPath: a,
|
|
1424
1622
|
modules: i,
|
|
1425
1623
|
i18n: r,
|
|
1426
|
-
loadDictionary:
|
|
1624
|
+
loadDictionary: h,
|
|
1427
1625
|
types: e.types,
|
|
1428
1626
|
screens: e.screens,
|
|
1429
|
-
loadManifest: async () => (await
|
|
1430
|
-
}),
|
|
1431
|
-
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1434
|
-
|
|
1627
|
+
loadManifest: async () => (await c.get(t)).data
|
|
1628
|
+
}), v = bt(nn(e));
|
|
1629
|
+
v.use(Nt), Na(v, m), Qt(v, r), en(v, u);
|
|
1630
|
+
const d = W("");
|
|
1631
|
+
v.provide(
|
|
1632
|
+
Rt,
|
|
1435
1633
|
x(() => r.state.locale)
|
|
1436
|
-
),
|
|
1634
|
+
), v.provide(Bt, {
|
|
1437
1635
|
list: x(
|
|
1438
|
-
() => r.state.contentLocales.map((
|
|
1439
|
-
code:
|
|
1440
|
-
label:
|
|
1636
|
+
() => r.state.contentLocales.map((y) => ({
|
|
1637
|
+
code: y.code,
|
|
1638
|
+
label: y.code.toUpperCase()
|
|
1441
1639
|
}))
|
|
1442
1640
|
),
|
|
1443
1641
|
active: x({
|
|
1444
|
-
get: () =>
|
|
1445
|
-
set: (
|
|
1446
|
-
|
|
1642
|
+
get: () => d.value || (r.state.contentLocales[0]?.code ?? ""),
|
|
1643
|
+
set: (y) => {
|
|
1644
|
+
d.value = y;
|
|
1447
1645
|
}
|
|
1448
1646
|
})
|
|
1449
1647
|
});
|
|
1450
|
-
const
|
|
1451
|
-
app:
|
|
1452
|
-
router:
|
|
1648
|
+
const w = {
|
|
1649
|
+
app: v,
|
|
1650
|
+
router: o,
|
|
1453
1651
|
context: m,
|
|
1454
1652
|
i18n: r,
|
|
1455
1653
|
theme: u,
|
|
1456
1654
|
async mount() {
|
|
1457
|
-
await Promise.all([
|
|
1458
|
-
}),
|
|
1655
|
+
await Promise.all([f(), h(r.state.locale)]).catch(() => {
|
|
1656
|
+
}), v.mount(e.el ?? "#webx-app"), await m.reload();
|
|
1459
1657
|
}
|
|
1460
1658
|
};
|
|
1461
|
-
async function
|
|
1462
|
-
const
|
|
1463
|
-
r.state.panelLocales =
|
|
1659
|
+
async function f() {
|
|
1660
|
+
const y = await c.get(`${a}/locales`);
|
|
1661
|
+
r.state.panelLocales = y.data.panel, r.state.contentLocales = y.data.content;
|
|
1464
1662
|
}
|
|
1465
|
-
for (const
|
|
1466
|
-
|
|
1467
|
-
return
|
|
1663
|
+
for (const y of e.plugins ?? [])
|
|
1664
|
+
y.install(w);
|
|
1665
|
+
return v.use(o), w;
|
|
1468
1666
|
}
|
|
1469
|
-
function
|
|
1667
|
+
function nn(e) {
|
|
1470
1668
|
const t = {
|
|
1471
1669
|
// The menu is the panel's own: it is the manifest, drawn.
|
|
1472
1670
|
// The shell hands in what a choice means where it drew the menu — in the drawer it is what
|
|
1473
1671
|
// closes it, and a drawer that stays open over the section it just opened is a drawer the
|
|
1474
1672
|
// reader has to dismiss by hand.
|
|
1475
|
-
nav: (
|
|
1673
|
+
nav: (a) => de(Ia, { collapsed: a.collapsed === !0, onSelect: a.select })
|
|
1476
1674
|
};
|
|
1477
|
-
return e.brand !== void 0 && (t.brand = () =>
|
|
1675
|
+
return e.brand !== void 0 && (t.brand = () => de(e.brand)), e.userMenu !== void 0 && (t.user = (a) => de(e.userMenu, { expanded: a.expanded === !0 })), { render: () => de(Ya, null, t) };
|
|
1478
1676
|
}
|
|
1479
|
-
function
|
|
1480
|
-
const e =
|
|
1677
|
+
function ln() {
|
|
1678
|
+
const e = sn(dt);
|
|
1481
1679
|
return e !== null ? e : typeof document < "u" && document.documentElement.lang !== "" ? document.documentElement.lang : typeof navigator > "u" ? "en" : navigator.language;
|
|
1482
1680
|
}
|
|
1483
|
-
function
|
|
1681
|
+
function on(e) {
|
|
1484
1682
|
try {
|
|
1485
|
-
localStorage.setItem(
|
|
1683
|
+
localStorage.setItem(dt, e);
|
|
1486
1684
|
} catch {
|
|
1487
1685
|
}
|
|
1488
1686
|
}
|
|
1489
|
-
function
|
|
1687
|
+
function sn(e) {
|
|
1490
1688
|
try {
|
|
1491
1689
|
return localStorage.getItem(e);
|
|
1492
1690
|
} catch {
|
|
1493
1691
|
return null;
|
|
1494
1692
|
}
|
|
1495
1693
|
}
|
|
1496
|
-
function
|
|
1497
|
-
typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((
|
|
1694
|
+
function rn(e, t) {
|
|
1695
|
+
typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((a) => a.code === e)?.direction ?? "ltr");
|
|
1498
1696
|
}
|
|
1499
|
-
function
|
|
1697
|
+
function un() {
|
|
1500
1698
|
return typeof document > "u" ? null : document.querySelector('meta[name="webx-manifest"]')?.getAttribute("content") ?? null;
|
|
1501
1699
|
}
|
|
1502
|
-
function
|
|
1700
|
+
function dn(e) {
|
|
1503
1701
|
const t = e.replace(/\r\n?/g, `
|
|
1504
1702
|
`).split(`
|
|
1505
|
-
`),
|
|
1506
|
-
let
|
|
1507
|
-
for (;
|
|
1508
|
-
const i = t[
|
|
1703
|
+
`), a = [];
|
|
1704
|
+
let l = 0;
|
|
1705
|
+
for (; l < t.length; ) {
|
|
1706
|
+
const i = t[l] ?? "";
|
|
1509
1707
|
if (i.trim() === "") {
|
|
1510
|
-
|
|
1708
|
+
l += 1;
|
|
1511
1709
|
continue;
|
|
1512
1710
|
}
|
|
1513
1711
|
if (/^```([\w-]*)\s*$/.exec(i)) {
|
|
1514
1712
|
const u = [];
|
|
1515
|
-
for (
|
|
1516
|
-
u.push(t[
|
|
1517
|
-
|
|
1713
|
+
for (l += 1; l < t.length && !/^```\s*$/.test(t[l] ?? ""); )
|
|
1714
|
+
u.push(t[l] ?? ""), l += 1;
|
|
1715
|
+
l += 1, a.push(`<pre><code>${We(u.join(`
|
|
1518
1716
|
`))}</code></pre>`);
|
|
1519
1717
|
continue;
|
|
1520
1718
|
}
|
|
1521
|
-
const
|
|
1522
|
-
if (
|
|
1523
|
-
const u = Math.min(
|
|
1524
|
-
|
|
1719
|
+
const o = /^(#{1,4})\s+(.*)$/.exec(i);
|
|
1720
|
+
if (o) {
|
|
1721
|
+
const u = Math.min(o[1].length + 1, 5);
|
|
1722
|
+
a.push(`<h${u}>${Te(o[2] ?? "")}</h${u}>`), l += 1;
|
|
1525
1723
|
continue;
|
|
1526
1724
|
}
|
|
1527
|
-
if (
|
|
1528
|
-
const u = /^\s*\d+[.)]\s+/.test(i),
|
|
1529
|
-
for (;
|
|
1530
|
-
for (
|
|
1531
|
-
const m = t[
|
|
1532
|
-
if (m.trim() === "" ||
|
|
1725
|
+
if (me(i)) {
|
|
1726
|
+
const u = /^\s*\d+[.)]\s+/.test(i), c = [];
|
|
1727
|
+
for (; l < t.length && me(t[l] ?? ""); )
|
|
1728
|
+
for (c.push((t[l] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), l += 1; l < t.length; ) {
|
|
1729
|
+
const m = t[l] ?? "";
|
|
1730
|
+
if (m.trim() === "" || me(m) || /^(#{1,4})\s/.test(m) || /^```/.test(m))
|
|
1533
1731
|
break;
|
|
1534
|
-
|
|
1732
|
+
c[c.length - 1] += ` ${m.trim()}`, l += 1;
|
|
1535
1733
|
}
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1734
|
+
const h = u ? "ol" : "ul";
|
|
1735
|
+
a.push(`<${h}>${c.map((m) => `<li>${Te(m)}</li>`).join("")}</${h}>`);
|
|
1538
1736
|
continue;
|
|
1539
1737
|
}
|
|
1540
1738
|
const r = [];
|
|
1541
|
-
for (;
|
|
1542
|
-
const u = t[
|
|
1543
|
-
if (u.trim() === "" ||
|
|
1544
|
-
r.push(u.trim()),
|
|
1739
|
+
for (; l < t.length; ) {
|
|
1740
|
+
const u = t[l] ?? "";
|
|
1741
|
+
if (u.trim() === "" || me(u) || /^(#{1,4})\s/.test(u) || /^```/.test(u)) break;
|
|
1742
|
+
r.push(u.trim()), l += 1;
|
|
1545
1743
|
}
|
|
1546
|
-
|
|
1744
|
+
a.push(`<p>${Te(r.join(" "))}</p>`);
|
|
1547
1745
|
}
|
|
1548
|
-
return
|
|
1746
|
+
return a.join("");
|
|
1549
1747
|
}
|
|
1550
|
-
const
|
|
1551
|
-
function
|
|
1748
|
+
const ce = "\0";
|
|
1749
|
+
function me(e) {
|
|
1552
1750
|
return /^\s*(?:[-*+]|\d+[.)])\s+/.test(e);
|
|
1553
1751
|
}
|
|
1554
|
-
function
|
|
1555
|
-
const t = [],
|
|
1556
|
-
return
|
|
1752
|
+
function Te(e) {
|
|
1753
|
+
const t = [], a = e.replace(/`([^`]+)`/g, (i, s) => (t.push(`<code>${We(s)}</code>`), `${ce}${t.length - 1}${ce}`));
|
|
1754
|
+
return We(a).replace(
|
|
1557
1755
|
/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
|
|
1558
1756
|
'<a href="$2" target="_blank" rel="noopener">$1</a>'
|
|
1559
1757
|
).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(
|
|
1560
|
-
new RegExp(`${
|
|
1758
|
+
new RegExp(`${ce}(\\d+)${ce}`, "g"),
|
|
1561
1759
|
(i, s) => t[Number(s)] ?? ""
|
|
1562
1760
|
);
|
|
1563
1761
|
}
|
|
1564
|
-
function
|
|
1762
|
+
function We(e) {
|
|
1565
1763
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1566
1764
|
}
|
|
1567
|
-
function
|
|
1568
|
-
const t = e.scope("webx-admin"),
|
|
1569
|
-
function
|
|
1570
|
-
const u = e.state.locale,
|
|
1571
|
-
let
|
|
1572
|
-
return
|
|
1765
|
+
function cn(e) {
|
|
1766
|
+
const t = e.scope("webx-admin"), a = /* @__PURE__ */ new Map();
|
|
1767
|
+
function l(s, o, r) {
|
|
1768
|
+
const u = e.state.locale, c = `${u}:${s}`;
|
|
1769
|
+
let h = a.get(c);
|
|
1770
|
+
return h === void 0 && (h = new Intl.DateTimeFormat(u, o), a.set(c, h)), h.format(r);
|
|
1573
1771
|
}
|
|
1574
|
-
const i = (s) =>
|
|
1772
|
+
const i = (s) => l("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, s);
|
|
1575
1773
|
return {
|
|
1576
1774
|
short(s) {
|
|
1577
|
-
const
|
|
1578
|
-
if (
|
|
1775
|
+
const o = fe(s);
|
|
1776
|
+
if (o === null)
|
|
1579
1777
|
return t("dates.never");
|
|
1580
|
-
const r = /* @__PURE__ */ new Date(), u =
|
|
1581
|
-
return u === 0 ? t("dates.today", { time: i(
|
|
1778
|
+
const r = /* @__PURE__ */ new Date(), u = Oe(o, r);
|
|
1779
|
+
return u === 0 ? t("dates.today", { time: i(o) }) : u === -1 ? t("dates.yesterday", { time: i(o) }) : o.getFullYear() === r.getFullYear() ? l(
|
|
1582
1780
|
"this-year",
|
|
1583
1781
|
{
|
|
1584
1782
|
day: "numeric",
|
|
@@ -1587,83 +1785,399 @@ function Nn(e) {
|
|
|
1587
1785
|
minute: "2-digit",
|
|
1588
1786
|
hourCycle: "h23"
|
|
1589
1787
|
},
|
|
1590
|
-
|
|
1591
|
-
) :
|
|
1788
|
+
o
|
|
1789
|
+
) : l("earlier", { day: "numeric", month: "long", year: "numeric" }, o);
|
|
1592
1790
|
},
|
|
1593
1791
|
compact(s) {
|
|
1594
|
-
const
|
|
1595
|
-
if (
|
|
1792
|
+
const o = fe(s);
|
|
1793
|
+
if (o === null)
|
|
1596
1794
|
return t("dates.never");
|
|
1597
1795
|
const r = /* @__PURE__ */ new Date();
|
|
1598
|
-
return
|
|
1796
|
+
return Oe(o, r) === 0 ? i(o) : o.getFullYear() === r.getFullYear() ? l("compact", { day: "numeric", month: "short" }, o) : l("compact-earlier", { dateStyle: "short" }, o);
|
|
1599
1797
|
},
|
|
1600
1798
|
exact(s) {
|
|
1601
|
-
const
|
|
1602
|
-
return
|
|
1799
|
+
const o = fe(s);
|
|
1800
|
+
return o === null ? "" : l("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, o);
|
|
1603
1801
|
},
|
|
1604
1802
|
iso(s) {
|
|
1605
|
-
const
|
|
1606
|
-
return
|
|
1803
|
+
const o = fe(s);
|
|
1804
|
+
return o === null ? "" : o.toISOString();
|
|
1607
1805
|
}
|
|
1608
1806
|
};
|
|
1609
1807
|
}
|
|
1610
|
-
function
|
|
1611
|
-
const e =
|
|
1612
|
-
return
|
|
1808
|
+
function ct() {
|
|
1809
|
+
const e = oe(we, null);
|
|
1810
|
+
return cn(e ?? mn());
|
|
1613
1811
|
}
|
|
1614
|
-
let
|
|
1615
|
-
function
|
|
1616
|
-
return
|
|
1812
|
+
let ve = null;
|
|
1813
|
+
function mn() {
|
|
1814
|
+
return ve === null && (ve = Ee(), ve.defaults("webx-admin", ut)), ve;
|
|
1617
1815
|
}
|
|
1618
|
-
function
|
|
1816
|
+
function fe(e) {
|
|
1619
1817
|
if (e == null || e === "")
|
|
1620
1818
|
return null;
|
|
1621
1819
|
const t = e instanceof Date ? e : new Date(e);
|
|
1622
1820
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
1623
1821
|
}
|
|
1624
|
-
function
|
|
1625
|
-
const
|
|
1626
|
-
return Math.round((
|
|
1822
|
+
function Oe(e, t) {
|
|
1823
|
+
const a = (l) => Date.UTC(l.getFullYear(), l.getMonth(), l.getDate());
|
|
1824
|
+
return Math.round((a(e) - a(t)) / 864e5);
|
|
1627
1825
|
}
|
|
1628
|
-
function
|
|
1629
|
-
const
|
|
1630
|
-
if (
|
|
1631
|
-
return
|
|
1632
|
-
if (
|
|
1633
|
-
if (
|
|
1634
|
-
if (
|
|
1635
|
-
if (
|
|
1636
|
-
if (
|
|
1637
|
-
const i = e instanceof
|
|
1826
|
+
function vn(e, t, a) {
|
|
1827
|
+
const l = e instanceof Ce ? e.status : fn(e);
|
|
1828
|
+
if (l === 422)
|
|
1829
|
+
return pn(e) ?? a ?? t("errors.unknown");
|
|
1830
|
+
if (l === 401) return t("errors.signed-out");
|
|
1831
|
+
if (l === 403) return t("errors.forbidden");
|
|
1832
|
+
if (l === 404) return t("errors.gone");
|
|
1833
|
+
if (l === 409) return t("errors.conflict");
|
|
1834
|
+
if (l === 429) {
|
|
1835
|
+
const i = e instanceof Ce ? e.retryAfter : null;
|
|
1638
1836
|
return i === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: i });
|
|
1639
1837
|
}
|
|
1640
|
-
return
|
|
1838
|
+
return l !== null && l >= 500 ? t("errors.server") : l === null ? t("errors.offline") : a ?? t("errors.unknown");
|
|
1641
1839
|
}
|
|
1642
|
-
function
|
|
1643
|
-
const e =
|
|
1644
|
-
return (t,
|
|
1840
|
+
function Ne() {
|
|
1841
|
+
const e = P("webx-admin");
|
|
1842
|
+
return (t, a) => vn(t, e, a);
|
|
1645
1843
|
}
|
|
1646
|
-
function
|
|
1844
|
+
function fn(e) {
|
|
1647
1845
|
const t = e?.status;
|
|
1648
1846
|
return typeof t == "number" ? t : null;
|
|
1649
1847
|
}
|
|
1650
|
-
function
|
|
1651
|
-
const
|
|
1652
|
-
return typeof
|
|
1848
|
+
function pn(e) {
|
|
1849
|
+
const a = e?.body?.message;
|
|
1850
|
+
return typeof a == "string" && a !== "" ? a : null;
|
|
1653
1851
|
}
|
|
1654
|
-
function
|
|
1655
|
-
const
|
|
1852
|
+
function hn(e, t, a) {
|
|
1853
|
+
const l = `${e.apiPath}/entities/${t}/${a}/notes`, i = (o) => `${e.apiPath}/notes/${o}`, s = (o) => o.data;
|
|
1656
1854
|
return {
|
|
1657
|
-
list: () => e.http.get(
|
|
1658
|
-
add: (
|
|
1659
|
-
save: (
|
|
1660
|
-
remove: (
|
|
1855
|
+
list: () => e.http.get(l).then(s),
|
|
1856
|
+
add: (o) => e.http.post(l, { body: o }).then(s),
|
|
1857
|
+
save: (o, r) => e.http.put(i(o), { body: r }).then(s),
|
|
1858
|
+
remove: (o) => e.http.delete(i(o)).then(() => {
|
|
1661
1859
|
})
|
|
1662
1860
|
};
|
|
1663
1861
|
}
|
|
1664
|
-
|
|
1862
|
+
function gn(e) {
|
|
1863
|
+
return (e.q ?? "").trim() !== "" || e.filtered ? "locked" : e.category == null ? "all" : "category";
|
|
1864
|
+
}
|
|
1865
|
+
function Gn(e, t) {
|
|
1866
|
+
const a = X(), l = P("webx-admin"), i = x(() => gn(t()));
|
|
1867
|
+
return {
|
|
1868
|
+
mode: i,
|
|
1869
|
+
sortable: x(() => i.value !== "locked"),
|
|
1870
|
+
hint: x(() => l(`categories.order-${i.value}`)),
|
|
1871
|
+
move: (s) => ea(a, e, s, i.value === "category" ? t().category ?? null : null)
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
function Re(e = {}) {
|
|
1875
|
+
const t = P("webx-admin");
|
|
1876
|
+
return (a, l) => t(e[a] ?? `webx-admin::categories.${a}`, l);
|
|
1877
|
+
}
|
|
1878
|
+
const yn = /* @__PURE__ */ R({
|
|
1879
|
+
name: "WxCategoryCreateDialog",
|
|
1880
|
+
__name: "CategoryCreateDialog",
|
|
1881
|
+
props: {
|
|
1882
|
+
options: {}
|
|
1883
|
+
},
|
|
1884
|
+
setup(e) {
|
|
1885
|
+
const t = e, { open: a, resolve: l, dismiss: i } = It(), s = xe(X(), t.options.api), o = Re(t.options.words), r = W(""), u = W(!1), c = W({}), h = Ke("field");
|
|
1886
|
+
Le(async () => {
|
|
1887
|
+
await Ye(), h.value?.querySelector("input")?.focus();
|
|
1888
|
+
});
|
|
1889
|
+
function m(d) {
|
|
1890
|
+
const w = Object.keys(c.value).find((f) => f === d || f.startsWith(`${d}.`));
|
|
1891
|
+
return w === void 0 ? void 0 : c.value[w]?.[0];
|
|
1892
|
+
}
|
|
1893
|
+
async function v() {
|
|
1894
|
+
if (!(r.value.trim() === "" || u.value)) {
|
|
1895
|
+
u.value = !0, c.value = {};
|
|
1896
|
+
try {
|
|
1897
|
+
l(await s.create({ title: r.value.trim() }));
|
|
1898
|
+
} catch (d) {
|
|
1899
|
+
c.value = d.body?.errors ?? {};
|
|
1900
|
+
} finally {
|
|
1901
|
+
u.value = !1;
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
return (d, w) => (p(), $(n(tt), {
|
|
1906
|
+
open: n(a),
|
|
1907
|
+
"onUpdate:open": w[2] || (w[2] = (f) => qe(a) ? a.value = f : null),
|
|
1908
|
+
title: n(o)("new"),
|
|
1909
|
+
width: 440
|
|
1910
|
+
}, {
|
|
1911
|
+
footer: g(() => [
|
|
1912
|
+
b(n(Dt), { size: "sm" }, {
|
|
1913
|
+
default: g(() => [
|
|
1914
|
+
b(n(Z), {
|
|
1915
|
+
variant: "outline",
|
|
1916
|
+
onClick: w[1] || (w[1] = (f) => n(i)())
|
|
1917
|
+
}, {
|
|
1918
|
+
default: g(() => [
|
|
1919
|
+
V(L(n(o)("cancel")), 1)
|
|
1920
|
+
]),
|
|
1921
|
+
_: 1
|
|
1922
|
+
}),
|
|
1923
|
+
b(n(Z), {
|
|
1924
|
+
type: "primary",
|
|
1925
|
+
loading: u.value,
|
|
1926
|
+
disabled: r.value.trim() === "",
|
|
1927
|
+
onClick: v
|
|
1928
|
+
}, {
|
|
1929
|
+
default: g(() => [
|
|
1930
|
+
V(L(n(o)("create")), 1)
|
|
1931
|
+
]),
|
|
1932
|
+
_: 1
|
|
1933
|
+
}, 8, ["loading", "disabled"])
|
|
1934
|
+
]),
|
|
1935
|
+
_: 1
|
|
1936
|
+
})
|
|
1937
|
+
]),
|
|
1938
|
+
default: g(() => [
|
|
1939
|
+
b(n(Pt), {
|
|
1940
|
+
label: n(o)("field-title"),
|
|
1941
|
+
error: m("title") ?? m("slug"),
|
|
1942
|
+
required: ""
|
|
1943
|
+
}, {
|
|
1944
|
+
default: g(() => [
|
|
1945
|
+
O("div", {
|
|
1946
|
+
ref_key: "field",
|
|
1947
|
+
ref: h
|
|
1948
|
+
}, [
|
|
1949
|
+
b(n(ye), {
|
|
1950
|
+
modelValue: r.value,
|
|
1951
|
+
"onUpdate:modelValue": w[0] || (w[0] = (f) => r.value = f),
|
|
1952
|
+
"aria-label": n(o)("field-title"),
|
|
1953
|
+
onKeyup: Xe(v, ["enter"])
|
|
1954
|
+
}, null, 8, ["modelValue", "aria-label"])
|
|
1955
|
+
], 512)
|
|
1956
|
+
]),
|
|
1957
|
+
_: 1
|
|
1958
|
+
}, 8, ["label", "error"])
|
|
1959
|
+
]),
|
|
1960
|
+
_: 1
|
|
1961
|
+
}, 8, ["open", "title"]));
|
|
1962
|
+
}
|
|
1963
|
+
}), bn = { class: "wx-category-row__name" }, wn = /* @__PURE__ */ R({
|
|
1964
|
+
name: "WxCategoriesPage",
|
|
1965
|
+
__name: "CategoriesPage",
|
|
1966
|
+
props: {
|
|
1967
|
+
options: {}
|
|
1968
|
+
},
|
|
1969
|
+
setup(e) {
|
|
1970
|
+
const t = e, a = X(), l = xe(a, t.options.api), i = ge(), s = Re(t.options.words), o = Ne(), r = W([]), u = W(!0), c = x(() => a.can(t.options.manage)), h = x(
|
|
1971
|
+
() => a.state.manifest?.modules.find((S) => S.id === t.options.module)?.title ?? ""
|
|
1972
|
+
), m = Mt(yn), v = x(
|
|
1973
|
+
() => c.value ? [{ key: "new", label: s("new"), icon: "plus", primary: !0, run: () => {
|
|
1974
|
+
y();
|
|
1975
|
+
} }] : []
|
|
1976
|
+
);
|
|
1977
|
+
function d(S) {
|
|
1978
|
+
return Number(S[t.options.count] ?? 0);
|
|
1979
|
+
}
|
|
1980
|
+
async function w() {
|
|
1981
|
+
u.value = !0;
|
|
1982
|
+
try {
|
|
1983
|
+
r.value = (await l.list()).data;
|
|
1984
|
+
} catch (S) {
|
|
1985
|
+
D.danger(o(S));
|
|
1986
|
+
} finally {
|
|
1987
|
+
u.value = !1;
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
w();
|
|
1991
|
+
function f(S) {
|
|
1992
|
+
i.push(`${t.options.path}/${S.id}`);
|
|
1993
|
+
}
|
|
1994
|
+
async function y() {
|
|
1995
|
+
const S = await m({ options: t.options });
|
|
1996
|
+
S !== void 0 && f(S);
|
|
1997
|
+
}
|
|
1998
|
+
async function k(S) {
|
|
1999
|
+
if (d(S) > 0) {
|
|
2000
|
+
D.warning(s("delete-blocked"));
|
|
2001
|
+
return;
|
|
2002
|
+
}
|
|
2003
|
+
if (await he({
|
|
2004
|
+
title: s("delete-title", { name: S.name }),
|
|
2005
|
+
message: s("delete-text"),
|
|
2006
|
+
confirmText: s("delete"),
|
|
2007
|
+
cancelText: s("cancel"),
|
|
2008
|
+
tone: "danger"
|
|
2009
|
+
}))
|
|
2010
|
+
try {
|
|
2011
|
+
await l.remove(S.id), D.success(s("deleted")), await w();
|
|
2012
|
+
} catch (C) {
|
|
2013
|
+
D.danger(o(C));
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
function M(S) {
|
|
2017
|
+
const B = [{ key: "edit", label: s("edit"), icon: "edit", run: () => f(S) }], C = t.options.items;
|
|
2018
|
+
return C && d(S) > 0 && B.push({
|
|
2019
|
+
key: "items",
|
|
2020
|
+
label: s("show-items"),
|
|
2021
|
+
icon: "file-txt",
|
|
2022
|
+
run: () => {
|
|
2023
|
+
i.push(C(S.id));
|
|
2024
|
+
}
|
|
2025
|
+
}), S.url && S.is_visible && B.push({ key: "site", label: s("open-on-site"), icon: "link", href: S.url }), c.value && B.push({
|
|
2026
|
+
key: "delete",
|
|
2027
|
+
label: s("delete"),
|
|
2028
|
+
icon: "trash",
|
|
2029
|
+
danger: !0,
|
|
2030
|
+
run: () => {
|
|
2031
|
+
k(S);
|
|
2032
|
+
}
|
|
2033
|
+
}), B;
|
|
2034
|
+
}
|
|
2035
|
+
async function J() {
|
|
2036
|
+
try {
|
|
2037
|
+
await l.reorder(r.value.map((S) => S.id));
|
|
2038
|
+
} catch (S) {
|
|
2039
|
+
D.danger(o(S, s("reorder-failed"))), await w();
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
return (S, B) => {
|
|
2043
|
+
const C = j("router-link");
|
|
2044
|
+
return p(), $(st, {
|
|
2045
|
+
class: "wx-categories",
|
|
2046
|
+
title: h.value,
|
|
2047
|
+
actions: v.value,
|
|
2048
|
+
padding: "sm"
|
|
2049
|
+
}, {
|
|
2050
|
+
default: g(() => [
|
|
2051
|
+
u.value ? (p(), $(n(re), {
|
|
2052
|
+
key: 0,
|
|
2053
|
+
class: "wx-categories__loading",
|
|
2054
|
+
rows: 5
|
|
2055
|
+
})) : r.value.length === 0 ? (p(), $(n(at), {
|
|
2056
|
+
key: 1,
|
|
2057
|
+
title: n(s)("empty"),
|
|
2058
|
+
description: n(s)("empty-help")
|
|
2059
|
+
}, null, 8, ["title", "description"])) : (p(), T(H, { key: 2 }, [
|
|
2060
|
+
b(n(Qe), {
|
|
2061
|
+
modelValue: r.value,
|
|
2062
|
+
"onUpdate:modelValue": B[0] || (B[0] = (A) => r.value = A),
|
|
2063
|
+
class: "wx-categories__list",
|
|
2064
|
+
plain: "",
|
|
2065
|
+
"item-key": "id",
|
|
2066
|
+
"item-label": (A) => A.name,
|
|
2067
|
+
disabled: !c.value,
|
|
2068
|
+
onMove: J
|
|
2069
|
+
}, {
|
|
2070
|
+
default: g(({ item: A }) => [
|
|
2071
|
+
b(C, {
|
|
2072
|
+
class: ae(["wx-category-row", { "is-hidden": !A.is_visible }]),
|
|
2073
|
+
to: `${t.options.path}/${A.id}`
|
|
2074
|
+
}, {
|
|
2075
|
+
default: g(() => [
|
|
2076
|
+
O("span", bn, [
|
|
2077
|
+
b(n(G), {
|
|
2078
|
+
truncate: "",
|
|
2079
|
+
weight: "medium"
|
|
2080
|
+
}, {
|
|
2081
|
+
default: g(() => [
|
|
2082
|
+
V(L(A.name), 1)
|
|
2083
|
+
]),
|
|
2084
|
+
_: 2
|
|
2085
|
+
}, 1024),
|
|
2086
|
+
A.is_visible ? U("", !0) : (p(), $(n(nt), {
|
|
2087
|
+
key: 0,
|
|
2088
|
+
content: n(s)("hidden")
|
|
2089
|
+
}, {
|
|
2090
|
+
default: g(() => [
|
|
2091
|
+
b(n(Ve), {
|
|
2092
|
+
name: "eye-off",
|
|
2093
|
+
size: "sm"
|
|
2094
|
+
})
|
|
2095
|
+
]),
|
|
2096
|
+
_: 1
|
|
2097
|
+
}, 8, ["content"]))
|
|
2098
|
+
]),
|
|
2099
|
+
b(n(G), {
|
|
2100
|
+
size: "sm",
|
|
2101
|
+
tone: "muted",
|
|
2102
|
+
truncate: ""
|
|
2103
|
+
}, {
|
|
2104
|
+
default: g(() => [
|
|
2105
|
+
V(L(A.path === null ? n(s)("no-address") : `/${A.path}`), 1)
|
|
2106
|
+
]),
|
|
2107
|
+
_: 2
|
|
2108
|
+
}, 1024)
|
|
2109
|
+
]),
|
|
2110
|
+
_: 2
|
|
2111
|
+
}, 1032, ["class", "to"])
|
|
2112
|
+
]),
|
|
2113
|
+
actions: g(({ item: A }) => [
|
|
2114
|
+
b(n(G), {
|
|
2115
|
+
class: "wx-category-row__count",
|
|
2116
|
+
size: "sm",
|
|
2117
|
+
tone: "muted"
|
|
2118
|
+
}, {
|
|
2119
|
+
default: g(() => [
|
|
2120
|
+
V(L(n(s)("count", { count: d(A) })), 1)
|
|
2121
|
+
]),
|
|
2122
|
+
_: 2
|
|
2123
|
+
}, 1024),
|
|
2124
|
+
b(Ue, {
|
|
2125
|
+
actions: M(A),
|
|
2126
|
+
label: A.name
|
|
2127
|
+
}, null, 8, ["actions", "label"])
|
|
2128
|
+
]),
|
|
2129
|
+
_: 1
|
|
2130
|
+
}, 8, ["modelValue", "item-label", "disabled"]),
|
|
2131
|
+
b(n(be), {
|
|
2132
|
+
class: "wx-categories__note",
|
|
2133
|
+
type: "info",
|
|
2134
|
+
description: n(s)("order")
|
|
2135
|
+
}, null, 8, ["description"])
|
|
2136
|
+
], 64))
|
|
2137
|
+
]),
|
|
2138
|
+
_: 1
|
|
2139
|
+
}, 8, ["title", "actions"]);
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
}), xn = {
|
|
2143
|
+
class: "wx-save-state",
|
|
2144
|
+
role: "status",
|
|
2145
|
+
"aria-live": "polite"
|
|
2146
|
+
}, kn = /* @__PURE__ */ R({
|
|
2147
|
+
__name: "SaveState",
|
|
2148
|
+
props: {
|
|
2149
|
+
state: {},
|
|
2150
|
+
linger: { default: 2e3 }
|
|
2151
|
+
},
|
|
2152
|
+
setup(e) {
|
|
2153
|
+
const t = e, a = P("webx-admin"), l = W(!1);
|
|
2154
|
+
let i = null;
|
|
2155
|
+
ee(
|
|
2156
|
+
() => t.state,
|
|
2157
|
+
(o, r) => {
|
|
2158
|
+
i !== null && clearTimeout(i), l.value = r === "saving" && o === "saved", l.value && (i = window.setTimeout(() => {
|
|
2159
|
+
l.value = !1, i = null;
|
|
2160
|
+
}, t.linger));
|
|
2161
|
+
}
|
|
2162
|
+
);
|
|
2163
|
+
const s = x(
|
|
2164
|
+
() => t.state === "saving" ? "saving" : l.value ? "saved" : null
|
|
2165
|
+
);
|
|
2166
|
+
return Ge(() => {
|
|
2167
|
+
i !== null && clearTimeout(i);
|
|
2168
|
+
}), (o, r) => (p(), T("span", xn, [
|
|
2169
|
+
s.value ? (p(), $(n(Ve), {
|
|
2170
|
+
key: 0,
|
|
2171
|
+
class: ae(["wx-save-state__mark", { "is-saved": s.value === "saved" }]),
|
|
2172
|
+
name: s.value === "saving" ? "loader" : "check",
|
|
2173
|
+
spin: s.value === "saving",
|
|
2174
|
+
label: n(a)(`editor.${s.value}`)
|
|
2175
|
+
}, null, 8, ["class", "name", "spin", "label"])) : U("", !0)
|
|
2176
|
+
]));
|
|
2177
|
+
}
|
|
2178
|
+
}), _n = /* @__PURE__ */ Y(kn, [["__scopeId", "data-v-216e5e44"]]), $n = { class: "wx-screen-host" }, Tn = /* @__PURE__ */ R({
|
|
1665
2179
|
__name: "Screen",
|
|
1666
|
-
props: /* @__PURE__ */
|
|
2180
|
+
props: /* @__PURE__ */ le({
|
|
1667
2181
|
name: {},
|
|
1668
2182
|
errors: { default: void 0 },
|
|
1669
2183
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -1674,39 +2188,39 @@ const Hn = { class: "wx-screen-host" }, va = /* @__PURE__ */ E({
|
|
|
1674
2188
|
modelValue: { default: () => ({}) },
|
|
1675
2189
|
modelModifiers: {}
|
|
1676
2190
|
}),
|
|
1677
|
-
emits: /* @__PURE__ */
|
|
1678
|
-
setup(e, { expose: t, emit:
|
|
1679
|
-
const
|
|
1680
|
-
async function
|
|
1681
|
-
u.value = null,
|
|
2191
|
+
emits: /* @__PURE__ */ le(["loaded"], ["update:modelValue"]),
|
|
2192
|
+
setup(e, { expose: t, emit: a }) {
|
|
2193
|
+
const l = e, i = a, s = ue(e, "modelValue"), o = X(), r = P("webx-admin"), u = W(null), c = W(null);
|
|
2194
|
+
async function h() {
|
|
2195
|
+
u.value = null, c.value = null;
|
|
1682
2196
|
try {
|
|
1683
|
-
const m = await
|
|
2197
|
+
const m = await o.loadScreen(l.name);
|
|
1684
2198
|
u.value = m, i("loaded", m);
|
|
1685
2199
|
} catch (m) {
|
|
1686
|
-
|
|
2200
|
+
c.value = m instanceof Error ? m.message : String(m);
|
|
1687
2201
|
}
|
|
1688
2202
|
}
|
|
1689
|
-
return
|
|
1690
|
-
|
|
1691
|
-
}, { immediate: !0 }), t({ reload:
|
|
1692
|
-
|
|
2203
|
+
return ee([() => l.name, () => o.i18n.state.locale], () => {
|
|
2204
|
+
h();
|
|
2205
|
+
}, { immediate: !0 }), t({ reload: h }), (m, v) => (p(), T("div", $n, [
|
|
2206
|
+
c.value ? (p(), $(n(be), {
|
|
1693
2207
|
key: 0,
|
|
1694
2208
|
type: "danger",
|
|
1695
|
-
title:
|
|
1696
|
-
description:
|
|
1697
|
-
}, null, 8, ["title", "description"])) : u.value === null ? (
|
|
2209
|
+
title: n(r)("shell.error-title"),
|
|
2210
|
+
description: c.value
|
|
2211
|
+
}, null, 8, ["title", "description"])) : u.value === null ? (p(), $(n(re), {
|
|
1698
2212
|
key: 1,
|
|
1699
2213
|
rows: 4
|
|
1700
|
-
})) : (
|
|
2214
|
+
})) : (p(), $(n(Gt), {
|
|
1701
2215
|
key: 2,
|
|
1702
2216
|
modelValue: s.value,
|
|
1703
|
-
"onUpdate:modelValue":
|
|
2217
|
+
"onUpdate:modelValue": v[0] || (v[0] = (d) => s.value = d),
|
|
1704
2218
|
root: u.value,
|
|
1705
|
-
patch: o
|
|
1706
|
-
types: o
|
|
2219
|
+
patch: n(o).screenPatch(e.name),
|
|
2220
|
+
types: n(o).types,
|
|
1707
2221
|
errors: e.errors,
|
|
1708
|
-
translate: o
|
|
1709
|
-
can: o
|
|
2222
|
+
translate: n(o).i18n.t,
|
|
2223
|
+
can: n(o).can,
|
|
1710
2224
|
disabled: e.disabled,
|
|
1711
2225
|
"label-position": e.labelPosition,
|
|
1712
2226
|
"label-width": e.labelWidth,
|
|
@@ -1714,63 +2228,220 @@ const Hn = { class: "wx-screen-host" }, va = /* @__PURE__ */ E({
|
|
|
1714
2228
|
}, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
|
|
1715
2229
|
]));
|
|
1716
2230
|
}
|
|
1717
|
-
}),
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
"aria-live": "polite"
|
|
1721
|
-
}, jn = /* @__PURE__ */ E({
|
|
1722
|
-
__name: "SaveState",
|
|
2231
|
+
}), Sn = /* @__PURE__ */ R({
|
|
2232
|
+
name: "WxCategoryEditorPage",
|
|
2233
|
+
__name: "CategoryEditorPage",
|
|
1723
2234
|
props: {
|
|
1724
|
-
|
|
1725
|
-
linger: { default: 2e3 }
|
|
2235
|
+
options: {}
|
|
1726
2236
|
},
|
|
1727
2237
|
setup(e) {
|
|
1728
|
-
const t = e,
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
(
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
2238
|
+
const t = e, a = X(), l = xe(a, t.options.api), i = Je(), s = ge(), o = et(), r = Re(t.options.words), u = Ne(), c = x(() => Number(i.params.id)), h = x(() => t.options.path), m = W(null), v = W({}), d = W(null), w = W(""), f = W(!0), y = W(!1), k = W({}), M = x(() => a.can(t.options.manage)), J = x(() => JSON.stringify(v.value)), S = x(() => w.value !== "" && J.value !== w.value), B = x(() => y.value ? "saving" : S.value ? "unsaved" : "saved"), C = x(
|
|
2239
|
+
() => a.state.manifest?.modules.find((z) => z.id === t.options.module)?.title ?? ""
|
|
2240
|
+
), A = x(() => {
|
|
2241
|
+
const z = v.value.title;
|
|
2242
|
+
return Ft(z, o.active.value, m.value?.name ?? "") || r("untitled");
|
|
2243
|
+
});
|
|
2244
|
+
oa({ category: m, values: v, prefix: d, moving: () => r("address-moving") });
|
|
2245
|
+
function E(z) {
|
|
2246
|
+
m.value = z.category, v.value = z.values, d.value = z.prefix, w.value = JSON.stringify(z.values);
|
|
2247
|
+
}
|
|
2248
|
+
async function K() {
|
|
2249
|
+
f.value = !0;
|
|
2250
|
+
try {
|
|
2251
|
+
E(await l.get(c.value));
|
|
2252
|
+
} catch (z) {
|
|
2253
|
+
D.danger(u(z)), s.push(h.value);
|
|
2254
|
+
} finally {
|
|
2255
|
+
f.value = !1;
|
|
1736
2256
|
}
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
(
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
2257
|
+
}
|
|
2258
|
+
async function ne() {
|
|
2259
|
+
if (!(!m.value || y.value || !M.value)) {
|
|
2260
|
+
y.value = !0, k.value = {};
|
|
2261
|
+
try {
|
|
2262
|
+
E(await l.save(m.value.id, v.value)), D.success(r("saved"));
|
|
2263
|
+
} catch (z) {
|
|
2264
|
+
const q = z.body;
|
|
2265
|
+
q?.errors ? (k.value = q.errors, D.danger(r("save-failed"))) : D.danger(u(z));
|
|
2266
|
+
} finally {
|
|
2267
|
+
y.value = !1;
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
async function ie() {
|
|
2272
|
+
const z = m.value;
|
|
2273
|
+
if (!(!z || !await he({
|
|
2274
|
+
title: r("delete-title", { name: z.name }),
|
|
2275
|
+
message: r("delete-text"),
|
|
2276
|
+
confirmText: r("delete"),
|
|
2277
|
+
cancelText: r("cancel"),
|
|
2278
|
+
tone: "danger"
|
|
2279
|
+
})))
|
|
2280
|
+
try {
|
|
2281
|
+
await l.remove(z.id), D.success(r("deleted")), w.value = J.value, s.push(h.value);
|
|
2282
|
+
} catch (_) {
|
|
2283
|
+
D.danger(u(_));
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
function te(z) {
|
|
2287
|
+
S.value && z.preventDefault();
|
|
2288
|
+
}
|
|
2289
|
+
function ke(z) {
|
|
2290
|
+
(z.ctrlKey || z.metaKey) && z.key.toLowerCase() === "s" && (z.preventDefault(), S.value && ne());
|
|
2291
|
+
}
|
|
2292
|
+
ee(c, () => {
|
|
2293
|
+
K();
|
|
2294
|
+
}), Le(() => {
|
|
2295
|
+
K(), window.addEventListener("beforeunload", te);
|
|
2296
|
+
}), Ge(() => {
|
|
2297
|
+
window.removeEventListener("beforeunload", te);
|
|
2298
|
+
}), _t(async () => !S.value || !M.value ? !0 : await he({
|
|
2299
|
+
title: r("leave-title"),
|
|
2300
|
+
message: r("leave-text"),
|
|
2301
|
+
confirmText: r("leave"),
|
|
2302
|
+
cancelText: r("cancel"),
|
|
2303
|
+
tone: "danger"
|
|
2304
|
+
}));
|
|
2305
|
+
const _e = x(() => {
|
|
2306
|
+
const z = m.value, q = [];
|
|
2307
|
+
return z && (z.url && z.is_visible && q.push({ key: "site", label: r("open-on-site"), icon: "link", href: z.url }), M.value && q.push({
|
|
2308
|
+
key: "delete",
|
|
2309
|
+
label: r("delete"),
|
|
2310
|
+
icon: "trash",
|
|
2311
|
+
danger: !0,
|
|
2312
|
+
menu: !0,
|
|
2313
|
+
run: () => {
|
|
2314
|
+
ie();
|
|
2315
|
+
}
|
|
2316
|
+
})), q;
|
|
2317
|
+
});
|
|
2318
|
+
return (z, q) => (p(), T("div", {
|
|
2319
|
+
class: "wx-category-editor",
|
|
2320
|
+
onKeydown: ke
|
|
2321
|
+
}, [
|
|
2322
|
+
f.value || !m.value ? (p(), T(H, { key: 0 }, [
|
|
2323
|
+
b(n(re), {
|
|
2324
|
+
class: "wx-category-editor__ghost",
|
|
2325
|
+
title: "",
|
|
2326
|
+
rows: 1
|
|
2327
|
+
}),
|
|
2328
|
+
b(n(Se), null, {
|
|
2329
|
+
default: g(() => [
|
|
2330
|
+
b(n(re), { rows: 6 })
|
|
2331
|
+
]),
|
|
2332
|
+
_: 1
|
|
2333
|
+
})
|
|
2334
|
+
], 64)) : (p(), T(H, { key: 1 }, [
|
|
2335
|
+
b(ot, {
|
|
2336
|
+
divider: "",
|
|
2337
|
+
back: h.value,
|
|
2338
|
+
"back-label": C.value,
|
|
2339
|
+
title: A.value,
|
|
2340
|
+
subtitle: m.value.path === null ? void 0 : `/${m.value.path}`,
|
|
2341
|
+
actions: _e.value
|
|
2342
|
+
}, Ae({
|
|
2343
|
+
trail: g(() => [
|
|
2344
|
+
b(n(Ot), {
|
|
2345
|
+
size: "sm",
|
|
2346
|
+
label: n(r)("trail")
|
|
2347
|
+
}, {
|
|
2348
|
+
default: g(() => [
|
|
2349
|
+
b(n(Pe), {
|
|
2350
|
+
as: "router-link",
|
|
2351
|
+
to: h.value
|
|
2352
|
+
}, {
|
|
2353
|
+
default: g(() => [
|
|
2354
|
+
V(L(C.value), 1)
|
|
2355
|
+
]),
|
|
2356
|
+
_: 1
|
|
2357
|
+
}, 8, ["to"]),
|
|
2358
|
+
b(n(Pe), { current: "" }, {
|
|
2359
|
+
default: g(() => [
|
|
2360
|
+
V(L(A.value), 1)
|
|
2361
|
+
]),
|
|
2362
|
+
_: 1
|
|
2363
|
+
})
|
|
2364
|
+
]),
|
|
2365
|
+
_: 1
|
|
2366
|
+
}, 8, ["label"])
|
|
2367
|
+
]),
|
|
2368
|
+
_: 2
|
|
2369
|
+
}, [
|
|
2370
|
+
m.value.is_visible ? void 0 : {
|
|
2371
|
+
name: "title-after",
|
|
2372
|
+
fn: g(() => [
|
|
2373
|
+
b(n(ze), { dot: "" }, {
|
|
2374
|
+
default: g(() => [
|
|
2375
|
+
V(L(n(r)("hidden")), 1)
|
|
2376
|
+
]),
|
|
2377
|
+
_: 1
|
|
2378
|
+
})
|
|
2379
|
+
]),
|
|
2380
|
+
key: "0"
|
|
2381
|
+
}
|
|
2382
|
+
]), 1032, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
2383
|
+
b(Tn, {
|
|
2384
|
+
modelValue: v.value,
|
|
2385
|
+
"onUpdate:modelValue": q[0] || (q[0] = (_) => v.value = _),
|
|
2386
|
+
name: t.options.screen,
|
|
2387
|
+
errors: k.value,
|
|
2388
|
+
disabled: !M.value || y.value
|
|
2389
|
+
}, null, 8, ["modelValue", "name", "errors", "disabled"]),
|
|
2390
|
+
M.value ? (p(), $(n(Ht), { key: 0 }, {
|
|
2391
|
+
state: g(() => [
|
|
2392
|
+
b(_n, { state: B.value }, null, 8, ["state"])
|
|
2393
|
+
]),
|
|
2394
|
+
default: g(() => [
|
|
2395
|
+
b(n(Z), {
|
|
2396
|
+
type: "primary",
|
|
2397
|
+
loading: y.value,
|
|
2398
|
+
disabled: !S.value,
|
|
2399
|
+
onClick: ne
|
|
2400
|
+
}, {
|
|
2401
|
+
default: g(() => [
|
|
2402
|
+
V(L(n(r)("save")), 1)
|
|
2403
|
+
]),
|
|
2404
|
+
_: 1
|
|
2405
|
+
}, 8, ["loading", "disabled"])
|
|
2406
|
+
]),
|
|
2407
|
+
_: 1
|
|
2408
|
+
})) : U("", !0)
|
|
2409
|
+
], 64))
|
|
2410
|
+
], 32));
|
|
1752
2411
|
}
|
|
1753
|
-
}),
|
|
2412
|
+
}), Cn = /* @__PURE__ */ Y(Sn, [["__scopeId", "data-v-9a461226"]]);
|
|
2413
|
+
function Jn(e) {
|
|
2414
|
+
return [
|
|
2415
|
+
{ path: e.path, name: e.name, component: wn, props: { options: e } },
|
|
2416
|
+
{
|
|
2417
|
+
path: `${e.path}/:id(\\d+)`,
|
|
2418
|
+
name: `${e.name}.edit`,
|
|
2419
|
+
component: Cn,
|
|
2420
|
+
props: { options: e }
|
|
2421
|
+
}
|
|
2422
|
+
];
|
|
2423
|
+
}
|
|
2424
|
+
const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
1754
2425
|
__name: "FilterChips",
|
|
1755
2426
|
props: {
|
|
1756
2427
|
filters: {}
|
|
1757
2428
|
},
|
|
1758
2429
|
setup(e) {
|
|
1759
|
-
return (t,
|
|
1760
|
-
key:
|
|
2430
|
+
return (t, a) => (p(!0), T(H, null, Q(e.filters, (l) => (p(), $(n(ze), {
|
|
2431
|
+
key: l.key,
|
|
1761
2432
|
class: "wx-filter-chip",
|
|
1762
2433
|
size: "sm",
|
|
1763
2434
|
round: "",
|
|
1764
2435
|
closable: "",
|
|
1765
|
-
onClose: (i) =>
|
|
2436
|
+
onClose: (i) => l.clear()
|
|
1766
2437
|
}, {
|
|
1767
2438
|
default: g(() => [
|
|
1768
|
-
|
|
2439
|
+
V(L(l.label), 1)
|
|
1769
2440
|
]),
|
|
1770
2441
|
_: 2
|
|
1771
2442
|
}, 1032, ["onClose"]))), 128));
|
|
1772
2443
|
}
|
|
1773
|
-
}),
|
|
2444
|
+
}), Wn = { class: "wx-rename__footer" }, Ln = /* @__PURE__ */ R({
|
|
1774
2445
|
__name: "RenameButton",
|
|
1775
2446
|
props: {
|
|
1776
2447
|
name: { default: "" },
|
|
@@ -1781,21 +2452,21 @@ const Hn = { class: "wx-screen-host" }, va = /* @__PURE__ */ E({
|
|
|
1781
2452
|
},
|
|
1782
2453
|
emits: ["rename"],
|
|
1783
2454
|
setup(e, { emit: t }) {
|
|
1784
|
-
const
|
|
1785
|
-
|
|
1786
|
-
|
|
2455
|
+
const a = e, l = t, i = P("webx-admin"), s = W(!1), o = W(a.name), r = W(null), u = x(() => a.label ?? i("editor.rename"));
|
|
2456
|
+
ee(s, async (h) => {
|
|
2457
|
+
h && (o.value = a.name, await Ye(), r.value?.focus(), r.value?.select());
|
|
1787
2458
|
});
|
|
1788
|
-
function
|
|
1789
|
-
const
|
|
1790
|
-
if (
|
|
2459
|
+
function c() {
|
|
2460
|
+
const h = o.value.trim();
|
|
2461
|
+
if (h === "" || h === a.name) {
|
|
1791
2462
|
s.value = !1;
|
|
1792
2463
|
return;
|
|
1793
2464
|
}
|
|
1794
|
-
|
|
2465
|
+
l("rename", h), s.value = !1;
|
|
1795
2466
|
}
|
|
1796
|
-
return (
|
|
2467
|
+
return (h, m) => (p(), $(n(jt), {
|
|
1797
2468
|
open: s.value,
|
|
1798
|
-
"onUpdate:open": m[2] || (m[2] = (
|
|
2469
|
+
"onUpdate:open": m[2] || (m[2] = (v) => s.value = v),
|
|
1799
2470
|
title: u.value,
|
|
1800
2471
|
width: 320,
|
|
1801
2472
|
side: "bottom",
|
|
@@ -1803,7 +2474,7 @@ const Hn = { class: "wx-screen-host" }, va = /* @__PURE__ */ E({
|
|
|
1803
2474
|
teleport: ""
|
|
1804
2475
|
}, {
|
|
1805
2476
|
trigger: g(() => [
|
|
1806
|
-
|
|
2477
|
+
b(n(se), {
|
|
1807
2478
|
type: "edit",
|
|
1808
2479
|
title: u.value,
|
|
1809
2480
|
size: e.size,
|
|
@@ -1811,27 +2482,27 @@ const Hn = { class: "wx-screen-host" }, va = /* @__PURE__ */ E({
|
|
|
1811
2482
|
}, null, 8, ["title", "size", "disabled"])
|
|
1812
2483
|
]),
|
|
1813
2484
|
default: g(() => [
|
|
1814
|
-
|
|
2485
|
+
O("form", {
|
|
1815
2486
|
class: "wx-rename",
|
|
1816
|
-
onSubmit:
|
|
2487
|
+
onSubmit: je(c, ["prevent"])
|
|
1817
2488
|
}, [
|
|
1818
|
-
|
|
2489
|
+
b(n(ye), {
|
|
1819
2490
|
ref_key: "field",
|
|
1820
2491
|
ref: r,
|
|
1821
|
-
modelValue:
|
|
1822
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
2492
|
+
modelValue: o.value,
|
|
2493
|
+
"onUpdate:modelValue": m[0] || (m[0] = (v) => o.value = v),
|
|
1823
2494
|
"aria-label": u.value,
|
|
1824
2495
|
placeholder: e.placeholder,
|
|
1825
|
-
onKeydown: m[1] || (m[1] =
|
|
2496
|
+
onKeydown: m[1] || (m[1] = Xe((v) => s.value = !1, ["esc"]))
|
|
1826
2497
|
}, null, 8, ["modelValue", "aria-label", "placeholder"]),
|
|
1827
|
-
|
|
1828
|
-
|
|
2498
|
+
O("div", Wn, [
|
|
2499
|
+
b(n(Z), {
|
|
1829
2500
|
type: "primary",
|
|
1830
2501
|
size: "sm",
|
|
1831
2502
|
"native-type": "submit"
|
|
1832
2503
|
}, {
|
|
1833
2504
|
default: g(() => [
|
|
1834
|
-
|
|
2505
|
+
V(L(n(i)("editor.save")), 1)
|
|
1835
2506
|
]),
|
|
1836
2507
|
_: 1
|
|
1837
2508
|
})
|
|
@@ -1841,7 +2512,7 @@ const Hn = { class: "wx-screen-host" }, va = /* @__PURE__ */ E({
|
|
|
1841
2512
|
_: 1
|
|
1842
2513
|
}, 8, ["open", "title"]));
|
|
1843
2514
|
}
|
|
1844
|
-
}),
|
|
2515
|
+
}), el = /* @__PURE__ */ Y(Ln, [["__scopeId", "data-v-d879e8d3"]]), An = ["innerHTML"], zn = /* @__PURE__ */ R({
|
|
1845
2516
|
__name: "HelpButton",
|
|
1846
2517
|
props: {
|
|
1847
2518
|
body: {},
|
|
@@ -1851,33 +2522,33 @@ const Hn = { class: "wx-screen-host" }, va = /* @__PURE__ */ E({
|
|
|
1851
2522
|
width: { default: 720 }
|
|
1852
2523
|
},
|
|
1853
2524
|
setup(e) {
|
|
1854
|
-
const t = e,
|
|
1855
|
-
return (
|
|
1856
|
-
|
|
2525
|
+
const t = e, a = P("webx-admin"), l = W(!1), i = x(() => t.title ?? a("help.title")), s = x(() => dn(t.body));
|
|
2526
|
+
return (o, r) => (p(), T(H, null, [
|
|
2527
|
+
b(n(se), {
|
|
1857
2528
|
type: "details",
|
|
1858
2529
|
icon: "question",
|
|
1859
2530
|
tone: "neutral",
|
|
1860
2531
|
size: e.size,
|
|
1861
2532
|
title: e.label ?? i.value,
|
|
1862
|
-
onClick: r[0] || (r[0] = (u) =>
|
|
2533
|
+
onClick: r[0] || (r[0] = (u) => l.value = !0)
|
|
1863
2534
|
}, null, 8, ["size", "title"]),
|
|
1864
|
-
|
|
1865
|
-
open:
|
|
1866
|
-
"onUpdate:open": r[1] || (r[1] = (u) =>
|
|
2535
|
+
b(n(tt), {
|
|
2536
|
+
open: l.value,
|
|
2537
|
+
"onUpdate:open": r[1] || (r[1] = (u) => l.value = u),
|
|
1867
2538
|
title: i.value,
|
|
1868
2539
|
width: e.width
|
|
1869
2540
|
}, {
|
|
1870
2541
|
default: g(() => [
|
|
1871
|
-
|
|
2542
|
+
O("div", {
|
|
1872
2543
|
class: "wx-help",
|
|
1873
2544
|
innerHTML: s.value
|
|
1874
|
-
}, null, 8,
|
|
2545
|
+
}, null, 8, An)
|
|
1875
2546
|
]),
|
|
1876
2547
|
_: 1
|
|
1877
2548
|
}, 8, ["open", "title", "width"])
|
|
1878
2549
|
], 64));
|
|
1879
2550
|
}
|
|
1880
|
-
}),
|
|
2551
|
+
}), tl = /* @__PURE__ */ Y(zn, [["__scopeId", "data-v-6c280d42"]]), mt = /* @__PURE__ */ R({
|
|
1881
2552
|
name: "WxDate",
|
|
1882
2553
|
__name: "DateText",
|
|
1883
2554
|
props: {
|
|
@@ -1887,46 +2558,46 @@ const Hn = { class: "wx-screen-host" }, va = /* @__PURE__ */ E({
|
|
|
1887
2558
|
tone: { default: "muted" }
|
|
1888
2559
|
},
|
|
1889
2560
|
setup(e) {
|
|
1890
|
-
const t = e,
|
|
1891
|
-
return (
|
|
2561
|
+
const t = e, a = ct(), l = x(() => t.compact ? a.compact(t.value) : a.short(t.value)), i = x(() => a.exact(t.value)), s = x(() => a.iso(t.value));
|
|
2562
|
+
return (o, r) => i.value ? (p(), $(n(nt), {
|
|
1892
2563
|
key: 0,
|
|
1893
2564
|
content: i.value
|
|
1894
2565
|
}, {
|
|
1895
2566
|
default: g(() => [
|
|
1896
|
-
|
|
2567
|
+
b(n(G), {
|
|
1897
2568
|
as: "time",
|
|
1898
2569
|
datetime: s.value,
|
|
1899
2570
|
size: e.size,
|
|
1900
2571
|
tone: e.tone
|
|
1901
2572
|
}, {
|
|
1902
2573
|
default: g(() => [
|
|
1903
|
-
|
|
2574
|
+
V(L(l.value), 1)
|
|
1904
2575
|
]),
|
|
1905
2576
|
_: 1
|
|
1906
2577
|
}, 8, ["datetime", "size", "tone"])
|
|
1907
2578
|
]),
|
|
1908
2579
|
_: 1
|
|
1909
|
-
}, 8, ["content"])) : (
|
|
2580
|
+
}, 8, ["content"])) : (p(), $(n(G), {
|
|
1910
2581
|
key: 1,
|
|
1911
2582
|
size: e.size,
|
|
1912
2583
|
tone: e.tone
|
|
1913
2584
|
}, {
|
|
1914
2585
|
default: g(() => [
|
|
1915
|
-
|
|
2586
|
+
V(L(l.value), 1)
|
|
1916
2587
|
]),
|
|
1917
2588
|
_: 1
|
|
1918
2589
|
}, 8, ["size", "tone"]));
|
|
1919
2590
|
}
|
|
1920
|
-
}),
|
|
2591
|
+
}), Vn = { class: "wx-notes" }, En = {
|
|
1921
2592
|
key: 3,
|
|
1922
2593
|
class: "wx-notes__list"
|
|
1923
|
-
},
|
|
2594
|
+
}, Un = { class: "wx-note__body" }, Nn = { class: "wx-note__head" }, Rn = { class: "wx-note__buttons" }, Bn = {
|
|
1924
2595
|
key: 1,
|
|
1925
2596
|
class: "wx-note__text"
|
|
1926
|
-
},
|
|
2597
|
+
}, In = {
|
|
1927
2598
|
key: 4,
|
|
1928
2599
|
class: "wx-notes__new"
|
|
1929
|
-
},
|
|
2600
|
+
}, Pn = /* @__PURE__ */ R({
|
|
1930
2601
|
name: "WxNotes",
|
|
1931
2602
|
__name: "NotesFeed",
|
|
1932
2603
|
props: {
|
|
@@ -1937,52 +2608,52 @@ const Hn = { class: "wx-screen-host" }, va = /* @__PURE__ */ E({
|
|
|
1937
2608
|
},
|
|
1938
2609
|
emits: ["change"],
|
|
1939
2610
|
setup(e, { emit: t }) {
|
|
1940
|
-
const
|
|
1941
|
-
async function
|
|
2611
|
+
const a = e, l = t, i = X(), s = P("webx-admin"), o = Ne(), r = W([]), u = W(!0), c = W(""), h = W(!1), m = W(null), v = W(""), d = x(() => hn(i, a.type, a.id)), w = x(() => a.title ?? s("notes.title"));
|
|
2612
|
+
async function f() {
|
|
1942
2613
|
u.value = !0;
|
|
1943
2614
|
try {
|
|
1944
|
-
r.value = await
|
|
1945
|
-
} catch (
|
|
1946
|
-
|
|
2615
|
+
r.value = await d.value.list();
|
|
2616
|
+
} catch (C) {
|
|
2617
|
+
D.danger(o(C));
|
|
1947
2618
|
} finally {
|
|
1948
2619
|
u.value = !1;
|
|
1949
2620
|
}
|
|
1950
2621
|
}
|
|
1951
|
-
|
|
1952
|
-
() => [
|
|
2622
|
+
ee(
|
|
2623
|
+
() => [a.type, a.id],
|
|
1953
2624
|
() => {
|
|
1954
|
-
m.value = null,
|
|
2625
|
+
m.value = null, c.value = "", f();
|
|
1955
2626
|
},
|
|
1956
2627
|
{ immediate: !0 }
|
|
1957
2628
|
);
|
|
1958
|
-
async function
|
|
1959
|
-
const
|
|
1960
|
-
if (!(
|
|
1961
|
-
|
|
2629
|
+
async function y() {
|
|
2630
|
+
const C = c.value.trim();
|
|
2631
|
+
if (!(C === "" || h.value)) {
|
|
2632
|
+
h.value = !0;
|
|
1962
2633
|
try {
|
|
1963
|
-
r.value = [...r.value, await
|
|
1964
|
-
} catch (
|
|
1965
|
-
|
|
2634
|
+
r.value = [...r.value, await d.value.add(C)], c.value = "", l("change");
|
|
2635
|
+
} catch (A) {
|
|
2636
|
+
D.danger(o(A));
|
|
1966
2637
|
} finally {
|
|
1967
|
-
|
|
2638
|
+
h.value = !1;
|
|
1968
2639
|
}
|
|
1969
2640
|
}
|
|
1970
2641
|
}
|
|
1971
|
-
function
|
|
1972
|
-
m.value =
|
|
2642
|
+
function k(C) {
|
|
2643
|
+
m.value = C.id, v.value = C.body;
|
|
1973
2644
|
}
|
|
1974
|
-
async function
|
|
1975
|
-
const
|
|
1976
|
-
if (
|
|
2645
|
+
async function M(C) {
|
|
2646
|
+
const A = v.value.trim();
|
|
2647
|
+
if (A !== "")
|
|
1977
2648
|
try {
|
|
1978
|
-
const
|
|
1979
|
-
r.value = r.value.map((
|
|
1980
|
-
} catch (
|
|
1981
|
-
|
|
2649
|
+
const E = await d.value.save(C.id, A);
|
|
2650
|
+
r.value = r.value.map((K) => K.id === E.id ? E : K), m.value = null, D.success(s("notes.saved")), l("change");
|
|
2651
|
+
} catch (E) {
|
|
2652
|
+
D.danger(o(E));
|
|
1982
2653
|
}
|
|
1983
2654
|
}
|
|
1984
|
-
async function
|
|
1985
|
-
if (await
|
|
2655
|
+
async function J(C) {
|
|
2656
|
+
if (await he({
|
|
1986
2657
|
title: s("notes.delete-title"),
|
|
1987
2658
|
message: s("notes.delete-text"),
|
|
1988
2659
|
confirmText: s("notes.delete"),
|
|
@@ -1990,235 +2661,247 @@ const Hn = { class: "wx-screen-host" }, va = /* @__PURE__ */ E({
|
|
|
1990
2661
|
tone: "danger"
|
|
1991
2662
|
}))
|
|
1992
2663
|
try {
|
|
1993
|
-
await
|
|
1994
|
-
} catch (
|
|
1995
|
-
|
|
2664
|
+
await d.value.remove(C.id), r.value = r.value.filter((E) => E.id !== C.id), D.success(s("notes.deleted")), l("change");
|
|
2665
|
+
} catch (E) {
|
|
2666
|
+
D.danger(o(E));
|
|
1996
2667
|
}
|
|
1997
2668
|
}
|
|
1998
|
-
function
|
|
1999
|
-
return !
|
|
2000
|
-
{ key: "edit", icon: "edit", label: s("notes.edit"), run: () =>
|
|
2669
|
+
function S(C) {
|
|
2670
|
+
return !a.can || !C.is_mine ? [] : [
|
|
2671
|
+
{ key: "edit", icon: "edit", label: s("notes.edit"), run: () => k(C) },
|
|
2001
2672
|
{
|
|
2002
2673
|
key: "delete",
|
|
2003
2674
|
icon: "trash",
|
|
2004
2675
|
label: s("notes.delete"),
|
|
2005
2676
|
danger: !0,
|
|
2006
2677
|
run: () => {
|
|
2007
|
-
|
|
2678
|
+
J(C);
|
|
2008
2679
|
}
|
|
2009
2680
|
}
|
|
2010
2681
|
];
|
|
2011
2682
|
}
|
|
2012
|
-
function
|
|
2013
|
-
return
|
|
2683
|
+
function B(C) {
|
|
2684
|
+
return C.author?.name ?? s("notes.unknown-author");
|
|
2014
2685
|
}
|
|
2015
|
-
return (
|
|
2016
|
-
|
|
2686
|
+
return (C, A) => (p(), T("section", Vn, [
|
|
2687
|
+
w.value ? (p(), $(n(G), {
|
|
2017
2688
|
key: 0,
|
|
2018
2689
|
weight: "medium",
|
|
2019
2690
|
class: "wx-notes__title"
|
|
2020
2691
|
}, {
|
|
2021
2692
|
default: g(() => [
|
|
2022
|
-
|
|
2693
|
+
V(L(w.value), 1)
|
|
2023
2694
|
]),
|
|
2024
2695
|
_: 1
|
|
2025
|
-
})) :
|
|
2026
|
-
u.value ? (
|
|
2696
|
+
})) : U("", !0),
|
|
2697
|
+
u.value ? (p(), $(n(re), {
|
|
2027
2698
|
key: 1,
|
|
2028
2699
|
rows: 2
|
|
2029
|
-
})) : r.value.length === 0 ? (
|
|
2700
|
+
})) : r.value.length === 0 ? (p(), $(n(at), {
|
|
2030
2701
|
key: 2,
|
|
2031
2702
|
size: "sm",
|
|
2032
|
-
description:
|
|
2033
|
-
}, null, 8, ["description"])) : (
|
|
2034
|
-
(
|
|
2035
|
-
key:
|
|
2703
|
+
description: n(s)("notes.empty")
|
|
2704
|
+
}, null, 8, ["description"])) : (p(), T("ul", En, [
|
|
2705
|
+
(p(!0), T(H, null, Q(r.value, (E) => (p(), T("li", {
|
|
2706
|
+
key: E.id,
|
|
2036
2707
|
class: "wx-note"
|
|
2037
2708
|
}, [
|
|
2038
|
-
|
|
2039
|
-
name:
|
|
2709
|
+
b(n(Kt), {
|
|
2710
|
+
name: B(E),
|
|
2040
2711
|
size: "sm",
|
|
2041
2712
|
tone: "auto"
|
|
2042
2713
|
}, null, 8, ["name"]),
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2714
|
+
O("div", Un, [
|
|
2715
|
+
O("div", Nn, [
|
|
2716
|
+
b(n(G), {
|
|
2046
2717
|
size: "sm",
|
|
2047
2718
|
weight: "medium",
|
|
2048
2719
|
truncate: ""
|
|
2049
2720
|
}, {
|
|
2050
2721
|
default: g(() => [
|
|
2051
|
-
|
|
2722
|
+
V(L(B(E)), 1)
|
|
2052
2723
|
]),
|
|
2053
2724
|
_: 2
|
|
2054
2725
|
}, 1024),
|
|
2055
|
-
|
|
2056
|
-
value:
|
|
2726
|
+
b(mt, {
|
|
2727
|
+
value: E.created_at
|
|
2057
2728
|
}, null, 8, ["value"]),
|
|
2058
|
-
|
|
2059
|
-
actions:
|
|
2060
|
-
label:
|
|
2729
|
+
b(Ue, {
|
|
2730
|
+
actions: S(E),
|
|
2731
|
+
label: B(E)
|
|
2061
2732
|
}, null, 8, ["actions", "label"])
|
|
2062
2733
|
]),
|
|
2063
|
-
m.value ===
|
|
2064
|
-
|
|
2065
|
-
modelValue:
|
|
2066
|
-
"onUpdate:modelValue":
|
|
2734
|
+
m.value === E.id ? (p(), T(H, { key: 0 }, [
|
|
2735
|
+
b(n(De), {
|
|
2736
|
+
modelValue: v.value,
|
|
2737
|
+
"onUpdate:modelValue": A[0] || (A[0] = (K) => v.value = K),
|
|
2067
2738
|
autosize: { minRows: 2, maxRows: 10 }
|
|
2068
2739
|
}, null, 8, ["modelValue"]),
|
|
2069
|
-
|
|
2070
|
-
|
|
2740
|
+
O("div", Rn, [
|
|
2741
|
+
b(n(Z), {
|
|
2071
2742
|
size: "sm",
|
|
2072
2743
|
type: "primary",
|
|
2073
|
-
onClick: (
|
|
2744
|
+
onClick: (K) => M(E)
|
|
2074
2745
|
}, {
|
|
2075
2746
|
default: g(() => [
|
|
2076
|
-
|
|
2747
|
+
V(L(n(s)("notes.save")), 1)
|
|
2077
2748
|
]),
|
|
2078
2749
|
_: 1
|
|
2079
2750
|
}, 8, ["onClick"]),
|
|
2080
|
-
|
|
2751
|
+
b(n(Z), {
|
|
2081
2752
|
size: "sm",
|
|
2082
2753
|
variant: "text",
|
|
2083
|
-
onClick:
|
|
2754
|
+
onClick: A[1] || (A[1] = (K) => m.value = null)
|
|
2084
2755
|
}, {
|
|
2085
2756
|
default: g(() => [
|
|
2086
|
-
|
|
2757
|
+
V(L(n(s)("notes.cancel")), 1)
|
|
2087
2758
|
]),
|
|
2088
2759
|
_: 1
|
|
2089
2760
|
})
|
|
2090
2761
|
])
|
|
2091
|
-
], 64)) : (
|
|
2762
|
+
], 64)) : (p(), T("p", Bn, L(E.body), 1))
|
|
2092
2763
|
])
|
|
2093
2764
|
]))), 128))
|
|
2094
2765
|
])),
|
|
2095
|
-
e.can ? (
|
|
2096
|
-
|
|
2097
|
-
modelValue:
|
|
2098
|
-
"onUpdate:modelValue":
|
|
2099
|
-
placeholder:
|
|
2766
|
+
e.can ? (p(), T("div", In, [
|
|
2767
|
+
b(n(De), {
|
|
2768
|
+
modelValue: c.value,
|
|
2769
|
+
"onUpdate:modelValue": A[2] || (A[2] = (E) => c.value = E),
|
|
2770
|
+
placeholder: n(s)("notes.placeholder"),
|
|
2100
2771
|
autosize: { minRows: 2, maxRows: 8 }
|
|
2101
2772
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
2102
|
-
|
|
2773
|
+
b(n(Z), {
|
|
2103
2774
|
size: "sm",
|
|
2104
2775
|
type: "primary",
|
|
2105
|
-
disabled:
|
|
2106
|
-
loading:
|
|
2107
|
-
onClick:
|
|
2776
|
+
disabled: c.value.trim() === "",
|
|
2777
|
+
loading: h.value,
|
|
2778
|
+
onClick: y
|
|
2108
2779
|
}, {
|
|
2109
2780
|
default: g(() => [
|
|
2110
|
-
|
|
2781
|
+
V(L(n(s)("notes.add")), 1)
|
|
2111
2782
|
]),
|
|
2112
2783
|
_: 1
|
|
2113
2784
|
}, 8, ["disabled", "loading"])
|
|
2114
|
-
])) :
|
|
2785
|
+
])) : U("", !0)
|
|
2115
2786
|
]));
|
|
2116
2787
|
}
|
|
2117
|
-
}),
|
|
2788
|
+
}), al = /* @__PURE__ */ Y(Pn, [["__scopeId", "data-v-71004c1a"]]), Dn = {
|
|
2118
2789
|
key: 1,
|
|
2119
2790
|
class: "wx-backup-note"
|
|
2120
|
-
},
|
|
2791
|
+
}, Mn = 48, Fn = /* @__PURE__ */ R({
|
|
2121
2792
|
name: "WxBackupNote",
|
|
2122
2793
|
__name: "BackupNote",
|
|
2123
2794
|
setup(e) {
|
|
2124
|
-
const t =
|
|
2125
|
-
const
|
|
2126
|
-
if (
|
|
2127
|
-
const
|
|
2128
|
-
return Number.isNaN(
|
|
2795
|
+
const t = X(), a = ct(), l = P("webx-admin"), i = x(() => t.state.manifest?.backup ?? null), s = x(() => i.value !== null && t.can("settings.view")), o = x(() => {
|
|
2796
|
+
const c = i.value?.at;
|
|
2797
|
+
if (c == null) return !0;
|
|
2798
|
+
const h = new Date(c).getTime();
|
|
2799
|
+
return Number.isNaN(h) || Date.now() - h > Mn * 36e5;
|
|
2129
2800
|
}), r = x(() => {
|
|
2130
|
-
const
|
|
2131
|
-
if (
|
|
2132
|
-
const
|
|
2133
|
-
let m =
|
|
2134
|
-
for (; m >= 1024 &&
|
|
2135
|
-
m /= 1024,
|
|
2801
|
+
const c = i.value?.bytes;
|
|
2802
|
+
if (c == null) return "";
|
|
2803
|
+
const h = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte"];
|
|
2804
|
+
let m = c, v = 0;
|
|
2805
|
+
for (; m >= 1024 && v < h.length - 1; )
|
|
2806
|
+
m /= 1024, v++;
|
|
2136
2807
|
return new Intl.NumberFormat(t.i18n.state.locale, {
|
|
2137
2808
|
style: "unit",
|
|
2138
|
-
unit: v
|
|
2809
|
+
unit: h[v],
|
|
2139
2810
|
unitDisplay: "short",
|
|
2140
|
-
maximumFractionDigits: m >= 10 ||
|
|
2811
|
+
maximumFractionDigits: m >= 10 || v === 0 ? 0 : 1
|
|
2141
2812
|
}).format(m);
|
|
2142
2813
|
}), u = x(
|
|
2143
|
-
() => i.value?.at == null ?
|
|
2814
|
+
() => i.value?.at == null ? l("backup.never") : l("backup.stale", { date: a.short(i.value.at) })
|
|
2144
2815
|
);
|
|
2145
|
-
return (
|
|
2816
|
+
return (c, h) => s.value && o.value ? (p(), $(n(be), {
|
|
2146
2817
|
key: 0,
|
|
2147
2818
|
type: "warning",
|
|
2148
2819
|
variant: "soft",
|
|
2149
2820
|
description: u.value
|
|
2150
|
-
}, null, 8, ["description"])) : s.value ? (
|
|
2151
|
-
|
|
2821
|
+
}, null, 8, ["description"])) : s.value ? (p(), T("p", Dn, [
|
|
2822
|
+
b(n(G), {
|
|
2152
2823
|
size: "sm",
|
|
2153
2824
|
tone: "muted"
|
|
2154
2825
|
}, {
|
|
2155
2826
|
default: g(() => [
|
|
2156
|
-
|
|
2827
|
+
V(L(n(l)("backup.title")), 1)
|
|
2157
2828
|
]),
|
|
2158
2829
|
_: 1
|
|
2159
2830
|
}),
|
|
2160
|
-
|
|
2831
|
+
b(mt, {
|
|
2161
2832
|
value: i.value?.at
|
|
2162
2833
|
}, null, 8, ["value"]),
|
|
2163
|
-
r.value ? (
|
|
2834
|
+
r.value ? (p(), $(n(G), {
|
|
2164
2835
|
key: 0,
|
|
2165
2836
|
size: "sm",
|
|
2166
2837
|
tone: "muted"
|
|
2167
2838
|
}, {
|
|
2168
2839
|
default: g(() => [
|
|
2169
|
-
|
|
2840
|
+
V("· " + L(r.value), 1)
|
|
2170
2841
|
]),
|
|
2171
2842
|
_: 1
|
|
2172
|
-
})) :
|
|
2173
|
-
])) :
|
|
2843
|
+
})) : U("", !0)
|
|
2844
|
+
])) : U("", !0);
|
|
2174
2845
|
}
|
|
2175
|
-
}),
|
|
2846
|
+
}), nl = /* @__PURE__ */ Y(Fn, [["__scopeId", "data-v-beeee67e"]]);
|
|
2176
2847
|
export {
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2848
|
+
Ba as AdminLanding,
|
|
2849
|
+
Ia as AdminNav,
|
|
2850
|
+
Ya as AdminShell,
|
|
2851
|
+
Ce as HttpError,
|
|
2852
|
+
ka as WxBackButton,
|
|
2853
|
+
nl as WxBackupNote,
|
|
2854
|
+
la as WxCategoriesField,
|
|
2855
|
+
wn as WxCategoriesPage,
|
|
2856
|
+
yn as WxCategoryCreateDialog,
|
|
2857
|
+
Cn as WxCategoryEditorPage,
|
|
2858
|
+
da as WxCategorySlug,
|
|
2859
|
+
mt as WxDate,
|
|
2860
|
+
Zn as WxFilterChips,
|
|
2861
|
+
tl as WxHelpButton,
|
|
2862
|
+
xa as WxLinkField,
|
|
2863
|
+
wa as WxLinkPicker,
|
|
2864
|
+
st as WxListScreen,
|
|
2865
|
+
al as WxNotes,
|
|
2866
|
+
el as WxRenameButton,
|
|
2867
|
+
Va as WxRichTextField,
|
|
2868
|
+
Ue as WxRowMenu,
|
|
2869
|
+
_n as WxSaveState,
|
|
2870
|
+
Tn as WxScreen,
|
|
2871
|
+
ot as WxScreenHead,
|
|
2872
|
+
it as adminKey,
|
|
2873
|
+
ut as adminMessages,
|
|
2874
|
+
Ea as adminTypes,
|
|
2875
|
+
Jn as categoryRoutes,
|
|
2876
|
+
Xn as createAdmin,
|
|
2877
|
+
Ua as createAdminContext,
|
|
2878
|
+
xe as createCategoriesApi,
|
|
2879
|
+
cn as createDates,
|
|
2880
|
+
Ga as createHttp,
|
|
2881
|
+
Ee as createI18n,
|
|
2882
|
+
ma as createLinksApi,
|
|
2883
|
+
hn as createNotesApi,
|
|
2884
|
+
tn as createTheme,
|
|
2885
|
+
ca as emptyLink,
|
|
2886
|
+
vn as errorText,
|
|
2887
|
+
we as i18nKey,
|
|
2888
|
+
gn as itemOrderMode,
|
|
2889
|
+
Na as provideAdmin,
|
|
2890
|
+
Qt as provideI18n,
|
|
2891
|
+
en as provideTheme,
|
|
2892
|
+
Me as readCookie,
|
|
2893
|
+
dn as renderMarkdown,
|
|
2894
|
+
ea as reorderItems,
|
|
2895
|
+
Qn as rowMenuWidth,
|
|
2896
|
+
rt as themeKey,
|
|
2897
|
+
X as useAdmin,
|
|
2898
|
+
sa as useCategoryEditor,
|
|
2899
|
+
Re as useCategoryWords,
|
|
2900
|
+
ct as useDates,
|
|
2901
|
+
Ne as useErrorText,
|
|
2902
|
+
Jt as useI18n,
|
|
2903
|
+
Gn as useItemOrder,
|
|
2904
|
+
Yn as useTheme,
|
|
2905
|
+
P as useTranslate
|
|
2223
2906
|
};
|
|
2224
2907
|
//# sourceMappingURL=index.js.map
|