@manuscripts/body-editor 2.0.45-LEAN-3931.0 → 2.0.45
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/configs/editor-views.js +1 -1
- package/dist/cjs/lib/math.js +2 -29
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/ReactSubView.js +3 -2
- package/dist/cjs/views/bibliography_element.js +1 -0
- package/dist/cjs/views/cross_reference.js +1 -2
- package/dist/cjs/views/cross_reference_editable.js +1 -2
- package/dist/cjs/views/figure_element.js +1 -1
- package/dist/cjs/views/inline_footnote.js +3 -1
- package/dist/es/configs/editor-views.js +1 -1
- package/dist/es/lib/math.js +2 -29
- package/dist/es/versions.js +1 -1
- package/dist/es/views/ReactSubView.js +3 -2
- package/dist/es/views/bibliography_element.js +2 -1
- package/dist/es/views/cross_reference.js +1 -2
- package/dist/es/views/cross_reference_editable.js +1 -2
- package/dist/es/views/editable_block.js +1 -1
- package/dist/es/views/figure_element.js +1 -1
- package/dist/es/views/inline_footnote.js +3 -1
- package/dist/types/configs/ManuscriptsEditor.d.ts +2 -1
- package/dist/types/configs/editor-views.d.ts +45 -50
- package/dist/types/lib/context-menu.d.ts +2 -2
- package/dist/types/types.d.ts +3 -0
- package/dist/types/versions.d.ts +1 -1
- package/dist/types/views/ReactSubView.d.ts +5 -4
- package/dist/types/views/affiliations.d.ts +3 -2
- package/dist/types/views/author_notes.d.ts +3 -3
- package/dist/types/views/base_node_view.d.ts +5 -5
- package/dist/types/views/bibliography_element.d.ts +4 -3
- package/dist/types/views/bibliography_element_editable.d.ts +3 -3
- package/dist/types/views/block_view.d.ts +3 -3
- package/dist/types/views/blockquote_element.d.ts +3 -3
- package/dist/types/views/blockquote_element_editable.d.ts +3 -3
- package/dist/types/views/bullet_list.d.ts +4 -4
- package/dist/types/views/bullet_list_editable.d.ts +3 -3
- package/dist/types/views/citation.d.ts +5 -4
- package/dist/types/views/citation_editable.d.ts +2 -3
- package/dist/types/views/contributors.d.ts +3 -2
- package/dist/types/views/creators.d.ts +4 -4
- package/dist/types/views/cross_reference.d.ts +4 -3
- package/dist/types/views/cross_reference_editable.d.ts +3 -4
- package/dist/types/views/editable_block.d.ts +2 -11
- package/dist/types/views/equation.d.ts +4 -4
- package/dist/types/views/equation_editable.d.ts +2 -3
- package/dist/types/views/equation_element.d.ts +4 -3
- package/dist/types/views/equation_element_editable.d.ts +3 -3
- package/dist/types/views/figure.d.ts +5 -4
- package/dist/types/views/figure_editable.d.ts +2 -11
- package/dist/types/views/figure_element.d.ts +3 -7
- package/dist/types/views/figure_element_editable.d.ts +2 -2
- package/dist/types/views/footnote.d.ts +3 -4
- package/dist/types/views/footnote_editable.d.ts +3 -3
- package/dist/types/views/footnotes_element.d.ts +3 -3
- package/dist/types/views/footnotes_element_editable.d.ts +3 -3
- package/dist/types/views/inline_equation.d.ts +4 -4
- package/dist/types/views/inline_equation_editable.d.ts +2 -3
- package/dist/types/views/inline_footnote.d.ts +4 -4
- package/dist/types/views/inline_footnote_editable.d.ts +1 -1
- package/dist/types/views/keyword.d.ts +3 -3
- package/dist/types/views/keyword_group.d.ts +2 -2
- package/dist/types/views/link.d.ts +5 -4
- package/dist/types/views/link_editable.d.ts +2 -3
- package/dist/types/views/list.d.ts +6 -6
- package/dist/types/views/list_item.d.ts +3 -4
- package/dist/types/views/ordered_list.d.ts +4 -4
- package/dist/types/views/ordered_list_editable.d.ts +3 -3
- package/dist/types/views/paragraph.d.ts +3 -3
- package/dist/types/views/paragraph_editable.d.ts +3 -3
- package/dist/types/views/placeholder.d.ts +4 -4
- package/dist/types/views/placeholder_element.d.ts +3 -3
- package/dist/types/views/placeholder_element_editable.d.ts +3 -3
- package/dist/types/views/pullquote_element.d.ts +3 -3
- package/dist/types/views/pullquote_element_editable.d.ts +3 -3
- package/dist/types/views/section.d.ts +3 -3
- package/dist/types/views/section_title.d.ts +3 -3
- package/dist/types/views/section_title_editable.d.ts +3 -3
- package/dist/types/views/table_cell.d.ts +2 -2
- package/dist/types/views/table_element.d.ts +2 -3
- package/dist/types/views/table_element_editable.d.ts +2 -2
- package/dist/types/views/table_element_footer.d.ts +4 -4
- package/dist/types/views/table_element_footer_editable.d.ts +1 -1
- package/dist/types/views/title.d.ts +4 -4
- package/dist/types/views/title_editable.d.ts +1 -1
- package/dist/types/views/toc_element.d.ts +3 -3
- package/dist/types/views/toc_element_editable.d.ts +3 -3
- package/package.json +3 -3
|
@@ -56,7 +56,6 @@ exports.default = (props, dispatch) => {
|
|
|
56
56
|
title: (0, title_editable_1.default)(props, dispatch),
|
|
57
57
|
bibliography_element: (0, bibliography_element_editable_1.default)(props, dispatch),
|
|
58
58
|
blockquote_element: (0, blockquote_element_editable_1.default)(props),
|
|
59
|
-
list: (0, list_1.default)(props),
|
|
60
59
|
citation: (0, citation_editable_1.default)(props, dispatch),
|
|
61
60
|
cross_reference: (0, cross_reference_editable_1.default)(props, dispatch),
|
|
62
61
|
contributors: (0, contributors_1.default)(props, dispatch),
|
|
@@ -72,6 +71,7 @@ exports.default = (props, dispatch) => {
|
|
|
72
71
|
keyword: (0, keyword_1.default)(props, dispatch),
|
|
73
72
|
keyword_group: (0, keyword_group_1.default)(props, dispatch),
|
|
74
73
|
link: (0, link_editable_1.default)(props, dispatch),
|
|
74
|
+
list: (0, list_1.default)(props),
|
|
75
75
|
list_item: (0, list_item_1.default)(props),
|
|
76
76
|
paragraph: (0, paragraph_editable_1.default)(props),
|
|
77
77
|
placeholder: (0, placeholder_1.default)(props),
|
package/dist/cjs/lib/math.js
CHANGED
|
@@ -52,35 +52,8 @@ const renderMath = (node) => {
|
|
|
52
52
|
if (!window.MathJax) {
|
|
53
53
|
(0, exports.initMathJax)();
|
|
54
54
|
}
|
|
55
|
-
if (window.MathJax.typeset) {
|
|
56
|
-
|
|
57
|
-
awaitMounting(node).then(() => {
|
|
58
|
-
window.MathJax.typeset([node]);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
window.MathJax.typeset([node]);
|
|
63
|
-
}
|
|
55
|
+
if (window.MathJax.typeset && node.parentNode) {
|
|
56
|
+
window.MathJax.typeset([node]);
|
|
64
57
|
}
|
|
65
58
|
};
|
|
66
59
|
exports.renderMath = renderMath;
|
|
67
|
-
function awaitMounting(node) {
|
|
68
|
-
return new Promise(function (resolve, reject) {
|
|
69
|
-
let max = 10;
|
|
70
|
-
function wait() {
|
|
71
|
-
max--;
|
|
72
|
-
if (!node.parentNode) {
|
|
73
|
-
setTimeout(() => {
|
|
74
|
-
wait();
|
|
75
|
-
}, 0);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
resolve();
|
|
79
|
-
}
|
|
80
|
-
if (max <= 0) {
|
|
81
|
-
reject();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
wait();
|
|
85
|
-
});
|
|
86
|
-
}
|
package/dist/cjs/versions.js
CHANGED
|
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
const react_1 = __importDefault(require("react"));
|
|
22
22
|
const client_1 = require("react-dom/client");
|
|
23
23
|
const styled_components_1 = require("styled-components");
|
|
24
|
-
|
|
24
|
+
function createSubView(props, Component, componentProps, node, getPos, view, classNames = '') {
|
|
25
25
|
const container = document.createElement('div');
|
|
26
26
|
container.classList.add('tools-panel');
|
|
27
27
|
if (classNames) {
|
|
@@ -40,4 +40,5 @@ exports.default = (props, Component, componentProps, node, getPos, view, classNa
|
|
|
40
40
|
const root = (0, client_1.createRoot)(container);
|
|
41
41
|
root.render(react_1.default.createElement(Wrapped, null));
|
|
42
42
|
return container;
|
|
43
|
-
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = createSubView;
|
|
@@ -138,6 +138,7 @@ class BibliographyElementBlockView extends block_view_1.default {
|
|
|
138
138
|
const node = nodes.get(id);
|
|
139
139
|
const comment = (0, comments_1.createCommentMarker)('div', id);
|
|
140
140
|
element.prepend(comment);
|
|
141
|
+
node.attrs;
|
|
141
142
|
const attrs = node.attrs;
|
|
142
143
|
const change = (_a = attrs.dataTracked) === null || _a === void 0 ? void 0 : _a[0];
|
|
143
144
|
if (change) {
|
|
@@ -25,8 +25,7 @@ class CrossReferenceView extends base_node_view_1.BaseNodeView {
|
|
|
25
25
|
this.selectNode = () => {
|
|
26
26
|
};
|
|
27
27
|
this.handleClick = () => {
|
|
28
|
-
const
|
|
29
|
-
const rids = xref.attrs.rids;
|
|
28
|
+
const rids = this.node.attrs.rids;
|
|
30
29
|
if (!rids.length) {
|
|
31
30
|
return;
|
|
32
31
|
}
|
|
@@ -40,8 +40,7 @@ class CrossReferenceEditableView extends cross_reference_1.CrossReferenceView {
|
|
|
40
40
|
super(...arguments);
|
|
41
41
|
this.selectNode = () => {
|
|
42
42
|
const { getCapabilities } = this.props;
|
|
43
|
-
const
|
|
44
|
-
const rids = xref.attrs.rids;
|
|
43
|
+
const rids = this.node.attrs.rids;
|
|
45
44
|
const can = getCapabilities();
|
|
46
45
|
if (!(can === null || can === void 0 ? void 0 : can.editArticle) || rids.length) {
|
|
47
46
|
return;
|
|
@@ -66,7 +66,7 @@ class FigureElementView extends block_view_1.default {
|
|
|
66
66
|
}
|
|
67
67
|
this.contentDOM.setAttribute('data-figure-style', figureStyle);
|
|
68
68
|
this.contentDOM.setAttribute('data-figure-layout', figureLayout);
|
|
69
|
-
this.contentDOM.setAttribute('data-alignment', alignment);
|
|
69
|
+
this.contentDOM.setAttribute('data-alignment', alignment || '');
|
|
70
70
|
if (sizeFraction > 1) {
|
|
71
71
|
this.contentDOM.style.width = '100%';
|
|
72
72
|
this.contentDOM.style.padding = '0 !important';
|
|
@@ -170,7 +170,9 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
|
|
|
170
170
|
};
|
|
171
171
|
this.onInsert = (notes) => {
|
|
172
172
|
if (notes.length) {
|
|
173
|
-
const contents = this.node.attrs.contents
|
|
173
|
+
const contents = this.node.attrs.contents
|
|
174
|
+
.split(',')
|
|
175
|
+
.map((n) => parseInt(n));
|
|
174
176
|
const rids = notes.map((note) => note.node.attrs.id);
|
|
175
177
|
const { tr } = this.view.state;
|
|
176
178
|
if (rids.length) {
|
|
@@ -51,7 +51,6 @@ export default (props, dispatch) => {
|
|
|
51
51
|
title: title(props, dispatch),
|
|
52
52
|
bibliography_element: bibliographyElement(props, dispatch),
|
|
53
53
|
blockquote_element: blockquoteElement(props),
|
|
54
|
-
list: list(props),
|
|
55
54
|
citation: citation(props, dispatch),
|
|
56
55
|
cross_reference: crossReference(props, dispatch),
|
|
57
56
|
contributors: contributors(props, dispatch),
|
|
@@ -67,6 +66,7 @@ export default (props, dispatch) => {
|
|
|
67
66
|
keyword: keyword(props, dispatch),
|
|
68
67
|
keyword_group: keywordGroup(props, dispatch),
|
|
69
68
|
link: link(props, dispatch),
|
|
69
|
+
list: list(props),
|
|
70
70
|
list_item: list_item(props),
|
|
71
71
|
paragraph: paragraph(props),
|
|
72
72
|
placeholder: placeholder(props),
|
package/dist/es/lib/math.js
CHANGED
|
@@ -48,34 +48,7 @@ export const renderMath = (node) => {
|
|
|
48
48
|
if (!window.MathJax) {
|
|
49
49
|
initMathJax();
|
|
50
50
|
}
|
|
51
|
-
if (window.MathJax.typeset) {
|
|
52
|
-
|
|
53
|
-
awaitMounting(node).then(() => {
|
|
54
|
-
window.MathJax.typeset([node]);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
window.MathJax.typeset([node]);
|
|
59
|
-
}
|
|
51
|
+
if (window.MathJax.typeset && node.parentNode) {
|
|
52
|
+
window.MathJax.typeset([node]);
|
|
60
53
|
}
|
|
61
54
|
};
|
|
62
|
-
function awaitMounting(node) {
|
|
63
|
-
return new Promise(function (resolve, reject) {
|
|
64
|
-
let max = 10;
|
|
65
|
-
function wait() {
|
|
66
|
-
max--;
|
|
67
|
-
if (!node.parentNode) {
|
|
68
|
-
setTimeout(() => {
|
|
69
|
-
wait();
|
|
70
|
-
}, 0);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
resolve();
|
|
74
|
-
}
|
|
75
|
-
if (max <= 0) {
|
|
76
|
-
reject();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
wait();
|
|
80
|
-
});
|
|
81
|
-
}
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.0.45
|
|
1
|
+
export const VERSION = '2.0.45';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import React from 'react';
|
|
17
17
|
import { createRoot } from 'react-dom/client';
|
|
18
18
|
import { ThemeProvider } from 'styled-components';
|
|
19
|
-
|
|
19
|
+
function createSubView(props, Component, componentProps, node, getPos, view, classNames = '') {
|
|
20
20
|
const container = document.createElement('div');
|
|
21
21
|
container.classList.add('tools-panel');
|
|
22
22
|
if (classNames) {
|
|
@@ -35,4 +35,5 @@ export default (props, Component, componentProps, node, getPos, view, classNames
|
|
|
35
35
|
const root = createRoot(container);
|
|
36
36
|
root.render(React.createElement(Wrapped, null));
|
|
37
37
|
return container;
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
|
+
export default createSubView;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { ContextMenu } from '@manuscripts/style-guide';
|
|
17
|
-
import { schema } from '@manuscripts/transform';
|
|
17
|
+
import { schema, } from '@manuscripts/transform';
|
|
18
18
|
import { NodeSelection } from 'prosemirror-state';
|
|
19
19
|
import { addNodeComment } from '../commands';
|
|
20
20
|
import { ReferencesEditor, } from '../components/references/ReferencesEditor';
|
|
@@ -132,6 +132,7 @@ export class BibliographyElementBlockView extends BlockView {
|
|
|
132
132
|
const node = nodes.get(id);
|
|
133
133
|
const comment = createCommentMarker('div', id);
|
|
134
134
|
element.prepend(comment);
|
|
135
|
+
node.attrs;
|
|
135
136
|
const attrs = node.attrs;
|
|
136
137
|
const change = (_a = attrs.dataTracked) === null || _a === void 0 ? void 0 : _a[0];
|
|
137
138
|
if (change) {
|
|
@@ -34,8 +34,7 @@ export class CrossReferenceEditableView extends CrossReferenceView {
|
|
|
34
34
|
super(...arguments);
|
|
35
35
|
this.selectNode = () => {
|
|
36
36
|
const { getCapabilities } = this.props;
|
|
37
|
-
const
|
|
38
|
-
const rids = xref.attrs.rids;
|
|
37
|
+
const rids = this.node.attrs.rids;
|
|
39
38
|
const can = getCapabilities();
|
|
40
39
|
if (!(can === null || can === void 0 ? void 0 : can.editArticle) || rids.length) {
|
|
41
40
|
return;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { schema } from '@manuscripts/transform';
|
|
16
|
+
import { schema, } from '@manuscripts/transform';
|
|
17
17
|
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
18
18
|
import { ContextMenu, contextMenuBtnClass } from '../lib/context-menu';
|
|
19
19
|
const isNotNull = (a) => a !== null;
|
|
@@ -60,7 +60,7 @@ export class FigureElementView extends BlockView {
|
|
|
60
60
|
}
|
|
61
61
|
this.contentDOM.setAttribute('data-figure-style', figureStyle);
|
|
62
62
|
this.contentDOM.setAttribute('data-figure-layout', figureLayout);
|
|
63
|
-
this.contentDOM.setAttribute('data-alignment', alignment);
|
|
63
|
+
this.contentDOM.setAttribute('data-alignment', alignment || '');
|
|
64
64
|
if (sizeFraction > 1) {
|
|
65
65
|
this.contentDOM.style.width = '100%';
|
|
66
66
|
this.contentDOM.style.padding = '0 !important';
|
|
@@ -164,7 +164,9 @@ export class InlineFootnoteView extends BaseNodeView {
|
|
|
164
164
|
};
|
|
165
165
|
this.onInsert = (notes) => {
|
|
166
166
|
if (notes.length) {
|
|
167
|
-
const contents = this.node.attrs.contents
|
|
167
|
+
const contents = this.node.attrs.contents
|
|
168
|
+
.split(',')
|
|
169
|
+
.map((n) => parseInt(n));
|
|
168
170
|
const rids = notes.map((note) => note.node.attrs.id);
|
|
169
171
|
const { tr } = this.view.state;
|
|
170
172
|
if (rids.length) {
|
|
@@ -49,7 +49,8 @@ export interface EditorProps {
|
|
|
49
49
|
collabProvider?: CollabProvider;
|
|
50
50
|
navigate: NavigateFunction;
|
|
51
51
|
location: Location;
|
|
52
|
+
dispatch?: Dispatch;
|
|
52
53
|
}
|
|
53
|
-
export type ExternalProps = Omit<EditorProps, 'popper'>;
|
|
54
|
+
export type ExternalProps = Omit<EditorProps, 'popper' | 'dispatch'>;
|
|
54
55
|
export declare const createEditorState: (props: EditorProps) => EditorState;
|
|
55
56
|
export declare const createEditorView: (props: EditorProps, root: HTMLElement, state: EditorState, dispatch: Dispatch) => EditorView;
|
|
@@ -13,15 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { DefaultTheme } from 'styled-components';
|
|
17
16
|
import { Dispatch } from '../commands';
|
|
18
|
-
import {
|
|
19
|
-
import { FigureProps } from '../views/figure_editable';
|
|
20
|
-
type EditorProps = EditableBlockProps & FigureProps & {
|
|
21
|
-
theme: DefaultTheme;
|
|
22
|
-
};
|
|
17
|
+
import { EditorProps } from './ManuscriptsEditor';
|
|
23
18
|
declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
24
|
-
title: import("../types").NodeViewCreator<import("../views/title").TitleView
|
|
19
|
+
title: import("../types").NodeViewCreator<import("../views/title").TitleView>;
|
|
25
20
|
bibliography_element: import("../types").NodeViewCreator<{
|
|
26
21
|
gutterButtons: () => HTMLElement[];
|
|
27
22
|
actionGutterButtons: () => HTMLElement[];
|
|
@@ -45,7 +40,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
45
40
|
contentDOM?: HTMLElement | undefined;
|
|
46
41
|
syncErrors: import("../types").SyncError[];
|
|
47
42
|
elementType: string;
|
|
48
|
-
readonly props:
|
|
43
|
+
readonly props: EditorProps;
|
|
49
44
|
node: import("prosemirror-model").Node;
|
|
50
45
|
readonly view: import("prosemirror-view").EditorView;
|
|
51
46
|
readonly getPos: () => number;
|
|
@@ -56,7 +51,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
56
51
|
deselectNode: () => void;
|
|
57
52
|
destroy: () => void;
|
|
58
53
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
59
|
-
} & import("../views/bibliography_element").BibliographyElementBlockView
|
|
54
|
+
} & import("../views/bibliography_element").BibliographyElementBlockView>;
|
|
60
55
|
blockquote_element: import("../types").NodeViewCreator<{
|
|
61
56
|
gutterButtons: () => HTMLElement[];
|
|
62
57
|
actionGutterButtons: () => HTMLElement[];
|
|
@@ -80,7 +75,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
80
75
|
contentDOM?: HTMLElement | undefined;
|
|
81
76
|
syncErrors: import("../types").SyncError[];
|
|
82
77
|
elementType: string;
|
|
83
|
-
readonly props:
|
|
78
|
+
readonly props: EditorProps;
|
|
84
79
|
node: import("prosemirror-model").Node;
|
|
85
80
|
readonly view: import("prosemirror-view").EditorView;
|
|
86
81
|
readonly getPos: () => number;
|
|
@@ -91,8 +86,13 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
91
86
|
deselectNode: () => void;
|
|
92
87
|
destroy: () => void;
|
|
93
88
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
94
|
-
} & import("../views/blockquote_element").BlockquoteElementView
|
|
95
|
-
|
|
89
|
+
} & import("../views/blockquote_element").BlockquoteElementView>;
|
|
90
|
+
citation: import("../types").NodeViewCreator<import("../views/citation_editable").CitationEditableView>;
|
|
91
|
+
cross_reference: import("../types").NodeViewCreator<import("../views/cross_reference_editable").CrossReferenceEditableView>;
|
|
92
|
+
contributors: import("../types").NodeViewCreator<import("../views/contributors").ContributorsView>;
|
|
93
|
+
affiliations: import("../types").NodeViewCreator<import("../views/affiliations").AffiliationsView>;
|
|
94
|
+
equation: import("../types").NodeViewCreator<import("../views/equation_editable").EquationEditableView>;
|
|
95
|
+
equation_element: import("../types").NodeViewCreator<{
|
|
96
96
|
gutterButtons: () => HTMLElement[];
|
|
97
97
|
actionGutterButtons: () => HTMLElement[];
|
|
98
98
|
createAddButton: () => HTMLElement | null;
|
|
@@ -115,7 +115,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
115
115
|
contentDOM?: HTMLElement | undefined;
|
|
116
116
|
syncErrors: import("../types").SyncError[];
|
|
117
117
|
elementType: string;
|
|
118
|
-
readonly props:
|
|
118
|
+
readonly props: EditorProps;
|
|
119
119
|
node: import("prosemirror-model").Node;
|
|
120
120
|
readonly view: import("prosemirror-view").EditorView;
|
|
121
121
|
readonly getPos: () => number;
|
|
@@ -126,13 +126,9 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
126
126
|
deselectNode: () => void;
|
|
127
127
|
destroy: () => void;
|
|
128
128
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
129
|
-
} & import("../views/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
contributors: import("../types").NodeViewCreator<import("../views/contributors").ContributorsView>;
|
|
133
|
-
affiliations: import("../types").NodeViewCreator<import("../views/affiliations").AffiliationsView>;
|
|
134
|
-
equation: import("../types").NodeViewCreator<import("../views/equation_editable").EquationEditableView>;
|
|
135
|
-
equation_element: import("../types").NodeViewCreator<{
|
|
129
|
+
} & import("../views/equation_element").EquationElementView>;
|
|
130
|
+
figure: import("../types").NodeViewCreator<import("../views/figure_editable").FigureEditableView>;
|
|
131
|
+
figure_element: import("../types").NodeViewCreator<{
|
|
136
132
|
gutterButtons: () => HTMLElement[];
|
|
137
133
|
actionGutterButtons: () => HTMLElement[];
|
|
138
134
|
createAddButton: () => HTMLElement | null;
|
|
@@ -155,7 +151,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
155
151
|
contentDOM?: HTMLElement | undefined;
|
|
156
152
|
syncErrors: import("../types").SyncError[];
|
|
157
153
|
elementType: string;
|
|
158
|
-
readonly props:
|
|
154
|
+
readonly props: EditorProps;
|
|
159
155
|
node: import("prosemirror-model").Node;
|
|
160
156
|
readonly view: import("prosemirror-view").EditorView;
|
|
161
157
|
readonly getPos: () => number;
|
|
@@ -166,9 +162,8 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
166
162
|
deselectNode: () => void;
|
|
167
163
|
destroy: () => void;
|
|
168
164
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
169
|
-
} & import("../views/
|
|
170
|
-
|
|
171
|
-
figure_element: import("../types").NodeViewCreator<{
|
|
165
|
+
} & import("../views/figure_element").FigureElementView>;
|
|
166
|
+
footnote: import("../types").NodeViewCreator<{
|
|
172
167
|
gutterButtons: () => HTMLElement[];
|
|
173
168
|
actionGutterButtons: () => HTMLElement[];
|
|
174
169
|
createAddButton: () => HTMLElement | null;
|
|
@@ -191,7 +186,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
191
186
|
contentDOM?: HTMLElement | undefined;
|
|
192
187
|
syncErrors: import("../types").SyncError[];
|
|
193
188
|
elementType: string;
|
|
194
|
-
readonly props:
|
|
189
|
+
readonly props: EditorProps;
|
|
195
190
|
node: import("prosemirror-model").Node;
|
|
196
191
|
readonly view: import("prosemirror-view").EditorView;
|
|
197
192
|
readonly getPos: () => number;
|
|
@@ -202,8 +197,14 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
202
197
|
deselectNode: () => void;
|
|
203
198
|
destroy: () => void;
|
|
204
199
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
205
|
-
} & import("../views/
|
|
206
|
-
|
|
200
|
+
} & import("../views/footnote").FootnoteView>;
|
|
201
|
+
footnotes_element: import("../types").NodeViewCreator<import("../views/footnotes_element").FootnotesElementView>;
|
|
202
|
+
inline_equation: import("../types").NodeViewCreator<import("../views/inline_equation_editable").InlineEquationEditableView>;
|
|
203
|
+
inline_footnote: import("../types").NodeViewCreator<import("../views/inline_footnote").InlineFootnoteView>;
|
|
204
|
+
keyword: import("../types").NodeViewCreator<import("../views/keyword").KeywordView>;
|
|
205
|
+
keyword_group: import("../types").NodeViewCreator<import("../views/keyword_group").KeywordGroupView>;
|
|
206
|
+
link: import("../types").NodeViewCreator<import("../views/link_editable").LinkEditableView>;
|
|
207
|
+
list: import("../types").NodeViewCreator<{
|
|
207
208
|
gutterButtons: () => HTMLElement[];
|
|
208
209
|
actionGutterButtons: () => HTMLElement[];
|
|
209
210
|
createAddButton: () => HTMLElement | null;
|
|
@@ -226,7 +227,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
226
227
|
contentDOM?: HTMLElement | undefined;
|
|
227
228
|
syncErrors: import("../types").SyncError[];
|
|
228
229
|
elementType: string;
|
|
229
|
-
readonly props:
|
|
230
|
+
readonly props: EditorProps;
|
|
230
231
|
node: import("prosemirror-model").Node;
|
|
231
232
|
readonly view: import("prosemirror-view").EditorView;
|
|
232
233
|
readonly getPos: () => number;
|
|
@@ -237,14 +238,8 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
237
238
|
deselectNode: () => void;
|
|
238
239
|
destroy: () => void;
|
|
239
240
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
240
|
-
} & import("../views/
|
|
241
|
-
|
|
242
|
-
inline_equation: import("../types").NodeViewCreator<import("../views/inline_equation_editable").InlineEquationEditableView>;
|
|
243
|
-
inline_footnote: import("../types").NodeViewCreator<import("../views/inline_footnote").InlineFootnoteView<any>>;
|
|
244
|
-
keyword: import("../types").NodeViewCreator<import("../views/keyword").KeywordView>;
|
|
245
|
-
keyword_group: import("../types").NodeViewCreator<import("../views/keyword_group").KeywordGroupView>;
|
|
246
|
-
link: import("../types").NodeViewCreator<import("../views/link_editable").LinkEditableView>;
|
|
247
|
-
list_item: import("../types").NodeViewCreator<import("../views/list_item").ListItemView<any>>;
|
|
241
|
+
} & import("../views/list").ListView>;
|
|
242
|
+
list_item: import("../types").NodeViewCreator<import("../views/list_item").ListItemView>;
|
|
248
243
|
paragraph: import("../types").NodeViewCreator<{
|
|
249
244
|
gutterButtons: () => HTMLElement[];
|
|
250
245
|
actionGutterButtons: () => HTMLElement[];
|
|
@@ -268,7 +263,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
268
263
|
contentDOM?: HTMLElement | undefined;
|
|
269
264
|
syncErrors: import("../types").SyncError[];
|
|
270
265
|
elementType: string;
|
|
271
|
-
readonly props:
|
|
266
|
+
readonly props: EditorProps;
|
|
272
267
|
node: import("prosemirror-model").Node;
|
|
273
268
|
readonly view: import("prosemirror-view").EditorView;
|
|
274
269
|
readonly getPos: () => number;
|
|
@@ -279,8 +274,8 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
279
274
|
deselectNode: () => void;
|
|
280
275
|
destroy: () => void;
|
|
281
276
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
282
|
-
} & import("../views/paragraph").ParagraphView
|
|
283
|
-
placeholder: import("../types").NodeViewCreator<import("../views/placeholder").PlaceholderView
|
|
277
|
+
} & import("../views/paragraph").ParagraphView>;
|
|
278
|
+
placeholder: import("../types").NodeViewCreator<import("../views/placeholder").PlaceholderView>;
|
|
284
279
|
placeholder_element: import("../types").NodeViewCreator<{
|
|
285
280
|
gutterButtons: () => HTMLElement[];
|
|
286
281
|
actionGutterButtons: () => HTMLElement[];
|
|
@@ -304,7 +299,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
304
299
|
contentDOM?: HTMLElement | undefined;
|
|
305
300
|
syncErrors: import("../types").SyncError[];
|
|
306
301
|
elementType: string;
|
|
307
|
-
readonly props:
|
|
302
|
+
readonly props: EditorProps;
|
|
308
303
|
node: import("prosemirror-model").Node;
|
|
309
304
|
readonly view: import("prosemirror-view").EditorView;
|
|
310
305
|
readonly getPos: () => number;
|
|
@@ -315,8 +310,8 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
315
310
|
deselectNode: () => void;
|
|
316
311
|
destroy: () => void;
|
|
317
312
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
318
|
-
} & import("../views/placeholder_element").PlaceholderElementView
|
|
319
|
-
section: import("../types").NodeViewCreator<import("../views/section").SectionView
|
|
313
|
+
} & import("../views/placeholder_element").PlaceholderElementView>;
|
|
314
|
+
section: import("../types").NodeViewCreator<import("../views/section").SectionView>;
|
|
320
315
|
pullquote_element: import("../types").NodeViewCreator<{
|
|
321
316
|
gutterButtons: () => HTMLElement[];
|
|
322
317
|
actionGutterButtons: () => HTMLElement[];
|
|
@@ -340,7 +335,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
340
335
|
contentDOM?: HTMLElement | undefined;
|
|
341
336
|
syncErrors: import("../types").SyncError[];
|
|
342
337
|
elementType: string;
|
|
343
|
-
readonly props:
|
|
338
|
+
readonly props: EditorProps;
|
|
344
339
|
node: import("prosemirror-model").Node;
|
|
345
340
|
readonly view: import("prosemirror-view").EditorView;
|
|
346
341
|
readonly getPos: () => number;
|
|
@@ -351,7 +346,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
351
346
|
deselectNode: () => void;
|
|
352
347
|
destroy: () => void;
|
|
353
348
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
354
|
-
} & import("../views/pullquote_element").PullquoteElementView
|
|
349
|
+
} & import("../views/pullquote_element").PullquoteElementView>;
|
|
355
350
|
section_title: import("../types").NodeViewCreator<{
|
|
356
351
|
gutterButtons: () => HTMLElement[];
|
|
357
352
|
actionGutterButtons: () => HTMLElement[];
|
|
@@ -375,7 +370,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
375
370
|
contentDOM?: HTMLElement | undefined;
|
|
376
371
|
syncErrors: import("../types").SyncError[];
|
|
377
372
|
elementType: string;
|
|
378
|
-
readonly props:
|
|
373
|
+
readonly props: EditorProps;
|
|
379
374
|
node: import("prosemirror-model").Node;
|
|
380
375
|
readonly view: import("prosemirror-view").EditorView;
|
|
381
376
|
readonly getPos: () => number;
|
|
@@ -386,7 +381,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
386
381
|
deselectNode: () => void;
|
|
387
382
|
destroy: () => void;
|
|
388
383
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
389
|
-
} & import("../views/section_title").SectionTitleView
|
|
384
|
+
} & import("../views/section_title").SectionTitleView>;
|
|
390
385
|
section_label: import("../types").NodeViewCreator<import("../views/block_view").default<any>>;
|
|
391
386
|
table_element: import("../types").NodeViewCreator<{
|
|
392
387
|
gutterButtons: () => HTMLElement[];
|
|
@@ -411,7 +406,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
411
406
|
contentDOM?: HTMLElement | undefined;
|
|
412
407
|
syncErrors: import("../types").SyncError[];
|
|
413
408
|
elementType: string;
|
|
414
|
-
readonly props:
|
|
409
|
+
readonly props: EditorProps;
|
|
415
410
|
node: import("prosemirror-model").Node;
|
|
416
411
|
readonly view: import("prosemirror-view").EditorView;
|
|
417
412
|
readonly getPos: () => number;
|
|
@@ -425,7 +420,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
425
420
|
} & import("../views/table_element").TableElementView>;
|
|
426
421
|
table_cell: import("../types").NodeViewCreator<import("../views/table_cell").TableCellView>;
|
|
427
422
|
table_header: import("../types").NodeViewCreator<import("../views/table_cell").TableCellView>;
|
|
428
|
-
table_element_footer: import("../types").NodeViewCreator<import("../views/table_element_footer").TableElementFooterView
|
|
423
|
+
table_element_footer: import("../types").NodeViewCreator<import("../views/table_element_footer").TableElementFooterView>;
|
|
429
424
|
toc_element: import("../types").NodeViewCreator<{
|
|
430
425
|
gutterButtons: () => HTMLElement[];
|
|
431
426
|
actionGutterButtons: () => HTMLElement[];
|
|
@@ -449,7 +444,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
449
444
|
contentDOM?: HTMLElement | undefined;
|
|
450
445
|
syncErrors: import("../types").SyncError[];
|
|
451
446
|
elementType: string;
|
|
452
|
-
readonly props:
|
|
447
|
+
readonly props: EditorProps;
|
|
453
448
|
node: import("prosemirror-model").Node;
|
|
454
449
|
readonly view: import("prosemirror-view").EditorView;
|
|
455
450
|
readonly getPos: () => number;
|
|
@@ -460,7 +455,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
|
|
|
460
455
|
deselectNode: () => void;
|
|
461
456
|
destroy: () => void;
|
|
462
457
|
handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
|
|
463
|
-
} & import("../views/toc_element").TOCElementView
|
|
458
|
+
} & import("../views/toc_element").TOCElementView>;
|
|
464
459
|
comments: () => {
|
|
465
460
|
dom: HTMLDivElement;
|
|
466
461
|
};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { ManuscriptEditorView, ManuscriptNode } from '@manuscripts/transform';
|
|
17
|
-
import {
|
|
17
|
+
import { EditorProps } from '../configs/ManuscriptsEditor';
|
|
18
18
|
export declare const sectionLevel: (depth: number) => string;
|
|
19
19
|
interface Actions {
|
|
20
20
|
addComment?: boolean;
|
|
@@ -26,7 +26,7 @@ export declare class ContextMenu {
|
|
|
26
26
|
private readonly getPos;
|
|
27
27
|
private readonly actions;
|
|
28
28
|
private readonly props?;
|
|
29
|
-
constructor(node: ManuscriptNode, view: ManuscriptEditorView, getPos: () => number, actions?: Actions, props?:
|
|
29
|
+
constructor(node: ManuscriptNode, view: ManuscriptEditorView, getPos: () => number, actions?: Actions, props?: EditorProps);
|
|
30
30
|
showAddMenu: (target: Element, after: boolean) => void;
|
|
31
31
|
showEditMenu: (target: Element) => void;
|
|
32
32
|
private createMenuItem;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -28,6 +28,9 @@ export interface SyncError {
|
|
|
28
28
|
export type TrackableAttributes<T extends ManuscriptNode> = T['attrs'] & {
|
|
29
29
|
dataTracked?: TrackedAttrs[];
|
|
30
30
|
};
|
|
31
|
+
export type Trackable<T extends ManuscriptNode> = Omit<T, 'attrs'> & {
|
|
32
|
+
attrs: TrackableAttributes<T>;
|
|
33
|
+
};
|
|
31
34
|
export type WidgetDecoration = Decoration & {
|
|
32
35
|
type: {
|
|
33
36
|
toDOM: () => HTMLElement;
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.45
|
|
1
|
+
export declare const VERSION = "2.0.45";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
import { ManuscriptEditorView, ManuscriptNode } from '@manuscripts/transform';
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import { Dispatch } from '../commands';
|
|
19
|
-
import {
|
|
19
|
+
import { Trackable } from '../types';
|
|
20
|
+
import { EditorProps } from '../configs/ManuscriptsEditor';
|
|
20
21
|
export interface ReactViewComponentProps<NodeT extends ManuscriptNode> {
|
|
21
22
|
nodeAttrs: NodeT['attrs'];
|
|
22
23
|
setNodeAttrs: (nextAttrs: Partial<NodeT['attrs']>) => void;
|
|
@@ -24,9 +25,9 @@ export interface ReactViewComponentProps<NodeT extends ManuscriptNode> {
|
|
|
24
25
|
viewProps: {
|
|
25
26
|
view: ManuscriptEditorView;
|
|
26
27
|
getPos: () => number;
|
|
27
|
-
node: ManuscriptNode
|
|
28
|
+
node: ManuscriptNode | Trackable<ManuscriptNode>;
|
|
28
29
|
};
|
|
29
30
|
dispatch: Dispatch;
|
|
30
31
|
}
|
|
31
|
-
declare
|
|
32
|
-
export default
|
|
32
|
+
declare function createSubView<T extends Trackable<ManuscriptNode>>(props: EditorProps, Component: React.FC<any>, componentProps: object, node: T, getPos: () => number, view: ManuscriptEditorView, classNames?: string): HTMLDivElement;
|
|
33
|
+
export default createSubView;
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import BlockView from './block_view';
|
|
17
|
-
import {
|
|
18
|
-
|
|
17
|
+
import { AffiliationNode } from '@manuscripts/transform';
|
|
18
|
+
import { Trackable } from '../types';
|
|
19
|
+
export declare class AffiliationsView extends BlockView<Trackable<AffiliationNode>> {
|
|
19
20
|
version: string;
|
|
20
21
|
container: HTMLElement;
|
|
21
22
|
ignoreMutation: () => boolean;
|