@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,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCopilotTextarea
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-WGFQTPTF.mjs";
|
|
4
4
|
import "../../chunk-DRV2FOHZ.mjs";
|
|
5
5
|
import "../../chunk-4NHVQZ67.mjs";
|
|
6
6
|
import "../../chunk-VPEH6V7T.mjs";
|
|
@@ -11,10 +11,10 @@ import "../../chunk-72P3KOHZ.mjs";
|
|
|
11
11
|
import "../../chunk-JJLQVT7S.mjs";
|
|
12
12
|
import "../../chunk-LQ2OWQU7.mjs";
|
|
13
13
|
import "../../chunk-7LSRNPNI.mjs";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-W3TDW7EW.mjs";
|
|
15
15
|
import "../../chunk-L7VVZH4Q.mjs";
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-4H2O7MYQ.mjs";
|
|
17
|
+
import "../../chunk-K7GVTNZU.mjs";
|
|
18
18
|
import "../../chunk-SX6NY5FW.mjs";
|
|
19
19
|
import "../../chunk-3PQ7GSFE.mjs";
|
|
20
20
|
import "../../chunk-WFTAAA7R.mjs";
|
|
@@ -27,7 +27,7 @@ import "../../chunk-PTZVE6NC.mjs";
|
|
|
27
27
|
import "../../chunk-2QDCE7PD.mjs";
|
|
28
28
|
import "../../chunk-7SUZ6CXM.mjs";
|
|
29
29
|
import "../../chunk-WJHSY5T6.mjs";
|
|
30
|
-
import "../../chunk-
|
|
30
|
+
import "../../chunk-LCDTIJSD.mjs";
|
|
31
31
|
import "../../chunk-224UKA7C.mjs";
|
|
32
32
|
import "../../chunk-XW3ICO4S.mjs";
|
|
33
33
|
import "../../chunk-M2DR4KVB.mjs";
|
|
@@ -158,8 +158,8 @@ function useMakeStandardAutosuggestionFunction(textareaPurpose, contextCategorie
|
|
|
158
158
|
|
|
159
159
|
// src/types/base/base-autosuggestions-config.tsx
|
|
160
160
|
var import_react_core3 = require("@copilotkit/react-core");
|
|
161
|
-
var defaultShouldToggleHoveringEditorOnKeyPress = (event) => {
|
|
162
|
-
if (event.key ===
|
|
161
|
+
var defaultShouldToggleHoveringEditorOnKeyPress = (event, shortcut) => {
|
|
162
|
+
if (event.key === shortcut && event.metaKey) {
|
|
163
163
|
return true;
|
|
164
164
|
}
|
|
165
165
|
return false;
|
|
@@ -1198,7 +1198,7 @@ var Label = React4.forwardRef((_a, ref) => {
|
|
|
1198
1198
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
1199
1199
|
|
|
1200
1200
|
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
|
|
1201
|
-
var
|
|
1201
|
+
var import_react8 = require("react");
|
|
1202
1202
|
|
|
1203
1203
|
// src/lib/stream-promise-flatten.ts
|
|
1204
1204
|
function streamPromiseFlatten(promise) {
|
|
@@ -1269,37 +1269,51 @@ var FileChipPreview = ({ filePointer, onDelete }) => {
|
|
|
1269
1269
|
);
|
|
1270
1270
|
};
|
|
1271
1271
|
|
|
1272
|
-
// src/components/hovering-toolbar/
|
|
1272
|
+
// src/components/hovering-toolbar/hovering-editor-provider.tsx
|
|
1273
|
+
var import_react7 = require("react");
|
|
1273
1274
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1275
|
+
var HoveringEditorContext = (0, import_react7.createContext)({
|
|
1276
|
+
isDisplayed: false,
|
|
1277
|
+
setIsDisplayed: () => {
|
|
1278
|
+
}
|
|
1279
|
+
});
|
|
1280
|
+
var HoveringEditorProvider = ({ children }) => {
|
|
1281
|
+
const [isDisplayed, setIsDisplayed] = (0, import_react7.useState)(false);
|
|
1282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HoveringEditorContext.Provider, { value: { isDisplayed, setIsDisplayed }, children });
|
|
1283
|
+
};
|
|
1284
|
+
var useHoveringEditorContext = () => (0, import_react7.useContext)(HoveringEditorContext);
|
|
1285
|
+
|
|
1286
|
+
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
|
|
1287
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1274
1288
|
var HoveringInsertionPromptBoxCore = ({
|
|
1275
1289
|
performInsertion,
|
|
1276
1290
|
state,
|
|
1277
1291
|
insertionOrEditingFunction,
|
|
1278
1292
|
contextCategories
|
|
1279
1293
|
}) => {
|
|
1280
|
-
const { getDocumentsContext } = (0,
|
|
1281
|
-
const [editSuggestion, setEditSuggestion] = (0,
|
|
1282
|
-
const [suggestionIsLoading, setSuggestionIsLoading] = (0,
|
|
1283
|
-
const [adjustmentPrompt, setAdjustmentPrompt] = (0,
|
|
1284
|
-
const [generatingSuggestion, setGeneratingSuggestion] = (0,
|
|
1294
|
+
const { getDocumentsContext } = (0, import_react8.useContext)(import_react_core5.CopilotContext);
|
|
1295
|
+
const [editSuggestion, setEditSuggestion] = (0, import_react8.useState)("");
|
|
1296
|
+
const [suggestionIsLoading, setSuggestionIsLoading] = (0, import_react8.useState)(false);
|
|
1297
|
+
const [adjustmentPrompt, setAdjustmentPrompt] = (0, import_react8.useState)("");
|
|
1298
|
+
const [generatingSuggestion, setGeneratingSuggestion] = (0, import_react8.useState)(
|
|
1285
1299
|
null
|
|
1286
1300
|
);
|
|
1287
|
-
const adjustmentTextAreaRef = (0,
|
|
1288
|
-
const suggestionTextAreaRef = (0,
|
|
1289
|
-
const [filePointers, setFilePointers] = (0,
|
|
1290
|
-
const [suggestedFiles, setSuggestedFiles] = (0,
|
|
1291
|
-
(0,
|
|
1301
|
+
const adjustmentTextAreaRef = (0, import_react8.useRef)(null);
|
|
1302
|
+
const suggestionTextAreaRef = (0, import_react8.useRef)(null);
|
|
1303
|
+
const [filePointers, setFilePointers] = (0, import_react8.useState)([]);
|
|
1304
|
+
const [suggestedFiles, setSuggestedFiles] = (0, import_react8.useState)([]);
|
|
1305
|
+
(0, import_react8.useEffect)(() => {
|
|
1292
1306
|
setSuggestedFiles(getDocumentsContext(contextCategories));
|
|
1293
1307
|
}, [contextCategories, getDocumentsContext]);
|
|
1294
1308
|
use_autosize_textarea_default(suggestionTextAreaRef, editSuggestion || "");
|
|
1295
1309
|
use_autosize_textarea_default(adjustmentTextAreaRef, adjustmentPrompt || "");
|
|
1296
|
-
(0,
|
|
1310
|
+
(0, import_react8.useEffect)(() => {
|
|
1297
1311
|
setTimeout(() => {
|
|
1298
1312
|
var _a;
|
|
1299
1313
|
(_a = adjustmentTextAreaRef.current) == null ? void 0 : _a.focus();
|
|
1300
1314
|
}, 0);
|
|
1301
1315
|
}, []);
|
|
1302
|
-
(0,
|
|
1316
|
+
(0, import_react8.useEffect)(() => {
|
|
1303
1317
|
if (!generatingSuggestion) {
|
|
1304
1318
|
return;
|
|
1305
1319
|
}
|
|
@@ -1337,7 +1351,7 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1337
1351
|
releaseLockIfNotClosed();
|
|
1338
1352
|
};
|
|
1339
1353
|
}, [generatingSuggestion]);
|
|
1340
|
-
const beginGeneratingAdjustment = (0,
|
|
1354
|
+
const beginGeneratingAdjustment = (0, import_react8.useCallback)(() => __async(void 0, null, function* () {
|
|
1341
1355
|
if (!adjustmentPrompt.trim()) {
|
|
1342
1356
|
return;
|
|
1343
1357
|
}
|
|
@@ -1366,10 +1380,11 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1366
1380
|
const textToEdit = editSuggestion || state.editorState.selectedText;
|
|
1367
1381
|
const adjustmentLabel = textToEdit === "" ? "Describe the text you want to insert" : "Describe adjustments to the suggested text";
|
|
1368
1382
|
const placeholder = textToEdit === "" ? "e.g. 'summarize the client's top 3 pain-points from @CallTranscript'" : "e.g. 'make it more formal', 'be more specific', ...";
|
|
1369
|
-
const
|
|
1370
|
-
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
|
|
1383
|
+
const { setIsDisplayed } = useHoveringEditorContext();
|
|
1384
|
+
const AdjustmentPromptComponent = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Label, { className: "", children: adjustmentLabel }),
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative w-full flex items-center", children: [
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1373
1388
|
"textarea",
|
|
1374
1389
|
{
|
|
1375
1390
|
disabled: suggestionIsLoading,
|
|
@@ -1383,6 +1398,9 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1383
1398
|
} else if (e.key === "Enter") {
|
|
1384
1399
|
e.preventDefault();
|
|
1385
1400
|
beginGeneratingAdjustment();
|
|
1401
|
+
} else if (e.key == "Escape") {
|
|
1402
|
+
e.preventDefault();
|
|
1403
|
+
setIsDisplayed(false);
|
|
1386
1404
|
}
|
|
1387
1405
|
},
|
|
1388
1406
|
placeholder,
|
|
@@ -1391,29 +1409,29 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1391
1409
|
rows: 1
|
|
1392
1410
|
}
|
|
1393
1411
|
),
|
|
1394
|
-
/* @__PURE__ */ (0,
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1395
1413
|
"button",
|
|
1396
1414
|
{
|
|
1397
1415
|
onClick: beginGeneratingAdjustment,
|
|
1398
1416
|
className: "absolute right-2 bg-blue-500 text-white w-8 h-8 rounded-full flex items-center justify-center",
|
|
1399
|
-
children: /* @__PURE__ */ (0,
|
|
1417
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { className: "material-icons", children: "arrow_forward" })
|
|
1400
1418
|
}
|
|
1401
1419
|
)
|
|
1402
1420
|
] })
|
|
1403
1421
|
] });
|
|
1404
|
-
const SuggestionComponent = /* @__PURE__ */ (0,
|
|
1405
|
-
/* @__PURE__ */ (0,
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1407
|
-
/* @__PURE__ */ (0,
|
|
1422
|
+
const SuggestionComponent = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1423
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex justify-between items-end w-full", children: [
|
|
1424
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Label, { className: "mt-4", children: "Suggested:" }),
|
|
1425
|
+
/* @__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)(
|
|
1408
1426
|
"div",
|
|
1409
1427
|
{
|
|
1410
1428
|
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]",
|
|
1411
1429
|
role: "status",
|
|
1412
|
-
children: /* @__PURE__ */ (0,
|
|
1430
|
+
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..." })
|
|
1413
1431
|
}
|
|
1414
1432
|
) }) })
|
|
1415
1433
|
] }),
|
|
1416
|
-
/* @__PURE__ */ (0,
|
|
1434
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1417
1435
|
"textarea",
|
|
1418
1436
|
{
|
|
1419
1437
|
ref: suggestionTextAreaRef,
|
|
@@ -1425,7 +1443,7 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1425
1443
|
}
|
|
1426
1444
|
)
|
|
1427
1445
|
] });
|
|
1428
|
-
const SubmitComponent = /* @__PURE__ */ (0,
|
|
1446
|
+
const SubmitComponent = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex w-full gap-4 justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1429
1447
|
Button,
|
|
1430
1448
|
{
|
|
1431
1449
|
className: " bg-green-700 text-white",
|
|
@@ -1434,16 +1452,16 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1434
1452
|
},
|
|
1435
1453
|
children: [
|
|
1436
1454
|
"Insert ",
|
|
1437
|
-
/* @__PURE__ */ (0,
|
|
1455
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { className: "material-icons", children: "check" })
|
|
1438
1456
|
]
|
|
1439
1457
|
}
|
|
1440
1458
|
) });
|
|
1441
1459
|
const sourceSearchCandidate = adjustmentPrompt.split(" ").pop();
|
|
1442
1460
|
const sourceSearchWord = (sourceSearchCandidate == null ? void 0 : sourceSearchCandidate.startsWith("@")) ? sourceSearchCandidate.slice(1) : void 0;
|
|
1443
|
-
return /* @__PURE__ */ (0,
|
|
1461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w-full flex flex-col items-start relative gap-2", children: [
|
|
1444
1462
|
AdjustmentPromptComponent,
|
|
1445
|
-
filePointers.length > 0 && /* @__PURE__ */ (0,
|
|
1446
|
-
sourceSearchWord !== void 0 && /* @__PURE__ */ (0,
|
|
1463
|
+
filePointers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IncludedFilesPreview, { includedFiles: filePointers, setIncludedFiles: setFilePointers }),
|
|
1464
|
+
sourceSearchWord !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1447
1465
|
SourceSearchBox,
|
|
1448
1466
|
{
|
|
1449
1467
|
searchTerm: sourceSearchWord,
|
|
@@ -1462,14 +1480,14 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1462
1480
|
};
|
|
1463
1481
|
|
|
1464
1482
|
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
|
|
1465
|
-
var
|
|
1483
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1466
1484
|
var HoveringInsertionPromptBox = (props) => {
|
|
1467
|
-
return /* @__PURE__ */ (0,
|
|
1485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1468
1486
|
"div",
|
|
1469
1487
|
{
|
|
1470
1488
|
className: "flex flex-col justify-center items-center space-y-4 rounded-md border shadow-lg p-4 border-gray- bg-white",
|
|
1471
1489
|
style: { width: "35rem" },
|
|
1472
|
-
children: /* @__PURE__ */ (0,
|
|
1490
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1473
1491
|
HoveringInsertionPromptBoxCore,
|
|
1474
1492
|
{
|
|
1475
1493
|
state: {
|
|
@@ -1486,10 +1504,10 @@ var HoveringInsertionPromptBox = (props) => {
|
|
|
1486
1504
|
|
|
1487
1505
|
// src/components/hovering-toolbar/hovering-toolbar-components.tsx
|
|
1488
1506
|
var import_css = require("@emotion/css");
|
|
1489
|
-
var
|
|
1507
|
+
var import_react9 = __toESM(require("react"));
|
|
1490
1508
|
var import_react_dom = __toESM(require("react-dom"));
|
|
1491
|
-
var
|
|
1492
|
-
var Button2 =
|
|
1509
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1510
|
+
var Button2 = import_react9.default.forwardRef(
|
|
1493
1511
|
(_a, ref) => {
|
|
1494
1512
|
var _b = _a, {
|
|
1495
1513
|
className,
|
|
@@ -1500,7 +1518,7 @@ var Button2 = import_react8.default.forwardRef(
|
|
|
1500
1518
|
"active",
|
|
1501
1519
|
"reversed"
|
|
1502
1520
|
]);
|
|
1503
|
-
return /* @__PURE__ */ (0,
|
|
1521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1504
1522
|
"span",
|
|
1505
1523
|
__spreadProps(__spreadValues({}, props), {
|
|
1506
1524
|
ref,
|
|
@@ -1515,10 +1533,10 @@ var Button2 = import_react8.default.forwardRef(
|
|
|
1515
1533
|
);
|
|
1516
1534
|
}
|
|
1517
1535
|
);
|
|
1518
|
-
var Icon =
|
|
1536
|
+
var Icon = import_react9.default.forwardRef(
|
|
1519
1537
|
(_a, ref) => {
|
|
1520
1538
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1521
|
-
return /* @__PURE__ */ (0,
|
|
1539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1522
1540
|
"span",
|
|
1523
1541
|
__spreadProps(__spreadValues({}, props), {
|
|
1524
1542
|
ref,
|
|
@@ -1534,10 +1552,10 @@ var Icon = import_react8.default.forwardRef(
|
|
|
1534
1552
|
);
|
|
1535
1553
|
}
|
|
1536
1554
|
);
|
|
1537
|
-
var Menu =
|
|
1555
|
+
var Menu = import_react9.default.forwardRef(
|
|
1538
1556
|
(_a, ref) => {
|
|
1539
1557
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1540
|
-
return /* @__PURE__ */ (0,
|
|
1558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1541
1559
|
"div",
|
|
1542
1560
|
__spreadProps(__spreadValues({}, props), {
|
|
1543
1561
|
"data-test-id": "menu",
|
|
@@ -1561,10 +1579,10 @@ var Menu = import_react8.default.forwardRef(
|
|
|
1561
1579
|
var Portal = ({ children }) => {
|
|
1562
1580
|
return typeof document === "object" ? import_react_dom.default.createPortal(children, document.body) : null;
|
|
1563
1581
|
};
|
|
1564
|
-
var Toolbar =
|
|
1582
|
+
var Toolbar = import_react9.default.forwardRef(
|
|
1565
1583
|
(_a, ref) => {
|
|
1566
1584
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1567
|
-
return /* @__PURE__ */ (0,
|
|
1585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1568
1586
|
Menu,
|
|
1569
1587
|
__spreadProps(__spreadValues({}, props), {
|
|
1570
1588
|
ref,
|
|
@@ -1583,20 +1601,6 @@ var Toolbar = import_react8.default.forwardRef(
|
|
|
1583
1601
|
}
|
|
1584
1602
|
);
|
|
1585
1603
|
|
|
1586
|
-
// src/components/hovering-toolbar/hovering-editor-provider.tsx
|
|
1587
|
-
var import_react9 = require("react");
|
|
1588
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1589
|
-
var HoveringEditorContext = (0, import_react9.createContext)({
|
|
1590
|
-
isDisplayed: false,
|
|
1591
|
-
setIsDisplayed: () => {
|
|
1592
|
-
}
|
|
1593
|
-
});
|
|
1594
|
-
var HoveringEditorProvider = ({ children }) => {
|
|
1595
|
-
const [isDisplayed, setIsDisplayed] = (0, import_react9.useState)(false);
|
|
1596
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(HoveringEditorContext.Provider, { value: { isDisplayed, setIsDisplayed }, children });
|
|
1597
|
-
};
|
|
1598
|
-
var useHoveringEditorContext = () => (0, import_react9.useContext)(HoveringEditorContext);
|
|
1599
|
-
|
|
1600
1604
|
// src/components/hovering-toolbar/hovering-toolbar.tsx
|
|
1601
1605
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1602
1606
|
var HoveringToolbar = (props) => {
|
|
@@ -1936,7 +1940,8 @@ var BaseCopilotTextareaWithHoveringContext = import_react13.default.forwardRef(
|
|
|
1936
1940
|
);
|
|
1937
1941
|
const onKeyDownHandlerForHoveringEditor = (0, import_react13.useCallback)(
|
|
1938
1942
|
(event) => {
|
|
1939
|
-
|
|
1943
|
+
var _a2;
|
|
1944
|
+
if (autosuggestionsConfig.shouldToggleHoveringEditorOnKeyPress(event, (_a2 = props.shortcut) != null ? _a2 : "k")) {
|
|
1940
1945
|
event.preventDefault();
|
|
1941
1946
|
setHoveringEditorIsDisplayed(!hoveringEditorIsDisplayed);
|
|
1942
1947
|
}
|