@manuscripts/body-editor 1.5.7 → 1.5.8-LEAN-2852
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 +2 -8
- package/dist/cjs/components/outline/DraggableTree.js +31 -30
- package/dist/cjs/components/outline/ManuscriptOutline.js +2 -13
- package/dist/cjs/components/outline/OutlineManuscript.js +2 -9
- package/dist/cjs/configs/editor-views.js +4 -0
- package/dist/cjs/lib/utils.js +3 -3
- package/dist/cjs/node-type-icons.js +1 -4
- 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/contributors_section.js +36 -0
- package/dist/cjs/views/footnotes_element.js +9 -0
- package/dist/cjs/views/title.js +37 -0
- package/dist/cjs/views/title_editable.js +20 -0
- package/dist/es/commands.js +2 -8
- package/dist/es/components/outline/DraggableTree.js +32 -31
- package/dist/es/components/outline/ManuscriptOutline.js +2 -13
- package/dist/es/components/outline/OutlineManuscript.js +4 -11
- package/dist/es/configs/editor-views.js +4 -0
- package/dist/es/lib/utils.js +3 -3
- package/dist/es/node-type-icons.js +1 -4
- 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/contributors_section.js +29 -0
- package/dist/es/views/footnotes_element.js +9 -0
- package/dist/es/views/title.js +33 -0
- package/dist/es/views/title_editable.js +18 -0
- package/dist/types/components/outline/DraggableTree.d.ts +0 -1
- package/dist/types/components/outline/OutlineManuscript.d.ts +2 -0
- package/dist/types/configs/editor-views.d.ts +16 -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/contributors_section.d.ts +17 -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/title.d.ts +24 -0
- package/dist/types/views/title_editable.d.ts +18 -0
- package/dist/types/views/toc_element_editable.d.ts +1 -0
- package/package.json +5 -5
- package/styles/AdvancedEditor.css +24 -0
- package/styles/Editor.css +8 -0
|
@@ -18,6 +18,7 @@ import bibliographyItem from '../views/bibliography_item_editable';
|
|
|
18
18
|
import blockquoteElement from '../views/blockquote_element_editable';
|
|
19
19
|
import bulletList from '../views/bullet_list_editable';
|
|
20
20
|
import citation from '../views/citation_editable';
|
|
21
|
+
import contributorsSection from '../views/contributors_section';
|
|
21
22
|
import crossReference from '../views/cross_reference_editable';
|
|
22
23
|
import equation from '../views/equation_editable';
|
|
23
24
|
import equationElement from '../views/equation_element_editable';
|
|
@@ -41,15 +42,18 @@ import pullquoteElement from '../views/pullquote_element_editable';
|
|
|
41
42
|
import sectionLabel from '../views/section_label';
|
|
42
43
|
import sectionTitle from '../views/section_title_editable';
|
|
43
44
|
import tableElement from '../views/table_element_editable';
|
|
45
|
+
import title from '../views/title_editable';
|
|
44
46
|
import tocElement from '../views/toc_element_editable';
|
|
45
47
|
export default (props, dispatch) => {
|
|
46
48
|
return {
|
|
49
|
+
title: title(props, dispatch),
|
|
47
50
|
bibliography_item: bibliographyItem(props),
|
|
48
51
|
bibliography_element: bibliographyElement(props),
|
|
49
52
|
blockquote_element: blockquoteElement(props),
|
|
50
53
|
bullet_list: bulletList(props),
|
|
51
54
|
citation: citation(props),
|
|
52
55
|
cross_reference: crossReference(props),
|
|
56
|
+
contributors_section: contributorsSection(props, dispatch),
|
|
53
57
|
equation: equation(props),
|
|
54
58
|
equation_element: equationElement(props),
|
|
55
59
|
figure: figure(props, dispatch),
|
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));
|
|
@@ -23,11 +23,11 @@ import SectionIcon from '@manuscripts/assets/react/OutlineIconSection';
|
|
|
23
23
|
import TableIcon from '@manuscripts/assets/react/OutlineIconTable';
|
|
24
24
|
import BulletListIcon from '@manuscripts/assets/react/OutlineIconUnorderedList';
|
|
25
25
|
import { BlockQuoteIcon, PullQuoteIcon } from '@manuscripts/style-guide';
|
|
26
|
-
import { schema as titleSchema } from '@manuscripts/title-editor';
|
|
27
26
|
import { schema } from '@manuscripts/transform';
|
|
28
27
|
import React from 'react';
|
|
29
28
|
const { nodes } = schema;
|
|
30
29
|
const icons = new Map([
|
|
30
|
+
[nodes.manuscript, ManuscriptIcon],
|
|
31
31
|
[nodes.bibliography_section, SectionIcon],
|
|
32
32
|
[nodes.blockquote_element, BlockQuoteIcon],
|
|
33
33
|
[nodes.bullet_list, BulletListIcon],
|
|
@@ -46,9 +46,6 @@ const icons = new Map([
|
|
|
46
46
|
[nodes.footnotes_section, SectionIcon],
|
|
47
47
|
]);
|
|
48
48
|
export const nodeTypeIcon = (nodeType) => {
|
|
49
|
-
if (nodeType === titleSchema.nodes.title) {
|
|
50
|
-
return React.createElement(ManuscriptIcon, null);
|
|
51
|
-
}
|
|
52
49
|
const Icon = icons.get(nodeType);
|
|
53
50
|
return Icon ? React.createElement(Icon, null) : null;
|
|
54
51
|
};
|
|
@@ -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);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseNodeView } from './base_node_view';
|
|
2
|
+
import { createNodeView } from './creators';
|
|
3
|
+
import ReactSubView from './ReactSubView';
|
|
4
|
+
export class ContributorsSectionView extends BaseNodeView {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.initialise = () => {
|
|
8
|
+
this.createDOM();
|
|
9
|
+
};
|
|
10
|
+
this.createDOM = () => {
|
|
11
|
+
this.dom = document.createElement('div');
|
|
12
|
+
this.dom.classList.add('contributors');
|
|
13
|
+
const can = this.props.getCapabilities();
|
|
14
|
+
const { components: { MetadataContainer }, subscribeStore, } = this.props;
|
|
15
|
+
this.metadata = ReactSubView(this.props, MetadataContainer, {
|
|
16
|
+
allowInvitingAuthors: false,
|
|
17
|
+
showAuthorEditButton: true,
|
|
18
|
+
disableEditButton: !can.editMetadata,
|
|
19
|
+
subscribe: subscribeStore,
|
|
20
|
+
}, this.node, this.getPos, this.view, 'metadata-container');
|
|
21
|
+
if (this.metadata) {
|
|
22
|
+
this.dom.appendChild(this.metadata);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
this.ignoreMutation = () => true;
|
|
26
|
+
this.stopEvent = () => true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export default createNodeView(ContributorsSectionView);
|
|
@@ -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');
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { BaseNodeView } from './base_node_view';
|
|
17
|
+
import { createNodeView } from './creators';
|
|
18
|
+
export class TitleView extends BaseNodeView {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.initialise = () => {
|
|
22
|
+
this.createDOM();
|
|
23
|
+
};
|
|
24
|
+
this.createDOM = () => {
|
|
25
|
+
this.dom = document.createElement('div');
|
|
26
|
+
this.dom.classList.add('manuscript-title');
|
|
27
|
+
this.contentDOM = document.createElement('div');
|
|
28
|
+
this.contentDOM.classList.add('article-titles');
|
|
29
|
+
this.dom.appendChild(this.contentDOM);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export default createNodeView(TitleView);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { createEditableNodeView } from './creators';
|
|
17
|
+
import { TitleView } from './title';
|
|
18
|
+
export default createEditableNodeView(TitleView);
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Manuscript, Project } from '@manuscripts/json-schema';
|
|
17
|
+
import { ManuscriptNode } from '@manuscripts/transform';
|
|
17
18
|
import React from 'react';
|
|
18
19
|
interface Props {
|
|
19
20
|
project: Project;
|
|
20
21
|
manuscript: Manuscript;
|
|
22
|
+
doc: ManuscriptNode;
|
|
21
23
|
}
|
|
22
24
|
export declare const OutlineManuscript: React.FunctionComponent<Props>;
|
|
23
25
|
export {};
|
|
@@ -23,6 +23,7 @@ type EditorProps = EditableBlockProps & CitationEditableProps & FigureProps & Ke
|
|
|
23
23
|
theme: DefaultTheme;
|
|
24
24
|
};
|
|
25
25
|
declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
26
|
+
title: import("../types").NodeViewCreator<import("../views/title").TitleView<any>>;
|
|
26
27
|
bibliography_item: import("../types").NodeViewCreator<import("../views/bibliography_item").BibliographyItemView<any>>;
|
|
27
28
|
bibliography_element: import("../types").NodeViewCreator<{
|
|
28
29
|
gutterButtons: () => HTMLElement[];
|
|
@@ -38,6 +39,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
38
39
|
};
|
|
39
40
|
initialise: () => void;
|
|
40
41
|
updateContents: () => void;
|
|
42
|
+
onUpdateContent(): void;
|
|
41
43
|
updateClasses: () => void;
|
|
42
44
|
updateAttributes: () => void;
|
|
43
45
|
createElement: () => void;
|
|
@@ -75,6 +77,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
75
77
|
};
|
|
76
78
|
initialise: () => void;
|
|
77
79
|
updateContents: () => void;
|
|
80
|
+
onUpdateContent(): void;
|
|
78
81
|
updateClasses: () => void;
|
|
79
82
|
updateAttributes: () => void;
|
|
80
83
|
createElement: () => void;
|
|
@@ -112,6 +115,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
112
115
|
};
|
|
113
116
|
initialise: () => void;
|
|
114
117
|
updateContents: () => void;
|
|
118
|
+
onUpdateContent(): void;
|
|
115
119
|
updateClasses: () => void;
|
|
116
120
|
updateAttributes: () => void;
|
|
117
121
|
createElement: () => void;
|
|
@@ -137,6 +141,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
137
141
|
} & import("../views/bullet_list").BulletListView<any>>;
|
|
138
142
|
citation: import("../types").NodeViewCreator<import("../views/citation_editable").CitationEditableView>;
|
|
139
143
|
cross_reference: import("../types").NodeViewCreator<import("../views/cross_reference_editable").CrossReferenceEditableView>;
|
|
144
|
+
contributors_section: import("../types").NodeViewCreator<import("../views/contributors_section").ContributorsSectionView<any>>;
|
|
140
145
|
equation: import("../types").NodeViewCreator<import("../views/equation_editable").EquationEditableView>;
|
|
141
146
|
equation_element: import("../types").NodeViewCreator<{
|
|
142
147
|
gutterButtons: () => HTMLElement[];
|
|
@@ -152,6 +157,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
152
157
|
};
|
|
153
158
|
initialise: () => void;
|
|
154
159
|
updateContents: () => void;
|
|
160
|
+
onUpdateContent(): void;
|
|
155
161
|
updateClasses: () => void;
|
|
156
162
|
updateAttributes: () => void;
|
|
157
163
|
createElement: () => void;
|
|
@@ -190,6 +196,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
190
196
|
};
|
|
191
197
|
initialise: () => void;
|
|
192
198
|
updateContents: () => void;
|
|
199
|
+
onUpdateContent(): void;
|
|
193
200
|
updateClasses: () => void;
|
|
194
201
|
updateAttributes: () => void;
|
|
195
202
|
createElement: () => void;
|
|
@@ -227,6 +234,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
227
234
|
};
|
|
228
235
|
initialise: () => void;
|
|
229
236
|
updateContents: () => void;
|
|
237
|
+
onUpdateContent(): void;
|
|
230
238
|
updateClasses: () => void;
|
|
231
239
|
updateAttributes: () => void;
|
|
232
240
|
createElement: () => void;
|
|
@@ -271,6 +279,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
271
279
|
};
|
|
272
280
|
initialise: () => void;
|
|
273
281
|
updateContents: () => void;
|
|
282
|
+
onUpdateContent(): void;
|
|
274
283
|
updateClasses: () => void;
|
|
275
284
|
updateAttributes: () => void;
|
|
276
285
|
createElement: () => void;
|
|
@@ -308,6 +317,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
308
317
|
};
|
|
309
318
|
initialise: () => void;
|
|
310
319
|
updateContents: () => void;
|
|
320
|
+
onUpdateContent(): void;
|
|
311
321
|
updateClasses: () => void;
|
|
312
322
|
updateAttributes: () => void;
|
|
313
323
|
createElement: () => void;
|
|
@@ -345,6 +355,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
345
355
|
};
|
|
346
356
|
initialise: () => void;
|
|
347
357
|
updateContents: () => void;
|
|
358
|
+
onUpdateContent(): void;
|
|
348
359
|
updateClasses: () => void;
|
|
349
360
|
updateAttributes: () => void;
|
|
350
361
|
createElement: () => void;
|
|
@@ -383,6 +394,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
383
394
|
};
|
|
384
395
|
initialise: () => void;
|
|
385
396
|
updateContents: () => void;
|
|
397
|
+
onUpdateContent(): void;
|
|
386
398
|
updateClasses: () => void;
|
|
387
399
|
updateAttributes: () => void;
|
|
388
400
|
createElement: () => void;
|
|
@@ -420,6 +432,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
420
432
|
};
|
|
421
433
|
initialise: () => void;
|
|
422
434
|
updateContents: () => void;
|
|
435
|
+
onUpdateContent(): void;
|
|
423
436
|
updateClasses: () => void;
|
|
424
437
|
updateAttributes: () => void;
|
|
425
438
|
createElement: () => void;
|
|
@@ -457,6 +470,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
457
470
|
};
|
|
458
471
|
initialise: () => void;
|
|
459
472
|
updateContents: () => void;
|
|
473
|
+
onUpdateContent(): void;
|
|
460
474
|
updateClasses: () => void;
|
|
461
475
|
updateAttributes: () => void;
|
|
462
476
|
createElement: () => void;
|
|
@@ -495,6 +509,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
495
509
|
};
|
|
496
510
|
initialise: () => void;
|
|
497
511
|
updateContents: () => void;
|
|
512
|
+
onUpdateContent(): void;
|
|
498
513
|
updateClasses: () => void;
|
|
499
514
|
updateAttributes: () => void;
|
|
500
515
|
createElement: () => void;
|
|
@@ -532,6 +547,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
532
547
|
};
|
|
533
548
|
initialise: () => void;
|
|
534
549
|
updateContents: () => void;
|
|
550
|
+
onUpdateContent(): void;
|
|
535
551
|
updateClasses: () => void;
|
|
536
552
|
updateAttributes: () => void;
|
|
537
553
|
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ManuscriptNodeView } from '@manuscripts/transform';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseNodeView } from './base_node_view';
|
|
4
|
+
import { EditableBlockProps } from './editable_block';
|
|
5
|
+
export interface ContributorsSectionProps extends EditableBlockProps {
|
|
6
|
+
components: Record<string, React.ComponentType<any>>;
|
|
7
|
+
subscribeStore: any;
|
|
8
|
+
}
|
|
9
|
+
export declare class ContributorsSectionView<PropsType extends ContributorsSectionProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
|
|
10
|
+
private metadata;
|
|
11
|
+
initialise: () => void;
|
|
12
|
+
protected createDOM: () => void;
|
|
13
|
+
ignoreMutation: () => boolean;
|
|
14
|
+
stopEvent: () => boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: (props: import("./base_node_view").BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<ContributorsSectionView<any>>;
|
|
17
|
+
export default _default;
|
|
@@ -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;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { ManuscriptNodeView } from '@manuscripts/transform';
|
|
17
|
+
import { BaseNodeProps, BaseNodeView } from './base_node_view';
|
|
18
|
+
export declare class TitleView<PropsType extends BaseNodeProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
|
|
19
|
+
contentDOM: HTMLElement;
|
|
20
|
+
initialise: () => void;
|
|
21
|
+
protected createDOM: () => void;
|
|
22
|
+
}
|
|
23
|
+
declare const _default: (props: BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<TitleView<any>>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { TitleView } from './title';
|
|
17
|
+
declare const _default: (props: import("./editable_block").EditableBlockProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<TitleView<any>>;
|
|
18
|
+
export default _default;
|
|
@@ -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;
|