@opengeni/react 0.34.2 → 0.35.2
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-GZ4KR67U.js → chunk-ALA3UGWB.js} +2 -2
- package/dist/chunk-ATSTR5P3.js +138 -0
- package/dist/chunk-ATSTR5P3.js.map +1 -0
- package/dist/{chunk-L7R5RK6A.js → chunk-AXQQ2V2I.js} +1312 -926
- package/dist/chunk-AXQQ2V2I.js.map +1 -0
- package/dist/{chunk-KZRUYCL4.js → chunk-FT2TXNGZ.js} +5 -2
- package/dist/chunk-FT2TXNGZ.js.map +1 -0
- package/dist/{chunk-TCCE5ZU5.js → chunk-J2RVJ6JX.js} +39 -9
- package/dist/chunk-J2RVJ6JX.js.map +1 -0
- package/dist/{chunk-4QOQ2DSR.js → chunk-LAKLF4PA.js} +14 -1
- package/dist/chunk-LAKLF4PA.js.map +1 -0
- package/dist/{chunk-A2WITZTI.js → chunk-OKKMZDQF.js} +3 -2
- package/dist/chunk-OKKMZDQF.js.map +1 -0
- package/dist/{chunk-MS3FBZ6A.js → chunk-PVW56EVR.js} +105 -62
- package/dist/chunk-PVW56EVR.js.map +1 -0
- package/dist/components/chat-composer.d.ts +2 -1
- package/dist/components/composer.d.ts +8 -2
- package/dist/components/copy-button.d.ts +4 -2
- package/dist/components/tip-follow.d.ts +3 -0
- package/dist/composer.d.ts +2 -1
- package/dist/composer.js +4 -3
- package/dist/hooks/use-turn-queue.d.ts +3 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +105 -101
- package/dist/index.js.map +1 -1
- package/dist/lib/format.d.ts +2 -0
- package/dist/machines.js +2 -2
- package/dist/session-ui.js +4 -3
- package/dist/session.js +4 -4
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/parsers.d.ts +5 -0
- package/dist/timeline/projection.d.ts +1 -12
- package/dist/timeline/tool-display-name.d.ts +17 -6
- package/dist/workstream-control-event.d.ts +6 -0
- package/package.json +2 -2
- package/src/components/chat-composer.tsx +1 -1
- package/src/components/composer-transcription-control.tsx +70 -57
- package/src/components/composer.tsx +197 -126
- package/src/components/copy-button.tsx +27 -8
- package/src/components/message-timeline.tsx +385 -71
- package/src/components/tip-follow.ts +15 -0
- package/src/composer.ts +1 -1
- package/src/hooks/use-composer.ts +7 -1
- package/src/hooks/use-turn-queue.ts +4 -0
- package/src/index.ts +2 -1
- package/src/lib/format.ts +14 -0
- package/src/timeline/index.ts +2 -0
- package/src/timeline/parsers.ts +18 -1
- package/src/timeline/projection.ts +51 -20
- package/src/timeline/registry.ts +15 -2
- package/src/timeline/shared.tsx +30 -28
- package/src/timeline/tool-display-name.ts +30 -11
- package/src/timeline/tool-renderers.tsx +347 -16
- package/src/timeline/turn-summary.tsx +5 -2
- package/src/workstream-control-event.ts +6 -0
- package/dist/chunk-4QOQ2DSR.js.map +0 -1
- package/dist/chunk-A2WITZTI.js.map +0 -1
- package/dist/chunk-KZRUYCL4.js.map +0 -1
- package/dist/chunk-L7R5RK6A.js.map +0 -1
- package/dist/chunk-MS3FBZ6A.js.map +0 -1
- package/dist/chunk-TCCE5ZU5.js.map +0 -1
- /package/dist/{chunk-GZ4KR67U.js.map → chunk-ALA3UGWB.js.map} +0 -0
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
formatBytes,
|
|
12
12
|
formatRelativeTime
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LAKLF4PA.js";
|
|
14
14
|
|
|
15
15
|
// src/types/machines.ts
|
|
16
16
|
function connectionStatusForState(state) {
|
|
@@ -1955,4 +1955,4 @@ export {
|
|
|
1955
1955
|
OpenGeniProvider,
|
|
1956
1956
|
useMachines
|
|
1957
1957
|
};
|
|
1958
|
-
//# sourceMappingURL=chunk-
|
|
1958
|
+
//# sourceMappingURL=chunk-ALA3UGWB.js.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-TK7G6XLT.js";
|
|
4
|
+
|
|
5
|
+
// src/components/tooltip.tsx
|
|
6
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
7
|
+
import {
|
|
8
|
+
createContext,
|
|
9
|
+
useContext,
|
|
10
|
+
useRef
|
|
11
|
+
} 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
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
59
|
+
var TooltipSourceContext = createContext(null);
|
|
60
|
+
function TooltipProvider({
|
|
61
|
+
delayDuration = 300,
|
|
62
|
+
...props
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, ...props });
|
|
65
|
+
}
|
|
66
|
+
function Tooltip({ children, ...props }) {
|
|
67
|
+
const sourceRef = useRef(null);
|
|
68
|
+
return /* @__PURE__ */ jsx(TooltipSourceContext.Provider, { value: sourceRef, children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props, children }) });
|
|
69
|
+
}
|
|
70
|
+
function TooltipTrigger({
|
|
71
|
+
asChild = true,
|
|
72
|
+
...props
|
|
73
|
+
}) {
|
|
74
|
+
const sourceRef = useContext(TooltipSourceContext);
|
|
75
|
+
return /* @__PURE__ */ jsx(
|
|
76
|
+
TooltipPrimitive.Trigger,
|
|
77
|
+
{
|
|
78
|
+
"data-slot": "tooltip-trigger",
|
|
79
|
+
asChild,
|
|
80
|
+
ref: (node) => {
|
|
81
|
+
if (sourceRef) sourceRef.current = node;
|
|
82
|
+
},
|
|
83
|
+
...props
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
var tooltipSurfaceStyle = {
|
|
88
|
+
backgroundColor: "var(--og-color-fg)",
|
|
89
|
+
color: "var(--og-color-bg)"
|
|
90
|
+
};
|
|
91
|
+
function TooltipContent({
|
|
92
|
+
className,
|
|
93
|
+
sideOffset = 6,
|
|
94
|
+
children,
|
|
95
|
+
style,
|
|
96
|
+
...props
|
|
97
|
+
}) {
|
|
98
|
+
const sourceRef = useContext(TooltipSourceContext);
|
|
99
|
+
const fallbackRef = useRef(null);
|
|
100
|
+
const portalStyle = usePortalTokenStyle(sourceRef ?? fallbackRef);
|
|
101
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
102
|
+
TooltipPrimitive.Content,
|
|
103
|
+
{
|
|
104
|
+
"data-slot": "tooltip-content",
|
|
105
|
+
sideOffset,
|
|
106
|
+
className: cn(
|
|
107
|
+
"og-root z-50 w-fit max-w-xs origin-[var(--radix-tooltip-content-transform-origin)]",
|
|
108
|
+
"rounded-og-md px-2.5 py-1.5 text-og-xs leading-4 text-balance shadow-og-md",
|
|
109
|
+
"animate-og-enter data-[state=closed]:opacity-0 data-[state=closed]:transition-opacity",
|
|
110
|
+
className
|
|
111
|
+
),
|
|
112
|
+
style: { ...portalStyle, ...tooltipSurfaceStyle, ...style },
|
|
113
|
+
...props,
|
|
114
|
+
children: [
|
|
115
|
+
children,
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
TooltipPrimitive.Arrow,
|
|
118
|
+
{
|
|
119
|
+
className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",
|
|
120
|
+
style: {
|
|
121
|
+
backgroundColor: "var(--og-color-fg)",
|
|
122
|
+
fill: "var(--og-color-fg)"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
) });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export {
|
|
132
|
+
usePortalTokenStyle,
|
|
133
|
+
TooltipProvider,
|
|
134
|
+
Tooltip,
|
|
135
|
+
TooltipTrigger,
|
|
136
|
+
TooltipContent
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=chunk-ATSTR5P3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/tooltip.tsx","../src/lib/use-portal-token-style.ts"],"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","import { type CSSProperties, type RefObject, useEffect, useState } from \"react\";\n\nexport type PortalTokenStyle = CSSProperties & Record<`--${string}`, string>;\n\n/**\n * Copy the effective SDK tokens across a portal boundary. A locally themed or\n * rebranded embed cannot rely on CSS inheritance once a portal mounts under\n * `<body>`. Ancestor theme/class/style mutations and OS color-scheme changes\n * keep the copied values live.\n */\nexport function usePortalTokenStyle(sourceRef: RefObject<HTMLElement | null>): PortalTokenStyle {\n const [style, setStyle] = useState<PortalTokenStyle>({});\n useEffect(() => {\n const source = sourceRef.current;\n if (!source || typeof MutationObserver === \"undefined\") return;\n let signature = \"\";\n const sync = () => {\n const computed = getComputedStyle(source);\n const next: PortalTokenStyle = { colorScheme: computed.colorScheme };\n for (let index = 0; index < computed.length; index += 1) {\n const property = computed.item(index);\n if (!property.startsWith(\"--og-\")) continue;\n next[property as `--${string}`] = computed.getPropertyValue(property);\n }\n const nextSignature = JSON.stringify(next);\n if (nextSignature !== signature) {\n signature = nextSignature;\n setStyle(next);\n }\n };\n const observers: MutationObserver[] = [];\n let ancestor: HTMLElement | null = source;\n while (ancestor) {\n const observer = new MutationObserver(sync);\n observer.observe(ancestor, {\n attributes: true,\n attributeFilter: [\"class\", \"data-og-theme\", \"style\"],\n });\n observers.push(observer);\n ancestor = ancestor.parentElement;\n }\n const colorScheme = window.matchMedia?.(\"(prefers-color-scheme: dark)\");\n colorScheme?.addEventListener?.(\"change\", sync);\n sync();\n return () => {\n for (const observer of observers) observer.disconnect();\n colorScheme?.removeEventListener?.(\"change\", sync);\n };\n }, [sourceRef]);\n return style;\n}\n"],"mappings":";;;;;AASA,SAAS,WAAW,wBAAwB;AAC5C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;;;ACjBP,SAA6C,WAAW,gBAAgB;AAUjE,SAAS,oBAAoB,WAA4D;AAC9F,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA2B,CAAC,CAAC;AACvD,YAAU,MAAM;AACd,UAAM,SAAS,UAAU;AACzB,QAAI,CAAC,UAAU,OAAO,qBAAqB,YAAa;AACxD,QAAI,YAAY;AAChB,UAAM,OAAO,MAAM;AACjB,YAAM,WAAW,iBAAiB,MAAM;AACxC,YAAM,OAAyB,EAAE,aAAa,SAAS,YAAY;AACnE,eAAS,QAAQ,GAAG,QAAQ,SAAS,QAAQ,SAAS,GAAG;AACvD,cAAM,WAAW,SAAS,KAAK,KAAK;AACpC,YAAI,CAAC,SAAS,WAAW,OAAO,EAAG;AACnC,aAAK,QAAyB,IAAI,SAAS,iBAAiB,QAAQ;AAAA,MACtE;AACA,YAAM,gBAAgB,KAAK,UAAU,IAAI;AACzC,UAAI,kBAAkB,WAAW;AAC/B,oBAAY;AACZ,iBAAS,IAAI;AAAA,MACf;AAAA,IACF;AACA,UAAM,YAAgC,CAAC;AACvC,QAAI,WAA+B;AACnC,WAAO,UAAU;AACf,YAAM,WAAW,IAAI,iBAAiB,IAAI;AAC1C,eAAS,QAAQ,UAAU;AAAA,QACzB,YAAY;AAAA,QAC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