@tiptap/vue-2 3.4.1 → 3.4.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.
package/dist/menus/index.d.cts
CHANGED
|
@@ -78,6 +78,12 @@ interface BubbleMenuPluginProps {
|
|
|
78
78
|
onHide?: () => void;
|
|
79
79
|
onUpdate?: () => void;
|
|
80
80
|
onDestroy?: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* The scrollable element that should be listened to when updating the position of the bubble menu.
|
|
83
|
+
* If not provided, the window will be used.
|
|
84
|
+
* @type {HTMLElement | Window}
|
|
85
|
+
*/
|
|
86
|
+
scrollTarget?: HTMLElement | Window;
|
|
81
87
|
};
|
|
82
88
|
}
|
|
83
89
|
|
package/dist/menus/index.d.ts
CHANGED
|
@@ -78,6 +78,12 @@ interface BubbleMenuPluginProps {
|
|
|
78
78
|
onHide?: () => void;
|
|
79
79
|
onUpdate?: () => void;
|
|
80
80
|
onDestroy?: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* The scrollable element that should be listened to when updating the position of the bubble menu.
|
|
83
|
+
* If not provided, the window will be used.
|
|
84
|
+
* @type {HTMLElement | Window}
|
|
85
|
+
*/
|
|
86
|
+
scrollTarget?: HTMLElement | Window;
|
|
81
87
|
};
|
|
82
88
|
}
|
|
83
89
|
|
package/dist/menus/index.js
CHANGED
|
@@ -1612,6 +1612,7 @@ var BubbleMenuView = class {
|
|
|
1612
1612
|
}) {
|
|
1613
1613
|
this.preventHide = false;
|
|
1614
1614
|
this.isVisible = false;
|
|
1615
|
+
this.scrollTarget = window;
|
|
1615
1616
|
this.floatingUIOptions = {
|
|
1616
1617
|
strategy: "absolute",
|
|
1617
1618
|
placement: "top",
|
|
@@ -1657,12 +1658,12 @@ var BubbleMenuView = class {
|
|
|
1657
1658
|
setTimeout(() => this.update(this.editor.view));
|
|
1658
1659
|
};
|
|
1659
1660
|
this.blurHandler = ({ event }) => {
|
|
1660
|
-
var
|
|
1661
|
+
var _a2;
|
|
1661
1662
|
if (this.preventHide) {
|
|
1662
1663
|
this.preventHide = false;
|
|
1663
1664
|
return;
|
|
1664
1665
|
}
|
|
1665
|
-
if ((event == null ? void 0 : event.relatedTarget) && ((
|
|
1666
|
+
if ((event == null ? void 0 : event.relatedTarget) && ((_a2 = this.element.parentNode) == null ? void 0 : _a2.contains(event.relatedTarget))) {
|
|
1666
1667
|
return;
|
|
1667
1668
|
}
|
|
1668
1669
|
if ((event == null ? void 0 : event.relatedTarget) === this.editor.view.dom) {
|
|
@@ -1697,12 +1698,14 @@ var BubbleMenuView = class {
|
|
|
1697
1698
|
this.updatePosition();
|
|
1698
1699
|
this.show();
|
|
1699
1700
|
};
|
|
1701
|
+
var _a;
|
|
1700
1702
|
this.editor = editor;
|
|
1701
1703
|
this.element = element;
|
|
1702
1704
|
this.view = view;
|
|
1703
1705
|
this.updateDelay = updateDelay;
|
|
1704
1706
|
this.resizeDelay = resizeDelay;
|
|
1705
1707
|
this.appendTo = appendTo;
|
|
1708
|
+
this.scrollTarget = (_a = options == null ? void 0 : options.scrollTarget) != null ? _a : window;
|
|
1706
1709
|
this.floatingUIOptions = {
|
|
1707
1710
|
...this.floatingUIOptions,
|
|
1708
1711
|
...options
|
|
@@ -1716,6 +1719,7 @@ var BubbleMenuView = class {
|
|
|
1716
1719
|
this.editor.on("focus", this.focusHandler);
|
|
1717
1720
|
this.editor.on("blur", this.blurHandler);
|
|
1718
1721
|
window.addEventListener("resize", this.resizeHandler);
|
|
1722
|
+
this.scrollTarget.addEventListener("scroll", this.resizeHandler);
|
|
1719
1723
|
this.update(view, view.state);
|
|
1720
1724
|
if (this.getShouldShow()) {
|
|
1721
1725
|
this.show();
|
|
@@ -1870,6 +1874,7 @@ var BubbleMenuView = class {
|
|
|
1870
1874
|
this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
|
|
1871
1875
|
this.view.dom.removeEventListener("dragstart", this.dragstartHandler);
|
|
1872
1876
|
window.removeEventListener("resize", this.resizeHandler);
|
|
1877
|
+
this.scrollTarget.removeEventListener("scroll", this.resizeHandler);
|
|
1873
1878
|
this.editor.off("focus", this.focusHandler);
|
|
1874
1879
|
this.editor.off("blur", this.blurHandler);
|
|
1875
1880
|
if (this.floatingUIOptions.onDestroy) {
|