@openrails/contentkit-ui 0.103.0 → 0.103.2
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 -4
- package/dist/components/admin/content-manager.d.ts +1 -1
- package/dist/components/admin/content-manager.js +346 -304
- package/dist/components/admin/content-manager.js.map +1 -1
- package/dist/components/admin/page-review.js +106 -97
- package/dist/components/admin/page-review.js.map +1 -1
- package/dist/components/admin/reader-content-editor.d.ts +6 -0
- package/dist/components/admin/reader-content-editor.js +709 -0
- package/dist/components/admin/reader-content-editor.js.map +1 -0
- package/dist/components/admin/reader-manifest.js +120 -105
- package/dist/components/admin/reader-manifest.js.map +1 -1
- package/dist/components/content/editor-save.d.ts +32 -0
- package/dist/components/content/editor-save.js +51 -0
- package/dist/components/content/editor-save.js.map +1 -0
- package/dist/components/content/editors.d.ts +17 -2
- package/dist/components/content/editors.js +359 -328
- package/dist/components/content/editors.js.map +1 -1
- package/dist/components/content/offer-fields.d.ts +1 -1
- package/dist/components/content/offer-fields.js +86 -64
- package/dist/components/content/offer-fields.js.map +1 -1
- package/dist/components/content/release-date-picker.d.ts +4 -4
- package/dist/components/content/release-date-picker.js +106 -48
- package/dist/components/content/release-date-picker.js.map +1 -1
- package/dist/components/groups/memberships.d.ts +11 -1
- package/dist/components/groups/memberships.js +1 -1
- package/dist/components/groups/memberships.js.map +1 -1
- package/dist/components/media-folder-editor.d.ts +4 -0
- package/dist/components/media-folder-editor.js +177 -167
- package/dist/components/media-folder-editor.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/admin/de.js +25 -0
- package/dist/locales/admin/de.js.map +1 -1
- package/dist/locales/admin/en.d.ts +25 -0
- package/dist/locales/admin/en.js +25 -0
- package/dist/locales/admin/en.js.map +1 -1
- package/dist/locales/admin/es.js +25 -0
- package/dist/locales/admin/es.js.map +1 -1
- package/dist/locales/admin/ja.js +25 -0
- package/dist/locales/admin/ja.js.map +1 -1
- package/dist/locales/admin/ko.js +25 -0
- package/dist/locales/admin/ko.js.map +1 -1
- package/dist/locales/admin/zh.js +25 -0
- package/dist/locales/admin/zh.js.map +1 -1
- package/dist/locales/discovery/de.js +1 -2
- package/dist/locales/discovery/de.js.map +1 -1
- package/dist/locales/discovery/en.d.ts +1 -2
- package/dist/locales/discovery/en.js +1 -2
- package/dist/locales/discovery/en.js.map +1 -1
- package/dist/locales/discovery/es.js +1 -2
- package/dist/locales/discovery/es.js.map +1 -1
- package/dist/locales/discovery/ja.js +1 -2
- package/dist/locales/discovery/ja.js.map +1 -1
- package/dist/locales/discovery/ko.js +1 -2
- package/dist/locales/discovery/ko.js.map +1 -1
- package/dist/locales/discovery/zh.js +1 -2
- package/dist/locales/discovery/zh.js.map +1 -1
- package/dist/locales/en.d.ts +26 -2
- package/dist/react/page-review.d.ts +1 -1
- package/dist/react/page-review.js +6 -5
- package/dist/react/page-review.js.map +1 -1
- package/dist/react/use-draft.d.ts +8 -0
- package/dist/react/use-draft.js +35 -0
- package/dist/react/use-draft.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -1
|
@@ -6,16 +6,17 @@ import { Input as i } from "../../ui/input.js";
|
|
|
6
6
|
import { Label as a } from "../../ui/label.js";
|
|
7
7
|
import { Select as o, SelectContent as s, SelectItem as c, SelectTrigger as l, SelectValue as u } from "../../ui/select.js";
|
|
8
8
|
import { ErrorLine as d, useAction as f } from "../social/parts.js";
|
|
9
|
-
import { LoadFailed as p, Rows as
|
|
10
|
-
import { Switch as
|
|
9
|
+
import { LoadFailed as p, Rows as ee } from "./shell.js";
|
|
10
|
+
import { Switch as m } from "../../ui/switch.js";
|
|
11
|
+
import { useEditorSaveTask as h } from "../content/editor-save.js";
|
|
11
12
|
import { emptyReaderMeta as g, matchAudio as _, readerMetaProblems as v, readerNames as y } from "../../client/reader-meta.js";
|
|
12
13
|
import { useReaderPlan as b } from "../../react/versions.js";
|
|
13
|
-
import { useId as x, useMemo as S,
|
|
14
|
-
import { jsx as
|
|
15
|
-
import { cn as
|
|
14
|
+
import { useId as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
15
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
16
|
+
import { cn as D } from "cn";
|
|
16
17
|
//#region src/components/admin/reader-manifest.tsx
|
|
17
|
-
var
|
|
18
|
-
function
|
|
18
|
+
var O = "__none__", k = (e, t) => t === void 0 ? e === void 0 ? O : `page:${e}` : `anchor:${t}`, A = (e) => e.startsWith("anchor:") ? { anchor: e.slice(7) } : e.startsWith("page:") ? { page: e.slice(5) } : {};
|
|
19
|
+
function te(e) {
|
|
19
20
|
let t = e.defaults?.auto_advance_seconds;
|
|
20
21
|
return {
|
|
21
22
|
schema_version: 1,
|
|
@@ -38,61 +39,75 @@ function A(e) {
|
|
|
38
39
|
}
|
|
39
40
|
var j = (e) => e.trim() === "" ? NaN : Number(e), M = (e) => e === void 0 || Number.isNaN(e) ? "" : String(e);
|
|
40
41
|
function N({ content: i, version: a, client: o, onError: s, className: c, appearance: l }) {
|
|
41
|
-
let { t: u } = e(),
|
|
42
|
+
let { t: u } = e(), m = n(o), x = b(i, a, { client: m }), O = S(() => x.plan ? y(x.plan) : {
|
|
42
43
|
pages: [],
|
|
43
44
|
files: []
|
|
44
|
-
}, [x.plan]), [
|
|
45
|
-
x.plan && x.plan !==
|
|
46
|
-
let X = S(() => j ? v(j,
|
|
45
|
+
}, [x.plan]), [k, A] = w(null), [j, M] = w(null), [N, z] = w(!1), [B, V] = w(!1), [q, J] = w(null), Y = f("reader.save", s);
|
|
46
|
+
x.plan && x.plan !== k && !N && (A(x.plan), M(x.plan.reader ? structuredClone(x.plan.reader) : g()));
|
|
47
|
+
let X = S(() => j ? v(j, O) : [], [j, O]), Z = (e) => {
|
|
47
48
|
M((t) => t && e(t)), z(!0), V(!1);
|
|
48
|
-
}, Q = (
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
}, Q = C(j);
|
|
50
|
+
Q.current = j;
|
|
51
|
+
let $ = async () => {
|
|
52
|
+
if (!j || X.length) return !1;
|
|
53
|
+
V(!1);
|
|
54
|
+
let e = j;
|
|
55
|
+
return !await Y.run(async () => (await m.versions.setReader(i, a, te(e)), !0)) || Q.current !== e ? !1 : (z(!1), V(!0), !0);
|
|
56
|
+
};
|
|
57
|
+
h(`reader-meta:${a}`, {
|
|
58
|
+
label: u("readerManifest.title"),
|
|
59
|
+
dirty: N,
|
|
60
|
+
pending: Y.pending,
|
|
61
|
+
valid: !X.length,
|
|
62
|
+
save: $,
|
|
63
|
+
order: 30
|
|
64
|
+
});
|
|
65
|
+
let ne = (() => {
|
|
66
|
+
if (x.loading && !x.plan && !x.pending) return /* @__PURE__ */ T(ee, { count: 2 });
|
|
67
|
+
if (x.pending) return /* @__PURE__ */ T("p", {
|
|
51
68
|
className: "text-muted-foreground",
|
|
52
69
|
children: u("readerManifest.pending")
|
|
53
70
|
});
|
|
54
|
-
if (x.error && !x.plan) return /* @__PURE__ */
|
|
71
|
+
if (x.error && !x.plan) return /* @__PURE__ */ T(p, {
|
|
55
72
|
error: x.error,
|
|
56
73
|
message: u("readerManifest.loadFailed"),
|
|
57
74
|
retry: x.reload
|
|
58
75
|
});
|
|
59
76
|
if (!j) return null;
|
|
60
77
|
let e = j.anchors ?? [], t = e.map((e) => e.id).filter(Boolean);
|
|
61
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ E("form", {
|
|
62
79
|
className: "grid gap-4",
|
|
63
80
|
onSubmit: (e) => {
|
|
64
|
-
e.preventDefault(),
|
|
65
|
-
e && (z(!1), V(!0));
|
|
66
|
-
}));
|
|
81
|
+
e.preventDefault(), $();
|
|
67
82
|
},
|
|
68
83
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ T("p", {
|
|
70
85
|
className: "text-muted-foreground",
|
|
71
86
|
children: u("readerManifest.summary", {
|
|
72
|
-
pages:
|
|
73
|
-
files:
|
|
87
|
+
pages: O.pages.length,
|
|
88
|
+
files: O.files.length
|
|
74
89
|
})
|
|
75
90
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ T(R, {
|
|
77
92
|
meta: j,
|
|
78
93
|
edit: Z
|
|
79
94
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ T(L, {
|
|
81
96
|
title: u("readerManifest.anchors"),
|
|
82
97
|
add: u("readerManifest.addAnchor"),
|
|
83
|
-
disabled: !
|
|
98
|
+
disabled: !O.pages.length,
|
|
84
99
|
onAdd: () => Z((e) => ({
|
|
85
100
|
...e,
|
|
86
101
|
anchors: [...e.anchors ?? [], {
|
|
87
102
|
id: P(e.anchors ?? []),
|
|
88
|
-
page:
|
|
103
|
+
page: O.pages[0],
|
|
89
104
|
offset_percent: 0
|
|
90
105
|
}]
|
|
91
106
|
})),
|
|
92
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
107
|
+
children: e.map((e, t) => /* @__PURE__ */ T(H, {
|
|
93
108
|
index: t,
|
|
94
109
|
anchor: e,
|
|
95
|
-
pages:
|
|
110
|
+
pages: O.pages,
|
|
96
111
|
onChange: (e) => Z((n) => ({
|
|
97
112
|
...n,
|
|
98
113
|
anchors: F(n.anchors, t, e)
|
|
@@ -103,24 +118,24 @@ function N({ content: i, version: a, client: o, onError: s, className: c, appear
|
|
|
103
118
|
}))
|
|
104
119
|
}, t))
|
|
105
120
|
}),
|
|
106
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ E(L, {
|
|
107
122
|
title: u("readerManifest.foreground"),
|
|
108
123
|
add: u("readerManifest.addCue"),
|
|
109
|
-
disabled: !
|
|
124
|
+
disabled: !O.files.length || !O.pages.length,
|
|
110
125
|
onAdd: () => Z((e) => ({
|
|
111
126
|
...e,
|
|
112
127
|
foreground: [...e.foreground ?? [], {
|
|
113
|
-
file:
|
|
114
|
-
page:
|
|
128
|
+
file: O.files[0],
|
|
129
|
+
page: O.pages[0]
|
|
115
130
|
}]
|
|
116
131
|
})),
|
|
117
|
-
extra: /* @__PURE__ */
|
|
132
|
+
extra: /* @__PURE__ */ T(r, {
|
|
118
133
|
type: "button",
|
|
119
134
|
size: "sm",
|
|
120
135
|
variant: "outline",
|
|
121
|
-
disabled: !
|
|
136
|
+
disabled: !O.files.length,
|
|
122
137
|
onClick: () => {
|
|
123
|
-
let e = _(
|
|
138
|
+
let e = _(O, t);
|
|
124
139
|
J(e), e.foreground.length && Z((t) => ({
|
|
125
140
|
...t,
|
|
126
141
|
foreground: e.foreground
|
|
@@ -128,10 +143,10 @@ function N({ content: i, version: a, client: o, onError: s, className: c, appear
|
|
|
128
143
|
},
|
|
129
144
|
children: u("readerManifest.match")
|
|
130
145
|
}),
|
|
131
|
-
children: [q && /* @__PURE__ */
|
|
146
|
+
children: [q && /* @__PURE__ */ T(G, { match: q }), (j.foreground ?? []).map((e, n) => /* @__PURE__ */ T(U, {
|
|
132
147
|
index: n,
|
|
133
148
|
cue: e,
|
|
134
|
-
names:
|
|
149
|
+
names: O,
|
|
135
150
|
anchors: t,
|
|
136
151
|
onChange: (e) => Z((t) => ({
|
|
137
152
|
...t,
|
|
@@ -143,18 +158,18 @@ function N({ content: i, version: a, client: o, onError: s, className: c, appear
|
|
|
143
158
|
}))
|
|
144
159
|
}, n))]
|
|
145
160
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ T(L, {
|
|
147
162
|
title: u("readerManifest.background"),
|
|
148
163
|
add: u("readerManifest.addTrack"),
|
|
149
|
-
disabled: !
|
|
164
|
+
disabled: !O.files.length,
|
|
150
165
|
onAdd: () => Z((e) => ({
|
|
151
166
|
...e,
|
|
152
|
-
background: [...e.background ?? [], { file:
|
|
167
|
+
background: [...e.background ?? [], { file: O.files[0] }]
|
|
153
168
|
})),
|
|
154
|
-
children: (j.background ?? []).map((e, n) => /* @__PURE__ */
|
|
169
|
+
children: (j.background ?? []).map((e, n) => /* @__PURE__ */ T(W, {
|
|
155
170
|
index: n,
|
|
156
171
|
cue: e,
|
|
157
|
-
names:
|
|
172
|
+
names: O,
|
|
158
173
|
anchors: t,
|
|
159
174
|
onChange: (e) => Z((t) => ({
|
|
160
175
|
...t,
|
|
@@ -166,27 +181,27 @@ function N({ content: i, version: a, client: o, onError: s, className: c, appear
|
|
|
166
181
|
}))
|
|
167
182
|
}, n))
|
|
168
183
|
}),
|
|
169
|
-
X.length > 0 && /* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
184
|
+
X.length > 0 && /* @__PURE__ */ T(K, { problems: X }),
|
|
185
|
+
/* @__PURE__ */ T(d, { error: Y.error }),
|
|
186
|
+
/* @__PURE__ */ E("div", {
|
|
172
187
|
className: "flex flex-wrap items-center gap-3",
|
|
173
188
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ T(r, {
|
|
175
190
|
type: "submit",
|
|
176
191
|
size: "sm",
|
|
177
192
|
disabled: Y.pending || !N || X.length > 0,
|
|
178
193
|
children: Y.pending ? u("common.saving") : u("common.save")
|
|
179
194
|
}),
|
|
180
|
-
N && /* @__PURE__ */
|
|
195
|
+
N && /* @__PURE__ */ T(r, {
|
|
181
196
|
type: "button",
|
|
182
197
|
size: "sm",
|
|
183
198
|
variant: "ghost",
|
|
184
199
|
onClick: () => {
|
|
185
|
-
z(!1),
|
|
200
|
+
z(!1), A(null), J(null);
|
|
186
201
|
},
|
|
187
202
|
children: u("readerManifest.revert")
|
|
188
203
|
}),
|
|
189
|
-
B && /* @__PURE__ */
|
|
204
|
+
B && /* @__PURE__ */ T("span", {
|
|
190
205
|
role: "status",
|
|
191
206
|
className: "text-muted-foreground",
|
|
192
207
|
children: u("readerManifest.saved")
|
|
@@ -196,14 +211,14 @@ function N({ content: i, version: a, client: o, onError: s, className: c, appear
|
|
|
196
211
|
]
|
|
197
212
|
});
|
|
198
213
|
})();
|
|
199
|
-
return /* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ E(t, {
|
|
200
215
|
appearance: l,
|
|
201
|
-
className:
|
|
216
|
+
className: D("grid gap-3 text-sm", c),
|
|
202
217
|
"data-ckui": "reader-manifest",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ T("h4", {
|
|
204
219
|
className: "font-medium",
|
|
205
220
|
children: u("readerManifest.title")
|
|
206
|
-
}),
|
|
221
|
+
}), ne]
|
|
207
222
|
});
|
|
208
223
|
}
|
|
209
224
|
function P(e) {
|
|
@@ -213,17 +228,17 @@ function P(e) {
|
|
|
213
228
|
}
|
|
214
229
|
var F = (e, t, n) => (e ?? []).map((e, r) => r === t ? n : e), I = (e, t) => (e ?? []).filter((e, n) => n !== t);
|
|
215
230
|
function L({ title: e, add: t, disabled: n, onAdd: i, extra: a, children: o }) {
|
|
216
|
-
return /* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ E("fieldset", {
|
|
217
232
|
className: "grid gap-2 rounded-md border border-border p-3",
|
|
218
233
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ T("legend", {
|
|
220
235
|
className: "px-1 font-medium",
|
|
221
236
|
children: e
|
|
222
237
|
}),
|
|
223
238
|
o,
|
|
224
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ E("div", {
|
|
225
240
|
className: "flex flex-wrap gap-2",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ T(r, {
|
|
227
242
|
type: "button",
|
|
228
243
|
size: "sm",
|
|
229
244
|
variant: "outline",
|
|
@@ -237,12 +252,12 @@ function L({ title: e, add: t, disabled: n, onAdd: i, extra: a, children: o }) {
|
|
|
237
252
|
}
|
|
238
253
|
function R({ meta: t, edit: n }) {
|
|
239
254
|
let { t: r } = e(), o = x(), s = t.defaults?.auto_advance_seconds;
|
|
240
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ E("div", {
|
|
241
256
|
className: "grid max-w-xs gap-1.5",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ T(a, {
|
|
243
258
|
htmlFor: `${o}-auto`,
|
|
244
259
|
children: r("readerManifest.autoAdvance")
|
|
245
|
-
}), /* @__PURE__ */
|
|
260
|
+
}), /* @__PURE__ */ T(i, {
|
|
246
261
|
id: `${o}-auto`,
|
|
247
262
|
className: "h-8",
|
|
248
263
|
type: "number",
|
|
@@ -257,38 +272,38 @@ function R({ meta: t, edit: n }) {
|
|
|
257
272
|
});
|
|
258
273
|
}
|
|
259
274
|
function z({ label: e, value: t, names: n, onChange: r }) {
|
|
260
|
-
return /* @__PURE__ */
|
|
275
|
+
return /* @__PURE__ */ E(o, {
|
|
261
276
|
value: t,
|
|
262
277
|
onValueChange: (e) => r(String(e)),
|
|
263
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ T(l, {
|
|
264
279
|
size: "sm",
|
|
265
280
|
"aria-label": e,
|
|
266
|
-
children: /* @__PURE__ */
|
|
267
|
-
}), /* @__PURE__ */
|
|
281
|
+
children: /* @__PURE__ */ T(u, { children: (e) => e })
|
|
282
|
+
}), /* @__PURE__ */ T(s, { children: n.map((e) => /* @__PURE__ */ T(c, {
|
|
268
283
|
value: e,
|
|
269
284
|
children: e
|
|
270
285
|
}, e)) })]
|
|
271
286
|
});
|
|
272
287
|
}
|
|
273
288
|
function B({ label: t, value: n, pages: r, anchors: i, none: a, onChange: d }) {
|
|
274
|
-
let { t: f } = e(), p = (e) => e ===
|
|
275
|
-
return /* @__PURE__ */
|
|
289
|
+
let { t: f } = e(), p = (e) => e === O ? a ?? "" : e.startsWith("anchor:") ? f("readerManifest.anchorNamed", { id: e.slice(7) }) : f("readerManifest.pageNamed", { name: e.slice(5) });
|
|
290
|
+
return /* @__PURE__ */ E(o, {
|
|
276
291
|
value: n,
|
|
277
292
|
onValueChange: (e) => d(String(e)),
|
|
278
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ T(l, {
|
|
279
294
|
size: "sm",
|
|
280
295
|
"aria-label": t,
|
|
281
|
-
children: /* @__PURE__ */
|
|
282
|
-
}), /* @__PURE__ */
|
|
283
|
-
a !== void 0 && /* @__PURE__ */
|
|
284
|
-
value:
|
|
296
|
+
children: /* @__PURE__ */ T(u, { children: p })
|
|
297
|
+
}), /* @__PURE__ */ E(s, { children: [
|
|
298
|
+
a !== void 0 && /* @__PURE__ */ T(c, {
|
|
299
|
+
value: O,
|
|
285
300
|
children: a
|
|
286
301
|
}),
|
|
287
|
-
i.map((e) => /* @__PURE__ */
|
|
302
|
+
i.map((e) => /* @__PURE__ */ T(c, {
|
|
288
303
|
value: `anchor:${e}`,
|
|
289
304
|
children: p(`anchor:${e}`)
|
|
290
305
|
}, `a-${e}`)),
|
|
291
|
-
r.map((e) => /* @__PURE__ */
|
|
306
|
+
r.map((e) => /* @__PURE__ */ T(c, {
|
|
292
307
|
value: `page:${e}`,
|
|
293
308
|
children: p(`page:${e}`)
|
|
294
309
|
}, `p-${e}`))
|
|
@@ -297,7 +312,7 @@ function B({ label: t, value: n, pages: r, anchors: i, none: a, onChange: d }) {
|
|
|
297
312
|
}
|
|
298
313
|
function V({ label: t, onRemove: n }) {
|
|
299
314
|
let { t: i } = e();
|
|
300
|
-
return /* @__PURE__ */
|
|
315
|
+
return /* @__PURE__ */ T(r, {
|
|
301
316
|
type: "button",
|
|
302
317
|
size: "sm",
|
|
303
318
|
variant: "ghost",
|
|
@@ -308,11 +323,11 @@ function V({ label: t, onRemove: n }) {
|
|
|
308
323
|
}
|
|
309
324
|
function H({ index: t, anchor: n, pages: r, onChange: a, onRemove: o }) {
|
|
310
325
|
let { t: s } = e(), c = t + 1;
|
|
311
|
-
return /* @__PURE__ */
|
|
326
|
+
return /* @__PURE__ */ E("div", {
|
|
312
327
|
className: "flex flex-wrap items-center gap-2",
|
|
313
328
|
"data-ckui": "reader-anchor",
|
|
314
329
|
children: [
|
|
315
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ T(i, {
|
|
316
331
|
className: "h-8 w-28",
|
|
317
332
|
"aria-label": s("readerManifest.anchorId", { n: c }),
|
|
318
333
|
value: n.id,
|
|
@@ -321,7 +336,7 @@ function H({ index: t, anchor: n, pages: r, onChange: a, onRemove: o }) {
|
|
|
321
336
|
id: e.target.value
|
|
322
337
|
})
|
|
323
338
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ T(z, {
|
|
325
340
|
label: s("readerManifest.anchorPage", { n: c }),
|
|
326
341
|
value: n.page,
|
|
327
342
|
names: r,
|
|
@@ -330,7 +345,7 @@ function H({ index: t, anchor: n, pages: r, onChange: a, onRemove: o }) {
|
|
|
330
345
|
page: e
|
|
331
346
|
})
|
|
332
347
|
}),
|
|
333
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ T(i, {
|
|
334
349
|
className: "h-8 w-24",
|
|
335
350
|
type: "number",
|
|
336
351
|
min: 0,
|
|
@@ -343,7 +358,7 @@ function H({ index: t, anchor: n, pages: r, onChange: a, onRemove: o }) {
|
|
|
343
358
|
offset_percent: j(e.target.value)
|
|
344
359
|
})
|
|
345
360
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ T(i, {
|
|
347
362
|
className: "h-8 w-28",
|
|
348
363
|
type: "number",
|
|
349
364
|
min: 0,
|
|
@@ -356,7 +371,7 @@ function H({ index: t, anchor: n, pages: r, onChange: a, onRemove: o }) {
|
|
|
356
371
|
duration_seconds: e.target.value.trim() === "" ? void 0 : j(e.target.value)
|
|
357
372
|
})
|
|
358
373
|
}),
|
|
359
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ T(V, {
|
|
360
375
|
label: s("readerManifest.removeAnchor", { n: c }),
|
|
361
376
|
onRemove: o
|
|
362
377
|
})
|
|
@@ -365,11 +380,11 @@ function H({ index: t, anchor: n, pages: r, onChange: a, onRemove: o }) {
|
|
|
365
380
|
}
|
|
366
381
|
function U({ index: t, cue: n, names: r, anchors: i, onChange: a, onRemove: o }) {
|
|
367
382
|
let { t: s } = e(), c = t + 1;
|
|
368
|
-
return /* @__PURE__ */
|
|
383
|
+
return /* @__PURE__ */ E("div", {
|
|
369
384
|
className: "flex flex-wrap items-center gap-2",
|
|
370
385
|
"data-ckui": "reader-foreground",
|
|
371
386
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ T(z, {
|
|
373
388
|
label: s("readerManifest.cueFile", { n: c }),
|
|
374
389
|
value: n.file,
|
|
375
390
|
names: r.files,
|
|
@@ -378,17 +393,17 @@ function U({ index: t, cue: n, names: r, anchors: i, onChange: a, onRemove: o })
|
|
|
378
393
|
file: e
|
|
379
394
|
})
|
|
380
395
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ T(B, {
|
|
382
397
|
label: s("readerManifest.cueAt", { n: c }),
|
|
383
|
-
value:
|
|
398
|
+
value: k(n.page, n.anchor),
|
|
384
399
|
pages: r.pages,
|
|
385
400
|
anchors: i,
|
|
386
401
|
onChange: (e) => a({
|
|
387
402
|
file: n.file,
|
|
388
|
-
...
|
|
403
|
+
...A(e)
|
|
389
404
|
})
|
|
390
405
|
}),
|
|
391
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ T(V, {
|
|
392
407
|
label: s("readerManifest.removeCue", { n: c }),
|
|
393
408
|
onRemove: o
|
|
394
409
|
})
|
|
@@ -396,7 +411,7 @@ function U({ index: t, cue: n, names: r, anchors: i, onChange: a, onRemove: o })
|
|
|
396
411
|
});
|
|
397
412
|
}
|
|
398
413
|
function W({ index: t, cue: n, names: r, anchors: a, onChange: o, onRemove: s }) {
|
|
399
|
-
let { t: c } = e(), l = t + 1, u = k(
|
|
414
|
+
let { t: c } = e(), l = t + 1, u = A(k(n.from_page, n.from_anchor)), d = A(k(n.to_page, n.to_anchor)), f = (e, t) => o({
|
|
400
415
|
file: n.file,
|
|
401
416
|
loop: n.loop,
|
|
402
417
|
layer: n.layer,
|
|
@@ -405,11 +420,11 @@ function W({ index: t, cue: n, names: r, anchors: a, onChange: o, onRemove: s })
|
|
|
405
420
|
to_page: t.page,
|
|
406
421
|
to_anchor: t.anchor
|
|
407
422
|
});
|
|
408
|
-
return /* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ E("div", {
|
|
409
424
|
className: "flex flex-wrap items-center gap-2",
|
|
410
425
|
"data-ckui": "reader-background",
|
|
411
426
|
children: [
|
|
412
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ T(z, {
|
|
413
428
|
label: c("readerManifest.trackFile", { n: l }),
|
|
414
429
|
value: n.file,
|
|
415
430
|
names: r.files,
|
|
@@ -418,25 +433,25 @@ function W({ index: t, cue: n, names: r, anchors: a, onChange: o, onRemove: s })
|
|
|
418
433
|
file: e
|
|
419
434
|
})
|
|
420
435
|
}),
|
|
421
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ T(B, {
|
|
422
437
|
label: c("readerManifest.trackFrom", { n: l }),
|
|
423
438
|
none: c("readerManifest.start"),
|
|
424
|
-
value:
|
|
439
|
+
value: k(n.from_page, n.from_anchor),
|
|
425
440
|
pages: r.pages,
|
|
426
441
|
anchors: a,
|
|
427
|
-
onChange: (e) => f(
|
|
442
|
+
onChange: (e) => f(A(e), d)
|
|
428
443
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ T(B, {
|
|
430
445
|
label: c("readerManifest.trackTo", { n: l }),
|
|
431
446
|
none: c("readerManifest.end"),
|
|
432
|
-
value:
|
|
447
|
+
value: k(n.to_page, n.to_anchor),
|
|
433
448
|
pages: r.pages,
|
|
434
449
|
anchors: a,
|
|
435
|
-
onChange: (e) => f(u,
|
|
450
|
+
onChange: (e) => f(u, A(e))
|
|
436
451
|
}),
|
|
437
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ E("label", {
|
|
438
453
|
className: "flex items-center gap-1.5",
|
|
439
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ T(m, {
|
|
440
455
|
size: "sm",
|
|
441
456
|
checked: !!n.loop,
|
|
442
457
|
onCheckedChange: (e) => o({
|
|
@@ -446,7 +461,7 @@ function W({ index: t, cue: n, names: r, anchors: a, onChange: o, onRemove: s })
|
|
|
446
461
|
"aria-label": c("readerManifest.loopN", { n: l })
|
|
447
462
|
}), c("readerManifest.loop")]
|
|
448
463
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ T(i, {
|
|
450
465
|
className: "h-8 w-28",
|
|
451
466
|
"aria-label": c("readerManifest.layer", { n: l }),
|
|
452
467
|
placeholder: c("readerManifest.layerPlaceholder"),
|
|
@@ -456,7 +471,7 @@ function W({ index: t, cue: n, names: r, anchors: a, onChange: o, onRemove: s })
|
|
|
456
471
|
layer: e.target.value || void 0
|
|
457
472
|
})
|
|
458
473
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ T(V, {
|
|
460
475
|
label: c("readerManifest.removeTrack", { n: l }),
|
|
461
476
|
onRemove: s
|
|
462
477
|
})
|
|
@@ -465,23 +480,23 @@ function W({ index: t, cue: n, names: r, anchors: a, onChange: o, onRemove: s })
|
|
|
465
480
|
}
|
|
466
481
|
function G({ match: t }) {
|
|
467
482
|
let { t: n } = e();
|
|
468
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ E("div", {
|
|
469
484
|
className: "grid gap-1 rounded-md bg-muted p-2 text-xs",
|
|
470
485
|
role: "status",
|
|
471
486
|
children: [
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
t.unmatchedPages.length > 0 && /* @__PURE__ */
|
|
474
|
-
t.unmatchedFiles.length > 0 && /* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ T("p", { children: t.foreground.length ? n("readerManifest.matched", { count: t.foreground.length }) : n("readerManifest.matchedNone") }),
|
|
488
|
+
t.unmatchedPages.length > 0 && /* @__PURE__ */ T("p", { children: n("readerManifest.pagesWithoutAudio", { names: t.unmatchedPages.join(", ") }) }),
|
|
489
|
+
t.unmatchedFiles.length > 0 && /* @__PURE__ */ T("p", { children: n("readerManifest.audioWithoutPlace", { names: t.unmatchedFiles.join(", ") }) })
|
|
475
490
|
]
|
|
476
491
|
});
|
|
477
492
|
}
|
|
478
493
|
function K({ problems: t }) {
|
|
479
494
|
let { t: n } = e(), r = (e) => n(`readerManifest.at_${e.at}`, { n: e.index + 1 });
|
|
480
|
-
return /* @__PURE__ */
|
|
495
|
+
return /* @__PURE__ */ T("ul", {
|
|
481
496
|
className: "grid gap-0.5 text-destructive",
|
|
482
497
|
role: "alert",
|
|
483
498
|
"data-ckui": "reader-problems",
|
|
484
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
499
|
+
children: t.map((e, t) => /* @__PURE__ */ T("li", { children: n(`readerManifest.problem_${e.problem}`, { where: r(e) }) }, t))
|
|
485
500
|
});
|
|
486
501
|
}
|
|
487
502
|
//#endregion
|