@flamingo-stack/openframe-frontend-core 0.0.364 → 0.0.365-snapshot.20260703164521
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/dist/{chunk-KGPDDWHM.js → chunk-3VGGQJIG.js} +19 -12
- package/dist/chunk-3VGGQJIG.js.map +1 -0
- package/dist/{chunk-6RQY3G72.js → chunk-57YGF3UX.js} +5 -5
- package/dist/chunk-57YGF3UX.js.map +1 -0
- package/dist/{chunk-3V2ZOHYZ.js → chunk-5UYS6HX6.js} +5 -4
- package/dist/{chunk-3V2ZOHYZ.js.map → chunk-5UYS6HX6.js.map} +1 -1
- package/dist/{chunk-ATKZKYVG.cjs → chunk-65R4KAF3.cjs} +16 -15
- package/dist/chunk-65R4KAF3.cjs.map +1 -0
- package/dist/{chunk-SF2OTFEP.js → chunk-AWSBFLM4.js} +2 -2
- package/dist/{chunk-3FGFGOH5.cjs → chunk-BFIXLKD7.cjs} +26 -25
- package/dist/chunk-BFIXLKD7.cjs.map +1 -0
- package/dist/{chunk-JEISYOQP.js → chunk-BTPPX4OH.js} +3 -3
- package/dist/{chunk-JEISYOQP.js.map → chunk-BTPPX4OH.js.map} +1 -1
- package/dist/{chunk-XDX45KT4.cjs → chunk-BW5TNAAB.cjs} +12 -12
- package/dist/{chunk-XDX45KT4.cjs.map → chunk-BW5TNAAB.cjs.map} +1 -1
- package/dist/{chunk-TE6HGB2A.js → chunk-FGSAACQ6.js} +2 -2
- package/dist/{chunk-GCUFSMBO.cjs → chunk-HY6SX7SY.cjs} +26 -26
- package/dist/{chunk-GCUFSMBO.cjs.map → chunk-HY6SX7SY.cjs.map} +1 -1
- package/dist/{chunk-FHENLKPY.cjs → chunk-J4TUSKUD.cjs} +5 -5
- package/dist/{chunk-FHENLKPY.cjs.map → chunk-J4TUSKUD.cjs.map} +1 -1
- package/dist/{chunk-PZKD2ZNQ.cjs → chunk-JA6Y4RQA.cjs} +7 -7
- package/dist/{chunk-PZKD2ZNQ.cjs.map → chunk-JA6Y4RQA.cjs.map} +1 -1
- package/dist/{chunk-6SELLOJA.js → chunk-JCVQ25SH.js} +4 -4
- package/dist/{chunk-A5WSWLKX.js → chunk-KY5R4WEH.js} +3 -2
- package/dist/chunk-KY5R4WEH.js.map +1 -0
- package/dist/{chunk-POOQCMCE.js → chunk-LB7GFBSI.js} +2 -2
- package/dist/{chunk-VIU6ALFT.cjs → chunk-MHQ7FGTU.cjs} +308 -260
- package/dist/chunk-MHQ7FGTU.cjs.map +1 -0
- package/dist/{chunk-A2DNPXQG.cjs → chunk-OYBPLAEL.cjs} +62 -62
- package/dist/{chunk-A2DNPXQG.cjs.map → chunk-OYBPLAEL.cjs.map} +1 -1
- package/dist/{chunk-UDMNQVDT.cjs → chunk-R7REILGJ.cjs} +9 -9
- package/dist/{chunk-UDMNQVDT.cjs.map → chunk-R7REILGJ.cjs.map} +1 -1
- package/dist/{chunk-QYL66BBH.js → chunk-SELQ4BMB.js} +2 -2
- package/dist/{chunk-ELNJDABM.js → chunk-VJNA6NSE.js} +3643 -3595
- package/dist/chunk-VJNA6NSE.js.map +1 -0
- package/dist/{chunk-ILIPF3MX.js → chunk-XDAAWSBX.js} +2 -2
- package/dist/{chunk-S2PKJCXQ.cjs → chunk-ZDXDRYAC.cjs} +70 -63
- package/dist/chunk-ZDXDRYAC.cjs.map +1 -0
- package/dist/{chunk-IQYROTER.cjs → chunk-ZV4736W2.cjs} +37 -37
- package/dist/{chunk-IQYROTER.cjs.map → chunk-ZV4736W2.cjs.map} +1 -1
- package/dist/{chunk-ZZQMVKBT.cjs → chunk-ZYK4YPUJ.cjs} +31 -31
- package/dist/chunk-ZYK4YPUJ.cjs.map +1 -0
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/index.cjs +4 -2
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.js +3 -1
- package/dist/components/chat/quick-action-chip.d.ts +19 -0
- package/dist/components/chat/quick-action-chip.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +20 -20
- package/dist/components/help-center-pages/index.js +11 -11
- package/dist/components/index.cjs +124 -120
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +13 -9
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/page-layout.d.ts +5 -1
- package/dist/components/layout/page-layout.d.ts.map +1 -1
- package/dist/components/layout/title-block.d.ts +5 -1
- package/dist/components/layout/title-block.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -1
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/shared/dev-section/dev-section-page.d.ts.map +1 -1
- package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +5 -5
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/fade-preview.d.ts +33 -0
- package/dist/components/ui/fade-preview.d.ts.map +1 -0
- package/dist/components/ui/index.cjs +6 -2
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +5 -1
- package/dist/components/ui/release-changelog-section.d.ts.map +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -1
- package/package.json +1 -1
- package/src/components/chat/quick-action-chip.tsx +46 -0
- package/src/components/docs/doc-viewer.tsx +1 -1
- package/src/components/faq/faq-document-page.tsx +1 -1
- package/src/components/layout/page-layout.tsx +11 -0
- package/src/components/layout/title-block.tsx +24 -4
- package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +1 -0
- package/src/components/shared/dev-section/dev-section-page.tsx +1 -0
- package/src/components/shared/legal-document/legal-document-page.tsx +1 -1
- package/src/components/shared/product-release/release-detail-page.tsx +26 -5
- package/src/components/ui/fade-preview.tsx +87 -0
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/release-changelog-section.tsx +12 -50
- package/dist/chunk-3FGFGOH5.cjs.map +0 -1
- package/dist/chunk-6RQY3G72.js.map +0 -1
- package/dist/chunk-A5WSWLKX.js.map +0 -1
- package/dist/chunk-ATKZKYVG.cjs.map +0 -1
- package/dist/chunk-ELNJDABM.js.map +0 -1
- package/dist/chunk-KGPDDWHM.js.map +0 -1
- package/dist/chunk-S2PKJCXQ.cjs.map +0 -1
- package/dist/chunk-VIU6ALFT.cjs.map +0 -1
- package/dist/chunk-ZZQMVKBT.cjs.map +0 -1
- /package/dist/{chunk-SF2OTFEP.js.map → chunk-AWSBFLM4.js.map} +0 -0
- /package/dist/{chunk-TE6HGB2A.js.map → chunk-FGSAACQ6.js.map} +0 -0
- /package/dist/{chunk-6SELLOJA.js.map → chunk-JCVQ25SH.js.map} +0 -0
- /package/dist/{chunk-POOQCMCE.js.map → chunk-LB7GFBSI.js.map} +0 -0
- /package/dist/{chunk-QYL66BBH.js.map → chunk-SELQ4BMB.js.map} +0 -0
- /package/dist/{chunk-ILIPF3MX.js.map → chunk-XDAAWSBX.js.map} +0 -0
|
@@ -38,6 +38,14 @@
|
|
|
38
38
|
* the loaded one — used by page skeletons that render through `PageLayout`).
|
|
39
39
|
* Both are additive + default-preserving: omit them and every existing caller is
|
|
40
40
|
* byte-identical. Do NOT change defaults or touch anything else here.
|
|
41
|
+
*
|
|
42
|
+
* SANCTIONED EXCEPTION (2026-07, explicit human sign-off): the OPTIONAL
|
|
43
|
+
* `titleWrap` prop. Defaults to `false` — the frozen single-line `truncate`
|
|
44
|
+
* baseline is unchanged for every existing caller. Content DETAIL pages (whose
|
|
45
|
+
* h1 is CMS data of arbitrary length — releases, legal docs, FAQ docs, dev
|
|
46
|
+
* sections) pass `titleWrap` to let the title wrap onto multiple lines instead
|
|
47
|
+
* of being ellipsis-clipped. Additive + default-preserving; do NOT change the
|
|
48
|
+
* default or touch anything else here.
|
|
41
49
|
* ========================================================================== */
|
|
42
50
|
|
|
43
51
|
import React from 'react'
|
|
@@ -86,6 +94,10 @@ export interface TitleBlockProps {
|
|
|
86
94
|
* (typography + surrounding markup unchanged, so header height is identical to loaded).
|
|
87
95
|
* Additive + default-preserving: omit it and every existing caller is byte-identical. */
|
|
88
96
|
loading?: boolean
|
|
97
|
+
/** When true, a long title WRAPS onto multiple lines instead of the frozen single-line
|
|
98
|
+
* ellipsis clamp. For content detail pages whose h1 is CMS data of arbitrary length.
|
|
99
|
+
* Additive + default-preserving: omit it and every existing caller is byte-identical. */
|
|
100
|
+
titleWrap?: boolean
|
|
89
101
|
}
|
|
90
102
|
|
|
91
103
|
/**
|
|
@@ -119,10 +131,14 @@ export function TitleBlock({
|
|
|
119
131
|
titleSize = 'h2',
|
|
120
132
|
titleAdornment,
|
|
121
133
|
loading,
|
|
134
|
+
titleWrap = false,
|
|
122
135
|
}: TitleBlockProps) {
|
|
123
136
|
const hasActions = actions && actions.length > 0
|
|
124
137
|
const hasMenuActions = !!menuActions && menuActions.some(g => g.items.length > 0)
|
|
125
138
|
const titleClass = titleSize === 'h1' ? 'text-h1' : 'text-h2'
|
|
139
|
+
// Frozen baseline is the single-line `truncate`; `titleWrap` swaps it for
|
|
140
|
+
// multi-line wrapping (break-words guards pathological unbroken tokens).
|
|
141
|
+
const titleOverflowClass = titleWrap ? 'break-words' : 'truncate'
|
|
126
142
|
|
|
127
143
|
return (
|
|
128
144
|
<div
|
|
@@ -163,11 +179,11 @@ export function TitleBlock({
|
|
|
163
179
|
{(loading || title) && (
|
|
164
180
|
titleAdornment ? (
|
|
165
181
|
<div className="flex items-center gap-[var(--spacing-system-m)] min-w-0 w-full">
|
|
166
|
-
<h1 className={cn(titleClass, 'text-ods-text-primary
|
|
182
|
+
<h1 className={cn(titleClass, 'text-ods-text-primary min-w-0', titleOverflowClass)} title={title}>{loading ? <TitleTextSkeleton widthClass="w-48 md:w-72" heightClass="h-4 md:h-6" /> : title}</h1>
|
|
167
183
|
<span className="shrink-0">{titleAdornment}</span>
|
|
168
184
|
</div>
|
|
169
185
|
) : (
|
|
170
|
-
<h1 className={cn(titleClass, 'text-ods-text-primary
|
|
186
|
+
<h1 className={cn(titleClass, 'text-ods-text-primary', titleOverflowClass)} title={title}>{loading ? <TitleTextSkeleton widthClass="w-48 md:w-72" heightClass="h-4 md:h-6" /> : title}</h1>
|
|
171
187
|
)
|
|
172
188
|
)}
|
|
173
189
|
{subtitle && (
|
|
@@ -179,11 +195,15 @@ export function TitleBlock({
|
|
|
179
195
|
title && (
|
|
180
196
|
titleAdornment ? (
|
|
181
197
|
<div className="flex items-center gap-[var(--spacing-system-m)] min-w-0 w-full">
|
|
182
|
-
<h1 className={cn(titleClass, 'text-ods-text-primary
|
|
198
|
+
<h1 className={cn(titleClass, 'text-ods-text-primary min-w-0', titleOverflowClass)} title={title}>{title}</h1>
|
|
183
199
|
<span className="shrink-0">{titleAdornment}</span>
|
|
184
200
|
</div>
|
|
185
201
|
) : (
|
|
186
|
-
|
|
202
|
+
/* This branch never had the single-line clamp, so text already
|
|
203
|
+
wraps; `titleWrap` only adds break-words for pathological
|
|
204
|
+
unbroken tokens. No class change when the prop is unset —
|
|
205
|
+
the frozen baseline stays byte-identical. */
|
|
206
|
+
<h1 className={cn(titleClass, 'text-ods-text-primary', titleWrap && 'break-words')}>{title}</h1>
|
|
187
207
|
)
|
|
188
208
|
)
|
|
189
209
|
)}
|
|
@@ -161,6 +161,7 @@ export function OnboardingGuideDetailView({
|
|
|
161
161
|
<PageLayout
|
|
162
162
|
title={guide.title}
|
|
163
163
|
titleSize="h1"
|
|
164
|
+
titleWrap
|
|
164
165
|
backButton={{ label: backLabel, onClick: () => router.push(resolvedBackHref) }}
|
|
165
166
|
>
|
|
166
167
|
{/* Tags — flat onboarding_guide_tags[] from entity_tags. */}
|
|
@@ -89,6 +89,7 @@ export function DevSectionPage({
|
|
|
89
89
|
title={title ?? section.hero.title}
|
|
90
90
|
subtitle={subtitle ?? section.hero.description}
|
|
91
91
|
titleSize="h1"
|
|
92
|
+
titleWrap
|
|
92
93
|
backButton={backCfg}
|
|
93
94
|
>
|
|
94
95
|
<DevSectionView sectionKey={sectionKey} showHeading={false} preControls={preControls}>
|
|
@@ -108,7 +108,7 @@ export function LegalDocumentPage({
|
|
|
108
108
|
const subtitle = effectiveLastUpdatedLabel ? `Last Updated: ${effectiveLastUpdatedLabel}` : fallbackDescription;
|
|
109
109
|
|
|
110
110
|
const inner = (
|
|
111
|
-
<PageLayout title={title} subtitle={subtitle} backButton={backCfg} titleSize="h1">
|
|
111
|
+
<PageLayout title={title} subtitle={subtitle} backButton={backCfg} titleSize="h1" titleWrap>
|
|
112
112
|
{data?.sourceFile && (
|
|
113
113
|
<p className="font-['DM_Sans'] text-sm text-ods-text-secondary opacity-75">Source: {data.sourceFile}</p>
|
|
114
114
|
)}
|
|
@@ -9,6 +9,7 @@ import { Card, CardContent } from '../../ui/card';
|
|
|
9
9
|
// the rail, see hub detail-container alignment decision 2026-06-10).
|
|
10
10
|
import { PageShell } from '../../layout/article-detail-layout';
|
|
11
11
|
import { PageLayout } from '../../layout/page-layout';
|
|
12
|
+
import { FadePreview } from '../../ui/fade-preview';
|
|
12
13
|
import { ReleaseChangelogSection } from '../../ui/release-changelog-section';
|
|
13
14
|
import { RichMarkdownRenderer } from '../../ui/rich-markdown-renderer';
|
|
14
15
|
import { EntityTagBadges } from '../../features/entity-tag-badges';
|
|
@@ -257,6 +258,7 @@ export function ReleaseDetailPage({
|
|
|
257
258
|
title={releaseTitle}
|
|
258
259
|
subtitle={`Version: ${releaseVersion}`}
|
|
259
260
|
titleSize="h1"
|
|
261
|
+
titleWrap
|
|
260
262
|
backButton={
|
|
261
263
|
showBackButton ? { label: backLabel, onClick: () => router.push(backHref) } : undefined
|
|
262
264
|
}
|
|
@@ -461,16 +463,35 @@ export function ReleaseDetailPage({
|
|
|
461
463
|
</div>
|
|
462
464
|
)}
|
|
463
465
|
|
|
464
|
-
{/* Bug-fixes & Enhancements Section
|
|
466
|
+
{/* Bug-fixes & Enhancements Section — releases can link dozens of
|
|
467
|
+
delivery tasks, so the list gets the same `FadePreview`
|
|
468
|
+
progressive disclosure as the changelog sections above: first
|
|
469
|
+
row visible, rest fade-masked behind "Show N more". */}
|
|
465
470
|
{DeliverySection && (deliveryLoading || (deliveryData && (deliveryData.completed.length > 0 || deliveryData.inProgress.length > 0))) && (
|
|
466
471
|
<div className="w-full space-y-4">
|
|
467
472
|
<p className="text-h5 tracking-[-0.28px] text-ods-text-secondary">
|
|
468
473
|
Related Enhancements and Bug-fixes
|
|
469
474
|
</p>
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
475
|
+
{(() => {
|
|
476
|
+
const deliveryCount = deliveryData
|
|
477
|
+
? deliveryData.completed.length + deliveryData.inProgress.length
|
|
478
|
+
: 0;
|
|
479
|
+
return deliveryLoading ? (
|
|
480
|
+
<DeliverySection data={deliveryData} isLoading={deliveryLoading} />
|
|
481
|
+
) : (
|
|
482
|
+
<FadePreview
|
|
483
|
+
hiddenCount={deliveryCount - 1}
|
|
484
|
+
collapsedHeight={300}
|
|
485
|
+
resetKey={deliveryCount}
|
|
486
|
+
>
|
|
487
|
+
{/* space-y-4 restores the completed/in-progress table gap the
|
|
488
|
+
parent's space-y used to provide before the fade wrapper. */}
|
|
489
|
+
<div className="space-y-4">
|
|
490
|
+
<DeliverySection data={deliveryData} isLoading={false} />
|
|
491
|
+
</div>
|
|
492
|
+
</FadePreview>
|
|
493
|
+
);
|
|
494
|
+
})()}
|
|
474
495
|
</div>
|
|
475
496
|
)}
|
|
476
497
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import { ChevronDown } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* FadePreview — the single shared progressive-disclosure primitive for
|
|
8
|
+
* long lists/sections: renders children inside a height-clamped wrapper
|
|
9
|
+
* whose bottom fades out via a CSS mask, with a "Show N more / Show less"
|
|
10
|
+
* toggle below.
|
|
11
|
+
*
|
|
12
|
+
* Extracted from `ReleaseChangelogSection`'s `previewFirst` mode (which
|
|
13
|
+
* itself unified the investor-update detail page's duplicated
|
|
14
|
+
* `FadedHighlightSection`). Every fade-preview surface must compose THIS
|
|
15
|
+
* component — do not re-inline the mask/clamp/toggle trio.
|
|
16
|
+
*
|
|
17
|
+
* When `hiddenCount <= 0` the children render unclamped and no toggle
|
|
18
|
+
* shows (single-entry sections need no disclosure).
|
|
19
|
+
*/
|
|
20
|
+
export interface FadePreviewProps {
|
|
21
|
+
/** How many items are visually hidden while collapsed — drives the
|
|
22
|
+
* "Show N more" label. Pass `total - visible`; `<= 0` disables the
|
|
23
|
+
* clamp + fade + toggle entirely. */
|
|
24
|
+
hiddenCount: number;
|
|
25
|
+
/** Collapsed height in px. ~120 shows one changelog entry's title +
|
|
26
|
+
* the start of its description before the mask kicks in. Callers with
|
|
27
|
+
* taller rows (e.g. delivery tables) pass a larger value. */
|
|
28
|
+
collapsedHeight?: number;
|
|
29
|
+
/** Reset the expanded state when this value changes — otherwise a
|
|
30
|
+
* parent that refetches and shrinks the list would leave a stale
|
|
31
|
+
* "expanded" state and a momentarily-wrong "Show 0 more" button.
|
|
32
|
+
* Callers typically pass the item count. */
|
|
33
|
+
resetKey?: unknown;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function FadePreview({
|
|
38
|
+
hiddenCount,
|
|
39
|
+
collapsedHeight = 120,
|
|
40
|
+
resetKey,
|
|
41
|
+
children,
|
|
42
|
+
}: FadePreviewProps) {
|
|
43
|
+
const [expanded, setExpanded] = useState(false);
|
|
44
|
+
const contentRef = useRef<HTMLDivElement>(null);
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
setExpanded(false);
|
|
48
|
+
}, [resetKey]);
|
|
49
|
+
|
|
50
|
+
const needsFade = hiddenCount > 0;
|
|
51
|
+
|
|
52
|
+
// No disclosure needed → no clamp wrapper at all. (Keeping the wrapper
|
|
53
|
+
// with a `scrollHeight ?? 2000` max-height would clip tall content on
|
|
54
|
+
// the first render, before the ref measures.)
|
|
55
|
+
if (!needsFade) return <>{children}</>;
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div className="relative">
|
|
59
|
+
<div
|
|
60
|
+
ref={contentRef}
|
|
61
|
+
className="overflow-hidden transition-[max-height] duration-500"
|
|
62
|
+
style={{
|
|
63
|
+
transitionTimingFunction: 'cubic-bezier(0.33, 1, 0.68, 1)',
|
|
64
|
+
maxHeight: expanded
|
|
65
|
+
? contentRef.current?.scrollHeight ?? 2000
|
|
66
|
+
: collapsedHeight,
|
|
67
|
+
...(!expanded ? {
|
|
68
|
+
maskImage: 'linear-gradient(to bottom, black 30%, transparent 100%)',
|
|
69
|
+
WebkitMaskImage: 'linear-gradient(to bottom, black 30%, transparent 100%)',
|
|
70
|
+
} : {}),
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
{children}
|
|
74
|
+
</div>
|
|
75
|
+
<button
|
|
76
|
+
type="button"
|
|
77
|
+
onClick={() => setExpanded(!expanded)}
|
|
78
|
+
className="mt-4 flex items-center gap-1.5 text-sm text-ods-text-secondary hover:text-ods-accent transition-colors duration-200"
|
|
79
|
+
>
|
|
80
|
+
<span>{expanded ? 'Show less' : `Show ${hiddenCount} more`}</span>
|
|
81
|
+
<ChevronDown
|
|
82
|
+
className={`w-3.5 h-3.5 transition-transform duration-300 ${expanded ? 'rotate-180' : ''}`}
|
|
83
|
+
/>
|
|
84
|
+
</button>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -53,6 +53,7 @@ export * from './tab-navigation'
|
|
|
53
53
|
export * from './alert'
|
|
54
54
|
export * from './badge'
|
|
55
55
|
export * from './ai-generated-badge'
|
|
56
|
+
export * from './fade-preview'
|
|
56
57
|
export * from './progress'
|
|
57
58
|
export * from './release-changelog-section'
|
|
58
59
|
export * from './stacked-rows-panel'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, { useState
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
4
|
import { Badge } from './badge';
|
|
5
5
|
import { ChevronDown } from 'lucide-react';
|
|
6
|
+
import { FadePreview } from './fade-preview';
|
|
6
7
|
import { RichMarkdownRenderer } from './rich-markdown-renderer';
|
|
7
8
|
import type { ChangelogEntry } from '../../types/product-release';
|
|
8
9
|
|
|
@@ -55,24 +56,11 @@ export function ReleaseChangelogSection({
|
|
|
55
56
|
MarkdownRenderer = RichMarkdownRenderer,
|
|
56
57
|
}: ReleaseChangelogSectionProps) {
|
|
57
58
|
const [collapsed, setCollapsed] = useState(collapsible ? defaultCollapsed : false);
|
|
58
|
-
const [previewExpanded, setPreviewExpanded] = useState(false);
|
|
59
|
-
const previewContentRef = useRef<HTMLDivElement>(null);
|
|
60
|
-
|
|
61
|
-
// Reset preview-expanded state when the entries set changes — otherwise
|
|
62
|
-
// a parent that refetches and shrinks entries from N → 1 would leave
|
|
63
|
-
// the user with a stale "expanded" state and a momentarily-wrong
|
|
64
|
-
// "Show 0 more" button before the `previewNeedsFade` gate hides it.
|
|
65
|
-
// Keyed on `entries.length` (not identity) so re-renders with the same
|
|
66
|
-
// length don't churn state unnecessarily.
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
setPreviewExpanded(false);
|
|
69
|
-
}, [entries.length]);
|
|
70
59
|
|
|
71
60
|
if (!entries || entries.length === 0) return null;
|
|
72
61
|
|
|
73
62
|
// collapsible wins when both flags are passed (documented in JSDoc).
|
|
74
63
|
const inPreviewMode = previewFirst && !collapsible;
|
|
75
|
-
const previewNeedsFade = inPreviewMode && entries.length > 1;
|
|
76
64
|
const showEntries = !collapsible || !collapsed;
|
|
77
65
|
|
|
78
66
|
return (
|
|
@@ -105,42 +93,16 @@ export function ReleaseChangelogSection({
|
|
|
105
93
|
)}
|
|
106
94
|
{showEntries && (
|
|
107
95
|
inPreviewMode ? (
|
|
108
|
-
/* Preview-first mode:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
style={{
|
|
119
|
-
transitionTimingFunction: 'cubic-bezier(0.33, 1, 0.68, 1)',
|
|
120
|
-
maxHeight: previewExpanded || !previewNeedsFade
|
|
121
|
-
? previewContentRef.current?.scrollHeight ?? 2000
|
|
122
|
-
: PREVIEW_COLLAPSED_HEIGHT,
|
|
123
|
-
...(previewNeedsFade && !previewExpanded ? {
|
|
124
|
-
maskImage: 'linear-gradient(to bottom, black 30%, transparent 100%)',
|
|
125
|
-
WebkitMaskImage: 'linear-gradient(to bottom, black 30%, transparent 100%)',
|
|
126
|
-
} : {}),
|
|
127
|
-
}}
|
|
128
|
-
>
|
|
129
|
-
<ChangelogEntryList entries={entries} MarkdownRenderer={MarkdownRenderer} />
|
|
130
|
-
</div>
|
|
131
|
-
{previewNeedsFade && (
|
|
132
|
-
<button
|
|
133
|
-
type="button"
|
|
134
|
-
onClick={() => setPreviewExpanded(!previewExpanded)}
|
|
135
|
-
className="mt-4 flex items-center gap-1.5 text-sm text-ods-text-secondary hover:text-ods-accent transition-colors duration-200"
|
|
136
|
-
>
|
|
137
|
-
<span>{previewExpanded ? 'Show less' : `Show ${entries.length - 1} more`}</span>
|
|
138
|
-
<ChevronDown
|
|
139
|
-
className={`w-3.5 h-3.5 transition-transform duration-300 ${previewExpanded ? 'rotate-180' : ''}`}
|
|
140
|
-
/>
|
|
141
|
-
</button>
|
|
142
|
-
)}
|
|
143
|
-
</div>
|
|
96
|
+
/* Preview-first mode: the shared `FadePreview` primitive clamps
|
|
97
|
+
the list to ~one full entry, fade-masks the rest, and renders
|
|
98
|
+
the "Show N more / Show less" toggle. */
|
|
99
|
+
<FadePreview
|
|
100
|
+
hiddenCount={entries.length - 1}
|
|
101
|
+
collapsedHeight={PREVIEW_COLLAPSED_HEIGHT}
|
|
102
|
+
resetKey={entries.length}
|
|
103
|
+
>
|
|
104
|
+
<ChangelogEntryList entries={entries} MarkdownRenderer={MarkdownRenderer} />
|
|
105
|
+
</FadePreview>
|
|
144
106
|
) : (
|
|
145
107
|
<ChangelogEntryList entries={entries} MarkdownRenderer={MarkdownRenderer} />
|
|
146
108
|
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-3FGFGOH5.cjs","../src/components/onboarding-guides/onboarding-guides-catalog-view.tsx","../src/components/onboarding-guides/onboarding-guides-catalog-skeleton.tsx","../src/components/onboarding-guides/onboarding-guide-detail-view.tsx","../src/components/onboarding-guides/hooks/use-onboarding-guides.ts"],"names":["jsx","jsxs"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACjBA,8BAAuD;AACvD,2CAA8B;ADmB9B;AACA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AAA;AACQ,cAAA;AAC1B,cAAA;AACN,cAAA;AAAA,YAAA;AACF,UAAA;AAIiB,UAAA;AACC,4BAAA;AAAmD,cAAA;AAChD,cAAA;AACjB,YAAA;AAEG,4BAAA;AAIL,UAAA;AAID,UAAA;AAAA,QAAA;AAAA,MAAA;AACH,IAAA;AACJ,EAAA;AACF;AHgF+E;AACA;AI1TtD;AAkBU;AACR,EAAA;AACuB,EAAA;AAEN,EAAA;AACU,EAAA;AACa,EAAA;AACV,EAAA;AAChD,EAAA;AAC6B,IAAA;AACgB,IAAA;AAEd,IAAA;AACe,IAAA;AACrD,EAAA;AACF;AAEsE;AACpD,EAAA;AACkC,IAAA;AACW,IAAA;AACtB,MAAA;AACqB,MAAA;AACG,MAAA;AACK,MAAA;AACG,MAAA;AACT,MAAA;AACM,MAAA;AAChD,MAAA;AAClB,IAAA;AACD,EAAA;AACH;AAE6D;AAC3C,EAAA;AACiC,IAAA;AACA,IAAA;AACW,MAAA;AACO,MAAA;AAC/C,MAAA;AAClB,IAAA;AACW,IAAA;AACZ,EAAA;AACH;AAE6C;AAC3B,EAAA;AACyB,IAAA;AACwB,IAAA;AACJ,MAAA;AAChD,MAAA;AACoD,QAAA;AAC7C,MAAA;AAClB,IAAA;AACW,IAAA;AACZ,EAAA;AACH;AJsS+E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-3FGFGOH5.cjs","sourcesContent":[null,"'use client'\n\n/**\n * Public-facing catalog view for `/onboarding-guides`.\n *\n * Two data modes:\n * - **controlled** (hub SSR): pass `initialGuides` + `initialSections`\n * (server-fetched; section changes re-render the host with new props).\n * - **self-fetching** (config-only embed): omit the data props and pass\n * `guidesEndpoint` + `sectionsEndpoint` (the api routes). The view fetches\n * the guides (refetching on `?section=` change) + the section list itself —\n * no host data layer. (Plain fetch + useEffect, the DeliveryLists pattern.)\n *\n * The view renders ONLY its body + its OWN controls (the RAG `<DocSearchBar>` +\n * dynamic section pills — onboarding's controls are content-driven, unlike the\n * static search/filter the `DevSectionView` chrome ships). It does NOT render the\n * page chrome: the CALLER wraps it in `<DevSectionPage sectionKey=\"onboarding\">`\n * (hero + back button), exactly like the roadmap / releases / delivery pages — so\n * every dev-center surface composes the same way and the view stays embeddable in\n * tabbed contexts. Card hrefs flow through `runtime.composeContentUrl`.\n */\n\nimport { useMemo, useTransition, type ReactNode } from 'react'\nimport { GraduationCap } from 'lucide-react'\n\nimport { useRouter, useSearchParams } from '../../embed-shims'\nimport { useSelfFetch } from '../../hooks/use-self-fetch'\nimport { DocSearchBar, useDocSearch } from '../shared/doc-search'\nimport { FilterPillRow } from '../ui/filter-pill-row'\nimport { LoadError } from '../ui/error-state'\nimport { OnboardingGuideCard } from '../chat/entity-cards/onboarding-guide-card'\nimport { OnboardingGuidesCatalogSkeleton } from './onboarding-guides-catalog-skeleton'\nimport { useChatRuntime } from '../../contexts/chat-runtime-context'\nimport type { OnboardingGuide } from '../chat/types/entities/onboarding-guide'\nimport { resolveContentHref } from '../../utils/content-href'\n\ntype SectionSummary = { section: string; section_order: number; count: number }\n\nexport interface OnboardingGuidesCatalogViewProps {\n /** Controlled / SSR: server-fetched guides. Omit + pass `guidesEndpoint`\n * for the self-fetching config-only mode. */\n initialGuides?: OnboardingGuide[]\n initialSections?: SectionSummary[]\n initialSection?: string\n /** Self-fetch: GET list endpoint (the api route). Appends `?section=`. */\n guidesEndpoint?: string\n /** Self-fetch: GET section-summary endpoint (the api route). */\n sectionsEndpoint?: string\n /** Optional per-row card renderer override. */\n renderCard?: (guide: OnboardingGuide) => ReactNode\n /** Base path the catalog is mounted under (fallback href prefix + `?section=`\n * push target). Default `/onboarding-guides`. */\n basePath?: string\n}\n\nexport function OnboardingGuidesCatalogView({\n initialGuides,\n initialSections,\n initialSection = '',\n guidesEndpoint,\n sectionsEndpoint,\n renderCard,\n basePath = '/onboarding-guides',\n}: OnboardingGuidesCatalogViewProps) {\n const router = useRouter()\n const searchParams = useSearchParams()\n const [isPending, startTransition] = useTransition()\n const runtime = useChatRuntime()\n\n // Self-fetch only when the host supplied NO data but DID give an endpoint.\n const selfFetch = initialGuides === undefined && guidesEndpoint !== undefined\n // Active section: from the URL when self-fetching, from the prop (host RSC\n // already read the URL server-side) when controlled.\n const sectionValue = selfFetch ? searchParams.get('section') ?? '' : initialSection\n const activeSection = sectionValue || 'all'\n\n // Self-fetch the guides (refetched whenever `?section=` changes — it's folded\n // into the url) + the section summaries. Controlled mode passes `null` urls so\n // the hook never fetches. The guides fetch carries the error/retry affordance.\n const guidesQs = sectionValue ? `?section=${encodeURIComponent(sectionValue)}` : ''\n const guidesRes = useSelfFetch<{ data?: OnboardingGuide[] }>(\n selfFetch && guidesEndpoint ? `${guidesEndpoint}${guidesQs}` : null,\n )\n const sectionsRes = useSelfFetch<SectionSummary[]>(\n selfFetch && sectionsEndpoint ? sectionsEndpoint : null,\n )\n\n // Invariant: `guidesRes.data` is `null` until the first fetch resolves, then\n // `{ data: [...] }`. The `?.data ?? []` chain collapses never-fetched (null) and\n // legitimately-empty ([]) to the same `[]` — so the first-load skeleton gate below\n // keys on the OUTER `guidesRes.data == null` to distinguish them (an empty section\n // toggle keeps the chrome; only a true cold start shows the full-page skeleton).\n const guides = initialGuides ?? guidesRes.data?.data ?? []\n const sections = initialSections ?? (Array.isArray(sectionsRes.data) ? sectionsRes.data : [])\n const isLoading = selfFetch ? guidesRes.isLoading : false\n\n // Section grouping. Data arrives already filtered (server-side `?section=`\n // for the host, or our `?section=` fetch); this just buckets visible rows.\n const grouped = useMemo(() => {\n const map = new Map<string, { section_order: number; guides: OnboardingGuide[] }>()\n for (const g of guides) {\n const existing = map.get(g.section)\n if (existing) {\n if (g.section_order < existing.section_order) existing.section_order = g.section_order\n existing.guides.push(g)\n } else {\n map.set(g.section, { section_order: g.section_order, guides: [g] })\n }\n }\n for (const entry of map.values()) {\n entry.guides.sort((a, b) => a.step_order - b.step_order || a.title.localeCompare(b.title))\n }\n return Array.from(map.entries())\n .map(([section, info]) => ({ section, ...info }))\n .sort((a, b) => a.section_order - b.section_order || a.section.localeCompare(b.section))\n }, [guides])\n\n const sectionFilterOptions = useMemo(\n () => [\n { value: 'all', label: `All (${guides.length})` },\n ...sections.map((s) => ({ value: s.section, label: `${s.section} (${s.count})` })),\n ],\n [guides.length, sections],\n )\n\n // Section pill change → push `?section=X`. Controlled mode: host RSC\n // re-fetches. Self-fetch mode: our guides effect re-fetches on the URL change.\n const setSection = (value: string) => {\n const params = new URLSearchParams(searchParams.toString())\n if (value === 'all') {\n params.delete('section')\n } else {\n params.set('section', value)\n }\n const qs = params.toString()\n startTransition(() => {\n router.push(qs ? `${basePath}?${qs}` : basePath)\n })\n }\n\n // Search bar — scoped to onboarding-guides only via RAG-search `tableIds`.\n const source = runtime?.source ?? 'openframe'\n const docSearch = useDocSearch({\n source,\n baseRoute: basePath,\n onNavigate: (path) => router.push(path),\n tableIds: ['onboarding-guides'],\n })\n\n // Per-row card renderer — runtime-composed href, fallback to relative.\n const defaultRenderCard = (guide: OnboardingGuide) => {\n const cta = resolveContentHref(runtime?.composeContentUrl, {\n type: 'onboarding_guide',\n slug: guide.slug,\n basePath,\n platforms: guide.onboarding_guide_platforms,\n })\n return (\n <OnboardingGuideCard\n guide={guide}\n href={cta.href}\n targetPlatform={cta.targetPlatform}\n size=\"catalog\"\n />\n )\n }\n const renderCardFn = renderCard ?? defaultRenderCard\n\n const preControls = (\n <div className=\"space-y-4\">\n <DocSearchBar\n placeholder=\"Search onboarding guides, releases, case studies…\"\n query={docSearch.query}\n onQueryChange={docSearch.setQuery}\n results={docSearch.results}\n isLoading={docSearch.isLoading}\n onResultSelect={docSearch.handleResultSelect}\n showDropdown={docSearch.keepDropdownOpen}\n />\n {sections.length > 0 && (\n <FilterPillRow\n label=\"Section\"\n selectedValue={activeSection}\n onValueChange={setSection}\n options={sectionFilterOptions}\n />\n )}\n </div>\n )\n\n // A failed guides fetch → a RETRYABLE error (not the indistinguishable-from-\n // empty \"no guides found\" state) — parity with the sibling self-fetch views.\n if (selfFetch && guidesRes.error) {\n return <LoadError message=\"Failed to load onboarding guides.\" onRetry={guidesRes.reload} />\n }\n // Full-page skeleton ONLY on the very first load (no data has loaded yet) — a\n // later section toggle that legitimately returns ZERO guides keeps the page\n // chrome (search + section pills) and dims the grid via the className below.\n if (selfFetch && guidesRes.data == null && isLoading) {\n return <OnboardingGuidesCatalogSkeleton />\n }\n\n return (\n <div className=\"w-full flex flex-col gap-10\">\n {preControls}\n {guides.length === 0 ? (\n <div className=\"text-center py-16\">\n <GraduationCap className=\"h-12 w-12 text-ods-text-secondary mx-auto mb-4\" />\n <h2 className=\"text-ods-text-primary font-['DM_Sans'] text-[20px] font-semibold mb-2\">\n No onboarding guides found\n </h2>\n <p className=\"text-ods-text-secondary font-['DM_Sans'] text-[14px]\">\n {activeSection !== 'all'\n ? 'No guides in this section yet.'\n : \"We're working on the onboarding library. Check back soon.\"}\n </p>\n </div>\n ) : (\n <div className={isPending || isLoading ? 'opacity-60 transition-opacity space-y-10' : 'space-y-10'}>\n {grouped.map((sec) => (\n <section key={sec.section} className=\"space-y-4\">\n <h2 className=\"text-h3 tracking-[-0.36px] text-ods-text-primary flex items-center gap-2\">\n {sec.section}\n <span className=\"inline-flex items-center justify-center rounded-full bg-ods-text-secondary/20 text-ods-text-secondary text-xs font-medium px-2 py-0.5\">\n {sec.guides.length}\n </span>\n </h2>\n {/* HORIZONTAL catalog list — single column so consecutive steps\n read top-to-bottom; a grid would visually reorder them. */}\n <ul className=\"flex flex-col gap-4\">\n {sec.guides.map((guide) => (\n <li key={guide.id}>{renderCardFn(guide)}</li>\n ))}\n </ul>\n </section>\n ))}\n </div>\n )}\n </div>\n )\n}\n","'use client'\n\nimport { OnboardingGuideCardSkeleton } from '../chat/entity-cards/onboarding-guide-card'\n\n/**\n * Loading skeleton for `/onboarding-guides` — CHROME-LESS, exactly like the\n * loaded `<OnboardingGuidesCatalogView>`. The HOST page owns the\n * `<DevSectionPage sectionKey=\"onboarding\">` shell (hero + back button);\n * this component renders only what replaces the view: the search/pill\n * placeholder block and the section card lists.\n *\n * HISTORY: this used to mount its own `<DevSectionPage>` — nested inside the\n * page's shell that double-rendered the hero + back button during loading\n * (the view was made chrome-less in the page restructure; the skeleton was\n * missed). Keep BOTH chrome-less.\n *\n * Wrapper mirrors the loaded view's `w-full flex flex-col gap-10`; per-card\n * height matches the loaded catalog card so resolve shifts are zero.\n */\nexport function OnboardingGuidesCatalogSkeleton() {\n return (\n <div className=\"w-full flex flex-col gap-10 animate-pulse\">\n {/* Search input placeholder — matches `<SearchInput>` h-12 — plus the\n section pill row (~74 px incl. padding), same as the loaded\n preControls block. */}\n <div className=\"space-y-4\">\n <div className=\"h-12 w-full bg-ods-card border border-ods-border rounded-md\" />\n <div className=\"flex flex-wrap items-center gap-3 p-4 bg-ods-card border border-ods-border rounded-lg\">\n <div className=\"h-4 w-14 bg-ods-border/60 rounded\" />\n {[0, 1, 2, 3].map((i) => (\n <div\n key={i}\n className=\"h-10 w-24 bg-ods-card border border-ods-border rounded-md\"\n />\n ))}\n </div>\n </div>\n <div className=\"space-y-10\">\n {[4, 3, 3].map((cardCount, sectionIdx) => (\n <section key={sectionIdx} className=\"space-y-4\">\n <h2 className=\"text-h3 tracking-[-0.36px] text-ods-text-primary flex items-center gap-2\">\n <span className=\"h-6 w-40 bg-ods-border/70 rounded\" />\n <span className=\"h-5 w-8 bg-ods-text-secondary/20 rounded-full\" />\n </h2>\n <ul className=\"flex flex-col gap-4\">\n {Array.from({ length: cardCount }).map((_, cardIdx) => (\n <li key={cardIdx}>\n <OnboardingGuideCardSkeleton size=\"catalog\" />\n </li>\n ))}\n </ul>\n </section>\n ))}\n </div>\n </div>\n )\n}\n","'use client'\n\n/**\n * Public-facing detail view for `/onboarding-guides/<slug>`.\n *\n * Two modes:\n * - **controlled** (hub SSR): pass `initialData` (a server-fetched guide).\n * - **self-fetching** (config-only embed): pass `slug` + `guideEndpoint`\n * (the api route) and the view fetches the guide itself — no host data\n * layer. (Plain fetch + useEffect, the DeliveryLists pattern.)\n *\n * Everything else flows through lib primitives + the ChatRuntime context\n * (markdown, video warmup, captions, related-card hrefs via\n * `runtime.composeContentUrl`). Optional `MarkdownRenderer` lets hosts swap a\n * renderer with extra plugins.\n */\n\nimport { type ComponentType, type ReactNode } from 'react'\nimport { PageLayout } from '../layout/page-layout'\n\nimport { useRouter } from '../../embed-shims'\n// PageShell (max-w-[1920px]) — the guide detail content must share the SAME\n// container sizing as the related-content/FAQ rail the host page renders\n// below it (which uses the wide shell). ArticleDetailLayout (1280px) made\n// the detail block visibly narrower than the rail.\nimport { PageShell } from '../layout/article-detail-layout'\nimport { DetailPageSkeleton } from '../shared/detail-page-skeleton'\nimport { EntityVideoSection } from '../features/entity-video-section'\nimport { VideoBitesDisplay } from '../features/video-bites-display'\nimport { useVideoWarmup } from '../features/use-video-warmup'\nimport { getCaptionsUrl } from '../features/captions-url'\nimport { RichMarkdownRenderer } from '../ui/rich-markdown-renderer'\nimport { EntityTagBadges } from '../features/entity-tag-badges'\nimport { LoadError } from '../ui/error-state'\nimport { ArticleAuthorByline } from '../shared/article-author-byline'\nimport { EntityAuthorCard } from '../chat/entity-cards/entity-author-card'\nimport { OnboardingGuideCard } from '../chat/entity-cards/onboarding-guide-card'\nimport { useChatRuntime } from '../../contexts/chat-runtime-context'\nimport type { OnboardingGuide } from '../chat/types/entities/onboarding-guide'\nimport type { VideoTeaser } from '../../types/video-processing'\nimport { resolveContentHref } from '../../utils/content-href'\nimport { buildOgPlaceholderUrl } from '../../utils/og-placeholder'\nimport { useSelfFetch } from '../../hooks/use-self-fetch'\n\nexport interface OnboardingGuideDetailViewProps {\n /** Server-fetched guide (controlled / SSR mode). Omit it and pass\n * `slug` + `guideEndpoint` for the self-fetching config-only mode. */\n initialData?: OnboardingGuide\n /** Self-fetch: the guide's slug (the host reads it from its route). */\n slug?: string\n /** Self-fetch: builds the GET url for a single guide (the api route).\n * e.g. `(s) => \\`/content/api/onboarding-guides/${s}\\``. */\n guideEndpoint?: (slug: string) => string\n related?: OnboardingGuide[]\n /** Link target for the author name in the metadata grid — the host\n * computes it (public author page; absent ⇒ plain text). */\n authorHref?: string\n /** Bio paragraph for the end-of-article author byline. Defaults to the\n * guide payload's `author.about` (hubs that hydrate it can omit this). */\n authorBio?: string | null\n /** Byline fallback paragraph when the bio is empty — the host passes its\n * platform-aware copy (the lib has no config awareness). Absent ⇒ the\n * byline renders nothing below the name when the bio is empty. */\n fallbackBio?: string | null\n /** Optional markdown renderer override. Defaults to lib\n * `<RichMarkdownRenderer>`. */\n MarkdownRenderer?: ComponentType<{ content: string }>\n /** Optional per-row related-card renderer override. */\n renderRelatedCard?: (guide: OnboardingGuide) => ReactNode\n /** Back-link target. Defaults to `basePath`. */\n backHref?: string\n /** Back-link label. Defaults to \"Back to Getting Started\". */\n backLabel?: string\n /** Base path the related-card hrefs default to when\n * `runtime.composeContentUrl` is not wired. Default `/onboarding-guides`. */\n basePath?: string\n /** Optional slot rendered inside the page chrome, BELOW the article + related\n * guides — e.g. the hub's cross-type related-content / FAQ rail. Lets the hub\n * mount this view directly (no local wrapper); embedders omit it. */\n relatedContent?: ReactNode\n /** Render the standalone `<PageShell>`. Default true. Pass false when the host\n * layout already provides the page container — only the padding box renders,\n * avoiding a nested `<main>`. */\n shell?: boolean\n}\n\nexport function OnboardingGuideDetailView({\n authorHref,\n authorBio,\n fallbackBio,\n initialData,\n slug,\n guideEndpoint,\n related = [],\n MarkdownRenderer = RichMarkdownRenderer,\n renderRelatedCard,\n backHref,\n backLabel = 'Back to Getting Started',\n basePath = '/onboarding-guides',\n relatedContent,\n shell = true,\n}: OnboardingGuideDetailViewProps) {\n const resolvedBackHref = backHref ?? basePath\n const runtime = useChatRuntime()\n const router = useRouter()\n // `shell` true → standalone `<PageShell>`; false → padding-only box (no nested\n // <main>) for hosts whose layout already provides the container.\n const renderShell = (node: ReactNode) =>\n shell ? <PageShell>{node}</PageShell> : <div className=\"page-shell-content\">{node}</div>\n\n // Controlled (hub SSR `initialData`) OR self-fetch by slug (config-only embed).\n const url = initialData ? null : slug && guideEndpoint ? guideEndpoint(slug) : null\n const { data: guide, isLoading, error, reload } = useSelfFetch<OnboardingGuide>(url, { initialData })\n\n // Hooks must run unconditionally — feed them optional-chained values so they\n // no-op while the guide is still loading.\n const { ref: videoWarmupRef } = useVideoWarmup<HTMLDivElement>({\n videoUrl: guide?.main_video_url,\n supabaseStorageOrigin: runtime?.endpoints.supabaseStorageOrigin,\n })\n\n if (error || (!guide && !isLoading)) {\n return renderShell(<LoadError message=\"Guide not found.\" onRetry={reload} />)\n }\n if (!guide) {\n // Skeleton (not a bare \"Loading…\") for parity with every other shared view —\n // catalog, roadmap, releases all render a skeleton on first load, so the detail\n // page shouldn't flash text then content. `bare` + `PageShell` so the loading\n // state matches the loaded page's full width / padding / min-height.\n return renderShell(\n // Match the loaded page's top offset (TitleBlock's\n // `pt-[var(--spacing-system-l)]`) so content doesn't jump on load.\n <div className=\"pt-[var(--spacing-system-l)]\">\n <DetailPageSkeleton bare showImageGallery={false} />\n </div>\n )\n }\n\n const captionsUrl = getCaptionsUrl('onboarding_guide', guide.id, guide.srt_content)\n\n const videoPoster =\n guide.main_video_thumbnail ||\n guide.featured_image ||\n guide.og_image_url ||\n // `buildOgPlaceholderUrl` always returns a usable string (relative route at\n // worst), so it's the terminal fallback — no trailing `|| undefined` needed.\n buildOgPlaceholderUrl(runtime?.endpoints, guide.title, { aspect: 'wide' })\n\n const defaultRenderRelatedCard = (g: OnboardingGuide) => {\n const cta = resolveContentHref(runtime?.composeContentUrl, {\n type: 'onboarding_guide',\n slug: g.slug,\n basePath,\n platforms: g.onboarding_guide_platforms,\n })\n return <OnboardingGuideCard guide={g} href={cta.href} targetPlatform={cta.targetPlatform} />\n }\n const renderRelatedCardFn = renderRelatedCard ?? defaultRenderRelatedCard\n\n return renderShell(\n <PageLayout\n title={guide.title}\n titleSize=\"h1\"\n backButton={{ label: backLabel, onClick: () => router.push(resolvedBackHref) }}\n >\n {/* Tags — flat onboarding_guide_tags[] from entity_tags. */}\n <EntityTagBadges tags={(guide as any).onboarding_guide_tags} />\n\n {/* Metadata grid — Section · Step | Published | Author. */}\n <EntityAuthorCard\n author={guide.author}\n authorHref={authorHref}\n publishedAt={guide.published_at}\n extraCells={[\n {\n value: `${guide.section} · Step ${guide.step_order}`,\n label: 'Section',\n uppercase: false,\n },\n ]}\n />\n\n {/* Video. `main_video_url` (Mux/MP4) and `youtube_url` are independent\n columns — either populated renders the player. */}\n {(guide.main_video_url || guide.youtube_url) && (\n <div ref={videoWarmupRef}>\n <EntityVideoSection\n mainVideoUrl={guide.main_video_url}\n youtubeUrl={guide.youtube_url || undefined}\n highlightVideoUrl={guide.highlight_video_url}\n mainVideoPoster={videoPoster}\n highlightVideoThumbnail={guide.highlight_video_thumbnail || undefined}\n videoSummary={undefined}\n videoBites={undefined}\n title={guide.title}\n srtContent={guide.srt_content}\n captionsUrl={captionsUrl}\n MarkdownRenderer={MarkdownRenderer}\n />\n </div>\n )}\n\n {/* Markdown body */}\n {guide.content && (\n <div className=\"space-y-4\">\n <MarkdownRenderer content={guide.content} />\n </div>\n )}\n\n {/* Video Bites */}\n {guide.video_bites && guide.video_bites.length > 0 && (\n <VideoBitesDisplay\n bites={guide.video_bites as VideoTeaser[]}\n filterPublished={true}\n showTitle={false}\n />\n )}\n\n {/* End-of-article author byline (avatar + linked name + bio) — the\n author DESCRIPTION block every article-shaped detail page renders.\n Hidden when the guide has no author (the byline returns null). */}\n <ArticleAuthorByline\n author={guide.author?.full_name ?? null}\n avatar={guide.author?.avatar_url}\n jobTitle={guide.author?.job_title}\n bio={authorBio ?? guide.author?.about}\n href={authorHref}\n fallbackBio={fallbackBio}\n />\n\n {/* Related — same-section, ordered by step. */}\n {related.length > 0 && (\n <div className=\"space-y-4 pt-8 border-t border-ods-border\">\n <h2 className=\"text-h3 tracking-[-0.36px] text-ods-text-primary\">\n More in {guide.section}\n </h2>\n <ul className=\"flex flex-col gap-3\">\n {related.map((r) => (\n <li key={r.id}>{renderRelatedCardFn(r)}</li>\n ))}\n </ul>\n </div>\n )}\n\n {/* Host slot — cross-type related-content / FAQ rail. */}\n {relatedContent}\n </PageLayout>\n )\n}\n","'use client'\n\n/**\n * React Query hooks for Onboarding Guides — PUBLIC reads only.\n *\n * Admin mutations (create/update/delete/publish/stats/save-highlight)\n * stay HUB-side in `hooks/use-onboarding-guides.ts` and import the\n * `onboardingGuideKeys.admin` sub-namespace from this module so the\n * cache namespace `['onboarding-guides']` has a single source of truth.\n *\n * Endpoints (`/api/onboarding-guides*`) are host-supplied — non-Next.js\n * embedders must reverse-proxy the same routes. Same precedent as the\n * tickets list hook.\n */\n\nimport { useQuery } from '@tanstack/react-query'\n\nimport type {\n OnboardingGuide,\n OnboardingGuideFilters,\n OnboardingGuideListResponse,\n OnboardingGuideSectionSummary,\n} from '../../chat/types/entities/onboarding-guide'\n\n/**\n * Cache key builder for the `['onboarding-guides']` namespace.\n *\n * Includes BOTH public-read sub-keys (`lists`, `list`, `details`,\n * `detail`, `sections`) AND the `admin` sub-namespace. Admin mutations\n * live hub-side but invalidate against this same builder so a single\n * `qc.invalidateQueries({ queryKey: onboardingGuideKeys.all })` from\n * an admin hook also clears the public read cache.\n */\nexport const onboardingGuideKeys = {\n all: ['onboarding-guides'] as const,\n lists: () => [...onboardingGuideKeys.all, 'list'] as const,\n list: (filters: OnboardingGuideFilters) =>\n [...onboardingGuideKeys.lists(), filters] as const,\n details: () => [...onboardingGuideKeys.all, 'detail'] as const,\n detail: (slug: string) => [...onboardingGuideKeys.details(), slug] as const,\n sections: () => [...onboardingGuideKeys.all, 'sections'] as const,\n admin: {\n all: ['admin', 'onboarding-guides'] as const,\n lists: () => ['admin', 'onboarding-guides', 'list'] as const,\n detail: (slug: string) =>\n ['admin', 'onboarding-guide', slug] as const,\n stats: () => ['admin', 'onboarding-guides', 'stats'] as const,\n },\n}\n\nexport function useOnboardingGuides(filters?: OnboardingGuideFilters) {\n return useQuery({\n queryKey: onboardingGuideKeys.list(filters || {}),\n queryFn: async (): Promise<OnboardingGuideListResponse> => {\n const params = new URLSearchParams()\n if (filters?.search) params.set('search', filters.search)\n if (filters?.section) params.set('section', filters.section)\n if (filters?.limit) params.set('limit', filters.limit.toString())\n if (filters?.offset) params.set('offset', filters.offset.toString())\n const res = await fetch(`/api/onboarding-guides?${params}`)\n if (!res.ok) throw new Error('Failed to fetch onboarding guides')\n return res.json()\n },\n })\n}\n\nexport function useOnboardingGuide(slug: string | undefined) {\n return useQuery({\n queryKey: onboardingGuideKeys.detail(slug || ''),\n queryFn: async (): Promise<OnboardingGuide> => {\n const res = await fetch(`/api/onboarding-guides/${slug}`)\n if (!res.ok) throw new Error('Failed to fetch onboarding guide')\n return res.json()\n },\n enabled: !!slug,\n })\n}\n\nexport function useOnboardingGuideSections() {\n return useQuery({\n queryKey: onboardingGuideKeys.sections(),\n queryFn: async (): Promise<OnboardingGuideSectionSummary[]> => {\n const res = await fetch('/api/onboarding-guides/sections')\n if (!res.ok)\n throw new Error('Failed to fetch onboarding-guide sections')\n return res.json()\n },\n staleTime: 0,\n })\n}\n"]}
|