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