@blocknote/ariakit 0.17.1 → 0.18.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,1165 +1,552 @@
1
- import Ae, { forwardRef as y, useRef as Le, useEffect as $e } from "react";
2
- import { assertEmpty as b, mergeCSSClasses as E, isSafari as Pr } from "@blocknote/core";
3
- import { elementOverflow as We, mergeRefs as Ve, ComponentsContext as Cr, BlockNoteViewRaw as wr } from "@blocknote/react";
4
- import { FormProvider as ne, FormLabel as Nr, FormInput as ae, MenuProvider as Or, Menu as Ir, MenuButton as Ye, MenuItem as Ne, MenuButtonArrow as Dr, CheckboxCheck as Oe, MenuGroupLabel as Mr, MenuSeparator as Fr, TabProvider as Ar, TabList as Lr, Tab as $r, TabPanel as Wr, Button as se, PopoverDisclosure as Vr, Popover as Yr, PopoverProvider as Br, Group as Be, Toolbar as Ur, TooltipProvider as Gr, TooltipAnchor as qr, ToolbarItem as Ue, Tooltip as Kr, SelectProvider as Jr, Select as Hr, SelectArrow as zr, SelectPopover as Xr, SelectItem as Zr, SelectItemCheck as Qr } from "@ariakit/react";
5
- var te = { exports: {} }, W = {};
6
- /**
7
- * @license React
8
- * react-jsx-runtime.production.min.js
9
- *
10
- * Copyright (c) Facebook, Inc. and its affiliates.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- */
15
- var Ie;
16
- function et() {
17
- if (Ie) return W;
18
- Ie = 1;
19
- var n = Ae, a = Symbol.for("react.element"), o = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, l = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
20
- function d(g, c, v) {
21
- var j, _ = {}, w = null, Y = null;
22
- v !== void 0 && (w = "" + v), c.key !== void 0 && (w = "" + c.key), c.ref !== void 0 && (Y = c.ref);
23
- for (j in c) t.call(c, j) && !u.hasOwnProperty(j) && (_[j] = c[j]);
24
- if (g && g.defaultProps) for (j in c = g.defaultProps, c) _[j] === void 0 && (_[j] = c[j]);
25
- return { $$typeof: a, type: g, key: w, ref: Y, props: _, _owner: l.current };
26
- }
27
- return W.Fragment = o, W.jsx = d, W.jsxs = d, W;
28
- }
29
- var V = {};
30
- /**
31
- * @license React
32
- * react-jsx-runtime.development.js
33
- *
34
- * Copyright (c) Facebook, Inc. and its affiliates.
35
- *
36
- * This source code is licensed under the MIT license found in the
37
- * LICENSE file in the root directory of this source tree.
38
- */
39
- var De;
40
- function rt() {
41
- return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
42
- var n = Ae, a = Symbol.for("react.element"), o = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), g = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), j = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), oe = Symbol.iterator, Ge = "@@iterator";
43
- function qe(e) {
44
- if (e === null || typeof e != "object")
45
- return null;
46
- var r = oe && e[oe] || e[Ge];
47
- return typeof r == "function" ? r : null;
48
- }
49
- var D = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
50
- function k(e) {
51
- {
52
- for (var r = arguments.length, s = new Array(r > 1 ? r - 1 : 0), f = 1; f < r; f++)
53
- s[f - 1] = arguments[f];
54
- Ke("error", e, s);
55
- }
56
- }
57
- function Ke(e, r, s) {
58
- {
59
- var f = D.ReactDebugCurrentFrame, h = f.getStackAddendum();
60
- h !== "" && (r += "%s", s = s.concat([h]));
61
- var x = s.map(function(p) {
62
- return String(p);
63
- });
64
- x.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, x);
65
- }
66
- }
67
- var Je = !1, He = !1, ze = !1, Xe = !1, Ze = !1, ie;
68
- ie = Symbol.for("react.module.reference");
69
- function Qe(e) {
70
- return !!(typeof e == "string" || typeof e == "function" || e === t || e === u || Ze || e === l || e === v || e === j || Xe || e === Y || Je || He || ze || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === _ || e.$$typeof === d || e.$$typeof === g || e.$$typeof === c || // This needs to include all possible module reference object
71
- // types supported by any Flight configuration anywhere since
72
- // we don't know which Flight build this will end up being used
73
- // with.
74
- e.$$typeof === ie || e.getModuleId !== void 0));
75
- }
76
- function er(e, r, s) {
77
- var f = e.displayName;
78
- if (f)
79
- return f;
80
- var h = r.displayName || r.name || "";
81
- return h !== "" ? s + "(" + h + ")" : s;
82
- }
83
- function le(e) {
84
- return e.displayName || "Context";
85
- }
86
- function N(e) {
87
- if (e == null)
88
- return null;
89
- if (typeof e.tag == "number" && k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
90
- return e.displayName || e.name || null;
91
- if (typeof e == "string")
92
- return e;
93
- switch (e) {
94
- case t:
95
- return "Fragment";
96
- case o:
97
- return "Portal";
98
- case u:
99
- return "Profiler";
100
- case l:
101
- return "StrictMode";
102
- case v:
103
- return "Suspense";
104
- case j:
105
- return "SuspenseList";
106
- }
107
- if (typeof e == "object")
108
- switch (e.$$typeof) {
109
- case g:
110
- var r = e;
111
- return le(r) + ".Consumer";
112
- case d:
113
- var s = e;
114
- return le(s._context) + ".Provider";
115
- case c:
116
- return er(e, e.render, "ForwardRef");
117
- case _:
118
- var f = e.displayName || null;
119
- return f !== null ? f : N(e.type) || "Memo";
120
- case w: {
121
- var h = e, x = h._payload, p = h._init;
122
- try {
123
- return N(p(x));
124
- } catch {
125
- return null;
126
- }
127
- }
128
- }
129
- return null;
130
- }
131
- var O = Object.assign, A = 0, ce, ue, fe, de, me, ve, pe;
132
- function be() {
133
- }
134
- be.__reactDisabledLog = !0;
135
- function rr() {
136
- {
137
- if (A === 0) {
138
- ce = console.log, ue = console.info, fe = console.warn, de = console.error, me = console.group, ve = console.groupCollapsed, pe = console.groupEnd;
139
- var e = {
140
- configurable: !0,
141
- enumerable: !0,
142
- value: be,
143
- writable: !0
144
- };
145
- Object.defineProperties(console, {
146
- info: e,
147
- log: e,
148
- warn: e,
149
- error: e,
150
- group: e,
151
- groupCollapsed: e,
152
- groupEnd: e
153
- });
154
- }
155
- A++;
156
- }
157
- }
158
- function tr() {
159
- {
160
- if (A--, A === 0) {
161
- var e = {
162
- configurable: !0,
163
- enumerable: !0,
164
- writable: !0
165
- };
166
- Object.defineProperties(console, {
167
- log: O({}, e, {
168
- value: ce
169
- }),
170
- info: O({}, e, {
171
- value: ue
172
- }),
173
- warn: O({}, e, {
174
- value: fe
175
- }),
176
- error: O({}, e, {
177
- value: de
178
- }),
179
- group: O({}, e, {
180
- value: me
181
- }),
182
- groupCollapsed: O({}, e, {
183
- value: ve
184
- }),
185
- groupEnd: O({}, e, {
186
- value: pe
187
- })
188
- });
189
- }
190
- A < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
191
- }
192
- }
193
- var K = D.ReactCurrentDispatcher, J;
194
- function B(e, r, s) {
195
- {
196
- if (J === void 0)
197
- try {
198
- throw Error();
199
- } catch (h) {
200
- var f = h.stack.trim().match(/\n( *(at )?)/);
201
- J = f && f[1] || "";
202
- }
203
- return `
204
- ` + J + e;
205
- }
206
- }
207
- var H = !1, U;
208
- {
209
- var nr = typeof WeakMap == "function" ? WeakMap : Map;
210
- U = new nr();
211
- }
212
- function ge(e, r) {
213
- if (!e || H)
214
- return "";
215
- {
216
- var s = U.get(e);
217
- if (s !== void 0)
218
- return s;
219
- }
220
- var f;
221
- H = !0;
222
- var h = Error.prepareStackTrace;
223
- Error.prepareStackTrace = void 0;
224
- var x;
225
- x = K.current, K.current = null, rr();
226
- try {
227
- if (r) {
228
- var p = function() {
229
- throw Error();
230
- };
231
- if (Object.defineProperty(p.prototype, "props", {
232
- set: function() {
233
- throw Error();
234
- }
235
- }), typeof Reflect == "object" && Reflect.construct) {
236
- try {
237
- Reflect.construct(p, []);
238
- } catch (P) {
239
- f = P;
240
- }
241
- Reflect.construct(e, [], p);
242
- } else {
243
- try {
244
- p.call();
245
- } catch (P) {
246
- f = P;
247
- }
248
- e.call(p.prototype);
249
- }
250
- } else {
251
- try {
252
- throw Error();
253
- } catch (P) {
254
- f = P;
255
- }
256
- e();
257
- }
258
- } catch (P) {
259
- if (P && f && typeof P.stack == "string") {
260
- for (var m = P.stack.split(`
261
- `), S = f.stack.split(`
262
- `), R = m.length - 1, T = S.length - 1; R >= 1 && T >= 0 && m[R] !== S[T]; )
263
- T--;
264
- for (; R >= 1 && T >= 0; R--, T--)
265
- if (m[R] !== S[T]) {
266
- if (R !== 1 || T !== 1)
267
- do
268
- if (R--, T--, T < 0 || m[R] !== S[T]) {
269
- var C = `
270
- ` + m[R].replace(" at new ", " at ");
271
- return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, C), C;
272
- }
273
- while (R >= 1 && T >= 0);
274
- break;
275
- }
276
- }
277
- } finally {
278
- H = !1, K.current = x, tr(), Error.prepareStackTrace = h;
279
- }
280
- var F = e ? e.displayName || e.name : "", I = F ? B(F) : "";
281
- return typeof e == "function" && U.set(e, I), I;
282
- }
283
- function ar(e, r, s) {
284
- return ge(e, !1);
285
- }
286
- function sr(e) {
287
- var r = e.prototype;
288
- return !!(r && r.isReactComponent);
289
- }
290
- function G(e, r, s) {
291
- if (e == null)
292
- return "";
293
- if (typeof e == "function")
294
- return ge(e, sr(e));
295
- if (typeof e == "string")
296
- return B(e);
297
- switch (e) {
298
- case v:
299
- return B("Suspense");
300
- case j:
301
- return B("SuspenseList");
302
- }
303
- if (typeof e == "object")
304
- switch (e.$$typeof) {
305
- case c:
306
- return ar(e.render);
307
- case _:
308
- return G(e.type, r, s);
309
- case w: {
310
- var f = e, h = f._payload, x = f._init;
311
- try {
312
- return G(x(h), r, s);
313
- } catch {
314
- }
315
- }
316
- }
317
- return "";
318
- }
319
- var L = Object.prototype.hasOwnProperty, he = {}, xe = D.ReactDebugCurrentFrame;
320
- function q(e) {
321
- if (e) {
322
- var r = e._owner, s = G(e.type, e._source, r ? r.type : null);
323
- xe.setExtraStackFrame(s);
324
- } else
325
- xe.setExtraStackFrame(null);
326
- }
327
- function or(e, r, s, f, h) {
328
- {
329
- var x = Function.call.bind(L);
330
- for (var p in e)
331
- if (x(e, p)) {
332
- var m = void 0;
333
- try {
334
- if (typeof e[p] != "function") {
335
- var S = Error((f || "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`.");
336
- throw S.name = "Invariant Violation", S;
337
- }
338
- m = e[p](r, p, f, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
339
- } catch (R) {
340
- m = R;
341
- }
342
- m && !(m instanceof Error) && (q(h), k("%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).", f || "React class", s, p, typeof m), q(null)), m instanceof Error && !(m.message in he) && (he[m.message] = !0, q(h), k("Failed %s type: %s", s, m.message), q(null));
343
- }
344
- }
345
- }
346
- var ir = Array.isArray;
347
- function z(e) {
348
- return ir(e);
349
- }
350
- function lr(e) {
351
- {
352
- var r = typeof Symbol == "function" && Symbol.toStringTag, s = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
353
- return s;
354
- }
355
- }
356
- function cr(e) {
357
- try {
358
- return ye(e), !1;
359
- } catch {
360
- return !0;
361
- }
362
- }
363
- function ye(e) {
364
- return "" + e;
365
- }
366
- function je(e) {
367
- if (cr(e))
368
- return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", lr(e)), ye(e);
369
- }
370
- var $ = D.ReactCurrentOwner, ur = {
371
- key: !0,
372
- ref: !0,
373
- __self: !0,
374
- __source: !0
375
- }, Re, Ee, X;
376
- X = {};
377
- function fr(e) {
378
- if (L.call(e, "ref")) {
379
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
380
- if (r && r.isReactWarning)
381
- return !1;
382
- }
383
- return e.ref !== void 0;
384
- }
385
- function dr(e) {
386
- if (L.call(e, "key")) {
387
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
388
- if (r && r.isReactWarning)
389
- return !1;
390
- }
391
- return e.key !== void 0;
392
- }
393
- function mr(e, r) {
394
- if (typeof e.ref == "string" && $.current && r && $.current.stateNode !== r) {
395
- var s = N($.current.type);
396
- X[s] || (k('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', N($.current.type), e.ref), X[s] = !0);
397
- }
398
- }
399
- function vr(e, r) {
400
- {
401
- var s = function() {
402
- Re || (Re = !0, k("%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)", r));
403
- };
404
- s.isReactWarning = !0, Object.defineProperty(e, "key", {
405
- get: s,
406
- configurable: !0
407
- });
408
- }
409
- }
410
- function pr(e, r) {
411
- {
412
- var s = function() {
413
- Ee || (Ee = !0, k("%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)", r));
414
- };
415
- s.isReactWarning = !0, Object.defineProperty(e, "ref", {
416
- get: s,
417
- configurable: !0
418
- });
419
- }
420
- }
421
- var br = function(e, r, s, f, h, x, p) {
422
- var m = {
423
- // This tag allows us to uniquely identify this as a React Element
424
- $$typeof: a,
425
- // Built-in properties that belong on the element
426
- type: e,
427
- key: r,
428
- ref: s,
429
- props: p,
430
- // Record the component responsible for creating this element.
431
- _owner: x
432
- };
433
- return m._store = {}, Object.defineProperty(m._store, "validated", {
434
- configurable: !1,
435
- enumerable: !1,
436
- writable: !0,
437
- value: !1
438
- }), Object.defineProperty(m, "_self", {
439
- configurable: !1,
440
- enumerable: !1,
441
- writable: !1,
442
- value: f
443
- }), Object.defineProperty(m, "_source", {
444
- configurable: !1,
445
- enumerable: !1,
446
- writable: !1,
447
- value: h
448
- }), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
449
- };
450
- function gr(e, r, s, f, h) {
451
- {
452
- var x, p = {}, m = null, S = null;
453
- s !== void 0 && (je(s), m = "" + s), dr(r) && (je(r.key), m = "" + r.key), fr(r) && (S = r.ref, mr(r, h));
454
- for (x in r)
455
- L.call(r, x) && !ur.hasOwnProperty(x) && (p[x] = r[x]);
456
- if (e && e.defaultProps) {
457
- var R = e.defaultProps;
458
- for (x in R)
459
- p[x] === void 0 && (p[x] = R[x]);
460
- }
461
- if (m || S) {
462
- var T = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
463
- m && vr(p, T), S && pr(p, T);
464
- }
465
- return br(e, m, S, h, f, $.current, p);
466
- }
467
- }
468
- var Z = D.ReactCurrentOwner, Te = D.ReactDebugCurrentFrame;
469
- function M(e) {
470
- if (e) {
471
- var r = e._owner, s = G(e.type, e._source, r ? r.type : null);
472
- Te.setExtraStackFrame(s);
473
- } else
474
- Te.setExtraStackFrame(null);
475
- }
476
- var Q;
477
- Q = !1;
478
- function ee(e) {
479
- return typeof e == "object" && e !== null && e.$$typeof === a;
480
- }
481
- function _e() {
482
- {
483
- if (Z.current) {
484
- var e = N(Z.current.type);
485
- if (e)
486
- return `
487
-
488
- Check the render method of \`` + e + "`.";
489
- }
490
- return "";
491
- }
492
- }
493
- function hr(e) {
494
- return "";
495
- }
496
- var ke = {};
497
- function xr(e) {
498
- {
499
- var r = _e();
500
- if (!r) {
501
- var s = typeof e == "string" ? e : e.displayName || e.name;
502
- s && (r = `
503
-
504
- Check the top-level render call using <` + s + ">.");
505
- }
506
- return r;
507
- }
508
- }
509
- function Se(e, r) {
510
- {
511
- if (!e._store || e._store.validated || e.key != null)
512
- return;
513
- e._store.validated = !0;
514
- var s = xr(r);
515
- if (ke[s])
516
- return;
517
- ke[s] = !0;
518
- var f = "";
519
- e && e._owner && e._owner !== Z.current && (f = " It was passed a child from " + N(e._owner.type) + "."), M(e), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, f), M(null);
520
- }
521
- }
522
- function Pe(e, r) {
523
- {
524
- if (typeof e != "object")
525
- return;
526
- if (z(e))
527
- for (var s = 0; s < e.length; s++) {
528
- var f = e[s];
529
- ee(f) && Se(f, r);
530
- }
531
- else if (ee(e))
532
- e._store && (e._store.validated = !0);
533
- else if (e) {
534
- var h = qe(e);
535
- if (typeof h == "function" && h !== e.entries)
536
- for (var x = h.call(e), p; !(p = x.next()).done; )
537
- ee(p.value) && Se(p.value, r);
538
- }
539
- }
540
- }
541
- function yr(e) {
542
- {
543
- var r = e.type;
544
- if (r == null || typeof r == "string")
545
- return;
546
- var s;
547
- if (typeof r == "function")
548
- s = r.propTypes;
549
- else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
550
- // Inner props are checked in the reconciler.
551
- r.$$typeof === _))
552
- s = r.propTypes;
553
- else
554
- return;
555
- if (s) {
556
- var f = N(r);
557
- or(s, e.props, "prop", f, e);
558
- } else if (r.PropTypes !== void 0 && !Q) {
559
- Q = !0;
560
- var h = N(r);
561
- k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
562
- }
563
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
564
- }
565
- }
566
- function jr(e) {
567
- {
568
- for (var r = Object.keys(e.props), s = 0; s < r.length; s++) {
569
- var f = r[s];
570
- if (f !== "children" && f !== "key") {
571
- M(e), k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", f), M(null);
572
- break;
573
- }
574
- }
575
- e.ref !== null && (M(e), k("Invalid attribute `ref` supplied to `React.Fragment`."), M(null));
576
- }
577
- }
578
- var Ce = {};
579
- function we(e, r, s, f, h, x) {
580
- {
581
- var p = Qe(e);
582
- if (!p) {
583
- var m = "";
584
- (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.");
585
- var S = hr();
586
- S ? m += S : m += _e();
587
- var R;
588
- e === null ? R = "null" : z(e) ? R = "array" : e !== void 0 && e.$$typeof === a ? (R = "<" + (N(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, m);
589
- }
590
- var T = gr(e, r, s, h, x);
591
- if (T == null)
592
- return T;
593
- if (p) {
594
- var C = r.children;
595
- if (C !== void 0)
596
- if (f)
597
- if (z(C)) {
598
- for (var F = 0; F < C.length; F++)
599
- Pe(C[F], e);
600
- Object.freeze && Object.freeze(C);
601
- } else
602
- k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
603
- else
604
- Pe(C, e);
605
- }
606
- if (L.call(r, "key")) {
607
- var I = N(e), P = Object.keys(r).filter(function(Sr) {
608
- return Sr !== "key";
609
- }), re = P.length > 0 ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}";
610
- if (!Ce[I + re]) {
611
- var kr = P.length > 0 ? "{" + P.join(": ..., ") + ": ...}" : "{}";
612
- k(`A props object containing a "key" prop is being spread into JSX:
613
- let props = %s;
614
- <%s {...props} />
615
- React keys must be passed directly to JSX without using spread:
616
- let props = %s;
617
- <%s key={someKey} {...props} />`, re, I, kr, I), Ce[I + re] = !0;
618
- }
619
- }
620
- return e === t ? jr(T) : yr(T), T;
621
- }
622
- }
623
- function Rr(e, r, s) {
624
- return we(e, r, s, !0);
625
- }
626
- function Er(e, r, s) {
627
- return we(e, r, s, !1);
628
- }
629
- var Tr = Er, _r = Rr;
630
- V.Fragment = t, V.jsx = Tr, V.jsxs = _r;
631
- }()), V;
632
- }
633
- process.env.NODE_ENV === "production" ? te.exports = et() : te.exports = rt();
634
- var i = te.exports;
635
- const tt = (n) => {
636
- const { children: a, ...o } = n;
637
- return b(o), /* @__PURE__ */ i.jsx(ne, { children: a });
638
- }, nt = y((n, a) => {
1
+ import { jsx as r, jsxs as g, Fragment as L } from "react/jsx-runtime";
2
+ import { assertEmpty as i, mergeCSSClasses as b, isSafari as B } from "@blocknote/core";
3
+ import { elementOverflow as P, mergeRefs as C, ComponentsContext as F, BlockNoteViewRaw as E } from "@blocknote/react";
4
+ import { FormProvider as k, FormLabel as G, FormInput as f, MenuProvider as V, Menu as $, MenuButton as w, MenuItem as T, MenuButtonArrow as O, CheckboxCheck as S, MenuGroupLabel as A, MenuSeparator as H, TabProvider as j, TabList as q, Tab as K, TabPanel as z, Button as N, PopoverDisclosure as J, Popover as Q, PopoverProvider as U, Group as y, Toolbar as W, TooltipProvider as X, TooltipAnchor as Y, ToolbarItem as x, Tooltip as Z, SelectProvider as _, Select as ee, SelectArrow as ne, SelectPopover as te, SelectItem as se, SelectItemCheck as ae } from "@ariakit/react";
5
+ import { forwardRef as d, useRef as R, useEffect as D } from "react";
6
+ const re = (n) => {
7
+ const { children: t, ...s } = n;
8
+ return i(s), /* @__PURE__ */ r(k, { children: t });
9
+ }, oe = d((n, t) => {
639
10
  const {
640
- className: o,
641
- name: t,
642
- label: l,
643
- icon: u,
644
- value: d,
645
- autoFocus: g,
11
+ className: s,
12
+ name: e,
13
+ label: a,
14
+ icon: o,
15
+ value: l,
16
+ autoFocus: m,
646
17
  placeholder: c,
647
- onKeyDown: v,
648
- onChange: j,
649
- onSubmit: _,
650
- ...w
18
+ onKeyDown: u,
19
+ onChange: p,
20
+ onSubmit: h,
21
+ ...v
651
22
  } = n;
652
- return b(w), /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
653
- n.label && /* @__PURE__ */ i.jsx(Nr, { name: t, children: l }),
654
- /* @__PURE__ */ i.jsxs("div", { className: "bn-ak-input-wrapper", children: [
655
- u,
656
- /* @__PURE__ */ i.jsx(
657
- ae,
23
+ return i(v), /* @__PURE__ */ g(L, { children: [
24
+ n.label && /* @__PURE__ */ r(G, { name: e, children: a }),
25
+ /* @__PURE__ */ g("div", { className: "bn-ak-input-wrapper", children: [
26
+ o,
27
+ /* @__PURE__ */ r(
28
+ f,
658
29
  {
659
- className: E("bn-ak-input", o || ""),
660
- ref: a,
661
- name: t,
662
- value: d,
663
- autoFocus: g,
30
+ className: b("bn-ak-input", s || ""),
31
+ ref: t,
32
+ name: e,
33
+ value: l,
34
+ autoFocus: m,
664
35
  placeholder: c,
665
- onKeyDown: v,
666
- onChange: j,
667
- onSubmit: _
36
+ onKeyDown: u,
37
+ onChange: p,
38
+ onSubmit: h
668
39
  }
669
40
  )
670
41
  ] })
671
42
  ] });
672
- }), at = (n) => {
43
+ }), le = (n) => {
673
44
  const {
674
- children: a,
675
- onOpenChange: o,
676
- position: t,
677
- sub: l,
45
+ children: t,
46
+ onOpenChange: s,
47
+ position: e,
48
+ sub: a,
678
49
  // unused
679
- ...u
50
+ ...o
680
51
  } = n;
681
- return b(u), /* @__PURE__ */ i.jsx(
682
- Or,
52
+ return i(o), /* @__PURE__ */ r(
53
+ V,
683
54
  {
684
- placement: t,
685
- setOpen: o,
55
+ placement: e,
56
+ setOpen: s,
686
57
  virtualFocus: !0,
687
- children: a
58
+ children: t
688
59
  }
689
60
  );
690
- }, st = y((n, a) => {
61
+ }, ce = d((n, t) => {
691
62
  const {
692
- className: o,
693
- children: t,
694
- sub: l,
63
+ className: s,
64
+ children: e,
65
+ sub: a,
695
66
  // unused
696
- ...u
67
+ ...o
697
68
  } = n;
698
- return b(u), /* @__PURE__ */ i.jsx(
699
- Ir,
69
+ return i(o), /* @__PURE__ */ r(
70
+ $,
700
71
  {
701
72
  unmountOnHide: !0,
702
- className: E("bn-ak-menu", o || ""),
703
- ref: a,
704
- children: t
73
+ className: b("bn-ak-menu", s || ""),
74
+ ref: t,
75
+ children: e
705
76
  }
706
77
  );
707
- }), ot = y((n, a) => {
708
- const { className: o, children: t, icon: l, checked: u, subTrigger: d, onClick: g, ...c } = n;
709
- return b(c), d ? /* @__PURE__ */ i.jsxs(
710
- Ye,
78
+ }), ie = d((n, t) => {
79
+ const { className: s, children: e, icon: a, checked: o, subTrigger: l, onClick: m, ...c } = n;
80
+ return i(c), l ? /* @__PURE__ */ g(
81
+ w,
711
82
  {
712
- render: /* @__PURE__ */ i.jsx(Ne, {}),
713
- className: E("bn-ak-menu-item", o || ""),
714
- ref: a,
715
- onClick: g,
83
+ render: /* @__PURE__ */ r(T, {}),
84
+ className: b("bn-ak-menu-item", s || ""),
85
+ ref: t,
86
+ onClick: m,
716
87
  children: [
717
- l,
718
- t,
719
- /* @__PURE__ */ i.jsx(Dr, {}),
720
- u !== void 0 && /* @__PURE__ */ i.jsx(Oe, { checked: u })
88
+ a,
89
+ e,
90
+ /* @__PURE__ */ r(O, {}),
91
+ o !== void 0 && /* @__PURE__ */ r(S, { checked: o })
721
92
  ]
722
93
  }
723
- ) : /* @__PURE__ */ i.jsxs(
724
- Ne,
94
+ ) : /* @__PURE__ */ g(
95
+ T,
725
96
  {
726
- className: E("bn-ak-menu-item", o || ""),
727
- ref: a,
728
- onClick: g,
97
+ className: b("bn-ak-menu-item", s || ""),
98
+ ref: t,
99
+ onClick: m,
729
100
  children: [
730
- l,
731
- t,
732
- u !== void 0 && /* @__PURE__ */ i.jsx(Oe, { checked: u })
101
+ a,
102
+ e,
103
+ o !== void 0 && /* @__PURE__ */ r(S, { checked: o })
733
104
  ]
734
105
  }
735
106
  );
736
- }), it = y((n, a) => {
737
- const { className: o, children: t, ...l } = n;
738
- return b(l), /* @__PURE__ */ i.jsx(
739
- Mr,
107
+ }), ue = d((n, t) => {
108
+ const { className: s, children: e, ...a } = n;
109
+ return i(a), /* @__PURE__ */ r(
110
+ A,
740
111
  {
741
- className: E("bn-ak-group-label", o || ""),
742
- ref: a,
743
- children: t
112
+ className: b("bn-ak-group-label", s || ""),
113
+ ref: t,
114
+ children: e
744
115
  }
745
116
  );
746
- }), lt = (n) => {
747
- const { children: a, sub: o, ...t } = n;
748
- return b(t), o ? a : /* @__PURE__ */ i.jsx(Ye, { render: a });
749
- }, ct = y((n, a) => {
750
- const { className: o, ...t } = n;
751
- return b(t), /* @__PURE__ */ i.jsx(
752
- Fr,
117
+ }), de = (n) => {
118
+ const { children: t, sub: s, ...e } = n;
119
+ return i(e), s ? t : /* @__PURE__ */ r(w, { render: t });
120
+ }, me = d((n, t) => {
121
+ const { className: s, ...e } = n;
122
+ return i(e), /* @__PURE__ */ r(
123
+ H,
753
124
  {
754
- className: E("bn-ak-separator", o || ""),
755
- ref: a
125
+ className: b("bn-ak-separator", s || ""),
126
+ ref: t
756
127
  }
757
128
  );
758
- }), ut = y((n, a) => {
129
+ }), be = d((n, t) => {
759
130
  const {
760
- className: o,
761
- tabs: t,
762
- defaultOpenTab: l,
763
- openTab: u,
764
- setOpenTab: d,
765
- loading: g,
131
+ className: s,
132
+ tabs: e,
133
+ defaultOpenTab: a,
134
+ openTab: o,
135
+ setOpenTab: l,
136
+ loading: m,
766
137
  // TODO: implement loading
767
138
  ...c
768
139
  } = n;
769
- return b(c), /* @__PURE__ */ i.jsx(
140
+ return i(c), /* @__PURE__ */ r(
770
141
  "div",
771
142
  {
772
- className: E("bn-ak-wrapper", o || ""),
773
- ref: a,
774
- children: /* @__PURE__ */ i.jsxs(
775
- Ar,
143
+ className: b("bn-ak-wrapper", s || ""),
144
+ ref: t,
145
+ children: /* @__PURE__ */ g(
146
+ j,
776
147
  {
777
- defaultSelectedId: l,
778
- selectedId: u,
779
- setActiveId: (v) => {
780
- v && d(v);
148
+ defaultSelectedId: a,
149
+ selectedId: o,
150
+ setActiveId: (u) => {
151
+ u && l(u);
781
152
  },
782
153
  children: [
783
- /* @__PURE__ */ i.jsx(Lr, { className: "bn-ak-tab-list", children: t.map((v) => /* @__PURE__ */ i.jsx($r, { className: "bn-ak-tab", id: v.name, children: v.name }, v.name)) }),
784
- /* @__PURE__ */ i.jsx("div", { className: "bn-ak-panels", children: t.map((v) => /* @__PURE__ */ i.jsx(Wr, { tabId: v.name, children: v.tabPanel }, v.name)) })
154
+ /* @__PURE__ */ r(q, { className: "bn-ak-tab-list", children: e.map((u) => /* @__PURE__ */ r(K, { className: "bn-ak-tab", id: u.name, children: u.name }, u.name)) }),
155
+ /* @__PURE__ */ r("div", { className: "bn-ak-panels", children: e.map((u) => /* @__PURE__ */ r(z, { tabId: u.name, children: u.tabPanel }, u.name)) })
785
156
  ]
786
157
  }
787
158
  )
788
159
  }
789
160
  );
790
- }), ft = y((n, a) => {
791
- const { className: o, children: t, onClick: l, label: u, ...d } = n;
792
- return b(d), /* @__PURE__ */ i.jsx(
793
- se,
161
+ }), ge = d((n, t) => {
162
+ const { className: s, children: e, onClick: a, label: o, ...l } = n;
163
+ return i(l), /* @__PURE__ */ r(
164
+ N,
794
165
  {
795
- className: E("bn-ak-button", o || ""),
796
- onClick: l,
797
- "aria-label": u,
798
- ref: a,
799
- children: t
166
+ className: b("bn-ak-button", s || ""),
167
+ onClick: a,
168
+ "aria-label": o,
169
+ ref: t,
170
+ children: e
800
171
  }
801
172
  );
802
- }), dt = y((n, a) => {
803
- const { className: o, accept: t, value: l, placeholder: u, onChange: d, ...g } = n;
804
- return b(g), /* @__PURE__ */ i.jsx(ne, { children: /* @__PURE__ */ i.jsx(
805
- ae,
173
+ }), pe = d((n, t) => {
174
+ const { className: s, accept: e, value: a, placeholder: o, onChange: l, ...m } = n;
175
+ return i(m), /* @__PURE__ */ r(k, { children: /* @__PURE__ */ r(
176
+ f,
806
177
  {
807
- className: o,
808
- ref: a,
178
+ className: s,
179
+ ref: t,
809
180
  name: "panel-input",
810
181
  type: "file",
811
- accept: t,
812
- value: l ? l.name : void 0,
813
- onChange: async (c) => d == null ? void 0 : d(c.target.files[0]),
814
- placeholder: u
182
+ accept: e,
183
+ value: a ? a.name : void 0,
184
+ onChange: async (c) => l == null ? void 0 : l(c.target.files[0]),
185
+ placeholder: o
815
186
  }
816
187
  ) });
817
- }), mt = y((n, a) => {
818
- const { className: o, children: t, ...l } = n;
819
- return b(l), /* @__PURE__ */ i.jsx("div", { className: o, ref: a, children: t });
820
- }), vt = y((n, a) => {
821
- const { className: o, value: t, placeholder: l, onKeyDown: u, onChange: d, ...g } = n;
822
- return b(g), /* @__PURE__ */ i.jsx(ne, { children: /* @__PURE__ */ i.jsx(
823
- ae,
188
+ }), he = d((n, t) => {
189
+ const { className: s, children: e, ...a } = n;
190
+ return i(a), /* @__PURE__ */ r("div", { className: s, ref: t, children: e });
191
+ }), Ne = d((n, t) => {
192
+ const { className: s, value: e, placeholder: a, onKeyDown: o, onChange: l, ...m } = n;
193
+ return i(m), /* @__PURE__ */ r(k, { children: /* @__PURE__ */ r(
194
+ f,
824
195
  {
825
- className: E("bn-ak-input", o || ""),
196
+ className: b("bn-ak-input", s || ""),
826
197
  name: "panel-input",
827
- value: t,
828
- placeholder: l,
829
- onChange: d,
830
- onKeyDown: u,
198
+ value: e,
199
+ placeholder: a,
200
+ onChange: l,
201
+ onKeyDown: o,
831
202
  "data-test": "embed-input",
832
- ref: a
203
+ ref: t
833
204
  }
834
205
  ) });
835
- }), pt = y((n, a) => {
836
- const { children: o, ...t } = n;
837
- return b(t), /* @__PURE__ */ i.jsx(Vr, { render: o, ref: a });
838
- }), bt = y((n, a) => {
839
- const { className: o, children: t, variant: l, ...u } = n;
840
- return b(u), /* @__PURE__ */ i.jsx(
841
- Yr,
206
+ }), ve = d((n, t) => {
207
+ const { children: s, ...e } = n;
208
+ return i(e), /* @__PURE__ */ r(J, { render: s, ref: t });
209
+ }), ke = d((n, t) => {
210
+ const { className: s, children: e, variant: a, ...o } = n;
211
+ return i(o), /* @__PURE__ */ r(
212
+ Q,
842
213
  {
843
- className: E("bn-ak-popover", o || ""),
844
- ref: a,
845
- children: t
214
+ className: b("bn-ak-popover", s || ""),
215
+ ref: t,
216
+ children: e
846
217
  }
847
218
  );
848
- }), gt = (n) => {
849
- const { children: a, opened: o, position: t, ...l } = n;
850
- return b(l), /* @__PURE__ */ i.jsx(Br, { open: o, placement: t, children: a });
851
- }, ht = y((n, a) => {
852
- const { className: o, children: t, ...l } = n;
853
- return b(l, !1), /* @__PURE__ */ i.jsx(Be, { className: o, ref: a, ...l, children: t });
854
- }), xt = y((n, a) => {
219
+ }), fe = (n) => {
220
+ const { children: t, opened: s, position: e, ...a } = n;
221
+ return i(a), /* @__PURE__ */ r(U, { open: s, placement: e, children: t });
222
+ }, Te = d((n, t) => {
223
+ const { className: s, children: e, ...a } = n;
224
+ return i(a, !1), /* @__PURE__ */ r(y, { className: s, ref: t, ...a, children: e });
225
+ }), Se = d((n, t) => {
855
226
  const {
856
- className: o,
857
- children: t,
858
- icon: l,
859
- onClick: u,
860
- label: d,
861
- onDragEnd: g,
227
+ className: s,
228
+ children: e,
229
+ icon: a,
230
+ onClick: o,
231
+ label: l,
232
+ onDragEnd: m,
862
233
  onDragStart: c,
863
- draggable: v,
864
- ...j
234
+ draggable: u,
235
+ ...p
865
236
  } = n;
866
- return b(j, !1), /* @__PURE__ */ i.jsxs(
867
- se,
237
+ return i(p, !1), /* @__PURE__ */ g(
238
+ N,
868
239
  {
869
- onDragEnd: g,
240
+ onDragEnd: m,
870
241
  onDragStart: c,
871
- draggable: v,
872
- "aria-label": d,
873
- className: E(
242
+ draggable: u,
243
+ "aria-label": l,
244
+ className: b(
874
245
  "bn-ak-button bn-ak-secondary",
875
- o || ""
246
+ s || ""
876
247
  ),
877
- ref: a,
878
- onClick: u,
879
- ...j,
248
+ ref: t,
249
+ onClick: o,
250
+ ...p,
880
251
  children: [
881
- l,
882
- t
252
+ a,
253
+ e
883
254
  ]
884
255
  }
885
256
  );
886
- }), yt = y((n, a) => {
887
- const { className: o, children: t, id: l, columns: u, ...d } = n;
888
- return b(d), /* @__PURE__ */ i.jsx(
257
+ }), Me = d((n, t) => {
258
+ const { className: s, children: e, id: a, columns: o, ...l } = n;
259
+ return i(l), /* @__PURE__ */ r(
889
260
  "div",
890
261
  {
891
- className: o,
892
- style: { gridTemplateColumns: `repeat(${u}, 1fr)` },
893
- ref: a,
894
- id: l,
262
+ className: s,
263
+ style: { gridTemplateColumns: `repeat(${o}, 1fr)` },
264
+ ref: t,
265
+ id: a,
895
266
  role: "grid",
896
- children: t
267
+ children: e
897
268
  }
898
269
  );
899
- }), jt = y((n, a) => {
900
- const { className: o, children: t, columns: l, ...u } = n;
901
- return b(u), /* @__PURE__ */ i.jsx(
270
+ }), Ie = d((n, t) => {
271
+ const { className: s, children: e, columns: a, ...o } = n;
272
+ return i(o), /* @__PURE__ */ r(
902
273
  "div",
903
274
  {
904
- className: E("bn-ak-menu-item", o || ""),
905
- style: { gridColumn: `1 / ${l + 1}` },
906
- ref: a,
907
- children: /* @__PURE__ */ i.jsx("div", { className: "bn-ak-suggestion-menu-item-label", children: t })
275
+ className: b("bn-ak-menu-item", s || ""),
276
+ style: { gridColumn: `1 / ${a + 1}` },
277
+ ref: t,
278
+ children: /* @__PURE__ */ r("div", { className: "bn-ak-suggestion-menu-item-label", children: e })
908
279
  }
909
280
  );
910
- }), Rt = y((n, a) => {
911
- const { className: o, isSelected: t, onClick: l, item: u, id: d, ...g } = n;
912
- b(g);
913
- const c = Le(null);
914
- return $e(() => {
915
- if (!c.current || !t)
281
+ }), Pe = d((n, t) => {
282
+ const { className: s, isSelected: e, onClick: a, item: o, id: l, ...m } = n;
283
+ i(m);
284
+ const c = R(null);
285
+ return D(() => {
286
+ if (!c.current || !e)
916
287
  return;
917
- const v = We(
288
+ const u = P(
918
289
  c.current,
919
290
  document.querySelector(".bn-grid-suggestion-menu")
920
291
  );
921
- v === "top" ? c.current.scrollIntoView(!0) : v === "bottom" && c.current.scrollIntoView(!1);
922
- }, [t]), /* @__PURE__ */ i.jsx(
292
+ u === "top" ? c.current.scrollIntoView(!0) : u === "bottom" && c.current.scrollIntoView(!1);
293
+ }, [e]), /* @__PURE__ */ r(
923
294
  "div",
924
295
  {
925
- className: o,
926
- ref: Ve([a, c]),
927
- id: d,
296
+ className: s,
297
+ ref: C([t, c]),
298
+ id: l,
928
299
  role: "option",
929
- onClick: l,
930
- "aria-selected": t || void 0,
931
- children: u.icon
300
+ onClick: a,
301
+ "aria-selected": e || void 0,
302
+ children: o.icon
932
303
  }
933
304
  );
934
- }), Et = y((n, a) => {
305
+ }), Ce = d((n, t) => {
935
306
  const {
936
- className: o,
937
- children: t,
307
+ className: s,
308
+ children: e,
938
309
  // unused, using "dots" instead
939
- columns: l,
940
- ...u
310
+ columns: a,
311
+ ...o
941
312
  } = n;
942
- return b(u), /* @__PURE__ */ i.jsx(
313
+ return i(o), /* @__PURE__ */ r(
943
314
  "div",
944
315
  {
945
- className: o,
946
- style: { gridColumn: `1 / ${l + 1}` },
947
- ref: a,
948
- children: t
316
+ className: s,
317
+ style: { gridColumn: `1 / ${a + 1}` },
318
+ ref: t,
319
+ children: e
949
320
  }
950
321
  );
951
- }), Tt = y((n, a) => {
952
- const { className: o, children: t, id: l, ...u } = n;
953
- return b(u), /* @__PURE__ */ i.jsx(
954
- Be,
322
+ }), we = d((n, t) => {
323
+ const { className: s, children: e, id: a, ...o } = n;
324
+ return i(o), /* @__PURE__ */ r(
325
+ y,
955
326
  {
956
- className: E("bn-ak-menu", o || ""),
957
- id: l,
327
+ className: b("bn-ak-menu", s || ""),
328
+ id: a,
958
329
  role: "listbox",
959
- ref: a,
960
- children: t
330
+ ref: t,
331
+ children: e
961
332
  }
962
333
  );
963
- }), _t = y((n, a) => {
964
- const { className: o, children: t, ...l } = n;
965
- return b(l), /* @__PURE__ */ i.jsx(
334
+ }), ye = d((n, t) => {
335
+ const { className: s, children: e, ...a } = n;
336
+ return i(a), /* @__PURE__ */ r(
966
337
  "div",
967
338
  {
968
- className: E("bn-ak-menu-item", o || ""),
969
- ref: a,
970
- children: /* @__PURE__ */ i.jsx("div", { className: "bn-ak-suggestion-menu-item-label", children: t })
339
+ className: b("bn-ak-menu-item", s || ""),
340
+ ref: t,
341
+ children: /* @__PURE__ */ r("div", { className: "bn-ak-suggestion-menu-item-label", children: e })
971
342
  }
972
343
  );
973
- }), kt = y((n, a) => {
974
- const { className: o, item: t, isSelected: l, onClick: u, id: d, ...g } = n;
975
- b(g);
976
- const c = Le(null);
977
- return $e(() => {
978
- if (!c.current || !l)
344
+ }), xe = d((n, t) => {
345
+ const { className: s, item: e, isSelected: a, onClick: o, id: l, ...m } = n;
346
+ i(m);
347
+ const c = R(null);
348
+ return D(() => {
349
+ if (!c.current || !a)
979
350
  return;
980
- const v = We(
351
+ const u = P(
981
352
  c.current,
982
353
  document.querySelector(".bn-suggestion-menu")
983
354
  );
984
- v === "top" ? c.current.scrollIntoView(!0) : v === "bottom" && c.current.scrollIntoView(!1);
985
- }, [l]), /* @__PURE__ */ i.jsxs(
355
+ u === "top" ? c.current.scrollIntoView(!0) : u === "bottom" && c.current.scrollIntoView(!1);
356
+ }, [a]), /* @__PURE__ */ g(
986
357
  "div",
987
358
  {
988
- className: E("bn-ak-menu-item", o || ""),
989
- ref: Ve([a, c]),
990
- id: d,
991
- onClick: u,
359
+ className: b("bn-ak-menu-item", s || ""),
360
+ ref: C([t, c]),
361
+ id: l,
362
+ onClick: o,
992
363
  role: "option",
993
- "aria-selected": l || void 0,
364
+ "aria-selected": a || void 0,
994
365
  children: [
995
- t.icon && /* @__PURE__ */ i.jsx(
366
+ e.icon && /* @__PURE__ */ r(
996
367
  "div",
997
368
  {
998
369
  className: "bn-ak-suggestion-menu-item-section",
999
370
  "data-position": "left",
1000
- children: t.icon
371
+ children: e.icon
1001
372
  }
1002
373
  ),
1003
- /* @__PURE__ */ i.jsxs("div", { className: "bn-ak-suggestion-menu-item-body", children: [
1004
- /* @__PURE__ */ i.jsx("div", { className: "bn-ak-suggestion-menu-item-title", children: t.title }),
1005
- /* @__PURE__ */ i.jsx("div", { className: "bn-ak-suggestion-menu-item-subtitle", children: t.subtext })
374
+ /* @__PURE__ */ g("div", { className: "bn-ak-suggestion-menu-item-body", children: [
375
+ /* @__PURE__ */ r("div", { className: "bn-ak-suggestion-menu-item-title", children: e.title }),
376
+ /* @__PURE__ */ r("div", { className: "bn-ak-suggestion-menu-item-subtitle", children: e.subtext })
1006
377
  ] }),
1007
- t.badge && /* @__PURE__ */ i.jsx(
378
+ e.badge && /* @__PURE__ */ r(
1008
379
  "div",
1009
380
  {
1010
381
  "data-position": "right",
1011
382
  className: "bn-ak-suggestion-menu-item-section",
1012
- children: /* @__PURE__ */ i.jsx("div", { children: t.badge })
383
+ children: /* @__PURE__ */ r("div", { children: e.badge })
1013
384
  }
1014
385
  )
1015
386
  ]
1016
387
  }
1017
388
  );
1018
- }), St = y((n, a) => {
1019
- const { className: o, children: t, ...l } = n;
1020
- return b(l), /* @__PURE__ */ i.jsx(
389
+ }), Re = d((n, t) => {
390
+ const { className: s, children: e, ...a } = n;
391
+ return i(a), /* @__PURE__ */ r(
1021
392
  "div",
1022
393
  {
1023
- className: E("bn-ak-group-label", o || ""),
1024
- ref: a,
1025
- children: t
394
+ className: b("bn-ak-group-label", s || ""),
395
+ ref: t,
396
+ children: e
1026
397
  }
1027
398
  );
1028
- }), Pt = y((n, a) => {
1029
- const { className: o, children: t, ...l } = n;
1030
- return b(l), /* @__PURE__ */ i.jsx("div", { className: o, ref: a, children: t });
1031
- }), Ct = y((n, a) => {
399
+ }), De = d((n, t) => {
400
+ const { className: s, children: e, ...a } = n;
401
+ return i(a), /* @__PURE__ */ r("div", { className: s, ref: t, children: e });
402
+ }), Le = d((n, t) => {
1032
403
  const {
1033
- className: o,
1034
- children: t,
1035
- draggable: l,
1036
- onDragStart: u,
1037
- onDragEnd: d,
1038
- style: g,
404
+ className: s,
405
+ children: e,
406
+ draggable: a,
407
+ onDragStart: o,
408
+ onDragEnd: l,
409
+ style: m,
1039
410
  label: c,
1040
- ...v
411
+ ...u
1041
412
  } = n;
1042
- return b(v, !1), /* @__PURE__ */ i.jsx(
1043
- se,
413
+ return i(u, !1), /* @__PURE__ */ r(
414
+ N,
1044
415
  {
1045
- className: E(
416
+ className: b(
1046
417
  "bn-ak-button bn-ak-secondary",
1047
- o || ""
418
+ s || ""
1048
419
  ),
1049
- ref: a,
420
+ ref: t,
1050
421
  "aria-label": c,
1051
- draggable: l,
1052
- onDragStart: u,
1053
- onDragEnd: d,
1054
- style: g,
1055
- ...v,
1056
- children: t
422
+ draggable: a,
423
+ onDragStart: o,
424
+ onDragEnd: l,
425
+ style: m,
426
+ ...u,
427
+ children: e
1057
428
  }
1058
429
  );
1059
- }), Me = y(
1060
- (n, a) => {
1061
- const { className: o, children: t, onMouseEnter: l, onMouseLeave: u, ...d } = n;
1062
- return b(d), /* @__PURE__ */ i.jsx(
1063
- Ur,
430
+ }), Be = d((n, t) => {
431
+ const { children: s, className: e, onMouseDown: a, onClick: o, ...l } = n;
432
+ return i(l, !1), /* @__PURE__ */ r(
433
+ N,
434
+ {
435
+ className: b(
436
+ "bn-ak-button bn-ak-secondary",
437
+ e || ""
438
+ ),
439
+ ref: t,
440
+ onMouseDown: a,
441
+ onClick: o,
442
+ ...l,
443
+ children: s
444
+ }
445
+ );
446
+ }), M = d(
447
+ (n, t) => {
448
+ const { className: s, children: e, onMouseEnter: a, onMouseLeave: o, ...l } = n;
449
+ return i(l), /* @__PURE__ */ r(
450
+ W,
1064
451
  {
1065
- className: E("bn-ak-toolbar", o || ""),
1066
- ref: a,
1067
- onMouseEnter: l,
1068
- onMouseLeave: u,
1069
- children: t
452
+ className: b("bn-ak-toolbar", s || ""),
453
+ ref: t,
454
+ onMouseEnter: a,
455
+ onMouseLeave: o,
456
+ children: e
1070
457
  }
1071
458
  );
1072
459
  }
1073
- ), Fe = y(
1074
- (n, a) => {
460
+ ), I = d(
461
+ (n, t) => {
1075
462
  const {
1076
- className: o,
1077
- children: t,
1078
- mainTooltip: l,
1079
- secondaryTooltip: u,
1080
- icon: d,
1081
- isSelected: g,
463
+ className: s,
464
+ children: e,
465
+ mainTooltip: a,
466
+ secondaryTooltip: o,
467
+ icon: l,
468
+ isSelected: m,
1082
469
  isDisabled: c,
1083
- onClick: v,
1084
- label: j,
1085
- ..._
470
+ onClick: u,
471
+ label: p,
472
+ ...h
1086
473
  } = n;
1087
- return b(_, !1), /* @__PURE__ */ i.jsxs(Gr, { children: [
1088
- /* @__PURE__ */ i.jsx(
1089
- qr,
474
+ return i(h, !1), /* @__PURE__ */ g(X, { children: [
475
+ /* @__PURE__ */ r(
476
+ Y,
1090
477
  {
1091
478
  className: "link",
1092
- render: /* @__PURE__ */ i.jsxs(
1093
- Ue,
479
+ render: /* @__PURE__ */ g(
480
+ x,
1094
481
  {
1095
- "aria-label": j,
1096
- className: E(
482
+ "aria-label": p,
483
+ className: b(
1097
484
  "bn-ak-button bn-ak-secondary",
1098
- o || ""
485
+ s || ""
1099
486
  ),
1100
- onMouseDown: (w) => {
1101
- Pr() && w.currentTarget.focus();
487
+ onMouseDown: (v) => {
488
+ B() && v.currentTarget.focus();
1102
489
  },
1103
- onClick: v,
1104
- "aria-pressed": g,
1105
- "data-selected": g ? "true" : void 0,
490
+ onClick: u,
491
+ "aria-pressed": m,
492
+ "data-selected": m ? "true" : void 0,
1106
493
  "data-test": n.mainTooltip.slice(0, 1).toLowerCase() + n.mainTooltip.replace(/\s+/g, "").slice(1),
1107
494
  disabled: c || !1,
1108
- ref: a,
1109
- ..._,
495
+ ref: t,
496
+ ...h,
1110
497
  children: [
1111
- d,
1112
- t
498
+ l,
499
+ e
1113
500
  ]
1114
501
  }
1115
502
  )
1116
503
  }
1117
504
  ),
1118
- /* @__PURE__ */ i.jsxs(Kr, { className: "bn-ak-tooltip", children: [
1119
- /* @__PURE__ */ i.jsx("span", { children: l }),
1120
- u && /* @__PURE__ */ i.jsx("span", { children: u })
505
+ /* @__PURE__ */ g(Z, { className: "bn-ak-tooltip", children: [
506
+ /* @__PURE__ */ r("span", { children: a }),
507
+ o && /* @__PURE__ */ r("span", { children: o })
1121
508
  ] })
1122
509
  ] });
1123
510
  }
1124
- ), wt = y((n, a) => {
1125
- const { className: o, items: t, isDisabled: l, ...u } = n;
1126
- b(u);
1127
- const d = n.items.filter((c) => c.isSelected)[0], g = (c) => {
1128
- var v, j;
1129
- (j = (v = t.find((_) => _.text === c)).onClick) == null || j.call(v);
511
+ ), Fe = d((n, t) => {
512
+ const { className: s, items: e, isDisabled: a, ...o } = n;
513
+ i(o);
514
+ const l = n.items.filter((c) => c.isSelected)[0], m = (c) => {
515
+ var u, p;
516
+ (p = (u = e.find((h) => h.text === c)).onClick) == null || p.call(u);
1130
517
  };
1131
- return /* @__PURE__ */ i.jsxs(Jr, { value: d.text, setValue: g, children: [
1132
- /* @__PURE__ */ i.jsxs(
1133
- Hr,
518
+ return /* @__PURE__ */ g(_, { value: l.text, setValue: m, children: [
519
+ /* @__PURE__ */ g(
520
+ ee,
1134
521
  {
1135
522
  className: "bn-ak-button bn-ak-secondary",
1136
- disabled: l,
523
+ disabled: a,
1137
524
  "aria-label": "Text alignment",
1138
- render: /* @__PURE__ */ i.jsx(Ue, {}),
525
+ render: /* @__PURE__ */ r(x, {}),
1139
526
  children: [
1140
- d.icon,
527
+ l.icon,
1141
528
  " ",
1142
- d.text,
529
+ l.text,
1143
530
  " ",
1144
- /* @__PURE__ */ i.jsx(zr, {})
531
+ /* @__PURE__ */ r(ne, {})
1145
532
  ]
1146
533
  }
1147
534
  ),
1148
- /* @__PURE__ */ i.jsx(
1149
- Xr,
535
+ /* @__PURE__ */ r(
536
+ te,
1150
537
  {
1151
- className: E("bn-ak-popover", o || ""),
1152
- ref: a,
538
+ className: b("bn-ak-popover", s || ""),
539
+ ref: t,
1153
540
  gutter: 4,
1154
- children: t.map((c) => /* @__PURE__ */ i.jsxs(
1155
- Zr,
541
+ children: e.map((c) => /* @__PURE__ */ g(
542
+ se,
1156
543
  {
1157
544
  className: "bn-ak-select-item",
1158
545
  value: c.text,
1159
546
  children: [
1160
547
  c.icon,
1161
548
  c.text,
1162
- c.text === d.text && /* @__PURE__ */ i.jsx(Qr, {})
549
+ c.text === l.text && /* @__PURE__ */ r(ae, {})
1163
550
  ]
1164
551
  },
1165
552
  c.text
@@ -1167,74 +554,75 @@ const tt = (n) => {
1167
554
  }
1168
555
  )
1169
556
  ] });
1170
- }), Nt = {
557
+ }), Ee = {
1171
558
  FormattingToolbar: {
1172
- Root: Me,
1173
- Button: Fe,
1174
- Select: wt
559
+ Root: M,
560
+ Button: I,
561
+ Select: Fe
1175
562
  },
1176
563
  FilePanel: {
1177
- Root: ut,
1178
- Button: ft,
1179
- FileInput: dt,
1180
- TabPanel: mt,
1181
- TextInput: vt
564
+ Root: be,
565
+ Button: ge,
566
+ FileInput: pe,
567
+ TabPanel: he,
568
+ TextInput: Ne
1182
569
  },
1183
570
  GridSuggestionMenu: {
1184
- Root: yt,
1185
- Item: Rt,
1186
- EmptyItem: jt,
1187
- Loader: Et
571
+ Root: Me,
572
+ Item: Pe,
573
+ EmptyItem: Ie,
574
+ Loader: Ce
1188
575
  },
1189
576
  LinkToolbar: {
1190
- Root: Me,
1191
- Button: Fe
577
+ Root: M,
578
+ Button: I
1192
579
  },
1193
580
  SideMenu: {
1194
- Root: ht,
1195
- Button: xt
581
+ Root: Te,
582
+ Button: Se
1196
583
  },
1197
584
  SuggestionMenu: {
1198
- Root: Tt,
1199
- Item: kt,
1200
- EmptyItem: _t,
1201
- Label: St,
1202
- Loader: Pt
585
+ Root: we,
586
+ Item: xe,
587
+ EmptyItem: ye,
588
+ Label: Re,
589
+ Loader: De
1203
590
  },
1204
591
  TableHandle: {
1205
- Root: Ct
592
+ Root: Le,
593
+ ExtendButton: Be
1206
594
  },
1207
595
  Generic: {
1208
596
  Form: {
1209
- Root: tt,
1210
- TextInput: nt
597
+ Root: re,
598
+ TextInput: oe
1211
599
  },
1212
600
  Menu: {
1213
- Root: at,
1214
- Trigger: lt,
1215
- Dropdown: st,
1216
- Divider: ct,
1217
- Label: it,
1218
- Item: ot
601
+ Root: le,
602
+ Trigger: de,
603
+ Dropdown: ce,
604
+ Divider: me,
605
+ Label: ue,
606
+ Item: ie
1219
607
  },
1220
608
  Popover: {
1221
- Root: gt,
1222
- Trigger: pt,
1223
- Content: bt
609
+ Root: fe,
610
+ Trigger: ve,
611
+ Content: ke
1224
612
  }
1225
613
  }
1226
- }, Ft = (n) => {
1227
- const { className: a, ...o } = n;
1228
- return /* @__PURE__ */ i.jsx(Cr.Provider, { value: Nt, children: /* @__PURE__ */ i.jsx(
1229
- wr,
614
+ }, He = (n) => {
615
+ const { className: t, ...s } = n;
616
+ return /* @__PURE__ */ r(F.Provider, { value: Ee, children: /* @__PURE__ */ r(
617
+ E,
1230
618
  {
1231
- className: E("bn-ariakit", a || ""),
1232
- ...o
619
+ className: b("bn-ariakit", t || ""),
620
+ ...s
1233
621
  }
1234
622
  ) });
1235
623
  };
1236
624
  export {
1237
- Ft as BlockNoteView,
1238
- Nt as components
625
+ He as BlockNoteView,
626
+ Ee as components
1239
627
  };
1240
628
  //# sourceMappingURL=blocknote-ariakit.js.map