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