@tiptap/vue-2 3.0.0-beta.0 → 3.0.0-beta.1

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.
@@ -1868,19 +1868,18 @@ var BubbleMenu = {
1868
1868
  }
1869
1869
  };
1870
1870
 
1871
- // ../extension-floating-menu/dist/index.js
1872
- import { Extension } from "@tiptap/core";
1871
+ // ../extension-floating-menu/src/floating-menu-plugin.ts
1873
1872
  import { getText, getTextSerializersFromSchema, posToDOMRect as posToDOMRect2 } from "@tiptap/core";
1874
1873
  import { Plugin as Plugin2, PluginKey as PluginKey2 } from "@tiptap/pm/state";
1875
1874
  var FloatingMenuView = class {
1876
1875
  constructor({ editor, element, view, options, shouldShow }) {
1877
1876
  this.preventHide = false;
1878
- this.shouldShow = ({ view: view2, state }) => {
1877
+ this.shouldShow = ({ view, state }) => {
1879
1878
  const { selection } = state;
1880
1879
  const { $anchor, empty } = selection;
1881
1880
  const isRootDepth = $anchor.depth === 1;
1882
1881
  const isEmptyTextBlock = $anchor.parent.isTextblock && !$anchor.parent.type.spec.code && !$anchor.parent.textContent && $anchor.parent.childCount === 0 && !this.getTextContent($anchor.parent);
1883
- if (!view2.hasFocus() || !empty || !isRootDepth || !isEmptyTextBlock || !this.editor.isEditable) {
1882
+ if (!view.hasFocus() || !empty || !isRootDepth || !isEmptyTextBlock || !this.editor.isEditable) {
1884
1883
  return false;
1885
1884
  }
1886
1885
  return true;
@@ -1897,14 +1896,14 @@ var FloatingMenuView = class {
1897
1896
  hide: false,
1898
1897
  inline: false
1899
1898
  };
1900
- this.updateHandler = (view2, selectionChanged, docChanged, oldState) => {
1901
- const { composing } = view2;
1899
+ this.updateHandler = (view, selectionChanged, docChanged, oldState) => {
1900
+ const { composing } = view;
1902
1901
  const isSame = !selectionChanged && !docChanged;
1903
1902
  if (composing || isSame) {
1904
1903
  return;
1905
1904
  }
1906
- const shouldShow2 = this.getShouldShow(oldState);
1907
- if (!shouldShow2) {
1905
+ const shouldShow = this.getShouldShow(oldState);
1906
+ if (!shouldShow) {
1908
1907
  this.hide();
1909
1908
  return;
1910
1909
  }
@@ -2052,34 +2051,9 @@ var FloatingMenuPlugin = (options) => {
2052
2051
  view: (view) => new FloatingMenuView({ view, ...options })
2053
2052
  });
2054
2053
  };
2055
- var FloatingMenu = Extension.create({
2056
- name: "floatingMenu",
2057
- addOptions() {
2058
- return {
2059
- element: null,
2060
- options: {},
2061
- pluginKey: "floatingMenu",
2062
- shouldShow: null
2063
- };
2064
- },
2065
- addProseMirrorPlugins() {
2066
- if (!this.options.element) {
2067
- return [];
2068
- }
2069
- return [
2070
- FloatingMenuPlugin({
2071
- pluginKey: this.options.pluginKey,
2072
- editor: this.editor,
2073
- element: this.options.element,
2074
- options: this.options.options,
2075
- shouldShow: this.options.shouldShow
2076
- })
2077
- ];
2078
- }
2079
- });
2080
2054
 
2081
2055
  // src/menus/FloatingMenu.ts
2082
- var FloatingMenu2 = {
2056
+ var FloatingMenu = {
2083
2057
  name: "FloatingMenu",
2084
2058
  props: {
2085
2059
  pluginKey: {
@@ -2133,6 +2107,6 @@ var FloatingMenu2 = {
2133
2107
  };
2134
2108
  export {
2135
2109
  BubbleMenu,
2136
- FloatingMenu2 as FloatingMenu
2110
+ FloatingMenu
2137
2111
  };
2138
2112
  //# sourceMappingURL=index.js.map