@openrails/contentkit-ui 0.103.1 → 0.104.0-rc.1

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