@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.
@@ -3047,6 +3047,20 @@ function useChatComposerController({
3047
3047
  const submittingRef = useRef4(false);
3048
3048
  const controlOperationRef = useRef4(false);
3049
3049
  const mountedRef = useRef4(true);
3050
+ const deliveredValueRef = useRef4(delivery.value);
3051
+ const liveValueRef = useRef4(delivery.value);
3052
+ if (delivery.value !== deliveredValueRef.current) {
3053
+ deliveredValueRef.current = delivery.value;
3054
+ liveValueRef.current = delivery.value;
3055
+ }
3056
+ const setComposerValue = useCallback4(
3057
+ (next) => {
3058
+ liveValueRef.current = next;
3059
+ delivery.setValue(next);
3060
+ },
3061
+ [delivery.setValue]
3062
+ );
3063
+ const visibleValue = liveValueRef.current;
3050
3064
  useEffect3(() => {
3051
3065
  mountedRef.current = true;
3052
3066
  return () => {
@@ -3131,7 +3145,7 @@ function useChatComposerController({
3131
3145
  applyComposerTextareaHeight(textarea, 220);
3132
3146
  });
3133
3147
  }, []);
3134
- useEffect3(() => resizeInput(), [delivery.value, resizeInput]);
3148
+ useEffect3(() => resizeInput(), [resizeInput, visibleValue]);
3135
3149
  useEffect3(
3136
3150
  () => () => {
3137
3151
  if (resizeInputRafRef.current !== null) {
@@ -3165,8 +3179,8 @@ function useChatComposerController({
3165
3179
  commands,
3166
3180
  context: commandContext,
3167
3181
  handlers,
3168
- value: delivery.value,
3169
- setValue: delivery.setValue
3182
+ value: visibleValue,
3183
+ setValue: setComposerValue
3170
3184
  });
3171
3185
  const paletteEnabled = commandContext !== void 0;
3172
3186
  const commandDraftBlocked = paletteEnabled && palette.isCommandDraft;
@@ -3330,8 +3344,8 @@ function useChatComposerController({
3330
3344
  handlePaste,
3331
3345
  handleFileChange,
3332
3346
  focusInput: () => textareaRef.current?.focus(),
3333
- setValue: delivery.setValue,
3334
- value: delivery.value
3347
+ setValue: setComposerValue,
3348
+ value: visibleValue
3335
3349
  };
3336
3350
  }
3337
3351
  var ComposerContext = createContext(null);
@@ -4531,4 +4545,4 @@ export {
4531
4545
  Status,
4532
4546
  ComposerTranscriptionControl
4533
4547
  };
4534
- //# sourceMappingURL=chunk-NVREJA6V.js.map
4548
+ //# sourceMappingURL=chunk-KSDXER4X.js.map