@copilotkit/react-textarea 1.53.1-next.0 → 1.53.1-next.2
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/CHANGELOG.md +17 -0
- package/dist/index.cjs +22 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +22 -0
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +22 -0
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/components/hovering-toolbar/hovering-toolbar.tsx +31 -1
- package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 1.53.1-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @copilotkit/react-core@1.53.1-next.2
|
|
8
|
+
- @copilotkit/runtime-client-gql@1.53.1-next.2
|
|
9
|
+
- @copilotkit/shared@1.53.1-next.2
|
|
10
|
+
|
|
11
|
+
## 1.53.1-next.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 40c22a0: fix: restore focus to textarea when hitting Escape in CMD+K popup
|
|
16
|
+
- @copilotkit/react-core@1.53.1-next.1
|
|
17
|
+
- @copilotkit/runtime-client-gql@1.53.1-next.1
|
|
18
|
+
- @copilotkit/shared@1.53.1-next.1
|
|
19
|
+
|
|
3
20
|
## 1.53.1-next.0
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -895,6 +895,9 @@ const HoveringInsertionPromptBoxCore = ({ performInsertion, state, insertionOrEd
|
|
|
895
895
|
} else if (e.key === "Enter") {
|
|
896
896
|
e.preventDefault();
|
|
897
897
|
beginGeneratingAdjustment();
|
|
898
|
+
} else if (e.key === "Escape") {
|
|
899
|
+
e.preventDefault();
|
|
900
|
+
setIsDisplayed(false);
|
|
898
901
|
}
|
|
899
902
|
},
|
|
900
903
|
placeholder,
|
|
@@ -1041,6 +1044,25 @@ const HoveringToolbar = (props) => {
|
|
|
1041
1044
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1042
1045
|
};
|
|
1043
1046
|
}, [ref, setIsDisplayed]);
|
|
1047
|
+
(0, react.useEffect)(() => {
|
|
1048
|
+
const handleEscapeKey = (event) => {
|
|
1049
|
+
if (event.key === "Escape") {
|
|
1050
|
+
event.preventDefault();
|
|
1051
|
+
setIsDisplayed(false);
|
|
1052
|
+
try {
|
|
1053
|
+
slate_react.ReactEditor.focus(editor);
|
|
1054
|
+
} catch {}
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
if (isDisplayed) document.addEventListener("keydown", handleEscapeKey);
|
|
1058
|
+
return () => {
|
|
1059
|
+
document.removeEventListener("keydown", handleEscapeKey);
|
|
1060
|
+
};
|
|
1061
|
+
}, [
|
|
1062
|
+
isDisplayed,
|
|
1063
|
+
setIsDisplayed,
|
|
1064
|
+
editor
|
|
1065
|
+
]);
|
|
1044
1066
|
if (!isShown) return null;
|
|
1045
1067
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu, {
|
|
1046
1068
|
ref,
|