@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.
@@ -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: (value: string) => void;
222
+ setValue: (next: string) => void;
223
223
  value: string;
224
224
  };
225
225
  export type ChatComposerController = ReturnType<typeof useChatComposerController>;
package/dist/composer.js CHANGED
@@ -37,7 +37,7 @@ import {
37
37
  useChatComposer,
38
38
  useChatComposerController,
39
39
  useVoiceInput
40
- } from "./chunk-NVREJA6V.js";
40
+ } from "./chunk-KSDXER4X.js";
41
41
  import "./chunk-T7VAYG2I.js";
42
42
  import {
43
43
  BillingClassMark,
package/dist/index.js CHANGED
@@ -109,7 +109,7 @@ import {
109
109
  useSlashCommands,
110
110
  useTranscription,
111
111
  useVoiceInput
112
- } from "./chunk-NVREJA6V.js";
112
+ } from "./chunk-KSDXER4X.js";
113
113
  import {
114
114
  FILE_ONLY_MESSAGE_TEXT,
115
115
  composeSendInput,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/react",
3
- "version": "2.5.0-canary.0",
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.0",
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(), [delivery.value, 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: delivery.value,
509
- setValue: delivery.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: delivery.setValue,
700
- value: delivery.value,
713
+ setValue: setComposerValue,
714
+ value: visibleValue,
701
715
  };
702
716
  }
703
717