@tiptap/vue-2 3.0.9 → 3.1.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 +13 -0
- package/dist/menus/index.cjs.map +1 -1
- package/dist/menus/index.js +14 -1
- package/dist/menus/index.js.map +1 -1
- package/package.json +7 -7
package/dist/menus/index.js
CHANGED
|
@@ -1586,7 +1586,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
1586
1586
|
|
|
1587
1587
|
// ../extension-bubble-menu/dist/index.js
|
|
1588
1588
|
import { isTextSelection, posToDOMRect } from "@tiptap/core";
|
|
1589
|
-
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
|
1589
|
+
import { NodeSelection, Plugin, PluginKey } from "@tiptap/pm/state";
|
|
1590
1590
|
import { CellSelection } from "@tiptap/pm/tables";
|
|
1591
1591
|
function combineDOMRects(rect1, rect2) {
|
|
1592
1592
|
const top = Math.min(rect1.top, rect2.top);
|
|
@@ -1766,6 +1766,19 @@ var BubbleMenuView = class {
|
|
|
1766
1766
|
getBoundingClientRect: () => domRect,
|
|
1767
1767
|
getClientRects: () => [domRect]
|
|
1768
1768
|
};
|
|
1769
|
+
if (selection instanceof NodeSelection) {
|
|
1770
|
+
let node = this.view.nodeDOM(selection.from);
|
|
1771
|
+
const nodeViewWrapper = node.dataset.nodeViewWrapper ? node : node.querySelector("[data-node-view-wrapper]");
|
|
1772
|
+
if (nodeViewWrapper) {
|
|
1773
|
+
node = nodeViewWrapper;
|
|
1774
|
+
}
|
|
1775
|
+
if (node) {
|
|
1776
|
+
virtualElement = {
|
|
1777
|
+
getBoundingClientRect: () => node.getBoundingClientRect(),
|
|
1778
|
+
getClientRects: () => [node.getBoundingClientRect()]
|
|
1779
|
+
};
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1769
1782
|
if (selection instanceof CellSelection) {
|
|
1770
1783
|
const { $anchorCell, $headCell } = selection;
|
|
1771
1784
|
const from = $anchorCell ? $anchorCell.pos : $headCell.pos;
|