@atlaskit/editor-plugin-show-diff 19.0.3 → 19.0.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/CHANGELOG.md +11 -0
- package/dist/cjs/pm-plugins/calculateDiff/calculateDiffDecorations.js +57 -93
- package/dist/cjs/pm-plugins/decorations/colorSchemes/factory.js +1 -1
- package/dist/cjs/pm-plugins/decorations/colorSchemes/standard.js +1 -26
- package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.js +12 -24
- package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +25 -57
- package/dist/cjs/pm-plugins/decorations/createChangedRowDecorationWidgets.js +22 -60
- package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.js +8 -16
- package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +7 -22
- package/dist/cjs/pm-plugins/decorations/createNodeChangedDecorationWidget.js +34 -52
- package/dist/cjs/pm-plugins/decorations/decorationKeys.js +6 -14
- package/dist/cjs/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +3 -8
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeView.js +132 -205
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +13 -20
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +6 -10
- package/dist/cjs/pm-plugins/getDefaultDiffType.js +10 -0
- package/dist/cjs/pm-plugins/getScrollableDecorations.js +5 -15
- package/dist/cjs/pm-plugins/main.js +45 -53
- package/dist/cjs/pm-plugins/resolveDiffContributors.js +18 -4
- package/dist/cjs/showDiffPlugin.js +14 -24
- package/dist/cjs/showDiffPluginType.js +1 -1
- package/dist/cjs/ui/ContributorTag/contributorAvatarRenderer.js +19 -9
- package/dist/cjs/ui/ContributorTag/contributorTagController.js +28 -3
- package/dist/cjs/ui/ContributorTag/contributorTagIcons.js +2 -2
- package/dist/es2019/pm-plugins/calculateDiff/calculateDiffDecorations.js +67 -105
- package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +1 -1
- package/dist/es2019/pm-plugins/decorations/colorSchemes/standard.js +0 -26
- package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.js +11 -23
- package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +25 -57
- package/dist/es2019/pm-plugins/decorations/createChangedRowDecorationWidgets.js +22 -60
- package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.js +8 -18
- package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +8 -23
- package/dist/es2019/pm-plugins/decorations/createNodeChangedDecorationWidget.js +34 -54
- package/dist/es2019/pm-plugins/decorations/decorationKeys.js +6 -16
- package/dist/es2019/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +2 -7
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeView.js +53 -125
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +11 -12
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +6 -7
- package/dist/es2019/pm-plugins/getDefaultDiffType.js +2 -0
- package/dist/es2019/pm-plugins/getScrollableDecorations.js +6 -19
- package/dist/es2019/pm-plugins/main.js +49 -65
- package/dist/es2019/pm-plugins/resolveDiffContributors.js +18 -3
- package/dist/es2019/showDiffPlugin.js +12 -24
- package/dist/es2019/showDiffPluginType.js +1 -1
- package/dist/es2019/ui/ContributorTag/contributorAvatarRenderer.js +19 -9
- package/dist/es2019/ui/ContributorTag/contributorTagController.js +30 -2
- package/dist/es2019/ui/ContributorTag/contributorTagIcons.js +2 -2
- package/dist/esm/pm-plugins/calculateDiff/calculateDiffDecorations.js +56 -92
- package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +1 -1
- package/dist/esm/pm-plugins/decorations/colorSchemes/standard.js +0 -26
- package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.js +12 -24
- package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +25 -57
- package/dist/esm/pm-plugins/decorations/createChangedRowDecorationWidgets.js +22 -60
- package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.js +8 -16
- package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +8 -23
- package/dist/esm/pm-plugins/decorations/createNodeChangedDecorationWidget.js +34 -52
- package/dist/esm/pm-plugins/decorations/decorationKeys.js +6 -14
- package/dist/esm/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +3 -8
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeView.js +132 -205
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +13 -20
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +6 -10
- package/dist/esm/pm-plugins/getDefaultDiffType.js +4 -0
- package/dist/esm/pm-plugins/getScrollableDecorations.js +6 -16
- package/dist/esm/pm-plugins/main.js +44 -52
- package/dist/esm/pm-plugins/resolveDiffContributors.js +18 -4
- package/dist/esm/showDiffPlugin.js +14 -24
- package/dist/esm/showDiffPluginType.js +1 -1
- package/dist/esm/ui/ContributorTag/contributorAvatarRenderer.js +19 -9
- package/dist/esm/ui/ContributorTag/contributorTagController.js +28 -3
- package/dist/esm/ui/ContributorTag/contributorTagIcons.js +2 -2
- package/dist/types/pm-plugins/decorations/colorSchemes/factory.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/colorSchemes/standard.d.ts +0 -3
- package/dist/types/pm-plugins/decorations/colorSchemes/types.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/createBlockChangedDecoration.d.ts +1 -3
- package/dist/types/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.d.ts +2 -3
- package/dist/types/pm-plugins/decorations/createChangedRowDecorationWidgets.d.ts +1 -3
- package/dist/types/pm-plugins/decorations/createInlineChangedDecoration.d.ts +2 -3
- package/dist/types/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.d.ts +2 -3
- package/dist/types/pm-plugins/decorations/createNodeChangedDecorationWidget.d.ts +2 -3
- package/dist/types/pm-plugins/decorations/decorationKeys.d.ts +5 -8
- package/dist/types/pm-plugins/decorations/utils/createDeletedLineBreakWidget.d.ts +3 -5
- package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeView.d.ts +4 -6
- package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.d.ts +3 -4
- package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.d.ts +4 -4
- package/dist/types/pm-plugins/getDefaultDiffType.d.ts +2 -0
- package/dist/types/pm-plugins/getScrollableDecorations.d.ts +1 -2
- package/dist/types/pm-plugins/main.d.ts +0 -1
- package/dist/types/showDiffPluginType.d.ts +1 -3
- package/docs/smart-diff-design.md +13 -29
- package/package.json +5 -5
- package/dist/cjs/pm-plugins/isExtendedEnabled.js +0 -23
- package/dist/es2019/pm-plugins/isExtendedEnabled.js +0 -13
- package/dist/esm/pm-plugins/isExtendedEnabled.js +0 -17
- package/dist/types/pm-plugins/isExtendedEnabled.d.ts +0 -12
|
@@ -28,8 +28,8 @@ import { createDeletedLineBreakDecoration } from '../decorations/utils/createDel
|
|
|
28
28
|
import { getAttrChangeRanges, stepIsValidAttrChange } from '../decorations/utils/getAttrChangeRanges';
|
|
29
29
|
import { getMarkChangeRanges } from '../decorations/utils/getMarkChangeRanges';
|
|
30
30
|
import { createRemovedLozenge } from '../decorations/utils/wrapBlockNodeView';
|
|
31
|
+
import { getDefaultDiffType } from '../getDefaultDiffType';
|
|
31
32
|
import { getScrollableDecorations } from '../getScrollableDecorations';
|
|
32
|
-
import { getDefaultDiffType, isExtendedEnabled } from '../isExtendedEnabled';
|
|
33
33
|
import { emptyTextBlockContentPositions } from '../utils/emptyTextBlocks';
|
|
34
34
|
import { diffBySteps } from './diffBySteps';
|
|
35
35
|
import { groupChangesByBlock } from './groupChangesByBlock';
|
|
@@ -51,28 +51,24 @@ var getChanges = function getChanges(_ref) {
|
|
|
51
51
|
steps = _ref.steps,
|
|
52
52
|
intl = _ref.intl,
|
|
53
53
|
smartThresholds = _ref.smartThresholds;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return groupChangesByBlock(changeset.changes, originalDoc, steppedDoc);
|
|
73
|
-
}
|
|
74
|
-
var _changes2 = simplifyChanges(changeset.changes, tr.doc);
|
|
75
|
-
return optimizeChanges(_changes2);
|
|
54
|
+
// The `smart` diff type is gated behind `platform_editor_ai_smart_diff`. When the gate is
|
|
55
|
+
// off, `smart` falls through to the default (`inline`) path below so behaviour degrades
|
|
56
|
+
// gracefully (see docs/smart-diff-design.md §3).
|
|
57
|
+
if (diffType === 'smart' && fg('platform_editor_ai_smart_diff')) {
|
|
58
|
+
var _changes = simplifyChanges(changeset.changes, tr.doc);
|
|
59
|
+
return classifySmartChanges({
|
|
60
|
+
changes: _changes,
|
|
61
|
+
originalDoc: originalDoc,
|
|
62
|
+
newDoc: tr.doc,
|
|
63
|
+
locale: intl.locale,
|
|
64
|
+
thresholds: smartThresholds
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (diffType === 'step') {
|
|
68
|
+
return diffBySteps(originalDoc, steps);
|
|
69
|
+
}
|
|
70
|
+
if (diffType === 'block') {
|
|
71
|
+
return groupChangesByBlock(changeset.changes, originalDoc, steppedDoc);
|
|
76
72
|
}
|
|
77
73
|
var changes = simplifyChanges(changeset.changes, tr.doc);
|
|
78
74
|
return optimizeChanges(changes);
|
|
@@ -88,13 +84,11 @@ var getAttributedChanges = function getAttributedChanges(_ref2) {
|
|
|
88
84
|
// the step attribution and promotes ranges to sentence/paragraph/node granularity, so a promoted
|
|
89
85
|
// range covers several actors' steps and the latest-writer rule credits all of it to one of them.
|
|
90
86
|
// The attributed changeset keeps step granularity instead.
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return groupChangesByBlock(changeset.changes, originalDoc, steppedDoc);
|
|
97
|
-
}
|
|
87
|
+
if (diffType === 'step') {
|
|
88
|
+
return attributedChanges;
|
|
89
|
+
}
|
|
90
|
+
if (diffType === 'block') {
|
|
91
|
+
return groupChangesByBlock(changeset.changes, originalDoc, steppedDoc);
|
|
98
92
|
}
|
|
99
93
|
return simplifyChangesWithAttribution(attributedChanges, tr.doc);
|
|
100
94
|
};
|
|
@@ -193,7 +187,6 @@ var calculateNodesForBlockDecoration = function calculateNodesForBlockDecoration
|
|
|
193
187
|
showContributorTags = _ref5$showContributor === void 0 ? false : _ref5$showContributor,
|
|
194
188
|
_ref5$showIndicators = _ref5.showIndicators,
|
|
195
189
|
showIndicators = _ref5$showIndicators === void 0 ? false : _ref5$showIndicators,
|
|
196
|
-
diffType = _ref5.diffType,
|
|
197
190
|
_ref5$coarseTableCell = _ref5.coarseTableCellsOnly,
|
|
198
191
|
coarseTableCellsOnly = _ref5$coarseTableCell === void 0 ? false : _ref5$coarseTableCell,
|
|
199
192
|
tagMountContext = _ref5.tagMountContext,
|
|
@@ -230,7 +223,6 @@ var calculateNodesForBlockDecoration = function calculateNodesForBlockDecoration
|
|
|
230
223
|
showContributorTags: showContributorTags,
|
|
231
224
|
showIndicators: showIndicators,
|
|
232
225
|
doc: doc,
|
|
233
|
-
diffType: diffType,
|
|
234
226
|
tagMountContext: tagMountContext
|
|
235
227
|
})));
|
|
236
228
|
}
|
|
@@ -257,7 +249,7 @@ var calculateNodesForBlockDecoration = function calculateNodesForBlockDecoration
|
|
|
257
249
|
return;
|
|
258
250
|
}
|
|
259
251
|
}
|
|
260
|
-
if (node.isBlock && (!
|
|
252
|
+
if (node.isBlock && (!requireContainedBlocks || pos >= from) && pos + node.nodeSize <= to) {
|
|
261
253
|
var _nodeEnd = pos + node.nodeSize;
|
|
262
254
|
var _isActive = isRangeActive(activeIndexPos, pos, _nodeEnd);
|
|
263
255
|
decorations.push.apply(decorations, _toConsumableArray(createBlockChangedDecoration({
|
|
@@ -275,7 +267,6 @@ var calculateNodesForBlockDecoration = function calculateNodesForBlockDecoration
|
|
|
275
267
|
showContributorTags: showContributorTags,
|
|
276
268
|
showIndicators: showIndicators,
|
|
277
269
|
doc: doc,
|
|
278
|
-
diffType: diffType,
|
|
279
270
|
tagMountContext: tagMountContext
|
|
280
271
|
})));
|
|
281
272
|
}
|
|
@@ -324,10 +315,9 @@ export var isDeletedContentPlacedBelow = function isDeletedContentPlacedBelow(_r
|
|
|
324
315
|
*/
|
|
325
316
|
var shouldHideDeletedSide = function shouldHideDeletedSide(_ref7) {
|
|
326
317
|
var change = _ref7.change,
|
|
327
|
-
diffType = _ref7.diffType,
|
|
328
318
|
hideDeletedDiffs = _ref7.hideDeletedDiffs,
|
|
329
319
|
isInverted = _ref7.isInverted;
|
|
330
|
-
return
|
|
320
|
+
return !isInverted && !!hideDeletedDiffs && (change.inserted.length > 0 || fg('platform_editor_diff_hide_pure_deletions') && UNSAFE_expValNoExposure('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false) === true);
|
|
331
321
|
};
|
|
332
322
|
var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8) {
|
|
333
323
|
var state = _ref8.state,
|
|
@@ -486,7 +476,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
486
476
|
stepIndex: stepIndex
|
|
487
477
|
});
|
|
488
478
|
}));
|
|
489
|
-
attributedChanges =
|
|
479
|
+
attributedChanges = diffType === 'step' ? diffBySteps(originalDoc, simplifiedSteps, simplifiedStepAttributions) : _toConsumableArray(changeset.changes);
|
|
490
480
|
// The attributed pipeline gives no guarantee that its output ranges are disjoint — see
|
|
491
481
|
// `collapseOverlappingChanges`.
|
|
492
482
|
var uncollapsedChanges = getAttributedChanges({
|
|
@@ -521,15 +511,13 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
521
511
|
/**
|
|
522
512
|
* If showIndicators is on, we create an anchor widget here to mark the doc margin.
|
|
523
513
|
*/
|
|
524
|
-
if (showIndicators
|
|
514
|
+
if (showIndicators) {
|
|
525
515
|
decorations.push(createDocMarginAnchorWidget());
|
|
526
516
|
}
|
|
527
517
|
|
|
528
518
|
// Our default operations are insertions, so it should match the opposite of isInverted.
|
|
529
519
|
var isInserted = !isInverted;
|
|
530
|
-
|
|
531
|
-
changes = groupDeletedColumnChanges(changes, originalDoc, tr.doc, new Mapping(stepMaps), isInverted);
|
|
532
|
-
}
|
|
520
|
+
changes = groupDeletedColumnChanges(changes, originalDoc, tr.doc, new Mapping(stepMaps), isInverted);
|
|
533
521
|
// A whole-table change owns every mark and attribute range inside its bounds, so those ranges
|
|
534
522
|
// do not also get their own decoration.
|
|
535
523
|
var tableChanges = changes.filter(function (change) {
|
|
@@ -594,7 +582,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
594
582
|
});
|
|
595
583
|
if (change.inserted.length > 0) {
|
|
596
584
|
// On an inverted diff the inserted side is visually the deleted side.
|
|
597
|
-
var shouldHideDeleted =
|
|
585
|
+
var shouldHideDeleted = isInverted && hideDeletedDiffs;
|
|
598
586
|
|
|
599
587
|
// A removed blank line — an empty paragraph or heading — has nothing to mark up. On an
|
|
600
588
|
// inverted diff, the shape AI suggested edits renders, the block is still in the displayed
|
|
@@ -617,7 +605,6 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
617
605
|
decorations.push(createDeletedLineBreakDecoration({
|
|
618
606
|
attributionKey: attributionKey,
|
|
619
607
|
colorScheme: changeColorScheme,
|
|
620
|
-
diffType: diffType,
|
|
621
608
|
isActive: isActive,
|
|
622
609
|
pos: pos,
|
|
623
610
|
reveal: reveal,
|
|
@@ -652,7 +639,6 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
652
639
|
// boundary to keep the indicator bar continuous with the deleted content.
|
|
653
640
|
var willRenderDeletedWidget = change.deleted.length > 0 && !isMarkOnly && !shouldHideDeletedSide({
|
|
654
641
|
change: change,
|
|
655
|
-
diffType: diffType,
|
|
656
642
|
hideDeletedDiffs: hideDeletedDiffs,
|
|
657
643
|
isInverted: isInverted
|
|
658
644
|
});
|
|
@@ -671,7 +657,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
671
657
|
if (useCoarseTableDecoration && isInsideTable(coarseTables, from)) {
|
|
672
658
|
continue;
|
|
673
659
|
}
|
|
674
|
-
decorations.push.apply(decorations, _toConsumableArray(createInlineChangedDecoration(
|
|
660
|
+
decorations.push.apply(decorations, _toConsumableArray(createInlineChangedDecoration({
|
|
675
661
|
attributionKey: attributionKey,
|
|
676
662
|
change: {
|
|
677
663
|
fromB: from,
|
|
@@ -681,8 +667,6 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
681
667
|
doc: tr.doc,
|
|
682
668
|
colorScheme: changeColorScheme,
|
|
683
669
|
isActive: isActive,
|
|
684
|
-
diffType: diffType
|
|
685
|
-
}, isExtendedEnabled(diffType) && {
|
|
686
670
|
isInserted: isInserted,
|
|
687
671
|
shouldHideDeleted: shouldHideDeleted,
|
|
688
672
|
showContributorTags: showContributorTags,
|
|
@@ -692,7 +676,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
692
676
|
isDeletedWidgetBelow: isDeletedWidgetBelow,
|
|
693
677
|
reveal: reveal,
|
|
694
678
|
tagMountContext: tagMountContext
|
|
695
|
-
})))
|
|
679
|
+
})));
|
|
696
680
|
}
|
|
697
681
|
} catch (err) {
|
|
698
682
|
_iterator4.e(err);
|
|
@@ -700,15 +684,13 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
700
684
|
_iterator4.f();
|
|
701
685
|
}
|
|
702
686
|
} else {
|
|
703
|
-
decorations.push.apply(decorations, _toConsumableArray(createInlineChangedDecoration(
|
|
687
|
+
decorations.push.apply(decorations, _toConsumableArray(createInlineChangedDecoration({
|
|
704
688
|
attributionKey: attributionKey,
|
|
705
689
|
change: change,
|
|
706
690
|
leftAnchorId: leftAnchorId,
|
|
707
691
|
doc: tr.doc,
|
|
708
692
|
colorScheme: changeColorScheme,
|
|
709
693
|
isActive: isActive,
|
|
710
|
-
diffType: diffType
|
|
711
|
-
}, isExtendedEnabled(diffType) && {
|
|
712
694
|
isInserted: isInserted,
|
|
713
695
|
shouldHideDeleted: shouldHideDeleted,
|
|
714
696
|
showContributorTags: showContributorTags,
|
|
@@ -718,45 +700,39 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
718
700
|
isDeletedWidgetBelow: isDeletedWidgetBelow,
|
|
719
701
|
reveal: reveal,
|
|
720
702
|
tagMountContext: tagMountContext
|
|
721
|
-
})))
|
|
703
|
+
})));
|
|
722
704
|
}
|
|
723
|
-
decorations.push.apply(decorations, _toConsumableArray(calculateNodesForBlockDecoration(
|
|
705
|
+
decorations.push.apply(decorations, _toConsumableArray(calculateNodesForBlockDecoration({
|
|
724
706
|
attributionKey: attributionKey,
|
|
725
707
|
doc: tr.doc,
|
|
726
708
|
from: change.fromB,
|
|
727
709
|
to: change.toB,
|
|
728
710
|
// A split piece's own range no longer covers the container it opened (EDITOR-8932).
|
|
729
711
|
nodeRanges: change.blockNodeRangesB,
|
|
730
|
-
colorScheme: changeColorScheme
|
|
731
|
-
}, isExtendedEnabled(diffType) && {
|
|
712
|
+
colorScheme: changeColorScheme,
|
|
732
713
|
isInserted: isInserted,
|
|
733
714
|
shouldHideDeleted: shouldHideDeleted,
|
|
734
715
|
showContributorTags: showContributorTags,
|
|
735
716
|
showIndicators: showIndicators,
|
|
736
|
-
tagMountContext: tagMountContext
|
|
737
|
-
}), {}, {
|
|
717
|
+
tagMountContext: tagMountContext,
|
|
738
718
|
activeIndexPos: activeIndexPos,
|
|
739
719
|
intl: intl,
|
|
740
|
-
diffType: diffType,
|
|
741
720
|
coarseTableCellsOnly: useCoarseTableDecoration,
|
|
742
721
|
leftAnchorId: leftAnchorId
|
|
743
|
-
})))
|
|
722
|
+
})));
|
|
744
723
|
}
|
|
745
724
|
if (change.deleted.length > 0 && !isMarkOnly && !hasNoDeletedContent) {
|
|
746
725
|
var _shouldHideDeleted = shouldHideDeletedSide({
|
|
747
726
|
change: change,
|
|
748
|
-
diffType: diffType,
|
|
749
727
|
hideDeletedDiffs: hideDeletedDiffs,
|
|
750
728
|
isInverted: isInverted
|
|
751
729
|
});
|
|
752
730
|
if (!_shouldHideDeleted) {
|
|
753
|
-
decorations.push.apply(decorations, _toConsumableArray(createNodeChangedDecorationWidget(
|
|
731
|
+
decorations.push.apply(decorations, _toConsumableArray(createNodeChangedDecorationWidget({
|
|
754
732
|
deletedColumns: deletedColumns,
|
|
755
733
|
// The deleted side has no inline decoration, so the widget carries the actor.
|
|
756
734
|
attributionKey: attributionKey,
|
|
757
|
-
|
|
758
|
-
// background for the wipe to act on.
|
|
759
|
-
reveal: isExtendedEnabled(diffType) ? reveal : undefined,
|
|
735
|
+
reveal: reveal,
|
|
760
736
|
change: change,
|
|
761
737
|
doc: originalDoc,
|
|
762
738
|
nodeViewSerializer: nodeViewSerializer,
|
|
@@ -766,15 +742,12 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
766
742
|
activeIndexPos: activeIndexPos,
|
|
767
743
|
leftAnchorId: leftAnchorId,
|
|
768
744
|
showContributorTags: showContributorTags,
|
|
769
|
-
tagMountContext: tagMountContext
|
|
770
|
-
}, isExtendedEnabled(diffType) && {
|
|
745
|
+
tagMountContext: tagMountContext,
|
|
771
746
|
isInserted: !isInserted,
|
|
772
|
-
diffType: diffType,
|
|
773
747
|
hideAddedDiffsUnderline: hideAddedDiffsUnderline,
|
|
774
|
-
placeBelow: isDeletedWidgetBelow
|
|
775
|
-
}), {}, {
|
|
748
|
+
placeBelow: isDeletedWidgetBelow,
|
|
776
749
|
showIndicators: showIndicators
|
|
777
|
-
})))
|
|
750
|
+
})));
|
|
778
751
|
}
|
|
779
752
|
}
|
|
780
753
|
};
|
|
@@ -805,7 +778,6 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
805
778
|
change: change,
|
|
806
779
|
colorScheme: changeColorScheme,
|
|
807
780
|
doc: tr.doc,
|
|
808
|
-
diffType: diffType,
|
|
809
781
|
isActive: isActive,
|
|
810
782
|
isInserted: true,
|
|
811
783
|
reveal: reveal,
|
|
@@ -843,8 +815,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
843
815
|
tagMountContext: tagMountContext,
|
|
844
816
|
// Suppress the border-bottom underline for atomic inline nodeviews —
|
|
845
817
|
// it doesn't render on custom nodeview DOM elements and is unnecessary noise.
|
|
846
|
-
hideAddedDiffsUnderline: true
|
|
847
|
-
diffType: diffType
|
|
818
|
+
hideAddedDiffsUnderline: true
|
|
848
819
|
})));
|
|
849
820
|
// If we have the original node position, also render the old node as a "deleted" widget
|
|
850
821
|
// so the user can see what it looked like before the change.
|
|
@@ -888,7 +859,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
888
859
|
var isSmartNodeLevelAttrChange = diffType === 'smart' && fg('platform_editor_ai_smart_diff') && expValEqualsNoExposure('platform_editor_ai_xstate_migration', 'isEnabled', true) && UNSAFE_expValNoExposure('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false) === true;
|
|
889
860
|
if (isSmartNodeLevelAttrChange && change.fromA !== undefined && change.toA !== undefined) {
|
|
890
861
|
var placeBelow = deletedDiffPlacement === 'bottom';
|
|
891
|
-
decorations.push.apply(decorations, _toConsumableArray(createNodeChangedDecorationWidget(
|
|
862
|
+
decorations.push.apply(decorations, _toConsumableArray(createNodeChangedDecorationWidget({
|
|
892
863
|
change: {
|
|
893
864
|
fromA: change.fromA,
|
|
894
865
|
toA: change.toA,
|
|
@@ -903,16 +874,13 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
903
874
|
newDoc: tr.doc,
|
|
904
875
|
intl: intl,
|
|
905
876
|
activeIndexPos: activeIndexPos,
|
|
906
|
-
isInserted: false
|
|
907
|
-
}, isExtendedEnabled(diffType) && {
|
|
908
|
-
diffType: diffType,
|
|
877
|
+
isInserted: false,
|
|
909
878
|
hideAddedDiffsUnderline: hideAddedDiffsUnderline,
|
|
910
|
-
placeBelow: placeBelow
|
|
911
|
-
}), {}, {
|
|
879
|
+
placeBelow: placeBelow,
|
|
912
880
|
showIndicators: showIndicators,
|
|
913
881
|
showContributorTags: showContributorTags,
|
|
914
882
|
tagMountContext: tagMountContext
|
|
915
|
-
})))
|
|
883
|
+
})));
|
|
916
884
|
}
|
|
917
885
|
}
|
|
918
886
|
});
|
|
@@ -921,7 +889,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
921
889
|
contributorTags: showContributorTags ? extractContributorTags(decorationSet, contributors, activeIndexPos,
|
|
922
890
|
// The stops the step buttons walk, so a stop cannot hold a second tag for one
|
|
923
891
|
// contributor that navigation can never reach.
|
|
924
|
-
getScrollableDecorations(decorationSet, tr.doc
|
|
892
|
+
getScrollableDecorations(decorationSet, tr.doc)) : [],
|
|
925
893
|
decorations: decorationSet,
|
|
926
894
|
diffDescriptors: extractDiffDescriptors(decorationSet)
|
|
927
895
|
};
|
|
@@ -930,7 +898,7 @@ export var calculateDiffDecorations = memoizeOne(calculateDiffDecorationsInner,
|
|
|
930
898
|
// Cache results unless relevant inputs change. `tagMountContext` is deliberately absent: it is
|
|
931
899
|
// built once per plugin instance, so it can never be the reason a diff needs recalculating.
|
|
932
900
|
function (_ref14, _ref15) {
|
|
933
|
-
var
|
|
901
|
+
var _ref18;
|
|
934
902
|
var _ref16 = _slicedToArray(_ref14, 1),
|
|
935
903
|
_ref16$ = _ref16[0],
|
|
936
904
|
pluginState = _ref16$.pluginState,
|
|
@@ -964,14 +932,10 @@ function (_ref14, _ref15) {
|
|
|
964
932
|
lastInlineDeletedDiffPlacement = _ref17$.inlineDeletedDiffPlacement,
|
|
965
933
|
lastReveal = _ref17$.reveal;
|
|
966
934
|
var originalDocIsSame = lastPluginState.originalDoc && pluginState.originalDoc && pluginState.originalDoc.eq(lastPluginState.originalDoc);
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
// other setting would leave the diff painted in the wrong resting state.
|
|
974
|
-
isEqual(reveal, lastReveal)) !== null && _ref18 !== void 0 ? _ref18 : false;
|
|
975
|
-
}
|
|
976
|
-
return (_ref19 = originalDocIsSame && isEqual(pluginState.steps, lastPluginState.steps) && isEqual(pluginState.stepAttributions, lastPluginState.stepAttributions) && isEqual(pluginState.contributors, lastPluginState.contributors) && state.doc.eq(lastState.doc) && colorScheme === lastColorScheme && intl.locale === lastIntl.locale && isEqual(activeIndexPos, lastActiveIndexPos) && hideDeletedDiffs === lastHideDeletedDiffs) !== null && _ref19 !== void 0 ? _ref19 : false;
|
|
935
|
+
return (_ref18 = colorScheme === lastColorScheme && intl.locale === lastIntl.locale && isInverted === lastIsInverted && diffType === lastDiffType && isEqual(activeIndexPos, lastActiveIndexPos) && originalDocIsSame && isEqual(pluginState.steps, lastPluginState.steps) && isEqual(pluginState.stepAttributions, lastPluginState.stepAttributions) &&
|
|
936
|
+
// Contributors can arrive after the first calculation; without this, tags never appear.
|
|
937
|
+
isEqual(pluginState.contributors, lastPluginState.contributors) && state.doc.eq(lastState.doc) && hideDeletedDiffs === lastHideDeletedDiffs && hideAddedDiffsUnderline === lastHideAddedDiffsUnderline && showIndicators === lastShowIndicators && isEqual(smartThresholds, lastSmartThresholds) && deletedDiffPlacement === lastDeletedDiffPlacement && inlineDeletedDiffPlacement === lastInlineDeletedDiffPlacement &&
|
|
938
|
+
// Turning the reveal on or off changes the emitted styles, so a cached result from the
|
|
939
|
+
// other setting would leave the diff painted in the wrong resting state.
|
|
940
|
+
isEqual(reveal, lastReveal)) !== null && _ref18 !== void 0 ? _ref18 : false;
|
|
977
941
|
});
|
|
@@ -833,7 +833,7 @@ export function buildDeletedCellOverlayRoundedStyle(colors) {
|
|
|
833
833
|
// --- Inline content style dispatch ---
|
|
834
834
|
|
|
835
835
|
/**
|
|
836
|
-
* Inserted inline content
|
|
836
|
+
* Inserted inline content. `insertedInlineTreatment` picks
|
|
837
837
|
* `text-decoration` vs a `border-bottom` rule; only the latter honours `hideAddedDiffsUnderline`.
|
|
838
838
|
*/
|
|
839
839
|
export function buildInsertedInlineStyle(colors, isActive, hideAddedDiffsUnderline) {
|
|
@@ -3,32 +3,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
5
5
|
import { getStandardDeletedTextDecorationStyle } from './getStandardDeletedTextDecorationStyle';
|
|
6
|
-
|
|
7
|
-
// delete on platform_editor_diff_plugin_extended cleanup
|
|
8
|
-
export var editingStyle = convertToInlineCss({
|
|
9
|
-
background: "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
|
|
10
|
-
textDecoration: 'underline',
|
|
11
|
-
textDecorationStyle: 'dotted',
|
|
12
|
-
textDecorationThickness: "var(--ds-space-025, 2px)",
|
|
13
|
-
textDecorationColor: "var(--ds-border-accent-purple, #AF59E1)"
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
// delete on platform_editor_diff_plugin_extended cleanup
|
|
17
|
-
export var editingContentStyleInBlock = convertToInlineCss({
|
|
18
|
-
textDecoration: 'underline',
|
|
19
|
-
textDecorationStyle: 'dotted',
|
|
20
|
-
textDecorationThickness: "var(--ds-space-025, 2px)",
|
|
21
|
-
textDecorationColor: "var(--ds-border-accent-purple, #AF59E1)"
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// delete on platform_editor_diff_plugin_extended cleanup
|
|
25
|
-
export var editingStyleActive = convertToInlineCss({
|
|
26
|
-
background: "var(--ds-background-accent-purple-subtler-pressed, #D8A0F7)",
|
|
27
|
-
textDecoration: 'underline',
|
|
28
|
-
textDecorationStyle: 'dotted',
|
|
29
|
-
textDecorationThickness: "var(--ds-space-025, 2px)",
|
|
30
|
-
textDecorationColor: "var(--ds-text-accent-purple, #803FA5)"
|
|
31
|
-
});
|
|
32
6
|
export var editingStyleExtended = convertToInlineCss({
|
|
33
7
|
background: "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
|
|
34
8
|
borderBottom: "2px solid ".concat("var(--ds-border-accent-purple, #AF59E1)"),
|
|
@@ -7,7 +7,6 @@ import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
|
7
7
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
|
-
import { isExtendedEnabled } from '../isExtendedEnabled';
|
|
11
10
|
import { isTaggableBlockNode } from '../utils/taggableBlockNodes';
|
|
12
11
|
import { buildAddedCellOverlayRoundedStyle, buildAddedCellOverlayStyle, buildDeletedBlockNodeStyle, buildDeletedCellOverlayRoundedStyle, buildDeletedCellOverlayStyle, buildInsertedBlockNodeStyle } from './colorSchemes/factory';
|
|
13
12
|
import { colorSchemeRegistry, getLegacyColorScheme } from './colorSchemes/schemes';
|
|
@@ -44,10 +43,9 @@ var isInsideTable = function isInsideTable(doc, pos) {
|
|
|
44
43
|
*/
|
|
45
44
|
var canTagBlock = function canTagBlock(_ref) {
|
|
46
45
|
var _doc$nodeAt;
|
|
47
|
-
var
|
|
48
|
-
doc = _ref.doc,
|
|
46
|
+
var doc = _ref.doc,
|
|
49
47
|
from = _ref.from;
|
|
50
|
-
if (doc === undefined
|
|
48
|
+
if (doc === undefined) {
|
|
51
49
|
return false;
|
|
52
50
|
}
|
|
53
51
|
var nodeType = (_doc$nodeAt = doc.nodeAt(from)) === null || _doc$nodeAt === void 0 ? void 0 : _doc$nodeAt.type;
|
|
@@ -106,19 +104,15 @@ var getBlockNodeStyleNext = function getBlockNodeStyleNext(_ref2) {
|
|
|
106
104
|
_ref2$isInserted = _ref2.isInserted,
|
|
107
105
|
isInserted = _ref2$isInserted === void 0 ? true : _ref2$isInserted,
|
|
108
106
|
_ref2$isActive = _ref2.isActive,
|
|
109
|
-
isActive = _ref2$isActive === void 0 ? false : _ref2$isActive
|
|
110
|
-
diffType = _ref2.diffType;
|
|
107
|
+
isActive = _ref2$isActive === void 0 ? false : _ref2$isActive;
|
|
111
108
|
if (UNSTYLED_NODES.includes(nodeName)) {
|
|
112
109
|
return undefined;
|
|
113
110
|
}
|
|
114
111
|
if (CELL_NODES.includes(nodeName)) {
|
|
115
|
-
|
|
116
|
-
return isExtendedEnabled(diffType) ? cellPositionStyle : undefined;
|
|
112
|
+
return cellPositionStyle;
|
|
117
113
|
}
|
|
118
114
|
var colors = colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : DEFAULT_COLOR_SCHEME];
|
|
119
|
-
|
|
120
|
-
// Deleted nodes only differ under the extended experience; otherwise all are insertions.
|
|
121
|
-
if (!isInserted && isExtendedEnabled(diffType)) {
|
|
115
|
+
if (!isInserted) {
|
|
122
116
|
return buildDeletedBlockNodeStyle(colors, getDeletedBlockNodeCategory(nodeName), isActive);
|
|
123
117
|
}
|
|
124
118
|
return buildInsertedBlockNodeStyle(colors, getInsertedBlockNodeShape(nodeName), isActive);
|
|
@@ -185,14 +179,12 @@ export var createBlockChangedDecoration = function createBlockChangedDecoration(
|
|
|
185
179
|
_ref3$showIndicators = _ref3.showIndicators,
|
|
186
180
|
showIndicators = _ref3$showIndicators === void 0 ? false : _ref3$showIndicators,
|
|
187
181
|
doc = _ref3.doc,
|
|
188
|
-
diffType = _ref3.diffType,
|
|
189
182
|
tagMountContext = _ref3.tagMountContext;
|
|
190
183
|
var decorations = [];
|
|
191
184
|
// Derived from the node range so it survives a recalculation, as in
|
|
192
185
|
// `createInlineChangedDecoration`. Changes are disjoint, so no two of them decorate one node.
|
|
193
186
|
var diffId = showContributorTags ? "block-".concat(change.from, "-").concat(change.to) : crypto.randomUUID();
|
|
194
187
|
var shouldTagBlock = showContributorTags && canTagBlock({
|
|
195
|
-
diffType: diffType,
|
|
196
188
|
doc: doc,
|
|
197
189
|
from: change.from
|
|
198
190
|
});
|
|
@@ -211,11 +203,10 @@ export var createBlockChangedDecoration = function createBlockChangedDecoration(
|
|
|
211
203
|
leftAnchorId: leftAnchorId,
|
|
212
204
|
isActive: isActive,
|
|
213
205
|
isInserted: isInserted,
|
|
214
|
-
nodeName: change.name
|
|
215
|
-
diffType: diffType
|
|
206
|
+
nodeName: change.name
|
|
216
207
|
}))];
|
|
217
208
|
}
|
|
218
|
-
if (
|
|
209
|
+
if (CELL_NODES.includes(change.name)) {
|
|
219
210
|
var cellOverlay = document.createElement('div');
|
|
220
211
|
var colors = colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : DEFAULT_COLOR_SCHEME];
|
|
221
212
|
var isRoundedTable = isExperimentEnabled('platform_editor_table_diff_rounded_corners');
|
|
@@ -239,15 +230,13 @@ export var createBlockChangedDecoration = function createBlockChangedDecoration(
|
|
|
239
230
|
key: 'cell-overlay-decoration'
|
|
240
231
|
}));
|
|
241
232
|
}
|
|
242
|
-
//
|
|
243
|
-
//
|
|
244
|
-
// variant's legacy style is untouched — see `resolveBaseNodeName`.
|
|
233
|
+
// `change.name` verbatim: base-name resolution stays in `canTagBlock`, which needs tags on, so a
|
|
234
|
+
// schema variant's legacy style is untouched — see `resolveBaseNodeName`.
|
|
245
235
|
var nodeStyle = getBlockNodeStyle({
|
|
246
236
|
nodeName: change.name,
|
|
247
237
|
colorScheme: colorScheme,
|
|
248
238
|
isInserted: isInserted,
|
|
249
|
-
isActive: isActive
|
|
250
|
-
diffType: diffType
|
|
239
|
+
isActive: isActive
|
|
251
240
|
});
|
|
252
241
|
var style = tagAnchorName ? [nodeStyle, convertToInlineCss({
|
|
253
242
|
anchorName: "--".concat(tagAnchorName)
|
|
@@ -268,8 +257,7 @@ export var createBlockChangedDecoration = function createBlockChangedDecoration(
|
|
|
268
257
|
leftAnchorId: leftAnchorId,
|
|
269
258
|
isActive: isActive,
|
|
270
259
|
isInserted: isInserted,
|
|
271
|
-
nodeName: change.name
|
|
272
|
-
diffType: diffType
|
|
260
|
+
nodeName: change.name
|
|
273
261
|
})));
|
|
274
262
|
}
|
|
275
263
|
if (decorations.length === 0) {
|
|
@@ -277,7 +265,7 @@ export var createBlockChangedDecoration = function createBlockChangedDecoration(
|
|
|
277
265
|
// there is nothing for a tag to hang off even when the node type would otherwise be taggable.
|
|
278
266
|
return decorations;
|
|
279
267
|
}
|
|
280
|
-
if (showIndicators && doc
|
|
268
|
+
if (showIndicators && doc) {
|
|
281
269
|
decorations.push.apply(decorations, _toConsumableArray(createBlockIndicatorAnchorWidgets({
|
|
282
270
|
doc: doc,
|
|
283
271
|
from: change.from,
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* cleanup, together with `colorSchemes/standard.ts`, `colorSchemes/traditional.ts` (EDITOR-8281).
|
|
10
10
|
*/
|
|
11
11
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
12
|
-
import { isExtendedEnabled } from '../isExtendedEnabled';
|
|
13
12
|
import { standardDecorationMarkerVariable, deletedDecorationMarkerVariable, editingStyleQuoteNode, editingStyleRuleNode, editingStyleCardBlockNode, editingStyleNode, getStandardDeletedContentStyleNew, deletedStyleQuoteNode, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from './colorSchemes/standard';
|
|
14
13
|
import { traditionalDecorationMarkerVariableActive, traditionalDecorationMarkerVariableNew, traditionalDeletedDecorationMarkerVariableActive, traditionalDeletedDecorationMarkerVariableNew, traditionalStyleQuoteNodeActive, traditionalStyleQuoteNodeNew, traditionalStyleRuleNodeActive, traditionalStyleRuleNodeNew, traditionalStyleCardBlockNodeActive, traditionalStyleCardBlockNodeNew, traditionalStyleNodeActive, traditionalStyleNodeNew, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, traditionalAddedCellOverlayStyle, traditionalAddedCellOverlayRoundedStyle, deletedTraditionalCellOverlayStyle, deletedTraditionalCellOverlayRoundedStyle } from './colorSchemes/traditional';
|
|
15
14
|
|
|
@@ -29,8 +28,7 @@ export var getBlockNodeStyleLegacy = function getBlockNodeStyleLegacy(_ref2) {
|
|
|
29
28
|
_ref2$isInserted = _ref2.isInserted,
|
|
30
29
|
isInserted = _ref2$isInserted === void 0 ? true : _ref2$isInserted,
|
|
31
30
|
_ref2$isActive = _ref2.isActive,
|
|
32
|
-
isActive = _ref2$isActive === void 0 ? false : _ref2$isActive
|
|
33
|
-
diffType = _ref2.diffType;
|
|
31
|
+
isActive = _ref2$isActive === void 0 ? false : _ref2$isActive;
|
|
34
32
|
var isTraditional = colorScheme === 'traditional';
|
|
35
33
|
if (['mediaSingle', 'mediaGroup', 'table',
|
|
36
34
|
// Handle table separately to avoid border issues
|
|
@@ -42,77 +40,47 @@ export var getBlockNodeStyleLegacy = function getBlockNodeStyleLegacy(_ref2) {
|
|
|
42
40
|
}
|
|
43
41
|
// Media nodes inside mediaSingle should not get position:relative
|
|
44
42
|
// as it shifts the image outside its parent container (e.g. panel)
|
|
45
|
-
if (nodeName === 'media') {
|
|
46
|
-
if (!isInserted
|
|
43
|
+
if (nodeName === 'media' || nodeName === 'panel') {
|
|
44
|
+
if (!isInserted) {
|
|
47
45
|
return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedDecorationMarkerVariable;
|
|
48
46
|
}
|
|
49
47
|
return isTraditional ? isActive ? traditionalStyleNodeActive : traditionalStyleNodeNew : editingStyleNode;
|
|
50
48
|
}
|
|
51
49
|
if (['tableCell', 'tableHeader'].includes(nodeName)) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
// When gate is off, it should return undefined as above
|
|
59
|
-
return undefined;
|
|
60
|
-
}
|
|
61
|
-
if (nodeName === 'panel') {
|
|
62
|
-
if (!isInserted && isExtendedEnabled(diffType)) {
|
|
63
|
-
return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedDecorationMarkerVariable;
|
|
64
|
-
}
|
|
65
|
-
return isTraditional ? isActive ? traditionalStyleNodeActive : traditionalStyleNodeNew : editingStyleNode;
|
|
50
|
+
// This is used for positioning the cell overlay widget decorations
|
|
51
|
+
return convertToInlineCss({
|
|
52
|
+
position: 'relative'
|
|
53
|
+
});
|
|
66
54
|
}
|
|
67
55
|
if (['extension', 'embedCard', 'listItem'].includes(nodeName)) {
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
return isTraditional && isActive ? traditionalDecorationMarkerVariableActive : isTraditional ? traditionalDecorationMarkerVariableNew : standardDecorationMarkerVariable;
|
|
71
|
-
} else {
|
|
72
|
-
if (nodeName === 'listItem') {
|
|
73
|
-
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : deletedDecorationMarkerVariable;
|
|
74
|
-
}
|
|
75
|
-
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : getStandardDeletedContentStyleNew();
|
|
76
|
-
}
|
|
56
|
+
if (isInserted) {
|
|
57
|
+
return isTraditional && isActive ? traditionalDecorationMarkerVariableActive : isTraditional ? traditionalDecorationMarkerVariableNew : standardDecorationMarkerVariable;
|
|
77
58
|
}
|
|
78
|
-
|
|
59
|
+
if (nodeName === 'listItem') {
|
|
60
|
+
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : deletedDecorationMarkerVariable;
|
|
61
|
+
}
|
|
62
|
+
return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : getStandardDeletedContentStyleNew();
|
|
79
63
|
}
|
|
80
64
|
if (nodeName === 'blockquote') {
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
return isTraditional ? isActive ? traditionalStyleQuoteNodeActive : traditionalStyleQuoteNodeNew : editingStyleQuoteNode;
|
|
84
|
-
} else {
|
|
85
|
-
return isTraditional ? deletedTraditionalStyleQuoteNode : deletedStyleQuoteNode;
|
|
86
|
-
}
|
|
65
|
+
if (isInserted) {
|
|
66
|
+
return isTraditional ? isActive ? traditionalStyleQuoteNodeActive : traditionalStyleQuoteNodeNew : editingStyleQuoteNode;
|
|
87
67
|
}
|
|
88
|
-
return isTraditional ?
|
|
68
|
+
return isTraditional ? deletedTraditionalStyleQuoteNode : deletedStyleQuoteNode;
|
|
89
69
|
}
|
|
90
70
|
if (nodeName === 'rule') {
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
return isTraditional ? isActive ? traditionalStyleRuleNodeActive : traditionalStyleRuleNodeNew : editingStyleRuleNode;
|
|
94
|
-
} else {
|
|
95
|
-
return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
|
|
96
|
-
}
|
|
71
|
+
if (isInserted) {
|
|
72
|
+
return isTraditional ? isActive ? traditionalStyleRuleNodeActive : traditionalStyleRuleNodeNew : editingStyleRuleNode;
|
|
97
73
|
}
|
|
98
|
-
return isTraditional ?
|
|
74
|
+
return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
|
|
99
75
|
}
|
|
100
76
|
if (nodeName === 'blockCard') {
|
|
101
|
-
if (isExtendedEnabled(diffType)) {
|
|
102
|
-
if (isInserted) {
|
|
103
|
-
return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : traditionalStyleCardBlockNodeNew : editingStyleCardBlockNode;
|
|
104
|
-
} else {
|
|
105
|
-
return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : traditionalStyleCardBlockNodeNew : editingStyleCardBlockNode;
|
|
109
|
-
}
|
|
110
|
-
if (isExtendedEnabled(diffType)) {
|
|
111
77
|
if (isInserted) {
|
|
112
|
-
return isTraditional ? isActive ?
|
|
113
|
-
} else {
|
|
114
|
-
return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
|
|
78
|
+
return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : traditionalStyleCardBlockNodeNew : editingStyleCardBlockNode;
|
|
115
79
|
}
|
|
80
|
+
return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
|
|
81
|
+
}
|
|
82
|
+
if (isInserted) {
|
|
83
|
+
return isTraditional ? isActive ? traditionalStyleNodeActive : traditionalStyleNodeNew : editingStyleNode;
|
|
116
84
|
}
|
|
117
|
-
return isTraditional ?
|
|
85
|
+
return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
|
|
118
86
|
};
|