@blocknote/xl-multi-column 0.28.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote-xl-multi-column.cjs +1 -1
- package/dist/blocknote-xl-multi-column.cjs.map +1 -1
- package/dist/blocknote-xl-multi-column.js +15 -24
- package/dist/blocknote-xl-multi-column.js.map +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +3 -3
- package/src/extensions/DropCursor/MultiColumnDropCursorPlugin.ts +4 -13
- package/src/test/commands/updateBlock.test.ts +2 -2
- package/src/test/conversions/formatConversionTestUtil.ts +197 -0
- package/src/test/conversions/htmlConversion.test.ts +4 -2
- package/src/test/conversions/nodeConversion.test.ts +3 -8
- package/src/test/conversions/testCases.ts +3 -6
- package/types/src/test/conversions/formatConversionTestUtil.d.ts +5 -0
- package/types/src/test/conversions/testCases.d.ts +1 -3
|
@@ -516,7 +516,7 @@ const be = (o) => new H({
|
|
|
516
516
|
},
|
|
517
517
|
inlineContentSpecs: o.inlineContentSpecs,
|
|
518
518
|
styleSpecs: o.styleSpecs
|
|
519
|
-
}),
|
|
519
|
+
}), _ = 0.1;
|
|
520
520
|
function ye(o) {
|
|
521
521
|
return { left: o.clientX, top: o.clientY };
|
|
522
522
|
}
|
|
@@ -524,7 +524,7 @@ function Xe(o) {
|
|
|
524
524
|
const e = o.editor;
|
|
525
525
|
return new H({
|
|
526
526
|
view(t) {
|
|
527
|
-
return new
|
|
527
|
+
return new _e(t, o);
|
|
528
528
|
},
|
|
529
529
|
props: {
|
|
530
530
|
handleDrop(t, n, r, u) {
|
|
@@ -533,21 +533,17 @@ function Xe(o) {
|
|
|
533
533
|
throw new Error("Could not get event position");
|
|
534
534
|
const l = V(t.state, c), i = Z(l), a = t.nodeDOM(l.posBeforeNode).getBoundingClientRect();
|
|
535
535
|
let s = "regular";
|
|
536
|
-
if (n.clientX <= a.left + a.width *
|
|
536
|
+
if (n.clientX <= a.left + a.width * _ && (s = "left"), n.clientX >= a.right - a.width * _ && (s = "right"), s === "regular")
|
|
537
537
|
return !1;
|
|
538
538
|
const d = S(
|
|
539
539
|
r.content.child(0),
|
|
540
|
-
e.
|
|
541
|
-
e.schema.inlineContentSchema,
|
|
542
|
-
e.schema.styleSchema
|
|
540
|
+
e.pmSchema
|
|
543
541
|
// TODO: cache?
|
|
544
542
|
);
|
|
545
543
|
if (i.blockNoteType === "column") {
|
|
546
544
|
const m = t.state.doc.resolve(i.bnBlock.beforePos).node(), h = S(
|
|
547
545
|
m,
|
|
548
|
-
e.
|
|
549
|
-
e.schema.inlineContentSchema,
|
|
550
|
-
e.schema.styleSchema
|
|
546
|
+
e.pmSchema
|
|
551
547
|
);
|
|
552
548
|
let f = 0;
|
|
553
549
|
h.children.forEach((b) => {
|
|
@@ -578,12 +574,7 @@ function Xe(o) {
|
|
|
578
574
|
children: K
|
|
579
575
|
});
|
|
580
576
|
} else {
|
|
581
|
-
const m = S(
|
|
582
|
-
i.bnBlock.node,
|
|
583
|
-
e.schema.blockSchema,
|
|
584
|
-
e.schema.inlineContentSchema,
|
|
585
|
-
e.schema.styleSchema
|
|
586
|
-
);
|
|
577
|
+
const m = S(i.bnBlock.node, e.pmSchema);
|
|
587
578
|
if (m.id === d.id)
|
|
588
579
|
return;
|
|
589
580
|
const h = s === "left" ? [d, m] : [m, d];
|
|
@@ -605,7 +596,7 @@ function Xe(o) {
|
|
|
605
596
|
}
|
|
606
597
|
});
|
|
607
598
|
}
|
|
608
|
-
class
|
|
599
|
+
class _e {
|
|
609
600
|
constructor(e, t) {
|
|
610
601
|
p(this, "width");
|
|
611
602
|
p(this, "color");
|
|
@@ -721,7 +712,7 @@ class ke {
|
|
|
721
712
|
if (t && !u) {
|
|
722
713
|
let c = "regular", l = t.pos;
|
|
723
714
|
const i = V(this.editorView.state, t), a = this.editorView.nodeDOM(i.posBeforeNode).getBoundingClientRect();
|
|
724
|
-
if (e.clientX <= a.left + a.width *
|
|
715
|
+
if (e.clientX <= a.left + a.width * _ && (c = "left", l = i.posBeforeNode), e.clientX >= a.right - a.width * _ && (c = "right", l = i.posBeforeNode), c === "regular" && this.editorView.dragging && this.editorView.dragging.slice) {
|
|
725
716
|
const s = ee(
|
|
726
717
|
this.editorView.state.doc,
|
|
727
718
|
l,
|
|
@@ -756,7 +747,7 @@ var X = {
|
|
|
756
747
|
className: void 0,
|
|
757
748
|
style: void 0,
|
|
758
749
|
attr: void 0
|
|
759
|
-
}, I = v.createContext && /* @__PURE__ */ v.createContext(X),
|
|
750
|
+
}, I = v.createContext && /* @__PURE__ */ v.createContext(X), ke = ["attr", "size", "title"];
|
|
760
751
|
function Pe(o, e) {
|
|
761
752
|
if (o == null) return {};
|
|
762
753
|
var t = Se(o, e), n, r;
|
|
@@ -777,15 +768,15 @@ function Se(o, e) {
|
|
|
777
768
|
}
|
|
778
769
|
return t;
|
|
779
770
|
}
|
|
780
|
-
function
|
|
781
|
-
return
|
|
771
|
+
function k() {
|
|
772
|
+
return k = Object.assign ? Object.assign.bind() : function(o) {
|
|
782
773
|
for (var e = 1; e < arguments.length; e++) {
|
|
783
774
|
var t = arguments[e];
|
|
784
775
|
for (var n in t)
|
|
785
776
|
Object.prototype.hasOwnProperty.call(t, n) && (o[n] = t[n]);
|
|
786
777
|
}
|
|
787
778
|
return o;
|
|
788
|
-
},
|
|
779
|
+
}, k.apply(this, arguments);
|
|
789
780
|
}
|
|
790
781
|
function L(o, e) {
|
|
791
782
|
var t = Object.keys(o);
|
|
@@ -831,7 +822,7 @@ function U(o) {
|
|
|
831
822
|
}, e.attr), U(e.child)));
|
|
832
823
|
}
|
|
833
824
|
function G(o) {
|
|
834
|
-
return (e) => /* @__PURE__ */ v.createElement(De,
|
|
825
|
+
return (e) => /* @__PURE__ */ v.createElement(De, k({
|
|
835
826
|
attr: P({}, o.attr)
|
|
836
827
|
}, e), U(o.child));
|
|
837
828
|
}
|
|
@@ -841,8 +832,8 @@ function De(o) {
|
|
|
841
832
|
attr: n,
|
|
842
833
|
size: r,
|
|
843
834
|
title: u
|
|
844
|
-
} = o, c = Pe(o,
|
|
845
|
-
return t.className && (i = t.className), o.className && (i = (i ? i + " " : "") + o.className), /* @__PURE__ */ v.createElement("svg",
|
|
835
|
+
} = o, c = Pe(o, ke), l = r || t.size || "1em", i;
|
|
836
|
+
return t.className && (i = t.className), o.className && (i = (i ? i + " " : "") + o.className), /* @__PURE__ */ v.createElement("svg", k({
|
|
846
837
|
stroke: "currentColor",
|
|
847
838
|
fill: "currentColor",
|
|
848
839
|
strokeWidth: "0"
|