@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.
- package/README.md +105 -43
- package/dist/client/beacons.d.ts +3 -13
- package/dist/client/beacons.js +4 -45
- package/dist/client/beacons.js.map +1 -1
- package/dist/client/client.d.ts +3 -0
- package/dist/client/client.js +45 -43
- package/dist/client/client.js.map +1 -1
- package/dist/client/content/favorites.d.ts +2 -0
- package/dist/client/content/favorites.js.map +1 -1
- package/dist/client/content/types.d.ts +3 -0
- package/dist/client/content/types.js.map +1 -1
- package/dist/client/discovery.d.ts +28 -3
- package/dist/client/discovery.js +22 -1
- package/dist/client/discovery.js.map +1 -1
- package/dist/client/engagement.d.ts +70 -0
- package/dist/client/engagement.js +191 -0
- package/dist/client/engagement.js.map +1 -0
- package/dist/client/generated/routes.d.ts +35 -9
- package/dist/client/generated/routes.js +59 -2
- package/dist/client/generated/routes.js.map +1 -1
- package/dist/client/generated/wire.d.ts +53 -12
- package/dist/client/generated/wire.js.map +1 -1
- package/dist/client/guest-reading-history.d.ts +40 -0
- package/dist/client/guest-reading-history.js +144 -0
- package/dist/client/guest-reading-history.js.map +1 -0
- package/dist/client/index.d.ts +4 -2
- package/dist/client/stats.d.ts +5 -5
- package/dist/client/stats.js.map +1 -1
- package/dist/client.js +24 -22
- package/dist/components/admin/content-manager.d.ts +1 -1
- package/dist/components/admin/content-manager.js +342 -302
- package/dist/components/admin/content-manager.js.map +1 -1
- package/dist/components/admin/page-review.js +106 -97
- package/dist/components/admin/page-review.js.map +1 -1
- package/dist/components/admin/quick-search.d.ts +14 -0
- package/dist/components/admin/quick-search.js +60 -0
- package/dist/components/admin/quick-search.js.map +1 -0
- package/dist/components/admin/reader-content-editor.d.ts +6 -0
- package/dist/components/admin/reader-content-editor.js +733 -0
- package/dist/components/admin/reader-content-editor.js.map +1 -0
- package/dist/components/admin/reader-manifest.js +120 -105
- package/dist/components/admin/reader-manifest.js.map +1 -1
- package/dist/components/admin/stats-dashboard.d.ts +4 -4
- package/dist/components/admin/stats-dashboard.js +132 -134
- package/dist/components/admin/stats-dashboard.js.map +1 -1
- package/dist/components/content/daily-releases.js +143 -191
- package/dist/components/content/daily-releases.js.map +1 -1
- package/dist/components/content/editor-save.d.ts +32 -0
- package/dist/components/content/editor-save.js +51 -0
- package/dist/components/content/editor-save.js.map +1 -0
- package/dist/components/content/editors.d.ts +17 -2
- package/dist/components/content/editors.js +359 -328
- package/dist/components/content/editors.js.map +1 -1
- package/dist/components/content/favorites.d.ts +6 -0
- package/dist/components/content/favorites.js +33 -0
- package/dist/components/content/favorites.js.map +1 -0
- package/dist/components/content/filter-dialog.js +19 -15
- package/dist/components/content/filter-dialog.js.map +1 -1
- package/dist/components/content/filters.d.ts +2 -0
- package/dist/components/content/filters.js +5 -1
- package/dist/components/content/filters.js.map +1 -1
- package/dist/components/content/grid.d.ts +34 -13
- package/dist/components/content/grid.js +300 -271
- package/dist/components/content/grid.js.map +1 -1
- package/dist/components/content/history.d.ts +6 -0
- package/dist/components/content/history.js +91 -0
- package/dist/components/content/history.js.map +1 -0
- package/dist/components/content/index.d.ts +1 -0
- package/dist/components/content/offer-fields.d.ts +1 -1
- package/dist/components/content/offer-fields.js +86 -64
- package/dist/components/content/offer-fields.js.map +1 -1
- package/dist/components/content/search.d.ts +11 -4
- package/dist/components/content/search.js +22 -11
- package/dist/components/content/search.js.map +1 -1
- package/dist/components/content/summary-tile.d.ts +14 -0
- package/dist/components/content/summary-tile.js +63 -0
- package/dist/components/content/summary-tile.js.map +1 -0
- package/dist/components/groups/memberships.d.ts +11 -1
- package/dist/components/groups/memberships.js +1 -1
- package/dist/components/groups/memberships.js.map +1 -1
- package/dist/components/media-folder-editor.d.ts +4 -0
- package/dist/components/media-folder-editor.js +178 -168
- package/dist/components/media-folder-editor.js.map +1 -1
- package/dist/components/video-mini-player.d.ts +4 -1
- package/dist/components/video-mini-player.js +77 -71
- package/dist/components/video-mini-player.js.map +1 -1
- package/dist/components/video-player.d.ts +4 -1
- package/dist/components/video-player.js +280 -276
- package/dist/components/video-player.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -14
- package/dist/locales/admin/de.js +33 -8
- package/dist/locales/admin/de.js.map +1 -1
- package/dist/locales/admin/en.d.ts +29 -4
- package/dist/locales/admin/en.js +33 -8
- package/dist/locales/admin/en.js.map +1 -1
- package/dist/locales/admin/es.js +33 -8
- package/dist/locales/admin/es.js.map +1 -1
- package/dist/locales/admin/ja.js +33 -8
- package/dist/locales/admin/ja.js.map +1 -1
- package/dist/locales/admin/ko.js +33 -8
- package/dist/locales/admin/ko.js.map +1 -1
- package/dist/locales/admin/zh.js +33 -8
- package/dist/locales/admin/zh.js.map +1 -1
- package/dist/locales/discovery/de.js +0 -1
- package/dist/locales/discovery/de.js.map +1 -1
- package/dist/locales/discovery/en.d.ts +0 -1
- package/dist/locales/discovery/en.js +0 -1
- package/dist/locales/discovery/en.js.map +1 -1
- package/dist/locales/discovery/es.js +0 -1
- package/dist/locales/discovery/es.js.map +1 -1
- package/dist/locales/discovery/ja.js +0 -1
- package/dist/locales/discovery/ja.js.map +1 -1
- package/dist/locales/discovery/ko.js +0 -1
- package/dist/locales/discovery/ko.js.map +1 -1
- package/dist/locales/discovery/zh.js +0 -1
- package/dist/locales/discovery/zh.js.map +1 -1
- package/dist/locales/en.d.ts +29 -5
- package/dist/react/discovery.d.ts +20 -17
- package/dist/react/discovery.js +273 -221
- package/dist/react/discovery.js.map +1 -1
- package/dist/react/index.d.ts +2 -1
- package/dist/react/page-review.d.ts +1 -1
- package/dist/react/page-review.js +6 -5
- package/dist/react/page-review.js.map +1 -1
- package/dist/react/resources.d.ts +3 -1
- package/dist/react/resources.js +4 -0
- package/dist/react/resources.js.map +1 -1
- package/dist/react/stats.d.ts +2 -2
- package/dist/react/stats.js.map +1 -1
- package/dist/react/use-draft.d.ts +8 -0
- package/dist/react/use-draft.js +35 -0
- package/dist/react/use-draft.js.map +1 -0
- package/dist/react/use-engagement.d.ts +26 -0
- package/dist/react/use-engagement.js +221 -0
- package/dist/react/use-engagement.js.map +1 -0
- package/dist/react/use-resource.d.ts +4 -3
- package/dist/react/use-resource.js +2 -1
- package/dist/react/use-resource.js.map +1 -1
- package/dist/react.js +12 -11
- package/dist/styles.css +1 -1
- package/dist/ui/dialog.d.ts +2 -1
- package/dist/ui/dialog.js +23 -20
- package/dist/ui/dialog.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { useMessages as e } from "../../i18n/context.js";
|
|
2
2
|
import { ContentKitUiRoot as t } from "../../scope.js";
|
|
3
3
|
import { ContentKitContext as n } from "../../react/context.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
4
|
+
import { useContentScope as r } from "../../react/use-resource.js";
|
|
5
|
+
import { useKinds as i } from "../../react/groups.js";
|
|
6
|
+
import { Button as a } from "../../ui/button.js";
|
|
7
|
+
import { useNearViewport as o } from "../../react/viewport.js";
|
|
8
|
+
import { Skeleton as s } from "../../ui/skeleton.js";
|
|
9
|
+
import { contentError as c } from "../social/parts.js";
|
|
10
|
+
import { useContents as l, useExposure as u, useHistory as d, useRecommendations as f, useSearch as p, useSimilar as m } from "../../react/discovery.js";
|
|
11
|
+
import { ContentCard as h } from "./card.js";
|
|
12
|
+
import { ContentFilterDialog as g } from "./filter-dialog.js";
|
|
13
|
+
import { useReleaseReveal as _ } from "./release-reveal.js";
|
|
14
|
+
import { ContentSummaryTile as v } from "./summary-tile.js";
|
|
15
|
+
import { ContentHistory as y } from "./history.js";
|
|
16
|
+
import { useCallback as b, useContext as x, useEffect as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
|
|
17
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
18
|
+
import { cn as k } from "cn";
|
|
14
19
|
//#region src/components/content/grid.tsx
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
if (!e) return { className:
|
|
20
|
+
var A = "grid grid-cols-[repeat(auto-fill,minmax(min(100%,10rem),1fr))] gap-x-4 gap-y-6";
|
|
21
|
+
function j(e) {
|
|
22
|
+
if (!e) return { className: A };
|
|
18
23
|
let t = typeof e.minCardWidth == "string" ? e.minCardWidth.trim() || "160px" : `${Number.isFinite(e.minCardWidth) ? Math.max(1, e.minCardWidth) : 160}px`, n = e.mobileColumns !== void 0 && Number.isFinite(e.mobileColumns) ? Math.max(1, Math.floor(e.mobileColumns)) : 2, r = e.maxColumns !== void 0 && Number.isFinite(e.maxColumns) ? Math.max(1, Math.floor(e.maxColumns)) : void 0;
|
|
19
24
|
return {
|
|
20
25
|
className: "grid grid-cols-[repeat(var(--ckui-card-mobile-columns),minmax(0,1fr))] gap-x-4 gap-y-6 md:grid-cols-[repeat(auto-fill,minmax(min(100%,var(--ckui-card-min-width)),1fr))]",
|
|
@@ -24,311 +29,335 @@ function E(e) {
|
|
|
24
29
|
}
|
|
25
30
|
};
|
|
26
31
|
}
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
function M(e) {
|
|
33
|
+
let { client: t, viewer: i, language: a } = r(e.client), o = x(n), [s, c] = E({
|
|
34
|
+
client: t,
|
|
35
|
+
viewer: i,
|
|
36
|
+
language: a,
|
|
37
|
+
access: o?.accessRevision,
|
|
38
|
+
render: e.render,
|
|
39
|
+
key: 0
|
|
40
|
+
}), l = s;
|
|
41
|
+
return (s.client !== t || s.viewer !== i || s.language !== a || s.access !== o?.accessRevision || s.render !== e.render) && (l = {
|
|
42
|
+
client: t,
|
|
43
|
+
viewer: i,
|
|
44
|
+
language: a,
|
|
45
|
+
access: o?.accessRevision,
|
|
46
|
+
render: e.render,
|
|
47
|
+
key: s.key + 1
|
|
48
|
+
}, c(l)), /* @__PURE__ */ D(N, { ...e }, l.key);
|
|
49
|
+
}
|
|
50
|
+
function N({ list: n, render: r, filterKinds: l, filterLanguage: d, horizontal: f, ...p }) {
|
|
51
|
+
let m = e(), { t: y } = m, { kinds: x } = i({ client: p.client }), [A, M] = E(!1), [N, P] = E(!1), F = T(null), [I, L] = E(null), [R, te] = E(0), [z, ne] = E(() => globalThis.matchMedia?.("(max-width: 767px)").matches ?? !1);
|
|
52
|
+
C(() => {
|
|
53
|
+
if (!I) return;
|
|
54
|
+
let e = () => {
|
|
55
|
+
let e = getComputedStyle(I).gridTemplateColumns.trim();
|
|
56
|
+
te(e && e !== "none" ? e.split(/\s+/).length : 0), ne(globalThis.matchMedia?.("(max-width: 767px)").matches ?? !1);
|
|
57
|
+
};
|
|
58
|
+
e();
|
|
59
|
+
let t = typeof ResizeObserver == "function" ? new ResizeObserver(e) : void 0;
|
|
60
|
+
return t?.observe(I), addEventListener("resize", e), () => {
|
|
61
|
+
t?.disconnect(), removeEventListener("resize", e);
|
|
62
|
+
};
|
|
63
|
+
}, [I]);
|
|
64
|
+
let B = n.summary?.locked_count ?? 0, V = p.showFilteredSummary === !1 ? 0 : n.summary?.filtered_count ?? 0, H = p.locked === "collapse" && !A && B > 0, U = H && B > 0 && R >= Math.max(0, p.lockedSummaryMinColumns ?? 0), W = w(() => {
|
|
65
|
+
let e = [], t = !1;
|
|
66
|
+
for (let [r, i] of n.items.entries()) {
|
|
67
|
+
if (ee(i) && (H || p.locked === "hide")) {
|
|
68
|
+
U && !t && (e.push({
|
|
69
|
+
key: "premium-summary",
|
|
70
|
+
premium: !0,
|
|
71
|
+
card: i
|
|
72
|
+
}), t = !0);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
e.push({
|
|
76
|
+
key: i.id,
|
|
77
|
+
card: i,
|
|
78
|
+
position: r + 1
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
U && !t && e.push({
|
|
82
|
+
key: "premium-summary",
|
|
83
|
+
premium: !0
|
|
84
|
+
});
|
|
85
|
+
let r = z && p.mobileCardLimit !== void 0 ? p.mobileCardLimit : p.cardLimit;
|
|
86
|
+
return r !== void 0 && Number.isFinite(r) ? e.slice(0, Math.max(0, Math.floor(r))) : e;
|
|
87
|
+
}, [
|
|
88
|
+
n.items,
|
|
89
|
+
H,
|
|
90
|
+
p.locked,
|
|
91
|
+
U,
|
|
92
|
+
z,
|
|
93
|
+
p.mobileCardLimit,
|
|
94
|
+
p.cardLimit
|
|
95
|
+
]), re = w(() => W.flatMap((e) => "premium" in e ? [] : [{
|
|
96
|
+
...e.card,
|
|
97
|
+
position: e.position
|
|
98
|
+
}]), [W]), G = u(re, {
|
|
99
|
+
surface: p.surface ?? "list",
|
|
100
|
+
render: r,
|
|
101
|
+
client: p.client
|
|
102
|
+
}), [ie, K] = o({
|
|
33
103
|
margin: "600px 0px",
|
|
34
104
|
leaveMargin: "1200px 0px"
|
|
35
|
-
}), { hasMore:
|
|
36
|
-
|
|
37
|
-
|
|
105
|
+
}), { hasMore: q, loadingMore: J, loadMore: Y, error: X } = n;
|
|
106
|
+
S(() => {
|
|
107
|
+
p.infinite && K && q && !J && !X && Y();
|
|
38
108
|
}, [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
109
|
+
p.infinite,
|
|
110
|
+
K,
|
|
111
|
+
q,
|
|
112
|
+
J,
|
|
113
|
+
Y,
|
|
114
|
+
X
|
|
45
115
|
]);
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
116
|
+
let { grid: Z, prepare: ae } = _(W.map((e) => e.key).join("\0")), oe = b((e) => {
|
|
117
|
+
Z.current = e, L(e);
|
|
118
|
+
}, [Z]), Q = f ? { className: "relative flex snap-x gap-4 overflow-x-auto pb-2 [&>li]:w-36 [&>li]:shrink-0 [&>li]:snap-start sm:[&>li]:w-44" } : j(p.grid), $ = n.summary?.truncated ? "≥ " : "", se = $ + (p.summaryLabels?.premium?.(B) ?? m.plural("contents.lockedShow", B)), ce = $ + (p.summaryLabels?.filtered?.(V) ?? m.plural("releases.filteredMore", V)), le = W.length > 0 || V > 0 || H && B > 0;
|
|
119
|
+
return /* @__PURE__ */ O(t, {
|
|
120
|
+
appearance: p.appearance,
|
|
121
|
+
className: k("grid gap-4 text-sm", p.className),
|
|
50
122
|
"data-ckui": "content-grid",
|
|
51
123
|
"aria-busy": n.loading,
|
|
52
|
-
children: [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
children: [/* @__PURE__ */ S("p", {
|
|
63
|
-
className: "text-destructive",
|
|
64
|
-
children: s(d, n.error)
|
|
65
|
-
}), /* @__PURE__ */ S(i, {
|
|
66
|
-
size: "sm",
|
|
67
|
-
variant: "outline",
|
|
68
|
-
onClick: n.reload,
|
|
69
|
-
children: f("common.retry")
|
|
70
|
-
})]
|
|
71
|
-
}) : n.items.length ? /* @__PURE__ */ S("ol", {
|
|
72
|
-
className: O.className,
|
|
73
|
-
style: O.style,
|
|
74
|
-
children: n.items.map((e, t) => /* @__PURE__ */ S("li", {
|
|
75
|
-
ref: m.track(e.id, t + 1),
|
|
76
|
-
children: l.renderCard ? l.renderCard(e, t + 1) : /* @__PURE__ */ S(g, {
|
|
77
|
-
card: e,
|
|
78
|
-
client: l.client,
|
|
79
|
-
href: l.href,
|
|
80
|
-
shape: l.shape,
|
|
81
|
-
aspectRatio: l.aspectRatio,
|
|
82
|
-
titlePosition: l.titlePosition,
|
|
83
|
-
loadMedia: l.loadMedia,
|
|
84
|
-
groupKinds: l.groupKinds,
|
|
85
|
-
chips: l.chips,
|
|
86
|
-
filterEntity: l.filterEntity,
|
|
87
|
-
entityStyle: l.entityStyle,
|
|
88
|
-
entityLayout: l.entityLayout,
|
|
89
|
-
metadata: l.metadata,
|
|
90
|
-
showCounts: l.showCounts,
|
|
91
|
-
tiers: D,
|
|
92
|
-
labels: l.labels,
|
|
93
|
-
owner: l.owner,
|
|
94
|
-
ownerHref: l.ownerHref,
|
|
95
|
-
decorate: l.decorate,
|
|
96
|
-
onOpen: () => m.click(e.id, t + 1)
|
|
97
|
-
})
|
|
98
|
-
}, e.id))
|
|
99
|
-
}) : /* @__PURE__ */ S("div", {
|
|
100
|
-
className: "text-muted-foreground",
|
|
101
|
-
role: "status",
|
|
102
|
-
children: l.empty ?? f("contents.empty")
|
|
103
|
-
}), n.hasMore && /* @__PURE__ */ C("div", {
|
|
104
|
-
ref: h,
|
|
105
|
-
className: "grid justify-items-center gap-2",
|
|
106
|
-
children: [n.error && n.items.length > 0 && /* @__PURE__ */ S("p", {
|
|
124
|
+
children: [
|
|
125
|
+
n.loading && !n.items.length ? /* @__PURE__ */ D("ol", {
|
|
126
|
+
"aria-hidden": !0,
|
|
127
|
+
className: Q.className,
|
|
128
|
+
style: Q.style,
|
|
129
|
+
children: Array.from({ length: 8 }, (e, t) => /* @__PURE__ */ D("li", { children: /* @__PURE__ */ D(s, {
|
|
130
|
+
className: p.aspectRatio === void 0 ? p.shape === "landscape" ? "aspect-video w-full" : "aspect-[3/4] w-full" : "w-full",
|
|
131
|
+
style: p.aspectRatio === void 0 ? void 0 : { aspectRatio: p.aspectRatio }
|
|
132
|
+
}) }, t))
|
|
133
|
+
}) : n.error && !n.items.length ? /* @__PURE__ */ O("div", {
|
|
107
134
|
role: "alert",
|
|
108
|
-
className: "
|
|
109
|
-
children:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
135
|
+
className: "grid justify-items-start gap-2",
|
|
136
|
+
children: [/* @__PURE__ */ D("p", {
|
|
137
|
+
className: "text-destructive",
|
|
138
|
+
children: c(m, n.error)
|
|
139
|
+
}), /* @__PURE__ */ D(a, {
|
|
140
|
+
size: "sm",
|
|
141
|
+
variant: "outline",
|
|
142
|
+
onClick: n.reload,
|
|
143
|
+
children: y("common.retry")
|
|
144
|
+
})]
|
|
145
|
+
}) : le ? /* @__PURE__ */ O("ol", {
|
|
146
|
+
ref: oe,
|
|
147
|
+
tabIndex: -1,
|
|
148
|
+
className: Q.className,
|
|
149
|
+
style: Q.style,
|
|
150
|
+
children: [W.map((e) => "premium" in e ? /* @__PURE__ */ D(v, {
|
|
151
|
+
tileKey: e.key,
|
|
152
|
+
kind: "premium",
|
|
153
|
+
contentKind: l?.[0] ?? e.card?.kind,
|
|
154
|
+
preview: e.card,
|
|
155
|
+
open: !0,
|
|
156
|
+
cardProps: p,
|
|
157
|
+
label: se,
|
|
158
|
+
onClick: (e) => {
|
|
159
|
+
ae(e.detail === 0), M(!0);
|
|
160
|
+
}
|
|
161
|
+
}, e.key) : /* @__PURE__ */ D("li", {
|
|
162
|
+
"data-release-key": e.key,
|
|
163
|
+
ref: G.track(e.card.id, e.position),
|
|
164
|
+
children: p.renderCard ? p.renderCard(e.card, e.position) : /* @__PURE__ */ D(h, {
|
|
165
|
+
card: e.card,
|
|
166
|
+
client: p.client,
|
|
167
|
+
href: p.href,
|
|
168
|
+
shape: p.shape,
|
|
169
|
+
aspectRatio: p.aspectRatio,
|
|
170
|
+
titlePosition: p.titlePosition,
|
|
171
|
+
loadMedia: p.loadMedia,
|
|
172
|
+
groupKinds: p.groupKinds,
|
|
173
|
+
chips: p.chips,
|
|
174
|
+
filterEntity: p.filterEntity,
|
|
175
|
+
entityStyle: p.entityStyle,
|
|
176
|
+
entityLayout: p.entityLayout,
|
|
177
|
+
metadata: p.metadata,
|
|
178
|
+
showCounts: p.showCounts,
|
|
179
|
+
tiers: p.tiers ?? x?.tiers,
|
|
180
|
+
labels: p.labels,
|
|
181
|
+
owner: p.owner,
|
|
182
|
+
ownerHref: p.ownerHref,
|
|
183
|
+
decorate: p.decorate,
|
|
184
|
+
onOpen: () => G.click(e.card.id, e.position)
|
|
185
|
+
})
|
|
186
|
+
}, e.key)), V > 0 && /* @__PURE__ */ D(v, {
|
|
187
|
+
tileKey: "filtered-summary",
|
|
188
|
+
kind: "filtered",
|
|
189
|
+
contentKind: l?.[0] ?? n.items[0]?.kind,
|
|
190
|
+
open: !0,
|
|
191
|
+
cardProps: p,
|
|
192
|
+
label: ce,
|
|
193
|
+
onClick: (e) => {
|
|
194
|
+
F.current = e.currentTarget, P(!0);
|
|
195
|
+
}
|
|
196
|
+
})]
|
|
197
|
+
}) : /* @__PURE__ */ D("div", {
|
|
198
|
+
className: "text-muted-foreground",
|
|
199
|
+
role: "status",
|
|
200
|
+
children: p.empty ?? y("contents.empty")
|
|
201
|
+
}),
|
|
202
|
+
n.hasMore && /* @__PURE__ */ O("div", {
|
|
203
|
+
ref: ie,
|
|
204
|
+
className: "grid justify-items-center gap-2",
|
|
205
|
+
children: [n.error && n.items.length > 0 && /* @__PURE__ */ D("p", {
|
|
206
|
+
role: "alert",
|
|
207
|
+
className: "text-destructive",
|
|
208
|
+
children: c(m, n.error)
|
|
209
|
+
}), /* @__PURE__ */ D(a, {
|
|
210
|
+
variant: "outline",
|
|
211
|
+
size: "sm",
|
|
212
|
+
disabled: n.loadingMore,
|
|
213
|
+
onClick: () => void n.loadMore(),
|
|
214
|
+
children: n.loadingMore ? y("contents.loading") : n.error ? y("common.retry") : y("contents.loadMore")
|
|
215
|
+
})]
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ D(g, {
|
|
218
|
+
open: N,
|
|
219
|
+
onOpenChange: P,
|
|
220
|
+
returnFocus: () => F.current?.isConnected ? F.current : I,
|
|
221
|
+
client: p.client,
|
|
222
|
+
kinds: l,
|
|
223
|
+
language: d,
|
|
224
|
+
counts: n.summary?.filtered_entities,
|
|
225
|
+
countsLowerBound: n.summary?.truncated,
|
|
226
|
+
appearance: p.appearance
|
|
227
|
+
})
|
|
228
|
+
]
|
|
118
229
|
});
|
|
119
230
|
}
|
|
120
|
-
|
|
231
|
+
function P(e, t) {
|
|
232
|
+
return e === "hide" ? "hide" : e === "collapse" ? "lock" : t;
|
|
233
|
+
}
|
|
234
|
+
var F = [
|
|
121
235
|
"tier",
|
|
122
236
|
"group",
|
|
123
237
|
"ppv",
|
|
124
238
|
"group_ppv"
|
|
125
|
-
];
|
|
126
|
-
function
|
|
127
|
-
let r =
|
|
239
|
+
], ee = (e) => !e.access.allowed && !e.access.unknown && F.includes(e.access.level);
|
|
240
|
+
function I({ query: e, locked: t = "show", ...n }) {
|
|
241
|
+
let r = w(() => ({
|
|
128
242
|
...e,
|
|
243
|
+
summary: e.summary ?? !0,
|
|
129
244
|
limit: e.limit ?? n.pageSize,
|
|
130
|
-
|
|
245
|
+
mode: P(t, e.mode)
|
|
131
246
|
}), [
|
|
132
247
|
e,
|
|
133
248
|
n.pageSize,
|
|
134
249
|
t
|
|
135
250
|
]), i = l(r, { client: n.client });
|
|
136
|
-
return /* @__PURE__ */
|
|
137
|
-
...n,
|
|
138
|
-
query: e
|
|
139
|
-
}), /* @__PURE__ */ S(D, {
|
|
251
|
+
return /* @__PURE__ */ D(M, {
|
|
140
252
|
...n,
|
|
253
|
+
locked: t,
|
|
141
254
|
list: i,
|
|
142
|
-
render: JSON.stringify(r)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
let a = e(), [o, s] = b(!1), { count: c } = f(n, { client: r.client }), u = y(() => o ? {
|
|
147
|
-
...n,
|
|
148
|
-
mode: "lock",
|
|
149
|
-
access: n.access ?? O,
|
|
150
|
-
limit: n.limit ?? r.pageSize
|
|
151
|
-
} : null, [
|
|
152
|
-
o,
|
|
153
|
-
n,
|
|
154
|
-
r.pageSize
|
|
155
|
-
]), d = l(u, { client: r.client }), p = y(() => d.items.filter((e) => !e.access.allowed), [d.items]);
|
|
156
|
-
return c ? /* @__PURE__ */ C(t, {
|
|
157
|
-
appearance: r.appearance,
|
|
158
|
-
className: "grid gap-3 text-sm",
|
|
159
|
-
"data-ckui": "locked-cards",
|
|
160
|
-
children: [/* @__PURE__ */ S(i, {
|
|
161
|
-
variant: "outline",
|
|
162
|
-
size: "sm",
|
|
163
|
-
className: "justify-self-start",
|
|
164
|
-
"aria-expanded": o,
|
|
165
|
-
onClick: () => s(!o),
|
|
166
|
-
children: o ? a.t("contents.lockedHide") : a.plural("contents.lockedShow", c)
|
|
167
|
-
}), o && /* @__PURE__ */ S(D, {
|
|
168
|
-
...r,
|
|
169
|
-
list: {
|
|
170
|
-
...d,
|
|
171
|
-
items: p
|
|
172
|
-
},
|
|
173
|
-
render: JSON.stringify(u)
|
|
174
|
-
})]
|
|
175
|
-
}) : null;
|
|
255
|
+
render: JSON.stringify(r),
|
|
256
|
+
filterKinds: e.kind ? [e.kind] : void 0,
|
|
257
|
+
filterLanguage: e.display_language ?? e.language
|
|
258
|
+
});
|
|
176
259
|
}
|
|
177
|
-
function
|
|
178
|
-
let { t: r } = e(), i =
|
|
260
|
+
function L({ query: t, ...n }) {
|
|
261
|
+
let { t: r } = e(), i = w(() => ({
|
|
179
262
|
...t,
|
|
263
|
+
mode: P(n.locked, t.mode),
|
|
264
|
+
summary: t.summary ?? !0,
|
|
180
265
|
limit: t.limit ?? n.pageSize
|
|
181
|
-
}), [
|
|
182
|
-
|
|
266
|
+
}), [
|
|
267
|
+
t,
|
|
268
|
+
n.pageSize,
|
|
269
|
+
n.locked
|
|
270
|
+
]), a = p(i, { client: n.client });
|
|
271
|
+
return t.q.trim() ? /* @__PURE__ */ D(M, {
|
|
183
272
|
surface: "search",
|
|
184
273
|
empty: r("contents.noResults", { q: t.q.trim() }),
|
|
185
274
|
...n,
|
|
186
275
|
list: a,
|
|
187
|
-
render: JSON.stringify(i)
|
|
276
|
+
render: JSON.stringify(i),
|
|
277
|
+
filterKinds: t.kind ? [t.kind] : void 0,
|
|
278
|
+
filterLanguage: t.display_language ?? t.language
|
|
188
279
|
}) : null;
|
|
189
280
|
}
|
|
190
|
-
function
|
|
191
|
-
let
|
|
192
|
-
...
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
children: a("contents.clearHistory")
|
|
208
|
-
}), /* @__PURE__ */ S(D, {
|
|
209
|
-
surface: "history",
|
|
210
|
-
empty: a("contents.historyEmpty"),
|
|
211
|
-
...r,
|
|
212
|
-
list: l,
|
|
213
|
-
render: JSON.stringify(s),
|
|
214
|
-
renderCard: r.renderCard ?? ((e) => /* @__PURE__ */ S(g, {
|
|
215
|
-
card: e,
|
|
216
|
-
client: r.client,
|
|
217
|
-
href: r.href,
|
|
218
|
-
shape: r.shape,
|
|
219
|
-
aspectRatio: r.aspectRatio,
|
|
220
|
-
titlePosition: r.titlePosition,
|
|
221
|
-
loadMedia: r.loadMedia,
|
|
222
|
-
groupKinds: r.groupKinds,
|
|
223
|
-
chips: r.chips,
|
|
224
|
-
filterEntity: r.filterEntity,
|
|
225
|
-
entityStyle: r.entityStyle,
|
|
226
|
-
entityLayout: r.entityLayout,
|
|
227
|
-
metadata: r.metadata,
|
|
228
|
-
showCounts: r.showCounts,
|
|
229
|
-
tiers: r.tiers,
|
|
230
|
-
labels: r.labels,
|
|
231
|
-
owner: r.owner,
|
|
232
|
-
ownerHref: r.ownerHref,
|
|
233
|
-
decorate: r.decorate,
|
|
234
|
-
children: /* @__PURE__ */ S(i, {
|
|
235
|
-
size: "xs",
|
|
236
|
-
variant: "ghost",
|
|
237
|
-
className: "justify-self-start",
|
|
238
|
-
disabled: u.pending,
|
|
239
|
-
onClick: () => void u.run(() => l.forget({ content_id: e.id })),
|
|
240
|
-
children: a("contents.removeFromHistory")
|
|
241
|
-
})
|
|
242
|
-
}))
|
|
243
|
-
})]
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
function N({ title: e, similar: n, recommendations: i, history: a, group: s, list: c, query: f = {}, more: m, ..._ }) {
|
|
247
|
-
let v = f.limit ?? _.pageSize ?? 12, b = y(() => ({
|
|
248
|
-
...f,
|
|
249
|
-
limit: v
|
|
250
|
-
}), [f, v]), x = y(() => c ? {
|
|
251
|
-
...c,
|
|
252
|
-
limit: c.limit ?? v
|
|
253
|
-
} : s ? {
|
|
254
|
-
groups: [s],
|
|
281
|
+
function R({ title: e, similar: n, recommendations: r, history: i, group: a, list: o, query: s = {}, more: c, ...u }) {
|
|
282
|
+
let p = s.limit ?? u.pageSize ?? 12, h = w(() => ({
|
|
283
|
+
...s,
|
|
284
|
+
mode: P(u.locked, s.mode),
|
|
285
|
+
summary: s.summary ?? !0,
|
|
286
|
+
limit: p
|
|
287
|
+
}), [
|
|
288
|
+
s,
|
|
289
|
+
p,
|
|
290
|
+
u.locked
|
|
291
|
+
]), g = w(() => o ? {
|
|
292
|
+
...o,
|
|
293
|
+
mode: P(u.locked, o.mode),
|
|
294
|
+
summary: o.summary ?? !0,
|
|
295
|
+
limit: o.limit ?? p
|
|
296
|
+
} : a ? {
|
|
297
|
+
groups: [a],
|
|
255
298
|
sort: "position",
|
|
256
|
-
|
|
299
|
+
mode: P(u.locked),
|
|
300
|
+
summary: !0,
|
|
301
|
+
limit: p
|
|
257
302
|
} : null, [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
303
|
+
o,
|
|
304
|
+
a,
|
|
305
|
+
p,
|
|
306
|
+
u.locked
|
|
307
|
+
]), _ = m(r || i || g ? null : n, h, { client: u.client }), v = f(r ? h : null, { client: u.client }), y = d(i ? {
|
|
308
|
+
...i,
|
|
309
|
+
mode: P(u.locked, i.mode),
|
|
310
|
+
summary: i.summary ?? !0,
|
|
311
|
+
limit: i.limit ?? p
|
|
312
|
+
} : null, { client: u.client }), b = l(g, { client: u.client }), x = r ? v : i || g ? (() => {
|
|
313
|
+
let e = i ? y : b;
|
|
266
314
|
return {
|
|
267
315
|
items: e.items,
|
|
316
|
+
summary: e.summary,
|
|
268
317
|
loading: e.loading,
|
|
269
318
|
error: e.error,
|
|
270
319
|
unavailable: e.error?.code === "not_configured",
|
|
271
320
|
reload: e.reload
|
|
272
321
|
};
|
|
273
|
-
})() :
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}), P = n || i || a || s || x, F = _.grid ? E(_.grid) : void 0;
|
|
285
|
-
return !P || A.unavailable || !A.loading && !A.items.length ? null : /* @__PURE__ */ C(t, {
|
|
286
|
-
appearance: _.appearance,
|
|
287
|
-
className: w("grid gap-3 text-sm", _.className),
|
|
322
|
+
})() : _, S = u.surface ?? (r ? "recommendations" : i ? "history" : a ? "featured" : g ? "list" : "similar");
|
|
323
|
+
if (!(n || r || i || a || g) || x.unavailable || !x.loading && !x.items.length && !x.summary?.filtered_count && !x.summary?.locked_count) return null;
|
|
324
|
+
let C = {
|
|
325
|
+
...x,
|
|
326
|
+
loadingMore: !1,
|
|
327
|
+
hasMore: !1,
|
|
328
|
+
loadMore: async () => {}
|
|
329
|
+
}, T = o?.kind ?? i?.kind ?? h.kind;
|
|
330
|
+
return /* @__PURE__ */ O(t, {
|
|
331
|
+
appearance: u.appearance,
|
|
332
|
+
className: k("grid gap-3 text-sm", u.className),
|
|
288
333
|
"data-ckui": "content-rail",
|
|
289
|
-
"data-surface":
|
|
290
|
-
children: [/* @__PURE__ */
|
|
334
|
+
"data-surface": S,
|
|
335
|
+
children: [/* @__PURE__ */ O("div", {
|
|
291
336
|
className: "flex items-baseline justify-between gap-2",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ D("h2", {
|
|
293
338
|
className: "text-base font-semibold",
|
|
294
339
|
children: e
|
|
295
|
-
}),
|
|
296
|
-
}), /* @__PURE__ */
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
filterEntity: _.filterEntity,
|
|
313
|
-
entityStyle: _.entityStyle,
|
|
314
|
-
entityLayout: _.entityLayout,
|
|
315
|
-
metadata: _.metadata,
|
|
316
|
-
showCounts: _.showCounts,
|
|
317
|
-
tiers: _.tiers ?? j?.tiers,
|
|
318
|
-
labels: _.labels,
|
|
319
|
-
owner: _.owner,
|
|
320
|
-
ownerHref: _.ownerHref,
|
|
321
|
-
decorate: _.decorate,
|
|
322
|
-
onOpen: () => N.click(e.id, t + 1)
|
|
323
|
-
}) : /* @__PURE__ */ S(o, {
|
|
324
|
-
className: _.aspectRatio === void 0 ? _.shape === "landscape" ? "aspect-video w-full" : "aspect-[3/4] w-full" : "w-full",
|
|
325
|
-
style: _.aspectRatio === void 0 ? void 0 : { aspectRatio: _.aspectRatio }
|
|
326
|
-
})
|
|
327
|
-
}, e?.id ?? t))
|
|
340
|
+
}), c]
|
|
341
|
+
}), /* @__PURE__ */ D(M, {
|
|
342
|
+
...u,
|
|
343
|
+
className: void 0,
|
|
344
|
+
surface: S,
|
|
345
|
+
horizontal: !u.grid,
|
|
346
|
+
list: C,
|
|
347
|
+
render: JSON.stringify([
|
|
348
|
+
n,
|
|
349
|
+
r,
|
|
350
|
+
i,
|
|
351
|
+
a,
|
|
352
|
+
g,
|
|
353
|
+
h
|
|
354
|
+
]),
|
|
355
|
+
filterKinds: T ? [T] : void 0,
|
|
356
|
+
filterLanguage: o?.display_language ?? i?.display_language ?? h.display_language ?? o?.language ?? i?.language ?? h.language
|
|
328
357
|
})]
|
|
329
358
|
});
|
|
330
359
|
}
|
|
331
360
|
//#endregion
|
|
332
|
-
export {
|
|
361
|
+
export { M as CardGrid, I as ContentGrid, y as ContentHistory, R as ContentRail, L as SearchResults, j as cardGridLayout, P as cardListMode };
|
|
333
362
|
|
|
334
363
|
//# sourceMappingURL=grid.js.map
|