@atlaskit/renderer 109.50.7 → 109.51.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 +21 -0
- package/dist/cjs/react/index.js +3 -1
- package/dist/cjs/react/nodes/table/colgroup.js +8 -4
- package/dist/cjs/react/nodes/table/sticky.js +9 -9
- package/dist/cjs/react/nodes/table/table.js +8 -4
- package/dist/cjs/react/nodes/table.js +12 -13
- package/dist/cjs/ui/Renderer/ErrorBoundary.js +22 -27
- package/dist/cjs/ui/Renderer/index.js +7 -4
- package/dist/es2019/react/index.js +3 -1
- package/dist/es2019/react/nodes/table/colgroup.js +8 -4
- package/dist/es2019/react/nodes/table/sticky.js +9 -9
- package/dist/es2019/react/nodes/table/table.js +8 -4
- package/dist/es2019/react/nodes/table.js +12 -13
- package/dist/es2019/ui/Renderer/ErrorBoundary.js +20 -25
- package/dist/es2019/ui/Renderer/index.js +7 -4
- package/dist/esm/react/index.js +3 -1
- package/dist/esm/react/nodes/table/colgroup.js +8 -4
- package/dist/esm/react/nodes/table/sticky.js +9 -9
- package/dist/esm/react/nodes/table/table.js +8 -4
- package/dist/esm/react/nodes/table.js +12 -13
- package/dist/esm/ui/Renderer/ErrorBoundary.js +22 -27
- package/dist/esm/ui/Renderer/index.js +7 -4
- package/dist/types/react/index.d.ts +2 -0
- package/dist/types/react/nodes/table/sticky.d.ts +2 -1
- package/dist/types/react/nodes/table/table.d.ts +1 -1
- package/dist/types/react/nodes/table/types.d.ts +1 -0
- package/dist/types/react/nodes/table.d.ts +22 -0
- package/dist/types/ui/Renderer/style.d.ts +1 -0
- package/dist/types/ui/renderer-props.d.ts +1 -0
- package/dist/types-ts4.5/react/index.d.ts +2 -0
- package/dist/types-ts4.5/react/nodes/table/sticky.d.ts +2 -1
- package/dist/types-ts4.5/react/nodes/table/table.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/table/types.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/table.d.ts +22 -0
- package/dist/types-ts4.5/ui/Renderer/style.d.ts +1 -0
- package/dist/types-ts4.5/ui/renderer-props.d.ts +1 -0
- package/package.json +5 -8
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ACTION, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
6
5
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
7
6
|
import { PLATFORM } from '../../analytics/events';
|
|
@@ -47,24 +46,22 @@ export class ErrorBoundary extends React.Component {
|
|
|
47
46
|
logException(error, {
|
|
48
47
|
location: 'renderer'
|
|
49
48
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
49
|
+
const pattern = /Failed to execute.*on 'Node'.*/;
|
|
50
|
+
const matchesPattern = pattern.test(error.message);
|
|
51
|
+
if (matchesPattern) {
|
|
52
|
+
this.fireAnalyticsEvent({
|
|
53
|
+
action: ACTION.CAUGHT_DOM_ERROR,
|
|
54
|
+
actionSubject: this.props.component,
|
|
55
|
+
actionSubjectId: this.props.componentId,
|
|
56
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
57
|
+
attributes: {
|
|
58
|
+
platform: PLATFORM.WEB,
|
|
59
|
+
errorMessage: `${additionalInfo}${error === null || error === void 0 ? void 0 : error.message}`
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
this.setState(() => ({
|
|
63
|
+
domError: true
|
|
64
|
+
}));
|
|
68
65
|
}
|
|
69
66
|
if (this.hasFallback()) {
|
|
70
67
|
this.setState({
|
|
@@ -77,12 +74,10 @@ export class ErrorBoundary extends React.Component {
|
|
|
77
74
|
}
|
|
78
75
|
}
|
|
79
76
|
render() {
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, this.props.children);
|
|
85
|
-
}
|
|
77
|
+
if (this.state.domError) {
|
|
78
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
79
|
+
key: uuid()
|
|
80
|
+
}, this.props.children);
|
|
86
81
|
}
|
|
87
82
|
if (this.shouldRecover()) {
|
|
88
83
|
return this.props.fallbackComponent;
|
|
@@ -42,7 +42,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
42
42
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
43
43
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
44
44
|
const packageName = "@atlaskit/renderer";
|
|
45
|
-
const packageVersion = "109.
|
|
45
|
+
const packageVersion = "109.51.1";
|
|
46
46
|
export const defaultNodeComponents = nodeToReact;
|
|
47
47
|
export class Renderer extends PureComponent {
|
|
48
48
|
constructor(props) {
|
|
@@ -270,7 +270,8 @@ export class Renderer extends PureComponent {
|
|
|
270
270
|
isInsideOfInlineExtension: fg('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
|
|
271
271
|
textHighlighter: props.UNSTABLE_textHighlighter,
|
|
272
272
|
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix,
|
|
273
|
-
allowTableAlignment: props.UNSTABLE_allowTableAlignment
|
|
273
|
+
allowTableAlignment: props.UNSTABLE_allowTableAlignment,
|
|
274
|
+
allowTableResizing: props.appearance === 'comment' && !fg('platform_editor_table_support_in_comment') ? false : props.UNSTABLE_allowTableResizing
|
|
274
275
|
};
|
|
275
276
|
}
|
|
276
277
|
render() {
|
|
@@ -462,7 +463,8 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
462
463
|
useBlockRenderForCodeBlock,
|
|
463
464
|
addTelepointer,
|
|
464
465
|
ssr,
|
|
465
|
-
isInsideOfInlineExtension
|
|
466
|
+
isInsideOfInlineExtension,
|
|
467
|
+
allowTableResizing
|
|
466
468
|
} = props;
|
|
467
469
|
const createTelepointer = () => {
|
|
468
470
|
const telepointer = document.createElement('span');
|
|
@@ -534,7 +536,8 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
534
536
|
allowNestedHeaderLinks,
|
|
535
537
|
allowColumnSorting: !!allowColumnSorting,
|
|
536
538
|
useBlockRenderForCodeBlock,
|
|
537
|
-
allowAnnotations: props.allowAnnotations
|
|
539
|
+
allowAnnotations: props.allowAnnotations,
|
|
540
|
+
allowTableResizing: allowTableResizing
|
|
538
541
|
})
|
|
539
542
|
}, children))));
|
|
540
543
|
});
|
package/dist/esm/react/index.js
CHANGED
|
@@ -185,6 +185,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
185
185
|
this.textHighlighter = init.textHighlighter;
|
|
186
186
|
this.isCommentsOnMediaMediaInlineBugFixEnabled = init.isCommentsOnMediaMediaInlineBugFixEnabled;
|
|
187
187
|
this.allowTableAlignment = init.allowTableAlignment;
|
|
188
|
+
this.allowTableResizing = init.allowTableResizing;
|
|
188
189
|
}
|
|
189
190
|
_createClass(ReactSerializer, [{
|
|
190
191
|
key: "resetState",
|
|
@@ -358,7 +359,8 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
358
359
|
stickyHeaders: stickyHeaders,
|
|
359
360
|
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
360
361
|
isInsideMultiBodiedExtension: isInsideMultiBodiedExtension,
|
|
361
|
-
allowTableAlignment: this.allowTableAlignment
|
|
362
|
+
allowTableAlignment: this.allowTableAlignment,
|
|
363
|
+
allowTableResizing: this.allowTableResizing
|
|
362
364
|
});
|
|
363
365
|
}
|
|
364
366
|
}, {
|
|
@@ -5,7 +5,6 @@ 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
7
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
8
|
-
import { isTableResizingEnabled } from '../table';
|
|
9
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { useFeatureFlags } from '../../../use-feature-flags';
|
|
11
10
|
// we allow scaling down column widths by no more than 30%
|
|
@@ -56,7 +55,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
56
55
|
isInsideOfBlockNode = props.isInsideOfBlockNode,
|
|
57
56
|
isinsideMultiBodiedExtension = props.isinsideMultiBodiedExtension,
|
|
58
57
|
isTableScalingEnabled = props.isTableScalingEnabled,
|
|
59
|
-
isTableFixedColumnWidthsOptionEnabled = props.isTableFixedColumnWidthsOptionEnabled
|
|
58
|
+
isTableFixedColumnWidthsOptionEnabled = props.isTableFixedColumnWidthsOptionEnabled,
|
|
59
|
+
allowTableResizing = props.allowTableResizing;
|
|
60
60
|
if (!columnWidths) {
|
|
61
61
|
return [];
|
|
62
62
|
}
|
|
@@ -65,8 +65,12 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
65
65
|
var tableResized = isTableResized(columnWidths);
|
|
66
66
|
var noOfColumns = columnWidths.length;
|
|
67
67
|
var targetWidths;
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
|
|
69
|
+
// appearance == comment && allowTableResizing && !tableNode?.attrs.width, means it is a comment
|
|
70
|
+
// appearance == comment && !allowTableResizing && !tableNode?.attrs.width, means it is a inline comment
|
|
71
|
+
// When comment and inline comment table width inherits from the parent container, we want tableContainerWidth === renderWidth
|
|
72
|
+
var tableContainerWidth = rendererAppearance === 'comment' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width) ? renderWidth : getTableContainerWidth(tableNode);
|
|
73
|
+
if (allowTableResizing && !isInsideOfBlockNode && !isinsideMultiBodiedExtension && !tableResized) {
|
|
70
74
|
// for tables with no column widths defined, assume that the real table width
|
|
71
75
|
// is defined by node.attrs.width
|
|
72
76
|
var _tableWidth2 = (isNumberColumnEnabled ? tableContainerWidth - akEditorTableNumberColumnWidth : tableContainerWidth) - 1;
|
|
@@ -16,7 +16,6 @@ import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
|
|
|
16
16
|
import { N40A } from '@atlaskit/theme/colors';
|
|
17
17
|
import { Table } from './table';
|
|
18
18
|
import { recursivelyInjectProps } from '../../utils/inject-props';
|
|
19
|
-
import { isTableResizingEnabled } from '../table';
|
|
20
19
|
export var tableStickyPadding = 8;
|
|
21
20
|
var modeSpecficStyles = {
|
|
22
21
|
none: css({
|
|
@@ -31,10 +30,10 @@ var modeSpecficStyles = {
|
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
// TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4123
|
|
34
|
-
var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width,
|
|
33
|
+
var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width, allowTableResizing) {
|
|
35
34
|
var _css;
|
|
36
35
|
var stickyHeaderZIndex;
|
|
37
|
-
if (
|
|
36
|
+
if (allowTableResizing) {
|
|
38
37
|
stickyHeaderZIndex = 13;
|
|
39
38
|
} else {
|
|
40
39
|
stickyHeaderZIndex = akEditorStickyHeaderZIndex;
|
|
@@ -67,8 +66,8 @@ var FixedTableDiv = function FixedTableDiv(props) {
|
|
|
67
66
|
var top = props.top,
|
|
68
67
|
wrapperWidth = props.wrapperWidth,
|
|
69
68
|
mode = props.mode,
|
|
70
|
-
|
|
71
|
-
var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth,
|
|
69
|
+
allowTableResizing = props.allowTableResizing;
|
|
70
|
+
var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth, allowTableResizing), modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]];
|
|
72
71
|
var attrs = {
|
|
73
72
|
mode: mode
|
|
74
73
|
};
|
|
@@ -76,7 +75,7 @@ var FixedTableDiv = function FixedTableDiv(props) {
|
|
|
76
75
|
"data-testid": "sticky-table-fixed"
|
|
77
76
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
78
77
|
,
|
|
79
|
-
className:
|
|
78
|
+
className: allowTableResizing ? 'fixed-table-div-custom-table-resizing' : ''
|
|
80
79
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
81
80
|
,
|
|
82
81
|
css: fixedTableCss
|
|
@@ -97,10 +96,11 @@ export var StickyTable = function StickyTable(_ref) {
|
|
|
97
96
|
renderWidth = _ref.renderWidth,
|
|
98
97
|
rowHeight = _ref.rowHeight,
|
|
99
98
|
tableNode = _ref.tableNode,
|
|
100
|
-
rendererAppearance = _ref.rendererAppearance
|
|
99
|
+
rendererAppearance = _ref.rendererAppearance,
|
|
100
|
+
allowTableResizing = _ref.allowTableResizing;
|
|
101
101
|
var styles;
|
|
102
102
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
103
|
-
if (
|
|
103
|
+
if (allowTableResizing) {
|
|
104
104
|
styles = css({
|
|
105
105
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
106
106
|
top: mode === 'pin-bottom' ? top : undefined,
|
|
@@ -124,7 +124,7 @@ export var StickyTable = function StickyTable(_ref) {
|
|
|
124
124
|
top: mode === 'stick' ? top : undefined,
|
|
125
125
|
mode: rowHeight > 300 ? 'none' : mode,
|
|
126
126
|
wrapperWidth: wrapperWidth,
|
|
127
|
-
|
|
127
|
+
allowTableResizing: allowTableResizing
|
|
128
128
|
}, jsx("div", {
|
|
129
129
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
130
130
|
className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " is-sticky ").concat(shadowClassNames || ''),
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { Colgroup } from './colgroup';
|
|
3
3
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
4
4
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import { isTableResizingEnabled } from '../table';
|
|
6
5
|
export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
7
6
|
var _tableNode$attrs;
|
|
8
7
|
var innerRef = _ref.innerRef,
|
|
@@ -14,11 +13,15 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
14
13
|
tableNode = _ref.tableNode,
|
|
15
14
|
rendererAppearance = _ref.rendererAppearance,
|
|
16
15
|
isInsideOfBlockNode = _ref.isInsideOfBlockNode,
|
|
17
|
-
isinsideMultiBodiedExtension = _ref.isinsideMultiBodiedExtension
|
|
16
|
+
isinsideMultiBodiedExtension = _ref.isinsideMultiBodiedExtension,
|
|
17
|
+
allowTableResizing = _ref.allowTableResizing;
|
|
18
18
|
var tableWidth = tableNode ? getTableContainerWidth(tableNode) : akEditorDefaultLayoutWidth;
|
|
19
|
-
if (rendererAppearance === 'comment' &&
|
|
19
|
+
if (rendererAppearance === 'comment' && allowTableResizing && tableNode && !((_tableNode$attrs = tableNode.attrs) !== null && _tableNode$attrs !== void 0 && _tableNode$attrs.width)) {
|
|
20
20
|
tableWidth = 'inherit';
|
|
21
21
|
}
|
|
22
|
+
if (rendererAppearance === 'comment' && !allowTableResizing) {
|
|
23
|
+
tableWidth = renderWidth;
|
|
24
|
+
}
|
|
22
25
|
var tableLayout = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout;
|
|
23
26
|
var tableDisplayMode = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.displayMode;
|
|
24
27
|
return /*#__PURE__*/React.createElement("table", {
|
|
@@ -36,6 +39,7 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
36
39
|
tableNode: tableNode,
|
|
37
40
|
rendererAppearance: rendererAppearance,
|
|
38
41
|
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
39
|
-
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension
|
|
42
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension,
|
|
43
|
+
allowTableResizing: allowTableResizing
|
|
40
44
|
}), /*#__PURE__*/React.createElement("tbody", null, children));
|
|
41
45
|
});
|
|
@@ -26,9 +26,7 @@ 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) ||
|
|
30
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
31
|
-
isCommentAppearance(appearance) && fg('platform_editor_table_support_in_comment');
|
|
29
|
+
return isFullWidthOrFullPageAppearance(appearance) || isCommentAppearance(appearance) && fg('platform_editor_table_support_in_comment');
|
|
32
30
|
};
|
|
33
31
|
var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
|
|
34
32
|
if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
|
|
@@ -292,7 +290,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
292
290
|
rendererAppearance = _this$props.rendererAppearance,
|
|
293
291
|
isInsideOfBlockNode = _this$props.isInsideOfBlockNode,
|
|
294
292
|
isinsideMultiBodiedExtension = _this$props.isinsideMultiBodiedExtension,
|
|
295
|
-
allowTableAlignment = _this$props.allowTableAlignment
|
|
293
|
+
allowTableAlignment = _this$props.allowTableAlignment,
|
|
294
|
+
allowTableResizing = _this$props.allowTableResizing;
|
|
296
295
|
var stickyMode = this.state.stickyMode;
|
|
297
296
|
var lineLengthFixedWidth = akEditorDefaultLayoutWidth;
|
|
298
297
|
var left;
|
|
@@ -305,7 +304,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
305
304
|
var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode) {
|
|
306
305
|
if (rendererAppearance === 'full-width' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
307
306
|
return isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth;
|
|
308
|
-
} else if (rendererAppearance === 'comment' &&
|
|
307
|
+
} else if (rendererAppearance === 'comment' && allowTableResizing && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
309
308
|
var tableContainerWidth = getTableContainerWidth(tableNode);
|
|
310
309
|
return isRenderWidthValid ? renderWidth : tableContainerWidth;
|
|
311
310
|
} else {
|
|
@@ -315,9 +314,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
315
314
|
}
|
|
316
315
|
};
|
|
317
316
|
var tableWidth = calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode);
|
|
318
|
-
var isCommentAppearanceAndTableAlignmentEnabled =
|
|
319
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
320
|
-
allowTableAlignment && fg('platform_editor_table_support_in_comment');
|
|
317
|
+
var isCommentAppearanceAndTableAlignmentEnabled = allowTableAlignment && fg('platform_editor_table_support_in_comment');
|
|
321
318
|
|
|
322
319
|
// Logic for table alignment in renderer
|
|
323
320
|
var isTableAlignStart = (isFullWidthOrFullPageAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled) && tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && allowTableAlignment && fg('platform.editor.table.allow-table-alignment'); // allowTableAlignment should be used instead of fg('platform.editor.table.allow-table-alignment') after this fg cleanup
|
|
@@ -345,8 +342,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
345
342
|
} else {
|
|
346
343
|
updatedLayout = layout;
|
|
347
344
|
}
|
|
348
|
-
var finalTableContainerWidth =
|
|
349
|
-
if (rendererAppearance === 'comment' &&
|
|
345
|
+
var finalTableContainerWidth = allowTableResizing ? tableWidth : 'inherit';
|
|
346
|
+
if (rendererAppearance === 'comment' && allowTableResizing) {
|
|
350
347
|
finalTableContainerWidth = tableNode !== null && tableNode !== void 0 && tableNode.attrs.width ? tableWidth : 'inherit';
|
|
351
348
|
}
|
|
352
349
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -373,7 +370,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
373
370
|
columnWidths: columnWidths,
|
|
374
371
|
rowHeight: this.state.headerRowHeight,
|
|
375
372
|
tableNode: tableNode,
|
|
376
|
-
rendererAppearance: rendererAppearance
|
|
373
|
+
rendererAppearance: rendererAppearance,
|
|
374
|
+
allowTableResizing: allowTableResizing
|
|
377
375
|
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
378
376
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
379
377
|
className: TableSharedCssClassName.TABLE_NODE_WRAPPER,
|
|
@@ -388,7 +386,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
388
386
|
tableNode: tableNode,
|
|
389
387
|
rendererAppearance: rendererAppearance,
|
|
390
388
|
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
391
|
-
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension
|
|
389
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension,
|
|
390
|
+
allowTableResizing: allowTableResizing
|
|
392
391
|
}, this.grabFirstRowRef(children)))));
|
|
393
392
|
}
|
|
394
393
|
}]);
|
|
@@ -468,7 +467,7 @@ var TableWithWidth = function TableWithWidth(props) {
|
|
|
468
467
|
var colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
469
468
|
return total + val;
|
|
470
469
|
}, 0)) || 0;
|
|
471
|
-
if (colWidthsSum ||
|
|
470
|
+
if (colWidthsSum || props.allowTableResizing) {
|
|
472
471
|
return /*#__PURE__*/React.createElement(TableWithShadows, _extends({
|
|
473
472
|
renderWidth: renderWidth
|
|
474
473
|
}, props));
|
|
@@ -9,7 +9,6 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { ACTION, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
12
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
14
13
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
15
14
|
import { PLATFORM } from '../../analytics/events';
|
|
@@ -70,26 +69,24 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
70
69
|
logException(error, {
|
|
71
70
|
location: 'renderer'
|
|
72
71
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
});
|
|
92
|
-
}
|
|
72
|
+
var pattern = /Failed to execute.*on 'Node'.*/;
|
|
73
|
+
var matchesPattern = pattern.test(error.message);
|
|
74
|
+
if (matchesPattern) {
|
|
75
|
+
this.fireAnalyticsEvent({
|
|
76
|
+
action: ACTION.CAUGHT_DOM_ERROR,
|
|
77
|
+
actionSubject: this.props.component,
|
|
78
|
+
actionSubjectId: this.props.componentId,
|
|
79
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
80
|
+
attributes: {
|
|
81
|
+
platform: PLATFORM.WEB,
|
|
82
|
+
errorMessage: "".concat(additionalInfo).concat(error === null || error === void 0 ? void 0 : error.message)
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
this.setState(function () {
|
|
86
|
+
return {
|
|
87
|
+
domError: true
|
|
88
|
+
};
|
|
89
|
+
});
|
|
93
90
|
}
|
|
94
91
|
if (this.hasFallback()) {
|
|
95
92
|
this.setState({
|
|
@@ -104,12 +101,10 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
104
101
|
}, {
|
|
105
102
|
key: "render",
|
|
106
103
|
value: function render() {
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}, this.props.children);
|
|
112
|
-
}
|
|
104
|
+
if (this.state.domError) {
|
|
105
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
106
|
+
key: uuid()
|
|
107
|
+
}, this.props.children);
|
|
113
108
|
}
|
|
114
109
|
if (this.shouldRecover()) {
|
|
115
110
|
return this.props.fallbackComponent;
|
|
@@ -52,7 +52,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
52
52
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
53
53
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
54
54
|
var packageName = "@atlaskit/renderer";
|
|
55
|
-
var packageVersion = "109.
|
|
55
|
+
var packageVersion = "109.51.1";
|
|
56
56
|
export var defaultNodeComponents = nodeToReact;
|
|
57
57
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
58
58
|
_inherits(Renderer, _PureComponent);
|
|
@@ -282,7 +282,8 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
282
282
|
isInsideOfInlineExtension: fg('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
|
|
283
283
|
textHighlighter: props.UNSTABLE_textHighlighter,
|
|
284
284
|
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix,
|
|
285
|
-
allowTableAlignment: props.UNSTABLE_allowTableAlignment
|
|
285
|
+
allowTableAlignment: props.UNSTABLE_allowTableAlignment,
|
|
286
|
+
allowTableResizing: props.appearance === 'comment' && !fg('platform_editor_table_support_in_comment') ? false : props.UNSTABLE_allowTableResizing
|
|
286
287
|
};
|
|
287
288
|
}
|
|
288
289
|
}, {
|
|
@@ -480,7 +481,8 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
480
481
|
useBlockRenderForCodeBlock = props.useBlockRenderForCodeBlock,
|
|
481
482
|
addTelepointer = props.addTelepointer,
|
|
482
483
|
ssr = props.ssr,
|
|
483
|
-
isInsideOfInlineExtension = props.isInsideOfInlineExtension
|
|
484
|
+
isInsideOfInlineExtension = props.isInsideOfInlineExtension,
|
|
485
|
+
allowTableResizing = props.allowTableResizing;
|
|
484
486
|
var createTelepointer = function createTelepointer() {
|
|
485
487
|
var telepointer = document.createElement('span');
|
|
486
488
|
telepointer.textContent = "\u200B";
|
|
@@ -553,7 +555,8 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
553
555
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
554
556
|
allowColumnSorting: !!allowColumnSorting,
|
|
555
557
|
useBlockRenderForCodeBlock: useBlockRenderForCodeBlock,
|
|
556
|
-
allowAnnotations: props.allowAnnotations
|
|
558
|
+
allowAnnotations: props.allowAnnotations,
|
|
559
|
+
allowTableResizing: allowTableResizing
|
|
557
560
|
})
|
|
558
561
|
}, children))));
|
|
559
562
|
});
|
|
@@ -43,6 +43,7 @@ export interface ReactSerializerInit {
|
|
|
43
43
|
textHighlighter?: TextHighlighter;
|
|
44
44
|
isCommentsOnMediaMediaInlineBugFixEnabled?: boolean;
|
|
45
45
|
allowTableAlignment?: boolean;
|
|
46
|
+
allowTableResizing?: boolean;
|
|
46
47
|
}
|
|
47
48
|
interface ParentInfo {
|
|
48
49
|
parentIsIncompleteTask: boolean;
|
|
@@ -92,6 +93,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
92
93
|
private isCommentsOnMediaMediaInlineBugFixEnabled?;
|
|
93
94
|
private textHighlighter?;
|
|
94
95
|
private allowTableAlignment?;
|
|
96
|
+
private allowTableResizing?;
|
|
95
97
|
constructor(init: ReactSerializerInit);
|
|
96
98
|
private resetState;
|
|
97
99
|
private getNodeProps;
|
|
@@ -25,8 +25,9 @@ type StickyTableProps = {
|
|
|
25
25
|
renderWidth: number;
|
|
26
26
|
tableNode?: PMNode;
|
|
27
27
|
rendererAppearance: RendererAppearance;
|
|
28
|
+
allowTableResizing?: boolean;
|
|
28
29
|
} & OverflowShadowProps;
|
|
29
|
-
export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, rendererAppearance, }: StickyTableProps) => jsx.JSX.Element;
|
|
30
|
+
export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, rendererAppearance, allowTableResizing, }: StickyTableProps) => jsx.JSX.Element;
|
|
30
31
|
export declare class OverflowParent {
|
|
31
32
|
private ref;
|
|
32
33
|
private constructor();
|
|
@@ -4,5 +4,5 @@ type TableProps = SharedTableProps & {
|
|
|
4
4
|
innerRef?: React.RefObject<HTMLTableElement>;
|
|
5
5
|
children: React.ReactNode[];
|
|
6
6
|
};
|
|
7
|
-
export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, isInsideOfBlockNode, isinsideMultiBodiedExtension, }: TableProps) => JSX.Element>;
|
|
7
|
+
export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, isInsideOfBlockNode, isinsideMultiBodiedExtension, allowTableResizing, }: TableProps) => JSX.Element>;
|
|
8
8
|
export {};
|