@assistant-ui/react 0.5.62 → 0.5.65
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-J2V7Y7JX.js → chunk-5KIEXJRK.js} +2 -4
- package/dist/chunk-5KIEXJRK.js.map +1 -0
- package/dist/{chunk-DCHYNTHI.js → chunk-PZ5AY32C.js} +2 -3
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/index.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +26 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/styles/index.css.map +1 -1
- package/dist/tailwindcss/index.js +1 -2
- package/dist/tailwindcss/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-DCHYNTHI.js.map +0 -1
- package/dist/chunk-J2V7Y7JX.js.map +0 -1
package/dist/index.mjs
CHANGED
@@ -2015,6 +2015,8 @@ var ComposerPrimitiveInput = forwardRef16(
|
|
2015
2015
|
disabled: disabledProp,
|
2016
2016
|
onChange,
|
2017
2017
|
onKeyDown,
|
2018
|
+
submitOnEnter = true,
|
2019
|
+
cancelOnEscape = true,
|
2018
2020
|
...rest
|
2019
2021
|
}, forwardedRef) => {
|
2020
2022
|
const threadStore = useThreadStore();
|
@@ -2028,6 +2030,7 @@ var ComposerPrimitiveInput = forwardRef16(
|
|
2028
2030
|
const textareaRef = useRef4(null);
|
2029
2031
|
const ref = useComposedRefs2(forwardedRef, textareaRef);
|
2030
2032
|
useEscapeKeydown2((e) => {
|
2033
|
+
if (!cancelOnEscape) return;
|
2031
2034
|
const composer = composerStore.getState();
|
2032
2035
|
if (composer.canCancel) {
|
2033
2036
|
composer.cancel();
|
@@ -2035,7 +2038,7 @@ var ComposerPrimitiveInput = forwardRef16(
|
|
2035
2038
|
}
|
2036
2039
|
});
|
2037
2040
|
const handleKeyPress = (e) => {
|
2038
|
-
if (isDisabled) return;
|
2041
|
+
if (isDisabled || !submitOnEnter) return;
|
2039
2042
|
if (e.nativeEvent.isComposing) return;
|
2040
2043
|
if (e.key === "Enter" && e.shiftKey === false) {
|
2041
2044
|
const { isRunning } = threadStore.getState();
|