@manuscripts/body-editor 2.6.32 → 2.6.33

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.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MATHJAX_VERSION = exports.VERSION = void 0;
4
- exports.VERSION = '2.6.32';
4
+ exports.VERSION = '2.6.33';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -29,17 +29,15 @@ class EquationView extends base_node_view_1.BaseNodeView {
29
29
  };
30
30
  this.createDOM = () => {
31
31
  this.dom = document.createElement('div');
32
- this.dom.classList.add('equation');
33
32
  this.dom.setAttribute('id', this.node.attrs.id);
34
33
  };
35
34
  this.updateContents = () => {
35
+ const classes = [
36
+ 'equation',
37
+ ...(0, track_changes_utils_1.getChangeClasses)(this.node.attrs.dataTracked),
38
+ ];
39
+ this.dom.className = classes.join(' ');
36
40
  this.dom.innerHTML = this.node.attrs.contents;
37
- if ((0, track_changes_utils_1.isDeleted)(this.node)) {
38
- this.dom.classList.add('deleted');
39
- }
40
- else {
41
- this.dom.classList.remove('deleted');
42
- }
43
41
  (0, math_1.renderMath)(this.dom);
44
42
  };
45
43
  this.ignoreMutation = () => true;
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.6.32';
1
+ export const VERSION = '2.6.33';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { renderMath } from '../lib/math';
17
- import { isDeleted } from '../lib/track-changes-utils';
17
+ import { getChangeClasses } from '../lib/track-changes-utils';
18
18
  import { BaseNodeView } from './base_node_view';
19
19
  import { createNodeView } from './creators';
20
20
  export class EquationView extends BaseNodeView {
@@ -26,17 +26,15 @@ export class EquationView extends BaseNodeView {
26
26
  };
27
27
  this.createDOM = () => {
28
28
  this.dom = document.createElement('div');
29
- this.dom.classList.add('equation');
30
29
  this.dom.setAttribute('id', this.node.attrs.id);
31
30
  };
32
31
  this.updateContents = () => {
32
+ const classes = [
33
+ 'equation',
34
+ ...getChangeClasses(this.node.attrs.dataTracked),
35
+ ];
36
+ this.dom.className = classes.join(' ');
33
37
  this.dom.innerHTML = this.node.attrs.contents;
34
- if (isDeleted(this.node)) {
35
- this.dom.classList.add('deleted');
36
- }
37
- else {
38
- this.dom.classList.remove('deleted');
39
- }
40
38
  renderMath(this.dom);
41
39
  };
42
40
  this.ignoreMutation = () => true;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.6.32";
1
+ export declare const VERSION = "2.6.33";
2
2
  export declare const MATHJAX_VERSION = "3.2.2";
@@ -14,8 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { EquationNode, ManuscriptNodeView } from '@manuscripts/transform';
17
+ import { Trackable } from '../types';
17
18
  import { BaseNodeView } from './base_node_view';
18
- export declare class EquationView extends BaseNodeView<EquationNode> implements ManuscriptNodeView {
19
+ export declare class EquationView extends BaseNodeView<Trackable<EquationNode>> implements ManuscriptNodeView {
19
20
  initialise: () => void;
20
21
  createDOM: () => void;
21
22
  updateContents: () => void;
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.6.32",
4
+ "version": "2.6.33",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -525,13 +525,12 @@ span.comment-marker {
525
525
  .ProseMirror {
526
526
  --inserted-pending-bg-color: #e6ffdb;
527
527
  --inserted-pending-color: #01872e;
528
- --accepted-bg-color: #e2e2e2;
529
528
  --deleted-color: #f35143;
530
529
  --deleted-pending-bg-color: #fff1f0;
530
+ --updated-bg-color: #d9f6ff;
531
+ --updated-border-color: #1a9bc7;
531
532
  --highlight-bg-color: #ffeebf;
532
533
  --common-color: #353535;
533
- --selected-pending-background-color: #ddf3fa;
534
- --selected-accepted-background-color: #f2f2f2;
535
534
  --box-element-bg-color: #fafafa;
536
535
  }
537
536
  .ProseMirror ins,
@@ -543,13 +542,19 @@ span.comment-marker {
543
542
  background: none;
544
543
  }
545
544
 
546
- span.selected-suggestion,
547
- .selected-suggestion > .block-container .block,
548
- .selected-suggestion:not(:has(> .block-container)) {
549
- background-color: var(--selected-pending-background-color) !important;
550
- color: var(--common-color) !important;
545
+ @keyframes fadeOutBackground {
546
+ 0% {
547
+ background: var(--fade-color);
548
+ }
549
+ 100% {
550
+ background: transparent;
551
+ }
552
+ }
553
+
554
+ .selected-suggestion:not(.block-container):not(.graphical-abstract):not(
555
+ .keywords
556
+ ):not(figure):not(figure .equation) {
551
557
  border-width: 2px 0 2px 0 !important;
552
- border-color: #20aedf !important;
553
558
  border-radius: 3px !important;
554
559
  border-style: solid !important;
555
560
  }
@@ -564,37 +569,21 @@ span.selected-suggestion,
564
569
  margin: 16px 0;
565
570
  }
566
571
 
567
- .tracking-visible .ProseMirror .inserted,
568
- .tracking-visible
569
- .ProseMirror
570
- [data-track-op='insert'][data-track-status='pending']
571
- .block,
572
- .tracking-visible
573
- .ProseMirror
574
- [data-track-op='node_split'][data-track-status='pending']
575
- .block,
576
- .tracking-visible
577
- .ProseMirror
578
- [data-track-op='wrap_with_node'][data-track-status='pending']
579
- .block {
572
+ /* Insert */
573
+ .tracking-visible .ProseMirror .inserted {
580
574
  background: var(--inserted-pending-bg-color);
581
575
  color: var(--inserted-pending-color);
582
576
  text-decoration: underline;
583
577
  }
584
578
 
585
- .ProseMirror .selected-suggestion .inserted,
586
- .ProseMirror .selected-suggestion [data-track-op='insert'] .block,
587
- .ProseMirror .selected-suggestion .deleted {
588
- background-color: var(--selected-pending-background-color) !important;
589
- color: var(--common-color) !important;
590
- }
591
-
592
- .tracking-visible .ProseMirror .set_attrs,
593
- .tracking-visible .ProseMirror [data-track-op='set_attrs'] {
594
- background: var(--inserted-pending-bg-color);
595
- text-decoration: none;
579
+ .inserted:has(.selected-suggestion),
580
+ .inserted.selected-suggestion,
581
+ .selected-suggestion:has(.inserted) {
582
+ border-color: var(--inserted-pending-color) !important;
583
+ text-decoration: none !important;
596
584
  }
597
585
 
586
+ /* Delete */
598
587
  .ProseMirror .deleted::before,
599
588
  .ProseMirror .deleted,
600
589
  .ProseMirror p .equation.deleted {
@@ -614,6 +603,11 @@ span.selected-suggestion,
614
603
  display: flex;
615
604
  }
616
605
 
606
+ .tracking-visible .ProseMirror .footnote.deleted::before,
607
+ .tracking-visible .ProseMirror .footnote.deleted {
608
+ display: flex;
609
+ }
610
+
617
611
  .tracking-visible .equation.deleted:after {
618
612
  content: '';
619
613
  width: 100%;
@@ -623,9 +617,105 @@ span.selected-suggestion,
623
617
  top: calc(50% + 1px);
624
618
  }
625
619
 
626
- .tracking-visible .ProseMirror .footnote.deleted::before,
627
- .tracking-visible .ProseMirror .footnote.deleted {
628
- display: flex;
620
+
621
+ .selected-suggestion .equation.deleted:after,
622
+ .selected-suggestion.equation.deleted:after {
623
+ content: none;
624
+ }
625
+
626
+ .deleted:has(.selected-suggestion),
627
+ .deleted.selected-suggestion,
628
+ .selected-suggestion:has(.deleted) {
629
+ border-color: var(--deleted-color) !important;
630
+ text-decoration: none !important;
631
+ }
632
+
633
+ /* Update */
634
+ .tracking-visible .ProseMirror .set_attrs {
635
+ background: var(--updated-bg-color);
636
+ text-decoration: none;
637
+ }
638
+
639
+ .selected-suggestion:has(.set_attrs),
640
+ .selected-suggestion.set_attrs {
641
+ border-color: var(--updated-border-color) !important;
642
+ }
643
+
644
+ /* */
645
+ .selected-suggestion .inserted,
646
+ .selected-suggestion .deleted {
647
+ text-decoration: none !important;
648
+ }
649
+
650
+ .selected-suggestion .inserted:not(.citation.inserted),
651
+ .selected-suggestion .deleted:not(.citation.deleted),
652
+ figure.block .equation.set_attrs.selected-suggestion {
653
+ background-color: transparent !important;
654
+ }
655
+
656
+ /* Inserted Block */
657
+ .tracking-visible .ProseMirror [data-track-op='insert'][data-track-status='pending'] .block,
658
+ .tracking-visible .ProseMirror [data-track-op='node_split'][data-track-status='pending'] .block,
659
+ .tracking-visible .ProseMirror
660
+ [data-track-op='wrap_with_node'][data-track-status='pending']
661
+ .block {
662
+ border-left: 3px solid var(--inserted-pending-color);
663
+ }
664
+
665
+ .selected-suggestion[data-track-status='pending'][data-track-op='insert']
666
+ .block,
667
+ .selected-suggestion
668
+ [data-track-status='pending'][data-track-op='insert']
669
+ .block,
670
+ .selected-suggestion[data-track-op='wrap_with_node'][data-track-status='pending']
671
+ .block {
672
+ border-left: 6px solid var(--inserted-pending-color) !important;
673
+ box-shadow: inset 6px 0 0 var(--inserted-pending-bg-color);
674
+ animation: fadeOutBackground 3s forwards;
675
+ --fade-color: var(--inserted-pending-bg-color);
676
+ }
677
+
678
+ /* Deleted Block */
679
+ .ProseMirror
680
+ .block-container[data-track-status='pending'][data-track-op='delete'] {
681
+ display: none;
682
+ }
683
+ .tracking-visible
684
+ .ProseMirror
685
+ .block-container[data-track-status='pending'][data-track-op='delete'] {
686
+ display: grid;
687
+ }
688
+
689
+ .tracking-visible .ProseMirror [data-track-status='pending'][data-track-op='delete'] .block {
690
+ border-left: 3px solid var(--deleted-color);
691
+ }
692
+
693
+ .selected-suggestion[data-track-status='pending'][data-track-op='delete']
694
+ .block,
695
+ .selected-suggestion
696
+ [data-track-status='pending'][data-track-op='delete']
697
+ .block {
698
+ border-left: 6px solid var(--deleted-color) !important;
699
+ box-shadow: inset 6px 0 0 var(--deleted-pending-bg-color);
700
+ animation: fadeOutBackground 3s forwards;
701
+ --fade-color: var(--deleted-pending-bg-color);
702
+ }
703
+
704
+ /* Updated Block */
705
+ .tracking-visible .ProseMirror [data-track-op='set_attrs'] .block,
706
+ .tracking-visible .block:has(figure[data-track-op='set_attrs']),
707
+ .tracking-visible figure.block:has(.equation.set_attrs) {
708
+ border-left: 3px solid var(--updated-border-color);
709
+ }
710
+
711
+ .selected-suggestion[data-track-op='set_attrs'] .block,
712
+ .selected-suggestion [data-track-op='set_attrs'] .block,
713
+ .block:has(figure.selected-suggestion[data-track-op='set_attrs']),
714
+ figure.block:has(.equation.set_attrs.selected-suggestion) {
715
+ border-left: 6px solid var(--updated-border-color);
716
+ box-shadow: inset 6px 0 0 var(--updated-bg-color);
717
+ animation: fadeOutBackground 3s forwards;
718
+ --fade-color: var(--updated-bg-color);
629
719
  }
630
720
 
631
721
  .tracking-visible .subtree .deleted {
@@ -637,19 +727,6 @@ span.selected-suggestion,
637
727
  display: none;
638
728
  }
639
729
 
640
- .ProseMirror .inserted:has(.selected-suggestion),
641
- .ProseMirror .deleted:has(.selected-suggestion),
642
- .ProseMirror .selected-suggestion .highlight,
643
- .ProseMirror
644
- .selected-suggestion
645
- .graphical-abstract:has(
646
- [data-track-status='pending'][data-track-op='insert']
647
- ) {
648
- background: transparent !important;
649
- color: var(--common-color);
650
- text-decoration: none;
651
- }
652
-
653
730
  .citation-wrapper {
654
731
  position: relative;
655
732
  }
@@ -670,25 +747,6 @@ span.selected-suggestion,
670
747
  display: inline-block;
671
748
  }
672
749
 
673
- .ProseMirror .affiliation[data-track-status='rejected'][data-track-op='insert'],
674
- .ProseMirror .contributor[data-track-status='rejected'][data-track-op='insert'],
675
- .ProseMirror figure[data-track-status='rejected'][data-track-op='insert'],
676
- .ProseMirror table[data-track-status='rejected'][data-track-op='insert'],
677
- .ProseMirror
678
- .block-container[data-track-status='rejected'][data-track-op='insert'] {
679
- display: none;
680
- }
681
-
682
- .ProseMirror
683
- .block-container[data-track-status='pending'][data-track-op='delete'] {
684
- display: none;
685
- }
686
- .tracking-visible
687
- .ProseMirror
688
- .block-container[data-track-status='pending'][data-track-op='delete'] {
689
- display: grid;
690
- }
691
-
692
750
  .contributor[data-track-status='pending'][data-track-op='delete'],
693
751
  .affiliation[data-track-status='pending'][data-track-op='delete'] {
694
752
  display: none;
@@ -712,6 +770,19 @@ span.selected-suggestion,
712
770
  color: var(--inserted-pending-color);
713
771
  text-decoration: underline;
714
772
  }
773
+
774
+ .tracking-visible .contributor[data-track-status='pending'][data-track-op='set_attrs'],
775
+ .tracking-visible .affiliation[data-track-status='pending'][data-track-op='set_attrs'] {
776
+ background: var(--updated-bg-color);
777
+ color: var(--common-color);
778
+ border-color: var(--updated-border-color);
779
+ }
780
+
781
+ .selected-suggestion.contributor,
782
+ .selected-suggestion.affiliation {
783
+ text-decoration: none !important;
784
+ }
785
+
715
786
  .block-contributors,
716
787
  .block-author_notes,
717
788
  .block-awards,
package/styles/Editor.css CHANGED
@@ -704,6 +704,7 @@
704
704
  overflow-x: auto;
705
705
  justify-content: center;
706
706
  vertical-align: middle;
707
+ align-items: center;
707
708
  }
708
709
 
709
710
  .ProseMirror .equation svg {
@@ -989,7 +990,7 @@
989
990
  margin-right: 4px;
990
991
  }
991
992
 
992
- .ProseMirror .footnote.footnote-selected {
993
+ .ProseMirror .footnote.footnote-selected:not(.selected-suggestion) {
993
994
  background-color: #f2fbfc;
994
995
  border: 1px solid #bce7f6;
995
996
  }
@@ -7,7 +7,3 @@
7
7
  .ProseMirror .deleted {
8
8
  background: #ddf3fa;
9
9
  }
10
- .ProseMirror
11
- .block-container[data-track-status='rejected'][data-track-op='insert'] {
12
- display: none;
13
- }