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