@manuscripts/body-editor 3.16.2 → 3.16.3
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/cjs/versions.js +1 -1
- package/dist/cjs/views/equation.js +2 -0
- package/dist/cjs/views/equation_editable.js +2 -0
- package/dist/cjs/views/inline_equation.js +2 -0
- package/dist/cjs/views/inline_equation_editable.js +2 -0
- package/dist/es/versions.js +1 -1
- package/dist/es/views/equation.js +2 -0
- package/dist/es/views/equation_editable.js +2 -0
- package/dist/es/views/inline_equation.js +2 -0
- package/dist/es/views/inline_equation_editable.js +2 -0
- package/dist/types/versions.d.ts +1 -1
- package/package.json +1 -1
- package/src/versions.ts +1 -1
- package/src/views/equation.ts +5 -0
- package/src/views/equation_editable.ts +3 -0
- package/src/views/inline_equation.ts +5 -0
- package/src/views/inline_equation_editable.ts +3 -0
- package/styles/Editor.css +2 -1
package/dist/cjs/versions.js
CHANGED
|
@@ -19,6 +19,7 @@ exports.EquationView = void 0;
|
|
|
19
19
|
const math_1 = require("../lib/math");
|
|
20
20
|
const base_node_view_1 = require("./base_node_view");
|
|
21
21
|
const creators_1 = require("./creators");
|
|
22
|
+
const navigation_utils_1 = require("../lib/navigation-utils");
|
|
22
23
|
class EquationView extends base_node_view_1.BaseNodeView {
|
|
23
24
|
constructor() {
|
|
24
25
|
super(...arguments);
|
|
@@ -29,6 +30,7 @@ class EquationView extends base_node_view_1.BaseNodeView {
|
|
|
29
30
|
this.createDOM = () => {
|
|
30
31
|
this.dom = document.createElement('div');
|
|
31
32
|
this.dom.classList.add('equation');
|
|
33
|
+
this.dom.addEventListener('keydown', (0, navigation_utils_1.handleEnterKey)(() => this.selectNode()));
|
|
32
34
|
};
|
|
33
35
|
this.ignoreMutation = () => true;
|
|
34
36
|
}
|
|
@@ -19,6 +19,7 @@ exports.InlineEquationView = void 0;
|
|
|
19
19
|
const math_1 = require("../lib/math");
|
|
20
20
|
const base_node_view_1 = require("./base_node_view");
|
|
21
21
|
const creators_1 = require("./creators");
|
|
22
|
+
const navigation_utils_1 = require("../lib/navigation-utils");
|
|
22
23
|
class InlineEquationView extends base_node_view_1.BaseNodeView {
|
|
23
24
|
constructor() {
|
|
24
25
|
super(...arguments);
|
|
@@ -27,6 +28,7 @@ class InlineEquationView extends base_node_view_1.BaseNodeView {
|
|
|
27
28
|
initialise() {
|
|
28
29
|
this.createDOM();
|
|
29
30
|
this.updateContents();
|
|
31
|
+
this.dom.addEventListener('keydown', (0, navigation_utils_1.handleEnterKey)(() => this.selectNode()));
|
|
30
32
|
}
|
|
31
33
|
updateContents() {
|
|
32
34
|
super.updateContents();
|
|
@@ -70,6 +70,8 @@ class InlineEquationEditableView extends inline_equation_1.InlineEquationView {
|
|
|
70
70
|
Esc: () => {
|
|
71
71
|
this.props.popper.destroy();
|
|
72
72
|
this.view.focus();
|
|
73
|
+
const tabbableView = this.dom.querySelector('[tabindex="0"]');
|
|
74
|
+
tabbableView?.focus();
|
|
73
75
|
},
|
|
74
76
|
},
|
|
75
77
|
});
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '3.16.
|
|
1
|
+
export const VERSION = '3.16.3';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { renderMath } from '../lib/math';
|
|
17
17
|
import { BaseNodeView } from './base_node_view';
|
|
18
18
|
import { createNodeView } from './creators';
|
|
19
|
+
import { handleEnterKey } from '../lib/navigation-utils';
|
|
19
20
|
export class EquationView extends BaseNodeView {
|
|
20
21
|
constructor() {
|
|
21
22
|
super(...arguments);
|
|
@@ -26,6 +27,7 @@ export class EquationView extends BaseNodeView {
|
|
|
26
27
|
this.createDOM = () => {
|
|
27
28
|
this.dom = document.createElement('div');
|
|
28
29
|
this.dom.classList.add('equation');
|
|
30
|
+
this.dom.addEventListener('keydown', handleEnterKey(() => this.selectNode()));
|
|
29
31
|
};
|
|
30
32
|
this.ignoreMutation = () => true;
|
|
31
33
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { renderMath } from '../lib/math';
|
|
17
17
|
import { BaseNodeView } from './base_node_view';
|
|
18
18
|
import { createNodeView } from './creators';
|
|
19
|
+
import { handleEnterKey } from '../lib/navigation-utils';
|
|
19
20
|
export class InlineEquationView extends BaseNodeView {
|
|
20
21
|
constructor() {
|
|
21
22
|
super(...arguments);
|
|
@@ -24,6 +25,7 @@ export class InlineEquationView extends BaseNodeView {
|
|
|
24
25
|
initialise() {
|
|
25
26
|
this.createDOM();
|
|
26
27
|
this.updateContents();
|
|
28
|
+
this.dom.addEventListener('keydown', handleEnterKey(() => this.selectNode()));
|
|
27
29
|
}
|
|
28
30
|
updateContents() {
|
|
29
31
|
super.updateContents();
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.16.
|
|
1
|
+
export declare const VERSION = "3.16.3";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
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.16.
|
|
4
|
+
"version": "3.16.3",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
package/src/versions.ts
CHANGED
package/src/views/equation.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { renderMath } from '../lib/math'
|
|
|
20
20
|
import { Trackable } from '../types'
|
|
21
21
|
import { BaseNodeView } from './base_node_view'
|
|
22
22
|
import { createNodeView } from './creators'
|
|
23
|
+
import { handleEnterKey } from '../lib/navigation-utils'
|
|
23
24
|
|
|
24
25
|
export class EquationView
|
|
25
26
|
extends BaseNodeView<Trackable<EquationNode>>
|
|
@@ -33,6 +34,10 @@ export class EquationView
|
|
|
33
34
|
public createDOM = () => {
|
|
34
35
|
this.dom = document.createElement('div')
|
|
35
36
|
this.dom.classList.add('equation')
|
|
37
|
+
this.dom.addEventListener(
|
|
38
|
+
'keydown',
|
|
39
|
+
handleEnterKey(() => this.selectNode())
|
|
40
|
+
)
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
public updateContents() {
|
|
@@ -20,6 +20,7 @@ import { renderMath } from '../lib/math'
|
|
|
20
20
|
import { Trackable } from '../types'
|
|
21
21
|
import { BaseNodeView } from './base_node_view'
|
|
22
22
|
import { createNodeView } from './creators'
|
|
23
|
+
import { handleEnterKey } from '../lib/navigation-utils'
|
|
23
24
|
|
|
24
25
|
export class InlineEquationView
|
|
25
26
|
extends BaseNodeView<Trackable<InlineEquationNode>>
|
|
@@ -28,6 +29,10 @@ export class InlineEquationView
|
|
|
28
29
|
public initialise() {
|
|
29
30
|
this.createDOM()
|
|
30
31
|
this.updateContents()
|
|
32
|
+
this.dom.addEventListener(
|
|
33
|
+
'keydown',
|
|
34
|
+
handleEnterKey(() => this.selectNode())
|
|
35
|
+
)
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
public updateContents() {
|
|
@@ -38,6 +38,9 @@ export class InlineEquationEditableView extends InlineEquationView {
|
|
|
38
38
|
Esc: () => {
|
|
39
39
|
this.props.popper.destroy()
|
|
40
40
|
this.view.focus()
|
|
41
|
+
const tabbableView =
|
|
42
|
+
this.dom.querySelector<HTMLElement>('[tabindex="0"]')
|
|
43
|
+
tabbableView?.focus()
|
|
41
44
|
},
|
|
42
45
|
},
|
|
43
46
|
})
|
package/styles/Editor.css
CHANGED
|
@@ -291,7 +291,8 @@
|
|
|
291
291
|
cursor: pointer;
|
|
292
292
|
}
|
|
293
293
|
.ProseMirror .citation:focus-visible,
|
|
294
|
-
.ProseMirror .cross-reference:focus-visible
|
|
294
|
+
.ProseMirror .cross-reference:focus-visible,
|
|
295
|
+
.ProseMirror .MathJax:focus-visible {
|
|
295
296
|
outline: 4px solid var(--focus-outline-color);
|
|
296
297
|
outline-offset: var(--focus-outline-offset);
|
|
297
298
|
border-radius: var(--focus-outline-radius);
|