@manuscripts/body-editor 1.9.21 → 1.9.22-LEAN-2089.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/authors/AffiliationButton.js +1 -2
- package/dist/cjs/components/authors/AuthorAffiliations.js +2 -4
- package/dist/cjs/components/authors/AuthorFormPlaceholder.js +34 -20
- package/dist/cjs/components/authors/AuthorsModal.js +1 -2
- package/dist/cjs/components/authors/DraggableAuthor.js +2 -4
- package/dist/cjs/components/outline/DraggableTree.js +2 -1
- package/dist/cjs/components/outline/Outline.js +3 -8
- package/dist/cjs/components/references/CitationEditor.js +3 -2
- package/dist/cjs/components/references/ReferenceForm.js +5 -18
- package/dist/cjs/components/references/ReferenceSearch.js +1 -1
- package/dist/cjs/components/references/ReferenceSearchResults.js +1 -3
- package/dist/cjs/components/references/ReferenceSearchSection.js +11 -15
- package/dist/cjs/components/references/ReferencesModal.js +1 -2
- package/dist/cjs/components/references/SearchInput.js +3 -4
- package/dist/cjs/components/views/FigureDropdown.js +3 -6
- package/dist/cjs/node-type-icons.js +14 -25
- package/dist/cjs/toolbar.js +14 -13
- package/dist/cjs/views/figure_editable.js +1 -1
- package/dist/es/components/authors/AffiliationButton.js +2 -3
- package/dist/es/components/authors/AuthorAffiliations.js +2 -4
- package/dist/es/components/authors/AuthorFormPlaceholder.js +34 -20
- package/dist/es/components/authors/AuthorsModal.js +1 -2
- package/dist/es/components/authors/DraggableAuthor.js +3 -5
- package/dist/es/components/outline/DraggableTree.js +3 -2
- package/dist/es/components/outline/Outline.js +2 -7
- package/dist/es/components/references/CitationEditor.js +3 -2
- package/dist/es/components/references/ReferenceForm.js +6 -19
- package/dist/es/components/references/ReferenceSearch.js +2 -2
- package/dist/es/components/references/ReferenceSearchResults.js +1 -3
- package/dist/es/components/references/ReferenceSearchSection.js +10 -14
- package/dist/es/components/references/ReferencesModal.js +2 -3
- package/dist/es/components/references/SearchInput.js +4 -5
- package/dist/es/components/views/FigureDropdown.js +4 -7
- package/dist/es/node-type-icons.js +15 -26
- package/dist/es/toolbar.js +14 -13
- package/dist/es/views/figure_editable.js +2 -2
- package/dist/types/components/outline/Outline.d.ts +0 -3
- package/dist/types/components/references/ReferenceSearchSection.d.ts +0 -1
- package/package.json +2 -2
- package/dist/cjs/components/track-changes/TrackChangesReview.js +0 -105
- package/dist/cjs/icons.js +0 -53
- package/dist/es/components/track-changes/TrackChangesReview.js +0 -75
- package/dist/es/icons.js +0 -48
- package/dist/types/components/track-changes/TrackChangesReview.d.ts +0 -25
- package/dist/types/icons.d.ts +0 -34
|
@@ -13,36 +13,25 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
17
|
-
import EquationIcon from '@manuscripts/assets/react/OutlineIconEquation';
|
|
18
|
-
import FigureIcon from '@manuscripts/assets/react/OutlineIconFigure';
|
|
19
|
-
import ManuscriptIcon from '@manuscripts/assets/react/OutlineIconManuscript';
|
|
20
|
-
import OrderedListIcon from '@manuscripts/assets/react/OutlineIconOrderedList';
|
|
21
|
-
import ParagraphIcon from '@manuscripts/assets/react/OutlineIconParagraph';
|
|
22
|
-
import SectionIcon from '@manuscripts/assets/react/OutlineIconSection';
|
|
23
|
-
import TableIcon from '@manuscripts/assets/react/OutlineIconTable';
|
|
24
|
-
import BulletListIcon from '@manuscripts/assets/react/OutlineIconUnorderedList';
|
|
25
|
-
import { BlockQuoteIcon, PullQuoteIcon } from '@manuscripts/style-guide';
|
|
16
|
+
import { OutlineBlockQuoteIcon, OutlineEquationIcon, OutlineFigureIcon, OutlineManuscriptIcon, OutlineOrderedListIcon, OutlineParagraphIcon, OutlinePullQuoteIcon, OutlineSectionIcon, OutlineTableIcon, OutlineUnorderedListIcon, } from '@manuscripts/style-guide';
|
|
26
17
|
import { schema } from '@manuscripts/transform';
|
|
27
18
|
import React from 'react';
|
|
28
19
|
const { nodes } = schema;
|
|
29
20
|
const icons = new Map([
|
|
30
|
-
[nodes.manuscript,
|
|
31
|
-
[nodes.bibliography_section,
|
|
32
|
-
[nodes.blockquote_element,
|
|
33
|
-
[nodes.bullet_list,
|
|
34
|
-
[nodes.equation_element,
|
|
35
|
-
[nodes.figure_element,
|
|
36
|
-
[nodes.
|
|
37
|
-
[nodes.
|
|
38
|
-
[nodes.
|
|
39
|
-
[nodes.
|
|
40
|
-
[nodes.
|
|
41
|
-
[nodes.
|
|
42
|
-
[nodes.
|
|
43
|
-
[nodes.
|
|
44
|
-
[nodes.graphical_abstract_section, SectionIcon],
|
|
45
|
-
[nodes.footnotes_section, SectionIcon],
|
|
21
|
+
[nodes.manuscript, OutlineManuscriptIcon],
|
|
22
|
+
[nodes.bibliography_section, OutlineSectionIcon],
|
|
23
|
+
[nodes.blockquote_element, OutlineBlockQuoteIcon],
|
|
24
|
+
[nodes.bullet_list, OutlineUnorderedListIcon],
|
|
25
|
+
[nodes.equation_element, OutlineEquationIcon],
|
|
26
|
+
[nodes.figure_element, OutlineFigureIcon],
|
|
27
|
+
[nodes.ordered_list, OutlineOrderedListIcon],
|
|
28
|
+
[nodes.paragraph, OutlineParagraphIcon],
|
|
29
|
+
[nodes.pullquote_element, OutlinePullQuoteIcon],
|
|
30
|
+
[nodes.section, OutlineSectionIcon],
|
|
31
|
+
[nodes.table_element, OutlineTableIcon],
|
|
32
|
+
[nodes.toc_section, OutlineSectionIcon],
|
|
33
|
+
[nodes.graphical_abstract_section, OutlineSectionIcon],
|
|
34
|
+
[nodes.footnotes_section, OutlineSectionIcon],
|
|
46
35
|
]);
|
|
47
36
|
export const nodeTypeIcon = (nodeType) => {
|
|
48
37
|
const Icon = icons.get(nodeType);
|
package/dist/es/toolbar.js
CHANGED
|
@@ -13,29 +13,30 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { AddCommentIcon, ToolbarBoldIcon, ToolbarCitationIcon, ToolbarEquationIcon, ToolbarFigureIcon, ToolbarItalicIcon, ToolbarOrderedListIcon, ToolbarSubscriptIcon, ToolbarSuperscriptIcon, ToolbarTableIcon, ToolbarUnderlineIcon, ToolbarUnorderedListIcon, } from '@manuscripts/style-guide';
|
|
16
17
|
import { schema } from '@manuscripts/transform';
|
|
17
18
|
import { toggleMark } from 'prosemirror-commands';
|
|
19
|
+
import React from 'react';
|
|
18
20
|
import { addComment, blockActive, canInsert, insertBlock, insertInlineCitation, insertList, markActive, } from './commands';
|
|
19
|
-
import icons from './icons';
|
|
20
21
|
export const toolbar = {
|
|
21
22
|
style: {
|
|
22
23
|
bold: {
|
|
23
24
|
title: 'Toggle bold',
|
|
24
|
-
content:
|
|
25
|
+
content: React.createElement(ToolbarBoldIcon, null),
|
|
25
26
|
isActive: markActive(schema.marks.bold),
|
|
26
27
|
isEnabled: toggleMark(schema.marks.bold),
|
|
27
28
|
run: toggleMark(schema.marks.bold),
|
|
28
29
|
},
|
|
29
30
|
italic: {
|
|
30
31
|
title: 'Toggle italic',
|
|
31
|
-
content:
|
|
32
|
+
content: React.createElement(ToolbarItalicIcon, null),
|
|
32
33
|
isActive: markActive(schema.marks.italic),
|
|
33
34
|
isEnabled: toggleMark(schema.marks.italic),
|
|
34
35
|
run: toggleMark(schema.marks.italic),
|
|
35
36
|
},
|
|
36
37
|
underline: {
|
|
37
38
|
title: 'Toggle underline',
|
|
38
|
-
content:
|
|
39
|
+
content: React.createElement(ToolbarUnderlineIcon, null),
|
|
39
40
|
isActive: markActive(schema.marks.underline),
|
|
40
41
|
isEnabled: toggleMark(schema.marks.underline),
|
|
41
42
|
run: toggleMark(schema.marks.underline),
|
|
@@ -44,14 +45,14 @@ export const toolbar = {
|
|
|
44
45
|
vertical: {
|
|
45
46
|
subscript: {
|
|
46
47
|
title: 'Toggle subscript',
|
|
47
|
-
content:
|
|
48
|
+
content: React.createElement(ToolbarSubscriptIcon, null),
|
|
48
49
|
isActive: markActive(schema.marks.subscript),
|
|
49
50
|
isEnabled: toggleMark(schema.marks.subscript),
|
|
50
51
|
run: toggleMark(schema.marks.subscript),
|
|
51
52
|
},
|
|
52
53
|
superscript: {
|
|
53
54
|
title: 'Toggle superscript',
|
|
54
|
-
content:
|
|
55
|
+
content: React.createElement(ToolbarSuperscriptIcon, null),
|
|
55
56
|
isActive: markActive(schema.marks.superscript),
|
|
56
57
|
isEnabled: toggleMark(schema.marks.superscript),
|
|
57
58
|
run: toggleMark(schema.marks.superscript),
|
|
@@ -60,7 +61,7 @@ export const toolbar = {
|
|
|
60
61
|
list: {
|
|
61
62
|
bullet_list: {
|
|
62
63
|
title: 'Wrap in bullet list',
|
|
63
|
-
content:
|
|
64
|
+
content: React.createElement(ToolbarUnorderedListIcon, null),
|
|
64
65
|
isActive: blockActive(schema.nodes.bullet_list),
|
|
65
66
|
isEnabled: insertList(schema.nodes.bullet_list, 'bullet'),
|
|
66
67
|
run: insertList(schema.nodes.bullet_list, 'bullet'),
|
|
@@ -71,7 +72,7 @@ export const toolbar = {
|
|
|
71
72
|
},
|
|
72
73
|
ordered_list: {
|
|
73
74
|
title: 'Wrap in ordered list',
|
|
74
|
-
content:
|
|
75
|
+
content: React.createElement(ToolbarOrderedListIcon, null),
|
|
75
76
|
isActive: blockActive(schema.nodes.ordered_list),
|
|
76
77
|
isEnabled: insertList(schema.nodes.ordered_list, 'order'),
|
|
77
78
|
run: insertList(schema.nodes.ordered_list, 'order'),
|
|
@@ -87,13 +88,13 @@ export const toolbar = {
|
|
|
87
88
|
inline: {
|
|
88
89
|
citation: {
|
|
89
90
|
title: 'Insert citation',
|
|
90
|
-
content:
|
|
91
|
+
content: React.createElement(ToolbarCitationIcon, null),
|
|
91
92
|
isEnabled: canInsert(schema.nodes.citation),
|
|
92
93
|
run: insertInlineCitation,
|
|
93
94
|
},
|
|
94
95
|
comment: {
|
|
95
96
|
title: 'Insert comment',
|
|
96
|
-
content:
|
|
97
|
+
content: React.createElement(AddCommentIcon, null),
|
|
97
98
|
isEnabled: canInsert(schema.nodes.highlight_marker),
|
|
98
99
|
run: addComment,
|
|
99
100
|
},
|
|
@@ -101,19 +102,19 @@ export const toolbar = {
|
|
|
101
102
|
element: {
|
|
102
103
|
figure_element: {
|
|
103
104
|
title: 'Insert figure',
|
|
104
|
-
content:
|
|
105
|
+
content: React.createElement(ToolbarFigureIcon, null),
|
|
105
106
|
isEnabled: canInsert(schema.nodes.figure_element),
|
|
106
107
|
run: insertBlock(schema.nodes.figure_element),
|
|
107
108
|
},
|
|
108
109
|
table_element: {
|
|
109
110
|
title: 'Insert table',
|
|
110
|
-
content:
|
|
111
|
+
content: React.createElement(ToolbarTableIcon, null),
|
|
111
112
|
isEnabled: canInsert(schema.nodes.table_element),
|
|
112
113
|
run: insertBlock(schema.nodes.table_element),
|
|
113
114
|
},
|
|
114
115
|
equation_element: {
|
|
115
116
|
title: 'Insert equation',
|
|
116
|
-
content:
|
|
117
|
+
content: React.createElement(ToolbarEquationIcon, null),
|
|
117
118
|
isEnabled: canInsert(schema.nodes.equation_element),
|
|
118
119
|
run: insertBlock(schema.nodes.equation_element),
|
|
119
120
|
},
|
|
@@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
import {
|
|
25
|
+
import { FileCorruptedIcon, } from '@manuscripts/style-guide';
|
|
26
26
|
import { createElement } from 'react';
|
|
27
27
|
import ReactDOM from 'react-dom';
|
|
28
28
|
import { FigureOptions, } from '../components/views/FigureDropdown';
|
|
@@ -151,7 +151,7 @@ export class FigureEditableView extends FigureView {
|
|
|
151
151
|
const instructions = document.createElement('div');
|
|
152
152
|
instructions.classList.add('instructions');
|
|
153
153
|
const iconContainer = document.createElement('div');
|
|
154
|
-
ReactDOM.render(createElement(
|
|
154
|
+
ReactDOM.render(createElement(FileCorruptedIcon, { className: 'icon' }), iconContainer, () => {
|
|
155
155
|
const target = instructions.querySelector('.unsupported-icon-wrapper');
|
|
156
156
|
if (target) {
|
|
157
157
|
target.innerHTML = iconContainer.innerHTML;
|
|
@@ -13,14 +13,11 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
/// <reference types="react" />
|
|
17
16
|
import { Link } from 'react-router-dom';
|
|
18
17
|
export declare const OutlineItemIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
19
18
|
export declare const OutlineItem: import("styled-components").StyledComponent<"div", any, {
|
|
20
19
|
depth: number;
|
|
21
20
|
}, never>;
|
|
22
|
-
export declare const StyledTriangleCollapsed: import("styled-components").StyledComponent<import("react").SFC<import("react").SVGAttributes<SVGElement>>, any, {}, never>;
|
|
23
|
-
export declare const StyledTriangleExpanded: import("styled-components").StyledComponent<import("react").SFC<import("react").SVGAttributes<SVGElement>>, any, {}, never>;
|
|
24
21
|
export declare const OutlineItemArrow: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
25
22
|
export declare const OutlineItemNoArrow: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
26
23
|
export declare const OutlineItemLink: import("styled-components").StyledComponent<typeof Link, any, {}, never>;
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
import React from 'react';
|
|
17
17
|
import { BibliographyItemAttrs } from '../../lib/references';
|
|
18
18
|
import { BibliographyItemSource } from './BibliographyItemSource';
|
|
19
|
-
export declare const Arrow: import("styled-components").StyledComponent<React.SFC<React.SVGAttributes<SVGElement>>, any, {}, never>;
|
|
20
19
|
export declare const ReferenceSearchSection: React.FC<{
|
|
21
20
|
query: string;
|
|
22
21
|
source: BibliographyItemSource;
|
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": "1.9.
|
|
4
|
+
"version": "1.9.22-LEAN-2089.0",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@manuscripts/assets": "^0.6.4",
|
|
32
32
|
"@manuscripts/json-schema": "^2.2.7",
|
|
33
33
|
"@manuscripts/library": "^1.3.6",
|
|
34
|
-
"@manuscripts/style-guide": "1.12.
|
|
34
|
+
"@manuscripts/style-guide": "1.12.7-LEAN-2089.0",
|
|
35
35
|
"@manuscripts/track-changes-plugin": "1.7.11",
|
|
36
36
|
"@manuscripts/transform": "2.3.3",
|
|
37
37
|
"astrocite-eutils": "^0.16.4",
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2022 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.TrackChangesReview = void 0;
|
|
45
|
-
const TrackChangesReviewIcon_1 = __importDefault(require("@manuscripts/assets/react/TrackChangesReviewIcon"));
|
|
46
|
-
const react_1 = __importStar(require("react"));
|
|
47
|
-
const react_dom_1 = __importDefault(require("react-dom"));
|
|
48
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
49
|
-
const TitleStyled = styled_components_1.default.div `
|
|
50
|
-
padding: 16px;
|
|
51
|
-
font-size: 16px;
|
|
52
|
-
border-bottom: 1px solid #ededed;
|
|
53
|
-
`;
|
|
54
|
-
const ChangesStyled = styled_components_1.default.div `
|
|
55
|
-
padding: 16px;
|
|
56
|
-
font-size: 12px;
|
|
57
|
-
`;
|
|
58
|
-
const TrackChangesItems = () => {
|
|
59
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
60
|
-
react_1.default.createElement(TitleStyled, null, "Changes"),
|
|
61
|
-
react_1.default.createElement(ChangesStyled, null,
|
|
62
|
-
react_1.default.createElement("div", null, "TO BE IMPLEMENTED:"),
|
|
63
|
-
react_1.default.createElement("div", null, "CITTC-110 - LEAN-2843"))));
|
|
64
|
-
};
|
|
65
|
-
const TrackChangesReview = ({ node, popper, target, }) => {
|
|
66
|
-
const [isPopperOpen, setIsPopperOpen] = (0, react_1.useState)(false);
|
|
67
|
-
const addPopperEventListeners = () => {
|
|
68
|
-
const mouseListener = (event) => {
|
|
69
|
-
window.requestAnimationFrame(() => {
|
|
70
|
-
window.removeEventListener('mousedown', mouseListener);
|
|
71
|
-
window.removeEventListener('keydown', keyListener);
|
|
72
|
-
popper.destroy();
|
|
73
|
-
setIsPopperOpen(false);
|
|
74
|
-
event.stopPropagation();
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
const keyListener = (event) => {
|
|
78
|
-
if (event.key === 'Escape') {
|
|
79
|
-
window.removeEventListener('keydown', keyListener);
|
|
80
|
-
window.removeEventListener('mousedown', mouseListener);
|
|
81
|
-
popper.destroy();
|
|
82
|
-
setIsPopperOpen(false);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
window.addEventListener('mousedown', mouseListener);
|
|
86
|
-
window.addEventListener('keydown', keyListener);
|
|
87
|
-
};
|
|
88
|
-
const handleClick = (e) => {
|
|
89
|
-
if (!isPopperOpen) {
|
|
90
|
-
const popperContainer = document.createElement('div');
|
|
91
|
-
popperContainer.classList.add('track-changes-review-panel');
|
|
92
|
-
react_dom_1.default.render((0, react_1.createElement)(TrackChangesItems, {
|
|
93
|
-
node,
|
|
94
|
-
}), popperContainer);
|
|
95
|
-
popper.show(target, popperContainer, 'top-end');
|
|
96
|
-
addPopperEventListeners();
|
|
97
|
-
setIsPopperOpen(true);
|
|
98
|
-
e.stopPropagation();
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
return (react_1.default.createElement(TrackChangesReviewIcon_1.default, { width: 36, height: 36, onMouseDown: (e) => {
|
|
102
|
-
handleClick(e);
|
|
103
|
-
} }));
|
|
104
|
-
};
|
|
105
|
-
exports.TrackChangesReview = TrackChangesReview;
|
package/dist/cjs/icons.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
const ToolbarIconBold_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconBold"));
|
|
22
|
-
const ToolbarIconCitation_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconCitation"));
|
|
23
|
-
const ToolbarIconCodeSnippet_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconCodeSnippet"));
|
|
24
|
-
const ToolbarIconEquation_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconEquation"));
|
|
25
|
-
const ToolbarIconFigure_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconFigure"));
|
|
26
|
-
const ToolbarIconInlineMath_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconInlineMath"));
|
|
27
|
-
const ToolbarIconItalic_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconItalic"));
|
|
28
|
-
const ToolbarIconOrderedList_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconOrderedList"));
|
|
29
|
-
const ToolbarIconSubscript_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconSubscript"));
|
|
30
|
-
const ToolbarIconSuperscript_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconSuperscript"));
|
|
31
|
-
const ToolbarIconSymbol_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconSymbol"));
|
|
32
|
-
const ToolbarIconTable_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconTable"));
|
|
33
|
-
const ToolbarIconUnderline_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconUnderline"));
|
|
34
|
-
const ToolbarIconUnorderedList_1 = __importDefault(require("@manuscripts/assets/react/ToolbarIconUnorderedList"));
|
|
35
|
-
const style_guide_1 = require("@manuscripts/style-guide");
|
|
36
|
-
const react_1 = __importDefault(require("react"));
|
|
37
|
-
exports.default = {
|
|
38
|
-
italic: react_1.default.createElement(ToolbarIconItalic_1.default, null),
|
|
39
|
-
bold: react_1.default.createElement(ToolbarIconBold_1.default, null),
|
|
40
|
-
subscript: react_1.default.createElement(ToolbarIconSubscript_1.default, null),
|
|
41
|
-
superscript: react_1.default.createElement(ToolbarIconSuperscript_1.default, null),
|
|
42
|
-
underline: react_1.default.createElement(ToolbarIconUnderline_1.default, null),
|
|
43
|
-
ordered_list: react_1.default.createElement(ToolbarIconOrderedList_1.default, null),
|
|
44
|
-
bullet_list: react_1.default.createElement(ToolbarIconUnorderedList_1.default, null),
|
|
45
|
-
figure_element: react_1.default.createElement(ToolbarIconFigure_1.default, null),
|
|
46
|
-
table_element: react_1.default.createElement(ToolbarIconTable_1.default, null),
|
|
47
|
-
citation: react_1.default.createElement(ToolbarIconCitation_1.default, null),
|
|
48
|
-
inline_equation: react_1.default.createElement(ToolbarIconInlineMath_1.default, null),
|
|
49
|
-
equation_element: react_1.default.createElement(ToolbarIconEquation_1.default, null),
|
|
50
|
-
listing_element: react_1.default.createElement(ToolbarIconCodeSnippet_1.default, null),
|
|
51
|
-
symbol: react_1.default.createElement(ToolbarIconSymbol_1.default, null),
|
|
52
|
-
highlight: react_1.default.createElement(style_guide_1.AddComment, null),
|
|
53
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2022 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 TrackChangesReviewIcon from '@manuscripts/assets/react/TrackChangesReviewIcon';
|
|
17
|
-
import React, { createElement, useState } from 'react';
|
|
18
|
-
import ReactDOM from 'react-dom';
|
|
19
|
-
import styled from 'styled-components';
|
|
20
|
-
const TitleStyled = styled.div `
|
|
21
|
-
padding: 16px;
|
|
22
|
-
font-size: 16px;
|
|
23
|
-
border-bottom: 1px solid #ededed;
|
|
24
|
-
`;
|
|
25
|
-
const ChangesStyled = styled.div `
|
|
26
|
-
padding: 16px;
|
|
27
|
-
font-size: 12px;
|
|
28
|
-
`;
|
|
29
|
-
const TrackChangesItems = () => {
|
|
30
|
-
return (React.createElement(React.Fragment, null,
|
|
31
|
-
React.createElement(TitleStyled, null, "Changes"),
|
|
32
|
-
React.createElement(ChangesStyled, null,
|
|
33
|
-
React.createElement("div", null, "TO BE IMPLEMENTED:"),
|
|
34
|
-
React.createElement("div", null, "CITTC-110 - LEAN-2843"))));
|
|
35
|
-
};
|
|
36
|
-
export const TrackChangesReview = ({ node, popper, target, }) => {
|
|
37
|
-
const [isPopperOpen, setIsPopperOpen] = useState(false);
|
|
38
|
-
const addPopperEventListeners = () => {
|
|
39
|
-
const mouseListener = (event) => {
|
|
40
|
-
window.requestAnimationFrame(() => {
|
|
41
|
-
window.removeEventListener('mousedown', mouseListener);
|
|
42
|
-
window.removeEventListener('keydown', keyListener);
|
|
43
|
-
popper.destroy();
|
|
44
|
-
setIsPopperOpen(false);
|
|
45
|
-
event.stopPropagation();
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
const keyListener = (event) => {
|
|
49
|
-
if (event.key === 'Escape') {
|
|
50
|
-
window.removeEventListener('keydown', keyListener);
|
|
51
|
-
window.removeEventListener('mousedown', mouseListener);
|
|
52
|
-
popper.destroy();
|
|
53
|
-
setIsPopperOpen(false);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
window.addEventListener('mousedown', mouseListener);
|
|
57
|
-
window.addEventListener('keydown', keyListener);
|
|
58
|
-
};
|
|
59
|
-
const handleClick = (e) => {
|
|
60
|
-
if (!isPopperOpen) {
|
|
61
|
-
const popperContainer = document.createElement('div');
|
|
62
|
-
popperContainer.classList.add('track-changes-review-panel');
|
|
63
|
-
ReactDOM.render(createElement(TrackChangesItems, {
|
|
64
|
-
node,
|
|
65
|
-
}), popperContainer);
|
|
66
|
-
popper.show(target, popperContainer, 'top-end');
|
|
67
|
-
addPopperEventListeners();
|
|
68
|
-
setIsPopperOpen(true);
|
|
69
|
-
e.stopPropagation();
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
return (React.createElement(TrackChangesReviewIcon, { width: 36, height: 36, onMouseDown: (e) => {
|
|
73
|
-
handleClick(e);
|
|
74
|
-
} }));
|
|
75
|
-
};
|
package/dist/es/icons.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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 Bold from '@manuscripts/assets/react/ToolbarIconBold';
|
|
17
|
-
import Citation from '@manuscripts/assets/react/ToolbarIconCitation';
|
|
18
|
-
import CodeSnippet from '@manuscripts/assets/react/ToolbarIconCodeSnippet';
|
|
19
|
-
import Equation from '@manuscripts/assets/react/ToolbarIconEquation';
|
|
20
|
-
import Figure from '@manuscripts/assets/react/ToolbarIconFigure';
|
|
21
|
-
import InlineMath from '@manuscripts/assets/react/ToolbarIconInlineMath';
|
|
22
|
-
import Italic from '@manuscripts/assets/react/ToolbarIconItalic';
|
|
23
|
-
import OrderedList from '@manuscripts/assets/react/ToolbarIconOrderedList';
|
|
24
|
-
import Subscript from '@manuscripts/assets/react/ToolbarIconSubscript';
|
|
25
|
-
import Superscript from '@manuscripts/assets/react/ToolbarIconSuperscript';
|
|
26
|
-
import Symbol from '@manuscripts/assets/react/ToolbarIconSymbol';
|
|
27
|
-
import Table from '@manuscripts/assets/react/ToolbarIconTable';
|
|
28
|
-
import Underline from '@manuscripts/assets/react/ToolbarIconUnderline';
|
|
29
|
-
import UnorderedList from '@manuscripts/assets/react/ToolbarIconUnorderedList';
|
|
30
|
-
import { AddComment } from '@manuscripts/style-guide';
|
|
31
|
-
import React from 'react';
|
|
32
|
-
export default {
|
|
33
|
-
italic: React.createElement(Italic, null),
|
|
34
|
-
bold: React.createElement(Bold, null),
|
|
35
|
-
subscript: React.createElement(Subscript, null),
|
|
36
|
-
superscript: React.createElement(Superscript, null),
|
|
37
|
-
underline: React.createElement(Underline, null),
|
|
38
|
-
ordered_list: React.createElement(OrderedList, null),
|
|
39
|
-
bullet_list: React.createElement(UnorderedList, null),
|
|
40
|
-
figure_element: React.createElement(Figure, null),
|
|
41
|
-
table_element: React.createElement(Table, null),
|
|
42
|
-
citation: React.createElement(Citation, null),
|
|
43
|
-
inline_equation: React.createElement(InlineMath, null),
|
|
44
|
-
equation_element: React.createElement(Equation, null),
|
|
45
|
-
listing_element: React.createElement(CodeSnippet, null),
|
|
46
|
-
symbol: React.createElement(Symbol, null),
|
|
47
|
-
highlight: React.createElement(AddComment, null),
|
|
48
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2022 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 { ManuscriptNode } from '@manuscripts/transform';
|
|
17
|
-
import React from 'react';
|
|
18
|
-
import { PopperManager } from '../../lib/popper';
|
|
19
|
-
interface TCReviewProps {
|
|
20
|
-
node: ManuscriptNode;
|
|
21
|
-
popper: PopperManager;
|
|
22
|
-
target: HTMLSpanElement;
|
|
23
|
-
}
|
|
24
|
-
export declare const TrackChangesReview: React.FC<TCReviewProps>;
|
|
25
|
-
export {};
|
package/dist/types/icons.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
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 React from 'react';
|
|
17
|
-
declare const _default: {
|
|
18
|
-
italic: React.JSX.Element;
|
|
19
|
-
bold: React.JSX.Element;
|
|
20
|
-
subscript: React.JSX.Element;
|
|
21
|
-
superscript: React.JSX.Element;
|
|
22
|
-
underline: React.JSX.Element;
|
|
23
|
-
ordered_list: React.JSX.Element;
|
|
24
|
-
bullet_list: React.JSX.Element;
|
|
25
|
-
figure_element: React.JSX.Element;
|
|
26
|
-
table_element: React.JSX.Element;
|
|
27
|
-
citation: React.JSX.Element;
|
|
28
|
-
inline_equation: React.JSX.Element;
|
|
29
|
-
equation_element: React.JSX.Element;
|
|
30
|
-
listing_element: React.JSX.Element;
|
|
31
|
-
symbol: React.JSX.Element;
|
|
32
|
-
highlight: React.JSX.Element;
|
|
33
|
-
};
|
|
34
|
-
export default _default;
|