@opengeni/react 0.44.3 → 0.44.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/chunk-22KP6LR5.js +31 -0
- package/dist/{chunk-TK7G6XLT.js.map → chunk-22KP6LR5.js.map} +1 -1
- package/dist/{chunk-SXIQK54Z.js → chunk-6EDV6YFE.js} +8 -8
- package/dist/{chunk-SXIQK54Z.js.map → chunk-6EDV6YFE.js.map} +1 -1
- package/dist/{chunk-U6K24XQD.js → chunk-EHSYZ4KP.js} +37 -16
- package/dist/chunk-EHSYZ4KP.js.map +1 -0
- package/dist/chunk-JB5725BI.js +48 -0
- package/dist/chunk-JB5725BI.js.map +1 -0
- package/dist/{chunk-QQRM3DO3.js → chunk-L3EWO3UK.js} +6 -6
- package/dist/{chunk-QQRM3DO3.js.map → chunk-L3EWO3UK.js.map} +1 -1
- package/dist/{chunk-YNYIAYXQ.js → chunk-LYRJUU5V.js} +23 -23
- package/dist/chunk-LYRJUU5V.js.map +1 -0
- package/dist/{chunk-ATSTR5P3.js → chunk-U3CSCMWA.js} +5 -49
- package/dist/chunk-U3CSCMWA.js.map +1 -0
- package/dist/{chunk-YDNWMKXO.js → chunk-VCBFUSUZ.js} +4 -4
- package/dist/chunk-VCBFUSUZ.js.map +1 -0
- package/dist/components/model-policy-picker.d.ts +10 -1
- package/dist/composer.js +5 -4
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/machines.js +2 -2
- package/dist/{queue-surface-implementation-THPAKGMD.js → queue-surface-implementation-J4XJFKRW.js} +41 -26
- package/dist/queue-surface-implementation-J4XJFKRW.js.map +1 -0
- package/dist/realtime/dropdown-menu.d.ts +4 -4
- package/dist/realtime.js +58 -20
- package/dist/realtime.js.map +1 -1
- package/dist/session-ui.js +5 -4
- package/package.json +1 -1
- package/src/components/composer.tsx +3 -3
- package/src/components/enrollment-device-flow.tsx +2 -2
- package/src/components/message-timeline.tsx +15 -15
- package/src/components/model-policy-picker.tsx +47 -14
- package/src/components/queue-surface-implementation.tsx +28 -18
- package/src/components/queue-surface-state.tsx +3 -3
- package/src/components/queue-surface.tsx +2 -2
- package/src/components/session-status.tsx +1 -1
- package/src/lib/cn.ts +14 -1
- package/src/lib/use-portal-token-style.ts +1 -1
- package/src/provider.tsx +4 -4
- package/src/realtime/dropdown-menu.tsx +51 -8
- package/src/realtime/realtime-control.tsx +2 -2
- package/styles/index.css +91 -11
- package/styles/tokens.css +61 -0
- package/dist/chunk-ATSTR5P3.js.map +0 -1
- package/dist/chunk-TK7G6XLT.js +0 -18
- package/dist/chunk-U6K24XQD.js.map +0 -1
- package/dist/chunk-YDNWMKXO.js.map +0 -1
- package/dist/chunk-YNYIAYXQ.js.map +0 -1
- package/dist/queue-surface-implementation-THPAKGMD.js.map +0 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
usePortalTokenStyle
|
|
3
|
+
} from "./chunk-JB5725BI.js";
|
|
1
4
|
import {
|
|
2
5
|
cn
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-22KP6LR5.js";
|
|
4
7
|
|
|
5
8
|
// src/components/tooltip.tsx
|
|
6
9
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
@@ -9,52 +12,6 @@ import {
|
|
|
9
12
|
useContext,
|
|
10
13
|
useRef
|
|
11
14
|
} from "react";
|
|
12
|
-
|
|
13
|
-
// src/lib/use-portal-token-style.ts
|
|
14
|
-
import { useEffect, useState } from "react";
|
|
15
|
-
function usePortalTokenStyle(sourceRef) {
|
|
16
|
-
const [style, setStyle] = useState({});
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
const source = sourceRef.current;
|
|
19
|
-
if (!source || typeof MutationObserver === "undefined") return;
|
|
20
|
-
let signature = "";
|
|
21
|
-
const sync = () => {
|
|
22
|
-
const computed = getComputedStyle(source);
|
|
23
|
-
const next = { colorScheme: computed.colorScheme };
|
|
24
|
-
for (let index = 0; index < computed.length; index += 1) {
|
|
25
|
-
const property = computed.item(index);
|
|
26
|
-
if (!property.startsWith("--og-")) continue;
|
|
27
|
-
next[property] = computed.getPropertyValue(property);
|
|
28
|
-
}
|
|
29
|
-
const nextSignature = JSON.stringify(next);
|
|
30
|
-
if (nextSignature !== signature) {
|
|
31
|
-
signature = nextSignature;
|
|
32
|
-
setStyle(next);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
const observers = [];
|
|
36
|
-
let ancestor = source;
|
|
37
|
-
while (ancestor) {
|
|
38
|
-
const observer = new MutationObserver(sync);
|
|
39
|
-
observer.observe(ancestor, {
|
|
40
|
-
attributes: true,
|
|
41
|
-
attributeFilter: ["class", "data-og-theme", "style"]
|
|
42
|
-
});
|
|
43
|
-
observers.push(observer);
|
|
44
|
-
ancestor = ancestor.parentElement;
|
|
45
|
-
}
|
|
46
|
-
const colorScheme = window.matchMedia?.("(prefers-color-scheme: dark)");
|
|
47
|
-
colorScheme?.addEventListener?.("change", sync);
|
|
48
|
-
sync();
|
|
49
|
-
return () => {
|
|
50
|
-
for (const observer of observers) observer.disconnect();
|
|
51
|
-
colorScheme?.removeEventListener?.("change", sync);
|
|
52
|
-
};
|
|
53
|
-
}, [sourceRef]);
|
|
54
|
-
return style;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// src/components/tooltip.tsx
|
|
58
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
59
16
|
var TooltipSourceContext = createContext(null);
|
|
60
17
|
function TooltipProvider({
|
|
@@ -129,10 +86,9 @@ function TooltipContent({
|
|
|
129
86
|
}
|
|
130
87
|
|
|
131
88
|
export {
|
|
132
|
-
usePortalTokenStyle,
|
|
133
89
|
TooltipProvider,
|
|
134
90
|
Tooltip,
|
|
135
91
|
TooltipTrigger,
|
|
136
92
|
TooltipContent
|
|
137
93
|
};
|
|
138
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-U3CSCMWA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/tooltip.tsx"],"sourcesContent":["/**\n * Token-styled Radix tooltip — SDK counterpart to apps/web `components/ui/tooltip`.\n * Portals copy `--og-*` tokens so embeds keep the host theme outside `.og-root`.\n *\n * Background/foreground are applied as inline styles (not only Tailwind\n * utilities): `.og-root` sets `color: var(--og-color-fg)` after utilities in the\n * consumer CSS cascade, which would otherwise paint light-on-light inverted\n * tips and look like a blank white bubble.\n */\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\";\nimport {\n createContext,\n useContext,\n useRef,\n type ComponentProps,\n type CSSProperties,\n type RefObject,\n} from \"react\";\n\nimport { cn } from \"../lib/cn\";\nimport { usePortalTokenStyle } from \"../lib/use-portal-token-style\";\n\nconst TooltipSourceContext = createContext<RefObject<HTMLElement | null> | null>(null);\n\nfunction TooltipProvider({\n delayDuration = 300,\n ...props\n}: ComponentProps<typeof TooltipPrimitive.Provider>) {\n return <TooltipPrimitive.Provider delayDuration={delayDuration} {...props} />;\n}\n\nfunction Tooltip({ children, ...props }: ComponentProps<typeof TooltipPrimitive.Root>) {\n const sourceRef = useRef<HTMLElement | null>(null);\n return (\n <TooltipSourceContext.Provider value={sourceRef}>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props}>\n {children}\n </TooltipPrimitive.Root>\n </TooltipSourceContext.Provider>\n );\n}\n\nfunction TooltipTrigger({\n asChild = true,\n ...props\n}: ComponentProps<typeof TooltipPrimitive.Trigger>) {\n const sourceRef = useContext(TooltipSourceContext);\n return (\n <TooltipPrimitive.Trigger\n data-slot=\"tooltip-trigger\"\n asChild={asChild}\n ref={(node) => {\n if (sourceRef) sourceRef.current = node;\n }}\n {...props}\n />\n );\n}\n\nconst tooltipSurfaceStyle: CSSProperties = {\n backgroundColor: \"var(--og-color-fg)\",\n color: \"var(--og-color-bg)\",\n};\n\nfunction TooltipContent({\n className,\n sideOffset = 6,\n children,\n style,\n ...props\n}: ComponentProps<typeof TooltipPrimitive.Content>) {\n const sourceRef = useContext(TooltipSourceContext);\n const fallbackRef = useRef<HTMLElement | null>(null);\n const portalStyle = usePortalTokenStyle(sourceRef ?? fallbackRef);\n\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"og-root z-50 w-fit max-w-xs origin-[var(--radix-tooltip-content-transform-origin)]\",\n \"rounded-og-md px-2.5 py-1.5 text-og-xs leading-4 text-balance shadow-og-md\",\n \"animate-og-enter data-[state=closed]:opacity-0 data-[state=closed]:transition-opacity\",\n className,\n )}\n style={{ ...portalStyle, ...tooltipSurfaceStyle, ...style }}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow\n className=\"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\"\n style={{\n backgroundColor: \"var(--og-color-fg)\",\n fill: \"var(--og-color-fg)\",\n }}\n />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n"],"mappings":";;;;;;;;AASA,SAAS,WAAW,wBAAwB;AAC5C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAWE,cAiDH,YAjDG;AANT,IAAM,uBAAuB,cAAoD,IAAI;AAErF,SAAS,gBAAgB;AAAA,EACvB,gBAAgB;AAAA,EAChB,GAAG;AACL,GAAqD;AACnD,SAAO,oBAAC,iBAAiB,UAAjB,EAA0B,eAA+B,GAAG,OAAO;AAC7E;AAEA,SAAS,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAiD;AACrF,QAAM,YAAY,OAA2B,IAAI;AACjD,SACE,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,WACpC,8BAAC,iBAAiB,MAAjB,EAAsB,aAAU,WAAW,GAAG,OAC5C,UACH,GACF;AAEJ;AAEA,SAAS,eAAe;AAAA,EACtB,UAAU;AAAA,EACV,GAAG;AACL,GAAoD;AAClD,QAAM,YAAY,WAAW,oBAAoB;AACjD,SACE;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA,KAAK,CAAC,SAAS;AACb,YAAI,UAAW,WAAU,UAAU;AAAA,MACrC;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,IAAM,sBAAqC;AAAA,EACzC,iBAAiB;AAAA,EACjB,OAAO;AACT;AAEA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAoD;AAClD,QAAM,YAAY,WAAW,oBAAoB;AACjD,QAAM,cAAc,OAA2B,IAAI;AACnD,QAAM,cAAc,oBAAoB,aAAa,WAAW;AAEhE,SACE,oBAAC,iBAAiB,QAAjB,EACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,GAAG,aAAa,GAAG,qBAAqB,GAAG,MAAM;AAAA,MACzD,GAAG;AAAA,MAEH;AAAA;AAAA,QACD;AAAA,UAAC,iBAAiB;AAAA,UAAjB;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,iBAAiB;AAAA,cACjB,MAAM;AAAA,YACR;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -15,7 +15,7 @@ function EmptyQueueStateSurface({ queue }) {
|
|
|
15
15
|
return /* @__PURE__ */ jsx(
|
|
16
16
|
"div",
|
|
17
17
|
{
|
|
18
|
-
className: "mx-auto mb-2 w-full max-w-3xl shrink-0 px-4 sm:px-6",
|
|
18
|
+
className: "og-root mx-auto mb-2 w-full max-w-3xl shrink-0 px-4 sm:px-6",
|
|
19
19
|
"data-testid": "queue-surface",
|
|
20
20
|
children: /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm", children: [
|
|
21
21
|
queue.stoppingPreviousAttempt ? /* @__PURE__ */ jsx(QueueStoppingStatus, { queue, dividerAfter: hasError }) : null,
|
|
@@ -33,7 +33,7 @@ function QueueStoppingStatus({
|
|
|
33
33
|
{
|
|
34
34
|
role: "status",
|
|
35
35
|
"aria-live": "polite",
|
|
36
|
-
className: `flex min-h-11 items-center gap-2.5 bg-status-waiting/[0.07] px-3 py-2 text-
|
|
36
|
+
className: `flex min-h-11 items-center gap-2.5 bg-status-waiting/[0.07] px-3 py-2 text-og-control text-fg ${dividerAfter ? "border-b border-status-waiting/20" : ""}`,
|
|
37
37
|
"data-testid": "stopping-previous-attempt",
|
|
38
38
|
children: [
|
|
39
39
|
/* @__PURE__ */ jsx(
|
|
@@ -60,7 +60,7 @@ function QueueErrorAlert({
|
|
|
60
60
|
"div",
|
|
61
61
|
{
|
|
62
62
|
role: "alert",
|
|
63
|
-
className: "flex min-w-0 max-w-full flex-wrap items-start gap-2 rounded-md bg-status-failed/10 px-2 py-1.5 text-
|
|
63
|
+
className: "flex min-w-0 max-w-full flex-wrap items-start gap-2 rounded-md bg-status-failed/10 px-2 py-1.5 text-og-control text-status-failed",
|
|
64
64
|
children: [
|
|
65
65
|
/* @__PURE__ */ jsx(
|
|
66
66
|
"span",
|
|
@@ -99,4 +99,4 @@ export {
|
|
|
99
99
|
QueueStoppingStatus,
|
|
100
100
|
QueueErrorAlert
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-VCBFUSUZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/queue-draft-policy.ts","../src/components/queue-surface-state.tsx"],"sourcesContent":["import type { ComposerState } from \"../hooks/use-composer\";\n\n/**\n * Decide whether checking out a queued prompt would replace current composer\n * content. `hasDraftContent` reads the synchronous draft refs, so this stays\n * correct even when a controlled input update has not rendered yet.\n */\nexport function requestQueueDraftEdit(\n composer: Pick<ComposerState, \"hasDraftContent\">,\n confirmReplacement: () => void,\n editImmediately: () => void,\n): void {\n if (composer.hasDraftContent()) {\n confirmReplacement();\n } else {\n editImmediately();\n }\n}\n","import { Loader2Icon, RotateCwIcon } from \"lucide-react\";\n\nimport type { UseTurnQueueResult } from \"../hooks/use-turn-queue\";\n\ntype QueueStateProps = {\n queue: UseTurnQueueResult;\n};\n\nexport function EmptyQueueStateSurface({ queue }: QueueStateProps) {\n const hasError = Boolean(queue.error || queue.mutationError);\n return (\n <div\n className=\"og-root mx-auto mb-2 w-full max-w-3xl shrink-0 px-4 sm:px-6\"\n data-testid=\"queue-surface\"\n >\n <div className=\"overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm\">\n {queue.stoppingPreviousAttempt ? (\n <QueueStoppingStatus queue={queue} dividerAfter={hasError} />\n ) : null}\n {hasError ? <QueueErrorAlert queue={queue} /> : null}\n </div>\n </div>\n );\n}\n\nexport function QueueStoppingStatus({\n queue,\n dividerAfter = false,\n}: QueueStateProps & { dividerAfter?: boolean }) {\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className={`flex min-h-11 items-center gap-2.5 bg-status-waiting/[0.07] px-3 py-2 text-og-control text-fg ${\n dividerAfter ? \"border-b border-status-waiting/20\" : \"\"\n }`}\n data-testid=\"stopping-previous-attempt\"\n >\n <Loader2Icon\n aria-hidden=\"true\"\n className=\"size-3.5 shrink-0 animate-spin text-status-waiting motion-reduce:animate-none\"\n />\n <span className=\"min-w-0\">\n <span className=\"font-medium\">\n {queue.effectiveControl?.state === \"paused\"\n ? \"Stopping current attempt…\"\n : \"Stopping previous attempt…\"}\n </span>{\" \"}\n <span className=\"text-fg-muted\">\n {queue.effectiveControl?.state === \"paused\"\n ? \"Queued work stays saved until you resume.\"\n : \"Queued work is saved and starts automatically.\"}\n </span>\n </span>\n </div>\n );\n}\n\nexport function QueueErrorAlert({\n queue,\n dividerBefore = false,\n}: QueueStateProps & { dividerBefore?: boolean }) {\n return (\n <div className={`${dividerBefore ? \"border-t border-border\" : \"\"} p-2`}>\n <div\n role=\"alert\"\n className=\"flex min-w-0 max-w-full flex-wrap items-start gap-2 rounded-md bg-status-failed/10 px-2 py-1.5 text-og-control text-status-failed\"\n >\n <span\n role=\"region\"\n aria-label=\"Queue error details\"\n tabIndex={0}\n className=\"max-h-[min(5rem,20dvh)] min-w-0 max-w-full flex-[1_1_5rem] overflow-auto overscroll-contain whitespace-pre-wrap rounded-sm outline-none [overflow-wrap:anywhere] [unicode-bidi:plaintext] focus-visible:ring-2 focus-visible:ring-ring/40\"\n data-testid=\"queue-error-message\"\n dir=\"auto\"\n >\n {(queue.mutationError ?? queue.error)?.message}\n </span>\n <button\n type=\"button\"\n onClick={() => {\n queue.clearMutationError();\n void queue.refresh();\n }}\n aria-label=\"Dismiss queue error and retry\"\n title=\"Retry loading the queue\"\n className=\"ms-auto inline-flex size-7 shrink-0 items-center justify-center self-start rounded-md outline-none transition-colors hover:bg-surface-3 focus-visible:ring-2 focus-visible:ring-ring/40 motion-reduce:transition-none pointer-coarse:size-[44px]\"\n >\n <RotateCwIcon className=\"size-3.5\" />\n </button>\n </div>\n </div>\n );\n}\n"],"mappings":";AAOO,SAAS,sBACd,UACA,oBACA,iBACM;AACN,MAAI,SAAS,gBAAgB,GAAG;AAC9B,uBAAmB;AAAA,EACrB,OAAO;AACL,oBAAgB;AAAA,EAClB;AACF;;;ACjBA,SAAS,aAAa,oBAAoB;AAepC,SAEI,KAFJ;AAPC,SAAS,uBAAuB,EAAE,MAAM,GAAoB;AACjE,QAAM,WAAW,QAAQ,MAAM,SAAS,MAAM,aAAa;AAC3D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAY;AAAA,MAEZ,+BAAC,SAAI,WAAU,2EACZ;AAAA,cAAM,0BACL,oBAAC,uBAAoB,OAAc,cAAc,UAAU,IACzD;AAAA,QACH,WAAW,oBAAC,mBAAgB,OAAc,IAAK;AAAA,SAClD;AAAA;AAAA,EACF;AAEJ;AAEO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA,eAAe;AACjB,GAAiD;AAC/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,aAAU;AAAA,MACV,WAAW,iGACT,eAAe,sCAAsC,EACvD;AAAA,MACA,eAAY;AAAA,MAEZ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAY;AAAA,YACZ,WAAU;AAAA;AAAA,QACZ;AAAA,QACA,qBAAC,UAAK,WAAU,WACd;AAAA,8BAAC,UAAK,WAAU,eACb,gBAAM,kBAAkB,UAAU,WAC/B,mCACA,mCACN;AAAA,UAAQ;AAAA,UACR,oBAAC,UAAK,WAAU,iBACb,gBAAM,kBAAkB,UAAU,WAC/B,8CACA,kDACN;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA,gBAAgB;AAClB,GAAkD;AAChD,SACE,oBAAC,SAAI,WAAW,GAAG,gBAAgB,2BAA2B,EAAE,QAC9D;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAU;AAAA,MAEV;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,cAAW;AAAA,YACX,UAAU;AAAA,YACV,WAAU;AAAA,YACV,eAAY;AAAA,YACZ,KAAI;AAAA,YAEF,iBAAM,iBAAiB,MAAM,QAAQ;AAAA;AAAA,QACzC;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS,MAAM;AACb,oBAAM,mBAAmB;AACzB,mBAAK,MAAM,QAAQ;AAAA,YACrB;AAAA,YACA,cAAW;AAAA,YACX,OAAM;AAAA,YACN,WAAU;AAAA,YAEV,8BAAC,gBAAa,WAAU,YAAW;AAAA;AAAA,QACrC;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClientModel, LatencyMode, ReasoningEffort } from "@opengeni/sdk";
|
|
2
|
-
import { type ReactNode } from "react";
|
|
2
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
3
3
|
import { type PickerBillingClass, type PickerModelRow } from "../model-policy";
|
|
4
4
|
type NavLevel = "providers" | "models" | "thinking";
|
|
5
5
|
type PickerNavState = {
|
|
@@ -30,12 +30,21 @@ export type ModelPolicyPickerProps = {
|
|
|
30
30
|
disabled?: boolean | undefined;
|
|
31
31
|
loading?: boolean | undefined;
|
|
32
32
|
error?: string | null | undefined;
|
|
33
|
+
/** Controlled menu state. Omit for the built-in uncontrolled behavior. */
|
|
34
|
+
open?: boolean | undefined;
|
|
35
|
+
/** Initial menu state when `open` is uncontrolled. */
|
|
36
|
+
defaultOpen?: boolean | undefined;
|
|
37
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
33
38
|
/** Non-Codex models stay visible but cannot be selected. */
|
|
34
39
|
codexOnly?: boolean | undefined;
|
|
35
40
|
/** Resets drill-down navigation when the session scope changes. */
|
|
36
41
|
sessionKey?: string | undefined;
|
|
37
42
|
/** Prefer bottom on new-chat surfaces and top for bottom-docked composers. */
|
|
38
43
|
menuSide?: "top" | "bottom" | undefined;
|
|
44
|
+
/** Classes for the portalled menu surface. Prefer --og-* tokens for theming. */
|
|
45
|
+
contentClassName?: string | undefined;
|
|
46
|
+
/** Inline styles for the portalled menu, applied after inherited --og-* tokens. */
|
|
47
|
+
contentStyle?: CSSProperties | undefined;
|
|
39
48
|
className?: string | undefined;
|
|
40
49
|
messages?: Partial<ModelPolicyPickerMessages> | undefined;
|
|
41
50
|
onModelChange: (modelId: string) => void;
|
package/dist/composer.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
useChatComposer,
|
|
38
38
|
useChatComposerController,
|
|
39
39
|
useVoiceInput
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-L3EWO3UK.js";
|
|
41
41
|
import "./chunk-HFO4ERGQ.js";
|
|
42
42
|
import "./chunk-EB67J347.js";
|
|
43
43
|
import {
|
|
@@ -48,12 +48,13 @@ import {
|
|
|
48
48
|
PickerBackHeader,
|
|
49
49
|
PickerNavRow,
|
|
50
50
|
defaultModelPolicyPickerMessages
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-EHSYZ4KP.js";
|
|
52
52
|
import "./chunk-EKZH6IDG.js";
|
|
53
53
|
import "./chunk-23EJ676W.js";
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-U3CSCMWA.js";
|
|
55
55
|
import "./chunk-LAKLF4PA.js";
|
|
56
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-JB5725BI.js";
|
|
57
|
+
import "./chunk-22KP6LR5.js";
|
|
57
58
|
export {
|
|
58
59
|
Actions,
|
|
59
60
|
AttachButton,
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
healthPulses,
|
|
26
26
|
pointsFor,
|
|
27
27
|
useMachines
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-6EDV6YFE.js";
|
|
29
29
|
import {
|
|
30
30
|
SESSION_EVENT_BROWSER_MAX_BYTES,
|
|
31
31
|
SESSION_EVENT_BROWSER_MAX_COUNT,
|
|
@@ -109,8 +109,8 @@ import {
|
|
|
109
109
|
useLightboxOptional,
|
|
110
110
|
useThemeType,
|
|
111
111
|
v4aToGitFileDiff
|
|
112
|
-
} from "./chunk-
|
|
113
|
-
import "./chunk-
|
|
112
|
+
} from "./chunk-LYRJUU5V.js";
|
|
113
|
+
import "./chunk-VCBFUSUZ.js";
|
|
114
114
|
import {
|
|
115
115
|
buildTimeline,
|
|
116
116
|
creditExhaustedFromEvents,
|
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
useSlashCommands,
|
|
172
172
|
useTranscription,
|
|
173
173
|
useVoiceInput
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-L3EWO3UK.js";
|
|
175
175
|
import {
|
|
176
176
|
FILE_ONLY_MESSAGE_TEXT,
|
|
177
177
|
composeSendInput,
|
|
@@ -192,7 +192,7 @@ import {
|
|
|
192
192
|
PickerBackHeader,
|
|
193
193
|
PickerNavRow,
|
|
194
194
|
defaultModelPolicyPickerMessages
|
|
195
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-EHSYZ4KP.js";
|
|
196
196
|
import {
|
|
197
197
|
useOpenGeni,
|
|
198
198
|
useOpenGeniClient
|
|
@@ -219,9 +219,8 @@ import {
|
|
|
219
219
|
Tooltip,
|
|
220
220
|
TooltipContent,
|
|
221
221
|
TooltipProvider,
|
|
222
|
-
TooltipTrigger
|
|
223
|
-
|
|
224
|
-
} from "./chunk-ATSTR5P3.js";
|
|
222
|
+
TooltipTrigger
|
|
223
|
+
} from "./chunk-U3CSCMWA.js";
|
|
225
224
|
import {
|
|
226
225
|
COMPOSER_PAYMENT_REQUIRED_MESSAGE,
|
|
227
226
|
CREDIT_EXHAUSTION_MESSAGE,
|
|
@@ -235,9 +234,12 @@ import {
|
|
|
235
234
|
truncate,
|
|
236
235
|
tryParseJson
|
|
237
236
|
} from "./chunk-LAKLF4PA.js";
|
|
237
|
+
import {
|
|
238
|
+
usePortalTokenStyle
|
|
239
|
+
} from "./chunk-JB5725BI.js";
|
|
238
240
|
import {
|
|
239
241
|
cn
|
|
240
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-22KP6LR5.js";
|
|
241
243
|
|
|
242
244
|
// src/hooks/use-last-started-turn-policy.ts
|
|
243
245
|
import { useCallback, useEffect } from "react";
|