@atlaskit/renderer 110.4.0 → 110.4.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,14 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 110.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#143055](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/143055)
8
+ [`a596a018303f2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a596a018303f2) -
9
+ [ux] Use 40 as max scaling percent in comment renderer when Table scaling is enabled in Comment
10
+ Renderer
11
+
3
12
  ## 110.4.0
4
13
 
5
14
  ### Minor Changes
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _styles = require("@atlaskit/editor-common/styles");
11
11
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
12
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
13
  var _nodeWidth = require("@atlaskit/editor-common/node-width");
13
14
  var _useFeatureFlags = require("../../../use-feature-flags");
14
15
  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; }
@@ -138,7 +139,7 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
138
139
  var scaleDownPercent = 0;
139
140
  var isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
140
141
  var isTableWidthFixed = isTableScalingWithFixedColumnWidthsOptionEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
141
- var maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
142
+ var maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || isTableScalingEnabled && rendererAppearance === 'comment' ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
142
143
 
143
144
  // fixes migration tables with zero-width columns
144
145
  if (zeroWidthColumnsCount > 0) {
@@ -173,8 +174,10 @@ var Colgroup = exports.Colgroup = function Colgroup(props) {
173
174
  return null;
174
175
  }
175
176
  var colStyles = renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
176
- isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth),
177
- isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption)
177
+ isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth) || props.rendererAppearance === 'comment' && (0, _experiments.editorExperiment)('support_table_in_comment', true, {
178
+ exposure: true
179
+ }),
180
+ isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption) && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width')
178
181
  }));
179
182
  if (!colStyles) {
180
183
  return null;
@@ -63,7 +63,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
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 = "110.4.0";
66
+ var packageVersion = "110.4.1";
67
67
  var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
68
68
  var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
69
69
  (0, _inherits2.default)(Renderer, _PureComponent);
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
3
3
  import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth } from '@atlaskit/editor-shared-styles';
4
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
5
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
5
6
  import { useFeatureFlags } from '../../../use-feature-flags';
6
7
  // we allow scaling down column widths by no more than 30%
@@ -125,7 +126,7 @@ const renderScaleDownColgroup = props => {
125
126
  let scaleDownPercent = 0;
126
127
  const isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
127
128
  const isTableWidthFixed = isTableScalingWithFixedColumnWidthsOptionEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
128
- const maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
129
+ const maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || isTableScalingEnabled && rendererAppearance === 'comment' ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
129
130
 
130
131
  // fixes migration tables with zero-width columns
131
132
  if (zeroWidthColumnsCount > 0) {
@@ -163,8 +164,10 @@ export const Colgroup = props => {
163
164
  }
164
165
  const colStyles = renderScaleDownColgroup({
165
166
  ...props,
166
- isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth),
167
- isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption)
167
+ isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth) || props.rendererAppearance === 'comment' && editorExperiment('support_table_in_comment', true, {
168
+ exposure: true
169
+ }),
170
+ isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption) && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width')
168
171
  });
169
172
  if (!colStyles) {
170
173
  return null;
@@ -45,7 +45,7 @@ import { nodeToReact } from '../../react/nodes';
45
45
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
46
46
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
47
47
  const packageName = "@atlaskit/renderer";
48
- const packageVersion = "110.4.0";
48
+ const packageVersion = "110.4.1";
49
49
  export const defaultNodeComponents = nodeToReact;
50
50
  export class Renderer extends PureComponent {
51
51
  constructor(props) {
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import React from 'react';
5
5
  import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
6
6
  import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth } from '@atlaskit/editor-shared-styles';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
8
9
  import { useFeatureFlags } from '../../../use-feature-flags';
9
10
  // we allow scaling down column widths by no more than 30%
@@ -131,7 +132,7 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
131
132
  var scaleDownPercent = 0;
132
133
  var isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
133
134
  var isTableWidthFixed = isTableScalingWithFixedColumnWidthsOptionEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
134
- var maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
135
+ var maxScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || isTableScalingEnabled && rendererAppearance === 'comment' ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
135
136
 
136
137
  // fixes migration tables with zero-width columns
137
138
  if (zeroWidthColumnsCount > 0) {
@@ -166,8 +167,10 @@ export var Colgroup = function Colgroup(props) {
166
167
  return null;
167
168
  }
168
169
  var colStyles = renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
169
- isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth),
170
- isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption)
170
+ isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth) || props.rendererAppearance === 'comment' && editorExperiment('support_table_in_comment', true, {
171
+ exposure: true
172
+ }),
173
+ isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption) && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width')
171
174
  }));
172
175
  if (!colStyles) {
173
176
  return null;
@@ -55,7 +55,7 @@ import { nodeToReact } from '../../react/nodes';
55
55
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
56
56
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
57
57
  var packageName = "@atlaskit/renderer";
58
- var packageVersion = "110.4.0";
58
+ var packageVersion = "110.4.1";
59
59
  export var defaultNodeComponents = nodeToReact;
60
60
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
61
61
  _inherits(Renderer, _PureComponent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "110.4.0",
3
+ "version": "110.4.1",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"