@tiptap/vue-2 3.0.7 → 3.0.9

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.
@@ -48,6 +48,15 @@ interface BubbleMenuPluginProps {
48
48
  from: number;
49
49
  to: number;
50
50
  }) => boolean) | null;
51
+ /**
52
+ * The DOM element to append your menu to. Default is the editor's parent element.
53
+ *
54
+ * Sometimes the menu needs to be appended to a different DOM context due to accessibility, clipping, or z-index issues.
55
+ *
56
+ * @type {HTMLElement}
57
+ * @default null
58
+ */
59
+ appendTo?: HTMLElement;
51
60
  /**
52
61
  * The options for the bubble menu. Those are passed to Floating UI and include options for the placement, offset, flip, shift, arrow, size, autoPlacement,
53
62
  * hide, and inline middlewares.
@@ -48,6 +48,15 @@ interface BubbleMenuPluginProps {
48
48
  from: number;
49
49
  to: number;
50
50
  }) => boolean) | null;
51
+ /**
52
+ * The DOM element to append your menu to. Default is the editor's parent element.
53
+ *
54
+ * Sometimes the menu needs to be appended to a different DOM context due to accessibility, clipping, or z-index issues.
55
+ *
56
+ * @type {HTMLElement}
57
+ * @default null
58
+ */
59
+ appendTo?: HTMLElement;
51
60
  /**
52
61
  * The options for the bubble menu. Those are passed to Floating UI and include options for the placement, offset, flip, shift, arrow, size, autoPlacement,
53
62
  * hide, and inline middlewares.
@@ -1607,6 +1607,7 @@ var BubbleMenuView = class {
1607
1607
  updateDelay = 250,
1608
1608
  resizeDelay = 60,
1609
1609
  shouldShow,
1610
+ appendTo,
1610
1611
  options
1611
1612
  }) {
1612
1613
  this.preventHide = false;
@@ -1701,6 +1702,7 @@ var BubbleMenuView = class {
1701
1702
  this.view = view;
1702
1703
  this.updateDelay = updateDelay;
1703
1704
  this.resizeDelay = resizeDelay;
1705
+ this.appendTo = appendTo;
1704
1706
  this.floatingUIOptions = {
1705
1707
  ...this.floatingUIOptions,
1706
1708
  ...options
@@ -1826,13 +1828,13 @@ var BubbleMenuView = class {
1826
1828
  return shouldShow;
1827
1829
  }
1828
1830
  show() {
1829
- var _a;
1831
+ var _a, _b;
1830
1832
  if (this.isVisible) {
1831
1833
  return;
1832
1834
  }
1833
1835
  this.element.style.visibility = "visible";
1834
1836
  this.element.style.opacity = "1";
1835
- (_a = this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
1837
+ (_b = (_a = this.appendTo) != null ? _a : this.view.dom.parentElement) == null ? void 0 : _b.appendChild(this.element);
1836
1838
  if (this.floatingUIOptions.onShow) {
1837
1839
  this.floatingUIOptions.onShow();
1838
1840
  }
@@ -1875,6 +1877,7 @@ var BubbleMenu = Extension.create({
1875
1877
  element: null,
1876
1878
  pluginKey: "bubbleMenu",
1877
1879
  updateDelay: void 0,
1880
+ appendTo: void 0,
1878
1881
  shouldShow: null
1879
1882
  };
1880
1883
  },
@@ -1889,6 +1892,7 @@ var BubbleMenu = Extension.create({
1889
1892
  element: this.options.element,
1890
1893
  updateDelay: this.options.updateDelay,
1891
1894
  options: this.options.options,
1895
+ appendTo: this.options.appendTo,
1892
1896
  shouldShow: this.options.shouldShow
1893
1897
  })
1894
1898
  ];