@atlaskit/editor-plugin-show-diff 15.1.10 → 15.1.11

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 (31) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/pm-plugins/decorations/colorSchemes/factory.js +13 -12
  3. package/dist/cjs/pm-plugins/decorations/colorSchemes/getStandardDeletedTextDecorationStyle.js +19 -0
  4. package/dist/cjs/pm-plugins/decorations/colorSchemes/standard.js +39 -26
  5. package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +9 -9
  6. package/dist/cjs/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.js +5 -3
  7. package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +5 -4
  8. package/dist/cjs/pm-plugins/decorations/revealStyles.js +1 -1
  9. package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +9 -10
  10. package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +5 -3
  11. package/dist/es2019/pm-plugins/decorations/colorSchemes/getStandardDeletedTextDecorationStyle.js +11 -0
  12. package/dist/es2019/pm-plugins/decorations/colorSchemes/standard.js +10 -8
  13. package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.js +6 -4
  14. package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +10 -10
  15. package/dist/es2019/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.js +6 -4
  16. package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +6 -5
  17. package/dist/es2019/pm-plugins/decorations/revealStyles.js +2 -2
  18. package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +10 -11
  19. package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +14 -12
  20. package/dist/esm/pm-plugins/decorations/colorSchemes/getStandardDeletedTextDecorationStyle.js +13 -0
  21. package/dist/esm/pm-plugins/decorations/colorSchemes/standard.js +38 -25
  22. package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +10 -10
  23. package/dist/esm/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.js +6 -4
  24. package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +6 -5
  25. package/dist/esm/pm-plugins/decorations/revealStyles.js +2 -2
  26. package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +10 -11
  27. package/dist/types/pm-plugins/decorations/colorSchemes/getStandardDeletedTextDecorationStyle.d.ts +12 -0
  28. package/dist/types/pm-plugins/decorations/colorSchemes/standard.d.ts +4 -4
  29. package/dist/types/pm-plugins/decorations/createChangedRowDecorationWidgets.styles.legacy.d.ts +4 -2
  30. package/dist/types/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.d.ts +4 -3
  31. package/package.json +5 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-show-diff
2
2
 
3
+ ## 15.1.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6572960285a9c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6572960285a9c) -
8
+ Prevent smart-diff strikethrough decorations from being parsed into ADF strike marks under
9
+ platform_editor_ai_suggested_edits_smart_diff.
10
+
3
11
  ## 15.1.10
4
12
 
5
13
  ### Patch Changes
@@ -70,6 +70,7 @@ exports.getDeletedInlineRevealColors = getDeletedInlineRevealColors;
70
70
  exports.getInsertedInlineRevealColors = getInsertedInlineRevealColors;
71
71
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
72
72
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
73
+ var _getStandardDeletedTextDecorationStyle = require("./getStandardDeletedTextDecorationStyle");
73
74
  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; }
74
75
  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; }
75
76
  // token() is a build-time transform needing static literals, so pre-compute every colour's
@@ -480,12 +481,12 @@ function buildDeletedBlockOutlineRoundedNew(colors) {
480
481
  function buildDeletedRowStyle(colors) {
481
482
  var _colors$deleteTextCol3;
482
483
  // Each branch emits exactly the CSS the pre-factory shim did for its scheme.
483
- return colors.deletedRowTreatment === 'textTint' ? (0, _lazyNodeView.convertToInlineCss)({
484
- color: textAccent((_colors$deleteTextCol3 = colors.deleteTextColor) !== null && _colors$deleteTextCol3 !== void 0 ? _colors$deleteTextCol3 : colors.deleteColor),
485
- textDecoration: 'line-through',
484
+ return colors.deletedRowTreatment === 'textTint' ? (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({
485
+ color: textAccent((_colors$deleteTextCol3 = colors.deleteTextColor) !== null && _colors$deleteTextCol3 !== void 0 ? _colors$deleteTextCol3 : colors.deleteColor)
486
+ }, (0, _getStandardDeletedTextDecorationStyle.getStandardDeletedTextDecorationStyle)()), {}, {
486
487
  opacity: 0.6,
487
488
  display: 'table-row'
488
- }) : (0, _lazyNodeView.convertToInlineCss)({
489
+ })) : (0, _lazyNodeView.convertToInlineCss)({
489
490
  textDecorationColor: borderAccent(colors.deleteColor),
490
491
  textDecoration: 'line-through',
491
492
  opacity: 0.6,
@@ -656,20 +657,20 @@ function buildDeletedInlineStyleStandard(colors, state) {
656
657
  var _colors$deleteTextCol5;
657
658
  if (state === 'active') {
658
659
  var _colors$deleteTextCol4;
659
- return (0, _lazyNodeView.convertToInlineCss)({
660
- color: colors.deleteTextColor ? textAccent(colors.deleteTextColor) : "var(--ds-text, #292A2E)",
661
- textDecoration: 'line-through',
660
+ return (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({
661
+ color: colors.deleteTextColor ? textAccent(colors.deleteTextColor) : "var(--ds-text, #292A2E)"
662
+ }, (0, _getStandardDeletedTextDecorationStyle.getStandardDeletedTextDecorationStyle)()), {}, {
662
663
  textDecorationColor: textAccent((_colors$deleteTextCol4 = colors.deleteTextColor) !== null && _colors$deleteTextCol4 !== void 0 ? _colors$deleteTextCol4 : colors.deleteColor),
663
664
  position: 'relative',
664
665
  opacity: colors.deleteTextColor ? 0.83 : 1
665
- });
666
+ }));
666
667
  }
667
- return (0, _lazyNodeView.convertToInlineCss)({
668
- color: textAccent((_colors$deleteTextCol5 = colors.deleteTextColor) !== null && _colors$deleteTextCol5 !== void 0 ? _colors$deleteTextCol5 : colors.deleteColor),
669
- textDecoration: 'line-through',
668
+ return (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({
669
+ color: textAccent((_colors$deleteTextCol5 = colors.deleteTextColor) !== null && _colors$deleteTextCol5 !== void 0 ? _colors$deleteTextCol5 : colors.deleteColor)
670
+ }, (0, _getStandardDeletedTextDecorationStyle.getStandardDeletedTextDecorationStyle)()), {}, {
670
671
  position: 'relative',
671
672
  opacity: colors.deleteTextColor || state === 'new' ? 0.83 : 0.6
672
- });
673
+ }));
673
674
  }
674
675
 
675
676
  /** Deleted node decoration marker — "new" state. */
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getStandardDeletedTextDecorationStyle = void 0;
7
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
8
+ /**
9
+ * The ADF strike parser recognises the `text-decoration` shorthand when a decorated NodeView is
10
+ * reconciled. Use the visually equivalent longhand for AI suggestion diffs so presentation-only
11
+ * styling cannot be retained as document content.
12
+ */
13
+ var getStandardDeletedTextDecorationStyle = exports.getStandardDeletedTextDecorationStyle = function getStandardDeletedTextDecorationStyle() {
14
+ return (0, _fg.fg)('platform_editor_ai_show_diff_patch_1') ? {
15
+ textDecorationLine: 'line-through'
16
+ } : {
17
+ textDecoration: 'line-through'
18
+ };
19
+ };
@@ -1,10 +1,15 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
- exports.standardDecorationMarkerVariable = exports.editingStyleRuleNode = exports.editingStyleQuoteNode = exports.editingStyleNode = exports.editingStyleExtendedNoUnderline = exports.editingStyleExtended = exports.editingStyleCardBlockNode = exports.editingStyleActiveExtendedNoUnderline = exports.editingStyleActiveExtended = exports.editingStyleActive = exports.editingStyle = exports.editingContentStyleInBlockExtendedNoUnderline = exports.editingContentStyleInBlockExtended = exports.editingContentStyleInBlock = exports.deletedStyleQuoteNodeWithLozengeActive = exports.deletedStyleQuoteNodeWithLozenge = exports.deletedStyleQuoteNode = exports.deletedRowStyle = exports.deletedInlineContentStyleExtended = exports.deletedDecorationMarkerVariable = exports.deletedContentStyleUnbounded = exports.deletedContentStyleNew = exports.deletedContentStyleActive = exports.deletedContentStyle = exports.deletedCellOverlayStyle = exports.deletedCellOverlayRoundedStyle = exports.deletedBlockOutlineRoundedActive = exports.deletedBlockOutlineRounded = exports.deletedBlockOutlineActive = exports.deletedBlockOutline = exports.addedCellOverlayStyle = exports.addedCellOverlayRoundedStyle = void 0;
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.editingStyleActive = exports.editingStyle = exports.editingContentStyleInBlockExtendedNoUnderline = exports.editingContentStyleInBlockExtended = exports.editingContentStyleInBlock = 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
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
9
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
10
+ var _getStandardDeletedTextDecorationStyle = require("./getStandardDeletedTextDecorationStyle");
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
+ 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; }
8
13
  // delete on platform_editor_diff_plugin_extended cleanup
9
14
  var editingStyle = exports.editingStyle = (0, _lazyNodeView.convertToInlineCss)({
10
15
  background: "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
@@ -62,25 +67,31 @@ var editingStyleActiveExtendedNoUnderline = exports.editingStyleActiveExtendedNo
62
67
  var editingContentStyleInBlockExtendedNoUnderline = exports.editingContentStyleInBlockExtendedNoUnderline = (0, _lazyNodeView.convertToInlineCss)({
63
68
  padding: "1px 0 2px"
64
69
  });
65
- var deletedContentStyle = exports.deletedContentStyle = (0, _lazyNodeView.convertToInlineCss)({
66
- color: "var(--ds-text-accent-gray, #505258)",
67
- textDecoration: 'line-through',
68
- position: 'relative',
69
- opacity: 0.6
70
- });
71
- var deletedContentStyleActive = exports.deletedContentStyleActive = (0, _lazyNodeView.convertToInlineCss)({
72
- color: "var(--ds-text, #292A2E)",
73
- textDecoration: 'line-through',
74
- textDecorationColor: "var(--ds-text-accent-gray, #505258)",
75
- position: 'relative',
76
- opacity: 1
77
- });
78
- var deletedContentStyleNew = exports.deletedContentStyleNew = (0, _lazyNodeView.convertToInlineCss)({
79
- color: "var(--ds-text-accent-gray, #505258)",
80
- textDecoration: 'line-through',
81
- position: 'relative',
82
- opacity: 0.83
83
- });
70
+ var getStandardDeletedContentStyle = exports.getStandardDeletedContentStyle = function getStandardDeletedContentStyle() {
71
+ return (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({
72
+ color: "var(--ds-text-accent-gray, #505258)"
73
+ }, (0, _getStandardDeletedTextDecorationStyle.getStandardDeletedTextDecorationStyle)()), {}, {
74
+ position: 'relative',
75
+ opacity: 0.6
76
+ }));
77
+ };
78
+ var getStandardDeletedContentStyleActive = exports.getStandardDeletedContentStyleActive = function getStandardDeletedContentStyleActive() {
79
+ return (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({
80
+ color: "var(--ds-text, #292A2E)"
81
+ }, (0, _getStandardDeletedTextDecorationStyle.getStandardDeletedTextDecorationStyle)()), {}, {
82
+ textDecorationColor: "var(--ds-text-accent-gray, #505258)",
83
+ position: 'relative',
84
+ opacity: 1
85
+ }));
86
+ };
87
+ var getStandardDeletedContentStyleNew = exports.getStandardDeletedContentStyleNew = function getStandardDeletedContentStyleNew() {
88
+ return (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({
89
+ color: "var(--ds-text-accent-gray, #505258)"
90
+ }, (0, _getStandardDeletedTextDecorationStyle.getStandardDeletedTextDecorationStyle)()), {}, {
91
+ position: 'relative',
92
+ opacity: 0.83
93
+ }));
94
+ };
84
95
 
85
96
  /**
86
97
  * Merge into existing styles when cleaning up
@@ -136,12 +147,14 @@ var deletedBlockOutlineRoundedActive = exports.deletedBlockOutlineRoundedActive
136
147
  boxShadow: "0 0 0 4px ".concat("var(--ds-border-accent-red, #E2483D)"),
137
148
  borderRadius: "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)")
138
149
  });
139
- var deletedRowStyle = exports.deletedRowStyle = (0, _lazyNodeView.convertToInlineCss)({
140
- color: "var(--ds-text-accent-gray, #505258)",
141
- textDecoration: 'line-through',
142
- opacity: 0.6,
143
- display: 'table-row'
144
- });
150
+ var getStandardDeletedRowStyle = exports.getStandardDeletedRowStyle = function getStandardDeletedRowStyle() {
151
+ return (0, _lazyNodeView.convertToInlineCss)(_objectSpread(_objectSpread({
152
+ color: "var(--ds-text-accent-gray, #505258)"
153
+ }, (0, _getStandardDeletedTextDecorationStyle.getStandardDeletedTextDecorationStyle)()), {}, {
154
+ opacity: 0.6,
155
+ display: 'table-row'
156
+ }));
157
+ };
145
158
  var editingStyleQuoteNode = exports.editingStyleQuoteNode = (0, _lazyNodeView.convertToInlineCss)({
146
159
  borderLeft: "2px solid ".concat("var(--ds-border-accent-purple, #AF59E1)")
147
160
  });
@@ -12,11 +12,11 @@ var _traditional = require("./colorSchemes/traditional");
12
12
  * Pre-refactor code preserved for the OFF cohort of
13
13
  * `platform_editor_show_diff_color_scheme_refactor`.
14
14
  *
15
- * This is a verbatim copy of the `getBlockNodeStyle` and the cell-overlay style selection that
16
- * lived in `createBlockChangedDecoration.ts` before the `colorSchemeRegistry` + `factory.ts`
17
- * migration. Do not modify it — it exists so the OFF cohort keeps the exact pre-refactor style
18
- * strings. Delete this file at cleanup, together with `colorSchemes/standard.ts`,
19
- * `colorSchemes/traditional.ts` (EDITOR-8281).
15
+ * This keeps the `getBlockNodeStyle` and cell-overlay style selection that lived in
16
+ * `createBlockChangedDecoration.ts` before the `colorSchemeRegistry` + `factory.ts` migration.
17
+ * Standard deleted styles are resolved at runtime only so the ADF-safety gate can select the
18
+ * equivalent longhand; with that gate off, their CSS remains unchanged. Delete this file at
19
+ * cleanup, together with `colorSchemes/standard.ts`, `colorSchemes/traditional.ts` (EDITOR-8281).
20
20
  */
21
21
 
22
22
  /** Verbatim copy of the pre-refactor cell-overlay style selection. */
@@ -78,7 +78,7 @@ var getBlockNodeStyleLegacy = exports.getBlockNodeStyleLegacy = function getBloc
78
78
  if (nodeName === 'listItem') {
79
79
  return isTraditional && isActive ? _traditional.traditionalDeletedDecorationMarkerVariableActive : isTraditional ? _traditional.traditionalDeletedDecorationMarkerVariableNew : _standard.deletedDecorationMarkerVariable;
80
80
  }
81
- return isTraditional && isActive ? _traditional.traditionalDeletedDecorationMarkerVariableActive : isTraditional ? _traditional.traditionalDeletedDecorationMarkerVariableNew : _standard.deletedContentStyleNew;
81
+ return isTraditional && isActive ? _traditional.traditionalDeletedDecorationMarkerVariableActive : isTraditional ? _traditional.traditionalDeletedDecorationMarkerVariableNew : (0, _standard.getStandardDeletedContentStyleNew)();
82
82
  }
83
83
  }
84
84
  return isTraditional && isActive ? _traditional.traditionalDecorationMarkerVariableActive : isTraditional ? _traditional.traditionalDecorationMarkerVariableNew : _standard.standardDecorationMarkerVariable;
@@ -98,7 +98,7 @@ var getBlockNodeStyleLegacy = exports.getBlockNodeStyleLegacy = function getBloc
98
98
  if (isInserted) {
99
99
  return isTraditional ? isActive ? _traditional.traditionalStyleRuleNodeActive : _traditional.traditionalStyleRuleNodeNew : _standard.editingStyleRuleNode;
100
100
  } else {
101
- return isTraditional ? (0, _traditional.getDeletedTraditionalInlineStyle)(false) : _standard.deletedContentStyleNew;
101
+ return isTraditional ? (0, _traditional.getDeletedTraditionalInlineStyle)(false) : (0, _standard.getStandardDeletedContentStyleNew)();
102
102
  }
103
103
  }
104
104
  return isTraditional ? isActive ? _traditional.traditionalStyleRuleNodeActive : _traditional.traditionalStyleRuleNodeNew : _standard.editingStyleRuleNode;
@@ -108,7 +108,7 @@ var getBlockNodeStyleLegacy = exports.getBlockNodeStyleLegacy = function getBloc
108
108
  if (isInserted) {
109
109
  return isTraditional ? isActive ? _traditional.traditionalStyleCardBlockNodeActive : _traditional.traditionalStyleCardBlockNodeNew : _standard.editingStyleCardBlockNode;
110
110
  } else {
111
- return isTraditional ? (0, _traditional.getDeletedTraditionalInlineStyle)(false) : _standard.deletedContentStyleNew;
111
+ return isTraditional ? (0, _traditional.getDeletedTraditionalInlineStyle)(false) : (0, _standard.getStandardDeletedContentStyleNew)();
112
112
  }
113
113
  }
114
114
  return isTraditional ? isActive ? _traditional.traditionalStyleCardBlockNodeActive : _traditional.traditionalStyleCardBlockNodeNew : _standard.editingStyleCardBlockNode;
@@ -117,7 +117,7 @@ var getBlockNodeStyleLegacy = exports.getBlockNodeStyleLegacy = function getBloc
117
117
  if (isInserted) {
118
118
  return isTraditional ? isActive ? _traditional.traditionalStyleNodeActive : _traditional.traditionalStyleNodeNew : _standard.editingStyleNode;
119
119
  } else {
120
- return isTraditional ? (0, _traditional.getDeletedTraditionalInlineStyle)(false) : _standard.deletedContentStyleNew;
120
+ return isTraditional ? (0, _traditional.getDeletedTraditionalInlineStyle)(false) : (0, _standard.getStandardDeletedContentStyleNew)();
121
121
  }
122
122
  }
123
123
  return isTraditional ? isActive ? _traditional.traditionalStyleNodeActive : _traditional.traditionalStyleNodeNew : _standard.editingStyleNode;
@@ -10,8 +10,10 @@ var _traditional = require("./colorSchemes/traditional");
10
10
  * Pre-refactor code preserved for the OFF cohort of
11
11
  * `platform_editor_show_diff_color_scheme_refactor`.
12
12
  *
13
- * These resolvers reproduce the per-scheme string-constant style decisions that
14
- * `createChangedRowDOM` made before the `colorSchemeRegistry` + `factory.ts` migration, verbatim.
13
+ * These resolvers reproduce the per-scheme style decisions that `createChangedRowDOM` made before
14
+ * the `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at
15
+ * runtime only so the ADF-safety gate can select the equivalent longhand; with that gate off,
16
+ * their CSS remains unchanged.
15
17
  *
16
18
  * Do not modify. Delete this file at experiment cleanup (EDITOR-8281).
17
19
  */
@@ -20,7 +22,7 @@ var _traditional = require("./colorSchemes/traditional");
20
22
  * Pre-refactor deleted-row style for the `<tr>` element.
21
23
  */
22
24
  var resolveDeletedRowStyleLegacy = exports.resolveDeletedRowStyleLegacy = function resolveDeletedRowStyleLegacy(colorScheme) {
23
- return colorScheme === 'traditional' ? _traditional.deletedTraditionalRowStyle : _standard.deletedRowStyle;
25
+ return colorScheme === 'traditional' ? _traditional.deletedTraditionalRowStyle : (0, _standard.getStandardDeletedRowStyle)();
24
26
  };
25
27
 
26
28
  /**
@@ -11,9 +11,10 @@ var _traditional = require("./colorSchemes/traditional");
11
11
  * Pre-refactor `createInlineChangedDecoration` styling code, preserved verbatim for the OFF cohort
12
12
  * of `platform_editor_show_diff_color_scheme_refactor`.
13
13
  *
14
- * Do not modify — this module exists purely so the OFF cohort keeps running the exact code that
15
- * shipped before the `colorSchemeRegistry` + `factory.ts` migration. Delete the whole file at
16
- * experiment cleanup (EDITOR-8281).
14
+ * This module exists so the OFF cohort keeps running the code that shipped before the
15
+ * `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at runtime
16
+ * only so the ADF-safety gate can select the equivalent longhand; with that gate off, their CSS
17
+ * remains unchanged. Delete the whole file at experiment cleanup (EDITOR-8281).
17
18
  */
18
19
 
19
20
  /**
@@ -37,7 +38,7 @@ var resolveInlineChangedStyleLegacy = exports.resolveInlineChangedStyleLegacy =
37
38
  if (colorScheme === 'traditional') {
38
39
  style = (0, _traditional.getDeletedTraditionalInlineStyle)(false);
39
40
  } else {
40
- style = (isActive ? _standard.deletedContentStyleActive : _standard.deletedContentStyle) + _standard.deletedInlineContentStyleExtended;
41
+ style = (isActive ? (0, _standard.getStandardDeletedContentStyleActive)() : (0, _standard.getStandardDeletedContentStyle)()) + _standard.deletedInlineContentStyleExtended;
41
42
  }
42
43
  }
43
44
  } else {
@@ -94,7 +94,7 @@ var getColorScheme = function getColorScheme(colorScheme) {
94
94
 
95
95
  /** Deleted text appearance (grey and strikethrough) without the highlight. */
96
96
  var deletedTextOnlyStyle = function deletedTextOnlyStyle(colors, isActive) {
97
- return (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_show_diff_color_scheme_refactor') ? (0, _factory.buildDeletedInlineStyleStandard)(colors, isActive ? 'active' : 'default') : isActive ? _standard.deletedContentStyleActive : _standard.deletedContentStyle;
97
+ return (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_show_diff_color_scheme_refactor') ? (0, _factory.buildDeletedInlineStyleStandard)(colors, isActive ? 'active' : 'default') : isActive ? (0, _standard.getStandardDeletedContentStyleActive)() : (0, _standard.getStandardDeletedContentStyle)();
98
98
  };
99
99
 
100
100
  /**
@@ -13,12 +13,11 @@ var _traditional = require("../colorSchemes/traditional");
13
13
  * Pre-refactor code preserved for the OFF cohort of
14
14
  * `platform_editor_show_diff_color_scheme_refactor`.
15
15
  *
16
- * These resolvers hold, verbatim, the per-scheme string-constant style decisions that
17
- * `wrapBlockNodeView.ts` made before the `colorSchemeRegistry` + `factory.ts` migration — same
18
- * branches, same ternaries, same order, same shim constants, same module-level constants.
19
- *
20
- * Do not modify. Delete this file at experiment cleanup, together with `colorSchemes/standard.ts`,
21
- * `colorSchemes/traditional.ts` (EDITOR-8281).
16
+ * These resolvers hold the per-scheme style decisions that `wrapBlockNodeView.ts` made before the
17
+ * `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at runtime
18
+ * only so the ADF-safety gate can select the equivalent longhand; with that gate off, their CSS
19
+ * remains unchanged. Delete this file at experiment cleanup, together with
20
+ * `colorSchemes/standard.ts`, `colorSchemes/traditional.ts` (EDITOR-8281).
22
21
  */
23
22
 
24
23
  var lozengeStyle = (0, _lazyNodeView.convertToInlineCss)({
@@ -99,9 +98,9 @@ var getChangedContentStyleLegacy = exports.getChangedContentStyleLegacy = functi
99
98
  return (0, _traditional.getDeletedTraditionalInlineStyle)(isActive);
100
99
  }
101
100
  if (isActive) {
102
- return _standard.deletedContentStyleActive;
101
+ return (0, _standard.getStandardDeletedContentStyleActive)();
103
102
  }
104
- return (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? _standard.deletedContentStyleNew : _standard.deletedContentStyle;
103
+ return (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? (0, _standard.getStandardDeletedContentStyleNew)() : (0, _standard.getStandardDeletedContentStyle)();
105
104
  };
106
105
 
107
106
  /** Pre-refactor node-specific style for a changed block node. */
@@ -177,9 +176,9 @@ var getDeletedContentStyleLegacy = exports.getDeletedContentStyleLegacy = functi
177
176
  return (0, _traditional.getDeletedTraditionalInlineStyle)(isActive);
178
177
  }
179
178
  if ((0, _isExtendedEnabled.isExtendedEnabled)(diffType) && !omitHighlight) {
180
- return (isActive ? _standard.deletedContentStyleActive : _standard.deletedContentStyleNew) + _standard.deletedInlineContentStyleExtended;
179
+ return (isActive ? (0, _standard.getStandardDeletedContentStyleActive)() : (0, _standard.getStandardDeletedContentStyleNew)()) + _standard.deletedInlineContentStyleExtended;
181
180
  }
182
- return isActive ? _standard.deletedContentStyleActive : _standard.deletedContentStyleNew;
181
+ return isActive ? (0, _standard.getStandardDeletedContentStyleActive)() : (0, _standard.getStandardDeletedContentStyleNew)();
183
182
  };
184
183
 
185
184
  /**
@@ -1,4 +1,6 @@
1
1
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
2
+ import { getStandardDeletedTextDecorationStyle } from './getStandardDeletedTextDecorationStyle';
3
+
2
4
  // token() is a build-time transform needing static literals, so pre-compute every colour's
3
5
  // tokens here and index by name at runtime.
4
6
 
@@ -410,7 +412,7 @@ export function buildDeletedRowStyle(colors) {
410
412
  // Each branch emits exactly the CSS the pre-factory shim did for its scheme.
411
413
  return colors.deletedRowTreatment === 'textTint' ? convertToInlineCss({
412
414
  color: textAccent((_colors$deleteTextCol3 = colors.deleteTextColor) !== null && _colors$deleteTextCol3 !== void 0 ? _colors$deleteTextCol3 : colors.deleteColor),
413
- textDecoration: 'line-through',
415
+ ...getStandardDeletedTextDecorationStyle(),
414
416
  opacity: 0.6,
415
417
  display: 'table-row'
416
418
  }) : convertToInlineCss({
@@ -586,7 +588,7 @@ export function buildDeletedInlineStyleStandard(colors, state) {
586
588
  var _colors$deleteTextCol4;
587
589
  return convertToInlineCss({
588
590
  color: colors.deleteTextColor ? textAccent(colors.deleteTextColor) : "var(--ds-text, #292A2E)",
589
- textDecoration: 'line-through',
591
+ ...getStandardDeletedTextDecorationStyle(),
590
592
  textDecorationColor: textAccent((_colors$deleteTextCol4 = colors.deleteTextColor) !== null && _colors$deleteTextCol4 !== void 0 ? _colors$deleteTextCol4 : colors.deleteColor),
591
593
  position: 'relative',
592
594
  opacity: colors.deleteTextColor ? 0.83 : 1
@@ -594,7 +596,7 @@ export function buildDeletedInlineStyleStandard(colors, state) {
594
596
  }
595
597
  return convertToInlineCss({
596
598
  color: textAccent((_colors$deleteTextCol5 = colors.deleteTextColor) !== null && _colors$deleteTextCol5 !== void 0 ? _colors$deleteTextCol5 : colors.deleteColor),
597
- textDecoration: 'line-through',
599
+ ...getStandardDeletedTextDecorationStyle(),
598
600
  position: 'relative',
599
601
  opacity: colors.deleteTextColor || state === 'new' ? 0.83 : 0.6
600
602
  });
@@ -0,0 +1,11 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
2
+ /**
3
+ * The ADF strike parser recognises the `text-decoration` shorthand when a decorated NodeView is
4
+ * reconciled. Use the visually equivalent longhand for AI suggestion diffs so presentation-only
5
+ * styling cannot be retained as document content.
6
+ */
7
+ export const getStandardDeletedTextDecorationStyle = () => fg('platform_editor_ai_show_diff_patch_1') ? {
8
+ textDecorationLine: 'line-through'
9
+ } : {
10
+ textDecoration: 'line-through'
11
+ };
@@ -1,4 +1,6 @@
1
1
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
2
+ import { getStandardDeletedTextDecorationStyle } from './getStandardDeletedTextDecorationStyle';
3
+
2
4
  // delete on platform_editor_diff_plugin_extended cleanup
3
5
  export const editingStyle = convertToInlineCss({
4
6
  background: "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
@@ -56,22 +58,22 @@ export const editingStyleActiveExtendedNoUnderline = convertToInlineCss({
56
58
  export const editingContentStyleInBlockExtendedNoUnderline = convertToInlineCss({
57
59
  padding: `1px 0 2px`
58
60
  });
59
- export const deletedContentStyle = convertToInlineCss({
61
+ export const getStandardDeletedContentStyle = () => convertToInlineCss({
60
62
  color: "var(--ds-text-accent-gray, #505258)",
61
- textDecoration: 'line-through',
63
+ ...getStandardDeletedTextDecorationStyle(),
62
64
  position: 'relative',
63
65
  opacity: 0.6
64
66
  });
65
- export const deletedContentStyleActive = convertToInlineCss({
67
+ export const getStandardDeletedContentStyleActive = () => convertToInlineCss({
66
68
  color: "var(--ds-text, #292A2E)",
67
- textDecoration: 'line-through',
69
+ ...getStandardDeletedTextDecorationStyle(),
68
70
  textDecorationColor: "var(--ds-text-accent-gray, #505258)",
69
71
  position: 'relative',
70
72
  opacity: 1
71
73
  });
72
- export const deletedContentStyleNew = convertToInlineCss({
74
+ export const getStandardDeletedContentStyleNew = () => convertToInlineCss({
73
75
  color: "var(--ds-text-accent-gray, #505258)",
74
- textDecoration: 'line-through',
76
+ ...getStandardDeletedTextDecorationStyle(),
75
77
  position: 'relative',
76
78
  opacity: 0.83
77
79
  });
@@ -130,9 +132,9 @@ export const deletedBlockOutlineRoundedActive = convertToInlineCss({
130
132
  boxShadow: `0 0 0 4px ${"var(--ds-border-accent-red, #E2483D)"}`,
131
133
  borderRadius: `calc(${"var(--ds-radius-xsmall, 2px)"} + 1px)`
132
134
  });
133
- export const deletedRowStyle = convertToInlineCss({
135
+ export const getStandardDeletedRowStyle = () => convertToInlineCss({
134
136
  color: "var(--ds-text-accent-gray, #505258)",
135
- textDecoration: 'line-through',
137
+ ...getStandardDeletedTextDecorationStyle(),
136
138
  opacity: 0.6,
137
139
  display: 'table-row'
138
140
  });
@@ -114,10 +114,12 @@ const getBlockNodeStyleNext = ({
114
114
  * OFF cohort of `platform_editor_show_diff_color_scheme_refactor`. Both are built to emit the
115
115
  * same style strings for both shipped schemes; see EDITOR-8281.
116
116
  */
117
- const getBlockNodeStyle = props => isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? getBlockNodeStyleNext(props) : getBlockNodeStyleLegacy({
118
- ...props,
119
- colorScheme: getLegacyColorScheme(props.colorScheme)
120
- });
117
+ const getBlockNodeStyle = props => {
118
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? getBlockNodeStyleNext(props) : getBlockNodeStyleLegacy({
119
+ ...props,
120
+ colorScheme: getLegacyColorScheme(props.colorScheme)
121
+ });
122
+ };
121
123
 
122
124
  /**
123
125
  * A table cell is "empty" only when it has no content at all — no text AND no
@@ -2,15 +2,15 @@
2
2
  * Pre-refactor code preserved for the OFF cohort of
3
3
  * `platform_editor_show_diff_color_scheme_refactor`.
4
4
  *
5
- * This is a verbatim copy of the `getBlockNodeStyle` and the cell-overlay style selection that
6
- * lived in `createBlockChangedDecoration.ts` before the `colorSchemeRegistry` + `factory.ts`
7
- * migration. Do not modify it — it exists so the OFF cohort keeps the exact pre-refactor style
8
- * strings. Delete this file at cleanup, together with `colorSchemes/standard.ts`,
9
- * `colorSchemes/traditional.ts` (EDITOR-8281).
5
+ * This keeps the `getBlockNodeStyle` and cell-overlay style selection that lived in
6
+ * `createBlockChangedDecoration.ts` before the `colorSchemeRegistry` + `factory.ts` migration.
7
+ * Standard deleted styles are resolved at runtime only so the ADF-safety gate can select the
8
+ * equivalent longhand; with that gate off, their CSS remains unchanged. Delete this file at
9
+ * cleanup, together with `colorSchemes/standard.ts`, `colorSchemes/traditional.ts` (EDITOR-8281).
10
10
  */
11
11
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
12
12
  import { isExtendedEnabled } from '../isExtendedEnabled';
13
- import { standardDecorationMarkerVariable, deletedDecorationMarkerVariable, editingStyleQuoteNode, editingStyleRuleNode, editingStyleCardBlockNode, editingStyleNode, deletedContentStyleNew, deletedStyleQuoteNode, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from './colorSchemes/standard';
13
+ import { standardDecorationMarkerVariable, deletedDecorationMarkerVariable, editingStyleQuoteNode, editingStyleRuleNode, editingStyleCardBlockNode, editingStyleNode, getStandardDeletedContentStyleNew, deletedStyleQuoteNode, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from './colorSchemes/standard';
14
14
  import { traditionalDecorationMarkerVariableActive, traditionalDecorationMarkerVariableNew, traditionalDeletedDecorationMarkerVariableActive, traditionalDeletedDecorationMarkerVariableNew, traditionalStyleQuoteNodeActive, traditionalStyleQuoteNodeNew, traditionalStyleRuleNodeActive, traditionalStyleRuleNodeNew, traditionalStyleCardBlockNodeActive, traditionalStyleCardBlockNodeNew, traditionalStyleNodeActive, traditionalStyleNodeNew, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, traditionalAddedCellOverlayStyle, traditionalAddedCellOverlayRoundedStyle, deletedTraditionalCellOverlayStyle, deletedTraditionalCellOverlayRoundedStyle } from './colorSchemes/traditional';
15
15
 
16
16
  /** Verbatim copy of the pre-refactor cell-overlay style selection. */
@@ -72,7 +72,7 @@ export const getBlockNodeStyleLegacy = ({
72
72
  if (nodeName === 'listItem') {
73
73
  return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : deletedDecorationMarkerVariable;
74
74
  }
75
- return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : deletedContentStyleNew;
75
+ return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : getStandardDeletedContentStyleNew();
76
76
  }
77
77
  }
78
78
  return isTraditional && isActive ? traditionalDecorationMarkerVariableActive : isTraditional ? traditionalDecorationMarkerVariableNew : standardDecorationMarkerVariable;
@@ -92,7 +92,7 @@ export const getBlockNodeStyleLegacy = ({
92
92
  if (isInserted) {
93
93
  return isTraditional ? isActive ? traditionalStyleRuleNodeActive : traditionalStyleRuleNodeNew : editingStyleRuleNode;
94
94
  } else {
95
- return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedContentStyleNew;
95
+ return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
96
96
  }
97
97
  }
98
98
  return isTraditional ? isActive ? traditionalStyleRuleNodeActive : traditionalStyleRuleNodeNew : editingStyleRuleNode;
@@ -102,7 +102,7 @@ export const getBlockNodeStyleLegacy = ({
102
102
  if (isInserted) {
103
103
  return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : traditionalStyleCardBlockNodeNew : editingStyleCardBlockNode;
104
104
  } else {
105
- return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedContentStyleNew;
105
+ return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
106
106
  }
107
107
  }
108
108
  return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : traditionalStyleCardBlockNodeNew : editingStyleCardBlockNode;
@@ -111,7 +111,7 @@ export const getBlockNodeStyleLegacy = ({
111
111
  if (isInserted) {
112
112
  return isTraditional ? isActive ? traditionalStyleNodeActive : traditionalStyleNodeNew : editingStyleNode;
113
113
  } else {
114
- return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedContentStyleNew;
114
+ return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
115
115
  }
116
116
  }
117
117
  return isTraditional ? isActive ? traditionalStyleNodeActive : traditionalStyleNodeNew : editingStyleNode;
@@ -2,20 +2,22 @@
2
2
  * Pre-refactor code preserved for the OFF cohort of
3
3
  * `platform_editor_show_diff_color_scheme_refactor`.
4
4
  *
5
- * These resolvers reproduce the per-scheme string-constant style decisions that
6
- * `createChangedRowDOM` made before the `colorSchemeRegistry` + `factory.ts` migration, verbatim.
5
+ * These resolvers reproduce the per-scheme style decisions that `createChangedRowDOM` made before
6
+ * the `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at
7
+ * runtime only so the ADF-safety gate can select the equivalent longhand; with that gate off,
8
+ * their CSS remains unchanged.
7
9
  *
8
10
  * Do not modify. Delete this file at experiment cleanup (EDITOR-8281).
9
11
  */
10
12
 
11
- import { addedCellOverlayRoundedStyle, addedCellOverlayStyle, deletedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedRowStyle } from './colorSchemes/standard';
13
+ import { addedCellOverlayRoundedStyle, addedCellOverlayStyle, deletedCellOverlayRoundedStyle, deletedCellOverlayStyle, getStandardDeletedRowStyle } from './colorSchemes/standard';
12
14
  import { deletedTraditionalCellOverlayRoundedStyle, deletedTraditionalCellOverlayStyle, deletedTraditionalRowStyle, traditionalAddedCellOverlayRoundedStyle, traditionalAddedCellOverlayStyle } from './colorSchemes/traditional';
13
15
 
14
16
  /**
15
17
  * Pre-refactor deleted-row style for the `<tr>` element.
16
18
  */
17
19
  export const resolveDeletedRowStyleLegacy = colorScheme => {
18
- return colorScheme === 'traditional' ? deletedTraditionalRowStyle : deletedRowStyle;
20
+ return colorScheme === 'traditional' ? deletedTraditionalRowStyle : getStandardDeletedRowStyle();
19
21
  };
20
22
 
21
23
  /**
@@ -2,13 +2,14 @@
2
2
  * Pre-refactor `createInlineChangedDecoration` styling code, preserved verbatim for the OFF cohort
3
3
  * of `platform_editor_show_diff_color_scheme_refactor`.
4
4
  *
5
- * Do not modify — this module exists purely so the OFF cohort keeps running the exact code that
6
- * shipped before the `colorSchemeRegistry` + `factory.ts` migration. Delete the whole file at
7
- * experiment cleanup (EDITOR-8281).
5
+ * This module exists so the OFF cohort keeps running the code that shipped before the
6
+ * `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at runtime
7
+ * only so the ADF-safety gate can select the equivalent longhand; with that gate off, their CSS
8
+ * remains unchanged. Delete the whole file at experiment cleanup (EDITOR-8281).
8
9
  */
9
10
 
10
11
  import { isExtendedEnabled } from '../isExtendedEnabled';
11
- import { deletedContentStyle, deletedContentStyleActive, deletedInlineContentStyleExtended, editingStyle, editingStyleActive, editingStyleActiveExtended, editingStyleActiveExtendedNoUnderline, editingStyleExtended, editingStyleExtendedNoUnderline } from './colorSchemes/standard';
12
+ import { deletedInlineContentStyleExtended, editingStyle, editingStyleActive, editingStyleActiveExtended, editingStyleActiveExtendedNoUnderline, editingStyleExtended, editingStyleExtendedNoUnderline, getStandardDeletedContentStyle, getStandardDeletedContentStyleActive } from './colorSchemes/standard';
12
13
  import { getDeletedTraditionalInlineStyle, traditionalInsertStyle, traditionalInsertStyleActive } from './colorSchemes/traditional';
13
14
  /**
14
15
  * Pre-refactor inline `style` computation for `createInlineChangedDecoration`.
@@ -32,7 +33,7 @@ export const resolveInlineChangedStyleLegacy = ({
32
33
  if (colorScheme === 'traditional') {
33
34
  style = getDeletedTraditionalInlineStyle(false);
34
35
  } else {
35
- style = (isActive ? deletedContentStyleActive : deletedContentStyle) + deletedInlineContentStyleExtended;
36
+ style = (isActive ? getStandardDeletedContentStyleActive() : getStandardDeletedContentStyle()) + deletedInlineContentStyleExtended;
36
37
  }
37
38
  }
38
39
  } else {
@@ -2,7 +2,7 @@ import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
2
2
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
3
3
  import { buildDeletedInlineStyleStandard, getDeletedInlineRevealColors, getInsertedInlineRevealColors } from './colorSchemes/factory';
4
4
  import { colorSchemeRegistry } from './colorSchemes/schemes';
5
- import { deletedContentStyle, deletedContentStyleActive } from './colorSchemes/standard';
5
+ import { getStandardDeletedContentStyle, getStandardDeletedContentStyleActive } from './colorSchemes/standard';
6
6
  /**
7
7
  * Painting strategy for reveal highlights. Highlights are `linear-gradient`s with animated
8
8
  * `background-size` for the wipe effect. Colours live on elements as custom properties so the
@@ -77,7 +77,7 @@ const resolveRevealColors = (colors, variant) => isExperimentEnabled('platform_e
77
77
  const getColorScheme = colorScheme => colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : 'standard'];
78
78
 
79
79
  /** Deleted text appearance (grey and strikethrough) without the highlight. */
80
- const deletedTextOnlyStyle = (colors, isActive) => isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? buildDeletedInlineStyleStandard(colors, isActive ? 'active' : 'default') : isActive ? deletedContentStyleActive : deletedContentStyle;
80
+ const deletedTextOnlyStyle = (colors, isActive) => isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? buildDeletedInlineStyleStandard(colors, isActive ? 'active' : 'default') : isActive ? getStandardDeletedContentStyleActive() : getStandardDeletedContentStyle();
81
81
 
82
82
  /**
83
83
  * Resolve reveal attribute and style for a decoration. Returned style REPLACES the decoration's
@@ -2,17 +2,16 @@
2
2
  * Pre-refactor code preserved for the OFF cohort of
3
3
  * `platform_editor_show_diff_color_scheme_refactor`.
4
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).
5
+ * These resolvers hold the per-scheme style decisions that `wrapBlockNodeView.ts` made before the
6
+ * `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at runtime
7
+ * only so the ADF-safety gate can select the equivalent longhand; with that gate off, their CSS
8
+ * remains unchanged. Delete this file at experiment cleanup, together with
9
+ * `colorSchemes/standard.ts`, `colorSchemes/traditional.ts` (EDITOR-8281).
11
10
  */
12
11
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
13
12
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  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';
14
+ import { deletedBlockOutline, deletedBlockOutlineActive, deletedBlockOutlineRounded, deletedBlockOutlineRoundedActive, deletedContentStyleUnbounded, deletedInlineContentStyleExtended, deletedStyleQuoteNodeWithLozenge, deletedStyleQuoteNodeWithLozengeActive, editingContentStyleInBlockExtended, editingContentStyleInBlockExtendedNoUnderline, editingStyleExtended, editingStyleExtendedNoUnderline, editingStyleActiveExtended, editingStyleActiveExtendedNoUnderline, editingStyleNode, getStandardDeletedContentStyle, getStandardDeletedContentStyleActive, getStandardDeletedContentStyleNew, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from '../colorSchemes/standard';
16
15
  import { deletedTraditionalBlockOutlineActive, deletedTraditionalBlockOutlineNew, deletedTraditionalBlockOutlineRoundedActive, deletedTraditionalBlockOutlineRoundedNew, deletedTraditionalContentStyleUnbounded, deletedTraditionalContentStyleUnboundedActive, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, deletedTraditionalStyleQuoteNodeActive, traditionalInsertStyle, traditionalInsertStyleActive, traditionalStyleNodeActive, traditionalStyleNodeNew, traditionalAddedCellOverlayRoundedStyle, traditionalAddedCellOverlayStyleNew, deletedTraditionalCellOverlayStyle, deletedTraditionalCellOverlayRoundedStyle } from '../colorSchemes/traditional';
17
16
  const lozengeStyle = convertToInlineCss({
18
17
  display: 'inline-flex',
@@ -88,9 +87,9 @@ export const getChangedContentStyleLegacy = (colorScheme, isActive = false, isIn
88
87
  return getDeletedTraditionalInlineStyle(isActive);
89
88
  }
90
89
  if (isActive) {
91
- return deletedContentStyleActive;
90
+ return getStandardDeletedContentStyleActive();
92
91
  }
93
- return expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? deletedContentStyleNew : deletedContentStyle;
92
+ return expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? getStandardDeletedContentStyleNew() : getStandardDeletedContentStyle();
94
93
  };
95
94
 
96
95
  /** Pre-refactor node-specific style for a changed block node. */
@@ -159,9 +158,9 @@ omitHighlight = false) => {
159
158
  return getDeletedTraditionalInlineStyle(isActive);
160
159
  }
161
160
  if (isExtendedEnabled(diffType) && !omitHighlight) {
162
- return (isActive ? deletedContentStyleActive : deletedContentStyleNew) + deletedInlineContentStyleExtended;
161
+ return (isActive ? getStandardDeletedContentStyleActive() : getStandardDeletedContentStyleNew()) + deletedInlineContentStyleExtended;
163
162
  }
164
- return isActive ? deletedContentStyleActive : deletedContentStyleNew;
163
+ return isActive ? getStandardDeletedContentStyleActive() : getStandardDeletedContentStyleNew();
165
164
  };
166
165
 
167
166
  /**
@@ -2,6 +2,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  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; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
5
+ import { getStandardDeletedTextDecorationStyle } from './getStandardDeletedTextDecorationStyle';
6
+
5
7
  // token() is a build-time transform needing static literals, so pre-compute every colour's
6
8
  // tokens here and index by name at runtime.
7
9
 
@@ -410,12 +412,12 @@ export function buildDeletedBlockOutlineRoundedNew(colors) {
410
412
  export function buildDeletedRowStyle(colors) {
411
413
  var _colors$deleteTextCol3;
412
414
  // Each branch emits exactly the CSS the pre-factory shim did for its scheme.
413
- return colors.deletedRowTreatment === 'textTint' ? convertToInlineCss({
414
- color: textAccent((_colors$deleteTextCol3 = colors.deleteTextColor) !== null && _colors$deleteTextCol3 !== void 0 ? _colors$deleteTextCol3 : colors.deleteColor),
415
- textDecoration: 'line-through',
415
+ return colors.deletedRowTreatment === 'textTint' ? convertToInlineCss(_objectSpread(_objectSpread({
416
+ color: textAccent((_colors$deleteTextCol3 = colors.deleteTextColor) !== null && _colors$deleteTextCol3 !== void 0 ? _colors$deleteTextCol3 : colors.deleteColor)
417
+ }, getStandardDeletedTextDecorationStyle()), {}, {
416
418
  opacity: 0.6,
417
419
  display: 'table-row'
418
- }) : convertToInlineCss({
420
+ })) : convertToInlineCss({
419
421
  textDecorationColor: borderAccent(colors.deleteColor),
420
422
  textDecoration: 'line-through',
421
423
  opacity: 0.6,
@@ -586,20 +588,20 @@ export function buildDeletedInlineStyleStandard(colors, state) {
586
588
  var _colors$deleteTextCol5;
587
589
  if (state === 'active') {
588
590
  var _colors$deleteTextCol4;
589
- return convertToInlineCss({
590
- color: colors.deleteTextColor ? textAccent(colors.deleteTextColor) : "var(--ds-text, #292A2E)",
591
- textDecoration: 'line-through',
591
+ return convertToInlineCss(_objectSpread(_objectSpread({
592
+ color: colors.deleteTextColor ? textAccent(colors.deleteTextColor) : "var(--ds-text, #292A2E)"
593
+ }, getStandardDeletedTextDecorationStyle()), {}, {
592
594
  textDecorationColor: textAccent((_colors$deleteTextCol4 = colors.deleteTextColor) !== null && _colors$deleteTextCol4 !== void 0 ? _colors$deleteTextCol4 : colors.deleteColor),
593
595
  position: 'relative',
594
596
  opacity: colors.deleteTextColor ? 0.83 : 1
595
- });
597
+ }));
596
598
  }
597
- return convertToInlineCss({
598
- color: textAccent((_colors$deleteTextCol5 = colors.deleteTextColor) !== null && _colors$deleteTextCol5 !== void 0 ? _colors$deleteTextCol5 : colors.deleteColor),
599
- textDecoration: 'line-through',
599
+ return convertToInlineCss(_objectSpread(_objectSpread({
600
+ color: textAccent((_colors$deleteTextCol5 = colors.deleteTextColor) !== null && _colors$deleteTextCol5 !== void 0 ? _colors$deleteTextCol5 : colors.deleteColor)
601
+ }, getStandardDeletedTextDecorationStyle()), {}, {
600
602
  position: 'relative',
601
603
  opacity: colors.deleteTextColor || state === 'new' ? 0.83 : 0.6
602
- });
604
+ }));
603
605
  }
604
606
 
605
607
  /** Deleted node decoration marker — "new" state. */
@@ -0,0 +1,13 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
2
+ /**
3
+ * The ADF strike parser recognises the `text-decoration` shorthand when a decorated NodeView is
4
+ * reconciled. Use the visually equivalent longhand for AI suggestion diffs so presentation-only
5
+ * styling cannot be retained as document content.
6
+ */
7
+ export var getStandardDeletedTextDecorationStyle = function getStandardDeletedTextDecorationStyle() {
8
+ return fg('platform_editor_ai_show_diff_patch_1') ? {
9
+ textDecorationLine: 'line-through'
10
+ } : {
11
+ textDecoration: 'line-through'
12
+ };
13
+ };
@@ -1,4 +1,9 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ 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; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1
4
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
5
+ import { getStandardDeletedTextDecorationStyle } from './getStandardDeletedTextDecorationStyle';
6
+
2
7
  // delete on platform_editor_diff_plugin_extended cleanup
3
8
  export var editingStyle = convertToInlineCss({
4
9
  background: "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
@@ -56,25 +61,31 @@ export var editingStyleActiveExtendedNoUnderline = convertToInlineCss({
56
61
  export var editingContentStyleInBlockExtendedNoUnderline = convertToInlineCss({
57
62
  padding: "1px 0 2px"
58
63
  });
59
- export var deletedContentStyle = convertToInlineCss({
60
- color: "var(--ds-text-accent-gray, #505258)",
61
- textDecoration: 'line-through',
62
- position: 'relative',
63
- opacity: 0.6
64
- });
65
- export var deletedContentStyleActive = convertToInlineCss({
66
- color: "var(--ds-text, #292A2E)",
67
- textDecoration: 'line-through',
68
- textDecorationColor: "var(--ds-text-accent-gray, #505258)",
69
- position: 'relative',
70
- opacity: 1
71
- });
72
- export var deletedContentStyleNew = convertToInlineCss({
73
- color: "var(--ds-text-accent-gray, #505258)",
74
- textDecoration: 'line-through',
75
- position: 'relative',
76
- opacity: 0.83
77
- });
64
+ export var getStandardDeletedContentStyle = function getStandardDeletedContentStyle() {
65
+ return convertToInlineCss(_objectSpread(_objectSpread({
66
+ color: "var(--ds-text-accent-gray, #505258)"
67
+ }, getStandardDeletedTextDecorationStyle()), {}, {
68
+ position: 'relative',
69
+ opacity: 0.6
70
+ }));
71
+ };
72
+ export var getStandardDeletedContentStyleActive = function getStandardDeletedContentStyleActive() {
73
+ return convertToInlineCss(_objectSpread(_objectSpread({
74
+ color: "var(--ds-text, #292A2E)"
75
+ }, getStandardDeletedTextDecorationStyle()), {}, {
76
+ textDecorationColor: "var(--ds-text-accent-gray, #505258)",
77
+ position: 'relative',
78
+ opacity: 1
79
+ }));
80
+ };
81
+ export var getStandardDeletedContentStyleNew = function getStandardDeletedContentStyleNew() {
82
+ return convertToInlineCss(_objectSpread(_objectSpread({
83
+ color: "var(--ds-text-accent-gray, #505258)"
84
+ }, getStandardDeletedTextDecorationStyle()), {}, {
85
+ position: 'relative',
86
+ opacity: 0.83
87
+ }));
88
+ };
78
89
 
79
90
  /**
80
91
  * Merge into existing styles when cleaning up
@@ -130,12 +141,14 @@ export var deletedBlockOutlineRoundedActive = convertToInlineCss({
130
141
  boxShadow: "0 0 0 4px ".concat("var(--ds-border-accent-red, #E2483D)"),
131
142
  borderRadius: "calc(".concat("var(--ds-radius-xsmall, 2px)", " + 1px)")
132
143
  });
133
- export var deletedRowStyle = convertToInlineCss({
134
- color: "var(--ds-text-accent-gray, #505258)",
135
- textDecoration: 'line-through',
136
- opacity: 0.6,
137
- display: 'table-row'
138
- });
144
+ export var getStandardDeletedRowStyle = function getStandardDeletedRowStyle() {
145
+ return convertToInlineCss(_objectSpread(_objectSpread({
146
+ color: "var(--ds-text-accent-gray, #505258)"
147
+ }, getStandardDeletedTextDecorationStyle()), {}, {
148
+ opacity: 0.6,
149
+ display: 'table-row'
150
+ }));
151
+ };
139
152
  export var editingStyleQuoteNode = convertToInlineCss({
140
153
  borderLeft: "2px solid ".concat("var(--ds-border-accent-purple, #AF59E1)")
141
154
  });
@@ -2,15 +2,15 @@
2
2
  * Pre-refactor code preserved for the OFF cohort of
3
3
  * `platform_editor_show_diff_color_scheme_refactor`.
4
4
  *
5
- * This is a verbatim copy of the `getBlockNodeStyle` and the cell-overlay style selection that
6
- * lived in `createBlockChangedDecoration.ts` before the `colorSchemeRegistry` + `factory.ts`
7
- * migration. Do not modify it — it exists so the OFF cohort keeps the exact pre-refactor style
8
- * strings. Delete this file at cleanup, together with `colorSchemes/standard.ts`,
9
- * `colorSchemes/traditional.ts` (EDITOR-8281).
5
+ * This keeps the `getBlockNodeStyle` and cell-overlay style selection that lived in
6
+ * `createBlockChangedDecoration.ts` before the `colorSchemeRegistry` + `factory.ts` migration.
7
+ * Standard deleted styles are resolved at runtime only so the ADF-safety gate can select the
8
+ * equivalent longhand; with that gate off, their CSS remains unchanged. Delete this file at
9
+ * cleanup, together with `colorSchemes/standard.ts`, `colorSchemes/traditional.ts` (EDITOR-8281).
10
10
  */
11
11
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
12
12
  import { isExtendedEnabled } from '../isExtendedEnabled';
13
- import { standardDecorationMarkerVariable, deletedDecorationMarkerVariable, editingStyleQuoteNode, editingStyleRuleNode, editingStyleCardBlockNode, editingStyleNode, deletedContentStyleNew, deletedStyleQuoteNode, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from './colorSchemes/standard';
13
+ import { standardDecorationMarkerVariable, deletedDecorationMarkerVariable, editingStyleQuoteNode, editingStyleRuleNode, editingStyleCardBlockNode, editingStyleNode, getStandardDeletedContentStyleNew, deletedStyleQuoteNode, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from './colorSchemes/standard';
14
14
  import { traditionalDecorationMarkerVariableActive, traditionalDecorationMarkerVariableNew, traditionalDeletedDecorationMarkerVariableActive, traditionalDeletedDecorationMarkerVariableNew, traditionalStyleQuoteNodeActive, traditionalStyleQuoteNodeNew, traditionalStyleRuleNodeActive, traditionalStyleRuleNodeNew, traditionalStyleCardBlockNodeActive, traditionalStyleCardBlockNodeNew, traditionalStyleNodeActive, traditionalStyleNodeNew, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, traditionalAddedCellOverlayStyle, traditionalAddedCellOverlayRoundedStyle, deletedTraditionalCellOverlayStyle, deletedTraditionalCellOverlayRoundedStyle } from './colorSchemes/traditional';
15
15
 
16
16
  /** Verbatim copy of the pre-refactor cell-overlay style selection. */
@@ -72,7 +72,7 @@ export var getBlockNodeStyleLegacy = function getBlockNodeStyleLegacy(_ref2) {
72
72
  if (nodeName === 'listItem') {
73
73
  return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : deletedDecorationMarkerVariable;
74
74
  }
75
- return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : deletedContentStyleNew;
75
+ return isTraditional && isActive ? traditionalDeletedDecorationMarkerVariableActive : isTraditional ? traditionalDeletedDecorationMarkerVariableNew : getStandardDeletedContentStyleNew();
76
76
  }
77
77
  }
78
78
  return isTraditional && isActive ? traditionalDecorationMarkerVariableActive : isTraditional ? traditionalDecorationMarkerVariableNew : standardDecorationMarkerVariable;
@@ -92,7 +92,7 @@ export var getBlockNodeStyleLegacy = function getBlockNodeStyleLegacy(_ref2) {
92
92
  if (isInserted) {
93
93
  return isTraditional ? isActive ? traditionalStyleRuleNodeActive : traditionalStyleRuleNodeNew : editingStyleRuleNode;
94
94
  } else {
95
- return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedContentStyleNew;
95
+ return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
96
96
  }
97
97
  }
98
98
  return isTraditional ? isActive ? traditionalStyleRuleNodeActive : traditionalStyleRuleNodeNew : editingStyleRuleNode;
@@ -102,7 +102,7 @@ export var getBlockNodeStyleLegacy = function getBlockNodeStyleLegacy(_ref2) {
102
102
  if (isInserted) {
103
103
  return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : traditionalStyleCardBlockNodeNew : editingStyleCardBlockNode;
104
104
  } else {
105
- return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedContentStyleNew;
105
+ return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
106
106
  }
107
107
  }
108
108
  return isTraditional ? isActive ? traditionalStyleCardBlockNodeActive : traditionalStyleCardBlockNodeNew : editingStyleCardBlockNode;
@@ -111,7 +111,7 @@ export var getBlockNodeStyleLegacy = function getBlockNodeStyleLegacy(_ref2) {
111
111
  if (isInserted) {
112
112
  return isTraditional ? isActive ? traditionalStyleNodeActive : traditionalStyleNodeNew : editingStyleNode;
113
113
  } else {
114
- return isTraditional ? getDeletedTraditionalInlineStyle(false) : deletedContentStyleNew;
114
+ return isTraditional ? getDeletedTraditionalInlineStyle(false) : getStandardDeletedContentStyleNew();
115
115
  }
116
116
  }
117
117
  return isTraditional ? isActive ? traditionalStyleNodeActive : traditionalStyleNodeNew : editingStyleNode;
@@ -2,20 +2,22 @@
2
2
  * Pre-refactor code preserved for the OFF cohort of
3
3
  * `platform_editor_show_diff_color_scheme_refactor`.
4
4
  *
5
- * These resolvers reproduce the per-scheme string-constant style decisions that
6
- * `createChangedRowDOM` made before the `colorSchemeRegistry` + `factory.ts` migration, verbatim.
5
+ * These resolvers reproduce the per-scheme style decisions that `createChangedRowDOM` made before
6
+ * the `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at
7
+ * runtime only so the ADF-safety gate can select the equivalent longhand; with that gate off,
8
+ * their CSS remains unchanged.
7
9
  *
8
10
  * Do not modify. Delete this file at experiment cleanup (EDITOR-8281).
9
11
  */
10
12
 
11
- import { addedCellOverlayRoundedStyle, addedCellOverlayStyle, deletedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedRowStyle } from './colorSchemes/standard';
13
+ import { addedCellOverlayRoundedStyle, addedCellOverlayStyle, deletedCellOverlayRoundedStyle, deletedCellOverlayStyle, getStandardDeletedRowStyle } from './colorSchemes/standard';
12
14
  import { deletedTraditionalCellOverlayRoundedStyle, deletedTraditionalCellOverlayStyle, deletedTraditionalRowStyle, traditionalAddedCellOverlayRoundedStyle, traditionalAddedCellOverlayStyle } from './colorSchemes/traditional';
13
15
 
14
16
  /**
15
17
  * Pre-refactor deleted-row style for the `<tr>` element.
16
18
  */
17
19
  export var resolveDeletedRowStyleLegacy = function resolveDeletedRowStyleLegacy(colorScheme) {
18
- return colorScheme === 'traditional' ? deletedTraditionalRowStyle : deletedRowStyle;
20
+ return colorScheme === 'traditional' ? deletedTraditionalRowStyle : getStandardDeletedRowStyle();
19
21
  };
20
22
 
21
23
  /**
@@ -2,13 +2,14 @@
2
2
  * Pre-refactor `createInlineChangedDecoration` styling code, preserved verbatim for the OFF cohort
3
3
  * of `platform_editor_show_diff_color_scheme_refactor`.
4
4
  *
5
- * Do not modify — this module exists purely so the OFF cohort keeps running the exact code that
6
- * shipped before the `colorSchemeRegistry` + `factory.ts` migration. Delete the whole file at
7
- * experiment cleanup (EDITOR-8281).
5
+ * This module exists so the OFF cohort keeps running the code that shipped before the
6
+ * `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at runtime
7
+ * only so the ADF-safety gate can select the equivalent longhand; with that gate off, their CSS
8
+ * remains unchanged. Delete the whole file at experiment cleanup (EDITOR-8281).
8
9
  */
9
10
 
10
11
  import { isExtendedEnabled } from '../isExtendedEnabled';
11
- import { deletedContentStyle, deletedContentStyleActive, deletedInlineContentStyleExtended, editingStyle, editingStyleActive, editingStyleActiveExtended, editingStyleActiveExtendedNoUnderline, editingStyleExtended, editingStyleExtendedNoUnderline } from './colorSchemes/standard';
12
+ import { deletedInlineContentStyleExtended, editingStyle, editingStyleActive, editingStyleActiveExtended, editingStyleActiveExtendedNoUnderline, editingStyleExtended, editingStyleExtendedNoUnderline, getStandardDeletedContentStyle, getStandardDeletedContentStyleActive } from './colorSchemes/standard';
12
13
  import { getDeletedTraditionalInlineStyle, traditionalInsertStyle, traditionalInsertStyleActive } from './colorSchemes/traditional';
13
14
  /**
14
15
  * Pre-refactor inline `style` computation for `createInlineChangedDecoration`.
@@ -31,7 +32,7 @@ export var resolveInlineChangedStyleLegacy = function resolveInlineChangedStyleL
31
32
  if (colorScheme === 'traditional') {
32
33
  style = getDeletedTraditionalInlineStyle(false);
33
34
  } else {
34
- style = (isActive ? deletedContentStyleActive : deletedContentStyle) + deletedInlineContentStyleExtended;
35
+ style = (isActive ? getStandardDeletedContentStyleActive() : getStandardDeletedContentStyle()) + deletedInlineContentStyleExtended;
35
36
  }
36
37
  }
37
38
  } else {
@@ -3,7 +3,7 @@ import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
3
3
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
4
4
  import { buildDeletedInlineStyleStandard, getDeletedInlineRevealColors, getInsertedInlineRevealColors } from './colorSchemes/factory';
5
5
  import { colorSchemeRegistry } from './colorSchemes/schemes';
6
- import { deletedContentStyle, deletedContentStyleActive } from './colorSchemes/standard';
6
+ import { getStandardDeletedContentStyle, getStandardDeletedContentStyleActive } from './colorSchemes/standard';
7
7
  /**
8
8
  * Painting strategy for reveal highlights. Highlights are `linear-gradient`s with animated
9
9
  * `background-size` for the wipe effect. Colours live on elements as custom properties so the
@@ -87,7 +87,7 @@ var getColorScheme = function getColorScheme(colorScheme) {
87
87
 
88
88
  /** Deleted text appearance (grey and strikethrough) without the highlight. */
89
89
  var deletedTextOnlyStyle = function deletedTextOnlyStyle(colors, isActive) {
90
- return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? buildDeletedInlineStyleStandard(colors, isActive ? 'active' : 'default') : isActive ? deletedContentStyleActive : deletedContentStyle;
90
+ return isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? buildDeletedInlineStyleStandard(colors, isActive ? 'active' : 'default') : isActive ? getStandardDeletedContentStyleActive() : getStandardDeletedContentStyle();
91
91
  };
92
92
 
93
93
  /**
@@ -2,17 +2,16 @@
2
2
  * Pre-refactor code preserved for the OFF cohort of
3
3
  * `platform_editor_show_diff_color_scheme_refactor`.
4
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).
5
+ * These resolvers hold the per-scheme style decisions that `wrapBlockNodeView.ts` made before the
6
+ * `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at runtime
7
+ * only so the ADF-safety gate can select the equivalent longhand; with that gate off, their CSS
8
+ * remains unchanged. Delete this file at experiment cleanup, together with
9
+ * `colorSchemes/standard.ts`, `colorSchemes/traditional.ts` (EDITOR-8281).
11
10
  */
12
11
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
13
12
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  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';
14
+ import { deletedBlockOutline, deletedBlockOutlineActive, deletedBlockOutlineRounded, deletedBlockOutlineRoundedActive, deletedContentStyleUnbounded, deletedInlineContentStyleExtended, deletedStyleQuoteNodeWithLozenge, deletedStyleQuoteNodeWithLozengeActive, editingContentStyleInBlockExtended, editingContentStyleInBlockExtendedNoUnderline, editingStyleExtended, editingStyleExtendedNoUnderline, editingStyleActiveExtended, editingStyleActiveExtendedNoUnderline, editingStyleNode, getStandardDeletedContentStyle, getStandardDeletedContentStyleActive, getStandardDeletedContentStyleNew, addedCellOverlayStyle, addedCellOverlayRoundedStyle, deletedCellOverlayStyle, deletedCellOverlayRoundedStyle } from '../colorSchemes/standard';
16
15
  import { deletedTraditionalBlockOutlineActive, deletedTraditionalBlockOutlineNew, deletedTraditionalBlockOutlineRoundedActive, deletedTraditionalBlockOutlineRoundedNew, deletedTraditionalContentStyleUnbounded, deletedTraditionalContentStyleUnboundedActive, getDeletedTraditionalInlineStyle, deletedTraditionalStyleQuoteNode, deletedTraditionalStyleQuoteNodeActive, traditionalInsertStyle, traditionalInsertStyleActive, traditionalStyleNodeActive, traditionalStyleNodeNew, traditionalAddedCellOverlayRoundedStyle, traditionalAddedCellOverlayStyleNew, deletedTraditionalCellOverlayStyle, deletedTraditionalCellOverlayRoundedStyle } from '../colorSchemes/traditional';
17
16
  var lozengeStyle = convertToInlineCss({
18
17
  display: 'inline-flex',
@@ -92,9 +91,9 @@ export var getChangedContentStyleLegacy = function getChangedContentStyleLegacy(
92
91
  return getDeletedTraditionalInlineStyle(isActive);
93
92
  }
94
93
  if (isActive) {
95
- return deletedContentStyleActive;
94
+ return getStandardDeletedContentStyleActive();
96
95
  }
97
- return expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? deletedContentStyleNew : deletedContentStyle;
96
+ return expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? getStandardDeletedContentStyleNew() : getStandardDeletedContentStyle();
98
97
  };
99
98
 
100
99
  /** Pre-refactor node-specific style for a changed block node. */
@@ -170,9 +169,9 @@ export var getDeletedContentStyleLegacy = function getDeletedContentStyleLegacy(
170
169
  return getDeletedTraditionalInlineStyle(isActive);
171
170
  }
172
171
  if (isExtendedEnabled(diffType) && !omitHighlight) {
173
- return (isActive ? deletedContentStyleActive : deletedContentStyleNew) + deletedInlineContentStyleExtended;
172
+ return (isActive ? getStandardDeletedContentStyleActive() : getStandardDeletedContentStyleNew()) + deletedInlineContentStyleExtended;
174
173
  }
175
- return isActive ? deletedContentStyleActive : deletedContentStyleNew;
174
+ return isActive ? getStandardDeletedContentStyleActive() : getStandardDeletedContentStyleNew();
176
175
  };
177
176
 
178
177
  /**
@@ -0,0 +1,12 @@
1
+ type StandardDeletedTextDecorationStyle = {
2
+ textDecoration: 'line-through';
3
+ } | {
4
+ textDecorationLine: 'line-through';
5
+ };
6
+ /**
7
+ * The ADF strike parser recognises the `text-decoration` shorthand when a decorated NodeView is
8
+ * reconciled. Use the visually equivalent longhand for AI suggestion diffs so presentation-only
9
+ * styling cannot be retained as document content.
10
+ */
11
+ export declare const getStandardDeletedTextDecorationStyle: () => StandardDeletedTextDecorationStyle;
12
+ export {};
@@ -13,9 +13,9 @@ export declare const editingStyleActiveExtended: string;
13
13
  export declare const editingStyleExtendedNoUnderline: string;
14
14
  export declare const editingStyleActiveExtendedNoUnderline: string;
15
15
  export declare const editingContentStyleInBlockExtendedNoUnderline: string;
16
- export declare const deletedContentStyle: string;
17
- export declare const deletedContentStyleActive: string;
18
- export declare const deletedContentStyleNew: string;
16
+ export declare const getStandardDeletedContentStyle: () => string;
17
+ export declare const getStandardDeletedContentStyleActive: () => string;
18
+ export declare const getStandardDeletedContentStyleNew: () => string;
19
19
  /**
20
20
  * Merge into existing styles when cleaning up
21
21
  */
@@ -29,7 +29,7 @@ export declare const deletedBlockOutline: string;
29
29
  export declare const deletedBlockOutlineActive: string;
30
30
  export declare const deletedBlockOutlineRounded: string;
31
31
  export declare const deletedBlockOutlineRoundedActive: string;
32
- export declare const deletedRowStyle: string;
32
+ export declare const getStandardDeletedRowStyle: () => string;
33
33
  export declare const editingStyleQuoteNode: string;
34
34
  export declare const editingStyleRuleNode: string;
35
35
  export declare const editingStyleNode: string;
@@ -2,8 +2,10 @@
2
2
  * Pre-refactor code preserved for the OFF cohort of
3
3
  * `platform_editor_show_diff_color_scheme_refactor`.
4
4
  *
5
- * These resolvers reproduce the per-scheme string-constant style decisions that
6
- * `createChangedRowDOM` made before the `colorSchemeRegistry` + `factory.ts` migration, verbatim.
5
+ * These resolvers reproduce the per-scheme style decisions that `createChangedRowDOM` made before
6
+ * the `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at
7
+ * runtime only so the ADF-safety gate can select the equivalent longhand; with that gate off,
8
+ * their CSS remains unchanged.
7
9
  *
8
10
  * Do not modify. Delete this file at experiment cleanup (EDITOR-8281).
9
11
  */
@@ -2,9 +2,10 @@
2
2
  * Pre-refactor `createInlineChangedDecoration` styling code, preserved verbatim for the OFF cohort
3
3
  * of `platform_editor_show_diff_color_scheme_refactor`.
4
4
  *
5
- * Do not modify — this module exists purely so the OFF cohort keeps running the exact code that
6
- * shipped before the `colorSchemeRegistry` + `factory.ts` migration. Delete the whole file at
7
- * experiment cleanup (EDITOR-8281).
5
+ * This module exists so the OFF cohort keeps running the code that shipped before the
6
+ * `colorSchemeRegistry` + `factory.ts` migration. Standard deleted styles are resolved at runtime
7
+ * only so the ADF-safety gate can select the equivalent longhand; with that gate off, their CSS
8
+ * remains unchanged. Delete the whole file at experiment cleanup (EDITOR-8281).
8
9
  */
9
10
  import type { ColorScheme, DiffType } from '../../showDiffPluginType';
10
11
  import type { InlineAttrChangeNodeName } from './utils/getAttrChangeRanges';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "15.1.10",
3
+ "version": "15.1.11",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -81,6 +81,10 @@
81
81
  "platform_editor_ai_smart_diff": {
82
82
  "type": "boolean"
83
83
  },
84
+ "platform_editor_ai_suggested_edits_smart_diff": {
85
+ "type": "boolean",
86
+ "referenceOnly": true
87
+ },
84
88
  "confluence_ncs_step_diffing_version_history": {
85
89
  "type": "boolean"
86
90
  },