@blocknote/xl-multi-column 0.23.3 → 0.23.5
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,13 +1,14 @@
|
|
|
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
|
-
|
|
1
|
+
var F = Object.defineProperty;
|
|
2
|
+
var Y = (o, e, t) => e in o ? F(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var p = (o, e, t) => Y(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { getNodeById as E, createStronglyTypedTiptapNode as R, createBlockSpecFromStronglyTypedTiptapNode as j, BlockNoteSchema as z, getBlockInfo as Z, nodeToBlock as S, UniqueID as q, getNearestBlockPos as $, insertOrUpdateBlock as O } from "@blocknote/core";
|
|
5
|
+
import { Extension as J } from "@tiptap/core";
|
|
6
|
+
import { PluginKey as Q, Plugin as H } from "prosemirror-state";
|
|
7
|
+
import { DecorationSet as D, Decoration as B } from "prosemirror-view";
|
|
8
|
+
import { dropPoint as ee } from "prosemirror-transform";
|
|
9
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
10
|
+
import v from "react";
|
|
11
|
+
const te = {
|
|
11
12
|
slash_menu: {
|
|
12
13
|
two_columns: {
|
|
13
14
|
title: "عمودان",
|
|
@@ -22,7 +23,7 @@ const Vt = {
|
|
|
22
23
|
group: "الكتل الأساسية"
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
},
|
|
26
|
+
}, oe = {
|
|
26
27
|
slash_menu: {
|
|
27
28
|
two_columns: {
|
|
28
29
|
title: "Zwei Spalten",
|
|
@@ -37,7 +38,7 @@ const Vt = {
|
|
|
37
38
|
group: "Grundlegende blöcke"
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
},
|
|
41
|
+
}, ne = {
|
|
41
42
|
slash_menu: {
|
|
42
43
|
two_columns: {
|
|
43
44
|
title: "Two Columns",
|
|
@@ -52,7 +53,7 @@ const Vt = {
|
|
|
52
53
|
group: "Basic blocks"
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
},
|
|
56
|
+
}, ie = {
|
|
56
57
|
slash_menu: {
|
|
57
58
|
two_columns: {
|
|
58
59
|
title: "Dos Columnas",
|
|
@@ -67,7 +68,7 @@ const Vt = {
|
|
|
67
68
|
group: "Bloques básicos"
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
},
|
|
71
|
+
}, se = {
|
|
71
72
|
slash_menu: {
|
|
72
73
|
two_columns: {
|
|
73
74
|
title: "Deux Colonnes",
|
|
@@ -82,7 +83,7 @@ const Vt = {
|
|
|
82
83
|
group: "Blocs de base"
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
|
-
},
|
|
86
|
+
}, re = {
|
|
86
87
|
slash_menu: {
|
|
87
88
|
two_columns: {
|
|
88
89
|
title: "Dva Stupca",
|
|
@@ -97,7 +98,7 @@ const Vt = {
|
|
|
97
98
|
group: "Osnovni blokovi"
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
|
-
},
|
|
101
|
+
}, le = {
|
|
101
102
|
slash_menu: {
|
|
102
103
|
two_columns: {
|
|
103
104
|
title: "Tvær Dálkar",
|
|
@@ -112,7 +113,7 @@ const Vt = {
|
|
|
112
113
|
group: "Grunnblokkar"
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
},
|
|
116
|
+
}, ce = {
|
|
116
117
|
slash_menu: {
|
|
117
118
|
two_columns: {
|
|
118
119
|
title: "二列",
|
|
@@ -127,7 +128,7 @@ const Vt = {
|
|
|
127
128
|
group: "基本ブロック"
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
|
-
},
|
|
131
|
+
}, ae = {
|
|
131
132
|
slash_menu: {
|
|
132
133
|
two_columns: {
|
|
133
134
|
title: "두 열",
|
|
@@ -142,7 +143,7 @@ const Vt = {
|
|
|
142
143
|
group: "기본 블록"
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
|
-
},
|
|
146
|
+
}, ue = {
|
|
146
147
|
slash_menu: {
|
|
147
148
|
two_columns: {
|
|
148
149
|
title: "Twee Kolommen",
|
|
@@ -157,7 +158,7 @@ const Vt = {
|
|
|
157
158
|
group: "Basisblokken"
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
|
-
},
|
|
161
|
+
}, de = {
|
|
161
162
|
slash_menu: {
|
|
162
163
|
two_columns: {
|
|
163
164
|
title: "Dwie Kolumny",
|
|
@@ -172,7 +173,7 @@ const Vt = {
|
|
|
172
173
|
group: "Podstawowe bloki"
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
|
-
},
|
|
176
|
+
}, he = {
|
|
176
177
|
slash_menu: {
|
|
177
178
|
two_columns: {
|
|
178
179
|
title: "Duas Colunas",
|
|
@@ -187,7 +188,7 @@ const Vt = {
|
|
|
187
188
|
group: "Blocos básicos"
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
|
-
},
|
|
191
|
+
}, me = {
|
|
191
192
|
slash_menu: {
|
|
192
193
|
two_columns: {
|
|
193
194
|
title: "Два Столбца",
|
|
@@ -202,7 +203,7 @@ const Vt = {
|
|
|
202
203
|
group: "Базовые блоки"
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
|
-
},
|
|
206
|
+
}, pe = {
|
|
206
207
|
slash_menu: {
|
|
207
208
|
two_columns: {
|
|
208
209
|
title: "Hai Cột",
|
|
@@ -217,7 +218,7 @@ const Vt = {
|
|
|
217
218
|
group: "Khối cơ bản"
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
|
-
},
|
|
221
|
+
}, fe = {
|
|
221
222
|
slash_menu: {
|
|
222
223
|
two_columns: {
|
|
223
224
|
title: "两列",
|
|
@@ -232,164 +233,164 @@ const Vt = {
|
|
|
232
233
|
group: "基础"
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
|
-
},
|
|
236
|
+
}, Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
236
237
|
__proto__: null,
|
|
237
|
-
ar:
|
|
238
|
-
de:
|
|
239
|
-
en:
|
|
240
|
-
es:
|
|
241
|
-
fr:
|
|
242
|
-
hr:
|
|
243
|
-
is:
|
|
244
|
-
ja:
|
|
245
|
-
ko:
|
|
246
|
-
nl:
|
|
247
|
-
pl:
|
|
248
|
-
pt:
|
|
249
|
-
ru:
|
|
250
|
-
vi:
|
|
251
|
-
zh:
|
|
238
|
+
ar: te,
|
|
239
|
+
de: oe,
|
|
240
|
+
en: ne,
|
|
241
|
+
es: ie,
|
|
242
|
+
fr: se,
|
|
243
|
+
hr: re,
|
|
244
|
+
is: le,
|
|
245
|
+
ja: ce,
|
|
246
|
+
ko: ae,
|
|
247
|
+
nl: ue,
|
|
248
|
+
pl: de,
|
|
249
|
+
pt: he,
|
|
250
|
+
ru: me,
|
|
251
|
+
vi: pe,
|
|
252
|
+
zh: fe
|
|
252
253
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
253
|
-
function
|
|
254
|
-
if (!
|
|
254
|
+
function N(o) {
|
|
255
|
+
if (!o.dictionary.multi_column)
|
|
255
256
|
throw new Error("Multi-column dictionary not found");
|
|
256
|
-
return
|
|
257
|
+
return o.dictionary.multi_column;
|
|
257
258
|
}
|
|
258
|
-
const
|
|
259
|
-
class
|
|
260
|
-
constructor(
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
259
|
+
const C = new Q("ColumnResizePlugin");
|
|
260
|
+
class ge {
|
|
261
|
+
constructor(e, t) {
|
|
262
|
+
p(this, "editor");
|
|
263
|
+
p(this, "view");
|
|
264
|
+
p(this, "RESIZE_MARGIN_WIDTH_PX", 20);
|
|
265
|
+
p(this, "COLUMN_MIN_WIDTH_PERCENT", 0.5);
|
|
266
|
+
p(this, "getColumnHoverOrDefaultState", (e) => {
|
|
266
267
|
if (!this.editor.isEditable)
|
|
267
268
|
return { type: "default" };
|
|
268
|
-
const
|
|
269
|
-
if (!this.view.dom.contains(
|
|
269
|
+
const t = e.target;
|
|
270
|
+
if (!this.view.dom.contains(t))
|
|
270
271
|
return { type: "default" };
|
|
271
|
-
const
|
|
272
|
+
const n = t.closest(
|
|
272
273
|
".bn-block-column"
|
|
273
274
|
);
|
|
274
|
-
if (!
|
|
275
|
+
if (!n)
|
|
275
276
|
return { type: "default" };
|
|
276
|
-
const
|
|
277
|
-
if (!
|
|
277
|
+
const r = e.clientX, u = n.getBoundingClientRect(), c = r < u.left + this.RESIZE_MARGIN_WIDTH_PX ? "left" : r > u.right - this.RESIZE_MARGIN_WIDTH_PX ? "right" : "none", l = c === "left" ? n.previousElementSibling : c === "right" ? n.nextElementSibling : void 0;
|
|
278
|
+
if (!l)
|
|
278
279
|
return { type: "default" };
|
|
279
|
-
const
|
|
280
|
-
|
|
280
|
+
const i = c === "left" ? l : n, g = c === "left" ? n : l, a = i.getAttribute("data-id"), s = g.getAttribute("data-id"), d = E(a, this.view.state.doc), m = E(
|
|
281
|
+
s,
|
|
281
282
|
this.view.state.doc
|
|
282
283
|
);
|
|
283
|
-
if (!
|
|
284
|
+
if (!d || !m || !d.posBeforeNode)
|
|
284
285
|
throw new Error("Column not found");
|
|
285
286
|
return {
|
|
286
287
|
type: "hover",
|
|
287
288
|
leftColumn: {
|
|
288
|
-
element:
|
|
289
|
-
id:
|
|
290
|
-
...
|
|
289
|
+
element: i,
|
|
290
|
+
id: a,
|
|
291
|
+
...d
|
|
291
292
|
},
|
|
292
293
|
rightColumn: {
|
|
293
|
-
element:
|
|
294
|
-
id:
|
|
295
|
-
...
|
|
294
|
+
element: g,
|
|
295
|
+
id: s,
|
|
296
|
+
...m
|
|
296
297
|
}
|
|
297
298
|
};
|
|
298
299
|
});
|
|
299
300
|
// When the user mouses down near the boundary between two columns, we
|
|
300
301
|
// want to set the plugin state to resize, so the columns can be resized
|
|
301
302
|
// by moving the mouse.
|
|
302
|
-
|
|
303
|
-
let
|
|
304
|
-
if (
|
|
303
|
+
p(this, "mouseDownHandler", (e) => {
|
|
304
|
+
let t = this.getColumnHoverOrDefaultState(e);
|
|
305
|
+
if (t.type === "default")
|
|
305
306
|
return;
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
|
|
307
|
+
e.preventDefault();
|
|
308
|
+
const n = e.clientX, r = t.leftColumn.element.getBoundingClientRect().width, u = t.rightColumn.element.getBoundingClientRect().width, c = t.leftColumn.node.attrs.width, l = t.rightColumn.node.attrs.width;
|
|
309
|
+
t = {
|
|
309
310
|
type: "resize",
|
|
310
|
-
startPos:
|
|
311
|
+
startPos: n,
|
|
311
312
|
leftColumn: {
|
|
312
|
-
...
|
|
313
|
-
widthPx:
|
|
314
|
-
widthPercent:
|
|
313
|
+
...t.leftColumn,
|
|
314
|
+
widthPx: r,
|
|
315
|
+
widthPercent: c
|
|
315
316
|
},
|
|
316
317
|
rightColumn: {
|
|
317
|
-
...
|
|
318
|
-
widthPx:
|
|
319
|
-
widthPercent:
|
|
318
|
+
...t.rightColumn,
|
|
319
|
+
widthPx: u,
|
|
320
|
+
widthPercent: l
|
|
320
321
|
}
|
|
321
322
|
}, this.view.dispatch(
|
|
322
|
-
this.view.state.tr.setMeta(
|
|
323
|
+
this.view.state.tr.setMeta(C, t)
|
|
323
324
|
), this.editor.sideMenu.freezeMenu();
|
|
324
325
|
});
|
|
325
326
|
// If the plugin isn't in a resize state, we want to update it to either a
|
|
326
327
|
// hover state if the mouse is near the boundary between two columns, or
|
|
327
328
|
// default otherwise. If the plugin is in a resize state, we want to
|
|
328
329
|
// update the column widths based on the horizontal mouse movement.
|
|
329
|
-
|
|
330
|
-
var
|
|
331
|
-
const
|
|
332
|
-
if (!
|
|
330
|
+
p(this, "mouseMoveHandler", (e) => {
|
|
331
|
+
var i, g;
|
|
332
|
+
const t = C.getState(this.view.state);
|
|
333
|
+
if (!t)
|
|
333
334
|
return;
|
|
334
|
-
if (
|
|
335
|
-
const
|
|
336
|
-
if (
|
|
335
|
+
if (t.type !== "resize") {
|
|
336
|
+
const a = this.getColumnHoverOrDefaultState(e), s = t.type === "default" && a.type === "default", d = t.type !== "default" && a.type !== "default" && t.leftColumn.id === a.leftColumn.id && t.rightColumn.id === a.rightColumn.id;
|
|
337
|
+
if (s || d || a.type === "hover" && ((g = (i = this.editor.sideMenu.view) == null ? void 0 : i.state) != null && g.show))
|
|
337
338
|
return;
|
|
338
339
|
this.view.dispatch(
|
|
339
|
-
this.view.state.tr.setMeta(
|
|
340
|
+
this.view.state.tr.setMeta(C, a)
|
|
340
341
|
);
|
|
341
342
|
return;
|
|
342
343
|
}
|
|
343
|
-
const
|
|
344
|
-
let
|
|
345
|
-
|
|
344
|
+
const r = (e.clientX - t.startPos) * t.leftColumn.widthPercent, u = (t.leftColumn.widthPx + r) / t.leftColumn.widthPx - 1;
|
|
345
|
+
let c = t.leftColumn.widthPercent + u, l = t.rightColumn.widthPercent - u;
|
|
346
|
+
c < this.COLUMN_MIN_WIDTH_PERCENT ? (l -= this.COLUMN_MIN_WIDTH_PERCENT - c, c = this.COLUMN_MIN_WIDTH_PERCENT) : l < this.COLUMN_MIN_WIDTH_PERCENT && (c -= this.COLUMN_MIN_WIDTH_PERCENT - l, l = this.COLUMN_MIN_WIDTH_PERCENT), this.view.dispatch(
|
|
346
347
|
this.view.state.tr.setNodeAttribute(
|
|
347
|
-
|
|
348
|
+
t.leftColumn.posBeforeNode,
|
|
348
349
|
"width",
|
|
349
|
-
|
|
350
|
+
c
|
|
350
351
|
).setNodeAttribute(
|
|
351
|
-
|
|
352
|
+
t.rightColumn.posBeforeNode,
|
|
352
353
|
"width",
|
|
353
|
-
|
|
354
|
+
l
|
|
354
355
|
).setMeta("addToHistory", !1)
|
|
355
356
|
);
|
|
356
357
|
});
|
|
357
358
|
// If the plugin is in a resize state, we want to revert it to a default
|
|
358
359
|
// or hover, depending on where the mouse cursor is, when the user
|
|
359
360
|
// releases the mouse button.
|
|
360
|
-
|
|
361
|
-
const
|
|
362
|
-
if (!
|
|
361
|
+
p(this, "mouseUpHandler", (e) => {
|
|
362
|
+
const t = C.getState(this.view.state);
|
|
363
|
+
if (!t || t.type !== "resize")
|
|
363
364
|
return;
|
|
364
|
-
const
|
|
365
|
+
const n = this.getColumnHoverOrDefaultState(e);
|
|
365
366
|
this.view.dispatch(
|
|
366
|
-
this.view.state.tr.setMeta(
|
|
367
|
+
this.view.state.tr.setMeta(C, n)
|
|
367
368
|
), this.editor.sideMenu.unfreezeMenu();
|
|
368
369
|
});
|
|
369
|
-
this.editor =
|
|
370
|
+
this.editor = e, this.view = t, this.view.dom.addEventListener("mousedown", this.mouseDownHandler), document.body.addEventListener("mousemove", this.mouseMoveHandler), document.body.addEventListener("mouseup", this.mouseUpHandler);
|
|
370
371
|
}
|
|
371
372
|
destroy() {
|
|
372
373
|
this.view.dom.removeEventListener("mousedown", this.mouseDownHandler), document.body.removeEventListener("mousemove", this.mouseMoveHandler), document.body.removeEventListener("mouseup", this.mouseUpHandler);
|
|
373
374
|
}
|
|
374
375
|
}
|
|
375
|
-
const
|
|
376
|
-
key:
|
|
376
|
+
const be = (o) => new H({
|
|
377
|
+
key: C,
|
|
377
378
|
props: {
|
|
378
379
|
// This adds a border between the columns when the user is
|
|
379
380
|
// resizing them or when the cursor is near their boundary.
|
|
380
|
-
decorations: (
|
|
381
|
-
const
|
|
382
|
-
return !
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
381
|
+
decorations: (e) => {
|
|
382
|
+
const t = C.getState(e);
|
|
383
|
+
return !t || t.type === "default" ? D.empty : D.create(e.doc, [
|
|
384
|
+
B.node(
|
|
385
|
+
t.leftColumn.posBeforeNode,
|
|
386
|
+
t.leftColumn.posBeforeNode + t.leftColumn.node.nodeSize,
|
|
386
387
|
{
|
|
387
388
|
style: "box-shadow: 4px 0 0 #ccc; cursor: col-resize"
|
|
388
389
|
}
|
|
389
390
|
),
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
391
|
+
B.node(
|
|
392
|
+
t.rightColumn.posBeforeNode,
|
|
393
|
+
t.rightColumn.posBeforeNode + t.rightColumn.node.nodeSize,
|
|
393
394
|
{
|
|
394
395
|
style: "cursor: col-resize"
|
|
395
396
|
}
|
|
@@ -399,18 +400,18 @@ const rr = (n) => new Ke({
|
|
|
399
400
|
},
|
|
400
401
|
state: {
|
|
401
402
|
init: () => ({ type: "default" }),
|
|
402
|
-
apply: (
|
|
403
|
-
const
|
|
404
|
-
return
|
|
403
|
+
apply: (e, t) => {
|
|
404
|
+
const n = e.getMeta(C);
|
|
405
|
+
return n === void 0 ? t : n;
|
|
405
406
|
}
|
|
406
407
|
},
|
|
407
|
-
view: (
|
|
408
|
-
}),
|
|
408
|
+
view: (e) => new ge(o, e)
|
|
409
|
+
}), we = (o) => J.create({
|
|
409
410
|
name: "columnResize",
|
|
410
411
|
addProseMirrorPlugins() {
|
|
411
|
-
return [
|
|
412
|
+
return [be(o)];
|
|
412
413
|
}
|
|
413
|
-
}),
|
|
414
|
+
}), Ce = R({
|
|
414
415
|
name: "column",
|
|
415
416
|
group: "bnBlock childContainer",
|
|
416
417
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -433,16 +434,16 @@ const rr = (n) => new Ke({
|
|
|
433
434
|
// value, which handles all the resizing for us, instead of manually
|
|
434
435
|
// having to set the `width` property of each column.
|
|
435
436
|
default: 1,
|
|
436
|
-
parseHTML: (
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
437
|
+
parseHTML: (o) => {
|
|
438
|
+
const e = o.getAttribute("data-width");
|
|
439
|
+
if (e === null)
|
|
439
440
|
return null;
|
|
440
|
-
const
|
|
441
|
-
return isFinite(
|
|
441
|
+
const t = parseFloat(e);
|
|
442
|
+
return isFinite(t) ? t : null;
|
|
442
443
|
},
|
|
443
|
-
renderHTML: (
|
|
444
|
-
"data-width":
|
|
445
|
-
style: `flex-grow: ${
|
|
444
|
+
renderHTML: (o) => ({
|
|
445
|
+
"data-width": o.width.toString(),
|
|
446
|
+
style: `flex-grow: ${o.width};`
|
|
446
447
|
})
|
|
447
448
|
}
|
|
448
449
|
};
|
|
@@ -451,24 +452,24 @@ const rr = (n) => new Ke({
|
|
|
451
452
|
return [
|
|
452
453
|
{
|
|
453
454
|
tag: "div",
|
|
454
|
-
getAttrs: (
|
|
455
|
+
getAttrs: (o) => typeof o == "string" ? !1 : o.getAttribute("data-node-type") === this.name ? {} : !1
|
|
455
456
|
}
|
|
456
457
|
];
|
|
457
458
|
},
|
|
458
|
-
renderHTML({ HTMLAttributes:
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
for (const [
|
|
462
|
-
|
|
459
|
+
renderHTML({ HTMLAttributes: o }) {
|
|
460
|
+
const e = document.createElement("div");
|
|
461
|
+
e.className = "bn-block-column", e.setAttribute("data-node-type", this.name);
|
|
462
|
+
for (const [t, n] of Object.entries(o))
|
|
463
|
+
e.setAttribute(t, n);
|
|
463
464
|
return {
|
|
464
|
-
dom:
|
|
465
|
-
contentDOM:
|
|
465
|
+
dom: e,
|
|
466
|
+
contentDOM: e
|
|
466
467
|
};
|
|
467
468
|
},
|
|
468
469
|
addExtensions() {
|
|
469
|
-
return [
|
|
470
|
+
return [we(this.options.editor)];
|
|
470
471
|
}
|
|
471
|
-
}),
|
|
472
|
+
}), ve = R({
|
|
472
473
|
name: "columnList",
|
|
473
474
|
group: "childContainer bnBlock blockGroupChild",
|
|
474
475
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -481,116 +482,116 @@ const rr = (n) => new Ke({
|
|
|
481
482
|
return [
|
|
482
483
|
{
|
|
483
484
|
tag: "div",
|
|
484
|
-
getAttrs: (
|
|
485
|
+
getAttrs: (o) => typeof o == "string" ? !1 : o.getAttribute("data-node-type") === this.name ? {} : !1
|
|
485
486
|
}
|
|
486
487
|
];
|
|
487
488
|
},
|
|
488
|
-
renderHTML({ HTMLAttributes:
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
for (const [
|
|
492
|
-
|
|
493
|
-
return
|
|
494
|
-
dom:
|
|
495
|
-
contentDOM:
|
|
489
|
+
renderHTML({ HTMLAttributes: o }) {
|
|
490
|
+
const e = document.createElement("div");
|
|
491
|
+
e.className = "bn-block-column-list", e.setAttribute("data-node-type", this.name);
|
|
492
|
+
for (const [t, n] of Object.entries(o))
|
|
493
|
+
e.setAttribute(t, n);
|
|
494
|
+
return e.style.display = "flex", {
|
|
495
|
+
dom: e,
|
|
496
|
+
contentDOM: e
|
|
496
497
|
};
|
|
497
498
|
}
|
|
498
|
-
}),
|
|
499
|
+
}), W = j(Ce, {
|
|
499
500
|
width: {
|
|
500
501
|
default: 1
|
|
501
502
|
}
|
|
502
|
-
}),
|
|
503
|
-
|
|
503
|
+
}), A = j(
|
|
504
|
+
ve,
|
|
504
505
|
{}
|
|
505
|
-
),
|
|
506
|
+
), M = z.create({
|
|
506
507
|
blockSpecs: {
|
|
507
|
-
column:
|
|
508
|
-
columnList:
|
|
508
|
+
column: W,
|
|
509
|
+
columnList: A
|
|
509
510
|
}
|
|
510
|
-
}),
|
|
511
|
+
}), Ve = (o) => z.create({
|
|
511
512
|
blockSpecs: {
|
|
512
|
-
...
|
|
513
|
-
column:
|
|
514
|
-
columnList:
|
|
513
|
+
...o.blockSpecs,
|
|
514
|
+
column: W,
|
|
515
|
+
columnList: A
|
|
515
516
|
},
|
|
516
|
-
inlineContentSpecs:
|
|
517
|
-
styleSpecs:
|
|
518
|
-
}),
|
|
519
|
-
function
|
|
520
|
-
return { left:
|
|
517
|
+
inlineContentSpecs: o.inlineContentSpecs,
|
|
518
|
+
styleSpecs: o.styleSpecs
|
|
519
|
+
}), k = 0.1;
|
|
520
|
+
function ye(o) {
|
|
521
|
+
return { left: o.clientX, top: o.clientY };
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
-
const
|
|
524
|
-
return new
|
|
525
|
-
view(
|
|
526
|
-
return new
|
|
523
|
+
function Xe(o) {
|
|
524
|
+
const e = o.editor;
|
|
525
|
+
return new H({
|
|
526
|
+
view(t) {
|
|
527
|
+
return new ke(t, o);
|
|
527
528
|
},
|
|
528
529
|
props: {
|
|
529
|
-
handleDrop(
|
|
530
|
-
const
|
|
531
|
-
if (!
|
|
530
|
+
handleDrop(t, n, r, u) {
|
|
531
|
+
const c = t.posAtCoords(ye(n));
|
|
532
|
+
if (!c)
|
|
532
533
|
throw new Error("Could not get event position");
|
|
533
|
-
const
|
|
534
|
-
let
|
|
535
|
-
if (
|
|
534
|
+
const l = V(t.state, c), i = Z(l), a = t.nodeDOM(l.posBeforeNode).getBoundingClientRect();
|
|
535
|
+
let s = "regular";
|
|
536
|
+
if (n.clientX <= a.left + a.width * k && (s = "left"), n.clientX >= a.right - a.width * k && (s = "right"), s === "regular")
|
|
536
537
|
return !1;
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
538
|
+
const d = S(
|
|
539
|
+
r.content.child(0),
|
|
540
|
+
e.schema.blockSchema,
|
|
541
|
+
e.schema.inlineContentSchema,
|
|
542
|
+
e.schema.styleSchema
|
|
542
543
|
// TODO: cache?
|
|
543
544
|
);
|
|
544
|
-
if (
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
545
|
+
if (i.blockNoteType === "column") {
|
|
546
|
+
const m = t.state.doc.resolve(i.bnBlock.beforePos).node(), h = S(
|
|
547
|
+
m,
|
|
548
|
+
e.schema.blockSchema,
|
|
549
|
+
e.schema.inlineContentSchema,
|
|
550
|
+
e.schema.styleSchema
|
|
550
551
|
);
|
|
551
|
-
let
|
|
552
|
-
|
|
553
|
-
|
|
552
|
+
let f = 0;
|
|
553
|
+
h.children.forEach((b) => {
|
|
554
|
+
f += b.props.width;
|
|
554
555
|
});
|
|
555
|
-
const
|
|
556
|
-
if (
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
|
|
556
|
+
const w = f / h.children.length;
|
|
557
|
+
if (w < 0.99 || w > 1.01) {
|
|
558
|
+
const b = 1 / w;
|
|
559
|
+
h.children.forEach((y) => {
|
|
560
|
+
y.props.width = y.props.width * b;
|
|
560
561
|
});
|
|
561
562
|
}
|
|
562
|
-
const
|
|
563
|
-
(
|
|
564
|
-
),
|
|
565
|
-
...
|
|
566
|
-
children:
|
|
567
|
-
(
|
|
563
|
+
const x = h.children.findIndex(
|
|
564
|
+
(b) => b.id === i.bnBlock.node.attrs.id
|
|
565
|
+
), K = h.children.map((b) => ({
|
|
566
|
+
...b,
|
|
567
|
+
children: b.children.filter(
|
|
568
|
+
(y) => y.id !== d.id
|
|
568
569
|
)
|
|
569
|
-
})).filter((
|
|
570
|
+
})).filter((b) => b.children.length > 0).toSpliced(s === "left" ? x : x + 1, 0, {
|
|
570
571
|
type: "column",
|
|
571
|
-
children: [
|
|
572
|
+
children: [d],
|
|
572
573
|
props: {},
|
|
573
574
|
content: void 0,
|
|
574
|
-
id:
|
|
575
|
+
id: q.options.generateID()
|
|
575
576
|
});
|
|
576
|
-
|
|
577
|
-
children:
|
|
577
|
+
e.removeBlocks([d]), e.updateBlock(h, {
|
|
578
|
+
children: K
|
|
578
579
|
});
|
|
579
580
|
} else {
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
),
|
|
586
|
-
|
|
587
|
-
[
|
|
581
|
+
const m = S(
|
|
582
|
+
i.bnBlock.node,
|
|
583
|
+
e.schema.blockSchema,
|
|
584
|
+
e.schema.inlineContentSchema,
|
|
585
|
+
e.schema.styleSchema
|
|
586
|
+
), h = s === "left" ? [d, m] : [m, d];
|
|
587
|
+
e.removeBlocks([d]), e.replaceBlocks(
|
|
588
|
+
[m],
|
|
588
589
|
[
|
|
589
590
|
{
|
|
590
591
|
type: "columnList",
|
|
591
|
-
children:
|
|
592
|
+
children: h.map((f) => ({
|
|
592
593
|
type: "column",
|
|
593
|
-
children: [
|
|
594
|
+
children: [f]
|
|
594
595
|
}))
|
|
595
596
|
}
|
|
596
597
|
]
|
|
@@ -601,131 +602,131 @@ function Or(n) {
|
|
|
601
602
|
}
|
|
602
603
|
});
|
|
603
604
|
}
|
|
604
|
-
class
|
|
605
|
-
constructor(
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
this.editorView =
|
|
614
|
-
const
|
|
615
|
-
this[
|
|
605
|
+
class ke {
|
|
606
|
+
constructor(e, t) {
|
|
607
|
+
p(this, "width");
|
|
608
|
+
p(this, "color");
|
|
609
|
+
p(this, "class");
|
|
610
|
+
p(this, "cursorPos");
|
|
611
|
+
p(this, "element", null);
|
|
612
|
+
p(this, "timeout");
|
|
613
|
+
p(this, "handlers");
|
|
614
|
+
this.editorView = e, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((n) => {
|
|
615
|
+
const r = (u) => {
|
|
616
|
+
this[n](u);
|
|
616
617
|
};
|
|
617
|
-
return
|
|
618
|
-
|
|
619
|
-
|
|
618
|
+
return e.dom.addEventListener(
|
|
619
|
+
n,
|
|
620
|
+
r,
|
|
620
621
|
// drop event captured in bubbling phase to make sure
|
|
621
622
|
// "cursorPos" is set to undefined before the "handleDrop" handler is called
|
|
622
623
|
// (otherwise an error could be thrown, see https://github.com/TypeCellOS/BlockNote/pull/1240)
|
|
623
|
-
|
|
624
|
-
), { name:
|
|
624
|
+
n === "drop" ? !0 : void 0
|
|
625
|
+
), { name: n, handler: r };
|
|
625
626
|
});
|
|
626
627
|
}
|
|
627
628
|
destroy() {
|
|
628
629
|
this.handlers.forEach(
|
|
629
|
-
({ name:
|
|
630
|
+
({ name: e, handler: t }) => this.editorView.dom.removeEventListener(
|
|
631
|
+
e,
|
|
630
632
|
t,
|
|
631
|
-
|
|
632
|
-
t === "drop" ? !0 : void 0
|
|
633
|
+
e === "drop" ? !0 : void 0
|
|
633
634
|
)
|
|
634
635
|
);
|
|
635
636
|
}
|
|
636
|
-
update(
|
|
637
|
-
this.cursorPos != null &&
|
|
637
|
+
update(e, t) {
|
|
638
|
+
this.cursorPos != null && t.doc !== e.state.doc && (this.cursorPos.pos > e.state.doc.content.size ? this.setCursor(void 0) : this.updateOverlay());
|
|
638
639
|
}
|
|
639
|
-
setCursor(
|
|
640
|
-
var
|
|
641
|
-
|
|
640
|
+
setCursor(e) {
|
|
641
|
+
var t, n;
|
|
642
|
+
e === this.cursorPos || (e == null ? void 0 : e.pos) === ((t = this.cursorPos) == null ? void 0 : t.pos) && (e == null ? void 0 : e.position) === ((n = this.cursorPos) == null ? void 0 : n.position) || (this.cursorPos = e, e ? this.updateOverlay() : (this.element.parentNode.removeChild(this.element), this.element = null));
|
|
642
643
|
}
|
|
643
644
|
updateOverlay() {
|
|
644
645
|
if (!this.cursorPos)
|
|
645
646
|
throw new Error("updateOverlay called with no cursor position");
|
|
646
|
-
const
|
|
647
|
-
let
|
|
648
|
-
const
|
|
649
|
-
if (
|
|
650
|
-
const
|
|
651
|
-
if (
|
|
647
|
+
const e = this.editorView.state.doc.resolve(this.cursorPos.pos), t = !e.parent.inlineContent;
|
|
648
|
+
let n;
|
|
649
|
+
const r = this.editorView.dom, u = r.getBoundingClientRect(), c = u.width / r.offsetWidth, l = u.height / r.offsetHeight;
|
|
650
|
+
if (t) {
|
|
651
|
+
const s = e.nodeBefore, d = e.nodeAfter;
|
|
652
|
+
if (s || d)
|
|
652
653
|
if (this.cursorPos.position === "left" || this.cursorPos.position === "right") {
|
|
653
|
-
const
|
|
654
|
-
if (!
|
|
654
|
+
const m = this.editorView.nodeDOM(this.cursorPos.pos);
|
|
655
|
+
if (!m)
|
|
655
656
|
throw new Error("nodeDOM returned null in updateOverlay");
|
|
656
|
-
const
|
|
657
|
-
|
|
658
|
-
left:
|
|
659
|
-
right:
|
|
660
|
-
top:
|
|
661
|
-
bottom:
|
|
657
|
+
const h = m.getBoundingClientRect(), f = this.width / 2 * l, w = this.cursorPos.position === "left" ? h.left : h.right;
|
|
658
|
+
n = {
|
|
659
|
+
left: w - f,
|
|
660
|
+
right: w + f,
|
|
661
|
+
top: h.top,
|
|
662
|
+
bottom: h.bottom
|
|
662
663
|
// left: blockRect.left,
|
|
663
664
|
// right: blockRect.right,
|
|
664
665
|
};
|
|
665
666
|
} else {
|
|
666
|
-
const
|
|
667
|
-
this.cursorPos.pos - (
|
|
667
|
+
const m = this.editorView.nodeDOM(
|
|
668
|
+
this.cursorPos.pos - (s ? s.nodeSize : 0)
|
|
668
669
|
);
|
|
669
|
-
if (
|
|
670
|
-
const
|
|
671
|
-
let
|
|
672
|
-
|
|
673
|
-
const
|
|
674
|
-
this.cursorPos.position === "regular" && (
|
|
675
|
-
left:
|
|
676
|
-
right:
|
|
677
|
-
top:
|
|
678
|
-
bottom:
|
|
670
|
+
if (m) {
|
|
671
|
+
const h = m.getBoundingClientRect();
|
|
672
|
+
let f = s ? h.bottom : h.top;
|
|
673
|
+
s && d && (f = (f + this.editorView.nodeDOM(this.cursorPos.pos).getBoundingClientRect().top) / 2);
|
|
674
|
+
const w = this.width / 2 * l;
|
|
675
|
+
this.cursorPos.position === "regular" && (n = {
|
|
676
|
+
left: h.left,
|
|
677
|
+
right: h.right,
|
|
678
|
+
top: f - w,
|
|
679
|
+
bottom: f + w
|
|
679
680
|
});
|
|
680
681
|
}
|
|
681
682
|
}
|
|
682
683
|
}
|
|
683
|
-
if (!
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
left:
|
|
687
|
-
right:
|
|
688
|
-
top:
|
|
689
|
-
bottom:
|
|
684
|
+
if (!n) {
|
|
685
|
+
const s = this.editorView.coordsAtPos(this.cursorPos.pos), d = this.width / 2 * c;
|
|
686
|
+
n = {
|
|
687
|
+
left: s.left - d,
|
|
688
|
+
right: s.left + d,
|
|
689
|
+
top: s.top,
|
|
690
|
+
bottom: s.bottom
|
|
690
691
|
};
|
|
691
692
|
}
|
|
692
|
-
const
|
|
693
|
-
this.element || (this.element =
|
|
693
|
+
const i = this.editorView.dom.offsetParent;
|
|
694
|
+
this.element || (this.element = i.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", t), this.element.classList.toggle(
|
|
694
695
|
"prosemirror-dropcursor-vertical",
|
|
695
696
|
this.cursorPos.position !== "regular"
|
|
696
|
-
), this.element.classList.toggle("prosemirror-dropcursor-inline", !
|
|
697
|
-
let
|
|
698
|
-
if (!
|
|
699
|
-
|
|
697
|
+
), this.element.classList.toggle("prosemirror-dropcursor-inline", !t);
|
|
698
|
+
let g, a;
|
|
699
|
+
if (!i || i === document.body && getComputedStyle(i).position === "static")
|
|
700
|
+
g = -window.scrollX, a = -window.scrollY;
|
|
700
701
|
else {
|
|
701
|
-
const
|
|
702
|
-
|
|
702
|
+
const s = i.getBoundingClientRect(), d = s.width / i.offsetWidth, m = s.height / i.offsetHeight;
|
|
703
|
+
g = s.left - i.scrollLeft * d, a = s.top - i.scrollTop * m;
|
|
703
704
|
}
|
|
704
|
-
this.element.style.left = (
|
|
705
|
+
this.element.style.left = (n.left - g) / c + "px", this.element.style.top = (n.top - a) / l + "px", this.element.style.width = (n.right - n.left) / c + "px", this.element.style.height = (n.bottom - n.top) / l + "px";
|
|
705
706
|
}
|
|
706
|
-
scheduleRemoval(
|
|
707
|
-
clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(void 0),
|
|
707
|
+
scheduleRemoval(e) {
|
|
708
|
+
clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(void 0), e);
|
|
708
709
|
}
|
|
709
710
|
// this gets executed on every mouse move when dragging (drag over)
|
|
710
|
-
dragover(
|
|
711
|
+
dragover(e) {
|
|
711
712
|
if (!this.editorView.editable)
|
|
712
713
|
return;
|
|
713
|
-
const
|
|
714
|
-
left:
|
|
715
|
-
top:
|
|
716
|
-
}),
|
|
717
|
-
if (
|
|
718
|
-
let
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
721
|
-
const
|
|
714
|
+
const t = this.editorView.posAtCoords({
|
|
715
|
+
left: e.clientX,
|
|
716
|
+
top: e.clientY
|
|
717
|
+
}), n = t && t.inside >= 0 && this.editorView.state.doc.nodeAt(t.inside), r = n && n.type.spec.disableDropCursor, u = typeof r == "function" ? r(this.editorView, t, e) : r;
|
|
718
|
+
if (t && !u) {
|
|
719
|
+
let c = "regular", l = t.pos;
|
|
720
|
+
const i = V(this.editorView.state, t), a = this.editorView.nodeDOM(i.posBeforeNode).getBoundingClientRect();
|
|
721
|
+
if (e.clientX <= a.left + a.width * k && (c = "left", l = i.posBeforeNode), e.clientX >= a.right - a.width * k && (c = "right", l = i.posBeforeNode), c === "regular" && this.editorView.dragging && this.editorView.dragging.slice) {
|
|
722
|
+
const s = ee(
|
|
722
723
|
this.editorView.state.doc,
|
|
723
|
-
|
|
724
|
+
l,
|
|
724
725
|
this.editorView.dragging.slice
|
|
725
726
|
);
|
|
726
|
-
|
|
727
|
+
s != null && (l = s);
|
|
727
728
|
}
|
|
728
|
-
this.setCursor({ pos:
|
|
729
|
+
this.setCursor({ pos: l, position: c }), this.scheduleRemoval(5e3);
|
|
729
730
|
}
|
|
730
731
|
}
|
|
731
732
|
dragend() {
|
|
@@ -734,771 +735,143 @@ class ar {
|
|
|
734
735
|
drop() {
|
|
735
736
|
this.setCursor(void 0);
|
|
736
737
|
}
|
|
737
|
-
dragleave(
|
|
738
|
-
(
|
|
738
|
+
dragleave(e) {
|
|
739
|
+
(e.target === this.editorView.dom || !this.editorView.dom.contains(e.relatedTarget)) && this.setCursor(void 0);
|
|
739
740
|
}
|
|
740
741
|
}
|
|
741
|
-
function
|
|
742
|
-
const
|
|
743
|
-
let
|
|
744
|
-
return
|
|
745
|
-
posBeforeNode:
|
|
746
|
-
node:
|
|
742
|
+
function V(o, e) {
|
|
743
|
+
const t = $(o.doc, e.pos);
|
|
744
|
+
let n = o.doc.resolve(t.posBeforeNode);
|
|
745
|
+
return n.parent.type.name === "column" && (n = o.doc.resolve(n.before())), {
|
|
746
|
+
posBeforeNode: n.pos,
|
|
747
|
+
node: n.nodeAfter
|
|
747
748
|
};
|
|
748
749
|
}
|
|
749
|
-
var
|
|
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 = {
|
|
750
|
+
var X = {
|
|
1374
751
|
color: void 0,
|
|
1375
752
|
size: void 0,
|
|
1376
753
|
className: void 0,
|
|
1377
754
|
style: void 0,
|
|
1378
755
|
attr: void 0
|
|
1379
|
-
},
|
|
1380
|
-
function
|
|
1381
|
-
if (
|
|
1382
|
-
var
|
|
756
|
+
}, I = v.createContext && /* @__PURE__ */ v.createContext(X), _e = ["attr", "size", "title"];
|
|
757
|
+
function Pe(o, e) {
|
|
758
|
+
if (o == null) return {};
|
|
759
|
+
var t = Se(o, e), n, r;
|
|
1383
760
|
if (Object.getOwnPropertySymbols) {
|
|
1384
|
-
var
|
|
1385
|
-
for (
|
|
1386
|
-
|
|
761
|
+
var u = Object.getOwnPropertySymbols(o);
|
|
762
|
+
for (r = 0; r < u.length; r++)
|
|
763
|
+
n = u[r], !(e.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(o, n) && (t[n] = o[n]);
|
|
1387
764
|
}
|
|
1388
|
-
return
|
|
765
|
+
return t;
|
|
1389
766
|
}
|
|
1390
|
-
function
|
|
1391
|
-
if (
|
|
1392
|
-
var
|
|
1393
|
-
for (var
|
|
1394
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1395
|
-
if (
|
|
1396
|
-
|
|
1397
|
-
}
|
|
1398
|
-
return
|
|
767
|
+
function Se(o, e) {
|
|
768
|
+
if (o == null) return {};
|
|
769
|
+
var t = {};
|
|
770
|
+
for (var n in o)
|
|
771
|
+
if (Object.prototype.hasOwnProperty.call(o, n)) {
|
|
772
|
+
if (e.indexOf(n) >= 0) continue;
|
|
773
|
+
t[n] = o[n];
|
|
774
|
+
}
|
|
775
|
+
return t;
|
|
1399
776
|
}
|
|
1400
|
-
function
|
|
1401
|
-
return
|
|
1402
|
-
for (var
|
|
1403
|
-
var
|
|
1404
|
-
for (var
|
|
1405
|
-
Object.prototype.hasOwnProperty.call(
|
|
1406
|
-
}
|
|
1407
|
-
return
|
|
1408
|
-
},
|
|
777
|
+
function _() {
|
|
778
|
+
return _ = Object.assign ? Object.assign.bind() : function(o) {
|
|
779
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
780
|
+
var t = arguments[e];
|
|
781
|
+
for (var n in t)
|
|
782
|
+
Object.prototype.hasOwnProperty.call(t, n) && (o[n] = t[n]);
|
|
783
|
+
}
|
|
784
|
+
return o;
|
|
785
|
+
}, _.apply(this, arguments);
|
|
1409
786
|
}
|
|
1410
|
-
function
|
|
1411
|
-
var
|
|
787
|
+
function L(o, e) {
|
|
788
|
+
var t = Object.keys(o);
|
|
1412
789
|
if (Object.getOwnPropertySymbols) {
|
|
1413
|
-
var
|
|
1414
|
-
|
|
1415
|
-
return Object.getOwnPropertyDescriptor(
|
|
1416
|
-
})),
|
|
790
|
+
var n = Object.getOwnPropertySymbols(o);
|
|
791
|
+
e && (n = n.filter(function(r) {
|
|
792
|
+
return Object.getOwnPropertyDescriptor(o, r).enumerable;
|
|
793
|
+
})), t.push.apply(t, n);
|
|
1417
794
|
}
|
|
1418
|
-
return
|
|
795
|
+
return t;
|
|
1419
796
|
}
|
|
1420
|
-
function
|
|
1421
|
-
for (var
|
|
1422
|
-
var
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
1426
|
-
Object.defineProperty(
|
|
797
|
+
function P(o) {
|
|
798
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
799
|
+
var t = arguments[e] != null ? arguments[e] : {};
|
|
800
|
+
e % 2 ? L(Object(t), !0).forEach(function(n) {
|
|
801
|
+
xe(o, n, t[n]);
|
|
802
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) : L(Object(t)).forEach(function(n) {
|
|
803
|
+
Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(t, n));
|
|
1427
804
|
});
|
|
1428
805
|
}
|
|
1429
|
-
return
|
|
806
|
+
return o;
|
|
1430
807
|
}
|
|
1431
|
-
function
|
|
1432
|
-
return
|
|
808
|
+
function xe(o, e, t) {
|
|
809
|
+
return e = Ee(e), e in o ? Object.defineProperty(o, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : o[e] = t, o;
|
|
1433
810
|
}
|
|
1434
|
-
function
|
|
1435
|
-
var
|
|
1436
|
-
return typeof
|
|
811
|
+
function Ee(o) {
|
|
812
|
+
var e = Oe(o, "string");
|
|
813
|
+
return typeof e == "symbol" ? e : e + "";
|
|
1437
814
|
}
|
|
1438
|
-
function
|
|
1439
|
-
if (typeof
|
|
1440
|
-
var
|
|
1441
|
-
if (
|
|
1442
|
-
var
|
|
1443
|
-
if (typeof
|
|
815
|
+
function Oe(o, e) {
|
|
816
|
+
if (typeof o != "object" || !o) return o;
|
|
817
|
+
var t = o[Symbol.toPrimitive];
|
|
818
|
+
if (t !== void 0) {
|
|
819
|
+
var n = t.call(o, e || "default");
|
|
820
|
+
if (typeof n != "object") return n;
|
|
1444
821
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1445
822
|
}
|
|
1446
|
-
return (
|
|
823
|
+
return (e === "string" ? String : Number)(o);
|
|
1447
824
|
}
|
|
1448
|
-
function
|
|
1449
|
-
return
|
|
1450
|
-
key:
|
|
1451
|
-
},
|
|
825
|
+
function U(o) {
|
|
826
|
+
return o && o.map((e, t) => /* @__PURE__ */ v.createElement(e.tag, P({
|
|
827
|
+
key: t
|
|
828
|
+
}, e.attr), U(e.child)));
|
|
1452
829
|
}
|
|
1453
|
-
function
|
|
1454
|
-
return (
|
|
1455
|
-
attr:
|
|
1456
|
-
},
|
|
830
|
+
function G(o) {
|
|
831
|
+
return (e) => /* @__PURE__ */ v.createElement(De, _({
|
|
832
|
+
attr: P({}, o.attr)
|
|
833
|
+
}, e), U(o.child));
|
|
1457
834
|
}
|
|
1458
|
-
function
|
|
1459
|
-
var
|
|
835
|
+
function De(o) {
|
|
836
|
+
var e = (t) => {
|
|
1460
837
|
var {
|
|
1461
|
-
attr:
|
|
1462
|
-
size:
|
|
1463
|
-
title:
|
|
1464
|
-
} =
|
|
1465
|
-
return
|
|
838
|
+
attr: n,
|
|
839
|
+
size: r,
|
|
840
|
+
title: u
|
|
841
|
+
} = o, c = Pe(o, _e), l = r || t.size || "1em", i;
|
|
842
|
+
return t.className && (i = t.className), o.className && (i = (i ? i + " " : "") + o.className), /* @__PURE__ */ v.createElement("svg", _({
|
|
1466
843
|
stroke: "currentColor",
|
|
1467
844
|
fill: "currentColor",
|
|
1468
845
|
strokeWidth: "0"
|
|
1469
|
-
},
|
|
1470
|
-
className:
|
|
1471
|
-
style:
|
|
1472
|
-
color:
|
|
1473
|
-
},
|
|
1474
|
-
height:
|
|
1475
|
-
width:
|
|
846
|
+
}, t.attr, n, c, {
|
|
847
|
+
className: i,
|
|
848
|
+
style: P(P({
|
|
849
|
+
color: o.color || t.color
|
|
850
|
+
}, t.style), o.style),
|
|
851
|
+
height: l,
|
|
852
|
+
width: l,
|
|
1476
853
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1477
|
-
}),
|
|
854
|
+
}), u && /* @__PURE__ */ v.createElement("title", null, u), o.children);
|
|
1478
855
|
};
|
|
1479
|
-
return
|
|
856
|
+
return I !== void 0 ? /* @__PURE__ */ v.createElement(I.Consumer, null, (t) => e(t)) : e(X);
|
|
1480
857
|
}
|
|
1481
|
-
function
|
|
1482
|
-
return
|
|
858
|
+
function Be(o) {
|
|
859
|
+
return G({ 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: [] }] })(o);
|
|
1483
860
|
}
|
|
1484
|
-
function
|
|
1485
|
-
return
|
|
861
|
+
function Te(o) {
|
|
862
|
+
return G({ 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: [] }] })(o);
|
|
1486
863
|
}
|
|
1487
|
-
function
|
|
1488
|
-
return "column" in
|
|
864
|
+
function Ne(o) {
|
|
865
|
+
return "column" in o.schema.blockSchema && o.schema.blockSchema.columnList === M.blockSchema.columnList && "column" in o.schema.blockSchema && o.schema.blockSchema.column === M.blockSchema.column;
|
|
1489
866
|
}
|
|
1490
|
-
function
|
|
1491
|
-
const
|
|
1492
|
-
return
|
|
867
|
+
function Ue(o) {
|
|
868
|
+
const e = [];
|
|
869
|
+
return Ne(o) && e.push(
|
|
1493
870
|
{
|
|
1494
|
-
...
|
|
1495
|
-
icon: /* @__PURE__ */
|
|
1496
|
-
fileName: "/Users/nickthesick/Developer/BlockNote/packages/xl-multi-column/src/extensions/SuggestionMenu/getMultiColumnSlashMenuItems.tsx",
|
|
1497
|
-
lineNumber: 41,
|
|
1498
|
-
columnNumber: 15
|
|
1499
|
-
}, this),
|
|
871
|
+
...N(o).slash_menu.two_columns,
|
|
872
|
+
icon: /* @__PURE__ */ T(Be, { size: 18 }),
|
|
1500
873
|
onItemClick: () => {
|
|
1501
|
-
|
|
874
|
+
O(o, {
|
|
1502
875
|
type: "columnList",
|
|
1503
876
|
children: [
|
|
1504
877
|
{
|
|
@@ -1522,14 +895,10 @@ function xr(n) {
|
|
|
1522
895
|
}
|
|
1523
896
|
},
|
|
1524
897
|
{
|
|
1525
|
-
...
|
|
1526
|
-
icon: /* @__PURE__ */
|
|
1527
|
-
fileName: "/Users/nickthesick/Developer/BlockNote/packages/xl-multi-column/src/extensions/SuggestionMenu/getMultiColumnSlashMenuItems.tsx",
|
|
1528
|
-
lineNumber: 68,
|
|
1529
|
-
columnNumber: 15
|
|
1530
|
-
}, this),
|
|
898
|
+
...N(o).slash_menu.three_columns,
|
|
899
|
+
icon: /* @__PURE__ */ T(Te, { size: 18 }),
|
|
1531
900
|
onItemClick: () => {
|
|
1532
|
-
|
|
901
|
+
O(o, {
|
|
1533
902
|
type: "columnList",
|
|
1534
903
|
children: [
|
|
1535
904
|
{
|
|
@@ -1560,17 +929,17 @@ function xr(n) {
|
|
|
1560
929
|
});
|
|
1561
930
|
}
|
|
1562
931
|
}
|
|
1563
|
-
),
|
|
932
|
+
), e;
|
|
1564
933
|
}
|
|
1565
934
|
export {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
935
|
+
W as ColumnBlock,
|
|
936
|
+
A as ColumnListBlock,
|
|
937
|
+
Ne as checkMultiColumnBlocksInSchema,
|
|
938
|
+
N as getMultiColumnDictionary,
|
|
939
|
+
Ue as getMultiColumnSlashMenuItems,
|
|
940
|
+
Ae as locales,
|
|
941
|
+
Xe as multiColumnDropCursor,
|
|
942
|
+
M as multiColumnSchema,
|
|
943
|
+
Ve as withMultiColumn
|
|
1575
944
|
};
|
|
1576
945
|
//# sourceMappingURL=blocknote-xl-multi-column.js.map
|