@opengeni/react 0.42.1 → 0.44.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-SJKT4TKW.js → chunk-23EJ676W.js} +3 -1
- package/dist/chunk-23EJ676W.js.map +1 -0
- package/dist/{chunk-Q2NCKWTK.js → chunk-HFO4ERGQ.js} +51 -4
- package/dist/chunk-HFO4ERGQ.js.map +1 -0
- package/dist/{chunk-4IJCL7YO.js → chunk-LWR4MXSS.js} +4 -1
- package/dist/chunk-LWR4MXSS.js.map +1 -0
- package/dist/{chunk-UWYTCQWW.js → chunk-QQRM3DO3.js} +93 -22
- package/dist/{chunk-UWYTCQWW.js.map → chunk-QQRM3DO3.js.map} +1 -1
- package/dist/{chunk-JALF5FI3.js → chunk-SRFUT2ZU.js} +2 -2
- package/dist/{chunk-WZT5G5OR.js → chunk-U6K24XQD.js} +5 -4
- package/dist/{chunk-WZT5G5OR.js.map → chunk-U6K24XQD.js.map} +1 -1
- package/dist/{chunk-KR2SK5GJ.js → chunk-YNYIAYXQ.js} +427 -94
- package/dist/chunk-YNYIAYXQ.js.map +1 -0
- package/dist/components/chat-composer.d.ts +5 -1
- package/dist/components/composer-transcription-control.d.ts +3 -1
- package/dist/components/composer.d.ts +6 -4
- package/dist/components/session-chrome.d.ts +1 -1
- package/dist/composer.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +70 -21
- package/dist/index.js.map +1 -1
- package/dist/model-policy.d.ts +2 -0
- package/dist/model-policy.js +1 -1
- package/dist/realtime/realtime-control.d.ts +29 -1
- package/dist/realtime.d.ts +1 -1
- package/dist/realtime.js +269 -151
- package/dist/realtime.js.map +1 -1
- package/dist/session-ui.js +2 -2
- package/dist/session.js +3 -3
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/parsers.d.ts +13 -8
- package/package.json +2 -2
- package/src/components/chat-composer.tsx +58 -19
- package/src/components/composer-transcription-control.tsx +194 -165
- package/src/components/composer.tsx +78 -14
- package/src/components/model-policy-picker.tsx +7 -2
- package/src/components/session-chrome.tsx +89 -78
- package/src/hooks/use-composer.ts +79 -9
- package/src/index.ts +2 -0
- package/src/model-policy.ts +4 -0
- package/src/realtime/realtime-control.tsx +307 -137
- package/src/realtime.ts +1 -0
- package/src/timeline/index.ts +2 -0
- package/src/timeline/parsers.ts +201 -19
- package/src/timeline/projection.ts +11 -0
- package/src/timeline/tool-renderers.tsx +213 -8
- package/src/timeline/turn-summary.tsx +7 -2
- package/styles/tokens.css +8 -5
- package/dist/chunk-4IJCL7YO.js.map +0 -1
- package/dist/chunk-KR2SK5GJ.js.map +0 -1
- package/dist/chunk-Q2NCKWTK.js.map +0 -1
- package/dist/chunk-SJKT4TKW.js.map +0 -1
- /package/dist/{chunk-JALF5FI3.js.map → chunk-SRFUT2ZU.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
shouldSteerOnKey,
|
|
3
3
|
shouldSubmitOnKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HFO4ERGQ.js";
|
|
5
5
|
import {
|
|
6
6
|
groupPickerRowsByBillingClass
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-23EJ676W.js";
|
|
8
8
|
import {
|
|
9
9
|
Tooltip,
|
|
10
10
|
TooltipContent,
|
|
@@ -2613,16 +2613,60 @@ var defaultChatComposerMessages = {
|
|
|
2613
2613
|
formatBytes,
|
|
2614
2614
|
formatRelativeTime
|
|
2615
2615
|
};
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
return;
|
|
2616
|
+
var composerHeightMirror = null;
|
|
2617
|
+
function measureComposerContentHeight(textarea) {
|
|
2618
|
+
if (typeof document === "undefined") {
|
|
2619
|
+
return textarea.scrollHeight;
|
|
2620
|
+
}
|
|
2621
|
+
const width = textarea.clientWidth;
|
|
2622
|
+
if (width <= 0) {
|
|
2623
|
+
return textarea.offsetHeight;
|
|
2624
|
+
}
|
|
2625
|
+
let mirror = composerHeightMirror;
|
|
2626
|
+
if (!mirror) {
|
|
2627
|
+
mirror = document.createElement("textarea");
|
|
2628
|
+
mirror.setAttribute("aria-hidden", "true");
|
|
2629
|
+
mirror.tabIndex = -1;
|
|
2630
|
+
mirror.rows = 1;
|
|
2631
|
+
mirror.style.cssText = "position:absolute;top:0;left:0;visibility:hidden;pointer-events:none;height:auto;min-height:0;max-height:none;overflow:hidden;z-index:-1;";
|
|
2632
|
+
composerHeightMirror = mirror;
|
|
2620
2633
|
}
|
|
2634
|
+
const style = getComputedStyle(textarea);
|
|
2635
|
+
mirror.style.width = `${width}px`;
|
|
2636
|
+
mirror.style.boxSizing = style.boxSizing;
|
|
2637
|
+
mirror.style.font = style.font;
|
|
2638
|
+
mirror.style.fontSize = style.fontSize;
|
|
2639
|
+
mirror.style.fontFamily = style.fontFamily;
|
|
2640
|
+
mirror.style.fontWeight = style.fontWeight;
|
|
2641
|
+
mirror.style.fontStyle = style.fontStyle;
|
|
2642
|
+
mirror.style.letterSpacing = style.letterSpacing;
|
|
2643
|
+
mirror.style.lineHeight = style.lineHeight;
|
|
2644
|
+
mirror.style.textTransform = style.textTransform;
|
|
2645
|
+
mirror.style.paddingTop = style.paddingTop;
|
|
2646
|
+
mirror.style.paddingRight = style.paddingRight;
|
|
2647
|
+
mirror.style.paddingBottom = style.paddingBottom;
|
|
2648
|
+
mirror.style.paddingLeft = style.paddingLeft;
|
|
2649
|
+
mirror.style.borderTopWidth = style.borderTopWidth;
|
|
2650
|
+
mirror.style.borderRightWidth = style.borderRightWidth;
|
|
2651
|
+
mirror.style.borderBottomWidth = style.borderBottomWidth;
|
|
2652
|
+
mirror.style.borderLeftWidth = style.borderLeftWidth;
|
|
2653
|
+
mirror.style.borderStyle = style.borderStyle;
|
|
2654
|
+
mirror.style.whiteSpace = style.whiteSpace;
|
|
2655
|
+
mirror.style.wordBreak = style.wordBreak;
|
|
2656
|
+
mirror.style.overflowWrap = style.overflowWrap;
|
|
2657
|
+
mirror.value = textarea.value;
|
|
2658
|
+
if (!mirror.isConnected) {
|
|
2659
|
+
document.documentElement.appendChild(mirror);
|
|
2660
|
+
}
|
|
2661
|
+
return mirror.scrollHeight;
|
|
2662
|
+
}
|
|
2663
|
+
function applyComposerTextareaHeight(textarea, maxPx = 220, measure = measureComposerContentHeight) {
|
|
2621
2664
|
const before = textarea.offsetHeight;
|
|
2622
|
-
|
|
2623
|
-
|
|
2665
|
+
const nextPx = Math.min(
|
|
2666
|
+
textarea.scrollHeight > textarea.clientHeight + 1 ? textarea.scrollHeight : measure(textarea),
|
|
2667
|
+
maxPx
|
|
2668
|
+
);
|
|
2624
2669
|
if (Math.abs(nextPx - before) < 1) {
|
|
2625
|
-
textarea.style.height = `${before}px`;
|
|
2626
2670
|
return;
|
|
2627
2671
|
}
|
|
2628
2672
|
textarea.style.height = `${nextPx}px`;
|
|
@@ -3150,7 +3194,8 @@ var Footer = forwardRef(function ComposerFooter({ className, ...props }, ref) {
|
|
|
3150
3194
|
ref,
|
|
3151
3195
|
className: cn(
|
|
3152
3196
|
"flex items-end gap-1.5 px-2 pb-2 pt-0.5 sm:px-2.5 sm:pb-2.5",
|
|
3153
|
-
|
|
3197
|
+
// Mobile: one control row — never wrap into a second toolbar line.
|
|
3198
|
+
"max-sm:flex-nowrap max-sm:items-center max-sm:gap-1",
|
|
3154
3199
|
className
|
|
3155
3200
|
)
|
|
3156
3201
|
}
|
|
@@ -3190,7 +3235,11 @@ var Actions = forwardRef(function ComposerActions({ className, ...props }, ref)
|
|
|
3190
3235
|
{
|
|
3191
3236
|
...props,
|
|
3192
3237
|
ref,
|
|
3193
|
-
className: cn(
|
|
3238
|
+
className: cn(
|
|
3239
|
+
"ml-auto flex shrink-0 items-center gap-1.5",
|
|
3240
|
+
"max-sm:flex-nowrap max-sm:gap-1",
|
|
3241
|
+
className
|
|
3242
|
+
)
|
|
3194
3243
|
}
|
|
3195
3244
|
);
|
|
3196
3245
|
});
|
|
@@ -3743,7 +3792,8 @@ function ComposerTranscriptionControl({
|
|
|
3743
3792
|
messages: overrides,
|
|
3744
3793
|
className,
|
|
3745
3794
|
createRecordingStore,
|
|
3746
|
-
createOwnerId
|
|
3795
|
+
createOwnerId,
|
|
3796
|
+
suppressed = false
|
|
3747
3797
|
}) {
|
|
3748
3798
|
const composer = useChatComposer();
|
|
3749
3799
|
const messages = { ...defaultMessages, ...overrides };
|
|
@@ -3751,7 +3801,7 @@ function ComposerTranscriptionControl({
|
|
|
3751
3801
|
client,
|
|
3752
3802
|
workspaceId,
|
|
3753
3803
|
capability,
|
|
3754
|
-
enabled: workspaceEnabled,
|
|
3804
|
+
enabled: workspaceEnabled && !suppressed,
|
|
3755
3805
|
value: composer.value,
|
|
3756
3806
|
setValue: composer.setValue,
|
|
3757
3807
|
focusInput: composer.focusInput,
|
|
@@ -3760,6 +3810,13 @@ function ComposerTranscriptionControl({
|
|
|
3760
3810
|
createOwnerId
|
|
3761
3811
|
});
|
|
3762
3812
|
const { status } = transcription;
|
|
3813
|
+
const cancelTranscription = transcription.cancel;
|
|
3814
|
+
useEffect4(() => {
|
|
3815
|
+
if (!suppressed) return;
|
|
3816
|
+
if (status === "recording" || status === "requesting-permission") {
|
|
3817
|
+
cancelTranscription();
|
|
3818
|
+
}
|
|
3819
|
+
}, [cancelTranscription, status, suppressed]);
|
|
3763
3820
|
const active = status === "requesting-permission" || status === "recording" || status === "saving" || status === "transcribing";
|
|
3764
3821
|
const recoverable = transcription.hasRecoverableRecording && (status === "recovered" || status === "transcript-ready" || status === "error");
|
|
3765
3822
|
const savedTranscript = status === "transcript-ready" && transcription.savedTranscript !== null;
|
|
@@ -3774,12 +3831,16 @@ function ComposerTranscriptionControl({
|
|
|
3774
3831
|
}
|
|
3775
3832
|
void transcription.start();
|
|
3776
3833
|
}
|
|
3777
|
-
return /* @__PURE__ */
|
|
3778
|
-
|
|
3834
|
+
return /* @__PURE__ */ jsx4(AnimatePresence3, { initial: false, children: suppressed ? null : /* @__PURE__ */ jsx4(
|
|
3835
|
+
motion3.span,
|
|
3779
3836
|
{
|
|
3780
|
-
|
|
3837
|
+
initial: { opacity: 0, width: 0 },
|
|
3838
|
+
animate: { opacity: 1, width: "auto" },
|
|
3839
|
+
exit: { opacity: 0, width: 0 },
|
|
3840
|
+
transition: { duration: 0.36, ease: [0.22, 1, 0.36, 1] },
|
|
3841
|
+
className: cn("inline-flex min-w-0 overflow-hidden", className),
|
|
3781
3842
|
"data-transcription-status": status,
|
|
3782
|
-
children: [
|
|
3843
|
+
children: /* @__PURE__ */ jsxs4("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
3783
3844
|
/* @__PURE__ */ jsx4(AnimatePresence3, { mode: "popLayout", initial: false, children: recoverable ? /* @__PURE__ */ jsxs4(
|
|
3784
3845
|
motion3.span,
|
|
3785
3846
|
{
|
|
@@ -3896,6 +3957,7 @@ function ComposerTranscriptionControl({
|
|
|
3896
3957
|
motion3.button,
|
|
3897
3958
|
{
|
|
3898
3959
|
type: "button",
|
|
3960
|
+
"data-og-composer-dictate": true,
|
|
3899
3961
|
initial: { opacity: 0, scale: 0.96 },
|
|
3900
3962
|
animate: { opacity: 1, scale: 1 },
|
|
3901
3963
|
exit: { opacity: 0, scale: 0.96 },
|
|
@@ -3920,10 +3982,19 @@ function ComposerTranscriptionControl({
|
|
|
3920
3982
|
children: errorMessage3
|
|
3921
3983
|
}
|
|
3922
3984
|
) }) : null,
|
|
3923
|
-
/* @__PURE__ */ jsx4(
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3985
|
+
/* @__PURE__ */ jsx4(
|
|
3986
|
+
"span",
|
|
3987
|
+
{
|
|
3988
|
+
className: "sr-only",
|
|
3989
|
+
role: status === "error" ? "alert" : "status",
|
|
3990
|
+
"aria-live": "polite",
|
|
3991
|
+
children: announcement
|
|
3992
|
+
}
|
|
3993
|
+
)
|
|
3994
|
+
] })
|
|
3995
|
+
},
|
|
3996
|
+
"composer-dictate"
|
|
3997
|
+
) });
|
|
3927
3998
|
}
|
|
3928
3999
|
function VoiceWaveform({
|
|
3929
4000
|
stream,
|
|
@@ -4091,4 +4162,4 @@ export {
|
|
|
4091
4162
|
Status,
|
|
4092
4163
|
ComposerTranscriptionControl
|
|
4093
4164
|
};
|
|
4094
|
-
//# sourceMappingURL=chunk-
|
|
4165
|
+
//# sourceMappingURL=chunk-QQRM3DO3.js.map
|