@blocknote/mantine 0.39.0 → 0.40.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,19 +1,19 @@
1
1
  import { jsx as s, jsxs as v } from "react/jsx-runtime";
2
- import { assertEmpty as d, isSafari as B, mergeCSSClasses as z, COLORS_DEFAULT as le, COLORS_DARK_MODE_DEFAULT as ce } from "@blocknote/core";
3
- import { mergeRefs as W, useDictionary as ue, useBlockNoteContext as q, FormattingToolbarController as de, getFormattingToolbarItems as me, FormattingToolbar as fe, elementOverflow as Z, usePrefersColorScheme as ge, ComponentsContext as he, BlockNoteViewRaw as be } from "@blocknote/react";
4
- import { Button as N, ActionIcon as j, Tooltip as J, Stack as $, Text as w, Group as b, Chip as pe, Divider as ve, Card as Q, Skeleton as V, Avatar as Se, TextInput as X, Menu as S, CheckIcon as Y, Tabs as M, LoadingOverlay as ye, FileInput as xe, PopoverDropdown as Ce, PopoverTarget as we, Popover as Te, Badge as Ne, Loader as ee, Flex as Pe, MantineProvider as ke } from "@mantine/core";
5
- import T, { forwardRef as m, useState as A, useRef as k, useEffect as _, useContext as Me, createContext as Fe, useCallback as E } from "react";
6
- import { useHover as Oe, useFocusWithin as te, mergeRefs as R, useFocusTrap as Re } from "@mantine/hooks";
2
+ import { assertEmpty as d, isSafari as R, mergeCSSClasses as E, COLORS_DEFAULT as ie, COLORS_DARK_MODE_DEFAULT as ae } from "@blocknote/core";
3
+ import { mergeRefs as U, useDictionary as le, useBlockNoteContext as W, FormattingToolbarController as ce, getFormattingToolbarItems as ue, FormattingToolbar as de, elementOverflow as q, usePrefersColorScheme as me, ComponentsContext as fe, BlockNoteViewRaw as ge } from "@blocknote/react";
4
+ import { Button as T, ActionIcon as L, Tooltip as Z, Stack as z, Text as C, Group as h, Chip as be, Divider as he, Card as J, Skeleton as _, Avatar as pe, TextInput as Q, Menu as p, CheckIcon as B, Tabs as P, LoadingOverlay as ve, FileInput as Se, PopoverDropdown as ye, PopoverTarget as we, Popover as xe, Badge as Ce, Loader as X, Flex as Ne, MantineContext as Te, MantineProvider as ke } from "@mantine/core";
5
+ import N, { forwardRef as m, useState as Y, useRef as j, useEffect as $, useContext as ee, createContext as Pe, useCallback as Fe } from "react";
6
+ import { useHover as Me, useFocusWithin as te, mergeRefs as A, useFocusTrap as Oe } from "@mantine/hooks";
7
7
  const ne = (e, n, t = !1) => {
8
8
  const o = [];
9
- function r(i, l = "--bn") {
10
- for (const a in i) {
11
- const u = a.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), c = `${l}-${u}`;
12
- typeof i[a] != "object" ? (typeof i[a] == "number" && (i[a] = `${i[a]}px`), t ? n.style.removeProperty(c) : n.style.setProperty(c, i[a].toString())) : r(i[a], c);
9
+ function r(i, a = "--bn") {
10
+ for (const l in i) {
11
+ const c = l.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), u = `${a}-${c}`;
12
+ typeof i[l] != "object" ? (typeof i[l] == "number" && (i[l] = `${i[l]}px`), t ? n.style.removeProperty(u) : n.style.setProperty(u, i[l].toString())) : r(i[l], u);
13
13
  }
14
14
  }
15
15
  return r(e), o;
16
- }, G = (e, n) => ne(e, n), De = {
16
+ }, V = (e, n) => ne(e, n), De = {
17
17
  colors: {
18
18
  editor: {
19
19
  text: void 0,
@@ -83,72 +83,72 @@ const ne = (e, n, t = !1) => {
83
83
  },
84
84
  borderRadius: void 0,
85
85
  fontFamily: void 0
86
- }, Ie = (e) => ne(De, e, !0), oe = (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
- ] }), D = m(
86
+ }, Ie = (e) => ne(De, e, !0), oe = (e) => /* @__PURE__ */ v(z, { gap: 0, className: "bn-tooltip", children: [
87
+ /* @__PURE__ */ s(C, { size: "sm", lineClamp: 5, children: e.mainTooltip }),
88
+ e.secondaryTooltip && /* @__PURE__ */ s(C, { size: "xs", lineClamp: 5, children: e.secondaryTooltip })
89
+ ] }), O = m(
90
90
  (e, n) => {
91
91
  const {
92
92
  className: t,
93
93
  children: o,
94
94
  mainTooltip: r,
95
95
  secondaryTooltip: i,
96
- icon: l,
97
- isSelected: a,
98
- isDisabled: u,
99
- onClick: c,
96
+ icon: a,
97
+ isSelected: l,
98
+ isDisabled: c,
99
+ onClick: u,
100
100
  label: g,
101
- variant: h,
102
- ...p
101
+ variant: b,
102
+ ...S
103
103
  } = e;
104
- d(p, !1);
105
- const [C, y] = A(!1), P = o ? /* @__PURE__ */ s(
106
- N,
104
+ d(S, !1);
105
+ const [x, y] = Y(!1), k = o ? /* @__PURE__ */ s(
106
+ T,
107
107
  {
108
108
  "aria-label": g,
109
109
  className: t,
110
- onMouseDown: (x) => {
111
- B() && x.currentTarget.focus();
110
+ onMouseDown: (w) => {
111
+ R() && w.currentTarget.focus();
112
112
  },
113
- onClick: (x) => {
114
- y(!0), c == null || c(x);
113
+ onClick: (w) => {
114
+ y(!0), u == null || u(w);
115
115
  },
116
116
  onPointerLeave: () => y(!1),
117
- "aria-pressed": a,
118
- "data-selected": a || void 0,
117
+ "aria-pressed": l,
118
+ "data-selected": l || void 0,
119
119
  "data-test": r ? r.slice(0, 1).toLowerCase() + r.replace(/\s+/g, "").slice(1) : void 0,
120
- size: h === "compact" ? "compact-xs" : "xs",
121
- disabled: u || !1,
120
+ size: b === "compact" ? "compact-xs" : "xs",
121
+ disabled: c || !1,
122
122
  ref: n,
123
- ...p,
123
+ ...S,
124
124
  children: o
125
125
  }
126
126
  ) : /* @__PURE__ */ s(
127
- j,
127
+ L,
128
128
  {
129
129
  className: t,
130
130
  "aria-label": g,
131
- onMouseDown: (x) => {
132
- B() && x.currentTarget.focus();
131
+ onMouseDown: (w) => {
132
+ R() && w.currentTarget.focus();
133
133
  },
134
- onClick: (x) => {
135
- y(!0), c == null || c(x);
134
+ onClick: (w) => {
135
+ y(!0), u == null || u(w);
136
136
  },
137
137
  onPointerLeave: () => y(!1),
138
- "aria-pressed": a,
139
- "data-selected": a || void 0,
138
+ "aria-pressed": l,
139
+ "data-selected": l || void 0,
140
140
  "data-test": r ? r.slice(0, 1).toLowerCase() + r.replace(/\s+/g, "").slice(1) : void 0,
141
- size: h === "compact" ? 20 : 30,
142
- disabled: u || !1,
141
+ size: b === "compact" ? 20 : 30,
142
+ disabled: c || !1,
143
143
  ref: n,
144
- ...p,
145
- children: l
144
+ ...S,
145
+ children: a
146
146
  }
147
147
  );
148
148
  return r ? /* @__PURE__ */ s(
149
- J,
149
+ Z,
150
150
  {
151
- disabled: C,
151
+ disabled: x,
152
152
  withinPortal: !1,
153
153
  label: /* @__PURE__ */ s(
154
154
  oe,
@@ -157,33 +157,33 @@ const ne = (e, n, t = !1) => {
157
157
  secondaryTooltip: i
158
158
  }
159
159
  ),
160
- children: P
160
+ children: k
161
161
  }
162
- ) : P;
162
+ ) : k;
163
163
  }
164
- ), Le = m((e, n) => {
164
+ ), Re = m((e, n) => {
165
165
  const {
166
166
  className: t,
167
167
  text: o,
168
168
  icon: r,
169
169
  isSelected: i,
170
- mainTooltip: l,
171
- secondaryTooltip: a,
172
- onClick: u,
173
- onMouseEnter: c,
170
+ mainTooltip: a,
171
+ secondaryTooltip: l,
172
+ onClick: c,
173
+ onMouseEnter: u,
174
174
  ...g
175
175
  } = e;
176
176
  d(g, !1);
177
- const [h, p] = A(!1), C = /* @__PURE__ */ v(
178
- pe,
177
+ const [b, S] = Y(!1), x = /* @__PURE__ */ v(
178
+ be,
179
179
  {
180
180
  className: t,
181
181
  checked: i === !0,
182
182
  wrapperProps: {
183
- onMouseEnter: c,
184
- onMouseLeave: () => p(!1),
183
+ onMouseEnter: u,
184
+ onMouseLeave: () => S(!1),
185
185
  onClick: (y) => {
186
- p(!0), u == null || u(y);
186
+ S(!0), c == null || c(y);
187
187
  }
188
188
  },
189
189
  variant: "light",
@@ -195,78 +195,78 @@ const ne = (e, n, t = !1) => {
195
195
  ]
196
196
  }
197
197
  );
198
- return !l || h ? C : /* @__PURE__ */ s(
199
- J,
198
+ return !a || b ? x : /* @__PURE__ */ s(
199
+ Z,
200
200
  {
201
201
  refProp: "rootRef",
202
202
  withinPortal: !1,
203
203
  label: /* @__PURE__ */ s(
204
204
  oe,
205
205
  {
206
- mainTooltip: l,
207
- secondaryTooltip: a
206
+ mainTooltip: a,
207
+ secondaryTooltip: l
208
208
  }
209
209
  ),
210
- children: C
210
+ children: x
211
211
  }
212
212
  );
213
213
  }), Be = m((e, n) => {
214
214
  const { className: t, children: o, ...r } = e;
215
- return d(r), /* @__PURE__ */ s(b, { className: t, ref: n, children: o });
215
+ return d(r), /* @__PURE__ */ s(h, { className: t, ref: n, children: o });
216
216
  }), Ee = m((e, n) => {
217
217
  const {
218
218
  className: t,
219
219
  children: o,
220
220
  headerText: r,
221
221
  selected: i,
222
- onFocus: l,
223
- onBlur: a,
224
- tabIndex: u,
225
- ...c
222
+ onFocus: a,
223
+ onBlur: l,
224
+ tabIndex: c,
225
+ ...u
226
226
  } = e;
227
- d(c, !1);
228
- const g = k(null);
229
- return _(() => {
230
- var h;
231
- i && ((h = g.current) == null || h.scrollIntoView({
227
+ d(u, !1);
228
+ const g = j(null);
229
+ return $(() => {
230
+ var b;
231
+ i && ((b = g.current) == null || b.scrollIntoView({
232
232
  behavior: "smooth",
233
233
  block: "center"
234
234
  }));
235
235
  }, [i]), /* @__PURE__ */ v(
236
- Q,
236
+ J,
237
237
  {
238
- className: z(t, i ? "selected" : ""),
239
- onFocus: l,
240
- onBlur: a,
241
- tabIndex: u,
242
- ref: W([n, g]),
238
+ className: E(t, i ? "selected" : ""),
239
+ onFocus: a,
240
+ onBlur: l,
241
+ tabIndex: c,
242
+ ref: U([n, g]),
243
243
  children: [
244
- r && /* @__PURE__ */ s(w, { className: "bn-header-text", children: r }),
244
+ r && /* @__PURE__ */ s(C, { className: "bn-header-text", children: r }),
245
245
  o
246
246
  ]
247
247
  }
248
248
  );
249
- }), ze = m((e, n) => {
249
+ }), Le = m((e, n) => {
250
250
  const { className: t, children: o, ...r } = e;
251
- return d(r, !1), /* @__PURE__ */ s(Q.Section, { className: t, ref: n, children: o });
252
- }), je = m((e, n) => {
251
+ return d(r, !1), /* @__PURE__ */ s(J.Section, { className: t, ref: n, children: o });
252
+ }), ze = m((e, n) => {
253
253
  const { className: t, children: o, ...r } = e;
254
254
  return d(r, !1), /* @__PURE__ */ s(
255
- ve,
255
+ he,
256
256
  {
257
257
  className: t,
258
- label: /* @__PURE__ */ s(w, { children: o }),
258
+ label: /* @__PURE__ */ s(C, { children: o }),
259
259
  ref: n
260
260
  }
261
261
  );
262
- }), $e = m((e, n) => {
263
- const { authorInfo: t, timeString: o, edited: r, ...i } = e, l = ue();
264
- return d(i, !1), t === "loading" ? /* @__PURE__ */ v(b, { children: [
265
- /* @__PURE__ */ s(V, { height: 24, width: 24 }),
266
- /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(V, { height: 12, width: 100 }) })
267
- ] }) : /* @__PURE__ */ v(b, { children: [
262
+ }), je = m((e, n) => {
263
+ const { authorInfo: t, timeString: o, edited: r, ...i } = e, a = le();
264
+ return d(i, !1), t === "loading" ? /* @__PURE__ */ v(h, { children: [
265
+ /* @__PURE__ */ s(_, { height: 24, width: 24 }),
266
+ /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(_, { height: 12, width: 100 }) })
267
+ ] }) : /* @__PURE__ */ v(h, { children: [
268
268
  /* @__PURE__ */ s(
269
- Se,
269
+ pe,
270
270
  {
271
271
  src: t.avatarUrl,
272
272
  alt: t.username,
@@ -275,49 +275,49 @@ const ne = (e, n, t = !1) => {
275
275
  color: "initials"
276
276
  }
277
277
  ),
278
- /* @__PURE__ */ v(w, { fz: "sm", fw: "bold", children: [
278
+ /* @__PURE__ */ v(C, { fz: "sm", fw: "bold", children: [
279
279
  t.username,
280
- /* @__PURE__ */ v(w, { fz: "xs", c: "dimmed", span: !0, ml: "xs", children: [
280
+ /* @__PURE__ */ v(C, { fz: "xs", c: "dimmed", span: !0, ml: "xs", children: [
281
281
  o,
282
282
  " ",
283
- r && `(${l.comments.edited})`
283
+ r && `(${a.comments.edited})`
284
284
  ] })
285
285
  ] })
286
286
  ] });
287
- }), Ae = m((e, n) => {
287
+ }), $e = m((e, n) => {
288
288
  const {
289
289
  className: t,
290
290
  showActions: o,
291
291
  authorInfo: r,
292
292
  timeString: i,
293
- edited: l,
294
- actions: a,
295
- children: u,
296
- ...c
297
- } = e, { hovered: g, ref: h } = Oe(), { focused: p, ref: C } = te(), y = W([n, h]);
298
- return d(c, !1), /* @__PURE__ */ v(b, { pos: "relative", ref: y, className: t, children: [
299
- a && (o === !0 || o === void 0 || o === "hover" && g || p) ? /* @__PURE__ */ s(
300
- b,
293
+ edited: a,
294
+ actions: l,
295
+ children: c,
296
+ ...u
297
+ } = e, { hovered: g, ref: b } = Me(), { focused: S, ref: x } = te(), y = U([n, b]);
298
+ return d(u, !1), /* @__PURE__ */ v(h, { pos: "relative", ref: y, className: t, children: [
299
+ l && (o === !0 || o === void 0 || o === "hover" && g || S) ? /* @__PURE__ */ s(
300
+ h,
301
301
  {
302
- ref: C,
302
+ ref: x,
303
303
  style: {
304
304
  position: "absolute",
305
305
  right: 0,
306
306
  top: 0,
307
307
  zIndex: 10
308
308
  },
309
- children: a
309
+ children: l
310
310
  }
311
311
  ) : null,
312
- /* @__PURE__ */ s($e, { ...e }),
313
- u
312
+ /* @__PURE__ */ s(je, { ...e }),
313
+ c
314
314
  ] });
315
- }), _e = m((e, n) => {
316
- const { className: t, autoFocus: o, onFocus: r, onBlur: i, editor: l, editable: a, ...u } = e;
317
- d(u, !1);
318
- const c = q();
315
+ }), Ae = m((e, n) => {
316
+ const { className: t, autoFocus: o, onFocus: r, onBlur: i, editor: a, editable: l, ...c } = e;
317
+ d(c, !1);
318
+ const u = W();
319
319
  return /* @__PURE__ */ s(
320
- Ot,
320
+ Ft,
321
321
  {
322
322
  autoFocus: o,
323
323
  className: t,
@@ -327,236 +327,80 @@ const ne = (e, n, t = !1) => {
327
327
  tableHandles: !1,
328
328
  filePanel: !1,
329
329
  formattingToolbar: !1,
330
- editable: a,
331
- theme: c == null ? void 0 : c.colorSchemePreference,
330
+ editable: l,
331
+ theme: u == null ? void 0 : u.colorSchemePreference,
332
332
  ref: n,
333
333
  onFocus: r,
334
334
  onBlur: i,
335
335
  children: /* @__PURE__ */ s(
336
- de,
336
+ ce,
337
337
  {
338
- formattingToolbar: Ve
338
+ formattingToolbar: _e
339
339
  }
340
340
  )
341
341
  }
342
342
  );
343
- }), Ve = () => {
344
- const e = me([]).filter(
343
+ }), _e = () => {
344
+ const e = ue([]).filter(
345
345
  (n) => n.key !== "nestBlockButton" && n.key !== "unnestBlockButton"
346
346
  );
347
- return /* @__PURE__ */ s(fe, { blockTypeSelectItems: [], children: e });
348
- }, Ge = m((e, n) => {
347
+ return /* @__PURE__ */ s(de, { blockTypeSelectItems: [], children: e });
348
+ }, Ve = m((e, n) => {
349
349
  const {
350
350
  className: t,
351
351
  name: o,
352
352
  label: r,
353
353
  variant: i,
354
- icon: l,
355
- value: a,
356
- autoFocus: u,
357
- placeholder: c,
354
+ icon: a,
355
+ value: l,
356
+ autoFocus: c,
357
+ placeholder: u,
358
358
  disabled: g,
359
- onKeyDown: h,
360
- onChange: p,
361
- onSubmit: C,
359
+ onKeyDown: b,
360
+ onChange: S,
361
+ onSubmit: x,
362
362
  autoComplete: y,
363
- rightSection: P,
364
- ...x
363
+ rightSection: k,
364
+ ...w
365
365
  } = e;
366
- return d(x), /* @__PURE__ */ s(
367
- X,
366
+ return d(w), /* @__PURE__ */ s(
367
+ Q,
368
368
  {
369
369
  size: "xs",
370
- className: z(
370
+ className: E(
371
371
  t || "",
372
372
  i === "large" ? "bn-mt-input-large" : ""
373
373
  ),
374
374
  ref: n,
375
375
  name: o,
376
376
  label: r,
377
- leftSection: l,
378
- value: a,
379
- autoFocus: u,
380
- "data-autofocus": u ? "true" : void 0,
381
- rightSection: P,
382
- placeholder: c,
377
+ leftSection: a,
378
+ value: l,
379
+ autoFocus: c,
380
+ "data-autofocus": c ? "true" : void 0,
381
+ rightSection: k,
382
+ placeholder: u,
383
383
  disabled: g,
384
- onKeyDown: h,
385
- onChange: p,
386
- onSubmit: C,
384
+ onKeyDown: b,
385
+ onChange: S,
386
+ onSubmit: x,
387
387
  autoComplete: y
388
388
  }
389
389
  );
390
- });
391
- var re = {
392
- color: void 0,
393
- size: void 0,
394
- className: void 0,
395
- style: void 0,
396
- attr: void 0
397
- }, H = T.createContext && /* @__PURE__ */ T.createContext(re), He = ["attr", "size", "title"];
398
- function Ke(e, n) {
399
- if (e == null) return {};
400
- var t = Ue(e, n), o, r;
401
- if (Object.getOwnPropertySymbols) {
402
- var i = Object.getOwnPropertySymbols(e);
403
- for (r = 0; r < i.length; r++)
404
- o = i[r], !(n.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(e, o) && (t[o] = e[o]);
405
- }
406
- return t;
407
- }
408
- function Ue(e, n) {
409
- if (e == null) return {};
410
- var t = {};
411
- for (var o in e)
412
- if (Object.prototype.hasOwnProperty.call(e, o)) {
413
- if (n.indexOf(o) >= 0) continue;
414
- t[o] = e[o];
415
- }
416
- return t;
417
- }
418
- function F() {
419
- return F = Object.assign ? Object.assign.bind() : function(e) {
420
- for (var n = 1; n < arguments.length; n++) {
421
- var t = arguments[n];
422
- for (var o in t)
423
- Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
424
- }
425
- return e;
426
- }, F.apply(this, arguments);
427
- }
428
- function K(e, n) {
429
- var t = Object.keys(e);
430
- if (Object.getOwnPropertySymbols) {
431
- var o = Object.getOwnPropertySymbols(e);
432
- n && (o = o.filter(function(r) {
433
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
434
- })), t.push.apply(t, o);
435
- }
436
- return t;
437
- }
438
- function O(e) {
439
- for (var n = 1; n < arguments.length; n++) {
440
- var t = arguments[n] != null ? arguments[n] : {};
441
- n % 2 ? K(Object(t), !0).forEach(function(o) {
442
- We(e, o, t[o]);
443
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : K(Object(t)).forEach(function(o) {
444
- Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
445
- });
446
- }
447
- return e;
448
- }
449
- function We(e, n, t) {
450
- return n = qe(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
451
- }
452
- function qe(e) {
453
- var n = Ze(e, "string");
454
- return typeof n == "symbol" ? n : n + "";
455
- }
456
- function Ze(e, n) {
457
- if (typeof e != "object" || !e) return e;
458
- var t = e[Symbol.toPrimitive];
459
- if (t !== void 0) {
460
- var o = t.call(e, n);
461
- if (typeof o != "object") return o;
462
- throw new TypeError("@@toPrimitive must return a primitive value.");
463
- }
464
- return (n === "string" ? String : Number)(e);
465
- }
466
- function se(e) {
467
- return e && e.map((n, t) => /* @__PURE__ */ T.createElement(n.tag, O({
468
- key: t
469
- }, n.attr), se(n.child)));
470
- }
471
- function ie(e) {
472
- return (n) => /* @__PURE__ */ T.createElement(Je, F({
473
- attr: O({}, e.attr)
474
- }, n), se(e.child));
475
- }
476
- function Je(e) {
477
- var n = (t) => {
478
- var {
479
- attr: o,
480
- size: r,
481
- title: i
482
- } = e, l = Ke(e, He), a = r || t.size || "1em", u;
483
- return t.className && (u = t.className), e.className && (u = (u ? u + " " : "") + e.className), /* @__PURE__ */ T.createElement("svg", F({
484
- stroke: "currentColor",
485
- fill: "currentColor",
486
- strokeWidth: "0"
487
- }, t.attr, o, l, {
488
- className: u,
489
- style: O(O({
490
- color: e.color || t.color
491
- }, t.style), e.style),
492
- height: a,
493
- width: a,
494
- xmlns: "http://www.w3.org/2000/svg"
495
- }), i && /* @__PURE__ */ T.createElement("title", null, i), e.children);
496
- };
497
- return H !== void 0 ? /* @__PURE__ */ T.createElement(H.Consumer, null, (t) => n(t)) : n(re);
498
- }
499
- function Qe(e) {
500
- return ie({ 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);
501
- }
502
- function Xe(e) {
503
- return ie({ 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);
504
- }
505
- const ae = Fe(void 0), Ye = m((e, n) => {
506
- const {
507
- children: t,
508
- onOpenChange: o,
509
- position: r,
510
- sub: i,
511
- // not used
512
- ...l
513
- } = e;
514
- d(l);
515
- const [a, u] = A(!1), c = k(null), g = k(
516
- void 0
517
- ), h = E(() => {
518
- g.current && clearTimeout(g.current), g.current = setTimeout(() => {
519
- u(!1);
520
- }, 250);
521
- }, []), p = E(() => {
522
- g.current && clearTimeout(g.current), u(!0);
523
- }, []);
524
- return /* @__PURE__ */ s(
525
- ae.Provider,
390
+ }), Ge = Pe(void 0), He = (e) => {
391
+ const { children: n, onOpenChange: t, position: o, sub: r, ...i } = e;
392
+ return d(i), r ? /* @__PURE__ */ s(
393
+ p.Sub,
526
394
  {
527
- value: {
528
- onMenuMouseOver: p,
529
- onMenuMouseLeave: h
530
- },
531
- children: /* @__PURE__ */ s(
532
- S.Item,
533
- {
534
- className: "bn-menu-item bn-mt-sub-menu-item",
535
- ref: R(n, c),
536
- onMouseOver: p,
537
- onMouseLeave: h,
538
- children: /* @__PURE__ */ s(
539
- S,
540
- {
541
- portalProps: {
542
- target: c.current ? c.current.parentElement : void 0
543
- },
544
- middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
545
- trigger: "hover",
546
- opened: a,
547
- onChange: o,
548
- position: r,
549
- children: t
550
- }
551
- )
552
- }
553
- )
395
+ transitionProps: { duration: 250, exitDelay: 250 },
396
+ withinPortal: !1,
397
+ middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
398
+ onChange: t,
399
+ position: o,
400
+ children: n
554
401
  }
555
- );
556
- }), et = (e) => {
557
- const { children: n, onOpenChange: t, position: o, sub: r, ...i } = e;
558
- return d(i), r ? /* @__PURE__ */ s(Ye, { ...e }) : /* @__PURE__ */ s(
559
- S,
402
+ ) : /* @__PURE__ */ s(
403
+ p,
560
404
  {
561
405
  withinPortal: !1,
562
406
  middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
@@ -565,42 +409,40 @@ const ae = Fe(void 0), Ye = m((e, n) => {
565
409
  children: n
566
410
  }
567
411
  );
568
- }, tt = m((e, n) => {
569
- const { className: t, children: o, icon: r, checked: i, subTrigger: l, onClick: a, ...u } = e;
570
- return d(u, !1), l ? /* @__PURE__ */ v(
571
- "div",
412
+ }, Ke = m((e, n) => {
413
+ const { className: t, children: o, icon: r, checked: i, subTrigger: a, onClick: l, ...c } = e;
414
+ return d(c, !1), a ? /* @__PURE__ */ s(
415
+ p.Sub.Item,
572
416
  {
573
- onClick: (c) => {
574
- c.preventDefault(), c.stopPropagation();
575
- },
417
+ className: t,
576
418
  ref: n,
577
- ...u,
578
- children: [
579
- o,
580
- /* @__PURE__ */ s(Xe, { size: 15 })
581
- ]
419
+ leftSection: r,
420
+ rightSection: i ? /* @__PURE__ */ s(B, { size: 10 }) : i === !1 ? /* @__PURE__ */ s("div", { className: "bn-tick-space" }) : null,
421
+ onClick: l,
422
+ ...c,
423
+ children: o
582
424
  }
583
425
  ) : /* @__PURE__ */ s(
584
- S.Item,
426
+ p.Item,
585
427
  {
586
428
  className: t,
587
429
  ref: n,
588
430
  leftSection: r,
589
- rightSection: i ? /* @__PURE__ */ s(Y, { size: 10 }) : i === !1 ? /* @__PURE__ */ s("div", { className: "bn-tick-space" }) : null,
590
- onClick: a,
591
- ...u,
431
+ rightSection: i ? /* @__PURE__ */ s(B, { size: 10 }) : i === !1 ? /* @__PURE__ */ s("div", { className: "bn-tick-space" }) : null,
432
+ onClick: l,
433
+ ...c,
592
434
  children: o
593
435
  }
594
436
  );
595
- }), nt = (e) => {
437
+ }), Ue = (e) => {
596
438
  const {
597
439
  children: n,
598
440
  sub: t,
599
441
  // unused
600
442
  ...o
601
443
  } = e;
602
- return d(o), /* @__PURE__ */ s(S.Target, { children: n });
603
- }, ot = m((e, n) => {
444
+ return d(o), t ? /* @__PURE__ */ s(p.Sub.Target, { children: n }) : /* @__PURE__ */ s(p.Target, { children: n });
445
+ }, We = m((e, n) => {
604
446
  const {
605
447
  className: t,
606
448
  children: o,
@@ -609,112 +451,121 @@ const ae = Fe(void 0), Ye = m((e, n) => {
609
451
  ...i
610
452
  } = e;
611
453
  d(i);
612
- const l = Me(ae);
613
- return /* @__PURE__ */ s(
614
- S.Dropdown,
454
+ const a = ee(Ge);
455
+ return r ? /* @__PURE__ */ s(
456
+ p.Sub.Dropdown,
615
457
  {
616
458
  className: t,
617
459
  ref: n,
618
- onMouseOver: l == null ? void 0 : l.onMenuMouseOver,
619
- onMouseLeave: l == null ? void 0 : l.onMenuMouseLeave,
460
+ onMouseOver: a == null ? void 0 : a.onMenuMouseOver,
461
+ onMouseLeave: a == null ? void 0 : a.onMenuMouseLeave,
462
+ children: o
463
+ }
464
+ ) : /* @__PURE__ */ s(
465
+ p.Dropdown,
466
+ {
467
+ className: t,
468
+ ref: n,
469
+ onMouseOver: a == null ? void 0 : a.onMenuMouseOver,
470
+ onMouseLeave: a == null ? void 0 : a.onMenuMouseLeave,
620
471
  children: o
621
472
  }
622
473
  );
623
- }), rt = m((e, n) => {
474
+ }), qe = m((e, n) => {
624
475
  const { className: t, ...o } = e;
625
- return d(o), /* @__PURE__ */ s(S.Divider, { className: t, ref: n });
626
- }), st = m((e, n) => {
476
+ return d(o), /* @__PURE__ */ s(p.Divider, { className: t, ref: n });
477
+ }), Ze = m((e, n) => {
627
478
  const { className: t, children: o, ...r } = e;
628
- return d(r), /* @__PURE__ */ s(S.Label, { className: t, ref: n, children: o });
629
- }), it = m((e, n) => {
479
+ return d(r), /* @__PURE__ */ s(p.Label, { className: t, ref: n, children: o });
480
+ }), Je = m((e, n) => {
630
481
  const {
631
482
  className: t,
632
483
  children: o,
633
484
  icon: r,
634
485
  onClick: i,
635
- onDragEnd: l,
636
- onDragStart: a,
637
- draggable: u,
638
- label: c,
486
+ onDragEnd: a,
487
+ onDragStart: l,
488
+ draggable: c,
489
+ label: u,
639
490
  ...g
640
491
  } = e;
641
492
  return d(g, !1), r ? /* @__PURE__ */ s(
642
- j,
493
+ L,
643
494
  {
644
495
  size: 24,
645
496
  className: t,
646
497
  ref: n,
647
498
  onClick: i,
648
- onDragEnd: l,
649
- onDragStart: a,
650
- draggable: u,
651
- "aria-label": c,
499
+ onDragEnd: a,
500
+ onDragStart: l,
501
+ draggable: c,
502
+ "aria-label": u,
652
503
  ...g,
653
504
  children: r
654
505
  }
655
506
  ) : /* @__PURE__ */ s(
656
- N,
507
+ T,
657
508
  {
658
509
  className: t,
659
510
  ref: n,
660
511
  onClick: i,
661
- onDragEnd: l,
662
- onDragStart: a,
663
- draggable: u,
664
- "aria-label": c,
512
+ onDragEnd: a,
513
+ onDragStart: l,
514
+ draggable: c,
515
+ "aria-label": u,
665
516
  ...g,
666
517
  children: o
667
518
  }
668
519
  );
669
- }), at = m((e, n) => {
520
+ }), Qe = m((e, n) => {
670
521
  const {
671
522
  className: t,
672
523
  tabs: o,
673
524
  defaultOpenTab: r,
674
525
  openTab: i,
675
- setOpenTab: l,
676
- loading: a,
677
- ...u
526
+ setOpenTab: a,
527
+ loading: l,
528
+ ...c
678
529
  } = e;
679
- return d(u), /* @__PURE__ */ s(b, { className: t, ref: n, children: /* @__PURE__ */ v(
680
- M,
530
+ return d(c), /* @__PURE__ */ s(h, { className: t, ref: n, children: /* @__PURE__ */ v(
531
+ P,
681
532
  {
682
533
  value: i,
683
534
  defaultValue: r,
684
- onChange: l,
535
+ onChange: a,
685
536
  children: [
686
- a && /* @__PURE__ */ s(ye, { visible: a }),
687
- /* @__PURE__ */ s(M.List, { children: o.map((c) => /* @__PURE__ */ s(
688
- M.Tab,
537
+ l && /* @__PURE__ */ s(ve, { visible: l }),
538
+ /* @__PURE__ */ s(P.List, { children: o.map((u) => /* @__PURE__ */ s(
539
+ P.Tab,
689
540
  {
690
- "data-test": `${c.name.toLowerCase()}-tab`,
691
- value: c.name,
692
- children: c.name
541
+ "data-test": `${u.name.toLowerCase()}-tab`,
542
+ value: u.name,
543
+ children: u.name
693
544
  },
694
- c.name
545
+ u.name
695
546
  )) }),
696
- o.map((c) => /* @__PURE__ */ s(M.Panel, { value: c.name, children: c.tabPanel }, c.name))
547
+ o.map((u) => /* @__PURE__ */ s(P.Panel, { value: u.name, children: u.tabPanel }, u.name))
697
548
  ]
698
549
  }
699
550
  ) });
700
- }), lt = m((e, n) => {
701
- const { className: t, children: o, onClick: r, label: i, ...l } = e;
702
- return d(l), /* @__PURE__ */ s(
703
- N,
551
+ }), Xe = m((e, n) => {
552
+ const { className: t, children: o, onClick: r, label: i, ...a } = e;
553
+ return d(a), /* @__PURE__ */ s(
554
+ T,
704
555
  {
705
556
  size: "xs",
706
557
  "aria-label": i,
707
558
  className: t,
708
559
  ref: n,
709
560
  onClick: r,
710
- ...l,
561
+ ...a,
711
562
  children: o
712
563
  }
713
564
  );
714
- }), ct = m((e, n) => {
715
- const { className: t, accept: o, value: r, placeholder: i, onChange: l, ...a } = e;
716
- return d(a), /* @__PURE__ */ s(
717
- xe,
565
+ }), Ye = m((e, n) => {
566
+ const { className: t, accept: o, value: r, placeholder: i, onChange: a, ...l } = e;
567
+ return d(l), /* @__PURE__ */ s(
568
+ Se,
718
569
  {
719
570
  size: "xs",
720
571
  className: t,
@@ -722,17 +573,17 @@ const ae = Fe(void 0), Ye = m((e, n) => {
722
573
  accept: o,
723
574
  value: r,
724
575
  placeholder: i,
725
- onChange: l,
726
- ...a
576
+ onChange: a,
577
+ ...l
727
578
  }
728
579
  );
729
- }), ut = m((e, n) => {
580
+ }), et = m((e, n) => {
730
581
  const { className: t, children: o, ...r } = e;
731
582
  return d(r), /* @__PURE__ */ s("div", { className: t, ref: n, children: o });
732
- }), dt = m((e, n) => {
733
- const { className: t, value: o, placeholder: r, onKeyDown: i, onChange: l, ...a } = e;
734
- return d(a), /* @__PURE__ */ s(
735
- X,
583
+ }), tt = m((e, n) => {
584
+ const { className: t, value: o, placeholder: r, onKeyDown: i, onChange: a, ...l } = e;
585
+ return d(l), /* @__PURE__ */ s(
586
+ Q,
736
587
  {
737
588
  size: "xs",
738
589
  "data-test": "embed-input",
@@ -741,16 +592,16 @@ const ae = Fe(void 0), Ye = m((e, n) => {
741
592
  value: o,
742
593
  placeholder: r,
743
594
  onKeyDown: i,
744
- onChange: l
595
+ onChange: a
745
596
  }
746
597
  );
747
- }), mt = (e) => {
598
+ }), nt = (e) => {
748
599
  const { opened: n, position: t, children: o, ...r } = e;
749
- return d(r), /* @__PURE__ */ s(Te, { withinPortal: !1, opened: n, position: t, children: o });
750
- }, ft = (e) => {
600
+ return d(r), /* @__PURE__ */ s(xe, { withinPortal: !1, opened: n, position: t, children: o });
601
+ }, ot = (e) => {
751
602
  const { children: n, ...t } = e;
752
603
  return d(t), /* @__PURE__ */ s(we, { children: n });
753
- }, gt = m((e, n) => {
604
+ }, rt = m((e, n) => {
754
605
  const {
755
606
  className: t,
756
607
  children: o,
@@ -758,11 +609,11 @@ const ae = Fe(void 0), Ye = m((e, n) => {
758
609
  // unused
759
610
  ...i
760
611
  } = e;
761
- return d(i), /* @__PURE__ */ s(Ce, { className: t, ref: n, children: o });
762
- }), ht = m((e, n) => {
612
+ return d(i), /* @__PURE__ */ s(ye, { className: t, ref: n, children: o });
613
+ }), st = m((e, n) => {
763
614
  const { className: t, children: o, ...r } = e;
764
615
  return d(r, !1), /* @__PURE__ */ s(
765
- b,
616
+ h,
766
617
  {
767
618
  align: "center",
768
619
  gap: 0,
@@ -772,50 +623,50 @@ const ae = Fe(void 0), Ye = m((e, n) => {
772
623
  children: o
773
624
  }
774
625
  );
775
- }), bt = m((e, n) => {
626
+ }), it = m((e, n) => {
776
627
  const {
777
628
  className: t,
778
629
  children: o,
779
630
  icon: r,
780
631
  onClick: i,
781
- onDragEnd: l,
782
- onDragStart: a,
783
- draggable: u,
784
- label: c,
632
+ onDragEnd: a,
633
+ onDragStart: l,
634
+ draggable: c,
635
+ label: u,
785
636
  ...g
786
637
  } = e;
787
638
  return d(g, !1), r ? /* @__PURE__ */ s(
788
- j,
639
+ L,
789
640
  {
790
641
  size: 24,
791
642
  className: t,
792
643
  ref: n,
793
644
  onClick: i,
794
- onDragEnd: l,
795
- onDragStart: a,
796
- draggable: u,
797
- "aria-label": c,
645
+ onDragEnd: a,
646
+ onDragStart: l,
647
+ draggable: c,
648
+ "aria-label": u,
798
649
  ...g,
799
650
  children: r
800
651
  }
801
652
  ) : /* @__PURE__ */ s(
802
- N,
653
+ T,
803
654
  {
804
655
  className: t,
805
656
  ref: n,
806
657
  onClick: i,
807
- onDragEnd: l,
808
- onDragStart: a,
809
- draggable: u,
810
- "aria-label": c,
658
+ onDragEnd: a,
659
+ onDragStart: l,
660
+ draggable: c,
661
+ "aria-label": u,
811
662
  ...g,
812
663
  children: o
813
664
  }
814
665
  );
815
- }), pt = m((e, n) => {
666
+ }), at = m((e, n) => {
816
667
  const { className: t, children: o, id: r, ...i } = e;
817
668
  return d(i), /* @__PURE__ */ s(
818
- $,
669
+ z,
819
670
  {
820
671
  gap: 0,
821
672
  className: t,
@@ -825,66 +676,66 @@ const ae = Fe(void 0), Ye = m((e, n) => {
825
676
  children: o
826
677
  }
827
678
  );
828
- }), vt = m((e, n) => {
679
+ }), lt = m((e, n) => {
829
680
  const { className: t, children: o, ...r } = e;
830
- return d(r), /* @__PURE__ */ s(b, { className: t, ref: n, children: /* @__PURE__ */ s(b, { className: "bn-mt-suggestion-menu-item-title", children: o }) });
831
- }), St = m((e, n) => {
832
- const { className: t, isSelected: o, onClick: r, item: i, id: l, ...a } = e;
833
- d(a);
834
- const u = k(null);
835
- return _(() => {
836
- if (!u.current || !o)
681
+ return d(r), /* @__PURE__ */ s(h, { className: t, ref: n, children: /* @__PURE__ */ s(h, { className: "bn-mt-suggestion-menu-item-title", children: o }) });
682
+ }), ct = m((e, n) => {
683
+ const { className: t, isSelected: o, onClick: r, item: i, id: a, ...l } = e;
684
+ d(l);
685
+ const c = j(null);
686
+ return $(() => {
687
+ if (!c.current || !o)
837
688
  return;
838
- const c = Z(
839
- u.current,
689
+ const u = q(
690
+ c.current,
840
691
  document.querySelector(".bn-suggestion-menu, #ai-suggestion-menu")
841
692
  // TODO
842
693
  );
843
- c === "top" ? u.current.scrollIntoView(!0) : c === "bottom" && u.current.scrollIntoView(!1);
694
+ u === "top" ? c.current.scrollIntoView(!0) : u === "bottom" && c.current.scrollIntoView(!1);
844
695
  }, [o]), /* @__PURE__ */ v(
845
- b,
696
+ h,
846
697
  {
847
698
  gap: 0,
848
699
  className: t,
849
- ref: R(n, u),
850
- id: l,
700
+ ref: A(n, c),
701
+ id: a,
851
702
  role: "option",
852
- onMouseDown: (c) => c.preventDefault(),
703
+ onMouseDown: (u) => u.preventDefault(),
853
704
  onClick: r,
854
705
  "aria-selected": o || void 0,
855
706
  children: [
856
707
  i.icon && /* @__PURE__ */ s(
857
- b,
708
+ h,
858
709
  {
859
710
  className: "bn-mt-suggestion-menu-item-section",
860
711
  "data-position": "left",
861
712
  children: i.icon
862
713
  }
863
714
  ),
864
- /* @__PURE__ */ v($, { gap: 0, className: "bn-mt-suggestion-menu-item-body", children: [
865
- /* @__PURE__ */ s(w, { className: "bn-mt-suggestion-menu-item-title", children: i.title }),
866
- /* @__PURE__ */ s(w, { className: "bn-mt-suggestion-menu-item-subtitle", children: i.subtext })
715
+ /* @__PURE__ */ v(z, { gap: 0, className: "bn-mt-suggestion-menu-item-body", children: [
716
+ /* @__PURE__ */ s(C, { className: "bn-mt-suggestion-menu-item-title", children: i.title }),
717
+ /* @__PURE__ */ s(C, { className: "bn-mt-suggestion-menu-item-subtitle", children: i.subtext })
867
718
  ] }),
868
719
  i.badge && /* @__PURE__ */ s(
869
- b,
720
+ h,
870
721
  {
871
722
  "data-position": "right",
872
723
  className: "bn-mt-suggestion-menu-item-section",
873
- children: /* @__PURE__ */ s(Ne, { size: "xs", children: i.badge })
724
+ children: /* @__PURE__ */ s(Ce, { size: "xs", children: i.badge })
874
725
  }
875
726
  )
876
727
  ]
877
728
  }
878
729
  );
879
- }), yt = m((e, n) => {
730
+ }), ut = m((e, n) => {
880
731
  const { className: t, children: o, ...r } = e;
881
- return d(r), /* @__PURE__ */ s(b, { className: t, ref: n, children: o });
882
- }), xt = m((e, n) => {
732
+ return d(r), /* @__PURE__ */ s(h, { className: t, ref: n, children: o });
733
+ }), dt = m((e, n) => {
883
734
  const { className: t, ...o } = e;
884
- return d(o), /* @__PURE__ */ s(ee, { className: t, type: "dots", size: 16, ref: n });
885
- }), Ct = m((e, n) => {
886
- const { className: t, children: o, id: r, columns: i, ...l } = e;
887
- return d(l), /* @__PURE__ */ s(
735
+ return d(o), /* @__PURE__ */ s(X, { className: t, type: "dots", size: 16, ref: n });
736
+ }), mt = m((e, n) => {
737
+ const { className: t, children: o, id: r, columns: i, ...a } = e;
738
+ return d(a), /* @__PURE__ */ s(
888
739
  "div",
889
740
  {
890
741
  className: t,
@@ -895,42 +746,42 @@ const ae = Fe(void 0), Ye = m((e, n) => {
895
746
  children: o
896
747
  }
897
748
  );
898
- }), wt = m((e, n) => {
749
+ }), ft = m((e, n) => {
899
750
  const { className: t, children: o, columns: r, ...i } = e;
900
751
  return d(i), /* @__PURE__ */ s(
901
- b,
752
+ h,
902
753
  {
903
754
  className: t,
904
755
  style: { gridColumn: `1 / ${r + 1}` },
905
756
  ref: n,
906
- children: /* @__PURE__ */ s(b, { className: "bn-mt-suggestion-menu-item-title", children: o })
757
+ children: /* @__PURE__ */ s(h, { className: "bn-mt-suggestion-menu-item-title", children: o })
907
758
  }
908
759
  );
909
- }), Tt = m((e, n) => {
910
- const { className: t, isSelected: o, onClick: r, item: i, id: l, ...a } = e;
911
- d(a);
912
- const u = k(null);
913
- return _(() => {
914
- if (!u.current || !o)
760
+ }), gt = m((e, n) => {
761
+ const { className: t, isSelected: o, onClick: r, item: i, id: a, ...l } = e;
762
+ d(l);
763
+ const c = j(null);
764
+ return $(() => {
765
+ if (!c.current || !o)
915
766
  return;
916
- const c = Z(
917
- u.current,
767
+ const u = q(
768
+ c.current,
918
769
  document.querySelector(".bn-grid-suggestion-menu")
919
770
  );
920
- c === "top" ? u.current.scrollIntoView(!0) : c === "bottom" && u.current.scrollIntoView(!1);
771
+ u === "top" ? c.current.scrollIntoView(!0) : u === "bottom" && c.current.scrollIntoView(!1);
921
772
  }, [o]), /* @__PURE__ */ s(
922
773
  "div",
923
774
  {
924
775
  className: t,
925
- ref: R(n, u),
926
- id: l,
776
+ ref: A(n, c),
777
+ id: a,
927
778
  role: "option",
928
779
  onClick: r,
929
780
  "aria-selected": o || void 0,
930
781
  children: i.icon
931
782
  }
932
783
  );
933
- }), Nt = m((e, n) => {
784
+ }), bt = m((e, n) => {
934
785
  const {
935
786
  className: t,
936
787
  children: o,
@@ -939,7 +790,7 @@ const ae = Fe(void 0), Ye = m((e, n) => {
939
790
  ...i
940
791
  } = e;
941
792
  return d(i), /* @__PURE__ */ s(
942
- ee,
793
+ X,
943
794
  {
944
795
  className: t,
945
796
  style: { gridColumn: `1 / ${r + 1}` },
@@ -947,75 +798,187 @@ const ae = Fe(void 0), Ye = m((e, n) => {
947
798
  ref: n
948
799
  }
949
800
  );
950
- }), Pt = m((e, n) => {
951
- const { children: t, className: o, onMouseDown: r, onClick: i, ...l } = e;
952
- return d(l, !1), /* @__PURE__ */ s(
953
- N,
801
+ }), ht = m((e, n) => {
802
+ const { children: t, className: o, onMouseDown: r, onClick: i, ...a } = e;
803
+ return d(a, !1), /* @__PURE__ */ s(
804
+ T,
954
805
  {
955
806
  className: o,
956
807
  ref: n,
957
808
  onMouseDown: r,
958
809
  onClick: i,
959
- ...l,
810
+ ...a,
960
811
  children: t
961
812
  }
962
813
  );
963
- }), kt = m((e, n) => {
814
+ }), pt = m((e, n) => {
964
815
  const {
965
816
  className: t,
966
817
  children: o,
967
818
  draggable: r,
968
819
  onDragStart: i,
969
- onDragEnd: l,
970
- style: a,
971
- label: u,
972
- ...c
820
+ onDragEnd: a,
821
+ style: l,
822
+ label: c,
823
+ ...u
973
824
  } = e;
974
- return d(c, !1), /* @__PURE__ */ s(
975
- N,
825
+ return d(u, !1), /* @__PURE__ */ s(
826
+ T,
976
827
  {
977
828
  className: t,
978
829
  ref: n,
979
- "aria-label": u,
830
+ "aria-label": c,
980
831
  draggable: r,
981
832
  onDragStart: i,
982
- onDragEnd: l,
983
- style: a,
984
- ...c,
833
+ onDragEnd: a,
834
+ style: l,
835
+ ...u,
985
836
  children: o
986
837
  }
987
838
  );
988
- }), I = m(
839
+ }), D = m(
989
840
  (e, n) => {
990
841
  const {
991
842
  className: t,
992
843
  children: o,
993
844
  onMouseEnter: r,
994
845
  onMouseLeave: i,
995
- variant: l,
996
- ...a
846
+ variant: a,
847
+ ...l
997
848
  } = e;
998
- d(a);
999
- const { ref: u, focused: c } = te(), g = Re(c), h = R(n, u, g);
849
+ d(l);
850
+ const { ref: c, focused: u } = te(), g = Oe(u), b = A(n, c, g);
1000
851
  return /* @__PURE__ */ s(
1001
- Pe,
852
+ Ne,
1002
853
  {
1003
854
  className: t,
1004
- ref: h,
855
+ ref: b,
1005
856
  role: "toolbar",
1006
857
  onMouseEnter: r,
1007
858
  onMouseLeave: i,
1008
- gap: l === "action-toolbar" ? 2 : void 0,
859
+ gap: a === "action-toolbar" ? 2 : void 0,
1009
860
  children: o
1010
861
  }
1011
862
  );
1012
863
  }
1013
- ), L = m((e, n) => {
864
+ );
865
+ var re = {
866
+ color: void 0,
867
+ size: void 0,
868
+ className: void 0,
869
+ style: void 0,
870
+ attr: void 0
871
+ }, G = N.createContext && /* @__PURE__ */ N.createContext(re), vt = ["attr", "size", "title"];
872
+ function St(e, n) {
873
+ if (e == null) return {};
874
+ var t = yt(e, n), o, r;
875
+ if (Object.getOwnPropertySymbols) {
876
+ var i = Object.getOwnPropertySymbols(e);
877
+ for (r = 0; r < i.length; r++)
878
+ o = i[r], !(n.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(e, o) && (t[o] = e[o]);
879
+ }
880
+ return t;
881
+ }
882
+ function yt(e, n) {
883
+ if (e == null) return {};
884
+ var t = {};
885
+ for (var o in e)
886
+ if (Object.prototype.hasOwnProperty.call(e, o)) {
887
+ if (n.indexOf(o) >= 0) continue;
888
+ t[o] = e[o];
889
+ }
890
+ return t;
891
+ }
892
+ function F() {
893
+ return F = Object.assign ? Object.assign.bind() : function(e) {
894
+ for (var n = 1; n < arguments.length; n++) {
895
+ var t = arguments[n];
896
+ for (var o in t)
897
+ Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
898
+ }
899
+ return e;
900
+ }, F.apply(this, arguments);
901
+ }
902
+ function H(e, n) {
903
+ var t = Object.keys(e);
904
+ if (Object.getOwnPropertySymbols) {
905
+ var o = Object.getOwnPropertySymbols(e);
906
+ n && (o = o.filter(function(r) {
907
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
908
+ })), t.push.apply(t, o);
909
+ }
910
+ return t;
911
+ }
912
+ function M(e) {
913
+ for (var n = 1; n < arguments.length; n++) {
914
+ var t = arguments[n] != null ? arguments[n] : {};
915
+ n % 2 ? H(Object(t), !0).forEach(function(o) {
916
+ wt(e, o, t[o]);
917
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : H(Object(t)).forEach(function(o) {
918
+ Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
919
+ });
920
+ }
921
+ return e;
922
+ }
923
+ function wt(e, n, t) {
924
+ return n = xt(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
925
+ }
926
+ function xt(e) {
927
+ var n = Ct(e, "string");
928
+ return typeof n == "symbol" ? n : n + "";
929
+ }
930
+ function Ct(e, n) {
931
+ if (typeof e != "object" || !e) return e;
932
+ var t = e[Symbol.toPrimitive];
933
+ if (t !== void 0) {
934
+ var o = t.call(e, n);
935
+ if (typeof o != "object") return o;
936
+ throw new TypeError("@@toPrimitive must return a primitive value.");
937
+ }
938
+ return (n === "string" ? String : Number)(e);
939
+ }
940
+ function se(e) {
941
+ return e && e.map((n, t) => /* @__PURE__ */ N.createElement(n.tag, M({
942
+ key: t
943
+ }, n.attr), se(n.child)));
944
+ }
945
+ function Nt(e) {
946
+ return (n) => /* @__PURE__ */ N.createElement(Tt, F({
947
+ attr: M({}, e.attr)
948
+ }, n), se(e.child));
949
+ }
950
+ function Tt(e) {
951
+ var n = (t) => {
952
+ var {
953
+ attr: o,
954
+ size: r,
955
+ title: i
956
+ } = e, a = St(e, vt), l = r || t.size || "1em", c;
957
+ return t.className && (c = t.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ N.createElement("svg", F({
958
+ stroke: "currentColor",
959
+ fill: "currentColor",
960
+ strokeWidth: "0"
961
+ }, t.attr, o, a, {
962
+ className: c,
963
+ style: M(M({
964
+ color: e.color || t.color
965
+ }, t.style), e.style),
966
+ height: l,
967
+ width: l,
968
+ xmlns: "http://www.w3.org/2000/svg"
969
+ }), i && /* @__PURE__ */ N.createElement("title", null, i), e.children);
970
+ };
971
+ return G !== void 0 ? /* @__PURE__ */ N.createElement(G.Consumer, null, (t) => n(t)) : n(re);
972
+ }
973
+ function kt(e) {
974
+ return Nt({ 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);
975
+ }
976
+ const I = m((e, n) => {
1014
977
  const { className: t, items: o, isDisabled: r, ...i } = e;
1015
978
  d(i);
1016
- const l = o.filter((a) => a.isSelected)[0];
1017
- return l ? /* @__PURE__ */ v(
1018
- S,
979
+ const a = o.filter((l) => l.isSelected)[0];
980
+ return a ? /* @__PURE__ */ v(
981
+ p,
1019
982
  {
1020
983
  withinPortal: !1,
1021
984
  transitionProps: {
@@ -1024,151 +987,147 @@ const ae = Fe(void 0), Ye = m((e, n) => {
1024
987
  disabled: r,
1025
988
  middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
1026
989
  children: [
1027
- /* @__PURE__ */ s(S.Target, { children: /* @__PURE__ */ s(
1028
- N,
990
+ /* @__PURE__ */ s(p.Target, { children: /* @__PURE__ */ s(
991
+ T,
1029
992
  {
1030
- onMouseDown: (a) => {
1031
- B() && a.currentTarget.focus();
993
+ onMouseDown: (l) => {
994
+ R() && l.currentTarget.focus();
1032
995
  },
1033
- leftSection: l.icon,
1034
- rightSection: /* @__PURE__ */ s(Qe, {}),
996
+ leftSection: a.icon,
997
+ rightSection: /* @__PURE__ */ s(kt, {}),
1035
998
  size: "xs",
1036
999
  variant: "subtle",
1037
1000
  disabled: r,
1038
- children: l.text
1001
+ children: a.text
1039
1002
  }
1040
1003
  ) }),
1041
- /* @__PURE__ */ s(S.Dropdown, { className: t, ref: n, children: o.map((a) => /* @__PURE__ */ s(
1042
- S.Item,
1004
+ /* @__PURE__ */ s(p.Dropdown, { className: t, ref: n, children: o.map((l) => /* @__PURE__ */ s(
1005
+ p.Item,
1043
1006
  {
1044
- onClick: a.onClick,
1045
- leftSection: a.icon,
1046
- rightSection: a.isSelected ? /* @__PURE__ */ s(Y, { size: 10, className: "bn-tick-icon" }) : (
1007
+ onClick: l.onClick,
1008
+ leftSection: l.icon,
1009
+ rightSection: l.isSelected ? /* @__PURE__ */ s(B, { size: 10, className: "bn-tick-icon" }) : (
1047
1010
  // Ensures space for tick even if item isn't currently selected.
1048
1011
  /* @__PURE__ */ s("div", { className: "bn-tick-space" })
1049
1012
  ),
1050
- disabled: a.isDisabled,
1051
- children: a.text
1013
+ disabled: l.isDisabled,
1014
+ children: l.text
1052
1015
  },
1053
- a.text
1016
+ l.text
1054
1017
  )) })
1055
1018
  ]
1056
1019
  }
1057
1020
  ) : null;
1058
- }), Mt = {
1021
+ }), Pt = {
1059
1022
  FormattingToolbar: {
1060
- Root: I,
1061
- Button: D,
1062
- Select: L
1023
+ Root: D,
1024
+ Button: O,
1025
+ Select: I
1063
1026
  },
1064
1027
  FilePanel: {
1065
- Root: at,
1066
- Button: lt,
1067
- FileInput: ct,
1068
- TabPanel: ut,
1069
- TextInput: dt
1028
+ Root: Qe,
1029
+ Button: Xe,
1030
+ FileInput: Ye,
1031
+ TabPanel: et,
1032
+ TextInput: tt
1070
1033
  },
1071
1034
  GridSuggestionMenu: {
1072
- Root: Ct,
1073
- Item: Tt,
1074
- EmptyItem: wt,
1075
- Loader: Nt
1035
+ Root: mt,
1036
+ Item: gt,
1037
+ EmptyItem: ft,
1038
+ Loader: bt
1076
1039
  },
1077
1040
  LinkToolbar: {
1078
- Root: I,
1079
- Button: D,
1080
- Select: L
1041
+ Root: D,
1042
+ Button: O,
1043
+ Select: I
1081
1044
  },
1082
1045
  SideMenu: {
1083
- Root: ht,
1084
- Button: bt
1046
+ Root: st,
1047
+ Button: it
1085
1048
  },
1086
1049
  SuggestionMenu: {
1087
- Root: pt,
1088
- Item: St,
1089
- EmptyItem: vt,
1090
- Label: yt,
1091
- Loader: xt
1050
+ Root: at,
1051
+ Item: ct,
1052
+ EmptyItem: lt,
1053
+ Label: ut,
1054
+ Loader: dt
1092
1055
  },
1093
1056
  TableHandle: {
1094
- Root: kt,
1095
- ExtendButton: Pt
1057
+ Root: pt,
1058
+ ExtendButton: ht
1096
1059
  },
1097
1060
  Generic: {
1098
1061
  Badge: {
1099
- Root: Le,
1062
+ Root: Re,
1100
1063
  Group: Be
1101
1064
  },
1102
1065
  Form: {
1103
1066
  Root: (e) => /* @__PURE__ */ s("div", { children: e.children }),
1104
- TextInput: Ge
1067
+ TextInput: Ve
1105
1068
  },
1106
1069
  Menu: {
1107
- Root: et,
1108
- Trigger: nt,
1109
- Dropdown: ot,
1110
- Divider: rt,
1111
- Label: st,
1112
- Item: tt,
1113
- Button: it
1070
+ Root: He,
1071
+ Trigger: Ue,
1072
+ Dropdown: We,
1073
+ Divider: qe,
1074
+ Label: Ze,
1075
+ Item: Ke,
1076
+ Button: Je
1114
1077
  },
1115
1078
  Popover: {
1116
- Root: mt,
1117
- Trigger: ft,
1118
- Content: gt
1079
+ Root: nt,
1080
+ Trigger: ot,
1081
+ Content: rt
1119
1082
  },
1120
1083
  Toolbar: {
1121
- Root: I,
1122
- Button: D,
1123
- Select: L
1084
+ Root: D,
1085
+ Button: O,
1086
+ Select: I
1124
1087
  }
1125
1088
  },
1126
1089
  Comments: {
1127
- Comment: Ae,
1128
- Editor: _e,
1090
+ Comment: $e,
1091
+ Editor: Ae,
1129
1092
  Card: Ee,
1130
- CardSection: ze,
1131
- ExpandSectionsPrompt: je
1093
+ CardSection: Le,
1094
+ ExpandSectionsPrompt: ze
1132
1095
  }
1133
- }, Ft = {
1134
- // Removes button press effect
1135
- activeClassName: ""
1136
- }, Ot = (e) => {
1137
- const { className: n, theme: t, ...o } = e, r = q(), i = ge(), l = (r == null ? void 0 : r.colorSchemePreference) || i, a = E(
1138
- (c) => {
1139
- if (c && (Ie(c), typeof t == "object")) {
1096
+ }, Ft = (e) => {
1097
+ const { className: n, theme: t, ...o } = e, r = W(), i = me(), a = (r == null ? void 0 : r.colorSchemePreference) || i, l = Fe(
1098
+ (b) => {
1099
+ if (b && (Ie(b), typeof t == "object")) {
1140
1100
  if ("light" in t && "dark" in t) {
1141
- G(
1142
- t[l === "dark" ? "dark" : "light"],
1143
- c
1101
+ V(
1102
+ t[a === "dark" ? "dark" : "light"],
1103
+ b
1144
1104
  );
1145
1105
  return;
1146
1106
  }
1147
- G(t, c);
1107
+ V(t, b);
1148
1108
  return;
1149
1109
  }
1150
1110
  },
1151
- [l, t]
1152
- ), u = typeof t == "string" ? t : l !== "no-preference" ? l : "light";
1153
- return /* @__PURE__ */ s(he.Provider, { value: Mt, children: /* @__PURE__ */ s(
1111
+ [a, t]
1112
+ ), c = ee(Te), u = typeof t == "string" ? t : a !== "no-preference" ? a : "light", g = /* @__PURE__ */ s(fe.Provider, { value: Pt, children: /* @__PURE__ */ s(
1113
+ ge,
1114
+ {
1115
+ "data-mantine-color-scheme": u,
1116
+ className: E("bn-mantine", n || ""),
1117
+ theme: typeof t == "object" ? void 0 : t,
1118
+ ...o,
1119
+ ref: l
1120
+ }
1121
+ ) });
1122
+ return c ? g : /* @__PURE__ */ s(
1154
1123
  ke,
1155
1124
  {
1156
- theme: Ft,
1157
- cssVariablesSelector: ".bn-mantine",
1125
+ withCssVariables: !1,
1158
1126
  getRootElement: () => {
1159
1127
  },
1160
- children: /* @__PURE__ */ s(
1161
- be,
1162
- {
1163
- "data-mantine-color-scheme": u,
1164
- className: z("bn-mantine", n || ""),
1165
- theme: typeof t == "object" ? void 0 : t,
1166
- ...o,
1167
- ref: a
1168
- }
1169
- )
1128
+ children: g
1170
1129
  }
1171
- ) });
1130
+ );
1172
1131
  }, f = [
1173
1132
  "#FFFFFF",
1174
1133
  "#EFEFEF",
@@ -1180,7 +1139,7 @@ const ae = Fe(void 0), Ye = m((e, n) => {
1180
1139
  "#161616",
1181
1140
  "#0F0F0F",
1182
1141
  "#000000"
1183
- ], U = {
1142
+ ], K = {
1184
1143
  colors: {
1185
1144
  editor: {
1186
1145
  text: f[5],
@@ -1209,11 +1168,11 @@ const ae = Fe(void 0), Ye = m((e, n) => {
1209
1168
  shadow: f[2],
1210
1169
  border: f[1],
1211
1170
  sideMenu: f[2],
1212
- highlights: le
1171
+ highlights: ie
1213
1172
  },
1214
1173
  borderRadius: 6,
1215
1174
  fontFamily: '"Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Open Sans", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'
1216
- }, zt = {
1175
+ }, Et = {
1217
1176
  colors: {
1218
1177
  editor: {
1219
1178
  text: f[2],
@@ -1242,18 +1201,18 @@ const ae = Fe(void 0), Ye = m((e, n) => {
1242
1201
  shadow: f[8],
1243
1202
  border: f[7],
1244
1203
  sideMenu: f[4],
1245
- highlights: ce
1204
+ highlights: ae
1246
1205
  },
1247
- borderRadius: U.borderRadius,
1248
- fontFamily: U.fontFamily
1206
+ borderRadius: K.borderRadius,
1207
+ fontFamily: K.fontFamily
1249
1208
  };
1250
1209
  export {
1251
- Ot as BlockNoteView,
1252
- G as applyBlockNoteCSSVariablesFromTheme,
1253
- Mt as components,
1254
- zt as darkDefaultTheme,
1210
+ Ft as BlockNoteView,
1211
+ V as applyBlockNoteCSSVariablesFromTheme,
1212
+ Pt as components,
1213
+ Et as darkDefaultTheme,
1255
1214
  f as defaultColorScheme,
1256
- U as lightDefaultTheme,
1215
+ K as lightDefaultTheme,
1257
1216
  Ie as removeBlockNoteCSSVariables
1258
1217
  };
1259
1218
  //# sourceMappingURL=blocknote-mantine.js.map