@tiptap/vue-2 3.6.2 → 3.6.4

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.
@@ -56,7 +56,7 @@ interface BubbleMenuPluginProps {
56
56
  * @type {HTMLElement}
57
57
  * @default null
58
58
  */
59
- appendTo?: HTMLElement;
59
+ appendTo?: HTMLElement | (() => HTMLElement);
60
60
  /**
61
61
  * A function that returns the virtual element for the menu.
62
62
  * This is useful when the menu needs to be positioned relative to a specific DOM element.
@@ -130,7 +130,7 @@ interface FloatingMenuPluginProps {
130
130
  * @type {HTMLElement}
131
131
  * @default null
132
132
  */
133
- appendTo?: HTMLElement;
133
+ appendTo?: HTMLElement | (() => HTMLElement);
134
134
  /**
135
135
  * A function that determines whether the menu should be shown or not.
136
136
  * If this function returns `false`, the menu will be hidden, otherwise it will be shown.
@@ -56,7 +56,7 @@ interface BubbleMenuPluginProps {
56
56
  * @type {HTMLElement}
57
57
  * @default null
58
58
  */
59
- appendTo?: HTMLElement;
59
+ appendTo?: HTMLElement | (() => HTMLElement);
60
60
  /**
61
61
  * A function that returns the virtual element for the menu.
62
62
  * This is useful when the menu needs to be positioned relative to a specific DOM element.
@@ -130,7 +130,7 @@ interface FloatingMenuPluginProps {
130
130
  * @type {HTMLElement}
131
131
  * @default null
132
132
  */
133
- appendTo?: HTMLElement;
133
+ appendTo?: HTMLElement | (() => HTMLElement);
134
134
  /**
135
135
  * A function that determines whether the menu should be shown or not.
136
136
  * If this function returns `false`, the menu will be hidden, otherwise it will be shown.
@@ -1870,13 +1870,14 @@ var BubbleMenuView = class {
1870
1870
  return shouldShow;
1871
1871
  }
1872
1872
  show() {
1873
- var _a, _b;
1873
+ var _a;
1874
1874
  if (this.isVisible) {
1875
1875
  return;
1876
1876
  }
1877
1877
  this.element.style.visibility = "visible";
1878
1878
  this.element.style.opacity = "1";
1879
- (_b = (_a = this.appendTo) != null ? _a : this.view.dom.parentElement) == null ? void 0 : _b.appendChild(this.element);
1879
+ const appendToElement = typeof this.appendTo === "function" ? this.appendTo() : this.appendTo;
1880
+ (_a = appendToElement != null ? appendToElement : this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
1880
1881
  if (this.floatingUIOptions.onShow) {
1881
1882
  this.floatingUIOptions.onShow();
1882
1883
  }
@@ -2181,13 +2182,14 @@ var FloatingMenuView = class {
2181
2182
  this.updateHandler(view, selectionChanged, docChanged, oldState);
2182
2183
  }
2183
2184
  show() {
2184
- var _a, _b;
2185
+ var _a;
2185
2186
  if (this.isVisible) {
2186
2187
  return;
2187
2188
  }
2188
2189
  this.element.style.visibility = "visible";
2189
2190
  this.element.style.opacity = "1";
2190
- (_b = (_a = this.appendTo) != null ? _a : this.view.dom.parentElement) == null ? void 0 : _b.appendChild(this.element);
2191
+ const appendToElement = typeof this.appendTo === "function" ? this.appendTo() : this.appendTo;
2192
+ (_a = appendToElement != null ? appendToElement : this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
2191
2193
  if (this.floatingUIOptions.onShow) {
2192
2194
  this.floatingUIOptions.onShow();
2193
2195
  }