@openrails/contentkit-ui 0.104.0-rc.1 → 0.104.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/client/beacons.js +4 -1
- package/dist/client/beacons.js.map +1 -1
- package/dist/client/contents.d.ts +9 -1
- package/dist/client/contents.js +73 -55
- package/dist/client/contents.js.map +1 -1
- package/dist/client/discovery.d.ts +6 -2
- package/dist/client/discovery.js +1 -1
- package/dist/client/discovery.js.map +1 -1
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/error-codes.js +4 -0
- package/dist/client/generated/error-codes.js.map +1 -1
- package/dist/client/generated/routes.d.ts +43 -30
- package/dist/client/generated/routes.js +70 -63
- package/dist/client/generated/routes.js.map +1 -1
- package/dist/client/generated/wire.d.ts +36 -74
- package/dist/client/generated/wire.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/media/windows.d.ts +2 -0
- package/dist/client/media/windows.js +4 -1
- package/dist/client/media/windows.js.map +1 -1
- package/dist/client/stats.d.ts +4 -20
- package/dist/client/stats.js +0 -11
- package/dist/client/stats.js.map +1 -1
- package/dist/client/versions.d.ts +8 -6
- package/dist/client/versions.js +15 -10
- package/dist/client/versions.js.map +1 -1
- package/dist/components/admin/bulk-drafts.d.ts +17 -0
- package/dist/components/admin/bulk-drafts.js +41 -0
- package/dist/components/admin/bulk-drafts.js.map +1 -0
- package/dist/components/admin/content-admin.d.ts +1 -1
- package/dist/components/admin/content-admin.js.map +1 -1
- package/dist/components/admin/content-manager.d.ts +11 -3
- package/dist/components/admin/content-manager.js +739 -380
- package/dist/components/admin/content-manager.js.map +1 -1
- package/dist/components/admin/group-manager.d.ts +8 -3
- package/dist/components/admin/group-manager.js +218 -146
- package/dist/components/admin/group-manager.js.map +1 -1
- package/dist/components/admin/page-notices.d.ts +16 -0
- package/dist/components/admin/page-notices.js +113 -0
- package/dist/components/admin/page-notices.js.map +1 -0
- package/dist/components/admin/page-picker.d.ts +38 -0
- package/dist/components/admin/page-picker.js +159 -0
- package/dist/components/admin/page-picker.js.map +1 -0
- package/dist/components/admin/reader-content-editor.js +537 -500
- package/dist/components/admin/reader-content-editor.js.map +1 -1
- package/dist/components/admin/reader-manifest.js +181 -179
- package/dist/components/admin/reader-manifest.js.map +1 -1
- package/dist/components/admin/shell.d.ts +10 -2
- package/dist/components/admin/shell.js +114 -42
- package/dist/components/admin/shell.js.map +1 -1
- package/dist/components/admin/stats-dashboard.d.ts +4 -9
- package/dist/components/admin/stats-dashboard.js +300 -202
- package/dist/components/admin/stats-dashboard.js.map +1 -1
- package/dist/components/admin/upload-queue.d.ts +14 -0
- package/dist/components/admin/upload-queue.js +115 -98
- package/dist/components/admin/upload-queue.js.map +1 -1
- package/dist/components/content/card.d.ts +31 -3
- package/dist/components/content/card.js +324 -158
- package/dist/components/content/card.js.map +1 -1
- package/dist/components/content/daily-releases.js +14 -12
- package/dist/components/content/daily-releases.js.map +1 -1
- package/dist/components/content/editor-save.js +27 -25
- package/dist/components/content/editor-save.js.map +1 -1
- package/dist/components/content/editors.js +274 -253
- package/dist/components/content/editors.js.map +1 -1
- package/dist/components/content/favorites.d.ts +1 -1
- package/dist/components/content/favorites.js +36 -22
- package/dist/components/content/favorites.js.map +1 -1
- package/dist/components/content/grid.d.ts +11 -4
- package/dist/components/content/grid.js +52 -43
- package/dist/components/content/grid.js.map +1 -1
- package/dist/components/content/history.js +83 -63
- package/dist/components/content/history.js.map +1 -1
- package/dist/components/content/index.d.ts +5 -3
- package/dist/components/content/listing.d.ts +14 -3
- package/dist/components/content/listing.js +65 -56
- package/dist/components/content/listing.js.map +1 -1
- package/dist/components/content/offer-fields.js +6 -6
- package/dist/components/content/paged-grid.d.ts +10 -0
- package/dist/components/content/paged-grid.js +116 -0
- package/dist/components/content/paged-grid.js.map +1 -0
- package/dist/components/content/pagination.d.ts +19 -0
- package/dist/components/content/pagination.js +97 -0
- package/dist/components/content/pagination.js.map +1 -0
- package/dist/components/content/paywall.d.ts +9 -0
- package/dist/components/content/paywall.js +27 -3
- package/dist/components/content/paywall.js.map +1 -1
- package/dist/components/content/post-list.d.ts +37 -0
- package/dist/components/content/post-list.js +203 -0
- package/dist/components/content/post-list.js.map +1 -0
- package/dist/components/content/reader-settings.d.ts +2 -0
- package/dist/components/content/reader-settings.js +1 -1
- package/dist/components/content/reader-settings.js.map +1 -1
- package/dist/components/groups/banner.d.ts +6 -2
- package/dist/components/groups/banner.js +79 -61
- package/dist/components/groups/banner.js.map +1 -1
- package/dist/components/groups/directory.d.ts +12 -2
- package/dist/components/groups/directory.js +168 -105
- package/dist/components/groups/directory.js.map +1 -1
- package/dist/components/groups/editor.js +10 -10
- package/dist/components/groups/editor.js.map +1 -1
- package/dist/components/groups/entity-chips.d.ts +61 -0
- package/dist/components/groups/entity-chips.js +382 -0
- package/dist/components/groups/entity-chips.js.map +1 -0
- package/dist/components/groups/group-members.d.ts +29 -0
- package/dist/components/groups/group-members.js +474 -0
- package/dist/components/groups/group-members.js.map +1 -0
- package/dist/components/groups/header.js +53 -45
- package/dist/components/groups/header.js.map +1 -1
- package/dist/components/groups/index.d.ts +3 -1
- package/dist/components/groups/memberships.d.ts +3 -36
- package/dist/components/groups/memberships.js +105 -480
- package/dist/components/groups/memberships.js.map +1 -1
- package/dist/components/groups/scoped.d.ts +23 -0
- package/dist/components/groups/scoped.js +92 -0
- package/dist/components/groups/scoped.js.map +1 -0
- package/dist/components/media-folder-editor.d.ts +5 -0
- package/dist/components/media-folder-editor.js +418 -230
- package/dist/components/media-folder-editor.js.map +1 -1
- package/dist/components/social/poll.js +57 -48
- package/dist/components/social/poll.js.map +1 -1
- package/dist/components/sortable-list.d.ts +5 -1
- package/dist/components/sortable-list.js +97 -81
- package/dist/components/sortable-list.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +41 -37
- package/dist/locales/admin/de.js +78 -45
- package/dist/locales/admin/de.js.map +1 -1
- package/dist/locales/admin/en.d.ts +74 -41
- package/dist/locales/admin/en.js +78 -45
- package/dist/locales/admin/en.js.map +1 -1
- package/dist/locales/admin/es.js +78 -45
- package/dist/locales/admin/es.js.map +1 -1
- package/dist/locales/admin/ja.js +78 -45
- package/dist/locales/admin/ja.js.map +1 -1
- package/dist/locales/admin/ko.js +78 -45
- package/dist/locales/admin/ko.js.map +1 -1
- package/dist/locales/admin/zh.js +78 -45
- package/dist/locales/admin/zh.js.map +1 -1
- package/dist/locales/de.js +2 -0
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/discovery/de.js +25 -1
- package/dist/locales/discovery/de.js.map +1 -1
- package/dist/locales/discovery/en.d.ts +24 -0
- package/dist/locales/discovery/en.js +25 -1
- package/dist/locales/discovery/en.js.map +1 -1
- package/dist/locales/discovery/es.js +25 -1
- package/dist/locales/discovery/es.js.map +1 -1
- package/dist/locales/discovery/ja.js +25 -1
- package/dist/locales/discovery/ja.js.map +1 -1
- package/dist/locales/discovery/ko.js +25 -1
- package/dist/locales/discovery/ko.js.map +1 -1
- package/dist/locales/discovery/zh.js +25 -1
- package/dist/locales/discovery/zh.js.map +1 -1
- package/dist/locales/en.d.ts +120 -43
- package/dist/locales/en.js +2 -0
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +2 -0
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/groups/de.js +22 -4
- package/dist/locales/groups/de.js.map +1 -1
- package/dist/locales/groups/en.d.ts +20 -2
- package/dist/locales/groups/en.js +22 -4
- package/dist/locales/groups/en.js.map +1 -1
- package/dist/locales/groups/es.js +22 -4
- package/dist/locales/groups/es.js.map +1 -1
- package/dist/locales/groups/ja.js +22 -4
- package/dist/locales/groups/ja.js.map +1 -1
- package/dist/locales/groups/ko.js +22 -4
- package/dist/locales/groups/ko.js.map +1 -1
- package/dist/locales/groups/zh.js +22 -4
- package/dist/locales/groups/zh.js.map +1 -1
- package/dist/locales/ja.js +2 -0
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +2 -0
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/zh.js +2 -0
- package/dist/locales/zh.js.map +1 -1
- package/dist/react/contents.js +1 -1
- package/dist/react/contents.js.map +1 -1
- package/dist/react/discovery.d.ts +16 -0
- package/dist/react/discovery.js +69 -37
- package/dist/react/discovery.js.map +1 -1
- package/dist/react/groups.d.ts +19 -3
- package/dist/react/groups.js +49 -22
- package/dist/react/groups.js.map +1 -1
- package/dist/react/index.d.ts +6 -4
- package/dist/react/page-notices.d.ts +13 -0
- package/dist/react/page-notices.js +38 -0
- package/dist/react/page-notices.js.map +1 -0
- package/dist/react/post-reads.d.ts +23 -0
- package/dist/react/post-reads.js +90 -0
- package/dist/react/post-reads.js.map +1 -0
- package/dist/react/remembered-sort.d.ts +5 -0
- package/dist/react/remembered-sort.js +29 -0
- package/dist/react/remembered-sort.js.map +1 -0
- package/dist/react/resources.js +2 -2
- package/dist/react/resources.js.map +1 -1
- package/dist/react/stats.d.ts +3 -7
- package/dist/react/stats.js +2 -6
- package/dist/react/stats.js.map +1 -1
- package/dist/react/use-engagement.d.ts +2 -0
- package/dist/react/use-engagement.js +40 -34
- package/dist/react/use-engagement.js.map +1 -1
- package/dist/react.js +29 -27
- package/dist/styles.css +1 -1
- package/dist/urls/index.d.ts +1 -1
- package/dist/urls.js +2 -2
- package/dist/urls.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/admin/page-review.d.ts +0 -13
- package/dist/components/admin/page-review.js +0 -225
- package/dist/components/admin/page-review.js.map +0 -1
- package/dist/react/page-review.d.ts +0 -14
- package/dist/react/page-review.js +0 -37
- package/dist/react/page-review.js.map +0 -1
|
@@ -1,123 +1,186 @@
|
|
|
1
1
|
import { useMessages as e } from "../../i18n/context.js";
|
|
2
2
|
import { ContentKitUiRoot as t } from "../../scope.js";
|
|
3
|
-
import { useGroups as n } from "../../react/groups.js";
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Skeleton as
|
|
6
|
-
import { contentError as
|
|
7
|
-
import { LETTERS as
|
|
8
|
-
import { GroupCover as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { useGroups as n, useGroupsPage as r } from "../../react/groups.js";
|
|
4
|
+
import { Button as i } from "../../ui/button.js";
|
|
5
|
+
import { Skeleton as a } from "../../ui/skeleton.js";
|
|
6
|
+
import { contentError as o } from "../social/parts.js";
|
|
7
|
+
import { LETTERS as s } from "../../client/group-fields.js";
|
|
8
|
+
import { GroupCover as c, GroupLink as l } from "./parts.js";
|
|
9
|
+
import { Pagination as u } from "../content/pagination.js";
|
|
10
|
+
import { SortMenu as d } from "../content/listing.js";
|
|
11
|
+
import { useRef as f, useState as p } from "react";
|
|
12
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
13
|
+
import { cn as _ } from "cn";
|
|
12
14
|
//#region src/components/groups/directory.tsx
|
|
13
|
-
function
|
|
14
|
-
let
|
|
15
|
-
kind:
|
|
16
|
-
language:
|
|
17
|
-
contentKind:
|
|
18
|
-
parent:
|
|
19
|
-
scope:
|
|
20
|
-
sort:
|
|
21
|
-
letter:
|
|
22
|
-
pageSize:
|
|
23
|
-
}
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
appearance:
|
|
26
|
-
className:
|
|
15
|
+
function v(n) {
|
|
16
|
+
let { t: r } = e(), [a, o] = p(null), [c, l] = p("name"), u = n.letter === void 0 ? a : n.letter, f = n.sort ?? c, m = (e) => n.onLetterChange ? n.onLetterChange(e) : o(e), v = (e) => n.onSortChange ? n.onSortChange(e) : l(e), x = {
|
|
17
|
+
kind: n.kind,
|
|
18
|
+
language: n.language,
|
|
19
|
+
contentKind: n.contentKind,
|
|
20
|
+
parent: n.parent,
|
|
21
|
+
scope: n.scope,
|
|
22
|
+
sort: f,
|
|
23
|
+
letter: u ?? void 0,
|
|
24
|
+
pageSize: n.pageSize
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ g(t, {
|
|
27
|
+
appearance: n.appearance,
|
|
28
|
+
className: _("grid gap-4 text-sm", n.className),
|
|
27
29
|
"data-ckui": "group-directory",
|
|
28
|
-
"data-kind":
|
|
29
|
-
children: [
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
"data-kind": n.kind,
|
|
31
|
+
children: [(n.letters !== !1 || !!n.sorts?.length) && /* @__PURE__ */ g("div", {
|
|
32
|
+
className: "flex flex-wrap items-start justify-between gap-2",
|
|
33
|
+
children: [n.letters !== !1 && /* @__PURE__ */ h("nav", {
|
|
34
|
+
"aria-label": r("groups.byLetter"),
|
|
32
35
|
className: "flex flex-wrap gap-1",
|
|
33
36
|
"data-ckui": "letters",
|
|
34
|
-
children: [null, ...
|
|
37
|
+
children: [null, ...s].map((e) => /* @__PURE__ */ h(i, {
|
|
35
38
|
size: "xs",
|
|
36
|
-
variant:
|
|
37
|
-
"aria-pressed":
|
|
38
|
-
"aria-label": e === null ? void 0 : e === "#" ?
|
|
39
|
+
variant: u === e ? "default" : "ghost",
|
|
40
|
+
"aria-pressed": u === e,
|
|
41
|
+
"aria-label": e === null ? void 0 : e === "#" ? r("groups.otherLetters") : e.toUpperCase(),
|
|
39
42
|
className: "min-w-7",
|
|
40
|
-
onClick: () =>
|
|
41
|
-
children: e === null ?
|
|
43
|
+
onClick: () => m(e),
|
|
44
|
+
children: e === null ? r("groups.all") : e.toUpperCase()
|
|
42
45
|
}, e ?? "all"))
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
46
|
+
}), !!n.sorts?.length && /* @__PURE__ */ h(d, {
|
|
47
|
+
value: f,
|
|
48
|
+
sorts: n.sorts,
|
|
49
|
+
onChange: v,
|
|
50
|
+
label: (e) => r(`groups.directorySort_${e}`),
|
|
51
|
+
className: "ms-auto"
|
|
52
|
+
})]
|
|
53
|
+
}), n.pagination === "pages" ? /* @__PURE__ */ h(b, {
|
|
54
|
+
...n,
|
|
55
|
+
filter: x
|
|
56
|
+
}) : /* @__PURE__ */ h(y, {
|
|
57
|
+
...n,
|
|
58
|
+
filter: x
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function y({ filter: t, client: r, ...a }) {
|
|
63
|
+
let s = e(), { t: c } = s, l = n(t, { client: r });
|
|
64
|
+
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(x, {
|
|
65
|
+
...a,
|
|
66
|
+
items: l.items,
|
|
67
|
+
loading: l.loading,
|
|
68
|
+
error: l.error,
|
|
69
|
+
reload: l.reload
|
|
70
|
+
}), l.hasMore && /* @__PURE__ */ g("div", {
|
|
71
|
+
className: "grid justify-items-center gap-2",
|
|
72
|
+
children: [l.error && /* @__PURE__ */ h("p", {
|
|
73
|
+
role: "alert",
|
|
74
|
+
className: "text-destructive",
|
|
75
|
+
children: o(s, l.error)
|
|
76
|
+
}), /* @__PURE__ */ h(i, {
|
|
77
|
+
variant: "outline",
|
|
78
|
+
size: "sm",
|
|
79
|
+
disabled: l.loadingMore,
|
|
80
|
+
onClick: () => void l.loadMore(),
|
|
81
|
+
children: l.loadingMore ? c("groups.loading") : l.error ? c("common.retry") : c("groups.loadMore")
|
|
82
|
+
})]
|
|
83
|
+
})] });
|
|
84
|
+
}
|
|
85
|
+
function b({ filter: e, client: t, ...n }) {
|
|
86
|
+
let i = JSON.stringify(e), [a, o] = p({
|
|
87
|
+
key: i,
|
|
88
|
+
page: 1
|
|
89
|
+
}), s = Math.max(1, Math.floor(n.page ?? (a.key === i ? a.page : 1))), c = f(null), l = r(e, s, { client: t }), d = e.pageSize ?? 50, _ = (e, t) => {
|
|
90
|
+
n.page === void 0 && o({
|
|
91
|
+
key: i,
|
|
92
|
+
page: e
|
|
93
|
+
}), n.onPageChange?.(e), t && c.current?.scrollIntoView({
|
|
94
|
+
block: "start",
|
|
95
|
+
behavior: "smooth"
|
|
96
|
+
});
|
|
97
|
+
}, v = (e) => l.total === void 0 ? null : /* @__PURE__ */ h(u, {
|
|
98
|
+
page: s,
|
|
99
|
+
total: l.total,
|
|
100
|
+
pageSize: d,
|
|
101
|
+
range: !e,
|
|
102
|
+
pageHref: n.pageHref,
|
|
103
|
+
onPageChange: (t) => _(t, e)
|
|
104
|
+
});
|
|
105
|
+
return /* @__PURE__ */ g(m, { children: [
|
|
106
|
+
/* @__PURE__ */ h("div", {
|
|
107
|
+
ref: c,
|
|
108
|
+
className: "scroll-mt-20",
|
|
109
|
+
children: v(!1)
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ h(x, {
|
|
112
|
+
...n,
|
|
113
|
+
items: l.items,
|
|
114
|
+
loading: l.loading,
|
|
115
|
+
error: l.error,
|
|
116
|
+
reload: l.reload
|
|
117
|
+
}),
|
|
118
|
+
l.items.length > 0 && v(!0)
|
|
119
|
+
] });
|
|
120
|
+
}
|
|
121
|
+
function x({ items: t, loading: n, error: r, reload: s, ...u }) {
|
|
122
|
+
let d = e(), { t: f } = d, p = u.layout === "grid", m = (e) => new Intl.NumberFormat(d.language).format(e);
|
|
123
|
+
return n && !t.length ? /* @__PURE__ */ h("div", {
|
|
124
|
+
className: p ? "grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-3" : "grid gap-2",
|
|
125
|
+
"aria-busy": !0,
|
|
126
|
+
children: Array.from({ length: 6 }, (e, t) => /* @__PURE__ */ h(a, { className: p ? "aspect-[3/4] w-full" : "h-6 w-48" }, t))
|
|
127
|
+
}) : r && !t.length ? /* @__PURE__ */ g("div", {
|
|
128
|
+
role: "alert",
|
|
129
|
+
className: "grid justify-items-start gap-2",
|
|
130
|
+
children: [/* @__PURE__ */ h("p", {
|
|
131
|
+
className: "text-destructive",
|
|
132
|
+
children: o(d, r)
|
|
133
|
+
}), /* @__PURE__ */ h(i, {
|
|
134
|
+
size: "sm",
|
|
135
|
+
variant: "outline",
|
|
136
|
+
onClick: s,
|
|
137
|
+
children: f("common.retry")
|
|
138
|
+
})]
|
|
139
|
+
}) : t.length ? /* @__PURE__ */ h("ul", {
|
|
140
|
+
className: p ? "grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-3" : "flex flex-wrap gap-2",
|
|
141
|
+
"data-ckui": "groups",
|
|
142
|
+
children: t.map((e) => /* @__PURE__ */ h("li", {
|
|
143
|
+
"data-ckui": "group",
|
|
144
|
+
"data-slug": e.slug,
|
|
145
|
+
children: u.renderGroup ? u.renderGroup(e) : p ? /* @__PURE__ */ g(l, {
|
|
146
|
+
group: e,
|
|
147
|
+
href: u.href,
|
|
148
|
+
className: "group grid gap-1.5",
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ h(c, {
|
|
85
151
|
group: e,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
})]
|
|
152
|
+
className: "aspect-[3/4] w-full"
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ h("span", {
|
|
155
|
+
className: "font-medium break-words group-hover:underline",
|
|
156
|
+
children: e.name || e.slug
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ h("span", {
|
|
159
|
+
className: "text-xs text-muted-foreground tabular-nums",
|
|
160
|
+
children: d.plural("groups.items", e.count)
|
|
96
161
|
})
|
|
97
|
-
|
|
98
|
-
}) : /* @__PURE__ */
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
children:
|
|
109
|
-
}), /* @__PURE__ */ u(r, {
|
|
110
|
-
variant: "outline",
|
|
111
|
-
size: "sm",
|
|
112
|
-
disabled: b.loadingMore,
|
|
113
|
-
onClick: () => void b.loadMore(),
|
|
114
|
-
children: b.loadingMore ? h("groups.loading") : b.error ? h("common.retry") : h("groups.loadMore")
|
|
162
|
+
]
|
|
163
|
+
}) : /* @__PURE__ */ g(l, {
|
|
164
|
+
group: e,
|
|
165
|
+
href: u.href,
|
|
166
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 hover:bg-muted",
|
|
167
|
+
children: [/* @__PURE__ */ h("span", {
|
|
168
|
+
className: "break-words",
|
|
169
|
+
children: e.name || e.slug
|
|
170
|
+
}), /* @__PURE__ */ h("span", {
|
|
171
|
+
className: "text-xs text-muted-foreground tabular-nums",
|
|
172
|
+
"aria-label": d.plural("groups.items", e.count),
|
|
173
|
+
children: m(e.count)
|
|
115
174
|
})]
|
|
116
175
|
})
|
|
117
|
-
|
|
176
|
+
}, e.id))
|
|
177
|
+
}) : /* @__PURE__ */ h("p", {
|
|
178
|
+
className: "text-muted-foreground",
|
|
179
|
+
role: "status",
|
|
180
|
+
children: f("groups.empty")
|
|
118
181
|
});
|
|
119
182
|
}
|
|
120
183
|
//#endregion
|
|
121
|
-
export {
|
|
184
|
+
export { v as GroupDirectory };
|
|
122
185
|
|
|
123
186
|
//# sourceMappingURL=directory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory.js","names":[],"sources":["../../../src/components/groups/directory.tsx"],"sourcesContent":["import { cn } from \"cn\";\nimport { useState, type ReactNode } from \"react\";\nimport type { ContentKitUiAppearance } from \"../../appearance.js\";\nimport type { ContentKitClient } from \"../../client/client.js\";\nimport { LETTERS } from \"../../client/group-fields.js\";\nimport type { GroupCard } from \"../../client/generated/wire.js\";\nimport { useMessages } from \"../../i18n/context.js\";\nimport { useGroups, type GroupSort } from \"../../react/groups.js\";\nimport { ContentKitUiRoot } from \"../../scope.js\";\nimport { Button } from \"#ckui/ui/button\";\nimport { Skeleton } from \"#ckui/ui/skeleton\";\nimport { contentError } from \"../social/parts.js\";\nimport { GroupCover, GroupLink, type GroupLike } from \"./parts.js\";\n\nexport interface GroupDirectoryProps {\n /** The group kind listed: tag, artist, series. */\n kind: string;\n /** Names, counts and paths in this language; default the provider's. */\n language?: string;\n /** Count contents of this kind only; default every kind. */\n contentKind?: string;\n /** Children of this group. */\n parent?: string;\n /** Groups scoped by this group (characters of a series). */\n scope?: string;\n /** Default \"name\". */\n sort?: GroupSort;\n /** The letter bucket shown, a-z or \"#\", null for every group. With onLetterChange the host keeps it (in its URL). */\n letter?: string | null;\n onLetterChange?: (letter: string | null) => void;\n /** Hide the A-Z bar. */\n letters?: boolean;\n /** \"list\" (names with counts, default) or \"grid\" (covers). */\n layout?: \"list\" | \"grid\";\n /** A group's link; default its canonical path. */\n href?: (group: GroupLike) => string | undefined;\n /** A group's entry instead of the default one. */\n renderGroup?: (group: GroupCard) => ReactNode;\n pageSize?: number;\n client?: ContentKitClient;\n className?: string;\n appearance?: ContentKitUiAppearance;\n}\n\n/** A directory of one kind's groups: A-Z buckets, names with content counts or covers, paged. */\nexport function GroupDirectory(p: GroupDirectoryProps) {\n const m = useMessages();\n const { t } = m;\n const [own, setOwn] = useState<string | null>(null);\n const letter = p.letter !== undefined ? p.letter : own;\n const choose = (l: string | null) => (p.onLetterChange ? p.onLetterChange(l) : setOwn(l));\n const list = useGroups(\n { kind: p.kind, language: p.language, contentKind: p.contentKind, parent: p.parent, scope: p.scope, sort: p.sort, letter: letter ?? undefined, pageSize: p.pageSize },\n { client: p.client },\n );\n const grid = p.layout === \"grid\";\n const count = (n: number) => new Intl.NumberFormat(m.language).format(n);\n return (\n <ContentKitUiRoot appearance={p.appearance} className={cn(\"grid gap-4 text-sm\", p.className)} data-ckui=\"group-directory\" data-kind={p.kind}>\n {p.letters !== false && (\n <nav aria-label={t(\"groups.byLetter\")} className=\"flex flex-wrap gap-1\" data-ckui=\"letters\">\n {[null, ...LETTERS].map((l) => (\n <Button\n key={l ?? \"all\"}\n size=\"xs\"\n variant={letter === l ? \"default\" : \"ghost\"}\n aria-pressed={letter === l}\n aria-label={l === null ? undefined : l === \"#\" ? t(\"groups.otherLetters\") : l.toUpperCase()}\n className=\"min-w-7\"\n onClick={() => choose(l)}\n >\n {l === null ? t(\"groups.all\") : l.toUpperCase()}\n </Button>\n ))}\n </nav>\n )}\n {list.loading && !list.items.length ? (\n <div className={grid ? \"grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-3\" : \"grid gap-2\"} aria-busy>\n {Array.from({ length: 6 }, (_, i) => (\n <Skeleton key={i} className={grid ? \"aspect-[3/4] w-full\" : \"h-6 w-48\"} />\n ))}\n </div>\n ) : list.error && !list.items.length ? (\n <div role=\"alert\" className=\"grid justify-items-start gap-2\">\n <p className=\"text-destructive\">{contentError(m, list.error)}</p>\n <Button size=\"sm\" variant=\"outline\" onClick={list.reload}>\n {t(\"common.retry\")}\n </Button>\n </div>\n ) : !list.items.length ? (\n <p className=\"text-muted-foreground\" role=\"status\">\n {t(\"groups.empty\")}\n </p>\n ) : (\n <ul className={grid ? \"grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-3\" : \"flex flex-wrap gap-2\"} data-ckui=\"groups\">\n {list.items.map((g) => (\n <li key={g.id} data-ckui=\"group\" data-slug={g.slug}>\n {p.renderGroup ? (\n p.renderGroup(g)\n ) : grid ? (\n <GroupLink group={g} href={p.href} className=\"group grid gap-1.5\">\n <GroupCover group={g} className=\"aspect-[3/4] w-full\" />\n <span className=\"font-medium break-words group-hover:underline\">{g.name || g.slug}</span>\n <span className=\"text-xs text-muted-foreground tabular-nums\">{m.plural(\"groups.items\", g.count)}</span>\n </GroupLink>\n ) : (\n <GroupLink group={g} href={p.href} className=\"inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 hover:bg-muted\">\n <span className=\"break-words\">{g.name || g.slug}</span>\n <span className=\"text-xs text-muted-foreground tabular-nums\" aria-label={m.plural(\"groups.items\", g.count)}>\n {count(g.count)}\n </span>\n </GroupLink>\n )}\n </li>\n ))}\n </ul>\n )}\n {list.hasMore && (\n <div className=\"grid justify-items-center gap-2\">\n {list.error && <p role=\"alert\" className=\"text-destructive\">{contentError(m, list.error)}</p>}\n <Button variant=\"outline\" size=\"sm\" disabled={list.loadingMore} onClick={() => void list.loadMore()}>\n {list.loadingMore ? t(\"groups.loading\") : list.error ? t(\"common.retry\") : t(\"groups.loadMore\")}\n </Button>\n </div>\n )}\n </ContentKitUiRoot>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA6CA,SAAgB,EAAe,GAAwB;CACrD,IAAM,IAAI,EAAY,GAChB,EAAE,SAAM,GACR,CAAC,GAAK,KAAU,EAAwB,IAAI,GAC5C,IAAS,EAAE,WAAW,KAAA,IAAuB,IAAX,EAAE,QACpC,KAAU,MAAsB,EAAE,iBAAiB,EAAE,eAAe,CAAC,IAAI,EAAO,CAAC,GACjF,IAAO,EACX;EAAE,MAAM,EAAE;EAAM,UAAU,EAAE;EAAU,aAAa,EAAE;EAAa,QAAQ,EAAE;EAAQ,OAAO,EAAE;EAAO,MAAM,EAAE;EAAM,QAAQ,KAAU,KAAA;EAAW,UAAU,EAAE;CAAS,GACpK,EAAE,QAAQ,EAAE,OAAO,CACrB,GACM,IAAO,EAAE,WAAW,QACpB,KAAS,MAAc,IAAI,KAAK,aAAa,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC;CACvE,OACE,kBAAC,GAAD;EAAkB,YAAY,EAAE;EAAY,WAAW,EAAG,sBAAsB,EAAE,SAAS;EAAG,aAAU;EAAkB,aAAW,EAAE;E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;MAA7C,UAAA;OACE,kBAAC,GAAD;QAAY,OAAO;QAAG,WAAU;OAAuB,CAAA;OACvD,kBAAC,QAAD;QAAM,WAAU;QAAiD,UAAA,EAAE,QAAQ,EAAE;OAAW,CAAA;OACxF,kBAAC,QAAD;QAAM,WAAU;QAA8C,UAAA,EAAE,OAAO,gBAAgB,EAAE,KAAK;OAAQ,CAAA;MAC7F;KAEX,CAAA,IAAA,kBAAC,GAAD;MAAW,OAAO;MAAG,MAAM,EAAE;MAAM,WAAU;MAA7C,UAAA,CACE,kBAAC,QAAD;OAAM,WAAU;OAAe,UAAA,EAAE,QAAQ,EAAE;MAAW,CAAA,GACtD,kBAAC,QAAD;OAAM,WAAU;OAA6C,cAAY,EAAE,OAAO,gBAAgB,EAAE,KAAK;OACtG,UAAA,EAAM,EAAE,KAAK;MACV,CAAA,CACG;;IAEX,GAjBK,EAAE,EAiBP,CACL;GACC,CAAA,IAzBJ,kBAAC,KAAD;IAAG,WAAU;IAAwB,MAAK;IACvC,UAAA,EAAE,cAAc;GAChB,CAAA;GAyBJ,EAAK,WACJ,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,EAAK,SAAS,kBAAC,KAAD;KAAG,MAAK;KAAQ,WAAU;KAAoB,UAAA,EAAa,GAAG,EAAK,KAAK;IAAK,CAAA,GAC5F,kBAAC,GAAD;KAAQ,SAAQ;KAAU,MAAK;KAAK,UAAU,EAAK;KAAa,eAAe,KAAK,EAAK,SAAS;KAC/F,UAAA,EAAK,cAAc,EAAE,gBAAgB,IAAI,EAAK,QAAQ,EAAE,cAAc,IAAI,EAAE,iBAAiB;IACxF,CAAA,CACL;;EAES;;AAEtB"}
|
|
1
|
+
{"version":3,"file":"directory.js","names":[],"sources":["../../../src/components/groups/directory.tsx"],"sourcesContent":["import { cn } from \"cn\";\nimport { useRef, useState, type ReactNode } from \"react\";\nimport type { ContentKitUiAppearance } from \"../../appearance.js\";\nimport type { ContentKitClient } from \"../../client/client.js\";\nimport { LETTERS } from \"../../client/group-fields.js\";\nimport type { GroupCard } from \"../../client/generated/wire.js\";\nimport { useMessages } from \"../../i18n/context.js\";\nimport { useGroups, useGroupsPage, type GroupFilter, type GroupSort } from \"../../react/groups.js\";\nimport { ContentKitUiRoot } from \"../../scope.js\";\nimport { Button } from \"#ckui/ui/button\";\nimport { Skeleton } from \"#ckui/ui/skeleton\";\nimport { contentError } from \"../social/parts.js\";\nimport { SortMenu } from \"../content/listing.js\";\nimport { Pagination } from \"../content/pagination.js\";\nimport { GroupCover, GroupLink, type GroupLike } from \"./parts.js\";\n\nexport interface GroupDirectoryProps {\n /** The group kind listed: tag, artist, series. */\n kind: string;\n /** Names, counts and paths in this language; default the provider's. */\n language?: string;\n /** Count contents of this kind only; default every kind. */\n contentKind?: string;\n /** Children of this group. */\n parent?: string;\n /** Groups scoped by this group (characters of a series). */\n scope?: string;\n /** Default \"name\". With sorts, the menu's choice; with onSortChange the host keeps it. */\n sort?: GroupSort;\n /** The sorts offered as a menu; none by default. */\n sorts?: readonly GroupSort[];\n onSortChange?: (sort: GroupSort) => void;\n /** The letter bucket shown, a-z or \"#\", null for every group. With onLetterChange the host keeps it (in its URL). */\n letter?: string | null;\n onLetterChange?: (letter: string | null) => void;\n /** Hide the A-Z bar. */\n letters?: boolean;\n /** \"list\" (names with counts, default) or \"grid\" (covers). */\n layout?: \"list\" | \"grid\";\n /** A group's link; default its canonical path. */\n href?: (group: GroupLike) => string | undefined;\n /** A group's entry instead of the default one. */\n renderGroup?: (group: GroupCard) => ReactNode;\n pageSize?: number;\n /** Numbered pages with a shown range instead of load more. */\n pagination?: \"pages\";\n /** The numbered page, from 1; with onPageChange the host keeps it. A changed letter or sort starts again at page 1: a host keeping the page drops it with them. */\n page?: number;\n onPageChange?: (page: number) => void;\n /** Each numbered page's link, for crawlers and opening in a new tab. */\n pageHref?: (page: number) => string;\n client?: ContentKitClient;\n className?: string;\n appearance?: ContentKitUiAppearance;\n}\n\n/** A directory of one kind's groups: A-Z buckets, an optional sort, names with content counts or covers, paged. */\nexport function GroupDirectory(p: GroupDirectoryProps) {\n const m = useMessages();\n const { t } = m;\n const [own, setOwn] = useState<string | null>(null);\n const [ownSort, setOwnSort] = useState<GroupSort>(\"name\");\n const letter = p.letter !== undefined ? p.letter : own;\n const sort = p.sort ?? ownSort;\n const choose = (l: string | null) => (p.onLetterChange ? p.onLetterChange(l) : setOwn(l));\n const chooseSort = (s: GroupSort) => (p.onSortChange ? p.onSortChange(s) : setOwnSort(s));\n const filter: GroupFilter = { kind: p.kind, language: p.language, contentKind: p.contentKind, parent: p.parent, scope: p.scope, sort, letter: letter ?? undefined, pageSize: p.pageSize };\n return (\n <ContentKitUiRoot appearance={p.appearance} className={cn(\"grid gap-4 text-sm\", p.className)} data-ckui=\"group-directory\" data-kind={p.kind}>\n {(p.letters !== false || !!p.sorts?.length) && (\n <div className=\"flex flex-wrap items-start justify-between gap-2\">\n {p.letters !== false && (\n <nav aria-label={t(\"groups.byLetter\")} className=\"flex flex-wrap gap-1\" data-ckui=\"letters\">\n {[null, ...LETTERS].map((l) => (\n <Button\n key={l ?? \"all\"}\n size=\"xs\"\n variant={letter === l ? \"default\" : \"ghost\"}\n aria-pressed={letter === l}\n aria-label={l === null ? undefined : l === \"#\" ? t(\"groups.otherLetters\") : l.toUpperCase()}\n className=\"min-w-7\"\n onClick={() => choose(l)}\n >\n {l === null ? t(\"groups.all\") : l.toUpperCase()}\n </Button>\n ))}\n </nav>\n )}\n {!!p.sorts?.length && <SortMenu value={sort} sorts={p.sorts} onChange={chooseSort} label={(s) => t(`groups.directorySort_${s}`)} className=\"ms-auto\" />}\n </div>\n )}\n {p.pagination === \"pages\" ? <NumberedGroups {...p} filter={filter} /> : <CursorGroups {...p} filter={filter} />}\n </ContentKitUiRoot>\n );\n}\n\ntype Shown = Pick<GroupDirectoryProps, \"layout\" | \"href\" | \"renderGroup\">;\n\nfunction CursorGroups({ filter, client, ...p }: GroupDirectoryProps & { filter: GroupFilter }) {\n const m = useMessages();\n const { t } = m;\n const list = useGroups(filter, { client });\n return (\n <>\n <Groups {...p} items={list.items} loading={list.loading} error={list.error} reload={list.reload} />\n {list.hasMore && (\n <div className=\"grid justify-items-center gap-2\">\n {list.error && <p role=\"alert\" className=\"text-destructive\">{contentError(m, list.error)}</p>}\n <Button variant=\"outline\" size=\"sm\" disabled={list.loadingMore} onClick={() => void list.loadMore()}>\n {list.loadingMore ? t(\"groups.loading\") : list.error ? t(\"common.retry\") : t(\"groups.loadMore\")}\n </Button>\n </div>\n )}\n </>\n );\n}\n\nfunction NumberedGroups({ filter, client, ...p }: GroupDirectoryProps & { filter: GroupFilter }) {\n const key = JSON.stringify(filter);\n const [own, setOwn] = useState({ key, page: 1 });\n const page = Math.max(1, Math.floor(p.page ?? (own.key === key ? own.page : 1)));\n const top = useRef<HTMLDivElement>(null);\n const r = useGroupsPage(filter, page, { client });\n const size = filter.pageSize ?? 50;\n const go = (next: number, scroll: boolean) => {\n if (p.page === undefined) setOwn({ key, page: next });\n p.onPageChange?.(next);\n if (scroll) top.current?.scrollIntoView({ block: \"start\", behavior: \"smooth\" });\n };\n const controls = (bottom: boolean) =>\n r.total !== undefined ? <Pagination page={page} total={r.total} pageSize={size} range={!bottom} pageHref={p.pageHref} onPageChange={(n) => go(n, bottom)} /> : null;\n return (\n <>\n <div ref={top} className=\"scroll-mt-20\">\n {controls(false)}\n </div>\n <Groups {...p} items={r.items} loading={r.loading} error={r.error} reload={r.reload} />\n {r.items.length > 0 && controls(true)}\n </>\n );\n}\n\nfunction Groups({ items, loading, error, reload, ...p }: Shown & { items: GroupCard[]; loading: boolean; error?: Parameters<typeof contentError>[1]; reload: () => void }) {\n const m = useMessages();\n const { t } = m;\n const grid = p.layout === \"grid\";\n const count = (n: number) => new Intl.NumberFormat(m.language).format(n);\n if (loading && !items.length)\n return (\n <div className={grid ? \"grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-3\" : \"grid gap-2\"} aria-busy>\n {Array.from({ length: 6 }, (_, i) => (\n <Skeleton key={i} className={grid ? \"aspect-[3/4] w-full\" : \"h-6 w-48\"} />\n ))}\n </div>\n );\n if (error && !items.length)\n return (\n <div role=\"alert\" className=\"grid justify-items-start gap-2\">\n <p className=\"text-destructive\">{contentError(m, error)}</p>\n <Button size=\"sm\" variant=\"outline\" onClick={reload}>\n {t(\"common.retry\")}\n </Button>\n </div>\n );\n if (!items.length)\n return (\n <p className=\"text-muted-foreground\" role=\"status\">\n {t(\"groups.empty\")}\n </p>\n );\n return (\n <ul className={grid ? \"grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-3\" : \"flex flex-wrap gap-2\"} data-ckui=\"groups\">\n {items.map((g) => (\n <li key={g.id} data-ckui=\"group\" data-slug={g.slug}>\n {p.renderGroup ? (\n p.renderGroup(g)\n ) : grid ? (\n <GroupLink group={g} href={p.href} className=\"group grid gap-1.5\">\n <GroupCover group={g} className=\"aspect-[3/4] w-full\" />\n <span className=\"font-medium break-words group-hover:underline\">{g.name || g.slug}</span>\n <span className=\"text-xs text-muted-foreground tabular-nums\">{m.plural(\"groups.items\", g.count)}</span>\n </GroupLink>\n ) : (\n <GroupLink group={g} href={p.href} className=\"inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 hover:bg-muted\">\n <span className=\"break-words\">{g.name || g.slug}</span>\n <span className=\"text-xs text-muted-foreground tabular-nums\" aria-label={m.plural(\"groups.items\", g.count)}>\n {count(g.count)}\n </span>\n </GroupLink>\n )}\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAyDA,SAAgB,EAAe,GAAwB;CAErD,IAAM,EAAE,SADE,EACI,GACR,CAAC,GAAK,KAAU,EAAwB,IAAI,GAC5C,CAAC,GAAS,KAAc,EAAoB,MAAM,GAClD,IAAS,EAAE,WAAW,KAAA,IAAuB,IAAX,EAAE,QACpC,IAAO,EAAE,QAAQ,GACjB,KAAU,MAAsB,EAAE,iBAAiB,EAAE,eAAe,CAAC,IAAI,EAAO,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,MACV,kBAAC,MAAD;GAAe,aAAU;GAAQ,aAAW,EAAE;GAC3C,UAAA,EAAE,cACD,EAAE,YAAY,CAAC,IACb,IACF,kBAAC,GAAD;IAAW,OAAO;IAAG,MAAM,EAAE;IAAM,WAAU;IAA7C,UAAA;KACE,kBAAC,GAAD;MAAY,OAAO;MAAG,WAAU;KAAuB,CAAA;KACvD,kBAAC,QAAD;MAAM,WAAU;MAAiD,UAAA,EAAE,QAAQ,EAAE;KAAW,CAAA;KACxF,kBAAC,QAAD;MAAM,WAAU;MAA8C,UAAA,EAAE,OAAO,gBAAgB,EAAE,KAAK;KAAQ,CAAA;IAC7F;GAEX,CAAA,IAAA,kBAAC,GAAD;IAAW,OAAO;IAAG,MAAM,EAAE;IAAM,WAAU;IAA7C,UAAA,CACE,kBAAC,QAAD;KAAM,WAAU;KAAe,UAAA,EAAE,QAAQ,EAAE;IAAW,CAAA,GACtD,kBAAC,QAAD;KAAM,WAAU;KAA6C,cAAY,EAAE,OAAO,gBAAgB,EAAE,KAAK;KACtG,UAAA,EAAM,EAAE,KAAK;IACV,CAAA,CACG;;EAEX,GAjBK,EAAE,EAiBP,CACL;CACC,CAAA,IA1BF,kBAAC,KAAD;EAAG,WAAU;EAAwB,MAAK;EACvC,UAAA,EAAE,cAAc;CAChB,CAAA;AA0BT"}
|
|
@@ -623,14 +623,14 @@ function ne({ group: e, g: r, languages: i, onError: a }) {
|
|
|
623
623
|
}),
|
|
624
624
|
/* @__PURE__ */ W("form", {
|
|
625
625
|
className: "flex flex-wrap items-end gap-2",
|
|
626
|
-
onSubmit: (
|
|
627
|
-
|
|
628
|
-
let
|
|
629
|
-
|
|
626
|
+
onSubmit: (t) => {
|
|
627
|
+
t.preventDefault();
|
|
628
|
+
let n = new Set(e.names.filter((e) => e.language === u).map((e) => e.name.toLowerCase())), i = f === "alias" ? [...new Set(S.split(/[,\n]/).map((e) => e.trim()).filter((e) => e && !n.has(e.toLowerCase())))] : [S.trim()].filter(Boolean);
|
|
629
|
+
i.length && T.run(() => r.names("add", i.map((e) => ({
|
|
630
630
|
language: u,
|
|
631
631
|
kind: f,
|
|
632
|
-
name:
|
|
633
|
-
}
|
|
632
|
+
name: e
|
|
633
|
+
})))).then((e) => e && C(""));
|
|
634
634
|
},
|
|
635
635
|
children: [
|
|
636
636
|
O.length > 1 && /* @__PURE__ */ W(_, {
|
|
@@ -670,7 +670,7 @@ function ne({ group: e, g: r, languages: i, onError: a }) {
|
|
|
670
670
|
className: "h-8 min-w-40 flex-1",
|
|
671
671
|
lang: u,
|
|
672
672
|
value: S,
|
|
673
|
-
placeholder: o("groupEditor.newName"),
|
|
673
|
+
placeholder: o(f === "alias" ? "groupEditor.newAliases" : "groupEditor.newName"),
|
|
674
674
|
onChange: (e) => C(e.target.value)
|
|
675
675
|
}),
|
|
676
676
|
/* @__PURE__ */ U(s, {
|
|
@@ -768,9 +768,9 @@ function re({ group: e, g: r, languages: i, onError: a }) {
|
|
|
768
768
|
});
|
|
769
769
|
}
|
|
770
770
|
function ie({ group: e, spec: t, onError: r, client: i, management: a }) {
|
|
771
|
-
let { t: o } = n(), s = e.cover, c = s?.image ? "image" : s?.content_id && !s.auto ? "content" : "auto";
|
|
771
|
+
let { t: o } = n(), s = e.cover, c = s?.image ? "image" : s?.content_id && !s.auto ? "content" : "auto", l = t.owner === "user" || !!t.avatar;
|
|
772
772
|
return /* @__PURE__ */ W(J, {
|
|
773
|
-
title: o(
|
|
773
|
+
title: o(l ? "groupEditor.images" : "groupEditor.cover"),
|
|
774
774
|
ckui: "group-cover-editor",
|
|
775
775
|
children: [
|
|
776
776
|
/* @__PURE__ */ U("p", {
|
|
@@ -785,7 +785,7 @@ function ie({ group: e, spec: t, onError: r, client: i, management: a }) {
|
|
|
785
785
|
client: i,
|
|
786
786
|
onError: r
|
|
787
787
|
}),
|
|
788
|
-
|
|
788
|
+
l && /* @__PURE__ */ U(I, {
|
|
789
789
|
management: a,
|
|
790
790
|
group: e,
|
|
791
791
|
slot: "avatar",
|