@openrails/contentkit-ui 0.104.0 → 0.105.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/client/generated/wire.d.ts +2 -0
- package/dist/client/generated/wire.js.map +1 -1
- package/dist/components/admin/content-manager.js +344 -344
- package/dist/components/admin/content-manager.js.map +1 -1
- package/dist/components/admin/reader-content-editor.js +179 -175
- package/dist/components/admin/reader-content-editor.js.map +1 -1
- package/dist/components/content/editors.d.ts +4 -0
- package/dist/components/content/editors.js +101 -89
- package/dist/components/content/editors.js.map +1 -1
- package/dist/locales/content/de.js +1 -0
- package/dist/locales/content/de.js.map +1 -1
- package/dist/locales/content/en.d.ts +1 -0
- package/dist/locales/content/en.js +1 -0
- package/dist/locales/content/en.js.map +1 -1
- package/dist/locales/content/es.js +1 -0
- package/dist/locales/content/es.js.map +1 -1
- package/dist/locales/content/ja.js +1 -0
- package/dist/locales/content/ja.js.map +1 -1
- package/dist/locales/content/ko.js +1 -0
- package/dist/locales/content/ko.js.map +1 -1
- package/dist/locales/content/zh.js +1 -0
- package/dist/locales/content/zh.js.map +1 -1
- package/dist/locales/en.d.ts +1 -0
- package/package.json +1 -1
|
@@ -14,14 +14,14 @@ import { MediaFolderEditor as c, positionalName as oe } from "../media-folder-ed
|
|
|
14
14
|
import { Badge as se } from "../../ui/badge.js";
|
|
15
15
|
import { Input as ce } from "../../ui/input.js";
|
|
16
16
|
import { Label as l } from "../../ui/label.js";
|
|
17
|
-
import { Select as
|
|
18
|
-
import { Textarea as
|
|
19
|
-
import { ErrorLine as
|
|
20
|
-
import { LoadFailed as
|
|
21
|
-
import { localInput as
|
|
22
|
-
import { parseAttributes as
|
|
23
|
-
import { labelOf as
|
|
24
|
-
import { useDraft as
|
|
17
|
+
import { Select as le, SelectContent as ue, SelectItem as de, SelectTrigger as fe, SelectValue as pe } from "../../ui/select.js";
|
|
18
|
+
import { Textarea as me } from "../../ui/textarea.js";
|
|
19
|
+
import { ErrorLine as u, contentError as he, useAction as ge } from "../social/parts.js";
|
|
20
|
+
import { LoadFailed as _e, Rows as ve, useConfirm as ye } from "./shell.js";
|
|
21
|
+
import { localInput as be } from "../social/bans.js";
|
|
22
|
+
import { parseAttributes as xe } from "../../client/group-fields.js";
|
|
23
|
+
import { labelOf as Se } from "../groups/parts.js";
|
|
24
|
+
import { useDraft as d } from "../../react/use-draft.js";
|
|
25
25
|
import { EditorSaveContext as Ce, readerMediaReady as we, useEditorSaveCoordinator as Te } from "../content/editor-save.js";
|
|
26
26
|
import { OfferFields as Ee } from "../content/offer-fields.js";
|
|
27
27
|
import { AttributeFields as De, formOf as Oe } from "../groups/fields.js";
|
|
@@ -30,13 +30,13 @@ import { usePageNotices as Ae } from "../../react/page-notices.js";
|
|
|
30
30
|
import { EntityChips as je } from "../groups/entity-chips.js";
|
|
31
31
|
import { ReaderManifestEditor as Me } from "./reader-manifest.js";
|
|
32
32
|
import { PageNotices as Ne } from "./page-notices.js";
|
|
33
|
-
import { RuleFields as Pe, VersionsEditor as Fe,
|
|
34
|
-
import { fileTitle as
|
|
35
|
-
import { contentStatus as
|
|
36
|
-
import { useEffect as f, useId as
|
|
37
|
-
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
33
|
+
import { RuleFields as Pe, VersionsEditor as Fe, allowsIndividualSales as Ie, cleanRule as Le, complete as Re, defaultAccessRule as ze, versionLabel as Be } from "../content/editors.js";
|
|
34
|
+
import { fileTitle as Ve } from "./bulk-drafts.js";
|
|
35
|
+
import { contentStatus as He } from "./content-manager.js";
|
|
36
|
+
import { useEffect as f, useId as Ue, useMemo as p, useRef as m, useState as h } from "react";
|
|
37
|
+
import { Fragment as We, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
38
38
|
//#region src/components/admin/reader-content-editor.tsx
|
|
39
|
-
var
|
|
39
|
+
var Ge = {
|
|
40
40
|
kind: "",
|
|
41
41
|
id: ""
|
|
42
42
|
}, v = () => ({
|
|
@@ -44,12 +44,12 @@ var He = {
|
|
|
44
44
|
slug: "",
|
|
45
45
|
description: "",
|
|
46
46
|
body: ""
|
|
47
|
-
}),
|
|
47
|
+
}), Ke = (e, t) => e?.text?.[t] ?? (e?.language === t ? {
|
|
48
48
|
title: e.title,
|
|
49
49
|
slug: e.slug,
|
|
50
50
|
description: e.description,
|
|
51
51
|
body: e.body
|
|
52
|
-
} : v()),
|
|
52
|
+
} : v()), qe = (e) => ({
|
|
53
53
|
...e,
|
|
54
54
|
title: e.title.trim(),
|
|
55
55
|
description: e.description?.trim()
|
|
@@ -65,18 +65,18 @@ function b({ title: e, label: t, children: n, className: r = "" }) {
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
function x(x) {
|
|
68
|
-
let { client: S, scope:
|
|
68
|
+
let { client: S, scope: Je } = te(x.client), Ye = r(), { t: C } = Ye, w = Ue(), Xe = ee(), Ze = i(x.onError), T = x.model, E = T.kinds[x.kind], Qe = x.languages?.map((e) => typeof e == "string" ? {
|
|
69
69
|
value: e,
|
|
70
70
|
label: e
|
|
71
|
-
} : e), D =
|
|
71
|
+
} : e), D = Qe?.length ? Qe : T.languages.map((e) => ({
|
|
72
72
|
value: e,
|
|
73
73
|
label: e
|
|
74
|
-
})),
|
|
74
|
+
})), $e = D.map((e) => e.value).join("|"), [O, et] = h(D[0]?.value ?? "en"), [tt, nt] = h(""), k = ke(x.id, x.kind, O, {
|
|
75
75
|
client: S,
|
|
76
|
-
version:
|
|
77
|
-
}), [
|
|
76
|
+
version: tt || void 0
|
|
77
|
+
}), [rt, it] = h(null), A = k.content ?? rt, j = m({
|
|
78
78
|
item: A,
|
|
79
|
-
scope:
|
|
79
|
+
scope: Je,
|
|
80
80
|
alive: !0
|
|
81
81
|
});
|
|
82
82
|
j.current.item = A, f(() => {
|
|
@@ -85,34 +85,37 @@ function x(x) {
|
|
|
85
85
|
e.alive = !1;
|
|
86
86
|
};
|
|
87
87
|
}, []);
|
|
88
|
-
let M = () => j.current.alive && j.current.scope ===
|
|
88
|
+
let M = () => j.current.alive && j.current.scope === Je, N = m(null), [at, ot] = h(!1), [P, st] = h(!1), [F, I] = h(), [ct, lt] = h(""), ut = d(p(() => ({ at: A?.publish_at ? be(new Date(A.publish_at)) : "" }), [A?.publish_at])), dt = ut.value.at, ft = (e) => ut.edit({ at: e }), [pt, mt] = h(!1), [ht, gt] = h([]), [_t, vt] = h(!1), [L, yt] = h(null), [bt, xt] = h(null), R = p(() => [...A?.versions ?? []].sort((e, t) => e.position - t.position), [A?.versions]), z = R.find((e) => e.id === tt) ?? R[0];
|
|
89
89
|
f(() => {
|
|
90
|
-
|
|
91
|
-
}, [
|
|
90
|
+
_t && z && gt((e) => e.includes(z.id) ? e : [...e, z.id]);
|
|
91
|
+
}, [_t, z]);
|
|
92
92
|
let B = ne(A?.id, {
|
|
93
93
|
language: O,
|
|
94
94
|
client: S
|
|
95
|
-
}),
|
|
95
|
+
}), St = p(() => new Map(B.entities), [B.entities]), [Ct, wt] = h(/* @__PURE__ */ new Map()), Tt = p(() => new Map([...Ct, ...St]), [St, Ct]), V = p(() => E.entities ?? [], [E.entities]), H = d(p(() => Object.fromEntries($e.split("|").map((e) => [e, Ke(A, e)])), [A, $e])), U = d(p(() => ({
|
|
96
96
|
listing: A?.listing ?? "listed",
|
|
97
|
-
comments: A?.comments ?? "open",
|
|
97
|
+
comments: A?.comments ?? (!E.comment_modes?.length || E.comment_modes.includes("open") ? "open" : E.comment_modes[0]),
|
|
98
98
|
attributes: Oe(E.attributes ?? {}, A?.attributes ?? {}),
|
|
99
|
-
access: A?.access ??
|
|
99
|
+
access: A?.access ?? ze(T, x.kind)
|
|
100
100
|
}), [
|
|
101
101
|
A?.listing,
|
|
102
102
|
A?.comments,
|
|
103
103
|
A?.attributes,
|
|
104
104
|
A?.access,
|
|
105
|
-
E.attributes
|
|
106
|
-
|
|
105
|
+
E.attributes,
|
|
106
|
+
E.comment_modes,
|
|
107
|
+
T,
|
|
108
|
+
x.kind
|
|
109
|
+
])), W = d(p(() => ({
|
|
107
110
|
memberships: B.memberships.filter((e) => V.includes(B.entities.get(e.group_id ?? "")?.kind ?? "")),
|
|
108
111
|
create: []
|
|
109
112
|
}), [
|
|
110
113
|
B.memberships,
|
|
111
114
|
B.entities,
|
|
112
115
|
V
|
|
113
|
-
])),
|
|
116
|
+
])), Et = (e, t, n) => {
|
|
114
117
|
let r = T.entity_kinds[e]?.scoped_by;
|
|
115
|
-
if (r) return new Set(t.filter((e) =>
|
|
118
|
+
if (r) return new Set(t.filter((e) => Tt.get(e.group_id ?? "")?.kind === r).map((e) => e.group_id)).size + n.filter((e) => e.kind === r).length === 1 ? void 0 : Se(x.labels, r);
|
|
116
119
|
}, G = Te(), K = m({
|
|
117
120
|
texts: H,
|
|
118
121
|
details: U,
|
|
@@ -125,12 +128,12 @@ function x(x) {
|
|
|
125
128
|
associations: W,
|
|
126
129
|
language: O
|
|
127
130
|
};
|
|
128
|
-
let
|
|
131
|
+
let Dt = m(!1);
|
|
129
132
|
f(() => {
|
|
130
|
-
if (
|
|
131
|
-
|
|
133
|
+
if (Dt.current || x.id || !x.entities?.length) return;
|
|
134
|
+
Dt.current = !0;
|
|
132
135
|
let e = x.entities.filter((e) => V.includes(e.kind));
|
|
133
|
-
e.length && (
|
|
136
|
+
e.length && (wt((t) => new Map([...t, ...e.map((e) => [e.id, e])])), K.current.associations.edit((t) => ({
|
|
134
137
|
...t,
|
|
135
138
|
memberships: [...t.memberships, ...e.filter((e) => !t.memberships.some((t) => t.group_id === e.id)).map((e) => ({ group_id: e.id }))]
|
|
136
139
|
})));
|
|
@@ -139,19 +142,19 @@ function x(x) {
|
|
|
139
142
|
x.entities,
|
|
140
143
|
V
|
|
141
144
|
]);
|
|
142
|
-
let
|
|
145
|
+
let Ot = H.value[O] ?? v(), kt = (e) => H.edit((t) => ({
|
|
143
146
|
...t,
|
|
144
147
|
[O]: {
|
|
145
148
|
...t[O] ?? v(),
|
|
146
149
|
...e
|
|
147
150
|
}
|
|
148
|
-
})),
|
|
149
|
-
M() && (I(t instanceof y ? t.message : t), t instanceof y ||
|
|
150
|
-
},
|
|
151
|
+
})), At = (t) => {
|
|
152
|
+
M() && (I(t instanceof y ? t.message : t), t instanceof y || Ze(e(t), "content.save"));
|
|
153
|
+
}, jt = async (e) => {
|
|
151
154
|
if (j.current.item) return j.current.item;
|
|
152
155
|
if (N.current) return N.current;
|
|
153
|
-
|
|
154
|
-
let t = K.current.language, n = K.current.texts.get()[t] ?? v(), r = n.title.trim() ||
|
|
156
|
+
ot(!0);
|
|
157
|
+
let t = K.current.language, n = K.current.texts.get()[t] ?? v(), r = n.title.trim() || Ve(e ?? "") || C("readerEditor.untitled");
|
|
155
158
|
n.title.trim() || K.current.texts.edit((e) => ({
|
|
156
159
|
...e,
|
|
157
160
|
[t]: {
|
|
@@ -165,10 +168,12 @@ function x(x) {
|
|
|
165
168
|
...n,
|
|
166
169
|
title: r
|
|
167
170
|
} },
|
|
168
|
-
owner_group_id: x.ownerGroup
|
|
171
|
+
owner_group_id: x.ownerGroup,
|
|
172
|
+
...E.access_levels?.length ? { access: Le(K.current.details.get().access) } : {},
|
|
173
|
+
...E.comment_modes?.length ? { comments: K.current.details.get().comments } : {}
|
|
169
174
|
};
|
|
170
|
-
return N.current = k.create(i).then((e) => (j.current.item = e, M() && (
|
|
171
|
-
N.current = null, M() &&
|
|
175
|
+
return N.current = k.create(i).then((e) => (j.current.item = e, M() && (it(e), x.onCreated?.(e)), e)).finally(() => {
|
|
176
|
+
N.current = null, M() && ot(!1);
|
|
172
177
|
}), N.current;
|
|
173
178
|
}, q = p(() => A && z ? {
|
|
174
179
|
kind: x.kind,
|
|
@@ -178,16 +183,16 @@ function x(x) {
|
|
|
178
183
|
x.kind,
|
|
179
184
|
A,
|
|
180
185
|
z
|
|
181
|
-
]), J =
|
|
186
|
+
]), J = ge("content.save", x.onError), Y = ge("offer.save", x.onError), X = ge("content.save", x.onError), Z = ae(q, {
|
|
182
187
|
commit: z?.live ? "manual" : "auto",
|
|
183
188
|
client: S,
|
|
184
189
|
onError: x.onError
|
|
185
|
-
}),
|
|
186
|
-
|
|
187
|
-
let
|
|
190
|
+
}), Mt = m(Z);
|
|
191
|
+
Mt.current = Z;
|
|
192
|
+
let Nt = Z.read.read?.files ?? [], Pt = Ae(A?.id, z?.id, { client: S }).reload, Ft = q && Z.read.read ? JSON.stringify([
|
|
188
193
|
q.id,
|
|
189
194
|
q.version,
|
|
190
|
-
|
|
195
|
+
Nt.filter((e) => e.upload).map((e) => [
|
|
191
196
|
e.path,
|
|
192
197
|
e.size,
|
|
193
198
|
e.staged,
|
|
@@ -196,66 +201,66 @@ function x(x) {
|
|
|
196
201
|
])
|
|
197
202
|
]) : null;
|
|
198
203
|
f(() => {
|
|
199
|
-
|
|
200
|
-
}, [
|
|
204
|
+
Ft && Pt();
|
|
205
|
+
}, [Ft, Pt]);
|
|
201
206
|
let Q = Z.groups.filter((e) => e.rule?.page).flatMap((e) => e.files.filter((e) => !a(e)));
|
|
202
207
|
f(() => {
|
|
203
|
-
L && !Q.some((e) => e.path === L.path) &&
|
|
208
|
+
L && !Q.some((e) => e.path === L.path) && yt(null);
|
|
204
209
|
}, [L, Q]);
|
|
205
|
-
let
|
|
210
|
+
let It = Z.groups.flatMap((e) => e.rule ? [e.rule] : []), Lt = z?.cover?.image ? Nt.find((e) => e.upload && !n(It, e.path)?.page && t(e.path).split("/").at(-1) === z.cover?.image) : void 0, $ = ie(q ?? Ge, bt?.path, {
|
|
206
211
|
client: S,
|
|
207
212
|
onError: x.onError,
|
|
208
|
-
onSaved: () =>
|
|
209
|
-
}),
|
|
213
|
+
onSaved: () => xt(null)
|
|
214
|
+
}), Rt = (e) => xt({
|
|
210
215
|
path: e,
|
|
211
|
-
aspect: n(
|
|
212
|
-
}),
|
|
216
|
+
aspect: n(It, e)?.aspect ?? ""
|
|
217
|
+
}), zt = !!Z.error || Z.queue.items.some((e) => e.status === "failed") || Nt.some((e) => e.failed), Bt = Nt.some(re), Vt = Q.length, Ht = Z.busy || at || Bt || Z.read.loading || J.pending, Ut = Ht || zt || !!Z.read.error || Vt === 0 || G.pending || Y.pending, Wt = (e) => {
|
|
213
218
|
let t = [...e];
|
|
214
|
-
t.length && (Z.add(t),
|
|
215
|
-
},
|
|
219
|
+
t.length && (Z.add(t), jt(t.find((e) => /\.zip$/i.test(e.name))?.name ?? t[0]?.name).catch(At));
|
|
220
|
+
}, Gt = ut.dirty.length > 0 || H.dirty.length > 0 || U.dirty.length > 0 || W.dirty.length > 0 || G.dirty, Kt = Gt || Z.pending.length > 0 || Z.queue.items.some((e) => e.status === "uploaded");
|
|
216
221
|
f(() => {
|
|
217
|
-
if (!
|
|
222
|
+
if (!Gt && !Z.busy) return;
|
|
218
223
|
let e = (e) => {
|
|
219
224
|
e.preventDefault(), e.returnValue = "";
|
|
220
225
|
};
|
|
221
226
|
return addEventListener("beforeunload", e), () => removeEventListener("beforeunload", e);
|
|
222
|
-
}, [
|
|
223
|
-
let
|
|
227
|
+
}, [Gt, Z.busy]);
|
|
228
|
+
let qt = async (e) => {
|
|
224
229
|
if (P) return;
|
|
225
|
-
I(void 0),
|
|
230
|
+
I(void 0), lt("");
|
|
226
231
|
let t = K.current;
|
|
227
232
|
if (!t.texts.get()[t.language]?.title.trim()) return I(C("contentManager.titleRequired"));
|
|
228
233
|
let n = G.problem();
|
|
229
234
|
if (n) return I(C("readerEditor.fixSection", { section: n }));
|
|
230
|
-
if (!
|
|
235
|
+
if (!Re(t.details.get().access) || t.details.get().access.level === "tier" && !t.details.get().access.tiers?.length) return I(C("readerEditor.accessRequired"));
|
|
231
236
|
let r;
|
|
232
237
|
try {
|
|
233
|
-
r =
|
|
238
|
+
r = xe(E.attributes ?? {}, t.details.get().attributes);
|
|
234
239
|
} catch (e) {
|
|
235
|
-
return
|
|
240
|
+
return At(e);
|
|
236
241
|
}
|
|
237
|
-
if (e &&
|
|
238
|
-
|
|
239
|
-
let i = t.texts.checkpoint(), ee = t.details.checkpoint(), te = t.associations.checkpoint(), ne = t.texts.dirty.slice(), re = { ...t.texts.get() }, a = t.details.get(), o = t.associations.get().memberships.slice(), s = t.associations.get().create.slice(), ie = (e) => !!
|
|
242
|
+
if (e && Ut) return I(C("readerEditor.filesNotReady"));
|
|
243
|
+
st(!0);
|
|
244
|
+
let i = t.texts.checkpoint(), ee = t.details.checkpoint(), te = t.associations.checkpoint(), ne = t.texts.dirty.slice(), re = { ...t.texts.get() }, a = t.details.get(), o = t.associations.get().memberships.slice(), s = t.associations.get().create.slice(), ie = (e) => !!Et(e.kind, o, s), ae = !0;
|
|
240
245
|
try {
|
|
241
|
-
let n = await
|
|
246
|
+
let n = await jt();
|
|
242
247
|
if (!M()) return;
|
|
243
248
|
if (B.error) throw B.error;
|
|
244
|
-
if (await
|
|
249
|
+
if (await Xe(async () => {
|
|
245
250
|
for (let e of ne) {
|
|
246
251
|
let t = String(e), r = re[t];
|
|
247
252
|
if (!r?.title.trim()) throw new y(C("contentManager.titleRequired"));
|
|
248
|
-
if (n = await S.contents.putText(n.id, t,
|
|
253
|
+
if (n = await S.contents.putText(n.id, t, qe(r)), !M()) return;
|
|
249
254
|
}
|
|
250
255
|
if (n = await S.contents.get(n.id, O), M() && (n = await S.contents.update(n.id, {
|
|
251
256
|
listing: a.listing,
|
|
252
257
|
comments: a.comments,
|
|
253
258
|
attributes: r,
|
|
254
|
-
access:
|
|
259
|
+
access: Le(a.access),
|
|
255
260
|
revision: n.revision
|
|
256
261
|
}), M() && t.associations.dirty.length)) {
|
|
257
262
|
let e = n.versions.find((e) => e.id === z?.id) ?? n.versions[0], t = o.map((t) => {
|
|
258
|
-
let n =
|
|
263
|
+
let n = Tt.get(t.group_id ?? "")?.kind;
|
|
259
264
|
return n && T.entity_kinds[n]?.version_level && !t.version_id ? {
|
|
260
265
|
...t,
|
|
261
266
|
version_id: e?.id
|
|
@@ -265,13 +270,13 @@ function x(x) {
|
|
|
265
270
|
memberships: t,
|
|
266
271
|
create: s.filter((e) => !ie(e))
|
|
267
272
|
}, O);
|
|
268
|
-
|
|
273
|
+
wt((e) => new Map([...e, ...r.entities.map((e) => [e.id, e])])), ae = te({
|
|
269
274
|
memberships: r.memberships.filter((e) => V.includes(r.entities.find((t) => t.id === e.group_id)?.kind ?? "")),
|
|
270
275
|
create: s.filter(ie)
|
|
271
276
|
});
|
|
272
277
|
}
|
|
273
278
|
}), !M()) return;
|
|
274
|
-
let c =
|
|
279
|
+
let c = Mt.current;
|
|
275
280
|
!c.busy && (c.pending.length || c.queue.items.some((e) => e.status === "uploaded")) && await c.commit();
|
|
276
281
|
let oe = await G.save(M);
|
|
277
282
|
if (oe) throw new y(C("readerEditor.fixSection", { section: oe }));
|
|
@@ -284,20 +289,20 @@ function x(x) {
|
|
|
284
289
|
});
|
|
285
290
|
if (e) {
|
|
286
291
|
if (!se || !ce || !ae) throw new y(C("readerEditor.changedDuringSave"));
|
|
287
|
-
let e =
|
|
292
|
+
let e = Mt.current;
|
|
288
293
|
if (!q || e.busy || e.error || e.queue.items.some((e) => e.status === "failed") || !await we(S, q)) throw new y(C("readerEditor.filesNotReady"));
|
|
289
294
|
if ((z ? await S.contents.version(n.id, z.id, O) : null)?.state !== "published") throw new y(C("readerEditor.versionDraft"));
|
|
290
295
|
if (!M()) return;
|
|
291
|
-
let t =
|
|
292
|
-
t({ at: r.publish_at ?
|
|
293
|
-
} else
|
|
296
|
+
let t = ut.checkpoint(), r = await Xe(() => S.contents.publishWhenReady(n.id, dt ? new Date(dt).toISOString() : void 0));
|
|
297
|
+
t({ at: r.publish_at ? be(new Date(r.publish_at)) : "" }), lt(C("contentManager.publishedNotice"));
|
|
298
|
+
} else lt(C("pollEditor.saved"));
|
|
294
299
|
} catch (e) {
|
|
295
|
-
|
|
300
|
+
At(e);
|
|
296
301
|
} finally {
|
|
297
|
-
M() &&
|
|
302
|
+
M() && st(!1);
|
|
298
303
|
}
|
|
299
|
-
},
|
|
300
|
-
let t = await
|
|
304
|
+
}, Jt = async (e) => {
|
|
305
|
+
let t = await jt(e.name), n = t.versions.find((e) => e.id === z?.id) ?? t.versions[0];
|
|
301
306
|
if (!n || !M()) return;
|
|
302
307
|
let r = {
|
|
303
308
|
kind: x.kind,
|
|
@@ -305,7 +310,7 @@ function x(x) {
|
|
|
305
310
|
version: n.id
|
|
306
311
|
}, i = await S.media.uploadNamed(r, e, { path: await S.media.presetPath(x.kind, "cover", e) });
|
|
307
312
|
M() && await S.contents.setCover(t.id, n.id, i.name);
|
|
308
|
-
},
|
|
313
|
+
}, Yt = async (e) => {
|
|
309
314
|
if (!q || !A || !z) return;
|
|
310
315
|
let n = /\.[^./]+$/.exec(e.path)?.[0] ?? "", r = await S.media.presetPath(x.kind, "cover", new File([], `i-${crypto.randomUUID()}${n}`, { type: e.type }));
|
|
311
316
|
await S.media.commit(q, [{
|
|
@@ -316,9 +321,9 @@ function x(x) {
|
|
|
316
321
|
path: e.path
|
|
317
322
|
},
|
|
318
323
|
to: r
|
|
319
|
-
}]), M() && (await S.contents.setCover(A.id, z.id, t(r).split("/").at(-1)), M() &&
|
|
320
|
-
}, { confirm:
|
|
321
|
-
A && await
|
|
324
|
+
}]), M() && (await S.contents.setCover(A.id, z.id, t(r).split("/").at(-1)), M() && Rt(r));
|
|
325
|
+
}, { confirm: Xt, dialog: Zt } = ye(), Qt = async () => {
|
|
326
|
+
A && await Xt({
|
|
322
327
|
title: C("contentManager.deleteTitle", { title: A.title }),
|
|
323
328
|
description: C("contentManager.deleteBody"),
|
|
324
329
|
confirm: C("contentManager.delete")
|
|
@@ -326,17 +331,17 @@ function x(x) {
|
|
|
326
331
|
Z.discard(), await S.contents.remove(A.id), M() && x.onDeleted?.(A);
|
|
327
332
|
});
|
|
328
333
|
};
|
|
329
|
-
if (x.id && !A) return k.error ? /* @__PURE__ */ g(
|
|
334
|
+
if (x.id && !A) return k.error ? /* @__PURE__ */ g(_e, {
|
|
330
335
|
error: k.error,
|
|
331
336
|
message: C("contentManager.loadFailed"),
|
|
332
337
|
retry: k.reload
|
|
333
|
-
}) : /* @__PURE__ */ g(
|
|
334
|
-
let
|
|
338
|
+
}) : /* @__PURE__ */ g(ve, {});
|
|
339
|
+
let $t = A ? He(A) : "draft", en = z?.id, tn = (e) => U.edit((t) => ({
|
|
335
340
|
...t,
|
|
336
341
|
...e
|
|
337
|
-
})),
|
|
342
|
+
})), nn = R.map((e) => ({
|
|
338
343
|
id: e.id,
|
|
339
|
-
label:
|
|
344
|
+
label: Be(e, (e) => D.find((t) => t.value === e)?.label ?? e, x.labels)
|
|
340
345
|
}));
|
|
341
346
|
return /* @__PURE__ */ g(Ce.Provider, {
|
|
342
347
|
value: G.context,
|
|
@@ -351,10 +356,10 @@ function x(x) {
|
|
|
351
356
|
type: "button",
|
|
352
357
|
className: "h-20 shrink-0 overflow-hidden rounded-md border border-border bg-muted disabled:cursor-default",
|
|
353
358
|
style: { aspectRatio: .7071 },
|
|
354
|
-
disabled: !
|
|
359
|
+
disabled: !Lt || P,
|
|
355
360
|
title: C("readerEditor.thumbnail"),
|
|
356
361
|
"aria-label": C("readerEditor.editThumbnail"),
|
|
357
|
-
onClick: () =>
|
|
362
|
+
onClick: () => Lt && Rt(Lt.path),
|
|
358
363
|
"data-ckui": "editor-thumbnail",
|
|
359
364
|
children: z?.cover?.url && /* @__PURE__ */ g("img", {
|
|
360
365
|
src: z.cover.url,
|
|
@@ -366,16 +371,16 @@ function x(x) {
|
|
|
366
371
|
className: "min-w-0 flex-1",
|
|
367
372
|
children: [/* @__PURE__ */ g("h1", {
|
|
368
373
|
className: "sr-only",
|
|
369
|
-
children:
|
|
374
|
+
children: Ot.title || C("readerEditor.new")
|
|
370
375
|
}), /* @__PURE__ */ _("div", {
|
|
371
376
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
372
377
|
children: [
|
|
373
378
|
/* @__PURE__ */ g(se, {
|
|
374
379
|
variant: A?.live ? "default" : "outline",
|
|
375
|
-
children: C(`contentManager.${
|
|
380
|
+
children: C(`contentManager.${$t}`)
|
|
376
381
|
}),
|
|
377
|
-
z && /* @__PURE__ */ g("span", { children: C("contentEditor.pageCount", { count: Z.read.read ?
|
|
378
|
-
|
|
382
|
+
z && /* @__PURE__ */ g("span", { children: C("contentEditor.pageCount", { count: Z.read.read ? Vt : z.pages ?? 0 }) }),
|
|
383
|
+
at && /* @__PURE__ */ g("span", {
|
|
379
384
|
role: "status",
|
|
380
385
|
children: C("common.saving")
|
|
381
386
|
})
|
|
@@ -391,29 +396,29 @@ function x(x) {
|
|
|
391
396
|
},
|
|
392
397
|
children: C(A.live ? "contentManager.view" : "readerEditor.preview")
|
|
393
398
|
}),
|
|
394
|
-
A && !
|
|
399
|
+
A && !Kt && !P ? /* @__PURE__ */ g("span", {
|
|
395
400
|
role: "status",
|
|
396
401
|
className: "text-sm text-muted-foreground",
|
|
397
402
|
"data-ckui": "editor-saved",
|
|
398
403
|
children: C("readerEditor.allSaved")
|
|
399
404
|
}) : /* @__PURE__ */ g(o, {
|
|
400
|
-
disabled: P ||
|
|
401
|
-
onClick: () => void
|
|
405
|
+
disabled: P || at || !Kt,
|
|
406
|
+
onClick: () => void qt(!1),
|
|
402
407
|
children: C(P ? "common.saving" : A?.live ? "readerEditor.saveChanges" : "readerEditor.saveDraft")
|
|
403
408
|
}),
|
|
404
409
|
!A?.live && /* @__PURE__ */ g(o, {
|
|
405
410
|
variant: "outline",
|
|
406
|
-
disabled: P ||
|
|
407
|
-
onClick: () => void
|
|
408
|
-
children: C(
|
|
411
|
+
disabled: P || Ut,
|
|
412
|
+
onClick: () => void qt(!0),
|
|
413
|
+
children: C(dt ? "readerEditor.schedule" : "contentManager.publish")
|
|
409
414
|
})
|
|
410
415
|
]
|
|
411
416
|
}),
|
|
412
|
-
F != null && /* @__PURE__ */ g(
|
|
413
|
-
|
|
417
|
+
F != null && /* @__PURE__ */ g(u, { children: typeof F == "string" ? F : he(Ye, e(F)) }),
|
|
418
|
+
ct && /* @__PURE__ */ g("p", {
|
|
414
419
|
role: "status",
|
|
415
420
|
className: "text-sm text-muted-foreground",
|
|
416
|
-
children:
|
|
421
|
+
children: ct
|
|
417
422
|
}),
|
|
418
423
|
/* @__PURE__ */ _("fieldset", {
|
|
419
424
|
disabled: P,
|
|
@@ -435,21 +440,21 @@ function x(x) {
|
|
|
435
440
|
id: `${w}-title`,
|
|
436
441
|
required: !0,
|
|
437
442
|
maxLength: 300,
|
|
438
|
-
value:
|
|
439
|
-
onChange: (e) =>
|
|
443
|
+
value: Ot.title,
|
|
444
|
+
onChange: (e) => kt({ title: e.target.value })
|
|
440
445
|
})]
|
|
441
446
|
}), /* @__PURE__ */ _("div", {
|
|
442
447
|
className: "grid gap-1.5",
|
|
443
448
|
children: [/* @__PURE__ */ g(l, {
|
|
444
449
|
htmlFor: `${w}-language`,
|
|
445
450
|
children: C("contentManager.language")
|
|
446
|
-
}), /* @__PURE__ */ _(
|
|
451
|
+
}), /* @__PURE__ */ _(le, {
|
|
447
452
|
value: O,
|
|
448
|
-
onValueChange: (e) => e &&
|
|
449
|
-
children: [/* @__PURE__ */ g(
|
|
453
|
+
onValueChange: (e) => e && et(e),
|
|
454
|
+
children: [/* @__PURE__ */ g(fe, {
|
|
450
455
|
id: `${w}-language`,
|
|
451
|
-
children: /* @__PURE__ */ g(
|
|
452
|
-
}), /* @__PURE__ */ g(
|
|
456
|
+
children: /* @__PURE__ */ g(pe, { children: D.find((e) => e.value === O)?.label ?? O })
|
|
457
|
+
}), /* @__PURE__ */ g(ue, { children: D.map((e) => /* @__PURE__ */ g(de, {
|
|
453
458
|
value: e.value,
|
|
454
459
|
children: e.label
|
|
455
460
|
}, e.value)) })]
|
|
@@ -461,17 +466,17 @@ function x(x) {
|
|
|
461
466
|
children: [/* @__PURE__ */ g(l, {
|
|
462
467
|
htmlFor: `${w}-description`,
|
|
463
468
|
children: C("readerEditor.headerText")
|
|
464
|
-
}), /* @__PURE__ */ g(
|
|
469
|
+
}), /* @__PURE__ */ g(me, {
|
|
465
470
|
id: `${w}-description`,
|
|
466
471
|
rows: 3,
|
|
467
|
-
value:
|
|
468
|
-
onChange: (e) =>
|
|
472
|
+
value: Ot.description ?? "",
|
|
473
|
+
onChange: (e) => kt({ description: e.target.value })
|
|
469
474
|
})]
|
|
470
475
|
}),
|
|
471
476
|
/* @__PURE__ */ g(De, {
|
|
472
477
|
declared: E.attributes ?? {},
|
|
473
478
|
form: U.value.attributes,
|
|
474
|
-
onChange: (e, t) =>
|
|
479
|
+
onChange: (e, t) => tn({ attributes: {
|
|
475
480
|
...U.value.attributes,
|
|
476
481
|
[e]: t
|
|
477
482
|
} }),
|
|
@@ -482,14 +487,14 @@ function x(x) {
|
|
|
482
487
|
/* @__PURE__ */ _(b, {
|
|
483
488
|
title: C("readerEditor.files"),
|
|
484
489
|
children: [
|
|
485
|
-
R.length > 1 && /* @__PURE__ */ _(
|
|
486
|
-
value:
|
|
487
|
-
onValueChange: (e) => e &&
|
|
490
|
+
R.length > 1 && /* @__PURE__ */ _(le, {
|
|
491
|
+
value: en ?? "",
|
|
492
|
+
onValueChange: (e) => e && nt(e),
|
|
488
493
|
disabled: Z.busy || Z.pending.length > 0,
|
|
489
|
-
children: [/* @__PURE__ */ g(
|
|
494
|
+
children: [/* @__PURE__ */ g(fe, {
|
|
490
495
|
"aria-label": C("contentEditor.versions"),
|
|
491
|
-
children: /* @__PURE__ */ g(
|
|
492
|
-
}), /* @__PURE__ */ g(
|
|
496
|
+
children: /* @__PURE__ */ g(pe, { children: nn.find((e) => e.id === en)?.label })
|
|
497
|
+
}), /* @__PURE__ */ g(ue, { children: nn.map((e) => /* @__PURE__ */ g(de, {
|
|
493
498
|
value: e.id,
|
|
494
499
|
children: e.label
|
|
495
500
|
}, e.id)) })]
|
|
@@ -508,31 +513,31 @@ function x(x) {
|
|
|
508
513
|
size: "sm",
|
|
509
514
|
variant: "secondary",
|
|
510
515
|
disabled: J.pending || P,
|
|
511
|
-
onClick: () => void J.run(() =>
|
|
516
|
+
onClick: () => void J.run(() => Yt(L)),
|
|
512
517
|
children: C("readerEditor.setThumbnail")
|
|
513
518
|
})]
|
|
514
519
|
}),
|
|
515
520
|
/* @__PURE__ */ g(c, {
|
|
516
521
|
folder: {
|
|
517
522
|
...Z,
|
|
518
|
-
add:
|
|
523
|
+
add: Wt
|
|
519
524
|
},
|
|
520
525
|
label: !1,
|
|
521
526
|
layout: "grid",
|
|
522
527
|
disabled: P,
|
|
523
528
|
inputLabel: C("readerEditor.files"),
|
|
524
529
|
selectedPage: L?.path ?? null,
|
|
525
|
-
onSelectPage:
|
|
530
|
+
onSelectPage: yt
|
|
526
531
|
}),
|
|
527
|
-
Z.read.error && /* @__PURE__ */ g(
|
|
532
|
+
Z.read.error && /* @__PURE__ */ g(_e, {
|
|
528
533
|
error: Z.read.error,
|
|
529
534
|
message: C("contentManager.loadFailed"),
|
|
530
535
|
retry: Z.read.reload
|
|
531
536
|
}),
|
|
532
|
-
(
|
|
537
|
+
(zt || Ht || !Z.read.error && Vt === 0) && /* @__PURE__ */ g("p", {
|
|
533
538
|
role: "status",
|
|
534
539
|
className: "text-sm text-muted-foreground",
|
|
535
|
-
children: C(
|
|
540
|
+
children: C(zt ? "readerEditor.filesFailed" : Ht ? "readerEditor.processing" : "readerEditor.addPages")
|
|
536
541
|
}),
|
|
537
542
|
A && z && /* @__PURE__ */ g(Ne, {
|
|
538
543
|
content: A.id,
|
|
@@ -544,14 +549,14 @@ function x(x) {
|
|
|
544
549
|
}),
|
|
545
550
|
A && /* @__PURE__ */ _("details", {
|
|
546
551
|
className: "rounded-xl border border-border bg-card p-4",
|
|
547
|
-
onToggle: (e) => e.currentTarget.open &&
|
|
552
|
+
onToggle: (e) => e.currentTarget.open && mt(!0),
|
|
548
553
|
children: [/* @__PURE__ */ g("summary", {
|
|
549
554
|
className: "cursor-pointer font-medium",
|
|
550
555
|
children: C("readerEditor.versions")
|
|
551
|
-
}),
|
|
556
|
+
}), pt && /* @__PURE__ */ g(Fe, {
|
|
552
557
|
content: A,
|
|
553
558
|
media: !1,
|
|
554
|
-
activeVersion:
|
|
559
|
+
activeVersion: en,
|
|
555
560
|
client: S,
|
|
556
561
|
labels: x.labels,
|
|
557
562
|
onError: x.onError
|
|
@@ -559,11 +564,11 @@ function x(x) {
|
|
|
559
564
|
}),
|
|
560
565
|
A && z && /* @__PURE__ */ _("details", {
|
|
561
566
|
className: "rounded-xl border border-border bg-card p-4",
|
|
562
|
-
onToggle: (e) =>
|
|
567
|
+
onToggle: (e) => vt(e.currentTarget.open),
|
|
563
568
|
children: [/* @__PURE__ */ g("summary", {
|
|
564
569
|
className: "cursor-pointer font-medium",
|
|
565
570
|
children: C("readerEditor.readerTools")
|
|
566
|
-
}),
|
|
571
|
+
}), ht.filter((e) => R.some((t) => t.id === e)).map((e) => /* @__PURE__ */ g("div", {
|
|
567
572
|
hidden: e !== z.id,
|
|
568
573
|
children: /* @__PURE__ */ g(Me, {
|
|
569
574
|
content: A.id,
|
|
@@ -579,26 +584,26 @@ function x(x) {
|
|
|
579
584
|
children: [
|
|
580
585
|
/* @__PURE__ */ _(b, {
|
|
581
586
|
title: C("readerEditor.entities"),
|
|
582
|
-
children: [B.error && /* @__PURE__ */ g(
|
|
587
|
+
children: [B.error && /* @__PURE__ */ g(u, { error: B.error }), V.map((e) => {
|
|
583
588
|
let t = W.value.memberships.map((e, t) => ({
|
|
584
589
|
a: e,
|
|
585
590
|
index: t
|
|
586
|
-
})).filter(({ a: t }) =>
|
|
591
|
+
})).filter(({ a: t }) => Tt.get(t.group_id ?? "")?.kind === e);
|
|
587
592
|
return /* @__PURE__ */ g(je, {
|
|
588
593
|
kind: e,
|
|
589
|
-
label:
|
|
594
|
+
label: Se(x.labels, e),
|
|
590
595
|
memberships: t.map(({ a: e }) => e),
|
|
591
|
-
cards:
|
|
596
|
+
cards: Tt,
|
|
592
597
|
spec: T.entity_kinds[e] ?? {},
|
|
593
598
|
labels: x.labels,
|
|
594
|
-
versions:
|
|
595
|
-
versionLabel: (e) =>
|
|
599
|
+
versions: nn,
|
|
600
|
+
versionLabel: (e) => nn.find((t) => t.id === e)?.label ?? e,
|
|
596
601
|
language: O,
|
|
597
602
|
management: x.management,
|
|
598
603
|
client: S,
|
|
599
604
|
disabled: !!A && B.loading,
|
|
600
605
|
created: W.value.create.filter((t) => t.kind === e).map((e) => e.name),
|
|
601
|
-
needsScope:
|
|
606
|
+
needsScope: Et(e, W.value.memberships, W.value.create),
|
|
602
607
|
onCreatedChange: (t) => W.edit((n) => ({
|
|
603
608
|
...n,
|
|
604
609
|
create: [...n.create.filter((t) => t.kind !== e), ...t.map((t) => ({
|
|
@@ -619,7 +624,7 @@ function x(x) {
|
|
|
619
624
|
memberships: n.memberships.filter((n, r) => r !== t[e].index)
|
|
620
625
|
})),
|
|
621
626
|
onAdd: (t) => {
|
|
622
|
-
|
|
627
|
+
wt((e) => new Map(e).set(t.id, t)), W.edit((n) => ({
|
|
623
628
|
...n,
|
|
624
629
|
memberships: [...n.memberships, {
|
|
625
630
|
group_id: t.id,
|
|
@@ -647,32 +652,32 @@ function x(x) {
|
|
|
647
652
|
disabled: J.pending || P,
|
|
648
653
|
onChange: (e) => {
|
|
649
654
|
let t = e.target.files?.[0];
|
|
650
|
-
e.target.value = "", t && J.run(() =>
|
|
655
|
+
e.target.value = "", t && J.run(() => Jt(t));
|
|
651
656
|
}
|
|
652
657
|
})]
|
|
653
658
|
}),
|
|
654
|
-
/* @__PURE__ */ g(
|
|
659
|
+
/* @__PURE__ */ g(u, { error: J.error })
|
|
655
660
|
]
|
|
656
661
|
}),
|
|
657
662
|
/* @__PURE__ */ _(b, {
|
|
658
|
-
title: C("contentEditor.accessTitle"),
|
|
663
|
+
title: C(Ie(T, x.kind) ? "contentEditor.accessTitle" : "contentEditor.accessOnlyTitle"),
|
|
659
664
|
children: [
|
|
660
665
|
/* @__PURE__ */ g(Pe, {
|
|
661
666
|
value: U.value.access,
|
|
662
|
-
onChange: (e) =>
|
|
667
|
+
onChange: (e) => tn({ access: e }),
|
|
663
668
|
model: T,
|
|
664
669
|
kind: x.kind,
|
|
665
670
|
owner: A?.owner_group_id ?? x.ownerGroup,
|
|
666
671
|
labels: x.labels,
|
|
667
672
|
client: S
|
|
668
673
|
}),
|
|
669
|
-
A && (U.value.access.level === "ppv" || U.value.access.level === "group_ppv" || A.offer) && /* @__PURE__ */ g(Ee, {
|
|
674
|
+
A && Ie(T, x.kind) && (U.value.access.level === "ppv" || U.value.access.level === "group_ppv" || A.offer) && /* @__PURE__ */ g(Ee, {
|
|
670
675
|
offer: A.offer,
|
|
671
676
|
pending: Y.pending,
|
|
672
677
|
onSell: (e) => Y.run(() => S.offers.sell({ content: A.id }, e)),
|
|
673
678
|
onWithdraw: () => void Y.run(() => S.offers.withdraw({ content: A.id }))
|
|
674
679
|
}),
|
|
675
|
-
/* @__PURE__ */ g(
|
|
680
|
+
/* @__PURE__ */ g(u, { error: Y.error })
|
|
676
681
|
]
|
|
677
682
|
}),
|
|
678
683
|
/* @__PURE__ */ _(b, {
|
|
@@ -686,48 +691,47 @@ function x(x) {
|
|
|
686
691
|
}), /* @__PURE__ */ g(ce, {
|
|
687
692
|
id: `${w}-publish`,
|
|
688
693
|
type: "datetime-local",
|
|
689
|
-
value:
|
|
690
|
-
onChange: (e) =>
|
|
694
|
+
value: dt,
|
|
695
|
+
onChange: (e) => ft(e.target.value)
|
|
691
696
|
})]
|
|
692
697
|
}),
|
|
693
698
|
/* @__PURE__ */ g(l, {
|
|
694
699
|
htmlFor: `${w}-listing`,
|
|
695
700
|
children: C("contentEditor.listing")
|
|
696
701
|
}),
|
|
697
|
-
/* @__PURE__ */ _(
|
|
702
|
+
/* @__PURE__ */ _(le, {
|
|
698
703
|
value: U.value.listing,
|
|
699
|
-
onValueChange: (e) => e &&
|
|
700
|
-
children: [/* @__PURE__ */ g(
|
|
704
|
+
onValueChange: (e) => e && tn({ listing: e }),
|
|
705
|
+
children: [/* @__PURE__ */ g(fe, {
|
|
701
706
|
id: `${w}-listing`,
|
|
702
|
-
children: /* @__PURE__ */ g(
|
|
703
|
-
}), /* @__PURE__ */ g(
|
|
707
|
+
children: /* @__PURE__ */ g(pe, { children: C(`contentEditor.listing_${U.value.listing}`) })
|
|
708
|
+
}), /* @__PURE__ */ g(ue, { children: [
|
|
704
709
|
"listed",
|
|
705
710
|
"members",
|
|
706
711
|
"unlisted"
|
|
707
|
-
].map((e) => /* @__PURE__ */ g(
|
|
712
|
+
].map((e) => /* @__PURE__ */ g(de, {
|
|
708
713
|
value: e,
|
|
709
714
|
children: C(`contentEditor.listing_${e}`)
|
|
710
715
|
}, e)) })]
|
|
711
716
|
}),
|
|
712
|
-
/* @__PURE__ */ g(l, {
|
|
717
|
+
E.comment_modes?.length !== 1 && /* @__PURE__ */ _(We, { children: [/* @__PURE__ */ g(l, {
|
|
713
718
|
htmlFor: `${w}-comments`,
|
|
714
719
|
children: C("contentEditor.comments")
|
|
715
|
-
}),
|
|
716
|
-
/* @__PURE__ */ _(u, {
|
|
720
|
+
}), /* @__PURE__ */ _(le, {
|
|
717
721
|
value: U.value.comments,
|
|
718
|
-
onValueChange: (e) => e &&
|
|
719
|
-
children: [/* @__PURE__ */ g(
|
|
722
|
+
onValueChange: (e) => e && tn({ comments: e }),
|
|
723
|
+
children: [/* @__PURE__ */ g(fe, {
|
|
720
724
|
id: `${w}-comments`,
|
|
721
|
-
children: /* @__PURE__ */ g(
|
|
722
|
-
}), /* @__PURE__ */ g(
|
|
725
|
+
children: /* @__PURE__ */ g(pe, { children: C(`contentEditor.comments_${U.value.comments}`) })
|
|
726
|
+
}), /* @__PURE__ */ g(ue, { children: [
|
|
723
727
|
"open",
|
|
724
728
|
"closed",
|
|
725
729
|
"hidden"
|
|
726
|
-
].map((e) => /* @__PURE__ */ g(
|
|
730
|
+
].filter((e) => !E.comment_modes?.length || E.comment_modes.includes(e)).map((e) => /* @__PURE__ */ g(de, {
|
|
727
731
|
value: e,
|
|
728
732
|
children: C(`contentEditor.comments_${e}`)
|
|
729
733
|
}, e)) })]
|
|
730
|
-
}),
|
|
734
|
+
})] }),
|
|
731
735
|
A?.state === "published" && /* @__PURE__ */ g(o, {
|
|
732
736
|
variant: "outline",
|
|
733
737
|
disabled: X.pending,
|
|
@@ -737,27 +741,27 @@ function x(x) {
|
|
|
737
741
|
A && /* @__PURE__ */ g(o, {
|
|
738
742
|
variant: "destructive",
|
|
739
743
|
disabled: X.pending,
|
|
740
|
-
onClick: () => void
|
|
744
|
+
onClick: () => void Qt(),
|
|
741
745
|
children: C("contentManager.delete")
|
|
742
746
|
}),
|
|
743
|
-
/* @__PURE__ */ g(
|
|
747
|
+
/* @__PURE__ */ g(u, { error: X.error })
|
|
744
748
|
]
|
|
745
749
|
})
|
|
746
750
|
]
|
|
747
751
|
})]
|
|
748
752
|
}),
|
|
749
|
-
|
|
753
|
+
Zt,
|
|
750
754
|
/* @__PURE__ */ g(s, {
|
|
751
|
-
open: !!
|
|
752
|
-
onOpenChange: (e) => !e && $.status !== "saving" &&
|
|
755
|
+
open: !!bt,
|
|
756
|
+
onOpenChange: (e) => !e && $.status !== "saving" && xt(null),
|
|
753
757
|
source: "source" in $ ? $.source ?? null : null,
|
|
754
|
-
aspect:
|
|
758
|
+
aspect: bt?.aspect ?? "",
|
|
755
759
|
rotatable: !1,
|
|
756
760
|
initialEdit: "edit" in $ ? $.edit : null,
|
|
757
761
|
title: C("readerEditor.thumbnail"),
|
|
758
762
|
confirmLabel: C("readerEditor.setThumbnail"),
|
|
759
763
|
busy: $.status === "saving",
|
|
760
|
-
error: $.status === "error" ?
|
|
764
|
+
error: $.status === "error" ? he(Ye, $.error) : void 0,
|
|
761
765
|
onConfirm: (e) => void $.save(e)
|
|
762
766
|
})
|
|
763
767
|
]
|