@blocknote/xl-multi-column 0.47.0 → 0.47.2

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