@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
|
@@ -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(), [
|
|
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:
|
|
3169
|
-
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:
|
|
3334
|
-
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-
|
|
4548
|
+
//# sourceMappingURL=chunk-KSDXER4X.js.map
|