@blocknote/mantine 0.51.3 → 0.52.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,12 +1,11 @@
1
1
  import { COLORS_DARK_MODE_DEFAULT as e, COLORS_DEFAULT as t, assertEmpty as n, isSafari as r, mergeCSSClasses as i } from "@blocknote/core";
2
2
  import { BlockNoteViewRaw as a, ComponentsContext as o, FormattingToolbar as s, FormattingToolbarController as c, elementOverflow as l, getFormattingToolbarItems as u, mergeRefs as d, useBlockNoteContext as f, useDictionary as p, usePrefersColorScheme as m } from "@blocknote/react";
3
- import { ActionIcon as h, Avatar as g, Badge as _, Button as v, Card as y, CheckIcon as b, Chip as ee, Divider as te, FileInput as ne, Flex as re, Group as x, Loader as S, LoadingOverlay as ie, MantineContext as C, MantineProvider as ae, Menu as w, Popover as oe, PopoverDropdown as se, PopoverTarget as ce, Skeleton as T, Stack as E, Tabs as D, Text as O, TextInput as k, Tooltip as A } from "@mantine/core";
4
- import { createContext as le, forwardRef as j, useCallback as ue, useContext as M, useEffect as N, useRef as P, useState as F } from "react";
5
- import { jsx as I, jsxs as L } from "react/jsx-runtime";
6
- import { mergeRefs as R, useFocusTrap as de, useFocusWithin as z, useHover as B } from "@mantine/hooks";
7
- import { HiChevronDown as V } from "react-icons/hi";
3
+ import { ActionIcon as h, Avatar as g, Badge as _, Button as v, Card as y, CheckIcon as ee, Chip as te, Divider as ne, FileInput as re, Flex as ie, Group as b, Loader as x, LoadingOverlay as ae, MantineContext as oe, MantineProvider as se, Menu as S, Popover as ce, PopoverDropdown as le, PopoverTarget as ue, Skeleton as C, Stack as w, Tabs as T, Text as E, TextInput as D, Tooltip as O } from "@mantine/core";
4
+ import k, { createContext as de, forwardRef as A, useCallback as fe, useContext as j, useEffect as M, useRef as N, useState as P } from "react";
5
+ import { jsx as F, jsxs as I } from "react/jsx-runtime";
6
+ import { mergeRefs as L, useFocusTrap as pe, useFocusWithin as me, useHover as he } from "@mantine/hooks";
8
7
  //#region src/BlockNoteTheme.ts
9
- var H = (e, t, n = !1) => {
8
+ var R = (e, t, n = !1) => {
10
9
  let r = [];
11
10
  function i(e, r = "--bn") {
12
11
  for (let a in e) {
@@ -15,7 +14,7 @@ var H = (e, t, n = !1) => {
15
14
  }
16
15
  }
17
16
  return i(e), r;
18
- }, U = (e, t) => H(e, t), fe = {
17
+ }, z = (e, t) => R(e, t), ge = {
19
18
  colors: {
20
19
  editor: {
21
20
  text: void 0,
@@ -85,22 +84,22 @@ var H = (e, t, n = !1) => {
85
84
  },
86
85
  borderRadius: void 0,
87
86
  fontFamily: void 0
88
- }, W = (e) => H(fe, e, !0), G = (e) => /* @__PURE__ */ L(E, {
87
+ }, B = (e) => R(ge, e, !0), V = (e) => /* @__PURE__ */ I(w, {
89
88
  gap: 0,
90
89
  className: "bn-tooltip",
91
- children: [/* @__PURE__ */ I(O, {
90
+ children: [/* @__PURE__ */ F(E, {
92
91
  size: "sm",
93
92
  lineClamp: 5,
94
93
  children: e.mainTooltip
95
- }), e.secondaryTooltip && /* @__PURE__ */ I(O, {
94
+ }), e.secondaryTooltip && /* @__PURE__ */ F(E, {
96
95
  size: "xs",
97
96
  lineClamp: 5,
98
97
  children: e.secondaryTooltip
99
98
  })]
100
- }), K = j((e, t) => {
99
+ }), H = A((e, t) => {
101
100
  let { className: i, children: a, mainTooltip: o, secondaryTooltip: s, icon: c, isSelected: l, isDisabled: u, onClick: d, label: f, variant: p, ...m } = e;
102
101
  n(m, !1);
103
- let [g, _] = F(!1), y = a ? /* @__PURE__ */ I(v, {
102
+ let [g, _] = P(!1), y = a ? /* @__PURE__ */ F(v, {
104
103
  "aria-label": f,
105
104
  className: i,
106
105
  onMouseDown: (e) => {
@@ -118,7 +117,7 @@ var H = (e, t, n = !1) => {
118
117
  ref: t,
119
118
  ...m,
120
119
  children: a
121
- }) : /* @__PURE__ */ I(h, {
120
+ }) : /* @__PURE__ */ F(h, {
122
121
  className: i,
123
122
  "aria-label": f,
124
123
  onMouseDown: (e) => {
@@ -137,19 +136,19 @@ var H = (e, t, n = !1) => {
137
136
  ...m,
138
137
  children: c
139
138
  });
140
- return o ? /* @__PURE__ */ I(A, {
139
+ return o ? /* @__PURE__ */ F(O, {
141
140
  disabled: g,
142
141
  withinPortal: !1,
143
- label: /* @__PURE__ */ I(G, {
142
+ label: /* @__PURE__ */ F(V, {
144
143
  mainTooltip: o,
145
144
  secondaryTooltip: s
146
145
  }),
147
146
  children: y
148
147
  }) : y;
149
- }), pe = j((e, t) => {
148
+ }), _e = A((e, t) => {
150
149
  let { className: r, text: i, icon: a, isSelected: o, mainTooltip: s, secondaryTooltip: c, onClick: l, onMouseEnter: u, ...d } = e;
151
150
  n(d, !1);
152
- let [f, p] = F(!1), m = /* @__PURE__ */ L(ee, {
151
+ let [f, p] = P(!1), m = /* @__PURE__ */ I(te, {
153
152
  className: r,
154
153
  checked: o === !0,
155
154
  wrapperProps: {
@@ -162,69 +161,69 @@ var H = (e, t, n = !1) => {
162
161
  variant: "light",
163
162
  icon: null,
164
163
  ref: t,
165
- children: [/* @__PURE__ */ I("span", { children: a }), /* @__PURE__ */ I("span", { children: i })]
164
+ children: [/* @__PURE__ */ F("span", { children: a }), /* @__PURE__ */ F("span", { children: i })]
166
165
  });
167
- return !s || f ? m : /* @__PURE__ */ I(A, {
166
+ return !s || f ? m : /* @__PURE__ */ F(O, {
168
167
  refProp: "rootRef",
169
168
  withinPortal: !1,
170
- label: /* @__PURE__ */ I(G, {
169
+ label: /* @__PURE__ */ F(V, {
171
170
  mainTooltip: s,
172
171
  secondaryTooltip: c
173
172
  }),
174
173
  children: m
175
174
  });
176
- }), me = j((e, t) => {
175
+ }), ve = A((e, t) => {
177
176
  let { className: r, children: i, ...a } = e;
178
- return n(a), /* @__PURE__ */ I(x, {
177
+ return n(a), /* @__PURE__ */ F(b, {
179
178
  className: r,
180
179
  ref: t,
181
180
  children: i
182
181
  });
183
- }), he = j((e, t) => {
182
+ }), ye = A((e, t) => {
184
183
  let { className: r, children: a, headerText: o, selected: s, onFocus: c, onBlur: l, tabIndex: u, ...d } = e;
185
- return n(d, !1), /* @__PURE__ */ L(y, {
184
+ return n(d, !1), /* @__PURE__ */ I(y, {
186
185
  className: i(r, s ? "selected" : ""),
187
186
  onFocus: c,
188
187
  onBlur: l,
189
188
  tabIndex: u,
190
189
  ref: t,
191
- children: [o && /* @__PURE__ */ I(O, {
190
+ children: [o && /* @__PURE__ */ F(E, {
192
191
  className: "bn-header-text",
193
192
  children: o
194
193
  }), a]
195
194
  });
196
- }), ge = j((e, t) => {
195
+ }), be = A((e, t) => {
197
196
  let { className: r, children: i, ...a } = e;
198
- return n(a, !1), /* @__PURE__ */ I(y.Section, {
197
+ return n(a, !1), /* @__PURE__ */ F(y.Section, {
199
198
  className: r,
200
199
  ref: t,
201
200
  children: i
202
201
  });
203
- }), _e = j((e, t) => {
202
+ }), xe = A((e, t) => {
204
203
  let { className: r, children: i, ...a } = e;
205
- return n(a, !1), /* @__PURE__ */ I(te, {
204
+ return n(a, !1), /* @__PURE__ */ F(ne, {
206
205
  className: r,
207
- label: /* @__PURE__ */ I(O, { children: i }),
206
+ label: /* @__PURE__ */ F(E, { children: i }),
208
207
  ref: t
209
208
  });
210
- }), ve = j((e, t) => {
209
+ }), Se = A((e, t) => {
211
210
  let { authorInfo: r, timeString: i, edited: a, ...o } = e, s = p();
212
- return n(o, !1), r === "loading" ? /* @__PURE__ */ L(x, { children: [/* @__PURE__ */ I(T, {
211
+ return n(o, !1), r === "loading" ? /* @__PURE__ */ I(b, { children: [/* @__PURE__ */ F(C, {
213
212
  height: 24,
214
213
  width: 24
215
- }), /* @__PURE__ */ I("div", { children: /* @__PURE__ */ I(T, {
214
+ }), /* @__PURE__ */ F("div", { children: /* @__PURE__ */ F(C, {
216
215
  height: 12,
217
216
  width: 100
218
- }) })] }) : /* @__PURE__ */ L(x, { children: [/* @__PURE__ */ I(g, {
217
+ }) })] }) : /* @__PURE__ */ I(b, { children: [/* @__PURE__ */ F(g, {
219
218
  src: r.avatarUrl,
220
219
  alt: r.username,
221
220
  radius: "xl",
222
221
  size: "sm",
223
222
  color: "initials"
224
- }), /* @__PURE__ */ L(O, {
223
+ }), /* @__PURE__ */ I(E, {
225
224
  fz: "sm",
226
225
  fw: "bold",
227
- children: [r.username, /* @__PURE__ */ L(O, {
226
+ children: [r.username, /* @__PURE__ */ I(E, {
228
227
  fz: "xs",
229
228
  c: "dimmed",
230
229
  span: !0,
@@ -236,14 +235,14 @@ var H = (e, t, n = !1) => {
236
235
  ]
237
236
  })]
238
237
  })] });
239
- }), ye = j((e, t) => {
240
- let { className: r, showActions: i, authorInfo: a, timeString: o, edited: s, actions: c, emojiPickerOpen: l, children: u, ...f } = e, { hovered: p, ref: m } = B(), h = d([t, m]);
241
- return n(f, !1), /* @__PURE__ */ L(x, {
238
+ }), Ce = A((e, t) => {
239
+ let { className: r, showActions: i, authorInfo: a, timeString: o, edited: s, actions: c, emojiPickerOpen: l, children: u, ...f } = e, { hovered: p, ref: m } = he(), h = d([t, m]);
240
+ return n(f, !1), /* @__PURE__ */ I(b, {
242
241
  pos: "relative",
243
242
  ref: h,
244
243
  className: r,
245
244
  children: [
246
- c && (i === !0 || i === void 0 || i === "hover" && p || l) ? /* @__PURE__ */ I(x, {
245
+ c && (i === !0 || i === void 0 || i === "hover" && p || l) ? /* @__PURE__ */ F(b, {
247
246
  style: {
248
247
  position: "absolute",
249
248
  right: 0,
@@ -252,15 +251,15 @@ var H = (e, t, n = !1) => {
252
251
  },
253
252
  children: c
254
253
  }) : null,
255
- /* @__PURE__ */ I(ve, { ...e }),
254
+ /* @__PURE__ */ F(Se, { ...e }),
256
255
  u
257
256
  ]
258
257
  });
259
- }), be = j((e, t) => {
258
+ }), we = A((e, t) => {
260
259
  let { className: r, autoFocus: i, onFocus: a, onBlur: o, editor: s, editable: l, ...u } = e;
261
260
  n(u, !1);
262
261
  let d = f();
263
- return /* @__PURE__ */ I(Z, {
262
+ return /* @__PURE__ */ F(mt, {
264
263
  autoFocus: i,
265
264
  className: r,
266
265
  editor: e.editor,
@@ -274,14 +273,14 @@ var H = (e, t, n = !1) => {
274
273
  ref: t,
275
274
  onFocus: a,
276
275
  onBlur: o,
277
- children: /* @__PURE__ */ I(c, { formattingToolbar: xe })
276
+ children: /* @__PURE__ */ F(c, { formattingToolbar: Te })
278
277
  });
279
- }), xe = () => /* @__PURE__ */ I(s, {
278
+ }), Te = () => /* @__PURE__ */ F(s, {
280
279
  blockTypeSelectItems: [],
281
280
  children: u([]).filter((e) => e.key !== "nestBlockButton" && e.key !== "unnestBlockButton")
282
- }), Se = j((e, t) => {
281
+ }), Ee = A((e, t) => {
283
282
  let { className: r, name: a, label: o, variant: s, icon: c, value: l, autoFocus: u, placeholder: d, disabled: f, onKeyDown: p, onChange: m, onSubmit: h, autoComplete: g, "aria-activedescendant": _, rightSection: v, ...y } = e;
284
- return n(y), /* @__PURE__ */ I(k, {
283
+ return n(y), /* @__PURE__ */ F(D, {
285
284
  size: "xs",
286
285
  className: i(r || "", s === "large" ? "bn-mt-input-large" : ""),
287
286
  ref: t,
@@ -300,9 +299,9 @@ var H = (e, t, n = !1) => {
300
299
  autoComplete: g,
301
300
  "aria-activedescendant": _
302
301
  });
303
- }), Ce = le(void 0), we = (e) => {
302
+ }), De = de(void 0), Oe = (e) => {
304
303
  let { children: t, onOpenChange: r, position: i, sub: a, ...o } = e;
305
- return n(o), a ? /* @__PURE__ */ I(w.Sub, {
304
+ return n(o), a ? /* @__PURE__ */ F(S.Sub, {
306
305
  transitionProps: {
307
306
  duration: 250,
308
307
  exitDelay: 250
@@ -317,7 +316,7 @@ var H = (e, t, n = !1) => {
317
316
  onChange: r,
318
317
  position: i,
319
318
  children: t
320
- }) : /* @__PURE__ */ I(w, {
319
+ }) : /* @__PURE__ */ F(S, {
321
320
  withinPortal: !1,
322
321
  middlewares: {
323
322
  flip: !0,
@@ -330,47 +329,47 @@ var H = (e, t, n = !1) => {
330
329
  returnFocus: !1,
331
330
  children: t
332
331
  });
333
- }, Te = j((e, t) => {
332
+ }, ke = A((e, t) => {
334
333
  let { className: r, children: i, icon: a, checked: o, subTrigger: s, onClick: c, ...l } = e;
335
- return n(l, !1), I(s ? w.Sub.Item : w.Item, {
334
+ return n(l, !1), F(s ? S.Sub.Item : S.Item, {
336
335
  className: r,
337
336
  ref: t,
338
337
  leftSection: a,
339
- rightSection: o ? /* @__PURE__ */ I(b, { size: 10 }) : o === !1 ? /* @__PURE__ */ I("div", { className: "bn-tick-space" }) : null,
338
+ rightSection: o ? /* @__PURE__ */ F(ee, { size: 10 }) : o === !1 ? /* @__PURE__ */ F("div", { className: "bn-tick-space" }) : null,
340
339
  onClick: c,
341
340
  ...l,
342
341
  children: i
343
342
  });
344
- }), Ee = (e) => {
343
+ }), Ae = (e) => {
345
344
  let { children: t, sub: r, ...i } = e;
346
- return n(i), I(r ? w.Sub.Target : w.Target, { children: t });
347
- }, De = j((e, t) => {
345
+ return n(i), F(r ? S.Sub.Target : S.Target, { children: t });
346
+ }, je = A((e, t) => {
348
347
  let { className: r, children: i, sub: a, ...o } = e;
349
348
  n(o);
350
- let s = M(Ce);
351
- return I(a ? w.Sub.Dropdown : w.Dropdown, {
349
+ let s = j(De);
350
+ return F(a ? S.Sub.Dropdown : S.Dropdown, {
352
351
  className: r,
353
352
  ref: t,
354
353
  onMouseOver: s?.onMenuMouseOver,
355
354
  onMouseLeave: s?.onMenuMouseLeave,
356
355
  children: i
357
356
  });
358
- }), Oe = j((e, t) => {
357
+ }), Me = A((e, t) => {
359
358
  let { className: r, ...i } = e;
360
- return n(i), /* @__PURE__ */ I(w.Divider, {
359
+ return n(i), /* @__PURE__ */ F(S.Divider, {
361
360
  className: r,
362
361
  ref: t
363
362
  });
364
- }), ke = j((e, t) => {
363
+ }), Ne = A((e, t) => {
365
364
  let { className: r, children: i, ...a } = e;
366
- return n(a), /* @__PURE__ */ I(w.Label, {
365
+ return n(a), /* @__PURE__ */ F(S.Label, {
367
366
  className: r,
368
367
  ref: t,
369
368
  children: i
370
369
  });
371
- }), Ae = j((e, t) => {
370
+ }), Pe = A((e, t) => {
372
371
  let { className: r, children: i, icon: a, onClick: o, onDragEnd: s, onDragStart: c, draggable: l, label: u, ...d } = e;
373
- return n(d, !1), a ? /* @__PURE__ */ I(h, {
372
+ return n(d, !1), a ? /* @__PURE__ */ F(h, {
374
373
  size: 24,
375
374
  className: r,
376
375
  ref: t,
@@ -381,7 +380,7 @@ var H = (e, t, n = !1) => {
381
380
  "aria-label": u,
382
381
  ...d,
383
382
  children: a
384
- }) : /* @__PURE__ */ I(v, {
383
+ }) : /* @__PURE__ */ F(v, {
385
384
  className: r,
386
385
  ref: t,
387
386
  onClick: o,
@@ -392,32 +391,32 @@ var H = (e, t, n = !1) => {
392
391
  ...d,
393
392
  children: i
394
393
  });
395
- }), je = j((e, t) => {
394
+ }), Fe = A((e, t) => {
396
395
  let { className: r, tabs: i, defaultOpenTab: a, openTab: o, setOpenTab: s, loading: c, ...l } = e;
397
- return n(l), /* @__PURE__ */ I(x, {
396
+ return n(l), /* @__PURE__ */ F(b, {
398
397
  className: r,
399
398
  ref: t,
400
- children: /* @__PURE__ */ L(D, {
399
+ children: /* @__PURE__ */ I(T, {
401
400
  value: o,
402
401
  defaultValue: a,
403
402
  onChange: s,
404
403
  children: [
405
- c && /* @__PURE__ */ I(ie, { visible: c }),
406
- /* @__PURE__ */ I(D.List, { children: i.map((e) => /* @__PURE__ */ I(D.Tab, {
404
+ c && /* @__PURE__ */ F(ae, { visible: c }),
405
+ /* @__PURE__ */ F(T.List, { children: i.map((e) => /* @__PURE__ */ F(T.Tab, {
407
406
  "data-test": `${e.name.toLowerCase()}-tab`,
408
407
  value: e.name,
409
408
  children: e.name
410
409
  }, e.name)) }),
411
- i.map((e) => /* @__PURE__ */ I(D.Panel, {
410
+ i.map((e) => /* @__PURE__ */ F(T.Panel, {
412
411
  value: e.name,
413
412
  children: e.tabPanel
414
413
  }, e.name))
415
414
  ]
416
415
  })
417
416
  });
418
- }), Me = j((e, t) => {
417
+ }), Ie = A((e, t) => {
419
418
  let { className: r, children: i, onClick: a, label: o, ...s } = e;
420
- return n(s), /* @__PURE__ */ I(v, {
419
+ return n(s), /* @__PURE__ */ F(v, {
421
420
  size: "xs",
422
421
  "aria-label": o,
423
422
  className: r,
@@ -426,9 +425,9 @@ var H = (e, t, n = !1) => {
426
425
  ...s,
427
426
  children: i
428
427
  });
429
- }), Ne = j((e, t) => {
428
+ }), Le = A((e, t) => {
430
429
  let { className: r, accept: i, value: a, placeholder: o, onChange: s, ...c } = e;
431
- return n(c), /* @__PURE__ */ I(ne, {
430
+ return n(c), /* @__PURE__ */ F(re, {
432
431
  size: "xs",
433
432
  className: r,
434
433
  ref: t,
@@ -438,16 +437,16 @@ var H = (e, t, n = !1) => {
438
437
  onChange: s,
439
438
  ...c
440
439
  });
441
- }), Pe = j((e, t) => {
440
+ }), Re = A((e, t) => {
442
441
  let { className: r, children: i, ...a } = e;
443
- return n(a), /* @__PURE__ */ I("div", {
442
+ return n(a), /* @__PURE__ */ F("div", {
444
443
  className: r,
445
444
  ref: t,
446
445
  children: i
447
446
  });
448
- }), Fe = j((e, t) => {
447
+ }), ze = A((e, t) => {
449
448
  let { className: r, value: i, placeholder: a, onKeyDown: o, onChange: s, ...c } = e;
450
- return n(c), /* @__PURE__ */ I(k, {
449
+ return n(c), /* @__PURE__ */ F(D, {
451
450
  size: "xs",
452
451
  "data-test": "embed-input",
453
452
  className: r,
@@ -457,9 +456,9 @@ var H = (e, t, n = !1) => {
457
456
  onKeyDown: o,
458
457
  onChange: s
459
458
  });
460
- }), Ie = (e) => {
459
+ }), Be = (e) => {
461
460
  let { open: t, onOpenChange: r, position: i, portalRoot: a, children: o, ...s } = e;
462
- return n(s), /* @__PURE__ */ I(oe, {
461
+ return n(s), /* @__PURE__ */ F(ce, {
463
462
  middlewares: { size: { padding: 20 } },
464
463
  withinPortal: !!a,
465
464
  portalProps: a ? { target: a } : void 0,
@@ -468,19 +467,19 @@ var H = (e, t, n = !1) => {
468
467
  position: i,
469
468
  children: o
470
469
  });
471
- }, Le = (e) => {
470
+ }, Ve = (e) => {
472
471
  let { children: t, ...r } = e;
473
- return n(r), /* @__PURE__ */ I(ce, { children: t });
474
- }, Re = j((e, t) => {
472
+ return n(r), /* @__PURE__ */ F(ue, { children: t });
473
+ }, He = A((e, t) => {
475
474
  let { className: r, children: i, variant: a, ...o } = e;
476
- return n(o), /* @__PURE__ */ I(se, {
475
+ return n(o), /* @__PURE__ */ F(le, {
477
476
  className: r,
478
477
  ref: t,
479
478
  children: i
480
479
  });
481
- }), ze = j((e, t) => {
480
+ }), Ue = A((e, t) => {
482
481
  let { className: r, children: i, ...a } = e;
483
- return n(a, !1), /* @__PURE__ */ I(x, {
482
+ return n(a, !1), /* @__PURE__ */ F(b, {
484
483
  align: "center",
485
484
  gap: 0,
486
485
  className: r,
@@ -488,9 +487,9 @@ var H = (e, t, n = !1) => {
488
487
  ...a,
489
488
  children: i
490
489
  });
491
- }), Be = j((e, t) => {
490
+ }), We = A((e, t) => {
492
491
  let { className: r, children: i, icon: a, onClick: o, onDragEnd: s, onDragStart: c, draggable: l, label: u, ...d } = e;
493
- return n(d, !1), a ? /* @__PURE__ */ I(h, {
492
+ return n(d, !1), a ? /* @__PURE__ */ F(h, {
494
493
  size: 24,
495
494
  className: r,
496
495
  ref: t,
@@ -501,7 +500,7 @@ var H = (e, t, n = !1) => {
501
500
  "aria-label": u,
502
501
  ...d,
503
502
  children: a
504
- }) : /* @__PURE__ */ I(v, {
503
+ }) : /* @__PURE__ */ F(v, {
505
504
  className: r,
506
505
  ref: t,
507
506
  onClick: o,
@@ -512,9 +511,17 @@ var H = (e, t, n = !1) => {
512
511
  ...d,
513
512
  children: i
514
513
  });
515
- }), Ve = j((e, t) => {
514
+ }), Ge = A((e, t) => {
515
+ let { className: r, markClassName: a, backgroundColor: o, children: s, ...c } = e;
516
+ return n(c), /* @__PURE__ */ F("span", {
517
+ className: i(r || "", a || ""),
518
+ style: a ? void 0 : { backgroundColor: o },
519
+ ref: t,
520
+ children: s
521
+ });
522
+ }), Ke = A((e, t) => {
516
523
  let { className: r, children: i, id: a, ...o } = e;
517
- return n(o), /* @__PURE__ */ I(E, {
524
+ return n(o), /* @__PURE__ */ F(w, {
518
525
  gap: 0,
519
526
  className: r,
520
527
  ref: t,
@@ -522,78 +529,78 @@ var H = (e, t, n = !1) => {
522
529
  role: "listbox",
523
530
  children: i
524
531
  });
525
- }), He = j((e, t) => {
532
+ }), qe = A((e, t) => {
526
533
  let { className: r, children: i, ...a } = e;
527
- return n(a), /* @__PURE__ */ I(x, {
534
+ return n(a), /* @__PURE__ */ F(b, {
528
535
  className: r,
529
536
  ref: t,
530
- children: /* @__PURE__ */ I(x, {
537
+ children: /* @__PURE__ */ F(b, {
531
538
  className: "bn-mt-suggestion-menu-item-title",
532
539
  children: i
533
540
  })
534
541
  });
535
- }), Ue = j((e, t) => {
542
+ }), Je = A((e, t) => {
536
543
  let { className: r, isSelected: i, onClick: a, item: o, id: s, ...c } = e;
537
544
  n(c);
538
- let u = P(null);
539
- return N(() => {
545
+ let u = N(null);
546
+ return M(() => {
540
547
  !u.current || !i || l(u.current, u.current.closest(".bn-suggestion-menu, #ai-suggestion-menu")) !== "none" && u.current.scrollIntoView({ block: "nearest" });
541
- }, [i]), /* @__PURE__ */ L(x, {
548
+ }, [i]), /* @__PURE__ */ I(b, {
542
549
  gap: 0,
543
550
  className: r,
544
- ref: R(t, u),
551
+ ref: L(t, u),
545
552
  id: s,
546
553
  role: "option",
547
554
  onMouseDown: (e) => e.preventDefault(),
548
555
  onClick: a,
549
556
  "aria-selected": i || void 0,
550
557
  children: [
551
- o.icon && /* @__PURE__ */ I(x, {
558
+ o.icon && /* @__PURE__ */ F(b, {
552
559
  className: "bn-mt-suggestion-menu-item-section",
553
560
  "data-position": "left",
554
561
  children: o.icon
555
562
  }),
556
- /* @__PURE__ */ L(E, {
563
+ /* @__PURE__ */ I(w, {
557
564
  gap: 0,
558
565
  className: "bn-mt-suggestion-menu-item-body",
559
- children: [/* @__PURE__ */ I(O, {
566
+ children: [/* @__PURE__ */ F(E, {
560
567
  className: "bn-mt-suggestion-menu-item-title",
561
568
  children: o.title
562
- }), /* @__PURE__ */ I(O, {
569
+ }), /* @__PURE__ */ F(E, {
563
570
  className: "bn-mt-suggestion-menu-item-subtitle",
564
571
  children: o.subtext
565
572
  })]
566
573
  }),
567
- o.badge && /* @__PURE__ */ I(x, {
574
+ o.badge && /* @__PURE__ */ F(b, {
568
575
  "data-position": "right",
569
576
  className: "bn-mt-suggestion-menu-item-section",
570
- children: /* @__PURE__ */ I(_, {
577
+ children: /* @__PURE__ */ F(_, {
571
578
  size: "xs",
572
579
  children: o.badge
573
580
  })
574
581
  })
575
582
  ]
576
583
  });
577
- }), We = j((e, t) => {
584
+ }), Ye = A((e, t) => {
578
585
  let { className: r, children: i, ...a } = e;
579
- return n(a), /* @__PURE__ */ I(x, {
586
+ return n(a), /* @__PURE__ */ F(b, {
580
587
  className: r,
581
588
  ref: t,
582
589
  children: i
583
590
  });
584
- }), Ge = j((e, t) => {
591
+ }), Xe = A((e, t) => {
585
592
  let { className: r, ...i } = e;
586
- return n(i), /* @__PURE__ */ I("div", {
593
+ return n(i), /* @__PURE__ */ F("div", {
587
594
  ref: t,
588
- children: /* @__PURE__ */ I(S, {
595
+ children: /* @__PURE__ */ F(x, {
589
596
  className: r,
590
597
  type: "dots",
591
598
  size: 16
592
599
  })
593
600
  });
594
- }), Ke = j((e, t) => {
601
+ }), Ze = A((e, t) => {
595
602
  let { className: r, children: i, id: a, columns: o, ...s } = e;
596
- return n(s), /* @__PURE__ */ I("div", {
603
+ return n(s), /* @__PURE__ */ F("div", {
597
604
  className: r,
598
605
  style: { gridTemplateColumns: `repeat(${o}, 1fr)` },
599
606
  ref: t,
@@ -601,45 +608,45 @@ var H = (e, t, n = !1) => {
601
608
  role: "grid",
602
609
  children: i
603
610
  });
604
- }), qe = j((e, t) => {
611
+ }), Qe = A((e, t) => {
605
612
  let { className: r, children: i, columns: a, ...o } = e;
606
- return n(o), /* @__PURE__ */ I(x, {
613
+ return n(o), /* @__PURE__ */ F(b, {
607
614
  className: r,
608
615
  style: { gridColumn: `1 / ${a + 1}` },
609
616
  ref: t,
610
- children: /* @__PURE__ */ I(x, {
617
+ children: /* @__PURE__ */ F(b, {
611
618
  className: "bn-mt-suggestion-menu-item-title",
612
619
  children: i
613
620
  })
614
621
  });
615
- }), q = j((e, t) => {
622
+ }), $e = A((e, t) => {
616
623
  let { className: r, isSelected: i, onClick: a, item: o, id: s, ...c } = e;
617
624
  n(c);
618
- let u = P(null);
619
- return N(() => {
625
+ let u = N(null);
626
+ return M(() => {
620
627
  !u.current || !i || l(u.current, u.current.closest(".bn-grid-suggestion-menu")) !== "none" && u.current.scrollIntoView({ block: "nearest" });
621
- }, [i]), /* @__PURE__ */ I("div", {
628
+ }, [i]), /* @__PURE__ */ F("div", {
622
629
  className: r,
623
- ref: R(t, u),
630
+ ref: L(t, u),
624
631
  id: s,
625
632
  role: "option",
626
633
  onClick: a,
627
634
  "aria-selected": i || void 0,
628
635
  children: o.icon
629
636
  });
630
- }), Je = j((e, t) => {
637
+ }), et = A((e, t) => {
631
638
  let { className: r, children: i, columns: a, ...o } = e;
632
- return n(o), /* @__PURE__ */ I("div", {
639
+ return n(o), /* @__PURE__ */ F("div", {
633
640
  style: { gridColumn: `1 / ${a + 1}` },
634
641
  ref: t,
635
- children: /* @__PURE__ */ I(S, {
642
+ children: /* @__PURE__ */ F(x, {
636
643
  className: r,
637
644
  type: "dots"
638
645
  })
639
646
  });
640
- }), Ye = j((e, t) => {
647
+ }), tt = A((e, t) => {
641
648
  let { children: r, className: i, onMouseDown: a, onClick: o, ...s } = e;
642
- return n(s, !1), /* @__PURE__ */ I(v, {
649
+ return n(s, !1), /* @__PURE__ */ F(v, {
643
650
  className: i,
644
651
  ref: t,
645
652
  onMouseDown: a,
@@ -647,9 +654,9 @@ var H = (e, t, n = !1) => {
647
654
  ...s,
648
655
  children: r
649
656
  });
650
- }), Xe = j((e, t) => {
657
+ }), nt = A((e, t) => {
651
658
  let { className: r, children: i, draggable: a, onDragStart: o, onDragEnd: s, style: c, label: l, ...u } = e;
652
- return n(u, !1), /* @__PURE__ */ I(v, {
659
+ return n(u, !1), /* @__PURE__ */ F(v, {
653
660
  className: r,
654
661
  ref: t,
655
662
  "aria-label": l,
@@ -660,24 +667,151 @@ var H = (e, t, n = !1) => {
660
667
  ...u,
661
668
  children: i
662
669
  });
663
- }), J = j((e, t) => {
670
+ }), U = A((e, t) => {
664
671
  let { className: r, children: i, onMouseEnter: a, onMouseLeave: o, variant: s, ...c } = e;
665
672
  n(c);
666
- let { ref: l, focused: u } = z();
667
- return /* @__PURE__ */ I(re, {
673
+ let { ref: l, focused: u } = me();
674
+ return /* @__PURE__ */ F(ie, {
668
675
  className: r,
669
- ref: R(t, l, de(u)),
676
+ ref: L(t, l, pe(u)),
670
677
  role: "toolbar",
671
678
  onMouseEnter: a,
672
679
  onMouseLeave: o,
673
680
  gap: s === "action-toolbar" ? 2 : void 0,
674
681
  children: i
675
682
  });
676
- }), Y = j((e, t) => {
683
+ }), W = {
684
+ color: void 0,
685
+ size: void 0,
686
+ className: void 0,
687
+ style: void 0,
688
+ attr: void 0
689
+ }, G = k.createContext && /*#__PURE__*/ k.createContext(W), rt = [
690
+ "attr",
691
+ "size",
692
+ "title"
693
+ ];
694
+ function it(e, t) {
695
+ if (e == null) return {};
696
+ var n, r, i = at(e, t);
697
+ if (Object.getOwnPropertySymbols) {
698
+ var a = Object.getOwnPropertySymbols(e);
699
+ for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
700
+ }
701
+ return i;
702
+ }
703
+ function at(e, t) {
704
+ if (e == null) return {};
705
+ var n = {};
706
+ for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
707
+ if (t.indexOf(r) !== -1) continue;
708
+ n[r] = e[r];
709
+ }
710
+ return n;
711
+ }
712
+ function K() {
713
+ return K = Object.assign ? Object.assign.bind() : function(e) {
714
+ for (var t = 1; t < arguments.length; t++) {
715
+ var n = arguments[t];
716
+ for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
717
+ }
718
+ return e;
719
+ }, K.apply(null, arguments);
720
+ }
721
+ function q(e, t) {
722
+ var n = Object.keys(e);
723
+ if (Object.getOwnPropertySymbols) {
724
+ var r = Object.getOwnPropertySymbols(e);
725
+ t && (r = r.filter(function(t) {
726
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
727
+ })), n.push.apply(n, r);
728
+ }
729
+ return n;
730
+ }
731
+ function J(e) {
732
+ for (var t = 1; t < arguments.length; t++) {
733
+ var n = arguments[t] == null ? {} : arguments[t];
734
+ t % 2 ? q(Object(n), !0).forEach(function(t) {
735
+ ot(e, t, n[t]);
736
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : q(Object(n)).forEach(function(t) {
737
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
738
+ });
739
+ }
740
+ return e;
741
+ }
742
+ function ot(e, t, n) {
743
+ return (t = st(t)) in e ? Object.defineProperty(e, t, {
744
+ value: n,
745
+ enumerable: !0,
746
+ configurable: !0,
747
+ writable: !0
748
+ }) : e[t] = n, e;
749
+ }
750
+ function st(e) {
751
+ var t = ct(e, "string");
752
+ return typeof t == "symbol" ? t : t + "";
753
+ }
754
+ function ct(e, t) {
755
+ if (typeof e != "object" || !e) return e;
756
+ var n = e[Symbol.toPrimitive];
757
+ if (n !== void 0) {
758
+ var r = n.call(e, t || "default");
759
+ if (typeof r != "object") return r;
760
+ throw TypeError("@@toPrimitive must return a primitive value.");
761
+ }
762
+ return (t === "string" ? String : Number)(e);
763
+ }
764
+ function Y(e) {
765
+ return e && e.map((e, t) => /*#__PURE__*/ k.createElement(e.tag, J({ key: t }, e.attr), Y(e.child)));
766
+ }
767
+ function lt(e) {
768
+ return (t) => /*#__PURE__*/ k.createElement(ut, K({ attr: J({}, e.attr) }, t), Y(e.child));
769
+ }
770
+ function ut(e) {
771
+ var t = (t) => {
772
+ var { attr: n, size: r, title: i } = e, a = it(e, rt), o = r || t.size || "1em", s;
773
+ return t.className && (s = t.className), e.className && (s = (s ? s + " " : "") + e.className), /*#__PURE__*/ k.createElement("svg", K({
774
+ stroke: "currentColor",
775
+ fill: "currentColor",
776
+ strokeWidth: "0"
777
+ }, t.attr, n, a, {
778
+ className: s,
779
+ style: J(J({ color: e.color || t.color }, t.style), e.style),
780
+ height: o,
781
+ width: o,
782
+ xmlns: "http://www.w3.org/2000/svg"
783
+ }), i && /*#__PURE__*/ k.createElement("title", null, i), e.children);
784
+ };
785
+ return G === void 0 ? t(W) : /*#__PURE__*/ k.createElement(G.Consumer, null, (e) => t(e));
786
+ }
787
+ //#endregion
788
+ //#region ../../node_modules/.pnpm/react-icons@5.6.0_react@19.2.5/node_modules/react-icons/hi/index.mjs
789
+ function dt(e) {
790
+ return lt({
791
+ tag: "svg",
792
+ attr: {
793
+ viewBox: "0 0 20 20",
794
+ fill: "currentColor",
795
+ "aria-hidden": "true"
796
+ },
797
+ child: [{
798
+ tag: "path",
799
+ attr: {
800
+ fillRule: "evenodd",
801
+ 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",
802
+ clipRule: "evenodd"
803
+ },
804
+ child: []
805
+ }]
806
+ })(e);
807
+ }
808
+ //#endregion
809
+ //#region src/toolbar/ToolbarSelect.tsx
810
+ var X = A((e, t) => {
677
811
  let { className: i, items: a, isDisabled: o, ...s } = e;
678
812
  n(s);
679
813
  let c = a.filter((e) => e.isSelected)[0];
680
- return c ? /* @__PURE__ */ L(w, {
814
+ return c ? /* @__PURE__ */ I(S, {
681
815
  withinPortal: !1,
682
816
  transitionProps: { exitDuration: 0 },
683
817
  disabled: o,
@@ -687,118 +821,142 @@ var H = (e, t, n = !1) => {
687
821
  inline: !1,
688
822
  size: !0
689
823
  },
690
- children: [/* @__PURE__ */ I(w.Target, { children: /* @__PURE__ */ I(v, {
824
+ children: [/* @__PURE__ */ F(S.Target, { children: /* @__PURE__ */ F(v, {
691
825
  onMouseDown: (e) => {
692
826
  r() && e.currentTarget.focus();
693
827
  },
694
828
  leftSection: c.icon,
695
- rightSection: /* @__PURE__ */ I(V, {}),
829
+ rightSection: /* @__PURE__ */ F(dt, {}),
696
830
  size: "xs",
697
831
  variant: "subtle",
698
832
  disabled: o,
699
833
  children: c.text
700
- }) }), /* @__PURE__ */ I(w.Dropdown, {
834
+ }) }), /* @__PURE__ */ F(S.Dropdown, {
701
835
  className: i,
702
836
  ref: t,
703
- children: a.map((e) => /* @__PURE__ */ I(w.Item, {
837
+ children: a.map((e) => /* @__PURE__ */ F(S.Item, {
704
838
  onClick: e.onClick,
705
839
  leftSection: e.icon,
706
- rightSection: e.isSelected ? /* @__PURE__ */ I(b, {
840
+ rightSection: e.isSelected ? /* @__PURE__ */ F(ee, {
707
841
  size: 10,
708
842
  className: "bn-tick-icon"
709
- }) : /* @__PURE__ */ I("div", { className: "bn-tick-space" }),
843
+ }) : /* @__PURE__ */ F("div", { className: "bn-tick-space" }),
710
844
  disabled: e.isDisabled,
711
845
  children: e.text
712
846
  }, e.text))
713
847
  })]
714
848
  }) : null;
715
- }), X = {
849
+ }), ft = A((e, t) => {
850
+ let { className: r, children: a, ...o } = e;
851
+ return n(o, !1), /* @__PURE__ */ F("div", {
852
+ className: i(r),
853
+ ref: t,
854
+ children: a
855
+ });
856
+ }), pt = A((e, t) => {
857
+ let { className: r, selected: a, comparing: o, onClick: s, actions: c, children: l, ...u } = e;
858
+ return n(u, !1), /* @__PURE__ */ I("div", {
859
+ className: i(r, a ? "selected" : "", o ? "comparing" : ""),
860
+ onClick: s,
861
+ ref: t,
862
+ children: [l, c && /* @__PURE__ */ F("div", {
863
+ className: "bn-snapshot-menu",
864
+ onClick: (e) => e.stopPropagation(),
865
+ children: c
866
+ })]
867
+ });
868
+ }), Z = {
716
869
  FormattingToolbar: {
717
- Root: J,
718
- Button: K,
719
- Select: Y
870
+ Root: U,
871
+ Button: H,
872
+ Select: X
720
873
  },
721
874
  FilePanel: {
722
- Root: je,
723
- Button: Me,
724
- FileInput: Ne,
725
- TabPanel: Pe,
726
- TextInput: Fe
875
+ Root: Fe,
876
+ Button: Ie,
877
+ FileInput: Le,
878
+ TabPanel: Re,
879
+ TextInput: ze
727
880
  },
728
881
  GridSuggestionMenu: {
729
- Root: Ke,
730
- Item: q,
731
- EmptyItem: qe,
732
- Loader: Je
882
+ Root: Ze,
883
+ Item: $e,
884
+ EmptyItem: Qe,
885
+ Loader: et
733
886
  },
734
887
  LinkToolbar: {
735
- Root: J,
736
- Button: K,
737
- Select: Y
888
+ Root: U,
889
+ Button: H,
890
+ Select: X
738
891
  },
739
892
  SideMenu: {
740
- Root: ze,
741
- Button: Be
893
+ Root: Ue,
894
+ Button: We
742
895
  },
743
896
  SuggestionMenu: {
744
- Root: Ve,
745
- Item: Ue,
746
- EmptyItem: He,
747
- Label: We,
748
- Loader: Ge
897
+ Root: Ke,
898
+ Item: Je,
899
+ EmptyItem: qe,
900
+ Label: Ye,
901
+ Loader: Xe
749
902
  },
903
+ AttributionTooltip: { Root: Ge },
750
904
  TableHandle: {
751
- Root: Xe,
752
- ExtendButton: Ye
905
+ Root: nt,
906
+ ExtendButton: tt
753
907
  },
754
908
  Generic: {
755
909
  Badge: {
756
- Root: pe,
757
- Group: me
910
+ Root: _e,
911
+ Group: ve
758
912
  },
759
913
  Form: {
760
- Root: (e) => /* @__PURE__ */ I("div", { children: e.children }),
761
- TextInput: Se
914
+ Root: (e) => /* @__PURE__ */ F("div", { children: e.children }),
915
+ TextInput: Ee
762
916
  },
763
917
  Menu: {
764
- Root: we,
765
- Trigger: Ee,
766
- Dropdown: De,
767
- Divider: Oe,
768
- Label: ke,
769
- Item: Te,
770
- Button: Ae
918
+ Root: Oe,
919
+ Trigger: Ae,
920
+ Dropdown: je,
921
+ Divider: Me,
922
+ Label: Ne,
923
+ Item: ke,
924
+ Button: Pe
771
925
  },
772
926
  Popover: {
773
- Root: Ie,
774
- Trigger: Le,
775
- Content: Re
927
+ Root: Be,
928
+ Trigger: Ve,
929
+ Content: He
776
930
  },
777
931
  Toolbar: {
778
- Root: J,
779
- Button: K,
780
- Select: Y
932
+ Root: U,
933
+ Button: H,
934
+ Select: X
781
935
  }
782
936
  },
783
937
  Comments: {
784
- Comment: ye,
785
- Editor: be,
786
- Card: he,
787
- CardSection: ge,
788
- ExpandSectionsPrompt: _e
938
+ Comment: Ce,
939
+ Editor: we,
940
+ Card: ye,
941
+ CardSection: be,
942
+ ExpandSectionsPrompt: xe
943
+ },
944
+ Versioning: {
945
+ Sidebar: ft,
946
+ Snapshot: pt
789
947
  }
790
- }, Z = (e) => {
791
- let { className: t, theme: n, editor: r, ...s } = e, c = f(), l = m(), u = c?.colorSchemePreference || l, d = typeof n == "string" ? n : u === "no-preference" ? "light" : u, p = ue((e) => {
792
- if (e && (W(e), typeof n == "object")) {
948
+ }, mt = (e) => {
949
+ let { className: t, theme: n, editor: r, ...s } = e, c = f(), l = m(), u = c?.colorSchemePreference || l, d = typeof n == "string" ? n : u === "no-preference" ? "light" : u, p = fe((e) => {
950
+ if (e && (B(e), typeof n == "object")) {
793
951
  if ("light" in n && "dark" in n) {
794
- U(n[u === "dark" ? "dark" : "light"], e);
952
+ z(n[u === "dark" ? "dark" : "light"], e);
795
953
  return;
796
954
  }
797
- U(n, e);
955
+ z(n, e);
798
956
  return;
799
957
  }
800
958
  }, [u, n]);
801
- N(() => {
959
+ M(() => {
802
960
  if (!r.portalElement) throw Error("Portal element not found");
803
961
  r.portalElement.setAttribute("data-mantine-color-scheme", d), p(r.portalElement);
804
962
  }, [
@@ -806,9 +964,9 @@ var H = (e, t, n = !1) => {
806
964
  p,
807
965
  d
808
966
  ]);
809
- let h = M(C), g = /* @__PURE__ */ I(o.Provider, {
810
- value: X,
811
- children: /* @__PURE__ */ I(a, {
967
+ let h = j(oe), g = /* @__PURE__ */ F(o.Provider, {
968
+ value: Z,
969
+ children: /* @__PURE__ */ F(a, {
812
970
  "data-mantine-color-scheme": d,
813
971
  className: i("bn-mantine", t || ""),
814
972
  theme: typeof n == "object" ? void 0 : n,
@@ -817,7 +975,7 @@ var H = (e, t, n = !1) => {
817
975
  ref: p
818
976
  })
819
977
  });
820
- return h ? g : /* @__PURE__ */ I(ae, {
978
+ return h ? g : /* @__PURE__ */ F(se, {
821
979
  withCssVariables: !1,
822
980
  getRootElement: () => void 0,
823
981
  children: g
@@ -866,7 +1024,7 @@ var H = (e, t, n = !1) => {
866
1024
  },
867
1025
  borderRadius: 6,
868
1026
  fontFamily: "\"Inter\", \"SF Pro Display\", -apple-system, BlinkMacSystemFont, \"Open Sans\", \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif"
869
- }, Ze = {
1027
+ }, ht = {
870
1028
  colors: {
871
1029
  editor: {
872
1030
  text: Q[2],
@@ -901,6 +1059,6 @@ var H = (e, t, n = !1) => {
901
1059
  fontFamily: $.fontFamily
902
1060
  };
903
1061
  //#endregion
904
- export { Z as BlockNoteView, U as applyBlockNoteCSSVariablesFromTheme, X as components, Ze as darkDefaultTheme, Q as defaultColorScheme, $ as lightDefaultTheme, W as removeBlockNoteCSSVariables };
1062
+ export { mt as BlockNoteView, z as applyBlockNoteCSSVariablesFromTheme, Z as components, ht as darkDefaultTheme, Q as defaultColorScheme, $ as lightDefaultTheme, B as removeBlockNoteCSSVariables };
905
1063
 
906
1064
  //# sourceMappingURL=blocknote-mantine.js.map