@copilotkit/react-textarea 0.0.0-fix-interrupt-issues-20250409144731 → 0.0.0-fix-agent-lock-20250618155414

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 (67) hide show
  1. package/CHANGELOG.md +414 -5
  2. package/dist/{chunk-MGYT7RNL.mjs → chunk-4ECCCOFV.mjs} +2 -2
  3. package/dist/{chunk-IYKS4ECD.mjs → chunk-7ISLGT23.mjs} +6 -6
  4. package/dist/{chunk-JECODQDC.mjs → chunk-B7WYSFPJ.mjs} +18 -23
  5. package/dist/chunk-B7WYSFPJ.mjs.map +1 -0
  6. package/dist/{chunk-4CVSOOJY.mjs → chunk-F6RLSVG3.mjs} +5 -5
  7. package/dist/chunk-F6RLSVG3.mjs.map +1 -0
  8. package/dist/{chunk-PBGN5D4Y.mjs → chunk-X7RBT3JT.mjs} +14 -10
  9. package/dist/chunk-X7RBT3JT.mjs.map +1 -0
  10. package/dist/{chunk-XIMW7FGX.mjs → chunk-YHMWPA3C.mjs} +6 -9
  11. package/dist/chunk-YHMWPA3C.mjs.map +1 -0
  12. package/dist/{chunk-7REG7GUN.mjs → chunk-YNYXWS2H.mjs} +2 -2
  13. package/dist/chunk-YNYXWS2H.mjs.map +1 -0
  14. package/dist/components/base-copilot-textarea/base-copilot-textarea.js +219 -223
  15. package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -1
  16. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +11 -11
  17. package/dist/components/copilot-textarea/copilot-textarea.js +221 -225
  18. package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
  19. package/dist/components/copilot-textarea/copilot-textarea.mjs +14 -14
  20. package/dist/components/hovering-toolbar/hovering-toolbar.js +281 -289
  21. package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -1
  22. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +6 -6
  23. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +0 -3
  24. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -1
  25. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +4 -4
  26. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.ts +0 -1
  27. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +0 -3
  28. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -1
  29. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +5 -5
  30. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +0 -3
  31. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -1
  32. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +5 -5
  33. package/dist/components/index.js +223 -227
  34. package/dist/components/index.js.map +1 -1
  35. package/dist/components/index.mjs +14 -14
  36. package/dist/index.js +223 -227
  37. package/dist/index.js.map +1 -1
  38. package/dist/index.mjs +15 -15
  39. package/dist/types/autosuggestions-config/autosuggestions-config.js +4 -4
  40. package/dist/types/autosuggestions-config/autosuggestions-config.js.map +1 -1
  41. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +2 -2
  42. package/dist/types/autosuggestions-config/index.js +4 -4
  43. package/dist/types/autosuggestions-config/index.js.map +1 -1
  44. package/dist/types/autosuggestions-config/index.mjs +2 -2
  45. package/dist/types/base/base-autosuggestions-config.d.ts +4 -0
  46. package/dist/types/base/base-autosuggestions-config.js +4 -4
  47. package/dist/types/base/base-autosuggestions-config.js.map +1 -1
  48. package/dist/types/base/base-autosuggestions-config.mjs +1 -1
  49. package/dist/types/base/index.js +4 -4
  50. package/dist/types/base/index.js.map +1 -1
  51. package/dist/types/base/index.mjs +1 -1
  52. package/dist/types/index.js +4 -4
  53. package/dist/types/index.js.map +1 -1
  54. package/dist/types/index.mjs +2 -2
  55. package/package.json +7 -6
  56. package/src/components/base-copilot-textarea/base-copilot-textarea.tsx +7 -1
  57. package/src/components/hovering-toolbar/hovering-toolbar.tsx +43 -40
  58. package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx +0 -3
  59. package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx +0 -1
  60. package/src/types/base/base-autosuggestions-config.tsx +9 -4
  61. package/dist/chunk-4CVSOOJY.mjs.map +0 -1
  62. package/dist/chunk-7REG7GUN.mjs.map +0 -1
  63. package/dist/chunk-JECODQDC.mjs.map +0 -1
  64. package/dist/chunk-PBGN5D4Y.mjs.map +0 -1
  65. package/dist/chunk-XIMW7FGX.mjs.map +0 -1
  66. /package/dist/{chunk-MGYT7RNL.mjs.map → chunk-4ECCCOFV.mjs.map} +0 -0
  67. /package/dist/{chunk-IYKS4ECD.mjs.map → chunk-7ISLGT23.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,14 +1,423 @@
1
1
  # ui
2
2
 
3
- ## 0.0.0-fix-interrupt-issues-20250409144731
3
+ ## 0.0.0-fix-agent-lock-20250618155414
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [b817a9f]
7
+ - @copilotkit/runtime-client-gql@0.0.0-fix-agent-lock-20250618155414
8
+ - @copilotkit/react-core@0.0.0-fix-agent-lock-20250618155414
9
+ - @copilotkit/shared@0.0.0-fix-agent-lock-20250618155414
10
+
11
+ ## 1.9.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [deaeca0]
16
+ - @copilotkit/shared@1.9.1
17
+ - @copilotkit/runtime-client-gql@1.9.1
18
+ - @copilotkit/react-core@1.9.1
19
+
20
+ ## 1.9.1-next.0
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [deaeca0]
25
+ - @copilotkit/shared@1.9.1-next.0
26
+ - @copilotkit/runtime-client-gql@1.9.1-next.0
27
+ - @copilotkit/react-core@1.9.1-next.0
28
+
29
+ ## 1.9.0
30
+
31
+ ### Patch Changes
32
+
33
+ - 54cae30: - fix(react-core): allow custom toolChoice in forwardedParameters to override default
34
+ - fix: move react-dom to peerDependencies in @copilotkit/react-textarea
35
+ - feat: add amazon bedrock adapter support
36
+ - Updated dependencies [54cae30]
37
+ - @copilotkit/react-core@1.9.0
38
+ - @copilotkit/runtime-client-gql@1.9.0
39
+ - @copilotkit/shared@1.9.0
40
+
41
+ ## 1.9.0-next.2
42
+
43
+ ### Patch Changes
44
+
45
+ - @copilotkit/runtime-client-gql@1.9.0-next.2
46
+ - @copilotkit/react-core@1.9.0-next.2
47
+ - @copilotkit/shared@1.9.0-next.2
48
+
49
+ ## 1.8.15-next.1
50
+
51
+ ### Patch Changes
52
+
53
+ - 54cae30: - fix(react-core): allow custom toolChoice in forwardedParameters to override default
54
+ - fix: move react-dom to peerDependencies in @copilotkit/react-textarea
55
+ - feat: add amazon bedrock adapter support
56
+ - Updated dependencies [54cae30]
57
+ - @copilotkit/react-core@1.8.15-next.1
58
+ - @copilotkit/runtime-client-gql@1.8.15-next.1
59
+ - @copilotkit/shared@1.8.15-next.1
60
+
61
+ ## 1.8.15-next.0
62
+
63
+ ### Patch Changes
64
+
65
+ - @copilotkit/runtime-client-gql@1.8.15-next.0
66
+ - @copilotkit/react-core@1.8.15-next.0
67
+ - @copilotkit/shared@1.8.15-next.0
68
+
69
+ ## 1.8.14
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [34a78d8]
74
+ - Updated dependencies [9cf1fda]
75
+ - Updated dependencies [9cf1fda]
76
+ - @copilotkit/shared@1.8.14
77
+ - @copilotkit/react-core@1.8.14
78
+ - @copilotkit/runtime-client-gql@1.8.14
79
+
80
+ ## 1.8.14-next.5
81
+
82
+ ### Patch Changes
83
+
84
+ - @copilotkit/runtime-client-gql@1.8.14-next.5
85
+ - @copilotkit/react-core@1.8.14-next.5
86
+ - @copilotkit/shared@1.8.14-next.5
87
+
88
+ ## 1.8.14-next.4
89
+
90
+ ### Patch Changes
91
+
92
+ - @copilotkit/runtime-client-gql@1.8.14-next.4
93
+ - @copilotkit/react-core@1.8.14-next.4
94
+ - @copilotkit/shared@1.8.14-next.4
95
+
96
+ ## 1.8.14-next.3
97
+
98
+ ### Patch Changes
99
+
100
+ - @copilotkit/runtime-client-gql@1.8.14-next.3
101
+ - @copilotkit/react-core@1.8.14-next.3
102
+ - @copilotkit/shared@1.8.14-next.3
103
+
104
+ ## 1.8.14-next.2
105
+
106
+ ### Patch Changes
107
+
108
+ - @copilotkit/runtime-client-gql@1.8.14-next.2
109
+ - @copilotkit/react-core@1.8.14-next.2
110
+ - @copilotkit/shared@1.8.14-next.2
111
+
112
+ ## 1.8.14-next.1
113
+
114
+ ### Patch Changes
115
+
116
+ - Updated dependencies [34a78d8]
117
+ - @copilotkit/shared@1.8.14-next.1
118
+ - @copilotkit/react-core@1.8.14-next.1
119
+ - @copilotkit/runtime-client-gql@1.8.14-next.1
120
+
121
+ ## 1.8.14-next.0
122
+
123
+ ### Patch Changes
124
+
125
+ - Updated dependencies [9cf1fda]
126
+ - Updated dependencies [9cf1fda]
127
+ - @copilotkit/react-core@1.8.14-next.0
128
+ - @copilotkit/runtime-client-gql@1.8.14-next.0
129
+ - @copilotkit/shared@1.8.14-next.0
130
+
131
+ ## 1.8.13
132
+
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies [7fcf5c4]
136
+ - @copilotkit/react-core@1.8.13
137
+ - @copilotkit/runtime-client-gql@1.8.13
138
+ - @copilotkit/shared@1.8.13
139
+
140
+ ## 1.8.13-next.3
141
+
142
+ ### Patch Changes
143
+
144
+ - @copilotkit/react-core@1.8.13-next.3
145
+ - @copilotkit/runtime-client-gql@1.8.13-next.3
146
+ - @copilotkit/shared@1.8.13-next.3
147
+
148
+ ## 1.8.13-next.2
149
+
150
+ ### Patch Changes
151
+
152
+ - @copilotkit/react-core@1.8.13-next.2
153
+ - @copilotkit/runtime-client-gql@1.8.13-next.2
154
+ - @copilotkit/shared@1.8.13-next.2
155
+
156
+ ## 1.8.13-next.1
157
+
158
+ ### Patch Changes
159
+
160
+ - Updated dependencies [7fcf5c4]
161
+ - @copilotkit/react-core@1.8.13-next.1
162
+ - @copilotkit/runtime-client-gql@1.8.13-next.1
163
+ - @copilotkit/shared@1.8.13-next.1
164
+
165
+ ## 1.8.13-next.0
166
+
167
+ ### Patch Changes
168
+
169
+ - @copilotkit/runtime-client-gql@1.8.13-next.0
170
+ - @copilotkit/react-core@1.8.13-next.0
171
+ - @copilotkit/shared@1.8.13-next.0
172
+
173
+ ## 1.8.12
174
+
175
+ ### Patch Changes
176
+
177
+ - Updated dependencies [3e09584]
178
+ - Updated dependencies [33ba021]
179
+ - @copilotkit/react-core@1.8.12
180
+ - @copilotkit/runtime-client-gql@1.8.12
181
+ - @copilotkit/shared@1.8.12
182
+
183
+ ## 1.8.12-next.6
184
+
185
+ ### Patch Changes
186
+
187
+ - Updated dependencies [3e09584]
188
+ - @copilotkit/react-core@1.8.12-next.6
189
+ - @copilotkit/runtime-client-gql@1.8.12-next.6
190
+ - @copilotkit/shared@1.8.12-next.6
191
+
192
+ ## 1.8.12-next.5
193
+
194
+ ### Patch Changes
195
+
196
+ - @copilotkit/react-core@1.8.12-next.5
197
+ - @copilotkit/runtime-client-gql@1.8.12-next.5
198
+ - @copilotkit/shared@1.8.12-next.5
199
+
200
+ ## 1.8.12-next.4
201
+
202
+ ### Patch Changes
203
+
204
+ - @copilotkit/runtime-client-gql@1.8.12-next.4
205
+ - @copilotkit/react-core@1.8.12-next.4
206
+ - @copilotkit/shared@1.8.12-next.4
207
+
208
+ ## 1.8.12-next.3
209
+
210
+ ### Patch Changes
211
+
212
+ - @copilotkit/react-core@1.8.12-next.3
213
+ - @copilotkit/runtime-client-gql@1.8.12-next.3
214
+ - @copilotkit/shared@1.8.12-next.3
215
+
216
+ ## 1.8.12-next.2
217
+
218
+ ### Patch Changes
219
+
220
+ - Updated dependencies [33ba021]
221
+ - @copilotkit/react-core@1.8.12-next.2
222
+ - @copilotkit/runtime-client-gql@1.8.12-next.2
223
+ - @copilotkit/shared@1.8.12-next.2
224
+
225
+ ## 1.8.12-next.1
226
+
227
+ ### Patch Changes
228
+
229
+ - @copilotkit/runtime-client-gql@1.8.12-next.1
230
+ - @copilotkit/react-core@1.8.12-next.1
231
+ - @copilotkit/shared@1.8.12-next.1
232
+
233
+ ## 1.8.12-next.0
234
+
235
+ ### Patch Changes
236
+
237
+ - @copilotkit/runtime-client-gql@1.8.12-next.0
238
+ - @copilotkit/react-core@1.8.12-next.0
239
+ - @copilotkit/shared@1.8.12-next.0
240
+
241
+ ## 1.8.11
242
+
243
+ ### Patch Changes
244
+
245
+ - @copilotkit/runtime-client-gql@1.8.11
246
+ - @copilotkit/react-core@1.8.11
247
+ - @copilotkit/shared@1.8.11
248
+
249
+ ## 1.8.11-next.1
250
+
251
+ ### Patch Changes
252
+
253
+ - @copilotkit/runtime-client-gql@1.8.11-next.1
254
+ - @copilotkit/react-core@1.8.11-next.1
255
+ - @copilotkit/shared@1.8.11-next.1
256
+
257
+ ## 1.8.11-next.0
258
+
259
+ ### Patch Changes
260
+
261
+ - @copilotkit/react-core@1.8.11-next.0
262
+ - @copilotkit/runtime-client-gql@1.8.11-next.0
263
+ - @copilotkit/shared@1.8.11-next.0
264
+
265
+ ## 1.8.10
266
+
267
+ ### Patch Changes
268
+
269
+ - Updated dependencies [742efbb]
270
+ - @copilotkit/react-core@1.8.10
271
+ - @copilotkit/runtime-client-gql@1.8.10
272
+ - @copilotkit/shared@1.8.10
273
+
274
+ ## 1.8.10-next.3
275
+
276
+ ### Patch Changes
277
+
278
+ - @copilotkit/react-core@1.8.10-next.3
279
+ - @copilotkit/runtime-client-gql@1.8.10-next.3
280
+ - @copilotkit/shared@1.8.10-next.3
281
+
282
+ ## 1.8.10-next.2
283
+
284
+ ### Patch Changes
285
+
286
+ - @copilotkit/runtime-client-gql@1.8.10-next.2
287
+ - @copilotkit/react-core@1.8.10-next.2
288
+ - @copilotkit/shared@1.8.10-next.2
289
+
290
+ ## 1.8.10-next.1
291
+
292
+ ### Patch Changes
293
+
294
+ - @copilotkit/react-core@1.8.10-next.1
295
+ - @copilotkit/runtime-client-gql@1.8.10-next.1
296
+ - @copilotkit/shared@1.8.10-next.1
297
+
298
+ ## 1.8.10-next.0
299
+
300
+ ### Patch Changes
301
+
302
+ - Updated dependencies [742efbb]
303
+ - @copilotkit/react-core@1.8.10-next.0
304
+ - @copilotkit/runtime-client-gql@1.8.10-next.0
305
+ - @copilotkit/shared@1.8.10-next.0
306
+
307
+ ## 1.8.9
308
+
309
+ ### Patch Changes
310
+
311
+ - @copilotkit/runtime-client-gql@1.8.9
312
+ - @copilotkit/react-core@1.8.9
313
+ - @copilotkit/shared@1.8.9
314
+
315
+ ## 1.8.9-next.0
316
+
317
+ ### Patch Changes
318
+
319
+ - @copilotkit/runtime-client-gql@1.8.9-next.0
320
+ - @copilotkit/react-core@1.8.9-next.0
321
+ - @copilotkit/shared@1.8.9-next.0
322
+
323
+ ## 1.8.8
324
+
325
+ ### Patch Changes
326
+
327
+ - Updated dependencies [dfb67c3]
328
+ - @copilotkit/react-core@1.8.8
329
+ - @copilotkit/runtime-client-gql@1.8.8
330
+ - @copilotkit/shared@1.8.8
331
+
332
+ ## 1.8.8-next.1
333
+
334
+ ### Patch Changes
335
+
336
+ - @copilotkit/runtime-client-gql@1.8.8-next.1
337
+ - @copilotkit/react-core@1.8.8-next.1
338
+ - @copilotkit/shared@1.8.8-next.1
339
+
340
+ ## 1.8.8-next.0
341
+
342
+ ### Patch Changes
343
+
344
+ - Updated dependencies [dfb67c3]
345
+ - @copilotkit/react-core@1.8.8-next.0
346
+ - @copilotkit/runtime-client-gql@1.8.8-next.0
347
+ - @copilotkit/shared@1.8.8-next.0
348
+
349
+ ## 1.8.7
350
+
351
+ ### Patch Changes
352
+
353
+ - Updated dependencies [8b8474f]
354
+ - @copilotkit/runtime-client-gql@1.8.7
355
+ - @copilotkit/react-core@1.8.7
356
+ - @copilotkit/shared@1.8.7
357
+
358
+ ## 1.8.7-next.0
359
+
360
+ ### Patch Changes
361
+
362
+ - Updated dependencies [8b8474f]
363
+ - @copilotkit/runtime-client-gql@1.8.7-next.0
364
+ - @copilotkit/react-core@1.8.7-next.0
365
+ - @copilotkit/shared@1.8.7-next.0
366
+
367
+ ## 1.8.6
368
+
369
+ ### Patch Changes
370
+
371
+ - Updated dependencies [7a04bd1]
372
+ - @copilotkit/react-core@1.8.6
373
+ - @copilotkit/runtime-client-gql@1.8.6
374
+ - @copilotkit/shared@1.8.6
375
+
376
+ ## 1.8.6-next.0
377
+
378
+ ### Patch Changes
379
+
380
+ - Updated dependencies [7a04bd1]
381
+ - @copilotkit/react-core@1.8.6-next.0
382
+ - @copilotkit/runtime-client-gql@1.8.6-next.0
383
+ - @copilotkit/shared@1.8.6-next.0
384
+
385
+ ## 1.8.5
386
+
387
+ ### Patch Changes
388
+
389
+ - Updated dependencies [c0d3261]
390
+ - Updated dependencies [77a7457]
8
391
  - Updated dependencies [d0e8a1e]
9
- - @copilotkit/react-core@0.0.0-fix-interrupt-issues-20250409144731
10
- - @copilotkit/runtime-client-gql@0.0.0-fix-interrupt-issues-20250409144731
11
- - @copilotkit/shared@0.0.0-fix-interrupt-issues-20250409144731
392
+ - @copilotkit/react-core@1.8.5
393
+ - @copilotkit/runtime-client-gql@1.8.5
394
+ - @copilotkit/shared@1.8.5
395
+
396
+ ## 1.8.5-next.5
397
+
398
+ ### Patch Changes
399
+
400
+ - Updated dependencies [c0d3261]
401
+ - @copilotkit/react-core@1.8.5-next.5
402
+ - @copilotkit/runtime-client-gql@1.8.5-next.5
403
+ - @copilotkit/shared@1.8.5-next.5
404
+
405
+ ## 1.8.5-next.4
406
+
407
+ ### Patch Changes
408
+
409
+ - @copilotkit/runtime-client-gql@1.8.5-next.4
410
+ - @copilotkit/react-core@1.8.5-next.4
411
+ - @copilotkit/shared@1.8.5-next.4
412
+
413
+ ## 1.8.5-next.3
414
+
415
+ ### Patch Changes
416
+
417
+ - Updated dependencies [77a7457]
418
+ - @copilotkit/react-core@1.8.5-next.3
419
+ - @copilotkit/runtime-client-gql@1.8.5-next.3
420
+ - @copilotkit/shared@1.8.5-next.3
12
421
 
13
422
  ## 1.8.5-next.2
14
423
 
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-QFXR6DOA.mjs";
10
10
  import {
11
11
  defaultBaseAutosuggestionsConfig
12
- } from "./chunk-4CVSOOJY.mjs";
12
+ } from "./chunk-F6RLSVG3.mjs";
13
13
  import {
14
14
  __spreadProps,
15
15
  __spreadValues
@@ -29,4 +29,4 @@ var defaultAutosuggestionsConfig = __spreadProps(__spreadValues({}, defaultBaseA
29
29
  export {
30
30
  defaultAutosuggestionsConfig
31
31
  };
32
- //# sourceMappingURL=chunk-MGYT7RNL.mjs.map
32
+ //# sourceMappingURL=chunk-4ECCCOFV.mjs.map
@@ -1,15 +1,15 @@
1
- import {
2
- useMakeStandardAutosuggestionFunction
3
- } from "./chunk-F6GMWOLE.mjs";
4
1
  import {
5
2
  useMakeStandardInsertionOrEditingFunction
6
3
  } from "./chunk-RXV67GJN.mjs";
4
+ import {
5
+ useMakeStandardAutosuggestionFunction
6
+ } from "./chunk-F6GMWOLE.mjs";
7
7
  import {
8
8
  defaultAutosuggestionsConfig
9
- } from "./chunk-MGYT7RNL.mjs";
9
+ } from "./chunk-4ECCCOFV.mjs";
10
10
  import {
11
11
  BaseCopilotTextarea
12
- } from "./chunk-PBGN5D4Y.mjs";
12
+ } from "./chunk-X7RBT3JT.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-IYKS4ECD.mjs.map
60
+ //# sourceMappingURL=chunk-7ISLGT23.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HoveringInsertionPromptBox
3
- } from "./chunk-7REG7GUN.mjs";
3
+ } from "./chunk-YNYXWS2H.mjs";
4
4
  import {
5
5
  useHoveringEditorContext
6
6
  } from "./chunk-LYB4B6MK.mjs";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-ECR45NSD.mjs";
15
15
 
16
16
  // src/components/hovering-toolbar/hovering-toolbar.tsx
17
- import { useEffect, useRef, useState } from "react";
17
+ import { useEffect, useLayoutEffect, useRef, useState } from "react";
18
18
  import { Transforms } from "slate";
19
19
  import { useSlate, useSlateSelection } from "slate-react";
20
20
  import { jsx } from "react/jsx-runtime";
@@ -27,10 +27,11 @@ var HoveringToolbar = (props) => {
27
27
  useEffect(() => {
28
28
  setIsClient(true);
29
29
  }, []);
30
- useEffect(() => {
30
+ const isShown = isClient && isDisplayed && selection;
31
+ useLayoutEffect(() => {
31
32
  const el = ref.current;
32
33
  const { selection: selection2 } = editor;
33
- if (!el) {
34
+ if (!el || !isShown) {
34
35
  return;
35
36
  }
36
37
  if (!selection2) {
@@ -46,26 +47,23 @@ var HoveringToolbar = (props) => {
46
47
  if (rect.top === 0 && rect.left === 0 && rect.width === 0 && rect.height === 0) {
47
48
  return;
48
49
  }
49
- const minGapFromEdge = 60;
50
- const verticalOffsetFromCorner = 35;
51
- const horizontalOffsetFromCorner = 15;
52
- let top = rect.top + window.scrollY - el.offsetHeight + verticalOffsetFromCorner;
53
- if (top < minGapFromEdge) {
54
- top = rect.bottom + window.scrollY + minGapFromEdge;
55
- } else if (top + el.offsetHeight > window.innerHeight - minGapFromEdge) {
56
- top = rect.top + window.scrollY - el.offsetHeight - minGapFromEdge;
50
+ const verticalOffsetFromCorner = 0;
51
+ const horizontalOffsetFromCorner = 0;
52
+ let top = rect.bottom + window.scrollY + verticalOffsetFromCorner;
53
+ if (rect.bottom + el.offsetHeight > window.innerHeight - verticalOffsetFromCorner) {
54
+ top = rect.top + window.scrollY - el.offsetHeight - verticalOffsetFromCorner;
57
55
  }
58
56
  let left = rect.left + window.scrollX - el.offsetWidth / 2 + rect.width / 2 + horizontalOffsetFromCorner;
59
- if (left < minGapFromEdge) {
60
- left = minGapFromEdge;
61
- } else if (left + el.offsetWidth > window.innerWidth - minGapFromEdge) {
62
- left = window.innerWidth - el.offsetWidth - minGapFromEdge;
57
+ if (left < horizontalOffsetFromCorner) {
58
+ left = horizontalOffsetFromCorner;
59
+ } else if (left + el.offsetWidth > window.innerWidth - horizontalOffsetFromCorner) {
60
+ left = window.innerWidth - el.offsetWidth - horizontalOffsetFromCorner;
63
61
  }
64
62
  el.style.opacity = "1";
65
63
  el.style.position = "absolute";
66
64
  el.style.top = `${top}px`;
67
65
  el.style.left = `${left}px`;
68
- });
66
+ }, [isShown]);
69
67
  useEffect(() => {
70
68
  const handleClickOutside = (event) => {
71
69
  if (ref.current && !ref.current.contains(event.target)) {
@@ -77,7 +75,7 @@ var HoveringToolbar = (props) => {
77
75
  document.removeEventListener("mousedown", handleClickOutside);
78
76
  };
79
77
  }, [ref, setIsDisplayed]);
80
- if (!isClient) {
78
+ if (!isShown) {
81
79
  return null;
82
80
  }
83
81
  return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
@@ -86,14 +84,11 @@ var HoveringToolbar = (props) => {
86
84
  ref,
87
85
  className: "copilot-kit-textarea-css-scope " + (props.hoverMenuClassname || "p-2 absolute z-10 top-[-10000px] left-[-10000px] mt-[-6px] opacity-0 transition-opacity duration-700"),
88
86
  "data-testid": "hovering-toolbar",
89
- children: isDisplayed && selection && /* @__PURE__ */ jsx(
87
+ children: /* @__PURE__ */ jsx(
90
88
  HoveringInsertionPromptBox,
91
89
  {
92
90
  editorState: editorState(editor, selection),
93
91
  apiConfig: props.apiConfig,
94
- closeWindow: () => {
95
- setIsDisplayed(false);
96
- },
97
92
  performInsertion: (insertedText) => {
98
93
  Transforms.delete(editor, { at: selection });
99
94
  Transforms.insertText(editor, insertedText, {
@@ -122,4 +117,4 @@ function editorState(editor, selection) {
122
117
  export {
123
118
  HoveringToolbar
124
119
  };
125
- //# sourceMappingURL=chunk-JECODQDC.mjs.map
120
+ //# sourceMappingURL=chunk-B7WYSFPJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/hovering-toolbar/hovering-toolbar.tsx"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { Editor, Location, Transforms } from \"slate\";\nimport { useSlate, useSlateSelection } from \"slate-react\";\nimport {\n getFullEditorTextWithNewlines,\n getTextAroundSelection,\n} from \"../../lib/get-text-around-cursor\";\nimport {\n EditingEditorState,\n InsertionEditorApiConfig,\n} from \"../../types/base/autosuggestions-bare-function\";\nimport { useHoveringEditorContext } from \"./hovering-editor-provider\";\nimport { Menu, Portal } from \"./hovering-toolbar-components\";\nimport { HoveringInsertionPromptBox } from \"./text-insertion-prompt-box\";\n\nexport interface HoveringToolbarProps {\n apiConfig: InsertionEditorApiConfig;\n contextCategories: string[];\n hoverMenuClassname: string | undefined;\n}\n\nexport const HoveringToolbar = (props: HoveringToolbarProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const editor = useSlate();\n const selection = useSlateSelection();\n const { isDisplayed, setIsDisplayed } = useHoveringEditorContext();\n\n // only render on client\n const [isClient, setIsClient] = useState(false);\n useEffect(() => {\n setIsClient(true);\n }, []);\n\n const isShown = isClient && isDisplayed && selection;\n\n useLayoutEffect(() => {\n const el = ref.current;\n const { selection } = editor;\n\n if (!el || !isShown) {\n return;\n }\n\n if (!selection) {\n el.removeAttribute(\"style\");\n return;\n }\n\n const domSelection = window.getSelection();\n if (!domSelection || domSelection.rangeCount === 0) {\n return;\n }\n\n const domRange = domSelection.getRangeAt(0);\n const rect = domRange.getBoundingClientRect();\n\n // We use window = (0,0,0,0) as a signal that the selection is not in the original copilot-textarea,\n // but inside the hovering window.\n //\n // in such case, we simply do nothing.\n if (rect.top === 0 && rect.left === 0 && rect.width === 0 && rect.height === 0) {\n return;\n }\n\n const verticalOffsetFromCorner = 0;\n const horizontalOffsetFromCorner = 0;\n\n // position the toolbar below the selection\n let top = rect.bottom + window.scrollY + verticalOffsetFromCorner;\n\n // no space left at bottom, move up\n if (rect.bottom + el.offsetHeight > window.innerHeight - verticalOffsetFromCorner) {\n top = rect.top + window.scrollY - el.offsetHeight - verticalOffsetFromCorner;\n }\n\n // position the toolbar in the center of the selection\n let left =\n rect.left + window.scrollX - el.offsetWidth / 2 + rect.width / 2 + horizontalOffsetFromCorner;\n\n // no space left at left, move right\n if (left < horizontalOffsetFromCorner) {\n left = horizontalOffsetFromCorner;\n }\n // no space left at right, move left\n else if (left + el.offsetWidth > window.innerWidth - horizontalOffsetFromCorner) {\n left = window.innerWidth - el.offsetWidth - horizontalOffsetFromCorner;\n }\n\n el.style.opacity = \"1\";\n el.style.position = \"absolute\";\n\n el.style.top = `${top}px`;\n el.style.left = `${left}px`;\n }, [isShown]);\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (ref.current && !ref.current.contains(event.target as Node)) {\n setIsDisplayed(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [ref, setIsDisplayed]);\n\n if (!isShown) {\n return null;\n }\n\n return (\n <Portal>\n <Menu\n ref={ref}\n className={\n \"copilot-kit-textarea-css-scope \" +\n (props.hoverMenuClassname ||\n \"p-2 absolute z-10 top-[-10000px] left-[-10000px] mt-[-6px] opacity-0 transition-opacity duration-700\")\n }\n data-testid=\"hovering-toolbar\"\n >\n <HoveringInsertionPromptBox\n editorState={editorState(editor, selection)}\n apiConfig={props.apiConfig}\n performInsertion={(insertedText) => {\n // replace the selection with the inserted text\n Transforms.delete(editor, { at: selection });\n Transforms.insertText(editor, insertedText, {\n at: selection,\n });\n setIsDisplayed(false);\n }}\n contextCategories={props.contextCategories}\n />\n </Menu>\n </Portal>\n );\n};\n\nfunction editorState(editor: Editor, selection: Location): EditingEditorState {\n const textAroundCursor = getTextAroundSelection(editor);\n if (textAroundCursor) {\n return textAroundCursor;\n }\n\n return {\n textBeforeCursor: getFullEditorTextWithNewlines(editor),\n textAfterCursor: \"\",\n selectedText: \"\",\n };\n}\n"],"mappings":"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","names":["selection"]}
@@ -1,10 +1,9 @@
1
1
  // src/types/base/base-autosuggestions-config.tsx
2
2
  import { defaultCopilotContextCategories } from "@copilotkit/react-core";
3
+ import { isMacOS } from "@copilotkit/shared";
3
4
  var defaultShouldToggleHoveringEditorOnKeyPress = (event, shortcut) => {
4
- if (event.key === shortcut && event.metaKey) {
5
- return true;
6
- }
7
- return false;
5
+ const isMetaKey = isMacOS() ? event.metaKey : event.ctrlKey;
6
+ return event.key === shortcut && isMetaKey;
8
7
  };
9
8
  var defaultShouldAcceptAutosuggestionOnKeyPress = (event) => {
10
9
  if (event.key === "Tab") {
@@ -19,6 +18,7 @@ var defaultBaseAutosuggestionsConfig = {
19
18
  disableWhenEmpty: true,
20
19
  disabled: false,
21
20
  temporarilyDisableWhenMovingCursorWithoutChangingText: true,
21
+ temporarilyDisableNotTrustedEvents: true,
22
22
  shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,
23
23
  shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress,
24
24
  shouldAcceptAutosuggestionOnTouch: defaultShouldAcceptAutosuggestionOnTouch
@@ -27,4 +27,4 @@ var defaultBaseAutosuggestionsConfig = {
27
27
  export {
28
28
  defaultBaseAutosuggestionsConfig
29
29
  };
30
- //# sourceMappingURL=chunk-4CVSOOJY.mjs.map
30
+ //# sourceMappingURL=chunk-F6RLSVG3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/base/base-autosuggestions-config.tsx"],"sourcesContent":["import { BaseCopilotTextareaApiConfig } from \"./autosuggestions-bare-function\";\nimport { defaultCopilotContextCategories } from \"@copilotkit/react-core\";\nimport { isMacOS } from \"@copilotkit/shared\";\n\n/**\n * @interface BaseAutosuggestionsConfig\n *\n * @property {string} textareaPurpose - The purpose of the textarea. This is used to guide the autosuggestions.\n *\n * @property {string[]} contextCategories - The categories of context to consider when providing autosuggestions.\n *\n * @property {number} debounceTime - The amount of time (in milliseconds) to wait before triggering autosuggestions after the user has stopped typing.\n *\n * @property {BaseCopilotTextareaApiConfig} apiConfig - The configuration for the API that provides the autosuggestions.\n *\n * @property {boolean} disableWhenEmpty - Whether to disable autosuggestions when the textarea is empty.\n *\n * @property {boolean} disabled - Whether to disable autosuggestions entirely.\n *\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable autosuggestions when the user moves the cursor without changing the text.\n *\n * @property {boolean} temporarilyDisableNotTrustedEvents - Temporarily disable autosuggestions after change event from non-trusted sources (like text insertion from autocomplete plugins)\n *\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the current autosuggestion based on a key press event. By default, the Tab key is used to accept the autosuggestion. Example code:\n *\n * ```typescript\n * const defaultShouldAcceptAutosuggestionOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if tab, accept the autosuggestion\n * if (event.key === \"Tab\") {\n * return true;\n * }\n * return false;\n * }\n * ```\n *\n * @property {(event: React.TouchEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnTouch - A function that determines whether to accept the current autosuggestion based on a mobile touch event. By default, the touching the end of a suggestion will accept it. Example code:\n *\n * ```typescript\n * const shouldAcceptAutosuggestionOnTouch = (event: React.TouchEvent<HTMLDivElement>) => {\n * // if tab, accept the autosuggestion\n * if (event.type === \"touchstart\") {\n * return true;\n * }\n * return false;\n * }\n * ```\n *\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event. By default, the Command + K key combination is used to toggle the hovering editor. Example code:\n *\n * ```typescript\n * const defaultShouldToggleHoveringEditorOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if command-k, toggle the hovering editor\n * if (event.key === \"k\" && event.metaKey) {\n * return true;\n * }\n * return false;\n * }\n * ```\n */\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n contextCategories: string[];\n debounceTime: number;\n apiConfig: BaseCopilotTextareaApiConfig;\n\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n temporarilyDisableNotTrustedEvents: boolean;\n shouldAcceptAutosuggestionOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n shouldAcceptAutosuggestionOnTouch: (event: React.TouchEvent<HTMLDivElement>) => boolean;\n shouldToggleHoveringEditorOnKeyPress: (\n event: React.KeyboardEvent<HTMLDivElement>,\n shortcut: string,\n ) => boolean;\n}\n\n// by default, command-k toggles the hovering editor\nconst defaultShouldToggleHoveringEditorOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n shortcut: string,\n) => {\n const isMetaKey = isMacOS() ? event.metaKey : event.ctrlKey;\n\n // if command-k, toggle the hovering editor\n return event.key === shortcut && isMetaKey;\n};\n\nconst defaultShouldAcceptAutosuggestionOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if tab, accept the autosuggestion\n if (event.key === \"Tab\") {\n return true;\n }\n return false;\n};\n\nconst defaultShouldAcceptAutosuggestionOnTouch = () => false;\n\n/**\n * Default configuration for the BaseAutosuggestions.\n *\n * @property {number} debounceTime - The amount of time to wait before triggering the autosuggestions API call.\n * @property {string[]} contextCategories - The categories to use for context when making the autosuggestions API call.\n * @property {boolean} disableWhenEmpty - Whether to disable the autosuggestions when the textarea is empty.\n * @property {boolean} disabled - Whether to disable the autosuggestions feature entirely.\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable the autosuggestions when the cursor is moved without changing the text.\n * @property {boolean} temporarilyDisableNotTrustedEvents - Temporarily disable the autosuggestions after change event from non-trusted sources (like text insertion from autocomplete plugins)\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the autosuggestion based on a key press event.\n * @property {() => boolean} defaultShouldAcceptAutosuggestionOnTouch - A function that determines whether to accept the autosuggestion based on a mobile touch event.\n */\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n contextCategories: defaultCopilotContextCategories,\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n temporarilyDisableNotTrustedEvents: true,\n shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,\n shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress,\n shouldAcceptAutosuggestionOnTouch: defaultShouldAcceptAutosuggestionOnTouch,\n};\n"],"mappings":";AACA,SAAS,uCAAuC;AAChD,SAAS,eAAe;AA4ExB,IAAM,8CAA8C,CAClD,OACA,aACG;AACH,QAAM,YAAY,QAAQ,IAAI,MAAM,UAAU,MAAM;AAGpD,SAAO,MAAM,QAAQ,YAAY;AACnC;AAEA,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO;AACvB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,IAAM,2CAA2C,MAAM;AAgBhD,IAAM,mCAGT;AAAA,EACF,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,uDAAuD;AAAA,EACvD,oCAAoC;AAAA,EACpC,sCAAsC;AAAA,EACtC,sCAAsC;AAAA,EACtC,mCAAmC;AACrC;","names":[]}