@manuscripts/body-editor 1.5.7 → 1.5.8
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 +0 -6
- package/dist/cjs/lib/utils.js +3 -3
- package/dist/cjs/views/bibliography_element.js +2 -0
- package/dist/cjs/views/block_view.js +4 -0
- package/dist/cjs/views/citation_editable.js +22 -4
- package/dist/cjs/views/footnotes_element.js +9 -0
- package/dist/es/commands.js +0 -6
- package/dist/es/lib/utils.js +3 -3
- package/dist/es/views/bibliography_element.js +2 -0
- package/dist/es/views/block_view.js +4 -0
- package/dist/es/views/citation_editable.js +22 -4
- package/dist/es/views/footnotes_element.js +9 -0
- package/dist/types/configs/editor-views.d.ts +14 -0
- package/dist/types/lib/utils.d.ts +2 -2
- package/dist/types/views/bibliography_element_editable.d.ts +1 -0
- package/dist/types/views/block_view.d.ts +1 -0
- package/dist/types/views/blockquote_element_editable.d.ts +1 -0
- package/dist/types/views/bullet_list_editable.d.ts +1 -0
- package/dist/types/views/editable_block.d.ts +1 -0
- package/dist/types/views/equation_element_editable.d.ts +1 -0
- package/dist/types/views/figure_element_editable.d.ts +1 -0
- package/dist/types/views/footnote_editable.d.ts +1 -0
- package/dist/types/views/footnotes_element.d.ts +2 -0
- package/dist/types/views/footnotes_element_editable.d.ts +1 -0
- package/dist/types/views/listing_element_editable.d.ts +1 -0
- package/dist/types/views/ordered_list_editable.d.ts +1 -0
- package/dist/types/views/paragraph_editable.d.ts +1 -0
- package/dist/types/views/placeholder_element_editable.d.ts +1 -0
- package/dist/types/views/pullquote_element_editable.d.ts +1 -0
- package/dist/types/views/section_title_editable.d.ts +1 -0
- package/dist/types/views/table_element_editable.d.ts +1 -0
- package/dist/types/views/toc_element_editable.d.ts +1 -0
- package/package.json +2 -2
package/dist/cjs/commands.js
CHANGED
|
@@ -257,9 +257,6 @@ 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')));
|
|
263
260
|
const insertInlineCitation = (state, dispatch, view, embeddedCitationItems = []) => {
|
|
264
261
|
const citation = (0, transform_1.buildCitation)(state.selection.$anchor.parent.attrs.id, embeddedCitationItems);
|
|
265
262
|
const node = state.schema.nodes.citation.create({
|
|
@@ -270,9 +267,6 @@ const insertInlineCitation = (state, dispatch, view, embeddedCitationItems = [])
|
|
|
270
267
|
const pos = state.selection.to;
|
|
271
268
|
const { tr } = state;
|
|
272
269
|
tr.insert(pos, node);
|
|
273
|
-
if (needsBibliography(state)) {
|
|
274
|
-
tr.insert(tr.doc.content.size, createBibliographySection(state)).setMeta(bibliography_1.bibliographyKey, { bibliographyInserted: true });
|
|
275
|
-
}
|
|
276
270
|
if (dispatch) {
|
|
277
271
|
const selection = prosemirror_state_1.NodeSelection.create(tr.doc, pos);
|
|
278
272
|
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, deep = false) => {
|
|
34
|
+
for (const node of iterateChildren(parent, deep)) {
|
|
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) => !!(0, exports.getMatchingChild)(parent, (node) => node.type === nodeType);
|
|
49
|
+
const getChildOfType = (parent, nodeType, deep = false) => !!(0, exports.getMatchingChild)(parent, (node) => node.type.name === nodeType.name, deep);
|
|
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,6 +30,8 @@ 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');
|
|
33
35
|
this.dom.appendChild(this.contentDOM);
|
|
34
36
|
};
|
|
35
37
|
}
|
|
@@ -34,6 +34,7 @@ class BlockView extends base_node_view_1.BaseNodeView {
|
|
|
34
34
|
this.updateContents = () => {
|
|
35
35
|
this.updateClasses();
|
|
36
36
|
this.updateAttributes();
|
|
37
|
+
this.onUpdateContent();
|
|
37
38
|
};
|
|
38
39
|
this.updateClasses = () => {
|
|
39
40
|
if (!this.contentDOM) {
|
|
@@ -89,5 +90,8 @@ class BlockView extends base_node_view_1.BaseNodeView {
|
|
|
89
90
|
this.gutterButtons = () => [];
|
|
90
91
|
this.actionGutterButtons = () => [];
|
|
91
92
|
}
|
|
93
|
+
onUpdateContent() {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
92
96
|
}
|
|
93
97
|
exports.default = BlockView;
|
|
@@ -48,6 +48,10 @@ 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
|
+
]);
|
|
51
55
|
class CitationEditableView extends citation_1.CitationView {
|
|
52
56
|
constructor() {
|
|
53
57
|
super(...arguments);
|
|
@@ -185,13 +189,27 @@ class CitationEditableView extends citation_1.CitationView {
|
|
|
185
189
|
insertBibliographyNode(view, item) {
|
|
186
190
|
const { doc, tr } = view.state;
|
|
187
191
|
const { DOI: doi, ['container-title']: containerTitle } = item, restAttr = __rest(item, ["DOI", 'container-title']);
|
|
188
|
-
|
|
192
|
+
let bibElement = null;
|
|
193
|
+
let pos = null;
|
|
194
|
+
doc.descendants((node, nodePos) => {
|
|
189
195
|
if (node.type === transform_1.schema.nodes.bibliography_element) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return false;
|
|
196
|
+
bibElement = node;
|
|
197
|
+
pos = nodePos;
|
|
193
198
|
}
|
|
194
199
|
});
|
|
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;
|
|
195
213
|
}
|
|
196
214
|
}
|
|
197
215
|
exports.CitationEditableView = CitationEditableView;
|
|
@@ -25,6 +25,15 @@ 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();
|
|
28
37
|
}
|
|
29
38
|
}
|
|
30
39
|
exports.FootnotesElementView = FootnotesElementView;
|
package/dist/es/commands.js
CHANGED
|
@@ -219,9 +219,6 @@ 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')));
|
|
225
222
|
export const insertInlineCitation = (state, dispatch, view, embeddedCitationItems = []) => {
|
|
226
223
|
const citation = buildCitation(state.selection.$anchor.parent.attrs.id, embeddedCitationItems);
|
|
227
224
|
const node = state.schema.nodes.citation.create({
|
|
@@ -232,9 +229,6 @@ export const insertInlineCitation = (state, dispatch, view, embeddedCitationItem
|
|
|
232
229
|
const pos = state.selection.to;
|
|
233
230
|
const { tr } = state;
|
|
234
231
|
tr.insert(pos, node);
|
|
235
|
-
if (needsBibliography(state)) {
|
|
236
|
-
tr.insert(tr.doc.content.size, createBibliographySection(state)).setMeta(bibliographyKey, { bibliographyInserted: true });
|
|
237
|
-
}
|
|
238
232
|
if (dispatch) {
|
|
239
233
|
const selection = NodeSelection.create(tr.doc, pos);
|
|
240
234
|
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, deep = false) => {
|
|
30
|
+
for (const node of iterateChildren(parent, deep)) {
|
|
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) => !!getMatchingChild(parent, (node) => node.type === nodeType);
|
|
43
|
+
export const getChildOfType = (parent, nodeType, deep = false) => !!getMatchingChild(parent, (node) => node.type.name === nodeType.name, deep);
|
|
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,6 +24,8 @@ 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');
|
|
27
29
|
this.dom.appendChild(this.contentDOM);
|
|
28
30
|
};
|
|
29
31
|
}
|
|
@@ -32,6 +32,7 @@ export default class BlockView extends BaseNodeView {
|
|
|
32
32
|
this.updateContents = () => {
|
|
33
33
|
this.updateClasses();
|
|
34
34
|
this.updateAttributes();
|
|
35
|
+
this.onUpdateContent();
|
|
35
36
|
};
|
|
36
37
|
this.updateClasses = () => {
|
|
37
38
|
if (!this.contentDOM) {
|
|
@@ -87,4 +88,7 @@ export default class BlockView extends BaseNodeView {
|
|
|
87
88
|
this.gutterButtons = () => [];
|
|
88
89
|
this.actionGutterButtons = () => [];
|
|
89
90
|
}
|
|
91
|
+
onUpdateContent() {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
90
94
|
}
|
|
@@ -42,6 +42,10 @@ 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
|
+
]);
|
|
45
49
|
export class CitationEditableView extends CitationView {
|
|
46
50
|
constructor() {
|
|
47
51
|
super(...arguments);
|
|
@@ -179,13 +183,27 @@ export class CitationEditableView extends CitationView {
|
|
|
179
183
|
insertBibliographyNode(view, item) {
|
|
180
184
|
const { doc, tr } = view.state;
|
|
181
185
|
const { DOI: doi, ['container-title']: containerTitle } = item, restAttr = __rest(item, ["DOI", 'container-title']);
|
|
182
|
-
|
|
186
|
+
let bibElement = null;
|
|
187
|
+
let pos = null;
|
|
188
|
+
doc.descendants((node, nodePos) => {
|
|
183
189
|
if (node.type === schema.nodes.bibliography_element) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return false;
|
|
190
|
+
bibElement = node;
|
|
191
|
+
pos = nodePos;
|
|
187
192
|
}
|
|
188
193
|
});
|
|
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;
|
|
189
207
|
}
|
|
190
208
|
}
|
|
191
209
|
export default createEditableNodeView(CitationEditableView);
|
|
@@ -19,6 +19,15 @@ 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();
|
|
22
31
|
}
|
|
23
32
|
}
|
|
24
33
|
export default createNodeOrElementView(FootnotesElementView, 'div');
|
|
@@ -38,6 +38,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
38
38
|
};
|
|
39
39
|
initialise: () => void;
|
|
40
40
|
updateContents: () => void;
|
|
41
|
+
onUpdateContent(): void;
|
|
41
42
|
updateClasses: () => void;
|
|
42
43
|
updateAttributes: () => void;
|
|
43
44
|
createElement: () => void;
|
|
@@ -75,6 +76,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
75
76
|
};
|
|
76
77
|
initialise: () => void;
|
|
77
78
|
updateContents: () => void;
|
|
79
|
+
onUpdateContent(): void;
|
|
78
80
|
updateClasses: () => void;
|
|
79
81
|
updateAttributes: () => void;
|
|
80
82
|
createElement: () => void;
|
|
@@ -112,6 +114,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
112
114
|
};
|
|
113
115
|
initialise: () => void;
|
|
114
116
|
updateContents: () => void;
|
|
117
|
+
onUpdateContent(): void;
|
|
115
118
|
updateClasses: () => void;
|
|
116
119
|
updateAttributes: () => void;
|
|
117
120
|
createElement: () => void;
|
|
@@ -152,6 +155,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
152
155
|
};
|
|
153
156
|
initialise: () => void;
|
|
154
157
|
updateContents: () => void;
|
|
158
|
+
onUpdateContent(): void;
|
|
155
159
|
updateClasses: () => void;
|
|
156
160
|
updateAttributes: () => void;
|
|
157
161
|
createElement: () => void;
|
|
@@ -190,6 +194,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
190
194
|
};
|
|
191
195
|
initialise: () => void;
|
|
192
196
|
updateContents: () => void;
|
|
197
|
+
onUpdateContent(): void;
|
|
193
198
|
updateClasses: () => void;
|
|
194
199
|
updateAttributes: () => void;
|
|
195
200
|
createElement: () => void;
|
|
@@ -227,6 +232,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
227
232
|
};
|
|
228
233
|
initialise: () => void;
|
|
229
234
|
updateContents: () => void;
|
|
235
|
+
onUpdateContent(): void;
|
|
230
236
|
updateClasses: () => void;
|
|
231
237
|
updateAttributes: () => void;
|
|
232
238
|
createElement: () => void;
|
|
@@ -271,6 +277,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
271
277
|
};
|
|
272
278
|
initialise: () => void;
|
|
273
279
|
updateContents: () => void;
|
|
280
|
+
onUpdateContent(): void;
|
|
274
281
|
updateClasses: () => void;
|
|
275
282
|
updateAttributes: () => void;
|
|
276
283
|
createElement: () => void;
|
|
@@ -308,6 +315,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
308
315
|
};
|
|
309
316
|
initialise: () => void;
|
|
310
317
|
updateContents: () => void;
|
|
318
|
+
onUpdateContent(): void;
|
|
311
319
|
updateClasses: () => void;
|
|
312
320
|
updateAttributes: () => void;
|
|
313
321
|
createElement: () => void;
|
|
@@ -345,6 +353,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
345
353
|
};
|
|
346
354
|
initialise: () => void;
|
|
347
355
|
updateContents: () => void;
|
|
356
|
+
onUpdateContent(): void;
|
|
348
357
|
updateClasses: () => void;
|
|
349
358
|
updateAttributes: () => void;
|
|
350
359
|
createElement: () => void;
|
|
@@ -383,6 +392,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
383
392
|
};
|
|
384
393
|
initialise: () => void;
|
|
385
394
|
updateContents: () => void;
|
|
395
|
+
onUpdateContent(): void;
|
|
386
396
|
updateClasses: () => void;
|
|
387
397
|
updateAttributes: () => void;
|
|
388
398
|
createElement: () => void;
|
|
@@ -420,6 +430,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
420
430
|
};
|
|
421
431
|
initialise: () => void;
|
|
422
432
|
updateContents: () => void;
|
|
433
|
+
onUpdateContent(): void;
|
|
423
434
|
updateClasses: () => void;
|
|
424
435
|
updateAttributes: () => void;
|
|
425
436
|
createElement: () => void;
|
|
@@ -457,6 +468,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
457
468
|
};
|
|
458
469
|
initialise: () => void;
|
|
459
470
|
updateContents: () => void;
|
|
471
|
+
onUpdateContent(): void;
|
|
460
472
|
updateClasses: () => void;
|
|
461
473
|
updateAttributes: () => void;
|
|
462
474
|
createElement: () => void;
|
|
@@ -495,6 +507,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
495
507
|
};
|
|
496
508
|
initialise: () => void;
|
|
497
509
|
updateContents: () => void;
|
|
510
|
+
onUpdateContent(): void;
|
|
498
511
|
updateClasses: () => void;
|
|
499
512
|
updateAttributes: () => void;
|
|
500
513
|
createElement: () => void;
|
|
@@ -532,6 +545,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
532
545
|
};
|
|
533
546
|
initialise: () => void;
|
|
534
547
|
updateContents: () => void;
|
|
548
|
+
onUpdateContent(): void;
|
|
535
549
|
updateClasses: () => void;
|
|
536
550
|
updateAttributes: () => void;
|
|
537
551
|
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) => ManuscriptNode | undefined;
|
|
19
|
+
export declare const getMatchingChild: (parent: ManuscriptNode, matcher: (node: ManuscriptNode) => boolean, deep?: 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) => boolean;
|
|
21
|
+
export declare const getChildOfType: (parent: ManuscriptNode, nodeType: ManuscriptNodeType, deep?: boolean) => 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,6 +28,7 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -23,6 +23,7 @@ export default class BlockView<T extends BaseNodeProps> extends BaseNodeView<T>
|
|
|
23
23
|
};
|
|
24
24
|
initialise: () => void;
|
|
25
25
|
updateContents: () => void;
|
|
26
|
+
onUpdateContent(): void;
|
|
26
27
|
updateClasses: () => void;
|
|
27
28
|
updateAttributes: () => void;
|
|
28
29
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -45,6 +45,7 @@ export declare const EditableBlock: <T extends Constructor<BlockView<EditableBlo
|
|
|
45
45
|
};
|
|
46
46
|
initialise: () => void;
|
|
47
47
|
updateContents: () => void;
|
|
48
|
+
onUpdateContent(): void;
|
|
48
49
|
updateClasses: () => void;
|
|
49
50
|
updateAttributes: () => void;
|
|
50
51
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -17,6 +17,8 @@ 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;
|
|
20
22
|
}
|
|
21
23
|
declare const _default: (props: BaseNodeProps) => import("../types").NodeViewCreator<FootnotesElementView<any>>;
|
|
22
24
|
export default _default;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
createElement: () => void;
|
|
@@ -28,6 +28,7 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
|
|
|
28
28
|
};
|
|
29
29
|
initialise: () => void;
|
|
30
30
|
updateContents: () => void;
|
|
31
|
+
onUpdateContent(): void;
|
|
31
32
|
updateClasses: () => void;
|
|
32
33
|
updateAttributes: () => void;
|
|
33
34
|
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.8",
|
|
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/style-guide": "^1.4.3",
|
|
34
34
|
"@manuscripts/title-editor": "^1.1.0",
|
|
35
35
|
"@manuscripts/track-changes-plugin": "^1.7.3",
|
|
36
|
-
"@manuscripts/transform": "1.5.
|
|
36
|
+
"@manuscripts/transform": "1.5.3",
|
|
37
37
|
"astrocite-eutils": "^0.16.4",
|
|
38
38
|
"axios": "^1.2.2",
|
|
39
39
|
"codemirror": "^5.58.1",
|