@flamingo-stack/openframe-frontend-core 0.0.598-2039.5713.1 → 0.0.598
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/chat-protocol/index.cjs +1 -8
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.d.ts +0 -1
- package/dist/chat-protocol/index.d.ts.map +1 -1
- package/dist/chat-protocol/index.js +2 -7
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
- package/dist/{chunk-TSCIVH7T.js → chunk-2JNCZDJR.js} +2 -2
- package/dist/{chunk-6NSGAH5H.cjs → chunk-2SYX2Z7R.cjs} +34 -34
- package/dist/{chunk-6NSGAH5H.cjs.map → chunk-2SYX2Z7R.cjs.map} +1 -1
- package/dist/{chunk-6ZHH37RS.cjs → chunk-3WSS7C2V.cjs} +15 -15
- package/dist/{chunk-6ZHH37RS.cjs.map → chunk-3WSS7C2V.cjs.map} +1 -1
- package/dist/{chunk-5L4ERWSW.js → chunk-75YW6ET4.js} +4 -4
- package/dist/{chunk-VKCETV3C.js → chunk-BK6CCQG6.js} +12 -12
- package/dist/{chunk-HM25MFZX.cjs → chunk-BPVHDDNY.cjs} +8 -8
- package/dist/{chunk-HM25MFZX.cjs.map → chunk-BPVHDDNY.cjs.map} +1 -1
- package/dist/{chunk-VIBREYUK.cjs → chunk-BZEWPW5A.cjs} +3 -3
- package/dist/{chunk-VIBREYUK.cjs.map → chunk-BZEWPW5A.cjs.map} +1 -1
- package/dist/{chunk-KYWU6F3O.cjs → chunk-DAPOBLAK.cjs} +39 -39
- package/dist/{chunk-KYWU6F3O.cjs.map → chunk-DAPOBLAK.cjs.map} +1 -1
- package/dist/{chunk-DHCA5BZP.cjs → chunk-DI3SVVY5.cjs} +85 -85
- package/dist/{chunk-DHCA5BZP.cjs.map → chunk-DI3SVVY5.cjs.map} +1 -1
- package/dist/{chunk-BLUL2TE3.js → chunk-EVMHJB6X.js} +4 -4
- package/dist/{chunk-S6WBBSII.js → chunk-EZM5DNII.js} +3 -3
- package/dist/{chunk-BVQEU5JB.js → chunk-GGQZBSFN.js} +2 -2
- package/dist/{chunk-KTX5B2FW.js → chunk-GHYFVT52.js} +439 -414
- package/dist/chunk-GHYFVT52.js.map +1 -0
- package/dist/{chunk-CCWI3622.cjs → chunk-H64ZHSYR.cjs} +4 -4
- package/dist/{chunk-CCWI3622.cjs.map → chunk-H64ZHSYR.cjs.map} +1 -1
- package/dist/{chunk-4T42D6YG.js → chunk-HLPAVYK7.js} +4 -4
- package/dist/{chunk-HFHBA3VV.cjs → chunk-HWAYIK4U.cjs} +22 -22
- package/dist/{chunk-HFHBA3VV.cjs.map → chunk-HWAYIK4U.cjs.map} +1 -1
- package/dist/{chunk-CF4QJPTN.cjs → chunk-JVZVVZOZ.cjs} +9 -9
- package/dist/{chunk-CF4QJPTN.cjs.map → chunk-JVZVVZOZ.cjs.map} +1 -1
- package/dist/{chunk-XV7RFACE.js → chunk-KHOZ52NR.js} +6 -6
- package/dist/{chunk-IW746HJ7.js → chunk-LRQCKSZC.js} +2 -2
- package/dist/{chunk-JJUV7Z4L.cjs → chunk-M4YQUHOR.cjs} +15 -15
- package/dist/{chunk-JJUV7Z4L.cjs.map → chunk-M4YQUHOR.cjs.map} +1 -1
- package/dist/{chunk-FKBM6U43.js → chunk-MYBXCWEI.js} +2 -2
- package/dist/{chunk-QTPHBCPI.js → chunk-NIAMPMKV.js} +4 -4
- package/dist/{chunk-UXOOVP77.cjs → chunk-O4VZOA2Q.cjs} +3 -3
- package/dist/{chunk-UXOOVP77.cjs.map → chunk-O4VZOA2Q.cjs.map} +1 -1
- package/dist/{chunk-ABNBTPI2.cjs → chunk-P24VPJTT.cjs} +15 -15
- package/dist/{chunk-ABNBTPI2.cjs.map → chunk-P24VPJTT.cjs.map} +1 -1
- package/dist/{chunk-4XPPQDEM.js → chunk-PTK3CINU.js} +5 -5
- package/dist/{chunk-7FUIRGMU.js → chunk-PX4IPM7Q.js} +3 -3
- package/dist/{chunk-NLT5R43J.cjs → chunk-QD64Q4I2.cjs} +9 -9
- package/dist/{chunk-NLT5R43J.cjs.map → chunk-QD64Q4I2.cjs.map} +1 -1
- package/dist/{chunk-TEVP4KNG.cjs → chunk-QIKBISZM.cjs} +522 -497
- package/dist/chunk-QIKBISZM.cjs.map +1 -0
- package/dist/{chunk-FGNUI4CC.js → chunk-R4UV366K.js} +6 -6
- package/dist/{chunk-UPKZU6QU.cjs → chunk-RDTOMWDN.cjs} +1 -1
- package/dist/chunk-RDTOMWDN.cjs.map +1 -0
- package/dist/{chunk-YB6FI2G3.js → chunk-RYXIRVDC.js} +1 -1
- package/dist/chunk-RYXIRVDC.js.map +1 -0
- package/dist/{chunk-QPAPUIF3.cjs → chunk-SAEJGTCI.cjs} +35 -35
- package/dist/{chunk-QPAPUIF3.cjs.map → chunk-SAEJGTCI.cjs.map} +1 -1
- package/dist/{chunk-66HTVTZZ.js → chunk-SE3PVN64.js} +2 -2
- package/dist/{chunk-3IXDZI3R.cjs → chunk-STYNZ4QM.cjs} +3 -3
- package/dist/{chunk-3IXDZI3R.cjs.map → chunk-STYNZ4QM.cjs.map} +1 -1
- package/dist/{chunk-CQRYXSHL.js → chunk-TZPVRWPU.js} +5 -5
- package/dist/{chunk-RU3IKVY2.js → chunk-UAAXUFK6.js} +3 -3
- package/dist/{chunk-F5NEZLTG.cjs → chunk-UE7OFLLS.cjs} +14 -14
- package/dist/{chunk-F5NEZLTG.cjs.map → chunk-UE7OFLLS.cjs.map} +1 -1
- package/dist/{chunk-VUR24QYH.cjs → chunk-UG7JNQZY.cjs} +37 -37
- package/dist/{chunk-VUR24QYH.cjs.map → chunk-UG7JNQZY.cjs.map} +1 -1
- package/dist/{chunk-UQSOFWXP.cjs → chunk-V2QK5W3O.cjs} +3 -3
- package/dist/{chunk-UQSOFWXP.cjs.map → chunk-V2QK5W3O.cjs.map} +1 -1
- package/dist/{chunk-ZABAXD4U.js → chunk-VIRTMRS4.js} +7 -7
- package/dist/{chunk-D565OOXC.cjs → chunk-VLJTJAHJ.cjs} +25 -25
- package/dist/{chunk-D565OOXC.cjs.map → chunk-VLJTJAHJ.cjs.map} +1 -1
- package/dist/{chunk-K5QV7ZAY.js → chunk-VNSRNVPD.js} +437 -756
- package/dist/chunk-VNSRNVPD.js.map +1 -0
- package/dist/{chunk-UQEOAPAI.cjs → chunk-WCBRZCU4.cjs} +9 -9
- package/dist/{chunk-UQEOAPAI.cjs.map → chunk-WCBRZCU4.cjs.map} +1 -1
- package/dist/{chunk-3XFDRL32.js → chunk-WDWCQD75.js} +9 -9
- package/dist/{chunk-QT35C6CW.js → chunk-WPN545FW.js} +12 -12
- package/dist/{chunk-F2KBCLUG.js → chunk-WZJOILPU.js} +2 -2
- package/dist/{chunk-KAADFO74.js → chunk-XNPAVMPB.js} +5 -5
- package/dist/{chunk-5PPYXXUO.cjs → chunk-YBPFIXV4.cjs} +522 -841
- package/dist/chunk-YBPFIXV4.cjs.map +1 -0
- package/dist/{chunk-EHAYNUOL.cjs → chunk-YH6IQTPI.cjs} +3 -3
- package/dist/{chunk-EHAYNUOL.cjs.map → chunk-YH6IQTPI.cjs.map} +1 -1
- package/dist/{chunk-AVAENPVE.cjs → chunk-YWBAIFI2.cjs} +105 -105
- package/dist/{chunk-AVAENPVE.cjs.map → chunk-YWBAIFI2.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +14 -14
- package/dist/components/case-studies/index.js +8 -8
- package/dist/components/chat/embeddable-chat.d.ts +19 -10
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/hooks/index.d.ts +0 -1
- package/dist/components/chat/hooks/index.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-chat-dialog-manager.d.ts +2 -2
- package/dist/components/chat/hooks/use-chat-dialog-manager.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-chat-history-hydration.d.ts +3 -13
- package/dist/components/chat/hooks/use-chat-history-hydration.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +16 -2
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-sse-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 +5 -9
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.js +4 -8
- package/dist/components/chat/types/unified-chat-state.types.d.ts +6 -67
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/chat/utils/index.d.ts +0 -1
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +9 -9
- package/dist/components/contact/index.js +8 -8
- package/dist/components/docs/index.cjs +12 -12
- package/dist/components/docs/index.js +11 -11
- package/dist/components/embeds/index.cjs +9 -9
- package/dist/components/embeds/index.js +8 -8
- package/dist/components/faq/index.cjs +10 -10
- package/dist/components/faq/index.js +9 -9
- package/dist/components/features/index.cjs +8 -8
- package/dist/components/features/index.js +7 -7
- package/dist/components/help-center-pages/index.cjs +31 -31
- package/dist/components/help-center-pages/index.js +22 -22
- package/dist/components/index.cjs +66 -70
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +22 -26
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +49 -49
- package/dist/components/meeting-scheduler/index.js +9 -9
- package/dist/components/navigation/index.cjs +11 -11
- package/dist/components/navigation/index.js +10 -10
- package/dist/components/onboarding-guides/index.cjs +12 -12
- package/dist/components/onboarding-guides/index.js +11 -11
- package/dist/components/related-content/index.cjs +7 -7
- package/dist/components/related-content/index.js +6 -6
- package/dist/components/tickets/index.cjs +13 -13
- package/dist/components/tickets/index.js +12 -12
- package/dist/components/ui/data-table/data-table-body.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-skeleton.d.ts +31 -0
- package/dist/components/ui/data-table/data-table-skeleton.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +8 -12
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +7 -11
- package/dist/components/ui/table/table-empty-state.d.ts +1 -1
- package/dist/components/ui/table/table-empty-state.d.ts.map +1 -1
- package/dist/components/ui/table/table-skeleton.d.ts +1 -14
- package/dist/components/ui/table/table-skeleton.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts +1 -1
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/components/ui/table/types.d.ts +33 -6
- package/dist/components/ui/table/types.d.ts.map +1 -1
- package/dist/contexts/chat-runtime-context.d.ts +0 -12
- package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
- package/dist/contexts/index.cjs +2 -2
- package/dist/contexts/index.js +1 -1
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/index.js +4 -4
- package/dist/index.cjs +12 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chat-protocol/index.ts +0 -1
- package/src/chat-protocol/nats-decoder.ts +5 -1
- package/src/components/chat/.embeddable-chat.md +2 -4
- package/src/components/chat/embeddable-chat.tsx +84 -131
- package/src/components/chat/hooks/.use-chat-dialog-manager.md +1 -3
- package/src/components/chat/hooks/.use-nats-chat-adapter.md +1 -3
- package/src/components/chat/hooks/.use-sse-chat-adapter.md +1 -8
- package/src/components/chat/hooks/.use-unified-chat.md +2 -2
- package/src/components/chat/hooks/index.ts +0 -2
- package/src/components/chat/hooks/use-chat-dialog-manager.ts +65 -38
- package/src/components/chat/hooks/use-chat-history-hydration.ts +24 -67
- package/src/components/chat/hooks/use-nats-chat-adapter.ts +150 -65
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +59 -233
- package/src/components/chat/hooks/use-unified-chat.ts +0 -5
- package/src/components/chat/types/.unified-chat-state.types.md +1 -13
- package/src/components/chat/types/unified-chat-state.types.ts +6 -74
- package/src/components/chat/utils/index.ts +0 -7
- package/src/components/ui/data-table/data-table-body.tsx +8 -49
- package/src/components/ui/data-table/data-table-skeleton.tsx +100 -0
- package/src/components/ui/table/table-empty-state.tsx +5 -1
- package/src/components/ui/table/table-skeleton.tsx +14 -40
- package/src/components/ui/table/table.tsx +34 -15
- package/src/components/ui/table/types.ts +33 -6
- package/src/contexts/.chat-runtime-context.md +1 -3
- package/src/contexts/chat-runtime-context.tsx +0 -12
- package/dist/chat-protocol/wire-narrow.d.ts +0 -17
- package/dist/chat-protocol/wire-narrow.d.ts.map +0 -1
- package/dist/chunk-5PPYXXUO.cjs.map +0 -1
- package/dist/chunk-K5QV7ZAY.js.map +0 -1
- package/dist/chunk-KTX5B2FW.js.map +0 -1
- package/dist/chunk-TEVP4KNG.cjs.map +0 -1
- package/dist/chunk-UPKZU6QU.cjs.map +0 -1
- package/dist/chunk-YB6FI2G3.js.map +0 -1
- package/dist/components/chat/hooks/use-managed-dialog-list.d.ts +0 -68
- package/dist/components/chat/hooks/use-managed-dialog-list.d.ts.map +0 -1
- package/dist/components/chat/utils/chat-conversations-api.d.ts +0 -29
- package/dist/components/chat/utils/chat-conversations-api.d.ts.map +0 -1
- package/src/chat-protocol/wire-narrow.ts +0 -22
- package/src/components/chat/hooks/.use-managed-dialog-list.md +0 -31
- package/src/components/chat/hooks/__tests__/managed-dialog-list.test.ts +0 -280
- package/src/components/chat/hooks/__tests__/nats-adapter-managed-dialogs.test.ts +0 -172
- package/src/components/chat/hooks/__tests__/sse-managed-dialogs.test.ts +0 -310
- package/src/components/chat/hooks/use-managed-dialog-list.ts +0 -371
- package/src/components/chat/utils/.chat-conversations-api.md +0 -16
- package/src/components/chat/utils/__tests__/chat-conversations-api-golden.test.ts +0 -105
- package/src/components/chat/utils/chat-conversations-api.ts +0 -83
- /package/dist/{chunk-TSCIVH7T.js.map → chunk-2JNCZDJR.js.map} +0 -0
- /package/dist/{chunk-5L4ERWSW.js.map → chunk-75YW6ET4.js.map} +0 -0
- /package/dist/{chunk-VKCETV3C.js.map → chunk-BK6CCQG6.js.map} +0 -0
- /package/dist/{chunk-BLUL2TE3.js.map → chunk-EVMHJB6X.js.map} +0 -0
- /package/dist/{chunk-S6WBBSII.js.map → chunk-EZM5DNII.js.map} +0 -0
- /package/dist/{chunk-BVQEU5JB.js.map → chunk-GGQZBSFN.js.map} +0 -0
- /package/dist/{chunk-4T42D6YG.js.map → chunk-HLPAVYK7.js.map} +0 -0
- /package/dist/{chunk-XV7RFACE.js.map → chunk-KHOZ52NR.js.map} +0 -0
- /package/dist/{chunk-IW746HJ7.js.map → chunk-LRQCKSZC.js.map} +0 -0
- /package/dist/{chunk-FKBM6U43.js.map → chunk-MYBXCWEI.js.map} +0 -0
- /package/dist/{chunk-QTPHBCPI.js.map → chunk-NIAMPMKV.js.map} +0 -0
- /package/dist/{chunk-4XPPQDEM.js.map → chunk-PTK3CINU.js.map} +0 -0
- /package/dist/{chunk-7FUIRGMU.js.map → chunk-PX4IPM7Q.js.map} +0 -0
- /package/dist/{chunk-FGNUI4CC.js.map → chunk-R4UV366K.js.map} +0 -0
- /package/dist/{chunk-66HTVTZZ.js.map → chunk-SE3PVN64.js.map} +0 -0
- /package/dist/{chunk-CQRYXSHL.js.map → chunk-TZPVRWPU.js.map} +0 -0
- /package/dist/{chunk-RU3IKVY2.js.map → chunk-UAAXUFK6.js.map} +0 -0
- /package/dist/{chunk-ZABAXD4U.js.map → chunk-VIRTMRS4.js.map} +0 -0
- /package/dist/{chunk-3XFDRL32.js.map → chunk-WDWCQD75.js.map} +0 -0
- /package/dist/{chunk-QT35C6CW.js.map → chunk-WPN545FW.js.map} +0 -0
- /package/dist/{chunk-F2KBCLUG.js.map → chunk-WZJOILPU.js.map} +0 -0
- /package/dist/{chunk-KAADFO74.js.map → chunk-XNPAVMPB.js.map} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
SearchInput
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GHYFVT52.js";
|
|
5
5
|
import {
|
|
6
6
|
contentFetch
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GGQZBSFN.js";
|
|
8
8
|
import {
|
|
9
9
|
NEW_TAB_FEATURES,
|
|
10
10
|
resolveExternalNavigation,
|
|
11
11
|
resolveSourceIcon,
|
|
12
12
|
stripSameOriginToPath
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VNSRNVPD.js";
|
|
14
14
|
import {
|
|
15
15
|
useDebounce
|
|
16
16
|
} from "./chunk-5LIDR7HL.js";
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
} from "./chunk-XXMHLZ3Y.js";
|
|
20
20
|
import {
|
|
21
21
|
decideNewTab
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-UAAXUFK6.js";
|
|
23
23
|
import {
|
|
24
24
|
useChatRuntime
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RYXIRVDC.js";
|
|
26
26
|
|
|
27
27
|
// src/components/shared/doc-search/format-relative-path.ts
|
|
28
28
|
function formatRelativePath(fullPath) {
|
|
@@ -381,4 +381,4 @@ export {
|
|
|
381
381
|
resolveSearchResultAction,
|
|
382
382
|
useDocSearch
|
|
383
383
|
};
|
|
384
|
-
//# sourceMappingURL=chunk-
|
|
384
|
+
//# sourceMappingURL=chunk-R4UV366K.js.map
|
|
@@ -21,4 +21,4 @@ function useRequiredChatRuntime() {
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
exports.ChatRuntimeContext = ChatRuntimeContext; exports.useChatRuntime = useChatRuntime; exports.useRequiredChatRuntime = useRequiredChatRuntime;
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-RDTOMWDN.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-RDTOMWDN.cjs","../src/contexts/chat-runtime-context.tsx"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACiCA,8BAA0C;AAoOnC,IAAM,mBAAA,EAAqB,kCAAA,IAAsC,CAAA;AAQjE,SAAS,cAAA,CAAA,EAAqC;AACnD,EAAA,OAAO,+BAAA,kBAA6B,CAAA;AACtC;AAUO,SAAS,sBAAA,CAAA,EAAsC;AACpD,EAAA,MAAM,EAAA,EAAI,+BAAA,kBAA6B,CAAA;AACvC,EAAA,GAAA,CAAI,CAAC,CAAA,EAAG;AACN,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,IAMF,CAAA;AAAA,EACF;AACA,EAAA,OAAO,CAAA;AACT;ADvRA;AACA;AACE;AACA;AACA;AACF,kJAAC","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-RDTOMWDN.cjs","sourcesContent":[null,"'use client';\n\n/**\n * Chat runtime context — single seam for embedding the chat panel in a\n * different host (e.g. user1.openframe.ai reverse-proxying API calls\n * under /api/mingo-guide/* to hub.openframe.ai/api/*).\n *\n * Three concerns, one context:\n * 1. API endpoints: chatStreamUrl / approvalToolUrl / commandsUrl /\n * buildListUrl + attachment endpoints + chat-identity. The chat\n * reads them from runtime; hub vs embedded app supply different\n * strings via different providers.\n * 2. Navigation mode + callbacks: 'host' or 'embed' mode. Host wires\n * its own router/docNav via the optional `navigate` callback\n * (plain function, NOT a hook); embed forces new-tab via\n * `defaultContentOrigin` + lib's `resolveExternalNavigation`.\n * 3. Identity context: only `source` (required for localStorage\n * namespacing). The display identity (greeting first-name etc.)\n * comes from the server via `useChatIdentity()` — never injected\n * client-side, so it always matches the server-resolved auth.\n *\n * Sibling of EndpointsRuntimeContext (announcement bar, contact form,\n * access codes). Each runtime stays an independent React context so\n * embedders can opt into either feature without forcing the other.\n *\n * IMPORTANT for embedders: memoize the value passed to\n * `<ChatRuntimeContext.Provider value={...}>` (e.g. via React.useMemo).\n * Every change to its reference identity invalidates downstream\n * `useMemo` consumers (the chat input's slash-commands binding,\n * useNavLink's embed-resolution memo, useDocChat's streamFn factory).\n * The hub's `<HubRuntimeProvider>` already memoizes correctly with\n * stable deps. Embedded apps that build the value inline on each render\n * will pay an avoidable re-render cost across the entire chat tree.\n */\n\nimport { createContext, useContext } from 'react';\n\nimport type { ComposeContentUrl } from '../utils/content-href';\n\n/**\n * Runtime config consumed by the chat panel.\n */\nexport interface ChatRuntime {\n endpoints: {\n /** POST streaming chat. Hub: '/api/docs/chat'. */\n chatStreamUrl: string;\n /** POST agent approve/reject. Hub: '/api/chat/agent/confirm-tool'. */\n approvalToolUrl: string;\n /** Customer-ticket agent endpoints (Help Center). OPTIONAL — when unset,\n * the ticket hooks fall back to the bare hub paths\n * (`/api/chat/agent/{find-ticket,ticket-action,list-engagements}`).\n * Embedders behind a reverse proxy set these to their proxied paths\n * (e.g. `/content/api/chat/agent/...`) so tickets route through the SAME\n * endpoint config + proxy as every other endpoint. */\n findTicketUrl?: string;\n ticketActionUrl?: string;\n listEngagementsUrl?: string;\n /** Ticket live-stream + read-receipt endpoints (Help Center\n * realtime). OPTIONAL — unset → bare hub paths under the DEDICATED\n * ticket surface (`/api/tickets/{stream,read}` — deliberately NOT\n * the chat agent's `/api/chat/agent/*` prefix). Reverse-proxy\n * embedders set their proxied paths. Consumed by\n * `TicketLiveProvider`. The unread summary has NO endpoint — it\n * arrives as `ticket-summary` frames on the stream and in\n * `ticket-read` responses. */\n ticketStreamUrl?: string;\n ticketReadUrl?: string;\n /** GET slash-command catalog. Hub: '/api/docs/commands'. */\n commandsUrl: string;\n /** GET server-side conversation history (`?conversationId=<id>`) — the\n * chat panel's mount-time hydration read against the server transcript\n * store (localStorage keeps only the server-issued conversation id).\n * OPTIONAL — defaults to `<chatStreamUrl>/history`, which is correct for\n * same-origin hosts AND for reverse-proxy embedders (the proxied chat\n * prefix covers it). Set explicitly only when the history route lives\n * elsewhere. */\n chatHistoryUrl?: string;\n /** GET RAG-search endpoint behind `<DocSearchBar>` (the in-source search\n * bar mounted by `<DocViewer>` / `<DocsHubPage>` when `showAIChat` is on).\n * Hub: '/api/docs/search'. OPTIONAL — falls back to the hub path so\n * same-origin Next.js hosts don't need to set it. Cross-origin embedders\n * set their proxied path so the search bar routes through the same\n * reverse proxy as everything else. Same pattern as `findTicketUrl`. */\n docsSearchUrl?: string;\n /** POST internal-link resolver. The in-source markdown renderer (lib or\n * custom) calls `<DocViewer>`'s `handlers.onResolveLink(href, currentPath)`\n * for relative hrefs like `./getting-started/intro.md` — that callback\n * posts to this URL with `{ link, currentPath, source }` and expects a\n * `ResolveLinkResult` back. Hub: '/api/docs/resolve-link'. OPTIONAL — same\n * fall-back chain as `docsSearchUrl`: prop override → runtime → default. */\n docsResolveLinkUrl?: string;\n /** GET per-platform empty-state config (admin-edited in\n * `/admin/chat-config`): `{ greeting, enabledRagTableIds, suggestedQueries }`.\n * Hub: '/api/docs/empty-state'. OPTIONAL — the in-app (host-mode) chat\n * injects these values as SSR props instead, so it leaves this unset.\n * Cross-origin EMBEDDERS (no server hop) set it to their proxied path\n * (e.g. '/content/api/docs/empty-state') so `<EmbeddableChat>` can fetch\n * the greeting / quick-action chips / RAG-source filter at runtime. When\n * unset, the chat falls back to the explicit `emptyStateGreeting` /\n * `suggestedQueries` / `enabledRagTableIds` props (or in-code defaults). */\n emptyStateUrl?: string;\n /** Build the per-agent display-config URL for an OpenFrame AI agent\n * (Fae/Mingo). OPTIONAL. The returned endpoint MUST be byte-compatible\n * with the empty-state wire shape ({ greeting, suggestedQueries,\n * enabledRagTableIds }). When set AND `EmbeddableChat` receives an\n * `activeAgentSlug` in embed mode, the chat fetches THIS url instead of\n * `emptyStateUrl` to render the selected agent's greeting + suggested\n * prompts (the \"agent mode\" URL override). Hub: `(slug) =>\n * '/api/ai-agents/' + encodeURIComponent(slug)`. */\n aiAgentConfigUrl?: (slug: string) => string;\n /** Build entity-card list URL for a content type + ids. Hub delegates\n * to the rag-table-config registry; embedded app provides its own\n * per-type URL builder against the reverse proxy. Returns null when\n * the type has no list endpoint (caller skips rendering). */\n buildListUrl: (type: string, ids: string[]) => string | null;\n /** Chat-attachment endpoints — added for the v2 attachment feature.\n *\n * Three concerns:\n * - `attachmentUploadUrl` — POSTed by the chat-attachment hook\n * to mint a Supabase signed-upload-URL + HMAC view token.\n * - `attachmentViewUrlPrefix` — embedded in markdown URLs the\n * chat hosts in user message bubbles (`![]()` / `[Attached]`).\n * Stored in chat history; chosen at SEND time. In host mode the\n * relative `/api/storage/view/chat-attachments/` is sufficient\n * (same-origin); embedders supply an absolute hub URL so the\n * browser can fetch cross-origin.\n * - `identityUrl` — GET endpoint the `useChatIdentity` hook\n * hits to learn the `{authTier, source, attachmentsEnabled}`\n * capability bag for the current session. Used beyond chat\n * (tickets / contact form / any embedded surface that needs\n * to identify the proxied customer), so the name has no\n * \"chat\" prefix even though the consuming hook still does. */\n attachmentUploadUrl: string;\n attachmentViewUrlPrefix: string;\n identityUrl: string;\n /** Optional URL prefix for the image proxy (`<prefix>?url=<external>`).\n * When unset, lib's `getProxiedImageUrl` returns the original URL\n * unchanged. Hub default: '/api/image-proxy'. Embedders that don't\n * host an image-proxy route leave this undefined → images load\n * directly cross-origin (CORS-permitting). */\n imageProxyUrlPrefix?: string;\n /** Optional list of hostnames that should bypass the image proxy\n * (rendered direct). Hub uses ['openmsp.ai']; embedders typically\n * leave it unset. Matches the `skipDomains` parameter of\n * `getProxiedImageUrl`. */\n imageProxySkipDomains?: string[];\n /** Optional base URL for the branded og-placeholder image route — the\n * DEFAULT cover-image fallback for entity cards with no image. The lib\n * appends `?title=…` (+ `w`/`h` for square slots) itself, so this is\n * the base, NOT a full URL: relative (`/api/og-placeholder`) for same-\n * origin hosts, or the proxied path (`/content/api/og-placeholder`) for\n * cross-origin embedders. May carry baked-in query params (preserved when\n * the lib layers `title`/dimensions on top) — but per-platform brand\n * colors are NO LONGER baked here; the `/api/og-placeholder` route\n * resolves them server-side from the platform. Most hosts leave this unset\n * and let the lib derive the base from `imageProxyUrlPrefix`.\n *\n * OPTIONAL — when unset the lib derives the base from the sibling\n * `imageProxyUrlPrefix` (same API base, route name swapped), then falls\n * back to the relative `/api/og-placeholder`. So an embedder that already\n * proxies images needs NO og-placeholder wiring. See\n * `resolveOgPlaceholderBase` / `buildOgPlaceholderUrl` in `../utils`. */\n ogPlaceholderUrl?: string;\n /** Base URL prefix for the captions route (`/api/captions` — the native\n * `<track>` VTT endpoint every video surface uses since captions stopped\n * being burned into video pixels). Plain path base, no query params.\n * Embedders point it at their proxied route (e.g. `/content/api/captions`);\n * unset ⇒ the same-origin relative `/api/captions` (the hub). Consumed via\n * `getEntityCaptionUrls` / `rebaseCaptionsUrl` in\n * `components/features/captions-url.ts`. */\n captionsUrlPrefix?: string;\n /** Supabase storage origin (e.g. `https://xyz.supabase.co`) — used\n * by `useVideoWarmup` to scope the `<link rel=\"preload\" as=\"video\">`\n * hint to MP4s the deployment actually hosts. Hub wires it via\n * `getSupabaseStorageOrigin()`; embedders without a Supabase\n * storage origin leave it unset (preload is then skipped; Mux/\n * YouTube preconnect still fires). */\n supabaseStorageOrigin?: string;\n };\n navigation: {\n /** ONE knob, two behaviors:\n * - 'host' = use the host page's existing click-routing untouched.\n * The chat panel calls `navigate?.()` for in-app routing.\n * - 'embed' = guest inside another app: short-circuit at the top\n * of click handlers to force new-tab + absolutize via\n * resolveExternalNavigation. */\n mode: 'host' | 'embed';\n /** Embed-only fallback origin for relative URLs whose target platform\n * can't be inferred. Used by resolveExternalNavigation when\n * `targetPlatform` is null — without this, a relative `/foo` href would\n * window.open against the embedder's origin, which is WRONG.\n * Set to your content host (e.g. 'https://hub.openframe.ai').\n * Required by the embedded app whenever mode='embed'. */\n defaultContentOrigin?: string;\n /** Override for opening external URLs. MUST BE SYNCHRONOUS —\n * Safari/Firefox block popups opened outside a direct user gesture.\n * Default: window.open(href, '_blank', 'noopener,noreferrer'). */\n openExternal?: (href: string) => void;\n /** Optional in-app navigation callback (host-mode only).\n * Returns `true` if the host handled the click in-app\n * (router.push + docNav.navigate); returns `false`, `undefined`,\n * or `void` → lib falls back to window.location.assign(href).\n * Hub wires this via HubRuntimeProvider's HubNavigationWiring;\n * embedders not in Next.js leave it undefined. */\n navigate?: (input: { href: string; path?: string | null; targetPlatform?: string | null }) => boolean | void;\n /** Optional new-tab decision callback. Returns true → lib opens in\n * new tab; false → same tab via `navigate`. Hub wires the existing\n * `decideNewTab` logic from use-nav-link.tsx (re-imports the pure\n * helper from lib). Embedders may omit; lib defaults to:\n * same-origin/same-platform → same tab, else new tab. */\n decideNewTab?: (args: { href: string; targetPlatform?: string | null }) => boolean;\n };\n /** Optional content-URL composer. Returns the platform-aware href +\n * target-platform tuple for a content entity. Hub wires this to its\n * `buildContentURL(type, slug, extractPrimaryPlatform(platforms))`\n * pipeline so the lib catalog/detail views can derive cross-\n * platform hrefs without knowing the hub's platform topology\n * (openmsp.ai / openframe.app / flamingo.run / tmcg).\n *\n * THE single content-href authority for every embeddable surface — page\n * views (onboarding catalog/detail, releases) AND chat cards / chips /\n * search results all resolve content links through this one seam, so a\n * given type lands in the SAME place regardless of where it's rendered.\n * Embedders wire `makeComposeContentUrl({ hostedTypes, contentOrigin })`;\n * omit it and lib views fall back to a same-origin relative path\n * (`buildDefaultHref`).\n *\n * Takes a single `ComposeContentUrlInput`: `type` + `identifier` (page\n * views pass the slug; chat rows pass the id + `externalUrl`, whose path\n * yields the slug for in-app routing) + optional `platforms` /\n * `externalUrl` / `targetPlatform`. */\n composeContentUrl?: ComposeContentUrl;\n /** Per-`documentType` doc-viewer targets — the UNIFIED, DYNAMIC replacement for\n * the single `chipBasePlatform` prop. Maps a doc-table documentType\n * (`'markdown'`, `'data_room_doc'`, …) → `{ platform, basePath }` for the PUBLIC\n * doc viewer that hosts it. Doc chips with no `externalUrl` resolve PER ROW to\n * `getBaseUrl(platform)/<basePath>/<path>`, so a chat mixing several doc sources\n * sends EACH to its own home (markdown→flamingo/knowledge-base,\n * data_room_doc→company-hub/data-room) instead of one static fallback. The hub\n * may keep using `chipBasePlatform` (one doc source per platform); embedders that\n * surface multiple doc sources wire this. Threaded into `resolveSourceRowCTA`. */\n docPlatformTargets?: Record<string, { platform: string; basePath: string }>;\n /** Chat source / platform identifier — OPTIONAL. The hub sets it from\n * `currentPlatform()`; EMBEDDERS leave it unset and stay platform-agnostic.\n *\n * It is NOT required for chat to work. The wire resolves source server-side\n * (`/docs/chat|search|commands` reject any client `source`); the\n * same-tab-vs-new-tab link decision falls back to an origin comparison when\n * it's absent (`decideNewTab` → `isCrossOriginUrl`); and the localStorage\n * history namespace falls back to a stable constant. Set it only where the\n * client legitimately needs to know its platform a priori — i.e. the hub,\n * where several platforms share related origins so \"same platform\" can't be\n * inferred from a URL alone. */\n source?: string;\n // NOTE: No `user` field. The chat's display identity (greeting\n // first-name, etc.) comes from the SERVER-resolved auth via\n // `useChatIdentity()` — the same identity the server uses to\n // authorize requests. Letting embedders pass a client-side `user`\n // would let it desync from the actual auth tier, causing greetings\n // like \"Hey Bob\" while the server treats the session as\n // alice@example.com. Single source of truth: the server.\n}\n\nexport const ChatRuntimeContext = createContext<ChatRuntime | null>(null);\n\n/**\n * Returns the active runtime, or null when no provider is mounted.\n * NULL is a first-class value — it signals \"no chat runtime configured.\"\n * Optional consumers fall back to no-op behavior; strict consumers\n * use `useRequiredChatRuntime` (below).\n */\nexport function useChatRuntime(): ChatRuntime | null {\n return useContext(ChatRuntimeContext);\n}\n\n/**\n * Strict variant used INSIDE the chat panel. Throws if no provider.\n * The hub guarantees one exists by mounting `<HubRuntimeProvider>` at\n * root; the embedded app mounts its own `<ChatRuntimeContext.Provider>`\n * at the tree root. In Jest / Storybook tests that render chat\n * internals directly, wrap with `<HubRuntimeProvider>` (hub defaults)\n * or supply `<ChatRuntimeContext.Provider value={mockedRuntime}>`.\n */\nexport function useRequiredChatRuntime(): ChatRuntime {\n const v = useContext(ChatRuntimeContext);\n if (!v) {\n throw new Error(\n '[chat-runtime] hook called outside a <ChatRuntimeContext.Provider>. ' +\n 'The hub mounts <HubRuntimeProvider> at root — this only fires when ' +\n 'chat internals are rendered above the provider tree. ' +\n 'Fix: ensure the rendering subtree descends from the runtime provider. ' +\n 'In tests/Storybook: wrap with <HubRuntimeProvider> or supply ' +\n 'a <ChatRuntimeContext.Provider value={mockedRuntime}>.',\n );\n }\n return v;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/contexts/chat-runtime-context.tsx"],"sourcesContent":["'use client';\n\n/**\n * Chat runtime context — single seam for embedding the chat panel in a\n * different host (e.g. user1.openframe.ai reverse-proxying API calls\n * under /api/mingo-guide/* to hub.openframe.ai/api/*).\n *\n * Three concerns, one context:\n * 1. API endpoints: chatStreamUrl / approvalToolUrl / commandsUrl /\n * buildListUrl + attachment endpoints + chat-identity. The chat\n * reads them from runtime; hub vs embedded app supply different\n * strings via different providers.\n * 2. Navigation mode + callbacks: 'host' or 'embed' mode. Host wires\n * its own router/docNav via the optional `navigate` callback\n * (plain function, NOT a hook); embed forces new-tab via\n * `defaultContentOrigin` + lib's `resolveExternalNavigation`.\n * 3. Identity context: only `source` (required for localStorage\n * namespacing). The display identity (greeting first-name etc.)\n * comes from the server via `useChatIdentity()` — never injected\n * client-side, so it always matches the server-resolved auth.\n *\n * Sibling of EndpointsRuntimeContext (announcement bar, contact form,\n * access codes). Each runtime stays an independent React context so\n * embedders can opt into either feature without forcing the other.\n *\n * IMPORTANT for embedders: memoize the value passed to\n * `<ChatRuntimeContext.Provider value={...}>` (e.g. via React.useMemo).\n * Every change to its reference identity invalidates downstream\n * `useMemo` consumers (the chat input's slash-commands binding,\n * useNavLink's embed-resolution memo, useDocChat's streamFn factory).\n * The hub's `<HubRuntimeProvider>` already memoizes correctly with\n * stable deps. Embedded apps that build the value inline on each render\n * will pay an avoidable re-render cost across the entire chat tree.\n */\n\nimport { createContext, useContext } from 'react';\n\nimport type { ComposeContentUrl } from '../utils/content-href';\n\n/**\n * Runtime config consumed by the chat panel.\n */\nexport interface ChatRuntime {\n endpoints: {\n /** POST streaming chat. Hub: '/api/docs/chat'. */\n chatStreamUrl: string;\n /** POST agent approve/reject. Hub: '/api/chat/agent/confirm-tool'. */\n approvalToolUrl: string;\n /** Customer-ticket agent endpoints (Help Center). OPTIONAL — when unset,\n * the ticket hooks fall back to the bare hub paths\n * (`/api/chat/agent/{find-ticket,ticket-action,list-engagements}`).\n * Embedders behind a reverse proxy set these to their proxied paths\n * (e.g. `/content/api/chat/agent/...`) so tickets route through the SAME\n * endpoint config + proxy as every other endpoint. */\n findTicketUrl?: string;\n ticketActionUrl?: string;\n listEngagementsUrl?: string;\n /** Ticket live-stream + read-receipt endpoints (Help Center\n * realtime). OPTIONAL — unset → bare hub paths under the DEDICATED\n * ticket surface (`/api/tickets/{stream,read}` — deliberately NOT\n * the chat agent's `/api/chat/agent/*` prefix). Reverse-proxy\n * embedders set their proxied paths. Consumed by\n * `TicketLiveProvider`. The unread summary has NO endpoint — it\n * arrives as `ticket-summary` frames on the stream and in\n * `ticket-read` responses. */\n ticketStreamUrl?: string;\n ticketReadUrl?: string;\n /** GET slash-command catalog. Hub: '/api/docs/commands'. */\n commandsUrl: string;\n /** GET server-side conversation history (`?conversationId=<id>`) — the\n * chat panel's mount-time hydration read against the server transcript\n * store (localStorage keeps only the server-issued conversation id).\n * OPTIONAL — defaults to `<chatStreamUrl>/history`, which is correct for\n * same-origin hosts AND for reverse-proxy embedders (the proxied chat\n * prefix covers it). Set explicitly only when the history route lives\n * elsewhere. */\n chatHistoryUrl?: string;\n /** GET RAG-search endpoint behind `<DocSearchBar>` (the in-source search\n * bar mounted by `<DocViewer>` / `<DocsHubPage>` when `showAIChat` is on).\n * Hub: '/api/docs/search'. OPTIONAL — falls back to the hub path so\n * same-origin Next.js hosts don't need to set it. Cross-origin embedders\n * set their proxied path so the search bar routes through the same\n * reverse proxy as everything else. Same pattern as `findTicketUrl`. */\n docsSearchUrl?: string;\n /** POST internal-link resolver. The in-source markdown renderer (lib or\n * custom) calls `<DocViewer>`'s `handlers.onResolveLink(href, currentPath)`\n * for relative hrefs like `./getting-started/intro.md` — that callback\n * posts to this URL with `{ link, currentPath, source }` and expects a\n * `ResolveLinkResult` back. Hub: '/api/docs/resolve-link'. OPTIONAL — same\n * fall-back chain as `docsSearchUrl`: prop override → runtime → default. */\n docsResolveLinkUrl?: string;\n /** GET per-platform empty-state config (admin-edited in\n * `/admin/chat-config`): `{ greeting, enabledRagTableIds, suggestedQueries }`.\n * Hub: '/api/docs/empty-state'. OPTIONAL — the in-app (host-mode) chat\n * injects these values as SSR props instead, so it leaves this unset.\n * Cross-origin EMBEDDERS (no server hop) set it to their proxied path\n * (e.g. '/content/api/docs/empty-state') so `<EmbeddableChat>` can fetch\n * the greeting / quick-action chips / RAG-source filter at runtime. When\n * unset, the chat falls back to the explicit `emptyStateGreeting` /\n * `suggestedQueries` / `enabledRagTableIds` props (or in-code defaults). */\n emptyStateUrl?: string;\n /** Build the per-agent display-config URL for an OpenFrame AI agent\n * (Fae/Mingo). OPTIONAL. The returned endpoint MUST be byte-compatible\n * with the empty-state wire shape ({ greeting, suggestedQueries,\n * enabledRagTableIds }). When set AND `EmbeddableChat` receives an\n * `activeAgentSlug` in embed mode, the chat fetches THIS url instead of\n * `emptyStateUrl` to render the selected agent's greeting + suggested\n * prompts (the \"agent mode\" URL override). Hub: `(slug) =>\n * '/api/ai-agents/' + encodeURIComponent(slug)`. */\n aiAgentConfigUrl?: (slug: string) => string;\n /** Build entity-card list URL for a content type + ids. Hub delegates\n * to the rag-table-config registry; embedded app provides its own\n * per-type URL builder against the reverse proxy. Returns null when\n * the type has no list endpoint (caller skips rendering). */\n buildListUrl: (type: string, ids: string[]) => string | null;\n /** Chat-attachment endpoints — added for the v2 attachment feature.\n *\n * Three concerns:\n * - `attachmentUploadUrl` — POSTed by the chat-attachment hook\n * to mint a Supabase signed-upload-URL + HMAC view token.\n * - `attachmentViewUrlPrefix` — embedded in markdown URLs the\n * chat hosts in user message bubbles (`![]()` / `[Attached]`).\n * Stored in chat history; chosen at SEND time. In host mode the\n * relative `/api/storage/view/chat-attachments/` is sufficient\n * (same-origin); embedders supply an absolute hub URL so the\n * browser can fetch cross-origin.\n * - `identityUrl` — GET endpoint the `useChatIdentity` hook\n * hits to learn the `{authTier, source, attachmentsEnabled}`\n * capability bag for the current session. Used beyond chat\n * (tickets / contact form / any embedded surface that needs\n * to identify the proxied customer), so the name has no\n * \"chat\" prefix even though the consuming hook still does. */\n attachmentUploadUrl: string;\n attachmentViewUrlPrefix: string;\n identityUrl: string;\n /** Optional URL prefix for the image proxy (`<prefix>?url=<external>`).\n * When unset, lib's `getProxiedImageUrl` returns the original URL\n * unchanged. Hub default: '/api/image-proxy'. Embedders that don't\n * host an image-proxy route leave this undefined → images load\n * directly cross-origin (CORS-permitting). */\n imageProxyUrlPrefix?: string;\n /** Optional list of hostnames that should bypass the image proxy\n * (rendered direct). Hub uses ['openmsp.ai']; embedders typically\n * leave it unset. Matches the `skipDomains` parameter of\n * `getProxiedImageUrl`. */\n imageProxySkipDomains?: string[];\n /** Optional base URL for the branded og-placeholder image route — the\n * DEFAULT cover-image fallback for entity cards with no image. The lib\n * appends `?title=…` (+ `w`/`h` for square slots) itself, so this is\n * the base, NOT a full URL: relative (`/api/og-placeholder`) for same-\n * origin hosts, or the proxied path (`/content/api/og-placeholder`) for\n * cross-origin embedders. May carry baked-in query params (preserved when\n * the lib layers `title`/dimensions on top) — but per-platform brand\n * colors are NO LONGER baked here; the `/api/og-placeholder` route\n * resolves them server-side from the platform. Most hosts leave this unset\n * and let the lib derive the base from `imageProxyUrlPrefix`.\n *\n * OPTIONAL — when unset the lib derives the base from the sibling\n * `imageProxyUrlPrefix` (same API base, route name swapped), then falls\n * back to the relative `/api/og-placeholder`. So an embedder that already\n * proxies images needs NO og-placeholder wiring. See\n * `resolveOgPlaceholderBase` / `buildOgPlaceholderUrl` in `../utils`. */\n ogPlaceholderUrl?: string;\n /** Base URL prefix for the captions route (`/api/captions` — the native\n * `<track>` VTT endpoint every video surface uses since captions stopped\n * being burned into video pixels). Plain path base, no query params.\n * Embedders point it at their proxied route (e.g. `/content/api/captions`);\n * unset ⇒ the same-origin relative `/api/captions` (the hub). Consumed via\n * `getEntityCaptionUrls` / `rebaseCaptionsUrl` in\n * `components/features/captions-url.ts`. */\n captionsUrlPrefix?: string;\n /** Supabase storage origin (e.g. `https://xyz.supabase.co`) — used\n * by `useVideoWarmup` to scope the `<link rel=\"preload\" as=\"video\">`\n * hint to MP4s the deployment actually hosts. Hub wires it via\n * `getSupabaseStorageOrigin()`; embedders without a Supabase\n * storage origin leave it unset (preload is then skipped; Mux/\n * YouTube preconnect still fires). */\n supabaseStorageOrigin?: string;\n };\n navigation: {\n /** ONE knob, two behaviors:\n * - 'host' = use the host page's existing click-routing untouched.\n * The chat panel calls `navigate?.()` for in-app routing.\n * - 'embed' = guest inside another app: short-circuit at the top\n * of click handlers to force new-tab + absolutize via\n * resolveExternalNavigation. */\n mode: 'host' | 'embed';\n /** Embed-only fallback origin for relative URLs whose target platform\n * can't be inferred. Used by resolveExternalNavigation when\n * `targetPlatform` is null — without this, a relative `/foo` href would\n * window.open against the embedder's origin, which is WRONG.\n * Set to your content host (e.g. 'https://hub.openframe.ai').\n * Required by the embedded app whenever mode='embed'. */\n defaultContentOrigin?: string;\n /** Override for opening external URLs. MUST BE SYNCHRONOUS —\n * Safari/Firefox block popups opened outside a direct user gesture.\n * Default: window.open(href, '_blank', 'noopener,noreferrer'). */\n openExternal?: (href: string) => void;\n /** Optional in-app navigation callback (host-mode only).\n * Returns `true` if the host handled the click in-app\n * (router.push + docNav.navigate); returns `false`, `undefined`,\n * or `void` → lib falls back to window.location.assign(href).\n * Hub wires this via HubRuntimeProvider's HubNavigationWiring;\n * embedders not in Next.js leave it undefined. */\n navigate?: (input: { href: string; path?: string | null; targetPlatform?: string | null }) => boolean | void;\n /** Optional new-tab decision callback. Returns true → lib opens in\n * new tab; false → same tab via `navigate`. Hub wires the existing\n * `decideNewTab` logic from use-nav-link.tsx (re-imports the pure\n * helper from lib). Embedders may omit; lib defaults to:\n * same-origin/same-platform → same tab, else new tab. */\n decideNewTab?: (args: { href: string; targetPlatform?: string | null }) => boolean;\n };\n /** Optional content-URL composer. Returns the platform-aware href +\n * target-platform tuple for a content entity. Hub wires this to its\n * `buildContentURL(type, slug, extractPrimaryPlatform(platforms))`\n * pipeline so the lib catalog/detail views can derive cross-\n * platform hrefs without knowing the hub's platform topology\n * (openmsp.ai / openframe.app / flamingo.run / tmcg).\n *\n * THE single content-href authority for every embeddable surface — page\n * views (onboarding catalog/detail, releases) AND chat cards / chips /\n * search results all resolve content links through this one seam, so a\n * given type lands in the SAME place regardless of where it's rendered.\n * Embedders wire `makeComposeContentUrl({ hostedTypes, contentOrigin })`;\n * omit it and lib views fall back to a same-origin relative path\n * (`buildDefaultHref`).\n *\n * Takes a single `ComposeContentUrlInput`: `type` + `identifier` (page\n * views pass the slug; chat rows pass the id + `externalUrl`, whose path\n * yields the slug for in-app routing) + optional `platforms` /\n * `externalUrl` / `targetPlatform`. */\n composeContentUrl?: ComposeContentUrl;\n /** Per-`documentType` doc-viewer targets — the UNIFIED, DYNAMIC replacement for\n * the single `chipBasePlatform` prop. Maps a doc-table documentType\n * (`'markdown'`, `'data_room_doc'`, …) → `{ platform, basePath }` for the PUBLIC\n * doc viewer that hosts it. Doc chips with no `externalUrl` resolve PER ROW to\n * `getBaseUrl(platform)/<basePath>/<path>`, so a chat mixing several doc sources\n * sends EACH to its own home (markdown→flamingo/knowledge-base,\n * data_room_doc→company-hub/data-room) instead of one static fallback. The hub\n * may keep using `chipBasePlatform` (one doc source per platform); embedders that\n * surface multiple doc sources wire this. Threaded into `resolveSourceRowCTA`. */\n docPlatformTargets?: Record<string, { platform: string; basePath: string }>;\n /** Chat source / platform identifier — OPTIONAL. The hub sets it from\n * `currentPlatform()`; EMBEDDERS leave it unset and stay platform-agnostic.\n *\n * It is NOT required for chat to work. The wire resolves source server-side\n * (`/docs/chat|search|commands` reject any client `source`); the\n * same-tab-vs-new-tab link decision falls back to an origin comparison when\n * it's absent (`decideNewTab` → `isCrossOriginUrl`); and the localStorage\n * history namespace falls back to a stable constant. Set it only where the\n * client legitimately needs to know its platform a priori — i.e. the hub,\n * where several platforms share related origins so \"same platform\" can't be\n * inferred from a URL alone. */\n source?: string;\n // NOTE: No `user` field. The chat's display identity (greeting\n // first-name, etc.) comes from the SERVER-resolved auth via\n // `useChatIdentity()` — the same identity the server uses to\n // authorize requests. Letting embedders pass a client-side `user`\n // would let it desync from the actual auth tier, causing greetings\n // like \"Hey Bob\" while the server treats the session as\n // alice@example.com. Single source of truth: the server.\n}\n\nexport const ChatRuntimeContext = createContext<ChatRuntime | null>(null);\n\n/**\n * Returns the active runtime, or null when no provider is mounted.\n * NULL is a first-class value — it signals \"no chat runtime configured.\"\n * Optional consumers fall back to no-op behavior; strict consumers\n * use `useRequiredChatRuntime` (below).\n */\nexport function useChatRuntime(): ChatRuntime | null {\n return useContext(ChatRuntimeContext);\n}\n\n/**\n * Strict variant used INSIDE the chat panel. Throws if no provider.\n * The hub guarantees one exists by mounting `<HubRuntimeProvider>` at\n * root; the embedded app mounts its own `<ChatRuntimeContext.Provider>`\n * at the tree root. In Jest / Storybook tests that render chat\n * internals directly, wrap with `<HubRuntimeProvider>` (hub defaults)\n * or supply `<ChatRuntimeContext.Provider value={mockedRuntime}>`.\n */\nexport function useRequiredChatRuntime(): ChatRuntime {\n const v = useContext(ChatRuntimeContext);\n if (!v) {\n throw new Error(\n '[chat-runtime] hook called outside a <ChatRuntimeContext.Provider>. ' +\n 'The hub mounts <HubRuntimeProvider> at root — this only fires when ' +\n 'chat internals are rendered above the provider tree. ' +\n 'Fix: ensure the rendering subtree descends from the runtime provider. ' +\n 'In tests/Storybook: wrap with <HubRuntimeProvider> or supply ' +\n 'a <ChatRuntimeContext.Provider value={mockedRuntime}>.',\n );\n }\n return v;\n}\n"],"mappings":";;;AAmCA,SAAS,eAAe,kBAAkB;AAoOnC,IAAM,qBAAqB,cAAkC,IAAI;AAQjE,SAAS,iBAAqC;AACnD,SAAO,WAAW,kBAAkB;AACtC;AAUO,SAAS,yBAAsC;AACpD,QAAM,IAAI,WAAW,kBAAkB;AACvC,MAAI,CAAC,GAAG;AACN,UAAM,IAAI;AAAA,MACR;AAAA,IAMF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkSTYNZ4QMcjs = require('./chunk-STYNZ4QM.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ var _chunk3IXDZI3Rcjs = require('./chunk-3IXDZI3R.cjs');
|
|
|
11
11
|
var _chunkN6CULJYRcjs = require('./chunk-N6CULJYR.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkH64ZHSYRcjs = require('./chunk-H64ZHSYR.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -39,7 +39,7 @@ var _chunkCCWI3622cjs = require('./chunk-CCWI3622.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunkWCBRZCU4cjs = require('./chunk-WCBRZCU4.cjs');
|
|
43
43
|
|
|
44
44
|
// src/components/related-content/related-content-section.tsx
|
|
45
45
|
var _react = require('react');
|
|
@@ -411,13 +411,13 @@ function cardEntry(definition) {
|
|
|
411
411
|
}
|
|
412
412
|
function programEntry(configKey) {
|
|
413
413
|
return cardEntry({
|
|
414
|
-
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
414
|
+
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWCBRZCU4cjs.ProgramCardSkeleton, { size: size === "sm" ? "sm" : "default" }),
|
|
415
415
|
decode: decodeProgramRow,
|
|
416
416
|
render: (item, ctx) => {
|
|
417
417
|
const config = _optionalChain([ctx, 'access', _2 => _2.extras, 'optionalAccess', _3 => _3.programConfigs, 'optionalAccess', _4 => _4[configKey]]);
|
|
418
418
|
if (!config) return null;
|
|
419
419
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
420
|
-
|
|
420
|
+
_chunkWCBRZCU4cjs.ProgramCard,
|
|
421
421
|
{
|
|
422
422
|
config,
|
|
423
423
|
item,
|
|
@@ -433,10 +433,10 @@ function programEntry(configKey) {
|
|
|
433
433
|
}
|
|
434
434
|
function roadmapEntry(cardType) {
|
|
435
435
|
return cardEntry({
|
|
436
|
-
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
436
|
+
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWCBRZCU4cjs.RoadmapCardSkeleton, { size: size === "sm" ? "sm" : "default" }),
|
|
437
437
|
decode: decodeRoadmapRow,
|
|
438
438
|
render: (item, ctx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
439
|
-
|
|
439
|
+
_chunkWCBRZCU4cjs.RoadmapCard,
|
|
440
440
|
{
|
|
441
441
|
item,
|
|
442
442
|
href: ctx.href,
|
|
@@ -453,10 +453,10 @@ function roadmapEntry(cardType) {
|
|
|
453
453
|
}
|
|
454
454
|
var RELATED_CARD_REGISTRY = {
|
|
455
455
|
blog_post_existing: cardEntry({
|
|
456
|
-
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
456
|
+
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWCBRZCU4cjs.BlogCardSkeleton, { size: size === "sm" ? "sm" : "default" }),
|
|
457
457
|
decode: decodeBlogRow,
|
|
458
458
|
render: (post, ctx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
459
|
-
|
|
459
|
+
_chunkWCBRZCU4cjs.BlogCard,
|
|
460
460
|
{
|
|
461
461
|
post,
|
|
462
462
|
size: ctx.legacySize,
|
|
@@ -468,10 +468,10 @@ var RELATED_CARD_REGISTRY = {
|
|
|
468
468
|
)
|
|
469
469
|
}),
|
|
470
470
|
case_study: cardEntry({
|
|
471
|
-
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
471
|
+
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWCBRZCU4cjs.CaseStudyCardSkeleton, { size: size === "sm" ? "sm" : "default" }),
|
|
472
472
|
decode: decodeCaseStudyRow,
|
|
473
473
|
render: (study, ctx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
474
|
-
|
|
474
|
+
_chunkWCBRZCU4cjs.CaseStudyCard,
|
|
475
475
|
{
|
|
476
476
|
study,
|
|
477
477
|
size: ctx.legacySize,
|
|
@@ -483,10 +483,10 @@ var RELATED_CARD_REGISTRY = {
|
|
|
483
483
|
)
|
|
484
484
|
}),
|
|
485
485
|
customer_interview: cardEntry({
|
|
486
|
-
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
486
|
+
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWCBRZCU4cjs.CustomerInterviewCardSkeleton, { size: size === "sm" ? "sm" : "default" }),
|
|
487
487
|
decode: decodeCustomerInterviewRow,
|
|
488
488
|
render: (interview, ctx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
489
|
-
|
|
489
|
+
_chunkWCBRZCU4cjs.CustomerInterviewCard,
|
|
490
490
|
{
|
|
491
491
|
interview,
|
|
492
492
|
size: ctx.legacySize,
|
|
@@ -504,13 +504,13 @@ var RELATED_CARD_REGISTRY = {
|
|
|
504
504
|
* record, and the three props the rail sets itself are read off it.
|
|
505
505
|
*/
|
|
506
506
|
product_release: cardEntry({
|
|
507
|
-
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
507
|
+
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWCBRZCU4cjs.ProductReleaseCardSkeleton, { size: size === "sm" ? "sm" : "lg" }),
|
|
508
508
|
decode: asRecord,
|
|
509
509
|
render: (release, ctx) => {
|
|
510
|
-
const buildReleaseProps = _nullishCoalesce(_optionalChain([ctx, 'access', _5 => _5.extras, 'optionalAccess', _6 => _6.buildProductReleaseCardProps]), () => (
|
|
510
|
+
const buildReleaseProps = _nullishCoalesce(_optionalChain([ctx, 'access', _5 => _5.extras, 'optionalAccess', _6 => _6.buildProductReleaseCardProps]), () => ( _chunkWCBRZCU4cjs.buildProductReleaseCardProps));
|
|
511
511
|
const releaseProps = buildReleaseProps(release);
|
|
512
512
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
-
|
|
513
|
+
_chunkWCBRZCU4cjs.ProductReleaseCard,
|
|
514
514
|
{
|
|
515
515
|
size: ctx.size === "sm" ? "sm" : "lg",
|
|
516
516
|
title: str(release, "title"),
|
|
@@ -526,10 +526,10 @@ var RELATED_CARD_REGISTRY = {
|
|
|
526
526
|
webinar: programEntry("webinar"),
|
|
527
527
|
event: programEntry("event"),
|
|
528
528
|
investor_update: cardEntry({
|
|
529
|
-
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
529
|
+
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWCBRZCU4cjs.InvestorUpdateCardSkeleton, { size: size === "sm" ? "sm" : "default" }),
|
|
530
530
|
decode: decodeInvestorUpdateRow,
|
|
531
531
|
render: (update, ctx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
532
|
-
|
|
532
|
+
_chunkWCBRZCU4cjs.InvestorUpdateCard,
|
|
533
533
|
{
|
|
534
534
|
update,
|
|
535
535
|
size: ctx.legacySize,
|
|
@@ -544,10 +544,10 @@ var RELATED_CARD_REGISTRY = {
|
|
|
544
544
|
* step-numbered 'default' variant is for the guide detail page's "More in
|
|
545
545
|
* section" rail, not this full-width row. */
|
|
546
546
|
onboarding_guide: cardEntry({
|
|
547
|
-
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
547
|
+
skeleton: (size) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWCBRZCU4cjs.OnboardingGuideCardSkeleton, { size: size === "sm" ? "sm" : "catalog" }),
|
|
548
548
|
decode: decodeOnboardingGuideRow,
|
|
549
549
|
render: (guide, ctx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
550
|
-
|
|
550
|
+
_chunkWCBRZCU4cjs.OnboardingGuideCard,
|
|
551
551
|
{
|
|
552
552
|
guide,
|
|
553
553
|
size: ctx.size === "sm" ? "sm" : "catalog",
|
|
@@ -564,10 +564,10 @@ var RELATED_CARD_REGISTRY = {
|
|
|
564
564
|
* href: an object with `href: undefined` is still truthy and would wrap the
|
|
565
565
|
* card in a dead <a>. */
|
|
566
566
|
what_i_shipped: cardEntry({
|
|
567
|
-
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
567
|
+
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWCBRZCU4cjs.WhatIShippedCardSkeleton, {}),
|
|
568
568
|
decode: decodeEmployeeEntryRow,
|
|
569
569
|
render: (entry, ctx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
570
|
-
|
|
570
|
+
_chunkWCBRZCU4cjs.WhatIShippedCard,
|
|
571
571
|
{
|
|
572
572
|
entry,
|
|
573
573
|
placeholderUrl: ctx.placeholderUrl,
|
|
@@ -577,10 +577,10 @@ var RELATED_CARD_REGISTRY = {
|
|
|
577
577
|
}),
|
|
578
578
|
/** Same shared employee-entry shape + anchor contract as What I Shipped. */
|
|
579
579
|
how_i_work: cardEntry({
|
|
580
|
-
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
580
|
+
skeleton: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWCBRZCU4cjs.HowIWorkCardSkeleton, {}),
|
|
581
581
|
decode: decodeEmployeeEntryRow,
|
|
582
582
|
render: (entry, ctx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
583
|
-
|
|
583
|
+
_chunkWCBRZCU4cjs.HowIWorkCard,
|
|
584
584
|
{
|
|
585
585
|
entry,
|
|
586
586
|
placeholderUrl: ctx.placeholderUrl,
|
|
@@ -601,7 +601,7 @@ function DefaultLinkPropsProvider({
|
|
|
601
601
|
children
|
|
602
602
|
}) {
|
|
603
603
|
if (!href) return children(null);
|
|
604
|
-
const newTab =
|
|
604
|
+
const newTab = _chunkWCBRZCU4cjs.decideNewTab.call(void 0, { href, targetPlatform, currentSource: "" });
|
|
605
605
|
return children(newTab ? { href, target: "_blank", rel: "noopener noreferrer" } : { href });
|
|
606
606
|
}
|
|
607
607
|
function defaultResolveHref(ref) {
|
|
@@ -657,8 +657,8 @@ function CardForType({
|
|
|
657
657
|
function useGroupItems(type, refs, buildUrl) {
|
|
658
658
|
const ids = refs.map((r) => r.id);
|
|
659
659
|
const url = ids.length > 0 ? buildUrl(type, ids) : null;
|
|
660
|
-
const { data, isLoading } =
|
|
661
|
-
const items = data != null ?
|
|
660
|
+
const { data, isLoading } = _chunkSTYNZ4QMcjs.useSelfFetch.call(void 0, url);
|
|
661
|
+
const items = data != null ? _chunkWCBRZCU4cjs.extractItems.call(void 0, data) : null;
|
|
662
662
|
return { items, isLoading };
|
|
663
663
|
}
|
|
664
664
|
function gridClassFor(columns) {
|
|
@@ -697,7 +697,7 @@ function ContentGroup({
|
|
|
697
697
|
setPage(1);
|
|
698
698
|
}
|
|
699
699
|
}, [refsKey]);
|
|
700
|
-
const totalGroupPages =
|
|
700
|
+
const totalGroupPages = _chunkH64ZHSYRcjs.pageCount.call(void 0, refs.length, GROUP_PAGE_SIZE);
|
|
701
701
|
const safePage = Math.min(page, totalGroupPages);
|
|
702
702
|
const visibleGroupRefs = refs.length > GROUP_PAGE_SIZE ? refs.slice((safePage - 1) * GROUP_PAGE_SIZE, safePage * GROUP_PAGE_SIZE) : refs;
|
|
703
703
|
const groupPagination = totalGroupPages > 1 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN6CULJYRcjs.Pagination, { currentPage: safePage, totalPages: totalGroupPages, onPageChange: setPage }) : null;
|
|
@@ -710,7 +710,7 @@ function ContentGroup({
|
|
|
710
710
|
}
|
|
711
711
|
if (!items || items.length === 0) return null;
|
|
712
712
|
const rowKey = (it) => {
|
|
713
|
-
const extracted =
|
|
713
|
+
const extracted = _chunkWCBRZCU4cjs.extractItemId.call(void 0, type, it);
|
|
714
714
|
if (extracted !== null) return extracted;
|
|
715
715
|
return String(typeof it === "object" && it !== null ? it.id : void 0);
|
|
716
716
|
};
|
|
@@ -799,9 +799,9 @@ function RelatedContentSection({
|
|
|
799
799
|
() => !suggestionsDisabled && initialItems ? { refs: initialItems } : void 0,
|
|
800
800
|
[initialItems, suggestionsDisabled]
|
|
801
801
|
);
|
|
802
|
-
const { data, isLoading } =
|
|
802
|
+
const { data, isLoading } = _chunkSTYNZ4QMcjs.useSelfFetch.call(void 0, suggestUrl, { initialData });
|
|
803
803
|
const effectiveBuildListUrl = _react.useMemo.call(void 0,
|
|
804
|
-
() => _nullishCoalesce(buildListUrl2, () => ( ((type, ids) =>
|
|
804
|
+
() => _nullishCoalesce(buildListUrl2, () => ( ((type, ids) => _chunkWCBRZCU4cjs.buildListUrl.call(void 0, type, ids, apiBaseUrl)))),
|
|
805
805
|
[buildListUrl2, apiBaseUrl]
|
|
806
806
|
);
|
|
807
807
|
const refs = _nullishCoalesce(_nullishCoalesce(contentRefs, () => ( _optionalChain([data, 'optionalAccess', _10 => _10.refs]))), () => ( []));
|
|
@@ -828,10 +828,10 @@ function RelatedContentSection({
|
|
|
828
828
|
}
|
|
829
829
|
let orderedTypes = _chunkN6CULJYRcjs.orderContentRefTypes.call(void 0, Object.keys(grouped));
|
|
830
830
|
if (entityType) {
|
|
831
|
-
const canonicalEntityType =
|
|
832
|
-
const sameType = orderedTypes.filter((t) =>
|
|
831
|
+
const canonicalEntityType = _chunkWCBRZCU4cjs.canonicalContentRefType.call(void 0, entityType);
|
|
832
|
+
const sameType = orderedTypes.filter((t) => _chunkWCBRZCU4cjs.canonicalContentRefType.call(void 0, t) === canonicalEntityType);
|
|
833
833
|
if (sameType.length > 0) {
|
|
834
|
-
orderedTypes = [...sameType, ...orderedTypes.filter((t) =>
|
|
834
|
+
orderedTypes = [...sameType, ...orderedTypes.filter((t) => _chunkWCBRZCU4cjs.canonicalContentRefType.call(void 0, t) !== canonicalEntityType)];
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
837
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-8", children: [
|
|
@@ -858,4 +858,4 @@ function RelatedContentSection({
|
|
|
858
858
|
|
|
859
859
|
|
|
860
860
|
exports.GROUP_PAGE_SIZE = GROUP_PAGE_SIZE; exports.RelatedContentSection = RelatedContentSection;
|
|
861
|
-
//# sourceMappingURL=chunk-
|
|
861
|
+
//# sourceMappingURL=chunk-SAEJGTCI.cjs.map
|