@atlaskit/editor-plugin-show-diff 14.2.2 → 14.2.3

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,19 @@
1
1
  # @atlaskit/editor-plugin-show-diff
2
2
 
3
+ ## 14.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e3b2afdd0a76a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e3b2afdd0a76a) -
8
+ [ux] Preserve the configured colour scheme for attributed diffs with zero or one distinct
9
+ contributor behind `confluence_ncs_step_diffing_version_history` and
10
+ `platform_editor_show_diff_color_scheme_refactor`.
11
+ - [`ee583927e98cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ee583927e98cc) -
12
+ [ux] Gate Post Stream Review smart diff behavior behind `platform_editor_ai_smart_diff` and its
13
+ diff indicators behind `platform_editor_diff_plugin_show_indicators`. Require the smart diff gate
14
+ when selecting the show-diff plugin's default diff type.
15
+ - Updated dependencies
16
+
3
17
  ## 14.2.2
4
18
 
5
19
  ### Patch Changes
@@ -27,9 +27,13 @@ var areAttributionColorGatesEnabled = exports.areAttributionColorGatesEnabled =
27
27
  return (0, _fg.fg)('confluence_ncs_step_diffing_version_history') && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_show_diff_color_scheme_refactor');
28
28
  };
29
29
  var isAttributionColoringEnabled = exports.isAttributionColoringEnabled = function isAttributionColoringEnabled(stepAttributions) {
30
- return areAttributionColorGatesEnabled() && (stepAttributions === null || stepAttributions === void 0 ? void 0 : stepAttributions.some(function (attribution) {
31
- return getAttributionKey(attribution) !== undefined;
32
- })) === true;
30
+ if (!areAttributionColorGatesEnabled() || !(stepAttributions !== null && stepAttributions !== void 0 && stepAttributions.length)) {
31
+ return false;
32
+ }
33
+ var attributionKeys = new Set(stepAttributions.map(getAttributionKey).filter(function (key) {
34
+ return key !== undefined;
35
+ }));
36
+ return attributionKeys.size > 1;
33
37
  };
34
38
  var createAttributionColorMap = exports.createAttributionColorMap = function createAttributionColorMap(stepAttributions) {
35
39
  var keys = Array.from(new Set(stepAttributions.map(getAttributionKey).filter(function (key) {
@@ -19,5 +19,5 @@ var isExtendedEnabled = exports.isExtendedEnabled = function isExtendedEnabled(d
19
19
  return (0, _expValEquals.expValEquals)('platform_editor_diff_plugin_extended', 'isEnabled', true) || diffType === 'smart' && (0, _fg.fg)('platform_editor_ai_smart_diff');
20
20
  };
21
21
  var getDefaultDiffType = exports.getDefaultDiffType = function getDefaultDiffType() {
22
- return (0, _fg.fg)('confluence_ncs_step_diffing_version_history') ? 'smart' : 'inline';
22
+ return (0, _fg.fg)('platform_editor_ai_smart_diff') ? 'smart' : 'inline';
23
23
  };
@@ -15,7 +15,13 @@ export const getAttributionKey = attribution => {
15
15
  return `user:${userId !== null && userId !== void 0 ? userId : ''}|agent:${agentIdentity}`;
16
16
  };
17
17
  export const areAttributionColorGatesEnabled = () => fg('confluence_ncs_step_diffing_version_history') && isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor');
18
- export const isAttributionColoringEnabled = stepAttributions => areAttributionColorGatesEnabled() && (stepAttributions === null || stepAttributions === void 0 ? void 0 : stepAttributions.some(attribution => getAttributionKey(attribution) !== undefined)) === true;
18
+ export const isAttributionColoringEnabled = stepAttributions => {
19
+ if (!areAttributionColorGatesEnabled() || !(stepAttributions !== null && stepAttributions !== void 0 && stepAttributions.length)) {
20
+ return false;
21
+ }
22
+ const attributionKeys = new Set(stepAttributions.map(getAttributionKey).filter(key => key !== undefined));
23
+ return attributionKeys.size > 1;
24
+ };
19
25
  export const createAttributionColorMap = stepAttributions => {
20
26
  const keys = Array.from(new Set(stepAttributions.map(getAttributionKey).filter(key => key !== undefined))).sort();
21
27
  return new Map(keys.map((key, index) => [key, ATTRIBUTION_COLOR_PALETTE[index % ATTRIBUTION_COLOR_PALETTE.length]]));
@@ -10,4 +10,4 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
10
  * when `smart` is active even if `platform_editor_diff_plugin_extended` is off.
11
11
  */
12
12
  export const isExtendedEnabled = diffType => expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true) || diffType === 'smart' && fg('platform_editor_ai_smart_diff');
13
- export const getDefaultDiffType = () => fg('confluence_ncs_step_diffing_version_history') ? 'smart' : 'inline';
13
+ export const getDefaultDiffType = () => fg('platform_editor_ai_smart_diff') ? 'smart' : 'inline';
@@ -20,9 +20,13 @@ export var areAttributionColorGatesEnabled = function areAttributionColorGatesEn
20
20
  return fg('confluence_ncs_step_diffing_version_history') && isExperimentEnabled('platform_editor_show_diff_color_scheme_refactor');
21
21
  };
22
22
  export var isAttributionColoringEnabled = function isAttributionColoringEnabled(stepAttributions) {
23
- return areAttributionColorGatesEnabled() && (stepAttributions === null || stepAttributions === void 0 ? void 0 : stepAttributions.some(function (attribution) {
24
- return getAttributionKey(attribution) !== undefined;
25
- })) === true;
23
+ if (!areAttributionColorGatesEnabled() || !(stepAttributions !== null && stepAttributions !== void 0 && stepAttributions.length)) {
24
+ return false;
25
+ }
26
+ var attributionKeys = new Set(stepAttributions.map(getAttributionKey).filter(function (key) {
27
+ return key !== undefined;
28
+ }));
29
+ return attributionKeys.size > 1;
26
30
  };
27
31
  export var createAttributionColorMap = function createAttributionColorMap(stepAttributions) {
28
32
  var keys = Array.from(new Set(stepAttributions.map(getAttributionKey).filter(function (key) {
@@ -13,5 +13,5 @@ export var isExtendedEnabled = function isExtendedEnabled(diffType) {
13
13
  return expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true) || diffType === 'smart' && fg('platform_editor_ai_smart_diff');
14
14
  };
15
15
  export var getDefaultDiffType = function getDefaultDiffType() {
16
- return fg('confluence_ncs_step_diffing_version_history') ? 'smart' : 'inline';
16
+ return fg('platform_editor_ai_smart_diff') ? 'smart' : 'inline';
17
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "14.2.2",
3
+ "version": "14.2.3",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,7 +28,7 @@
28
28
  "@atlaskit/editor-tables": "^3.0.0",
29
29
  "@atlaskit/platform-feature-experiments": "^0.3.0",
30
30
  "@atlaskit/platform-feature-flags": "^2.1.0",
31
- "@atlaskit/tmp-editor-statsig": "^164.0.0",
31
+ "@atlaskit/tmp-editor-statsig": "^165.0.0",
32
32
  "@atlaskit/tokens": "^16.8.0",
33
33
  "@babel/runtime": "^7.0.0",
34
34
  "@compiled/react": "^1.0.2",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/css": "^1.1.0",
43
43
  "@atlaskit/dropdown-menu": "^18.2.0",
44
44
  "@atlaskit/editor-core": "^226.1.0",
45
- "@atlaskit/editor-json-transformer": "^9.6.0",
45
+ "@atlaskit/editor-json-transformer": "^9.7.0",
46
46
  "@atlaskit/editor-plugins": "^16.1.0",
47
47
  "@atlaskit/form": "^17.1.0",
48
48
  "@atlaskit/primitives": "^22.4.0",
@@ -59,7 +59,7 @@
59
59
  "react-intl": "^7.0.0"
60
60
  },
61
61
  "peerDependencies": {
62
- "@atlaskit/editor-common": "^120.4.0",
62
+ "@atlaskit/editor-common": "^120.6.0",
63
63
  "react": "^18.2.0 || ^19.2.0"
64
64
  },
65
65
  "techstack": {