@manuscripts/body-editor 2.0.43-LEAN-3840.2 → 2.0.44

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.
@@ -196,7 +196,7 @@ const insertTable = (config, state, dispatch) => {
196
196
  };
197
197
  exports.insertTable = insertTable;
198
198
  const insertSupplement = (file, state, dispatch) => {
199
- const supplement = transform_1.schema.nodes.supplement.create({
199
+ const supplement = transform_1.schema.nodes.supplement.createAndFill({
200
200
  id: (0, transform_1.generateNodeID)(transform_1.schema.nodes.supplement),
201
201
  href: file.id,
202
202
  });
@@ -11,9 +11,10 @@ const insertSupplementsNode = (tr) => {
11
11
  }
12
12
  const abstracts = (0, exports.findAbstractsNode)(doc);
13
13
  const pos = abstracts.pos - 1;
14
- tr.insert(pos, transform_1.schema.nodes.supplements.create());
14
+ const supplementsNode = transform_1.schema.nodes.supplements.createAndFill();
15
+ tr.insert(pos, supplementsNode);
15
16
  return {
16
- node: supplements,
17
+ node: supplementsNode,
17
18
  pos,
18
19
  };
19
20
  };
@@ -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.43-LEAN-3840.2';
4
+ exports.VERSION = '2.0.44';
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;
@@ -88,15 +88,9 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
88
88
  const fnState = footnotes_2.footnotesKey.getState(this.view.state);
89
89
  if (fnState) {
90
90
  this.activateModal({
91
- notes: Array.from(fnState.unusedFootnotes.values()).reduce((acc, n) => {
92
- const node = n[0];
93
- if (!(0, track_changes_utils_1.isDeleted)(node) && !(0, track_changes_utils_1.isRejectedInsert)(node)) {
94
- acc.push({
95
- node,
96
- });
97
- }
98
- return acc;
99
- }, []),
91
+ notes: Array.from(fnState.unusedFootnotes.values()).map((n) => ({
92
+ node: n[0],
93
+ })),
100
94
  onCancel: () => {
101
95
  const { tr } = this.view.state;
102
96
  if (!this.node.attrs.rids.length) {
@@ -121,12 +115,12 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
121
115
  return false;
122
116
  };
123
117
  this.updateContents = () => {
124
- const attrs = (0, track_changes_utils_1.getActualAttrs)(this.node);
118
+ const attrs = this.node.attrs;
125
119
  this.dom.setAttribute('rids', attrs.rids.join(','));
126
120
  this.dom.setAttribute('contents', attrs.contents);
127
121
  this.dom.className = [
128
122
  'footnote',
129
- ...(0, track_changes_utils_1.getChangeClasses)(this.node.attrs.dataTracked),
123
+ ...(0, track_changes_utils_1.getChangeClasses)(attrs.dataTracked),
130
124
  ].join(' ');
131
125
  if (this.isSelected() &&
132
126
  (!attrs.rids || !attrs.rids.length) &&
@@ -184,7 +184,7 @@ export const insertTable = (config, state, dispatch) => {
184
184
  return true;
185
185
  };
186
186
  export const insertSupplement = (file, state, dispatch) => {
187
- const supplement = schema.nodes.supplement.create({
187
+ const supplement = schema.nodes.supplement.createAndFill({
188
188
  id: generateNodeID(schema.nodes.supplement),
189
189
  href: file.id,
190
190
  });
@@ -8,9 +8,10 @@ export const insertSupplementsNode = (tr) => {
8
8
  }
9
9
  const abstracts = findAbstractsNode(doc);
10
10
  const pos = abstracts.pos - 1;
11
- tr.insert(pos, schema.nodes.supplements.create());
11
+ const supplementsNode = schema.nodes.supplements.createAndFill();
12
+ tr.insert(pos, supplementsNode);
12
13
  return {
13
- node: supplements,
14
+ node: supplementsNode,
14
15
  pos,
15
16
  };
16
17
  };
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.0.43-LEAN-3840.2';
1
+ export const VERSION = '2.0.44';
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);
@@ -20,7 +20,7 @@ import { findChildrenByType, findParentNodeClosestToPos, } from 'prosemirror-uti
20
20
  import { createFootnote, insertFootnote, insertTableFootnote, } from '../commands';
21
21
  import { FootnotesSelector } from '../components/views/FootnotesSelector';
22
22
  import { buildTableFootnoteLabels } from '../lib/footnotes';
23
- import { getActualAttrs, getChangeClasses, isDeleted, isPendingInsert, isRejectedInsert, } from '../lib/track-changes-utils';
23
+ import { getChangeClasses, isDeleted, isPendingInsert, isRejectedInsert, } from '../lib/track-changes-utils';
24
24
  import { footnotesKey } from '../plugins/footnotes';
25
25
  import { BaseNodeView } from './base_node_view';
26
26
  import { createNodeView } from './creators';
@@ -82,15 +82,9 @@ export class InlineFootnoteView extends BaseNodeView {
82
82
  const fnState = footnotesKey.getState(this.view.state);
83
83
  if (fnState) {
84
84
  this.activateModal({
85
- notes: Array.from(fnState.unusedFootnotes.values()).reduce((acc, n) => {
86
- const node = n[0];
87
- if (!isDeleted(node) && !isRejectedInsert(node)) {
88
- acc.push({
89
- node,
90
- });
91
- }
92
- return acc;
93
- }, []),
85
+ notes: Array.from(fnState.unusedFootnotes.values()).map((n) => ({
86
+ node: n[0],
87
+ })),
94
88
  onCancel: () => {
95
89
  const { tr } = this.view.state;
96
90
  if (!this.node.attrs.rids.length) {
@@ -115,12 +109,12 @@ export class InlineFootnoteView extends BaseNodeView {
115
109
  return false;
116
110
  };
117
111
  this.updateContents = () => {
118
- const attrs = getActualAttrs(this.node);
112
+ const attrs = this.node.attrs;
119
113
  this.dom.setAttribute('rids', attrs.rids.join(','));
120
114
  this.dom.setAttribute('contents', attrs.contents);
121
115
  this.dom.className = [
122
116
  'footnote',
123
- ...getChangeClasses(this.node.attrs.dataTracked),
117
+ ...getChangeClasses(attrs.dataTracked),
124
118
  ].join(' ');
125
119
  if (this.isSelected() &&
126
120
  (!attrs.rids || !attrs.rids.length) &&
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.0.43-LEAN-3840.2";
1
+ export declare const VERSION = "2.0.44";
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.43-LEAN-3840.2",
4
+ "version": "2.0.44",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -33,7 +33,7 @@
33
33
  "@manuscripts/json-schema": "2.2.11",
34
34
  "@manuscripts/library": "1.3.11",
35
35
  "@manuscripts/style-guide": "2.0.19",
36
- "@manuscripts/track-changes-plugin": "1.7.18-LEAN-3840.1",
36
+ "@manuscripts/track-changes-plugin": "1.7.17",
37
37
  "@manuscripts/transform": "2.3.31",
38
38
  "@popperjs/core": "^2.11.8",
39
39
  "astrocite-eutils": "^0.16.4",
@@ -116,4 +116,4 @@
116
116
  "engines": {
117
117
  "node": ">=20.16.0"
118
118
  }
119
- }
119
+ }