@tiptap/vue-2 3.0.8 → 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 +19 -2
- package/dist/menus/index.cjs.map +1 -1
- package/dist/menus/index.d.cts +9 -0
- package/dist/menus/index.d.ts +9 -0
- package/dist/menus/index.js +20 -3
- package/dist/menus/index.js.map +1 -1
- package/package.json +7 -7
package/dist/menus/index.cjs
CHANGED
|
@@ -1634,6 +1634,7 @@ var BubbleMenuView = class {
|
|
|
1634
1634
|
updateDelay = 250,
|
|
1635
1635
|
resizeDelay = 60,
|
|
1636
1636
|
shouldShow,
|
|
1637
|
+
appendTo,
|
|
1637
1638
|
options
|
|
1638
1639
|
}) {
|
|
1639
1640
|
this.preventHide = false;
|
|
@@ -1728,6 +1729,7 @@ var BubbleMenuView = class {
|
|
|
1728
1729
|
this.view = view;
|
|
1729
1730
|
this.updateDelay = updateDelay;
|
|
1730
1731
|
this.resizeDelay = resizeDelay;
|
|
1732
|
+
this.appendTo = appendTo;
|
|
1731
1733
|
this.floatingUIOptions = {
|
|
1732
1734
|
...this.floatingUIOptions,
|
|
1733
1735
|
...options
|
|
@@ -1791,6 +1793,19 @@ var BubbleMenuView = class {
|
|
|
1791
1793
|
getBoundingClientRect: () => domRect,
|
|
1792
1794
|
getClientRects: () => [domRect]
|
|
1793
1795
|
};
|
|
1796
|
+
if (selection instanceof import_state.NodeSelection) {
|
|
1797
|
+
let node = this.view.nodeDOM(selection.from);
|
|
1798
|
+
const nodeViewWrapper = node.dataset.nodeViewWrapper ? node : node.querySelector("[data-node-view-wrapper]");
|
|
1799
|
+
if (nodeViewWrapper) {
|
|
1800
|
+
node = nodeViewWrapper;
|
|
1801
|
+
}
|
|
1802
|
+
if (node) {
|
|
1803
|
+
virtualElement = {
|
|
1804
|
+
getBoundingClientRect: () => node.getBoundingClientRect(),
|
|
1805
|
+
getClientRects: () => [node.getBoundingClientRect()]
|
|
1806
|
+
};
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1794
1809
|
if (selection instanceof import_tables.CellSelection) {
|
|
1795
1810
|
const { $anchorCell, $headCell } = selection;
|
|
1796
1811
|
const from = $anchorCell ? $anchorCell.pos : $headCell.pos;
|
|
@@ -1853,13 +1868,13 @@ var BubbleMenuView = class {
|
|
|
1853
1868
|
return shouldShow;
|
|
1854
1869
|
}
|
|
1855
1870
|
show() {
|
|
1856
|
-
var _a;
|
|
1871
|
+
var _a, _b;
|
|
1857
1872
|
if (this.isVisible) {
|
|
1858
1873
|
return;
|
|
1859
1874
|
}
|
|
1860
1875
|
this.element.style.visibility = "visible";
|
|
1861
1876
|
this.element.style.opacity = "1";
|
|
1862
|
-
(_a = this.view.dom.parentElement) == null ? void 0 :
|
|
1877
|
+
(_b = (_a = this.appendTo) != null ? _a : this.view.dom.parentElement) == null ? void 0 : _b.appendChild(this.element);
|
|
1863
1878
|
if (this.floatingUIOptions.onShow) {
|
|
1864
1879
|
this.floatingUIOptions.onShow();
|
|
1865
1880
|
}
|
|
@@ -1902,6 +1917,7 @@ var BubbleMenu = import_core2.Extension.create({
|
|
|
1902
1917
|
element: null,
|
|
1903
1918
|
pluginKey: "bubbleMenu",
|
|
1904
1919
|
updateDelay: void 0,
|
|
1920
|
+
appendTo: void 0,
|
|
1905
1921
|
shouldShow: null
|
|
1906
1922
|
};
|
|
1907
1923
|
},
|
|
@@ -1916,6 +1932,7 @@ var BubbleMenu = import_core2.Extension.create({
|
|
|
1916
1932
|
element: this.options.element,
|
|
1917
1933
|
updateDelay: this.options.updateDelay,
|
|
1918
1934
|
options: this.options.options,
|
|
1935
|
+
appendTo: this.options.appendTo,
|
|
1919
1936
|
shouldShow: this.options.shouldShow
|
|
1920
1937
|
})
|
|
1921
1938
|
];
|