@atlaskit/editor-plugin-show-diff 19.0.2 → 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 +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 +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
|
@@ -5,7 +5,6 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
5
5
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
-
import { isExtendedEnabled } from '../isExtendedEnabled';
|
|
9
8
|
import { buildAddedCellOverlayRoundedStyle, buildAddedCellOverlayStyle, buildDeletedCellOverlayRoundedStyle, buildDeletedCellOverlayStyle, buildDeletedRowStyle } from './colorSchemes/factory';
|
|
10
9
|
import { colorSchemeRegistry, getLegacyColorScheme } from './colorSchemes/schemes';
|
|
11
10
|
import { createLeftAnchorWidget } from './createAnchorDecorationWidgets';
|
|
@@ -21,8 +20,7 @@ import { createRemovedLozenge } from './utils/wrapBlockNodeView';
|
|
|
21
20
|
const extractChangedRows = ({
|
|
22
21
|
change,
|
|
23
22
|
originalDoc,
|
|
24
|
-
newDoc
|
|
25
|
-
diffType
|
|
23
|
+
newDoc
|
|
26
24
|
}) => {
|
|
27
25
|
const changedRows = [];
|
|
28
26
|
|
|
@@ -57,7 +55,7 @@ const extractChangedRows = ({
|
|
|
57
55
|
// Find which rows were changed by analyzing the change range
|
|
58
56
|
const changeStartInTable = change.fromA - tableOld.pos - 1;
|
|
59
57
|
const changeEndInTable = change.toA - tableOld.pos - 1;
|
|
60
|
-
const edgeAttrsByOffset =
|
|
58
|
+
const edgeAttrsByOffset = expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_diff_rounded_corners') ? getTableTopAndBottomCellEdgeAttrs(oldTableMap) : undefined;
|
|
61
59
|
let currentOffset = 0;
|
|
62
60
|
let rowIndex = 0;
|
|
63
61
|
tableOld.node.content.forEach(rowNode => {
|
|
@@ -66,7 +64,7 @@ const extractChangedRows = ({
|
|
|
66
64
|
|
|
67
65
|
// Check if this row overlaps with the deletion range
|
|
68
66
|
const rowOverlapsChange = rowStart >= changeStartInTable && rowStart < changeEndInTable || rowEnd > changeStartInTable && rowEnd <= changeEndInTable || rowStart < changeStartInTable && rowEnd > changeEndInTable;
|
|
69
|
-
if (rowOverlapsChange && rowNode.type.name === 'tableRow'
|
|
67
|
+
if (rowOverlapsChange && rowNode.type.name === 'tableRow') {
|
|
70
68
|
const rowLocalId = rowNode.attrs.localId;
|
|
71
69
|
const isTableRowReplacement = rowLocalId && tableNew.node.children.some(candidateRow => candidateRow.type.name === 'tableRow' && candidateRow.attrs.localId === rowLocalId);
|
|
72
70
|
const cellEdgeAttrs = edgeAttrsByOffset ? getRowCellEdgeAttrs({
|
|
@@ -122,32 +120,6 @@ const extractChangedRows = ({
|
|
|
122
120
|
return true;
|
|
123
121
|
});
|
|
124
122
|
};
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Checks if a table row is empty (contains no meaningful content)
|
|
128
|
-
*/
|
|
129
|
-
const isEmptyRow = rowNode => {
|
|
130
|
-
let isEmpty = true;
|
|
131
|
-
rowNode.descendants(node => {
|
|
132
|
-
if (!isEmpty) {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// If we find any inline content with size > 0, the row is not empty
|
|
137
|
-
if (node.isInline && node.nodeSize > 0) {
|
|
138
|
-
isEmpty = false;
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// If we find text content, the row is not empty
|
|
143
|
-
if (node.isText && node.text && node.text.trim() !== '') {
|
|
144
|
-
isEmpty = false;
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
return true;
|
|
148
|
-
});
|
|
149
|
-
return isEmpty;
|
|
150
|
-
};
|
|
151
123
|
/**
|
|
152
124
|
* Creates a DOM representation of a deleted table row
|
|
153
125
|
*/
|
|
@@ -158,7 +130,6 @@ const createChangedRowDOM = ({
|
|
|
158
130
|
isTableRowReplacement,
|
|
159
131
|
colorScheme,
|
|
160
132
|
isInserted,
|
|
161
|
-
diffType,
|
|
162
133
|
hasAnchoredRemovedLozenge,
|
|
163
134
|
intl,
|
|
164
135
|
isActive
|
|
@@ -169,16 +140,15 @@ const createChangedRowDOM = ({
|
|
|
169
140
|
}
|
|
170
141
|
const colors = colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : 'standard'];
|
|
171
142
|
const deletedTreatment = isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? buildDeletedRowStyle(colors) : resolveDeletedRowStyleLegacy(getLegacyColorScheme(colorScheme));
|
|
172
|
-
const hostsRemovedLozenge = Boolean(intl) &&
|
|
143
|
+
const hostsRemovedLozenge = Boolean(intl) && !isInserted && !hasAnchoredRemovedLozenge;
|
|
173
144
|
|
|
174
145
|
// Inserted rows keep their natural styling; the row strikethrough is deletions only.
|
|
175
|
-
if (!
|
|
146
|
+
if (!isInserted) {
|
|
176
147
|
tr.setAttribute('style', deletedTreatment);
|
|
177
148
|
}
|
|
178
|
-
// Mirrors the strikethrough condition above:
|
|
179
|
-
// is ADDED content, so it must not claim the "deleted" testid — page models match that as
|
|
149
|
+
// Mirrors the strikethrough condition above: an `isInserted` row is ADDED content, so it must not claim the "deleted" testid — page models match that as
|
|
180
150
|
// removed content (same reasoning as `createTableCellContentWidgets`).
|
|
181
|
-
tr.setAttribute('data-testid',
|
|
151
|
+
tr.setAttribute('data-testid', isInserted && fg('platform_editor_ai_show_diff_patch_1') ? 'show-diff-changed-row' : 'show-diff-deleted-row');
|
|
182
152
|
if (fg('platform_editor_ai_show_diff_patch_1')) {
|
|
183
153
|
tr.style.setProperty('scroll-margin-top', scrollMarginTopValue);
|
|
184
154
|
}
|
|
@@ -191,17 +161,15 @@ const createChangedRowDOM = ({
|
|
|
191
161
|
if (nodeView) {
|
|
192
162
|
if (nodeView instanceof HTMLElement) {
|
|
193
163
|
applyCellEdgeAttrs(nodeView, cellEdgeAttrs === null || cellEdgeAttrs === void 0 ? void 0 : cellEdgeAttrs[cellIndex]);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
nodeView.appendChild(overlay);
|
|
204
|
-
}
|
|
164
|
+
const overlay = document.createElement('span');
|
|
165
|
+
const isRoundedTable = isExperimentEnabled('platform_editor_table_diff_rounded_corners');
|
|
166
|
+
const overlayStyle = isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? isInserted ? isRoundedTable ? buildAddedCellOverlayRoundedStyle(colors) : buildAddedCellOverlayStyle(colors) : isRoundedTable ? buildDeletedCellOverlayRoundedStyle(colors) : buildDeletedCellOverlayStyle(colors) : resolveCellOverlayStyleLegacy({
|
|
167
|
+
colorScheme: getLegacyColorScheme(colorScheme),
|
|
168
|
+
isInserted,
|
|
169
|
+
isRoundedTable
|
|
170
|
+
});
|
|
171
|
+
overlay.setAttribute('style', overlayStyle);
|
|
172
|
+
nodeView.appendChild(overlay);
|
|
205
173
|
}
|
|
206
174
|
tr.appendChild(nodeView);
|
|
207
175
|
} else {
|
|
@@ -255,8 +223,7 @@ const createAnchoredRemovedLozengeWidget = ({
|
|
|
255
223
|
const expandDiffForChangedRows = ({
|
|
256
224
|
changes,
|
|
257
225
|
originalDoc,
|
|
258
|
-
newDoc
|
|
259
|
-
diffType
|
|
226
|
+
newDoc
|
|
260
227
|
}) => {
|
|
261
228
|
const rowInfo = [];
|
|
262
229
|
for (const change of changes) {
|
|
@@ -264,8 +231,7 @@ const expandDiffForChangedRows = ({
|
|
|
264
231
|
const changedRows = extractChangedRows({
|
|
265
232
|
change,
|
|
266
233
|
originalDoc,
|
|
267
|
-
newDoc
|
|
268
|
-
diffType
|
|
234
|
+
newDoc
|
|
269
235
|
});
|
|
270
236
|
if (changedRows.length > 0) {
|
|
271
237
|
rowInfo.push(...changedRows);
|
|
@@ -287,7 +253,6 @@ export const createChangedRowDecorationWidgets = ({
|
|
|
287
253
|
isActive,
|
|
288
254
|
isInserted = false,
|
|
289
255
|
leftAnchorId,
|
|
290
|
-
diffType,
|
|
291
256
|
intl,
|
|
292
257
|
showIndicators = false,
|
|
293
258
|
showContributorTags = false,
|
|
@@ -297,13 +262,12 @@ export const createChangedRowDecorationWidgets = ({
|
|
|
297
262
|
const changedRows = expandDiffForChangedRows({
|
|
298
263
|
changes: changes.filter(change => change.deleted.length > 0),
|
|
299
264
|
originalDoc,
|
|
300
|
-
newDoc
|
|
301
|
-
diffType
|
|
265
|
+
newDoc
|
|
302
266
|
});
|
|
303
267
|
return changedRows.flatMap(changedRow => {
|
|
304
268
|
// Keep the ID stable while contributor tags are enabled so recalculation preserves their state.
|
|
305
269
|
const diffId = showContributorTags ? `widget-row-${changedRow.fromA}-${changedRow.toA}` : crypto.randomUUID();
|
|
306
|
-
const hasAnchoredRemovedLozenge = Boolean(intl) &&
|
|
270
|
+
const hasAnchoredRemovedLozenge = Boolean(intl) && !isInserted && supportsAnchorPositioning();
|
|
307
271
|
const rowDOM = createChangedRowDOM({
|
|
308
272
|
rowNode: changedRow.rowNode,
|
|
309
273
|
isTableRowReplacement: changedRow.isTableRowReplacement,
|
|
@@ -311,7 +275,6 @@ export const createChangedRowDecorationWidgets = ({
|
|
|
311
275
|
nodeViewSerializer,
|
|
312
276
|
colorScheme,
|
|
313
277
|
isInserted,
|
|
314
|
-
diffType,
|
|
315
278
|
hasAnchoredRemovedLozenge,
|
|
316
279
|
intl,
|
|
317
280
|
isActive
|
|
@@ -329,7 +292,7 @@ export const createChangedRowDecorationWidgets = ({
|
|
|
329
292
|
// is still created but can never resolve a position, so it silently does not render and the
|
|
330
293
|
// bar covers only the row being changed. `createNodeChangedDecorationWidget` sets the same
|
|
331
294
|
// property on its own widget DOM for non-table content; this path returns before reaching it.
|
|
332
|
-
if (showIndicators &&
|
|
295
|
+
if (showIndicators && fg('platform_editor_ai_show_diff_patch_1')) {
|
|
333
296
|
rowAnchorNames.push(buildAnchorDecorationKey({
|
|
334
297
|
diffId
|
|
335
298
|
}));
|
|
@@ -383,8 +346,7 @@ export const createChangedRowDecorationWidgets = ({
|
|
|
383
346
|
diffId,
|
|
384
347
|
leftAnchorId,
|
|
385
348
|
isActive,
|
|
386
|
-
isInserted
|
|
387
|
-
diffType
|
|
349
|
+
isInserted
|
|
388
350
|
})
|
|
389
351
|
});
|
|
390
352
|
decorations.push(rowWidget);
|
|
@@ -3,7 +3,6 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
|
3
3
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
5
|
import { CONTRIBUTOR_TAG_Z_INDEX } from '../../ui/ContributorTag/buildContributorTagDom';
|
|
6
|
-
import { isExtendedEnabled } from '../isExtendedEnabled';
|
|
7
6
|
import { isEmptyParagraphSlice } from '../utils/isEmptyParagraphSlice';
|
|
8
7
|
import { buildAtomicInlineChangedCSSVariables, buildDeletedInlineContentStyleExtended, buildDeletedInlineNodeCSSVariables, buildDeletedInlineStyle, buildDeletedInlineStyleStandard, buildInsertStyle, buildInsertStyleActive, buildInsertStyleExtended, buildInsertStyleExtendedActive, buildInsertStyleExtendedNoUnderline, buildInsertStyleExtendedNoUnderlineActive } from './colorSchemes/factory';
|
|
9
8
|
import { colorSchemeRegistry, getLegacyColorScheme } from './colorSchemes/schemes';
|
|
@@ -54,7 +53,7 @@ const getAtomicInlineNodeClassName = inlineNodeName => {
|
|
|
54
53
|
return classNames.join(' ');
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
/** Inline style for inserted content
|
|
56
|
+
/** Inline style for inserted content. */
|
|
58
57
|
const getExtendedInsertStyle = (colors, isActive, hideAddedDiffsUnderline) => {
|
|
59
58
|
if (colors.insertedInlineTreatment === 'underline') {
|
|
60
59
|
// hideAddedDiffsUnderline only targets the 'borderBottom' rule, so it does not apply here.
|
|
@@ -66,7 +65,7 @@ const getExtendedInsertStyle = (colors, isActive, hideAddedDiffsUnderline) => {
|
|
|
66
65
|
return hideAddedDiffsUnderline ? buildInsertStyleExtendedNoUnderline(colors) : buildInsertStyleExtended(colors);
|
|
67
66
|
};
|
|
68
67
|
|
|
69
|
-
/** Inline style for deleted content
|
|
68
|
+
/** Inline style for deleted content. */
|
|
70
69
|
const getExtendedDeletedStyle = (colors, isActive) => {
|
|
71
70
|
if (colors.deletedInlineTreatment === 'strikethrough') {
|
|
72
71
|
// Identical in both states — the block decoration carries the active emphasis.
|
|
@@ -78,16 +77,10 @@ const getExtendedDeletedStyle = (colors, isActive) => {
|
|
|
78
77
|
/** Registry-driven inline `style` for a changed-content decoration. */
|
|
79
78
|
const resolveInlineChangedStyleRefactored = ({
|
|
80
79
|
colors,
|
|
81
|
-
diffType,
|
|
82
80
|
hideAddedDiffsUnderline,
|
|
83
81
|
isActive,
|
|
84
82
|
isInserted
|
|
85
|
-
}) =>
|
|
86
|
-
if (isExtendedEnabled(diffType)) {
|
|
87
|
-
return isInserted ? getExtendedInsertStyle(colors, isActive, hideAddedDiffsUnderline) : getExtendedDeletedStyle(colors, isActive);
|
|
88
|
-
}
|
|
89
|
-
return isActive ? buildInsertStyleActive(colors) : buildInsertStyle(colors);
|
|
90
|
-
};
|
|
83
|
+
}) => isInserted ? getExtendedInsertStyle(colors, isActive, hideAddedDiffsUnderline) : getExtendedDeletedStyle(colors, isActive);
|
|
91
84
|
|
|
92
85
|
/**
|
|
93
86
|
* Single gate for the inline `style` string: registry + factory when the refactor is on, the
|
|
@@ -132,7 +125,6 @@ export const createInlineChangedDecoration = ({
|
|
|
132
125
|
showContributorTags = false,
|
|
133
126
|
showIndicators = false,
|
|
134
127
|
doc,
|
|
135
|
-
diffType,
|
|
136
128
|
hideAddedDiffsUnderline = false,
|
|
137
129
|
inlineNodeName,
|
|
138
130
|
hasDeletedWidget = false,
|
|
@@ -148,7 +140,7 @@ export const createInlineChangedDecoration = ({
|
|
|
148
140
|
|
|
149
141
|
// Match the rendered shape: whitespace text is eligible, while an empty paragraph is structural
|
|
150
142
|
// content with no tag host.
|
|
151
|
-
const canTagChange = showContributorTags && !!doc &&
|
|
143
|
+
const canTagChange = showContributorTags && !!doc && isContributorTagWidgetEnabled() && !isEmptyParagraphSlice(doc.slice(change.fromB, change.toB));
|
|
152
144
|
if (shouldHideDeleted) {
|
|
153
145
|
return [Decoration.inline(change.fromB, change.toB, {
|
|
154
146
|
style: displayNoneStyle
|
|
@@ -166,19 +158,17 @@ export const createInlineChangedDecoration = ({
|
|
|
166
158
|
const colors = getColorScheme(colorScheme);
|
|
167
159
|
|
|
168
160
|
// The reveal withholds the static highlight so the wipe has something to reveal, so it supplies
|
|
169
|
-
// the whole style rather than adding to the usual one.
|
|
170
|
-
|
|
171
|
-
const revealed = isExtendedEnabled(diffType) ? resolveRevealStyle({
|
|
161
|
+
// the whole style rather than adding to the usual one.
|
|
162
|
+
const revealed = resolveRevealStyle({
|
|
172
163
|
colorScheme,
|
|
173
164
|
hideAddedDiffsUnderline,
|
|
174
165
|
isActive,
|
|
175
166
|
isInserted,
|
|
176
167
|
reveal
|
|
177
|
-
})
|
|
168
|
+
});
|
|
178
169
|
const style = (_revealed$style = revealed === null || revealed === void 0 ? void 0 : revealed.style) !== null && _revealed$style !== void 0 ? _revealed$style : resolveInlineChangedStyle({
|
|
179
170
|
colors,
|
|
180
171
|
colorScheme,
|
|
181
|
-
diffType,
|
|
182
172
|
hideAddedDiffsUnderline,
|
|
183
173
|
isActive,
|
|
184
174
|
isInserted
|
|
@@ -233,7 +223,7 @@ export const createInlineChangedDecoration = ({
|
|
|
233
223
|
isActive,
|
|
234
224
|
isInserted
|
|
235
225
|
}))];
|
|
236
|
-
if (showIndicators && doc
|
|
226
|
+
if (showIndicators && doc) {
|
|
237
227
|
// For paragraphs, fromB/toB land on the outer block
|
|
238
228
|
// boundary. Adjust anchor widgets into inline content so the indicator
|
|
239
229
|
// bar doesn't extend into the preceding block's margin.
|
|
@@ -8,42 +8,27 @@
|
|
|
8
8
|
* remains unchanged. Delete the whole file at experiment cleanup (EDITOR-8281).
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { deletedInlineContentStyleExtended, editingStyle, editingStyleActive, editingStyleActiveExtended, editingStyleActiveExtendedNoUnderline, editingStyleExtended, editingStyleExtendedNoUnderline, getStandardDeletedContentStyle, getStandardDeletedContentStyleActive } from './colorSchemes/standard';
|
|
11
|
+
import { deletedInlineContentStyleExtended, editingStyleActiveExtended, editingStyleActiveExtendedNoUnderline, editingStyleExtended, editingStyleExtendedNoUnderline, getStandardDeletedContentStyle, getStandardDeletedContentStyleActive } from './colorSchemes/standard';
|
|
13
12
|
import { getDeletedTraditionalInlineStyle, traditionalInsertStyle, traditionalInsertStyleActive } from './colorSchemes/traditional';
|
|
14
13
|
/**
|
|
15
14
|
* Pre-refactor inline `style` computation for `createInlineChangedDecoration`.
|
|
16
15
|
*/
|
|
17
16
|
export const resolveInlineChangedStyleLegacy = ({
|
|
18
17
|
colorScheme,
|
|
19
|
-
diffType,
|
|
20
18
|
hideAddedDiffsUnderline,
|
|
21
19
|
isActive,
|
|
22
20
|
isInserted
|
|
23
21
|
}) => {
|
|
24
|
-
|
|
25
|
-
if (isExtendedEnabled(diffType)) {
|
|
26
|
-
if (isInserted) {
|
|
27
|
-
if (colorScheme === 'traditional') {
|
|
28
|
-
style = isActive ? traditionalInsertStyleActive : traditionalInsertStyle;
|
|
29
|
-
} else {
|
|
30
|
-
style = isActive ? hideAddedDiffsUnderline ? editingStyleActiveExtendedNoUnderline : editingStyleActiveExtended : hideAddedDiffsUnderline ? editingStyleExtendedNoUnderline : editingStyleExtended;
|
|
31
|
-
}
|
|
32
|
-
} else {
|
|
33
|
-
if (colorScheme === 'traditional') {
|
|
34
|
-
style = getDeletedTraditionalInlineStyle(false);
|
|
35
|
-
} else {
|
|
36
|
-
style = (isActive ? getStandardDeletedContentStyleActive() : getStandardDeletedContentStyle()) + deletedInlineContentStyleExtended;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
22
|
+
if (isInserted) {
|
|
40
23
|
if (colorScheme === 'traditional') {
|
|
41
|
-
|
|
42
|
-
} else {
|
|
43
|
-
style = isActive ? editingStyleActive : editingStyle;
|
|
24
|
+
return isActive ? traditionalInsertStyleActive : traditionalInsertStyle;
|
|
44
25
|
}
|
|
26
|
+
return isActive ? hideAddedDiffsUnderline ? editingStyleActiveExtendedNoUnderline : editingStyleActiveExtended : hideAddedDiffsUnderline ? editingStyleExtendedNoUnderline : editingStyleExtended;
|
|
27
|
+
}
|
|
28
|
+
if (colorScheme === 'traditional') {
|
|
29
|
+
return getDeletedTraditionalInlineStyle(false);
|
|
45
30
|
}
|
|
46
|
-
return
|
|
31
|
+
return (isActive ? getStandardDeletedContentStyleActive() : getStandardDeletedContentStyle()) + deletedInlineContentStyleExtended;
|
|
47
32
|
};
|
|
48
33
|
|
|
49
34
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
|
-
import { isExtendedEnabled } from '../isExtendedEnabled';
|
|
4
3
|
import { countEmptyTextBlockOnlySlice } from '../utils/emptyTextBlocks';
|
|
5
4
|
import { isEmptyParagraphSlice } from '../utils/isEmptyParagraphSlice';
|
|
6
5
|
import { clampAnchorPosIntoCell, createLeftAnchorWidget } from './createAnchorDecorationWidgets';
|
|
@@ -29,8 +28,7 @@ const createTableCellContentWidgets = ({
|
|
|
29
28
|
nodeViewSerializer,
|
|
30
29
|
colorScheme,
|
|
31
30
|
isInserted,
|
|
32
|
-
leftAnchorId
|
|
33
|
-
diffType
|
|
31
|
+
leftAnchorId
|
|
34
32
|
}) => {
|
|
35
33
|
// Collect the inner content position of each cell in the new document within
|
|
36
34
|
// the change range. Whole-cell replacement preserves cell count/order, so the
|
|
@@ -59,7 +57,7 @@ const createTableCellContentWidgets = ({
|
|
|
59
57
|
// so every block inside the cell is rendered.
|
|
60
58
|
cellNode.content.forEach(blockNode => {
|
|
61
59
|
const nodeView = nodeViewSerializer.tryCreateNodeView(blockNode);
|
|
62
|
-
const wrapper = createContentWrapper(colorScheme, false, isInserted
|
|
60
|
+
const wrapper = createContentWrapper(colorScheme, false, isInserted);
|
|
63
61
|
if (nodeView) {
|
|
64
62
|
wrapper.append(nodeView);
|
|
65
63
|
} else {
|
|
@@ -90,10 +88,7 @@ const createTableCellContentWidgets = ({
|
|
|
90
88
|
diffId: crypto.randomUUID(),
|
|
91
89
|
leftAnchorId,
|
|
92
90
|
isInserted,
|
|
93
|
-
|
|
94
|
-
...(isExtendedEnabled(diffType) && {
|
|
95
|
-
side: -1
|
|
96
|
-
})
|
|
91
|
+
side: -1
|
|
97
92
|
})
|
|
98
93
|
}));
|
|
99
94
|
});
|
|
@@ -122,7 +117,6 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
122
117
|
// before it. Used for `smart` node-level changes so the deleted node appears beneath
|
|
123
118
|
// its replacement (gray + strikethrough).
|
|
124
119
|
placeBelow = false,
|
|
125
|
-
diffType,
|
|
126
120
|
hideAddedDiffsUnderline = false,
|
|
127
121
|
reveal,
|
|
128
122
|
tagMountContext,
|
|
@@ -155,7 +149,6 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
155
149
|
return [createDeletedLineBreakDecoration({
|
|
156
150
|
colorScheme,
|
|
157
151
|
count: deletedBlankLineCount,
|
|
158
|
-
diffType,
|
|
159
152
|
isActive,
|
|
160
153
|
pos: safeInsertPos,
|
|
161
154
|
reveal,
|
|
@@ -180,8 +173,7 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
180
173
|
nodeViewSerializer,
|
|
181
174
|
colorScheme,
|
|
182
175
|
isInserted,
|
|
183
|
-
leftAnchorId
|
|
184
|
-
diffType
|
|
176
|
+
leftAnchorId
|
|
185
177
|
});
|
|
186
178
|
}
|
|
187
179
|
if (tableDiffMode.kind === 'none') {
|
|
@@ -198,7 +190,6 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
198
190
|
isActive,
|
|
199
191
|
isInserted,
|
|
200
192
|
leftAnchorId,
|
|
201
|
-
diffType,
|
|
202
193
|
intl,
|
|
203
194
|
// Needed for the row's own indicator anchor; this path returns before the
|
|
204
195
|
// `anchor-name` assignment further down.
|
|
@@ -225,8 +216,8 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
225
216
|
const isVisuallyFirstInParent = !placeBelow && $safeInsertPos.parentOffset === 0;
|
|
226
217
|
const isTopLevelInsert = $safeInsertPos.depth === 0;
|
|
227
218
|
const hasPreviousBlock = ((_$safeInsertPos$nodeB = $safeInsertPos.nodeBefore) === null || _$safeInsertPos$nodeB === void 0 ? void 0 : _$safeInsertPos$nodeB.isBlock) === true;
|
|
228
|
-
const isFirstDocHeadingReplacement =
|
|
229
|
-
if (
|
|
219
|
+
const isFirstDocHeadingReplacement = !placeBelow && change.fromB === 0 && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type.name) === 'heading' && ((_newDoc$firstChild = newDoc.firstChild) === null || _newDoc$firstChild === void 0 ? void 0 : _newDoc$firstChild.type.name) === 'heading';
|
|
220
|
+
if (isTopLevelInsert && hasPreviousBlock && !isFirstDocHeadingReplacement) {
|
|
230
221
|
// Editor CSS removes the top margin from a block when it is its parent's first child.
|
|
231
222
|
// Keep the serialized block as a subsequent child so each block type retains its own margin.
|
|
232
223
|
dom.append(dom.ownerDocument.createElement('div'));
|
|
@@ -242,27 +233,23 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
242
233
|
// incorrectly applies because isNestedNode resolves to false (getPos returns 0).
|
|
243
234
|
// Observe DOM mutations and override the transform on .rich-media-item elements
|
|
244
235
|
// after React mounts to prevent the image from shifting outside its parent container.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
el.style.marginLeft = '0';
|
|
253
|
-
el.style.maxWidth = '100%';
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
if (richMediaItems.length > 0) {
|
|
257
|
-
var _constrainMediaObserv;
|
|
258
|
-
(_constrainMediaObserv = constrainMediaObserver) === null || _constrainMediaObserv === void 0 ? void 0 : _constrainMediaObserv.disconnect();
|
|
236
|
+
const constrainMediaObserver = new MutationObserver(() => {
|
|
237
|
+
const richMediaItems = dom.querySelectorAll('.rich-media-item');
|
|
238
|
+
richMediaItems.forEach(el => {
|
|
239
|
+
if (el instanceof HTMLElement) {
|
|
240
|
+
el.style.transform = 'none';
|
|
241
|
+
el.style.marginLeft = '0';
|
|
242
|
+
el.style.maxWidth = '100%';
|
|
259
243
|
}
|
|
260
244
|
});
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
245
|
+
if (richMediaItems.length > 0) {
|
|
246
|
+
constrainMediaObserver.disconnect();
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
constrainMediaObserver.observe(dom, {
|
|
250
|
+
childList: true,
|
|
251
|
+
subtree: true
|
|
252
|
+
});
|
|
266
253
|
// Derived from the deleted range so it survives a recalculation — see the same reasoning in
|
|
267
254
|
// `createInlineChangedDecoration`.
|
|
268
255
|
const diffId = showContributorTags ? `widget-${change.fromA}-${change.toA}` : crypto.randomUUID();
|
|
@@ -315,14 +302,14 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
315
302
|
if (childNodeView) {
|
|
316
303
|
const lineBreak = document.createElement('br');
|
|
317
304
|
dom.append(lineBreak);
|
|
318
|
-
const wrapper = createContentWrapper(colorScheme, isActive, isInserted
|
|
305
|
+
const wrapper = createContentWrapper(colorScheme, isActive, isInserted);
|
|
319
306
|
wrapper.append(childNodeView);
|
|
320
307
|
dom.append(wrapper);
|
|
321
308
|
} else {
|
|
322
309
|
// Fallback to serializing the individual child node
|
|
323
310
|
const serializedChild = serializer.serializeNode(childNode);
|
|
324
311
|
if (serializedChild) {
|
|
325
|
-
const wrapper = createContentWrapper(colorScheme, isActive, isInserted
|
|
312
|
+
const wrapper = createContentWrapper(colorScheme, isActive, isInserted);
|
|
326
313
|
wrapper.append(serializedChild);
|
|
327
314
|
dom.append(wrapper);
|
|
328
315
|
}
|
|
@@ -363,7 +350,7 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
363
350
|
const nodeView = serializer.tryCreateNodeView(node);
|
|
364
351
|
if (nodeView) {
|
|
365
352
|
if (node.isInline) {
|
|
366
|
-
const wrapper = createContentWrapper(colorScheme, isActive, isInserted,
|
|
353
|
+
const wrapper = createContentWrapper(colorScheme, isActive, isInserted, reveal);
|
|
367
354
|
wrapper.append(nodeView);
|
|
368
355
|
dom.append(wrapper);
|
|
369
356
|
} else {
|
|
@@ -376,7 +363,6 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
376
363
|
intl,
|
|
377
364
|
isActive,
|
|
378
365
|
isInserted,
|
|
379
|
-
diffType,
|
|
380
366
|
hideAddedDiffsUnderline,
|
|
381
367
|
highlightInlineLeafNodes: shouldPreserveCompleteMultiInlineBlock
|
|
382
368
|
});
|
|
@@ -393,12 +379,11 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
393
379
|
colorScheme,
|
|
394
380
|
isActive,
|
|
395
381
|
isInserted,
|
|
396
|
-
diffType,
|
|
397
382
|
reveal
|
|
398
383
|
});
|
|
399
384
|
dom.append(injectedNode);
|
|
400
385
|
} else {
|
|
401
|
-
const wrapper = createContentWrapper(colorScheme, isActive, isInserted,
|
|
386
|
+
const wrapper = createContentWrapper(colorScheme, isActive, isInserted, reveal);
|
|
402
387
|
wrapper.append(fallbackNode);
|
|
403
388
|
dom.append(wrapper);
|
|
404
389
|
}
|
|
@@ -467,7 +452,7 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
467
452
|
|
|
468
453
|
// Needed even when the indicator bar is off, because a contributor tag also anchors against the
|
|
469
454
|
// widget.
|
|
470
|
-
if (
|
|
455
|
+
if (showIndicators || showContributorTags) {
|
|
471
456
|
dom.style.setProperty('anchor-name', `--${buildAnchorDecorationKey({
|
|
472
457
|
diffId
|
|
473
458
|
})}`);
|
|
@@ -523,7 +508,7 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
523
508
|
}
|
|
524
509
|
}
|
|
525
510
|
}
|
|
526
|
-
if (showIndicators
|
|
511
|
+
if (showIndicators) {
|
|
527
512
|
const leftAnchor = createLeftAnchorWidget({
|
|
528
513
|
doc: newDoc,
|
|
529
514
|
from: safeInsertPos,
|
|
@@ -549,12 +534,9 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
549
534
|
leftAnchorId,
|
|
550
535
|
isActive,
|
|
551
536
|
isInserted,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
// trailing side (1); otherwise render before the new content (-1).
|
|
556
|
-
side: placeBelow ? 1 : -1
|
|
557
|
-
})
|
|
537
|
+
// placeBelow anchors at the end of the new content, so render on the
|
|
538
|
+
// trailing side (1); otherwise render before the new content (-1).
|
|
539
|
+
side: placeBelow ? 1 : -1
|
|
558
540
|
}),
|
|
559
541
|
// Without an explicit mark set, prosemirror-view wraps the widget in the marks of the
|
|
560
542
|
// adjacent text in the NEW document. `dom` already carries the original marks, so a
|
|
@@ -562,8 +544,7 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
562
544
|
// introduced — unbolded text shown struck through but still bold.
|
|
563
545
|
marks: [],
|
|
564
546
|
destroy: () => {
|
|
565
|
-
|
|
566
|
-
(_constrainMediaObserv2 = constrainMediaObserver) === null || _constrainMediaObserv2 === void 0 ? void 0 : _constrainMediaObserv2.disconnect();
|
|
547
|
+
constrainMediaObserver.disconnect();
|
|
567
548
|
unmountContributorTag(tagMount);
|
|
568
549
|
tagMount = undefined;
|
|
569
550
|
}
|
|
@@ -584,7 +565,7 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
584
565
|
// Away from the parent's start the node below keeps its own margin, and it is the block *inside*
|
|
585
566
|
// the widget that loses one — handled by `absorbFirstChildMarginReset` above, not here.
|
|
586
567
|
const nodeAfterWidget = $safeInsertPos.nodeAfter;
|
|
587
|
-
if (fg('platform_editor_ai_show_diff_patch_2') &&
|
|
568
|
+
if (fg('platform_editor_ai_show_diff_patch_2') && isVisuallyFirstInParent && nodeAfterWidget) {
|
|
588
569
|
const shapedSpacer = createNodeShapedMarginSpacer({
|
|
589
570
|
node: nodeAfterWidget,
|
|
590
571
|
serializer,
|
|
@@ -608,7 +589,7 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
608
589
|
}));
|
|
609
590
|
}
|
|
610
591
|
}
|
|
611
|
-
if (!fg('platform_editor_ai_show_diff_patch_2') && isDiffWidgetAtStartOfDoc && isSingleBlock && isPureDeletion
|
|
592
|
+
if (!fg('platform_editor_ai_show_diff_patch_2') && isDiffWidgetAtStartOfDoc && isSingleBlock && isPureDeletion) {
|
|
612
593
|
const followingNode = $safeInsertPos.nodeAfter;
|
|
613
594
|
const headingLevel = (followingNode === null || followingNode === void 0 ? void 0 : followingNode.type.name) === 'heading' ? followingNode.attrs.level : undefined;
|
|
614
595
|
if (isHeadingLevel(headingLevel)) {
|
|
@@ -632,8 +613,7 @@ export const createNodeChangedDecorationWidget = ({
|
|
|
632
613
|
colorScheme,
|
|
633
614
|
decorationType: 'widget',
|
|
634
615
|
diffId: crypto.randomUUID(),
|
|
635
|
-
isInserted
|
|
636
|
-
diffType
|
|
616
|
+
isInserted
|
|
637
617
|
})
|
|
638
618
|
}));
|
|
639
619
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isExtendedEnabled } from '../isExtendedEnabled';
|
|
2
1
|
/**
|
|
3
2
|
* Decoration families produced by the show-diff plugin.
|
|
4
3
|
* Each family owns its own key space and spec shape.
|
|
@@ -51,21 +50,14 @@ export const buildAnchorDecorationKey = ({
|
|
|
51
50
|
};
|
|
52
51
|
|
|
53
52
|
/**
|
|
54
|
-
* Builds a diff decoration key. The
|
|
55
|
-
*
|
|
56
|
-
* distinguishable.
|
|
53
|
+
* Builds a diff decoration key. The key includes the `diffId` so independently
|
|
54
|
+
* rendered decorations for the same type remain distinguishable.
|
|
57
55
|
*/
|
|
58
56
|
export const buildDiffDecorationKey = ({
|
|
59
57
|
decorationKeyPrefix,
|
|
60
58
|
isActive,
|
|
61
|
-
diffId
|
|
62
|
-
|
|
63
|
-
}) => {
|
|
64
|
-
if (isExtendedEnabled(diffType)) {
|
|
65
|
-
return `${decorationKeyPrefix}-${diffId}-${isActive ? 'active' : 'inactive'}`;
|
|
66
|
-
}
|
|
67
|
-
return isActive !== undefined ? `${decorationKeyPrefix}-${isActive ? 'active' : 'inactive'}` : decorationKeyPrefix;
|
|
68
|
-
};
|
|
59
|
+
diffId
|
|
60
|
+
}) => `${decorationKeyPrefix}-${diffId}-${isActive ? 'active' : 'inactive'}`;
|
|
69
61
|
export const buildDiffDecorationSpec = ({
|
|
70
62
|
attributionKey,
|
|
71
63
|
colorScheme,
|
|
@@ -75,8 +67,7 @@ export const buildDiffDecorationSpec = ({
|
|
|
75
67
|
isInserted,
|
|
76
68
|
leftAnchorId,
|
|
77
69
|
nodeName,
|
|
78
|
-
side
|
|
79
|
-
diffType
|
|
70
|
+
side
|
|
80
71
|
}) => ({
|
|
81
72
|
decorationFamily: DecorationFamily.diff,
|
|
82
73
|
decorationType,
|
|
@@ -84,8 +75,7 @@ export const buildDiffDecorationSpec = ({
|
|
|
84
75
|
key: buildDiffDecorationKey({
|
|
85
76
|
decorationKeyPrefix: DiffDecorationKey[decorationType],
|
|
86
77
|
diffId,
|
|
87
|
-
isActive
|
|
88
|
-
diffType
|
|
78
|
+
isActive
|
|
89
79
|
}),
|
|
90
80
|
...(attributionKey ? {
|
|
91
81
|
attributionKey
|