@manuscripts/body-editor 2.6.9 → 2.6.10

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 = '2.6.9';
4
+ exports.VERSION = '2.6.10';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -28,19 +28,17 @@ class InlineEquationView extends base_node_view_1.BaseNodeView {
28
28
  this.updateContents();
29
29
  };
30
30
  this.updateContents = () => {
31
- if ((0, track_changes_utils_1.isDeleted)(this.node)) {
32
- this.dom.classList.add('deleted');
33
- }
34
- else {
35
- this.dom.classList.remove('deleted');
36
- }
31
+ const classes = [
32
+ 'equation',
33
+ ...(0, track_changes_utils_1.getChangeClasses)(this.node.attrs.dataTracked),
34
+ ];
35
+ this.dom.className = classes.join(' ');
37
36
  this.dom.innerHTML = this.node.attrs.contents;
38
37
  (0, math_1.renderMath)(this.dom);
39
38
  };
40
39
  this.ignoreMutation = () => true;
41
40
  this.createDOM = () => {
42
41
  this.dom = document.createElement('span');
43
- this.dom.classList.add('equation');
44
42
  this.dom.setAttribute('id', this.node.attrs.id);
45
43
  };
46
44
  }
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.6.9';
1
+ export const VERSION = '2.6.10';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { renderMath } from '../lib/math';
17
- import { isDeleted } from '../lib/track-changes-utils';
17
+ import { getChangeClasses } from '../lib/track-changes-utils';
18
18
  import { BaseNodeView } from './base_node_view';
19
19
  import { createNodeView } from './creators';
20
20
  export class InlineEquationView extends BaseNodeView {
@@ -25,19 +25,17 @@ export class InlineEquationView extends BaseNodeView {
25
25
  this.updateContents();
26
26
  };
27
27
  this.updateContents = () => {
28
- if (isDeleted(this.node)) {
29
- this.dom.classList.add('deleted');
30
- }
31
- else {
32
- this.dom.classList.remove('deleted');
33
- }
28
+ const classes = [
29
+ 'equation',
30
+ ...getChangeClasses(this.node.attrs.dataTracked),
31
+ ];
32
+ this.dom.className = classes.join(' ');
34
33
  this.dom.innerHTML = this.node.attrs.contents;
35
34
  renderMath(this.dom);
36
35
  };
37
36
  this.ignoreMutation = () => true;
38
37
  this.createDOM = () => {
39
38
  this.dom = document.createElement('span');
40
- this.dom.classList.add('equation');
41
39
  this.dom.setAttribute('id', this.node.attrs.id);
42
40
  };
43
41
  }
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.6.9";
1
+ export declare const VERSION = "2.6.10";
2
2
  export declare const MATHJAX_VERSION = "3.2.2";
@@ -14,8 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { InlineEquationNode, ManuscriptNodeView } from '@manuscripts/transform';
17
+ import { Trackable } from '../types';
17
18
  import { BaseNodeView } from './base_node_view';
18
- export declare class InlineEquationView extends BaseNodeView<InlineEquationNode> implements ManuscriptNodeView {
19
+ export declare class InlineEquationView extends BaseNodeView<Trackable<InlineEquationNode>> implements ManuscriptNodeView {
19
20
  initialise: () => void;
20
21
  updateContents: () => void;
21
22
  ignoreMutation: () => boolean;
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": "2.6.9",
4
+ "version": "2.6.10",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",