@atlaskit/renderer 108.6.11 → 108.7.1

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,21 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 108.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4fe49c40988`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4fe49c40988) - [ux] ED-18966 fix default table in renderer full-width appearance mode
8
+
9
+ ## 108.7.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`5f028fb62a1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f028fb62a1) - ED-19038 added mediaSingle.widthType support to renderer.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 108.6.11
4
20
 
5
21
  ### Patch Changes
@@ -55,7 +55,8 @@ var MediaSingle = function MediaSingle(props) {
55
55
  isInsideOfBlockNode = props.isInsideOfBlockNode,
56
56
  layout = props.layout,
57
57
  children = props.children,
58
- pctWidth = props.width;
58
+ widthAttr = props.width,
59
+ widthType = props.widthType;
59
60
  var isCaptionsFlaggedOn = (0, _mediaCommon.getMediaFeatureFlag)('captions', featureFlags);
60
61
  var _React$useState = _react.default.useState({
61
62
  width: 0,
@@ -163,7 +164,10 @@ var MediaSingle = function MediaSingle(props) {
163
164
  height: height,
164
165
  lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
165
166
  containerWidth: containerWidth,
166
- pctWidth: pctWidth,
167
+ size: {
168
+ width: widthAttr,
169
+ widthType: widthType
170
+ },
167
171
  fullWidthMode: isFullWidth
168
172
  }, (0, _react2.jsx)(_react.Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
169
173
  };
@@ -258,8 +258,11 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
258
258
  var lineLength = _editorSharedStyles.akEditorDefaultLayoutWidth;
259
259
  var tableWidth;
260
260
  var left;
261
+ var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance) {
262
+ return rendererAppearance === 'full-width' && !tableNode.attrs.width ? Math.min(_editorSharedStyles.akEditorFullWidthLayoutWidth, renderWidth) : Math.min((0, _nodeWidth.getTableContainerWidth)(tableNode), renderWidth);
263
+ };
261
264
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && tableNode) {
262
- tableWidth = Math.min((0, _nodeWidth.getTableContainerWidth)(tableNode), renderWidth);
265
+ tableWidth = calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance);
263
266
  } else {
264
267
  tableWidth = (0, _styles.calcTableWidth)(layout, renderWidth, false);
265
268
  }
@@ -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 = "108.6.11";
58
+ var packageVersion = "108.7.1";
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": "108.6.11",
3
+ "version": "108.7.1",
4
4
  "sideEffects": false
5
5
  }
@@ -42,7 +42,8 @@ const MediaSingle = props => {
42
42
  isInsideOfBlockNode,
43
43
  layout,
44
44
  children,
45
- width: pctWidth
45
+ width: widthAttr,
46
+ widthType
46
47
  } = props;
47
48
  const isCaptionsFlaggedOn = getMediaFeatureFlag('captions', featureFlags);
48
49
  const [externalImageDimensions, setExternalImageDimensions] = React.useState({
@@ -148,7 +149,10 @@ const MediaSingle = props => {
148
149
  height: height,
149
150
  lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
150
151
  containerWidth: containerWidth,
151
- pctWidth: pctWidth,
152
+ size: {
153
+ width: widthAttr,
154
+ widthType
155
+ },
152
156
  fullWidthMode: isFullWidth
153
157
  }, jsx(Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
154
158
  };
@@ -8,6 +8,7 @@ import { SortOrder } from '@atlaskit/editor-common/types';
8
8
  import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
9
9
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
10
10
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
11
+ import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
11
12
  import { FullPagePadding } from '../../ui/Renderer/style';
12
13
  import { TableHeader } from './tableCell';
13
14
  import { withSmartCardStorage } from '../../ui/SmartCardStorage';
@@ -217,8 +218,11 @@ export class TableContainer extends React.Component {
217
218
  const lineLength = akEditorDefaultLayoutWidth;
218
219
  let tableWidth;
219
220
  let left;
221
+ const calcDefaultLayoutWidthByAppearance = (tableNode, rendererAppearance) => {
222
+ return rendererAppearance === 'full-width' && !tableNode.attrs.width ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : Math.min(getTableContainerWidth(tableNode), renderWidth);
223
+ };
220
224
  if (getBooleanFF('platform.editor.custom-table-width') && tableNode) {
221
- tableWidth = Math.min(getTableContainerWidth(tableNode), renderWidth);
225
+ tableWidth = calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance);
222
226
  } else {
223
227
  tableWidth = calcTableWidth(layout, renderWidth, false);
224
228
  }
@@ -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.6.11";
38
+ const packageVersion = "108.7.1";
39
39
  export class Renderer extends PureComponent {
40
40
  constructor(props) {
41
41
  super(props);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.6.11",
3
+ "version": "108.7.1",
4
4
  "sideEffects": false
5
5
  }
@@ -43,7 +43,8 @@ var MediaSingle = function MediaSingle(props) {
43
43
  isInsideOfBlockNode = props.isInsideOfBlockNode,
44
44
  layout = props.layout,
45
45
  children = props.children,
46
- pctWidth = props.width;
46
+ widthAttr = props.width,
47
+ widthType = props.widthType;
47
48
  var isCaptionsFlaggedOn = getMediaFeatureFlag('captions', featureFlags);
48
49
  var _React$useState = React.useState({
49
50
  width: 0,
@@ -151,7 +152,10 @@ var MediaSingle = function MediaSingle(props) {
151
152
  height: height,
152
153
  lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
153
154
  containerWidth: containerWidth,
154
- pctWidth: pctWidth,
155
+ size: {
156
+ width: widthAttr,
157
+ widthType: widthType
158
+ },
155
159
  fullWidthMode: isFullWidth
156
160
  }, jsx(Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
157
161
  };
@@ -16,6 +16,7 @@ import { SortOrder } from '@atlaskit/editor-common/types';
16
16
  import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
17
17
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
18
18
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
19
+ import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
19
20
  import { FullPagePadding } from '../../ui/Renderer/style';
20
21
  import { TableHeader } from './tableCell';
21
22
  import { withSmartCardStorage } from '../../ui/SmartCardStorage';
@@ -251,8 +252,11 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
251
252
  var lineLength = akEditorDefaultLayoutWidth;
252
253
  var tableWidth;
253
254
  var left;
255
+ var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance) {
256
+ return rendererAppearance === 'full-width' && !tableNode.attrs.width ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : Math.min(getTableContainerWidth(tableNode), renderWidth);
257
+ };
254
258
  if (getBooleanFF('platform.editor.custom-table-width') && tableNode) {
255
- tableWidth = Math.min(getTableContainerWidth(tableNode), renderWidth);
259
+ tableWidth = calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance);
256
260
  } else {
257
261
  tableWidth = calcTableWidth(layout, renderWidth, false);
258
262
  }
@@ -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.6.11";
48
+ var packageVersion = "108.7.1";
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": "108.6.11",
3
+ "version": "108.7.1",
4
4
  "sideEffects": false
5
5
  }
@@ -3,7 +3,7 @@ import { default as React } from 'react';
3
3
  import { WrappedComponentProps } from 'react-intl-next';
4
4
  import { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
5
5
  import { MediaFeatureFlags } from '@atlaskit/media-common';
6
- import type { EventHandlers } from '@atlaskit/editor-common/ui';
6
+ import type { EventHandlers, MediaSingleWidthType } from '@atlaskit/editor-common/ui';
7
7
  import { AnalyticsEventPayload } from '../../../analytics/events';
8
8
  import { RendererAppearance } from '../../../ui/Renderer/types';
9
9
  export interface Props {
@@ -11,6 +11,7 @@ export interface Props {
11
11
  layout: MediaSingleLayout;
12
12
  eventHandlers?: EventHandlers;
13
13
  width?: number;
14
+ widthType?: MediaSingleWidthType;
14
15
  isInsideOfBlockNode?: boolean;
15
16
  rendererAppearance: RendererAppearance;
16
17
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
@@ -3,7 +3,7 @@ import { default as React } from 'react';
3
3
  import { WrappedComponentProps } from 'react-intl-next';
4
4
  import { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
5
5
  import { MediaFeatureFlags } from '@atlaskit/media-common';
6
- import type { EventHandlers } from '@atlaskit/editor-common/ui';
6
+ import type { EventHandlers, MediaSingleWidthType } from '@atlaskit/editor-common/ui';
7
7
  import { AnalyticsEventPayload } from '../../../analytics/events';
8
8
  import { RendererAppearance } from '../../../ui/Renderer/types';
9
9
  export interface Props {
@@ -11,6 +11,7 @@ export interface Props {
11
11
  layout: MediaSingleLayout;
12
12
  eventHandlers?: EventHandlers;
13
13
  width?: number;
14
+ widthType?: MediaSingleWidthType;
14
15
  isInsideOfBlockNode?: boolean;
15
16
  rendererAppearance: RendererAppearance;
16
17
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.6.11",
3
+ "version": "108.7.1",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/analytics-next": "^9.1.0",
32
32
  "@atlaskit/button": "^16.8.0",
33
33
  "@atlaskit/code": "^14.6.0",
34
- "@atlaskit/editor-common": "^74.22.0",
34
+ "@atlaskit/editor-common": "^74.23.0",
35
35
  "@atlaskit/editor-json-transformer": "^8.10.0",
36
36
  "@atlaskit/editor-palette": "1.5.1",
37
37
  "@atlaskit/editor-shared-styles": "^2.4.0",
@@ -69,6 +69,7 @@
69
69
  "react-dom": "^16.8.0"
70
70
  },
71
71
  "devDependencies": {
72
+ "@af/visual-regression": "*",
72
73
  "@atlaskit/analytics-gas-types": "^5.1.0",
73
74
  "@atlaskit/css-reset": "^6.5.0",
74
75
  "@atlaskit/editor-core": "^186.0.0",