@webx-ui/module-blog 0.1.0 → 0.2.1
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/ArticleEditorPage.d.ts +1 -3
- package/dist/TagRenameDialog.d.ts +20 -0
- package/dist/TagsPage.d.ts +1 -3
- package/dist/index.js +1585 -1581
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { provide as
|
|
2
|
-
import { useAdmin as
|
|
3
|
-
import { useLocales as
|
|
4
|
-
import { useRoute as
|
|
5
|
-
import { provideBlocksPreview as
|
|
6
|
-
const
|
|
7
|
-
function zt(
|
|
8
|
-
|
|
1
|
+
import { provide as ct, inject as vt, defineComponent as ee, computed as v, openBlock as p, createElementBlock as G, createVNode as n, unref as e, withCtx as l, createBlock as z, createTextVNode as w, toDisplayString as b, createCommentVNode as H, useModel as qe, mergeModels as Me, ref as C, watch as ue, onMounted as Ne, onBeforeUnmount as Je, Fragment as ve, createElementVNode as j, renderList as Be, normalizeClass as Pe, useTemplateRef as De, nextTick as Ze, isRef as Ie, withKeys as ze, resolveDynamicComponent as tt, mergeProps as pt, useId as ft, withModifiers as at } from "vue";
|
|
2
|
+
import { useAdmin as ne, useTranslate as Q, useDates as mt, useErrorText as ge, WxScreenHead as bt, WxScreen as gt, WxDate as je, rowMenuWidth as st, WxListScreen as Qe, WxRowMenu as Re, WxFilterChips as ht } from "@webx-ui/module-admin";
|
|
3
|
+
import { useLocales as Xe, WxFormItem as ie, WxText as J, WxAlert as We, WxSelect as _e, localizedValue as yt, confirm as be, WxSkeleton as Ue, WxBadge as oe, WxBreadcrumb as wt, WxBreadcrumbItem as lt, WxButton as Z, WxActionBar as rt, toast as L, WxEmpty as Ge, WxSortableList as Ye, WxAction as Oe, useModal as Ee, WxDialog as Fe, WxInput as Ae, WxSpace as Le, useElementWidth as _t, createModal as Ce, WxTable as ot, WxEntityCard as xt, WxIcon as we, WxTooltip as et, WxHeading as kt, WxTextarea as $t, WxSwitch as Tt, WxCard as Vt, WxListDetail as At, WxCheckbox as St } from "@webx-ui/core";
|
|
4
|
+
import { useRoute as He, useRouter as Ke, onBeforeRouteLeave as Wt } from "vue-router";
|
|
5
|
+
import { provideBlocksPreview as Ct } from "@webx-ui/module-blocks";
|
|
6
|
+
const ut = /* @__PURE__ */ Symbol("wx-article-editor");
|
|
7
|
+
function zt(f) {
|
|
8
|
+
ct(ut, f);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function Se() {
|
|
11
|
+
return vt(ut, null);
|
|
12
12
|
}
|
|
13
13
|
const Rt = {
|
|
14
14
|
module: {
|
|
@@ -44,6 +44,9 @@ const Rt = {
|
|
|
44
44
|
"view-draft": "Drafts",
|
|
45
45
|
"view-unpublished": "Off the site",
|
|
46
46
|
bin: "Bin",
|
|
47
|
+
"filter-rubric": "Rubric",
|
|
48
|
+
"filter-tag": "Tag",
|
|
49
|
+
"filter-author": "Author",
|
|
47
50
|
"any-rubric": "Any rubric",
|
|
48
51
|
"any-tag": "Any tag",
|
|
49
52
|
"any-author": "Any author",
|
|
@@ -226,681 +229,623 @@ const Rt = {
|
|
|
226
229
|
"merge-confirm": "Merge"
|
|
227
230
|
}
|
|
228
231
|
}, it = /* @__PURE__ */ new WeakSet();
|
|
229
|
-
function
|
|
232
|
+
function te() {
|
|
230
233
|
try {
|
|
231
|
-
const { i18n:
|
|
232
|
-
it.has(
|
|
234
|
+
const { i18n: f } = ne();
|
|
235
|
+
it.has(f) || (f.defaults("webx-blog", Rt), it.add(f));
|
|
233
236
|
} catch {
|
|
234
237
|
}
|
|
235
238
|
}
|
|
236
|
-
const Ut = { class: "wx-article-address" },
|
|
239
|
+
const Ut = { class: "wx-article-address" }, qt = /* @__PURE__ */ ee({
|
|
237
240
|
name: "WxArticleAddress",
|
|
238
241
|
__name: "ArticleAddress",
|
|
239
|
-
setup(
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
return typeof
|
|
245
|
-
}),
|
|
246
|
-
const
|
|
247
|
-
return typeof
|
|
242
|
+
setup(f) {
|
|
243
|
+
const m = Se(), r = Xe();
|
|
244
|
+
te();
|
|
245
|
+
const y = Q("webx-blog"), u = v(() => {
|
|
246
|
+
const s = m?.values.value.slug;
|
|
247
|
+
return typeof s == "string" ? s : s?.[r.active.value] ?? "";
|
|
248
|
+
}), a = v(() => u.value === "" ? null : `/${[m?.prefix.value ?? "", u.value].filter(Boolean).join("/")}`), t = v(() => {
|
|
249
|
+
const s = m?.article.value?.path;
|
|
250
|
+
return typeof s == "string" && a.value !== null && a.value !== `/${s}`;
|
|
248
251
|
});
|
|
249
|
-
return (
|
|
250
|
-
n(e(
|
|
251
|
-
label: e(
|
|
252
|
+
return (s, i) => (p(), G("div", Ut, [
|
|
253
|
+
n(e(ie), {
|
|
254
|
+
label: e(y)("article.address")
|
|
252
255
|
}, {
|
|
253
|
-
default:
|
|
254
|
-
|
|
256
|
+
default: l(() => [
|
|
257
|
+
a.value ? (p(), z(e(J), {
|
|
255
258
|
key: 0,
|
|
256
259
|
mono: "",
|
|
257
260
|
class: "wx-article-address__value"
|
|
258
261
|
}, {
|
|
259
|
-
default:
|
|
260
|
-
|
|
262
|
+
default: l(() => [
|
|
263
|
+
w(b(a.value), 1)
|
|
261
264
|
]),
|
|
262
265
|
_: 1
|
|
263
|
-
})) : (p(),
|
|
266
|
+
})) : (p(), z(e(J), {
|
|
264
267
|
key: 1,
|
|
265
268
|
size: "sm",
|
|
266
269
|
tone: "muted"
|
|
267
270
|
}, {
|
|
268
|
-
default:
|
|
269
|
-
|
|
271
|
+
default: l(() => [
|
|
272
|
+
w(b(e(y)("article.no-address")), 1)
|
|
270
273
|
]),
|
|
271
274
|
_: 1
|
|
272
275
|
}))
|
|
273
276
|
]),
|
|
274
277
|
_: 1
|
|
275
278
|
}, 8, ["label"]),
|
|
276
|
-
t.value ? (p(),
|
|
279
|
+
t.value ? (p(), z(e(We), {
|
|
277
280
|
key: 0,
|
|
278
281
|
type: "info",
|
|
279
282
|
variant: "soft",
|
|
280
|
-
description: e(
|
|
281
|
-
}, null, 8, ["description"])) :
|
|
283
|
+
description: e(y)("article.address-moving")
|
|
284
|
+
}, null, 8, ["description"])) : H("", !0)
|
|
282
285
|
]));
|
|
283
286
|
}
|
|
284
|
-
}),
|
|
285
|
-
const
|
|
286
|
-
for (const [
|
|
287
|
-
|
|
288
|
-
return
|
|
289
|
-
},
|
|
287
|
+
}), pe = (f, m) => {
|
|
288
|
+
const r = f.__vccOpts || f;
|
|
289
|
+
for (const [y, u] of m)
|
|
290
|
+
r[y] = u;
|
|
291
|
+
return r;
|
|
292
|
+
}, Mt = /* @__PURE__ */ pe(qt, [["__scopeId", "data-v-2ee0dcfe"]]), Nt = /* @__PURE__ */ ee({
|
|
290
293
|
name: "WxArticleAuthor",
|
|
291
294
|
__name: "ArticleAuthor",
|
|
292
|
-
props: /* @__PURE__ */
|
|
295
|
+
props: /* @__PURE__ */ Me({
|
|
293
296
|
disabled: { type: Boolean, default: !1 }
|
|
294
297
|
}, {
|
|
295
298
|
modelValue: { default: null },
|
|
296
299
|
modelModifiers: {}
|
|
297
300
|
}),
|
|
298
301
|
emits: ["update:modelValue"],
|
|
299
|
-
setup(
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
() => (
|
|
302
|
+
setup(f) {
|
|
303
|
+
const m = f, r = qe(f, "modelValue"), y = Se();
|
|
304
|
+
te();
|
|
305
|
+
const u = Q("webx-blog"), a = v(() => m.disabled || y?.disabled.value === !0), t = v(
|
|
306
|
+
() => (y?.options.value.authors ?? []).map((i) => ({
|
|
304
307
|
label: i.title,
|
|
305
308
|
value: i.id
|
|
306
309
|
}))
|
|
307
|
-
),
|
|
308
|
-
get: () =>
|
|
310
|
+
), s = v({
|
|
311
|
+
get: () => r.value,
|
|
309
312
|
set: (i) => {
|
|
310
|
-
|
|
313
|
+
r.value = typeof i == "number" ? i : null;
|
|
311
314
|
}
|
|
312
315
|
});
|
|
313
|
-
return (i,
|
|
314
|
-
modelValue:
|
|
315
|
-
"onUpdate:modelValue":
|
|
316
|
+
return (i, x) => (p(), z(e(_e), {
|
|
317
|
+
modelValue: s.value,
|
|
318
|
+
"onUpdate:modelValue": x[0] || (x[0] = (T) => s.value = T),
|
|
316
319
|
options: t.value,
|
|
317
|
-
placeholder: e(
|
|
318
|
-
disabled:
|
|
320
|
+
placeholder: e(u)("article.no-author"),
|
|
321
|
+
disabled: a.value,
|
|
319
322
|
clearable: "",
|
|
320
323
|
filterable: "",
|
|
321
324
|
teleport: "",
|
|
322
|
-
"aria-label": e(
|
|
325
|
+
"aria-label": e(u)("article.author")
|
|
323
326
|
}, null, 8, ["modelValue", "options", "placeholder", "disabled", "aria-label"]));
|
|
324
327
|
}
|
|
325
328
|
});
|
|
326
|
-
function
|
|
327
|
-
const
|
|
329
|
+
function de(f) {
|
|
330
|
+
const m = `${f.apiPath}/blog/articles`, r = `${f.apiPath}/blog/rubrics`, y = `${f.apiPath}/blog/tags`, u = (a) => a.data;
|
|
328
331
|
return {
|
|
329
|
-
articles: (
|
|
332
|
+
articles: (a = {}) => {
|
|
330
333
|
const t = new URLSearchParams();
|
|
331
|
-
|
|
332
|
-
const
|
|
333
|
-
return
|
|
334
|
+
a.q && t.set("q", a.q), a.rubric != null && t.set("rubric", String(a.rubric)), a.tag != null && t.set("tag", String(a.tag)), a.author != null && t.set("author", String(a.author)), a.status && t.set("status", a.status), a.sort && t.set("sort", a.sort), a.trashed && t.set("trashed", "1"), a.page && a.page > 1 && t.set("page", String(a.page)), a.per_page && t.set("per_page", String(a.per_page));
|
|
335
|
+
const s = t.size > 0 ? `?${t}` : "";
|
|
336
|
+
return f.http.get(`${m}${s}`).then((i) => ({ ...i.meta, data: i.data, filters: i.filters }));
|
|
334
337
|
},
|
|
335
|
-
get: (
|
|
336
|
-
create: (
|
|
337
|
-
save: (
|
|
338
|
-
discard: (
|
|
339
|
-
versions: (
|
|
340
|
-
restoreVersion: (
|
|
341
|
-
tags: (
|
|
342
|
-
const t =
|
|
343
|
-
return
|
|
338
|
+
get: (a) => f.http.get(`${m}/${a}`).then(u),
|
|
339
|
+
create: (a) => f.http.post(m, a).then(u),
|
|
340
|
+
save: (a, t) => f.http.put(`${m}/${a}`, t).then(u),
|
|
341
|
+
discard: (a) => f.http.post(`${m}/${a}/discard`, {}).then(u),
|
|
342
|
+
versions: (a) => f.http.get(`${m}/${a}/versions`).then(u),
|
|
343
|
+
restoreVersion: (a, t) => f.http.post(`${m}/${a}/versions/${t}/restore`, {}).then(u),
|
|
344
|
+
tags: (a = "") => {
|
|
345
|
+
const t = a.trim() === "" ? "" : `?q=${encodeURIComponent(a.trim())}`;
|
|
346
|
+
return f.http.get(`${y}${t}`).then(u);
|
|
344
347
|
},
|
|
345
|
-
createTag: (
|
|
346
|
-
publish: (
|
|
347
|
-
unpublish: (
|
|
348
|
-
remove: (
|
|
348
|
+
createTag: (a) => f.http.post(y, a).then(u),
|
|
349
|
+
publish: (a, t) => f.http.post(`${m}/${a}/publish`, t == null ? {} : { at: t }).then(u),
|
|
350
|
+
unpublish: (a) => f.http.post(`${m}/${a}/unpublish`, {}).then(u),
|
|
351
|
+
remove: (a) => f.http.delete(`${m}/${a}`).then(() => {
|
|
349
352
|
}),
|
|
350
|
-
restore: (
|
|
351
|
-
rubrics: () =>
|
|
352
|
-
createRubric: (
|
|
353
|
-
saveRubric: (
|
|
354
|
-
removeRubric: (
|
|
353
|
+
restore: (a) => f.http.post(`${m}/${a}/restore`, {}).then(u),
|
|
354
|
+
rubrics: () => f.http.get(r),
|
|
355
|
+
createRubric: (a) => f.http.post(r, a).then(u),
|
|
356
|
+
saveRubric: (a, t) => f.http.put(`${r}/${a}`, t).then(u),
|
|
357
|
+
removeRubric: (a) => f.http.delete(`${r}/${a}`).then(() => {
|
|
355
358
|
}),
|
|
356
|
-
sortRubrics: (
|
|
359
|
+
sortRubrics: (a) => f.http.post(`${r}/reorder`, { ids: a }).then(() => {
|
|
357
360
|
}),
|
|
358
|
-
tagsPage: (
|
|
361
|
+
tagsPage: (a = {}) => {
|
|
359
362
|
const t = new URLSearchParams();
|
|
360
|
-
|
|
361
|
-
const
|
|
362
|
-
return
|
|
363
|
+
a.q && t.set("q", a.q), a.empty && t.set("empty", "1"), a.noindex && t.set("noindex", "1"), a.sort && t.set("sort", a.sort), a.page && a.page > 1 && t.set("page", String(a.page)), a.per_page && t.set("per_page", String(a.per_page));
|
|
364
|
+
const s = t.size > 0 ? `?${t}` : "";
|
|
365
|
+
return f.http.get(`${y}${s}`).then((i) => ({ ...i.meta, data: i.data, filters: i.filters }));
|
|
363
366
|
},
|
|
364
|
-
saveTag: (
|
|
365
|
-
removeTag: (
|
|
367
|
+
saveTag: (a, t) => f.http.put(`${y}/${a}`, t).then(u),
|
|
368
|
+
removeTag: (a) => f.http.delete(`${y}/${a}`).then(() => {
|
|
366
369
|
}),
|
|
367
|
-
massTags: (
|
|
368
|
-
mergeTags: (
|
|
370
|
+
massTags: (a, t) => f.http.post(`${y}/mass`, { ids: a, action: t }).then((s) => s.data.affected),
|
|
371
|
+
mergeTags: (a, t, s) => f.http.post(`${y}/merge`, { ids: a, keep: t, redirect: s }).then(u)
|
|
369
372
|
};
|
|
370
373
|
}
|
|
371
|
-
const
|
|
374
|
+
const Bt = { class: "wx-article-editor__screen" }, Pt = 1200, Dt = /* @__PURE__ */ ee({
|
|
372
375
|
__name: "ArticleEditorPage",
|
|
373
376
|
props: {
|
|
374
377
|
base: { default: "/blog" }
|
|
375
378
|
},
|
|
376
|
-
setup(
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
const i =
|
|
380
|
-
const
|
|
381
|
-
return
|
|
382
|
-
}),
|
|
383
|
-
const
|
|
384
|
-
return typeof
|
|
385
|
-
}),
|
|
386
|
-
if (
|
|
387
|
-
const
|
|
388
|
-
return !Number.isNaN(
|
|
389
|
-
}),
|
|
390
|
-
const
|
|
391
|
-
if (!
|
|
392
|
-
const
|
|
379
|
+
setup(f) {
|
|
380
|
+
const m = f, r = ne(), y = de(r), u = He(), a = Ke(), t = Xe(), s = mt();
|
|
381
|
+
te();
|
|
382
|
+
const i = Q("webx-blog"), x = ge(), T = v(() => Number(u.params.id)), c = v(() => `${m.base}/articles`), o = C(null), _ = C({}), W = C(""), S = C(""), E = C(null), F = C({ rubrics: [], authors: [] }), $ = C([]), U = C(!0), R = C(!1), M = C(!1), A = C({}), I = C(null), K = C(""), P = C(0), q = v(() => r.can("blog.articles.manage")), k = v(() => !q.value || M.value), le = v(() => JSON.stringify(_.value)), O = v(() => K.value !== "" && le.value !== K.value), se = v(() => R.value ? "saving" : O.value ? "unsaved" : "saved"), xe = v(() => {
|
|
383
|
+
const V = _.value.title;
|
|
384
|
+
return yt(V, t.active.value, o.value?.title ?? "");
|
|
385
|
+
}), ce = v(() => {
|
|
386
|
+
const V = _.value.published_at;
|
|
387
|
+
return typeof V == "string" && V !== "" ? V : null;
|
|
388
|
+
}), he = v(() => {
|
|
389
|
+
if (ce.value === null) return !1;
|
|
390
|
+
const V = new Date(ce.value.replace(" ", "T"));
|
|
391
|
+
return !Number.isNaN(V.valueOf()) && V.valueOf() > Date.now();
|
|
392
|
+
}), Te = v(() => {
|
|
393
|
+
const V = o.value;
|
|
394
|
+
if (!V) return "";
|
|
395
|
+
const Y = s.short(V.published_at);
|
|
393
396
|
return {
|
|
394
397
|
draft: i("article.live-never"),
|
|
395
|
-
scheduled: i("article.live-scheduled", { date:
|
|
396
|
-
published: i("article.live-since", { date:
|
|
397
|
-
modified: `${i("article.live-since", { date:
|
|
398
|
+
scheduled: i("article.live-scheduled", { date: Y }),
|
|
399
|
+
published: i("article.live-since", { date: Y }),
|
|
400
|
+
modified: `${i("article.live-since", { date: Y })} · ${i("article.live-edited")}`,
|
|
398
401
|
unpublished: i("article.live-off")
|
|
399
|
-
}[
|
|
402
|
+
}[V.status] ?? "";
|
|
400
403
|
});
|
|
401
|
-
|
|
402
|
-
article:
|
|
403
|
-
values:
|
|
404
|
-
options:
|
|
405
|
-
related:
|
|
406
|
-
prefix:
|
|
407
|
-
base:
|
|
408
|
-
canManage:
|
|
409
|
-
disabled:
|
|
410
|
-
reload: () =>
|
|
411
|
-
save: () =>
|
|
404
|
+
Ct({ url: v(() => E.value), reload: P }), zt({
|
|
405
|
+
article: o,
|
|
406
|
+
values: _,
|
|
407
|
+
options: F,
|
|
408
|
+
related: $,
|
|
409
|
+
prefix: S,
|
|
410
|
+
base: m.base,
|
|
411
|
+
canManage: q.value,
|
|
412
|
+
disabled: k,
|
|
413
|
+
reload: () => fe(!0),
|
|
414
|
+
save: () => N()
|
|
412
415
|
});
|
|
413
|
-
function
|
|
414
|
-
|
|
416
|
+
function ke(V) {
|
|
417
|
+
o.value = V.article, _.value = V.values, W.value = V.revision, S.value = V.prefix, E.value = V.preview_url, F.value = V.options, $.value = V.related, K.value = JSON.stringify(V.values), I.value = null;
|
|
415
418
|
}
|
|
416
|
-
async function
|
|
417
|
-
|
|
419
|
+
async function fe(V = !1) {
|
|
420
|
+
V || (U.value = !0);
|
|
418
421
|
try {
|
|
419
|
-
|
|
420
|
-
} catch (
|
|
421
|
-
L.danger(
|
|
422
|
+
ke(await y.get(T.value));
|
|
423
|
+
} catch (Y) {
|
|
424
|
+
L.danger(x(Y)), a.push(c.value);
|
|
422
425
|
} finally {
|
|
423
|
-
|
|
426
|
+
U.value = !1;
|
|
424
427
|
}
|
|
425
428
|
}
|
|
426
|
-
let
|
|
427
|
-
function
|
|
428
|
-
!
|
|
429
|
-
|
|
430
|
-
},
|
|
429
|
+
let re;
|
|
430
|
+
function me() {
|
|
431
|
+
!q.value || I.value || !O.value || (clearTimeout(re), re = setTimeout(() => {
|
|
432
|
+
N();
|
|
433
|
+
}, Pt));
|
|
431
434
|
}
|
|
432
|
-
function
|
|
433
|
-
!
|
|
435
|
+
function g() {
|
|
436
|
+
!q.value || I.value || !O.value || R.value || (clearTimeout(re), N());
|
|
434
437
|
}
|
|
435
|
-
async function
|
|
436
|
-
if (!
|
|
437
|
-
clearTimeout(
|
|
438
|
-
const
|
|
439
|
-
|
|
438
|
+
async function N() {
|
|
439
|
+
if (!o.value || R.value || !q.value) return;
|
|
440
|
+
clearTimeout(re);
|
|
441
|
+
const V = le.value, Y = _.value;
|
|
442
|
+
R.value = !0, A.value = {};
|
|
440
443
|
try {
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
} catch (
|
|
444
|
-
const
|
|
445
|
-
|
|
444
|
+
const ae = await y.save(o.value.id, { values: Y, revision: W.value });
|
|
445
|
+
o.value = ae.article, W.value = ae.revision, S.value = ae.prefix, E.value = ae.preview_url, F.value = ae.options, $.value = ae.related, I.value = null, le.value === V && (K.value = V), P.value += 1;
|
|
446
|
+
} catch (ae) {
|
|
447
|
+
const Ve = ae;
|
|
448
|
+
Ve.status === 409 && Ve.body?.data ? I.value = Ve.body : Ve.body?.errors ? (A.value = Ve.body.errors, L.danger(i("article.save-failed"))) : L.danger(x(ae));
|
|
446
449
|
} finally {
|
|
447
|
-
|
|
450
|
+
R.value = !1;
|
|
448
451
|
}
|
|
449
452
|
}
|
|
450
|
-
async function
|
|
451
|
-
await
|
|
453
|
+
async function B() {
|
|
454
|
+
await be({
|
|
452
455
|
title: i("article.conflict-theirs-title"),
|
|
453
456
|
message: i("article.conflict-theirs-text"),
|
|
454
457
|
confirmText: i("article.conflict-theirs"),
|
|
455
458
|
cancelText: i("panel.cancel"),
|
|
456
459
|
tone: "danger"
|
|
457
|
-
}) && await
|
|
460
|
+
}) && await fe(!0);
|
|
458
461
|
}
|
|
459
|
-
async function
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
+
async function X() {
|
|
463
|
+
const V = I.value;
|
|
464
|
+
V && (W.value = V.data.revision, I.value = null, await N());
|
|
462
465
|
}
|
|
463
|
-
async function
|
|
464
|
-
if (!(!
|
|
466
|
+
async function ye() {
|
|
467
|
+
if (!(!o.value || !await be({
|
|
465
468
|
title: i("article.discard-title"),
|
|
466
469
|
message: i("article.discard-text"),
|
|
467
470
|
confirmText: i("article.discard"),
|
|
468
471
|
cancelText: i("panel.cancel"),
|
|
469
472
|
tone: "danger"
|
|
470
473
|
}))) {
|
|
471
|
-
|
|
474
|
+
M.value = !0;
|
|
472
475
|
try {
|
|
473
|
-
|
|
474
|
-
} catch (
|
|
475
|
-
L.danger(
|
|
476
|
+
ke(await y.discard(o.value.id)), L.success(i("article.discarded"));
|
|
477
|
+
} catch (Y) {
|
|
478
|
+
L.danger(x(Y));
|
|
476
479
|
} finally {
|
|
477
|
-
|
|
480
|
+
M.value = !1;
|
|
478
481
|
}
|
|
479
482
|
}
|
|
480
483
|
}
|
|
481
|
-
async function
|
|
482
|
-
const
|
|
483
|
-
if (!
|
|
484
|
-
const
|
|
485
|
-
if (await
|
|
486
|
-
title: i("article.publish-title", { title:
|
|
487
|
-
message:
|
|
488
|
-
confirmText:
|
|
484
|
+
async function d() {
|
|
485
|
+
const V = o.value;
|
|
486
|
+
if (!V) return;
|
|
487
|
+
const Y = V.path === null ? null : `/${V.path}`, ae = ce.value === null ? i("article.publish-now") : s.short(ce.value);
|
|
488
|
+
if (await be({
|
|
489
|
+
title: i("article.publish-title", { title: V.title }),
|
|
490
|
+
message: he.value ? i("article.publish-later", { date: ae }) : Y === null ? i("article.publish-nowhere") : i("article.publish-text", { address: Y }),
|
|
491
|
+
confirmText: he.value ? i("article.schedule") : i("panel.publish"),
|
|
489
492
|
cancelText: i("panel.cancel")
|
|
490
|
-
}) && (
|
|
491
|
-
|
|
493
|
+
}) && (O.value && await N(), !I.value)) {
|
|
494
|
+
M.value = !0;
|
|
492
495
|
try {
|
|
493
|
-
await
|
|
494
|
-
} catch (
|
|
495
|
-
L.danger(
|
|
496
|
+
await y.publish(V.id, ce.value), await fe(!0), L.success(he.value ? i("article.scheduled") : i("panel.published"));
|
|
497
|
+
} catch (dt) {
|
|
498
|
+
L.danger(x(dt));
|
|
496
499
|
} finally {
|
|
497
|
-
|
|
500
|
+
M.value = !1;
|
|
498
501
|
}
|
|
499
502
|
}
|
|
500
503
|
}
|
|
501
|
-
function
|
|
502
|
-
const
|
|
503
|
-
return
|
|
504
|
+
function D() {
|
|
505
|
+
const V = o.value?.status;
|
|
506
|
+
return V === "published" ? "success" : V === "modified" ? "warning" : V === "scheduled" ? "primary" : "default";
|
|
504
507
|
}
|
|
505
|
-
function
|
|
506
|
-
|
|
508
|
+
function h(V) {
|
|
509
|
+
O.value && V.preventDefault();
|
|
507
510
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}),
|
|
511
|
-
|
|
512
|
-
}),
|
|
513
|
-
clearTimeout(
|
|
514
|
-
}),
|
|
511
|
+
ue(le, me), ue(T, () => {
|
|
512
|
+
fe();
|
|
513
|
+
}), Ne(() => {
|
|
514
|
+
fe(), window.addEventListener("beforeunload", h);
|
|
515
|
+
}), Je(() => {
|
|
516
|
+
clearTimeout(re), window.removeEventListener("beforeunload", h);
|
|
517
|
+
}), Wt(async () => !O.value || !q.value || (await N(), !O.value) ? !0 : await be({
|
|
515
518
|
title: i("article.leave-title"),
|
|
516
519
|
message: i("article.leave-text"),
|
|
517
520
|
confirmText: i("article.leave"),
|
|
518
521
|
cancelText: i("panel.cancel"),
|
|
519
522
|
tone: "danger"
|
|
520
|
-
}))
|
|
521
|
-
|
|
522
|
-
|
|
523
|
+
}));
|
|
524
|
+
const $e = v(() => {
|
|
525
|
+
const V = [];
|
|
526
|
+
return E.value && V.push({ key: "preview", label: i("article.preview"), icon: "eye", href: E.value }), o.value?.url && o.value.status !== "draft" && V.push({
|
|
527
|
+
key: "site",
|
|
528
|
+
label: i("panel.open-on-site"),
|
|
529
|
+
icon: "link",
|
|
530
|
+
href: o.value.url
|
|
531
|
+
}), V;
|
|
532
|
+
});
|
|
533
|
+
return (V, Y) => (p(), G("div", {
|
|
523
534
|
class: "wx-article-editor",
|
|
524
|
-
onFocusout:
|
|
535
|
+
onFocusout: g
|
|
525
536
|
}, [
|
|
526
|
-
|
|
537
|
+
U.value || !o.value ? (p(), G(ve, { key: 0 }, [
|
|
527
538
|
n(e(Ue), {
|
|
528
539
|
class: "wx-article-editor__ghost",
|
|
529
540
|
title: "",
|
|
530
541
|
rows: 1
|
|
531
542
|
}),
|
|
532
543
|
n(e(Ue), { rows: 8 })
|
|
533
|
-
], 64)) : (p(),
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
544
|
+
], 64)) : (p(), G(ve, { key: 1 }, [
|
|
545
|
+
n(e(bt), {
|
|
546
|
+
divider: "",
|
|
547
|
+
back: c.value,
|
|
548
|
+
"back-label": e(i)("module.articles"),
|
|
549
|
+
title: xe.value || e(i)("article.untitled"),
|
|
550
|
+
actions: $e.value
|
|
551
|
+
}, {
|
|
552
|
+
trail: l(() => [
|
|
541
553
|
n(e(wt), {
|
|
542
554
|
size: "sm",
|
|
543
555
|
label: e(i)("article.trail")
|
|
544
556
|
}, {
|
|
545
|
-
default:
|
|
546
|
-
n(e(
|
|
557
|
+
default: l(() => [
|
|
558
|
+
n(e(lt), {
|
|
547
559
|
as: "router-link",
|
|
548
|
-
to:
|
|
560
|
+
to: c.value
|
|
549
561
|
}, {
|
|
550
|
-
default:
|
|
551
|
-
|
|
562
|
+
default: l(() => [
|
|
563
|
+
w(b(e(i)("module.articles")), 1)
|
|
552
564
|
]),
|
|
553
565
|
_: 1
|
|
554
566
|
}, 8, ["to"]),
|
|
555
|
-
n(e(
|
|
556
|
-
default:
|
|
557
|
-
|
|
567
|
+
n(e(lt), { current: "" }, {
|
|
568
|
+
default: l(() => [
|
|
569
|
+
w(b(xe.value || e(i)("article.untitled")), 1)
|
|
558
570
|
]),
|
|
559
571
|
_: 1
|
|
560
572
|
})
|
|
561
573
|
]),
|
|
562
574
|
_: 1
|
|
563
|
-
}, 8, ["label"])
|
|
564
|
-
q("div", Dt, [
|
|
565
|
-
q("span", It, f(he.value || e(i)("article.untitled")), 1),
|
|
566
|
-
n(e(re), {
|
|
567
|
-
type: vt(),
|
|
568
|
-
dot: ""
|
|
569
|
-
}, {
|
|
570
|
-
default: a(() => [
|
|
571
|
-
g(f(e(i)(`panel.status-${d.value.status}`)), 1)
|
|
572
|
-
]),
|
|
573
|
-
_: 1
|
|
574
|
-
}, 8, ["type"])
|
|
575
|
-
])
|
|
575
|
+
}, 8, ["label"])
|
|
576
576
|
]),
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
577
|
+
"title-after": l(() => [
|
|
578
|
+
n(e(oe), {
|
|
579
|
+
type: D(),
|
|
580
|
+
dot: ""
|
|
581
581
|
}, {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
type: "more",
|
|
585
|
-
title: e(i)("article.more")
|
|
586
|
-
}, null, 8, ["title"])
|
|
587
|
-
]),
|
|
588
|
-
default: a(() => [
|
|
589
|
-
M.value ? (p(), V(e(lt), {
|
|
590
|
-
key: 0,
|
|
591
|
-
icon: "eye",
|
|
592
|
-
href: M.value,
|
|
593
|
-
target: "_blank",
|
|
594
|
-
rel: "noopener"
|
|
595
|
-
}, {
|
|
596
|
-
default: a(() => [
|
|
597
|
-
g(f(e(i)("article.preview")), 1)
|
|
598
|
-
]),
|
|
599
|
-
_: 1
|
|
600
|
-
}, 8, ["href"])) : I("", !0),
|
|
601
|
-
d.value.url && d.value.status !== "draft" ? (p(), V(e(lt), {
|
|
602
|
-
key: 1,
|
|
603
|
-
icon: "link",
|
|
604
|
-
href: d.value.url,
|
|
605
|
-
target: "_blank",
|
|
606
|
-
rel: "noopener"
|
|
607
|
-
}, {
|
|
608
|
-
default: a(() => [
|
|
609
|
-
g(f(e(i)("panel.open-on-site")), 1)
|
|
610
|
-
]),
|
|
611
|
-
_: 1
|
|
612
|
-
}, 8, ["href"])) : I("", !0)
|
|
582
|
+
default: l(() => [
|
|
583
|
+
w(b(e(i)(`panel.status-${o.value.status}`)), 1)
|
|
613
584
|
]),
|
|
614
585
|
_: 1
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
href: M.value,
|
|
621
|
-
target: "_blank",
|
|
622
|
-
rel: "noopener"
|
|
623
|
-
}, {
|
|
624
|
-
default: a(() => [
|
|
625
|
-
g(f(e(i)("article.preview")), 1)
|
|
626
|
-
]),
|
|
627
|
-
_: 1
|
|
628
|
-
}, 8, ["href"])) : I("", !0),
|
|
629
|
-
d.value.url && d.value.status !== "draft" ? (p(), V(e(F), {
|
|
630
|
-
key: 1,
|
|
631
|
-
variant: "outline",
|
|
632
|
-
icon: "link",
|
|
633
|
-
href: d.value.url,
|
|
634
|
-
target: "_blank",
|
|
635
|
-
rel: "noopener"
|
|
636
|
-
}, {
|
|
637
|
-
default: a(() => [
|
|
638
|
-
g(f(e(i)("panel.open-on-site")), 1)
|
|
639
|
-
]),
|
|
640
|
-
_: 1
|
|
641
|
-
}, 8, ["href"])) : I("", !0)
|
|
642
|
-
], 64))
|
|
643
|
-
])
|
|
644
|
-
]),
|
|
645
|
-
N.value ? (p(), V(e(Se), {
|
|
586
|
+
}, 8, ["type"])
|
|
587
|
+
]),
|
|
588
|
+
_: 1
|
|
589
|
+
}, 8, ["back", "back-label", "title", "actions"]),
|
|
590
|
+
I.value ? (p(), z(e(We), {
|
|
646
591
|
key: 0,
|
|
647
592
|
type: "warning",
|
|
648
593
|
title: e(i)("article.conflict-title"),
|
|
649
|
-
description:
|
|
594
|
+
description: I.value.message
|
|
650
595
|
}, {
|
|
651
|
-
actions:
|
|
652
|
-
n(e(
|
|
596
|
+
actions: l(() => [
|
|
597
|
+
n(e(Z), {
|
|
653
598
|
size: "sm",
|
|
654
599
|
variant: "outline",
|
|
655
|
-
onClick:
|
|
600
|
+
onClick: B
|
|
656
601
|
}, {
|
|
657
|
-
default:
|
|
658
|
-
|
|
602
|
+
default: l(() => [
|
|
603
|
+
w(b(e(i)("article.conflict-theirs")), 1)
|
|
659
604
|
]),
|
|
660
605
|
_: 1
|
|
661
606
|
}),
|
|
662
|
-
n(e(
|
|
607
|
+
n(e(Z), {
|
|
663
608
|
size: "sm",
|
|
664
609
|
type: "primary",
|
|
665
|
-
onClick:
|
|
610
|
+
onClick: X
|
|
666
611
|
}, {
|
|
667
|
-
default:
|
|
668
|
-
|
|
612
|
+
default: l(() => [
|
|
613
|
+
w(b(e(i)("article.conflict-mine")), 1)
|
|
669
614
|
]),
|
|
670
615
|
_: 1
|
|
671
616
|
})
|
|
672
617
|
]),
|
|
673
618
|
_: 1
|
|
674
|
-
}, 8, ["title", "description"])) :
|
|
675
|
-
|
|
676
|
-
n(e(
|
|
677
|
-
modelValue:
|
|
678
|
-
"onUpdate:modelValue":
|
|
619
|
+
}, 8, ["title", "description"])) : H("", !0),
|
|
620
|
+
j("div", Bt, [
|
|
621
|
+
n(e(gt), {
|
|
622
|
+
modelValue: _.value,
|
|
623
|
+
"onUpdate:modelValue": Y[0] || (Y[0] = (ae) => _.value = ae),
|
|
679
624
|
name: "blog.article-form",
|
|
680
625
|
errors: A.value,
|
|
681
|
-
disabled:
|
|
626
|
+
disabled: k.value
|
|
682
627
|
}, null, 8, ["modelValue", "errors", "disabled"])
|
|
683
628
|
]),
|
|
684
|
-
|
|
685
|
-
state:
|
|
686
|
-
n(e(
|
|
629
|
+
q.value ? (p(), z(e(rt), { key: 1 }, {
|
|
630
|
+
state: l(() => [
|
|
631
|
+
n(e(J), {
|
|
687
632
|
size: "sm",
|
|
688
633
|
tone: "muted"
|
|
689
634
|
}, {
|
|
690
|
-
default:
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
], 64)) :
|
|
635
|
+
default: l(() => [
|
|
636
|
+
w(b(e(i)(`article.state-${se.value}`)), 1),
|
|
637
|
+
Te.value ? (p(), G(ve, { key: 0 }, [
|
|
638
|
+
w(" · " + b(Te.value), 1)
|
|
639
|
+
], 64)) : H("", !0)
|
|
695
640
|
]),
|
|
696
641
|
_: 1
|
|
697
642
|
})
|
|
698
643
|
]),
|
|
699
|
-
default:
|
|
700
|
-
|
|
644
|
+
default: l(() => [
|
|
645
|
+
o.value.status === "modified" ? (p(), z(e(Z), {
|
|
701
646
|
key: 0,
|
|
702
647
|
variant: "text",
|
|
703
|
-
loading:
|
|
704
|
-
onClick:
|
|
648
|
+
loading: M.value,
|
|
649
|
+
onClick: ye
|
|
705
650
|
}, {
|
|
706
|
-
default:
|
|
707
|
-
|
|
651
|
+
default: l(() => [
|
|
652
|
+
w(b(e(i)("article.discard")), 1)
|
|
708
653
|
]),
|
|
709
654
|
_: 1
|
|
710
|
-
}, 8, ["loading"])) :
|
|
711
|
-
n(e(
|
|
655
|
+
}, 8, ["loading"])) : H("", !0),
|
|
656
|
+
n(e(Z), {
|
|
712
657
|
variant: "outline",
|
|
713
|
-
loading:
|
|
714
|
-
disabled: !
|
|
715
|
-
onClick:
|
|
658
|
+
loading: R.value,
|
|
659
|
+
disabled: !O.value,
|
|
660
|
+
onClick: N
|
|
716
661
|
}, {
|
|
717
|
-
default:
|
|
718
|
-
|
|
662
|
+
default: l(() => [
|
|
663
|
+
w(b(e(i)("article.save")), 1)
|
|
719
664
|
]),
|
|
720
665
|
_: 1
|
|
721
666
|
}, 8, ["loading", "disabled"]),
|
|
722
|
-
n(e(
|
|
667
|
+
n(e(Z), {
|
|
723
668
|
type: "primary",
|
|
724
|
-
loading:
|
|
725
|
-
disabled:
|
|
726
|
-
onClick:
|
|
669
|
+
loading: M.value,
|
|
670
|
+
disabled: o.value.status === "published" && !O.value,
|
|
671
|
+
onClick: d
|
|
727
672
|
}, {
|
|
728
|
-
default:
|
|
729
|
-
|
|
673
|
+
default: l(() => [
|
|
674
|
+
w(b(he.value ? e(i)("article.schedule") : e(i)("panel.publish")), 1)
|
|
730
675
|
]),
|
|
731
676
|
_: 1
|
|
732
677
|
}, 8, ["loading", "disabled"])
|
|
733
678
|
]),
|
|
734
679
|
_: 1
|
|
735
|
-
})) :
|
|
680
|
+
})) : H("", !0)
|
|
736
681
|
], 64))
|
|
737
|
-
],
|
|
682
|
+
], 32));
|
|
738
683
|
}
|
|
739
|
-
}),
|
|
684
|
+
}), It = /* @__PURE__ */ pe(Dt, [["__scopeId", "data-v-41431c5d"]]), Ot = { class: "wx-article-history" }, Et = { class: "wx-article-history__number" }, Ft = { class: "wx-article-history__who" }, Lt = /* @__PURE__ */ ee({
|
|
740
685
|
name: "WxArticleHistory",
|
|
741
686
|
__name: "ArticleHistory",
|
|
742
|
-
setup(
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
const
|
|
687
|
+
setup(f) {
|
|
688
|
+
const m = ne(), r = de(m), y = Se();
|
|
689
|
+
te();
|
|
690
|
+
const u = Q("webx-blog"), a = ge(), t = C(null), s = C(!1), i = v(() => y?.article.value ?? null), x = v(() => m.can("blog.articles.manage")), T = v(
|
|
746
691
|
() => i.value?.status === "published" || i.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
|
|
747
692
|
);
|
|
748
|
-
async function
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
693
|
+
async function c() {
|
|
694
|
+
const _ = i.value;
|
|
695
|
+
if (_)
|
|
751
696
|
try {
|
|
752
|
-
t.value = await
|
|
753
|
-
} catch (
|
|
754
|
-
t.value = [], L.danger(
|
|
697
|
+
t.value = await r.versions(_.id);
|
|
698
|
+
} catch (W) {
|
|
699
|
+
t.value = [], L.danger(a(W));
|
|
755
700
|
}
|
|
756
701
|
}
|
|
757
|
-
async function
|
|
758
|
-
const
|
|
759
|
-
if (!(!
|
|
760
|
-
title:
|
|
761
|
-
message:
|
|
762
|
-
confirmText:
|
|
763
|
-
cancelText:
|
|
702
|
+
async function o(_) {
|
|
703
|
+
const W = i.value;
|
|
704
|
+
if (!(!W || !await be({
|
|
705
|
+
title: u("article.restore-title", { number: _.number }),
|
|
706
|
+
message: u("article.restore-text"),
|
|
707
|
+
confirmText: u("article.restore-version"),
|
|
708
|
+
cancelText: u("panel.cancel")
|
|
764
709
|
}))) {
|
|
765
|
-
|
|
710
|
+
s.value = !0;
|
|
766
711
|
try {
|
|
767
|
-
await
|
|
768
|
-
} catch (
|
|
769
|
-
L.danger(
|
|
712
|
+
await r.restoreVersion(W.id, _.number), await y?.reload(), L.success(u("article.restored-version", { number: _.number }));
|
|
713
|
+
} catch (E) {
|
|
714
|
+
L.danger(a(E));
|
|
770
715
|
} finally {
|
|
771
|
-
|
|
716
|
+
s.value = !1;
|
|
772
717
|
}
|
|
773
718
|
}
|
|
774
719
|
}
|
|
775
|
-
return
|
|
720
|
+
return ue(
|
|
776
721
|
() => [i.value?.id, i.value?.published_at, i.value?.updated_at],
|
|
777
722
|
() => {
|
|
778
|
-
|
|
723
|
+
c();
|
|
779
724
|
},
|
|
780
725
|
{ immediate: !0 }
|
|
781
|
-
), (
|
|
782
|
-
t.value === null ? (p(),
|
|
726
|
+
), (_, W) => (p(), G("div", Ot, [
|
|
727
|
+
t.value === null ? (p(), z(e(Ue), {
|
|
783
728
|
key: 0,
|
|
784
729
|
class: "wx-article-history__ghost",
|
|
785
730
|
rows: 3
|
|
786
|
-
})) : t.value.length === 0 ? (p(),
|
|
731
|
+
})) : t.value.length === 0 ? (p(), z(e(Ge), {
|
|
787
732
|
key: 1,
|
|
788
|
-
description: e(
|
|
789
|
-
}, null, 8, ["description"])) : (p(!0),
|
|
790
|
-
key:
|
|
791
|
-
class:
|
|
733
|
+
description: e(u)("article.history-empty")
|
|
734
|
+
}, null, 8, ["description"])) : (p(!0), G(ve, { key: 2 }, Be(t.value, (S) => (p(), G("div", {
|
|
735
|
+
key: S.number,
|
|
736
|
+
class: Pe(["wx-article-history__row", { "is-live": S.number === T.value }])
|
|
792
737
|
}, [
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
738
|
+
j("code", Et, b(e(u)("article.version", { number: S.number })), 1),
|
|
739
|
+
j("div", Ft, [
|
|
740
|
+
S.created_at ? (p(), z(e(je), {
|
|
796
741
|
key: 0,
|
|
797
|
-
value:
|
|
742
|
+
value: S.created_at,
|
|
798
743
|
size: "md",
|
|
799
744
|
tone: "default"
|
|
800
|
-
}, null, 8, ["value"])) :
|
|
801
|
-
n(e(
|
|
745
|
+
}, null, 8, ["value"])) : H("", !0),
|
|
746
|
+
n(e(J), {
|
|
802
747
|
size: "sm",
|
|
803
748
|
tone: "muted"
|
|
804
749
|
}, {
|
|
805
|
-
default:
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
], 64)) :
|
|
750
|
+
default: l(() => [
|
|
751
|
+
w(b(S.author ?? e(u)(`article.source-${S.source}`)) + " ", 1),
|
|
752
|
+
S.comment ? (p(), G(ve, { key: 0 }, [
|
|
753
|
+
w(" · " + b(S.comment), 1)
|
|
754
|
+
], 64)) : H("", !0)
|
|
810
755
|
]),
|
|
811
756
|
_: 2
|
|
812
757
|
}, 1024)
|
|
813
758
|
]),
|
|
814
|
-
|
|
759
|
+
S.number === T.value ? (p(), z(e(oe), {
|
|
815
760
|
key: 0,
|
|
816
761
|
type: "success",
|
|
817
762
|
dot: ""
|
|
818
763
|
}, {
|
|
819
|
-
default:
|
|
820
|
-
|
|
764
|
+
default: l(() => [
|
|
765
|
+
w(b(e(u)("article.version-live")), 1)
|
|
821
766
|
]),
|
|
822
767
|
_: 1
|
|
823
|
-
})) :
|
|
824
|
-
|
|
768
|
+
})) : H("", !0),
|
|
769
|
+
x.value && S.number !== T.value ? (p(), z(e(Z), {
|
|
825
770
|
key: 1,
|
|
826
771
|
size: "sm",
|
|
827
772
|
variant: "outline",
|
|
828
|
-
loading:
|
|
829
|
-
onClick: (
|
|
773
|
+
loading: s.value,
|
|
774
|
+
onClick: (E) => o(S)
|
|
830
775
|
}, {
|
|
831
|
-
default:
|
|
832
|
-
|
|
776
|
+
default: l(() => [
|
|
777
|
+
w(b(e(u)("article.restore-version")), 1)
|
|
833
778
|
]),
|
|
834
779
|
_: 1
|
|
835
|
-
}, 8, ["loading", "onClick"])) :
|
|
780
|
+
}, 8, ["loading", "onClick"])) : H("", !0)
|
|
836
781
|
], 2))), 128))
|
|
837
782
|
]));
|
|
838
783
|
}
|
|
839
|
-
}),
|
|
784
|
+
}), Ht = /* @__PURE__ */ pe(Lt, [["__scopeId", "data-v-0a997938"]]), Kt = { class: "wx-article-related" }, jt = { class: "wx-article-related__name" }, Gt = 250, Jt = 10, Zt = /* @__PURE__ */ ee({
|
|
840
785
|
name: "WxArticleRelated",
|
|
841
786
|
__name: "ArticleRelated",
|
|
842
|
-
props: /* @__PURE__ */
|
|
787
|
+
props: /* @__PURE__ */ Me({
|
|
843
788
|
disabled: { type: Boolean, default: !1 }
|
|
844
789
|
}, {
|
|
845
790
|
modelValue: { default: () => [] },
|
|
846
791
|
modelModifiers: {}
|
|
847
792
|
}),
|
|
848
793
|
emits: ["update:modelValue"],
|
|
849
|
-
setup(
|
|
850
|
-
const
|
|
851
|
-
|
|
852
|
-
const t =
|
|
853
|
-
let
|
|
854
|
-
|
|
855
|
-
() =>
|
|
856
|
-
(
|
|
857
|
-
const
|
|
858
|
-
for (const
|
|
859
|
-
|
|
794
|
+
setup(f) {
|
|
795
|
+
const m = f, r = qe(f, "modelValue"), y = ne(), u = de(y), a = Se();
|
|
796
|
+
te();
|
|
797
|
+
const t = Q("webx-blog"), s = ge(), i = v(() => m.disabled || a?.disabled.value === !0), x = C(/* @__PURE__ */ new Map()), T = C([]);
|
|
798
|
+
let c;
|
|
799
|
+
ue(
|
|
800
|
+
() => a?.related.value,
|
|
801
|
+
($) => {
|
|
802
|
+
const U = new Map(x.value);
|
|
803
|
+
for (const R of $ ?? []) U.set(R.id, R.title);
|
|
804
|
+
x.value = U;
|
|
860
805
|
},
|
|
861
806
|
{ immediate: !0, deep: !0 }
|
|
862
807
|
);
|
|
863
|
-
const
|
|
864
|
-
get: () =>
|
|
865
|
-
set: (
|
|
866
|
-
|
|
808
|
+
const o = v({
|
|
809
|
+
get: () => r.value.map(($) => ({ id: $, title: x.value.get($) ?? `#${$}` })),
|
|
810
|
+
set: ($) => {
|
|
811
|
+
r.value = $.map((U) => U.id);
|
|
867
812
|
}
|
|
868
|
-
}),
|
|
869
|
-
() => T.value.filter((
|
|
813
|
+
}), _ = v(
|
|
814
|
+
() => T.value.filter(($) => !r.value.includes($.id)).map(($) => ({ label: $.title, value: $.id }))
|
|
870
815
|
);
|
|
871
|
-
async function
|
|
872
|
-
const
|
|
816
|
+
async function W($) {
|
|
817
|
+
const U = a?.article.value?.id;
|
|
873
818
|
try {
|
|
874
|
-
const
|
|
875
|
-
T.value =
|
|
876
|
-
const
|
|
877
|
-
for (const A of T.value)
|
|
878
|
-
|
|
879
|
-
} catch (
|
|
880
|
-
L.danger(
|
|
819
|
+
const R = await u.articles({ q: $, per_page: Jt });
|
|
820
|
+
T.value = R.data.filter((A) => A.id !== U).map((A) => ({ id: A.id, title: A.title }));
|
|
821
|
+
const M = new Map(x.value);
|
|
822
|
+
for (const A of T.value) M.set(A.id, A.title);
|
|
823
|
+
x.value = M;
|
|
824
|
+
} catch (R) {
|
|
825
|
+
L.danger(s(R));
|
|
881
826
|
}
|
|
882
827
|
}
|
|
883
|
-
function
|
|
884
|
-
clearTimeout(
|
|
885
|
-
|
|
886
|
-
},
|
|
828
|
+
function S($) {
|
|
829
|
+
clearTimeout(c), c = setTimeout(() => {
|
|
830
|
+
W($);
|
|
831
|
+
}, Gt);
|
|
887
832
|
}
|
|
888
|
-
function
|
|
889
|
-
typeof
|
|
833
|
+
function E($) {
|
|
834
|
+
typeof $ != "number" || r.value.includes($) || (r.value = [...r.value, $]);
|
|
890
835
|
}
|
|
891
|
-
function
|
|
892
|
-
|
|
836
|
+
function F($) {
|
|
837
|
+
r.value = r.value.filter((U) => U !== $);
|
|
893
838
|
}
|
|
894
|
-
return
|
|
895
|
-
() =>
|
|
839
|
+
return ue(
|
|
840
|
+
() => a?.article.value?.id,
|
|
896
841
|
() => {
|
|
897
|
-
|
|
842
|
+
W("");
|
|
898
843
|
},
|
|
899
844
|
{ immediate: !0 }
|
|
900
|
-
),
|
|
901
|
-
n(e(
|
|
902
|
-
modelValue:
|
|
903
|
-
"onUpdate:modelValue":
|
|
845
|
+
), Je(() => clearTimeout(c)), ($, U) => (p(), G("div", Kt, [
|
|
846
|
+
n(e(Ye), {
|
|
847
|
+
modelValue: o.value,
|
|
848
|
+
"onUpdate:modelValue": U[0] || (U[0] = (R) => o.value = R),
|
|
904
849
|
plain: "",
|
|
905
850
|
size: "sm",
|
|
906
851
|
"item-key": "id",
|
|
@@ -909,302 +854,302 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
909
854
|
"empty-text": e(t)("article.related-empty"),
|
|
910
855
|
"aria-label": e(t)("article.related")
|
|
911
856
|
}, {
|
|
912
|
-
default:
|
|
913
|
-
|
|
857
|
+
default: l(({ item: R }) => [
|
|
858
|
+
j("span", jt, b(R.title), 1)
|
|
914
859
|
]),
|
|
915
|
-
actions:
|
|
916
|
-
n(e(
|
|
860
|
+
actions: l(({ item: R }) => [
|
|
861
|
+
n(e(Oe), {
|
|
917
862
|
type: "remove",
|
|
918
863
|
size: "sm",
|
|
919
864
|
disabled: i.value,
|
|
920
865
|
title: e(t)("article.related-remove"),
|
|
921
|
-
onClick: (
|
|
866
|
+
onClick: (M) => F(R.id)
|
|
922
867
|
}, null, 8, ["disabled", "title", "onClick"])
|
|
923
868
|
]),
|
|
924
869
|
_: 1
|
|
925
870
|
}, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
|
|
926
|
-
n(e(
|
|
871
|
+
n(e(_e), {
|
|
927
872
|
"model-value": null,
|
|
928
|
-
options:
|
|
873
|
+
options: _.value,
|
|
929
874
|
placeholder: e(t)("article.related-add"),
|
|
930
875
|
"empty-text": e(t)("article.related-nothing"),
|
|
931
876
|
disabled: i.value,
|
|
932
877
|
filterable: "",
|
|
933
878
|
teleport: "",
|
|
934
879
|
"aria-label": e(t)("article.related-add"),
|
|
935
|
-
onSearch:
|
|
936
|
-
"onUpdate:modelValue":
|
|
880
|
+
onSearch: S,
|
|
881
|
+
"onUpdate:modelValue": E
|
|
937
882
|
}, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"])
|
|
938
883
|
]));
|
|
939
884
|
}
|
|
940
|
-
}),
|
|
885
|
+
}), Qt = /* @__PURE__ */ pe(Zt, [["__scopeId", "data-v-164e86fe"]]), Xt = { class: "wx-article-rubrics" }, Yt = { class: "wx-article-rubrics__name" }, ea = /* @__PURE__ */ ee({
|
|
941
886
|
name: "WxArticleRubrics",
|
|
942
887
|
__name: "ArticleRubrics",
|
|
943
|
-
props: /* @__PURE__ */
|
|
888
|
+
props: /* @__PURE__ */ Me({
|
|
944
889
|
disabled: { type: Boolean, default: !1 }
|
|
945
890
|
}, {
|
|
946
891
|
modelValue: { default: () => [] },
|
|
947
892
|
modelModifiers: {}
|
|
948
893
|
}),
|
|
949
894
|
emits: ["update:modelValue"],
|
|
950
|
-
setup(
|
|
951
|
-
const
|
|
952
|
-
|
|
953
|
-
const
|
|
954
|
-
const
|
|
955
|
-
for (const
|
|
956
|
-
return
|
|
957
|
-
}),
|
|
958
|
-
get: () =>
|
|
959
|
-
set: (
|
|
960
|
-
|
|
895
|
+
setup(f) {
|
|
896
|
+
const m = f, r = qe(f, "modelValue"), y = Se();
|
|
897
|
+
te();
|
|
898
|
+
const u = Q("webx-blog"), a = v(() => m.disabled || y?.disabled.value === !0), t = v(() => {
|
|
899
|
+
const c = /* @__PURE__ */ new Map();
|
|
900
|
+
for (const o of y?.options.value.rubrics ?? []) c.set(o.id, o.title);
|
|
901
|
+
return c;
|
|
902
|
+
}), s = v({
|
|
903
|
+
get: () => r.value.map((c) => ({ id: c, title: t.value.get(c) ?? `#${c}` })),
|
|
904
|
+
set: (c) => {
|
|
905
|
+
r.value = c.map((o) => o.id);
|
|
961
906
|
}
|
|
962
|
-
}), i =
|
|
963
|
-
() => (
|
|
907
|
+
}), i = v(
|
|
908
|
+
() => (y?.options.value.rubrics ?? []).filter((c) => !r.value.includes(c.id)).map((c) => ({ label: c.title, value: c.id }))
|
|
964
909
|
);
|
|
965
|
-
function
|
|
966
|
-
typeof
|
|
910
|
+
function x(c) {
|
|
911
|
+
typeof c != "number" || r.value.includes(c) || (r.value = [...r.value, c]);
|
|
967
912
|
}
|
|
968
|
-
function T(
|
|
969
|
-
|
|
913
|
+
function T(c) {
|
|
914
|
+
r.value = r.value.filter((o) => o !== c);
|
|
970
915
|
}
|
|
971
|
-
return (
|
|
972
|
-
n(e(
|
|
973
|
-
modelValue:
|
|
974
|
-
"onUpdate:modelValue":
|
|
916
|
+
return (c, o) => (p(), G("div", Xt, [
|
|
917
|
+
n(e(Ye), {
|
|
918
|
+
modelValue: s.value,
|
|
919
|
+
"onUpdate:modelValue": o[0] || (o[0] = (_) => s.value = _),
|
|
975
920
|
plain: "",
|
|
976
921
|
size: "sm",
|
|
977
922
|
"item-key": "id",
|
|
978
923
|
"item-label": "title",
|
|
979
|
-
disabled:
|
|
980
|
-
"empty-text": e(
|
|
981
|
-
"aria-label": e(
|
|
924
|
+
disabled: a.value,
|
|
925
|
+
"empty-text": e(u)("article.rubrics-empty"),
|
|
926
|
+
"aria-label": e(u)("article.rubrics")
|
|
982
927
|
}, {
|
|
983
|
-
default:
|
|
984
|
-
|
|
985
|
-
|
|
928
|
+
default: l(({ item: _, index: W }) => [
|
|
929
|
+
j("span", Yt, b(_.title), 1),
|
|
930
|
+
W === 0 ? (p(), z(e(oe), {
|
|
986
931
|
key: 0,
|
|
987
932
|
type: "primary"
|
|
988
933
|
}, {
|
|
989
|
-
default:
|
|
990
|
-
|
|
934
|
+
default: l(() => [
|
|
935
|
+
w(b(e(u)("article.rubric-main")), 1)
|
|
991
936
|
]),
|
|
992
937
|
_: 1
|
|
993
|
-
})) :
|
|
938
|
+
})) : H("", !0)
|
|
994
939
|
]),
|
|
995
|
-
actions:
|
|
996
|
-
n(e(
|
|
940
|
+
actions: l(({ item: _ }) => [
|
|
941
|
+
n(e(Oe), {
|
|
997
942
|
type: "remove",
|
|
998
943
|
size: "sm",
|
|
999
|
-
disabled:
|
|
1000
|
-
title: e(
|
|
1001
|
-
onClick: (
|
|
944
|
+
disabled: a.value,
|
|
945
|
+
title: e(u)("article.rubric-remove"),
|
|
946
|
+
onClick: (W) => T(_.id)
|
|
1002
947
|
}, null, 8, ["disabled", "title", "onClick"])
|
|
1003
948
|
]),
|
|
1004
949
|
_: 1
|
|
1005
950
|
}, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
|
|
1006
|
-
n(e(
|
|
951
|
+
n(e(_e), {
|
|
1007
952
|
"model-value": null,
|
|
1008
953
|
options: i.value,
|
|
1009
|
-
placeholder: e(
|
|
1010
|
-
disabled:
|
|
1011
|
-
"empty-text": e(
|
|
954
|
+
placeholder: e(u)("article.rubric-add"),
|
|
955
|
+
disabled: a.value || i.value.length === 0,
|
|
956
|
+
"empty-text": e(u)("article.rubric-none-left"),
|
|
1012
957
|
filterable: "",
|
|
1013
958
|
teleport: "",
|
|
1014
|
-
"aria-label": e(
|
|
1015
|
-
"onUpdate:modelValue":
|
|
959
|
+
"aria-label": e(u)("article.rubric-add"),
|
|
960
|
+
"onUpdate:modelValue": x
|
|
1016
961
|
}, null, 8, ["options", "placeholder", "disabled", "empty-text", "aria-label"])
|
|
1017
962
|
]));
|
|
1018
963
|
}
|
|
1019
|
-
}),
|
|
964
|
+
}), ta = /* @__PURE__ */ pe(ea, [["__scopeId", "data-v-db8c5bc8"]]), aa = { class: "wx-article-tags" }, la = {
|
|
1020
965
|
key: 0,
|
|
1021
966
|
class: "wx-article-tags__chips"
|
|
1022
|
-
},
|
|
967
|
+
}, ia = { class: "wx-article-tags__pick" }, na = 250, sa = /* @__PURE__ */ ee({
|
|
1023
968
|
name: "WxArticleTags",
|
|
1024
969
|
__name: "ArticleTags",
|
|
1025
|
-
props: /* @__PURE__ */
|
|
970
|
+
props: /* @__PURE__ */ Me({
|
|
1026
971
|
disabled: { type: Boolean, default: !1 }
|
|
1027
972
|
}, {
|
|
1028
973
|
modelValue: { default: () => [] },
|
|
1029
974
|
modelModifiers: {}
|
|
1030
975
|
}),
|
|
1031
976
|
emits: ["update:modelValue"],
|
|
1032
|
-
setup(
|
|
1033
|
-
const
|
|
1034
|
-
|
|
1035
|
-
const t =
|
|
1036
|
-
let
|
|
1037
|
-
|
|
1038
|
-
() =>
|
|
977
|
+
setup(f) {
|
|
978
|
+
const m = f, r = qe(f, "modelValue"), y = ne(), u = de(y), a = Se();
|
|
979
|
+
te();
|
|
980
|
+
const t = Q("webx-blog"), s = ge(), i = v(() => m.disabled || a?.disabled.value === !0), x = C(/* @__PURE__ */ new Map()), T = C([]), c = C(""), o = C(!1);
|
|
981
|
+
let _;
|
|
982
|
+
ue(
|
|
983
|
+
() => a?.article.value?.tags,
|
|
1039
984
|
(A) => {
|
|
1040
|
-
const
|
|
1041
|
-
for (const
|
|
1042
|
-
|
|
985
|
+
const I = new Map(x.value);
|
|
986
|
+
for (const K of A ?? []) I.set(K.id, K.title);
|
|
987
|
+
x.value = I;
|
|
1043
988
|
},
|
|
1044
989
|
{ immediate: !0, deep: !0 }
|
|
1045
990
|
);
|
|
1046
|
-
const
|
|
1047
|
-
() =>
|
|
1048
|
-
),
|
|
1049
|
-
() => T.value.filter((A) => !
|
|
991
|
+
const W = v(
|
|
992
|
+
() => r.value.map((A) => ({ id: A, title: x.value.get(A) ?? `#${A}` }))
|
|
993
|
+
), S = v(
|
|
994
|
+
() => T.value.filter((A) => !r.value.includes(A.id)).map((A) => ({
|
|
1050
995
|
// The count is part of the label rather than a column: a select draws a line of text, and
|
|
1051
996
|
// the number is what the reader is choosing between two near-identical words on.
|
|
1052
997
|
label: t("article.tag-option", { title: A.title, count: A.articles_count }),
|
|
1053
998
|
value: A.id
|
|
1054
999
|
}))
|
|
1055
|
-
),
|
|
1056
|
-
const A =
|
|
1000
|
+
), E = v(() => {
|
|
1001
|
+
const A = c.value.trim();
|
|
1057
1002
|
if (A === "") return null;
|
|
1058
|
-
const
|
|
1059
|
-
return T.value.some((
|
|
1003
|
+
const I = (K) => K.toLowerCase() === A.toLowerCase();
|
|
1004
|
+
return T.value.some((K) => I(K.title)) ? null : A;
|
|
1060
1005
|
});
|
|
1061
|
-
async function
|
|
1006
|
+
async function F() {
|
|
1062
1007
|
try {
|
|
1063
|
-
T.value = await
|
|
1064
|
-
const A = new Map(
|
|
1065
|
-
for (const
|
|
1066
|
-
|
|
1008
|
+
T.value = await u.tags(c.value);
|
|
1009
|
+
const A = new Map(x.value);
|
|
1010
|
+
for (const I of T.value) A.set(I.id, I.title);
|
|
1011
|
+
x.value = A;
|
|
1067
1012
|
} catch (A) {
|
|
1068
|
-
L.danger(
|
|
1013
|
+
L.danger(s(A));
|
|
1069
1014
|
}
|
|
1070
1015
|
}
|
|
1016
|
+
function $(A) {
|
|
1017
|
+
c.value = A, clearTimeout(_), _ = setTimeout(() => {
|
|
1018
|
+
F();
|
|
1019
|
+
}, na);
|
|
1020
|
+
}
|
|
1071
1021
|
function U(A) {
|
|
1072
|
-
|
|
1073
|
-
P();
|
|
1074
|
-
}, ca);
|
|
1022
|
+
typeof A != "number" || r.value.includes(A) || (r.value = [...r.value, A], c.value = "");
|
|
1075
1023
|
}
|
|
1076
1024
|
function R(A) {
|
|
1077
|
-
|
|
1025
|
+
r.value = r.value.filter((I) => I !== A);
|
|
1078
1026
|
}
|
|
1079
|
-
function
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
const A = M.value;
|
|
1084
|
-
if (!(A === null || d.value)) {
|
|
1085
|
-
d.value = !0;
|
|
1027
|
+
async function M() {
|
|
1028
|
+
const A = E.value;
|
|
1029
|
+
if (!(A === null || o.value)) {
|
|
1030
|
+
o.value = !0;
|
|
1086
1031
|
try {
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1089
|
-
} catch (
|
|
1090
|
-
L.danger(
|
|
1032
|
+
const I = await u.createTag({ title: A });
|
|
1033
|
+
x.value = new Map(x.value).set(I.id, I.title), T.value = [I, ...T.value], U(I.id);
|
|
1034
|
+
} catch (I) {
|
|
1035
|
+
L.danger(s(I));
|
|
1091
1036
|
} finally {
|
|
1092
|
-
|
|
1037
|
+
o.value = !1;
|
|
1093
1038
|
}
|
|
1094
1039
|
}
|
|
1095
1040
|
}
|
|
1096
|
-
return
|
|
1097
|
-
() =>
|
|
1041
|
+
return ue(
|
|
1042
|
+
() => a?.article.value?.id,
|
|
1098
1043
|
() => {
|
|
1099
|
-
|
|
1044
|
+
F();
|
|
1100
1045
|
},
|
|
1101
1046
|
{ immediate: !0 }
|
|
1102
|
-
),
|
|
1103
|
-
|
|
1104
|
-
(p(!0),
|
|
1105
|
-
key:
|
|
1047
|
+
), Je(() => clearTimeout(_)), (A, I) => (p(), G("div", aa, [
|
|
1048
|
+
W.value.length > 0 ? (p(), G("div", la, [
|
|
1049
|
+
(p(!0), G(ve, null, Be(W.value, (K) => (p(), z(e(oe), {
|
|
1050
|
+
key: K.id,
|
|
1106
1051
|
type: "default",
|
|
1107
1052
|
class: "wx-article-tags__chip"
|
|
1108
1053
|
}, {
|
|
1109
|
-
default:
|
|
1110
|
-
|
|
1111
|
-
n(e(
|
|
1054
|
+
default: l(() => [
|
|
1055
|
+
w(b(K.title) + " ", 1),
|
|
1056
|
+
n(e(Oe), {
|
|
1112
1057
|
icon: "close",
|
|
1113
1058
|
tone: "neutral",
|
|
1114
1059
|
size: "sm",
|
|
1115
1060
|
disabled: i.value,
|
|
1116
1061
|
title: e(t)("article.tag-remove"),
|
|
1117
|
-
onClick: (
|
|
1062
|
+
onClick: (P) => R(K.id)
|
|
1118
1063
|
}, null, 8, ["disabled", "title", "onClick"])
|
|
1119
1064
|
]),
|
|
1120
1065
|
_: 2
|
|
1121
1066
|
}, 1024))), 128))
|
|
1122
|
-
])) : (p(),
|
|
1067
|
+
])) : (p(), z(e(J), {
|
|
1123
1068
|
key: 1,
|
|
1124
1069
|
size: "sm",
|
|
1125
1070
|
tone: "muted"
|
|
1126
1071
|
}, {
|
|
1127
|
-
default:
|
|
1128
|
-
|
|
1072
|
+
default: l(() => [
|
|
1073
|
+
w(b(e(t)("article.tags-empty")), 1)
|
|
1129
1074
|
]),
|
|
1130
1075
|
_: 1
|
|
1131
1076
|
})),
|
|
1132
|
-
|
|
1133
|
-
n(e(
|
|
1077
|
+
j("div", ia, [
|
|
1078
|
+
n(e(_e), {
|
|
1134
1079
|
"model-value": null,
|
|
1135
|
-
options:
|
|
1080
|
+
options: S.value,
|
|
1136
1081
|
placeholder: e(t)("article.tag-add"),
|
|
1137
1082
|
"empty-text": e(t)("article.tag-nothing"),
|
|
1138
1083
|
disabled: i.value,
|
|
1139
1084
|
filterable: "",
|
|
1140
1085
|
teleport: "",
|
|
1141
1086
|
"aria-label": e(t)("article.tag-add"),
|
|
1142
|
-
onSearch:
|
|
1143
|
-
"onUpdate:modelValue":
|
|
1087
|
+
onSearch: $,
|
|
1088
|
+
"onUpdate:modelValue": U
|
|
1144
1089
|
}, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"]),
|
|
1145
|
-
|
|
1090
|
+
E.value ? (p(), z(e(Z), {
|
|
1146
1091
|
key: 0,
|
|
1147
1092
|
variant: "outline",
|
|
1148
1093
|
icon: "plus",
|
|
1149
|
-
loading:
|
|
1094
|
+
loading: o.value,
|
|
1150
1095
|
disabled: i.value,
|
|
1151
|
-
onClick:
|
|
1096
|
+
onClick: M
|
|
1152
1097
|
}, {
|
|
1153
|
-
default:
|
|
1154
|
-
|
|
1098
|
+
default: l(() => [
|
|
1099
|
+
w(b(e(t)("article.tag-create", { title: E.value })), 1)
|
|
1155
1100
|
]),
|
|
1156
1101
|
_: 1
|
|
1157
|
-
}, 8, ["loading", "disabled"])) :
|
|
1102
|
+
}, 8, ["loading", "disabled"])) : H("", !0)
|
|
1158
1103
|
])
|
|
1159
1104
|
]));
|
|
1160
1105
|
}
|
|
1161
|
-
}),
|
|
1106
|
+
}), ra = /* @__PURE__ */ pe(sa, [["__scopeId", "data-v-ce095e37"]]), oa = /* @__PURE__ */ ee({
|
|
1162
1107
|
__name: "ArticleCreateDialog",
|
|
1163
|
-
setup(
|
|
1164
|
-
const { open:
|
|
1165
|
-
|
|
1166
|
-
const t =
|
|
1167
|
-
|
|
1168
|
-
await
|
|
1108
|
+
setup(f) {
|
|
1109
|
+
const { open: m, resolve: r, dismiss: y } = Ee(), u = ne(), a = de(u);
|
|
1110
|
+
te();
|
|
1111
|
+
const t = Q("webx-blog"), s = C(""), i = C(!1), x = C({}), T = De("field");
|
|
1112
|
+
Ne(async () => {
|
|
1113
|
+
await Ze(), T.value?.querySelector("input")?.focus();
|
|
1169
1114
|
});
|
|
1170
|
-
async function
|
|
1171
|
-
if (!(
|
|
1172
|
-
i.value = !0,
|
|
1115
|
+
async function c() {
|
|
1116
|
+
if (!(s.value.trim() === "" || i.value)) {
|
|
1117
|
+
i.value = !0, x.value = {};
|
|
1173
1118
|
try {
|
|
1174
|
-
|
|
1175
|
-
} catch (
|
|
1176
|
-
|
|
1119
|
+
r(await a.create({ title: s.value.trim() }));
|
|
1120
|
+
} catch (o) {
|
|
1121
|
+
x.value = o.body?.errors ?? {};
|
|
1177
1122
|
} finally {
|
|
1178
1123
|
i.value = !1;
|
|
1179
1124
|
}
|
|
1180
1125
|
}
|
|
1181
1126
|
}
|
|
1182
|
-
return (
|
|
1183
|
-
open: e(
|
|
1184
|
-
"onUpdate:open":
|
|
1127
|
+
return (o, _) => (p(), z(e(Fe), {
|
|
1128
|
+
open: e(m),
|
|
1129
|
+
"onUpdate:open": _[2] || (_[2] = (W) => Ie(m) ? m.value = W : null),
|
|
1185
1130
|
title: e(t)("panel.new-title"),
|
|
1186
1131
|
width: 440
|
|
1187
1132
|
}, {
|
|
1188
|
-
footer:
|
|
1189
|
-
n(e(
|
|
1190
|
-
default:
|
|
1191
|
-
n(e(
|
|
1133
|
+
footer: l(() => [
|
|
1134
|
+
n(e(Le), { size: "sm" }, {
|
|
1135
|
+
default: l(() => [
|
|
1136
|
+
n(e(Z), {
|
|
1192
1137
|
variant: "outline",
|
|
1193
|
-
onClick:
|
|
1138
|
+
onClick: _[1] || (_[1] = (W) => e(y)())
|
|
1194
1139
|
}, {
|
|
1195
|
-
default:
|
|
1196
|
-
|
|
1140
|
+
default: l(() => [
|
|
1141
|
+
w(b(e(t)("panel.cancel")), 1)
|
|
1197
1142
|
]),
|
|
1198
1143
|
_: 1
|
|
1199
1144
|
}),
|
|
1200
|
-
n(e(
|
|
1145
|
+
n(e(Z), {
|
|
1201
1146
|
type: "primary",
|
|
1202
1147
|
loading: i.value,
|
|
1203
|
-
disabled:
|
|
1204
|
-
onClick:
|
|
1148
|
+
disabled: s.value.trim() === "",
|
|
1149
|
+
onClick: c
|
|
1205
1150
|
}, {
|
|
1206
|
-
default:
|
|
1207
|
-
|
|
1151
|
+
default: l(() => [
|
|
1152
|
+
w(b(e(t)("panel.create")), 1)
|
|
1208
1153
|
]),
|
|
1209
1154
|
_: 1
|
|
1210
1155
|
}, 8, ["loading", "disabled"])
|
|
@@ -1212,22 +1157,22 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
1212
1157
|
_: 1
|
|
1213
1158
|
})
|
|
1214
1159
|
]),
|
|
1215
|
-
default:
|
|
1216
|
-
n(e(
|
|
1160
|
+
default: l(() => [
|
|
1161
|
+
n(e(ie), {
|
|
1217
1162
|
label: e(t)("panel.field-title"),
|
|
1218
|
-
error:
|
|
1163
|
+
error: x.value.title?.[0] ?? x.value.slug?.[0],
|
|
1219
1164
|
required: ""
|
|
1220
1165
|
}, {
|
|
1221
|
-
default:
|
|
1222
|
-
|
|
1166
|
+
default: l(() => [
|
|
1167
|
+
j("div", {
|
|
1223
1168
|
ref_key: "field",
|
|
1224
1169
|
ref: T
|
|
1225
1170
|
}, [
|
|
1226
|
-
n(e(
|
|
1227
|
-
modelValue:
|
|
1228
|
-
"onUpdate:modelValue":
|
|
1171
|
+
n(e(Ae), {
|
|
1172
|
+
modelValue: s.value,
|
|
1173
|
+
"onUpdate:modelValue": _[0] || (_[0] = (W) => s.value = W),
|
|
1229
1174
|
"aria-label": e(t)("panel.field-title"),
|
|
1230
|
-
onKeyup:
|
|
1175
|
+
onKeyup: ze(c, ["enter"])
|
|
1231
1176
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1232
1177
|
], 512)
|
|
1233
1178
|
]),
|
|
@@ -1237,485 +1182,529 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
1237
1182
|
_: 1
|
|
1238
1183
|
}, 8, ["open", "title"]));
|
|
1239
1184
|
}
|
|
1240
|
-
}),
|
|
1185
|
+
}), ua = ["src"], da = { class: "wx-articles__name" }, ca = { class: "wx-articles__name-text" }, va = { class: "wx-articles__title" }, pa = { class: "wx-articles__address" }, fa = { class: "wx-articles__chips" }, ma = { class: "wx-articles__state" }, nt = 640, ba = /* @__PURE__ */ ee({
|
|
1241
1186
|
__name: "ArticlesPage",
|
|
1242
1187
|
props: {
|
|
1243
1188
|
base: { default: "/blog" }
|
|
1244
1189
|
},
|
|
1245
|
-
setup(
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
const t =
|
|
1249
|
-
() =>
|
|
1250
|
-
),
|
|
1251
|
-
get: () => typeof
|
|
1252
|
-
set: (
|
|
1253
|
-
|
|
1254
|
-
query: { ...
|
|
1190
|
+
setup(f) {
|
|
1191
|
+
const m = f, r = ne(), y = de(r), u = He(), a = Ke();
|
|
1192
|
+
te();
|
|
1193
|
+
const t = Q("webx-blog"), s = Q("webx-admin"), i = ge(), x = De("root"), T = _t(x), c = C(null), o = C(!0), _ = Ce(oa), W = v(() => r.can("blog.articles.manage")), S = v(
|
|
1194
|
+
() => r.state.manifest?.modules.find((d) => d.id === "articles")?.title ?? t("module.articles")
|
|
1195
|
+
), E = v({
|
|
1196
|
+
get: () => typeof u.query.view == "string" ? u.query.view : "",
|
|
1197
|
+
set: (d) => {
|
|
1198
|
+
a.replace({
|
|
1199
|
+
query: { ...u.query, view: d === "" ? void 0 : String(d), page: void 0 }
|
|
1255
1200
|
});
|
|
1256
1201
|
}
|
|
1257
|
-
}),
|
|
1258
|
-
q: typeof
|
|
1259
|
-
rubric: U(
|
|
1260
|
-
tag: U(
|
|
1261
|
-
author: U(
|
|
1262
|
-
sort: typeof
|
|
1263
|
-
page: Number(
|
|
1202
|
+
}), F = v(() => E.value === "trashed"), $ = v(() => ({
|
|
1203
|
+
q: typeof u.query.q == "string" ? u.query.q : "",
|
|
1204
|
+
rubric: U(u.query.rubric),
|
|
1205
|
+
tag: U(u.query.tag),
|
|
1206
|
+
author: U(u.query.author),
|
|
1207
|
+
sort: typeof u.query.sort == "string" ? u.query.sort : null,
|
|
1208
|
+
page: Number(u.query.page ?? 1) || 1
|
|
1264
1209
|
}));
|
|
1265
|
-
function U(
|
|
1266
|
-
return typeof
|
|
1210
|
+
function U(d) {
|
|
1211
|
+
return typeof d == "string" && d !== "" && Number(d) || null;
|
|
1267
1212
|
}
|
|
1268
|
-
const R =
|
|
1213
|
+
const R = v(() => [
|
|
1269
1214
|
{ value: "", label: t("panel.view-all") },
|
|
1270
1215
|
{ value: "published", label: t("panel.view-published") },
|
|
1271
1216
|
{ value: "scheduled", label: t("panel.view-scheduled") },
|
|
1272
1217
|
{ value: "draft", label: t("panel.view-draft") },
|
|
1273
1218
|
{ value: "unpublished", label: t("panel.view-unpublished") },
|
|
1274
1219
|
{ value: "trashed", label: t("panel.bin"), icon: "trash" }
|
|
1275
|
-
]),
|
|
1220
|
+
]), M = v(() => c.value?.filters ?? { rubrics: [], tags: [], authors: [] }), A = v(() => T.value > 0 && T.value < nt), I = v(() => A.value ? [{ key: "card", label: "" }] : [
|
|
1276
1221
|
{ key: "cover", label: "", width: 68 },
|
|
1222
|
+
/* The one that takes what the others leave, and the only one without a number. */
|
|
1277
1223
|
{ key: "title", label: t("panel.column-title"), minWidth: 220 },
|
|
1278
|
-
{ key: "rubrics", label: t("panel.column-rubrics"), width: 190, hideBelow:
|
|
1279
|
-
{ key: "author", label: t("panel.column-author"), width: 160, hideBelow:
|
|
1224
|
+
{ key: "rubrics", label: t("panel.column-rubrics"), width: 190, hideBelow: 1e3 },
|
|
1225
|
+
{ key: "author", label: t("panel.column-author"), width: 160, hideBelow: 1200 },
|
|
1280
1226
|
{
|
|
1281
1227
|
key: "date",
|
|
1282
|
-
label:
|
|
1283
|
-
width:
|
|
1228
|
+
label: F.value ? t("panel.column-deleted") : t("panel.column-date"),
|
|
1229
|
+
width: 120,
|
|
1284
1230
|
hideBelow: 700,
|
|
1285
1231
|
// "today at 16:22" is three words the table will break over two lines given half a
|
|
1286
1232
|
// chance, and a date read down a column has to be one line to be read at all.
|
|
1287
1233
|
cellClass: "wx-articles__when"
|
|
1288
1234
|
},
|
|
1289
|
-
{ key: "status", label: t("panel.column-status"), width:
|
|
1290
|
-
{ key: "actions", label: "", width:
|
|
1291
|
-
]),
|
|
1292
|
-
|
|
1293
|
-
|
|
1235
|
+
{ key: "status", label: t("panel.column-status"), width: 170 },
|
|
1236
|
+
{ key: "actions", label: "", width: st, align: "right" }
|
|
1237
|
+
]), K = v(() => $.value.q !== "" ? t("panel.empty-search") : F.value ? t("panel.empty-bin") : t("panel.empty")), P = v(() => {
|
|
1238
|
+
const d = [], D = M.value.rubrics.find((V) => V.id === $.value.rubric);
|
|
1239
|
+
D && d.push({
|
|
1240
|
+
key: "rubric",
|
|
1241
|
+
label: `${t("panel.filter-rubric")}: ${D.title}`,
|
|
1242
|
+
clear: () => O("rubric", void 0)
|
|
1243
|
+
});
|
|
1244
|
+
const h = M.value.tags.find((V) => V.id === $.value.tag);
|
|
1245
|
+
h && d.push({
|
|
1246
|
+
key: "tag",
|
|
1247
|
+
label: `${t("panel.filter-tag")}: ${h.title}`,
|
|
1248
|
+
clear: () => O("tag", void 0)
|
|
1249
|
+
});
|
|
1250
|
+
const $e = M.value.authors.find((V) => V.id === $.value.author);
|
|
1251
|
+
return $e && d.push({
|
|
1252
|
+
key: "author",
|
|
1253
|
+
label: `${t("panel.filter-author")}: ${$e.title}`,
|
|
1254
|
+
clear: () => O("author", void 0)
|
|
1255
|
+
}), d;
|
|
1256
|
+
});
|
|
1257
|
+
function q() {
|
|
1258
|
+
a.replace({
|
|
1259
|
+
query: {
|
|
1260
|
+
...u.query,
|
|
1261
|
+
rubric: void 0,
|
|
1262
|
+
tag: void 0,
|
|
1263
|
+
author: void 0,
|
|
1264
|
+
page: void 0
|
|
1265
|
+
}
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
async function k(d) {
|
|
1269
|
+
o.value = !0;
|
|
1294
1270
|
try {
|
|
1295
|
-
|
|
1296
|
-
q:
|
|
1297
|
-
status:
|
|
1298
|
-
trashed:
|
|
1299
|
-
rubric:
|
|
1300
|
-
tag:
|
|
1301
|
-
author:
|
|
1302
|
-
sort:
|
|
1303
|
-
page:
|
|
1304
|
-
per_page:
|
|
1271
|
+
c.value = await y.articles({
|
|
1272
|
+
q: d?.search ?? $.value.q,
|
|
1273
|
+
status: F.value ? "" : E.value,
|
|
1274
|
+
trashed: F.value,
|
|
1275
|
+
rubric: $.value.rubric,
|
|
1276
|
+
tag: $.value.tag,
|
|
1277
|
+
author: $.value.author,
|
|
1278
|
+
sort: d?.sort ? `${d.sort.order === "desc" ? "-" : ""}${d.sort.key}` : null,
|
|
1279
|
+
page: d?.page ?? $.value.page,
|
|
1280
|
+
per_page: d?.perPage
|
|
1305
1281
|
});
|
|
1306
|
-
} catch (
|
|
1307
|
-
L.danger(
|
|
1282
|
+
} catch (D) {
|
|
1283
|
+
L.danger(i(D));
|
|
1308
1284
|
} finally {
|
|
1309
|
-
|
|
1285
|
+
o.value = !1;
|
|
1310
1286
|
}
|
|
1311
1287
|
}
|
|
1312
|
-
function
|
|
1313
|
-
const
|
|
1314
|
-
...
|
|
1315
|
-
q:
|
|
1316
|
-
sort:
|
|
1317
|
-
page:
|
|
1288
|
+
function le(d) {
|
|
1289
|
+
const D = {
|
|
1290
|
+
...u.query,
|
|
1291
|
+
q: d.search === "" ? void 0 : d.search,
|
|
1292
|
+
sort: d.sort === null ? void 0 : `${d.sort.order === "desc" ? "-" : ""}${d.sort.key}`,
|
|
1293
|
+
page: d.page === 1 ? void 0 : String(d.page)
|
|
1318
1294
|
};
|
|
1319
|
-
|
|
1295
|
+
a.replace({ query: D }), k(d);
|
|
1320
1296
|
}
|
|
1321
|
-
function
|
|
1322
|
-
|
|
1297
|
+
function O(d, D) {
|
|
1298
|
+
a.replace({
|
|
1323
1299
|
query: {
|
|
1324
|
-
...
|
|
1325
|
-
[
|
|
1300
|
+
...u.query,
|
|
1301
|
+
[d]: typeof D == "number" ? String(D) : void 0,
|
|
1326
1302
|
page: void 0
|
|
1327
1303
|
}
|
|
1328
1304
|
});
|
|
1329
1305
|
}
|
|
1330
|
-
|
|
1331
|
-
() => [
|
|
1306
|
+
ue(
|
|
1307
|
+
() => [E.value, $.value.rubric, $.value.tag, $.value.author],
|
|
1332
1308
|
() => {
|
|
1333
|
-
|
|
1309
|
+
k();
|
|
1334
1310
|
}
|
|
1335
|
-
),
|
|
1336
|
-
function
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1339
|
-
}
|
|
1340
|
-
async function
|
|
1341
|
-
const
|
|
1342
|
-
|
|
1343
|
-
}
|
|
1344
|
-
function
|
|
1345
|
-
if (!
|
|
1346
|
-
if (
|
|
1311
|
+
), k();
|
|
1312
|
+
function se(d) {
|
|
1313
|
+
const D = `${m.base}/articles/${d.id}`;
|
|
1314
|
+
a.resolve(D).matched.length > 0 && a.push({ path: D, query: { ...u.query } });
|
|
1315
|
+
}
|
|
1316
|
+
async function xe() {
|
|
1317
|
+
const d = await _({});
|
|
1318
|
+
d && (await k(), se(d));
|
|
1319
|
+
}
|
|
1320
|
+
function ce(d) {
|
|
1321
|
+
if (!W.value) return [];
|
|
1322
|
+
if (F.value)
|
|
1347
1323
|
return [
|
|
1348
1324
|
{
|
|
1349
1325
|
key: "restore",
|
|
1350
1326
|
icon: "refresh",
|
|
1351
1327
|
label: t("panel.restore"),
|
|
1352
1328
|
run: () => {
|
|
1353
|
-
|
|
1329
|
+
re(d);
|
|
1354
1330
|
}
|
|
1355
1331
|
}
|
|
1356
1332
|
];
|
|
1357
|
-
const
|
|
1358
|
-
{ key: "open", icon: "edit", label: t("panel.open"), run: () =>
|
|
1333
|
+
const D = [
|
|
1334
|
+
{ key: "open", icon: "edit", label: t("panel.open"), run: () => se(d) }
|
|
1359
1335
|
];
|
|
1360
|
-
return
|
|
1336
|
+
return d.url && d.status !== "draft" && D.push({
|
|
1361
1337
|
key: "site",
|
|
1362
1338
|
icon: "external-link",
|
|
1363
1339
|
label: t("panel.open-on-site"),
|
|
1364
|
-
href:
|
|
1365
|
-
}),
|
|
1340
|
+
href: d.url
|
|
1341
|
+
}), d.path !== null && D.push({
|
|
1366
1342
|
key: "copy",
|
|
1367
1343
|
icon: "copy",
|
|
1368
1344
|
label: t("panel.copy-address"),
|
|
1369
1345
|
run: () => {
|
|
1370
|
-
|
|
1346
|
+
g(d);
|
|
1371
1347
|
}
|
|
1372
|
-
}),
|
|
1348
|
+
}), D.push({
|
|
1373
1349
|
key: "pin",
|
|
1374
1350
|
icon: "star",
|
|
1375
|
-
label:
|
|
1351
|
+
label: d.pinned ? t("panel.unpin") : t("panel.pin"),
|
|
1376
1352
|
run: () => {
|
|
1377
|
-
|
|
1353
|
+
ke(d, !d.pinned);
|
|
1378
1354
|
}
|
|
1379
|
-
}),
|
|
1380
|
-
|
|
1355
|
+
}), D.push(
|
|
1356
|
+
d.status === "published" || d.status === "modified" || d.status === "scheduled" ? {
|
|
1381
1357
|
key: "unpublish",
|
|
1382
1358
|
icon: "eye-off",
|
|
1383
1359
|
label: t("panel.unpublish"),
|
|
1384
1360
|
run: () => {
|
|
1385
|
-
|
|
1361
|
+
Te(d);
|
|
1386
1362
|
}
|
|
1387
1363
|
} : {
|
|
1388
1364
|
key: "publish",
|
|
1389
1365
|
icon: "upload",
|
|
1390
1366
|
label: t("panel.publish"),
|
|
1391
1367
|
run: () => {
|
|
1392
|
-
|
|
1368
|
+
he(d);
|
|
1393
1369
|
}
|
|
1394
1370
|
}
|
|
1395
|
-
),
|
|
1371
|
+
), D.push({
|
|
1396
1372
|
key: "delete",
|
|
1397
1373
|
icon: "trash",
|
|
1398
1374
|
label: t("panel.delete"),
|
|
1399
1375
|
danger: !0,
|
|
1400
1376
|
run: () => {
|
|
1401
|
-
|
|
1377
|
+
fe(d);
|
|
1402
1378
|
}
|
|
1403
|
-
}),
|
|
1379
|
+
}), D;
|
|
1404
1380
|
}
|
|
1405
|
-
async function
|
|
1406
|
-
await
|
|
1381
|
+
async function he(d) {
|
|
1382
|
+
await me(() => y.publish(d.id), t("panel.published"));
|
|
1407
1383
|
}
|
|
1408
|
-
async function
|
|
1409
|
-
await
|
|
1384
|
+
async function Te(d) {
|
|
1385
|
+
await me(() => y.unpublish(d.id), t("panel.unpublished-done"));
|
|
1410
1386
|
}
|
|
1411
|
-
async function
|
|
1412
|
-
await
|
|
1413
|
-
() =>
|
|
1414
|
-
t(
|
|
1387
|
+
async function ke(d, D) {
|
|
1388
|
+
await me(
|
|
1389
|
+
() => y.save(d.id, { values: { pinned: D }, revision: d.revision }),
|
|
1390
|
+
t(D ? "panel.pinned-done" : "panel.unpinned")
|
|
1415
1391
|
);
|
|
1416
1392
|
}
|
|
1417
|
-
async function
|
|
1418
|
-
await
|
|
1419
|
-
title: t("panel.delete-title", { title:
|
|
1393
|
+
async function fe(d) {
|
|
1394
|
+
await be({
|
|
1395
|
+
title: t("panel.delete-title", { title: d.title }),
|
|
1420
1396
|
message: t("panel.delete-text"),
|
|
1421
1397
|
confirmText: t("panel.delete"),
|
|
1422
1398
|
cancelText: t("panel.cancel"),
|
|
1423
1399
|
tone: "danger"
|
|
1424
|
-
}) && await
|
|
1400
|
+
}) && await me(() => y.remove(d.id), t("panel.deleted"));
|
|
1425
1401
|
}
|
|
1426
|
-
async function
|
|
1427
|
-
await
|
|
1402
|
+
async function re(d) {
|
|
1403
|
+
await me(() => y.restore(d.id), t("panel.restored"));
|
|
1428
1404
|
}
|
|
1429
|
-
async function
|
|
1405
|
+
async function me(d, D) {
|
|
1430
1406
|
try {
|
|
1431
|
-
await
|
|
1432
|
-
} catch (
|
|
1433
|
-
L.danger(
|
|
1407
|
+
await d(), L.success(D);
|
|
1408
|
+
} catch (h) {
|
|
1409
|
+
L.danger(i(h));
|
|
1434
1410
|
} finally {
|
|
1435
|
-
await
|
|
1411
|
+
await k();
|
|
1436
1412
|
}
|
|
1437
1413
|
}
|
|
1438
|
-
async function
|
|
1439
|
-
if (
|
|
1414
|
+
async function g(d) {
|
|
1415
|
+
if (d.url)
|
|
1440
1416
|
try {
|
|
1441
|
-
await navigator.clipboard.writeText(
|
|
1417
|
+
await navigator.clipboard.writeText(d.url), L.success(t("panel.address-copied"));
|
|
1442
1418
|
} catch {
|
|
1443
1419
|
}
|
|
1444
1420
|
}
|
|
1445
|
-
function
|
|
1446
|
-
return
|
|
1421
|
+
function N(d) {
|
|
1422
|
+
return d === "published" || d === "modified" ? "success" : d === "scheduled" ? "warning" : "default";
|
|
1447
1423
|
}
|
|
1448
|
-
function
|
|
1449
|
-
return
|
|
1424
|
+
function B(d) {
|
|
1425
|
+
return F.value ? "—" : d.path === null ? t("panel.no-address") : `/${d.path}`;
|
|
1450
1426
|
}
|
|
1451
|
-
function
|
|
1452
|
-
return
|
|
1427
|
+
function X(d) {
|
|
1428
|
+
return F.value ? d.deleted_at : d.published_at;
|
|
1453
1429
|
}
|
|
1454
|
-
|
|
1430
|
+
const ye = v(
|
|
1431
|
+
() => W.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
|
|
1432
|
+
xe();
|
|
1433
|
+
} }] : []
|
|
1434
|
+
);
|
|
1435
|
+
return (d, D) => (p(), G("div", {
|
|
1455
1436
|
ref_key: "root",
|
|
1456
|
-
ref:
|
|
1437
|
+
ref: x,
|
|
1457
1438
|
class: "wx-articles"
|
|
1458
1439
|
}, [
|
|
1459
|
-
n(e(
|
|
1460
|
-
view:
|
|
1461
|
-
"onUpdate:view":
|
|
1440
|
+
n(e(Qe), {
|
|
1441
|
+
view: E.value,
|
|
1442
|
+
"onUpdate:view": D[3] || (D[3] = (h) => E.value = h),
|
|
1462
1443
|
title: S.value,
|
|
1463
|
-
views: R.value
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1444
|
+
views: R.value,
|
|
1445
|
+
actions: ye.value
|
|
1446
|
+
}, {
|
|
1447
|
+
default: l(() => [
|
|
1448
|
+
n(e(ot), {
|
|
1449
|
+
data: c.value,
|
|
1450
|
+
columns: I.value,
|
|
1469
1451
|
"row-key": "id",
|
|
1470
1452
|
searchable: "",
|
|
1471
|
-
clickable: !
|
|
1472
|
-
hover: !
|
|
1453
|
+
clickable: !F.value,
|
|
1454
|
+
hover: !F.value,
|
|
1473
1455
|
flush: "",
|
|
1456
|
+
loading: o.value,
|
|
1474
1457
|
layout: "fixed",
|
|
1475
|
-
loading: h.value,
|
|
1476
1458
|
"cards-below": nt,
|
|
1459
|
+
"filters-count": P.value.length,
|
|
1460
|
+
"filters-label": e(s)("filters.title"),
|
|
1477
1461
|
"search-placeholder": e(t)("panel.search"),
|
|
1478
|
-
"empty-text":
|
|
1462
|
+
"empty-text": K.value,
|
|
1479
1463
|
"aria-label": S.value,
|
|
1480
|
-
onRowClick:
|
|
1481
|
-
onStateChange:
|
|
1464
|
+
onRowClick: se,
|
|
1465
|
+
onStateChange: le
|
|
1482
1466
|
}, {
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1467
|
+
filters: l(() => [
|
|
1468
|
+
n(e(ie), {
|
|
1469
|
+
label: e(t)("panel.filter-rubric")
|
|
1470
|
+
}, {
|
|
1471
|
+
default: l(() => [
|
|
1472
|
+
n(e(_e), {
|
|
1473
|
+
"model-value": $.value.rubric,
|
|
1474
|
+
options: M.value.rubrics.map((h) => ({ value: h.id, label: h.title })),
|
|
1475
|
+
placeholder: e(t)("panel.any-rubric"),
|
|
1476
|
+
clearable: "",
|
|
1477
|
+
size: "sm",
|
|
1478
|
+
"onUpdate:modelValue": D[0] || (D[0] = (h) => O("rubric", h))
|
|
1479
|
+
}, null, 8, ["model-value", "options", "placeholder"])
|
|
1480
|
+
]),
|
|
1481
|
+
_: 1
|
|
1482
|
+
}, 8, ["label"]),
|
|
1483
|
+
n(e(ie), {
|
|
1484
|
+
label: e(t)("panel.filter-tag")
|
|
1485
|
+
}, {
|
|
1486
|
+
default: l(() => [
|
|
1487
|
+
n(e(_e), {
|
|
1488
|
+
"model-value": $.value.tag,
|
|
1489
|
+
options: M.value.tags.map((h) => ({ value: h.id, label: h.title })),
|
|
1490
|
+
placeholder: e(t)("panel.any-tag"),
|
|
1491
|
+
clearable: "",
|
|
1492
|
+
filterable: "",
|
|
1493
|
+
size: "sm",
|
|
1494
|
+
"onUpdate:modelValue": D[1] || (D[1] = (h) => O("tag", h))
|
|
1495
|
+
}, null, 8, ["model-value", "options", "placeholder"])
|
|
1496
|
+
]),
|
|
1497
|
+
_: 1
|
|
1498
|
+
}, 8, ["label"]),
|
|
1499
|
+
n(e(ie), {
|
|
1500
|
+
label: e(t)("panel.filter-author")
|
|
1501
|
+
}, {
|
|
1502
|
+
default: l(() => [
|
|
1503
|
+
n(e(_e), {
|
|
1504
|
+
"model-value": $.value.author,
|
|
1505
|
+
options: M.value.authors.map((h) => ({ value: h.id, label: h.title })),
|
|
1506
|
+
placeholder: e(t)("panel.any-author"),
|
|
1507
|
+
clearable: "",
|
|
1508
|
+
size: "sm",
|
|
1509
|
+
"onUpdate:modelValue": D[2] || (D[2] = (h) => O("author", h))
|
|
1510
|
+
}, null, 8, ["model-value", "options", "placeholder"])
|
|
1511
|
+
]),
|
|
1512
|
+
_: 1
|
|
1513
|
+
}, 8, ["label"]),
|
|
1514
|
+
P.value.length > 0 ? (p(), z(e(Z), {
|
|
1515
|
+
key: 0,
|
|
1516
|
+
variant: "text",
|
|
1517
|
+
size: "sm",
|
|
1518
|
+
block: "",
|
|
1519
|
+
onClick: q
|
|
1520
|
+
}, {
|
|
1521
|
+
icon: l(() => [
|
|
1522
|
+
n(e(we), { name: "close" })
|
|
1523
|
+
]),
|
|
1524
|
+
default: l(() => [
|
|
1525
|
+
w(" " + b(e(s)("filters.reset")), 1)
|
|
1526
|
+
]),
|
|
1527
|
+
_: 1
|
|
1528
|
+
})) : H("", !0)
|
|
1529
|
+
]),
|
|
1530
|
+
applied: l(() => [
|
|
1531
|
+
n(e(ht), { filters: P.value }, null, 8, ["filters"])
|
|
1511
1532
|
]),
|
|
1512
|
-
"cell-cover":
|
|
1513
|
-
|
|
1514
|
-
class:
|
|
1533
|
+
"cell-cover": l(({ row: h }) => [
|
|
1534
|
+
j("span", {
|
|
1535
|
+
class: Pe(["wx-articles__cover", { "is-empty": !h.cover }])
|
|
1515
1536
|
}, [
|
|
1516
|
-
|
|
1537
|
+
h.cover?.thumb ? (p(), G("img", {
|
|
1517
1538
|
key: 0,
|
|
1518
|
-
src:
|
|
1539
|
+
src: h.cover.thumb,
|
|
1519
1540
|
alt: "",
|
|
1520
1541
|
loading: "lazy"
|
|
1521
|
-
}, null, 8,
|
|
1542
|
+
}, null, 8, ua)) : (p(), z(e(we), {
|
|
1522
1543
|
key: 1,
|
|
1523
1544
|
name: "image",
|
|
1524
1545
|
size: "sm"
|
|
1525
1546
|
}))
|
|
1526
1547
|
], 2)
|
|
1527
1548
|
]),
|
|
1528
|
-
"cell-title":
|
|
1529
|
-
|
|
1530
|
-
|
|
1549
|
+
"cell-title": l(({ row: h }) => [
|
|
1550
|
+
j("div", da, [
|
|
1551
|
+
h.pinned ? (p(), z(e(et), {
|
|
1531
1552
|
key: 0,
|
|
1532
1553
|
content: e(t)("panel.pinned")
|
|
1533
1554
|
}, {
|
|
1534
|
-
default:
|
|
1535
|
-
n(e(
|
|
1555
|
+
default: l(() => [
|
|
1556
|
+
n(e(we), {
|
|
1536
1557
|
class: "wx-articles__pin",
|
|
1537
1558
|
name: "star",
|
|
1538
1559
|
size: "sm"
|
|
1539
1560
|
})
|
|
1540
1561
|
]),
|
|
1541
1562
|
_: 1
|
|
1542
|
-
}, 8, ["content"])) :
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1563
|
+
}, 8, ["content"])) : H("", !0),
|
|
1564
|
+
j("div", ca, [
|
|
1565
|
+
j("span", va, b(h.title), 1),
|
|
1566
|
+
j("span", pa, b(B(h)), 1)
|
|
1546
1567
|
])
|
|
1547
1568
|
])
|
|
1548
1569
|
]),
|
|
1549
|
-
"cell-rubrics":
|
|
1550
|
-
|
|
1551
|
-
(p(!0),
|
|
1552
|
-
key:
|
|
1570
|
+
"cell-rubrics": l(({ row: h }) => [
|
|
1571
|
+
j("span", fa, [
|
|
1572
|
+
(p(!0), G(ve, null, Be(h.rubrics, ($e) => (p(), z(e(oe), {
|
|
1573
|
+
key: $e.id,
|
|
1553
1574
|
size: "sm",
|
|
1554
1575
|
round: ""
|
|
1555
1576
|
}, {
|
|
1556
|
-
default:
|
|
1557
|
-
|
|
1577
|
+
default: l(() => [
|
|
1578
|
+
w(b($e.title), 1)
|
|
1558
1579
|
]),
|
|
1559
1580
|
_: 2
|
|
1560
1581
|
}, 1024))), 128))
|
|
1561
1582
|
])
|
|
1562
1583
|
]),
|
|
1563
|
-
"cell-author":
|
|
1564
|
-
n(e(
|
|
1584
|
+
"cell-author": l(({ row: h }) => [
|
|
1585
|
+
n(e(J), {
|
|
1565
1586
|
size: "sm",
|
|
1566
1587
|
tone: "muted",
|
|
1567
1588
|
truncate: ""
|
|
1568
1589
|
}, {
|
|
1569
|
-
default:
|
|
1570
|
-
|
|
1590
|
+
default: l(() => [
|
|
1591
|
+
w(b(h.author ? h.author.name : "—"), 1)
|
|
1571
1592
|
]),
|
|
1572
1593
|
_: 2
|
|
1573
1594
|
}, 1024)
|
|
1574
1595
|
]),
|
|
1575
|
-
"cell-date":
|
|
1576
|
-
|
|
1596
|
+
"cell-date": l(({ row: h }) => [
|
|
1597
|
+
X(h) ? (p(), z(e(je), {
|
|
1577
1598
|
key: 0,
|
|
1578
|
-
value:
|
|
1579
|
-
|
|
1599
|
+
value: X(h),
|
|
1600
|
+
compact: ""
|
|
1601
|
+
}, null, 8, ["value"])) : (p(), z(e(J), {
|
|
1580
1602
|
key: 1,
|
|
1581
1603
|
size: "sm",
|
|
1582
1604
|
tone: "muted"
|
|
1583
1605
|
}, {
|
|
1584
|
-
default:
|
|
1585
|
-
|
|
1606
|
+
default: l(() => [...D[4] || (D[4] = [
|
|
1607
|
+
w("—", -1)
|
|
1586
1608
|
])]),
|
|
1587
1609
|
_: 1
|
|
1588
1610
|
}))
|
|
1589
1611
|
]),
|
|
1590
|
-
"cell-status":
|
|
1591
|
-
|
|
1592
|
-
n(e(
|
|
1593
|
-
type:
|
|
1612
|
+
"cell-status": l(({ row: h }) => [
|
|
1613
|
+
j("span", ma, [
|
|
1614
|
+
n(e(oe), {
|
|
1615
|
+
type: N(h.status),
|
|
1594
1616
|
dot: "",
|
|
1595
1617
|
size: "sm"
|
|
1596
1618
|
}, {
|
|
1597
|
-
default:
|
|
1598
|
-
|
|
1619
|
+
default: l(() => [
|
|
1620
|
+
w(b(e(t)(`panel.status-${h.status}`)), 1)
|
|
1599
1621
|
]),
|
|
1600
1622
|
_: 2
|
|
1601
1623
|
}, 1032, ["type"]),
|
|
1602
|
-
|
|
1624
|
+
h.status === "modified" ? (p(), z(e(oe), {
|
|
1603
1625
|
key: 0,
|
|
1604
1626
|
type: "primary",
|
|
1605
1627
|
size: "sm",
|
|
1606
1628
|
round: ""
|
|
1607
1629
|
}, {
|
|
1608
|
-
default:
|
|
1609
|
-
|
|
1630
|
+
default: l(() => [
|
|
1631
|
+
w(b(e(t)("panel.edits")), 1)
|
|
1610
1632
|
]),
|
|
1611
1633
|
_: 1
|
|
1612
|
-
})) :
|
|
1634
|
+
})) : H("", !0)
|
|
1613
1635
|
])
|
|
1614
1636
|
]),
|
|
1615
|
-
"cell-card":
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1637
|
+
"cell-card": l(({ row: h }) => [
|
|
1638
|
+
n(e(xt), {
|
|
1639
|
+
class: "wx-articles__entity",
|
|
1640
|
+
variant: "plain",
|
|
1641
|
+
title: h.title,
|
|
1642
|
+
image: h.cover?.thumb ?? void 0,
|
|
1643
|
+
"image-size": "56px",
|
|
1644
|
+
"title-lines": 2,
|
|
1645
|
+
subtitle: B(h)
|
|
1646
|
+
}, {
|
|
1647
|
+
title: l(() => [
|
|
1648
|
+
h.pinned ? (p(), z(e(we), {
|
|
1621
1649
|
key: 0,
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
loading: "lazy"
|
|
1625
|
-
}, null, 8, $a)) : (p(), V(e(Y), {
|
|
1626
|
-
key: 1,
|
|
1627
|
-
name: "image",
|
|
1650
|
+
class: "wx-articles__pin",
|
|
1651
|
+
name: "star",
|
|
1628
1652
|
size: "sm"
|
|
1629
|
-
}))
|
|
1630
|
-
|
|
1631
|
-
q("div", Ta, [
|
|
1632
|
-
q("div", Va, [
|
|
1633
|
-
s.pinned ? (p(), V(e(Y), {
|
|
1634
|
-
key: 0,
|
|
1635
|
-
class: "wx-articles__pin",
|
|
1636
|
-
name: "star",
|
|
1637
|
-
size: "sm"
|
|
1638
|
-
})) : I("", !0),
|
|
1639
|
-
q("span", null, f(s.title), 1)
|
|
1640
|
-
]),
|
|
1641
|
-
q("div", Aa, [
|
|
1642
|
-
s.rubrics[0] ? (p(), V(e(re), {
|
|
1643
|
-
key: 0,
|
|
1644
|
-
size: "sm",
|
|
1645
|
-
round: ""
|
|
1646
|
-
}, {
|
|
1647
|
-
default: a(() => [
|
|
1648
|
-
g(f(s.rubrics[0].title), 1)
|
|
1649
|
-
]),
|
|
1650
|
-
_: 2
|
|
1651
|
-
}, 1024)) : I("", !0),
|
|
1652
|
-
n(e(re), {
|
|
1653
|
-
type: ye(s.status),
|
|
1654
|
-
dot: "",
|
|
1655
|
-
size: "sm"
|
|
1656
|
-
}, {
|
|
1657
|
-
default: a(() => [
|
|
1658
|
-
g(f(e(t)(`panel.status-${s.status}`)), 1)
|
|
1659
|
-
]),
|
|
1660
|
-
_: 2
|
|
1661
|
-
}, 1032, ["type"]),
|
|
1662
|
-
ie(s) ? (p(), V(e(De), {
|
|
1663
|
-
key: 1,
|
|
1664
|
-
value: ie(s)
|
|
1665
|
-
}, null, 8, ["value"])) : I("", !0),
|
|
1666
|
-
s.author ? (p(), V(e(G), {
|
|
1667
|
-
key: 2,
|
|
1668
|
-
size: "sm",
|
|
1669
|
-
tone: "muted",
|
|
1670
|
-
truncate: ""
|
|
1671
|
-
}, {
|
|
1672
|
-
default: a(() => [
|
|
1673
|
-
g(f(s.author.name), 1)
|
|
1674
|
-
]),
|
|
1675
|
-
_: 2
|
|
1676
|
-
}, 1024)) : I("", !0)
|
|
1677
|
-
])
|
|
1653
|
+
})) : H("", !0),
|
|
1654
|
+
w(" " + b(h.title), 1)
|
|
1678
1655
|
]),
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1656
|
+
meta: l(() => [
|
|
1657
|
+
h.rubrics[0] ? (p(), z(e(oe), {
|
|
1658
|
+
key: 0,
|
|
1659
|
+
size: "sm",
|
|
1660
|
+
round: ""
|
|
1661
|
+
}, {
|
|
1662
|
+
default: l(() => [
|
|
1663
|
+
w(b(h.rubrics[0].title), 1)
|
|
1664
|
+
]),
|
|
1665
|
+
_: 2
|
|
1666
|
+
}, 1024)) : H("", !0),
|
|
1667
|
+
n(e(oe), {
|
|
1668
|
+
type: N(h.status),
|
|
1669
|
+
dot: "",
|
|
1670
|
+
size: "sm"
|
|
1671
|
+
}, {
|
|
1672
|
+
default: l(() => [
|
|
1673
|
+
w(b(e(t)(`panel.status-${h.status}`)), 1)
|
|
1674
|
+
]),
|
|
1675
|
+
_: 2
|
|
1676
|
+
}, 1032, ["type"]),
|
|
1677
|
+
X(h) ? (p(), z(e(je), {
|
|
1678
|
+
key: 1,
|
|
1679
|
+
value: X(h)
|
|
1680
|
+
}, null, 8, ["value"])) : H("", !0)
|
|
1681
|
+
]),
|
|
1682
|
+
_: 2
|
|
1683
|
+
}, 1032, ["title", "image", "subtitle"])
|
|
1684
|
+
]),
|
|
1685
|
+
"card-actions": l(({ row: h }) => [
|
|
1686
|
+
n(e(Re), {
|
|
1687
|
+
actions: ce(h),
|
|
1688
|
+
label: h.title
|
|
1689
|
+
}, null, 8, ["actions", "label"])
|
|
1684
1690
|
]),
|
|
1685
|
-
"cell-actions":
|
|
1686
|
-
n(e(
|
|
1687
|
-
actions:
|
|
1688
|
-
label:
|
|
1691
|
+
"cell-actions": l(({ row: h }) => [
|
|
1692
|
+
n(e(Re), {
|
|
1693
|
+
actions: ce(h),
|
|
1694
|
+
label: h.title
|
|
1689
1695
|
}, null, 8, ["actions", "label"])
|
|
1690
1696
|
]),
|
|
1691
1697
|
_: 1
|
|
1692
|
-
}, 8, ["data", "columns", "clickable", "hover", "loading", "search-placeholder", "empty-text", "aria-label"])
|
|
1698
|
+
}, 8, ["data", "columns", "clickable", "hover", "loading", "filters-count", "filters-label", "search-placeholder", "empty-text", "aria-label"])
|
|
1693
1699
|
]),
|
|
1694
|
-
_:
|
|
1695
|
-
}, [
|
|
1696
|
-
k.value ? {
|
|
1697
|
-
name: "actions",
|
|
1698
|
-
fn: a(() => [
|
|
1699
|
-
n(e(F), {
|
|
1700
|
-
type: "primary",
|
|
1701
|
-
icon: "plus",
|
|
1702
|
-
onClick: j
|
|
1703
|
-
}, {
|
|
1704
|
-
default: a(() => [
|
|
1705
|
-
g(f(e(t)("panel.new")), 1)
|
|
1706
|
-
]),
|
|
1707
|
-
_: 1
|
|
1708
|
-
})
|
|
1709
|
-
]),
|
|
1710
|
-
key: "0"
|
|
1711
|
-
} : void 0
|
|
1712
|
-
]), 1032, ["view", "title", "views"])
|
|
1700
|
+
_: 1
|
|
1701
|
+
}, 8, ["view", "title", "views", "actions"])
|
|
1713
1702
|
], 512));
|
|
1714
1703
|
}
|
|
1715
|
-
}),
|
|
1704
|
+
}), ga = /* @__PURE__ */ pe(ba, [["__scopeId", "data-v-2d93df26"]]), ha = { class: "wx-rubric-form__head" }, ya = { class: "wx-rubric-form__body" }, wa = { class: "wx-rubric-form__row" }, _a = { class: "wx-rubric-form__row" }, xa = { class: "wx-rubric-form__side" }, ka = {
|
|
1716
1705
|
key: 1,
|
|
1717
1706
|
class: "wx-rubric-form__seo"
|
|
1718
|
-
},
|
|
1707
|
+
}, $a = { class: "wx-rubric-form__foot" }, Ta = /* @__PURE__ */ ee({
|
|
1719
1708
|
__name: "RubricForm",
|
|
1720
1709
|
props: {
|
|
1721
1710
|
rubric: {},
|
|
@@ -1724,13 +1713,13 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
1724
1713
|
disabled: { type: Boolean, default: !1 }
|
|
1725
1714
|
},
|
|
1726
1715
|
emits: ["back", "saved", "deleted", "articles"],
|
|
1727
|
-
setup(
|
|
1728
|
-
const
|
|
1729
|
-
|
|
1730
|
-
const
|
|
1731
|
-
() =>
|
|
1732
|
-
),
|
|
1733
|
-
function
|
|
1716
|
+
setup(f, { emit: m }) {
|
|
1717
|
+
const r = f, y = m, u = ne(), a = de(u), t = Xe();
|
|
1718
|
+
te();
|
|
1719
|
+
const s = Q("webx-blog"), i = ge(), x = v(() => u.types["wx-media"]?.component), T = v(() => u.types["wx-seo"]?.component), c = v(
|
|
1720
|
+
() => u.types["wx-seo"]?.bind?.({ id: "seo", type: "wx-seo" }) ?? {}
|
|
1721
|
+
), o = C(E()), _ = C({}), W = C(!1), S = C(!1);
|
|
1722
|
+
function E() {
|
|
1734
1723
|
return {
|
|
1735
1724
|
title: {},
|
|
1736
1725
|
slug: {},
|
|
@@ -1740,433 +1729,424 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
1740
1729
|
seo: {}
|
|
1741
1730
|
};
|
|
1742
1731
|
}
|
|
1743
|
-
|
|
1744
|
-
() =>
|
|
1745
|
-
(
|
|
1746
|
-
if (
|
|
1747
|
-
|
|
1732
|
+
ue(
|
|
1733
|
+
() => r.rubric,
|
|
1734
|
+
(P) => {
|
|
1735
|
+
if (_.value = {}, S.value = !1, P === null) {
|
|
1736
|
+
o.value = E();
|
|
1748
1737
|
return;
|
|
1749
1738
|
}
|
|
1750
|
-
|
|
1751
|
-
title: { ...
|
|
1752
|
-
slug: { ...
|
|
1753
|
-
lead: { ...
|
|
1754
|
-
cover:
|
|
1755
|
-
is_visible:
|
|
1756
|
-
seo: { ...
|
|
1757
|
-
},
|
|
1739
|
+
o.value = {
|
|
1740
|
+
title: { ...P.title },
|
|
1741
|
+
slug: { ...P.slug },
|
|
1742
|
+
lead: { ...P.lead },
|
|
1743
|
+
cover: P.cover ? { path: P.cover.path, url: P.cover.url } : null,
|
|
1744
|
+
is_visible: P.is_visible,
|
|
1745
|
+
seo: { ...P.seo }
|
|
1746
|
+
}, S.value = Object.keys(P.seo ?? {}).length > 0;
|
|
1758
1747
|
},
|
|
1759
1748
|
{ immediate: !0 }
|
|
1760
1749
|
);
|
|
1761
|
-
const
|
|
1762
|
-
() =>
|
|
1763
|
-
),
|
|
1764
|
-
const
|
|
1765
|
-
return
|
|
1766
|
-
}),
|
|
1767
|
-
const
|
|
1768
|
-
return typeof
|
|
1769
|
-
}),
|
|
1770
|
-
function
|
|
1771
|
-
const
|
|
1772
|
-
(
|
|
1750
|
+
const F = v(
|
|
1751
|
+
() => o.value.title[t.active.value] || r.rubric?.name || s("rubric.new")
|
|
1752
|
+
), $ = v(() => {
|
|
1753
|
+
const P = o.value.slug[t.active.value] ?? "";
|
|
1754
|
+
return P === "" ? null : `/${[r.prefix, P].filter(Boolean).join("/")}`;
|
|
1755
|
+
}), U = v(() => {
|
|
1756
|
+
const P = r.rubric?.path;
|
|
1757
|
+
return typeof P == "string" && $.value !== null && $.value !== `/${P}`;
|
|
1758
|
+
}), R = v(() => r.rubric?.articles_count ?? 0);
|
|
1759
|
+
function M(P) {
|
|
1760
|
+
const q = Object.keys(_.value).find(
|
|
1761
|
+
(k) => k === P || k.startsWith(`${P}.`)
|
|
1773
1762
|
);
|
|
1774
|
-
return
|
|
1763
|
+
return q === void 0 ? void 0 : _.value[q]?.[0];
|
|
1775
1764
|
}
|
|
1776
1765
|
function A() {
|
|
1777
1766
|
return {
|
|
1778
|
-
title:
|
|
1779
|
-
slug:
|
|
1780
|
-
lead:
|
|
1781
|
-
cover:
|
|
1782
|
-
is_visible:
|
|
1767
|
+
title: o.value.title,
|
|
1768
|
+
slug: o.value.slug,
|
|
1769
|
+
lead: o.value.lead,
|
|
1770
|
+
cover: o.value.cover === null ? null : { path: o.value.cover.path },
|
|
1771
|
+
is_visible: o.value.is_visible,
|
|
1783
1772
|
// Only when it was opened: a save of the rest of the form must not empty a card nobody
|
|
1784
1773
|
// looked at, and an untouched card is the rules being left in charge (§12).
|
|
1785
|
-
...
|
|
1774
|
+
...S.value ? { seo: o.value.seo } : {}
|
|
1786
1775
|
};
|
|
1787
1776
|
}
|
|
1788
|
-
async function
|
|
1789
|
-
|
|
1777
|
+
async function I() {
|
|
1778
|
+
W.value = !0, _.value = {};
|
|
1790
1779
|
try {
|
|
1791
|
-
const
|
|
1792
|
-
L.success(
|
|
1793
|
-
} catch (
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1780
|
+
const P = r.rubric === null ? await a.createRubric(A()) : await a.saveRubric(r.rubric.id, A());
|
|
1781
|
+
L.success(r.rubric === null ? s("rubric.created") : s("rubric.saved")), y("saved", P);
|
|
1782
|
+
} catch (P) {
|
|
1783
|
+
const q = P.body;
|
|
1784
|
+
q?.errors && (_.value = q.errors), L.danger(i(P));
|
|
1796
1785
|
} finally {
|
|
1797
|
-
|
|
1786
|
+
W.value = !1;
|
|
1798
1787
|
}
|
|
1799
1788
|
}
|
|
1800
|
-
async function
|
|
1801
|
-
if (!(
|
|
1802
|
-
title:
|
|
1803
|
-
message:
|
|
1804
|
-
confirmText:
|
|
1805
|
-
cancelText:
|
|
1789
|
+
async function K() {
|
|
1790
|
+
if (!(r.rubric === null || !await be({
|
|
1791
|
+
title: s("rubric.delete-title", { name: r.rubric.name }),
|
|
1792
|
+
message: s("rubric.delete-text"),
|
|
1793
|
+
confirmText: s("rubric.delete"),
|
|
1794
|
+
cancelText: s("rubric.cancel"),
|
|
1806
1795
|
tone: "danger"
|
|
1807
1796
|
})))
|
|
1808
1797
|
try {
|
|
1809
|
-
await
|
|
1810
|
-
} catch (
|
|
1811
|
-
L.danger(i(
|
|
1798
|
+
await a.removeRubric(r.rubric.id), L.success(s("rubric.deleted")), y("deleted");
|
|
1799
|
+
} catch (q) {
|
|
1800
|
+
L.danger(i(q));
|
|
1812
1801
|
}
|
|
1813
1802
|
}
|
|
1814
|
-
return (
|
|
1815
|
-
class:
|
|
1803
|
+
return (P, q) => (p(), G("div", {
|
|
1804
|
+
class: Pe(["wx-rubric-form", { "is-pane": r.inline }])
|
|
1816
1805
|
}, [
|
|
1817
|
-
|
|
1818
|
-
|
|
1806
|
+
j("div", ha, [
|
|
1807
|
+
r.inline ? H("", !0) : (p(), z(e(Oe), {
|
|
1819
1808
|
key: 0,
|
|
1820
1809
|
icon: "arrow-left",
|
|
1821
|
-
title: e(
|
|
1822
|
-
onClick:
|
|
1810
|
+
title: e(s)("rubric.back"),
|
|
1811
|
+
onClick: q[0] || (q[0] = (k) => y("back"))
|
|
1823
1812
|
}, null, 8, ["title"])),
|
|
1824
1813
|
n(e(kt), {
|
|
1825
1814
|
level: 3,
|
|
1826
1815
|
truncate: ""
|
|
1827
1816
|
}, {
|
|
1828
|
-
default:
|
|
1829
|
-
|
|
1817
|
+
default: l(() => [
|
|
1818
|
+
w(b(F.value), 1)
|
|
1830
1819
|
]),
|
|
1831
1820
|
_: 1
|
|
1832
1821
|
}),
|
|
1833
|
-
|
|
1822
|
+
r.rubric ? (p(), z(e(J), {
|
|
1834
1823
|
key: 1,
|
|
1835
1824
|
size: "sm",
|
|
1836
1825
|
tone: "muted"
|
|
1837
1826
|
}, {
|
|
1838
|
-
default:
|
|
1839
|
-
|
|
1827
|
+
default: l(() => [
|
|
1828
|
+
w(b(e(s)("rubric.articles", { count: R.value })), 1)
|
|
1840
1829
|
]),
|
|
1841
1830
|
_: 1
|
|
1842
|
-
})) :
|
|
1843
|
-
|
|
1844
|
-
|
|
1831
|
+
})) : H("", !0),
|
|
1832
|
+
q[10] || (q[10] = j("span", { class: "wx-rubric-form__spacer" }, null, -1)),
|
|
1833
|
+
r.rubric && R.value > 0 ? (p(), z(e(Z), {
|
|
1845
1834
|
key: 2,
|
|
1846
1835
|
variant: "text",
|
|
1847
1836
|
size: "sm",
|
|
1848
|
-
onClick:
|
|
1837
|
+
onClick: q[1] || (q[1] = (k) => y("articles", r.rubric))
|
|
1849
1838
|
}, {
|
|
1850
|
-
default:
|
|
1851
|
-
|
|
1839
|
+
default: l(() => [
|
|
1840
|
+
w(b(e(s)("rubric.show-articles")), 1)
|
|
1852
1841
|
]),
|
|
1853
1842
|
_: 1
|
|
1854
|
-
})) :
|
|
1843
|
+
})) : H("", !0)
|
|
1855
1844
|
]),
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
n(e(
|
|
1845
|
+
j("div", ya, [
|
|
1846
|
+
j("div", wa, [
|
|
1847
|
+
n(e(ie), {
|
|
1859
1848
|
class: "wx-rubric-form__title",
|
|
1860
|
-
label: e(
|
|
1861
|
-
error:
|
|
1849
|
+
label: e(s)("rubric.field-title"),
|
|
1850
|
+
error: M("title"),
|
|
1862
1851
|
required: ""
|
|
1863
1852
|
}, {
|
|
1864
|
-
default:
|
|
1865
|
-
n(e(
|
|
1866
|
-
modelValue:
|
|
1867
|
-
"onUpdate:modelValue":
|
|
1853
|
+
default: l(() => [
|
|
1854
|
+
n(e(Ae), {
|
|
1855
|
+
modelValue: o.value.title,
|
|
1856
|
+
"onUpdate:modelValue": q[2] || (q[2] = (k) => o.value.title = k),
|
|
1868
1857
|
localized: "",
|
|
1869
|
-
disabled:
|
|
1858
|
+
disabled: r.disabled
|
|
1870
1859
|
}, null, 8, ["modelValue", "disabled"])
|
|
1871
1860
|
]),
|
|
1872
1861
|
_: 1
|
|
1873
1862
|
}, 8, ["label", "error"]),
|
|
1874
|
-
n(e(
|
|
1863
|
+
n(e(ie), {
|
|
1875
1864
|
class: "wx-rubric-form__slug",
|
|
1876
|
-
label: e(
|
|
1877
|
-
error:
|
|
1878
|
-
help:
|
|
1865
|
+
label: e(s)("rubric.field-slug"),
|
|
1866
|
+
error: M("slug"),
|
|
1867
|
+
help: $.value ?? e(s)("rubric.no-address")
|
|
1879
1868
|
}, {
|
|
1880
|
-
default:
|
|
1881
|
-
n(e(
|
|
1882
|
-
modelValue:
|
|
1883
|
-
"onUpdate:modelValue":
|
|
1869
|
+
default: l(() => [
|
|
1870
|
+
n(e(Ae), {
|
|
1871
|
+
modelValue: o.value.slug,
|
|
1872
|
+
"onUpdate:modelValue": q[3] || (q[3] = (k) => o.value.slug = k),
|
|
1884
1873
|
localized: "",
|
|
1885
|
-
disabled:
|
|
1874
|
+
disabled: r.disabled
|
|
1886
1875
|
}, null, 8, ["modelValue", "disabled"])
|
|
1887
1876
|
]),
|
|
1888
1877
|
_: 1
|
|
1889
1878
|
}, 8, ["label", "error", "help"])
|
|
1890
1879
|
]),
|
|
1891
|
-
|
|
1880
|
+
U.value ? (p(), z(e(We), {
|
|
1892
1881
|
key: 0,
|
|
1893
1882
|
type: "info",
|
|
1894
1883
|
variant: "soft",
|
|
1895
|
-
description: e(
|
|
1896
|
-
}, null, 8, ["description"])) :
|
|
1897
|
-
n(e(
|
|
1898
|
-
label: e(
|
|
1899
|
-
help: e(
|
|
1884
|
+
description: e(s)("rubric.address-moving")
|
|
1885
|
+
}, null, 8, ["description"])) : H("", !0),
|
|
1886
|
+
n(e(ie), {
|
|
1887
|
+
label: e(s)("rubric.field-lead"),
|
|
1888
|
+
help: e(s)("rubric.lead-help"),
|
|
1900
1889
|
wide: ""
|
|
1901
1890
|
}, {
|
|
1902
|
-
default:
|
|
1891
|
+
default: l(() => [
|
|
1903
1892
|
n(e($t), {
|
|
1904
|
-
modelValue:
|
|
1905
|
-
"onUpdate:modelValue":
|
|
1893
|
+
modelValue: o.value.lead,
|
|
1894
|
+
"onUpdate:modelValue": q[4] || (q[4] = (k) => o.value.lead = k),
|
|
1906
1895
|
localized: "",
|
|
1907
1896
|
rows: 3,
|
|
1908
|
-
disabled:
|
|
1897
|
+
disabled: r.disabled
|
|
1909
1898
|
}, null, 8, ["modelValue", "disabled"])
|
|
1910
1899
|
]),
|
|
1911
1900
|
_: 1
|
|
1912
1901
|
}, 8, ["label", "help"]),
|
|
1913
|
-
|
|
1914
|
-
|
|
1902
|
+
j("div", _a, [
|
|
1903
|
+
x.value ? (p(), z(tt(x.value), {
|
|
1915
1904
|
key: 0,
|
|
1916
|
-
modelValue:
|
|
1917
|
-
"onUpdate:modelValue":
|
|
1905
|
+
modelValue: o.value.cover,
|
|
1906
|
+
"onUpdate:modelValue": q[5] || (q[5] = (k) => o.value.cover = k),
|
|
1918
1907
|
class: "wx-rubric-form__cover",
|
|
1919
|
-
label: e(
|
|
1908
|
+
label: e(s)("rubric.field-cover"),
|
|
1920
1909
|
accept: "image",
|
|
1921
1910
|
captions: !1,
|
|
1922
1911
|
aspect: "16/9",
|
|
1923
|
-
disabled:
|
|
1924
|
-
}, null, 8, ["modelValue", "label", "disabled"])) :
|
|
1925
|
-
|
|
1912
|
+
disabled: r.disabled
|
|
1913
|
+
}, null, 8, ["modelValue", "label", "disabled"])) : H("", !0),
|
|
1914
|
+
j("div", xa, [
|
|
1926
1915
|
n(e(Tt), {
|
|
1927
|
-
modelValue:
|
|
1928
|
-
"onUpdate:modelValue":
|
|
1929
|
-
label: e(
|
|
1930
|
-
disabled:
|
|
1916
|
+
modelValue: o.value.is_visible,
|
|
1917
|
+
"onUpdate:modelValue": q[6] || (q[6] = (k) => o.value.is_visible = k),
|
|
1918
|
+
label: e(s)("rubric.visible"),
|
|
1919
|
+
disabled: r.disabled
|
|
1931
1920
|
}, null, 8, ["modelValue", "label", "disabled"]),
|
|
1932
|
-
n(e(
|
|
1921
|
+
n(e(J), {
|
|
1933
1922
|
size: "sm",
|
|
1934
1923
|
tone: "muted"
|
|
1935
1924
|
}, {
|
|
1936
|
-
default:
|
|
1937
|
-
|
|
1925
|
+
default: l(() => [
|
|
1926
|
+
w(b(e(s)("rubric.visible-help")), 1)
|
|
1938
1927
|
]),
|
|
1939
1928
|
_: 1
|
|
1940
1929
|
})
|
|
1941
1930
|
])
|
|
1942
1931
|
]),
|
|
1943
|
-
T.value ? (p(),
|
|
1944
|
-
|
|
1932
|
+
T.value ? (p(), G("div", ka, [
|
|
1933
|
+
S.value ? (p(), z(tt(T.value), pt({
|
|
1945
1934
|
key: 1,
|
|
1946
|
-
modelValue:
|
|
1947
|
-
"onUpdate:modelValue":
|
|
1948
|
-
},
|
|
1935
|
+
modelValue: o.value.seo,
|
|
1936
|
+
"onUpdate:modelValue": q[8] || (q[8] = (k) => o.value.seo = k)
|
|
1937
|
+
}, c.value, {
|
|
1949
1938
|
"structured-data": !1,
|
|
1950
|
-
disabled:
|
|
1951
|
-
}), null, 16, ["modelValue", "disabled"])) : (p(),
|
|
1952
|
-
n(e(
|
|
1939
|
+
disabled: r.disabled
|
|
1940
|
+
}), null, 16, ["modelValue", "disabled"])) : (p(), G(ve, { key: 0 }, [
|
|
1941
|
+
n(e(J), {
|
|
1953
1942
|
size: "sm",
|
|
1954
1943
|
weight: "medium"
|
|
1955
1944
|
}, {
|
|
1956
|
-
default:
|
|
1957
|
-
|
|
1945
|
+
default: l(() => [
|
|
1946
|
+
w(b(e(s)("rubric.seo")), 1)
|
|
1958
1947
|
]),
|
|
1959
1948
|
_: 1
|
|
1960
1949
|
}),
|
|
1961
|
-
n(e(
|
|
1950
|
+
n(e(J), {
|
|
1962
1951
|
size: "sm",
|
|
1963
1952
|
tone: "muted"
|
|
1964
1953
|
}, {
|
|
1965
|
-
default:
|
|
1966
|
-
|
|
1954
|
+
default: l(() => [
|
|
1955
|
+
w(b(e(s)("rubric.seo-help")), 1)
|
|
1967
1956
|
]),
|
|
1968
1957
|
_: 1
|
|
1969
1958
|
}),
|
|
1970
|
-
n(e(
|
|
1959
|
+
n(e(Z), {
|
|
1971
1960
|
variant: "text",
|
|
1972
1961
|
size: "sm",
|
|
1973
|
-
disabled:
|
|
1974
|
-
onClick:
|
|
1962
|
+
disabled: r.disabled,
|
|
1963
|
+
onClick: q[7] || (q[7] = (k) => S.value = !0)
|
|
1975
1964
|
}, {
|
|
1976
|
-
default:
|
|
1977
|
-
|
|
1965
|
+
default: l(() => [
|
|
1966
|
+
w(b(e(s)("rubric.seo-override", { name: F.value })), 1)
|
|
1978
1967
|
]),
|
|
1979
1968
|
_: 1
|
|
1980
1969
|
}, 8, ["disabled"])
|
|
1981
1970
|
], 64))
|
|
1982
|
-
])) :
|
|
1971
|
+
])) : H("", !0)
|
|
1983
1972
|
]),
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
n(e(
|
|
1973
|
+
j("div", $a, [
|
|
1974
|
+
r.rubric ? (p(), G(ve, { key: 0 }, [
|
|
1975
|
+
n(e(Z), {
|
|
1987
1976
|
variant: "outline",
|
|
1988
1977
|
type: "danger",
|
|
1989
|
-
disabled:
|
|
1990
|
-
onClick:
|
|
1978
|
+
disabled: r.disabled || R.value > 0,
|
|
1979
|
+
onClick: K
|
|
1991
1980
|
}, {
|
|
1992
|
-
icon:
|
|
1993
|
-
n(e(
|
|
1981
|
+
icon: l(() => [
|
|
1982
|
+
n(e(we), { name: "trash" })
|
|
1994
1983
|
]),
|
|
1995
|
-
default:
|
|
1996
|
-
|
|
1984
|
+
default: l(() => [
|
|
1985
|
+
w(" " + b(e(s)("rubric.delete")), 1)
|
|
1997
1986
|
]),
|
|
1998
1987
|
_: 1
|
|
1999
1988
|
}, 8, ["disabled"]),
|
|
2000
|
-
|
|
1989
|
+
R.value > 0 ? (p(), z(e(J), {
|
|
2001
1990
|
key: 0,
|
|
2002
1991
|
size: "sm",
|
|
2003
1992
|
tone: "muted"
|
|
2004
1993
|
}, {
|
|
2005
|
-
default:
|
|
2006
|
-
|
|
1994
|
+
default: l(() => [
|
|
1995
|
+
w(b(e(s)("rubric.delete-blocked")), 1)
|
|
2007
1996
|
]),
|
|
2008
1997
|
_: 1
|
|
2009
|
-
})) :
|
|
2010
|
-
], 64)) :
|
|
2011
|
-
|
|
2012
|
-
n(e(
|
|
1998
|
+
})) : H("", !0)
|
|
1999
|
+
], 64)) : H("", !0),
|
|
2000
|
+
q[11] || (q[11] = j("span", { class: "wx-rubric-form__spacer" }, null, -1)),
|
|
2001
|
+
n(e(Z), {
|
|
2013
2002
|
variant: "outline",
|
|
2014
|
-
onClick:
|
|
2003
|
+
onClick: q[9] || (q[9] = (k) => y("back"))
|
|
2015
2004
|
}, {
|
|
2016
|
-
default:
|
|
2017
|
-
|
|
2005
|
+
default: l(() => [
|
|
2006
|
+
w(b(e(s)("rubric.cancel")), 1)
|
|
2018
2007
|
]),
|
|
2019
2008
|
_: 1
|
|
2020
2009
|
}),
|
|
2021
|
-
n(e(
|
|
2010
|
+
n(e(Z), {
|
|
2022
2011
|
type: "primary",
|
|
2023
|
-
loading:
|
|
2024
|
-
disabled:
|
|
2025
|
-
onClick:
|
|
2012
|
+
loading: W.value,
|
|
2013
|
+
disabled: r.disabled,
|
|
2014
|
+
onClick: I
|
|
2026
2015
|
}, {
|
|
2027
|
-
default:
|
|
2028
|
-
|
|
2016
|
+
default: l(() => [
|
|
2017
|
+
w(b(e(s)("rubric.save")), 1)
|
|
2029
2018
|
]),
|
|
2030
2019
|
_: 1
|
|
2031
2020
|
}, 8, ["loading", "disabled"])
|
|
2032
2021
|
])
|
|
2033
2022
|
], 2));
|
|
2034
2023
|
}
|
|
2035
|
-
}),
|
|
2024
|
+
}), Va = /* @__PURE__ */ pe(Ta, [["__scopeId", "data-v-ace40cf4"]]), Aa = ["onClick"], Sa = { class: "wx-rubric-row__name" }, Wa = /* @__PURE__ */ ee({
|
|
2036
2025
|
__name: "RubricsPage",
|
|
2037
2026
|
props: {
|
|
2038
2027
|
base: { default: "/blog" }
|
|
2039
2028
|
},
|
|
2040
|
-
setup(
|
|
2041
|
-
const
|
|
2042
|
-
|
|
2043
|
-
const t =
|
|
2044
|
-
() =>
|
|
2045
|
-
),
|
|
2046
|
-
const
|
|
2047
|
-
return typeof
|
|
2048
|
-
}),
|
|
2049
|
-
async function
|
|
2029
|
+
setup(f) {
|
|
2030
|
+
const m = f, r = ne(), y = de(r), u = He(), a = Ke();
|
|
2031
|
+
te();
|
|
2032
|
+
const t = Q("webx-blog"), s = ge(), i = C([]), x = C(""), T = C(!0), c = C(!1), o = C(!1), _ = v(() => r.can("blog.taxonomy.manage")), W = v(
|
|
2033
|
+
() => r.state.manifest?.modules.find((k) => k.id === "rubrics")?.title ?? t("module.rubrics")
|
|
2034
|
+
), S = v(() => {
|
|
2035
|
+
const k = u.query.rubric;
|
|
2036
|
+
return typeof k == "string" && k !== "" ? Number(k) : null;
|
|
2037
|
+
}), E = v(() => i.value.find((k) => k.id === S.value) ?? null);
|
|
2038
|
+
async function F() {
|
|
2050
2039
|
T.value = !0;
|
|
2051
2040
|
try {
|
|
2052
|
-
const
|
|
2053
|
-
i.value =
|
|
2054
|
-
} catch (
|
|
2055
|
-
L.danger(
|
|
2041
|
+
const k = await y.rubrics();
|
|
2042
|
+
i.value = k.data, x.value = k.prefix;
|
|
2043
|
+
} catch (k) {
|
|
2044
|
+
L.danger(s(k));
|
|
2056
2045
|
} finally {
|
|
2057
2046
|
T.value = !1;
|
|
2058
2047
|
}
|
|
2059
2048
|
}
|
|
2060
|
-
|
|
2061
|
-
|
|
2049
|
+
F(), ue(E, (k) => {
|
|
2050
|
+
k !== null && (c.value = !0);
|
|
2062
2051
|
});
|
|
2063
|
-
function
|
|
2064
|
-
|
|
2052
|
+
function $(k) {
|
|
2053
|
+
o.value = !1, a.replace({ query: { ...u.query, rubric: String(k.id) } }), c.value = !0;
|
|
2065
2054
|
}
|
|
2066
|
-
function
|
|
2067
|
-
|
|
2055
|
+
function U() {
|
|
2056
|
+
o.value = !0, R(), c.value = !0;
|
|
2068
2057
|
}
|
|
2069
|
-
function
|
|
2070
|
-
const
|
|
2071
|
-
delete
|
|
2058
|
+
function R() {
|
|
2059
|
+
const k = { ...u.query };
|
|
2060
|
+
delete k.rubric, a.replace({ query: k });
|
|
2072
2061
|
}
|
|
2073
|
-
async function
|
|
2074
|
-
|
|
2062
|
+
async function M(k) {
|
|
2063
|
+
o.value = !1, await F(), a.replace({ query: { ...u.query, rubric: String(k.id) } });
|
|
2075
2064
|
}
|
|
2076
2065
|
async function A() {
|
|
2077
|
-
|
|
2066
|
+
o.value = !1, R(), c.value = !1, await F();
|
|
2078
2067
|
}
|
|
2079
|
-
function
|
|
2080
|
-
|
|
2068
|
+
function I() {
|
|
2069
|
+
o.value = !1, R(), c.value = !1;
|
|
2081
2070
|
}
|
|
2082
|
-
function
|
|
2083
|
-
|
|
2071
|
+
function K(k) {
|
|
2072
|
+
a.push({ path: `${m.base}/articles`, query: { rubric: String(k.id) } });
|
|
2084
2073
|
}
|
|
2085
|
-
|
|
2074
|
+
const P = v(
|
|
2075
|
+
() => _.value ? [{ key: "new", label: t("rubric.new"), icon: "plus", primary: !0, run: () => {
|
|
2076
|
+
U();
|
|
2077
|
+
} }] : []
|
|
2078
|
+
);
|
|
2079
|
+
async function q() {
|
|
2086
2080
|
try {
|
|
2087
|
-
await
|
|
2088
|
-
} catch (
|
|
2089
|
-
L.danger(
|
|
2081
|
+
await y.sortRubrics(i.value.map((k) => k.id));
|
|
2082
|
+
} catch (k) {
|
|
2083
|
+
L.danger(s(k, t("rubric.reorder-failed"))), await F();
|
|
2090
2084
|
}
|
|
2091
2085
|
}
|
|
2092
|
-
return (
|
|
2093
|
-
title:
|
|
2086
|
+
return (k, le) => (p(), z(e(Qe), {
|
|
2087
|
+
title: W.value,
|
|
2088
|
+
actions: P.value,
|
|
2094
2089
|
card: !1,
|
|
2095
2090
|
fill: ""
|
|
2096
2091
|
}, {
|
|
2097
|
-
|
|
2098
|
-
k.value ? (p(), V(e(F), {
|
|
2099
|
-
key: 0,
|
|
2100
|
-
type: "primary",
|
|
2101
|
-
onClick: R
|
|
2102
|
-
}, {
|
|
2103
|
-
icon: a(() => [
|
|
2104
|
-
n(e(Y), { name: "plus" })
|
|
2105
|
-
]),
|
|
2106
|
-
default: a(() => [
|
|
2107
|
-
g(" " + f(e(t)("rubric.new")), 1)
|
|
2108
|
-
]),
|
|
2109
|
-
_: 1
|
|
2110
|
-
})) : I("", !0)
|
|
2111
|
-
]),
|
|
2112
|
-
default: a(() => [
|
|
2092
|
+
default: l(() => [
|
|
2113
2093
|
n(e(Vt), {
|
|
2114
2094
|
class: "wx-rubrics",
|
|
2115
2095
|
padding: "none"
|
|
2116
2096
|
}, {
|
|
2117
|
-
default:
|
|
2097
|
+
default: l(() => [
|
|
2118
2098
|
n(e(At), {
|
|
2119
|
-
open:
|
|
2120
|
-
"onUpdate:open":
|
|
2099
|
+
open: c.value,
|
|
2100
|
+
"onUpdate:open": le[1] || (le[1] = (O) => c.value = O),
|
|
2121
2101
|
class: "wx-rubrics__panes",
|
|
2122
2102
|
"list-width": 320,
|
|
2123
2103
|
"detail-min": 440,
|
|
2124
|
-
"detail-label":
|
|
2104
|
+
"detail-label": E.value ? E.value.name : e(t)("rubric.new")
|
|
2125
2105
|
}, {
|
|
2126
|
-
list:
|
|
2127
|
-
T.value ? (p(),
|
|
2106
|
+
list: l(() => [
|
|
2107
|
+
T.value ? (p(), z(e(Ue), {
|
|
2128
2108
|
key: 0,
|
|
2129
2109
|
class: "wx-rubrics__loading",
|
|
2130
2110
|
rows: 5
|
|
2131
|
-
})) : i.value.length === 0 ? (p(),
|
|
2111
|
+
})) : i.value.length === 0 ? (p(), z(e(Ge), {
|
|
2132
2112
|
key: 1,
|
|
2133
2113
|
title: e(t)("rubric.empty"),
|
|
2134
2114
|
description: e(t)("rubric.empty-help")
|
|
2135
|
-
}, null, 8, ["title", "description"])) : (p(),
|
|
2115
|
+
}, null, 8, ["title", "description"])) : (p(), z(e(Ye), {
|
|
2136
2116
|
key: 2,
|
|
2137
2117
|
modelValue: i.value,
|
|
2138
|
-
"onUpdate:modelValue":
|
|
2118
|
+
"onUpdate:modelValue": le[0] || (le[0] = (O) => i.value = O),
|
|
2139
2119
|
class: "wx-rubrics__list",
|
|
2140
2120
|
plain: "",
|
|
2141
2121
|
size: "sm",
|
|
2142
2122
|
"item-key": "id",
|
|
2143
|
-
"item-label": (
|
|
2144
|
-
disabled: !
|
|
2123
|
+
"item-label": (O) => O.name,
|
|
2124
|
+
disabled: !_.value,
|
|
2145
2125
|
title: e(t)("rubric.order"),
|
|
2146
|
-
onMove:
|
|
2126
|
+
onMove: q
|
|
2147
2127
|
}, {
|
|
2148
|
-
default:
|
|
2149
|
-
|
|
2128
|
+
default: l(({ item: O }) => [
|
|
2129
|
+
j("button", {
|
|
2150
2130
|
type: "button",
|
|
2151
|
-
class:
|
|
2152
|
-
onClick: (
|
|
2131
|
+
class: Pe(["wx-rubric-row", { "is-current": O.id === S.value, "is-hidden": !O.is_visible }]),
|
|
2132
|
+
onClick: (se) => $(O)
|
|
2153
2133
|
}, [
|
|
2154
|
-
|
|
2155
|
-
n(e(
|
|
2134
|
+
j("span", Sa, [
|
|
2135
|
+
n(e(J), {
|
|
2156
2136
|
truncate: "",
|
|
2157
2137
|
weight: "medium"
|
|
2158
2138
|
}, {
|
|
2159
|
-
default:
|
|
2160
|
-
|
|
2139
|
+
default: l(() => [
|
|
2140
|
+
w(b(O.name), 1)
|
|
2161
2141
|
]),
|
|
2162
2142
|
_: 2
|
|
2163
2143
|
}, 1024),
|
|
2164
|
-
|
|
2144
|
+
O.is_visible ? H("", !0) : (p(), z(e(et), {
|
|
2165
2145
|
key: 0,
|
|
2166
2146
|
content: e(t)("rubric.hidden")
|
|
2167
2147
|
}, {
|
|
2168
|
-
default:
|
|
2169
|
-
n(e(
|
|
2148
|
+
default: l(() => [
|
|
2149
|
+
n(e(we), {
|
|
2170
2150
|
name: "eye-off",
|
|
2171
2151
|
size: "sm"
|
|
2172
2152
|
})
|
|
@@ -2174,26 +2154,26 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
2174
2154
|
_: 1
|
|
2175
2155
|
}, 8, ["content"]))
|
|
2176
2156
|
]),
|
|
2177
|
-
n(e(
|
|
2157
|
+
n(e(J), {
|
|
2178
2158
|
size: "sm",
|
|
2179
2159
|
tone: "muted",
|
|
2180
2160
|
truncate: ""
|
|
2181
2161
|
}, {
|
|
2182
|
-
default:
|
|
2183
|
-
|
|
2162
|
+
default: l(() => [
|
|
2163
|
+
w(b(O.path === null ? e(t)("rubric.no-address") : `/${O.path}`), 1)
|
|
2184
2164
|
]),
|
|
2185
2165
|
_: 2
|
|
2186
2166
|
}, 1024)
|
|
2187
|
-
], 10,
|
|
2167
|
+
], 10, Aa)
|
|
2188
2168
|
]),
|
|
2189
|
-
actions:
|
|
2190
|
-
n(e(
|
|
2169
|
+
actions: l(({ item: O }) => [
|
|
2170
|
+
n(e(J), {
|
|
2191
2171
|
class: "wx-rubric-row__count",
|
|
2192
2172
|
size: "sm",
|
|
2193
2173
|
tone: "muted"
|
|
2194
2174
|
}, {
|
|
2195
|
-
default:
|
|
2196
|
-
|
|
2175
|
+
default: l(() => [
|
|
2176
|
+
w(b(O.articles_count), 1)
|
|
2197
2177
|
]),
|
|
2198
2178
|
_: 2
|
|
2199
2179
|
}, 1024)
|
|
@@ -2201,25 +2181,25 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
2201
2181
|
_: 1
|
|
2202
2182
|
}, 8, ["modelValue", "item-label", "disabled", "title"]))
|
|
2203
2183
|
]),
|
|
2204
|
-
empty:
|
|
2205
|
-
n(e(
|
|
2184
|
+
empty: l(() => [
|
|
2185
|
+
n(e(Ge), {
|
|
2206
2186
|
description: e(t)("rubric.choose")
|
|
2207
2187
|
}, null, 8, ["description"])
|
|
2208
2188
|
]),
|
|
2209
|
-
detail:
|
|
2210
|
-
|
|
2211
|
-
key:
|
|
2212
|
-
rubric:
|
|
2213
|
-
prefix:
|
|
2214
|
-
inline:
|
|
2215
|
-
disabled: !
|
|
2189
|
+
detail: l(({ inline: O, back: se }) => [
|
|
2190
|
+
o.value || E.value ? (p(), z(Va, {
|
|
2191
|
+
key: o.value ? "new" : String(E.value?.id),
|
|
2192
|
+
rubric: o.value ? null : E.value,
|
|
2193
|
+
prefix: x.value,
|
|
2194
|
+
inline: O,
|
|
2195
|
+
disabled: !_.value,
|
|
2216
2196
|
onBack: () => {
|
|
2217
|
-
|
|
2197
|
+
se(), I();
|
|
2218
2198
|
},
|
|
2219
|
-
onArticles:
|
|
2220
|
-
onSaved:
|
|
2199
|
+
onArticles: K,
|
|
2200
|
+
onSaved: M,
|
|
2221
2201
|
onDeleted: A
|
|
2222
|
-
}, null, 8, ["rubric", "prefix", "inline", "disabled", "onBack"])) :
|
|
2202
|
+
}, null, 8, ["rubric", "prefix", "inline", "disabled", "onBack"])) : H("", !0)
|
|
2223
2203
|
]),
|
|
2224
2204
|
_: 1
|
|
2225
2205
|
}, 8, ["open", "detail-label"])
|
|
@@ -2228,60 +2208,60 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
2228
2208
|
})
|
|
2229
2209
|
]),
|
|
2230
2210
|
_: 1
|
|
2231
|
-
}, 8, ["title"]));
|
|
2211
|
+
}, 8, ["title", "actions"]));
|
|
2232
2212
|
}
|
|
2233
|
-
}),
|
|
2213
|
+
}), Ca = /* @__PURE__ */ ee({
|
|
2234
2214
|
__name: "TagCreateDialog",
|
|
2235
|
-
setup(
|
|
2236
|
-
const { open:
|
|
2237
|
-
|
|
2238
|
-
const t =
|
|
2239
|
-
|
|
2240
|
-
await
|
|
2215
|
+
setup(f) {
|
|
2216
|
+
const { open: m, resolve: r, dismiss: y } = Ee(), u = ne(), a = de(u);
|
|
2217
|
+
te();
|
|
2218
|
+
const t = Q("webx-blog"), s = C(""), i = C(""), x = C(!1), T = C({}), c = De("field");
|
|
2219
|
+
Ne(async () => {
|
|
2220
|
+
await Ze(), c.value?.querySelector("input")?.focus();
|
|
2241
2221
|
});
|
|
2242
|
-
async function
|
|
2243
|
-
if (!(
|
|
2244
|
-
|
|
2222
|
+
async function o() {
|
|
2223
|
+
if (!(s.value.trim() === "" || x.value)) {
|
|
2224
|
+
x.value = !0, T.value = {};
|
|
2245
2225
|
try {
|
|
2246
|
-
|
|
2247
|
-
await
|
|
2248
|
-
title:
|
|
2226
|
+
r(
|
|
2227
|
+
await a.createTag({
|
|
2228
|
+
title: s.value.trim(),
|
|
2249
2229
|
...i.value.trim() === "" ? {} : { slug: i.value.trim() }
|
|
2250
2230
|
})
|
|
2251
2231
|
);
|
|
2252
|
-
} catch (
|
|
2253
|
-
T.value =
|
|
2232
|
+
} catch (_) {
|
|
2233
|
+
T.value = _.body?.errors ?? {};
|
|
2254
2234
|
} finally {
|
|
2255
|
-
|
|
2235
|
+
x.value = !1;
|
|
2256
2236
|
}
|
|
2257
2237
|
}
|
|
2258
2238
|
}
|
|
2259
|
-
return (
|
|
2260
|
-
open: e(
|
|
2261
|
-
"onUpdate:open":
|
|
2239
|
+
return (_, W) => (p(), z(e(Fe), {
|
|
2240
|
+
open: e(m),
|
|
2241
|
+
"onUpdate:open": W[3] || (W[3] = (S) => Ie(m) ? m.value = S : null),
|
|
2262
2242
|
title: e(t)("tag.new-title"),
|
|
2263
2243
|
width: 440
|
|
2264
2244
|
}, {
|
|
2265
|
-
footer:
|
|
2266
|
-
n(e(
|
|
2267
|
-
default:
|
|
2268
|
-
n(e(
|
|
2245
|
+
footer: l(() => [
|
|
2246
|
+
n(e(Le), { size: "sm" }, {
|
|
2247
|
+
default: l(() => [
|
|
2248
|
+
n(e(Z), {
|
|
2269
2249
|
variant: "outline",
|
|
2270
|
-
onClick:
|
|
2250
|
+
onClick: W[2] || (W[2] = (S) => e(y)())
|
|
2271
2251
|
}, {
|
|
2272
|
-
default:
|
|
2273
|
-
|
|
2252
|
+
default: l(() => [
|
|
2253
|
+
w(b(e(t)("tag.cancel")), 1)
|
|
2274
2254
|
]),
|
|
2275
2255
|
_: 1
|
|
2276
2256
|
}),
|
|
2277
|
-
n(e(
|
|
2257
|
+
n(e(Z), {
|
|
2278
2258
|
type: "primary",
|
|
2279
|
-
loading:
|
|
2280
|
-
disabled:
|
|
2281
|
-
onClick:
|
|
2259
|
+
loading: x.value,
|
|
2260
|
+
disabled: s.value.trim() === "",
|
|
2261
|
+
onClick: o
|
|
2282
2262
|
}, {
|
|
2283
|
-
default:
|
|
2284
|
-
|
|
2263
|
+
default: l(() => [
|
|
2264
|
+
w(b(e(t)("tag.create")), 1)
|
|
2285
2265
|
]),
|
|
2286
2266
|
_: 1
|
|
2287
2267
|
}, 8, ["loading", "disabled"])
|
|
@@ -2289,38 +2269,38 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
2289
2269
|
_: 1
|
|
2290
2270
|
})
|
|
2291
2271
|
]),
|
|
2292
|
-
default:
|
|
2293
|
-
n(e(
|
|
2272
|
+
default: l(() => [
|
|
2273
|
+
n(e(ie), {
|
|
2294
2274
|
label: e(t)("tag.field-title"),
|
|
2295
2275
|
error: T.value.title?.[0],
|
|
2296
2276
|
required: ""
|
|
2297
2277
|
}, {
|
|
2298
|
-
default:
|
|
2299
|
-
|
|
2278
|
+
default: l(() => [
|
|
2279
|
+
j("div", {
|
|
2300
2280
|
ref_key: "field",
|
|
2301
|
-
ref:
|
|
2281
|
+
ref: c
|
|
2302
2282
|
}, [
|
|
2303
|
-
n(e(
|
|
2304
|
-
modelValue:
|
|
2305
|
-
"onUpdate:modelValue":
|
|
2283
|
+
n(e(Ae), {
|
|
2284
|
+
modelValue: s.value,
|
|
2285
|
+
"onUpdate:modelValue": W[0] || (W[0] = (S) => s.value = S),
|
|
2306
2286
|
"aria-label": e(t)("tag.field-title"),
|
|
2307
|
-
onKeyup:
|
|
2287
|
+
onKeyup: ze(o, ["enter"])
|
|
2308
2288
|
}, null, 8, ["modelValue", "aria-label"])
|
|
2309
2289
|
], 512)
|
|
2310
2290
|
]),
|
|
2311
2291
|
_: 1
|
|
2312
2292
|
}, 8, ["label", "error"]),
|
|
2313
|
-
n(e(
|
|
2293
|
+
n(e(ie), {
|
|
2314
2294
|
label: e(t)("tag.field-slug"),
|
|
2315
2295
|
error: T.value.slug?.[0],
|
|
2316
2296
|
help: e(t)("tag.field-slug-help")
|
|
2317
2297
|
}, {
|
|
2318
|
-
default:
|
|
2319
|
-
n(e(
|
|
2298
|
+
default: l(() => [
|
|
2299
|
+
n(e(Ae), {
|
|
2320
2300
|
modelValue: i.value,
|
|
2321
|
-
"onUpdate:modelValue":
|
|
2301
|
+
"onUpdate:modelValue": W[1] || (W[1] = (S) => i.value = S),
|
|
2322
2302
|
"aria-label": e(t)("tag.field-slug"),
|
|
2323
|
-
onKeyup:
|
|
2303
|
+
onKeyup: ze(o, ["enter"])
|
|
2324
2304
|
}, null, 8, ["modelValue", "aria-label"])
|
|
2325
2305
|
]),
|
|
2326
2306
|
_: 1
|
|
@@ -2329,63 +2309,144 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
2329
2309
|
_: 1
|
|
2330
2310
|
}, 8, ["open", "title"]));
|
|
2331
2311
|
}
|
|
2332
|
-
}),
|
|
2312
|
+
}), za = ["id"], Ra = /* @__PURE__ */ ee({
|
|
2313
|
+
__name: "TagRenameDialog",
|
|
2314
|
+
props: {
|
|
2315
|
+
name: {}
|
|
2316
|
+
},
|
|
2317
|
+
setup(f) {
|
|
2318
|
+
const m = f, { open: r, resolve: y, dismiss: u } = Ee();
|
|
2319
|
+
te();
|
|
2320
|
+
const a = Q("webx-blog"), t = Q("webx-admin"), s = ft(), i = C(m.name), x = De("field");
|
|
2321
|
+
Ne(async () => {
|
|
2322
|
+
await Ze();
|
|
2323
|
+
const c = x.value?.querySelector("input");
|
|
2324
|
+
c?.focus(), c?.select();
|
|
2325
|
+
});
|
|
2326
|
+
function T() {
|
|
2327
|
+
const c = i.value.trim();
|
|
2328
|
+
if (c === "" || c === m.name) {
|
|
2329
|
+
u();
|
|
2330
|
+
return;
|
|
2331
|
+
}
|
|
2332
|
+
y(c);
|
|
2333
|
+
}
|
|
2334
|
+
return (c, o) => (p(), z(e(Fe), {
|
|
2335
|
+
open: e(r),
|
|
2336
|
+
"onUpdate:open": o[2] || (o[2] = (_) => Ie(r) ? r.value = _ : null),
|
|
2337
|
+
title: e(a)("tag.rename"),
|
|
2338
|
+
width: 420
|
|
2339
|
+
}, {
|
|
2340
|
+
footer: l(() => [
|
|
2341
|
+
n(e(Le), { size: "sm" }, {
|
|
2342
|
+
default: l(() => [
|
|
2343
|
+
n(e(Z), {
|
|
2344
|
+
variant: "outline",
|
|
2345
|
+
onClick: o[1] || (o[1] = (_) => e(u)())
|
|
2346
|
+
}, {
|
|
2347
|
+
default: l(() => [
|
|
2348
|
+
w(b(e(a)("tag.cancel")), 1)
|
|
2349
|
+
]),
|
|
2350
|
+
_: 1
|
|
2351
|
+
}),
|
|
2352
|
+
n(e(Z), {
|
|
2353
|
+
type: "primary",
|
|
2354
|
+
"native-type": "submit",
|
|
2355
|
+
form: e(s),
|
|
2356
|
+
disabled: i.value.trim() === ""
|
|
2357
|
+
}, {
|
|
2358
|
+
default: l(() => [
|
|
2359
|
+
w(b(e(t)("editor.save")), 1)
|
|
2360
|
+
]),
|
|
2361
|
+
_: 1
|
|
2362
|
+
}, 8, ["form", "disabled"])
|
|
2363
|
+
]),
|
|
2364
|
+
_: 1
|
|
2365
|
+
})
|
|
2366
|
+
]),
|
|
2367
|
+
default: l(() => [
|
|
2368
|
+
j("form", {
|
|
2369
|
+
id: e(s),
|
|
2370
|
+
ref_key: "field",
|
|
2371
|
+
ref: x,
|
|
2372
|
+
onSubmit: at(T, ["prevent"])
|
|
2373
|
+
}, [
|
|
2374
|
+
n(e(ie), {
|
|
2375
|
+
label: e(a)("tag.field-title"),
|
|
2376
|
+
required: ""
|
|
2377
|
+
}, {
|
|
2378
|
+
default: l(() => [
|
|
2379
|
+
n(e(Ae), {
|
|
2380
|
+
modelValue: i.value,
|
|
2381
|
+
"onUpdate:modelValue": o[0] || (o[0] = (_) => i.value = _),
|
|
2382
|
+
"aria-label": e(a)("tag.field-title"),
|
|
2383
|
+
onKeydown: ze(at(T, ["prevent"]), ["enter"])
|
|
2384
|
+
}, null, 8, ["modelValue", "aria-label", "onKeydown"])
|
|
2385
|
+
]),
|
|
2386
|
+
_: 1
|
|
2387
|
+
}, 8, ["label"])
|
|
2388
|
+
], 40, za)
|
|
2389
|
+
]),
|
|
2390
|
+
_: 1
|
|
2391
|
+
}, 8, ["open", "title"]));
|
|
2392
|
+
}
|
|
2393
|
+
}), Ua = { class: "wx-tag-merge" }, qa = { class: "wx-tag-merge__chips" }, Ma = { class: "wx-tag-merge__redirect" }, Na = /* @__PURE__ */ ee({
|
|
2333
2394
|
__name: "TagMergeDialog",
|
|
2334
2395
|
props: {
|
|
2335
2396
|
tags: {}
|
|
2336
2397
|
},
|
|
2337
|
-
setup(
|
|
2338
|
-
const
|
|
2339
|
-
|
|
2340
|
-
const
|
|
2341
|
-
[...
|
|
2342
|
-
), T =
|
|
2343
|
-
() =>
|
|
2344
|
-
),
|
|
2345
|
-
async function
|
|
2346
|
-
if (!(
|
|
2347
|
-
T.value = !0,
|
|
2398
|
+
setup(f) {
|
|
2399
|
+
const m = f, { open: r, resolve: y, dismiss: u } = Ee(), a = ne(), t = de(a);
|
|
2400
|
+
te();
|
|
2401
|
+
const s = Q("webx-blog"), i = ge(), x = C(
|
|
2402
|
+
[...m.tags].sort((U, R) => R.articles_count - U.articles_count)[0]?.id ?? 0
|
|
2403
|
+
), T = C(!1), c = C(!0), o = C(null), _ = v(
|
|
2404
|
+
() => m.tags.map((U) => ({ value: U.id, label: `${U.title} · ${U.articles_count}` }))
|
|
2405
|
+
), W = v(() => m.tags.find((U) => U.id === x.value) ?? null), S = v(() => m.tags.filter((U) => U.id !== x.value)), E = v(() => S.value.reduce((U, R) => U + R.articles_count, 0)), F = v(() => S.value.map((U) => U.path).filter(Boolean));
|
|
2406
|
+
async function $() {
|
|
2407
|
+
if (!(W.value === null || S.value.length === 0 || T.value)) {
|
|
2408
|
+
T.value = !0, o.value = null;
|
|
2348
2409
|
try {
|
|
2349
|
-
|
|
2410
|
+
y(
|
|
2350
2411
|
await t.mergeTags(
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2412
|
+
S.value.map((U) => U.id),
|
|
2413
|
+
x.value,
|
|
2414
|
+
c.value
|
|
2354
2415
|
)
|
|
2355
2416
|
);
|
|
2356
|
-
} catch (
|
|
2357
|
-
|
|
2417
|
+
} catch (U) {
|
|
2418
|
+
o.value = i(U);
|
|
2358
2419
|
} finally {
|
|
2359
2420
|
T.value = !1;
|
|
2360
2421
|
}
|
|
2361
2422
|
}
|
|
2362
2423
|
}
|
|
2363
|
-
return (
|
|
2364
|
-
open: e(
|
|
2365
|
-
"onUpdate:open":
|
|
2366
|
-
title: e(
|
|
2424
|
+
return (U, R) => (p(), z(e(Fe), {
|
|
2425
|
+
open: e(r),
|
|
2426
|
+
"onUpdate:open": R[3] || (R[3] = (M) => Ie(r) ? r.value = M : null),
|
|
2427
|
+
title: e(s)("tag.merge-title"),
|
|
2367
2428
|
width: 520
|
|
2368
2429
|
}, {
|
|
2369
|
-
footer:
|
|
2370
|
-
n(e(
|
|
2371
|
-
default:
|
|
2372
|
-
n(e(
|
|
2430
|
+
footer: l(() => [
|
|
2431
|
+
n(e(Le), { size: "sm" }, {
|
|
2432
|
+
default: l(() => [
|
|
2433
|
+
n(e(Z), {
|
|
2373
2434
|
variant: "outline",
|
|
2374
|
-
onClick:
|
|
2435
|
+
onClick: R[2] || (R[2] = (M) => e(u)())
|
|
2375
2436
|
}, {
|
|
2376
|
-
default:
|
|
2377
|
-
|
|
2437
|
+
default: l(() => [
|
|
2438
|
+
w(b(e(s)("tag.cancel")), 1)
|
|
2378
2439
|
]),
|
|
2379
2440
|
_: 1
|
|
2380
2441
|
}),
|
|
2381
|
-
n(e(
|
|
2442
|
+
n(e(Z), {
|
|
2382
2443
|
type: "primary",
|
|
2383
2444
|
loading: T.value,
|
|
2384
|
-
disabled:
|
|
2385
|
-
onClick:
|
|
2445
|
+
disabled: S.value.length === 0,
|
|
2446
|
+
onClick: $
|
|
2386
2447
|
}, {
|
|
2387
|
-
default:
|
|
2388
|
-
|
|
2448
|
+
default: l(() => [
|
|
2449
|
+
w(b(e(s)("tag.merge-confirm")), 1)
|
|
2389
2450
|
]),
|
|
2390
2451
|
_: 1
|
|
2391
2452
|
}, 8, ["loading", "disabled"])
|
|
@@ -2393,532 +2454,475 @@ const Mt = { class: "wx-article-editor__head" }, Pt = { class: "wx-article-edito
|
|
|
2393
2454
|
_: 1
|
|
2394
2455
|
})
|
|
2395
2456
|
]),
|
|
2396
|
-
default:
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
(p(!0),
|
|
2400
|
-
key:
|
|
2457
|
+
default: l(() => [
|
|
2458
|
+
j("div", Ua, [
|
|
2459
|
+
j("div", qa, [
|
|
2460
|
+
(p(!0), G(ve, null, Be(S.value, (M) => (p(), z(e(oe), {
|
|
2461
|
+
key: M.id,
|
|
2401
2462
|
size: "sm",
|
|
2402
2463
|
round: ""
|
|
2403
2464
|
}, {
|
|
2404
|
-
default:
|
|
2405
|
-
|
|
2465
|
+
default: l(() => [
|
|
2466
|
+
w(b(M.title) + " · " + b(M.articles_count), 1)
|
|
2406
2467
|
]),
|
|
2407
2468
|
_: 2
|
|
2408
2469
|
}, 1024))), 128)),
|
|
2409
|
-
n(e(
|
|
2470
|
+
n(e(we), {
|
|
2410
2471
|
name: "arrow-right",
|
|
2411
2472
|
size: "sm"
|
|
2412
2473
|
}),
|
|
2413
|
-
|
|
2474
|
+
W.value ? (p(), z(e(oe), {
|
|
2414
2475
|
key: 0,
|
|
2415
2476
|
type: "primary",
|
|
2416
2477
|
size: "sm",
|
|
2417
2478
|
round: ""
|
|
2418
2479
|
}, {
|
|
2419
|
-
default:
|
|
2420
|
-
|
|
2480
|
+
default: l(() => [
|
|
2481
|
+
w(b(W.value.title) + " · " + b(W.value.articles_count), 1)
|
|
2421
2482
|
]),
|
|
2422
2483
|
_: 1
|
|
2423
|
-
})) :
|
|
2484
|
+
})) : H("", !0)
|
|
2424
2485
|
]),
|
|
2425
|
-
n(e(
|
|
2426
|
-
label: e(
|
|
2486
|
+
n(e(ie), {
|
|
2487
|
+
label: e(s)("tag.merge-keep")
|
|
2427
2488
|
}, {
|
|
2428
|
-
default:
|
|
2429
|
-
n(e(
|
|
2430
|
-
modelValue:
|
|
2431
|
-
"onUpdate:modelValue":
|
|
2432
|
-
options:
|
|
2433
|
-
"aria-label": e(
|
|
2489
|
+
default: l(() => [
|
|
2490
|
+
n(e(_e), {
|
|
2491
|
+
modelValue: x.value,
|
|
2492
|
+
"onUpdate:modelValue": R[0] || (R[0] = (M) => x.value = M),
|
|
2493
|
+
options: _.value,
|
|
2494
|
+
"aria-label": e(s)("tag.merge-keep")
|
|
2434
2495
|
}, null, 8, ["modelValue", "options", "aria-label"])
|
|
2435
2496
|
]),
|
|
2436
2497
|
_: 1
|
|
2437
2498
|
}, 8, ["label"]),
|
|
2438
|
-
|
|
2439
|
-
n(e(
|
|
2440
|
-
modelValue:
|
|
2441
|
-
"onUpdate:modelValue":
|
|
2442
|
-
label: e(
|
|
2499
|
+
j("div", Ma, [
|
|
2500
|
+
n(e(St), {
|
|
2501
|
+
modelValue: c.value,
|
|
2502
|
+
"onUpdate:modelValue": R[1] || (R[1] = (M) => c.value = M),
|
|
2503
|
+
label: e(s)("tag.merge-redirect")
|
|
2443
2504
|
}, null, 8, ["modelValue", "label"]),
|
|
2444
|
-
n(e(
|
|
2505
|
+
n(e(J), {
|
|
2445
2506
|
size: "sm",
|
|
2446
2507
|
tone: "muted"
|
|
2447
2508
|
}, {
|
|
2448
|
-
default:
|
|
2449
|
-
|
|
2509
|
+
default: l(() => [
|
|
2510
|
+
w(b(F.value.length === 0 ? e(s)("tag.merge-redirect-none") : e(s)("tag.merge-redirect-help", { addresses: F.value.join(", ") })), 1)
|
|
2450
2511
|
]),
|
|
2451
2512
|
_: 1
|
|
2452
2513
|
})
|
|
2453
2514
|
]),
|
|
2454
|
-
n(e(
|
|
2515
|
+
n(e(We), {
|
|
2455
2516
|
type: "warning",
|
|
2456
2517
|
variant: "soft",
|
|
2457
|
-
description: e(
|
|
2458
|
-
count:
|
|
2459
|
-
tag:
|
|
2460
|
-
merged:
|
|
2518
|
+
description: e(s)("tag.merge-warning", {
|
|
2519
|
+
count: E.value,
|
|
2520
|
+
tag: W.value?.title ?? "",
|
|
2521
|
+
merged: S.value.length
|
|
2461
2522
|
})
|
|
2462
2523
|
}, null, 8, ["description"]),
|
|
2463
|
-
|
|
2524
|
+
o.value ? (p(), z(e(We), {
|
|
2464
2525
|
key: 0,
|
|
2465
2526
|
type: "danger",
|
|
2466
2527
|
variant: "soft",
|
|
2467
|
-
description:
|
|
2468
|
-
}, null, 8, ["description"])) :
|
|
2528
|
+
description: o.value
|
|
2529
|
+
}, null, 8, ["description"])) : H("", !0)
|
|
2469
2530
|
])
|
|
2470
2531
|
]),
|
|
2471
2532
|
_: 1
|
|
2472
2533
|
}, 8, ["open", "title"]));
|
|
2473
2534
|
}
|
|
2474
|
-
}),
|
|
2535
|
+
}), Ba = /* @__PURE__ */ pe(Na, [["__scopeId", "data-v-aa68b3a8"]]), Pa = { class: "wx-tags" }, Da = /* @__PURE__ */ ee({
|
|
2475
2536
|
__name: "TagsPage",
|
|
2476
2537
|
props: {
|
|
2477
2538
|
base: { default: "/blog" }
|
|
2478
2539
|
},
|
|
2479
|
-
setup(
|
|
2480
|
-
const
|
|
2481
|
-
|
|
2482
|
-
const t =
|
|
2483
|
-
() =>
|
|
2484
|
-
),
|
|
2485
|
-
get: () => typeof
|
|
2486
|
-
set: (
|
|
2487
|
-
|
|
2488
|
-
query: { ...
|
|
2540
|
+
setup(f) {
|
|
2541
|
+
const m = f, r = ne(), y = de(r), u = He(), a = Ke();
|
|
2542
|
+
te();
|
|
2543
|
+
const t = Q("webx-blog"), s = ge(), i = C(null), x = C(!0), T = C([]), c = C(!1), o = Ce(Ra), _ = Ce(Ca), W = Ce(Ba), S = v(() => r.can("blog.taxonomy.manage")), E = v(
|
|
2544
|
+
() => r.state.manifest?.modules.find((g) => g.id === "tags")?.title ?? t("module.tags")
|
|
2545
|
+
), F = v({
|
|
2546
|
+
get: () => typeof u.query.view == "string" ? u.query.view : "",
|
|
2547
|
+
set: (g) => {
|
|
2548
|
+
a.replace({
|
|
2549
|
+
query: { ...u.query, view: g === "" ? void 0 : String(g), page: void 0 }
|
|
2489
2550
|
});
|
|
2490
2551
|
}
|
|
2491
|
-
}),
|
|
2492
|
-
{ value: "", label: t("tag.view-all"), badge:
|
|
2493
|
-
{ value: "empty", label: t("tag.view-empty"), badge:
|
|
2494
|
-
{ value: "noindex", label: t("tag.view-noindex"), badge:
|
|
2495
|
-
]),
|
|
2496
|
-
{ key: "title", label: t("tag.column-title"), minWidth: 150 },
|
|
2552
|
+
}), $ = v(() => i.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), U = v(() => [
|
|
2553
|
+
{ value: "", label: t("tag.view-all"), badge: $.value.total },
|
|
2554
|
+
{ value: "empty", label: t("tag.view-empty"), badge: $.value.empty },
|
|
2555
|
+
{ value: "noindex", label: t("tag.view-noindex"), badge: $.value.noindex }
|
|
2556
|
+
]), R = v(() => i.value?.data ?? []), M = v(() => R.value.filter((g) => T.value.includes(g.id))), A = v(() => [
|
|
2557
|
+
{ key: "title", label: t("tag.column-title"), minWidth: 150, sortable: !0 },
|
|
2497
2558
|
// The number is what the other columns and the narrowest the title may be add up to without
|
|
2498
2559
|
// this one: below it the address is what does not fit, and a fixed table does not shrink —
|
|
2499
2560
|
// it scrolls sideways and takes the ··· with it (CLAUDE.md §4). Measured, not guessed: at
|
|
2500
2561
|
// 375px the row is the word, the number and the menu, and nothing hangs off the edge.
|
|
2501
2562
|
{ key: "path", label: t("tag.column-address"), width: 180, hideBelow: 760 },
|
|
2502
|
-
{
|
|
2563
|
+
{
|
|
2564
|
+
key: "articles_count",
|
|
2565
|
+
label: t("tag.column-articles"),
|
|
2566
|
+
width: 80,
|
|
2567
|
+
align: "right",
|
|
2568
|
+
sortable: !0
|
|
2569
|
+
},
|
|
2503
2570
|
// Wide enough for the longest of the three states on one line, in every language: measured
|
|
2504
2571
|
// at 180px of text, and a cell keeps 32 of its own. Narrower, the ruled row wrapped and
|
|
2505
2572
|
// stood eighteen pixels taller than the ones around it.
|
|
2506
2573
|
{ key: "indexing", label: t("tag.column-indexing"), width: 230, hideBelow: 560 },
|
|
2507
|
-
{ key: "actions", label: "", width:
|
|
2574
|
+
{ key: "actions", label: "", width: st, align: "right" }
|
|
2508
2575
|
]);
|
|
2509
|
-
function
|
|
2576
|
+
function I(g) {
|
|
2510
2577
|
return {
|
|
2511
|
-
q:
|
|
2512
|
-
empty:
|
|
2513
|
-
noindex:
|
|
2578
|
+
q: g?.search ?? (typeof u.query.q == "string" ? u.query.q : ""),
|
|
2579
|
+
empty: F.value === "empty",
|
|
2580
|
+
noindex: F.value === "noindex",
|
|
2514
2581
|
// Only when it is not the default: most used first is what the list is, and a query
|
|
2515
2582
|
// string that repeats the default is a link that outlives a change of mind about it.
|
|
2516
|
-
sort:
|
|
2517
|
-
page:
|
|
2518
|
-
per_page:
|
|
2583
|
+
sort: P(g),
|
|
2584
|
+
page: g?.page ?? (Number(u.query.page ?? 1) || 1),
|
|
2585
|
+
per_page: g?.perPage
|
|
2519
2586
|
};
|
|
2520
2587
|
}
|
|
2521
|
-
async function
|
|
2522
|
-
|
|
2588
|
+
async function K(g) {
|
|
2589
|
+
x.value = !0;
|
|
2523
2590
|
try {
|
|
2524
|
-
i.value = await
|
|
2525
|
-
} catch (
|
|
2526
|
-
L.danger(
|
|
2591
|
+
i.value = await y.tagsPage(I(g));
|
|
2592
|
+
} catch (N) {
|
|
2593
|
+
L.danger(s(N));
|
|
2527
2594
|
} finally {
|
|
2528
|
-
|
|
2595
|
+
x.value = !1;
|
|
2529
2596
|
}
|
|
2530
2597
|
}
|
|
2531
|
-
function
|
|
2532
|
-
const
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2598
|
+
function P(g) {
|
|
2599
|
+
const N = g?.sort ?? q();
|
|
2600
|
+
if (!N) return;
|
|
2601
|
+
const B = N.key === "title" ? "name" : "articles", X = `${N.order === "desc" ? "-" : ""}${B}`;
|
|
2602
|
+
return X === "articles" ? void 0 : X;
|
|
2603
|
+
}
|
|
2604
|
+
function q() {
|
|
2605
|
+
const g = typeof u.query.sort == "string" ? u.query.sort : "";
|
|
2606
|
+
if (g === "") return null;
|
|
2607
|
+
const N = g.startsWith("-");
|
|
2608
|
+
return { key: (N ? g.slice(1) : g) === "name" ? "title" : "articles_count", order: N ? "desc" : "asc" };
|
|
2609
|
+
}
|
|
2610
|
+
function k(g) {
|
|
2611
|
+
const N = {
|
|
2612
|
+
...u.query,
|
|
2613
|
+
q: g.search === "" ? void 0 : g.search,
|
|
2614
|
+
sort: P(g),
|
|
2615
|
+
page: g.page === 1 ? void 0 : String(g.page)
|
|
2536
2616
|
};
|
|
2537
|
-
|
|
2538
|
-
}
|
|
2539
|
-
oe(R, () => {
|
|
2540
|
-
T.value = [], m();
|
|
2541
|
-
}), m();
|
|
2542
|
-
function j(o) {
|
|
2543
|
-
l.replace({
|
|
2544
|
-
query: { ...c.query, sort: o === "articles" ? void 0 : o, page: void 0 }
|
|
2545
|
-
}), m();
|
|
2546
|
-
}
|
|
2547
|
-
const de = b(() => c.query.sort === "name" ? "name" : "articles");
|
|
2548
|
-
async function Ve() {
|
|
2549
|
-
await C({}) && await m();
|
|
2550
|
-
}
|
|
2551
|
-
async function ve(o) {
|
|
2552
|
-
d.value = o.id, k.value = o.title, await Ke(), S.value?.querySelector("input")?.focus();
|
|
2553
|
-
}
|
|
2554
|
-
function J() {
|
|
2555
|
-
d.value = null, k.value = "";
|
|
2556
|
-
}
|
|
2557
|
-
async function we(o) {
|
|
2558
|
-
const s = k.value.trim();
|
|
2559
|
-
if (s === "" || s === o.title) {
|
|
2560
|
-
J();
|
|
2561
|
-
return;
|
|
2562
|
-
}
|
|
2563
|
-
J(), await Q(o, { title: s }, t("tag.renamed"));
|
|
2617
|
+
a.replace({ query: N }), K(g);
|
|
2564
2618
|
}
|
|
2565
|
-
|
|
2566
|
-
|
|
2619
|
+
ue(F, () => {
|
|
2620
|
+
T.value = [], K();
|
|
2621
|
+
}), K();
|
|
2622
|
+
async function le() {
|
|
2623
|
+
await _({}) && await K();
|
|
2567
2624
|
}
|
|
2568
|
-
async function
|
|
2625
|
+
async function O(g) {
|
|
2626
|
+
const N = await o({ name: g.title });
|
|
2627
|
+
N && await xe(g, { title: N }, t("tag.renamed"));
|
|
2628
|
+
}
|
|
2629
|
+
async function se(g, N) {
|
|
2630
|
+
await xe(g, { noindex: N }, t(N ? "tag.kept-out" : "tag.indexed"));
|
|
2631
|
+
}
|
|
2632
|
+
async function xe(g, N, B) {
|
|
2569
2633
|
try {
|
|
2570
|
-
const
|
|
2634
|
+
const X = await y.saveTag(g.id, N);
|
|
2571
2635
|
i.value && (i.value = {
|
|
2572
2636
|
...i.value,
|
|
2573
|
-
data: i.value.data.map((
|
|
2574
|
-
}), L.success(
|
|
2575
|
-
} catch (
|
|
2576
|
-
L.danger(
|
|
2637
|
+
data: i.value.data.map((ye) => ye.id === X.id ? X : ye)
|
|
2638
|
+
}), L.success(B);
|
|
2639
|
+
} catch (X) {
|
|
2640
|
+
L.danger(s(X));
|
|
2577
2641
|
}
|
|
2578
2642
|
}
|
|
2579
|
-
async function
|
|
2580
|
-
if (await
|
|
2581
|
-
title: t("tag.delete-title", { title:
|
|
2582
|
-
message:
|
|
2643
|
+
async function ce(g) {
|
|
2644
|
+
if (await be({
|
|
2645
|
+
title: t("tag.delete-title", { title: g.title }),
|
|
2646
|
+
message: g.articles_count > 0 ? t("tag.delete-text-used", { count: g.articles_count }) : t("tag.delete-text"),
|
|
2583
2647
|
confirmText: t("tag.delete"),
|
|
2584
2648
|
cancelText: t("tag.cancel"),
|
|
2585
2649
|
tone: "danger"
|
|
2586
2650
|
}))
|
|
2587
2651
|
try {
|
|
2588
|
-
await
|
|
2589
|
-
} catch (
|
|
2590
|
-
L.danger(
|
|
2652
|
+
await y.removeTag(g.id), L.success(t("tag.deleted")), T.value = T.value.filter((B) => B !== g.id), await K();
|
|
2653
|
+
} catch (B) {
|
|
2654
|
+
L.danger(s(B));
|
|
2591
2655
|
}
|
|
2592
2656
|
}
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2657
|
+
const he = v(() => [
|
|
2658
|
+
{
|
|
2659
|
+
key: "index",
|
|
2660
|
+
icon: "eye",
|
|
2661
|
+
label: t("tag.index"),
|
|
2662
|
+
disabled: c.value,
|
|
2663
|
+
run: () => {
|
|
2664
|
+
re("index");
|
|
2665
|
+
}
|
|
2666
|
+
},
|
|
2667
|
+
{
|
|
2668
|
+
key: "noindex",
|
|
2669
|
+
icon: "eye-off",
|
|
2670
|
+
label: t("tag.noindex"),
|
|
2671
|
+
disabled: c.value,
|
|
2672
|
+
run: () => {
|
|
2673
|
+
re("noindex");
|
|
2674
|
+
}
|
|
2675
|
+
},
|
|
2676
|
+
{
|
|
2677
|
+
key: "delete",
|
|
2678
|
+
icon: "trash",
|
|
2679
|
+
label: t("tag.delete"),
|
|
2680
|
+
danger: !0,
|
|
2681
|
+
disabled: c.value,
|
|
2682
|
+
run: () => {
|
|
2683
|
+
re("delete");
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
]);
|
|
2687
|
+
function Te(g) {
|
|
2688
|
+
if (!S.value) return [];
|
|
2689
|
+
const N = [
|
|
2596
2690
|
{ key: "rename", icon: "edit", label: t("tag.rename"), run: () => {
|
|
2597
|
-
|
|
2691
|
+
O(g);
|
|
2598
2692
|
} }
|
|
2599
2693
|
];
|
|
2600
|
-
return
|
|
2694
|
+
return g.url && N.push({
|
|
2601
2695
|
key: "site",
|
|
2602
2696
|
icon: "external-link",
|
|
2603
2697
|
label: t("tag.open-on-site"),
|
|
2604
|
-
href:
|
|
2605
|
-
}),
|
|
2698
|
+
href: g.url
|
|
2699
|
+
}), N.push({
|
|
2606
2700
|
key: "articles",
|
|
2607
2701
|
icon: "list",
|
|
2608
2702
|
label: t("tag.show-articles"),
|
|
2609
2703
|
run: () => {
|
|
2610
|
-
|
|
2704
|
+
a.push({ path: `${m.base}/articles`, query: { tag: String(g.id) } });
|
|
2611
2705
|
}
|
|
2612
|
-
}),
|
|
2613
|
-
|
|
2706
|
+
}), N.push(
|
|
2707
|
+
g.noindex ? {
|
|
2614
2708
|
key: "index",
|
|
2615
2709
|
icon: "eye",
|
|
2616
2710
|
label: t("tag.index"),
|
|
2617
2711
|
run: () => {
|
|
2618
|
-
|
|
2712
|
+
se(g, !1);
|
|
2619
2713
|
}
|
|
2620
2714
|
} : {
|
|
2621
2715
|
key: "noindex",
|
|
2622
2716
|
icon: "eye-off",
|
|
2623
2717
|
label: t("tag.noindex"),
|
|
2624
2718
|
run: () => {
|
|
2625
|
-
|
|
2719
|
+
se(g, !0);
|
|
2626
2720
|
}
|
|
2627
2721
|
}
|
|
2628
|
-
),
|
|
2722
|
+
), N.push({
|
|
2629
2723
|
key: "delete",
|
|
2630
2724
|
icon: "trash",
|
|
2631
2725
|
label: t("tag.delete"),
|
|
2632
2726
|
danger: !0,
|
|
2633
2727
|
run: () => {
|
|
2634
|
-
|
|
2728
|
+
ce(g);
|
|
2635
2729
|
}
|
|
2636
|
-
}),
|
|
2637
|
-
}
|
|
2638
|
-
function
|
|
2639
|
-
return
|
|
2640
|
-
}
|
|
2641
|
-
async function
|
|
2642
|
-
if (
|
|
2643
|
-
const
|
|
2644
|
-
|
|
2645
|
-
}
|
|
2646
|
-
async function
|
|
2647
|
-
const
|
|
2648
|
-
if (!(
|
|
2649
|
-
if (
|
|
2650
|
-
const
|
|
2651
|
-
if (!await
|
|
2652
|
-
title: t("tag.delete-many-title", { count:
|
|
2653
|
-
message:
|
|
2730
|
+
}), N;
|
|
2731
|
+
}
|
|
2732
|
+
function ke(g) {
|
|
2733
|
+
return g === "noindex" ? "muted" : "success";
|
|
2734
|
+
}
|
|
2735
|
+
async function fe() {
|
|
2736
|
+
if (M.value.length < 2) return;
|
|
2737
|
+
const g = await W({ tags: M.value });
|
|
2738
|
+
g && (L.success(t("tag.merged", { tag: g.tag.title, count: g.articles_count })), T.value = [], await K());
|
|
2739
|
+
}
|
|
2740
|
+
async function re(g) {
|
|
2741
|
+
const N = M.value.map((B) => B.id);
|
|
2742
|
+
if (!(N.length === 0 || c.value)) {
|
|
2743
|
+
if (g === "delete") {
|
|
2744
|
+
const B = M.value.reduce((ye, d) => ye + d.articles_count, 0);
|
|
2745
|
+
if (!await be({
|
|
2746
|
+
title: t("tag.delete-many-title", { count: N.length }),
|
|
2747
|
+
message: B > 0 ? t("tag.delete-many-text-used", { count: B }) : t("tag.delete-many-text"),
|
|
2654
2748
|
confirmText: t("tag.delete"),
|
|
2655
2749
|
cancelText: t("tag.cancel"),
|
|
2656
2750
|
tone: "danger"
|
|
2657
2751
|
})) return;
|
|
2658
2752
|
}
|
|
2659
|
-
|
|
2753
|
+
c.value = !0;
|
|
2660
2754
|
try {
|
|
2661
|
-
const
|
|
2755
|
+
const B = await y.massTags(N, g);
|
|
2662
2756
|
L.success(
|
|
2663
|
-
|
|
2664
|
-
), T.value = [], await
|
|
2665
|
-
} catch (
|
|
2666
|
-
L.danger(
|
|
2757
|
+
g === "delete" ? t("tag.deleted-many", { count: B }) : g === "index" ? t("tag.indexed-many", { count: B }) : t("tag.kept-out-many", { count: B })
|
|
2758
|
+
), T.value = [], await K();
|
|
2759
|
+
} catch (B) {
|
|
2760
|
+
L.danger(s(B));
|
|
2667
2761
|
} finally {
|
|
2668
|
-
|
|
2762
|
+
c.value = !1;
|
|
2669
2763
|
}
|
|
2670
2764
|
}
|
|
2671
2765
|
}
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2766
|
+
const me = v(
|
|
2767
|
+
() => S.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
|
|
2768
|
+
le();
|
|
2769
|
+
} }] : []
|
|
2770
|
+
);
|
|
2771
|
+
return (g, N) => (p(), G("div", Pa, [
|
|
2772
|
+
n(e(Qe), {
|
|
2773
|
+
view: F.value,
|
|
2774
|
+
"onUpdate:view": N[1] || (N[1] = (B) => F.value = B),
|
|
2775
|
+
title: E.value,
|
|
2776
|
+
views: U.value,
|
|
2777
|
+
actions: me.value
|
|
2778
|
+
}, {
|
|
2779
|
+
default: l(() => [
|
|
2780
|
+
n(e(ot), {
|
|
2681
2781
|
selected: T.value,
|
|
2682
|
-
"onUpdate:selected":
|
|
2782
|
+
"onUpdate:selected": N[0] || (N[0] = (B) => T.value = B),
|
|
2683
2783
|
data: i.value,
|
|
2684
|
-
columns:
|
|
2784
|
+
columns: A.value,
|
|
2685
2785
|
"row-key": "id",
|
|
2686
2786
|
searchable: "",
|
|
2687
2787
|
hover: "",
|
|
2688
2788
|
flush: "",
|
|
2689
2789
|
layout: "fixed",
|
|
2690
|
-
loading:
|
|
2691
|
-
selectable:
|
|
2790
|
+
loading: x.value,
|
|
2791
|
+
selectable: S.value,
|
|
2692
2792
|
"cards-below": 0,
|
|
2693
2793
|
"search-placeholder": e(t)("tag.search"),
|
|
2694
|
-
"empty-text":
|
|
2695
|
-
"aria-label":
|
|
2696
|
-
onStateChange:
|
|
2794
|
+
"empty-text": R.value.length === 0 && !x.value ? e(t)("tag.empty") : void 0,
|
|
2795
|
+
"aria-label": E.value,
|
|
2796
|
+
onStateChange: k
|
|
2697
2797
|
}, {
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
}, {
|
|
2706
|
-
default: a(() => [
|
|
2707
|
-
g(f(e(t)(`tag.sort-${w}`)), 1)
|
|
2708
|
-
]),
|
|
2709
|
-
_: 2
|
|
2710
|
-
}, 1032, ["variant", "onClick"])), 64))
|
|
2711
|
-
])
|
|
2712
|
-
]),
|
|
2713
|
-
"cell-title": a(({ row: w }) => [
|
|
2714
|
-
d.value === w.id ? (p(), K("span", {
|
|
2715
|
-
key: 0,
|
|
2716
|
-
ref_key: "box",
|
|
2717
|
-
ref: S,
|
|
2718
|
-
class: "wx-tags__rename"
|
|
2719
|
-
}, [
|
|
2720
|
-
n(e($e), {
|
|
2721
|
-
modelValue: k.value,
|
|
2722
|
-
"onUpdate:modelValue": s[0] || (s[0] = (le) => k.value = le),
|
|
2723
|
-
size: "sm",
|
|
2724
|
-
"aria-label": e(t)("tag.rename"),
|
|
2725
|
-
onKeyup: [
|
|
2726
|
-
Ce((le) => we(w), ["enter"]),
|
|
2727
|
-
Ce(J, ["esc"])
|
|
2728
|
-
],
|
|
2729
|
-
onBlur: (le) => we(w)
|
|
2730
|
-
}, null, 8, ["modelValue", "aria-label", "onKeyup", "onBlur"])
|
|
2731
|
-
], 512)) : P.value ? (p(), K("button", {
|
|
2732
|
-
key: 1,
|
|
2733
|
-
type: "button",
|
|
2734
|
-
class: "wx-tags__name",
|
|
2735
|
-
title: e(t)("tag.rename"),
|
|
2736
|
-
onClick: (le) => ve(w)
|
|
2737
|
-
}, f(w.title), 9, Za)) : (p(), K("span", Qa, f(w.title), 1))
|
|
2798
|
+
"cell-title": l(({ row: B }) => [
|
|
2799
|
+
n(e(J), { truncate: "" }, {
|
|
2800
|
+
default: l(() => [
|
|
2801
|
+
w(b(B.title), 1)
|
|
2802
|
+
]),
|
|
2803
|
+
_: 2
|
|
2804
|
+
}, 1024)
|
|
2738
2805
|
]),
|
|
2739
|
-
"cell-path":
|
|
2740
|
-
n(e(
|
|
2806
|
+
"cell-path": l(({ row: B }) => [
|
|
2807
|
+
n(e(J), {
|
|
2741
2808
|
size: "sm",
|
|
2742
2809
|
tone: "muted",
|
|
2743
2810
|
mono: "",
|
|
2744
2811
|
truncate: ""
|
|
2745
2812
|
}, {
|
|
2746
|
-
default:
|
|
2747
|
-
|
|
2813
|
+
default: l(() => [
|
|
2814
|
+
w(b(B.path ?? e(t)("tag.no-address")), 1)
|
|
2748
2815
|
]),
|
|
2749
2816
|
_: 2
|
|
2750
2817
|
}, 1024)
|
|
2751
2818
|
]),
|
|
2752
|
-
"cell-articles_count":
|
|
2753
|
-
n(e(
|
|
2754
|
-
tone:
|
|
2819
|
+
"cell-articles_count": l(({ row: B }) => [
|
|
2820
|
+
n(e(J), {
|
|
2821
|
+
tone: B.articles_count === 0 ? "muted" : "default"
|
|
2755
2822
|
}, {
|
|
2756
|
-
default:
|
|
2757
|
-
|
|
2823
|
+
default: l(() => [
|
|
2824
|
+
w(b(B.articles_count), 1)
|
|
2758
2825
|
]),
|
|
2759
2826
|
_: 2
|
|
2760
2827
|
}, 1032, ["tone"])
|
|
2761
2828
|
]),
|
|
2762
|
-
"cell-indexing":
|
|
2763
|
-
|
|
2829
|
+
"cell-indexing": l(({ row: B }) => [
|
|
2830
|
+
B.indexing === "rule" ? (p(), z(e(et), {
|
|
2764
2831
|
key: 0,
|
|
2765
2832
|
content: e(t)("tag.indexing-rule-help")
|
|
2766
2833
|
}, {
|
|
2767
|
-
default:
|
|
2768
|
-
n(e(
|
|
2834
|
+
default: l(() => [
|
|
2835
|
+
n(e(J), {
|
|
2769
2836
|
size: "sm",
|
|
2770
|
-
tone:
|
|
2837
|
+
tone: ke(B.indexing)
|
|
2771
2838
|
}, {
|
|
2772
|
-
default:
|
|
2773
|
-
|
|
2839
|
+
default: l(() => [
|
|
2840
|
+
w(b(e(t)("tag.indexing-rule")), 1)
|
|
2774
2841
|
]),
|
|
2775
2842
|
_: 1
|
|
2776
2843
|
}, 8, ["tone"])
|
|
2777
2844
|
]),
|
|
2778
2845
|
_: 2
|
|
2779
|
-
}, 1032, ["content"])) : (p(),
|
|
2846
|
+
}, 1032, ["content"])) : (p(), z(e(J), {
|
|
2780
2847
|
key: 1,
|
|
2781
2848
|
size: "sm",
|
|
2782
|
-
tone:
|
|
2849
|
+
tone: ke(B.indexing)
|
|
2783
2850
|
}, {
|
|
2784
|
-
default:
|
|
2785
|
-
|
|
2851
|
+
default: l(() => [
|
|
2852
|
+
w(b(e(t)(`tag.indexing-${B.indexing}`)), 1)
|
|
2786
2853
|
]),
|
|
2787
2854
|
_: 2
|
|
2788
2855
|
}, 1032, ["tone"]))
|
|
2789
2856
|
]),
|
|
2790
|
-
"cell-actions":
|
|
2791
|
-
n(e(
|
|
2792
|
-
actions:
|
|
2793
|
-
label:
|
|
2857
|
+
"cell-actions": l(({ row: B }) => [
|
|
2858
|
+
n(e(Re), {
|
|
2859
|
+
actions: Te(B),
|
|
2860
|
+
label: B.title
|
|
2794
2861
|
}, null, 8, ["actions", "label"])
|
|
2795
2862
|
]),
|
|
2796
2863
|
_: 1
|
|
2797
2864
|
}, 8, ["selected", "data", "columns", "loading", "selectable", "search-placeholder", "empty-text", "aria-label"])
|
|
2798
2865
|
]),
|
|
2799
|
-
_:
|
|
2800
|
-
}, [
|
|
2801
|
-
|
|
2802
|
-
name: "actions",
|
|
2803
|
-
fn: a(() => [
|
|
2804
|
-
n(e(F), {
|
|
2805
|
-
type: "primary",
|
|
2806
|
-
onClick: Ve
|
|
2807
|
-
}, {
|
|
2808
|
-
icon: a(() => [
|
|
2809
|
-
n(e(Y), { name: "plus" })
|
|
2810
|
-
]),
|
|
2811
|
-
default: a(() => [
|
|
2812
|
-
g(" " + f(e(t)("tag.new")), 1)
|
|
2813
|
-
]),
|
|
2814
|
-
_: 1
|
|
2815
|
-
})
|
|
2816
|
-
]),
|
|
2817
|
-
key: "0"
|
|
2818
|
-
} : void 0
|
|
2819
|
-
]), 1032, ["view", "title", "views"]),
|
|
2820
|
-
N.value.length > 0 ? (p(), V(e(ot), {
|
|
2866
|
+
_: 1
|
|
2867
|
+
}, 8, ["view", "title", "views", "actions"]),
|
|
2868
|
+
M.value.length > 0 ? (p(), z(e(rt), {
|
|
2821
2869
|
key: 0,
|
|
2822
2870
|
class: "wx-tags__bar",
|
|
2823
2871
|
sticky: ""
|
|
2824
2872
|
}, {
|
|
2825
|
-
|
|
2826
|
-
n(e(
|
|
2827
|
-
default:
|
|
2828
|
-
|
|
2873
|
+
state: l(() => [
|
|
2874
|
+
n(e(J), { weight: "medium" }, {
|
|
2875
|
+
default: l(() => [
|
|
2876
|
+
w(b(e(t)("tag.selected", { count: M.value.length })), 1)
|
|
2829
2877
|
]),
|
|
2830
2878
|
_: 1
|
|
2831
|
-
})
|
|
2832
|
-
|
|
2833
|
-
|
|
2879
|
+
})
|
|
2880
|
+
]),
|
|
2881
|
+
default: l(() => [
|
|
2882
|
+
n(e(Z), {
|
|
2834
2883
|
type: "primary",
|
|
2835
|
-
disabled:
|
|
2836
|
-
onClick:
|
|
2884
|
+
disabled: M.value.length < 2 || c.value,
|
|
2885
|
+
onClick: fe
|
|
2837
2886
|
}, {
|
|
2838
|
-
icon:
|
|
2839
|
-
n(e(
|
|
2887
|
+
icon: l(() => [
|
|
2888
|
+
n(e(we), { name: "link" })
|
|
2840
2889
|
]),
|
|
2841
|
-
default:
|
|
2842
|
-
|
|
2890
|
+
default: l(() => [
|
|
2891
|
+
w(" " + b(e(t)("tag.merge")), 1)
|
|
2843
2892
|
]),
|
|
2844
2893
|
_: 1
|
|
2845
2894
|
}, 8, ["disabled"]),
|
|
2846
|
-
n(e(
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
},
|
|
2851
|
-
icon: a(() => [
|
|
2852
|
-
n(e(Y), { name: "eye" })
|
|
2853
|
-
]),
|
|
2854
|
-
default: a(() => [
|
|
2855
|
-
g(" " + f(e(t)("tag.index")), 1)
|
|
2856
|
-
]),
|
|
2857
|
-
_: 1
|
|
2858
|
-
}, 8, ["disabled"]),
|
|
2859
|
-
n(e(F), {
|
|
2860
|
-
variant: "outline",
|
|
2861
|
-
disabled: h.value,
|
|
2862
|
-
onClick: s[4] || (s[4] = (w) => v("noindex"))
|
|
2863
|
-
}, {
|
|
2864
|
-
icon: a(() => [
|
|
2865
|
-
n(e(Y), { name: "eye-off" })
|
|
2866
|
-
]),
|
|
2867
|
-
default: a(() => [
|
|
2868
|
-
g(" " + f(e(t)("tag.noindex")), 1)
|
|
2869
|
-
]),
|
|
2870
|
-
_: 1
|
|
2871
|
-
}, 8, ["disabled"]),
|
|
2872
|
-
n(e(F), {
|
|
2873
|
-
variant: "outline",
|
|
2874
|
-
type: "danger",
|
|
2875
|
-
disabled: h.value,
|
|
2876
|
-
onClick: s[5] || (s[5] = (w) => v("delete"))
|
|
2877
|
-
}, {
|
|
2878
|
-
icon: a(() => [
|
|
2879
|
-
n(e(Y), { name: "trash" })
|
|
2880
|
-
]),
|
|
2881
|
-
default: a(() => [
|
|
2882
|
-
g(" " + f(e(t)("tag.delete")), 1)
|
|
2883
|
-
]),
|
|
2884
|
-
_: 1
|
|
2885
|
-
}, 8, ["disabled"]),
|
|
2886
|
-
n(e(F), {
|
|
2887
|
-
variant: "text",
|
|
2888
|
-
"aria-label": e(t)("tag.clear"),
|
|
2889
|
-
onClick: s[6] || (s[6] = (w) => T.value = [])
|
|
2890
|
-
}, {
|
|
2891
|
-
icon: a(() => [
|
|
2892
|
-
n(e(Y), { name: "close" })
|
|
2893
|
-
]),
|
|
2894
|
-
_: 1
|
|
2895
|
-
}, 8, ["aria-label"])
|
|
2895
|
+
n(e(Re), {
|
|
2896
|
+
size: "lg",
|
|
2897
|
+
actions: he.value,
|
|
2898
|
+
label: e(t)("tag.selected", { count: M.value.length })
|
|
2899
|
+
}, null, 8, ["actions", "label"])
|
|
2896
2900
|
]),
|
|
2897
2901
|
_: 1
|
|
2898
|
-
})) :
|
|
2902
|
+
})) : H("", !0)
|
|
2899
2903
|
]));
|
|
2900
2904
|
}
|
|
2901
|
-
}),
|
|
2902
|
-
function
|
|
2903
|
-
const
|
|
2905
|
+
}), Ia = /* @__PURE__ */ pe(Da, [["__scopeId", "data-v-beb86d88"]]);
|
|
2906
|
+
function Ka(f = {}) {
|
|
2907
|
+
const m = f.path ?? "/blog";
|
|
2904
2908
|
return [
|
|
2905
2909
|
{
|
|
2906
2910
|
id: "articles",
|
|
2907
|
-
path: `${
|
|
2911
|
+
path: `${m}/articles`,
|
|
2908
2912
|
routes: [
|
|
2909
2913
|
// The section's own path travels as a prop, so a panel that mounted the blog somewhere
|
|
2910
2914
|
// else still links between its screens correctly.
|
|
2911
2915
|
{
|
|
2912
|
-
path: `${
|
|
2916
|
+
path: `${m}/articles`,
|
|
2913
2917
|
name: "webx.blog.articles",
|
|
2914
|
-
component:
|
|
2915
|
-
props: { base:
|
|
2918
|
+
component: ga,
|
|
2919
|
+
props: { base: m }
|
|
2916
2920
|
},
|
|
2917
2921
|
{
|
|
2918
|
-
path: `${
|
|
2922
|
+
path: `${m}/articles/:id(\\d+)`,
|
|
2919
2923
|
name: "webx.blog.articles.edit",
|
|
2920
|
-
component:
|
|
2921
|
-
props: { base:
|
|
2924
|
+
component: It,
|
|
2925
|
+
props: { base: m }
|
|
2922
2926
|
}
|
|
2923
2927
|
],
|
|
2924
2928
|
/*
|
|
@@ -2932,60 +2936,60 @@ function nl(y = {}) {
|
|
|
2932
2936
|
* binding.
|
|
2933
2937
|
*/
|
|
2934
2938
|
types: {
|
|
2935
|
-
"wx-article-address": { component:
|
|
2936
|
-
"wx-article-author": { component:
|
|
2937
|
-
"wx-article-rubrics": { component:
|
|
2938
|
-
"wx-article-tags": { component:
|
|
2939
|
-
"wx-article-related": { component:
|
|
2940
|
-
"wx-article-history": { component:
|
|
2939
|
+
"wx-article-address": { component: Mt, kind: "display" },
|
|
2940
|
+
"wx-article-author": { component: Nt, kind: "field" },
|
|
2941
|
+
"wx-article-rubrics": { component: ta, kind: "field" },
|
|
2942
|
+
"wx-article-tags": { component: ra, kind: "field" },
|
|
2943
|
+
"wx-article-related": { component: Qt, kind: "field" },
|
|
2944
|
+
"wx-article-history": { component: Ht, kind: "display" }
|
|
2941
2945
|
}
|
|
2942
2946
|
},
|
|
2943
2947
|
{
|
|
2944
2948
|
id: "rubrics",
|
|
2945
|
-
path: `${
|
|
2949
|
+
path: `${m}/rubrics`,
|
|
2946
2950
|
routes: [
|
|
2947
2951
|
{
|
|
2948
|
-
path: `${
|
|
2952
|
+
path: `${m}/rubrics`,
|
|
2949
2953
|
name: "webx.blog.rubrics",
|
|
2950
|
-
component:
|
|
2951
|
-
props: { base:
|
|
2954
|
+
component: Wa,
|
|
2955
|
+
props: { base: m }
|
|
2952
2956
|
}
|
|
2953
2957
|
]
|
|
2954
2958
|
},
|
|
2955
2959
|
{
|
|
2956
2960
|
id: "tags",
|
|
2957
|
-
path: `${
|
|
2961
|
+
path: `${m}/tags`,
|
|
2958
2962
|
routes: [
|
|
2959
2963
|
{
|
|
2960
|
-
path: `${
|
|
2964
|
+
path: `${m}/tags`,
|
|
2961
2965
|
name: "webx.blog.tags",
|
|
2962
|
-
component:
|
|
2963
|
-
props: { base:
|
|
2966
|
+
component: Ia,
|
|
2967
|
+
props: { base: m }
|
|
2964
2968
|
}
|
|
2965
2969
|
]
|
|
2966
2970
|
}
|
|
2967
2971
|
];
|
|
2968
2972
|
}
|
|
2969
2973
|
export {
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2974
|
+
Mt as WxArticleAddress,
|
|
2975
|
+
Nt as WxArticleAuthorField,
|
|
2976
|
+
oa as WxArticleCreateDialog,
|
|
2977
|
+
It as WxArticleEditorPage,
|
|
2978
|
+
Ht as WxArticleHistory,
|
|
2979
|
+
Qt as WxArticleRelated,
|
|
2980
|
+
ta as WxArticleRubrics,
|
|
2981
|
+
ra as WxArticleTags,
|
|
2982
|
+
ga as WxArticlesPage,
|
|
2983
|
+
Va as WxRubricForm,
|
|
2984
|
+
Wa as WxRubricsPage,
|
|
2985
|
+
Ca as WxTagCreateDialog,
|
|
2986
|
+
Ba as WxTagMergeDialog,
|
|
2987
|
+
Ia as WxTagsPage,
|
|
2988
|
+
ut as articleEditorKey,
|
|
2989
|
+
Ka as blog,
|
|
2986
2990
|
Rt as blogMessages,
|
|
2987
|
-
|
|
2991
|
+
de as createBlogApi,
|
|
2988
2992
|
zt as provideArticleEditor,
|
|
2989
|
-
|
|
2993
|
+
Se as useArticleEditor
|
|
2990
2994
|
};
|
|
2991
2995
|
//# sourceMappingURL=index.js.map
|