@blocknote/mantine 0.15.3 → 0.15.5
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.
- package/dist/blocknote-mantine.js +37 -31
- package/dist/blocknote-mantine.js.map +1 -1
- package/dist/blocknote-mantine.umd.cjs +4 -4
- package/dist/blocknote-mantine.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/style.css +2 -1
- package/src/suggestionMenu/SuggestionMenuItem.tsx +4 -1
- package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuItem.tsx +4 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import D, { forwardRef as R, useRef as Z, useEffect as
|
|
1
|
+
import D, { forwardRef as R, useRef as Z, useEffect as He, createContext as Br, useState as Yr, useCallback as fe, useContext as Ur } from "react";
|
|
2
2
|
import { assertEmpty as p, isSafari as ve, mergeCSSClasses as Gr } from "@blocknote/core";
|
|
3
|
-
import { elementOverflow as
|
|
3
|
+
import { elementOverflow as Je, useBlockNoteContext as Kr, usePrefersColorScheme as qr, ComponentsContext as Hr, BlockNoteViewRaw as Jr } from "@blocknote/react";
|
|
4
4
|
import { Group as F, Loader as Xe, Menu as O, CheckIcon as Ze, Tabs as X, LoadingOverlay as Xr, Button as U, FileInput as Zr, TextInput as Qe, Popover as Qr, PopoverTarget as et, PopoverDropdown as rt, ActionIcon as er, Stack as me, Text as Q, Badge as tt, Tooltip as nt, MantineProvider as ot } from "@mantine/core";
|
|
5
5
|
import { mergeRefs as te, useFocusWithin as at, useFocusTrap as it } from "@mantine/hooks";
|
|
6
6
|
var be = { exports: {} }, B = {};
|
|
@@ -205,16 +205,16 @@ function lt() {
|
|
|
205
205
|
` + oe + e;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
var ae = !1,
|
|
208
|
+
var ae = !1, q;
|
|
209
209
|
{
|
|
210
210
|
var hr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
-
|
|
211
|
+
q = new hr();
|
|
212
212
|
}
|
|
213
213
|
function ke(e, a) {
|
|
214
214
|
if (!e || ae)
|
|
215
215
|
return "";
|
|
216
216
|
{
|
|
217
|
-
var s =
|
|
217
|
+
var s = q.get(e);
|
|
218
218
|
if (s !== void 0)
|
|
219
219
|
return s;
|
|
220
220
|
}
|
|
@@ -269,7 +269,7 @@ function lt() {
|
|
|
269
269
|
if (E--, S--, S < 0 || m[E] !== P[S]) {
|
|
270
270
|
var C = `
|
|
271
271
|
` + m[E].replace(" at new ", " at ");
|
|
272
|
-
return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
272
|
+
return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, C), C;
|
|
273
273
|
}
|
|
274
274
|
while (E >= 1 && S >= 0);
|
|
275
275
|
break;
|
|
@@ -279,7 +279,7 @@ function lt() {
|
|
|
279
279
|
ae = !1, ne.current = j, pr(), Error.prepareStackTrace = x;
|
|
280
280
|
}
|
|
281
281
|
var $ = e ? e.displayName || e.name : "", I = $ ? K($) : "";
|
|
282
|
-
return typeof e == "function" &&
|
|
282
|
+
return typeof e == "function" && q.set(e, I), I;
|
|
283
283
|
}
|
|
284
284
|
function xr(e, a, s) {
|
|
285
285
|
return ke(e, !1);
|
|
@@ -288,7 +288,7 @@ function lt() {
|
|
|
288
288
|
var a = e.prototype;
|
|
289
289
|
return !!(a && a.isReactComponent);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function H(e, a, s) {
|
|
292
292
|
if (e == null)
|
|
293
293
|
return "";
|
|
294
294
|
if (typeof e == "function")
|
|
@@ -306,11 +306,11 @@ function lt() {
|
|
|
306
306
|
case d:
|
|
307
307
|
return xr(e.render);
|
|
308
308
|
case w:
|
|
309
|
-
return
|
|
309
|
+
return H(e.type, a, s);
|
|
310
310
|
case T: {
|
|
311
311
|
var v = e, x = v._payload, j = v._init;
|
|
312
312
|
try {
|
|
313
|
-
return
|
|
313
|
+
return H(j(x), a, s);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
316
316
|
}
|
|
@@ -318,9 +318,9 @@ function lt() {
|
|
|
318
318
|
return "";
|
|
319
319
|
}
|
|
320
320
|
var W = Object.prototype.hasOwnProperty, Pe = {}, _e = L.ReactDebugCurrentFrame;
|
|
321
|
-
function
|
|
321
|
+
function J(e) {
|
|
322
322
|
if (e) {
|
|
323
|
-
var a = e._owner, s =
|
|
323
|
+
var a = e._owner, s = H(e.type, e._source, a ? a.type : null);
|
|
324
324
|
_e.setExtraStackFrame(s);
|
|
325
325
|
} else
|
|
326
326
|
_e.setExtraStackFrame(null);
|
|
@@ -340,7 +340,7 @@ function lt() {
|
|
|
340
340
|
} catch (E) {
|
|
341
341
|
m = E;
|
|
342
342
|
}
|
|
343
|
-
m && !(m instanceof Error) && (
|
|
343
|
+
m && !(m instanceof Error) && (J(x), k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", v || "React class", s, g, typeof m), J(null)), m instanceof Error && !(m.message in Pe) && (Pe[m.message] = !0, J(x), k("Failed %s type: %s", s, m.message), J(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -469,7 +469,7 @@ function lt() {
|
|
|
469
469
|
var le = L.ReactCurrentOwner, De = L.ReactDebugCurrentFrame;
|
|
470
470
|
function A(e) {
|
|
471
471
|
if (e) {
|
|
472
|
-
var a = e._owner, s =
|
|
472
|
+
var a = e._owner, s = H(e.type, e._source, a ? a.type : null);
|
|
473
473
|
De.setExtraStackFrame(s);
|
|
474
474
|
} else
|
|
475
475
|
De.setExtraStackFrame(null);
|
|
@@ -740,10 +740,13 @@ const rr = (r, n, t = !1) => {
|
|
|
740
740
|
const { className: t, isSelected: o, onClick: i, item: u, id: f, ...c } = r;
|
|
741
741
|
p(c);
|
|
742
742
|
const d = Z(null);
|
|
743
|
-
return
|
|
743
|
+
return He(() => {
|
|
744
744
|
if (!d.current || !o)
|
|
745
745
|
return;
|
|
746
|
-
const b =
|
|
746
|
+
const b = Je(
|
|
747
|
+
d.current,
|
|
748
|
+
document.querySelector(".bn-grid-suggestion-menu")
|
|
749
|
+
);
|
|
747
750
|
b === "top" ? d.current.scrollIntoView(!0) : b === "bottom" && d.current.scrollIntoView(!1);
|
|
748
751
|
}, [o]), /* @__PURE__ */ l.jsx(
|
|
749
752
|
"div",
|
|
@@ -1178,10 +1181,13 @@ const ar = Br(void 0), St = R((r, n) => {
|
|
|
1178
1181
|
const { className: t, isSelected: o, onClick: i, item: u, id: f, ...c } = r;
|
|
1179
1182
|
p(c);
|
|
1180
1183
|
const d = Z(null);
|
|
1181
|
-
return
|
|
1184
|
+
return He(() => {
|
|
1182
1185
|
if (!d.current || !o)
|
|
1183
1186
|
return;
|
|
1184
|
-
const b =
|
|
1187
|
+
const b = Je(
|
|
1188
|
+
d.current,
|
|
1189
|
+
document.querySelector(".bn-suggestion-menu")
|
|
1190
|
+
);
|
|
1185
1191
|
b === "top" ? d.current.scrollIntoView(!0) : b === "bottom" && d.current.scrollIntoView(!1);
|
|
1186
1192
|
}, [o]), /* @__PURE__ */ l.jsxs(
|
|
1187
1193
|
F,
|
|
@@ -1302,7 +1308,7 @@ const ar = Br(void 0), St = R((r, n) => {
|
|
|
1302
1308
|
}
|
|
1303
1309
|
);
|
|
1304
1310
|
}
|
|
1305
|
-
),
|
|
1311
|
+
), qt = (r) => /* @__PURE__ */ l.jsxs(me, { gap: 0, className: "bn-tooltip", children: [
|
|
1306
1312
|
/* @__PURE__ */ l.jsx(Q, { size: "sm", children: r.mainTooltip }),
|
|
1307
1313
|
r.secondaryTooltip && /* @__PURE__ */ l.jsx(Q, { size: "xs", children: r.secondaryTooltip })
|
|
1308
1314
|
] }), Ke = R(
|
|
@@ -1324,7 +1330,7 @@ const ar = Br(void 0), St = R((r, n) => {
|
|
|
1324
1330
|
{
|
|
1325
1331
|
withinPortal: !1,
|
|
1326
1332
|
label: /* @__PURE__ */ l.jsx(
|
|
1327
|
-
|
|
1333
|
+
qt,
|
|
1328
1334
|
{
|
|
1329
1335
|
mainTooltip: i,
|
|
1330
1336
|
secondaryTooltip: u
|
|
@@ -1370,7 +1376,7 @@ const ar = Br(void 0), St = R((r, n) => {
|
|
|
1370
1376
|
}
|
|
1371
1377
|
);
|
|
1372
1378
|
}
|
|
1373
|
-
),
|
|
1379
|
+
), Ht = R((r, n) => {
|
|
1374
1380
|
const { className: t, items: o, isDisabled: i, ...u } = r;
|
|
1375
1381
|
p(u);
|
|
1376
1382
|
const f = o.filter((c) => c.isSelected)[0];
|
|
@@ -1426,7 +1432,7 @@ const ar = Br(void 0), St = R((r, n) => {
|
|
|
1426
1432
|
"#161616",
|
|
1427
1433
|
"#0F0F0F",
|
|
1428
1434
|
"#000000"
|
|
1429
|
-
],
|
|
1435
|
+
], qe = {
|
|
1430
1436
|
colors: {
|
|
1431
1437
|
editor: {
|
|
1432
1438
|
text: y[5],
|
|
@@ -1564,13 +1570,13 @@ const ar = Br(void 0), St = R((r, n) => {
|
|
|
1564
1570
|
}
|
|
1565
1571
|
}
|
|
1566
1572
|
},
|
|
1567
|
-
borderRadius:
|
|
1568
|
-
fontFamily:
|
|
1569
|
-
},
|
|
1573
|
+
borderRadius: qe.borderRadius,
|
|
1574
|
+
fontFamily: qe.fontFamily
|
|
1575
|
+
}, Jt = {
|
|
1570
1576
|
FormattingToolbar: {
|
|
1571
1577
|
Root: Ge,
|
|
1572
1578
|
Button: Ke,
|
|
1573
|
-
Select:
|
|
1579
|
+
Select: Ht
|
|
1574
1580
|
},
|
|
1575
1581
|
FilePanel: {
|
|
1576
1582
|
Root: Ot,
|
|
@@ -1626,7 +1632,7 @@ const ar = Br(void 0), St = R((r, n) => {
|
|
|
1626
1632
|
// Removes button press effect
|
|
1627
1633
|
activeClassName: ""
|
|
1628
1634
|
}, on = (r) => {
|
|
1629
|
-
const { className: n, theme: t, ...o } = r, i = Kr(), u =
|
|
1635
|
+
const { className: n, theme: t, ...o } = r, i = Kr(), u = qr(), f = (i == null ? void 0 : i.colorSchemePreference) || u, c = fe(
|
|
1630
1636
|
(d) => {
|
|
1631
1637
|
if (d && (ct(d), typeof t == "object")) {
|
|
1632
1638
|
if ("light" in t && "dark" in t) {
|
|
@@ -1642,7 +1648,7 @@ const ar = Br(void 0), St = R((r, n) => {
|
|
|
1642
1648
|
},
|
|
1643
1649
|
[f, t]
|
|
1644
1650
|
);
|
|
1645
|
-
return /* @__PURE__ */ l.jsx(
|
|
1651
|
+
return /* @__PURE__ */ l.jsx(Hr.Provider, { value: Jt, children: /* @__PURE__ */ l.jsx(
|
|
1646
1652
|
ot,
|
|
1647
1653
|
{
|
|
1648
1654
|
theme: Xt,
|
|
@@ -1650,7 +1656,7 @@ const ar = Br(void 0), St = R((r, n) => {
|
|
|
1650
1656
|
getRootElement: () => {
|
|
1651
1657
|
},
|
|
1652
1658
|
children: /* @__PURE__ */ l.jsx(
|
|
1653
|
-
|
|
1659
|
+
Jr,
|
|
1654
1660
|
{
|
|
1655
1661
|
className: Gr("bn-mantine", n || ""),
|
|
1656
1662
|
theme: typeof t == "object" ? void 0 : t,
|
|
@@ -1664,10 +1670,10 @@ const ar = Br(void 0), St = R((r, n) => {
|
|
|
1664
1670
|
export {
|
|
1665
1671
|
on as BlockNoteView,
|
|
1666
1672
|
Be as applyBlockNoteCSSVariablesFromTheme,
|
|
1667
|
-
|
|
1673
|
+
Jt as components,
|
|
1668
1674
|
nn as darkDefaultTheme,
|
|
1669
1675
|
y as defaultColorScheme,
|
|
1670
|
-
|
|
1676
|
+
qe as lightDefaultTheme,
|
|
1671
1677
|
ct as removeBlockNoteCSSVariables
|
|
1672
1678
|
};
|
|
1673
1679
|
//# sourceMappingURL=blocknote-mantine.js.map
|