@webx-ui/module-blog 0.5.14 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +913 -911
- 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 { useAdmin as
|
|
2
|
-
import { provide as
|
|
3
|
-
import { WxSelect as
|
|
1
|
+
import { useAdmin as ne, useTranslate as J, useDates as ut, useErrorText as be, WxScreenHead as ct, WxScreen as dt, WxSaveState as pt, WxDate as Ee, rowMenuWidth as Ye, WxListScreen as et, WxRowMenu as ze, WxFilterChips as vt, categoryRoutes as gt } from "@webx-ui/module-admin";
|
|
2
|
+
import { provide as ft, inject as ht, defineComponent as Q, useModel as Le, computed as h, openBlock as _, createBlock as q, unref as e, mergeModels as Fe, ref as M, watch as ve, onMounted as Ne, onBeforeUnmount as Ke, createElementBlock as H, Fragment as ke, createVNode as r, withCtx as l, createTextVNode as C, toDisplayString as k, createCommentVNode as K, createElementVNode as F, renderList as qe, normalizeClass as tt, normalizeProps as mt, guardReactiveProps as bt, useTemplateRef as Ie, nextTick as He, isRef as Pe, withKeys as Me, useId as yt, withModifiers as Je } from "vue";
|
|
3
|
+
import { WxSelect as _e, useLocales as at, localizedValue as wt, confirm as de, WxSkeleton as Oe, WxCard as xt, WxBadge as ie, WxBreadcrumb as _t, WxBreadcrumbItem as Ze, WxAlert as Ue, WxButton as G, WxActionBar as lt, toast as R, WxEmpty as kt, WxText as le, WxSortableList as $t, WxAction as Tt, WxInput as Ce, WxFormItem as pe, useModal as Re, WxDialog as De, WxSpace as Be, useElementWidth as At, createModal as Ve, WxTable as it, WxEntityCard as St, WxIcon as Te, WxTooltip as nt, WxCheckbox as Wt } from "@webx-ui/core";
|
|
4
4
|
import { useRoute as Ge, useRouter as je, onBeforeRouteLeave as Ct } from "vue-router";
|
|
5
5
|
import { provideBlocksPreview as Vt } from "@webx-ui/module-blocks";
|
|
6
6
|
const st = /* @__PURE__ */ Symbol("wx-article-editor");
|
|
7
|
-
function zt(
|
|
8
|
-
|
|
7
|
+
function zt(g) {
|
|
8
|
+
ft(st, g);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function Ae() {
|
|
11
|
+
return ht(st, null);
|
|
12
12
|
}
|
|
13
13
|
const Mt = {
|
|
14
14
|
module: {
|
|
@@ -226,8 +226,8 @@ const Mt = {
|
|
|
226
226
|
}, Qe = /* @__PURE__ */ new WeakSet();
|
|
227
227
|
function X() {
|
|
228
228
|
try {
|
|
229
|
-
const { i18n:
|
|
230
|
-
Qe.has(
|
|
229
|
+
const { i18n: g } = ne();
|
|
230
|
+
Qe.has(g) || (g.defaults("webx-blog", Mt), Qe.add(g));
|
|
231
231
|
} catch {
|
|
232
232
|
}
|
|
233
233
|
}
|
|
@@ -241,23 +241,23 @@ const Ut = /* @__PURE__ */ Q({
|
|
|
241
241
|
modelModifiers: {}
|
|
242
242
|
}),
|
|
243
243
|
emits: ["update:modelValue"],
|
|
244
|
-
setup(
|
|
245
|
-
const c =
|
|
244
|
+
setup(g) {
|
|
245
|
+
const c = g, v = Le(g, "modelValue"), f = Ae();
|
|
246
246
|
X();
|
|
247
|
-
const a =
|
|
248
|
-
() => (
|
|
249
|
-
label:
|
|
250
|
-
value:
|
|
247
|
+
const a = J("webx-blog"), s = h(() => c.disabled || f?.disabled.value === !0), t = h(
|
|
248
|
+
() => (f?.options.value.authors ?? []).map((i) => ({
|
|
249
|
+
label: i.title,
|
|
250
|
+
value: i.id
|
|
251
251
|
}))
|
|
252
|
-
),
|
|
253
|
-
get: () =>
|
|
254
|
-
set: (
|
|
255
|
-
|
|
252
|
+
), u = h({
|
|
253
|
+
get: () => v.value,
|
|
254
|
+
set: (i) => {
|
|
255
|
+
v.value = typeof i == "number" ? i : null;
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
|
-
return (
|
|
259
|
-
modelValue:
|
|
260
|
-
"onUpdate:modelValue":
|
|
258
|
+
return (i, m) => (_(), q(e(_e), {
|
|
259
|
+
modelValue: u.value,
|
|
260
|
+
"onUpdate:modelValue": m[0] || (m[0] = (y) => u.value = y),
|
|
261
261
|
options: t.value,
|
|
262
262
|
placeholder: e(a)("article.no-author"),
|
|
263
263
|
disabled: s.value,
|
|
@@ -268,42 +268,42 @@ const Ut = /* @__PURE__ */ Q({
|
|
|
268
268
|
}, null, 8, ["modelValue", "options", "placeholder", "disabled", "aria-label"]));
|
|
269
269
|
}
|
|
270
270
|
});
|
|
271
|
-
function
|
|
272
|
-
const c = `${
|
|
271
|
+
function ue(g) {
|
|
272
|
+
const c = `${g.apiPath}/blog/articles`, v = `${g.apiPath}/blog/tags`, f = (a) => a.data;
|
|
273
273
|
return {
|
|
274
274
|
articles: (a = {}) => {
|
|
275
275
|
const s = new URLSearchParams();
|
|
276
276
|
a.q && s.set("q", a.q), a.rubric != null && s.set("rubric", String(a.rubric)), a.tag != null && s.set("tag", String(a.tag)), a.author != null && s.set("author", String(a.author)), a.status && s.set("status", a.status), a.sort && s.set("sort", a.sort), a.trashed && s.set("trashed", "1"), a.page && a.page > 1 && s.set("page", String(a.page)), a.per_page && s.set("per_page", String(a.per_page));
|
|
277
277
|
const t = s.size > 0 ? `?${s}` : "";
|
|
278
|
-
return
|
|
278
|
+
return g.http.get(`${c}${t}`).then((u) => ({ ...u.meta, data: u.data, filters: u.filters }));
|
|
279
279
|
},
|
|
280
|
-
get: (a) =>
|
|
281
|
-
create: (a) =>
|
|
282
|
-
save: (a, s) =>
|
|
283
|
-
discard: (a) =>
|
|
284
|
-
versions: (a) =>
|
|
285
|
-
restoreVersion: (a, s) =>
|
|
280
|
+
get: (a) => g.http.get(`${c}/${a}`).then(f),
|
|
281
|
+
create: (a) => g.http.post(c, a).then(f),
|
|
282
|
+
save: (a, s) => g.http.put(`${c}/${a}`, s).then(f),
|
|
283
|
+
discard: (a) => g.http.post(`${c}/${a}/discard`, {}).then(f),
|
|
284
|
+
versions: (a) => g.http.get(`${c}/${a}/versions`).then(f),
|
|
285
|
+
restoreVersion: (a, s) => g.http.post(`${c}/${a}/versions/${s}/restore`, {}).then(f),
|
|
286
286
|
tags: (a = "") => {
|
|
287
287
|
const s = a.trim() === "" ? "" : `?q=${encodeURIComponent(a.trim())}`;
|
|
288
|
-
return
|
|
288
|
+
return g.http.get(`${v}${s}`).then(f);
|
|
289
289
|
},
|
|
290
|
-
createTag: (a) =>
|
|
291
|
-
publish: (a, s) =>
|
|
292
|
-
unpublish: (a) =>
|
|
293
|
-
remove: (a) =>
|
|
290
|
+
createTag: (a) => g.http.post(v, a).then(f),
|
|
291
|
+
publish: (a, s) => g.http.post(`${c}/${a}/publish`, s == null ? {} : { at: s }).then(f),
|
|
292
|
+
unpublish: (a) => g.http.post(`${c}/${a}/unpublish`, {}).then(f),
|
|
293
|
+
remove: (a) => g.http.delete(`${c}/${a}`).then(() => {
|
|
294
294
|
}),
|
|
295
|
-
restore: (a) =>
|
|
295
|
+
restore: (a) => g.http.post(`${c}/${a}/restore`, {}).then(f),
|
|
296
296
|
tagsPage: (a = {}) => {
|
|
297
297
|
const s = new URLSearchParams();
|
|
298
298
|
a.q && s.set("q", a.q), a.empty && s.set("empty", "1"), a.noindex && s.set("noindex", "1"), a.sort && s.set("sort", a.sort), a.page && a.page > 1 && s.set("page", String(a.page)), a.per_page && s.set("per_page", String(a.per_page));
|
|
299
299
|
const t = s.size > 0 ? `?${s}` : "";
|
|
300
|
-
return
|
|
300
|
+
return g.http.get(`${v}${t}`).then((u) => ({ ...u.meta, data: u.data, filters: u.filters }));
|
|
301
301
|
},
|
|
302
|
-
saveTag: (a, s) =>
|
|
303
|
-
removeTag: (a) =>
|
|
302
|
+
saveTag: (a, s) => g.http.put(`${v}/${a}`, s).then(f),
|
|
303
|
+
removeTag: (a) => g.http.delete(`${v}/${a}`).then(() => {
|
|
304
304
|
}),
|
|
305
|
-
massTags: (a, s) =>
|
|
306
|
-
mergeTags: (a, s, t) =>
|
|
305
|
+
massTags: (a, s) => g.http.post(`${v}/mass`, { ids: a, action: s }).then((t) => t.data.affected),
|
|
306
|
+
mergeTags: (a, s, t) => g.http.post(`${v}/merge`, { ids: a, keep: s, redirect: t }).then(f)
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
309
|
const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__ */ Q({
|
|
@@ -311,224 +311,224 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
311
311
|
props: {
|
|
312
312
|
base: { default: "/blog" }
|
|
313
313
|
},
|
|
314
|
-
setup(
|
|
315
|
-
const c =
|
|
314
|
+
setup(g) {
|
|
315
|
+
const c = g, v = ne(), f = ue(v), a = Ge(), s = je(), t = at(), u = ut();
|
|
316
316
|
X();
|
|
317
|
-
const
|
|
318
|
-
const
|
|
319
|
-
return wt(
|
|
320
|
-
}),
|
|
321
|
-
const
|
|
322
|
-
return typeof
|
|
317
|
+
const i = J("webx-blog"), m = be(), y = h(() => Number(a.params.id)), $ = h(() => `${c.base}/articles`), d = M(null), W = M({}), V = M(""), z = M(""), D = M(null), B = M({ rubrics: [], authors: [] }), w = M([]), T = M(!0), N = M(!1), I = M(!1), b = M({}), P = M(null), E = M(""), Z = M(0), Y = h(() => v.can("blog.articles.manage")), se = h(() => !Y.value || I.value), re = h(() => JSON.stringify(W.value)), O = h(() => E.value !== "" && re.value !== E.value), ye = h(() => N.value ? "saving" : O.value ? "unsaved" : "saved"), we = h(() => {
|
|
318
|
+
const x = W.value.title;
|
|
319
|
+
return wt(x, t.active.value, d.value?.title ?? "");
|
|
320
|
+
}), te = h(() => {
|
|
321
|
+
const x = W.value.published_at;
|
|
322
|
+
return typeof x == "string" && x !== "" ? x : null;
|
|
323
323
|
}), fe = h(() => {
|
|
324
|
-
if (
|
|
325
|
-
const
|
|
326
|
-
return !Number.isNaN(
|
|
327
|
-
}),
|
|
328
|
-
const
|
|
329
|
-
if (!
|
|
330
|
-
const L =
|
|
324
|
+
if (te.value === null) return !1;
|
|
325
|
+
const x = new Date(te.value.replace(" ", "T"));
|
|
326
|
+
return !Number.isNaN(x.valueOf()) && x.valueOf() > Date.now();
|
|
327
|
+
}), Se = h(() => {
|
|
328
|
+
const x = d.value;
|
|
329
|
+
if (!x) return "";
|
|
330
|
+
const L = u.short(x.published_at);
|
|
331
331
|
return {
|
|
332
|
-
scheduled:
|
|
333
|
-
published:
|
|
334
|
-
modified:
|
|
335
|
-
}[
|
|
332
|
+
scheduled: i("article.live-scheduled", { date: L }),
|
|
333
|
+
published: i("article.live-since", { date: L }),
|
|
334
|
+
modified: i("article.live-since", { date: L })
|
|
335
|
+
}[x.status] ?? "";
|
|
336
336
|
});
|
|
337
|
-
Vt({ url: h(() =>
|
|
338
|
-
article:
|
|
339
|
-
values:
|
|
340
|
-
options:
|
|
341
|
-
related:
|
|
342
|
-
prefix:
|
|
337
|
+
Vt({ url: h(() => D.value), reload: Z }), zt({
|
|
338
|
+
article: d,
|
|
339
|
+
values: W,
|
|
340
|
+
options: B,
|
|
341
|
+
related: w,
|
|
342
|
+
prefix: z,
|
|
343
343
|
base: c.base,
|
|
344
344
|
canManage: Y.value,
|
|
345
|
-
disabled:
|
|
346
|
-
reload: () =>
|
|
347
|
-
save: () =>
|
|
345
|
+
disabled: se,
|
|
346
|
+
reload: () => oe(!0),
|
|
347
|
+
save: () => A()
|
|
348
348
|
});
|
|
349
|
-
function
|
|
350
|
-
|
|
349
|
+
function $e(x) {
|
|
350
|
+
d.value = x.article, W.value = x.values, V.value = x.revision, z.value = x.prefix, D.value = x.preview_url, B.value = x.options, w.value = x.related, E.value = JSON.stringify(x.values), P.value = null;
|
|
351
351
|
}
|
|
352
|
-
async function
|
|
353
|
-
|
|
352
|
+
async function oe(x = !1) {
|
|
353
|
+
x || (T.value = !0);
|
|
354
354
|
try {
|
|
355
|
-
|
|
355
|
+
$e(await f.get(y.value));
|
|
356
356
|
} catch (L) {
|
|
357
|
-
|
|
357
|
+
R.danger(m(L)), s.push($.value);
|
|
358
358
|
} finally {
|
|
359
|
-
|
|
359
|
+
T.value = !1;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
let
|
|
363
|
-
function
|
|
364
|
-
!Y.value || P.value || !O.value || (clearTimeout(
|
|
365
|
-
|
|
362
|
+
let ce;
|
|
363
|
+
function ae() {
|
|
364
|
+
!Y.value || P.value || !O.value || (clearTimeout(ce), ce = setTimeout(() => {
|
|
365
|
+
A();
|
|
366
366
|
}, qt));
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
!Y.value || P.value || !O.value || N.value || (clearTimeout(
|
|
368
|
+
function We() {
|
|
369
|
+
!Y.value || P.value || !O.value || N.value || (clearTimeout(ce), A());
|
|
370
370
|
}
|
|
371
|
-
let
|
|
372
|
-
async function
|
|
373
|
-
for (;
|
|
374
|
-
const { carried: j, done:
|
|
375
|
-
if (await
|
|
371
|
+
let o;
|
|
372
|
+
async function A() {
|
|
373
|
+
for (; o; ) {
|
|
374
|
+
const { carried: j, done: me } = o;
|
|
375
|
+
if (await me, !O.value || P.value || re.value === j) return;
|
|
376
376
|
}
|
|
377
|
-
const
|
|
378
|
-
|
|
377
|
+
const x = re.value, L = S();
|
|
378
|
+
o = { carried: x, done: L };
|
|
379
379
|
try {
|
|
380
380
|
await L;
|
|
381
381
|
} finally {
|
|
382
|
-
|
|
382
|
+
o?.done === L && (o = void 0);
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
async function
|
|
386
|
-
if (!
|
|
387
|
-
clearTimeout(
|
|
388
|
-
const
|
|
389
|
-
N.value = !0,
|
|
385
|
+
async function S() {
|
|
386
|
+
if (!d.value || !Y.value) return;
|
|
387
|
+
clearTimeout(ce);
|
|
388
|
+
const x = re.value, L = W.value;
|
|
389
|
+
N.value = !0, b.value = {};
|
|
390
390
|
try {
|
|
391
|
-
const j = await
|
|
392
|
-
|
|
391
|
+
const j = await f.save(d.value.id, { values: L, revision: V.value });
|
|
392
|
+
d.value = j.article, V.value = j.revision, z.value = j.prefix, D.value = j.preview_url, B.value = j.options, w.value = j.related, P.value = null, re.value === x && (E.value = x), Z.value += 1;
|
|
393
393
|
} catch (j) {
|
|
394
|
-
const
|
|
395
|
-
|
|
394
|
+
const me = j;
|
|
395
|
+
me.status === 409 && me.body?.data ? P.value = me.body : me.body?.errors ? (b.value = me.body.errors, R.danger(i("article.save-failed"))) : R.danger(m(j));
|
|
396
396
|
} finally {
|
|
397
397
|
N.value = !1;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
async function
|
|
400
|
+
async function ee() {
|
|
401
401
|
await de({
|
|
402
|
-
title:
|
|
403
|
-
message:
|
|
404
|
-
confirmText:
|
|
405
|
-
cancelText:
|
|
402
|
+
title: i("article.conflict-theirs-title"),
|
|
403
|
+
message: i("article.conflict-theirs-text"),
|
|
404
|
+
confirmText: i("article.conflict-theirs"),
|
|
405
|
+
cancelText: i("panel.cancel"),
|
|
406
406
|
tone: "danger"
|
|
407
|
-
}) && await
|
|
407
|
+
}) && await oe(!0);
|
|
408
408
|
}
|
|
409
409
|
async function n() {
|
|
410
|
-
const
|
|
411
|
-
|
|
410
|
+
const x = P.value;
|
|
411
|
+
x && (V.value = x.data.revision, P.value = null, await A());
|
|
412
412
|
}
|
|
413
|
-
async function
|
|
414
|
-
if (!(!
|
|
415
|
-
title:
|
|
416
|
-
message:
|
|
417
|
-
confirmText:
|
|
418
|
-
cancelText:
|
|
413
|
+
async function U() {
|
|
414
|
+
if (!(!d.value || !await de({
|
|
415
|
+
title: i("article.discard-title"),
|
|
416
|
+
message: i("article.discard-text"),
|
|
417
|
+
confirmText: i("article.discard"),
|
|
418
|
+
cancelText: i("panel.cancel"),
|
|
419
419
|
tone: "danger"
|
|
420
420
|
}))) {
|
|
421
|
-
|
|
421
|
+
I.value = !0;
|
|
422
422
|
try {
|
|
423
|
-
|
|
423
|
+
$e(await f.discard(d.value.id)), R.success(i("article.discarded"));
|
|
424
424
|
} catch (L) {
|
|
425
|
-
|
|
425
|
+
R.danger(m(L));
|
|
426
426
|
} finally {
|
|
427
|
-
|
|
427
|
+
I.value = !1;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
async function
|
|
432
|
-
const
|
|
433
|
-
if (!
|
|
434
|
-
const L =
|
|
431
|
+
async function p() {
|
|
432
|
+
const x = d.value;
|
|
433
|
+
if (!x) return;
|
|
434
|
+
const L = x.path === null ? null : `/${x.path}`, j = te.value === null ? i("article.publish-now") : u.short(te.value);
|
|
435
435
|
if (await de({
|
|
436
|
-
title:
|
|
437
|
-
message: fe.value ?
|
|
438
|
-
confirmText: fe.value ?
|
|
439
|
-
cancelText:
|
|
440
|
-
}) && (O.value && await
|
|
441
|
-
|
|
436
|
+
title: i("article.publish-title", { title: x.title }),
|
|
437
|
+
message: fe.value ? i("article.publish-later", { date: j }) : L === null ? i("article.publish-nowhere") : i("article.publish-text", { address: L }),
|
|
438
|
+
confirmText: fe.value ? i("article.schedule") : i("panel.publish"),
|
|
439
|
+
cancelText: i("panel.cancel")
|
|
440
|
+
}) && (O.value && await A(), !P.value)) {
|
|
441
|
+
I.value = !0;
|
|
442
442
|
try {
|
|
443
|
-
await
|
|
443
|
+
await f.publish(x.id, te.value), await oe(!0), R.success(fe.value ? i("article.scheduled") : i("panel.published"));
|
|
444
444
|
} catch (ot) {
|
|
445
|
-
|
|
445
|
+
R.danger(m(ot));
|
|
446
446
|
} finally {
|
|
447
|
-
|
|
447
|
+
I.value = !1;
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
function
|
|
452
|
-
const
|
|
453
|
-
return
|
|
451
|
+
function xe() {
|
|
452
|
+
const x = d.value?.status;
|
|
453
|
+
return x === "published" ? "success" : x === "modified" ? "warning" : x === "scheduled" ? "primary" : "default";
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
O.value &&
|
|
455
|
+
function he(x) {
|
|
456
|
+
O.value && x.preventDefault();
|
|
457
457
|
}
|
|
458
|
-
ve(
|
|
459
|
-
|
|
458
|
+
ve(re, ae), ve(y, () => {
|
|
459
|
+
oe();
|
|
460
460
|
}), Ne(() => {
|
|
461
|
-
|
|
461
|
+
oe(), window.addEventListener("beforeunload", he);
|
|
462
462
|
}), Ke(() => {
|
|
463
|
-
clearTimeout(
|
|
464
|
-
}), Ct(async () => !O.value || !Y.value || (await
|
|
465
|
-
title:
|
|
466
|
-
message:
|
|
467
|
-
confirmText:
|
|
468
|
-
cancelText:
|
|
463
|
+
clearTimeout(ce), window.removeEventListener("beforeunload", he);
|
|
464
|
+
}), Ct(async () => !O.value || !Y.value || (await A(), !O.value) ? !0 : await de({
|
|
465
|
+
title: i("article.leave-title"),
|
|
466
|
+
message: i("article.leave-text"),
|
|
467
|
+
confirmText: i("article.leave"),
|
|
468
|
+
cancelText: i("panel.cancel"),
|
|
469
469
|
tone: "danger"
|
|
470
470
|
}));
|
|
471
471
|
const rt = h(() => {
|
|
472
|
-
const
|
|
473
|
-
return
|
|
472
|
+
const x = [];
|
|
473
|
+
return D.value && x.push({ key: "preview", label: i("article.preview"), icon: "eye", href: D.value }), d.value?.url && d.value.status !== "draft" && x.push({
|
|
474
474
|
key: "site",
|
|
475
|
-
label:
|
|
475
|
+
label: i("panel.open-on-site"),
|
|
476
476
|
icon: "link",
|
|
477
|
-
href:
|
|
478
|
-
}),
|
|
477
|
+
href: d.value.url
|
|
478
|
+
}), d.value?.status === "modified" && x.push({
|
|
479
479
|
key: "discard",
|
|
480
|
-
label:
|
|
480
|
+
label: i("article.discard"),
|
|
481
481
|
icon: "refresh",
|
|
482
482
|
danger: !0,
|
|
483
483
|
menu: !0,
|
|
484
484
|
run: () => {
|
|
485
|
-
|
|
485
|
+
U();
|
|
486
486
|
}
|
|
487
|
-
}),
|
|
487
|
+
}), x;
|
|
488
488
|
});
|
|
489
|
-
return (
|
|
489
|
+
return (x, L) => (_(), H("div", {
|
|
490
490
|
class: "wx-article-editor",
|
|
491
|
-
onFocusout:
|
|
491
|
+
onFocusout: We
|
|
492
492
|
}, [
|
|
493
|
-
|
|
493
|
+
T.value || !d.value ? (_(), H(ke, { key: 0 }, [
|
|
494
494
|
r(e(Oe), {
|
|
495
495
|
class: "wx-article-editor__ghost",
|
|
496
496
|
title: "",
|
|
497
497
|
rows: 1
|
|
498
498
|
}),
|
|
499
499
|
r(e(xt), null, {
|
|
500
|
-
default:
|
|
500
|
+
default: l(() => [
|
|
501
501
|
r(e(Oe), { rows: 8 })
|
|
502
502
|
]),
|
|
503
503
|
_: 1
|
|
504
504
|
})
|
|
505
|
-
], 64)) : (
|
|
505
|
+
], 64)) : (_(), H(ke, { key: 1 }, [
|
|
506
506
|
r(e(ct), {
|
|
507
507
|
divider: "",
|
|
508
|
-
back:
|
|
509
|
-
"back-label": e(
|
|
510
|
-
title:
|
|
511
|
-
subtitle:
|
|
508
|
+
back: $.value,
|
|
509
|
+
"back-label": e(i)("module.articles"),
|
|
510
|
+
title: we.value || e(i)("article.untitled"),
|
|
511
|
+
subtitle: Se.value,
|
|
512
512
|
actions: rt.value
|
|
513
513
|
}, {
|
|
514
|
-
trail:
|
|
514
|
+
trail: l(() => [
|
|
515
515
|
r(e(_t), {
|
|
516
516
|
size: "sm",
|
|
517
|
-
label: e(
|
|
517
|
+
label: e(i)("article.trail")
|
|
518
518
|
}, {
|
|
519
|
-
default:
|
|
519
|
+
default: l(() => [
|
|
520
520
|
r(e(Ze), {
|
|
521
521
|
as: "router-link",
|
|
522
|
-
to:
|
|
522
|
+
to: $.value
|
|
523
523
|
}, {
|
|
524
|
-
default:
|
|
525
|
-
|
|
524
|
+
default: l(() => [
|
|
525
|
+
C(k(e(i)("module.articles")), 1)
|
|
526
526
|
]),
|
|
527
527
|
_: 1
|
|
528
528
|
}, 8, ["to"]),
|
|
529
529
|
r(e(Ze), { current: "" }, {
|
|
530
|
-
default:
|
|
531
|
-
|
|
530
|
+
default: l(() => [
|
|
531
|
+
C(k(we.value || e(i)("article.untitled")), 1)
|
|
532
532
|
]),
|
|
533
533
|
_: 1
|
|
534
534
|
})
|
|
@@ -536,43 +536,43 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
536
536
|
_: 1
|
|
537
537
|
}, 8, ["label"])
|
|
538
538
|
]),
|
|
539
|
-
"title-after":
|
|
540
|
-
r(e(
|
|
541
|
-
type:
|
|
539
|
+
"title-after": l(() => [
|
|
540
|
+
r(e(ie), {
|
|
541
|
+
type: xe(),
|
|
542
542
|
dot: ""
|
|
543
543
|
}, {
|
|
544
|
-
default:
|
|
545
|
-
|
|
544
|
+
default: l(() => [
|
|
545
|
+
C(k(e(i)(`panel.status-${d.value.status}`)), 1)
|
|
546
546
|
]),
|
|
547
547
|
_: 1
|
|
548
548
|
}, 8, ["type"]),
|
|
549
|
-
|
|
549
|
+
d.value.status === "modified" ? (_(), q(e(ie), {
|
|
550
550
|
key: 0,
|
|
551
551
|
type: "primary",
|
|
552
552
|
round: ""
|
|
553
553
|
}, {
|
|
554
|
-
default:
|
|
555
|
-
|
|
554
|
+
default: l(() => [
|
|
555
|
+
C(k(e(i)("panel.edits")), 1)
|
|
556
556
|
]),
|
|
557
557
|
_: 1
|
|
558
558
|
})) : K("", !0)
|
|
559
559
|
]),
|
|
560
560
|
_: 1
|
|
561
561
|
}, 8, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
562
|
-
P.value ? (
|
|
562
|
+
P.value ? (_(), q(e(Ue), {
|
|
563
563
|
key: 0,
|
|
564
564
|
type: "warning",
|
|
565
|
-
title: e(
|
|
565
|
+
title: e(i)("article.conflict-title"),
|
|
566
566
|
description: P.value.message
|
|
567
567
|
}, {
|
|
568
|
-
actions:
|
|
568
|
+
actions: l(() => [
|
|
569
569
|
r(e(G), {
|
|
570
570
|
size: "sm",
|
|
571
571
|
variant: "outline",
|
|
572
|
-
onClick:
|
|
572
|
+
onClick: ee
|
|
573
573
|
}, {
|
|
574
|
-
default:
|
|
575
|
-
|
|
574
|
+
default: l(() => [
|
|
575
|
+
C(k(e(i)("article.conflict-theirs")), 1)
|
|
576
576
|
]),
|
|
577
577
|
_: 1
|
|
578
578
|
}),
|
|
@@ -581,8 +581,8 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
581
581
|
type: "primary",
|
|
582
582
|
onClick: n
|
|
583
583
|
}, {
|
|
584
|
-
default:
|
|
585
|
-
|
|
584
|
+
default: l(() => [
|
|
585
|
+
C(k(e(i)("article.conflict-mine")), 1)
|
|
586
586
|
]),
|
|
587
587
|
_: 1
|
|
588
588
|
})
|
|
@@ -591,37 +591,37 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
591
591
|
}, 8, ["title", "description"])) : K("", !0),
|
|
592
592
|
F("div", Nt, [
|
|
593
593
|
r(e(dt), {
|
|
594
|
-
modelValue:
|
|
595
|
-
"onUpdate:modelValue": L[0] || (L[0] = (j) =>
|
|
594
|
+
modelValue: W.value,
|
|
595
|
+
"onUpdate:modelValue": L[0] || (L[0] = (j) => W.value = j),
|
|
596
596
|
name: "blog.article-form",
|
|
597
|
-
errors:
|
|
598
|
-
disabled:
|
|
597
|
+
errors: b.value,
|
|
598
|
+
disabled: se.value
|
|
599
599
|
}, null, 8, ["modelValue", "errors", "disabled"])
|
|
600
600
|
]),
|
|
601
|
-
Y.value ? (
|
|
602
|
-
state:
|
|
603
|
-
r(e(pt), { state:
|
|
601
|
+
Y.value ? (_(), q(e(lt), { key: 1 }, {
|
|
602
|
+
state: l(() => [
|
|
603
|
+
r(e(pt), { state: ye.value }, null, 8, ["state"])
|
|
604
604
|
]),
|
|
605
|
-
default:
|
|
605
|
+
default: l(() => [
|
|
606
606
|
r(e(G), {
|
|
607
607
|
variant: "outline",
|
|
608
608
|
loading: N.value,
|
|
609
609
|
disabled: !O.value,
|
|
610
|
-
onClick:
|
|
610
|
+
onClick: A
|
|
611
611
|
}, {
|
|
612
|
-
default:
|
|
613
|
-
|
|
612
|
+
default: l(() => [
|
|
613
|
+
C(k(e(i)("article.save")), 1)
|
|
614
614
|
]),
|
|
615
615
|
_: 1
|
|
616
616
|
}, 8, ["loading", "disabled"]),
|
|
617
617
|
r(e(G), {
|
|
618
618
|
type: "primary",
|
|
619
|
-
loading:
|
|
620
|
-
disabled:
|
|
621
|
-
onClick:
|
|
619
|
+
loading: I.value,
|
|
620
|
+
disabled: d.value.status === "published" && !O.value,
|
|
621
|
+
onClick: p
|
|
622
622
|
}, {
|
|
623
|
-
default:
|
|
624
|
-
|
|
623
|
+
default: l(() => [
|
|
624
|
+
C(k(fe.value ? e(i)("article.schedule") : e(i)("panel.publish")), 1)
|
|
625
625
|
]),
|
|
626
626
|
_: 1
|
|
627
627
|
}, 8, ["loading", "disabled"])
|
|
@@ -631,105 +631,105 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
631
631
|
], 64))
|
|
632
632
|
], 32));
|
|
633
633
|
}
|
|
634
|
-
}), ge = (
|
|
635
|
-
const
|
|
636
|
-
for (const [
|
|
637
|
-
|
|
638
|
-
return
|
|
634
|
+
}), ge = (g, c) => {
|
|
635
|
+
const v = g.__vccOpts || g;
|
|
636
|
+
for (const [f, a] of c)
|
|
637
|
+
v[f] = a;
|
|
638
|
+
return v;
|
|
639
639
|
}, Pt = /* @__PURE__ */ ge(It, [["__scopeId", "data-v-c8b3304e"]]), Rt = { class: "wx-article-history" }, Dt = { class: "wx-article-history__number" }, Bt = { class: "wx-article-history__who" }, Et = /* @__PURE__ */ Q({
|
|
640
640
|
name: "WxArticleHistory",
|
|
641
641
|
__name: "ArticleHistory",
|
|
642
|
-
setup(
|
|
643
|
-
const c =
|
|
642
|
+
setup(g) {
|
|
643
|
+
const c = ne(), v = ue(c), f = Ae();
|
|
644
644
|
X();
|
|
645
|
-
const a =
|
|
646
|
-
() =>
|
|
645
|
+
const a = J("webx-blog"), s = be(), t = M(null), u = M(!1), i = h(() => f?.article.value ?? null), m = h(() => c.can("blog.articles.manage")), y = h(
|
|
646
|
+
() => i.value?.status === "published" || i.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
|
|
647
647
|
);
|
|
648
|
-
async function
|
|
649
|
-
const
|
|
650
|
-
if (
|
|
648
|
+
async function $() {
|
|
649
|
+
const W = i.value;
|
|
650
|
+
if (W)
|
|
651
651
|
try {
|
|
652
|
-
t.value = await
|
|
653
|
-
} catch (
|
|
654
|
-
t.value = [],
|
|
652
|
+
t.value = await v.versions(W.id);
|
|
653
|
+
} catch (V) {
|
|
654
|
+
t.value = [], R.danger(s(V));
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
|
-
async function
|
|
658
|
-
const
|
|
659
|
-
if (!(!
|
|
660
|
-
title: a("article.restore-title", { number:
|
|
657
|
+
async function d(W) {
|
|
658
|
+
const V = i.value;
|
|
659
|
+
if (!(!V || !await de({
|
|
660
|
+
title: a("article.restore-title", { number: W.number }),
|
|
661
661
|
message: a("article.restore-text"),
|
|
662
662
|
confirmText: a("article.restore-version"),
|
|
663
663
|
cancelText: a("panel.cancel")
|
|
664
664
|
}))) {
|
|
665
|
-
|
|
665
|
+
u.value = !0;
|
|
666
666
|
try {
|
|
667
|
-
await
|
|
668
|
-
} catch (
|
|
669
|
-
|
|
667
|
+
await v.restoreVersion(V.id, W.number), await f?.reload(), R.success(a("article.restored-version", { number: W.number }));
|
|
668
|
+
} catch (D) {
|
|
669
|
+
R.danger(s(D));
|
|
670
670
|
} finally {
|
|
671
|
-
|
|
671
|
+
u.value = !1;
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
675
|
return ve(
|
|
676
|
-
() => [
|
|
676
|
+
() => [i.value?.id, i.value?.published_at, i.value?.updated_at],
|
|
677
677
|
() => {
|
|
678
|
-
|
|
678
|
+
$();
|
|
679
679
|
},
|
|
680
680
|
{ immediate: !0 }
|
|
681
|
-
), (
|
|
682
|
-
t.value === null ? (
|
|
681
|
+
), (W, V) => (_(), H("div", Rt, [
|
|
682
|
+
t.value === null ? (_(), q(e(Oe), {
|
|
683
683
|
key: 0,
|
|
684
684
|
class: "wx-article-history__ghost",
|
|
685
685
|
rows: 3
|
|
686
|
-
})) : t.value.length === 0 ? (
|
|
686
|
+
})) : t.value.length === 0 ? (_(), q(e(kt), {
|
|
687
687
|
key: 1,
|
|
688
688
|
description: e(a)("article.history-empty")
|
|
689
|
-
}, null, 8, ["description"])) : (
|
|
690
|
-
key:
|
|
691
|
-
class: tt(["wx-article-history__row", { "is-live":
|
|
689
|
+
}, null, 8, ["description"])) : (_(!0), H(ke, { key: 2 }, qe(t.value, (z) => (_(), H("div", {
|
|
690
|
+
key: z.number,
|
|
691
|
+
class: tt(["wx-article-history__row", { "is-live": z.number === y.value }])
|
|
692
692
|
}, [
|
|
693
|
-
F("code", Dt, k(e(a)("article.version", { number:
|
|
693
|
+
F("code", Dt, k(e(a)("article.version", { number: z.number })), 1),
|
|
694
694
|
F("div", Bt, [
|
|
695
|
-
|
|
695
|
+
z.created_at ? (_(), q(e(Ee), {
|
|
696
696
|
key: 0,
|
|
697
|
-
value:
|
|
697
|
+
value: z.created_at,
|
|
698
698
|
size: "md",
|
|
699
699
|
tone: "default"
|
|
700
700
|
}, null, 8, ["value"])) : K("", !0),
|
|
701
|
-
r(e(
|
|
701
|
+
r(e(le), {
|
|
702
702
|
size: "sm",
|
|
703
703
|
tone: "muted"
|
|
704
704
|
}, {
|
|
705
|
-
default:
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
705
|
+
default: l(() => [
|
|
706
|
+
C(k(z.author ?? e(a)(`article.source-${z.source}`)) + " ", 1),
|
|
707
|
+
z.comment ? (_(), H(ke, { key: 0 }, [
|
|
708
|
+
C(" · " + k(z.comment), 1)
|
|
709
709
|
], 64)) : K("", !0)
|
|
710
710
|
]),
|
|
711
711
|
_: 2
|
|
712
712
|
}, 1024)
|
|
713
713
|
]),
|
|
714
|
-
|
|
714
|
+
z.number === y.value ? (_(), q(e(ie), {
|
|
715
715
|
key: 0,
|
|
716
716
|
type: "success",
|
|
717
717
|
dot: ""
|
|
718
718
|
}, {
|
|
719
|
-
default:
|
|
720
|
-
|
|
719
|
+
default: l(() => [
|
|
720
|
+
C(k(e(a)("article.version-live")), 1)
|
|
721
721
|
]),
|
|
722
722
|
_: 1
|
|
723
723
|
})) : K("", !0),
|
|
724
|
-
|
|
724
|
+
m.value && z.number !== y.value ? (_(), q(e(G), {
|
|
725
725
|
key: 1,
|
|
726
726
|
size: "sm",
|
|
727
727
|
variant: "outline",
|
|
728
|
-
loading:
|
|
729
|
-
onClick: (
|
|
728
|
+
loading: u.value,
|
|
729
|
+
onClick: (D) => d(z)
|
|
730
730
|
}, {
|
|
731
|
-
default:
|
|
732
|
-
|
|
731
|
+
default: l(() => [
|
|
732
|
+
C(k(e(a)("article.restore-version")), 1)
|
|
733
733
|
]),
|
|
734
734
|
_: 1
|
|
735
735
|
}, 8, ["loading", "onClick"])) : K("", !0)
|
|
@@ -746,94 +746,94 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
746
746
|
modelModifiers: {}
|
|
747
747
|
}),
|
|
748
748
|
emits: ["update:modelValue"],
|
|
749
|
-
setup(
|
|
750
|
-
const c =
|
|
749
|
+
setup(g) {
|
|
750
|
+
const c = g, v = Le(g, "modelValue"), f = ne(), a = ue(f), s = Ae();
|
|
751
751
|
X();
|
|
752
|
-
const t =
|
|
753
|
-
let
|
|
752
|
+
const t = J("webx-blog"), u = be(), i = h(() => c.disabled || s?.disabled.value === !0), m = M(/* @__PURE__ */ new Map()), y = M([]);
|
|
753
|
+
let $;
|
|
754
754
|
ve(
|
|
755
755
|
() => s?.related.value,
|
|
756
|
-
(
|
|
757
|
-
const
|
|
758
|
-
for (const N of
|
|
759
|
-
|
|
756
|
+
(w) => {
|
|
757
|
+
const T = new Map(m.value);
|
|
758
|
+
for (const N of w ?? []) T.set(N.id, N.title);
|
|
759
|
+
m.value = T;
|
|
760
760
|
},
|
|
761
761
|
{ immediate: !0, deep: !0 }
|
|
762
762
|
);
|
|
763
|
-
const
|
|
764
|
-
get: () =>
|
|
765
|
-
set: (
|
|
766
|
-
|
|
763
|
+
const d = h({
|
|
764
|
+
get: () => v.value.map((w) => ({ id: w, title: m.value.get(w) ?? `#${w}` })),
|
|
765
|
+
set: (w) => {
|
|
766
|
+
v.value = w.map((T) => T.id);
|
|
767
767
|
}
|
|
768
|
-
}),
|
|
769
|
-
() =>
|
|
768
|
+
}), W = h(
|
|
769
|
+
() => y.value.filter((w) => !v.value.includes(w.id)).map((w) => ({ label: w.title, value: w.id }))
|
|
770
770
|
);
|
|
771
|
-
async function
|
|
772
|
-
const
|
|
771
|
+
async function V(w) {
|
|
772
|
+
const T = s?.article.value?.id;
|
|
773
773
|
try {
|
|
774
|
-
const N = await a.articles({ q:
|
|
775
|
-
|
|
776
|
-
const
|
|
777
|
-
for (const
|
|
778
|
-
|
|
774
|
+
const N = await a.articles({ q: w, per_page: Ht });
|
|
775
|
+
y.value = N.data.filter((b) => b.id !== T).map((b) => ({ id: b.id, title: b.title }));
|
|
776
|
+
const I = new Map(m.value);
|
|
777
|
+
for (const b of y.value) I.set(b.id, b.title);
|
|
778
|
+
m.value = I;
|
|
779
779
|
} catch (N) {
|
|
780
|
-
|
|
780
|
+
R.danger(u(N));
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
|
-
function
|
|
784
|
-
clearTimeout(
|
|
785
|
-
|
|
783
|
+
function z(w) {
|
|
784
|
+
clearTimeout($), $ = setTimeout(() => {
|
|
785
|
+
V(w);
|
|
786
786
|
}, Kt);
|
|
787
787
|
}
|
|
788
|
-
function
|
|
789
|
-
typeof
|
|
788
|
+
function D(w) {
|
|
789
|
+
typeof w != "number" || v.value.includes(w) || (v.value = [...v.value, w]);
|
|
790
790
|
}
|
|
791
|
-
function
|
|
792
|
-
|
|
791
|
+
function B(w) {
|
|
792
|
+
v.value = v.value.filter((T) => T !== w);
|
|
793
793
|
}
|
|
794
794
|
return ve(
|
|
795
795
|
() => s?.article.value?.id,
|
|
796
796
|
() => {
|
|
797
|
-
|
|
797
|
+
V("");
|
|
798
798
|
},
|
|
799
799
|
{ immediate: !0 }
|
|
800
|
-
), Ke(() => clearTimeout(
|
|
800
|
+
), Ke(() => clearTimeout($)), (w, T) => (_(), H("div", Lt, [
|
|
801
801
|
r(e($t), {
|
|
802
|
-
modelValue:
|
|
803
|
-
"onUpdate:modelValue":
|
|
802
|
+
modelValue: d.value,
|
|
803
|
+
"onUpdate:modelValue": T[0] || (T[0] = (N) => d.value = N),
|
|
804
804
|
plain: "",
|
|
805
805
|
size: "sm",
|
|
806
806
|
"item-key": "id",
|
|
807
807
|
"item-label": "title",
|
|
808
|
-
disabled:
|
|
808
|
+
disabled: i.value,
|
|
809
809
|
"empty-text": e(t)("article.related-empty"),
|
|
810
810
|
"aria-label": e(t)("article.related")
|
|
811
811
|
}, {
|
|
812
|
-
default:
|
|
812
|
+
default: l(({ item: N }) => [
|
|
813
813
|
F("span", Ft, k(N.title), 1)
|
|
814
814
|
]),
|
|
815
|
-
actions:
|
|
815
|
+
actions: l(({ item: N }) => [
|
|
816
816
|
r(e(Tt), {
|
|
817
817
|
type: "remove",
|
|
818
818
|
size: "sm",
|
|
819
|
-
disabled:
|
|
819
|
+
disabled: i.value,
|
|
820
820
|
title: e(t)("article.related-remove"),
|
|
821
|
-
onClick: (
|
|
821
|
+
onClick: (I) => B(N.id)
|
|
822
822
|
}, null, 8, ["disabled", "title", "onClick"])
|
|
823
823
|
]),
|
|
824
824
|
_: 1
|
|
825
825
|
}, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
|
|
826
|
-
r(e(
|
|
826
|
+
r(e(_e), {
|
|
827
827
|
"model-value": null,
|
|
828
|
-
options:
|
|
828
|
+
options: W.value,
|
|
829
829
|
placeholder: e(t)("article.related-add"),
|
|
830
830
|
"empty-text": e(t)("article.related-nothing"),
|
|
831
|
-
disabled:
|
|
831
|
+
disabled: i.value,
|
|
832
832
|
filterable: "",
|
|
833
833
|
teleport: "",
|
|
834
834
|
"aria-label": e(t)("article.related-add"),
|
|
835
|
-
onSearch:
|
|
836
|
-
"onUpdate:modelValue":
|
|
835
|
+
onSearch: z,
|
|
836
|
+
"onUpdate:modelValue": D
|
|
837
837
|
}, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"])
|
|
838
838
|
]));
|
|
839
839
|
}
|
|
@@ -841,31 +841,31 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
841
841
|
name: "WxArticleSlug",
|
|
842
842
|
inheritAttrs: !1,
|
|
843
843
|
__name: "ArticleSlug",
|
|
844
|
-
setup(
|
|
845
|
-
const c =
|
|
844
|
+
setup(g) {
|
|
845
|
+
const c = Ae(), v = at();
|
|
846
846
|
X();
|
|
847
|
-
const
|
|
848
|
-
const
|
|
849
|
-
return
|
|
847
|
+
const f = J("webx-blog"), a = h(() => {
|
|
848
|
+
const u = c?.prefix.value ?? "";
|
|
849
|
+
return u === "" ? "/" : `/${u}/`;
|
|
850
850
|
}), s = h(() => {
|
|
851
|
-
const
|
|
852
|
-
return typeof
|
|
851
|
+
const u = c?.values.value.slug;
|
|
852
|
+
return typeof u == "string" ? u : u?.[v.active.value] ?? "";
|
|
853
853
|
}), t = h(() => {
|
|
854
|
-
const
|
|
855
|
-
return typeof
|
|
854
|
+
const u = c?.article.value?.path;
|
|
855
|
+
return typeof u == "string" && s.value !== "" && `${a.value}${s.value}` != `/${u}`;
|
|
856
856
|
});
|
|
857
|
-
return (
|
|
858
|
-
r(e(Ce), mt(bt(
|
|
859
|
-
prefix:
|
|
857
|
+
return (u, i) => (_(), H("div", Jt, [
|
|
858
|
+
r(e(Ce), mt(bt(u.$attrs)), {
|
|
859
|
+
prefix: l(() => [
|
|
860
860
|
F("span", Zt, k(a.value), 1)
|
|
861
861
|
]),
|
|
862
862
|
_: 1
|
|
863
863
|
}, 16),
|
|
864
|
-
t.value ? (
|
|
864
|
+
t.value ? (_(), q(e(Ue), {
|
|
865
865
|
key: 0,
|
|
866
866
|
type: "info",
|
|
867
867
|
variant: "soft",
|
|
868
|
-
description: e(
|
|
868
|
+
description: e(f)("article.address-moving")
|
|
869
869
|
}, null, 8, ["description"])) : K("", !0)
|
|
870
870
|
]));
|
|
871
871
|
}
|
|
@@ -882,123 +882,123 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
882
882
|
modelModifiers: {}
|
|
883
883
|
}),
|
|
884
884
|
emits: ["update:modelValue"],
|
|
885
|
-
setup(
|
|
886
|
-
const c =
|
|
885
|
+
setup(g) {
|
|
886
|
+
const c = g, v = Le(g, "modelValue"), f = ne(), a = ue(f), s = Ae();
|
|
887
887
|
X();
|
|
888
|
-
const t =
|
|
889
|
-
let
|
|
888
|
+
const t = J("webx-blog"), u = be(), i = h(() => c.disabled || s?.disabled.value === !0), m = M(/* @__PURE__ */ new Map()), y = M([]), $ = M(""), d = M(!1);
|
|
889
|
+
let W;
|
|
890
890
|
ve(
|
|
891
891
|
() => s?.article.value?.tags,
|
|
892
|
-
(
|
|
893
|
-
const P = new Map(
|
|
894
|
-
for (const E of
|
|
895
|
-
|
|
892
|
+
(b) => {
|
|
893
|
+
const P = new Map(m.value);
|
|
894
|
+
for (const E of b ?? []) P.set(E.id, E.title);
|
|
895
|
+
m.value = P;
|
|
896
896
|
},
|
|
897
897
|
{ immediate: !0, deep: !0 }
|
|
898
898
|
);
|
|
899
|
-
const
|
|
900
|
-
() =>
|
|
901
|
-
),
|
|
902
|
-
() =>
|
|
899
|
+
const V = h(
|
|
900
|
+
() => v.value.map((b) => ({ id: b, title: m.value.get(b) ?? `#${b}` }))
|
|
901
|
+
), z = h(
|
|
902
|
+
() => y.value.filter((b) => !v.value.includes(b.id)).map((b) => ({
|
|
903
903
|
// The count is part of the label rather than a column: a select draws a line of text, and
|
|
904
904
|
// the number is what the reader is choosing between two near-identical words on.
|
|
905
|
-
label: t("article.tag-option", { title:
|
|
906
|
-
value:
|
|
905
|
+
label: t("article.tag-option", { title: b.title, count: b.articles_count }),
|
|
906
|
+
value: b.id
|
|
907
907
|
}))
|
|
908
|
-
),
|
|
909
|
-
const
|
|
910
|
-
if (
|
|
911
|
-
const P = (E) => E.toLowerCase() ===
|
|
912
|
-
return
|
|
908
|
+
), D = h(() => {
|
|
909
|
+
const b = $.value.trim();
|
|
910
|
+
if (b === "") return null;
|
|
911
|
+
const P = (E) => E.toLowerCase() === b.toLowerCase();
|
|
912
|
+
return y.value.some((E) => P(E.title)) ? null : b;
|
|
913
913
|
});
|
|
914
|
-
async function
|
|
914
|
+
async function B() {
|
|
915
915
|
try {
|
|
916
|
-
|
|
917
|
-
const
|
|
918
|
-
for (const P of
|
|
919
|
-
|
|
920
|
-
} catch (
|
|
921
|
-
|
|
916
|
+
y.value = await a.tags($.value);
|
|
917
|
+
const b = new Map(m.value);
|
|
918
|
+
for (const P of y.value) b.set(P.id, P.title);
|
|
919
|
+
m.value = b;
|
|
920
|
+
} catch (b) {
|
|
921
|
+
R.danger(u(b));
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
|
-
function
|
|
925
|
-
|
|
926
|
-
|
|
924
|
+
function w(b) {
|
|
925
|
+
$.value = b, clearTimeout(W), W = setTimeout(() => {
|
|
926
|
+
B();
|
|
927
927
|
}, aa);
|
|
928
928
|
}
|
|
929
|
-
function
|
|
930
|
-
typeof
|
|
929
|
+
function T(b) {
|
|
930
|
+
typeof b != "number" || v.value.includes(b) || (v.value = [...v.value, b], $.value = "");
|
|
931
931
|
}
|
|
932
|
-
function N(
|
|
933
|
-
|
|
932
|
+
function N(b) {
|
|
933
|
+
v.value = v.value.filter((P) => P !== b);
|
|
934
934
|
}
|
|
935
|
-
async function
|
|
936
|
-
const
|
|
937
|
-
if (!(
|
|
938
|
-
|
|
935
|
+
async function I() {
|
|
936
|
+
const b = D.value;
|
|
937
|
+
if (!(b === null || d.value)) {
|
|
938
|
+
d.value = !0;
|
|
939
939
|
try {
|
|
940
|
-
const P = await a.createTag({ title:
|
|
941
|
-
|
|
940
|
+
const P = await a.createTag({ title: b });
|
|
941
|
+
m.value = new Map(m.value).set(P.id, P.title), y.value = [P, ...y.value], T(P.id);
|
|
942
942
|
} catch (P) {
|
|
943
|
-
|
|
943
|
+
R.danger(u(P));
|
|
944
944
|
} finally {
|
|
945
|
-
|
|
945
|
+
d.value = !1;
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
return ve(
|
|
950
950
|
() => s?.article.value?.id,
|
|
951
951
|
() => {
|
|
952
|
-
|
|
952
|
+
B();
|
|
953
953
|
},
|
|
954
954
|
{ immediate: !0 }
|
|
955
|
-
), Ke(() => clearTimeout(
|
|
956
|
-
|
|
957
|
-
(
|
|
955
|
+
), Ke(() => clearTimeout(W)), (b, P) => (_(), H("div", Yt, [
|
|
956
|
+
V.value.length > 0 ? (_(), H("div", ea, [
|
|
957
|
+
(_(!0), H(ke, null, qe(V.value, (E) => (_(), q(e(ie), {
|
|
958
958
|
key: E.id,
|
|
959
959
|
type: "default",
|
|
960
|
-
closable: !
|
|
960
|
+
closable: !i.value,
|
|
961
961
|
"close-label": e(t)("article.tag-remove"),
|
|
962
|
-
onClose: (
|
|
962
|
+
onClose: (Z) => N(E.id)
|
|
963
963
|
}, {
|
|
964
|
-
default:
|
|
965
|
-
|
|
964
|
+
default: l(() => [
|
|
965
|
+
C(k(E.title), 1)
|
|
966
966
|
]),
|
|
967
967
|
_: 2
|
|
968
968
|
}, 1032, ["closable", "close-label", "onClose"]))), 128))
|
|
969
|
-
])) : (
|
|
969
|
+
])) : (_(), q(e(le), {
|
|
970
970
|
key: 1,
|
|
971
971
|
size: "sm",
|
|
972
972
|
tone: "muted"
|
|
973
973
|
}, {
|
|
974
|
-
default:
|
|
975
|
-
|
|
974
|
+
default: l(() => [
|
|
975
|
+
C(k(e(t)("article.tags-empty")), 1)
|
|
976
976
|
]),
|
|
977
977
|
_: 1
|
|
978
978
|
})),
|
|
979
979
|
F("div", ta, [
|
|
980
|
-
r(e(
|
|
980
|
+
r(e(_e), {
|
|
981
981
|
"model-value": null,
|
|
982
|
-
options:
|
|
982
|
+
options: z.value,
|
|
983
983
|
placeholder: e(t)("article.tag-add"),
|
|
984
984
|
"empty-text": e(t)("article.tag-nothing"),
|
|
985
|
-
disabled:
|
|
985
|
+
disabled: i.value,
|
|
986
986
|
filterable: "",
|
|
987
987
|
teleport: "",
|
|
988
988
|
"aria-label": e(t)("article.tag-add"),
|
|
989
|
-
onSearch:
|
|
990
|
-
"onUpdate:modelValue":
|
|
989
|
+
onSearch: w,
|
|
990
|
+
"onUpdate:modelValue": T
|
|
991
991
|
}, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"]),
|
|
992
|
-
|
|
992
|
+
D.value ? (_(), q(e(G), {
|
|
993
993
|
key: 0,
|
|
994
994
|
variant: "outline",
|
|
995
995
|
icon: "plus",
|
|
996
|
-
loading:
|
|
997
|
-
disabled:
|
|
998
|
-
onClick:
|
|
996
|
+
loading: d.value,
|
|
997
|
+
disabled: i.value,
|
|
998
|
+
onClick: I
|
|
999
999
|
}, {
|
|
1000
|
-
default:
|
|
1001
|
-
|
|
1000
|
+
default: l(() => [
|
|
1001
|
+
C(k(e(t)("article.tag-create", { title: D.value })), 1)
|
|
1002
1002
|
]),
|
|
1003
1003
|
_: 1
|
|
1004
1004
|
}, 8, ["loading", "disabled"])) : K("", !0)
|
|
@@ -1008,48 +1008,48 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1008
1008
|
}), ia = /* @__PURE__ */ ge(la, [["__scopeId", "data-v-faf5adec"]]), na = /* @__PURE__ */ Q({
|
|
1009
1009
|
name: "WxArticleUnpublish",
|
|
1010
1010
|
__name: "ArticleUnpublish",
|
|
1011
|
-
setup(
|
|
1012
|
-
const c =
|
|
1011
|
+
setup(g) {
|
|
1012
|
+
const c = ne(), v = ue(c), f = Ae();
|
|
1013
1013
|
X();
|
|
1014
|
-
const a =
|
|
1015
|
-
const
|
|
1016
|
-
return
|
|
1017
|
-
}),
|
|
1018
|
-
async function
|
|
1019
|
-
const
|
|
1020
|
-
if (!(!
|
|
1021
|
-
title: a("article.unpublish-title", { title:
|
|
1022
|
-
message:
|
|
1014
|
+
const a = J("webx-blog"), s = be(), t = M(!1), u = h(() => {
|
|
1015
|
+
const y = f?.article.value?.status;
|
|
1016
|
+
return y === "published" || y === "modified" || y === "scheduled";
|
|
1017
|
+
}), i = h(() => f?.disabled.value === !0 || t.value);
|
|
1018
|
+
async function m() {
|
|
1019
|
+
const y = f?.article.value;
|
|
1020
|
+
if (!(!y || !await de({
|
|
1021
|
+
title: a("article.unpublish-title", { title: y.title }),
|
|
1022
|
+
message: y.status === "scheduled" ? a("article.unpublish-waiting") : a("article.unpublish-text"),
|
|
1023
1023
|
confirmText: a("panel.unpublish"),
|
|
1024
1024
|
cancelText: a("panel.cancel"),
|
|
1025
1025
|
tone: "danger"
|
|
1026
1026
|
}))) {
|
|
1027
1027
|
t.value = !0;
|
|
1028
1028
|
try {
|
|
1029
|
-
await
|
|
1030
|
-
} catch (
|
|
1031
|
-
|
|
1029
|
+
await v.unpublish(y.id), await f?.reload(), R.success(a("panel.unpublished-done"));
|
|
1030
|
+
} catch (d) {
|
|
1031
|
+
R.danger(s(d));
|
|
1032
1032
|
} finally {
|
|
1033
1033
|
t.value = !1;
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
1036
|
}
|
|
1037
|
-
return (
|
|
1037
|
+
return (y, $) => u.value && e(f)?.canManage ? (_(), q(e(pe), {
|
|
1038
1038
|
key: 0,
|
|
1039
1039
|
class: "wx-article-unpublish",
|
|
1040
1040
|
help: e(a)("article.unpublish-help")
|
|
1041
1041
|
}, {
|
|
1042
|
-
default:
|
|
1042
|
+
default: l(() => [
|
|
1043
1043
|
r(e(G), {
|
|
1044
1044
|
variant: "outline",
|
|
1045
1045
|
type: "danger",
|
|
1046
1046
|
icon: "eye-off",
|
|
1047
1047
|
loading: t.value,
|
|
1048
|
-
disabled:
|
|
1049
|
-
onClick:
|
|
1048
|
+
disabled: i.value,
|
|
1049
|
+
onClick: m
|
|
1050
1050
|
}, {
|
|
1051
|
-
default:
|
|
1052
|
-
|
|
1051
|
+
default: l(() => [
|
|
1052
|
+
C(k(e(a)("panel.unpublish")), 1)
|
|
1053
1053
|
]),
|
|
1054
1054
|
_: 1
|
|
1055
1055
|
}, 8, ["loading", "disabled"])
|
|
@@ -1059,51 +1059,51 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1059
1059
|
}
|
|
1060
1060
|
}), sa = /* @__PURE__ */ ge(na, [["__scopeId", "data-v-c311cff2"]]), ra = /* @__PURE__ */ Q({
|
|
1061
1061
|
__name: "ArticleCreateDialog",
|
|
1062
|
-
setup(
|
|
1063
|
-
const { open: c, resolve:
|
|
1062
|
+
setup(g) {
|
|
1063
|
+
const { open: c, resolve: v, dismiss: f } = Re(), a = ne(), s = ue(a);
|
|
1064
1064
|
X();
|
|
1065
|
-
const t =
|
|
1065
|
+
const t = J("webx-blog"), u = M(""), i = M(!1), m = M({}), y = Ie("field");
|
|
1066
1066
|
Ne(async () => {
|
|
1067
|
-
await He(),
|
|
1067
|
+
await He(), y.value?.querySelector("input")?.focus();
|
|
1068
1068
|
});
|
|
1069
|
-
async function
|
|
1070
|
-
if (!(
|
|
1071
|
-
|
|
1069
|
+
async function $() {
|
|
1070
|
+
if (!(u.value.trim() === "" || i.value)) {
|
|
1071
|
+
i.value = !0, m.value = {};
|
|
1072
1072
|
try {
|
|
1073
|
-
|
|
1074
|
-
} catch (
|
|
1075
|
-
|
|
1073
|
+
v(await s.create({ title: u.value.trim() }));
|
|
1074
|
+
} catch (d) {
|
|
1075
|
+
m.value = d.body?.errors ?? {};
|
|
1076
1076
|
} finally {
|
|
1077
|
-
|
|
1077
|
+
i.value = !1;
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
|
-
return (
|
|
1081
|
+
return (d, W) => (_(), q(e(De), {
|
|
1082
1082
|
open: e(c),
|
|
1083
|
-
"onUpdate:open":
|
|
1083
|
+
"onUpdate:open": W[2] || (W[2] = (V) => Pe(c) ? c.value = V : null),
|
|
1084
1084
|
title: e(t)("panel.new-title"),
|
|
1085
1085
|
width: 440
|
|
1086
1086
|
}, {
|
|
1087
|
-
footer:
|
|
1087
|
+
footer: l(() => [
|
|
1088
1088
|
r(e(Be), { size: "sm" }, {
|
|
1089
|
-
default:
|
|
1089
|
+
default: l(() => [
|
|
1090
1090
|
r(e(G), {
|
|
1091
1091
|
variant: "outline",
|
|
1092
|
-
onClick:
|
|
1092
|
+
onClick: W[1] || (W[1] = (V) => e(f)())
|
|
1093
1093
|
}, {
|
|
1094
|
-
default:
|
|
1095
|
-
|
|
1094
|
+
default: l(() => [
|
|
1095
|
+
C(k(e(t)("panel.cancel")), 1)
|
|
1096
1096
|
]),
|
|
1097
1097
|
_: 1
|
|
1098
1098
|
}),
|
|
1099
1099
|
r(e(G), {
|
|
1100
1100
|
type: "primary",
|
|
1101
|
-
loading:
|
|
1102
|
-
disabled:
|
|
1103
|
-
onClick:
|
|
1101
|
+
loading: i.value,
|
|
1102
|
+
disabled: u.value.trim() === "",
|
|
1103
|
+
onClick: $
|
|
1104
1104
|
}, {
|
|
1105
|
-
default:
|
|
1106
|
-
|
|
1105
|
+
default: l(() => [
|
|
1106
|
+
C(k(e(t)("panel.create")), 1)
|
|
1107
1107
|
]),
|
|
1108
1108
|
_: 1
|
|
1109
1109
|
}, 8, ["loading", "disabled"])
|
|
@@ -1111,22 +1111,22 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1111
1111
|
_: 1
|
|
1112
1112
|
})
|
|
1113
1113
|
]),
|
|
1114
|
-
default:
|
|
1114
|
+
default: l(() => [
|
|
1115
1115
|
r(e(pe), {
|
|
1116
1116
|
label: e(t)("panel.field-title"),
|
|
1117
|
-
error:
|
|
1117
|
+
error: m.value.title?.[0] ?? m.value.slug?.[0],
|
|
1118
1118
|
required: ""
|
|
1119
1119
|
}, {
|
|
1120
|
-
default:
|
|
1120
|
+
default: l(() => [
|
|
1121
1121
|
F("div", {
|
|
1122
1122
|
ref_key: "field",
|
|
1123
|
-
ref:
|
|
1123
|
+
ref: y
|
|
1124
1124
|
}, [
|
|
1125
1125
|
r(e(Ce), {
|
|
1126
|
-
modelValue:
|
|
1127
|
-
"onUpdate:modelValue":
|
|
1126
|
+
modelValue: u.value,
|
|
1127
|
+
"onUpdate:modelValue": W[0] || (W[0] = (V) => u.value = V),
|
|
1128
1128
|
"aria-label": e(t)("panel.field-title"),
|
|
1129
|
-
onKeyup: Me(
|
|
1129
|
+
onKeyup: Me($, ["enter"])
|
|
1130
1130
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1131
1131
|
], 512)
|
|
1132
1132
|
]),
|
|
@@ -1136,32 +1136,32 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1136
1136
|
_: 1
|
|
1137
1137
|
}, 8, ["open", "title"]));
|
|
1138
1138
|
}
|
|
1139
|
-
}), oa = ["src"], ua = { class: "wx-articles__name" }, ca = { class: "wx-articles__name-text" }, da = { class: "wx-articles__title" }, pa = { class: "wx-articles__address" }, va = { class: "wx-articles__chips" }, ga = { class: "wx-articles__state" }, Xe = 640,
|
|
1139
|
+
}), oa = ["src"], ua = { class: "wx-articles__name" }, ca = { class: "wx-articles__name-text" }, da = { class: "wx-articles__title" }, pa = { class: "wx-articles__address" }, va = { class: "wx-articles__chips" }, ga = { class: "wx-articles__state" }, Xe = 640, fa = /* @__PURE__ */ Q({
|
|
1140
1140
|
__name: "ArticlesPage",
|
|
1141
1141
|
props: {
|
|
1142
1142
|
base: { default: "/blog" }
|
|
1143
1143
|
},
|
|
1144
|
-
setup(
|
|
1145
|
-
const c =
|
|
1144
|
+
setup(g) {
|
|
1145
|
+
const c = g, v = ne(), f = ue(v), a = Ge(), s = je();
|
|
1146
1146
|
X();
|
|
1147
|
-
const t =
|
|
1148
|
-
() =>
|
|
1149
|
-
),
|
|
1147
|
+
const t = J("webx-blog"), u = J("webx-admin"), i = be(), m = Ie("root"), y = At(m), $ = M(null), d = M(!0), W = Ve(ra), V = h(() => v.can("blog.articles.manage")), z = h(
|
|
1148
|
+
() => v.state.manifest?.modules.find((n) => n.id === "articles")?.title ?? t("module.articles")
|
|
1149
|
+
), D = h({
|
|
1150
1150
|
get: () => typeof a.query.view == "string" ? a.query.view : "",
|
|
1151
1151
|
set: (n) => {
|
|
1152
1152
|
s.replace({
|
|
1153
1153
|
query: { ...a.query, view: n === "" ? void 0 : String(n), page: void 0 }
|
|
1154
1154
|
});
|
|
1155
1155
|
}
|
|
1156
|
-
}),
|
|
1156
|
+
}), B = h(() => D.value === "trashed"), w = h(() => ({
|
|
1157
1157
|
q: typeof a.query.q == "string" ? a.query.q : "",
|
|
1158
|
-
rubric:
|
|
1159
|
-
tag:
|
|
1160
|
-
author:
|
|
1158
|
+
rubric: T(a.query.rubric),
|
|
1159
|
+
tag: T(a.query.tag),
|
|
1160
|
+
author: T(a.query.author),
|
|
1161
1161
|
sort: typeof a.query.sort == "string" ? a.query.sort : null,
|
|
1162
1162
|
page: Number(a.query.page ?? 1) || 1
|
|
1163
1163
|
}));
|
|
1164
|
-
function
|
|
1164
|
+
function T(n) {
|
|
1165
1165
|
return typeof n == "string" && n !== "" && Number(n) || null;
|
|
1166
1166
|
}
|
|
1167
1167
|
const N = h(() => [
|
|
@@ -1171,7 +1171,7 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1171
1171
|
{ value: "draft", label: t("panel.view-draft") },
|
|
1172
1172
|
{ value: "unpublished", label: t("panel.view-unpublished") },
|
|
1173
1173
|
{ value: "trashed", label: t("panel.bin"), icon: "trash" }
|
|
1174
|
-
]),
|
|
1174
|
+
]), I = h(() => $.value?.filters ?? { rubrics: [], tags: [], authors: [] }), b = h(() => y.value > 0 && y.value < Xe), P = h(() => b.value ? [{ key: "card", label: "" }] : [
|
|
1175
1175
|
{ key: "cover", label: "", width: 68 },
|
|
1176
1176
|
/* The one that takes what the others leave, and the only one without a number. */
|
|
1177
1177
|
{ key: "title", label: t("panel.column-title"), minWidth: 220 },
|
|
@@ -1179,7 +1179,7 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1179
1179
|
{ key: "author", label: t("panel.column-author"), width: 160, hideBelow: 1200 },
|
|
1180
1180
|
{
|
|
1181
1181
|
key: "date",
|
|
1182
|
-
label:
|
|
1182
|
+
label: B.value ? t("panel.column-deleted") : t("panel.column-date"),
|
|
1183
1183
|
width: 120,
|
|
1184
1184
|
hideBelow: 700,
|
|
1185
1185
|
// "today at 16:22" is three words the table will break over two lines given half a
|
|
@@ -1188,23 +1188,23 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1188
1188
|
},
|
|
1189
1189
|
{ key: "status", label: t("panel.column-status"), width: 170 },
|
|
1190
1190
|
{ key: "actions", label: "", width: Ye, align: "right" }
|
|
1191
|
-
]), E = h(() =>
|
|
1192
|
-
const n = [],
|
|
1193
|
-
|
|
1191
|
+
]), E = h(() => w.value.q !== "" ? t("panel.empty-search") : B.value ? t("panel.empty-bin") : t("panel.empty")), Z = h(() => {
|
|
1192
|
+
const n = [], U = I.value.rubrics.find((he) => he.id === w.value.rubric);
|
|
1193
|
+
U && n.push({
|
|
1194
1194
|
key: "rubric",
|
|
1195
|
-
label: `${t("panel.filter-rubric")}: ${
|
|
1195
|
+
label: `${t("panel.filter-rubric")}: ${U.title}`,
|
|
1196
1196
|
clear: () => O("rubric", void 0)
|
|
1197
1197
|
});
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1198
|
+
const p = I.value.tags.find((he) => he.id === w.value.tag);
|
|
1199
|
+
p && n.push({
|
|
1200
1200
|
key: "tag",
|
|
1201
|
-
label: `${t("panel.filter-tag")}: ${
|
|
1201
|
+
label: `${t("panel.filter-tag")}: ${p.title}`,
|
|
1202
1202
|
clear: () => O("tag", void 0)
|
|
1203
1203
|
});
|
|
1204
|
-
const
|
|
1205
|
-
return
|
|
1204
|
+
const xe = I.value.authors.find((he) => he.id === w.value.author);
|
|
1205
|
+
return xe && n.push({
|
|
1206
1206
|
key: "author",
|
|
1207
|
-
label: `${t("panel.filter-author")}: ${
|
|
1207
|
+
label: `${t("panel.filter-author")}: ${xe.title}`,
|
|
1208
1208
|
clear: () => O("author", void 0)
|
|
1209
1209
|
}), n;
|
|
1210
1210
|
});
|
|
@@ -1219,100 +1219,100 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1219
1219
|
}
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
|
-
async function
|
|
1223
|
-
|
|
1222
|
+
async function se(n) {
|
|
1223
|
+
d.value = !0;
|
|
1224
1224
|
try {
|
|
1225
|
-
|
|
1226
|
-
q: n?.search ??
|
|
1227
|
-
status:
|
|
1228
|
-
trashed:
|
|
1229
|
-
rubric:
|
|
1230
|
-
tag:
|
|
1231
|
-
author:
|
|
1225
|
+
$.value = await f.articles({
|
|
1226
|
+
q: n?.search ?? w.value.q,
|
|
1227
|
+
status: B.value ? "" : D.value,
|
|
1228
|
+
trashed: B.value,
|
|
1229
|
+
rubric: w.value.rubric,
|
|
1230
|
+
tag: w.value.tag,
|
|
1231
|
+
author: w.value.author,
|
|
1232
1232
|
sort: n?.sort ? `${n.sort.order === "desc" ? "-" : ""}${n.sort.key}` : null,
|
|
1233
|
-
page: n?.page ??
|
|
1233
|
+
page: n?.page ?? w.value.page,
|
|
1234
1234
|
per_page: n?.perPage
|
|
1235
1235
|
});
|
|
1236
|
-
} catch (
|
|
1237
|
-
|
|
1236
|
+
} catch (U) {
|
|
1237
|
+
R.danger(i(U));
|
|
1238
1238
|
} finally {
|
|
1239
|
-
|
|
1239
|
+
d.value = !1;
|
|
1240
1240
|
}
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1243
|
-
const
|
|
1242
|
+
function re(n) {
|
|
1243
|
+
const U = {
|
|
1244
1244
|
...a.query,
|
|
1245
1245
|
q: n.search === "" ? void 0 : n.search,
|
|
1246
1246
|
sort: n.sort === null ? void 0 : `${n.sort.order === "desc" ? "-" : ""}${n.sort.key}`,
|
|
1247
1247
|
page: n.page === 1 ? void 0 : String(n.page)
|
|
1248
1248
|
};
|
|
1249
|
-
s.replace({ query:
|
|
1249
|
+
s.replace({ query: U }), se(n);
|
|
1250
1250
|
}
|
|
1251
|
-
function O(n,
|
|
1251
|
+
function O(n, U) {
|
|
1252
1252
|
s.replace({
|
|
1253
1253
|
query: {
|
|
1254
1254
|
...a.query,
|
|
1255
|
-
[n]: typeof
|
|
1255
|
+
[n]: typeof U == "number" ? String(U) : void 0,
|
|
1256
1256
|
page: void 0
|
|
1257
1257
|
}
|
|
1258
1258
|
});
|
|
1259
1259
|
}
|
|
1260
1260
|
ve(
|
|
1261
|
-
[
|
|
1261
|
+
[D, () => w.value.rubric, () => w.value.tag, () => w.value.author],
|
|
1262
1262
|
() => {
|
|
1263
|
-
|
|
1263
|
+
se();
|
|
1264
1264
|
}
|
|
1265
|
-
),
|
|
1266
|
-
function
|
|
1267
|
-
const
|
|
1268
|
-
s.resolve(
|
|
1265
|
+
), se();
|
|
1266
|
+
function ye(n) {
|
|
1267
|
+
const U = `${c.base}/articles/${n.id}`;
|
|
1268
|
+
s.resolve(U).matched.length > 0 && s.push({ path: U, query: { ...a.query } });
|
|
1269
1269
|
}
|
|
1270
|
-
async function
|
|
1271
|
-
const n = await
|
|
1272
|
-
n && (await
|
|
1270
|
+
async function we() {
|
|
1271
|
+
const n = await W({});
|
|
1272
|
+
n && (await se(), ye(n));
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1275
|
-
if (!
|
|
1276
|
-
if (
|
|
1274
|
+
function te(n) {
|
|
1275
|
+
if (!V.value) return [];
|
|
1276
|
+
if (B.value)
|
|
1277
1277
|
return [
|
|
1278
1278
|
{
|
|
1279
1279
|
key: "restore",
|
|
1280
1280
|
icon: "refresh",
|
|
1281
1281
|
label: t("panel.restore"),
|
|
1282
1282
|
run: () => {
|
|
1283
|
-
|
|
1283
|
+
ce(n);
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
1286
|
];
|
|
1287
|
-
const
|
|
1288
|
-
{ key: "open", icon: "edit", label: t("panel.open"), run: () =>
|
|
1287
|
+
const U = [
|
|
1288
|
+
{ key: "open", icon: "edit", label: t("panel.open"), run: () => ye(n) }
|
|
1289
1289
|
];
|
|
1290
|
-
return n.url && n.status !== "draft" &&
|
|
1290
|
+
return n.url && n.status !== "draft" && U.push({
|
|
1291
1291
|
key: "site",
|
|
1292
1292
|
icon: "external-link",
|
|
1293
1293
|
label: t("panel.open-on-site"),
|
|
1294
1294
|
href: n.url
|
|
1295
|
-
}), n.path !== null &&
|
|
1295
|
+
}), n.path !== null && U.push({
|
|
1296
1296
|
key: "copy",
|
|
1297
1297
|
icon: "copy",
|
|
1298
1298
|
label: t("panel.copy-address"),
|
|
1299
1299
|
run: () => {
|
|
1300
|
-
|
|
1300
|
+
We(n);
|
|
1301
1301
|
}
|
|
1302
|
-
}),
|
|
1302
|
+
}), U.push({
|
|
1303
1303
|
key: "pin",
|
|
1304
1304
|
icon: "star",
|
|
1305
1305
|
label: n.pinned ? t("panel.unpin") : t("panel.pin"),
|
|
1306
1306
|
run: () => {
|
|
1307
|
-
|
|
1307
|
+
$e(n, !n.pinned);
|
|
1308
1308
|
}
|
|
1309
|
-
}),
|
|
1309
|
+
}), U.push(
|
|
1310
1310
|
n.status === "published" || n.status === "modified" || n.status === "scheduled" ? {
|
|
1311
1311
|
key: "unpublish",
|
|
1312
1312
|
icon: "eye-off",
|
|
1313
1313
|
label: t("panel.unpublish"),
|
|
1314
1314
|
run: () => {
|
|
1315
|
-
|
|
1315
|
+
Se(n);
|
|
1316
1316
|
}
|
|
1317
1317
|
} : {
|
|
1318
1318
|
key: "publish",
|
|
@@ -1322,114 +1322,114 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1322
1322
|
fe(n);
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
|
-
),
|
|
1325
|
+
), U.push({
|
|
1326
1326
|
key: "delete",
|
|
1327
1327
|
icon: "trash",
|
|
1328
1328
|
label: t("panel.delete"),
|
|
1329
1329
|
danger: !0,
|
|
1330
1330
|
run: () => {
|
|
1331
|
-
|
|
1331
|
+
oe(n);
|
|
1332
1332
|
}
|
|
1333
|
-
}),
|
|
1333
|
+
}), U;
|
|
1334
1334
|
}
|
|
1335
1335
|
async function fe(n) {
|
|
1336
|
-
await
|
|
1336
|
+
await ae(() => f.publish(n.id), t("panel.published"));
|
|
1337
1337
|
}
|
|
1338
|
-
async function
|
|
1339
|
-
await
|
|
1338
|
+
async function Se(n) {
|
|
1339
|
+
await ae(() => f.unpublish(n.id), t("panel.unpublished-done"));
|
|
1340
1340
|
}
|
|
1341
|
-
async function
|
|
1342
|
-
await
|
|
1343
|
-
() =>
|
|
1344
|
-
t(
|
|
1341
|
+
async function $e(n, U) {
|
|
1342
|
+
await ae(
|
|
1343
|
+
() => f.save(n.id, { values: { pinned: U }, revision: n.revision }),
|
|
1344
|
+
t(U ? "panel.pinned-done" : "panel.unpinned")
|
|
1345
1345
|
);
|
|
1346
1346
|
}
|
|
1347
|
-
async function
|
|
1347
|
+
async function oe(n) {
|
|
1348
1348
|
await de({
|
|
1349
1349
|
title: t("panel.delete-title", { title: n.title }),
|
|
1350
1350
|
message: t("panel.delete-text"),
|
|
1351
1351
|
confirmText: t("panel.delete"),
|
|
1352
1352
|
cancelText: t("panel.cancel"),
|
|
1353
1353
|
tone: "danger"
|
|
1354
|
-
}) && await
|
|
1354
|
+
}) && await ae(() => f.remove(n.id), t("panel.deleted"));
|
|
1355
1355
|
}
|
|
1356
|
-
async function
|
|
1357
|
-
await
|
|
1356
|
+
async function ce(n) {
|
|
1357
|
+
await ae(() => f.restore(n.id), t("panel.restored"));
|
|
1358
1358
|
}
|
|
1359
|
-
async function
|
|
1359
|
+
async function ae(n, U) {
|
|
1360
1360
|
try {
|
|
1361
|
-
await n(),
|
|
1362
|
-
} catch (
|
|
1363
|
-
|
|
1361
|
+
await n(), R.success(U);
|
|
1362
|
+
} catch (p) {
|
|
1363
|
+
R.danger(i(p));
|
|
1364
1364
|
} finally {
|
|
1365
|
-
await
|
|
1365
|
+
await se();
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
|
-
async function
|
|
1368
|
+
async function We(n) {
|
|
1369
1369
|
if (n.url)
|
|
1370
1370
|
try {
|
|
1371
|
-
await navigator.clipboard.writeText(n.url),
|
|
1371
|
+
await navigator.clipboard.writeText(n.url), R.success(t("panel.address-copied"));
|
|
1372
1372
|
} catch {
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
1375
|
-
function
|
|
1375
|
+
function o(n) {
|
|
1376
1376
|
return n === "published" || n === "modified" ? "success" : n === "scheduled" ? "warning" : "default";
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1379
|
-
return
|
|
1378
|
+
function A(n) {
|
|
1379
|
+
return B.value ? "—" : n.path === null ? t("panel.no-address") : `/${n.path}`;
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1382
|
-
return
|
|
1381
|
+
function S(n) {
|
|
1382
|
+
return B.value ? n.deleted_at : n.published_at;
|
|
1383
1383
|
}
|
|
1384
|
-
const
|
|
1385
|
-
() =>
|
|
1386
|
-
|
|
1384
|
+
const ee = h(
|
|
1385
|
+
() => V.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
|
|
1386
|
+
we();
|
|
1387
1387
|
} }] : []
|
|
1388
1388
|
);
|
|
1389
|
-
return (n,
|
|
1389
|
+
return (n, U) => (_(), H("div", {
|
|
1390
1390
|
ref_key: "root",
|
|
1391
|
-
ref:
|
|
1391
|
+
ref: m,
|
|
1392
1392
|
class: "wx-articles"
|
|
1393
1393
|
}, [
|
|
1394
1394
|
r(e(et), {
|
|
1395
|
-
view:
|
|
1396
|
-
"onUpdate:view":
|
|
1397
|
-
title:
|
|
1395
|
+
view: D.value,
|
|
1396
|
+
"onUpdate:view": U[3] || (U[3] = (p) => D.value = p),
|
|
1397
|
+
title: z.value,
|
|
1398
1398
|
views: N.value,
|
|
1399
|
-
actions:
|
|
1399
|
+
actions: ee.value
|
|
1400
1400
|
}, {
|
|
1401
|
-
default:
|
|
1401
|
+
default: l(() => [
|
|
1402
1402
|
r(e(it), {
|
|
1403
|
-
data:
|
|
1403
|
+
data: $.value,
|
|
1404
1404
|
columns: P.value,
|
|
1405
1405
|
"row-key": "id",
|
|
1406
1406
|
searchable: "",
|
|
1407
|
-
clickable: !
|
|
1408
|
-
hover: !
|
|
1407
|
+
clickable: !B.value,
|
|
1408
|
+
hover: !B.value,
|
|
1409
1409
|
flush: "",
|
|
1410
|
-
loading:
|
|
1410
|
+
loading: d.value,
|
|
1411
1411
|
layout: "fixed",
|
|
1412
1412
|
"cards-below": Xe,
|
|
1413
|
-
"filters-count":
|
|
1414
|
-
"filters-label": e(
|
|
1413
|
+
"filters-count": Z.value.length,
|
|
1414
|
+
"filters-label": e(u)("filters.title"),
|
|
1415
1415
|
"search-placeholder": e(t)("panel.search"),
|
|
1416
1416
|
"empty-text": E.value,
|
|
1417
|
-
"aria-label":
|
|
1418
|
-
onRowClick:
|
|
1419
|
-
onStateChange:
|
|
1417
|
+
"aria-label": z.value,
|
|
1418
|
+
onRowClick: ye,
|
|
1419
|
+
onStateChange: re
|
|
1420
1420
|
}, {
|
|
1421
|
-
filters:
|
|
1421
|
+
filters: l(() => [
|
|
1422
1422
|
r(e(pe), {
|
|
1423
1423
|
label: e(t)("panel.filter-rubric")
|
|
1424
1424
|
}, {
|
|
1425
|
-
default:
|
|
1426
|
-
r(e(
|
|
1427
|
-
"model-value":
|
|
1428
|
-
options:
|
|
1425
|
+
default: l(() => [
|
|
1426
|
+
r(e(_e), {
|
|
1427
|
+
"model-value": w.value.rubric,
|
|
1428
|
+
options: I.value.rubrics.map((p) => ({ value: p.id, label: p.title })),
|
|
1429
1429
|
placeholder: e(t)("panel.any-rubric"),
|
|
1430
1430
|
clearable: "",
|
|
1431
1431
|
size: "sm",
|
|
1432
|
-
"onUpdate:modelValue":
|
|
1432
|
+
"onUpdate:modelValue": U[0] || (U[0] = (p) => O("rubric", p))
|
|
1433
1433
|
}, null, 8, ["model-value", "options", "placeholder"])
|
|
1434
1434
|
]),
|
|
1435
1435
|
_: 1
|
|
@@ -1437,15 +1437,15 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1437
1437
|
r(e(pe), {
|
|
1438
1438
|
label: e(t)("panel.filter-tag")
|
|
1439
1439
|
}, {
|
|
1440
|
-
default:
|
|
1441
|
-
r(e(
|
|
1442
|
-
"model-value":
|
|
1443
|
-
options:
|
|
1440
|
+
default: l(() => [
|
|
1441
|
+
r(e(_e), {
|
|
1442
|
+
"model-value": w.value.tag,
|
|
1443
|
+
options: I.value.tags.map((p) => ({ value: p.id, label: p.title })),
|
|
1444
1444
|
placeholder: e(t)("panel.any-tag"),
|
|
1445
1445
|
clearable: "",
|
|
1446
1446
|
filterable: "",
|
|
1447
1447
|
size: "sm",
|
|
1448
|
-
"onUpdate:modelValue":
|
|
1448
|
+
"onUpdate:modelValue": U[1] || (U[1] = (p) => O("tag", p))
|
|
1449
1449
|
}, null, 8, ["model-value", "options", "placeholder"])
|
|
1450
1450
|
]),
|
|
1451
1451
|
_: 1
|
|
@@ -1453,61 +1453,61 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1453
1453
|
r(e(pe), {
|
|
1454
1454
|
label: e(t)("panel.filter-author")
|
|
1455
1455
|
}, {
|
|
1456
|
-
default:
|
|
1457
|
-
r(e(
|
|
1458
|
-
"model-value":
|
|
1459
|
-
options:
|
|
1456
|
+
default: l(() => [
|
|
1457
|
+
r(e(_e), {
|
|
1458
|
+
"model-value": w.value.author,
|
|
1459
|
+
options: I.value.authors.map((p) => ({ value: p.id, label: p.title })),
|
|
1460
1460
|
placeholder: e(t)("panel.any-author"),
|
|
1461
1461
|
clearable: "",
|
|
1462
1462
|
size: "sm",
|
|
1463
|
-
"onUpdate:modelValue":
|
|
1463
|
+
"onUpdate:modelValue": U[2] || (U[2] = (p) => O("author", p))
|
|
1464
1464
|
}, null, 8, ["model-value", "options", "placeholder"])
|
|
1465
1465
|
]),
|
|
1466
1466
|
_: 1
|
|
1467
1467
|
}, 8, ["label"]),
|
|
1468
|
-
|
|
1468
|
+
Z.value.length > 0 ? (_(), q(e(G), {
|
|
1469
1469
|
key: 0,
|
|
1470
1470
|
variant: "text",
|
|
1471
1471
|
size: "sm",
|
|
1472
1472
|
block: "",
|
|
1473
1473
|
onClick: Y
|
|
1474
1474
|
}, {
|
|
1475
|
-
icon:
|
|
1476
|
-
r(e(
|
|
1475
|
+
icon: l(() => [
|
|
1476
|
+
r(e(Te), { name: "close" })
|
|
1477
1477
|
]),
|
|
1478
|
-
default:
|
|
1479
|
-
|
|
1478
|
+
default: l(() => [
|
|
1479
|
+
C(" " + k(e(u)("filters.reset")), 1)
|
|
1480
1480
|
]),
|
|
1481
1481
|
_: 1
|
|
1482
1482
|
})) : K("", !0)
|
|
1483
1483
|
]),
|
|
1484
|
-
applied:
|
|
1485
|
-
r(e(vt), { filters:
|
|
1484
|
+
applied: l(() => [
|
|
1485
|
+
r(e(vt), { filters: Z.value }, null, 8, ["filters"])
|
|
1486
1486
|
]),
|
|
1487
|
-
"cell-cover":
|
|
1487
|
+
"cell-cover": l(({ row: p }) => [
|
|
1488
1488
|
F("span", {
|
|
1489
|
-
class: tt(["wx-articles__cover", { "is-empty": !
|
|
1489
|
+
class: tt(["wx-articles__cover", { "is-empty": !p.cover }])
|
|
1490
1490
|
}, [
|
|
1491
|
-
|
|
1491
|
+
p.cover?.thumb ? (_(), H("img", {
|
|
1492
1492
|
key: 0,
|
|
1493
|
-
src:
|
|
1493
|
+
src: p.cover.thumb,
|
|
1494
1494
|
alt: "",
|
|
1495
1495
|
loading: "lazy"
|
|
1496
|
-
}, null, 8, oa)) : (
|
|
1496
|
+
}, null, 8, oa)) : (_(), q(e(Te), {
|
|
1497
1497
|
key: 1,
|
|
1498
1498
|
name: "image",
|
|
1499
1499
|
size: "sm"
|
|
1500
1500
|
}))
|
|
1501
1501
|
], 2)
|
|
1502
1502
|
]),
|
|
1503
|
-
"cell-title":
|
|
1503
|
+
"cell-title": l(({ row: p }) => [
|
|
1504
1504
|
F("div", ua, [
|
|
1505
|
-
|
|
1505
|
+
p.pinned ? (_(), q(e(nt), {
|
|
1506
1506
|
key: 0,
|
|
1507
1507
|
content: e(t)("panel.pinned")
|
|
1508
1508
|
}, {
|
|
1509
|
-
default:
|
|
1510
|
-
r(e(
|
|
1509
|
+
default: l(() => [
|
|
1510
|
+
r(e(Te), {
|
|
1511
1511
|
class: "wx-articles__pin",
|
|
1512
1512
|
name: "star",
|
|
1513
1513
|
size: "sm"
|
|
@@ -1516,136 +1516,136 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1516
1516
|
_: 1
|
|
1517
1517
|
}, 8, ["content"])) : K("", !0),
|
|
1518
1518
|
F("div", ca, [
|
|
1519
|
-
F("span", da, k(
|
|
1520
|
-
F("span", pa, k(
|
|
1519
|
+
F("span", da, k(p.title), 1),
|
|
1520
|
+
F("span", pa, k(A(p)), 1)
|
|
1521
1521
|
])
|
|
1522
1522
|
])
|
|
1523
1523
|
]),
|
|
1524
|
-
"cell-rubrics":
|
|
1524
|
+
"cell-rubrics": l(({ row: p }) => [
|
|
1525
1525
|
F("span", va, [
|
|
1526
|
-
(
|
|
1527
|
-
key:
|
|
1526
|
+
(_(!0), H(ke, null, qe(p.rubrics, (xe) => (_(), q(e(ie), {
|
|
1527
|
+
key: xe.id,
|
|
1528
1528
|
size: "sm",
|
|
1529
1529
|
round: ""
|
|
1530
1530
|
}, {
|
|
1531
|
-
default:
|
|
1532
|
-
|
|
1531
|
+
default: l(() => [
|
|
1532
|
+
C(k(xe.title), 1)
|
|
1533
1533
|
]),
|
|
1534
1534
|
_: 2
|
|
1535
1535
|
}, 1024))), 128))
|
|
1536
1536
|
])
|
|
1537
1537
|
]),
|
|
1538
|
-
"cell-author":
|
|
1539
|
-
r(e(
|
|
1538
|
+
"cell-author": l(({ row: p }) => [
|
|
1539
|
+
r(e(le), {
|
|
1540
1540
|
size: "sm",
|
|
1541
1541
|
tone: "muted",
|
|
1542
1542
|
truncate: ""
|
|
1543
1543
|
}, {
|
|
1544
|
-
default:
|
|
1545
|
-
|
|
1544
|
+
default: l(() => [
|
|
1545
|
+
C(k(p.author ? p.author.name : "—"), 1)
|
|
1546
1546
|
]),
|
|
1547
1547
|
_: 2
|
|
1548
1548
|
}, 1024)
|
|
1549
1549
|
]),
|
|
1550
|
-
"cell-date":
|
|
1551
|
-
|
|
1550
|
+
"cell-date": l(({ row: p }) => [
|
|
1551
|
+
S(p) ? (_(), q(e(Ee), {
|
|
1552
1552
|
key: 0,
|
|
1553
|
-
value:
|
|
1553
|
+
value: S(p),
|
|
1554
1554
|
compact: ""
|
|
1555
|
-
}, null, 8, ["value"])) : (
|
|
1555
|
+
}, null, 8, ["value"])) : (_(), q(e(le), {
|
|
1556
1556
|
key: 1,
|
|
1557
1557
|
size: "sm",
|
|
1558
1558
|
tone: "muted"
|
|
1559
1559
|
}, {
|
|
1560
|
-
default:
|
|
1561
|
-
|
|
1560
|
+
default: l(() => [...U[4] || (U[4] = [
|
|
1561
|
+
C("—", -1)
|
|
1562
1562
|
])]),
|
|
1563
1563
|
_: 1
|
|
1564
1564
|
}))
|
|
1565
1565
|
]),
|
|
1566
|
-
"cell-status":
|
|
1566
|
+
"cell-status": l(({ row: p }) => [
|
|
1567
1567
|
F("span", ga, [
|
|
1568
|
-
r(e(
|
|
1569
|
-
type:
|
|
1568
|
+
r(e(ie), {
|
|
1569
|
+
type: o(p.status),
|
|
1570
1570
|
dot: "",
|
|
1571
1571
|
size: "sm"
|
|
1572
1572
|
}, {
|
|
1573
|
-
default:
|
|
1574
|
-
|
|
1573
|
+
default: l(() => [
|
|
1574
|
+
C(k(e(t)(`panel.status-${p.status}`)), 1)
|
|
1575
1575
|
]),
|
|
1576
1576
|
_: 2
|
|
1577
1577
|
}, 1032, ["type"]),
|
|
1578
|
-
|
|
1578
|
+
p.status === "modified" ? (_(), q(e(ie), {
|
|
1579
1579
|
key: 0,
|
|
1580
1580
|
type: "primary",
|
|
1581
1581
|
size: "sm",
|
|
1582
1582
|
round: ""
|
|
1583
1583
|
}, {
|
|
1584
|
-
default:
|
|
1585
|
-
|
|
1584
|
+
default: l(() => [
|
|
1585
|
+
C(k(e(t)("panel.edits")), 1)
|
|
1586
1586
|
]),
|
|
1587
1587
|
_: 1
|
|
1588
1588
|
})) : K("", !0)
|
|
1589
1589
|
])
|
|
1590
1590
|
]),
|
|
1591
|
-
"cell-card":
|
|
1591
|
+
"cell-card": l(({ row: p }) => [
|
|
1592
1592
|
r(e(St), {
|
|
1593
1593
|
class: "wx-articles__entity",
|
|
1594
1594
|
variant: "plain",
|
|
1595
|
-
title:
|
|
1596
|
-
image:
|
|
1595
|
+
title: p.title,
|
|
1596
|
+
image: p.cover?.thumb ?? void 0,
|
|
1597
1597
|
"image-size": "56px",
|
|
1598
1598
|
"title-lines": 2,
|
|
1599
|
-
subtitle:
|
|
1599
|
+
subtitle: A(p)
|
|
1600
1600
|
}, {
|
|
1601
|
-
title:
|
|
1602
|
-
|
|
1601
|
+
title: l(() => [
|
|
1602
|
+
p.pinned ? (_(), q(e(Te), {
|
|
1603
1603
|
key: 0,
|
|
1604
1604
|
class: "wx-articles__pin",
|
|
1605
1605
|
name: "star",
|
|
1606
1606
|
size: "sm"
|
|
1607
1607
|
})) : K("", !0),
|
|
1608
|
-
|
|
1608
|
+
C(" " + k(p.title), 1)
|
|
1609
1609
|
]),
|
|
1610
|
-
meta:
|
|
1611
|
-
|
|
1610
|
+
meta: l(() => [
|
|
1611
|
+
p.rubrics[0] ? (_(), q(e(ie), {
|
|
1612
1612
|
key: 0,
|
|
1613
1613
|
size: "sm",
|
|
1614
1614
|
round: ""
|
|
1615
1615
|
}, {
|
|
1616
|
-
default:
|
|
1617
|
-
|
|
1616
|
+
default: l(() => [
|
|
1617
|
+
C(k(p.rubrics[0].title), 1)
|
|
1618
1618
|
]),
|
|
1619
1619
|
_: 2
|
|
1620
1620
|
}, 1024)) : K("", !0),
|
|
1621
|
-
r(e(
|
|
1622
|
-
type:
|
|
1621
|
+
r(e(ie), {
|
|
1622
|
+
type: o(p.status),
|
|
1623
1623
|
dot: "",
|
|
1624
1624
|
size: "sm"
|
|
1625
1625
|
}, {
|
|
1626
|
-
default:
|
|
1627
|
-
|
|
1626
|
+
default: l(() => [
|
|
1627
|
+
C(k(e(t)(`panel.status-${p.status}`)), 1)
|
|
1628
1628
|
]),
|
|
1629
1629
|
_: 2
|
|
1630
1630
|
}, 1032, ["type"]),
|
|
1631
|
-
|
|
1631
|
+
S(p) ? (_(), q(e(Ee), {
|
|
1632
1632
|
key: 1,
|
|
1633
|
-
value:
|
|
1633
|
+
value: S(p)
|
|
1634
1634
|
}, null, 8, ["value"])) : K("", !0)
|
|
1635
1635
|
]),
|
|
1636
1636
|
_: 2
|
|
1637
1637
|
}, 1032, ["title", "image", "subtitle"])
|
|
1638
1638
|
]),
|
|
1639
|
-
"card-actions":
|
|
1639
|
+
"card-actions": l(({ row: p }) => [
|
|
1640
1640
|
r(e(ze), {
|
|
1641
|
-
actions:
|
|
1642
|
-
label:
|
|
1641
|
+
actions: te(p),
|
|
1642
|
+
label: p.title
|
|
1643
1643
|
}, null, 8, ["actions", "label"])
|
|
1644
1644
|
]),
|
|
1645
|
-
"cell-actions":
|
|
1645
|
+
"cell-actions": l(({ row: p }) => [
|
|
1646
1646
|
r(e(ze), {
|
|
1647
|
-
actions:
|
|
1648
|
-
label:
|
|
1647
|
+
actions: te(p),
|
|
1648
|
+
label: p.title
|
|
1649
1649
|
}, null, 8, ["actions", "label"])
|
|
1650
1650
|
]),
|
|
1651
1651
|
_: 1
|
|
@@ -1655,58 +1655,58 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1655
1655
|
}, 8, ["view", "title", "views", "actions"])
|
|
1656
1656
|
], 512));
|
|
1657
1657
|
}
|
|
1658
|
-
}),
|
|
1658
|
+
}), ha = /* @__PURE__ */ ge(fa, [["__scopeId", "data-v-d6800820"]]), ma = /* @__PURE__ */ Q({
|
|
1659
1659
|
__name: "TagCreateDialog",
|
|
1660
|
-
setup(
|
|
1661
|
-
const { open: c, resolve:
|
|
1660
|
+
setup(g) {
|
|
1661
|
+
const { open: c, resolve: v, dismiss: f } = Re(), a = ne(), s = ue(a);
|
|
1662
1662
|
X();
|
|
1663
|
-
const t =
|
|
1663
|
+
const t = J("webx-blog"), u = M(""), i = M(""), m = M(!1), y = M({}), $ = Ie("field");
|
|
1664
1664
|
Ne(async () => {
|
|
1665
|
-
await He(),
|
|
1665
|
+
await He(), $.value?.querySelector("input")?.focus();
|
|
1666
1666
|
});
|
|
1667
|
-
async function
|
|
1668
|
-
if (!(
|
|
1669
|
-
|
|
1667
|
+
async function d() {
|
|
1668
|
+
if (!(u.value.trim() === "" || m.value)) {
|
|
1669
|
+
m.value = !0, y.value = {};
|
|
1670
1670
|
try {
|
|
1671
|
-
|
|
1671
|
+
v(
|
|
1672
1672
|
await s.createTag({
|
|
1673
|
-
title:
|
|
1674
|
-
...
|
|
1673
|
+
title: u.value.trim(),
|
|
1674
|
+
...i.value.trim() === "" ? {} : { slug: i.value.trim() }
|
|
1675
1675
|
})
|
|
1676
1676
|
);
|
|
1677
|
-
} catch (
|
|
1678
|
-
|
|
1677
|
+
} catch (W) {
|
|
1678
|
+
y.value = W.body?.errors ?? {};
|
|
1679
1679
|
} finally {
|
|
1680
|
-
|
|
1680
|
+
m.value = !1;
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
1683
|
}
|
|
1684
|
-
return (
|
|
1684
|
+
return (W, V) => (_(), q(e(De), {
|
|
1685
1685
|
open: e(c),
|
|
1686
|
-
"onUpdate:open":
|
|
1686
|
+
"onUpdate:open": V[3] || (V[3] = (z) => Pe(c) ? c.value = z : null),
|
|
1687
1687
|
title: e(t)("tag.new-title"),
|
|
1688
1688
|
width: 440
|
|
1689
1689
|
}, {
|
|
1690
|
-
footer:
|
|
1690
|
+
footer: l(() => [
|
|
1691
1691
|
r(e(Be), { size: "sm" }, {
|
|
1692
|
-
default:
|
|
1692
|
+
default: l(() => [
|
|
1693
1693
|
r(e(G), {
|
|
1694
1694
|
variant: "outline",
|
|
1695
|
-
onClick:
|
|
1695
|
+
onClick: V[2] || (V[2] = (z) => e(f)())
|
|
1696
1696
|
}, {
|
|
1697
|
-
default:
|
|
1698
|
-
|
|
1697
|
+
default: l(() => [
|
|
1698
|
+
C(k(e(t)("tag.cancel")), 1)
|
|
1699
1699
|
]),
|
|
1700
1700
|
_: 1
|
|
1701
1701
|
}),
|
|
1702
1702
|
r(e(G), {
|
|
1703
1703
|
type: "primary",
|
|
1704
|
-
loading:
|
|
1705
|
-
disabled:
|
|
1706
|
-
onClick:
|
|
1704
|
+
loading: m.value,
|
|
1705
|
+
disabled: u.value.trim() === "",
|
|
1706
|
+
onClick: d
|
|
1707
1707
|
}, {
|
|
1708
|
-
default:
|
|
1709
|
-
|
|
1708
|
+
default: l(() => [
|
|
1709
|
+
C(k(e(t)("tag.create")), 1)
|
|
1710
1710
|
]),
|
|
1711
1711
|
_: 1
|
|
1712
1712
|
}, 8, ["loading", "disabled"])
|
|
@@ -1714,22 +1714,22 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1714
1714
|
_: 1
|
|
1715
1715
|
})
|
|
1716
1716
|
]),
|
|
1717
|
-
default:
|
|
1717
|
+
default: l(() => [
|
|
1718
1718
|
r(e(pe), {
|
|
1719
1719
|
label: e(t)("tag.field-title"),
|
|
1720
|
-
error:
|
|
1720
|
+
error: y.value.title?.[0],
|
|
1721
1721
|
required: ""
|
|
1722
1722
|
}, {
|
|
1723
|
-
default:
|
|
1723
|
+
default: l(() => [
|
|
1724
1724
|
F("div", {
|
|
1725
1725
|
ref_key: "field",
|
|
1726
|
-
ref:
|
|
1726
|
+
ref: $
|
|
1727
1727
|
}, [
|
|
1728
1728
|
r(e(Ce), {
|
|
1729
|
-
modelValue:
|
|
1730
|
-
"onUpdate:modelValue":
|
|
1729
|
+
modelValue: u.value,
|
|
1730
|
+
"onUpdate:modelValue": V[0] || (V[0] = (z) => u.value = z),
|
|
1731
1731
|
"aria-label": e(t)("tag.field-title"),
|
|
1732
|
-
onKeyup: Me(
|
|
1732
|
+
onKeyup: Me(d, ["enter"])
|
|
1733
1733
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1734
1734
|
], 512)
|
|
1735
1735
|
]),
|
|
@@ -1737,15 +1737,15 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1737
1737
|
}, 8, ["label", "error"]),
|
|
1738
1738
|
r(e(pe), {
|
|
1739
1739
|
label: e(t)("tag.field-slug"),
|
|
1740
|
-
error:
|
|
1740
|
+
error: y.value.slug?.[0],
|
|
1741
1741
|
help: e(t)("tag.field-slug-help")
|
|
1742
1742
|
}, {
|
|
1743
|
-
default:
|
|
1743
|
+
default: l(() => [
|
|
1744
1744
|
r(e(Ce), {
|
|
1745
|
-
modelValue:
|
|
1746
|
-
"onUpdate:modelValue":
|
|
1745
|
+
modelValue: i.value,
|
|
1746
|
+
"onUpdate:modelValue": V[1] || (V[1] = (z) => i.value = z),
|
|
1747
1747
|
"aria-label": e(t)("tag.field-slug"),
|
|
1748
|
-
onKeyup: Me(
|
|
1748
|
+
onKeyup: Me(d, ["enter"])
|
|
1749
1749
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1750
1750
|
]),
|
|
1751
1751
|
_: 1
|
|
@@ -1759,49 +1759,49 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1759
1759
|
props: {
|
|
1760
1760
|
name: {}
|
|
1761
1761
|
},
|
|
1762
|
-
setup(
|
|
1763
|
-
const c =
|
|
1762
|
+
setup(g) {
|
|
1763
|
+
const c = g, { open: v, resolve: f, dismiss: a } = Re();
|
|
1764
1764
|
X();
|
|
1765
|
-
const s =
|
|
1765
|
+
const s = J("webx-blog"), t = J("webx-admin"), u = yt(), i = M(c.name), m = Ie("field");
|
|
1766
1766
|
Ne(async () => {
|
|
1767
1767
|
await He();
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1768
|
+
const $ = m.value?.querySelector("input");
|
|
1769
|
+
$?.focus(), $?.select();
|
|
1770
1770
|
});
|
|
1771
|
-
function
|
|
1772
|
-
const
|
|
1773
|
-
if (
|
|
1771
|
+
function y() {
|
|
1772
|
+
const $ = i.value.trim();
|
|
1773
|
+
if ($ === "" || $ === c.name) {
|
|
1774
1774
|
a();
|
|
1775
1775
|
return;
|
|
1776
1776
|
}
|
|
1777
|
-
|
|
1777
|
+
f($);
|
|
1778
1778
|
}
|
|
1779
|
-
return (
|
|
1780
|
-
open: e(
|
|
1781
|
-
"onUpdate:open":
|
|
1779
|
+
return ($, d) => (_(), q(e(De), {
|
|
1780
|
+
open: e(v),
|
|
1781
|
+
"onUpdate:open": d[2] || (d[2] = (W) => Pe(v) ? v.value = W : null),
|
|
1782
1782
|
title: e(s)("tag.rename"),
|
|
1783
1783
|
width: 420
|
|
1784
1784
|
}, {
|
|
1785
|
-
footer:
|
|
1785
|
+
footer: l(() => [
|
|
1786
1786
|
r(e(Be), { size: "sm" }, {
|
|
1787
|
-
default:
|
|
1787
|
+
default: l(() => [
|
|
1788
1788
|
r(e(G), {
|
|
1789
1789
|
variant: "outline",
|
|
1790
|
-
onClick:
|
|
1790
|
+
onClick: d[1] || (d[1] = (W) => e(a)())
|
|
1791
1791
|
}, {
|
|
1792
|
-
default:
|
|
1793
|
-
|
|
1792
|
+
default: l(() => [
|
|
1793
|
+
C(k(e(s)("tag.cancel")), 1)
|
|
1794
1794
|
]),
|
|
1795
1795
|
_: 1
|
|
1796
1796
|
}),
|
|
1797
1797
|
r(e(G), {
|
|
1798
1798
|
type: "primary",
|
|
1799
1799
|
"native-type": "submit",
|
|
1800
|
-
form: e(
|
|
1801
|
-
disabled:
|
|
1800
|
+
form: e(u),
|
|
1801
|
+
disabled: i.value.trim() === ""
|
|
1802
1802
|
}, {
|
|
1803
|
-
default:
|
|
1804
|
-
|
|
1803
|
+
default: l(() => [
|
|
1804
|
+
C(k(e(t)("editor.save")), 1)
|
|
1805
1805
|
]),
|
|
1806
1806
|
_: 1
|
|
1807
1807
|
}, 8, ["form", "disabled"])
|
|
@@ -1809,23 +1809,23 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1809
1809
|
_: 1
|
|
1810
1810
|
})
|
|
1811
1811
|
]),
|
|
1812
|
-
default:
|
|
1812
|
+
default: l(() => [
|
|
1813
1813
|
F("form", {
|
|
1814
|
-
id: e(
|
|
1814
|
+
id: e(u),
|
|
1815
1815
|
ref_key: "field",
|
|
1816
|
-
ref:
|
|
1817
|
-
onSubmit: Je(
|
|
1816
|
+
ref: m,
|
|
1817
|
+
onSubmit: Je(y, ["prevent"])
|
|
1818
1818
|
}, [
|
|
1819
1819
|
r(e(pe), {
|
|
1820
1820
|
label: e(s)("tag.field-title"),
|
|
1821
1821
|
required: ""
|
|
1822
1822
|
}, {
|
|
1823
|
-
default:
|
|
1823
|
+
default: l(() => [
|
|
1824
1824
|
r(e(Ce), {
|
|
1825
|
-
modelValue:
|
|
1826
|
-
"onUpdate:modelValue":
|
|
1825
|
+
modelValue: i.value,
|
|
1826
|
+
"onUpdate:modelValue": d[0] || (d[0] = (W) => i.value = W),
|
|
1827
1827
|
"aria-label": e(s)("tag.field-title"),
|
|
1828
|
-
onKeydown: Me(Je(
|
|
1828
|
+
onKeydown: Me(Je(y, ["prevent"]), ["enter"])
|
|
1829
1829
|
}, null, 8, ["modelValue", "aria-label", "onKeydown"])
|
|
1830
1830
|
]),
|
|
1831
1831
|
_: 1
|
|
@@ -1840,58 +1840,58 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1840
1840
|
props: {
|
|
1841
1841
|
tags: {}
|
|
1842
1842
|
},
|
|
1843
|
-
setup(
|
|
1844
|
-
const c =
|
|
1843
|
+
setup(g) {
|
|
1844
|
+
const c = g, { open: v, resolve: f, dismiss: a } = Re(), s = ne(), t = ue(s);
|
|
1845
1845
|
X();
|
|
1846
|
-
const
|
|
1847
|
-
[...c.tags].sort((
|
|
1848
|
-
),
|
|
1849
|
-
() => c.tags.map((
|
|
1850
|
-
),
|
|
1851
|
-
async function
|
|
1852
|
-
if (!(
|
|
1853
|
-
|
|
1846
|
+
const u = J("webx-blog"), i = be(), m = M(
|
|
1847
|
+
[...c.tags].sort((T, N) => N.articles_count - T.articles_count)[0]?.id ?? 0
|
|
1848
|
+
), y = M(!1), $ = M(!0), d = M(null), W = h(
|
|
1849
|
+
() => c.tags.map((T) => ({ value: T.id, label: `${T.title} · ${T.articles_count}` }))
|
|
1850
|
+
), V = h(() => c.tags.find((T) => T.id === m.value) ?? null), z = h(() => c.tags.filter((T) => T.id !== m.value)), D = h(() => z.value.reduce((T, N) => T + N.articles_count, 0)), B = h(() => z.value.map((T) => T.path).filter(Boolean));
|
|
1851
|
+
async function w() {
|
|
1852
|
+
if (!(V.value === null || z.value.length === 0 || y.value)) {
|
|
1853
|
+
y.value = !0, d.value = null;
|
|
1854
1854
|
try {
|
|
1855
|
-
|
|
1855
|
+
f(
|
|
1856
1856
|
await t.mergeTags(
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1857
|
+
z.value.map((T) => T.id),
|
|
1858
|
+
m.value,
|
|
1859
|
+
$.value
|
|
1860
1860
|
)
|
|
1861
1861
|
);
|
|
1862
|
-
} catch (
|
|
1863
|
-
|
|
1862
|
+
} catch (T) {
|
|
1863
|
+
d.value = i(T);
|
|
1864
1864
|
} finally {
|
|
1865
|
-
|
|
1865
|
+
y.value = !1;
|
|
1866
1866
|
}
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
1869
|
-
return (
|
|
1870
|
-
open: e(
|
|
1871
|
-
"onUpdate:open": N[3] || (N[3] = (
|
|
1872
|
-
title: e(
|
|
1869
|
+
return (T, N) => (_(), q(e(De), {
|
|
1870
|
+
open: e(v),
|
|
1871
|
+
"onUpdate:open": N[3] || (N[3] = (I) => Pe(v) ? v.value = I : null),
|
|
1872
|
+
title: e(u)("tag.merge-title"),
|
|
1873
1873
|
width: 520
|
|
1874
1874
|
}, {
|
|
1875
|
-
footer:
|
|
1875
|
+
footer: l(() => [
|
|
1876
1876
|
r(e(Be), { size: "sm" }, {
|
|
1877
|
-
default:
|
|
1877
|
+
default: l(() => [
|
|
1878
1878
|
r(e(G), {
|
|
1879
1879
|
variant: "outline",
|
|
1880
|
-
onClick: N[2] || (N[2] = (
|
|
1880
|
+
onClick: N[2] || (N[2] = (I) => e(a)())
|
|
1881
1881
|
}, {
|
|
1882
|
-
default:
|
|
1883
|
-
|
|
1882
|
+
default: l(() => [
|
|
1883
|
+
C(k(e(u)("tag.cancel")), 1)
|
|
1884
1884
|
]),
|
|
1885
1885
|
_: 1
|
|
1886
1886
|
}),
|
|
1887
1887
|
r(e(G), {
|
|
1888
1888
|
type: "primary",
|
|
1889
|
-
loading:
|
|
1890
|
-
disabled:
|
|
1891
|
-
onClick:
|
|
1889
|
+
loading: y.value,
|
|
1890
|
+
disabled: z.value.length === 0,
|
|
1891
|
+
onClick: w
|
|
1892
1892
|
}, {
|
|
1893
|
-
default:
|
|
1894
|
-
|
|
1893
|
+
default: l(() => [
|
|
1894
|
+
C(k(e(u)("tag.merge-confirm")), 1)
|
|
1895
1895
|
]),
|
|
1896
1896
|
_: 1
|
|
1897
1897
|
}, 8, ["loading", "disabled"])
|
|
@@ -1899,60 +1899,60 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1899
1899
|
_: 1
|
|
1900
1900
|
})
|
|
1901
1901
|
]),
|
|
1902
|
-
default:
|
|
1902
|
+
default: l(() => [
|
|
1903
1903
|
F("div", wa, [
|
|
1904
1904
|
F("div", xa, [
|
|
1905
|
-
(
|
|
1906
|
-
key:
|
|
1905
|
+
(_(!0), H(ke, null, qe(z.value, (I) => (_(), q(e(ie), {
|
|
1906
|
+
key: I.id,
|
|
1907
1907
|
size: "sm",
|
|
1908
1908
|
round: ""
|
|
1909
1909
|
}, {
|
|
1910
|
-
default:
|
|
1911
|
-
|
|
1910
|
+
default: l(() => [
|
|
1911
|
+
C(k(I.title) + " · " + k(I.articles_count), 1)
|
|
1912
1912
|
]),
|
|
1913
1913
|
_: 2
|
|
1914
1914
|
}, 1024))), 128)),
|
|
1915
|
-
r(e(
|
|
1915
|
+
r(e(Te), {
|
|
1916
1916
|
name: "arrow-right",
|
|
1917
1917
|
size: "sm"
|
|
1918
1918
|
}),
|
|
1919
|
-
|
|
1919
|
+
V.value ? (_(), q(e(ie), {
|
|
1920
1920
|
key: 0,
|
|
1921
1921
|
type: "primary",
|
|
1922
1922
|
size: "sm",
|
|
1923
1923
|
round: ""
|
|
1924
1924
|
}, {
|
|
1925
|
-
default:
|
|
1926
|
-
|
|
1925
|
+
default: l(() => [
|
|
1926
|
+
C(k(V.value.title) + " · " + k(V.value.articles_count), 1)
|
|
1927
1927
|
]),
|
|
1928
1928
|
_: 1
|
|
1929
1929
|
})) : K("", !0)
|
|
1930
1930
|
]),
|
|
1931
1931
|
r(e(pe), {
|
|
1932
|
-
label: e(
|
|
1932
|
+
label: e(u)("tag.merge-keep")
|
|
1933
1933
|
}, {
|
|
1934
|
-
default:
|
|
1935
|
-
r(e(
|
|
1936
|
-
modelValue:
|
|
1937
|
-
"onUpdate:modelValue": N[0] || (N[0] = (
|
|
1938
|
-
options:
|
|
1939
|
-
"aria-label": e(
|
|
1934
|
+
default: l(() => [
|
|
1935
|
+
r(e(_e), {
|
|
1936
|
+
modelValue: m.value,
|
|
1937
|
+
"onUpdate:modelValue": N[0] || (N[0] = (I) => m.value = I),
|
|
1938
|
+
options: W.value,
|
|
1939
|
+
"aria-label": e(u)("tag.merge-keep")
|
|
1940
1940
|
}, null, 8, ["modelValue", "options", "aria-label"])
|
|
1941
1941
|
]),
|
|
1942
1942
|
_: 1
|
|
1943
1943
|
}, 8, ["label"]),
|
|
1944
1944
|
F("div", _a, [
|
|
1945
1945
|
r(e(Wt), {
|
|
1946
|
-
modelValue:
|
|
1947
|
-
"onUpdate:modelValue": N[1] || (N[1] = (
|
|
1948
|
-
label: e(
|
|
1946
|
+
modelValue: $.value,
|
|
1947
|
+
"onUpdate:modelValue": N[1] || (N[1] = (I) => $.value = I),
|
|
1948
|
+
label: e(u)("tag.merge-redirect")
|
|
1949
1949
|
}, null, 8, ["modelValue", "label"]),
|
|
1950
|
-
r(e(
|
|
1950
|
+
r(e(le), {
|
|
1951
1951
|
size: "sm",
|
|
1952
1952
|
tone: "muted"
|
|
1953
1953
|
}, {
|
|
1954
|
-
default:
|
|
1955
|
-
|
|
1954
|
+
default: l(() => [
|
|
1955
|
+
C(k(B.value.length === 0 ? e(u)("tag.merge-redirect-none") : e(u)("tag.merge-redirect-help", { addresses: B.value.join(", ") })), 1)
|
|
1956
1956
|
]),
|
|
1957
1957
|
_: 1
|
|
1958
1958
|
})
|
|
@@ -1960,17 +1960,17 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1960
1960
|
r(e(Ue), {
|
|
1961
1961
|
type: "warning",
|
|
1962
1962
|
variant: "soft",
|
|
1963
|
-
description: e(
|
|
1964
|
-
count:
|
|
1965
|
-
tag:
|
|
1966
|
-
merged:
|
|
1963
|
+
description: e(u)("tag.merge-warning", {
|
|
1964
|
+
count: D.value,
|
|
1965
|
+
tag: V.value?.title ?? "",
|
|
1966
|
+
merged: z.value.length
|
|
1967
1967
|
})
|
|
1968
1968
|
}, null, 8, ["description"]),
|
|
1969
|
-
|
|
1969
|
+
d.value ? (_(), q(e(Ue), {
|
|
1970
1970
|
key: 0,
|
|
1971
1971
|
type: "danger",
|
|
1972
1972
|
variant: "soft",
|
|
1973
|
-
description:
|
|
1973
|
+
description: d.value
|
|
1974
1974
|
}, null, 8, ["description"])) : K("", !0)
|
|
1975
1975
|
])
|
|
1976
1976
|
]),
|
|
@@ -1982,23 +1982,23 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
1982
1982
|
props: {
|
|
1983
1983
|
base: { default: "/blog" }
|
|
1984
1984
|
},
|
|
1985
|
-
setup(
|
|
1986
|
-
const c =
|
|
1985
|
+
setup(g) {
|
|
1986
|
+
const c = g, v = ne(), f = ue(v), a = Ge(), s = je();
|
|
1987
1987
|
X();
|
|
1988
|
-
const t =
|
|
1989
|
-
() =>
|
|
1990
|
-
),
|
|
1988
|
+
const t = J("webx-blog"), u = J("webx-admin"), i = be(), m = M(null), y = M(!0), $ = M([]), d = M(!1), W = Ve(ya), V = Ve(ma), z = Ve($a), D = h(() => v.can("blog.taxonomy.manage")), B = h(
|
|
1989
|
+
() => v.state.manifest?.modules.find((o) => o.id === "tags")?.title ?? t("module.tags")
|
|
1990
|
+
), w = h({
|
|
1991
1991
|
get: () => typeof a.query.view == "string" ? a.query.view : "",
|
|
1992
|
-
set: (
|
|
1992
|
+
set: (o) => {
|
|
1993
1993
|
s.replace({
|
|
1994
|
-
query: { ...a.query, view:
|
|
1994
|
+
query: { ...a.query, view: o === "" ? void 0 : String(o), page: void 0 }
|
|
1995
1995
|
});
|
|
1996
1996
|
}
|
|
1997
|
-
}),
|
|
1998
|
-
{ value: "", label: t("tag.view-all"), badge:
|
|
1999
|
-
{ value: "empty", label: t("tag.view-empty"), badge:
|
|
2000
|
-
{ value: "noindex", label: t("tag.view-noindex"), badge:
|
|
2001
|
-
]),
|
|
1997
|
+
}), T = h(() => m.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), N = h(() => [
|
|
1998
|
+
{ value: "", label: t("tag.view-all"), badge: T.value.total },
|
|
1999
|
+
{ value: "empty", label: t("tag.view-empty"), badge: T.value.empty },
|
|
2000
|
+
{ value: "noindex", label: t("tag.view-noindex"), badge: T.value.noindex }
|
|
2001
|
+
]), I = h(() => m.value?.data ?? []), b = h(() => I.value.filter((o) => $.value.includes(o.id))), P = h(() => [
|
|
2002
2002
|
{ key: "title", label: t("tag.column-title"), minWidth: 150, sortable: !0 },
|
|
2003
2003
|
// The number is what the other columns and the narrowest the title may be add up to without
|
|
2004
2004
|
// this one: below it the address is what does not fit, and a fixed table does not shrink —
|
|
@@ -2018,104 +2018,104 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
2018
2018
|
{ key: "indexing", label: t("tag.column-indexing"), width: 230, hideBelow: 560 },
|
|
2019
2019
|
{ key: "actions", label: "", width: Ye, align: "right" }
|
|
2020
2020
|
]);
|
|
2021
|
-
function
|
|
2021
|
+
function E(o) {
|
|
2022
2022
|
return {
|
|
2023
|
-
q:
|
|
2024
|
-
empty:
|
|
2025
|
-
noindex:
|
|
2023
|
+
q: o?.search ?? (typeof a.query.q == "string" ? a.query.q : ""),
|
|
2024
|
+
empty: w.value === "empty",
|
|
2025
|
+
noindex: w.value === "noindex",
|
|
2026
2026
|
// Only when it is not the default: most used first is what the list is, and a query
|
|
2027
2027
|
// string that repeats the default is a link that outlives a change of mind about it.
|
|
2028
|
-
sort:
|
|
2029
|
-
page:
|
|
2030
|
-
per_page:
|
|
2028
|
+
sort: Y(o),
|
|
2029
|
+
page: o?.page ?? (Number(a.query.page ?? 1) || 1),
|
|
2030
|
+
per_page: o?.perPage
|
|
2031
2031
|
};
|
|
2032
2032
|
}
|
|
2033
|
-
async function
|
|
2034
|
-
|
|
2033
|
+
async function Z(o) {
|
|
2034
|
+
y.value = !0;
|
|
2035
2035
|
try {
|
|
2036
|
-
|
|
2037
|
-
} catch (
|
|
2038
|
-
|
|
2036
|
+
m.value = await f.tagsPage(E(o));
|
|
2037
|
+
} catch (A) {
|
|
2038
|
+
R.danger(i(A));
|
|
2039
2039
|
} finally {
|
|
2040
|
-
|
|
2040
|
+
y.value = !1;
|
|
2041
2041
|
}
|
|
2042
2042
|
}
|
|
2043
|
-
function
|
|
2044
|
-
const
|
|
2045
|
-
if (!
|
|
2046
|
-
const
|
|
2047
|
-
return
|
|
2043
|
+
function Y(o) {
|
|
2044
|
+
const A = o?.sort ?? se();
|
|
2045
|
+
if (!A) return;
|
|
2046
|
+
const S = A.key === "title" ? "name" : "articles", ee = `${A.order === "desc" ? "-" : ""}${S}`;
|
|
2047
|
+
return ee === "articles" ? void 0 : ee;
|
|
2048
2048
|
}
|
|
2049
|
-
function
|
|
2050
|
-
const
|
|
2051
|
-
if (
|
|
2052
|
-
const
|
|
2053
|
-
return { key: (
|
|
2049
|
+
function se() {
|
|
2050
|
+
const o = typeof a.query.sort == "string" ? a.query.sort : "";
|
|
2051
|
+
if (o === "") return null;
|
|
2052
|
+
const A = o.startsWith("-");
|
|
2053
|
+
return { key: (A ? o.slice(1) : o) === "name" ? "title" : "articles_count", order: A ? "desc" : "asc" };
|
|
2054
2054
|
}
|
|
2055
|
-
function
|
|
2056
|
-
const
|
|
2055
|
+
function re(o) {
|
|
2056
|
+
const A = {
|
|
2057
2057
|
...a.query,
|
|
2058
|
-
q:
|
|
2059
|
-
sort:
|
|
2060
|
-
page:
|
|
2058
|
+
q: o.search === "" ? void 0 : o.search,
|
|
2059
|
+
sort: Y(o),
|
|
2060
|
+
page: o.page === 1 ? void 0 : String(o.page)
|
|
2061
2061
|
};
|
|
2062
|
-
s.replace({ query:
|
|
2062
|
+
s.replace({ query: A }), Z(o);
|
|
2063
2063
|
}
|
|
2064
|
-
ve(
|
|
2065
|
-
|
|
2066
|
-
}),
|
|
2067
|
-
async function
|
|
2068
|
-
await
|
|
2064
|
+
ve(w, () => {
|
|
2065
|
+
$.value = [], Z();
|
|
2066
|
+
}), Z();
|
|
2067
|
+
async function O() {
|
|
2068
|
+
await V({}) && await Z();
|
|
2069
2069
|
}
|
|
2070
|
-
async function
|
|
2071
|
-
const
|
|
2072
|
-
|
|
2070
|
+
async function ye(o) {
|
|
2071
|
+
const A = await W({ name: o.title });
|
|
2072
|
+
A && await te(o, { title: A }, t("tag.renamed"));
|
|
2073
2073
|
}
|
|
2074
|
-
async function
|
|
2075
|
-
await
|
|
2074
|
+
async function we(o, A) {
|
|
2075
|
+
await te(o, { noindex: A }, t(A ? "tag.kept-out" : "tag.indexed"));
|
|
2076
2076
|
}
|
|
2077
|
-
async function
|
|
2077
|
+
async function te(o, A, S) {
|
|
2078
2078
|
try {
|
|
2079
|
-
const
|
|
2080
|
-
|
|
2081
|
-
...
|
|
2082
|
-
data:
|
|
2083
|
-
}),
|
|
2084
|
-
} catch (
|
|
2085
|
-
|
|
2079
|
+
const ee = await f.saveTag(o.id, A);
|
|
2080
|
+
m.value && (m.value = {
|
|
2081
|
+
...m.value,
|
|
2082
|
+
data: m.value.data.map((n) => n.id === ee.id ? ee : n)
|
|
2083
|
+
}), R.success(S);
|
|
2084
|
+
} catch (ee) {
|
|
2085
|
+
R.danger(i(ee));
|
|
2086
2086
|
}
|
|
2087
2087
|
}
|
|
2088
|
-
async function
|
|
2088
|
+
async function fe(o) {
|
|
2089
2089
|
if (await de({
|
|
2090
|
-
title: t("tag.delete-title", { title:
|
|
2091
|
-
message:
|
|
2090
|
+
title: t("tag.delete-title", { title: o.title }),
|
|
2091
|
+
message: o.articles_count > 0 ? t("tag.delete-text-used", { count: o.articles_count }) : t("tag.delete-text"),
|
|
2092
2092
|
confirmText: t("tag.delete"),
|
|
2093
2093
|
cancelText: t("tag.cancel"),
|
|
2094
2094
|
tone: "danger"
|
|
2095
2095
|
}))
|
|
2096
2096
|
try {
|
|
2097
|
-
await
|
|
2098
|
-
} catch (
|
|
2099
|
-
|
|
2097
|
+
await f.removeTag(o.id), R.success(t("tag.deleted")), $.value = $.value.filter((S) => S !== o.id), await Z();
|
|
2098
|
+
} catch (S) {
|
|
2099
|
+
R.danger(i(S));
|
|
2100
2100
|
}
|
|
2101
2101
|
}
|
|
2102
|
-
const
|
|
2102
|
+
const Se = h(() => [
|
|
2103
2103
|
{
|
|
2104
2104
|
key: "index",
|
|
2105
2105
|
icon: "eye",
|
|
2106
2106
|
label: t("tag.index"),
|
|
2107
|
-
disabled:
|
|
2107
|
+
disabled: d.value,
|
|
2108
2108
|
run: () => {
|
|
2109
|
-
|
|
2109
|
+
ae("index");
|
|
2110
2110
|
}
|
|
2111
2111
|
},
|
|
2112
2112
|
{
|
|
2113
2113
|
key: "noindex",
|
|
2114
2114
|
icon: "eye-off",
|
|
2115
2115
|
label: t("tag.noindex"),
|
|
2116
|
-
disabled:
|
|
2116
|
+
disabled: d.value,
|
|
2117
2117
|
run: () => {
|
|
2118
|
-
|
|
2118
|
+
ae("noindex");
|
|
2119
2119
|
}
|
|
2120
2120
|
},
|
|
2121
2121
|
{
|
|
@@ -2123,241 +2123,243 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
|
|
|
2123
2123
|
icon: "trash",
|
|
2124
2124
|
label: t("tag.delete"),
|
|
2125
2125
|
danger: !0,
|
|
2126
|
-
disabled:
|
|
2126
|
+
disabled: d.value,
|
|
2127
2127
|
run: () => {
|
|
2128
|
-
|
|
2128
|
+
ae("delete");
|
|
2129
2129
|
}
|
|
2130
2130
|
}
|
|
2131
2131
|
]);
|
|
2132
|
-
function
|
|
2133
|
-
if (!
|
|
2134
|
-
const
|
|
2132
|
+
function $e(o) {
|
|
2133
|
+
if (!D.value) return [];
|
|
2134
|
+
const A = [
|
|
2135
2135
|
{ key: "rename", icon: "edit", label: t("tag.rename"), run: () => {
|
|
2136
|
-
|
|
2136
|
+
ye(o);
|
|
2137
2137
|
} }
|
|
2138
2138
|
];
|
|
2139
|
-
return
|
|
2139
|
+
return o.url && A.push({
|
|
2140
2140
|
key: "site",
|
|
2141
2141
|
icon: "external-link",
|
|
2142
2142
|
label: t("tag.open-on-site"),
|
|
2143
|
-
href:
|
|
2144
|
-
}),
|
|
2143
|
+
href: o.url
|
|
2144
|
+
}), A.push({
|
|
2145
2145
|
key: "articles",
|
|
2146
2146
|
icon: "list",
|
|
2147
2147
|
label: t("tag.show-articles"),
|
|
2148
2148
|
run: () => {
|
|
2149
|
-
s.push({ path: `${c.base}/articles`, query: { tag: String(
|
|
2149
|
+
s.push({ path: `${c.base}/articles`, query: { tag: String(o.id) } });
|
|
2150
2150
|
}
|
|
2151
|
-
}),
|
|
2152
|
-
|
|
2151
|
+
}), A.push(
|
|
2152
|
+
o.noindex ? {
|
|
2153
2153
|
key: "index",
|
|
2154
2154
|
icon: "eye",
|
|
2155
2155
|
label: t("tag.index"),
|
|
2156
2156
|
run: () => {
|
|
2157
|
-
|
|
2157
|
+
we(o, !1);
|
|
2158
2158
|
}
|
|
2159
2159
|
} : {
|
|
2160
2160
|
key: "noindex",
|
|
2161
2161
|
icon: "eye-off",
|
|
2162
2162
|
label: t("tag.noindex"),
|
|
2163
2163
|
run: () => {
|
|
2164
|
-
|
|
2164
|
+
we(o, !0);
|
|
2165
2165
|
}
|
|
2166
2166
|
}
|
|
2167
|
-
),
|
|
2167
|
+
), A.push({
|
|
2168
2168
|
key: "delete",
|
|
2169
2169
|
icon: "trash",
|
|
2170
2170
|
label: t("tag.delete"),
|
|
2171
2171
|
danger: !0,
|
|
2172
2172
|
run: () => {
|
|
2173
|
-
|
|
2173
|
+
fe(o);
|
|
2174
2174
|
}
|
|
2175
|
-
}),
|
|
2175
|
+
}), A;
|
|
2176
2176
|
}
|
|
2177
|
-
function
|
|
2178
|
-
return
|
|
2177
|
+
function oe(o) {
|
|
2178
|
+
return o === "noindex" ? "muted" : "success";
|
|
2179
2179
|
}
|
|
2180
|
-
async function
|
|
2181
|
-
if (
|
|
2182
|
-
const
|
|
2183
|
-
|
|
2180
|
+
async function ce() {
|
|
2181
|
+
if (b.value.length < 2) return;
|
|
2182
|
+
const o = await z({ tags: b.value });
|
|
2183
|
+
o && (R.success(t("tag.merged", { tag: o.tag.title, count: o.articles_count })), $.value = [], await Z());
|
|
2184
2184
|
}
|
|
2185
|
-
async function
|
|
2186
|
-
const
|
|
2187
|
-
if (!(
|
|
2188
|
-
if (
|
|
2189
|
-
const
|
|
2185
|
+
async function ae(o) {
|
|
2186
|
+
const A = b.value.map((S) => S.id);
|
|
2187
|
+
if (!(A.length === 0 || d.value)) {
|
|
2188
|
+
if (o === "delete") {
|
|
2189
|
+
const S = b.value.reduce((n, U) => n + U.articles_count, 0);
|
|
2190
2190
|
if (!await de({
|
|
2191
|
-
title: t("tag.delete-many-title", { count:
|
|
2192
|
-
message:
|
|
2191
|
+
title: t("tag.delete-many-title", { count: A.length }),
|
|
2192
|
+
message: S > 0 ? t("tag.delete-many-text-used", { count: S }) : t("tag.delete-many-text"),
|
|
2193
2193
|
confirmText: t("tag.delete"),
|
|
2194
2194
|
cancelText: t("tag.cancel"),
|
|
2195
2195
|
tone: "danger"
|
|
2196
2196
|
})) return;
|
|
2197
2197
|
}
|
|
2198
|
-
|
|
2198
|
+
d.value = !0;
|
|
2199
2199
|
try {
|
|
2200
|
-
const
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
),
|
|
2204
|
-
} catch (
|
|
2205
|
-
|
|
2200
|
+
const S = await f.massTags(A, o);
|
|
2201
|
+
R.success(
|
|
2202
|
+
o === "delete" ? t("tag.deleted-many", { count: S }) : o === "index" ? t("tag.indexed-many", { count: S }) : t("tag.kept-out-many", { count: S })
|
|
2203
|
+
), $.value = [], await Z();
|
|
2204
|
+
} catch (S) {
|
|
2205
|
+
R.danger(i(S));
|
|
2206
2206
|
} finally {
|
|
2207
|
-
|
|
2207
|
+
d.value = !1;
|
|
2208
2208
|
}
|
|
2209
2209
|
}
|
|
2210
2210
|
}
|
|
2211
|
-
const
|
|
2212
|
-
() =>
|
|
2213
|
-
|
|
2211
|
+
const We = h(
|
|
2212
|
+
() => D.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
|
|
2213
|
+
O();
|
|
2214
2214
|
} }] : []
|
|
2215
2215
|
);
|
|
2216
|
-
return (
|
|
2216
|
+
return (o, A) => (_(), H("div", Ta, [
|
|
2217
2217
|
r(e(et), {
|
|
2218
|
-
view:
|
|
2219
|
-
"onUpdate:view":
|
|
2218
|
+
view: w.value,
|
|
2219
|
+
"onUpdate:view": A[1] || (A[1] = (S) => w.value = S),
|
|
2220
2220
|
title: B.value,
|
|
2221
|
-
views:
|
|
2222
|
-
actions:
|
|
2221
|
+
views: N.value,
|
|
2222
|
+
actions: We.value
|
|
2223
2223
|
}, {
|
|
2224
|
-
default:
|
|
2224
|
+
default: l(() => [
|
|
2225
2225
|
r(e(it), {
|
|
2226
|
-
selected:
|
|
2227
|
-
"onUpdate:selected":
|
|
2228
|
-
data:
|
|
2229
|
-
columns:
|
|
2226
|
+
selected: $.value,
|
|
2227
|
+
"onUpdate:selected": A[0] || (A[0] = (S) => $.value = S),
|
|
2228
|
+
data: m.value,
|
|
2229
|
+
columns: P.value,
|
|
2230
2230
|
"row-key": "id",
|
|
2231
2231
|
searchable: "",
|
|
2232
2232
|
hover: "",
|
|
2233
2233
|
flush: "",
|
|
2234
2234
|
layout: "fixed",
|
|
2235
|
-
loading:
|
|
2236
|
-
selectable:
|
|
2235
|
+
loading: y.value,
|
|
2236
|
+
selectable: D.value,
|
|
2237
|
+
"select-row-label": e(u)("filters.select-row"),
|
|
2238
|
+
"select-all-label": e(u)("filters.select-all"),
|
|
2237
2239
|
"cards-below": 0,
|
|
2238
2240
|
"search-placeholder": e(t)("tag.search"),
|
|
2239
|
-
"empty-text":
|
|
2241
|
+
"empty-text": I.value.length === 0 && !y.value ? e(t)("tag.empty") : void 0,
|
|
2240
2242
|
"aria-label": B.value,
|
|
2241
|
-
onStateChange:
|
|
2243
|
+
onStateChange: re
|
|
2242
2244
|
}, {
|
|
2243
|
-
"cell-title":
|
|
2244
|
-
r(e(
|
|
2245
|
-
default:
|
|
2246
|
-
|
|
2245
|
+
"cell-title": l(({ row: S }) => [
|
|
2246
|
+
r(e(le), { truncate: "" }, {
|
|
2247
|
+
default: l(() => [
|
|
2248
|
+
C(k(S.title), 1)
|
|
2247
2249
|
]),
|
|
2248
2250
|
_: 2
|
|
2249
2251
|
}, 1024)
|
|
2250
2252
|
]),
|
|
2251
|
-
"cell-path":
|
|
2252
|
-
r(e(
|
|
2253
|
+
"cell-path": l(({ row: S }) => [
|
|
2254
|
+
r(e(le), {
|
|
2253
2255
|
size: "sm",
|
|
2254
2256
|
tone: "muted",
|
|
2255
2257
|
mono: "",
|
|
2256
2258
|
truncate: ""
|
|
2257
2259
|
}, {
|
|
2258
|
-
default:
|
|
2259
|
-
|
|
2260
|
+
default: l(() => [
|
|
2261
|
+
C(k(S.path ?? e(t)("tag.no-address")), 1)
|
|
2260
2262
|
]),
|
|
2261
2263
|
_: 2
|
|
2262
2264
|
}, 1024)
|
|
2263
2265
|
]),
|
|
2264
|
-
"cell-articles_count":
|
|
2265
|
-
r(e(
|
|
2266
|
-
tone:
|
|
2266
|
+
"cell-articles_count": l(({ row: S }) => [
|
|
2267
|
+
r(e(le), {
|
|
2268
|
+
tone: S.articles_count === 0 ? "muted" : "default"
|
|
2267
2269
|
}, {
|
|
2268
|
-
default:
|
|
2269
|
-
|
|
2270
|
+
default: l(() => [
|
|
2271
|
+
C(k(S.articles_count), 1)
|
|
2270
2272
|
]),
|
|
2271
2273
|
_: 2
|
|
2272
2274
|
}, 1032, ["tone"])
|
|
2273
2275
|
]),
|
|
2274
|
-
"cell-indexing":
|
|
2275
|
-
|
|
2276
|
+
"cell-indexing": l(({ row: S }) => [
|
|
2277
|
+
S.indexing === "rule" ? (_(), q(e(nt), {
|
|
2276
2278
|
key: 0,
|
|
2277
2279
|
content: e(t)("tag.indexing-rule-help")
|
|
2278
2280
|
}, {
|
|
2279
|
-
default:
|
|
2280
|
-
r(e(
|
|
2281
|
+
default: l(() => [
|
|
2282
|
+
r(e(le), {
|
|
2281
2283
|
size: "sm",
|
|
2282
|
-
tone:
|
|
2284
|
+
tone: oe(S.indexing)
|
|
2283
2285
|
}, {
|
|
2284
|
-
default:
|
|
2285
|
-
|
|
2286
|
+
default: l(() => [
|
|
2287
|
+
C(k(e(t)("tag.indexing-rule")), 1)
|
|
2286
2288
|
]),
|
|
2287
2289
|
_: 1
|
|
2288
2290
|
}, 8, ["tone"])
|
|
2289
2291
|
]),
|
|
2290
2292
|
_: 2
|
|
2291
|
-
}, 1032, ["content"])) : (
|
|
2293
|
+
}, 1032, ["content"])) : (_(), q(e(le), {
|
|
2292
2294
|
key: 1,
|
|
2293
2295
|
size: "sm",
|
|
2294
|
-
tone:
|
|
2296
|
+
tone: oe(S.indexing)
|
|
2295
2297
|
}, {
|
|
2296
|
-
default:
|
|
2297
|
-
|
|
2298
|
+
default: l(() => [
|
|
2299
|
+
C(k(e(t)(`tag.indexing-${S.indexing}`)), 1)
|
|
2298
2300
|
]),
|
|
2299
2301
|
_: 2
|
|
2300
2302
|
}, 1032, ["tone"]))
|
|
2301
2303
|
]),
|
|
2302
|
-
"cell-actions":
|
|
2304
|
+
"cell-actions": l(({ row: S }) => [
|
|
2303
2305
|
r(e(ze), {
|
|
2304
|
-
actions:
|
|
2305
|
-
label:
|
|
2306
|
+
actions: $e(S),
|
|
2307
|
+
label: S.title
|
|
2306
2308
|
}, null, 8, ["actions", "label"])
|
|
2307
2309
|
]),
|
|
2308
2310
|
_: 1
|
|
2309
|
-
}, 8, ["selected", "data", "columns", "loading", "selectable", "search-placeholder", "empty-text", "aria-label"])
|
|
2311
|
+
}, 8, ["selected", "data", "columns", "loading", "selectable", "select-row-label", "select-all-label", "search-placeholder", "empty-text", "aria-label"])
|
|
2310
2312
|
]),
|
|
2311
2313
|
_: 1
|
|
2312
2314
|
}, 8, ["view", "title", "views", "actions"]),
|
|
2313
|
-
|
|
2315
|
+
b.value.length > 0 ? (_(), q(e(lt), {
|
|
2314
2316
|
key: 0,
|
|
2315
2317
|
class: "wx-tags__bar",
|
|
2316
2318
|
sticky: ""
|
|
2317
2319
|
}, {
|
|
2318
|
-
state:
|
|
2319
|
-
r(e(
|
|
2320
|
-
default:
|
|
2321
|
-
|
|
2320
|
+
state: l(() => [
|
|
2321
|
+
r(e(le), { weight: "medium" }, {
|
|
2322
|
+
default: l(() => [
|
|
2323
|
+
C(k(e(t)("tag.selected", { count: b.value.length })), 1)
|
|
2322
2324
|
]),
|
|
2323
2325
|
_: 1
|
|
2324
2326
|
})
|
|
2325
2327
|
]),
|
|
2326
|
-
default:
|
|
2328
|
+
default: l(() => [
|
|
2327
2329
|
r(e(G), {
|
|
2328
2330
|
type: "primary",
|
|
2329
|
-
disabled:
|
|
2330
|
-
onClick:
|
|
2331
|
+
disabled: b.value.length < 2 || d.value,
|
|
2332
|
+
onClick: ce
|
|
2331
2333
|
}, {
|
|
2332
|
-
icon:
|
|
2333
|
-
r(e(
|
|
2334
|
+
icon: l(() => [
|
|
2335
|
+
r(e(Te), { name: "link" })
|
|
2334
2336
|
]),
|
|
2335
|
-
default:
|
|
2336
|
-
|
|
2337
|
+
default: l(() => [
|
|
2338
|
+
C(" " + k(e(t)("tag.merge")), 1)
|
|
2337
2339
|
]),
|
|
2338
2340
|
_: 1
|
|
2339
2341
|
}, 8, ["disabled"]),
|
|
2340
2342
|
r(e(ze), {
|
|
2341
2343
|
size: "lg",
|
|
2342
|
-
actions:
|
|
2343
|
-
label: e(t)("tag.selected", { count:
|
|
2344
|
+
actions: Se.value,
|
|
2345
|
+
label: e(t)("tag.selected", { count: b.value.length })
|
|
2344
2346
|
}, null, 8, ["actions", "label"])
|
|
2345
2347
|
]),
|
|
2346
2348
|
_: 1
|
|
2347
2349
|
})) : K("", !0)
|
|
2348
2350
|
]));
|
|
2349
2351
|
}
|
|
2350
|
-
}), Sa = /* @__PURE__ */ ge(Aa, [["__scopeId", "data-v-
|
|
2351
|
-
function Wa(
|
|
2352
|
+
}), Sa = /* @__PURE__ */ ge(Aa, [["__scopeId", "data-v-d9b8d73d"]]);
|
|
2353
|
+
function Wa(g = "/blog") {
|
|
2352
2354
|
return {
|
|
2353
2355
|
api: "blog/rubrics",
|
|
2354
|
-
path: `${
|
|
2356
|
+
path: `${g}/rubrics`,
|
|
2355
2357
|
name: "webx.blog.rubrics",
|
|
2356
2358
|
module: "rubrics",
|
|
2357
2359
|
screen: "blog.category-form",
|
|
2358
2360
|
manage: "blog.taxonomy.manage",
|
|
2359
2361
|
count: "articles_count",
|
|
2360
|
-
items: (c) => ({ path: `${
|
|
2362
|
+
items: (c) => ({ path: `${g}/articles`, query: { rubric: String(c) } }),
|
|
2361
2363
|
words: {
|
|
2362
2364
|
new: "webx-blog::rubric.new",
|
|
2363
2365
|
empty: "webx-blog::rubric.empty",
|
|
@@ -2377,8 +2379,8 @@ function Wa(v = "/blog") {
|
|
|
2377
2379
|
}
|
|
2378
2380
|
};
|
|
2379
2381
|
}
|
|
2380
|
-
function Na(
|
|
2381
|
-
const c =
|
|
2382
|
+
function Na(g = {}) {
|
|
2383
|
+
const c = g.path ?? "/blog";
|
|
2382
2384
|
return [
|
|
2383
2385
|
{
|
|
2384
2386
|
id: "articles",
|
|
@@ -2389,7 +2391,7 @@ function Na(v = {}) {
|
|
|
2389
2391
|
{
|
|
2390
2392
|
path: `${c}/articles`,
|
|
2391
2393
|
name: "webx.blog.articles",
|
|
2392
|
-
component:
|
|
2394
|
+
component: ha,
|
|
2393
2395
|
props: { base: c }
|
|
2394
2396
|
},
|
|
2395
2397
|
{
|
|
@@ -2452,16 +2454,16 @@ export {
|
|
|
2452
2454
|
Xt as WxArticleSlug,
|
|
2453
2455
|
ia as WxArticleTags,
|
|
2454
2456
|
sa as WxArticleUnpublish,
|
|
2455
|
-
|
|
2457
|
+
ha as WxArticlesPage,
|
|
2456
2458
|
ma as WxTagCreateDialog,
|
|
2457
2459
|
$a as WxTagMergeDialog,
|
|
2458
2460
|
Sa as WxTagsPage,
|
|
2459
2461
|
st as articleEditorKey,
|
|
2460
2462
|
Na as blog,
|
|
2461
2463
|
Mt as blogMessages,
|
|
2462
|
-
|
|
2464
|
+
ue as createBlogApi,
|
|
2463
2465
|
zt as provideArticleEditor,
|
|
2464
2466
|
Wa as rubricsOptions,
|
|
2465
|
-
|
|
2467
|
+
Ae as useArticleEditor
|
|
2466
2468
|
};
|
|
2467
2469
|
//# sourceMappingURL=index.js.map
|