@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
|
@@ -20,56 +20,58 @@ import { useDraft as O } from "../../react/use-draft.js";
|
|
|
20
20
|
import { readerMediaReady as ee, useEditorSaveTask as k } from "./editor-save.js";
|
|
21
21
|
import { OfferFields as A } from "./offer-fields.js";
|
|
22
22
|
import { AttributeFields as j, formOf as M } from "../groups/fields.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
23
|
+
import { useReaderPlan as N } from "../../react/versions.js";
|
|
24
|
+
import { PagePicker as P, usePlanMedia as te } from "../admin/page-picker.js";
|
|
25
|
+
import { ReaderManifestEditor as ne } from "../admin/reader-manifest.js";
|
|
26
|
+
import { PageNotices as F } from "../admin/page-notices.js";
|
|
27
|
+
import { VideoMediaEditor as I, videoPaths as L } from "../admin/media-item-panel.js";
|
|
28
|
+
import { MembershipEditor as R } from "../groups/memberships.js";
|
|
29
|
+
import { useCallback as re, useEffect as z, useId as ie, useMemo as B, useRef as V, useState as H } from "react";
|
|
30
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
31
|
+
import { cn as ae } from "cn";
|
|
30
32
|
//#region src/components/content/editors.tsx
|
|
31
|
-
var
|
|
33
|
+
var K = "__none__", oe = [
|
|
32
34
|
"listed",
|
|
33
35
|
"members",
|
|
34
36
|
"unlisted"
|
|
35
|
-
],
|
|
37
|
+
], se = [
|
|
36
38
|
"open",
|
|
37
39
|
"closed",
|
|
38
40
|
"hidden"
|
|
39
|
-
],
|
|
41
|
+
], ce = [
|
|
40
42
|
"public",
|
|
41
43
|
"tier",
|
|
42
44
|
"ppv",
|
|
43
45
|
"group",
|
|
44
46
|
"group_ppv"
|
|
45
|
-
],
|
|
46
|
-
function
|
|
47
|
-
return /* @__PURE__ */
|
|
47
|
+
], q = (e) => e === "group" || e === "group_ppv";
|
|
48
|
+
function J({ title: e, ckui: t, children: n }) {
|
|
49
|
+
return /* @__PURE__ */ G("section", {
|
|
48
50
|
className: "grid gap-3 border-t border-border pt-4",
|
|
49
51
|
"data-ckui": t,
|
|
50
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ W("h3", {
|
|
51
53
|
className: "font-medium",
|
|
52
54
|
children: e
|
|
53
55
|
}), n]
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
|
-
function
|
|
58
|
+
function Y({ show: e }) {
|
|
57
59
|
let { t: n } = t();
|
|
58
|
-
return e ? /* @__PURE__ */
|
|
60
|
+
return e ? /* @__PURE__ */ W("span", {
|
|
59
61
|
role: "status",
|
|
60
62
|
className: "text-muted-foreground",
|
|
61
63
|
children: n("contentEditor.saved")
|
|
62
64
|
}) : null;
|
|
63
65
|
}
|
|
64
|
-
function
|
|
66
|
+
function X(e, t) {
|
|
65
67
|
let { kinds: n } = i({ client: t });
|
|
66
68
|
return {
|
|
67
69
|
model: n,
|
|
68
70
|
spec: n?.kinds[e]
|
|
69
71
|
};
|
|
70
72
|
}
|
|
71
|
-
function
|
|
72
|
-
let [r, i] =
|
|
73
|
+
function le(e, t, n) {
|
|
74
|
+
let [r, i] = H({
|
|
73
75
|
id: e,
|
|
74
76
|
client: t,
|
|
75
77
|
scope: n,
|
|
@@ -86,31 +88,31 @@ function ce(e, t, n) {
|
|
|
86
88
|
}
|
|
87
89
|
return r.key;
|
|
88
90
|
}
|
|
89
|
-
function
|
|
90
|
-
let { client: n, store: i, scope: a, language: o } = r(t), s =
|
|
91
|
-
return
|
|
91
|
+
function ue(e, t) {
|
|
92
|
+
let { client: n, store: i, scope: a, language: o } = r(t), s = V(!0);
|
|
93
|
+
return z(() => (s.current = !0, () => {
|
|
92
94
|
s.current = !1;
|
|
93
95
|
}), []), async () => {
|
|
94
96
|
let t = await n.contents.get(e.id, o ?? e.language);
|
|
95
97
|
return s.current && i.patch((t) => t.type === "content" && t.id === e.id && (t.readScope ?? "{}") === a, (e) => (e && e.revision > t.revision && (t = e), t)), t;
|
|
96
98
|
};
|
|
97
99
|
}
|
|
98
|
-
function
|
|
99
|
-
let { client: t, scope: n } = r(e.client), i =
|
|
100
|
-
return /* @__PURE__ */
|
|
100
|
+
function de(e) {
|
|
101
|
+
let { client: t, scope: n } = r(e.client), i = le(e.content.id, t, n);
|
|
102
|
+
return /* @__PURE__ */ W(fe, {
|
|
101
103
|
...e,
|
|
102
104
|
client: t
|
|
103
105
|
}, i);
|
|
104
106
|
}
|
|
105
|
-
function
|
|
106
|
-
let { t: i } = t(), a = n(r.client), { spec: o } =
|
|
107
|
+
function fe({ content: e, ...r }) {
|
|
108
|
+
let { t: i } = t(), a = n(r.client), { spec: o } = X(e.kind, r.client), c = B(() => o?.attributes ?? {}, [o]), l = O(B(() => ({
|
|
107
109
|
listing: e.listing,
|
|
108
110
|
comments: e.comments
|
|
109
|
-
}), [e.listing, e.comments])), u = O(
|
|
110
|
-
return /* @__PURE__ */
|
|
111
|
+
}), [e.listing, e.comments])), u = O(B(() => M(c, e.attributes), [c, e.attributes])), { listing: d, comments: v } = l.value, x = ue(e, r.client), [S, w] = H(null), [T, E] = H(!1), D = b("content.save", r.onError);
|
|
112
|
+
return /* @__PURE__ */ W(J, {
|
|
111
113
|
title: i("contentEditor.details"),
|
|
112
114
|
ckui: "content-details",
|
|
113
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ G("form", {
|
|
114
116
|
className: "grid gap-3",
|
|
115
117
|
onSubmit: (t) => {
|
|
116
118
|
t.preventDefault(), w(null), E(!1);
|
|
@@ -136,9 +138,9 @@ function de({ content: e, ...r }) {
|
|
|
136
138
|
});
|
|
137
139
|
},
|
|
138
140
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ G("div", {
|
|
140
142
|
className: "grid gap-1.5 sm:max-w-xs",
|
|
141
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ W(f, { children: i("contentEditor.listing") }), /* @__PURE__ */ G(p, {
|
|
142
144
|
value: d,
|
|
143
145
|
onValueChange: (e) => {
|
|
144
146
|
l.edit((t) => ({
|
|
@@ -146,19 +148,19 @@ function de({ content: e, ...r }) {
|
|
|
146
148
|
listing: e
|
|
147
149
|
})), E(!1);
|
|
148
150
|
},
|
|
149
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ W(g, {
|
|
150
152
|
size: "sm",
|
|
151
153
|
"aria-label": i("contentEditor.listing"),
|
|
152
|
-
children: /* @__PURE__ */
|
|
153
|
-
}), /* @__PURE__ */
|
|
154
|
+
children: /* @__PURE__ */ W(_, { children: (e) => i(`contentEditor.listing_${e}`) })
|
|
155
|
+
}), /* @__PURE__ */ W(m, { children: oe.map((e) => /* @__PURE__ */ W(h, {
|
|
154
156
|
value: e,
|
|
155
157
|
children: i(`contentEditor.listing_${e}`)
|
|
156
158
|
}, e)) })]
|
|
157
159
|
})]
|
|
158
160
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ G("div", {
|
|
160
162
|
className: "grid gap-1.5 sm:max-w-xs",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ W(f, { children: i("contentEditor.comments") }), /* @__PURE__ */ G(p, {
|
|
162
164
|
value: v,
|
|
163
165
|
onValueChange: (e) => {
|
|
164
166
|
l.edit((t) => ({
|
|
@@ -166,17 +168,17 @@ function de({ content: e, ...r }) {
|
|
|
166
168
|
comments: e
|
|
167
169
|
})), E(!1);
|
|
168
170
|
},
|
|
169
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ W(g, {
|
|
170
172
|
size: "sm",
|
|
171
173
|
"aria-label": i("contentEditor.comments"),
|
|
172
|
-
children: /* @__PURE__ */
|
|
173
|
-
}), /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ W(_, { children: (e) => i(`contentEditor.comments_${e}`) })
|
|
175
|
+
}), /* @__PURE__ */ W(m, { children: se.map((e) => /* @__PURE__ */ W(h, {
|
|
174
176
|
value: e,
|
|
175
177
|
children: i(`contentEditor.comments_${e}`)
|
|
176
178
|
}, e)) })]
|
|
177
179
|
})]
|
|
178
180
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ W(j, {
|
|
180
182
|
declared: c,
|
|
181
183
|
form: u.value,
|
|
182
184
|
onChange: (e, t) => {
|
|
@@ -187,18 +189,18 @@ function de({ content: e, ...r }) {
|
|
|
187
189
|
},
|
|
188
190
|
labels: r.labels
|
|
189
191
|
}),
|
|
190
|
-
S && /* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
192
|
+
S && /* @__PURE__ */ W(y, { children: S }),
|
|
193
|
+
/* @__PURE__ */ W(y, { error: D.error }),
|
|
194
|
+
/* @__PURE__ */ G("div", {
|
|
193
195
|
className: "flex items-center gap-3",
|
|
194
196
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ W(s, {
|
|
196
198
|
type: "submit",
|
|
197
199
|
size: "sm",
|
|
198
200
|
disabled: D.pending,
|
|
199
201
|
children: D.pending ? i("common.saving") : i("common.save")
|
|
200
202
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ W(s, {
|
|
202
204
|
type: "button",
|
|
203
205
|
variant: "ghost",
|
|
204
206
|
size: "sm",
|
|
@@ -214,80 +216,80 @@ function de({ content: e, ...r }) {
|
|
|
214
216
|
},
|
|
215
217
|
children: i("common.cancel")
|
|
216
218
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ W(Y, { show: T })
|
|
218
220
|
]
|
|
219
221
|
})
|
|
220
222
|
]
|
|
221
223
|
})
|
|
222
224
|
});
|
|
223
225
|
}
|
|
224
|
-
function
|
|
225
|
-
let { t: c } = t(), l = ie(), u = r?.tiers ?? [], v = r?.kinds[i], y = Object.entries(r?.entity_kinds ?? {}).filter(([, e]) => e.sellable || e.auth_scope).map(([e]) => e), [b, C] =
|
|
226
|
+
function pe({ value: e, onChange: n, model: r, kind: i, owner: a, labels: o, client: s }) {
|
|
227
|
+
let { t: c } = t(), l = ie(), u = r?.tiers ?? [], v = r?.kinds[i], y = Object.entries(r?.entity_kinds ?? {}).filter(([, e]) => e.sellable || e.auth_scope).map(([e]) => e), [b, C] = H(), O = b ?? y[0] ?? "", ee = D(e.group_id ? [e.group_id] : [], { client: s }), k = e.group_id ? ee.get(e.group_id) : void 0, A = (t) => n({
|
|
226
228
|
...e,
|
|
227
229
|
...t
|
|
228
230
|
}), j = v?.presentation === "reader", M = !!v?.segments;
|
|
229
|
-
return /* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ G("div", {
|
|
230
232
|
className: "grid gap-3",
|
|
231
233
|
"data-ckui": "rule-fields",
|
|
232
234
|
children: [
|
|
233
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ G("div", {
|
|
234
236
|
className: "grid gap-1.5 sm:max-w-xs",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ W(f, { children: c("contentEditor.access") }), /* @__PURE__ */ G(p, {
|
|
236
238
|
value: e.level,
|
|
237
239
|
onValueChange: (t) => {
|
|
238
240
|
let r = t;
|
|
239
241
|
n({
|
|
240
242
|
level: r,
|
|
241
|
-
group_id:
|
|
243
|
+
group_id: q(r) ? e.group_id || a : void 0,
|
|
242
244
|
preview: e.preview,
|
|
243
245
|
free_after: e.free_after
|
|
244
246
|
});
|
|
245
247
|
},
|
|
246
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ W(g, {
|
|
247
249
|
size: "sm",
|
|
248
250
|
"aria-label": c("contentEditor.access"),
|
|
249
|
-
children: /* @__PURE__ */
|
|
250
|
-
}), /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ W(_, { children: (e) => c(`contentEditor.level_${e}`) })
|
|
252
|
+
}), /* @__PURE__ */ W(m, { children: ce.filter((e) => (e !== "tier" || u.length) && (!e.startsWith("group") || y.length)).map((e) => /* @__PURE__ */ W(h, {
|
|
251
253
|
value: e,
|
|
252
254
|
children: c(`contentEditor.level_${e}`)
|
|
253
255
|
}, e)) })]
|
|
254
256
|
})]
|
|
255
257
|
}),
|
|
256
|
-
e.level === "tier" && /* @__PURE__ */
|
|
258
|
+
e.level === "tier" && /* @__PURE__ */ G("fieldset", {
|
|
257
259
|
className: "flex flex-wrap gap-3",
|
|
258
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ W("legend", {
|
|
259
261
|
className: "sr-only",
|
|
260
262
|
children: c("contentEditor.tiers")
|
|
261
|
-
}), u.map((t) => /* @__PURE__ */
|
|
263
|
+
}), u.map((t) => /* @__PURE__ */ G("label", {
|
|
262
264
|
className: "flex items-center gap-2",
|
|
263
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ W(x, {
|
|
264
266
|
checked: e.tiers?.includes(t) ?? !1,
|
|
265
267
|
onCheckedChange: (n) => A({ tiers: n ? [...e.tiers ?? [], t] : (e.tiers ?? []).filter((e) => e !== t) }),
|
|
266
268
|
"aria-label": E(o, t)
|
|
267
269
|
}), E(o, t)]
|
|
268
270
|
}, t))]
|
|
269
271
|
}),
|
|
270
|
-
|
|
272
|
+
q(e.level) && /* @__PURE__ */ G("div", {
|
|
271
273
|
className: "flex flex-wrap items-end gap-2",
|
|
272
274
|
children: [
|
|
273
|
-
k || e.group_id ? /* @__PURE__ */
|
|
275
|
+
k || e.group_id ? /* @__PURE__ */ W("span", {
|
|
274
276
|
className: "rounded-md border border-border px-2 py-0.5",
|
|
275
277
|
"data-ckui": "rule-group",
|
|
276
278
|
children: k ? k.name || k.slug : e.group_id
|
|
277
279
|
}) : null,
|
|
278
|
-
y.length > 1 && /* @__PURE__ */
|
|
280
|
+
y.length > 1 && /* @__PURE__ */ G(p, {
|
|
279
281
|
value: O,
|
|
280
282
|
onValueChange: (e) => C(String(e)),
|
|
281
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ W(g, {
|
|
282
284
|
size: "sm",
|
|
283
285
|
"aria-label": c("groupEditor.edgeKind"),
|
|
284
|
-
children: /* @__PURE__ */
|
|
285
|
-
}), /* @__PURE__ */
|
|
286
|
+
children: /* @__PURE__ */ W(_, { children: (e) => E(o, e) })
|
|
287
|
+
}), /* @__PURE__ */ W(m, { children: y.map((e) => /* @__PURE__ */ W(h, {
|
|
286
288
|
value: e,
|
|
287
289
|
children: E(o, e)
|
|
288
290
|
}, e)) })]
|
|
289
291
|
}),
|
|
290
|
-
O && /* @__PURE__ */
|
|
292
|
+
O && /* @__PURE__ */ W(T, {
|
|
291
293
|
kind: O,
|
|
292
294
|
label: c("contentEditor.group"),
|
|
293
295
|
client: s,
|
|
@@ -295,15 +297,15 @@ function Y({ value: e, onChange: n, model: r, kind: i, owner: a, labels: o, clie
|
|
|
295
297
|
}, O)
|
|
296
298
|
]
|
|
297
299
|
}),
|
|
298
|
-
e.level !== "public" && /* @__PURE__ */
|
|
300
|
+
e.level !== "public" && /* @__PURE__ */ G("div", {
|
|
299
301
|
className: "grid gap-3 sm:grid-cols-3",
|
|
300
302
|
children: [
|
|
301
|
-
j && /* @__PURE__ */
|
|
303
|
+
j && /* @__PURE__ */ G("div", {
|
|
302
304
|
className: "grid gap-1.5",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
305
|
+
children: [/* @__PURE__ */ W(f, {
|
|
304
306
|
htmlFor: `${l}-pages`,
|
|
305
307
|
children: c("contentEditor.previewPages")
|
|
306
|
-
}), /* @__PURE__ */
|
|
308
|
+
}), /* @__PURE__ */ W(d, {
|
|
307
309
|
id: `${l}-pages`,
|
|
308
310
|
className: "h-8",
|
|
309
311
|
type: "number",
|
|
@@ -315,12 +317,12 @@ function Y({ value: e, onChange: n, model: r, kind: i, owner: a, labels: o, clie
|
|
|
315
317
|
} })
|
|
316
318
|
})]
|
|
317
319
|
}),
|
|
318
|
-
M && /* @__PURE__ */
|
|
320
|
+
M && /* @__PURE__ */ G("div", {
|
|
319
321
|
className: "grid gap-1.5",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ W(f, {
|
|
321
323
|
htmlFor: `${l}-segments`,
|
|
322
324
|
children: c("contentEditor.previewSegments")
|
|
323
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ W(d, {
|
|
324
326
|
id: `${l}-segments`,
|
|
325
327
|
className: "h-8",
|
|
326
328
|
type: "number",
|
|
@@ -332,12 +334,12 @@ function Y({ value: e, onChange: n, model: r, kind: i, owner: a, labels: o, clie
|
|
|
332
334
|
} })
|
|
333
335
|
})]
|
|
334
336
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ G("div", {
|
|
336
338
|
className: "grid gap-1.5",
|
|
337
|
-
children: [/* @__PURE__ */
|
|
339
|
+
children: [/* @__PURE__ */ W(f, {
|
|
338
340
|
htmlFor: `${l}-free`,
|
|
339
341
|
children: c("contentEditor.freeAfter")
|
|
340
|
-
}), /* @__PURE__ */
|
|
342
|
+
}), /* @__PURE__ */ W(d, {
|
|
341
343
|
id: `${l}-free`,
|
|
342
344
|
className: "h-8",
|
|
343
345
|
type: "datetime-local",
|
|
@@ -350,8 +352,8 @@ function Y({ value: e, onChange: n, model: r, kind: i, owner: a, labels: o, clie
|
|
|
350
352
|
]
|
|
351
353
|
});
|
|
352
354
|
}
|
|
353
|
-
var
|
|
354
|
-
function
|
|
355
|
+
var Z = (e) => !q(e.level) || !!e.group_id;
|
|
356
|
+
function me(e) {
|
|
355
357
|
let t = e.preview && (e.preview.pages || e.preview.segments) ? {
|
|
356
358
|
pages: e.preview.pages || void 0,
|
|
357
359
|
segments: e.preview.segments || void 0
|
|
@@ -364,31 +366,31 @@ function Z(e) {
|
|
|
364
366
|
free_after: e.level === "public" ? void 0 : e.free_after
|
|
365
367
|
};
|
|
366
368
|
}
|
|
367
|
-
function
|
|
368
|
-
let { client: t, scope: n } = r(e.client), i =
|
|
369
|
-
return /* @__PURE__ */
|
|
369
|
+
function he(e) {
|
|
370
|
+
let { client: t, scope: n } = r(e.client), i = le(e.content.id, t, n);
|
|
371
|
+
return /* @__PURE__ */ W(ge, {
|
|
370
372
|
...e,
|
|
371
373
|
client: t
|
|
372
374
|
}, i);
|
|
373
375
|
}
|
|
374
|
-
function
|
|
375
|
-
let { t: i } = t(), a = n(r.client), { model: o } =
|
|
376
|
-
return /* @__PURE__ */
|
|
376
|
+
function ge({ content: e, ...r }) {
|
|
377
|
+
let { t: i } = t(), a = n(r.client), { model: o } = X(e.kind, r.client), c = O(e.access), l = ue(e, r.client), [u, d] = H(!1), f = b("content.save", r.onError), p = b("offer.save", r.onError);
|
|
378
|
+
return /* @__PURE__ */ G(J, {
|
|
377
379
|
title: i("contentEditor.accessTitle"),
|
|
378
380
|
ckui: "access-editor",
|
|
379
381
|
children: [
|
|
380
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ G("form", {
|
|
381
383
|
className: "grid gap-3",
|
|
382
384
|
onSubmit: (t) => {
|
|
383
385
|
t.preventDefault(), d(!1);
|
|
384
386
|
let n = c.checkpoint();
|
|
385
387
|
f.run(() => a.contents.update(e.id, {
|
|
386
|
-
access:
|
|
388
|
+
access: me(c.value),
|
|
387
389
|
revision: e.revision
|
|
388
390
|
})).then((e) => e && d(n(e.access)));
|
|
389
391
|
},
|
|
390
392
|
children: [
|
|
391
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ W(pe, {
|
|
392
394
|
value: c.value,
|
|
393
395
|
onChange: (e) => {
|
|
394
396
|
c.edit(e), d(!1);
|
|
@@ -399,17 +401,17 @@ function pe({ content: e, ...r }) {
|
|
|
399
401
|
labels: r.labels,
|
|
400
402
|
client: a
|
|
401
403
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ W(y, { error: f.error }),
|
|
405
|
+
/* @__PURE__ */ G("div", {
|
|
404
406
|
className: "flex items-center gap-3",
|
|
405
407
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ W(s, {
|
|
407
409
|
type: "submit",
|
|
408
410
|
size: "sm",
|
|
409
|
-
disabled: f.pending || !
|
|
411
|
+
disabled: f.pending || !Z(c.value),
|
|
410
412
|
children: f.pending ? i("common.saving") : i("common.save")
|
|
411
413
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ W(s, {
|
|
413
415
|
type: "button",
|
|
414
416
|
variant: "ghost",
|
|
415
417
|
size: "sm",
|
|
@@ -422,29 +424,29 @@ function pe({ content: e, ...r }) {
|
|
|
422
424
|
},
|
|
423
425
|
children: i("common.cancel")
|
|
424
426
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ W(Y, { show: u })
|
|
426
428
|
]
|
|
427
429
|
})
|
|
428
430
|
]
|
|
429
431
|
}),
|
|
430
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ W(A, {
|
|
431
433
|
offer: e.offer,
|
|
432
434
|
pending: p.pending,
|
|
433
435
|
onSell: (t) => p.run(() => a.offers.sell({ content: e.id }, t)),
|
|
434
436
|
onWithdraw: () => void p.run(() => a.offers.withdraw({ content: e.id }))
|
|
435
437
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ W(y, { error: p.error })
|
|
437
439
|
]
|
|
438
440
|
});
|
|
439
441
|
}
|
|
440
442
|
function Q(e, t, n) {
|
|
441
443
|
return e.label || [...e.languages.map(t), ...e.traits.map((e) => E(n, e))].join(" · ");
|
|
442
444
|
}
|
|
443
|
-
function
|
|
444
|
-
let { t: l } = t(), d = n(o.client), f = e(), { model: p, spec: m } =
|
|
445
|
+
function _e({ content: r, media: i = !0, activeVersion: a, ...o }) {
|
|
446
|
+
let { t: l } = t(), d = n(o.client), f = e(), { model: p, spec: m } = X(r.kind, o.client), h = b("content.save", o.onError), g = b("content.save", o.onError), [_, v] = H(null), [x, S] = H([]), C = (e) => {
|
|
445
447
|
v(e), S((t) => t.includes(e) ? t : [...t, e]);
|
|
446
448
|
};
|
|
447
|
-
|
|
449
|
+
z(() => {
|
|
448
450
|
a && (v(a), S((e) => e.includes(a) ? e : [...e, a]));
|
|
449
451
|
}, [a]), k(`versions:${r.id}`, {
|
|
450
452
|
label: l("contentEditor.versions"),
|
|
@@ -453,18 +455,18 @@ function me({ content: r, media: i = !0, activeVersion: a, ...o }) {
|
|
|
453
455
|
valid: !0,
|
|
454
456
|
save: async () => !0
|
|
455
457
|
});
|
|
456
|
-
let w =
|
|
458
|
+
let w = B(() => [...r.versions].sort((e, t) => e.position - t.position), [r.versions]);
|
|
457
459
|
if (!m) return null;
|
|
458
460
|
if (m.versions.hidden) {
|
|
459
461
|
let e = w[0];
|
|
460
|
-
return !e || !i && !m.segments ? null : /* @__PURE__ */
|
|
462
|
+
return !e || !i && !m.segments ? null : /* @__PURE__ */ G(J, {
|
|
461
463
|
title: l("contentEditor.media"),
|
|
462
464
|
ckui: "version-media",
|
|
463
|
-
children: [m.segments && /* @__PURE__ */
|
|
465
|
+
children: [m.segments && /* @__PURE__ */ W($, {
|
|
464
466
|
content: r,
|
|
465
467
|
version: e,
|
|
466
468
|
...o
|
|
467
|
-
}), i && /* @__PURE__ */
|
|
469
|
+
}), i && /* @__PURE__ */ W(Se, {
|
|
468
470
|
content: r,
|
|
469
471
|
version: e,
|
|
470
472
|
model: p,
|
|
@@ -473,11 +475,11 @@ function me({ content: r, media: i = !0, activeVersion: a, ...o }) {
|
|
|
473
475
|
});
|
|
474
476
|
}
|
|
475
477
|
let T = p?.languages ?? [];
|
|
476
|
-
return /* @__PURE__ */
|
|
478
|
+
return /* @__PURE__ */ G(J, {
|
|
477
479
|
title: l("contentEditor.versions"),
|
|
478
480
|
ckui: "versions-editor",
|
|
479
481
|
children: [
|
|
480
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ W(c, {
|
|
481
483
|
items: w,
|
|
482
484
|
id: (e) => e.id,
|
|
483
485
|
name: (e) => Q(e, f, o.labels),
|
|
@@ -487,31 +489,31 @@ function me({ content: r, media: i = !0, activeVersion: a, ...o }) {
|
|
|
487
489
|
let n = w.map((e) => e.id), [i] = n.splice(e, 1);
|
|
488
490
|
n.splice(t, 0, i), h.run(() => d.contents.orderVersions(r.id, n));
|
|
489
491
|
},
|
|
490
|
-
children: (e, t) => /* @__PURE__ */
|
|
492
|
+
children: (e, t) => /* @__PURE__ */ G("div", {
|
|
491
493
|
className: "grid gap-2 rounded-md border border-border p-2",
|
|
492
494
|
"data-ckui": "version-row",
|
|
493
495
|
"data-version": e.id,
|
|
494
|
-
children: [/* @__PURE__ */
|
|
496
|
+
children: [/* @__PURE__ */ G("div", {
|
|
495
497
|
className: "flex flex-wrap items-center gap-2",
|
|
496
498
|
children: [
|
|
497
499
|
w.length > 1 && t,
|
|
498
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ W("span", {
|
|
499
501
|
className: "min-w-0 flex-1 font-medium break-words",
|
|
500
502
|
children: Q(e, f, o.labels)
|
|
501
503
|
}),
|
|
502
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ W(u, {
|
|
503
505
|
variant: e.live ? "default" : "outline",
|
|
504
506
|
children: l(e.live ? "contentEditor.live" : e.state === "draft" ? "contentManager.draft" : "contentManager.scheduled")
|
|
505
507
|
}),
|
|
506
|
-
e.access && /* @__PURE__ */
|
|
508
|
+
e.access && /* @__PURE__ */ W(u, {
|
|
507
509
|
variant: "secondary",
|
|
508
510
|
children: l(`contentEditor.level_${e.access.level}`)
|
|
509
511
|
}),
|
|
510
|
-
e.pages ? /* @__PURE__ */
|
|
512
|
+
e.pages ? /* @__PURE__ */ W("span", {
|
|
511
513
|
className: "text-xs text-muted-foreground",
|
|
512
514
|
children: l("contentEditor.pageCount", { count: e.pages })
|
|
513
515
|
}) : null,
|
|
514
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ W(s, {
|
|
515
517
|
type: "button",
|
|
516
518
|
size: "xs",
|
|
517
519
|
variant: "ghost",
|
|
@@ -520,9 +522,9 @@ function me({ content: r, media: i = !0, activeVersion: a, ...o }) {
|
|
|
520
522
|
children: l(_ === e.id ? "contentEditor.close" : "contentEditor.edit")
|
|
521
523
|
})
|
|
522
524
|
]
|
|
523
|
-
}), x.includes(e.id) && /* @__PURE__ */
|
|
525
|
+
}), x.includes(e.id) && /* @__PURE__ */ W("div", {
|
|
524
526
|
hidden: _ !== e.id,
|
|
525
|
-
children: /* @__PURE__ */
|
|
527
|
+
children: /* @__PURE__ */ W(be, {
|
|
526
528
|
content: r,
|
|
527
529
|
version: e,
|
|
528
530
|
model: p,
|
|
@@ -532,57 +534,57 @@ function me({ content: r, media: i = !0, activeVersion: a, ...o }) {
|
|
|
532
534
|
})]
|
|
533
535
|
})
|
|
534
536
|
}),
|
|
535
|
-
/* @__PURE__ */
|
|
536
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ W(y, { error: h.error }),
|
|
538
|
+
/* @__PURE__ */ W(ye, {
|
|
537
539
|
languages: T,
|
|
538
540
|
many: m?.versions.languages === "many",
|
|
539
541
|
pending: g.pending,
|
|
540
542
|
onAdd: (e) => void g.run(() => d.contents.addVersion(r.id, e)).then((e) => e && C(e.id))
|
|
541
543
|
}),
|
|
542
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ W(y, { error: g.error })
|
|
543
545
|
]
|
|
544
546
|
});
|
|
545
547
|
}
|
|
546
|
-
function
|
|
548
|
+
function ve({ languages: n, value: r, many: i, onChange: a }) {
|
|
547
549
|
let { t: o } = t(), s = e();
|
|
548
|
-
return i ? /* @__PURE__ */
|
|
550
|
+
return i ? /* @__PURE__ */ G("fieldset", {
|
|
549
551
|
className: "flex flex-wrap gap-3",
|
|
550
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ W("legend", {
|
|
551
553
|
className: "sr-only",
|
|
552
554
|
children: o("contentEditor.versionLanguages")
|
|
553
|
-
}), n.map((e) => /* @__PURE__ */
|
|
555
|
+
}), n.map((e) => /* @__PURE__ */ G("label", {
|
|
554
556
|
className: "flex items-center gap-1.5",
|
|
555
|
-
children: [/* @__PURE__ */
|
|
557
|
+
children: [/* @__PURE__ */ W(x, {
|
|
556
558
|
size: "sm",
|
|
557
559
|
checked: r.includes(e),
|
|
558
560
|
onCheckedChange: (t) => a(t ? [...r, e] : r.filter((t) => t !== e)),
|
|
559
561
|
"aria-label": s(e)
|
|
560
562
|
}), s(e)]
|
|
561
563
|
}, e))]
|
|
562
|
-
}) : /* @__PURE__ */
|
|
563
|
-
value: r[0] ??
|
|
564
|
-
onValueChange: (e) => a(e ===
|
|
565
|
-
children: [/* @__PURE__ */
|
|
564
|
+
}) : /* @__PURE__ */ G(p, {
|
|
565
|
+
value: r[0] ?? K,
|
|
566
|
+
onValueChange: (e) => a(e === K ? [] : [String(e)]),
|
|
567
|
+
children: [/* @__PURE__ */ W(g, {
|
|
566
568
|
size: "sm",
|
|
567
569
|
"aria-label": o("contentEditor.versionLanguage"),
|
|
568
|
-
children: /* @__PURE__ */
|
|
569
|
-
}), /* @__PURE__ */
|
|
570
|
+
children: /* @__PURE__ */ W(_, { children: (e) => e === K ? o("contentEditor.chooseLanguage") : s(e) })
|
|
571
|
+
}), /* @__PURE__ */ W(m, { children: n.map((e) => /* @__PURE__ */ W(h, {
|
|
570
572
|
value: e,
|
|
571
573
|
children: s(e)
|
|
572
574
|
}, e)) })]
|
|
573
575
|
});
|
|
574
576
|
}
|
|
575
|
-
function
|
|
576
|
-
let { t: a } = t(), [o, c] =
|
|
577
|
-
return /* @__PURE__ */
|
|
577
|
+
function ye({ languages: e, many: n, pending: r, onAdd: i }) {
|
|
578
|
+
let { t: a } = t(), [o, c] = H([]);
|
|
579
|
+
return /* @__PURE__ */ G("div", {
|
|
578
580
|
className: "flex flex-wrap items-center gap-2",
|
|
579
581
|
"data-ckui": "add-version",
|
|
580
|
-
children: [/* @__PURE__ */
|
|
582
|
+
children: [/* @__PURE__ */ W(ve, {
|
|
581
583
|
languages: e,
|
|
582
584
|
value: o,
|
|
583
585
|
many: n,
|
|
584
586
|
onChange: c
|
|
585
|
-
}), /* @__PURE__ */
|
|
587
|
+
}), /* @__PURE__ */ W(s, {
|
|
586
588
|
type: "button",
|
|
587
589
|
size: "sm",
|
|
588
590
|
variant: "outline",
|
|
@@ -594,7 +596,7 @@ function ge({ languages: e, many: n, pending: r, onAdd: i }) {
|
|
|
594
596
|
})]
|
|
595
597
|
});
|
|
596
598
|
}
|
|
597
|
-
function
|
|
599
|
+
function be({ content: e, version: r, model: i, media: a, ...o }) {
|
|
598
600
|
let { t: c } = t(), l = ie(), u = n(o.client), p = i?.kinds[e.kind], m = re((t) => ({
|
|
599
601
|
langs: t.languages,
|
|
600
602
|
traits: t.traits,
|
|
@@ -603,13 +605,13 @@ function _e({ content: e, version: r, model: i, media: a, ...o }) {
|
|
|
603
605
|
at: w(t.publish_at),
|
|
604
606
|
own: !!t.access,
|
|
605
607
|
rule: t.access ?? e.access
|
|
606
|
-
}), [e.access]), h = O(
|
|
608
|
+
}), [e.access]), h = O(B(() => m(r), [m, r])), { langs: g, traits: _, label: v, draft: C, at: T, own: D, rule: j } = h.value, M = (e) => {
|
|
607
609
|
h.edit((t) => ({
|
|
608
610
|
...t,
|
|
609
611
|
...e
|
|
610
612
|
})), F(!1);
|
|
611
|
-
}, [N, P] =
|
|
612
|
-
if (!
|
|
613
|
+
}, [N, P] = H(null), [te, F] = H(!1), I = b("content.save", o.onError), L = b("content.save", o.onError), R = b("offer.save", o.onError), z = g.length > 0 && (!D || Z(j)), V = async () => {
|
|
614
|
+
if (!z) return !1;
|
|
613
615
|
if (P(null), F(!1), p?.presentation === "reader" && r.state === "draft" && !C && !await ee(u, {
|
|
614
616
|
kind: e.kind,
|
|
615
617
|
id: e.id,
|
|
@@ -621,7 +623,7 @@ function _e({ content: e, version: r, model: i, media: a, ...o }) {
|
|
|
621
623
|
label: v.trim(),
|
|
622
624
|
state: C ? "draft" : "published",
|
|
623
625
|
publish_at: S(T),
|
|
624
|
-
...D ? { access:
|
|
626
|
+
...D ? { access: me(j) } : { clear_access: !!r.access }
|
|
625
627
|
}));
|
|
626
628
|
if (!n) return !1;
|
|
627
629
|
let i = t(m(n));
|
|
@@ -630,33 +632,33 @@ function _e({ content: e, version: r, model: i, media: a, ...o }) {
|
|
|
630
632
|
return k(`version:${r.id}`, {
|
|
631
633
|
label: c("contentEditor.versions"),
|
|
632
634
|
dirty: h.dirty.length > 0,
|
|
633
|
-
pending: I.pending ||
|
|
634
|
-
valid:
|
|
635
|
-
save:
|
|
635
|
+
pending: I.pending || L.pending,
|
|
636
|
+
valid: z,
|
|
637
|
+
save: V,
|
|
636
638
|
order: 10
|
|
637
|
-
}), /* @__PURE__ */
|
|
639
|
+
}), /* @__PURE__ */ G("div", {
|
|
638
640
|
className: "grid gap-4 pt-2",
|
|
639
641
|
children: [
|
|
640
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ G("form", {
|
|
641
643
|
className: "grid gap-3",
|
|
642
644
|
onSubmit: (e) => {
|
|
643
|
-
e.preventDefault(),
|
|
645
|
+
e.preventDefault(), V();
|
|
644
646
|
},
|
|
645
647
|
children: [
|
|
646
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ W(ve, {
|
|
647
649
|
languages: i?.languages ?? [],
|
|
648
650
|
value: g,
|
|
649
651
|
many: p?.versions.languages === "many",
|
|
650
652
|
onChange: (e) => M({ langs: e })
|
|
651
653
|
}),
|
|
652
|
-
!!p?.versions.traits?.length && /* @__PURE__ */
|
|
654
|
+
!!p?.versions.traits?.length && /* @__PURE__ */ G("fieldset", {
|
|
653
655
|
className: "flex flex-wrap gap-3",
|
|
654
|
-
children: [/* @__PURE__ */
|
|
656
|
+
children: [/* @__PURE__ */ W("legend", {
|
|
655
657
|
className: "sr-only",
|
|
656
658
|
children: c("contentEditor.traits")
|
|
657
|
-
}), p.versions.traits.map((e) => /* @__PURE__ */
|
|
659
|
+
}), p.versions.traits.map((e) => /* @__PURE__ */ G("label", {
|
|
658
660
|
className: "flex items-center gap-1.5",
|
|
659
|
-
children: [/* @__PURE__ */
|
|
661
|
+
children: [/* @__PURE__ */ W(x, {
|
|
660
662
|
size: "sm",
|
|
661
663
|
checked: _.includes(e),
|
|
662
664
|
onCheckedChange: (t) => M({ traits: t ? [..._, e] : _.filter((t) => t !== e) }),
|
|
@@ -664,25 +666,25 @@ function _e({ content: e, version: r, model: i, media: a, ...o }) {
|
|
|
664
666
|
}), E(o.labels, e)]
|
|
665
667
|
}, e))]
|
|
666
668
|
}),
|
|
667
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ G("div", {
|
|
668
670
|
className: "grid gap-3 sm:grid-cols-2",
|
|
669
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ G("div", {
|
|
670
672
|
className: "grid gap-1.5",
|
|
671
|
-
children: [/* @__PURE__ */
|
|
673
|
+
children: [/* @__PURE__ */ W(f, {
|
|
672
674
|
htmlFor: `${l}-label`,
|
|
673
675
|
children: c("contentEditor.versionLabel")
|
|
674
|
-
}), /* @__PURE__ */
|
|
676
|
+
}), /* @__PURE__ */ W(d, {
|
|
675
677
|
id: `${l}-label`,
|
|
676
678
|
className: "h-8",
|
|
677
679
|
value: v,
|
|
678
680
|
onChange: (e) => M({ label: e.target.value })
|
|
679
681
|
})]
|
|
680
|
-
}), /* @__PURE__ */
|
|
682
|
+
}), /* @__PURE__ */ G("div", {
|
|
681
683
|
className: "grid gap-1.5",
|
|
682
|
-
children: [/* @__PURE__ */
|
|
684
|
+
children: [/* @__PURE__ */ W(f, {
|
|
683
685
|
htmlFor: `${l}-at`,
|
|
684
686
|
children: c("contentEditor.versionPublishAt")
|
|
685
|
-
}), /* @__PURE__ */
|
|
687
|
+
}), /* @__PURE__ */ W(d, {
|
|
686
688
|
id: `${l}-at`,
|
|
687
689
|
className: "h-8",
|
|
688
690
|
type: "datetime-local",
|
|
@@ -691,23 +693,23 @@ function _e({ content: e, version: r, model: i, media: a, ...o }) {
|
|
|
691
693
|
})]
|
|
692
694
|
})]
|
|
693
695
|
}),
|
|
694
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ G("label", {
|
|
695
697
|
className: "flex items-center gap-2",
|
|
696
|
-
children: [/* @__PURE__ */
|
|
698
|
+
children: [/* @__PURE__ */ W(x, {
|
|
697
699
|
size: "sm",
|
|
698
700
|
checked: C,
|
|
699
701
|
onCheckedChange: (e) => M({ draft: e })
|
|
700
702
|
}), c("contentEditor.versionDraft")]
|
|
701
703
|
}),
|
|
702
|
-
/* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ G("label", {
|
|
703
705
|
className: "flex items-center gap-2",
|
|
704
|
-
children: [/* @__PURE__ */
|
|
706
|
+
children: [/* @__PURE__ */ W(x, {
|
|
705
707
|
size: "sm",
|
|
706
708
|
checked: D,
|
|
707
709
|
onCheckedChange: (e) => M({ own: e })
|
|
708
710
|
}), c("contentEditor.ownAccess")]
|
|
709
711
|
}),
|
|
710
|
-
D && /* @__PURE__ */
|
|
712
|
+
D && /* @__PURE__ */ W(pe, {
|
|
711
713
|
value: j,
|
|
712
714
|
onChange: (e) => M({ rule: e }),
|
|
713
715
|
model: i,
|
|
@@ -716,62 +718,62 @@ function _e({ content: e, version: r, model: i, media: a, ...o }) {
|
|
|
716
718
|
labels: o.labels,
|
|
717
719
|
client: u
|
|
718
720
|
}),
|
|
719
|
-
N && /* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
-
/* @__PURE__ */
|
|
721
|
+
N && /* @__PURE__ */ W(y, { children: N }),
|
|
722
|
+
/* @__PURE__ */ W(y, { error: I.error }),
|
|
723
|
+
/* @__PURE__ */ G("div", {
|
|
722
724
|
className: "flex flex-wrap items-center gap-3",
|
|
723
725
|
children: [
|
|
724
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ W(s, {
|
|
725
727
|
type: "submit",
|
|
726
728
|
size: "sm",
|
|
727
|
-
disabled: I.pending || !g.length || D && !
|
|
729
|
+
disabled: I.pending || !g.length || D && !Z(j),
|
|
728
730
|
children: I.pending ? c("common.saving") : c("common.save")
|
|
729
731
|
}),
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
+
/* @__PURE__ */ W(Y, { show: te }),
|
|
733
|
+
/* @__PURE__ */ W(s, {
|
|
732
734
|
type: "button",
|
|
733
735
|
size: "sm",
|
|
734
736
|
variant: "destructive",
|
|
735
737
|
className: "ms-auto",
|
|
736
|
-
disabled:
|
|
737
|
-
onClick: () => void
|
|
738
|
+
disabled: L.pending,
|
|
739
|
+
onClick: () => void L.run(() => u.contents.removeVersion(e.id, r.id)),
|
|
738
740
|
children: c("contentEditor.deleteVersion")
|
|
739
741
|
})
|
|
740
742
|
]
|
|
741
743
|
}),
|
|
742
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ W(y, { error: L.error })
|
|
743
745
|
]
|
|
744
746
|
}),
|
|
745
|
-
/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */ W(A, {
|
|
746
748
|
offer: r.offer,
|
|
747
|
-
pending:
|
|
748
|
-
onSell: (t) =>
|
|
749
|
+
pending: R.pending,
|
|
750
|
+
onSell: (t) => R.run(() => u.offers.sell({
|
|
749
751
|
content: e.id,
|
|
750
752
|
version: r.id
|
|
751
753
|
}, t)),
|
|
752
|
-
onWithdraw: () => void
|
|
754
|
+
onWithdraw: () => void R.run(() => u.offers.withdraw({
|
|
753
755
|
content: e.id,
|
|
754
756
|
version: r.id
|
|
755
757
|
}))
|
|
756
758
|
}),
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
p?.segments && /* @__PURE__ */
|
|
759
|
+
/* @__PURE__ */ W(y, { error: R.error }),
|
|
760
|
+
p?.segments && /* @__PURE__ */ W($, {
|
|
759
761
|
content: e,
|
|
760
762
|
version: r,
|
|
761
763
|
...o
|
|
762
764
|
}),
|
|
763
|
-
a && /* @__PURE__ */
|
|
765
|
+
a && /* @__PURE__ */ W(xe, {
|
|
764
766
|
content: e,
|
|
765
767
|
version: r,
|
|
766
768
|
...o
|
|
767
769
|
}),
|
|
768
|
-
a && /* @__PURE__ */
|
|
770
|
+
a && /* @__PURE__ */ W(Se, {
|
|
769
771
|
content: e,
|
|
770
772
|
version: r,
|
|
771
773
|
model: i,
|
|
772
774
|
...o
|
|
773
775
|
}),
|
|
774
|
-
a && p?.presentation === "reader" && /* @__PURE__ */
|
|
776
|
+
a && p?.presentation === "reader" && /* @__PURE__ */ W(ne, {
|
|
775
777
|
content: e.id,
|
|
776
778
|
version: r.id,
|
|
777
779
|
client: o.client,
|
|
@@ -780,9 +782,9 @@ function _e({ content: e, version: r, model: i, media: a, ...o }) {
|
|
|
780
782
|
]
|
|
781
783
|
});
|
|
782
784
|
}
|
|
783
|
-
function
|
|
784
|
-
let { t: a } = t(), c = n(i.client), { presets: l } = o({ client: c }), u = b("content.save", i.onError), d =
|
|
785
|
-
if (
|
|
785
|
+
function xe({ content: e, version: r, ...i }) {
|
|
786
|
+
let { t: a } = t(), c = n(i.client), { presets: l } = o({ client: c }), u = b("content.save", i.onError), d = V(null), [f, p] = H(null);
|
|
787
|
+
if (z(() => () => void (f && URL.revokeObjectURL(f)), [f]), !l.some((t) => t.kind === e.kind && t.name === "cover")) return null;
|
|
786
788
|
let m = f ?? r.cover?.url, h = (t) => void u.run(async () => {
|
|
787
789
|
if (!t) return p(null), c.contents.setCover(e.id, r.id, null);
|
|
788
790
|
let n = {
|
|
@@ -792,26 +794,26 @@ function ve({ content: e, version: r, ...i }) {
|
|
|
792
794
|
}, i = await c.media.uploadNamed(n, t, { path: await c.media.presetPath(e.kind, "cover", t) }), a = await c.contents.setCover(e.id, r.id, i.name);
|
|
793
795
|
return typeof URL.createObjectURL == "function" && p(URL.createObjectURL(t)), a;
|
|
794
796
|
});
|
|
795
|
-
return /* @__PURE__ */
|
|
797
|
+
return /* @__PURE__ */ G("div", {
|
|
796
798
|
className: "grid gap-1.5",
|
|
797
799
|
"data-ckui": "version-cover",
|
|
798
800
|
children: [
|
|
799
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ W("span", {
|
|
800
802
|
className: "text-sm font-medium",
|
|
801
803
|
children: a("contentManager.cover")
|
|
802
804
|
}),
|
|
803
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ G("div", {
|
|
804
806
|
className: "flex flex-wrap items-center gap-3",
|
|
805
807
|
children: [
|
|
806
|
-
m ? /* @__PURE__ */
|
|
808
|
+
m ? /* @__PURE__ */ W("img", {
|
|
807
809
|
src: m,
|
|
808
810
|
alt: "",
|
|
809
811
|
className: "h-20 w-36 rounded-md border border-border object-cover"
|
|
810
|
-
}) : /* @__PURE__ */
|
|
812
|
+
}) : /* @__PURE__ */ W("span", {
|
|
811
813
|
className: "text-muted-foreground",
|
|
812
814
|
children: a("contentManager.noCover")
|
|
813
815
|
}),
|
|
814
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ W(s, {
|
|
815
817
|
type: "button",
|
|
816
818
|
size: "sm",
|
|
817
819
|
variant: "outline",
|
|
@@ -819,7 +821,7 @@ function ve({ content: e, version: r, ...i }) {
|
|
|
819
821
|
onClick: () => d.current?.click(),
|
|
820
822
|
children: a(m ? "pollEditor.replaceImage" : "contentManager.addCover")
|
|
821
823
|
}),
|
|
822
|
-
r.cover?.image && /* @__PURE__ */
|
|
824
|
+
r.cover?.image && /* @__PURE__ */ W(s, {
|
|
823
825
|
type: "button",
|
|
824
826
|
size: "sm",
|
|
825
827
|
variant: "ghost",
|
|
@@ -827,7 +829,7 @@ function ve({ content: e, version: r, ...i }) {
|
|
|
827
829
|
onClick: () => h(null),
|
|
828
830
|
children: a("pollEditor.removeImage")
|
|
829
831
|
}),
|
|
830
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ W("input", {
|
|
831
833
|
ref: d,
|
|
832
834
|
type: "file",
|
|
833
835
|
accept: "image/*",
|
|
@@ -840,12 +842,12 @@ function ve({ content: e, version: r, ...i }) {
|
|
|
840
842
|
})
|
|
841
843
|
]
|
|
842
844
|
}),
|
|
843
|
-
/* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ W(y, { error: u.error })
|
|
844
846
|
]
|
|
845
847
|
});
|
|
846
848
|
}
|
|
847
|
-
function
|
|
848
|
-
let { t: s } = t(), c = e(), u =
|
|
849
|
+
function Se({ content: n, version: r, model: i, ...o }) {
|
|
850
|
+
let { t: s } = t(), c = e(), u = B(() => ({
|
|
849
851
|
kind: n.kind,
|
|
850
852
|
id: n.id,
|
|
851
853
|
version: r.id
|
|
@@ -856,42 +858,42 @@ function ye({ content: n, version: r, model: i, ...o }) {
|
|
|
856
858
|
]), d = a(u, {
|
|
857
859
|
editor: !0,
|
|
858
860
|
client: o.client
|
|
859
|
-
}), f =
|
|
861
|
+
}), f = B(() => (i?.languages ?? []).map((e) => ({
|
|
860
862
|
value: e,
|
|
861
863
|
label: c(e)
|
|
862
864
|
})), [i, c]);
|
|
863
|
-
return !d.read && d.loading ? /* @__PURE__ */
|
|
865
|
+
return !d.read && d.loading ? /* @__PURE__ */ W(v, { className: "h-24 w-full" }) : d.read?.uploads && L(d.read.uploads).source ? /* @__PURE__ */ W(I, {
|
|
864
866
|
item: u,
|
|
865
867
|
languages: f,
|
|
866
868
|
client: o.client,
|
|
867
869
|
onError: o.onError
|
|
868
|
-
}) : /* @__PURE__ */
|
|
870
|
+
}) : /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(l, {
|
|
869
871
|
item: u,
|
|
870
872
|
commit: r.live ? "manual" : "auto",
|
|
871
873
|
label: s("contentEditor.media"),
|
|
872
874
|
client: o.client,
|
|
873
875
|
onError: o.onError
|
|
874
|
-
}), i?.kinds[n.kind]?.presentation === "reader" && /* @__PURE__ */
|
|
876
|
+
}), i?.kinds[n.kind]?.presentation === "reader" && /* @__PURE__ */ W(F, {
|
|
875
877
|
content: n.id,
|
|
876
878
|
version: r.id,
|
|
877
879
|
client: o.client,
|
|
878
880
|
onError: o.onError
|
|
879
881
|
})] });
|
|
880
882
|
}
|
|
881
|
-
var
|
|
883
|
+
var Ce = (e) => e.segments.map((e) => ({
|
|
882
884
|
title: e.title ?? "",
|
|
883
885
|
start: String(e.start),
|
|
884
886
|
end: String(e.end),
|
|
885
887
|
release: w(e.release_at)
|
|
886
888
|
}));
|
|
887
889
|
function $({ content: e, version: r, ...i }) {
|
|
888
|
-
let { t: a } = t(), o = n(i.client), c = O(
|
|
890
|
+
let { t: a } = t(), o = n(i.client), c = O(B(() => ({ rows: Ce(r) }), [r])), l = c.value.rows, u = (e) => c.edit((t) => ({ rows: typeof e == "function" ? e(t.rows) : e })), [f, p] = H(!1), m = b("content.save", i.onError), h = N(e.id, r.id, { client: o }), { pages: g } = te(h.plan, o), _ = (e, t) => {
|
|
889
891
|
p(!1), u((n) => n.map((n, r) => r === e ? {
|
|
890
892
|
...n,
|
|
891
893
|
...t
|
|
892
894
|
} : n));
|
|
893
|
-
},
|
|
894
|
-
if (!
|
|
895
|
+
}, v = l.every((e) => /^\d+$/.test(e.start) && /^\d+$/.test(e.end) && Number(e.end) > Number(e.start)), x = async () => {
|
|
896
|
+
if (!v) return !1;
|
|
895
897
|
p(!1);
|
|
896
898
|
let t = c.checkpoint(), n = l.map((e, t) => ({
|
|
897
899
|
position: t + 1,
|
|
@@ -902,71 +904,90 @@ function $({ content: e, version: r, ...i }) {
|
|
|
902
904
|
released: !1
|
|
903
905
|
})), i = await m.run(() => o.contents.setSegments(e.id, r.id, n));
|
|
904
906
|
if (!i) return !1;
|
|
905
|
-
let a = t({ rows:
|
|
907
|
+
let a = t({ rows: Ce(i) });
|
|
906
908
|
return p(a), a;
|
|
907
909
|
};
|
|
908
910
|
return k(`segments:${r.id}`, {
|
|
909
911
|
label: a("contentEditor.segments"),
|
|
910
912
|
dirty: c.dirty.length > 0,
|
|
911
913
|
pending: m.pending,
|
|
912
|
-
valid:
|
|
913
|
-
save:
|
|
914
|
+
valid: v,
|
|
915
|
+
save: x,
|
|
914
916
|
order: 20
|
|
915
|
-
}), /* @__PURE__ */
|
|
917
|
+
}), /* @__PURE__ */ G("div", {
|
|
916
918
|
className: "grid gap-2",
|
|
917
919
|
"data-ckui": "segments-editor",
|
|
918
920
|
children: [
|
|
919
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ W("h4", {
|
|
920
922
|
className: "text-sm font-medium",
|
|
921
923
|
children: a("contentEditor.segments")
|
|
922
924
|
}),
|
|
923
|
-
l.length === 0 && /* @__PURE__ */
|
|
925
|
+
l.length === 0 && /* @__PURE__ */ W("p", {
|
|
924
926
|
className: "text-muted-foreground",
|
|
925
927
|
children: a("contentEditor.noSegments")
|
|
926
928
|
}),
|
|
927
|
-
l.map((e, t) => /* @__PURE__ */
|
|
929
|
+
l.map((e, t) => /* @__PURE__ */ G("div", {
|
|
928
930
|
className: "flex flex-wrap items-center gap-2",
|
|
929
931
|
"data-ckui": "segment-row",
|
|
930
932
|
children: [
|
|
931
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ W("span", {
|
|
932
934
|
className: "w-6 text-xs text-muted-foreground tabular-nums",
|
|
933
935
|
children: t + 1
|
|
934
936
|
}),
|
|
935
|
-
/* @__PURE__ */
|
|
937
|
+
/* @__PURE__ */ W(d, {
|
|
936
938
|
className: "h-8 w-40",
|
|
937
939
|
"aria-label": a("contentEditor.segmentTitle", { n: t + 1 }),
|
|
938
940
|
placeholder: a("contentEditor.segmentTitlePlaceholder"),
|
|
939
941
|
value: e.title,
|
|
940
|
-
onChange: (e) =>
|
|
941
|
-
}),
|
|
942
|
-
/* @__PURE__ */ V(d, {
|
|
943
|
-
className: "h-8 w-20",
|
|
944
|
-
type: "number",
|
|
945
|
-
min: 0,
|
|
946
|
-
"aria-label": a("contentEditor.segmentStart", { n: t + 1 }),
|
|
947
|
-
value: e.start,
|
|
948
|
-
onChange: (e) => h(t, { start: e.target.value })
|
|
949
|
-
}),
|
|
950
|
-
/* @__PURE__ */ V("span", {
|
|
951
|
-
"aria-hidden": !0,
|
|
952
|
-
children: "–"
|
|
942
|
+
onChange: (e) => _(t, { title: e.target.value })
|
|
953
943
|
}),
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
944
|
+
g.length ? /* @__PURE__ */ G(U, { children: [
|
|
945
|
+
/* @__PURE__ */ W(P, {
|
|
946
|
+
label: a("contentEditor.segmentStart", { n: t + 1 }),
|
|
947
|
+
pages: g,
|
|
948
|
+
value: g[Number(e.start)]?.name ?? "",
|
|
949
|
+
onChange: (e) => _(t, { start: String(g.findIndex((t) => t.name === e)) })
|
|
950
|
+
}),
|
|
951
|
+
/* @__PURE__ */ W("span", {
|
|
952
|
+
"aria-hidden": !0,
|
|
953
|
+
children: "–"
|
|
954
|
+
}),
|
|
955
|
+
/* @__PURE__ */ W(P, {
|
|
956
|
+
label: a("contentEditor.segmentEnd", { n: t + 1 }),
|
|
957
|
+
pages: g,
|
|
958
|
+
value: g[Number(e.end) - 1]?.name ?? "",
|
|
959
|
+
onChange: (e) => _(t, { end: String(g.findIndex((t) => t.name === e) + 1) })
|
|
960
|
+
})
|
|
961
|
+
] }) : /* @__PURE__ */ G(U, { children: [
|
|
962
|
+
/* @__PURE__ */ W(d, {
|
|
963
|
+
className: "h-8 w-20",
|
|
964
|
+
type: "number",
|
|
965
|
+
min: 0,
|
|
966
|
+
"aria-label": a("contentEditor.segmentStart", { n: t + 1 }),
|
|
967
|
+
value: e.start,
|
|
968
|
+
onChange: (e) => _(t, { start: e.target.value })
|
|
969
|
+
}),
|
|
970
|
+
/* @__PURE__ */ W("span", {
|
|
971
|
+
"aria-hidden": !0,
|
|
972
|
+
children: "–"
|
|
973
|
+
}),
|
|
974
|
+
/* @__PURE__ */ W(d, {
|
|
975
|
+
className: "h-8 w-20",
|
|
976
|
+
type: "number",
|
|
977
|
+
min: 1,
|
|
978
|
+
"aria-label": a("contentEditor.segmentEnd", { n: t + 1 }),
|
|
979
|
+
value: e.end,
|
|
980
|
+
onChange: (e) => _(t, { end: e.target.value })
|
|
981
|
+
})
|
|
982
|
+
] }),
|
|
983
|
+
/* @__PURE__ */ W(d, {
|
|
963
984
|
className: "h-8 w-48",
|
|
964
985
|
type: "datetime-local",
|
|
965
986
|
"aria-label": a("contentEditor.segmentRelease", { n: t + 1 }),
|
|
966
987
|
value: e.release,
|
|
967
|
-
onChange: (e) =>
|
|
988
|
+
onChange: (e) => _(t, { release: e.target.value })
|
|
968
989
|
}),
|
|
969
|
-
/* @__PURE__ */
|
|
990
|
+
/* @__PURE__ */ W(s, {
|
|
970
991
|
type: "button",
|
|
971
992
|
size: "xs",
|
|
972
993
|
variant: "ghost",
|
|
@@ -975,10 +996,10 @@ function $({ content: e, version: r, ...i }) {
|
|
|
975
996
|
})
|
|
976
997
|
]
|
|
977
998
|
}, t)),
|
|
978
|
-
/* @__PURE__ */
|
|
999
|
+
/* @__PURE__ */ G("div", {
|
|
979
1000
|
className: "flex flex-wrap items-center gap-2",
|
|
980
1001
|
children: [
|
|
981
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ W(s, {
|
|
982
1003
|
type: "button",
|
|
983
1004
|
size: "sm",
|
|
984
1005
|
variant: "outline",
|
|
@@ -993,49 +1014,49 @@ function $({ content: e, version: r, ...i }) {
|
|
|
993
1014
|
},
|
|
994
1015
|
children: a("contentEditor.addSegment")
|
|
995
1016
|
}),
|
|
996
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ W(s, {
|
|
997
1018
|
type: "button",
|
|
998
1019
|
size: "sm",
|
|
999
|
-
disabled: m.pending || !
|
|
1000
|
-
onClick: () => void
|
|
1020
|
+
disabled: m.pending || !v,
|
|
1021
|
+
onClick: () => void x(),
|
|
1001
1022
|
children: a("contentEditor.saveSegments")
|
|
1002
1023
|
}),
|
|
1003
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ W(Y, { show: f })
|
|
1004
1025
|
]
|
|
1005
1026
|
}),
|
|
1006
|
-
/* @__PURE__ */
|
|
1027
|
+
/* @__PURE__ */ W(y, { error: m.error })
|
|
1007
1028
|
]
|
|
1008
1029
|
});
|
|
1009
1030
|
}
|
|
1010
|
-
function
|
|
1011
|
-
let r = e(), i =
|
|
1031
|
+
function we({ content: t, ...n }) {
|
|
1032
|
+
let r = e(), i = B(() => t.versions.map((e) => ({
|
|
1012
1033
|
id: e.id,
|
|
1013
1034
|
label: Q(e, r, n.labels)
|
|
1014
1035
|
})), [
|
|
1015
1036
|
t.versions,
|
|
1016
1037
|
r,
|
|
1017
1038
|
n.labels
|
|
1018
|
-
]), { spec: a } =
|
|
1019
|
-
return /* @__PURE__ */
|
|
1020
|
-
className:
|
|
1039
|
+
]), { spec: a } = X(t.kind, n.client);
|
|
1040
|
+
return /* @__PURE__ */ G("div", {
|
|
1041
|
+
className: ae("grid gap-6", n.className),
|
|
1021
1042
|
"data-ckui": "content-sections",
|
|
1022
1043
|
children: [
|
|
1023
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ W(de, {
|
|
1024
1045
|
content: t,
|
|
1025
1046
|
...n
|
|
1026
1047
|
}),
|
|
1027
|
-
/* @__PURE__ */
|
|
1048
|
+
/* @__PURE__ */ W(he, {
|
|
1028
1049
|
content: t,
|
|
1029
1050
|
...n
|
|
1030
1051
|
}),
|
|
1031
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ W(_e, {
|
|
1032
1053
|
content: t,
|
|
1033
1054
|
...n
|
|
1034
1055
|
}),
|
|
1035
|
-
!!a?.entities?.length && /* @__PURE__ */
|
|
1056
|
+
!!a?.entities?.length && /* @__PURE__ */ W("section", {
|
|
1036
1057
|
className: "grid gap-3 border-t border-border pt-4",
|
|
1037
1058
|
"data-ckui": "content-groups",
|
|
1038
|
-
children: /* @__PURE__ */
|
|
1059
|
+
children: /* @__PURE__ */ W(R, {
|
|
1039
1060
|
management: n.management,
|
|
1040
1061
|
content: t.id,
|
|
1041
1062
|
contentKind: t.kind,
|
|
@@ -1049,6 +1070,6 @@ function xe({ content: t, ...n }) {
|
|
|
1049
1070
|
});
|
|
1050
1071
|
}
|
|
1051
1072
|
//#endregion
|
|
1052
|
-
export {
|
|
1073
|
+
export { he as AccessEditor, de as ContentDetailsEditor, we as ContentSections, pe as RuleFields, $ as SegmentsEditor, xe as VersionCover, _e as VersionsEditor, me as cleanRule, Z as complete, Q as versionLabel };
|
|
1053
1074
|
|
|
1054
1075
|
//# sourceMappingURL=editors.js.map
|