@manuscripts/body-editor 2.8.48 → 2.8.52
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 +11 -0
- package/dist/cjs/configs/editor-views.js +2 -0
- package/dist/cjs/icons.js +2 -1
- package/dist/cjs/lib/context-menu.js +21 -0
- package/dist/cjs/lib/utils.js +7 -1
- package/dist/cjs/plugins/placeholder.js +21 -3
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/block_view.js +13 -6
- package/dist/cjs/views/editable_block.js +4 -8
- package/dist/cjs/views/figure_editable.js +49 -36
- package/dist/cjs/views/pullquote_element.js +33 -0
- package/dist/cjs/views/quote_image_editable.js +71 -0
- package/dist/es/commands.js +11 -0
- package/dist/es/configs/editor-views.js +2 -0
- package/dist/es/icons.js +2 -1
- package/dist/es/lib/context-menu.js +21 -0
- package/dist/es/lib/utils.js +5 -1
- package/dist/es/plugins/placeholder.js +22 -4
- package/dist/es/versions.js +1 -1
- package/dist/es/views/block_view.js +13 -6
- package/dist/es/views/editable_block.js +2 -6
- package/dist/es/views/figure_editable.js +49 -36
- package/dist/es/views/pullquote_element.js +33 -0
- package/dist/es/views/quote_image_editable.js +67 -0
- package/dist/types/icons.d.ts +1 -0
- package/dist/types/lib/utils.d.ts +3 -1
- package/dist/types/versions.d.ts +1 -1
- package/dist/types/views/block_view.d.ts +1 -0
- package/dist/types/views/blockquote_element_editable.d.ts +1 -0
- package/dist/types/views/bullet_list_editable.d.ts +1 -0
- package/dist/types/views/editable_block.d.ts +1 -0
- package/dist/types/views/equation_element_editable.d.ts +1 -0
- package/dist/types/views/figure_editable.d.ts +7 -4
- package/dist/types/views/figure_element_editable.d.ts +1 -0
- package/dist/types/views/list.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.d.ts +6 -0
- package/dist/types/views/pullquote_element_editable.d.ts +1 -0
- package/dist/types/views/quote_image_editable.d.ts +26 -0
- package/dist/types/views/section_title_editable.d.ts +1 -0
- package/dist/types/views/table_element_editable.d.ts +1 -0
- package/package.json +3 -3
- package/styles/Editor.css +105 -24
|
@@ -16,14 +16,18 @@
|
|
|
16
16
|
import { addTrackChangesAttributes } from '../lib/track-changes-utils';
|
|
17
17
|
import { BaseNodeView } from './base_node_view';
|
|
18
18
|
export default class BlockView extends BaseNodeView {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.gutter = {};
|
|
22
|
+
}
|
|
19
23
|
initialise() {
|
|
20
24
|
this.createDOM();
|
|
21
25
|
this.createGutter('block-gutter', this.gutterButtons().filter(Boolean));
|
|
22
26
|
this.createElement();
|
|
23
|
-
this.createGutter('action-gutter', this.actionGutterButtons().filter(Boolean));
|
|
24
27
|
this.updateContents();
|
|
25
28
|
}
|
|
26
29
|
updateContents() {
|
|
30
|
+
this.createGutter('action-gutter', this.actionGutterButtons().filter(Boolean));
|
|
27
31
|
super.updateContents();
|
|
28
32
|
this.updateClasses();
|
|
29
33
|
this.updatePlaceholder();
|
|
@@ -56,13 +60,16 @@ export default class BlockView extends BaseNodeView {
|
|
|
56
60
|
this.dom.classList.add(`block-${this.node.type.name}`);
|
|
57
61
|
}
|
|
58
62
|
createGutter(className, buttons) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
if (this.gutter[className]) {
|
|
64
|
+
this.gutter[className].remove();
|
|
65
|
+
}
|
|
66
|
+
this.gutter[className] = document.createElement('div');
|
|
67
|
+
this.gutter[className].setAttribute('contenteditable', 'false');
|
|
68
|
+
this.gutter[className].classList.add(className);
|
|
62
69
|
for (const button of buttons) {
|
|
63
|
-
gutter.appendChild(button);
|
|
70
|
+
this.gutter[className].appendChild(button);
|
|
64
71
|
}
|
|
65
|
-
this.dom.appendChild(gutter);
|
|
72
|
+
this.dom.appendChild(this.gutter[className]);
|
|
66
73
|
}
|
|
67
74
|
gutterButtons() {
|
|
68
75
|
return [];
|
|
@@ -13,13 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { schema
|
|
17
|
-
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
16
|
+
import { schema } from '@manuscripts/transform';
|
|
18
17
|
import { ContextMenu, contextMenuBtnClass } from '../lib/context-menu';
|
|
19
|
-
|
|
20
|
-
const hasParent = ($pos, type) => {
|
|
21
|
-
return !!findParentNodeOfTypeClosestToPos($pos, type);
|
|
22
|
-
};
|
|
18
|
+
import { hasParent, isNotNull } from '../lib/utils';
|
|
23
19
|
export const EditableBlock = (Base) => {
|
|
24
20
|
return class extends Base {
|
|
25
21
|
constructor() {
|
|
@@ -29,6 +29,7 @@ import { createElement } from 'react';
|
|
|
29
29
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
30
30
|
import { FigureOptions, } from '../components/views/FigureDropdown';
|
|
31
31
|
import { groupFiles } from '../lib/files';
|
|
32
|
+
import { isDeleted } from '../lib/track-changes-utils';
|
|
32
33
|
import { updateNodeAttrs } from '../lib/view';
|
|
33
34
|
import { createEditableNodeView } from './creators';
|
|
34
35
|
import { FigureView } from './figure';
|
|
@@ -43,10 +44,10 @@ export var figurePositions;
|
|
|
43
44
|
export class FigureEditableView extends FigureView {
|
|
44
45
|
constructor() {
|
|
45
46
|
super(...arguments);
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
};
|
|
47
|
+
this.upload = (file) => __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const result = yield this.props.fileManagement.upload(file);
|
|
49
|
+
this.setSrc(result.id);
|
|
50
|
+
});
|
|
50
51
|
this.setSrc = (src) => {
|
|
51
52
|
const { tr } = this.view.state;
|
|
52
53
|
const pos = this.getPos();
|
|
@@ -162,14 +163,17 @@ export class FigureEditableView extends FigureView {
|
|
|
162
163
|
this.props.popper.show(this.positionMenuWrapper, ReactSubView(this.props, ContextMenu, componentProps, this.node, this.getPos, this.view, ['context-menu', 'position-menu']), 'left', false);
|
|
163
164
|
};
|
|
164
165
|
}
|
|
166
|
+
initialise() {
|
|
167
|
+
this.upload = this.upload.bind(this);
|
|
168
|
+
this.createDOM();
|
|
169
|
+
this.updateContents();
|
|
170
|
+
}
|
|
165
171
|
updateContents() {
|
|
166
|
-
var _a;
|
|
167
172
|
super.updateContents();
|
|
168
|
-
const
|
|
169
|
-
const src = attrs.src;
|
|
173
|
+
const src = this.node.attrs.src;
|
|
170
174
|
const files = this.props.getFiles();
|
|
171
175
|
const file = src && files.filter((f) => f.id === src)[0];
|
|
172
|
-
this.figurePosition = attrs.type;
|
|
176
|
+
this.figurePosition = this.node.attrs.type;
|
|
173
177
|
this.container.innerHTML = '';
|
|
174
178
|
const can = this.props.getCapabilities();
|
|
175
179
|
const link = file && this.props.fileManagement.previewLink(file);
|
|
@@ -178,37 +182,13 @@ export class FigureEditableView extends FigureView {
|
|
|
178
182
|
: file
|
|
179
183
|
? this.createUnsupportedFormat(file.name)
|
|
180
184
|
: this.createPlaceholder();
|
|
181
|
-
|
|
182
|
-
let handleUpload;
|
|
183
|
-
let handleReplace;
|
|
184
|
-
let handleDetach;
|
|
185
|
-
if (src) {
|
|
186
|
-
if (file) {
|
|
187
|
-
handleDownload = () => {
|
|
188
|
-
this.props.fileManagement.download(file);
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
handleDetach = () => {
|
|
192
|
-
this.setSrc('');
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
if (can.replaceFile) {
|
|
196
|
-
handleReplace = (file) => {
|
|
197
|
-
this.setSrc(file.id);
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
if (can.uploadFile) {
|
|
201
|
-
const upload = (file) => __awaiter(this, void 0, void 0, function* () {
|
|
202
|
-
const result = yield this.props.fileManagement.upload(file);
|
|
203
|
-
this.setSrc(result.id);
|
|
204
|
-
});
|
|
205
|
-
handleUpload = figureUploader(upload);
|
|
185
|
+
if (can.uploadFile && !isDeleted(this.node)) {
|
|
206
186
|
const handlePlaceholderClick = (event) => {
|
|
207
187
|
const target = event.target;
|
|
208
188
|
if (target.dataset && target.dataset.action) {
|
|
209
189
|
return;
|
|
210
190
|
}
|
|
211
|
-
const triggerUpload = figureUploader(upload);
|
|
191
|
+
const triggerUpload = figureUploader(this.upload);
|
|
212
192
|
triggerUpload();
|
|
213
193
|
};
|
|
214
194
|
img.addEventListener('click', handlePlaceholderClick);
|
|
@@ -238,12 +218,46 @@ export class FigureEditableView extends FigureView {
|
|
|
238
218
|
img.addEventListener('drop', (e) => __awaiter(this, void 0, void 0, function* () {
|
|
239
219
|
if (e.dataTransfer && e.dataTransfer.files.length) {
|
|
240
220
|
e.preventDefault();
|
|
241
|
-
yield upload(e.dataTransfer.files[0]);
|
|
221
|
+
yield this.upload(e.dataTransfer.files[0]);
|
|
242
222
|
}
|
|
243
223
|
}));
|
|
244
224
|
}
|
|
245
225
|
this.container.innerHTML = '';
|
|
246
226
|
this.container.appendChild(img);
|
|
227
|
+
this.addTools();
|
|
228
|
+
}
|
|
229
|
+
addTools() {
|
|
230
|
+
this.manageReactTools();
|
|
231
|
+
this.container.appendChild(this.createPositionMenuWrapper());
|
|
232
|
+
}
|
|
233
|
+
manageReactTools() {
|
|
234
|
+
var _a;
|
|
235
|
+
let handleDownload;
|
|
236
|
+
let handleUpload;
|
|
237
|
+
let handleReplace;
|
|
238
|
+
let handleDetach;
|
|
239
|
+
const src = this.node.attrs.src;
|
|
240
|
+
const files = this.props.getFiles();
|
|
241
|
+
const file = src && files.filter((f) => f.id === src)[0];
|
|
242
|
+
const can = this.props.getCapabilities();
|
|
243
|
+
if (src) {
|
|
244
|
+
if (file) {
|
|
245
|
+
handleDownload = () => {
|
|
246
|
+
this.props.fileManagement.download(file);
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
handleDetach = () => {
|
|
250
|
+
this.setSrc('');
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
if (can.replaceFile) {
|
|
254
|
+
handleReplace = (file) => {
|
|
255
|
+
this.setSrc(file.id);
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
if (can.uploadFile) {
|
|
259
|
+
handleUpload = figureUploader(this.upload);
|
|
260
|
+
}
|
|
247
261
|
(_a = this.reactTools) === null || _a === void 0 ? void 0 : _a.remove();
|
|
248
262
|
if (this.props.dispatch && this.props.theme) {
|
|
249
263
|
const files = this.props.getFiles();
|
|
@@ -259,7 +273,6 @@ export class FigureEditableView extends FigureView {
|
|
|
259
273
|
this.reactTools = ReactSubView(this.props, FigureOptions, componentProps, this.node, this.getPos, this.view);
|
|
260
274
|
this.dom.insertBefore(this.reactTools, this.dom.firstChild);
|
|
261
275
|
}
|
|
262
|
-
this.container.appendChild(this.createPositionMenuWrapper());
|
|
263
276
|
}
|
|
264
277
|
}
|
|
265
278
|
export default createEditableNodeView(FigureEditableView);
|
|
@@ -13,18 +13,51 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { ContextMenu } from '@manuscripts/style-guide';
|
|
17
|
+
import { schema } from '@manuscripts/transform';
|
|
18
|
+
import { findChildrenByType } from 'prosemirror-utils';
|
|
16
19
|
import BlockView from './block_view';
|
|
17
20
|
import { createNodeOrElementView } from './creators';
|
|
21
|
+
import ReactSubView from './ReactSubView';
|
|
18
22
|
export class PullquoteElementView extends BlockView {
|
|
19
23
|
constructor() {
|
|
20
24
|
super(...arguments);
|
|
21
25
|
this.elementType = 'aside';
|
|
26
|
+
this.ignoreMutation = () => true;
|
|
27
|
+
this.stopEvent = () => true;
|
|
22
28
|
this.createElement = () => {
|
|
23
29
|
this.contentDOM = document.createElement(this.elementType);
|
|
24
30
|
this.contentDOM.className = 'block';
|
|
25
31
|
this.contentDOM.classList.add('pullquote');
|
|
26
32
|
this.dom.appendChild(this.contentDOM);
|
|
27
33
|
};
|
|
34
|
+
this.actionGutterButtons = () => {
|
|
35
|
+
const contextMenu = this.addFigureContextMenu();
|
|
36
|
+
return contextMenu ? [contextMenu] : [];
|
|
37
|
+
};
|
|
38
|
+
this.addFigureContextMenu = () => {
|
|
39
|
+
const can = this.props.getCapabilities();
|
|
40
|
+
const componentProps = {
|
|
41
|
+
actions: [],
|
|
42
|
+
};
|
|
43
|
+
if (can.editArticle) {
|
|
44
|
+
componentProps.actions.push({
|
|
45
|
+
label: 'Add Image',
|
|
46
|
+
action: () => this.handleAddFigure(),
|
|
47
|
+
icon: 'AddFigure',
|
|
48
|
+
disabled: !!findChildrenByType(this.node, schema.nodes.quote_image)
|
|
49
|
+
.length,
|
|
50
|
+
});
|
|
51
|
+
this.contextMenu = ReactSubView(this.props, ContextMenu, componentProps, this.node, this.getPos, this.view, ['context-menu']);
|
|
52
|
+
return this.contextMenu;
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
handleAddFigure() {
|
|
58
|
+
const tr = this.view.state.tr;
|
|
59
|
+
tr.insert(this.getPos() + 1, schema.nodes.quote_image.create());
|
|
60
|
+
this.view.dispatch(tr);
|
|
28
61
|
}
|
|
29
62
|
}
|
|
30
63
|
export default createNodeOrElementView(PullquoteElementView, 'aside');
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { plusIcon } from '../icons';
|
|
17
|
+
import { addTrackChangesAttributes, addTrackChangesClassNames, isDeleted, } from '../lib/track-changes-utils';
|
|
18
|
+
import { createEditableNodeView } from './creators';
|
|
19
|
+
import { FigureEditableView } from './figure_editable';
|
|
20
|
+
export class QuoteImageEditableView extends FigureEditableView {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.createPlaceholder = () => {
|
|
24
|
+
const element = document.createElement('div');
|
|
25
|
+
element.classList.add('figure', 'placeholder');
|
|
26
|
+
const instructions = document.createElement('div');
|
|
27
|
+
instructions.classList.add('instructions');
|
|
28
|
+
instructions.innerHTML = `${plusIcon}<div>Drag or click here to upload image</div>`;
|
|
29
|
+
element.appendChild(instructions);
|
|
30
|
+
return element;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
createDOM() {
|
|
34
|
+
this.dom = document.createElement('figure');
|
|
35
|
+
this.container = document.createElement('div');
|
|
36
|
+
this.container.className = 'pullquote-figure';
|
|
37
|
+
this.container.contentEditable = 'false';
|
|
38
|
+
this.dom.appendChild(this.container);
|
|
39
|
+
}
|
|
40
|
+
addTools() {
|
|
41
|
+
if (!this.closeButton) {
|
|
42
|
+
const closeButton = document.createElement('button');
|
|
43
|
+
closeButton.innerHTML = plusIcon;
|
|
44
|
+
closeButton.classList.add('figure-remove-button', 'button-reset');
|
|
45
|
+
closeButton.addEventListener('click', () => {
|
|
46
|
+
if (this.node.attrs.src) {
|
|
47
|
+
this.setSrc('');
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
const { tr } = this.view.state;
|
|
51
|
+
tr.delete(this.getPos(), this.getPos() + this.node.nodeSize);
|
|
52
|
+
this.view.dispatch(tr);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
this.closeButton = closeButton;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
updateContents() {
|
|
59
|
+
super.updateContents();
|
|
60
|
+
if (!isDeleted(this.node)) {
|
|
61
|
+
this.container.appendChild(this.closeButton);
|
|
62
|
+
}
|
|
63
|
+
addTrackChangesAttributes(this.node.attrs, this.dom);
|
|
64
|
+
addTrackChangesClassNames(this.node.attrs, this.dom);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export default createEditableNodeView(QuoteImageEditableView);
|
package/dist/types/icons.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { BibliographyItemAttrs, BibliographyItemType, ManuscriptNode, ManuscriptNodeType } from '@manuscripts/transform';
|
|
17
|
-
import { Node as ProseMirrorNode, NodeType } from 'prosemirror-model';
|
|
17
|
+
import { Node as ProseMirrorNode, NodeType, ResolvedPos } from 'prosemirror-model';
|
|
18
18
|
import { EditorState, Selection } from 'prosemirror-state';
|
|
19
19
|
export declare function iterateChildren(node: ManuscriptNode, recurse?: boolean): Iterable<ManuscriptNode>;
|
|
20
20
|
export declare const getMatchingChild: (parent: ManuscriptNode, matcher: (node: ManuscriptNode) => boolean, deep?: boolean) => ManuscriptNode | undefined;
|
|
@@ -28,6 +28,8 @@ export declare const isChildOfNodeTypes: (doc: ManuscriptNode, pos: number, pare
|
|
|
28
28
|
export declare const isSelectionInNode: (state: EditorState, targetNode: ProseMirrorNode) => boolean;
|
|
29
29
|
export declare const isSelectionInBody: (state: EditorState) => boolean;
|
|
30
30
|
export declare const createHeader: (typeName: string, text: string) => HTMLHeadingElement;
|
|
31
|
+
export declare const isNotNull: <T>(a: T | null) => a is T;
|
|
32
|
+
export declare const hasParent: ($pos: ResolvedPos, type: ManuscriptNodeType) => boolean;
|
|
31
33
|
export declare const shouldRenderField: (field: string, type: BibliographyItemType) => boolean;
|
|
32
34
|
export declare const cleanItemValues: (item: BibliographyItemAttrs) => BibliographyItemAttrs;
|
|
33
35
|
export declare const isBodyLocked: (state: EditorState) => boolean;
|
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.52";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
|
@@ -23,6 +23,7 @@ export default class BlockView<BlockNode extends ManuscriptNode> extends BaseNod
|
|
|
23
23
|
updatePlaceholder(): void;
|
|
24
24
|
createElement(): void;
|
|
25
25
|
createDOM(): void;
|
|
26
|
+
gutter: Record<string, HTMLElement>;
|
|
26
27
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
27
28
|
gutterButtons(): HTMLElement[];
|
|
28
29
|
actionGutterButtons(): HTMLElement[];
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
27
27
|
updatePlaceholder(): void;
|
|
28
28
|
createElement(): void;
|
|
29
29
|
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
30
31
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
31
32
|
dom: HTMLElement;
|
|
32
33
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
27
27
|
updatePlaceholder(): void;
|
|
28
28
|
createElement(): void;
|
|
29
29
|
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
30
31
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
31
32
|
dom: HTMLElement;
|
|
32
33
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -30,6 +30,7 @@ export declare const EditableBlock: <T extends Constructor<BlockView<import("pro
|
|
|
30
30
|
updatePlaceholder(): void;
|
|
31
31
|
createElement(): void;
|
|
32
32
|
createDOM(): void;
|
|
33
|
+
gutter: Record<string, HTMLElement>;
|
|
33
34
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
34
35
|
dom: HTMLElement;
|
|
35
36
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
27
27
|
updatePlaceholder(): void;
|
|
28
28
|
createElement(): void;
|
|
29
29
|
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
30
31
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
31
32
|
dom: HTMLElement;
|
|
32
33
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -23,12 +23,15 @@ export declare class FigureEditableView extends FigureView {
|
|
|
23
23
|
reactTools: HTMLDivElement;
|
|
24
24
|
positionMenuWrapper: HTMLDivElement;
|
|
25
25
|
figurePosition: string;
|
|
26
|
-
initialise
|
|
26
|
+
initialise(): void;
|
|
27
|
+
upload: (file: File) => Promise<void>;
|
|
27
28
|
updateContents(): void;
|
|
28
|
-
|
|
29
|
+
protected addTools(): void;
|
|
30
|
+
private manageReactTools;
|
|
31
|
+
protected setSrc: (src: string) => void;
|
|
29
32
|
private createUnsupportedFormat;
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
protected createImg: (src: string) => HTMLImageElement;
|
|
34
|
+
protected createPlaceholder: () => HTMLDivElement;
|
|
32
35
|
createPositionMenuWrapper: () => HTMLDivElement;
|
|
33
36
|
showPositionMenu: () => void;
|
|
34
37
|
}
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
27
27
|
updatePlaceholder(): void;
|
|
28
28
|
createElement(): void;
|
|
29
29
|
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
30
31
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
31
32
|
dom: HTMLElement;
|
|
32
33
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -34,6 +34,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
34
34
|
updatePlaceholder(): void;
|
|
35
35
|
createElement(): void;
|
|
36
36
|
createDOM(): void;
|
|
37
|
+
gutter: Record<string, HTMLElement>;
|
|
37
38
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
38
39
|
dom: HTMLElement;
|
|
39
40
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
27
27
|
updatePlaceholder(): void;
|
|
28
28
|
createElement(): void;
|
|
29
29
|
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
30
31
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
31
32
|
dom: HTMLElement;
|
|
32
33
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
27
27
|
updatePlaceholder(): void;
|
|
28
28
|
createElement(): void;
|
|
29
29
|
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
30
31
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
31
32
|
dom: HTMLElement;
|
|
32
33
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
27
27
|
updatePlaceholder(): void;
|
|
28
28
|
createElement(): void;
|
|
29
29
|
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
30
31
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
31
32
|
dom: HTMLElement;
|
|
32
33
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -17,7 +17,13 @@ import { PullquoteElementNode } from '@manuscripts/transform';
|
|
|
17
17
|
import BlockView from './block_view';
|
|
18
18
|
export declare class PullquoteElementView extends BlockView<PullquoteElementNode> {
|
|
19
19
|
elementType: string;
|
|
20
|
+
contextMenu: HTMLElement;
|
|
21
|
+
ignoreMutation: () => boolean;
|
|
22
|
+
stopEvent: () => boolean;
|
|
20
23
|
createElement: () => void;
|
|
24
|
+
handleAddFigure(): void;
|
|
25
|
+
actionGutterButtons: () => HTMLElement[];
|
|
26
|
+
addFigureContextMenu: () => HTMLElement | undefined;
|
|
21
27
|
}
|
|
22
28
|
declare const _default: (props: import("../configs/ManuscriptsEditor").EditorProps) => import("../types").NodeViewCreator<PullquoteElementView>;
|
|
23
29
|
export default _default;
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
27
27
|
updatePlaceholder(): void;
|
|
28
28
|
createElement(): void;
|
|
29
29
|
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
30
31
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
31
32
|
dom: HTMLElement;
|
|
32
33
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { FigureEditableView } from './figure_editable';
|
|
17
|
+
export declare class QuoteImageEditableView extends FigureEditableView {
|
|
18
|
+
closeButton: HTMLButtonElement;
|
|
19
|
+
isInPullQuote: boolean;
|
|
20
|
+
createDOM(): void;
|
|
21
|
+
addTools(): void;
|
|
22
|
+
updateContents(): void;
|
|
23
|
+
protected createPlaceholder: () => HTMLDivElement;
|
|
24
|
+
}
|
|
25
|
+
declare const _default: (props: import("../configs/ManuscriptsEditor").EditorProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<QuoteImageEditableView>;
|
|
26
|
+
export default _default;
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
27
27
|
updatePlaceholder(): void;
|
|
28
28
|
createElement(): void;
|
|
29
29
|
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
30
31
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
31
32
|
dom: HTMLElement;
|
|
32
33
|
contentDOM?: HTMLElement | undefined;
|
|
@@ -27,6 +27,7 @@ declare const _default: (props: import("../configs/ManuscriptsEditor").EditorPro
|
|
|
27
27
|
updatePlaceholder(): void;
|
|
28
28
|
createElement(): void;
|
|
29
29
|
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
30
31
|
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
31
32
|
dom: HTMLElement;
|
|
32
33
|
contentDOM?: HTMLElement | undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/body-editor",
|
|
3
3
|
"description": "Prosemirror components for editing and viewing manuscripts",
|
|
4
|
-
"version": "2.8.
|
|
4
|
+
"version": "2.8.52",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"@iarna/word-count": "^1.1.2",
|
|
33
33
|
"@manuscripts/json-schema": "2.2.11",
|
|
34
34
|
"@manuscripts/library": "1.3.14",
|
|
35
|
-
"@manuscripts/style-guide": "2.1.
|
|
35
|
+
"@manuscripts/style-guide": "2.1.10",
|
|
36
36
|
"@manuscripts/track-changes-plugin": "1.10.4",
|
|
37
|
-
"@manuscripts/transform": "3.0.
|
|
37
|
+
"@manuscripts/transform": "3.0.59",
|
|
38
38
|
"@popperjs/core": "^2.11.8",
|
|
39
39
|
"astrocite-eutils": "^0.16.4",
|
|
40
40
|
"codemirror": "^5.58.1",
|