@blocknote/ariakit 0.46.2 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +1,34 @@
1
- import { jsx as r, jsxs as h, Fragment as A } from "react/jsx-runtime";
2
- import { assertEmpty as u, mergeCSSClasses as b, isSafari as V } from "@blocknote/core";
3
- import { elementOverflow as B, mergeRefs as D, useFocusWithin as H, useDictionary as j, useBlockNoteContext as K, FormattingToolbarController as Q, getFormattingToolbarItems as z, FormattingToolbar as U, ComponentsContext as W, BlockNoteViewRaw as Z } from "@blocknote/react";
4
- import { FormProvider as C, FormLabel as _, FormInput as w, MenuButton as F, MenuButtonArrow as J, CheckboxCheck as y, MenuItem as P, MenuGroupLabel as X, MenuSeparator as Y, Menu as ee, MenuProvider as ne, Button as f, TabProvider as te, TabList as ae, Tab as se, TabPanel as re, Popover as oe, PopoverDisclosure as le, PopoverProvider as ce, Group as k, Toolbar as ie, TooltipProvider as R, TooltipAnchor as E, ToolbarItem as L, Tooltip as q, SelectProvider as ue, Select as de, SelectArrow as me, SelectPopover as be, SelectItem as he, SelectItemCheck as ge } from "@ariakit/react";
5
- import { forwardRef as d, useRef as G, useEffect as O, useState as pe } from "react";
1
+ import { jsx as r, jsxs as h, Fragment as H } from "react/jsx-runtime";
2
+ import { assertEmpty as i, mergeCSSClasses as b, isSafari as V } from "@blocknote/core";
3
+ import { elementOverflow as B, mergeRefs as D, useFocusWithin as j, useDictionary as K, useBlockNoteContext as Q, FormattingToolbarController as z, getFormattingToolbarItems as U, FormattingToolbar as W, ComponentsContext as Z, BlockNoteViewRaw as _ } from "@blocknote/react";
4
+ import { FormProvider as C, FormLabel as J, FormInput as w, MenuButton as F, MenuButtonArrow as X, CheckboxCheck as y, MenuItem as P, MenuGroupLabel as Y, MenuSeparator as ee, Menu as ne, MenuProvider as te, Button as v, TabProvider as ae, TabList as se, Tab as re, TabPanel as oe, Popover as le, PopoverDisclosure as ce, PopoverProvider as ie, Group as N, Toolbar as de, TooltipProvider as R, TooltipAnchor as E, ToolbarItem as L, Tooltip as q, SelectProvider as ue, Select as me, SelectArrow as be, SelectPopover as he, SelectItem as ge, SelectItemCheck as pe } from "@ariakit/react";
5
+ import { forwardRef as u, useRef as G, useEffect as A, useState as ke } from "react";
6
6
  const Ne = (n) => {
7
7
  const { children: t, ...a } = n;
8
- return u(a), /* @__PURE__ */ r(C, { children: t });
9
- }, ke = d((n, t) => {
8
+ return i(a), /* @__PURE__ */ r(C, { children: t });
9
+ }, ve = u((n, t) => {
10
10
  const {
11
11
  className: a,
12
12
  name: e,
13
13
  label: s,
14
14
  variant: o,
15
- icon: c,
15
+ icon: l,
16
16
  value: m,
17
- autoFocus: l,
18
- placeholder: i,
17
+ autoFocus: c,
18
+ placeholder: d,
19
19
  disabled: g,
20
20
  onKeyDown: p,
21
- onChange: N,
22
- onSubmit: v,
21
+ onChange: k,
22
+ onSubmit: f,
23
23
  autoComplete: T,
24
- rightSection: x,
24
+ "aria-activedescendant": x,
25
+ rightSection: O,
25
26
  ...$
26
27
  } = n;
27
- return u($), /* @__PURE__ */ h(A, { children: [
28
- n.label && /* @__PURE__ */ r(_, { name: e, children: s }),
28
+ return i($), /* @__PURE__ */ h(H, { children: [
29
+ n.label && /* @__PURE__ */ r(J, { name: e, children: s }),
29
30
  /* @__PURE__ */ h("div", { className: "bn-ak-input-wrapper", children: [
30
- c,
31
+ l,
31
32
  /* @__PURE__ */ r(
32
33
  w,
33
34
  {
@@ -39,16 +40,17 @@ const Ne = (n) => {
39
40
  ref: t,
40
41
  name: e,
41
42
  value: m,
42
- autoFocus: l,
43
- placeholder: i,
43
+ autoFocus: c,
44
+ placeholder: d,
44
45
  disabled: g,
45
46
  onKeyDown: p,
46
- onChange: N,
47
- onSubmit: v,
48
- autoComplete: T
47
+ onChange: k,
48
+ onSubmit: f,
49
+ autoComplete: T,
50
+ "aria-activedescendant": x
49
51
  }
50
52
  ),
51
- x
53
+ O
52
54
  ] })
53
55
  ] });
54
56
  }), fe = (n) => {
@@ -60,8 +62,8 @@ const Ne = (n) => {
60
62
  // unused
61
63
  ...o
62
64
  } = n;
63
- return u(o), /* @__PURE__ */ r(
64
- ne,
65
+ return i(o), /* @__PURE__ */ r(
66
+ te,
65
67
  {
66
68
  placement: e,
67
69
  setOpen: a,
@@ -69,7 +71,7 @@ const Ne = (n) => {
69
71
  children: t
70
72
  }
71
73
  );
72
- }, ve = d((n, t) => {
74
+ }, Te = u((n, t) => {
73
75
  const {
74
76
  className: a,
75
77
  children: e,
@@ -77,8 +79,8 @@ const Ne = (n) => {
77
79
  // unused
78
80
  ...o
79
81
  } = n;
80
- return u(o), /* @__PURE__ */ r(
81
- ee,
82
+ return i(o), /* @__PURE__ */ r(
83
+ ne,
82
84
  {
83
85
  unmountOnHide: !0,
84
86
  className: b("bn-ak-menu", a || ""),
@@ -86,9 +88,9 @@ const Ne = (n) => {
86
88
  children: e
87
89
  }
88
90
  );
89
- }), Te = d((n, t) => {
90
- const { className: a, children: e, icon: s, checked: o, subTrigger: c, onClick: m, ...l } = n;
91
- return u(l), c ? /* @__PURE__ */ h(
91
+ }), Se = u((n, t) => {
92
+ const { className: a, children: e, icon: s, checked: o, subTrigger: l, onClick: m, ...c } = n;
93
+ return i(c), l ? /* @__PURE__ */ h(
92
94
  F,
93
95
  {
94
96
  render: /* @__PURE__ */ r(P, {}),
@@ -98,7 +100,7 @@ const Ne = (n) => {
98
100
  children: [
99
101
  s,
100
102
  e,
101
- /* @__PURE__ */ r(J, {}),
103
+ /* @__PURE__ */ r(X, {}),
102
104
  o !== void 0 && /* @__PURE__ */ r(y, { checked: o })
103
105
  ]
104
106
  }
@@ -115,47 +117,47 @@ const Ne = (n) => {
115
117
  ]
116
118
  }
117
119
  );
118
- }), Se = d((n, t) => {
120
+ }), Me = u((n, t) => {
119
121
  const { className: a, children: e, ...s } = n;
120
- return u(s), /* @__PURE__ */ r(
121
- X,
122
+ return i(s), /* @__PURE__ */ r(
123
+ Y,
122
124
  {
123
125
  className: b("bn-ak-group-label", a || ""),
124
126
  ref: t,
125
127
  children: e
126
128
  }
127
129
  );
128
- }), Me = (n) => {
130
+ }), Ie = (n) => {
129
131
  const { children: t, sub: a, ...e } = n;
130
- return u(e), a ? t : /* @__PURE__ */ r(F, { render: t });
131
- }, Ie = d((n, t) => {
132
+ return i(e), a ? t : /* @__PURE__ */ r(F, { render: t });
133
+ }, Ce = u((n, t) => {
132
134
  const { className: a, ...e } = n;
133
- return u(e), /* @__PURE__ */ r(
134
- Y,
135
+ return i(e), /* @__PURE__ */ r(
136
+ ee,
135
137
  {
136
138
  className: b("bn-ak-separator", a || ""),
137
139
  ref: t
138
140
  }
139
141
  );
140
- }), Ce = d((n, t) => {
142
+ }), we = u((n, t) => {
141
143
  const {
142
144
  className: a,
143
145
  children: e,
144
146
  icon: s,
145
147
  onClick: o,
146
- label: c,
148
+ label: l,
147
149
  onDragEnd: m,
148
- onDragStart: l,
149
- draggable: i,
150
+ onDragStart: c,
151
+ draggable: d,
150
152
  ...g
151
153
  } = n;
152
- return u(g, !1), /* @__PURE__ */ h(
153
- f,
154
+ return i(g, !1), /* @__PURE__ */ h(
155
+ v,
154
156
  {
155
157
  onDragEnd: m,
156
- onDragStart: l,
157
- draggable: i,
158
- "aria-label": c,
158
+ onDragStart: c,
159
+ draggable: d,
160
+ "aria-label": l,
159
161
  className: b(
160
162
  "bn-ak-button bn-ak-secondary",
161
163
  a || ""
@@ -169,42 +171,42 @@ const Ne = (n) => {
169
171
  ]
170
172
  }
171
173
  );
172
- }), we = d((n, t) => {
174
+ }), xe = u((n, t) => {
173
175
  const {
174
176
  className: a,
175
177
  tabs: e,
176
178
  defaultOpenTab: s,
177
179
  openTab: o,
178
- setOpenTab: c,
180
+ setOpenTab: l,
179
181
  loading: m,
180
182
  // TODO: implement loading
181
- ...l
183
+ ...c
182
184
  } = n;
183
- return u(l), /* @__PURE__ */ r(
185
+ return i(c), /* @__PURE__ */ r(
184
186
  "div",
185
187
  {
186
188
  className: b("bn-ak-wrapper", a || ""),
187
189
  ref: t,
188
190
  children: /* @__PURE__ */ h(
189
- te,
191
+ ae,
190
192
  {
191
193
  defaultSelectedId: s,
192
194
  selectedId: o,
193
- setActiveId: (i) => {
194
- i && c(i);
195
+ setActiveId: (d) => {
196
+ d && l(d);
195
197
  },
196
198
  children: [
197
- /* @__PURE__ */ r(ae, { className: "bn-ak-tab-list", children: e.map((i) => /* @__PURE__ */ r(se, { className: "bn-ak-tab", id: i.name, children: i.name }, i.name)) }),
198
- /* @__PURE__ */ r("div", { className: "bn-ak-panels", children: e.map((i) => /* @__PURE__ */ r(re, { tabId: i.name, children: i.tabPanel }, i.name)) })
199
+ /* @__PURE__ */ r(se, { className: "bn-ak-tab-list", children: e.map((d) => /* @__PURE__ */ r(re, { className: "bn-ak-tab", id: d.name, children: d.name }, d.name)) }),
200
+ /* @__PURE__ */ r("div", { className: "bn-ak-panels", children: e.map((d) => /* @__PURE__ */ r(oe, { tabId: d.name, children: d.tabPanel }, d.name)) })
199
201
  ]
200
202
  }
201
203
  )
202
204
  }
203
205
  );
204
- }), xe = d((n, t) => {
205
- const { className: a, children: e, onClick: s, label: o, ...c } = n;
206
- return u(c), /* @__PURE__ */ r(
207
- f,
206
+ }), ye = u((n, t) => {
207
+ const { className: a, children: e, onClick: s, label: o, ...l } = n;
208
+ return i(l), /* @__PURE__ */ r(
209
+ v,
208
210
  {
209
211
  className: b("bn-ak-button", a || ""),
210
212
  onClick: s,
@@ -213,9 +215,9 @@ const Ne = (n) => {
213
215
  children: e
214
216
  }
215
217
  );
216
- }), ye = d((n, t) => {
217
- const { className: a, accept: e, value: s, placeholder: o, onChange: c, ...m } = n;
218
- return u(m), /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(
218
+ }), Pe = u((n, t) => {
219
+ const { className: a, accept: e, value: s, placeholder: o, onChange: l, ...m } = n;
220
+ return i(m), /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(
219
221
  w,
220
222
  {
221
223
  className: a,
@@ -224,35 +226,35 @@ const Ne = (n) => {
224
226
  type: "file",
225
227
  accept: e,
226
228
  value: s ? s.name : void 0,
227
- onChange: async (l) => c == null ? void 0 : c(l.target.files[0]),
229
+ onChange: async (c) => l == null ? void 0 : l(c.target.files[0]),
228
230
  placeholder: o
229
231
  }
230
232
  ) });
231
- }), Pe = d((n, t) => {
233
+ }), Be = u((n, t) => {
232
234
  const { className: a, children: e, ...s } = n;
233
- return u(s), /* @__PURE__ */ r("div", { className: a, ref: t, children: e });
234
- }), Be = d((n, t) => {
235
- const { className: a, value: e, placeholder: s, onKeyDown: o, onChange: c, ...m } = n;
236
- return u(m), /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(
235
+ return i(s), /* @__PURE__ */ r("div", { className: a, ref: t, children: e });
236
+ }), De = u((n, t) => {
237
+ const { className: a, value: e, placeholder: s, onKeyDown: o, onChange: l, ...m } = n;
238
+ return i(m), /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(
237
239
  w,
238
240
  {
239
241
  className: b("bn-ak-input", a || ""),
240
242
  name: "panel-input",
241
243
  value: e,
242
244
  placeholder: s,
243
- onChange: c,
245
+ onChange: l,
244
246
  onKeyDown: o,
245
247
  "data-test": "embed-input",
246
248
  ref: t
247
249
  }
248
250
  ) });
249
- }), De = d((n, t) => {
251
+ }), Fe = u((n, t) => {
250
252
  const { children: a, ...e } = n;
251
- return u(e), /* @__PURE__ */ r(le, { render: a, ref: t });
252
- }), Fe = d((n, t) => {
253
+ return i(e), /* @__PURE__ */ r(ce, { render: a, ref: t });
254
+ }), Re = u((n, t) => {
253
255
  const { className: a, children: e, variant: s, ...o } = n;
254
- return u(o), /* @__PURE__ */ r(
255
- oe,
256
+ return i(o), /* @__PURE__ */ r(
257
+ le,
256
258
  {
257
259
  className: b(
258
260
  "bn-ak-popover",
@@ -263,10 +265,10 @@ const Ne = (n) => {
263
265
  children: e
264
266
  }
265
267
  );
266
- }), Re = (n) => {
268
+ }), Ee = (n) => {
267
269
  const { children: t, open: a, onOpenChange: e, position: s, ...o } = n;
268
- return u(o), /* @__PURE__ */ r(
269
- ce,
270
+ return i(o), /* @__PURE__ */ r(
271
+ ie,
270
272
  {
271
273
  open: a,
272
274
  setOpen: e,
@@ -274,28 +276,28 @@ const Ne = (n) => {
274
276
  children: t
275
277
  }
276
278
  );
277
- }, Ee = d((n, t) => {
279
+ }, Le = u((n, t) => {
278
280
  const { className: a, children: e, ...s } = n;
279
- return u(s, !1), /* @__PURE__ */ r(k, { className: a, ref: t, ...s, children: e });
280
- }), Le = d((n, t) => {
281
+ return i(s, !1), /* @__PURE__ */ r(N, { className: a, ref: t, ...s, children: e });
282
+ }), qe = u((n, t) => {
281
283
  const {
282
284
  className: a,
283
285
  children: e,
284
286
  icon: s,
285
287
  onClick: o,
286
- label: c,
288
+ label: l,
287
289
  onDragEnd: m,
288
- onDragStart: l,
289
- draggable: i,
290
+ onDragStart: c,
291
+ draggable: d,
290
292
  ...g
291
293
  } = n;
292
- return u(g, !1), /* @__PURE__ */ h(
293
- f,
294
+ return i(g, !1), /* @__PURE__ */ h(
295
+ v,
294
296
  {
295
297
  onDragEnd: m,
296
- onDragStart: l,
297
- draggable: i,
298
- "aria-label": c,
298
+ onDragStart: c,
299
+ draggable: d,
300
+ "aria-label": l,
299
301
  className: b(
300
302
  "bn-ak-button bn-ak-secondary",
301
303
  a || ""
@@ -309,9 +311,9 @@ const Ne = (n) => {
309
311
  ]
310
312
  }
311
313
  );
312
- }), qe = d((n, t) => {
313
- const { className: a, children: e, id: s, columns: o, ...c } = n;
314
- return u(c), /* @__PURE__ */ r(
314
+ }), Ge = u((n, t) => {
315
+ const { className: a, children: e, id: s, columns: o, ...l } = n;
316
+ return i(l), /* @__PURE__ */ r(
315
317
  "div",
316
318
  {
317
319
  className: a,
@@ -322,9 +324,9 @@ const Ne = (n) => {
322
324
  children: e
323
325
  }
324
326
  );
325
- }), Ge = d((n, t) => {
327
+ }), Ae = u((n, t) => {
326
328
  const { className: a, children: e, columns: s, ...o } = n;
327
- return u(o), /* @__PURE__ */ r(
329
+ return i(o), /* @__PURE__ */ r(
328
330
  "div",
329
331
  {
330
332
  className: b("bn-ak-menu-item", a || ""),
@@ -333,31 +335,30 @@ const Ne = (n) => {
333
335
  children: /* @__PURE__ */ r("div", { className: "bn-ak-suggestion-menu-item-label", children: e })
334
336
  }
335
337
  );
336
- }), Oe = d((n, t) => {
337
- const { className: a, isSelected: e, onClick: s, item: o, id: c, ...m } = n;
338
- u(m);
339
- const l = G(null);
340
- return O(() => {
341
- if (!l.current || !e)
338
+ }), Oe = u((n, t) => {
339
+ const { className: a, isSelected: e, onClick: s, item: o, id: l, ...m } = n;
340
+ i(m);
341
+ const c = G(null);
342
+ return A(() => {
343
+ if (!c.current || !e)
342
344
  return;
343
- const i = B(
344
- l.current,
345
- l.current.closest(".bn-grid-suggestion-menu")
346
- );
347
- i === "top" ? l.current.scrollIntoView(!0) : i === "bottom" && l.current.scrollIntoView(!1);
345
+ B(
346
+ c.current,
347
+ c.current.closest(".bn-grid-suggestion-menu")
348
+ ) !== "none" && c.current.scrollIntoView({ block: "nearest" });
348
349
  }, [e]), /* @__PURE__ */ r(
349
350
  "div",
350
351
  {
351
352
  className: a,
352
- ref: D([t, l]),
353
- id: c,
353
+ ref: D([t, c]),
354
+ id: l,
354
355
  role: "option",
355
356
  onClick: s,
356
357
  "aria-selected": e || void 0,
357
358
  children: o.icon
358
359
  }
359
360
  );
360
- }), $e = d((n, t) => {
361
+ }), $e = u((n, t) => {
361
362
  const {
362
363
  className: a,
363
364
  children: e,
@@ -365,7 +366,7 @@ const Ne = (n) => {
365
366
  columns: s,
366
367
  ...o
367
368
  } = n;
368
- return u(o), /* @__PURE__ */ r(
369
+ return i(o), /* @__PURE__ */ r(
369
370
  "div",
370
371
  {
371
372
  className: a,
@@ -374,10 +375,10 @@ const Ne = (n) => {
374
375
  children: e
375
376
  }
376
377
  );
377
- }), Ae = d((n, t) => {
378
+ }), He = u((n, t) => {
378
379
  const { className: a, children: e, id: s, ...o } = n;
379
- return u(o), /* @__PURE__ */ r(
380
- k,
380
+ return i(o), /* @__PURE__ */ r(
381
+ N,
381
382
  {
382
383
  className: b("bn-ak-menu", a || ""),
383
384
  id: s,
@@ -386,9 +387,9 @@ const Ne = (n) => {
386
387
  children: e
387
388
  }
388
389
  );
389
- }), Ve = d((n, t) => {
390
+ }), Ve = u((n, t) => {
390
391
  const { className: a, children: e, ...s } = n;
391
- return u(s), /* @__PURE__ */ r(
392
+ return i(s), /* @__PURE__ */ r(
392
393
  "div",
393
394
  {
394
395
  className: b("bn-ak-menu-item", a || ""),
@@ -396,25 +397,24 @@ const Ne = (n) => {
396
397
  children: /* @__PURE__ */ r("div", { className: "bn-ak-suggestion-menu-item-label", children: e })
397
398
  }
398
399
  );
399
- }), He = d((n, t) => {
400
- const { className: a, item: e, isSelected: s, onClick: o, id: c, ...m } = n;
401
- u(m);
402
- const l = G(null);
403
- return O(() => {
404
- if (!l.current || !s)
400
+ }), je = u((n, t) => {
401
+ const { className: a, item: e, isSelected: s, onClick: o, id: l, ...m } = n;
402
+ i(m);
403
+ const c = G(null);
404
+ return A(() => {
405
+ if (!c.current || !s)
405
406
  return;
406
- const i = B(
407
- l.current,
408
- l.current.closest(".bn-suggestion-menu, #ai-suggestion-menu")
409
- );
410
- i === "top" ? l.current.scrollIntoView(!0) : i === "bottom" && l.current.scrollIntoView(!1);
407
+ B(
408
+ c.current,
409
+ c.current.closest(".bn-suggestion-menu, #ai-suggestion-menu")
410
+ ) !== "none" && c.current.scrollIntoView({ block: "nearest" });
411
411
  }, [s]), /* @__PURE__ */ h(
412
412
  "div",
413
413
  {
414
414
  className: b("bn-ak-menu-item", a || ""),
415
- ref: D([t, l]),
416
- id: c,
417
- onMouseDown: (i) => i.preventDefault(),
415
+ ref: D([t, c]),
416
+ id: l,
417
+ onMouseDown: (d) => d.preventDefault(),
418
418
  onClick: o,
419
419
  role: "option",
420
420
  "aria-selected": s || void 0,
@@ -442,9 +442,9 @@ const Ne = (n) => {
442
442
  ]
443
443
  }
444
444
  );
445
- }), je = d((n, t) => {
445
+ }), Ke = u((n, t) => {
446
446
  const { className: a, children: e, ...s } = n;
447
- return u(s), /* @__PURE__ */ r(
447
+ return i(s), /* @__PURE__ */ r(
448
448
  "div",
449
449
  {
450
450
  className: b("bn-ak-group-label", a || ""),
@@ -452,9 +452,9 @@ const Ne = (n) => {
452
452
  children: e
453
453
  }
454
454
  );
455
- }), Ke = d((n, t) => {
455
+ }), Qe = u((n, t) => {
456
456
  const { className: a, ...e } = n;
457
- return u(e), /* @__PURE__ */ r("div", { className: a, ref: t, children: /* @__PURE__ */ r(
457
+ return i(e), /* @__PURE__ */ r("div", { className: a, ref: t, children: /* @__PURE__ */ r(
458
458
  "svg",
459
459
  {
460
460
  xmlns: "http://www.w3.org/2000/svg",
@@ -465,10 +465,10 @@ const Ne = (n) => {
465
465
  children: /* @__PURE__ */ r("path", { d: "M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z" })
466
466
  }
467
467
  ) });
468
- }), Qe = d((n, t) => {
469
- const { children: a, className: e, onMouseDown: s, onClick: o, ...c } = n;
470
- return u(c, !1), /* @__PURE__ */ r(
471
- f,
468
+ }), ze = u((n, t) => {
469
+ const { children: a, className: e, onMouseDown: s, onClick: o, ...l } = n;
470
+ return i(l, !1), /* @__PURE__ */ r(
471
+ v,
472
472
  {
473
473
  className: b(
474
474
  "bn-ak-button bn-ak-secondary",
@@ -477,50 +477,50 @@ const Ne = (n) => {
477
477
  ref: t,
478
478
  onMouseDown: s,
479
479
  onClick: o,
480
- ...c,
480
+ ...l,
481
481
  children: a
482
482
  }
483
483
  );
484
- }), ze = d((n, t) => {
484
+ }), Ue = u((n, t) => {
485
485
  const {
486
486
  className: a,
487
487
  children: e,
488
488
  draggable: s,
489
489
  onDragStart: o,
490
- onDragEnd: c,
490
+ onDragEnd: l,
491
491
  style: m,
492
- label: l,
493
- ...i
492
+ label: c,
493
+ ...d
494
494
  } = n;
495
- return u(i, !1), /* @__PURE__ */ r(
496
- f,
495
+ return i(d, !1), /* @__PURE__ */ r(
496
+ v,
497
497
  {
498
498
  className: b(
499
499
  "bn-ak-button bn-ak-secondary",
500
500
  a || ""
501
501
  ),
502
502
  ref: t,
503
- "aria-label": l,
503
+ "aria-label": c,
504
504
  draggable: s,
505
505
  onDragStart: o,
506
- onDragEnd: c,
506
+ onDragEnd: l,
507
507
  style: m,
508
- ...i,
508
+ ...d,
509
509
  children: e
510
510
  }
511
511
  );
512
- }), S = d(
512
+ }), S = u(
513
513
  (n, t) => {
514
514
  const {
515
515
  className: a,
516
516
  children: e,
517
517
  onMouseEnter: s,
518
518
  onMouseLeave: o,
519
- variant: c,
519
+ variant: l,
520
520
  ...m
521
521
  } = n;
522
- return u(m), /* @__PURE__ */ r(
523
- ie,
522
+ return i(m), /* @__PURE__ */ r(
523
+ de,
524
524
  {
525
525
  className: b("bn-ak-toolbar", a || ""),
526
526
  ref: t,
@@ -530,22 +530,22 @@ const Ne = (n) => {
530
530
  }
531
531
  );
532
532
  }
533
- ), M = d(
533
+ ), M = u(
534
534
  (n, t) => {
535
535
  const {
536
536
  className: a,
537
537
  children: e,
538
538
  mainTooltip: s,
539
539
  secondaryTooltip: o,
540
- icon: c,
540
+ icon: l,
541
541
  isSelected: m,
542
- isDisabled: l,
543
- onClick: i,
542
+ isDisabled: c,
543
+ onClick: d,
544
544
  label: g,
545
545
  variant: p,
546
- ...N
546
+ ...k
547
547
  } = n;
548
- return u(N, !1), /* @__PURE__ */ h(R, { children: [
548
+ return i(k, !1), /* @__PURE__ */ h(R, { children: [
549
549
  /* @__PURE__ */ r(
550
550
  E,
551
551
  {
@@ -557,17 +557,17 @@ const Ne = (n) => {
557
557
  "bn-ak-button bn-ak-secondary",
558
558
  a || ""
559
559
  ),
560
- onMouseDown: (v) => {
561
- V() && v.currentTarget.focus();
560
+ onMouseDown: (f) => {
561
+ V() && f.currentTarget.focus();
562
562
  },
563
- onClick: i,
563
+ onClick: d,
564
564
  "aria-pressed": m,
565
565
  "data-selected": m ? "true" : void 0,
566
- disabled: l || !1,
566
+ disabled: c || !1,
567
567
  ref: t,
568
- ...N,
568
+ ...k,
569
569
  children: [
570
- c,
570
+ l,
571
571
  e
572
572
  ]
573
573
  }
@@ -580,74 +580,74 @@ const Ne = (n) => {
580
580
  ] })
581
581
  ] });
582
582
  }
583
- ), I = d((n, t) => {
583
+ ), I = u((n, t) => {
584
584
  const { className: a, items: e, isDisabled: s, ...o } = n;
585
- u(o);
586
- const c = n.items.filter((l) => l.isSelected)[0], m = (l) => {
587
- var i, g;
588
- (g = (i = e.find((p) => p.text === l)).onClick) == null || g.call(i);
585
+ i(o);
586
+ const l = n.items.filter((c) => c.isSelected)[0], m = (c) => {
587
+ var d, g;
588
+ (g = (d = e.find((p) => p.text === c)).onClick) == null || g.call(d);
589
589
  };
590
- return /* @__PURE__ */ h(ue, { value: c.text, setValue: m, children: [
590
+ return /* @__PURE__ */ h(ue, { value: l.text, setValue: m, children: [
591
591
  /* @__PURE__ */ h(
592
- de,
592
+ me,
593
593
  {
594
594
  className: "bn-ak-button bn-ak-secondary",
595
595
  disabled: s,
596
596
  "aria-label": "Text alignment",
597
597
  render: /* @__PURE__ */ r(L, {}),
598
598
  children: [
599
- c.icon,
599
+ l.icon,
600
600
  " ",
601
- c.text,
601
+ l.text,
602
602
  " ",
603
- /* @__PURE__ */ r(me, {})
603
+ /* @__PURE__ */ r(be, {})
604
604
  ]
605
605
  }
606
606
  ),
607
607
  /* @__PURE__ */ r(
608
- be,
608
+ he,
609
609
  {
610
610
  className: b("bn-ak-popover", a || ""),
611
611
  ref: t,
612
612
  gutter: 4,
613
- children: e.map((l) => /* @__PURE__ */ h(
614
- he,
613
+ children: e.map((c) => /* @__PURE__ */ h(
614
+ ge,
615
615
  {
616
616
  className: "bn-ak-select-item",
617
- value: l.text,
617
+ value: c.text,
618
618
  children: [
619
- l.icon,
620
- l.text,
621
- l.text === c.text && /* @__PURE__ */ r(ge, {})
619
+ c.icon,
620
+ c.text,
621
+ c.text === l.text && /* @__PURE__ */ r(pe, {})
622
622
  ]
623
623
  },
624
- l.text
624
+ c.text
625
625
  ))
626
626
  }
627
627
  )
628
628
  ] });
629
- }), Ue = d((n, t) => {
629
+ }), We = u((n, t) => {
630
630
  const {
631
631
  className: a,
632
632
  children: e,
633
633
  selected: s,
634
634
  headerText: o,
635
- onFocus: c,
635
+ onFocus: l,
636
636
  onBlur: m,
637
- tabIndex: l,
638
- ...i
637
+ tabIndex: c,
638
+ ...d
639
639
  } = n;
640
- return u(i, !1), /* @__PURE__ */ h(
641
- k,
640
+ return i(d, !1), /* @__PURE__ */ h(
641
+ N,
642
642
  {
643
643
  className: b(
644
644
  a,
645
645
  "bn-ak-hovercard",
646
646
  s && "selected"
647
647
  ),
648
- onFocus: c,
648
+ onFocus: l,
649
649
  onBlur: m,
650
- tabIndex: l,
650
+ tabIndex: c,
651
651
  ref: t,
652
652
  children: [
653
653
  o && /* @__PURE__ */ r("div", { className: "bn-header-text", children: o }),
@@ -655,20 +655,20 @@ const Ne = (n) => {
655
655
  ]
656
656
  }
657
657
  );
658
- }), We = d((n, t) => {
658
+ }), Ze = u((n, t) => {
659
659
  const { className: a, children: e, ...s } = n;
660
- return u(s, !1), /* @__PURE__ */ r(
661
- k,
660
+ return i(s, !1), /* @__PURE__ */ r(
661
+ N,
662
662
  {
663
663
  className: b(a, "bn-ak-card-section"),
664
664
  ref: t,
665
665
  children: e
666
666
  }
667
667
  );
668
- }), Ze = d((n, t) => {
668
+ }), _e = u((n, t) => {
669
669
  const { className: a, children: e, ...s } = n;
670
- return u(s, !1), /* @__PURE__ */ r(
671
- f,
670
+ return i(s, !1), /* @__PURE__ */ r(
671
+ v,
672
672
  {
673
673
  className: b(
674
674
  a,
@@ -678,12 +678,12 @@ const Ne = (n) => {
678
678
  children: e
679
679
  }
680
680
  );
681
- }), _e = d((n, t) => {
682
- const { authorInfo: a, timeString: e, edited: s, ...o } = n, c = j();
683
- return u(o, !1), a === "loading" ? /* @__PURE__ */ h(k, { className: "bn-ak-author-info", children: [
681
+ }), Je = u((n, t) => {
682
+ const { authorInfo: a, timeString: e, edited: s, ...o } = n, l = K();
683
+ return i(o, !1), a === "loading" ? /* @__PURE__ */ h(N, { className: "bn-ak-author-info", children: [
684
684
  /* @__PURE__ */ r("div", { className: "bn-ak-avatar bn-ak-skeleton" }),
685
685
  /* @__PURE__ */ r("div", { className: "bn-ak-username bn-ak-skeleton" })
686
- ] }) : /* @__PURE__ */ h(k, { className: "bn-ak-author-info", children: [
686
+ ] }) : /* @__PURE__ */ h(N, { className: "bn-ak-author-info", children: [
687
687
  /* @__PURE__ */ r(
688
688
  "img",
689
689
  {
@@ -697,35 +697,35 @@ const Ne = (n) => {
697
697
  /* @__PURE__ */ h("span", { children: [
698
698
  e,
699
699
  " ",
700
- s && `(${c.comments.edited})`
700
+ s && `(${l.comments.edited})`
701
701
  ] })
702
702
  ] })
703
703
  ] });
704
- }), Je = d((n, t) => {
704
+ }), Xe = u((n, t) => {
705
705
  const {
706
706
  className: a,
707
707
  showActions: e,
708
708
  authorInfo: s,
709
709
  timeString: o,
710
- actions: c,
710
+ actions: l,
711
711
  children: m,
712
- edited: l,
713
- emojiPickerOpen: i,
712
+ edited: c,
713
+ emojiPickerOpen: d,
714
714
  // Unused
715
715
  ...g
716
716
  } = n;
717
- u(g, !1);
718
- const [p, N] = pe(!1), { focused: v, ref: T } = H();
717
+ i(g, !1);
718
+ const [p, k] = ke(!1), { focused: f, ref: T } = j();
719
719
  return /* @__PURE__ */ h(
720
- k,
720
+ N,
721
721
  {
722
722
  ref: t,
723
723
  className: a,
724
- onMouseEnter: () => N(!0),
725
- onMouseLeave: () => N(!1),
724
+ onMouseEnter: () => k(!0),
725
+ onMouseLeave: () => k(!1),
726
726
  children: [
727
- c && (e === !0 || e === void 0 || e === "hover" && p || v) ? /* @__PURE__ */ r(
728
- k,
727
+ l && (e === !0 || e === void 0 || e === "hover" && p || f) ? /* @__PURE__ */ r(
728
+ N,
729
729
  {
730
730
  ref: T,
731
731
  style: {
@@ -734,20 +734,20 @@ const Ne = (n) => {
734
734
  top: 0,
735
735
  zIndex: 10
736
736
  },
737
- children: c
737
+ children: l
738
738
  }
739
739
  ) : null,
740
- /* @__PURE__ */ r(_e, { ...n }),
740
+ /* @__PURE__ */ r(Je, { ...n }),
741
741
  m
742
742
  ]
743
743
  }
744
744
  );
745
- }), Xe = d((n, t) => {
746
- const { className: a, onFocus: e, onBlur: s, autoFocus: o, editor: c, editable: m, ...l } = n;
747
- u(l, !1);
748
- const i = K();
745
+ }), Ye = u((n, t) => {
746
+ const { className: a, onFocus: e, onBlur: s, autoFocus: o, editor: l, editable: m, ...c } = n;
747
+ i(c, !1);
748
+ const d = Q();
749
749
  return /* @__PURE__ */ r(
750
- an,
750
+ sn,
751
751
  {
752
752
  autoFocus: o,
753
753
  className: a,
@@ -758,38 +758,38 @@ const Ne = (n) => {
758
758
  filePanel: !1,
759
759
  formattingToolbar: !1,
760
760
  editable: m,
761
- theme: i == null ? void 0 : i.colorSchemePreference,
761
+ theme: d == null ? void 0 : d.colorSchemePreference,
762
762
  ref: t,
763
763
  onFocus: e,
764
764
  onBlur: s,
765
765
  children: /* @__PURE__ */ r(
766
- Q,
766
+ z,
767
767
  {
768
- formattingToolbar: Ye
768
+ formattingToolbar: en
769
769
  }
770
770
  )
771
771
  }
772
772
  );
773
- }), Ye = () => {
774
- const n = z([]).filter(
773
+ }), en = () => {
774
+ const n = U([]).filter(
775
775
  (t) => t.key !== "nestBlockButton" && t.key !== "unnestBlockButton"
776
776
  );
777
- return /* @__PURE__ */ r(U, { blockTypeSelectItems: [], children: n });
778
- }, en = d((n, t) => {
777
+ return /* @__PURE__ */ r(W, { blockTypeSelectItems: [], children: n });
778
+ }, nn = u((n, t) => {
779
779
  const {
780
780
  className: a,
781
781
  text: e,
782
782
  icon: s,
783
783
  isSelected: o,
784
- mainTooltip: c,
784
+ mainTooltip: l,
785
785
  secondaryTooltip: m,
786
- onClick: l,
787
- onMouseEnter: i,
786
+ onClick: c,
787
+ onMouseEnter: d,
788
788
  ...g
789
789
  } = n;
790
- u(g, !1);
790
+ i(g, !1);
791
791
  const p = /* @__PURE__ */ h(
792
- f,
792
+ v,
793
793
  {
794
794
  className: b(
795
795
  a,
@@ -797,8 +797,8 @@ const Ne = (n) => {
797
797
  o && "bn-ak-primary"
798
798
  ),
799
799
  "aria-selected": o === !0,
800
- onClick: (N) => l == null ? void 0 : l(N),
801
- onMouseEnter: i,
800
+ onClick: (k) => c == null ? void 0 : c(k),
801
+ onMouseEnter: d,
802
802
  ref: t,
803
803
  children: [
804
804
  /* @__PURE__ */ r("span", { children: s }),
@@ -806,40 +806,40 @@ const Ne = (n) => {
806
806
  ]
807
807
  }
808
808
  );
809
- return c ? /* @__PURE__ */ h(R, { children: [
809
+ return l ? /* @__PURE__ */ h(R, { children: [
810
810
  /* @__PURE__ */ r(E, { render: p }),
811
811
  /* @__PURE__ */ h(q, { className: "bn-ak-tooltip", portal: !1, children: [
812
- /* @__PURE__ */ r("span", { children: c }),
812
+ /* @__PURE__ */ r("span", { children: l }),
813
813
  m && /* @__PURE__ */ r("span", { children: m })
814
814
  ] })
815
815
  ] }) : p;
816
- }), nn = d((n, t) => {
816
+ }), tn = u((n, t) => {
817
817
  const { className: a, children: e, ...s } = n;
818
- return u(s), /* @__PURE__ */ r(
819
- k,
818
+ return i(s), /* @__PURE__ */ r(
819
+ N,
820
820
  {
821
821
  className: b(a, "bn-ak-badge-group"),
822
822
  ref: t,
823
823
  children: e
824
824
  }
825
825
  );
826
- }), tn = {
826
+ }), an = {
827
827
  FormattingToolbar: {
828
828
  Root: S,
829
829
  Button: M,
830
830
  Select: I
831
831
  },
832
832
  FilePanel: {
833
- Root: we,
834
- Button: xe,
835
- FileInput: ye,
836
- TabPanel: Pe,
837
- TextInput: Be
833
+ Root: xe,
834
+ Button: ye,
835
+ FileInput: Pe,
836
+ TabPanel: Be,
837
+ TextInput: De
838
838
  },
839
839
  GridSuggestionMenu: {
840
- Root: qe,
840
+ Root: Ge,
841
841
  Item: Oe,
842
- EmptyItem: Ge,
842
+ EmptyItem: Ae,
843
843
  Loader: $e
844
844
  },
845
845
  LinkToolbar: {
@@ -848,31 +848,31 @@ const Ne = (n) => {
848
848
  Select: I
849
849
  },
850
850
  SideMenu: {
851
- Root: Ee,
852
- Button: Le
851
+ Root: Le,
852
+ Button: qe
853
853
  },
854
854
  SuggestionMenu: {
855
- Root: Ae,
856
- Item: He,
855
+ Root: He,
856
+ Item: je,
857
857
  EmptyItem: Ve,
858
- Label: je,
859
- Loader: Ke
858
+ Label: Ke,
859
+ Loader: Qe
860
860
  },
861
861
  TableHandle: {
862
- Root: ze,
863
- ExtendButton: Qe
862
+ Root: Ue,
863
+ ExtendButton: ze
864
864
  },
865
865
  Comments: {
866
- Comment: Je,
867
- Editor: Xe,
868
- Card: Ue,
869
- CardSection: We,
870
- ExpandSectionsPrompt: Ze
866
+ Comment: Xe,
867
+ Editor: Ye,
868
+ Card: We,
869
+ CardSection: Ze,
870
+ ExpandSectionsPrompt: _e
871
871
  },
872
872
  Generic: {
873
873
  Badge: {
874
- Root: en,
875
- Group: nn
874
+ Root: nn,
875
+ Group: tn
876
876
  },
877
877
  Toolbar: {
878
878
  Root: S,
@@ -881,27 +881,27 @@ const Ne = (n) => {
881
881
  },
882
882
  Form: {
883
883
  Root: Ne,
884
- TextInput: ke
884
+ TextInput: ve
885
885
  },
886
886
  Menu: {
887
887
  Root: fe,
888
- Trigger: Me,
889
- Dropdown: ve,
890
- Divider: Ie,
891
- Label: Se,
892
- Item: Te,
893
- Button: Ce
888
+ Trigger: Ie,
889
+ Dropdown: Te,
890
+ Divider: Ce,
891
+ Label: Me,
892
+ Item: Se,
893
+ Button: we
894
894
  },
895
895
  Popover: {
896
- Root: Re,
897
- Trigger: De,
898
- Content: Fe
896
+ Root: Ee,
897
+ Trigger: Fe,
898
+ Content: Re
899
899
  }
900
900
  }
901
- }, an = (n) => {
901
+ }, sn = (n) => {
902
902
  const { className: t, ...a } = n;
903
- return /* @__PURE__ */ r(W.Provider, { value: tn, children: /* @__PURE__ */ r(
904
- Z,
903
+ return /* @__PURE__ */ r(Z.Provider, { value: an, children: /* @__PURE__ */ r(
904
+ _,
905
905
  {
906
906
  className: b("bn-ariakit", t || ""),
907
907
  ...a
@@ -909,7 +909,7 @@ const Ne = (n) => {
909
909
  ) });
910
910
  };
911
911
  export {
912
- an as BlockNoteView,
913
- tn as components
912
+ sn as BlockNoteView,
913
+ an as components
914
914
  };
915
915
  //# sourceMappingURL=blocknote-ariakit.js.map