@manuscripts/body-editor 1.5.2-LEAN-3069 → 1.5.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/commands.js +6 -0
- package/dist/cjs/lib/utils.js +3 -3
- package/dist/cjs/views/bibliography_element.js +0 -2
- package/dist/cjs/views/block_view.js +0 -4
- package/dist/cjs/views/citation_editable.js +4 -22
- package/dist/cjs/views/footnotes_element.js +0 -9
- package/dist/es/commands.js +6 -0
- package/dist/es/lib/utils.js +3 -3
- package/dist/es/views/bibliography_element.js +0 -2
- package/dist/es/views/block_view.js +0 -4
- package/dist/es/views/citation_editable.js +4 -22
- package/dist/es/views/footnotes_element.js +0 -9
- package/dist/types/configs/editor-views.d.ts +0 -14
- package/dist/types/lib/utils.d.ts +2 -2
- package/dist/types/views/bibliography_element_editable.d.ts +0 -1
- package/dist/types/views/block_view.d.ts +0 -1
- package/dist/types/views/blockquote_element_editable.d.ts +0 -1
- package/dist/types/views/bullet_list_editable.d.ts +0 -1
- package/dist/types/views/editable_block.d.ts +0 -1
- package/dist/types/views/equation_element_editable.d.ts +0 -1
- package/dist/types/views/figure_element_editable.d.ts +0 -1
- package/dist/types/views/footnote_editable.d.ts +0 -1
- package/dist/types/views/footnotes_element.d.ts +0 -2
- package/dist/types/views/footnotes_element_editable.d.ts +0 -1
- package/dist/types/views/listing_element_editable.d.ts +0 -1
- package/dist/types/views/ordered_list_editable.d.ts +0 -1
- package/dist/types/views/paragraph_editable.d.ts +0 -1
- package/dist/types/views/placeholder_element_editable.d.ts +0 -1
- package/dist/types/views/pullquote_element_editable.d.ts +0 -1
- package/dist/types/views/section_title_editable.d.ts +0 -1
- package/dist/types/views/table_element_editable.d.ts +0 -1
- package/dist/types/views/toc_element_editable.d.ts +0 -1
- package/package.json +5 -5
package/dist/cjs/commands.js
CHANGED
|
@@ -257,6 +257,9 @@ const insertLink = (state, dispatch) => {
|
|
|
257
257
|
return true;
|
|
258
258
|
};
|
|
259
259
|
exports.insertLink = insertLink;
|
|
260
|
+
const needsBibliography = (state) => !bibliography_1.bibliographyKey.getState(state).citations.length &&
|
|
261
|
+
!(0, utils_1.getChildOfType)(state.tr.doc, state.schema.nodes.bibliography_section);
|
|
262
|
+
const createBibliographySection = (state) => state.schema.nodes.bibliography_section.createAndFill({}, state.schema.nodes.section_title.create({}, state.schema.text('Bibliography')));
|
|
260
263
|
const insertInlineCitation = (state, dispatch, view, embeddedCitationItems = []) => {
|
|
261
264
|
const citation = (0, transform_1.buildCitation)(state.selection.$anchor.parent.attrs.id, embeddedCitationItems);
|
|
262
265
|
const node = state.schema.nodes.citation.create({
|
|
@@ -267,6 +270,9 @@ const insertInlineCitation = (state, dispatch, view, embeddedCitationItems = [])
|
|
|
267
270
|
const pos = state.selection.to;
|
|
268
271
|
const { tr } = state;
|
|
269
272
|
tr.insert(pos, node);
|
|
273
|
+
if (needsBibliography(state)) {
|
|
274
|
+
tr.insert(tr.doc.content.size, createBibliographySection(state)).setMeta(bibliography_1.bibliographyKey, { bibliographyInserted: true });
|
|
275
|
+
}
|
|
270
276
|
if (dispatch) {
|
|
271
277
|
const selection = prosemirror_state_1.NodeSelection.create(tr.doc, pos);
|
|
272
278
|
dispatch(tr.setSelection(selection).scrollIntoView());
|
package/dist/cjs/lib/utils.js
CHANGED
|
@@ -30,8 +30,8 @@ function* iterateChildren(node, recurse = false) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
exports.iterateChildren = iterateChildren;
|
|
33
|
-
const getMatchingChild = (parent, matcher
|
|
34
|
-
for (const node of iterateChildren(parent
|
|
33
|
+
const getMatchingChild = (parent, matcher) => {
|
|
34
|
+
for (const node of iterateChildren(parent)) {
|
|
35
35
|
if (matcher(node)) {
|
|
36
36
|
return node;
|
|
37
37
|
}
|
|
@@ -46,7 +46,7 @@ const getMatchingDescendant = (parent, matcher) => {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
exports.getMatchingDescendant = getMatchingDescendant;
|
|
49
|
-
const getChildOfType = (parent, nodeType
|
|
49
|
+
const getChildOfType = (parent, nodeType) => !!(0, exports.getMatchingChild)(parent, (node) => node.type === nodeType);
|
|
50
50
|
exports.getChildOfType = getChildOfType;
|
|
51
51
|
exports.findParentNodeWithId = (0, prosemirror_utils_1.findParentNode)((node) => 'id' in node.attrs);
|
|
52
52
|
exports.findParentNodeWithIdValue = (0, prosemirror_utils_1.findParentNode)((node) => node.attrs.id);
|
|
@@ -30,8 +30,6 @@ class BibliographyElementBlockView extends block_view_1.default {
|
|
|
30
30
|
this.contentDOM = document.createElement('div');
|
|
31
31
|
this.contentDOM.classList.add('block');
|
|
32
32
|
this.contentDOM.setAttribute('id', this.node.attrs.id);
|
|
33
|
-
this.contentDOM.setAttribute('contenteditable', 'false');
|
|
34
|
-
this.dom.setAttribute('contenteditable', 'false');
|
|
35
33
|
this.dom.appendChild(this.contentDOM);
|
|
36
34
|
};
|
|
37
35
|
}
|
|
@@ -34,7 +34,6 @@ class BlockView extends base_node_view_1.BaseNodeView {
|
|
|
34
34
|
this.updateContents = () => {
|
|
35
35
|
this.updateClasses();
|
|
36
36
|
this.updateAttributes();
|
|
37
|
-
this.onUpdateContent();
|
|
38
37
|
};
|
|
39
38
|
this.updateClasses = () => {
|
|
40
39
|
if (!this.contentDOM) {
|
|
@@ -90,8 +89,5 @@ class BlockView extends base_node_view_1.BaseNodeView {
|
|
|
90
89
|
this.gutterButtons = () => [];
|
|
91
90
|
this.actionGutterButtons = () => [];
|
|
92
91
|
}
|
|
93
|
-
onUpdateContent() {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
92
|
}
|
|
97
93
|
exports.default = BlockView;
|
|
@@ -48,10 +48,6 @@ const bibliography_1 = require("../plugins/bibliography");
|
|
|
48
48
|
const bibliography_utils_1 = require("../plugins/bibliography/bibliography-utils");
|
|
49
49
|
const citation_1 = require("./citation");
|
|
50
50
|
const creators_1 = require("./creators");
|
|
51
|
-
const createBibliographySection = (bibItem) => transform_1.schema.nodes.bibliography_section.createAndFill({}, [
|
|
52
|
-
transform_1.schema.nodes.section_title.create({}, transform_1.schema.text('Bibliography')),
|
|
53
|
-
transform_1.schema.nodes.bibliography_element.create({}, bibItem ? [bibItem] : []),
|
|
54
|
-
]);
|
|
55
51
|
class CitationEditableView extends citation_1.CitationView {
|
|
56
52
|
constructor() {
|
|
57
53
|
super(...arguments);
|
|
@@ -189,27 +185,13 @@ class CitationEditableView extends citation_1.CitationView {
|
|
|
189
185
|
insertBibliographyNode(view, item) {
|
|
190
186
|
const { doc, tr } = view.state;
|
|
191
187
|
const { DOI: doi, ['container-title']: containerTitle } = item, restAttr = __rest(item, ["DOI", 'container-title']);
|
|
192
|
-
|
|
193
|
-
let pos = null;
|
|
194
|
-
doc.descendants((node, nodePos) => {
|
|
188
|
+
doc.descendants((node, pos) => {
|
|
195
189
|
if (node.type === transform_1.schema.nodes.bibliography_element) {
|
|
196
|
-
|
|
197
|
-
|
|
190
|
+
view.dispatch(tr.insert(pos + 1, transform_1.schema.nodes.bibliography_item.create(Object.assign({ id: item._id, doi,
|
|
191
|
+
containerTitle }, restAttr))));
|
|
192
|
+
return false;
|
|
198
193
|
}
|
|
199
194
|
});
|
|
200
|
-
let newTr;
|
|
201
|
-
const bibItem = transform_1.schema.nodes.bibliography_item.create(Object.assign({ id: item._id, doi,
|
|
202
|
-
containerTitle }, restAttr));
|
|
203
|
-
if (bibElement && pos) {
|
|
204
|
-
newTr = tr.insert(pos + 1, bibItem);
|
|
205
|
-
}
|
|
206
|
-
else {
|
|
207
|
-
newTr = tr
|
|
208
|
-
.insert(tr.doc.content.size, createBibliographySection(bibItem))
|
|
209
|
-
.setMeta(bibliography_1.bibliographyKey, { bibliographyInserted: true });
|
|
210
|
-
}
|
|
211
|
-
view.dispatch(newTr);
|
|
212
|
-
return false;
|
|
213
195
|
}
|
|
214
196
|
}
|
|
215
197
|
exports.CitationEditableView = CitationEditableView;
|
|
@@ -25,15 +25,6 @@ class FootnotesElementView extends block_view_1.default {
|
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
|
27
27
|
this.elementType = 'div';
|
|
28
|
-
this.checkEditability = () => {
|
|
29
|
-
var _a, _b;
|
|
30
|
-
const editable = this.node.childCount ? 'true' : 'false';
|
|
31
|
-
(_a = this.contentDOM) === null || _a === void 0 ? void 0 : _a.setAttribute('contenteditable', editable);
|
|
32
|
-
(_b = this.dom) === null || _b === void 0 ? void 0 : _b.setAttribute('contenteditable', editable);
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
onUpdateContent() {
|
|
36
|
-
this.checkEditability();
|
|
37
28
|
}
|
|
38
29
|
}
|
|
39
30
|
exports.FootnotesElementView = FootnotesElementView;
|
package/dist/es/commands.js
CHANGED
|
@@ -219,6 +219,9 @@ export const insertLink = (state, dispatch) => {
|
|
|
219
219
|
}
|
|
220
220
|
return true;
|
|
221
221
|
};
|
|
222
|
+
const needsBibliography = (state) => !bibliographyKey.getState(state).citations.length &&
|
|
223
|
+
!getChildOfType(state.tr.doc, state.schema.nodes.bibliography_section);
|
|
224
|
+
const createBibliographySection = (state) => state.schema.nodes.bibliography_section.createAndFill({}, state.schema.nodes.section_title.create({}, state.schema.text('Bibliography')));
|
|
222
225
|
export const insertInlineCitation = (state, dispatch, view, embeddedCitationItems = []) => {
|
|
223
226
|
const citation = buildCitation(state.selection.$anchor.parent.attrs.id, embeddedCitationItems);
|
|
224
227
|
const node = state.schema.nodes.citation.create({
|
|
@@ -229,6 +232,9 @@ export const insertInlineCitation = (state, dispatch, view, embeddedCitationItem
|
|
|
229
232
|
const pos = state.selection.to;
|
|
230
233
|
const { tr } = state;
|
|
231
234
|
tr.insert(pos, node);
|
|
235
|
+
if (needsBibliography(state)) {
|
|
236
|
+
tr.insert(tr.doc.content.size, createBibliographySection(state)).setMeta(bibliographyKey, { bibliographyInserted: true });
|
|
237
|
+
}
|
|
232
238
|
if (dispatch) {
|
|
233
239
|
const selection = NodeSelection.create(tr.doc, pos);
|
|
234
240
|
dispatch(tr.setSelection(selection).scrollIntoView());
|
package/dist/es/lib/utils.js
CHANGED
|
@@ -26,8 +26,8 @@ export function* iterateChildren(node, recurse = false) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
export const getMatchingChild = (parent, matcher
|
|
30
|
-
for (const node of iterateChildren(parent
|
|
29
|
+
export const getMatchingChild = (parent, matcher) => {
|
|
30
|
+
for (const node of iterateChildren(parent)) {
|
|
31
31
|
if (matcher(node)) {
|
|
32
32
|
return node;
|
|
33
33
|
}
|
|
@@ -40,7 +40,7 @@ export const getMatchingDescendant = (parent, matcher) => {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
export const getChildOfType = (parent, nodeType
|
|
43
|
+
export const getChildOfType = (parent, nodeType) => !!getMatchingChild(parent, (node) => node.type === nodeType);
|
|
44
44
|
export const findParentNodeWithId = findParentNode((node) => 'id' in node.attrs);
|
|
45
45
|
export const findParentNodeWithIdValue = findParentNode((node) => node.attrs.id);
|
|
46
46
|
export const findParentSection = findParentNode((node) => isSectionNodeType(node.type));
|
|
@@ -24,8 +24,6 @@ export class BibliographyElementBlockView extends BlockView {
|
|
|
24
24
|
this.contentDOM = document.createElement('div');
|
|
25
25
|
this.contentDOM.classList.add('block');
|
|
26
26
|
this.contentDOM.setAttribute('id', this.node.attrs.id);
|
|
27
|
-
this.contentDOM.setAttribute('contenteditable', 'false');
|
|
28
|
-
this.dom.setAttribute('contenteditable', 'false');
|
|
29
27
|
this.dom.appendChild(this.contentDOM);
|
|
30
28
|
};
|
|
31
29
|
}
|
|
@@ -32,7 +32,6 @@ export default class BlockView extends BaseNodeView {
|
|
|
32
32
|
this.updateContents = () => {
|
|
33
33
|
this.updateClasses();
|
|
34
34
|
this.updateAttributes();
|
|
35
|
-
this.onUpdateContent();
|
|
36
35
|
};
|
|
37
36
|
this.updateClasses = () => {
|
|
38
37
|
if (!this.contentDOM) {
|
|
@@ -88,7 +87,4 @@ export default class BlockView extends BaseNodeView {
|
|
|
88
87
|
this.gutterButtons = () => [];
|
|
89
88
|
this.actionGutterButtons = () => [];
|
|
90
89
|
}
|
|
91
|
-
onUpdateContent() {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
90
|
}
|
|
@@ -42,10 +42,6 @@ import { bibliographyKey } from '../plugins/bibliography';
|
|
|
42
42
|
import { getReferencesModelMap } from '../plugins/bibliography/bibliography-utils';
|
|
43
43
|
import { CitationView } from './citation';
|
|
44
44
|
import { createEditableNodeView } from './creators';
|
|
45
|
-
const createBibliographySection = (bibItem) => schema.nodes.bibliography_section.createAndFill({}, [
|
|
46
|
-
schema.nodes.section_title.create({}, schema.text('Bibliography')),
|
|
47
|
-
schema.nodes.bibliography_element.create({}, bibItem ? [bibItem] : []),
|
|
48
|
-
]);
|
|
49
45
|
export class CitationEditableView extends CitationView {
|
|
50
46
|
constructor() {
|
|
51
47
|
super(...arguments);
|
|
@@ -183,27 +179,13 @@ export class CitationEditableView extends CitationView {
|
|
|
183
179
|
insertBibliographyNode(view, item) {
|
|
184
180
|
const { doc, tr } = view.state;
|
|
185
181
|
const { DOI: doi, ['container-title']: containerTitle } = item, restAttr = __rest(item, ["DOI", 'container-title']);
|
|
186
|
-
|
|
187
|
-
let pos = null;
|
|
188
|
-
doc.descendants((node, nodePos) => {
|
|
182
|
+
doc.descendants((node, pos) => {
|
|
189
183
|
if (node.type === schema.nodes.bibliography_element) {
|
|
190
|
-
|
|
191
|
-
|
|
184
|
+
view.dispatch(tr.insert(pos + 1, schema.nodes.bibliography_item.create(Object.assign({ id: item._id, doi,
|
|
185
|
+
containerTitle }, restAttr))));
|
|
186
|
+
return false;
|
|
192
187
|
}
|
|
193
188
|
});
|
|
194
|
-
let newTr;
|
|
195
|
-
const bibItem = schema.nodes.bibliography_item.create(Object.assign({ id: item._id, doi,
|
|
196
|
-
containerTitle }, restAttr));
|
|
197
|
-
if (bibElement && pos) {
|
|
198
|
-
newTr = tr.insert(pos + 1, bibItem);
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
newTr = tr
|
|
202
|
-
.insert(tr.doc.content.size, createBibliographySection(bibItem))
|
|
203
|
-
.setMeta(bibliographyKey, { bibliographyInserted: true });
|
|
204
|
-
}
|
|
205
|
-
view.dispatch(newTr);
|
|
206
|
-
return false;
|
|
207
189
|
}
|
|
208
190
|
}
|
|
209
191
|
export default createEditableNodeView(CitationEditableView);
|
|
@@ -19,15 +19,6 @@ export class FootnotesElementView extends BlockView {
|
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
21
|
this.elementType = 'div';
|
|
22
|
-
this.checkEditability = () => {
|
|
23
|
-
var _a, _b;
|
|
24
|
-
const editable = this.node.childCount ? 'true' : 'false';
|
|
25
|
-
(_a = this.contentDOM) === null || _a === void 0 ? void 0 : _a.setAttribute('contenteditable', editable);
|
|
26
|
-
(_b = this.dom) === null || _b === void 0 ? void 0 : _b.setAttribute('contenteditable', editable);
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
onUpdateContent() {
|
|
30
|
-
this.checkEditability();
|
|
31
22
|
}
|
|
32
23
|
}
|
|
33
24
|
export default createNodeOrElementView(FootnotesElementView, 'div');
|
|
@@ -38,7 +38,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
38
38
|
};
|
|
39
39
|
initialise: () => void;
|
|
40
40
|
updateContents: () => void;
|
|
41
|
-
onUpdateContent(): void;
|
|
42
41
|
updateClasses: () => void;
|
|
43
42
|
updateAttributes: () => void;
|
|
44
43
|
createElement: () => void;
|
|
@@ -76,7 +75,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
76
75
|
};
|
|
77
76
|
initialise: () => void;
|
|
78
77
|
updateContents: () => void;
|
|
79
|
-
onUpdateContent(): void;
|
|
80
78
|
updateClasses: () => void;
|
|
81
79
|
updateAttributes: () => void;
|
|
82
80
|
createElement: () => void;
|
|
@@ -114,7 +112,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
114
112
|
};
|
|
115
113
|
initialise: () => void;
|
|
116
114
|
updateContents: () => void;
|
|
117
|
-
onUpdateContent(): void;
|
|
118
115
|
updateClasses: () => void;
|
|
119
116
|
updateAttributes: () => void;
|
|
120
117
|
createElement: () => void;
|
|
@@ -155,7 +152,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
155
152
|
};
|
|
156
153
|
initialise: () => void;
|
|
157
154
|
updateContents: () => void;
|
|
158
|
-
onUpdateContent(): void;
|
|
159
155
|
updateClasses: () => void;
|
|
160
156
|
updateAttributes: () => void;
|
|
161
157
|
createElement: () => void;
|
|
@@ -194,7 +190,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
194
190
|
};
|
|
195
191
|
initialise: () => void;
|
|
196
192
|
updateContents: () => void;
|
|
197
|
-
onUpdateContent(): void;
|
|
198
193
|
updateClasses: () => void;
|
|
199
194
|
updateAttributes: () => void;
|
|
200
195
|
createElement: () => void;
|
|
@@ -232,7 +227,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
232
227
|
};
|
|
233
228
|
initialise: () => void;
|
|
234
229
|
updateContents: () => void;
|
|
235
|
-
onUpdateContent(): void;
|
|
236
230
|
updateClasses: () => void;
|
|
237
231
|
updateAttributes: () => void;
|
|
238
232
|
createElement: () => void;
|
|
@@ -277,7 +271,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
277
271
|
};
|
|
278
272
|
initialise: () => void;
|
|
279
273
|
updateContents: () => void;
|
|
280
|
-
onUpdateContent(): void;
|
|
281
274
|
updateClasses: () => void;
|
|
282
275
|
updateAttributes: () => void;
|
|
283
276
|
createElement: () => void;
|
|
@@ -315,7 +308,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
315
308
|
};
|
|
316
309
|
initialise: () => void;
|
|
317
310
|
updateContents: () => void;
|
|
318
|
-
onUpdateContent(): void;
|
|
319
311
|
updateClasses: () => void;
|
|
320
312
|
updateAttributes: () => void;
|
|
321
313
|
createElement: () => void;
|
|
@@ -353,7 +345,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
353
345
|
};
|
|
354
346
|
initialise: () => void;
|
|
355
347
|
updateContents: () => void;
|
|
356
|
-
onUpdateContent(): void;
|
|
357
348
|
updateClasses: () => void;
|
|
358
349
|
updateAttributes: () => void;
|
|
359
350
|
createElement: () => void;
|
|
@@ -392,7 +383,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
392
383
|
};
|
|
393
384
|
initialise: () => void;
|
|
394
385
|
updateContents: () => void;
|
|
395
|
-
onUpdateContent(): void;
|
|
396
386
|
updateClasses: () => void;
|
|
397
387
|
updateAttributes: () => void;
|
|
398
388
|
createElement: () => void;
|
|
@@ -430,7 +420,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
430
420
|
};
|
|
431
421
|
initialise: () => void;
|
|
432
422
|
updateContents: () => void;
|
|
433
|
-
onUpdateContent(): void;
|
|
434
423
|
updateClasses: () => void;
|
|
435
424
|
updateAttributes: () => void;
|
|
436
425
|
createElement: () => void;
|
|
@@ -468,7 +457,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
468
457
|
};
|
|
469
458
|
initialise: () => void;
|
|
470
459
|
updateContents: () => void;
|
|
471
|
-
onUpdateContent(): void;
|
|
472
460
|
updateClasses: () => void;
|
|
473
461
|
updateAttributes: () => void;
|
|
474
462
|
createElement: () => void;
|
|
@@ -507,7 +495,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
507
495
|
};
|
|
508
496
|
initialise: () => void;
|
|
509
497
|
updateContents: () => void;
|
|
510
|
-
onUpdateContent(): void;
|
|
511
498
|
updateClasses: () => void;
|
|
512
499
|
updateAttributes: () => void;
|
|
513
500
|
createElement: () => void;
|
|
@@ -545,7 +532,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
545
532
|
};
|
|
546
533
|
initialise: () => void;
|
|
547
534
|
updateContents: () => void;
|
|
548
|
-
onUpdateContent(): void;
|
|
549
535
|
updateClasses: () => void;
|
|
550
536
|
updateAttributes: () => void;
|
|
551
537
|
createElement: () => void;
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
import { ManuscriptNode, ManuscriptNodeType } from '@manuscripts/transform';
|
|
17
17
|
import { Selection } from 'prosemirror-state';
|
|
18
18
|
export declare function iterateChildren(node: ManuscriptNode, recurse?: boolean): Iterable<ManuscriptNode>;
|
|
19
|
-
export declare const getMatchingChild: (parent: ManuscriptNode, matcher: (node: ManuscriptNode) => boolean
|
|
19
|
+
export declare const getMatchingChild: (parent: ManuscriptNode, matcher: (node: ManuscriptNode) => boolean) => ManuscriptNode | undefined;
|
|
20
20
|
export declare const getMatchingDescendant: (parent: ManuscriptNode, matcher: (node: ManuscriptNode) => boolean) => ManuscriptNode | undefined;
|
|
21
|
-
export declare const getChildOfType: (parent: ManuscriptNode, nodeType: ManuscriptNodeType
|
|
21
|
+
export declare const getChildOfType: (parent: ManuscriptNode, nodeType: ManuscriptNodeType) => boolean;
|
|
22
22
|
export declare const findParentNodeWithId: (selection: Selection) => import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
23
23
|
export declare const findParentNodeWithIdValue: (selection: Selection) => import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
24
24
|
export declare const findParentSection: (selection: Selection) => import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -23,7 +23,6 @@ export default class BlockView<T extends BaseNodeProps> extends BaseNodeView<T>
|
|
|
23
23
|
};
|
|
24
24
|
initialise: () => void;
|
|
25
25
|
updateContents: () => void;
|
|
26
|
-
onUpdateContent(): void;
|
|
27
26
|
updateClasses: () => void;
|
|
28
27
|
updateAttributes: () => void;
|
|
29
28
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -45,7 +45,6 @@ export declare const EditableBlock: <T extends Constructor<BlockView<EditableBlo
|
|
|
45
45
|
};
|
|
46
46
|
initialise: () => void;
|
|
47
47
|
updateContents: () => void;
|
|
48
|
-
onUpdateContent(): void;
|
|
49
48
|
updateClasses: () => void;
|
|
50
49
|
updateAttributes: () => void;
|
|
51
50
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -17,8 +17,6 @@ import { BaseNodeProps } from './base_node_view';
|
|
|
17
17
|
import BlockView from './block_view';
|
|
18
18
|
export declare class FootnotesElementView<PropsType extends BaseNodeProps> extends BlockView<PropsType> {
|
|
19
19
|
elementType: string;
|
|
20
|
-
onUpdateContent(): void;
|
|
21
|
-
checkEditability: () => void;
|
|
22
20
|
}
|
|
23
21
|
declare const _default: (props: BaseNodeProps) => import("../types").NodeViewCreator<FootnotesElementView<any>>;
|
|
24
22
|
export default _default;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => void;
|
|
@@ -28,7 +28,6 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
-
onUpdateContent(): void;
|
|
32
31
|
updateClasses: () => void;
|
|
33
32
|
updateAttributes: () => void;
|
|
34
33
|
createElement: () => 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": "1.5.
|
|
4
|
+
"version": "1.5.3",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"@manuscripts/assets": "^0.6.4",
|
|
31
31
|
"@manuscripts/comment-editor": "^1.0.3",
|
|
32
32
|
"@manuscripts/json-schema": "^2.2.0",
|
|
33
|
-
"@manuscripts/library": "1.2.
|
|
34
|
-
"@manuscripts/style-guide": "1.4.
|
|
33
|
+
"@manuscripts/library": "1.2.1",
|
|
34
|
+
"@manuscripts/style-guide": "1.4.1",
|
|
35
35
|
"@manuscripts/title-editor": "^1.1.0",
|
|
36
36
|
"@manuscripts/track-changes-plugin": "^1.7.2",
|
|
37
|
-
"@manuscripts/transform": "1.5.
|
|
37
|
+
"@manuscripts/transform": "1.5.2",
|
|
38
38
|
"astrocite-eutils": "^0.16.4",
|
|
39
39
|
"axios": "^1.2.2",
|
|
40
40
|
"codemirror": "^5.58.1",
|
|
@@ -145,4 +145,4 @@
|
|
|
145
145
|
"resolutions": {
|
|
146
146
|
"@types/react": "^17.0.2"
|
|
147
147
|
}
|
|
148
|
-
}
|
|
148
|
+
}
|