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