@manuscripts/body-editor 3.12.17 → 3.12.20

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.
Files changed (57) hide show
  1. package/dist/cjs/commands.js +16 -24
  2. package/dist/cjs/components/affiliations/AffiliationForm.js +5 -6
  3. package/dist/cjs/components/affiliations/AffiliationsModal.js +21 -57
  4. package/dist/cjs/components/affiliations/AffiliationsPanel.js +22 -0
  5. package/dist/cjs/components/authors/AuthorDetailsForm.js +3 -4
  6. package/dist/cjs/components/authors/AuthorsModal.js +15 -48
  7. package/dist/cjs/components/authors/AuthorsPanel.js +18 -0
  8. package/dist/cjs/components/authors/useManageAffiliations.js +6 -4
  9. package/dist/cjs/components/authors-affiliations/AuthorsAndAffiliationsModals.js +134 -0
  10. package/dist/cjs/components/authors-affiliations/GenericPanel.js +136 -0
  11. package/dist/cjs/components/form/ModalFormActions.js +11 -5
  12. package/dist/cjs/keys/title.js +24 -10
  13. package/dist/cjs/lib/__tests__/plugins.test.js +2 -2
  14. package/dist/cjs/lib/context-menu.js +8 -9
  15. package/dist/cjs/plugins/objects.js +24 -19
  16. package/dist/cjs/versions.js +1 -1
  17. package/dist/cjs/views/affiliations.js +5 -11
  18. package/dist/cjs/views/caption.js +1 -1
  19. package/dist/cjs/views/contributors.js +4 -7
  20. package/dist/cjs/views/figure.js +0 -1
  21. package/dist/es/commands.js +16 -24
  22. package/dist/es/components/affiliations/AffiliationForm.js +5 -6
  23. package/dist/es/components/affiliations/AffiliationsModal.js +21 -53
  24. package/dist/es/components/affiliations/AffiliationsPanel.js +15 -0
  25. package/dist/es/components/authors/AuthorDetailsForm.js +3 -4
  26. package/dist/es/components/authors/AuthorsModal.js +15 -45
  27. package/dist/es/components/authors/AuthorsPanel.js +11 -0
  28. package/dist/es/components/authors/useManageAffiliations.js +7 -5
  29. package/dist/es/components/authors-affiliations/AuthorsAndAffiliationsModals.js +93 -0
  30. package/dist/es/components/authors-affiliations/GenericPanel.js +94 -0
  31. package/dist/es/components/form/ModalFormActions.js +11 -5
  32. package/dist/es/keys/title.js +24 -10
  33. package/dist/es/lib/__tests__/plugins.test.js +2 -2
  34. package/dist/es/lib/context-menu.js +8 -9
  35. package/dist/es/plugins/objects.js +25 -20
  36. package/dist/es/versions.js +1 -1
  37. package/dist/es/views/affiliations.js +5 -11
  38. package/dist/es/views/caption.js +1 -1
  39. package/dist/es/views/contributors.js +5 -8
  40. package/dist/es/views/figure.js +0 -1
  41. package/dist/types/components/affiliations/AffiliationForm.d.ts +1 -0
  42. package/dist/types/components/affiliations/AffiliationsModal.d.ts +2 -5
  43. package/dist/types/components/affiliations/AffiliationsPanel.d.ts +11 -0
  44. package/dist/types/components/authors/AuthorDetailsForm.d.ts +1 -0
  45. package/dist/types/components/authors/AuthorsModal.d.ts +2 -4
  46. package/dist/types/components/authors/AuthorsPanel.d.ts +13 -0
  47. package/dist/types/components/authors/useManageAffiliations.d.ts +0 -2
  48. package/dist/types/components/authors-affiliations/AuthorsAndAffiliationsModals.d.ts +29 -0
  49. package/dist/types/components/authors-affiliations/GenericPanel.d.ts +48 -0
  50. package/dist/types/components/form/ModalFormActions.d.ts +1 -0
  51. package/dist/types/versions.d.ts +1 -1
  52. package/package.json +3 -3
  53. package/styles/AdvancedEditor.css +18 -48
  54. package/styles/Editor.css +28 -63
  55. package/dist/cjs/components/authors/AffiliationDrawer.js +0 -24
  56. package/dist/es/components/authors/AffiliationDrawer.js +0 -17
  57. package/dist/types/components/authors/AffiliationDrawer.d.ts +0 -12
@@ -162,6 +162,10 @@
162
162
  [caption listing] auto !important;
163
163
  }
164
164
 
165
+ .ProseMirror .figure-block {
166
+ text-align: center;
167
+ }
168
+
165
169
  .ProseMirror .figure-block-group .figure-block {
166
170
  border: none;
167
171
  border-radius: 0;
@@ -254,16 +258,6 @@
254
258
  padding-bottom: 20px;
255
259
  }
256
260
 
257
- .ProseMirror .figure-block > figcaption {
258
- grid-column-start: 1;
259
- grid-column-end: -1;
260
- margin-top: 30px;
261
- }
262
-
263
- .ProseMirror .figure-caption {
264
- display: none;
265
- }
266
-
267
261
  .ProseMirror .figure.placeholder {
268
262
  align-items: center;
269
263
  border-radius: 16px;
@@ -319,22 +313,6 @@
319
313
  border: none;
320
314
  }
321
315
 
322
- .ProseMirror figcaption {
323
- background: white;
324
- font-size: 14px;
325
- margin-top: 1em;
326
- text-align: center;
327
- word-wrap: break-word;
328
- }
329
-
330
- .ProseMirror .block-table_element figcaption {
331
- text-align: left;
332
- }
333
-
334
- .ProseMirror .figure-block > figcaption .figure-label {
335
- display: initial !important;
336
- }
337
-
338
316
  .ProseMirror .figure-block[id^='MPTable'] {
339
317
  border-collapse: collapse;
340
318
  empty-cells: show;
@@ -365,11 +343,6 @@
365
343
  border-bottom-width: 1pt !important;
366
344
  }
367
345
 
368
- .ProseMirror .figure-block[id^='MPTable'] > figcaption {
369
- grid-row: 2 !important;
370
- text-align: center !important;
371
- }
372
-
373
346
  .position-menu-button:focus-visible {
374
347
  outline: none;
375
348
  }
@@ -449,11 +422,6 @@ ProseMirror .block-embed .position-menu {
449
422
  .ProseMirror .block-affiliations {
450
423
  grid-template-columns: 52px auto 100px;
451
424
  }
452
- .ProseMirror .block-container.block-box_element > .block.box-element {
453
- position: relative;
454
- display: grid;
455
- grid-template-columns: auto;
456
- }
457
425
 
458
426
  .ProseMirror .box-element .block-container .block {
459
427
  background: var(--box-element-bg-color);
@@ -462,8 +430,8 @@ ProseMirror .block-embed .position-menu {
462
430
  border-right: 2px solid #e2e2e2;
463
431
  }
464
432
 
465
- .ProseMirror .box-element::after,
466
- .box-element > .block-section::before {
433
+ .ProseMirror .box-element > .block-section::before,
434
+ .ProseMirror .box-element > .block-section::after {
467
435
  content: ' ';
468
436
  margin-left: 52px;
469
437
  margin-right: 52px;
@@ -471,11 +439,16 @@ ProseMirror .block-embed .position-menu {
471
439
  height: 0;
472
440
  }
473
441
 
474
- .box-element > figcaption {
475
- margin-left: 54px;
476
- margin-right: 54px;
477
- padding-bottom: 6px;
478
- text-align: left;
442
+ .ProseMirror .box-element > .block-section {
443
+ padding-top: 6px;
444
+ }
445
+
446
+ .ProseMirror .box-element > .element-label {
447
+ margin-left: 52px;
448
+ }
449
+
450
+ .ProseMirror .box-element > .caption-title {
451
+ margin-right: 52px;
479
452
  }
480
453
 
481
454
  .ProseMirror
@@ -496,9 +469,7 @@ ProseMirror .block-embed .position-menu {
496
469
  > h1.empty-node[data-placeholder]::before {
497
470
  font-size: 16pt;
498
471
  }
499
- .box-element section figcaption {
500
- background: var(--box-element-bg-color);
501
- }
472
+
502
473
  .unsupported-format-label {
503
474
  font-size: 140%;
504
475
  line-height: 1.3;
@@ -1854,8 +1825,7 @@ th:hover > .table-context-menu-button,
1854
1825
 
1855
1826
  .ProseMirror .block-image_element .block:focus-visible,
1856
1827
  .ProseMirror .block-figure_element .block:focus-visible,
1857
- .ProseMirror .block-embed .block:focus-visible,
1858
- .ProseMirror .supplement-caption:focus-visible {
1828
+ .ProseMirror .block-embed .block:focus-visible {
1859
1829
  outline: none;
1860
1830
  }
1861
1831
 
package/styles/Editor.css CHANGED
@@ -308,82 +308,55 @@
308
308
  padding-top: 1em;
309
309
  }
310
310
 
311
- .ProseMirror .caption-title:not(.empty-node) {
311
+ /* Caption and Element Label */
312
+
313
+ .ProseMirror .caption-title:not(.empty-node), .ProseMirror .element-label {
312
314
  font-weight: bold;
313
315
  }
314
316
 
315
- .ProseMirror .caption-description {
317
+ .ProseMirror .element-label, .ProseMirror .caption-description, .ProseMirror .caption-title {
318
+ font-size: 14px;
319
+ outline: none;
316
320
  margin: 0;
317
- outline: none !important;
321
+ display: inline;
318
322
  }
319
323
 
320
- .ProseMirror .suppress-title .caption-description {
324
+ .ProseMirror .element-label + .caption-description > p:first-child {
321
325
  display: inline;
322
- outline: none !important;
323
- }
324
- .ProseMirror .caption-title {
325
- outline: none !important;
326
326
  }
327
327
 
328
- .ProseMirror .caption-title.empty-node::before {
329
- content: 'Caption Title...';
330
- color: #000;
331
- cursor: text;
328
+ .ProseMirror .caption-description > p {
329
+ margin: 0;
332
330
  }
333
331
 
334
- .ProseMirror .block-box_element .caption-title.empty-node::before {
335
- content: none;
332
+ .ProseMirror .element-label {
333
+ margin-right: 5px;
336
334
  }
337
335
 
338
- .ProseMirror .block-box_element label.caption-title.placeholder.empty-node {
339
- display: inline-flex;
336
+ .ProseMirror .block-equation_element .element-label {
337
+ display: block;
338
+ text-align: center;
340
339
  }
341
340
 
342
- .ProseMirror .block-box_element .caption-title.empty-node::after {
341
+ .ProseMirror .caption-title.empty-node::before {
343
342
  content: 'Caption Title...';
344
- color: #999;
345
- font-style: italic;
346
- pointer-events: none;
343
+ color: #000;
344
+ cursor: text;
347
345
  }
348
346
 
349
- .ProseMirror .caption-description.empty-node::before {
347
+ .ProseMirror .caption-description > p.empty-node::before {
350
348
  content: 'Caption...';
351
349
  color: #000;
352
350
  cursor: text;
353
351
  }
354
352
 
355
- .ProseMirror .block-table_element .caption-description.empty-node::before {
356
- content: 'Table caption';
357
- }
358
-
359
353
  .ProseMirror .block-table_element .caption-title.empty-node::before {
360
354
  content: 'Table title';
361
355
  }
362
356
 
363
- .ProseMirror .suppress-caption .caption-description {
364
- display: none;
365
- }
366
-
367
- .ProseMirror .suppress-caption figcaption > .figure-label {
368
- display: none !important;
369
- }
370
-
371
- .ProseMirror .suppress-title .caption-title {
372
- display: none;
373
- }
374
-
375
- .ProseMirror .figure-label {
376
- font-weight: bold;
377
- font-size: 14px;
378
- margin-right: 5px;
379
- white-space: nowrap;
380
- }
381
-
382
- .block-image_element .figure-label {
383
- display: block;
384
- text-align: center;
385
- grid-column-start: 1;
386
- grid-column-end: -1;
357
+ .ProseMirror .box-element > .caption-title.empty-node::before {
358
+ color: #999;
359
+ font-style: italic;
387
360
  }
388
361
 
389
362
  .ProseMirror .executable-container {
@@ -860,21 +833,18 @@
860
833
  max-width: 100%;
861
834
  }
862
835
 
863
- .ProseMirror figcaption .equation,
864
836
  .ProseMirror p .equation {
865
837
  display: inline;
866
838
  vertical-align: baseline;
867
839
  padding: 0 5px;
868
840
  }
869
841
 
870
- .ProseMirror figcaption .equation-placeholder,
871
842
  .ProseMirror p .equation-placeholder {
872
843
  display: inline;
873
844
  }
874
845
 
875
846
  .ProseMirror .code-placeholder,
876
- .ProseMirror .equation-placeholder,
877
- .ProseMirror .caption-placeholder {
847
+ .ProseMirror .equation-placeholder {
878
848
  color: #c9c9c9;
879
849
  }
880
850
 
@@ -1229,23 +1199,22 @@
1229
1199
  border-bottom: none;
1230
1200
  }
1231
1201
 
1232
- .ProseMirror .supplement-item figcaption {
1233
- text-align: left;
1234
- margin-top: 0;
1235
- }
1236
-
1237
1202
  .ProseMirror .supplement-item .caption-title.empty-node::before {
1238
1203
  content: 'Insert caption title...';
1239
1204
  color: #c9c9c9;
1240
1205
  font-style: italic;
1241
1206
  }
1242
1207
 
1243
- .ProseMirror .supplement-item .caption-description.empty-node::before {
1208
+ .ProseMirror .supplement-item .caption-description > p.empty-node::before {
1244
1209
  content: 'Insert caption...';
1245
1210
  color: #c9c9c9;
1246
1211
  font-style: italic;
1247
1212
  }
1248
1213
 
1214
+ .ProseMirror .supplement-item .caption-description > p {
1215
+ text-align: start;
1216
+ }
1217
+
1249
1218
  .ProseMirror .supplement-file-info {
1250
1219
  display: flex;
1251
1220
  align-items: center;
@@ -1341,10 +1310,6 @@
1341
1310
  cursor: move;
1342
1311
  }
1343
1312
 
1344
- .ProseMirror .supplement-item:hover figcaption {
1345
- background-color: #f2f2f2 !important;
1346
- }
1347
-
1348
1313
  .ProseMirror .supplement-item .drag-icon {
1349
1314
  position: absolute;
1350
1315
  top: 50%;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AffiliationsDrawer = void 0;
7
- const style_guide_1 = require("@manuscripts/style-guide");
8
- const react_1 = __importDefault(require("react"));
9
- const AffiliationsDrawer = ({ items, selectedItems = [], onSelect, ...drawerProps }) => {
10
- return (react_1.default.createElement(style_guide_1.Drawer, { ...drawerProps },
11
- react_1.default.createElement(style_guide_1.DrawerItemsList, null, items.map((item) => (react_1.default.createElement(style_guide_1.DrawerListItem, { "data-cy": "item", key: item.id, selected: selectedItems?.map((a) => a.id).includes(item.id), onClick: () => onSelect(item.id) },
12
- react_1.default.createElement(style_guide_1.DrawerIcon, null, selectedItems?.map((a) => a.id).includes(item.id) ? (react_1.default.createElement(style_guide_1.AddedIcon, { width: 22, height: 22 })) : (react_1.default.createElement(style_guide_1.AddIcon, { width: 22, height: 22 }))),
13
- react_1.default.createElement(style_guide_1.DrawerLabelContainer, null,
14
- react_1.default.createElement(style_guide_1.DrawerItemLabel, null, item.institution),
15
- react_1.default.createElement(style_guide_1.DrawerItemMeta, null,
16
- item.city && (react_1.default.createElement(react_1.default.Fragment, null,
17
- item.city,
18
- item.county || item.country ? ', ' : '')),
19
- item.county && (react_1.default.createElement(react_1.default.Fragment, null,
20
- item.county,
21
- item.country ? ', ' : '')),
22
- item.country && react_1.default.createElement(react_1.default.Fragment, null, item.country)))))))));
23
- };
24
- exports.AffiliationsDrawer = AffiliationsDrawer;
@@ -1,17 +0,0 @@
1
- import { AddedIcon, AddIcon, Drawer, DrawerIcon, DrawerItemLabel, DrawerItemMeta, DrawerItemsList, DrawerLabelContainer, DrawerListItem, } from '@manuscripts/style-guide';
2
- import React from 'react';
3
- export const AffiliationsDrawer = ({ items, selectedItems = [], onSelect, ...drawerProps }) => {
4
- return (React.createElement(Drawer, { ...drawerProps },
5
- React.createElement(DrawerItemsList, null, items.map((item) => (React.createElement(DrawerListItem, { "data-cy": "item", key: item.id, selected: selectedItems?.map((a) => a.id).includes(item.id), onClick: () => onSelect(item.id) },
6
- React.createElement(DrawerIcon, null, selectedItems?.map((a) => a.id).includes(item.id) ? (React.createElement(AddedIcon, { width: 22, height: 22 })) : (React.createElement(AddIcon, { width: 22, height: 22 }))),
7
- React.createElement(DrawerLabelContainer, null,
8
- React.createElement(DrawerItemLabel, null, item.institution),
9
- React.createElement(DrawerItemMeta, null,
10
- item.city && (React.createElement(React.Fragment, null,
11
- item.city,
12
- item.county || item.country ? ', ' : '')),
13
- item.county && (React.createElement(React.Fragment, null,
14
- item.county,
15
- item.country ? ', ' : '')),
16
- item.country && React.createElement(React.Fragment, null, item.country)))))))));
17
- };
@@ -1,12 +0,0 @@
1
- import { DrawerProps } from '@manuscripts/style-guide';
2
- import React from 'react';
3
- import { AffiliationAttrs } from '../../lib/authors';
4
- interface AffiliationsDrawerProps {
5
- items: AffiliationAttrs[];
6
- selectedItems: {
7
- id: string;
8
- }[];
9
- onSelect: (id: string) => void;
10
- }
11
- export declare const AffiliationsDrawer: React.FC<AffiliationsDrawerProps & Omit<DrawerProps, 'children'>>;
12
- export {};