@copilotkit/react-textarea 0.29.0-alpha.0 → 0.29.0
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/.turbo/turbo-build.log +428 -432
- package/CHANGELOG.md +28 -0
- package/dist/{chunk-BBZ7AWOB.mjs → chunk-4H2O7MYQ.mjs} +2 -2
- package/dist/{chunk-AZHILHKM.mjs → chunk-DKE57EAC.mjs} +2 -2
- package/dist/{chunk-VB4VNCIQ.mjs → chunk-K7GVTNZU.mjs} +8 -1
- package/dist/chunk-K7GVTNZU.mjs.map +1 -0
- package/dist/{chunk-FP2EKU3L.mjs → chunk-LCDTIJSD.mjs} +3 -3
- package/dist/{chunk-FP2EKU3L.mjs.map → chunk-LCDTIJSD.mjs.map} +1 -1
- package/dist/{chunk-SNQEBH5I.mjs → chunk-PXALH4EC.mjs} +3 -3
- package/dist/{chunk-5J3UZV77.mjs → chunk-W3TDW7EW.mjs} +2 -2
- package/dist/{chunk-B6TKVDDY.mjs → chunk-WGFQTPTF.mjs} +5 -4
- package/dist/chunk-WGFQTPTF.mjs.map +1 -0
- package/dist/components/base-copilot-textarea/base-copilot-textarea.js +67 -62
- package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -1
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +5 -5
- package/dist/components/copilot-textarea/copilot-textarea.js +67 -62
- package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
- package/dist/components/copilot-textarea/copilot-textarea.mjs +7 -7
- package/dist/components/hovering-toolbar/hovering-toolbar.js +59 -55
- package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs +3 -3
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +46 -32
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +2 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +49 -35
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +3 -2
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +49 -35
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +3 -2
- package/dist/components/index.js +67 -62
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +7 -7
- package/dist/index.js +67 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/types/autosuggestions-config/autosuggestions-config.js +2 -2
- package/dist/types/autosuggestions-config/autosuggestions-config.js.map +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs +2 -2
- package/dist/types/autosuggestions-config/index.js +2 -2
- package/dist/types/autosuggestions-config/index.js.map +1 -1
- package/dist/types/autosuggestions-config/index.mjs +2 -2
- package/dist/types/base/base-autosuggestions-config.d.ts +1 -1
- package/dist/types/base/base-autosuggestions-config.js +2 -2
- package/dist/types/base/base-autosuggestions-config.js.map +1 -1
- package/dist/types/base/base-autosuggestions-config.mjs +1 -1
- package/dist/types/base/base-copilot-textarea-props.d.ts +1 -0
- package/dist/types/base/base-copilot-textarea-props.js.map +1 -1
- package/dist/types/base/index.js +2 -2
- package/dist/types/base/index.js.map +1 -1
- package/dist/types/base/index.mjs +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +2 -2
- package/package.json +6 -6
- package/src/components/base-copilot-textarea/base-copilot-textarea.tsx +3 -1
- package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx +6 -0
- package/src/types/base/base-autosuggestions-config.tsx +6 -2
- package/src/types/base/base-copilot-textarea-props.tsx +1 -0
- package/dist/chunk-B6TKVDDY.mjs.map +0 -1
- package/dist/chunk-VB4VNCIQ.mjs.map +0 -1
- /package/dist/{chunk-BBZ7AWOB.mjs.map → chunk-4H2O7MYQ.mjs.map} +0 -0
- /package/dist/{chunk-AZHILHKM.mjs.map → chunk-DKE57EAC.mjs.map} +0 -0
- /package/dist/{chunk-SNQEBH5I.mjs.map → chunk-PXALH4EC.mjs.map} +0 -0
- /package/dist/{chunk-5J3UZV77.mjs.map → chunk-W3TDW7EW.mjs.map} +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import "../../../chunk-L7VVZH4Q.mjs";
|
|
2
2
|
import {
|
|
3
3
|
HoveringInsertionPromptBox
|
|
4
|
-
} from "../../../chunk-
|
|
5
|
-
import "../../../chunk-
|
|
4
|
+
} from "../../../chunk-4H2O7MYQ.mjs";
|
|
5
|
+
import "../../../chunk-K7GVTNZU.mjs";
|
|
6
6
|
import "../../../chunk-SX6NY5FW.mjs";
|
|
7
7
|
import "../../../chunk-3PQ7GSFE.mjs";
|
|
8
8
|
import "../../../chunk-WFTAAA7R.mjs";
|
|
9
9
|
import "../../../chunk-KFQZHRPJ.mjs";
|
|
10
|
+
import "../../../chunk-LYB4B6MK.mjs";
|
|
10
11
|
import "../../../chunk-FJNUPSQK.mjs";
|
|
11
12
|
import "../../../chunk-WTASPE2W.mjs";
|
|
12
13
|
import "../../../chunk-PTZVE6NC.mjs";
|
package/dist/components/index.js
CHANGED
|
@@ -639,8 +639,8 @@ function clearAutocompletionsFromEditor(editor) {
|
|
|
639
639
|
|
|
640
640
|
// src/types/base/base-autosuggestions-config.tsx
|
|
641
641
|
var import_react_core = require("@copilotkit/react-core");
|
|
642
|
-
var defaultShouldToggleHoveringEditorOnKeyPress = (event) => {
|
|
643
|
-
if (event.key ===
|
|
642
|
+
var defaultShouldToggleHoveringEditorOnKeyPress = (event, shortcut) => {
|
|
643
|
+
if (event.key === shortcut && event.metaKey) {
|
|
644
644
|
return true;
|
|
645
645
|
}
|
|
646
646
|
return false;
|
|
@@ -898,7 +898,7 @@ var Label = React4.forwardRef((_a, ref) => {
|
|
|
898
898
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
899
899
|
|
|
900
900
|
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
|
|
901
|
-
var
|
|
901
|
+
var import_react7 = require("react");
|
|
902
902
|
|
|
903
903
|
// src/lib/stream-promise-flatten.ts
|
|
904
904
|
function streamPromiseFlatten(promise) {
|
|
@@ -969,37 +969,51 @@ var FileChipPreview = ({ filePointer, onDelete }) => {
|
|
|
969
969
|
);
|
|
970
970
|
};
|
|
971
971
|
|
|
972
|
-
// src/components/hovering-toolbar/
|
|
972
|
+
// src/components/hovering-toolbar/hovering-editor-provider.tsx
|
|
973
|
+
var import_react6 = require("react");
|
|
973
974
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
975
|
+
var HoveringEditorContext = (0, import_react6.createContext)({
|
|
976
|
+
isDisplayed: false,
|
|
977
|
+
setIsDisplayed: () => {
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
var HoveringEditorProvider = ({ children }) => {
|
|
981
|
+
const [isDisplayed, setIsDisplayed] = (0, import_react6.useState)(false);
|
|
982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HoveringEditorContext.Provider, { value: { isDisplayed, setIsDisplayed }, children });
|
|
983
|
+
};
|
|
984
|
+
var useHoveringEditorContext = () => (0, import_react6.useContext)(HoveringEditorContext);
|
|
985
|
+
|
|
986
|
+
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
|
|
987
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
974
988
|
var HoveringInsertionPromptBoxCore = ({
|
|
975
989
|
performInsertion,
|
|
976
990
|
state,
|
|
977
991
|
insertionOrEditingFunction,
|
|
978
992
|
contextCategories
|
|
979
993
|
}) => {
|
|
980
|
-
const { getDocumentsContext } = (0,
|
|
981
|
-
const [editSuggestion, setEditSuggestion] = (0,
|
|
982
|
-
const [suggestionIsLoading, setSuggestionIsLoading] = (0,
|
|
983
|
-
const [adjustmentPrompt, setAdjustmentPrompt] = (0,
|
|
984
|
-
const [generatingSuggestion, setGeneratingSuggestion] = (0,
|
|
994
|
+
const { getDocumentsContext } = (0, import_react7.useContext)(import_react_core2.CopilotContext);
|
|
995
|
+
const [editSuggestion, setEditSuggestion] = (0, import_react7.useState)("");
|
|
996
|
+
const [suggestionIsLoading, setSuggestionIsLoading] = (0, import_react7.useState)(false);
|
|
997
|
+
const [adjustmentPrompt, setAdjustmentPrompt] = (0, import_react7.useState)("");
|
|
998
|
+
const [generatingSuggestion, setGeneratingSuggestion] = (0, import_react7.useState)(
|
|
985
999
|
null
|
|
986
1000
|
);
|
|
987
|
-
const adjustmentTextAreaRef = (0,
|
|
988
|
-
const suggestionTextAreaRef = (0,
|
|
989
|
-
const [filePointers, setFilePointers] = (0,
|
|
990
|
-
const [suggestedFiles, setSuggestedFiles] = (0,
|
|
991
|
-
(0,
|
|
1001
|
+
const adjustmentTextAreaRef = (0, import_react7.useRef)(null);
|
|
1002
|
+
const suggestionTextAreaRef = (0, import_react7.useRef)(null);
|
|
1003
|
+
const [filePointers, setFilePointers] = (0, import_react7.useState)([]);
|
|
1004
|
+
const [suggestedFiles, setSuggestedFiles] = (0, import_react7.useState)([]);
|
|
1005
|
+
(0, import_react7.useEffect)(() => {
|
|
992
1006
|
setSuggestedFiles(getDocumentsContext(contextCategories));
|
|
993
1007
|
}, [contextCategories, getDocumentsContext]);
|
|
994
1008
|
use_autosize_textarea_default(suggestionTextAreaRef, editSuggestion || "");
|
|
995
1009
|
use_autosize_textarea_default(adjustmentTextAreaRef, adjustmentPrompt || "");
|
|
996
|
-
(0,
|
|
1010
|
+
(0, import_react7.useEffect)(() => {
|
|
997
1011
|
setTimeout(() => {
|
|
998
1012
|
var _a;
|
|
999
1013
|
(_a = adjustmentTextAreaRef.current) == null ? void 0 : _a.focus();
|
|
1000
1014
|
}, 0);
|
|
1001
1015
|
}, []);
|
|
1002
|
-
(0,
|
|
1016
|
+
(0, import_react7.useEffect)(() => {
|
|
1003
1017
|
if (!generatingSuggestion) {
|
|
1004
1018
|
return;
|
|
1005
1019
|
}
|
|
@@ -1037,7 +1051,7 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1037
1051
|
releaseLockIfNotClosed();
|
|
1038
1052
|
};
|
|
1039
1053
|
}, [generatingSuggestion]);
|
|
1040
|
-
const beginGeneratingAdjustment = (0,
|
|
1054
|
+
const beginGeneratingAdjustment = (0, import_react7.useCallback)(() => __async(void 0, null, function* () {
|
|
1041
1055
|
if (!adjustmentPrompt.trim()) {
|
|
1042
1056
|
return;
|
|
1043
1057
|
}
|
|
@@ -1066,10 +1080,11 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1066
1080
|
const textToEdit = editSuggestion || state.editorState.selectedText;
|
|
1067
1081
|
const adjustmentLabel = textToEdit === "" ? "Describe the text you want to insert" : "Describe adjustments to the suggested text";
|
|
1068
1082
|
const placeholder = textToEdit === "" ? "e.g. 'summarize the client's top 3 pain-points from @CallTranscript'" : "e.g. 'make it more formal', 'be more specific', ...";
|
|
1069
|
-
const
|
|
1070
|
-
|
|
1071
|
-
/* @__PURE__ */ (0,
|
|
1072
|
-
|
|
1083
|
+
const { setIsDisplayed } = useHoveringEditorContext();
|
|
1084
|
+
const AdjustmentPromptComponent = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1085
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Label, { className: "", children: adjustmentLabel }),
|
|
1086
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative w-full flex items-center", children: [
|
|
1087
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1073
1088
|
"textarea",
|
|
1074
1089
|
{
|
|
1075
1090
|
disabled: suggestionIsLoading,
|
|
@@ -1083,6 +1098,9 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1083
1098
|
} else if (e.key === "Enter") {
|
|
1084
1099
|
e.preventDefault();
|
|
1085
1100
|
beginGeneratingAdjustment();
|
|
1101
|
+
} else if (e.key == "Escape") {
|
|
1102
|
+
e.preventDefault();
|
|
1103
|
+
setIsDisplayed(false);
|
|
1086
1104
|
}
|
|
1087
1105
|
},
|
|
1088
1106
|
placeholder,
|
|
@@ -1091,29 +1109,29 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1091
1109
|
rows: 1
|
|
1092
1110
|
}
|
|
1093
1111
|
),
|
|
1094
|
-
/* @__PURE__ */ (0,
|
|
1112
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1095
1113
|
"button",
|
|
1096
1114
|
{
|
|
1097
1115
|
onClick: beginGeneratingAdjustment,
|
|
1098
1116
|
className: "absolute right-2 bg-blue-500 text-white w-8 h-8 rounded-full flex items-center justify-center",
|
|
1099
|
-
children: /* @__PURE__ */ (0,
|
|
1117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { className: "material-icons", children: "arrow_forward" })
|
|
1100
1118
|
}
|
|
1101
1119
|
)
|
|
1102
1120
|
] })
|
|
1103
1121
|
] });
|
|
1104
|
-
const SuggestionComponent = /* @__PURE__ */ (0,
|
|
1105
|
-
/* @__PURE__ */ (0,
|
|
1106
|
-
/* @__PURE__ */ (0,
|
|
1107
|
-
/* @__PURE__ */ (0,
|
|
1122
|
+
const SuggestionComponent = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1123
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex justify-between items-end w-full", children: [
|
|
1124
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Label, { className: "mt-4", children: "Suggested:" }),
|
|
1125
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "ml-auto", children: isLoading && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1108
1126
|
"div",
|
|
1109
1127
|
{
|
|
1110
1128
|
className: "inline-block h-4 w-4 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",
|
|
1111
1129
|
role: "status",
|
|
1112
|
-
children: /* @__PURE__ */ (0,
|
|
1130
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]", children: "Loading..." })
|
|
1113
1131
|
}
|
|
1114
1132
|
) }) })
|
|
1115
1133
|
] }),
|
|
1116
|
-
/* @__PURE__ */ (0,
|
|
1134
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1117
1135
|
"textarea",
|
|
1118
1136
|
{
|
|
1119
1137
|
ref: suggestionTextAreaRef,
|
|
@@ -1125,7 +1143,7 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1125
1143
|
}
|
|
1126
1144
|
)
|
|
1127
1145
|
] });
|
|
1128
|
-
const SubmitComponent = /* @__PURE__ */ (0,
|
|
1146
|
+
const SubmitComponent = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex w-full gap-4 justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1129
1147
|
Button,
|
|
1130
1148
|
{
|
|
1131
1149
|
className: " bg-green-700 text-white",
|
|
@@ -1134,16 +1152,16 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1134
1152
|
},
|
|
1135
1153
|
children: [
|
|
1136
1154
|
"Insert ",
|
|
1137
|
-
/* @__PURE__ */ (0,
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { className: "material-icons", children: "check" })
|
|
1138
1156
|
]
|
|
1139
1157
|
}
|
|
1140
1158
|
) });
|
|
1141
1159
|
const sourceSearchCandidate = adjustmentPrompt.split(" ").pop();
|
|
1142
1160
|
const sourceSearchWord = (sourceSearchCandidate == null ? void 0 : sourceSearchCandidate.startsWith("@")) ? sourceSearchCandidate.slice(1) : void 0;
|
|
1143
|
-
return /* @__PURE__ */ (0,
|
|
1161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w-full flex flex-col items-start relative gap-2", children: [
|
|
1144
1162
|
AdjustmentPromptComponent,
|
|
1145
|
-
filePointers.length > 0 && /* @__PURE__ */ (0,
|
|
1146
|
-
sourceSearchWord !== void 0 && /* @__PURE__ */ (0,
|
|
1163
|
+
filePointers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IncludedFilesPreview, { includedFiles: filePointers, setIncludedFiles: setFilePointers }),
|
|
1164
|
+
sourceSearchWord !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1147
1165
|
SourceSearchBox,
|
|
1148
1166
|
{
|
|
1149
1167
|
searchTerm: sourceSearchWord,
|
|
@@ -1162,14 +1180,14 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1162
1180
|
};
|
|
1163
1181
|
|
|
1164
1182
|
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
|
|
1165
|
-
var
|
|
1183
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1166
1184
|
var HoveringInsertionPromptBox = (props) => {
|
|
1167
|
-
return /* @__PURE__ */ (0,
|
|
1185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1168
1186
|
"div",
|
|
1169
1187
|
{
|
|
1170
1188
|
className: "flex flex-col justify-center items-center space-y-4 rounded-md border shadow-lg p-4 border-gray- bg-white",
|
|
1171
1189
|
style: { width: "35rem" },
|
|
1172
|
-
children: /* @__PURE__ */ (0,
|
|
1190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1173
1191
|
HoveringInsertionPromptBoxCore,
|
|
1174
1192
|
{
|
|
1175
1193
|
state: {
|
|
@@ -1186,10 +1204,10 @@ var HoveringInsertionPromptBox = (props) => {
|
|
|
1186
1204
|
|
|
1187
1205
|
// src/components/hovering-toolbar/hovering-toolbar-components.tsx
|
|
1188
1206
|
var import_css = require("@emotion/css");
|
|
1189
|
-
var
|
|
1207
|
+
var import_react8 = __toESM(require("react"));
|
|
1190
1208
|
var import_react_dom = __toESM(require("react-dom"));
|
|
1191
|
-
var
|
|
1192
|
-
var Button2 =
|
|
1209
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1210
|
+
var Button2 = import_react8.default.forwardRef(
|
|
1193
1211
|
(_a, ref) => {
|
|
1194
1212
|
var _b = _a, {
|
|
1195
1213
|
className,
|
|
@@ -1200,7 +1218,7 @@ var Button2 = import_react7.default.forwardRef(
|
|
|
1200
1218
|
"active",
|
|
1201
1219
|
"reversed"
|
|
1202
1220
|
]);
|
|
1203
|
-
return /* @__PURE__ */ (0,
|
|
1221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1204
1222
|
"span",
|
|
1205
1223
|
__spreadProps(__spreadValues({}, props), {
|
|
1206
1224
|
ref,
|
|
@@ -1215,10 +1233,10 @@ var Button2 = import_react7.default.forwardRef(
|
|
|
1215
1233
|
);
|
|
1216
1234
|
}
|
|
1217
1235
|
);
|
|
1218
|
-
var Icon =
|
|
1236
|
+
var Icon = import_react8.default.forwardRef(
|
|
1219
1237
|
(_a, ref) => {
|
|
1220
1238
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1221
|
-
return /* @__PURE__ */ (0,
|
|
1239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1222
1240
|
"span",
|
|
1223
1241
|
__spreadProps(__spreadValues({}, props), {
|
|
1224
1242
|
ref,
|
|
@@ -1234,10 +1252,10 @@ var Icon = import_react7.default.forwardRef(
|
|
|
1234
1252
|
);
|
|
1235
1253
|
}
|
|
1236
1254
|
);
|
|
1237
|
-
var Menu =
|
|
1255
|
+
var Menu = import_react8.default.forwardRef(
|
|
1238
1256
|
(_a, ref) => {
|
|
1239
1257
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1240
|
-
return /* @__PURE__ */ (0,
|
|
1258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1241
1259
|
"div",
|
|
1242
1260
|
__spreadProps(__spreadValues({}, props), {
|
|
1243
1261
|
"data-test-id": "menu",
|
|
@@ -1261,10 +1279,10 @@ var Menu = import_react7.default.forwardRef(
|
|
|
1261
1279
|
var Portal = ({ children }) => {
|
|
1262
1280
|
return typeof document === "object" ? import_react_dom.default.createPortal(children, document.body) : null;
|
|
1263
1281
|
};
|
|
1264
|
-
var Toolbar =
|
|
1282
|
+
var Toolbar = import_react8.default.forwardRef(
|
|
1265
1283
|
(_a, ref) => {
|
|
1266
1284
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1267
|
-
return /* @__PURE__ */ (0,
|
|
1285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1268
1286
|
Menu,
|
|
1269
1287
|
__spreadProps(__spreadValues({}, props), {
|
|
1270
1288
|
ref,
|
|
@@ -1283,20 +1301,6 @@ var Toolbar = import_react7.default.forwardRef(
|
|
|
1283
1301
|
}
|
|
1284
1302
|
);
|
|
1285
1303
|
|
|
1286
|
-
// src/components/hovering-toolbar/hovering-editor-provider.tsx
|
|
1287
|
-
var import_react8 = require("react");
|
|
1288
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1289
|
-
var HoveringEditorContext = (0, import_react8.createContext)({
|
|
1290
|
-
isDisplayed: false,
|
|
1291
|
-
setIsDisplayed: () => {
|
|
1292
|
-
}
|
|
1293
|
-
});
|
|
1294
|
-
var HoveringEditorProvider = ({ children }) => {
|
|
1295
|
-
const [isDisplayed, setIsDisplayed] = (0, import_react8.useState)(false);
|
|
1296
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(HoveringEditorContext.Provider, { value: { isDisplayed, setIsDisplayed }, children });
|
|
1297
|
-
};
|
|
1298
|
-
var useHoveringEditorContext = () => (0, import_react8.useContext)(HoveringEditorContext);
|
|
1299
|
-
|
|
1300
1304
|
// src/components/hovering-toolbar/hovering-toolbar.tsx
|
|
1301
1305
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1302
1306
|
var HoveringToolbar = (props) => {
|
|
@@ -1636,7 +1640,8 @@ var BaseCopilotTextareaWithHoveringContext = import_react12.default.forwardRef(
|
|
|
1636
1640
|
);
|
|
1637
1641
|
const onKeyDownHandlerForHoveringEditor = (0, import_react12.useCallback)(
|
|
1638
1642
|
(event) => {
|
|
1639
|
-
|
|
1643
|
+
var _a2;
|
|
1644
|
+
if (autosuggestionsConfig.shouldToggleHoveringEditorOnKeyPress(event, (_a2 = props.shortcut) != null ? _a2 : "k")) {
|
|
1640
1645
|
event.preventDefault();
|
|
1641
1646
|
setHoveringEditorIsDisplayed(!hoveringEditorIsDisplayed);
|
|
1642
1647
|
}
|