@blocknote/xl-multi-column 0.23.1 → 0.23.3
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,14 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { getNodeById as
|
|
5
|
-
import { Extension as
|
|
6
|
-
import { PluginKey as
|
|
7
|
-
import { DecorationSet as
|
|
8
|
-
import { dropPoint as
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
const te = {
|
|
1
|
+
var jt = Object.defineProperty;
|
|
2
|
+
var Nt = (n, t, r) => t in n ? jt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[t] = r;
|
|
3
|
+
var R = (n, t, r) => Nt(n, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { getNodeById as Me, createStronglyTypedTiptapNode as Ye, createBlockSpecFromStronglyTypedTiptapNode as $e, BlockNoteSchema as Xe, getBlockInfo as Mt, nodeToBlock as ue, UniqueID as Bt, getNearestBlockPos as It, insertOrUpdateBlock as Be } from "@blocknote/core";
|
|
5
|
+
import { Extension as At } from "@tiptap/core";
|
|
6
|
+
import { PluginKey as Lt, Plugin as Ke } from "prosemirror-state";
|
|
7
|
+
import { DecorationSet as Ie, Decoration as Ae } from "prosemirror-view";
|
|
8
|
+
import { dropPoint as Wt } from "prosemirror-transform";
|
|
9
|
+
import I from "react";
|
|
10
|
+
const Vt = {
|
|
12
11
|
slash_menu: {
|
|
13
12
|
two_columns: {
|
|
14
13
|
title: "عمودان",
|
|
@@ -23,7 +22,7 @@ const te = {
|
|
|
23
22
|
group: "الكتل الأساسية"
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
},
|
|
25
|
+
}, zt = {
|
|
27
26
|
slash_menu: {
|
|
28
27
|
two_columns: {
|
|
29
28
|
title: "Zwei Spalten",
|
|
@@ -38,7 +37,7 @@ const te = {
|
|
|
38
37
|
group: "Grundlegende blöcke"
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
|
-
},
|
|
40
|
+
}, Ft = {
|
|
42
41
|
slash_menu: {
|
|
43
42
|
two_columns: {
|
|
44
43
|
title: "Two Columns",
|
|
@@ -53,7 +52,7 @@ const te = {
|
|
|
53
52
|
group: "Basic blocks"
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
|
-
},
|
|
55
|
+
}, Ht = {
|
|
57
56
|
slash_menu: {
|
|
58
57
|
two_columns: {
|
|
59
58
|
title: "Dos Columnas",
|
|
@@ -68,7 +67,7 @@ const te = {
|
|
|
68
67
|
group: "Bloques básicos"
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
|
-
},
|
|
70
|
+
}, Ut = {
|
|
72
71
|
slash_menu: {
|
|
73
72
|
two_columns: {
|
|
74
73
|
title: "Deux Colonnes",
|
|
@@ -83,7 +82,7 @@ const te = {
|
|
|
83
82
|
group: "Blocs de base"
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
|
-
},
|
|
85
|
+
}, Yt = {
|
|
87
86
|
slash_menu: {
|
|
88
87
|
two_columns: {
|
|
89
88
|
title: "Dva Stupca",
|
|
@@ -98,7 +97,7 @@ const te = {
|
|
|
98
97
|
group: "Osnovni blokovi"
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
|
-
},
|
|
100
|
+
}, $t = {
|
|
102
101
|
slash_menu: {
|
|
103
102
|
two_columns: {
|
|
104
103
|
title: "Tvær Dálkar",
|
|
@@ -113,7 +112,7 @@ const te = {
|
|
|
113
112
|
group: "Grunnblokkar"
|
|
114
113
|
}
|
|
115
114
|
}
|
|
116
|
-
},
|
|
115
|
+
}, Xt = {
|
|
117
116
|
slash_menu: {
|
|
118
117
|
two_columns: {
|
|
119
118
|
title: "二列",
|
|
@@ -128,7 +127,7 @@ const te = {
|
|
|
128
127
|
group: "基本ブロック"
|
|
129
128
|
}
|
|
130
129
|
}
|
|
131
|
-
},
|
|
130
|
+
}, Kt = {
|
|
132
131
|
slash_menu: {
|
|
133
132
|
two_columns: {
|
|
134
133
|
title: "두 열",
|
|
@@ -143,7 +142,7 @@ const te = {
|
|
|
143
142
|
group: "기본 블록"
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
|
-
},
|
|
145
|
+
}, Gt = {
|
|
147
146
|
slash_menu: {
|
|
148
147
|
two_columns: {
|
|
149
148
|
title: "Twee Kolommen",
|
|
@@ -158,7 +157,7 @@ const te = {
|
|
|
158
157
|
group: "Basisblokken"
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
|
-
},
|
|
160
|
+
}, qt = {
|
|
162
161
|
slash_menu: {
|
|
163
162
|
two_columns: {
|
|
164
163
|
title: "Dwie Kolumny",
|
|
@@ -173,7 +172,7 @@ const te = {
|
|
|
173
172
|
group: "Podstawowe bloki"
|
|
174
173
|
}
|
|
175
174
|
}
|
|
176
|
-
},
|
|
175
|
+
}, Jt = {
|
|
177
176
|
slash_menu: {
|
|
178
177
|
two_columns: {
|
|
179
178
|
title: "Duas Colunas",
|
|
@@ -188,7 +187,7 @@ const te = {
|
|
|
188
187
|
group: "Blocos básicos"
|
|
189
188
|
}
|
|
190
189
|
}
|
|
191
|
-
},
|
|
190
|
+
}, Zt = {
|
|
192
191
|
slash_menu: {
|
|
193
192
|
two_columns: {
|
|
194
193
|
title: "Два Столбца",
|
|
@@ -203,7 +202,7 @@ const te = {
|
|
|
203
202
|
group: "Базовые блоки"
|
|
204
203
|
}
|
|
205
204
|
}
|
|
206
|
-
},
|
|
205
|
+
}, Qt = {
|
|
207
206
|
slash_menu: {
|
|
208
207
|
two_columns: {
|
|
209
208
|
title: "Hai Cột",
|
|
@@ -218,7 +217,7 @@ const te = {
|
|
|
218
217
|
group: "Khối cơ bản"
|
|
219
218
|
}
|
|
220
219
|
}
|
|
221
|
-
},
|
|
220
|
+
}, er = {
|
|
222
221
|
slash_menu: {
|
|
223
222
|
two_columns: {
|
|
224
223
|
title: "两列",
|
|
@@ -233,164 +232,164 @@ const te = {
|
|
|
233
232
|
group: "基础"
|
|
234
233
|
}
|
|
235
234
|
}
|
|
236
|
-
},
|
|
235
|
+
}, Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
237
236
|
__proto__: null,
|
|
238
|
-
ar:
|
|
239
|
-
de:
|
|
240
|
-
en:
|
|
241
|
-
es:
|
|
242
|
-
fr:
|
|
243
|
-
hr:
|
|
244
|
-
is:
|
|
245
|
-
ja:
|
|
246
|
-
ko:
|
|
247
|
-
nl:
|
|
248
|
-
pl:
|
|
249
|
-
pt:
|
|
250
|
-
ru:
|
|
251
|
-
vi:
|
|
252
|
-
zh:
|
|
237
|
+
ar: Vt,
|
|
238
|
+
de: zt,
|
|
239
|
+
en: Ft,
|
|
240
|
+
es: Ht,
|
|
241
|
+
fr: Ut,
|
|
242
|
+
hr: Yt,
|
|
243
|
+
is: $t,
|
|
244
|
+
ja: Xt,
|
|
245
|
+
ko: Kt,
|
|
246
|
+
nl: Gt,
|
|
247
|
+
pl: qt,
|
|
248
|
+
pt: Jt,
|
|
249
|
+
ru: Zt,
|
|
250
|
+
vi: Qt,
|
|
251
|
+
zh: er
|
|
253
252
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
254
|
-
function
|
|
255
|
-
if (!
|
|
253
|
+
function Le(n) {
|
|
254
|
+
if (!n.dictionary.multi_column)
|
|
256
255
|
throw new Error("Multi-column dictionary not found");
|
|
257
|
-
return
|
|
256
|
+
return n.dictionary.multi_column;
|
|
258
257
|
}
|
|
259
|
-
const
|
|
260
|
-
class
|
|
261
|
-
constructor(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
258
|
+
const B = new Lt("ColumnResizePlugin");
|
|
259
|
+
class tr {
|
|
260
|
+
constructor(t, r) {
|
|
261
|
+
R(this, "editor");
|
|
262
|
+
R(this, "view");
|
|
263
|
+
R(this, "RESIZE_MARGIN_WIDTH_PX", 20);
|
|
264
|
+
R(this, "COLUMN_MIN_WIDTH_PERCENT", 0.5);
|
|
265
|
+
R(this, "getColumnHoverOrDefaultState", (t) => {
|
|
267
266
|
if (!this.editor.isEditable)
|
|
268
267
|
return { type: "default" };
|
|
269
|
-
const
|
|
270
|
-
if (!this.view.dom.contains(
|
|
268
|
+
const r = t.target;
|
|
269
|
+
if (!this.view.dom.contains(r))
|
|
271
270
|
return { type: "default" };
|
|
272
|
-
const
|
|
271
|
+
const i = r.closest(
|
|
273
272
|
".bn-block-column"
|
|
274
273
|
);
|
|
275
|
-
if (!
|
|
274
|
+
if (!i)
|
|
276
275
|
return { type: "default" };
|
|
277
|
-
const
|
|
278
|
-
if (!
|
|
276
|
+
const f = t.clientX, b = i.getBoundingClientRect(), p = f < b.left + this.RESIZE_MARGIN_WIDTH_PX ? "left" : f > b.right - this.RESIZE_MARGIN_WIDTH_PX ? "right" : "none", h = p === "left" ? i.previousElementSibling : p === "right" ? i.nextElementSibling : void 0;
|
|
277
|
+
if (!h)
|
|
279
278
|
return { type: "default" };
|
|
280
|
-
const
|
|
281
|
-
|
|
279
|
+
const u = p === "left" ? h : i, S = p === "left" ? i : h, g = u.getAttribute("data-id"), c = S.getAttribute("data-id"), y = Me(g, this.view.state.doc), E = Me(
|
|
280
|
+
c,
|
|
282
281
|
this.view.state.doc
|
|
283
282
|
);
|
|
284
|
-
if (!
|
|
283
|
+
if (!y || !E || !y.posBeforeNode)
|
|
285
284
|
throw new Error("Column not found");
|
|
286
285
|
return {
|
|
287
286
|
type: "hover",
|
|
288
287
|
leftColumn: {
|
|
289
|
-
element:
|
|
290
|
-
id:
|
|
291
|
-
...
|
|
288
|
+
element: u,
|
|
289
|
+
id: g,
|
|
290
|
+
...y
|
|
292
291
|
},
|
|
293
292
|
rightColumn: {
|
|
294
|
-
element:
|
|
295
|
-
id:
|
|
296
|
-
...
|
|
293
|
+
element: S,
|
|
294
|
+
id: c,
|
|
295
|
+
...E
|
|
297
296
|
}
|
|
298
297
|
};
|
|
299
298
|
});
|
|
300
299
|
// When the user mouses down near the boundary between two columns, we
|
|
301
300
|
// want to set the plugin state to resize, so the columns can be resized
|
|
302
301
|
// by moving the mouse.
|
|
303
|
-
|
|
304
|
-
let
|
|
305
|
-
if (
|
|
302
|
+
R(this, "mouseDownHandler", (t) => {
|
|
303
|
+
let r = this.getColumnHoverOrDefaultState(t);
|
|
304
|
+
if (r.type === "default")
|
|
306
305
|
return;
|
|
307
|
-
|
|
308
|
-
const
|
|
309
|
-
|
|
306
|
+
t.preventDefault();
|
|
307
|
+
const i = t.clientX, f = r.leftColumn.element.getBoundingClientRect().width, b = r.rightColumn.element.getBoundingClientRect().width, p = r.leftColumn.node.attrs.width, h = r.rightColumn.node.attrs.width;
|
|
308
|
+
r = {
|
|
310
309
|
type: "resize",
|
|
311
|
-
startPos:
|
|
310
|
+
startPos: i,
|
|
312
311
|
leftColumn: {
|
|
313
|
-
...
|
|
314
|
-
widthPx:
|
|
315
|
-
widthPercent:
|
|
312
|
+
...r.leftColumn,
|
|
313
|
+
widthPx: f,
|
|
314
|
+
widthPercent: p
|
|
316
315
|
},
|
|
317
316
|
rightColumn: {
|
|
318
|
-
...
|
|
319
|
-
widthPx:
|
|
320
|
-
widthPercent:
|
|
317
|
+
...r.rightColumn,
|
|
318
|
+
widthPx: b,
|
|
319
|
+
widthPercent: h
|
|
321
320
|
}
|
|
322
321
|
}, this.view.dispatch(
|
|
323
|
-
this.view.state.tr.setMeta(
|
|
322
|
+
this.view.state.tr.setMeta(B, r)
|
|
324
323
|
), this.editor.sideMenu.freezeMenu();
|
|
325
324
|
});
|
|
326
325
|
// If the plugin isn't in a resize state, we want to update it to either a
|
|
327
326
|
// hover state if the mouse is near the boundary between two columns, or
|
|
328
327
|
// default otherwise. If the plugin is in a resize state, we want to
|
|
329
328
|
// update the column widths based on the horizontal mouse movement.
|
|
330
|
-
|
|
331
|
-
var
|
|
332
|
-
const
|
|
333
|
-
if (!
|
|
329
|
+
R(this, "mouseMoveHandler", (t) => {
|
|
330
|
+
var u, S;
|
|
331
|
+
const r = B.getState(this.view.state);
|
|
332
|
+
if (!r)
|
|
334
333
|
return;
|
|
335
|
-
if (
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
334
|
+
if (r.type !== "resize") {
|
|
335
|
+
const g = this.getColumnHoverOrDefaultState(t), c = r.type === "default" && g.type === "default", y = r.type !== "default" && g.type !== "default" && r.leftColumn.id === g.leftColumn.id && r.rightColumn.id === g.rightColumn.id;
|
|
336
|
+
if (c || y || g.type === "hover" && ((S = (u = this.editor.sideMenu.view) == null ? void 0 : u.state) != null && S.show))
|
|
338
337
|
return;
|
|
339
338
|
this.view.dispatch(
|
|
340
|
-
this.view.state.tr.setMeta(
|
|
339
|
+
this.view.state.tr.setMeta(B, g)
|
|
341
340
|
);
|
|
342
341
|
return;
|
|
343
342
|
}
|
|
344
|
-
const
|
|
345
|
-
let
|
|
346
|
-
|
|
343
|
+
const f = (t.clientX - r.startPos) * r.leftColumn.widthPercent, b = (r.leftColumn.widthPx + f) / r.leftColumn.widthPx - 1;
|
|
344
|
+
let p = r.leftColumn.widthPercent + b, h = r.rightColumn.widthPercent - b;
|
|
345
|
+
p < this.COLUMN_MIN_WIDTH_PERCENT ? (h -= this.COLUMN_MIN_WIDTH_PERCENT - p, p = this.COLUMN_MIN_WIDTH_PERCENT) : h < this.COLUMN_MIN_WIDTH_PERCENT && (p -= this.COLUMN_MIN_WIDTH_PERCENT - h, h = this.COLUMN_MIN_WIDTH_PERCENT), this.view.dispatch(
|
|
347
346
|
this.view.state.tr.setNodeAttribute(
|
|
348
|
-
|
|
347
|
+
r.leftColumn.posBeforeNode,
|
|
349
348
|
"width",
|
|
350
|
-
|
|
349
|
+
p
|
|
351
350
|
).setNodeAttribute(
|
|
352
|
-
|
|
351
|
+
r.rightColumn.posBeforeNode,
|
|
353
352
|
"width",
|
|
354
|
-
|
|
353
|
+
h
|
|
355
354
|
).setMeta("addToHistory", !1)
|
|
356
355
|
);
|
|
357
356
|
});
|
|
358
357
|
// If the plugin is in a resize state, we want to revert it to a default
|
|
359
358
|
// or hover, depending on where the mouse cursor is, when the user
|
|
360
359
|
// releases the mouse button.
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
if (!
|
|
360
|
+
R(this, "mouseUpHandler", (t) => {
|
|
361
|
+
const r = B.getState(this.view.state);
|
|
362
|
+
if (!r || r.type !== "resize")
|
|
364
363
|
return;
|
|
365
|
-
const
|
|
364
|
+
const i = this.getColumnHoverOrDefaultState(t);
|
|
366
365
|
this.view.dispatch(
|
|
367
|
-
this.view.state.tr.setMeta(
|
|
366
|
+
this.view.state.tr.setMeta(B, i)
|
|
368
367
|
), this.editor.sideMenu.unfreezeMenu();
|
|
369
368
|
});
|
|
370
|
-
this.editor =
|
|
369
|
+
this.editor = t, this.view = r, this.view.dom.addEventListener("mousedown", this.mouseDownHandler), document.body.addEventListener("mousemove", this.mouseMoveHandler), document.body.addEventListener("mouseup", this.mouseUpHandler);
|
|
371
370
|
}
|
|
372
371
|
destroy() {
|
|
373
372
|
this.view.dom.removeEventListener("mousedown", this.mouseDownHandler), document.body.removeEventListener("mousemove", this.mouseMoveHandler), document.body.removeEventListener("mouseup", this.mouseUpHandler);
|
|
374
373
|
}
|
|
375
374
|
}
|
|
376
|
-
const
|
|
377
|
-
key:
|
|
375
|
+
const rr = (n) => new Ke({
|
|
376
|
+
key: B,
|
|
378
377
|
props: {
|
|
379
378
|
// This adds a border between the columns when the user is
|
|
380
379
|
// resizing them or when the cursor is near their boundary.
|
|
381
|
-
decorations: (
|
|
382
|
-
const
|
|
383
|
-
return !
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
380
|
+
decorations: (t) => {
|
|
381
|
+
const r = B.getState(t);
|
|
382
|
+
return !r || r.type === "default" ? Ie.empty : Ie.create(t.doc, [
|
|
383
|
+
Ae.node(
|
|
384
|
+
r.leftColumn.posBeforeNode,
|
|
385
|
+
r.leftColumn.posBeforeNode + r.leftColumn.node.nodeSize,
|
|
387
386
|
{
|
|
388
387
|
style: "box-shadow: 4px 0 0 #ccc; cursor: col-resize"
|
|
389
388
|
}
|
|
390
389
|
),
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
390
|
+
Ae.node(
|
|
391
|
+
r.rightColumn.posBeforeNode,
|
|
392
|
+
r.rightColumn.posBeforeNode + r.rightColumn.node.nodeSize,
|
|
394
393
|
{
|
|
395
394
|
style: "cursor: col-resize"
|
|
396
395
|
}
|
|
@@ -400,18 +399,18 @@ const be = (o) => new H({
|
|
|
400
399
|
},
|
|
401
400
|
state: {
|
|
402
401
|
init: () => ({ type: "default" }),
|
|
403
|
-
apply: (
|
|
404
|
-
const
|
|
405
|
-
return
|
|
402
|
+
apply: (t, r) => {
|
|
403
|
+
const i = t.getMeta(B);
|
|
404
|
+
return i === void 0 ? r : i;
|
|
406
405
|
}
|
|
407
406
|
},
|
|
408
|
-
view: (
|
|
409
|
-
}),
|
|
407
|
+
view: (t) => new tr(n, t)
|
|
408
|
+
}), nr = (n) => At.create({
|
|
410
409
|
name: "columnResize",
|
|
411
410
|
addProseMirrorPlugins() {
|
|
412
|
-
return [
|
|
411
|
+
return [rr(n)];
|
|
413
412
|
}
|
|
414
|
-
}),
|
|
413
|
+
}), or = Ye({
|
|
415
414
|
name: "column",
|
|
416
415
|
group: "bnBlock childContainer",
|
|
417
416
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -434,16 +433,16 @@ const be = (o) => new H({
|
|
|
434
433
|
// value, which handles all the resizing for us, instead of manually
|
|
435
434
|
// having to set the `width` property of each column.
|
|
436
435
|
default: 1,
|
|
437
|
-
parseHTML: (
|
|
438
|
-
const
|
|
439
|
-
if (
|
|
436
|
+
parseHTML: (n) => {
|
|
437
|
+
const t = n.getAttribute("data-width");
|
|
438
|
+
if (t === null)
|
|
440
439
|
return null;
|
|
441
|
-
const
|
|
442
|
-
return isFinite(
|
|
440
|
+
const r = parseFloat(t);
|
|
441
|
+
return isFinite(r) ? r : null;
|
|
443
442
|
},
|
|
444
|
-
renderHTML: (
|
|
445
|
-
"data-width":
|
|
446
|
-
style: `flex-grow: ${
|
|
443
|
+
renderHTML: (n) => ({
|
|
444
|
+
"data-width": n.width.toString(),
|
|
445
|
+
style: `flex-grow: ${n.width};`
|
|
447
446
|
})
|
|
448
447
|
}
|
|
449
448
|
};
|
|
@@ -452,24 +451,24 @@ const be = (o) => new H({
|
|
|
452
451
|
return [
|
|
453
452
|
{
|
|
454
453
|
tag: "div",
|
|
455
|
-
getAttrs: (
|
|
454
|
+
getAttrs: (n) => typeof n == "string" ? !1 : n.getAttribute("data-node-type") === this.name ? {} : !1
|
|
456
455
|
}
|
|
457
456
|
];
|
|
458
457
|
},
|
|
459
|
-
renderHTML({ HTMLAttributes:
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
for (const [
|
|
463
|
-
|
|
458
|
+
renderHTML({ HTMLAttributes: n }) {
|
|
459
|
+
const t = document.createElement("div");
|
|
460
|
+
t.className = "bn-block-column", t.setAttribute("data-node-type", this.name);
|
|
461
|
+
for (const [r, i] of Object.entries(n))
|
|
462
|
+
t.setAttribute(r, i);
|
|
464
463
|
return {
|
|
465
|
-
dom:
|
|
466
|
-
contentDOM:
|
|
464
|
+
dom: t,
|
|
465
|
+
contentDOM: t
|
|
467
466
|
};
|
|
468
467
|
},
|
|
469
468
|
addExtensions() {
|
|
470
|
-
return [
|
|
469
|
+
return [nr(this.options.editor)];
|
|
471
470
|
}
|
|
472
|
-
}),
|
|
471
|
+
}), ir = Ye({
|
|
473
472
|
name: "columnList",
|
|
474
473
|
group: "childContainer bnBlock blockGroupChild",
|
|
475
474
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -482,116 +481,116 @@ const be = (o) => new H({
|
|
|
482
481
|
return [
|
|
483
482
|
{
|
|
484
483
|
tag: "div",
|
|
485
|
-
getAttrs: (
|
|
484
|
+
getAttrs: (n) => typeof n == "string" ? !1 : n.getAttribute("data-node-type") === this.name ? {} : !1
|
|
486
485
|
}
|
|
487
486
|
];
|
|
488
487
|
},
|
|
489
|
-
renderHTML({ HTMLAttributes:
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
for (const [
|
|
493
|
-
|
|
494
|
-
return
|
|
495
|
-
dom:
|
|
496
|
-
contentDOM:
|
|
488
|
+
renderHTML({ HTMLAttributes: n }) {
|
|
489
|
+
const t = document.createElement("div");
|
|
490
|
+
t.className = "bn-block-column-list", t.setAttribute("data-node-type", this.name);
|
|
491
|
+
for (const [r, i] of Object.entries(n))
|
|
492
|
+
t.setAttribute(r, i);
|
|
493
|
+
return t.style.display = "flex", {
|
|
494
|
+
dom: t,
|
|
495
|
+
contentDOM: t
|
|
497
496
|
};
|
|
498
497
|
}
|
|
499
|
-
}),
|
|
498
|
+
}), Ge = $e(or, {
|
|
500
499
|
width: {
|
|
501
500
|
default: 1
|
|
502
501
|
}
|
|
503
|
-
}),
|
|
504
|
-
|
|
502
|
+
}), qe = $e(
|
|
503
|
+
ir,
|
|
505
504
|
{}
|
|
506
|
-
),
|
|
505
|
+
), We = Xe.create({
|
|
507
506
|
blockSpecs: {
|
|
508
|
-
column:
|
|
509
|
-
columnList:
|
|
507
|
+
column: Ge,
|
|
508
|
+
columnList: qe
|
|
510
509
|
}
|
|
511
|
-
}),
|
|
510
|
+
}), Tr = (n) => Xe.create({
|
|
512
511
|
blockSpecs: {
|
|
513
|
-
...
|
|
514
|
-
column:
|
|
515
|
-
columnList:
|
|
512
|
+
...n.blockSpecs,
|
|
513
|
+
column: Ge,
|
|
514
|
+
columnList: qe
|
|
516
515
|
},
|
|
517
|
-
inlineContentSpecs:
|
|
518
|
-
styleSpecs:
|
|
519
|
-
}),
|
|
520
|
-
function
|
|
521
|
-
return { left:
|
|
516
|
+
inlineContentSpecs: n.inlineContentSpecs,
|
|
517
|
+
styleSpecs: n.styleSpecs
|
|
518
|
+
}), J = 0.1;
|
|
519
|
+
function sr(n) {
|
|
520
|
+
return { left: n.clientX, top: n.clientY };
|
|
522
521
|
}
|
|
523
|
-
function
|
|
524
|
-
const
|
|
525
|
-
return new
|
|
526
|
-
view(
|
|
527
|
-
return new
|
|
522
|
+
function Or(n) {
|
|
523
|
+
const t = n.editor;
|
|
524
|
+
return new Ke({
|
|
525
|
+
view(r) {
|
|
526
|
+
return new ar(r, n);
|
|
528
527
|
},
|
|
529
528
|
props: {
|
|
530
|
-
handleDrop(
|
|
531
|
-
const
|
|
532
|
-
if (!
|
|
529
|
+
handleDrop(r, i, f, b) {
|
|
530
|
+
const p = r.posAtCoords(sr(i));
|
|
531
|
+
if (!p)
|
|
533
532
|
throw new Error("Could not get event position");
|
|
534
|
-
const
|
|
535
|
-
let
|
|
536
|
-
if (
|
|
533
|
+
const h = Je(r.state, p), u = Mt(h), g = r.nodeDOM(h.posBeforeNode).getBoundingClientRect();
|
|
534
|
+
let c = "regular";
|
|
535
|
+
if (i.clientX <= g.left + g.width * J && (c = "left"), i.clientX >= g.right - g.width * J && (c = "right"), c === "regular")
|
|
537
536
|
return !1;
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
537
|
+
const y = ue(
|
|
538
|
+
f.content.child(0),
|
|
539
|
+
t.schema.blockSchema,
|
|
540
|
+
t.schema.inlineContentSchema,
|
|
541
|
+
t.schema.styleSchema
|
|
543
542
|
// TODO: cache?
|
|
544
543
|
);
|
|
545
|
-
if (
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
544
|
+
if (u.blockNoteType === "column") {
|
|
545
|
+
const E = r.state.doc.resolve(u.bnBlock.beforePos).node(), w = ue(
|
|
546
|
+
E,
|
|
547
|
+
t.schema.blockSchema,
|
|
548
|
+
t.schema.inlineContentSchema,
|
|
549
|
+
t.schema.styleSchema
|
|
551
550
|
);
|
|
552
|
-
let
|
|
553
|
-
|
|
554
|
-
|
|
551
|
+
let T = 0;
|
|
552
|
+
w.children.forEach((x) => {
|
|
553
|
+
T += x.props.width;
|
|
555
554
|
});
|
|
556
|
-
const
|
|
557
|
-
if (
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
|
|
555
|
+
const j = T / w.children.length;
|
|
556
|
+
if (j < 0.99 || j > 1.01) {
|
|
557
|
+
const x = 1 / j;
|
|
558
|
+
w.children.forEach((W) => {
|
|
559
|
+
W.props.width = W.props.width * x;
|
|
561
560
|
});
|
|
562
561
|
}
|
|
563
|
-
const
|
|
564
|
-
(
|
|
565
|
-
),
|
|
566
|
-
...
|
|
567
|
-
children:
|
|
568
|
-
(
|
|
562
|
+
const M = w.children.findIndex(
|
|
563
|
+
(x) => x.id === u.bnBlock.node.attrs.id
|
|
564
|
+
), k = w.children.map((x) => ({
|
|
565
|
+
...x,
|
|
566
|
+
children: x.children.filter(
|
|
567
|
+
(W) => W.id !== y.id
|
|
569
568
|
)
|
|
570
|
-
})).filter((
|
|
569
|
+
})).filter((x) => x.children.length > 0).toSpliced(c === "left" ? M : M + 1, 0, {
|
|
571
570
|
type: "column",
|
|
572
|
-
children: [
|
|
571
|
+
children: [y],
|
|
573
572
|
props: {},
|
|
574
573
|
content: void 0,
|
|
575
|
-
id:
|
|
574
|
+
id: Bt.options.generateID()
|
|
576
575
|
});
|
|
577
|
-
|
|
578
|
-
children:
|
|
576
|
+
t.removeBlocks([y]), t.updateBlock(w, {
|
|
577
|
+
children: k
|
|
579
578
|
});
|
|
580
579
|
} else {
|
|
581
|
-
const
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
),
|
|
587
|
-
|
|
588
|
-
[
|
|
580
|
+
const E = ue(
|
|
581
|
+
u.bnBlock.node,
|
|
582
|
+
t.schema.blockSchema,
|
|
583
|
+
t.schema.inlineContentSchema,
|
|
584
|
+
t.schema.styleSchema
|
|
585
|
+
), w = c === "left" ? [y, E] : [E, y];
|
|
586
|
+
t.removeBlocks([y]), t.replaceBlocks(
|
|
587
|
+
[E],
|
|
589
588
|
[
|
|
590
589
|
{
|
|
591
590
|
type: "columnList",
|
|
592
|
-
children:
|
|
591
|
+
children: w.map((T) => ({
|
|
593
592
|
type: "column",
|
|
594
|
-
children: [
|
|
593
|
+
children: [T]
|
|
595
594
|
}))
|
|
596
595
|
}
|
|
597
596
|
]
|
|
@@ -602,131 +601,131 @@ function Xe(o) {
|
|
|
602
601
|
}
|
|
603
602
|
});
|
|
604
603
|
}
|
|
605
|
-
class
|
|
606
|
-
constructor(
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
this.editorView =
|
|
615
|
-
const
|
|
616
|
-
this[
|
|
604
|
+
class ar {
|
|
605
|
+
constructor(t, r) {
|
|
606
|
+
R(this, "width");
|
|
607
|
+
R(this, "color");
|
|
608
|
+
R(this, "class");
|
|
609
|
+
R(this, "cursorPos");
|
|
610
|
+
R(this, "element", null);
|
|
611
|
+
R(this, "timeout");
|
|
612
|
+
R(this, "handlers");
|
|
613
|
+
this.editorView = t, this.width = r.width ?? 1, this.color = r.color === !1 ? void 0 : r.color || "black", this.class = r.class, this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((i) => {
|
|
614
|
+
const f = (b) => {
|
|
615
|
+
this[i](b);
|
|
617
616
|
};
|
|
618
|
-
return
|
|
619
|
-
|
|
620
|
-
|
|
617
|
+
return t.dom.addEventListener(
|
|
618
|
+
i,
|
|
619
|
+
f,
|
|
621
620
|
// drop event captured in bubbling phase to make sure
|
|
622
621
|
// "cursorPos" is set to undefined before the "handleDrop" handler is called
|
|
623
622
|
// (otherwise an error could be thrown, see https://github.com/TypeCellOS/BlockNote/pull/1240)
|
|
624
|
-
|
|
625
|
-
), { name:
|
|
623
|
+
i === "drop" ? !0 : void 0
|
|
624
|
+
), { name: i, handler: f };
|
|
626
625
|
});
|
|
627
626
|
}
|
|
628
627
|
destroy() {
|
|
629
628
|
this.handlers.forEach(
|
|
630
|
-
({ name:
|
|
631
|
-
e,
|
|
629
|
+
({ name: t, handler: r }) => this.editorView.dom.removeEventListener(
|
|
632
630
|
t,
|
|
633
|
-
|
|
631
|
+
r,
|
|
632
|
+
t === "drop" ? !0 : void 0
|
|
634
633
|
)
|
|
635
634
|
);
|
|
636
635
|
}
|
|
637
|
-
update(
|
|
638
|
-
this.cursorPos != null &&
|
|
636
|
+
update(t, r) {
|
|
637
|
+
this.cursorPos != null && r.doc !== t.state.doc && (this.cursorPos.pos > t.state.doc.content.size ? this.setCursor(void 0) : this.updateOverlay());
|
|
639
638
|
}
|
|
640
|
-
setCursor(
|
|
641
|
-
var
|
|
642
|
-
|
|
639
|
+
setCursor(t) {
|
|
640
|
+
var r, i;
|
|
641
|
+
t === this.cursorPos || (t == null ? void 0 : t.pos) === ((r = this.cursorPos) == null ? void 0 : r.pos) && (t == null ? void 0 : t.position) === ((i = this.cursorPos) == null ? void 0 : i.position) || (this.cursorPos = t, t ? this.updateOverlay() : (this.element.parentNode.removeChild(this.element), this.element = null));
|
|
643
642
|
}
|
|
644
643
|
updateOverlay() {
|
|
645
644
|
if (!this.cursorPos)
|
|
646
645
|
throw new Error("updateOverlay called with no cursor position");
|
|
647
|
-
const
|
|
648
|
-
let
|
|
649
|
-
const
|
|
650
|
-
if (
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
646
|
+
const t = this.editorView.state.doc.resolve(this.cursorPos.pos), r = !t.parent.inlineContent;
|
|
647
|
+
let i;
|
|
648
|
+
const f = this.editorView.dom, b = f.getBoundingClientRect(), p = b.width / f.offsetWidth, h = b.height / f.offsetHeight;
|
|
649
|
+
if (r) {
|
|
650
|
+
const c = t.nodeBefore, y = t.nodeAfter;
|
|
651
|
+
if (c || y)
|
|
653
652
|
if (this.cursorPos.position === "left" || this.cursorPos.position === "right") {
|
|
654
|
-
const
|
|
655
|
-
if (!
|
|
653
|
+
const E = this.editorView.nodeDOM(this.cursorPos.pos);
|
|
654
|
+
if (!E)
|
|
656
655
|
throw new Error("nodeDOM returned null in updateOverlay");
|
|
657
|
-
const
|
|
658
|
-
|
|
659
|
-
left:
|
|
660
|
-
right:
|
|
661
|
-
top:
|
|
662
|
-
bottom:
|
|
656
|
+
const w = E.getBoundingClientRect(), T = this.width / 2 * h, j = this.cursorPos.position === "left" ? w.left : w.right;
|
|
657
|
+
i = {
|
|
658
|
+
left: j - T,
|
|
659
|
+
right: j + T,
|
|
660
|
+
top: w.top,
|
|
661
|
+
bottom: w.bottom
|
|
663
662
|
// left: blockRect.left,
|
|
664
663
|
// right: blockRect.right,
|
|
665
664
|
};
|
|
666
665
|
} else {
|
|
667
|
-
const
|
|
668
|
-
this.cursorPos.pos - (
|
|
666
|
+
const E = this.editorView.nodeDOM(
|
|
667
|
+
this.cursorPos.pos - (c ? c.nodeSize : 0)
|
|
669
668
|
);
|
|
670
|
-
if (
|
|
671
|
-
const
|
|
672
|
-
let
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
this.cursorPos.position === "regular" && (
|
|
676
|
-
left:
|
|
677
|
-
right:
|
|
678
|
-
top:
|
|
679
|
-
bottom:
|
|
669
|
+
if (E) {
|
|
670
|
+
const w = E.getBoundingClientRect();
|
|
671
|
+
let T = c ? w.bottom : w.top;
|
|
672
|
+
c && y && (T = (T + this.editorView.nodeDOM(this.cursorPos.pos).getBoundingClientRect().top) / 2);
|
|
673
|
+
const j = this.width / 2 * h;
|
|
674
|
+
this.cursorPos.position === "regular" && (i = {
|
|
675
|
+
left: w.left,
|
|
676
|
+
right: w.right,
|
|
677
|
+
top: T - j,
|
|
678
|
+
bottom: T + j
|
|
680
679
|
});
|
|
681
680
|
}
|
|
682
681
|
}
|
|
683
682
|
}
|
|
684
|
-
if (!
|
|
685
|
-
const
|
|
686
|
-
|
|
687
|
-
left:
|
|
688
|
-
right:
|
|
689
|
-
top:
|
|
690
|
-
bottom:
|
|
683
|
+
if (!i) {
|
|
684
|
+
const c = this.editorView.coordsAtPos(this.cursorPos.pos), y = this.width / 2 * p;
|
|
685
|
+
i = {
|
|
686
|
+
left: c.left - y,
|
|
687
|
+
right: c.left + y,
|
|
688
|
+
top: c.top,
|
|
689
|
+
bottom: c.bottom
|
|
691
690
|
};
|
|
692
691
|
}
|
|
693
|
-
const
|
|
694
|
-
this.element || (this.element =
|
|
692
|
+
const u = this.editorView.dom.offsetParent;
|
|
693
|
+
this.element || (this.element = u.appendChild(document.createElement("div")), this.class && (this.element.className = this.class), this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none;", this.color && (this.element.style.backgroundColor = this.color)), this.element.classList.toggle("prosemirror-dropcursor-block", r), this.element.classList.toggle(
|
|
695
694
|
"prosemirror-dropcursor-vertical",
|
|
696
695
|
this.cursorPos.position !== "regular"
|
|
697
|
-
), this.element.classList.toggle("prosemirror-dropcursor-inline", !
|
|
698
|
-
let
|
|
699
|
-
if (!
|
|
700
|
-
|
|
696
|
+
), this.element.classList.toggle("prosemirror-dropcursor-inline", !r);
|
|
697
|
+
let S, g;
|
|
698
|
+
if (!u || u === document.body && getComputedStyle(u).position === "static")
|
|
699
|
+
S = -window.scrollX, g = -window.scrollY;
|
|
701
700
|
else {
|
|
702
|
-
const
|
|
703
|
-
|
|
701
|
+
const c = u.getBoundingClientRect(), y = c.width / u.offsetWidth, E = c.height / u.offsetHeight;
|
|
702
|
+
S = c.left - u.scrollLeft * y, g = c.top - u.scrollTop * E;
|
|
704
703
|
}
|
|
705
|
-
this.element.style.left = (
|
|
704
|
+
this.element.style.left = (i.left - S) / p + "px", this.element.style.top = (i.top - g) / h + "px", this.element.style.width = (i.right - i.left) / p + "px", this.element.style.height = (i.bottom - i.top) / h + "px";
|
|
706
705
|
}
|
|
707
|
-
scheduleRemoval(
|
|
708
|
-
clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(void 0),
|
|
706
|
+
scheduleRemoval(t) {
|
|
707
|
+
clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(void 0), t);
|
|
709
708
|
}
|
|
710
709
|
// this gets executed on every mouse move when dragging (drag over)
|
|
711
|
-
dragover(
|
|
710
|
+
dragover(t) {
|
|
712
711
|
if (!this.editorView.editable)
|
|
713
712
|
return;
|
|
714
|
-
const
|
|
715
|
-
left:
|
|
716
|
-
top:
|
|
717
|
-
}),
|
|
718
|
-
if (
|
|
719
|
-
let
|
|
720
|
-
const
|
|
721
|
-
if (
|
|
722
|
-
const
|
|
713
|
+
const r = this.editorView.posAtCoords({
|
|
714
|
+
left: t.clientX,
|
|
715
|
+
top: t.clientY
|
|
716
|
+
}), i = r && r.inside >= 0 && this.editorView.state.doc.nodeAt(r.inside), f = i && i.type.spec.disableDropCursor, b = typeof f == "function" ? f(this.editorView, r, t) : f;
|
|
717
|
+
if (r && !b) {
|
|
718
|
+
let p = "regular", h = r.pos;
|
|
719
|
+
const u = Je(this.editorView.state, r), g = this.editorView.nodeDOM(u.posBeforeNode).getBoundingClientRect();
|
|
720
|
+
if (t.clientX <= g.left + g.width * J && (p = "left", h = u.posBeforeNode), t.clientX >= g.right - g.width * J && (p = "right", h = u.posBeforeNode), p === "regular" && this.editorView.dragging && this.editorView.dragging.slice) {
|
|
721
|
+
const c = Wt(
|
|
723
722
|
this.editorView.state.doc,
|
|
724
|
-
|
|
723
|
+
h,
|
|
725
724
|
this.editorView.dragging.slice
|
|
726
725
|
);
|
|
727
|
-
|
|
726
|
+
c != null && (h = c);
|
|
728
727
|
}
|
|
729
|
-
this.setCursor({ pos:
|
|
728
|
+
this.setCursor({ pos: h, position: p }), this.scheduleRemoval(5e3);
|
|
730
729
|
}
|
|
731
730
|
}
|
|
732
731
|
dragend() {
|
|
@@ -735,143 +734,771 @@ class ke {
|
|
|
735
734
|
drop() {
|
|
736
735
|
this.setCursor(void 0);
|
|
737
736
|
}
|
|
738
|
-
dragleave(
|
|
739
|
-
(
|
|
737
|
+
dragleave(t) {
|
|
738
|
+
(t.target === this.editorView.dom || !this.editorView.dom.contains(t.relatedTarget)) && this.setCursor(void 0);
|
|
740
739
|
}
|
|
741
740
|
}
|
|
742
|
-
function
|
|
743
|
-
const
|
|
744
|
-
let
|
|
745
|
-
return
|
|
746
|
-
posBeforeNode:
|
|
747
|
-
node:
|
|
741
|
+
function Je(n, t) {
|
|
742
|
+
const r = It(n.doc, t.pos);
|
|
743
|
+
let i = n.doc.resolve(r.posBeforeNode);
|
|
744
|
+
return i.parent.type.name === "column" && (i = n.doc.resolve(i.before())), {
|
|
745
|
+
posBeforeNode: i.pos,
|
|
746
|
+
node: i.nodeAfter
|
|
748
747
|
};
|
|
749
748
|
}
|
|
750
|
-
var
|
|
749
|
+
var ce = { exports: {} }, G = {};
|
|
750
|
+
/**
|
|
751
|
+
* @license React
|
|
752
|
+
* react-jsx-dev-runtime.production.min.js
|
|
753
|
+
*
|
|
754
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
755
|
+
*
|
|
756
|
+
* This source code is licensed under the MIT license found in the
|
|
757
|
+
* LICENSE file in the root directory of this source tree.
|
|
758
|
+
*/
|
|
759
|
+
var Ve;
|
|
760
|
+
function lr() {
|
|
761
|
+
if (Ve) return G;
|
|
762
|
+
Ve = 1;
|
|
763
|
+
var n = Symbol.for("react.fragment");
|
|
764
|
+
return G.Fragment = n, G.jsxDEV = void 0, G;
|
|
765
|
+
}
|
|
766
|
+
var q = {};
|
|
767
|
+
/**
|
|
768
|
+
* @license React
|
|
769
|
+
* react-jsx-dev-runtime.development.js
|
|
770
|
+
*
|
|
771
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
772
|
+
*
|
|
773
|
+
* This source code is licensed under the MIT license found in the
|
|
774
|
+
* LICENSE file in the root directory of this source tree.
|
|
775
|
+
*/
|
|
776
|
+
var ze;
|
|
777
|
+
function ur() {
|
|
778
|
+
return ze || (ze = 1, process.env.NODE_ENV !== "production" && function() {
|
|
779
|
+
var n = I, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), h = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), w = Symbol.iterator, T = "@@iterator";
|
|
780
|
+
function j(e) {
|
|
781
|
+
if (e === null || typeof e != "object")
|
|
782
|
+
return null;
|
|
783
|
+
var o = w && e[w] || e[T];
|
|
784
|
+
return typeof o == "function" ? o : null;
|
|
785
|
+
}
|
|
786
|
+
var M = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
787
|
+
function k(e) {
|
|
788
|
+
{
|
|
789
|
+
for (var o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), a = 1; a < o; a++)
|
|
790
|
+
s[a - 1] = arguments[a];
|
|
791
|
+
x("error", e, s);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
function x(e, o, s) {
|
|
795
|
+
{
|
|
796
|
+
var a = M.ReactDebugCurrentFrame, m = a.getStackAddendum();
|
|
797
|
+
m !== "" && (o += "%s", s = s.concat([m]));
|
|
798
|
+
var v = s.map(function(d) {
|
|
799
|
+
return String(d);
|
|
800
|
+
});
|
|
801
|
+
v.unshift("Warning: " + o), Function.prototype.apply.call(console[e], console, v);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
var W = !1, tt = !1, rt = !1, nt = !1, ot = !1, de;
|
|
805
|
+
de = Symbol.for("react.module.reference");
|
|
806
|
+
function it(e) {
|
|
807
|
+
return !!(typeof e == "string" || typeof e == "function" || e === i || e === b || ot || e === f || e === S || e === g || nt || e === E || W || tt || rt || typeof e == "object" && e !== null && (e.$$typeof === y || e.$$typeof === c || e.$$typeof === p || e.$$typeof === h || e.$$typeof === u || // This needs to include all possible module reference object
|
|
808
|
+
// types supported by any Flight configuration anywhere since
|
|
809
|
+
// we don't know which Flight build this will end up being used
|
|
810
|
+
// with.
|
|
811
|
+
e.$$typeof === de || e.getModuleId !== void 0));
|
|
812
|
+
}
|
|
813
|
+
function st(e, o, s) {
|
|
814
|
+
var a = e.displayName;
|
|
815
|
+
if (a)
|
|
816
|
+
return a;
|
|
817
|
+
var m = o.displayName || o.name || "";
|
|
818
|
+
return m !== "" ? s + "(" + m + ")" : s;
|
|
819
|
+
}
|
|
820
|
+
function fe(e) {
|
|
821
|
+
return e.displayName || "Context";
|
|
822
|
+
}
|
|
823
|
+
function N(e) {
|
|
824
|
+
if (e == null)
|
|
825
|
+
return null;
|
|
826
|
+
if (typeof e.tag == "number" && k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
827
|
+
return e.displayName || e.name || null;
|
|
828
|
+
if (typeof e == "string")
|
|
829
|
+
return e;
|
|
830
|
+
switch (e) {
|
|
831
|
+
case i:
|
|
832
|
+
return "Fragment";
|
|
833
|
+
case r:
|
|
834
|
+
return "Portal";
|
|
835
|
+
case b:
|
|
836
|
+
return "Profiler";
|
|
837
|
+
case f:
|
|
838
|
+
return "StrictMode";
|
|
839
|
+
case S:
|
|
840
|
+
return "Suspense";
|
|
841
|
+
case g:
|
|
842
|
+
return "SuspenseList";
|
|
843
|
+
}
|
|
844
|
+
if (typeof e == "object")
|
|
845
|
+
switch (e.$$typeof) {
|
|
846
|
+
case h:
|
|
847
|
+
var o = e;
|
|
848
|
+
return fe(o) + ".Consumer";
|
|
849
|
+
case p:
|
|
850
|
+
var s = e;
|
|
851
|
+
return fe(s._context) + ".Provider";
|
|
852
|
+
case u:
|
|
853
|
+
return st(e, e.render, "ForwardRef");
|
|
854
|
+
case c:
|
|
855
|
+
var a = e.displayName || null;
|
|
856
|
+
return a !== null ? a : N(e.type) || "Memo";
|
|
857
|
+
case y: {
|
|
858
|
+
var m = e, v = m._payload, d = m._init;
|
|
859
|
+
try {
|
|
860
|
+
return N(d(v));
|
|
861
|
+
} catch {
|
|
862
|
+
return null;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
return null;
|
|
867
|
+
}
|
|
868
|
+
var A = Object.assign, F = 0, he, me, pe, ge, ve, be, ye;
|
|
869
|
+
function we() {
|
|
870
|
+
}
|
|
871
|
+
we.__reactDisabledLog = !0;
|
|
872
|
+
function at() {
|
|
873
|
+
{
|
|
874
|
+
if (F === 0) {
|
|
875
|
+
he = console.log, me = console.info, pe = console.warn, ge = console.error, ve = console.group, be = console.groupCollapsed, ye = console.groupEnd;
|
|
876
|
+
var e = {
|
|
877
|
+
configurable: !0,
|
|
878
|
+
enumerable: !0,
|
|
879
|
+
value: we,
|
|
880
|
+
writable: !0
|
|
881
|
+
};
|
|
882
|
+
Object.defineProperties(console, {
|
|
883
|
+
info: e,
|
|
884
|
+
log: e,
|
|
885
|
+
warn: e,
|
|
886
|
+
error: e,
|
|
887
|
+
group: e,
|
|
888
|
+
groupCollapsed: e,
|
|
889
|
+
groupEnd: e
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
F++;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
function lt() {
|
|
896
|
+
{
|
|
897
|
+
if (F--, F === 0) {
|
|
898
|
+
var e = {
|
|
899
|
+
configurable: !0,
|
|
900
|
+
enumerable: !0,
|
|
901
|
+
writable: !0
|
|
902
|
+
};
|
|
903
|
+
Object.defineProperties(console, {
|
|
904
|
+
log: A({}, e, {
|
|
905
|
+
value: he
|
|
906
|
+
}),
|
|
907
|
+
info: A({}, e, {
|
|
908
|
+
value: me
|
|
909
|
+
}),
|
|
910
|
+
warn: A({}, e, {
|
|
911
|
+
value: pe
|
|
912
|
+
}),
|
|
913
|
+
error: A({}, e, {
|
|
914
|
+
value: ge
|
|
915
|
+
}),
|
|
916
|
+
group: A({}, e, {
|
|
917
|
+
value: ve
|
|
918
|
+
}),
|
|
919
|
+
groupCollapsed: A({}, e, {
|
|
920
|
+
value: be
|
|
921
|
+
}),
|
|
922
|
+
groupEnd: A({}, e, {
|
|
923
|
+
value: ye
|
|
924
|
+
})
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
F < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
var ee = M.ReactCurrentDispatcher, te;
|
|
931
|
+
function Y(e, o, s) {
|
|
932
|
+
{
|
|
933
|
+
if (te === void 0)
|
|
934
|
+
try {
|
|
935
|
+
throw Error();
|
|
936
|
+
} catch (m) {
|
|
937
|
+
var a = m.stack.trim().match(/\n( *(at )?)/);
|
|
938
|
+
te = a && a[1] || "";
|
|
939
|
+
}
|
|
940
|
+
return `
|
|
941
|
+
` + te + e;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
var re = !1, $;
|
|
945
|
+
{
|
|
946
|
+
var ut = typeof WeakMap == "function" ? WeakMap : Map;
|
|
947
|
+
$ = new ut();
|
|
948
|
+
}
|
|
949
|
+
function Ce(e, o) {
|
|
950
|
+
if (!e || re)
|
|
951
|
+
return "";
|
|
952
|
+
{
|
|
953
|
+
var s = $.get(e);
|
|
954
|
+
if (s !== void 0)
|
|
955
|
+
return s;
|
|
956
|
+
}
|
|
957
|
+
var a;
|
|
958
|
+
re = !0;
|
|
959
|
+
var m = Error.prepareStackTrace;
|
|
960
|
+
Error.prepareStackTrace = void 0;
|
|
961
|
+
var v;
|
|
962
|
+
v = ee.current, ee.current = null, at();
|
|
963
|
+
try {
|
|
964
|
+
if (o) {
|
|
965
|
+
var d = function() {
|
|
966
|
+
throw Error();
|
|
967
|
+
};
|
|
968
|
+
if (Object.defineProperty(d.prototype, "props", {
|
|
969
|
+
set: function() {
|
|
970
|
+
throw Error();
|
|
971
|
+
}
|
|
972
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
973
|
+
try {
|
|
974
|
+
Reflect.construct(d, []);
|
|
975
|
+
} catch (O) {
|
|
976
|
+
a = O;
|
|
977
|
+
}
|
|
978
|
+
Reflect.construct(e, [], d);
|
|
979
|
+
} else {
|
|
980
|
+
try {
|
|
981
|
+
d.call();
|
|
982
|
+
} catch (O) {
|
|
983
|
+
a = O;
|
|
984
|
+
}
|
|
985
|
+
e.call(d.prototype);
|
|
986
|
+
}
|
|
987
|
+
} else {
|
|
988
|
+
try {
|
|
989
|
+
throw Error();
|
|
990
|
+
} catch (O) {
|
|
991
|
+
a = O;
|
|
992
|
+
}
|
|
993
|
+
e();
|
|
994
|
+
}
|
|
995
|
+
} catch (O) {
|
|
996
|
+
if (O && a && typeof O.stack == "string") {
|
|
997
|
+
for (var l = O.stack.split(`
|
|
998
|
+
`), P = a.stack.split(`
|
|
999
|
+
`), C = l.length - 1, _ = P.length - 1; C >= 1 && _ >= 0 && l[C] !== P[_]; )
|
|
1000
|
+
_--;
|
|
1001
|
+
for (; C >= 1 && _ >= 0; C--, _--)
|
|
1002
|
+
if (l[C] !== P[_]) {
|
|
1003
|
+
if (C !== 1 || _ !== 1)
|
|
1004
|
+
do
|
|
1005
|
+
if (C--, _--, _ < 0 || l[C] !== P[_]) {
|
|
1006
|
+
var D = `
|
|
1007
|
+
` + l[C].replace(" at new ", " at ");
|
|
1008
|
+
return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" && $.set(e, D), D;
|
|
1009
|
+
}
|
|
1010
|
+
while (C >= 1 && _ >= 0);
|
|
1011
|
+
break;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
} finally {
|
|
1015
|
+
re = !1, ee.current = v, lt(), Error.prepareStackTrace = m;
|
|
1016
|
+
}
|
|
1017
|
+
var z = e ? e.displayName || e.name : "", L = z ? Y(z) : "";
|
|
1018
|
+
return typeof e == "function" && $.set(e, L), L;
|
|
1019
|
+
}
|
|
1020
|
+
function ct(e, o, s) {
|
|
1021
|
+
return Ce(e, !1);
|
|
1022
|
+
}
|
|
1023
|
+
function dt(e) {
|
|
1024
|
+
var o = e.prototype;
|
|
1025
|
+
return !!(o && o.isReactComponent);
|
|
1026
|
+
}
|
|
1027
|
+
function X(e, o, s) {
|
|
1028
|
+
if (e == null)
|
|
1029
|
+
return "";
|
|
1030
|
+
if (typeof e == "function")
|
|
1031
|
+
return Ce(e, dt(e));
|
|
1032
|
+
if (typeof e == "string")
|
|
1033
|
+
return Y(e);
|
|
1034
|
+
switch (e) {
|
|
1035
|
+
case S:
|
|
1036
|
+
return Y("Suspense");
|
|
1037
|
+
case g:
|
|
1038
|
+
return Y("SuspenseList");
|
|
1039
|
+
}
|
|
1040
|
+
if (typeof e == "object")
|
|
1041
|
+
switch (e.$$typeof) {
|
|
1042
|
+
case u:
|
|
1043
|
+
return ct(e.render);
|
|
1044
|
+
case c:
|
|
1045
|
+
return X(e.type, o, s);
|
|
1046
|
+
case y: {
|
|
1047
|
+
var a = e, m = a._payload, v = a._init;
|
|
1048
|
+
try {
|
|
1049
|
+
return X(v(m), o, s);
|
|
1050
|
+
} catch {
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
return "";
|
|
1055
|
+
}
|
|
1056
|
+
var H = Object.prototype.hasOwnProperty, _e = {}, Ee = M.ReactDebugCurrentFrame;
|
|
1057
|
+
function K(e) {
|
|
1058
|
+
if (e) {
|
|
1059
|
+
var o = e._owner, s = X(e.type, e._source, o ? o.type : null);
|
|
1060
|
+
Ee.setExtraStackFrame(s);
|
|
1061
|
+
} else
|
|
1062
|
+
Ee.setExtraStackFrame(null);
|
|
1063
|
+
}
|
|
1064
|
+
function ft(e, o, s, a, m) {
|
|
1065
|
+
{
|
|
1066
|
+
var v = Function.call.bind(H);
|
|
1067
|
+
for (var d in e)
|
|
1068
|
+
if (v(e, d)) {
|
|
1069
|
+
var l = void 0;
|
|
1070
|
+
try {
|
|
1071
|
+
if (typeof e[d] != "function") {
|
|
1072
|
+
var P = Error((a || "React class") + ": " + s + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1073
|
+
throw P.name = "Invariant Violation", P;
|
|
1074
|
+
}
|
|
1075
|
+
l = e[d](o, d, a, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1076
|
+
} catch (C) {
|
|
1077
|
+
l = C;
|
|
1078
|
+
}
|
|
1079
|
+
l && !(l instanceof Error) && (K(m), k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", a || "React class", s, d, typeof l), K(null)), l instanceof Error && !(l.message in _e) && (_e[l.message] = !0, K(m), k("Failed %s type: %s", s, l.message), K(null));
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
var ht = Array.isArray;
|
|
1084
|
+
function ne(e) {
|
|
1085
|
+
return ht(e);
|
|
1086
|
+
}
|
|
1087
|
+
function mt(e) {
|
|
1088
|
+
{
|
|
1089
|
+
var o = typeof Symbol == "function" && Symbol.toStringTag, s = o && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
1090
|
+
return s;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
function pt(e) {
|
|
1094
|
+
try {
|
|
1095
|
+
return ke(e), !1;
|
|
1096
|
+
} catch {
|
|
1097
|
+
return !0;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
function ke(e) {
|
|
1101
|
+
return "" + e;
|
|
1102
|
+
}
|
|
1103
|
+
function Re(e) {
|
|
1104
|
+
if (pt(e))
|
|
1105
|
+
return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", mt(e)), ke(e);
|
|
1106
|
+
}
|
|
1107
|
+
var U = M.ReactCurrentOwner, gt = {
|
|
1108
|
+
key: !0,
|
|
1109
|
+
ref: !0,
|
|
1110
|
+
__self: !0,
|
|
1111
|
+
__source: !0
|
|
1112
|
+
}, Se, Pe, oe;
|
|
1113
|
+
oe = {};
|
|
1114
|
+
function vt(e) {
|
|
1115
|
+
if (H.call(e, "ref")) {
|
|
1116
|
+
var o = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
1117
|
+
if (o && o.isReactWarning)
|
|
1118
|
+
return !1;
|
|
1119
|
+
}
|
|
1120
|
+
return e.ref !== void 0;
|
|
1121
|
+
}
|
|
1122
|
+
function bt(e) {
|
|
1123
|
+
if (H.call(e, "key")) {
|
|
1124
|
+
var o = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
1125
|
+
if (o && o.isReactWarning)
|
|
1126
|
+
return !1;
|
|
1127
|
+
}
|
|
1128
|
+
return e.key !== void 0;
|
|
1129
|
+
}
|
|
1130
|
+
function yt(e, o) {
|
|
1131
|
+
if (typeof e.ref == "string" && U.current && o && U.current.stateNode !== o) {
|
|
1132
|
+
var s = N(U.current.type);
|
|
1133
|
+
oe[s] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', N(U.current.type), e.ref), oe[s] = !0);
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
function wt(e, o) {
|
|
1137
|
+
{
|
|
1138
|
+
var s = function() {
|
|
1139
|
+
Se || (Se = !0, k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
1140
|
+
};
|
|
1141
|
+
s.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
1142
|
+
get: s,
|
|
1143
|
+
configurable: !0
|
|
1144
|
+
});
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
function Ct(e, o) {
|
|
1148
|
+
{
|
|
1149
|
+
var s = function() {
|
|
1150
|
+
Pe || (Pe = !0, k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
1151
|
+
};
|
|
1152
|
+
s.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
1153
|
+
get: s,
|
|
1154
|
+
configurable: !0
|
|
1155
|
+
});
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
var _t = function(e, o, s, a, m, v, d) {
|
|
1159
|
+
var l = {
|
|
1160
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
1161
|
+
$$typeof: t,
|
|
1162
|
+
// Built-in properties that belong on the element
|
|
1163
|
+
type: e,
|
|
1164
|
+
key: o,
|
|
1165
|
+
ref: s,
|
|
1166
|
+
props: d,
|
|
1167
|
+
// Record the component responsible for creating this element.
|
|
1168
|
+
_owner: v
|
|
1169
|
+
};
|
|
1170
|
+
return l._store = {}, Object.defineProperty(l._store, "validated", {
|
|
1171
|
+
configurable: !1,
|
|
1172
|
+
enumerable: !1,
|
|
1173
|
+
writable: !0,
|
|
1174
|
+
value: !1
|
|
1175
|
+
}), Object.defineProperty(l, "_self", {
|
|
1176
|
+
configurable: !1,
|
|
1177
|
+
enumerable: !1,
|
|
1178
|
+
writable: !1,
|
|
1179
|
+
value: a
|
|
1180
|
+
}), Object.defineProperty(l, "_source", {
|
|
1181
|
+
configurable: !1,
|
|
1182
|
+
enumerable: !1,
|
|
1183
|
+
writable: !1,
|
|
1184
|
+
value: m
|
|
1185
|
+
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
1186
|
+
};
|
|
1187
|
+
function Et(e, o, s, a, m) {
|
|
1188
|
+
{
|
|
1189
|
+
var v, d = {}, l = null, P = null;
|
|
1190
|
+
s !== void 0 && (Re(s), l = "" + s), bt(o) && (Re(o.key), l = "" + o.key), vt(o) && (P = o.ref, yt(o, m));
|
|
1191
|
+
for (v in o)
|
|
1192
|
+
H.call(o, v) && !gt.hasOwnProperty(v) && (d[v] = o[v]);
|
|
1193
|
+
if (e && e.defaultProps) {
|
|
1194
|
+
var C = e.defaultProps;
|
|
1195
|
+
for (v in C)
|
|
1196
|
+
d[v] === void 0 && (d[v] = C[v]);
|
|
1197
|
+
}
|
|
1198
|
+
if (l || P) {
|
|
1199
|
+
var _ = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
1200
|
+
l && wt(d, _), P && Ct(d, _);
|
|
1201
|
+
}
|
|
1202
|
+
return _t(e, l, P, m, a, U.current, d);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
var ie = M.ReactCurrentOwner, Te = M.ReactDebugCurrentFrame;
|
|
1206
|
+
function V(e) {
|
|
1207
|
+
if (e) {
|
|
1208
|
+
var o = e._owner, s = X(e.type, e._source, o ? o.type : null);
|
|
1209
|
+
Te.setExtraStackFrame(s);
|
|
1210
|
+
} else
|
|
1211
|
+
Te.setExtraStackFrame(null);
|
|
1212
|
+
}
|
|
1213
|
+
var se;
|
|
1214
|
+
se = !1;
|
|
1215
|
+
function ae(e) {
|
|
1216
|
+
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
1217
|
+
}
|
|
1218
|
+
function Oe() {
|
|
1219
|
+
{
|
|
1220
|
+
if (ie.current) {
|
|
1221
|
+
var e = N(ie.current.type);
|
|
1222
|
+
if (e)
|
|
1223
|
+
return `
|
|
1224
|
+
|
|
1225
|
+
Check the render method of \`` + e + "`.";
|
|
1226
|
+
}
|
|
1227
|
+
return "";
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
function kt(e) {
|
|
1231
|
+
{
|
|
1232
|
+
if (e !== void 0) {
|
|
1233
|
+
var o = e.fileName.replace(/^.*[\\\/]/, ""), s = e.lineNumber;
|
|
1234
|
+
return `
|
|
1235
|
+
|
|
1236
|
+
Check your code at ` + o + ":" + s + ".";
|
|
1237
|
+
}
|
|
1238
|
+
return "";
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
var xe = {};
|
|
1242
|
+
function Rt(e) {
|
|
1243
|
+
{
|
|
1244
|
+
var o = Oe();
|
|
1245
|
+
if (!o) {
|
|
1246
|
+
var s = typeof e == "string" ? e : e.displayName || e.name;
|
|
1247
|
+
s && (o = `
|
|
1248
|
+
|
|
1249
|
+
Check the top-level render call using <` + s + ">.");
|
|
1250
|
+
}
|
|
1251
|
+
return o;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
function De(e, o) {
|
|
1255
|
+
{
|
|
1256
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
1257
|
+
return;
|
|
1258
|
+
e._store.validated = !0;
|
|
1259
|
+
var s = Rt(o);
|
|
1260
|
+
if (xe[s])
|
|
1261
|
+
return;
|
|
1262
|
+
xe[s] = !0;
|
|
1263
|
+
var a = "";
|
|
1264
|
+
e && e._owner && e._owner !== ie.current && (a = " It was passed a child from " + N(e._owner.type) + "."), V(e), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, a), V(null);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
function je(e, o) {
|
|
1268
|
+
{
|
|
1269
|
+
if (typeof e != "object")
|
|
1270
|
+
return;
|
|
1271
|
+
if (ne(e))
|
|
1272
|
+
for (var s = 0; s < e.length; s++) {
|
|
1273
|
+
var a = e[s];
|
|
1274
|
+
ae(a) && De(a, o);
|
|
1275
|
+
}
|
|
1276
|
+
else if (ae(e))
|
|
1277
|
+
e._store && (e._store.validated = !0);
|
|
1278
|
+
else if (e) {
|
|
1279
|
+
var m = j(e);
|
|
1280
|
+
if (typeof m == "function" && m !== e.entries)
|
|
1281
|
+
for (var v = m.call(e), d; !(d = v.next()).done; )
|
|
1282
|
+
ae(d.value) && De(d.value, o);
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
function St(e) {
|
|
1287
|
+
{
|
|
1288
|
+
var o = e.type;
|
|
1289
|
+
if (o == null || typeof o == "string")
|
|
1290
|
+
return;
|
|
1291
|
+
var s;
|
|
1292
|
+
if (typeof o == "function")
|
|
1293
|
+
s = o.propTypes;
|
|
1294
|
+
else if (typeof o == "object" && (o.$$typeof === u || // Note: Memo only checks outer props here.
|
|
1295
|
+
// Inner props are checked in the reconciler.
|
|
1296
|
+
o.$$typeof === c))
|
|
1297
|
+
s = o.propTypes;
|
|
1298
|
+
else
|
|
1299
|
+
return;
|
|
1300
|
+
if (s) {
|
|
1301
|
+
var a = N(o);
|
|
1302
|
+
ft(s, e.props, "prop", a, e);
|
|
1303
|
+
} else if (o.PropTypes !== void 0 && !se) {
|
|
1304
|
+
se = !0;
|
|
1305
|
+
var m = N(o);
|
|
1306
|
+
k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
|
|
1307
|
+
}
|
|
1308
|
+
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
function Pt(e) {
|
|
1312
|
+
{
|
|
1313
|
+
for (var o = Object.keys(e.props), s = 0; s < o.length; s++) {
|
|
1314
|
+
var a = o[s];
|
|
1315
|
+
if (a !== "children" && a !== "key") {
|
|
1316
|
+
V(e), k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), V(null);
|
|
1317
|
+
break;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
e.ref !== null && (V(e), k("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
var Ne = {};
|
|
1324
|
+
function Tt(e, o, s, a, m, v) {
|
|
1325
|
+
{
|
|
1326
|
+
var d = it(e);
|
|
1327
|
+
if (!d) {
|
|
1328
|
+
var l = "";
|
|
1329
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
1330
|
+
var P = kt(m);
|
|
1331
|
+
P ? l += P : l += Oe();
|
|
1332
|
+
var C;
|
|
1333
|
+
e === null ? C = "null" : ne(e) ? C = "array" : e !== void 0 && e.$$typeof === t ? (C = "<" + (N(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : C = typeof e, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", C, l);
|
|
1334
|
+
}
|
|
1335
|
+
var _ = Et(e, o, s, m, v);
|
|
1336
|
+
if (_ == null)
|
|
1337
|
+
return _;
|
|
1338
|
+
if (d) {
|
|
1339
|
+
var D = o.children;
|
|
1340
|
+
if (D !== void 0)
|
|
1341
|
+
if (a)
|
|
1342
|
+
if (ne(D)) {
|
|
1343
|
+
for (var z = 0; z < D.length; z++)
|
|
1344
|
+
je(D[z], e);
|
|
1345
|
+
Object.freeze && Object.freeze(D);
|
|
1346
|
+
} else
|
|
1347
|
+
k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
1348
|
+
else
|
|
1349
|
+
je(D, e);
|
|
1350
|
+
}
|
|
1351
|
+
if (H.call(o, "key")) {
|
|
1352
|
+
var L = N(e), O = Object.keys(o).filter(function(Dt) {
|
|
1353
|
+
return Dt !== "key";
|
|
1354
|
+
}), le = O.length > 0 ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1355
|
+
if (!Ne[L + le]) {
|
|
1356
|
+
var xt = O.length > 0 ? "{" + O.join(": ..., ") + ": ...}" : "{}";
|
|
1357
|
+
k(`A props object containing a "key" prop is being spread into JSX:
|
|
1358
|
+
let props = %s;
|
|
1359
|
+
<%s {...props} />
|
|
1360
|
+
React keys must be passed directly to JSX without using spread:
|
|
1361
|
+
let props = %s;
|
|
1362
|
+
<%s key={someKey} {...props} />`, le, L, xt, L), Ne[L + le] = !0;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
return e === i ? Pt(_) : St(_), _;
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
var Ot = Tt;
|
|
1369
|
+
q.Fragment = i, q.jsxDEV = Ot;
|
|
1370
|
+
}()), q;
|
|
1371
|
+
}
|
|
1372
|
+
process.env.NODE_ENV === "production" ? ce.exports = lr() : ce.exports = ur();
|
|
1373
|
+
var Fe = ce.exports, Ze = {
|
|
751
1374
|
color: void 0,
|
|
752
1375
|
size: void 0,
|
|
753
1376
|
className: void 0,
|
|
754
1377
|
style: void 0,
|
|
755
1378
|
attr: void 0
|
|
756
|
-
},
|
|
757
|
-
function
|
|
758
|
-
if (
|
|
759
|
-
var
|
|
1379
|
+
}, He = I.createContext && /* @__PURE__ */ I.createContext(Ze), cr = ["attr", "size", "title"];
|
|
1380
|
+
function dr(n, t) {
|
|
1381
|
+
if (n == null) return {};
|
|
1382
|
+
var r = fr(n, t), i, f;
|
|
760
1383
|
if (Object.getOwnPropertySymbols) {
|
|
761
|
-
var
|
|
762
|
-
for (
|
|
763
|
-
|
|
1384
|
+
var b = Object.getOwnPropertySymbols(n);
|
|
1385
|
+
for (f = 0; f < b.length; f++)
|
|
1386
|
+
i = b[f], !(t.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(n, i) && (r[i] = n[i]);
|
|
764
1387
|
}
|
|
765
|
-
return
|
|
1388
|
+
return r;
|
|
766
1389
|
}
|
|
767
|
-
function
|
|
768
|
-
if (
|
|
769
|
-
var
|
|
770
|
-
for (var
|
|
771
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
772
|
-
if (
|
|
773
|
-
|
|
774
|
-
}
|
|
775
|
-
return
|
|
1390
|
+
function fr(n, t) {
|
|
1391
|
+
if (n == null) return {};
|
|
1392
|
+
var r = {};
|
|
1393
|
+
for (var i in n)
|
|
1394
|
+
if (Object.prototype.hasOwnProperty.call(n, i)) {
|
|
1395
|
+
if (t.indexOf(i) >= 0) continue;
|
|
1396
|
+
r[i] = n[i];
|
|
1397
|
+
}
|
|
1398
|
+
return r;
|
|
776
1399
|
}
|
|
777
|
-
function
|
|
778
|
-
return
|
|
779
|
-
for (var
|
|
780
|
-
var
|
|
781
|
-
for (var
|
|
782
|
-
Object.prototype.hasOwnProperty.call(
|
|
783
|
-
}
|
|
784
|
-
return
|
|
785
|
-
},
|
|
1400
|
+
function Z() {
|
|
1401
|
+
return Z = Object.assign ? Object.assign.bind() : function(n) {
|
|
1402
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1403
|
+
var r = arguments[t];
|
|
1404
|
+
for (var i in r)
|
|
1405
|
+
Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
|
|
1406
|
+
}
|
|
1407
|
+
return n;
|
|
1408
|
+
}, Z.apply(this, arguments);
|
|
786
1409
|
}
|
|
787
|
-
function
|
|
788
|
-
var
|
|
1410
|
+
function Ue(n, t) {
|
|
1411
|
+
var r = Object.keys(n);
|
|
789
1412
|
if (Object.getOwnPropertySymbols) {
|
|
790
|
-
var
|
|
791
|
-
|
|
792
|
-
return Object.getOwnPropertyDescriptor(
|
|
793
|
-
})),
|
|
1413
|
+
var i = Object.getOwnPropertySymbols(n);
|
|
1414
|
+
t && (i = i.filter(function(f) {
|
|
1415
|
+
return Object.getOwnPropertyDescriptor(n, f).enumerable;
|
|
1416
|
+
})), r.push.apply(r, i);
|
|
794
1417
|
}
|
|
795
|
-
return
|
|
1418
|
+
return r;
|
|
796
1419
|
}
|
|
797
|
-
function
|
|
798
|
-
for (var
|
|
799
|
-
var
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
803
|
-
Object.defineProperty(
|
|
1420
|
+
function Q(n) {
|
|
1421
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1422
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
1423
|
+
t % 2 ? Ue(Object(r), !0).forEach(function(i) {
|
|
1424
|
+
hr(n, i, r[i]);
|
|
1425
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(r)) : Ue(Object(r)).forEach(function(i) {
|
|
1426
|
+
Object.defineProperty(n, i, Object.getOwnPropertyDescriptor(r, i));
|
|
804
1427
|
});
|
|
805
1428
|
}
|
|
806
|
-
return
|
|
1429
|
+
return n;
|
|
807
1430
|
}
|
|
808
|
-
function
|
|
809
|
-
return
|
|
1431
|
+
function hr(n, t, r) {
|
|
1432
|
+
return t = mr(t), t in n ? Object.defineProperty(n, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : n[t] = r, n;
|
|
810
1433
|
}
|
|
811
|
-
function
|
|
812
|
-
var
|
|
813
|
-
return typeof
|
|
1434
|
+
function mr(n) {
|
|
1435
|
+
var t = pr(n, "string");
|
|
1436
|
+
return typeof t == "symbol" ? t : t + "";
|
|
814
1437
|
}
|
|
815
|
-
function
|
|
816
|
-
if (typeof
|
|
817
|
-
var
|
|
818
|
-
if (
|
|
819
|
-
var
|
|
820
|
-
if (typeof
|
|
1438
|
+
function pr(n, t) {
|
|
1439
|
+
if (typeof n != "object" || !n) return n;
|
|
1440
|
+
var r = n[Symbol.toPrimitive];
|
|
1441
|
+
if (r !== void 0) {
|
|
1442
|
+
var i = r.call(n, t || "default");
|
|
1443
|
+
if (typeof i != "object") return i;
|
|
821
1444
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
822
1445
|
}
|
|
823
|
-
return (
|
|
1446
|
+
return (t === "string" ? String : Number)(n);
|
|
824
1447
|
}
|
|
825
|
-
function
|
|
826
|
-
return
|
|
827
|
-
key:
|
|
828
|
-
},
|
|
1448
|
+
function Qe(n) {
|
|
1449
|
+
return n && n.map((t, r) => /* @__PURE__ */ I.createElement(t.tag, Q({
|
|
1450
|
+
key: r
|
|
1451
|
+
}, t.attr), Qe(t.child)));
|
|
829
1452
|
}
|
|
830
|
-
function
|
|
831
|
-
return (
|
|
832
|
-
attr:
|
|
833
|
-
},
|
|
1453
|
+
function et(n) {
|
|
1454
|
+
return (t) => /* @__PURE__ */ I.createElement(gr, Z({
|
|
1455
|
+
attr: Q({}, n.attr)
|
|
1456
|
+
}, t), Qe(n.child));
|
|
834
1457
|
}
|
|
835
|
-
function
|
|
836
|
-
var
|
|
1458
|
+
function gr(n) {
|
|
1459
|
+
var t = (r) => {
|
|
837
1460
|
var {
|
|
838
|
-
attr:
|
|
839
|
-
size:
|
|
840
|
-
title:
|
|
841
|
-
} =
|
|
842
|
-
return
|
|
1461
|
+
attr: i,
|
|
1462
|
+
size: f,
|
|
1463
|
+
title: b
|
|
1464
|
+
} = n, p = dr(n, cr), h = f || r.size || "1em", u;
|
|
1465
|
+
return r.className && (u = r.className), n.className && (u = (u ? u + " " : "") + n.className), /* @__PURE__ */ I.createElement("svg", Z({
|
|
843
1466
|
stroke: "currentColor",
|
|
844
1467
|
fill: "currentColor",
|
|
845
1468
|
strokeWidth: "0"
|
|
846
|
-
},
|
|
847
|
-
className:
|
|
848
|
-
style:
|
|
849
|
-
color:
|
|
850
|
-
},
|
|
851
|
-
height:
|
|
852
|
-
width:
|
|
1469
|
+
}, r.attr, i, p, {
|
|
1470
|
+
className: u,
|
|
1471
|
+
style: Q(Q({
|
|
1472
|
+
color: n.color || r.color
|
|
1473
|
+
}, r.style), n.style),
|
|
1474
|
+
height: h,
|
|
1475
|
+
width: h,
|
|
853
1476
|
xmlns: "http://www.w3.org/2000/svg"
|
|
854
|
-
}),
|
|
1477
|
+
}), b && /* @__PURE__ */ I.createElement("title", null, b), n.children);
|
|
855
1478
|
};
|
|
856
|
-
return
|
|
1479
|
+
return He !== void 0 ? /* @__PURE__ */ I.createElement(He.Consumer, null, (r) => t(r)) : t(Ze);
|
|
857
1480
|
}
|
|
858
|
-
function
|
|
859
|
-
return
|
|
1481
|
+
function vr(n) {
|
|
1482
|
+
return et({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M3 3m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1zm9 -1v18" }, child: [] }] })(n);
|
|
860
1483
|
}
|
|
861
|
-
function
|
|
862
|
-
return
|
|
1484
|
+
function br(n) {
|
|
1485
|
+
return et({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M3 3m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1zm6 -1v18m6 -18v18" }, child: [] }] })(n);
|
|
863
1486
|
}
|
|
864
|
-
function
|
|
865
|
-
return "column" in
|
|
1487
|
+
function yr(n) {
|
|
1488
|
+
return "column" in n.schema.blockSchema && n.schema.blockSchema.columnList === We.blockSchema.columnList && "column" in n.schema.blockSchema && n.schema.blockSchema.column === We.blockSchema.column;
|
|
866
1489
|
}
|
|
867
|
-
function
|
|
868
|
-
const
|
|
869
|
-
return
|
|
1490
|
+
function xr(n) {
|
|
1491
|
+
const t = [];
|
|
1492
|
+
return yr(n) && t.push(
|
|
870
1493
|
{
|
|
871
|
-
...
|
|
872
|
-
icon: /* @__PURE__ */
|
|
1494
|
+
...Le(n).slash_menu.two_columns,
|
|
1495
|
+
icon: /* @__PURE__ */ Fe.jsxDEV(vr, { size: 18 }, void 0, !1, {
|
|
1496
|
+
fileName: "/Users/nickthesick/Developer/BlockNote/packages/xl-multi-column/src/extensions/SuggestionMenu/getMultiColumnSlashMenuItems.tsx",
|
|
1497
|
+
lineNumber: 41,
|
|
1498
|
+
columnNumber: 15
|
|
1499
|
+
}, this),
|
|
873
1500
|
onItemClick: () => {
|
|
874
|
-
|
|
1501
|
+
Be(n, {
|
|
875
1502
|
type: "columnList",
|
|
876
1503
|
children: [
|
|
877
1504
|
{
|
|
@@ -895,10 +1522,14 @@ function Ue(o) {
|
|
|
895
1522
|
}
|
|
896
1523
|
},
|
|
897
1524
|
{
|
|
898
|
-
...
|
|
899
|
-
icon: /* @__PURE__ */
|
|
1525
|
+
...Le(n).slash_menu.three_columns,
|
|
1526
|
+
icon: /* @__PURE__ */ Fe.jsxDEV(br, { size: 18 }, void 0, !1, {
|
|
1527
|
+
fileName: "/Users/nickthesick/Developer/BlockNote/packages/xl-multi-column/src/extensions/SuggestionMenu/getMultiColumnSlashMenuItems.tsx",
|
|
1528
|
+
lineNumber: 68,
|
|
1529
|
+
columnNumber: 15
|
|
1530
|
+
}, this),
|
|
900
1531
|
onItemClick: () => {
|
|
901
|
-
|
|
1532
|
+
Be(n, {
|
|
902
1533
|
type: "columnList",
|
|
903
1534
|
children: [
|
|
904
1535
|
{
|
|
@@ -929,17 +1560,17 @@ function Ue(o) {
|
|
|
929
1560
|
});
|
|
930
1561
|
}
|
|
931
1562
|
}
|
|
932
|
-
),
|
|
1563
|
+
), t;
|
|
933
1564
|
}
|
|
934
1565
|
export {
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
1566
|
+
Ge as ColumnBlock,
|
|
1567
|
+
qe as ColumnListBlock,
|
|
1568
|
+
yr as checkMultiColumnBlocksInSchema,
|
|
1569
|
+
Le as getMultiColumnDictionary,
|
|
1570
|
+
xr as getMultiColumnSlashMenuItems,
|
|
1571
|
+
Pr as locales,
|
|
1572
|
+
Or as multiColumnDropCursor,
|
|
1573
|
+
We as multiColumnSchema,
|
|
1574
|
+
Tr as withMultiColumn
|
|
944
1575
|
};
|
|
945
1576
|
//# sourceMappingURL=blocknote-xl-multi-column.js.map
|