@blocknote/shadcn 0.15.3 → 0.15.4

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.
@@ -5,16 +5,16 @@ import { elementOverflow as Ge, mergeRefs as Ke, ComponentsContext as ut, BlockN
5
5
  import { cva as Q } from "class-variance-authority";
6
6
  import { clsx as ft } from "clsx";
7
7
  import { extendTailwindMerge as mt } from "tailwind-merge";
8
- import { Slot as Je } from "@radix-ui/react-slot";
8
+ import { Slot as qe } from "@radix-ui/react-slot";
9
9
  import * as T from "@radix-ui/react-dropdown-menu";
10
- import { ChevronRight as qe, Check as He, Circle as pt, ChevronDown as Xe, ChevronUp as gt } from "lucide-react";
10
+ import { ChevronRight as Je, Check as He, Circle as pt, ChevronDown as Xe, ChevronUp as gt } from "lucide-react";
11
11
  import { FormProvider as vt, useFormContext as xt, useForm as ht } from "react-hook-form";
12
12
  import * as Ze from "@radix-ui/react-label";
13
13
  import * as ee from "@radix-ui/react-popover";
14
14
  import * as D from "@radix-ui/react-select";
15
15
  import * as V from "@radix-ui/react-tabs";
16
16
  import * as Qe from "@radix-ui/react-toggle";
17
- import * as J from "@radix-ui/react-tooltip";
17
+ import * as q from "@radix-ui/react-tooltip";
18
18
  var ue = { exports: {} }, G = {};
19
19
  /**
20
20
  * @license React
@@ -204,7 +204,7 @@ function wt() {
204
204
  }
205
205
  }
206
206
  var te = $.ReactCurrentDispatcher, re;
207
- function q(e, i, l) {
207
+ function J(e, i, l) {
208
208
  {
209
209
  if (re === void 0)
210
210
  try {
@@ -290,7 +290,7 @@ function wt() {
290
290
  } finally {
291
291
  oe = !1, te.current = N, On(), Error.prepareStackTrace = w;
292
292
  }
293
- var z = e ? e.displayName || e.name : "", B = z ? q(z) : "";
293
+ var z = e ? e.displayName || e.name : "", B = z ? J(z) : "";
294
294
  return typeof e == "function" && H.set(e, B), B;
295
295
  }
296
296
  function Bn(e, i, l) {
@@ -306,12 +306,12 @@ function wt() {
306
306
  if (typeof e == "function")
307
307
  return je(e, Vn(e));
308
308
  if (typeof e == "string")
309
- return q(e);
309
+ return J(e);
310
310
  switch (e) {
311
311
  case u:
312
- return q("Suspense");
312
+ return J("Suspense");
313
313
  case g:
314
- return q("SuspenseList");
314
+ return J("SuspenseList");
315
315
  }
316
316
  if (typeof e == "object")
317
317
  switch (e.$$typeof) {
@@ -409,7 +409,7 @@ function wt() {
409
409
  se[l] || (P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', O(U.current.type), e.ref), se[l] = !0);
410
410
  }
411
411
  }
412
- function Jn(e, i) {
412
+ function qn(e, i) {
413
413
  {
414
414
  var l = function() {
415
415
  De || (De = !0, P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", i));
@@ -420,7 +420,7 @@ function wt() {
420
420
  });
421
421
  }
422
422
  }
423
- function qn(e, i) {
423
+ function Jn(e, i) {
424
424
  {
425
425
  var l = function() {
426
426
  _e || (_e = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", i));
@@ -473,7 +473,7 @@ function wt() {
473
473
  }
474
474
  if (x || I) {
475
475
  var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
476
- x && Jn(h, E), I && qn(h, E);
476
+ x && qn(h, E), I && Jn(h, E);
477
477
  }
478
478
  return Hn(e, x, I, w, m, U.current, h);
479
479
  }
@@ -696,7 +696,7 @@ const St = Q(
696
696
  }
697
697
  ), en = p.forwardRef(
698
698
  ({ className: r, variant: t, size: n, asChild: o = !1, ...s }, d) => {
699
- const c = o ? Je : "button";
699
+ const c = o ? qe : "button";
700
700
  return /* @__PURE__ */ a.jsx(
701
701
  c,
702
702
  {
@@ -773,7 +773,7 @@ const _t = T.Root, Pt = T.Trigger, It = T.Sub, rn = p.forwardRef(({ className: r
773
773
  ...o,
774
774
  children: [
775
775
  n,
776
- /* @__PURE__ */ a.jsx(qe, { className: "bn-ml-auto bn-h-4 bn-w-4" })
776
+ /* @__PURE__ */ a.jsx(Je, { className: "bn-ml-auto bn-h-4 bn-w-4" })
777
777
  ]
778
778
  }
779
779
  ));
@@ -923,7 +923,7 @@ Bt.displayName = "FormLabel";
923
923
  const Vt = p.forwardRef(({ ...r }, t) => {
924
924
  const { error: n, formItemId: o, formDescriptionId: s, formMessageId: d } = ne();
925
925
  return /* @__PURE__ */ a.jsx(
926
- Je,
926
+ qe,
927
927
  {
928
928
  ref: t,
929
929
  id: o,
@@ -1103,7 +1103,7 @@ const Kt = p.forwardRef(({ className: r, ...t }, n) => /* @__PURE__ */ a.jsx(
1103
1103
  }
1104
1104
  ));
1105
1105
  Kt.displayName = D.Separator.displayName;
1106
- const Jt = V.Root, hn = p.forwardRef(({ className: r, ...t }, n) => /* @__PURE__ */ a.jsx(
1106
+ const qt = V.Root, hn = p.forwardRef(({ className: r, ...t }, n) => /* @__PURE__ */ a.jsx(
1107
1107
  V.List,
1108
1108
  {
1109
1109
  ref: n,
@@ -1139,7 +1139,7 @@ const wn = p.forwardRef(({ className: r, ...t }, n) => /* @__PURE__ */ a.jsx(
1139
1139
  }
1140
1140
  ));
1141
1141
  wn.displayName = V.Content.displayName;
1142
- const qt = Q(
1142
+ const Jt = Q(
1143
1143
  "bn-inline-flex bn-items-center bn-justify-center bn-rounded-md bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-colors hover:bn-bg-muted hover:bn-text-muted-foreground focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=on]:bn-bg-accent data-[state=on]:bn-text-accent-foreground",
1144
1144
  {
1145
1145
  variants: {
@@ -1162,13 +1162,13 @@ const qt = Q(
1162
1162
  Qe.Root,
1163
1163
  {
1164
1164
  ref: s,
1165
- className: b(qt({ variant: t, size: n, className: r })),
1165
+ className: b(Jt({ variant: t, size: n, className: r })),
1166
1166
  ...o
1167
1167
  }
1168
1168
  ));
1169
1169
  Cn.displayName = Qe.Root.displayName;
1170
- const Ht = J.Provider, Xt = J.Root, Zt = J.Trigger, Nn = p.forwardRef(({ className: r, sideOffset: t = 4, ...n }, o) => /* @__PURE__ */ a.jsx(
1171
- J.Content,
1170
+ const Ht = q.Provider, Xt = q.Root, Zt = q.Trigger, Nn = p.forwardRef(({ className: r, sideOffset: t = 4, ...n }, o) => /* @__PURE__ */ a.jsx(
1171
+ q.Content,
1172
1172
  {
1173
1173
  ref: o,
1174
1174
  sideOffset: t,
@@ -1179,7 +1179,7 @@ const Ht = J.Provider, Xt = J.Root, Zt = J.Trigger, Nn = p.forwardRef(({ classNa
1179
1179
  ...n
1180
1180
  }
1181
1181
  ));
1182
- Nn.displayName = J.Content.displayName;
1182
+ Nn.displayName = q.Content.displayName;
1183
1183
  const Qt = {
1184
1184
  Badge: {
1185
1185
  Badge: jt
@@ -1225,7 +1225,7 @@ const Qt = {
1225
1225
  SelectValue: Ut
1226
1226
  },
1227
1227
  Tabs: {
1228
- Tabs: Jt,
1228
+ Tabs: qt,
1229
1229
  TabsContent: wn,
1230
1230
  TabsList: hn,
1231
1231
  TabsTrigger: yn
@@ -1279,7 +1279,10 @@ const er = (r) => {
1279
1279
  return Ye(() => {
1280
1280
  if (!f.current || !o)
1281
1281
  return;
1282
- const u = Ge(f.current);
1282
+ const u = Ge(
1283
+ f.current,
1284
+ document.querySelector(".bn-grid-suggestion-menu")
1285
+ );
1283
1286
  u === "top" ? f.current.scrollIntoView(!0) : u === "bottom" && f.current.scrollIntoView(!1);
1284
1287
  }, [o]), /* @__PURE__ */ a.jsx(
1285
1288
  "div",
@@ -1402,7 +1405,7 @@ const er = (r) => {
1402
1405
  children: [
1403
1406
  s,
1404
1407
  o,
1405
- c && /* @__PURE__ */ a.jsx(qe, { className: "bn-ml-auto bn-h-4 bn-w-4" })
1408
+ c && /* @__PURE__ */ a.jsx(Je, { className: "bn-ml-auto bn-h-4 bn-w-4" })
1406
1409
  ]
1407
1410
  }
1408
1411
  );
@@ -1621,7 +1624,10 @@ const er = (r) => {
1621
1624
  return Ye(() => {
1622
1625
  if (!u.current || !d)
1623
1626
  return;
1624
- const g = Ge(u.current);
1627
+ const g = Ge(
1628
+ u.current,
1629
+ document.querySelector(".bn-suggestion-menu")
1630
+ );
1625
1631
  g === "top" ? u.current.scrollIntoView(!0) : g === "bottom" && u.current.scrollIntoView(!1);
1626
1632
  }, [d]), /* @__PURE__ */ a.jsxs(
1627
1633
  "div",