@blocknote/ariakit 0.47.3 → 0.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote-ariakit.cjs +2 -2
- package/dist/blocknote-ariakit.cjs.map +1 -1
- package/dist/blocknote-ariakit.js +632 -914
- package/dist/blocknote-ariakit.js.map +1 -1
- package/dist/style.css +2 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +8 -8
- package/src/comments/Comment.tsx +3 -2
- package/src/popover/Popover.tsx +12 -3
- package/src/style.css +0 -4
|
@@ -1,915 +1,633 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}),
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
})
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
})
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}),
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
})
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}),
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}),
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
),
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
}), We = u((n, t) => {
|
|
630
|
-
const {
|
|
631
|
-
className: a,
|
|
632
|
-
children: e,
|
|
633
|
-
selected: s,
|
|
634
|
-
headerText: o,
|
|
635
|
-
onFocus: l,
|
|
636
|
-
onBlur: m,
|
|
637
|
-
tabIndex: c,
|
|
638
|
-
...d
|
|
639
|
-
} = n;
|
|
640
|
-
return i(d, !1), /* @__PURE__ */ h(
|
|
641
|
-
N,
|
|
642
|
-
{
|
|
643
|
-
className: b(
|
|
644
|
-
a,
|
|
645
|
-
"bn-ak-hovercard",
|
|
646
|
-
s && "selected"
|
|
647
|
-
),
|
|
648
|
-
onFocus: l,
|
|
649
|
-
onBlur: m,
|
|
650
|
-
tabIndex: c,
|
|
651
|
-
ref: t,
|
|
652
|
-
children: [
|
|
653
|
-
o && /* @__PURE__ */ r("div", { className: "bn-header-text", children: o }),
|
|
654
|
-
e
|
|
655
|
-
]
|
|
656
|
-
}
|
|
657
|
-
);
|
|
658
|
-
}), Ze = u((n, t) => {
|
|
659
|
-
const { className: a, children: e, ...s } = n;
|
|
660
|
-
return i(s, !1), /* @__PURE__ */ r(
|
|
661
|
-
N,
|
|
662
|
-
{
|
|
663
|
-
className: b(a, "bn-ak-card-section"),
|
|
664
|
-
ref: t,
|
|
665
|
-
children: e
|
|
666
|
-
}
|
|
667
|
-
);
|
|
668
|
-
}), _e = u((n, t) => {
|
|
669
|
-
const { className: a, children: e, ...s } = n;
|
|
670
|
-
return i(s, !1), /* @__PURE__ */ r(
|
|
671
|
-
v,
|
|
672
|
-
{
|
|
673
|
-
className: b(
|
|
674
|
-
a,
|
|
675
|
-
"bn-ak-button bn-ak-secondary bn-ak-expand-sections-prompt"
|
|
676
|
-
),
|
|
677
|
-
ref: t,
|
|
678
|
-
children: e
|
|
679
|
-
}
|
|
680
|
-
);
|
|
681
|
-
}), Je = u((n, t) => {
|
|
682
|
-
const { authorInfo: a, timeString: e, edited: s, ...o } = n, l = K();
|
|
683
|
-
return i(o, !1), a === "loading" ? /* @__PURE__ */ h(N, { className: "bn-ak-author-info", children: [
|
|
684
|
-
/* @__PURE__ */ r("div", { className: "bn-ak-avatar bn-ak-skeleton" }),
|
|
685
|
-
/* @__PURE__ */ r("div", { className: "bn-ak-username bn-ak-skeleton" })
|
|
686
|
-
] }) : /* @__PURE__ */ h(N, { className: "bn-ak-author-info", children: [
|
|
687
|
-
/* @__PURE__ */ r(
|
|
688
|
-
"img",
|
|
689
|
-
{
|
|
690
|
-
src: a.avatarUrl,
|
|
691
|
-
alt: a.username,
|
|
692
|
-
className: "bn-ak-avatar"
|
|
693
|
-
}
|
|
694
|
-
),
|
|
695
|
-
/* @__PURE__ */ h("div", { className: "bn-ak-username", children: [
|
|
696
|
-
a.username,
|
|
697
|
-
/* @__PURE__ */ h("span", { children: [
|
|
698
|
-
e,
|
|
699
|
-
" ",
|
|
700
|
-
s && `(${l.comments.edited})`
|
|
701
|
-
] })
|
|
702
|
-
] })
|
|
703
|
-
] });
|
|
704
|
-
}), Xe = u((n, t) => {
|
|
705
|
-
const {
|
|
706
|
-
className: a,
|
|
707
|
-
showActions: e,
|
|
708
|
-
authorInfo: s,
|
|
709
|
-
timeString: o,
|
|
710
|
-
actions: l,
|
|
711
|
-
children: m,
|
|
712
|
-
edited: c,
|
|
713
|
-
emojiPickerOpen: d,
|
|
714
|
-
// Unused
|
|
715
|
-
...g
|
|
716
|
-
} = n;
|
|
717
|
-
i(g, !1);
|
|
718
|
-
const [p, k] = ke(!1), { focused: f, ref: T } = j();
|
|
719
|
-
return /* @__PURE__ */ h(
|
|
720
|
-
N,
|
|
721
|
-
{
|
|
722
|
-
ref: t,
|
|
723
|
-
className: a,
|
|
724
|
-
onMouseEnter: () => k(!0),
|
|
725
|
-
onMouseLeave: () => k(!1),
|
|
726
|
-
children: [
|
|
727
|
-
l && (e === !0 || e === void 0 || e === "hover" && p || f) ? /* @__PURE__ */ r(
|
|
728
|
-
N,
|
|
729
|
-
{
|
|
730
|
-
ref: T,
|
|
731
|
-
style: {
|
|
732
|
-
position: "absolute",
|
|
733
|
-
right: 0,
|
|
734
|
-
top: 0,
|
|
735
|
-
zIndex: 10
|
|
736
|
-
},
|
|
737
|
-
children: l
|
|
738
|
-
}
|
|
739
|
-
) : null,
|
|
740
|
-
/* @__PURE__ */ r(Je, { ...n }),
|
|
741
|
-
m
|
|
742
|
-
]
|
|
743
|
-
}
|
|
744
|
-
);
|
|
745
|
-
}), Ye = u((n, t) => {
|
|
746
|
-
const { className: a, onFocus: e, onBlur: s, autoFocus: o, editor: l, editable: m, ...c } = n;
|
|
747
|
-
i(c, !1);
|
|
748
|
-
const d = Q();
|
|
749
|
-
return /* @__PURE__ */ r(
|
|
750
|
-
sn,
|
|
751
|
-
{
|
|
752
|
-
autoFocus: o,
|
|
753
|
-
className: a,
|
|
754
|
-
editor: n.editor,
|
|
755
|
-
sideMenu: !1,
|
|
756
|
-
slashMenu: !1,
|
|
757
|
-
tableHandles: !1,
|
|
758
|
-
filePanel: !1,
|
|
759
|
-
formattingToolbar: !1,
|
|
760
|
-
editable: m,
|
|
761
|
-
theme: d == null ? void 0 : d.colorSchemePreference,
|
|
762
|
-
ref: t,
|
|
763
|
-
onFocus: e,
|
|
764
|
-
onBlur: s,
|
|
765
|
-
children: /* @__PURE__ */ r(
|
|
766
|
-
z,
|
|
767
|
-
{
|
|
768
|
-
formattingToolbar: en
|
|
769
|
-
}
|
|
770
|
-
)
|
|
771
|
-
}
|
|
772
|
-
);
|
|
773
|
-
}), en = () => {
|
|
774
|
-
const n = U([]).filter(
|
|
775
|
-
(t) => t.key !== "nestBlockButton" && t.key !== "unnestBlockButton"
|
|
776
|
-
);
|
|
777
|
-
return /* @__PURE__ */ r(W, { blockTypeSelectItems: [], children: n });
|
|
778
|
-
}, nn = u((n, t) => {
|
|
779
|
-
const {
|
|
780
|
-
className: a,
|
|
781
|
-
text: e,
|
|
782
|
-
icon: s,
|
|
783
|
-
isSelected: o,
|
|
784
|
-
mainTooltip: l,
|
|
785
|
-
secondaryTooltip: m,
|
|
786
|
-
onClick: c,
|
|
787
|
-
onMouseEnter: d,
|
|
788
|
-
...g
|
|
789
|
-
} = n;
|
|
790
|
-
i(g, !1);
|
|
791
|
-
const p = /* @__PURE__ */ h(
|
|
792
|
-
v,
|
|
793
|
-
{
|
|
794
|
-
className: b(
|
|
795
|
-
a,
|
|
796
|
-
"bn-ak-badge bn-ak-button",
|
|
797
|
-
o && "bn-ak-primary"
|
|
798
|
-
),
|
|
799
|
-
"aria-selected": o === !0,
|
|
800
|
-
onClick: (k) => c == null ? void 0 : c(k),
|
|
801
|
-
onMouseEnter: d,
|
|
802
|
-
ref: t,
|
|
803
|
-
children: [
|
|
804
|
-
/* @__PURE__ */ r("span", { children: s }),
|
|
805
|
-
/* @__PURE__ */ r("span", { children: e })
|
|
806
|
-
]
|
|
807
|
-
}
|
|
808
|
-
);
|
|
809
|
-
return l ? /* @__PURE__ */ h(R, { children: [
|
|
810
|
-
/* @__PURE__ */ r(E, { render: p }),
|
|
811
|
-
/* @__PURE__ */ h(q, { className: "bn-ak-tooltip", portal: !1, children: [
|
|
812
|
-
/* @__PURE__ */ r("span", { children: l }),
|
|
813
|
-
m && /* @__PURE__ */ r("span", { children: m })
|
|
814
|
-
] })
|
|
815
|
-
] }) : p;
|
|
816
|
-
}), tn = u((n, t) => {
|
|
817
|
-
const { className: a, children: e, ...s } = n;
|
|
818
|
-
return i(s), /* @__PURE__ */ r(
|
|
819
|
-
N,
|
|
820
|
-
{
|
|
821
|
-
className: b(a, "bn-ak-badge-group"),
|
|
822
|
-
ref: t,
|
|
823
|
-
children: e
|
|
824
|
-
}
|
|
825
|
-
);
|
|
826
|
-
}), an = {
|
|
827
|
-
FormattingToolbar: {
|
|
828
|
-
Root: S,
|
|
829
|
-
Button: M,
|
|
830
|
-
Select: I
|
|
831
|
-
},
|
|
832
|
-
FilePanel: {
|
|
833
|
-
Root: xe,
|
|
834
|
-
Button: ye,
|
|
835
|
-
FileInput: Pe,
|
|
836
|
-
TabPanel: Be,
|
|
837
|
-
TextInput: De
|
|
838
|
-
},
|
|
839
|
-
GridSuggestionMenu: {
|
|
840
|
-
Root: Ge,
|
|
841
|
-
Item: Oe,
|
|
842
|
-
EmptyItem: Ae,
|
|
843
|
-
Loader: $e
|
|
844
|
-
},
|
|
845
|
-
LinkToolbar: {
|
|
846
|
-
Root: S,
|
|
847
|
-
Button: M,
|
|
848
|
-
Select: I
|
|
849
|
-
},
|
|
850
|
-
SideMenu: {
|
|
851
|
-
Root: Le,
|
|
852
|
-
Button: qe
|
|
853
|
-
},
|
|
854
|
-
SuggestionMenu: {
|
|
855
|
-
Root: He,
|
|
856
|
-
Item: je,
|
|
857
|
-
EmptyItem: Ve,
|
|
858
|
-
Label: Ke,
|
|
859
|
-
Loader: Qe
|
|
860
|
-
},
|
|
861
|
-
TableHandle: {
|
|
862
|
-
Root: Ue,
|
|
863
|
-
ExtendButton: ze
|
|
864
|
-
},
|
|
865
|
-
Comments: {
|
|
866
|
-
Comment: Xe,
|
|
867
|
-
Editor: Ye,
|
|
868
|
-
Card: We,
|
|
869
|
-
CardSection: Ze,
|
|
870
|
-
ExpandSectionsPrompt: _e
|
|
871
|
-
},
|
|
872
|
-
Generic: {
|
|
873
|
-
Badge: {
|
|
874
|
-
Root: nn,
|
|
875
|
-
Group: tn
|
|
876
|
-
},
|
|
877
|
-
Toolbar: {
|
|
878
|
-
Root: S,
|
|
879
|
-
Button: M,
|
|
880
|
-
Select: I
|
|
881
|
-
},
|
|
882
|
-
Form: {
|
|
883
|
-
Root: Ne,
|
|
884
|
-
TextInput: ve
|
|
885
|
-
},
|
|
886
|
-
Menu: {
|
|
887
|
-
Root: fe,
|
|
888
|
-
Trigger: Ie,
|
|
889
|
-
Dropdown: Te,
|
|
890
|
-
Divider: Ce,
|
|
891
|
-
Label: Me,
|
|
892
|
-
Item: Se,
|
|
893
|
-
Button: we
|
|
894
|
-
},
|
|
895
|
-
Popover: {
|
|
896
|
-
Root: Ee,
|
|
897
|
-
Trigger: Fe,
|
|
898
|
-
Content: Re
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
}, sn = (n) => {
|
|
902
|
-
const { className: t, ...a } = n;
|
|
903
|
-
return /* @__PURE__ */ r(Z.Provider, { value: an, children: /* @__PURE__ */ r(
|
|
904
|
-
_,
|
|
905
|
-
{
|
|
906
|
-
className: b("bn-ariakit", t || ""),
|
|
907
|
-
...a
|
|
908
|
-
}
|
|
909
|
-
) });
|
|
1
|
+
import { assertEmpty as e, isSafari as t, mergeCSSClasses as n } from "@blocknote/core";
|
|
2
|
+
import { BlockNoteViewRaw as r, ComponentsContext as i, FormattingToolbar as a, FormattingToolbarController as o, elementOverflow as s, getFormattingToolbarItems as c, mergeRefs as l, useBlockNoteContext as u, useDictionary as d, useFocusWithin as f } from "@blocknote/react";
|
|
3
|
+
import { Button as p, CheckboxCheck as m, FormInput as h, FormLabel as g, FormProvider as _, Group as v, Menu as y, MenuButton as b, MenuButtonArrow as x, MenuGroupLabel as S, MenuItem as C, MenuProvider as w, MenuSeparator as T, Popover as E, PopoverDisclosure as D, PopoverProvider as O, Select as k, SelectArrow as A, SelectItem as j, SelectItemCheck as ee, SelectPopover as te, SelectProvider as ne, Tab as re, TabList as ie, TabPanel as ae, TabProvider as oe, Toolbar as se, ToolbarItem as M, Tooltip as N, TooltipAnchor as P, TooltipProvider as F } from "@ariakit/react";
|
|
4
|
+
import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
5
|
+
import { createContext as z, forwardRef as B, useContext as V, useEffect as H, useRef as U, useState as W } from "react";
|
|
6
|
+
//#region src/input/Form.tsx
|
|
7
|
+
var G = (t) => {
|
|
8
|
+
let { children: n, ...r } = t;
|
|
9
|
+
return e(r), /* @__PURE__ */ L(_, { children: n });
|
|
10
|
+
}, K = B((t, r) => {
|
|
11
|
+
let { className: i, name: a, label: o, variant: s, icon: c, value: l, autoFocus: u, placeholder: d, disabled: f, onKeyDown: p, onChange: m, onSubmit: _, autoComplete: v, "aria-activedescendant": y, rightSection: b, ...x } = t;
|
|
12
|
+
return e(x), /* @__PURE__ */ R(I, { children: [t.label && /* @__PURE__ */ L(g, {
|
|
13
|
+
name: a,
|
|
14
|
+
children: o
|
|
15
|
+
}), /* @__PURE__ */ R("div", {
|
|
16
|
+
className: "bn-ak-input-wrapper",
|
|
17
|
+
children: [
|
|
18
|
+
c,
|
|
19
|
+
/* @__PURE__ */ L(h, {
|
|
20
|
+
className: n("bn-ak-input", i || "", s === "large" ? "bn-ak-input-large" : ""),
|
|
21
|
+
ref: r,
|
|
22
|
+
name: a,
|
|
23
|
+
value: l,
|
|
24
|
+
autoFocus: u,
|
|
25
|
+
placeholder: d,
|
|
26
|
+
disabled: f,
|
|
27
|
+
onKeyDown: p,
|
|
28
|
+
onChange: m,
|
|
29
|
+
onSubmit: _,
|
|
30
|
+
autoComplete: v,
|
|
31
|
+
"aria-activedescendant": y
|
|
32
|
+
}),
|
|
33
|
+
b
|
|
34
|
+
]
|
|
35
|
+
})] });
|
|
36
|
+
}), ce = (t) => {
|
|
37
|
+
let { children: n, onOpenChange: r, position: i, sub: a, ...o } = t;
|
|
38
|
+
return e(o), /* @__PURE__ */ L(w, {
|
|
39
|
+
placement: i,
|
|
40
|
+
setOpen: r,
|
|
41
|
+
virtualFocus: !0,
|
|
42
|
+
children: n
|
|
43
|
+
});
|
|
44
|
+
}, le = B((t, r) => {
|
|
45
|
+
let { className: i, children: a, sub: o, ...s } = t;
|
|
46
|
+
return e(s), /* @__PURE__ */ L(y, {
|
|
47
|
+
unmountOnHide: !0,
|
|
48
|
+
className: n("bn-ak-menu", i || ""),
|
|
49
|
+
ref: r,
|
|
50
|
+
children: a
|
|
51
|
+
});
|
|
52
|
+
}), ue = B((t, r) => {
|
|
53
|
+
let { className: i, children: a, icon: o, checked: s, subTrigger: c, onClick: l, ...u } = t;
|
|
54
|
+
return e(u), c ? /* @__PURE__ */ R(b, {
|
|
55
|
+
render: /* @__PURE__ */ L(C, {}),
|
|
56
|
+
className: n("bn-ak-menu-item", i || ""),
|
|
57
|
+
ref: r,
|
|
58
|
+
onClick: l,
|
|
59
|
+
children: [
|
|
60
|
+
o,
|
|
61
|
+
a,
|
|
62
|
+
/* @__PURE__ */ L(x, {}),
|
|
63
|
+
s !== void 0 && /* @__PURE__ */ L(m, { checked: s })
|
|
64
|
+
]
|
|
65
|
+
}) : /* @__PURE__ */ R(C, {
|
|
66
|
+
className: n("bn-ak-menu-item", i || ""),
|
|
67
|
+
ref: r,
|
|
68
|
+
onClick: l,
|
|
69
|
+
children: [
|
|
70
|
+
o,
|
|
71
|
+
a,
|
|
72
|
+
s !== void 0 && /* @__PURE__ */ L(m, { checked: s })
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
}), de = B((t, r) => {
|
|
76
|
+
let { className: i, children: a, ...o } = t;
|
|
77
|
+
return e(o), /* @__PURE__ */ L(S, {
|
|
78
|
+
className: n("bn-ak-group-label", i || ""),
|
|
79
|
+
ref: r,
|
|
80
|
+
children: a
|
|
81
|
+
});
|
|
82
|
+
}), fe = (t) => {
|
|
83
|
+
let { children: n, sub: r, ...i } = t;
|
|
84
|
+
return e(i), r ? n : /* @__PURE__ */ L(b, { render: n });
|
|
85
|
+
}, pe = B((t, r) => {
|
|
86
|
+
let { className: i, ...a } = t;
|
|
87
|
+
return e(a), /* @__PURE__ */ L(T, {
|
|
88
|
+
className: n("bn-ak-separator", i || ""),
|
|
89
|
+
ref: r
|
|
90
|
+
});
|
|
91
|
+
}), me = B((t, r) => {
|
|
92
|
+
let { className: i, children: a, icon: o, onClick: s, label: c, onDragEnd: l, onDragStart: u, draggable: d, ...f } = t;
|
|
93
|
+
return e(f, !1), /* @__PURE__ */ R(p, {
|
|
94
|
+
onDragEnd: l,
|
|
95
|
+
onDragStart: u,
|
|
96
|
+
draggable: d,
|
|
97
|
+
"aria-label": c,
|
|
98
|
+
className: n("bn-ak-button bn-ak-secondary", i || ""),
|
|
99
|
+
ref: r,
|
|
100
|
+
onClick: s,
|
|
101
|
+
...f,
|
|
102
|
+
children: [o, a]
|
|
103
|
+
});
|
|
104
|
+
}), he = B((t, r) => {
|
|
105
|
+
let { className: i, tabs: a, defaultOpenTab: o, openTab: s, setOpenTab: c, loading: l, ...u } = t;
|
|
106
|
+
return e(u), /* @__PURE__ */ L("div", {
|
|
107
|
+
className: n("bn-ak-wrapper", i || ""),
|
|
108
|
+
ref: r,
|
|
109
|
+
children: /* @__PURE__ */ R(oe, {
|
|
110
|
+
defaultSelectedId: o,
|
|
111
|
+
selectedId: s,
|
|
112
|
+
setActiveId: (e) => {
|
|
113
|
+
e && c(e);
|
|
114
|
+
},
|
|
115
|
+
children: [/* @__PURE__ */ L(ie, {
|
|
116
|
+
className: "bn-ak-tab-list",
|
|
117
|
+
children: a.map((e) => /* @__PURE__ */ L(re, {
|
|
118
|
+
className: "bn-ak-tab",
|
|
119
|
+
id: e.name,
|
|
120
|
+
children: e.name
|
|
121
|
+
}, e.name))
|
|
122
|
+
}), /* @__PURE__ */ L("div", {
|
|
123
|
+
className: "bn-ak-panels",
|
|
124
|
+
children: a.map((e) => /* @__PURE__ */ L(ae, {
|
|
125
|
+
tabId: e.name,
|
|
126
|
+
children: e.tabPanel
|
|
127
|
+
}, e.name))
|
|
128
|
+
})]
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
}), ge = B((t, r) => {
|
|
132
|
+
let { className: i, children: a, onClick: o, label: s, ...c } = t;
|
|
133
|
+
return e(c), /* @__PURE__ */ L(p, {
|
|
134
|
+
className: n("bn-ak-button", i || ""),
|
|
135
|
+
onClick: o,
|
|
136
|
+
"aria-label": s,
|
|
137
|
+
ref: r,
|
|
138
|
+
children: a
|
|
139
|
+
});
|
|
140
|
+
}), _e = B((t, n) => {
|
|
141
|
+
let { className: r, accept: i, value: a, placeholder: o, onChange: s, ...c } = t;
|
|
142
|
+
return e(c), /* @__PURE__ */ L(_, { children: /* @__PURE__ */ L(h, {
|
|
143
|
+
className: r,
|
|
144
|
+
ref: n,
|
|
145
|
+
name: "panel-input",
|
|
146
|
+
type: "file",
|
|
147
|
+
accept: i,
|
|
148
|
+
value: a ? a.name : void 0,
|
|
149
|
+
onChange: async (e) => s?.(e.target.files[0]),
|
|
150
|
+
placeholder: o
|
|
151
|
+
}) });
|
|
152
|
+
}), ve = B((t, n) => {
|
|
153
|
+
let { className: r, children: i, ...a } = t;
|
|
154
|
+
return e(a), /* @__PURE__ */ L("div", {
|
|
155
|
+
className: r,
|
|
156
|
+
ref: n,
|
|
157
|
+
children: i
|
|
158
|
+
});
|
|
159
|
+
}), ye = B((t, r) => {
|
|
160
|
+
let { className: i, value: a, placeholder: o, onKeyDown: s, onChange: c, ...l } = t;
|
|
161
|
+
return e(l), /* @__PURE__ */ L(_, { children: /* @__PURE__ */ L(h, {
|
|
162
|
+
className: n("bn-ak-input", i || ""),
|
|
163
|
+
name: "panel-input",
|
|
164
|
+
value: a,
|
|
165
|
+
placeholder: o,
|
|
166
|
+
onChange: c,
|
|
167
|
+
onKeyDown: s,
|
|
168
|
+
"data-test": "embed-input",
|
|
169
|
+
ref: r
|
|
170
|
+
}) });
|
|
171
|
+
}), q = z(void 0), be = B((t, n) => {
|
|
172
|
+
let { children: r, ...i } = t;
|
|
173
|
+
return e(i), /* @__PURE__ */ L(D, {
|
|
174
|
+
render: r,
|
|
175
|
+
ref: n
|
|
176
|
+
});
|
|
177
|
+
}), xe = B((t, r) => {
|
|
178
|
+
let { className: i, children: a, variant: o, ...s } = t;
|
|
179
|
+
e(s);
|
|
180
|
+
let c = V(q);
|
|
181
|
+
return /* @__PURE__ */ L(E, {
|
|
182
|
+
className: n("bn-ak-popover", i || "", o === "panel-popover" ? "bn-ak-panel-popover" : ""),
|
|
183
|
+
portalElement: c ?? void 0,
|
|
184
|
+
ref: r,
|
|
185
|
+
children: a
|
|
186
|
+
});
|
|
187
|
+
}), Se = (t) => {
|
|
188
|
+
let { children: n, open: r, onOpenChange: i, position: a, portalRoot: o, ...s } = t;
|
|
189
|
+
return e(s), /* @__PURE__ */ L(O, {
|
|
190
|
+
open: r,
|
|
191
|
+
setOpen: i,
|
|
192
|
+
placement: a,
|
|
193
|
+
children: /* @__PURE__ */ L(q.Provider, {
|
|
194
|
+
value: o,
|
|
195
|
+
children: n
|
|
196
|
+
})
|
|
197
|
+
});
|
|
198
|
+
}, Ce = B((t, n) => {
|
|
199
|
+
let { className: r, children: i, ...a } = t;
|
|
200
|
+
return e(a, !1), /* @__PURE__ */ L(v, {
|
|
201
|
+
className: r,
|
|
202
|
+
ref: n,
|
|
203
|
+
...a,
|
|
204
|
+
children: i
|
|
205
|
+
});
|
|
206
|
+
}), we = B((t, r) => {
|
|
207
|
+
let { className: i, children: a, icon: o, onClick: s, label: c, onDragEnd: l, onDragStart: u, draggable: d, ...f } = t;
|
|
208
|
+
return e(f, !1), /* @__PURE__ */ R(p, {
|
|
209
|
+
onDragEnd: l,
|
|
210
|
+
onDragStart: u,
|
|
211
|
+
draggable: d,
|
|
212
|
+
"aria-label": c,
|
|
213
|
+
className: n("bn-ak-button bn-ak-secondary", i || ""),
|
|
214
|
+
ref: r,
|
|
215
|
+
onClick: s,
|
|
216
|
+
...f,
|
|
217
|
+
children: [o, a]
|
|
218
|
+
});
|
|
219
|
+
}), Te = B((t, n) => {
|
|
220
|
+
let { className: r, children: i, id: a, columns: o, ...s } = t;
|
|
221
|
+
return e(s), /* @__PURE__ */ L("div", {
|
|
222
|
+
className: r,
|
|
223
|
+
style: { gridTemplateColumns: `repeat(${o}, 1fr)` },
|
|
224
|
+
ref: n,
|
|
225
|
+
id: a,
|
|
226
|
+
role: "grid",
|
|
227
|
+
children: i
|
|
228
|
+
});
|
|
229
|
+
}), Ee = B((t, r) => {
|
|
230
|
+
let { className: i, children: a, columns: o, ...s } = t;
|
|
231
|
+
return e(s), /* @__PURE__ */ L("div", {
|
|
232
|
+
className: n("bn-ak-menu-item", i || ""),
|
|
233
|
+
style: { gridColumn: `1 / ${o + 1}` },
|
|
234
|
+
ref: r,
|
|
235
|
+
children: /* @__PURE__ */ L("div", {
|
|
236
|
+
className: "bn-ak-suggestion-menu-item-label",
|
|
237
|
+
children: a
|
|
238
|
+
})
|
|
239
|
+
});
|
|
240
|
+
}), De = B((t, n) => {
|
|
241
|
+
let { className: r, isSelected: i, onClick: a, item: o, id: c, ...u } = t;
|
|
242
|
+
e(u);
|
|
243
|
+
let d = U(null);
|
|
244
|
+
return H(() => {
|
|
245
|
+
!d.current || !i || s(d.current, d.current.closest(".bn-grid-suggestion-menu")) !== "none" && d.current.scrollIntoView({ block: "nearest" });
|
|
246
|
+
}, [i]), /* @__PURE__ */ L("div", {
|
|
247
|
+
className: r,
|
|
248
|
+
ref: l([n, d]),
|
|
249
|
+
id: c,
|
|
250
|
+
role: "option",
|
|
251
|
+
onClick: a,
|
|
252
|
+
"aria-selected": i || void 0,
|
|
253
|
+
children: o.icon
|
|
254
|
+
});
|
|
255
|
+
}), Oe = B((t, n) => {
|
|
256
|
+
let { className: r, children: i, columns: a, ...o } = t;
|
|
257
|
+
return e(o), /* @__PURE__ */ L("div", {
|
|
258
|
+
className: r,
|
|
259
|
+
style: { gridColumn: `1 / ${a + 1}` },
|
|
260
|
+
ref: n,
|
|
261
|
+
children: i
|
|
262
|
+
});
|
|
263
|
+
}), ke = B((t, r) => {
|
|
264
|
+
let { className: i, children: a, id: o, ...s } = t;
|
|
265
|
+
return e(s), /* @__PURE__ */ L(v, {
|
|
266
|
+
className: n("bn-ak-menu", i || ""),
|
|
267
|
+
id: o,
|
|
268
|
+
role: "listbox",
|
|
269
|
+
ref: r,
|
|
270
|
+
children: a
|
|
271
|
+
});
|
|
272
|
+
}), Ae = B((t, r) => {
|
|
273
|
+
let { className: i, children: a, ...o } = t;
|
|
274
|
+
return e(o), /* @__PURE__ */ L("div", {
|
|
275
|
+
className: n("bn-ak-menu-item", i || ""),
|
|
276
|
+
ref: r,
|
|
277
|
+
children: /* @__PURE__ */ L("div", {
|
|
278
|
+
className: "bn-ak-suggestion-menu-item-label",
|
|
279
|
+
children: a
|
|
280
|
+
})
|
|
281
|
+
});
|
|
282
|
+
}), je = B((t, r) => {
|
|
283
|
+
let { className: i, item: a, isSelected: o, onClick: c, id: u, ...d } = t;
|
|
284
|
+
e(d);
|
|
285
|
+
let f = U(null);
|
|
286
|
+
return H(() => {
|
|
287
|
+
!f.current || !o || s(f.current, f.current.closest(".bn-suggestion-menu, #ai-suggestion-menu")) !== "none" && f.current.scrollIntoView({ block: "nearest" });
|
|
288
|
+
}, [o]), /* @__PURE__ */ R("div", {
|
|
289
|
+
className: n("bn-ak-menu-item", i || ""),
|
|
290
|
+
ref: l([r, f]),
|
|
291
|
+
id: u,
|
|
292
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
293
|
+
onClick: c,
|
|
294
|
+
role: "option",
|
|
295
|
+
"aria-selected": o || void 0,
|
|
296
|
+
children: [
|
|
297
|
+
a.icon && /* @__PURE__ */ L("div", {
|
|
298
|
+
className: "bn-ak-suggestion-menu-item-section",
|
|
299
|
+
"data-position": "left",
|
|
300
|
+
children: a.icon
|
|
301
|
+
}),
|
|
302
|
+
/* @__PURE__ */ R("div", {
|
|
303
|
+
className: "bn-ak-suggestion-menu-item-body",
|
|
304
|
+
children: [/* @__PURE__ */ L("div", {
|
|
305
|
+
className: "bn-ak-suggestion-menu-item-title",
|
|
306
|
+
children: a.title
|
|
307
|
+
}), /* @__PURE__ */ L("div", {
|
|
308
|
+
className: "bn-ak-suggestion-menu-item-subtitle",
|
|
309
|
+
children: a.subtext
|
|
310
|
+
})]
|
|
311
|
+
}),
|
|
312
|
+
a.badge && /* @__PURE__ */ L("div", {
|
|
313
|
+
"data-position": "right",
|
|
314
|
+
className: "bn-ak-suggestion-menu-item-section",
|
|
315
|
+
children: /* @__PURE__ */ L("div", { children: a.badge })
|
|
316
|
+
})
|
|
317
|
+
]
|
|
318
|
+
});
|
|
319
|
+
}), Me = B((t, r) => {
|
|
320
|
+
let { className: i, children: a, ...o } = t;
|
|
321
|
+
return e(o), /* @__PURE__ */ L("div", {
|
|
322
|
+
className: n("bn-ak-group-label", i || ""),
|
|
323
|
+
ref: r,
|
|
324
|
+
children: a
|
|
325
|
+
});
|
|
326
|
+
}), Ne = B((t, n) => {
|
|
327
|
+
let { className: r, ...i } = t;
|
|
328
|
+
return e(i), /* @__PURE__ */ L("div", {
|
|
329
|
+
className: r,
|
|
330
|
+
ref: n,
|
|
331
|
+
children: /* @__PURE__ */ L("svg", {
|
|
332
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
333
|
+
height: "1em",
|
|
334
|
+
viewBox: "0 -960 960 960",
|
|
335
|
+
width: "1em",
|
|
336
|
+
fill: "#e8eaed",
|
|
337
|
+
children: /* @__PURE__ */ L("path", { d: "M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z" })
|
|
338
|
+
})
|
|
339
|
+
});
|
|
340
|
+
}), Pe = B((t, r) => {
|
|
341
|
+
let { children: i, className: a, onMouseDown: o, onClick: s, ...c } = t;
|
|
342
|
+
return e(c, !1), /* @__PURE__ */ L(p, {
|
|
343
|
+
className: n("bn-ak-button bn-ak-secondary", a || ""),
|
|
344
|
+
ref: r,
|
|
345
|
+
onMouseDown: o,
|
|
346
|
+
onClick: s,
|
|
347
|
+
...c,
|
|
348
|
+
children: i
|
|
349
|
+
});
|
|
350
|
+
}), Fe = B((t, r) => {
|
|
351
|
+
let { className: i, children: a, draggable: o, onDragStart: s, onDragEnd: c, style: l, label: u, ...d } = t;
|
|
352
|
+
return e(d, !1), /* @__PURE__ */ L(p, {
|
|
353
|
+
className: n("bn-ak-button bn-ak-secondary", i || ""),
|
|
354
|
+
ref: r,
|
|
355
|
+
"aria-label": u,
|
|
356
|
+
draggable: o,
|
|
357
|
+
onDragStart: s,
|
|
358
|
+
onDragEnd: c,
|
|
359
|
+
style: l,
|
|
360
|
+
...d,
|
|
361
|
+
children: a
|
|
362
|
+
});
|
|
363
|
+
}), J = B((t, r) => {
|
|
364
|
+
let { className: i, children: a, onMouseEnter: o, onMouseLeave: s, variant: c, ...l } = t;
|
|
365
|
+
return e(l), /* @__PURE__ */ L(se, {
|
|
366
|
+
className: n("bn-ak-toolbar", i || ""),
|
|
367
|
+
ref: r,
|
|
368
|
+
onMouseEnter: o,
|
|
369
|
+
onMouseLeave: s,
|
|
370
|
+
children: a
|
|
371
|
+
});
|
|
372
|
+
}), Y = B((r, i) => {
|
|
373
|
+
let { className: a, children: o, mainTooltip: s, secondaryTooltip: c, icon: l, isSelected: u, isDisabled: d, onClick: f, label: p, variant: m, ...h } = r;
|
|
374
|
+
return e(h, !1), /* @__PURE__ */ R(F, { children: [/* @__PURE__ */ L(P, { render: /* @__PURE__ */ R(M, {
|
|
375
|
+
"aria-label": p,
|
|
376
|
+
className: n("bn-ak-button bn-ak-secondary", a || ""),
|
|
377
|
+
onMouseDown: (e) => {
|
|
378
|
+
t() && e.currentTarget.focus();
|
|
379
|
+
},
|
|
380
|
+
onClick: f,
|
|
381
|
+
"aria-pressed": u,
|
|
382
|
+
"data-selected": u ? "true" : void 0,
|
|
383
|
+
disabled: d || !1,
|
|
384
|
+
ref: i,
|
|
385
|
+
...h,
|
|
386
|
+
children: [l, o]
|
|
387
|
+
}) }), /* @__PURE__ */ R(N, {
|
|
388
|
+
className: "bn-ak-tooltip",
|
|
389
|
+
portal: !1,
|
|
390
|
+
children: [/* @__PURE__ */ L("span", { children: s }), c && /* @__PURE__ */ L("span", { children: c })]
|
|
391
|
+
})] });
|
|
392
|
+
}), X = B((t, r) => {
|
|
393
|
+
let { className: i, items: a, isDisabled: o, ...s } = t;
|
|
394
|
+
e(s);
|
|
395
|
+
let c = t.items.filter((e) => e.isSelected)[0];
|
|
396
|
+
return /* @__PURE__ */ R(ne, {
|
|
397
|
+
value: c.text,
|
|
398
|
+
setValue: (e) => {
|
|
399
|
+
a.find((t) => t.text === e).onClick?.();
|
|
400
|
+
},
|
|
401
|
+
children: [/* @__PURE__ */ R(k, {
|
|
402
|
+
className: "bn-ak-button bn-ak-secondary",
|
|
403
|
+
disabled: o,
|
|
404
|
+
"aria-label": "Text alignment",
|
|
405
|
+
render: /* @__PURE__ */ L(M, {}),
|
|
406
|
+
children: [
|
|
407
|
+
c.icon,
|
|
408
|
+
" ",
|
|
409
|
+
c.text,
|
|
410
|
+
" ",
|
|
411
|
+
/* @__PURE__ */ L(A, {})
|
|
412
|
+
]
|
|
413
|
+
}), /* @__PURE__ */ L(te, {
|
|
414
|
+
className: n("bn-ak-popover", i || ""),
|
|
415
|
+
ref: r,
|
|
416
|
+
gutter: 4,
|
|
417
|
+
children: a.map((e) => /* @__PURE__ */ R(j, {
|
|
418
|
+
className: "bn-ak-select-item",
|
|
419
|
+
value: e.text,
|
|
420
|
+
children: [
|
|
421
|
+
e.icon,
|
|
422
|
+
e.text,
|
|
423
|
+
e.text === c.text && /* @__PURE__ */ L(ee, {})
|
|
424
|
+
]
|
|
425
|
+
}, e.text))
|
|
426
|
+
})]
|
|
427
|
+
});
|
|
428
|
+
}), Ie = B((t, r) => {
|
|
429
|
+
let { className: i, children: a, selected: o, headerText: s, onFocus: c, onBlur: l, tabIndex: u, ...d } = t;
|
|
430
|
+
return e(d, !1), /* @__PURE__ */ R(v, {
|
|
431
|
+
className: n(i, "bn-ak-hovercard", o && "selected"),
|
|
432
|
+
onFocus: c,
|
|
433
|
+
onBlur: l,
|
|
434
|
+
tabIndex: u,
|
|
435
|
+
ref: r,
|
|
436
|
+
children: [s && /* @__PURE__ */ L("div", {
|
|
437
|
+
className: "bn-header-text",
|
|
438
|
+
children: s
|
|
439
|
+
}), a]
|
|
440
|
+
});
|
|
441
|
+
}), Le = B((t, r) => {
|
|
442
|
+
let { className: i, children: a, ...o } = t;
|
|
443
|
+
return e(o, !1), /* @__PURE__ */ L(v, {
|
|
444
|
+
className: n(i, "bn-ak-card-section"),
|
|
445
|
+
ref: r,
|
|
446
|
+
children: a
|
|
447
|
+
});
|
|
448
|
+
}), Re = B((t, r) => {
|
|
449
|
+
let { className: i, children: a, ...o } = t;
|
|
450
|
+
return e(o, !1), /* @__PURE__ */ L(p, {
|
|
451
|
+
className: n(i, "bn-ak-button bn-ak-secondary bn-ak-expand-sections-prompt"),
|
|
452
|
+
ref: r,
|
|
453
|
+
children: a
|
|
454
|
+
});
|
|
455
|
+
}), ze = B((t, n) => {
|
|
456
|
+
let { authorInfo: r, timeString: i, edited: a, ...o } = t, s = d();
|
|
457
|
+
return e(o, !1), r === "loading" ? /* @__PURE__ */ R(v, {
|
|
458
|
+
className: "bn-ak-author-info",
|
|
459
|
+
children: [/* @__PURE__ */ L("div", { className: "bn-ak-avatar bn-ak-skeleton" }), /* @__PURE__ */ L("div", { className: "bn-ak-username bn-ak-skeleton" })]
|
|
460
|
+
}) : /* @__PURE__ */ R(v, {
|
|
461
|
+
className: "bn-ak-author-info",
|
|
462
|
+
children: [/* @__PURE__ */ L("img", {
|
|
463
|
+
src: r.avatarUrl,
|
|
464
|
+
alt: r.username,
|
|
465
|
+
className: "bn-ak-avatar"
|
|
466
|
+
}), /* @__PURE__ */ R("div", {
|
|
467
|
+
className: "bn-ak-username",
|
|
468
|
+
children: [r.username, /* @__PURE__ */ R("span", { children: [
|
|
469
|
+
i,
|
|
470
|
+
" ",
|
|
471
|
+
a && `(${s.comments.edited})`
|
|
472
|
+
] })]
|
|
473
|
+
})]
|
|
474
|
+
});
|
|
475
|
+
}), Z = B((t, n) => {
|
|
476
|
+
let { className: r, showActions: i, authorInfo: a, timeString: o, actions: s, children: c, edited: l, emojiPickerOpen: u, ...d } = t;
|
|
477
|
+
e(d, !1);
|
|
478
|
+
let [p, m] = W(!1), { focused: h, ref: g } = f();
|
|
479
|
+
return /* @__PURE__ */ R(v, {
|
|
480
|
+
ref: n,
|
|
481
|
+
className: r,
|
|
482
|
+
onMouseEnter: () => m(!0),
|
|
483
|
+
onMouseLeave: () => m(!1),
|
|
484
|
+
children: [
|
|
485
|
+
s && (i === !0 || i === void 0 || i === "hover" && p || h || u) ? /* @__PURE__ */ L(v, {
|
|
486
|
+
ref: g,
|
|
487
|
+
style: {
|
|
488
|
+
position: "absolute",
|
|
489
|
+
right: 0,
|
|
490
|
+
top: 0,
|
|
491
|
+
zIndex: 10
|
|
492
|
+
},
|
|
493
|
+
children: s
|
|
494
|
+
}) : null,
|
|
495
|
+
/* @__PURE__ */ L(ze, { ...t }),
|
|
496
|
+
c
|
|
497
|
+
]
|
|
498
|
+
});
|
|
499
|
+
}), Be = B((t, n) => {
|
|
500
|
+
let { className: r, onFocus: i, onBlur: a, autoFocus: s, editor: c, editable: l, ...d } = t;
|
|
501
|
+
e(d, !1);
|
|
502
|
+
let f = u();
|
|
503
|
+
return /* @__PURE__ */ L($, {
|
|
504
|
+
autoFocus: s,
|
|
505
|
+
className: r,
|
|
506
|
+
editor: t.editor,
|
|
507
|
+
sideMenu: !1,
|
|
508
|
+
slashMenu: !1,
|
|
509
|
+
tableHandles: !1,
|
|
510
|
+
filePanel: !1,
|
|
511
|
+
formattingToolbar: !1,
|
|
512
|
+
editable: l,
|
|
513
|
+
theme: f?.colorSchemePreference,
|
|
514
|
+
ref: n,
|
|
515
|
+
onFocus: i,
|
|
516
|
+
onBlur: a,
|
|
517
|
+
children: /* @__PURE__ */ L(o, { formattingToolbar: Ve })
|
|
518
|
+
});
|
|
519
|
+
}), Ve = () => /* @__PURE__ */ L(a, {
|
|
520
|
+
blockTypeSelectItems: [],
|
|
521
|
+
children: c([]).filter((e) => e.key !== "nestBlockButton" && e.key !== "unnestBlockButton")
|
|
522
|
+
}), He = B((t, r) => {
|
|
523
|
+
let { className: i, text: a, icon: o, isSelected: s, mainTooltip: c, secondaryTooltip: l, onClick: u, onMouseEnter: d, ...f } = t;
|
|
524
|
+
e(f, !1);
|
|
525
|
+
let m = /* @__PURE__ */ R(p, {
|
|
526
|
+
className: n(i, "bn-ak-badge bn-ak-button", s && "bn-ak-primary"),
|
|
527
|
+
"aria-selected": s === !0,
|
|
528
|
+
onClick: (e) => u?.(e),
|
|
529
|
+
onMouseEnter: d,
|
|
530
|
+
ref: r,
|
|
531
|
+
children: [/* @__PURE__ */ L("span", { children: o }), /* @__PURE__ */ L("span", { children: a })]
|
|
532
|
+
});
|
|
533
|
+
return c ? /* @__PURE__ */ R(F, { children: [/* @__PURE__ */ L(P, { render: m }), /* @__PURE__ */ R(N, {
|
|
534
|
+
className: "bn-ak-tooltip",
|
|
535
|
+
portal: !1,
|
|
536
|
+
children: [/* @__PURE__ */ L("span", { children: c }), l && /* @__PURE__ */ L("span", { children: l })]
|
|
537
|
+
})] }) : m;
|
|
538
|
+
}), Ue = B((t, r) => {
|
|
539
|
+
let { className: i, children: a, ...o } = t;
|
|
540
|
+
return e(o), /* @__PURE__ */ L(v, {
|
|
541
|
+
className: n(i, "bn-ak-badge-group"),
|
|
542
|
+
ref: r,
|
|
543
|
+
children: a
|
|
544
|
+
});
|
|
545
|
+
}), Q = {
|
|
546
|
+
FormattingToolbar: {
|
|
547
|
+
Root: J,
|
|
548
|
+
Button: Y,
|
|
549
|
+
Select: X
|
|
550
|
+
},
|
|
551
|
+
FilePanel: {
|
|
552
|
+
Root: he,
|
|
553
|
+
Button: ge,
|
|
554
|
+
FileInput: _e,
|
|
555
|
+
TabPanel: ve,
|
|
556
|
+
TextInput: ye
|
|
557
|
+
},
|
|
558
|
+
GridSuggestionMenu: {
|
|
559
|
+
Root: Te,
|
|
560
|
+
Item: De,
|
|
561
|
+
EmptyItem: Ee,
|
|
562
|
+
Loader: Oe
|
|
563
|
+
},
|
|
564
|
+
LinkToolbar: {
|
|
565
|
+
Root: J,
|
|
566
|
+
Button: Y,
|
|
567
|
+
Select: X
|
|
568
|
+
},
|
|
569
|
+
SideMenu: {
|
|
570
|
+
Root: Ce,
|
|
571
|
+
Button: we
|
|
572
|
+
},
|
|
573
|
+
SuggestionMenu: {
|
|
574
|
+
Root: ke,
|
|
575
|
+
Item: je,
|
|
576
|
+
EmptyItem: Ae,
|
|
577
|
+
Label: Me,
|
|
578
|
+
Loader: Ne
|
|
579
|
+
},
|
|
580
|
+
TableHandle: {
|
|
581
|
+
Root: Fe,
|
|
582
|
+
ExtendButton: Pe
|
|
583
|
+
},
|
|
584
|
+
Comments: {
|
|
585
|
+
Comment: Z,
|
|
586
|
+
Editor: Be,
|
|
587
|
+
Card: Ie,
|
|
588
|
+
CardSection: Le,
|
|
589
|
+
ExpandSectionsPrompt: Re
|
|
590
|
+
},
|
|
591
|
+
Generic: {
|
|
592
|
+
Badge: {
|
|
593
|
+
Root: He,
|
|
594
|
+
Group: Ue
|
|
595
|
+
},
|
|
596
|
+
Toolbar: {
|
|
597
|
+
Root: J,
|
|
598
|
+
Button: Y,
|
|
599
|
+
Select: X
|
|
600
|
+
},
|
|
601
|
+
Form: {
|
|
602
|
+
Root: G,
|
|
603
|
+
TextInput: K
|
|
604
|
+
},
|
|
605
|
+
Menu: {
|
|
606
|
+
Root: ce,
|
|
607
|
+
Trigger: fe,
|
|
608
|
+
Dropdown: le,
|
|
609
|
+
Divider: pe,
|
|
610
|
+
Label: de,
|
|
611
|
+
Item: ue,
|
|
612
|
+
Button: me
|
|
613
|
+
},
|
|
614
|
+
Popover: {
|
|
615
|
+
Root: Se,
|
|
616
|
+
Trigger: be,
|
|
617
|
+
Content: xe
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}, $ = (e) => {
|
|
621
|
+
let { className: t, ...a } = e;
|
|
622
|
+
return /* @__PURE__ */ L(i.Provider, {
|
|
623
|
+
value: Q,
|
|
624
|
+
children: /* @__PURE__ */ L(r, {
|
|
625
|
+
className: n("bn-ariakit", t || ""),
|
|
626
|
+
...a
|
|
627
|
+
})
|
|
628
|
+
});
|
|
910
629
|
};
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
//# sourceMappingURL=blocknote-ariakit.js.map
|
|
630
|
+
//#endregion
|
|
631
|
+
export { $ as BlockNoteView, Q as components };
|
|
632
|
+
|
|
633
|
+
//# sourceMappingURL=blocknote-ariakit.js.map
|