@tiptap/vue-2 3.18.0 → 3.20.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.
@@ -1628,6 +1628,7 @@ var BubbleMenuView = class {
1628
1628
  editor,
1629
1629
  element,
1630
1630
  view,
1631
+ pluginKey = "bubbleMenu",
1631
1632
  updateDelay = 250,
1632
1633
  resizeDelay = 60,
1633
1634
  shouldShow,
@@ -1732,8 +1733,14 @@ var BubbleMenuView = class {
1732
1733
  this.updatePosition();
1733
1734
  this.show();
1734
1735
  };
1736
+ /**
1737
+ * Handles the transaction event to update the position of the bubble menu.
1738
+ * This allows external code to trigger a position update via:
1739
+ * `editor.view.dispatch(editor.state.tr.setMeta(pluginKey, 'updatePosition'))`
1740
+ * The `pluginKey` defaults to `bubbleMenu`
1741
+ */
1735
1742
  this.transactionHandler = ({ transaction: tr }) => {
1736
- const meta = tr.getMeta("bubbleMenu");
1743
+ const meta = tr.getMeta(this.pluginKey);
1737
1744
  if (meta === "updatePosition") {
1738
1745
  this.updatePosition();
1739
1746
  } else if (meta && typeof meta === "object" && meta.type === "updateOptions") {
@@ -1744,6 +1751,7 @@ var BubbleMenuView = class {
1744
1751
  this.editor = editor;
1745
1752
  this.element = element;
1746
1753
  this.view = view;
1754
+ this.pluginKey = pluginKey;
1747
1755
  this.updateDelay = updateDelay;
1748
1756
  this.resizeDelay = resizeDelay;
1749
1757
  this.appendTo = appendTo;
@@ -2061,6 +2069,7 @@ var FloatingMenuView = class {
2061
2069
  editor,
2062
2070
  element,
2063
2071
  view,
2072
+ pluginKey = "floatingMenu",
2064
2073
  updateDelay = 250,
2065
2074
  resizeDelay = 60,
2066
2075
  options,
@@ -2129,10 +2138,11 @@ var FloatingMenuView = class {
2129
2138
  /**
2130
2139
  * Handles the transaction event to update the position of the floating menu.
2131
2140
  * This allows external code to trigger a position update via:
2132
- * `editor.view.dispatch(editor.state.tr.setMeta('floatingMenu', 'updatePosition'))`
2141
+ * `editor.view.dispatch(editor.state.tr.setMeta(pluginKey, 'updatePosition'))`
2142
+ * The `pluginKey` defaults to `floatingMenu`
2133
2143
  */
2134
2144
  this.transactionHandler = ({ transaction: tr }) => {
2135
- const meta = tr.getMeta("floatingMenu");
2145
+ const meta = tr.getMeta(this.pluginKey);
2136
2146
  if (meta === "updatePosition") {
2137
2147
  this.updatePosition();
2138
2148
  } else if (meta && typeof meta === "object" && meta.type === "updateOptions") {
@@ -2156,6 +2166,7 @@ var FloatingMenuView = class {
2156
2166
  this.editor = editor;
2157
2167
  this.element = element;
2158
2168
  this.view = view;
2169
+ this.pluginKey = pluginKey;
2159
2170
  this.updateDelay = updateDelay;
2160
2171
  this.resizeDelay = resizeDelay;
2161
2172
  this.appendTo = appendTo;