@manuscripts/body-editor 2.8.30 → 2.8.32
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-plugins.js +2 -0
- package/dist/cjs/configs/editor-views.js +4 -16
- package/dist/cjs/icons.js +2 -1
- package/dist/cjs/keys/index.js +1 -1
- package/dist/cjs/keys/title.js +17 -5
- package/dist/cjs/lib/helpers.js +1 -1
- package/dist/cjs/plugins/alt-titles.js +154 -0
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/alt_title.js +44 -0
- package/dist/cjs/views/alt_titles_section.js +58 -0
- package/dist/cjs/views/title.js +1 -0
- package/dist/es/configs/editor-plugins.js +2 -0
- package/dist/es/configs/editor-views.js +4 -16
- package/dist/es/icons.js +2 -1
- package/dist/es/keys/index.js +1 -1
- package/dist/es/keys/title.js +17 -5
- package/dist/es/lib/helpers.js +1 -1
- package/dist/es/plugins/alt-titles.js +151 -0
- package/dist/es/versions.js +1 -1
- package/dist/es/views/alt_title.js +40 -0
- package/dist/es/views/alt_titles_section.js +51 -0
- package/dist/es/views/title.js +1 -0
- package/dist/types/configs/editor-views.d.ts +3 -337
- package/dist/types/icons.d.ts +1 -0
- package/dist/types/plugins/alt-titles.d.ts +12 -0
- package/dist/types/versions.d.ts +1 -1
- package/dist/types/views/alt_title.d.ts +24 -0
- package/dist/types/views/alt_titles_section.d.ts +26 -0
- package/package.json +2 -2
- package/styles/AdvancedEditor.css +102 -11
- package/styles/Editor.css +30 -13
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { schema, } from '@manuscripts/transform';
|
|
2
|
+
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
3
|
+
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
4
|
+
import { arrowDown } from '../icons';
|
|
5
|
+
import { skipTracking } from '@manuscripts/track-changes-plugin';
|
|
6
|
+
function getTitlesData(doc) {
|
|
7
|
+
let title;
|
|
8
|
+
let runningTitle;
|
|
9
|
+
let shortTitle;
|
|
10
|
+
let altTitlesSection;
|
|
11
|
+
doc.descendants((node, pos) => {
|
|
12
|
+
if (title && runningTitle && shortTitle && altTitlesSection) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (node.type === schema.nodes.title) {
|
|
16
|
+
title = [node, pos];
|
|
17
|
+
}
|
|
18
|
+
if (node.type === schema.nodes.alt_titles) {
|
|
19
|
+
altTitlesSection = [node, pos];
|
|
20
|
+
}
|
|
21
|
+
if (node.type === schema.nodes.alt_title) {
|
|
22
|
+
if (node.attrs.type === 'running') {
|
|
23
|
+
runningTitle = [node, pos];
|
|
24
|
+
}
|
|
25
|
+
if (node.attrs.type === 'short') {
|
|
26
|
+
shortTitle = [node, pos];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return { title, runningTitle, shortTitle, altTitlesSection };
|
|
31
|
+
}
|
|
32
|
+
function createAltTitlesButton(listener) {
|
|
33
|
+
const altTitlesButton = document.createElement('button');
|
|
34
|
+
altTitlesButton.classList.add('alt-titles-open', 'button-reset');
|
|
35
|
+
altTitlesButton.innerHTML = arrowDown;
|
|
36
|
+
altTitlesButton.addEventListener('click', (e) => {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
listener();
|
|
39
|
+
});
|
|
40
|
+
return altTitlesButton;
|
|
41
|
+
}
|
|
42
|
+
function selectionInAltTitles(from, to, state) {
|
|
43
|
+
if (state.runningTitle && state.shortTitle) {
|
|
44
|
+
const range = {
|
|
45
|
+
from: Math.min(state.runningTitle[1], state.shortTitle[1]),
|
|
46
|
+
to: Math.max(state.runningTitle[1] + state.runningTitle[0].nodeSize, state.shortTitle[1] + state.shortTitle[0].nodeSize),
|
|
47
|
+
};
|
|
48
|
+
return Math.max(from, range.from) <= Math.min(to, range.to);
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
export const altTitlesKey = new PluginKey('altTitles');
|
|
53
|
+
export default () => {
|
|
54
|
+
return new Plugin({
|
|
55
|
+
key: altTitlesKey,
|
|
56
|
+
state: {
|
|
57
|
+
init: (_, state) => {
|
|
58
|
+
return Object.assign({ collapsed: true }, getTitlesData(state.doc));
|
|
59
|
+
},
|
|
60
|
+
apply: (tr, value) => {
|
|
61
|
+
let newState = value;
|
|
62
|
+
if (tr.docChanged) {
|
|
63
|
+
newState = Object.assign(Object.assign({}, newState), getTitlesData(tr.doc));
|
|
64
|
+
}
|
|
65
|
+
if (tr.selectionSet &&
|
|
66
|
+
selectionInAltTitles(tr.selection.from, tr.selection.to, newState)) {
|
|
67
|
+
newState = Object.assign(Object.assign({}, newState), { collapsed: false });
|
|
68
|
+
}
|
|
69
|
+
if (tr.getMeta(altTitlesKey)) {
|
|
70
|
+
newState = Object.assign(Object.assign(Object.assign({}, newState), tr.getMeta(altTitlesKey)), getTitlesData(tr.doc));
|
|
71
|
+
}
|
|
72
|
+
return newState;
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
appendTransaction: (transactions, _, newState) => {
|
|
76
|
+
let tr = newState.tr;
|
|
77
|
+
if (!transactions.some((tr) => tr.getMeta(altTitlesKey)) ||
|
|
78
|
+
!altTitlesKey.getState(newState)) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const { title, runningTitle, shortTitle, altTitlesSection } = altTitlesKey.getState(newState);
|
|
82
|
+
const schema = newState.schema;
|
|
83
|
+
if (!title) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
if (!altTitlesSection) {
|
|
87
|
+
const titleEnd = title[0].nodeSize + title[1];
|
|
88
|
+
const section = schema.nodes.alt_titles.create({}, [
|
|
89
|
+
schema.nodes.alt_title.create({
|
|
90
|
+
type: 'running',
|
|
91
|
+
}),
|
|
92
|
+
schema.nodes.alt_title.create({ type: 'short' }),
|
|
93
|
+
]);
|
|
94
|
+
tr.insert(titleEnd, section);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
const endPos = altTitlesSection[1] + altTitlesSection[0].nodeSize - 1;
|
|
98
|
+
if (!runningTitle) {
|
|
99
|
+
const title = schema.nodes.alt_title.create({
|
|
100
|
+
type: 'running',
|
|
101
|
+
});
|
|
102
|
+
tr.insert(endPos, title);
|
|
103
|
+
}
|
|
104
|
+
if (!shortTitle) {
|
|
105
|
+
const title = schema.nodes.alt_title.create({ type: 'short' });
|
|
106
|
+
const newPos = tr.mapping.map(endPos);
|
|
107
|
+
tr.insert(newPos, title);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (tr.docChanged) {
|
|
111
|
+
return tr.setMeta(altTitlesKey, 'created-missing-titles');
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
props: {
|
|
118
|
+
decorations: (state) => {
|
|
119
|
+
const decorations = [];
|
|
120
|
+
const pState = altTitlesKey.getState(state);
|
|
121
|
+
if (!pState || !pState.title) {
|
|
122
|
+
return DecorationSet.empty;
|
|
123
|
+
}
|
|
124
|
+
if (!pState.collapsed) {
|
|
125
|
+
state.doc.descendants((node, pos) => {
|
|
126
|
+
if (node.type === state.schema.nodes.alt_titles) {
|
|
127
|
+
decorations.push(Decoration.node(pos, pos + node.nodeSize, {
|
|
128
|
+
class: 'alt-titles-section-open',
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
else if (pState.title[0].textContent.length) {
|
|
134
|
+
const titleEnd = pState.title[0].nodeSize + pState.title[1];
|
|
135
|
+
decorations.push(Decoration.widget(titleEnd - 1, (view) => {
|
|
136
|
+
return createAltTitlesButton(() => {
|
|
137
|
+
const tr = view.state.tr.setMeta(altTitlesKey, {
|
|
138
|
+
collapsed: false,
|
|
139
|
+
});
|
|
140
|
+
view.dispatch(skipTracking(tr));
|
|
141
|
+
});
|
|
142
|
+
}, {
|
|
143
|
+
side: -1,
|
|
144
|
+
key: 'title-' + titleEnd,
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
return DecorationSet.create(state.doc, decorations);
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
};
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.8.
|
|
1
|
+
export const VERSION = '2.8.32';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2025 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 AltTitleView 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-alt-title');
|
|
27
|
+
const label = document.createElement('div');
|
|
28
|
+
label.classList.add('alt-title-label');
|
|
29
|
+
label.innerHTML = this.node.attrs.type + ' title';
|
|
30
|
+
label.contentEditable = 'false';
|
|
31
|
+
this.dom.setAttribute('data-type', this.node.attrs.type);
|
|
32
|
+
this.contentDOM = document.createElement('div');
|
|
33
|
+
this.contentDOM.classList.add('alt-title-text');
|
|
34
|
+
this.dom.appendChild(label);
|
|
35
|
+
this.dom.appendChild(this.contentDOM);
|
|
36
|
+
this.updateContents();
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export default createNodeView(AltTitleView);
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { arrowDown } from '../icons';
|
|
17
|
+
import { altTitlesKey } from '../plugins/alt-titles';
|
|
18
|
+
import BlockView from './block_view';
|
|
19
|
+
import { createNodeView } from './creators';
|
|
20
|
+
export class AltTitleSectionView extends BlockView {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.ignoreMutation = () => true;
|
|
24
|
+
this.createElement = () => {
|
|
25
|
+
this.container = document.createElement('div');
|
|
26
|
+
this.container.classList.add('block');
|
|
27
|
+
this.dom.appendChild(this.container);
|
|
28
|
+
this.contentDOM = document.createElement('div');
|
|
29
|
+
this.contentDOM.classList.add('alt-titles-section');
|
|
30
|
+
this.contentDOM.setAttribute('id', this.node.attrs.id);
|
|
31
|
+
this.container.appendChild(this.contentDOM);
|
|
32
|
+
this.container.appendChild(this.createClosingPanel());
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
createClosingPanel() {
|
|
36
|
+
const closingPanel = document.createElement('div');
|
|
37
|
+
closingPanel.classList.add('alt-titles-closing-panel');
|
|
38
|
+
const button = document.createElement('button');
|
|
39
|
+
button.classList.add('alt-titles-closing-button', 'button-reset');
|
|
40
|
+
button.innerHTML = arrowDown;
|
|
41
|
+
button.addEventListener('click', () => {
|
|
42
|
+
const tr = this.view.state.tr.setMeta(altTitlesKey, {
|
|
43
|
+
collapsed: true,
|
|
44
|
+
});
|
|
45
|
+
this.view.dispatch(tr);
|
|
46
|
+
});
|
|
47
|
+
closingPanel.appendChild(button);
|
|
48
|
+
return closingPanel;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export default createNodeView(AltTitleSectionView);
|
package/dist/es/views/title.js
CHANGED
|
@@ -1,340 +1,6 @@
|
|
|
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
|
-
*/
|
|
1
|
+
import { ManuscriptNodeView, Nodes } from '@manuscripts/transform';
|
|
16
2
|
import { Dispatch } from '../commands';
|
|
3
|
+
import { NodeViewCreator } from '../types';
|
|
17
4
|
import { EditorProps } from './ManuscriptsEditor';
|
|
18
|
-
declare const _default: (props: EditorProps, dispatch: Dispatch) =>
|
|
19
|
-
title: import("../types").NodeViewCreator<import("../views/title").TitleView>;
|
|
20
|
-
alt_title: () => {
|
|
21
|
-
dom: HTMLDivElement;
|
|
22
|
-
};
|
|
23
|
-
bibliography_element: import("../types").NodeViewCreator<import("../views/bibliography_element").BibliographyElementBlockView>;
|
|
24
|
-
blockquote_element: import("../types").NodeViewCreator<{
|
|
25
|
-
gutterButtons(): HTMLElement[];
|
|
26
|
-
actionGutterButtons(): never[];
|
|
27
|
-
createAddButton(): HTMLAnchorElement | null;
|
|
28
|
-
createEditButton(): HTMLElement | null;
|
|
29
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
30
|
-
initialise(): void;
|
|
31
|
-
updateContents(): void;
|
|
32
|
-
handleTrackChanges(): void;
|
|
33
|
-
updateClasses(): void;
|
|
34
|
-
updatePlaceholder(): void;
|
|
35
|
-
createElement(): void;
|
|
36
|
-
createDOM(): void;
|
|
37
|
-
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
38
|
-
dom: HTMLElement;
|
|
39
|
-
contentDOM?: HTMLElement | undefined;
|
|
40
|
-
elementType: string;
|
|
41
|
-
readonly props: EditorProps;
|
|
42
|
-
node: import("prosemirror-model").Node;
|
|
43
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
44
|
-
readonly getPos: () => number;
|
|
45
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
46
|
-
selectNode(): void;
|
|
47
|
-
deselectNode(): void;
|
|
48
|
-
destroy(): void;
|
|
49
|
-
} & import("../views/blockquote_element").BlockquoteElementView>;
|
|
50
|
-
box_element: import("../types").NodeViewCreator<import("../views/box_element").BoxElementView>;
|
|
51
|
-
citation: import("../types").NodeViewCreator<import("../views/citation_editable").CitationEditableView>;
|
|
52
|
-
cross_reference: import("../types").NodeViewCreator<import("../views/cross_reference_editable").CrossReferenceEditableView>;
|
|
53
|
-
contributors: import("../types").NodeViewCreator<import("../views/contributors").ContributorsView>;
|
|
54
|
-
affiliations: import("../types").NodeViewCreator<import("../views/affiliations").AffiliationsView>;
|
|
55
|
-
embed: import("../types").NodeViewCreator<import("../views/embed").EmbedMediaView>;
|
|
56
|
-
equation: import("../types").NodeViewCreator<import("../views/equation_editable").EquationEditableView>;
|
|
57
|
-
equation_element: import("../types").NodeViewCreator<{
|
|
58
|
-
gutterButtons(): HTMLElement[];
|
|
59
|
-
actionGutterButtons(): never[];
|
|
60
|
-
createAddButton(): HTMLAnchorElement | null;
|
|
61
|
-
createEditButton(): HTMLElement | null;
|
|
62
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
63
|
-
initialise(): void;
|
|
64
|
-
updateContents(): void;
|
|
65
|
-
handleTrackChanges(): void;
|
|
66
|
-
updateClasses(): void;
|
|
67
|
-
updatePlaceholder(): void;
|
|
68
|
-
createElement(): void;
|
|
69
|
-
createDOM(): void;
|
|
70
|
-
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
71
|
-
dom: HTMLElement;
|
|
72
|
-
contentDOM?: HTMLElement | undefined;
|
|
73
|
-
elementType: string;
|
|
74
|
-
readonly props: EditorProps;
|
|
75
|
-
node: import("prosemirror-model").Node;
|
|
76
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
77
|
-
readonly getPos: () => number;
|
|
78
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
79
|
-
selectNode(): void;
|
|
80
|
-
deselectNode(): void;
|
|
81
|
-
destroy(): void;
|
|
82
|
-
} & import("../views/equation_element").EquationElementView>;
|
|
83
|
-
figure: import("../types").NodeViewCreator<import("../views/figure_editable").FigureEditableView>;
|
|
84
|
-
figure_element: import("../types").NodeViewCreator<{
|
|
85
|
-
gutterButtons(): HTMLElement[];
|
|
86
|
-
actionGutterButtons(): never[];
|
|
87
|
-
createAddButton(): HTMLAnchorElement | null;
|
|
88
|
-
createEditButton(): HTMLElement | null;
|
|
89
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
90
|
-
initialise(): void;
|
|
91
|
-
updateContents(): void;
|
|
92
|
-
handleTrackChanges(): void;
|
|
93
|
-
updateClasses(): void;
|
|
94
|
-
updatePlaceholder(): void;
|
|
95
|
-
createElement(): void;
|
|
96
|
-
createDOM(): void;
|
|
97
|
-
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
98
|
-
dom: HTMLElement;
|
|
99
|
-
contentDOM?: HTMLElement | undefined;
|
|
100
|
-
elementType: string;
|
|
101
|
-
readonly props: EditorProps;
|
|
102
|
-
node: import("prosemirror-model").Node;
|
|
103
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
104
|
-
readonly getPos: () => number;
|
|
105
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
106
|
-
selectNode(): void;
|
|
107
|
-
deselectNode(): void;
|
|
108
|
-
destroy(): void;
|
|
109
|
-
} & import("../views/figure_element").FigureElementView>;
|
|
110
|
-
image_element: import("../types").NodeViewCreator<{
|
|
111
|
-
gutterButtons(): HTMLElement[];
|
|
112
|
-
actionGutterButtons(): never[];
|
|
113
|
-
createAddButton(): HTMLAnchorElement | null;
|
|
114
|
-
createEditButton(): HTMLElement | null;
|
|
115
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
116
|
-
initialise(): void;
|
|
117
|
-
updateContents(): void;
|
|
118
|
-
handleTrackChanges(): void;
|
|
119
|
-
updateClasses(): void;
|
|
120
|
-
updatePlaceholder(): void;
|
|
121
|
-
createElement(): void;
|
|
122
|
-
createDOM(): void;
|
|
123
|
-
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
124
|
-
dom: HTMLElement;
|
|
125
|
-
contentDOM?: HTMLElement | undefined;
|
|
126
|
-
elementType: string;
|
|
127
|
-
readonly props: EditorProps;
|
|
128
|
-
node: import("prosemirror-model").Node;
|
|
129
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
130
|
-
readonly getPos: () => number;
|
|
131
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
132
|
-
selectNode(): void;
|
|
133
|
-
deselectNode(): void;
|
|
134
|
-
destroy(): void;
|
|
135
|
-
} & import("../views/figure_element").FigureElementView>;
|
|
136
|
-
footnote: import("../types").NodeViewCreator<import("../views/footnote").FootnoteView>;
|
|
137
|
-
footnotes_element: import("../types").NodeViewCreator<import("../views/footnotes_element").FootnotesElementView>;
|
|
138
|
-
general_table_footnote: import("../types").NodeViewCreator<import("../views/general_table_footnote").GeneralTableFootnoteView>;
|
|
139
|
-
inline_equation: import("../types").NodeViewCreator<import("../views/inline_equation_editable").InlineEquationEditableView>;
|
|
140
|
-
inline_footnote: import("../types").NodeViewCreator<import("../views/inline_footnote").InlineFootnoteView>;
|
|
141
|
-
keyword: import("../types").NodeViewCreator<import("../views/keyword").KeywordView>;
|
|
142
|
-
keyword_group: import("../types").NodeViewCreator<import("../views/keyword_group").KeywordGroupView>;
|
|
143
|
-
link: import("../types").NodeViewCreator<import("../views/link_editable").LinkEditableView>;
|
|
144
|
-
list: import("../types").NodeViewCreator<{
|
|
145
|
-
gutterButtons(): HTMLElement[];
|
|
146
|
-
actionGutterButtons(): never[];
|
|
147
|
-
createAddButton(): HTMLAnchorElement | null;
|
|
148
|
-
createEditButton(): HTMLElement | null;
|
|
149
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
150
|
-
initialise(): void;
|
|
151
|
-
updateContents(): void;
|
|
152
|
-
handleTrackChanges(): void;
|
|
153
|
-
updateClasses(): void;
|
|
154
|
-
updatePlaceholder(): void;
|
|
155
|
-
createElement(): void;
|
|
156
|
-
createDOM(): void;
|
|
157
|
-
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
158
|
-
dom: HTMLElement;
|
|
159
|
-
contentDOM?: HTMLElement | undefined;
|
|
160
|
-
elementType: string;
|
|
161
|
-
readonly props: EditorProps;
|
|
162
|
-
node: import("prosemirror-model").Node;
|
|
163
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
164
|
-
readonly getPos: () => number;
|
|
165
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
166
|
-
selectNode(): void;
|
|
167
|
-
deselectNode(): void;
|
|
168
|
-
destroy(): void;
|
|
169
|
-
} & import("../views/list").ListView>;
|
|
170
|
-
list_item: import("../types").NodeViewCreator<import("../views/list_item").ListItemView>;
|
|
171
|
-
paragraph: import("../types").NodeViewCreator<{
|
|
172
|
-
gutterButtons(): HTMLElement[];
|
|
173
|
-
actionGutterButtons(): never[];
|
|
174
|
-
createAddButton(): HTMLAnchorElement | null;
|
|
175
|
-
createEditButton(): HTMLElement | null;
|
|
176
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
177
|
-
initialise(): void;
|
|
178
|
-
updateContents(): void;
|
|
179
|
-
handleTrackChanges(): void;
|
|
180
|
-
updateClasses(): void;
|
|
181
|
-
updatePlaceholder(): void;
|
|
182
|
-
createElement(): void;
|
|
183
|
-
createDOM(): void;
|
|
184
|
-
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
185
|
-
dom: HTMLElement;
|
|
186
|
-
contentDOM?: HTMLElement | undefined;
|
|
187
|
-
elementType: string;
|
|
188
|
-
readonly props: EditorProps;
|
|
189
|
-
node: import("prosemirror-model").Node;
|
|
190
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
191
|
-
readonly getPos: () => number;
|
|
192
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
193
|
-
selectNode(): void;
|
|
194
|
-
deselectNode(): void;
|
|
195
|
-
destroy(): void;
|
|
196
|
-
} & import("../views/paragraph").ParagraphView>;
|
|
197
|
-
placeholder: import("../types").NodeViewCreator<import("../views/placeholder").PlaceholderView>;
|
|
198
|
-
placeholder_element: import("../types").NodeViewCreator<{
|
|
199
|
-
gutterButtons(): HTMLElement[];
|
|
200
|
-
actionGutterButtons(): never[];
|
|
201
|
-
createAddButton(): HTMLAnchorElement | null;
|
|
202
|
-
createEditButton(): HTMLElement | null;
|
|
203
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
204
|
-
initialise(): void;
|
|
205
|
-
updateContents(): void;
|
|
206
|
-
handleTrackChanges(): void;
|
|
207
|
-
updateClasses(): void;
|
|
208
|
-
updatePlaceholder(): void;
|
|
209
|
-
createElement(): void;
|
|
210
|
-
createDOM(): void;
|
|
211
|
-
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
212
|
-
dom: HTMLElement;
|
|
213
|
-
contentDOM?: HTMLElement | undefined;
|
|
214
|
-
elementType: string;
|
|
215
|
-
readonly props: EditorProps;
|
|
216
|
-
node: import("prosemirror-model").Node;
|
|
217
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
218
|
-
readonly getPos: () => number;
|
|
219
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
220
|
-
selectNode(): void;
|
|
221
|
-
deselectNode(): void;
|
|
222
|
-
destroy(): void;
|
|
223
|
-
} & import("../views/placeholder_element").PlaceholderElementView>;
|
|
224
|
-
section: import("../types").NodeViewCreator<import("../views/section").SectionView>;
|
|
225
|
-
graphical_abstract_section: import("../types").NodeViewCreator<import("../views/section").SectionView>;
|
|
226
|
-
pullquote_element: import("../types").NodeViewCreator<{
|
|
227
|
-
gutterButtons(): HTMLElement[];
|
|
228
|
-
actionGutterButtons(): never[];
|
|
229
|
-
createAddButton(): HTMLAnchorElement | null;
|
|
230
|
-
createEditButton(): HTMLElement | null;
|
|
231
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
232
|
-
initialise(): void;
|
|
233
|
-
updateContents(): void;
|
|
234
|
-
handleTrackChanges(): void;
|
|
235
|
-
updateClasses(): void;
|
|
236
|
-
updatePlaceholder(): void;
|
|
237
|
-
createElement(): void;
|
|
238
|
-
createDOM(): void;
|
|
239
|
-
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
240
|
-
dom: HTMLElement;
|
|
241
|
-
contentDOM?: HTMLElement | undefined;
|
|
242
|
-
elementType: string;
|
|
243
|
-
readonly props: EditorProps;
|
|
244
|
-
node: import("prosemirror-model").Node;
|
|
245
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
246
|
-
readonly getPos: () => number;
|
|
247
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
248
|
-
selectNode(): void;
|
|
249
|
-
deselectNode(): void;
|
|
250
|
-
destroy(): void;
|
|
251
|
-
} & import("../views/pullquote_element").PullquoteElementView>;
|
|
252
|
-
section_title: import("../types").NodeViewCreator<{
|
|
253
|
-
gutterButtons(): HTMLElement[];
|
|
254
|
-
actionGutterButtons(): never[];
|
|
255
|
-
createAddButton(): HTMLAnchorElement | null;
|
|
256
|
-
createEditButton(): HTMLElement | null;
|
|
257
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
258
|
-
initialise(): void;
|
|
259
|
-
updateContents(): void;
|
|
260
|
-
handleTrackChanges(): void;
|
|
261
|
-
updateClasses(): void;
|
|
262
|
-
updatePlaceholder(): void;
|
|
263
|
-
createElement(): void;
|
|
264
|
-
createDOM(): void;
|
|
265
|
-
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
266
|
-
dom: HTMLElement;
|
|
267
|
-
contentDOM?: HTMLElement | undefined;
|
|
268
|
-
elementType: string;
|
|
269
|
-
readonly props: EditorProps;
|
|
270
|
-
node: import("prosemirror-model").Node;
|
|
271
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
272
|
-
readonly getPos: () => number;
|
|
273
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
274
|
-
selectNode(): void;
|
|
275
|
-
deselectNode(): void;
|
|
276
|
-
destroy(): void;
|
|
277
|
-
} & import("../views/section_title").SectionTitleView>;
|
|
278
|
-
section_label: import("../types").NodeViewCreator<import("../views/block_view").default<any>>;
|
|
279
|
-
table_element: import("../types").NodeViewCreator<{
|
|
280
|
-
gutterButtons(): HTMLElement[];
|
|
281
|
-
actionGutterButtons(): never[];
|
|
282
|
-
createAddButton(): HTMLAnchorElement | null;
|
|
283
|
-
createEditButton(): HTMLElement | null;
|
|
284
|
-
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
285
|
-
initialise(): void;
|
|
286
|
-
updateContents(): void;
|
|
287
|
-
handleTrackChanges(): void;
|
|
288
|
-
updateClasses(): void;
|
|
289
|
-
updatePlaceholder(): void;
|
|
290
|
-
createElement(): void;
|
|
291
|
-
createDOM(): void;
|
|
292
|
-
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
293
|
-
dom: HTMLElement;
|
|
294
|
-
contentDOM?: HTMLElement | undefined;
|
|
295
|
-
elementType: string;
|
|
296
|
-
readonly props: EditorProps;
|
|
297
|
-
node: import("prosemirror-model").Node;
|
|
298
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
299
|
-
readonly getPos: () => number;
|
|
300
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
301
|
-
selectNode(): void;
|
|
302
|
-
deselectNode(): void;
|
|
303
|
-
destroy(): void;
|
|
304
|
-
} & import("../views/table_element").TableElementView>;
|
|
305
|
-
table_cell: import("../types").NodeViewCreator<import("../views/table_cell").TableCellView>;
|
|
306
|
-
table_header: import("../types").NodeViewCreator<import("../views/table_cell").TableCellView>;
|
|
307
|
-
table_element_footer: import("../types").NodeViewCreator<{
|
|
308
|
-
initialise: () => void;
|
|
309
|
-
createDOM: () => void;
|
|
310
|
-
dom: HTMLElement;
|
|
311
|
-
contentDOM?: HTMLElement | undefined;
|
|
312
|
-
elementType: string;
|
|
313
|
-
readonly props: EditorProps;
|
|
314
|
-
node: import("@manuscripts/transform/dist/types").TableElementFooterNode;
|
|
315
|
-
readonly view: import("prosemirror-view").EditorView;
|
|
316
|
-
readonly getPos: () => number;
|
|
317
|
-
update(newNode: import("prosemirror-model").Node): boolean;
|
|
318
|
-
updateContents(): void;
|
|
319
|
-
handleTrackChanges(): void;
|
|
320
|
-
selectNode(): void;
|
|
321
|
-
deselectNode(): void;
|
|
322
|
-
destroy(): void;
|
|
323
|
-
}>;
|
|
324
|
-
comments: () => {
|
|
325
|
-
dom: HTMLDivElement;
|
|
326
|
-
};
|
|
327
|
-
supplements: () => {
|
|
328
|
-
dom: HTMLDivElement;
|
|
329
|
-
};
|
|
330
|
-
author_notes: import("../types").NodeViewCreator<import("../views/author_notes").AuthorNotesView>;
|
|
331
|
-
awards: import("../types").NodeViewCreator<import("../views/awards").AwardsView>;
|
|
332
|
-
award: import("../types").NodeViewCreator<import("../views/award").AwardView>;
|
|
333
|
-
long_desc: () => {
|
|
334
|
-
dom: HTMLDivElement;
|
|
335
|
-
};
|
|
336
|
-
alt_text: () => {
|
|
337
|
-
dom: HTMLDivElement;
|
|
338
|
-
};
|
|
339
|
-
};
|
|
5
|
+
declare const _default: (props: EditorProps, dispatch: Dispatch) => Partial<Record<Nodes, NodeViewCreator<ManuscriptNodeView>>>;
|
|
340
6
|
export default _default;
|
package/dist/types/icons.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AltTitleNode, AltTitlesSectionNode, TitleNode } from '@manuscripts/transform';
|
|
2
|
+
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
3
|
+
export interface PluginState {
|
|
4
|
+
collapsed: boolean;
|
|
5
|
+
title: [TitleNode, number] | undefined;
|
|
6
|
+
runningTitle: [AltTitleNode, number] | undefined;
|
|
7
|
+
shortTitle: [AltTitleNode, number] | undefined;
|
|
8
|
+
altTitlesSection: [AltTitlesSectionNode, number] | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare const altTitlesKey: PluginKey<PluginState>;
|
|
11
|
+
declare const _default: () => Plugin<PluginState>;
|
|
12
|
+
export default _default;
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.8.
|
|
1
|
+
export declare const VERSION = "2.8.32";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2025 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 { AltTitleNode, ManuscriptNodeView } from '@manuscripts/transform';
|
|
17
|
+
import { BaseNodeView } from './base_node_view';
|
|
18
|
+
export declare class AltTitleView extends BaseNodeView<AltTitleNode> implements ManuscriptNodeView {
|
|
19
|
+
contentDOM: HTMLElement;
|
|
20
|
+
initialise: () => void;
|
|
21
|
+
protected createDOM: () => void;
|
|
22
|
+
}
|
|
23
|
+
declare const _default: (props: import("../configs/ManuscriptsEditor").EditorProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<AltTitleView>;
|
|
24
|
+
export default _default;
|