prosemirror-slash-menu-react 0.0.7 → 0.0.8

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/index.es.js CHANGED
@@ -219,7 +219,8 @@ const SlashMenuReact = ({ editorState, editorView, icons, rightIcons, subMenuIco
219
219
  const virtualReference = useMemo(() => {
220
220
  var _a;
221
221
  const domNode = (_a = editorView.domAtPos(editorState.selection.to)) === null || _a === void 0 ? void 0 : _a.node;
222
- const cursorLeft = editorView.coordsAtPos(editorState.selection.to).left;
222
+ const cursorPosition = editorView.state.selection.to;
223
+ const cursorLeft = editorView.coordsAtPos(cursorPosition).left;
223
224
  if (!(domNode instanceof HTMLElement))
224
225
  return;
225
226
  const { top, height } = domNode.getBoundingClientRect();
@@ -247,10 +248,8 @@ const SlashMenuReact = ({ editorState, editorView, icons, rightIcons, subMenuIco
247
248
  };
248
249
  },
249
250
  };
250
- }, [editorState, window.scrollY]);
251
+ }, [editorView, editorState, window.scrollY]);
251
252
  const offsetModifier = useMemo(() => {
252
- const filterElement = document.getElementById("menu-filter-wrapper");
253
- filterElement === null || filterElement === void 0 ? void 0 : filterElement.getBoundingClientRect().top;
254
253
  return {
255
254
  name: "offset",
256
255
  options: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.js CHANGED
@@ -227,7 +227,8 @@ const SlashMenuReact = ({ editorState, editorView, icons, rightIcons, subMenuIco
227
227
  const virtualReference = React.useMemo(() => {
228
228
  var _a;
229
229
  const domNode = (_a = editorView.domAtPos(editorState.selection.to)) === null || _a === void 0 ? void 0 : _a.node;
230
- const cursorLeft = editorView.coordsAtPos(editorState.selection.to).left;
230
+ const cursorPosition = editorView.state.selection.to;
231
+ const cursorLeft = editorView.coordsAtPos(cursorPosition).left;
231
232
  if (!(domNode instanceof HTMLElement))
232
233
  return;
233
234
  const { top, height } = domNode.getBoundingClientRect();
@@ -255,10 +256,8 @@ const SlashMenuReact = ({ editorState, editorView, icons, rightIcons, subMenuIco
255
256
  };
256
257
  },
257
258
  };
258
- }, [editorState, window.scrollY]);
259
+ }, [editorView, editorState, window.scrollY]);
259
260
  const offsetModifier = React.useMemo(() => {
260
- const filterElement = document.getElementById("menu-filter-wrapper");
261
- filterElement === null || filterElement === void 0 ? void 0 : filterElement.getBoundingClientRect().top;
262
261
  return {
263
262
  name: "offset",
264
263
  options: {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prosemirror-slash-menu-react",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Implementation of prosemirror-slash-menu in react",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -84,6 +84,7 @@
84
84
  "dev": "rollup -c -w --bundleConfigAsCjs",
85
85
  "yalc:watch": "nodemon --watch dist --exec 'yalc push'",
86
86
  "lint": "tsc --noEmit && eslint src --ext .ts",
87
+ "lint:fix": "eslint src --ext .ts --fix",
87
88
  "dev:watch": "npm-run-all --parallel dev yalc:watch"
88
89
  }
89
90
  }