@blocknote/mantine 0.30.1 → 0.31.1
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.cjs +1 -1
- package/dist/blocknote-mantine.cjs.map +1 -1
- package/dist/blocknote-mantine.js +120 -113
- package/dist/blocknote-mantine.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/form/TextInput.tsx +12 -2
- package/src/style.css +57 -0
- package/src/suggestionMenu/SuggestionMenuItem.tsx +2 -1
- package/src/suggestionMenu/SuggestionMenuLoader.tsx +4 -6
- package/src/toolbar/Toolbar.tsx +1 -2
- package/src/toolbar/ToolbarButton.tsx +1 -2
- package/types/src/form/TextInput.d.ts +5 -1
- package/types/src/suggestionMenu/SuggestionMenuItem.d.ts +1 -1
- package/types/src/suggestionMenu/SuggestionMenuLoader.d.ts +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as s, jsxs as v } from "react/jsx-runtime";
|
|
2
|
-
import { assertEmpty as d, isSafari as B, mergeCSSClasses as
|
|
2
|
+
import { assertEmpty as d, isSafari as B, mergeCSSClasses as z, COLORS_DEFAULT as ae, COLORS_DARK_MODE_DEFAULT as le } from "@blocknote/core";
|
|
3
3
|
import { mergeRefs as W, FormattingToolbarController as ce, getFormattingToolbarItems as ue, FormattingToolbar as de, elementOverflow as q, useBlockNoteContext as me, usePrefersColorScheme as fe, ComponentsContext as ge, BlockNoteViewRaw as he } from "@blocknote/react";
|
|
4
|
-
import { Button as
|
|
5
|
-
import
|
|
6
|
-
import { useHover as
|
|
4
|
+
import { Button as N, ActionIcon as j, Tooltip as Z, Stack as $, Text as w, Group as b, Chip as be, Divider as pe, Card as J, Skeleton as V, Avatar as ve, TextInput as Q, Menu as S, CheckIcon as X, Tabs as M, LoadingOverlay as Se, FileInput as ye, PopoverDropdown as xe, PopoverTarget as Ce, Popover as we, Badge as Te, Loader as Y, Flex as Ne, MantineProvider as ke } from "@mantine/core";
|
|
5
|
+
import T, { forwardRef as m, useState as A, useRef as P, useEffect as _, useContext as Pe, createContext as Me, useCallback as E } from "react";
|
|
6
|
+
import { useHover as Fe, useFocusWithin as ee, mergeRefs as R, useFocusTrap as Oe } from "@mantine/hooks";
|
|
7
7
|
const te = (e, n, t = !1) => {
|
|
8
8
|
const o = [];
|
|
9
9
|
function r(i, l = "--bn") {
|
|
@@ -13,7 +13,7 @@ const te = (e, n, t = !1) => {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
return r(e), o;
|
|
16
|
-
},
|
|
16
|
+
}, G = (e, n) => te(e, n), Re = {
|
|
17
17
|
colors: {
|
|
18
18
|
editor: {
|
|
19
19
|
text: void 0,
|
|
@@ -83,9 +83,9 @@ const te = (e, n, t = !1) => {
|
|
|
83
83
|
},
|
|
84
84
|
borderRadius: void 0,
|
|
85
85
|
fontFamily: void 0
|
|
86
|
-
}, Ie = (e) => te(Re, e, !0), ne = (e) => /* @__PURE__ */ v(
|
|
87
|
-
/* @__PURE__ */ s(
|
|
88
|
-
e.secondaryTooltip && /* @__PURE__ */ s(
|
|
86
|
+
}, Ie = (e) => te(Re, e, !0), ne = (e) => /* @__PURE__ */ v($, { gap: 0, className: "bn-tooltip", children: [
|
|
87
|
+
/* @__PURE__ */ s(w, { size: "sm", lineClamp: 5, children: e.mainTooltip }),
|
|
88
|
+
e.secondaryTooltip && /* @__PURE__ */ s(w, { size: "xs", lineClamp: 5, children: e.secondaryTooltip })
|
|
89
89
|
] }), I = m(
|
|
90
90
|
(e, n) => {
|
|
91
91
|
const {
|
|
@@ -102,16 +102,16 @@ const te = (e, n, t = !1) => {
|
|
|
102
102
|
...p
|
|
103
103
|
} = e;
|
|
104
104
|
d(p, !1);
|
|
105
|
-
const [
|
|
106
|
-
|
|
105
|
+
const [C, y] = A(!1), k = o ? /* @__PURE__ */ s(
|
|
106
|
+
N,
|
|
107
107
|
{
|
|
108
108
|
"aria-label": g,
|
|
109
109
|
className: t,
|
|
110
|
-
onMouseDown: (
|
|
111
|
-
B() &&
|
|
110
|
+
onMouseDown: (x) => {
|
|
111
|
+
B() && x.currentTarget.focus();
|
|
112
112
|
},
|
|
113
|
-
onClick: (
|
|
114
|
-
y(!0), c == null || c(
|
|
113
|
+
onClick: (x) => {
|
|
114
|
+
y(!0), c == null || c(x);
|
|
115
115
|
},
|
|
116
116
|
onPointerLeave: () => y(!1),
|
|
117
117
|
"aria-pressed": a,
|
|
@@ -124,15 +124,15 @@ const te = (e, n, t = !1) => {
|
|
|
124
124
|
children: o
|
|
125
125
|
}
|
|
126
126
|
) : /* @__PURE__ */ s(
|
|
127
|
-
|
|
127
|
+
j,
|
|
128
128
|
{
|
|
129
129
|
className: t,
|
|
130
130
|
"aria-label": g,
|
|
131
|
-
onMouseDown: (
|
|
132
|
-
B() &&
|
|
131
|
+
onMouseDown: (x) => {
|
|
132
|
+
B() && x.currentTarget.focus();
|
|
133
133
|
},
|
|
134
|
-
onClick: (
|
|
135
|
-
y(!0), c == null || c(
|
|
134
|
+
onClick: (x) => {
|
|
135
|
+
y(!0), c == null || c(x);
|
|
136
136
|
},
|
|
137
137
|
onPointerLeave: () => y(!1),
|
|
138
138
|
"aria-pressed": a,
|
|
@@ -148,7 +148,7 @@ const te = (e, n, t = !1) => {
|
|
|
148
148
|
return r ? /* @__PURE__ */ s(
|
|
149
149
|
Z,
|
|
150
150
|
{
|
|
151
|
-
disabled:
|
|
151
|
+
disabled: C,
|
|
152
152
|
withinPortal: !1,
|
|
153
153
|
label: /* @__PURE__ */ s(
|
|
154
154
|
ne,
|
|
@@ -157,9 +157,9 @@ const te = (e, n, t = !1) => {
|
|
|
157
157
|
secondaryTooltip: i
|
|
158
158
|
}
|
|
159
159
|
),
|
|
160
|
-
children:
|
|
160
|
+
children: k
|
|
161
161
|
}
|
|
162
|
-
) :
|
|
162
|
+
) : k;
|
|
163
163
|
}
|
|
164
164
|
), De = m((e, n) => {
|
|
165
165
|
const {
|
|
@@ -174,7 +174,7 @@ const te = (e, n, t = !1) => {
|
|
|
174
174
|
...g
|
|
175
175
|
} = e;
|
|
176
176
|
d(g, !1);
|
|
177
|
-
const [h, p] =
|
|
177
|
+
const [h, p] = A(!1), C = /* @__PURE__ */ v(
|
|
178
178
|
be,
|
|
179
179
|
{
|
|
180
180
|
className: t,
|
|
@@ -195,7 +195,7 @@ const te = (e, n, t = !1) => {
|
|
|
195
195
|
]
|
|
196
196
|
}
|
|
197
197
|
);
|
|
198
|
-
return !l || h ?
|
|
198
|
+
return !l || h ? C : /* @__PURE__ */ s(
|
|
199
199
|
Z,
|
|
200
200
|
{
|
|
201
201
|
refProp: "rootRef",
|
|
@@ -207,7 +207,7 @@ const te = (e, n, t = !1) => {
|
|
|
207
207
|
secondaryTooltip: a
|
|
208
208
|
}
|
|
209
209
|
),
|
|
210
|
-
children:
|
|
210
|
+
children: C
|
|
211
211
|
}
|
|
212
212
|
);
|
|
213
213
|
}), Le = m((e, n) => {
|
|
@@ -225,8 +225,8 @@ const te = (e, n, t = !1) => {
|
|
|
225
225
|
...c
|
|
226
226
|
} = e;
|
|
227
227
|
d(c, !1);
|
|
228
|
-
const g =
|
|
229
|
-
return
|
|
228
|
+
const g = P(null);
|
|
229
|
+
return _(() => {
|
|
230
230
|
var h;
|
|
231
231
|
i && ((h = g.current) == null || h.scrollIntoView({
|
|
232
232
|
behavior: "smooth",
|
|
@@ -235,13 +235,13 @@ const te = (e, n, t = !1) => {
|
|
|
235
235
|
}, [i]), /* @__PURE__ */ v(
|
|
236
236
|
J,
|
|
237
237
|
{
|
|
238
|
-
className:
|
|
238
|
+
className: z(t, i ? "selected" : ""),
|
|
239
239
|
onFocus: l,
|
|
240
240
|
onBlur: a,
|
|
241
241
|
tabIndex: u,
|
|
242
242
|
ref: W([n, g]),
|
|
243
243
|
children: [
|
|
244
|
-
r && /* @__PURE__ */ s(
|
|
244
|
+
r && /* @__PURE__ */ s(w, { className: "bn-header-text", children: r }),
|
|
245
245
|
o
|
|
246
246
|
]
|
|
247
247
|
}
|
|
@@ -255,15 +255,15 @@ const te = (e, n, t = !1) => {
|
|
|
255
255
|
pe,
|
|
256
256
|
{
|
|
257
257
|
className: t,
|
|
258
|
-
label: /* @__PURE__ */ s(
|
|
258
|
+
label: /* @__PURE__ */ s(w, { children: o }),
|
|
259
259
|
ref: n
|
|
260
260
|
}
|
|
261
261
|
);
|
|
262
262
|
}), je = m((e, n) => {
|
|
263
263
|
const { authorInfo: t, timeString: o, edited: r, ...i } = e;
|
|
264
264
|
return d(i, !1), t === "loading" ? /* @__PURE__ */ v(b, { children: [
|
|
265
|
-
/* @__PURE__ */ s(
|
|
266
|
-
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
265
|
+
/* @__PURE__ */ s(V, { height: 24, width: 24 }),
|
|
266
|
+
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(V, { height: 12, width: 100 }) })
|
|
267
267
|
] }) : /* @__PURE__ */ v(b, { children: [
|
|
268
268
|
/* @__PURE__ */ s(
|
|
269
269
|
ve,
|
|
@@ -275,9 +275,9 @@ const te = (e, n, t = !1) => {
|
|
|
275
275
|
color: "initials"
|
|
276
276
|
}
|
|
277
277
|
),
|
|
278
|
-
/* @__PURE__ */ v(
|
|
278
|
+
/* @__PURE__ */ v(w, { fz: "sm", fw: "bold", children: [
|
|
279
279
|
t.username,
|
|
280
|
-
/* @__PURE__ */ v(
|
|
280
|
+
/* @__PURE__ */ v(w, { fz: "xs", c: "dimmed", span: !0, ml: "xs", children: [
|
|
281
281
|
o,
|
|
282
282
|
" ",
|
|
283
283
|
r && "(edited)"
|
|
@@ -294,12 +294,12 @@ const te = (e, n, t = !1) => {
|
|
|
294
294
|
actions: a,
|
|
295
295
|
children: u,
|
|
296
296
|
...c
|
|
297
|
-
} = e, { hovered: g, ref: h } =
|
|
297
|
+
} = e, { hovered: g, ref: h } = Fe(), { focused: p, ref: C } = ee(), y = W([n, h]);
|
|
298
298
|
return d(c, !1), /* @__PURE__ */ v(b, { pos: "relative", ref: y, className: t, children: [
|
|
299
299
|
a && (o === !0 || o === void 0 || o === "hover" && g || p) ? /* @__PURE__ */ s(
|
|
300
300
|
b,
|
|
301
301
|
{
|
|
302
|
-
ref:
|
|
302
|
+
ref: C,
|
|
303
303
|
style: {
|
|
304
304
|
position: "absolute",
|
|
305
305
|
right: 0,
|
|
@@ -315,7 +315,7 @@ const te = (e, n, t = !1) => {
|
|
|
315
315
|
}), Ae = m((e, n) => {
|
|
316
316
|
const { className: t, autoFocus: o, onFocus: r, onBlur: i, editor: l, editable: a, ...u } = e;
|
|
317
317
|
return d(u, !1), /* @__PURE__ */ s(
|
|
318
|
-
|
|
318
|
+
Ft,
|
|
319
319
|
{
|
|
320
320
|
autoFocus: o,
|
|
321
321
|
className: t,
|
|
@@ -347,31 +347,41 @@ const te = (e, n, t = !1) => {
|
|
|
347
347
|
className: t,
|
|
348
348
|
name: o,
|
|
349
349
|
label: r,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
350
|
+
variant: i,
|
|
351
|
+
icon: l,
|
|
352
|
+
value: a,
|
|
353
|
+
autoFocus: u,
|
|
354
|
+
placeholder: c,
|
|
355
|
+
disabled: g,
|
|
356
|
+
onKeyDown: h,
|
|
357
|
+
onChange: p,
|
|
358
|
+
onSubmit: C,
|
|
359
|
+
autoComplete: y,
|
|
360
|
+
rightSection: k,
|
|
361
|
+
...x
|
|
358
362
|
} = e;
|
|
359
|
-
return d(
|
|
363
|
+
return d(x), /* @__PURE__ */ s(
|
|
360
364
|
Q,
|
|
361
365
|
{
|
|
362
366
|
size: "xs",
|
|
363
|
-
className:
|
|
367
|
+
className: z(
|
|
368
|
+
t || "",
|
|
369
|
+
i === "large" ? "bn-mt-input-large" : ""
|
|
370
|
+
),
|
|
364
371
|
ref: n,
|
|
365
372
|
name: o,
|
|
366
373
|
label: r,
|
|
367
|
-
leftSection:
|
|
368
|
-
value:
|
|
369
|
-
autoFocus:
|
|
370
|
-
"data-autofocus":
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
374
|
+
leftSection: l,
|
|
375
|
+
value: a,
|
|
376
|
+
autoFocus: u,
|
|
377
|
+
"data-autofocus": u ? "true" : void 0,
|
|
378
|
+
rightSection: k,
|
|
379
|
+
placeholder: c,
|
|
380
|
+
disabled: g,
|
|
381
|
+
onKeyDown: h,
|
|
382
|
+
onChange: p,
|
|
383
|
+
onSubmit: C,
|
|
384
|
+
autoComplete: y
|
|
375
385
|
}
|
|
376
386
|
);
|
|
377
387
|
});
|
|
@@ -381,7 +391,7 @@ var oe = {
|
|
|
381
391
|
className: void 0,
|
|
382
392
|
style: void 0,
|
|
383
393
|
attr: void 0
|
|
384
|
-
},
|
|
394
|
+
}, H = T.createContext && /* @__PURE__ */ T.createContext(oe), Ge = ["attr", "size", "title"];
|
|
385
395
|
function He(e, n) {
|
|
386
396
|
if (e == null) return {};
|
|
387
397
|
var t = Ke(e, n), o, r;
|
|
@@ -412,7 +422,7 @@ function F() {
|
|
|
412
422
|
return e;
|
|
413
423
|
}, F.apply(this, arguments);
|
|
414
424
|
}
|
|
415
|
-
function
|
|
425
|
+
function K(e, n) {
|
|
416
426
|
var t = Object.keys(e);
|
|
417
427
|
if (Object.getOwnPropertySymbols) {
|
|
418
428
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -422,12 +432,12 @@ function H(e, n) {
|
|
|
422
432
|
}
|
|
423
433
|
return t;
|
|
424
434
|
}
|
|
425
|
-
function
|
|
435
|
+
function O(e) {
|
|
426
436
|
for (var n = 1; n < arguments.length; n++) {
|
|
427
437
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
428
|
-
n % 2 ?
|
|
438
|
+
n % 2 ? K(Object(t), !0).forEach(function(o) {
|
|
429
439
|
Ue(e, o, t[o]);
|
|
430
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) :
|
|
440
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : K(Object(t)).forEach(function(o) {
|
|
431
441
|
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
|
|
432
442
|
});
|
|
433
443
|
}
|
|
@@ -451,13 +461,13 @@ function qe(e, n) {
|
|
|
451
461
|
return (n === "string" ? String : Number)(e);
|
|
452
462
|
}
|
|
453
463
|
function re(e) {
|
|
454
|
-
return e && e.map((n, t) => /* @__PURE__ */
|
|
464
|
+
return e && e.map((n, t) => /* @__PURE__ */ T.createElement(n.tag, O({
|
|
455
465
|
key: t
|
|
456
466
|
}, n.attr), re(n.child)));
|
|
457
467
|
}
|
|
458
468
|
function se(e) {
|
|
459
|
-
return (n) => /* @__PURE__ */
|
|
460
|
-
attr:
|
|
469
|
+
return (n) => /* @__PURE__ */ T.createElement(Ze, F({
|
|
470
|
+
attr: O({}, e.attr)
|
|
461
471
|
}, n), re(e.child));
|
|
462
472
|
}
|
|
463
473
|
function Ze(e) {
|
|
@@ -467,21 +477,21 @@ function Ze(e) {
|
|
|
467
477
|
size: r,
|
|
468
478
|
title: i
|
|
469
479
|
} = e, l = He(e, Ge), a = r || t.size || "1em", u;
|
|
470
|
-
return t.className && (u = t.className), e.className && (u = (u ? u + " " : "") + e.className), /* @__PURE__ */
|
|
480
|
+
return t.className && (u = t.className), e.className && (u = (u ? u + " " : "") + e.className), /* @__PURE__ */ T.createElement("svg", F({
|
|
471
481
|
stroke: "currentColor",
|
|
472
482
|
fill: "currentColor",
|
|
473
483
|
strokeWidth: "0"
|
|
474
484
|
}, t.attr, o, l, {
|
|
475
485
|
className: u,
|
|
476
|
-
style:
|
|
486
|
+
style: O(O({
|
|
477
487
|
color: e.color || t.color
|
|
478
488
|
}, t.style), e.style),
|
|
479
489
|
height: a,
|
|
480
490
|
width: a,
|
|
481
491
|
xmlns: "http://www.w3.org/2000/svg"
|
|
482
|
-
}), i && /* @__PURE__ */
|
|
492
|
+
}), i && /* @__PURE__ */ T.createElement("title", null, i), e.children);
|
|
483
493
|
};
|
|
484
|
-
return
|
|
494
|
+
return H !== void 0 ? /* @__PURE__ */ T.createElement(H.Consumer, null, (t) => n(t)) : n(oe);
|
|
485
495
|
}
|
|
486
496
|
function Je(e) {
|
|
487
497
|
return se({ 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);
|
|
@@ -489,7 +499,7 @@ function Je(e) {
|
|
|
489
499
|
function Qe(e) {
|
|
490
500
|
return se({ 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);
|
|
491
501
|
}
|
|
492
|
-
const ie =
|
|
502
|
+
const ie = Me(void 0), Xe = m((e, n) => {
|
|
493
503
|
const {
|
|
494
504
|
children: t,
|
|
495
505
|
onOpenChange: o,
|
|
@@ -499,7 +509,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
499
509
|
...l
|
|
500
510
|
} = e;
|
|
501
511
|
d(l);
|
|
502
|
-
const [a, u] =
|
|
512
|
+
const [a, u] = A(!1), c = P(null), g = P(), h = E(() => {
|
|
503
513
|
g.current && clearTimeout(g.current), g.current = setTimeout(() => {
|
|
504
514
|
u(!1);
|
|
505
515
|
}, 250);
|
|
@@ -517,7 +527,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
517
527
|
S.Item,
|
|
518
528
|
{
|
|
519
529
|
className: "bn-menu-item bn-mt-sub-menu-item",
|
|
520
|
-
ref:
|
|
530
|
+
ref: R(n, c),
|
|
521
531
|
onMouseOver: p,
|
|
522
532
|
onMouseLeave: h,
|
|
523
533
|
children: /* @__PURE__ */ s(
|
|
@@ -624,7 +634,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
624
634
|
...g
|
|
625
635
|
} = e;
|
|
626
636
|
return d(g, !1), r ? /* @__PURE__ */ s(
|
|
627
|
-
|
|
637
|
+
j,
|
|
628
638
|
{
|
|
629
639
|
size: 24,
|
|
630
640
|
className: t,
|
|
@@ -638,7 +648,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
638
648
|
children: r
|
|
639
649
|
}
|
|
640
650
|
) : /* @__PURE__ */ s(
|
|
641
|
-
|
|
651
|
+
N,
|
|
642
652
|
{
|
|
643
653
|
className: t,
|
|
644
654
|
ref: n,
|
|
@@ -662,15 +672,15 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
662
672
|
...u
|
|
663
673
|
} = e;
|
|
664
674
|
return d(u), /* @__PURE__ */ s(b, { className: t, ref: n, children: /* @__PURE__ */ v(
|
|
665
|
-
|
|
675
|
+
M,
|
|
666
676
|
{
|
|
667
677
|
value: i,
|
|
668
678
|
defaultValue: r,
|
|
669
679
|
onChange: l,
|
|
670
680
|
children: [
|
|
671
681
|
a && /* @__PURE__ */ s(Se, { visible: a }),
|
|
672
|
-
/* @__PURE__ */ s(
|
|
673
|
-
|
|
682
|
+
/* @__PURE__ */ s(M.List, { children: o.map((c) => /* @__PURE__ */ s(
|
|
683
|
+
M.Tab,
|
|
674
684
|
{
|
|
675
685
|
"data-test": `${c.name.toLowerCase()}-tab`,
|
|
676
686
|
value: c.name,
|
|
@@ -678,14 +688,14 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
678
688
|
},
|
|
679
689
|
c.name
|
|
680
690
|
)) }),
|
|
681
|
-
o.map((c) => /* @__PURE__ */ s(
|
|
691
|
+
o.map((c) => /* @__PURE__ */ s(M.Panel, { value: c.name, children: c.tabPanel }, c.name))
|
|
682
692
|
]
|
|
683
693
|
}
|
|
684
694
|
) });
|
|
685
695
|
}), at = m((e, n) => {
|
|
686
696
|
const { className: t, children: o, onClick: r, label: i, ...l } = e;
|
|
687
697
|
return d(l), /* @__PURE__ */ s(
|
|
688
|
-
|
|
698
|
+
N,
|
|
689
699
|
{
|
|
690
700
|
size: "xs",
|
|
691
701
|
"aria-label": i,
|
|
@@ -770,7 +780,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
770
780
|
...g
|
|
771
781
|
} = e;
|
|
772
782
|
return d(g, !1), r ? /* @__PURE__ */ s(
|
|
773
|
-
|
|
783
|
+
j,
|
|
774
784
|
{
|
|
775
785
|
size: 24,
|
|
776
786
|
className: t,
|
|
@@ -784,7 +794,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
784
794
|
children: r
|
|
785
795
|
}
|
|
786
796
|
) : /* @__PURE__ */ s(
|
|
787
|
-
|
|
797
|
+
N,
|
|
788
798
|
{
|
|
789
799
|
className: t,
|
|
790
800
|
ref: n,
|
|
@@ -800,7 +810,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
800
810
|
}), bt = m((e, n) => {
|
|
801
811
|
const { className: t, children: o, id: r, ...i } = e;
|
|
802
812
|
return d(i), /* @__PURE__ */ s(
|
|
803
|
-
|
|
813
|
+
$,
|
|
804
814
|
{
|
|
805
815
|
gap: 0,
|
|
806
816
|
className: t,
|
|
@@ -816,13 +826,14 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
816
826
|
}), vt = m((e, n) => {
|
|
817
827
|
const { className: t, isSelected: o, onClick: r, item: i, id: l, ...a } = e;
|
|
818
828
|
d(a);
|
|
819
|
-
const u =
|
|
820
|
-
return
|
|
829
|
+
const u = P(null);
|
|
830
|
+
return _(() => {
|
|
821
831
|
if (!u.current || !o)
|
|
822
832
|
return;
|
|
823
833
|
const c = q(
|
|
824
834
|
u.current,
|
|
825
|
-
document.querySelector(".bn-suggestion-menu")
|
|
835
|
+
document.querySelector(".bn-suggestion-menu, #ai-suggestion-menu")
|
|
836
|
+
// TODO
|
|
826
837
|
);
|
|
827
838
|
c === "top" ? u.current.scrollIntoView(!0) : c === "bottom" && u.current.scrollIntoView(!1);
|
|
828
839
|
}, [o]), /* @__PURE__ */ v(
|
|
@@ -830,9 +841,10 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
830
841
|
{
|
|
831
842
|
gap: 0,
|
|
832
843
|
className: t,
|
|
833
|
-
ref:
|
|
844
|
+
ref: R(n, u),
|
|
834
845
|
id: l,
|
|
835
846
|
role: "option",
|
|
847
|
+
onMouseDown: (c) => c.preventDefault(),
|
|
836
848
|
onClick: r,
|
|
837
849
|
"aria-selected": o || void 0,
|
|
838
850
|
children: [
|
|
@@ -844,9 +856,9 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
844
856
|
children: i.icon
|
|
845
857
|
}
|
|
846
858
|
),
|
|
847
|
-
/* @__PURE__ */ v(
|
|
848
|
-
/* @__PURE__ */ s(
|
|
849
|
-
/* @__PURE__ */ s(
|
|
859
|
+
/* @__PURE__ */ v($, { gap: 0, className: "bn-mt-suggestion-menu-item-body", children: [
|
|
860
|
+
/* @__PURE__ */ s(w, { className: "bn-mt-suggestion-menu-item-title", children: i.title }),
|
|
861
|
+
/* @__PURE__ */ s(w, { className: "bn-mt-suggestion-menu-item-subtitle", children: i.subtext })
|
|
850
862
|
] }),
|
|
851
863
|
i.badge && /* @__PURE__ */ s(
|
|
852
864
|
b,
|
|
@@ -863,13 +875,8 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
863
875
|
const { className: t, children: o, ...r } = e;
|
|
864
876
|
return d(r), /* @__PURE__ */ s(b, { className: t, ref: n, children: o });
|
|
865
877
|
}), yt = m((e, n) => {
|
|
866
|
-
const {
|
|
867
|
-
|
|
868
|
-
children: o,
|
|
869
|
-
// unused, using "dots" instead
|
|
870
|
-
...r
|
|
871
|
-
} = e;
|
|
872
|
-
return d(r), /* @__PURE__ */ s(Y, { className: t, type: "dots", ref: n });
|
|
878
|
+
const { className: t, ...o } = e;
|
|
879
|
+
return d(o), /* @__PURE__ */ s(Y, { className: t, type: "dots", size: 16, ref: n });
|
|
873
880
|
}), xt = m((e, n) => {
|
|
874
881
|
const { className: t, children: o, id: r, columns: i, ...l } = e;
|
|
875
882
|
return d(l), /* @__PURE__ */ s(
|
|
@@ -897,8 +904,8 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
897
904
|
}), wt = m((e, n) => {
|
|
898
905
|
const { className: t, isSelected: o, onClick: r, item: i, id: l, ...a } = e;
|
|
899
906
|
d(a);
|
|
900
|
-
const u =
|
|
901
|
-
return
|
|
907
|
+
const u = P(null);
|
|
908
|
+
return _(() => {
|
|
902
909
|
if (!u.current || !o)
|
|
903
910
|
return;
|
|
904
911
|
const c = q(
|
|
@@ -910,7 +917,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
910
917
|
"div",
|
|
911
918
|
{
|
|
912
919
|
className: t,
|
|
913
|
-
ref:
|
|
920
|
+
ref: R(n, u),
|
|
914
921
|
id: l,
|
|
915
922
|
role: "option",
|
|
916
923
|
onClick: r,
|
|
@@ -938,7 +945,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
938
945
|
}), Nt = m((e, n) => {
|
|
939
946
|
const { children: t, className: o, onMouseDown: r, onClick: i, ...l } = e;
|
|
940
947
|
return d(l, !1), /* @__PURE__ */ s(
|
|
941
|
-
|
|
948
|
+
N,
|
|
942
949
|
{
|
|
943
950
|
className: o,
|
|
944
951
|
ref: n,
|
|
@@ -960,7 +967,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
960
967
|
...c
|
|
961
968
|
} = e;
|
|
962
969
|
return d(c, !1), /* @__PURE__ */ s(
|
|
963
|
-
|
|
970
|
+
N,
|
|
964
971
|
{
|
|
965
972
|
className: t,
|
|
966
973
|
ref: n,
|
|
@@ -984,7 +991,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
984
991
|
...a
|
|
985
992
|
} = e;
|
|
986
993
|
d(a);
|
|
987
|
-
const { ref: u, focused: c } = ee(), g = Oe(c), h =
|
|
994
|
+
const { ref: u, focused: c } = ee(), g = Oe(c), h = R(n, u, g);
|
|
988
995
|
return /* @__PURE__ */ s(
|
|
989
996
|
Ne,
|
|
990
997
|
{
|
|
@@ -1013,7 +1020,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
1013
1020
|
middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
|
|
1014
1021
|
children: [
|
|
1015
1022
|
/* @__PURE__ */ s(S.Target, { children: /* @__PURE__ */ s(
|
|
1016
|
-
|
|
1023
|
+
N,
|
|
1017
1024
|
{
|
|
1018
1025
|
onMouseDown: (a) => {
|
|
1019
1026
|
B() && a.currentTarget.focus();
|
|
@@ -1118,21 +1125,21 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
1118
1125
|
CardSection: Ee,
|
|
1119
1126
|
ExpandSectionsPrompt: ze
|
|
1120
1127
|
}
|
|
1121
|
-
},
|
|
1128
|
+
}, Mt = {
|
|
1122
1129
|
// Removes button press effect
|
|
1123
1130
|
activeClassName: ""
|
|
1124
|
-
},
|
|
1131
|
+
}, Ft = (e) => {
|
|
1125
1132
|
const { className: n, theme: t, ...o } = e, r = me(), i = fe(), l = (r == null ? void 0 : r.colorSchemePreference) || i, a = E(
|
|
1126
1133
|
(c) => {
|
|
1127
1134
|
if (c && (Ie(c), typeof t == "object")) {
|
|
1128
1135
|
if ("light" in t && "dark" in t) {
|
|
1129
|
-
|
|
1136
|
+
G(
|
|
1130
1137
|
t[l === "dark" ? "dark" : "light"],
|
|
1131
1138
|
c
|
|
1132
1139
|
);
|
|
1133
1140
|
return;
|
|
1134
1141
|
}
|
|
1135
|
-
|
|
1142
|
+
G(t, c);
|
|
1136
1143
|
return;
|
|
1137
1144
|
}
|
|
1138
1145
|
},
|
|
@@ -1141,7 +1148,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
1141
1148
|
return /* @__PURE__ */ s(ge.Provider, { value: Pt, children: /* @__PURE__ */ s(
|
|
1142
1149
|
ke,
|
|
1143
1150
|
{
|
|
1144
|
-
theme:
|
|
1151
|
+
theme: Mt,
|
|
1145
1152
|
cssVariablesSelector: ".bn-mantine",
|
|
1146
1153
|
getRootElement: () => {
|
|
1147
1154
|
},
|
|
@@ -1149,7 +1156,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
1149
1156
|
he,
|
|
1150
1157
|
{
|
|
1151
1158
|
"data-mantine-color-scheme": u,
|
|
1152
|
-
className:
|
|
1159
|
+
className: z("bn-mantine", n || ""),
|
|
1153
1160
|
theme: typeof t == "object" ? void 0 : t,
|
|
1154
1161
|
...o,
|
|
1155
1162
|
ref: a
|
|
@@ -1168,7 +1175,7 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
1168
1175
|
"#161616",
|
|
1169
1176
|
"#0F0F0F",
|
|
1170
1177
|
"#000000"
|
|
1171
|
-
],
|
|
1178
|
+
], U = {
|
|
1172
1179
|
colors: {
|
|
1173
1180
|
editor: {
|
|
1174
1181
|
text: f[5],
|
|
@@ -1232,16 +1239,16 @@ const ie = Fe(void 0), Xe = m((e, n) => {
|
|
|
1232
1239
|
sideMenu: f[4],
|
|
1233
1240
|
highlights: le
|
|
1234
1241
|
},
|
|
1235
|
-
borderRadius:
|
|
1236
|
-
fontFamily:
|
|
1242
|
+
borderRadius: U.borderRadius,
|
|
1243
|
+
fontFamily: U.fontFamily
|
|
1237
1244
|
};
|
|
1238
1245
|
export {
|
|
1239
|
-
|
|
1240
|
-
|
|
1246
|
+
Ft as BlockNoteView,
|
|
1247
|
+
G as applyBlockNoteCSSVariablesFromTheme,
|
|
1241
1248
|
Pt as components,
|
|
1242
1249
|
Et as darkDefaultTheme,
|
|
1243
1250
|
f as defaultColorScheme,
|
|
1244
|
-
|
|
1251
|
+
U as lightDefaultTheme,
|
|
1245
1252
|
Ie as removeBlockNoteCSSVariables
|
|
1246
1253
|
};
|
|
1247
1254
|
//# sourceMappingURL=blocknote-mantine.js.map
|