@copilotkit/react-textarea 0.0.0-fix-debug-infosys-20251107151227 → 0.0.0-fix-restore-handle-method-node-http-20251222114321

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 (90) hide show
  1. package/CHANGELOG.md +322 -5
  2. package/dist/{chunk-HDBI2WN5.mjs → chunk-2IWVZ4PP.mjs} +17 -27
  3. package/dist/chunk-2IWVZ4PP.mjs.map +1 -0
  4. package/dist/{chunk-XW3ICO4S.mjs → chunk-3QJOFG3V.mjs} +1 -1
  5. package/dist/chunk-3QJOFG3V.mjs.map +1 -0
  6. package/dist/{chunk-6SGWO63I.mjs → chunk-4ECCCOFV.mjs} +4 -4
  7. package/dist/{chunk-C3PMJNQA.mjs → chunk-CEHEOPK4.mjs} +3 -3
  8. package/dist/{chunk-RXV67GJN.mjs → chunk-DL3JWL2E.mjs} +4 -2
  9. package/dist/chunk-DL3JWL2E.mjs.map +1 -0
  10. package/dist/{chunk-7L6GIHDM.mjs → chunk-F2ULK22F.mjs} +1 -1
  11. package/dist/chunk-F2ULK22F.mjs.map +1 -0
  12. package/dist/{chunk-LQ2OWQU7.mjs → chunk-JLOABKLH.mjs} +2 -2
  13. package/dist/{chunk-LQ2OWQU7.mjs.map → chunk-JLOABKLH.mjs.map} +1 -1
  14. package/dist/{chunk-2DF2AVDU.mjs → chunk-MC6CFI4J.mjs} +2 -2
  15. package/dist/{chunk-HBWBHJ64.mjs → chunk-N7BU66P5.mjs} +4 -4
  16. package/dist/{chunk-3PQ7GSFE.mjs → chunk-NAFNY4FL.mjs} +1 -1
  17. package/dist/chunk-NAFNY4FL.mjs.map +1 -0
  18. package/dist/{chunk-7WVURIB7.mjs → chunk-TS337P24.mjs} +8 -8
  19. package/dist/{chunk-NZIHZWRU.mjs → chunk-USIYVLVC.mjs} +5 -5
  20. package/dist/chunk-USIYVLVC.mjs.map +1 -0
  21. package/dist/{chunk-F6GMWOLE.mjs → chunk-ZQSEYPNN.mjs} +6 -25
  22. package/dist/chunk-ZQSEYPNN.mjs.map +1 -0
  23. package/dist/components/base-copilot-textarea/base-copilot-textarea.js +17 -27
  24. package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -1
  25. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +12 -12
  26. package/dist/components/base-copilot-textarea/render-element.d.ts +3 -2
  27. package/dist/components/base-copilot-textarea/render-element.js.map +1 -1
  28. package/dist/components/base-copilot-textarea/render-element.mjs +1 -1
  29. package/dist/components/base-copilot-textarea/render-placeholder.d.ts +3 -2
  30. package/dist/components/base-copilot-textarea/render-placeholder.js.map +1 -1
  31. package/dist/components/base-copilot-textarea/render-placeholder.mjs +1 -1
  32. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js +1 -1
  33. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js.map +1 -1
  34. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +1 -1
  35. package/dist/components/copilot-textarea/copilot-textarea.d.ts +3 -3
  36. package/dist/components/copilot-textarea/copilot-textarea.js +24 -48
  37. package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
  38. package/dist/components/copilot-textarea/copilot-textarea.mjs +17 -17
  39. package/dist/components/hovering-toolbar/hovering-toolbar-components.d.ts +1 -1
  40. package/dist/components/hovering-toolbar/hovering-toolbar-components.js +16 -26
  41. package/dist/components/hovering-toolbar/hovering-toolbar-components.js.map +1 -1
  42. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +1 -1
  43. package/dist/components/hovering-toolbar/hovering-toolbar.js +16 -26
  44. package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -1
  45. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +5 -5
  46. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -1
  47. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +2 -2
  48. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -1
  49. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +3 -3
  50. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -1
  51. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +3 -3
  52. package/dist/components/index.js +24 -48
  53. package/dist/components/index.js.map +1 -1
  54. package/dist/components/index.mjs +17 -17
  55. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js +4 -20
  56. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js.map +1 -1
  57. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +1 -1
  58. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js +3 -1
  59. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js.map +1 -1
  60. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +1 -1
  61. package/dist/hooks/misc/use-autosize-textarea.d.ts +1 -1
  62. package/dist/hooks/misc/use-autosize-textarea.js.map +1 -1
  63. package/dist/hooks/misc/use-autosize-textarea.mjs +1 -1
  64. package/dist/index.js +24 -48
  65. package/dist/index.js.map +1 -1
  66. package/dist/index.mjs +19 -19
  67. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +2 -2
  68. package/dist/types/autosuggestions-config/index.mjs +2 -2
  69. package/dist/types/index.mjs +2 -2
  70. package/package.json +6 -6
  71. package/src/components/base-copilot-textarea/render-element.tsx +2 -1
  72. package/src/components/base-copilot-textarea/render-placeholder.tsx +2 -1
  73. package/src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx +1 -1
  74. package/src/components/copilot-textarea/copilot-textarea.tsx +3 -3
  75. package/src/components/hovering-toolbar/hovering-toolbar-components.tsx +28 -40
  76. package/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx +24 -22
  77. package/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx +2 -1
  78. package/src/hooks/misc/use-autosize-textarea.tsx +1 -1
  79. package/dist/chunk-3PQ7GSFE.mjs.map +0 -1
  80. package/dist/chunk-7L6GIHDM.mjs.map +0 -1
  81. package/dist/chunk-F6GMWOLE.mjs.map +0 -1
  82. package/dist/chunk-HDBI2WN5.mjs.map +0 -1
  83. package/dist/chunk-NZIHZWRU.mjs.map +0 -1
  84. package/dist/chunk-RXV67GJN.mjs.map +0 -1
  85. package/dist/chunk-XW3ICO4S.mjs.map +0 -1
  86. /package/dist/{chunk-6SGWO63I.mjs.map → chunk-4ECCCOFV.mjs.map} +0 -0
  87. /package/dist/{chunk-C3PMJNQA.mjs.map → chunk-CEHEOPK4.mjs.map} +0 -0
  88. /package/dist/{chunk-2DF2AVDU.mjs.map → chunk-MC6CFI4J.mjs.map} +0 -0
  89. /package/dist/{chunk-HBWBHJ64.mjs.map → chunk-N7BU66P5.mjs.map} +0 -0
  90. /package/dist/{chunk-7WVURIB7.mjs.map → chunk-TS337P24.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,13 +1,330 @@
1
1
  # ui
2
2
 
3
- ## 0.0.0-fix-debug-infosys-20251107151227
3
+ ## 0.0.0-fix-restore-handle-method-node-http-20251222114321
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [890be06]
8
- - @copilotkit/runtime-client-gql@0.0.0-fix-debug-infosys-20251107151227
9
- - @copilotkit/react-core@0.0.0-fix-debug-infosys-20251107151227
10
- - @copilotkit/shared@0.0.0-fix-debug-infosys-20251107151227
7
+ - @copilotkit/runtime-client-gql@0.0.0-fix-restore-handle-method-node-http-20251222114321
8
+ - @copilotkit/react-core@0.0.0-fix-restore-handle-method-node-http-20251222114321
9
+ - @copilotkit/shared@0.0.0-fix-restore-handle-method-node-http-20251222114321
10
+
11
+ ## 1.50.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 80dffec: Updated the default model and API version for the Google GenAI adapter
16
+ - Updated dependencies [bdc7a8f]
17
+ - Updated dependencies [80dffec]
18
+ - Updated dependencies [cfa4185]
19
+ - Updated dependencies [eac8b20]
20
+ - @copilotkit/react-core@1.50.1
21
+ - @copilotkit/runtime-client-gql@1.50.1
22
+ - @copilotkit/shared@1.50.1
23
+
24
+ ## 1.50.1-next.3
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [eac8b20]
29
+ - @copilotkit/react-core@1.50.1-next.3
30
+ - @copilotkit/runtime-client-gql@1.50.1-next.3
31
+ - @copilotkit/shared@1.50.1-next.3
32
+
33
+ ## 1.50.1-next.2
34
+
35
+ ### Patch Changes
36
+
37
+ - Updated dependencies [bdc7a8f]
38
+ - @copilotkit/react-core@1.50.1-next.2
39
+ - @copilotkit/runtime-client-gql@1.50.1-next.2
40
+ - @copilotkit/shared@1.50.1-next.2
41
+
42
+ ## 1.50.1-next.1
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies [cfa4185]
47
+ - @copilotkit/react-core@1.50.1-next.1
48
+ - @copilotkit/runtime-client-gql@1.50.1-next.1
49
+ - @copilotkit/shared@1.50.1-next.1
50
+
51
+ ## 1.50.1-next.0
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated the default model and API version for the Google GenAI adapter
56
+ - Updated dependencies
57
+ - @copilotkit/runtime-client-gql@1.50.1-next.0
58
+ - @copilotkit/react-core@1.50.1-next.0
59
+ - @copilotkit/shared@1.50.1-next.0
60
+
61
+ ## 1.50.0
62
+
63
+ ### Minor Changes
64
+
65
+ - 0fc76d7: add new runner with telemetry baked in
66
+ - c942f9c: Minor fixes and stability improvements
67
+ - eed6021: Updating to the latest version of vnext
68
+ - 3b7367e: Improving general stability around LangChain
69
+ - 7ff9ca7: Minor fixes and improvements
70
+ - 974875e: Lint and format code to resolve Prettier errors
71
+ - 3bd484f: Minor fixes and stability improvements
72
+ - 5a534bf: fix telemetry in v1.50 runtime
73
+ - 907ae5d: - feat: route CPK implementation to 2.0 copilotkitnext
74
+ - 769a06c: Refactor suggestions to not always run
75
+ - 788292b: Improving langchain dependency resolution
76
+ - eab69a2: Enabling the new inspector
77
+ - 0a7bfe0: Updating dependency versions across all packages
78
+
79
+ ### Patch Changes
80
+
81
+ - Updated dependencies [0fc76d7]
82
+ - Updated dependencies [c942f9c]
83
+ - Updated dependencies [bad5f06]
84
+ - Updated dependencies [8ce60af]
85
+ - Updated dependencies [33f47e3]
86
+ - Updated dependencies [04057d5]
87
+ - Updated dependencies [6ce0edc]
88
+ - Updated dependencies [2c93ff1]
89
+ - Updated dependencies [b0e3652]
90
+ - Updated dependencies [7643e71]
91
+ - Updated dependencies [d55a8bd]
92
+ - Updated dependencies [eed6021]
93
+ - Updated dependencies [3b7367e]
94
+ - Updated dependencies [c38da1c]
95
+ - Updated dependencies [7ff9ca7]
96
+ - Updated dependencies [3c60073]
97
+ - Updated dependencies [962546c]
98
+ - Updated dependencies [974875e]
99
+ - Updated dependencies [4942f62]
100
+ - Updated dependencies [3bd484f]
101
+ - Updated dependencies [5a534bf]
102
+ - Updated dependencies [ca8eb39]
103
+ - Updated dependencies [907ae5d]
104
+ - Updated dependencies [769a06c]
105
+ - Updated dependencies [788292b]
106
+ - Updated dependencies [c3d55e5]
107
+ - Updated dependencies [eab69a2]
108
+ - Updated dependencies [5840bab]
109
+ - Updated dependencies [7808fac]
110
+ - Updated dependencies [0a7bfe0]
111
+ - Updated dependencies [c70210e]
112
+ - Updated dependencies [d2c57a1]
113
+ - @copilotkit/runtime-client-gql@1.50.0
114
+ - @copilotkit/react-core@1.50.0
115
+ - @copilotkit/shared@1.50.0
116
+
117
+ ## 1.50.0-beta.19
118
+
119
+ ### Minor Changes
120
+
121
+ - Improving langchain dependency resolution
122
+
123
+ ### Patch Changes
124
+
125
+ - Updated dependencies
126
+ - @copilotkit/runtime-client-gql@1.50.0-beta.19
127
+ - @copilotkit/react-core@1.50.0-beta.19
128
+ - @copilotkit/shared@1.50.0-beta.19
129
+
130
+ ## 1.50.0-beta.18
131
+
132
+ ### Minor Changes
133
+
134
+ - Improving general stability around LangChain
135
+
136
+ ### Patch Changes
137
+
138
+ - Updated dependencies
139
+ - @copilotkit/runtime-client-gql@1.50.0-beta.18
140
+ - @copilotkit/react-core@1.50.0-beta.18
141
+ - @copilotkit/shared@1.50.0-beta.18
142
+
143
+ ## 1.50.0-beta.17
144
+
145
+ ### Minor Changes
146
+
147
+ - Minor fixes and improvements
148
+
149
+ ### Patch Changes
150
+
151
+ - Updated dependencies
152
+ - @copilotkit/runtime-client-gql@1.50.0-beta.17
153
+ - @copilotkit/react-core@1.50.0-beta.17
154
+ - @copilotkit/shared@1.50.0-beta.17
155
+
156
+ ## 1.50.0-beta.16
157
+
158
+ ### Minor Changes
159
+
160
+ - Minor fixes and stability improvements
161
+
162
+ ### Patch Changes
163
+
164
+ - Updated dependencies
165
+ - @copilotkit/runtime-client-gql@1.50.0-beta.16
166
+ - @copilotkit/react-core@1.50.0-beta.16
167
+ - @copilotkit/shared@1.50.0-beta.16
168
+
169
+ ## 1.50.0-beta.15
170
+
171
+ ### Minor Changes
172
+
173
+ - Lint and format code to resolve Prettier errors
174
+
175
+ ### Patch Changes
176
+
177
+ - Updated dependencies
178
+ - @copilotkit/runtime-client-gql@1.50.0-beta.15
179
+ - @copilotkit/react-core@1.50.0-beta.15
180
+ - @copilotkit/shared@1.50.0-beta.15
181
+
182
+ ## 1.50.0-beta.14
183
+
184
+ ### Minor Changes
185
+
186
+ - Minor fixes and stability improvements
187
+
188
+ ### Patch Changes
189
+
190
+ - Updated dependencies
191
+ - @copilotkit/runtime-client-gql@1.50.0-beta.14
192
+ - @copilotkit/react-core@1.50.0-beta.14
193
+ - @copilotkit/shared@1.50.0-beta.14
194
+
195
+ ## 1.50.0-beta.13
196
+
197
+ ### Minor Changes
198
+
199
+ - Updating to the latest version of vnext
200
+
201
+ ### Patch Changes
202
+
203
+ - Updated dependencies
204
+ - @copilotkit/runtime-client-gql@1.50.0-beta.13
205
+ - @copilotkit/react-core@1.50.0-beta.13
206
+ - @copilotkit/shared@1.50.0-beta.13
207
+
208
+ ## 1.50.0-beta.12
209
+
210
+ ### Minor Changes
211
+
212
+ - eab69a2: Enabling the new inspector
213
+
214
+ ### Patch Changes
215
+
216
+ - Updated dependencies [eab69a2]
217
+ - @copilotkit/runtime-client-gql@1.50.0-beta.12
218
+ - @copilotkit/react-core@1.50.0-beta.12
219
+ - @copilotkit/shared@1.50.0-beta.12
220
+
221
+ ## 1.50.0-beta.11
222
+
223
+ ### Minor Changes
224
+
225
+ - fix telemetry in v1.50 runtime
226
+
227
+ ### Patch Changes
228
+
229
+ - Updated dependencies
230
+ - @copilotkit/runtime-client-gql@1.50.0-beta.11
231
+ - @copilotkit/react-core@1.50.0-beta.11
232
+ - @copilotkit/shared@1.50.0-beta.11
233
+
234
+ ## 1.50.0-beta.10
235
+
236
+ ### Minor Changes
237
+
238
+ - add new runner with telemetry baked in
239
+
240
+ ### Patch Changes
241
+
242
+ - Updated dependencies
243
+ - @copilotkit/runtime-client-gql@1.50.0-beta.10
244
+ - @copilotkit/react-core@1.50.0-beta.10
245
+ - @copilotkit/shared@1.50.0-beta.10
246
+
247
+ ## 1.50.0-beta.9
248
+
249
+ ### Minor Changes
250
+
251
+ - Refactor suggestions to not always run
252
+
253
+ ### Patch Changes
254
+
255
+ - Updated dependencies
256
+ - @copilotkit/runtime-client-gql@1.50.0-beta.9
257
+ - @copilotkit/react-core@1.50.0-beta.9
258
+ - @copilotkit/shared@1.50.0-beta.9
259
+
260
+ ## 1.50.0-beta.8
261
+
262
+ ### Patch Changes
263
+
264
+ - @copilotkit/react-core@1.50.0-beta.8
265
+ - @copilotkit/runtime-client-gql@1.50.0-beta.8
266
+ - @copilotkit/shared@1.50.0-beta.8
267
+
268
+ ## 1.50.0-beta.7
269
+
270
+ ### Patch Changes
271
+
272
+ - Updated dependencies [6ce0edc]
273
+ - @copilotkit/react-core@1.50.0-beta.7
274
+ - @copilotkit/runtime-client-gql@1.50.0-beta.7
275
+ - @copilotkit/shared@1.50.0-beta.7
276
+
277
+ ## 1.50.0-beta.6
278
+
279
+ ### Minor Changes
280
+
281
+ - Updating dependency versions across all packages
282
+
283
+ ### Patch Changes
284
+
285
+ - Updated dependencies
286
+ - @copilotkit/runtime-client-gql@1.50.0-beta.6
287
+ - @copilotkit/react-core@1.50.0-beta.6
288
+ - @copilotkit/shared@1.50.0-beta.6
289
+
290
+ ## 1.50.0-beta.4
291
+
292
+ ### Minor Changes
293
+
294
+ - 907ae5d: - feat: route CPK implementation to 2.0 copilotkitnext
295
+
296
+ ### Patch Changes
297
+
298
+ - Updated dependencies [bad5f06]
299
+ - Updated dependencies [8ce60af]
300
+ - Updated dependencies [33f47e3]
301
+ - Updated dependencies [04057d5]
302
+ - Updated dependencies [2c93ff1]
303
+ - Updated dependencies [b0e3652]
304
+ - Updated dependencies [7643e71]
305
+ - Updated dependencies [d55a8bd]
306
+ - Updated dependencies [c38da1c]
307
+ - Updated dependencies [3c60073]
308
+ - Updated dependencies [962546c]
309
+ - Updated dependencies [4942f62]
310
+ - Updated dependencies [ca8eb39]
311
+ - Updated dependencies [907ae5d]
312
+ - Updated dependencies [c3d55e5]
313
+ - Updated dependencies [5840bab]
314
+ - Updated dependencies [7808fac]
315
+ - Updated dependencies [c70210e]
316
+ - Updated dependencies [d2c57a1]
317
+ - @copilotkit/react-core@1.50.0-beta.4
318
+ - @copilotkit/runtime-client-gql@1.50.0-beta.4
319
+ - @copilotkit/shared@1.50.0-beta.4
320
+
321
+ ## 1.10.7-next.0
322
+
323
+ ### Patch Changes
324
+
325
+ - @copilotkit/react-core@1.10.7-next.0
326
+ - @copilotkit/runtime-client-gql@1.10.7-next.0
327
+ - @copilotkit/shared@1.10.7-next.0
11
328
 
12
329
  ## 1.10.6
13
330
 
@@ -9,32 +9,22 @@ import { css, cx } from "@emotion/css";
9
9
  import React from "react";
10
10
  import ReactDOM from "react-dom";
11
11
  import { jsx } from "react/jsx-runtime";
12
- var Button = React.forwardRef(
13
- (_a, ref) => {
14
- var _b = _a, {
15
- className,
16
- active,
17
- reversed
18
- } = _b, props = __objRest(_b, [
19
- "className",
20
- "active",
21
- "reversed"
22
- ]);
23
- return /* @__PURE__ */ jsx(
24
- "span",
25
- __spreadProps(__spreadValues({}, props), {
26
- ref,
27
- className: cx(
28
- className,
29
- css`
30
- cursor: pointer;
31
- color: ${reversed ? active ? "white" : "#aaa" : active ? "black" : "#ccc"};
32
- `
33
- )
34
- })
35
- );
36
- }
37
- );
12
+ var Button = React.forwardRef((_a, ref) => {
13
+ var _b = _a, { className, active, reversed } = _b, props = __objRest(_b, ["className", "active", "reversed"]);
14
+ return /* @__PURE__ */ jsx(
15
+ "span",
16
+ __spreadProps(__spreadValues({}, props), {
17
+ ref,
18
+ className: cx(
19
+ className,
20
+ css`
21
+ cursor: pointer;
22
+ color: ${reversed ? active ? "white" : "#aaa" : active ? "black" : "#ccc"};
23
+ `
24
+ )
25
+ })
26
+ );
27
+ });
38
28
  var Icon = React.forwardRef(
39
29
  (_a, ref) => {
40
30
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
@@ -110,4 +100,4 @@ export {
110
100
  Portal,
111
101
  Toolbar
112
102
  };
113
- //# sourceMappingURL=chunk-HDBI2WN5.mjs.map
103
+ //# sourceMappingURL=chunk-2IWVZ4PP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/hovering-toolbar/hovering-toolbar-components.tsx"],"sourcesContent":["import { css, cx } from \"@emotion/css\";\nimport React, { PropsWithChildren, Ref } from \"react\";\nimport ReactDOM from \"react-dom\";\n\ninterface BaseProps {\n className?: string;\n [key: string]: unknown;\n}\n\nexport const Button = React.forwardRef<\n HTMLSpanElement,\n PropsWithChildren<{ active: boolean; reversed: boolean } & BaseProps>\n>(({ className, active, reversed, ...props }, ref) => (\n <span\n {...props}\n ref={ref}\n className={cx(\n className as string,\n css`\n cursor: pointer;\n color: ${reversed ? (active ? \"white\" : \"#aaa\") : active ? \"black\" : \"#ccc\"};\n `,\n )}\n />\n));\n\nexport const Icon = React.forwardRef<HTMLSpanElement, PropsWithChildren<BaseProps>>(\n ({ className, ...props }, ref) => (\n <span\n {...props}\n ref={ref}\n className={cx(\n \"material-icons\",\n className as string,\n css`\n font-size: 18px;\n vertical-align: text-bottom;\n `,\n )}\n />\n ),\n);\n\nexport const Menu = React.forwardRef<HTMLDivElement, PropsWithChildren<BaseProps>>(\n ({ className, ...props }, ref) => {\n return (\n <div\n {...props}\n data-testid=\"menu\"\n ref={ref}\n className={cx(\n className as string,\n css`\n & > * {\n display: inline-block;\n }\n\n & > * + * {\n margin-left: 15px;\n }\n `,\n )}\n />\n );\n },\n);\nexport const Portal = ({ children }: { children: React.ReactNode }) => {\n return typeof document === \"object\" ? ReactDOM.createPortal(children, document.body) : null;\n};\n\nexport const Toolbar = React.forwardRef<HTMLDivElement, PropsWithChildren<BaseProps>>(\n ({ className, ...props }, ref) => (\n <Menu\n {...props}\n ref={ref}\n className={cx(\n className as string,\n css`\n position: relative;\n padding: 1px 18px 17px;\n margin: 0 -20px;\n border-bottom: 2px solid #eee;\n margin-bottom: 20px;\n `,\n )}\n />\n ),\n);\n"],"mappings":";;;;;;;AAAA,SAAS,KAAK,UAAU;AACxB,OAAO,WAAuC;AAC9C,OAAO,cAAc;AAWnB;AAJK,IAAM,SAAS,MAAM,WAG1B,CAAC,IAA2C,QAAK;AAAhD,eAAE,aAAW,QAAQ,SAZxB,IAYG,IAAkC,kBAAlC,IAAkC,CAAhC,aAAW,UAAQ;AACtB;AAAA,IAAC;AAAA,qCACK,QADL;AAAA,MAEC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA;AAAA,iBAEW,WAAY,SAAS,UAAU,SAAU,SAAS,UAAU;AAAA;AAAA,MAEzE;AAAA;AAAA,EACF;AAAA,CACD;AAEM,IAAM,OAAO,MAAM;AAAA,EACxB,CAAC,IAAyB,QAAK;AAA9B,iBAAE,YA3BL,IA2BG,IAAgB,kBAAhB,IAAgB,CAAd;AACD;AAAA,MAAC;AAAA,uCACK,QADL;AAAA,QAEC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA;AAAA;AAAA;AAAA,QAIF;AAAA;AAAA,IACF;AAAA;AAEJ;AAEO,IAAM,OAAO,MAAM;AAAA,EACxB,CAAC,IAAyB,QAAQ;AAAjC,iBAAE,YA5CL,IA4CG,IAAgB,kBAAhB,IAAgB,CAAd;AACD,WACE;AAAA,MAAC;AAAA,uCACK,QADL;AAAA,QAEC,eAAY;AAAA,QACZ;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QASF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AACO,IAAM,SAAS,CAAC,EAAE,SAAS,MAAqC;AACrE,SAAO,OAAO,aAAa,WAAW,SAAS,aAAa,UAAU,SAAS,IAAI,IAAI;AACzF;AAEO,IAAM,UAAU,MAAM;AAAA,EAC3B,CAAC,IAAyB,QAAK;AAA9B,iBAAE,YAvEL,IAuEG,IAAgB,kBAAhB,IAAgB,CAAd;AACD;AAAA,MAAC;AAAA,uCACK,QADL;AAAA,QAEC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOF;AAAA;AAAA,IACF;AAAA;AAEJ;","names":[]}
@@ -22,4 +22,4 @@ function makeRenderPlaceholderFunction(placeholderStyle) {
22
22
  export {
23
23
  makeRenderPlaceholderFunction
24
24
  };
25
- //# sourceMappingURL=chunk-XW3ICO4S.mjs.map
25
+ //# sourceMappingURL=chunk-3QJOFG3V.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/base-copilot-textarea/render-placeholder.tsx"],"sourcesContent":["import { RenderPlaceholderProps } from \"slate-react\";\nimport React from \"react\";\n\nexport type RenderPlaceholderFunction = (props: RenderPlaceholderProps) => React.JSX.Element;\n\nexport function makeRenderPlaceholderFunction(\n placeholderStyle?: React.CSSProperties,\n): RenderPlaceholderFunction {\n return (props: RenderPlaceholderProps) => {\n const { style, ...restAttributes } = props.attributes;\n\n return (\n <div\n {...restAttributes}\n style={{\n ...style,\n ...placeholderStyle,\n }}\n >\n {props.children}\n </div>\n );\n };\n}\n"],"mappings":";;;;;;;AAYM;AAPC,SAAS,8BACd,kBAC2B;AAC3B,SAAO,CAAC,UAAkC;AACxC,UAAqC,WAAM,YAAnC,QATZ,IASyC,IAAnB,2BAAmB,IAAnB,CAAV;AAER,WACE;AAAA,MAAC;AAAA,uCACK,iBADL;AAAA,QAEC,OAAO,kCACF,QACA;AAAA,QAGJ,gBAAM;AAAA;AAAA,IACT;AAAA,EAEJ;AACF;","names":[]}
@@ -1,12 +1,12 @@
1
+ import {
2
+ defaultEditingApiConfig
3
+ } from "./chunk-EJGGLWWR.mjs";
1
4
  import {
2
5
  defaultInsertionsApiConfig
3
6
  } from "./chunk-MCNXIA4Q.mjs";
4
7
  import {
5
8
  defaultSuggestionsApiConfig
6
9
  } from "./chunk-QFXR6DOA.mjs";
7
- import {
8
- defaultEditingApiConfig
9
- } from "./chunk-EJGGLWWR.mjs";
10
10
  import {
11
11
  defaultBaseAutosuggestionsConfig
12
12
  } from "./chunk-F6RLSVG3.mjs";
@@ -29,4 +29,4 @@ var defaultAutosuggestionsConfig = __spreadProps(__spreadValues({}, defaultBaseA
29
29
  export {
30
30
  defaultAutosuggestionsConfig
31
31
  };
32
- //# sourceMappingURL=chunk-6SGWO63I.mjs.map
32
+ //# sourceMappingURL=chunk-4ECCCOFV.mjs.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  HoveringInsertionPromptBox
3
- } from "./chunk-2DF2AVDU.mjs";
3
+ } from "./chunk-MC6CFI4J.mjs";
4
4
  import {
5
5
  useHoveringEditorContext
6
6
  } from "./chunk-LYB4B6MK.mjs";
7
7
  import {
8
8
  Menu,
9
9
  Portal
10
- } from "./chunk-HDBI2WN5.mjs";
10
+ } from "./chunk-2IWVZ4PP.mjs";
11
11
  import {
12
12
  getFullEditorTextWithNewlines,
13
13
  getTextAroundSelection
@@ -117,4 +117,4 @@ function editorState(editor, selection) {
117
117
  export {
118
118
  HoveringToolbar
119
119
  };
120
- //# sourceMappingURL=chunk-C3PMJNQA.mjs.map
120
+ //# sourceMappingURL=chunk-CEHEOPK4.mjs.map
@@ -19,7 +19,9 @@ import {
19
19
  CopilotRequestType
20
20
  } from "@copilotkit/runtime-client-gql";
21
21
  function useMakeStandardInsertionOrEditingFunction(textareaPurpose, contextCategories, insertionApiConfig, editingApiConfig) {
22
- const { getContextString, copilotApiConfig, runtimeClient } = useCopilotContext();
22
+ const runtimeClient = { generateCopilotResponse: (...args) => {
23
+ } };
24
+ const { getContextString, copilotApiConfig } = useCopilotContext();
23
25
  const headers = __spreadValues({}, copilotApiConfig.publicApiKey ? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey } : {});
24
26
  function runtimeClientResponseToStringStream(responsePromise) {
25
27
  return __async(this, null, function* () {
@@ -165,4 +167,4 @@ function useMakeStandardInsertionOrEditingFunction(textareaPurpose, contextCateg
165
167
  export {
166
168
  useMakeStandardInsertionOrEditingFunction
167
169
  };
168
- //# sourceMappingURL=chunk-RXV67GJN.mjs.map
170
+ //# sourceMappingURL=chunk-DL3JWL2E.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx"],"sourcesContent":["import { COPILOT_CLOUD_PUBLIC_API_KEY_HEADER } from \"@copilotkit/shared\";\nimport { useCopilotContext } from \"@copilotkit/react-core\";\nimport { useCallback } from \"react\";\nimport {\n CopilotRuntimeClient,\n Message,\n Role,\n TextMessage,\n convertGqlOutputToMessages,\n convertMessagesToGqlInput,\n filterAgentStateMessages,\n CopilotRequestType,\n} from \"@copilotkit/runtime-client-gql\";\nimport { retry } from \"../../lib/retry\";\nimport {\n EditingEditorState,\n Generator_InsertionOrEditingSuggestion,\n} from \"../../types/base/autosuggestions-bare-function\";\nimport { InsertionsApiConfig } from \"../../types/autosuggestions-config/insertions-api-config\";\nimport { EditingApiConfig } from \"../../types/autosuggestions-config/editing-api-config\";\nimport { DocumentPointer } from \"@copilotkit/react-core\";\n\n/**\n * Returns a memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.\n * The function takes in the text before and after the cursor, and an abort signal.\n * It sends a POST request to the API endpoint with the messages array containing the system message, few shot messages, and user messages.\n * The function returns the suggestion from the API response.\n *\n * @param textareaPurpose - The purpose of the textarea. This is included in the system message.\n * @param apiEndpoint - The API endpoint to send the autosuggestion request to.\n * @param makeSystemMessage - A function that takes in a context string and returns a system message to include in the autosuggestion request.\n * @param fewShotMessages - An array of few shot messages to include in the autosuggestion request.\n * @param contextCategories - The categories of context strings we want to include. By default, we include the (default) \"global\" context category.\n * @returns A memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.\n */\nexport function useMakeStandardInsertionOrEditingFunction(\n textareaPurpose: string,\n contextCategories: string[],\n insertionApiConfig: InsertionsApiConfig,\n editingApiConfig: EditingApiConfig,\n): Generator_InsertionOrEditingSuggestion {\n const runtimeClient: any = { generateCopilotResponse: (...args: any[]) => {} };\n const { getContextString, copilotApiConfig } = useCopilotContext();\n const headers = {\n ...(copilotApiConfig.publicApiKey\n ? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey }\n : {}),\n };\n\n async function runtimeClientResponseToStringStream(\n responsePromise: ReturnType<typeof runtimeClient.generateCopilotResponse>,\n ) {\n const messagesStream = runtimeClient.asStream(responsePromise);\n\n return new ReadableStream({\n async start(controller) {\n const reader = messagesStream.getReader();\n let sentContent = \"\";\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n\n const messages = convertGqlOutputToMessages(value.generateCopilotResponse.messages);\n\n let newContent = \"\";\n\n for (const message of messages) {\n if (message.isTextMessage()) {\n newContent += message.content;\n }\n }\n if (newContent) {\n const contentToSend = newContent.slice(sentContent.length);\n controller.enqueue(contentToSend);\n sentContent += contentToSend;\n }\n }\n controller.close();\n },\n });\n }\n\n const insertionFunction = useCallback(\n async (\n editorState: EditingEditorState,\n insertionPrompt: string,\n documents: DocumentPointer[],\n abortSignal: AbortSignal,\n ) => {\n const res = await retry(async () => {\n const messages: Message[] = [\n new TextMessage({\n role: Role.System,\n content: insertionApiConfig.makeSystemPrompt(\n textareaPurpose,\n getContextString(documents, contextCategories),\n ),\n }),\n ...insertionApiConfig.fewShotMessages,\n new TextMessage({\n role: Role.User,\n content: `<TextAfterCursor>${editorState.textAfterCursor}</TextAfterCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<TextBeforeCursor>${editorState.textBeforeCursor}</TextBeforeCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<InsertionPrompt>${insertionPrompt}</InsertionPrompt>`,\n }),\n ];\n\n return runtimeClientResponseToStringStream(\n runtimeClient.generateCopilotResponse({\n data: {\n frontend: {\n actions: [],\n url: window.location.href,\n },\n messages: convertMessagesToGqlInput(filterAgentStateMessages(messages)),\n metadata: {\n requestType: CopilotRequestType.TextareaCompletion,\n },\n },\n properties: copilotApiConfig.properties,\n signal: abortSignal,\n }),\n );\n });\n\n return res;\n },\n [insertionApiConfig, getContextString, contextCategories, textareaPurpose],\n );\n\n const editingFunction = useCallback(\n async (\n editorState: EditingEditorState,\n editingPrompt: string,\n documents: DocumentPointer[],\n abortSignal: AbortSignal,\n ) => {\n const res = await retry(async () => {\n const messages: Message[] = [\n new TextMessage({\n role: Role.System,\n content: editingApiConfig.makeSystemPrompt(\n textareaPurpose,\n getContextString(documents, contextCategories),\n ),\n }),\n ...editingApiConfig.fewShotMessages,\n new TextMessage({\n role: Role.User,\n content: `<TextBeforeCursor>${editorState.textBeforeCursor}</TextBeforeCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<TextToEdit>${editorState.selectedText}</TextToEdit>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<TextAfterCursor>${editorState.textAfterCursor}</TextAfterCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<EditingPrompt>${editingPrompt}</EditingPrompt>`,\n }),\n ];\n\n return runtimeClientResponseToStringStream(\n runtimeClient.generateCopilotResponse({\n data: {\n frontend: {\n actions: [],\n url: window.location.href,\n },\n messages: convertMessagesToGqlInput(filterAgentStateMessages(messages)),\n metadata: {\n requestType: CopilotRequestType.TextareaCompletion,\n },\n },\n properties: copilotApiConfig.properties,\n signal: abortSignal,\n }),\n );\n });\n\n return res;\n },\n [editingApiConfig, getContextString, contextCategories, textareaPurpose],\n );\n\n const insertionOrEditingFunction = useCallback(\n async (\n editorState: EditingEditorState,\n insertionPrompt: string,\n documents: DocumentPointer[],\n abortSignal: AbortSignal,\n ) => {\n if (editorState.selectedText === \"\") {\n return await insertionFunction(editorState, insertionPrompt, documents, abortSignal);\n } else {\n return await editingFunction(editorState, insertionPrompt, documents, abortSignal);\n }\n },\n [insertionFunction, editingFunction],\n );\n\n return insertionOrEditingFunction;\n}\n"],"mappings":"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","names":[]}
@@ -36,4 +36,4 @@ var SuggestionElement = (props) => {
36
36
  export {
37
37
  makeRenderElementFunction
38
38
  };
39
- //# sourceMappingURL=chunk-7L6GIHDM.mjs.map
39
+ //# sourceMappingURL=chunk-F2ULK22F.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/base-copilot-textarea/render-element.tsx"],"sourcesContent":["import { RenderElementProps } from \"slate-react\";\nimport React from \"react\";\n\nexport type RenderElementFunction = (props: RenderElementProps) => React.JSX.Element;\n\nexport function makeRenderElementFunction(\n suggestionsStyle: React.CSSProperties,\n): RenderElementFunction {\n return (props: RenderElementProps) => {\n switch (props.element.type) {\n case \"paragraph\":\n return <DefaultElement {...props} />;\n case \"suggestion\":\n return <SuggestionElement {...props} suggestionsStyle={suggestionsStyle} />;\n }\n };\n}\n\nconst DefaultElement = (props: RenderElementProps) => {\n return <div {...props.attributes}>{props.children}</div>;\n};\nconst SuggestionElement = (\n props: RenderElementProps & {\n suggestionsStyle: React.CSSProperties;\n },\n) => {\n return (\n <span\n {...props.attributes}\n style={{\n ...props.suggestionsStyle,\n }}\n data-testid=\"suggestion\"\n contentEditable={false}\n >\n {props.children /* https://github.com/ianstormtaylor/slate/issues/3930 */}\n {props.element.type === \"suggestion\" && props.element.content}\n </span>\n );\n};\n"],"mappings":";;;;;;AAWe,cAgBX,YAhBW;AANR,SAAS,0BACd,kBACuB;AACvB,SAAO,CAAC,UAA8B;AACpC,YAAQ,MAAM,QAAQ,MAAM;AAAA,MAC1B,KAAK;AACH,eAAO,oBAAC,mCAAmB,MAAO;AAAA,MACpC,KAAK;AACH,eAAO,oBAAC,oDAAsB,QAAtB,EAA6B,mBAAoC;AAAA,IAC7E;AAAA,EACF;AACF;AAEA,IAAM,iBAAiB,CAAC,UAA8B;AACpD,SAAO,oBAAC,wCAAQ,MAAM,aAAd,EAA2B,gBAAM,WAAS;AACpD;AACA,IAAM,oBAAoB,CACxB,UAGG;AACH,SACE;AAAA,IAAC;AAAA,qCACK,MAAM,aADX;AAAA,MAEC,OAAO,mBACF,MAAM;AAAA,MAEX,eAAY;AAAA,MACZ,iBAAiB;AAAA,MAEhB;AAAA,cAAM;AAAA,QACN,MAAM,QAAQ,SAAS,gBAAgB,MAAM,QAAQ;AAAA;AAAA;AAAA,EACxD;AAEJ;","names":[]}
@@ -36,7 +36,7 @@ var isSelectionEqual = (a, b) => {
36
36
  return Range.equals(a, b);
37
37
  };
38
38
  function usePrevious(value) {
39
- const ref = useRef();
39
+ const ref = useRef(void 0);
40
40
  useEffect(() => {
41
41
  ref.current = value;
42
42
  });
@@ -46,4 +46,4 @@ function usePrevious(value) {
46
46
  export {
47
47
  TrackerTextEditedSinceLastCursorMovement
48
48
  };
49
- //# sourceMappingURL=chunk-LQ2OWQU7.mjs.map
49
+ //# sourceMappingURL=chunk-JLOABKLH.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { BaseSelection } from \"slate\";\nimport { useSlateSelector } from \"slate-react\";\nimport { Range } from \"slate\";\nimport { editorToText } from \"../../lib/editor-to-text\";\n\ninterface TrackerTextEditedSinceLastCursorMovementProps {\n setCursorMovedSinceLastTextChange: (value: boolean) => void;\n}\nexport function TrackerTextEditedSinceLastCursorMovement(\n props: TrackerTextEditedSinceLastCursorMovementProps,\n) {\n const cursorState: RelevantEditorState = useSlateSelector((state) => ({\n selection: state.selection,\n text: editorToText(state),\n }));\n\n const previousState = usePrevious(cursorState);\n\n useEffect(() => {\n if (!previousState) {\n return;\n }\n\n if (cursorChangedWithoutTextChanged(previousState, cursorState)) {\n props.setCursorMovedSinceLastTextChange(true);\n }\n }, [props.setCursorMovedSinceLastTextChange, cursorState]);\n\n return <></>;\n}\n\ntype RelevantEditorState = {\n selection: BaseSelection;\n text: string;\n};\n\nconst cursorChangedWithoutTextChanged = (\n prev: RelevantEditorState,\n next: RelevantEditorState,\n): boolean => {\n // Check if the selection has changed\n const isSelectionChanged = !isSelectionEqual(prev.selection, next.selection);\n\n // Check if the text content remains the same\n const isTextSame = prev.text === next.text;\n\n return isSelectionChanged && isTextSame;\n};\n\nconst isSelectionEqual = (a: BaseSelection, b: BaseSelection) => {\n if (!a && !b) return true;\n if (!a || !b) return false;\n return Range.equals(a, b);\n};\n\n/**\n * Easily keep track of the *previous* value of a variable.\n *\n * Example:\n * ```\n * const [count, setCount] = useState(0);\n * const prevCount = usePrevious(count);\n *\n * useEffect(() => {\n * if (count > prevCount) {\n * console.log('Now I know that count is bigger than before');\n * }\n * }, [count, prevCount]);\n * ```\n */\nfunction usePrevious<T>(value: T): T | undefined {\n const ref = useRef<T>();\n\n useEffect(() => {\n ref.current = value;\n });\n\n return ref.current;\n}\n"],"mappings":";;;;;AAAA,SAAS,WAAW,cAAc;AAElC,SAAS,wBAAwB;AACjC,SAAS,aAAa;AA0Bb;AApBF,SAAS,yCACd,OACA;AACA,QAAM,cAAmC,iBAAiB,CAAC,WAAW;AAAA,IACpE,WAAW,MAAM;AAAA,IACjB,MAAM,aAAa,KAAK;AAAA,EAC1B,EAAE;AAEF,QAAM,gBAAgB,YAAY,WAAW;AAE7C,YAAU,MAAM;AACd,QAAI,CAAC,eAAe;AAClB;AAAA,IACF;AAEA,QAAI,gCAAgC,eAAe,WAAW,GAAG;AAC/D,YAAM,kCAAkC,IAAI;AAAA,IAC9C;AAAA,EACF,GAAG,CAAC,MAAM,mCAAmC,WAAW,CAAC;AAEzD,SAAO,gCAAE;AACX;AAOA,IAAM,kCAAkC,CACtC,MACA,SACY;AAEZ,QAAM,qBAAqB,CAAC,iBAAiB,KAAK,WAAW,KAAK,SAAS;AAG3E,QAAM,aAAa,KAAK,SAAS,KAAK;AAEtC,SAAO,sBAAsB;AAC/B;AAEA,IAAM,mBAAmB,CAAC,GAAkB,MAAqB;AAC/D,MAAI,CAAC,KAAK,CAAC;AAAG,WAAO;AACrB,MAAI,CAAC,KAAK,CAAC;AAAG,WAAO;AACrB,SAAO,MAAM,OAAO,GAAG,CAAC;AAC1B;AAiBA,SAAS,YAAe,OAAyB;AAC/C,QAAM,MAAM,OAAU;AAEtB,YAAU,MAAM;AACd,QAAI,UAAU;AAAA,EAChB,CAAC;AAED,SAAO,IAAI;AACb;","names":[]}
1
+ {"version":3,"sources":["../src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { BaseSelection } from \"slate\";\nimport { useSlateSelector } from \"slate-react\";\nimport { Range } from \"slate\";\nimport { editorToText } from \"../../lib/editor-to-text\";\n\ninterface TrackerTextEditedSinceLastCursorMovementProps {\n setCursorMovedSinceLastTextChange: (value: boolean) => void;\n}\nexport function TrackerTextEditedSinceLastCursorMovement(\n props: TrackerTextEditedSinceLastCursorMovementProps,\n) {\n const cursorState: RelevantEditorState = useSlateSelector((state) => ({\n selection: state.selection,\n text: editorToText(state),\n }));\n\n const previousState = usePrevious(cursorState);\n\n useEffect(() => {\n if (!previousState) {\n return;\n }\n\n if (cursorChangedWithoutTextChanged(previousState, cursorState)) {\n props.setCursorMovedSinceLastTextChange(true);\n }\n }, [props.setCursorMovedSinceLastTextChange, cursorState]);\n\n return <></>;\n}\n\ntype RelevantEditorState = {\n selection: BaseSelection;\n text: string;\n};\n\nconst cursorChangedWithoutTextChanged = (\n prev: RelevantEditorState,\n next: RelevantEditorState,\n): boolean => {\n // Check if the selection has changed\n const isSelectionChanged = !isSelectionEqual(prev.selection, next.selection);\n\n // Check if the text content remains the same\n const isTextSame = prev.text === next.text;\n\n return isSelectionChanged && isTextSame;\n};\n\nconst isSelectionEqual = (a: BaseSelection, b: BaseSelection) => {\n if (!a && !b) return true;\n if (!a || !b) return false;\n return Range.equals(a, b);\n};\n\n/**\n * Easily keep track of the *previous* value of a variable.\n *\n * Example:\n * ```\n * const [count, setCount] = useState(0);\n * const prevCount = usePrevious(count);\n *\n * useEffect(() => {\n * if (count > prevCount) {\n * console.log('Now I know that count is bigger than before');\n * }\n * }, [count, prevCount]);\n * ```\n */\nfunction usePrevious<T>(value: T): T | undefined {\n const ref = useRef<T>(undefined!);\n\n useEffect(() => {\n ref.current = value;\n });\n\n return ref.current;\n}\n"],"mappings":";;;;;AAAA,SAAS,WAAW,cAAc;AAElC,SAAS,wBAAwB;AACjC,SAAS,aAAa;AA0Bb;AApBF,SAAS,yCACd,OACA;AACA,QAAM,cAAmC,iBAAiB,CAAC,WAAW;AAAA,IACpE,WAAW,MAAM;AAAA,IACjB,MAAM,aAAa,KAAK;AAAA,EAC1B,EAAE;AAEF,QAAM,gBAAgB,YAAY,WAAW;AAE7C,YAAU,MAAM;AACd,QAAI,CAAC,eAAe;AAClB;AAAA,IACF;AAEA,QAAI,gCAAgC,eAAe,WAAW,GAAG;AAC/D,YAAM,kCAAkC,IAAI;AAAA,IAC9C;AAAA,EACF,GAAG,CAAC,MAAM,mCAAmC,WAAW,CAAC;AAEzD,SAAO,gCAAE;AACX;AAOA,IAAM,kCAAkC,CACtC,MACA,SACY;AAEZ,QAAM,qBAAqB,CAAC,iBAAiB,KAAK,WAAW,KAAK,SAAS;AAG3E,QAAM,aAAa,KAAK,SAAS,KAAK;AAEtC,SAAO,sBAAsB;AAC/B;AAEA,IAAM,mBAAmB,CAAC,GAAkB,MAAqB;AAC/D,MAAI,CAAC,KAAK,CAAC;AAAG,WAAO;AACrB,MAAI,CAAC,KAAK,CAAC;AAAG,WAAO;AACrB,SAAO,MAAM,OAAO,GAAG,CAAC;AAC1B;AAiBA,SAAS,YAAe,OAAyB;AAC/C,QAAM,MAAM,OAAU,MAAU;AAEhC,YAAU,MAAM;AACd,QAAI,UAAU;AAAA,EAChB,CAAC;AAED,SAAO,IAAI;AACb;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HoveringInsertionPromptBoxCore
3
- } from "./chunk-HBWBHJ64.mjs";
3
+ } from "./chunk-N7BU66P5.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-2DF2AVDU.mjs.map
31
+ //# sourceMappingURL=chunk-MC6CFI4J.mjs.map
@@ -1,9 +1,9 @@
1
+ import {
2
+ use_autosize_textarea_default
3
+ } from "./chunk-NAFNY4FL.mjs";
1
4
  import {
2
5
  IncludedFilesPreview
3
6
  } from "./chunk-KMVGEY7Q.mjs";
4
- import {
5
- use_autosize_textarea_default
6
- } from "./chunk-3PQ7GSFE.mjs";
7
7
  import {
8
8
  Label
9
9
  } from "./chunk-D47EKHIF.mjs";
@@ -223,4 +223,4 @@ var HoveringInsertionPromptBoxCore = ({
223
223
  export {
224
224
  HoveringInsertionPromptBoxCore
225
225
  };
226
- //# sourceMappingURL=chunk-HBWBHJ64.mjs.map
226
+ //# sourceMappingURL=chunk-N7BU66P5.mjs.map
@@ -14,4 +14,4 @@ var use_autosize_textarea_default = useAutosizeTextArea;
14
14
  export {
15
15
  use_autosize_textarea_default
16
16
  };
17
- //# sourceMappingURL=chunk-3PQ7GSFE.mjs.map
17
+ //# sourceMappingURL=chunk-NAFNY4FL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/misc/use-autosize-textarea.tsx"],"sourcesContent":["import { Ref, RefObject, useEffect } from \"react\";\n\n// Updates the height of a <textarea> when the value changes.\nconst useAutosizeTextArea = (textAreaRef: RefObject<HTMLTextAreaElement | null>, value: string) => {\n useEffect(() => {\n if (textAreaRef.current !== null) {\n // We need to reset the height momentarily to get the correct scrollHeight for the textarea\n textAreaRef.current.style.height = \"0px\";\n const scrollHeight = textAreaRef.current.scrollHeight;\n\n // We then set the height directly, outside of the render loop\n // Trying to set this with state or a ref will product an incorrect value.\n textAreaRef.current.style.height = scrollHeight + \"px\";\n }\n }, [textAreaRef, value]);\n};\n\nexport default useAutosizeTextArea;\n"],"mappings":";AAAA,SAAyB,iBAAiB;AAG1C,IAAM,sBAAsB,CAAC,aAAoD,UAAkB;AACjG,YAAU,MAAM;AACd,QAAI,YAAY,YAAY,MAAM;AAEhC,kBAAY,QAAQ,MAAM,SAAS;AACnC,YAAM,eAAe,YAAY,QAAQ;AAIzC,kBAAY,QAAQ,MAAM,SAAS,eAAe;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,aAAa,KAAK,CAAC;AACzB;AAEA,IAAO,gCAAQ;","names":[]}
@@ -16,12 +16,9 @@ import {
16
16
  import {
17
17
  replaceEditorText
18
18
  } from "./chunk-5UNJXFUO.mjs";
19
- import {
20
- useAddBrandingCss
21
- } from "./chunk-7LSRNPNI.mjs";
22
19
  import {
23
20
  HoveringToolbar
24
- } from "./chunk-C3PMJNQA.mjs";
21
+ } from "./chunk-CEHEOPK4.mjs";
25
22
  import {
26
23
  HoveringEditorProvider,
27
24
  useHoveringEditorContext
@@ -31,13 +28,16 @@ import {
31
28
  } from "./chunk-F6RLSVG3.mjs";
32
29
  import {
33
30
  makeRenderElementFunction
34
- } from "./chunk-7L6GIHDM.mjs";
31
+ } from "./chunk-F2ULK22F.mjs";
35
32
  import {
36
33
  makeRenderPlaceholderFunction
37
- } from "./chunk-XW3ICO4S.mjs";
34
+ } from "./chunk-3QJOFG3V.mjs";
38
35
  import {
39
36
  TrackerTextEditedSinceLastCursorMovement
40
- } from "./chunk-LQ2OWQU7.mjs";
37
+ } from "./chunk-JLOABKLH.mjs";
38
+ import {
39
+ useAddBrandingCss
40
+ } from "./chunk-7LSRNPNI.mjs";
41
41
  import {
42
42
  getFullEditorTextWithNewlines,
43
43
  getTextAroundCollapsedCursor
@@ -266,4 +266,4 @@ function makeSemiFakeReactTextAreaEvent(currentText) {
266
266
  export {
267
267
  BaseCopilotTextarea
268
268
  };
269
- //# sourceMappingURL=chunk-7WVURIB7.mjs.map
269
+ //# sourceMappingURL=chunk-TS337P24.mjs.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  useMakeStandardAutosuggestionFunction
3
- } from "./chunk-F6GMWOLE.mjs";
3
+ } from "./chunk-ZQSEYPNN.mjs";
4
4
  import {
5
5
  useMakeStandardInsertionOrEditingFunction
6
- } from "./chunk-RXV67GJN.mjs";
6
+ } from "./chunk-DL3JWL2E.mjs";
7
7
  import {
8
8
  defaultAutosuggestionsConfig
9
- } from "./chunk-6SGWO63I.mjs";
9
+ } from "./chunk-4ECCCOFV.mjs";
10
10
  import {
11
11
  BaseCopilotTextarea
12
- } from "./chunk-7WVURIB7.mjs";
12
+ } from "./chunk-TS337P24.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-NZIHZWRU.mjs.map
60
+ //# sourceMappingURL=chunk-USIYVLVC.mjs.map