@atlaskit/renderer 108.16.4 → 108.16.5

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/renderer
2
2
 
3
+ ## 108.16.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43362](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43362) [`e4cea0e13b9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4cea0e13b9) - [ux] ED-20699 Use LCH color inversion method in dark mode, behind platform.editor.use-lch-for-color-inversion_1qv8ol feature flag.
8
+
3
9
  ## 108.16.4
4
10
 
5
11
  ### Patch Changes
@@ -12,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var _adfSchema = require("@atlaskit/adf-schema");
13
13
  var _editorPalette = require("@atlaskit/editor-palette");
14
14
  var _tokens = require("@atlaskit/tokens");
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
18
  /**
@@ -76,7 +77,12 @@ function TextColor(props) {
76
77
  } else {
77
78
  if (colorMode === 'dark') {
78
79
  // if we have a custom color, we need to check if we are in dark mode
79
- paletteColorValue = invertCustomColor(props.color);
80
+ // and if the feature flag is enabled we need to use the LCH conversion method
81
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
82
+ paletteColorValue = (0, _adfSchema.getDarkModeLCHColor)(props.color);
83
+ } else {
84
+ paletteColorValue = invertCustomColor(props.color);
85
+ }
80
86
  } else {
81
87
  // if we are in light mode, we can just set the color
82
88
  paletteColorValue = props.color;
@@ -17,6 +17,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
17
17
  var _consts = require("../../consts");
18
18
  var _reactIntlNext = require("react-intl-next");
19
19
  var _messages = require("../../messages");
20
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
21
  var IgnoreSorting = ['LABEL', 'INPUT'];
21
22
  var nextStatusOrder = function nextStatusOrder(currentSortOrder) {
22
23
  switch (currentSortOrder) {
@@ -133,7 +134,12 @@ var getStyle = function getStyle(_ref) {
133
134
  // if we have a custom color, we need to check if we are in dark mode
134
135
  if (colorMode === 'dark') {
135
136
  // if we are in dark mode, we need to invert the color
136
- style.backgroundColor = invertCustomColor(background);
137
+ // and if the feature flag is enabled we need to use the LCH conversion method
138
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
139
+ style.backgroundColor = (0, _adfSchema.getDarkModeLCHColor)(background);
140
+ } else {
141
+ style.backgroundColor = invertCustomColor(background);
142
+ }
137
143
  } else {
138
144
  // if we are in light mode, we can just set the color
139
145
  style.backgroundColor = background;
@@ -53,7 +53,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
53
53
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
54
54
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
55
55
  var packageName = "@atlaskit/renderer";
56
- var packageVersion = "108.16.4";
56
+ var packageVersion = "108.16.5";
57
57
  var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
58
58
  (0, _inherits2.default)(Renderer, _PureComponent);
59
59
  var _super = _createSuper(Renderer);
@@ -1,8 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useMemo } from 'react';
3
- import { isHex, isRgb, rgbToHex } from '@atlaskit/adf-schema';
3
+ import { isHex, isRgb, rgbToHex, getDarkModeLCHColor } from '@atlaskit/adf-schema';
4
4
  import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
5
5
  import { useThemeObserver } from '@atlaskit/tokens';
6
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
7
+
6
8
  /**
7
9
  * This function is duplicated in
8
10
  * - @atlaskit/adf-schema
@@ -66,7 +68,12 @@ export default function TextColor(props) {
66
68
  } else {
67
69
  if (colorMode === 'dark') {
68
70
  // if we have a custom color, we need to check if we are in dark mode
69
- paletteColorValue = invertCustomColor(props.color);
71
+ // and if the feature flag is enabled we need to use the LCH conversion method
72
+ if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
73
+ paletteColorValue = getDarkModeLCHColor(props.color);
74
+ } else {
75
+ paletteColorValue = invertCustomColor(props.color);
76
+ }
70
77
  } else {
71
78
  // if we are in light mode, we can just set the color
72
79
  paletteColorValue = props.color;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { isHex, isRgb, rgbToHex, tableBackgroundColorPalette } from '@atlaskit/adf-schema';
3
+ import { isHex, isRgb, rgbToHex, tableBackgroundColorPalette, getDarkModeLCHColor } from '@atlaskit/adf-schema';
4
4
  import { useThemeObserver } from '@atlaskit/tokens';
5
5
  import { SortOrder } from '@atlaskit/editor-common/types';
6
6
  import { hexToEditorBackgroundPaletteRawValue } from '@atlaskit/editor-palette';
@@ -10,6 +10,7 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/anal
10
10
  import { RendererCssClassName } from '../../consts';
11
11
  import { useIntl } from 'react-intl-next';
12
12
  import { tableCellMessages } from '../../messages';
13
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
13
14
  const IgnoreSorting = ['LABEL', 'INPUT'];
14
15
  const nextStatusOrder = currentSortOrder => {
15
16
  switch (currentSortOrder) {
@@ -129,7 +130,12 @@ const getStyle = ({
129
130
  // if we have a custom color, we need to check if we are in dark mode
130
131
  if (colorMode === 'dark') {
131
132
  // if we are in dark mode, we need to invert the color
132
- style.backgroundColor = invertCustomColor(background);
133
+ // and if the feature flag is enabled we need to use the LCH conversion method
134
+ if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
135
+ style.backgroundColor = getDarkModeLCHColor(background);
136
+ } else {
137
+ style.backgroundColor = invertCustomColor(background);
138
+ }
133
139
  } else {
134
140
  // if we are in light mode, we can just set the color
135
141
  style.backgroundColor = background;
@@ -35,7 +35,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
35
35
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
36
36
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
37
37
  const packageName = "@atlaskit/renderer";
38
- const packageVersion = "108.16.4";
38
+ const packageVersion = "108.16.5";
39
39
  export class Renderer extends PureComponent {
40
40
  constructor(props) {
41
41
  super(props);
@@ -1,9 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import React, { useMemo } from 'react';
4
- import { isHex, isRgb, rgbToHex } from '@atlaskit/adf-schema';
4
+ import { isHex, isRgb, rgbToHex, getDarkModeLCHColor } from '@atlaskit/adf-schema';
5
5
  import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
6
6
  import { useThemeObserver } from '@atlaskit/tokens';
7
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
+
7
9
  /**
8
10
  * This function is duplicated in
9
11
  * - @atlaskit/adf-schema
@@ -66,7 +68,12 @@ export default function TextColor(props) {
66
68
  } else {
67
69
  if (colorMode === 'dark') {
68
70
  // if we have a custom color, we need to check if we are in dark mode
69
- paletteColorValue = invertCustomColor(props.color);
71
+ // and if the feature flag is enabled we need to use the LCH conversion method
72
+ if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
73
+ paletteColorValue = getDarkModeLCHColor(props.color);
74
+ } else {
75
+ paletteColorValue = invertCustomColor(props.color);
76
+ }
70
77
  } else {
71
78
  // if we are in light mode, we can just set the color
72
79
  paletteColorValue = props.color;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { isHex, isRgb, rgbToHex, tableBackgroundColorPalette } from '@atlaskit/adf-schema';
3
+ import { isHex, isRgb, rgbToHex, tableBackgroundColorPalette, getDarkModeLCHColor } from '@atlaskit/adf-schema';
4
4
  import { useThemeObserver } from '@atlaskit/tokens';
5
5
  import { SortOrder } from '@atlaskit/editor-common/types';
6
6
  import { hexToEditorBackgroundPaletteRawValue } from '@atlaskit/editor-palette';
@@ -10,6 +10,7 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/anal
10
10
  import { RendererCssClassName } from '../../consts';
11
11
  import { useIntl } from 'react-intl-next';
12
12
  import { tableCellMessages } from '../../messages';
13
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
13
14
  var IgnoreSorting = ['LABEL', 'INPUT'];
14
15
  var nextStatusOrder = function nextStatusOrder(currentSortOrder) {
15
16
  switch (currentSortOrder) {
@@ -126,7 +127,12 @@ var getStyle = function getStyle(_ref) {
126
127
  // if we have a custom color, we need to check if we are in dark mode
127
128
  if (colorMode === 'dark') {
128
129
  // if we are in dark mode, we need to invert the color
129
- style.backgroundColor = invertCustomColor(background);
130
+ // and if the feature flag is enabled we need to use the LCH conversion method
131
+ if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
132
+ style.backgroundColor = getDarkModeLCHColor(background);
133
+ } else {
134
+ style.backgroundColor = invertCustomColor(background);
135
+ }
130
136
  } else {
131
137
  // if we are in light mode, we can just set the color
132
138
  style.backgroundColor = background;
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
45
45
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
46
46
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
47
47
  var packageName = "@atlaskit/renderer";
48
- var packageVersion = "108.16.4";
48
+ var packageVersion = "108.16.5";
49
49
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
50
50
  _inherits(Renderer, _PureComponent);
51
51
  var _super = _createSuper(Renderer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.16.4",
3
+ "version": "108.16.5",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -128,6 +128,9 @@
128
128
  "platform.media-experience.media-viewer-v2_hgsii": {
129
129
  "type": "boolean",
130
130
  "referenceOnly": "true"
131
+ },
132
+ "platform.editor.use-lch-for-color-inversion_1qv8ol": {
133
+ "type": "boolean"
131
134
  }
132
135
  }
133
136
  }