@manuscripts/body-editor 3.4.1 → 3.4.4
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 +2 -1
- package/dist/cjs/components/LanguageDropdown/index.js +215 -0
- package/dist/cjs/components/LanguageDropdown/languages.js +134 -0
- package/dist/cjs/configs/editor-views.js +4 -1
- package/dist/cjs/icons.js +3 -2
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/abstracts.js +82 -0
- package/dist/cjs/views/figure_element.js +2 -2
- package/dist/cjs/views/section_title.js +3 -0
- package/dist/cjs/views/translated_abstract.js +117 -0
- package/dist/cjs/views/translated_abstract_editable.js +21 -0
- package/dist/es/commands.js +2 -1
- package/dist/es/components/LanguageDropdown/index.js +177 -0
- package/dist/es/components/LanguageDropdown/languages.js +90 -0
- package/dist/es/configs/editor-views.js +4 -1
- package/dist/es/icons.js +3 -2
- package/dist/es/index.js +1 -0
- package/dist/es/versions.js +1 -1
- package/dist/es/views/abstracts.js +78 -0
- package/dist/es/views/figure_element.js +3 -3
- package/dist/es/views/section_title.js +3 -0
- package/dist/es/views/translated_abstract.js +110 -0
- package/dist/es/views/translated_abstract_editable.js +19 -0
- package/dist/types/components/LanguageDropdown/index.d.ts +27 -0
- package/dist/types/components/LanguageDropdown/languages.d.ts +22 -0
- package/dist/types/icons.d.ts +2 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/versions.d.ts +1 -1
- package/dist/types/views/abstracts.d.ts +28 -0
- package/dist/types/views/translated_abstract.d.ts +38 -0
- package/dist/types/views/translated_abstract_editable.d.ts +44 -0
- package/package.json +3 -2
- package/styles/AdvancedEditor.css +88 -21
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.4.
|
|
1
|
+
export declare const VERSION = "3.4.4";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { ManuscriptNode } from '@manuscripts/transform';
|
|
17
|
+
import { BaseNodeView } from './base_node_view';
|
|
18
|
+
export declare class AbstractsView extends BaseNodeView<ManuscriptNode> {
|
|
19
|
+
elementType: string;
|
|
20
|
+
initialise(): void;
|
|
21
|
+
createDOM(): void;
|
|
22
|
+
createElement(): void;
|
|
23
|
+
private addTranslationBtn;
|
|
24
|
+
private addTranslation;
|
|
25
|
+
updateContents(): void;
|
|
26
|
+
}
|
|
27
|
+
declare const _default: (props: import("../configs/ManuscriptsEditor").EditorProps, dispatch?: import("..").Dispatch) => import("../types").NodeViewCreator<AbstractsView>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { TransAbstractNode } from '@manuscripts/transform';
|
|
17
|
+
import { Trackable } from '../types';
|
|
18
|
+
import BlockView from './block_view';
|
|
19
|
+
export declare class TransAbstractView extends BlockView<Trackable<TransAbstractNode>> {
|
|
20
|
+
elementType: string;
|
|
21
|
+
private languageButton;
|
|
22
|
+
createDOM(): void;
|
|
23
|
+
createElement(): void;
|
|
24
|
+
updateContents(): void;
|
|
25
|
+
destroy(): void;
|
|
26
|
+
private updateLanguageAttributes;
|
|
27
|
+
private handleLanguageSelector;
|
|
28
|
+
private createLanguageButton;
|
|
29
|
+
private cleanupLanguageButton;
|
|
30
|
+
private updateButtonContent;
|
|
31
|
+
private handleButtonClick;
|
|
32
|
+
private showLanguageDropdown;
|
|
33
|
+
private createDropdownContainer;
|
|
34
|
+
private handleLanguageChange;
|
|
35
|
+
private updateNodeLanguage;
|
|
36
|
+
}
|
|
37
|
+
declare const _default: (props: import("../configs/ManuscriptsEditor").EditorProps, dispatch?: import("..").Dispatch) => import("../types").NodeViewCreator<TransAbstractView>;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { TransAbstractView } from './translated_abstract';
|
|
17
|
+
declare const _default: (props: import("../configs/ManuscriptsEditor").EditorProps, dispatch?: import("..").Dispatch) => import("../types").NodeViewCreator<{
|
|
18
|
+
gutterButtons(): HTMLElement[];
|
|
19
|
+
actionGutterButtons(): never[];
|
|
20
|
+
createAddButton(): HTMLAnchorElement | null;
|
|
21
|
+
createEditButton(): HTMLElement | null;
|
|
22
|
+
createMenu: () => import("../lib/context-menu").ContextMenu;
|
|
23
|
+
initialise(): void;
|
|
24
|
+
updateContents(): void;
|
|
25
|
+
handleTrackChanges(): void;
|
|
26
|
+
updateClasses(): void;
|
|
27
|
+
updatePlaceholder(): void;
|
|
28
|
+
createElement(): void;
|
|
29
|
+
createDOM(): void;
|
|
30
|
+
gutter: Record<string, HTMLElement>;
|
|
31
|
+
createGutter(className: string, buttons: HTMLElement[]): void;
|
|
32
|
+
dom: HTMLElement;
|
|
33
|
+
contentDOM?: HTMLElement;
|
|
34
|
+
elementType: string;
|
|
35
|
+
readonly props: import("../configs/ManuscriptsEditor").EditorProps;
|
|
36
|
+
node: import("prosemirror-model").Node;
|
|
37
|
+
readonly view: import("@manuscripts/transform").ManuscriptEditorView;
|
|
38
|
+
readonly getPos: () => number;
|
|
39
|
+
update(newNode: import("@manuscripts/transform").ManuscriptNode): boolean;
|
|
40
|
+
selectNode(): void;
|
|
41
|
+
deselectNode(): void;
|
|
42
|
+
destroy(): void;
|
|
43
|
+
} & TransAbstractView>;
|
|
44
|
+
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": "3.4.
|
|
4
|
+
"version": "3.4.4",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -36,9 +36,10 @@
|
|
|
36
36
|
"@citation-js/plugin-enw": "0.3.0",
|
|
37
37
|
"@citation-js/plugin-pubmed": "0.3.0",
|
|
38
38
|
"@citation-js/plugin-ris": "0.7.18",
|
|
39
|
+
"@cospired/i18n-iso-languages": "^4.2.0",
|
|
39
40
|
"@iarna/word-count": "1.1.2",
|
|
40
41
|
"@manuscripts/json-schema": "2.2.12",
|
|
41
|
-
"@manuscripts/style-guide": "3.2.
|
|
42
|
+
"@manuscripts/style-guide": "3.2.3",
|
|
42
43
|
"@manuscripts/track-changes-plugin": "2.0.10",
|
|
43
44
|
"@manuscripts/transform": "4.2.13",
|
|
44
45
|
"@popperjs/core": "2.11.8",
|
|
@@ -184,24 +184,12 @@
|
|
|
184
184
|
margin-bottom: 30px;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
.ProseMirror .block-figure_element .add-
|
|
187
|
+
.ProseMirror .block-figure_element .add-button {
|
|
188
188
|
border: 0px;
|
|
189
189
|
left: 53px;
|
|
190
190
|
width: 25px;
|
|
191
|
-
z-index: 1;
|
|
192
191
|
height: 25px;
|
|
193
|
-
cursor: pointer;
|
|
194
192
|
position: absolute;
|
|
195
|
-
border-radius: 50%;
|
|
196
|
-
background-color: #6e6e6e;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.ProseMirror .block-figure_element .add-figure-button.disabled {
|
|
200
|
-
background-color: #e2e2e2 !important;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.ProseMirror .block-figure_element .add-figure-button svg path {
|
|
204
|
-
fill: #ffffff !important;
|
|
205
193
|
}
|
|
206
194
|
|
|
207
195
|
.ProseMirror .figure-block:hover .options-button {
|
|
@@ -993,7 +981,7 @@ figure .selected-suggestion {
|
|
|
993
981
|
background-color: transparent !important;
|
|
994
982
|
}
|
|
995
983
|
|
|
996
|
-
.selected-suggestion[data-track-status='pending'] .block:not(.box-element),
|
|
984
|
+
.selected-suggestion[data-track-status='pending'] .block:not(.box-element):not(.trans-abstract),
|
|
997
985
|
.block:has(figure.selected-suggestion),
|
|
998
986
|
figure.block:has(.equation.selected-suggestion) {
|
|
999
987
|
box-shadow: inset 6px 0 0 black, inset 9px 0 0 lightgray;
|
|
@@ -1004,7 +992,7 @@ figure.block:has(.equation.selected-suggestion) {
|
|
|
1004
992
|
.tracking-visible
|
|
1005
993
|
.ProseMirror
|
|
1006
994
|
[data-track-op='insert'][data-track-status='pending']
|
|
1007
|
-
.block:not(.box-element),
|
|
995
|
+
.block:not(.box-element):not(.trans-abstract),
|
|
1008
996
|
.tracking-visible
|
|
1009
997
|
.ProseMirror
|
|
1010
998
|
[data-track-op='wrap_with_node'][data-track-status='pending']
|
|
@@ -1014,7 +1002,7 @@ figure.block:has(.equation.selected-suggestion) {
|
|
|
1014
1002
|
|
|
1015
1003
|
.tracking-visible
|
|
1016
1004
|
.selected-suggestion[data-track-status='pending'][data-track-op='insert']
|
|
1017
|
-
.block:not(.box-element),
|
|
1005
|
+
.block:not(.box-element):not(.trans-abstract),
|
|
1018
1006
|
.tracking-visible
|
|
1019
1007
|
.selected-suggestion
|
|
1020
1008
|
[data-track-status='pending'][data-track-op='insert']
|
|
@@ -1042,7 +1030,7 @@ figure.block:has(.equation.selected-suggestion) {
|
|
|
1042
1030
|
.tracking-visible
|
|
1043
1031
|
.ProseMirror
|
|
1044
1032
|
[data-track-status='pending'][data-track-op='delete']
|
|
1045
|
-
.block:not(.box-element),
|
|
1033
|
+
.block:not(.box-element):not(.trans-abstract),
|
|
1046
1034
|
.tracking-visible
|
|
1047
1035
|
.ProseMirror
|
|
1048
1036
|
.figure-block
|
|
@@ -1060,7 +1048,7 @@ figure.block:has(.equation.selected-suggestion) {
|
|
|
1060
1048
|
}
|
|
1061
1049
|
|
|
1062
1050
|
.selected-suggestion[data-track-status='pending'][data-track-op='delete']
|
|
1063
|
-
|
|
1051
|
+
.block:not(.box-element):not(.trans-abstract) {
|
|
1064
1052
|
box-shadow: inset 6px 0 0 var(--deleted-color),
|
|
1065
1053
|
inset 9px 0 0 var(--deleted-pending-bg-color) !important;
|
|
1066
1054
|
animation: fadeOutBackground 3s forwards;
|
|
@@ -1068,7 +1056,7 @@ figure.block:has(.equation.selected-suggestion) {
|
|
|
1068
1056
|
}
|
|
1069
1057
|
|
|
1070
1058
|
/* Updated Block */
|
|
1071
|
-
.tracking-visible .ProseMirror [data-track-op='set_attrs'] .block,
|
|
1059
|
+
.tracking-visible .ProseMirror [data-track-op='set_attrs'] .block:not(.trans-abstract),
|
|
1072
1060
|
.tracking-visible .block:has(figure[data-track-op='set_attrs']),
|
|
1073
1061
|
.tracking-visible figure.block:has(.equation.set_attrs),
|
|
1074
1062
|
.tracking-visible
|
|
@@ -1085,8 +1073,7 @@ figure.block:has(.equation.selected-suggestion) {
|
|
|
1085
1073
|
box-shadow: inset 3px 0 0 var(--updated-border-color);
|
|
1086
1074
|
}
|
|
1087
1075
|
|
|
1088
|
-
.tracking-visible .selected-suggestion[data-track-op='set_attrs'] .block,
|
|
1089
|
-
.tracking-visible .selected-suggestion [data-track-op='set_attrs'] .block,
|
|
1076
|
+
.tracking-visible .selected-suggestion[data-track-op='set_attrs'] .block:not(.trans-abstract),
|
|
1090
1077
|
.tracking-visible
|
|
1091
1078
|
.block:has(figure.selected-suggestion[data-track-op='set_attrs']),
|
|
1092
1079
|
.tracking-visible .selected-suggestion[data-track-op='node_split'] .block,
|
|
@@ -1729,3 +1716,83 @@ th:hover > .table-context-menu-button,
|
|
|
1729
1716
|
color: #666;
|
|
1730
1717
|
margin: 4px 0 0 0;
|
|
1731
1718
|
}
|
|
1719
|
+
|
|
1720
|
+
.ProseMirror .add-button {
|
|
1721
|
+
border: 0px;
|
|
1722
|
+
z-index: 1;
|
|
1723
|
+
cursor: pointer;
|
|
1724
|
+
border-radius: 50%;
|
|
1725
|
+
background-color: #6e6e6e;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
.ProseMirror .add-button.disabled {
|
|
1729
|
+
background-color: #e2e2e2 !important;
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
.ProseMirror .add-button svg path {
|
|
1733
|
+
fill: #ffffff !important;
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
/* Abstract translations */
|
|
1737
|
+
.ProseMirror .abstracts {
|
|
1738
|
+
position: relative;
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
.ProseMirror .abstracts .add-translation-container {
|
|
1742
|
+
display: flex;
|
|
1743
|
+
align-items: center;
|
|
1744
|
+
gap: 8px;
|
|
1745
|
+
margin: 8px 0;
|
|
1746
|
+
padding: 6px 12px;
|
|
1747
|
+
position: absolute;
|
|
1748
|
+
right: 50px;
|
|
1749
|
+
z-index: 5;
|
|
1750
|
+
cursor: pointer;
|
|
1751
|
+
}
|
|
1752
|
+
.ProseMirror .abstracts .add-translation-text {
|
|
1753
|
+
font-size: 14px;
|
|
1754
|
+
color:#353535
|
|
1755
|
+
}
|
|
1756
|
+
.ProseMirror .abstracts .add-translation-container .add-button {
|
|
1757
|
+
margin: 0;
|
|
1758
|
+
padding: 0;
|
|
1759
|
+
width: 16px;
|
|
1760
|
+
height: 16px;
|
|
1761
|
+
display: flex;
|
|
1762
|
+
align-items: center;
|
|
1763
|
+
justify-content: center;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
.ProseMirror .abstracts .add-translation-container .add-button svg {
|
|
1767
|
+
width: 10px;
|
|
1768
|
+
height: 8px;
|
|
1769
|
+
}
|
|
1770
|
+
.ProseMirror .block-trans_abstract .language-selector-btn {
|
|
1771
|
+
position: absolute;
|
|
1772
|
+
z-index: 9;
|
|
1773
|
+
top: 40px;
|
|
1774
|
+
border: 0px;
|
|
1775
|
+
background: transparent;
|
|
1776
|
+
right: 60px;
|
|
1777
|
+
display: flex;
|
|
1778
|
+
align-items: center;
|
|
1779
|
+
font-size: 14px;
|
|
1780
|
+
color: #6E6E6E;
|
|
1781
|
+
cursor: pointer;
|
|
1782
|
+
}
|
|
1783
|
+
.abstracts-language-dropdown {
|
|
1784
|
+
right: -142px !important;
|
|
1785
|
+
top: -86px !important;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
.ProseMirror .block-trans_abstract p.empty-node[data-placeholder] {
|
|
1789
|
+
font-style: italic;
|
|
1790
|
+
color: #c9c9c9;
|
|
1791
|
+
margin: 0;
|
|
1792
|
+
}
|
|
1793
|
+
.ProseMirror .block-trans_abstract section.block.trans-abstract {
|
|
1794
|
+
padding: 0 !important;
|
|
1795
|
+
}
|
|
1796
|
+
.ProseMirror .abstracts.empty-node .add-translation-container {
|
|
1797
|
+
display: none;
|
|
1798
|
+
}
|