@blocknote/ariakit 0.16.0 → 0.17.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.
@@ -1,7 +1,7 @@
1
1
  import Ae, { forwardRef as y, useRef as Le, useEffect as $e } from "react";
2
2
  import { assertEmpty as b, mergeCSSClasses as E, isSafari as Pr } from "@blocknote/core";
3
3
  import { elementOverflow as We, mergeRefs as Ve, ComponentsContext as Cr, BlockNoteViewRaw as wr } from "@blocknote/react";
4
- import { FormProvider as ne, FormLabel as Nr, FormInput as ae, Menu as Or, MenuButton as Ye, MenuItem as Ne, MenuButtonArrow as Ir, CheckboxCheck as Oe, MenuGroupLabel as Dr, MenuSeparator as Mr, MenuProvider as Fr, TabProvider as Ar, TabList as Lr, Tab as $r, TabPanel as Wr, Button as se, PopoverDisclosure as Vr, Popover as Yr, PopoverProvider as Br, Group as Be, Toolbar as Ur, TooltipProvider as Gr, TooltipAnchor as qr, ToolbarItem as Ue, Tooltip as Kr, SelectProvider as Jr, Select as Hr, SelectArrow as zr, SelectPopover as Xr, SelectItem as Zr, SelectItemCheck as Qr } from "@ariakit/react";
4
+ import { FormProvider as ne, FormLabel as Nr, FormInput as ae, MenuProvider as Or, Menu as Ir, MenuButton as Ye, MenuItem as Ne, MenuButtonArrow as Dr, CheckboxCheck as Oe, MenuGroupLabel as Mr, MenuSeparator as Fr, TabProvider as Ar, TabList as Lr, Tab as $r, TabPanel as Wr, Button as se, PopoverDisclosure as Vr, Popover as Yr, PopoverProvider as Br, Group as Be, Toolbar as Ur, TooltipProvider as Gr, TooltipAnchor as qr, ToolbarItem as Ue, Tooltip as Kr, SelectProvider as Jr, Select as Hr, SelectArrow as zr, SelectPopover as Xr, SelectItem as Zr, SelectItemCheck as Qr } from "@ariakit/react";
5
5
  var te = { exports: {} }, W = {};
6
6
  /**
7
7
  * @license React
@@ -636,71 +636,6 @@ const tt = (n) => {
636
636
  const { children: a, ...o } = n;
637
637
  return b(o), /* @__PURE__ */ i.jsx(ne, { children: a });
638
638
  }, nt = y((n, a) => {
639
- const { className: o, children: t, id: l, columns: u, ...d } = n;
640
- return b(d), /* @__PURE__ */ i.jsx(
641
- "div",
642
- {
643
- className: o,
644
- style: { gridTemplateColumns: `repeat(${u}, 1fr)` },
645
- ref: a,
646
- id: l,
647
- role: "grid",
648
- children: t
649
- }
650
- );
651
- }), at = y((n, a) => {
652
- const { className: o, children: t, columns: l, ...u } = n;
653
- return b(u), /* @__PURE__ */ i.jsx(
654
- "div",
655
- {
656
- className: E("bn-ak-menu-item", o || ""),
657
- style: { gridColumn: `1 / ${l + 1}` },
658
- ref: a,
659
- children: /* @__PURE__ */ i.jsx("div", { className: "bn-ak-suggestion-menu-item-label", children: t })
660
- }
661
- );
662
- }), st = y((n, a) => {
663
- const { className: o, isSelected: t, onClick: l, item: u, id: d, ...g } = n;
664
- b(g);
665
- const c = Le(null);
666
- return $e(() => {
667
- if (!c.current || !t)
668
- return;
669
- const v = We(
670
- c.current,
671
- document.querySelector(".bn-grid-suggestion-menu")
672
- );
673
- v === "top" ? c.current.scrollIntoView(!0) : v === "bottom" && c.current.scrollIntoView(!1);
674
- }, [t]), /* @__PURE__ */ i.jsx(
675
- "div",
676
- {
677
- className: o,
678
- ref: Ve([a, c]),
679
- id: d,
680
- role: "option",
681
- onClick: l,
682
- "aria-selected": t || void 0,
683
- children: u.icon
684
- }
685
- );
686
- }), ot = y((n, a) => {
687
- const {
688
- className: o,
689
- children: t,
690
- // unused, using "dots" instead
691
- columns: l,
692
- ...u
693
- } = n;
694
- return b(u), /* @__PURE__ */ i.jsx(
695
- "div",
696
- {
697
- className: o,
698
- style: { gridColumn: `1 / ${l + 1}` },
699
- ref: a,
700
- children: t
701
- }
702
- );
703
- }), it = y((n, a) => {
704
639
  const {
705
640
  className: o,
706
641
  name: t,
@@ -734,7 +669,7 @@ const tt = (n) => {
734
669
  )
735
670
  ] })
736
671
  ] });
737
- }), lt = (n) => {
672
+ }), at = (n) => {
738
673
  const {
739
674
  children: a,
740
675
  onOpenChange: o,
@@ -744,7 +679,7 @@ const tt = (n) => {
744
679
  ...u
745
680
  } = n;
746
681
  return b(u), /* @__PURE__ */ i.jsx(
747
- Fr,
682
+ Or,
748
683
  {
749
684
  placement: t,
750
685
  setOpen: o,
@@ -752,7 +687,7 @@ const tt = (n) => {
752
687
  children: a
753
688
  }
754
689
  );
755
- }, ct = y((n, a) => {
690
+ }, st = y((n, a) => {
756
691
  const {
757
692
  className: o,
758
693
  children: t,
@@ -761,7 +696,7 @@ const tt = (n) => {
761
696
  ...u
762
697
  } = n;
763
698
  return b(u), /* @__PURE__ */ i.jsx(
764
- Or,
699
+ Ir,
765
700
  {
766
701
  unmountOnHide: !0,
767
702
  className: E("bn-ak-menu", o || ""),
@@ -769,7 +704,7 @@ const tt = (n) => {
769
704
  children: t
770
705
  }
771
706
  );
772
- }), ut = y((n, a) => {
707
+ }), ot = y((n, a) => {
773
708
  const { className: o, children: t, icon: l, checked: u, subTrigger: d, onClick: g, ...c } = n;
774
709
  return b(c), d ? /* @__PURE__ */ i.jsxs(
775
710
  Ye,
@@ -781,7 +716,7 @@ const tt = (n) => {
781
716
  children: [
782
717
  l,
783
718
  t,
784
- /* @__PURE__ */ i.jsx(Ir, {}),
719
+ /* @__PURE__ */ i.jsx(Dr, {}),
785
720
  u !== void 0 && /* @__PURE__ */ i.jsx(Oe, { checked: u })
786
721
  ]
787
722
  }
@@ -798,29 +733,29 @@ const tt = (n) => {
798
733
  ]
799
734
  }
800
735
  );
801
- }), ft = y((n, a) => {
736
+ }), it = y((n, a) => {
802
737
  const { className: o, children: t, ...l } = n;
803
738
  return b(l), /* @__PURE__ */ i.jsx(
804
- Dr,
739
+ Mr,
805
740
  {
806
741
  className: E("bn-ak-group-label", o || ""),
807
742
  ref: a,
808
743
  children: t
809
744
  }
810
745
  );
811
- }), dt = (n) => {
746
+ }), lt = (n) => {
812
747
  const { children: a, sub: o, ...t } = n;
813
748
  return b(t), o ? a : /* @__PURE__ */ i.jsx(Ye, { render: a });
814
- }, mt = y((n, a) => {
749
+ }, ct = y((n, a) => {
815
750
  const { className: o, ...t } = n;
816
751
  return b(t), /* @__PURE__ */ i.jsx(
817
- Mr,
752
+ Fr,
818
753
  {
819
754
  className: E("bn-ak-separator", o || ""),
820
755
  ref: a
821
756
  }
822
757
  );
823
- }), vt = y((n, a) => {
758
+ }), ut = y((n, a) => {
824
759
  const {
825
760
  className: o,
826
761
  tabs: t,
@@ -852,7 +787,7 @@ const tt = (n) => {
852
787
  )
853
788
  }
854
789
  );
855
- }), pt = y((n, a) => {
790
+ }), ft = y((n, a) => {
856
791
  const { className: o, children: t, onClick: l, label: u, ...d } = n;
857
792
  return b(d), /* @__PURE__ */ i.jsx(
858
793
  se,
@@ -864,7 +799,7 @@ const tt = (n) => {
864
799
  children: t
865
800
  }
866
801
  );
867
- }), bt = y((n, a) => {
802
+ }), dt = y((n, a) => {
868
803
  const { className: o, accept: t, value: l, placeholder: u, onChange: d, ...g } = n;
869
804
  return b(g), /* @__PURE__ */ i.jsx(ne, { children: /* @__PURE__ */ i.jsx(
870
805
  ae,
@@ -879,10 +814,10 @@ const tt = (n) => {
879
814
  placeholder: u
880
815
  }
881
816
  ) });
882
- }), gt = y((n, a) => {
817
+ }), mt = y((n, a) => {
883
818
  const { className: o, children: t, ...l } = n;
884
819
  return b(l), /* @__PURE__ */ i.jsx("div", { className: o, ref: a, children: t });
885
- }), ht = y((n, a) => {
820
+ }), vt = y((n, a) => {
886
821
  const { className: o, value: t, placeholder: l, onKeyDown: u, onChange: d, ...g } = n;
887
822
  return b(g), /* @__PURE__ */ i.jsx(ne, { children: /* @__PURE__ */ i.jsx(
888
823
  ae,
@@ -897,10 +832,10 @@ const tt = (n) => {
897
832
  ref: a
898
833
  }
899
834
  ) });
900
- }), xt = y((n, a) => {
835
+ }), pt = y((n, a) => {
901
836
  const { children: o, ...t } = n;
902
837
  return b(t), /* @__PURE__ */ i.jsx(Vr, { render: o, ref: a });
903
- }), yt = y((n, a) => {
838
+ }), bt = y((n, a) => {
904
839
  const { className: o, children: t, variant: l, ...u } = n;
905
840
  return b(u), /* @__PURE__ */ i.jsx(
906
841
  Yr,
@@ -910,13 +845,13 @@ const tt = (n) => {
910
845
  children: t
911
846
  }
912
847
  );
913
- }), jt = (n) => {
848
+ }), gt = (n) => {
914
849
  const { children: a, opened: o, position: t, ...l } = n;
915
850
  return b(l), /* @__PURE__ */ i.jsx(Br, { open: o, placement: t, children: a });
916
- }, Rt = y((n, a) => {
851
+ }, ht = y((n, a) => {
917
852
  const { className: o, children: t, ...l } = n;
918
853
  return b(l, !1), /* @__PURE__ */ i.jsx(Be, { className: o, ref: a, ...l, children: t });
919
- }), Et = y((n, a) => {
854
+ }), xt = y((n, a) => {
920
855
  const {
921
856
  className: o,
922
857
  children: t,
@@ -948,6 +883,71 @@ const tt = (n) => {
948
883
  ]
949
884
  }
950
885
  );
886
+ }), yt = y((n, a) => {
887
+ const { className: o, children: t, id: l, columns: u, ...d } = n;
888
+ return b(d), /* @__PURE__ */ i.jsx(
889
+ "div",
890
+ {
891
+ className: o,
892
+ style: { gridTemplateColumns: `repeat(${u}, 1fr)` },
893
+ ref: a,
894
+ id: l,
895
+ role: "grid",
896
+ children: t
897
+ }
898
+ );
899
+ }), jt = y((n, a) => {
900
+ const { className: o, children: t, columns: l, ...u } = n;
901
+ return b(u), /* @__PURE__ */ i.jsx(
902
+ "div",
903
+ {
904
+ className: E("bn-ak-menu-item", o || ""),
905
+ style: { gridColumn: `1 / ${l + 1}` },
906
+ ref: a,
907
+ children: /* @__PURE__ */ i.jsx("div", { className: "bn-ak-suggestion-menu-item-label", children: t })
908
+ }
909
+ );
910
+ }), Rt = y((n, a) => {
911
+ const { className: o, isSelected: t, onClick: l, item: u, id: d, ...g } = n;
912
+ b(g);
913
+ const c = Le(null);
914
+ return $e(() => {
915
+ if (!c.current || !t)
916
+ return;
917
+ const v = We(
918
+ c.current,
919
+ document.querySelector(".bn-grid-suggestion-menu")
920
+ );
921
+ v === "top" ? c.current.scrollIntoView(!0) : v === "bottom" && c.current.scrollIntoView(!1);
922
+ }, [t]), /* @__PURE__ */ i.jsx(
923
+ "div",
924
+ {
925
+ className: o,
926
+ ref: Ve([a, c]),
927
+ id: d,
928
+ role: "option",
929
+ onClick: l,
930
+ "aria-selected": t || void 0,
931
+ children: u.icon
932
+ }
933
+ );
934
+ }), Et = y((n, a) => {
935
+ const {
936
+ className: o,
937
+ children: t,
938
+ // unused, using "dots" instead
939
+ columns: l,
940
+ ...u
941
+ } = n;
942
+ return b(u), /* @__PURE__ */ i.jsx(
943
+ "div",
944
+ {
945
+ className: o,
946
+ style: { gridColumn: `1 / ${l + 1}` },
947
+ ref: a,
948
+ children: t
949
+ }
950
+ );
951
951
  }), Tt = y((n, a) => {
952
952
  const { className: o, children: t, id: l, ...u } = n;
953
953
  return b(u), /* @__PURE__ */ i.jsx(
@@ -961,6 +961,16 @@ const tt = (n) => {
961
961
  }
962
962
  );
963
963
  }), _t = y((n, a) => {
964
+ const { className: o, children: t, ...l } = n;
965
+ return b(l), /* @__PURE__ */ i.jsx(
966
+ "div",
967
+ {
968
+ className: E("bn-ak-menu-item", o || ""),
969
+ ref: a,
970
+ children: /* @__PURE__ */ i.jsx("div", { className: "bn-ak-suggestion-menu-item-label", children: t })
971
+ }
972
+ );
973
+ }), kt = y((n, a) => {
964
974
  const { className: o, item: t, isSelected: l, onClick: u, id: d, ...g } = n;
965
975
  b(g);
966
976
  const c = Le(null);
@@ -1005,16 +1015,6 @@ const tt = (n) => {
1005
1015
  ]
1006
1016
  }
1007
1017
  );
1008
- }), kt = y((n, a) => {
1009
- const { className: o, children: t, ...l } = n;
1010
- return b(l), /* @__PURE__ */ i.jsx(
1011
- "div",
1012
- {
1013
- className: E("bn-ak-menu-item", o || ""),
1014
- ref: a,
1015
- children: /* @__PURE__ */ i.jsx("div", { className: "bn-ak-suggestion-menu-item-label", children: t })
1016
- }
1017
- );
1018
1018
  }), St = y((n, a) => {
1019
1019
  const { className: o, children: t, ...l } = n;
1020
1020
  return b(l), /* @__PURE__ */ i.jsx(
@@ -1174,30 +1174,30 @@ const tt = (n) => {
1174
1174
  Select: wt
1175
1175
  },
1176
1176
  FilePanel: {
1177
- Root: vt,
1178
- Button: pt,
1179
- FileInput: bt,
1180
- TabPanel: gt,
1181
- TextInput: ht
1177
+ Root: ut,
1178
+ Button: ft,
1179
+ FileInput: dt,
1180
+ TabPanel: mt,
1181
+ TextInput: vt
1182
1182
  },
1183
1183
  GridSuggestionMenu: {
1184
- Root: nt,
1185
- Item: st,
1186
- EmptyItem: at,
1187
- Loader: ot
1184
+ Root: yt,
1185
+ Item: Rt,
1186
+ EmptyItem: jt,
1187
+ Loader: Et
1188
1188
  },
1189
1189
  LinkToolbar: {
1190
1190
  Root: Me,
1191
1191
  Button: Fe
1192
1192
  },
1193
1193
  SideMenu: {
1194
- Root: Rt,
1195
- Button: Et
1194
+ Root: ht,
1195
+ Button: xt
1196
1196
  },
1197
1197
  SuggestionMenu: {
1198
1198
  Root: Tt,
1199
- Item: _t,
1200
- EmptyItem: kt,
1199
+ Item: kt,
1200
+ EmptyItem: _t,
1201
1201
  Label: St,
1202
1202
  Loader: Pt
1203
1203
  },
@@ -1207,20 +1207,20 @@ const tt = (n) => {
1207
1207
  Generic: {
1208
1208
  Form: {
1209
1209
  Root: tt,
1210
- TextInput: it
1210
+ TextInput: nt
1211
1211
  },
1212
1212
  Menu: {
1213
- Root: lt,
1214
- Trigger: dt,
1215
- Dropdown: ct,
1216
- Divider: mt,
1217
- Label: ft,
1218
- Item: ut
1213
+ Root: at,
1214
+ Trigger: lt,
1215
+ Dropdown: st,
1216
+ Divider: ct,
1217
+ Label: it,
1218
+ Item: ot
1219
1219
  },
1220
1220
  Popover: {
1221
- Root: jt,
1222
- Trigger: xt,
1223
- Content: yt
1221
+ Root: gt,
1222
+ Trigger: pt,
1223
+ Content: bt
1224
1224
  }
1225
1225
  }
1226
1226
  }, Ft = (n) => {