@blocknote/ariakit 0.25.1 → 0.26.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,46 +1,46 @@
1
- import { jsx as r, jsxs as h, Fragment as G } from "react/jsx-runtime";
2
- import { assertEmpty as i, mergeCSSClasses as b, isSafari as A } from "@blocknote/core";
3
- import { elementOverflow as P, mergeRefs as B, useFocusWithin as $, FormattingToolbarController as V, getFormattingToolbarItems as O, FormattingToolbar as H, ComponentsContext as j, BlockNoteViewRaw as q } from "@blocknote/react";
4
- import { FormProvider as T, FormLabel as K, FormInput as M, MenuProvider as z, Menu as U, MenuButton as w, MenuItem as C, MenuButtonArrow as W, CheckboxCheck as y, MenuGroupLabel as _, MenuSeparator as J, Button as f, TabProvider as Q, TabList as X, Tab as Y, TabPanel as Z, PopoverDisclosure as ee, Popover as ne, PopoverProvider as te, Group as N, Toolbar as ae, TooltipProvider as x, TooltipAnchor as F, ToolbarItem as R, Tooltip as D, SelectProvider as se, Select as re, SelectArrow as oe, SelectPopover as le, SelectItem as ce, SelectItemCheck as ie } from "@ariakit/react";
5
- import { forwardRef as u, useRef as E, useEffect as L, useState as ue } from "react";
6
- const de = (n) => {
1
+ import { jsx as r, jsxs as h, Fragment as A } from "react/jsx-runtime";
2
+ import { assertEmpty as i, mergeCSSClasses as b, isSafari as $ } from "@blocknote/core";
3
+ import { elementOverflow as P, mergeRefs as B, useFocusWithin as V, FormattingToolbarController as O, getFormattingToolbarItems as H, FormattingToolbar as j, ComponentsContext as q, BlockNoteViewRaw as K } from "@blocknote/react";
4
+ import { FormProvider as I, FormLabel as z, FormInput as y, MenuProvider as U, Menu as W, MenuButton as w, MenuItem as C, MenuButtonArrow as _, CheckboxCheck as x, MenuGroupLabel as J, MenuSeparator as Q, Button as f, TabProvider as X, TabList as Y, Tab as Z, TabPanel as ee, PopoverDisclosure as ne, Popover as te, PopoverProvider as ae, Group as N, Toolbar as se, TooltipProvider as F, TooltipAnchor as R, ToolbarItem as D, Tooltip as E, SelectProvider as re, Select as oe, SelectArrow as le, SelectPopover as ce, SelectItem as ie, SelectItemCheck as ue } from "@ariakit/react";
5
+ import { forwardRef as u, useRef as L, useEffect as G, useState as de } from "react";
6
+ const me = (n) => {
7
7
  const { children: t, ...a } = n;
8
- return i(a), /* @__PURE__ */ r(T, { children: t });
9
- }, me = u((n, t) => {
8
+ return i(a), /* @__PURE__ */ r(I, { children: t });
9
+ }, be = u((n, t) => {
10
10
  const {
11
11
  className: a,
12
12
  name: e,
13
13
  label: s,
14
14
  icon: o,
15
- value: l,
15
+ value: c,
16
16
  autoFocus: m,
17
- placeholder: c,
17
+ placeholder: l,
18
18
  onKeyDown: d,
19
- onChange: g,
20
- onSubmit: p,
19
+ onChange: p,
20
+ onSubmit: g,
21
21
  ...k
22
22
  } = n;
23
- return i(k), /* @__PURE__ */ h(G, { children: [
24
- n.label && /* @__PURE__ */ r(K, { name: e, children: s }),
23
+ return i(k), /* @__PURE__ */ h(A, { children: [
24
+ n.label && /* @__PURE__ */ r(z, { name: e, children: s }),
25
25
  /* @__PURE__ */ h("div", { className: "bn-ak-input-wrapper", children: [
26
26
  o,
27
27
  /* @__PURE__ */ r(
28
- M,
28
+ y,
29
29
  {
30
30
  className: b("bn-ak-input", a || ""),
31
31
  ref: t,
32
32
  name: e,
33
- value: l,
33
+ value: c,
34
34
  autoFocus: m,
35
- placeholder: c,
35
+ placeholder: l,
36
36
  onKeyDown: d,
37
- onChange: g,
38
- onSubmit: p
37
+ onChange: p,
38
+ onSubmit: g
39
39
  }
40
40
  )
41
41
  ] })
42
42
  ] });
43
- }), be = (n) => {
43
+ }), he = (n) => {
44
44
  const {
45
45
  children: t,
46
46
  onOpenChange: a,
@@ -50,7 +50,7 @@ const de = (n) => {
50
50
  ...o
51
51
  } = n;
52
52
  return i(o), /* @__PURE__ */ r(
53
- z,
53
+ U,
54
54
  {
55
55
  placement: e,
56
56
  setOpen: a,
@@ -58,7 +58,7 @@ const de = (n) => {
58
58
  children: t
59
59
  }
60
60
  );
61
- }, he = u((n, t) => {
61
+ }, pe = u((n, t) => {
62
62
  const {
63
63
  className: a,
64
64
  children: e,
@@ -67,7 +67,7 @@ const de = (n) => {
67
67
  ...o
68
68
  } = n;
69
69
  return i(o), /* @__PURE__ */ r(
70
- U,
70
+ W,
71
71
  {
72
72
  unmountOnHide: !0,
73
73
  className: b("bn-ak-menu", a || ""),
@@ -76,8 +76,8 @@ const de = (n) => {
76
76
  }
77
77
  );
78
78
  }), ge = u((n, t) => {
79
- const { className: a, children: e, icon: s, checked: o, subTrigger: l, onClick: m, ...c } = n;
80
- return i(c), l ? /* @__PURE__ */ h(
79
+ const { className: a, children: e, icon: s, checked: o, subTrigger: c, onClick: m, ...l } = n;
80
+ return i(l), c ? /* @__PURE__ */ h(
81
81
  w,
82
82
  {
83
83
  render: /* @__PURE__ */ r(C, {}),
@@ -87,8 +87,8 @@ const de = (n) => {
87
87
  children: [
88
88
  s,
89
89
  e,
90
- /* @__PURE__ */ r(W, {}),
91
- o !== void 0 && /* @__PURE__ */ r(y, { checked: o })
90
+ /* @__PURE__ */ r(_, {}),
91
+ o !== void 0 && /* @__PURE__ */ r(x, { checked: o })
92
92
  ]
93
93
  }
94
94
  ) : /* @__PURE__ */ h(
@@ -100,99 +100,99 @@ const de = (n) => {
100
100
  children: [
101
101
  s,
102
102
  e,
103
- o !== void 0 && /* @__PURE__ */ r(y, { checked: o })
103
+ o !== void 0 && /* @__PURE__ */ r(x, { checked: o })
104
104
  ]
105
105
  }
106
106
  );
107
- }), pe = u((n, t) => {
107
+ }), Ne = u((n, t) => {
108
108
  const { className: a, children: e, ...s } = n;
109
109
  return i(s), /* @__PURE__ */ r(
110
- _,
110
+ J,
111
111
  {
112
112
  className: b("bn-ak-group-label", a || ""),
113
113
  ref: t,
114
114
  children: e
115
115
  }
116
116
  );
117
- }), Ne = (n) => {
117
+ }), ke = (n) => {
118
118
  const { children: t, sub: a, ...e } = n;
119
119
  return i(e), a ? t : /* @__PURE__ */ r(w, { render: t });
120
- }, ke = u((n, t) => {
120
+ }, fe = u((n, t) => {
121
121
  const { className: a, ...e } = n;
122
122
  return i(e), /* @__PURE__ */ r(
123
- J,
123
+ Q,
124
124
  {
125
125
  className: b("bn-ak-separator", a || ""),
126
126
  ref: t
127
127
  }
128
128
  );
129
- }), fe = u((n, t) => {
129
+ }), ve = u((n, t) => {
130
130
  const {
131
131
  className: a,
132
132
  children: e,
133
133
  icon: s,
134
134
  onClick: o,
135
- label: l,
135
+ label: c,
136
136
  onDragEnd: m,
137
- onDragStart: c,
137
+ onDragStart: l,
138
138
  draggable: d,
139
- ...g
139
+ ...p
140
140
  } = n;
141
- return i(g, !1), /* @__PURE__ */ h(
141
+ return i(p, !1), /* @__PURE__ */ h(
142
142
  f,
143
143
  {
144
144
  onDragEnd: m,
145
- onDragStart: c,
145
+ onDragStart: l,
146
146
  draggable: d,
147
- "aria-label": l,
147
+ "aria-label": c,
148
148
  className: b(
149
149
  "bn-ak-button bn-ak-secondary",
150
150
  a || ""
151
151
  ),
152
152
  ref: t,
153
153
  onClick: o,
154
- ...g,
154
+ ...p,
155
155
  children: [
156
156
  s,
157
157
  e
158
158
  ]
159
159
  }
160
160
  );
161
- }), ve = u((n, t) => {
161
+ }), Se = u((n, t) => {
162
162
  const {
163
163
  className: a,
164
164
  tabs: e,
165
165
  defaultOpenTab: s,
166
166
  openTab: o,
167
- setOpenTab: l,
167
+ setOpenTab: c,
168
168
  loading: m,
169
169
  // TODO: implement loading
170
- ...c
170
+ ...l
171
171
  } = n;
172
- return i(c), /* @__PURE__ */ r(
172
+ return i(l), /* @__PURE__ */ r(
173
173
  "div",
174
174
  {
175
175
  className: b("bn-ak-wrapper", a || ""),
176
176
  ref: t,
177
177
  children: /* @__PURE__ */ h(
178
- Q,
178
+ X,
179
179
  {
180
180
  defaultSelectedId: s,
181
181
  selectedId: o,
182
182
  setActiveId: (d) => {
183
- d && l(d);
183
+ d && c(d);
184
184
  },
185
185
  children: [
186
- /* @__PURE__ */ r(X, { className: "bn-ak-tab-list", children: e.map((d) => /* @__PURE__ */ r(Y, { className: "bn-ak-tab", id: d.name, children: d.name }, d.name)) }),
187
- /* @__PURE__ */ r("div", { className: "bn-ak-panels", children: e.map((d) => /* @__PURE__ */ r(Z, { tabId: d.name, children: d.tabPanel }, d.name)) })
186
+ /* @__PURE__ */ r(Y, { className: "bn-ak-tab-list", children: e.map((d) => /* @__PURE__ */ r(Z, { className: "bn-ak-tab", id: d.name, children: d.name }, d.name)) }),
187
+ /* @__PURE__ */ r("div", { className: "bn-ak-panels", children: e.map((d) => /* @__PURE__ */ r(ee, { tabId: d.name, children: d.tabPanel }, d.name)) })
188
188
  ]
189
189
  }
190
190
  )
191
191
  }
192
192
  );
193
- }), Se = u((n, t) => {
194
- const { className: a, children: e, onClick: s, label: o, ...l } = n;
195
- return i(l), /* @__PURE__ */ r(
193
+ }), Te = u((n, t) => {
194
+ const { className: a, children: e, onClick: s, label: o, ...c } = n;
195
+ return i(c), /* @__PURE__ */ r(
196
196
  f,
197
197
  {
198
198
  className: b("bn-ak-button", a || ""),
@@ -202,10 +202,10 @@ const de = (n) => {
202
202
  children: e
203
203
  }
204
204
  );
205
- }), Te = u((n, t) => {
206
- const { className: a, accept: e, value: s, placeholder: o, onChange: l, ...m } = n;
207
- return i(m), /* @__PURE__ */ r(T, { children: /* @__PURE__ */ r(
208
- M,
205
+ }), Me = u((n, t) => {
206
+ const { className: a, accept: e, value: s, placeholder: o, onChange: c, ...m } = n;
207
+ return i(m), /* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(
208
+ y,
209
209
  {
210
210
  className: a,
211
211
  ref: t,
@@ -213,23 +213,23 @@ const de = (n) => {
213
213
  type: "file",
214
214
  accept: e,
215
215
  value: s ? s.name : void 0,
216
- onChange: async (c) => l == null ? void 0 : l(c.target.files[0]),
216
+ onChange: async (l) => c == null ? void 0 : c(l.target.files[0]),
217
217
  placeholder: o
218
218
  }
219
219
  ) });
220
- }), Me = u((n, t) => {
220
+ }), Ie = u((n, t) => {
221
221
  const { className: a, children: e, ...s } = n;
222
222
  return i(s), /* @__PURE__ */ r("div", { className: a, ref: t, children: e });
223
- }), Ie = u((n, t) => {
224
- const { className: a, value: e, placeholder: s, onKeyDown: o, onChange: l, ...m } = n;
225
- return i(m), /* @__PURE__ */ r(T, { children: /* @__PURE__ */ r(
226
- M,
223
+ }), ye = u((n, t) => {
224
+ const { className: a, value: e, placeholder: s, onKeyDown: o, onChange: c, ...m } = n;
225
+ return i(m), /* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(
226
+ y,
227
227
  {
228
228
  className: b("bn-ak-input", a || ""),
229
229
  name: "panel-input",
230
230
  value: e,
231
231
  placeholder: s,
232
- onChange: l,
232
+ onChange: c,
233
233
  onKeyDown: o,
234
234
  "data-test": "embed-input",
235
235
  ref: t
@@ -237,11 +237,11 @@ const de = (n) => {
237
237
  ) });
238
238
  }), Ce = u((n, t) => {
239
239
  const { children: a, ...e } = n;
240
- return i(e), /* @__PURE__ */ r(ee, { render: a, ref: t });
241
- }), ye = u((n, t) => {
240
+ return i(e), /* @__PURE__ */ r(ne, { render: a, ref: t });
241
+ }), xe = u((n, t) => {
242
242
  const { className: a, children: e, variant: s, ...o } = n;
243
243
  return i(o), /* @__PURE__ */ r(
244
- ne,
244
+ te,
245
245
  {
246
246
  className: b(
247
247
  "bn-ak-popover",
@@ -254,7 +254,7 @@ const de = (n) => {
254
254
  );
255
255
  }), Pe = (n) => {
256
256
  const { children: t, opened: a, position: e, ...s } = n;
257
- return i(s), /* @__PURE__ */ r(te, { open: a, placement: e, children: t });
257
+ return i(s), /* @__PURE__ */ r(ae, { open: a, placement: e, children: t });
258
258
  }, Be = u((n, t) => {
259
259
  const { className: a, children: e, ...s } = n;
260
260
  return i(s, !1), /* @__PURE__ */ r(N, { className: a, ref: t, ...s, children: e });
@@ -264,35 +264,35 @@ const de = (n) => {
264
264
  children: e,
265
265
  icon: s,
266
266
  onClick: o,
267
- label: l,
267
+ label: c,
268
268
  onDragEnd: m,
269
- onDragStart: c,
269
+ onDragStart: l,
270
270
  draggable: d,
271
- ...g
271
+ ...p
272
272
  } = n;
273
- return i(g, !1), /* @__PURE__ */ h(
273
+ return i(p, !1), /* @__PURE__ */ h(
274
274
  f,
275
275
  {
276
276
  onDragEnd: m,
277
- onDragStart: c,
277
+ onDragStart: l,
278
278
  draggable: d,
279
- "aria-label": l,
279
+ "aria-label": c,
280
280
  className: b(
281
281
  "bn-ak-button bn-ak-secondary",
282
282
  a || ""
283
283
  ),
284
284
  ref: t,
285
285
  onClick: o,
286
- ...g,
286
+ ...p,
287
287
  children: [
288
288
  s,
289
289
  e
290
290
  ]
291
291
  }
292
292
  );
293
- }), xe = u((n, t) => {
294
- const { className: a, children: e, id: s, columns: o, ...l } = n;
295
- return i(l), /* @__PURE__ */ r(
293
+ }), Fe = u((n, t) => {
294
+ const { className: a, children: e, id: s, columns: o, ...c } = n;
295
+ return i(c), /* @__PURE__ */ r(
296
296
  "div",
297
297
  {
298
298
  className: a,
@@ -303,7 +303,7 @@ const de = (n) => {
303
303
  children: e
304
304
  }
305
305
  );
306
- }), Fe = u((n, t) => {
306
+ }), Re = u((n, t) => {
307
307
  const { className: a, children: e, columns: s, ...o } = n;
308
308
  return i(o), /* @__PURE__ */ r(
309
309
  "div",
@@ -314,31 +314,31 @@ const de = (n) => {
314
314
  children: /* @__PURE__ */ r("div", { className: "bn-ak-suggestion-menu-item-label", children: e })
315
315
  }
316
316
  );
317
- }), Re = u((n, t) => {
318
- const { className: a, isSelected: e, onClick: s, item: o, id: l, ...m } = n;
317
+ }), De = u((n, t) => {
318
+ const { className: a, isSelected: e, onClick: s, item: o, id: c, ...m } = n;
319
319
  i(m);
320
- const c = E(null);
321
- return L(() => {
322
- if (!c.current || !e)
320
+ const l = L(null);
321
+ return G(() => {
322
+ if (!l.current || !e)
323
323
  return;
324
324
  const d = P(
325
- c.current,
325
+ l.current,
326
326
  document.querySelector(".bn-grid-suggestion-menu")
327
327
  );
328
- d === "top" ? c.current.scrollIntoView(!0) : d === "bottom" && c.current.scrollIntoView(!1);
328
+ d === "top" ? l.current.scrollIntoView(!0) : d === "bottom" && l.current.scrollIntoView(!1);
329
329
  }, [e]), /* @__PURE__ */ r(
330
330
  "div",
331
331
  {
332
332
  className: a,
333
- ref: B([t, c]),
334
- id: l,
333
+ ref: B([t, l]),
334
+ id: c,
335
335
  role: "option",
336
336
  onClick: s,
337
337
  "aria-selected": e || void 0,
338
338
  children: o.icon
339
339
  }
340
340
  );
341
- }), De = u((n, t) => {
341
+ }), Ee = u((n, t) => {
342
342
  const {
343
343
  className: a,
344
344
  children: e,
@@ -355,7 +355,7 @@ const de = (n) => {
355
355
  children: e
356
356
  }
357
357
  );
358
- }), Ee = u((n, t) => {
358
+ }), Le = u((n, t) => {
359
359
  const { className: a, children: e, id: s, ...o } = n;
360
360
  return i(o), /* @__PURE__ */ r(
361
361
  N,
@@ -367,7 +367,7 @@ const de = (n) => {
367
367
  children: e
368
368
  }
369
369
  );
370
- }), Le = u((n, t) => {
370
+ }), Ge = u((n, t) => {
371
371
  const { className: a, children: e, ...s } = n;
372
372
  return i(s), /* @__PURE__ */ r(
373
373
  "div",
@@ -377,24 +377,24 @@ const de = (n) => {
377
377
  children: /* @__PURE__ */ r("div", { className: "bn-ak-suggestion-menu-item-label", children: e })
378
378
  }
379
379
  );
380
- }), Ge = u((n, t) => {
381
- const { className: a, item: e, isSelected: s, onClick: o, id: l, ...m } = n;
380
+ }), Ae = u((n, t) => {
381
+ const { className: a, item: e, isSelected: s, onClick: o, id: c, ...m } = n;
382
382
  i(m);
383
- const c = E(null);
384
- return L(() => {
385
- if (!c.current || !s)
383
+ const l = L(null);
384
+ return G(() => {
385
+ if (!l.current || !s)
386
386
  return;
387
387
  const d = P(
388
- c.current,
388
+ l.current,
389
389
  document.querySelector(".bn-suggestion-menu")
390
390
  );
391
- d === "top" ? c.current.scrollIntoView(!0) : d === "bottom" && c.current.scrollIntoView(!1);
391
+ d === "top" ? l.current.scrollIntoView(!0) : d === "bottom" && l.current.scrollIntoView(!1);
392
392
  }, [s]), /* @__PURE__ */ h(
393
393
  "div",
394
394
  {
395
395
  className: b("bn-ak-menu-item", a || ""),
396
- ref: B([t, c]),
397
- id: l,
396
+ ref: B([t, l]),
397
+ id: c,
398
398
  onClick: o,
399
399
  role: "option",
400
400
  "aria-selected": s || void 0,
@@ -422,7 +422,7 @@ const de = (n) => {
422
422
  ]
423
423
  }
424
424
  );
425
- }), Ae = u((n, t) => {
425
+ }), $e = u((n, t) => {
426
426
  const { className: a, children: e, ...s } = n;
427
427
  return i(s), /* @__PURE__ */ r(
428
428
  "div",
@@ -432,12 +432,12 @@ const de = (n) => {
432
432
  children: e
433
433
  }
434
434
  );
435
- }), $e = u((n, t) => {
435
+ }), Ve = u((n, t) => {
436
436
  const { className: a, children: e, ...s } = n;
437
437
  return i(s), /* @__PURE__ */ r("div", { className: a, ref: t, children: e });
438
- }), Ve = u((n, t) => {
439
- const { children: a, className: e, onMouseDown: s, onClick: o, ...l } = n;
440
- return i(l, !1), /* @__PURE__ */ r(
438
+ }), Oe = u((n, t) => {
439
+ const { children: a, className: e, onMouseDown: s, onClick: o, ...c } = n;
440
+ return i(c, !1), /* @__PURE__ */ r(
441
441
  f,
442
442
  {
443
443
  className: b(
@@ -447,19 +447,19 @@ const de = (n) => {
447
447
  ref: t,
448
448
  onMouseDown: s,
449
449
  onClick: o,
450
- ...l,
450
+ ...c,
451
451
  children: a
452
452
  }
453
453
  );
454
- }), Oe = u((n, t) => {
454
+ }), He = u((n, t) => {
455
455
  const {
456
456
  className: a,
457
457
  children: e,
458
458
  draggable: s,
459
459
  onDragStart: o,
460
- onDragEnd: l,
460
+ onDragEnd: c,
461
461
  style: m,
462
- label: c,
462
+ label: l,
463
463
  ...d
464
464
  } = n;
465
465
  return i(d, !1), /* @__PURE__ */ r(
@@ -470,27 +470,27 @@ const de = (n) => {
470
470
  a || ""
471
471
  ),
472
472
  ref: t,
473
- "aria-label": c,
473
+ "aria-label": l,
474
474
  draggable: s,
475
475
  onDragStart: o,
476
- onDragEnd: l,
476
+ onDragEnd: c,
477
477
  style: m,
478
478
  ...d,
479
479
  children: e
480
480
  }
481
481
  );
482
- }), v = u(
482
+ }), S = u(
483
483
  (n, t) => {
484
484
  const {
485
485
  className: a,
486
486
  children: e,
487
487
  onMouseEnter: s,
488
488
  onMouseLeave: o,
489
- variant: l,
489
+ variant: c,
490
490
  ...m
491
491
  } = n;
492
492
  return i(m), /* @__PURE__ */ r(
493
- ae,
493
+ se,
494
494
  {
495
495
  className: b("bn-ak-toolbar", a || ""),
496
496
  ref: t,
@@ -500,110 +500,129 @@ const de = (n) => {
500
500
  }
501
501
  );
502
502
  }
503
- ), S = u(
503
+ ), T = u(
504
504
  (n, t) => {
505
505
  const {
506
506
  className: a,
507
507
  children: e,
508
508
  mainTooltip: s,
509
509
  secondaryTooltip: o,
510
- icon: l,
510
+ icon: c,
511
511
  isSelected: m,
512
- isDisabled: c,
512
+ isDisabled: l,
513
513
  onClick: d,
514
- label: g,
515
- variant: p,
514
+ label: p,
515
+ variant: g,
516
516
  ...k
517
517
  } = n;
518
- return i(k, !1), /* @__PURE__ */ h(x, { children: [
518
+ return i(k, !1), /* @__PURE__ */ h(F, { children: [
519
519
  /* @__PURE__ */ r(
520
- F,
520
+ R,
521
521
  {
522
522
  render: /* @__PURE__ */ h(
523
- R,
523
+ D,
524
524
  {
525
- "aria-label": g,
525
+ "aria-label": p,
526
526
  className: b(
527
527
  "bn-ak-button bn-ak-secondary",
528
528
  a || ""
529
529
  ),
530
- onMouseDown: (I) => {
531
- A() && I.currentTarget.focus();
530
+ onMouseDown: (v) => {
531
+ $() && v.currentTarget.focus();
532
532
  },
533
533
  onClick: d,
534
534
  "aria-pressed": m,
535
535
  "data-selected": m ? "true" : void 0,
536
- disabled: c || !1,
536
+ disabled: l || !1,
537
537
  ref: t,
538
538
  ...k,
539
539
  children: [
540
- l,
540
+ c,
541
541
  e
542
542
  ]
543
543
  }
544
544
  )
545
545
  }
546
546
  ),
547
- /* @__PURE__ */ h(D, { className: "bn-ak-tooltip", portal: !1, children: [
547
+ /* @__PURE__ */ h(E, { className: "bn-ak-tooltip", portal: !1, children: [
548
548
  /* @__PURE__ */ r("span", { children: s }),
549
549
  o && /* @__PURE__ */ r("span", { children: o })
550
550
  ] })
551
551
  ] });
552
552
  }
553
- ), He = u((n, t) => {
553
+ ), M = u((n, t) => {
554
554
  const { className: a, items: e, isDisabled: s, ...o } = n;
555
555
  i(o);
556
- const l = n.items.filter((c) => c.isSelected)[0], m = (c) => {
557
- var d, g;
558
- (g = (d = e.find((p) => p.text === c)).onClick) == null || g.call(d);
556
+ const c = n.items.filter((l) => l.isSelected)[0], m = (l) => {
557
+ var d, p;
558
+ (p = (d = e.find((g) => g.text === l)).onClick) == null || p.call(d);
559
559
  };
560
- return /* @__PURE__ */ h(se, { value: l.text, setValue: m, children: [
560
+ return /* @__PURE__ */ h(re, { value: c.text, setValue: m, children: [
561
561
  /* @__PURE__ */ h(
562
- re,
562
+ oe,
563
563
  {
564
564
  className: "bn-ak-button bn-ak-secondary",
565
565
  disabled: s,
566
566
  "aria-label": "Text alignment",
567
- render: /* @__PURE__ */ r(R, {}),
567
+ render: /* @__PURE__ */ r(D, {}),
568
568
  children: [
569
- l.icon,
569
+ c.icon,
570
570
  " ",
571
- l.text,
571
+ c.text,
572
572
  " ",
573
- /* @__PURE__ */ r(oe, {})
573
+ /* @__PURE__ */ r(le, {})
574
574
  ]
575
575
  }
576
576
  ),
577
577
  /* @__PURE__ */ r(
578
- le,
578
+ ce,
579
579
  {
580
580
  className: b("bn-ak-popover", a || ""),
581
581
  ref: t,
582
582
  gutter: 4,
583
- children: e.map((c) => /* @__PURE__ */ h(
584
- ce,
583
+ children: e.map((l) => /* @__PURE__ */ h(
584
+ ie,
585
585
  {
586
586
  className: "bn-ak-select-item",
587
- value: c.text,
587
+ value: l.text,
588
588
  children: [
589
- c.icon,
590
- c.text,
591
- c.text === l.text && /* @__PURE__ */ r(ie, {})
589
+ l.icon,
590
+ l.text,
591
+ l.text === c.text && /* @__PURE__ */ r(ue, {})
592
592
  ]
593
593
  },
594
- c.text
594
+ l.text
595
595
  ))
596
596
  }
597
597
  )
598
598
  ] });
599
599
  }), je = u((n, t) => {
600
- const { className: a, children: e, ...s } = n;
601
- return i(s, !1), /* @__PURE__ */ r(
600
+ const {
601
+ className: a,
602
+ children: e,
603
+ selected: s,
604
+ headerText: o,
605
+ onFocus: c,
606
+ onBlur: m,
607
+ tabIndex: l,
608
+ ...d
609
+ } = n;
610
+ return i(d, !1), /* @__PURE__ */ h(
602
611
  N,
603
612
  {
604
- className: b(a, "bn-ak-hovercard"),
613
+ className: b(
614
+ a,
615
+ "bn-ak-hovercard",
616
+ s && "selected"
617
+ ),
618
+ onFocus: c,
619
+ onBlur: m,
620
+ tabIndex: l,
605
621
  ref: t,
606
- children: e
622
+ children: [
623
+ o && /* @__PURE__ */ r("div", { className: "bn-header-text", children: o }),
624
+ e
625
+ ]
607
626
  }
608
627
  );
609
628
  }), qe = u((n, t) => {
@@ -617,8 +636,21 @@ const de = (n) => {
617
636
  }
618
637
  );
619
638
  }), Ke = u((n, t) => {
620
- const { authorInfo: a, timeString: e, ...s } = n;
621
- return i(s, !1), a === "loading" ? /* @__PURE__ */ h(N, { className: "bn-ak-author-info", children: [
639
+ const { className: a, children: e, ...s } = n;
640
+ return i(s, !1), /* @__PURE__ */ r(
641
+ f,
642
+ {
643
+ className: b(
644
+ a,
645
+ "bn-ak-button bn-ak-secondary bn-ak-expand-sections-prompt"
646
+ ),
647
+ ref: t,
648
+ children: e
649
+ }
650
+ );
651
+ }), ze = u((n, t) => {
652
+ const { authorInfo: a, timeString: e, edited: s, ...o } = n;
653
+ return i(o, !1), a === "loading" ? /* @__PURE__ */ h(N, { className: "bn-ak-author-info", children: [
622
654
  /* @__PURE__ */ r("div", { className: "bn-ak-avatar bn-ak-skeleton" }),
623
655
  /* @__PURE__ */ r("div", { className: "bn-ak-username bn-ak-skeleton" })
624
656
  ] }) : /* @__PURE__ */ h(N, { className: "bn-ak-author-info", children: [
@@ -632,21 +664,26 @@ const de = (n) => {
632
664
  ),
633
665
  /* @__PURE__ */ h("div", { className: "bn-ak-username", children: [
634
666
  a.username,
635
- /* @__PURE__ */ r("span", { children: e })
667
+ /* @__PURE__ */ h("span", { children: [
668
+ e,
669
+ " ",
670
+ s && "(edited)"
671
+ ] })
636
672
  ] })
637
673
  ] });
638
- }), ze = u((n, t) => {
674
+ }), Ue = u((n, t) => {
639
675
  const {
640
676
  className: a,
641
677
  showActions: e,
642
678
  authorInfo: s,
643
679
  timeString: o,
644
- actions: l,
680
+ actions: c,
645
681
  children: m,
646
- ...c
682
+ edited: l,
683
+ ...d
647
684
  } = n;
648
- i(c, !1);
649
- const [d, g] = ue(!1), { focused: p, ref: k } = $();
685
+ i(d, !1);
686
+ const [p, g] = de(!1), { focused: k, ref: v } = V();
650
687
  return /* @__PURE__ */ h(
651
688
  N,
652
689
  {
@@ -655,30 +692,30 @@ const de = (n) => {
655
692
  onMouseEnter: () => g(!0),
656
693
  onMouseLeave: () => g(!1),
657
694
  children: [
658
- l && (e === !0 || e === void 0 || e === "hover" && d || p) ? /* @__PURE__ */ r(
695
+ c && (e === !0 || e === void 0 || e === "hover" && p || k) ? /* @__PURE__ */ r(
659
696
  N,
660
697
  {
661
- ref: k,
698
+ ref: v,
662
699
  style: {
663
700
  position: "absolute",
664
701
  right: 0,
665
702
  top: 0,
666
703
  zIndex: 10
667
704
  },
668
- children: l
705
+ children: c
669
706
  }
670
707
  ) : null,
671
- /* @__PURE__ */ r(Ke, { ...n }),
708
+ /* @__PURE__ */ r(ze, { ...n }),
672
709
  m
673
710
  ]
674
711
  }
675
712
  );
676
- }), Ue = u((n, t) => {
677
- const { className: a, onFocus: e, onBlur: s, editor: o, editable: l, ...m } = n;
678
- return i(m, !1), /* @__PURE__ */ r(
679
- Xe,
713
+ }), We = u((n, t) => {
714
+ const { className: a, onFocus: e, onBlur: s, autoFocus: o, editor: c, editable: m, ...l } = n;
715
+ return i(l, !1), /* @__PURE__ */ r(
716
+ Ye,
680
717
  {
681
- autoFocus: !0,
718
+ autoFocus: o,
682
719
  className: a,
683
720
  editor: n.editor,
684
721
  sideMenu: !1,
@@ -686,37 +723,37 @@ const de = (n) => {
686
723
  tableHandles: !1,
687
724
  filePanel: !1,
688
725
  formattingToolbar: !1,
689
- editable: l,
726
+ editable: m,
690
727
  ref: t,
691
728
  onFocus: e,
692
729
  onBlur: s,
693
730
  children: /* @__PURE__ */ r(
694
- V,
731
+ O,
695
732
  {
696
- formattingToolbar: We
733
+ formattingToolbar: _e
697
734
  }
698
735
  )
699
736
  }
700
737
  );
701
- }), We = () => {
702
- const n = O([]).filter(
738
+ }), _e = () => {
739
+ const n = H([]).filter(
703
740
  (t) => t.key !== "nestBlockButton" && t.key !== "unnestBlockButton"
704
741
  );
705
- return /* @__PURE__ */ r(H, { blockTypeSelectItems: [], children: n });
706
- }, _e = u((n, t) => {
742
+ return /* @__PURE__ */ r(j, { blockTypeSelectItems: [], children: n });
743
+ }, Je = u((n, t) => {
707
744
  const {
708
745
  className: a,
709
746
  text: e,
710
747
  icon: s,
711
748
  isSelected: o,
712
- mainTooltip: l,
749
+ mainTooltip: c,
713
750
  secondaryTooltip: m,
714
- onClick: c,
751
+ onClick: l,
715
752
  onMouseEnter: d,
716
- ...g
753
+ ...p
717
754
  } = n;
718
- i(g, !1);
719
- const p = /* @__PURE__ */ h(
755
+ i(p, !1);
756
+ const g = /* @__PURE__ */ h(
720
757
  f,
721
758
  {
722
759
  className: b(
@@ -725,7 +762,7 @@ const de = (n) => {
725
762
  o && "bn-ak-primary"
726
763
  ),
727
764
  "aria-selected": o === !0,
728
- onClick: (k) => c == null ? void 0 : c(k),
765
+ onClick: (k) => l == null ? void 0 : l(k),
729
766
  onMouseEnter: d,
730
767
  ref: t,
731
768
  children: [
@@ -734,14 +771,14 @@ const de = (n) => {
734
771
  ]
735
772
  }
736
773
  );
737
- return l ? /* @__PURE__ */ h(x, { children: [
738
- /* @__PURE__ */ r(F, { render: p }),
739
- /* @__PURE__ */ h(D, { className: "bn-ak-tooltip", portal: !1, children: [
740
- /* @__PURE__ */ r("span", { children: l }),
774
+ return c ? /* @__PURE__ */ h(F, { children: [
775
+ /* @__PURE__ */ r(R, { render: g }),
776
+ /* @__PURE__ */ h(E, { className: "bn-ak-tooltip", portal: !1, children: [
777
+ /* @__PURE__ */ r("span", { children: c }),
741
778
  m && /* @__PURE__ */ r("span", { children: m })
742
779
  ] })
743
- ] }) : p;
744
- }), Je = u((n, t) => {
780
+ ] }) : g;
781
+ }), Qe = u((n, t) => {
745
782
  const { className: a, children: e, ...s } = n;
746
783
  return i(s), /* @__PURE__ */ r(
747
784
  N,
@@ -751,82 +788,85 @@ const de = (n) => {
751
788
  children: e
752
789
  }
753
790
  );
754
- }), Qe = {
791
+ }), Xe = {
755
792
  FormattingToolbar: {
756
- Root: v,
757
- Button: S,
758
- Select: He
793
+ Root: S,
794
+ Button: T,
795
+ Select: M
759
796
  },
760
797
  FilePanel: {
761
- Root: ve,
762
- Button: Se,
763
- FileInput: Te,
764
- TabPanel: Me,
765
- TextInput: Ie
798
+ Root: Se,
799
+ Button: Te,
800
+ FileInput: Me,
801
+ TabPanel: Ie,
802
+ TextInput: ye
766
803
  },
767
804
  GridSuggestionMenu: {
768
- Root: xe,
769
- Item: Re,
770
- EmptyItem: Fe,
771
- Loader: De
805
+ Root: Fe,
806
+ Item: De,
807
+ EmptyItem: Re,
808
+ Loader: Ee
772
809
  },
773
810
  LinkToolbar: {
774
- Root: v,
775
- Button: S
811
+ Root: S,
812
+ Button: T,
813
+ Select: M
776
814
  },
777
815
  SideMenu: {
778
816
  Root: Be,
779
817
  Button: we
780
818
  },
781
819
  SuggestionMenu: {
782
- Root: Ee,
783
- Item: Ge,
784
- EmptyItem: Le,
785
- Label: Ae,
786
- Loader: $e
820
+ Root: Le,
821
+ Item: Ae,
822
+ EmptyItem: Ge,
823
+ Label: $e,
824
+ Loader: Ve
787
825
  },
788
826
  TableHandle: {
789
- Root: Oe,
790
- ExtendButton: Ve
827
+ Root: He,
828
+ ExtendButton: Oe
791
829
  },
792
830
  Comments: {
793
- Comment: ze,
794
- Editor: Ue,
831
+ Comment: Ue,
832
+ Editor: We,
795
833
  Card: je,
796
- CardSection: qe
834
+ CardSection: qe,
835
+ ExpandSectionsPrompt: Ke
797
836
  },
798
837
  Generic: {
799
838
  Badge: {
800
- Root: _e,
801
- Group: Je
839
+ Root: Je,
840
+ Group: Qe
802
841
  },
803
842
  Toolbar: {
804
- Root: v,
805
- Button: S
843
+ Root: S,
844
+ Button: T,
845
+ Select: M
806
846
  },
807
847
  Form: {
808
- Root: de,
809
- TextInput: me
848
+ Root: me,
849
+ TextInput: be
810
850
  },
811
851
  Menu: {
812
- Root: be,
813
- Trigger: Ne,
814
- Dropdown: he,
815
- Divider: ke,
816
- Label: pe,
852
+ Root: he,
853
+ Trigger: ke,
854
+ Dropdown: pe,
855
+ Divider: fe,
856
+ Label: Ne,
817
857
  Item: ge,
818
- Button: fe
858
+ Button: ve
819
859
  },
820
860
  Popover: {
821
861
  Root: Pe,
822
862
  Trigger: Ce,
823
- Content: ye
863
+ Content: xe
824
864
  }
825
865
  }
826
- }, Xe = (n) => {
866
+ }, Ye = (n) => {
827
867
  const { className: t, ...a } = n;
828
- return /* @__PURE__ */ r(j.Provider, { value: Qe, children: /* @__PURE__ */ r(
829
- q,
868
+ return /* @__PURE__ */ r(q.Provider, { value: Xe, children: /* @__PURE__ */ r(
869
+ K,
830
870
  {
831
871
  className: b("bn-ariakit", t || ""),
832
872
  ...a
@@ -834,7 +874,7 @@ const de = (n) => {
834
874
  ) });
835
875
  };
836
876
  export {
837
- Xe as BlockNoteView,
838
- Qe as components
877
+ Ye as BlockNoteView,
878
+ Xe as components
839
879
  };
840
880
  //# sourceMappingURL=blocknote-ariakit.js.map