@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
|
@@ -2,22 +2,22 @@ import { useMessages as e } from "../../i18n/context.js";
|
|
|
2
2
|
import { ContentKitUiRoot as t } from "../../scope.js";
|
|
3
3
|
import { ContentKitContext as n, useContentKitClient as r } from "../../react/context.js";
|
|
4
4
|
import { decodeImage as i } from "../../client/image.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { useGroup as a } from "../../react/groups.js";
|
|
6
|
+
import { Button as o } from "../../ui/button.js";
|
|
7
|
+
import { ImageCropDialog as s } from "../image-crop-dialog.js";
|
|
8
|
+
import { Badge as c } from "../../ui/badge.js";
|
|
9
|
+
import { Skeleton as l } from "../../ui/skeleton.js";
|
|
10
|
+
import { ErrorLine as u, contentError as d, useAction as f } from "../social/parts.js";
|
|
11
11
|
import { GroupAvatar as p, GroupCover as m } from "./parts.js";
|
|
12
12
|
import { priceLabel as h } from "../content/paywall.js";
|
|
13
13
|
import { useContext as g, useRef as _, useState as v } from "react";
|
|
14
14
|
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
15
15
|
import { cn as x } from "cn";
|
|
16
16
|
//#region src/components/groups/banner.tsx
|
|
17
|
-
function S({ group: i, onCheckout:
|
|
18
|
-
let v = e(), { t: S } = v, C = r(
|
|
17
|
+
function S({ group: i, onCheckout: a, onSignIn: s, client: l, onError: p, className: m, appearance: _ }) {
|
|
18
|
+
let v = e(), { t: S } = v, C = r(l), w = g(n), T = f("membership.join", p), E = i.access;
|
|
19
19
|
if (!E || E.editor || !E.offer && !E.member && !E.unknown) return null;
|
|
20
|
-
let D = w?.viewer === null, O =
|
|
20
|
+
let D = w?.viewer === null, O = s ?? w?.onSignIn, k = E.offer && Number(E.offer.terms.amount) > 0 ? E.offer : void 0;
|
|
21
21
|
return /* @__PURE__ */ b(t, {
|
|
22
22
|
appearance: _,
|
|
23
23
|
className: x("grid gap-2 rounded-lg border border-border p-3 text-sm", m),
|
|
@@ -28,7 +28,7 @@ function S({ group: i, onCheckout: o, onSignIn: c, client: f, onError: p, classN
|
|
|
28
28
|
children: S("membership.unknown")
|
|
29
29
|
}) : E.member ? /* @__PURE__ */ b("div", {
|
|
30
30
|
className: "flex flex-wrap items-center gap-2",
|
|
31
|
-
children: [/* @__PURE__ */ y(
|
|
31
|
+
children: [/* @__PURE__ */ y(c, { children: S("membership.member") }), !k && /* @__PURE__ */ y(o, {
|
|
32
32
|
size: "sm",
|
|
33
33
|
variant: "ghost",
|
|
34
34
|
disabled: T.pending,
|
|
@@ -40,13 +40,13 @@ function S({ group: i, onCheckout: o, onSignIn: c, client: f, onError: p, classN
|
|
|
40
40
|
children: [/* @__PURE__ */ y("p", {
|
|
41
41
|
className: "text-muted-foreground",
|
|
42
42
|
children: S(k ? "membership.paidPitch" : "membership.freePitch")
|
|
43
|
-
}), /* @__PURE__ */ y(
|
|
43
|
+
}), /* @__PURE__ */ y(o, {
|
|
44
44
|
size: "sm",
|
|
45
45
|
className: "justify-self-start",
|
|
46
|
-
disabled: T.pending || !!k && !
|
|
46
|
+
disabled: T.pending || !!k && !a,
|
|
47
47
|
onClick: () => {
|
|
48
48
|
if (D && O) return O();
|
|
49
|
-
if (k) return
|
|
49
|
+
if (k) return a?.({
|
|
50
50
|
key: E.key,
|
|
51
51
|
offer: k
|
|
52
52
|
});
|
|
@@ -54,69 +54,69 @@ function S({ group: i, onCheckout: o, onSignIn: c, client: f, onError: p, classN
|
|
|
54
54
|
},
|
|
55
55
|
children: k ? S("membership.joinFor", { price: h(v, k.terms) }) : S("membership.join")
|
|
56
56
|
})]
|
|
57
|
-
}), T.error && /* @__PURE__ */ y(
|
|
57
|
+
}), T.error && /* @__PURE__ */ y(u, { children: d(v, T.error) })]
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
function C(n) {
|
|
61
|
-
let r = e(), i =
|
|
61
|
+
let r = e(), i = a(n.group ? null : n.id, {
|
|
62
62
|
language: n.language,
|
|
63
63
|
client: n.client
|
|
64
|
-
}),
|
|
65
|
-
if (!
|
|
66
|
-
let
|
|
64
|
+
}), o = n.group ?? i.group;
|
|
65
|
+
if (!o) return i.error ? /* @__PURE__ */ y(u, { children: d(r, i.error) }) : /* @__PURE__ */ y(l, { className: "h-48 w-full" });
|
|
66
|
+
let s = o.text.find((e) => e.language === (n.language ?? o.name_language)) ?? o.text.find((e) => e.description), c = o.counts.filter((e) => e.language === (n.language ?? "")).reduce((e, t) => e + t.count, 0);
|
|
67
67
|
return /* @__PURE__ */ b(t, {
|
|
68
68
|
appearance: n.appearance,
|
|
69
69
|
className: x("grid gap-3 text-sm", n.className),
|
|
70
70
|
"data-ckui": "group-banner",
|
|
71
|
-
"data-kind":
|
|
71
|
+
"data-kind": o.kind,
|
|
72
72
|
children: [
|
|
73
73
|
/* @__PURE__ */ y(m, {
|
|
74
|
-
group:
|
|
74
|
+
group: o,
|
|
75
75
|
className: "aspect-[3/1] w-full"
|
|
76
76
|
}),
|
|
77
77
|
/* @__PURE__ */ b("div", {
|
|
78
78
|
className: "flex flex-wrap items-end gap-4 px-2 sm:px-4",
|
|
79
79
|
children: [
|
|
80
80
|
/* @__PURE__ */ y(p, {
|
|
81
|
-
group:
|
|
81
|
+
group: o,
|
|
82
82
|
className: "-mt-12 size-20 border-4 border-background sm:-mt-16 sm:size-28"
|
|
83
83
|
}),
|
|
84
84
|
/* @__PURE__ */ b("div", {
|
|
85
85
|
className: "grid min-w-0 flex-1 gap-1",
|
|
86
86
|
children: [/* @__PURE__ */ y("h1", {
|
|
87
87
|
className: "text-xl font-semibold break-words",
|
|
88
|
-
children:
|
|
88
|
+
children: o.name || o.slug
|
|
89
89
|
}), /* @__PURE__ */ y("p", {
|
|
90
90
|
className: "text-xs text-muted-foreground tabular-nums",
|
|
91
|
-
children: r.plural("groups.items",
|
|
91
|
+
children: r.plural("groups.items", c)
|
|
92
92
|
})]
|
|
93
93
|
}),
|
|
94
94
|
/* @__PURE__ */ b("div", {
|
|
95
95
|
className: "flex flex-wrap items-start gap-2",
|
|
96
96
|
children: [/* @__PURE__ */ y(S, {
|
|
97
|
-
group:
|
|
97
|
+
group: o,
|
|
98
98
|
onCheckout: n.onCheckout,
|
|
99
99
|
client: n.client
|
|
100
100
|
}), n.children]
|
|
101
101
|
})
|
|
102
102
|
]
|
|
103
103
|
}),
|
|
104
|
-
|
|
104
|
+
s?.description && /* @__PURE__ */ y("p", {
|
|
105
105
|
className: "px-2 break-words whitespace-pre-line sm:px-4",
|
|
106
|
-
children:
|
|
106
|
+
children: s.description
|
|
107
107
|
})
|
|
108
108
|
]
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
function w({ group: t, slot: n, crop: r = !0, client:
|
|
112
|
-
let { t: h } = e(), g =
|
|
111
|
+
function w({ group: t, slot: n, crop: r = !0, client: c, onError: l, className: d }) {
|
|
112
|
+
let { t: h } = e(), g = a(t.id, { client: c }), S = _(null), C = f("group.save", l), [w, T] = v(null), [E, D] = v(null), O = g.group ?? t, k = n === "cover" ? !!O.cover?.image || !!O.cover?.content_id && !O.cover.auto : !!O.avatar?.image, A = (e, t) => C.run(() => g.uploadImage(n, e, {
|
|
113
113
|
wait: !1,
|
|
114
114
|
edit: t
|
|
115
115
|
})), j = () => {
|
|
116
116
|
w?.revoke?.(), T(null), D(null);
|
|
117
117
|
};
|
|
118
118
|
return /* @__PURE__ */ b("div", {
|
|
119
|
-
className: x("flex flex-wrap items-center gap-3",
|
|
119
|
+
className: x("flex flex-wrap items-center gap-3", d),
|
|
120
120
|
"data-ckui": "group-image-editor",
|
|
121
121
|
"data-slot": n,
|
|
122
122
|
children: [
|
|
@@ -134,14 +134,14 @@ function w({ group: t, slot: n, crop: r = !0, client: s, onError: c, className:
|
|
|
134
134
|
children: [
|
|
135
135
|
/* @__PURE__ */ b("div", {
|
|
136
136
|
className: "flex flex-wrap gap-2",
|
|
137
|
-
children: [/* @__PURE__ */ y(
|
|
137
|
+
children: [/* @__PURE__ */ y(o, {
|
|
138
138
|
type: "button",
|
|
139
139
|
size: "sm",
|
|
140
140
|
variant: "outline",
|
|
141
141
|
disabled: C.pending,
|
|
142
142
|
onClick: () => S.current?.click(),
|
|
143
143
|
children: C.pending ? h("groupEditor.uploading") : h(n === "avatar" ? "groupEditor.uploadAvatar" : "groupEditor.uploadCover")
|
|
144
|
-
}), k && /* @__PURE__ */ y(
|
|
144
|
+
}), k && /* @__PURE__ */ y(o, {
|
|
145
145
|
type: "button",
|
|
146
146
|
size: "sm",
|
|
147
147
|
variant: "ghost",
|
|
@@ -166,10 +166,10 @@ function w({ group: t, slot: n, crop: r = !0, client: s, onError: c, className:
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
}),
|
|
169
|
-
/* @__PURE__ */ y(
|
|
169
|
+
/* @__PURE__ */ y(u, { error: C.error })
|
|
170
170
|
]
|
|
171
171
|
}),
|
|
172
|
-
/* @__PURE__ */ y(
|
|
172
|
+
/* @__PURE__ */ y(s, {
|
|
173
173
|
open: !!w,
|
|
174
174
|
onOpenChange: (e) => !e && j(),
|
|
175
175
|
source: w,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useMessages as e } from "../../i18n/context.js";
|
|
2
2
|
import { ContentKitUiRoot as t } from "../../scope.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { useGroups as n } from "../../react/groups.js";
|
|
4
|
+
import { Button as r } from "../../ui/button.js";
|
|
5
|
+
import { Skeleton as i } from "../../ui/skeleton.js";
|
|
6
|
+
import { contentError as a } from "../social/parts.js";
|
|
7
|
+
import { LETTERS as o } from "../../client/group-fields.js";
|
|
8
8
|
import { GroupCover as s, GroupLink as c } from "./parts.js";
|
|
9
9
|
import { useState as l } from "react";
|
|
10
10
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
11
11
|
import { cn as f } from "cn";
|
|
12
12
|
//#region src/components/groups/directory.tsx
|
|
13
13
|
function p(p) {
|
|
14
|
-
let m = e(), { t: h } = m, [g, _] = l(null), v = p.letter === void 0 ? g : p.letter, y = (e) => p.onLetterChange ? p.onLetterChange(e) : _(e), b =
|
|
14
|
+
let m = e(), { t: h } = m, [g, _] = l(null), v = p.letter === void 0 ? g : p.letter, y = (e) => p.onLetterChange ? p.onLetterChange(e) : _(e), b = n({
|
|
15
15
|
kind: p.kind,
|
|
16
16
|
language: p.language,
|
|
17
17
|
contentKind: p.contentKind,
|
|
@@ -31,7 +31,7 @@ function p(p) {
|
|
|
31
31
|
"aria-label": h("groups.byLetter"),
|
|
32
32
|
className: "flex flex-wrap gap-1",
|
|
33
33
|
"data-ckui": "letters",
|
|
34
|
-
children: [null, ...
|
|
34
|
+
children: [null, ...o].map((e) => /* @__PURE__ */ u(r, {
|
|
35
35
|
size: "xs",
|
|
36
36
|
variant: v === e ? "default" : "ghost",
|
|
37
37
|
"aria-pressed": v === e,
|
|
@@ -44,14 +44,14 @@ function p(p) {
|
|
|
44
44
|
b.loading && !b.items.length ? /* @__PURE__ */ u("div", {
|
|
45
45
|
className: x ? "grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-3" : "grid gap-2",
|
|
46
46
|
"aria-busy": !0,
|
|
47
|
-
children: Array.from({ length: 6 }, (e, t) => /* @__PURE__ */ u(
|
|
47
|
+
children: Array.from({ length: 6 }, (e, t) => /* @__PURE__ */ u(i, { className: x ? "aspect-[3/4] w-full" : "h-6 w-48" }, t))
|
|
48
48
|
}) : b.error && !b.items.length ? /* @__PURE__ */ d("div", {
|
|
49
49
|
role: "alert",
|
|
50
50
|
className: "grid justify-items-start gap-2",
|
|
51
51
|
children: [/* @__PURE__ */ u("p", {
|
|
52
52
|
className: "text-destructive",
|
|
53
|
-
children:
|
|
54
|
-
}), /* @__PURE__ */ u(
|
|
53
|
+
children: a(m, b.error)
|
|
54
|
+
}), /* @__PURE__ */ u(r, {
|
|
55
55
|
size: "sm",
|
|
56
56
|
variant: "outline",
|
|
57
57
|
onClick: b.reload,
|
|
@@ -100,7 +100,7 @@ function p(p) {
|
|
|
100
100
|
role: "status",
|
|
101
101
|
children: h("groups.empty")
|
|
102
102
|
}),
|
|
103
|
-
b.hasMore && /* @__PURE__ */ u(
|
|
103
|
+
b.hasMore && /* @__PURE__ */ u(r, {
|
|
104
104
|
variant: "outline",
|
|
105
105
|
size: "sm",
|
|
106
106
|
className: "justify-self-center",
|