@atlaskit/adf-schema 47.6.0 → 47.7.0

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,11 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 47.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 105bd25: EDF-2577: Remap orange to yellow in text background color mapping functions behind editor_text_highlight_orange_to_yellow experiment
8
+
3
9
  ## 47.6.0
4
10
 
5
11
  ### Minor Changes
@@ -1,5 +1,6 @@
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
  });
@@ -9,6 +10,7 @@ exports.hexToEditorBorderPaletteColor = hexToEditorBorderPaletteColor;
9
10
  exports.hexToEditorTextBackgroundPaletteColor = hexToEditorTextBackgroundPaletteColor;
10
11
  exports.hexToEditorTextPaletteColor = hexToEditorTextPaletteColor;
11
12
  exports.textBackgroundColorPalette = void 0;
13
+ var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
12
14
  /**
13
15
  * This takes an adf hex color and returns a matching border palette color.
14
16
  *
@@ -125,6 +127,13 @@ var editorTextPalette = exports.editorTextPalette = {
125
127
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
126
128
  */
127
129
  function hexToEditorTextBackgroundPaletteColor(hexColor) {
130
+ var orangeToYellowEnabled = _featureGateJsClient.default.getExperimentValue('editor_text_highlight_orange_to_yellow', 'cohort', 'control', {
131
+ fireExperimentExposure: true
132
+ });
133
+ if (orangeToYellowEnabled === 'test') {
134
+ textBackgroundColorPalette['#FEDEC8'] = 'var(--ds-background-accent-yellow-subtler, #F8E6A0)';
135
+ }
136
+
128
137
  // Ts ignore was used to allow use of conditional return type
129
138
  // (preferring better type on consumption over safety in implementation)
130
139
  return hexColor ? textBackgroundColorPalette[hexColor.toUpperCase()] : undefined;
@@ -1,3 +1,5 @@
1
+ import FeatureGates from '@atlaskit/feature-gate-js-client';
2
+
1
3
  /**
2
4
  * This takes an adf hex color and returns a matching border palette color.
3
5
  *
@@ -114,6 +116,13 @@ export const editorTextPalette = {
114
116
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
115
117
  */
116
118
  export function hexToEditorTextBackgroundPaletteColor(hexColor) {
119
+ const orangeToYellowEnabled = FeatureGates.getExperimentValue('editor_text_highlight_orange_to_yellow', 'cohort', 'control', {
120
+ fireExperimentExposure: true
121
+ });
122
+ if (orangeToYellowEnabled === 'test') {
123
+ textBackgroundColorPalette['#FEDEC8'] = 'var(--ds-background-accent-yellow-subtler, #F8E6A0)';
124
+ }
125
+
117
126
  // Ts ignore was used to allow use of conditional return type
118
127
  // (preferring better type on consumption over safety in implementation)
119
128
  return hexColor ? textBackgroundColorPalette[hexColor.toUpperCase()] : undefined;
@@ -1,3 +1,5 @@
1
+ import FeatureGates from '@atlaskit/feature-gate-js-client';
2
+
1
3
  /**
2
4
  * This takes an adf hex color and returns a matching border palette color.
3
5
  *
@@ -114,6 +116,13 @@ export var editorTextPalette = {
114
116
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
115
117
  */
116
118
  export function hexToEditorTextBackgroundPaletteColor(hexColor) {
119
+ var orangeToYellowEnabled = FeatureGates.getExperimentValue('editor_text_highlight_orange_to_yellow', 'cohort', 'control', {
120
+ fireExperimentExposure: true
121
+ });
122
+ if (orangeToYellowEnabled === 'test') {
123
+ textBackgroundColorPalette['#FEDEC8'] = 'var(--ds-background-accent-yellow-subtler, #F8E6A0)';
124
+ }
125
+
117
126
  // Ts ignore was used to allow use of conditional return type
118
127
  // (preferring better type on consumption over safety in implementation)
119
128
  return hexColor ? textBackgroundColorPalette[hexColor.toUpperCase()] : undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "47.6.0",
3
+ "version": "47.7.0",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,15 +39,16 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@atlaskit/editor-prosemirror": "*",
42
+ "@atlaskit/feature-gate-js-client": "^4.26.4",
42
43
  "@babel/runtime": "^7.0.0",
43
44
  "css-color-names": "0.0.4",
44
45
  "linkify-it": "^2.0.3",
45
46
  "memoize-one": "^6.0.0"
46
47
  },
47
48
  "devDependencies": {
48
- "@atlassian/adf-schema-json": "^1.31.0",
49
49
  "@atlaskit/adf-schema-generator": "^2.1.0",
50
50
  "@atlaskit/codemod-utils": "^4.2.4",
51
+ "@atlassian/adf-schema-json": "^1.31.0",
51
52
  "@babel/cli": "^7.22.9",
52
53
  "@babel/core": "^7.22.9",
53
54
  "@babel/plugin-proposal-class-properties": "^7.18.6",