@flamingo-stack/openframe-frontend-core 0.0.827 → 0.0.829
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/build/export-map.json +1 -1
- package/dist/chat-protocol/frames.d.ts +2 -0
- package/dist/chat-protocol/frames.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +9 -6
- package/dist/chat-protocol/progress.d.ts +2 -1
- package/dist/chat-protocol/progress.d.ts.map +1 -1
- package/dist/chat-protocol/progress.js +6 -6
- package/dist/{chunk-ALRX2VIY.cjs → chunk-4DUVTJ6A.cjs} +13 -13
- package/dist/{chunk-B5H7RKFF.cjs → chunk-4ZIKDOPY.cjs} +4 -4
- package/dist/{chunk-6SFCI6D4.cjs → chunk-6WNSZ5XP.cjs} +12 -14
- package/dist/{chunk-UULSSD56.cjs → chunk-AH4YWTWZ.cjs} +5 -5
- package/dist/{chunk-7VC5FVWT.cjs → chunk-DWSU35QQ.cjs} +62 -62
- package/dist/{chunk-3WKQ2GCR.cjs → chunk-HMC2IWV4.cjs} +4 -6
- package/dist/{chunk-RPKWEBHC.cjs → chunk-IBQ3CSKL.cjs} +3 -3
- package/dist/{chunk-ZT7JHN7G.cjs → chunk-IFLGIBFZ.cjs} +54 -59
- package/dist/{chunk-4ZH7RPEA.cjs → chunk-IHRMX3X6.cjs} +154 -154
- package/dist/{chunk-6ZLCEIIC.cjs → chunk-IMDYB77M.cjs} +21 -21
- package/dist/chunk-IX2E3AN7.cjs +77 -0
- package/dist/{chunk-VAIML6YU.cjs → chunk-LNXRTVOY.cjs} +13 -13
- package/dist/{chunk-QMQWXGCH.cjs → chunk-MFYSV7DE.cjs} +23 -19
- package/dist/{chunk-K6X7VP2Y.cjs → chunk-PRZAEPGG.cjs} +41 -41
- package/dist/{chunk-XPF74L76.cjs → chunk-R3PKAIX3.cjs} +2 -2
- package/dist/{chunk-UWGPYAB3.cjs → chunk-THPAGFT6.cjs} +47 -47
- package/dist/{chunk-DR4P7AEU.cjs → chunk-UE5ZBCJ4.cjs} +3 -3
- package/dist/{chunk-BGT6JFMP.cjs → chunk-UO6F6LLI.cjs} +41 -5
- package/dist/{chunk-SVCTAOJR.cjs → chunk-YHQDB5QJ.cjs} +2 -2
- package/dist/{chunk-YKUL6JBI.cjs → chunk-ZJXLNIWC.cjs} +46 -34
- package/dist/{cloud-tenants-LKTWIZNS.cjs → cloud-tenants-YVCSVVIS.cjs} +8 -7
- package/dist/components/case-studies/index.cjs +20 -19
- package/dist/components/chat/assistant-ask-prompts.d.ts +5 -1
- package/dist/components/chat/assistant-ask-prompts.d.ts.map +1 -1
- package/dist/components/chat/assistant-ask-prompts.js +3 -1
- package/dist/components/chat/embeddable-chat.js +1 -0
- package/dist/components/chat/guide-welcome.d.ts +10 -1
- package/dist/components/chat/guide-welcome.d.ts.map +1 -1
- package/dist/components/chat/guide-welcome.js +12 -2
- package/dist/components/chat/hooks/use-empty-state-config.d.ts +13 -3
- package/dist/components/chat/hooks/use-empty-state-config.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-empty-state-config.js +10 -2
- package/dist/components/chat/index.cjs +7 -3
- package/dist/components/contact/index.cjs +9 -8
- package/dist/components/docs/index.cjs +12 -11
- package/dist/components/embeds/index.cjs +9 -8
- package/dist/components/faq/faq-ask-card.d.ts +2 -13
- package/dist/components/faq/faq-ask-card.d.ts.map +1 -1
- package/dist/components/faq/faq-ask-card.js +1 -2
- package/dist/components/faq/faq-document-page.d.ts +2 -4
- package/dist/components/faq/faq-document-page.d.ts.map +1 -1
- package/dist/components/faq/faq-document-page.js +0 -2
- package/dist/components/faq/faq-section.d.ts +16 -29
- package/dist/components/faq/faq-section.d.ts.map +1 -1
- package/dist/components/faq/faq-section.js +23 -15
- package/dist/components/faq/index.cjs +10 -9
- package/dist/components/faq/index.d.ts +1 -1
- package/dist/components/faq/index.d.ts.map +1 -1
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +8 -7
- package/dist/components/help-center-pages/delivery-page.d.ts +1 -8
- package/dist/components/help-center-pages/delivery-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/delivery-page.js +4 -16
- package/dist/components/help-center-pages/download-apps-page.d.ts +1 -8
- package/dist/components/help-center-pages/download-apps-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/download-apps-page.js +3 -4
- package/dist/components/help-center-pages/index.cjs +114 -162
- package/dist/components/help-center-pages/onboarding-guides-catalog-page.d.ts +1 -8
- package/dist/components/help-center-pages/onboarding-guides-catalog-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/onboarding-guides-catalog-page.js +14 -26
- package/dist/components/help-center-pages/product-releases-list-page.d.ts +1 -8
- package/dist/components/help-center-pages/product-releases-list-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/product-releases-list-page.js +12 -24
- package/dist/components/help-center-pages/roadmap-page.d.ts +1 -8
- package/dist/components/help-center-pages/roadmap-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/roadmap-page.js +13 -25
- package/dist/components/help-center-pages/trust-center-page.d.ts +1 -1
- package/dist/components/help-center-pages/trust-center-page.d.ts.map +1 -1
- package/dist/components/index.cjs +50 -45
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/meeting-scheduler/index.cjs +39 -38
- package/dist/components/navigation/index.cjs +11 -10
- package/dist/components/onboarding-guides/index.cjs +10 -9
- package/dist/components/page-topic-label.d.ts +13 -0
- package/dist/components/page-topic-label.d.ts.map +1 -0
- package/dist/components/page-topic-label.js +20 -0
- package/dist/components/product-demo/index.cjs +17 -16
- package/dist/components/shared/dev-section/dev-section-page.d.ts +1 -8
- package/dist/components/shared/dev-section/dev-section-page.d.ts.map +1 -1
- package/dist/components/shared/dev-section/dev-section-page.js +2 -3
- package/dist/components/shared/legal-document/legal-document-page.d.ts +2 -10
- package/dist/components/shared/legal-document/legal-document-page.d.ts.map +1 -1
- package/dist/components/shared/legal-document/legal-document-page.js +2 -5
- package/dist/components/shared/legal-document/use-legal-documents.d.ts +0 -2
- package/dist/components/shared/legal-document/use-legal-documents.d.ts.map +1 -1
- package/dist/components/shared/legal-document/use-legal-documents.js +0 -1
- package/dist/components/tickets/index.cjs +13 -12
- package/dist/components/ui/index.cjs +10 -7
- package/dist/contexts/endpoints-runtime-context.d.ts +5 -0
- package/dist/contexts/endpoints-runtime-context.d.ts.map +1 -1
- package/dist/contexts/index.cjs +10 -1
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/contexts/index.js +4 -0
- package/dist/contexts/page-topics-context.d.ts +30 -0
- package/dist/contexts/page-topics-context.d.ts.map +1 -0
- package/dist/contexts/page-topics-context.js +27 -0
- package/dist/{devices-JWG72ANF.cjs → devices-AW6BERJF.cjs} +9 -8
- package/dist/{embeddable-chat-5UT6UHEO.cjs → embeddable-chat-ZJIOMMSA.cjs} +74 -71
- package/dist/hooks/index.cjs +3 -3
- package/dist/index.cjs +25 -11
- package/dist/{knowledge-DQXVSHME.cjs → knowledge-PEOXTIVS.cjs} +9 -8
- package/dist/{logs-Z33VBTVX.cjs → logs-CYA7H4KM.cjs} +15 -14
- package/dist/{policies-XE4UMH6Z.cjs → policies-M6QSFL5G.cjs} +12 -11
- package/dist/{scripts-MECQG5GG.cjs → scripts-Y46ECDDP.cjs} +13 -12
- package/dist/{software-update-PCSIA6BP.cjs → software-update-OTC2DGQZ.cjs} +11 -10
- package/dist/utils/index.cjs +46 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +12 -0
- package/dist/utils/page-topics.cjs +48 -0
- package/dist/utils/page-topics.d.ts +34 -0
- package/dist/utils/page-topics.d.ts.map +1 -0
- package/dist/utils/page-topics.js +46 -0
- package/package.json +7 -1
- package/src/chat-protocol/frames.ts +3 -0
- package/src/chat-protocol/progress.ts +11 -10
- package/src/components/chat/assistant-ask-prompts.tsx +8 -2
- package/src/components/chat/embeddable-chat.tsx +3 -0
- package/src/components/chat/guide-welcome.tsx +26 -2
- package/src/components/chat/hooks/use-empty-state-config.ts +22 -5
- package/src/components/faq/faq-ask-card.tsx +2 -12
- package/src/components/faq/faq-document-page.tsx +1 -5
- package/src/components/faq/faq-section.tsx +47 -50
- package/src/components/faq/index.ts +1 -2
- package/src/components/help-center-pages/delivery-page.tsx +1 -16
- package/src/components/help-center-pages/download-apps-page.tsx +2 -9
- package/src/components/help-center-pages/onboarding-guides-catalog-page.tsx +1 -16
- package/src/components/help-center-pages/product-releases-list-page.tsx +1 -16
- package/src/components/help-center-pages/roadmap-page.tsx +1 -16
- package/src/components/help-center-pages/trust-center-page.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/page-topic-label.tsx +30 -0
- package/src/components/shared/dev-section/dev-section-page.tsx +2 -9
- package/src/components/shared/legal-document/legal-document-page.tsx +3 -13
- package/src/components/shared/legal-document/use-legal-documents.ts +0 -3
- package/src/contexts/endpoints-runtime-context.tsx +5 -0
- package/src/contexts/index.ts +1 -0
- package/src/contexts/page-topics-context.tsx +68 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/page-topics.ts +81 -0
- package/dist/{chunk-IKWQW3YJ.cjs → chunk-AY6XJOIN.cjs} +4 -4
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
import { cn } from '../../utils/cn';
|
|
55
55
|
import { formatUrlForDisplay } from '../../utils/format';
|
|
56
56
|
import { DESKTOP_OSES, type DesktopOs } from '../../utils/visitor-os';
|
|
57
|
-
import {
|
|
57
|
+
import { SharedPageFaq } from '../faq/faq-section';
|
|
58
58
|
import { CommandBox } from '../features/command-box';
|
|
59
59
|
import { AppleLogoIcon } from '../icons-v2-generated/brand-logos/apple-logo-icon';
|
|
60
60
|
import { WindowsLogoGreyIcon } from '../icons-v2-generated/brand-logos/windows-logo-grey-icon';
|
|
@@ -99,12 +99,6 @@ export interface DownloadAppsPageProps {
|
|
|
99
99
|
openAppHref?: (download: AppDownload) => string | null | undefined;
|
|
100
100
|
/** The closing card, under the mobile app: using OpenFrame without installing anything. Default: none. */
|
|
101
101
|
web?: DownloadAppsWebOption;
|
|
102
|
-
/**
|
|
103
|
-
* The page's own FAQ block: the topic the page is about (stated by the host,
|
|
104
|
-
* never read from its address) and where the host serves the FAQs. Rendered
|
|
105
|
-
* after the page's content, inside its container. Absent: no FAQ block.
|
|
106
|
-
*/
|
|
107
|
-
faq?: PageFaqSlot;
|
|
108
102
|
}
|
|
109
103
|
|
|
110
104
|
/** The "no install" card: the host's words and its own button (the page holds no signup link). */
|
|
@@ -373,7 +367,6 @@ export function DownloadAppsPage({
|
|
|
373
367
|
onDownloadAction,
|
|
374
368
|
openAppHref,
|
|
375
369
|
web,
|
|
376
|
-
faq,
|
|
377
370
|
}: DownloadAppsPageProps) {
|
|
378
371
|
const { data, isLoading, error, reload } = useDownloads({ endpoint, initialData });
|
|
379
372
|
// In a page's loading state the answer is read: the page draws its sections' skeletons, never nothing.
|
|
@@ -462,7 +455,7 @@ export function DownloadAppsPage({
|
|
|
462
455
|
{body}
|
|
463
456
|
{web && <WebCard web={web} />}
|
|
464
457
|
</div>
|
|
465
|
-
|
|
458
|
+
<SharedPageFaq />
|
|
466
459
|
</DownloadAppsChrome>
|
|
467
460
|
);
|
|
468
461
|
}
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
import type { ReactNode } from 'react';
|
|
12
12
|
import type { OnboardingGuide } from '../chat/types/entities/onboarding-guide';
|
|
13
|
-
import type { PageFaqSlot } from '../faq/faq-section';
|
|
14
13
|
import { OnboardingGuidesCatalogView } from '../onboarding-guides';
|
|
15
14
|
import { DevSectionPage } from '../shared/dev-section';
|
|
16
15
|
|
|
@@ -33,12 +32,6 @@ export interface OnboardingGuidesCatalogPageProps {
|
|
|
33
32
|
subtitle?: string;
|
|
34
33
|
/** Optional slot rendered below the catalog, inside the page chrome. */
|
|
35
34
|
belowContent?: ReactNode;
|
|
36
|
-
/**
|
|
37
|
-
* The page's own FAQ block: the topic the page is about (stated by the host,
|
|
38
|
-
* never read from its address) and where the host serves the FAQs. Rendered
|
|
39
|
-
* after the page's content, inside its container. Absent: no FAQ block.
|
|
40
|
-
*/
|
|
41
|
-
faq?: PageFaqSlot;
|
|
42
35
|
/** Render the standalone `<PageShell>`. Default true. Pass false when the host
|
|
43
36
|
* layout already provides the page container (forwarded to `DevSectionPage`). */
|
|
44
37
|
shell?: boolean;
|
|
@@ -55,18 +48,10 @@ export function OnboardingGuidesCatalogPage({
|
|
|
55
48
|
title,
|
|
56
49
|
subtitle,
|
|
57
50
|
belowContent,
|
|
58
|
-
faq,
|
|
59
51
|
shell,
|
|
60
52
|
}: OnboardingGuidesCatalogPageProps) {
|
|
61
53
|
return (
|
|
62
|
-
<DevSectionPage
|
|
63
|
-
sectionKey="onboarding"
|
|
64
|
-
backButton={backButton}
|
|
65
|
-
title={title}
|
|
66
|
-
subtitle={subtitle}
|
|
67
|
-
faq={faq}
|
|
68
|
-
shell={shell}
|
|
69
|
-
>
|
|
54
|
+
<DevSectionPage sectionKey="onboarding" backButton={backButton} title={title} subtitle={subtitle} shell={shell}>
|
|
70
55
|
<OnboardingGuidesCatalogView
|
|
71
56
|
guidesEndpoint={guidesEndpoint}
|
|
72
57
|
sectionsEndpoint={sectionsEndpoint}
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
import type { ReactNode } from 'react';
|
|
12
12
|
import type { ProductRelease, ProductReleaseListResponse } from '../../types/product-release';
|
|
13
|
-
import type { PageFaqSlot } from '../faq/faq-section';
|
|
14
13
|
import { DevSectionPage } from '../shared/dev-section';
|
|
15
14
|
import { ProductReleasesView, type ProductReleaseCardExtras } from '../shared/product-release';
|
|
16
15
|
|
|
@@ -29,12 +28,6 @@ export interface ProductReleasesListPageProps {
|
|
|
29
28
|
subtitle?: string;
|
|
30
29
|
/** Optional slot rendered below the list, inside the page chrome. */
|
|
31
30
|
belowContent?: ReactNode;
|
|
32
|
-
/**
|
|
33
|
-
* The page's own FAQ block: the topic the page is about (stated by the host,
|
|
34
|
-
* never read from its address) and where the host serves the FAQs. Rendered
|
|
35
|
-
* after the page's content, inside its container. Absent: no FAQ block.
|
|
36
|
-
*/
|
|
37
|
-
faq?: PageFaqSlot;
|
|
38
31
|
/** Render the standalone `<PageShell>`. Default true. Pass false when the host
|
|
39
32
|
* layout already provides the page container (forwarded to `DevSectionPage`). */
|
|
40
33
|
shell?: boolean;
|
|
@@ -49,18 +42,10 @@ export function ProductReleasesListPage({
|
|
|
49
42
|
title,
|
|
50
43
|
subtitle,
|
|
51
44
|
belowContent,
|
|
52
|
-
faq,
|
|
53
45
|
shell,
|
|
54
46
|
}: ProductReleasesListPageProps) {
|
|
55
47
|
return (
|
|
56
|
-
<DevSectionPage
|
|
57
|
-
sectionKey="releases"
|
|
58
|
-
backButton={backButton}
|
|
59
|
-
title={title}
|
|
60
|
-
subtitle={subtitle}
|
|
61
|
-
faq={faq}
|
|
62
|
-
shell={shell}
|
|
63
|
-
>
|
|
48
|
+
<DevSectionPage sectionKey="releases" backButton={backButton} title={title} subtitle={subtitle} shell={shell}>
|
|
64
49
|
<ProductReleasesView
|
|
65
50
|
endpoint={releasesEndpoint}
|
|
66
51
|
basePath={basePath}
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
import type { ReactNode } from 'react';
|
|
12
12
|
import type { RoadmapItem } from '../chat/types/entities/roadmap-item';
|
|
13
|
-
import type { PageFaqSlot } from '../faq/faq-section';
|
|
14
13
|
import { DevSectionPage } from '../shared/dev-section';
|
|
15
14
|
import { RoadmapView } from '../shared/roadmap';
|
|
16
15
|
import type { UseRoadmapVotingOptions } from '../shared/roadmap';
|
|
@@ -36,12 +35,6 @@ export interface RoadmapPageProps {
|
|
|
36
35
|
/** Optional slot rendered below the list, inside the page chrome — e.g. the
|
|
37
36
|
* hub's related-content rail. */
|
|
38
37
|
belowContent?: ReactNode;
|
|
39
|
-
/**
|
|
40
|
-
* The page's own FAQ block: the topic the page is about (stated by the host,
|
|
41
|
-
* never read from its address) and where the host serves the FAQs. Rendered
|
|
42
|
-
* after the page's content, inside its container. Absent: no FAQ block.
|
|
43
|
-
*/
|
|
44
|
-
faq?: PageFaqSlot;
|
|
45
38
|
/** Render the standalone `<PageShell>`. Default true. Pass false when the host
|
|
46
39
|
* layout already provides the page container (forwarded to `DevSectionPage`). */
|
|
47
40
|
shell?: boolean;
|
|
@@ -58,18 +51,10 @@ export function RoadmapPage({
|
|
|
58
51
|
title,
|
|
59
52
|
subtitle,
|
|
60
53
|
belowContent,
|
|
61
|
-
faq,
|
|
62
54
|
shell,
|
|
63
55
|
}: RoadmapPageProps) {
|
|
64
56
|
return (
|
|
65
|
-
<DevSectionPage
|
|
66
|
-
sectionKey="roadmap"
|
|
67
|
-
backButton={backButton}
|
|
68
|
-
title={title}
|
|
69
|
-
subtitle={subtitle}
|
|
70
|
-
faq={faq}
|
|
71
|
-
shell={shell}
|
|
72
|
-
>
|
|
57
|
+
<DevSectionPage sectionKey="roadmap" backButton={backButton} title={title} subtitle={subtitle} shell={shell}>
|
|
73
58
|
<RoadmapView
|
|
74
59
|
endpoint={roadmapEndpoint}
|
|
75
60
|
initialItems={initialItems}
|
|
@@ -93,7 +93,7 @@ export interface TrustCenterPageProps {
|
|
|
93
93
|
title?: string;
|
|
94
94
|
/** Page subtitle. Default the brand-neutral `TRUST_CENTER_TAGLINE` (a host adds its brand here). */
|
|
95
95
|
subtitle?: string;
|
|
96
|
-
/** The FAQ section's "ask the assistant" card (`FaqSection`'s `ask`)
|
|
96
|
+
/** The FAQ section's "ask the assistant" card (`FaqSection`'s `ask`), for the page's topic (`usePageTopic`): `false` switches it off. */
|
|
97
97
|
ask?: FaqSectionProps['ask'];
|
|
98
98
|
/**
|
|
99
99
|
* Host content shown after the trust sections and BEFORE the FAQ (the hub's
|
package/src/components/index.ts
CHANGED
|
@@ -50,6 +50,7 @@ export * from './persistent-pagination';
|
|
|
50
50
|
export * from './pricing-display';
|
|
51
51
|
export * from './agent-identity';
|
|
52
52
|
export * from './agent-mark';
|
|
53
|
+
export * from './page-topic-label';
|
|
53
54
|
export * from './results-count';
|
|
54
55
|
export * from './selection-source-badge';
|
|
55
56
|
export * from './social-icon-row';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { usePageTopic } from '../contexts/page-topics-context';
|
|
4
|
+
import { cn } from '../utils/cn';
|
|
5
|
+
|
|
6
|
+
export interface PageTopicLabelProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The page's topic (`usePageTopic`) as a faint stamp: what the FAQ block prints
|
|
12
|
+
* under its heading and the chat prints by its quick actions, so whoever edits
|
|
13
|
+
* FAQs or quick actions can check which topic a page asks for. A debugging aid,
|
|
14
|
+
* not copy: the badge size at reduced opacity, named on hover. ONE label read
|
|
15
|
+
* from ONE source, so the two surfaces can never show different topics. Nothing
|
|
16
|
+
* renders when the page has no topic.
|
|
17
|
+
*/
|
|
18
|
+
export function PageTopicLabel({ className }: PageTopicLabelProps) {
|
|
19
|
+
const topic = usePageTopic();
|
|
20
|
+
if (!topic) return null;
|
|
21
|
+
return (
|
|
22
|
+
<p
|
|
23
|
+
data-page-topic={topic}
|
|
24
|
+
title="Page topic"
|
|
25
|
+
className={cn('leading-none text-ods-text-muted opacity-60 text-badge', className)}
|
|
26
|
+
>
|
|
27
|
+
{topic}
|
|
28
|
+
</p>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
OPENFRAME_DEV_SECTIONS,
|
|
23
23
|
type OpenframeDevSectionKey,
|
|
24
24
|
} from '../../../utils/dev-sections/openframe-dev-sections';
|
|
25
|
-
import {
|
|
25
|
+
import { SharedPageFaq } from '../../faq/faq-section';
|
|
26
26
|
import { PageShell, PageLayout } from '../../ui';
|
|
27
27
|
import { DevSectionView } from './dev-section-view';
|
|
28
28
|
|
|
@@ -52,12 +52,6 @@ export interface DevSectionPageProps {
|
|
|
52
52
|
* `false` when the host layout already provides the page container (e.g.
|
|
53
53
|
* openframe-frontend's `AppLayout` `<main>`): then only the
|
|
54
54
|
* `page-shell-content` padding box is rendered, avoiding a nested `<main>`. */
|
|
55
|
-
/**
|
|
56
|
-
* The page's own FAQ block: the topic the page is about (stated by the host,
|
|
57
|
-
* never read from its address) and where the host serves the FAQs. Rendered
|
|
58
|
-
* after the page's content, inside its container. Absent: no FAQ block.
|
|
59
|
-
*/
|
|
60
|
-
faq?: PageFaqSlot;
|
|
61
55
|
shell?: boolean;
|
|
62
56
|
}
|
|
63
57
|
|
|
@@ -68,7 +62,6 @@ export function DevSectionPage({
|
|
|
68
62
|
backButton,
|
|
69
63
|
title,
|
|
70
64
|
subtitle,
|
|
71
|
-
faq,
|
|
72
65
|
shell = true,
|
|
73
66
|
}: DevSectionPageProps) {
|
|
74
67
|
const router = useRouter();
|
|
@@ -103,7 +96,7 @@ export function DevSectionPage({
|
|
|
103
96
|
<DevSectionView sectionKey={sectionKey} showHeading={false} preControls={preControls}>
|
|
104
97
|
{children}
|
|
105
98
|
</DevSectionView>
|
|
106
|
-
|
|
99
|
+
<SharedPageFaq />
|
|
107
100
|
</PageLayout>
|
|
108
101
|
);
|
|
109
102
|
|
|
@@ -21,7 +21,7 @@ import type { ComponentType } from 'react';
|
|
|
21
21
|
import Link from '../../../embed-shims/next-link';
|
|
22
22
|
import { useRouter } from '../../../embed-shims/next-navigation';
|
|
23
23
|
import { cn } from '../../../utils/cn';
|
|
24
|
-
import {
|
|
24
|
+
import { SharedPageFaq } from '../../faq/faq-section';
|
|
25
25
|
import { LoadingRegion } from '../../loading/loading-region';
|
|
26
26
|
import { PageShell, PageLayout } from '../../ui';
|
|
27
27
|
import { DataSyncLine } from '../../ui/data-attribution';
|
|
@@ -68,18 +68,11 @@ export interface LegalDocumentPageProps {
|
|
|
68
68
|
backButton?: { label?: string; href?: string } | false;
|
|
69
69
|
/**
|
|
70
70
|
* The hub's list of legal documents (`GET /api/legal`). Given it, the page
|
|
71
|
-
* takes the document's title
|
|
71
|
+
* takes the document's title from the list, so a host passes
|
|
72
72
|
* only the type and its endpoints and states nothing per document; the title
|
|
73
73
|
* then names the document even when its text fails to load.
|
|
74
74
|
*/
|
|
75
75
|
documentsEndpoint?: string;
|
|
76
|
-
/**
|
|
77
|
-
* The page's own FAQ block: the topic the page is about and where the host
|
|
78
|
-
* serves the FAQs. Rendered after the page's content, inside its container.
|
|
79
|
-
* Without a `topic`, the topic is the one the list (`documentsEndpoint`)
|
|
80
|
-
* gives the document. Absent, or no topic known: no FAQ block.
|
|
81
|
-
*/
|
|
82
|
-
faq?: PageFaqSlot | Omit<PageFaqSlot, 'topic'>;
|
|
83
76
|
/** Render the standalone `<PageShell>`. Default true. Pass false when the host
|
|
84
77
|
* layout already provides the page container — only the padding box renders,
|
|
85
78
|
* avoiding a nested `<main>`. */
|
|
@@ -133,7 +126,6 @@ export function LegalDocumentPage({
|
|
|
133
126
|
MarkdownRenderer = RichMarkdownRenderer,
|
|
134
127
|
documentsEndpoint,
|
|
135
128
|
backButton,
|
|
136
|
-
faq,
|
|
137
129
|
shell = true,
|
|
138
130
|
}: LegalDocumentPageProps) {
|
|
139
131
|
const router = useRouter();
|
|
@@ -155,8 +147,6 @@ export function LegalDocumentPage({
|
|
|
155
147
|
const { documents } = useLegalDocuments({ apiEndpoint: documentsEndpoint, enabled: Boolean(documentsEndpoint) });
|
|
156
148
|
const listed = documents.find(doc => doc.docType === docType);
|
|
157
149
|
const title = titleProp ?? data?.title ?? listed?.title ?? 'Legal document';
|
|
158
|
-
const faqTopic = faq && 'topic' in faq ? faq.topic : listed?.faqTopic;
|
|
159
|
-
const faqSlot = faq && faqTopic ? { ...faq, topic: faqTopic } : null;
|
|
160
150
|
const errorTitle = errorTitleProp ?? `Unable to load ${title}`;
|
|
161
151
|
const emptyStateMessage = emptyStateMessageProp ?? `${title} is not available at this time.`;
|
|
162
152
|
|
|
@@ -221,7 +211,7 @@ export function LegalDocumentPage({
|
|
|
221
211
|
</div>
|
|
222
212
|
</div>
|
|
223
213
|
</div>
|
|
224
|
-
|
|
214
|
+
<SharedPageFaq />
|
|
225
215
|
</PageLayout>
|
|
226
216
|
);
|
|
227
217
|
|
|
@@ -25,8 +25,6 @@ export interface LegalDocumentSummary {
|
|
|
25
25
|
/** The document's page on the hub's own site (a path). */
|
|
26
26
|
route: string;
|
|
27
27
|
sourceFile: string;
|
|
28
|
-
/** The topic the document's FAQs are written for, when the hub has one. */
|
|
29
|
-
faqTopic: string | null;
|
|
30
28
|
version: string | null;
|
|
31
29
|
effectiveDate: string | null;
|
|
32
30
|
/** False while the hub has no content for it yet. */
|
|
@@ -71,7 +69,6 @@ export function toLegalDocumentSummaries(payload: unknown): LegalDocumentSummary
|
|
|
71
69
|
summary: text(row, 'summary') ?? '',
|
|
72
70
|
route: text(row, 'route') ?? '',
|
|
73
71
|
sourceFile: text(row, 'sourceFile') ?? '',
|
|
74
|
-
faqTopic: text(row, 'faqTopic'),
|
|
75
72
|
version: text(row, 'version'),
|
|
76
73
|
effectiveDate: text(row, 'effectiveDate'),
|
|
77
74
|
published: row.published === true,
|
|
@@ -45,6 +45,11 @@ export interface EndpointsRuntime {
|
|
|
45
45
|
* without the proxy simply omits it and claude embeds fall back to
|
|
46
46
|
* claude.ai — no probing happens. */
|
|
47
47
|
storageViewBaseUrl?: string;
|
|
48
|
+
/** GET the host's FAQ list (the hub's `/api/faqs`). Every `FaqSection` reads its questions from it, and a shared
|
|
49
|
+
* page of the lib (roadmap, delivery, releases, onboarding guides, downloads, legal documents) draws its own FAQ
|
|
50
|
+
* block from it, for the page's topic (`usePageTopic`). OPTIONAL: a host whose layout draws every page's FAQ itself
|
|
51
|
+
* (the hub) leaves it unset, and `FaqSection` then asks the same-origin `/api/faqs`. */
|
|
52
|
+
faqsUrl?: string;
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
export const EndpointsRuntimeContext = createContext<EndpointsRuntime | null>(null);
|
package/src/contexts/index.ts
CHANGED
|
@@ -38,5 +38,6 @@ export {
|
|
|
38
38
|
type AssistantOpenRequest,
|
|
39
39
|
type AssistantRuntime,
|
|
40
40
|
} from './assistant-runtime-context';
|
|
41
|
+
export { PageTopicsProvider, usePageTopic, usePageTopicStamp } from './page-topics-context';
|
|
41
42
|
|
|
42
43
|
export { useOuterOrDefault } from './use-outer-or-default';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, useMemo, type ReactNode } from 'react';
|
|
4
|
+
import { usePathname } from '../embed-shims/next-navigation';
|
|
5
|
+
import { pageTopicFor } from '../utils/page-topics';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Page topics for a host (`utils/page-topics`): a page's topic is its own path,
|
|
9
|
+
* so a host gives no map, only where it mounts the hub's pages, ONCE at the
|
|
10
|
+
* root. Every surface that offers something for "this page" (the FAQ block, its
|
|
11
|
+
* ask card, the chat's quick actions) reads the page's topic from the address
|
|
12
|
+
* through it (`usePageTopic`); none takes a topic prop.
|
|
13
|
+
*/
|
|
14
|
+
interface PageTopicsValue {
|
|
15
|
+
/** Where the host mounts the hub's pages (`/help-center`). */
|
|
16
|
+
basePath?: string;
|
|
17
|
+
/** The address to read, where the router's answer is not the page's. */
|
|
18
|
+
pathname?: string;
|
|
19
|
+
/** Whether surfaces print the page's topic stamp (`PageTopicLabel`) by default. */
|
|
20
|
+
showTopic: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const PageTopicsContext = createContext<PageTopicsValue | null>(null);
|
|
24
|
+
|
|
25
|
+
export interface PageTopicsProviderProps {
|
|
26
|
+
/**
|
|
27
|
+
* Where the host mounts the hub's pages (`/help-center`): a page under it asks
|
|
28
|
+
* with its path without the mount, the hub page it mirrors. Absent: the
|
|
29
|
+
* enclosing provider's, else the pages sit at the root.
|
|
30
|
+
*/
|
|
31
|
+
basePath?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The page's address, for a subtree the router answers another path for (a
|
|
34
|
+
* layout slot prerendered for one page and shown on another until it
|
|
35
|
+
* hydrates). Absent: the router's (`usePathname`).
|
|
36
|
+
*/
|
|
37
|
+
pathname?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Print the page's topic stamp (`PageTopicLabel`) on every surface that can
|
|
40
|
+
* show it (the FAQ block, the chat's quick actions), for whoever edits FAQs
|
|
41
|
+
* and quick actions. ONE host decision, made at the root; a surface's own
|
|
42
|
+
* `showTopic` prop still overrides it. Absent: the enclosing provider's
|
|
43
|
+
* choice, else off.
|
|
44
|
+
*/
|
|
45
|
+
showTopic?: boolean;
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function PageTopicsProvider({ basePath, pathname, showTopic, children }: PageTopicsProviderProps) {
|
|
50
|
+
const inherited = useContext(PageTopicsContext);
|
|
51
|
+
const base = basePath ?? inherited?.basePath;
|
|
52
|
+
const stamp = showTopic ?? inherited?.showTopic ?? false;
|
|
53
|
+
const value = useMemo(() => ({ basePath: base, pathname, showTopic: stamp }), [base, pathname, stamp]);
|
|
54
|
+
return <PageTopicsContext.Provider value={value}>{children}</PageTopicsContext.Provider>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The topic of the page on screen: its path (`pageTopicFor`). Undefined where the host gave no provider. */
|
|
58
|
+
export function usePageTopic(): string | undefined {
|
|
59
|
+
const value = useContext(PageTopicsContext);
|
|
60
|
+
const routerPathname = usePathname();
|
|
61
|
+
if (!value) return undefined;
|
|
62
|
+
return pageTopicFor(value.pathname ?? routerPathname ?? '/', { basePath: value.basePath });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Whether the host asked surfaces to print the page's topic stamp (`PageTopicsProvider showTopic`). */
|
|
66
|
+
export function usePageTopicStamp(): boolean {
|
|
67
|
+
return useContext(PageTopicsContext)?.showTopic ?? false;
|
|
68
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -378,6 +378,14 @@ export { buildListUrl, canonicalContentRefType } from './list-url';
|
|
|
378
378
|
// zero drift across page + chat + future consumers.
|
|
379
379
|
export { faqSectionSlug, faqItemAnchor, parseFaqHash } from './faq-anchor';
|
|
380
380
|
export type { FaqHashTarget } from './faq-anchor';
|
|
381
|
+
export {
|
|
382
|
+
deepestTopic,
|
|
383
|
+
isPagePathTopic,
|
|
384
|
+
pageTopicFor,
|
|
385
|
+
type PageTopicOptions,
|
|
386
|
+
topicCandidates,
|
|
387
|
+
topicMatchesPath,
|
|
388
|
+
} from './page-topics';
|
|
381
389
|
|
|
382
390
|
// Content-ref group registry (labels/order/layout per rail type) + list-API
|
|
383
391
|
// response normalizers + the shared suggestion-fetch URL composer — all
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE topic of a page is its own path: one rule for every surface that offers
|
|
3
|
+
* something "for this page" (the FAQ block, its "ask the assistant" card, the
|
|
4
|
+
* chat's quick actions). No host keeps a route to topic map: FAQs and quick
|
|
5
|
+
* actions are tagged with the paths of the pages they are written for.
|
|
6
|
+
*
|
|
7
|
+
* - A page asks with its path: query and hash dropped, trailing slash dropped,
|
|
8
|
+
* lowercased, decoded (`/Blog/My-Post/?x` asks `/blog/my-post`).
|
|
9
|
+
* - A host that mounts the hub's pages under a path states it (`basePath`):
|
|
10
|
+
* `/help-center/roadmap` asks `/roadmap`, the hub page it mirrors. A path
|
|
11
|
+
* outside the mount is asked as it is (`/devices`).
|
|
12
|
+
* - A tag is written for a page when it is the page's path or a parent of it
|
|
13
|
+
* (`/blog` is written for `/blog` and `/blog/my-post`); `/` only for the home
|
|
14
|
+
* page. A page takes its DEEPEST matching tag (`deepestTopic`), so a record
|
|
15
|
+
* page shares its list page's topic until something is tagged for it alone.
|
|
16
|
+
*
|
|
17
|
+
* A zero-import leaf: a server read and the browser resolve through the same
|
|
18
|
+
* functions.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const HOME_PATH = '/';
|
|
22
|
+
|
|
23
|
+
/** A path segment decoded, or as written when its escapes are malformed (`%E0`): an address never throws. */
|
|
24
|
+
function decodeSegment(segment: string): string {
|
|
25
|
+
try {
|
|
26
|
+
return decodeURIComponent(segment);
|
|
27
|
+
} catch {
|
|
28
|
+
return segment;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** A path in the one form topics are compared in: leading slash, no trailing slash, lowercased, decoded. */
|
|
33
|
+
function normalizePath(pathname: string): string {
|
|
34
|
+
const segments = (pathname.split(/[?#]/)[0] ?? '')
|
|
35
|
+
.split('/')
|
|
36
|
+
.filter(Boolean)
|
|
37
|
+
.map(segment => decodeSegment(segment).toLowerCase());
|
|
38
|
+
return segments.length === 0 ? HOME_PATH : `/${segments.join('/')}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface PageTopicOptions {
|
|
42
|
+
/** Where the host mounts the hub's pages (`/help-center`): a path under it is asked without it. */
|
|
43
|
+
basePath?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** The topic the page at `pathname` asks with: its path, without the host's mount. */
|
|
47
|
+
export function pageTopicFor(pathname: string, options: PageTopicOptions = {}): string {
|
|
48
|
+
const path = normalizePath(pathname);
|
|
49
|
+
const base = options.basePath ? normalizePath(options.basePath) : HOME_PATH;
|
|
50
|
+
if (base === HOME_PATH) return path;
|
|
51
|
+
if (path === base) return HOME_PATH;
|
|
52
|
+
return path.startsWith(`${base}/`) ? path.slice(base.length) : path;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Whether a tag names a page (a path), as opposed to a section of a page (a word). */
|
|
56
|
+
export function isPagePathTopic(tag: string): boolean {
|
|
57
|
+
return tag.startsWith(HOME_PATH);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Whether `tag` is written for the page at `path` (`pageTopicFor`'s answer): the path itself or a parent of it. */
|
|
61
|
+
export function topicMatchesPath(tag: string, path: string): boolean {
|
|
62
|
+
if (!isPagePathTopic(tag)) return tag === path;
|
|
63
|
+
if (tag === HOME_PATH || path === HOME_PATH) return tag === path;
|
|
64
|
+
return path === tag || path.startsWith(`${tag}/`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Every tag that can be written for the page at `path`, deepest first: what a host queries its rows by. */
|
|
68
|
+
export function topicCandidates(path: string): string[] {
|
|
69
|
+
if (!isPagePathTopic(path) || path === HOME_PATH) return [path];
|
|
70
|
+
const segments = path.split('/').filter(Boolean);
|
|
71
|
+
return segments.map((_, i) => `/${segments.slice(0, segments.length - i).join('/')}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** The deepest of `tags` written for the page at `path`, or null when none is. */
|
|
75
|
+
export function deepestTopic(tags: Iterable<string>, path: string): string | null {
|
|
76
|
+
let best: string | null = null;
|
|
77
|
+
for (const tag of tags) {
|
|
78
|
+
if (topicMatchesPath(tag, path) && (best === null || tag.length > best.length)) best = tag;
|
|
79
|
+
}
|
|
80
|
+
return best;
|
|
81
|
+
}
|
|
@@ -5,10 +5,6 @@ var _chunkAPOMNC7Hcjs = require('./chunk-APOMNC7H.cjs');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _chunk7DNL734Scjs = require('./chunk-7DNL734S.cjs');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
8
|
var _chunkMZ4KBSH7cjs = require('./chunk-MZ4KBSH7.cjs');
|
|
13
9
|
|
|
14
10
|
|
|
@@ -59,6 +55,10 @@ var _chunkSKI6NKOEcjs = require('./chunk-SKI6NKOE.cjs');
|
|
|
59
55
|
|
|
60
56
|
|
|
61
57
|
|
|
58
|
+
var _chunk7DNL734Scjs = require('./chunk-7DNL734S.cjs');
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
var _chunkBLH2SFOOcjs = require('./chunk-BLH2SFOO.cjs');
|