@blocknote/mantine 0.19.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as i, jsxs as S } from "react/jsx-runtime";
|
|
2
2
|
import { assertEmpty as d, isSafari as M, COLORS_DEFAULT as q, COLORS_DARK_MODE_DEFAULT as Z, mergeCSSClasses as J } from "@blocknote/core";
|
|
3
3
|
import { elementOverflow as z, useBlockNoteContext as Q, usePrefersColorScheme as X, ComponentsContext as Y, BlockNoteViewRaw as ee } from "@blocknote/react";
|
|
4
|
-
import { TextInput as B, Menu as b, CheckIcon as _, Group as
|
|
4
|
+
import { TextInput as B, Menu as b, CheckIcon as _, Group as p, Tabs as w, LoadingOverlay as te, Button as x, FileInput as ne, Popover as oe, PopoverTarget as re, PopoverDropdown as se, ActionIcon as $, Loader as V, Stack as O, Text as N, Badge as ie, Tooltip as ae, MantineProvider as le } from "@mantine/core";
|
|
5
5
|
import y, { forwardRef as g, createContext as ce, useState as ue, useRef as C, useCallback as F, useContext as de, useEffect as A } from "react";
|
|
6
|
-
import { mergeRefs as
|
|
6
|
+
import { mergeRefs as T, useFocusWithin as me, useFocusTrap as ge } from "@mantine/hooks";
|
|
7
7
|
const G = (e, n, t = !1) => {
|
|
8
|
-
const
|
|
9
|
-
function
|
|
8
|
+
const o = [];
|
|
9
|
+
function r(s, l = "--bn") {
|
|
10
10
|
for (const a in s) {
|
|
11
11
|
const c = a.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), u = `${l}-${c}`;
|
|
12
|
-
typeof s[a] != "object" ? (typeof s[a] == "number" && (s[a] = `${s[a]}px`), t ? n.style.removeProperty(u) : n.style.setProperty(u, s[a].toString())) :
|
|
12
|
+
typeof s[a] != "object" ? (typeof s[a] == "number" && (s[a] = `${s[a]}px`), t ? n.style.removeProperty(u) : n.style.setProperty(u, s[a].toString())) : r(s[a], u);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return r(e), o;
|
|
16
16
|
}, D = (e, n) => G(e, n), fe = {
|
|
17
17
|
colors: {
|
|
18
18
|
editor: {
|
|
@@ -83,18 +83,18 @@ const G = (e, n, t = !1) => {
|
|
|
83
83
|
},
|
|
84
84
|
borderRadius: void 0,
|
|
85
85
|
fontFamily: void 0
|
|
86
|
-
}, be = (e) => G(fe, e, !0),
|
|
86
|
+
}, be = (e) => G(fe, e, !0), pe = g((e, n) => {
|
|
87
87
|
const {
|
|
88
88
|
className: t,
|
|
89
|
-
name:
|
|
90
|
-
label:
|
|
89
|
+
name: o,
|
|
90
|
+
label: r,
|
|
91
91
|
icon: s,
|
|
92
92
|
value: l,
|
|
93
93
|
autoFocus: a,
|
|
94
94
|
placeholder: c,
|
|
95
95
|
onKeyDown: u,
|
|
96
96
|
onChange: f,
|
|
97
|
-
onSubmit:
|
|
97
|
+
onSubmit: v,
|
|
98
98
|
...h
|
|
99
99
|
} = e;
|
|
100
100
|
return d(h), /* @__PURE__ */ i(
|
|
@@ -103,8 +103,8 @@ const G = (e, n, t = !1) => {
|
|
|
103
103
|
size: "xs",
|
|
104
104
|
className: t,
|
|
105
105
|
ref: n,
|
|
106
|
-
name:
|
|
107
|
-
label:
|
|
106
|
+
name: o,
|
|
107
|
+
label: r,
|
|
108
108
|
leftSection: s,
|
|
109
109
|
value: l,
|
|
110
110
|
autoFocus: a,
|
|
@@ -112,7 +112,7 @@ const G = (e, n, t = !1) => {
|
|
|
112
112
|
placeholder: c,
|
|
113
113
|
onKeyDown: u,
|
|
114
114
|
onChange: f,
|
|
115
|
-
onSubmit:
|
|
115
|
+
onSubmit: v
|
|
116
116
|
}
|
|
117
117
|
);
|
|
118
118
|
});
|
|
@@ -122,24 +122,24 @@ var H = {
|
|
|
122
122
|
className: void 0,
|
|
123
123
|
style: void 0,
|
|
124
124
|
attr: void 0
|
|
125
|
-
}, I = y.createContext && /* @__PURE__ */ y.createContext(H),
|
|
125
|
+
}, I = y.createContext && /* @__PURE__ */ y.createContext(H), ve = ["attr", "size", "title"];
|
|
126
126
|
function he(e, n) {
|
|
127
127
|
if (e == null) return {};
|
|
128
|
-
var t = ye(e, n),
|
|
128
|
+
var t = ye(e, n), o, r;
|
|
129
129
|
if (Object.getOwnPropertySymbols) {
|
|
130
130
|
var s = Object.getOwnPropertySymbols(e);
|
|
131
|
-
for (
|
|
132
|
-
|
|
131
|
+
for (r = 0; r < s.length; r++)
|
|
132
|
+
o = s[r], !(n.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(e, o) && (t[o] = e[o]);
|
|
133
133
|
}
|
|
134
134
|
return t;
|
|
135
135
|
}
|
|
136
136
|
function ye(e, n) {
|
|
137
137
|
if (e == null) return {};
|
|
138
138
|
var t = {};
|
|
139
|
-
for (var
|
|
140
|
-
if (Object.prototype.hasOwnProperty.call(e,
|
|
141
|
-
if (n.indexOf(
|
|
142
|
-
t[
|
|
139
|
+
for (var o in e)
|
|
140
|
+
if (Object.prototype.hasOwnProperty.call(e, o)) {
|
|
141
|
+
if (n.indexOf(o) >= 0) continue;
|
|
142
|
+
t[o] = e[o];
|
|
143
143
|
}
|
|
144
144
|
return t;
|
|
145
145
|
}
|
|
@@ -147,8 +147,8 @@ function k() {
|
|
|
147
147
|
return k = Object.assign ? Object.assign.bind() : function(e) {
|
|
148
148
|
for (var n = 1; n < arguments.length; n++) {
|
|
149
149
|
var t = arguments[n];
|
|
150
|
-
for (var
|
|
151
|
-
Object.prototype.hasOwnProperty.call(t,
|
|
150
|
+
for (var o in t)
|
|
151
|
+
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
152
152
|
}
|
|
153
153
|
return e;
|
|
154
154
|
}, k.apply(this, arguments);
|
|
@@ -156,20 +156,20 @@ function k() {
|
|
|
156
156
|
function R(e, n) {
|
|
157
157
|
var t = Object.keys(e);
|
|
158
158
|
if (Object.getOwnPropertySymbols) {
|
|
159
|
-
var
|
|
160
|
-
n && (
|
|
161
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
162
|
-
})), t.push.apply(t,
|
|
159
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
160
|
+
n && (o = o.filter(function(r) {
|
|
161
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
162
|
+
})), t.push.apply(t, o);
|
|
163
163
|
}
|
|
164
164
|
return t;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function P(e) {
|
|
167
167
|
for (var n = 1; n < arguments.length; n++) {
|
|
168
168
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
169
|
-
n % 2 ? R(Object(t), !0).forEach(function(
|
|
170
|
-
Se(e,
|
|
171
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : R(Object(t)).forEach(function(
|
|
172
|
-
Object.defineProperty(e,
|
|
169
|
+
n % 2 ? R(Object(t), !0).forEach(function(o) {
|
|
170
|
+
Se(e, o, t[o]);
|
|
171
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : R(Object(t)).forEach(function(o) {
|
|
172
|
+
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
return e;
|
|
@@ -185,36 +185,36 @@ function we(e, n) {
|
|
|
185
185
|
if (typeof e != "object" || !e) return e;
|
|
186
186
|
var t = e[Symbol.toPrimitive];
|
|
187
187
|
if (t !== void 0) {
|
|
188
|
-
var
|
|
189
|
-
if (typeof
|
|
188
|
+
var o = t.call(e, n || "default");
|
|
189
|
+
if (typeof o != "object") return o;
|
|
190
190
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
191
191
|
}
|
|
192
192
|
return (n === "string" ? String : Number)(e);
|
|
193
193
|
}
|
|
194
194
|
function K(e) {
|
|
195
|
-
return e && e.map((n, t) => /* @__PURE__ */ y.createElement(n.tag,
|
|
195
|
+
return e && e.map((n, t) => /* @__PURE__ */ y.createElement(n.tag, P({
|
|
196
196
|
key: t
|
|
197
197
|
}, n.attr), K(n.child)));
|
|
198
198
|
}
|
|
199
199
|
function U(e) {
|
|
200
200
|
return (n) => /* @__PURE__ */ y.createElement(Ne, k({
|
|
201
|
-
attr:
|
|
201
|
+
attr: P({}, e.attr)
|
|
202
202
|
}, n), K(e.child));
|
|
203
203
|
}
|
|
204
204
|
function Ne(e) {
|
|
205
205
|
var n = (t) => {
|
|
206
206
|
var {
|
|
207
|
-
attr:
|
|
208
|
-
size:
|
|
207
|
+
attr: o,
|
|
208
|
+
size: r,
|
|
209
209
|
title: s
|
|
210
|
-
} = e, l = he(e,
|
|
210
|
+
} = e, l = he(e, ve), a = r || t.size || "1em", c;
|
|
211
211
|
return t.className && (c = t.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ y.createElement("svg", k({
|
|
212
212
|
stroke: "currentColor",
|
|
213
213
|
fill: "currentColor",
|
|
214
214
|
strokeWidth: "0"
|
|
215
|
-
}, t.attr,
|
|
215
|
+
}, t.attr, o, l, {
|
|
216
216
|
className: c,
|
|
217
|
-
style:
|
|
217
|
+
style: P(P({
|
|
218
218
|
color: e.color || t.color
|
|
219
219
|
}, t.style), e.style),
|
|
220
220
|
height: a,
|
|
@@ -230,17 +230,17 @@ function Ce(e) {
|
|
|
230
230
|
function ke(e) {
|
|
231
231
|
return U({ tag: "svg", attr: { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", clipRule: "evenodd" }, child: [] }] })(e);
|
|
232
232
|
}
|
|
233
|
-
const W = ce(void 0),
|
|
233
|
+
const W = ce(void 0), Pe = g((e, n) => {
|
|
234
234
|
const {
|
|
235
235
|
children: t,
|
|
236
|
-
onOpenChange:
|
|
237
|
-
position:
|
|
236
|
+
onOpenChange: o,
|
|
237
|
+
position: r,
|
|
238
238
|
sub: s,
|
|
239
239
|
// not used
|
|
240
240
|
...l
|
|
241
241
|
} = e;
|
|
242
242
|
d(l);
|
|
243
|
-
const [a, c] = ue(!1), u = C(null), f = C(),
|
|
243
|
+
const [a, c] = ue(!1), u = C(null), f = C(), v = F(() => {
|
|
244
244
|
f.current && clearTimeout(f.current), f.current = setTimeout(() => {
|
|
245
245
|
c(!1);
|
|
246
246
|
}, 250);
|
|
@@ -252,15 +252,15 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
252
252
|
{
|
|
253
253
|
value: {
|
|
254
254
|
onMenuMouseOver: h,
|
|
255
|
-
onMenuMouseLeave:
|
|
255
|
+
onMenuMouseLeave: v
|
|
256
256
|
},
|
|
257
257
|
children: /* @__PURE__ */ i(
|
|
258
258
|
b.Item,
|
|
259
259
|
{
|
|
260
260
|
className: "bn-menu-item bn-mt-sub-menu-item",
|
|
261
|
-
ref:
|
|
261
|
+
ref: T(n, u),
|
|
262
262
|
onMouseOver: h,
|
|
263
|
-
onMouseLeave:
|
|
263
|
+
onMouseLeave: v,
|
|
264
264
|
children: /* @__PURE__ */ i(
|
|
265
265
|
b,
|
|
266
266
|
{
|
|
@@ -270,9 +270,9 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
270
270
|
middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
|
|
271
271
|
trigger: "hover",
|
|
272
272
|
opened: a,
|
|
273
|
-
onClose: () =>
|
|
274
|
-
onOpen: () =>
|
|
275
|
-
position:
|
|
273
|
+
onClose: () => o == null ? void 0 : o(!1),
|
|
274
|
+
onOpen: () => o == null ? void 0 : o(!0),
|
|
275
|
+
position: r,
|
|
276
276
|
children: t
|
|
277
277
|
}
|
|
278
278
|
)
|
|
@@ -280,34 +280,44 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
280
280
|
)
|
|
281
281
|
}
|
|
282
282
|
);
|
|
283
|
-
}),
|
|
284
|
-
const { children: n, onOpenChange: t, position:
|
|
285
|
-
return d(s),
|
|
283
|
+
}), Te = (e) => {
|
|
284
|
+
const { children: n, onOpenChange: t, position: o, sub: r, ...s } = e;
|
|
285
|
+
return d(s), r ? /* @__PURE__ */ i(Pe, { ...e }) : /* @__PURE__ */ i(
|
|
286
286
|
b,
|
|
287
287
|
{
|
|
288
288
|
withinPortal: !1,
|
|
289
289
|
middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
|
|
290
290
|
onClose: () => t == null ? void 0 : t(!1),
|
|
291
291
|
onOpen: () => t == null ? void 0 : t(!0),
|
|
292
|
-
position:
|
|
292
|
+
position: o,
|
|
293
293
|
children: n
|
|
294
294
|
}
|
|
295
295
|
);
|
|
296
296
|
}, Me = g((e, n) => {
|
|
297
|
-
const { className: t, children:
|
|
298
|
-
return d(c, !1), l ? /* @__PURE__ */ S(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
297
|
+
const { className: t, children: o, icon: r, checked: s, subTrigger: l, onClick: a, ...c } = e;
|
|
298
|
+
return d(c, !1), l ? /* @__PURE__ */ S(
|
|
299
|
+
"div",
|
|
300
|
+
{
|
|
301
|
+
onClick: (u) => {
|
|
302
|
+
u.preventDefault(), u.stopPropagation();
|
|
303
|
+
},
|
|
304
|
+
ref: n,
|
|
305
|
+
...c,
|
|
306
|
+
children: [
|
|
307
|
+
o,
|
|
308
|
+
/* @__PURE__ */ i(ke, { size: 15 })
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
) : /* @__PURE__ */ i(
|
|
302
312
|
b.Item,
|
|
303
313
|
{
|
|
304
314
|
className: t,
|
|
305
315
|
ref: n,
|
|
306
|
-
leftSection:
|
|
316
|
+
leftSection: r,
|
|
307
317
|
rightSection: s ? /* @__PURE__ */ i(_, { size: 10 }) : s === !1 ? /* @__PURE__ */ i("div", { className: "bn-tick-space" }) : null,
|
|
308
318
|
onClick: a,
|
|
309
319
|
...c,
|
|
310
|
-
children:
|
|
320
|
+
children: o
|
|
311
321
|
}
|
|
312
322
|
);
|
|
313
323
|
}), Fe = (e) => {
|
|
@@ -315,14 +325,14 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
315
325
|
children: n,
|
|
316
326
|
sub: t,
|
|
317
327
|
// unused
|
|
318
|
-
...
|
|
328
|
+
...o
|
|
319
329
|
} = e;
|
|
320
|
-
return d(
|
|
330
|
+
return d(o), /* @__PURE__ */ i(b.Target, { children: n });
|
|
321
331
|
}, Oe = g((e, n) => {
|
|
322
332
|
const {
|
|
323
333
|
className: t,
|
|
324
|
-
children:
|
|
325
|
-
sub:
|
|
334
|
+
children: o,
|
|
335
|
+
sub: r,
|
|
326
336
|
//unused
|
|
327
337
|
...s
|
|
328
338
|
} = e;
|
|
@@ -335,34 +345,34 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
335
345
|
ref: n,
|
|
336
346
|
onMouseOver: l == null ? void 0 : l.onMenuMouseOver,
|
|
337
347
|
onMouseLeave: l == null ? void 0 : l.onMenuMouseLeave,
|
|
338
|
-
children:
|
|
348
|
+
children: o
|
|
339
349
|
}
|
|
340
350
|
);
|
|
341
351
|
}), De = g((e, n) => {
|
|
342
|
-
const { className: t, ...
|
|
343
|
-
return d(
|
|
352
|
+
const { className: t, ...o } = e;
|
|
353
|
+
return d(o), /* @__PURE__ */ i(b.Divider, { className: t, ref: n });
|
|
344
354
|
}), Ie = g((e, n) => {
|
|
345
|
-
const { className: t, children:
|
|
346
|
-
return d(
|
|
355
|
+
const { className: t, children: o, ...r } = e;
|
|
356
|
+
return d(r), /* @__PURE__ */ i(b.Label, { className: t, ref: n, children: o });
|
|
347
357
|
}), Re = g((e, n) => {
|
|
348
358
|
const {
|
|
349
359
|
className: t,
|
|
350
|
-
tabs:
|
|
351
|
-
defaultOpenTab:
|
|
360
|
+
tabs: o,
|
|
361
|
+
defaultOpenTab: r,
|
|
352
362
|
openTab: s,
|
|
353
363
|
setOpenTab: l,
|
|
354
364
|
loading: a,
|
|
355
365
|
...c
|
|
356
366
|
} = e;
|
|
357
|
-
return d(c), /* @__PURE__ */ i(
|
|
367
|
+
return d(c), /* @__PURE__ */ i(p, { className: t, ref: n, children: /* @__PURE__ */ S(
|
|
358
368
|
w,
|
|
359
369
|
{
|
|
360
370
|
value: s,
|
|
361
|
-
defaultValue:
|
|
371
|
+
defaultValue: r,
|
|
362
372
|
onChange: l,
|
|
363
373
|
children: [
|
|
364
374
|
a && /* @__PURE__ */ i(te, { visible: a }),
|
|
365
|
-
/* @__PURE__ */ i(w.List, { children:
|
|
375
|
+
/* @__PURE__ */ i(w.List, { children: o.map((u) => /* @__PURE__ */ i(
|
|
366
376
|
w.Tab,
|
|
367
377
|
{
|
|
368
378
|
"data-test": `${u.name.toLowerCase()}-tab`,
|
|
@@ -371,12 +381,12 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
371
381
|
},
|
|
372
382
|
u.name
|
|
373
383
|
)) }),
|
|
374
|
-
|
|
384
|
+
o.map((u) => /* @__PURE__ */ i(w.Panel, { value: u.name, children: u.tabPanel }, u.name))
|
|
375
385
|
]
|
|
376
386
|
}
|
|
377
387
|
) });
|
|
378
388
|
}), Le = g((e, n) => {
|
|
379
|
-
const { className: t, children:
|
|
389
|
+
const { className: t, children: o, onClick: r, label: s, ...l } = e;
|
|
380
390
|
return d(l), /* @__PURE__ */ i(
|
|
381
391
|
x,
|
|
382
392
|
{
|
|
@@ -384,31 +394,31 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
384
394
|
"aria-label": s,
|
|
385
395
|
className: t,
|
|
386
396
|
ref: n,
|
|
387
|
-
onClick:
|
|
397
|
+
onClick: r,
|
|
388
398
|
...l,
|
|
389
|
-
children:
|
|
399
|
+
children: o
|
|
390
400
|
}
|
|
391
401
|
);
|
|
392
402
|
}), Ee = g((e, n) => {
|
|
393
|
-
const { className: t, accept:
|
|
403
|
+
const { className: t, accept: o, value: r, placeholder: s, onChange: l, ...a } = e;
|
|
394
404
|
return d(a), /* @__PURE__ */ i(
|
|
395
405
|
ne,
|
|
396
406
|
{
|
|
397
407
|
size: "xs",
|
|
398
408
|
className: t,
|
|
399
409
|
ref: n,
|
|
400
|
-
accept:
|
|
401
|
-
value:
|
|
410
|
+
accept: o,
|
|
411
|
+
value: r,
|
|
402
412
|
placeholder: s,
|
|
403
413
|
onChange: l,
|
|
404
414
|
...a
|
|
405
415
|
}
|
|
406
416
|
);
|
|
407
417
|
}), je = g((e, n) => {
|
|
408
|
-
const { className: t, children:
|
|
409
|
-
return d(
|
|
418
|
+
const { className: t, children: o, ...r } = e;
|
|
419
|
+
return d(r), /* @__PURE__ */ i("div", { className: t, ref: n, children: o });
|
|
410
420
|
}), ze = g((e, n) => {
|
|
411
|
-
const { className: t, value:
|
|
421
|
+
const { className: t, value: o, placeholder: r, onKeyDown: s, onChange: l, ...a } = e;
|
|
412
422
|
return d(a), /* @__PURE__ */ i(
|
|
413
423
|
B,
|
|
414
424
|
{
|
|
@@ -416,54 +426,54 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
416
426
|
"data-test": "embed-input",
|
|
417
427
|
className: t,
|
|
418
428
|
ref: n,
|
|
419
|
-
value:
|
|
420
|
-
placeholder:
|
|
429
|
+
value: o,
|
|
430
|
+
placeholder: r,
|
|
421
431
|
onKeyDown: s,
|
|
422
432
|
onChange: l
|
|
423
433
|
}
|
|
424
434
|
);
|
|
425
435
|
}), Be = (e) => {
|
|
426
|
-
const { children: n, opened: t, position:
|
|
427
|
-
return d(
|
|
428
|
-
|
|
436
|
+
const { children: n, opened: t, position: o, ...r } = e;
|
|
437
|
+
return d(r), /* @__PURE__ */ i(
|
|
438
|
+
oe,
|
|
429
439
|
{
|
|
430
440
|
withinPortal: !1,
|
|
431
441
|
zIndex: 1e4,
|
|
432
442
|
opened: t,
|
|
433
|
-
position:
|
|
443
|
+
position: o,
|
|
434
444
|
children: n
|
|
435
445
|
}
|
|
436
446
|
);
|
|
437
447
|
}, _e = (e) => {
|
|
438
448
|
const { children: n, ...t } = e;
|
|
439
|
-
return d(t), /* @__PURE__ */ i(
|
|
449
|
+
return d(t), /* @__PURE__ */ i(re, { children: n });
|
|
440
450
|
}, $e = g((e, n) => {
|
|
441
451
|
const {
|
|
442
452
|
className: t,
|
|
443
|
-
children:
|
|
444
|
-
variant:
|
|
453
|
+
children: o,
|
|
454
|
+
variant: r,
|
|
445
455
|
// unused
|
|
446
456
|
...s
|
|
447
457
|
} = e;
|
|
448
|
-
return d(s), /* @__PURE__ */ i(se, { className: t, ref: n, children:
|
|
458
|
+
return d(s), /* @__PURE__ */ i(se, { className: t, ref: n, children: o });
|
|
449
459
|
}), Ve = g((e, n) => {
|
|
450
|
-
const { className: t, children:
|
|
451
|
-
return d(
|
|
452
|
-
|
|
460
|
+
const { className: t, children: o, ...r } = e;
|
|
461
|
+
return d(r, !1), /* @__PURE__ */ i(
|
|
462
|
+
p,
|
|
453
463
|
{
|
|
454
464
|
align: "center",
|
|
455
465
|
gap: 0,
|
|
456
466
|
className: t,
|
|
457
467
|
ref: n,
|
|
458
|
-
...
|
|
459
|
-
children:
|
|
468
|
+
...r,
|
|
469
|
+
children: o
|
|
460
470
|
}
|
|
461
471
|
);
|
|
462
472
|
}), Ae = g((e, n) => {
|
|
463
473
|
const {
|
|
464
474
|
className: t,
|
|
465
|
-
children:
|
|
466
|
-
icon:
|
|
475
|
+
children: o,
|
|
476
|
+
icon: r,
|
|
467
477
|
onClick: s,
|
|
468
478
|
onDragEnd: l,
|
|
469
479
|
onDragStart: a,
|
|
@@ -471,7 +481,7 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
471
481
|
label: u,
|
|
472
482
|
...f
|
|
473
483
|
} = e;
|
|
474
|
-
return d(f, !1),
|
|
484
|
+
return d(f, !1), r ? /* @__PURE__ */ i(
|
|
475
485
|
$,
|
|
476
486
|
{
|
|
477
487
|
size: 24,
|
|
@@ -483,7 +493,7 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
483
493
|
draggable: c,
|
|
484
494
|
"aria-label": u,
|
|
485
495
|
...f,
|
|
486
|
-
children:
|
|
496
|
+
children: r
|
|
487
497
|
}
|
|
488
498
|
) : /* @__PURE__ */ i(
|
|
489
499
|
x,
|
|
@@ -496,115 +506,115 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
496
506
|
draggable: c,
|
|
497
507
|
"aria-label": u,
|
|
498
508
|
...f,
|
|
499
|
-
children:
|
|
509
|
+
children: o
|
|
500
510
|
}
|
|
501
511
|
);
|
|
502
512
|
}), Ge = g((e, n) => {
|
|
503
|
-
const { className: t, children:
|
|
513
|
+
const { className: t, children: o, id: r, columns: s, ...l } = e;
|
|
504
514
|
return d(l), /* @__PURE__ */ i(
|
|
505
515
|
"div",
|
|
506
516
|
{
|
|
507
517
|
className: t,
|
|
508
518
|
style: { gridTemplateColumns: `repeat(${s}, 1fr)` },
|
|
509
519
|
ref: n,
|
|
510
|
-
id:
|
|
520
|
+
id: r,
|
|
511
521
|
role: "grid",
|
|
512
|
-
children:
|
|
522
|
+
children: o
|
|
513
523
|
}
|
|
514
524
|
);
|
|
515
525
|
}), He = g((e, n) => {
|
|
516
|
-
const { className: t, children:
|
|
526
|
+
const { className: t, children: o, columns: r, ...s } = e;
|
|
517
527
|
return d(s), /* @__PURE__ */ i(
|
|
518
|
-
|
|
528
|
+
p,
|
|
519
529
|
{
|
|
520
530
|
className: t,
|
|
521
|
-
style: { gridColumn: `1 / ${
|
|
531
|
+
style: { gridColumn: `1 / ${r + 1}` },
|
|
522
532
|
ref: n,
|
|
523
|
-
children: /* @__PURE__ */ i(
|
|
533
|
+
children: /* @__PURE__ */ i(p, { className: "bn-mt-suggestion-menu-item-title", children: o })
|
|
524
534
|
}
|
|
525
535
|
);
|
|
526
536
|
}), Ke = g((e, n) => {
|
|
527
|
-
const { className: t, isSelected:
|
|
537
|
+
const { className: t, isSelected: o, onClick: r, item: s, id: l, ...a } = e;
|
|
528
538
|
d(a);
|
|
529
539
|
const c = C(null);
|
|
530
540
|
return A(() => {
|
|
531
|
-
if (!c.current || !
|
|
541
|
+
if (!c.current || !o)
|
|
532
542
|
return;
|
|
533
543
|
const u = z(
|
|
534
544
|
c.current,
|
|
535
545
|
document.querySelector(".bn-grid-suggestion-menu")
|
|
536
546
|
);
|
|
537
547
|
u === "top" ? c.current.scrollIntoView(!0) : u === "bottom" && c.current.scrollIntoView(!1);
|
|
538
|
-
}, [
|
|
548
|
+
}, [o]), /* @__PURE__ */ i(
|
|
539
549
|
"div",
|
|
540
550
|
{
|
|
541
551
|
className: t,
|
|
542
|
-
ref:
|
|
552
|
+
ref: T(n, c),
|
|
543
553
|
id: l,
|
|
544
554
|
role: "option",
|
|
545
|
-
onClick:
|
|
546
|
-
"aria-selected":
|
|
555
|
+
onClick: r,
|
|
556
|
+
"aria-selected": o || void 0,
|
|
547
557
|
children: s.icon
|
|
548
558
|
}
|
|
549
559
|
);
|
|
550
560
|
}), Ue = g((e, n) => {
|
|
551
561
|
const {
|
|
552
562
|
className: t,
|
|
553
|
-
children:
|
|
563
|
+
children: o,
|
|
554
564
|
// unused, using "dots" instead
|
|
555
|
-
columns:
|
|
565
|
+
columns: r,
|
|
556
566
|
...s
|
|
557
567
|
} = e;
|
|
558
568
|
return d(s), /* @__PURE__ */ i(
|
|
559
569
|
V,
|
|
560
570
|
{
|
|
561
571
|
className: t,
|
|
562
|
-
style: { gridColumn: `1 / ${
|
|
572
|
+
style: { gridColumn: `1 / ${r + 1}` },
|
|
563
573
|
type: "dots",
|
|
564
574
|
ref: n
|
|
565
575
|
}
|
|
566
576
|
);
|
|
567
577
|
}), We = g((e, n) => {
|
|
568
|
-
const { className: t, children:
|
|
578
|
+
const { className: t, children: o, id: r, ...s } = e;
|
|
569
579
|
return d(s), /* @__PURE__ */ i(
|
|
570
580
|
O,
|
|
571
581
|
{
|
|
572
582
|
gap: 0,
|
|
573
583
|
className: t,
|
|
574
584
|
ref: n,
|
|
575
|
-
id:
|
|
585
|
+
id: r,
|
|
576
586
|
role: "listbox",
|
|
577
|
-
children:
|
|
587
|
+
children: o
|
|
578
588
|
}
|
|
579
589
|
);
|
|
580
590
|
}), qe = g((e, n) => {
|
|
581
|
-
const { className: t, children:
|
|
582
|
-
return d(
|
|
591
|
+
const { className: t, children: o, ...r } = e;
|
|
592
|
+
return d(r), /* @__PURE__ */ i(p, { className: t, ref: n, children: /* @__PURE__ */ i(p, { className: "bn-mt-suggestion-menu-item-title", children: o }) });
|
|
583
593
|
}), Ze = g((e, n) => {
|
|
584
|
-
const { className: t, isSelected:
|
|
594
|
+
const { className: t, isSelected: o, onClick: r, item: s, id: l, ...a } = e;
|
|
585
595
|
d(a);
|
|
586
596
|
const c = C(null);
|
|
587
597
|
return A(() => {
|
|
588
|
-
if (!c.current || !
|
|
598
|
+
if (!c.current || !o)
|
|
589
599
|
return;
|
|
590
600
|
const u = z(
|
|
591
601
|
c.current,
|
|
592
602
|
document.querySelector(".bn-suggestion-menu")
|
|
593
603
|
);
|
|
594
604
|
u === "top" ? c.current.scrollIntoView(!0) : u === "bottom" && c.current.scrollIntoView(!1);
|
|
595
|
-
}, [
|
|
596
|
-
|
|
605
|
+
}, [o]), /* @__PURE__ */ S(
|
|
606
|
+
p,
|
|
597
607
|
{
|
|
598
608
|
gap: 0,
|
|
599
609
|
className: t,
|
|
600
|
-
ref:
|
|
610
|
+
ref: T(n, c),
|
|
601
611
|
id: l,
|
|
602
612
|
role: "option",
|
|
603
|
-
onClick:
|
|
604
|
-
"aria-selected":
|
|
613
|
+
onClick: r,
|
|
614
|
+
"aria-selected": o || void 0,
|
|
605
615
|
children: [
|
|
606
616
|
s.icon && /* @__PURE__ */ i(
|
|
607
|
-
|
|
617
|
+
p,
|
|
608
618
|
{
|
|
609
619
|
className: "bn-mt-suggestion-menu-item-section",
|
|
610
620
|
"data-position": "left",
|
|
@@ -616,7 +626,7 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
616
626
|
/* @__PURE__ */ i(N, { className: "bn-mt-suggestion-menu-item-subtitle", children: s.subtext })
|
|
617
627
|
] }),
|
|
618
628
|
s.badge && /* @__PURE__ */ i(
|
|
619
|
-
|
|
629
|
+
p,
|
|
620
630
|
{
|
|
621
631
|
"data-position": "right",
|
|
622
632
|
className: "bn-mt-suggestion-menu-item-section",
|
|
@@ -627,21 +637,21 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
627
637
|
}
|
|
628
638
|
);
|
|
629
639
|
}), Je = g((e, n) => {
|
|
630
|
-
const { className: t, children:
|
|
631
|
-
return d(
|
|
640
|
+
const { className: t, children: o, ...r } = e;
|
|
641
|
+
return d(r), /* @__PURE__ */ i(p, { className: t, ref: n, children: o });
|
|
632
642
|
}), Qe = g((e, n) => {
|
|
633
643
|
const {
|
|
634
644
|
className: t,
|
|
635
|
-
children:
|
|
645
|
+
children: o,
|
|
636
646
|
// unused, using "dots" instead
|
|
637
|
-
...
|
|
647
|
+
...r
|
|
638
648
|
} = e;
|
|
639
|
-
return d(
|
|
649
|
+
return d(r), /* @__PURE__ */ i(V, { className: t, type: "dots", ref: n });
|
|
640
650
|
}), Xe = g((e, n) => {
|
|
641
651
|
const {
|
|
642
652
|
className: t,
|
|
643
|
-
children:
|
|
644
|
-
draggable:
|
|
653
|
+
children: o,
|
|
654
|
+
draggable: r,
|
|
645
655
|
onDragStart: s,
|
|
646
656
|
onDragEnd: l,
|
|
647
657
|
style: a,
|
|
@@ -654,22 +664,22 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
654
664
|
className: t,
|
|
655
665
|
ref: n,
|
|
656
666
|
"aria-label": c,
|
|
657
|
-
draggable:
|
|
667
|
+
draggable: r,
|
|
658
668
|
onDragStart: s,
|
|
659
669
|
onDragEnd: l,
|
|
660
670
|
style: a,
|
|
661
671
|
...u,
|
|
662
|
-
children:
|
|
672
|
+
children: o
|
|
663
673
|
}
|
|
664
674
|
);
|
|
665
675
|
}), Ye = g((e, n) => {
|
|
666
|
-
const { children: t, className:
|
|
676
|
+
const { children: t, className: o, onMouseDown: r, onClick: s, ...l } = e;
|
|
667
677
|
return d(l, !1), /* @__PURE__ */ i(
|
|
668
678
|
x,
|
|
669
679
|
{
|
|
670
|
-
className:
|
|
680
|
+
className: o,
|
|
671
681
|
ref: n,
|
|
672
|
-
onMouseDown:
|
|
682
|
+
onMouseDown: r,
|
|
673
683
|
onClick: s,
|
|
674
684
|
...l,
|
|
675
685
|
children: t
|
|
@@ -677,18 +687,18 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
677
687
|
);
|
|
678
688
|
}), L = g(
|
|
679
689
|
(e, n) => {
|
|
680
|
-
const { className: t, children:
|
|
690
|
+
const { className: t, children: o, onMouseEnter: r, onMouseLeave: s, ...l } = e;
|
|
681
691
|
d(l);
|
|
682
|
-
const { ref: a, focused: c } = me(), u = ge(c), f =
|
|
692
|
+
const { ref: a, focused: c } = me(), u = ge(c), f = T(n, a, u);
|
|
683
693
|
return /* @__PURE__ */ i(
|
|
684
|
-
|
|
694
|
+
p,
|
|
685
695
|
{
|
|
686
696
|
className: t,
|
|
687
697
|
ref: f,
|
|
688
698
|
role: "toolbar",
|
|
689
|
-
onMouseEnter:
|
|
699
|
+
onMouseEnter: r,
|
|
690
700
|
onMouseLeave: s,
|
|
691
|
-
children:
|
|
701
|
+
children: o
|
|
692
702
|
}
|
|
693
703
|
);
|
|
694
704
|
}
|
|
@@ -699,28 +709,28 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
699
709
|
(e, n) => {
|
|
700
710
|
const {
|
|
701
711
|
className: t,
|
|
702
|
-
children:
|
|
703
|
-
mainTooltip:
|
|
712
|
+
children: o,
|
|
713
|
+
mainTooltip: r,
|
|
704
714
|
secondaryTooltip: s,
|
|
705
715
|
icon: l,
|
|
706
716
|
isSelected: a,
|
|
707
717
|
isDisabled: c,
|
|
708
718
|
onClick: u,
|
|
709
719
|
label: f,
|
|
710
|
-
...
|
|
720
|
+
...v
|
|
711
721
|
} = e;
|
|
712
|
-
return d(
|
|
722
|
+
return d(v, !1), /* @__PURE__ */ i(
|
|
713
723
|
ae,
|
|
714
724
|
{
|
|
715
725
|
withinPortal: !1,
|
|
716
726
|
label: /* @__PURE__ */ i(
|
|
717
727
|
et,
|
|
718
728
|
{
|
|
719
|
-
mainTooltip:
|
|
729
|
+
mainTooltip: r,
|
|
720
730
|
secondaryTooltip: s
|
|
721
731
|
}
|
|
722
732
|
),
|
|
723
|
-
children:
|
|
733
|
+
children: o ? /* @__PURE__ */ i(
|
|
724
734
|
x,
|
|
725
735
|
{
|
|
726
736
|
"aria-label": f,
|
|
@@ -731,12 +741,12 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
731
741
|
onClick: u,
|
|
732
742
|
"aria-pressed": a,
|
|
733
743
|
"data-selected": a || void 0,
|
|
734
|
-
"data-test":
|
|
744
|
+
"data-test": r.slice(0, 1).toLowerCase() + r.replace(/\s+/g, "").slice(1),
|
|
735
745
|
size: "xs",
|
|
736
746
|
disabled: c || !1,
|
|
737
747
|
ref: n,
|
|
738
|
-
...
|
|
739
|
-
children:
|
|
748
|
+
...v,
|
|
749
|
+
children: o
|
|
740
750
|
}
|
|
741
751
|
) : /* @__PURE__ */ i(
|
|
742
752
|
$,
|
|
@@ -749,11 +759,11 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
749
759
|
onClick: u,
|
|
750
760
|
"aria-pressed": a,
|
|
751
761
|
"data-selected": a || void 0,
|
|
752
|
-
"data-test":
|
|
762
|
+
"data-test": r.slice(0, 1).toLowerCase() + r.replace(/\s+/g, "").slice(1),
|
|
753
763
|
size: 30,
|
|
754
764
|
disabled: c || !1,
|
|
755
765
|
ref: n,
|
|
756
|
-
...
|
|
766
|
+
...v,
|
|
757
767
|
children: l
|
|
758
768
|
}
|
|
759
769
|
)
|
|
@@ -761,9 +771,9 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
761
771
|
);
|
|
762
772
|
}
|
|
763
773
|
), tt = g((e, n) => {
|
|
764
|
-
const { className: t, items:
|
|
774
|
+
const { className: t, items: o, isDisabled: r, ...s } = e;
|
|
765
775
|
d(s);
|
|
766
|
-
const l =
|
|
776
|
+
const l = o.filter((a) => a.isSelected)[0];
|
|
767
777
|
return l ? /* @__PURE__ */ S(
|
|
768
778
|
b,
|
|
769
779
|
{
|
|
@@ -771,7 +781,7 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
771
781
|
transitionProps: {
|
|
772
782
|
exitDuration: 0
|
|
773
783
|
},
|
|
774
|
-
disabled:
|
|
784
|
+
disabled: r,
|
|
775
785
|
middlewares: { flip: !0, shift: !0, inline: !1, size: !0 },
|
|
776
786
|
children: [
|
|
777
787
|
/* @__PURE__ */ i(b.Target, { children: /* @__PURE__ */ i(
|
|
@@ -784,11 +794,11 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
784
794
|
rightSection: /* @__PURE__ */ i(Ce, {}),
|
|
785
795
|
size: "xs",
|
|
786
796
|
variant: "subtle",
|
|
787
|
-
disabled:
|
|
797
|
+
disabled: r,
|
|
788
798
|
children: l.text
|
|
789
799
|
}
|
|
790
800
|
) }),
|
|
791
|
-
/* @__PURE__ */ i(b.Dropdown, { className: t, ref: n, children:
|
|
801
|
+
/* @__PURE__ */ i(b.Dropdown, { className: t, ref: n, children: o.map((a) => /* @__PURE__ */ i(
|
|
792
802
|
b.Item,
|
|
793
803
|
{
|
|
794
804
|
onClick: a.onClick,
|
|
@@ -923,10 +933,10 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
923
933
|
Generic: {
|
|
924
934
|
Form: {
|
|
925
935
|
Root: (e) => /* @__PURE__ */ i("div", { children: e.children }),
|
|
926
|
-
TextInput:
|
|
936
|
+
TextInput: pe
|
|
927
937
|
},
|
|
928
938
|
Menu: {
|
|
929
|
-
Root:
|
|
939
|
+
Root: Te,
|
|
930
940
|
Trigger: Fe,
|
|
931
941
|
Dropdown: Oe,
|
|
932
942
|
Divider: De,
|
|
@@ -939,11 +949,11 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
939
949
|
Content: $e
|
|
940
950
|
}
|
|
941
951
|
}
|
|
942
|
-
},
|
|
952
|
+
}, ot = {
|
|
943
953
|
// Removes button press effect
|
|
944
954
|
activeClassName: ""
|
|
945
955
|
}, dt = (e) => {
|
|
946
|
-
const { className: n, theme: t, ...
|
|
956
|
+
const { className: n, theme: t, ...o } = e, r = Q(), s = X(), l = (r == null ? void 0 : r.colorSchemePreference) || s, a = F(
|
|
947
957
|
(c) => {
|
|
948
958
|
if (c && (be(c), typeof t == "object")) {
|
|
949
959
|
if ("light" in t && "dark" in t) {
|
|
@@ -962,7 +972,7 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
962
972
|
return /* @__PURE__ */ i(Y.Provider, { value: nt, children: /* @__PURE__ */ i(
|
|
963
973
|
le,
|
|
964
974
|
{
|
|
965
|
-
theme:
|
|
975
|
+
theme: ot,
|
|
966
976
|
cssVariablesSelector: ".bn-mantine",
|
|
967
977
|
getRootElement: () => {
|
|
968
978
|
},
|
|
@@ -971,7 +981,7 @@ const W = ce(void 0), Te = g((e, n) => {
|
|
|
971
981
|
{
|
|
972
982
|
className: J("bn-mantine", n || ""),
|
|
973
983
|
theme: typeof t == "object" ? void 0 : t,
|
|
974
|
-
...
|
|
984
|
+
...o,
|
|
975
985
|
ref: a
|
|
976
986
|
}
|
|
977
987
|
)
|