@manuscripts/body-editor 2.0.36-LEAN-3840.0 → 2.0.36

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.0.36-LEAN-3840.0';
4
+ exports.VERSION = '2.0.36';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -35,7 +35,6 @@ const setTCClasses = (node, dom) => {
35
35
  const lastChange = dataTracked[dataTracked.length - 1];
36
36
  const changeClasses = (0, track_changes_utils_1.getChangeClasses)([lastChange]);
37
37
  dom.classList.add(...changeClasses);
38
- dom.setAttribute('id', node.attrs.id);
39
38
  }
40
39
  };
41
40
  exports.setTCClasses = setTCClasses;
@@ -87,15 +87,9 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
87
87
  const fnState = footnotes_1.footnotesKey.getState(this.view.state);
88
88
  if (fnState) {
89
89
  this.activateModal({
90
- notes: Array.from(fnState.unusedFootnotes.values()).reduce((acc, n) => {
91
- const node = n[0];
92
- if (!(0, track_changes_utils_1.isDeleted)(node) && !(0, track_changes_utils_1.isRejectedInsert)(node)) {
93
- acc.push({
94
- node,
95
- });
96
- }
97
- return acc;
98
- }, []),
90
+ notes: Array.from(fnState.unusedFootnotes.values()).map((n) => ({
91
+ node: n[0],
92
+ })),
99
93
  onCancel: () => {
100
94
  const { tr } = this.view.state;
101
95
  if (!this.node.attrs.rids.length) {
@@ -120,12 +114,12 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
120
114
  return false;
121
115
  };
122
116
  this.updateContents = () => {
123
- const attrs = (0, track_changes_utils_1.getActualAttrs)(this.node);
117
+ const attrs = this.node.attrs;
124
118
  this.dom.setAttribute('rids', attrs.rids.join(','));
125
119
  this.dom.setAttribute('contents', attrs.contents);
126
120
  this.dom.className = [
127
121
  'footnote',
128
- ...(0, track_changes_utils_1.getChangeClasses)(this.node.attrs.dataTracked),
122
+ ...(0, track_changes_utils_1.getChangeClasses)(attrs.dataTracked),
129
123
  ].join(' ');
130
124
  if (this.isSelected() &&
131
125
  (!attrs.rids || !attrs.rids.length) &&
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.0.36-LEAN-3840.0';
1
+ export const VERSION = '2.0.36';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -28,7 +28,6 @@ export const setTCClasses = (node, dom) => {
28
28
  const lastChange = dataTracked[dataTracked.length - 1];
29
29
  const changeClasses = getChangeClasses([lastChange]);
30
30
  dom.classList.add(...changeClasses);
31
- dom.setAttribute('id', node.attrs.id);
32
31
  }
33
32
  };
34
33
  export default createNodeOrElementView(FootnoteView, 'div', setTCClasses);
@@ -18,7 +18,7 @@ import { schema, } from '@manuscripts/transform';
18
18
  import { NodeSelection, TextSelection } from 'prosemirror-state';
19
19
  import { findChildrenByType, findParentNodeClosestToPos, } from 'prosemirror-utils';
20
20
  import { createFootnote, insertFootnote, insertTableFootnote, } from '../commands';
21
- import { getActualAttrs, getChangeClasses, isDeleted, isPendingInsert, isRejectedInsert, } from '../lib/track-changes-utils';
21
+ import { getChangeClasses, isDeleted, isPendingInsert, isRejectedInsert, } from '../lib/track-changes-utils';
22
22
  import { footnotesKey } from '../plugins/footnotes';
23
23
  import { buildTableFootnoteLabels } from '../plugins/footnotes/footnotes-utils';
24
24
  import { BaseNodeView } from './base_node_view';
@@ -81,15 +81,9 @@ export class InlineFootnoteView extends BaseNodeView {
81
81
  const fnState = footnotesKey.getState(this.view.state);
82
82
  if (fnState) {
83
83
  this.activateModal({
84
- notes: Array.from(fnState.unusedFootnotes.values()).reduce((acc, n) => {
85
- const node = n[0];
86
- if (!isDeleted(node) && !isRejectedInsert(node)) {
87
- acc.push({
88
- node,
89
- });
90
- }
91
- return acc;
92
- }, []),
84
+ notes: Array.from(fnState.unusedFootnotes.values()).map((n) => ({
85
+ node: n[0],
86
+ })),
93
87
  onCancel: () => {
94
88
  const { tr } = this.view.state;
95
89
  if (!this.node.attrs.rids.length) {
@@ -114,12 +108,12 @@ export class InlineFootnoteView extends BaseNodeView {
114
108
  return false;
115
109
  };
116
110
  this.updateContents = () => {
117
- const attrs = getActualAttrs(this.node);
111
+ const attrs = this.node.attrs;
118
112
  this.dom.setAttribute('rids', attrs.rids.join(','));
119
113
  this.dom.setAttribute('contents', attrs.contents);
120
114
  this.dom.className = [
121
115
  'footnote',
122
- ...getChangeClasses(this.node.attrs.dataTracked),
116
+ ...getChangeClasses(attrs.dataTracked),
123
117
  ].join(' ');
124
118
  if (this.isSelected() &&
125
119
  (!attrs.rids || !attrs.rids.length) &&
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.0.36-LEAN-3840.0";
1
+ export declare const VERSION = "2.0.36";
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": "2.0.36-LEAN-3840.0",
4
+ "version": "2.0.36",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -32,9 +32,9 @@
32
32
  "@iarna/word-count": "^1.1.2",
33
33
  "@manuscripts/json-schema": "2.2.11",
34
34
  "@manuscripts/library": "1.3.11",
35
- "@manuscripts/style-guide": "2.0.12-LEAN-3840.0",
36
- "@manuscripts/track-changes-plugin": "1.7.18-LEAN-3840.1",
37
- "@manuscripts/transform": "2.3.29",
35
+ "@manuscripts/style-guide": "2.0.12",
36
+ "@manuscripts/track-changes-plugin": "1.7.17",
37
+ "@manuscripts/transform": "2.3.30",
38
38
  "@popperjs/core": "^2.11.8",
39
39
  "astrocite-eutils": "^0.16.4",
40
40
  "codemirror": "^5.58.1",