@manuscripts/body-editor 1.6.0 → 1.6.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.
@@ -68,9 +68,7 @@ const useEditor = (initialState, createView) => {
68
68
  state.doc.descendants((node, pos) => {
69
69
  if (node.attrs.id === id) {
70
70
  currentView.focus();
71
- const selection = node.isAtom
72
- ? prosemirror_state_1.NodeSelection.create(state.tr.doc, pos)
73
- : prosemirror_state_1.TextSelection.near(state.tr.doc.resolve(pos + 1));
71
+ const selection = prosemirror_state_1.NodeSelection.create(state.tr.doc, pos);
74
72
  currentView.dispatch(state.tr.setSelection(selection));
75
73
  const dom = currentView.domAtPos(pos + 1);
76
74
  if (dom.node instanceof Element) {
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { NodeSelection, TextSelection, } from 'prosemirror-state';
16
+ import { NodeSelection, } from 'prosemirror-state';
17
17
  import { useCallback, useEffect, useRef, useState } from 'react';
18
18
  import { useHistory } from 'react-router-dom';
19
19
  import { bibliographyKey } from './plugins/bibliography';
@@ -66,9 +66,7 @@ const useEditor = (initialState, createView) => {
66
66
  state.doc.descendants((node, pos) => {
67
67
  if (node.attrs.id === id) {
68
68
  currentView.focus();
69
- const selection = node.isAtom
70
- ? NodeSelection.create(state.tr.doc, pos)
71
- : TextSelection.near(state.tr.doc.resolve(pos + 1));
69
+ const selection = NodeSelection.create(state.tr.doc, pos);
72
70
  currentView.dispatch(state.tr.setSelection(selection));
73
71
  const dom = currentView.domAtPos(pos + 1);
74
72
  if (dom.node instanceof Element) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/body-editor",
3
3
  "description": "Prosemirror components for editing and viewing manuscripts",
4
- "version": "1.6.0",
4
+ "version": "1.6.1",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",