@flamingo-stack/openframe-frontend-core 0.0.701 → 0.0.702-snapshot.20261005191338
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DJLZXJYB.js → chunk-2NE3DNXY.js} +1 -1
- package/dist/{chunk-V5QNDOEL.js → chunk-53AC23ZN.js} +4 -4
- package/dist/{chunk-BQ34PIFC.cjs → chunk-5VPIC5MD.cjs} +3 -3
- package/dist/{chunk-BRQY2HKD.cjs → chunk-67CXGPTW.cjs} +24 -24
- package/dist/{chunk-BZYMGI4L.js → chunk-7632TNE7.js} +1 -1
- package/dist/{chunk-QPNR4N7N.cjs → chunk-BMJUKS6S.cjs} +20 -20
- package/dist/{chunk-GD4JALTR.js → chunk-BOUPNYUV.js} +2 -2
- package/dist/{chunk-BPS7JQCI.cjs → chunk-BSEIEWM5.cjs} +2 -2
- package/dist/{chunk-6JG75WVO.js → chunk-DAW6TDZB.js} +4 -4
- package/dist/{chunk-B7M6QEEM.js → chunk-ENGBNKUJ.js} +673 -432
- package/dist/{chunk-N7HMUQRV.js → chunk-G55W76S6.js} +1 -1
- package/dist/{chunk-65YVUYWJ.cjs → chunk-GX3OUTFO.cjs} +32 -32
- package/dist/{chunk-S4ADN25W.js → chunk-GZYLZ4MB.js} +2 -2
- package/dist/{chunk-A5ZGKBN2.js → chunk-HHFPQNP3.js} +1 -1
- package/dist/{chunk-RTGPIHVO.cjs → chunk-HY5YL3U5.cjs} +247 -173
- package/dist/{chunk-DG2I57UM.cjs → chunk-HYLIQMZH.cjs} +21 -21
- package/dist/{chunk-N7DPIH57.js → chunk-J4K5JOLI.js} +1 -1
- package/dist/{chunk-4H5Q6MQG.cjs → chunk-KFDP3DUL.cjs} +44 -44
- package/dist/{chunk-QDIX2ZRL.cjs → chunk-MXHJROXJ.cjs} +754 -513
- package/dist/{chunk-CUPJCGLB.js → chunk-NCTYD7HL.js} +2 -2
- package/dist/{chunk-MFORWVGD.js → chunk-NMGX2ZTU.js} +5 -5
- package/dist/{chunk-QZGFJBG5.cjs → chunk-NU724ZVN.cjs} +70 -70
- package/dist/{chunk-ZSPHOHOW.cjs → chunk-NYSYSKSH.cjs} +9 -9
- package/dist/{chunk-PNWIVND4.js → chunk-PJP5SMOU.js} +3 -3
- package/dist/{chunk-6JPQDYYY.js → chunk-QGTDWFT6.js} +419 -345
- package/dist/{chunk-GFXZMFDX.cjs → chunk-RLDAYA2A.cjs} +9 -9
- package/dist/{chunk-2CSYUMNM.cjs → chunk-RTXTGLGB.cjs} +2 -2
- package/dist/{chunk-YBC346FY.cjs → chunk-S6V7A5FS.cjs} +12 -12
- package/dist/{chunk-7ZDTAABP.cjs → chunk-SFGXIFYO.cjs} +7 -7
- package/dist/{chunk-JPVDJB27.js → chunk-SL2FOFT2.js} +4 -4
- package/dist/{chunk-EONNPRAW.js → chunk-UTW4SQDI.js} +2 -2
- package/dist/{chunk-NIT257DV.cjs → chunk-YBGEPKC2.cjs} +4 -4
- package/dist/components/case-studies/index.cjs +14 -14
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +4 -4
- package/dist/components/faq/index.js +3 -3
- package/dist/components/features/index.cjs +23 -3
- package/dist/components/features/index.js +22 -2
- package/dist/components/features/remote-session/index.d.ts +9 -1
- package/dist/components/features/remote-session/index.d.ts.map +1 -1
- package/dist/components/features/remote-session/remote-session-block.d.ts +4 -2
- package/dist/components/features/remote-session/remote-session-block.d.ts.map +1 -1
- package/dist/components/features/remote-session/remote-session-chat-panel.d.ts +4 -2
- package/dist/components/features/remote-session/remote-session-chat-panel.d.ts.map +1 -1
- package/dist/components/features/remote-session/remote-session-events.d.ts +24 -0
- package/dist/components/features/remote-session/remote-session-events.d.ts.map +1 -0
- package/dist/components/features/remote-session/remote-session-keep-modals.d.ts +41 -0
- package/dist/components/features/remote-session/remote-session-keep-modals.d.ts.map +1 -0
- package/dist/components/features/remote-session/remote-session-parts.d.ts +13 -2
- package/dist/components/features/remote-session/remote-session-parts.d.ts.map +1 -1
- package/dist/components/features/remote-session/remote-session-status.d.ts +34 -0
- package/dist/components/features/remote-session/remote-session-status.d.ts.map +1 -0
- package/dist/components/features/remote-session/remote-session-viewers.d.ts +15 -0
- package/dist/components/features/remote-session/remote-session-viewers.d.ts.map +1 -0
- package/dist/components/features/remote-session/types.d.ts +22 -0
- package/dist/components/features/remote-session/types.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +71 -71
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +61 -41
- package/dist/components/index.js +33 -13
- package/dist/components/meeting-scheduler/index.cjs +25 -25
- package/dist/components/meeting-scheduler/index.js +2 -2
- package/dist/components/navigation/app-layout-drawer.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +6 -6
- package/dist/components/onboarding-guides/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/drawer.d.ts +7 -3
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/components/ui/panel-resize-handle.d.ts +25 -0
- package/dist/components/ui/panel-resize-handle.d.ts.map +1 -0
- package/dist/hooks/ui/use-resizable-panel-size.d.ts +46 -0
- package/dist/hooks/ui/use-resizable-panel-size.d.ts.map +1 -0
- package/dist/index.cjs +27 -7
- package/dist/index.js +26 -6
- package/dist/tailwind.config.cjs +7 -1
- package/dist/tailwind.config.js +7 -1
- package/package.json +1 -1
- package/src/components/chat/embeddable-chat.tsx +11 -9
- package/src/components/features/remote-session/index.ts +28 -0
- package/src/components/features/remote-session/remote-session-block.tsx +6 -3
- package/src/components/features/remote-session/remote-session-chat-panel.tsx +11 -7
- package/src/components/features/remote-session/remote-session-events.tsx +93 -0
- package/src/components/features/remote-session/remote-session-keep-modals.tsx +208 -0
- package/src/components/features/remote-session/remote-session-parts.tsx +32 -3
- package/src/components/features/remote-session/remote-session-status.tsx +102 -0
- package/src/components/features/remote-session/remote-session-viewers.tsx +103 -0
- package/src/components/features/remote-session/types.ts +26 -0
- package/src/components/navigation/app-layout-drawer.tsx +14 -237
- package/src/components/ui/drawer.tsx +41 -188
- package/src/components/ui/panel-resize-handle.tsx +184 -0
- package/src/hooks/ui/use-resizable-panel-size.ts +114 -0
- package/tailwind.config.ts +6 -0
|
@@ -24616,7 +24616,7 @@ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
|
24616
24616
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
24617
24617
|
import { isIOS } from "@react-aria/utils";
|
|
24618
24618
|
import { MessageSquare as MessageSquare3 } from "lucide-react";
|
|
24619
|
-
import React9, { useCallback as useCallback28, useEffect as
|
|
24619
|
+
import React9, { useCallback as useCallback28, useEffect as useEffect39, useImperativeHandle as useImperativeHandle4, useMemo as useMemo31, useRef as useRef37, useState as useState49 } from "react";
|
|
24620
24620
|
|
|
24621
24621
|
// src/components/ui/drawer.tsx
|
|
24622
24622
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
@@ -24624,18 +24624,191 @@ import { cva } from "class-variance-authority";
|
|
|
24624
24624
|
import { X } from "lucide-react";
|
|
24625
24625
|
import {
|
|
24626
24626
|
forwardRef as forwardRef29,
|
|
24627
|
-
|
|
24628
|
-
|
|
24629
|
-
|
|
24630
|
-
|
|
24627
|
+
useEffect as useEffect38,
|
|
24628
|
+
useRef as useRef34,
|
|
24629
|
+
useState as useState46,
|
|
24630
|
+
useSyncExternalStore as useSyncExternalStore4
|
|
24631
24631
|
} from "react";
|
|
24632
|
-
|
|
24632
|
+
|
|
24633
|
+
// src/hooks/ui/use-resizable-panel-size.ts
|
|
24634
|
+
import { useCallback as useCallback25, useMemo as useMemo29, useState as useState45 } from "react";
|
|
24635
|
+
var CHOSEN_SIZE_KEY_SUFFIX = ":chosen";
|
|
24636
|
+
function isStoredPanelSize(value) {
|
|
24637
|
+
if (typeof value !== "object" || value === null) return false;
|
|
24638
|
+
const { size } = value;
|
|
24639
|
+
return typeof size === "number" && Number.isFinite(size) && size > 0;
|
|
24640
|
+
}
|
|
24641
|
+
function useResizablePanelSize({
|
|
24642
|
+
enabled,
|
|
24643
|
+
minSize,
|
|
24644
|
+
maxSize,
|
|
24645
|
+
defaultSize,
|
|
24646
|
+
available,
|
|
24647
|
+
reserve,
|
|
24648
|
+
storageKey
|
|
24649
|
+
}) {
|
|
24650
|
+
const storage = useMemo29(
|
|
24651
|
+
() => enabled && storageKey ? createLocalStorageAdapter({
|
|
24652
|
+
key: `${storageKey}${CHOSEN_SIZE_KEY_SUFFIX}`,
|
|
24653
|
+
validate: isStoredPanelSize,
|
|
24654
|
+
logTag: `[panel-size:${storageKey}]`
|
|
24655
|
+
}) : null,
|
|
24656
|
+
[enabled, storageKey]
|
|
24657
|
+
);
|
|
24658
|
+
const [held, setChosen] = useState45(() => ({ storage, size: storage?.load()?.size ?? null }));
|
|
24659
|
+
const chosen = held.storage === storage ? held : { storage, size: storage?.load()?.size ?? null };
|
|
24660
|
+
if (chosen !== held) setChosen(chosen);
|
|
24661
|
+
const chosenSize = chosen.size;
|
|
24662
|
+
const clampSize = useCallback25(
|
|
24663
|
+
(value) => {
|
|
24664
|
+
const ceiling = available > 0 ? Math.min(maxSize, available - reserve) : maxSize;
|
|
24665
|
+
return clamp(value, minSize, Math.max(minSize, ceiling));
|
|
24666
|
+
},
|
|
24667
|
+
[available, reserve, minSize, maxSize]
|
|
24668
|
+
);
|
|
24669
|
+
const fallbackSize = typeof defaultSize === "function" ? defaultSize(available) : defaultSize;
|
|
24670
|
+
const size = enabled ? clampSize(chosenSize ?? fallbackSize) : fallbackSize;
|
|
24671
|
+
const setSize = useCallback25(
|
|
24672
|
+
(next) => {
|
|
24673
|
+
const nextSize = Math.round(clampSize(next));
|
|
24674
|
+
setChosen({ storage, size: nextSize });
|
|
24675
|
+
storage?.save({ size: nextSize });
|
|
24676
|
+
},
|
|
24677
|
+
[clampSize, storage]
|
|
24678
|
+
);
|
|
24679
|
+
return { size, setSize, clampSize };
|
|
24680
|
+
}
|
|
24681
|
+
|
|
24682
|
+
// src/components/ui/panel-resize-handle.tsx
|
|
24683
|
+
import { useEffect as useEffect37, useRef as useRef33 } from "react";
|
|
24684
|
+
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
24685
|
+
var HORIZONTAL_SIDES = /* @__PURE__ */ new Set(["left", "right"]);
|
|
24686
|
+
function finishDrag(startRef, dragSizeRef, commit) {
|
|
24687
|
+
if (!startRef.current) return;
|
|
24688
|
+
startRef.current = null;
|
|
24689
|
+
if (dragSizeRef.current !== null) commit(dragSizeRef.current);
|
|
24690
|
+
dragSizeRef.current = null;
|
|
24691
|
+
document.body.style.cursor = "";
|
|
24692
|
+
document.body.style.userSelect = "";
|
|
24693
|
+
}
|
|
24694
|
+
function PanelResizeHandle({
|
|
24695
|
+
side,
|
|
24696
|
+
size,
|
|
24697
|
+
minSize,
|
|
24698
|
+
maxSize,
|
|
24699
|
+
onSize,
|
|
24700
|
+
clampSize,
|
|
24701
|
+
panelRef,
|
|
24702
|
+
variant,
|
|
24703
|
+
ariaLabel
|
|
24704
|
+
}) {
|
|
24705
|
+
const isHorizontal = HORIZONTAL_SIDES.has(side);
|
|
24706
|
+
const startRef = useRef33(null);
|
|
24707
|
+
const dragSizeRef = useRef33(null);
|
|
24708
|
+
const onSizeRef = useRef33(onSize);
|
|
24709
|
+
useEffect37(() => {
|
|
24710
|
+
onSizeRef.current = onSize;
|
|
24711
|
+
}, [onSize]);
|
|
24712
|
+
useEffect37(() => () => finishDrag(startRef, dragSizeRef, onSizeRef.current), []);
|
|
24713
|
+
const direction = side === "right" || side === "bottom" ? -1 : 1;
|
|
24714
|
+
const handlePointerDown = (e) => {
|
|
24715
|
+
if (e.button !== 0 && e.pointerType === "mouse") return;
|
|
24716
|
+
e.preventDefault();
|
|
24717
|
+
startRef.current = { x: e.clientX, y: e.clientY, size };
|
|
24718
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
24719
|
+
document.body.style.cursor = isHorizontal ? "col-resize" : "row-resize";
|
|
24720
|
+
document.body.style.userSelect = "none";
|
|
24721
|
+
};
|
|
24722
|
+
const handlePointerMove = (e) => {
|
|
24723
|
+
const start = startRef.current;
|
|
24724
|
+
const panel = panelRef.current;
|
|
24725
|
+
if (!start || !panel) return;
|
|
24726
|
+
const delta = isHorizontal ? e.clientX - start.x : e.clientY - start.y;
|
|
24727
|
+
const next = clampSize(start.size + delta * direction);
|
|
24728
|
+
dragSizeRef.current = next;
|
|
24729
|
+
panel.style[isHorizontal ? "width" : "height"] = `${next}px`;
|
|
24730
|
+
e.currentTarget.setAttribute("aria-valuenow", String(Math.round(next)));
|
|
24731
|
+
};
|
|
24732
|
+
const endDrag = (e) => {
|
|
24733
|
+
if (!startRef.current) return;
|
|
24734
|
+
finishDrag(startRef, dragSizeRef, onSize);
|
|
24735
|
+
try {
|
|
24736
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
24737
|
+
} catch {
|
|
24738
|
+
}
|
|
24739
|
+
};
|
|
24740
|
+
const handleKeyDown = (e) => {
|
|
24741
|
+
const step = e.shiftKey ? 40 : 16;
|
|
24742
|
+
if (isHorizontal) {
|
|
24743
|
+
if (e.key === "ArrowLeft") {
|
|
24744
|
+
e.preventDefault();
|
|
24745
|
+
onSize(size + step * (side === "right" ? 1 : -1));
|
|
24746
|
+
} else if (e.key === "ArrowRight") {
|
|
24747
|
+
e.preventDefault();
|
|
24748
|
+
onSize(size + step * (side === "right" ? -1 : 1));
|
|
24749
|
+
}
|
|
24750
|
+
} else {
|
|
24751
|
+
if (e.key === "ArrowUp") {
|
|
24752
|
+
e.preventDefault();
|
|
24753
|
+
onSize(size + step * (side === "bottom" ? 1 : -1));
|
|
24754
|
+
} else if (e.key === "ArrowDown") {
|
|
24755
|
+
e.preventDefault();
|
|
24756
|
+
onSize(size + step * (side === "bottom" ? -1 : 1));
|
|
24757
|
+
}
|
|
24758
|
+
}
|
|
24759
|
+
if (e.key === "Home") {
|
|
24760
|
+
e.preventDefault();
|
|
24761
|
+
onSize(minSize);
|
|
24762
|
+
} else if (e.key === "End") {
|
|
24763
|
+
e.preventDefault();
|
|
24764
|
+
onSize(maxSize);
|
|
24765
|
+
}
|
|
24766
|
+
};
|
|
24767
|
+
const track = variant === "inLayout" ? { w: "w-6", h: "h-6" } : { w: "w-3", h: "h-3" };
|
|
24768
|
+
const trackPosition = side === "right" ? `right-full top-4 bottom-4 ${track.w} items-center justify-end pr-1` : side === "left" ? `left-full top-4 bottom-4 ${track.w} items-center justify-start pl-1` : side === "bottom" ? `bottom-full left-4 right-4 ${track.h} justify-center items-end pb-1` : `top-full left-4 right-4 ${track.h} justify-center items-start pt-1`;
|
|
24769
|
+
const cursorClass = isHorizontal ? "cursor-col-resize" : "cursor-row-resize";
|
|
24770
|
+
const gripClass = isHorizontal ? "h-10 w-1" : "w-10 h-1";
|
|
24771
|
+
return /* @__PURE__ */ jsx99(
|
|
24772
|
+
"div",
|
|
24773
|
+
{
|
|
24774
|
+
role: "separator",
|
|
24775
|
+
tabIndex: 0,
|
|
24776
|
+
"aria-orientation": isHorizontal ? "vertical" : "horizontal",
|
|
24777
|
+
"aria-valuenow": Math.round(size),
|
|
24778
|
+
"aria-valuemin": minSize,
|
|
24779
|
+
"aria-valuemax": maxSize,
|
|
24780
|
+
"aria-label": ariaLabel ?? (isHorizontal ? "Resize panel width" : "Resize panel height"),
|
|
24781
|
+
onPointerDown: handlePointerDown,
|
|
24782
|
+
onPointerMove: handlePointerMove,
|
|
24783
|
+
onPointerUp: endDrag,
|
|
24784
|
+
onPointerCancel: endDrag,
|
|
24785
|
+
onLostPointerCapture: endDrag,
|
|
24786
|
+
onKeyDown: handleKeyDown,
|
|
24787
|
+
className: cn(
|
|
24788
|
+
"group absolute z-20 flex touch-none select-none",
|
|
24789
|
+
"outline-none ring-0 focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0",
|
|
24790
|
+
trackPosition,
|
|
24791
|
+
cursorClass
|
|
24792
|
+
),
|
|
24793
|
+
children: /* @__PURE__ */ jsx99(
|
|
24794
|
+
"div",
|
|
24795
|
+
{
|
|
24796
|
+
"aria-hidden": true,
|
|
24797
|
+
className: cn("rounded-full", variant === "inLayout" ? "bg-ods-border" : "bg-ods-bg-surface", gripClass)
|
|
24798
|
+
}
|
|
24799
|
+
)
|
|
24800
|
+
}
|
|
24801
|
+
);
|
|
24802
|
+
}
|
|
24803
|
+
|
|
24804
|
+
// src/components/ui/drawer.tsx
|
|
24805
|
+
import { jsx as jsx100, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
24633
24806
|
var OVERLAY_BACKDROP_CLASS = "bg-ods-overlay";
|
|
24634
24807
|
var Drawer = DialogPrimitive.Root;
|
|
24635
24808
|
var DrawerTrigger = DialogPrimitive.Trigger;
|
|
24636
24809
|
var DrawerClose = DialogPrimitive.Close;
|
|
24637
24810
|
var DrawerPortal = DialogPrimitive.Portal;
|
|
24638
|
-
var DrawerOverlay = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
24811
|
+
var DrawerOverlay = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ jsx100(
|
|
24639
24812
|
DialogPrimitive.Overlay,
|
|
24640
24813
|
{
|
|
24641
24814
|
ref,
|
|
@@ -24727,132 +24900,19 @@ var drawerPanelVariants = cva(
|
|
|
24727
24900
|
}
|
|
24728
24901
|
}
|
|
24729
24902
|
);
|
|
24730
|
-
var
|
|
24731
|
-
|
|
24732
|
-
|
|
24733
|
-
return
|
|
24734
|
-
}
|
|
24735
|
-
|
|
24736
|
-
|
|
24737
|
-
|
|
24738
|
-
|
|
24739
|
-
|
|
24740
|
-
|
|
24741
|
-
|
|
24742
|
-
|
|
24743
|
-
);
|
|
24744
|
-
const readInitial = useCallback25(() => {
|
|
24745
|
-
if (!enabled) return defaultSize;
|
|
24746
|
-
if (typeof window === "undefined") return defaultSize;
|
|
24747
|
-
if (!storageKey) return clampToViewport(defaultSize);
|
|
24748
|
-
try {
|
|
24749
|
-
const raw = window.localStorage.getItem(storageKey);
|
|
24750
|
-
if (!raw) return clampToViewport(defaultSize);
|
|
24751
|
-
const parsed = parseFloat(raw);
|
|
24752
|
-
if (!Number.isFinite(parsed)) return clampToViewport(defaultSize);
|
|
24753
|
-
return clampToViewport(parsed);
|
|
24754
|
-
} catch {
|
|
24755
|
-
return clampToViewport(defaultSize);
|
|
24756
|
-
}
|
|
24757
|
-
}, [enabled, storageKey, defaultSize, clampToViewport]);
|
|
24758
|
-
const [size, setSizeRaw] = useState45(readInitial);
|
|
24759
|
-
const setSize = useCallback25((next) => setSizeRaw(clampToViewport(next)), [clampToViewport]);
|
|
24760
|
-
useEffect37(() => {
|
|
24761
|
-
if (!enabled || !storageKey || typeof window === "undefined") return;
|
|
24762
|
-
try {
|
|
24763
|
-
window.localStorage.setItem(storageKey, String(Math.round(size)));
|
|
24764
|
-
} catch {
|
|
24765
|
-
}
|
|
24766
|
-
}, [enabled, size, storageKey]);
|
|
24767
|
-
useEffect37(() => {
|
|
24768
|
-
if (!enabled || typeof window === "undefined") return void 0;
|
|
24769
|
-
const onResize = () => setSizeRaw((prev) => clampToViewport(prev));
|
|
24770
|
-
window.addEventListener("resize", onResize);
|
|
24771
|
-
return () => window.removeEventListener("resize", onResize);
|
|
24772
|
-
}, [enabled, clampToViewport]);
|
|
24773
|
-
return { size, setSize };
|
|
24774
|
-
}
|
|
24775
|
-
function DrawerResizeHandle({ side, size, minSize, maxSize, onSize, ariaLabel }) {
|
|
24776
|
-
const isHorizontal = HORIZONTAL_SIDES.has(side);
|
|
24777
|
-
const startRef = useRef33(null);
|
|
24778
|
-
const direction = side === "right" || side === "bottom" ? -1 : 1;
|
|
24779
|
-
const handlePointerDown = (e) => {
|
|
24780
|
-
if (e.button !== 0 && e.pointerType === "mouse") return;
|
|
24781
|
-
e.preventDefault();
|
|
24782
|
-
startRef.current = { x: e.clientX, y: e.clientY, size };
|
|
24783
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
24784
|
-
document.body.style.cursor = isHorizontal ? "col-resize" : "row-resize";
|
|
24785
|
-
document.body.style.userSelect = "none";
|
|
24786
|
-
};
|
|
24787
|
-
const handlePointerMove = (e) => {
|
|
24788
|
-
const start = startRef.current;
|
|
24789
|
-
if (!start) return;
|
|
24790
|
-
const delta = isHorizontal ? e.clientX - start.x : e.clientY - start.y;
|
|
24791
|
-
onSize(start.size + delta * direction);
|
|
24792
|
-
};
|
|
24793
|
-
const endDrag = (e) => {
|
|
24794
|
-
if (!startRef.current) return;
|
|
24795
|
-
startRef.current = null;
|
|
24796
|
-
try {
|
|
24797
|
-
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
24798
|
-
} catch {
|
|
24799
|
-
}
|
|
24800
|
-
document.body.style.cursor = "";
|
|
24801
|
-
document.body.style.userSelect = "";
|
|
24802
|
-
};
|
|
24803
|
-
const handleKeyDown = (e) => {
|
|
24804
|
-
const step = e.shiftKey ? 40 : 16;
|
|
24805
|
-
if (isHorizontal) {
|
|
24806
|
-
if (e.key === "ArrowLeft") {
|
|
24807
|
-
e.preventDefault();
|
|
24808
|
-
onSize(size + step * (side === "right" ? 1 : -1));
|
|
24809
|
-
} else if (e.key === "ArrowRight") {
|
|
24810
|
-
e.preventDefault();
|
|
24811
|
-
onSize(size + step * (side === "right" ? -1 : 1));
|
|
24812
|
-
}
|
|
24813
|
-
} else {
|
|
24814
|
-
if (e.key === "ArrowUp") {
|
|
24815
|
-
e.preventDefault();
|
|
24816
|
-
onSize(size + step * (side === "bottom" ? 1 : -1));
|
|
24817
|
-
} else if (e.key === "ArrowDown") {
|
|
24818
|
-
e.preventDefault();
|
|
24819
|
-
onSize(size + step * (side === "bottom" ? -1 : 1));
|
|
24820
|
-
}
|
|
24821
|
-
}
|
|
24822
|
-
if (e.key === "Home") {
|
|
24823
|
-
e.preventDefault();
|
|
24824
|
-
onSize(minSize);
|
|
24825
|
-
} else if (e.key === "End") {
|
|
24826
|
-
e.preventDefault();
|
|
24827
|
-
onSize(maxSize);
|
|
24828
|
-
}
|
|
24829
|
-
};
|
|
24830
|
-
const trackPosition = side === "right" ? "right-full top-4 bottom-4 w-3 items-center justify-end pr-1" : side === "left" ? "left-full top-4 bottom-4 w-3 items-center justify-start pl-1" : side === "bottom" ? "bottom-full left-4 right-4 h-3 justify-center items-end pb-1" : "top-full left-4 right-4 h-3 justify-center items-start pt-1";
|
|
24831
|
-
const cursorClass = isHorizontal ? "cursor-col-resize" : "cursor-row-resize";
|
|
24832
|
-
const gripClass = isHorizontal ? "h-10 w-1" : "w-10 h-1";
|
|
24833
|
-
return /* @__PURE__ */ jsx99(
|
|
24834
|
-
"div",
|
|
24835
|
-
{
|
|
24836
|
-
role: "separator",
|
|
24837
|
-
tabIndex: 0,
|
|
24838
|
-
"aria-orientation": isHorizontal ? "vertical" : "horizontal",
|
|
24839
|
-
"aria-valuenow": Math.round(size),
|
|
24840
|
-
"aria-valuemin": minSize,
|
|
24841
|
-
"aria-valuemax": maxSize,
|
|
24842
|
-
"aria-label": ariaLabel ?? (isHorizontal ? "Resize panel width" : "Resize panel height"),
|
|
24843
|
-
onPointerDown: handlePointerDown,
|
|
24844
|
-
onPointerMove: handlePointerMove,
|
|
24845
|
-
onPointerUp: endDrag,
|
|
24846
|
-
onPointerCancel: endDrag,
|
|
24847
|
-
onKeyDown: handleKeyDown,
|
|
24848
|
-
className: cn(
|
|
24849
|
-
"group absolute z-20 flex touch-none select-none",
|
|
24850
|
-
"outline-none ring-0 focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0",
|
|
24851
|
-
trackPosition,
|
|
24852
|
-
cursorClass
|
|
24853
|
-
),
|
|
24854
|
-
children: /* @__PURE__ */ jsx99("div", { "aria-hidden": true, className: cn("rounded-full bg-ods-bg-surface", gripClass) })
|
|
24855
|
-
}
|
|
24903
|
+
var HORIZONTAL_SIDES2 = /* @__PURE__ */ new Set(["left", "right"]);
|
|
24904
|
+
var subscribeToResize = (onChange) => {
|
|
24905
|
+
window.addEventListener("resize", onChange);
|
|
24906
|
+
return () => window.removeEventListener("resize", onChange);
|
|
24907
|
+
};
|
|
24908
|
+
var subscribeToNothing = () => () => {
|
|
24909
|
+
};
|
|
24910
|
+
var noExtent = () => 0;
|
|
24911
|
+
function useViewportExtent(enabled, isHorizontal) {
|
|
24912
|
+
return useSyncExternalStore4(
|
|
24913
|
+
enabled ? subscribeToResize : subscribeToNothing,
|
|
24914
|
+
enabled ? isHorizontal ? () => window.innerWidth : () => window.innerHeight : noExtent,
|
|
24915
|
+
noExtent
|
|
24856
24916
|
);
|
|
24857
24917
|
}
|
|
24858
24918
|
var DrawerContent = forwardRef29(
|
|
@@ -24877,11 +24937,10 @@ var DrawerContent = forwardRef29(
|
|
|
24877
24937
|
...props
|
|
24878
24938
|
}, ref) => {
|
|
24879
24939
|
const resolvedSide = side ?? "right";
|
|
24880
|
-
const isHorizontal =
|
|
24881
|
-
const initialSize = defaultSize ?? (isHorizontal ? 560 : 480);
|
|
24940
|
+
const isHorizontal = HORIZONTAL_SIDES2.has(resolvedSide);
|
|
24882
24941
|
const headerHeight = useHeaderHeight();
|
|
24883
|
-
const [isMobile, setIsMobile] =
|
|
24884
|
-
|
|
24942
|
+
const [isMobile, setIsMobile] = useState46(false);
|
|
24943
|
+
useEffect38(() => {
|
|
24885
24944
|
if (typeof window === "undefined") return void 0;
|
|
24886
24945
|
const mq = window.matchMedia(`(max-width: ${mobileBreakpoint - 1}px)`);
|
|
24887
24946
|
const update = () => setIsMobile(mq.matches);
|
|
@@ -24889,18 +24948,25 @@ var DrawerContent = forwardRef29(
|
|
|
24889
24948
|
mq.addEventListener("change", update);
|
|
24890
24949
|
return () => mq.removeEventListener("change", update);
|
|
24891
24950
|
}, [mobileBreakpoint]);
|
|
24892
|
-
const
|
|
24951
|
+
const available = useViewportExtent(resizable, isHorizontal);
|
|
24952
|
+
const panelRef = useRef34(null);
|
|
24953
|
+
const {
|
|
24954
|
+
size: resizedSize,
|
|
24955
|
+
setSize,
|
|
24956
|
+
clampSize
|
|
24957
|
+
} = useResizablePanelSize({
|
|
24893
24958
|
enabled: resizable,
|
|
24894
|
-
isHorizontal,
|
|
24895
24959
|
minSize,
|
|
24896
24960
|
maxSize,
|
|
24897
|
-
defaultSize:
|
|
24961
|
+
defaultSize: defaultSize ?? (isHorizontal ? 560 : 480),
|
|
24962
|
+
available,
|
|
24963
|
+
reserve: 80,
|
|
24898
24964
|
storageKey
|
|
24899
24965
|
});
|
|
24900
24966
|
const applyInlineSize = resizable && !isMobile;
|
|
24901
24967
|
const sizeStyle = applyInlineSize ? isHorizontal ? { width: resizedSize } : { height: resizedSize } : {};
|
|
24902
24968
|
return /* @__PURE__ */ jsxs75(DrawerPortal, { children: [
|
|
24903
|
-
/* @__PURE__ */
|
|
24969
|
+
/* @__PURE__ */ jsx100(DrawerOverlay, { className: overlayClassName }),
|
|
24904
24970
|
/* @__PURE__ */ jsxs75(
|
|
24905
24971
|
DialogPrimitive.Content,
|
|
24906
24972
|
{
|
|
@@ -24909,20 +24975,24 @@ var DrawerContent = forwardRef29(
|
|
|
24909
24975
|
style: { ...offsetHeader ? { top: headerHeight } : {}, ...style },
|
|
24910
24976
|
...props,
|
|
24911
24977
|
children: [
|
|
24912
|
-
applyInlineSize ? /* @__PURE__ */
|
|
24913
|
-
|
|
24978
|
+
applyInlineSize ? /* @__PURE__ */ jsx100(
|
|
24979
|
+
PanelResizeHandle,
|
|
24914
24980
|
{
|
|
24981
|
+
variant: "overlay",
|
|
24915
24982
|
side: resolvedSide,
|
|
24916
24983
|
size: resizedSize,
|
|
24917
24984
|
minSize,
|
|
24918
24985
|
maxSize,
|
|
24919
24986
|
onSize: setSize,
|
|
24987
|
+
clampSize,
|
|
24988
|
+
panelRef,
|
|
24920
24989
|
ariaLabel: resizeAriaLabel
|
|
24921
24990
|
}
|
|
24922
24991
|
) : null,
|
|
24923
|
-
/* @__PURE__ */
|
|
24992
|
+
/* @__PURE__ */ jsx100(
|
|
24924
24993
|
"div",
|
|
24925
24994
|
{
|
|
24995
|
+
ref: panelRef,
|
|
24926
24996
|
className: cn(drawerPanelVariants({ side, flush, size }), className, panelClassName),
|
|
24927
24997
|
style: { ...sizeStyle, ...panelStyle },
|
|
24928
24998
|
children
|
|
@@ -24935,11 +25005,11 @@ var DrawerContent = forwardRef29(
|
|
|
24935
25005
|
}
|
|
24936
25006
|
);
|
|
24937
25007
|
DrawerContent.displayName = "DrawerContent";
|
|
24938
|
-
var DrawerHeader = ({ className, children, ...props }) => /* @__PURE__ */
|
|
25008
|
+
var DrawerHeader = ({ className, children, ...props }) => /* @__PURE__ */ jsx100("div", { className: cn("flex flex-col gap-4", className), ...props, children });
|
|
24939
25009
|
DrawerHeader.displayName = "DrawerHeader";
|
|
24940
25010
|
var DrawerTitle = forwardRef29(
|
|
24941
25011
|
({ className, children, actions, hideClose, ...props }, ref) => /* @__PURE__ */ jsxs75("div", { className: "flex items-start gap-4", children: [
|
|
24942
|
-
/* @__PURE__ */
|
|
25012
|
+
/* @__PURE__ */ jsx100(
|
|
24943
25013
|
DialogPrimitive.Title,
|
|
24944
25014
|
{
|
|
24945
25015
|
ref,
|
|
@@ -24950,13 +25020,13 @@ var DrawerTitle = forwardRef29(
|
|
|
24950
25020
|
),
|
|
24951
25021
|
actions,
|
|
24952
25022
|
!hideClose && /* @__PURE__ */ jsxs75(DialogPrimitive.Close, { className: "shrink-0 rounded-sm text-ods-text-secondary outline-none ring-0 transition-colors hover:text-ods-text-primary focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0", children: [
|
|
24953
|
-
/* @__PURE__ */
|
|
24954
|
-
/* @__PURE__ */
|
|
25023
|
+
/* @__PURE__ */ jsx100(X, { className: "size-6" }),
|
|
25024
|
+
/* @__PURE__ */ jsx100("span", { className: "sr-only", children: "Close" })
|
|
24955
25025
|
] })
|
|
24956
25026
|
] })
|
|
24957
25027
|
);
|
|
24958
25028
|
DrawerTitle.displayName = "DrawerTitle";
|
|
24959
|
-
var DrawerDescription = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
25029
|
+
var DrawerDescription = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ jsx100(
|
|
24960
25030
|
DialogPrimitive.Description,
|
|
24961
25031
|
{
|
|
24962
25032
|
ref,
|
|
@@ -24965,16 +25035,16 @@ var DrawerDescription = forwardRef29(({ className, ...props }, ref) => /* @__PUR
|
|
|
24965
25035
|
}
|
|
24966
25036
|
));
|
|
24967
25037
|
DrawerDescription.displayName = "DrawerDescription";
|
|
24968
|
-
var DrawerBody = ({ className, ...props }) => /* @__PURE__ */
|
|
25038
|
+
var DrawerBody = ({ className, ...props }) => /* @__PURE__ */ jsx100("div", { className: cn("flex flex-1 flex-col gap-4 overflow-y-auto", className), ...props });
|
|
24969
25039
|
DrawerBody.displayName = "DrawerBody";
|
|
24970
|
-
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
25040
|
+
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ jsx100("div", { className: cn("mt-auto flex flex-col gap-2", className), ...props });
|
|
24971
25041
|
DrawerFooter.displayName = "DrawerFooter";
|
|
24972
25042
|
|
|
24973
25043
|
// src/components/ui/hover-dropdown.tsx
|
|
24974
|
-
import { useState as
|
|
24975
|
-
import { Fragment as Fragment33, jsx as
|
|
25044
|
+
import { useState as useState47, useRef as useRef35, useCallback as useCallback26 } from "react";
|
|
25045
|
+
import { Fragment as Fragment33, jsx as jsx101, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
24976
25046
|
function DefaultAnchor({ href, className, children }) {
|
|
24977
|
-
return /* @__PURE__ */
|
|
25047
|
+
return /* @__PURE__ */ jsx101("a", { href, className, children });
|
|
24978
25048
|
}
|
|
24979
25049
|
function HoverDropdown({
|
|
24980
25050
|
children,
|
|
@@ -24984,10 +25054,10 @@ function HoverDropdown({
|
|
|
24984
25054
|
className,
|
|
24985
25055
|
renderAnchor
|
|
24986
25056
|
}) {
|
|
24987
|
-
const [open, setOpen] =
|
|
24988
|
-
const timeoutRef =
|
|
24989
|
-
const containerRef =
|
|
24990
|
-
const panelRef =
|
|
25057
|
+
const [open, setOpen] = useState47(false);
|
|
25058
|
+
const timeoutRef = useRef35(void 0);
|
|
25059
|
+
const containerRef = useRef35(null);
|
|
25060
|
+
const panelRef = useRef35(null);
|
|
24991
25061
|
useIsomorphicLayoutEffect(() => {
|
|
24992
25062
|
const el = panelRef.current;
|
|
24993
25063
|
const container = containerRef.current;
|
|
@@ -25027,24 +25097,24 @@ function HoverDropdown({
|
|
|
25027
25097
|
clearTimeout(timeoutRef.current);
|
|
25028
25098
|
setOpen((prev) => !prev);
|
|
25029
25099
|
}, []);
|
|
25030
|
-
if (items.length === 0) return /* @__PURE__ */
|
|
25100
|
+
if (items.length === 0) return /* @__PURE__ */ jsx101(Fragment33, { children });
|
|
25031
25101
|
const renderAnchorFn = renderAnchor ?? DefaultAnchor;
|
|
25032
25102
|
return /* @__PURE__ */ jsxs76("div", { ref: containerRef, className: "relative inline-flex", onMouseEnter: show, onMouseLeave: hide, onClick: toggle, children: [
|
|
25033
25103
|
children,
|
|
25034
|
-
open && /* @__PURE__ */
|
|
25104
|
+
open && /* @__PURE__ */ jsx101(
|
|
25035
25105
|
"div",
|
|
25036
25106
|
{
|
|
25037
25107
|
className: `fixed z-[9999] max-h-[420px] min-w-[220px] max-w-[340px] overflow-y-auto rounded-lg border border-ods-border bg-ods-card p-1 shadow-xl ${className || ""}`,
|
|
25038
25108
|
ref: panelRef,
|
|
25039
25109
|
children: items.map((item, i) => {
|
|
25040
25110
|
const content = /* @__PURE__ */ jsxs76(Fragment33, { children: [
|
|
25041
|
-
item.icon && /* @__PURE__ */
|
|
25042
|
-
/* @__PURE__ */
|
|
25111
|
+
item.icon && /* @__PURE__ */ jsx101("span", { className: "flex-shrink-0 [&_svg]:size-3.5", children: item.icon }),
|
|
25112
|
+
/* @__PURE__ */ jsx101("span", { className: "min-w-0 flex-1 truncate", children: item.label })
|
|
25043
25113
|
] });
|
|
25044
25114
|
const rowClass = "group flex w-full items-center gap-1.5 pl-2 pr-1 py-1.5 rounded text-h6 text-ods-text-secondary hover:bg-ods-accent/10 transition-colors text-left";
|
|
25045
25115
|
const primaryClass = "flex flex-1 items-center gap-1.5 min-w-0 hover:text-ods-accent cursor-pointer no-underline";
|
|
25046
25116
|
const secondaryAction = item.secondaryAction;
|
|
25047
|
-
const secondary = secondaryAction ? /* @__PURE__ */
|
|
25117
|
+
const secondary = secondaryAction ? /* @__PURE__ */ jsx101(
|
|
25048
25118
|
"button",
|
|
25049
25119
|
{
|
|
25050
25120
|
onClick: (e) => {
|
|
@@ -25073,12 +25143,12 @@ function HoverDropdown({
|
|
|
25073
25143
|
}
|
|
25074
25144
|
if (!item.onClick) {
|
|
25075
25145
|
return /* @__PURE__ */ jsxs76("div", { className: rowClass, children: [
|
|
25076
|
-
/* @__PURE__ */
|
|
25146
|
+
/* @__PURE__ */ jsx101("span", { className: `${primaryClass} cursor-default hover:!text-ods-text-secondary`, children: content }),
|
|
25077
25147
|
secondary
|
|
25078
25148
|
] }, i);
|
|
25079
25149
|
}
|
|
25080
25150
|
return /* @__PURE__ */ jsxs76("div", { className: rowClass, children: [
|
|
25081
|
-
/* @__PURE__ */
|
|
25151
|
+
/* @__PURE__ */ jsx101("button", { onClick: item.onClick, className: primaryClass, children: content }),
|
|
25082
25152
|
secondary
|
|
25083
25153
|
] }, i);
|
|
25084
25154
|
})
|
|
@@ -25088,7 +25158,7 @@ function HoverDropdown({
|
|
|
25088
25158
|
}
|
|
25089
25159
|
|
|
25090
25160
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
25091
|
-
import { useCallback as useCallback27, useMemo as
|
|
25161
|
+
import { useCallback as useCallback27, useMemo as useMemo30, useRef as useRef36, useState as useState48 } from "react";
|
|
25092
25162
|
function useChatDialogManager({
|
|
25093
25163
|
dialogs,
|
|
25094
25164
|
activeDialogId,
|
|
@@ -25099,8 +25169,8 @@ function useChatDialogManager({
|
|
|
25099
25169
|
fetchArchivedDialogs,
|
|
25100
25170
|
unarchiveDialog
|
|
25101
25171
|
}) {
|
|
25102
|
-
const [renameTarget, setRenameTarget] =
|
|
25103
|
-
const [archiveTarget, setArchiveTarget] =
|
|
25172
|
+
const [renameTarget, setRenameTarget] = useState48(null);
|
|
25173
|
+
const [archiveTarget, setArchiveTarget] = useState48(null);
|
|
25104
25174
|
const handleConfirmRename = useCallback27(
|
|
25105
25175
|
(name) => {
|
|
25106
25176
|
if (renameTarget) void renameDialog(renameTarget.id, name);
|
|
@@ -25108,7 +25178,7 @@ function useChatDialogManager({
|
|
|
25108
25178
|
},
|
|
25109
25179
|
[renameTarget, renameDialog]
|
|
25110
25180
|
);
|
|
25111
|
-
const [openingDialogId, setOpeningDialogId] =
|
|
25181
|
+
const [openingDialogId, setOpeningDialogId] = useState48(null);
|
|
25112
25182
|
const handleConfirmArchive = useCallback27(async () => {
|
|
25113
25183
|
if (archiveTarget) {
|
|
25114
25184
|
try {
|
|
@@ -25124,12 +25194,12 @@ function useChatDialogManager({
|
|
|
25124
25194
|
}
|
|
25125
25195
|
setArchiveTarget(null);
|
|
25126
25196
|
}, [archiveTarget, archiveDialog, activeDialogId, clearMessages]);
|
|
25127
|
-
const [archiveOpen, setArchiveOpen] =
|
|
25128
|
-
const [archivedDialogs, setArchivedDialogs] =
|
|
25129
|
-
const [archivedCursor, setArchivedCursor] =
|
|
25130
|
-
const [archivedLoading, setArchivedLoading] =
|
|
25131
|
-
const [archivedPending, setArchivedPending] =
|
|
25132
|
-
const archivedRequestIdRef =
|
|
25197
|
+
const [archiveOpen, setArchiveOpen] = useState48(false);
|
|
25198
|
+
const [archivedDialogs, setArchivedDialogs] = useState48([]);
|
|
25199
|
+
const [archivedCursor, setArchivedCursor] = useState48(null);
|
|
25200
|
+
const [archivedLoading, setArchivedLoading] = useState48(false);
|
|
25201
|
+
const [archivedPending, setArchivedPending] = useState48(false);
|
|
25202
|
+
const archivedRequestIdRef = useRef36(0);
|
|
25133
25203
|
const loadArchivedPage = useCallback27(
|
|
25134
25204
|
async (cursor) => {
|
|
25135
25205
|
if (!fetchArchivedDialogs) return;
|
|
@@ -25168,7 +25238,7 @@ function useChatDialogManager({
|
|
|
25168
25238
|
void loadArchivedPage();
|
|
25169
25239
|
}, [loadArchivedPage]);
|
|
25170
25240
|
const closeArchive = useCallback27(() => setArchiveOpen(false), []);
|
|
25171
|
-
const [viewingArchivedId, setViewingArchivedId] =
|
|
25241
|
+
const [viewingArchivedId, setViewingArchivedId] = useState48(null);
|
|
25172
25242
|
const handleSelectDialog = useCallback27(
|
|
25173
25243
|
(id) => {
|
|
25174
25244
|
setViewingArchivedId(null);
|
|
@@ -25187,7 +25257,7 @@ function useChatDialogManager({
|
|
|
25187
25257
|
},
|
|
25188
25258
|
[selectDialog]
|
|
25189
25259
|
);
|
|
25190
|
-
const [restoreTarget, setRestoreTarget] =
|
|
25260
|
+
const [restoreTarget, setRestoreTarget] = useState48(null);
|
|
25191
25261
|
const handleConfirmRestore = useCallback27(async () => {
|
|
25192
25262
|
if (restoreTarget) {
|
|
25193
25263
|
try {
|
|
@@ -25217,7 +25287,7 @@ function useChatDialogManager({
|
|
|
25217
25287
|
clearMessages();
|
|
25218
25288
|
setArchiveOpen(false);
|
|
25219
25289
|
}, [selectDialog, clearMessages]);
|
|
25220
|
-
const activeDialog =
|
|
25290
|
+
const activeDialog = useMemo30(
|
|
25221
25291
|
() => dialogs.find((d) => d.id === activeDialogId) ?? archivedDialogs.find((d) => d.id === activeDialogId),
|
|
25222
25292
|
[dialogs, archivedDialogs, activeDialogId]
|
|
25223
25293
|
);
|
|
@@ -25321,7 +25391,7 @@ function pruneTimestampCache(timestampCache, liveIds) {
|
|
|
25321
25391
|
}
|
|
25322
25392
|
|
|
25323
25393
|
// src/components/chat/embeddable-chat.tsx
|
|
25324
|
-
import { Fragment as Fragment34, jsx as
|
|
25394
|
+
import { Fragment as Fragment34, jsx as jsx102, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
25325
25395
|
var HISTORY_RAIL_WIDTH = 320;
|
|
25326
25396
|
var CHAT_BLOCK_MIN_WIDTH = 400;
|
|
25327
25397
|
var SPLIT_MIN_WIDTH = HISTORY_RAIL_WIDTH + CHAT_BLOCK_MIN_WIDTH;
|
|
@@ -25329,12 +25399,14 @@ var DRAWER_DEFAULT_WIDTH_RATIO = 0.5;
|
|
|
25329
25399
|
var DRAWER_WIDTH_KEY = "mingo-chat-width-v4";
|
|
25330
25400
|
var DRAWER_DEFAULT_WIDTH_PX = 750;
|
|
25331
25401
|
var SPLIT_DEFAULT_WIDTH_ALLOWANCE = 16;
|
|
25332
|
-
function drawerDefaultWidth(withHistoryRail) {
|
|
25333
|
-
if (
|
|
25334
|
-
const ratioWidth = Math.round(
|
|
25402
|
+
function drawerDefaultWidth(viewportWidth, withHistoryRail) {
|
|
25403
|
+
if (viewportWidth <= 0) return DRAWER_DEFAULT_WIDTH_PX;
|
|
25404
|
+
const ratioWidth = Math.round(viewportWidth * DRAWER_DEFAULT_WIDTH_RATIO);
|
|
25335
25405
|
if (!withHistoryRail) return ratioWidth;
|
|
25336
25406
|
return Math.max(ratioWidth, SPLIT_MIN_WIDTH + SPLIT_DEFAULT_WIDTH_ALLOWANCE);
|
|
25337
25407
|
}
|
|
25408
|
+
var drawerDefaultWidthWithRail = (viewportWidth) => drawerDefaultWidth(viewportWidth, true);
|
|
25409
|
+
var drawerDefaultWidthWithoutRail = (viewportWidth) => drawerDefaultWidth(viewportWidth, false);
|
|
25338
25410
|
var formatRelativePath = (p) => p.replace(/^\/+/, "").replace(/\/+$/, "");
|
|
25339
25411
|
var mentionTokenOf = (key, markerByType) => {
|
|
25340
25412
|
const ci = key.indexOf(":");
|
|
@@ -25346,11 +25418,11 @@ var RAIL_COLLAPSED_STORAGE_KEY = "mingo-chat-history-collapsed";
|
|
|
25346
25418
|
var NO_CONTEXT_ITEMS = [];
|
|
25347
25419
|
var RAIL_ANIM_MS = 320;
|
|
25348
25420
|
function useRailPresence(open) {
|
|
25349
|
-
const [mounted, setMounted] =
|
|
25350
|
-
const [active, setActive] =
|
|
25421
|
+
const [mounted, setMounted] = useState49(open);
|
|
25422
|
+
const [active, setActive] = useState49(false);
|
|
25351
25423
|
if (open && !mounted) setMounted(true);
|
|
25352
25424
|
if (!open && active) setActive(false);
|
|
25353
|
-
|
|
25425
|
+
useEffect39(() => {
|
|
25354
25426
|
if (open) {
|
|
25355
25427
|
let raf2 = 0;
|
|
25356
25428
|
const raf1 = requestAnimationFrame(() => {
|
|
@@ -25372,7 +25444,7 @@ function RailSlot({
|
|
|
25372
25444
|
innerClassName,
|
|
25373
25445
|
children
|
|
25374
25446
|
}) {
|
|
25375
|
-
return /* @__PURE__ */
|
|
25447
|
+
return /* @__PURE__ */ jsx102(
|
|
25376
25448
|
"div",
|
|
25377
25449
|
{
|
|
25378
25450
|
className: cn(
|
|
@@ -25381,7 +25453,7 @@ function RailSlot({
|
|
|
25381
25453
|
"shrink-0 overflow-hidden border-r border-ods-border transition-[width,opacity] ease-out",
|
|
25382
25454
|
active ? "duration-[240ms] w-80 opacity-100" : "duration-[300ms] w-0 opacity-0"
|
|
25383
25455
|
),
|
|
25384
|
-
children: /* @__PURE__ */
|
|
25456
|
+
children: /* @__PURE__ */ jsx102("div", { className: cn("h-full w-80", innerClassName), children })
|
|
25385
25457
|
}
|
|
25386
25458
|
);
|
|
25387
25459
|
}
|
|
@@ -25438,7 +25510,7 @@ function SourceChip({
|
|
|
25438
25510
|
sourceRowCtxFromRuntime(runtime, { baseRoute, chipBasePlatform })
|
|
25439
25511
|
);
|
|
25440
25512
|
const Icon = cta.icon;
|
|
25441
|
-
const icon = /* @__PURE__ */
|
|
25513
|
+
const icon = /* @__PURE__ */ jsx102(Icon, { className: "h-3.5 w-3.5" });
|
|
25442
25514
|
const chipClass = chatChipClass({ tone: "secondary" });
|
|
25443
25515
|
const decideTab = (href, targetPlatform) => computeIsNewTab(runtime, href, targetPlatform);
|
|
25444
25516
|
if (src.items && src.items.length > 0) {
|
|
@@ -25461,12 +25533,12 @@ function SourceChip({
|
|
|
25461
25533
|
// A client-built group keeps each row's own citation number, so the
|
|
25462
25534
|
// `[3]` in the answer is findable inside the dropdown.
|
|
25463
25535
|
label: item.index === void 0 ? item.name : `[${item.index}] ${item.name}`,
|
|
25464
|
-
icon: /* @__PURE__ */
|
|
25536
|
+
icon: /* @__PURE__ */ jsx102(ItemIcon, { className: "h-3.5 w-3.5" }),
|
|
25465
25537
|
href: itemCta.href ?? void 0,
|
|
25466
25538
|
targetPlatform: itemCta.targetPlatform,
|
|
25467
25539
|
path: item.path ?? null,
|
|
25468
25540
|
secondaryAction: onDiscuss && itemCta.askable && itemChatRef ? {
|
|
25469
|
-
icon: /* @__PURE__ */
|
|
25541
|
+
icon: /* @__PURE__ */ jsx102(MessageSquare3, {}),
|
|
25470
25542
|
label: `Ask about ${item.name}`,
|
|
25471
25543
|
onClick: () => onDiscuss(itemChatRef)
|
|
25472
25544
|
} : void 0
|
|
@@ -25474,11 +25546,11 @@ function SourceChip({
|
|
|
25474
25546
|
});
|
|
25475
25547
|
const itemIndices = src.items.flatMap((item) => item.index === void 0 ? [] : [item.index]);
|
|
25476
25548
|
const groupIndices = itemIndices.length > 0 ? formatCitationIndices(itemIndices) : `${src.index}`;
|
|
25477
|
-
return /* @__PURE__ */
|
|
25549
|
+
return /* @__PURE__ */ jsx102(
|
|
25478
25550
|
HoverDropdown,
|
|
25479
25551
|
{
|
|
25480
25552
|
items: dropdownItems,
|
|
25481
|
-
renderAnchor: ({ href, targetPlatform, path, className, children }) => /* @__PURE__ */
|
|
25553
|
+
renderAnchor: ({ href, targetPlatform, path, className, children }) => /* @__PURE__ */ jsx102(
|
|
25482
25554
|
NavLinkAnchorViaRuntime,
|
|
25483
25555
|
{
|
|
25484
25556
|
href,
|
|
@@ -25512,7 +25584,7 @@ function SourceChip({
|
|
|
25512
25584
|
] });
|
|
25513
25585
|
const wrapChip = (clickable) => /* @__PURE__ */ jsxs77("span", { className: "inline-flex items-center", children: [
|
|
25514
25586
|
clickable,
|
|
25515
|
-
/* @__PURE__ */
|
|
25587
|
+
/* @__PURE__ */ jsx102(SourceActionButton, { chatRef: cta.chatRef, onDiscuss, density: "inline", className: "-mr-1 ml-1" })
|
|
25516
25588
|
] });
|
|
25517
25589
|
const buildClickHandler = (href, path, targetPlatform, isNewTab) => (e) => {
|
|
25518
25590
|
const handled = executeNavigation({
|
|
@@ -25529,7 +25601,7 @@ function SourceChip({
|
|
|
25529
25601
|
const resolvedHref = resolveHrefForRuntime(cta.href, runtime);
|
|
25530
25602
|
const isNewTab = decideTab(resolvedHref, cta.targetPlatform ?? null);
|
|
25531
25603
|
return wrapChip(
|
|
25532
|
-
/* @__PURE__ */
|
|
25604
|
+
/* @__PURE__ */ jsx102(
|
|
25533
25605
|
"a",
|
|
25534
25606
|
{
|
|
25535
25607
|
href: resolvedHref,
|
|
@@ -25545,7 +25617,7 @@ function SourceChip({
|
|
|
25545
25617
|
const resolvedHref = resolveHrefForRuntime(cta.href, runtime);
|
|
25546
25618
|
const isNewTab = decideTab(resolvedHref, cta.targetPlatform ?? null);
|
|
25547
25619
|
return wrapChip(
|
|
25548
|
-
/* @__PURE__ */
|
|
25620
|
+
/* @__PURE__ */ jsx102(
|
|
25549
25621
|
"a",
|
|
25550
25622
|
{
|
|
25551
25623
|
href: resolvedHref,
|
|
@@ -25559,7 +25631,7 @@ function SourceChip({
|
|
|
25559
25631
|
);
|
|
25560
25632
|
}
|
|
25561
25633
|
return wrapChip(
|
|
25562
|
-
/* @__PURE__ */
|
|
25634
|
+
/* @__PURE__ */ jsx102("span", { className: `${chipClass} cursor-default`, title: displayName, children: chipBody(displayName) })
|
|
25563
25635
|
);
|
|
25564
25636
|
}
|
|
25565
25637
|
function SourceChips({
|
|
@@ -25570,13 +25642,13 @@ function SourceChips({
|
|
|
25570
25642
|
onClose,
|
|
25571
25643
|
onDiscuss
|
|
25572
25644
|
}) {
|
|
25573
|
-
const [expanded, setExpanded] =
|
|
25645
|
+
const [expanded, setExpanded] = useState49(false);
|
|
25574
25646
|
if (cited.length === 0) {
|
|
25575
25647
|
const fallback = uncited.slice(0, FALLBACK_TOP_RETRIEVED);
|
|
25576
25648
|
if (fallback.length === 0) return null;
|
|
25577
25649
|
return /* @__PURE__ */ jsxs77("div", { className: "mt-2 flex flex-col gap-1.5 border-t border-ods-border pt-2", children: [
|
|
25578
|
-
/* @__PURE__ */
|
|
25579
|
-
/* @__PURE__ */
|
|
25650
|
+
/* @__PURE__ */ jsx102("span", { className: "uppercase text-ods-text-muted text-h6", children: "Top retrieved sources" }),
|
|
25651
|
+
/* @__PURE__ */ jsx102("div", { className: "flex flex-wrap gap-1.5", children: fallback.map((src) => /* @__PURE__ */ jsx102(
|
|
25580
25652
|
SourceChip,
|
|
25581
25653
|
{
|
|
25582
25654
|
src,
|
|
@@ -25592,9 +25664,9 @@ function SourceChips({
|
|
|
25592
25664
|
const hiddenCount = uncited.length;
|
|
25593
25665
|
const hasOverflow = hiddenCount > 0;
|
|
25594
25666
|
return /* @__PURE__ */ jsxs77("div", { className: "mt-2 flex flex-col gap-1.5 border-t border-ods-border pt-2", children: [
|
|
25595
|
-
/* @__PURE__ */
|
|
25667
|
+
/* @__PURE__ */ jsx102("span", { className: "uppercase text-ods-text-muted text-h6", children: "Sources" }),
|
|
25596
25668
|
/* @__PURE__ */ jsxs77("div", { className: `flex flex-wrap gap-1.5 ${expanded ? "max-h-[200px] overflow-y-auto overscroll-contain" : ""}`, children: [
|
|
25597
|
-
cited.map((src) => /* @__PURE__ */
|
|
25669
|
+
cited.map((src) => /* @__PURE__ */ jsx102(
|
|
25598
25670
|
SourceChip,
|
|
25599
25671
|
{
|
|
25600
25672
|
src,
|
|
@@ -25605,7 +25677,7 @@ function SourceChips({
|
|
|
25605
25677
|
},
|
|
25606
25678
|
src.index
|
|
25607
25679
|
)),
|
|
25608
|
-
expanded && uncited.map((src) => /* @__PURE__ */
|
|
25680
|
+
expanded && uncited.map((src) => /* @__PURE__ */ jsx102(
|
|
25609
25681
|
SourceChip,
|
|
25610
25682
|
{
|
|
25611
25683
|
src,
|
|
@@ -25616,7 +25688,7 @@ function SourceChips({
|
|
|
25616
25688
|
},
|
|
25617
25689
|
src.index
|
|
25618
25690
|
)),
|
|
25619
|
-
hasOverflow && /* @__PURE__ */
|
|
25691
|
+
hasOverflow && /* @__PURE__ */ jsx102(
|
|
25620
25692
|
"button",
|
|
25621
25693
|
{
|
|
25622
25694
|
onClick: () => setExpanded(!expanded),
|
|
@@ -25631,7 +25703,7 @@ function SourceChips({
|
|
|
25631
25703
|
}
|
|
25632
25704
|
var EmbeddableChat = React9.forwardRef(
|
|
25633
25705
|
function EmbeddableChatImpl(props, ref) {
|
|
25634
|
-
return /* @__PURE__ */
|
|
25706
|
+
return /* @__PURE__ */ jsx102(EmbeddableChatInner, { ...props, handleRef: ref });
|
|
25635
25707
|
}
|
|
25636
25708
|
);
|
|
25637
25709
|
EmbeddableChat.displayName = "EmbeddableChat";
|
|
@@ -25678,7 +25750,7 @@ function EmbeddableChatInner({
|
|
|
25678
25750
|
const commandsUrl = runtime.endpoints.commandsUrl;
|
|
25679
25751
|
const { attachmentsEnabled, user: identityUser } = useChatIdentity();
|
|
25680
25752
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
25681
|
-
|
|
25753
|
+
useEffect39(() => {
|
|
25682
25754
|
if (process.env.NODE_ENV !== "production") {
|
|
25683
25755
|
const hasOpen = open !== void 0;
|
|
25684
25756
|
const hasHandler = onOpenChange !== void 0;
|
|
@@ -25694,13 +25766,13 @@ function EmbeddableChatInner({
|
|
|
25694
25766
|
defaultProp: defaultOpen ?? false,
|
|
25695
25767
|
onChange: onOpenChange
|
|
25696
25768
|
});
|
|
25697
|
-
const [autoFocusInput] =
|
|
25769
|
+
const [autoFocusInput] = useState49(() => {
|
|
25698
25770
|
if (typeof window === "undefined") return false;
|
|
25699
25771
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
25700
25772
|
});
|
|
25701
25773
|
usePreventScroll({ isDisabled: !isOpen || shellLess });
|
|
25702
|
-
const navigatingAwayRef =
|
|
25703
|
-
|
|
25774
|
+
const navigatingAwayRef = useRef37(false);
|
|
25775
|
+
useEffect39(() => {
|
|
25704
25776
|
if (!isOpen) return void 0;
|
|
25705
25777
|
if (shellLess) return void 0;
|
|
25706
25778
|
if (typeof window === "undefined") return void 0;
|
|
@@ -25726,9 +25798,9 @@ function EmbeddableChatInner({
|
|
|
25726
25798
|
window.scrollTo(0, scrollY);
|
|
25727
25799
|
};
|
|
25728
25800
|
}, [isOpen, shellLess]);
|
|
25729
|
-
const chatInputRef =
|
|
25730
|
-
const [quickActionPreview, setQuickActionPreview] =
|
|
25731
|
-
const slashCommandsProp =
|
|
25801
|
+
const chatInputRef = useRef37(null);
|
|
25802
|
+
const [quickActionPreview, setQuickActionPreview] = useState49(null);
|
|
25803
|
+
const slashCommandsProp = useMemo31(
|
|
25732
25804
|
() => ({
|
|
25733
25805
|
fetchCommands: (prefix, signal) => fetchSlashCommands(prefix, signal, commandsUrl),
|
|
25734
25806
|
resolveSourceIcon: (sourceId) => {
|
|
@@ -25743,14 +25815,14 @@ function EmbeddableChatInner({
|
|
|
25743
25815
|
[commandsUrl]
|
|
25744
25816
|
);
|
|
25745
25817
|
const headerUserName = identityUser?.name?.trim() || [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || userDisplayName?.trim() || void 0;
|
|
25746
|
-
const effectiveModes =
|
|
25818
|
+
const effectiveModes = useMemo31(() => {
|
|
25747
25819
|
if (modes) return modes;
|
|
25748
25820
|
const guideOptions = tableIdForDocumentType ? { tableIdForDocumentType } : {};
|
|
25749
25821
|
return { guide: guideOptions };
|
|
25750
25822
|
}, [modes, tableIdForDocumentType]);
|
|
25751
25823
|
const hasMingoMode = !!effectiveModes.mingo || !!mingoState;
|
|
25752
25824
|
const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
|
|
25753
|
-
const [uncontrolledActiveMode, setUncontrolledActiveMode] =
|
|
25825
|
+
const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState49(initialActiveMode);
|
|
25754
25826
|
const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
|
|
25755
25827
|
const handleActiveModeChange = useCallback28(
|
|
25756
25828
|
(next) => {
|
|
@@ -25764,7 +25836,7 @@ function EmbeddableChatInner({
|
|
|
25764
25836
|
const { commands: commandsList, loaded: commandsLoaded } = useSlashCommandRegistry(commandsUrl, {
|
|
25765
25837
|
enabled: activeMode === "guide"
|
|
25766
25838
|
});
|
|
25767
|
-
const commandsById =
|
|
25839
|
+
const commandsById = useMemo31(() => {
|
|
25768
25840
|
const map = /* @__PURE__ */ new Map();
|
|
25769
25841
|
for (const cmd of commandsList) map.set(cmd.id, cmd);
|
|
25770
25842
|
return map;
|
|
@@ -25778,7 +25850,7 @@ function EmbeddableChatInner({
|
|
|
25778
25850
|
const effectiveGreeting = emptyStateConfig.greeting ?? emptyStateGreeting;
|
|
25779
25851
|
const effectiveEnabledRagTableIds = emptyStateUrl ? emptyStateConfig.enabledRagTableIds : enabledRagTableIds;
|
|
25780
25852
|
const effectiveSuggestedQueries = emptyStateUrl ? emptyStateConfig.suggestedQueries : suggestedQueries;
|
|
25781
|
-
const effectiveQuickActions =
|
|
25853
|
+
const effectiveQuickActions = useMemo31(
|
|
25782
25854
|
() => emptyStateUrl ? emptyStateConfig.quickActions : [],
|
|
25783
25855
|
[emptyStateUrl, emptyStateConfig.quickActions]
|
|
25784
25856
|
);
|
|
@@ -25825,7 +25897,7 @@ function EmbeddableChatInner({
|
|
|
25825
25897
|
injectedDialogCapabilities: mingoDialogCapabilities
|
|
25826
25898
|
});
|
|
25827
25899
|
const historyListMode = dialogCapabilities !== void 0;
|
|
25828
|
-
const [namingNewChat, setNamingNewChat] =
|
|
25900
|
+
const [namingNewChat, setNamingNewChat] = useState49(false);
|
|
25829
25901
|
const sendMessage = useCallback28(
|
|
25830
25902
|
async (text2, options) => {
|
|
25831
25903
|
if (activeDialogId == null) setNamingNewChat(true);
|
|
@@ -25837,7 +25909,7 @@ function EmbeddableChatInner({
|
|
|
25837
25909
|
},
|
|
25838
25910
|
[activeDialogId, sendMessageRaw]
|
|
25839
25911
|
);
|
|
25840
|
-
const mingoCaps =
|
|
25912
|
+
const mingoCaps = useMemo31(
|
|
25841
25913
|
() => ({
|
|
25842
25914
|
...dialogCapabilities,
|
|
25843
25915
|
canRename: dialogCapabilities?.canRename ?? false,
|
|
@@ -25845,8 +25917,8 @@ function EmbeddableChatInner({
|
|
|
25845
25917
|
}),
|
|
25846
25918
|
[dialogCapabilities]
|
|
25847
25919
|
);
|
|
25848
|
-
const guidePromptSentRef =
|
|
25849
|
-
|
|
25920
|
+
const guidePromptSentRef = useRef37(false);
|
|
25921
|
+
useEffect39(() => {
|
|
25850
25922
|
if (!guidePendingPrompt) {
|
|
25851
25923
|
guidePromptSentRef.current = false;
|
|
25852
25924
|
return;
|
|
@@ -25869,17 +25941,17 @@ function EmbeddableChatInner({
|
|
|
25869
25941
|
const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
|
|
25870
25942
|
const contextMaxItems = contextPicker?.maxItems ?? 10;
|
|
25871
25943
|
const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
|
|
25872
|
-
const [contextItems, setContextItems] =
|
|
25873
|
-
const [contextPickerOpen, setContextPickerOpen] =
|
|
25874
|
-
const [mentionQuery, setMentionQuery] =
|
|
25875
|
-
const mentionActiveRef =
|
|
25876
|
-
|
|
25944
|
+
const [contextItems, setContextItems] = useState49(NO_CONTEXT_ITEMS);
|
|
25945
|
+
const [contextPickerOpen, setContextPickerOpen] = useState49(false);
|
|
25946
|
+
const [mentionQuery, setMentionQuery] = useState49(null);
|
|
25947
|
+
const mentionActiveRef = useRef37(false);
|
|
25948
|
+
useEffect39(() => {
|
|
25877
25949
|
mentionActiveRef.current = mentionQuery !== null;
|
|
25878
25950
|
}, [mentionQuery]);
|
|
25879
|
-
const mentionKeysRef =
|
|
25951
|
+
const mentionKeysRef = useRef37(/* @__PURE__ */ new Set());
|
|
25880
25952
|
const scopeDialogId = activeDialogId ?? null;
|
|
25881
|
-
const [composerScope, setComposerScope] =
|
|
25882
|
-
const [composerKey, setComposerKey] =
|
|
25953
|
+
const [composerScope, setComposerScope] = useState49({ dialogId: scopeDialogId, mode: activeMode });
|
|
25954
|
+
const [composerKey, setComposerKey] = useState49(0);
|
|
25883
25955
|
if (composerScope.dialogId !== scopeDialogId || composerScope.mode !== activeMode) {
|
|
25884
25956
|
const named = namingNewChat && composerScope.dialogId == null && scopeDialogId != null && composerScope.mode === activeMode;
|
|
25885
25957
|
setComposerScope({ dialogId: scopeDialogId, mode: activeMode });
|
|
@@ -25890,17 +25962,17 @@ function EmbeddableChatInner({
|
|
|
25890
25962
|
setMentionQuery(null);
|
|
25891
25963
|
}
|
|
25892
25964
|
}
|
|
25893
|
-
|
|
25965
|
+
useEffect39(() => {
|
|
25894
25966
|
mentionKeysRef.current.clear();
|
|
25895
25967
|
clearAttachments();
|
|
25896
25968
|
}, [composerKey, clearAttachments]);
|
|
25897
|
-
const mentionMarkerByType =
|
|
25969
|
+
const mentionMarkerByType = useMemo31(() => {
|
|
25898
25970
|
const m = /* @__PURE__ */ new Map();
|
|
25899
25971
|
for (const t of contextPicker?.entityTypes ?? []) if (t.marker) m.set(t.type, t.marker);
|
|
25900
25972
|
return m;
|
|
25901
25973
|
}, [contextPicker?.entityTypes]);
|
|
25902
25974
|
const contextEntityTypes = contextPicker?.entityTypes;
|
|
25903
|
-
const resolveContextIcon =
|
|
25975
|
+
const resolveContextIcon = useMemo31(() => {
|
|
25904
25976
|
const byType = /* @__PURE__ */ new Map();
|
|
25905
25977
|
for (const t of contextEntityTypes ?? []) byType.set(t.type, t.icon);
|
|
25906
25978
|
return (item) => byType.get(item.type);
|
|
@@ -25973,7 +26045,7 @@ function EmbeddableChatInner({
|
|
|
25973
26045
|
navigatingAwayRef.current = true;
|
|
25974
26046
|
setIsOpen(false);
|
|
25975
26047
|
}, [setIsOpen]);
|
|
25976
|
-
const chatPanelHandle =
|
|
26048
|
+
const chatPanelHandle = useMemo31(
|
|
25977
26049
|
() => ({ closeChat: handleNavigationClose }),
|
|
25978
26050
|
[handleNavigationClose]
|
|
25979
26051
|
);
|
|
@@ -25987,14 +26059,14 @@ function EmbeddableChatInner({
|
|
|
25987
26059
|
}),
|
|
25988
26060
|
[discussRef, displayRef, resolvedBaseRoute, chipBasePlatform, extras]
|
|
25989
26061
|
);
|
|
25990
|
-
const mingoAssistantIcon =
|
|
25991
|
-
() => effectiveAssistantIcon ? /* @__PURE__ */
|
|
26062
|
+
const mingoAssistantIcon = useMemo31(
|
|
26063
|
+
() => effectiveAssistantIcon ? /* @__PURE__ */ jsx102(EntityIcon, { icon: effectiveAssistantIcon, size: 24 }) : /* @__PURE__ */ jsx102(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
|
|
25992
26064
|
[effectiveAssistantIcon]
|
|
25993
26065
|
);
|
|
25994
|
-
const [timestampCache] =
|
|
26066
|
+
const [timestampCache] = useState49(() => /* @__PURE__ */ new Map());
|
|
25995
26067
|
const guideUserName = activeMode === "guide" ? [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || identityUser?.name?.trim() || void 0 : void 0;
|
|
25996
26068
|
const guideUserAvatar = activeMode === "guide" ? identityUser?.avatarUrl?.trim() || void 0 : void 0;
|
|
25997
|
-
const messages =
|
|
26069
|
+
const messages = useMemo31(() => {
|
|
25998
26070
|
const options = { userName: guideUserName, userAvatar: guideUserAvatar, timestampCache };
|
|
25999
26071
|
const mapped = rawMessages.map((m) => mapHostMessage(m, options));
|
|
26000
26072
|
pruneTimestampCache(timestampCache, new Set(rawMessages.map((m) => m.id)));
|
|
@@ -26031,7 +26103,7 @@ function EmbeddableChatInner({
|
|
|
26031
26103
|
},
|
|
26032
26104
|
[sendMessage]
|
|
26033
26105
|
);
|
|
26034
|
-
const guideSuggestedActions =
|
|
26106
|
+
const guideSuggestedActions = useMemo31(() => {
|
|
26035
26107
|
if (effectiveQuickActions.length > 0) {
|
|
26036
26108
|
return effectiveQuickActions.map((qa) => ({
|
|
26037
26109
|
id: qa.id,
|
|
@@ -26092,7 +26164,7 @@ function EmbeddableChatInner({
|
|
|
26092
26164
|
});
|
|
26093
26165
|
const handleOpen = useCallback28(() => setIsOpen(true), [setIsOpen]);
|
|
26094
26166
|
useCloseOnNavigation(handleNavigationClose, null);
|
|
26095
|
-
|
|
26167
|
+
useEffect39(() => {
|
|
26096
26168
|
const handler = (e) => {
|
|
26097
26169
|
const detail = e.detail;
|
|
26098
26170
|
if (!detail || detail.source !== source) return;
|
|
@@ -26102,7 +26174,7 @@ function EmbeddableChatInner({
|
|
|
26102
26174
|
window.addEventListener("ask-ai:open-with-ref", handler);
|
|
26103
26175
|
return () => window.removeEventListener("ask-ai:open-with-ref", handler);
|
|
26104
26176
|
}, [source, discussRef, setIsOpen]);
|
|
26105
|
-
|
|
26177
|
+
useEffect39(() => {
|
|
26106
26178
|
const handler = (e) => {
|
|
26107
26179
|
const detail = e.detail;
|
|
26108
26180
|
if (!detail || detail.source !== source) return;
|
|
@@ -26123,11 +26195,11 @@ function EmbeddableChatInner({
|
|
|
26123
26195
|
if (!isQuickActionEmpty && quickActionPreview !== null) setQuickActionPreview(null);
|
|
26124
26196
|
const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
|
|
26125
26197
|
const sourceLabel = source === "flamingo" ? "Knowledge Base" : "Data Room";
|
|
26126
|
-
const enabledSet =
|
|
26198
|
+
const enabledSet = useMemo31(
|
|
26127
26199
|
() => effectiveEnabledRagTableIds ? new Set(effectiveEnabledRagTableIds) : null,
|
|
26128
26200
|
[effectiveEnabledRagTableIds]
|
|
26129
26201
|
);
|
|
26130
|
-
const chipCommands =
|
|
26202
|
+
const chipCommands = useMemo31(() => {
|
|
26131
26203
|
const out = [];
|
|
26132
26204
|
for (const cmd of commandsById.values()) {
|
|
26133
26205
|
if (cmd.displayOrder === void 0) continue;
|
|
@@ -26148,7 +26220,7 @@ function EmbeddableChatInner({
|
|
|
26148
26220
|
if (chatLoading && index === messages.length - 1) return null;
|
|
26149
26221
|
const { cited, uncited } = splitCitedSources(message.sources, flattenAssistantContent(message.content));
|
|
26150
26222
|
if (cited.length === 0 && uncited.length === 0) return null;
|
|
26151
|
-
return /* @__PURE__ */
|
|
26223
|
+
return /* @__PURE__ */ jsx102("div", { className: "pb-2", children: /* @__PURE__ */ jsx102(
|
|
26152
26224
|
SourceChips,
|
|
26153
26225
|
{
|
|
26154
26226
|
cited,
|
|
@@ -26162,10 +26234,10 @@ function EmbeddableChatInner({
|
|
|
26162
26234
|
},
|
|
26163
26235
|
[chatLoading, messages.length, resolvedBaseRoute, chipBasePlatform, handleNavigationClose, discussRef]
|
|
26164
26236
|
);
|
|
26165
|
-
const [portalHost, setPortalHost] =
|
|
26166
|
-
const [panelBoundary, setPanelBoundary] =
|
|
26167
|
-
const [canSplit, setCanSplit] =
|
|
26168
|
-
|
|
26237
|
+
const [portalHost, setPortalHost] = useState49(null);
|
|
26238
|
+
const [panelBoundary, setPanelBoundary] = useState49(null);
|
|
26239
|
+
const [canSplit, setCanSplit] = useState49(false);
|
|
26240
|
+
useEffect39(() => {
|
|
26169
26241
|
if (!panelBoundary || typeof ResizeObserver === "undefined") return void 0;
|
|
26170
26242
|
const ro = new ResizeObserver((entries) => {
|
|
26171
26243
|
const w = entries[0]?.contentRect?.width;
|
|
@@ -26178,9 +26250,9 @@ function EmbeddableChatInner({
|
|
|
26178
26250
|
setPanelBoundary(node);
|
|
26179
26251
|
if (node) setCanSplit(node.clientWidth >= SPLIT_MIN_WIDTH);
|
|
26180
26252
|
}, []);
|
|
26181
|
-
const [railCollapsed, setRailCollapsed] =
|
|
26253
|
+
const [railCollapsed, setRailCollapsed] = useState49(false);
|
|
26182
26254
|
const railStorageHydrated = useIsHydrated();
|
|
26183
|
-
const [railStorageRead, setRailStorageRead] =
|
|
26255
|
+
const [railStorageRead, setRailStorageRead] = useState49(false);
|
|
26184
26256
|
if (railStorageHydrated && !railStorageRead) {
|
|
26185
26257
|
setRailStorageRead(true);
|
|
26186
26258
|
try {
|
|
@@ -26198,13 +26270,13 @@ function EmbeddableChatInner({
|
|
|
26198
26270
|
return next;
|
|
26199
26271
|
});
|
|
26200
26272
|
}, []);
|
|
26201
|
-
const [railSearchOpen, setRailSearchOpen] =
|
|
26273
|
+
const [railSearchOpen, setRailSearchOpen] = useState49(false);
|
|
26202
26274
|
const splitEligible = historyListMode;
|
|
26203
26275
|
const wideMingo = splitEligible && canSplit && !previewMode;
|
|
26204
26276
|
const splitActive = wideMingo && !railCollapsed;
|
|
26205
26277
|
const railPresence = useRailPresence(splitActive);
|
|
26206
26278
|
const showWideHeader = wideMingo || railPresence.mounted;
|
|
26207
|
-
const [composeOpen, setComposeOpen] =
|
|
26279
|
+
const [composeOpen, setComposeOpen] = useState49(false);
|
|
26208
26280
|
if (hasConversation && composeOpen) setComposeOpen(false);
|
|
26209
26281
|
const isMingoMode = historyListMode;
|
|
26210
26282
|
const emptyListSkipped = mingoCaps.emptyListSkipsToCompose === true && dialogs.length === 0 && !dialogsInitialLoading && !mingoCaps.searchQuery;
|
|
@@ -26227,14 +26299,14 @@ function EmbeddableChatInner({
|
|
|
26227
26299
|
const handleNewChat = useCallback28(() => {
|
|
26228
26300
|
resetToNewChat();
|
|
26229
26301
|
}, [resetToNewChat]);
|
|
26230
|
-
const [pendingDraft, setPendingDraft] =
|
|
26231
|
-
const [seededDraft, setSeededDraft] =
|
|
26302
|
+
const [pendingDraft, setPendingDraft] = useState49(null);
|
|
26303
|
+
const [seededDraft, setSeededDraft] = useState49(null);
|
|
26232
26304
|
if (pendingDraft && seededDraft !== pendingDraft) {
|
|
26233
26305
|
setSeededDraft(pendingDraft);
|
|
26234
26306
|
setContextItems(pendingDraft.mentions);
|
|
26235
26307
|
}
|
|
26236
|
-
const appliedDraftRef =
|
|
26237
|
-
|
|
26308
|
+
const appliedDraftRef = useRef37(null);
|
|
26309
|
+
useEffect39(() => {
|
|
26238
26310
|
const draft = pendingDraft;
|
|
26239
26311
|
if (!draft || appliedDraftRef.current === draft) return;
|
|
26240
26312
|
const input = chatInputRef.current;
|
|
@@ -26307,13 +26379,13 @@ function EmbeddableChatInner({
|
|
|
26307
26379
|
onCopyLink: headerOnCopyLink,
|
|
26308
26380
|
onOpenArchive: headerOnOpenArchive
|
|
26309
26381
|
};
|
|
26310
|
-
const body = /* @__PURE__ */
|
|
26311
|
-
/* @__PURE__ */
|
|
26382
|
+
const body = /* @__PURE__ */ jsx102(PortalContainerContext.Provider, { value: portalHost, children: /* @__PURE__ */ jsxs77(CollisionBoundaryContext.Provider, { value: panelBoundary, children: [
|
|
26383
|
+
/* @__PURE__ */ jsx102(
|
|
26312
26384
|
"div",
|
|
26313
26385
|
{
|
|
26314
26386
|
ref: setPanelNode,
|
|
26315
26387
|
className: `flex h-full flex-col overflow-hidden transition-colors duration-200 ${archiveOpen && !splitActive || stackedListView ? "bg-ods-card" : "bg-ods-bg"} ${previewMode ? "pointer-events-none select-none" : ""}`,
|
|
26316
|
-
children: archiveOpen && !splitActive ? /* @__PURE__ */
|
|
26388
|
+
children: archiveOpen && !splitActive ? /* @__PURE__ */ jsx102("div", { className: "flex min-h-0 flex-1 flex-col duration-200 animate-in fade-in-0", children: /* @__PURE__ */ jsx102(
|
|
26317
26389
|
ChatArchivePage,
|
|
26318
26390
|
{
|
|
26319
26391
|
dialogs: archivedDialogs,
|
|
@@ -26342,15 +26414,15 @@ function EmbeddableChatInner({
|
|
|
26342
26414
|
// sub-`md` viewport would split the body yet drop to the mobile
|
|
26343
26415
|
// single-bar header (no rail search / collapse controls).
|
|
26344
26416
|
/* @__PURE__ */ jsxs77("div", { className: "flex h-14 w-full flex-shrink-0 overflow-hidden border-b border-ods-border bg-ods-card", children: [
|
|
26345
|
-
railPresence.mounted && /* @__PURE__ */
|
|
26417
|
+
railPresence.mounted && /* @__PURE__ */ jsx102(RailSlot, { active: railPresence.active, innerClassName: "flex overflow-hidden", children: archiveOpen ? (
|
|
26346
26418
|
// Archive open in the wide layout — the rail header
|
|
26347
26419
|
// turns into a "Chat Archive" back bar (the list itself
|
|
26348
26420
|
// renders in the rail below); the chat block is untouched.
|
|
26349
26421
|
// Back is a full-height leading cell, matching the other
|
|
26350
26422
|
// header cells (not a small inline chevron).
|
|
26351
26423
|
/* @__PURE__ */ jsxs77(Fragment34, { children: [
|
|
26352
|
-
/* @__PURE__ */
|
|
26353
|
-
/* @__PURE__ */
|
|
26424
|
+
/* @__PURE__ */ jsx102(ChatHeaderIconButton, { divider: "right", onClick: closeArchive, "aria-label": "Back to chats", children: /* @__PURE__ */ jsx102(Chevron02LeftIcon, { size: 24 }) }),
|
|
26425
|
+
/* @__PURE__ */ jsx102("div", { className: "flex min-w-0 flex-1 items-center px-[var(--spacing-system-mf)]", children: /* @__PURE__ */ jsx102("span", { className: "min-w-0 flex-1 truncate text-ods-text-primary text-h3", children: "Chat Archive" }) })
|
|
26354
26426
|
] })
|
|
26355
26427
|
) : (
|
|
26356
26428
|
// "Current Chats" rail header — title fills, then the
|
|
@@ -26358,7 +26430,7 @@ function EmbeddableChatInner({
|
|
|
26358
26430
|
// inline field takes over the title area in place
|
|
26359
26431
|
// (Figma 116:51217) and the magnifier toggle is hidden.
|
|
26360
26432
|
/* @__PURE__ */ jsxs77(Fragment34, { children: [
|
|
26361
|
-
railSearchOpen && mingoCaps.onSearchChange ? /* @__PURE__ */
|
|
26433
|
+
railSearchOpen && mingoCaps.onSearchChange ? /* @__PURE__ */ jsx102(
|
|
26362
26434
|
ChatHeaderSearchField,
|
|
26363
26435
|
{
|
|
26364
26436
|
initialValue: mingoCaps.searchQuery,
|
|
@@ -26366,22 +26438,22 @@ function EmbeddableChatInner({
|
|
|
26366
26438
|
onCollapse: () => setRailSearchOpen(false)
|
|
26367
26439
|
}
|
|
26368
26440
|
) : /* @__PURE__ */ jsxs77(Fragment34, { children: [
|
|
26369
|
-
/* @__PURE__ */
|
|
26370
|
-
mingoCaps.onSearchChange && /* @__PURE__ */
|
|
26441
|
+
/* @__PURE__ */ jsx102("div", { className: "flex min-w-0 flex-1 items-center px-[var(--spacing-system-mf)]", children: /* @__PURE__ */ jsx102("span", { className: "min-w-0 flex-1 truncate text-ods-text-primary text-h3", children: "Current Chats" }) }),
|
|
26442
|
+
mingoCaps.onSearchChange && /* @__PURE__ */ jsx102(
|
|
26371
26443
|
ChatHeaderIconButton,
|
|
26372
26444
|
{
|
|
26373
26445
|
onClick: () => setRailSearchOpen((o) => !o),
|
|
26374
26446
|
"aria-label": "Search chats",
|
|
26375
26447
|
"aria-pressed": railSearchOpen,
|
|
26376
|
-
children: /* @__PURE__ */
|
|
26448
|
+
children: /* @__PURE__ */ jsx102(SearchIcon, { size: 24 })
|
|
26377
26449
|
}
|
|
26378
26450
|
)
|
|
26379
26451
|
] }),
|
|
26380
|
-
headerOnOpenArchive && /* @__PURE__ */
|
|
26452
|
+
headerOnOpenArchive && /* @__PURE__ */ jsx102(ChatHeaderIconButton, { onClick: headerOnOpenArchive, "aria-label": "Chat archive", children: /* @__PURE__ */ jsx102(ClockHistoryIcon, { size: 24 }) })
|
|
26381
26453
|
] })
|
|
26382
26454
|
) }),
|
|
26383
26455
|
/* @__PURE__ */ jsxs77("div", { className: "flex min-w-0 flex-1", children: [
|
|
26384
|
-
/* @__PURE__ */
|
|
26456
|
+
/* @__PURE__ */ jsx102(
|
|
26385
26457
|
"button",
|
|
26386
26458
|
{
|
|
26387
26459
|
type: "button",
|
|
@@ -26389,17 +26461,17 @@ function EmbeddableChatInner({
|
|
|
26389
26461
|
"aria-label": splitActive ? "Collapse chat list" : "Show chat list",
|
|
26390
26462
|
"aria-pressed": !splitActive,
|
|
26391
26463
|
className: "flex size-14 shrink-0 items-center justify-center border-r border-ods-border text-ods-text-secondary transition-colors hover:bg-ods-bg-hover hover:text-ods-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-ods-accent",
|
|
26392
|
-
children: splitActive ? /* @__PURE__ */
|
|
26464
|
+
children: splitActive ? /* @__PURE__ */ jsx102(Arrow02RightIcon, { size: 24 }) : /* @__PURE__ */ jsx102(Arrow02LeftIcon, { size: 24 })
|
|
26393
26465
|
}
|
|
26394
26466
|
),
|
|
26395
26467
|
/* @__PURE__ */ jsxs77("div", { className: "flex min-w-0 flex-1 items-center gap-[var(--spacing-system-m)] px-[var(--spacing-system-mf)] py-[var(--spacing-system-sf)]", children: [
|
|
26396
26468
|
/* @__PURE__ */ jsxs77("div", { className: "flex min-w-0 flex-col", children: [
|
|
26397
|
-
/* @__PURE__ */
|
|
26398
|
-
headerPersonName && /* @__PURE__ */
|
|
26469
|
+
/* @__PURE__ */ jsx102("p", { className: "truncate leading-tight text-ods-text-primary text-h3", children: headerShowBack || isGuideEmpty ? headerTitle : freshConversationTitle }),
|
|
26470
|
+
headerPersonName && /* @__PURE__ */ jsx102("p", { className: "truncate leading-tight text-ods-text-secondary text-h6", children: headerPersonName })
|
|
26399
26471
|
] }),
|
|
26400
26472
|
headerAvatar ? (
|
|
26401
26473
|
// Owner avatar at the title cell's right edge (Figma 113:63273).
|
|
26402
|
-
/* @__PURE__ */
|
|
26474
|
+
/* @__PURE__ */ jsx102(
|
|
26403
26475
|
SquareAvatar,
|
|
26404
26476
|
{
|
|
26405
26477
|
variant: "round",
|
|
@@ -26414,17 +26486,17 @@ function EmbeddableChatInner({
|
|
|
26414
26486
|
)
|
|
26415
26487
|
) : null
|
|
26416
26488
|
] }),
|
|
26417
|
-
isViewingArchived && headerOnRestore && /* @__PURE__ */
|
|
26418
|
-
headerShowBack && !isViewingArchived && splitHeaderMenuItems.length > 0 && /* @__PURE__ */
|
|
26489
|
+
isViewingArchived && headerOnRestore && /* @__PURE__ */ jsx102(ChatHeaderIconButton, { onClick: headerOnRestore, "aria-label": "Unarchive chat", children: /* @__PURE__ */ jsx102(Refresh01LeftIcon, { size: 24 }) }),
|
|
26490
|
+
headerShowBack && !isViewingArchived && splitHeaderMenuItems.length > 0 && /* @__PURE__ */ jsx102(
|
|
26419
26491
|
ActionsMenuDropdown,
|
|
26420
26492
|
{
|
|
26421
26493
|
triggerAriaLabel: "Chat actions",
|
|
26422
26494
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
26423
26495
|
groups: [{ items: splitHeaderMenuItems }],
|
|
26424
|
-
customTrigger: /* @__PURE__ */
|
|
26496
|
+
customTrigger: /* @__PURE__ */ jsx102(ChatHeaderIconButton, { "aria-label": "Chat actions", children: /* @__PURE__ */ jsx102(Ellipsis01Icon, { size: 24 }) })
|
|
26425
26497
|
}
|
|
26426
26498
|
),
|
|
26427
|
-
/* @__PURE__ */
|
|
26499
|
+
/* @__PURE__ */ jsx102(ChatHeaderIconButton, { onClick: handleClose, "aria-label": "Close", children: /* @__PURE__ */ jsx102(XmarkIcon, { size: 24 }) })
|
|
26428
26500
|
] })
|
|
26429
26501
|
] })
|
|
26430
26502
|
) : (
|
|
@@ -26432,14 +26504,14 @@ function EmbeddableChatInner({
|
|
|
26432
26504
|
// guide, resolved into `narrowHeaderProps` above. (Wide layouts,
|
|
26433
26505
|
// including rail-collapsed, use the wide header above.) Embedded
|
|
26434
26506
|
// previews (hero demo tabs) force the compact bar via `compact`.
|
|
26435
|
-
/* @__PURE__ */
|
|
26507
|
+
/* @__PURE__ */ jsx102(ChatPanelHeader, { ...narrowHeaderProps, compact: previewMode })
|
|
26436
26508
|
),
|
|
26437
|
-
activeMode === "guide" && hasMingoMode && /* @__PURE__ */
|
|
26509
|
+
activeMode === "guide" && hasMingoMode && /* @__PURE__ */ jsx102(GuideModeBanner, { className: "duration-200 animate-in fade-in-0" }),
|
|
26438
26510
|
/* @__PURE__ */ jsxs77("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
|
|
26439
|
-
railPresence.mounted && /* @__PURE__ */
|
|
26511
|
+
railPresence.mounted && /* @__PURE__ */ jsx102(RailSlot, { active: railPresence.active, innerClassName: "flex flex-col min-h-0 bg-ods-card", children: archiveOpen ? (
|
|
26440
26512
|
// Archive list inside the rail (header lives in the split
|
|
26441
26513
|
// header's left cell above). Right chat block stays put.
|
|
26442
|
-
/* @__PURE__ */
|
|
26514
|
+
/* @__PURE__ */ jsx102(
|
|
26443
26515
|
ChatArchivePage,
|
|
26444
26516
|
{
|
|
26445
26517
|
embedded: true,
|
|
@@ -26453,7 +26525,7 @@ function EmbeddableChatInner({
|
|
|
26453
26525
|
}
|
|
26454
26526
|
}
|
|
26455
26527
|
)
|
|
26456
|
-
) : /* @__PURE__ */
|
|
26528
|
+
) : /* @__PURE__ */ jsx102(
|
|
26457
26529
|
MingoHistoryRail,
|
|
26458
26530
|
{
|
|
26459
26531
|
dialogs,
|
|
@@ -26477,11 +26549,11 @@ function EmbeddableChatInner({
|
|
|
26477
26549
|
onRetry: reloadDialogs
|
|
26478
26550
|
}
|
|
26479
26551
|
) }),
|
|
26480
|
-
/* @__PURE__ */
|
|
26552
|
+
/* @__PURE__ */ jsx102("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: stackedListView ? (
|
|
26481
26553
|
// Narrow "Current Chats" list (Figma 341:36190) — the default
|
|
26482
26554
|
// single-column view. No composer here; "Start New Chat" opens
|
|
26483
26555
|
// the compose view.
|
|
26484
|
-
/* @__PURE__ */
|
|
26556
|
+
/* @__PURE__ */ jsx102(
|
|
26485
26557
|
MingoHistoryRail,
|
|
26486
26558
|
{
|
|
26487
26559
|
className: "duration-200 animate-in fade-in-0",
|
|
@@ -26507,11 +26579,11 @@ function EmbeddableChatInner({
|
|
|
26507
26579
|
}
|
|
26508
26580
|
)
|
|
26509
26581
|
) : /* @__PURE__ */ jsxs77(Fragment34, { children: [
|
|
26510
|
-
/* @__PURE__ */
|
|
26582
|
+
/* @__PURE__ */ jsx102("div", { ref: galleryPanelRef, className: "flex min-h-0 flex-1 flex-col p-[var(--spacing-system-m)]", children: /* @__PURE__ */ jsx102(
|
|
26511
26583
|
"div",
|
|
26512
26584
|
{
|
|
26513
26585
|
className: "flex min-h-0 flex-1 flex-col duration-200 animate-in fade-in-0",
|
|
26514
|
-
children: hasConversation ? /* @__PURE__ */
|
|
26586
|
+
children: hasConversation ? /* @__PURE__ */ jsx102("div", { className: "flex min-h-0 flex-1 flex-col", children: messagesInitialLoading ? (
|
|
26515
26587
|
// Match the real list's `fullWidth` layout so swapping
|
|
26516
26588
|
// skeleton → bubbles doesn't shift the column. The panel
|
|
26517
26589
|
// wrapper above already pads (`p-[var(--spacing-system-m)]`),
|
|
@@ -26522,8 +26594,8 @@ function EmbeddableChatInner({
|
|
|
26522
26594
|
// skeleton overflows a short panel and grows its OWN
|
|
26523
26595
|
// scrollbar — ugly. `fill` top-anchors + clips overflow so
|
|
26524
26596
|
// it reads as "the whole panel is loading" and never scrolls.
|
|
26525
|
-
/* @__PURE__ */
|
|
26526
|
-
) : /* @__PURE__ */
|
|
26597
|
+
/* @__PURE__ */ jsx102(ChatMessageListSkeleton, { fullWidth: true, fill: previewMode, className: "flex-1" })
|
|
26598
|
+
) : /* @__PURE__ */ jsx102(
|
|
26527
26599
|
ChatMessageList,
|
|
26528
26600
|
{
|
|
26529
26601
|
messages,
|
|
@@ -26554,7 +26626,7 @@ function EmbeddableChatInner({
|
|
|
26554
26626
|
centred greeting + capability grid + Guide-chat promo +
|
|
26555
26627
|
quick-action chips. Guide mode keeps the slash-command
|
|
26556
26628
|
onboarding list below. */
|
|
26557
|
-
/* @__PURE__ */
|
|
26629
|
+
/* @__PURE__ */ jsx102(
|
|
26558
26630
|
MingoWelcome,
|
|
26559
26631
|
{
|
|
26560
26632
|
onStartGuideChat: effectiveModes.guide ? () => handleActiveModeChange("guide") : void 0,
|
|
@@ -26569,7 +26641,7 @@ function EmbeddableChatInner({
|
|
|
26569
26641
|
/* Figma node 7532:328214 — Guide-mode empty state: greeting
|
|
26570
26642
|
+ slash-command onboarding list share one scroll region,
|
|
26571
26643
|
with a pinned quick-action chip row above the composer. */
|
|
26572
|
-
/* @__PURE__ */
|
|
26644
|
+
/* @__PURE__ */ jsx102(
|
|
26573
26645
|
GuideWelcome,
|
|
26574
26646
|
{
|
|
26575
26647
|
subtitle: effectiveGreeting ?? void 0,
|
|
@@ -26586,7 +26658,7 @@ function EmbeddableChatInner({
|
|
|
26586
26658
|
onQuickActionHoverEnd: () => setQuickActionPreview(null),
|
|
26587
26659
|
agentSlug: activeAgentSlug,
|
|
26588
26660
|
children: (chipCommands.length > 0 || !commandsLoaded) && /* @__PURE__ */ jsxs77("div", { className: "shrink-0 overflow-hidden rounded-md border border-ods-border", children: [
|
|
26589
|
-
!commandsLoaded && chipCommands.length === 0 && SKELETON_ROW_VARIANTS.map((variant, i) => /* @__PURE__ */
|
|
26661
|
+
!commandsLoaded && chipCommands.length === 0 && SKELETON_ROW_VARIANTS.map((variant, i) => /* @__PURE__ */ jsx102(
|
|
26590
26662
|
MingoOnboardingCardSkeleton,
|
|
26591
26663
|
{
|
|
26592
26664
|
titleWidth: variant.titleWidth,
|
|
@@ -26604,10 +26676,10 @@ function EmbeddableChatInner({
|
|
|
26604
26676
|
label: action.label,
|
|
26605
26677
|
onClick: () => dispatchSlashCommandAction(action.id, cmdId, chatInputRef)
|
|
26606
26678
|
}));
|
|
26607
|
-
return /* @__PURE__ */
|
|
26679
|
+
return /* @__PURE__ */ jsx102(
|
|
26608
26680
|
MingoOnboardingCard,
|
|
26609
26681
|
{
|
|
26610
|
-
icon: /* @__PURE__ */
|
|
26682
|
+
icon: /* @__PURE__ */ jsx102(Icon, { size: 16 }),
|
|
26611
26683
|
title: label,
|
|
26612
26684
|
slashCommand: `/${cmdId}`,
|
|
26613
26685
|
description: cmd.description,
|
|
@@ -26623,7 +26695,7 @@ function EmbeddableChatInner({
|
|
|
26623
26695
|
},
|
|
26624
26696
|
contentViewKey
|
|
26625
26697
|
) }),
|
|
26626
|
-
/* @__PURE__ */
|
|
26698
|
+
/* @__PURE__ */ jsx102(
|
|
26627
26699
|
ChatAttachmentChipStrip,
|
|
26628
26700
|
{
|
|
26629
26701
|
attachments: stagedAttachments,
|
|
@@ -26631,7 +26703,7 @@ function EmbeddableChatInner({
|
|
|
26631
26703
|
disabled: chatLoading
|
|
26632
26704
|
}
|
|
26633
26705
|
),
|
|
26634
|
-
/* @__PURE__ */
|
|
26706
|
+
/* @__PURE__ */ jsx102(
|
|
26635
26707
|
ChatComposer,
|
|
26636
26708
|
{
|
|
26637
26709
|
archived: isViewingArchived,
|
|
@@ -26679,7 +26751,7 @@ function EmbeddableChatInner({
|
|
|
26679
26751
|
}
|
|
26680
26752
|
),
|
|
26681
26753
|
galleryModal,
|
|
26682
|
-
/* @__PURE__ */
|
|
26754
|
+
/* @__PURE__ */ jsx102(
|
|
26683
26755
|
ChatDialogModals,
|
|
26684
26756
|
{
|
|
26685
26757
|
renameTarget,
|
|
@@ -26693,15 +26765,15 @@ function EmbeddableChatInner({
|
|
|
26693
26765
|
onConfirmRestore: handleConfirmRestore
|
|
26694
26766
|
}
|
|
26695
26767
|
),
|
|
26696
|
-
/* @__PURE__ */
|
|
26768
|
+
/* @__PURE__ */ jsx102("div", { ref: setPortalHost, style: { display: "contents" } })
|
|
26697
26769
|
] }) });
|
|
26698
26770
|
const panel = shellLess ? /* @__PURE__ */ jsxs77(ChatPanelContext.Provider, { value: chatPanelHandle, children: [
|
|
26699
|
-
/* @__PURE__ */
|
|
26771
|
+
/* @__PURE__ */ jsx102(VisuallyHidden, { children: /* @__PURE__ */ jsxs77(DialogPrimitive2.Title, { children: [
|
|
26700
26772
|
sourceLabel,
|
|
26701
26773
|
" AI Assistant"
|
|
26702
26774
|
] }) }),
|
|
26703
26775
|
body
|
|
26704
|
-
] }) : /* @__PURE__ */
|
|
26776
|
+
] }) : /* @__PURE__ */ jsx102(Drawer, { open: isOpen, onOpenChange: (o) => !o && handleClose(), children: /* @__PURE__ */ jsx102(ChatPanelContext.Provider, { value: chatPanelHandle, children: /* @__PURE__ */ jsxs77(
|
|
26705
26777
|
DrawerContent,
|
|
26706
26778
|
{
|
|
26707
26779
|
side: "right",
|
|
@@ -26709,14 +26781,14 @@ function EmbeddableChatInner({
|
|
|
26709
26781
|
resizable: true,
|
|
26710
26782
|
minSize: 480,
|
|
26711
26783
|
maxSize: 1600,
|
|
26712
|
-
defaultSize:
|
|
26784
|
+
defaultSize: historyListMode ? drawerDefaultWidthWithRail : drawerDefaultWidthWithoutRail,
|
|
26713
26785
|
storageKey: DRAWER_WIDTH_KEY,
|
|
26714
26786
|
resizeAriaLabel: "Resize chat panel",
|
|
26715
26787
|
overlayClassName: "mingo-chat-overlay",
|
|
26716
26788
|
"aria-describedby": void 0,
|
|
26717
26789
|
className: "mingo-chat-content w-screen !bg-ods-bg shadow-2xl focus:outline-none focus-visible:outline-none md:w-auto",
|
|
26718
26790
|
children: [
|
|
26719
|
-
/* @__PURE__ */
|
|
26791
|
+
/* @__PURE__ */ jsx102(VisuallyHidden, { children: /* @__PURE__ */ jsxs77(DialogPrimitive2.Title, { children: [
|
|
26720
26792
|
sourceLabel,
|
|
26721
26793
|
" AI Assistant"
|
|
26722
26794
|
] }) }),
|
|
@@ -26725,16 +26797,16 @@ function EmbeddableChatInner({
|
|
|
26725
26797
|
}
|
|
26726
26798
|
) }) });
|
|
26727
26799
|
return /* @__PURE__ */ jsxs77(Fragment34, { children: [
|
|
26728
|
-
showInternalTrigger && !shellLess && /* @__PURE__ */
|
|
26800
|
+
showInternalTrigger && !shellLess && /* @__PURE__ */ jsx102(
|
|
26729
26801
|
"div",
|
|
26730
26802
|
{
|
|
26731
26803
|
"aria-hidden": isOpen,
|
|
26732
26804
|
className: `pointer-events-none sticky bottom-0 z-[9990] h-0 ${isOpen ? "opacity-0" : "opacity-100"}`,
|
|
26733
|
-
children: /* @__PURE__ */
|
|
26805
|
+
children: /* @__PURE__ */ jsx102("div", { className: "absolute bottom-4 right-4 md:bottom-6 md:right-6", children: /* @__PURE__ */ jsx102(
|
|
26734
26806
|
Button,
|
|
26735
26807
|
{
|
|
26736
26808
|
onClick: handleOpen,
|
|
26737
|
-
leftIcon: /* @__PURE__ */
|
|
26809
|
+
leftIcon: /* @__PURE__ */ jsx102(MingoIcon, { className: "h-5 w-5", color: "currentColor" }),
|
|
26738
26810
|
tabIndex: isOpen ? -1 : 0,
|
|
26739
26811
|
className: `pointer-events-auto !w-auto shadow-lg ${isOpen ? "!pointer-events-none" : ""}`,
|
|
26740
26812
|
children: "Ask AI"
|
|
@@ -26747,7 +26819,7 @@ function EmbeddableChatInner({
|
|
|
26747
26819
|
}
|
|
26748
26820
|
|
|
26749
26821
|
// src/components/chat/proxy-credentials-panel.tsx
|
|
26750
|
-
import { useMemo as
|
|
26822
|
+
import { useMemo as useMemo32, useState as useState50 } from "react";
|
|
26751
26823
|
|
|
26752
26824
|
// src/components/ui/field.tsx
|
|
26753
26825
|
import { useId as useId3 } from "react";
|
|
@@ -26755,11 +26827,11 @@ import { useId as useId3 } from "react";
|
|
|
26755
26827
|
// src/components/ui/info-hint.tsx
|
|
26756
26828
|
import { Info as Info3 } from "lucide-react";
|
|
26757
26829
|
import { useId as useId2 } from "react";
|
|
26758
|
-
import { jsx as
|
|
26830
|
+
import { jsx as jsx103, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
26759
26831
|
function InfoHint({ children, label, side = "top", className }) {
|
|
26760
26832
|
const describedById = useId2();
|
|
26761
26833
|
return /* @__PURE__ */ jsxs78("span", { className: cn("inline-flex shrink-0 items-center", className), children: [
|
|
26762
|
-
/* @__PURE__ */
|
|
26834
|
+
/* @__PURE__ */ jsx103(
|
|
26763
26835
|
FloatingTooltip,
|
|
26764
26836
|
{
|
|
26765
26837
|
content: children,
|
|
@@ -26767,7 +26839,7 @@ function InfoHint({ children, label, side = "top", className }) {
|
|
|
26767
26839
|
as: "span",
|
|
26768
26840
|
triggerClassName: "inline-flex shrink-0 items-center",
|
|
26769
26841
|
className: "text-h6",
|
|
26770
|
-
children: /* @__PURE__ */
|
|
26842
|
+
children: /* @__PURE__ */ jsx103(
|
|
26771
26843
|
Button,
|
|
26772
26844
|
{
|
|
26773
26845
|
type: "button",
|
|
@@ -26777,17 +26849,17 @@ function InfoHint({ children, label, side = "top", className }) {
|
|
|
26777
26849
|
"aria-label": label ? `About ${label}` : "More information",
|
|
26778
26850
|
"aria-describedby": describedById,
|
|
26779
26851
|
className: "text-ods-text-secondary hover:text-ods-text-primary",
|
|
26780
|
-
children: /* @__PURE__ */
|
|
26852
|
+
children: /* @__PURE__ */ jsx103(Info3, { className: "h-3.5 w-3.5 shrink-0" })
|
|
26781
26853
|
}
|
|
26782
26854
|
)
|
|
26783
26855
|
}
|
|
26784
26856
|
),
|
|
26785
|
-
/* @__PURE__ */
|
|
26857
|
+
/* @__PURE__ */ jsx103("span", { id: describedById, className: "sr-only", children })
|
|
26786
26858
|
] });
|
|
26787
26859
|
}
|
|
26788
26860
|
|
|
26789
26861
|
// src/components/ui/field.tsx
|
|
26790
|
-
import { jsx as
|
|
26862
|
+
import { jsx as jsx104, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
26791
26863
|
function Field({ label, hint, required, children, error, labelExtras, labelEnd }) {
|
|
26792
26864
|
const controlId = useId3();
|
|
26793
26865
|
const errorId = `${controlId}-error`;
|
|
@@ -26801,19 +26873,19 @@ function Field({ label, hint, required, children, error, labelExtras, labelEnd }
|
|
|
26801
26873
|
/* @__PURE__ */ jsxs79("div", { className: "flex items-center gap-1.5", children: [
|
|
26802
26874
|
/* @__PURE__ */ jsxs79(Label, { htmlFor: controlId, children: [
|
|
26803
26875
|
label,
|
|
26804
|
-
required && /* @__PURE__ */
|
|
26876
|
+
required && /* @__PURE__ */ jsx104(RequiredMark, {})
|
|
26805
26877
|
] }),
|
|
26806
|
-
hint && /* @__PURE__ */
|
|
26878
|
+
hint && /* @__PURE__ */ jsx104(InfoHint, { label, children: hint }),
|
|
26807
26879
|
labelExtras,
|
|
26808
|
-
labelEnd && /* @__PURE__ */
|
|
26880
|
+
labelEnd && /* @__PURE__ */ jsx104("span", { className: "ml-auto shrink-0", children: labelEnd })
|
|
26809
26881
|
] }),
|
|
26810
|
-
/* @__PURE__ */
|
|
26811
|
-
error && /* @__PURE__ */
|
|
26882
|
+
/* @__PURE__ */ jsx104("div", { className: "pt-[var(--spacing-system-xxs)]", children: children(renderProps) }),
|
|
26883
|
+
error && /* @__PURE__ */ jsx104("p", { id: errorId, role: "alert", className: "text-ods-error text-h6", children: error })
|
|
26812
26884
|
] });
|
|
26813
26885
|
}
|
|
26814
26886
|
|
|
26815
26887
|
// src/components/chat/proxy-credentials-panel.tsx
|
|
26816
|
-
import { jsx as
|
|
26888
|
+
import { jsx as jsx105, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
26817
26889
|
var httpsOnly = (label) => (value) => /^https:\/\//i.test(value) ? null : `${label} must start with https://`;
|
|
26818
26890
|
var OPTIONAL_FIELD_COPY = {
|
|
26819
26891
|
avatarUrl: {
|
|
@@ -26866,20 +26938,20 @@ function maskKey(key) {
|
|
|
26866
26938
|
return key.length - prefix.length <= 8 ? `${prefix}\u2022\u2022\u2022\u2022` : `${prefix}\u2026${key.slice(-4)}`;
|
|
26867
26939
|
}
|
|
26868
26940
|
function HeaderName({ children }) {
|
|
26869
|
-
return /* @__PURE__ */
|
|
26941
|
+
return /* @__PURE__ */ jsx105("code", { className: "font-mono text-ods-text-secondary text-h6", children });
|
|
26870
26942
|
}
|
|
26871
26943
|
function Section({ title, description, children }) {
|
|
26872
26944
|
return /* @__PURE__ */ jsxs80("section", { className: "space-y-[var(--spacing-system-sf)]", children: [
|
|
26873
26945
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
26874
|
-
/* @__PURE__ */
|
|
26875
|
-
/* @__PURE__ */
|
|
26946
|
+
/* @__PURE__ */ jsx105("h3", { className: "text-ods-text-primary text-h4", children: title }),
|
|
26947
|
+
/* @__PURE__ */ jsx105("p", { className: "text-ods-text-secondary text-h6", children: description })
|
|
26876
26948
|
] }),
|
|
26877
26949
|
children
|
|
26878
26950
|
] });
|
|
26879
26951
|
}
|
|
26880
26952
|
function ProxyCredentialsPanel({ description }) {
|
|
26881
26953
|
const hydrated = useIsHydrated();
|
|
26882
|
-
return /* @__PURE__ */
|
|
26954
|
+
return /* @__PURE__ */ jsx105(
|
|
26883
26955
|
ProxyCredentialsForm,
|
|
26884
26956
|
{
|
|
26885
26957
|
description,
|
|
@@ -26890,13 +26962,13 @@ function ProxyCredentialsPanel({ description }) {
|
|
|
26890
26962
|
}
|
|
26891
26963
|
function ProxyCredentialsForm({ description, saved }) {
|
|
26892
26964
|
const { secret: savedSecret, email: savedEmail, ...savedOptional } = saved ?? { email: "", secret: "" };
|
|
26893
|
-
const [secret, setSecret] =
|
|
26894
|
-
const [email, setEmail] =
|
|
26895
|
-
const [optional, setOptional] =
|
|
26896
|
-
const [savedKeyTail, setSavedKeyTail] =
|
|
26897
|
-
const [activeEmail, setActiveEmail] =
|
|
26898
|
-
const [status, setStatus] =
|
|
26899
|
-
const errors =
|
|
26965
|
+
const [secret, setSecret] = useState50("");
|
|
26966
|
+
const [email, setEmail] = useState50(savedEmail);
|
|
26967
|
+
const [optional, setOptional] = useState50(savedOptional);
|
|
26968
|
+
const [savedKeyTail, setSavedKeyTail] = useState50(savedSecret ? maskKey(savedSecret) : null);
|
|
26969
|
+
const [activeEmail, setActiveEmail] = useState50(savedEmail || null);
|
|
26970
|
+
const [status, setStatus] = useState50("");
|
|
26971
|
+
const errors = useMemo32(() => {
|
|
26900
26972
|
const out = {};
|
|
26901
26973
|
for (const { field } of EMBED_PROXY_OPTIONAL_HEADERS) {
|
|
26902
26974
|
const value = optional[field]?.trim();
|
|
@@ -26939,28 +27011,28 @@ function ProxyCredentialsForm({ description, saved }) {
|
|
|
26939
27011
|
setStatus("Cleared. Requests use the session again.");
|
|
26940
27012
|
};
|
|
26941
27013
|
const setField = (field, value) => setOptional((prev) => ({ ...prev, [field]: value }));
|
|
26942
|
-
return /* @__PURE__ */
|
|
27014
|
+
return /* @__PURE__ */ jsx105(Card, { children: /* @__PURE__ */ jsxs80(CardContent, { className: "space-y-[var(--spacing-system-lf)] p-[var(--spacing-system-mf)]", children: [
|
|
26943
27015
|
/* @__PURE__ */ jsxs80("header", { className: "flex flex-col gap-[var(--spacing-system-sf)] sm:flex-row sm:items-start sm:justify-between", children: [
|
|
26944
27016
|
/* @__PURE__ */ jsxs80("div", { children: [
|
|
26945
|
-
/* @__PURE__ */
|
|
26946
|
-
description && /* @__PURE__ */
|
|
27017
|
+
/* @__PURE__ */ jsx105("h2", { className: "text-ods-text-primary text-h3", children: "Proxy credentials" }),
|
|
27018
|
+
description && /* @__PURE__ */ jsx105("p", { className: "text-ods-text-secondary text-h6", children: description })
|
|
26947
27019
|
] }),
|
|
26948
|
-
activeEmail && /* @__PURE__ */
|
|
27020
|
+
activeEmail && /* @__PURE__ */ jsx105("div", { className: "self-start", children: /* @__PURE__ */ jsx105(StatusBadge, { singleLine: true, colorScheme: "success", text: `Active: ${activeEmail}` }) })
|
|
26949
27021
|
] }),
|
|
26950
|
-
/* @__PURE__ */
|
|
27022
|
+
/* @__PURE__ */ jsx105(
|
|
26951
27023
|
Section,
|
|
26952
27024
|
{
|
|
26953
27025
|
title: "Credentials",
|
|
26954
27026
|
description: "A platform API key minted in /admin/api-keys for this platform, and the user to act as.",
|
|
26955
27027
|
children: /* @__PURE__ */ jsxs80("div", { className: "grid grid-cols-1 gap-[var(--spacing-system-sf)] md:grid-cols-2", children: [
|
|
26956
|
-
/* @__PURE__ */
|
|
27028
|
+
/* @__PURE__ */ jsx105(
|
|
26957
27029
|
Field,
|
|
26958
27030
|
{
|
|
26959
27031
|
label: "Platform API key",
|
|
26960
27032
|
required: true,
|
|
26961
27033
|
hint: "A SERVICE key may act as anyone; a personal key only as its owner.",
|
|
26962
|
-
labelEnd: /* @__PURE__ */
|
|
26963
|
-
children: (props) => /* @__PURE__ */
|
|
27034
|
+
labelEnd: /* @__PURE__ */ jsx105(HeaderName, { children: "Authorization" }),
|
|
27035
|
+
children: (props) => /* @__PURE__ */ jsx105(
|
|
26964
27036
|
Input,
|
|
26965
27037
|
{
|
|
26966
27038
|
...props,
|
|
@@ -26974,14 +27046,14 @@ function ProxyCredentialsForm({ description, saved }) {
|
|
|
26974
27046
|
)
|
|
26975
27047
|
}
|
|
26976
27048
|
),
|
|
26977
|
-
/* @__PURE__ */
|
|
27049
|
+
/* @__PURE__ */ jsx105(
|
|
26978
27050
|
Field,
|
|
26979
27051
|
{
|
|
26980
27052
|
label: "Act as",
|
|
26981
27053
|
required: true,
|
|
26982
27054
|
hint: "The end user the requests run as.",
|
|
26983
|
-
labelEnd: /* @__PURE__ */
|
|
26984
|
-
children: (props) => /* @__PURE__ */
|
|
27055
|
+
labelEnd: /* @__PURE__ */ jsx105(HeaderName, { children: "X-Chat-Act-As" }),
|
|
27056
|
+
children: (props) => /* @__PURE__ */ jsx105(
|
|
26985
27057
|
Input,
|
|
26986
27058
|
{
|
|
26987
27059
|
...props,
|
|
@@ -26998,16 +27070,16 @@ function ProxyCredentialsForm({ description, saved }) {
|
|
|
26998
27070
|
] })
|
|
26999
27071
|
}
|
|
27000
27072
|
),
|
|
27001
|
-
GROUPS.map((group) => /* @__PURE__ */
|
|
27073
|
+
GROUPS.map((group) => /* @__PURE__ */ jsx105(Section, { title: group.title, description: group.description, children: /* @__PURE__ */ jsx105("div", { className: "grid grid-cols-1 gap-[var(--spacing-system-sf)] md:grid-cols-2", children: EMBED_PROXY_OPTIONAL_HEADERS.filter((row) => row.group === group.id).map(({ field, header }) => {
|
|
27002
27074
|
const copy = OPTIONAL_FIELD_COPY[field];
|
|
27003
|
-
return /* @__PURE__ */
|
|
27075
|
+
return /* @__PURE__ */ jsx105(
|
|
27004
27076
|
Field,
|
|
27005
27077
|
{
|
|
27006
27078
|
label: copy.label,
|
|
27007
27079
|
hint: copy.hint,
|
|
27008
27080
|
error: errors[field] ?? null,
|
|
27009
|
-
labelEnd: /* @__PURE__ */
|
|
27010
|
-
children: (props) => /* @__PURE__ */
|
|
27081
|
+
labelEnd: /* @__PURE__ */ jsx105(HeaderName, { children: header }),
|
|
27082
|
+
children: (props) => /* @__PURE__ */ jsx105(
|
|
27011
27083
|
Input,
|
|
27012
27084
|
{
|
|
27013
27085
|
...props,
|
|
@@ -27023,18 +27095,18 @@ function ProxyCredentialsForm({ description, saved }) {
|
|
|
27023
27095
|
field
|
|
27024
27096
|
);
|
|
27025
27097
|
}) }) }, group.id)),
|
|
27026
|
-
/* @__PURE__ */
|
|
27098
|
+
/* @__PURE__ */ jsx105(Section, { title: "Headers sent", description: "What the next chat or MCP request carries, from the form as typed.", children: /* @__PURE__ */ jsx105("div", { className: "rounded-md border border-ods-border bg-ods-bg p-[var(--spacing-system-sf)]", children: preview.length ? /* @__PURE__ */ jsx105("dl", { className: "space-y-[var(--spacing-system-xxs)] font-mono text-h6", children: preview.map(([name, value]) => /* @__PURE__ */ jsxs80("div", { className: "flex flex-wrap gap-x-[var(--spacing-system-xsf)]", children: [
|
|
27027
27099
|
/* @__PURE__ */ jsxs80("dt", { className: "text-ods-text-secondary", children: [
|
|
27028
27100
|
name,
|
|
27029
27101
|
":"
|
|
27030
27102
|
] }),
|
|
27031
|
-
/* @__PURE__ */
|
|
27032
|
-
] }, name)) }) : /* @__PURE__ */
|
|
27103
|
+
/* @__PURE__ */ jsx105("dd", { className: "break-all text-ods-text-primary", children: value })
|
|
27104
|
+
] }, name)) }) : /* @__PURE__ */ jsx105("p", { className: "text-ods-text-secondary text-h6", children: "No proxy headers: requests use the session." }) }) }),
|
|
27033
27105
|
/* @__PURE__ */ jsxs80("div", { className: "flex flex-wrap items-center justify-between gap-[var(--spacing-system-sf)]", children: [
|
|
27034
|
-
/* @__PURE__ */
|
|
27106
|
+
/* @__PURE__ */ jsx105("span", { className: "text-ods-text-secondary text-h6", children: status }),
|
|
27035
27107
|
/* @__PURE__ */ jsxs80("div", { className: "flex gap-[var(--spacing-system-xsf)]", children: [
|
|
27036
|
-
/* @__PURE__ */
|
|
27037
|
-
/* @__PURE__ */
|
|
27108
|
+
/* @__PURE__ */ jsx105(Button, { variant: "outline", onClick: clear, disabled: !activeEmail && !secret && !email, children: "Clear" }),
|
|
27109
|
+
/* @__PURE__ */ jsx105(Button, { onClick: save, disabled: !canSave, children: "Save" })
|
|
27038
27110
|
] })
|
|
27039
27111
|
] })
|
|
27040
27112
|
] }) });
|
|
@@ -27095,6 +27167,8 @@ export {
|
|
|
27095
27167
|
ModalHeader,
|
|
27096
27168
|
ModalTitle,
|
|
27097
27169
|
ModalFooter,
|
|
27170
|
+
useResizablePanelSize,
|
|
27171
|
+
PanelResizeHandle,
|
|
27098
27172
|
OVERLAY_BACKDROP_CLASS,
|
|
27099
27173
|
Drawer,
|
|
27100
27174
|
DrawerTrigger,
|