@blocknote/mantine 0.42.2 → 0.43.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.
@@ -1,7 +1,7 @@
1
1
  import { jsx as s, jsxs as v } from "react/jsx-runtime";
2
2
  import { assertEmpty as u, isSafari as R, mergeCSSClasses as B, COLORS_DEFAULT as re, COLORS_DARK_MODE_DEFAULT as se } from "@blocknote/core";
3
3
  import { mergeRefs as ie, useDictionary as ae, useBlockNoteContext as H, FormattingToolbarController as le, getFormattingToolbarItems as ce, FormattingToolbar as de, elementOverflow as K, usePrefersColorScheme as ue, ComponentsContext as me, BlockNoteViewRaw as ge } from "@blocknote/react";
4
- import { Button as T, ActionIcon as E, Tooltip as U, Stack as L, Text as C, Group as h, Chip as fe, Divider as be, Card as W, Skeleton as $, Avatar as he, TextInput as q, Menu as p, CheckIcon as z, Tabs as k, LoadingOverlay as pe, FileInput as ve, PopoverDropdown as Se, PopoverTarget as ye, Popover as we, Badge as xe, Loader as Z, Flex as Ce, MantineContext as Ne, MantineProvider as Te } from "@mantine/core";
4
+ import { Button as T, ActionIcon as E, Tooltip as U, Stack as L, Text as C, Group as b, Chip as fe, Divider as he, Card as W, Skeleton as $, Avatar as be, TextInput as q, Menu as p, CheckIcon as z, Tabs as k, LoadingOverlay as pe, FileInput as ve, PopoverDropdown as Se, PopoverTarget as ye, Popover as we, Badge as xe, Loader as Z, Flex as Ce, MantineContext as Ne, MantineProvider as Te } from "@mantine/core";
5
5
  import N, { forwardRef as m, useState as J, useContext as Q, createContext as Pe, useRef as X, useEffect as Y, useCallback as ke } from "react";
6
6
  import { useHover as Fe, mergeRefs as j, useFocusWithin as Me, useFocusTrap as Oe } from "@mantine/hooks";
7
7
  const ee = (e, n, t = !1) => {
@@ -98,7 +98,7 @@ const ee = (e, n, t = !1) => {
98
98
  isDisabled: c,
99
99
  onClick: d,
100
100
  label: f,
101
- variant: b,
101
+ variant: h,
102
102
  ...S
103
103
  } = e;
104
104
  u(S, !1);
@@ -117,7 +117,7 @@ const ee = (e, n, t = !1) => {
117
117
  "aria-pressed": l,
118
118
  "data-selected": l || void 0,
119
119
  "data-test": r ? r.slice(0, 1).toLowerCase() + r.replace(/\s+/g, "").slice(1) : void 0,
120
- size: b === "compact" ? "compact-xs" : "xs",
120
+ size: h === "compact" ? "compact-xs" : "xs",
121
121
  disabled: c || !1,
122
122
  ref: n,
123
123
  ...S,
@@ -138,7 +138,7 @@ const ee = (e, n, t = !1) => {
138
138
  "aria-pressed": l,
139
139
  "data-selected": l || void 0,
140
140
  "data-test": r ? r.slice(0, 1).toLowerCase() + r.replace(/\s+/g, "").slice(1) : void 0,
141
- size: b === "compact" ? 20 : 30,
141
+ size: h === "compact" ? 20 : 30,
142
142
  disabled: c || !1,
143
143
  ref: n,
144
144
  ...S,
@@ -174,7 +174,7 @@ const ee = (e, n, t = !1) => {
174
174
  ...f
175
175
  } = e;
176
176
  u(f, !1);
177
- const [b, S] = J(!1), x = /* @__PURE__ */ v(
177
+ const [h, S] = J(!1), x = /* @__PURE__ */ v(
178
178
  fe,
179
179
  {
180
180
  className: t,
@@ -195,7 +195,7 @@ const ee = (e, n, t = !1) => {
195
195
  ]
196
196
  }
197
197
  );
198
- return !a || b ? x : /* @__PURE__ */ s(
198
+ return !a || h ? x : /* @__PURE__ */ s(
199
199
  U,
200
200
  {
201
201
  refProp: "rootRef",
@@ -212,7 +212,7 @@ const ee = (e, n, t = !1) => {
212
212
  );
213
213
  }), ze = m((e, n) => {
214
214
  const { className: t, children: o, ...r } = e;
215
- return u(r), /* @__PURE__ */ s(h, { className: t, ref: n, children: o });
215
+ return u(r), /* @__PURE__ */ s(b, { className: t, ref: n, children: o });
216
216
  }), Be = m((e, n) => {
217
217
  const {
218
218
  className: t,
@@ -244,7 +244,7 @@ const ee = (e, n, t = !1) => {
244
244
  }), Le = m((e, n) => {
245
245
  const { className: t, children: o, ...r } = e;
246
246
  return u(r, !1), /* @__PURE__ */ s(
247
- be,
247
+ he,
248
248
  {
249
249
  className: t,
250
250
  label: /* @__PURE__ */ s(C, { children: o }),
@@ -253,12 +253,12 @@ const ee = (e, n, t = !1) => {
253
253
  );
254
254
  }), je = m((e, n) => {
255
255
  const { authorInfo: t, timeString: o, edited: r, ...i } = e, a = ae();
256
- return u(i, !1), t === "loading" ? /* @__PURE__ */ v(h, { children: [
256
+ return u(i, !1), t === "loading" ? /* @__PURE__ */ v(b, { children: [
257
257
  /* @__PURE__ */ s($, { height: 24, width: 24 }),
258
258
  /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s($, { height: 12, width: 100 }) })
259
- ] }) : /* @__PURE__ */ v(h, { children: [
259
+ ] }) : /* @__PURE__ */ v(b, { children: [
260
260
  /* @__PURE__ */ s(
261
- he,
261
+ be,
262
262
  {
263
263
  src: t.avatarUrl,
264
264
  alt: t.username,
@@ -287,10 +287,10 @@ const ee = (e, n, t = !1) => {
287
287
  emojiPickerOpen: c,
288
288
  children: d,
289
289
  ...f
290
- } = e, { hovered: b, ref: S } = Fe(), x = ie([n, S]);
291
- return u(f, !1), /* @__PURE__ */ v(h, { pos: "relative", ref: x, className: t, children: [
292
- l && (o === !0 || o === void 0 || o === "hover" && b || c) ? /* @__PURE__ */ s(
293
- h,
290
+ } = e, { hovered: h, ref: S } = Fe(), x = ie([n, S]);
291
+ return u(f, !1), /* @__PURE__ */ v(b, { pos: "relative", ref: x, className: t, children: [
292
+ l && (o === !0 || o === void 0 || o === "hover" && h || c) ? /* @__PURE__ */ s(
293
+ b,
294
294
  {
295
295
  style: {
296
296
  position: "absolute",
@@ -348,7 +348,7 @@ const ee = (e, n, t = !1) => {
348
348
  autoFocus: c,
349
349
  placeholder: d,
350
350
  disabled: f,
351
- onKeyDown: b,
351
+ onKeyDown: h,
352
352
  onChange: S,
353
353
  onSubmit: x,
354
354
  autoComplete: y,
@@ -373,7 +373,7 @@ const ee = (e, n, t = !1) => {
373
373
  rightSection: P,
374
374
  placeholder: d,
375
375
  disabled: f,
376
- onKeyDown: b,
376
+ onKeyDown: h,
377
377
  onChange: S,
378
378
  onSubmit: x,
379
379
  autoComplete: y
@@ -519,7 +519,7 @@ const ee = (e, n, t = !1) => {
519
519
  loading: l,
520
520
  ...c
521
521
  } = e;
522
- return u(c), /* @__PURE__ */ s(h, { className: t, ref: n, children: /* @__PURE__ */ v(
522
+ return u(c), /* @__PURE__ */ s(b, { className: t, ref: n, children: /* @__PURE__ */ v(
523
523
  k,
524
524
  {
525
525
  value: i,
@@ -588,16 +588,17 @@ const ee = (e, n, t = !1) => {
588
588
  }
589
589
  );
590
590
  }), nt = (e) => {
591
- const { opened: n, position: t, children: o, ...r } = e;
592
- return u(r), /* @__PURE__ */ s(
591
+ const { open: n, onOpenChange: t, position: o, children: r, ...i } = e;
592
+ return u(i), /* @__PURE__ */ s(
593
593
  we,
594
594
  {
595
595
  middlewares: { size: { padding: 20 } },
596
596
  withinPortal: !1,
597
597
  opened: n,
598
- position: t,
598
+ onChange: t,
599
+ position: o,
599
600
  zIndex: 1e4,
600
- children: o
601
+ children: r
601
602
  }
602
603
  );
603
604
  }, ot = (e) => {
@@ -615,7 +616,7 @@ const ee = (e, n, t = !1) => {
615
616
  }), st = m((e, n) => {
616
617
  const { className: t, children: o, ...r } = e;
617
618
  return u(r, !1), /* @__PURE__ */ s(
618
- h,
619
+ b,
619
620
  {
620
621
  align: "center",
621
622
  gap: 0,
@@ -680,7 +681,7 @@ const ee = (e, n, t = !1) => {
680
681
  );
681
682
  }), lt = m((e, n) => {
682
683
  const { className: t, children: o, ...r } = e;
683
- return u(r), /* @__PURE__ */ s(h, { className: t, ref: n, children: /* @__PURE__ */ s(h, { className: "bn-mt-suggestion-menu-item-title", children: o }) });
684
+ return u(r), /* @__PURE__ */ s(b, { className: t, ref: n, children: /* @__PURE__ */ s(b, { className: "bn-mt-suggestion-menu-item-title", children: o }) });
684
685
  }), ct = m((e, n) => {
685
686
  const { className: t, isSelected: o, onClick: r, item: i, id: a, ...l } = e;
686
687
  u(l);
@@ -695,7 +696,7 @@ const ee = (e, n, t = !1) => {
695
696
  );
696
697
  d === "top" ? c.current.scrollIntoView(!0) : d === "bottom" && c.current.scrollIntoView(!1);
697
698
  }, [o]), /* @__PURE__ */ v(
698
- h,
699
+ b,
699
700
  {
700
701
  gap: 0,
701
702
  className: t,
@@ -707,7 +708,7 @@ const ee = (e, n, t = !1) => {
707
708
  "aria-selected": o || void 0,
708
709
  children: [
709
710
  i.icon && /* @__PURE__ */ s(
710
- h,
711
+ b,
711
712
  {
712
713
  className: "bn-mt-suggestion-menu-item-section",
713
714
  "data-position": "left",
@@ -719,7 +720,7 @@ const ee = (e, n, t = !1) => {
719
720
  /* @__PURE__ */ s(C, { className: "bn-mt-suggestion-menu-item-subtitle", children: i.subtext })
720
721
  ] }),
721
722
  i.badge && /* @__PURE__ */ s(
722
- h,
723
+ b,
723
724
  {
724
725
  "data-position": "right",
725
726
  className: "bn-mt-suggestion-menu-item-section",
@@ -731,7 +732,7 @@ const ee = (e, n, t = !1) => {
731
732
  );
732
733
  }), dt = m((e, n) => {
733
734
  const { className: t, children: o, ...r } = e;
734
- return u(r), /* @__PURE__ */ s(h, { className: t, ref: n, children: o });
735
+ return u(r), /* @__PURE__ */ s(b, { className: t, ref: n, children: o });
735
736
  }), ut = m((e, n) => {
736
737
  const { className: t, ...o } = e;
737
738
  return u(o), /* @__PURE__ */ s(Z, { className: t, type: "dots", size: 16, ref: n });
@@ -751,12 +752,12 @@ const ee = (e, n, t = !1) => {
751
752
  }), gt = m((e, n) => {
752
753
  const { className: t, children: o, columns: r, ...i } = e;
753
754
  return u(i), /* @__PURE__ */ s(
754
- h,
755
+ b,
755
756
  {
756
757
  className: t,
757
758
  style: { gridColumn: `1 / ${r + 1}` },
758
759
  ref: n,
759
- children: /* @__PURE__ */ s(h, { className: "bn-mt-suggestion-menu-item-title", children: o })
760
+ children: /* @__PURE__ */ s(b, { className: "bn-mt-suggestion-menu-item-title", children: o })
760
761
  }
761
762
  );
762
763
  }), ft = m((e, n) => {
@@ -783,7 +784,7 @@ const ee = (e, n, t = !1) => {
783
784
  children: i.icon
784
785
  }
785
786
  );
786
- }), bt = m((e, n) => {
787
+ }), ht = m((e, n) => {
787
788
  const {
788
789
  className: t,
789
790
  children: o,
@@ -800,7 +801,7 @@ const ee = (e, n, t = !1) => {
800
801
  ref: n
801
802
  }
802
803
  );
803
- }), ht = m((e, n) => {
804
+ }), bt = m((e, n) => {
804
805
  const { children: t, className: o, onMouseDown: r, onClick: i, ...a } = e;
805
806
  return u(a, !1), /* @__PURE__ */ s(
806
807
  T,
@@ -849,12 +850,12 @@ const ee = (e, n, t = !1) => {
849
850
  ...l
850
851
  } = e;
851
852
  u(l);
852
- const { ref: c, focused: d } = Me(), f = Oe(d), b = j(n, c, f);
853
+ const { ref: c, focused: d } = Me(), f = Oe(d), h = j(n, c, f);
853
854
  return /* @__PURE__ */ s(
854
855
  Ce,
855
856
  {
856
857
  className: t,
857
- ref: b,
858
+ ref: h,
858
859
  role: "toolbar",
859
860
  onMouseEnter: r,
860
861
  onMouseLeave: i,
@@ -1037,7 +1038,7 @@ const I = m((e, n) => {
1037
1038
  Root: mt,
1038
1039
  Item: ft,
1039
1040
  EmptyItem: gt,
1040
- Loader: bt
1041
+ Loader: ht
1041
1042
  },
1042
1043
  LinkToolbar: {
1043
1044
  Root: D,
@@ -1057,7 +1058,7 @@ const I = m((e, n) => {
1057
1058
  },
1058
1059
  TableHandle: {
1059
1060
  Root: pt,
1060
- ExtendButton: ht
1061
+ ExtendButton: bt
1061
1062
  },
1062
1063
  Generic: {
1063
1064
  Badge: {
@@ -1097,16 +1098,16 @@ const I = m((e, n) => {
1097
1098
  }
1098
1099
  }, Ft = (e) => {
1099
1100
  const { className: n, theme: t, ...o } = e, r = H(), i = ue(), a = (r == null ? void 0 : r.colorSchemePreference) || i, l = ke(
1100
- (b) => {
1101
- if (b && (Ie(b), typeof t == "object")) {
1101
+ (h) => {
1102
+ if (h && (Ie(h), typeof t == "object")) {
1102
1103
  if ("light" in t && "dark" in t) {
1103
1104
  A(
1104
1105
  t[a === "dark" ? "dark" : "light"],
1105
- b
1106
+ h
1106
1107
  );
1107
1108
  return;
1108
1109
  }
1109
- A(t, b);
1110
+ A(t, h);
1110
1111
  return;
1111
1112
  }
1112
1113
  },