@atlaskit/renderer 120.2.6 → 120.3.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,27 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 120.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#190691](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/190691)
8
+ [`e4343163813c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e4343163813c4) -
9
+ [ux] [JRACLOUD-95277] When numbered column is on, use percentage scaling for colWidths if the
10
+ tableWidth is less than the maxWidth and the column width is greater than the min colWidth
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 120.2.7
17
+
18
+ ### Patch Changes
19
+
20
+ - [#191865](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/191865)
21
+ [`972dbb190b357`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/972dbb190b357) -
22
+ [ux] Fix smart link line break bug in client side rendering
23
+ - Updated dependencies
24
+
3
25
  ## 120.2.6
4
26
 
5
27
  ### Patch Changes
@@ -29,7 +29,7 @@ var _PortalContext = require("../../ui/Renderer/PortalContext");
29
29
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
30
30
 
31
31
  var HoverLinkOverlayNoop = function HoverLinkOverlayNoop(props) {
32
- return (0, _react2.jsx)("div", null, props.children);
32
+ return (0, _react2.jsx)(_react.Fragment, null, props.children);
33
33
  };
34
34
  var HoverLinkOverlayWithCondition = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
35
35
  return (0, _platformFeatureFlags.fg)('platform_editor_preview_panel_linking');
@@ -14,6 +14,7 @@ var _nodeWidth = require("@atlaskit/editor-common/node-width");
14
14
  var _useFeatureFlags = require("../../../use-feature-flags");
15
15
  var _rendererContext = require("../../../renderer-context");
16
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
18
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
19
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
20
  // we allow scaling down column widths by no more than 30%
@@ -174,6 +175,35 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
174
175
  isNumberColumnEnabled: isNumberColumnEnabled
175
176
  });
176
177
  }
178
+ if (isNumberColumnEnabled && (tableWidth < maxTableWidth || maxTableWidth === 0) && (0, _expValEquals.expValEquals)('editor_prevent_numbered_column_too_big_jira', 'isEnabled', true)) {
179
+ var fixedColWidths = targetWidths.map(function (width) {
180
+ return fixColumnWidth(width, tableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
181
+ });
182
+ var sumFixedColumnWidths = colWidthSum(fixedColWidths);
183
+ return fixedColWidths.map(function (colWidth) {
184
+ var width = Math.max(colWidth, cellMinWidth);
185
+ if (colWidth > _editorSharedStyles.akEditorTableCellMinWidth) {
186
+ // To make sure the numbered column isn't scaled, use
187
+ // percentages for the other columns.
188
+ // Calculate the percentage based on the sum of the fixed column widths
189
+ return {
190
+ width: "".concat(width / sumFixedColumnWidths * 100, "%")
191
+ };
192
+ } else {
193
+ // If the column is equal to or less than the minimum cell width, we need to return a fixed pixel width.
194
+ // This is to prevent columns being scaled below the minimum cell width.
195
+ var style = width ? {
196
+ width: "".concat(width, "px")
197
+ } : {};
198
+ return style;
199
+ }
200
+ });
201
+ }
202
+
203
+ /**
204
+ * When cleaning up editor_prevent_numbered_column_too_big_jira experiment,
205
+ * resuse the fixedColWidths const to avoid code duplication.
206
+ */
177
207
  return targetWidths.map(function (colWidth) {
178
208
  var width = fixColumnWidth(colWidth, minTableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
179
209
  var style = width ? {
@@ -63,7 +63,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
63
63
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
64
64
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
65
65
  var packageName = "@atlaskit/renderer";
66
- var packageVersion = "120.2.5";
66
+ var packageVersion = "120.2.7";
67
67
  var setAsQueryContainerStyles = (0, _react2.css)({
68
68
  containerName: 'ak-renderer-wrapper',
69
69
  containerType: 'inline-size'
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  * @jsxRuntime classic
4
4
  * @jsx jsx
5
5
  */
6
- import { useState } from 'react';
6
+ import { Fragment, useState } from 'react';
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { jsx } from '@emotion/react';
9
9
  import { useSmartCardContext } from '@atlaskit/link-provider';
@@ -18,7 +18,7 @@ import { withSmartCardStorage } from '../../ui/SmartCardStorage';
18
18
  import { getCardClickHandler } from '../utils/getCardClickHandler';
19
19
  import { useInlineAnnotationProps } from '../../ui/annotations/element/useInlineAnnotationProps';
20
20
  import { usePortal } from '../../ui/Renderer/PortalContext';
21
- const HoverLinkOverlayNoop = props => jsx("div", null, props.children);
21
+ const HoverLinkOverlayNoop = props => jsx(Fragment, null, props.children);
22
22
  const HoverLinkOverlayWithCondition = componentWithCondition(() => fg('platform_editor_preview_panel_linking'), HoverLinkOverlay, HoverLinkOverlayNoop);
23
23
  const InlineCard = props => {
24
24
  var _cardContext$value, _cardContext$value$st, _cardContext$value2, _cardContext$value2$i, _cardContext$value3;
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
3
- import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth } from '@atlaskit/editor-shared-styles';
3
+ import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth, akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles';
4
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
5
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
6
6
  import { useFeatureFlags } from '../../../use-feature-flags';
7
7
  import { useRendererContext } from '../../../renderer-context';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
 
10
11
  // we allow scaling down column widths by no more than 30%
11
12
  // this intends to reduce unwanted scrolling in the Renderer in these scenarios:
@@ -160,6 +161,33 @@ const renderScaleDownColgroup = props => {
160
161
  isNumberColumnEnabled: isNumberColumnEnabled
161
162
  });
162
163
  }
164
+ if (isNumberColumnEnabled && (tableWidth < maxTableWidth || maxTableWidth === 0) && expValEquals('editor_prevent_numbered_column_too_big_jira', 'isEnabled', true)) {
165
+ const fixedColWidths = targetWidths.map(width => fixColumnWidth(width, tableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth);
166
+ const sumFixedColumnWidths = colWidthSum(fixedColWidths);
167
+ return fixedColWidths.map(colWidth => {
168
+ const width = Math.max(colWidth, cellMinWidth);
169
+ if (colWidth > akEditorTableCellMinWidth) {
170
+ // To make sure the numbered column isn't scaled, use
171
+ // percentages for the other columns.
172
+ // Calculate the percentage based on the sum of the fixed column widths
173
+ return {
174
+ width: `${width / sumFixedColumnWidths * 100}%`
175
+ };
176
+ } else {
177
+ // If the column is equal to or less than the minimum cell width, we need to return a fixed pixel width.
178
+ // This is to prevent columns being scaled below the minimum cell width.
179
+ const style = width ? {
180
+ width: `${width}px`
181
+ } : {};
182
+ return style;
183
+ }
184
+ });
185
+ }
186
+
187
+ /**
188
+ * When cleaning up editor_prevent_numbered_column_too_big_jira experiment,
189
+ * resuse the fixedColWidths const to avoid code duplication.
190
+ */
163
191
  return targetWidths.map(colWidth => {
164
192
  const width = fixColumnWidth(colWidth, minTableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
165
193
  const style = width ? {
@@ -49,7 +49,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
49
49
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
50
50
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
51
51
  const packageName = "@atlaskit/renderer";
52
- const packageVersion = "120.2.5";
52
+ const packageVersion = "120.2.7";
53
53
  const setAsQueryContainerStyles = css({
54
54
  containerName: 'ak-renderer-wrapper',
55
55
  containerType: 'inline-size'
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  * @jsxRuntime classic
5
5
  * @jsx jsx
6
6
  */
7
- import { useState } from 'react';
7
+ import { Fragment, useState } from 'react';
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { jsx } from '@emotion/react';
10
10
  import { useSmartCardContext } from '@atlaskit/link-provider';
@@ -20,7 +20,7 @@ import { getCardClickHandler } from '../utils/getCardClickHandler';
20
20
  import { useInlineAnnotationProps } from '../../ui/annotations/element/useInlineAnnotationProps';
21
21
  import { usePortal } from '../../ui/Renderer/PortalContext';
22
22
  var HoverLinkOverlayNoop = function HoverLinkOverlayNoop(props) {
23
- return jsx("div", null, props.children);
23
+ return jsx(Fragment, null, props.children);
24
24
  };
25
25
  var HoverLinkOverlayWithCondition = componentWithCondition(function () {
26
26
  return fg('platform_editor_preview_panel_linking');
@@ -3,12 +3,13 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import React from 'react';
5
5
  import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
6
- import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth } from '@atlaskit/editor-shared-styles';
6
+ import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth, akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles';
7
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
8
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
9
9
  import { useFeatureFlags } from '../../../use-feature-flags';
10
10
  import { useRendererContext } from '../../../renderer-context';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
13
 
13
14
  // we allow scaling down column widths by no more than 30%
14
15
  // this intends to reduce unwanted scrolling in the Renderer in these scenarios:
@@ -168,6 +169,35 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
168
169
  isNumberColumnEnabled: isNumberColumnEnabled
169
170
  });
170
171
  }
172
+ if (isNumberColumnEnabled && (tableWidth < maxTableWidth || maxTableWidth === 0) && expValEquals('editor_prevent_numbered_column_too_big_jira', 'isEnabled', true)) {
173
+ var fixedColWidths = targetWidths.map(function (width) {
174
+ return fixColumnWidth(width, tableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
175
+ });
176
+ var sumFixedColumnWidths = colWidthSum(fixedColWidths);
177
+ return fixedColWidths.map(function (colWidth) {
178
+ var width = Math.max(colWidth, cellMinWidth);
179
+ if (colWidth > akEditorTableCellMinWidth) {
180
+ // To make sure the numbered column isn't scaled, use
181
+ // percentages for the other columns.
182
+ // Calculate the percentage based on the sum of the fixed column widths
183
+ return {
184
+ width: "".concat(width / sumFixedColumnWidths * 100, "%")
185
+ };
186
+ } else {
187
+ // If the column is equal to or less than the minimum cell width, we need to return a fixed pixel width.
188
+ // This is to prevent columns being scaled below the minimum cell width.
189
+ var style = width ? {
190
+ width: "".concat(width, "px")
191
+ } : {};
192
+ return style;
193
+ }
194
+ });
195
+ }
196
+
197
+ /**
198
+ * When cleaning up editor_prevent_numbered_column_too_big_jira experiment,
199
+ * resuse the fixedColWidths const to avoid code duplication.
200
+ */
171
201
  return targetWidths.map(function (colWidth) {
172
202
  var width = fixColumnWidth(colWidth, minTableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
173
203
  var style = width ? {
@@ -54,7 +54,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
54
54
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
55
55
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
56
56
  var packageName = "@atlaskit/renderer";
57
- var packageVersion = "120.2.5";
57
+ var packageVersion = "120.2.7";
58
58
  var setAsQueryContainerStyles = css({
59
59
  containerName: 'ak-renderer-wrapper',
60
60
  containerType: 'inline-size'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "120.2.6",
3
+ "version": "120.3.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -28,7 +28,7 @@
28
28
  "@atlaskit/analytics-listeners": "^9.0.0",
29
29
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
30
30
  "@atlaskit/analytics-next": "^11.1.0",
31
- "@atlaskit/button": "^23.2.0",
31
+ "@atlaskit/button": "^23.3.0",
32
32
  "@atlaskit/code": "^17.2.0",
33
33
  "@atlaskit/editor-json-transformer": "^8.24.0",
34
34
  "@atlaskit/editor-palette": "^2.1.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/feature-gate-js-client": "^5.5.0",
40
40
  "@atlaskit/icon": "^27.7.0",
41
41
  "@atlaskit/link": "^3.2.0",
42
- "@atlaskit/link-datasource": "^4.14.0",
42
+ "@atlaskit/link-datasource": "^4.15.0",
43
43
  "@atlaskit/media-card": "^79.4.0",
44
44
  "@atlaskit/media-client": "^35.2.0",
45
45
  "@atlaskit/media-client-react": "^4.1.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/status": "^3.0.0",
55
55
  "@atlaskit/task-decision": "^19.2.0",
56
56
  "@atlaskit/theme": "^19.0.0",
57
- "@atlaskit/tmp-editor-statsig": "^9.12.0",
57
+ "@atlaskit/tmp-editor-statsig": "^9.15.0",
58
58
  "@atlaskit/tokens": "^5.6.0",
59
59
  "@atlaskit/tooltip": "^20.3.0",
60
60
  "@atlaskit/visually-hidden": "^3.0.0",