@flamingo-stack/openframe-frontend-core 0.0.577 → 0.0.578-1950.5326.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JQI726T3.js → chunk-3LMYQGAJ.js} +3 -2
- package/dist/chunk-3LMYQGAJ.js.map +1 -0
- package/dist/{chunk-RUJKOU5F.js → chunk-5IAGT5LB.js} +2 -2
- package/dist/{chunk-TU32TSAK.js → chunk-5NG2P2KI.js} +5 -5
- package/dist/{chunk-GDWBJFMG.cjs → chunk-ABWA3W3M.cjs} +32 -32
- package/dist/{chunk-GDWBJFMG.cjs.map → chunk-ABWA3W3M.cjs.map} +1 -1
- package/dist/{chunk-U3SDSA5K.js → chunk-AJ67T7LI.js} +4 -4
- package/dist/{chunk-THDGDYJ3.js → chunk-BFJBE4PQ.js} +5 -5
- package/dist/{chunk-KE2TCUOH.cjs → chunk-BLPGMX2L.cjs} +190 -190
- package/dist/{chunk-KE2TCUOH.cjs.map → chunk-BLPGMX2L.cjs.map} +1 -1
- package/dist/{chunk-HSOMYCUG.cjs → chunk-E5QAU63Y.cjs} +11 -11
- package/dist/{chunk-HSOMYCUG.cjs.map → chunk-E5QAU63Y.cjs.map} +1 -1
- package/dist/{chunk-ZBJ6XSDO.js → chunk-ESXUEMPA.js} +3 -3
- package/dist/{chunk-CFTZAZ7R.cjs → chunk-G3AJXLKH.cjs} +28 -28
- package/dist/{chunk-CFTZAZ7R.cjs.map → chunk-G3AJXLKH.cjs.map} +1 -1
- package/dist/{chunk-XG2WNF4L.cjs → chunk-GOEBT72V.cjs} +19 -19
- package/dist/{chunk-XG2WNF4L.cjs.map → chunk-GOEBT72V.cjs.map} +1 -1
- package/dist/{chunk-LYOGSVFO.js → chunk-IBSOYTGZ.js} +3 -3
- package/dist/{chunk-AQ5MZVYN.js → chunk-IWK2NFVR.js} +3 -3
- package/dist/{chunk-2YCUEUIZ.js → chunk-JJH4H4CJ.js} +6 -6
- package/dist/{chunk-RSMUAAPW.js → chunk-KLG3MGRP.js} +3 -3
- package/dist/{chunk-RNUH5IHZ.js → chunk-KPE277X2.js} +3 -3
- package/dist/{chunk-XBBCUC32.cjs → chunk-KQBYQBQN.cjs} +15 -15
- package/dist/{chunk-XBBCUC32.cjs.map → chunk-KQBYQBQN.cjs.map} +1 -1
- package/dist/{chunk-IQFXDS5O.js → chunk-LEUJNBWU.js} +7 -7
- package/dist/{chunk-4D2BR756.js → chunk-LPFA56WY.js} +52 -31
- package/dist/chunk-LPFA56WY.js.map +1 -0
- package/dist/{chunk-75X6BRID.cjs → chunk-M7FNT5AC.cjs} +453 -432
- package/dist/chunk-M7FNT5AC.cjs.map +1 -0
- package/dist/{chunk-JCH6HGQD.js → chunk-MCWAZ5XI.js} +2 -2
- package/dist/{chunk-ET3Q4FIZ.cjs → chunk-NJDL7F7K.cjs} +10 -10
- package/dist/{chunk-ET3Q4FIZ.cjs.map → chunk-NJDL7F7K.cjs.map} +1 -1
- package/dist/{chunk-MIY5FYX3.cjs → chunk-NNFQLTJ3.cjs} +4 -3
- package/dist/chunk-NNFQLTJ3.cjs.map +1 -0
- package/dist/{chunk-XBSW7IF6.cjs → chunk-NPNYQSCG.cjs} +21 -21
- package/dist/{chunk-XBSW7IF6.cjs.map → chunk-NPNYQSCG.cjs.map} +1 -1
- package/dist/{chunk-NQCGDZJ3.cjs → chunk-OIJWSYKP.cjs} +3 -3
- package/dist/{chunk-NQCGDZJ3.cjs.map → chunk-OIJWSYKP.cjs.map} +1 -1
- package/dist/{chunk-WOHHZZJK.cjs → chunk-POB6GNIR.cjs} +57 -57
- package/dist/{chunk-WOHHZZJK.cjs.map → chunk-POB6GNIR.cjs.map} +1 -1
- package/dist/{chunk-NEKT67O5.js → chunk-QHGARH6P.js} +6 -6
- package/dist/{chunk-5DPCIIJ7.cjs → chunk-R7OJZCE6.cjs} +80 -80
- package/dist/{chunk-5DPCIIJ7.cjs.map → chunk-R7OJZCE6.cjs.map} +1 -1
- package/dist/{chunk-6FJABKPX.cjs → chunk-SETRICAM.cjs} +6 -6
- package/dist/{chunk-6FJABKPX.cjs.map → chunk-SETRICAM.cjs.map} +1 -1
- package/dist/{chunk-4KR7JWKB.js → chunk-SHJXC7A4.js} +4 -4
- package/dist/{chunk-NP3XN6ZX.js → chunk-SNZZ6Q6G.js} +4 -4
- package/dist/chunk-SNZZ6Q6G.js.map +1 -0
- package/dist/{chunk-APFGR2KK.cjs → chunk-UQPA2XT7.cjs} +28 -28
- package/dist/{chunk-APFGR2KK.cjs.map → chunk-UQPA2XT7.cjs.map} +1 -1
- package/dist/{chunk-GPWU3PPR.cjs → chunk-VEHZNQ77.cjs} +30 -30
- package/dist/{chunk-GPWU3PPR.cjs.map → chunk-VEHZNQ77.cjs.map} +1 -1
- package/dist/{chunk-RCLJSENK.cjs → chunk-WUZQYZXI.cjs} +6 -6
- package/dist/{chunk-RCLJSENK.cjs.map → chunk-WUZQYZXI.cjs.map} +1 -1
- package/dist/{chunk-CIUYHBAY.cjs → chunk-YOYHJQX3.cjs} +5 -5
- package/dist/{chunk-CIUYHBAY.cjs.map → chunk-YOYHJQX3.cjs.map} +1 -1
- package/dist/{chunk-FCVAVOXS.js → chunk-ZBVMPVJF.js} +3 -3
- package/dist/components/case-studies/index.cjs +10 -10
- package/dist/components/case-studies/index.js +4 -4
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +3 -3
- package/dist/components/chat/index.js +2 -2
- package/dist/components/chat/nav-link-anchor-via-runtime.d.ts.map +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +9 -2
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/chat/utils/chat-nav-resolution.d.ts +9 -3
- package/dist/components/chat/utils/chat-nav-resolution.d.ts.map +1 -1
- package/dist/components/chat/utils/execute-navigation.d.ts +11 -0
- package/dist/components/chat/utils/execute-navigation.d.ts.map +1 -1
- package/dist/components/chat/utils/index.d.ts +1 -1
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/chat/utils/nav-anchor-props.d.ts +4 -0
- package/dist/components/chat/utils/nav-anchor-props.d.ts.map +1 -1
- package/dist/components/chat/utils/resolve-fetched-card-href.d.ts +42 -3
- package/dist/components/chat/utils/resolve-fetched-card-href.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +5 -5
- package/dist/components/contact/index.js +4 -4
- package/dist/components/docs/index.cjs +8 -8
- package/dist/components/docs/index.js +7 -7
- package/dist/components/embeds/index.cjs +5 -5
- package/dist/components/embeds/index.js +4 -4
- package/dist/components/faq/index.cjs +5 -5
- package/dist/components/faq/index.js +4 -4
- package/dist/components/features/index.cjs +4 -4
- package/dist/components/features/index.js +3 -3
- package/dist/components/help-center-pages/index.cjs +24 -24
- package/dist/components/help-center-pages/index.js +15 -15
- package/dist/components/index.cjs +136 -136
- package/dist/components/index.js +15 -15
- package/dist/components/meeting-scheduler/index.cjs +31 -31
- package/dist/components/meeting-scheduler/index.js +3 -3
- package/dist/components/navigation/index.cjs +7 -7
- package/dist/components/navigation/index.js +6 -6
- package/dist/components/onboarding-guides/index.cjs +7 -7
- package/dist/components/onboarding-guides/index.js +6 -6
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +8 -8
- package/dist/components/tickets/index.js +7 -7
- package/dist/components/ui/index.cjs +4 -4
- package/dist/components/ui/index.js +3 -3
- package/dist/index.cjs +8 -8
- package/dist/index.js +7 -7
- package/dist/utils/content-href.d.ts +26 -5
- package/dist/utils/content-href.d.ts.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/embeddable-chat.tsx +9 -2
- package/src/components/chat/entity-cards/.dispatch.md +1 -1
- package/src/components/chat/entity-cards/dispatch.tsx +43 -23
- package/src/components/chat/hooks/.use-unified-chat.md +5 -1
- package/src/components/chat/hooks/use-nats-chat-adapter.ts +4 -7
- package/src/components/chat/hooks/use-unified-chat.ts +8 -2
- package/src/components/chat/nav-link-anchor-via-runtime.tsx +8 -10
- package/src/components/chat/types/.unified-chat-state.types.md +2 -1
- package/src/components/chat/types/unified-chat-state.types.ts +9 -2
- package/src/components/chat/utils/__tests__/execute-navigation.test.ts +190 -0
- package/src/components/chat/utils/__tests__/resolve-fetched-card-href.test.ts +75 -2
- package/src/components/chat/utils/chat-nav-resolution.ts +9 -3
- package/src/components/chat/utils/execute-navigation.ts +32 -2
- package/src/components/chat/utils/index.ts +1 -1
- package/src/components/chat/utils/nav-anchor-props.ts +4 -2
- package/src/components/chat/utils/resolve-fetched-card-href.ts +50 -2
- package/src/utils/.content-href.md +1 -1
- package/src/utils/__tests__/content-href.test.ts +3 -0
- package/src/utils/content-href.ts +30 -3
- package/src/utils/index.ts +1 -0
- package/dist/chunk-4D2BR756.js.map +0 -1
- package/dist/chunk-75X6BRID.cjs.map +0 -1
- package/dist/chunk-JQI726T3.js.map +0 -1
- package/dist/chunk-MIY5FYX3.cjs.map +0 -1
- package/dist/chunk-NP3XN6ZX.js.map +0 -1
- package/dist/components/chat/utils/nav-click-handler.d.ts +0 -24
- package/dist/components/chat/utils/nav-click-handler.d.ts.map +0 -1
- package/src/components/chat/utils/.nav-click-handler.md +0 -43
- package/src/components/chat/utils/nav-click-handler.ts +0 -34
- /package/dist/{chunk-RUJKOU5F.js.map → chunk-5IAGT5LB.js.map} +0 -0
- /package/dist/{chunk-TU32TSAK.js.map → chunk-5NG2P2KI.js.map} +0 -0
- /package/dist/{chunk-U3SDSA5K.js.map → chunk-AJ67T7LI.js.map} +0 -0
- /package/dist/{chunk-THDGDYJ3.js.map → chunk-BFJBE4PQ.js.map} +0 -0
- /package/dist/{chunk-ZBJ6XSDO.js.map → chunk-ESXUEMPA.js.map} +0 -0
- /package/dist/{chunk-LYOGSVFO.js.map → chunk-IBSOYTGZ.js.map} +0 -0
- /package/dist/{chunk-AQ5MZVYN.js.map → chunk-IWK2NFVR.js.map} +0 -0
- /package/dist/{chunk-2YCUEUIZ.js.map → chunk-JJH4H4CJ.js.map} +0 -0
- /package/dist/{chunk-RSMUAAPW.js.map → chunk-KLG3MGRP.js.map} +0 -0
- /package/dist/{chunk-RNUH5IHZ.js.map → chunk-KPE277X2.js.map} +0 -0
- /package/dist/{chunk-IQFXDS5O.js.map → chunk-LEUJNBWU.js.map} +0 -0
- /package/dist/{chunk-JCH6HGQD.js.map → chunk-MCWAZ5XI.js.map} +0 -0
- /package/dist/{chunk-NEKT67O5.js.map → chunk-QHGARH6P.js.map} +0 -0
- /package/dist/{chunk-4KR7JWKB.js.map → chunk-SHJXC7A4.js.map} +0 -0
- /package/dist/{chunk-FCVAVOXS.js.map → chunk-ZBVMPVJF.js.map} +0 -0
|
@@ -59,7 +59,7 @@ export {
|
|
|
59
59
|
resolveExternalNavigation,
|
|
60
60
|
type ExternalNavResolution,
|
|
61
61
|
} from './chat-nav-resolution';
|
|
62
|
-
export { handleChatNavClick, type ChatNavClickInput } from './
|
|
62
|
+
export { handleChatNavClick, type ChatNavClickInput } from './execute-navigation';
|
|
63
63
|
// The unified navigation-execution primitive — single source of truth for
|
|
64
64
|
// new-tab/same-tab + internal/external + embed/host + the runtime→router→window
|
|
65
65
|
// fallback. Every surface routes through it (handleChatNavClick is now a wrapper).
|
|
@@ -33,11 +33,13 @@ import { decideNewTab as libDecideNewTab } from './decide-new-tab';
|
|
|
33
33
|
/** An ABSOLUTE `http(s)` URL on the current page's origin. Relative hrefs return
|
|
34
34
|
* false (in embed mode they're hub-relative, not in-app), as do cross-origin
|
|
35
35
|
* and non-http URLs. SSR-safe: no `window` → false. */
|
|
36
|
-
function isSameOriginAbsoluteHref(href: string): boolean {
|
|
36
|
+
export function isSameOriginAbsoluteHref(href: string): boolean {
|
|
37
37
|
if (typeof window === 'undefined') return false;
|
|
38
38
|
if (!/^https?:\/\//i.test(href)) return false;
|
|
39
39
|
try {
|
|
40
|
-
|
|
40
|
+
// Origin off `location.href`, not `location.origin`: jsdom leaves the latter
|
|
41
|
+
// undefined, which reads as "every URL is foreign" under test.
|
|
42
|
+
return new URL(href).origin === new URL(window.location.href).origin;
|
|
41
43
|
} catch {
|
|
42
44
|
return false;
|
|
43
45
|
}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* Pure — no React, no DOM. The caller owns `safeHref` validation.
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
import type { ComposeContentUrl } from '../../../utils/content-href';
|
|
34
|
+
import type { ComposeContentUrl, ComposedContentUrl } from '../../../utils/content-href';
|
|
35
35
|
import { canonicalContentRefType } from '../../../utils/list-url';
|
|
36
36
|
|
|
37
37
|
export interface FetchedCardHrefInput {
|
|
@@ -90,12 +90,60 @@ function readPlatforms(item: unknown, canonicalType: string): Array<{ name?: str
|
|
|
90
90
|
* when the host wired no seam (the caller then keeps the card unlinked, which
|
|
91
91
|
* is the pre-existing behavior).
|
|
92
92
|
*/
|
|
93
|
+
/**
|
|
94
|
+
* Where a fetch-mode card's destination came from. The loader needs the source,
|
|
95
|
+
* not just the string: only the `item` branch must leave the ref's own
|
|
96
|
+
* `targetPlatform` untouched.
|
|
97
|
+
*/
|
|
98
|
+
export type FetchedCardHrefChoice =
|
|
99
|
+
| { source: 'hostOverride'; href: string; targetPlatform: string | null }
|
|
100
|
+
| { source: 'item'; href: string; targetPlatform?: undefined }
|
|
101
|
+
| { source: 'composed'; href: string; targetPlatform: string | null };
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Decide a fetched card's destination between the two producers that can claim
|
|
105
|
+
* it. Pure, so the precedence is testable on its own — it used to live as
|
|
106
|
+
* inline ternaries in `ChatCardLoader`.
|
|
107
|
+
*
|
|
108
|
+
* 1. an EXPLICIT host override — the host said where this type lives in its
|
|
109
|
+
* own app, which beats everything;
|
|
110
|
+
* 2. the fetched row's own url (`registry.fallbackHref`) — minted by the
|
|
111
|
+
* content host for ITS surface, authoritative in the absence of (1);
|
|
112
|
+
* 3. the composer's synthesized href, unless the registry opted out
|
|
113
|
+
* (`noComposedHref`) because the synthesis would be a 404.
|
|
114
|
+
*
|
|
115
|
+
* (2) beating (3) is why `noComposedHref` exists; (1) beating (2) is what keeps
|
|
116
|
+
* a re-homed type (an embedder serving hub tickets under `/help-center/tickets`)
|
|
117
|
+
* from following the content host's path into an unrelated route of its own.
|
|
118
|
+
*/
|
|
119
|
+
export function pickFetchedCardHref({
|
|
120
|
+
composed,
|
|
121
|
+
itemHref,
|
|
122
|
+
allowComposed,
|
|
123
|
+
}: {
|
|
124
|
+
/** Result of {@link resolveFetchedCardHref}, or null when unresolvable. */
|
|
125
|
+
composed: ComposedContentUrl | null;
|
|
126
|
+
/** `registry.fallbackHref(item)` — the fetched row's own destination. */
|
|
127
|
+
itemHref: string | null;
|
|
128
|
+
/** False for registry entries flagged `noComposedHref`. */
|
|
129
|
+
allowComposed: boolean;
|
|
130
|
+
}): FetchedCardHrefChoice | null {
|
|
131
|
+
if (composed?.hostOverride) {
|
|
132
|
+
return { source: 'hostOverride', href: composed.href, targetPlatform: composed.targetPlatform };
|
|
133
|
+
}
|
|
134
|
+
if (itemHref) return { source: 'item', href: itemHref };
|
|
135
|
+
if (composed && allowComposed) {
|
|
136
|
+
return { source: 'composed', href: composed.href, targetPlatform: composed.targetPlatform };
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
|
|
93
141
|
export function resolveFetchedCardHref({
|
|
94
142
|
contentRefType,
|
|
95
143
|
id,
|
|
96
144
|
item,
|
|
97
145
|
composeContentUrl,
|
|
98
|
-
}: FetchedCardHrefInput):
|
|
146
|
+
}: FetchedCardHrefInput): ComposedContentUrl | null {
|
|
99
147
|
if (!composeContentUrl || !contentRefType || !id) return null;
|
|
100
148
|
const canonicalType = canonicalContentRefType(contentRefType);
|
|
101
149
|
return composeContentUrl({
|
|
@@ -15,7 +15,7 @@ Unified content-href authority for all embeddable surfaces — resolves content
|
|
|
15
15
|
|
|
16
16
|
### Functions
|
|
17
17
|
|
|
18
|
-
- **`makeComposeContentUrl(opts)`** — Factory that builds the embedder's `composeContentUrl`. Resolution order: explicit `overrides` → hosted in-app route → verbatim `externalUrl` → hub-origin fallback.
|
|
18
|
+
- **`makeComposeContentUrl(opts)`** — Factory that builds the embedder's `composeContentUrl`. Resolution order: explicit `overrides` → hosted in-app route → verbatim `externalUrl` → hub-origin fallback. Only the `overrides` branch returns `hostOverride: true`; fetch-mode chat cards rank that above the fetched row's own url (`pickFetchedCardHref`), and everything else below it.
|
|
19
19
|
- **`buildDefaultHref(basePath, slug)`** — Fallback href when no `composeContentUrl` is wired (single-platform embedders).
|
|
20
20
|
- **`resolveContentHref(composeContentUrl, args)`** — Ternary helper used by catalog/detail views: delegates to `composeContentUrl` when wired, otherwise calls `buildDefaultHref`.
|
|
21
21
|
|
|
@@ -188,6 +188,9 @@ describe('makeComposeContentUrl (unified single-object seam)', () => {
|
|
|
188
188
|
expect(c({ type: 'product_release', identifier: 'v2', externalUrl: `${HUB}/releases/v2` })).toEqual({
|
|
189
189
|
href: '/custom/v2',
|
|
190
190
|
targetPlatform: 'openframe',
|
|
191
|
+
// Only this branch is flagged — fetch-mode cards rank it above the
|
|
192
|
+
// fetched row's own url (`pickFetchedCardHref`).
|
|
193
|
+
hostOverride: true,
|
|
191
194
|
});
|
|
192
195
|
});
|
|
193
196
|
|
|
@@ -112,10 +112,34 @@ export interface ContentHrefOptions {
|
|
|
112
112
|
overrides?: Record<string, (identifier: string) => { href: string; targetPlatform: string | null }>;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
/** What the seam resolves a content reference to. */
|
|
116
|
+
export interface ComposedContentUrl {
|
|
117
|
+
href: string;
|
|
118
|
+
targetPlatform: string | null;
|
|
119
|
+
/**
|
|
120
|
+
* Set ONLY when the href came from the host's EXPLICIT per-type `overrides`
|
|
121
|
+
* entry — i.e. the host stated where this type lives in ITS app, rather than
|
|
122
|
+
* the composer falling through to a hosted-suffix or `<origin>/<type>/<id>`
|
|
123
|
+
* synthesis.
|
|
124
|
+
*
|
|
125
|
+
* The distinction is load-bearing for fetch-mode chat cards whose fetched row
|
|
126
|
+
* already carries a destination (`refHydratedEntry`'s `item.url`, minted by
|
|
127
|
+
* the CONTENT HOST for its OWN surface). That url must beat a synthesized
|
|
128
|
+
* guess, but must NOT beat a host that has explicitly re-homed the type:
|
|
129
|
+
* a HubSpot ticket's `item.url` is the hub's `/tickets?ticket=…`, which in an
|
|
130
|
+
* embedder that serves the same ticket at `/help-center/tickets` silently
|
|
131
|
+
* resolves against the embedder's own unrelated `/tickets` route.
|
|
132
|
+
*
|
|
133
|
+
* Optional and absent by default, so a hand-written composer (the hub's
|
|
134
|
+
* cross-platform one) keeps the pre-existing "row url wins" behavior.
|
|
135
|
+
*/
|
|
136
|
+
hostOverride?: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
115
139
|
/** The unified `composeContentUrl` seam shape on `ChatRuntime`. ALWAYS returns
|
|
116
140
|
* a tuple (never null) — the seam type is non-nullable and callers read
|
|
117
141
|
* `.href` unconditionally. */
|
|
118
|
-
export type ComposeContentUrl = (input: ComposeContentUrlInput) =>
|
|
142
|
+
export type ComposeContentUrl = (input: ComposeContentUrlInput) => ComposedContentUrl;
|
|
119
143
|
|
|
120
144
|
/**
|
|
121
145
|
* Owning platform of a content row, from the hydrated junction the list APIs
|
|
@@ -162,7 +186,8 @@ function lastPathSegment(url: string): string | null {
|
|
|
162
186
|
* Build the embedder's `composeContentUrl` for the unified seam.
|
|
163
187
|
*
|
|
164
188
|
* Resolution order (the merged rule used by BOTH page views and chat cards):
|
|
165
|
-
* 1. `overrides[type]` — explicit per-type href
|
|
189
|
+
* 1. `overrides[type]` — explicit per-type href, returned with
|
|
190
|
+
* `hostOverride: true` (the only branch that sets it).
|
|
166
191
|
* 2. `hostedTypes.has(type)` → relative `/<suffix>/<slug>` (in-app, soft-nav).
|
|
167
192
|
* Chat rows carry the hub URL not the slug, so the slug is recovered from
|
|
168
193
|
* `externalUrl`; page views pass the slug as `identifier`.
|
|
@@ -184,7 +209,9 @@ export function makeComposeContentUrl(opts: ContentHrefOptions): ComposeContentU
|
|
|
184
209
|
const type = canonicalContentRefType(rawType);
|
|
185
210
|
const override =
|
|
186
211
|
opts.overrides && Object.prototype.hasOwnProperty.call(opts.overrides, type) ? opts.overrides[type] : undefined;
|
|
187
|
-
|
|
212
|
+
// Flagged as an explicit host decision — see `ComposedContentUrl.hostOverride`
|
|
213
|
+
// for why a fetch-mode card has to tell this apart from the branches below.
|
|
214
|
+
if (override) return { ...override(identifier), hostOverride: true };
|
|
188
215
|
|
|
189
216
|
const seg = (Object.prototype.hasOwnProperty.call(suffixes, type) ? suffixes[type] : undefined) ?? type;
|
|
190
217
|
|
package/src/utils/index.ts
CHANGED