@blocknote/mantine 0.24.1 → 0.24.2

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.
@@ -8,8 +8,8 @@ const G = (e, n, t = !1) => {
8
8
  const o = [];
9
9
  function r(s, l = "--bn") {
10
10
  for (const a in s) {
11
- const c = a.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), u = `${l}-${c}`;
12
- typeof s[a] != "object" ? (typeof s[a] == "number" && (s[a] = `${s[a]}px`), t ? n.style.removeProperty(u) : n.style.setProperty(u, s[a].toString())) : r(s[a], u);
11
+ const u = a.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), c = `${l}-${u}`;
12
+ typeof s[a] != "object" ? (typeof s[a] == "number" && (s[a] = `${s[a]}px`), t ? n.style.removeProperty(c) : n.style.setProperty(c, s[a].toString())) : r(s[a], c);
13
13
  }
14
14
  }
15
15
  return r(e), o;
@@ -91,8 +91,8 @@ const G = (e, n, t = !1) => {
91
91
  icon: s,
92
92
  value: l,
93
93
  autoFocus: a,
94
- placeholder: c,
95
- onKeyDown: u,
94
+ placeholder: u,
95
+ onKeyDown: c,
96
96
  onChange: f,
97
97
  onSubmit: v,
98
98
  ...h
@@ -109,8 +109,8 @@ const G = (e, n, t = !1) => {
109
109
  value: l,
110
110
  autoFocus: a,
111
111
  "data-autofocus": a ? "true" : void 0,
112
- placeholder: c,
113
- onKeyDown: u,
112
+ placeholder: u,
113
+ onKeyDown: c,
114
114
  onChange: f,
115
115
  onSubmit: v
116
116
  }
@@ -143,15 +143,15 @@ function ye(e, n) {
143
143
  }
144
144
  return t;
145
145
  }
146
- function k() {
147
- return k = Object.assign ? Object.assign.bind() : function(e) {
146
+ function T() {
147
+ return T = Object.assign ? Object.assign.bind() : function(e) {
148
148
  for (var n = 1; n < arguments.length; n++) {
149
149
  var t = arguments[n];
150
150
  for (var o in t)
151
151
  Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
152
152
  }
153
153
  return e;
154
- }, k.apply(this, arguments);
154
+ }, T.apply(this, arguments);
155
155
  }
156
156
  function E(e, n) {
157
157
  var t = Object.keys(e);
@@ -163,7 +163,7 @@ function E(e, n) {
163
163
  }
164
164
  return t;
165
165
  }
166
- function T(e) {
166
+ function k(e) {
167
167
  for (var n = 1; n < arguments.length; n++) {
168
168
  var t = arguments[n] != null ? arguments[n] : {};
169
169
  n % 2 ? E(Object(t), !0).forEach(function(o) {
@@ -192,13 +192,13 @@ function we(e, n) {
192
192
  return (n === "string" ? String : Number)(e);
193
193
  }
194
194
  function K(e) {
195
- return e && e.map((n, t) => /* @__PURE__ */ y.createElement(n.tag, T({
195
+ return e && e.map((n, t) => /* @__PURE__ */ y.createElement(n.tag, k({
196
196
  key: t
197
197
  }, n.attr), K(n.child)));
198
198
  }
199
199
  function U(e) {
200
- return (n) => /* @__PURE__ */ y.createElement(Ne, k({
201
- attr: T({}, e.attr)
200
+ return (n) => /* @__PURE__ */ y.createElement(Ne, T({
201
+ attr: k({}, e.attr)
202
202
  }, n), K(e.child));
203
203
  }
204
204
  function Ne(e) {
@@ -207,14 +207,14 @@ function Ne(e) {
207
207
  attr: o,
208
208
  size: r,
209
209
  title: s
210
- } = e, l = he(e, ve), a = r || t.size || "1em", c;
211
- return t.className && (c = t.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ y.createElement("svg", k({
210
+ } = e, l = he(e, ve), a = r || t.size || "1em", u;
211
+ return t.className && (u = t.className), e.className && (u = (u ? u + " " : "") + e.className), /* @__PURE__ */ y.createElement("svg", T({
212
212
  stroke: "currentColor",
213
213
  fill: "currentColor",
214
214
  strokeWidth: "0"
215
215
  }, t.attr, o, l, {
216
- className: c,
217
- style: T(T({
216
+ className: u,
217
+ style: k(k({
218
218
  color: e.color || t.color
219
219
  }, t.style), e.style),
220
220
  height: a,
@@ -227,10 +227,10 @@ function Ne(e) {
227
227
  function Ce(e) {
228
228
  return U({ tag: "svg", attr: { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", clipRule: "evenodd" }, child: [] }] })(e);
229
229
  }
230
- function ke(e) {
230
+ function Te(e) {
231
231
  return U({ tag: "svg", attr: { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", clipRule: "evenodd" }, child: [] }] })(e);
232
232
  }
233
- const W = ce(void 0), Te = g((e, n) => {
233
+ const W = ce(void 0), ke = g((e, n) => {
234
234
  const {
235
235
  children: t,
236
236
  onOpenChange: o,
@@ -240,12 +240,12 @@ const W = ce(void 0), Te = g((e, n) => {
240
240
  ...l
241
241
  } = e;
242
242
  d(l);
243
- const [a, c] = ue(!1), u = C(null), f = C(), v = D(() => {
243
+ const [a, u] = ue(!1), c = C(null), f = C(), v = D(() => {
244
244
  f.current && clearTimeout(f.current), f.current = setTimeout(() => {
245
- c(!1);
245
+ u(!1);
246
246
  }, 250);
247
247
  }, []), h = D(() => {
248
- f.current && clearTimeout(f.current), c(!0);
248
+ f.current && clearTimeout(f.current), u(!0);
249
249
  }, []);
250
250
  return /* @__PURE__ */ i(
251
251
  W.Provider,
@@ -258,14 +258,14 @@ const W = ce(void 0), Te = g((e, n) => {
258
258
  b.Item,
259
259
  {
260
260
  className: "bn-menu-item bn-mt-sub-menu-item",
261
- ref: P(n, u),
261
+ ref: P(n, c),
262
262
  onMouseOver: h,
263
263
  onMouseLeave: v,
264
264
  children: /* @__PURE__ */ i(
265
265
  b,
266
266
  {
267
267
  portalProps: {
268
- target: u.current ? u.current.parentElement : void 0
268
+ target: c.current ? c.current.parentElement : void 0
269
269
  },
270
270
  middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
271
271
  trigger: "hover",
@@ -282,7 +282,7 @@ const W = ce(void 0), Te = g((e, n) => {
282
282
  );
283
283
  }), Pe = (e) => {
284
284
  const { children: n, onOpenChange: t, position: o, sub: r, ...s } = e;
285
- return d(s), r ? /* @__PURE__ */ i(Te, { ...e }) : /* @__PURE__ */ i(
285
+ return d(s), r ? /* @__PURE__ */ i(ke, { ...e }) : /* @__PURE__ */ i(
286
286
  b,
287
287
  {
288
288
  withinPortal: !1,
@@ -294,18 +294,18 @@ const W = ce(void 0), Te = g((e, n) => {
294
294
  }
295
295
  );
296
296
  }, Me = g((e, n) => {
297
- const { className: t, children: o, icon: r, checked: s, subTrigger: l, onClick: a, ...c } = e;
298
- return d(c, !1), l ? /* @__PURE__ */ S(
297
+ const { className: t, children: o, icon: r, checked: s, subTrigger: l, onClick: a, ...u } = e;
298
+ return d(u, !1), l ? /* @__PURE__ */ S(
299
299
  "div",
300
300
  {
301
- onClick: (u) => {
302
- u.preventDefault(), u.stopPropagation();
301
+ onClick: (c) => {
302
+ c.preventDefault(), c.stopPropagation();
303
303
  },
304
304
  ref: n,
305
- ...c,
305
+ ...u,
306
306
  children: [
307
307
  o,
308
- /* @__PURE__ */ i(ke, { size: 15 })
308
+ /* @__PURE__ */ i(Te, { size: 15 })
309
309
  ]
310
310
  }
311
311
  ) : /* @__PURE__ */ i(
@@ -316,7 +316,7 @@ const W = ce(void 0), Te = g((e, n) => {
316
316
  leftSection: r,
317
317
  rightSection: s ? /* @__PURE__ */ i(_, { size: 10 }) : s === !1 ? /* @__PURE__ */ i("div", { className: "bn-tick-space" }) : null,
318
318
  onClick: a,
319
- ...c,
319
+ ...u,
320
320
  children: o
321
321
  }
322
322
  );
@@ -362,9 +362,9 @@ const W = ce(void 0), Te = g((e, n) => {
362
362
  openTab: s,
363
363
  setOpenTab: l,
364
364
  loading: a,
365
- ...c
365
+ ...u
366
366
  } = e;
367
- return d(c), /* @__PURE__ */ i(p, { className: t, ref: n, children: /* @__PURE__ */ S(
367
+ return d(u), /* @__PURE__ */ i(p, { className: t, ref: n, children: /* @__PURE__ */ S(
368
368
  w,
369
369
  {
370
370
  value: s,
@@ -372,16 +372,16 @@ const W = ce(void 0), Te = g((e, n) => {
372
372
  onChange: l,
373
373
  children: [
374
374
  a && /* @__PURE__ */ i(te, { visible: a }),
375
- /* @__PURE__ */ i(w.List, { children: o.map((u) => /* @__PURE__ */ i(
375
+ /* @__PURE__ */ i(w.List, { children: o.map((c) => /* @__PURE__ */ i(
376
376
  w.Tab,
377
377
  {
378
- "data-test": `${u.name.toLowerCase()}-tab`,
379
- value: u.name,
380
- children: u.name
378
+ "data-test": `${c.name.toLowerCase()}-tab`,
379
+ value: c.name,
380
+ children: c.name
381
381
  },
382
- u.name
382
+ c.name
383
383
  )) }),
384
- o.map((u) => /* @__PURE__ */ i(w.Panel, { value: u.name, children: u.tabPanel }, u.name))
384
+ o.map((c) => /* @__PURE__ */ i(w.Panel, { value: c.name, children: c.tabPanel }, c.name))
385
385
  ]
386
386
  }
387
387
  ) });
@@ -468,8 +468,8 @@ const W = ce(void 0), Te = g((e, n) => {
468
468
  onClick: s,
469
469
  onDragEnd: l,
470
470
  onDragStart: a,
471
- draggable: c,
472
- label: u,
471
+ draggable: u,
472
+ label: c,
473
473
  ...f
474
474
  } = e;
475
475
  return d(f, !1), r ? /* @__PURE__ */ i(
@@ -481,8 +481,8 @@ const W = ce(void 0), Te = g((e, n) => {
481
481
  onClick: s,
482
482
  onDragEnd: l,
483
483
  onDragStart: a,
484
- draggable: c,
485
- "aria-label": u,
484
+ draggable: u,
485
+ "aria-label": c,
486
486
  ...f,
487
487
  children: r
488
488
  }
@@ -494,8 +494,8 @@ const W = ce(void 0), Te = g((e, n) => {
494
494
  onClick: s,
495
495
  onDragEnd: l,
496
496
  onDragStart: a,
497
- draggable: c,
498
- "aria-label": u,
497
+ draggable: u,
498
+ "aria-label": c,
499
499
  ...f,
500
500
  children: o
501
501
  }
@@ -527,20 +527,20 @@ const W = ce(void 0), Te = g((e, n) => {
527
527
  }), Ke = g((e, n) => {
528
528
  const { className: t, isSelected: o, onClick: r, item: s, id: l, ...a } = e;
529
529
  d(a);
530
- const c = C(null);
530
+ const u = C(null);
531
531
  return A(() => {
532
- if (!c.current || !o)
532
+ if (!u.current || !o)
533
533
  return;
534
- const u = z(
535
- c.current,
534
+ const c = z(
535
+ u.current,
536
536
  document.querySelector(".bn-grid-suggestion-menu")
537
537
  );
538
- u === "top" ? c.current.scrollIntoView(!0) : u === "bottom" && c.current.scrollIntoView(!1);
538
+ c === "top" ? u.current.scrollIntoView(!0) : c === "bottom" && u.current.scrollIntoView(!1);
539
539
  }, [o]), /* @__PURE__ */ i(
540
540
  "div",
541
541
  {
542
542
  className: t,
543
- ref: P(n, c),
543
+ ref: P(n, u),
544
544
  id: l,
545
545
  role: "option",
546
546
  onClick: r,
@@ -584,21 +584,21 @@ const W = ce(void 0), Te = g((e, n) => {
584
584
  }), Ze = g((e, n) => {
585
585
  const { className: t, isSelected: o, onClick: r, item: s, id: l, ...a } = e;
586
586
  d(a);
587
- const c = C(null);
587
+ const u = C(null);
588
588
  return A(() => {
589
- if (!c.current || !o)
589
+ if (!u.current || !o)
590
590
  return;
591
- const u = z(
592
- c.current,
591
+ const c = z(
592
+ u.current,
593
593
  document.querySelector(".bn-suggestion-menu")
594
594
  );
595
- u === "top" ? c.current.scrollIntoView(!0) : u === "bottom" && c.current.scrollIntoView(!1);
595
+ c === "top" ? u.current.scrollIntoView(!0) : c === "bottom" && u.current.scrollIntoView(!1);
596
596
  }, [o]), /* @__PURE__ */ S(
597
597
  p,
598
598
  {
599
599
  gap: 0,
600
600
  className: t,
601
- ref: P(n, c),
601
+ ref: P(n, u),
602
602
  id: l,
603
603
  role: "option",
604
604
  onClick: r,
@@ -659,20 +659,20 @@ const W = ce(void 0), Te = g((e, n) => {
659
659
  onDragStart: s,
660
660
  onDragEnd: l,
661
661
  style: a,
662
- label: c,
663
- ...u
662
+ label: u,
663
+ ...c
664
664
  } = e;
665
- return d(u, !1), /* @__PURE__ */ i(
665
+ return d(c, !1), /* @__PURE__ */ i(
666
666
  x,
667
667
  {
668
668
  className: t,
669
669
  ref: n,
670
- "aria-label": c,
670
+ "aria-label": u,
671
671
  draggable: r,
672
672
  onDragStart: s,
673
673
  onDragEnd: l,
674
674
  style: a,
675
- ...u,
675
+ ...c,
676
676
  children: o
677
677
  }
678
678
  );
@@ -680,7 +680,7 @@ const W = ce(void 0), Te = g((e, n) => {
680
680
  (e, n) => {
681
681
  const { className: t, children: o, onMouseEnter: r, onMouseLeave: s, ...l } = e;
682
682
  d(l);
683
- const { ref: a, focused: c } = me(), u = ge(c), f = P(n, a, u);
683
+ const { ref: a, focused: u } = me(), c = ge(u), f = P(n, a, c);
684
684
  return /* @__PURE__ */ i(
685
685
  p,
686
686
  {
@@ -705,8 +705,8 @@ const W = ce(void 0), Te = g((e, n) => {
705
705
  secondaryTooltip: s,
706
706
  icon: l,
707
707
  isSelected: a,
708
- isDisabled: c,
709
- onClick: u,
708
+ isDisabled: u,
709
+ onClick: c,
710
710
  label: f,
711
711
  ...v
712
712
  } = e;
@@ -729,12 +729,12 @@ const W = ce(void 0), Te = g((e, n) => {
729
729
  onMouseDown: (h) => {
730
730
  O() && h.currentTarget.focus();
731
731
  },
732
- onClick: u,
732
+ onClick: c,
733
733
  "aria-pressed": a,
734
734
  "data-selected": a || void 0,
735
735
  "data-test": r.slice(0, 1).toLowerCase() + r.replace(/\s+/g, "").slice(1),
736
736
  size: "xs",
737
- disabled: c || !1,
737
+ disabled: u || !1,
738
738
  ref: n,
739
739
  ...v,
740
740
  children: o
@@ -747,12 +747,12 @@ const W = ce(void 0), Te = g((e, n) => {
747
747
  onMouseDown: (h) => {
748
748
  O() && h.currentTarget.focus();
749
749
  },
750
- onClick: u,
750
+ onClick: c,
751
751
  "aria-pressed": a,
752
752
  "data-selected": a || void 0,
753
753
  "data-test": r.slice(0, 1).toLowerCase() + r.replace(/\s+/g, "").slice(1),
754
754
  size: 30,
755
- disabled: c || !1,
755
+ disabled: u || !1,
756
756
  ref: n,
757
757
  ...v,
758
758
  children: l
@@ -886,7 +886,7 @@ const W = ce(void 0), Te = g((e, n) => {
886
886
  }
887
887
  },
888
888
  [l, t]
889
- );
889
+ ), u = typeof t == "string" ? t : l !== "no-preference" ? l : "light";
890
890
  return /* @__PURE__ */ i(Y.Provider, { value: nt, children: /* @__PURE__ */ i(
891
891
  le,
892
892
  {
@@ -897,6 +897,7 @@ const W = ce(void 0), Te = g((e, n) => {
897
897
  children: /* @__PURE__ */ i(
898
898
  ee,
899
899
  {
900
+ "data-mantine-color-scheme": u,
900
901
  className: q("bn-mantine", n || ""),
901
902
  theme: typeof t == "object" ? void 0 : t,
902
903
  ...o,