@tiptap/vue-2 3.4.6 → 3.5.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.
- package/dist/menus/index.cjs +17 -2
- package/dist/menus/index.cjs.map +1 -1
- package/dist/menus/index.d.cts +12 -0
- package/dist/menus/index.d.ts +12 -0
- package/dist/menus/index.js +17 -2
- package/dist/menus/index.js.map +1 -1
- package/package.json +7 -7
- package/src/menus/BubbleMenu.ts +1 -1
- package/src/menus/FloatingMenu.ts +1 -1
package/dist/menus/index.cjs
CHANGED
|
@@ -1747,6 +1747,7 @@ var BubbleMenuView = class {
|
|
|
1747
1747
|
this.view.dom.addEventListener("dragstart", this.dragstartHandler);
|
|
1748
1748
|
this.editor.on("focus", this.focusHandler);
|
|
1749
1749
|
this.editor.on("blur", this.blurHandler);
|
|
1750
|
+
this.editor.on("transaction", this.transactionHandler);
|
|
1750
1751
|
window.addEventListener("resize", this.resizeHandler);
|
|
1751
1752
|
this.scrollTarget.addEventListener("scroll", this.resizeHandler);
|
|
1752
1753
|
this.update(view, view.state);
|
|
@@ -1910,6 +1911,12 @@ var BubbleMenuView = class {
|
|
|
1910
1911
|
}
|
|
1911
1912
|
this.isVisible = false;
|
|
1912
1913
|
}
|
|
1914
|
+
transactionHandler({ transaction: tr }) {
|
|
1915
|
+
const meta = tr.getMeta("bubbleMenu");
|
|
1916
|
+
if (meta === "updatePosition") {
|
|
1917
|
+
this.updatePosition();
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1913
1920
|
destroy() {
|
|
1914
1921
|
this.hide();
|
|
1915
1922
|
this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
|
|
@@ -1918,6 +1925,7 @@ var BubbleMenuView = class {
|
|
|
1918
1925
|
this.scrollTarget.removeEventListener("scroll", this.resizeHandler);
|
|
1919
1926
|
this.editor.off("focus", this.focusHandler);
|
|
1920
1927
|
this.editor.off("blur", this.blurHandler);
|
|
1928
|
+
this.editor.off("transaction", this.transactionHandler);
|
|
1921
1929
|
if (this.floatingUIOptions.onDestroy) {
|
|
1922
1930
|
this.floatingUIOptions.onDestroy();
|
|
1923
1931
|
}
|
|
@@ -1956,6 +1964,13 @@ var BubbleMenu = import_core2.Extension.create({
|
|
|
1956
1964
|
shouldShow: this.options.shouldShow
|
|
1957
1965
|
})
|
|
1958
1966
|
];
|
|
1967
|
+
},
|
|
1968
|
+
addCommands() {
|
|
1969
|
+
return {
|
|
1970
|
+
updateBubbleMenuPosition: () => ({ commands }) => {
|
|
1971
|
+
return commands.setMeta("bubbleMenu", "updatePosition");
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1959
1974
|
}
|
|
1960
1975
|
});
|
|
1961
1976
|
|
|
@@ -2015,7 +2030,7 @@ var BubbleMenu2 = {
|
|
|
2015
2030
|
}
|
|
2016
2031
|
},
|
|
2017
2032
|
render(createElement) {
|
|
2018
|
-
return createElement("div", {
|
|
2033
|
+
return createElement("div", {}, this.$slots.default);
|
|
2019
2034
|
},
|
|
2020
2035
|
beforeDestroy() {
|
|
2021
2036
|
this.editor.unregisterPlugin(this.pluginKey);
|
|
@@ -2303,7 +2318,7 @@ var FloatingMenu2 = {
|
|
|
2303
2318
|
}
|
|
2304
2319
|
},
|
|
2305
2320
|
render(createElement) {
|
|
2306
|
-
return createElement("div", {
|
|
2321
|
+
return createElement("div", {}, this.$slots.default);
|
|
2307
2322
|
},
|
|
2308
2323
|
beforeDestroy() {
|
|
2309
2324
|
this.editor.unregisterPlugin(this.pluginKey);
|