@flamingo-stack/openframe-frontend-core 0.0.207 → 0.0.208-snapshot.20260526233118
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-Z3GQGR5E.js → chunk-4TD7MDHA.js} +3178 -2088
- package/dist/chunk-4TD7MDHA.js.map +1 -0
- package/dist/chunk-4XLJWX2N.js +12 -0
- package/dist/chunk-4XLJWX2N.js.map +1 -0
- package/dist/chunk-VFKQMAUF.cjs +12 -0
- package/dist/chunk-VFKQMAUF.cjs.map +1 -0
- package/dist/{chunk-APM6KBPU.cjs → chunk-ZRSOPDAV.cjs} +1664 -574
- package/dist/chunk-ZRSOPDAV.cjs.map +1 -0
- package/dist/components/chat/embeddable-chat.d.ts +35 -2
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/case-study-card.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/customer-interview-card.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/dispatch.d.ts +9 -0
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
- package/dist/components/chat/hooks/index.d.ts +3 -0
- package/dist/components/chat/hooks/index.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-embedded-chat.d.ts +10 -169
- package/dist/components/chat/hooks/use-embedded-chat.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +85 -0
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts +124 -0
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-unified-chat.d.ts +33 -0
- package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -0
- package/dist/components/chat/index.cjs +8 -2
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.js +11 -5
- package/dist/components/chat/types/index.d.ts +1 -0
- package/dist/components/chat/types/index.d.ts.map +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +185 -0
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -0
- package/dist/components/features/index.cjs +3 -2
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +2 -1
- package/dist/components/index.cjs +26 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +27 -3
- package/dist/components/loading/unified-skeleton.d.ts +2 -1
- package/dist/components/loading/unified-skeleton.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +3 -2
- package/dist/components/navigation/index.cjs.map +1 -1
- package/dist/components/navigation/index.js +2 -1
- package/dist/components/shared/delivery/delivery-lists.d.ts +16 -0
- package/dist/components/shared/delivery/delivery-lists.d.ts.map +1 -0
- package/dist/components/shared/delivery/delivery-table.d.ts +12 -0
- package/dist/components/shared/delivery/delivery-table.d.ts.map +1 -0
- package/dist/components/shared/delivery/index.d.ts +3 -0
- package/dist/components/shared/delivery/index.d.ts.map +1 -0
- package/dist/components/shared/dev-section/dev-section-page.d.ts +31 -0
- package/dist/components/shared/dev-section/dev-section-page.d.ts.map +1 -0
- package/dist/components/shared/dev-section/dev-section-view.d.ts +34 -0
- package/dist/components/shared/dev-section/dev-section-view.d.ts.map +1 -0
- package/dist/components/shared/dev-section/index.d.ts +3 -0
- package/dist/components/shared/dev-section/index.d.ts.map +1 -0
- package/dist/components/shared/legal-document/index.d.ts +10 -0
- package/dist/components/shared/legal-document/index.d.ts.map +1 -0
- package/dist/components/shared/legal-document/legal-document-page.d.ts +66 -0
- package/dist/components/shared/legal-document/legal-document-page.d.ts.map +1 -0
- package/dist/components/shared/legal-document/use-legal-docs.d.ts +40 -0
- package/dist/components/shared/legal-document/use-legal-docs.d.ts.map +1 -0
- package/dist/components/shared/product-release/index.d.ts +2 -1
- package/dist/components/shared/product-release/index.d.ts.map +1 -1
- package/dist/components/shared/product-release/release-detail-page.d.ts +11 -7
- package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
- package/dist/components/shared/roadmap/index.d.ts +18 -0
- package/dist/components/shared/roadmap/index.d.ts.map +1 -0
- package/dist/components/shared/roadmap/roadmap-grid-skeleton.d.ts +24 -0
- package/dist/components/shared/roadmap/roadmap-grid-skeleton.d.ts.map +1 -0
- package/dist/components/shared/roadmap/roadmap-grid.d.ts +18 -0
- package/dist/components/shared/roadmap/roadmap-grid.d.ts.map +1 -0
- package/dist/components/shared/roadmap/use-roadmap-voting.d.ts +25 -0
- package/dist/components/shared/roadmap/use-roadmap-voting.d.ts.map +1 -0
- package/dist/components/ui/index.cjs +8 -2
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +11 -5
- package/dist/components/ui/release-changelog-section.d.ts +13 -2
- package/dist/components/ui/release-changelog-section.d.ts.map +1 -1
- package/dist/embed-shims/index.cjs +1 -6
- package/dist/embed-shims/index.cjs.map +1 -1
- package/dist/embed-shims/index.js +1 -6
- package/dist/embed-shims/index.js.map +1 -1
- package/dist/index.cjs +18 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -3
- package/dist/types/delivery.d.ts +49 -0
- package/dist/types/delivery.d.ts.map +1 -0
- package/dist/types/index.cjs +13 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +12 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/dev-sections/index.d.ts +11 -0
- package/dist/utils/dev-sections/index.d.ts.map +1 -0
- package/dist/utils/dev-sections/openframe-dev-sections.d.ts +209 -0
- package/dist/utils/dev-sections/openframe-dev-sections.d.ts.map +1 -0
- package/dist/utils/index.cjs +82 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +81 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/embeddable-chat.tsx +123 -8
- package/src/components/chat/entity-cards/blog-card.tsx +2 -2
- package/src/components/chat/entity-cards/case-study-card.tsx +9 -2
- package/src/components/chat/entity-cards/customer-interview-card.tsx +6 -2
- package/src/components/chat/entity-cards/dispatch.tsx +14 -0
- package/src/components/chat/entity-cards/investor-update-card.tsx +1 -1
- package/src/components/chat/entity-cards/onboarding-guide-card.tsx +2 -2
- package/src/components/chat/hooks/index.ts +9 -2
- package/src/components/chat/hooks/use-embedded-chat.ts +18 -1016
- package/src/components/chat/hooks/use-nats-chat-adapter.ts +372 -0
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +1058 -0
- package/src/components/chat/hooks/use-unified-chat.ts +171 -0
- package/src/components/chat/types/index.ts +1 -0
- package/src/components/chat/types/unified-chat-state.types.ts +215 -0
- package/src/components/index.ts +8 -0
- package/src/components/loading/card-skeleton.tsx +2 -2
- package/src/components/loading/unified-skeleton.tsx +6 -5
- package/src/components/shared/delivery/delivery-lists.tsx +199 -0
- package/src/components/shared/delivery/delivery-table.tsx +174 -0
- package/src/components/shared/delivery/index.ts +9 -0
- package/src/components/shared/dev-section/dev-section-page.tsx +72 -0
- package/src/components/shared/dev-section/dev-section-view.tsx +129 -0
- package/src/components/shared/dev-section/index.ts +2 -0
- package/src/components/shared/legal-document/index.ts +19 -0
- package/src/components/shared/legal-document/legal-document-page.tsx +178 -0
- package/src/components/shared/legal-document/use-legal-docs.ts +123 -0
- package/src/components/shared/product-release/index.ts +14 -3
- package/src/components/shared/product-release/product-release-card-skeleton.tsx +1 -1
- package/src/components/shared/product-release/product-release-card.tsx +1 -1
- package/src/components/shared/product-release/release-detail-page.tsx +45 -7
- package/src/components/shared/roadmap/index.ts +23 -0
- package/src/components/shared/roadmap/roadmap-grid-skeleton.tsx +74 -0
- package/src/components/shared/roadmap/roadmap-grid.tsx +106 -0
- package/src/components/shared/roadmap/use-roadmap-voting.ts +163 -0
- package/src/components/ui/release-changelog-section.tsx +113 -32
- package/src/stories/EmbeddableChat.stories.tsx +186 -0
- package/src/types/delivery.ts +54 -0
- package/src/types/index.ts +1 -0
- package/src/utils/dev-sections/index.ts +17 -0
- package/src/utils/dev-sections/openframe-dev-sections.ts +148 -0
- package/src/utils/index.ts +6 -1
- package/dist/chunk-APM6KBPU.cjs.map +0 -1
- package/dist/chunk-Z3GQGR5E.js.map +0 -1
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* - `currentPlatform()` → `useRequiredChatRuntime().source`.
|
|
16
16
|
* - `useNavLink`/`NavLinkAnchor` → chip-anchor rewrite via
|
|
17
17
|
* `handleChatNavClick` + lib's `NavLinkAnchorViaRuntime`.
|
|
18
|
-
* - `useDocChat(source)` → `
|
|
18
|
+
* - `useDocChat(source)` → `useSseChatAdapter()` (reads source from runtime).
|
|
19
19
|
* - `tableIdForDocumentType` import deleted (dead per audit).
|
|
20
20
|
* - `renderChatInlineEntityCard` imported from lib's entity-cards barrel.
|
|
21
21
|
* - `useCloseOnNavigation` signature is `(close, pathname)` — pass `null`
|
|
@@ -54,7 +54,13 @@ import { renderChatInlineEntityCard } from './entity-cards/dispatch'
|
|
|
54
54
|
import type { ChatCardDispatchExtras } from './entity-cards/dispatch'
|
|
55
55
|
|
|
56
56
|
import { useRequiredChatRuntime } from '../../contexts/chat-runtime-context'
|
|
57
|
-
import {
|
|
57
|
+
import { type ChatSource, type UseSseChatAdapterOptions } from './hooks/use-sse-chat-adapter'
|
|
58
|
+
import {
|
|
59
|
+
useUnifiedChat,
|
|
60
|
+
type ChatMode,
|
|
61
|
+
type UseUnifiedChatModes,
|
|
62
|
+
} from './hooks/use-unified-chat'
|
|
63
|
+
import type { UseNatsChatAdapterConfig } from './hooks/use-nats-chat-adapter'
|
|
58
64
|
import { useChatAttachments } from './hooks/use-chat-attachments'
|
|
59
65
|
import { useChatAttachmentImageGallery } from './hooks/use-chat-attachment-image-gallery'
|
|
60
66
|
import { useChatIdentity } from './hooks/use-chat-identity'
|
|
@@ -84,7 +90,7 @@ import { formatSingularLookupInvocation } from './utils/slash-dispatch-utils'
|
|
|
84
90
|
|
|
85
91
|
/** Lib-side type alias kept inline to avoid leaking the (deprecated) hub
|
|
86
92
|
* `rag-table-config` `DocSource` import. The chat source is always a
|
|
87
|
-
* string id; `
|
|
93
|
+
* string id; `useSseChatAdapter` reads it from `runtime.source`. */
|
|
88
94
|
type DocSource = string
|
|
89
95
|
|
|
90
96
|
export interface EmbeddableChatProps {
|
|
@@ -117,10 +123,46 @@ export interface EmbeddableChatProps {
|
|
|
117
123
|
* (programs + product_release). Forwarded straight to
|
|
118
124
|
* `renderChatInlineEntityCard`. */
|
|
119
125
|
extras?: ChatCardDispatchExtras
|
|
120
|
-
/** Optional callback used by `
|
|
126
|
+
/** Optional callback used by `useSseChatAdapter`'s `displayRef` /
|
|
121
127
|
* `discussRef` flow to translate an LLM document type into the
|
|
122
|
-
* registry table id for entity-id-filtered retrieval.
|
|
128
|
+
* registry table id for entity-id-filtered retrieval.
|
|
129
|
+
*
|
|
130
|
+
* Legacy top-level form. The new shape is `modes.guide.tableIdForDocumentType`.
|
|
131
|
+
* When both are present, `modes` wins. */
|
|
123
132
|
tableIdForDocumentType?: (documentType: string) => string | null
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Per-mode transport configuration. When omitted, the component
|
|
136
|
+
* falls back to legacy guide-only behaviour synthesised from the
|
|
137
|
+
* top-level `tableIdForDocumentType` prop — multi-platform-hub and
|
|
138
|
+
* any other existing consumer keep working with zero changes.
|
|
139
|
+
*
|
|
140
|
+
* When provided, this is the canonical way to wire chat transports:
|
|
141
|
+
*
|
|
142
|
+
* - `modes.guide` → SSE/Guide adapter options (RAG retrieval, hub).
|
|
143
|
+
* - `modes.mingo` → NATS/Mingo adapter config (agent, openframe).
|
|
144
|
+
*
|
|
145
|
+
* Configuring both modes makes the in-panel mode toggle appear so
|
|
146
|
+
* the user can flip between Guide and Mingo without losing either
|
|
147
|
+
* history (each mode keeps its own local thread).
|
|
148
|
+
*/
|
|
149
|
+
modes?: UseUnifiedChatModes
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Controlled active-mode. When provided, `onActiveModeChange` MUST
|
|
153
|
+
* also be provided. For uncontrolled use see `defaultActiveMode`.
|
|
154
|
+
*/
|
|
155
|
+
activeMode?: ChatMode
|
|
156
|
+
|
|
157
|
+
/** Controlled active-mode change handler. Required when `activeMode` is set. */
|
|
158
|
+
onActiveModeChange?: (mode: ChatMode) => void
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Initial active mode for uncontrolled mode. Ignored when `activeMode`
|
|
162
|
+
* is set. Defaults to `'guide'` when `modes.guide` is configured,
|
|
163
|
+
* else `'mingo'`.
|
|
164
|
+
*/
|
|
165
|
+
defaultActiveMode?: ChatMode
|
|
124
166
|
}
|
|
125
167
|
|
|
126
168
|
// =============================================================================
|
|
@@ -490,6 +532,10 @@ function EmbeddableChatInner({
|
|
|
490
532
|
showInternalTrigger = true,
|
|
491
533
|
extras,
|
|
492
534
|
tableIdForDocumentType,
|
|
535
|
+
modes,
|
|
536
|
+
activeMode: controlledActiveMode,
|
|
537
|
+
onActiveModeChange,
|
|
538
|
+
defaultActiveMode,
|
|
493
539
|
}: EmbeddableChatProps) {
|
|
494
540
|
const runtime = useRequiredChatRuntime()
|
|
495
541
|
const source = runtime.source as DocSource
|
|
@@ -639,6 +685,42 @@ function EmbeddableChatInner({
|
|
|
639
685
|
identityUser?.name?.split(' ')[0]?.trim()) ||
|
|
640
686
|
undefined
|
|
641
687
|
|
|
688
|
+
// Synthesize `modes` from legacy props when the new API isn't used.
|
|
689
|
+
// `modes` wins when both are present — the legacy top-level
|
|
690
|
+
// `tableIdForDocumentType` is then silently ignored.
|
|
691
|
+
const effectiveModes = useMemo<UseUnifiedChatModes>(() => {
|
|
692
|
+
if (modes) return modes
|
|
693
|
+
const guideOptions: UseSseChatAdapterOptions = tableIdForDocumentType
|
|
694
|
+
? { tableIdForDocumentType }
|
|
695
|
+
: {}
|
|
696
|
+
return { guide: guideOptions }
|
|
697
|
+
}, [modes, tableIdForDocumentType])
|
|
698
|
+
|
|
699
|
+
// Initial active mode picks the first configured slot when neither
|
|
700
|
+
// controlled `activeMode` nor `defaultActiveMode` is provided. Guide
|
|
701
|
+
// wins ties so legacy callers see no behaviour change.
|
|
702
|
+
const initialActiveMode: ChatMode =
|
|
703
|
+
controlledActiveMode ??
|
|
704
|
+
defaultActiveMode ??
|
|
705
|
+
(effectiveModes.guide ? 'guide' : 'mingo')
|
|
706
|
+
|
|
707
|
+
const [uncontrolledActiveMode, setUncontrolledActiveMode] =
|
|
708
|
+
useState<ChatMode>(initialActiveMode)
|
|
709
|
+
const activeMode = controlledActiveMode ?? uncontrolledActiveMode
|
|
710
|
+
const handleActiveModeChange = useCallback(
|
|
711
|
+
(next: ChatMode) => {
|
|
712
|
+
if (controlledActiveMode === undefined) {
|
|
713
|
+
setUncontrolledActiveMode(next)
|
|
714
|
+
}
|
|
715
|
+
onActiveModeChange?.(next)
|
|
716
|
+
},
|
|
717
|
+
[controlledActiveMode, onActiveModeChange],
|
|
718
|
+
)
|
|
719
|
+
|
|
720
|
+
// Mode toggle visible only when both slots are populated.
|
|
721
|
+
const showModeToggle =
|
|
722
|
+
effectiveModes.guide !== undefined && effectiveModes.mingo !== undefined
|
|
723
|
+
|
|
642
724
|
const {
|
|
643
725
|
messages: rawMessages,
|
|
644
726
|
isLoading: chatLoading,
|
|
@@ -654,7 +736,7 @@ function EmbeddableChatInner({
|
|
|
654
736
|
currentCacheHitRatePct,
|
|
655
737
|
currentUsageBreakdown,
|
|
656
738
|
displayRef,
|
|
657
|
-
} =
|
|
739
|
+
} = useUnifiedChat({ modes: effectiveModes, activeMode })
|
|
658
740
|
|
|
659
741
|
// Chat-attachment hooks (v2 attachment feature).
|
|
660
742
|
const {
|
|
@@ -736,7 +818,7 @@ function EmbeddableChatInner({
|
|
|
736
818
|
}
|
|
737
819
|
sendMessage(augmentedText, {
|
|
738
820
|
...(readyAttachments.length > 0
|
|
739
|
-
? {
|
|
821
|
+
? { attachments: readyAttachments }
|
|
740
822
|
: {}),
|
|
741
823
|
})
|
|
742
824
|
if (readyAttachments.length > 0) {
|
|
@@ -894,6 +976,35 @@ function EmbeddableChatInner({
|
|
|
894
976
|
fullWidth
|
|
895
977
|
className="!rounded-xl"
|
|
896
978
|
/>
|
|
979
|
+
{showModeToggle ? (
|
|
980
|
+
<div
|
|
981
|
+
role="radiogroup"
|
|
982
|
+
aria-label="Chat mode"
|
|
983
|
+
className="mt-3 inline-flex rounded-lg border border-ods-border bg-ods-bg-secondary p-0.5"
|
|
984
|
+
>
|
|
985
|
+
{(['mingo', 'guide'] as ChatMode[]).map((m) => {
|
|
986
|
+
const isActive = activeMode === m
|
|
987
|
+
const label = m === 'mingo' ? 'Mingo' : 'Guide'
|
|
988
|
+
return (
|
|
989
|
+
<button
|
|
990
|
+
key={m}
|
|
991
|
+
type="button"
|
|
992
|
+
role="radio"
|
|
993
|
+
aria-checked={isActive}
|
|
994
|
+
onClick={() => handleActiveModeChange(m)}
|
|
995
|
+
className={
|
|
996
|
+
'px-3 py-1 text-sm rounded-md transition-colors ' +
|
|
997
|
+
(isActive
|
|
998
|
+
? 'bg-ods-accent text-ods-text-on-accent'
|
|
999
|
+
: 'text-ods-text-secondary hover:text-ods-text-primary')
|
|
1000
|
+
}
|
|
1001
|
+
>
|
|
1002
|
+
{label}
|
|
1003
|
+
</button>
|
|
1004
|
+
)
|
|
1005
|
+
})}
|
|
1006
|
+
</div>
|
|
1007
|
+
) : null}
|
|
897
1008
|
</div>
|
|
898
1009
|
|
|
899
1010
|
<div
|
|
@@ -1071,7 +1182,11 @@ function EmbeddableChatInner({
|
|
|
1071
1182
|
|
|
1072
1183
|
<div className="flex items-center gap-2 w-full">
|
|
1073
1184
|
<ChatAttachmentAddButton
|
|
1074
|
-
|
|
1185
|
+
// Attachments are Guide-only: the NATS agent backend
|
|
1186
|
+
// doesn't accept them, so the add-button is hidden in
|
|
1187
|
+
// Mingo mode regardless of the identity endpoint's
|
|
1188
|
+
// capability flag.
|
|
1189
|
+
attachmentsEnabled={attachmentsEnabled && activeMode === 'guide'}
|
|
1075
1190
|
attachmentsCount={stagedAttachments.length}
|
|
1076
1191
|
onAddFiles={addAttachmentFiles}
|
|
1077
1192
|
disabled={chatLoading}
|
|
@@ -83,7 +83,7 @@ export function BlogCardSkeleton({ size = 'default' }: { size?: 'default' | 'sm'
|
|
|
83
83
|
}
|
|
84
84
|
return (
|
|
85
85
|
<article className="group bg-ods-card border border-ods-border rounded-lg overflow-hidden h-full flex flex-col animate-pulse">
|
|
86
|
-
<div className="aspect-[
|
|
86
|
+
<div className="aspect-[1200/630] bg-ods-bg" />
|
|
87
87
|
<div className="p-4 flex flex-col flex-grow space-y-3">
|
|
88
88
|
<div className="h-5 w-3/4 bg-ods-bg rounded" />
|
|
89
89
|
<div className="h-5 w-1/2 bg-ods-bg rounded" />
|
|
@@ -187,7 +187,7 @@ export function BlogCard({
|
|
|
187
187
|
className="flex flex-col h-full focus:outline-none"
|
|
188
188
|
aria-label={`Read article: ${post.title}`}
|
|
189
189
|
>
|
|
190
|
-
<div className="relative w-full aspect-[
|
|
190
|
+
<div className="relative w-full aspect-[1200/630] overflow-hidden bg-ods-bg">
|
|
191
191
|
{displayImage ? (
|
|
192
192
|
<Image
|
|
193
193
|
src={displayImage}
|
|
@@ -71,7 +71,8 @@ export function CaseStudyCardSkeleton({ size = 'default' }: { size?: 'default' |
|
|
|
71
71
|
}
|
|
72
72
|
return (
|
|
73
73
|
<div className="bg-ods-card border border-ods-border rounded-lg overflow-hidden p-6 flex flex-col gap-6 animate-pulse">
|
|
74
|
-
|
|
74
|
+
{/* Skeleton aspect matches the real card's image slot (OG 1200×630) */}
|
|
75
|
+
<div className="w-full aspect-[1200/630] rounded-sm bg-ods-bg" />
|
|
75
76
|
<div className="h-[72px] flex flex-col gap-2">
|
|
76
77
|
<div className="h-5 w-3/4 bg-ods-bg rounded" />
|
|
77
78
|
<div className="h-5 w-1/2 bg-ods-bg rounded" />
|
|
@@ -125,7 +126,13 @@ export function CaseStudyCard({ study, href, target, rel, placeholderUrl, size =
|
|
|
125
126
|
return (
|
|
126
127
|
<a href={href} target={target} rel={rel} className={cn('block h-full', className)}>
|
|
127
128
|
<Card className="bg-ods-card border border-ods-border hover:border-ods-accent transition-colors p-6 flex flex-col gap-6 overflow-hidden">
|
|
128
|
-
|
|
129
|
+
{/* Fixed aspect ratio matches the standard OG card source aspect
|
|
130
|
+
(1200×630 = 1.91:1), so the image fits with near-zero CSS-side
|
|
131
|
+
cropping. Subject anchoring is then a function of the source
|
|
132
|
+
image's center-66% safe zone (OG design convention) — visually
|
|
133
|
+
uniform across all cards regardless of column width. Skeleton
|
|
134
|
+
(lines 73-74) uses the same aspect for consistent layout. */}
|
|
135
|
+
<div className="relative w-full aspect-[1200/630] rounded-sm overflow-hidden bg-ods-bg shrink-0">
|
|
129
136
|
{coverImage && (
|
|
130
137
|
<Image
|
|
131
138
|
src={coverImage}
|
|
@@ -66,7 +66,8 @@ export function CustomerInterviewCardSkeleton({ size = 'default' }: { size?: 'de
|
|
|
66
66
|
}
|
|
67
67
|
return (
|
|
68
68
|
<div className="bg-ods-card border border-ods-border rounded-lg overflow-hidden p-6 flex flex-col gap-6 animate-pulse">
|
|
69
|
-
|
|
69
|
+
{/* Aspect matches the loaded image slot (OG 1200×630) */}
|
|
70
|
+
<div className="w-full aspect-[1200/630] rounded-sm bg-ods-bg" />
|
|
70
71
|
<div className="space-y-2">
|
|
71
72
|
<div className="h-5 w-3/4 bg-ods-bg rounded" />
|
|
72
73
|
<div className="h-5 w-1/2 bg-ods-bg rounded" />
|
|
@@ -130,7 +131,10 @@ export function CustomerInterviewCard({ interview, href, target, rel, placeholde
|
|
|
130
131
|
return (
|
|
131
132
|
<a href={href} target={target} rel={rel} className={cn('block h-full', className)}>
|
|
132
133
|
<Card className="bg-ods-card border border-ods-border hover:border-ods-accent transition-colors p-6 flex flex-col gap-6 overflow-hidden">
|
|
133
|
-
|
|
134
|
+
{/* Fixed aspect matching standard OG card source (1200×630, 1.91:1)
|
|
135
|
+
— image renders with near-zero CSS-side crop, subject anchored
|
|
136
|
+
consistently via center-66% safe-zone convention. */}
|
|
137
|
+
<div className="w-full aspect-[1200/630] rounded-sm overflow-hidden bg-ods-bg shrink-0 relative">
|
|
134
138
|
{thumbnailUrl ? (
|
|
135
139
|
<>
|
|
136
140
|
<img
|
|
@@ -117,6 +117,15 @@ export interface ChatCardDispatchExtras {
|
|
|
117
117
|
buildProductReleaseCardProps?: (
|
|
118
118
|
release: any,
|
|
119
119
|
) => Omit<ProductReleaseCardProps, 'size' | 'title' | 'summary' | 'version' | 'anchorProps'>
|
|
120
|
+
/** Build a branded OG placeholder URL from an entity title. Compact chat-
|
|
121
|
+
* inline cards (`size='sm'` for blog/case-study/customer-interview/
|
|
122
|
+
* investor-update/onboarding-guide) pass the result as `placeholderUrl`
|
|
123
|
+
* so the card's image slot renders the OG fallback instead of an empty
|
|
124
|
+
* span when the entity has no `featured_image`. Hub callers wire
|
|
125
|
+
* `buildOgPlaceholderUrl` from `lib/utils/entity-image.ts`. Optional —
|
|
126
|
+
* when omitted, the compact cards keep the existing empty-slot
|
|
127
|
+
* behavior. */
|
|
128
|
+
buildOgPlaceholderUrl?: (title: string) => string | null
|
|
120
129
|
}
|
|
121
130
|
|
|
122
131
|
/** Per-card render options threaded through from the chat shell. */
|
|
@@ -676,6 +685,7 @@ const CHAT_CARD_REGISTRY: Record<string, ChatCardRegistryEntry> = {
|
|
|
676
685
|
size="sm"
|
|
677
686
|
href={chatRef.url ?? ''}
|
|
678
687
|
targetPlatform={chatRef.targetPlatform ?? null}
|
|
688
|
+
placeholderUrl={opts?.extras?.buildOgPlaceholderUrl?.(item?.title ?? '') ?? null}
|
|
679
689
|
{...newTabAnchorAttrs(opts.isNewTab)}
|
|
680
690
|
hasEmbeddedVideo={chatRef.metadata?.hasEmbeddedVideo === true}
|
|
681
691
|
/>
|
|
@@ -692,6 +702,7 @@ const CHAT_CARD_REGISTRY: Record<string, ChatCardRegistryEntry> = {
|
|
|
692
702
|
size="sm"
|
|
693
703
|
href={chatRef.url ?? ''}
|
|
694
704
|
targetPlatform={chatRef.targetPlatform ?? null}
|
|
705
|
+
placeholderUrl={opts?.extras?.buildOgPlaceholderUrl?.(item?.title ?? '') ?? null}
|
|
695
706
|
{...newTabAnchorAttrs(opts.isNewTab)}
|
|
696
707
|
/>
|
|
697
708
|
),
|
|
@@ -707,6 +718,7 @@ const CHAT_CARD_REGISTRY: Record<string, ChatCardRegistryEntry> = {
|
|
|
707
718
|
size="sm"
|
|
708
719
|
href={chatRef.url ?? ''}
|
|
709
720
|
targetPlatform={chatRef.targetPlatform ?? null}
|
|
721
|
+
placeholderUrl={opts?.extras?.buildOgPlaceholderUrl?.(item?.title ?? '') ?? null}
|
|
710
722
|
{...newTabAnchorAttrs(opts.isNewTab)}
|
|
711
723
|
/>
|
|
712
724
|
),
|
|
@@ -747,6 +759,7 @@ const CHAT_CARD_REGISTRY: Record<string, ChatCardRegistryEntry> = {
|
|
|
747
759
|
size="sm"
|
|
748
760
|
href={chatRef.url ?? ''}
|
|
749
761
|
targetPlatform={chatRef.targetPlatform ?? null}
|
|
762
|
+
placeholderUrl={opts?.extras?.buildOgPlaceholderUrl?.(item?.title ?? '') ?? null}
|
|
750
763
|
{...newTabAnchorAttrs(opts.isNewTab)}
|
|
751
764
|
/>
|
|
752
765
|
),
|
|
@@ -763,6 +776,7 @@ const CHAT_CARD_REGISTRY: Record<string, ChatCardRegistryEntry> = {
|
|
|
763
776
|
size="sm"
|
|
764
777
|
href={chatRef.url ?? ''}
|
|
765
778
|
targetPlatform={chatRef.targetPlatform ?? null}
|
|
779
|
+
placeholderUrl={opts?.extras?.buildOgPlaceholderUrl?.(item?.title ?? '') ?? null}
|
|
766
780
|
{...newTabAnchorAttrs(opts.isNewTab)}
|
|
767
781
|
/>
|
|
768
782
|
),
|
|
@@ -62,7 +62,7 @@ export function InvestorUpdateCardSkeleton({ size = 'default' }: { size?: 'defau
|
|
|
62
62
|
}
|
|
63
63
|
return (
|
|
64
64
|
<div className="bg-ods-card border border-ods-border rounded-lg overflow-hidden h-full animate-pulse">
|
|
65
|
-
<div className="aspect-[
|
|
65
|
+
<div className="aspect-[1200/630] bg-ods-bg" />
|
|
66
66
|
<div className="p-4 space-y-3">
|
|
67
67
|
<div className="h-5 w-3/4 bg-ods-bg rounded" />
|
|
68
68
|
<div className="h-3 w-full bg-ods-bg/60 rounded" />
|
|
@@ -63,7 +63,7 @@ export function OnboardingGuideCardSkeleton({ size = 'default' }: { size?: 'cata
|
|
|
63
63
|
return (
|
|
64
64
|
<div className="bg-ods-system-greys-black border border-ods-border rounded-lg overflow-hidden flex flex-col p-6 gap-4 animate-pulse">
|
|
65
65
|
<div className="flex flex-col md:flex-row gap-4 md:gap-6">
|
|
66
|
-
<div className="w-full md:w-[256px] aspect-[
|
|
66
|
+
<div className="w-full md:w-[256px] aspect-[1200/630] bg-ods-border rounded-lg flex-shrink-0" />
|
|
67
67
|
<div className="flex-1 min-w-0 flex flex-col">
|
|
68
68
|
<div className="min-h-[60px] md:min-h-[72px] flex flex-col gap-1.5 justify-start mb-3">
|
|
69
69
|
<div className="h-[25px] md:h-[30px] w-3/4 bg-ods-border rounded" />
|
|
@@ -169,7 +169,7 @@ export function OnboardingGuideCard({ guide, href, target, rel, placeholderUrl,
|
|
|
169
169
|
<div className="flex flex-col p-6 gap-4">
|
|
170
170
|
<div className="flex flex-col md:flex-row gap-4 md:gap-6">
|
|
171
171
|
<div className="w-full md:w-[256px] flex-shrink-0">
|
|
172
|
-
<div className="relative rounded-lg overflow-hidden w-full aspect-[
|
|
172
|
+
<div className="relative rounded-lg overflow-hidden w-full aspect-[1200/630] bg-ods-bg">
|
|
173
173
|
{coverImage ? (
|
|
174
174
|
<Image
|
|
175
175
|
src={coverImage}
|
|
@@ -16,10 +16,17 @@ export * from './use-close-on-navigation'
|
|
|
16
16
|
|
|
17
17
|
// useChat + useSSE — ported from hub `hooks/useChat.ts` + `hooks/useSSE.ts`
|
|
18
18
|
// minus the MockChatService + useChatConfig dependencies (which stay in
|
|
19
|
-
// hub-only code).
|
|
20
|
-
// the hub's `useDocChat`.
|
|
19
|
+
// hub-only code).
|
|
21
20
|
export * from './use-chat'
|
|
22
21
|
export * from './use-sse'
|
|
22
|
+
|
|
23
|
+
// Unified chat surface — single public hook + two transport adapters.
|
|
24
|
+
// Consumers typically use `useUnifiedChat({ modes, activeMode })`; the
|
|
25
|
+
// adapter hooks are exposed for advanced cases where direct transport
|
|
26
|
+
// access is needed. `useEmbeddedChat` is the legacy SSE alias.
|
|
27
|
+
export * from './use-sse-chat-adapter'
|
|
28
|
+
export * from './use-nats-chat-adapter'
|
|
29
|
+
export * from './use-unified-chat'
|
|
23
30
|
export * from './use-embedded-chat'
|
|
24
31
|
|
|
25
32
|
// useProxiedImageUrl — runtime-driven hook wrapping pure
|