@atlaskit/editor-plugin-show-diff 13.0.11 → 13.1.1

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-products/tsconfig.json +3 -0
  4. package/dist/cjs/pm-plugins/decorations/colorSchemes/factory.js +259 -23
  5. package/dist/cjs/pm-plugins/decorations/colorSchemes/schemes.js +21 -5
  6. package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.js +87 -105
  7. package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +124 -0
  8. package/dist/cjs/pm-plugins/decorations/createChangedRowDecorationWidgets.js +15 -12
  9. package/dist/cjs/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.js +37 -0
  10. package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.js +109 -59
  11. package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +67 -0
  12. package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeView.js +30 -168
  13. package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +205 -0
  14. package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +225 -0
  15. package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +247 -23
  16. package/dist/es2019/pm-plugins/decorations/colorSchemes/schemes.js +20 -4
  17. package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.js +85 -105
  18. package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +118 -0
  19. package/dist/es2019/pm-plugins/decorations/createChangedRowDecorationWidgets.js +15 -12
  20. package/dist/es2019/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.js +33 -0
  21. package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.js +82 -37
  22. package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +62 -0
  23. package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeView.js +15 -140
  24. package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +143 -0
  25. package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +200 -0
  26. package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +248 -23
  27. package/dist/esm/pm-plugins/decorations/colorSchemes/schemes.js +20 -4
  28. package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.js +87 -105
  29. package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +118 -0
  30. package/dist/esm/pm-plugins/decorations/createChangedRowDecorationWidgets.js +15 -12
  31. package/dist/esm/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.js +32 -0
  32. package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.js +109 -59
  33. package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +61 -0
  34. package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeView.js +15 -153
  35. package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +198 -0
  36. package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +218 -0
  37. package/dist/types/pm-plugins/decorations/colorSchemes/factory.d.ts +78 -6
  38. package/dist/types/pm-plugins/decorations/colorSchemes/schemes.d.ts +3 -0
  39. package/dist/types/pm-plugins/decorations/colorSchemes/types.d.ts +13 -3
  40. package/dist/types/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.d.ts +14 -0
  41. package/dist/types/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.d.ts +22 -0
  42. package/dist/types/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.d.ts +26 -0
  43. package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.d.ts +39 -0
  44. package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.d.ts +40 -0
  45. package/package.json +4 -3
@@ -4,116 +4,8 @@ import { trackChangesMessages } from '@atlaskit/editor-common/messages';
4
4
  import { getBaseNodeTypeName } from '@atlaskit/editor-common/utils/node-type-utils';
5
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
6
  import { isExtendedEnabled } from '../../isExtendedEnabled';
7
- import { deletedBlockOutline, deletedBlockOutlineActive, deletedBlockOutlineRounded, deletedBlockOutlineRoundedActive, deletedContentStyle, deletedContentStyleActive, deletedContentStyleNew, deletedContentStyleUnbounded, deletedInlineContentStyleExtended, deletedStyleQuoteNodeWithLozenge, deletedStyleQuoteNodeWithLozengeActive, editingContentStyleInBlockExtended, editingContentStyleInBlockExtendedNoUnderline, editingStyleExtended, editingStyleExtendedNoUnderline, editingStyleActiveExtended, editingStyleActiveExtendedNoUnderline, editingStyleNode, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from '../colorSchemes/standard';
8
- import { deletedTraditionalBlockOutlineActive, deletedTraditionalBlockOutlineNew, deletedTraditionalBlockOutlineRoundedActive, deletedTraditionalBlockOutlineRoundedNew, deletedTraditionalContentStyleUnbounded, deletedTraditionalContentStyleUnboundedActive, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, deletedTraditionalStyleQuoteNodeActive, traditionalInsertStyle, traditionalInsertStyleActive, traditionalStyleNodeActive, traditionalStyleNodeNew, traditionalAddedCellOverlayRoundedStyle, traditionalAddedCellOverlayStyleNew, deletedTraditionalCellOverlayStyle, deletedTraditionalCellOverlayRoundedStyle } from '../colorSchemes/traditional';
9
7
  import { applyTableCellEdgeAttrs } from './tableCellEdgeAttrs';
10
- var lozengeStyle = convertToInlineCss({
11
- display: 'inline-flex',
12
- boxSizing: 'border-box',
13
- position: 'static',
14
- blockSize: 'min-content',
15
- borderRadius: "var(--ds-radius-small, 4px)",
16
- overflow: 'hidden',
17
- paddingInlineStart: "var(--ds-space-050, 4px)",
18
- paddingInlineEnd: "var(--ds-space-050, 4px)",
19
- backgroundColor: "var(--ds-background-accent-gray-subtler, #DDDEE1)",
20
- font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
21
- fontWeight: "var(--ds-font-weight-bold, 653)",
22
- textOverflow: 'ellipsis',
23
- whiteSpace: 'nowrap',
24
- color: "var(--ds-text-warning-inverse, #292A2E)"
25
- });
26
- var lozengeStyleActiveStandard = convertToInlineCss({
27
- display: 'inline-flex',
28
- boxSizing: 'border-box',
29
- position: 'static',
30
- blockSize: 'min-content',
31
- borderRadius: "var(--ds-radius-small, 4px)",
32
- overflow: 'hidden',
33
- paddingInlineStart: "var(--ds-space-050, 4px)",
34
- paddingInlineEnd: "var(--ds-space-050, 4px)",
35
- backgroundColor: "var(--ds-background-accent-red-subtler-pressed, #FD9891)",
36
- font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
37
- fontWeight: "var(--ds-font-weight-bold, 653)",
38
- textOverflow: 'ellipsis',
39
- whiteSpace: 'nowrap',
40
- color: "var(--ds-text-warning-inverse, #292A2E)"
41
- });
42
- var lozengeStyleActiveTraditional = convertToInlineCss({
43
- display: 'inline-flex',
44
- boxSizing: 'border-box',
45
- position: 'static',
46
- blockSize: 'min-content',
47
- borderRadius: "var(--ds-radius-small, 4px)",
48
- overflow: 'hidden',
49
- paddingInlineStart: "var(--ds-space-050, 4px)",
50
- paddingInlineEnd: "var(--ds-space-050, 4px)",
51
- backgroundColor: "var(--ds-background-accent-red-subtler-pressed, #FD9891)",
52
- font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
53
- fontWeight: "var(--ds-font-weight-bold, 653)",
54
- textOverflow: 'ellipsis',
55
- whiteSpace: 'nowrap',
56
- color: "var(--ds-text-warning-inverse, #292A2E)"
57
- });
58
- var getChangedContentStyle = function getChangedContentStyle(colorScheme) {
59
- var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
60
- var isInserted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
61
- var diffType = arguments.length > 3 ? arguments[3] : undefined;
62
- var hideAddedDiffsUnderline = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
63
- if (isExtendedEnabled(diffType) && isInserted) {
64
- if (colorScheme === 'traditional') {
65
- return isActive ? traditionalInsertStyleActive : traditionalInsertStyle;
66
- }
67
- return isActive ? hideAddedDiffsUnderline ? editingStyleActiveExtendedNoUnderline : editingStyleActiveExtended : hideAddedDiffsUnderline ? editingStyleExtendedNoUnderline : editingStyleExtended;
68
- }
69
- if (colorScheme === 'traditional') {
70
- return getDeletedTraditionalInlineStyle(isActive);
71
- }
72
- if (isActive) {
73
- return deletedContentStyleActive;
74
- }
75
- return expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? deletedContentStyleNew : deletedContentStyle;
76
- };
77
- var getChangedNodeStyle = function getChangedNodeStyle(nodeName, colorScheme) {
78
- var isInserted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
79
- var isActive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
80
- var diffType = arguments.length > 4 ? arguments[4] : undefined;
81
- var hideAddedDiffsUnderline = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
82
- var isTraditional = colorScheme === 'traditional';
83
- if (isExtendedEnabled(diffType) && isInserted) {
84
- if (isMultiContainerBlockNode(nodeName)) {
85
- return hideAddedDiffsUnderline ? editingContentStyleInBlockExtendedNoUnderline : editingContentStyleInBlockExtended;
86
- }
87
- if (isTextLikeBlockNode(nodeName)) {
88
- return undefined;
89
- }
90
- if (isTraditional) {
91
- return isActive ? traditionalStyleNodeActive : traditionalStyleNodeNew;
92
- }
93
- return editingStyleNode;
94
- }
95
- switch (nodeName) {
96
- case 'blockquote':
97
- if (isTraditional) {
98
- return isActive ? deletedTraditionalStyleQuoteNodeActive : deletedTraditionalStyleQuoteNode;
99
- }
100
- return isActive ? deletedStyleQuoteNodeWithLozengeActive : deletedStyleQuoteNodeWithLozenge;
101
- case 'expand':
102
- case 'decisionList':
103
- if (isTraditional) {
104
- return isActive ? deletedTraditionalBlockOutlineActive : deletedTraditionalBlockOutlineNew;
105
- }
106
- return isActive ? deletedBlockOutlineActive : deletedBlockOutline;
107
- case 'panel':
108
- case 'codeBlock':
109
- if (isTraditional) {
110
- return isActive ? deletedTraditionalBlockOutlineRoundedActive : deletedTraditionalBlockOutlineRoundedNew;
111
- }
112
- return isActive ? deletedBlockOutlineRoundedActive : deletedBlockOutlineRounded;
113
- default:
114
- return undefined;
115
- }
116
- };
8
+ import { getChangedContentStyle, getChangedNodeStyle, getDeletedContentStyle, getDeletedContentStyleUnbounded, getInsertedContentStyle, hasRestingDeletedRing, isMultiContainerBlockNode, isTextLikeBlockNode, resolveCellOverlayStyle, resolveNestedInsertedNodeStyle, resolveRemovedLozengeStyle } from './wrapBlockNodeViewStyles';
117
9
  var shouldShowRemovedLozenge = function shouldShowRemovedLozenge(nodeName) {
118
10
  switch (nodeName) {
119
11
  case 'expand':
@@ -150,7 +42,8 @@ var maybeAddDeletedOutlineNewClass = function maybeAddDeletedOutlineNewClass(_re
150
42
  if (name !== 'mediaSingle' && name !== 'embedCard') {
151
43
  return;
152
44
  }
153
- if (colorScheme === 'traditional' && !isActive) {
45
+ // Only schemes with a resting ring get the class.
46
+ if (hasRestingDeletedRing(colorScheme) && !isActive) {
154
47
  nodeView.classList.add('show-diff-deleted-outline-new');
155
48
  }
156
49
  };
@@ -162,23 +55,18 @@ var maybeAddDeletedOutlineNewClass = function maybeAddDeletedOutlineNewClass(_re
162
55
  var shouldApplyStylesDirectly = function shouldApplyStylesDirectly(nodeName) {
163
56
  return nodeName === 'heading';
164
57
  };
165
- var isMultiContainerBlockNode = function isMultiContainerBlockNode(nodeName) {
166
- return ['decisionList', 'layoutSection'].includes(nodeName);
167
- };
168
- var isTextLikeBlockNode = function isTextLikeBlockNode(nodeName) {
169
- return ['heading', 'bulletList', 'orderedList', 'listItem', 'taskList', 'blockquote'].includes(nodeName);
170
- };
171
58
  var applyCellOverlayStyles = function applyCellOverlayStyles(_ref2) {
172
59
  var element = _ref2.element,
173
60
  colorScheme = _ref2.colorScheme,
174
61
  isInserted = _ref2.isInserted;
175
62
  var isRoundedTable = expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true);
63
+ var overlayStyle = resolveCellOverlayStyle({
64
+ colorScheme: colorScheme,
65
+ isInserted: isInserted,
66
+ isRoundedTable: isRoundedTable
67
+ });
176
68
  element.querySelectorAll('td, th').forEach(function (cell) {
177
69
  var overlay = document.createElement('span');
178
- var isTraditional = colorScheme === 'traditional';
179
- var deletedCellStyle = isTraditional ? isRoundedTable ? deletedTraditionalCellOverlayRoundedStyle : deletedTraditionalCellOverlayStyle : isRoundedTable ? deletedCellOverlayRoundedStyle : deletedCellOverlayStyle;
180
- var addedCellStyle = isTraditional ? isRoundedTable ? traditionalAddedCellOverlayRoundedStyle : traditionalAddedCellOverlayStyleNew : isRoundedTable ? addedCellOverlayRoundedStyle : addedCellOverlayStyle;
181
- var overlayStyle = isInserted ? addedCellStyle : deletedCellStyle;
182
70
  overlay.setAttribute('style', overlayStyle);
183
71
  cell.appendChild(overlay);
184
72
  });
@@ -204,7 +92,7 @@ var createRemovedLozenge = function createRemovedLozenge(intl) {
204
92
 
205
93
  // Create vanilla HTML lozenge element with Atlaskit Lozenge styling (visual refresh)
206
94
  var lozengeElement = document.createElement('span');
207
- var lozengeInnerStyle = isActive && colorScheme === 'traditional' ? lozengeStyleActiveTraditional : isActive ? lozengeStyleActiveStandard : lozengeStyle;
95
+ var lozengeInnerStyle = resolveRemovedLozengeStyle(colorScheme, isActive);
208
96
  lozengeElement.setAttribute('style', lozengeInnerStyle);
209
97
  lozengeElement.textContent = intl.formatMessage(trackChangesMessages.removed).toUpperCase();
210
98
  container.appendChild(lozengeElement);
@@ -256,19 +144,22 @@ var applyMultiContainerLikeStyles = function applyMultiContainerLikeStyles(_ref4
256
144
  var targetNodeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(targetNode.type) : targetNode.type.name;
257
145
  var nodeSpecificStyle = getChangedNodeStyle(targetNodeName, colorScheme, isInserted, isActive, diffType, hideAddedDiffsUnderline) || '';
258
146
  if (targetNode.type.name === 'decisionList') {
147
+ var nestedInsertedNodeStyle = resolveNestedInsertedNodeStyle();
259
148
  element.querySelectorAll('li').forEach(function (listItem) {
260
149
  var currentListItemStyle = listItem.getAttribute('style') || '';
261
- listItem.setAttribute('style', "".concat(currentListItemStyle).concat(editingStyleNode));
150
+ listItem.setAttribute('style', "".concat(currentListItemStyle).concat(nestedInsertedNodeStyle));
262
151
  });
263
152
  } else if (targetNode.type.name === 'layoutSection') {
153
+ var _nestedInsertedNodeStyle = resolveNestedInsertedNodeStyle();
264
154
  element.querySelectorAll('[data-layout-column="true"]').forEach(function (section) {
265
155
  var currentSectionStyle = section.getAttribute('style') || '';
266
- section.setAttribute('style', "".concat(currentSectionStyle).concat(editingStyleNode));
156
+ section.setAttribute('style', "".concat(currentSectionStyle).concat(_nestedInsertedNodeStyle));
267
157
  });
268
158
  } else if (targetNode.type.name === 'taskList') {
159
+ var _nestedInsertedNodeStyle2 = resolveNestedInsertedNodeStyle();
269
160
  element.querySelectorAll('li').forEach(function (listItem) {
270
161
  var currentListItemStyle = listItem.getAttribute('style') || '';
271
- listItem.setAttribute('style', "".concat(currentListItemStyle).concat(editingStyleNode));
162
+ listItem.setAttribute('style', "".concat(currentListItemStyle).concat(_nestedInsertedNodeStyle2));
272
163
  });
273
164
  }
274
165
  element.setAttribute('style', "".concat(currentStyle, ";").concat(nodeSpecificStyle));
@@ -595,35 +486,6 @@ export var wrapBlockNodeView = function wrapBlockNodeView(_ref0) {
595
486
  }
596
487
  }
597
488
  };
598
- var getDeletedContentStyleUnbounded = function getDeletedContentStyleUnbounded(colorScheme) {
599
- var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
600
- if (colorScheme === 'traditional' && isActive) {
601
- return deletedTraditionalContentStyleUnboundedActive;
602
- }
603
- return colorScheme === 'traditional' ? deletedTraditionalContentStyleUnbounded : deletedContentStyleUnbounded;
604
- };
605
- var getInsertedContentStyle = function getInsertedContentStyle(colorScheme) {
606
- var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
607
- var hideAddedDiffsUnderline = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
608
- if (colorScheme === 'traditional') {
609
- return isActive ? traditionalInsertStyleActive : traditionalInsertStyle;
610
- }
611
- if (isActive) {
612
- return hideAddedDiffsUnderline ? editingStyleActiveExtendedNoUnderline : editingStyleActiveExtended;
613
- }
614
- return hideAddedDiffsUnderline ? editingStyleExtendedNoUnderline : editingStyleExtended;
615
- };
616
- var getDeletedContentStyle = function getDeletedContentStyle(colorScheme) {
617
- var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
618
- var diffType = arguments.length > 2 ? arguments[2] : undefined;
619
- if (colorScheme === 'traditional') {
620
- return getDeletedTraditionalInlineStyle(isActive);
621
- }
622
- if (isExtendedEnabled(diffType)) {
623
- return (isActive ? deletedContentStyleActive : deletedContentStyleNew) + deletedInlineContentStyleExtended;
624
- }
625
- return isActive ? deletedContentStyleActive : deletedContentStyleNew;
626
- };
627
489
 
628
490
  /**
629
491
  * Injects a styled inner wrapper span around the children of a block node element.
@@ -0,0 +1,198 @@
1
+ /**
2
+ * Style resolution for the `wrapBlockNodeView` nodeview decorations.
3
+ *
4
+ * Every exported resolver is a single gate: the `colorSchemeRegistry` + `factory.ts`
5
+ * implementation when `platform_editor_show_diff_color_scheme_refactor` is on, and the verbatim
6
+ * pre-refactor per-scheme constants from `./wrapBlockNodeViewStyles.legacy` when it is off. The two
7
+ * paths are built to emit identical style strings for both shipped schemes, so this is a kill
8
+ * switch for a refactor rather than a behaviour experiment.
9
+ *
10
+ * On cleanup (EDITOR-8281): drop the `isExperimentEnabled` dispatch and the `*Legacy` imports,
11
+ * keeping the `*Next` bodies.
12
+ */
13
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
14
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
+ import { isExtendedEnabled } from '../../isExtendedEnabled';
16
+ import { buildAddedCellOverlayRoundedStyle, buildAddedCellOverlayStyle, buildAddedCellOverlayStyleNew, buildDeletedCellOverlayRoundedStyle, buildDeletedCellOverlayStyle, buildDeletedInlineContentStyle, buildDeletedInlineContentStyleExtended, buildDeletedLozengeActiveStyle, buildDeletedLozengeStyle, buildDeletedQuoteNodeWithLozengeStyle, buildDeletedStrikethroughLine, buildDeletedWrappedBlockOutline, buildInsertedBlockNodeStyle, buildInsertedInlineStyle, buildInsertStyleInBlockExtended, buildInsertStyleInBlockExtendedNoUnderline, buildInsertStyleNode } from '../colorSchemes/factory';
17
+ import { colorSchemeRegistry, standardScheme } from '../colorSchemes/schemes';
18
+ import { getChangedContentStyleLegacy, getChangedNodeStyleLegacy, getDeletedContentStyleLegacy, getDeletedContentStyleUnboundedLegacy, getInsertedContentStyleLegacy, hasRestingDeletedRingLegacy, resolveCellOverlayStyleLegacy, resolveNestedInsertedNodeStyleLegacy, resolveRemovedLozengeStyleLegacy } from './wrapBlockNodeViewStyles.legacy';
19
+ var DEFAULT_COLOR_SCHEME = 'standard';
20
+ var getColorScheme = function getColorScheme(colorScheme) {
21
+ return colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : DEFAULT_COLOR_SCHEME];
22
+ };
23
+
24
+ /**
25
+ * Inserted content inside a multi-container or list node always uses the standard scheme, so a
26
+ * traditional diff shows purple here. Pre-existing: these call sites predate traditional.
27
+ * Preserved as-is; see EDITOR-8281.
28
+ */
29
+ var nestedContentScheme = standardScheme;
30
+ var lozengeStyle = buildDeletedLozengeStyle();
31
+
32
+ /**
33
+ * Node-name classification shared by the style resolvers below and by the routing in
34
+ * `wrapBlockNodeView.ts`.
35
+ */
36
+ export var isMultiContainerBlockNode = function isMultiContainerBlockNode(nodeName) {
37
+ return ['decisionList', 'layoutSection'].includes(nodeName);
38
+ };
39
+ export var isTextLikeBlockNode = function isTextLikeBlockNode(nodeName) {
40
+ return ['heading', 'bulletList', 'orderedList', 'listItem', 'taskList', 'blockquote'].includes(nodeName);
41
+ };
42
+ var getChangedContentStyleNext = function getChangedContentStyleNext(colorScheme) {
43
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
44
+ var isInserted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
45
+ var diffType = arguments.length > 3 ? arguments[3] : undefined;
46
+ var hideAddedDiffsUnderline = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
47
+ var colors = getColorScheme(colorScheme);
48
+ if (isExtendedEnabled(diffType) && isInserted) {
49
+ return buildInsertedInlineStyle(colors, isActive, hideAddedDiffsUnderline);
50
+ }
51
+ if (isActive) {
52
+ return buildDeletedInlineContentStyle(colors, 'active');
53
+ }
54
+ return buildDeletedInlineContentStyle(colors, expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'new' : 'default');
55
+ };
56
+ var getChangedNodeStyleNext = function getChangedNodeStyleNext(nodeName, colorScheme) {
57
+ var isInserted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
58
+ var isActive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
59
+ var diffType = arguments.length > 4 ? arguments[4] : undefined;
60
+ var hideAddedDiffsUnderline = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
61
+ var colors = getColorScheme(colorScheme);
62
+ if (isExtendedEnabled(diffType) && isInserted) {
63
+ if (isMultiContainerBlockNode(nodeName)) {
64
+ return hideAddedDiffsUnderline ? buildInsertStyleInBlockExtendedNoUnderline(nestedContentScheme) : buildInsertStyleInBlockExtended(nestedContentScheme);
65
+ }
66
+ if (isTextLikeBlockNode(nodeName)) {
67
+ return undefined;
68
+ }
69
+ return buildInsertedBlockNodeStyle(colors, 'node', isActive);
70
+ }
71
+ switch (nodeName) {
72
+ case 'blockquote':
73
+ return buildDeletedQuoteNodeWithLozengeStyle(colors, isActive);
74
+ case 'expand':
75
+ case 'decisionList':
76
+ return buildDeletedWrappedBlockOutline(colors, {
77
+ isActive: isActive,
78
+ isRounded: false
79
+ });
80
+ case 'panel':
81
+ case 'codeBlock':
82
+ return buildDeletedWrappedBlockOutline(colors, {
83
+ isActive: isActive,
84
+ isRounded: true
85
+ });
86
+ default:
87
+ return undefined;
88
+ }
89
+ };
90
+ var getDeletedContentStyleUnboundedNext = function getDeletedContentStyleUnboundedNext(colorScheme) {
91
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
92
+ return buildDeletedStrikethroughLine(getColorScheme(colorScheme), isActive);
93
+ };
94
+ var getInsertedContentStyleNext = function getInsertedContentStyleNext(colorScheme) {
95
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
96
+ var hideAddedDiffsUnderline = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
97
+ return buildInsertedInlineStyle(getColorScheme(colorScheme), isActive, hideAddedDiffsUnderline);
98
+ };
99
+ var getDeletedContentStyleNext = function getDeletedContentStyleNext(colorScheme) {
100
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
101
+ var diffType = arguments.length > 2 ? arguments[2] : undefined;
102
+ var colors = getColorScheme(colorScheme);
103
+ var base = buildDeletedInlineContentStyle(colors, isActive ? 'active' : 'new');
104
+
105
+ // glyphTint adds a background highlight and border-bottom over the tint; strikethrough does not.
106
+ var needsExtendedHighlight = colors.deletedInlineTreatment === 'glyphTint' && isExtendedEnabled(diffType);
107
+ return needsExtendedHighlight ? base + buildDeletedInlineContentStyleExtended(colors) : base;
108
+ };
109
+ var resolveCellOverlayStyleNext = function resolveCellOverlayStyleNext(_ref) {
110
+ var colorScheme = _ref.colorScheme,
111
+ isInserted = _ref.isInserted,
112
+ isRoundedTable = _ref.isRoundedTable;
113
+ var colors = getColorScheme(colorScheme);
114
+
115
+ // Square added-cell overlays follow insertedNodeEmphasis: pressed background vs accent border.
116
+ var addedCellStyle = isRoundedTable ? buildAddedCellOverlayRoundedStyle(colors) : colors.insertedNodeEmphasis === 'stateful' ? buildAddedCellOverlayStyleNew(colors) : buildAddedCellOverlayStyle(colors);
117
+ var deletedCellStyle = isRoundedTable ? buildDeletedCellOverlayRoundedStyle(colors) : buildDeletedCellOverlayStyle(colors);
118
+ return isInserted ? addedCellStyle : deletedCellStyle;
119
+ };
120
+ var resolveRemovedLozengeStyleNext = function resolveRemovedLozengeStyleNext(colorScheme, isActive) {
121
+ return isActive ? buildDeletedLozengeActiveStyle(getColorScheme(colorScheme)) : lozengeStyle;
122
+ };
123
+ var resolveNestedInsertedNodeStyleNext = function resolveNestedInsertedNodeStyleNext() {
124
+ return buildInsertStyleNode(nestedContentScheme);
125
+ };
126
+
127
+ // Only 'stateful' schemes have a resting ring.
128
+ var hasRestingDeletedRingNext = function hasRestingDeletedRingNext(colorScheme) {
129
+ return getColorScheme(colorScheme).deletedNodeEmphasis === 'stateful';
130
+ };
131
+
132
+ /** Inline content style for a changed (inserted or deleted) block node. */
133
+ export var getChangedContentStyle = function getChangedContentStyle(colorScheme) {
134
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
135
+ var isInserted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
136
+ var diffType = arguments.length > 3 ? arguments[3] : undefined;
137
+ var hideAddedDiffsUnderline = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
138
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? getChangedContentStyleNext(colorScheme, isActive, isInserted, diffType, hideAddedDiffsUnderline) : getChangedContentStyleLegacy(colorScheme, isActive, isInserted, diffType, hideAddedDiffsUnderline);
139
+ };
140
+
141
+ /** Node-specific style for a changed block node, or `undefined` when the node type has none. */
142
+ export var getChangedNodeStyle = function getChangedNodeStyle(nodeName, colorScheme) {
143
+ var isInserted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
144
+ var isActive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
145
+ var diffType = arguments.length > 4 ? arguments[4] : undefined;
146
+ var hideAddedDiffsUnderline = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
147
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? getChangedNodeStyleNext(nodeName, colorScheme, isInserted, isActive, diffType, hideAddedDiffsUnderline) : getChangedNodeStyleLegacy(nodeName, colorScheme, isInserted, isActive, diffType, hideAddedDiffsUnderline);
148
+ };
149
+
150
+ /** The positioned line drawn across deleted content spanning an unbounded range. */
151
+ export var getDeletedContentStyleUnbounded = function getDeletedContentStyleUnbounded(colorScheme) {
152
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
153
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? getDeletedContentStyleUnboundedNext(colorScheme, isActive) : getDeletedContentStyleUnboundedLegacy(colorScheme, isActive);
154
+ };
155
+
156
+ /** Inline style for inserted content. */
157
+ export var getInsertedContentStyle = function getInsertedContentStyle(colorScheme) {
158
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
159
+ var hideAddedDiffsUnderline = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
160
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? getInsertedContentStyleNext(colorScheme, isActive, hideAddedDiffsUnderline) : getInsertedContentStyleLegacy(colorScheme, isActive, hideAddedDiffsUnderline);
161
+ };
162
+
163
+ /** Inline style for deleted content. */
164
+ export var getDeletedContentStyle = function getDeletedContentStyle(colorScheme) {
165
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
166
+ var diffType = arguments.length > 2 ? arguments[2] : undefined;
167
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? getDeletedContentStyleNext(colorScheme, isActive, diffType) : getDeletedContentStyleLegacy(colorScheme, isActive, diffType);
168
+ };
169
+
170
+ /**
171
+ * Overlay style for one added or deleted table cell. Invariant across the cells of a table, so the
172
+ * `querySelectorAll('td, th')` loop in `wrapBlockNodeView.ts` resolves it once.
173
+ */
174
+ export var resolveCellOverlayStyle = function resolveCellOverlayStyle(args) {
175
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? resolveCellOverlayStyleNext(args) : resolveCellOverlayStyleLegacy(args);
176
+ };
177
+
178
+ /** Inner style for the "Removed" lozenge on a deleted block node. */
179
+ export var resolveRemovedLozengeStyle = function resolveRemovedLozengeStyle(colorScheme, isActive) {
180
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? resolveRemovedLozengeStyleNext(colorScheme, isActive) : resolveRemovedLozengeStyleLegacy(colorScheme, isActive);
181
+ };
182
+
183
+ /**
184
+ * Style for inserted content nested inside a multi-container or list node — the `decisionList` and
185
+ * `taskList` `li`s and the `layoutSection` columns. Scheme-independent: see
186
+ * `nestedContentScheme` above.
187
+ */
188
+ export var resolveNestedInsertedNodeStyle = function resolveNestedInsertedNodeStyle() {
189
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? resolveNestedInsertedNodeStyleNext() : resolveNestedInsertedNodeStyleLegacy();
190
+ };
191
+
192
+ /**
193
+ * Whether the colour scheme draws a resting (non-active) ring on a deleted media/embed node, which
194
+ * is what the `show-diff-deleted-outline-new` class styles in editor-core's smartCardStyles.
195
+ */
196
+ export var hasRestingDeletedRing = function hasRestingDeletedRing(colorScheme) {
197
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? hasRestingDeletedRingNext(colorScheme) : hasRestingDeletedRingLegacy(colorScheme);
198
+ };
@@ -0,0 +1,218 @@
1
+ /**
2
+ * Pre-refactor code preserved for the OFF cohort of
3
+ * `platform_editor_show_diff_color_scheme_refactor`.
4
+ *
5
+ * These resolvers hold, verbatim, the per-scheme string-constant style decisions that
6
+ * `wrapBlockNodeView.ts` made before the `colorSchemeRegistry` + `factory.ts` migration — same
7
+ * branches, same ternaries, same order, same shim constants, same module-level constants.
8
+ *
9
+ * Do not modify. Delete this file at experiment cleanup, together with `colorSchemes/standard.ts`,
10
+ * `colorSchemes/traditional.ts` (EDITOR-8281).
11
+ */
12
+ import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
+ import { isExtendedEnabled } from '../../isExtendedEnabled';
15
+ import { deletedBlockOutline, deletedBlockOutlineActive, deletedBlockOutlineRounded, deletedBlockOutlineRoundedActive, deletedContentStyle, deletedContentStyleActive, deletedContentStyleNew, deletedContentStyleUnbounded, deletedInlineContentStyleExtended, deletedStyleQuoteNodeWithLozenge, deletedStyleQuoteNodeWithLozengeActive, editingContentStyleInBlockExtended, editingContentStyleInBlockExtendedNoUnderline, editingStyleExtended, editingStyleExtendedNoUnderline, editingStyleActiveExtended, editingStyleActiveExtendedNoUnderline, editingStyleNode, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from '../colorSchemes/standard';
16
+ import { deletedTraditionalBlockOutlineActive, deletedTraditionalBlockOutlineNew, deletedTraditionalBlockOutlineRoundedActive, deletedTraditionalBlockOutlineRoundedNew, deletedTraditionalContentStyleUnbounded, deletedTraditionalContentStyleUnboundedActive, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, deletedTraditionalStyleQuoteNodeActive, traditionalInsertStyle, traditionalInsertStyleActive, traditionalStyleNodeActive, traditionalStyleNodeNew, traditionalAddedCellOverlayRoundedStyle, traditionalAddedCellOverlayStyleNew, deletedTraditionalCellOverlayStyle, deletedTraditionalCellOverlayRoundedStyle } from '../colorSchemes/traditional';
17
+ var lozengeStyle = convertToInlineCss({
18
+ display: 'inline-flex',
19
+ boxSizing: 'border-box',
20
+ position: 'static',
21
+ blockSize: 'min-content',
22
+ borderRadius: "var(--ds-radius-small, 4px)",
23
+ overflow: 'hidden',
24
+ paddingInlineStart: "var(--ds-space-050, 4px)",
25
+ paddingInlineEnd: "var(--ds-space-050, 4px)",
26
+ backgroundColor: "var(--ds-background-accent-gray-subtler, #DDDEE1)",
27
+ font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
28
+ fontWeight: "var(--ds-font-weight-bold, 653)",
29
+ textOverflow: 'ellipsis',
30
+ whiteSpace: 'nowrap',
31
+ color: "var(--ds-text-warning-inverse, #292A2E)"
32
+ });
33
+ var lozengeStyleActiveStandard = convertToInlineCss({
34
+ display: 'inline-flex',
35
+ boxSizing: 'border-box',
36
+ position: 'static',
37
+ blockSize: 'min-content',
38
+ borderRadius: "var(--ds-radius-small, 4px)",
39
+ overflow: 'hidden',
40
+ paddingInlineStart: "var(--ds-space-050, 4px)",
41
+ paddingInlineEnd: "var(--ds-space-050, 4px)",
42
+ backgroundColor: "var(--ds-background-accent-red-subtler-pressed, #FD9891)",
43
+ font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
44
+ fontWeight: "var(--ds-font-weight-bold, 653)",
45
+ textOverflow: 'ellipsis',
46
+ whiteSpace: 'nowrap',
47
+ color: "var(--ds-text-warning-inverse, #292A2E)"
48
+ });
49
+ var lozengeStyleActiveTraditional = convertToInlineCss({
50
+ display: 'inline-flex',
51
+ boxSizing: 'border-box',
52
+ position: 'static',
53
+ blockSize: 'min-content',
54
+ borderRadius: "var(--ds-radius-small, 4px)",
55
+ overflow: 'hidden',
56
+ paddingInlineStart: "var(--ds-space-050, 4px)",
57
+ paddingInlineEnd: "var(--ds-space-050, 4px)",
58
+ backgroundColor: "var(--ds-background-accent-red-subtler-pressed, #FD9891)",
59
+ font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
60
+ fontWeight: "var(--ds-font-weight-bold, 653)",
61
+ textOverflow: 'ellipsis',
62
+ whiteSpace: 'nowrap',
63
+ color: "var(--ds-text-warning-inverse, #292A2E)"
64
+ });
65
+
66
+ /**
67
+ * Frozen copies of the two node-name predicates `getChangedNodeStyle` branched on pre-refactor.
68
+ * The live copies are exported from `./wrapBlockNodeViewStyles`; these exist so this module stays
69
+ * self-contained (and so the OFF cohort keeps the exact pre-refactor classification) and go away
70
+ * with the rest of the file at cleanup.
71
+ */
72
+ var isMultiContainerBlockNode = function isMultiContainerBlockNode(nodeName) {
73
+ return ['decisionList', 'layoutSection'].includes(nodeName);
74
+ };
75
+ var isTextLikeBlockNode = function isTextLikeBlockNode(nodeName) {
76
+ return ['heading', 'bulletList', 'orderedList', 'listItem', 'taskList', 'blockquote'].includes(nodeName);
77
+ };
78
+
79
+ /** Pre-refactor inline content style for a changed (inserted or deleted) block node. */
80
+ export var getChangedContentStyleLegacy = function getChangedContentStyleLegacy(colorScheme) {
81
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
82
+ var isInserted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
83
+ var diffType = arguments.length > 3 ? arguments[3] : undefined;
84
+ var hideAddedDiffsUnderline = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
85
+ if (isExtendedEnabled(diffType) && isInserted) {
86
+ if (colorScheme === 'traditional') {
87
+ return isActive ? traditionalInsertStyleActive : traditionalInsertStyle;
88
+ }
89
+ return isActive ? hideAddedDiffsUnderline ? editingStyleActiveExtendedNoUnderline : editingStyleActiveExtended : hideAddedDiffsUnderline ? editingStyleExtendedNoUnderline : editingStyleExtended;
90
+ }
91
+ if (colorScheme === 'traditional') {
92
+ return getDeletedTraditionalInlineStyle(isActive);
93
+ }
94
+ if (isActive) {
95
+ return deletedContentStyleActive;
96
+ }
97
+ return expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? deletedContentStyleNew : deletedContentStyle;
98
+ };
99
+
100
+ /** Pre-refactor node-specific style for a changed block node. */
101
+ export var getChangedNodeStyleLegacy = function getChangedNodeStyleLegacy(nodeName, colorScheme) {
102
+ var isInserted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
103
+ var isActive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
104
+ var diffType = arguments.length > 4 ? arguments[4] : undefined;
105
+ var hideAddedDiffsUnderline = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
106
+ var isTraditional = colorScheme === 'traditional';
107
+ if (isExtendedEnabled(diffType) && isInserted) {
108
+ if (isMultiContainerBlockNode(nodeName)) {
109
+ return hideAddedDiffsUnderline ? editingContentStyleInBlockExtendedNoUnderline : editingContentStyleInBlockExtended;
110
+ }
111
+ if (isTextLikeBlockNode(nodeName)) {
112
+ return undefined;
113
+ }
114
+ if (isTraditional) {
115
+ return isActive ? traditionalStyleNodeActive : traditionalStyleNodeNew;
116
+ }
117
+ return editingStyleNode;
118
+ }
119
+ switch (nodeName) {
120
+ case 'blockquote':
121
+ if (isTraditional) {
122
+ return isActive ? deletedTraditionalStyleQuoteNodeActive : deletedTraditionalStyleQuoteNode;
123
+ }
124
+ return isActive ? deletedStyleQuoteNodeWithLozengeActive : deletedStyleQuoteNodeWithLozenge;
125
+ case 'expand':
126
+ case 'decisionList':
127
+ if (isTraditional) {
128
+ return isActive ? deletedTraditionalBlockOutlineActive : deletedTraditionalBlockOutlineNew;
129
+ }
130
+ return isActive ? deletedBlockOutlineActive : deletedBlockOutline;
131
+ case 'panel':
132
+ case 'codeBlock':
133
+ if (isTraditional) {
134
+ return isActive ? deletedTraditionalBlockOutlineRoundedActive : deletedTraditionalBlockOutlineRoundedNew;
135
+ }
136
+ return isActive ? deletedBlockOutlineRoundedActive : deletedBlockOutlineRounded;
137
+ default:
138
+ return undefined;
139
+ }
140
+ };
141
+
142
+ /** Pre-refactor unbounded strikethrough line for deleted content. */
143
+ export var getDeletedContentStyleUnboundedLegacy = function getDeletedContentStyleUnboundedLegacy(colorScheme) {
144
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
145
+ if (colorScheme === 'traditional' && isActive) {
146
+ return deletedTraditionalContentStyleUnboundedActive;
147
+ }
148
+ return colorScheme === 'traditional' ? deletedTraditionalContentStyleUnbounded : deletedContentStyleUnbounded;
149
+ };
150
+
151
+ /** Pre-refactor inline style for inserted content. */
152
+ export var getInsertedContentStyleLegacy = function getInsertedContentStyleLegacy(colorScheme) {
153
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
154
+ var hideAddedDiffsUnderline = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
155
+ if (colorScheme === 'traditional') {
156
+ return isActive ? traditionalInsertStyleActive : traditionalInsertStyle;
157
+ }
158
+ if (isActive) {
159
+ return hideAddedDiffsUnderline ? editingStyleActiveExtendedNoUnderline : editingStyleActiveExtended;
160
+ }
161
+ return hideAddedDiffsUnderline ? editingStyleExtendedNoUnderline : editingStyleExtended;
162
+ };
163
+
164
+ /** Pre-refactor inline style for deleted content. */
165
+ export var getDeletedContentStyleLegacy = function getDeletedContentStyleLegacy(colorScheme) {
166
+ var isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
167
+ var diffType = arguments.length > 2 ? arguments[2] : undefined;
168
+ if (colorScheme === 'traditional') {
169
+ return getDeletedTraditionalInlineStyle(isActive);
170
+ }
171
+ if (isExtendedEnabled(diffType)) {
172
+ return (isActive ? deletedContentStyleActive : deletedContentStyleNew) + deletedInlineContentStyleExtended;
173
+ }
174
+ return isActive ? deletedContentStyleActive : deletedContentStyleNew;
175
+ };
176
+
177
+ /**
178
+ * Pre-refactor table-cell overlay style, as chosen inside the `querySelectorAll('td, th')` loop of
179
+ * `applyCellOverlayStyles`. The choice does not vary per cell, so hoisting it out of the loop is
180
+ * behaviour-preserving.
181
+ *
182
+ * NOTE: not interchangeable with the same-named resolver in
183
+ * `createChangedRowDecorationWidgets.styles.legacy.ts`. The two pre-refactor call sites disagreed
184
+ * for the traditional non-rounded added cell — the nodeview path (here) used
185
+ * `traditionalAddedCellOverlayStyleNew`, the row-widget path used `traditionalAddedCellOverlayStyle`.
186
+ * Preserved as-is.
187
+ */
188
+ export var resolveCellOverlayStyleLegacy = function resolveCellOverlayStyleLegacy(_ref) {
189
+ var colorScheme = _ref.colorScheme,
190
+ isInserted = _ref.isInserted,
191
+ isRoundedTable = _ref.isRoundedTable;
192
+ var isTraditional = colorScheme === 'traditional';
193
+ var deletedCellStyle = isTraditional ? isRoundedTable ? deletedTraditionalCellOverlayRoundedStyle : deletedTraditionalCellOverlayStyle : isRoundedTable ? deletedCellOverlayRoundedStyle : deletedCellOverlayStyle;
194
+ var addedCellStyle = isTraditional ? isRoundedTable ? traditionalAddedCellOverlayRoundedStyle : traditionalAddedCellOverlayStyleNew : isRoundedTable ? addedCellOverlayRoundedStyle : addedCellOverlayStyle;
195
+ return isInserted ? addedCellStyle : deletedCellStyle;
196
+ };
197
+
198
+ /** Pre-refactor inner style for the "Removed" lozenge on a deleted block node. */
199
+ export var resolveRemovedLozengeStyleLegacy = function resolveRemovedLozengeStyleLegacy(colorScheme, isActive) {
200
+ return isActive && colorScheme === 'traditional' ? lozengeStyleActiveTraditional : isActive ? lozengeStyleActiveStandard : lozengeStyle;
201
+ };
202
+
203
+ /**
204
+ * Pre-refactor style for inserted content nested inside a multi-container or list node (the
205
+ * `decisionList` / `layoutSection` / `taskList` children). Always the standard scheme's node
206
+ * outline, in every colour scheme.
207
+ */
208
+ export var resolveNestedInsertedNodeStyleLegacy = function resolveNestedInsertedNodeStyleLegacy() {
209
+ return editingStyleNode;
210
+ };
211
+
212
+ /**
213
+ * Pre-refactor scheme predicate behind `maybeAddDeletedOutlineNewClass`. The `!isActive` half of
214
+ * the original condition stays at the call site in `wrapBlockNodeView.ts`.
215
+ */
216
+ export var hasRestingDeletedRingLegacy = function hasRestingDeletedRingLegacy(colorScheme) {
217
+ return colorScheme === 'traditional';
218
+ };