@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.
- package/dist/blocknote-ariakit.cjs +1 -1
- package/dist/blocknote-ariakit.cjs.map +1 -1
- package/dist/blocknote-ariakit.js +268 -228
- package/dist/blocknote-ariakit.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/comments/Card.tsx +40 -3
- package/src/comments/Comment.tsx +9 -3
- package/src/comments/Editor.tsx +3 -2
- package/src/components.ts +4 -1
- package/src/style.css +35 -13
- package/types/src/comments/Card.d.ts +9 -0
- package/types/src/comments/Comment.d.ts +1 -0
- package/types/src/comments/Editor.d.ts +1 -0
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { jsx as r, jsxs as h, Fragment as
|
|
2
|
-
import { assertEmpty as i, mergeCSSClasses as b, isSafari as
|
|
3
|
-
import { elementOverflow as P, mergeRefs as B, useFocusWithin as
|
|
4
|
-
import { FormProvider as
|
|
5
|
-
import { forwardRef as u, useRef as
|
|
6
|
-
const
|
|
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(
|
|
9
|
-
},
|
|
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:
|
|
15
|
+
value: c,
|
|
16
16
|
autoFocus: m,
|
|
17
|
-
placeholder:
|
|
17
|
+
placeholder: l,
|
|
18
18
|
onKeyDown: d,
|
|
19
|
-
onChange:
|
|
20
|
-
onSubmit:
|
|
19
|
+
onChange: p,
|
|
20
|
+
onSubmit: g,
|
|
21
21
|
...k
|
|
22
22
|
} = n;
|
|
23
|
-
return i(k), /* @__PURE__ */ h(
|
|
24
|
-
n.label && /* @__PURE__ */ r(
|
|
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
|
-
|
|
28
|
+
y,
|
|
29
29
|
{
|
|
30
30
|
className: b("bn-ak-input", a || ""),
|
|
31
31
|
ref: t,
|
|
32
32
|
name: e,
|
|
33
|
-
value:
|
|
33
|
+
value: c,
|
|
34
34
|
autoFocus: m,
|
|
35
|
-
placeholder:
|
|
35
|
+
placeholder: l,
|
|
36
36
|
onKeyDown: d,
|
|
37
|
-
onChange:
|
|
38
|
-
onSubmit:
|
|
37
|
+
onChange: p,
|
|
38
|
+
onSubmit: g
|
|
39
39
|
}
|
|
40
40
|
)
|
|
41
41
|
] })
|
|
42
42
|
] });
|
|
43
|
-
}),
|
|
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
|
-
|
|
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
|
-
},
|
|
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
|
-
|
|
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:
|
|
80
|
-
return i(
|
|
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(
|
|
91
|
-
o !== void 0 && /* @__PURE__ */ r(
|
|
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(
|
|
103
|
+
o !== void 0 && /* @__PURE__ */ r(x, { checked: o })
|
|
104
104
|
]
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
120
|
+
}, fe = u((n, t) => {
|
|
121
121
|
const { className: a, ...e } = n;
|
|
122
122
|
return i(e), /* @__PURE__ */ r(
|
|
123
|
-
|
|
123
|
+
Q,
|
|
124
124
|
{
|
|
125
125
|
className: b("bn-ak-separator", a || ""),
|
|
126
126
|
ref: t
|
|
127
127
|
}
|
|
128
128
|
);
|
|
129
|
-
}),
|
|
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:
|
|
135
|
+
label: c,
|
|
136
136
|
onDragEnd: m,
|
|
137
|
-
onDragStart:
|
|
137
|
+
onDragStart: l,
|
|
138
138
|
draggable: d,
|
|
139
|
-
...
|
|
139
|
+
...p
|
|
140
140
|
} = n;
|
|
141
|
-
return i(
|
|
141
|
+
return i(p, !1), /* @__PURE__ */ h(
|
|
142
142
|
f,
|
|
143
143
|
{
|
|
144
144
|
onDragEnd: m,
|
|
145
|
-
onDragStart:
|
|
145
|
+
onDragStart: l,
|
|
146
146
|
draggable: d,
|
|
147
|
-
"aria-label":
|
|
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
|
-
...
|
|
154
|
+
...p,
|
|
155
155
|
children: [
|
|
156
156
|
s,
|
|
157
157
|
e
|
|
158
158
|
]
|
|
159
159
|
}
|
|
160
160
|
);
|
|
161
|
-
}),
|
|
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:
|
|
167
|
+
setOpenTab: c,
|
|
168
168
|
loading: m,
|
|
169
169
|
// TODO: implement loading
|
|
170
|
-
...
|
|
170
|
+
...l
|
|
171
171
|
} = n;
|
|
172
|
-
return i(
|
|
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
|
-
|
|
178
|
+
X,
|
|
179
179
|
{
|
|
180
180
|
defaultSelectedId: s,
|
|
181
181
|
selectedId: o,
|
|
182
182
|
setActiveId: (d) => {
|
|
183
|
-
d &&
|
|
183
|
+
d && c(d);
|
|
184
184
|
},
|
|
185
185
|
children: [
|
|
186
|
-
/* @__PURE__ */ r(
|
|
187
|
-
/* @__PURE__ */ r("div", { className: "bn-ak-panels", children: e.map((d) => /* @__PURE__ */ r(
|
|
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
|
-
}),
|
|
194
|
-
const { className: a, children: e, onClick: s, label: o, ...
|
|
195
|
-
return i(
|
|
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
|
-
}),
|
|
206
|
-
const { className: a, accept: e, value: s, placeholder: o, onChange:
|
|
207
|
-
return i(m), /* @__PURE__ */ r(
|
|
208
|
-
|
|
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 (
|
|
216
|
+
onChange: async (l) => c == null ? void 0 : c(l.target.files[0]),
|
|
217
217
|
placeholder: o
|
|
218
218
|
}
|
|
219
219
|
) });
|
|
220
|
-
}),
|
|
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
|
-
}),
|
|
224
|
-
const { className: a, value: e, placeholder: s, onKeyDown: o, onChange:
|
|
225
|
-
return i(m), /* @__PURE__ */ r(
|
|
226
|
-
|
|
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:
|
|
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(
|
|
241
|
-
}),
|
|
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
|
-
|
|
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(
|
|
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:
|
|
267
|
+
label: c,
|
|
268
268
|
onDragEnd: m,
|
|
269
|
-
onDragStart:
|
|
269
|
+
onDragStart: l,
|
|
270
270
|
draggable: d,
|
|
271
|
-
...
|
|
271
|
+
...p
|
|
272
272
|
} = n;
|
|
273
|
-
return i(
|
|
273
|
+
return i(p, !1), /* @__PURE__ */ h(
|
|
274
274
|
f,
|
|
275
275
|
{
|
|
276
276
|
onDragEnd: m,
|
|
277
|
-
onDragStart:
|
|
277
|
+
onDragStart: l,
|
|
278
278
|
draggable: d,
|
|
279
|
-
"aria-label":
|
|
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
|
-
...
|
|
286
|
+
...p,
|
|
287
287
|
children: [
|
|
288
288
|
s,
|
|
289
289
|
e
|
|
290
290
|
]
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
|
-
}),
|
|
294
|
-
const { className: a, children: e, id: s, columns: o, ...
|
|
295
|
-
return i(
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
318
|
-
const { className: a, isSelected: e, onClick: s, item: o, id:
|
|
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
|
|
321
|
-
return
|
|
322
|
-
if (!
|
|
320
|
+
const l = L(null);
|
|
321
|
+
return G(() => {
|
|
322
|
+
if (!l.current || !e)
|
|
323
323
|
return;
|
|
324
324
|
const d = P(
|
|
325
|
-
|
|
325
|
+
l.current,
|
|
326
326
|
document.querySelector(".bn-grid-suggestion-menu")
|
|
327
327
|
);
|
|
328
|
-
d === "top" ?
|
|
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,
|
|
334
|
-
id:
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
381
|
-
const { className: a, item: e, isSelected: s, onClick: o, id:
|
|
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
|
|
384
|
-
return
|
|
385
|
-
if (!
|
|
383
|
+
const l = L(null);
|
|
384
|
+
return G(() => {
|
|
385
|
+
if (!l.current || !s)
|
|
386
386
|
return;
|
|
387
387
|
const d = P(
|
|
388
|
-
|
|
388
|
+
l.current,
|
|
389
389
|
document.querySelector(".bn-suggestion-menu")
|
|
390
390
|
);
|
|
391
|
-
d === "top" ?
|
|
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,
|
|
397
|
-
id:
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
439
|
-
const { children: a, className: e, onMouseDown: s, onClick: o, ...
|
|
440
|
-
return i(
|
|
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
|
-
...
|
|
450
|
+
...c,
|
|
451
451
|
children: a
|
|
452
452
|
}
|
|
453
453
|
);
|
|
454
|
-
}),
|
|
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:
|
|
460
|
+
onDragEnd: c,
|
|
461
461
|
style: m,
|
|
462
|
-
label:
|
|
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":
|
|
473
|
+
"aria-label": l,
|
|
474
474
|
draggable: s,
|
|
475
475
|
onDragStart: o,
|
|
476
|
-
onDragEnd:
|
|
476
|
+
onDragEnd: c,
|
|
477
477
|
style: m,
|
|
478
478
|
...d,
|
|
479
479
|
children: e
|
|
480
480
|
}
|
|
481
481
|
);
|
|
482
|
-
}),
|
|
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:
|
|
489
|
+
variant: c,
|
|
490
490
|
...m
|
|
491
491
|
} = n;
|
|
492
492
|
return i(m), /* @__PURE__ */ r(
|
|
493
|
-
|
|
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
|
-
),
|
|
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:
|
|
510
|
+
icon: c,
|
|
511
511
|
isSelected: m,
|
|
512
|
-
isDisabled:
|
|
512
|
+
isDisabled: l,
|
|
513
513
|
onClick: d,
|
|
514
|
-
label:
|
|
515
|
-
variant:
|
|
514
|
+
label: p,
|
|
515
|
+
variant: g,
|
|
516
516
|
...k
|
|
517
517
|
} = n;
|
|
518
|
-
return i(k, !1), /* @__PURE__ */ h(
|
|
518
|
+
return i(k, !1), /* @__PURE__ */ h(F, { children: [
|
|
519
519
|
/* @__PURE__ */ r(
|
|
520
|
-
|
|
520
|
+
R,
|
|
521
521
|
{
|
|
522
522
|
render: /* @__PURE__ */ h(
|
|
523
|
-
|
|
523
|
+
D,
|
|
524
524
|
{
|
|
525
|
-
"aria-label":
|
|
525
|
+
"aria-label": p,
|
|
526
526
|
className: b(
|
|
527
527
|
"bn-ak-button bn-ak-secondary",
|
|
528
528
|
a || ""
|
|
529
529
|
),
|
|
530
|
-
onMouseDown: (
|
|
531
|
-
|
|
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:
|
|
536
|
+
disabled: l || !1,
|
|
537
537
|
ref: t,
|
|
538
538
|
...k,
|
|
539
539
|
children: [
|
|
540
|
-
|
|
540
|
+
c,
|
|
541
541
|
e
|
|
542
542
|
]
|
|
543
543
|
}
|
|
544
544
|
)
|
|
545
545
|
}
|
|
546
546
|
),
|
|
547
|
-
/* @__PURE__ */ h(
|
|
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
|
-
),
|
|
553
|
+
), M = u((n, t) => {
|
|
554
554
|
const { className: a, items: e, isDisabled: s, ...o } = n;
|
|
555
555
|
i(o);
|
|
556
|
-
const
|
|
557
|
-
var d,
|
|
558
|
-
(
|
|
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(
|
|
560
|
+
return /* @__PURE__ */ h(re, { value: c.text, setValue: m, children: [
|
|
561
561
|
/* @__PURE__ */ h(
|
|
562
|
-
|
|
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(
|
|
567
|
+
render: /* @__PURE__ */ r(D, {}),
|
|
568
568
|
children: [
|
|
569
|
-
|
|
569
|
+
c.icon,
|
|
570
570
|
" ",
|
|
571
|
-
|
|
571
|
+
c.text,
|
|
572
572
|
" ",
|
|
573
|
-
/* @__PURE__ */ r(
|
|
573
|
+
/* @__PURE__ */ r(le, {})
|
|
574
574
|
]
|
|
575
575
|
}
|
|
576
576
|
),
|
|
577
577
|
/* @__PURE__ */ r(
|
|
578
|
-
|
|
578
|
+
ce,
|
|
579
579
|
{
|
|
580
580
|
className: b("bn-ak-popover", a || ""),
|
|
581
581
|
ref: t,
|
|
582
582
|
gutter: 4,
|
|
583
|
-
children: e.map((
|
|
584
|
-
|
|
583
|
+
children: e.map((l) => /* @__PURE__ */ h(
|
|
584
|
+
ie,
|
|
585
585
|
{
|
|
586
586
|
className: "bn-ak-select-item",
|
|
587
|
-
value:
|
|
587
|
+
value: l.text,
|
|
588
588
|
children: [
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
589
|
+
l.icon,
|
|
590
|
+
l.text,
|
|
591
|
+
l.text === c.text && /* @__PURE__ */ r(ue, {})
|
|
592
592
|
]
|
|
593
593
|
},
|
|
594
|
-
|
|
594
|
+
l.text
|
|
595
595
|
))
|
|
596
596
|
}
|
|
597
597
|
)
|
|
598
598
|
] });
|
|
599
599
|
}), je = u((n, t) => {
|
|
600
|
-
const {
|
|
601
|
-
|
|
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(
|
|
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:
|
|
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 {
|
|
621
|
-
return i(s, !1),
|
|
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__ */
|
|
667
|
+
/* @__PURE__ */ h("span", { children: [
|
|
668
|
+
e,
|
|
669
|
+
" ",
|
|
670
|
+
s && "(edited)"
|
|
671
|
+
] })
|
|
636
672
|
] })
|
|
637
673
|
] });
|
|
638
|
-
}),
|
|
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:
|
|
680
|
+
actions: c,
|
|
645
681
|
children: m,
|
|
646
|
-
|
|
682
|
+
edited: l,
|
|
683
|
+
...d
|
|
647
684
|
} = n;
|
|
648
|
-
i(
|
|
649
|
-
const [
|
|
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
|
-
|
|
695
|
+
c && (e === !0 || e === void 0 || e === "hover" && p || k) ? /* @__PURE__ */ r(
|
|
659
696
|
N,
|
|
660
697
|
{
|
|
661
|
-
ref:
|
|
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:
|
|
705
|
+
children: c
|
|
669
706
|
}
|
|
670
707
|
) : null,
|
|
671
|
-
/* @__PURE__ */ r(
|
|
708
|
+
/* @__PURE__ */ r(ze, { ...n }),
|
|
672
709
|
m
|
|
673
710
|
]
|
|
674
711
|
}
|
|
675
712
|
);
|
|
676
|
-
}),
|
|
677
|
-
const { className: a, onFocus: e, onBlur: s,
|
|
678
|
-
return i(
|
|
679
|
-
|
|
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:
|
|
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:
|
|
726
|
+
editable: m,
|
|
690
727
|
ref: t,
|
|
691
728
|
onFocus: e,
|
|
692
729
|
onBlur: s,
|
|
693
730
|
children: /* @__PURE__ */ r(
|
|
694
|
-
|
|
731
|
+
O,
|
|
695
732
|
{
|
|
696
|
-
formattingToolbar:
|
|
733
|
+
formattingToolbar: _e
|
|
697
734
|
}
|
|
698
735
|
)
|
|
699
736
|
}
|
|
700
737
|
);
|
|
701
|
-
}),
|
|
702
|
-
const n =
|
|
738
|
+
}), _e = () => {
|
|
739
|
+
const n = H([]).filter(
|
|
703
740
|
(t) => t.key !== "nestBlockButton" && t.key !== "unnestBlockButton"
|
|
704
741
|
);
|
|
705
|
-
return /* @__PURE__ */ r(
|
|
706
|
-
},
|
|
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:
|
|
749
|
+
mainTooltip: c,
|
|
713
750
|
secondaryTooltip: m,
|
|
714
|
-
onClick:
|
|
751
|
+
onClick: l,
|
|
715
752
|
onMouseEnter: d,
|
|
716
|
-
...
|
|
753
|
+
...p
|
|
717
754
|
} = n;
|
|
718
|
-
i(
|
|
719
|
-
const
|
|
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) =>
|
|
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
|
|
738
|
-
/* @__PURE__ */ r(
|
|
739
|
-
/* @__PURE__ */ h(
|
|
740
|
-
/* @__PURE__ */ r("span", { children:
|
|
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
|
-
] }) :
|
|
744
|
-
}),
|
|
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
|
-
}),
|
|
791
|
+
}), Xe = {
|
|
755
792
|
FormattingToolbar: {
|
|
756
|
-
Root:
|
|
757
|
-
Button:
|
|
758
|
-
Select:
|
|
793
|
+
Root: S,
|
|
794
|
+
Button: T,
|
|
795
|
+
Select: M
|
|
759
796
|
},
|
|
760
797
|
FilePanel: {
|
|
761
|
-
Root:
|
|
762
|
-
Button:
|
|
763
|
-
FileInput:
|
|
764
|
-
TabPanel:
|
|
765
|
-
TextInput:
|
|
798
|
+
Root: Se,
|
|
799
|
+
Button: Te,
|
|
800
|
+
FileInput: Me,
|
|
801
|
+
TabPanel: Ie,
|
|
802
|
+
TextInput: ye
|
|
766
803
|
},
|
|
767
804
|
GridSuggestionMenu: {
|
|
768
|
-
Root:
|
|
769
|
-
Item:
|
|
770
|
-
EmptyItem:
|
|
771
|
-
Loader:
|
|
805
|
+
Root: Fe,
|
|
806
|
+
Item: De,
|
|
807
|
+
EmptyItem: Re,
|
|
808
|
+
Loader: Ee
|
|
772
809
|
},
|
|
773
810
|
LinkToolbar: {
|
|
774
|
-
Root:
|
|
775
|
-
Button:
|
|
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:
|
|
783
|
-
Item:
|
|
784
|
-
EmptyItem:
|
|
785
|
-
Label:
|
|
786
|
-
Loader:
|
|
820
|
+
Root: Le,
|
|
821
|
+
Item: Ae,
|
|
822
|
+
EmptyItem: Ge,
|
|
823
|
+
Label: $e,
|
|
824
|
+
Loader: Ve
|
|
787
825
|
},
|
|
788
826
|
TableHandle: {
|
|
789
|
-
Root:
|
|
790
|
-
ExtendButton:
|
|
827
|
+
Root: He,
|
|
828
|
+
ExtendButton: Oe
|
|
791
829
|
},
|
|
792
830
|
Comments: {
|
|
793
|
-
Comment:
|
|
794
|
-
Editor:
|
|
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:
|
|
801
|
-
Group:
|
|
839
|
+
Root: Je,
|
|
840
|
+
Group: Qe
|
|
802
841
|
},
|
|
803
842
|
Toolbar: {
|
|
804
|
-
Root:
|
|
805
|
-
Button:
|
|
843
|
+
Root: S,
|
|
844
|
+
Button: T,
|
|
845
|
+
Select: M
|
|
806
846
|
},
|
|
807
847
|
Form: {
|
|
808
|
-
Root:
|
|
809
|
-
TextInput:
|
|
848
|
+
Root: me,
|
|
849
|
+
TextInput: be
|
|
810
850
|
},
|
|
811
851
|
Menu: {
|
|
812
|
-
Root:
|
|
813
|
-
Trigger:
|
|
814
|
-
Dropdown:
|
|
815
|
-
Divider:
|
|
816
|
-
Label:
|
|
852
|
+
Root: he,
|
|
853
|
+
Trigger: ke,
|
|
854
|
+
Dropdown: pe,
|
|
855
|
+
Divider: fe,
|
|
856
|
+
Label: Ne,
|
|
817
857
|
Item: ge,
|
|
818
|
-
Button:
|
|
858
|
+
Button: ve
|
|
819
859
|
},
|
|
820
860
|
Popover: {
|
|
821
861
|
Root: Pe,
|
|
822
862
|
Trigger: Ce,
|
|
823
|
-
Content:
|
|
863
|
+
Content: xe
|
|
824
864
|
}
|
|
825
865
|
}
|
|
826
|
-
},
|
|
866
|
+
}, Ye = (n) => {
|
|
827
867
|
const { className: t, ...a } = n;
|
|
828
|
-
return /* @__PURE__ */ r(
|
|
829
|
-
|
|
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
|
-
|
|
838
|
-
|
|
877
|
+
Ye as BlockNoteView,
|
|
878
|
+
Xe as components
|
|
839
879
|
};
|
|
840
880
|
//# sourceMappingURL=blocknote-ariakit.js.map
|