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