@blocknote/mantine 0.44.1 → 0.45.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 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";
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 Z, 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 q, 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) => {
@@ -356,7 +356,7 @@ const ee = (e, n, t = !1) => {
356
356
  ...w
357
357
  } = e;
358
358
  return u(w), /* @__PURE__ */ s(
359
- q,
359
+ Z,
360
360
  {
361
361
  size: "xs",
362
362
  className: B(
@@ -463,10 +463,10 @@ const ee = (e, n, t = !1) => {
463
463
  children: o
464
464
  }
465
465
  );
466
- }), qe = m((e, n) => {
466
+ }), Ze = m((e, n) => {
467
467
  const { className: t, ...o } = e;
468
468
  return u(o), /* @__PURE__ */ s(p.Divider, { className: t, ref: n });
469
- }), Ze = m((e, n) => {
469
+ }), qe = m((e, n) => {
470
470
  const { className: t, children: o, ...r } = e;
471
471
  return u(r), /* @__PURE__ */ s(p.Label, { className: t, ref: n, children: o });
472
472
  }), Je = m((e, n) => {
@@ -575,7 +575,7 @@ const ee = (e, n, t = !1) => {
575
575
  }), tt = m((e, n) => {
576
576
  const { className: t, value: o, placeholder: r, onKeyDown: i, onChange: a, ...l } = e;
577
577
  return u(l), /* @__PURE__ */ s(
578
- q,
578
+ Z,
579
579
  {
580
580
  size: "xs",
581
581
  "data-test": "embed-input",
@@ -689,11 +689,9 @@ const ee = (e, n, t = !1) => {
689
689
  return Y(() => {
690
690
  if (!c.current || !o)
691
691
  return;
692
- const d = K(
693
- c.current,
694
- document.querySelector(".bn-suggestion-menu, #ai-suggestion-menu")
695
- // TODO
696
- );
692
+ const d = K(c.current, c.current.closest(
693
+ ".bn-suggestion-menu, #ai-suggestion-menu"
694
+ ));
697
695
  d === "top" ? c.current.scrollIntoView(!0) : d === "bottom" && c.current.scrollIntoView(!1);
698
696
  }, [o]), /* @__PURE__ */ v(
699
697
  b,
@@ -735,7 +733,7 @@ const ee = (e, n, t = !1) => {
735
733
  return u(r), /* @__PURE__ */ s(b, { className: t, ref: n, children: o });
736
734
  }), ut = m((e, n) => {
737
735
  const { className: t, ...o } = e;
738
- return u(o), /* @__PURE__ */ s(Z, { className: t, type: "dots", size: 16, ref: n });
736
+ return u(o), /* @__PURE__ */ s(q, { className: t, type: "dots", size: 16, ref: n });
739
737
  }), mt = m((e, n) => {
740
738
  const { className: t, children: o, id: r, columns: i, ...a } = e;
741
739
  return u(a), /* @__PURE__ */ s(
@@ -769,7 +767,7 @@ const ee = (e, n, t = !1) => {
769
767
  return;
770
768
  const d = K(
771
769
  c.current,
772
- document.querySelector(".bn-grid-suggestion-menu")
770
+ c.current.closest(".bn-grid-suggestion-menu")
773
771
  );
774
772
  d === "top" ? c.current.scrollIntoView(!0) : d === "bottom" && c.current.scrollIntoView(!1);
775
773
  }, [o]), /* @__PURE__ */ s(
@@ -793,7 +791,7 @@ const ee = (e, n, t = !1) => {
793
791
  ...i
794
792
  } = e;
795
793
  return u(i), /* @__PURE__ */ s(
796
- Z,
794
+ q,
797
795
  {
798
796
  className: t,
799
797
  style: { gridColumn: `1 / ${r + 1}` },
@@ -1073,8 +1071,8 @@ const I = m((e, n) => {
1073
1071
  Root: He,
1074
1072
  Trigger: Ue,
1075
1073
  Dropdown: We,
1076
- Divider: qe,
1077
- Label: Ze,
1074
+ Divider: Ze,
1075
+ Label: qe,
1078
1076
  Item: Ke,
1079
1077
  Button: Je
1080
1078
  },