@atlaskit/editor-plugin-show-diff 17.0.1 → 17.1.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/CHANGELOG.md +27 -0
- package/dist/cjs/entry-points/show-diff-plugin-type.js +12 -1
- package/dist/cjs/pm-plugins/NodeViewSerializer.js +1 -1
- package/dist/cjs/pm-plugins/calculateDiff/calculateDiffDecorations.js +128 -51
- package/dist/cjs/pm-plugins/calculateDiff/groupDeletedColumnChanges.js +265 -0
- package/dist/cjs/pm-plugins/decorations/colorSchemes/attributions.js +14 -3
- package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.js +1 -1
- package/dist/cjs/pm-plugins/decorations/createChangedRowDecorationWidgets.js +100 -34
- package/dist/cjs/pm-plugins/decorations/createContributorTagWidget.js +18 -13
- package/dist/cjs/pm-plugins/decorations/createNodeChangedDecorationWidget.js +82 -20
- package/dist/cjs/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +106 -0
- package/dist/cjs/pm-plugins/decorations/utils/tableDiffMode.js +36 -0
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeView.js +19 -8
- package/dist/cjs/pm-plugins/resolveDiffContributors.js +4 -3
- package/dist/cjs/pm-plugins/utils/emptyTextBlocks.js +66 -0
- package/dist/cjs/showDiffPluginType.js +87 -1
- package/dist/cjs/ui/ContributorTag/contributorAvatarRenderer.js +22 -14
- package/dist/cjs/ui/ContributorTag/contributorTagIcons.js +4 -0
- package/dist/es2019/entry-points/calculate-diff.js +1 -0
- package/dist/es2019/entry-points/show-diff-plugin-type.js +3 -0
- package/dist/es2019/entry-points/show-diff-plugin.js +1 -0
- package/dist/es2019/pm-plugins/NodeViewSerializer.js +1 -1
- package/dist/es2019/pm-plugins/calculateDiff/calculateDiffDecorations.js +63 -3
- package/dist/es2019/pm-plugins/calculateDiff/groupDeletedColumnChanges.js +210 -0
- package/dist/es2019/pm-plugins/decorations/colorSchemes/attributions.js +12 -3
- package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +0 -1
- package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.js +1 -1
- package/dist/es2019/pm-plugins/decorations/createChangedRowDecorationWidgets.js +79 -13
- package/dist/es2019/pm-plugins/decorations/createContributorTagWidget.js +8 -2
- package/dist/es2019/pm-plugins/decorations/createNodeChangedDecorationWidget.js +85 -15
- package/dist/es2019/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +100 -0
- package/dist/es2019/pm-plugins/decorations/utils/tableDiffMode.js +27 -0
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeView.js +17 -7
- package/dist/es2019/pm-plugins/resolveDiffContributors.js +3 -1
- package/dist/es2019/pm-plugins/scrollToDiff.js +1 -0
- package/dist/es2019/pm-plugins/utils/emptyTextBlocks.js +58 -0
- package/dist/es2019/showDiffPluginType.js +85 -1
- package/dist/es2019/ui/ContributorTag/contributorAvatarRenderer.js +22 -14
- package/dist/es2019/ui/ContributorTag/contributorTagIcons.js +4 -0
- package/dist/esm/entry-points/calculate-diff.js +1 -0
- package/dist/esm/entry-points/show-diff-plugin-type.js +3 -0
- package/dist/esm/entry-points/show-diff-plugin.js +1 -0
- package/dist/esm/pm-plugins/NodeViewSerializer.js +1 -1
- package/dist/esm/pm-plugins/calculateDiff/calculateDiffDecorations.js +129 -52
- package/dist/esm/pm-plugins/calculateDiff/groupDeletedColumnChanges.js +258 -0
- package/dist/esm/pm-plugins/decorations/colorSchemes/attributions.js +14 -3
- package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +0 -1
- package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.js +1 -1
- package/dist/esm/pm-plugins/decorations/createChangedRowDecorationWidgets.js +100 -34
- package/dist/esm/pm-plugins/decorations/createContributorTagWidget.js +18 -13
- package/dist/esm/pm-plugins/decorations/createNodeChangedDecorationWidget.js +84 -22
- package/dist/esm/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +100 -0
- package/dist/esm/pm-plugins/decorations/utils/tableDiffMode.js +30 -0
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeView.js +18 -7
- package/dist/esm/pm-plugins/resolveDiffContributors.js +4 -3
- package/dist/esm/pm-plugins/scrollToDiff.js +1 -0
- package/dist/esm/pm-plugins/utils/emptyTextBlocks.js +60 -0
- package/dist/esm/showDiffPluginType.js +85 -1
- package/dist/esm/ui/ContributorTag/contributorAvatarRenderer.js +22 -14
- package/dist/esm/ui/ContributorTag/contributorTagIcons.js +4 -0
- package/dist/types/entry-points/show-diff-plugin-type.d.ts +2 -1
- package/dist/types/pm-plugins/calculateDiff/groupDeletedColumnChanges.d.ts +9 -0
- package/dist/types/pm-plugins/decorations/colorSchemes/attributions.d.ts +2 -2
- package/dist/types/pm-plugins/decorations/createChangedRowDecorationWidgets.d.ts +3 -1
- package/dist/types/pm-plugins/decorations/createContributorTagWidget.d.ts +5 -1
- package/dist/types/pm-plugins/decorations/createNodeChangedDecorationWidget.d.ts +3 -2
- package/dist/types/pm-plugins/decorations/utils/createDeletedLineBreakWidget.d.ts +50 -0
- package/dist/types/pm-plugins/decorations/utils/getAttrChangeRanges.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/utils/getMarkChangeRanges.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/utils/tableDiffMode.d.ts +26 -0
- package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeView.d.ts +4 -0
- package/dist/types/pm-plugins/utils/emptyTextBlocks.d.ts +16 -0
- package/dist/types/showDiffPluginType.d.ts +6 -1
- package/dist/types/ui/ContributorTag/contributorTagIcons.d.ts +1 -1
- package/package.json +4 -4
|
@@ -12,23 +12,28 @@ import { ChangeSet, simplifyChanges } from 'prosemirror-changeset';
|
|
|
12
12
|
import { areDocsEqualByBlockStructureAndText } from '@atlaskit/editor-common/utils/areDocsEqualByBlockStructureAndText';
|
|
13
13
|
import { areNodesEqualIgnoreAttrs } from '@atlaskit/editor-common/utils/document';
|
|
14
14
|
import { Mapping } from '@atlaskit/editor-prosemirror/transform';
|
|
15
|
-
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
15
|
+
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
16
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
16
17
|
import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
|
|
17
18
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
18
19
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
20
|
+
import { createAttributionColorMap, getAttributionKey, getAttributionKeyForChange, getColorSchemeForChange, isAttributionColoringEnabled, isContributorTagsEnabled } from '../decorations/colorSchemes/attributions';
|
|
19
21
|
import { createDocMarginAnchorWidget } from '../decorations/createAnchorDecorationWidgets';
|
|
20
22
|
import { createBlockChangedDecoration } from '../decorations/createBlockChangedDecoration';
|
|
21
23
|
import { createInlineChangedDecoration } from '../decorations/createInlineChangedDecoration';
|
|
22
24
|
import { createNodeChangedDecorationWidget } from '../decorations/createNodeChangedDecorationWidget';
|
|
23
|
-
import { createAttributionColorMap, getAttributionKey, getAttributionKeyForChange, getColorSchemeForChange, isAttributionColoringEnabled, isContributorTagsEnabled } from '../decorations/colorSchemes/attributions';
|
|
24
25
|
import { extractDiffDescriptors } from '../decorations/decorationKeys';
|
|
25
26
|
import { extractContributorTags } from '../decorations/extractContributorTags';
|
|
27
|
+
import { createDeletedLineBreakDecoration } from '../decorations/utils/createDeletedLineBreakWidget';
|
|
26
28
|
import { getAttrChangeRanges, stepIsValidAttrChange } from '../decorations/utils/getAttrChangeRanges';
|
|
27
29
|
import { getMarkChangeRanges } from '../decorations/utils/getMarkChangeRanges';
|
|
30
|
+
import { createRemovedLozenge } from '../decorations/utils/wrapBlockNodeView';
|
|
28
31
|
import { getScrollableDecorations } from '../getScrollableDecorations';
|
|
29
32
|
import { getDefaultDiffType, isExtendedEnabled } from '../isExtendedEnabled';
|
|
33
|
+
import { emptyTextBlockContentPositions } from '../utils/emptyTextBlocks';
|
|
30
34
|
import { diffBySteps } from './diffBySteps';
|
|
31
35
|
import { groupChangesByBlock } from './groupChangesByBlock';
|
|
36
|
+
import { CELL_CONTENT_OFFSET, groupDeletedColumnChanges } from './groupDeletedColumnChanges';
|
|
32
37
|
import { isMarkOnlyChange } from './isMarkOnlyChange';
|
|
33
38
|
import { isOpenTokenOnlyChange } from './isOpenTokenOnlyChange';
|
|
34
39
|
import { optimizeChanges } from './optimizeChanges';
|
|
@@ -501,7 +506,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
501
506
|
|
|
502
507
|
// Still colours-only: a tags-only diff keeps the plain colour scheme.
|
|
503
508
|
if (attributionColoringEnabled) {
|
|
504
|
-
attributionColors = createAttributionColorMap(simplifiedStepAttributions);
|
|
509
|
+
attributionColors = createAttributionColorMap(simplifiedStepAttributions, contributors);
|
|
505
510
|
}
|
|
506
511
|
} else {
|
|
507
512
|
var _changeset = ChangeSet.create(originalDoc, undefined, tokenEncoder).addSteps(steppedDoc, stepMaps, tr.doc);
|
|
@@ -527,10 +532,38 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
527
532
|
|
|
528
533
|
// Our default operations are insertions, so it should match the opposite of isInverted.
|
|
529
534
|
var isInserted = !isInverted;
|
|
535
|
+
if (isExtendedEnabled(diffType)) {
|
|
536
|
+
changes = groupDeletedColumnChanges(changes, originalDoc, tr.doc, new Mapping(stepMaps), isInverted);
|
|
537
|
+
}
|
|
538
|
+
// A whole-table change owns every mark and attribute range inside its bounds, so those ranges
|
|
539
|
+
// do not also get their own decoration.
|
|
540
|
+
var tableChanges = changes.filter(function (change) {
|
|
541
|
+
return change.deletedColumns !== undefined;
|
|
542
|
+
});
|
|
543
|
+
var isHandledByTable = function isHandledByTable(from, to) {
|
|
544
|
+
return tableChanges.some(function (change) {
|
|
545
|
+
return from >= change.fromB && to <= change.toB;
|
|
546
|
+
});
|
|
547
|
+
};
|
|
530
548
|
var createDecorationsForChange = function createDecorationsForChange(change) {
|
|
531
549
|
var changeColorScheme = attributionColors ? getColorSchemeForChange(change, attributedChanges, attributionColors, colorScheme) : colorScheme;
|
|
532
550
|
var attributionKey = showContributorTags ? getAttributionKeyForChange(change, attributedChanges) : undefined;
|
|
533
551
|
var isActive = isRangeActive(activeIndexPos, change.fromB, change.toB);
|
|
552
|
+
var deletedColumns = change.deletedColumns;
|
|
553
|
+
// On an inverted diff the table that lost columns is the one in `tr.doc`, so the column
|
|
554
|
+
// indices address it directly and each label anchors inside its own cell.
|
|
555
|
+
var table = tr.doc.nodeAt(change.fromB);
|
|
556
|
+
if (isInverted && !hideDeletedDiffs && deletedColumns !== null && deletedColumns !== void 0 && deletedColumns.length && (table === null || table === void 0 ? void 0 : table.type.name) === 'table') {
|
|
557
|
+
var tableMap = TableMap.get(table);
|
|
558
|
+
deletedColumns.forEach(function (column) {
|
|
559
|
+
var offset = tableMap.positionAt(0, column, table);
|
|
560
|
+
decorations.push(Decoration.widget(change.fromB + CELL_CONTENT_OFFSET + offset, function () {
|
|
561
|
+
return createRemovedLozenge(intl, isActive, changeColorScheme, true);
|
|
562
|
+
}, {
|
|
563
|
+
side: -1
|
|
564
|
+
}));
|
|
565
|
+
});
|
|
566
|
+
}
|
|
534
567
|
|
|
535
568
|
// The deleted side of a mark-only change is a byte-identical copy of the new text, so it is
|
|
536
569
|
// suppressed in the clean view. `hideDeletedDiffs` is load-bearing: when false the reviewer
|
|
@@ -564,6 +597,41 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
564
597
|
// On an inverted diff the inserted side is visually the deleted side.
|
|
565
598
|
var shouldHideDeleted = isExtendedEnabled(diffType) ? isInverted && hideDeletedDiffs : false;
|
|
566
599
|
|
|
600
|
+
// A removed blank line — an empty paragraph or heading — has nothing to mark up. On an
|
|
601
|
+
// inverted diff, the shape AI suggested edits renders, the block is still in the displayed
|
|
602
|
+
// document, so the removal lands here on the inserted side rather than on the deleted side,
|
|
603
|
+
// and both the inline and the block decoration paint nothing: an empty textblock has no
|
|
604
|
+
// inline content to cover, and block decorations return no style for a paragraph or heading.
|
|
605
|
+
// The reviewer sees an unmarked blank line. Stand the struck-through return glyph in for each
|
|
606
|
+
// one, anchored inside the block so it renders on the blank line itself.
|
|
607
|
+
//
|
|
608
|
+
// One decoration per blank line rather than one per change: a run of adjacent blank lines is
|
|
609
|
+
// reported as a single change spanning all of them.
|
|
610
|
+
//
|
|
611
|
+
// Withheld in the clean view, where removals are hidden rather than struck through.
|
|
612
|
+
if (fg('platform_editor_ai_show_diff_patch_2') && !isInserted && !shouldHideDeleted) {
|
|
613
|
+
var _iterator3 = _createForOfIteratorHelper(emptyTextBlockContentPositions(tr.doc, change.fromB, change.toB)),
|
|
614
|
+
_step3;
|
|
615
|
+
try {
|
|
616
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
617
|
+
var pos = _step3.value;
|
|
618
|
+
decorations.push(createDeletedLineBreakDecoration({
|
|
619
|
+
attributionKey: attributionKey,
|
|
620
|
+
colorScheme: changeColorScheme,
|
|
621
|
+
diffType: diffType,
|
|
622
|
+
isActive: isActive,
|
|
623
|
+
pos: pos,
|
|
624
|
+
reveal: reveal,
|
|
625
|
+
side: -1
|
|
626
|
+
}));
|
|
627
|
+
}
|
|
628
|
+
} catch (err) {
|
|
629
|
+
_iterator3.e(err);
|
|
630
|
+
} finally {
|
|
631
|
+
_iterator3.f();
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
567
635
|
// For `smart` NODE-level promotions the change range spans a whole container
|
|
568
636
|
// (e.g. an entire list/table/layout, using outer node bounds). Applying a SINGLE
|
|
569
637
|
// inline decoration across that whole range would paint the inserted style across
|
|
@@ -594,13 +662,13 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
594
662
|
// table (the cell overlays added below provide the highlight without the
|
|
595
663
|
// expensive content re-render); leaf blocks outside the table still get theirs.
|
|
596
664
|
var coarseTables = useCoarseTableDecoration ? tableRanges(tr.doc, change.fromB, change.toB) : [];
|
|
597
|
-
var
|
|
598
|
-
|
|
665
|
+
var _iterator4 = _createForOfIteratorHelper(leafTextblockRanges(tr.doc, change.fromB, change.toB)),
|
|
666
|
+
_step4;
|
|
599
667
|
try {
|
|
600
|
-
for (
|
|
601
|
-
var
|
|
602
|
-
from =
|
|
603
|
-
to =
|
|
668
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
669
|
+
var _step4$value = _slicedToArray(_step4.value, 2),
|
|
670
|
+
from = _step4$value[0],
|
|
671
|
+
to = _step4$value[1];
|
|
604
672
|
if (useCoarseTableDecoration && isInsideTable(coarseTables, from)) {
|
|
605
673
|
continue;
|
|
606
674
|
}
|
|
@@ -627,9 +695,9 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
627
695
|
}))));
|
|
628
696
|
}
|
|
629
697
|
} catch (err) {
|
|
630
|
-
|
|
698
|
+
_iterator4.e(err);
|
|
631
699
|
} finally {
|
|
632
|
-
|
|
700
|
+
_iterator4.f();
|
|
633
701
|
}
|
|
634
702
|
} else {
|
|
635
703
|
decorations.push.apply(decorations, _toConsumableArray(createInlineChangedDecoration(_objectSpread({
|
|
@@ -681,6 +749,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
681
749
|
});
|
|
682
750
|
if (!_shouldHideDeleted) {
|
|
683
751
|
decorations.push.apply(decorations, _toConsumableArray(createNodeChangedDecorationWidget(_objectSpread(_objectSpread({
|
|
752
|
+
deletedColumns: deletedColumns,
|
|
684
753
|
// The deleted side has no inline decoration, so the widget carries the actor.
|
|
685
754
|
attributionKey: attributionKey,
|
|
686
755
|
// Extended pipeline only, matching the inline path: the non-extended styles have no
|
|
@@ -716,6 +785,10 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
716
785
|
getMarkChangeRanges(simplifiedSteps, simplifiedStepAttributions, fg('confluence_ncs_step_diffing_version_history') ? stepMaps : undefined).filter(function (_ref11) {
|
|
717
786
|
var fromB = _ref11.fromB,
|
|
718
787
|
toB = _ref11.toB;
|
|
788
|
+
return !isHandledByTable(fromB, toB);
|
|
789
|
+
}).filter(function (_ref12) {
|
|
790
|
+
var fromB = _ref12.fromB,
|
|
791
|
+
toB = _ref12.toB;
|
|
719
792
|
return !fg('confluence_ncs_step_diffing_version_history') || !changes.some(function (change) {
|
|
720
793
|
return change.fromB === fromB && change.toB === toB;
|
|
721
794
|
});
|
|
@@ -737,9 +810,13 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
737
810
|
tagMountContext: tagMountContext
|
|
738
811
|
})));
|
|
739
812
|
});
|
|
740
|
-
getAttrChangeRanges(tr.doc, attrStepContexts, originalDoc).filter(function (
|
|
741
|
-
var fromB =
|
|
742
|
-
toB =
|
|
813
|
+
getAttrChangeRanges(tr.doc, attrStepContexts, originalDoc).filter(function (_ref13) {
|
|
814
|
+
var fromB = _ref13.fromB,
|
|
815
|
+
toB = _ref13.toB;
|
|
816
|
+
return !isHandledByTable(fromB, toB);
|
|
817
|
+
}).filter(function (_ref14) {
|
|
818
|
+
var fromB = _ref14.fromB,
|
|
819
|
+
toB = _ref14.toB;
|
|
743
820
|
return !fg('confluence_ncs_step_diffing_version_history') || !changes.some(function (change) {
|
|
744
821
|
return change.fromB === fromB && change.toB === toB;
|
|
745
822
|
});
|
|
@@ -849,49 +926,49 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
849
926
|
export var calculateDiffDecorations = memoizeOne(calculateDiffDecorationsInner,
|
|
850
927
|
// Cache results unless relevant inputs change. `tagMountContext` is deliberately absent: it is
|
|
851
928
|
// built once per plugin instance, so it can never be the reason a diff needs recalculating.
|
|
852
|
-
function (
|
|
853
|
-
var
|
|
854
|
-
var
|
|
855
|
-
|
|
856
|
-
pluginState =
|
|
857
|
-
state =
|
|
858
|
-
colorScheme =
|
|
859
|
-
intl =
|
|
860
|
-
activeIndexPos =
|
|
861
|
-
isInverted =
|
|
862
|
-
diffType =
|
|
863
|
-
hideDeletedDiffs =
|
|
864
|
-
hideAddedDiffsUnderline =
|
|
865
|
-
showIndicators =
|
|
866
|
-
smartThresholds =
|
|
867
|
-
deletedDiffPlacement =
|
|
868
|
-
inlineDeletedDiffPlacement =
|
|
869
|
-
reveal =
|
|
870
|
-
var
|
|
871
|
-
|
|
872
|
-
lastPluginState =
|
|
873
|
-
lastState =
|
|
874
|
-
lastColorScheme =
|
|
875
|
-
lastIntl =
|
|
876
|
-
lastActiveIndexPos =
|
|
877
|
-
lastIsInverted =
|
|
878
|
-
lastDiffType =
|
|
879
|
-
lastHideDeletedDiffs =
|
|
880
|
-
lastHideAddedDiffsUnderline =
|
|
881
|
-
lastShowIndicators =
|
|
882
|
-
lastSmartThresholds =
|
|
883
|
-
lastDeletedDiffPlacement =
|
|
884
|
-
lastInlineDeletedDiffPlacement =
|
|
885
|
-
lastReveal =
|
|
929
|
+
function (_ref15, _ref16) {
|
|
930
|
+
var _ref20;
|
|
931
|
+
var _ref17 = _slicedToArray(_ref15, 1),
|
|
932
|
+
_ref17$ = _ref17[0],
|
|
933
|
+
pluginState = _ref17$.pluginState,
|
|
934
|
+
state = _ref17$.state,
|
|
935
|
+
colorScheme = _ref17$.colorScheme,
|
|
936
|
+
intl = _ref17$.intl,
|
|
937
|
+
activeIndexPos = _ref17$.activeIndexPos,
|
|
938
|
+
isInverted = _ref17$.isInverted,
|
|
939
|
+
diffType = _ref17$.diffType,
|
|
940
|
+
hideDeletedDiffs = _ref17$.hideDeletedDiffs,
|
|
941
|
+
hideAddedDiffsUnderline = _ref17$.hideAddedDiffsUnderline,
|
|
942
|
+
showIndicators = _ref17$.showIndicators,
|
|
943
|
+
smartThresholds = _ref17$.smartThresholds,
|
|
944
|
+
deletedDiffPlacement = _ref17$.deletedDiffPlacement,
|
|
945
|
+
inlineDeletedDiffPlacement = _ref17$.inlineDeletedDiffPlacement,
|
|
946
|
+
reveal = _ref17$.reveal;
|
|
947
|
+
var _ref18 = _slicedToArray(_ref16, 1),
|
|
948
|
+
_ref18$ = _ref18[0],
|
|
949
|
+
lastPluginState = _ref18$.pluginState,
|
|
950
|
+
lastState = _ref18$.state,
|
|
951
|
+
lastColorScheme = _ref18$.colorScheme,
|
|
952
|
+
lastIntl = _ref18$.intl,
|
|
953
|
+
lastActiveIndexPos = _ref18$.activeIndexPos,
|
|
954
|
+
lastIsInverted = _ref18$.isInverted,
|
|
955
|
+
lastDiffType = _ref18$.diffType,
|
|
956
|
+
lastHideDeletedDiffs = _ref18$.hideDeletedDiffs,
|
|
957
|
+
lastHideAddedDiffsUnderline = _ref18$.hideAddedDiffsUnderline,
|
|
958
|
+
lastShowIndicators = _ref18$.showIndicators,
|
|
959
|
+
lastSmartThresholds = _ref18$.smartThresholds,
|
|
960
|
+
lastDeletedDiffPlacement = _ref18$.deletedDiffPlacement,
|
|
961
|
+
lastInlineDeletedDiffPlacement = _ref18$.inlineDeletedDiffPlacement,
|
|
962
|
+
lastReveal = _ref18$.reveal;
|
|
886
963
|
var originalDocIsSame = lastPluginState.originalDoc && pluginState.originalDoc && pluginState.originalDoc.eq(lastPluginState.originalDoc);
|
|
887
964
|
if (isExtendedEnabled(diffType)) {
|
|
888
|
-
var
|
|
889
|
-
return (
|
|
965
|
+
var _ref19;
|
|
966
|
+
return (_ref19 = colorScheme === lastColorScheme && intl.locale === lastIntl.locale && isInverted === lastIsInverted && diffType === lastDiffType && isEqual(activeIndexPos, lastActiveIndexPos) && originalDocIsSame && isEqual(pluginState.steps, lastPluginState.steps) && isEqual(pluginState.stepAttributions, lastPluginState.stepAttributions) &&
|
|
890
967
|
// Contributors can arrive after the first calculation; without this, tags never appear.
|
|
891
968
|
isEqual(pluginState.contributors, lastPluginState.contributors) && state.doc.eq(lastState.doc) && hideDeletedDiffs === lastHideDeletedDiffs && hideAddedDiffsUnderline === lastHideAddedDiffsUnderline && showIndicators === lastShowIndicators && isEqual(smartThresholds, lastSmartThresholds) && deletedDiffPlacement === lastDeletedDiffPlacement && inlineDeletedDiffPlacement === lastInlineDeletedDiffPlacement &&
|
|
892
969
|
// Turning the reveal on or off changes the emitted styles, so a cached result from the
|
|
893
970
|
// other setting would leave the diff painted in the wrong resting state.
|
|
894
|
-
isEqual(reveal, lastReveal)) !== null &&
|
|
971
|
+
isEqual(reveal, lastReveal)) !== null && _ref19 !== void 0 ? _ref19 : false;
|
|
895
972
|
}
|
|
896
|
-
return (
|
|
973
|
+
return (_ref20 = 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 && _ref20 !== void 0 ? _ref20 : false;
|
|
897
974
|
});
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
import { areNodesEqualIgnoreAttrs } from '@atlaskit/editor-common/utils/document';
|
|
6
|
+
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
|
+
export var CELL_CONTENT_OFFSET = 2;
|
|
9
|
+
var IGNORED_CELL_ATTRS = ['localId', 'colwidth'];
|
|
10
|
+
var tablesIn = function tablesIn(doc) {
|
|
11
|
+
var tables = [];
|
|
12
|
+
doc.descendants(function (node, pos) {
|
|
13
|
+
if (node.type.name === 'table') {
|
|
14
|
+
tables.push({
|
|
15
|
+
node: node,
|
|
16
|
+
pos: pos
|
|
17
|
+
});
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
});
|
|
22
|
+
return tables;
|
|
23
|
+
};
|
|
24
|
+
var tableEnd = function tableEnd(table) {
|
|
25
|
+
return table.pos + table.node.nodeSize;
|
|
26
|
+
};
|
|
27
|
+
var documentsDifferOnlyByTable = function documentsDifferOnlyByTable(originalDoc, newDoc, before, after) {
|
|
28
|
+
try {
|
|
29
|
+
return originalDoc.replace(before.pos, tableEnd(before), new Slice(Fragment.from(after.node), 0, 0)).eq(newDoc);
|
|
30
|
+
} catch (_unused) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var columnOffsets = function columnOffsets(map, table) {
|
|
35
|
+
return Array.from({
|
|
36
|
+
length: map.width
|
|
37
|
+
}, function (_, column) {
|
|
38
|
+
return map.positionAt(0, column, table);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
var positionMatchedColumns = function positionMatchedColumns(_ref) {
|
|
42
|
+
var before = _ref.before,
|
|
43
|
+
after = _ref.after,
|
|
44
|
+
afterToBefore = _ref.afterToBefore,
|
|
45
|
+
beforeOffsets = _ref.beforeOffsets;
|
|
46
|
+
var afterMap = TableMap.get(after.node);
|
|
47
|
+
var surviving = new Set();
|
|
48
|
+
for (var column = 0; column < afterMap.width; column++) {
|
|
49
|
+
var offset = afterMap.positionAt(0, column, after.node);
|
|
50
|
+
var mapped = afterToBefore.mapResult(after.pos + CELL_CONTENT_OFFSET + offset);
|
|
51
|
+
var beforeColumn = beforeOffsets.indexOf(mapped.pos - before.pos - CELL_CONTENT_OFFSET);
|
|
52
|
+
if (mapped.deleted || beforeColumn === -1) {
|
|
53
|
+
return new Set();
|
|
54
|
+
}
|
|
55
|
+
surviving.add(beforeColumn);
|
|
56
|
+
}
|
|
57
|
+
return surviving;
|
|
58
|
+
};
|
|
59
|
+
var addContentMatchedColumns = function addContentMatchedColumns(surviving, before, after) {
|
|
60
|
+
var _before$node$firstChi, _before$node$firstChi2, _after$node$firstChil, _after$node$firstChil2;
|
|
61
|
+
var beforeCells = (_before$node$firstChi = (_before$node$firstChi2 = before.node.firstChild) === null || _before$node$firstChi2 === void 0 ? void 0 : _before$node$firstChi2.children) !== null && _before$node$firstChi !== void 0 ? _before$node$firstChi : [];
|
|
62
|
+
var afterCells = (_after$node$firstChil = (_after$node$firstChil2 = after.node.firstChild) === null || _after$node$firstChil2 === void 0 ? void 0 : _after$node$firstChil2.children) !== null && _after$node$firstChil !== void 0 ? _after$node$firstChil : [];
|
|
63
|
+
var _iterator = _createForOfIteratorHelper(afterCells),
|
|
64
|
+
_step;
|
|
65
|
+
try {
|
|
66
|
+
var _loop = function _loop() {
|
|
67
|
+
var afterCell = _step.value;
|
|
68
|
+
var matches = beforeCells.flatMap(function (beforeCell, column) {
|
|
69
|
+
return areNodesEqualIgnoreAttrs(beforeCell, afterCell, IGNORED_CELL_ATTRS) ? [column] : [];
|
|
70
|
+
});
|
|
71
|
+
if (matches.length !== 1) {
|
|
72
|
+
return {
|
|
73
|
+
v: false
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
surviving.add(matches[0]);
|
|
77
|
+
},
|
|
78
|
+
_ret;
|
|
79
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
80
|
+
_ret = _loop();
|
|
81
|
+
if (_ret) return _ret.v;
|
|
82
|
+
}
|
|
83
|
+
} catch (err) {
|
|
84
|
+
_iterator.e(err);
|
|
85
|
+
} finally {
|
|
86
|
+
_iterator.f();
|
|
87
|
+
}
|
|
88
|
+
var ordered = _toConsumableArray(surviving);
|
|
89
|
+
return !ordered.some(function (column, index) {
|
|
90
|
+
return index > 0 && column <= ordered[index - 1];
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
var findDeletedColumns = function findDeletedColumns(before, after, afterToBefore) {
|
|
94
|
+
var beforeMap = TableMap.get(before.node);
|
|
95
|
+
var afterMap = TableMap.get(after.node);
|
|
96
|
+
// Merged or malformed tables do not have reliable column indices.
|
|
97
|
+
if (beforeMap.hasMergedCells() || afterMap.hasMergedCells() || beforeMap.problems || afterMap.problems) {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
var beforeOffsets = columnOffsets(beforeMap, before.node);
|
|
101
|
+
var surviving = positionMatchedColumns({
|
|
102
|
+
before: before,
|
|
103
|
+
after: after,
|
|
104
|
+
afterToBefore: afterToBefore,
|
|
105
|
+
beforeOffsets: beforeOffsets
|
|
106
|
+
});
|
|
107
|
+
if (surviving.size !== afterMap.width && !addContentMatchedColumns(surviving, before, after)) {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
return beforeOffsets.flatMap(function (_, column) {
|
|
111
|
+
return surviving.has(column) ? [] : [column];
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
var findCounterpart = function findCounterpart(_ref2) {
|
|
115
|
+
var table = _ref2.table,
|
|
116
|
+
index = _ref2.index,
|
|
117
|
+
originalTables = _ref2.originalTables,
|
|
118
|
+
newTables = _ref2.newTables,
|
|
119
|
+
mapping = _ref2.mapping;
|
|
120
|
+
var from = mapping.map(table.pos, -1);
|
|
121
|
+
var to = mapping.map(tableEnd(table), 1);
|
|
122
|
+
var inside = mapping.mapResult(table.pos + 1);
|
|
123
|
+
var candidates = newTables.filter(function (candidate) {
|
|
124
|
+
return inside.deleted ? candidate.pos >= from && tableEnd(candidate) <= to : candidate.pos < inside.pos && inside.pos < tableEnd(candidate);
|
|
125
|
+
});
|
|
126
|
+
if (candidates.length === 1) {
|
|
127
|
+
return candidates[0];
|
|
128
|
+
}
|
|
129
|
+
return originalTables.length === newTables.length ? newTables[index] : undefined;
|
|
130
|
+
};
|
|
131
|
+
var orient = function orient(_ref3) {
|
|
132
|
+
var table = _ref3.table,
|
|
133
|
+
counterpart = _ref3.counterpart,
|
|
134
|
+
mapping = _ref3.mapping,
|
|
135
|
+
isInverted = _ref3.isInverted;
|
|
136
|
+
return {
|
|
137
|
+
before: isInverted ? counterpart : table,
|
|
138
|
+
after: isInverted ? table : counterpart,
|
|
139
|
+
afterToBefore: (isInverted ? mapping.invert() : mapping).invert()
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
var changesInTable = function changesInTable(changes, table) {
|
|
143
|
+
return changes.filter(function (change) {
|
|
144
|
+
return change.fromA < tableEnd(table) && change.toA > table.pos;
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
var isNarrowingSafe = function isNarrowingSafe(_ref4) {
|
|
148
|
+
var replacedChanges = _ref4.replacedChanges,
|
|
149
|
+
table = _ref4.table,
|
|
150
|
+
counterpart = _ref4.counterpart,
|
|
151
|
+
originalDoc = _ref4.originalDoc,
|
|
152
|
+
newDoc = _ref4.newDoc;
|
|
153
|
+
var staysInside = replacedChanges.every(function (change) {
|
|
154
|
+
return change.fromA >= table.pos && change.toA <= tableEnd(table) && change.fromB >= counterpart.pos && change.toB <= tableEnd(counterpart);
|
|
155
|
+
});
|
|
156
|
+
return staysInside || documentsDifferOnlyByTable(originalDoc, newDoc, table, counterpart);
|
|
157
|
+
};
|
|
158
|
+
var planTableChange = function planTableChange(_ref5) {
|
|
159
|
+
var table = _ref5.table,
|
|
160
|
+
index = _ref5.index,
|
|
161
|
+
originalTables = _ref5.originalTables,
|
|
162
|
+
newTables = _ref5.newTables,
|
|
163
|
+
changes = _ref5.changes,
|
|
164
|
+
originalDoc = _ref5.originalDoc,
|
|
165
|
+
newDoc = _ref5.newDoc,
|
|
166
|
+
mapping = _ref5.mapping,
|
|
167
|
+
isInverted = _ref5.isInverted;
|
|
168
|
+
var counterpart = findCounterpart({
|
|
169
|
+
table: table,
|
|
170
|
+
index: index,
|
|
171
|
+
originalTables: originalTables,
|
|
172
|
+
newTables: newTables,
|
|
173
|
+
mapping: mapping
|
|
174
|
+
});
|
|
175
|
+
if (!counterpart) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
var _orient = orient({
|
|
179
|
+
table: table,
|
|
180
|
+
counterpart: counterpart,
|
|
181
|
+
mapping: mapping,
|
|
182
|
+
isInverted: isInverted
|
|
183
|
+
}),
|
|
184
|
+
before = _orient.before,
|
|
185
|
+
after = _orient.after,
|
|
186
|
+
afterToBefore = _orient.afterToBefore;
|
|
187
|
+
if (TableMap.get(before.node).width <= TableMap.get(after.node).width) {
|
|
188
|
+
return undefined;
|
|
189
|
+
}
|
|
190
|
+
var replacedChanges = changesInTable(changes, table);
|
|
191
|
+
if (!replacedChanges.length) {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
if (!isNarrowingSafe({
|
|
195
|
+
replacedChanges: replacedChanges,
|
|
196
|
+
table: table,
|
|
197
|
+
counterpart: counterpart,
|
|
198
|
+
originalDoc: originalDoc,
|
|
199
|
+
newDoc: newDoc
|
|
200
|
+
})) {
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
var spans = replacedChanges.flatMap(function (change) {
|
|
204
|
+
return [].concat(_toConsumableArray(change.deleted), _toConsumableArray(change.inserted));
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
replacedChanges: replacedChanges,
|
|
208
|
+
tableChange: {
|
|
209
|
+
deletedColumns: findDeletedColumns(before, after, afterToBefore),
|
|
210
|
+
fromA: table.pos,
|
|
211
|
+
toA: tableEnd(table),
|
|
212
|
+
fromB: counterpart.pos,
|
|
213
|
+
toB: tableEnd(counterpart),
|
|
214
|
+
deleted: spans,
|
|
215
|
+
inserted: spans
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
/** Groups a deleted column's cell changes into one whole-table change. */
|
|
221
|
+
export var groupDeletedColumnChanges = function groupDeletedColumnChanges(changes, originalDoc, newDoc, mapping, isInverted) {
|
|
222
|
+
var originalTables = tablesIn(originalDoc);
|
|
223
|
+
var newTables = tablesIn(newDoc);
|
|
224
|
+
var plans = [];
|
|
225
|
+
var replaced = new Set();
|
|
226
|
+
originalTables.forEach(function (table, index) {
|
|
227
|
+
var plan = planTableChange({
|
|
228
|
+
table: table,
|
|
229
|
+
index: index,
|
|
230
|
+
originalTables: originalTables,
|
|
231
|
+
newTables: newTables,
|
|
232
|
+
changes: changes.filter(function (change) {
|
|
233
|
+
return !replaced.has(change);
|
|
234
|
+
}),
|
|
235
|
+
originalDoc: originalDoc,
|
|
236
|
+
newDoc: newDoc,
|
|
237
|
+
mapping: mapping,
|
|
238
|
+
isInverted: isInverted
|
|
239
|
+
});
|
|
240
|
+
if (!plan) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
plans.push(plan);
|
|
244
|
+
plan.replacedChanges.forEach(function (change) {
|
|
245
|
+
return replaced.add(change);
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
if (!plans.length) {
|
|
249
|
+
return _toConsumableArray(changes);
|
|
250
|
+
}
|
|
251
|
+
return [].concat(_toConsumableArray(changes.filter(function (change) {
|
|
252
|
+
return !replaced.has(change);
|
|
253
|
+
})), _toConsumableArray(plans.map(function (plan) {
|
|
254
|
+
return plan.tableChange;
|
|
255
|
+
}))).sort(function (left, right) {
|
|
256
|
+
return left.fromB - right.fromB;
|
|
257
|
+
});
|
|
258
|
+
};
|
|
@@ -11,6 +11,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
11
11
|
import { getParticipantColor } from '@atlaskit/editor-shared-styles/utils';
|
|
12
12
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
14
|
+
import { DIFF_AGENT_BRANDS } from '../../../showDiffPluginType';
|
|
14
15
|
import { PARTICIPANT_COLOR_SCHEMES } from './types';
|
|
15
16
|
|
|
16
17
|
/** A contributor with both of its identities collapsed to internal attribution keys. */
|
|
@@ -89,6 +90,16 @@ export var getAttributionKey = function getAttributionKey(attribution) {
|
|
|
89
90
|
var _getAttributionIdenti;
|
|
90
91
|
return (_getAttributionIdenti = getAttributionIdentity(attribution)) === null || _getAttributionIdenti === void 0 ? void 0 : _getAttributionIdenti.key;
|
|
91
92
|
};
|
|
93
|
+
var isDiffAgentBrand = function isDiffAgentBrand(agentBrand) {
|
|
94
|
+
return agentBrand !== undefined && DIFF_AGENT_BRANDS.has(agentBrand);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** Prefers the resolved branded profile over the raw attribution agent type. */
|
|
98
|
+
var getAgentBrandForColor = function getAgentBrandForColor(attribution, contributors) {
|
|
99
|
+
var _contributors, _getAttributionKey;
|
|
100
|
+
var agentBrand = contributors === null || contributors === void 0 || (_contributors = contributors[(_getAttributionKey = getAttributionKey(attribution)) !== null && _getAttributionKey !== void 0 ? _getAttributionKey : '']) === null || _contributors === void 0 ? void 0 : _contributors.agentKind;
|
|
101
|
+
return isDiffAgentBrand(agentBrand) ? agentBrand : attribution === null || attribution === void 0 ? void 0 : attribution.agentType;
|
|
102
|
+
};
|
|
92
103
|
|
|
93
104
|
/**
|
|
94
105
|
* Public contributor list to internal key-addressed record. A contributor whose attribution carries
|
|
@@ -148,7 +159,7 @@ export var isContributorTagsEnabled = function isContributorTagsEnabled(stepAttr
|
|
|
148
159
|
return getAttributionKey(attribution) !== undefined;
|
|
149
160
|
})) && contributors !== undefined && Object.keys(contributors).length > 0;
|
|
150
161
|
};
|
|
151
|
-
export var createAttributionColorMap = function createAttributionColorMap(stepAttributions) {
|
|
162
|
+
export var createAttributionColorMap = function createAttributionColorMap(stepAttributions, contributors) {
|
|
152
163
|
var colors = new Map();
|
|
153
164
|
var allocatedColors = new Set();
|
|
154
165
|
|
|
@@ -163,7 +174,7 @@ export var createAttributionColorMap = function createAttributionColorMap(stepAt
|
|
|
163
174
|
if (!identity) {
|
|
164
175
|
continue;
|
|
165
176
|
}
|
|
166
|
-
var _getParticipantColor = getParticipantColor(identity.colorSeed, attribution
|
|
177
|
+
var _getParticipantColor = getParticipantColor(identity.colorSeed, getAgentBrandForColor(attribution, contributors)),
|
|
167
178
|
index = _getParticipantColor.index,
|
|
168
179
|
isFixed = _getParticipantColor.isFixed;
|
|
169
180
|
var color = HASHED_PARTICIPANT_COLOR_SCHEMES[index];
|
|
@@ -186,7 +197,7 @@ export var createAttributionColorMap = function createAttributionColorMap(stepAt
|
|
|
186
197
|
if (!_identity || colors.has(_identity.key)) {
|
|
187
198
|
continue;
|
|
188
199
|
}
|
|
189
|
-
var _getParticipantColor2 = getParticipantColor(_identity.colorSeed, _attribution
|
|
200
|
+
var _getParticipantColor2 = getParticipantColor(_identity.colorSeed, getAgentBrandForColor(_attribution, contributors)),
|
|
190
201
|
_index = _getParticipantColor2.index;
|
|
191
202
|
var hashedColor = getSlotColor(_index);
|
|
192
203
|
if (!hashedColor) {
|
|
@@ -4,7 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { agentBrandColorSchemes } from '@atlaskit/agent-color/agent-brand-color-schemes';
|
|
5
5
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
6
6
|
import { getStandardDeletedTextDecorationStyle } from './getStandardDeletedTextDecorationStyle';
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Hover highlight for deleted text under an 'onEmphasis' scheme. Inline styles cannot express
|
|
10
9
|
* `:hover`, so the resting style resolves its background from this property and
|
|
@@ -12,9 +12,9 @@ import { isTaggableBlockNode } from '../utils/taggableBlockNodes';
|
|
|
12
12
|
import { buildAddedCellOverlayRoundedStyle, buildAddedCellOverlayStyle, buildDeletedBlockNodeStyle, buildDeletedCellOverlayRoundedStyle, buildDeletedCellOverlayStyle, buildInsertedBlockNodeStyle } from './colorSchemes/factory';
|
|
13
13
|
import { colorSchemeRegistry, getLegacyColorScheme } from './colorSchemes/schemes';
|
|
14
14
|
import { createBlockIndicatorAnchorWidgets } from './createAnchorDecorationWidgets';
|
|
15
|
+
import { getBlockNodeStyleLegacy, resolveCellOverlayStyleLegacy } from './createBlockChangedDecoration.styles.legacy';
|
|
15
16
|
import { createContributorTagWidget, isContributorTagWidgetEnabled } from './createContributorTagWidget';
|
|
16
17
|
import { AnchorTypeKey, buildDiffDecorationSpec, buildAnchorDecorationKey, scrollMarginTopStyle } from './decorationKeys';
|
|
17
|
-
import { getBlockNodeStyleLegacy, resolveCellOverlayStyleLegacy } from './createBlockChangedDecoration.styles.legacy';
|
|
18
18
|
var displayNoneStyle = convertToInlineCss({
|
|
19
19
|
display: 'none'
|
|
20
20
|
});
|