@atlaskit/editor-plugin-show-diff 19.0.3 → 20.0.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 +17 -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 +11 -11
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-show-diff
|
|
2
2
|
|
|
3
|
+
## 20.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 19.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`dec0b5dd31b2f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dec0b5dd31b2f) -
|
|
14
|
+
Add Figma, Lovable, and Replit contributor tags behind
|
|
15
|
+
confluence_ncs_step_diffing_version_history.
|
|
16
|
+
- [`806c750c64957`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/806c750c64957) -
|
|
17
|
+
Clean up experiment `platform_editor_diff_plugin_extended`
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 19.0.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -30,8 +30,8 @@ var _createDeletedLineBreakWidget = require("../decorations/utils/createDeletedL
|
|
|
30
30
|
var _getAttrChangeRanges = require("../decorations/utils/getAttrChangeRanges");
|
|
31
31
|
var _getMarkChangeRanges = require("../decorations/utils/getMarkChangeRanges");
|
|
32
32
|
var _wrapBlockNodeView = require("../decorations/utils/wrapBlockNodeView");
|
|
33
|
+
var _getDefaultDiffType = require("../getDefaultDiffType");
|
|
33
34
|
var _getScrollableDecorations = require("../getScrollableDecorations");
|
|
34
|
-
var _isExtendedEnabled = require("../isExtendedEnabled");
|
|
35
35
|
var _emptyTextBlocks = require("../utils/emptyTextBlocks");
|
|
36
36
|
var _diffBySteps = require("./diffBySteps");
|
|
37
37
|
var _groupChangesByBlock = require("./groupChangesByBlock");
|
|
@@ -58,28 +58,24 @@ var getChanges = function getChanges(_ref) {
|
|
|
58
58
|
steps = _ref.steps,
|
|
59
59
|
intl = _ref.intl,
|
|
60
60
|
smartThresholds = _ref.smartThresholds;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return (0, _groupChangesByBlock.groupChangesByBlock)(changeset.changes, originalDoc, steppedDoc);
|
|
80
|
-
}
|
|
81
|
-
var _changes2 = (0, _prosemirrorChangeset.simplifyChanges)(changeset.changes, tr.doc);
|
|
82
|
-
return (0, _optimizeChanges.optimizeChanges)(_changes2);
|
|
61
|
+
// The `smart` diff type is gated behind `platform_editor_ai_smart_diff`. When the gate is
|
|
62
|
+
// off, `smart` falls through to the default (`inline`) path below so behaviour degrades
|
|
63
|
+
// gracefully (see docs/smart-diff-design.md §3).
|
|
64
|
+
if (diffType === 'smart' && (0, _fg.fg)('platform_editor_ai_smart_diff')) {
|
|
65
|
+
var _changes = (0, _prosemirrorChangeset.simplifyChanges)(changeset.changes, tr.doc);
|
|
66
|
+
return (0, _classifySmartChanges.classifySmartChanges)({
|
|
67
|
+
changes: _changes,
|
|
68
|
+
originalDoc: originalDoc,
|
|
69
|
+
newDoc: tr.doc,
|
|
70
|
+
locale: intl.locale,
|
|
71
|
+
thresholds: smartThresholds
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
if (diffType === 'step') {
|
|
75
|
+
return (0, _diffBySteps.diffBySteps)(originalDoc, steps);
|
|
76
|
+
}
|
|
77
|
+
if (diffType === 'block') {
|
|
78
|
+
return (0, _groupChangesByBlock.groupChangesByBlock)(changeset.changes, originalDoc, steppedDoc);
|
|
83
79
|
}
|
|
84
80
|
var changes = (0, _prosemirrorChangeset.simplifyChanges)(changeset.changes, tr.doc);
|
|
85
81
|
return (0, _optimizeChanges.optimizeChanges)(changes);
|
|
@@ -95,13 +91,11 @@ var getAttributedChanges = function getAttributedChanges(_ref2) {
|
|
|
95
91
|
// the step attribution and promotes ranges to sentence/paragraph/node granularity, so a promoted
|
|
96
92
|
// range covers several actors' steps and the latest-writer rule credits all of it to one of them.
|
|
97
93
|
// The attributed changeset keeps step granularity instead.
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return (0, _groupChangesByBlock.groupChangesByBlock)(changeset.changes, originalDoc, steppedDoc);
|
|
104
|
-
}
|
|
94
|
+
if (diffType === 'step') {
|
|
95
|
+
return attributedChanges;
|
|
96
|
+
}
|
|
97
|
+
if (diffType === 'block') {
|
|
98
|
+
return (0, _groupChangesByBlock.groupChangesByBlock)(changeset.changes, originalDoc, steppedDoc);
|
|
105
99
|
}
|
|
106
100
|
return (0, _simplifyChangesWithAttribution.simplifyChangesWithAttribution)(attributedChanges, tr.doc);
|
|
107
101
|
};
|
|
@@ -200,7 +194,6 @@ var calculateNodesForBlockDecoration = function calculateNodesForBlockDecoration
|
|
|
200
194
|
showContributorTags = _ref5$showContributor === void 0 ? false : _ref5$showContributor,
|
|
201
195
|
_ref5$showIndicators = _ref5.showIndicators,
|
|
202
196
|
showIndicators = _ref5$showIndicators === void 0 ? false : _ref5$showIndicators,
|
|
203
|
-
diffType = _ref5.diffType,
|
|
204
197
|
_ref5$coarseTableCell = _ref5.coarseTableCellsOnly,
|
|
205
198
|
coarseTableCellsOnly = _ref5$coarseTableCell === void 0 ? false : _ref5$coarseTableCell,
|
|
206
199
|
tagMountContext = _ref5.tagMountContext,
|
|
@@ -237,7 +230,6 @@ var calculateNodesForBlockDecoration = function calculateNodesForBlockDecoration
|
|
|
237
230
|
showContributorTags: showContributorTags,
|
|
238
231
|
showIndicators: showIndicators,
|
|
239
232
|
doc: doc,
|
|
240
|
-
diffType: diffType,
|
|
241
233
|
tagMountContext: tagMountContext
|
|
242
234
|
})));
|
|
243
235
|
}
|
|
@@ -264,7 +256,7 @@ var calculateNodesForBlockDecoration = function calculateNodesForBlockDecoration
|
|
|
264
256
|
return;
|
|
265
257
|
}
|
|
266
258
|
}
|
|
267
|
-
if (node.isBlock && (!
|
|
259
|
+
if (node.isBlock && (!requireContainedBlocks || pos >= from) && pos + node.nodeSize <= to) {
|
|
268
260
|
var _nodeEnd = pos + node.nodeSize;
|
|
269
261
|
var _isActive = isRangeActive(activeIndexPos, pos, _nodeEnd);
|
|
270
262
|
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createBlockChangedDecoration.createBlockChangedDecoration)({
|
|
@@ -282,7 +274,6 @@ var calculateNodesForBlockDecoration = function calculateNodesForBlockDecoration
|
|
|
282
274
|
showContributorTags: showContributorTags,
|
|
283
275
|
showIndicators: showIndicators,
|
|
284
276
|
doc: doc,
|
|
285
|
-
diffType: diffType,
|
|
286
277
|
tagMountContext: tagMountContext
|
|
287
278
|
})));
|
|
288
279
|
}
|
|
@@ -331,10 +322,9 @@ var isDeletedContentPlacedBelow = exports.isDeletedContentPlacedBelow = function
|
|
|
331
322
|
*/
|
|
332
323
|
var shouldHideDeletedSide = function shouldHideDeletedSide(_ref7) {
|
|
333
324
|
var change = _ref7.change,
|
|
334
|
-
diffType = _ref7.diffType,
|
|
335
325
|
hideDeletedDiffs = _ref7.hideDeletedDiffs,
|
|
336
326
|
isInverted = _ref7.isInverted;
|
|
337
|
-
return
|
|
327
|
+
return !isInverted && !!hideDeletedDiffs && (change.inserted.length > 0 || (0, _fg.fg)('platform_editor_diff_hide_pure_deletions') && (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false) === true);
|
|
338
328
|
};
|
|
339
329
|
var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8) {
|
|
340
330
|
var state = _ref8.state,
|
|
@@ -347,7 +337,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
347
337
|
_ref8$isInverted = _ref8.isInverted,
|
|
348
338
|
isInverted = _ref8$isInverted === void 0 ? false : _ref8$isInverted,
|
|
349
339
|
_ref8$diffType = _ref8.diffType,
|
|
350
|
-
diffType = _ref8$diffType === void 0 ? (0,
|
|
340
|
+
diffType = _ref8$diffType === void 0 ? (0, _getDefaultDiffType.getDefaultDiffType)() : _ref8$diffType,
|
|
351
341
|
_ref8$hideDeletedDiff = _ref8.hideDeletedDiffs,
|
|
352
342
|
hideDeletedDiffs = _ref8$hideDeletedDiff === void 0 ? false : _ref8$hideDeletedDiff,
|
|
353
343
|
_ref8$hideAddedDiffsU = _ref8.hideAddedDiffsUnderline,
|
|
@@ -493,7 +483,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
493
483
|
stepIndex: stepIndex
|
|
494
484
|
});
|
|
495
485
|
}));
|
|
496
|
-
attributedChanges =
|
|
486
|
+
attributedChanges = diffType === 'step' ? (0, _diffBySteps.diffBySteps)(originalDoc, simplifiedSteps, simplifiedStepAttributions) : (0, _toConsumableArray2.default)(changeset.changes);
|
|
497
487
|
// The attributed pipeline gives no guarantee that its output ranges are disjoint — see
|
|
498
488
|
// `collapseOverlappingChanges`.
|
|
499
489
|
var uncollapsedChanges = getAttributedChanges({
|
|
@@ -528,15 +518,13 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
528
518
|
/**
|
|
529
519
|
* If showIndicators is on, we create an anchor widget here to mark the doc margin.
|
|
530
520
|
*/
|
|
531
|
-
if (showIndicators
|
|
521
|
+
if (showIndicators) {
|
|
532
522
|
decorations.push((0, _createAnchorDecorationWidgets.createDocMarginAnchorWidget)());
|
|
533
523
|
}
|
|
534
524
|
|
|
535
525
|
// Our default operations are insertions, so it should match the opposite of isInverted.
|
|
536
526
|
var isInserted = !isInverted;
|
|
537
|
-
|
|
538
|
-
changes = (0, _groupDeletedColumnChanges.groupDeletedColumnChanges)(changes, originalDoc, tr.doc, new _transform.Mapping(stepMaps), isInverted);
|
|
539
|
-
}
|
|
527
|
+
changes = (0, _groupDeletedColumnChanges.groupDeletedColumnChanges)(changes, originalDoc, tr.doc, new _transform.Mapping(stepMaps), isInverted);
|
|
540
528
|
// A whole-table change owns every mark and attribute range inside its bounds, so those ranges
|
|
541
529
|
// do not also get their own decoration.
|
|
542
530
|
var tableChanges = changes.filter(function (change) {
|
|
@@ -601,7 +589,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
601
589
|
});
|
|
602
590
|
if (change.inserted.length > 0) {
|
|
603
591
|
// On an inverted diff the inserted side is visually the deleted side.
|
|
604
|
-
var shouldHideDeleted =
|
|
592
|
+
var shouldHideDeleted = isInverted && hideDeletedDiffs;
|
|
605
593
|
|
|
606
594
|
// A removed blank line — an empty paragraph or heading — has nothing to mark up. On an
|
|
607
595
|
// inverted diff, the shape AI suggested edits renders, the block is still in the displayed
|
|
@@ -624,7 +612,6 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
624
612
|
decorations.push((0, _createDeletedLineBreakWidget.createDeletedLineBreakDecoration)({
|
|
625
613
|
attributionKey: attributionKey,
|
|
626
614
|
colorScheme: changeColorScheme,
|
|
627
|
-
diffType: diffType,
|
|
628
615
|
isActive: isActive,
|
|
629
616
|
pos: pos,
|
|
630
617
|
reveal: reveal,
|
|
@@ -659,7 +646,6 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
659
646
|
// boundary to keep the indicator bar continuous with the deleted content.
|
|
660
647
|
var willRenderDeletedWidget = change.deleted.length > 0 && !isMarkOnly && !shouldHideDeletedSide({
|
|
661
648
|
change: change,
|
|
662
|
-
diffType: diffType,
|
|
663
649
|
hideDeletedDiffs: hideDeletedDiffs,
|
|
664
650
|
isInverted: isInverted
|
|
665
651
|
});
|
|
@@ -678,7 +664,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
678
664
|
if (useCoarseTableDecoration && isInsideTable(coarseTables, from)) {
|
|
679
665
|
continue;
|
|
680
666
|
}
|
|
681
|
-
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createInlineChangedDecoration.createInlineChangedDecoration)(
|
|
667
|
+
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createInlineChangedDecoration.createInlineChangedDecoration)({
|
|
682
668
|
attributionKey: attributionKey,
|
|
683
669
|
change: {
|
|
684
670
|
fromB: from,
|
|
@@ -688,8 +674,6 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
688
674
|
doc: tr.doc,
|
|
689
675
|
colorScheme: changeColorScheme,
|
|
690
676
|
isActive: isActive,
|
|
691
|
-
diffType: diffType
|
|
692
|
-
}, (0, _isExtendedEnabled.isExtendedEnabled)(diffType) && {
|
|
693
677
|
isInserted: isInserted,
|
|
694
678
|
shouldHideDeleted: shouldHideDeleted,
|
|
695
679
|
showContributorTags: showContributorTags,
|
|
@@ -699,7 +683,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
699
683
|
isDeletedWidgetBelow: isDeletedWidgetBelow,
|
|
700
684
|
reveal: reveal,
|
|
701
685
|
tagMountContext: tagMountContext
|
|
702
|
-
})))
|
|
686
|
+
})));
|
|
703
687
|
}
|
|
704
688
|
} catch (err) {
|
|
705
689
|
_iterator4.e(err);
|
|
@@ -707,15 +691,13 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
707
691
|
_iterator4.f();
|
|
708
692
|
}
|
|
709
693
|
} else {
|
|
710
|
-
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createInlineChangedDecoration.createInlineChangedDecoration)(
|
|
694
|
+
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createInlineChangedDecoration.createInlineChangedDecoration)({
|
|
711
695
|
attributionKey: attributionKey,
|
|
712
696
|
change: change,
|
|
713
697
|
leftAnchorId: leftAnchorId,
|
|
714
698
|
doc: tr.doc,
|
|
715
699
|
colorScheme: changeColorScheme,
|
|
716
700
|
isActive: isActive,
|
|
717
|
-
diffType: diffType
|
|
718
|
-
}, (0, _isExtendedEnabled.isExtendedEnabled)(diffType) && {
|
|
719
701
|
isInserted: isInserted,
|
|
720
702
|
shouldHideDeleted: shouldHideDeleted,
|
|
721
703
|
showContributorTags: showContributorTags,
|
|
@@ -725,45 +707,39 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
725
707
|
isDeletedWidgetBelow: isDeletedWidgetBelow,
|
|
726
708
|
reveal: reveal,
|
|
727
709
|
tagMountContext: tagMountContext
|
|
728
|
-
})))
|
|
710
|
+
})));
|
|
729
711
|
}
|
|
730
|
-
decorations.push.apply(decorations, (0, _toConsumableArray2.default)(calculateNodesForBlockDecoration(
|
|
712
|
+
decorations.push.apply(decorations, (0, _toConsumableArray2.default)(calculateNodesForBlockDecoration({
|
|
731
713
|
attributionKey: attributionKey,
|
|
732
714
|
doc: tr.doc,
|
|
733
715
|
from: change.fromB,
|
|
734
716
|
to: change.toB,
|
|
735
717
|
// A split piece's own range no longer covers the container it opened (EDITOR-8932).
|
|
736
718
|
nodeRanges: change.blockNodeRangesB,
|
|
737
|
-
colorScheme: changeColorScheme
|
|
738
|
-
}, (0, _isExtendedEnabled.isExtendedEnabled)(diffType) && {
|
|
719
|
+
colorScheme: changeColorScheme,
|
|
739
720
|
isInserted: isInserted,
|
|
740
721
|
shouldHideDeleted: shouldHideDeleted,
|
|
741
722
|
showContributorTags: showContributorTags,
|
|
742
723
|
showIndicators: showIndicators,
|
|
743
|
-
tagMountContext: tagMountContext
|
|
744
|
-
}), {}, {
|
|
724
|
+
tagMountContext: tagMountContext,
|
|
745
725
|
activeIndexPos: activeIndexPos,
|
|
746
726
|
intl: intl,
|
|
747
|
-
diffType: diffType,
|
|
748
727
|
coarseTableCellsOnly: useCoarseTableDecoration,
|
|
749
728
|
leftAnchorId: leftAnchorId
|
|
750
|
-
})))
|
|
729
|
+
})));
|
|
751
730
|
}
|
|
752
731
|
if (change.deleted.length > 0 && !isMarkOnly && !hasNoDeletedContent) {
|
|
753
732
|
var _shouldHideDeleted = shouldHideDeletedSide({
|
|
754
733
|
change: change,
|
|
755
|
-
diffType: diffType,
|
|
756
734
|
hideDeletedDiffs: hideDeletedDiffs,
|
|
757
735
|
isInverted: isInverted
|
|
758
736
|
});
|
|
759
737
|
if (!_shouldHideDeleted) {
|
|
760
|
-
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createNodeChangedDecorationWidget.createNodeChangedDecorationWidget)(
|
|
738
|
+
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createNodeChangedDecorationWidget.createNodeChangedDecorationWidget)({
|
|
761
739
|
deletedColumns: deletedColumns,
|
|
762
740
|
// The deleted side has no inline decoration, so the widget carries the actor.
|
|
763
741
|
attributionKey: attributionKey,
|
|
764
|
-
|
|
765
|
-
// background for the wipe to act on.
|
|
766
|
-
reveal: (0, _isExtendedEnabled.isExtendedEnabled)(diffType) ? reveal : undefined,
|
|
742
|
+
reveal: reveal,
|
|
767
743
|
change: change,
|
|
768
744
|
doc: originalDoc,
|
|
769
745
|
nodeViewSerializer: nodeViewSerializer,
|
|
@@ -773,15 +749,12 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
773
749
|
activeIndexPos: activeIndexPos,
|
|
774
750
|
leftAnchorId: leftAnchorId,
|
|
775
751
|
showContributorTags: showContributorTags,
|
|
776
|
-
tagMountContext: tagMountContext
|
|
777
|
-
}, (0, _isExtendedEnabled.isExtendedEnabled)(diffType) && {
|
|
752
|
+
tagMountContext: tagMountContext,
|
|
778
753
|
isInserted: !isInserted,
|
|
779
|
-
diffType: diffType,
|
|
780
754
|
hideAddedDiffsUnderline: hideAddedDiffsUnderline,
|
|
781
|
-
placeBelow: isDeletedWidgetBelow
|
|
782
|
-
}), {}, {
|
|
755
|
+
placeBelow: isDeletedWidgetBelow,
|
|
783
756
|
showIndicators: showIndicators
|
|
784
|
-
})))
|
|
757
|
+
})));
|
|
785
758
|
}
|
|
786
759
|
}
|
|
787
760
|
};
|
|
@@ -812,7 +785,6 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
812
785
|
change: change,
|
|
813
786
|
colorScheme: changeColorScheme,
|
|
814
787
|
doc: tr.doc,
|
|
815
|
-
diffType: diffType,
|
|
816
788
|
isActive: isActive,
|
|
817
789
|
isInserted: true,
|
|
818
790
|
reveal: reveal,
|
|
@@ -850,8 +822,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
850
822
|
tagMountContext: tagMountContext,
|
|
851
823
|
// Suppress the border-bottom underline for atomic inline nodeviews —
|
|
852
824
|
// it doesn't render on custom nodeview DOM elements and is unnecessary noise.
|
|
853
|
-
hideAddedDiffsUnderline: true
|
|
854
|
-
diffType: diffType
|
|
825
|
+
hideAddedDiffsUnderline: true
|
|
855
826
|
})));
|
|
856
827
|
// If we have the original node position, also render the old node as a "deleted" widget
|
|
857
828
|
// so the user can see what it looked like before the change.
|
|
@@ -895,7 +866,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
895
866
|
var isSmartNodeLevelAttrChange = diffType === 'smart' && (0, _fg.fg)('platform_editor_ai_smart_diff') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_ai_xstate_migration', 'isEnabled', true) && (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false) === true;
|
|
896
867
|
if (isSmartNodeLevelAttrChange && change.fromA !== undefined && change.toA !== undefined) {
|
|
897
868
|
var placeBelow = deletedDiffPlacement === 'bottom';
|
|
898
|
-
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createNodeChangedDecorationWidget.createNodeChangedDecorationWidget)(
|
|
869
|
+
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createNodeChangedDecorationWidget.createNodeChangedDecorationWidget)({
|
|
899
870
|
change: {
|
|
900
871
|
fromA: change.fromA,
|
|
901
872
|
toA: change.toA,
|
|
@@ -910,16 +881,13 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
910
881
|
newDoc: tr.doc,
|
|
911
882
|
intl: intl,
|
|
912
883
|
activeIndexPos: activeIndexPos,
|
|
913
|
-
isInserted: false
|
|
914
|
-
}, (0, _isExtendedEnabled.isExtendedEnabled)(diffType) && {
|
|
915
|
-
diffType: diffType,
|
|
884
|
+
isInserted: false,
|
|
916
885
|
hideAddedDiffsUnderline: hideAddedDiffsUnderline,
|
|
917
|
-
placeBelow: placeBelow
|
|
918
|
-
}), {}, {
|
|
886
|
+
placeBelow: placeBelow,
|
|
919
887
|
showIndicators: showIndicators,
|
|
920
888
|
showContributorTags: showContributorTags,
|
|
921
889
|
tagMountContext: tagMountContext
|
|
922
|
-
})))
|
|
890
|
+
})));
|
|
923
891
|
}
|
|
924
892
|
}
|
|
925
893
|
});
|
|
@@ -928,7 +896,7 @@ var calculateDiffDecorationsInner = function calculateDiffDecorationsInner(_ref8
|
|
|
928
896
|
contributorTags: showContributorTags ? (0, _extractContributorTags.extractContributorTags)(decorationSet, contributors, activeIndexPos,
|
|
929
897
|
// The stops the step buttons walk, so a stop cannot hold a second tag for one
|
|
930
898
|
// contributor that navigation can never reach.
|
|
931
|
-
(0, _getScrollableDecorations.getScrollableDecorations)(decorationSet, tr.doc
|
|
899
|
+
(0, _getScrollableDecorations.getScrollableDecorations)(decorationSet, tr.doc)) : [],
|
|
932
900
|
decorations: decorationSet,
|
|
933
901
|
diffDescriptors: (0, _decorationKeys.extractDiffDescriptors)(decorationSet)
|
|
934
902
|
};
|
|
@@ -937,7 +905,7 @@ var calculateDiffDecorations = exports.calculateDiffDecorations = (0, _memoizeOn
|
|
|
937
905
|
// Cache results unless relevant inputs change. `tagMountContext` is deliberately absent: it is
|
|
938
906
|
// built once per plugin instance, so it can never be the reason a diff needs recalculating.
|
|
939
907
|
function (_ref14, _ref15) {
|
|
940
|
-
var
|
|
908
|
+
var _ref18;
|
|
941
909
|
var _ref16 = (0, _slicedToArray2.default)(_ref14, 1),
|
|
942
910
|
_ref16$ = _ref16[0],
|
|
943
911
|
pluginState = _ref16$.pluginState,
|
|
@@ -971,14 +939,10 @@ function (_ref14, _ref15) {
|
|
|
971
939
|
lastInlineDeletedDiffPlacement = _ref17$.inlineDeletedDiffPlacement,
|
|
972
940
|
lastReveal = _ref17$.reveal;
|
|
973
941
|
var originalDocIsSame = lastPluginState.originalDoc && pluginState.originalDoc && pluginState.originalDoc.eq(lastPluginState.originalDoc);
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
// other setting would leave the diff painted in the wrong resting state.
|
|
981
|
-
(0, _isEqual.default)(reveal, lastReveal)) !== null && _ref18 !== void 0 ? _ref18 : false;
|
|
982
|
-
}
|
|
983
|
-
return (_ref19 = originalDocIsSame && (0, _isEqual.default)(pluginState.steps, lastPluginState.steps) && (0, _isEqual.default)(pluginState.stepAttributions, lastPluginState.stepAttributions) && (0, _isEqual.default)(pluginState.contributors, lastPluginState.contributors) && state.doc.eq(lastState.doc) && colorScheme === lastColorScheme && intl.locale === lastIntl.locale && (0, _isEqual.default)(activeIndexPos, lastActiveIndexPos) && hideDeletedDiffs === lastHideDeletedDiffs) !== null && _ref19 !== void 0 ? _ref19 : false;
|
|
942
|
+
return (_ref18 = colorScheme === lastColorScheme && intl.locale === lastIntl.locale && isInverted === lastIsInverted && diffType === lastDiffType && (0, _isEqual.default)(activeIndexPos, lastActiveIndexPos) && originalDocIsSame && (0, _isEqual.default)(pluginState.steps, lastPluginState.steps) && (0, _isEqual.default)(pluginState.stepAttributions, lastPluginState.stepAttributions) &&
|
|
943
|
+
// Contributors can arrive after the first calculation; without this, tags never appear.
|
|
944
|
+
(0, _isEqual.default)(pluginState.contributors, lastPluginState.contributors) && state.doc.eq(lastState.doc) && hideDeletedDiffs === lastHideDeletedDiffs && hideAddedDiffsUnderline === lastHideAddedDiffsUnderline && showIndicators === lastShowIndicators && (0, _isEqual.default)(smartThresholds, lastSmartThresholds) && deletedDiffPlacement === lastDeletedDiffPlacement && inlineDeletedDiffPlacement === lastInlineDeletedDiffPlacement &&
|
|
945
|
+
// Turning the reveal on or off changes the emitted styles, so a cached result from the
|
|
946
|
+
// other setting would leave the diff painted in the wrong resting state.
|
|
947
|
+
(0, _isEqual.default)(reveal, lastReveal)) !== null && _ref18 !== void 0 ? _ref18 : false;
|
|
984
948
|
});
|
|
@@ -909,7 +909,7 @@ function buildDeletedCellOverlayRoundedStyle(colors) {
|
|
|
909
909
|
// --- Inline content style dispatch ---
|
|
910
910
|
|
|
911
911
|
/**
|
|
912
|
-
* Inserted inline content
|
|
912
|
+
* Inserted inline content. `insertedInlineTreatment` picks
|
|
913
913
|
* `text-decoration` vs a `border-bottom` rule; only the latter honours `hideAddedDiffsUnderline`.
|
|
914
914
|
*/
|
|
915
915
|
function buildInsertedInlineStyle(colors, isActive, hideAddedDiffsUnderline) {
|
|
@@ -4,37 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.standardDecorationMarkerVariable = exports.getStandardDeletedRowStyle = exports.getStandardDeletedContentStyleNew = exports.getStandardDeletedContentStyleActive = exports.getStandardDeletedContentStyle = exports.editingStyleRuleNode = exports.editingStyleQuoteNode = exports.editingStyleNode = exports.editingStyleExtendedNoUnderline = exports.editingStyleExtended = exports.editingStyleCardBlockNode = exports.editingStyleActiveExtendedNoUnderline = exports.editingStyleActiveExtended = exports.
|
|
7
|
+
exports.standardDecorationMarkerVariable = exports.getStandardDeletedRowStyle = exports.getStandardDeletedContentStyleNew = exports.getStandardDeletedContentStyleActive = exports.getStandardDeletedContentStyle = exports.editingStyleRuleNode = exports.editingStyleQuoteNode = exports.editingStyleNode = exports.editingStyleExtendedNoUnderline = exports.editingStyleExtended = exports.editingStyleCardBlockNode = exports.editingStyleActiveExtendedNoUnderline = exports.editingStyleActiveExtended = exports.editingContentStyleInBlockExtendedNoUnderline = exports.editingContentStyleInBlockExtended = exports.deletedStyleQuoteNodeWithLozengeActive = exports.deletedStyleQuoteNodeWithLozenge = exports.deletedStyleQuoteNode = exports.deletedInlineContentStyleExtended = exports.deletedDecorationMarkerVariable = exports.deletedContentStyleUnbounded = exports.deletedCellOverlayStyle = exports.deletedCellOverlayRoundedStyle = exports.deletedBlockOutlineRoundedActive = exports.deletedBlockOutlineRounded = exports.deletedBlockOutlineActive = exports.deletedBlockOutline = exports.addedCellOverlayStyle = exports.addedCellOverlayRoundedStyle = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
10
10
|
var _getStandardDeletedTextDecorationStyle = require("./getStandardDeletedTextDecorationStyle");
|
|
11
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
12
|
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) { (0, _defineProperty2.default)(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; }
|
|
13
|
-
// delete on platform_editor_diff_plugin_extended cleanup
|
|
14
|
-
var editingStyle = exports.editingStyle = (0, _lazyNodeView.convertToInlineCss)({
|
|
15
|
-
background: "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
|
|
16
|
-
textDecoration: 'underline',
|
|
17
|
-
textDecorationStyle: 'dotted',
|
|
18
|
-
textDecorationThickness: "var(--ds-space-025, 2px)",
|
|
19
|
-
textDecorationColor: "var(--ds-border-accent-purple, #AF59E1)"
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// delete on platform_editor_diff_plugin_extended cleanup
|
|
23
|
-
var editingContentStyleInBlock = exports.editingContentStyleInBlock = (0, _lazyNodeView.convertToInlineCss)({
|
|
24
|
-
textDecoration: 'underline',
|
|
25
|
-
textDecorationStyle: 'dotted',
|
|
26
|
-
textDecorationThickness: "var(--ds-space-025, 2px)",
|
|
27
|
-
textDecorationColor: "var(--ds-border-accent-purple, #AF59E1)"
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// delete on platform_editor_diff_plugin_extended cleanup
|
|
31
|
-
var editingStyleActive = exports.editingStyleActive = (0, _lazyNodeView.convertToInlineCss)({
|
|
32
|
-
background: "var(--ds-background-accent-purple-subtler-pressed, #D8A0F7)",
|
|
33
|
-
textDecoration: 'underline',
|
|
34
|
-
textDecorationStyle: 'dotted',
|
|
35
|
-
textDecorationThickness: "var(--ds-space-025, 2px)",
|
|
36
|
-
textDecorationColor: "var(--ds-text-accent-purple, #803FA5)"
|
|
37
|
-
});
|
|
38
13
|
var editingStyleExtended = exports.editingStyleExtended = (0, _lazyNodeView.convertToInlineCss)({
|
|
39
14
|
background: "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
|
|
40
15
|
borderBottom: "2px solid ".concat("var(--ds-border-accent-purple, #AF59E1)"),
|
|
@@ -12,7 +12,6 @@ var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
|
12
12
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
13
13
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
14
14
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
|
-
var _isExtendedEnabled = require("../isExtendedEnabled");
|
|
16
15
|
var _taggableBlockNodes = require("../utils/taggableBlockNodes");
|
|
17
16
|
var _factory = require("./colorSchemes/factory");
|
|
18
17
|
var _schemes = require("./colorSchemes/schemes");
|
|
@@ -51,10 +50,9 @@ var isInsideTable = function isInsideTable(doc, pos) {
|
|
|
51
50
|
*/
|
|
52
51
|
var canTagBlock = function canTagBlock(_ref) {
|
|
53
52
|
var _doc$nodeAt;
|
|
54
|
-
var
|
|
55
|
-
doc = _ref.doc,
|
|
53
|
+
var doc = _ref.doc,
|
|
56
54
|
from = _ref.from;
|
|
57
|
-
if (doc === undefined
|
|
55
|
+
if (doc === undefined) {
|
|
58
56
|
return false;
|
|
59
57
|
}
|
|
60
58
|
var nodeType = (_doc$nodeAt = doc.nodeAt(from)) === null || _doc$nodeAt === void 0 ? void 0 : _doc$nodeAt.type;
|
|
@@ -113,19 +111,15 @@ var getBlockNodeStyleNext = function getBlockNodeStyleNext(_ref2) {
|
|
|
113
111
|
_ref2$isInserted = _ref2.isInserted,
|
|
114
112
|
isInserted = _ref2$isInserted === void 0 ? true : _ref2$isInserted,
|
|
115
113
|
_ref2$isActive = _ref2.isActive,
|
|
116
|
-
isActive = _ref2$isActive === void 0 ? false : _ref2$isActive
|
|
117
|
-
diffType = _ref2.diffType;
|
|
114
|
+
isActive = _ref2$isActive === void 0 ? false : _ref2$isActive;
|
|
118
115
|
if (UNSTYLED_NODES.includes(nodeName)) {
|
|
119
116
|
return undefined;
|
|
120
117
|
}
|
|
121
118
|
if (CELL_NODES.includes(nodeName)) {
|
|
122
|
-
|
|
123
|
-
return (0, _isExtendedEnabled.isExtendedEnabled)(diffType) ? cellPositionStyle : undefined;
|
|
119
|
+
return cellPositionStyle;
|
|
124
120
|
}
|
|
125
121
|
var colors = _schemes.colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : DEFAULT_COLOR_SCHEME];
|
|
126
|
-
|
|
127
|
-
// Deleted nodes only differ under the extended experience; otherwise all are insertions.
|
|
128
|
-
if (!isInserted && (0, _isExtendedEnabled.isExtendedEnabled)(diffType)) {
|
|
122
|
+
if (!isInserted) {
|
|
129
123
|
return (0, _factory.buildDeletedBlockNodeStyle)(colors, getDeletedBlockNodeCategory(nodeName), isActive);
|
|
130
124
|
}
|
|
131
125
|
return (0, _factory.buildInsertedBlockNodeStyle)(colors, getInsertedBlockNodeShape(nodeName), isActive);
|
|
@@ -192,14 +186,12 @@ var createBlockChangedDecoration = exports.createBlockChangedDecoration = functi
|
|
|
192
186
|
_ref3$showIndicators = _ref3.showIndicators,
|
|
193
187
|
showIndicators = _ref3$showIndicators === void 0 ? false : _ref3$showIndicators,
|
|
194
188
|
doc = _ref3.doc,
|
|
195
|
-
diffType = _ref3.diffType,
|
|
196
189
|
tagMountContext = _ref3.tagMountContext;
|
|
197
190
|
var decorations = [];
|
|
198
191
|
// Derived from the node range so it survives a recalculation, as in
|
|
199
192
|
// `createInlineChangedDecoration`. Changes are disjoint, so no two of them decorate one node.
|
|
200
193
|
var diffId = showContributorTags ? "block-".concat(change.from, "-").concat(change.to) : crypto.randomUUID();
|
|
201
194
|
var shouldTagBlock = showContributorTags && canTagBlock({
|
|
202
|
-
diffType: diffType,
|
|
203
195
|
doc: doc,
|
|
204
196
|
from: change.from
|
|
205
197
|
});
|
|
@@ -218,11 +210,10 @@ var createBlockChangedDecoration = exports.createBlockChangedDecoration = functi
|
|
|
218
210
|
leftAnchorId: leftAnchorId,
|
|
219
211
|
isActive: isActive,
|
|
220
212
|
isInserted: isInserted,
|
|
221
|
-
nodeName: change.name
|
|
222
|
-
diffType: diffType
|
|
213
|
+
nodeName: change.name
|
|
223
214
|
}))];
|
|
224
215
|
}
|
|
225
|
-
if (
|
|
216
|
+
if (CELL_NODES.includes(change.name)) {
|
|
226
217
|
var cellOverlay = document.createElement('div');
|
|
227
218
|
var colors = _schemes.colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : DEFAULT_COLOR_SCHEME];
|
|
228
219
|
var isRoundedTable = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_diff_rounded_corners');
|
|
@@ -246,15 +237,13 @@ var createBlockChangedDecoration = exports.createBlockChangedDecoration = functi
|
|
|
246
237
|
key: 'cell-overlay-decoration'
|
|
247
238
|
}));
|
|
248
239
|
}
|
|
249
|
-
//
|
|
250
|
-
//
|
|
251
|
-
// variant's legacy style is untouched — see `resolveBaseNodeName`.
|
|
240
|
+
// `change.name` verbatim: base-name resolution stays in `canTagBlock`, which needs tags on, so a
|
|
241
|
+
// schema variant's legacy style is untouched — see `resolveBaseNodeName`.
|
|
252
242
|
var nodeStyle = getBlockNodeStyle({
|
|
253
243
|
nodeName: change.name,
|
|
254
244
|
colorScheme: colorScheme,
|
|
255
245
|
isInserted: isInserted,
|
|
256
|
-
isActive: isActive
|
|
257
|
-
diffType: diffType
|
|
246
|
+
isActive: isActive
|
|
258
247
|
});
|
|
259
248
|
var style = tagAnchorName ? [nodeStyle, (0, _lazyNodeView.convertToInlineCss)({
|
|
260
249
|
anchorName: "--".concat(tagAnchorName)
|
|
@@ -275,8 +264,7 @@ var createBlockChangedDecoration = exports.createBlockChangedDecoration = functi
|
|
|
275
264
|
leftAnchorId: leftAnchorId,
|
|
276
265
|
isActive: isActive,
|
|
277
266
|
isInserted: isInserted,
|
|
278
|
-
nodeName: change.name
|
|
279
|
-
diffType: diffType
|
|
267
|
+
nodeName: change.name
|
|
280
268
|
})));
|
|
281
269
|
}
|
|
282
270
|
if (decorations.length === 0) {
|
|
@@ -284,7 +272,7 @@ var createBlockChangedDecoration = exports.createBlockChangedDecoration = functi
|
|
|
284
272
|
// there is nothing for a tag to hang off even when the node type would otherwise be taggable.
|
|
285
273
|
return decorations;
|
|
286
274
|
}
|
|
287
|
-
if (showIndicators && doc
|
|
275
|
+
if (showIndicators && doc) {
|
|
288
276
|
decorations.push.apply(decorations, (0, _toConsumableArray2.default)((0, _createAnchorDecorationWidgets.createBlockIndicatorAnchorWidgets)({
|
|
289
277
|
doc: doc,
|
|
290
278
|
from: change.from,
|