@atlaskit/renderer 109.51.5 → 109.52.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,35 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 109.52.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#137755](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/137755)
8
+ [`f3d004d4e3a3e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f3d004d4e3a3e) -
9
+ ED-24650 fix nested node jittering issue
10
+
11
+ ### Patch Changes
12
+
13
+ - [#137736](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/137736)
14
+ [`2a88fdd213838`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2a88fdd213838) -
15
+ Introducing new smaller refined entry-points for editor-common to reduce bundle size.
16
+ - [#137404](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/137404)
17
+ [`adae1f3dc8fca`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/adae1f3dc8fca) -
18
+ Switches Support Table in Comment features to use Statsig experiment instead of a Feature Gate.
19
+ - Updated dependencies
20
+
21
+ ## 109.51.6
22
+
23
+ ### Patch Changes
24
+
25
+ - [#136023](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136023)
26
+ [`462ac84782509`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/462ac84782509) -
27
+ ED-24794: Fixed numbered column tables not scaling down in renderer
28
+ - [#137344](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/137344)
29
+ [`00c81bdf34c46`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/00c81bdf34c46) -
30
+ [ux] Fixes an issue where tables that existed before "Support Table in Comment" are displayed as
31
+ centered 760px width tables when FF for Support Table in Comment is enabled.
32
+
3
33
  ## 109.51.5
4
34
 
5
35
  ### Patch Changes
@@ -43,9 +43,14 @@ var fixColumnWidth = function fixColumnWidth(columnWidth, _tableWidth, _layoutWi
43
43
  var calcScalePercent = function calcScalePercent(_ref) {
44
44
  var renderWidth = _ref.renderWidth,
45
45
  tableWidth = _ref.tableWidth,
46
- maxScale = _ref.maxScale;
47
- var diffPercent = 1 - renderWidth / tableWidth;
48
- return diffPercent < maxScale ? diffPercent : maxScale;
46
+ maxScale = _ref.maxScale,
47
+ isNumberColumnEnabled = _ref.isNumberColumnEnabled;
48
+ var noNumColumnScalePercent = renderWidth / tableWidth;
49
+ // when numbered column is enabled, we need to calculate the scale percent without the akEditorTableNumberColumnWidth
50
+ // As numbered column width is not scaled down
51
+ var numColumnScalePercent = (renderWidth - _editorSharedStyles.akEditorTableNumberColumnWidth) / (tableWidth - _editorSharedStyles.akEditorTableNumberColumnWidth);
52
+ var diffPercent = 1 - noNumColumnScalePercent;
53
+ return diffPercent < maxScale ? isNumberColumnEnabled ? 1 - numColumnScalePercent : diffPercent : maxScale;
49
54
  };
50
55
  var colWidthSum = function colWidthSum(columnWidths) {
51
56
  return columnWidths.reduce(function (prev, curr) {
@@ -67,8 +72,6 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
67
72
  if (!columnWidths) {
68
73
  return [];
69
74
  }
70
-
71
- // isTableColumnResized checks if table columns were resized
72
75
  var tableColumnResized = isTableColumnResized(columnWidths);
73
76
  var noOfColumns = columnWidths.length;
74
77
  var targetWidths;
@@ -151,7 +154,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
151
154
  scaleDownPercent = calcScalePercent({
152
155
  renderWidth: renderWidth,
153
156
  tableWidth: tableWidth,
154
- maxScale: shouldTable100ScaleDown ? 1 : maxScalingPercent
157
+ maxScale: shouldTable100ScaleDown ? 1 : maxScalingPercent,
158
+ isNumberColumnEnabled: isNumberColumnEnabled
155
159
  });
156
160
  }
157
161
  return targetWidths.map(function (colWidth) {
@@ -20,7 +20,7 @@ var _utils = require("@atlaskit/editor-common/utils");
20
20
  var _types = require("@atlaskit/editor-common/types");
21
21
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
22
  var _nodeWidth = require("@atlaskit/editor-common/node-width");
23
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
24
24
  var _style = require("../../ui/Renderer/style");
25
25
  var _tableCell = require("./tableCell");
26
26
  var _SmartCardStorage = require("../../ui/SmartCardStorage");
@@ -33,7 +33,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
33
33
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
34
34
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
35
35
  var isTableResizingEnabled = exports.isTableResizingEnabled = function isTableResizingEnabled(appearance) {
36
- return (0, _appearance.isFullWidthOrFullPageAppearance)(appearance) || (0, _appearance.isCommentAppearance)(appearance) && (0, _platformFeatureFlags.fg)('platform_editor_table_support_in_comment');
36
+ return (0, _appearance.isFullWidthOrFullPageAppearance)(appearance) || (0, _appearance.isCommentAppearance)(appearance) && (0, _experiments.editorExperiment)('support_table_in_comment', true, {
37
+ exposure: true
38
+ });
37
39
  };
38
40
  var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
39
41
  if (!tableOrderStatus || tableOrderStatus.order === _types.SortOrder.NO_ORDER) {
@@ -349,8 +351,21 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
349
351
  updatedLayout = layout;
350
352
  }
351
353
  var finalTableContainerWidth = allowTableResizing ? tableWidth : 'inherit';
352
- if (rendererAppearance === 'comment' && allowTableResizing) {
353
- finalTableContainerWidth = tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? tableWidth : 'inherit';
354
+ if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
355
+ // If table alignment is disabled and table width is akEditorDefaultLayoutWidth = 760,
356
+ // it is most likely a table created before "Support Table in Comments" FF was enabled
357
+ // and we would see a bug ED-24795. A table created before "Support Table in Comments",
358
+ // should inhirit the width of the renderer container.
359
+
360
+ // !NOTE: it a table resized to 760 is copied from 'full-page' editor and pasted in comment editor
361
+ // where (allowTableResizing && !allowTableAlignment), the table will loose 760px width.
362
+ finalTableContainerWidth = tableNode !== null && tableNode !== void 0 && tableNode.attrs.width && (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.width) !== _editorSharedStyles.akEditorDefaultLayoutWidth ? tableWidth : 'inherit';
363
+ }
364
+ if (rendererAppearance === 'comment' && allowTableResizing && allowTableAlignment) {
365
+ // If table alignment is enabled and layout is not 'align-start' or 'center', we are loading a table that was
366
+ // created before "Support Table in Comments" FF was enabled. So the table should have the same width as renderer container
367
+ // instead of 760 that was set on tableNode when the table had been published.
368
+ finalTableContainerWidth = ((tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'align-start' || (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'center') && tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? tableWidth : 'inherit';
354
369
  }
355
370
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
356
371
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -22,6 +22,9 @@ var _providerFactory = require("@atlaskit/editor-common/provider-factory");
22
22
  var _ui = require("@atlaskit/editor-common/ui");
23
23
  var _performanceMeasures = require("@atlaskit/editor-common/performance-measures");
24
24
  var _utils = require("@atlaskit/editor-common/utils");
25
+ var _measureRender = require("@atlaskit/editor-common/performance/measure-render");
26
+ var _browser = require("@atlaskit/editor-common/browser");
27
+ var _navigation = require("@atlaskit/editor-common/performance/navigation");
25
28
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
26
29
  var _normalizeFeatureFlags = require("@atlaskit/editor-common/normalize-feature-flags");
27
30
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
@@ -60,7 +63,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
60
63
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
61
64
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
62
65
  var packageName = "@atlaskit/renderer";
63
- var packageVersion = "109.51.5";
66
+ var packageVersion = "109.52.0";
64
67
  var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
65
68
  var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
66
69
  (0, _inherits2.default)(Renderer, _PureComponent);
@@ -73,7 +76,7 @@ var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
73
76
  * This is used in measuring the Renderer Mount time and is then
74
77
  * deleted once that measurement occurs.
75
78
  */
76
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderedMeasurementDistortedDurationMonitor", (0, _utils.getDistortedDurationMonitor)());
79
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderedMeasurementDistortedDurationMonitor", (0, _measureRender.getDistortedDurationMonitor)());
77
80
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "featureFlags", (0, _memoizeOne.default)(function (featureFlags) {
78
81
  var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(featureFlags, {
79
82
  objectFlagKeys: ['rendererRenderTracking']
@@ -105,10 +108,10 @@ var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
105
108
  });
106
109
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleMouseTripleClickInTables", function (event) {
107
110
  var _parentElement, _parentElement2;
108
- if (_utils.browser.ios || _utils.browser.android) {
111
+ if (_browser.browser.ios || _browser.browser.android) {
109
112
  return;
110
113
  }
111
- var badBrowser = _utils.browser.chrome || _utils.browser.safari;
114
+ var badBrowser = _browser.browser.chrome || _browser.browser.safari;
112
115
  var tripleClick = event.detail >= 3;
113
116
  if (!(badBrowser && tripleClick)) {
114
117
  return;
@@ -221,7 +224,7 @@ var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
221
224
  platform: _events.PLATFORM.WEB,
222
225
  duration: duration,
223
226
  distortedDuration: _this2.renderedMeasurementDistortedDurationMonitor.distortedDuration,
224
- ttfb: (0, _utils.getResponseEndTime)(),
227
+ ttfb: (0, _navigation.getResponseEndTime)(),
225
228
  nodes: (0, _traverse.reduce)(_this2.props.document, function (acc, node) {
226
229
  acc[node.type] = (acc[node.type] || 0) + 1;
227
230
  return acc;
@@ -31,10 +31,15 @@ const fixColumnWidth = (columnWidth, _tableWidth, _layoutWidth, zeroWidthColumns
31
31
  const calcScalePercent = ({
32
32
  renderWidth,
33
33
  tableWidth,
34
- maxScale
34
+ maxScale,
35
+ isNumberColumnEnabled
35
36
  }) => {
36
- const diffPercent = 1 - renderWidth / tableWidth;
37
- return diffPercent < maxScale ? diffPercent : maxScale;
37
+ const noNumColumnScalePercent = renderWidth / tableWidth;
38
+ // when numbered column is enabled, we need to calculate the scale percent without the akEditorTableNumberColumnWidth
39
+ // As numbered column width is not scaled down
40
+ const numColumnScalePercent = (renderWidth - akEditorTableNumberColumnWidth) / (tableWidth - akEditorTableNumberColumnWidth);
41
+ const diffPercent = 1 - noNumColumnScalePercent;
42
+ return diffPercent < maxScale ? isNumberColumnEnabled ? 1 - numColumnScalePercent : diffPercent : maxScale;
38
43
  };
39
44
  const colWidthSum = columnWidths => columnWidths.reduce((prev, curr) => curr + prev, 0);
40
45
  const renderScaleDownColgroup = props => {
@@ -54,8 +59,6 @@ const renderScaleDownColgroup = props => {
54
59
  if (!columnWidths) {
55
60
  return [];
56
61
  }
57
-
58
- // isTableColumnResized checks if table columns were resized
59
62
  const tableColumnResized = isTableColumnResized(columnWidths);
60
63
  const noOfColumns = columnWidths.length;
61
64
  let targetWidths;
@@ -138,7 +141,8 @@ const renderScaleDownColgroup = props => {
138
141
  scaleDownPercent = calcScalePercent({
139
142
  renderWidth,
140
143
  tableWidth,
141
- maxScale: shouldTable100ScaleDown ? 1 : maxScalingPercent
144
+ maxScale: shouldTable100ScaleDown ? 1 : maxScalingPercent,
145
+ isNumberColumnEnabled: isNumberColumnEnabled
142
146
  });
143
147
  }
144
148
  return targetWidths.map(colWidth => {
@@ -7,14 +7,16 @@ import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMerged
7
7
  import { SortOrder } from '@atlaskit/editor-common/types';
8
8
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
9
9
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
10
- import { fg } from '@atlaskit/platform-feature-flags';
10
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
11
  import { FullPagePadding } from '../../ui/Renderer/style';
12
12
  import { TableHeader } from './tableCell';
13
13
  import { withSmartCardStorage } from '../../ui/SmartCardStorage';
14
14
  import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
15
15
  import { Table } from './table/table';
16
16
  import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFullWidthOrFullPageAppearance } from '../utils/appearance';
17
- export const isTableResizingEnabled = appearance => isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance) && fg('platform_editor_table_support_in_comment');
17
+ export const isTableResizingEnabled = appearance => isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance) && editorExperiment('support_table_in_comment', true, {
18
+ exposure: true
19
+ });
18
20
  const orderChildren = (children, tableNode, smartCardStorage, tableOrderStatus) => {
19
21
  if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
20
22
  return children;
@@ -296,8 +298,21 @@ export class TableContainer extends React.Component {
296
298
  updatedLayout = layout;
297
299
  }
298
300
  let finalTableContainerWidth = allowTableResizing ? tableWidth : 'inherit';
299
- if (rendererAppearance === 'comment' && allowTableResizing) {
300
- finalTableContainerWidth = tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? tableWidth : 'inherit';
301
+ if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
302
+ // If table alignment is disabled and table width is akEditorDefaultLayoutWidth = 760,
303
+ // it is most likely a table created before "Support Table in Comments" FF was enabled
304
+ // and we would see a bug ED-24795. A table created before "Support Table in Comments",
305
+ // should inhirit the width of the renderer container.
306
+
307
+ // !NOTE: it a table resized to 760 is copied from 'full-page' editor and pasted in comment editor
308
+ // where (allowTableResizing && !allowTableAlignment), the table will loose 760px width.
309
+ finalTableContainerWidth = tableNode !== null && tableNode !== void 0 && tableNode.attrs.width && (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.width) !== akEditorDefaultLayoutWidth ? tableWidth : 'inherit';
310
+ }
311
+ if (rendererAppearance === 'comment' && allowTableResizing && allowTableAlignment) {
312
+ // If table alignment is enabled and layout is not 'align-start' or 'center', we are loading a table that was
313
+ // created before "Support Table in Comments" FF was enabled. So the table should have the same width as renderer container
314
+ // instead of 760 that was set on tableNode when the table had been published.
315
+ finalTableContainerWidth = ((tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'align-start' || (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'center') && tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? tableWidth : 'inherit';
301
316
  }
302
317
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
303
318
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -12,7 +12,10 @@ import { reduce } from '@atlaskit/adf-utils/traverse';
12
12
  import { ProviderFactory, ProviderFactoryProvider } from '@atlaskit/editor-common/provider-factory';
13
13
  import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
14
14
  import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
15
- import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, shouldForceTracking, measureTTI, getDistortedDurationMonitor, browser } from '@atlaskit/editor-common/utils';
15
+ import { getAnalyticsAppearance, getAnalyticsEventSeverity, shouldForceTracking, measureTTI } from '@atlaskit/editor-common/utils';
16
+ import { getDistortedDurationMonitor } from '@atlaskit/editor-common/performance/measure-render';
17
+ import { browser } from '@atlaskit/editor-common/browser';
18
+ import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
16
19
  import { fg } from '@atlaskit/platform-feature-flags';
17
20
  import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
18
21
  import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
@@ -42,7 +45,7 @@ import { nodeToReact } from '../../react/nodes';
42
45
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
43
46
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
44
47
  const packageName = "@atlaskit/renderer";
45
- const packageVersion = "109.51.5";
48
+ const packageVersion = "109.52.0";
46
49
  export const defaultNodeComponents = nodeToReact;
47
50
  export class Renderer extends PureComponent {
48
51
  constructor(props) {
@@ -36,9 +36,14 @@ var fixColumnWidth = function fixColumnWidth(columnWidth, _tableWidth, _layoutWi
36
36
  var calcScalePercent = function calcScalePercent(_ref) {
37
37
  var renderWidth = _ref.renderWidth,
38
38
  tableWidth = _ref.tableWidth,
39
- maxScale = _ref.maxScale;
40
- var diffPercent = 1 - renderWidth / tableWidth;
41
- return diffPercent < maxScale ? diffPercent : maxScale;
39
+ maxScale = _ref.maxScale,
40
+ isNumberColumnEnabled = _ref.isNumberColumnEnabled;
41
+ var noNumColumnScalePercent = renderWidth / tableWidth;
42
+ // when numbered column is enabled, we need to calculate the scale percent without the akEditorTableNumberColumnWidth
43
+ // As numbered column width is not scaled down
44
+ var numColumnScalePercent = (renderWidth - akEditorTableNumberColumnWidth) / (tableWidth - akEditorTableNumberColumnWidth);
45
+ var diffPercent = 1 - noNumColumnScalePercent;
46
+ return diffPercent < maxScale ? isNumberColumnEnabled ? 1 - numColumnScalePercent : diffPercent : maxScale;
42
47
  };
43
48
  var colWidthSum = function colWidthSum(columnWidths) {
44
49
  return columnWidths.reduce(function (prev, curr) {
@@ -60,8 +65,6 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
60
65
  if (!columnWidths) {
61
66
  return [];
62
67
  }
63
-
64
- // isTableColumnResized checks if table columns were resized
65
68
  var tableColumnResized = isTableColumnResized(columnWidths);
66
69
  var noOfColumns = columnWidths.length;
67
70
  var targetWidths;
@@ -144,7 +147,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
144
147
  scaleDownPercent = calcScalePercent({
145
148
  renderWidth: renderWidth,
146
149
  tableWidth: tableWidth,
147
- maxScale: shouldTable100ScaleDown ? 1 : maxScalingPercent
150
+ maxScale: shouldTable100ScaleDown ? 1 : maxScalingPercent,
151
+ isNumberColumnEnabled: isNumberColumnEnabled
148
152
  });
149
153
  }
150
154
  return targetWidths.map(function (colWidth) {
@@ -18,7 +18,7 @@ import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMerged
18
18
  import { SortOrder } from '@atlaskit/editor-common/types';
19
19
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
20
20
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
21
- import { fg } from '@atlaskit/platform-feature-flags';
21
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
22
22
  import { FullPagePadding } from '../../ui/Renderer/style';
23
23
  import { TableHeader } from './tableCell';
24
24
  import { withSmartCardStorage } from '../../ui/SmartCardStorage';
@@ -26,7 +26,9 @@ import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky'
26
26
  import { Table } from './table/table';
27
27
  import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFullWidthOrFullPageAppearance } from '../utils/appearance';
28
28
  export var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
29
- return isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance) && fg('platform_editor_table_support_in_comment');
29
+ return isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance) && editorExperiment('support_table_in_comment', true, {
30
+ exposure: true
31
+ });
30
32
  };
31
33
  var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
32
34
  if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
@@ -342,8 +344,21 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
342
344
  updatedLayout = layout;
343
345
  }
344
346
  var finalTableContainerWidth = allowTableResizing ? tableWidth : 'inherit';
345
- if (rendererAppearance === 'comment' && allowTableResizing) {
346
- finalTableContainerWidth = tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? tableWidth : 'inherit';
347
+ if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
348
+ // If table alignment is disabled and table width is akEditorDefaultLayoutWidth = 760,
349
+ // it is most likely a table created before "Support Table in Comments" FF was enabled
350
+ // and we would see a bug ED-24795. A table created before "Support Table in Comments",
351
+ // should inhirit the width of the renderer container.
352
+
353
+ // !NOTE: it a table resized to 760 is copied from 'full-page' editor and pasted in comment editor
354
+ // where (allowTableResizing && !allowTableAlignment), the table will loose 760px width.
355
+ finalTableContainerWidth = tableNode !== null && tableNode !== void 0 && tableNode.attrs.width && (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.width) !== akEditorDefaultLayoutWidth ? tableWidth : 'inherit';
356
+ }
357
+ if (rendererAppearance === 'comment' && allowTableResizing && allowTableAlignment) {
358
+ // If table alignment is enabled and layout is not 'align-start' or 'center', we are loading a table that was
359
+ // created before "Support Table in Comments" FF was enabled. So the table should have the same width as renderer container
360
+ // instead of 760 that was set on tableNode when the table had been published.
361
+ finalTableContainerWidth = ((tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'align-start' || (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout) === 'center') && tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? tableWidth : 'inherit';
347
362
  }
348
363
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
349
364
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -22,7 +22,10 @@ import { reduce } from '@atlaskit/adf-utils/traverse';
22
22
  import { ProviderFactory, ProviderFactoryProvider } from '@atlaskit/editor-common/provider-factory';
23
23
  import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
24
24
  import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
25
- import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, shouldForceTracking, measureTTI, getDistortedDurationMonitor, browser } from '@atlaskit/editor-common/utils';
25
+ import { getAnalyticsAppearance, getAnalyticsEventSeverity, shouldForceTracking, measureTTI } from '@atlaskit/editor-common/utils';
26
+ import { getDistortedDurationMonitor } from '@atlaskit/editor-common/performance/measure-render';
27
+ import { browser } from '@atlaskit/editor-common/browser';
28
+ import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
26
29
  import { fg } from '@atlaskit/platform-feature-flags';
27
30
  import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
28
31
  import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
@@ -52,7 +55,7 @@ import { nodeToReact } from '../../react/nodes';
52
55
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
53
56
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
54
57
  var packageName = "@atlaskit/renderer";
55
- var packageVersion = "109.51.5";
58
+ var packageVersion = "109.52.0";
56
59
  export var defaultNodeComponents = nodeToReact;
57
60
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
58
61
  _inherits(Renderer, _PureComponent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "109.51.5",
3
+ "version": "109.52.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,15 +29,15 @@
29
29
  "@atlaskit/analytics-next": "^10.1.0",
30
30
  "@atlaskit/button": "^20.1.0",
31
31
  "@atlaskit/code": "^15.6.0",
32
- "@atlaskit/editor-common": "^88.8.0",
32
+ "@atlaskit/editor-common": "^88.11.0",
33
33
  "@atlaskit/editor-json-transformer": "^8.18.0",
34
34
  "@atlaskit/editor-palette": "1.6.0",
35
35
  "@atlaskit/editor-prosemirror": "5.0.1",
36
36
  "@atlaskit/editor-shared-styles": "^2.13.0",
37
37
  "@atlaskit/emoji": "^67.7.0",
38
38
  "@atlaskit/feature-gate-js-client": "^4.18.0",
39
- "@atlaskit/icon": "^22.15.0",
40
- "@atlaskit/link-datasource": "^2.11.0",
39
+ "@atlaskit/icon": "^22.16.0",
40
+ "@atlaskit/link-datasource": "^2.12.0",
41
41
  "@atlaskit/media-card": "^78.2.0",
42
42
  "@atlaskit/media-client": "^27.6.0",
43
43
  "@atlaskit/media-client-react": "^2.2.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/media-ui": "^25.11.0",
47
47
  "@atlaskit/media-viewer": "^48.7.0",
48
48
  "@atlaskit/platform-feature-flags": "^0.3.0",
49
- "@atlaskit/smart-card": "^27.19.0",
49
+ "@atlaskit/smart-card": "^27.20.0",
50
50
  "@atlaskit/status": "^1.4.0",
51
51
  "@atlaskit/task-decision": "^17.10.0",
52
52
  "@atlaskit/theme": "^13.0.0",
@@ -72,7 +72,7 @@
72
72
  "@af/visual-regression": "*",
73
73
  "@atlaskit/analytics-gas-types": "^5.1.0",
74
74
  "@atlaskit/css-reset": "^6.10.0",
75
- "@atlaskit/editor-test-helpers": "^18.32.0",
75
+ "@atlaskit/editor-test-helpers": "^18.33.0",
76
76
  "@atlaskit/link-provider": "^1.14.0",
77
77
  "@atlaskit/link-test-helpers": "^7.5.0",
78
78
  "@atlaskit/linking-common": "^5.11.0",
@@ -128,9 +128,6 @@
128
128
  "platform.editor.inline_extension.extended_lcqdn": {
129
129
  "type": "boolean"
130
130
  },
131
- "platform_editor_table_support_in_comment": {
132
- "type": "boolean"
133
- },
134
131
  "editor_inline_comments_on_inline_nodes": {
135
132
  "type": "boolean"
136
133
  },