@flamingo-stack/openframe-frontend-core 0.0.706 → 0.0.707
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-K6O43WDL.cjs → chunk-2G7UYK35.cjs} +32 -32
- package/dist/{chunk-7SCNMP2B.cjs → chunk-2KXTOP6G.cjs} +26 -13
- package/dist/{chunk-DDVBX42E.cjs → chunk-2RNB5DTN.cjs} +7 -7
- package/dist/{chunk-TE773HEH.js → chunk-36BCTE7D.js} +4 -4
- package/dist/{chunk-STHZBOQI.cjs → chunk-3AHTOSXJ.cjs} +9 -9
- package/dist/{chunk-G6UMNAVI.js → chunk-4L6XCMOU.js} +10 -2
- package/dist/{chunk-T5TMCHWM.js → chunk-4UM2ETLM.js} +2 -2
- package/dist/{chunk-3PLDQDE6.cjs → chunk-6I4ZAFO2.cjs} +9 -9
- package/dist/{chunk-YGJKKDDM.js → chunk-6IW7TWPV.js} +1 -1
- package/dist/{chunk-3EZ4HHAP.js → chunk-6YKAT7NV.js} +2 -2
- package/dist/{chunk-HZ7CBXPL.cjs → chunk-AOWDNSTM.cjs} +40 -40
- package/dist/{chunk-SW5ZV2BN.cjs → chunk-B73373AG.cjs} +20 -20
- package/dist/{chunk-4ILM7W2R.js → chunk-CNWOMQQJ.js} +1 -1
- package/dist/{chunk-DWPAAWMR.js → chunk-CZSZSDD4.js} +4 -4
- package/dist/{chunk-PXOQIA5K.js → chunk-DA5UDTLG.js} +2 -2
- package/dist/{chunk-BHI6GVC4.js → chunk-HDOYSEOJ.js} +3 -3
- package/dist/{chunk-IKJA3Y7Z.js → chunk-I3ST4PLM.js} +1 -1
- package/dist/{chunk-LVSFKENJ.cjs → chunk-JRU2CXLB.cjs} +2 -2
- package/dist/{chunk-SEKYEWQG.cjs → chunk-L6Y6OOKG.cjs} +20 -20
- package/dist/{chunk-3NCM4ZQB.js → chunk-LFFB6EMB.js} +15 -2
- package/dist/{chunk-O2RSAA5M.js → chunk-LNW45N2C.js} +5 -5
- package/dist/{chunk-M75XEEGT.cjs → chunk-LRQTJOF2.cjs} +24 -24
- package/dist/{chunk-6232S532.js → chunk-MR3A4MZV.js} +1 -1
- package/dist/{chunk-RTIPR53L.cjs → chunk-NSGXARGJ.cjs} +70 -70
- package/dist/{chunk-UJ33ZXDT.cjs → chunk-OJLR5MEO.cjs} +4 -4
- package/dist/{chunk-GWQEYPYM.cjs → chunk-P42V6N34.cjs} +321 -313
- package/dist/{chunk-7GEBFJT2.js → chunk-PO33GZVY.js} +24 -4
- package/dist/{chunk-TQ4LB2DS.cjs → chunk-QAOFMK2A.cjs} +3 -3
- package/dist/{chunk-7OFPU7WE.cjs → chunk-SEXWHIMS.cjs} +351 -331
- package/dist/{chunk-4CJMQLB5.js → chunk-SS5MBHDP.js} +2 -2
- package/dist/{chunk-VZICIQW2.js → chunk-TDYIREDJ.js} +4 -4
- package/dist/{chunk-MB4PNY7C.cjs → chunk-YBUT4AMG.cjs} +2 -2
- package/dist/components/case-studies/index.cjs +14 -14
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/index.cjs +4 -2
- package/dist/components/chat/index.d.ts +1 -1
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +3 -1
- package/dist/components/chat/nav-link-anchor-via-runtime.d.ts +34 -5
- package/dist/components/chat/nav-link-anchor-via-runtime.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +4 -4
- package/dist/components/faq/index.js +3 -3
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/help-center-pages/index.cjs +70 -70
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +38 -36
- package/dist/components/index.js +15 -13
- package/dist/components/meeting-scheduler/index.cjs +25 -25
- package/dist/components/meeting-scheduler/index.js +2 -2
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +6 -6
- package/dist/components/onboarding-guides/index.js +5 -5
- package/dist/components/platform/ToolBadge.d.ts +6 -0
- package/dist/components/platform/ToolBadge.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/brand-association-card.d.ts +7 -0
- package/dist/components/ui/brand-association-card.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +5 -3
- package/dist/components/ui/index.js +4 -2
- package/dist/index.cjs +9 -7
- package/dist/index.js +8 -6
- package/package.json +1 -1
- package/src/components/chat/index.ts +7 -1
- package/src/components/chat/nav-link-anchor-via-runtime.tsx +62 -9
- package/src/components/platform/ToolBadge.tsx +18 -1
- package/src/components/ui/brand-association-card.tsx +25 -3
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
SoftwareInfo,
|
|
10
10
|
SoftwareSourceBadge,
|
|
11
11
|
ToolBadge
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LFFB6EMB.js";
|
|
13
13
|
import {
|
|
14
14
|
ASK_AI_OPEN_EVENT,
|
|
15
15
|
AppHeader,
|
|
@@ -37,14 +37,14 @@ import {
|
|
|
37
37
|
navLinkLabel,
|
|
38
38
|
openAskAi,
|
|
39
39
|
siteNavHasMobileMenus
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-HDOYSEOJ.js";
|
|
41
41
|
import {
|
|
42
42
|
MobileNavigationDropdown,
|
|
43
43
|
MultiLevelNavigation,
|
|
44
44
|
StickySectionNav,
|
|
45
45
|
useSectionNavigation
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import "./chunk-
|
|
46
|
+
} from "./chunk-CNWOMQQJ.js";
|
|
47
|
+
import "./chunk-6YKAT7NV.js";
|
|
48
48
|
import {
|
|
49
49
|
AIEnrichButton,
|
|
50
50
|
AIEnrichSection,
|
|
@@ -673,7 +673,7 @@ import {
|
|
|
673
673
|
withFirstTouchAttribution,
|
|
674
674
|
withWalkthroughOpenParam,
|
|
675
675
|
writeDismissCookie
|
|
676
|
-
} from "./chunk-
|
|
676
|
+
} from "./chunk-4L6XCMOU.js";
|
|
677
677
|
import "./chunk-LQYXMEYF.js";
|
|
678
678
|
import "./chunk-4JPLYOS6.js";
|
|
679
679
|
import {
|
|
@@ -1195,6 +1195,7 @@ import {
|
|
|
1195
1195
|
useMarqueeSync,
|
|
1196
1196
|
useNatsChatAdapter,
|
|
1197
1197
|
useNatsDialogSubscription,
|
|
1198
|
+
useNavLinkViaRuntime,
|
|
1198
1199
|
usePlatformColors,
|
|
1199
1200
|
useProxiedImageUrl,
|
|
1200
1201
|
useSSE,
|
|
@@ -1206,7 +1207,7 @@ import {
|
|
|
1206
1207
|
useStableShallow,
|
|
1207
1208
|
useUnifiedChat,
|
|
1208
1209
|
usesCanonicalStatusStyle
|
|
1209
|
-
} from "./chunk-
|
|
1210
|
+
} from "./chunk-PO33GZVY.js";
|
|
1210
1211
|
import {
|
|
1211
1212
|
HEADING_EMOJI_RE,
|
|
1212
1213
|
HUB_HEADER_OFFSET_PX,
|
|
@@ -3575,6 +3576,7 @@ export {
|
|
|
3575
3576
|
useNatsChatAdapter,
|
|
3576
3577
|
useNatsClient,
|
|
3577
3578
|
useNatsDialogSubscription,
|
|
3579
|
+
useNavLinkViaRuntime,
|
|
3578
3580
|
useNavMenus,
|
|
3579
3581
|
useNearViewport,
|
|
3580
3582
|
useNotificationPermission,
|
package/package.json
CHANGED
|
@@ -61,7 +61,13 @@ export { remarkCardLinks } from './remark-card-links';
|
|
|
61
61
|
export { remarkMentionChips } from './remark-mention-chips';
|
|
62
62
|
|
|
63
63
|
// Card-supporting UI migrated from hub `components/shared/*` + `components/blog/*`
|
|
64
|
-
export {
|
|
64
|
+
export {
|
|
65
|
+
NavLinkAnchorViaRuntime,
|
|
66
|
+
type NavLinkAnchorViaRuntimeProps,
|
|
67
|
+
type NavLinkViaRuntimeInput,
|
|
68
|
+
type NavLinkViaRuntimeProps,
|
|
69
|
+
useNavLinkViaRuntime,
|
|
70
|
+
} from './nav-link-anchor-via-runtime';
|
|
65
71
|
export { SourceActionButton, type SourceActionButtonProps, type SourceActionDensity } from './source-action-button';
|
|
66
72
|
export {
|
|
67
73
|
ChatAttachmentAddButton,
|
|
@@ -18,11 +18,14 @@
|
|
|
18
18
|
* the lib should never silently fall back when the runtime is missing
|
|
19
19
|
* (the chat tree always provides one in both host + embed modes).
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
* the
|
|
21
|
+
* The same component serves a host's own chrome and pages (site header,
|
|
22
|
+
* footer, call-to-action links): the host mounts the runtime app-wide, names
|
|
23
|
+
* the destination's platform in `targetPlatform`, and may pass its own
|
|
24
|
+
* `onClick` (it runs first; `preventDefault()` cancels the navigation) and
|
|
25
|
+
* plain anchor attributes (`aria-*`, `title`, `data-*`, `style`, `rel`).
|
|
23
26
|
*/
|
|
24
27
|
|
|
25
|
-
import type { ReactNode, MouseEvent } from 'react';
|
|
28
|
+
import type { AnchorHTMLAttributes, ReactNode, MouseEvent } from 'react';
|
|
26
29
|
import { useRequiredChatRuntime } from '../../contexts/chat-runtime-context';
|
|
27
30
|
import { useRouter } from '../../embed-shims/next-navigation';
|
|
28
31
|
import { useChatPanel } from './chat-panel-context';
|
|
@@ -30,7 +33,10 @@ import { resolveHrefForRuntime } from './utils/chat-nav-resolution';
|
|
|
30
33
|
import { executeNavigation } from './utils/execute-navigation';
|
|
31
34
|
import { computeIsNewTab, newTabAnchorAttrs } from './utils/nav-anchor-props';
|
|
32
35
|
|
|
33
|
-
export interface NavLinkAnchorViaRuntimeProps
|
|
36
|
+
export interface NavLinkAnchorViaRuntimeProps extends Omit<
|
|
37
|
+
AnchorHTMLAttributes<HTMLAnchorElement>,
|
|
38
|
+
'href' | 'target' | 'onClick' | 'className' | 'children'
|
|
39
|
+
> {
|
|
34
40
|
href: string;
|
|
35
41
|
path?: string | null;
|
|
36
42
|
targetPlatform?: string | null;
|
|
@@ -38,15 +44,41 @@ export interface NavLinkAnchorViaRuntimeProps {
|
|
|
38
44
|
/** Optional — matches `NavLinkAnchorComponent`'s contract so the
|
|
39
45
|
* markdown-anchor slot can render an empty anchor (rare but legal). */
|
|
40
46
|
children?: ReactNode;
|
|
47
|
+
/** Runs before the navigation; `preventDefault()` cancels it. */
|
|
48
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
41
49
|
}
|
|
42
50
|
|
|
43
|
-
export
|
|
51
|
+
export interface NavLinkViaRuntimeInput {
|
|
52
|
+
href: string;
|
|
53
|
+
path?: string | null;
|
|
54
|
+
/** The platform that owns `href`, by name. */
|
|
55
|
+
targetPlatform?: string | null;
|
|
56
|
+
/** Runs before the navigation; `preventDefault()` cancels it. */
|
|
57
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface NavLinkViaRuntimeProps {
|
|
61
|
+
href: string;
|
|
62
|
+
target?: '_blank';
|
|
63
|
+
rel?: 'noopener' | 'noopener noreferrer';
|
|
64
|
+
onClick: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The anchor props of {@link NavLinkAnchorViaRuntime}, for an element that is
|
|
69
|
+
* not a bare `<a>` (a `Button`'s `linkProps`). ONE decision and ONE click
|
|
70
|
+
* handler for both forms.
|
|
71
|
+
*
|
|
72
|
+
* A new-tab link to a NAMED platform is one of our own sites and keeps the
|
|
73
|
+
* Referer (`noopener` alone: the cross-domain analytics attribute the visit by
|
|
74
|
+
* it); any other new-tab link also gets `noreferrer`.
|
|
75
|
+
*/
|
|
76
|
+
export function useNavLinkViaRuntime({
|
|
44
77
|
href,
|
|
45
78
|
path,
|
|
46
79
|
targetPlatform,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}: NavLinkAnchorViaRuntimeProps) {
|
|
80
|
+
onClick: onClickProp,
|
|
81
|
+
}: NavLinkViaRuntimeInput): NavLinkViaRuntimeProps {
|
|
50
82
|
const runtime = useRequiredChatRuntime();
|
|
51
83
|
const router = useRouter();
|
|
52
84
|
const panel = useChatPanel();
|
|
@@ -54,6 +86,8 @@ export function NavLinkAnchorViaRuntime({
|
|
|
54
86
|
const isNewTab = computeIsNewTab(runtime, resolvedHref, targetPlatform ?? null);
|
|
55
87
|
|
|
56
88
|
const onClick = (e: MouseEvent<HTMLAnchorElement>) => {
|
|
89
|
+
onClickProp?.(e);
|
|
90
|
+
if (e.defaultPrevented) return;
|
|
57
91
|
const handled = executeNavigation({
|
|
58
92
|
event: e,
|
|
59
93
|
runtime,
|
|
@@ -64,8 +98,27 @@ export function NavLinkAnchorViaRuntime({
|
|
|
64
98
|
});
|
|
65
99
|
if (handled && !isNewTab && panel?.closeChat) panel.closeChat();
|
|
66
100
|
};
|
|
101
|
+
const attrs = newTabAnchorAttrs(isNewTab);
|
|
102
|
+
return {
|
|
103
|
+
href: resolvedHref,
|
|
104
|
+
...attrs,
|
|
105
|
+
...(isNewTab && targetPlatform && { rel: 'noopener' as const }),
|
|
106
|
+
onClick,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function NavLinkAnchorViaRuntime({
|
|
111
|
+
href,
|
|
112
|
+
path,
|
|
113
|
+
targetPlatform,
|
|
114
|
+
className,
|
|
115
|
+
children,
|
|
116
|
+
onClick,
|
|
117
|
+
...anchorAttrs
|
|
118
|
+
}: NavLinkAnchorViaRuntimeProps) {
|
|
119
|
+
const linkProps = useNavLinkViaRuntime({ href, path, targetPlatform, onClick });
|
|
67
120
|
return (
|
|
68
|
-
<a
|
|
121
|
+
<a {...linkProps} {...anchorAttrs} className={className}>
|
|
69
122
|
{children}
|
|
70
123
|
</a>
|
|
71
124
|
);
|
|
@@ -9,6 +9,7 @@ import type React from 'react';
|
|
|
9
9
|
import type { ToolType } from '../../types/tool.types';
|
|
10
10
|
import { cn } from '../../utils/cn';
|
|
11
11
|
import { getToolLabel } from '../../utils/tool-utils';
|
|
12
|
+
import { NavLinkAnchorViaRuntime } from '../chat/nav-link-anchor-via-runtime';
|
|
12
13
|
import { ToolIcon } from '../tool-icon';
|
|
13
14
|
|
|
14
15
|
export type { ToolType } from '../../types/tool.types';
|
|
@@ -31,6 +32,12 @@ export interface ToolBadgeProps {
|
|
|
31
32
|
* link that opens it in a new tab; without it the badge is plain text.
|
|
32
33
|
*/
|
|
33
34
|
href?: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* The platform `href` is on, by name, when it is one of the host's own
|
|
37
|
+
* platforms. The badge then opens through the shared navigation rule (the
|
|
38
|
+
* one chat cards use); the host must mount the chat runtime.
|
|
39
|
+
*/
|
|
40
|
+
targetPlatform?: string | null;
|
|
34
41
|
/** Additional CSS classes */
|
|
35
42
|
className?: string;
|
|
36
43
|
iconClassName?: string;
|
|
@@ -47,6 +54,7 @@ export const ToolBadge: React.FC<ToolBadgeProps> = ({
|
|
|
47
54
|
icon,
|
|
48
55
|
variant = 'inline',
|
|
49
56
|
href,
|
|
57
|
+
targetPlatform,
|
|
50
58
|
className,
|
|
51
59
|
iconClassName,
|
|
52
60
|
}) => {
|
|
@@ -55,7 +63,16 @@ export const ToolBadge: React.FC<ToolBadgeProps> = ({
|
|
|
55
63
|
|
|
56
64
|
// One rule for both variants: with an `href` the badge is a link.
|
|
57
65
|
const linked = (node: React.ReactElement, linkClassName: string) =>
|
|
58
|
-
href ? (
|
|
66
|
+
href && targetPlatform ? (
|
|
67
|
+
<NavLinkAnchorViaRuntime
|
|
68
|
+
href={href}
|
|
69
|
+
targetPlatform={targetPlatform}
|
|
70
|
+
title={text || undefined}
|
|
71
|
+
className={linkClassName}
|
|
72
|
+
>
|
|
73
|
+
{node}
|
|
74
|
+
</NavLinkAnchorViaRuntime>
|
|
75
|
+
) : href ? (
|
|
59
76
|
<a href={href} target="_blank" rel="noopener noreferrer" title={text || undefined} className={linkClassName}>
|
|
60
77
|
{node}
|
|
61
78
|
</a>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { ExternalLink } from 'lucide-react';
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import { useNavLinkViaRuntime } from '../chat/nav-link-anchor-via-runtime';
|
|
5
6
|
import { Button } from './button';
|
|
6
7
|
|
|
7
8
|
export interface BrandAssociationItem {
|
|
@@ -10,6 +11,13 @@ export interface BrandAssociationItem {
|
|
|
10
11
|
description: string;
|
|
11
12
|
buttonText: string;
|
|
12
13
|
link: string;
|
|
14
|
+
/**
|
|
15
|
+
* The platform `link` leads to, by name, when it is another of the host's
|
|
16
|
+
* own platforms. The button then opens it through the shared navigation rule
|
|
17
|
+
* (the one chat cards use); the host must mount the chat runtime. Omitted, it
|
|
18
|
+
* is a plain outside link in a new tab.
|
|
19
|
+
*/
|
|
20
|
+
targetPlatform?: string | null;
|
|
13
21
|
}
|
|
14
22
|
|
|
15
23
|
export interface BrandAssociationCardProps {
|
|
@@ -17,6 +25,16 @@ export interface BrandAssociationCardProps {
|
|
|
17
25
|
className?: string;
|
|
18
26
|
}
|
|
19
27
|
|
|
28
|
+
/** The button to a NAMED platform: the shared navigation rule decides how it opens. */
|
|
29
|
+
function PlatformBrowseButton({ item }: { item: BrandAssociationItem }) {
|
|
30
|
+
const linkProps = useNavLinkViaRuntime({ href: item.link, targetPlatform: item.targetPlatform });
|
|
31
|
+
return (
|
|
32
|
+
<Button variant="outline" linkProps={linkProps} rightIcon={<ExternalLink className="h-4 w-4" />}>
|
|
33
|
+
Browse {item.buttonText}
|
|
34
|
+
</Button>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
20
38
|
export function BrandAssociationCard({ item, className = '' }: BrandAssociationCardProps) {
|
|
21
39
|
// Helper function to render icon - handle both React elements and components
|
|
22
40
|
const renderIcon = () => {
|
|
@@ -43,9 +61,13 @@ export function BrandAssociationCard({ item, className = '' }: BrandAssociationC
|
|
|
43
61
|
<p className="text-ods-text-secondary text-h6">{item.description}</p>
|
|
44
62
|
|
|
45
63
|
{/* Browse Button */}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
64
|
+
{item.targetPlatform ? (
|
|
65
|
+
<PlatformBrowseButton item={item} />
|
|
66
|
+
) : (
|
|
67
|
+
<Button variant="outline" href={item.link} openInNewTab rightIcon={<ExternalLink className="h-4 w-4" />}>
|
|
68
|
+
Browse {item.buttonText}
|
|
69
|
+
</Button>
|
|
70
|
+
)}
|
|
49
71
|
</div>
|
|
50
72
|
</div>
|
|
51
73
|
);
|