@webx-ui/module-press 0.1.16 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PressPage-9Ghxpuqd.js +327 -0
- package/dist/PressPage-9Ghxpuqd.js.map +1 -0
- package/dist/index-C6NYJ0-x.js +349 -0
- package/dist/index-C6NYJ0-x.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +8 -654
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,657 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { useLocales as _e, localizedValue as xe, WxSkeleton as ie, WxBadge as Q, WxActionBar as ke, WxButton as Se, toast as _, confirm as X, WxCard as We, WxListDetail as Te, WxEmpty as le, WxInput as Pe, WxIcon as Y, WxSortableList as Ae, WxAvatar as qe, WxTooltip as ae, WxAlert as Be } from "@webx-ui/core";
|
|
4
|
-
import { reorderItems as $e, useAdmin as ee, useTranslate as ue, useErrorText as ce, provideRecordAddress as Le, useBodyKeys as Ne, WxScreenHead as Oe, WxScreen as Ce, WxSaveState as Ve, useItemOrder as De, WxListScreen as Ie, WxRowMenu as Re } from "@webx-ui/module-admin";
|
|
5
|
-
const Z = "press";
|
|
6
|
-
function de(u) {
|
|
7
|
-
const d = `${u.apiPath}/${Z}`, i = (s) => s.data;
|
|
8
|
-
return {
|
|
9
|
-
list: (s = {}) => {
|
|
10
|
-
const f = new URLSearchParams();
|
|
11
|
-
return s.search && f.set("search", s.search), s.trashed && f.set("trashed", "1"), u.http.get(f.size > 0 ? `${d}?${f}` : d);
|
|
12
|
-
},
|
|
13
|
-
get: (s) => u.http.get(`${d}/${s}`).then(i),
|
|
14
|
-
create: (s) => u.http.post(d, { values: s }).then(i),
|
|
15
|
-
save: (s, f) => u.http.put(`${d}/${s}`, { values: f }).then(i),
|
|
16
|
-
remove: (s) => u.http.delete(`${d}/${s}`).then(() => {
|
|
17
|
-
}),
|
|
18
|
-
// The resource of the list line, and not the form's answer: a restored outlet stays closed.
|
|
19
|
-
restore: (s) => u.http.post(`${d}/${s}/restore`, {}).then(i),
|
|
20
|
-
reorder: (s) => $e(u, Z, s, null)
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
const ze = {
|
|
24
|
-
module: {
|
|
25
|
-
press: "Press"
|
|
26
|
-
},
|
|
27
|
-
outlet: {
|
|
28
|
-
new: "New outlet",
|
|
29
|
-
untitled: "Untitled",
|
|
30
|
-
search: "Search the outlets",
|
|
31
|
-
empty: "No outlets yet.",
|
|
32
|
-
"empty-help": "An outlet is a magazine, a paper or a site that wrote about you; its articles are added on its form.",
|
|
33
|
-
"empty-search": "Nothing matches that.",
|
|
34
|
-
"empty-bin": "The bin is empty.",
|
|
35
|
-
all: "All",
|
|
36
|
-
trashed: "Bin",
|
|
37
|
-
"not-published": "Not published",
|
|
38
|
-
"visible-nowhere": "Published, but seen in no language: none of its articles has a title yet.",
|
|
39
|
-
"articles-count": "Articles: :count",
|
|
40
|
-
"no-articles": "No articles yet",
|
|
41
|
-
featured: "In the logo strip",
|
|
42
|
-
"seen-in": "Seen in: :locales",
|
|
43
|
-
choose: "Choose an outlet",
|
|
44
|
-
"choose-help": "Or add a new one: the first line of the list.",
|
|
45
|
-
save: "Save",
|
|
46
|
-
saved: "The outlet is saved.",
|
|
47
|
-
"save-failed": "The outlet was not saved.",
|
|
48
|
-
cancel: "Cancel",
|
|
49
|
-
delete: "Delete",
|
|
50
|
-
"delete-title": "Delete “:name”?",
|
|
51
|
-
"delete-text": "It goes to the bin with its articles and leaves the site and every block. Restored, it comes back with them.",
|
|
52
|
-
deleted: "The outlet is in the bin.",
|
|
53
|
-
restore: "Restore",
|
|
54
|
-
restored: "The outlet is back.",
|
|
55
|
-
"reorder-failed": "The new order was not saved.",
|
|
56
|
-
"leave-title": "Leave without saving?",
|
|
57
|
-
"leave-text": "What you wrote in this outlet is not on the server.",
|
|
58
|
-
leave: "Leave",
|
|
59
|
-
back: "Back to the list",
|
|
60
|
-
open: "Open on the site",
|
|
61
|
-
"address-moving": "The page of the outlet moves to the new address when you save."
|
|
62
|
-
},
|
|
63
|
-
screen: {
|
|
64
|
-
general: "General",
|
|
65
|
-
outlet: "Outlet",
|
|
66
|
-
logo: "Logo",
|
|
67
|
-
"logo-help": "Without a logo the site prints the name.",
|
|
68
|
-
title: "Name",
|
|
69
|
-
"title-help": "Where it is not written in a language, the name from another one is shown.",
|
|
70
|
-
slug: "Address",
|
|
71
|
-
"slug-help": "The outlet's page. A language with articles and no address of its own takes this one.",
|
|
72
|
-
"website-url": "Website",
|
|
73
|
-
"website-url-help": "An address that starts with http:// or https://.",
|
|
74
|
-
summary: "About the outlet",
|
|
75
|
-
"summary-help": "A few words under the name on its page, and its description for search engines.",
|
|
76
|
-
settings: "Settings",
|
|
77
|
-
published: "Published",
|
|
78
|
-
"published-help": "On the site at once — in the languages it has articles in.",
|
|
79
|
-
featured: "In the strip of logos",
|
|
80
|
-
"featured-help": "Shown by the logos block set to the marked outlets only.",
|
|
81
|
-
articles: "Articles",
|
|
82
|
-
"articles-help": "In the order they are shown on the outlet's page. Saved with the outlet.",
|
|
83
|
-
"article-label": "#:number · :title",
|
|
84
|
-
"article-untitled": "Untitled",
|
|
85
|
-
"article-title": "Title",
|
|
86
|
-
"article-title-help": "An article is shown in a language only when it has a title in it.",
|
|
87
|
-
excerpt: "Excerpt",
|
|
88
|
-
kind: "Kind",
|
|
89
|
-
"kind-none": "No kind",
|
|
90
|
-
"published-on": "Date",
|
|
91
|
-
"date-precision": "Known to",
|
|
92
|
-
"date-precision-help": "How much of the date is printed: the day, the month, or the year only.",
|
|
93
|
-
precision: {
|
|
94
|
-
day: "Day",
|
|
95
|
-
month: "Month",
|
|
96
|
-
year: "Year"
|
|
97
|
-
},
|
|
98
|
-
url: "Link",
|
|
99
|
-
"url-help": "The article on the outlet's site. Without it the title leads to the PDF.",
|
|
100
|
-
file: "PDF",
|
|
101
|
-
"file-help": "A PDF from the library — a scan of the page, say.",
|
|
102
|
-
hidden: "Do not show",
|
|
103
|
-
"hidden-help": "Kept here, and shown nowhere on the site.",
|
|
104
|
-
seo: "SEO",
|
|
105
|
-
"seo-empty": "The SEO card appears here when module-seo is installed."
|
|
106
|
-
},
|
|
107
|
-
kinds: {
|
|
108
|
-
mention: "Mention",
|
|
109
|
-
interview: "Interview",
|
|
110
|
-
expert_comment: "Expert comment",
|
|
111
|
-
authored: "Authored article"
|
|
112
|
-
}
|
|
113
|
-
}, oe = /* @__PURE__ */ new WeakSet();
|
|
114
|
-
function ve() {
|
|
115
|
-
try {
|
|
116
|
-
const { i18n: u } = ee();
|
|
117
|
-
oe.has(u) || (u.defaults("webx-press", ze), oe.add(u));
|
|
118
|
-
} catch {
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
const Ee = /* @__PURE__ */ se({
|
|
122
|
-
name: "WxOutletPane",
|
|
123
|
-
__name: "OutletPane",
|
|
124
|
-
props: {
|
|
125
|
-
id: {},
|
|
126
|
-
inline: { type: Boolean, default: !0 }
|
|
127
|
-
},
|
|
128
|
-
emits: ["back", "saved", "created", "removed"],
|
|
129
|
-
setup(u, { emit: d }) {
|
|
130
|
-
const i = u, s = d, f = ee(), a = de(f), A = _e();
|
|
131
|
-
ve();
|
|
132
|
-
const n = ue("webx-press"), q = ce(), y = W(null), x = W({}), L = W(null), m = W(""), k = W(i.id !== null), S = W(!1), g = W({}), B = h(() => f.can("press.manage")), E = h(() => JSON.stringify(x.value)), T = h(() => m.value !== "" && E.value !== m.value), U = h(() => S.value ? "saving" : T.value || i.id === null ? "unsaved" : "saved"), J = h(() => {
|
|
133
|
-
const l = x.value.title, r = i.id === null ? n("outlet.new") : y.value?.title ?? "";
|
|
134
|
-
return xe(l, A.active.value, r) || n("outlet.untitled");
|
|
135
|
-
});
|
|
136
|
-
Le({
|
|
137
|
-
values: x,
|
|
138
|
-
prefix: L,
|
|
139
|
-
path: h(() => P(y.value?.url ?? null, A.active.value)),
|
|
140
|
-
moving: () => n("outlet.address-moving")
|
|
141
|
-
});
|
|
142
|
-
function P(l, r) {
|
|
143
|
-
if (l === null) return null;
|
|
144
|
-
let e;
|
|
145
|
-
try {
|
|
146
|
-
e = new URL(l, "http://site.invalid").pathname.split("/").filter((V) => V !== "");
|
|
147
|
-
} catch {
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
const c = A.list.value.map((V) => V.code), o = c.includes(e[0] ?? "") && e[0] !== c[0] ? e.shift() : c[0];
|
|
151
|
-
return o === void 0 || o === r ? e.join("/") : void 0;
|
|
152
|
-
}
|
|
153
|
-
function C(l) {
|
|
154
|
-
y.value = l.outlet, x.value = l.values, L.value = l.prefix, m.value = JSON.stringify(l.values);
|
|
155
|
-
}
|
|
156
|
-
if (i.id === null) {
|
|
157
|
-
const l = {
|
|
158
|
-
title: {},
|
|
159
|
-
slug: {},
|
|
160
|
-
summary: {},
|
|
161
|
-
published: !1,
|
|
162
|
-
featured: !1,
|
|
163
|
-
articles: []
|
|
164
|
-
};
|
|
165
|
-
x.value = l, m.value = JSON.stringify(l);
|
|
166
|
-
}
|
|
167
|
-
async function I() {
|
|
168
|
-
if (i.id !== null) {
|
|
169
|
-
k.value = !0;
|
|
170
|
-
try {
|
|
171
|
-
C(await a.get(i.id));
|
|
172
|
-
} catch (l) {
|
|
173
|
-
_.danger(q(l)), s("back");
|
|
174
|
-
} finally {
|
|
175
|
-
k.value = !1;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
async function R() {
|
|
180
|
-
if (!(S.value || !B.value)) {
|
|
181
|
-
S.value = !0, g.value = {};
|
|
182
|
-
try {
|
|
183
|
-
const l = i.id === null, r = l ? await a.create(x.value) : await a.save(i.id, x.value);
|
|
184
|
-
C(r), _.success(n("outlet.saved")), s(l ? "created" : "saved", r.outlet);
|
|
185
|
-
} catch (l) {
|
|
186
|
-
const r = l.body;
|
|
187
|
-
r?.errors ? (g.value = r.errors, _.danger(n("outlet.save-failed"))) : _.danger(q(l));
|
|
188
|
-
} finally {
|
|
189
|
-
S.value = !1;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
async function G() {
|
|
194
|
-
const l = y.value;
|
|
195
|
-
if (!(!l || !await X({
|
|
196
|
-
title: n("outlet.delete-title", { name: l.title }),
|
|
197
|
-
message: n("outlet.delete-text"),
|
|
198
|
-
confirmText: n("outlet.delete"),
|
|
199
|
-
cancelText: n("outlet.cancel"),
|
|
200
|
-
tone: "danger"
|
|
201
|
-
})))
|
|
202
|
-
try {
|
|
203
|
-
await a.remove(l.id), _.success(n("outlet.deleted")), m.value = E.value, s("removed", l.id);
|
|
204
|
-
} catch (e) {
|
|
205
|
-
_.danger(q(e));
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function M(l) {
|
|
209
|
-
T.value && l.preventDefault();
|
|
210
|
-
}
|
|
211
|
-
function K(l) {
|
|
212
|
-
(l.ctrlKey || l.metaKey) && l.key.toLowerCase() === "s" && (l.preventDefault(), (T.value || i.id === null) && R());
|
|
213
|
-
}
|
|
214
|
-
Ne(K), he(() => {
|
|
215
|
-
I(), window.addEventListener("beforeunload", M);
|
|
216
|
-
}), ne(() => {
|
|
217
|
-
window.removeEventListener("beforeunload", M);
|
|
218
|
-
});
|
|
219
|
-
async function F() {
|
|
220
|
-
return !T.value || !B.value ? !0 : await X({
|
|
221
|
-
title: n("outlet.leave-title"),
|
|
222
|
-
message: n("outlet.leave-text"),
|
|
223
|
-
confirmText: n("outlet.leave"),
|
|
224
|
-
cancelText: n("outlet.cancel"),
|
|
225
|
-
tone: "danger"
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
we(
|
|
229
|
-
async (l, r) => l.query.outlet === r.query.outlet ? !0 : await F()
|
|
230
|
-
), ye(F);
|
|
231
|
-
const j = h(() => {
|
|
232
|
-
const l = y.value, r = [];
|
|
233
|
-
if (l?.url) {
|
|
234
|
-
const e = l.url;
|
|
235
|
-
r.push({
|
|
236
|
-
key: "open",
|
|
237
|
-
label: n("outlet.open"),
|
|
238
|
-
icon: "external-link",
|
|
239
|
-
run: () => {
|
|
240
|
-
window.open(e, "_blank", "noopener");
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
return B.value && l !== null && r.push({
|
|
245
|
-
key: "delete",
|
|
246
|
-
label: n("outlet.delete"),
|
|
247
|
-
icon: "trash",
|
|
248
|
-
danger: !0,
|
|
249
|
-
menu: !0,
|
|
250
|
-
run: () => {
|
|
251
|
-
G();
|
|
252
|
-
}
|
|
253
|
-
}), r;
|
|
254
|
-
});
|
|
255
|
-
return (l, r) => (v(), D("div", {
|
|
256
|
-
class: "wx-outlet",
|
|
257
|
-
onKeydown: K
|
|
258
|
-
}, [
|
|
259
|
-
k.value ? (v(), b(t(ie), {
|
|
260
|
-
key: 0,
|
|
261
|
-
class: "wx-outlet__ghost",
|
|
262
|
-
title: "",
|
|
263
|
-
rows: 6
|
|
264
|
-
})) : (v(), D(re, { key: 1 }, [
|
|
265
|
-
w(t(Oe), {
|
|
266
|
-
level: 3,
|
|
267
|
-
back: !i.inline,
|
|
268
|
-
"back-label": t(n)("outlet.back"),
|
|
269
|
-
title: J.value,
|
|
270
|
-
actions: j.value,
|
|
271
|
-
"collapse-below": 480,
|
|
272
|
-
onBack: r[0] || (r[0] = (e) => s("back"))
|
|
273
|
-
}, fe({ _: 2 }, [
|
|
274
|
-
y.value && !y.value.published ? {
|
|
275
|
-
name: "title-after",
|
|
276
|
-
fn: p(() => [
|
|
277
|
-
w(t(Q), { dot: "" }, {
|
|
278
|
-
default: p(() => [
|
|
279
|
-
z($(t(n)("outlet.not-published")), 1)
|
|
280
|
-
]),
|
|
281
|
-
_: 1
|
|
282
|
-
})
|
|
283
|
-
]),
|
|
284
|
-
key: "0"
|
|
285
|
-
} : void 0
|
|
286
|
-
]), 1032, ["back", "back-label", "title", "actions"]),
|
|
287
|
-
w(t(Ce), {
|
|
288
|
-
modelValue: x.value,
|
|
289
|
-
"onUpdate:modelValue": r[1] || (r[1] = (e) => x.value = e),
|
|
290
|
-
name: "press.outlet-form",
|
|
291
|
-
errors: g.value,
|
|
292
|
-
disabled: !B.value || S.value
|
|
293
|
-
}, null, 8, ["modelValue", "errors", "disabled"]),
|
|
294
|
-
B.value ? (v(), b(t(ke), { key: 0 }, {
|
|
295
|
-
state: p(() => [
|
|
296
|
-
w(t(Ve), { state: U.value }, null, 8, ["state"])
|
|
297
|
-
]),
|
|
298
|
-
default: p(() => [
|
|
299
|
-
w(t(Se), {
|
|
300
|
-
type: "primary",
|
|
301
|
-
loading: S.value,
|
|
302
|
-
disabled: !T.value && i.id !== null,
|
|
303
|
-
onClick: R
|
|
304
|
-
}, {
|
|
305
|
-
default: p(() => [
|
|
306
|
-
z($(t(n)("outlet.save")), 1)
|
|
307
|
-
]),
|
|
308
|
-
_: 1
|
|
309
|
-
}, 8, ["loading", "disabled"])
|
|
310
|
-
]),
|
|
311
|
-
_: 1
|
|
312
|
-
})) : O("", !0)
|
|
313
|
-
], 64))
|
|
314
|
-
], 32));
|
|
315
|
-
}
|
|
316
|
-
}), pe = (u, d) => {
|
|
317
|
-
const i = u.__vccOpts || u;
|
|
318
|
-
for (const [s, f] of d)
|
|
319
|
-
i[s] = f;
|
|
320
|
-
return i;
|
|
321
|
-
}, Ue = /* @__PURE__ */ pe(Ee, [["__scopeId", "data-v-b6ea9c8f"]]), Me = { class: "wx-press__bar" }, Ke = {
|
|
322
|
-
key: 0,
|
|
323
|
-
class: "wx-outlet-row__logo"
|
|
324
|
-
}, Fe = ["src"], je = { class: "wx-outlet-row__body" }, Je = { class: "wx-outlet-row__head" }, Ge = { class: "wx-outlet-row__title" }, He = { class: "wx-outlet-row__facts" }, Ye = { class: "wx-outlet-row__count" }, Qe = ["aria-label"], Xe = /* @__PURE__ */ se({
|
|
325
|
-
__name: "PressPage",
|
|
326
|
-
props: {
|
|
327
|
-
base: { default: "/press" }
|
|
328
|
-
},
|
|
329
|
-
setup(u) {
|
|
330
|
-
const d = ee(), i = de(d), s = ge(), f = be();
|
|
331
|
-
ve();
|
|
332
|
-
const a = ue("webx-press"), A = ce(), n = W([]), q = W(!0), y = h(() => d.can("press.manage")), x = h(
|
|
333
|
-
() => d.state.manifest?.modules.find((e) => e.id === "press")?.title ?? a("module.press")
|
|
334
|
-
), L = h({
|
|
335
|
-
get: () => s.query.view === "trashed" ? "trashed" : "",
|
|
336
|
-
set: (e) => {
|
|
337
|
-
const c = {
|
|
338
|
-
...s.query,
|
|
339
|
-
view: e === "" ? void 0 : String(e)
|
|
340
|
-
};
|
|
341
|
-
delete c.outlet, f.replace({ query: c });
|
|
342
|
-
}
|
|
343
|
-
}), m = h(() => L.value === "trashed"), k = h(() => typeof s.query.q == "string" ? s.query.q : ""), S = W(k.value), g = h(() => {
|
|
344
|
-
const e = s.query.outlet;
|
|
345
|
-
return e === "new" ? y.value ? "new" : null : typeof e == "string" && e !== "" && Number(e) || null;
|
|
346
|
-
}), B = h({
|
|
347
|
-
get: () => g.value !== null,
|
|
348
|
-
set: (e) => {
|
|
349
|
-
e || R();
|
|
350
|
-
}
|
|
351
|
-
}), E = h(() => [
|
|
352
|
-
{ value: "", label: a("outlet.all") },
|
|
353
|
-
{ value: "trashed", label: a("outlet.trashed"), icon: "trash" }
|
|
354
|
-
]), T = De(Z, () => ({ q: k.value, filtered: m.value })), U = h(() => y.value && T.sortable.value), J = h(() => k.value !== "" ? a("outlet.empty-search") : m.value ? a("outlet.empty-bin") : a("outlet.empty"));
|
|
355
|
-
async function P() {
|
|
356
|
-
q.value = !0;
|
|
357
|
-
try {
|
|
358
|
-
const e = await i.list({ search: k.value, trashed: m.value });
|
|
359
|
-
n.value = e.data;
|
|
360
|
-
} catch (e) {
|
|
361
|
-
_.danger(A(e));
|
|
362
|
-
} finally {
|
|
363
|
-
q.value = !1;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
te(
|
|
367
|
-
() => [L.value, k.value],
|
|
368
|
-
() => {
|
|
369
|
-
P();
|
|
370
|
-
}
|
|
371
|
-
), P();
|
|
372
|
-
let C;
|
|
373
|
-
te(S, (e) => {
|
|
374
|
-
clearTimeout(C), C = setTimeout(() => {
|
|
375
|
-
f.replace({ query: { ...s.query, q: e.trim() === "" ? void 0 : e } });
|
|
376
|
-
}, 300);
|
|
377
|
-
}), ne(() => clearTimeout(C));
|
|
378
|
-
function I(e) {
|
|
379
|
-
f.replace({ query: { ...s.query, outlet: String(e) } });
|
|
380
|
-
}
|
|
381
|
-
function R() {
|
|
382
|
-
const e = { ...s.query };
|
|
383
|
-
delete e.outlet, f.replace({ query: e });
|
|
384
|
-
}
|
|
385
|
-
function G(e) {
|
|
386
|
-
I(e.id), P();
|
|
387
|
-
}
|
|
388
|
-
async function M() {
|
|
389
|
-
try {
|
|
390
|
-
await T.move(n.value.map((e) => e.id));
|
|
391
|
-
} catch (e) {
|
|
392
|
-
_.danger(A(e, a("outlet.reorder-failed"))), await P();
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
function K(e) {
|
|
396
|
-
return y.value ? m.value ? [
|
|
397
|
-
{
|
|
398
|
-
key: "restore",
|
|
399
|
-
icon: "refresh",
|
|
400
|
-
label: a("outlet.restore"),
|
|
401
|
-
run: () => {
|
|
402
|
-
l(e);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
] : [
|
|
406
|
-
{
|
|
407
|
-
key: "delete",
|
|
408
|
-
icon: "trash",
|
|
409
|
-
label: a("outlet.delete"),
|
|
410
|
-
danger: !0,
|
|
411
|
-
run: () => {
|
|
412
|
-
F(e);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
] : [];
|
|
416
|
-
}
|
|
417
|
-
async function F(e) {
|
|
418
|
-
if (await X({
|
|
419
|
-
title: a("outlet.delete-title", { name: e.title }),
|
|
420
|
-
message: a("outlet.delete-text"),
|
|
421
|
-
confirmText: a("outlet.delete"),
|
|
422
|
-
cancelText: a("outlet.cancel"),
|
|
423
|
-
tone: "danger"
|
|
424
|
-
}))
|
|
425
|
-
try {
|
|
426
|
-
await i.remove(e.id), _.success(a("outlet.deleted")), j(e.id);
|
|
427
|
-
} catch (o) {
|
|
428
|
-
_.danger(A(o));
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
function j(e) {
|
|
432
|
-
g.value === e && R(), P();
|
|
433
|
-
}
|
|
434
|
-
async function l(e) {
|
|
435
|
-
try {
|
|
436
|
-
await i.restore(e.id), _.success(a("outlet.restored"));
|
|
437
|
-
} catch (c) {
|
|
438
|
-
_.danger(A(c));
|
|
439
|
-
} finally {
|
|
440
|
-
await P();
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
function r(e) {
|
|
444
|
-
return e.published && e.locales.length === 0;
|
|
445
|
-
}
|
|
446
|
-
return (e, c) => (v(), b(t(Ie), {
|
|
447
|
-
view: L.value,
|
|
448
|
-
"onUpdate:view": c[4] || (c[4] = (o) => L.value = o),
|
|
449
|
-
title: x.value,
|
|
450
|
-
views: E.value,
|
|
451
|
-
card: !1
|
|
452
|
-
}, {
|
|
453
|
-
default: p(() => [
|
|
454
|
-
w(t(We), {
|
|
455
|
-
class: "wx-press",
|
|
456
|
-
padding: "none"
|
|
457
|
-
}, {
|
|
458
|
-
default: p(() => [
|
|
459
|
-
w(t(Te), {
|
|
460
|
-
open: B.value,
|
|
461
|
-
"onUpdate:open": c[3] || (c[3] = (o) => B.value = o),
|
|
462
|
-
class: "wx-press__panes",
|
|
463
|
-
"list-width": 360,
|
|
464
|
-
"detail-min": 520,
|
|
465
|
-
"detail-label": t(a)("module.press")
|
|
466
|
-
}, {
|
|
467
|
-
list: p(() => [
|
|
468
|
-
N("div", Me, [
|
|
469
|
-
w(t(Pe), {
|
|
470
|
-
modelValue: S.value,
|
|
471
|
-
"onUpdate:modelValue": c[0] || (c[0] = (o) => S.value = o),
|
|
472
|
-
class: "wx-press__search",
|
|
473
|
-
size: "sm",
|
|
474
|
-
clearable: "",
|
|
475
|
-
placeholder: t(a)("outlet.search"),
|
|
476
|
-
"aria-label": t(a)("outlet.search")
|
|
477
|
-
}, {
|
|
478
|
-
prefix: p(() => [
|
|
479
|
-
w(t(Y), {
|
|
480
|
-
name: "search",
|
|
481
|
-
size: "sm"
|
|
482
|
-
})
|
|
483
|
-
]),
|
|
484
|
-
_: 1
|
|
485
|
-
}, 8, ["modelValue", "placeholder", "aria-label"])
|
|
486
|
-
]),
|
|
487
|
-
y.value && !m.value ? (v(), D("button", {
|
|
488
|
-
key: 0,
|
|
489
|
-
type: "button",
|
|
490
|
-
class: H(["wx-press__new", { "is-current": g.value === "new" }]),
|
|
491
|
-
onClick: c[1] || (c[1] = (o) => I("new"))
|
|
492
|
-
}, [
|
|
493
|
-
w(t(Y), {
|
|
494
|
-
name: "plus",
|
|
495
|
-
size: "sm"
|
|
496
|
-
}),
|
|
497
|
-
z(" " + $(t(a)("outlet.new")), 1)
|
|
498
|
-
], 2)) : O("", !0),
|
|
499
|
-
q.value && n.value.length === 0 ? (v(), b(t(ie), {
|
|
500
|
-
key: 1,
|
|
501
|
-
class: "wx-press__loading",
|
|
502
|
-
rows: 5
|
|
503
|
-
})) : n.value.length === 0 ? (v(), b(t(le), {
|
|
504
|
-
key: 2,
|
|
505
|
-
title: J.value,
|
|
506
|
-
description: !m.value && k.value === "" ? t(a)("outlet.empty-help") : void 0
|
|
507
|
-
}, null, 8, ["title", "description"])) : (v(), D(re, { key: 3 }, [
|
|
508
|
-
w(t(Ae), {
|
|
509
|
-
modelValue: n.value,
|
|
510
|
-
"onUpdate:modelValue": c[2] || (c[2] = (o) => n.value = o),
|
|
511
|
-
class: H(["wx-press__list", { "is-loading": q.value }]),
|
|
512
|
-
plain: "",
|
|
513
|
-
"item-key": "id",
|
|
514
|
-
handle: U.value ? "grip" : "row",
|
|
515
|
-
"item-label": (o) => o.title,
|
|
516
|
-
disabled: !U.value,
|
|
517
|
-
onMove: M
|
|
518
|
-
}, {
|
|
519
|
-
default: p(({ item: o }) => [
|
|
520
|
-
(v(), b(me(m.value ? "div" : "button"), {
|
|
521
|
-
type: m.value ? void 0 : "button",
|
|
522
|
-
class: H(["wx-outlet-row", { "is-current": g.value === o.id }]),
|
|
523
|
-
onClick: (V) => m.value ? void 0 : I(o.id)
|
|
524
|
-
}, {
|
|
525
|
-
default: p(() => [
|
|
526
|
-
o.logo?.thumb ? (v(), D("span", Ke, [
|
|
527
|
-
N("img", {
|
|
528
|
-
src: o.logo.thumb,
|
|
529
|
-
alt: ""
|
|
530
|
-
}, null, 8, Fe)
|
|
531
|
-
])) : (v(), b(t(qe), {
|
|
532
|
-
key: 1,
|
|
533
|
-
class: "wx-outlet-row__initials",
|
|
534
|
-
shape: "square",
|
|
535
|
-
name: o.title,
|
|
536
|
-
size: "md"
|
|
537
|
-
}, null, 8, ["name"])),
|
|
538
|
-
N("span", je, [
|
|
539
|
-
N("span", Je, [
|
|
540
|
-
N("span", Ge, $(o.title), 1),
|
|
541
|
-
o.featured ? (v(), b(t(ae), {
|
|
542
|
-
key: 0,
|
|
543
|
-
content: t(a)("outlet.featured")
|
|
544
|
-
}, {
|
|
545
|
-
default: p(() => [
|
|
546
|
-
w(t(Y), {
|
|
547
|
-
class: "wx-outlet-row__featured",
|
|
548
|
-
name: "star",
|
|
549
|
-
size: "sm",
|
|
550
|
-
"aria-label": t(a)("outlet.featured")
|
|
551
|
-
}, null, 8, ["aria-label"])
|
|
552
|
-
]),
|
|
553
|
-
_: 1
|
|
554
|
-
}, 8, ["content"])) : O("", !0)
|
|
555
|
-
]),
|
|
556
|
-
N("span", He, [
|
|
557
|
-
o.published ? r(o) ? (v(), b(t(ae), {
|
|
558
|
-
key: 1,
|
|
559
|
-
content: t(a)("outlet.visible-nowhere")
|
|
560
|
-
}, {
|
|
561
|
-
default: p(() => [
|
|
562
|
-
w(t(Q), {
|
|
563
|
-
type: "warning",
|
|
564
|
-
dot: "",
|
|
565
|
-
size: "sm"
|
|
566
|
-
}, {
|
|
567
|
-
default: p(() => [
|
|
568
|
-
z($(t(a)("outlet.not-published")), 1)
|
|
569
|
-
]),
|
|
570
|
-
_: 1
|
|
571
|
-
})
|
|
572
|
-
]),
|
|
573
|
-
_: 1
|
|
574
|
-
}, 8, ["content"])) : O("", !0) : (v(), b(t(Q), {
|
|
575
|
-
key: 0,
|
|
576
|
-
dot: "",
|
|
577
|
-
size: "sm"
|
|
578
|
-
}, {
|
|
579
|
-
default: p(() => [
|
|
580
|
-
z($(t(a)("outlet.not-published")), 1)
|
|
581
|
-
]),
|
|
582
|
-
_: 1
|
|
583
|
-
})),
|
|
584
|
-
N("span", Ye, $(o.articles_count > 0 ? t(a)("outlet.articles-count", { count: o.articles_count }) : t(a)("outlet.no-articles")), 1),
|
|
585
|
-
o.locales.length > 0 ? (v(), D("span", {
|
|
586
|
-
key: 2,
|
|
587
|
-
class: "wx-outlet-row__locales",
|
|
588
|
-
"aria-label": t(a)("outlet.seen-in", { locales: o.locales.join(", ") })
|
|
589
|
-
}, $(o.locales.join(" · ")), 9, Qe)) : O("", !0)
|
|
590
|
-
])
|
|
591
|
-
])
|
|
592
|
-
]),
|
|
593
|
-
_: 2
|
|
594
|
-
}, 1032, ["type", "class", "onClick"]))
|
|
595
|
-
]),
|
|
596
|
-
actions: p(({ item: o }) => [
|
|
597
|
-
w(t(Re), {
|
|
598
|
-
actions: K(o),
|
|
599
|
-
label: o.title
|
|
600
|
-
}, null, 8, ["actions", "label"])
|
|
601
|
-
]),
|
|
602
|
-
_: 1
|
|
603
|
-
}, 8, ["modelValue", "class", "handle", "item-label", "disabled"]),
|
|
604
|
-
y.value && !m.value ? (v(), b(t(Be), {
|
|
605
|
-
key: 0,
|
|
606
|
-
class: "wx-press__note",
|
|
607
|
-
type: "info",
|
|
608
|
-
description: t(T).hint.value
|
|
609
|
-
}, null, 8, ["description"])) : O("", !0)
|
|
610
|
-
], 64))
|
|
611
|
-
]),
|
|
612
|
-
detail: p(({ inline: o, back: V }) => [
|
|
613
|
-
g.value !== null ? (v(), b(Ue, {
|
|
614
|
-
id: g.value === "new" ? null : g.value,
|
|
615
|
-
key: String(g.value),
|
|
616
|
-
inline: o,
|
|
617
|
-
onBack: V,
|
|
618
|
-
onSaved: P,
|
|
619
|
-
onCreated: G,
|
|
620
|
-
onRemoved: j
|
|
621
|
-
}, null, 8, ["id", "inline", "onBack"])) : O("", !0)
|
|
622
|
-
]),
|
|
623
|
-
empty: p(() => [
|
|
624
|
-
w(t(le), {
|
|
625
|
-
title: t(a)("outlet.choose"),
|
|
626
|
-
description: y.value ? t(a)("outlet.choose-help") : void 0
|
|
627
|
-
}, null, 8, ["title", "description"])
|
|
628
|
-
]),
|
|
629
|
-
_: 1
|
|
630
|
-
}, 8, ["open", "detail-label"])
|
|
631
|
-
]),
|
|
632
|
-
_: 1
|
|
633
|
-
})
|
|
634
|
-
]),
|
|
635
|
-
_: 1
|
|
636
|
-
}, 8, ["view", "title", "views"]));
|
|
637
|
-
}
|
|
638
|
-
}), Ze = /* @__PURE__ */ pe(Xe, [["__scopeId", "data-v-7ef16f83"]]);
|
|
639
|
-
function ot(u = {}) {
|
|
640
|
-
const d = u.path ?? "/press";
|
|
641
|
-
return {
|
|
642
|
-
id: "press",
|
|
643
|
-
path: d,
|
|
644
|
-
// One route: the open outlet is in the address (`?outlet=`), beside the list it was opened
|
|
645
|
-
// from, so a link to it is a link to both.
|
|
646
|
-
routes: [{ path: d, name: "webx.press", component: Ze, props: { base: d } }]
|
|
647
|
-
};
|
|
648
|
-
}
|
|
1
|
+
import "vue";
|
|
2
|
+
import { P as r, O as P, W as p, c as t, p as o, a as x } from "./index-C6NYJ0-x.js";
|
|
649
3
|
export {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
4
|
+
r as PRESS_API,
|
|
5
|
+
P as WxOutletPane,
|
|
6
|
+
p as WxPressPage,
|
|
7
|
+
t as createPressApi,
|
|
8
|
+
o as press,
|
|
9
|
+
x as pressMessages
|
|
656
10
|
};
|
|
657
11
|
//# sourceMappingURL=index.js.map
|