@flamingo-stack/openframe-frontend-core 0.0.644 → 0.0.645-2219.6362.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/README.md +2 -2
- package/dist/{chunk-IXD6SHQ6.js → chunk-2SNL36JV.js} +6 -6
- package/dist/{chunk-FOSIR4QF.js → chunk-3DWDJ54N.js} +5 -5
- package/dist/{chunk-YB6FI2G3.js → chunk-3SMLYVM2.js} +1 -1
- package/dist/{chunk-YB6FI2G3.js.map → chunk-3SMLYVM2.js.map} +1 -1
- package/dist/{chunk-UKV52KAP.cjs → chunk-3WLHNR2G.cjs} +44 -44
- package/dist/{chunk-UKV52KAP.cjs.map → chunk-3WLHNR2G.cjs.map} +1 -1
- package/dist/{chunk-FAD5WURS.cjs → chunk-4GZZYHG5.cjs} +124 -124
- package/dist/{chunk-FAD5WURS.cjs.map → chunk-4GZZYHG5.cjs.map} +1 -1
- package/dist/{chunk-4EEUB62O.js → chunk-4HVWGYHI.js} +2 -2
- package/dist/{chunk-RFFF2EYD.cjs → chunk-5F5WKIDW.cjs} +15 -15
- package/dist/{chunk-RFFF2EYD.cjs.map → chunk-5F5WKIDW.cjs.map} +1 -1
- package/dist/{chunk-G5U4JP45.js → chunk-5ONM3FHQ.js} +4 -4
- package/dist/{chunk-GELNUDBT.cjs → chunk-77BLJHKI.cjs} +10 -10
- package/dist/{chunk-GELNUDBT.cjs.map → chunk-77BLJHKI.cjs.map} +1 -1
- package/dist/{chunk-KJWPAJRT.js → chunk-7EI3NES7.js} +3 -3
- package/dist/{chunk-C5Y5T6GC.cjs → chunk-AHC2CQDD.cjs} +20 -20
- package/dist/{chunk-C5Y5T6GC.cjs.map → chunk-AHC2CQDD.cjs.map} +1 -1
- package/dist/{chunk-MCQAOIUK.cjs → chunk-BH34E2RJ.cjs} +37 -37
- package/dist/{chunk-MCQAOIUK.cjs.map → chunk-BH34E2RJ.cjs.map} +1 -1
- package/dist/{chunk-TGUA3C4U.cjs → chunk-BWGV4TI5.cjs} +9 -9
- package/dist/{chunk-TGUA3C4U.cjs.map → chunk-BWGV4TI5.cjs.map} +1 -1
- package/dist/{chunk-I57XLISO.js → chunk-CLVJC6SI.js} +195 -15
- package/dist/chunk-CLVJC6SI.js.map +1 -0
- package/dist/{chunk-27RD5XTP.js → chunk-CYXV5HPV.js} +5 -5
- package/dist/{chunk-4WVWRFGP.js → chunk-DEIYPXGD.js} +9 -9
- package/dist/{chunk-3IXDZI3R.cjs → chunk-DOVVKQMZ.cjs} +3 -3
- package/dist/{chunk-3IXDZI3R.cjs.map → chunk-DOVVKQMZ.cjs.map} +1 -1
- package/dist/{chunk-KOQCA5X5.cjs → chunk-DWJREJRA.cjs} +5 -5
- package/dist/{chunk-KOQCA5X5.cjs.map → chunk-DWJREJRA.cjs.map} +1 -1
- package/dist/{chunk-TTVOBWAH.js → chunk-EADBLRNF.js} +5 -5
- package/dist/{chunk-MRIOYSXH.js → chunk-EBDCDHOT.js} +5 -5
- package/dist/{chunk-RNMGKAS6.js → chunk-EDNZ2HN3.js} +15 -15
- package/dist/{chunk-7R2DIGG4.cjs → chunk-EX5PJGVA.cjs} +76 -76
- package/dist/{chunk-7R2DIGG4.cjs.map → chunk-EX5PJGVA.cjs.map} +1 -1
- package/dist/{chunk-GBEUGDZG.cjs → chunk-F6U2H42L.cjs} +23 -23
- package/dist/{chunk-GBEUGDZG.cjs.map → chunk-F6U2H42L.cjs.map} +1 -1
- package/dist/{chunk-KEKN76JR.js → chunk-FRQ2DE5Z.js} +5 -5
- package/dist/{chunk-JOV64HW5.js → chunk-GRBZC5N3.js} +3 -3
- package/dist/{chunk-CHIHYC7Q.cjs → chunk-GSD62VAY.cjs} +21 -21
- package/dist/{chunk-CHIHYC7Q.cjs.map → chunk-GSD62VAY.cjs.map} +1 -1
- package/dist/{chunk-LPMDCQLL.js → chunk-H3EJDISW.js} +2 -2
- package/dist/{chunk-3DGRXC74.js → chunk-HQBC7YRF.js} +5 -5
- package/dist/{chunk-VE52MSYC.js → chunk-IERXOVIS.js} +8 -8
- package/dist/{chunk-KOLVBEW5.js → chunk-IWISVG4P.js} +3 -3
- package/dist/{chunk-GNKM6R55.cjs → chunk-JH5P72AF.cjs} +25 -25
- package/dist/{chunk-GNKM6R55.cjs.map → chunk-JH5P72AF.cjs.map} +1 -1
- package/dist/{chunk-LCK7T2RM.cjs → chunk-JU6SBF3C.cjs} +13 -13
- package/dist/{chunk-LCK7T2RM.cjs.map → chunk-JU6SBF3C.cjs.map} +1 -1
- package/dist/{chunk-OMSUWB6A.cjs → chunk-K72YMLCU.cjs} +118 -118
- package/dist/{chunk-OMSUWB6A.cjs.map → chunk-K72YMLCU.cjs.map} +1 -1
- package/dist/{chunk-CBXZSTAG.cjs → chunk-KHHFMHYE.cjs} +973 -793
- package/dist/chunk-KHHFMHYE.cjs.map +1 -0
- package/dist/{chunk-F2KBCLUG.js → chunk-KKSSA4CS.js} +2 -2
- package/dist/{chunk-IIXB5REN.cjs → chunk-KL3Z26IS.cjs} +16 -16
- package/dist/{chunk-IIXB5REN.cjs.map → chunk-KL3Z26IS.cjs.map} +1 -1
- package/dist/{chunk-FKBM6U43.js → chunk-LZLT67PE.js} +2 -2
- package/dist/{chunk-B3Z3RJRW.js → chunk-M4AD2PHE.js} +5 -5
- package/dist/{chunk-BVQEU5JB.js → chunk-MT5A25AX.js} +2 -2
- package/dist/{chunk-UEXIMEVU.js → chunk-N7IAE3DN.js} +10 -10
- package/dist/{chunk-DCCY54LU.cjs → chunk-O2SLSYJC.cjs} +14 -14
- package/dist/{chunk-DCCY54LU.cjs.map → chunk-O2SLSYJC.cjs.map} +1 -1
- package/dist/{chunk-3UBT2OIX.cjs → chunk-O3YNMOIS.cjs} +74 -74
- package/dist/{chunk-3UBT2OIX.cjs.map → chunk-O3YNMOIS.cjs.map} +1 -1
- package/dist/{chunk-HOGOQA2X.js → chunk-O7LA444D.js} +3 -3
- package/dist/{chunk-PFV4DAX5.js → chunk-OBBAT4AU.js} +10 -10
- package/dist/{chunk-B5IFXCRF.cjs → chunk-OPNEE5XD.cjs} +41 -41
- package/dist/{chunk-B5IFXCRF.cjs.map → chunk-OPNEE5XD.cjs.map} +1 -1
- package/dist/chunk-OXB6LRBK.js +20 -0
- package/dist/chunk-OXB6LRBK.js.map +1 -0
- package/dist/{chunk-SKABQX44.js → chunk-QP7Z4EN7.js} +7 -7
- package/dist/{chunk-HPWLIYRL.js → chunk-REDPQ7F6.js} +14 -14
- package/dist/{chunk-OVXYX47B.cjs → chunk-TIYVK2BE.cjs} +19 -19
- package/dist/{chunk-OVXYX47B.cjs.map → chunk-TIYVK2BE.cjs.map} +1 -1
- package/dist/{chunk-UPKZU6QU.cjs → chunk-U2YLMFJK.cjs} +1 -1
- package/dist/{chunk-UPKZU6QU.cjs.map → chunk-U2YLMFJK.cjs.map} +1 -1
- package/dist/{chunk-7Q5XXPCB.js → chunk-UF5VXOVZ.js} +14 -14
- package/dist/{chunk-65EVGKFV.cjs → chunk-UOOA73XL.cjs} +14 -14
- package/dist/{chunk-65EVGKFV.cjs.map → chunk-UOOA73XL.cjs.map} +1 -1
- package/dist/{chunk-CCWI3622.cjs → chunk-VTYP25OW.cjs} +4 -4
- package/dist/{chunk-CCWI3622.cjs.map → chunk-VTYP25OW.cjs.map} +1 -1
- package/dist/{chunk-RB6L5EGM.cjs → chunk-WDFDZSAK.cjs} +1131 -1131
- package/dist/{chunk-RB6L5EGM.cjs.map → chunk-WDFDZSAK.cjs.map} +1 -1
- package/dist/{chunk-T3C3JLGV.cjs → chunk-WKX7DYFM.cjs} +8 -8
- package/dist/{chunk-T3C3JLGV.cjs.map → chunk-WKX7DYFM.cjs.map} +1 -1
- package/dist/{chunk-S2KMNFFN.js → chunk-WWPANZTL.js} +7 -7
- package/dist/chunk-X7CEWD6V.cjs +20 -0
- package/dist/chunk-X7CEWD6V.cjs.map +1 -0
- package/dist/{chunk-5JUTGEZE.js → chunk-XBTZOO74.js} +2 -2
- package/dist/{chunk-RWURXICE.cjs → chunk-XGD6SCHN.cjs} +44 -44
- package/dist/{chunk-RWURXICE.cjs.map → chunk-XGD6SCHN.cjs.map} +1 -1
- package/dist/{chunk-EHAYNUOL.cjs → chunk-XOGD2AME.cjs} +3 -3
- package/dist/{chunk-EHAYNUOL.cjs.map → chunk-XOGD2AME.cjs.map} +1 -1
- package/dist/{chunk-N6HNK25A.cjs → chunk-YWUZL3RT.cjs} +11 -11
- package/dist/{chunk-N6HNK25A.cjs.map → chunk-YWUZL3RT.cjs.map} +1 -1
- package/dist/{chunk-LZYPSDFE.cjs → chunk-ZC7BVCDJ.cjs} +90 -90
- package/dist/{chunk-LZYPSDFE.cjs.map → chunk-ZC7BVCDJ.cjs.map} +1 -1
- package/dist/components/calendar.cjs +10 -10
- package/dist/components/calendar.js +2 -2
- package/dist/components/case-studies/index.cjs +30 -30
- package/dist/components/case-studies/index.js +14 -14
- package/dist/components/chat/embeddable-chat.d.ts +1 -1
- package/dist/components/chat/index.cjs +9 -9
- package/dist/components/chat/index.js +8 -8
- package/dist/components/chat/utils/source-row-cta.d.ts +1 -1
- package/dist/components/command.d.ts +7 -7
- package/dist/components/contact/index.cjs +15 -15
- package/dist/components/contact/index.js +14 -14
- package/dist/components/docs/index.cjs +18 -18
- package/dist/components/docs/index.js +17 -17
- package/dist/components/embeds/index.cjs +15 -15
- package/dist/components/embeds/index.js +14 -14
- package/dist/components/faq/index.cjs +16 -16
- package/dist/components/faq/index.js +15 -15
- package/dist/components/features/index.cjs +14 -14
- package/dist/components/features/index.js +13 -13
- package/dist/components/help-center-pages/index.cjs +37 -37
- package/dist/components/help-center-pages/index.js +28 -28
- package/dist/components/icons/index.cjs +3 -3
- package/dist/components/icons/index.js +2 -2
- package/dist/components/index.cjs +115 -115
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +31 -31
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +119 -119
- package/dist/components/meeting-scheduler/index.js +15 -15
- package/dist/components/navigation/index.cjs +17 -17
- package/dist/components/navigation/index.js +16 -16
- package/dist/components/onboarding-guides/index.cjs +18 -18
- package/dist/components/onboarding-guides/index.js +17 -17
- package/dist/components/related-content/index.cjs +10 -10
- package/dist/components/related-content/index.js +9 -9
- package/dist/components/resizable.d.ts +1 -1
- package/dist/components/tickets/index.cjs +19 -19
- package/dist/components/tickets/index.js +18 -18
- package/dist/components/ui/file-manager/index.cjs +57 -57
- package/dist/components/ui/file-manager/index.js +4 -4
- package/dist/components/ui/index.cjs +14 -14
- package/dist/components/ui/index.js +13 -13
- package/dist/contexts/chat-runtime-context.d.ts +1 -1
- package/dist/contexts/index.cjs +2 -2
- package/dist/contexts/index.js +1 -1
- package/dist/hooks/index.cjs +7 -7
- package/dist/hooks/index.js +6 -6
- package/dist/index.cjs +36 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -22
- package/dist/index.js.map +1 -1
- package/dist/platform-domains.cjs +43 -0
- package/dist/platform-domains.cjs.map +1 -1
- package/dist/platform-domains.d.ts +59 -4
- package/dist/platform-domains.d.ts.map +1 -1
- package/dist/platform-domains.js +39 -1
- package/dist/platform-domains.js.map +1 -1
- package/dist/types/index.cjs +0 -104
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js +0 -104
- package/dist/types/index.js.map +1 -1
- package/dist/utils/cn.d.ts +0 -21
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/index.cjs +53 -25
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +49 -25
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/platform-domains.test.ts +116 -0
- package/src/components/chat/embeddable-chat.tsx +2 -2
- package/src/components/chat/utils/__tests__/source-row-cta.test.ts +2 -2
- package/src/components/chat/utils/source-row-cta.ts +4 -4
- package/src/components/made-with-love.tsx +2 -2
- package/src/contexts/chat-runtime-context.tsx +1 -1
- package/src/platform-domains.ts +96 -4
- package/src/utils/.cn.md +3 -23
- package/src/utils/cn.ts +0 -47
- package/src/utils/index.ts +9 -2
- package/dist/chunk-23V5BSHD.cjs +0 -169
- package/dist/chunk-23V5BSHD.cjs.map +0 -1
- package/dist/chunk-CBXZSTAG.cjs.map +0 -1
- package/dist/chunk-I57XLISO.js.map +0 -1
- package/dist/chunk-O4MCCKKN.js +0 -169
- package/dist/chunk-O4MCCKKN.js.map +0 -1
- /package/dist/{chunk-IXD6SHQ6.js.map → chunk-2SNL36JV.js.map} +0 -0
- /package/dist/{chunk-FOSIR4QF.js.map → chunk-3DWDJ54N.js.map} +0 -0
- /package/dist/{chunk-4EEUB62O.js.map → chunk-4HVWGYHI.js.map} +0 -0
- /package/dist/{chunk-G5U4JP45.js.map → chunk-5ONM3FHQ.js.map} +0 -0
- /package/dist/{chunk-KJWPAJRT.js.map → chunk-7EI3NES7.js.map} +0 -0
- /package/dist/{chunk-27RD5XTP.js.map → chunk-CYXV5HPV.js.map} +0 -0
- /package/dist/{chunk-4WVWRFGP.js.map → chunk-DEIYPXGD.js.map} +0 -0
- /package/dist/{chunk-TTVOBWAH.js.map → chunk-EADBLRNF.js.map} +0 -0
- /package/dist/{chunk-MRIOYSXH.js.map → chunk-EBDCDHOT.js.map} +0 -0
- /package/dist/{chunk-RNMGKAS6.js.map → chunk-EDNZ2HN3.js.map} +0 -0
- /package/dist/{chunk-KEKN76JR.js.map → chunk-FRQ2DE5Z.js.map} +0 -0
- /package/dist/{chunk-JOV64HW5.js.map → chunk-GRBZC5N3.js.map} +0 -0
- /package/dist/{chunk-LPMDCQLL.js.map → chunk-H3EJDISW.js.map} +0 -0
- /package/dist/{chunk-3DGRXC74.js.map → chunk-HQBC7YRF.js.map} +0 -0
- /package/dist/{chunk-VE52MSYC.js.map → chunk-IERXOVIS.js.map} +0 -0
- /package/dist/{chunk-KOLVBEW5.js.map → chunk-IWISVG4P.js.map} +0 -0
- /package/dist/{chunk-F2KBCLUG.js.map → chunk-KKSSA4CS.js.map} +0 -0
- /package/dist/{chunk-FKBM6U43.js.map → chunk-LZLT67PE.js.map} +0 -0
- /package/dist/{chunk-B3Z3RJRW.js.map → chunk-M4AD2PHE.js.map} +0 -0
- /package/dist/{chunk-BVQEU5JB.js.map → chunk-MT5A25AX.js.map} +0 -0
- /package/dist/{chunk-UEXIMEVU.js.map → chunk-N7IAE3DN.js.map} +0 -0
- /package/dist/{chunk-HOGOQA2X.js.map → chunk-O7LA444D.js.map} +0 -0
- /package/dist/{chunk-PFV4DAX5.js.map → chunk-OBBAT4AU.js.map} +0 -0
- /package/dist/{chunk-SKABQX44.js.map → chunk-QP7Z4EN7.js.map} +0 -0
- /package/dist/{chunk-HPWLIYRL.js.map → chunk-REDPQ7F6.js.map} +0 -0
- /package/dist/{chunk-7Q5XXPCB.js.map → chunk-UF5VXOVZ.js.map} +0 -0
- /package/dist/{chunk-S2KMNFFN.js.map → chunk-WWPANZTL.js.map} +0 -0
- /package/dist/{chunk-5JUTGEZE.js.map → chunk-XBTZOO74.js.map} +0 -0
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ import { useDebounce, useMediaQuery, useToast } from '@flamingo-stack/openframe-
|
|
|
27
27
|
### Utilities
|
|
28
28
|
|
|
29
29
|
```tsx
|
|
30
|
-
import { cn, formatDate, formatPrice,
|
|
30
|
+
import { cn, formatDate, formatPrice, getPlatformUrl } from '@flamingo-stack/openframe-frontend-core/utils'
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
### Styles
|
|
@@ -65,7 +65,7 @@ export default {
|
|
|
65
65
|
| `./components/navigation` | Navigation components (Header, StickySectionNav) |
|
|
66
66
|
| `./components/toast` | Toast notification system |
|
|
67
67
|
| `./hooks` | React hooks (useDebounce, useMediaQuery, useToast, etc.) |
|
|
68
|
-
| `./utils` | Utilities (cn, formatDate, formatPrice,
|
|
68
|
+
| `./utils` | Utilities (cn, formatDate, formatPrice, getPlatformUrl, platform-config) |
|
|
69
69
|
| `./types` | TypeScript type definitions |
|
|
70
70
|
| `./styles` | CSS styles and ODS design tokens |
|
|
71
71
|
| `./nats` | NATS WebSocket utilities |
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
SearchInput
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-REDPQ7F6.js";
|
|
5
5
|
import {
|
|
6
6
|
contentFetch
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MT5A25AX.js";
|
|
8
8
|
import {
|
|
9
9
|
NEW_TAB_FEATURES,
|
|
10
10
|
resolveExternalNavigation,
|
|
11
11
|
resolveSourceIcon,
|
|
12
12
|
stripSameOriginToPath
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CLVJC6SI.js";
|
|
14
14
|
import {
|
|
15
15
|
useDebounce
|
|
16
16
|
} from "./chunk-C3GXRBJD.js";
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
} from "./chunk-XXMHLZ3Y.js";
|
|
20
20
|
import {
|
|
21
21
|
decideNewTab
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-3DWDJ54N.js";
|
|
23
23
|
import {
|
|
24
24
|
useChatRuntime
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-3SMLYVM2.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-2SNL36JV.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
useAuthedImageSrc,
|
|
8
8
|
useImageEdgeColor,
|
|
9
9
|
useOgPlaceholderUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LZLT67PE.js";
|
|
11
11
|
import {
|
|
12
12
|
FigmaIcon,
|
|
13
13
|
ImageIcon,
|
|
@@ -18,16 +18,16 @@ import {
|
|
|
18
18
|
} from "./chunk-OTX6XNSA.js";
|
|
19
19
|
import {
|
|
20
20
|
useChatRuntime
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3SMLYVM2.js";
|
|
22
22
|
import {
|
|
23
23
|
Button
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-4HVWGYHI.js";
|
|
25
25
|
import {
|
|
26
26
|
next_link_default
|
|
27
27
|
} from "./chunk-BTROSBHF.js";
|
|
28
28
|
import {
|
|
29
29
|
cn
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-OXB6LRBK.js";
|
|
31
31
|
|
|
32
32
|
// src/components/ui/card.tsx
|
|
33
33
|
import { forwardRef } from "react";
|
|
@@ -4235,4 +4235,4 @@ export {
|
|
|
4235
4235
|
canonicalContentRefType,
|
|
4236
4236
|
buildListUrl
|
|
4237
4237
|
};
|
|
4238
|
-
//# sourceMappingURL=chunk-
|
|
4238
|
+
//# sourceMappingURL=chunk-3DWDJ54N.js.map
|
|
@@ -1 +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 /**\n * Conversation-list surface for the SSE/Guide chat — the server-side\n * transcript store exposed as a dialog list:\n * GET `<url>?status=active|archived&cursor=&limit=&search=` → `{ dialogs, nextCursor }`\n * PATCH `<url>/<id>` with `{ title }` (rename) or `{ archived }` (archive / restore)\n * Hub: '/api/docs/chat/conversations'. OPTIONAL and NEVER derived: unset =\n * the Guide adapter has no dialog list and the panel keeps its single-thread\n * UI. Set it to enable the \"Current Chats\" rail / archive / rename in Guide\n * mode (the same UX openframe gets in Mingo mode). Selecting a row hydrates\n * through `chatHistoryUrl`.\n */\n chatConversationsUrl?: 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;AAgPnC,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
|
+
{"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 /**\n * Conversation-list surface for the SSE/Guide chat — the server-side\n * transcript store exposed as a dialog list:\n * GET `<url>?status=active|archived&cursor=&limit=&search=` → `{ dialogs, nextCursor }`\n * PATCH `<url>/<id>` with `{ title }` (rename) or `{ archived }` (archive / restore)\n * Hub: '/api/docs/chat/conversations'. OPTIONAL and NEVER derived: unset =\n * the Guide adapter has no dialog list and the panel keeps its single-thread\n * UI. Set it to enable the \"Current Chats\" rail / archive / rename in Guide\n * mode (the same UX openframe gets in Mingo mode). Selecting a row hydrates\n * through `chatHistoryUrl`.\n */\n chatConversationsUrl?: 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 * `getPlatformUrl(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;AAgPnC,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":[]}
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkO2SLSYJCcjs = require('./chunk-O2SLSYJC.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkKL3Z26IScjs = require('./chunk-KL3Z26IS.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunk5F5WKIDWcjs = require('./chunk-5F5WKIDW.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -22,10 +22,10 @@ var _chunkRFFF2EYDcjs = require('./chunk-RFFF2EYD.cjs');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkWDFDZSAKcjs = require('./chunk-WDFDZSAK.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkVTYP25OWcjs = require('./chunk-VTYP25OW.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -37,10 +37,10 @@ var _chunkTLLJIGTPcjs = require('./chunk-TLLJIGTP.cjs');
|
|
|
37
37
|
var _chunkSADRZ4YIcjs = require('./chunk-SADRZ4YI.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkU2YLMFJKcjs = require('./chunk-U2YLMFJK.cjs');
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkX7CEWD6Vcjs = require('./chunk-X7CEWD6V.cjs');
|
|
44
44
|
|
|
45
45
|
// src/components/docs/doc-viewer.tsx
|
|
46
46
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -58,7 +58,7 @@ function PersistentFilterControls({
|
|
|
58
58
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
|
-
className:
|
|
61
|
+
className: _chunkX7CEWD6Vcjs.cn.call(void 0,
|
|
62
62
|
"relative transition-all ease-in-out",
|
|
63
63
|
isLoading && preventInteraction && "pointer-events-none",
|
|
64
64
|
className
|
|
@@ -76,7 +76,7 @@ function PersistentFilterControls({
|
|
|
76
76
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
77
77
|
"div",
|
|
78
78
|
{
|
|
79
|
-
className:
|
|
79
|
+
className: _chunkX7CEWD6Vcjs.cn.call(void 0, "transition-all ease-in-out", isLoading && "cursor-not-allowed"),
|
|
80
80
|
style: {
|
|
81
81
|
transitionDuration: `${transitionDuration}ms`
|
|
82
82
|
},
|
|
@@ -105,13 +105,13 @@ function PersistentSidebar({ isLoading, children, className }) {
|
|
|
105
105
|
{
|
|
106
106
|
isLoading,
|
|
107
107
|
disabledOpacity: 0.5,
|
|
108
|
-
className:
|
|
108
|
+
className: _chunkX7CEWD6Vcjs.cn.call(void 0, "lg:sticky lg:top-20", className),
|
|
109
109
|
children
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
113
|
function PersistentMobileDropdown({ isLoading, children, className }) {
|
|
114
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PersistentFilterControls, { isLoading, disabledOpacity: 0.7, className:
|
|
114
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PersistentFilterControls, { isLoading, disabledOpacity: 0.7, className: _chunkX7CEWD6Vcjs.cn.call(void 0, "lg:hidden", className), children });
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// src/components/docs/doc-navigation-context.tsx
|
|
@@ -192,12 +192,12 @@ function toResolveLinkResult(body) {
|
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
function useDocsResolveLink(sourceId, resolveLinkEndpoint) {
|
|
195
|
-
const chatRuntime =
|
|
195
|
+
const chatRuntime = _chunkU2YLMFJKcjs.useChatRuntime.call(void 0, );
|
|
196
196
|
const resolvedResolveLinkEndpoint = _nullishCoalesce(_nullishCoalesce(resolveLinkEndpoint, () => ( _optionalChain([chatRuntime, 'optionalAccess', _2 => _2.endpoints, 'access', _3 => _3.docsResolveLinkUrl]))), () => ( "/api/docs/resolve-link"));
|
|
197
197
|
return _react.useCallback.call(void 0,
|
|
198
198
|
async (href, currentPath) => {
|
|
199
199
|
try {
|
|
200
|
-
const response = await
|
|
200
|
+
const response = await _chunkVTYP25OWcjs.contentFetch.call(void 0, resolvedResolveLinkEndpoint, {
|
|
201
201
|
method: "POST",
|
|
202
202
|
headers: { "Content-Type": "application/json" },
|
|
203
203
|
body: JSON.stringify({ link: href, currentPath, source: sourceId })
|
|
@@ -324,8 +324,8 @@ function toDocContent(value, requestedPath) {
|
|
|
324
324
|
}
|
|
325
325
|
function useDocumentTree(config, initialPath) {
|
|
326
326
|
const { structureEndpoint, contentEndpoint, baseRoute } = config;
|
|
327
|
-
const folderIndexFile = _nullishCoalesce(config.folderIndexFile, () => (
|
|
328
|
-
const cleanInitialPath =
|
|
327
|
+
const folderIndexFile = _nullishCoalesce(config.folderIndexFile, () => ( _chunkWDFDZSAKcjs.DEFAULT_FOLDER_INDEX_FILE));
|
|
328
|
+
const cleanInitialPath = _chunkWDFDZSAKcjs.stripFolderIndexFromPath.call(void 0, _optionalChain([initialPath, 'optionalAccess', _4 => _4.replace, 'call', _5 => _5(/\/$/, "")]) || "", folderIndexFile);
|
|
329
329
|
const [structure, setStructure] = _react.useState.call(void 0, []);
|
|
330
330
|
const [selectedPath, setSelectedPath] = _react.useState.call(void 0, cleanInitialPath);
|
|
331
331
|
const [content, setContent] = _react.useState.call(void 0, null);
|
|
@@ -349,12 +349,12 @@ function useDocumentTree(config, initialPath) {
|
|
|
349
349
|
} else if (pathname.startsWith(`${normalizedBaseRoute}/`)) {
|
|
350
350
|
pathFromUrl = pathname.substring(`${normalizedBaseRoute}/`.length);
|
|
351
351
|
}
|
|
352
|
-
pathFromUrl =
|
|
352
|
+
pathFromUrl = _chunkWDFDZSAKcjs.stripFolderIndexFromPath.call(void 0, pathFromUrl, folderIndexFile);
|
|
353
353
|
if (pathFromUrl !== selectedPathRef.current) {
|
|
354
354
|
setSelectedPath(pathFromUrl);
|
|
355
355
|
if (pathFromUrl) {
|
|
356
356
|
const parentPath = pathFromUrl.includes("/") ? pathFromUrl.substring(0, pathFromUrl.lastIndexOf("/")) : pathFromUrl;
|
|
357
|
-
setExpandedNodes(new Set(
|
|
357
|
+
setExpandedNodes(new Set(_chunkWDFDZSAKcjs.getDocAncestorNodeIds.call(void 0, parentPath)));
|
|
358
358
|
}
|
|
359
359
|
setTimeout(() => {
|
|
360
360
|
scrollToContent();
|
|
@@ -372,7 +372,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
372
372
|
setSelectedPath(cleanInitialPath);
|
|
373
373
|
if (cleanInitialPath) {
|
|
374
374
|
const parentPath = cleanInitialPath.includes("/") ? cleanInitialPath.substring(0, cleanInitialPath.lastIndexOf("/")) : cleanInitialPath;
|
|
375
|
-
setExpandedNodes(new Set(
|
|
375
|
+
setExpandedNodes(new Set(_chunkWDFDZSAKcjs.getDocAncestorNodeIds.call(void 0, parentPath)));
|
|
376
376
|
}
|
|
377
377
|
setExternalNavCount((n) => n + 1);
|
|
378
378
|
}
|
|
@@ -386,7 +386,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
386
386
|
try {
|
|
387
387
|
setIsLoadingStructure(true);
|
|
388
388
|
setError(null);
|
|
389
|
-
const response = await
|
|
389
|
+
const response = await _chunkVTYP25OWcjs.contentFetch.call(void 0, structureEndpoint);
|
|
390
390
|
if (!response.ok) {
|
|
391
391
|
throw new Error("Failed to load documentation structure");
|
|
392
392
|
}
|
|
@@ -397,7 +397,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
397
397
|
if (cleanInitialPath) {
|
|
398
398
|
const pathForExpansion = cleanInitialPath.includes(".") ? cleanInitialPath.substring(0, cleanInitialPath.lastIndexOf("/")) : cleanInitialPath;
|
|
399
399
|
if (pathForExpansion) {
|
|
400
|
-
setExpandedNodes(new Set(
|
|
400
|
+
setExpandedNodes(new Set(_chunkWDFDZSAKcjs.getDocAncestorNodeIds.call(void 0, pathForExpansion)));
|
|
401
401
|
}
|
|
402
402
|
} else if (nodes.length > 0) {
|
|
403
403
|
const hasRootReadme = nodes.some((node) => node.type === "file" && node.path === folderIndexFile);
|
|
@@ -425,7 +425,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
425
425
|
const fetchContent = async (path) => {
|
|
426
426
|
try {
|
|
427
427
|
setIsLoadingContent(true);
|
|
428
|
-
const response = await
|
|
428
|
+
const response = await _chunkVTYP25OWcjs.contentFetch.call(void 0, `${contentEndpoint}?path=${encodeURIComponent(path)}`);
|
|
429
429
|
if (path !== lastFetchedPath.current) return;
|
|
430
430
|
if (!response.ok) {
|
|
431
431
|
if (response.status === 404) {
|
|
@@ -437,7 +437,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
437
437
|
setContent(null);
|
|
438
438
|
return;
|
|
439
439
|
}
|
|
440
|
-
const probe =
|
|
440
|
+
const probe = _chunkWDFDZSAKcjs.findDocNodeByPath.call(void 0, _chunkWDFDZSAKcjs.stripFolderIndexFromPath.call(void 0, path, folderIndexFile), structure);
|
|
441
441
|
const probeIsNoReadmeFolder = !!probe && probe.type === "folder" && !probe.hasReadme;
|
|
442
442
|
const preStructureFolderLike = structure.length === 0 && !path.endsWith(".md");
|
|
443
443
|
if (probeIsNoReadmeFolder || preStructureFolderLike) {
|
|
@@ -494,7 +494,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
494
494
|
if (selectedPath === "") {
|
|
495
495
|
pathToFetch = folderIndexFile;
|
|
496
496
|
} else {
|
|
497
|
-
const node =
|
|
497
|
+
const node = _chunkWDFDZSAKcjs.findDocNodeByPath.call(void 0, selectedPath, structure);
|
|
498
498
|
if (node && node.type === "folder" && !node.hasReadme) {
|
|
499
499
|
const firstDocPath = findFirstDocPath(node);
|
|
500
500
|
if (!firstDocPath) {
|
|
@@ -535,16 +535,16 @@ function useDocumentTree(config, initialPath) {
|
|
|
535
535
|
if (node.type === "folder") {
|
|
536
536
|
setExpandedNodes((prev) => {
|
|
537
537
|
if (prev.has(node.id)) {
|
|
538
|
-
const ancestorIds =
|
|
538
|
+
const ancestorIds = _chunkWDFDZSAKcjs.getDocAncestorNodeIds.call(void 0, node.path);
|
|
539
539
|
ancestorIds.pop();
|
|
540
540
|
return new Set(ancestorIds);
|
|
541
541
|
}
|
|
542
|
-
return new Set(
|
|
542
|
+
return new Set(_chunkWDFDZSAKcjs.getDocAncestorNodeIds.call(void 0, node.path));
|
|
543
543
|
});
|
|
544
544
|
} else {
|
|
545
545
|
const lastSlash = node.path.lastIndexOf("/");
|
|
546
546
|
if (lastSlash > 0) {
|
|
547
|
-
setExpandedNodes(new Set(
|
|
547
|
+
setExpandedNodes(new Set(_chunkWDFDZSAKcjs.getDocAncestorNodeIds.call(void 0, node.path.substring(0, lastSlash))));
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
lastFetchedPath.current = null;
|
|
@@ -559,7 +559,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
559
559
|
const hashIndex = path.indexOf("#");
|
|
560
560
|
const anchor = hashIndex !== -1 ? path.substring(hashIndex) : "";
|
|
561
561
|
const cleanPath = path.replace(/\/$/, "").split("#")[0];
|
|
562
|
-
const pathForSelection = anchor && _optionalChain([options, 'optionalAccess', _6 => _6.fromInternalLink]) && cleanPath === "" ? selectedPathRef.current :
|
|
562
|
+
const pathForSelection = anchor && _optionalChain([options, 'optionalAccess', _6 => _6.fromInternalLink]) && cleanPath === "" ? selectedPathRef.current : _chunkWDFDZSAKcjs.stripFolderIndexFromPath.call(void 0, cleanPath, folderIndexFile);
|
|
563
563
|
if (anchor && _optionalChain([options, 'optionalAccess', _7 => _7.fromInternalLink]) && pathForSelection === selectedPathRef.current) {
|
|
564
564
|
_chunkTLLJIGTPcjs.navigateSamePageHash.call(void 0, anchor, { headerOffset: _chunkTLLJIGTPcjs.HUB_HEADER_OFFSET_PX });
|
|
565
565
|
return;
|
|
@@ -623,15 +623,15 @@ function useDocumentTree(config, initialPath) {
|
|
|
623
623
|
return docNavigation.register({
|
|
624
624
|
baseRoute: normalizedBaseRoute,
|
|
625
625
|
findNodeByPath: (path) => {
|
|
626
|
-
const clean =
|
|
627
|
-
return _nullishCoalesce(
|
|
626
|
+
const clean = _chunkWDFDZSAKcjs.stripFolderIndexFromPath.call(void 0, path.replace(/\/$/, "").split("#")[0], folderIndexFile);
|
|
627
|
+
return _nullishCoalesce(_chunkWDFDZSAKcjs.findDocNodeByPath.call(void 0, clean, structure), () => ( null));
|
|
628
628
|
},
|
|
629
629
|
selectNode
|
|
630
630
|
});
|
|
631
631
|
}, [docNavigation, normalizedBaseRoute, structure, selectNode, folderIndexFile]);
|
|
632
632
|
const isEmptyFolder = _react.useMemo.call(void 0, () => {
|
|
633
633
|
if (!selectedPath || structure.length === 0) return false;
|
|
634
|
-
const node =
|
|
634
|
+
const node = _chunkWDFDZSAKcjs.findDocNodeByPath.call(void 0, selectedPath, structure);
|
|
635
635
|
return !!node && node.type === "folder" && !node.hasReadme && !findFirstDocPath(node);
|
|
636
636
|
}, [selectedPath, structure]);
|
|
637
637
|
return {
|
|
@@ -767,7 +767,7 @@ function DocViewerContent({
|
|
|
767
767
|
label: _nullishCoalesce(_optionalChain([backButton, 'optionalAccess', _16 => _16.label]), () => ( "Back to home")),
|
|
768
768
|
onClick: () => router.push(_nullishCoalesce(_optionalChain([backButton, 'optionalAccess', _17 => _17.href]), () => ( "/")))
|
|
769
769
|
};
|
|
770
|
-
const docSearch =
|
|
770
|
+
const docSearch = _chunk5F5WKIDWcjs.useDocSearch.call(void 0, {
|
|
771
771
|
source: chatSource,
|
|
772
772
|
baseRoute,
|
|
773
773
|
searchEndpoint,
|
|
@@ -791,7 +791,7 @@ function DocViewerContent({
|
|
|
791
791
|
onResolveLink: resolveLink
|
|
792
792
|
});
|
|
793
793
|
}, [content, renderContent, navigateToDoc, sourceId, resolveLink]);
|
|
794
|
-
const selectedNodeDocType = selectedPath && structure.length > 0 ? _optionalChain([
|
|
794
|
+
const selectedNodeDocType = selectedPath && structure.length > 0 ? _optionalChain([_chunkWDFDZSAKcjs.findDocNodeByPath.call(void 0, selectedPath, structure), 'optionalAccess', _18 => _18.documentType]) : void 0;
|
|
795
795
|
const activeDocType = _nullishCoalesce(_optionalChain([content, 'optionalAccess', _19 => _19.documentType]), () => ( selectedNodeDocType));
|
|
796
796
|
const isMarkdownContent = !activeDocType || activeDocType === "markdown";
|
|
797
797
|
const showStickyNav = isMarkdownContent;
|
|
@@ -802,9 +802,9 @@ function DocViewerContent({
|
|
|
802
802
|
const containerBgStyle = colorPalette.containerBackground !== "transparent" ? { backgroundColor: colorPalette.containerBackground } : {};
|
|
803
803
|
const defaultEmptyText = structure.length > 0 ? "Select a document from the sidebar to view" : "No documents yet. Add content from the admin panel.";
|
|
804
804
|
const resolvedEmptyText = emptyStateText || defaultEmptyText;
|
|
805
|
-
const inner = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { ...bgStyle, ...containerBgStyle }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
805
|
+
const inner = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { ...bgStyle, ...containerBgStyle }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWDFDZSAKcjs.PageLayout, { title, subtitle, titleSize: "h1", titleWrap: true, backButton: _nullishCoalesce(backCfg, () => ( void 0)), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-10", children: [
|
|
806
806
|
showAIChat && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
807
|
-
|
|
807
|
+
_chunk5F5WKIDWcjs.DocSearchBar,
|
|
808
808
|
{
|
|
809
809
|
placeholder: `Search ${_optionalChain([sidebarLabel, 'optionalAccess', _23 => _23.toLowerCase, 'call', _24 => _24()]) || "documents"}...`,
|
|
810
810
|
query: docSearch.query,
|
|
@@ -823,9 +823,9 @@ function DocViewerContent({
|
|
|
823
823
|
] })
|
|
824
824
|
] }) }),
|
|
825
825
|
!error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-1 flex-col items-start gap-6 lg:flex-row lg:gap-10", children: [
|
|
826
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full lg:w-[320px] lg:shrink-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "lg:sticky lg:top-20", children: isLoadingStructure ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
826
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full lg:w-[320px] lg:shrink-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "lg:sticky lg:top-20", children: isLoadingStructure ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWDFDZSAKcjs.CategorySidebarSkeleton, {}) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
827
827
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PersistentMobileDropdown, { isLoading: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
828
|
-
|
|
828
|
+
_chunkKL3Z26IScjs.MobileNavigationDropdown,
|
|
829
829
|
{
|
|
830
830
|
nodes: structure,
|
|
831
831
|
selectedPath,
|
|
@@ -839,7 +839,7 @@ function DocViewerContent({
|
|
|
839
839
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PersistentSidebar, { isLoading: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "hidden lg:block", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
|
|
840
840
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "font-semibold text-ods-text-secondary text-h5", children: sidebarLabel }),
|
|
841
841
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
842
|
-
|
|
842
|
+
_chunkKL3Z26IScjs.MultiLevelNavigation,
|
|
843
843
|
{
|
|
844
844
|
nodes: structure,
|
|
845
845
|
selectedPath,
|
|
@@ -878,7 +878,7 @@ function DocViewerContent({
|
|
|
878
878
|
showStickyNav && content && stickyNavSections.length > 0 && !isLoadingContent && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "hidden lg:block", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "sticky top-24", children: [
|
|
879
879
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-4 font-semibold text-ods-text-secondary text-h5", children: "ON THIS PAGE" }),
|
|
880
880
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
881
|
-
|
|
881
|
+
_chunkKL3Z26IScjs.StickySectionNav,
|
|
882
882
|
{
|
|
883
883
|
sections: stickyNavSections,
|
|
884
884
|
activeSection,
|
|
@@ -893,7 +893,7 @@ function DocViewerContent({
|
|
|
893
893
|
) })
|
|
894
894
|
] })
|
|
895
895
|
] }) }) });
|
|
896
|
-
return shell ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
896
|
+
return shell ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWDFDZSAKcjs.PageShell, { contentClassName: `${bgClass} ${className}`, children: inner }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `page-shell-content ${bgClass} ${className}`.trim(), children: inner });
|
|
897
897
|
}
|
|
898
898
|
|
|
899
899
|
// src/components/docs/skeletons.tsx
|
|
@@ -983,11 +983,11 @@ function EmbedSkeleton({ documentType } = {}) {
|
|
|
983
983
|
|
|
984
984
|
var DEFAULT_TITLE = "Documents";
|
|
985
985
|
var defaultFallbackRenderer = () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "py-16 text-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-ods-text-secondary", children: "Unsupported document type" }) });
|
|
986
|
-
var defaultPdfRenderer = (content, handlers) => content.fileUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
987
|
-
var defaultGoogleSheetRenderer = (content, handlers) => content.externalUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
988
|
-
var defaultFigmaRenderer = (content, handlers) => content.externalUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
986
|
+
var defaultPdfRenderer = (content, handlers) => content.fileUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkO2SLSYJCcjs.PdfViewer, { src: content.fileUrl, fileName: content.fileName }) : defaultFallbackRenderer(content, handlers);
|
|
987
|
+
var defaultGoogleSheetRenderer = (content, handlers) => content.externalUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkO2SLSYJCcjs.GoogleSheetsViewer, { externalUrl: content.externalUrl, fileName: content.fileName }) : defaultFallbackRenderer(content, handlers);
|
|
988
|
+
var defaultFigmaRenderer = (content, handlers) => content.externalUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWDFDZSAKcjs.FigmaEmbed, { url: content.externalUrl, title: content.fileName, loading: "eager" }) : defaultFallbackRenderer(content, handlers);
|
|
989
989
|
var defaultFileRenderer = (content) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
990
|
-
|
|
990
|
+
_chunkO2SLSYJCcjs.FileDownloadCard,
|
|
991
991
|
{
|
|
992
992
|
fileName: content.fileName,
|
|
993
993
|
mimeType: content.mimeType,
|
|
@@ -1050,4 +1050,4 @@ function DocsHubPage({
|
|
|
1050
1050
|
|
|
1051
1051
|
|
|
1052
1052
|
exports.PersistentFilterControls = PersistentFilterControls; exports.PersistentSearchContainer = PersistentSearchContainer; exports.PersistentSidebar = PersistentSidebar; exports.PersistentMobileDropdown = PersistentMobileDropdown; exports.DocNavigationProvider = DocNavigationProvider; exports.useDocNavigation = useDocNavigation; exports.useDocumentTree = useDocumentTree; exports.useScrollSpy = useScrollSpy; exports.DocViewer = DocViewer; exports.MarkdownSkeleton = MarkdownSkeleton; exports.EmbedSkeleton = EmbedSkeleton; exports.DocsHubPage = DocsHubPage;
|
|
1053
|
-
//# sourceMappingURL=chunk-
|
|
1053
|
+
//# sourceMappingURL=chunk-3WLHNR2G.cjs.map
|