@manuscripts/body-editor 3.12.3 → 3.12.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.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MATHJAX_VERSION = exports.VERSION = void 0;
4
- exports.VERSION = '3.12.3';
4
+ exports.VERSION = '3.12.4';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -41,15 +41,15 @@ class FootnoteView extends base_node_view_1.BaseNodeView {
41
41
  this.dom.tabIndex = 0;
42
42
  this.contentDOM = document.createElement('div');
43
43
  this.contentDOM.classList.add('footnote-text');
44
- this.dom.addEventListener('mousedown', this.handleClick);
45
- this.dom.addEventListener('keydown', (0, navigation_utils_1.handleEnterKey)(this.handleClick));
44
+ this.dom.addEventListener('mousedown', (e) => this.handleClick(e, false));
45
+ this.dom.addEventListener('keydown', (0, navigation_utils_1.handleEnterKey)((e) => this.handleClick(e, true)));
46
46
  this.updateContents();
47
47
  };
48
- this.handleClick = (event) => {
48
+ this.handleClick = (event, fromKeyboard = false) => {
49
49
  const element = event.target;
50
50
  const item = element.closest('.footnote');
51
51
  if (item) {
52
- this.showContextMenu(item);
52
+ this.showContextMenu(item, fromKeyboard);
53
53
  }
54
54
  };
55
55
  this.handleMarkerClick = (e) => {
@@ -140,7 +140,7 @@ class FootnoteView extends base_node_view_1.BaseNodeView {
140
140
  const fn = (0, footnotes_1.getFootnotesElementState)(this.view.state, id);
141
141
  return { id, fn };
142
142
  }
143
- showContextMenu(element) {
143
+ showContextMenu(element, autoFocus) {
144
144
  this.props.popper.destroy();
145
145
  const can = this.props.getCapabilities();
146
146
  const { id, fn } = this.getFootnoteState();
@@ -162,7 +162,7 @@ class FootnoteView extends base_node_view_1.BaseNodeView {
162
162
  });
163
163
  }
164
164
  this.contextMenu = (0, ReactSubView_1.default)(this.props, style_guide_1.ContextMenu, componentProps, this.node, this.getPos, this.view, ['context-menu', 'footnote-context-menu']);
165
- this.props.popper.show(element, this.contextMenu, 'right-start');
165
+ this.props.popper.show(element, this.contextMenu, 'right-start', true, [], autoFocus);
166
166
  }
167
167
  }
168
168
  exports.FootnoteView = FootnoteView;
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.12.3';
1
+ export const VERSION = '3.12.4';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -35,15 +35,15 @@ export class FootnoteView extends BaseNodeView {
35
35
  this.dom.tabIndex = 0;
36
36
  this.contentDOM = document.createElement('div');
37
37
  this.contentDOM.classList.add('footnote-text');
38
- this.dom.addEventListener('mousedown', this.handleClick);
39
- this.dom.addEventListener('keydown', handleEnterKey(this.handleClick));
38
+ this.dom.addEventListener('mousedown', (e) => this.handleClick(e, false));
39
+ this.dom.addEventListener('keydown', handleEnterKey((e) => this.handleClick(e, true)));
40
40
  this.updateContents();
41
41
  };
42
- this.handleClick = (event) => {
42
+ this.handleClick = (event, fromKeyboard = false) => {
43
43
  const element = event.target;
44
44
  const item = element.closest('.footnote');
45
45
  if (item) {
46
- this.showContextMenu(item);
46
+ this.showContextMenu(item, fromKeyboard);
47
47
  }
48
48
  };
49
49
  this.handleMarkerClick = (e) => {
@@ -134,7 +134,7 @@ export class FootnoteView extends BaseNodeView {
134
134
  const fn = getFootnotesElementState(this.view.state, id);
135
135
  return { id, fn };
136
136
  }
137
- showContextMenu(element) {
137
+ showContextMenu(element, autoFocus) {
138
138
  this.props.popper.destroy();
139
139
  const can = this.props.getCapabilities();
140
140
  const { id, fn } = this.getFootnoteState();
@@ -156,7 +156,7 @@ export class FootnoteView extends BaseNodeView {
156
156
  });
157
157
  }
158
158
  this.contextMenu = ReactSubView(this.props, ContextMenu, componentProps, this.node, this.getPos, this.view, ['context-menu', 'footnote-context-menu']);
159
- this.props.popper.show(element, this.contextMenu, 'right-start');
159
+ this.props.popper.show(element, this.contextMenu, 'right-start', true, [], autoFocus);
160
160
  }
161
161
  }
162
162
  const getEffectiveChildCount = (node) => {
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.12.3";
1
+ export declare const VERSION = "3.12.4";
2
2
  export declare const MATHJAX_VERSION = "3.2.2";
@@ -26,8 +26,8 @@ export declare class FootnoteView extends BaseNodeView<Trackable<FootnoteNode>>
26
26
  id: string;
27
27
  fn: import("../plugins/footnotes").FootnotesElementState | undefined;
28
28
  };
29
- showContextMenu(element: HTMLElement): void;
30
- handleClick: (event: Event) => void;
29
+ showContextMenu(element: HTMLElement, autoFocus: boolean): void;
30
+ handleClick: (event: Event, fromKeyboard?: boolean) => void;
31
31
  handleMarkerClick: (e?: Event) => void;
32
32
  handleDeleteClick: (e?: Event) => void;
33
33
  handleDelete: () => void;
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": "3.12.3",
4
+ "version": "3.12.4",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",