@copilotkit/react-textarea 0.35.0 → 0.36.0-mme-fix-packaging-issues.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.
Files changed (46) hide show
  1. package/.turbo/turbo-build.log +267 -267
  2. package/CHANGELOG.md +6 -0
  3. package/dist/{chunk-COQISBP2.mjs → chunk-7R7KMN2G.mjs} +2 -2
  4. package/dist/{chunk-DMLXXOXD.mjs → chunk-GZPRBYKA.mjs} +2 -2
  5. package/dist/chunk-JC6NGPO4.mjs +100 -0
  6. package/dist/chunk-JC6NGPO4.mjs.map +1 -0
  7. package/dist/{chunk-PQIOU3E5.mjs → chunk-MMVI7IPP.mjs} +2 -2
  8. package/dist/{chunk-XU5Z5BWV.mjs → chunk-O3QC2FT5.mjs} +2 -2
  9. package/dist/{chunk-OGLVRSCO.mjs → chunk-P4EI4H6Y.mjs} +2 -2
  10. package/dist/components/base-copilot-textarea/base-copilot-textarea.js +116 -66
  11. package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -1
  12. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +5 -5
  13. package/dist/components/copilot-textarea/copilot-textarea.js +123 -73
  14. package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
  15. package/dist/components/copilot-textarea/copilot-textarea.mjs +6 -6
  16. package/dist/components/hovering-toolbar/hovering-toolbar.js +95 -45
  17. package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -1
  18. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +4 -4
  19. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +84 -34
  20. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -1
  21. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +2 -2
  22. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +84 -34
  23. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -1
  24. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +3 -3
  25. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.d.ts +1 -2
  26. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js +67 -19
  27. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js.map +1 -1
  28. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs +1 -3
  29. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +84 -34
  30. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -1
  31. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +3 -3
  32. package/dist/components/index.js +126 -76
  33. package/dist/components/index.js.map +1 -1
  34. package/dist/components/index.mjs +6 -6
  35. package/dist/index.js +126 -76
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +6 -6
  38. package/package.json +3 -4
  39. package/src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx +62 -13
  40. package/dist/chunk-YNXNMCDX.mjs +0 -51
  41. package/dist/chunk-YNXNMCDX.mjs.map +0 -1
  42. /package/dist/{chunk-COQISBP2.mjs.map → chunk-7R7KMN2G.mjs.map} +0 -0
  43. /package/dist/{chunk-DMLXXOXD.mjs.map → chunk-GZPRBYKA.mjs.map} +0 -0
  44. /package/dist/{chunk-PQIOU3E5.mjs.map → chunk-MMVI7IPP.mjs.map} +0 -0
  45. /package/dist/{chunk-XU5Z5BWV.mjs.map → chunk-O3QC2FT5.mjs.map} +0 -0
  46. /package/dist/{chunk-OGLVRSCO.mjs.map → chunk-P4EI4H6Y.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # ui
2
2
 
3
+ ## 0.36.0-mme-fix-packaging-issues.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Remove mui package
8
+
3
9
  ## 0.35.0
4
10
 
5
11
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HoveringInsertionPromptBoxCore
3
- } from "./chunk-OGLVRSCO.mjs";
3
+ } from "./chunk-P4EI4H6Y.mjs";
4
4
 
5
5
  // src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -28,4 +28,4 @@ var HoveringInsertionPromptBox = (props) => {
28
28
  export {
29
29
  HoveringInsertionPromptBox
30
30
  };
31
- //# sourceMappingURL=chunk-COQISBP2.mjs.map
31
+ //# sourceMappingURL=chunk-7R7KMN2G.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HoveringInsertionPromptBox
3
- } from "./chunk-COQISBP2.mjs";
3
+ } from "./chunk-7R7KMN2G.mjs";
4
4
  import {
5
5
  useHoveringEditorContext
6
6
  } from "./chunk-LYB4B6MK.mjs";
@@ -121,4 +121,4 @@ function editorState(editor, selection) {
121
121
  export {
122
122
  HoveringToolbar
123
123
  };
124
- //# sourceMappingURL=chunk-DMLXXOXD.mjs.map
124
+ //# sourceMappingURL=chunk-GZPRBYKA.mjs.map
@@ -0,0 +1,100 @@
1
+ import {
2
+ Label
3
+ } from "./chunk-YFK5BFEI.mjs";
4
+
5
+ // src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx
6
+ import React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ var IncludedFilesPreview = ({
9
+ includedFiles,
10
+ setIncludedFiles
11
+ }) => {
12
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 mt-2", children: [
13
+ /* @__PURE__ */ jsx(Label, { className: "", children: "Included context:" }),
14
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: includedFiles.map((filePointer, index) => {
15
+ return /* @__PURE__ */ jsx(
16
+ FileChipPreview,
17
+ {
18
+ filePointer,
19
+ onDelete: () => {
20
+ setIncludedFiles((prev) => prev.filter((fp) => fp !== filePointer));
21
+ }
22
+ },
23
+ `file-${filePointer.sourceApplication}.${filePointer.name}`
24
+ );
25
+ }) })
26
+ ] });
27
+ };
28
+ function FileChipPreview({
29
+ filePointer,
30
+ onDelete
31
+ }) {
32
+ const CLOSE_BUTTON_COLOR = "rgba(0, 0, 0, 0.26)";
33
+ const [color, setColor] = React.useState(CLOSE_BUTTON_COLOR);
34
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
35
+ "button",
36
+ {
37
+ style: {
38
+ fontSize: "0.8125rem",
39
+ display: "inline-flex",
40
+ justifyContent: "center",
41
+ alignItems: "center",
42
+ height: "32px",
43
+ color: "rgba(0, 0, 0, 0.87)",
44
+ backgroundColor: "rgba(0, 0, 0, 0.08)",
45
+ borderRadius: "16px",
46
+ whiteSpace: "nowrap",
47
+ boxSizing: "border-box",
48
+ border: 0,
49
+ verticalAlign: "middle",
50
+ outline: 0,
51
+ cursor: "default"
52
+ },
53
+ children: [
54
+ /* @__PURE__ */ jsx(
55
+ "img",
56
+ {
57
+ style: {
58
+ marginLeft: "5px",
59
+ width: "24px",
60
+ height: "24px",
61
+ backgroundColor: "transparent",
62
+ borderRadius: "50%"
63
+ },
64
+ src: filePointer.iconImageUri,
65
+ alt: filePointer.sourceApplication
66
+ }
67
+ ),
68
+ /* @__PURE__ */ jsx("span", { style: { marginLeft: "5px" }, children: filePointer.name }),
69
+ /* @__PURE__ */ jsx(
70
+ "svg",
71
+ {
72
+ style: {
73
+ color,
74
+ fontSize: "22px",
75
+ cursor: "pointer",
76
+ margin: "0 5px 0 5px",
77
+ userSelect: "none",
78
+ width: "1em",
79
+ height: "1em",
80
+ display: "inline-block",
81
+ fill: "currentColor",
82
+ flexShrink: 0
83
+ },
84
+ viewBox: "0 0 24 24",
85
+ preserveAspectRatio: "xMidYMid meet",
86
+ onClick: onDelete,
87
+ onMouseOver: () => setColor("rgba(0, 0, 0, 0.54)"),
88
+ onMouseOut: () => setColor(CLOSE_BUTTON_COLOR),
89
+ children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" })
90
+ }
91
+ )
92
+ ]
93
+ }
94
+ ) });
95
+ }
96
+
97
+ export {
98
+ IncludedFilesPreview
99
+ };
100
+ //# sourceMappingURL=chunk-JC6NGPO4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx"],"sourcesContent":["import { DocumentPointer } from \"@copilotkit/react-core\";\nimport { Label } from \"../../ui/label\";\nimport React from \"react\";\n\nexport interface IncludedFilesPreviewProps {\n includedFiles: DocumentPointer[];\n setIncludedFiles: React.Dispatch<React.SetStateAction<DocumentPointer[]>>;\n}\n\nexport const IncludedFilesPreview = ({\n includedFiles,\n setIncludedFiles,\n}: IncludedFilesPreviewProps) => {\n return (\n <div className=\"flex flex-col gap-2 mt-2\">\n <Label className=\"\">Included context:</Label>\n <div className=\"flex flex-wrap gap-2\">\n {includedFiles.map((filePointer, index) => {\n return (\n <FileChipPreview\n key={`file-${filePointer.sourceApplication}.${filePointer.name}`}\n filePointer={filePointer}\n onDelete={() => {\n setIncludedFiles((prev) => prev.filter((fp) => fp !== filePointer));\n }}\n />\n );\n })}\n </div>\n </div>\n );\n};\n\nexport interface FileChipPreviewProps {\n filePointer: DocumentPointer;\n onDelete: () => void;\n}\n\nfunction FileChipPreview({\n filePointer,\n onDelete,\n}: {\n filePointer: DocumentPointer;\n onDelete: () => void;\n}) {\n const CLOSE_BUTTON_COLOR = \"rgba(0, 0, 0, 0.26)\";\n const [color, setColor] = React.useState(CLOSE_BUTTON_COLOR);\n return (\n <div>\n <button\n style={{\n fontSize: \"0.8125rem\",\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n height: \"32px\",\n color: \"rgba(0, 0, 0, 0.87)\",\n backgroundColor: \"rgba(0, 0, 0, 0.08)\",\n borderRadius: \"16px\",\n whiteSpace: \"nowrap\",\n boxSizing: \"border-box\",\n border: 0,\n verticalAlign: \"middle\",\n outline: 0,\n cursor: \"default\",\n }}\n >\n <img\n style={{\n marginLeft: \"5px\",\n width: \"24px\",\n height: \"24px\",\n backgroundColor: \"transparent\",\n borderRadius: \"50%\",\n }}\n src={filePointer.iconImageUri}\n alt={filePointer.sourceApplication}\n />\n <span style={{ marginLeft: \"5px\" }}>{filePointer.name}</span>\n <svg\n style={{\n color: color,\n fontSize: \"22px\",\n cursor: \"pointer\",\n margin: \"0 5px 0 5px\",\n userSelect: \"none\",\n width: \"1em\",\n height: \"1em\",\n display: \"inline-block\",\n fill: \"currentColor\",\n flexShrink: 0,\n }}\n viewBox=\"0 0 24 24\" // Defines the size of the original design space\n preserveAspectRatio=\"xMidYMid meet\"\n onClick={onDelete}\n onMouseOver={() => setColor(\"rgba(0, 0, 0, 0.54)\")}\n onMouseOut={() => setColor(CLOSE_BUTTON_COLOR)}\n >\n <path d=\"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z\"></path>\n </svg>\n </button>\n </div>\n );\n}\n"],"mappings":";;;;;AAEA,OAAO,WAAW;AAYd,SACE,KADF;AALG,IAAM,uBAAuB,CAAC;AAAA,EACnC;AAAA,EACA;AACF,MAAiC;AAC/B,SACE,qBAAC,SAAI,WAAU,4BACb;AAAA,wBAAC,SAAM,WAAU,IAAG,+BAAiB;AAAA,IACrC,oBAAC,SAAI,WAAU,wBACZ,wBAAc,IAAI,CAAC,aAAa,UAAU;AACzC,aACE;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA,UAAU,MAAM;AACd,6BAAiB,CAAC,SAAS,KAAK,OAAO,CAAC,OAAO,OAAO,WAAW,CAAC;AAAA,UACpE;AAAA;AAAA,QAJK,QAAQ,YAAY,qBAAqB,YAAY;AAAA,MAK5D;AAAA,IAEJ,CAAC,GACH;AAAA,KACF;AAEJ;AAOA,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA;AACF,GAGG;AACD,QAAM,qBAAqB;AAC3B,QAAM,CAAC,OAAO,QAAQ,IAAI,MAAM,SAAS,kBAAkB;AAC3D,SACE,oBAAC,SACC;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,QACL,UAAU;AAAA,QACV,SAAS;AAAA,QACT,gBAAgB;AAAA,QAChB,YAAY;AAAA,QACZ,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,iBAAiB;AAAA,QACjB,cAAc;AAAA,QACd,YAAY;AAAA,QACZ,WAAW;AAAA,QACX,QAAQ;AAAA,QACR,eAAe;AAAA,QACf,SAAS;AAAA,QACT,QAAQ;AAAA,MACV;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,cACL,YAAY;AAAA,cACZ,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,iBAAiB;AAAA,cACjB,cAAc;AAAA,YAChB;AAAA,YACA,KAAK,YAAY;AAAA,YACjB,KAAK,YAAY;AAAA;AAAA,QACnB;AAAA,QACA,oBAAC,UAAK,OAAO,EAAE,YAAY,MAAM,GAAI,sBAAY,MAAK;AAAA,QACtD;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,cACL;AAAA,cACA,UAAU;AAAA,cACV,QAAQ;AAAA,cACR,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,SAAS;AAAA,cACT,MAAM;AAAA,cACN,YAAY;AAAA,YACd;AAAA,YACA,SAAQ;AAAA,YACR,qBAAoB;AAAA,YACpB,SAAS;AAAA,YACT,aAAa,MAAM,SAAS,qBAAqB;AAAA,YACjD,YAAY,MAAM,SAAS,kBAAkB;AAAA,YAE7C,8BAAC,UAAK,GAAE,mLAAkL;AAAA;AAAA,QAC5L;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-DKE57EAC.mjs";
10
10
  import {
11
11
  BaseCopilotTextarea
12
- } from "./chunk-XU5Z5BWV.mjs";
12
+ } from "./chunk-O3QC2FT5.mjs";
13
13
  import {
14
14
  __objRest,
15
15
  __spreadProps,
@@ -57,4 +57,4 @@ var CopilotTextarea = React.forwardRef(
57
57
  export {
58
58
  CopilotTextarea
59
59
  };
60
- //# sourceMappingURL=chunk-PQIOU3E5.mjs.map
60
+ //# sourceMappingURL=chunk-MMVI7IPP.mjs.map
@@ -24,7 +24,7 @@ import {
24
24
  } from "./chunk-7LSRNPNI.mjs";
25
25
  import {
26
26
  HoveringToolbar
27
- } from "./chunk-DMLXXOXD.mjs";
27
+ } from "./chunk-GZPRBYKA.mjs";
28
28
  import {
29
29
  HoveringEditorProvider,
30
30
  useHoveringEditorContext
@@ -256,4 +256,4 @@ function makeSemiFakeReactTextAreaEvent(currentText) {
256
256
  export {
257
257
  BaseCopilotTextarea
258
258
  };
259
- //# sourceMappingURL=chunk-XU5Z5BWV.mjs.map
259
+ //# sourceMappingURL=chunk-O3QC2FT5.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  IncludedFilesPreview
3
- } from "./chunk-YNXNMCDX.mjs";
3
+ } from "./chunk-JC6NGPO4.mjs";
4
4
  import {
5
5
  use_autosize_textarea_default
6
6
  } from "./chunk-3PQ7GSFE.mjs";
@@ -222,4 +222,4 @@ var HoveringInsertionPromptBoxCore = ({
222
222
  export {
223
223
  HoveringInsertionPromptBoxCore
224
224
  };
225
- //# sourceMappingURL=chunk-OGLVRSCO.mjs.map
225
+ //# sourceMappingURL=chunk-P4EI4H6Y.mjs.map
@@ -82,7 +82,7 @@ __export(base_copilot_textarea_exports, {
82
82
  BaseCopilotTextarea: () => BaseCopilotTextarea
83
83
  });
84
84
  module.exports = __toCommonJS(base_copilot_textarea_exports);
85
- var import_react12 = __toESM(require("react"));
85
+ var import_react13 = __toESM(require("react"));
86
86
  var import_slate10 = require("slate");
87
87
  var import_slate_react5 = require("slate-react");
88
88
  var import_tailwind_merge2 = require("tailwind-merge");
@@ -659,7 +659,7 @@ var defaultBaseAutosuggestionsConfig = {
659
659
  };
660
660
 
661
661
  // src/components/hovering-toolbar/hovering-toolbar.tsx
662
- var import_react9 = require("react");
662
+ var import_react10 = require("react");
663
663
  var import_slate7 = require("slate");
664
664
  var import_slate_react3 = require("slate-react");
665
665
 
@@ -895,7 +895,7 @@ var Label = React4.forwardRef((_a, ref) => {
895
895
  Label.displayName = LabelPrimitive.Root.displayName;
896
896
 
897
897
  // src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
898
- var import_react7 = require("react");
898
+ var import_react8 = require("react");
899
899
 
900
900
  // src/lib/stream-promise-flatten.ts
901
901
  function streamPromiseFlatten(promise) {
@@ -925,8 +925,7 @@ function streamPromiseFlatten(promise) {
925
925
  var import_react_core2 = require("@copilotkit/react-core");
926
926
 
927
927
  // src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx
928
- var import_Chip = __toESM(require("@mui/material/Chip/Chip.js"));
929
- var import_Avatar = __toESM(require("@mui/material/Avatar/Avatar.js"));
928
+ var import_react6 = __toESM(require("react"));
930
929
  var import_jsx_runtime5 = require("react/jsx-runtime");
931
930
  var IncludedFilesPreview = ({
932
931
  includedFiles,
@@ -948,37 +947,88 @@ var IncludedFilesPreview = ({
948
947
  }) })
949
948
  ] });
950
949
  };
951
- var FileChipPreview = ({ filePointer, onDelete }) => {
952
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
953
- import_Chip.default,
950
+ function FileChipPreview({
951
+ filePointer,
952
+ onDelete
953
+ }) {
954
+ const CLOSE_BUTTON_COLOR = "rgba(0, 0, 0, 0.26)";
955
+ const [color, setColor] = import_react6.default.useState(CLOSE_BUTTON_COLOR);
956
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
957
+ "button",
954
958
  {
955
- label: filePointer.name,
956
- onDelete,
957
- avatar: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
958
- import_Avatar.default,
959
- {
960
- src: filePointer.iconImageUri,
961
- alt: filePointer.sourceApplication,
962
- sx: { backgroundColor: "transparent" }
963
- }
964
- )
959
+ style: {
960
+ fontSize: "0.8125rem",
961
+ display: "inline-flex",
962
+ justifyContent: "center",
963
+ alignItems: "center",
964
+ height: "32px",
965
+ color: "rgba(0, 0, 0, 0.87)",
966
+ backgroundColor: "rgba(0, 0, 0, 0.08)",
967
+ borderRadius: "16px",
968
+ whiteSpace: "nowrap",
969
+ boxSizing: "border-box",
970
+ border: 0,
971
+ verticalAlign: "middle",
972
+ outline: 0,
973
+ cursor: "default"
974
+ },
975
+ children: [
976
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
977
+ "img",
978
+ {
979
+ style: {
980
+ marginLeft: "5px",
981
+ width: "24px",
982
+ height: "24px",
983
+ backgroundColor: "transparent",
984
+ borderRadius: "50%"
985
+ },
986
+ src: filePointer.iconImageUri,
987
+ alt: filePointer.sourceApplication
988
+ }
989
+ ),
990
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { marginLeft: "5px" }, children: filePointer.name }),
991
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
992
+ "svg",
993
+ {
994
+ style: {
995
+ color,
996
+ fontSize: "22px",
997
+ cursor: "pointer",
998
+ margin: "0 5px 0 5px",
999
+ userSelect: "none",
1000
+ width: "1em",
1001
+ height: "1em",
1002
+ display: "inline-block",
1003
+ fill: "currentColor",
1004
+ flexShrink: 0
1005
+ },
1006
+ viewBox: "0 0 24 24",
1007
+ preserveAspectRatio: "xMidYMid meet",
1008
+ onClick: onDelete,
1009
+ onMouseOver: () => setColor("rgba(0, 0, 0, 0.54)"),
1010
+ onMouseOut: () => setColor(CLOSE_BUTTON_COLOR),
1011
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" })
1012
+ }
1013
+ )
1014
+ ]
965
1015
  }
966
- );
967
- };
1016
+ ) });
1017
+ }
968
1018
 
969
1019
  // src/components/hovering-toolbar/hovering-editor-provider.tsx
970
- var import_react6 = require("react");
1020
+ var import_react7 = require("react");
971
1021
  var import_jsx_runtime6 = require("react/jsx-runtime");
972
- var HoveringEditorContext = (0, import_react6.createContext)({
1022
+ var HoveringEditorContext = (0, import_react7.createContext)({
973
1023
  isDisplayed: false,
974
1024
  setIsDisplayed: () => {
975
1025
  }
976
1026
  });
977
1027
  var HoveringEditorProvider = ({ children }) => {
978
- const [isDisplayed, setIsDisplayed] = (0, import_react6.useState)(false);
1028
+ const [isDisplayed, setIsDisplayed] = (0, import_react7.useState)(false);
979
1029
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HoveringEditorContext.Provider, { value: { isDisplayed, setIsDisplayed }, children });
980
1030
  };
981
- var useHoveringEditorContext = () => (0, import_react6.useContext)(HoveringEditorContext);
1031
+ var useHoveringEditorContext = () => (0, import_react7.useContext)(HoveringEditorContext);
982
1032
 
983
1033
  // src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
984
1034
  var import_jsx_runtime7 = require("react/jsx-runtime");
@@ -988,27 +1038,27 @@ var HoveringInsertionPromptBoxCore = ({
988
1038
  insertionOrEditingFunction,
989
1039
  contextCategories
990
1040
  }) => {
991
- const { getDocumentsContext } = (0, import_react7.useContext)(import_react_core2.CopilotContext);
992
- const [editSuggestion, setEditSuggestion] = (0, import_react7.useState)("");
993
- const [suggestionIsLoading, setSuggestionIsLoading] = (0, import_react7.useState)(false);
994
- const [adjustmentPrompt, setAdjustmentPrompt] = (0, import_react7.useState)("");
995
- const [generatingSuggestion, setGeneratingSuggestion] = (0, import_react7.useState)(
1041
+ const { getDocumentsContext } = (0, import_react8.useContext)(import_react_core2.CopilotContext);
1042
+ const [editSuggestion, setEditSuggestion] = (0, import_react8.useState)("");
1043
+ const [suggestionIsLoading, setSuggestionIsLoading] = (0, import_react8.useState)(false);
1044
+ const [adjustmentPrompt, setAdjustmentPrompt] = (0, import_react8.useState)("");
1045
+ const [generatingSuggestion, setGeneratingSuggestion] = (0, import_react8.useState)(
996
1046
  null
997
1047
  );
998
- const adjustmentTextAreaRef = (0, import_react7.useRef)(null);
999
- const suggestionTextAreaRef = (0, import_react7.useRef)(null);
1000
- const [filePointers, setFilePointers] = (0, import_react7.useState)([]);
1001
- const [suggestedFiles, setSuggestedFiles] = (0, import_react7.useState)([]);
1002
- (0, import_react7.useEffect)(() => {
1048
+ const adjustmentTextAreaRef = (0, import_react8.useRef)(null);
1049
+ const suggestionTextAreaRef = (0, import_react8.useRef)(null);
1050
+ const [filePointers, setFilePointers] = (0, import_react8.useState)([]);
1051
+ const [suggestedFiles, setSuggestedFiles] = (0, import_react8.useState)([]);
1052
+ (0, import_react8.useEffect)(() => {
1003
1053
  setSuggestedFiles(getDocumentsContext(contextCategories));
1004
1054
  }, [contextCategories, getDocumentsContext]);
1005
1055
  use_autosize_textarea_default(suggestionTextAreaRef, editSuggestion || "");
1006
1056
  use_autosize_textarea_default(adjustmentTextAreaRef, adjustmentPrompt || "");
1007
- (0, import_react7.useEffect)(() => {
1057
+ (0, import_react8.useEffect)(() => {
1008
1058
  var _a;
1009
1059
  (_a = adjustmentTextAreaRef.current) == null ? void 0 : _a.focus();
1010
1060
  }, []);
1011
- (0, import_react7.useEffect)(() => {
1061
+ (0, import_react8.useEffect)(() => {
1012
1062
  if (!generatingSuggestion) {
1013
1063
  return;
1014
1064
  }
@@ -1046,7 +1096,7 @@ var HoveringInsertionPromptBoxCore = ({
1046
1096
  releaseLockIfNotClosed();
1047
1097
  };
1048
1098
  }, [generatingSuggestion]);
1049
- const beginGeneratingAdjustment = (0, import_react7.useCallback)(() => __async(void 0, null, function* () {
1099
+ const beginGeneratingAdjustment = (0, import_react8.useCallback)(() => __async(void 0, null, function* () {
1050
1100
  if (!adjustmentPrompt.trim()) {
1051
1101
  return;
1052
1102
  }
@@ -1199,10 +1249,10 @@ var HoveringInsertionPromptBox = (props) => {
1199
1249
 
1200
1250
  // src/components/hovering-toolbar/hovering-toolbar-components.tsx
1201
1251
  var import_css = require("@emotion/css");
1202
- var import_react8 = __toESM(require("react"));
1252
+ var import_react9 = __toESM(require("react"));
1203
1253
  var import_react_dom = __toESM(require("react-dom"));
1204
1254
  var import_jsx_runtime9 = require("react/jsx-runtime");
1205
- var Button2 = import_react8.default.forwardRef(
1255
+ var Button2 = import_react9.default.forwardRef(
1206
1256
  (_a, ref) => {
1207
1257
  var _b = _a, {
1208
1258
  className,
@@ -1228,7 +1278,7 @@ var Button2 = import_react8.default.forwardRef(
1228
1278
  );
1229
1279
  }
1230
1280
  );
1231
- var Icon = import_react8.default.forwardRef(
1281
+ var Icon = import_react9.default.forwardRef(
1232
1282
  (_a, ref) => {
1233
1283
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1234
1284
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
@@ -1247,7 +1297,7 @@ var Icon = import_react8.default.forwardRef(
1247
1297
  );
1248
1298
  }
1249
1299
  );
1250
- var Menu = import_react8.default.forwardRef(
1300
+ var Menu = import_react9.default.forwardRef(
1251
1301
  (_a, ref) => {
1252
1302
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1253
1303
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
@@ -1274,7 +1324,7 @@ var Menu = import_react8.default.forwardRef(
1274
1324
  var Portal = ({ children }) => {
1275
1325
  return typeof document === "object" ? import_react_dom.default.createPortal(children, document.body) : null;
1276
1326
  };
1277
- var Toolbar = import_react8.default.forwardRef(
1327
+ var Toolbar = import_react9.default.forwardRef(
1278
1328
  (_a, ref) => {
1279
1329
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1280
1330
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
@@ -1299,15 +1349,15 @@ var Toolbar = import_react8.default.forwardRef(
1299
1349
  // src/components/hovering-toolbar/hovering-toolbar.tsx
1300
1350
  var import_jsx_runtime10 = require("react/jsx-runtime");
1301
1351
  var HoveringToolbar = (props) => {
1302
- const ref = (0, import_react9.useRef)(null);
1352
+ const ref = (0, import_react10.useRef)(null);
1303
1353
  const editor = (0, import_slate_react3.useSlate)();
1304
1354
  const selection = (0, import_slate_react3.useSlateSelection)();
1305
1355
  const { isDisplayed, setIsDisplayed } = useHoveringEditorContext();
1306
- const [isClient, setIsClient] = (0, import_react9.useState)(false);
1307
- (0, import_react9.useEffect)(() => {
1356
+ const [isClient, setIsClient] = (0, import_react10.useState)(false);
1357
+ (0, import_react10.useEffect)(() => {
1308
1358
  setIsClient(true);
1309
1359
  }, []);
1310
- (0, import_react9.useEffect)(() => {
1360
+ (0, import_react10.useEffect)(() => {
1311
1361
  const el = ref.current;
1312
1362
  const { selection: selection2 } = editor;
1313
1363
  if (!el) {
@@ -1345,7 +1395,7 @@ var HoveringToolbar = (props) => {
1345
1395
  el.style.top = `${top}px`;
1346
1396
  el.style.left = `${left}px`;
1347
1397
  });
1348
- (0, import_react9.useEffect)(() => {
1398
+ (0, import_react10.useEffect)(() => {
1349
1399
  const handleClickOutside = (event) => {
1350
1400
  if (ref.current && !ref.current.contains(event.target)) {
1351
1401
  setIsDisplayed(false);
@@ -1443,10 +1493,10 @@ function makeRenderPlaceholderFunction(placeholderStyle) {
1443
1493
  }
1444
1494
 
1445
1495
  // src/components/base-copilot-textarea/use-add-branding-css.tsx
1446
- var import_react10 = require("react");
1496
+ var import_react11 = require("react");
1447
1497
  function useAddBrandingCss(suggestionStyleAugmented, disableBranding) {
1448
1498
  const cssSelector = ".copilot-textarea.with-branding";
1449
- (0, import_react10.useEffect)(() => {
1499
+ (0, import_react11.useEffect)(() => {
1450
1500
  if (disableBranding) {
1451
1501
  return;
1452
1502
  }
@@ -1498,7 +1548,7 @@ function useAddBrandingCss(suggestionStyleAugmented, disableBranding) {
1498
1548
  }
1499
1549
 
1500
1550
  // src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx
1501
- var import_react11 = require("react");
1551
+ var import_react12 = require("react");
1502
1552
  var import_slate_react4 = require("slate-react");
1503
1553
  var import_slate9 = require("slate");
1504
1554
 
@@ -1551,7 +1601,7 @@ function TrackerTextEditedSinceLastCursorMovement(props) {
1551
1601
  text: editorToText(state)
1552
1602
  }));
1553
1603
  const previousState = usePrevious(cursorState);
1554
- (0, import_react11.useEffect)(() => {
1604
+ (0, import_react12.useEffect)(() => {
1555
1605
  if (!previousState) {
1556
1606
  return;
1557
1607
  }
@@ -1574,8 +1624,8 @@ var isSelectionEqual = (a, b) => {
1574
1624
  return import_slate9.Range.equals(a, b);
1575
1625
  };
1576
1626
  function usePrevious(value) {
1577
- const ref = (0, import_react11.useRef)();
1578
- (0, import_react11.useEffect)(() => {
1627
+ const ref = (0, import_react12.useRef)();
1628
+ (0, import_react12.useEffect)(() => {
1579
1629
  ref.current = value;
1580
1630
  });
1581
1631
  return ref.current;
@@ -1583,21 +1633,21 @@ function usePrevious(value) {
1583
1633
 
1584
1634
  // src/components/base-copilot-textarea/base-copilot-textarea.tsx
1585
1635
  var import_jsx_runtime14 = require("react/jsx-runtime");
1586
- var BaseCopilotTextarea = import_react12.default.forwardRef(
1636
+ var BaseCopilotTextarea = import_react13.default.forwardRef(
1587
1637
  (props, ref) => {
1588
1638
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(HoveringEditorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(BaseCopilotTextareaWithHoveringContext, __spreadProps(__spreadValues({}, props), { ref })) });
1589
1639
  }
1590
1640
  );
1591
- var BaseCopilotTextareaWithHoveringContext = import_react12.default.forwardRef(
1641
+ var BaseCopilotTextareaWithHoveringContext = import_react13.default.forwardRef(
1592
1642
  (props, ref) => {
1593
1643
  const autosuggestionsConfig = __spreadValues(__spreadValues({}, defaultBaseAutosuggestionsConfig), props.baseAutosuggestionsConfig);
1594
- const valueOnInitialRender = (0, import_react12.useMemo)(() => {
1644
+ const valueOnInitialRender = (0, import_react13.useMemo)(() => {
1595
1645
  var _a2;
1596
1646
  return (_a2 = props.value) != null ? _a2 : "";
1597
1647
  }, []);
1598
- const [lastKnownFullEditorText, setLastKnownFullEditorText] = (0, import_react12.useState)(valueOnInitialRender);
1599
- const [cursorMovedSinceLastTextChange, setCursorMovedSinceLastTextChange] = (0, import_react12.useState)(false);
1600
- const initialValue = (0, import_react12.useMemo)(() => {
1648
+ const [lastKnownFullEditorText, setLastKnownFullEditorText] = (0, import_react13.useState)(valueOnInitialRender);
1649
+ const [cursorMovedSinceLastTextChange, setCursorMovedSinceLastTextChange] = (0, import_react13.useState)(false);
1650
+ const initialValue = (0, import_react13.useMemo)(() => {
1601
1651
  return [
1602
1652
  {
1603
1653
  type: "paragraph",
@@ -1607,7 +1657,7 @@ var BaseCopilotTextareaWithHoveringContext = import_react12.default.forwardRef(
1607
1657
  }, [valueOnInitialRender]);
1608
1658
  const editor = useCopilotTextareaEditor();
1609
1659
  const { isDisplayed: hoveringEditorIsDisplayed, setIsDisplayed: setHoveringEditorIsDisplayed } = useHoveringEditorContext();
1610
- const insertText = (0, import_react12.useCallback)(
1660
+ const insertText = (0, import_react13.useCallback)(
1611
1661
  (autosuggestion) => {
1612
1662
  import_slate10.Editor.insertText(editor, autosuggestion.text, {
1613
1663
  at: autosuggestion.point
@@ -1633,7 +1683,7 @@ var BaseCopilotTextareaWithHoveringContext = import_react12.default.forwardRef(
1633
1683
  autosuggestionsConfig.disableWhenEmpty,
1634
1684
  shouldDisableAutosuggestions
1635
1685
  );
1636
- const onKeyDownHandlerForHoveringEditor = (0, import_react12.useCallback)(
1686
+ const onKeyDownHandlerForHoveringEditor = (0, import_react13.useCallback)(
1637
1687
  (event) => {
1638
1688
  var _a2;
1639
1689
  if (autosuggestionsConfig.shouldToggleHoveringEditorOnKeyPress(event, (_a2 = props.shortcut) != null ? _a2 : "k")) {
@@ -1647,7 +1697,7 @@ var BaseCopilotTextareaWithHoveringContext = import_react12.default.forwardRef(
1647
1697
  autosuggestionsConfig.shouldToggleHoveringEditorOnKeyPress
1648
1698
  ]
1649
1699
  );
1650
- (0, import_react12.useEffect)(() => {
1700
+ (0, import_react13.useEffect)(() => {
1651
1701
  clearAutocompletionsFromEditor(editor);
1652
1702
  if (currentAutocompleteSuggestion) {
1653
1703
  addAutocompletionsToEditor(
@@ -1657,23 +1707,23 @@ var BaseCopilotTextareaWithHoveringContext = import_react12.default.forwardRef(
1657
1707
  );
1658
1708
  }
1659
1709
  }, [currentAutocompleteSuggestion]);
1660
- const suggestionStyleAugmented = (0, import_react12.useMemo)(() => {
1710
+ const suggestionStyleAugmented = (0, import_react13.useMemo)(() => {
1661
1711
  return __spreadValues({
1662
1712
  fontStyle: "italic",
1663
1713
  color: "gray"
1664
1714
  }, props.suggestionsStyle);
1665
1715
  }, [props.suggestionsStyle]);
1666
- const renderElementMemoized = (0, import_react12.useMemo)(() => {
1716
+ const renderElementMemoized = (0, import_react13.useMemo)(() => {
1667
1717
  return makeRenderElementFunction(suggestionStyleAugmented);
1668
1718
  }, [suggestionStyleAugmented]);
1669
- const renderPlaceholderMemoized = (0, import_react12.useMemo)(() => {
1719
+ const renderPlaceholderMemoized = (0, import_react13.useMemo)(() => {
1670
1720
  const placeholderStyleSlatejsOverrides = {
1671
1721
  top: void 0
1672
1722
  };
1673
1723
  const placeholderStyleAugmented = __spreadValues(__spreadValues({}, placeholderStyleSlatejsOverrides), props.placeholderStyle);
1674
1724
  return makeRenderPlaceholderFunction(placeholderStyleAugmented);
1675
1725
  }, [props.placeholderStyle]);
1676
- (0, import_react12.useEffect)(() => {
1726
+ (0, import_react13.useEffect)(() => {
1677
1727
  var _a2, _b;
1678
1728
  if (props.value === lastKnownFullEditorText) {
1679
1729
  return;