@blocknote/ariakit 0.41.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote-ariakit.cjs +1 -1
- package/dist/blocknote-ariakit.cjs.map +1 -1
- package/dist/blocknote-ariakit.js +80 -78
- package/dist/blocknote-ariakit.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +13 -13
- package/src/comments/Comment.tsx +1 -0
- package/src/style.css +4 -0
- package/types/src/comments/Comment.d.ts +1 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as r, jsxs as h, Fragment as
|
|
2
|
-
import { assertEmpty as u, mergeCSSClasses as b, isSafari as
|
|
3
|
-
import { elementOverflow as B, mergeRefs as
|
|
4
|
-
import { FormProvider as
|
|
5
|
-
import { forwardRef as d, useRef as
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { assertEmpty as u, mergeCSSClasses as b, isSafari as V } from "@blocknote/core";
|
|
3
|
+
import { elementOverflow as B, mergeRefs as D, useFocusWithin as H, useDictionary as j, useBlockNoteContext as K, FormattingToolbarController as Q, getFormattingToolbarItems as z, FormattingToolbar as U, ComponentsContext as W, BlockNoteViewRaw as Z } from "@blocknote/react";
|
|
4
|
+
import { FormProvider as w, FormLabel as _, FormInput as y, MenuButton as F, MenuButtonArrow as J, CheckboxCheck as x, MenuItem as P, MenuGroupLabel as X, MenuSeparator as Y, Menu as ee, MenuProvider as ne, Button as f, TabProvider as te, TabList as ae, Tab as se, TabPanel as re, Popover as oe, PopoverDisclosure as le, PopoverProvider as ce, Group as k, Toolbar as ie, TooltipProvider as R, TooltipAnchor as E, ToolbarItem as L, Tooltip as q, SelectProvider as ue, Select as de, SelectArrow as me, SelectPopover as be, SelectItem as he, SelectItemCheck as ge } from "@ariakit/react";
|
|
5
|
+
import { forwardRef as d, useRef as G, useEffect as $, useState as pe } from "react";
|
|
6
6
|
const Ne = (n) => {
|
|
7
7
|
const { children: t, ...a } = n;
|
|
8
|
-
return u(a), /* @__PURE__ */ r(
|
|
8
|
+
return u(a), /* @__PURE__ */ r(w, { children: t });
|
|
9
9
|
}, ke = d((n, t) => {
|
|
10
10
|
const {
|
|
11
11
|
className: a,
|
|
@@ -18,18 +18,18 @@ const Ne = (n) => {
|
|
|
18
18
|
placeholder: i,
|
|
19
19
|
disabled: g,
|
|
20
20
|
onKeyDown: p,
|
|
21
|
-
onChange:
|
|
21
|
+
onChange: N,
|
|
22
22
|
onSubmit: v,
|
|
23
|
-
autoComplete:
|
|
24
|
-
rightSection:
|
|
23
|
+
autoComplete: T,
|
|
24
|
+
rightSection: C,
|
|
25
25
|
...A
|
|
26
26
|
} = n;
|
|
27
|
-
return u(A), /* @__PURE__ */ h(
|
|
27
|
+
return u(A), /* @__PURE__ */ h(O, { children: [
|
|
28
28
|
n.label && /* @__PURE__ */ r(_, { name: e, children: s }),
|
|
29
29
|
/* @__PURE__ */ h("div", { className: "bn-ak-input-wrapper", children: [
|
|
30
30
|
l,
|
|
31
31
|
/* @__PURE__ */ r(
|
|
32
|
-
|
|
32
|
+
y,
|
|
33
33
|
{
|
|
34
34
|
className: b(
|
|
35
35
|
"bn-ak-input",
|
|
@@ -43,12 +43,12 @@ const Ne = (n) => {
|
|
|
43
43
|
placeholder: i,
|
|
44
44
|
disabled: g,
|
|
45
45
|
onKeyDown: p,
|
|
46
|
-
onChange:
|
|
46
|
+
onChange: N,
|
|
47
47
|
onSubmit: v,
|
|
48
|
-
autoComplete:
|
|
48
|
+
autoComplete: T
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
|
-
|
|
51
|
+
C
|
|
52
52
|
] })
|
|
53
53
|
] });
|
|
54
54
|
}), fe = (n) => {
|
|
@@ -89,9 +89,9 @@ const Ne = (n) => {
|
|
|
89
89
|
}), Te = d((n, t) => {
|
|
90
90
|
const { className: a, children: e, icon: s, checked: o, subTrigger: l, onClick: m, ...c } = n;
|
|
91
91
|
return u(c), l ? /* @__PURE__ */ h(
|
|
92
|
-
|
|
92
|
+
F,
|
|
93
93
|
{
|
|
94
|
-
render: /* @__PURE__ */ r(
|
|
94
|
+
render: /* @__PURE__ */ r(P, {}),
|
|
95
95
|
className: b("bn-ak-menu-item", a || ""),
|
|
96
96
|
ref: t,
|
|
97
97
|
onClick: m,
|
|
@@ -99,11 +99,11 @@ const Ne = (n) => {
|
|
|
99
99
|
s,
|
|
100
100
|
e,
|
|
101
101
|
/* @__PURE__ */ r(J, {}),
|
|
102
|
-
o !== void 0 && /* @__PURE__ */ r(
|
|
102
|
+
o !== void 0 && /* @__PURE__ */ r(x, { checked: o })
|
|
103
103
|
]
|
|
104
104
|
}
|
|
105
105
|
) : /* @__PURE__ */ h(
|
|
106
|
-
|
|
106
|
+
P,
|
|
107
107
|
{
|
|
108
108
|
className: b("bn-ak-menu-item", a || ""),
|
|
109
109
|
ref: t,
|
|
@@ -111,7 +111,7 @@ const Ne = (n) => {
|
|
|
111
111
|
children: [
|
|
112
112
|
s,
|
|
113
113
|
e,
|
|
114
|
-
o !== void 0 && /* @__PURE__ */ r(
|
|
114
|
+
o !== void 0 && /* @__PURE__ */ r(x, { checked: o })
|
|
115
115
|
]
|
|
116
116
|
}
|
|
117
117
|
);
|
|
@@ -127,7 +127,7 @@ const Ne = (n) => {
|
|
|
127
127
|
);
|
|
128
128
|
}), Me = (n) => {
|
|
129
129
|
const { children: t, sub: a, ...e } = n;
|
|
130
|
-
return u(e), a ? t : /* @__PURE__ */ r(
|
|
130
|
+
return u(e), a ? t : /* @__PURE__ */ r(F, { render: t });
|
|
131
131
|
}, Ie = d((n, t) => {
|
|
132
132
|
const { className: a, ...e } = n;
|
|
133
133
|
return u(e), /* @__PURE__ */ r(
|
|
@@ -215,8 +215,8 @@ const Ne = (n) => {
|
|
|
215
215
|
);
|
|
216
216
|
}), xe = d((n, t) => {
|
|
217
217
|
const { className: a, accept: e, value: s, placeholder: o, onChange: l, ...m } = n;
|
|
218
|
-
return u(m), /* @__PURE__ */ r(
|
|
219
|
-
|
|
218
|
+
return u(m), /* @__PURE__ */ r(w, { children: /* @__PURE__ */ r(
|
|
219
|
+
y,
|
|
220
220
|
{
|
|
221
221
|
className: a,
|
|
222
222
|
ref: t,
|
|
@@ -228,13 +228,13 @@ const Ne = (n) => {
|
|
|
228
228
|
placeholder: o
|
|
229
229
|
}
|
|
230
230
|
) });
|
|
231
|
-
}),
|
|
231
|
+
}), Pe = d((n, t) => {
|
|
232
232
|
const { className: a, children: e, ...s } = n;
|
|
233
233
|
return u(s), /* @__PURE__ */ r("div", { className: a, ref: t, children: e });
|
|
234
|
-
}),
|
|
234
|
+
}), Be = d((n, t) => {
|
|
235
235
|
const { className: a, value: e, placeholder: s, onKeyDown: o, onChange: l, ...m } = n;
|
|
236
|
-
return u(m), /* @__PURE__ */ r(
|
|
237
|
-
|
|
236
|
+
return u(m), /* @__PURE__ */ r(w, { children: /* @__PURE__ */ r(
|
|
237
|
+
y,
|
|
238
238
|
{
|
|
239
239
|
className: b("bn-ak-input", a || ""),
|
|
240
240
|
name: "panel-input",
|
|
@@ -268,7 +268,7 @@ const Ne = (n) => {
|
|
|
268
268
|
return u(s), /* @__PURE__ */ r(ce, { open: a, placement: e, children: t });
|
|
269
269
|
}, Ee = d((n, t) => {
|
|
270
270
|
const { className: a, children: e, ...s } = n;
|
|
271
|
-
return u(s, !1), /* @__PURE__ */ r(
|
|
271
|
+
return u(s, !1), /* @__PURE__ */ r(k, { className: a, ref: t, ...s, children: e });
|
|
272
272
|
}), Le = d((n, t) => {
|
|
273
273
|
const {
|
|
274
274
|
className: a,
|
|
@@ -328,8 +328,8 @@ const Ne = (n) => {
|
|
|
328
328
|
}), $e = d((n, t) => {
|
|
329
329
|
const { className: a, isSelected: e, onClick: s, item: o, id: l, ...m } = n;
|
|
330
330
|
u(m);
|
|
331
|
-
const c =
|
|
332
|
-
return
|
|
331
|
+
const c = G(null);
|
|
332
|
+
return $(() => {
|
|
333
333
|
if (!c.current || !e)
|
|
334
334
|
return;
|
|
335
335
|
const i = B(
|
|
@@ -341,7 +341,7 @@ const Ne = (n) => {
|
|
|
341
341
|
"div",
|
|
342
342
|
{
|
|
343
343
|
className: a,
|
|
344
|
-
ref:
|
|
344
|
+
ref: D([t, c]),
|
|
345
345
|
id: l,
|
|
346
346
|
role: "option",
|
|
347
347
|
onClick: s,
|
|
@@ -366,10 +366,10 @@ const Ne = (n) => {
|
|
|
366
366
|
children: e
|
|
367
367
|
}
|
|
368
368
|
);
|
|
369
|
-
}),
|
|
369
|
+
}), Oe = d((n, t) => {
|
|
370
370
|
const { className: a, children: e, id: s, ...o } = n;
|
|
371
371
|
return u(o), /* @__PURE__ */ r(
|
|
372
|
-
|
|
372
|
+
k,
|
|
373
373
|
{
|
|
374
374
|
className: b("bn-ak-menu", a || ""),
|
|
375
375
|
id: s,
|
|
@@ -378,7 +378,7 @@ const Ne = (n) => {
|
|
|
378
378
|
children: e
|
|
379
379
|
}
|
|
380
380
|
);
|
|
381
|
-
}),
|
|
381
|
+
}), Ve = d((n, t) => {
|
|
382
382
|
const { className: a, children: e, ...s } = n;
|
|
383
383
|
return u(s), /* @__PURE__ */ r(
|
|
384
384
|
"div",
|
|
@@ -391,8 +391,8 @@ const Ne = (n) => {
|
|
|
391
391
|
}), He = d((n, t) => {
|
|
392
392
|
const { className: a, item: e, isSelected: s, onClick: o, id: l, ...m } = n;
|
|
393
393
|
u(m);
|
|
394
|
-
const c =
|
|
395
|
-
return
|
|
394
|
+
const c = G(null);
|
|
395
|
+
return $(() => {
|
|
396
396
|
if (!c.current || !s)
|
|
397
397
|
return;
|
|
398
398
|
const i = B(
|
|
@@ -405,7 +405,7 @@ const Ne = (n) => {
|
|
|
405
405
|
"div",
|
|
406
406
|
{
|
|
407
407
|
className: b("bn-ak-menu-item", a || ""),
|
|
408
|
-
ref:
|
|
408
|
+
ref: D([t, c]),
|
|
409
409
|
id: l,
|
|
410
410
|
onMouseDown: (i) => i.preventDefault(),
|
|
411
411
|
onClick: o,
|
|
@@ -502,7 +502,7 @@ const Ne = (n) => {
|
|
|
502
502
|
children: e
|
|
503
503
|
}
|
|
504
504
|
);
|
|
505
|
-
}),
|
|
505
|
+
}), S = d(
|
|
506
506
|
(n, t) => {
|
|
507
507
|
const {
|
|
508
508
|
className: a,
|
|
@@ -523,7 +523,7 @@ const Ne = (n) => {
|
|
|
523
523
|
}
|
|
524
524
|
);
|
|
525
525
|
}
|
|
526
|
-
),
|
|
526
|
+
), M = d(
|
|
527
527
|
(n, t) => {
|
|
528
528
|
const {
|
|
529
529
|
className: a,
|
|
@@ -536,14 +536,14 @@ const Ne = (n) => {
|
|
|
536
536
|
onClick: i,
|
|
537
537
|
label: g,
|
|
538
538
|
variant: p,
|
|
539
|
-
...
|
|
539
|
+
...N
|
|
540
540
|
} = n;
|
|
541
|
-
return u(
|
|
541
|
+
return u(N, !1), /* @__PURE__ */ h(R, { children: [
|
|
542
542
|
/* @__PURE__ */ r(
|
|
543
|
-
|
|
543
|
+
E,
|
|
544
544
|
{
|
|
545
545
|
render: /* @__PURE__ */ h(
|
|
546
|
-
|
|
546
|
+
L,
|
|
547
547
|
{
|
|
548
548
|
"aria-label": g,
|
|
549
549
|
className: b(
|
|
@@ -551,14 +551,14 @@ const Ne = (n) => {
|
|
|
551
551
|
a || ""
|
|
552
552
|
),
|
|
553
553
|
onMouseDown: (v) => {
|
|
554
|
-
|
|
554
|
+
V() && v.currentTarget.focus();
|
|
555
555
|
},
|
|
556
556
|
onClick: i,
|
|
557
557
|
"aria-pressed": m,
|
|
558
558
|
"data-selected": m ? "true" : void 0,
|
|
559
559
|
disabled: c || !1,
|
|
560
560
|
ref: t,
|
|
561
|
-
...
|
|
561
|
+
...N,
|
|
562
562
|
children: [
|
|
563
563
|
l,
|
|
564
564
|
e
|
|
@@ -567,13 +567,13 @@ const Ne = (n) => {
|
|
|
567
567
|
)
|
|
568
568
|
}
|
|
569
569
|
),
|
|
570
|
-
/* @__PURE__ */ h(
|
|
570
|
+
/* @__PURE__ */ h(q, { className: "bn-ak-tooltip", portal: !1, children: [
|
|
571
571
|
/* @__PURE__ */ r("span", { children: s }),
|
|
572
572
|
o && /* @__PURE__ */ r("span", { children: o })
|
|
573
573
|
] })
|
|
574
574
|
] });
|
|
575
575
|
}
|
|
576
|
-
),
|
|
576
|
+
), I = d((n, t) => {
|
|
577
577
|
const { className: a, items: e, isDisabled: s, ...o } = n;
|
|
578
578
|
u(o);
|
|
579
579
|
const l = n.items.filter((c) => c.isSelected)[0], m = (c) => {
|
|
@@ -587,7 +587,7 @@ const Ne = (n) => {
|
|
|
587
587
|
className: "bn-ak-button bn-ak-secondary",
|
|
588
588
|
disabled: s,
|
|
589
589
|
"aria-label": "Text alignment",
|
|
590
|
-
render: /* @__PURE__ */ r(
|
|
590
|
+
render: /* @__PURE__ */ r(L, {}),
|
|
591
591
|
children: [
|
|
592
592
|
l.icon,
|
|
593
593
|
" ",
|
|
@@ -631,7 +631,7 @@ const Ne = (n) => {
|
|
|
631
631
|
...i
|
|
632
632
|
} = n;
|
|
633
633
|
return u(i, !1), /* @__PURE__ */ h(
|
|
634
|
-
|
|
634
|
+
k,
|
|
635
635
|
{
|
|
636
636
|
className: b(
|
|
637
637
|
a,
|
|
@@ -651,7 +651,7 @@ const Ne = (n) => {
|
|
|
651
651
|
}), We = d((n, t) => {
|
|
652
652
|
const { className: a, children: e, ...s } = n;
|
|
653
653
|
return u(s, !1), /* @__PURE__ */ r(
|
|
654
|
-
|
|
654
|
+
k,
|
|
655
655
|
{
|
|
656
656
|
className: b(a, "bn-ak-card-section"),
|
|
657
657
|
ref: t,
|
|
@@ -673,10 +673,10 @@ const Ne = (n) => {
|
|
|
673
673
|
);
|
|
674
674
|
}), _e = d((n, t) => {
|
|
675
675
|
const { authorInfo: a, timeString: e, edited: s, ...o } = n, l = j();
|
|
676
|
-
return u(o, !1), a === "loading" ? /* @__PURE__ */ h(
|
|
676
|
+
return u(o, !1), a === "loading" ? /* @__PURE__ */ h(k, { className: "bn-ak-author-info", children: [
|
|
677
677
|
/* @__PURE__ */ r("div", { className: "bn-ak-avatar bn-ak-skeleton" }),
|
|
678
678
|
/* @__PURE__ */ r("div", { className: "bn-ak-username bn-ak-skeleton" })
|
|
679
|
-
] }) : /* @__PURE__ */ h(
|
|
679
|
+
] }) : /* @__PURE__ */ h(k, { className: "bn-ak-author-info", children: [
|
|
680
680
|
/* @__PURE__ */ r(
|
|
681
681
|
"img",
|
|
682
682
|
{
|
|
@@ -703,22 +703,24 @@ const Ne = (n) => {
|
|
|
703
703
|
actions: l,
|
|
704
704
|
children: m,
|
|
705
705
|
edited: c,
|
|
706
|
-
|
|
706
|
+
emojiPickerOpen: i,
|
|
707
|
+
// Unused
|
|
708
|
+
...g
|
|
707
709
|
} = n;
|
|
708
|
-
u(
|
|
709
|
-
const [
|
|
710
|
+
u(g, !1);
|
|
711
|
+
const [p, N] = pe(!1), { focused: v, ref: T } = H();
|
|
710
712
|
return /* @__PURE__ */ h(
|
|
711
|
-
|
|
713
|
+
k,
|
|
712
714
|
{
|
|
713
715
|
ref: t,
|
|
714
716
|
className: a,
|
|
715
|
-
onMouseEnter: () =>
|
|
716
|
-
onMouseLeave: () =>
|
|
717
|
+
onMouseEnter: () => N(!0),
|
|
718
|
+
onMouseLeave: () => N(!1),
|
|
717
719
|
children: [
|
|
718
|
-
l && (e === !0 || e === void 0 || e === "hover" &&
|
|
719
|
-
|
|
720
|
+
l && (e === !0 || e === void 0 || e === "hover" && p || v) ? /* @__PURE__ */ r(
|
|
721
|
+
k,
|
|
720
722
|
{
|
|
721
|
-
ref:
|
|
723
|
+
ref: T,
|
|
722
724
|
style: {
|
|
723
725
|
position: "absolute",
|
|
724
726
|
right: 0,
|
|
@@ -788,7 +790,7 @@ const Ne = (n) => {
|
|
|
788
790
|
o && "bn-ak-primary"
|
|
789
791
|
),
|
|
790
792
|
"aria-selected": o === !0,
|
|
791
|
-
onClick: (
|
|
793
|
+
onClick: (N) => c == null ? void 0 : c(N),
|
|
792
794
|
onMouseEnter: i,
|
|
793
795
|
ref: t,
|
|
794
796
|
children: [
|
|
@@ -797,9 +799,9 @@ const Ne = (n) => {
|
|
|
797
799
|
]
|
|
798
800
|
}
|
|
799
801
|
);
|
|
800
|
-
return l ? /* @__PURE__ */ h(
|
|
801
|
-
/* @__PURE__ */ r(
|
|
802
|
-
/* @__PURE__ */ h(
|
|
802
|
+
return l ? /* @__PURE__ */ h(R, { children: [
|
|
803
|
+
/* @__PURE__ */ r(E, { render: p }),
|
|
804
|
+
/* @__PURE__ */ h(q, { className: "bn-ak-tooltip", portal: !1, children: [
|
|
803
805
|
/* @__PURE__ */ r("span", { children: l }),
|
|
804
806
|
m && /* @__PURE__ */ r("span", { children: m })
|
|
805
807
|
] })
|
|
@@ -807,7 +809,7 @@ const Ne = (n) => {
|
|
|
807
809
|
}), nn = d((n, t) => {
|
|
808
810
|
const { className: a, children: e, ...s } = n;
|
|
809
811
|
return u(s), /* @__PURE__ */ r(
|
|
810
|
-
|
|
812
|
+
k,
|
|
811
813
|
{
|
|
812
814
|
className: b(a, "bn-ak-badge-group"),
|
|
813
815
|
ref: t,
|
|
@@ -816,16 +818,16 @@ const Ne = (n) => {
|
|
|
816
818
|
);
|
|
817
819
|
}), tn = {
|
|
818
820
|
FormattingToolbar: {
|
|
819
|
-
Root:
|
|
820
|
-
Button:
|
|
821
|
-
Select:
|
|
821
|
+
Root: S,
|
|
822
|
+
Button: M,
|
|
823
|
+
Select: I
|
|
822
824
|
},
|
|
823
825
|
FilePanel: {
|
|
824
826
|
Root: ye,
|
|
825
827
|
Button: Ce,
|
|
826
828
|
FileInput: xe,
|
|
827
|
-
TabPanel:
|
|
828
|
-
TextInput:
|
|
829
|
+
TabPanel: Pe,
|
|
830
|
+
TextInput: Be
|
|
829
831
|
},
|
|
830
832
|
GridSuggestionMenu: {
|
|
831
833
|
Root: qe,
|
|
@@ -834,18 +836,18 @@ const Ne = (n) => {
|
|
|
834
836
|
Loader: Ae
|
|
835
837
|
},
|
|
836
838
|
LinkToolbar: {
|
|
837
|
-
Root:
|
|
838
|
-
Button:
|
|
839
|
-
Select:
|
|
839
|
+
Root: S,
|
|
840
|
+
Button: M,
|
|
841
|
+
Select: I
|
|
840
842
|
},
|
|
841
843
|
SideMenu: {
|
|
842
844
|
Root: Ee,
|
|
843
845
|
Button: Le
|
|
844
846
|
},
|
|
845
847
|
SuggestionMenu: {
|
|
846
|
-
Root:
|
|
848
|
+
Root: Oe,
|
|
847
849
|
Item: He,
|
|
848
|
-
EmptyItem:
|
|
850
|
+
EmptyItem: Ve,
|
|
849
851
|
Label: je,
|
|
850
852
|
Loader: Ke
|
|
851
853
|
},
|
|
@@ -866,9 +868,9 @@ const Ne = (n) => {
|
|
|
866
868
|
Group: nn
|
|
867
869
|
},
|
|
868
870
|
Toolbar: {
|
|
869
|
-
Root:
|
|
870
|
-
Button:
|
|
871
|
-
Select:
|
|
871
|
+
Root: S,
|
|
872
|
+
Button: M,
|
|
873
|
+
Select: I
|
|
872
874
|
},
|
|
873
875
|
Form: {
|
|
874
876
|
Root: Ne,
|