@atlaskit/renderer 106.0.1 → 106.0.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,11 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 106.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8c04b73312e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8c04b73312e) - ED-16758 Added data-cell-background attribute to store table cell background color information.
8
+
3
9
  ## 106.0.1
4
10
 
5
11
  ### Patch Changes
@@ -52,11 +52,28 @@ var getSortOrderLabel = function getSortOrderLabel(intl, currentSortOrder) {
52
52
  return intl.formatMessage(noneSortingLabel);
53
53
  }
54
54
  };
55
- var getDataAttributes = function getDataAttributes(colwidth) {
55
+ var getDataAttributes = function getDataAttributes(colwidth, background) {
56
56
  var attrs = {};
57
57
  if (colwidth) {
58
58
  attrs['data-colwidth'] = colwidth.join(',');
59
59
  }
60
+ /**
61
+ * Storing hex code in data-cell-background because
62
+ * we want to have DST token (css variable) or
63
+ * DST token value (value (hex code) of css variable) in
64
+ * inline style to correct render table cell background
65
+ * based on selected theme.
66
+ * Currently we rely on background color hex code stored in
67
+ * inline style.
68
+ * Because of that when we copy and paste table, we end up
69
+ * having DST token or DST token value in ADF instead of
70
+ * original hex code which we map to DST token.
71
+ * So, introducing data-cell-background.
72
+ * More details at https://product-fabric.atlassian.net/wiki/spaces/EUXQ/pages/3472556903/Tokenising+tableCell+background+colors#Update-toDom-and-parseDom-to-store-and-read-background-color-from-data-cell-background-attribute.4
73
+ */
74
+ if (background) {
75
+ attrs['data-cell-background'] = background;
76
+ }
60
77
  return attrs;
61
78
  };
62
79
  var getStyle = function getStyle(background, colGroupWidth, offsetTop) {
@@ -105,7 +122,7 @@ var withCellProps = function withCellProps(WrapperComponent) {
105
122
  colorname: colorName,
106
123
  onClick: onClick,
107
124
  className: className
108
- }, getDataAttributes(colwidth), {
125
+ }, getDataAttributes(colwidth, background), {
109
126
  "aria-sort": ariaSort
110
127
  }), children);
111
128
  }
@@ -55,7 +55,7 @@ exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
55
55
  var DEGRADED_SEVERITY_THRESHOLD = 3000;
56
56
  exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
57
57
  var packageName = "@atlaskit/renderer";
58
- var packageVersion = "106.0.1";
58
+ var packageVersion = "106.0.2";
59
59
  var Renderer = /*#__PURE__*/function (_PureComponent) {
60
60
  (0, _inherits2.default)(Renderer, _PureComponent);
61
61
  var _super = _createSuper(Renderer);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "106.0.1",
3
+ "version": "106.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -39,11 +39,28 @@ const getSortOrderLabel = (intl, currentSortOrder) => {
39
39
  return intl.formatMessage(noneSortingLabel);
40
40
  }
41
41
  };
42
- const getDataAttributes = colwidth => {
42
+ const getDataAttributes = (colwidth, background) => {
43
43
  const attrs = {};
44
44
  if (colwidth) {
45
45
  attrs['data-colwidth'] = colwidth.join(',');
46
46
  }
47
+ /**
48
+ * Storing hex code in data-cell-background because
49
+ * we want to have DST token (css variable) or
50
+ * DST token value (value (hex code) of css variable) in
51
+ * inline style to correct render table cell background
52
+ * based on selected theme.
53
+ * Currently we rely on background color hex code stored in
54
+ * inline style.
55
+ * Because of that when we copy and paste table, we end up
56
+ * having DST token or DST token value in ADF instead of
57
+ * original hex code which we map to DST token.
58
+ * So, introducing data-cell-background.
59
+ * More details at https://product-fabric.atlassian.net/wiki/spaces/EUXQ/pages/3472556903/Tokenising+tableCell+background+colors#Update-toDom-and-parseDom-to-store-and-read-background-color-from-data-cell-background-attribute.4
60
+ */
61
+ if (background) {
62
+ attrs['data-cell-background'] = background;
63
+ }
47
64
  return attrs;
48
65
  };
49
66
  const getStyle = (background, colGroupWidth, offsetTop) => {
@@ -85,7 +102,7 @@ const withCellProps = WrapperComponent => {
85
102
  colorname: colorName,
86
103
  onClick: onClick,
87
104
  className: className
88
- }, getDataAttributes(colwidth), {
105
+ }, getDataAttributes(colwidth, background), {
89
106
  "aria-sort": ariaSort
90
107
  }), children);
91
108
  }
@@ -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 = "106.0.1";
38
+ const packageVersion = "106.0.2";
39
39
  export class Renderer extends PureComponent {
40
40
  /**
41
41
  * This is used in measuring the Renderer Mount time and is then
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "106.0.1",
3
+ "version": "106.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -45,11 +45,28 @@ var getSortOrderLabel = function getSortOrderLabel(intl, currentSortOrder) {
45
45
  return intl.formatMessage(noneSortingLabel);
46
46
  }
47
47
  };
48
- var getDataAttributes = function getDataAttributes(colwidth) {
48
+ var getDataAttributes = function getDataAttributes(colwidth, background) {
49
49
  var attrs = {};
50
50
  if (colwidth) {
51
51
  attrs['data-colwidth'] = colwidth.join(',');
52
52
  }
53
+ /**
54
+ * Storing hex code in data-cell-background because
55
+ * we want to have DST token (css variable) or
56
+ * DST token value (value (hex code) of css variable) in
57
+ * inline style to correct render table cell background
58
+ * based on selected theme.
59
+ * Currently we rely on background color hex code stored in
60
+ * inline style.
61
+ * Because of that when we copy and paste table, we end up
62
+ * having DST token or DST token value in ADF instead of
63
+ * original hex code which we map to DST token.
64
+ * So, introducing data-cell-background.
65
+ * More details at https://product-fabric.atlassian.net/wiki/spaces/EUXQ/pages/3472556903/Tokenising+tableCell+background+colors#Update-toDom-and-parseDom-to-store-and-read-background-color-from-data-cell-background-attribute.4
66
+ */
67
+ if (background) {
68
+ attrs['data-cell-background'] = background;
69
+ }
53
70
  return attrs;
54
71
  };
55
72
  var getStyle = function getStyle(background, colGroupWidth, offsetTop) {
@@ -98,7 +115,7 @@ var withCellProps = function withCellProps(WrapperComponent) {
98
115
  colorname: colorName,
99
116
  onClick: onClick,
100
117
  className: className
101
- }, getDataAttributes(colwidth), {
118
+ }, getDataAttributes(colwidth, background), {
102
119
  "aria-sort": ariaSort
103
120
  }), children);
104
121
  }
@@ -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 = "106.0.1";
48
+ var packageVersion = "106.0.2";
49
49
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
50
50
  _inherits(Renderer, _PureComponent);
51
51
  var _super = _createSuper(Renderer);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "106.0.1",
3
+ "version": "106.0.2",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "106.0.1",
3
+ "version": "106.0.2",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/media-filmstrip": "^46.1.0",
44
44
  "@atlaskit/media-ui": "^22.3.0",
45
45
  "@atlaskit/media-viewer": "^47.4.0",
46
- "@atlaskit/smart-card": "^24.1.0",
46
+ "@atlaskit/smart-card": "^24.3.0",
47
47
  "@atlaskit/status": "^1.2.0",
48
48
  "@atlaskit/task-decision": "^17.5.0",
49
49
  "@atlaskit/theme": "^12.2.0",
@@ -80,7 +80,7 @@
80
80
  "@atlaskit/media-test-helpers": "^30.1.0",
81
81
  "@atlaskit/mention": "^21.0.0",
82
82
  "@atlaskit/navigation-next": "^9.0.0",
83
- "@atlaskit/profilecard": "^18.2.0",
83
+ "@atlaskit/profilecard": "^18.3.0",
84
84
  "@atlaskit/radio": "^5.4.0",
85
85
  "@atlaskit/range": "^7.0.0",
86
86
  "@atlaskit/ssr": "*",