@atlaskit/editor-plugin-show-diff 14.3.1 → 14.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/editor-plugin-show-diff
2
2
 
3
+ ## 14.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a6c26b16402ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a6c26b16402ca) -
8
+ Migrate nine dogfooding editor experiments from `@atlaskit/tmp-editor-statsig` to the Platform
9
+ experiment API and move their tests to Platform experiment mocks.
10
+ - Updated dependencies
11
+
3
12
  ## 14.3.1
4
13
 
5
14
  ### Patch Changes
@@ -10,7 +10,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
10
10
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
11
11
  var _view = require("@atlaskit/editor-prosemirror/view");
12
12
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
13
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
13
  var _isExtendedEnabled = require("../isExtendedEnabled");
15
14
  var _factory = require("./colorSchemes/factory");
16
15
  var _schemes = require("./colorSchemes/schemes");
@@ -176,7 +175,7 @@ var createBlockChangedDecoration = exports.createBlockChangedDecoration = functi
176
175
  if ((0, _isExtendedEnabled.isExtendedEnabled)(diffType) && CELL_NODES.includes(change.name)) {
177
176
  var cellOverlay = document.createElement('div');
178
177
  var colors = _schemes.colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : DEFAULT_COLOR_SCHEME];
179
- var isRoundedTable = (0, _expValEquals.expValEquals)('platform_editor_table_diff_rounded_corners', 'isEnabled', true);
178
+ var isRoundedTable = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_diff_rounded_corners');
180
179
 
181
180
  // On an inverted diff, an empty cell being filled is an addition, so give it the
182
181
  // added (purple) overlay instead of the deleted (grey) one (EDITOR-8442).
@@ -65,7 +65,7 @@ var extractChangedRows = function extractChangedRows(_ref) {
65
65
  // Find which rows were changed by analyzing the change range
66
66
  var changeStartInTable = change.fromA - tableOld.pos - 1;
67
67
  var changeEndInTable = change.toA - tableOld.pos - 1;
68
- var edgeAttrsByOffset = (0, _isExtendedEnabled.isExtendedEnabled)(diffType) && (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && (0, _expValEquals.expValEquals)('platform_editor_table_diff_rounded_corners', 'isEnabled', true) ? (0, _tableCellEdgeAttrs.getTableTopAndBottomCellEdgeAttrs)(oldTableMap) : undefined;
68
+ var edgeAttrsByOffset = (0, _isExtendedEnabled.isExtendedEnabled)(diffType) && (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_diff_rounded_corners') ? (0, _tableCellEdgeAttrs.getTableTopAndBottomCellEdgeAttrs)(oldTableMap) : undefined;
69
69
  var currentOffset = 0;
70
70
  var rowIndex = 0;
71
71
  tableOld.node.content.forEach(function (rowNode) {
@@ -155,7 +155,7 @@ var createChangedRowDOM = function createChangedRowDOM(rowNode, cellEdgeAttrs, n
155
155
  (0, _tableCellEdgeAttrs.applyCellEdgeAttrs)(nodeView, cellEdgeAttrs === null || cellEdgeAttrs === void 0 ? void 0 : cellEdgeAttrs[cellIndex]);
156
156
  if ((0, _isExtendedEnabled.isExtendedEnabled)(diffType)) {
157
157
  var overlay = document.createElement('span');
158
- var isRoundedTable = (0, _expValEquals.expValEquals)('platform_editor_table_diff_rounded_corners', 'isEnabled', true);
158
+ var isRoundedTable = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_diff_rounded_corners');
159
159
  var overlayStyle = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_show_diff_color_scheme_refactor') ? isInserted ? isRoundedTable ? (0, _factory.buildAddedCellOverlayRoundedStyle)(colors) : (0, _factory.buildAddedCellOverlayStyle)(colors) : isRoundedTable ? (0, _factory.buildDeletedCellOverlayRoundedStyle)(colors) : (0, _factory.buildDeletedCellOverlayStyle)(colors) : (0, _createChangedRowDecorationWidgetsStyles.resolveCellOverlayStyleLegacy)({
160
160
  colorScheme: (0, _schemes.getLegacyColorScheme)(colorScheme),
161
161
  isInserted: isInserted,
@@ -130,7 +130,7 @@ var applyCellOverlayStyles = function applyCellOverlayStyles(_ref4) {
130
130
  var element = _ref4.element,
131
131
  colorScheme = _ref4.colorScheme,
132
132
  isInserted = _ref4.isInserted;
133
- var isRoundedTable = (0, _expValEquals.expValEquals)('platform_editor_table_diff_rounded_corners', 'isEnabled', true);
133
+ var isRoundedTable = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_diff_rounded_corners');
134
134
  var overlayStyle = (0, _wrapBlockNodeViewStyles.resolveCellOverlayStyle)({
135
135
  colorScheme: colorScheme,
136
136
  isInserted: isInserted,
@@ -550,7 +550,7 @@ var wrapBlockNodeView = exports.wrapBlockNodeView = function wrapBlockNodeView(_
550
550
  return;
551
551
  }
552
552
  if (targetNode.type.name === 'table') {
553
- if ((0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && (0, _expValEquals.expValEquals)('platform_editor_table_diff_rounded_corners', 'isEnabled', true)) {
553
+ if ((0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_diff_rounded_corners')) {
554
554
  (0, _tableCellEdgeAttrs.applyTableCellEdgeAttrs)({
555
555
  element: nodeView,
556
556
  tableNode: targetNode
@@ -1,7 +1,6 @@
1
1
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
2
2
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
3
3
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
4
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
4
  import { isExtendedEnabled } from '../isExtendedEnabled';
6
5
  import { buildAddedCellOverlayRoundedStyle, buildAddedCellOverlayStyle, buildDeletedBlockNodeStyle, buildDeletedCellOverlayRoundedStyle, buildDeletedCellOverlayStyle, buildInsertedBlockNodeStyle } from './colorSchemes/factory';
7
6
  import { colorSchemeRegistry, getLegacyColorScheme } from './colorSchemes/schemes';
@@ -160,7 +159,7 @@ export const createBlockChangedDecoration = ({
160
159
  if (isExtendedEnabled(diffType) && CELL_NODES.includes(change.name)) {
161
160
  const cellOverlay = document.createElement('div');
162
161
  const colors = colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : DEFAULT_COLOR_SCHEME];
163
- const isRoundedTable = expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true);
162
+ const isRoundedTable = isExperimentEnabled('platform_editor_table_diff_rounded_corners');
164
163
 
165
164
  // On an inverted diff, an empty cell being filled is an addition, so give it the
166
165
  // added (purple) overlay instead of the deleted (grey) one (EDITOR-8442).
@@ -48,7 +48,7 @@ const extractChangedRows = ({
48
48
  // Find which rows were changed by analyzing the change range
49
49
  const changeStartInTable = change.fromA - tableOld.pos - 1;
50
50
  const changeEndInTable = change.toA - tableOld.pos - 1;
51
- const edgeAttrsByOffset = isExtendedEnabled(diffType) && expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true) ? getTableTopAndBottomCellEdgeAttrs(oldTableMap) : undefined;
51
+ const edgeAttrsByOffset = isExtendedEnabled(diffType) && expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_diff_rounded_corners') ? getTableTopAndBottomCellEdgeAttrs(oldTableMap) : undefined;
52
52
  let currentOffset = 0;
53
53
  let rowIndex = 0;
54
54
  tableOld.node.content.forEach(rowNode => {
@@ -134,7 +134,7 @@ const createChangedRowDOM = (rowNode, cellEdgeAttrs, nodeViewSerializer, colorSc
134
134
  applyCellEdgeAttrs(nodeView, cellEdgeAttrs === null || cellEdgeAttrs === void 0 ? void 0 : cellEdgeAttrs[cellIndex]);
135
135
  if (isExtendedEnabled(diffType)) {
136
136
  const overlay = document.createElement('span');
137
- const isRoundedTable = expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true);
137
+ const isRoundedTable = isExperimentEnabled('platform_editor_table_diff_rounded_corners');
138
138
  const overlayStyle = isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? isInserted ? isRoundedTable ? buildAddedCellOverlayRoundedStyle(colors) : buildAddedCellOverlayStyle(colors) : isRoundedTable ? buildDeletedCellOverlayRoundedStyle(colors) : buildDeletedCellOverlayStyle(colors) : resolveCellOverlayStyleLegacy({
139
139
  colorScheme: getLegacyColorScheme(colorScheme),
140
140
  isInserted,
@@ -121,7 +121,7 @@ const applyCellOverlayStyles = ({
121
121
  colorScheme,
122
122
  isInserted
123
123
  }) => {
124
- const isRoundedTable = expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true);
124
+ const isRoundedTable = isExperimentEnabled('platform_editor_table_diff_rounded_corners');
125
125
  const overlayStyle = resolveCellOverlayStyle({
126
126
  colorScheme,
127
127
  isInserted,
@@ -536,7 +536,7 @@ export const wrapBlockNodeView = ({
536
536
  return;
537
537
  }
538
538
  if (targetNode.type.name === 'table') {
539
- if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true)) {
539
+ if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_diff_rounded_corners')) {
540
540
  applyTableCellEdgeAttrs({
541
541
  element: nodeView,
542
542
  tableNode: targetNode
@@ -5,7 +5,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
6
6
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
7
7
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
8
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
8
  import { isExtendedEnabled } from '../isExtendedEnabled';
10
9
  import { buildAddedCellOverlayRoundedStyle, buildAddedCellOverlayStyle, buildDeletedBlockNodeStyle, buildDeletedCellOverlayRoundedStyle, buildDeletedCellOverlayStyle, buildInsertedBlockNodeStyle } from './colorSchemes/factory';
11
10
  import { colorSchemeRegistry, getLegacyColorScheme } from './colorSchemes/schemes';
@@ -169,7 +168,7 @@ export var createBlockChangedDecoration = function createBlockChangedDecoration(
169
168
  if (isExtendedEnabled(diffType) && CELL_NODES.includes(change.name)) {
170
169
  var cellOverlay = document.createElement('div');
171
170
  var colors = colorSchemeRegistry[colorScheme !== null && colorScheme !== void 0 ? colorScheme : DEFAULT_COLOR_SCHEME];
172
- var isRoundedTable = expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true);
171
+ var isRoundedTable = isExperimentEnabled('platform_editor_table_diff_rounded_corners');
173
172
 
174
173
  // On an inverted diff, an empty cell being filled is an addition, so give it the
175
174
  // added (purple) overlay instead of the deleted (grey) one (EDITOR-8442).
@@ -58,7 +58,7 @@ var extractChangedRows = function extractChangedRows(_ref) {
58
58
  // Find which rows were changed by analyzing the change range
59
59
  var changeStartInTable = change.fromA - tableOld.pos - 1;
60
60
  var changeEndInTable = change.toA - tableOld.pos - 1;
61
- var edgeAttrsByOffset = isExtendedEnabled(diffType) && expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true) ? getTableTopAndBottomCellEdgeAttrs(oldTableMap) : undefined;
61
+ var edgeAttrsByOffset = isExtendedEnabled(diffType) && expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_diff_rounded_corners') ? getTableTopAndBottomCellEdgeAttrs(oldTableMap) : undefined;
62
62
  var currentOffset = 0;
63
63
  var rowIndex = 0;
64
64
  tableOld.node.content.forEach(function (rowNode) {
@@ -148,7 +148,7 @@ var createChangedRowDOM = function createChangedRowDOM(rowNode, cellEdgeAttrs, n
148
148
  applyCellEdgeAttrs(nodeView, cellEdgeAttrs === null || cellEdgeAttrs === void 0 ? void 0 : cellEdgeAttrs[cellIndex]);
149
149
  if (isExtendedEnabled(diffType)) {
150
150
  var overlay = document.createElement('span');
151
- var isRoundedTable = expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true);
151
+ var isRoundedTable = isExperimentEnabled('platform_editor_table_diff_rounded_corners');
152
152
  var overlayStyle = isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor') ? isInserted ? isRoundedTable ? buildAddedCellOverlayRoundedStyle(colors) : buildAddedCellOverlayStyle(colors) : isRoundedTable ? buildDeletedCellOverlayRoundedStyle(colors) : buildDeletedCellOverlayStyle(colors) : resolveCellOverlayStyleLegacy({
153
153
  colorScheme: getLegacyColorScheme(colorScheme),
154
154
  isInserted: isInserted,
@@ -123,7 +123,7 @@ var applyCellOverlayStyles = function applyCellOverlayStyles(_ref4) {
123
123
  var element = _ref4.element,
124
124
  colorScheme = _ref4.colorScheme,
125
125
  isInserted = _ref4.isInserted;
126
- var isRoundedTable = expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true);
126
+ var isRoundedTable = isExperimentEnabled('platform_editor_table_diff_rounded_corners');
127
127
  var overlayStyle = resolveCellOverlayStyle({
128
128
  colorScheme: colorScheme,
129
129
  isInserted: isInserted,
@@ -543,7 +543,7 @@ export var wrapBlockNodeView = function wrapBlockNodeView(_ref12) {
543
543
  return;
544
544
  }
545
545
  if (targetNode.type.name === 'table') {
546
- if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && expValEquals('platform_editor_table_diff_rounded_corners', 'isEnabled', true)) {
546
+ if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_diff_rounded_corners')) {
547
547
  applyTableCellEdgeAttrs({
548
548
  element: nodeView,
549
549
  tableNode: targetNode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "14.3.1",
3
+ "version": "14.3.2",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,7 +29,7 @@
29
29
  "@atlaskit/editor-tables": "^3.1.0",
30
30
  "@atlaskit/platform-feature-experiments": "^0.3.0",
31
31
  "@atlaskit/platform-feature-flags": "^2.2.0",
32
- "@atlaskit/tmp-editor-statsig": "^173.0.0",
32
+ "@atlaskit/tmp-editor-statsig": "^174.0.0",
33
33
  "@atlaskit/tokens": "^16.11.0",
34
34
  "@babel/runtime": "^7.0.0",
35
35
  "@compiled/react": "^1.0.2",
@@ -60,7 +60,7 @@
60
60
  "react-intl": "^7.0.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@atlaskit/editor-common": "^120.11.0",
63
+ "@atlaskit/editor-common": "^120.12.0",
64
64
  "react": "^18.2.0 || ^19.2.0"
65
65
  },
66
66
  "platform-feature-flags": {