@webx-ui/module-blog 0.8.3 → 0.8.5
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-DViFCNvm.js → ArticleEditorPage-Bkb5YrLy.js} +2 -2
- package/dist/{ArticleEditorPage-DViFCNvm.js.map → ArticleEditorPage-Bkb5YrLy.js.map} +1 -1
- package/dist/{ArticlesPage-CI-Nwhpy.js → ArticlesPage-BnHi8gF0.js} +173 -154
- package/dist/ArticlesPage-BnHi8gF0.js.map +1 -0
- package/dist/{AuthorsPage-BN6sRqyE.js → AuthorsPage-DSLsX44M.js} +2 -2
- package/dist/{AuthorsPage-BN6sRqyE.js.map → AuthorsPage-DSLsX44M.js.map} +1 -1
- package/dist/{TagsPage-rFfpCqPs.js → TagsPage-BnLVnx5a.js} +2 -2
- package/dist/{TagsPage-rFfpCqPs.js.map → TagsPage-BnLVnx5a.js.map} +1 -1
- package/dist/{index-DqN5h0Ej.js → index-ChbP89HC.js} +418 -417
- package/dist/index-ChbP89HC.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/dist/ArticlesPage-CI-Nwhpy.js.map +0 -1
- package/dist/index-DqN5h0Ej.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { provide as Me, inject as Pe, defineComponent as z, useModel as re, computed as
|
|
2
|
-
import { useAdmin as K, useTranslate as H, useErrorText as Z, WxDate as
|
|
3
|
-
import { RouterLink as
|
|
4
|
-
import { WxSelect as ee, WxSkeleton as Te, WxEmpty as
|
|
1
|
+
import { provide as Me, inject as Pe, defineComponent as z, useModel as re, computed as $, openBlock as _, createElementBlock as U, createVNode as y, unref as e, createBlock as W, withCtx as v, createTextVNode as N, toDisplayString as C, createCommentVNode as L, mergeModels as ue, ref as A, watch as X, createElementVNode as E, Fragment as Y, renderList as ce, normalizeClass as Re, onBeforeUnmount as de, mergeProps as Ue, normalizeProps as Ie, guardReactiveProps as De, onMounted as he, createSlots as Le, useTemplateRef as ke, nextTick as $e, isRef as pe, withKeys as ie, defineAsyncComponent as le } from "vue";
|
|
2
|
+
import { useAdmin as K, useTranslate as H, useErrorText as Z, WxDate as Be, WxDrafts as Ee, useRemoveConfirm as Oe, categoryRoutes as ze, useBodyKeys as Ke, WxScreenHead as He, WxScreen as Fe, WxSaveState as je } from "@webx-ui/module-admin";
|
|
3
|
+
import { RouterLink as Ge, useRoute as Je, onBeforeRouteUpdate as Ze, onBeforeRouteLeave as Qe } from "vue-router";
|
|
4
|
+
import { WxSelect as ee, WxSkeleton as Te, WxEmpty as Xe, WxText as ve, WxBadge as q, WxButton as O, toast as P, confirm as te, WxSortableList as Ye, WxAction as qe, useLocales as Ae, WxInput as ae, WxAlert as ne, WxFormItem as J, localizedValue as et, WxCard as tt, WxActionBar as at, useModal as ge, WxDialog as me, WxSpace as fe, WxIcon as lt, WxCheckbox as ot } from "@webx-ui/core";
|
|
5
5
|
const Se = /* @__PURE__ */ Symbol("wx-article-editor");
|
|
6
|
-
function
|
|
6
|
+
function Ft(n) {
|
|
7
7
|
Me(Se, n);
|
|
8
8
|
}
|
|
9
9
|
function Q() {
|
|
10
10
|
return Pe(Se, null);
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const st = {
|
|
13
13
|
module: {
|
|
14
14
|
group: "Blog",
|
|
15
15
|
articles: "Articles",
|
|
@@ -280,11 +280,11 @@ const lt = {
|
|
|
280
280
|
function F() {
|
|
281
281
|
try {
|
|
282
282
|
const { i18n: n } = K();
|
|
283
|
-
_e.has(n) || (n.defaults("webx-blog",
|
|
283
|
+
_e.has(n) || (n.defaults("webx-blog", st), _e.add(n));
|
|
284
284
|
} catch {
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
const
|
|
287
|
+
const it = { class: "wx-article-author" }, nt = /* @__PURE__ */ z({
|
|
288
288
|
name: "WxArticleAuthor",
|
|
289
289
|
__name: "ArticleAuthor",
|
|
290
290
|
props: /* @__PURE__ */ ue({
|
|
@@ -297,31 +297,31 @@ const ot = { class: "wx-article-author" }, st = /* @__PURE__ */ z({
|
|
|
297
297
|
setup(n) {
|
|
298
298
|
const l = n, o = re(n, "modelValue"), i = Q();
|
|
299
299
|
F();
|
|
300
|
-
const t = H("webx-blog"), a = K(), r =
|
|
300
|
+
const t = H("webx-blog"), a = K(), r = $(() => l.disabled || i?.disabled.value === !0), u = $(
|
|
301
301
|
() => (i?.options.value.authors ?? []).map((c) => ({
|
|
302
302
|
label: c.title,
|
|
303
303
|
value: c.id
|
|
304
304
|
}))
|
|
305
|
-
), s =
|
|
305
|
+
), s = $(() => {
|
|
306
306
|
if (!a.state.manifest?.modules.some((w) => w.id === "authors") || !a.can("blog.authors.manage") || o.value === null) return null;
|
|
307
|
-
const
|
|
307
|
+
const g = i?.base ?? "/blog", x = i?.options.value.authors.find((w) => w.id === o.value)?.profile;
|
|
308
308
|
return x ? {
|
|
309
|
-
to: { path: `${
|
|
309
|
+
to: { path: `${g}/authors`, query: { author: String(x) } },
|
|
310
310
|
label: t("author.profile")
|
|
311
311
|
} : {
|
|
312
|
-
to: { path: `${
|
|
312
|
+
to: { path: `${g}/authors`, query: { author: "new", account: String(o.value) } },
|
|
313
313
|
label: t("author.make-profile")
|
|
314
314
|
};
|
|
315
|
-
}),
|
|
315
|
+
}), m = $({
|
|
316
316
|
get: () => o.value,
|
|
317
317
|
set: (c) => {
|
|
318
318
|
o.value = typeof c == "number" ? c : null;
|
|
319
319
|
}
|
|
320
320
|
});
|
|
321
|
-
return (c,
|
|
322
|
-
|
|
323
|
-
modelValue:
|
|
324
|
-
"onUpdate:modelValue":
|
|
321
|
+
return (c, g) => (_(), U("div", it, [
|
|
322
|
+
y(e(ee), {
|
|
323
|
+
modelValue: m.value,
|
|
324
|
+
"onUpdate:modelValue": g[0] || (g[0] = (x) => m.value = x),
|
|
325
325
|
options: u.value,
|
|
326
326
|
placeholder: e(t)("article.no-author"),
|
|
327
327
|
disabled: r.value,
|
|
@@ -330,13 +330,13 @@ const ot = { class: "wx-article-author" }, st = /* @__PURE__ */ z({
|
|
|
330
330
|
teleport: "",
|
|
331
331
|
"aria-label": e(t)("article.author")
|
|
332
332
|
}, null, 8, ["modelValue", "options", "placeholder", "disabled", "aria-label"]),
|
|
333
|
-
s.value ? (
|
|
333
|
+
s.value ? (_(), W(e(Ge), {
|
|
334
334
|
key: 0,
|
|
335
335
|
class: "wx-article-author__profile",
|
|
336
336
|
to: s.value.to
|
|
337
337
|
}, {
|
|
338
|
-
default:
|
|
339
|
-
|
|
338
|
+
default: v(() => [
|
|
339
|
+
N(C(s.value.label), 1)
|
|
340
340
|
]),
|
|
341
341
|
_: 1
|
|
342
342
|
}, 8, ["to"])) : L("", !0)
|
|
@@ -347,7 +347,7 @@ const ot = { class: "wx-article-author" }, st = /* @__PURE__ */ z({
|
|
|
347
347
|
for (const [i, t] of l)
|
|
348
348
|
o[i] = t;
|
|
349
349
|
return o;
|
|
350
|
-
},
|
|
350
|
+
}, rt = /* @__PURE__ */ j(nt, [["__scopeId", "data-v-4b275a4c"]]);
|
|
351
351
|
function G(n) {
|
|
352
352
|
const l = `${n.apiPath}/blog/articles`, o = `${n.apiPath}/blog/tags`, i = (t) => t.data;
|
|
353
353
|
return {
|
|
@@ -389,27 +389,27 @@ function G(n) {
|
|
|
389
389
|
mergeTags: (t, a, r) => n.http.post(`${o}/merge`, { ids: t, keep: a, redirect: r }).then(i)
|
|
390
390
|
};
|
|
391
391
|
}
|
|
392
|
-
const
|
|
392
|
+
const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-history" }, dt = { class: "wx-article-history__number" }, ht = { class: "wx-article-history__who" }, pt = /* @__PURE__ */ z({
|
|
393
393
|
name: "WxArticleHistory",
|
|
394
394
|
__name: "ArticleHistory",
|
|
395
395
|
setup(n) {
|
|
396
396
|
const l = K(), o = G(l), i = Q();
|
|
397
397
|
F();
|
|
398
|
-
const t = H("webx-blog"), a = Z(), r =
|
|
398
|
+
const t = H("webx-blog"), a = Z(), r = A(null), u = A(!1), s = $(() => i?.article.value ?? null), m = $(() => l.can("blog.articles.manage")), c = $(
|
|
399
399
|
() => s.value?.status === "published" || s.value?.status === "modified" ? r.value?.[0]?.number ?? null : null
|
|
400
400
|
);
|
|
401
|
-
async function
|
|
401
|
+
async function g() {
|
|
402
402
|
const w = s.value;
|
|
403
403
|
if (w)
|
|
404
404
|
try {
|
|
405
405
|
r.value = await o.versions(w.id);
|
|
406
|
-
} catch (
|
|
407
|
-
r.value = [],
|
|
406
|
+
} catch (p) {
|
|
407
|
+
r.value = [], P.danger(a(p));
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
async function x(w) {
|
|
411
|
-
const
|
|
412
|
-
if (!(!
|
|
411
|
+
const p = s.value;
|
|
412
|
+
if (!(!p || !await te({
|
|
413
413
|
title: t("article.restore-title", { number: w.number }),
|
|
414
414
|
message: t("article.restore-text"),
|
|
415
415
|
confirmText: t("article.restore-version"),
|
|
@@ -417,9 +417,9 @@ const nt = { class: "wx-article-history-tab" }, rt = { class: "wx-article-histor
|
|
|
417
417
|
}))) {
|
|
418
418
|
u.value = !0;
|
|
419
419
|
try {
|
|
420
|
-
await o.restoreVersion(
|
|
420
|
+
await o.restoreVersion(p.id, w.number), await i?.reload(), P.success(t("article.restored-version", { number: w.number }));
|
|
421
421
|
} catch (M) {
|
|
422
|
-
|
|
422
|
+
P.danger(a(M));
|
|
423
423
|
} finally {
|
|
424
424
|
u.value = !1;
|
|
425
425
|
}
|
|
@@ -428,78 +428,78 @@ const nt = { class: "wx-article-history-tab" }, rt = { class: "wx-article-histor
|
|
|
428
428
|
return X(
|
|
429
429
|
() => [s.value?.id, s.value?.published_at, s.value?.updated_at],
|
|
430
430
|
() => {
|
|
431
|
-
|
|
431
|
+
g();
|
|
432
432
|
},
|
|
433
433
|
{ immediate: !0 }
|
|
434
|
-
), (w,
|
|
435
|
-
E("div",
|
|
436
|
-
r.value === null ? (
|
|
434
|
+
), (w, p) => (_(), U("div", ut, [
|
|
435
|
+
E("div", ct, [
|
|
436
|
+
r.value === null ? (_(), W(e(Te), {
|
|
437
437
|
key: 0,
|
|
438
438
|
class: "wx-article-history__ghost",
|
|
439
439
|
rows: 3
|
|
440
|
-
})) : r.value.length === 0 ? (
|
|
440
|
+
})) : r.value.length === 0 ? (_(), W(e(Xe), {
|
|
441
441
|
key: 1,
|
|
442
442
|
description: e(t)("article.history-empty")
|
|
443
|
-
}, null, 8, ["description"])) : (
|
|
443
|
+
}, null, 8, ["description"])) : (_(!0), U(Y, { key: 2 }, ce(r.value, (f) => (_(), U("div", {
|
|
444
444
|
key: f.number,
|
|
445
|
-
class:
|
|
445
|
+
class: Re(["wx-article-history__row", { "is-live": f.number === c.value }])
|
|
446
446
|
}, [
|
|
447
|
-
E("code",
|
|
448
|
-
E("div",
|
|
449
|
-
f.created_at ? (
|
|
447
|
+
E("code", dt, C(e(t)("article.version", { number: f.number })), 1),
|
|
448
|
+
E("div", ht, [
|
|
449
|
+
f.created_at ? (_(), W(e(Be), {
|
|
450
450
|
key: 0,
|
|
451
451
|
value: f.created_at,
|
|
452
452
|
size: "md",
|
|
453
453
|
tone: "default"
|
|
454
454
|
}, null, 8, ["value"])) : L("", !0),
|
|
455
|
-
|
|
455
|
+
y(e(ve), {
|
|
456
456
|
size: "sm",
|
|
457
457
|
tone: "muted"
|
|
458
458
|
}, {
|
|
459
|
-
default:
|
|
460
|
-
|
|
461
|
-
f.comment ? (
|
|
462
|
-
|
|
459
|
+
default: v(() => [
|
|
460
|
+
N(C(f.author ?? e(t)(`article.source-${f.source}`)) + " ", 1),
|
|
461
|
+
f.comment ? (_(), U(Y, { key: 0 }, [
|
|
462
|
+
N(" · " + C(f.comment), 1)
|
|
463
463
|
], 64)) : L("", !0)
|
|
464
464
|
]),
|
|
465
465
|
_: 2
|
|
466
466
|
}, 1024)
|
|
467
467
|
]),
|
|
468
|
-
f.number === c.value ? (
|
|
468
|
+
f.number === c.value ? (_(), W(e(q), {
|
|
469
469
|
key: 0,
|
|
470
470
|
type: "success",
|
|
471
471
|
dot: ""
|
|
472
472
|
}, {
|
|
473
|
-
default:
|
|
474
|
-
|
|
473
|
+
default: v(() => [
|
|
474
|
+
N(C(e(t)("article.version-live")), 1)
|
|
475
475
|
]),
|
|
476
476
|
_: 1
|
|
477
477
|
})) : L("", !0),
|
|
478
|
-
|
|
478
|
+
m.value && f.number !== c.value ? (_(), W(e(O), {
|
|
479
479
|
key: 1,
|
|
480
480
|
size: "sm",
|
|
481
481
|
variant: "outline",
|
|
482
482
|
loading: u.value,
|
|
483
483
|
onClick: (M) => x(f)
|
|
484
484
|
}, {
|
|
485
|
-
default:
|
|
486
|
-
|
|
485
|
+
default: v(() => [
|
|
486
|
+
N(C(e(t)("article.restore-version")), 1)
|
|
487
487
|
]),
|
|
488
488
|
_: 1
|
|
489
489
|
}, 8, ["loading", "onClick"])) : L("", !0)
|
|
490
490
|
], 2))), 128))
|
|
491
491
|
]),
|
|
492
|
-
|
|
492
|
+
y(e(Ee), {
|
|
493
493
|
id: s.value?.id,
|
|
494
494
|
entity: "articles",
|
|
495
495
|
screen: "blog.article-form",
|
|
496
|
-
"can-restore":
|
|
496
|
+
"can-restore": m.value,
|
|
497
497
|
stamp: [s.value?.published_at, s.value?.updated_at],
|
|
498
|
-
onRestored:
|
|
498
|
+
onRestored: p[0] || (p[0] = (f) => e(i)?.reload())
|
|
499
499
|
}, null, 8, ["id", "can-restore", "stamp"])
|
|
500
500
|
]));
|
|
501
501
|
}
|
|
502
|
-
}),
|
|
502
|
+
}), vt = /* @__PURE__ */ j(pt, [["__scopeId", "data-v-0052c4f9"]]), gt = { class: "wx-article-related" }, mt = { class: "wx-article-related__name" }, ft = 250, bt = 10, wt = /* @__PURE__ */ z({
|
|
503
503
|
name: "WxArticleRelated",
|
|
504
504
|
__name: "ArticleRelated",
|
|
505
505
|
props: /* @__PURE__ */ ue({
|
|
@@ -512,119 +512,120 @@ const nt = { class: "wx-article-history-tab" }, rt = { class: "wx-article-histor
|
|
|
512
512
|
setup(n) {
|
|
513
513
|
const l = n, o = re(n, "modelValue"), i = K(), t = G(i), a = Q();
|
|
514
514
|
F();
|
|
515
|
-
const r = H("webx-blog"), u =
|
|
516
|
-
let
|
|
515
|
+
const r = H("webx-blog"), u = Oe(), s = Z(), m = $(() => l.disabled || a?.disabled.value === !0), c = A(/* @__PURE__ */ new Map()), g = A([]);
|
|
516
|
+
let x;
|
|
517
517
|
X(
|
|
518
518
|
() => a?.related.value,
|
|
519
|
-
(
|
|
520
|
-
const
|
|
521
|
-
for (const
|
|
522
|
-
|
|
519
|
+
(d) => {
|
|
520
|
+
const k = new Map(c.value);
|
|
521
|
+
for (const S of d ?? []) k.set(S.id, S.title);
|
|
522
|
+
c.value = k;
|
|
523
523
|
},
|
|
524
524
|
{ immediate: !0, deep: !0 }
|
|
525
525
|
);
|
|
526
|
-
const
|
|
527
|
-
get: () => o.value.map((
|
|
528
|
-
set: (
|
|
529
|
-
o.value =
|
|
526
|
+
const w = $({
|
|
527
|
+
get: () => o.value.map((d) => ({ id: d, title: c.value.get(d) ?? `#${d}` })),
|
|
528
|
+
set: (d) => {
|
|
529
|
+
o.value = d.map((k) => k.id);
|
|
530
530
|
}
|
|
531
|
-
}),
|
|
532
|
-
() =>
|
|
531
|
+
}), p = $(
|
|
532
|
+
() => g.value.filter((d) => !o.value.includes(d.id)).map((d) => ({ label: d.title, value: d.id }))
|
|
533
533
|
);
|
|
534
|
-
async function
|
|
535
|
-
const
|
|
534
|
+
async function f(d) {
|
|
535
|
+
const k = a?.article.value?.id;
|
|
536
536
|
try {
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
for (const
|
|
541
|
-
|
|
542
|
-
} catch (
|
|
543
|
-
|
|
537
|
+
const S = await t.articles({ q: d, per_page: bt });
|
|
538
|
+
g.value = S.data.filter((V) => V.id !== k).map((V) => ({ id: V.id, title: V.title }));
|
|
539
|
+
const b = new Map(c.value);
|
|
540
|
+
for (const V of g.value) b.set(V.id, V.title);
|
|
541
|
+
c.value = b;
|
|
542
|
+
} catch (S) {
|
|
543
|
+
P.danger(s(S));
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
clearTimeout(
|
|
548
|
-
|
|
549
|
-
},
|
|
546
|
+
function M(d) {
|
|
547
|
+
clearTimeout(x), x = setTimeout(() => {
|
|
548
|
+
f(d);
|
|
549
|
+
}, ft);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
typeof
|
|
551
|
+
function I(d) {
|
|
552
|
+
typeof d != "number" || o.value.includes(d) || (o.value = [...o.value, d]);
|
|
553
553
|
}
|
|
554
|
-
function D(
|
|
555
|
-
o.value = o.value.filter((
|
|
554
|
+
function D(d) {
|
|
555
|
+
o.value = o.value.filter((k) => k !== d);
|
|
556
556
|
}
|
|
557
557
|
return X(
|
|
558
558
|
() => a?.article.value?.id,
|
|
559
559
|
() => {
|
|
560
|
-
|
|
560
|
+
f("");
|
|
561
561
|
},
|
|
562
562
|
{ immediate: !0 }
|
|
563
|
-
), de(() => clearTimeout(
|
|
564
|
-
|
|
565
|
-
modelValue:
|
|
566
|
-
"onUpdate:modelValue":
|
|
563
|
+
), de(() => clearTimeout(x)), (d, k) => (_(), U("div", gt, [
|
|
564
|
+
y(e(Ye), {
|
|
565
|
+
modelValue: w.value,
|
|
566
|
+
"onUpdate:modelValue": k[0] || (k[0] = (S) => w.value = S),
|
|
567
567
|
plain: "",
|
|
568
568
|
size: "sm",
|
|
569
569
|
"item-key": "id",
|
|
570
570
|
"item-label": "title",
|
|
571
|
-
disabled:
|
|
571
|
+
disabled: m.value,
|
|
572
572
|
"empty-text": e(r)("article.related-empty"),
|
|
573
573
|
"aria-label": e(r)("article.related")
|
|
574
574
|
}, {
|
|
575
|
-
default:
|
|
576
|
-
E("span",
|
|
575
|
+
default: v(({ item: S }) => [
|
|
576
|
+
E("span", mt, C(S.title), 1)
|
|
577
577
|
]),
|
|
578
|
-
actions:
|
|
579
|
-
|
|
578
|
+
actions: v(({ item: S }) => [
|
|
579
|
+
y(e(qe), Ue({
|
|
580
580
|
type: "remove",
|
|
581
581
|
size: "sm",
|
|
582
|
-
disabled:
|
|
583
|
-
title: e(r)("article.related-remove")
|
|
584
|
-
|
|
585
|
-
|
|
582
|
+
disabled: m.value,
|
|
583
|
+
title: e(r)("article.related-remove")
|
|
584
|
+
}, e(u), {
|
|
585
|
+
onClick: (b) => D(S.id)
|
|
586
|
+
}), null, 16, ["disabled", "title", "onClick"])
|
|
586
587
|
]),
|
|
587
588
|
_: 1
|
|
588
589
|
}, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
|
|
589
|
-
|
|
590
|
+
y(e(ee), {
|
|
590
591
|
"model-value": null,
|
|
591
|
-
options:
|
|
592
|
+
options: p.value,
|
|
592
593
|
placeholder: e(r)("article.related-add"),
|
|
593
594
|
"empty-text": e(r)("article.related-nothing"),
|
|
594
|
-
disabled:
|
|
595
|
+
disabled: m.value,
|
|
595
596
|
filterable: "",
|
|
596
597
|
teleport: "",
|
|
597
598
|
"aria-label": e(r)("article.related-add"),
|
|
598
|
-
onSearch:
|
|
599
|
-
"onUpdate:modelValue":
|
|
599
|
+
onSearch: M,
|
|
600
|
+
"onUpdate:modelValue": I
|
|
600
601
|
}, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"])
|
|
601
602
|
]));
|
|
602
603
|
}
|
|
603
|
-
}),
|
|
604
|
+
}), yt = /* @__PURE__ */ j(wt, [["__scopeId", "data-v-ac2e96f8"]]), xt = { class: "wx-article-slug" }, _t = { class: "wx-article-slug__prefix" }, kt = /* @__PURE__ */ z({
|
|
604
605
|
name: "WxArticleSlug",
|
|
605
606
|
inheritAttrs: !1,
|
|
606
607
|
__name: "ArticleSlug",
|
|
607
608
|
setup(n) {
|
|
608
609
|
const l = Q(), o = Ae();
|
|
609
610
|
F();
|
|
610
|
-
const i = H("webx-blog"), t =
|
|
611
|
+
const i = H("webx-blog"), t = $(() => {
|
|
611
612
|
const u = l?.prefix.value ?? "";
|
|
612
613
|
return u === "" ? "/" : `/${u}/`;
|
|
613
|
-
}), a =
|
|
614
|
+
}), a = $(() => {
|
|
614
615
|
const u = l?.values.value.slug;
|
|
615
616
|
return typeof u == "string" ? u : u?.[o.active.value] ?? "";
|
|
616
|
-
}), r =
|
|
617
|
+
}), r = $(() => {
|
|
617
618
|
const u = l?.article.value?.path;
|
|
618
619
|
return typeof u == "string" && a.value !== "" && `${t.value}${a.value}` != `/${u}`;
|
|
619
620
|
});
|
|
620
|
-
return (u, s) => (
|
|
621
|
-
|
|
622
|
-
prefix:
|
|
623
|
-
E("span",
|
|
621
|
+
return (u, s) => (_(), U("div", xt, [
|
|
622
|
+
y(e(ae), Ie(De(u.$attrs)), {
|
|
623
|
+
prefix: v(() => [
|
|
624
|
+
E("span", _t, C(t.value), 1)
|
|
624
625
|
]),
|
|
625
626
|
_: 1
|
|
626
627
|
}, 16),
|
|
627
|
-
r.value ? (
|
|
628
|
+
r.value ? (_(), W(e(ne), {
|
|
628
629
|
key: 0,
|
|
629
630
|
type: "info",
|
|
630
631
|
variant: "soft",
|
|
@@ -632,10 +633,10 @@ const nt = { class: "wx-article-history-tab" }, rt = { class: "wx-article-histor
|
|
|
632
633
|
}, null, 8, ["description"])) : L("", !0)
|
|
633
634
|
]));
|
|
634
635
|
}
|
|
635
|
-
}),
|
|
636
|
+
}), $t = /* @__PURE__ */ j(kt, [["__scopeId", "data-v-5da20e5e"]]), Tt = { class: "wx-article-tags" }, At = {
|
|
636
637
|
key: 0,
|
|
637
638
|
class: "wx-article-tags__chips"
|
|
638
|
-
},
|
|
639
|
+
}, St = { class: "wx-article-tags__pick" }, Vt = 250, Ct = /* @__PURE__ */ z({
|
|
639
640
|
name: "WxArticleTags",
|
|
640
641
|
__name: "ArticleTags",
|
|
641
642
|
props: /* @__PURE__ */ ue({
|
|
@@ -648,62 +649,62 @@ const nt = { class: "wx-article-history-tab" }, rt = { class: "wx-article-histor
|
|
|
648
649
|
setup(n) {
|
|
649
650
|
const l = n, o = re(n, "modelValue"), i = K(), t = G(i), a = Q();
|
|
650
651
|
F();
|
|
651
|
-
const r = H("webx-blog"), u = Z(), s =
|
|
652
|
+
const r = H("webx-blog"), u = Z(), s = $(() => l.disabled || a?.disabled.value === !0), m = A(/* @__PURE__ */ new Map()), c = A([]), g = A(""), x = A(!1);
|
|
652
653
|
let w;
|
|
653
654
|
X(
|
|
654
655
|
() => a?.article.value?.tags,
|
|
655
|
-
(
|
|
656
|
-
const
|
|
657
|
-
for (const
|
|
658
|
-
|
|
656
|
+
(b) => {
|
|
657
|
+
const V = new Map(m.value);
|
|
658
|
+
for (const R of b ?? []) V.set(R.id, R.title);
|
|
659
|
+
m.value = V;
|
|
659
660
|
},
|
|
660
661
|
{ immediate: !0, deep: !0 }
|
|
661
662
|
);
|
|
662
|
-
const
|
|
663
|
-
() => o.value.map((
|
|
664
|
-
), f =
|
|
665
|
-
() => c.value.filter((
|
|
663
|
+
const p = $(
|
|
664
|
+
() => o.value.map((b) => ({ id: b, title: m.value.get(b) ?? `#${b}` }))
|
|
665
|
+
), f = $(
|
|
666
|
+
() => c.value.filter((b) => !o.value.includes(b.id)).map((b) => ({
|
|
666
667
|
// The count is part of the label rather than a column: a select draws a line of text, and
|
|
667
668
|
// the number is what the reader is choosing between two near-identical words on.
|
|
668
|
-
label: r("article.tag-option", { title:
|
|
669
|
-
value:
|
|
669
|
+
label: r("article.tag-option", { title: b.title, count: b.articles_count }),
|
|
670
|
+
value: b.id
|
|
670
671
|
}))
|
|
671
|
-
), M =
|
|
672
|
-
const
|
|
673
|
-
if (
|
|
674
|
-
const
|
|
675
|
-
return c.value.some((
|
|
672
|
+
), M = $(() => {
|
|
673
|
+
const b = g.value.trim();
|
|
674
|
+
if (b === "") return null;
|
|
675
|
+
const V = (R) => R.toLowerCase() === b.toLowerCase();
|
|
676
|
+
return c.value.some((R) => V(R.title)) ? null : b;
|
|
676
677
|
});
|
|
677
|
-
async function
|
|
678
|
+
async function I() {
|
|
678
679
|
try {
|
|
679
|
-
c.value = await t.tags(
|
|
680
|
-
const
|
|
681
|
-
for (const
|
|
682
|
-
|
|
683
|
-
} catch (
|
|
684
|
-
|
|
680
|
+
c.value = await t.tags(g.value);
|
|
681
|
+
const b = new Map(m.value);
|
|
682
|
+
for (const V of c.value) b.set(V.id, V.title);
|
|
683
|
+
m.value = b;
|
|
684
|
+
} catch (b) {
|
|
685
|
+
P.danger(u(b));
|
|
685
686
|
}
|
|
686
687
|
}
|
|
687
|
-
function
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
},
|
|
688
|
+
function D(b) {
|
|
689
|
+
g.value = b, clearTimeout(w), w = setTimeout(() => {
|
|
690
|
+
I();
|
|
691
|
+
}, Vt);
|
|
691
692
|
}
|
|
692
|
-
function
|
|
693
|
-
typeof
|
|
693
|
+
function d(b) {
|
|
694
|
+
typeof b != "number" || o.value.includes(b) || (o.value = [...o.value, b], g.value = "");
|
|
694
695
|
}
|
|
695
|
-
function
|
|
696
|
-
o.value = o.value.filter((
|
|
696
|
+
function k(b) {
|
|
697
|
+
o.value = o.value.filter((V) => V !== b);
|
|
697
698
|
}
|
|
698
|
-
async function
|
|
699
|
-
const
|
|
700
|
-
if (!(
|
|
699
|
+
async function S() {
|
|
700
|
+
const b = M.value;
|
|
701
|
+
if (!(b === null || x.value)) {
|
|
701
702
|
x.value = !0;
|
|
702
703
|
try {
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
} catch (
|
|
706
|
-
|
|
704
|
+
const V = await t.createTag({ title: b });
|
|
705
|
+
m.value = new Map(m.value).set(V.id, V.title), c.value = [V, ...c.value], d(V.id);
|
|
706
|
+
} catch (V) {
|
|
707
|
+
P.danger(u(V));
|
|
707
708
|
} finally {
|
|
708
709
|
x.value = !1;
|
|
709
710
|
}
|
|
@@ -712,35 +713,35 @@ const nt = { class: "wx-article-history-tab" }, rt = { class: "wx-article-histor
|
|
|
712
713
|
return X(
|
|
713
714
|
() => a?.article.value?.id,
|
|
714
715
|
() => {
|
|
715
|
-
|
|
716
|
+
I();
|
|
716
717
|
},
|
|
717
718
|
{ immediate: !0 }
|
|
718
|
-
), de(() => clearTimeout(w)), (
|
|
719
|
-
|
|
720
|
-
(
|
|
721
|
-
key:
|
|
719
|
+
), de(() => clearTimeout(w)), (b, V) => (_(), U("div", Tt, [
|
|
720
|
+
p.value.length > 0 ? (_(), U("div", At, [
|
|
721
|
+
(_(!0), U(Y, null, ce(p.value, (R) => (_(), W(e(q), {
|
|
722
|
+
key: R.id,
|
|
722
723
|
type: "default",
|
|
723
724
|
closable: !s.value,
|
|
724
725
|
"close-label": e(r)("article.tag-remove"),
|
|
725
|
-
onClose: (oe) =>
|
|
726
|
+
onClose: (oe) => k(R.id)
|
|
726
727
|
}, {
|
|
727
|
-
default:
|
|
728
|
-
|
|
728
|
+
default: v(() => [
|
|
729
|
+
N(C(R.title), 1)
|
|
729
730
|
]),
|
|
730
731
|
_: 2
|
|
731
732
|
}, 1032, ["closable", "close-label", "onClose"]))), 128))
|
|
732
|
-
])) : (
|
|
733
|
+
])) : (_(), W(e(ve), {
|
|
733
734
|
key: 1,
|
|
734
735
|
size: "sm",
|
|
735
736
|
tone: "muted"
|
|
736
737
|
}, {
|
|
737
|
-
default:
|
|
738
|
-
|
|
738
|
+
default: v(() => [
|
|
739
|
+
N(C(e(r)("article.tags-empty")), 1)
|
|
739
740
|
]),
|
|
740
741
|
_: 1
|
|
741
742
|
})),
|
|
742
|
-
E("div",
|
|
743
|
-
|
|
743
|
+
E("div", St, [
|
|
744
|
+
y(e(ee), {
|
|
744
745
|
"model-value": null,
|
|
745
746
|
options: f.value,
|
|
746
747
|
placeholder: e(r)("article.tag-add"),
|
|
@@ -749,36 +750,36 @@ const nt = { class: "wx-article-history-tab" }, rt = { class: "wx-article-histor
|
|
|
749
750
|
filterable: "",
|
|
750
751
|
teleport: "",
|
|
751
752
|
"aria-label": e(r)("article.tag-add"),
|
|
752
|
-
onSearch:
|
|
753
|
-
"onUpdate:modelValue":
|
|
753
|
+
onSearch: D,
|
|
754
|
+
"onUpdate:modelValue": d
|
|
754
755
|
}, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"]),
|
|
755
|
-
M.value ? (
|
|
756
|
+
M.value ? (_(), W(e(O), {
|
|
756
757
|
key: 0,
|
|
757
758
|
variant: "outline",
|
|
758
759
|
icon: "plus",
|
|
759
760
|
loading: x.value,
|
|
760
761
|
disabled: s.value,
|
|
761
|
-
onClick:
|
|
762
|
+
onClick: S
|
|
762
763
|
}, {
|
|
763
|
-
default:
|
|
764
|
-
|
|
764
|
+
default: v(() => [
|
|
765
|
+
N(C(e(r)("article.tag-create", { title: M.value })), 1)
|
|
765
766
|
]),
|
|
766
767
|
_: 1
|
|
767
768
|
}, 8, ["loading", "disabled"])) : L("", !0)
|
|
768
769
|
])
|
|
769
770
|
]));
|
|
770
771
|
}
|
|
771
|
-
}),
|
|
772
|
+
}), Wt = /* @__PURE__ */ j(Ct, [["__scopeId", "data-v-faf5adec"]]), Nt = /* @__PURE__ */ z({
|
|
772
773
|
name: "WxArticleUnpublish",
|
|
773
774
|
__name: "ArticleUnpublish",
|
|
774
775
|
setup(n) {
|
|
775
776
|
const l = K(), o = G(l), i = Q();
|
|
776
777
|
F();
|
|
777
|
-
const t = H("webx-blog"), a = Z(), r =
|
|
778
|
+
const t = H("webx-blog"), a = Z(), r = A(!1), u = $(() => {
|
|
778
779
|
const c = i?.article.value?.status;
|
|
779
780
|
return c === "published" || c === "modified" || c === "scheduled";
|
|
780
|
-
}), s =
|
|
781
|
-
async function
|
|
781
|
+
}), s = $(() => i?.disabled.value === !0 || r.value);
|
|
782
|
+
async function m() {
|
|
782
783
|
const c = i?.article.value;
|
|
783
784
|
if (!(!c || !await te({
|
|
784
785
|
title: t("article.unpublish-title", { title: c.title }),
|
|
@@ -789,30 +790,30 @@ const nt = { class: "wx-article-history-tab" }, rt = { class: "wx-article-histor
|
|
|
789
790
|
}))) {
|
|
790
791
|
r.value = !0;
|
|
791
792
|
try {
|
|
792
|
-
await o.unpublish(c.id), await i?.reload(),
|
|
793
|
+
await o.unpublish(c.id), await i?.reload(), P.success(t("panel.unpublished-done"));
|
|
793
794
|
} catch (x) {
|
|
794
|
-
|
|
795
|
+
P.danger(a(x));
|
|
795
796
|
} finally {
|
|
796
797
|
r.value = !1;
|
|
797
798
|
}
|
|
798
799
|
}
|
|
799
800
|
}
|
|
800
|
-
return (c,
|
|
801
|
+
return (c, g) => u.value && e(i)?.canManage ? (_(), W(e(J), {
|
|
801
802
|
key: 0,
|
|
802
803
|
class: "wx-article-unpublish",
|
|
803
804
|
help: e(t)("article.unpublish-help")
|
|
804
805
|
}, {
|
|
805
|
-
default:
|
|
806
|
-
|
|
806
|
+
default: v(() => [
|
|
807
|
+
y(e(O), {
|
|
807
808
|
variant: "outline",
|
|
808
809
|
type: "danger",
|
|
809
810
|
icon: "eye-off",
|
|
810
811
|
loading: r.value,
|
|
811
812
|
disabled: s.value,
|
|
812
|
-
onClick:
|
|
813
|
+
onClick: m
|
|
813
814
|
}, {
|
|
814
|
-
default:
|
|
815
|
-
|
|
815
|
+
default: v(() => [
|
|
816
|
+
N(C(e(t)("panel.unpublish")), 1)
|
|
816
817
|
]),
|
|
817
818
|
_: 1
|
|
818
819
|
}, 8, ["loading", "disabled"])
|
|
@@ -820,8 +821,8 @@ const nt = { class: "wx-article-history-tab" }, rt = { class: "wx-article-histor
|
|
|
820
821
|
_: 1
|
|
821
822
|
}, 8, ["help"])) : L("", !0);
|
|
822
823
|
}
|
|
823
|
-
}),
|
|
824
|
-
function
|
|
824
|
+
}), Mt = /* @__PURE__ */ j(Nt, [["__scopeId", "data-v-c311cff2"]]);
|
|
825
|
+
function Pt(n = "/blog") {
|
|
825
826
|
return {
|
|
826
827
|
api: "blog/rubrics",
|
|
827
828
|
path: `${n}/rubrics`,
|
|
@@ -850,7 +851,7 @@ function Nt(n = "/blog") {
|
|
|
850
851
|
}
|
|
851
852
|
};
|
|
852
853
|
}
|
|
853
|
-
function
|
|
854
|
+
function jt(n = {}) {
|
|
854
855
|
const l = n.path ?? "/blog";
|
|
855
856
|
return [
|
|
856
857
|
{
|
|
@@ -862,13 +863,13 @@ function Ht(n = {}) {
|
|
|
862
863
|
{
|
|
863
864
|
path: `${l}/articles`,
|
|
864
865
|
name: "webx.blog.articles",
|
|
865
|
-
component: () => import("./ArticlesPage-
|
|
866
|
+
component: () => import("./ArticlesPage-BnHi8gF0.js"),
|
|
866
867
|
props: { base: l }
|
|
867
868
|
},
|
|
868
869
|
{
|
|
869
870
|
path: `${l}/articles/:id(\\d+)`,
|
|
870
871
|
name: "webx.blog.articles.edit",
|
|
871
|
-
component: () => import("./ArticleEditorPage-
|
|
872
|
+
component: () => import("./ArticleEditorPage-Bkb5YrLy.js"),
|
|
872
873
|
props: { base: l }
|
|
873
874
|
}
|
|
874
875
|
],
|
|
@@ -887,12 +888,12 @@ function Ht(n = {}) {
|
|
|
887
888
|
* description — it is configuration the editor was handed with the record.
|
|
888
889
|
*/
|
|
889
890
|
types: {
|
|
890
|
-
"wx-article-slug": { component:
|
|
891
|
-
"wx-article-author": { component:
|
|
892
|
-
"wx-article-tags": { component:
|
|
893
|
-
"wx-article-related": { component:
|
|
894
|
-
"wx-article-unpublish": { component:
|
|
895
|
-
"wx-article-history": { component:
|
|
891
|
+
"wx-article-slug": { component: $t, kind: "field" },
|
|
892
|
+
"wx-article-author": { component: rt, kind: "field" },
|
|
893
|
+
"wx-article-tags": { component: Wt, kind: "field" },
|
|
894
|
+
"wx-article-related": { component: yt, kind: "field" },
|
|
895
|
+
"wx-article-unpublish": { component: Mt, kind: "display" },
|
|
896
|
+
"wx-article-history": { component: vt, kind: "display" }
|
|
896
897
|
}
|
|
897
898
|
},
|
|
898
899
|
{
|
|
@@ -900,7 +901,7 @@ function Ht(n = {}) {
|
|
|
900
901
|
path: `${l}/rubrics`,
|
|
901
902
|
// The list and the page of one rubric are the panel's shared category screens (§3.6 of
|
|
902
903
|
// the services spec); what is the blog's is the description they are handed.
|
|
903
|
-
routes:
|
|
904
|
+
routes: ze(Pt(l))
|
|
904
905
|
},
|
|
905
906
|
{
|
|
906
907
|
id: "tags",
|
|
@@ -909,7 +910,7 @@ function Ht(n = {}) {
|
|
|
909
910
|
{
|
|
910
911
|
path: `${l}/tags`,
|
|
911
912
|
name: "webx.blog.tags",
|
|
912
|
-
component: () => import("./TagsPage-
|
|
913
|
+
component: () => import("./TagsPage-BnLVnx5a.js"),
|
|
913
914
|
props: { base: l }
|
|
914
915
|
}
|
|
915
916
|
]
|
|
@@ -923,14 +924,14 @@ function Ht(n = {}) {
|
|
|
923
924
|
{
|
|
924
925
|
path: `${l}/authors`,
|
|
925
926
|
name: "webx.blog.authors",
|
|
926
|
-
component: () => import("./AuthorsPage-
|
|
927
|
+
component: () => import("./AuthorsPage-DSLsX44M.js"),
|
|
927
928
|
props: { base: l }
|
|
928
929
|
}
|
|
929
930
|
]
|
|
930
931
|
}
|
|
931
932
|
];
|
|
932
933
|
}
|
|
933
|
-
function
|
|
934
|
+
function Rt(n) {
|
|
934
935
|
const l = `${n.apiPath}/blog/authors`, o = (i) => i.data;
|
|
935
936
|
return {
|
|
936
937
|
list: (i = "") => {
|
|
@@ -945,10 +946,10 @@ function Mt(n) {
|
|
|
945
946
|
})
|
|
946
947
|
};
|
|
947
948
|
}
|
|
948
|
-
const
|
|
949
|
+
const Ut = {
|
|
949
950
|
key: 1,
|
|
950
951
|
class: "wx-author__account"
|
|
951
|
-
},
|
|
952
|
+
}, It = /* @__PURE__ */ z({
|
|
952
953
|
name: "WxAuthorPane",
|
|
953
954
|
__name: "AuthorPane",
|
|
954
955
|
props: {
|
|
@@ -957,34 +958,34 @@ const Pt = {
|
|
|
957
958
|
},
|
|
958
959
|
emits: ["back", "saved", "created", "removed"],
|
|
959
960
|
setup(n, { emit: l }) {
|
|
960
|
-
const o = n, i = l, t = K(), a =
|
|
961
|
+
const o = n, i = l, t = K(), a = Rt(t), r = Je(), u = Ae();
|
|
961
962
|
F();
|
|
962
|
-
const s = H("webx-blog"),
|
|
963
|
-
() => x.value !== "" && (
|
|
964
|
-
),
|
|
965
|
-
const
|
|
966
|
-
return
|
|
967
|
-
}),
|
|
968
|
-
() => w.value.map((
|
|
969
|
-
label:
|
|
970
|
-
value:
|
|
963
|
+
const s = H("webx-blog"), m = Z(), c = A(null), g = A({}), x = A(""), w = A([]), p = A(null), f = A(!0), M = A(!1), I = A({}), D = $(() => t.can("blog.authors.manage")), d = $(() => JSON.stringify(g.value)), k = $(
|
|
964
|
+
() => x.value !== "" && (d.value !== x.value || p.value !== null)
|
|
965
|
+
), S = $(() => M.value ? "saving" : k.value || o.id === null ? "unsaved" : "saved"), b = $(() => {
|
|
966
|
+
const h = g.value.title, T = o.id === null ? s("author.new") : c.value?.name ?? "";
|
|
967
|
+
return et(h, u.active.value, T) || s("author.untitled");
|
|
968
|
+
}), V = $(
|
|
969
|
+
() => w.value.map((h) => ({
|
|
970
|
+
label: h.articles_count > 0 ? `${h.name} · ${s("author.articles", { count: h.articles_count })}` : h.name,
|
|
971
|
+
value: h.id
|
|
971
972
|
}))
|
|
972
|
-
),
|
|
973
|
-
get: () =>
|
|
974
|
-
set: (
|
|
975
|
-
|
|
976
|
-
const
|
|
977
|
-
|
|
973
|
+
), R = $({
|
|
974
|
+
get: () => p.value,
|
|
975
|
+
set: (h) => {
|
|
976
|
+
p.value = typeof h == "number" ? h : null;
|
|
977
|
+
const T = w.value.find((Ne) => Ne.id === p.value), B = g.value.title, se = u.list.value[0]?.code;
|
|
978
|
+
T && se && !(B?.[se] ?? "").trim() && (g.value = { ...g.value, title: { ...B ?? {}, [se]: T.name } });
|
|
978
979
|
}
|
|
979
980
|
});
|
|
980
|
-
function oe(
|
|
981
|
-
c.value =
|
|
981
|
+
function oe(h) {
|
|
982
|
+
c.value = h.author, g.value = h.values, x.value = JSON.stringify(h.values), p.value = null;
|
|
982
983
|
}
|
|
983
984
|
async function Ve() {
|
|
984
985
|
f.value = !0;
|
|
985
986
|
try {
|
|
986
987
|
if (o.id === null) {
|
|
987
|
-
const
|
|
988
|
+
const h = {
|
|
988
989
|
title: {},
|
|
989
990
|
slug: {},
|
|
990
991
|
role: {},
|
|
@@ -993,64 +994,64 @@ const Pt = {
|
|
|
993
994
|
socials: [],
|
|
994
995
|
is_public: !1
|
|
995
996
|
};
|
|
996
|
-
|
|
997
|
-
const
|
|
998
|
-
w.value.some((B) => B.id ===
|
|
997
|
+
g.value = h, x.value = JSON.stringify(h), w.value = await a.accounts();
|
|
998
|
+
const T = Number(r.query.account);
|
|
999
|
+
w.value.some((B) => B.id === T) && (R.value = T);
|
|
999
1000
|
} else
|
|
1000
1001
|
oe(await a.get(o.id));
|
|
1001
|
-
} catch (
|
|
1002
|
-
|
|
1002
|
+
} catch (h) {
|
|
1003
|
+
P.danger(m(h)), i("back");
|
|
1003
1004
|
} finally {
|
|
1004
1005
|
f.value = !1;
|
|
1005
1006
|
}
|
|
1006
1007
|
}
|
|
1007
1008
|
async function be() {
|
|
1008
|
-
if (!(M.value || !
|
|
1009
|
-
M.value = !0,
|
|
1009
|
+
if (!(M.value || !D.value)) {
|
|
1010
|
+
M.value = !0, I.value = {};
|
|
1010
1011
|
try {
|
|
1011
|
-
const
|
|
1012
|
-
if (
|
|
1013
|
-
|
|
1012
|
+
const h = o.id === null;
|
|
1013
|
+
if (h && p.value === null) {
|
|
1014
|
+
I.value = { user_id: [s("author.account-missing")] }, P.danger(s("author.save-failed"));
|
|
1014
1015
|
return;
|
|
1015
1016
|
}
|
|
1016
|
-
const
|
|
1017
|
-
oe(
|
|
1018
|
-
} catch (
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1017
|
+
const T = h ? await a.create(p.value, g.value) : await a.save(o.id, g.value);
|
|
1018
|
+
oe(T), P.success(s("author.saved")), i(h ? "created" : "saved", T.author);
|
|
1019
|
+
} catch (h) {
|
|
1020
|
+
const T = h.body;
|
|
1021
|
+
T?.errors ? (I.value = T.errors, P.danger(s("author.save-failed"))) : P.danger(m(h));
|
|
1021
1022
|
} finally {
|
|
1022
1023
|
M.value = !1;
|
|
1023
1024
|
}
|
|
1024
1025
|
}
|
|
1025
1026
|
}
|
|
1026
1027
|
async function Ce() {
|
|
1027
|
-
const
|
|
1028
|
-
if (!(!
|
|
1029
|
-
title: s("author.delete-title", { name:
|
|
1028
|
+
const h = c.value;
|
|
1029
|
+
if (!(!h || !await te({
|
|
1030
|
+
title: s("author.delete-title", { name: h.name }),
|
|
1030
1031
|
message: s("author.delete-text"),
|
|
1031
1032
|
confirmText: s("author.delete"),
|
|
1032
1033
|
cancelText: s("author.cancel"),
|
|
1033
1034
|
tone: "danger"
|
|
1034
1035
|
})))
|
|
1035
1036
|
try {
|
|
1036
|
-
await a.remove(
|
|
1037
|
+
await a.remove(h.id), P.success(s("author.deleted")), x.value = d.value, p.value = null, i("removed", h.id);
|
|
1037
1038
|
} catch (B) {
|
|
1038
|
-
|
|
1039
|
+
P.danger(m(B));
|
|
1039
1040
|
}
|
|
1040
1041
|
}
|
|
1041
|
-
function we(
|
|
1042
|
-
|
|
1042
|
+
function we(h) {
|
|
1043
|
+
k.value && h.preventDefault();
|
|
1043
1044
|
}
|
|
1044
|
-
function ye(
|
|
1045
|
-
(
|
|
1045
|
+
function ye(h) {
|
|
1046
|
+
(h.ctrlKey || h.metaKey) && h.key.toLowerCase() === "s" && (h.preventDefault(), (k.value || o.id === null) && be());
|
|
1046
1047
|
}
|
|
1047
|
-
|
|
1048
|
+
Ke(ye), he(() => {
|
|
1048
1049
|
Ve(), window.addEventListener("beforeunload", we);
|
|
1049
1050
|
}), de(() => {
|
|
1050
1051
|
window.removeEventListener("beforeunload", we);
|
|
1051
1052
|
});
|
|
1052
1053
|
async function xe() {
|
|
1053
|
-
return
|
|
1054
|
+
return !k.value || !D.value ? !0 : await te({
|
|
1054
1055
|
title: s("author.leave-title"),
|
|
1055
1056
|
message: s("author.leave-text"),
|
|
1056
1057
|
confirmText: s("author.leave"),
|
|
@@ -1058,19 +1059,19 @@ const Pt = {
|
|
|
1058
1059
|
tone: "danger"
|
|
1059
1060
|
});
|
|
1060
1061
|
}
|
|
1061
|
-
|
|
1062
|
-
async (
|
|
1063
|
-
),
|
|
1064
|
-
const We =
|
|
1065
|
-
const
|
|
1066
|
-
return
|
|
1062
|
+
Ze(
|
|
1063
|
+
async (h, T) => h.query.author === T.query.author ? !0 : await xe()
|
|
1064
|
+
), Qe(xe);
|
|
1065
|
+
const We = $(() => {
|
|
1066
|
+
const h = [], T = c.value;
|
|
1067
|
+
return T?.open && T.url && h.push({
|
|
1067
1068
|
key: "open",
|
|
1068
1069
|
label: s("author.open-page"),
|
|
1069
1070
|
icon: "external-link",
|
|
1070
1071
|
run: () => {
|
|
1071
|
-
window.open(
|
|
1072
|
+
window.open(T.url, "_blank", "noopener");
|
|
1072
1073
|
}
|
|
1073
|
-
}),
|
|
1074
|
+
}), D.value && T !== null && h.push({
|
|
1074
1075
|
key: "delete",
|
|
1075
1076
|
label: s("author.delete"),
|
|
1076
1077
|
icon: "trash",
|
|
@@ -1079,33 +1080,33 @@ const Pt = {
|
|
|
1079
1080
|
run: () => {
|
|
1080
1081
|
Ce();
|
|
1081
1082
|
}
|
|
1082
|
-
}),
|
|
1083
|
+
}), h;
|
|
1083
1084
|
});
|
|
1084
|
-
return (
|
|
1085
|
+
return (h, T) => (_(), U("div", {
|
|
1085
1086
|
class: "wx-author",
|
|
1086
1087
|
onKeydown: ye
|
|
1087
1088
|
}, [
|
|
1088
|
-
f.value ? (
|
|
1089
|
+
f.value ? (_(), W(e(Te), {
|
|
1089
1090
|
key: 0,
|
|
1090
1091
|
class: "wx-author__ghost",
|
|
1091
1092
|
title: "",
|
|
1092
1093
|
rows: 6
|
|
1093
|
-
})) : (
|
|
1094
|
-
|
|
1094
|
+
})) : (_(), U(Y, { key: 1 }, [
|
|
1095
|
+
y(e(He), {
|
|
1095
1096
|
level: 3,
|
|
1096
1097
|
back: !o.inline,
|
|
1097
1098
|
"back-label": e(s)("author.back"),
|
|
1098
|
-
title:
|
|
1099
|
+
title: b.value,
|
|
1099
1100
|
actions: We.value,
|
|
1100
1101
|
"collapse-below": 480,
|
|
1101
|
-
onBack:
|
|
1102
|
-
},
|
|
1102
|
+
onBack: T[0] || (T[0] = (B) => i("back"))
|
|
1103
|
+
}, Le({ _: 2 }, [
|
|
1103
1104
|
c.value && !c.value.open ? {
|
|
1104
1105
|
name: "title-after",
|
|
1105
|
-
fn:
|
|
1106
|
-
|
|
1107
|
-
default:
|
|
1108
|
-
|
|
1106
|
+
fn: v(() => [
|
|
1107
|
+
y(e(q), { dot: "" }, {
|
|
1108
|
+
default: v(() => [
|
|
1109
|
+
N(C(e(s)("author.page-closed")), 1)
|
|
1109
1110
|
]),
|
|
1110
1111
|
_: 1
|
|
1111
1112
|
})
|
|
@@ -1113,20 +1114,20 @@ const Pt = {
|
|
|
1113
1114
|
key: "0"
|
|
1114
1115
|
} : void 0
|
|
1115
1116
|
]), 1032, ["back", "back-label", "title", "actions"]),
|
|
1116
|
-
o.id === null ? (
|
|
1117
|
-
default:
|
|
1118
|
-
|
|
1117
|
+
o.id === null ? (_(), W(e(tt), { key: 0 }, {
|
|
1118
|
+
default: v(() => [
|
|
1119
|
+
y(e(J), {
|
|
1119
1120
|
label: e(s)("author.account"),
|
|
1120
1121
|
help: w.value.length === 0 ? e(s)("author.no-accounts") : e(s)("author.account-help"),
|
|
1121
|
-
error:
|
|
1122
|
+
error: I.value.user_id?.[0],
|
|
1122
1123
|
required: ""
|
|
1123
1124
|
}, {
|
|
1124
|
-
default:
|
|
1125
|
-
|
|
1126
|
-
modelValue:
|
|
1127
|
-
"onUpdate:modelValue":
|
|
1128
|
-
options:
|
|
1129
|
-
disabled: !
|
|
1125
|
+
default: v(() => [
|
|
1126
|
+
y(e(ee), {
|
|
1127
|
+
modelValue: R.value,
|
|
1128
|
+
"onUpdate:modelValue": T[1] || (T[1] = (B) => R.value = B),
|
|
1129
|
+
options: V.value,
|
|
1130
|
+
disabled: !D.value || M.value || w.value.length === 0,
|
|
1130
1131
|
filterable: "",
|
|
1131
1132
|
teleport: "",
|
|
1132
1133
|
"aria-label": e(s)("author.account")
|
|
@@ -1136,27 +1137,27 @@ const Pt = {
|
|
|
1136
1137
|
}, 8, ["label", "help", "error"])
|
|
1137
1138
|
]),
|
|
1138
1139
|
_: 1
|
|
1139
|
-
})) : c.value?.user ? (
|
|
1140
|
-
|
|
1141
|
-
modelValue:
|
|
1142
|
-
"onUpdate:modelValue":
|
|
1140
|
+
})) : c.value?.user ? (_(), U("p", Ut, C(e(s)("author.account")) + ": " + C(c.value.user.name), 1)) : L("", !0),
|
|
1141
|
+
y(e(Fe), {
|
|
1142
|
+
modelValue: g.value,
|
|
1143
|
+
"onUpdate:modelValue": T[2] || (T[2] = (B) => g.value = B),
|
|
1143
1144
|
name: "blog.author-form",
|
|
1144
|
-
errors:
|
|
1145
|
-
disabled: !
|
|
1145
|
+
errors: I.value,
|
|
1146
|
+
disabled: !D.value || M.value
|
|
1146
1147
|
}, null, 8, ["modelValue", "errors", "disabled"]),
|
|
1147
|
-
|
|
1148
|
-
state:
|
|
1149
|
-
|
|
1148
|
+
D.value ? (_(), W(e(at), { key: 2 }, {
|
|
1149
|
+
state: v(() => [
|
|
1150
|
+
y(e(je), { state: S.value }, null, 8, ["state"])
|
|
1150
1151
|
]),
|
|
1151
|
-
default:
|
|
1152
|
-
|
|
1152
|
+
default: v(() => [
|
|
1153
|
+
y(e(O), {
|
|
1153
1154
|
type: "primary",
|
|
1154
1155
|
loading: M.value,
|
|
1155
|
-
disabled:
|
|
1156
|
+
disabled: !k.value && o.id !== null,
|
|
1156
1157
|
onClick: be
|
|
1157
1158
|
}, {
|
|
1158
|
-
default:
|
|
1159
|
-
|
|
1159
|
+
default: v(() => [
|
|
1160
|
+
N(C(e(s)("author.save")), 1)
|
|
1160
1161
|
]),
|
|
1161
1162
|
_: 1
|
|
1162
1163
|
}, 8, ["loading", "disabled"])
|
|
@@ -1166,18 +1167,18 @@ const Pt = {
|
|
|
1166
1167
|
], 64))
|
|
1167
1168
|
], 32));
|
|
1168
1169
|
}
|
|
1169
|
-
}),
|
|
1170
|
+
}), Gt = /* @__PURE__ */ j(It, [["__scopeId", "data-v-60f7aa2e"]]), Jt = /* @__PURE__ */ z({
|
|
1170
1171
|
__name: "TagCreateDialog",
|
|
1171
1172
|
setup(n) {
|
|
1172
1173
|
const { open: l, resolve: o, dismiss: i } = ge(), t = K(), a = G(t);
|
|
1173
1174
|
F();
|
|
1174
|
-
const r = H("webx-blog"), u =
|
|
1175
|
+
const r = H("webx-blog"), u = A(""), s = A(""), m = A(!1), c = A({}), g = ke("field");
|
|
1175
1176
|
he(async () => {
|
|
1176
|
-
await $e(),
|
|
1177
|
+
await $e(), g.value?.querySelector("input")?.focus();
|
|
1177
1178
|
});
|
|
1178
1179
|
async function x() {
|
|
1179
|
-
if (!(u.value.trim() === "" ||
|
|
1180
|
-
|
|
1180
|
+
if (!(u.value.trim() === "" || m.value)) {
|
|
1181
|
+
m.value = !0, c.value = {};
|
|
1181
1182
|
try {
|
|
1182
1183
|
o(
|
|
1183
1184
|
await a.createTag({
|
|
@@ -1188,36 +1189,36 @@ const Pt = {
|
|
|
1188
1189
|
} catch (w) {
|
|
1189
1190
|
c.value = w.body?.errors ?? {};
|
|
1190
1191
|
} finally {
|
|
1191
|
-
|
|
1192
|
+
m.value = !1;
|
|
1192
1193
|
}
|
|
1193
1194
|
}
|
|
1194
1195
|
}
|
|
1195
|
-
return (w,
|
|
1196
|
+
return (w, p) => (_(), W(e(me), {
|
|
1196
1197
|
open: e(l),
|
|
1197
|
-
"onUpdate:open":
|
|
1198
|
+
"onUpdate:open": p[3] || (p[3] = (f) => pe(l) ? l.value = f : null),
|
|
1198
1199
|
title: e(r)("tag.new-title"),
|
|
1199
1200
|
width: 440
|
|
1200
1201
|
}, {
|
|
1201
|
-
footer:
|
|
1202
|
-
|
|
1203
|
-
default:
|
|
1204
|
-
|
|
1202
|
+
footer: v(() => [
|
|
1203
|
+
y(e(fe), { size: "sm" }, {
|
|
1204
|
+
default: v(() => [
|
|
1205
|
+
y(e(O), {
|
|
1205
1206
|
variant: "outline",
|
|
1206
|
-
onClick:
|
|
1207
|
+
onClick: p[2] || (p[2] = (f) => e(i)())
|
|
1207
1208
|
}, {
|
|
1208
|
-
default:
|
|
1209
|
-
|
|
1209
|
+
default: v(() => [
|
|
1210
|
+
N(C(e(r)("tag.cancel")), 1)
|
|
1210
1211
|
]),
|
|
1211
1212
|
_: 1
|
|
1212
1213
|
}),
|
|
1213
|
-
|
|
1214
|
+
y(e(O), {
|
|
1214
1215
|
type: "primary",
|
|
1215
|
-
loading:
|
|
1216
|
+
loading: m.value,
|
|
1216
1217
|
disabled: u.value.trim() === "",
|
|
1217
1218
|
onClick: x
|
|
1218
1219
|
}, {
|
|
1219
|
-
default:
|
|
1220
|
-
|
|
1220
|
+
default: v(() => [
|
|
1221
|
+
N(C(e(r)("tag.create")), 1)
|
|
1221
1222
|
]),
|
|
1222
1223
|
_: 1
|
|
1223
1224
|
}, 8, ["loading", "disabled"])
|
|
@@ -1225,20 +1226,20 @@ const Pt = {
|
|
|
1225
1226
|
_: 1
|
|
1226
1227
|
})
|
|
1227
1228
|
]),
|
|
1228
|
-
default:
|
|
1229
|
-
|
|
1229
|
+
default: v(() => [
|
|
1230
|
+
y(e(J), {
|
|
1230
1231
|
label: e(r)("tag.field-title"),
|
|
1231
1232
|
error: c.value.title?.[0],
|
|
1232
1233
|
required: ""
|
|
1233
1234
|
}, {
|
|
1234
|
-
default:
|
|
1235
|
+
default: v(() => [
|
|
1235
1236
|
E("div", {
|
|
1236
1237
|
ref_key: "field",
|
|
1237
|
-
ref:
|
|
1238
|
+
ref: g
|
|
1238
1239
|
}, [
|
|
1239
|
-
|
|
1240
|
+
y(e(ae), {
|
|
1240
1241
|
modelValue: u.value,
|
|
1241
|
-
"onUpdate:modelValue":
|
|
1242
|
+
"onUpdate:modelValue": p[0] || (p[0] = (f) => u.value = f),
|
|
1242
1243
|
"aria-label": e(r)("tag.field-title"),
|
|
1243
1244
|
onKeyup: ie(x, ["enter"])
|
|
1244
1245
|
}, null, 8, ["modelValue", "aria-label"])
|
|
@@ -1246,15 +1247,15 @@ const Pt = {
|
|
|
1246
1247
|
]),
|
|
1247
1248
|
_: 1
|
|
1248
1249
|
}, 8, ["label", "error"]),
|
|
1249
|
-
|
|
1250
|
+
y(e(J), {
|
|
1250
1251
|
label: e(r)("tag.field-slug"),
|
|
1251
1252
|
error: c.value.slug?.[0],
|
|
1252
1253
|
help: e(r)("tag.field-slug-help")
|
|
1253
1254
|
}, {
|
|
1254
|
-
default:
|
|
1255
|
-
|
|
1255
|
+
default: v(() => [
|
|
1256
|
+
y(e(ae), {
|
|
1256
1257
|
modelValue: s.value,
|
|
1257
|
-
"onUpdate:modelValue":
|
|
1258
|
+
"onUpdate:modelValue": p[1] || (p[1] = (f) => s.value = f),
|
|
1258
1259
|
"aria-label": e(r)("tag.field-slug"),
|
|
1259
1260
|
onKeyup: ie(x, ["enter"])
|
|
1260
1261
|
}, null, 8, ["modelValue", "aria-label"])
|
|
@@ -1265,7 +1266,7 @@ const Pt = {
|
|
|
1265
1266
|
_: 1
|
|
1266
1267
|
}, 8, ["open", "title"]));
|
|
1267
1268
|
}
|
|
1268
|
-
}),
|
|
1269
|
+
}), Dt = { class: "wx-tag-merge" }, Lt = { class: "wx-tag-merge__chips" }, Bt = { class: "wx-tag-merge__redirect" }, Et = /* @__PURE__ */ z({
|
|
1269
1270
|
__name: "TagMergeDialog",
|
|
1270
1271
|
props: {
|
|
1271
1272
|
tags: {}
|
|
@@ -1273,55 +1274,55 @@ const Pt = {
|
|
|
1273
1274
|
setup(n) {
|
|
1274
1275
|
const l = n, { open: o, resolve: i, dismiss: t } = ge(), a = K(), r = G(a);
|
|
1275
1276
|
F();
|
|
1276
|
-
const u = H("webx-blog"), s = Z(),
|
|
1277
|
-
[...l.tags].sort((
|
|
1278
|
-
), c =
|
|
1279
|
-
() => l.tags.map((
|
|
1280
|
-
),
|
|
1281
|
-
async function
|
|
1282
|
-
if (!(
|
|
1277
|
+
const u = H("webx-blog"), s = Z(), m = A(
|
|
1278
|
+
[...l.tags].sort((d, k) => k.articles_count - d.articles_count)[0]?.id ?? 0
|
|
1279
|
+
), c = A(!1), g = A(!0), x = A(null), w = $(
|
|
1280
|
+
() => l.tags.map((d) => ({ value: d.id, label: `${d.title} · ${d.articles_count}` }))
|
|
1281
|
+
), p = $(() => l.tags.find((d) => d.id === m.value) ?? null), f = $(() => l.tags.filter((d) => d.id !== m.value)), M = $(() => f.value.reduce((d, k) => d + k.articles_count, 0)), I = $(() => f.value.map((d) => d.path).filter(Boolean));
|
|
1282
|
+
async function D() {
|
|
1283
|
+
if (!(p.value === null || f.value.length === 0 || c.value)) {
|
|
1283
1284
|
c.value = !0, x.value = null;
|
|
1284
1285
|
try {
|
|
1285
1286
|
i(
|
|
1286
1287
|
await r.mergeTags(
|
|
1287
|
-
f.value.map((
|
|
1288
|
-
|
|
1289
|
-
|
|
1288
|
+
f.value.map((d) => d.id),
|
|
1289
|
+
m.value,
|
|
1290
|
+
g.value
|
|
1290
1291
|
)
|
|
1291
1292
|
);
|
|
1292
|
-
} catch (
|
|
1293
|
-
x.value = s(
|
|
1293
|
+
} catch (d) {
|
|
1294
|
+
x.value = s(d);
|
|
1294
1295
|
} finally {
|
|
1295
1296
|
c.value = !1;
|
|
1296
1297
|
}
|
|
1297
1298
|
}
|
|
1298
1299
|
}
|
|
1299
|
-
return (
|
|
1300
|
+
return (d, k) => (_(), W(e(me), {
|
|
1300
1301
|
open: e(o),
|
|
1301
|
-
"onUpdate:open":
|
|
1302
|
+
"onUpdate:open": k[3] || (k[3] = (S) => pe(o) ? o.value = S : null),
|
|
1302
1303
|
title: e(u)("tag.merge-title"),
|
|
1303
1304
|
width: 520
|
|
1304
1305
|
}, {
|
|
1305
|
-
footer:
|
|
1306
|
-
|
|
1307
|
-
default:
|
|
1308
|
-
|
|
1306
|
+
footer: v(() => [
|
|
1307
|
+
y(e(fe), { size: "sm" }, {
|
|
1308
|
+
default: v(() => [
|
|
1309
|
+
y(e(O), {
|
|
1309
1310
|
variant: "outline",
|
|
1310
|
-
onClick:
|
|
1311
|
+
onClick: k[2] || (k[2] = (S) => e(t)())
|
|
1311
1312
|
}, {
|
|
1312
|
-
default:
|
|
1313
|
-
|
|
1313
|
+
default: v(() => [
|
|
1314
|
+
N(C(e(u)("tag.cancel")), 1)
|
|
1314
1315
|
]),
|
|
1315
1316
|
_: 1
|
|
1316
1317
|
}),
|
|
1317
|
-
|
|
1318
|
+
y(e(O), {
|
|
1318
1319
|
type: "primary",
|
|
1319
1320
|
loading: c.value,
|
|
1320
1321
|
disabled: f.value.length === 0,
|
|
1321
|
-
onClick:
|
|
1322
|
+
onClick: D
|
|
1322
1323
|
}, {
|
|
1323
|
-
default:
|
|
1324
|
-
|
|
1324
|
+
default: v(() => [
|
|
1325
|
+
N(C(e(u)("tag.merge-confirm")), 1)
|
|
1325
1326
|
]),
|
|
1326
1327
|
_: 1
|
|
1327
1328
|
}, 8, ["loading", "disabled"])
|
|
@@ -1329,74 +1330,74 @@ const Pt = {
|
|
|
1329
1330
|
_: 1
|
|
1330
1331
|
})
|
|
1331
1332
|
]),
|
|
1332
|
-
default:
|
|
1333
|
-
E("div",
|
|
1334
|
-
E("div",
|
|
1335
|
-
(
|
|
1336
|
-
key:
|
|
1333
|
+
default: v(() => [
|
|
1334
|
+
E("div", Dt, [
|
|
1335
|
+
E("div", Lt, [
|
|
1336
|
+
(_(!0), U(Y, null, ce(f.value, (S) => (_(), W(e(q), {
|
|
1337
|
+
key: S.id,
|
|
1337
1338
|
size: "sm",
|
|
1338
1339
|
round: ""
|
|
1339
1340
|
}, {
|
|
1340
|
-
default:
|
|
1341
|
-
|
|
1341
|
+
default: v(() => [
|
|
1342
|
+
N(C(S.title) + " · " + C(S.articles_count), 1)
|
|
1342
1343
|
]),
|
|
1343
1344
|
_: 2
|
|
1344
1345
|
}, 1024))), 128)),
|
|
1345
|
-
|
|
1346
|
+
y(e(lt), {
|
|
1346
1347
|
name: "arrow-right",
|
|
1347
1348
|
size: "sm"
|
|
1348
1349
|
}),
|
|
1349
|
-
|
|
1350
|
+
p.value ? (_(), W(e(q), {
|
|
1350
1351
|
key: 0,
|
|
1351
1352
|
type: "primary",
|
|
1352
1353
|
size: "sm",
|
|
1353
1354
|
round: ""
|
|
1354
1355
|
}, {
|
|
1355
|
-
default:
|
|
1356
|
-
|
|
1356
|
+
default: v(() => [
|
|
1357
|
+
N(C(p.value.title) + " · " + C(p.value.articles_count), 1)
|
|
1357
1358
|
]),
|
|
1358
1359
|
_: 1
|
|
1359
1360
|
})) : L("", !0)
|
|
1360
1361
|
]),
|
|
1361
|
-
|
|
1362
|
+
y(e(J), {
|
|
1362
1363
|
label: e(u)("tag.merge-keep")
|
|
1363
1364
|
}, {
|
|
1364
|
-
default:
|
|
1365
|
-
|
|
1366
|
-
modelValue:
|
|
1367
|
-
"onUpdate:modelValue":
|
|
1365
|
+
default: v(() => [
|
|
1366
|
+
y(e(ee), {
|
|
1367
|
+
modelValue: m.value,
|
|
1368
|
+
"onUpdate:modelValue": k[0] || (k[0] = (S) => m.value = S),
|
|
1368
1369
|
options: w.value,
|
|
1369
1370
|
"aria-label": e(u)("tag.merge-keep")
|
|
1370
1371
|
}, null, 8, ["modelValue", "options", "aria-label"])
|
|
1371
1372
|
]),
|
|
1372
1373
|
_: 1
|
|
1373
1374
|
}, 8, ["label"]),
|
|
1374
|
-
E("div",
|
|
1375
|
-
|
|
1376
|
-
modelValue:
|
|
1377
|
-
"onUpdate:modelValue":
|
|
1375
|
+
E("div", Bt, [
|
|
1376
|
+
y(e(ot), {
|
|
1377
|
+
modelValue: g.value,
|
|
1378
|
+
"onUpdate:modelValue": k[1] || (k[1] = (S) => g.value = S),
|
|
1378
1379
|
label: e(u)("tag.merge-redirect")
|
|
1379
1380
|
}, null, 8, ["modelValue", "label"]),
|
|
1380
|
-
|
|
1381
|
+
y(e(ve), {
|
|
1381
1382
|
size: "sm",
|
|
1382
1383
|
tone: "muted"
|
|
1383
1384
|
}, {
|
|
1384
|
-
default:
|
|
1385
|
-
|
|
1385
|
+
default: v(() => [
|
|
1386
|
+
N(C(I.value.length === 0 ? e(u)("tag.merge-redirect-none") : e(u)("tag.merge-redirect-help", { addresses: I.value.join(", ") })), 1)
|
|
1386
1387
|
]),
|
|
1387
1388
|
_: 1
|
|
1388
1389
|
})
|
|
1389
1390
|
]),
|
|
1390
|
-
|
|
1391
|
+
y(e(ne), {
|
|
1391
1392
|
type: "warning",
|
|
1392
1393
|
variant: "soft",
|
|
1393
1394
|
description: e(u)("tag.merge-warning", {
|
|
1394
1395
|
count: M.value,
|
|
1395
|
-
tag:
|
|
1396
|
+
tag: p.value?.title ?? "",
|
|
1396
1397
|
merged: f.value.length
|
|
1397
1398
|
})
|
|
1398
1399
|
}, null, 8, ["description"]),
|
|
1399
|
-
x.value ? (
|
|
1400
|
+
x.value ? (_(), W(e(ne), {
|
|
1400
1401
|
key: 0,
|
|
1401
1402
|
type: "danger",
|
|
1402
1403
|
variant: "soft",
|
|
@@ -1407,53 +1408,53 @@ const Pt = {
|
|
|
1407
1408
|
_: 1
|
|
1408
1409
|
}, 8, ["open", "title"]));
|
|
1409
1410
|
}
|
|
1410
|
-
}),
|
|
1411
|
+
}), Zt = /* @__PURE__ */ j(Et, [["__scopeId", "data-v-aa68b3a8"]]), Qt = /* @__PURE__ */ z({
|
|
1411
1412
|
__name: "ArticleCreateDialog",
|
|
1412
1413
|
setup(n) {
|
|
1413
1414
|
const { open: l, resolve: o, dismiss: i } = ge(), t = K(), a = G(t);
|
|
1414
1415
|
F();
|
|
1415
|
-
const r = H("webx-blog"), u =
|
|
1416
|
+
const r = H("webx-blog"), u = A(""), s = A(!1), m = A({}), c = ke("field");
|
|
1416
1417
|
he(async () => {
|
|
1417
1418
|
await $e(), c.value?.querySelector("input")?.focus();
|
|
1418
1419
|
});
|
|
1419
|
-
async function
|
|
1420
|
+
async function g() {
|
|
1420
1421
|
if (!(u.value.trim() === "" || s.value)) {
|
|
1421
|
-
s.value = !0,
|
|
1422
|
+
s.value = !0, m.value = {};
|
|
1422
1423
|
try {
|
|
1423
1424
|
o(await a.create({ title: u.value.trim() }));
|
|
1424
1425
|
} catch (x) {
|
|
1425
|
-
|
|
1426
|
+
m.value = x.body?.errors ?? {};
|
|
1426
1427
|
} finally {
|
|
1427
1428
|
s.value = !1;
|
|
1428
1429
|
}
|
|
1429
1430
|
}
|
|
1430
1431
|
}
|
|
1431
|
-
return (x, w) => (
|
|
1432
|
+
return (x, w) => (_(), W(e(me), {
|
|
1432
1433
|
open: e(l),
|
|
1433
|
-
"onUpdate:open": w[2] || (w[2] = (
|
|
1434
|
+
"onUpdate:open": w[2] || (w[2] = (p) => pe(l) ? l.value = p : null),
|
|
1434
1435
|
title: e(r)("panel.new-title"),
|
|
1435
1436
|
width: 440
|
|
1436
1437
|
}, {
|
|
1437
|
-
footer:
|
|
1438
|
-
|
|
1439
|
-
default:
|
|
1440
|
-
|
|
1438
|
+
footer: v(() => [
|
|
1439
|
+
y(e(fe), { size: "sm" }, {
|
|
1440
|
+
default: v(() => [
|
|
1441
|
+
y(e(O), {
|
|
1441
1442
|
variant: "outline",
|
|
1442
|
-
onClick: w[1] || (w[1] = (
|
|
1443
|
+
onClick: w[1] || (w[1] = (p) => e(i)())
|
|
1443
1444
|
}, {
|
|
1444
|
-
default:
|
|
1445
|
-
|
|
1445
|
+
default: v(() => [
|
|
1446
|
+
N(C(e(r)("panel.cancel")), 1)
|
|
1446
1447
|
]),
|
|
1447
1448
|
_: 1
|
|
1448
1449
|
}),
|
|
1449
|
-
|
|
1450
|
+
y(e(O), {
|
|
1450
1451
|
type: "primary",
|
|
1451
1452
|
loading: s.value,
|
|
1452
1453
|
disabled: u.value.trim() === "",
|
|
1453
|
-
onClick:
|
|
1454
|
+
onClick: g
|
|
1454
1455
|
}, {
|
|
1455
|
-
default:
|
|
1456
|
-
|
|
1456
|
+
default: v(() => [
|
|
1457
|
+
N(C(e(r)("panel.create")), 1)
|
|
1457
1458
|
]),
|
|
1458
1459
|
_: 1
|
|
1459
1460
|
}, 8, ["loading", "disabled"])
|
|
@@ -1461,22 +1462,22 @@ const Pt = {
|
|
|
1461
1462
|
_: 1
|
|
1462
1463
|
})
|
|
1463
1464
|
]),
|
|
1464
|
-
default:
|
|
1465
|
-
|
|
1465
|
+
default: v(() => [
|
|
1466
|
+
y(e(J), {
|
|
1466
1467
|
label: e(r)("panel.field-title"),
|
|
1467
|
-
error:
|
|
1468
|
+
error: m.value.title?.[0] ?? m.value.slug?.[0],
|
|
1468
1469
|
required: ""
|
|
1469
1470
|
}, {
|
|
1470
|
-
default:
|
|
1471
|
+
default: v(() => [
|
|
1471
1472
|
E("div", {
|
|
1472
1473
|
ref_key: "field",
|
|
1473
1474
|
ref: c
|
|
1474
1475
|
}, [
|
|
1475
|
-
|
|
1476
|
+
y(e(ae), {
|
|
1476
1477
|
modelValue: u.value,
|
|
1477
|
-
"onUpdate:modelValue": w[0] || (w[0] = (
|
|
1478
|
+
"onUpdate:modelValue": w[0] || (w[0] = (p) => u.value = p),
|
|
1478
1479
|
"aria-label": e(r)("panel.field-title"),
|
|
1479
|
-
onKeyup: ie(
|
|
1480
|
+
onKeyup: ie(g, ["enter"])
|
|
1480
1481
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1481
1482
|
], 512)
|
|
1482
1483
|
]),
|
|
@@ -1486,31 +1487,31 @@ const Pt = {
|
|
|
1486
1487
|
_: 1
|
|
1487
1488
|
}, 8, ["open", "title"]));
|
|
1488
1489
|
}
|
|
1489
|
-
}),
|
|
1490
|
+
}), Xt = le(() => import("./ArticlesPage-BnHi8gF0.js")), Yt = le(() => import("./TagsPage-BnLVnx5a.js")), qt = le(() => import("./AuthorsPage-DSLsX44M.js")), ea = le(() => import("./ArticleEditorPage-Bkb5YrLy.js"));
|
|
1490
1491
|
export {
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1492
|
+
Gt as A,
|
|
1493
|
+
Zt as T,
|
|
1494
|
+
ea as W,
|
|
1495
|
+
Qt as _,
|
|
1495
1496
|
j as a,
|
|
1496
|
-
|
|
1497
|
+
Jt as b,
|
|
1497
1498
|
G as c,
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1499
|
+
Rt as d,
|
|
1500
|
+
rt as e,
|
|
1501
|
+
vt as f,
|
|
1502
|
+
yt as g,
|
|
1503
|
+
$t as h,
|
|
1504
|
+
Wt as i,
|
|
1505
|
+
Mt as j,
|
|
1506
|
+
Xt as k,
|
|
1507
|
+
qt as l,
|
|
1508
|
+
Yt as m,
|
|
1508
1509
|
Se as n,
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1510
|
+
jt as o,
|
|
1511
|
+
Ft as p,
|
|
1512
|
+
st as q,
|
|
1513
|
+
Pt as r,
|
|
1513
1514
|
Q as s,
|
|
1514
1515
|
F as u
|
|
1515
1516
|
};
|
|
1516
|
-
//# sourceMappingURL=index-
|
|
1517
|
+
//# sourceMappingURL=index-ChbP89HC.js.map
|