@opengeni/react 2.5.0-canary.0 → 2.5.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-NVREJA6V.js → chunk-KSDXER4X.js} +20 -6
- package/dist/chunk-KSDXER4X.js.map +1 -0
- package/dist/components/composer.d.ts +1 -1
- package/dist/composer.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/composer.tsx +19 -5
- package/dist/chunk-NVREJA6V.js.map +0 -1
|
@@ -219,7 +219,7 @@ export declare function useChatComposerController({ delivery, draft, control, ef
|
|
|
219
219
|
handlePaste: (event: ClipboardEvent<HTMLTextAreaElement>) => void;
|
|
220
220
|
handleFileChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
221
221
|
focusInput: () => void | undefined;
|
|
222
|
-
setValue: (
|
|
222
|
+
setValue: (next: string) => void;
|
|
223
223
|
value: string;
|
|
224
224
|
};
|
|
225
225
|
export type ChatComposerController = ReturnType<typeof useChatComposerController>;
|
package/dist/composer.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/react",
|
|
3
|
-
"version": "2.5.0-canary.
|
|
3
|
+
"version": "2.5.0-canary.1",
|
|
4
4
|
"description": "React hooks and styled components for OpenGeni: live session streaming, chat composer, message timeline, session status, and fleet views — token-themed (CSS variables), dark-first, built on Tailwind v4 + Radix + Motion.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"@dnd-kit/utilities": "3.2.2",
|
|
117
117
|
"@fontsource-variable/noto-sans-arabic": "5.2.10",
|
|
118
118
|
"@fontsource-variable/noto-sans-jp": "5.2.10",
|
|
119
|
-
"@opengeni/sdk": "^2.5.0-canary.
|
|
119
|
+
"@opengeni/sdk": "^2.5.0-canary.1",
|
|
120
120
|
"clsx": "^2.1.1",
|
|
121
121
|
"lucide-react": "^1.8.0",
|
|
122
122
|
"motion": "^12.0.0",
|
|
@@ -367,6 +367,20 @@ export function useChatComposerController({
|
|
|
367
367
|
const submittingRef = useRef(false);
|
|
368
368
|
const controlOperationRef = useRef(false);
|
|
369
369
|
const mountedRef = useRef(true);
|
|
370
|
+
const deliveredValueRef = useRef(delivery.value);
|
|
371
|
+
const liveValueRef = useRef(delivery.value);
|
|
372
|
+
if (delivery.value !== deliveredValueRef.current) {
|
|
373
|
+
deliveredValueRef.current = delivery.value;
|
|
374
|
+
liveValueRef.current = delivery.value;
|
|
375
|
+
}
|
|
376
|
+
const setComposerValue = useCallback(
|
|
377
|
+
(next: string) => {
|
|
378
|
+
liveValueRef.current = next;
|
|
379
|
+
delivery.setValue(next);
|
|
380
|
+
},
|
|
381
|
+
[delivery.setValue],
|
|
382
|
+
);
|
|
383
|
+
const visibleValue = liveValueRef.current;
|
|
370
384
|
|
|
371
385
|
useEffect(() => {
|
|
372
386
|
mountedRef.current = true;
|
|
@@ -468,7 +482,7 @@ export function useChatComposerController({
|
|
|
468
482
|
applyComposerTextareaHeight(textarea, 220);
|
|
469
483
|
});
|
|
470
484
|
}, []);
|
|
471
|
-
useEffect(() => resizeInput(), [
|
|
485
|
+
useEffect(() => resizeInput(), [resizeInput, visibleValue]);
|
|
472
486
|
useEffect(
|
|
473
487
|
() => () => {
|
|
474
488
|
if (resizeInputRafRef.current !== null) {
|
|
@@ -505,8 +519,8 @@ export function useChatComposerController({
|
|
|
505
519
|
commands,
|
|
506
520
|
context: commandContext,
|
|
507
521
|
handlers,
|
|
508
|
-
value:
|
|
509
|
-
setValue:
|
|
522
|
+
value: visibleValue,
|
|
523
|
+
setValue: setComposerValue,
|
|
510
524
|
});
|
|
511
525
|
const paletteEnabled = commandContext !== undefined;
|
|
512
526
|
const commandDraftBlocked = paletteEnabled && palette.isCommandDraft;
|
|
@@ -696,8 +710,8 @@ export function useChatComposerController({
|
|
|
696
710
|
handlePaste,
|
|
697
711
|
handleFileChange,
|
|
698
712
|
focusInput: () => textareaRef.current?.focus(),
|
|
699
|
-
setValue:
|
|
700
|
-
value:
|
|
713
|
+
setValue: setComposerValue,
|
|
714
|
+
value: visibleValue,
|
|
701
715
|
};
|
|
702
716
|
}
|
|
703
717
|
|