@atlaskit/renderer 124.16.1 → 124.16.3
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 +17 -0
- package/dist/cjs/react/nodes/table/colgroup.js +2 -2
- package/dist/cjs/react/nodes/table.js +9 -4
- package/dist/cjs/react/nodes/tableNew.js +8 -4
- package/dist/cjs/react/utils/appearance.js +5 -2
- package/dist/cjs/ui/Expand.js +3 -1
- package/dist/cjs/ui/Renderer/index.js +6 -1
- package/dist/es2019/react/nodes/table/colgroup.js +2 -2
- package/dist/es2019/react/nodes/table.js +11 -6
- package/dist/es2019/react/nodes/tableNew.js +10 -6
- package/dist/es2019/react/utils/appearance.js +2 -1
- package/dist/es2019/ui/Expand.js +3 -1
- package/dist/es2019/ui/Renderer/index.js +6 -1
- package/dist/esm/react/nodes/table/colgroup.js +2 -2
- package/dist/esm/react/nodes/table.js +11 -6
- package/dist/esm/react/nodes/tableNew.js +10 -6
- package/dist/esm/react/utils/appearance.js +4 -1
- package/dist/esm/ui/Expand.js +3 -1
- package/dist/esm/ui/Renderer/index.js +6 -1
- package/dist/types/react/utils/appearance.d.ts +2 -1
- package/dist/types-ts4.5/react/utils/appearance.d.ts +2 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 124.16.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`be08843fca604`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/be08843fca604) -
|
|
8
|
+
[EDITOR-3389] Make sure that renderer falls back to 'full-width' if the appearance is 'max' and
|
|
9
|
+
the experiment is off
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 124.16.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`d3461a5b84b81`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d3461a5b84b81) -
|
|
17
|
+
Suppress i18n errors
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 124.16.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -234,12 +234,12 @@ var Colgroup = exports.Colgroup = function Colgroup(props) {
|
|
|
234
234
|
}
|
|
235
235
|
var colStyles = renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
|
|
236
236
|
isTopLevelRenderer: isTopLevelRenderer,
|
|
237
|
-
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'comment' && (0, _experiments.editorExperiment)('support_table_in_comment', true, {
|
|
237
|
+
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' && (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || props.rendererAppearance === 'comment' && (0, _experiments.editorExperiment)('support_table_in_comment', true, {
|
|
238
238
|
exposure: true
|
|
239
239
|
}) || props.rendererAppearance === 'comment' && (0, _experiments.editorExperiment)('support_table_in_comment_jira', true, {
|
|
240
240
|
exposure: true
|
|
241
241
|
}),
|
|
242
|
-
isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption) && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width')
|
|
242
|
+
isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption) && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' && (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true))
|
|
243
243
|
}));
|
|
244
244
|
if (!colStyles) {
|
|
245
245
|
return null;
|
|
@@ -32,6 +32,7 @@ var _table = require("./table/table");
|
|
|
32
32
|
var _appearance = require("../utils/appearance");
|
|
33
33
|
var _TableStickyScrollbar = require("./TableStickyScrollbar");
|
|
34
34
|
var _tableNew = require("./tableNew");
|
|
35
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
35
36
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
36
37
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
37
38
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -432,6 +433,8 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
432
433
|
var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode) {
|
|
433
434
|
if (rendererAppearance === 'full-width' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
434
435
|
return [isRenderWidthValid ? Math.min(_editorSharedStyles.akEditorFullWidthLayoutWidth, renderWidth) : _editorSharedStyles.akEditorFullWidthLayoutWidth, "min(".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")")];
|
|
436
|
+
} else if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
437
|
+
return [isRenderWidthValid ? Math.min(_editorSharedStyles.akEditorMaxWidthLayoutWidth, renderWidth) : _editorSharedStyles.akEditorMaxWidthLayoutWidth, "min(".concat(_editorSharedStyles.akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")")];
|
|
435
438
|
} else if (rendererAppearance === 'comment' && allowTableResizing && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
436
439
|
var tableContainerWidth = (0, _nodeWidth.getTableContainerWidth)(tableNode);
|
|
437
440
|
return [isRenderWidthValid ? renderWidth : tableContainerWidth, renderWidthCSS];
|
|
@@ -450,15 +453,17 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
450
453
|
var isTableAlignStart = tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && allowTableAlignment;
|
|
451
454
|
var fullWidthLineLength = isRenderWidthValid ? Math.min(_editorSharedStyles.akEditorFullWidthLayoutWidth, renderWidth) : _editorSharedStyles.akEditorFullWidthLayoutWidth;
|
|
452
455
|
var fullWidthLineLengthCSS = "min(".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
456
|
+
var maxWidthLineLength = isRenderWidthValid ? Math.min(_editorSharedStyles.akEditorMaxWidthLayoutWidth, renderWidth) : _editorSharedStyles.akEditorMaxWidthLayoutWidth;
|
|
457
|
+
var maxWidthLineLengthCSS = "min(".concat(_editorSharedStyles.akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
453
458
|
var commentLineLength = isRenderWidthValid ? renderWidth : lineLengthFixedWidth;
|
|
454
459
|
var isCommentAppearanceAndTableAlignmentEnabled = (0, _appearance.isCommentAppearance)(rendererAppearance) && allowTableAlignment;
|
|
455
|
-
var lineLength = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
|
|
456
|
-
var lineLengthCSS = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
460
|
+
var lineLength = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLength : (0, _appearance.isMaxWidthAppearance)(rendererAppearance) && (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) ? maxWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
|
|
461
|
+
var lineLengthCSS = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLengthCSS : (0, _appearance.isMaxWidthAppearance)(rendererAppearance) && (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) ? maxWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
457
462
|
|
|
458
463
|
// Setting fixTableSSRResizing to false while FG logic is true in tableNew
|
|
459
464
|
var fixTableSSRResizing = false;
|
|
460
465
|
var tableWidthNew = fixTableSSRResizing ? (0, _nodeWidth.getTableContainerWidth)(tableNode) : tableWidth;
|
|
461
|
-
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && ((0, _appearance.isFullPageAppearance)(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || (0, _appearance.isFullWidthAppearance)(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
466
|
+
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && ((0, _appearance.isFullPageAppearance)(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || (0, _appearance.isFullWidthAppearance)(rendererAppearance) || (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) && (0, _appearance.isMaxWidthAppearance)(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
462
467
|
var leftCSS;
|
|
463
468
|
if (shouldCalculateLeftForAlignment) {
|
|
464
469
|
left = (tableWidth - lineLength) / 2;
|
|
@@ -494,7 +499,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
494
499
|
// We can only use CSS to determine the width when we have a known width in container.
|
|
495
500
|
// When appearance is full-page, full-width or comment we use CSS based width calculation.
|
|
496
501
|
// Otherwise it's fixed table width (customized width) or inherit.
|
|
497
|
-
if ((rendererAppearance === 'full-page' || rendererAppearance === 'full-width') && fixTableSSRResizing) {
|
|
502
|
+
if ((rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max') && fixTableSSRResizing) {
|
|
498
503
|
finalTableContainerWidth = allowTableResizing ? "calc(".concat(tableWidthCSS, ")") : 'inherit';
|
|
499
504
|
}
|
|
500
505
|
if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
|
|
@@ -25,6 +25,7 @@ var _sticky = require("./table/sticky");
|
|
|
25
25
|
var _table = require("./table/table");
|
|
26
26
|
var _appearance = require("../utils/appearance");
|
|
27
27
|
var _TableStickyScrollbar = require("./TableStickyScrollbar");
|
|
28
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
28
29
|
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; }
|
|
29
30
|
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; }
|
|
30
31
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
@@ -404,7 +405,9 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
404
405
|
}) ? 'calc(100cqw - var(--ak-renderer--full-page-gutter) * 2)' : "100cqw - ".concat(_style.FullPagePadding, "px * 2");
|
|
405
406
|
var renderWidthCSS = rendererAppearance === 'full-page' ? fullPageRendererWidthCSS : "100cqw";
|
|
406
407
|
var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode) {
|
|
407
|
-
if (rendererAppearance === '
|
|
408
|
+
if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width) && (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true)) {
|
|
409
|
+
return "min(".concat(_editorSharedStyles.akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
410
|
+
} else if (rendererAppearance === 'full-width' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
408
411
|
return "min(".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
409
412
|
} else if (rendererAppearance === 'comment' && allowTableResizing && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
410
413
|
return renderWidthCSS;
|
|
@@ -419,10 +422,11 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
419
422
|
// Logic for table alignment in renderer
|
|
420
423
|
var isTableAlignStart = tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && allowTableAlignment;
|
|
421
424
|
var fullWidthLineLengthCSS = "min(".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
425
|
+
var maxWidthLineLengthCSS = "min(".concat(_editorSharedStyles.akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
422
426
|
var isCommentAppearanceAndTableAlignmentEnabled = (0, _appearance.isCommentAppearance)(rendererAppearance) && allowTableAlignment;
|
|
423
|
-
var lineLengthCSS = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
427
|
+
var lineLengthCSS = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLengthCSS : (0, _appearance.isMaxWidthAppearance)(rendererAppearance) && (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) ? maxWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
424
428
|
var tableWidthNew = (0, _nodeWidth.getTableContainerWidth)(tableNode);
|
|
425
|
-
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && ((0, _appearance.isFullPageAppearance)(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || (0, _appearance.isFullWidthAppearance)(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
429
|
+
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && ((0, _appearance.isFullPageAppearance)(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || (0, _appearance.isFullWidthAppearance)(rendererAppearance) || (0, _appearance.isMaxWidthAppearance)(rendererAppearance) && (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
426
430
|
var leftCSS;
|
|
427
431
|
if (shouldCalculateLeftForAlignment) {
|
|
428
432
|
leftCSS = "(".concat(tableWidthCSS, " - ").concat(lineLengthCSS, ") / 2");
|
|
@@ -451,7 +455,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
451
455
|
// We can only use CSS to determine the width when we have a known width in container.
|
|
452
456
|
// When appearance is full-page, full-width or comment we use CSS based width calculation.
|
|
453
457
|
// Otherwise it's fixed table width (customized width) or inherit.
|
|
454
|
-
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width') {
|
|
458
|
+
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max' && (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true)) {
|
|
455
459
|
finalTableContainerWidth = allowTableResizing ? "calc(".concat(tableWidthCSS, ")") : 'inherit';
|
|
456
460
|
}
|
|
457
461
|
if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isFullWidthOrFullPageAppearance = exports.isFullWidthAppearance = exports.isFullPageAppearance = exports.isCommentAppearance = void 0;
|
|
6
|
+
exports.isMaxWidthAppearance = exports.isFullWidthOrFullPageAppearance = exports.isFullWidthAppearance = exports.isFullPageAppearance = exports.isCommentAppearance = void 0;
|
|
7
7
|
var isFullWidthAppearance = exports.isFullWidthAppearance = function isFullWidthAppearance(appearance) {
|
|
8
8
|
return appearance === 'full-width';
|
|
9
9
|
};
|
|
10
|
+
var isMaxWidthAppearance = exports.isMaxWidthAppearance = function isMaxWidthAppearance(appearance) {
|
|
11
|
+
return appearance === 'max';
|
|
12
|
+
};
|
|
10
13
|
var isFullPageAppearance = exports.isFullPageAppearance = function isFullPageAppearance(appearance) {
|
|
11
14
|
return appearance === 'full-page';
|
|
12
15
|
};
|
|
@@ -14,5 +17,5 @@ var isCommentAppearance = exports.isCommentAppearance = function isCommentAppear
|
|
|
14
17
|
return appearance === 'comment';
|
|
15
18
|
};
|
|
16
19
|
var isFullWidthOrFullPageAppearance = exports.isFullWidthOrFullPageAppearance = function isFullWidthOrFullPageAppearance(appearance) {
|
|
17
|
-
return isFullPageAppearance(appearance) || isFullWidthAppearance(appearance);
|
|
20
|
+
return isFullPageAppearance(appearance) || isFullWidthAppearance(appearance) || isMaxWidthAppearance(appearance);
|
|
18
21
|
};
|
package/dist/cjs/ui/Expand.js
CHANGED
|
@@ -294,7 +294,9 @@ function Expand(_ref2) {
|
|
|
294
294
|
className: "".concat(nodeType, "-content-wrapper")
|
|
295
295
|
}, (0, _react.jsx)(_ui.WidthProvider, null, (0, _react.jsx)("div", {
|
|
296
296
|
css: clearNextSiblingMarginTopStyle
|
|
297
|
-
}), (0, _platformFeatureFlags.fg)('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ?
|
|
297
|
+
}), (0, _platformFeatureFlags.fg)('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ?
|
|
298
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
|
|
299
|
+
(0, _react.jsx)(_react2.Suspense, {
|
|
298
300
|
fallback: (0, _react.jsx)("div", null, "Loading...")
|
|
299
301
|
}, (0, _react.jsx)(LazyChildren, null, children)) : null : children))));
|
|
300
302
|
}
|
|
@@ -69,7 +69,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
69
69
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
70
70
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
71
71
|
var packageName = "@atlaskit/renderer";
|
|
72
|
-
var packageVersion = "
|
|
72
|
+
var packageVersion = "124.16.2";
|
|
73
73
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
74
74
|
containerName: 'ak-renderer-wrapper',
|
|
75
75
|
containerType: 'inline-size'
|
|
@@ -780,6 +780,11 @@ var RendererWithAnnotationSelection = function RendererWithAnnotationSelection(p
|
|
|
780
780
|
adfDocument = props.document;
|
|
781
781
|
var localRef = _react.default.useRef(null);
|
|
782
782
|
var innerRef = props.innerRef || localRef;
|
|
783
|
+
|
|
784
|
+
// @see https://hello.jira.atlassian.cloud/browse/EDITOR-3389
|
|
785
|
+
if (props.appearance === 'max' && (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', false)) {
|
|
786
|
+
props.appearance = 'full-width';
|
|
787
|
+
}
|
|
783
788
|
if (!allowAnnotations) {
|
|
784
789
|
// Ignored via go/ees005
|
|
785
790
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -223,12 +223,12 @@ export const Colgroup = props => {
|
|
|
223
223
|
const colStyles = renderScaleDownColgroup({
|
|
224
224
|
...props,
|
|
225
225
|
isTopLevelRenderer,
|
|
226
|
-
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'comment' && editorExperiment('support_table_in_comment', true, {
|
|
226
|
+
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || props.rendererAppearance === 'comment' && editorExperiment('support_table_in_comment', true, {
|
|
227
227
|
exposure: true
|
|
228
228
|
}) || props.rendererAppearance === 'comment' && editorExperiment('support_table_in_comment_jira', true, {
|
|
229
229
|
exposure: true
|
|
230
230
|
}),
|
|
231
|
-
isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption) && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width')
|
|
231
|
+
isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption) && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true))
|
|
232
232
|
});
|
|
233
233
|
if (!colStyles) {
|
|
234
234
|
return null;
|
|
@@ -8,7 +8,7 @@ import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
|
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
11
|
-
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
11
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorMaxWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
12
12
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
13
13
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
14
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
@@ -16,9 +16,10 @@ import { TableHeader } from './tableCell';
|
|
|
16
16
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
17
17
|
import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
|
|
18
18
|
import { Table } from './table/table';
|
|
19
|
-
import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFullWidthOrFullPageAppearance } from '../utils/appearance';
|
|
19
|
+
import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFullWidthOrFullPageAppearance, isMaxWidthAppearance } from '../utils/appearance';
|
|
20
20
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
21
21
|
import { TableProcessorWithContainerStyles } from './tableNew';
|
|
22
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
22
23
|
export const isTableResizingEnabled = appearance => isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance) && editorExperiment('support_table_in_comment', true, {
|
|
23
24
|
exposure: true
|
|
24
25
|
});
|
|
@@ -378,6 +379,8 @@ export class TableContainer extends React.Component {
|
|
|
378
379
|
const calcDefaultLayoutWidthByAppearance = (rendererAppearance, tableNode) => {
|
|
379
380
|
if (rendererAppearance === 'full-width' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
380
381
|
return [isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth, `min(${akEditorFullWidthLayoutWidth}px, ${renderWidthCSS})`];
|
|
382
|
+
} else if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
383
|
+
return [isRenderWidthValid ? Math.min(akEditorMaxWidthLayoutWidth, renderWidth) : akEditorMaxWidthLayoutWidth, `min(${akEditorMaxWidthLayoutWidth}px, ${renderWidthCSS})`];
|
|
381
384
|
} else if (rendererAppearance === 'comment' && allowTableResizing && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
382
385
|
const tableContainerWidth = getTableContainerWidth(tableNode);
|
|
383
386
|
return [isRenderWidthValid ? renderWidth : tableContainerWidth, renderWidthCSS];
|
|
@@ -393,15 +396,17 @@ export class TableContainer extends React.Component {
|
|
|
393
396
|
const isTableAlignStart = tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && allowTableAlignment;
|
|
394
397
|
const fullWidthLineLength = isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth;
|
|
395
398
|
const fullWidthLineLengthCSS = `min(${akEditorFullWidthLayoutWidth}px, ${renderWidthCSS})`;
|
|
399
|
+
const maxWidthLineLength = isRenderWidthValid ? Math.min(akEditorMaxWidthLayoutWidth, renderWidth) : akEditorMaxWidthLayoutWidth;
|
|
400
|
+
const maxWidthLineLengthCSS = `min(${akEditorMaxWidthLayoutWidth}px, ${renderWidthCSS})`;
|
|
396
401
|
const commentLineLength = isRenderWidthValid ? renderWidth : lineLengthFixedWidth;
|
|
397
402
|
const isCommentAppearanceAndTableAlignmentEnabled = isCommentAppearance(rendererAppearance) && allowTableAlignment;
|
|
398
|
-
const lineLength = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
|
|
399
|
-
const lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : `${lineLengthFixedWidth}px`;
|
|
403
|
+
const lineLength = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLength : isMaxWidthAppearance(rendererAppearance) && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) ? maxWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
|
|
404
|
+
const lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isMaxWidthAppearance(rendererAppearance) && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) ? maxWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : `${lineLengthFixedWidth}px`;
|
|
400
405
|
|
|
401
406
|
// Setting fixTableSSRResizing to false while FG logic is true in tableNew
|
|
402
407
|
const fixTableSSRResizing = false;
|
|
403
408
|
const tableWidthNew = fixTableSSRResizing ? getTableContainerWidth(tableNode) : tableWidth;
|
|
404
|
-
const shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
409
|
+
const shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) && isMaxWidthAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
405
410
|
let leftCSS;
|
|
406
411
|
if (shouldCalculateLeftForAlignment) {
|
|
407
412
|
left = (tableWidth - lineLength) / 2;
|
|
@@ -437,7 +442,7 @@ export class TableContainer extends React.Component {
|
|
|
437
442
|
// We can only use CSS to determine the width when we have a known width in container.
|
|
438
443
|
// When appearance is full-page, full-width or comment we use CSS based width calculation.
|
|
439
444
|
// Otherwise it's fixed table width (customized width) or inherit.
|
|
440
|
-
if ((rendererAppearance === 'full-page' || rendererAppearance === 'full-width') && fixTableSSRResizing) {
|
|
445
|
+
if ((rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max') && fixTableSSRResizing) {
|
|
441
446
|
finalTableContainerWidth = allowTableResizing ? `calc(${tableWidthCSS})` : 'inherit';
|
|
442
447
|
}
|
|
443
448
|
if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
|
|
@@ -7,13 +7,14 @@ import { FullPagePadding } from '../../ui/Renderer/style';
|
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
8
|
import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
10
|
-
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
10
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorMaxWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
11
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
12
|
import { TableHeader } from './tableCell';
|
|
13
13
|
import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
|
|
14
14
|
import { Table } from './table/table';
|
|
15
|
-
import { isCommentAppearance, isFullWidthOrFullPageAppearance, isFullWidthAppearance, isFullPageAppearance } from '../utils/appearance';
|
|
15
|
+
import { isCommentAppearance, isFullWidthOrFullPageAppearance, isFullWidthAppearance, isMaxWidthAppearance, isFullPageAppearance } from '../utils/appearance';
|
|
16
16
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
17
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
18
|
const stickyContainerBaseStyles = {
|
|
18
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
19
20
|
height: "var(--ds-space-250, 20px)",
|
|
@@ -348,7 +349,9 @@ export class TableContainer extends React.Component {
|
|
|
348
349
|
}) ? 'calc(100cqw - var(--ak-renderer--full-page-gutter) * 2)' : `100cqw - ${FullPagePadding}px * 2`;
|
|
349
350
|
const renderWidthCSS = rendererAppearance === 'full-page' ? fullPageRendererWidthCSS : `100cqw`;
|
|
350
351
|
const calcDefaultLayoutWidthByAppearance = (rendererAppearance, tableNode) => {
|
|
351
|
-
if (rendererAppearance === '
|
|
352
|
+
if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width) && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true)) {
|
|
353
|
+
return `min(${akEditorMaxWidthLayoutWidth}px, ${renderWidthCSS})`;
|
|
354
|
+
} else if (rendererAppearance === 'full-width' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
352
355
|
return `min(${akEditorFullWidthLayoutWidth}px, ${renderWidthCSS})`;
|
|
353
356
|
} else if (rendererAppearance === 'comment' && allowTableResizing && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
354
357
|
return renderWidthCSS;
|
|
@@ -363,10 +366,11 @@ export class TableContainer extends React.Component {
|
|
|
363
366
|
// Logic for table alignment in renderer
|
|
364
367
|
const isTableAlignStart = tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && allowTableAlignment;
|
|
365
368
|
const fullWidthLineLengthCSS = `min(${akEditorFullWidthLayoutWidth}px, ${renderWidthCSS})`;
|
|
369
|
+
const maxWidthLineLengthCSS = `min(${akEditorMaxWidthLayoutWidth}px, ${renderWidthCSS})`;
|
|
366
370
|
const isCommentAppearanceAndTableAlignmentEnabled = isCommentAppearance(rendererAppearance) && allowTableAlignment;
|
|
367
|
-
const lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : `${lineLengthFixedWidth}px`;
|
|
371
|
+
const lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isMaxWidthAppearance(rendererAppearance) && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) ? maxWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : `${lineLengthFixedWidth}px`;
|
|
368
372
|
const tableWidthNew = getTableContainerWidth(tableNode);
|
|
369
|
-
const shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
373
|
+
const shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || isMaxWidthAppearance(rendererAppearance) && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
370
374
|
let leftCSS;
|
|
371
375
|
if (shouldCalculateLeftForAlignment) {
|
|
372
376
|
leftCSS = `(${tableWidthCSS} - ${lineLengthCSS}) / 2`;
|
|
@@ -395,7 +399,7 @@ export class TableContainer extends React.Component {
|
|
|
395
399
|
// We can only use CSS to determine the width when we have a known width in container.
|
|
396
400
|
// When appearance is full-page, full-width or comment we use CSS based width calculation.
|
|
397
401
|
// Otherwise it's fixed table width (customized width) or inherit.
|
|
398
|
-
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width') {
|
|
402
|
+
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max' && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true)) {
|
|
399
403
|
finalTableContainerWidth = allowTableResizing ? `calc(${tableWidthCSS})` : 'inherit';
|
|
400
404
|
}
|
|
401
405
|
if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const isFullWidthAppearance = appearance => appearance === 'full-width';
|
|
2
|
+
export const isMaxWidthAppearance = appearance => appearance === 'max';
|
|
2
3
|
export const isFullPageAppearance = appearance => appearance === 'full-page';
|
|
3
4
|
export const isCommentAppearance = appearance => appearance === 'comment';
|
|
4
|
-
export const isFullWidthOrFullPageAppearance = appearance => isFullPageAppearance(appearance) || isFullWidthAppearance(appearance);
|
|
5
|
+
export const isFullWidthOrFullPageAppearance = appearance => isFullPageAppearance(appearance) || isFullWidthAppearance(appearance) || isMaxWidthAppearance(appearance);
|
package/dist/es2019/ui/Expand.js
CHANGED
|
@@ -274,7 +274,9 @@ function Expand({
|
|
|
274
274
|
className: `${nodeType}-content-wrapper`
|
|
275
275
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
276
276
|
css: clearNextSiblingMarginTopStyle
|
|
277
|
-
}), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ?
|
|
277
|
+
}), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ?
|
|
278
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
|
|
279
|
+
jsx(Suspense, {
|
|
278
280
|
fallback: jsx("div", null, "Loading...")
|
|
279
281
|
}, jsx(LazyChildren, null, children)) : null : children))));
|
|
280
282
|
}
|
|
@@ -55,7 +55,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
55
55
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
56
56
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
57
57
|
const packageName = "@atlaskit/renderer";
|
|
58
|
-
const packageVersion = "
|
|
58
|
+
const packageVersion = "124.16.2";
|
|
59
59
|
const setAsQueryContainerStyles = css({
|
|
60
60
|
containerName: 'ak-renderer-wrapper',
|
|
61
61
|
containerType: 'inline-size'
|
|
@@ -767,6 +767,11 @@ const RendererWithAnnotationSelection = props => {
|
|
|
767
767
|
} = props;
|
|
768
768
|
const localRef = React.useRef(null);
|
|
769
769
|
const innerRef = props.innerRef || localRef;
|
|
770
|
+
|
|
771
|
+
// @see https://hello.jira.atlassian.cloud/browse/EDITOR-3389
|
|
772
|
+
if (props.appearance === 'max' && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', false)) {
|
|
773
|
+
props.appearance = 'full-width';
|
|
774
|
+
}
|
|
770
775
|
if (!allowAnnotations) {
|
|
771
776
|
// Ignored via go/ees005
|
|
772
777
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -228,12 +228,12 @@ export var Colgroup = function Colgroup(props) {
|
|
|
228
228
|
}
|
|
229
229
|
var colStyles = renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
|
|
230
230
|
isTopLevelRenderer: isTopLevelRenderer,
|
|
231
|
-
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'comment' && editorExperiment('support_table_in_comment', true, {
|
|
231
|
+
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || props.rendererAppearance === 'comment' && editorExperiment('support_table_in_comment', true, {
|
|
232
232
|
exposure: true
|
|
233
233
|
}) || props.rendererAppearance === 'comment' && editorExperiment('support_table_in_comment_jira', true, {
|
|
234
234
|
exposure: true
|
|
235
235
|
}),
|
|
236
|
-
isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption) && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width')
|
|
236
|
+
isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption) && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true))
|
|
237
237
|
}));
|
|
238
238
|
if (!colStyles) {
|
|
239
239
|
return null;
|
|
@@ -19,7 +19,7 @@ import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
|
|
|
19
19
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
20
|
import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
|
|
21
21
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
22
|
-
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
22
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorMaxWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
23
23
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
24
24
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
25
25
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
@@ -27,9 +27,10 @@ import { TableHeader } from './tableCell';
|
|
|
27
27
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
28
28
|
import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
|
|
29
29
|
import { Table } from './table/table';
|
|
30
|
-
import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFullWidthOrFullPageAppearance } from '../utils/appearance';
|
|
30
|
+
import { isCommentAppearance, isFullPageAppearance, isFullWidthAppearance, isFullWidthOrFullPageAppearance, isMaxWidthAppearance } from '../utils/appearance';
|
|
31
31
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
32
32
|
import { TableProcessorWithContainerStyles } from './tableNew';
|
|
33
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
33
34
|
export var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
|
|
34
35
|
return isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance) && editorExperiment('support_table_in_comment', true, {
|
|
35
36
|
exposure: true
|
|
@@ -425,6 +426,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
425
426
|
var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode) {
|
|
426
427
|
if (rendererAppearance === 'full-width' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
427
428
|
return [isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth, "min(".concat(akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")")];
|
|
429
|
+
} else if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
430
|
+
return [isRenderWidthValid ? Math.min(akEditorMaxWidthLayoutWidth, renderWidth) : akEditorMaxWidthLayoutWidth, "min(".concat(akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")")];
|
|
428
431
|
} else if (rendererAppearance === 'comment' && allowTableResizing && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
429
432
|
var tableContainerWidth = getTableContainerWidth(tableNode);
|
|
430
433
|
return [isRenderWidthValid ? renderWidth : tableContainerWidth, renderWidthCSS];
|
|
@@ -443,15 +446,17 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
443
446
|
var isTableAlignStart = tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && allowTableAlignment;
|
|
444
447
|
var fullWidthLineLength = isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth;
|
|
445
448
|
var fullWidthLineLengthCSS = "min(".concat(akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
449
|
+
var maxWidthLineLength = isRenderWidthValid ? Math.min(akEditorMaxWidthLayoutWidth, renderWidth) : akEditorMaxWidthLayoutWidth;
|
|
450
|
+
var maxWidthLineLengthCSS = "min(".concat(akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
446
451
|
var commentLineLength = isRenderWidthValid ? renderWidth : lineLengthFixedWidth;
|
|
447
452
|
var isCommentAppearanceAndTableAlignmentEnabled = isCommentAppearance(rendererAppearance) && allowTableAlignment;
|
|
448
|
-
var lineLength = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
|
|
449
|
-
var lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
453
|
+
var lineLength = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLength : isMaxWidthAppearance(rendererAppearance) && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) ? maxWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
|
|
454
|
+
var lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isMaxWidthAppearance(rendererAppearance) && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) ? maxWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
450
455
|
|
|
451
456
|
// Setting fixTableSSRResizing to false while FG logic is true in tableNew
|
|
452
457
|
var fixTableSSRResizing = false;
|
|
453
458
|
var tableWidthNew = fixTableSSRResizing ? getTableContainerWidth(tableNode) : tableWidth;
|
|
454
|
-
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
459
|
+
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) && isMaxWidthAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
455
460
|
var leftCSS;
|
|
456
461
|
if (shouldCalculateLeftForAlignment) {
|
|
457
462
|
left = (tableWidth - lineLength) / 2;
|
|
@@ -487,7 +492,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
487
492
|
// We can only use CSS to determine the width when we have a known width in container.
|
|
488
493
|
// When appearance is full-page, full-width or comment we use CSS based width calculation.
|
|
489
494
|
// Otherwise it's fixed table width (customized width) or inherit.
|
|
490
|
-
if ((rendererAppearance === 'full-page' || rendererAppearance === 'full-width') && fixTableSSRResizing) {
|
|
495
|
+
if ((rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max') && fixTableSSRResizing) {
|
|
491
496
|
finalTableContainerWidth = allowTableResizing ? "calc(".concat(tableWidthCSS, ")") : 'inherit';
|
|
492
497
|
}
|
|
493
498
|
if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
|
|
@@ -19,13 +19,14 @@ import { FullPagePadding } from '../../ui/Renderer/style';
|
|
|
19
19
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
20
|
import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
|
|
21
21
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
22
|
-
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
22
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorMaxWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
23
23
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
24
24
|
import { TableHeader } from './tableCell';
|
|
25
25
|
import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
|
|
26
26
|
import { Table } from './table/table';
|
|
27
|
-
import { isCommentAppearance, isFullWidthOrFullPageAppearance, isFullWidthAppearance, isFullPageAppearance } from '../utils/appearance';
|
|
27
|
+
import { isCommentAppearance, isFullWidthOrFullPageAppearance, isFullWidthAppearance, isMaxWidthAppearance, isFullPageAppearance } from '../utils/appearance';
|
|
28
28
|
import { TableStickyScrollbar } from './TableStickyScrollbar';
|
|
29
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
29
30
|
var stickyContainerBaseStyles = {
|
|
30
31
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
31
32
|
height: "var(--ds-space-250, 20px)",
|
|
@@ -398,7 +399,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
398
399
|
}) ? 'calc(100cqw - var(--ak-renderer--full-page-gutter) * 2)' : "100cqw - ".concat(FullPagePadding, "px * 2");
|
|
399
400
|
var renderWidthCSS = rendererAppearance === 'full-page' ? fullPageRendererWidthCSS : "100cqw";
|
|
400
401
|
var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode) {
|
|
401
|
-
if (rendererAppearance === '
|
|
402
|
+
if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width) && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true)) {
|
|
403
|
+
return "min(".concat(akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
404
|
+
} else if (rendererAppearance === 'full-width' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
402
405
|
return "min(".concat(akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
403
406
|
} else if (rendererAppearance === 'comment' && allowTableResizing && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
404
407
|
return renderWidthCSS;
|
|
@@ -413,10 +416,11 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
413
416
|
// Logic for table alignment in renderer
|
|
414
417
|
var isTableAlignStart = tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && allowTableAlignment;
|
|
415
418
|
var fullWidthLineLengthCSS = "min(".concat(akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
419
|
+
var maxWidthLineLengthCSS = "min(".concat(akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
416
420
|
var isCommentAppearanceAndTableAlignmentEnabled = isCommentAppearance(rendererAppearance) && allowTableAlignment;
|
|
417
|
-
var lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
421
|
+
var lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isMaxWidthAppearance(rendererAppearance) && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) ? maxWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
418
422
|
var tableWidthNew = getTableContainerWidth(tableNode);
|
|
419
|
-
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
423
|
+
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || isMaxWidthAppearance(rendererAppearance) && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
420
424
|
var leftCSS;
|
|
421
425
|
if (shouldCalculateLeftForAlignment) {
|
|
422
426
|
leftCSS = "(".concat(tableWidthCSS, " - ").concat(lineLengthCSS, ") / 2");
|
|
@@ -445,7 +449,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
445
449
|
// We can only use CSS to determine the width when we have a known width in container.
|
|
446
450
|
// When appearance is full-page, full-width or comment we use CSS based width calculation.
|
|
447
451
|
// Otherwise it's fixed table width (customized width) or inherit.
|
|
448
|
-
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width') {
|
|
452
|
+
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max' && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true)) {
|
|
449
453
|
finalTableContainerWidth = allowTableResizing ? "calc(".concat(tableWidthCSS, ")") : 'inherit';
|
|
450
454
|
}
|
|
451
455
|
if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export var isFullWidthAppearance = function isFullWidthAppearance(appearance) {
|
|
2
2
|
return appearance === 'full-width';
|
|
3
3
|
};
|
|
4
|
+
export var isMaxWidthAppearance = function isMaxWidthAppearance(appearance) {
|
|
5
|
+
return appearance === 'max';
|
|
6
|
+
};
|
|
4
7
|
export var isFullPageAppearance = function isFullPageAppearance(appearance) {
|
|
5
8
|
return appearance === 'full-page';
|
|
6
9
|
};
|
|
@@ -8,5 +11,5 @@ export var isCommentAppearance = function isCommentAppearance(appearance) {
|
|
|
8
11
|
return appearance === 'comment';
|
|
9
12
|
};
|
|
10
13
|
export var isFullWidthOrFullPageAppearance = function isFullWidthOrFullPageAppearance(appearance) {
|
|
11
|
-
return isFullPageAppearance(appearance) || isFullWidthAppearance(appearance);
|
|
14
|
+
return isFullPageAppearance(appearance) || isFullWidthAppearance(appearance) || isMaxWidthAppearance(appearance);
|
|
12
15
|
};
|
package/dist/esm/ui/Expand.js
CHANGED
|
@@ -285,7 +285,9 @@ function Expand(_ref2) {
|
|
|
285
285
|
className: "".concat(nodeType, "-content-wrapper")
|
|
286
286
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
287
287
|
css: clearNextSiblingMarginTopStyle
|
|
288
|
-
}), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ?
|
|
288
|
+
}), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ?
|
|
289
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
|
|
290
|
+
jsx(Suspense, {
|
|
289
291
|
fallback: jsx("div", null, "Loading...")
|
|
290
292
|
}, jsx(LazyChildren, null, children)) : null : children))));
|
|
291
293
|
}
|
|
@@ -60,7 +60,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
60
60
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
61
61
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
62
62
|
var packageName = "@atlaskit/renderer";
|
|
63
|
-
var packageVersion = "
|
|
63
|
+
var packageVersion = "124.16.2";
|
|
64
64
|
var setAsQueryContainerStyles = css({
|
|
65
65
|
containerName: 'ak-renderer-wrapper',
|
|
66
66
|
containerType: 'inline-size'
|
|
@@ -771,6 +771,11 @@ var RendererWithAnnotationSelection = function RendererWithAnnotationSelection(p
|
|
|
771
771
|
adfDocument = props.document;
|
|
772
772
|
var localRef = React.useRef(null);
|
|
773
773
|
var innerRef = props.innerRef || localRef;
|
|
774
|
+
|
|
775
|
+
// @see https://hello.jira.atlassian.cloud/browse/EDITOR-3389
|
|
776
|
+
if (props.appearance === 'max' && expValEquals('editor_tinymce_full_width_mode', 'isEnabled', false)) {
|
|
777
|
+
props.appearance = 'full-width';
|
|
778
|
+
}
|
|
774
779
|
if (!allowAnnotations) {
|
|
775
780
|
// Ignored via go/ees005
|
|
776
781
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type RendererAppearance } from '../../ui/Renderer/types';
|
|
2
2
|
export declare const isFullWidthAppearance: (appearance: RendererAppearance) => appearance is "full-width";
|
|
3
|
+
export declare const isMaxWidthAppearance: (appearance: RendererAppearance) => appearance is "max";
|
|
3
4
|
export declare const isFullPageAppearance: (appearance: RendererAppearance) => appearance is "full-page";
|
|
4
5
|
export declare const isCommentAppearance: (appearance: RendererAppearance) => appearance is "comment";
|
|
5
|
-
export declare const isFullWidthOrFullPageAppearance: (appearance: RendererAppearance) => appearance is "full-page" | "full-width";
|
|
6
|
+
export declare const isFullWidthOrFullPageAppearance: (appearance: RendererAppearance) => appearance is "full-page" | "full-width" | "max";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type RendererAppearance } from '../../ui/Renderer/types';
|
|
2
2
|
export declare const isFullWidthAppearance: (appearance: RendererAppearance) => appearance is "full-width";
|
|
3
|
+
export declare const isMaxWidthAppearance: (appearance: RendererAppearance) => appearance is "max";
|
|
3
4
|
export declare const isFullPageAppearance: (appearance: RendererAppearance) => appearance is "full-page";
|
|
4
5
|
export declare const isCommentAppearance: (appearance: RendererAppearance) => appearance is "comment";
|
|
5
|
-
export declare const isFullWidthOrFullPageAppearance: (appearance: RendererAppearance) => appearance is "full-page" | "full-width";
|
|
6
|
+
export declare const isFullWidthOrFullPageAppearance: (appearance: RendererAppearance) => appearance is "full-page" | "full-width" | "max";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "124.16.
|
|
3
|
+
"version": "124.16.3",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
55
55
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
56
56
|
"@atlaskit/react-ufo": "^4.15.0",
|
|
57
|
-
"@atlaskit/smart-card": "^43.
|
|
57
|
+
"@atlaskit/smart-card": "^43.9.0",
|
|
58
58
|
"@atlaskit/status": "^3.0.0",
|
|
59
59
|
"@atlaskit/task-decision": "^19.2.0",
|
|
60
60
|
"@atlaskit/theme": "^21.0.0",
|
|
61
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
62
|
-
"@atlaskit/tokens": "^8.
|
|
61
|
+
"@atlaskit/tmp-editor-statsig": "^13.40.0",
|
|
62
|
+
"@atlaskit/tokens": "^8.2.0",
|
|
63
63
|
"@atlaskit/tooltip": "^20.10.0",
|
|
64
64
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
65
65
|
"@babel/runtime": "^7.0.0",
|