@manuscripts/body-editor 2.8.86 → 2.8.87-LEAN-4591.0
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/components/views/FigureDropdown.js +4 -2
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/figure_editable.js +21 -0
- package/dist/cjs/views/figure_element.js +37 -0
- package/dist/es/components/views/FigureDropdown.js +4 -2
- package/dist/es/versions.js +1 -1
- package/dist/es/views/figure_editable.js +21 -0
- package/dist/es/views/figure_element.js +37 -0
- package/dist/types/components/views/FigureDropdown.d.ts +2 -0
- package/dist/types/versions.d.ts +1 -1
- package/dist/types/views/figure_editable.d.ts +1 -0
- package/dist/types/views/figure_element.d.ts +3 -0
- package/package.json +1 -1
- package/styles/AdvancedEditor.css +152 -1
- package/styles/Editor.css +0 -114
|
@@ -7,7 +7,7 @@ exports.FigureOptions = void 0;
|
|
|
7
7
|
const style_guide_1 = require("@manuscripts/style-guide");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
|
-
const FigureOptions = ({ can, files, onDownload, onUpload, onDetach, onReplace, }) => {
|
|
10
|
+
const FigureOptions = ({ can, files, onDownload, onUpload, onDetach, onReplace, onDelete, figureIndex, }) => {
|
|
11
11
|
const { isOpen, toggleOpen, wrapperRef } = (0, style_guide_1.useDropdown)();
|
|
12
12
|
const supplements = files.supplements
|
|
13
13
|
.map((s) => s.file)
|
|
@@ -18,6 +18,7 @@ const FigureOptions = ({ can, files, onDownload, onUpload, onDetach, onReplace,
|
|
|
18
18
|
const showDetach = onDetach && can.detachFile;
|
|
19
19
|
const showReplace = onReplace && can.replaceFile;
|
|
20
20
|
const replaceBtnText = onDownload ? 'Replace' : 'Choose file';
|
|
21
|
+
const showDelete = onDelete && can.editArticle && figureIndex !== 0;
|
|
21
22
|
return (react_1.default.createElement(DropdownWrapper, { ref: wrapperRef },
|
|
22
23
|
react_1.default.createElement(OptionsButton, { className: 'options-button', onClick: toggleOpen },
|
|
23
24
|
react_1.default.createElement(style_guide_1.DotsIcon, null)),
|
|
@@ -33,7 +34,8 @@ const FigureOptions = ({ can, files, onDownload, onUpload, onDetach, onReplace,
|
|
|
33
34
|
react_1.default.createElement(style_guide_1.UploadIcon, null),
|
|
34
35
|
" Upload new...")) }),
|
|
35
36
|
react_1.default.createElement(ListItemButton, { onClick: onDownload, disabled: !showDownload }, "Download"),
|
|
36
|
-
react_1.default.createElement(ListItemButton, { onClick: onDetach, disabled: !showDetach }, "Detach")
|
|
37
|
+
react_1.default.createElement(ListItemButton, { onClick: onDetach, disabled: !showDetach }, "Detach"),
|
|
38
|
+
showDelete && (react_1.default.createElement(ListItemButton, { onClick: onDelete }, "Delete"))))));
|
|
37
39
|
};
|
|
38
40
|
exports.FigureOptions = FigureOptions;
|
|
39
41
|
const NestedDropdown = ({ parentToggleOpen, buttonText, disabled, list, moveLeft }) => {
|
package/dist/cjs/versions.js
CHANGED
|
@@ -242,6 +242,7 @@ class FigureEditableView extends figure_1.FigureView {
|
|
|
242
242
|
let handleUpload;
|
|
243
243
|
let handleReplace;
|
|
244
244
|
let handleDetach;
|
|
245
|
+
let handleDelete;
|
|
245
246
|
const src = this.node.attrs.src;
|
|
246
247
|
const files = this.props.getFiles();
|
|
247
248
|
const file = src && files.filter((f) => f.id === src)[0];
|
|
@@ -264,6 +265,14 @@ class FigureEditableView extends figure_1.FigureView {
|
|
|
264
265
|
if (can.uploadFile) {
|
|
265
266
|
handleUpload = (0, figure_uploader_1.figureUploader)(this.upload);
|
|
266
267
|
}
|
|
268
|
+
if (can.editArticle) {
|
|
269
|
+
handleDelete = () => {
|
|
270
|
+
const pos = this.getPos();
|
|
271
|
+
const tr = this.view.state.tr;
|
|
272
|
+
tr.delete(pos, pos + this.node.nodeSize);
|
|
273
|
+
this.view.dispatch(tr);
|
|
274
|
+
};
|
|
275
|
+
}
|
|
267
276
|
(_a = this.reactTools) === null || _a === void 0 ? void 0 : _a.remove();
|
|
268
277
|
if (this.props.dispatch && this.props.theme) {
|
|
269
278
|
const files = this.props.getFiles();
|
|
@@ -275,11 +284,23 @@ class FigureEditableView extends figure_1.FigureView {
|
|
|
275
284
|
onUpload: handleUpload,
|
|
276
285
|
onDetach: handleDetach,
|
|
277
286
|
onReplace: handleReplace,
|
|
287
|
+
onDelete: handleDelete,
|
|
288
|
+
figureIndex: this.getFigureIndex(),
|
|
278
289
|
};
|
|
279
290
|
this.reactTools = (0, ReactSubView_1.default)(this.props, FigureDropdown_1.FigureOptions, componentProps, this.node, this.getPos, this.view);
|
|
280
291
|
this.dom.insertBefore(this.reactTools, this.dom.firstChild);
|
|
281
292
|
}
|
|
282
293
|
}
|
|
294
|
+
getFigureIndex() {
|
|
295
|
+
const figures = [];
|
|
296
|
+
this.view.state.doc.descendants((node, pos) => {
|
|
297
|
+
if (node.type === transform_1.schema.nodes.figure) {
|
|
298
|
+
figures.push(pos);
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
const currentPos = this.getPos();
|
|
302
|
+
return figures.indexOf(currentPos);
|
|
303
|
+
}
|
|
283
304
|
}
|
|
284
305
|
exports.FigureEditableView = FigureEditableView;
|
|
285
306
|
exports.default = (0, creators_1.createEditableNodeView)(FigureEditableView);
|
|
@@ -19,6 +19,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.FigureElementView = void 0;
|
|
22
|
+
const style_guide_1 = require("@manuscripts/style-guide");
|
|
23
|
+
const transform_1 = require("@manuscripts/transform");
|
|
24
|
+
const react_1 = require("react");
|
|
25
|
+
const server_1 = require("react-dom/server");
|
|
22
26
|
const block_view_1 = __importDefault(require("./block_view"));
|
|
23
27
|
const creators_1 = require("./creators");
|
|
24
28
|
class FigureElementView extends block_view_1.default {
|
|
@@ -33,7 +37,40 @@ class FigureElementView extends block_view_1.default {
|
|
|
33
37
|
this.contentDOM.classList.add('figure-block');
|
|
34
38
|
this.contentDOM.setAttribute('id', this.node.attrs.id);
|
|
35
39
|
this.container.appendChild(this.contentDOM);
|
|
40
|
+
if (this.node.type === transform_1.schema.nodes.figure_element) {
|
|
41
|
+
this.addFigureElementButtons();
|
|
42
|
+
}
|
|
36
43
|
};
|
|
44
|
+
this.addFigure = () => {
|
|
45
|
+
const { state } = this.view;
|
|
46
|
+
const { tr } = state;
|
|
47
|
+
const figureElementPos = this.getPos();
|
|
48
|
+
let insertPos = figureElementPos + 1;
|
|
49
|
+
let lastFigureEndPos = insertPos;
|
|
50
|
+
let hasFigures = false;
|
|
51
|
+
this.node.forEach((node) => {
|
|
52
|
+
if (node.type === transform_1.schema.nodes.figure) {
|
|
53
|
+
lastFigureEndPos = insertPos + node.nodeSize;
|
|
54
|
+
hasFigures = true;
|
|
55
|
+
}
|
|
56
|
+
insertPos += node.nodeSize;
|
|
57
|
+
});
|
|
58
|
+
const finalInsertPos = hasFigures ? lastFigureEndPos : figureElementPos + 1;
|
|
59
|
+
const figureNode = state.schema.nodes.figure.create();
|
|
60
|
+
tr.insert(finalInsertPos, figureNode);
|
|
61
|
+
this.view.dispatch(tr);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
addFigureElementButtons() {
|
|
65
|
+
var _a;
|
|
66
|
+
if ((_a = this.props.getCapabilities()) === null || _a === void 0 ? void 0 : _a.editArticle) {
|
|
67
|
+
this.addFigureBtn = document.createElement('button');
|
|
68
|
+
this.addFigureBtn.className = 'add-figure-button';
|
|
69
|
+
this.addFigureBtn.innerHTML = (0, server_1.renderToStaticMarkup)((0, react_1.createElement)(style_guide_1.PlusIcon));
|
|
70
|
+
this.addFigureBtn.title = 'Add figure';
|
|
71
|
+
this.addFigureBtn.addEventListener('click', this.addFigure);
|
|
72
|
+
this.container.prepend(this.addFigureBtn);
|
|
73
|
+
}
|
|
37
74
|
}
|
|
38
75
|
}
|
|
39
76
|
exports.FigureElementView = FigureElementView;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DotsIcon, DropdownList, getFileIcon, IconButton, IconTextButton, isImageFile, TriangleCollapsedIcon, UploadIcon, useDropdown, } from '@manuscripts/style-guide';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
export const FigureOptions = ({ can, files, onDownload, onUpload, onDetach, onReplace, }) => {
|
|
4
|
+
export const FigureOptions = ({ can, files, onDownload, onUpload, onDetach, onReplace, onDelete, figureIndex, }) => {
|
|
5
5
|
const { isOpen, toggleOpen, wrapperRef } = useDropdown();
|
|
6
6
|
const supplements = files.supplements
|
|
7
7
|
.map((s) => s.file)
|
|
@@ -12,6 +12,7 @@ export const FigureOptions = ({ can, files, onDownload, onUpload, onDetach, onRe
|
|
|
12
12
|
const showDetach = onDetach && can.detachFile;
|
|
13
13
|
const showReplace = onReplace && can.replaceFile;
|
|
14
14
|
const replaceBtnText = onDownload ? 'Replace' : 'Choose file';
|
|
15
|
+
const showDelete = onDelete && can.editArticle && figureIndex !== 0;
|
|
15
16
|
return (React.createElement(DropdownWrapper, { ref: wrapperRef },
|
|
16
17
|
React.createElement(OptionsButton, { className: 'options-button', onClick: toggleOpen },
|
|
17
18
|
React.createElement(DotsIcon, null)),
|
|
@@ -27,7 +28,8 @@ export const FigureOptions = ({ can, files, onDownload, onUpload, onDetach, onRe
|
|
|
27
28
|
React.createElement(UploadIcon, null),
|
|
28
29
|
" Upload new...")) }),
|
|
29
30
|
React.createElement(ListItemButton, { onClick: onDownload, disabled: !showDownload }, "Download"),
|
|
30
|
-
React.createElement(ListItemButton, { onClick: onDetach, disabled: !showDetach }, "Detach")
|
|
31
|
+
React.createElement(ListItemButton, { onClick: onDetach, disabled: !showDetach }, "Detach"),
|
|
32
|
+
showDelete && (React.createElement(ListItemButton, { onClick: onDelete }, "Delete"))))));
|
|
31
33
|
};
|
|
32
34
|
const NestedDropdown = ({ parentToggleOpen, buttonText, disabled, list, moveLeft }) => {
|
|
33
35
|
const { isOpen, toggleOpen, wrapperRef } = useDropdown();
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.8.
|
|
1
|
+
export const VERSION = '2.8.87-LEAN-4591.0';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
|
@@ -236,6 +236,7 @@ export class FigureEditableView extends FigureView {
|
|
|
236
236
|
let handleUpload;
|
|
237
237
|
let handleReplace;
|
|
238
238
|
let handleDetach;
|
|
239
|
+
let handleDelete;
|
|
239
240
|
const src = this.node.attrs.src;
|
|
240
241
|
const files = this.props.getFiles();
|
|
241
242
|
const file = src && files.filter((f) => f.id === src)[0];
|
|
@@ -258,6 +259,14 @@ export class FigureEditableView extends FigureView {
|
|
|
258
259
|
if (can.uploadFile) {
|
|
259
260
|
handleUpload = figureUploader(this.upload);
|
|
260
261
|
}
|
|
262
|
+
if (can.editArticle) {
|
|
263
|
+
handleDelete = () => {
|
|
264
|
+
const pos = this.getPos();
|
|
265
|
+
const tr = this.view.state.tr;
|
|
266
|
+
tr.delete(pos, pos + this.node.nodeSize);
|
|
267
|
+
this.view.dispatch(tr);
|
|
268
|
+
};
|
|
269
|
+
}
|
|
261
270
|
(_a = this.reactTools) === null || _a === void 0 ? void 0 : _a.remove();
|
|
262
271
|
if (this.props.dispatch && this.props.theme) {
|
|
263
272
|
const files = this.props.getFiles();
|
|
@@ -269,10 +278,22 @@ export class FigureEditableView extends FigureView {
|
|
|
269
278
|
onUpload: handleUpload,
|
|
270
279
|
onDetach: handleDetach,
|
|
271
280
|
onReplace: handleReplace,
|
|
281
|
+
onDelete: handleDelete,
|
|
282
|
+
figureIndex: this.getFigureIndex(),
|
|
272
283
|
};
|
|
273
284
|
this.reactTools = ReactSubView(this.props, FigureOptions, componentProps, this.node, this.getPos, this.view);
|
|
274
285
|
this.dom.insertBefore(this.reactTools, this.dom.firstChild);
|
|
275
286
|
}
|
|
276
287
|
}
|
|
288
|
+
getFigureIndex() {
|
|
289
|
+
const figures = [];
|
|
290
|
+
this.view.state.doc.descendants((node, pos) => {
|
|
291
|
+
if (node.type === schema.nodes.figure) {
|
|
292
|
+
figures.push(pos);
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
const currentPos = this.getPos();
|
|
296
|
+
return figures.indexOf(currentPos);
|
|
297
|
+
}
|
|
277
298
|
}
|
|
278
299
|
export default createEditableNodeView(FigureEditableView);
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { PlusIcon } from '@manuscripts/style-guide';
|
|
17
|
+
import { schema } from '@manuscripts/transform';
|
|
18
|
+
import { createElement } from 'react';
|
|
19
|
+
import { renderToStaticMarkup } from 'react-dom/server';
|
|
16
20
|
import BlockView from './block_view';
|
|
17
21
|
import { createNodeView } from './creators';
|
|
18
22
|
export class FigureElementView extends BlockView {
|
|
@@ -27,7 +31,40 @@ export class FigureElementView extends BlockView {
|
|
|
27
31
|
this.contentDOM.classList.add('figure-block');
|
|
28
32
|
this.contentDOM.setAttribute('id', this.node.attrs.id);
|
|
29
33
|
this.container.appendChild(this.contentDOM);
|
|
34
|
+
if (this.node.type === schema.nodes.figure_element) {
|
|
35
|
+
this.addFigureElementButtons();
|
|
36
|
+
}
|
|
30
37
|
};
|
|
38
|
+
this.addFigure = () => {
|
|
39
|
+
const { state } = this.view;
|
|
40
|
+
const { tr } = state;
|
|
41
|
+
const figureElementPos = this.getPos();
|
|
42
|
+
let insertPos = figureElementPos + 1;
|
|
43
|
+
let lastFigureEndPos = insertPos;
|
|
44
|
+
let hasFigures = false;
|
|
45
|
+
this.node.forEach((node) => {
|
|
46
|
+
if (node.type === schema.nodes.figure) {
|
|
47
|
+
lastFigureEndPos = insertPos + node.nodeSize;
|
|
48
|
+
hasFigures = true;
|
|
49
|
+
}
|
|
50
|
+
insertPos += node.nodeSize;
|
|
51
|
+
});
|
|
52
|
+
const finalInsertPos = hasFigures ? lastFigureEndPos : figureElementPos + 1;
|
|
53
|
+
const figureNode = state.schema.nodes.figure.create();
|
|
54
|
+
tr.insert(finalInsertPos, figureNode);
|
|
55
|
+
this.view.dispatch(tr);
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
addFigureElementButtons() {
|
|
59
|
+
var _a;
|
|
60
|
+
if ((_a = this.props.getCapabilities()) === null || _a === void 0 ? void 0 : _a.editArticle) {
|
|
61
|
+
this.addFigureBtn = document.createElement('button');
|
|
62
|
+
this.addFigureBtn.className = 'add-figure-button';
|
|
63
|
+
this.addFigureBtn.innerHTML = renderToStaticMarkup(createElement(PlusIcon));
|
|
64
|
+
this.addFigureBtn.title = 'Add figure';
|
|
65
|
+
this.addFigureBtn.addEventListener('click', this.addFigure);
|
|
66
|
+
this.container.prepend(this.addFigureBtn);
|
|
67
|
+
}
|
|
31
68
|
}
|
|
32
69
|
}
|
|
33
70
|
export default createNodeView(FigureElementView);
|
|
@@ -10,6 +10,8 @@ export interface FigureOptionsProps extends FigureDropdownProps {
|
|
|
10
10
|
onUpload?: () => void;
|
|
11
11
|
onDetach?: () => void;
|
|
12
12
|
onReplace?: (file: FileAttachment) => void;
|
|
13
|
+
onDelete?: () => void;
|
|
14
|
+
figureIndex?: number;
|
|
13
15
|
}
|
|
14
16
|
export interface FigureElementOptionsProps extends FigureDropdownProps {
|
|
15
17
|
onAdd: (file: FileAttachment) => Promise<void>;
|
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.87-LEAN-4591.0";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
|
@@ -29,6 +29,7 @@ export declare class FigureEditableView extends FigureView {
|
|
|
29
29
|
protected addTools(): void;
|
|
30
30
|
private manageReactTools;
|
|
31
31
|
protected setSrc: (src: string) => void;
|
|
32
|
+
private getFigureIndex;
|
|
32
33
|
private createUnsupportedFormat;
|
|
33
34
|
protected createImg: (src: string) => HTMLImageElement;
|
|
34
35
|
protected createPlaceholder: () => HTMLDivElement;
|
|
@@ -18,8 +18,11 @@ import { Trackable } from '../types';
|
|
|
18
18
|
import BlockView from './block_view';
|
|
19
19
|
export declare class FigureElementView extends BlockView<Trackable<FigureElementNode>> {
|
|
20
20
|
private container;
|
|
21
|
+
private addFigureBtn;
|
|
21
22
|
ignoreMutation: () => boolean;
|
|
22
23
|
createElement: () => void;
|
|
24
|
+
private addFigureElementButtons;
|
|
25
|
+
private addFigure;
|
|
23
26
|
}
|
|
24
27
|
declare const _default: (props: import("../configs/ManuscriptsEditor").EditorProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<FigureElementView>;
|
|
25
28
|
export default _default;
|
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.87-LEAN-4591.0",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -122,6 +122,8 @@
|
|
|
122
122
|
text-indent: 0pt;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
/* Figures */
|
|
126
|
+
|
|
125
127
|
.ProseMirror .figure-block {
|
|
126
128
|
width: 100%;
|
|
127
129
|
border: 1px solid #f2f2f2;
|
|
@@ -132,6 +134,11 @@
|
|
|
132
134
|
|
|
133
135
|
grid-template-columns: repeat(3, auto) !important;
|
|
134
136
|
grid-template-rows: repeat(1, minmax(min-content, max-content)) [caption listing] auto !important;
|
|
137
|
+
|
|
138
|
+
margin: 16px 0 0;
|
|
139
|
+
box-sizing: border-box;
|
|
140
|
+
justify-self: center;
|
|
141
|
+
position: relative;
|
|
135
142
|
}
|
|
136
143
|
|
|
137
144
|
.ProseMirror .figure-group {
|
|
@@ -144,8 +151,140 @@
|
|
|
144
151
|
width: 100%;
|
|
145
152
|
position: relative;
|
|
146
153
|
grid-column: 1/-1;
|
|
154
|
+
margin: 0;
|
|
155
|
+
display: flex;
|
|
156
|
+
flex-direction: column;
|
|
157
|
+
justify-content: flex-end;
|
|
158
|
+
align-items: center;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.ProseMirror .figure-images-container .figure-image-container {
|
|
162
|
+
position: relative;
|
|
163
|
+
margin-bottom: 30px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.ProseMirror .block-figure_element .add-figure-button {
|
|
167
|
+
border: 0px;
|
|
168
|
+
left: 53px;
|
|
169
|
+
width: 25px;
|
|
170
|
+
z-index: 1;
|
|
171
|
+
height: 25px;
|
|
172
|
+
bottom: 220px;
|
|
173
|
+
cursor: pointer;
|
|
174
|
+
position: absolute;
|
|
175
|
+
border-radius: 50%;
|
|
176
|
+
background-color: #6E6E6E;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.ProseMirror .block-figure_element .add-figure-button.disabled {
|
|
180
|
+
background-color: #E2E2E2 !important;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.ProseMirror .block-figure_element .add-figure-button svg path {
|
|
184
|
+
fill: #FFFFFF !important;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
.ProseMirror .figure-block:hover .options-button {
|
|
189
|
+
visibility: visible;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.ProseMirror .block:focus-within .figure-block,
|
|
193
|
+
.ProseMirror .block:hover .figure-block {
|
|
194
|
+
border-color: #e2e2e2;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.ProseMirror .figure-block[data-alignment='left'] {
|
|
198
|
+
justify-self: flex-start;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.ProseMirror .figure-block[data-alignment='right'] {
|
|
202
|
+
justify-self: flex-end;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.ProseMirror .figure-block .expanded-listing .executable-attachments {
|
|
206
|
+
display: block;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.ProseMirror .figure-block > .listing {
|
|
210
|
+
grid-column-start: 1;
|
|
211
|
+
grid-column-end: -1;
|
|
212
|
+
padding: 0;
|
|
213
|
+
min-height: 0;
|
|
214
|
+
overflow: visible;
|
|
215
|
+
width: 100%;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.ProseMirror .figure-block figure {
|
|
219
|
+
padding-bottom: 20px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.ProseMirror .figure-block > figcaption {
|
|
223
|
+
grid-column-start: 1;
|
|
224
|
+
grid-column-end: -1;
|
|
225
|
+
margin-top: 30px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.ProseMirror .figure-caption {
|
|
229
|
+
display: none;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.ProseMirror .figure.placeholder {
|
|
233
|
+
align-items: center;
|
|
234
|
+
border-radius: 16px;
|
|
235
|
+
border: 1px dashed #e2e2e2;
|
|
236
|
+
background-color: #fafafa;
|
|
237
|
+
cursor: pointer;
|
|
238
|
+
display: flex;
|
|
239
|
+
justify-content: center;
|
|
240
|
+
text-align: center;
|
|
241
|
+
padding: 64px 32px;
|
|
242
|
+
max-width: 210px;
|
|
243
|
+
min-height: 100px;
|
|
244
|
+
white-space: normal;
|
|
245
|
+
font-size: 14px;
|
|
147
246
|
}
|
|
148
247
|
|
|
248
|
+
.ProseMirror .figure.placeholder a {
|
|
249
|
+
text-decoration: underline;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.ProseMirror .figure.placeholder.over {
|
|
253
|
+
border-color: #bce7f6;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.ProseMirror .figure-image {
|
|
257
|
+
max-width: 100%;
|
|
258
|
+
object-fit: contain;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.ProseMirror .figure-embed {
|
|
262
|
+
width: 640px;
|
|
263
|
+
max-width: 90%;
|
|
264
|
+
position: relative;
|
|
265
|
+
padding-top: 56.25%; /* Player ratio: 100 / (1280 / 720) */
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.ProseMirror .figure-embed .figure-embed-object {
|
|
269
|
+
position: absolute;
|
|
270
|
+
top: 0;
|
|
271
|
+
left: 0;
|
|
272
|
+
border: none;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.ProseMirror figcaption {
|
|
276
|
+
background: white;
|
|
277
|
+
font-size: 14px;
|
|
278
|
+
margin-top: 1em;
|
|
279
|
+
text-align: center;
|
|
280
|
+
word-wrap: break-word;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.ProseMirror .block-table_element figcaption {
|
|
284
|
+
text-align: left;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
|
|
149
288
|
.ProseMirror .figure-block > figcaption .figure-label {
|
|
150
289
|
display: initial !important;
|
|
151
290
|
}
|
|
@@ -683,6 +822,10 @@ span.comment-marker {
|
|
|
683
822
|
text-decoration: line-through;
|
|
684
823
|
}
|
|
685
824
|
|
|
825
|
+
.tracking-visible .ProseMirror figure.deleted {
|
|
826
|
+
display: flex;
|
|
827
|
+
}
|
|
828
|
+
|
|
686
829
|
.tracking-visible .ProseMirror .block.deleted {
|
|
687
830
|
display: block;
|
|
688
831
|
}
|
|
@@ -794,10 +937,18 @@ figure.block:has(.equation.selected-suggestion) {
|
|
|
794
937
|
.tracking-visible
|
|
795
938
|
.ProseMirror
|
|
796
939
|
[data-track-status='pending'][data-track-op='delete']
|
|
797
|
-
.block
|
|
940
|
+
.block, .tracking-visible
|
|
941
|
+
.ProseMirror .figure-block
|
|
942
|
+
figure[data-track-status='pending'].deleted img {
|
|
798
943
|
box-shadow: inset 3px 0 0 var(--deleted-color);
|
|
799
944
|
}
|
|
800
945
|
|
|
946
|
+
.tracking-visible
|
|
947
|
+
.ProseMirror .figure-block
|
|
948
|
+
figure[data-track-status='pending'].deleted img {
|
|
949
|
+
padding-left: 3px;
|
|
950
|
+
}
|
|
951
|
+
|
|
801
952
|
.selected-suggestion[data-track-status='pending'][data-track-op='delete']
|
|
802
953
|
.block,
|
|
803
954
|
.selected-suggestion[data-track-status='pending'][data-track-op='delete']
|
package/styles/Editor.css
CHANGED
|
@@ -277,120 +277,6 @@
|
|
|
277
277
|
background-color: #bce7f6;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
.ProseMirror .figure-block {
|
|
281
|
-
border: 1px solid transparent;
|
|
282
|
-
border-radius: 4px;
|
|
283
|
-
display: grid;
|
|
284
|
-
gap: 20px 40px;
|
|
285
|
-
margin: 16px 0 0;
|
|
286
|
-
box-sizing: border-box;
|
|
287
|
-
justify-self: center;
|
|
288
|
-
position: relative;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.ProseMirror .figure-block:hover .options-button {
|
|
292
|
-
visibility: visible;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.ProseMirror .block:focus-within .figure-block,
|
|
296
|
-
.ProseMirror .block:hover .figure-block {
|
|
297
|
-
border-color: #e2e2e2;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.ProseMirror .figure-block[data-alignment='left'] {
|
|
301
|
-
justify-self: flex-start;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
.ProseMirror .figure-block[data-alignment='right'] {
|
|
305
|
-
justify-self: flex-end;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.ProseMirror .figure-block .expanded-listing .executable-attachments {
|
|
309
|
-
display: block;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.ProseMirror .figure-block figure {
|
|
313
|
-
margin: 0;
|
|
314
|
-
display: flex;
|
|
315
|
-
flex-direction: column;
|
|
316
|
-
justify-content: flex-end;
|
|
317
|
-
align-items: center;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.ProseMirror .figure-block > .listing {
|
|
321
|
-
grid-column-start: 1;
|
|
322
|
-
grid-column-end: -1;
|
|
323
|
-
padding: 0;
|
|
324
|
-
min-height: 0;
|
|
325
|
-
overflow: visible;
|
|
326
|
-
width: 100%;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.ProseMirror .figure-block > figcaption {
|
|
330
|
-
grid-column-start: 1;
|
|
331
|
-
grid-column-end: -1;
|
|
332
|
-
margin-top: 0;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
.ProseMirror .figure-caption {
|
|
336
|
-
display: none;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.ProseMirror .figure.placeholder {
|
|
340
|
-
align-items: center;
|
|
341
|
-
border-radius: 16px;
|
|
342
|
-
border: 1px dashed #e2e2e2;
|
|
343
|
-
background-color: #fafafa;
|
|
344
|
-
cursor: pointer;
|
|
345
|
-
display: flex;
|
|
346
|
-
justify-content: center;
|
|
347
|
-
text-align: center;
|
|
348
|
-
padding: 64px 32px;
|
|
349
|
-
max-width: 210px;
|
|
350
|
-
min-height: 100px;
|
|
351
|
-
white-space: normal;
|
|
352
|
-
font-size: 14px;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.ProseMirror .figure.placeholder a {
|
|
356
|
-
text-decoration: underline;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.ProseMirror .figure.placeholder.over {
|
|
360
|
-
border-color: #bce7f6;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.ProseMirror .figure-image {
|
|
364
|
-
max-width: 100%;
|
|
365
|
-
object-fit: contain;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.ProseMirror .figure-embed {
|
|
369
|
-
width: 640px;
|
|
370
|
-
max-width: 90%;
|
|
371
|
-
position: relative;
|
|
372
|
-
padding-top: 56.25%; /* Player ratio: 100 / (1280 / 720) */
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
.ProseMirror .figure-embed .figure-embed-object {
|
|
376
|
-
position: absolute;
|
|
377
|
-
top: 0;
|
|
378
|
-
left: 0;
|
|
379
|
-
border: none;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
.ProseMirror figcaption {
|
|
383
|
-
background: white;
|
|
384
|
-
font-size: 14px;
|
|
385
|
-
margin-top: 1em;
|
|
386
|
-
text-align: center;
|
|
387
|
-
word-wrap: break-word;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
.ProseMirror .block-table_element figcaption {
|
|
391
|
-
text-align: left;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
280
|
.ProseMirror .block-table_element .block-gutter {
|
|
395
281
|
padding-top: 1em;
|
|
396
282
|
}
|