@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
|
@@ -4,557 +4,599 @@ import { useContentKitClient as n, useErrorReporter as r } from "../../react/con
|
|
|
4
4
|
import { keyOf as i, useContentScope as a, usePaged as o } from "../../react/use-resource.js";
|
|
5
5
|
import { useKinds as s } from "../../react/groups.js";
|
|
6
6
|
import { Alert as c, AlertDescription as l } from "../../ui/alert.js";
|
|
7
|
-
import { Button as u, buttonVariants as
|
|
8
|
-
import { Badge as
|
|
9
|
-
import { Input as
|
|
10
|
-
import { Label as
|
|
11
|
-
import { Select as
|
|
12
|
-
import { Skeleton as
|
|
13
|
-
import { Textarea as
|
|
14
|
-
import { ErrorLine as
|
|
15
|
-
import { AdminRoot as
|
|
16
|
-
import { localInput as
|
|
17
|
-
import { imageRefs as
|
|
18
|
-
import { useAdminLocation as
|
|
19
|
-
import { ContentSections as
|
|
20
|
-
import { useContent as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
7
|
+
import { Button as u, buttonVariants as d } from "../../ui/button.js";
|
|
8
|
+
import { Badge as f } from "../../ui/badge.js";
|
|
9
|
+
import { Input as p } from "../../ui/input.js";
|
|
10
|
+
import { Label as m } from "../../ui/label.js";
|
|
11
|
+
import { Select as ee, SelectContent as te, SelectItem as h, SelectTrigger as ne, SelectValue as re } from "../../ui/select.js";
|
|
12
|
+
import { Skeleton as g } from "../../ui/skeleton.js";
|
|
13
|
+
import { Textarea as _ } from "../../ui/textarea.js";
|
|
14
|
+
import { ErrorLine as ie, RelativeTime as v, contentError as y, formatDate as ae, useAction as oe } from "../social/parts.js";
|
|
15
|
+
import { AdminRoot as b, LoadFailed as x, NoAccess as S, Pager as se, Rows as C, pageOf as ce, useConfirm as le } from "./shell.js";
|
|
16
|
+
import { localInput as w } from "../social/bans.js";
|
|
17
|
+
import { imageRefs as T } from "../../client/contents.js";
|
|
18
|
+
import { useAdminLocation as E, useFlowClient as D, useStaffAccess as O } from "../../react/admin.js";
|
|
19
|
+
import { ContentSections as k } from "../content/editors.js";
|
|
20
|
+
import { useContent as A } from "../../react/contents.js";
|
|
21
|
+
import { ReaderContentEditor as j } from "./reader-content-editor.js";
|
|
22
|
+
import { useEffect as ue, useId as de, useMemo as fe, useRef as M, useState as N } from "react";
|
|
23
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
23
24
|
//#region src/components/admin/content-manager.tsx
|
|
24
|
-
function
|
|
25
|
-
return
|
|
25
|
+
function L(e = {}) {
|
|
26
|
+
return O(["contents"], e);
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function R(e) {
|
|
28
29
|
return e.moderation === "rejected" ? "rejected" : e.moderation === "held" ? "held" : e.state === "draft" ? "draft" : e.live ? "published" : "scheduled";
|
|
29
30
|
}
|
|
30
|
-
var
|
|
31
|
+
var pe = (e) => (e ?? []).map((e) => typeof e == "string" ? {
|
|
31
32
|
value: e,
|
|
32
33
|
label: e
|
|
33
|
-
} : e),
|
|
34
|
+
} : e), me = {
|
|
34
35
|
published: "default",
|
|
35
36
|
scheduled: "secondary",
|
|
36
37
|
draft: "outline",
|
|
37
38
|
held: "secondary",
|
|
38
39
|
rejected: "destructive"
|
|
39
|
-
},
|
|
40
|
+
}, z = [
|
|
40
41
|
"draft",
|
|
41
42
|
"scheduled",
|
|
42
43
|
"published"
|
|
43
44
|
];
|
|
44
|
-
function
|
|
45
|
-
let l =
|
|
45
|
+
function B({ client: e, baseUrl: t, auth: n, guard: r, appearance: i, className: a, language: o, messages: s, ...c }) {
|
|
46
|
+
let l = D({
|
|
46
47
|
client: e,
|
|
47
48
|
baseUrl: t,
|
|
48
49
|
auth: n
|
|
49
50
|
});
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ F(b, {
|
|
51
52
|
flow: "content-manager",
|
|
52
53
|
appearance: i,
|
|
53
54
|
className: a,
|
|
54
55
|
language: o,
|
|
55
56
|
messages: s,
|
|
56
57
|
guard: r,
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ F(V, {
|
|
58
59
|
...c,
|
|
59
60
|
client: l
|
|
60
61
|
})
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
let { t: i } = t(), a =
|
|
65
|
-
return o.loading ? /* @__PURE__ */
|
|
64
|
+
function V({ basePath: e, navigation: n, ...r }) {
|
|
65
|
+
let { t: i } = t(), a = E(e, n), o = L({ client: r.client });
|
|
66
|
+
return o.loading ? /* @__PURE__ */ F(C, {}) : o.allowed.contents ? a.view ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(u, {
|
|
66
67
|
variant: "ghost",
|
|
67
68
|
size: "sm",
|
|
68
69
|
className: "justify-self-start",
|
|
69
70
|
onClick: () => a.go(""),
|
|
70
71
|
children: i("contentManager.back")
|
|
71
|
-
}), /* @__PURE__ */
|
|
72
|
+
}), /* @__PURE__ */ F(W, {
|
|
72
73
|
management: !0,
|
|
73
74
|
...r,
|
|
74
75
|
id: a.view === "new" ? null : a.view,
|
|
75
76
|
onCreated: (e) => a.go(e.id, void 0, { replace: !0 }),
|
|
76
77
|
onDeleted: () => a.go("", void 0, { replace: !0 })
|
|
77
|
-
}
|
|
78
|
+
})] }) : /* @__PURE__ */ F(H, {
|
|
78
79
|
...r,
|
|
79
80
|
loc: a
|
|
80
|
-
}) : /* @__PURE__ */
|
|
81
|
+
}) : /* @__PURE__ */ F(S, { children: i("contentManager.noAccess") });
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
let
|
|
84
|
-
q:
|
|
85
|
-
status:
|
|
86
|
-
deleted:
|
|
87
|
-
},
|
|
88
|
-
...
|
|
83
|
+
function H({ loc: e, client: n, kind: r, languages: s, contentHref: c, pageSize: l = 20, onError: g }) {
|
|
84
|
+
let _ = t(), { t: y } = _, b = de(), S = pe(s)[0]?.value, w = e.query.get("q") ?? "", T = z.find((t) => t === e.query.get("status")) ?? "", E = e.query.get("deleted") === "1", D = ce(e.query), O = {
|
|
85
|
+
q: w,
|
|
86
|
+
status: T,
|
|
87
|
+
deleted: E ? "1" : void 0
|
|
88
|
+
}, k = (t) => e.go("", {
|
|
89
|
+
...O,
|
|
89
90
|
...t
|
|
90
|
-
}), [
|
|
91
|
-
|
|
92
|
-
let { store:
|
|
91
|
+
}), [A, j] = N(w);
|
|
92
|
+
ue(() => j(w), [w]);
|
|
93
|
+
let { store: fe, scope: M } = a(n), L = E ? "deleted" : T || void 0, B = o(fe, i("contents-page", M, r, w, L, l), {
|
|
93
94
|
type: "contents",
|
|
94
|
-
scope:
|
|
95
|
-
},
|
|
95
|
+
scope: E ? "deleted" : void 0
|
|
96
|
+
}, D, l, (e, t) => n.contents.manage({
|
|
96
97
|
...e,
|
|
97
98
|
kind: r,
|
|
98
|
-
q:
|
|
99
|
+
q: w || void 0,
|
|
99
100
|
state: L,
|
|
100
|
-
language:
|
|
101
|
-
}, t)),
|
|
102
|
-
await
|
|
103
|
-
title:
|
|
104
|
-
description:
|
|
105
|
-
confirm:
|
|
106
|
-
}) && await
|
|
101
|
+
language: S
|
|
102
|
+
}, t)), V = oe("content.save", g), { confirm: H, dialog: U } = le(), W = async (e) => {
|
|
103
|
+
await H({
|
|
104
|
+
title: y("contentManager.deleteTitle", { title: e.title }),
|
|
105
|
+
description: y("contentManager.deleteBody"),
|
|
106
|
+
confirm: y("contentManager.delete")
|
|
107
|
+
}) && await V.run(() => n.contents.remove(e.id));
|
|
107
108
|
};
|
|
108
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ I("div", {
|
|
109
110
|
className: "grid gap-4",
|
|
110
111
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ I("div", {
|
|
112
113
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
113
|
-
children: [/* @__PURE__ */
|
|
114
|
+
children: [/* @__PURE__ */ F("h2", {
|
|
114
115
|
className: "text-base font-semibold",
|
|
115
|
-
children:
|
|
116
|
-
}), /* @__PURE__ */
|
|
116
|
+
children: y("contentManager.title")
|
|
117
|
+
}), /* @__PURE__ */ F(u, {
|
|
117
118
|
size: "sm",
|
|
118
119
|
onClick: () => e.go("new"),
|
|
119
|
-
children:
|
|
120
|
+
children: y("contentManager.new")
|
|
120
121
|
})]
|
|
121
122
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ I("div", {
|
|
123
124
|
className: "flex gap-2",
|
|
124
125
|
role: "group",
|
|
125
|
-
"aria-label":
|
|
126
|
-
children: [/* @__PURE__ */
|
|
126
|
+
"aria-label": y("contentManager.title"),
|
|
127
|
+
children: [/* @__PURE__ */ F(u, {
|
|
127
128
|
size: "sm",
|
|
128
|
-
variant:
|
|
129
|
-
"aria-pressed": !
|
|
130
|
-
onClick: () => e.go("", { q:
|
|
131
|
-
children:
|
|
132
|
-
}), /* @__PURE__ */
|
|
129
|
+
variant: E ? "outline" : "default",
|
|
130
|
+
"aria-pressed": !E,
|
|
131
|
+
onClick: () => e.go("", { q: w }),
|
|
132
|
+
children: y("contentManager.items")
|
|
133
|
+
}), /* @__PURE__ */ F(u, {
|
|
133
134
|
size: "sm",
|
|
134
|
-
variant:
|
|
135
|
-
"aria-pressed":
|
|
135
|
+
variant: E ? "default" : "outline",
|
|
136
|
+
"aria-pressed": E,
|
|
136
137
|
onClick: () => e.go("", {
|
|
137
|
-
q:
|
|
138
|
+
q: w,
|
|
138
139
|
deleted: "1"
|
|
139
140
|
}),
|
|
140
|
-
children:
|
|
141
|
+
children: y("contentManager.deleted")
|
|
141
142
|
})]
|
|
142
143
|
}),
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ I("div", {
|
|
144
145
|
className: "grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto]",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ I("form", {
|
|
146
147
|
className: "flex gap-2",
|
|
147
148
|
role: "search",
|
|
148
149
|
onSubmit: (e) => {
|
|
149
|
-
e.preventDefault(),
|
|
150
|
+
e.preventDefault(), k({ q: A.trim() });
|
|
150
151
|
},
|
|
151
152
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
htmlFor: `${
|
|
153
|
+
/* @__PURE__ */ F(m, {
|
|
154
|
+
htmlFor: `${b}-q`,
|
|
154
155
|
className: "sr-only",
|
|
155
|
-
children:
|
|
156
|
+
children: y("contentManager.search")
|
|
156
157
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
id: `${
|
|
158
|
+
/* @__PURE__ */ F(p, {
|
|
159
|
+
id: `${b}-q`,
|
|
159
160
|
className: "h-8",
|
|
160
161
|
type: "search",
|
|
161
|
-
value:
|
|
162
|
-
placeholder:
|
|
163
|
-
onChange: (e) =>
|
|
162
|
+
value: A,
|
|
163
|
+
placeholder: y("contentManager.search"),
|
|
164
|
+
onChange: (e) => j(e.target.value)
|
|
164
165
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ F(u, {
|
|
166
167
|
type: "submit",
|
|
167
168
|
size: "sm",
|
|
168
169
|
variant: "outline",
|
|
169
|
-
children:
|
|
170
|
+
children: y("moderation.filter")
|
|
170
171
|
})
|
|
171
172
|
]
|
|
172
|
-
}), !
|
|
173
|
-
value:
|
|
174
|
-
onValueChange: (e) =>
|
|
175
|
-
children: [/* @__PURE__ */
|
|
173
|
+
}), !E && /* @__PURE__ */ I(ee, {
|
|
174
|
+
value: T,
|
|
175
|
+
onValueChange: (e) => k({ status: String(e ?? "") }),
|
|
176
|
+
children: [/* @__PURE__ */ F(ne, {
|
|
176
177
|
size: "sm",
|
|
177
|
-
"aria-label":
|
|
178
|
-
children: /* @__PURE__ */
|
|
179
|
-
}), /* @__PURE__ */
|
|
178
|
+
"aria-label": y("contentManager.status"),
|
|
179
|
+
children: /* @__PURE__ */ F(re, { children: (e) => y(e ? `contentManager.${e}` : "contentManager.allStatuses") })
|
|
180
|
+
}), /* @__PURE__ */ I(te, { children: [/* @__PURE__ */ F(h, {
|
|
180
181
|
value: "",
|
|
181
|
-
children:
|
|
182
|
-
}),
|
|
182
|
+
children: y("contentManager.allStatuses")
|
|
183
|
+
}), z.map((e) => /* @__PURE__ */ F(h, {
|
|
183
184
|
value: e,
|
|
184
|
-
children:
|
|
185
|
+
children: y(`contentManager.${e}`)
|
|
185
186
|
}, e))] })]
|
|
186
187
|
})]
|
|
187
188
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
|
|
190
|
-
error:
|
|
191
|
-
message:
|
|
192
|
-
retry:
|
|
193
|
-
}) :
|
|
189
|
+
/* @__PURE__ */ F(ie, { error: V.error }),
|
|
190
|
+
B.loading && !B.items.length ? /* @__PURE__ */ F(C, {}) : B.error && !B.items.length ? /* @__PURE__ */ F(x, {
|
|
191
|
+
error: B.error,
|
|
192
|
+
message: y("contentManager.loadFailed"),
|
|
193
|
+
retry: B.reload
|
|
194
|
+
}) : B.items.length ? /* @__PURE__ */ F("ul", {
|
|
194
195
|
className: "grid divide-y divide-border rounded-lg border border-border",
|
|
195
|
-
"aria-busy":
|
|
196
|
-
children:
|
|
197
|
-
let r =
|
|
198
|
-
return /* @__PURE__ */
|
|
196
|
+
"aria-busy": B.loading,
|
|
197
|
+
children: B.items.map((t) => {
|
|
198
|
+
let r = R(t), i = r === "published" ? c?.(t) : void 0;
|
|
199
|
+
return /* @__PURE__ */ I("li", {
|
|
199
200
|
className: "flex flex-wrap items-start gap-3 p-3",
|
|
200
201
|
"data-ckui": "content-row",
|
|
201
|
-
"data-status":
|
|
202
|
-
children: [/* @__PURE__ */
|
|
202
|
+
"data-status": E ? "deleted" : r,
|
|
203
|
+
children: [/* @__PURE__ */ I("div", {
|
|
203
204
|
className: "grid min-w-0 flex-1 gap-1",
|
|
204
|
-
children: [
|
|
205
|
+
children: [E ? /* @__PURE__ */ F("span", {
|
|
205
206
|
className: "font-medium break-words",
|
|
206
207
|
children: t.title
|
|
207
|
-
}) : /* @__PURE__ */
|
|
208
|
+
}) : /* @__PURE__ */ F("button", {
|
|
208
209
|
type: "button",
|
|
209
210
|
className: "text-left font-medium break-words hover:underline",
|
|
210
211
|
onClick: () => e.go(t.id),
|
|
211
212
|
children: t.title
|
|
212
|
-
}), /* @__PURE__ */
|
|
213
|
+
}), /* @__PURE__ */ I("div", {
|
|
213
214
|
className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground",
|
|
214
215
|
children: [
|
|
215
|
-
!
|
|
216
|
-
variant:
|
|
217
|
-
children:
|
|
216
|
+
!E && /* @__PURE__ */ F(f, {
|
|
217
|
+
variant: me[r],
|
|
218
|
+
children: y(`contentManager.${r}`)
|
|
218
219
|
}),
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
r === "scheduled" && t.publish_at && /* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ F("span", { children: t.language }),
|
|
221
|
+
/* @__PURE__ */ F(v, { at: E && t.deleted_at ? t.deleted_at : t.updated_at }),
|
|
222
|
+
r === "scheduled" && t.publish_at && /* @__PURE__ */ F("span", { children: y("pollManager.goesLive", { date: ae(_, t.publish_at) }) })
|
|
222
223
|
]
|
|
223
224
|
})]
|
|
224
|
-
}), /* @__PURE__ */
|
|
225
|
+
}), /* @__PURE__ */ F("div", {
|
|
225
226
|
className: "flex flex-wrap gap-2",
|
|
226
|
-
children:
|
|
227
|
+
children: E ? /* @__PURE__ */ F(u, {
|
|
227
228
|
size: "sm",
|
|
228
229
|
variant: "outline",
|
|
229
|
-
disabled:
|
|
230
|
-
onClick: () => void
|
|
231
|
-
children:
|
|
232
|
-
}) : /* @__PURE__ */
|
|
233
|
-
i && /* @__PURE__ */
|
|
234
|
-
className:
|
|
230
|
+
disabled: V.pending,
|
|
231
|
+
onClick: () => void V.run(() => n.contents.restore(t.id)),
|
|
232
|
+
children: y("moderation.restore")
|
|
233
|
+
}) : /* @__PURE__ */ I(P, { children: [
|
|
234
|
+
i && /* @__PURE__ */ F("a", {
|
|
235
|
+
className: d({
|
|
235
236
|
size: "sm",
|
|
236
237
|
variant: "ghost"
|
|
237
238
|
}),
|
|
238
239
|
href: i,
|
|
239
|
-
children:
|
|
240
|
+
children: y("contentManager.view")
|
|
240
241
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ F(u, {
|
|
242
243
|
size: "sm",
|
|
243
244
|
variant: "outline",
|
|
244
245
|
onClick: () => e.go(t.id),
|
|
245
|
-
children:
|
|
246
|
+
children: y("comments.edit")
|
|
246
247
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ F(u, {
|
|
248
249
|
size: "sm",
|
|
249
250
|
variant: "destructive",
|
|
250
|
-
disabled:
|
|
251
|
-
onClick: () => void
|
|
252
|
-
children:
|
|
251
|
+
disabled: V.pending,
|
|
252
|
+
onClick: () => void W(t),
|
|
253
|
+
children: y("comments.delete")
|
|
253
254
|
})
|
|
254
255
|
] })
|
|
255
256
|
})]
|
|
256
257
|
}, t.id);
|
|
257
258
|
})
|
|
258
|
-
}) : /* @__PURE__ */
|
|
259
|
+
}) : /* @__PURE__ */ F("p", {
|
|
259
260
|
className: "text-muted-foreground",
|
|
260
|
-
children:
|
|
261
|
+
children: y(E ? "contentManager.noDeleted" : "contentManager.empty")
|
|
261
262
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
page:
|
|
264
|
-
hasNext:
|
|
265
|
-
disabled:
|
|
263
|
+
/* @__PURE__ */ F(se, {
|
|
264
|
+
page: D,
|
|
265
|
+
hasNext: B.hasNext,
|
|
266
|
+
disabled: B.loading,
|
|
266
267
|
onPage: (t) => e.go("", {
|
|
267
|
-
...
|
|
268
|
+
...O,
|
|
268
269
|
page: t > 1 ? t : void 0
|
|
269
270
|
})
|
|
270
271
|
}),
|
|
271
|
-
|
|
272
|
+
U
|
|
272
273
|
]
|
|
273
274
|
});
|
|
274
275
|
}
|
|
275
|
-
var
|
|
276
|
+
var U = {
|
|
276
277
|
title: "",
|
|
277
278
|
slug: "",
|
|
278
279
|
description: "",
|
|
279
280
|
publishAt: "",
|
|
280
281
|
body: ""
|
|
281
282
|
};
|
|
282
|
-
function
|
|
283
|
-
let
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
function W(e) {
|
|
284
|
+
let { client: n, scope: r } = a(e.client), [i, o] = N({
|
|
285
|
+
id: e.id,
|
|
286
|
+
kind: e.kind,
|
|
287
|
+
client: n,
|
|
288
|
+
scope: r,
|
|
289
|
+
key: 0,
|
|
290
|
+
allocated: null
|
|
291
|
+
}), c = i;
|
|
292
|
+
if (i.id !== e.id || i.kind !== e.kind || i.client !== n || i.scope !== r) {
|
|
293
|
+
let t = i.id == null && e.id === i.allocated && i.kind === e.kind && i.client === n && i.scope === r;
|
|
294
|
+
c = {
|
|
295
|
+
id: e.id,
|
|
296
|
+
kind: e.kind,
|
|
297
|
+
client: n,
|
|
298
|
+
scope: r,
|
|
299
|
+
key: t ? i.key : i.key + 1,
|
|
300
|
+
allocated: null
|
|
301
|
+
}, o(c);
|
|
302
|
+
}
|
|
303
|
+
let { kinds: l, error: u, reload: d } = s({ client: n }), { t: f } = t();
|
|
304
|
+
if (!l) return u ? /* @__PURE__ */ F(x, {
|
|
305
|
+
error: u,
|
|
306
|
+
message: f("contentManager.loadFailed"),
|
|
307
|
+
retry: d
|
|
308
|
+
}) : /* @__PURE__ */ F(C, {});
|
|
309
|
+
let p = {
|
|
310
|
+
...e,
|
|
311
|
+
client: n,
|
|
312
|
+
onCreated: (t) => {
|
|
313
|
+
o((e) => ({
|
|
314
|
+
...e,
|
|
315
|
+
allocated: t.id
|
|
316
|
+
})), e.onCreated?.(t);
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
return l.kinds[e.kind]?.presentation === "reader" ? /* @__PURE__ */ F(j, {
|
|
320
|
+
...p,
|
|
321
|
+
model: l
|
|
322
|
+
}, c.key) : /* @__PURE__ */ F(G, { ...p }, c.key);
|
|
323
|
+
}
|
|
324
|
+
function G({ id: i, client: a, kind: o, languages: d, renderEditor: v, contentHref: ae, labels: oe, ownerGroup: b, onCreated: S, onDeleted: se, onError: C, management: ce }) {
|
|
325
|
+
let E = n(a), D = t(), { t: O } = D, j = de(), M = pe(d), [L, z] = N(M[0]?.value ?? "en"), B = A(i, o, L, { client: E }), V = !!s({ client: E }).kinds?.kinds[o]?.versions.hidden, H = r(C), [W, G] = N(i ? null : U), [K, q] = N(null), [ge, J] = N(null), { confirm: _e, dialog: ve } = le(), Y = B.content;
|
|
326
|
+
ue(() => {
|
|
327
|
+
if (!Y) return;
|
|
328
|
+
let e = Y.text?.[L];
|
|
329
|
+
G((t) => t ?? {
|
|
288
330
|
title: e?.title ?? "",
|
|
289
331
|
slug: e?.slug ?? "",
|
|
290
332
|
description: e?.description ?? "",
|
|
291
333
|
body: e?.body ?? "",
|
|
292
|
-
publishAt:
|
|
334
|
+
publishAt: Y.publish_at && !Y.live ? w(new Date(Y.publish_at)) : ""
|
|
293
335
|
});
|
|
294
|
-
}, [
|
|
295
|
-
let { imageSrc:
|
|
296
|
-
let n =
|
|
336
|
+
}, [Y, L]);
|
|
337
|
+
let { imageSrc: ye } = B, be = fe(() => (W?.body ?? "").replace(T(), (e, t) => {
|
|
338
|
+
let n = ye(t);
|
|
297
339
|
return n && n !== t ? n.replaceAll("&", "&") : e;
|
|
298
|
-
}), [
|
|
299
|
-
if (i && !
|
|
300
|
-
error:
|
|
301
|
-
message:
|
|
302
|
-
retry:
|
|
303
|
-
}) : /* @__PURE__ */
|
|
340
|
+
}), [W?.body, ye]);
|
|
341
|
+
if (i && !W) return B.error ? /* @__PURE__ */ F(x, {
|
|
342
|
+
error: B.error,
|
|
343
|
+
message: O("contentManager.loadFailed"),
|
|
344
|
+
retry: B.reload
|
|
345
|
+
}) : /* @__PURE__ */ I("div", {
|
|
304
346
|
className: "grid gap-3",
|
|
305
347
|
"aria-busy": !0,
|
|
306
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ F(g, { className: "h-9 w-full" }), /* @__PURE__ */ F(g, { className: "h-48 w-full" })]
|
|
307
349
|
});
|
|
308
|
-
let
|
|
350
|
+
let X = W, Z = (e) => G((t) => ({
|
|
309
351
|
...t,
|
|
310
352
|
...e
|
|
311
|
-
})),
|
|
353
|
+
})), Q = (t) => {
|
|
312
354
|
let n = e(t);
|
|
313
|
-
|
|
314
|
-
},
|
|
315
|
-
title:
|
|
316
|
-
slug:
|
|
317
|
-
description:
|
|
318
|
-
body:
|
|
319
|
-
}),
|
|
320
|
-
if (
|
|
355
|
+
q(n), H(n, "content.save");
|
|
356
|
+
}, xe = () => ({
|
|
357
|
+
title: X.title.trim(),
|
|
358
|
+
slug: X.slug.trim() || void 0,
|
|
359
|
+
description: X.description.trim(),
|
|
360
|
+
body: X.body
|
|
361
|
+
}), Se = async () => {
|
|
362
|
+
if (q(null), J(null), !X.title.trim()) return q(O("contentManager.titleRequired"));
|
|
321
363
|
try {
|
|
322
|
-
if (!
|
|
323
|
-
let e = await
|
|
364
|
+
if (!Y) {
|
|
365
|
+
let e = await B.create({
|
|
324
366
|
kind: o,
|
|
325
|
-
text: { [
|
|
326
|
-
owner_group_id:
|
|
367
|
+
text: { [L]: xe() },
|
|
368
|
+
owner_group_id: b
|
|
327
369
|
});
|
|
328
|
-
|
|
370
|
+
S?.(e);
|
|
329
371
|
return;
|
|
330
372
|
}
|
|
331
|
-
let e = await
|
|
332
|
-
|
|
373
|
+
let e = await B.putText(xe());
|
|
374
|
+
J(O("pollEditor.saved")), G((t) => ({
|
|
333
375
|
...t,
|
|
334
|
-
slug: e.text?.[
|
|
376
|
+
slug: e.text?.[L]?.slug ?? t.slug
|
|
335
377
|
}));
|
|
336
378
|
} catch (e) {
|
|
337
|
-
|
|
379
|
+
Q(e);
|
|
338
380
|
}
|
|
339
|
-
},
|
|
340
|
-
|
|
381
|
+
}, Ce = async (e) => {
|
|
382
|
+
q(null), J(null);
|
|
341
383
|
try {
|
|
342
|
-
e ? await
|
|
384
|
+
e ? await B.publish(X.publishAt ? new Date(X.publishAt).toISOString() : void 0) : await B.unpublish(), J(O(e ? "contentManager.publishedNotice" : "contentManager.unpublishedNotice"));
|
|
343
385
|
} catch (e) {
|
|
344
|
-
|
|
386
|
+
Q(e);
|
|
345
387
|
}
|
|
346
|
-
},
|
|
347
|
-
if (
|
|
348
|
-
title:
|
|
349
|
-
description:
|
|
350
|
-
confirm:
|
|
388
|
+
}, we = async () => {
|
|
389
|
+
if (Y && await _e({
|
|
390
|
+
title: O("contentManager.deleteTitle", { title: Y.title }),
|
|
391
|
+
description: O("contentManager.deleteBody"),
|
|
392
|
+
confirm: O("contentManager.delete")
|
|
351
393
|
})) try {
|
|
352
|
-
await
|
|
394
|
+
await B.remove(), se?.(Y);
|
|
353
395
|
} catch (e) {
|
|
354
|
-
|
|
396
|
+
Q(e);
|
|
355
397
|
}
|
|
356
|
-
},
|
|
357
|
-
value:
|
|
358
|
-
onChange: (e) =>
|
|
359
|
-
uploadImage:
|
|
360
|
-
disabled:
|
|
361
|
-
placeholder:
|
|
362
|
-
"aria-label":
|
|
398
|
+
}, $ = Y ? R(Y) : "draft", Te = Y && $ === "published" ? ae?.(Y) : void 0, Ee = {
|
|
399
|
+
value: be,
|
|
400
|
+
onChange: (e) => Z({ body: B.storedBody(e) }),
|
|
401
|
+
uploadImage: Y ? (e) => B.uploadImage(e) : void 0,
|
|
402
|
+
disabled: B.saving,
|
|
403
|
+
placeholder: O("contentManager.bodyPlaceholder"),
|
|
404
|
+
"aria-label": O("contentManager.body")
|
|
363
405
|
};
|
|
364
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ I("form", {
|
|
365
407
|
className: "grid gap-4",
|
|
366
408
|
"data-ckui": "content-form",
|
|
367
409
|
onSubmit: (e) => {
|
|
368
|
-
e.preventDefault(),
|
|
410
|
+
e.preventDefault(), Se();
|
|
369
411
|
},
|
|
370
412
|
children: [
|
|
371
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ I("div", {
|
|
372
414
|
className: "flex flex-wrap items-center gap-2",
|
|
373
415
|
children: [
|
|
374
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ F("h2", {
|
|
375
417
|
className: "text-base font-semibold",
|
|
376
|
-
children:
|
|
418
|
+
children: O(Y ? "contentManager.editTitle" : "contentManager.newTitle")
|
|
377
419
|
}),
|
|
378
|
-
|
|
379
|
-
variant:
|
|
380
|
-
children:
|
|
420
|
+
Y && /* @__PURE__ */ F(f, {
|
|
421
|
+
variant: me[$],
|
|
422
|
+
children: O(`contentManager.${$}`)
|
|
381
423
|
}),
|
|
382
|
-
|
|
424
|
+
Te && /* @__PURE__ */ F("a", {
|
|
383
425
|
className: "text-xs text-muted-foreground hover:underline",
|
|
384
|
-
href:
|
|
385
|
-
children:
|
|
426
|
+
href: Te,
|
|
427
|
+
children: O("contentManager.view")
|
|
386
428
|
})
|
|
387
429
|
]
|
|
388
430
|
}),
|
|
389
|
-
|
|
390
|
-
variant:
|
|
391
|
-
children: /* @__PURE__ */
|
|
431
|
+
Y?.moderation && /* @__PURE__ */ F(c, {
|
|
432
|
+
variant: Y.moderation === "rejected" ? "destructive" : "default",
|
|
433
|
+
children: /* @__PURE__ */ F(l, { children: Y.moderation_reason ? O(`contentManager.${Y.moderation === "rejected" ? "rejectedBecause" : "heldBecause"}`, { reason: Y.moderation_reason }) : O(`contentManager.${Y.moderation === "rejected" ? "rejectedNote" : "heldNote"}`) })
|
|
392
434
|
}),
|
|
393
|
-
|
|
435
|
+
M.length > 1 && /* @__PURE__ */ I("div", {
|
|
394
436
|
className: "grid gap-1.5",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
396
|
-
htmlFor: `${
|
|
397
|
-
children:
|
|
398
|
-
}), /* @__PURE__ */
|
|
399
|
-
value:
|
|
437
|
+
children: [/* @__PURE__ */ F(m, {
|
|
438
|
+
htmlFor: `${j}-lang`,
|
|
439
|
+
children: O("contentManager.language")
|
|
440
|
+
}), /* @__PURE__ */ I(ee, {
|
|
441
|
+
value: L,
|
|
400
442
|
onValueChange: (e) => {
|
|
401
|
-
|
|
443
|
+
z(String(e ?? "")), G(Y ? null : U);
|
|
402
444
|
},
|
|
403
|
-
children: [/* @__PURE__ */
|
|
404
|
-
id: `${
|
|
445
|
+
children: [/* @__PURE__ */ F(ne, {
|
|
446
|
+
id: `${j}-lang`,
|
|
405
447
|
className: "w-full",
|
|
406
|
-
children: /* @__PURE__ */
|
|
407
|
-
}), /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ F(re, { children: (e) => M.find((t) => t.value === e)?.label ?? e })
|
|
449
|
+
}), /* @__PURE__ */ F(te, { children: M.map((e) => /* @__PURE__ */ F(h, {
|
|
408
450
|
value: e.value,
|
|
409
451
|
children: e.label
|
|
410
452
|
}, e.value)) })]
|
|
411
453
|
})]
|
|
412
454
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ I("div", {
|
|
414
456
|
className: "grid gap-1.5",
|
|
415
|
-
children: [/* @__PURE__ */
|
|
416
|
-
htmlFor: `${
|
|
417
|
-
children:
|
|
418
|
-
}), /* @__PURE__ */
|
|
419
|
-
id: `${
|
|
420
|
-
value:
|
|
457
|
+
children: [/* @__PURE__ */ F(m, {
|
|
458
|
+
htmlFor: `${j}-title`,
|
|
459
|
+
children: O("contentManager.itemTitle")
|
|
460
|
+
}), /* @__PURE__ */ F(p, {
|
|
461
|
+
id: `${j}-title`,
|
|
462
|
+
value: X.title,
|
|
421
463
|
required: !0,
|
|
422
464
|
maxLength: 300,
|
|
423
|
-
onChange: (e) =>
|
|
465
|
+
onChange: (e) => Z({ title: e.target.value })
|
|
424
466
|
})]
|
|
425
467
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ I("div", {
|
|
427
469
|
className: "grid gap-4 sm:grid-cols-2",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
470
|
+
children: [/* @__PURE__ */ I("div", {
|
|
429
471
|
className: "grid gap-1.5",
|
|
430
|
-
children: [/* @__PURE__ */
|
|
431
|
-
htmlFor: `${
|
|
432
|
-
children:
|
|
433
|
-
}), /* @__PURE__ */
|
|
434
|
-
id: `${
|
|
435
|
-
value:
|
|
436
|
-
placeholder:
|
|
437
|
-
onChange: (e) =>
|
|
472
|
+
children: [/* @__PURE__ */ F(m, {
|
|
473
|
+
htmlFor: `${j}-slug`,
|
|
474
|
+
children: O("contentManager.slug")
|
|
475
|
+
}), /* @__PURE__ */ F(p, {
|
|
476
|
+
id: `${j}-slug`,
|
|
477
|
+
value: X.slug,
|
|
478
|
+
placeholder: O("contentManager.slugAuto"),
|
|
479
|
+
onChange: (e) => Z({ slug: e.target.value })
|
|
438
480
|
})]
|
|
439
|
-
}), /* @__PURE__ */
|
|
481
|
+
}), /* @__PURE__ */ I("div", {
|
|
440
482
|
className: "grid gap-1.5",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
442
|
-
htmlFor: `${
|
|
443
|
-
children:
|
|
444
|
-
}), /* @__PURE__ */
|
|
445
|
-
id: `${
|
|
483
|
+
children: [/* @__PURE__ */ F(m, {
|
|
484
|
+
htmlFor: `${j}-publish`,
|
|
485
|
+
children: O("contentManager.publishAt")
|
|
486
|
+
}), /* @__PURE__ */ F(p, {
|
|
487
|
+
id: `${j}-publish`,
|
|
446
488
|
type: "datetime-local",
|
|
447
|
-
value:
|
|
448
|
-
onChange: (e) =>
|
|
489
|
+
value: X.publishAt,
|
|
490
|
+
onChange: (e) => Z({ publishAt: e.target.value })
|
|
449
491
|
})]
|
|
450
492
|
})]
|
|
451
493
|
}),
|
|
452
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ I("div", {
|
|
453
495
|
className: "grid gap-1.5",
|
|
454
|
-
children: [/* @__PURE__ */
|
|
455
|
-
htmlFor: `${
|
|
456
|
-
children:
|
|
457
|
-
}), /* @__PURE__ */
|
|
458
|
-
id: `${
|
|
496
|
+
children: [/* @__PURE__ */ F(m, {
|
|
497
|
+
htmlFor: `${j}-description`,
|
|
498
|
+
children: O("contentManager.description")
|
|
499
|
+
}), /* @__PURE__ */ F(_, {
|
|
500
|
+
id: `${j}-description`,
|
|
459
501
|
rows: 2,
|
|
460
|
-
value:
|
|
461
|
-
onChange: (e) =>
|
|
502
|
+
value: X.description,
|
|
503
|
+
onChange: (e) => Z({ description: e.target.value })
|
|
462
504
|
})]
|
|
463
505
|
}),
|
|
464
|
-
(
|
|
465
|
-
item:
|
|
466
|
-
src:
|
|
467
|
-
saving:
|
|
468
|
-
onFile: (e) => void
|
|
506
|
+
(V || !Y) && /* @__PURE__ */ F(he, {
|
|
507
|
+
item: Y,
|
|
508
|
+
src: B.coverSrc,
|
|
509
|
+
saving: B.saving,
|
|
510
|
+
onFile: (e) => void B.setCover(e).catch(Q)
|
|
469
511
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ I("div", {
|
|
471
513
|
className: "grid gap-1.5",
|
|
472
514
|
children: [
|
|
473
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ F("span", {
|
|
474
516
|
className: "text-sm font-medium",
|
|
475
|
-
children:
|
|
517
|
+
children: O("contentManager.body")
|
|
476
518
|
}),
|
|
477
|
-
|
|
478
|
-
"aria-label":
|
|
519
|
+
v ? v(Ee) : /* @__PURE__ */ F(_, {
|
|
520
|
+
"aria-label": Ee["aria-label"],
|
|
479
521
|
rows: 12,
|
|
480
|
-
value:
|
|
481
|
-
placeholder:
|
|
482
|
-
onChange: (e) =>
|
|
522
|
+
value: X.body,
|
|
523
|
+
placeholder: Ee.placeholder,
|
|
524
|
+
onChange: (e) => Z({ body: e.target.value })
|
|
483
525
|
}),
|
|
484
|
-
!
|
|
526
|
+
!Y && /* @__PURE__ */ F("p", {
|
|
485
527
|
className: "text-xs text-muted-foreground",
|
|
486
|
-
children:
|
|
528
|
+
children: O("contentManager.imagesAfterCreate")
|
|
487
529
|
})
|
|
488
530
|
]
|
|
489
531
|
}),
|
|
490
|
-
|
|
491
|
-
|
|
532
|
+
K && /* @__PURE__ */ F(ie, { children: typeof K == "string" ? K : y(D, K) }),
|
|
533
|
+
ge && !K && /* @__PURE__ */ F("p", {
|
|
492
534
|
role: "status",
|
|
493
535
|
className: "text-sm text-muted-foreground",
|
|
494
|
-
children:
|
|
536
|
+
children: ge
|
|
495
537
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ I("div", {
|
|
497
539
|
className: "flex flex-wrap gap-2 border-t border-border pt-4",
|
|
498
540
|
children: [
|
|
499
|
-
/* @__PURE__ */
|
|
541
|
+
/* @__PURE__ */ F(u, {
|
|
500
542
|
type: "submit",
|
|
501
|
-
disabled:
|
|
502
|
-
children:
|
|
543
|
+
disabled: B.saving,
|
|
544
|
+
children: B.saving ? O("common.saving") : O(Y ? "common.save" : "contentManager.createDraft")
|
|
503
545
|
}),
|
|
504
|
-
|
|
546
|
+
Y && !Y.live && /* @__PURE__ */ F(u, {
|
|
505
547
|
type: "button",
|
|
506
548
|
variant: "outline",
|
|
507
|
-
disabled:
|
|
508
|
-
onClick: () => void
|
|
509
|
-
children:
|
|
549
|
+
disabled: B.saving,
|
|
550
|
+
onClick: () => void Ce(!0),
|
|
551
|
+
children: O("contentManager.publish")
|
|
510
552
|
}),
|
|
511
|
-
|
|
553
|
+
Y?.state === "published" && /* @__PURE__ */ F(u, {
|
|
512
554
|
type: "button",
|
|
513
555
|
variant: "outline",
|
|
514
|
-
disabled:
|
|
515
|
-
onClick: () => void
|
|
516
|
-
children:
|
|
556
|
+
disabled: B.saving,
|
|
557
|
+
onClick: () => void Ce(!1),
|
|
558
|
+
children: O("contentManager.unpublish")
|
|
517
559
|
}),
|
|
518
|
-
|
|
560
|
+
Y && /* @__PURE__ */ F(u, {
|
|
519
561
|
type: "button",
|
|
520
562
|
variant: "destructive",
|
|
521
563
|
className: "ms-auto",
|
|
522
|
-
disabled:
|
|
523
|
-
onClick: () => void
|
|
524
|
-
children:
|
|
564
|
+
disabled: B.saving,
|
|
565
|
+
onClick: () => void we(),
|
|
566
|
+
children: O("contentManager.delete")
|
|
525
567
|
})
|
|
526
568
|
]
|
|
527
569
|
}),
|
|
528
|
-
|
|
570
|
+
ve
|
|
529
571
|
]
|
|
530
|
-
}),
|
|
531
|
-
management:
|
|
532
|
-
content:
|
|
533
|
-
client:
|
|
534
|
-
onError:
|
|
535
|
-
labels:
|
|
572
|
+
}), Y && /* @__PURE__ */ F(k, {
|
|
573
|
+
management: ce,
|
|
574
|
+
content: Y,
|
|
575
|
+
client: E,
|
|
576
|
+
onError: C,
|
|
577
|
+
labels: oe
|
|
536
578
|
})] });
|
|
537
579
|
}
|
|
538
|
-
function
|
|
539
|
-
let { t: a } = t(), o =
|
|
540
|
-
return /* @__PURE__ */
|
|
580
|
+
function he({ item: e, src: n, saving: r, onFile: i }) {
|
|
581
|
+
let { t: a } = t(), o = M(null);
|
|
582
|
+
return /* @__PURE__ */ I("div", {
|
|
541
583
|
className: "grid gap-1.5",
|
|
542
584
|
"data-ckui": "content-cover",
|
|
543
|
-
children: [/* @__PURE__ */
|
|
585
|
+
children: [/* @__PURE__ */ F("span", {
|
|
544
586
|
className: "text-sm font-medium",
|
|
545
587
|
children: a("contentManager.cover")
|
|
546
|
-
}), e ? /* @__PURE__ */
|
|
588
|
+
}), e ? /* @__PURE__ */ I("div", {
|
|
547
589
|
className: "flex flex-wrap items-center gap-3",
|
|
548
590
|
children: [
|
|
549
|
-
n ? /* @__PURE__ */
|
|
591
|
+
n ? /* @__PURE__ */ F("img", {
|
|
550
592
|
src: n,
|
|
551
593
|
alt: "",
|
|
552
594
|
className: "h-20 w-36 rounded-md border border-border object-cover"
|
|
553
|
-
}) : /* @__PURE__ */
|
|
595
|
+
}) : /* @__PURE__ */ F("span", {
|
|
554
596
|
className: "text-muted-foreground",
|
|
555
597
|
children: a("contentManager.noCover")
|
|
556
598
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ F(u, {
|
|
558
600
|
type: "button",
|
|
559
601
|
size: "sm",
|
|
560
602
|
variant: "outline",
|
|
@@ -562,7 +604,7 @@ function _e({ item: e, src: n, saving: r, onFile: i }) {
|
|
|
562
604
|
onClick: () => o.current?.click(),
|
|
563
605
|
children: a(n ? "pollEditor.replaceImage" : "contentManager.addCover")
|
|
564
606
|
}),
|
|
565
|
-
n && /* @__PURE__ */
|
|
607
|
+
n && /* @__PURE__ */ F(u, {
|
|
566
608
|
type: "button",
|
|
567
609
|
size: "sm",
|
|
568
610
|
variant: "ghost",
|
|
@@ -570,7 +612,7 @@ function _e({ item: e, src: n, saving: r, onFile: i }) {
|
|
|
570
612
|
onClick: () => i(null),
|
|
571
613
|
children: a("pollEditor.removeImage")
|
|
572
614
|
}),
|
|
573
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ F("input", {
|
|
574
616
|
ref: o,
|
|
575
617
|
type: "file",
|
|
576
618
|
accept: "image/*",
|
|
@@ -582,13 +624,13 @@ function _e({ item: e, src: n, saving: r, onFile: i }) {
|
|
|
582
624
|
}
|
|
583
625
|
})
|
|
584
626
|
]
|
|
585
|
-
}) : /* @__PURE__ */
|
|
627
|
+
}) : /* @__PURE__ */ F("p", {
|
|
586
628
|
className: "text-xs text-muted-foreground",
|
|
587
629
|
children: a("contentManager.imagesAfterCreate")
|
|
588
630
|
})]
|
|
589
631
|
});
|
|
590
632
|
}
|
|
591
633
|
//#endregion
|
|
592
|
-
export {
|
|
634
|
+
export { W as ContentEditor, B as ContentManager, R as contentStatus, L as useContentManagerAccess };
|
|
593
635
|
|
|
594
636
|
//# sourceMappingURL=content-manager.js.map
|