@blocknote/xl-multi-column 0.47.2 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,848 +1,656 @@
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 $ = {
12
- slash_menu: {
13
- two_columns: {
14
- title: "عمودان",
15
- subtext: "عمودان جنبًا إلى جنب",
16
- aliases: ["أعمدة", "صف", "تقسيم"],
17
- group: "الكتل الأساسية"
18
- },
19
- three_columns: {
20
- title: "ثلاثة أعمدة",
21
- subtext: "ثلاثة أعمدة جنبًا إلى جنب",
22
- aliases: ["أعمدة", "صف", "تقسيم"],
23
- group: "الكتل الأساسية"
24
- }
25
- }
26
- }, J = {
27
- slash_menu: {
28
- two_columns: {
29
- title: "Zwei Spalten",
30
- subtext: "Zwei Spalten nebeneinander",
31
- aliases: ["Spalten", "Reihe", "teilen"],
32
- group: "Grundlegende Blöcke"
33
- },
34
- three_columns: {
35
- title: "Drei Spalten",
36
- subtext: "Drei Spalten nebeneinander",
37
- aliases: ["Spalten", "Reihe", "teilen"],
38
- group: "Grundlegende Blöcke"
39
- }
40
- }
41
- }, Q = {
42
- slash_menu: {
43
- two_columns: {
44
- title: "Two Columns",
45
- subtext: "Two columns side by side",
46
- aliases: ["columns", "row", "split"],
47
- group: "Basic blocks"
48
- },
49
- three_columns: {
50
- title: "Three Columns",
51
- subtext: "Three columns side by side",
52
- aliases: ["columns", "row", "split"],
53
- group: "Basic blocks"
54
- }
55
- }
56
- }, ee = {
57
- slash_menu: {
58
- two_columns: {
59
- title: "Dos Columnas",
60
- subtext: "Dos columnas lado a lado",
61
- aliases: ["columnas", "fila", "dividir"],
62
- group: "Bloques básicos"
63
- },
64
- three_columns: {
65
- title: "Tres Columnas",
66
- subtext: "Tres columnas lado a lado",
67
- aliases: ["columnas", "fila", "dividir"],
68
- group: "Bloques básicos"
69
- }
70
- }
71
- }, te = {
72
- slash_menu: {
73
- two_columns: {
74
- title: "Deux Colonnes",
75
- subtext: "Deux colonnes côte à côte",
76
- aliases: ["colonnes", "rangée", "partager"],
77
- group: "Blocs de base"
78
- },
79
- three_columns: {
80
- title: "Trois Colonnes",
81
- subtext: "Trois colonnes côte à côte",
82
- aliases: ["colonnes", "rangée", "partager"],
83
- group: "Blocs de base"
84
- }
85
- }
86
- }, oe = {
87
- slash_menu: {
88
- two_columns: {
89
- title: "Dva Stupca",
90
- subtext: "Dva stupca jedan pored drugog",
91
- aliases: ["stupci", "redak", "podijeli"],
92
- group: "Osnovni blokovi"
93
- },
94
- three_columns: {
95
- title: "Tri Stupca",
96
- subtext: "Tri stupca jedan pored drugog",
97
- aliases: ["stupci", "redak", "podijeli"],
98
- group: "Osnovni blokovi"
99
- }
100
- }
101
- }, ne = {
102
- slash_menu: {
103
- two_columns: {
104
- title: "Tvær Dálkar",
105
- subtext: "Tvær dálkar hlið við hlið",
106
- aliases: ["dálkar", "röð", "skipta"],
107
- group: "Grunnblokkar"
108
- },
109
- three_columns: {
110
- title: "Þrír Dálkar",
111
- subtext: "Þrír dálkar hlið við hlið",
112
- aliases: ["dálkar", "röð", "skipta"],
113
- group: "Grunnblokkar"
114
- }
115
- }
116
- }, ie = {
117
- slash_menu: {
118
- two_columns: {
119
- title: "二列",
120
- subtext: "二列並んで",
121
- aliases: ["列", "行", "分割"],
122
- group: "基本ブロック"
123
- },
124
- three_columns: {
125
- title: "三列",
126
- subtext: "三列並んで",
127
- aliases: ["", "行", "分割"],
128
- group: "基本ブロック"
129
- }
130
- }
131
- }, re = {
132
- slash_menu: {
133
- two_columns: {
134
- title: " ",
135
- subtext: "두 열 나란히",
136
- aliases: ["", "행", "분할"],
137
- group: "기본 블록"
138
- },
139
- three_columns: {
140
- title: " ",
141
- subtext: "세 열 나란히",
142
- aliases: ["열", "행", "분할"],
143
- group: "기본 블록"
144
- }
145
- }
146
- }, le = {
147
- slash_menu: {
148
- two_columns: {
149
- title: "Twee Kolommen",
150
- subtext: "Twee kolommen naast elkaar",
151
- aliases: ["kolommen", "rij", "verdelen"],
152
- group: "Basisblokken"
153
- },
154
- three_columns: {
155
- title: "Drie Kolommen",
156
- subtext: "Drie kolommen naast elkaar",
157
- aliases: ["kolommen", "rij", "verdelen"],
158
- group: "Basisblokken"
159
- }
160
- }
161
- }, se = {
162
- slash_menu: {
163
- two_columns: {
164
- title: "Dwie Kolumny",
165
- subtext: "Dwie kolumny obok siebie",
166
- aliases: ["kolumny", "rząd", "podzielić"],
167
- group: "Podstawowe bloki"
168
- },
169
- three_columns: {
170
- title: "Trzy Kolumny",
171
- subtext: "Trzy kolumny obok siebie",
172
- aliases: ["kolumny", "rząd", "podzielić"],
173
- group: "Podstawowe bloki"
174
- }
175
- }
176
- }, ue = {
177
- slash_menu: {
178
- two_columns: {
179
- title: "Duas Colunas",
180
- subtext: "Duas colunas lado a lado",
181
- aliases: ["colunas", "linha", "dividir"],
182
- group: "Blocos básicos"
183
- },
184
- three_columns: {
185
- title: "Três Colunas",
186
- subtext: "Três colunas lado a lado",
187
- aliases: ["colunas", "linha", "dividir"],
188
- group: "Blocos básicos"
189
- }
190
- }
191
- }, ae = {
192
- slash_menu: {
193
- two_columns: {
194
- title: "Два Столбца",
195
- subtext: "Два столбца рядом",
196
- aliases: ["столбцы", "ряд", "разделить"],
197
- group: "Базовые блоки"
198
- },
199
- three_columns: {
200
- title: "Три Столбца",
201
- subtext: "Три столбца рядом",
202
- aliases: ["столбцы", "ряд", "разделить"],
203
- group: "Базовые блоки"
204
- }
205
- }
206
- }, ce = {
207
- slash_menu: {
208
- two_columns: {
209
- title: "Hai Cột",
210
- subtext: "Hai cột cạnh nhau",
211
- aliases: ["cột", "hàng", "chia"],
212
- group: "Khối cơ bản"
213
- },
214
- three_columns: {
215
- title: "Ba Cột",
216
- subtext: "Ba cột cạnh nhau",
217
- aliases: ["cột", "hàng", "chia"],
218
- group: "Khối bản"
219
- }
220
- }
221
- }, de = {
222
- slash_menu: {
223
- two_columns: {
224
- title: "两列",
225
- subtext: "两列并排",
226
- aliases: ["列", "行", "分割"],
227
- group: "基础"
228
- },
229
- three_columns: {
230
- title: "三列",
231
- subtext: "三列并排",
232
- aliases: ["", "行", "分割"],
233
- group: "基础"
234
- }
235
- }
236
- }, He = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
237
- __proto__: null,
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
253
- }, Symbol.toStringTag, { value: "Module" }));
254
- function N(e) {
255
- if (!e.dictionary.multi_column)
256
- throw new Error("Multi-column dictionary not found");
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
- };
287
- }
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) => {
386
- if (!this.editor.isEditable)
387
- return { type: "default" };
388
- const o = t.target;
389
- if (!this.view.dom.contains(o))
390
- return { type: "default" };
391
- const n = o.closest(
392
- ".bn-block-column"
393
- );
394
- if (!n)
395
- return { type: "default" };
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)
398
- return { type: "default" };
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,
401
- this.view.state.doc
402
- );
403
- if (!p || !b || !p.posBeforeNode)
404
- throw new Error("Column not found");
405
- return {
406
- type: "hover",
407
- leftColumn: {
408
- element: r,
409
- id: c,
410
- ...p
411
- },
412
- rightColumn: {
413
- element: a,
414
- id: h,
415
- ...b
416
- }
417
- };
418
- });
419
- // When the user mouses down near the boundary between two columns, we
420
- // want to set the plugin state to resize, so the columns can be resized
421
- // by moving the mouse.
422
- m(this, "mouseDownHandler", (t) => {
423
- var r;
424
- let o = this.getColumnHoverOrDefaultState(t);
425
- if (o.type === "default")
426
- return;
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 = {
430
- type: "resize",
431
- startPos: n,
432
- leftColumn: {
433
- ...o.leftColumn,
434
- widthPx: u,
435
- widthPercent: s
436
- },
437
- rightColumn: {
438
- ...o.rightColumn,
439
- widthPx: l,
440
- widthPercent: i
441
- }
442
- }, this.view.dispatch(
443
- this.view.state.tr.setMeta(f, o)
444
- ), (r = this.editor.getExtension(_)) == null || r.freezeMenu();
445
- });
446
- // If the plugin isn't in a resize state, we want to update it to either a
447
- // hover state if the mouse is near the boundary between two columns, or
448
- // default otherwise. If the plugin is in a resize state, we want to
449
- // update the column widths based on the horizontal mouse movement.
450
- m(this, "mouseMoveHandler", (t) => {
451
- var r, a;
452
- const o = f.getState(this.view.state);
453
- if (!o)
454
- return;
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))
458
- return;
459
- this.view.dispatch(
460
- this.view.state.tr.setMeta(f, c)
461
- );
462
- return;
463
- }
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(
467
- this.view.state.tr.setNodeAttribute(
468
- o.leftColumn.posBeforeNode,
469
- "width",
470
- s
471
- ).setNodeAttribute(
472
- o.rightColumn.posBeforeNode,
473
- "width",
474
- i
475
- ).setMeta("addToHistory", !1)
476
- );
477
- });
478
- // If the plugin is in a resize state, we want to revert it to a default
479
- // or hover, depending on where the mouse cursor is, when the user
480
- // releases the mouse button.
481
- m(this, "mouseUpHandler", (t) => {
482
- var u;
483
- const o = f.getState(this.view.state);
484
- if (!o || o.type !== "resize")
485
- return;
486
- const n = this.getColumnHoverOrDefaultState(t);
487
- this.view.dispatch(
488
- this.view.state.tr.setMeta(f, n)
489
- ), (u = this.editor.getExtension(_)) == null || u.unfreezeMenu();
490
- });
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);
492
- }
493
- destroy() {
494
- this.view.dom.removeEventListener("mousedown", this.mouseDownHandler), document.body.removeEventListener("mousemove", this.mouseMoveHandler), document.body.removeEventListener("mouseup", this.mouseUpHandler);
495
- }
496
- }
497
- const fe = (e) => new I({
498
- key: f,
499
- props: {
500
- // This adds a border between the columns when the user is
501
- // resizing them or when the cursor is near their boundary.
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,
508
- {
509
- style: "box-shadow: 4px 0 0 #ccc; cursor: col-resize"
510
- }
511
- ),
512
- x.node(
513
- o.rightColumn.posBeforeNode,
514
- o.rightColumn.posBeforeNode + o.rightColumn.node.nodeSize,
515
- {
516
- style: "cursor: col-resize"
517
- }
518
- )
519
- ]);
520
- }
521
- },
522
- state: {
523
- init: () => ({ type: "default" }),
524
- apply: (t, o) => {
525
- const n = t.getMeta(f);
526
- return n === void 0 ? o : n;
527
- }
528
- },
529
- view: (t) => new pe(e, t)
530
- }), ge = (e) => Y.create({
531
- name: "columnResize",
532
- addProseMirrorPlugins() {
533
- return [fe(e)];
534
- }
535
- }), be = L.create({
536
- name: "column",
537
- group: "bnBlock childContainer",
538
- // A block always contains content, and optionally a blockGroup which contains nested blocks
539
- content: "blockContainer+",
540
- priority: 40,
541
- defining: !0,
542
- marks: "deletion insertion modification",
543
- addAttributes() {
544
- return {
545
- width: {
546
- // Why does each column have a default width of 1, i.e. 100%? Because
547
- // when creating a new column, we want to make sure that existing
548
- // column widths are preserved, while the new one also has a sensible
549
- // width. If we'd set it so all column widths must add up to 100%
550
- // instead, then each time a new column is created, we'd have to assign
551
- // it a width depending on the total number of columns and also adjust
552
- // the widths of the other columns. The same can be said for using px
553
- // instead of percent widths and making them add to the editor width. So
554
- // using this method is both simpler and computationally cheaper. This
555
- // is possible because we can set the `flex-grow` property to the width
556
- // value, which handles all the resizing for us, instead of manually
557
- // having to set the `width` property of each column.
558
- default: 1,
559
- parseHTML: (e) => {
560
- const t = e.getAttribute("data-width");
561
- if (t === null)
562
- return null;
563
- const o = parseFloat(t);
564
- return isFinite(o) ? o : null;
565
- },
566
- renderHTML: (e) => ({
567
- "data-width": e.width.toString(),
568
- style: `flex-grow: ${e.width};`
569
- })
570
- }
571
- };
572
- },
573
- parseHTML() {
574
- return [
575
- {
576
- tag: "div",
577
- getAttrs: (e) => typeof e == "string" ? !1 : e.getAttribute("data-node-type") === this.name ? {} : !1
578
- }
579
- ];
580
- },
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);
586
- return {
587
- dom: t,
588
- contentDOM: t
589
- };
590
- },
591
- addExtensions() {
592
- return [ge(this.options.editor)];
593
- }
594
- }), we = L.create({
595
- name: "columnList",
596
- group: "childContainer bnBlock blockGroupChild",
597
- // A block always contains content, and optionally a blockGroup which contains nested blocks
598
- content: "column column+",
599
- // min two columns
600
- priority: 40,
601
- // should be below blockContainer
602
- defining: !0,
603
- marks: "deletion insertion modification",
604
- parseHTML() {
605
- return [
606
- {
607
- tag: "div",
608
- getAttrs: (e) => typeof e == "string" ? !1 : e.getAttribute("data-node-type") === this.name ? {} : !1
609
- }
610
- ];
611
- },
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
620
- };
621
- }
622
- }), H = M(
623
- {
624
- node: be,
625
- type: "column",
626
- content: "none"
627
- },
628
- {
629
- width: {
630
- default: 1
631
- }
632
- },
633
- [he()]
634
- ), z = M(
635
- {
636
- node: we,
637
- type: "columnList",
638
- content: "none"
639
- },
640
- {}
641
- ), D = q.create({
642
- blockSpecs: {
643
- column: H,
644
- columnList: z
645
- }
646
- }), Re = (e) => e.extend({
647
- blockSpecs: {
648
- column: H,
649
- columnList: z
650
- }
1
+ import { BlockNoteSchema as e, UniqueID as t, createBlockSpecFromTiptapNode as n, createExtension as r, getBlockInfo as i, getNearestBlockPos as a, getNodeById as o, nodeToBlock as s } from "@blocknote/core";
2
+ import { Plugin as c, PluginKey as l } from "prosemirror-state";
3
+ import { Extension as u, Node as d } from "@tiptap/core";
4
+ import { SideMenuExtension as f, insertOrUpdateBlockForSlashMenu as p } from "@blocknote/core/extensions";
5
+ import { Decoration as m, DecorationSet as h } from "prosemirror-view";
6
+ import { TbColumns2 as g, TbColumns3 as _ } from "react-icons/tb";
7
+ import { jsx as v } from "react/jsx-runtime";
8
+ //#region \0rolldown/runtime.js
9
+ var y = Object.defineProperty, b = (e, t) => {
10
+ let n = {};
11
+ for (var r in e) y(n, r, {
12
+ get: e[r],
13
+ enumerable: !0
14
+ });
15
+ return t || y(n, Symbol.toStringTag, { value: "Module" }), n;
16
+ }, x = { slash_menu: {
17
+ two_columns: {
18
+ title: "عمودان",
19
+ subtext: "عمودان جنبًا إلى جنب",
20
+ aliases: [
21
+ "أعمدة",
22
+ "صف",
23
+ "تقسيم"
24
+ ],
25
+ group: "الكتل الأساسية"
26
+ },
27
+ three_columns: {
28
+ title: "ثلاثة أعمدة",
29
+ subtext: "ثلاثة أعمدة جنبًا إلى جنب",
30
+ aliases: [
31
+ "أعمدة",
32
+ "صف",
33
+ "تقسيم"
34
+ ],
35
+ group: "الكتل الأساسية"
36
+ }
37
+ } }, S = { slash_menu: {
38
+ two_columns: {
39
+ title: "Zwei Spalten",
40
+ subtext: "Zwei Spalten nebeneinander",
41
+ aliases: [
42
+ "Spalten",
43
+ "Reihe",
44
+ "teilen"
45
+ ],
46
+ group: "Grundlegende Blöcke"
47
+ },
48
+ three_columns: {
49
+ title: "Drei Spalten",
50
+ subtext: "Drei Spalten nebeneinander",
51
+ aliases: [
52
+ "Spalten",
53
+ "Reihe",
54
+ "teilen"
55
+ ],
56
+ group: "Grundlegende Blöcke"
57
+ }
58
+ } }, C = { slash_menu: {
59
+ two_columns: {
60
+ title: "Two Columns",
61
+ subtext: "Two columns side by side",
62
+ aliases: [
63
+ "columns",
64
+ "row",
65
+ "split"
66
+ ],
67
+ group: "Basic blocks"
68
+ },
69
+ three_columns: {
70
+ title: "Three Columns",
71
+ subtext: "Three columns side by side",
72
+ aliases: [
73
+ "columns",
74
+ "row",
75
+ "split"
76
+ ],
77
+ group: "Basic blocks"
78
+ }
79
+ } }, w = { slash_menu: {
80
+ two_columns: {
81
+ title: "Dos Columnas",
82
+ subtext: "Dos columnas lado a lado",
83
+ aliases: [
84
+ "columnas",
85
+ "fila",
86
+ "dividir"
87
+ ],
88
+ group: "Bloques básicos"
89
+ },
90
+ three_columns: {
91
+ title: "Tres Columnas",
92
+ subtext: "Tres columnas lado a lado",
93
+ aliases: [
94
+ "columnas",
95
+ "fila",
96
+ "dividir"
97
+ ],
98
+ group: "Bloques básicos"
99
+ }
100
+ } }, T = { slash_menu: {
101
+ two_columns: {
102
+ title: "Deux Colonnes",
103
+ subtext: "Deux colonnes côte à côte",
104
+ aliases: [
105
+ "colonnes",
106
+ "rangée",
107
+ "partager"
108
+ ],
109
+ group: "Blocs de base"
110
+ },
111
+ three_columns: {
112
+ title: "Trois Colonnes",
113
+ subtext: "Trois colonnes côte à côte",
114
+ aliases: [
115
+ "colonnes",
116
+ "rangée",
117
+ "partager"
118
+ ],
119
+ group: "Blocs de base"
120
+ }
121
+ } }, E = { slash_menu: {
122
+ two_columns: {
123
+ title: "Dva Stupca",
124
+ subtext: "Dva stupca jedan pored drugog",
125
+ aliases: [
126
+ "stupci",
127
+ "redak",
128
+ "podijeli"
129
+ ],
130
+ group: "Osnovni blokovi"
131
+ },
132
+ three_columns: {
133
+ title: "Tri Stupca",
134
+ subtext: "Tri stupca jedan pored drugog",
135
+ aliases: [
136
+ "stupci",
137
+ "redak",
138
+ "podijeli"
139
+ ],
140
+ group: "Osnovni blokovi"
141
+ }
142
+ } }, D = { slash_menu: {
143
+ two_columns: {
144
+ title: "Tvær Dálkar",
145
+ subtext: "Tvær dálkar hlið við hlið",
146
+ aliases: [
147
+ "dálkar",
148
+ "röð",
149
+ "skipta"
150
+ ],
151
+ group: "Grunnblokkar"
152
+ },
153
+ three_columns: {
154
+ title: "Þrír Dálkar",
155
+ subtext: "Þrír dálkar hlið við hlið",
156
+ aliases: [
157
+ "dálkar",
158
+ "röð",
159
+ "skipta"
160
+ ],
161
+ group: "Grunnblokkar"
162
+ }
163
+ } }, O = { slash_menu: {
164
+ two_columns: {
165
+ title: "二列",
166
+ subtext: "二列並んで",
167
+ aliases: [
168
+ "列",
169
+ "行",
170
+ "分割"
171
+ ],
172
+ group: "基本ブロック"
173
+ },
174
+ three_columns: {
175
+ title: "三列",
176
+ subtext: "三列並んで",
177
+ aliases: [
178
+ "列",
179
+ "",
180
+ "分割"
181
+ ],
182
+ group: "基本ブロック"
183
+ }
184
+ } }, k = { slash_menu: {
185
+ two_columns: {
186
+ title: " ",
187
+ subtext: " 나란히",
188
+ aliases: [
189
+ "열",
190
+ "행",
191
+ "분할"
192
+ ],
193
+ group: "기본 블록"
194
+ },
195
+ three_columns: {
196
+ title: " ",
197
+ subtext: " 열 나란히",
198
+ aliases: [
199
+ "열",
200
+ "",
201
+ "분할"
202
+ ],
203
+ group: "기본 블록"
204
+ }
205
+ } }, A = { slash_menu: {
206
+ two_columns: {
207
+ title: "Twee Kolommen",
208
+ subtext: "Twee kolommen naast elkaar",
209
+ aliases: [
210
+ "kolommen",
211
+ "rij",
212
+ "verdelen"
213
+ ],
214
+ group: "Basisblokken"
215
+ },
216
+ three_columns: {
217
+ title: "Drie Kolommen",
218
+ subtext: "Drie kolommen naast elkaar",
219
+ aliases: [
220
+ "kolommen",
221
+ "rij",
222
+ "verdelen"
223
+ ],
224
+ group: "Basisblokken"
225
+ }
226
+ } }, j = { slash_menu: {
227
+ two_columns: {
228
+ title: "Dwie Kolumny",
229
+ subtext: "Dwie kolumny obok siebie",
230
+ aliases: [
231
+ "kolumny",
232
+ "rząd",
233
+ "podzielić"
234
+ ],
235
+ group: "Podstawowe bloki"
236
+ },
237
+ three_columns: {
238
+ title: "Trzy Kolumny",
239
+ subtext: "Trzy kolumny obok siebie",
240
+ aliases: [
241
+ "kolumny",
242
+ "rząd",
243
+ "podzielić"
244
+ ],
245
+ group: "Podstawowe bloki"
246
+ }
247
+ } }, M = { slash_menu: {
248
+ two_columns: {
249
+ title: "Duas Colunas",
250
+ subtext: "Duas colunas lado a lado",
251
+ aliases: [
252
+ "colunas",
253
+ "linha",
254
+ "dividir"
255
+ ],
256
+ group: "Blocos básicos"
257
+ },
258
+ three_columns: {
259
+ title: "Três Colunas",
260
+ subtext: "Três colunas lado a lado",
261
+ aliases: [
262
+ "colunas",
263
+ "linha",
264
+ "dividir"
265
+ ],
266
+ group: "Blocos básicos"
267
+ }
268
+ } }, N = { slash_menu: {
269
+ two_columns: {
270
+ title: "Два Столбца",
271
+ subtext: "Два столбца рядом",
272
+ aliases: [
273
+ "столбцы",
274
+ "ряд",
275
+ "разделить"
276
+ ],
277
+ group: "Базовые блоки"
278
+ },
279
+ three_columns: {
280
+ title: "Три Столбца",
281
+ subtext: "Три столбца рядом",
282
+ aliases: [
283
+ "столбцы",
284
+ "ряд",
285
+ "разделить"
286
+ ],
287
+ group: "Базовые блоки"
288
+ }
289
+ } }, P = { slash_menu: {
290
+ two_columns: {
291
+ title: "Hai Cột",
292
+ subtext: "Hai cột cạnh nhau",
293
+ aliases: [
294
+ "cột",
295
+ "hàng",
296
+ "chia"
297
+ ],
298
+ group: "Khối bản"
299
+ },
300
+ three_columns: {
301
+ title: "Ba Cột",
302
+ subtext: "Ba cột cạnh nhau",
303
+ aliases: [
304
+ "cột",
305
+ "hàng",
306
+ "chia"
307
+ ],
308
+ group: "Khối bản"
309
+ }
310
+ } }, F = { slash_menu: {
311
+ two_columns: {
312
+ title: "两列",
313
+ subtext: "两列并排",
314
+ aliases: [
315
+ "列",
316
+ "行",
317
+ "分割"
318
+ ],
319
+ group: "基础"
320
+ },
321
+ three_columns: {
322
+ title: "三列",
323
+ subtext: "三列并排",
324
+ aliases: [
325
+ "列",
326
+ "行",
327
+ "分割"
328
+ ],
329
+ group: "基础"
330
+ }
331
+ } }, I = /* @__PURE__ */ b({
332
+ ar: () => x,
333
+ de: () => S,
334
+ en: () => C,
335
+ es: () => w,
336
+ fr: () => T,
337
+ hr: () => E,
338
+ is: () => D,
339
+ ja: () => O,
340
+ ko: () => k,
341
+ nl: () => A,
342
+ pl: () => j,
343
+ pt: () => M,
344
+ ru: () => N,
345
+ vi: () => P,
346
+ zh: () => F
651
347
  });
652
- var R = {
653
- color: void 0,
654
- size: void 0,
655
- className: void 0,
656
- style: void 0,
657
- attr: void 0
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;
662
- if (Object.getOwnPropertySymbols) {
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]);
666
- }
667
- return o;
668
- }
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];
676
- }
677
- return o;
678
- }
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]);
685
- }
686
- return e;
687
- }, C.apply(this, arguments);
688
- }
689
- function T(e, t) {
690
- var o = Object.keys(e);
691
- if (Object.getOwnPropertySymbols) {
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);
696
- }
697
- return o;
698
- }
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));
706
- });
707
- }
708
- return e;
709
- }
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;
712
- }
713
- function ke(e) {
714
- var t = Pe(e, "string");
715
- return typeof t == "symbol" ? t : t + "";
716
- }
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);
722
- if (typeof n != "object") return n;
723
- throw new TypeError("@@toPrimitive must return a primitive value.");
724
- }
725
- return (t === "string" ? String : Number)(e);
726
- }
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)));
731
- }
732
- function A(e) {
733
- return (t) => /* @__PURE__ */ g.createElement(Ee, C({
734
- attr: v({}, e.attr)
735
- }, t), W(e.child));
736
- }
737
- function Ee(e) {
738
- var t = (o) => {
739
- var {
740
- attr: n,
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({
745
- stroke: "currentColor",
746
- fill: "currentColor",
747
- strokeWidth: "0"
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,
755
- xmlns: "http://www.w3.org/2000/svg"
756
- }), l && /* @__PURE__ */ g.createElement("title", null, l), e.children);
757
- };
758
- return O !== void 0 ? /* @__PURE__ */ g.createElement(O.Consumer, null, (o) => t(o)) : t(R);
348
+ //#endregion
349
+ //#region src/i18n/dictionary.ts
350
+ function L(e) {
351
+ if (!e.dictionary.multi_column) throw Error("Multi-column dictionary not found");
352
+ return e.dictionary.multi_column;
759
353
  }
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);
354
+ //#endregion
355
+ //#region src/extensions/DropCursor/multiColumnDropCursor.ts
356
+ var R = .1;
357
+ function z(e, t, n) {
358
+ let r = t.posAtCoords({
359
+ left: e.clientX,
360
+ top: e.clientY
361
+ });
362
+ if (!r) return null;
363
+ let i = a(n.doc, r.pos), o = n.doc.resolve(i.posBeforeNode);
364
+ o.parent.type.name === "column" && (o = n.doc.resolve(o.before()));
365
+ let s = {
366
+ posBeforeNode: o.pos,
367
+ node: o.nodeAfter
368
+ }, c = t.nodeDOM(s.posBeforeNode);
369
+ if (c === null) return {
370
+ position: "regular",
371
+ posBeforeNode: s.posBeforeNode,
372
+ node: s.node
373
+ };
374
+ let l = c.getBoundingClientRect(), u = "regular";
375
+ return e.clientX <= l.left + l.width * R ? u = "left" : e.clientX >= l.right - l.width * R && (u = "right"), {
376
+ position: u,
377
+ posBeforeNode: s.posBeforeNode,
378
+ node: s.node
379
+ };
762
380
  }
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);
381
+ var B = { hooks: { computeDropPosition: (e) => {
382
+ let t = z(e.event, e.view, e.view.state);
383
+ return t === null || t.position === "regular" ? e.defaultPosition : {
384
+ pos: t.posBeforeNode,
385
+ orientation: t.position === "left" ? "block-vertical-left" : "block-vertical-right"
386
+ };
387
+ } } };
388
+ //#endregion
389
+ //#region src/extensions/DropCursor/multiColumnHandleDropPlugin.ts
390
+ function V(e) {
391
+ return new c({ props: { handleDrop(n, r, a, o) {
392
+ let c = z(r, n, n.state);
393
+ if (c === null) return !1;
394
+ let l = i(c);
395
+ if (c.position === "regular" || a.content.childCount === 0) return !1;
396
+ let u = s(a.content.child(0), e.pmSchema);
397
+ if (l.blockNoteType === "column") {
398
+ let r = s(n.state.doc.resolve(l.bnBlock.beforePos).node(), e.pmSchema), i = 0;
399
+ r.children.forEach((e) => {
400
+ i += e.props.width;
401
+ });
402
+ let a = i / r.children.length;
403
+ if (a < .99 || a > 1.01) {
404
+ let e = 1 / a;
405
+ r.children.forEach((t) => {
406
+ t.props.width = t.props.width * e;
407
+ });
408
+ }
409
+ let o = r.children.findIndex((e) => e.id === l.bnBlock.node.attrs.id), d = r.children.map((e) => ({
410
+ ...e,
411
+ children: e.children.filter((e) => e.id !== u.id)
412
+ })).filter((e) => e.children.length > 0).toSpliced(c.position === "left" ? o : o + 1, 0, {
413
+ type: "column",
414
+ children: [u],
415
+ props: {},
416
+ content: void 0,
417
+ id: t.options.generateID()
418
+ });
419
+ e.getBlock(u.id) && e.removeBlocks([u]), e.updateBlock(r, { children: d });
420
+ } else {
421
+ let t = s(l.bnBlock.node, e.pmSchema);
422
+ if (t.id === u.id) return !0;
423
+ let n = c.position === "left" ? [u, t] : [t, u];
424
+ e.getBlock(u.id) && e.removeBlocks([u]), e.replaceBlocks([t], [{
425
+ type: "columnList",
426
+ children: n.map((e) => ({
427
+ type: "column",
428
+ children: [e]
429
+ }))
430
+ }]);
431
+ }
432
+ return !0;
433
+ } } });
765
434
  }
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;
435
+ var H = r(({ editor: e }) => ({
436
+ key: "multiColumnDropHandler",
437
+ prosemirrorPlugins: [V(e)]
438
+ })), U = new l("ColumnResizePlugin"), W = class {
439
+ editor;
440
+ view;
441
+ RESIZE_MARGIN_WIDTH_PX = 20;
442
+ COLUMN_MIN_WIDTH_PERCENT = .5;
443
+ constructor(e, t) {
444
+ 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);
445
+ }
446
+ getColumnHoverOrDefaultState = (e) => {
447
+ if (!this.editor.isEditable) return { type: "default" };
448
+ let t = e.target;
449
+ if (!this.view.dom.contains(t)) return { type: "default" };
450
+ let n = t.closest(".bn-block-column");
451
+ if (!n) return { type: "default" };
452
+ let r = e.clientX, i = n.getBoundingClientRect(), a = r < i.left + this.RESIZE_MARGIN_WIDTH_PX ? "left" : r > i.right - this.RESIZE_MARGIN_WIDTH_PX ? "right" : "none", s = a === "left" ? n.previousElementSibling : a === "right" ? n.nextElementSibling : void 0;
453
+ if (!s) return { type: "default" };
454
+ let c = a === "left" ? s : n, l = a === "left" ? n : s, u = c.getAttribute("data-id"), d = l.getAttribute("data-id"), f = o(u, this.view.state.doc), p = o(d, this.view.state.doc);
455
+ if (!f || !p || !f.posBeforeNode) throw Error("Column not found");
456
+ return {
457
+ type: "hover",
458
+ leftColumn: {
459
+ element: c,
460
+ id: u,
461
+ ...f
462
+ },
463
+ rightColumn: {
464
+ element: l,
465
+ id: d,
466
+ ...p
467
+ }
468
+ };
469
+ };
470
+ mouseDownHandler = (e) => {
471
+ let t = this.getColumnHoverOrDefaultState(e);
472
+ if (t.type === "default") return;
473
+ e.preventDefault();
474
+ let n = e.clientX, r = t.leftColumn.element.getBoundingClientRect().width, i = t.rightColumn.element.getBoundingClientRect().width, a = t.leftColumn.node.attrs.width, o = t.rightColumn.node.attrs.width;
475
+ t = {
476
+ type: "resize",
477
+ startPos: n,
478
+ leftColumn: {
479
+ ...t.leftColumn,
480
+ widthPx: r,
481
+ widthPercent: a
482
+ },
483
+ rightColumn: {
484
+ ...t.rightColumn,
485
+ widthPx: i,
486
+ widthPercent: o
487
+ }
488
+ }, this.view.dispatch(this.view.state.tr.setMeta(U, t)), this.editor.getExtension(f)?.freezeMenu();
489
+ };
490
+ mouseMoveHandler = (e) => {
491
+ let t = U.getState(this.view.state);
492
+ if (!t) return;
493
+ if (t.type !== "resize") {
494
+ let n = this.getColumnHoverOrDefaultState(e), r = t.type === "default" && n.type === "default", i = t.type !== "default" && n.type !== "default" && t.leftColumn.id === n.leftColumn.id && t.rightColumn.id === n.rightColumn.id;
495
+ if (r || i || n.type === "hover" && this.editor.getExtension(f)?.store.state?.show) return;
496
+ this.view.dispatch(this.view.state.tr.setMeta(U, n));
497
+ return;
498
+ }
499
+ let n = (e.clientX - t.startPos) * t.leftColumn.widthPercent, r = (t.leftColumn.widthPx + n) / t.leftColumn.widthPx - 1, i = t.leftColumn.widthPercent + r, a = t.rightColumn.widthPercent - r;
500
+ i < this.COLUMN_MIN_WIDTH_PERCENT ? (a -= this.COLUMN_MIN_WIDTH_PERCENT - i, i = this.COLUMN_MIN_WIDTH_PERCENT) : a < this.COLUMN_MIN_WIDTH_PERCENT && (i -= this.COLUMN_MIN_WIDTH_PERCENT - a, a = this.COLUMN_MIN_WIDTH_PERCENT), this.view.dispatch(this.view.state.tr.setNodeAttribute(t.leftColumn.posBeforeNode, "width", i).setNodeAttribute(t.rightColumn.posBeforeNode, "width", a).setMeta("addToHistory", !1));
501
+ };
502
+ mouseUpHandler = (e) => {
503
+ let t = U.getState(this.view.state);
504
+ if (!t || t.type !== "resize") return;
505
+ let n = this.getColumnHoverOrDefaultState(e);
506
+ this.view.dispatch(this.view.state.tr.setMeta(U, n)), this.editor.getExtension(f)?.unfreezeMenu();
507
+ };
508
+ destroy() {
509
+ this.view.dom.removeEventListener("mousedown", this.mouseDownHandler), document.body.removeEventListener("mousemove", this.mouseMoveHandler), document.body.removeEventListener("mouseup", this.mouseUpHandler);
510
+ }
511
+ }, G = (e) => new c({
512
+ key: U,
513
+ props: { decorations: (e) => {
514
+ let t = U.getState(e);
515
+ return !t || t.type === "default" ? h.empty : h.create(e.doc, [m.node(t.leftColumn.posBeforeNode, t.leftColumn.posBeforeNode + t.leftColumn.node.nodeSize, { style: "box-shadow: 4px 0 0 #ccc; cursor: col-resize" }), m.node(t.rightColumn.posBeforeNode, t.rightColumn.posBeforeNode + t.rightColumn.node.nodeSize, { style: "cursor: col-resize" })]);
516
+ } },
517
+ state: {
518
+ init: () => ({ type: "default" }),
519
+ apply: (e, t) => {
520
+ let n = e.getMeta(U);
521
+ return n === void 0 ? t : n;
522
+ }
523
+ },
524
+ view: (t) => new W(e, t)
525
+ }), K = (e) => u.create({
526
+ name: "columnResize",
527
+ addProseMirrorPlugins() {
528
+ return [G(e)];
529
+ }
530
+ }), q = d.create({
531
+ name: "column",
532
+ group: "bnBlock childContainer",
533
+ content: "blockContainer+",
534
+ priority: 40,
535
+ defining: !0,
536
+ marks: "deletion insertion modification",
537
+ addAttributes() {
538
+ return { width: {
539
+ default: 1,
540
+ parseHTML: (e) => {
541
+ let t = e.getAttribute("data-width");
542
+ if (t === null) return null;
543
+ let n = parseFloat(t);
544
+ return isFinite(n) ? n : null;
545
+ },
546
+ renderHTML: (e) => ({
547
+ "data-width": e.width.toString(),
548
+ style: `flex-grow: ${e.width};`
549
+ })
550
+ } };
551
+ },
552
+ parseHTML() {
553
+ return [{
554
+ tag: "div",
555
+ getAttrs: (e) => typeof e == "string" ? !1 : e.getAttribute("data-node-type") === this.name ? {} : !1
556
+ }];
557
+ },
558
+ renderHTML({ HTMLAttributes: e }) {
559
+ let t = document.createElement("div");
560
+ t.className = "bn-block-column", t.setAttribute("data-node-type", this.name);
561
+ for (let [n, r] of Object.entries(e)) t.setAttribute(n, r);
562
+ return {
563
+ dom: t,
564
+ contentDOM: t
565
+ };
566
+ },
567
+ addExtensions() {
568
+ return [K(this.options.editor)];
569
+ }
570
+ }), J = d.create({
571
+ name: "columnList",
572
+ group: "childContainer bnBlock blockGroupChild",
573
+ content: "column column+",
574
+ priority: 40,
575
+ defining: !0,
576
+ marks: "deletion insertion modification",
577
+ parseHTML() {
578
+ return [{
579
+ tag: "div",
580
+ getAttrs: (e) => typeof e == "string" ? !1 : e.getAttribute("data-node-type") === this.name ? {} : !1
581
+ }];
582
+ },
583
+ renderHTML({ HTMLAttributes: e }) {
584
+ let t = document.createElement("div");
585
+ t.className = "bn-block-column-list", t.setAttribute("data-node-type", this.name);
586
+ for (let [n, r] of Object.entries(e)) t.setAttribute(n, r);
587
+ return t.style.display = "flex", {
588
+ dom: t,
589
+ contentDOM: t
590
+ };
591
+ }
592
+ }), Y = n({
593
+ node: q,
594
+ type: "column",
595
+ content: "none"
596
+ }, { width: { default: 1 } }, [H()]), X = n({
597
+ node: J,
598
+ type: "columnList",
599
+ content: "none"
600
+ }, {}), Z = e.create({ blockSpecs: {
601
+ column: Y,
602
+ columnList: X
603
+ } }), Q = (e) => e.extend({ blockSpecs: {
604
+ column: Y,
605
+ columnList: X
606
+ } });
607
+ //#endregion
608
+ //#region src/extensions/SuggestionMenu/getMultiColumnSlashMenuItems.tsx
609
+ function $(e) {
610
+ return "column" in e.schema.blockSchema && e.schema.blockSchema.columnList === Z.blockSchema.columnList && "column" in e.schema.blockSchema && e.schema.blockSchema.column === Z.blockSchema.column;
768
611
  }
769
- function We(e) {
770
- const t = [];
771
- return Ne(e) && t.push(
772
- {
773
- ...N(e).slash_menu.two_columns,
774
- icon: /* @__PURE__ */ S(xe, { size: 18 }),
775
- onItemClick: () => {
776
- P(e, {
777
- type: "columnList",
778
- children: [
779
- {
780
- type: "column",
781
- children: [
782
- {
783
- type: "paragraph"
784
- }
785
- ]
786
- },
787
- {
788
- type: "column",
789
- children: [
790
- {
791
- type: "paragraph"
792
- }
793
- ]
794
- }
795
- ]
796
- });
797
- }
798
- },
799
- {
800
- ...N(e).slash_menu.three_columns,
801
- icon: /* @__PURE__ */ S(Se, { size: 18 }),
802
- onItemClick: () => {
803
- P(e, {
804
- type: "columnList",
805
- children: [
806
- {
807
- type: "column",
808
- children: [
809
- {
810
- type: "paragraph"
811
- }
812
- ]
813
- },
814
- {
815
- type: "column",
816
- children: [
817
- {
818
- type: "paragraph"
819
- }
820
- ]
821
- },
822
- {
823
- type: "column",
824
- children: [
825
- {
826
- type: "paragraph"
827
- }
828
- ]
829
- }
830
- ]
831
- });
832
- }
833
- }
834
- ), t;
612
+ function ee(e) {
613
+ let t = [];
614
+ return $(e) && t.push({
615
+ ...L(e).slash_menu.two_columns,
616
+ icon: /* @__PURE__ */ v(g, { size: 18 }),
617
+ onItemClick: () => {
618
+ p(e, {
619
+ type: "columnList",
620
+ children: [{
621
+ type: "column",
622
+ children: [{ type: "paragraph" }]
623
+ }, {
624
+ type: "column",
625
+ children: [{ type: "paragraph" }]
626
+ }]
627
+ });
628
+ }
629
+ }, {
630
+ ...L(e).slash_menu.three_columns,
631
+ icon: /* @__PURE__ */ v(_, { size: 18 }),
632
+ onItemClick: () => {
633
+ p(e, {
634
+ type: "columnList",
635
+ children: [
636
+ {
637
+ type: "column",
638
+ children: [{ type: "paragraph" }]
639
+ },
640
+ {
641
+ type: "column",
642
+ children: [{ type: "paragraph" }]
643
+ },
644
+ {
645
+ type: "column",
646
+ children: [{ type: "paragraph" }]
647
+ }
648
+ ]
649
+ });
650
+ }
651
+ }), t;
835
652
  }
836
- export {
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
847
- };
848
- //# sourceMappingURL=blocknote-xl-multi-column.js.map
653
+ //#endregion
654
+ export { Y as ColumnBlock, X as ColumnListBlock, $ as checkMultiColumnBlocksInSchema, z as detectEdgePosition, L as getMultiColumnDictionary, ee as getMultiColumnSlashMenuItems, I as locales, B as multiColumnDropCursor, Z as multiColumnSchema, Q as withMultiColumn };
655
+
656
+ //# sourceMappingURL=blocknote-xl-multi-column.js.map