@tiptap/vue-2 3.4.5 → 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.d.cts
CHANGED
|
@@ -93,6 +93,18 @@ interface BubbleMenuPluginProps {
|
|
|
93
93
|
scrollTarget?: HTMLElement | Window;
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
+
declare module '@tiptap/core' {
|
|
97
|
+
interface Commands<ReturnType> {
|
|
98
|
+
bubbleMenu: {
|
|
99
|
+
/**
|
|
100
|
+
* Update the position of the bubble menu. This command is useful to force
|
|
101
|
+
* the bubble menu to update its position in response to certain events
|
|
102
|
+
* (for example, when the bubble menu is resized).
|
|
103
|
+
*/
|
|
104
|
+
updateBubbleMenuPosition: () => ReturnType;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
96
108
|
|
|
97
109
|
interface BubbleMenuInterface extends Vue {
|
|
98
110
|
pluginKey: BubbleMenuPluginProps['pluginKey'];
|
package/dist/menus/index.d.ts
CHANGED
|
@@ -93,6 +93,18 @@ interface BubbleMenuPluginProps {
|
|
|
93
93
|
scrollTarget?: HTMLElement | Window;
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
+
declare module '@tiptap/core' {
|
|
97
|
+
interface Commands<ReturnType> {
|
|
98
|
+
bubbleMenu: {
|
|
99
|
+
/**
|
|
100
|
+
* Update the position of the bubble menu. This command is useful to force
|
|
101
|
+
* the bubble menu to update its position in response to certain events
|
|
102
|
+
* (for example, when the bubble menu is resized).
|
|
103
|
+
*/
|
|
104
|
+
updateBubbleMenuPosition: () => ReturnType;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
96
108
|
|
|
97
109
|
interface BubbleMenuInterface extends Vue {
|
|
98
110
|
pluginKey: BubbleMenuPluginProps['pluginKey'];
|
package/dist/menus/index.js
CHANGED
|
@@ -1720,6 +1720,7 @@ var BubbleMenuView = class {
|
|
|
1720
1720
|
this.view.dom.addEventListener("dragstart", this.dragstartHandler);
|
|
1721
1721
|
this.editor.on("focus", this.focusHandler);
|
|
1722
1722
|
this.editor.on("blur", this.blurHandler);
|
|
1723
|
+
this.editor.on("transaction", this.transactionHandler);
|
|
1723
1724
|
window.addEventListener("resize", this.resizeHandler);
|
|
1724
1725
|
this.scrollTarget.addEventListener("scroll", this.resizeHandler);
|
|
1725
1726
|
this.update(view, view.state);
|
|
@@ -1883,6 +1884,12 @@ var BubbleMenuView = class {
|
|
|
1883
1884
|
}
|
|
1884
1885
|
this.isVisible = false;
|
|
1885
1886
|
}
|
|
1887
|
+
transactionHandler({ transaction: tr }) {
|
|
1888
|
+
const meta = tr.getMeta("bubbleMenu");
|
|
1889
|
+
if (meta === "updatePosition") {
|
|
1890
|
+
this.updatePosition();
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1886
1893
|
destroy() {
|
|
1887
1894
|
this.hide();
|
|
1888
1895
|
this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
|
|
@@ -1891,6 +1898,7 @@ var BubbleMenuView = class {
|
|
|
1891
1898
|
this.scrollTarget.removeEventListener("scroll", this.resizeHandler);
|
|
1892
1899
|
this.editor.off("focus", this.focusHandler);
|
|
1893
1900
|
this.editor.off("blur", this.blurHandler);
|
|
1901
|
+
this.editor.off("transaction", this.transactionHandler);
|
|
1894
1902
|
if (this.floatingUIOptions.onDestroy) {
|
|
1895
1903
|
this.floatingUIOptions.onDestroy();
|
|
1896
1904
|
}
|
|
@@ -1929,6 +1937,13 @@ var BubbleMenu = Extension.create({
|
|
|
1929
1937
|
shouldShow: this.options.shouldShow
|
|
1930
1938
|
})
|
|
1931
1939
|
];
|
|
1940
|
+
},
|
|
1941
|
+
addCommands() {
|
|
1942
|
+
return {
|
|
1943
|
+
updateBubbleMenuPosition: () => ({ commands }) => {
|
|
1944
|
+
return commands.setMeta("bubbleMenu", "updatePosition");
|
|
1945
|
+
}
|
|
1946
|
+
};
|
|
1932
1947
|
}
|
|
1933
1948
|
});
|
|
1934
1949
|
|
|
@@ -1988,7 +2003,7 @@ var BubbleMenu2 = {
|
|
|
1988
2003
|
}
|
|
1989
2004
|
},
|
|
1990
2005
|
render(createElement) {
|
|
1991
|
-
return createElement("div", {
|
|
2006
|
+
return createElement("div", {}, this.$slots.default);
|
|
1992
2007
|
},
|
|
1993
2008
|
beforeDestroy() {
|
|
1994
2009
|
this.editor.unregisterPlugin(this.pluginKey);
|
|
@@ -2276,7 +2291,7 @@ var FloatingMenu2 = {
|
|
|
2276
2291
|
}
|
|
2277
2292
|
},
|
|
2278
2293
|
render(createElement) {
|
|
2279
|
-
return createElement("div", {
|
|
2294
|
+
return createElement("div", {}, this.$slots.default);
|
|
2280
2295
|
},
|
|
2281
2296
|
beforeDestroy() {
|
|
2282
2297
|
this.editor.unregisterPlugin(this.pluginKey);
|