@blocknote/mantine 0.13.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.
Files changed (54) hide show
  1. package/LICENSE +373 -0
  2. package/dist/blocknote-mantine.js +1532 -0
  3. package/dist/blocknote-mantine.js.map +1 -0
  4. package/dist/blocknote-mantine.umd.cjs +28 -0
  5. package/dist/blocknote-mantine.umd.cjs.map +1 -0
  6. package/dist/style.css +1 -0
  7. package/dist/webpack-stats.json +1 -0
  8. package/package.json +88 -0
  9. package/src/BlockNoteTheme.ts +153 -0
  10. package/src/defaultThemes.ts +159 -0
  11. package/src/form/TextInput.tsx +44 -0
  12. package/src/index.tsx +172 -0
  13. package/src/mantineStyles.css +138 -0
  14. package/src/menu/Menu.tsx +252 -0
  15. package/src/panel/Panel.tsx +50 -0
  16. package/src/panel/PanelButton.tsx +26 -0
  17. package/src/panel/PanelFileInput.tsx +26 -0
  18. package/src/panel/PanelTab.tsx +18 -0
  19. package/src/panel/PanelTextInput.tsx +27 -0
  20. package/src/popover/Popover.tsx +53 -0
  21. package/src/sideMenu/SideMenu.tsx +20 -0
  22. package/src/sideMenu/SideMenuButton.tsx +57 -0
  23. package/src/style.css +490 -0
  24. package/src/suggestionMenu/SuggestionMenu.tsx +25 -0
  25. package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +22 -0
  26. package/src/suggestionMenu/SuggestionMenuItem.tsx +47 -0
  27. package/src/suggestionMenu/SuggestionMenuLabel.tsx +20 -0
  28. package/src/suggestionMenu/SuggestionMenuLoader.tsx +20 -0
  29. package/src/tableHandle/TableHandle.tsx +37 -0
  30. package/src/toolbar/Toolbar.tsx +36 -0
  31. package/src/toolbar/ToolbarButton.tsx +106 -0
  32. package/src/toolbar/ToolbarSelect.tsx +69 -0
  33. package/types/src/BlockNoteTheme.d.ts +33 -0
  34. package/types/src/defaultThemes.d.ts +143 -0
  35. package/types/src/form/TextInput.d.ts +13 -0
  36. package/types/src/index.d.ts +14 -0
  37. package/types/src/menu/Menu.d.ts +24 -0
  38. package/types/src/panel/Panel.d.ts +12 -0
  39. package/types/src/panel/PanelButton.d.ts +11 -0
  40. package/types/src/panel/PanelFileInput.d.ts +7 -0
  41. package/types/src/panel/PanelTab.d.ts +5 -0
  42. package/types/src/panel/PanelTextInput.d.ts +8 -0
  43. package/types/src/popover/Popover.d.ts +9 -0
  44. package/types/src/sideMenu/SideMenu.d.ts +5 -0
  45. package/types/src/sideMenu/SideMenuButton.d.ts +15 -0
  46. package/types/src/suggestionMenu/SuggestionMenu.d.ts +6 -0
  47. package/types/src/suggestionMenu/SuggestionMenuEmptyItem.d.ts +5 -0
  48. package/types/src/suggestionMenu/SuggestionMenuItem.d.ts +8 -0
  49. package/types/src/suggestionMenu/SuggestionMenuLabel.d.ts +5 -0
  50. package/types/src/suggestionMenu/SuggestionMenuLoader.d.ts +5 -0
  51. package/types/src/tableHandle/TableHandle.d.ts +14 -0
  52. package/types/src/toolbar/Toolbar.d.ts +10 -0
  53. package/types/src/toolbar/ToolbarButton.d.ts +12 -0
  54. package/types/src/toolbar/ToolbarSelect.d.ts +12 -0
@@ -0,0 +1,1532 @@
1
+ import M, { forwardRef as k, createContext as jr, useState as Er, useRef as Sr, useCallback as ne, useContext as _r } from "react";
2
+ import { useBlockNoteContext as Cr, ComponentsContext as wr, BlockNoteViewRaw as Pr } from "@blocknote/react";
3
+ import * as d from "@mantine/core";
4
+ import { MantineProvider as Or } from "@mantine/core";
5
+ import Fr from "use-prefers-color-scheme";
6
+ import { assertEmpty as R, isSafari as ae } from "@blocknote/core";
7
+ import { useFocusWithin as Mr, useFocusTrap as Nr, mergeRefs as Dr } from "@mantine/hooks";
8
+ var oe = { exports: {} }, $ = {};
9
+ /**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+ var Oe;
19
+ function Ir() {
20
+ if (Oe)
21
+ return $;
22
+ Oe = 1;
23
+ var r = M, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
24
+ function f(u, b, g) {
25
+ var y, S = {}, w = null, V = null;
26
+ g !== void 0 && (w = "" + g), b.key !== void 0 && (w = "" + b.key), b.ref !== void 0 && (V = b.ref);
27
+ for (y in b)
28
+ a.call(b, y) && !c.hasOwnProperty(y) && (S[y] = b[y]);
29
+ if (u && u.defaultProps)
30
+ for (y in b = u.defaultProps, b)
31
+ S[y] === void 0 && (S[y] = b[y]);
32
+ return { $$typeof: n, type: u, key: w, ref: V, props: S, _owner: i.current };
33
+ }
34
+ return $.Fragment = o, $.jsx = f, $.jsxs = f, $;
35
+ }
36
+ var W = {};
37
+ /**
38
+ * @license React
39
+ * react-jsx-runtime.development.js
40
+ *
41
+ * Copyright (c) Facebook, Inc. and its affiliates.
42
+ *
43
+ * This source code is licensed under the MIT license found in the
44
+ * LICENSE file in the root directory of this source tree.
45
+ */
46
+ var Fe;
47
+ function Lr() {
48
+ return Fe || (Fe = 1, process.env.NODE_ENV !== "production" && function() {
49
+ var r = M, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), u = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), V = Symbol.for("react.offscreen"), ie = Symbol.iterator, Ve = "@@iterator";
50
+ function Ye(e) {
51
+ if (e === null || typeof e != "object")
52
+ return null;
53
+ var t = ie && e[ie] || e[Ve];
54
+ return typeof t == "function" ? t : null;
55
+ }
56
+ var I = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
57
+ function _(e) {
58
+ {
59
+ for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), v = 1; v < t; v++)
60
+ s[v - 1] = arguments[v];
61
+ Ue("error", e, s);
62
+ }
63
+ }
64
+ function Ue(e, t, s) {
65
+ {
66
+ var v = I.ReactDebugCurrentFrame, h = v.getStackAddendum();
67
+ h !== "" && (t += "%s", s = s.concat([h]));
68
+ var T = s.map(function(p) {
69
+ return String(p);
70
+ });
71
+ T.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, T);
72
+ }
73
+ }
74
+ var Ge = !1, He = !1, Ke = !1, qe = !1, Je = !1, se;
75
+ se = Symbol.for("react.module.reference");
76
+ function Xe(e) {
77
+ return !!(typeof e == "string" || typeof e == "function" || e === a || e === c || Je || e === i || e === g || e === y || qe || e === V || Ge || He || Ke || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === S || e.$$typeof === f || e.$$typeof === u || e.$$typeof === b || // This needs to include all possible module reference object
78
+ // types supported by any Flight configuration anywhere since
79
+ // we don't know which Flight build this will end up being used
80
+ // with.
81
+ e.$$typeof === se || e.getModuleId !== void 0));
82
+ }
83
+ function Ze(e, t, s) {
84
+ var v = e.displayName;
85
+ if (v)
86
+ return v;
87
+ var h = t.displayName || t.name || "";
88
+ return h !== "" ? s + "(" + h + ")" : s;
89
+ }
90
+ function le(e) {
91
+ return e.displayName || "Context";
92
+ }
93
+ function O(e) {
94
+ if (e == null)
95
+ return null;
96
+ if (typeof e.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
97
+ return e.displayName || e.name || null;
98
+ if (typeof e == "string")
99
+ return e;
100
+ switch (e) {
101
+ case a:
102
+ return "Fragment";
103
+ case o:
104
+ return "Portal";
105
+ case c:
106
+ return "Profiler";
107
+ case i:
108
+ return "StrictMode";
109
+ case g:
110
+ return "Suspense";
111
+ case y:
112
+ return "SuspenseList";
113
+ }
114
+ if (typeof e == "object")
115
+ switch (e.$$typeof) {
116
+ case u:
117
+ var t = e;
118
+ return le(t) + ".Consumer";
119
+ case f:
120
+ var s = e;
121
+ return le(s._context) + ".Provider";
122
+ case b:
123
+ return Ze(e, e.render, "ForwardRef");
124
+ case S:
125
+ var v = e.displayName || null;
126
+ return v !== null ? v : O(e.type) || "Memo";
127
+ case w: {
128
+ var h = e, T = h._payload, p = h._init;
129
+ try {
130
+ return O(p(T));
131
+ } catch {
132
+ return null;
133
+ }
134
+ }
135
+ }
136
+ return null;
137
+ }
138
+ var D = Object.assign, z = 0, ue, ce, de, fe, ve, be, ge;
139
+ function me() {
140
+ }
141
+ me.__reactDisabledLog = !0;
142
+ function Qe() {
143
+ {
144
+ if (z === 0) {
145
+ ue = console.log, ce = console.info, de = console.warn, fe = console.error, ve = console.group, be = console.groupCollapsed, ge = console.groupEnd;
146
+ var e = {
147
+ configurable: !0,
148
+ enumerable: !0,
149
+ value: me,
150
+ writable: !0
151
+ };
152
+ Object.defineProperties(console, {
153
+ info: e,
154
+ log: e,
155
+ warn: e,
156
+ error: e,
157
+ group: e,
158
+ groupCollapsed: e,
159
+ groupEnd: e
160
+ });
161
+ }
162
+ z++;
163
+ }
164
+ }
165
+ function er() {
166
+ {
167
+ if (z--, z === 0) {
168
+ var e = {
169
+ configurable: !0,
170
+ enumerable: !0,
171
+ writable: !0
172
+ };
173
+ Object.defineProperties(console, {
174
+ log: D({}, e, {
175
+ value: ue
176
+ }),
177
+ info: D({}, e, {
178
+ value: ce
179
+ }),
180
+ warn: D({}, e, {
181
+ value: de
182
+ }),
183
+ error: D({}, e, {
184
+ value: fe
185
+ }),
186
+ group: D({}, e, {
187
+ value: ve
188
+ }),
189
+ groupCollapsed: D({}, e, {
190
+ value: be
191
+ }),
192
+ groupEnd: D({}, e, {
193
+ value: ge
194
+ })
195
+ });
196
+ }
197
+ z < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
198
+ }
199
+ }
200
+ var q = I.ReactCurrentDispatcher, J;
201
+ function Y(e, t, s) {
202
+ {
203
+ if (J === void 0)
204
+ try {
205
+ throw Error();
206
+ } catch (h) {
207
+ var v = h.stack.trim().match(/\n( *(at )?)/);
208
+ J = v && v[1] || "";
209
+ }
210
+ return `
211
+ ` + J + e;
212
+ }
213
+ }
214
+ var X = !1, U;
215
+ {
216
+ var rr = typeof WeakMap == "function" ? WeakMap : Map;
217
+ U = new rr();
218
+ }
219
+ function pe(e, t) {
220
+ if (!e || X)
221
+ return "";
222
+ {
223
+ var s = U.get(e);
224
+ if (s !== void 0)
225
+ return s;
226
+ }
227
+ var v;
228
+ X = !0;
229
+ var h = Error.prepareStackTrace;
230
+ Error.prepareStackTrace = void 0;
231
+ var T;
232
+ T = q.current, q.current = null, Qe();
233
+ try {
234
+ if (t) {
235
+ var p = function() {
236
+ throw Error();
237
+ };
238
+ if (Object.defineProperty(p.prototype, "props", {
239
+ set: function() {
240
+ throw Error();
241
+ }
242
+ }), typeof Reflect == "object" && Reflect.construct) {
243
+ try {
244
+ Reflect.construct(p, []);
245
+ } catch (F) {
246
+ v = F;
247
+ }
248
+ Reflect.construct(e, [], p);
249
+ } else {
250
+ try {
251
+ p.call();
252
+ } catch (F) {
253
+ v = F;
254
+ }
255
+ e.call(p.prototype);
256
+ }
257
+ } else {
258
+ try {
259
+ throw Error();
260
+ } catch (F) {
261
+ v = F;
262
+ }
263
+ e();
264
+ }
265
+ } catch (F) {
266
+ if (F && v && typeof F.stack == "string") {
267
+ for (var m = F.stack.split(`
268
+ `), C = v.stack.split(`
269
+ `), j = m.length - 1, E = C.length - 1; j >= 1 && E >= 0 && m[j] !== C[E]; )
270
+ E--;
271
+ for (; j >= 1 && E >= 0; j--, E--)
272
+ if (m[j] !== C[E]) {
273
+ if (j !== 1 || E !== 1)
274
+ do
275
+ if (j--, E--, E < 0 || m[j] !== C[E]) {
276
+ var P = `
277
+ ` + m[j].replace(" at new ", " at ");
278
+ return e.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, P), P;
279
+ }
280
+ while (j >= 1 && E >= 0);
281
+ break;
282
+ }
283
+ }
284
+ } finally {
285
+ X = !1, q.current = T, er(), Error.prepareStackTrace = h;
286
+ }
287
+ var A = e ? e.displayName || e.name : "", Pe = A ? Y(A) : "";
288
+ return typeof e == "function" && U.set(e, Pe), Pe;
289
+ }
290
+ function tr(e, t, s) {
291
+ return pe(e, !1);
292
+ }
293
+ function nr(e) {
294
+ var t = e.prototype;
295
+ return !!(t && t.isReactComponent);
296
+ }
297
+ function G(e, t, s) {
298
+ if (e == null)
299
+ return "";
300
+ if (typeof e == "function")
301
+ return pe(e, nr(e));
302
+ if (typeof e == "string")
303
+ return Y(e);
304
+ switch (e) {
305
+ case g:
306
+ return Y("Suspense");
307
+ case y:
308
+ return Y("SuspenseList");
309
+ }
310
+ if (typeof e == "object")
311
+ switch (e.$$typeof) {
312
+ case b:
313
+ return tr(e.render);
314
+ case S:
315
+ return G(e.type, t, s);
316
+ case w: {
317
+ var v = e, h = v._payload, T = v._init;
318
+ try {
319
+ return G(T(h), t, s);
320
+ } catch {
321
+ }
322
+ }
323
+ }
324
+ return "";
325
+ }
326
+ var H = Object.prototype.hasOwnProperty, he = {}, xe = I.ReactDebugCurrentFrame;
327
+ function K(e) {
328
+ if (e) {
329
+ var t = e._owner, s = G(e.type, e._source, t ? t.type : null);
330
+ xe.setExtraStackFrame(s);
331
+ } else
332
+ xe.setExtraStackFrame(null);
333
+ }
334
+ function ar(e, t, s, v, h) {
335
+ {
336
+ var T = Function.call.bind(H);
337
+ for (var p in e)
338
+ if (T(e, p)) {
339
+ var m = void 0;
340
+ try {
341
+ if (typeof e[p] != "function") {
342
+ var C = Error((v || "React class") + ": " + s + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
343
+ throw C.name = "Invariant Violation", C;
344
+ }
345
+ m = e[p](t, p, v, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ } catch (j) {
347
+ m = j;
348
+ }
349
+ m && !(m instanceof Error) && (K(h), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", v || "React class", s, p, typeof m), K(null)), m instanceof Error && !(m.message in he) && (he[m.message] = !0, K(h), _("Failed %s type: %s", s, m.message), K(null));
350
+ }
351
+ }
352
+ }
353
+ var or = Array.isArray;
354
+ function Z(e) {
355
+ return or(e);
356
+ }
357
+ function ir(e) {
358
+ {
359
+ var t = typeof Symbol == "function" && Symbol.toStringTag, s = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
360
+ return s;
361
+ }
362
+ }
363
+ function sr(e) {
364
+ try {
365
+ return ye(e), !1;
366
+ } catch {
367
+ return !0;
368
+ }
369
+ }
370
+ function ye(e) {
371
+ return "" + e;
372
+ }
373
+ function Te(e) {
374
+ if (sr(e))
375
+ return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ir(e)), ye(e);
376
+ }
377
+ var B = I.ReactCurrentOwner, lr = {
378
+ key: !0,
379
+ ref: !0,
380
+ __self: !0,
381
+ __source: !0
382
+ }, Re, ke, Q;
383
+ Q = {};
384
+ function ur(e) {
385
+ if (H.call(e, "ref")) {
386
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
387
+ if (t && t.isReactWarning)
388
+ return !1;
389
+ }
390
+ return e.ref !== void 0;
391
+ }
392
+ function cr(e) {
393
+ if (H.call(e, "key")) {
394
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
395
+ if (t && t.isReactWarning)
396
+ return !1;
397
+ }
398
+ return e.key !== void 0;
399
+ }
400
+ function dr(e, t) {
401
+ if (typeof e.ref == "string" && B.current && t && B.current.stateNode !== t) {
402
+ var s = O(B.current.type);
403
+ Q[s] || (_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', O(B.current.type), e.ref), Q[s] = !0);
404
+ }
405
+ }
406
+ function fr(e, t) {
407
+ {
408
+ var s = function() {
409
+ Re || (Re = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
410
+ };
411
+ s.isReactWarning = !0, Object.defineProperty(e, "key", {
412
+ get: s,
413
+ configurable: !0
414
+ });
415
+ }
416
+ }
417
+ function vr(e, t) {
418
+ {
419
+ var s = function() {
420
+ ke || (ke = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
421
+ };
422
+ s.isReactWarning = !0, Object.defineProperty(e, "ref", {
423
+ get: s,
424
+ configurable: !0
425
+ });
426
+ }
427
+ }
428
+ var br = function(e, t, s, v, h, T, p) {
429
+ var m = {
430
+ // This tag allows us to uniquely identify this as a React Element
431
+ $$typeof: n,
432
+ // Built-in properties that belong on the element
433
+ type: e,
434
+ key: t,
435
+ ref: s,
436
+ props: p,
437
+ // Record the component responsible for creating this element.
438
+ _owner: T
439
+ };
440
+ return m._store = {}, Object.defineProperty(m._store, "validated", {
441
+ configurable: !1,
442
+ enumerable: !1,
443
+ writable: !0,
444
+ value: !1
445
+ }), Object.defineProperty(m, "_self", {
446
+ configurable: !1,
447
+ enumerable: !1,
448
+ writable: !1,
449
+ value: v
450
+ }), Object.defineProperty(m, "_source", {
451
+ configurable: !1,
452
+ enumerable: !1,
453
+ writable: !1,
454
+ value: h
455
+ }), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
456
+ };
457
+ function gr(e, t, s, v, h) {
458
+ {
459
+ var T, p = {}, m = null, C = null;
460
+ s !== void 0 && (Te(s), m = "" + s), cr(t) && (Te(t.key), m = "" + t.key), ur(t) && (C = t.ref, dr(t, h));
461
+ for (T in t)
462
+ H.call(t, T) && !lr.hasOwnProperty(T) && (p[T] = t[T]);
463
+ if (e && e.defaultProps) {
464
+ var j = e.defaultProps;
465
+ for (T in j)
466
+ p[T] === void 0 && (p[T] = j[T]);
467
+ }
468
+ if (m || C) {
469
+ var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
470
+ m && fr(p, E), C && vr(p, E);
471
+ }
472
+ return br(e, m, C, h, v, B.current, p);
473
+ }
474
+ }
475
+ var ee = I.ReactCurrentOwner, je = I.ReactDebugCurrentFrame;
476
+ function L(e) {
477
+ if (e) {
478
+ var t = e._owner, s = G(e.type, e._source, t ? t.type : null);
479
+ je.setExtraStackFrame(s);
480
+ } else
481
+ je.setExtraStackFrame(null);
482
+ }
483
+ var re;
484
+ re = !1;
485
+ function te(e) {
486
+ return typeof e == "object" && e !== null && e.$$typeof === n;
487
+ }
488
+ function Ee() {
489
+ {
490
+ if (ee.current) {
491
+ var e = O(ee.current.type);
492
+ if (e)
493
+ return `
494
+
495
+ Check the render method of \`` + e + "`.";
496
+ }
497
+ return "";
498
+ }
499
+ }
500
+ function mr(e) {
501
+ {
502
+ if (e !== void 0) {
503
+ var t = e.fileName.replace(/^.*[\\\/]/, ""), s = e.lineNumber;
504
+ return `
505
+
506
+ Check your code at ` + t + ":" + s + ".";
507
+ }
508
+ return "";
509
+ }
510
+ }
511
+ var Se = {};
512
+ function pr(e) {
513
+ {
514
+ var t = Ee();
515
+ if (!t) {
516
+ var s = typeof e == "string" ? e : e.displayName || e.name;
517
+ s && (t = `
518
+
519
+ Check the top-level render call using <` + s + ">.");
520
+ }
521
+ return t;
522
+ }
523
+ }
524
+ function _e(e, t) {
525
+ {
526
+ if (!e._store || e._store.validated || e.key != null)
527
+ return;
528
+ e._store.validated = !0;
529
+ var s = pr(t);
530
+ if (Se[s])
531
+ return;
532
+ Se[s] = !0;
533
+ var v = "";
534
+ e && e._owner && e._owner !== ee.current && (v = " It was passed a child from " + O(e._owner.type) + "."), L(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, v), L(null);
535
+ }
536
+ }
537
+ function Ce(e, t) {
538
+ {
539
+ if (typeof e != "object")
540
+ return;
541
+ if (Z(e))
542
+ for (var s = 0; s < e.length; s++) {
543
+ var v = e[s];
544
+ te(v) && _e(v, t);
545
+ }
546
+ else if (te(e))
547
+ e._store && (e._store.validated = !0);
548
+ else if (e) {
549
+ var h = Ye(e);
550
+ if (typeof h == "function" && h !== e.entries)
551
+ for (var T = h.call(e), p; !(p = T.next()).done; )
552
+ te(p.value) && _e(p.value, t);
553
+ }
554
+ }
555
+ }
556
+ function hr(e) {
557
+ {
558
+ var t = e.type;
559
+ if (t == null || typeof t == "string")
560
+ return;
561
+ var s;
562
+ if (typeof t == "function")
563
+ s = t.propTypes;
564
+ else if (typeof t == "object" && (t.$$typeof === b || // Note: Memo only checks outer props here.
565
+ // Inner props are checked in the reconciler.
566
+ t.$$typeof === S))
567
+ s = t.propTypes;
568
+ else
569
+ return;
570
+ if (s) {
571
+ var v = O(t);
572
+ ar(s, e.props, "prop", v, e);
573
+ } else if (t.PropTypes !== void 0 && !re) {
574
+ re = !0;
575
+ var h = O(t);
576
+ _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
577
+ }
578
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
579
+ }
580
+ }
581
+ function xr(e) {
582
+ {
583
+ for (var t = Object.keys(e.props), s = 0; s < t.length; s++) {
584
+ var v = t[s];
585
+ if (v !== "children" && v !== "key") {
586
+ L(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), L(null);
587
+ break;
588
+ }
589
+ }
590
+ e.ref !== null && (L(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), L(null));
591
+ }
592
+ }
593
+ function we(e, t, s, v, h, T) {
594
+ {
595
+ var p = Xe(e);
596
+ if (!p) {
597
+ var m = "";
598
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (m += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
599
+ var C = mr(h);
600
+ C ? m += C : m += Ee();
601
+ var j;
602
+ e === null ? j = "null" : Z(e) ? j = "array" : e !== void 0 && e.$$typeof === n ? (j = "<" + (O(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : j = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, m);
603
+ }
604
+ var E = gr(e, t, s, h, T);
605
+ if (E == null)
606
+ return E;
607
+ if (p) {
608
+ var P = t.children;
609
+ if (P !== void 0)
610
+ if (v)
611
+ if (Z(P)) {
612
+ for (var A = 0; A < P.length; A++)
613
+ Ce(P[A], e);
614
+ Object.freeze && Object.freeze(P);
615
+ } else
616
+ _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
617
+ else
618
+ Ce(P, e);
619
+ }
620
+ return e === a ? xr(E) : hr(E), E;
621
+ }
622
+ }
623
+ function yr(e, t, s) {
624
+ return we(e, t, s, !0);
625
+ }
626
+ function Tr(e, t, s) {
627
+ return we(e, t, s, !1);
628
+ }
629
+ var Rr = Tr, kr = yr;
630
+ W.Fragment = a, W.jsx = Rr, W.jsxs = kr;
631
+ }()), W;
632
+ }
633
+ process.env.NODE_ENV === "production" ? oe.exports = Ir() : oe.exports = Lr();
634
+ var l = oe.exports;
635
+ const Ae = (r, n, o = !1) => {
636
+ const a = [];
637
+ function i(c, f = "--bn") {
638
+ for (const u in c) {
639
+ const b = u.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), g = `${f}-${b}`;
640
+ typeof c[u] != "object" ? (typeof c[u] == "number" && (c[u] = `${c[u]}px`), o ? n.style.removeProperty(g) : n.style.setProperty(g, c[u].toString())) : i(c[u], g);
641
+ }
642
+ }
643
+ return i(r), a;
644
+ }, Me = (r, n) => Ae(r, n), Ar = {
645
+ colors: {
646
+ editor: {
647
+ text: void 0,
648
+ background: void 0
649
+ },
650
+ menu: {
651
+ text: void 0,
652
+ background: void 0
653
+ },
654
+ tooltip: {
655
+ text: void 0,
656
+ background: void 0
657
+ },
658
+ hovered: {
659
+ text: void 0,
660
+ background: void 0
661
+ },
662
+ selected: {
663
+ text: void 0,
664
+ background: void 0
665
+ },
666
+ disabled: {
667
+ text: void 0,
668
+ background: void 0
669
+ },
670
+ shadow: void 0,
671
+ border: void 0,
672
+ sideMenu: void 0,
673
+ highlights: {
674
+ gray: {
675
+ text: void 0,
676
+ background: void 0
677
+ },
678
+ brown: {
679
+ text: void 0,
680
+ background: void 0
681
+ },
682
+ red: {
683
+ text: void 0,
684
+ background: void 0
685
+ },
686
+ orange: {
687
+ text: void 0,
688
+ background: void 0
689
+ },
690
+ yellow: {
691
+ text: void 0,
692
+ background: void 0
693
+ },
694
+ green: {
695
+ text: void 0,
696
+ background: void 0
697
+ },
698
+ blue: {
699
+ text: void 0,
700
+ background: void 0
701
+ },
702
+ purple: {
703
+ text: void 0,
704
+ background: void 0
705
+ },
706
+ pink: {
707
+ text: void 0,
708
+ background: void 0
709
+ }
710
+ }
711
+ },
712
+ borderRadius: void 0,
713
+ fontFamily: void 0
714
+ }, zr = (r) => Ae(Ar, r, !0), Br = k((r, n) => {
715
+ const {
716
+ className: o,
717
+ name: a,
718
+ label: i,
719
+ icon: c,
720
+ value: f,
721
+ autoFocus: u,
722
+ placeholder: b,
723
+ onKeyDown: g,
724
+ onChange: y,
725
+ onSubmit: S,
726
+ ...w
727
+ } = r;
728
+ return R(w), /* @__PURE__ */ l.jsx(
729
+ d.TextInput,
730
+ {
731
+ size: "xs",
732
+ className: o,
733
+ ref: n,
734
+ name: a,
735
+ label: i,
736
+ leftSection: c,
737
+ value: f,
738
+ autoFocus: u,
739
+ "data-autofocus": u ? "true" : void 0,
740
+ placeholder: b,
741
+ onKeyDown: g,
742
+ onChange: y,
743
+ onSubmit: S
744
+ }
745
+ );
746
+ });
747
+ var ze = {
748
+ color: void 0,
749
+ size: void 0,
750
+ className: void 0,
751
+ style: void 0,
752
+ attr: void 0
753
+ }, Ne = M.createContext && M.createContext(ze), N = globalThis && globalThis.__assign || function() {
754
+ return N = Object.assign || function(r) {
755
+ for (var n, o = 1, a = arguments.length; o < a; o++) {
756
+ n = arguments[o];
757
+ for (var i in n)
758
+ Object.prototype.hasOwnProperty.call(n, i) && (r[i] = n[i]);
759
+ }
760
+ return r;
761
+ }, N.apply(this, arguments);
762
+ }, $r = globalThis && globalThis.__rest || function(r, n) {
763
+ var o = {};
764
+ for (var a in r)
765
+ Object.prototype.hasOwnProperty.call(r, a) && n.indexOf(a) < 0 && (o[a] = r[a]);
766
+ if (r != null && typeof Object.getOwnPropertySymbols == "function")
767
+ for (var i = 0, a = Object.getOwnPropertySymbols(r); i < a.length; i++)
768
+ n.indexOf(a[i]) < 0 && Object.prototype.propertyIsEnumerable.call(r, a[i]) && (o[a[i]] = r[a[i]]);
769
+ return o;
770
+ };
771
+ function Be(r) {
772
+ return r && r.map(function(n, o) {
773
+ return M.createElement(n.tag, N({
774
+ key: o
775
+ }, n.attr), Be(n.child));
776
+ });
777
+ }
778
+ function $e(r) {
779
+ return function(n) {
780
+ return M.createElement(Wr, N({
781
+ attr: N({}, r.attr)
782
+ }, n), Be(r.child));
783
+ };
784
+ }
785
+ function Wr(r) {
786
+ var n = function(o) {
787
+ var a = r.attr, i = r.size, c = r.title, f = $r(r, ["attr", "size", "title"]), u = i || o.size || "1em", b;
788
+ return o.className && (b = o.className), r.className && (b = (b ? b + " " : "") + r.className), M.createElement("svg", N({
789
+ stroke: "currentColor",
790
+ fill: "currentColor",
791
+ strokeWidth: "0"
792
+ }, o.attr, a, f, {
793
+ className: b,
794
+ style: N(N({
795
+ color: r.color || o.color
796
+ }, o.style), r.style),
797
+ height: u,
798
+ width: u,
799
+ xmlns: "http://www.w3.org/2000/svg"
800
+ }), c && M.createElement("title", null, c), r.children);
801
+ };
802
+ return Ne !== void 0 ? M.createElement(Ne.Consumer, null, function(o) {
803
+ return n(o);
804
+ }) : n(ze);
805
+ }
806
+ function Vr(r) {
807
+ return $e({ 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" } }] })(r);
808
+ }
809
+ function Yr(r) {
810
+ return $e({ 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" } }] })(r);
811
+ }
812
+ const We = jr(void 0), Ur = k((r, n) => {
813
+ const {
814
+ children: o,
815
+ onOpenChange: a,
816
+ position: i,
817
+ sub: c,
818
+ // not used
819
+ ...f
820
+ } = r;
821
+ R(f);
822
+ const [u, b] = Er(!1), g = Sr(), y = ne(() => {
823
+ g.current && clearTimeout(g.current), g.current = setTimeout(() => {
824
+ b(!1);
825
+ }, 250);
826
+ }, []), S = ne(() => {
827
+ g.current && clearTimeout(g.current), b(!0);
828
+ }, []);
829
+ return /* @__PURE__ */ l.jsx(
830
+ We.Provider,
831
+ {
832
+ value: {
833
+ onMenuMouseOver: S,
834
+ onMenuMouseLeave: y
835
+ },
836
+ children: /* @__PURE__ */ l.jsx(
837
+ d.Menu.Item,
838
+ {
839
+ className: "bn-menu-item bn-mt-sub-menu-item",
840
+ ref: n,
841
+ onMouseOver: S,
842
+ onMouseLeave: y,
843
+ children: /* @__PURE__ */ l.jsx(
844
+ d.Menu,
845
+ {
846
+ withinPortal: !1,
847
+ middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
848
+ trigger: "hover",
849
+ opened: u,
850
+ onClose: () => a == null ? void 0 : a(!1),
851
+ onOpen: () => a == null ? void 0 : a(!0),
852
+ position: i,
853
+ children: o
854
+ }
855
+ )
856
+ }
857
+ )
858
+ }
859
+ );
860
+ }), Gr = (r) => {
861
+ const { children: n, onOpenChange: o, position: a, sub: i, ...c } = r;
862
+ return R(c), i ? /* @__PURE__ */ l.jsx(Ur, { ...r }) : /* @__PURE__ */ l.jsx(
863
+ d.Menu,
864
+ {
865
+ withinPortal: !1,
866
+ middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
867
+ onClose: () => o == null ? void 0 : o(!1),
868
+ onOpen: () => o == null ? void 0 : o(!0),
869
+ position: a,
870
+ children: n
871
+ }
872
+ );
873
+ }, Hr = k((r, n) => {
874
+ const { className: o, children: a, icon: i, checked: c, subTrigger: f, onClick: u, ...b } = r;
875
+ return R(b, !1), f ? /* @__PURE__ */ l.jsxs("div", { ref: n, ...b, children: [
876
+ a,
877
+ /* @__PURE__ */ l.jsx(Yr, { size: 15 })
878
+ ] }) : /* @__PURE__ */ l.jsx(
879
+ d.Menu.Item,
880
+ {
881
+ className: o,
882
+ ref: n,
883
+ leftSection: i,
884
+ rightSection: c ? /* @__PURE__ */ l.jsx(d.CheckIcon, { size: 10 }) : c === !1 ? /* @__PURE__ */ l.jsx("div", { className: "bn-tick-space" }) : null,
885
+ onClick: u,
886
+ ...b,
887
+ children: a
888
+ }
889
+ );
890
+ }), Kr = (r) => {
891
+ const {
892
+ children: n,
893
+ sub: o,
894
+ // unused
895
+ ...a
896
+ } = r;
897
+ return R(a), /* @__PURE__ */ l.jsx(d.Menu.Target, { children: n });
898
+ }, qr = k((r, n) => {
899
+ const {
900
+ className: o,
901
+ children: a,
902
+ sub: i,
903
+ //unused
904
+ ...c
905
+ } = r;
906
+ R(c);
907
+ const f = _r(We);
908
+ return /* @__PURE__ */ l.jsx(
909
+ d.Menu.Dropdown,
910
+ {
911
+ className: o,
912
+ ref: n,
913
+ onMouseOver: f == null ? void 0 : f.onMenuMouseOver,
914
+ onMouseLeave: f == null ? void 0 : f.onMenuMouseLeave,
915
+ children: a
916
+ }
917
+ );
918
+ }), Jr = k((r, n) => {
919
+ const { className: o, ...a } = r;
920
+ return R(a), /* @__PURE__ */ l.jsx(d.Menu.Divider, { className: o, ref: n });
921
+ }), Xr = k((r, n) => {
922
+ const { className: o, children: a, ...i } = r;
923
+ return R(i), /* @__PURE__ */ l.jsx(d.Menu.Label, { className: o, ref: n, children: a });
924
+ }), Zr = k((r, n) => {
925
+ const {
926
+ className: o,
927
+ tabs: a,
928
+ defaultOpenTab: i,
929
+ openTab: c,
930
+ setOpenTab: f,
931
+ loading: u,
932
+ ...b
933
+ } = r;
934
+ return R(b), /* @__PURE__ */ l.jsx(d.Group, { className: o, ref: n, children: /* @__PURE__ */ l.jsxs(
935
+ d.Tabs,
936
+ {
937
+ value: c,
938
+ defaultValue: i,
939
+ onChange: f,
940
+ children: [
941
+ u && /* @__PURE__ */ l.jsx(d.LoadingOverlay, { visible: u }),
942
+ /* @__PURE__ */ l.jsx(d.Tabs.List, { children: a.map((g) => /* @__PURE__ */ l.jsx(
943
+ d.Tabs.Tab,
944
+ {
945
+ "data-test": `${g.name.toLowerCase()}-tab`,
946
+ value: g.name,
947
+ children: g.name
948
+ },
949
+ g.name
950
+ )) }),
951
+ a.map((g) => /* @__PURE__ */ l.jsx(d.Tabs.Panel, { value: g.name, children: g.tabPanel }, g.name))
952
+ ]
953
+ }
954
+ ) });
955
+ }), Qr = k((r, n) => {
956
+ const { className: o, children: a, onClick: i, label: c, ...f } = r;
957
+ return R(f), /* @__PURE__ */ l.jsx(
958
+ d.Button,
959
+ {
960
+ size: "xs",
961
+ "aria-label": c,
962
+ className: o,
963
+ ref: n,
964
+ onClick: i,
965
+ ...f,
966
+ children: a
967
+ }
968
+ );
969
+ }), et = k((r, n) => {
970
+ const { className: o, value: a, placeholder: i, onChange: c, ...f } = r;
971
+ return R(f), /* @__PURE__ */ l.jsx(
972
+ d.FileInput,
973
+ {
974
+ size: "xs",
975
+ className: o,
976
+ ref: n,
977
+ value: a,
978
+ placeholder: i,
979
+ onChange: c,
980
+ ...f
981
+ }
982
+ );
983
+ }), rt = k((r, n) => {
984
+ const { className: o, children: a, ...i } = r;
985
+ return R(i), /* @__PURE__ */ l.jsx("div", { className: o, ref: n, children: a });
986
+ }), tt = k((r, n) => {
987
+ const { className: o, value: a, placeholder: i, onKeyDown: c, onChange: f, ...u } = r;
988
+ return R(u), /* @__PURE__ */ l.jsx(
989
+ d.TextInput,
990
+ {
991
+ size: "xs",
992
+ "data-test": "embed-input",
993
+ className: o,
994
+ ref: n,
995
+ value: a,
996
+ placeholder: i,
997
+ onKeyDown: c,
998
+ onChange: f
999
+ }
1000
+ );
1001
+ }), nt = (r) => {
1002
+ const { children: n, opened: o, position: a, ...i } = r;
1003
+ return R(i), /* @__PURE__ */ l.jsx(
1004
+ d.Popover,
1005
+ {
1006
+ withinPortal: !1,
1007
+ zIndex: 1e4,
1008
+ opened: o,
1009
+ position: a,
1010
+ children: n
1011
+ }
1012
+ );
1013
+ }, at = (r) => {
1014
+ const { children: n, ...o } = r;
1015
+ return R(o), /* @__PURE__ */ l.jsx(d.PopoverTarget, { children: n });
1016
+ }, ot = k((r, n) => {
1017
+ const {
1018
+ className: o,
1019
+ children: a,
1020
+ variant: i,
1021
+ // unused
1022
+ ...c
1023
+ } = r;
1024
+ return R(c), /* @__PURE__ */ l.jsx(d.PopoverDropdown, { className: o, ref: n, children: a });
1025
+ }), it = k((r, n) => {
1026
+ const { className: o, children: a, ...i } = r;
1027
+ return R(i), /* @__PURE__ */ l.jsx(d.Group, { align: "center", gap: 0, className: o, ref: n, children: a });
1028
+ }), st = k((r, n) => {
1029
+ const {
1030
+ className: o,
1031
+ children: a,
1032
+ icon: i,
1033
+ onClick: c,
1034
+ onDragEnd: f,
1035
+ onDragStart: u,
1036
+ draggable: b,
1037
+ label: g,
1038
+ ...y
1039
+ } = r;
1040
+ return R(y, !1), i ? /* @__PURE__ */ l.jsx(
1041
+ d.ActionIcon,
1042
+ {
1043
+ size: 24,
1044
+ className: o,
1045
+ ref: n,
1046
+ onClick: c,
1047
+ onDragEnd: f,
1048
+ onDragStart: u,
1049
+ draggable: b,
1050
+ "aria-label": g,
1051
+ ...y,
1052
+ children: i
1053
+ }
1054
+ ) : /* @__PURE__ */ l.jsx(
1055
+ d.Button,
1056
+ {
1057
+ className: o,
1058
+ ref: n,
1059
+ onClick: c,
1060
+ onDragEnd: f,
1061
+ onDragStart: u,
1062
+ draggable: b,
1063
+ "aria-label": g,
1064
+ ...y,
1065
+ children: a
1066
+ }
1067
+ );
1068
+ }), lt = k((r, n) => {
1069
+ const { className: o, children: a, id: i, ...c } = r;
1070
+ return R(c), /* @__PURE__ */ l.jsx(
1071
+ d.Stack,
1072
+ {
1073
+ gap: 0,
1074
+ className: o,
1075
+ ref: n,
1076
+ id: i,
1077
+ role: "listbox",
1078
+ children: a
1079
+ }
1080
+ );
1081
+ }), ut = k((r, n) => {
1082
+ const { className: o, children: a, ...i } = r;
1083
+ return R(i), /* @__PURE__ */ l.jsx(d.Group, { className: o, ref: n, children: /* @__PURE__ */ l.jsx(d.Group, { className: "bn-mt-suggestion-menu-item-label", children: a }) });
1084
+ }), ct = k((r, n) => {
1085
+ const { className: o, isSelected: a, onClick: i, item: c, id: f, ...u } = r;
1086
+ return R(u), /* @__PURE__ */ l.jsxs(
1087
+ d.Group,
1088
+ {
1089
+ gap: 0,
1090
+ className: o,
1091
+ ref: n,
1092
+ id: f,
1093
+ role: "option",
1094
+ "aria-selected": a || void 0,
1095
+ children: [
1096
+ c.icon && /* @__PURE__ */ l.jsx(
1097
+ d.Group,
1098
+ {
1099
+ className: "bn-mt-suggestion-menu-item-section",
1100
+ "data-position": "left",
1101
+ children: c.icon
1102
+ }
1103
+ ),
1104
+ /* @__PURE__ */ l.jsxs(d.Stack, { gap: 0, className: "bn-mt-suggestion-menu-item-body", children: [
1105
+ /* @__PURE__ */ l.jsx(d.Text, { className: "bn-mt-suggestion-menu-item-title", children: c.title }),
1106
+ /* @__PURE__ */ l.jsx(d.Text, { className: "bn-mt-suggestion-menu-item-subtitle", children: c.subtext })
1107
+ ] }),
1108
+ c.badge && /* @__PURE__ */ l.jsx(
1109
+ d.Group,
1110
+ {
1111
+ "data-position": "right",
1112
+ className: "bn-mt-suggestion-menu-item-section",
1113
+ children: /* @__PURE__ */ l.jsx(d.Badge, { size: "xs", children: c.badge })
1114
+ }
1115
+ )
1116
+ ]
1117
+ }
1118
+ );
1119
+ }), dt = k((r, n) => {
1120
+ const { className: o, children: a, ...i } = r;
1121
+ return R(i), /* @__PURE__ */ l.jsx(d.Group, { className: o, ref: n, children: a });
1122
+ }), ft = k((r, n) => {
1123
+ const {
1124
+ className: o,
1125
+ children: a,
1126
+ // unused, using "dots" instead
1127
+ ...i
1128
+ } = r;
1129
+ return R(i), /* @__PURE__ */ l.jsx(d.Loader, { className: o, type: "dots", ref: n });
1130
+ }), vt = k((r, n) => {
1131
+ const {
1132
+ className: o,
1133
+ children: a,
1134
+ draggable: i,
1135
+ onDragStart: c,
1136
+ onDragEnd: f,
1137
+ style: u,
1138
+ label: b,
1139
+ ...g
1140
+ } = r;
1141
+ return R(g, !1), /* @__PURE__ */ l.jsx(
1142
+ "button",
1143
+ {
1144
+ className: o,
1145
+ ref: n,
1146
+ "aria-label": b,
1147
+ draggable: i,
1148
+ onDragStart: c,
1149
+ onDragEnd: f,
1150
+ style: u,
1151
+ ...g,
1152
+ children: a
1153
+ }
1154
+ );
1155
+ }), De = k(
1156
+ (r, n) => {
1157
+ const { className: o, children: a, onMouseEnter: i, onMouseLeave: c, ...f } = r;
1158
+ R(f);
1159
+ const { ref: u, focused: b } = Mr(), g = Nr(b), y = Dr(n, u, g);
1160
+ return /* @__PURE__ */ l.jsx(
1161
+ d.Group,
1162
+ {
1163
+ className: o,
1164
+ ref: y,
1165
+ role: "toolbar",
1166
+ onMouseEnter: i,
1167
+ onMouseLeave: c,
1168
+ children: a
1169
+ }
1170
+ );
1171
+ }
1172
+ ), bt = (r) => /* @__PURE__ */ l.jsxs(d.Stack, { gap: 0, className: "bn-tooltip", children: [
1173
+ /* @__PURE__ */ l.jsx(d.Text, { size: "sm", children: r.mainTooltip }),
1174
+ r.secondaryTooltip && /* @__PURE__ */ l.jsx(d.Text, { size: "xs", children: r.secondaryTooltip })
1175
+ ] }), Ie = k(
1176
+ (r, n) => {
1177
+ const {
1178
+ className: o,
1179
+ children: a,
1180
+ mainTooltip: i,
1181
+ secondaryTooltip: c,
1182
+ icon: f,
1183
+ isSelected: u,
1184
+ isDisabled: b,
1185
+ onClick: g,
1186
+ label: y,
1187
+ ...S
1188
+ } = r;
1189
+ return R(S, !1), /* @__PURE__ */ l.jsx(
1190
+ d.Tooltip,
1191
+ {
1192
+ withinPortal: !1,
1193
+ label: /* @__PURE__ */ l.jsx(
1194
+ bt,
1195
+ {
1196
+ mainTooltip: i,
1197
+ secondaryTooltip: c
1198
+ }
1199
+ ),
1200
+ children: a ? /* @__PURE__ */ l.jsx(
1201
+ d.Button,
1202
+ {
1203
+ "aria-label": y,
1204
+ className: o,
1205
+ onMouseDown: (w) => {
1206
+ ae() && w.currentTarget.focus();
1207
+ },
1208
+ onClick: g,
1209
+ "aria-pressed": u,
1210
+ "data-selected": u || void 0,
1211
+ "data-test": i.slice(0, 1).toLowerCase() + i.replace(/\s+/g, "").slice(1),
1212
+ size: "xs",
1213
+ disabled: b || !1,
1214
+ ref: n,
1215
+ ...S,
1216
+ children: a
1217
+ }
1218
+ ) : /* @__PURE__ */ l.jsx(
1219
+ d.ActionIcon,
1220
+ {
1221
+ className: o,
1222
+ "aria-label": y,
1223
+ onMouseDown: (w) => {
1224
+ ae() && w.currentTarget.focus();
1225
+ },
1226
+ onClick: g,
1227
+ "aria-pressed": u,
1228
+ "data-selected": u || void 0,
1229
+ "data-test": i.slice(0, 1).toLowerCase() + i.replace(/\s+/g, "").slice(1),
1230
+ size: 30,
1231
+ disabled: b || !1,
1232
+ ref: n,
1233
+ ...S,
1234
+ children: f
1235
+ }
1236
+ )
1237
+ }
1238
+ );
1239
+ }
1240
+ ), gt = k((r, n) => {
1241
+ const { className: o, items: a, isDisabled: i, ...c } = r;
1242
+ R(c);
1243
+ const f = a.filter((u) => u.isSelected)[0];
1244
+ return f ? /* @__PURE__ */ l.jsxs(
1245
+ d.Menu,
1246
+ {
1247
+ withinPortal: !1,
1248
+ transitionProps: {
1249
+ exitDuration: 0
1250
+ },
1251
+ disabled: i,
1252
+ middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
1253
+ children: [
1254
+ /* @__PURE__ */ l.jsx(d.Menu.Target, { children: /* @__PURE__ */ l.jsx(
1255
+ d.Button,
1256
+ {
1257
+ onMouseDown: (u) => {
1258
+ ae() && u.currentTarget.focus();
1259
+ },
1260
+ leftSection: f.icon,
1261
+ rightSection: /* @__PURE__ */ l.jsx(Vr, {}),
1262
+ size: "xs",
1263
+ variant: "subtle",
1264
+ disabled: i,
1265
+ children: f.text
1266
+ }
1267
+ ) }),
1268
+ /* @__PURE__ */ l.jsx(d.Menu.Dropdown, { className: o, ref: n, children: a.map((u) => /* @__PURE__ */ l.jsx(
1269
+ d.Menu.Item,
1270
+ {
1271
+ onClick: u.onClick,
1272
+ leftSection: u.icon,
1273
+ rightSection: u.isSelected ? /* @__PURE__ */ l.jsx(d.CheckIcon, { size: 10, className: "bn-tick-icon" }) : (
1274
+ // Ensures space for tick even if item isn't currently selected.
1275
+ /* @__PURE__ */ l.jsx("div", { className: "bn-tick-space" })
1276
+ ),
1277
+ disabled: u.isDisabled,
1278
+ children: u.text
1279
+ },
1280
+ u.text
1281
+ )) })
1282
+ ]
1283
+ }
1284
+ ) : null;
1285
+ });
1286
+ const x = [
1287
+ "#FFFFFF",
1288
+ "#EFEFEF",
1289
+ "#CFCFCF",
1290
+ "#AFAFAF",
1291
+ "#7F7F7F",
1292
+ "#3F3F3F",
1293
+ "#1F1F1F",
1294
+ "#161616",
1295
+ "#0F0F0F",
1296
+ "#000000"
1297
+ ], Le = {
1298
+ colors: {
1299
+ editor: {
1300
+ text: x[5],
1301
+ background: x[0]
1302
+ },
1303
+ menu: {
1304
+ text: x[5],
1305
+ background: x[0]
1306
+ },
1307
+ tooltip: {
1308
+ text: x[5],
1309
+ background: x[1]
1310
+ },
1311
+ hovered: {
1312
+ text: x[5],
1313
+ background: x[1]
1314
+ },
1315
+ selected: {
1316
+ text: x[0],
1317
+ background: x[5]
1318
+ },
1319
+ disabled: {
1320
+ text: x[3],
1321
+ background: x[1]
1322
+ },
1323
+ shadow: x[2],
1324
+ border: x[1],
1325
+ sideMenu: x[2],
1326
+ highlights: {
1327
+ gray: {
1328
+ text: "#9b9a97",
1329
+ background: "#ebeced"
1330
+ },
1331
+ brown: {
1332
+ text: "#64473a",
1333
+ background: "#e9e5e3"
1334
+ },
1335
+ red: {
1336
+ text: "#e03e3e",
1337
+ background: "#fbe4e4"
1338
+ },
1339
+ orange: {
1340
+ text: "#d9730d",
1341
+ background: "#f6e9d9"
1342
+ },
1343
+ yellow: {
1344
+ text: "#dfab01",
1345
+ background: "#fbf3db"
1346
+ },
1347
+ green: {
1348
+ text: "#4d6461",
1349
+ background: "#ddedea"
1350
+ },
1351
+ blue: {
1352
+ text: "#0b6e99",
1353
+ background: "#ddebf1"
1354
+ },
1355
+ purple: {
1356
+ text: "#6940a5",
1357
+ background: "#eae4f2"
1358
+ },
1359
+ pink: {
1360
+ text: "#ad1a72",
1361
+ background: "#f4dfeb"
1362
+ }
1363
+ }
1364
+ },
1365
+ borderRadius: 6,
1366
+ fontFamily: '"Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Open Sans", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'
1367
+ }, jt = {
1368
+ colors: {
1369
+ editor: {
1370
+ text: x[2],
1371
+ background: x[6]
1372
+ },
1373
+ menu: {
1374
+ text: x[2],
1375
+ background: x[6]
1376
+ },
1377
+ tooltip: {
1378
+ text: x[2],
1379
+ background: x[7]
1380
+ },
1381
+ hovered: {
1382
+ text: x[2],
1383
+ background: x[7]
1384
+ },
1385
+ selected: {
1386
+ text: x[2],
1387
+ background: x[8]
1388
+ },
1389
+ disabled: {
1390
+ text: x[5],
1391
+ background: x[7]
1392
+ },
1393
+ shadow: x[8],
1394
+ border: x[7],
1395
+ sideMenu: x[4],
1396
+ highlights: {
1397
+ gray: {
1398
+ text: "#bebdb8",
1399
+ background: "#9b9a97"
1400
+ },
1401
+ brown: {
1402
+ text: "#8e6552",
1403
+ background: "#64473a"
1404
+ },
1405
+ red: {
1406
+ text: "#ec4040",
1407
+ background: "#be3434"
1408
+ },
1409
+ orange: {
1410
+ text: "#e3790d",
1411
+ background: "#b7600a"
1412
+ },
1413
+ yellow: {
1414
+ text: "#dfab01",
1415
+ background: "#b58b00"
1416
+ },
1417
+ green: {
1418
+ text: "#6b8b87",
1419
+ background: "#4d6461"
1420
+ },
1421
+ blue: {
1422
+ text: "#0e87bc",
1423
+ background: "#0b6e99"
1424
+ },
1425
+ purple: {
1426
+ text: "#8552d7",
1427
+ background: "#6940a5"
1428
+ },
1429
+ pink: {
1430
+ text: "#da208f",
1431
+ background: "#ad1a72"
1432
+ }
1433
+ }
1434
+ },
1435
+ borderRadius: Le.borderRadius,
1436
+ fontFamily: Le.fontFamily
1437
+ }, mt = {
1438
+ FormattingToolbar: {
1439
+ Root: De,
1440
+ Button: Ie,
1441
+ Select: gt
1442
+ },
1443
+ ImagePanel: {
1444
+ Root: Zr,
1445
+ Button: Qr,
1446
+ FileInput: et,
1447
+ TabPanel: rt,
1448
+ TextInput: tt
1449
+ },
1450
+ LinkToolbar: {
1451
+ Root: De,
1452
+ Button: Ie
1453
+ },
1454
+ SideMenu: {
1455
+ Root: it,
1456
+ Button: st
1457
+ },
1458
+ SuggestionMenu: {
1459
+ Root: lt,
1460
+ Item: ct,
1461
+ EmptyItem: ut,
1462
+ Label: dt,
1463
+ Loader: ft
1464
+ },
1465
+ TableHandle: {
1466
+ Root: vt
1467
+ },
1468
+ Generic: {
1469
+ Form: {
1470
+ Root: (r) => /* @__PURE__ */ l.jsx("div", { children: r.children }),
1471
+ TextInput: Br
1472
+ },
1473
+ Menu: {
1474
+ Root: Gr,
1475
+ Trigger: Kr,
1476
+ Dropdown: qr,
1477
+ Divider: Jr,
1478
+ Label: Xr,
1479
+ Item: Hr
1480
+ },
1481
+ Popover: {
1482
+ Root: nt,
1483
+ Trigger: at,
1484
+ Content: ot
1485
+ }
1486
+ }
1487
+ }, pt = {
1488
+ // Removes button press effect
1489
+ activeClassName: ""
1490
+ }, Et = (r) => {
1491
+ const { theme: n, ...o } = r, a = Cr(), i = Fr(), c = (a == null ? void 0 : a.colorSchemePreference) || i, f = ne(
1492
+ (u) => {
1493
+ if (u && (zr(u), typeof n == "object")) {
1494
+ if ("light" in n && "dark" in n) {
1495
+ Me(
1496
+ n[c === "dark" ? "dark" : "light"],
1497
+ u
1498
+ );
1499
+ return;
1500
+ }
1501
+ Me(n, u);
1502
+ return;
1503
+ }
1504
+ },
1505
+ [c, n]
1506
+ );
1507
+ return /* @__PURE__ */ l.jsx(wr.Provider, { value: mt, children: /* @__PURE__ */ l.jsx(
1508
+ Or,
1509
+ {
1510
+ theme: pt,
1511
+ cssVariablesSelector: ".bn-container",
1512
+ children: /* @__PURE__ */ l.jsx(
1513
+ Pr,
1514
+ {
1515
+ theme: typeof n == "object" ? void 0 : n,
1516
+ ...o,
1517
+ ref: f
1518
+ }
1519
+ )
1520
+ }
1521
+ ) });
1522
+ };
1523
+ export {
1524
+ Et as BlockNoteView,
1525
+ Me as applyBlockNoteCSSVariablesFromTheme,
1526
+ mt as components,
1527
+ jt as darkDefaultTheme,
1528
+ x as defaultColorScheme,
1529
+ Le as lightDefaultTheme,
1530
+ zr as removeBlockNoteCSSVariables
1531
+ };
1532
+ //# sourceMappingURL=blocknote-mantine.js.map