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