@atlaskit/renderer 109.6.0 → 109.6.2
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 +13 -0
- package/dist/cjs/react/index.js +3 -1
- package/dist/cjs/react/nodes/blockCard.js +2 -1
- package/dist/cjs/react/nodes/fallback.js +17 -7
- package/dist/cjs/react/nodes/table/colgroup.js +3 -2
- package/dist/cjs/react/nodes/table/table.js +4 -2
- package/dist/cjs/react/nodes/table.js +4 -2
- package/dist/cjs/react/renderer-node.js +7 -1
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/index.js +4 -2
- package/dist/es2019/react/nodes/blockCard.js +2 -1
- package/dist/es2019/react/nodes/fallback.js +17 -7
- package/dist/es2019/react/nodes/table/colgroup.js +3 -2
- package/dist/es2019/react/nodes/table/table.js +4 -2
- package/dist/es2019/react/nodes/table.js +4 -2
- package/dist/es2019/react/renderer-node.js +8 -0
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/index.js +4 -2
- package/dist/esm/react/nodes/blockCard.js +2 -1
- package/dist/esm/react/nodes/fallback.js +17 -7
- package/dist/esm/react/nodes/table/colgroup.js +3 -2
- package/dist/esm/react/nodes/table/table.js +4 -2
- package/dist/esm/react/nodes/table.js +4 -2
- package/dist/esm/react/renderer-node.js +6 -0
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/nodes/fallback.d.ts +4 -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/renderer-node.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/fallback.d.ts +4 -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/renderer-node.d.ts +1 -0
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#75568](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75568) [`cf557c64b311`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cf557c64b311) - Updated CardErrorBoundary to pass error and datasourceId to LazyLoadedDatasourceRenderFailedAnalyticsWrapper
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 109.6.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#75436](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75436) [`bfcf32bb4fa3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bfcf32bb4fa3) - [ux] ED-21941 Disable resize/layout options for table, media and extension when added to MBE. Table rendering fixed for Confluence editor
|
|
15
|
+
|
|
3
16
|
## 109.6.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -343,12 +343,14 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
343
343
|
// TODO: https://product-fabric.atlassian.net/browse/CEMS-1048
|
|
344
344
|
var stickyHeaders = !(0, _rendererNode.insideBreakoutLayout)(path) ? this.stickyHeaders : undefined;
|
|
345
345
|
var isInsideOfBlockNode = (0, _rendererNode.insideBlockNode)(path, node.type.schema);
|
|
346
|
+
var isinsideMultiBodiedExtension = (0, _rendererNode.insideMultiBodiedExtension)(path, node.type.schema);
|
|
346
347
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
347
348
|
allowColumnSorting: this.allowColumnSorting,
|
|
348
349
|
columnWidths: (0, _utils.calcTableColumnWidths)(node),
|
|
349
350
|
tableNode: node,
|
|
350
351
|
stickyHeaders: stickyHeaders,
|
|
351
|
-
isInsideOfBlockNode: isInsideOfBlockNode
|
|
352
|
+
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
353
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension
|
|
352
354
|
});
|
|
353
355
|
}
|
|
354
356
|
}, {
|
|
@@ -92,7 +92,8 @@ function BlockCard(props) {
|
|
|
92
92
|
return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
93
93
|
data: analyticsData
|
|
94
94
|
}, (0, _react2.jsx)(_fallback.CardErrorBoundary, (0, _extends2.default)({
|
|
95
|
-
unsupportedComponent: _ui.UnsupportedInline
|
|
95
|
+
unsupportedComponent: _ui.UnsupportedInline,
|
|
96
|
+
datasourceId: props.datasource.id
|
|
96
97
|
}, cardProps), (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref5) {
|
|
97
98
|
var width = _ref5.width;
|
|
98
99
|
return (0, _react2.jsx)("div", {
|
|
@@ -29,7 +29,8 @@ var CardErrorBoundary = exports.CardErrorBoundary = /*#__PURE__*/function (_Reac
|
|
|
29
29
|
}
|
|
30
30
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
31
31
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
32
|
-
isError: false
|
|
32
|
+
isError: false,
|
|
33
|
+
error: null
|
|
33
34
|
});
|
|
34
35
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClickFallback", function (e) {
|
|
35
36
|
var _this$props = _this.props,
|
|
@@ -49,7 +50,8 @@ var CardErrorBoundary = exports.CardErrorBoundary = /*#__PURE__*/function (_Reac
|
|
|
49
50
|
var _this$props2 = this.props,
|
|
50
51
|
_url = _this$props2.url,
|
|
51
52
|
isDatasource = _this$props2.isDatasource,
|
|
52
|
-
UnsupportedComponent = _this$props2.unsupportedComponent
|
|
53
|
+
UnsupportedComponent = _this$props2.unsupportedComponent,
|
|
54
|
+
datasourceId = _this$props2.datasourceId;
|
|
53
55
|
if (_url) {
|
|
54
56
|
var fallback = /*#__PURE__*/_react.default.createElement("a", {
|
|
55
57
|
href: _url,
|
|
@@ -57,9 +59,15 @@ var CardErrorBoundary = exports.CardErrorBoundary = /*#__PURE__*/function (_Reac
|
|
|
57
59
|
}, _url);
|
|
58
60
|
if (isDatasource) {
|
|
59
61
|
if ((0, _adfSchema.isSafeUrl)(_url)) {
|
|
60
|
-
return /*#__PURE__*/_react.default.createElement(_linkDatasource.LazyLoadedDatasourceRenderFailedAnalyticsWrapper,
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement(_linkDatasource.LazyLoadedDatasourceRenderFailedAnalyticsWrapper, {
|
|
63
|
+
datasourceId: datasourceId,
|
|
64
|
+
error: this.state.error
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_.InlineCard, this.props));
|
|
61
66
|
} else {
|
|
62
|
-
return /*#__PURE__*/_react.default.createElement(_linkDatasource.LazyLoadedDatasourceRenderFailedAnalyticsWrapper,
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_linkDatasource.LazyLoadedDatasourceRenderFailedAnalyticsWrapper, {
|
|
68
|
+
datasourceId: datasourceId,
|
|
69
|
+
error: this.state.error
|
|
70
|
+
}, fallback);
|
|
63
71
|
}
|
|
64
72
|
} else {
|
|
65
73
|
return fallback;
|
|
@@ -74,14 +82,16 @@ var CardErrorBoundary = exports.CardErrorBoundary = /*#__PURE__*/function (_Reac
|
|
|
74
82
|
key: "componentDidCatch",
|
|
75
83
|
value: function componentDidCatch(_error) {
|
|
76
84
|
this.setState({
|
|
77
|
-
isError: true
|
|
85
|
+
isError: true,
|
|
86
|
+
error: _error
|
|
78
87
|
});
|
|
79
88
|
}
|
|
80
89
|
}], [{
|
|
81
90
|
key: "getDerivedStateFromError",
|
|
82
|
-
value: function getDerivedStateFromError() {
|
|
91
|
+
value: function getDerivedStateFromError(error) {
|
|
83
92
|
return {
|
|
84
|
-
isError: true
|
|
93
|
+
isError: true,
|
|
94
|
+
error: error
|
|
85
95
|
};
|
|
86
96
|
}
|
|
87
97
|
}]);
|
|
@@ -59,7 +59,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
59
59
|
renderWidth = props.renderWidth,
|
|
60
60
|
tableNode = props.tableNode,
|
|
61
61
|
rendererAppearance = props.rendererAppearance,
|
|
62
|
-
isInsideOfBlockNode = props.isInsideOfBlockNode
|
|
62
|
+
isInsideOfBlockNode = props.isInsideOfBlockNode,
|
|
63
|
+
isinsideMultiBodiedExtension = props.isinsideMultiBodiedExtension;
|
|
63
64
|
if (!columnWidths) {
|
|
64
65
|
return [];
|
|
65
66
|
}
|
|
@@ -72,7 +73,7 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
72
73
|
} else {
|
|
73
74
|
tableContainerWidth = getTableLayoutWidth(layout);
|
|
74
75
|
}
|
|
75
|
-
if ((0, _table.isTableResizingEnabled)(rendererAppearance) && !isInsideOfBlockNode && !tableResized) {
|
|
76
|
+
if ((0, _table.isTableResizingEnabled)(rendererAppearance) && !isInsideOfBlockNode && !isinsideMultiBodiedExtension && !tableResized) {
|
|
76
77
|
// for tables with no column widths defined, assume that the real table width
|
|
77
78
|
// is defined by node.attrs.width
|
|
78
79
|
var _tableWidth2 = (isNumberColumnEnabled ? tableContainerWidth - _editorSharedStyles.akEditorTableNumberColumnWidth : tableContainerWidth) - 1;
|
|
@@ -18,7 +18,8 @@ var Table = exports.Table = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
18
18
|
children = _ref.children,
|
|
19
19
|
tableNode = _ref.tableNode,
|
|
20
20
|
rendererAppearance = _ref.rendererAppearance,
|
|
21
|
-
isInsideOfBlockNode = _ref.isInsideOfBlockNode
|
|
21
|
+
isInsideOfBlockNode = _ref.isInsideOfBlockNode,
|
|
22
|
+
isinsideMultiBodiedExtension = _ref.isinsideMultiBodiedExtension;
|
|
22
23
|
var tableWidth = tableNode ? (0, _nodeWidth.getTableContainerWidth)(tableNode) : _editorSharedStyles.akEditorDefaultLayoutWidth;
|
|
23
24
|
return /*#__PURE__*/_react.default.createElement("table", {
|
|
24
25
|
"data-testid": "renderer-table",
|
|
@@ -32,6 +33,7 @@ var Table = exports.Table = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
32
33
|
renderWidth: renderWidth,
|
|
33
34
|
tableNode: tableNode,
|
|
34
35
|
rendererAppearance: rendererAppearance,
|
|
35
|
-
isInsideOfBlockNode: isInsideOfBlockNode
|
|
36
|
+
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
37
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension
|
|
36
38
|
}), /*#__PURE__*/_react.default.createElement("tbody", null, children));
|
|
37
39
|
});
|
|
@@ -295,7 +295,8 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
295
295
|
stickyHeaders = _this$props.stickyHeaders,
|
|
296
296
|
tableNode = _this$props.tableNode,
|
|
297
297
|
rendererAppearance = _this$props.rendererAppearance,
|
|
298
|
-
isInsideOfBlockNode = _this$props.isInsideOfBlockNode
|
|
298
|
+
isInsideOfBlockNode = _this$props.isInsideOfBlockNode,
|
|
299
|
+
isinsideMultiBodiedExtension = _this$props.isinsideMultiBodiedExtension;
|
|
299
300
|
var stickyMode = this.state.stickyMode;
|
|
300
301
|
var lineLength = _editorSharedStyles.akEditorDefaultLayoutWidth;
|
|
301
302
|
var tableWidth;
|
|
@@ -386,7 +387,8 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
386
387
|
renderWidth: renderWidth,
|
|
387
388
|
tableNode: tableNode,
|
|
388
389
|
rendererAppearance: rendererAppearance,
|
|
389
|
-
isInsideOfBlockNode: isInsideOfBlockNode
|
|
390
|
+
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
391
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension
|
|
390
392
|
}, this.grabFirstRowRef(children)))));
|
|
391
393
|
}
|
|
392
394
|
}]);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isLayoutNode = exports.insideBreakoutLayout = exports.insideBlockNode = exports.hasBreakOutMark = void 0;
|
|
6
|
+
exports.isLayoutNode = exports.insideMultiBodiedExtension = exports.insideBreakoutLayout = exports.insideBlockNode = exports.hasBreakOutMark = void 0;
|
|
7
7
|
var isLayoutNode = exports.isLayoutNode = function isLayoutNode(node) {
|
|
8
8
|
return node.type.name === 'layoutSection';
|
|
9
9
|
};
|
|
@@ -30,4 +30,10 @@ var insideBlockNode = exports.insideBlockNode = function insideBlockNode(path, s
|
|
|
30
30
|
return path && path.some(function (n) {
|
|
31
31
|
return n.type && blockNodeNames.indexOf(n.type.name) > -1;
|
|
32
32
|
});
|
|
33
|
+
};
|
|
34
|
+
var insideMultiBodiedExtension = exports.insideMultiBodiedExtension = function insideMultiBodiedExtension(path, schema) {
|
|
35
|
+
var multiBodiedExtension = schema.nodes.multiBodiedExtension;
|
|
36
|
+
return path.some(function (n) {
|
|
37
|
+
return n.type === multiBodiedExtension;
|
|
38
|
+
});
|
|
33
39
|
};
|
|
@@ -54,7 +54,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
54
54
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
55
55
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
56
56
|
var packageName = "@atlaskit/renderer";
|
|
57
|
-
var packageVersion = "109.6.
|
|
57
|
+
var packageVersion = "109.6.2";
|
|
58
58
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
59
59
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
60
60
|
var _super = _createSuper(Renderer);
|
|
@@ -10,7 +10,7 @@ import { getMarksByOrder, isSameMark } from '@atlaskit/editor-common/validator';
|
|
|
10
10
|
import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
|
|
11
11
|
import { getText } from '../utils';
|
|
12
12
|
import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
|
|
13
|
-
import { insideBlockNode, insideBreakoutLayout } from './renderer-node';
|
|
13
|
+
import { insideBlockNode, insideBreakoutLayout, insideMultiBodiedExtension } from './renderer-node';
|
|
14
14
|
import { isCodeMark } from './marks/code';
|
|
15
15
|
function mergeMarks(marksAndNodes) {
|
|
16
16
|
return marksAndNodes.reduce((acc, markOrNode) => {
|
|
@@ -303,13 +303,15 @@ export default class ReactSerializer {
|
|
|
303
303
|
// TODO: https://product-fabric.atlassian.net/browse/CEMS-1048
|
|
304
304
|
const stickyHeaders = !insideBreakoutLayout(path) ? this.stickyHeaders : undefined;
|
|
305
305
|
const isInsideOfBlockNode = insideBlockNode(path, node.type.schema);
|
|
306
|
+
const isinsideMultiBodiedExtension = insideMultiBodiedExtension(path, node.type.schema);
|
|
306
307
|
return {
|
|
307
308
|
...this.getProps(node),
|
|
308
309
|
allowColumnSorting: this.allowColumnSorting,
|
|
309
310
|
columnWidths: calcTableColumnWidths(node),
|
|
310
311
|
tableNode: node,
|
|
311
312
|
stickyHeaders,
|
|
312
|
-
isInsideOfBlockNode
|
|
313
|
+
isInsideOfBlockNode,
|
|
314
|
+
isinsideMultiBodiedExtension
|
|
313
315
|
};
|
|
314
316
|
}
|
|
315
317
|
getDateProps(node, parentInfo) {
|
|
@@ -83,7 +83,8 @@ export default function BlockCard(props) {
|
|
|
83
83
|
return jsx(AnalyticsContext, {
|
|
84
84
|
data: analyticsData
|
|
85
85
|
}, jsx(CardErrorBoundary, _extends({
|
|
86
|
-
unsupportedComponent: UnsupportedInline
|
|
86
|
+
unsupportedComponent: UnsupportedInline,
|
|
87
|
+
datasourceId: props.datasource.id
|
|
87
88
|
}, cardProps), jsx(WidthConsumer, null, ({
|
|
88
89
|
width
|
|
89
90
|
}) => jsx("div", {
|
|
@@ -7,7 +7,8 @@ export class CardErrorBoundary extends React.PureComponent {
|
|
|
7
7
|
constructor(...args) {
|
|
8
8
|
super(...args);
|
|
9
9
|
_defineProperty(this, "state", {
|
|
10
|
-
isError: false
|
|
10
|
+
isError: false,
|
|
11
|
+
error: null
|
|
11
12
|
});
|
|
12
13
|
_defineProperty(this, "onClickFallback", e => {
|
|
13
14
|
const {
|
|
@@ -20,9 +21,10 @@ export class CardErrorBoundary extends React.PureComponent {
|
|
|
20
21
|
}
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
static getDerivedStateFromError() {
|
|
24
|
+
static getDerivedStateFromError(error) {
|
|
24
25
|
return {
|
|
25
|
-
isError: true
|
|
26
|
+
isError: true,
|
|
27
|
+
error
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
render() {
|
|
@@ -30,7 +32,8 @@ export class CardErrorBoundary extends React.PureComponent {
|
|
|
30
32
|
const {
|
|
31
33
|
url,
|
|
32
34
|
isDatasource,
|
|
33
|
-
unsupportedComponent: UnsupportedComponent
|
|
35
|
+
unsupportedComponent: UnsupportedComponent,
|
|
36
|
+
datasourceId
|
|
34
37
|
} = this.props;
|
|
35
38
|
if (url) {
|
|
36
39
|
const fallback = /*#__PURE__*/React.createElement("a", {
|
|
@@ -39,9 +42,15 @@ export class CardErrorBoundary extends React.PureComponent {
|
|
|
39
42
|
}, url);
|
|
40
43
|
if (isDatasource) {
|
|
41
44
|
if (isSafeUrl(url)) {
|
|
42
|
-
return /*#__PURE__*/React.createElement(LazyLoadedDatasourceRenderFailedAnalyticsWrapper,
|
|
45
|
+
return /*#__PURE__*/React.createElement(LazyLoadedDatasourceRenderFailedAnalyticsWrapper, {
|
|
46
|
+
datasourceId: datasourceId,
|
|
47
|
+
error: this.state.error
|
|
48
|
+
}, /*#__PURE__*/React.createElement(InlineCard, this.props));
|
|
43
49
|
} else {
|
|
44
|
-
return /*#__PURE__*/React.createElement(LazyLoadedDatasourceRenderFailedAnalyticsWrapper,
|
|
50
|
+
return /*#__PURE__*/React.createElement(LazyLoadedDatasourceRenderFailedAnalyticsWrapper, {
|
|
51
|
+
datasourceId: datasourceId,
|
|
52
|
+
error: this.state.error
|
|
53
|
+
}, fallback);
|
|
45
54
|
}
|
|
46
55
|
} else {
|
|
47
56
|
return fallback;
|
|
@@ -54,7 +63,8 @@ export class CardErrorBoundary extends React.PureComponent {
|
|
|
54
63
|
}
|
|
55
64
|
componentDidCatch(_error) {
|
|
56
65
|
this.setState({
|
|
57
|
-
isError: true
|
|
66
|
+
isError: true,
|
|
67
|
+
error: _error
|
|
58
68
|
});
|
|
59
69
|
}
|
|
60
70
|
}
|
|
@@ -53,7 +53,8 @@ const renderScaleDownColgroup = props => {
|
|
|
53
53
|
renderWidth,
|
|
54
54
|
tableNode,
|
|
55
55
|
rendererAppearance,
|
|
56
|
-
isInsideOfBlockNode
|
|
56
|
+
isInsideOfBlockNode,
|
|
57
|
+
isinsideMultiBodiedExtension
|
|
57
58
|
} = props;
|
|
58
59
|
if (!columnWidths) {
|
|
59
60
|
return [];
|
|
@@ -67,7 +68,7 @@ const renderScaleDownColgroup = props => {
|
|
|
67
68
|
} else {
|
|
68
69
|
tableContainerWidth = getTableLayoutWidth(layout);
|
|
69
70
|
}
|
|
70
|
-
if (isTableResizingEnabled(rendererAppearance) && !isInsideOfBlockNode && !tableResized) {
|
|
71
|
+
if (isTableResizingEnabled(rendererAppearance) && !isInsideOfBlockNode && !isinsideMultiBodiedExtension && !tableResized) {
|
|
71
72
|
// for tables with no column widths defined, assume that the real table width
|
|
72
73
|
// is defined by node.attrs.width
|
|
73
74
|
const tableWidth = (isNumberColumnEnabled ? tableContainerWidth - akEditorTableNumberColumnWidth : tableContainerWidth) - 1;
|
|
@@ -11,7 +11,8 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
11
11
|
children,
|
|
12
12
|
tableNode,
|
|
13
13
|
rendererAppearance,
|
|
14
|
-
isInsideOfBlockNode
|
|
14
|
+
isInsideOfBlockNode,
|
|
15
|
+
isinsideMultiBodiedExtension
|
|
15
16
|
}) => {
|
|
16
17
|
const tableWidth = tableNode ? getTableContainerWidth(tableNode) : akEditorDefaultLayoutWidth;
|
|
17
18
|
return /*#__PURE__*/React.createElement("table", {
|
|
@@ -26,6 +27,7 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
26
27
|
renderWidth: renderWidth,
|
|
27
28
|
tableNode: tableNode,
|
|
28
29
|
rendererAppearance: rendererAppearance,
|
|
29
|
-
isInsideOfBlockNode: isInsideOfBlockNode
|
|
30
|
+
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
31
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension
|
|
30
32
|
}), /*#__PURE__*/React.createElement("tbody", null, children));
|
|
31
33
|
});
|
|
@@ -239,7 +239,8 @@ export class TableContainer extends React.Component {
|
|
|
239
239
|
stickyHeaders,
|
|
240
240
|
tableNode,
|
|
241
241
|
rendererAppearance,
|
|
242
|
-
isInsideOfBlockNode
|
|
242
|
+
isInsideOfBlockNode,
|
|
243
|
+
isinsideMultiBodiedExtension
|
|
243
244
|
} = this.props;
|
|
244
245
|
const {
|
|
245
246
|
stickyMode
|
|
@@ -333,7 +334,8 @@ export class TableContainer extends React.Component {
|
|
|
333
334
|
renderWidth: renderWidth,
|
|
334
335
|
tableNode: tableNode,
|
|
335
336
|
rendererAppearance: rendererAppearance,
|
|
336
|
-
isInsideOfBlockNode: isInsideOfBlockNode
|
|
337
|
+
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
338
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension
|
|
337
339
|
}, this.grabFirstRowRef(children)))));
|
|
338
340
|
}
|
|
339
341
|
}
|
|
@@ -11,4 +11,12 @@ export const insideBlockNode = (path, schema) => {
|
|
|
11
11
|
} = schema;
|
|
12
12
|
const blockNodeNames = [expand, nestedExpand, layoutColumn].filter(node => Boolean(node)).map(node => node.name);
|
|
13
13
|
return path && path.some(n => n.type && blockNodeNames.indexOf(n.type.name) > -1);
|
|
14
|
+
};
|
|
15
|
+
export const insideMultiBodiedExtension = (path, schema) => {
|
|
16
|
+
const {
|
|
17
|
+
nodes: {
|
|
18
|
+
multiBodiedExtension
|
|
19
|
+
}
|
|
20
|
+
} = schema;
|
|
21
|
+
return path.some(n => n.type === multiBodiedExtension);
|
|
14
22
|
};
|
|
@@ -35,7 +35,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
35
35
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
36
36
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
37
37
|
const packageName = "@atlaskit/renderer";
|
|
38
|
-
const packageVersion = "109.6.
|
|
38
|
+
const packageVersion = "109.6.2";
|
|
39
39
|
export class Renderer extends PureComponent {
|
|
40
40
|
constructor(props) {
|
|
41
41
|
super(props);
|
package/dist/esm/react/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { getMarksByOrder, isSameMark } from '@atlaskit/editor-common/validator';
|
|
|
17
17
|
import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
|
|
18
18
|
import { getText } from '../utils';
|
|
19
19
|
import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
|
|
20
|
-
import { insideBlockNode, insideBreakoutLayout } from './renderer-node';
|
|
20
|
+
import { insideBlockNode, insideBreakoutLayout, insideMultiBodiedExtension } from './renderer-node';
|
|
21
21
|
import { isCodeMark } from './marks/code';
|
|
22
22
|
function mergeMarks(marksAndNodes) {
|
|
23
23
|
return marksAndNodes.reduce(function (acc, markOrNode) {
|
|
@@ -336,12 +336,14 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
336
336
|
// TODO: https://product-fabric.atlassian.net/browse/CEMS-1048
|
|
337
337
|
var stickyHeaders = !insideBreakoutLayout(path) ? this.stickyHeaders : undefined;
|
|
338
338
|
var isInsideOfBlockNode = insideBlockNode(path, node.type.schema);
|
|
339
|
+
var isinsideMultiBodiedExtension = insideMultiBodiedExtension(path, node.type.schema);
|
|
339
340
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
340
341
|
allowColumnSorting: this.allowColumnSorting,
|
|
341
342
|
columnWidths: calcTableColumnWidths(node),
|
|
342
343
|
tableNode: node,
|
|
343
344
|
stickyHeaders: stickyHeaders,
|
|
344
|
-
isInsideOfBlockNode: isInsideOfBlockNode
|
|
345
|
+
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
346
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension
|
|
345
347
|
});
|
|
346
348
|
}
|
|
347
349
|
}, {
|
|
@@ -85,7 +85,8 @@ export default function BlockCard(props) {
|
|
|
85
85
|
return jsx(AnalyticsContext, {
|
|
86
86
|
data: analyticsData
|
|
87
87
|
}, jsx(CardErrorBoundary, _extends({
|
|
88
|
-
unsupportedComponent: UnsupportedInline
|
|
88
|
+
unsupportedComponent: UnsupportedInline,
|
|
89
|
+
datasourceId: props.datasource.id
|
|
89
90
|
}, cardProps), jsx(WidthConsumer, null, function (_ref5) {
|
|
90
91
|
var width = _ref5.width;
|
|
91
92
|
return jsx("div", {
|
|
@@ -22,7 +22,8 @@ export var CardErrorBoundary = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22
22
|
}
|
|
23
23
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
24
24
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
25
|
-
isError: false
|
|
25
|
+
isError: false,
|
|
26
|
+
error: null
|
|
26
27
|
});
|
|
27
28
|
_defineProperty(_assertThisInitialized(_this), "onClickFallback", function (e) {
|
|
28
29
|
var _this$props = _this.props,
|
|
@@ -42,7 +43,8 @@ export var CardErrorBoundary = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
42
43
|
var _this$props2 = this.props,
|
|
43
44
|
_url = _this$props2.url,
|
|
44
45
|
isDatasource = _this$props2.isDatasource,
|
|
45
|
-
UnsupportedComponent = _this$props2.unsupportedComponent
|
|
46
|
+
UnsupportedComponent = _this$props2.unsupportedComponent,
|
|
47
|
+
datasourceId = _this$props2.datasourceId;
|
|
46
48
|
if (_url) {
|
|
47
49
|
var fallback = /*#__PURE__*/React.createElement("a", {
|
|
48
50
|
href: _url,
|
|
@@ -50,9 +52,15 @@ export var CardErrorBoundary = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
50
52
|
}, _url);
|
|
51
53
|
if (isDatasource) {
|
|
52
54
|
if (isSafeUrl(_url)) {
|
|
53
|
-
return /*#__PURE__*/React.createElement(LazyLoadedDatasourceRenderFailedAnalyticsWrapper,
|
|
55
|
+
return /*#__PURE__*/React.createElement(LazyLoadedDatasourceRenderFailedAnalyticsWrapper, {
|
|
56
|
+
datasourceId: datasourceId,
|
|
57
|
+
error: this.state.error
|
|
58
|
+
}, /*#__PURE__*/React.createElement(InlineCard, this.props));
|
|
54
59
|
} else {
|
|
55
|
-
return /*#__PURE__*/React.createElement(LazyLoadedDatasourceRenderFailedAnalyticsWrapper,
|
|
60
|
+
return /*#__PURE__*/React.createElement(LazyLoadedDatasourceRenderFailedAnalyticsWrapper, {
|
|
61
|
+
datasourceId: datasourceId,
|
|
62
|
+
error: this.state.error
|
|
63
|
+
}, fallback);
|
|
56
64
|
}
|
|
57
65
|
} else {
|
|
58
66
|
return fallback;
|
|
@@ -67,14 +75,16 @@ export var CardErrorBoundary = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
67
75
|
key: "componentDidCatch",
|
|
68
76
|
value: function componentDidCatch(_error) {
|
|
69
77
|
this.setState({
|
|
70
|
-
isError: true
|
|
78
|
+
isError: true,
|
|
79
|
+
error: _error
|
|
71
80
|
});
|
|
72
81
|
}
|
|
73
82
|
}], [{
|
|
74
83
|
key: "getDerivedStateFromError",
|
|
75
|
-
value: function getDerivedStateFromError() {
|
|
84
|
+
value: function getDerivedStateFromError(error) {
|
|
76
85
|
return {
|
|
77
|
-
isError: true
|
|
86
|
+
isError: true,
|
|
87
|
+
error: error
|
|
78
88
|
};
|
|
79
89
|
}
|
|
80
90
|
}]);
|
|
@@ -53,7 +53,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
53
53
|
renderWidth = props.renderWidth,
|
|
54
54
|
tableNode = props.tableNode,
|
|
55
55
|
rendererAppearance = props.rendererAppearance,
|
|
56
|
-
isInsideOfBlockNode = props.isInsideOfBlockNode
|
|
56
|
+
isInsideOfBlockNode = props.isInsideOfBlockNode,
|
|
57
|
+
isinsideMultiBodiedExtension = props.isinsideMultiBodiedExtension;
|
|
57
58
|
if (!columnWidths) {
|
|
58
59
|
return [];
|
|
59
60
|
}
|
|
@@ -66,7 +67,7 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
66
67
|
} else {
|
|
67
68
|
tableContainerWidth = getTableLayoutWidth(layout);
|
|
68
69
|
}
|
|
69
|
-
if (isTableResizingEnabled(rendererAppearance) && !isInsideOfBlockNode && !tableResized) {
|
|
70
|
+
if (isTableResizingEnabled(rendererAppearance) && !isInsideOfBlockNode && !isinsideMultiBodiedExtension && !tableResized) {
|
|
70
71
|
// for tables with no column widths defined, assume that the real table width
|
|
71
72
|
// is defined by node.attrs.width
|
|
72
73
|
var _tableWidth2 = (isNumberColumnEnabled ? tableContainerWidth - akEditorTableNumberColumnWidth : tableContainerWidth) - 1;
|
|
@@ -11,7 +11,8 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
11
11
|
children = _ref.children,
|
|
12
12
|
tableNode = _ref.tableNode,
|
|
13
13
|
rendererAppearance = _ref.rendererAppearance,
|
|
14
|
-
isInsideOfBlockNode = _ref.isInsideOfBlockNode
|
|
14
|
+
isInsideOfBlockNode = _ref.isInsideOfBlockNode,
|
|
15
|
+
isinsideMultiBodiedExtension = _ref.isinsideMultiBodiedExtension;
|
|
15
16
|
var tableWidth = tableNode ? getTableContainerWidth(tableNode) : akEditorDefaultLayoutWidth;
|
|
16
17
|
return /*#__PURE__*/React.createElement("table", {
|
|
17
18
|
"data-testid": "renderer-table",
|
|
@@ -25,6 +26,7 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
25
26
|
renderWidth: renderWidth,
|
|
26
27
|
tableNode: tableNode,
|
|
27
28
|
rendererAppearance: rendererAppearance,
|
|
28
|
-
isInsideOfBlockNode: isInsideOfBlockNode
|
|
29
|
+
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
30
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension
|
|
29
31
|
}), /*#__PURE__*/React.createElement("tbody", null, children));
|
|
30
32
|
});
|
|
@@ -288,7 +288,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
288
288
|
stickyHeaders = _this$props.stickyHeaders,
|
|
289
289
|
tableNode = _this$props.tableNode,
|
|
290
290
|
rendererAppearance = _this$props.rendererAppearance,
|
|
291
|
-
isInsideOfBlockNode = _this$props.isInsideOfBlockNode
|
|
291
|
+
isInsideOfBlockNode = _this$props.isInsideOfBlockNode,
|
|
292
|
+
isinsideMultiBodiedExtension = _this$props.isinsideMultiBodiedExtension;
|
|
292
293
|
var stickyMode = this.state.stickyMode;
|
|
293
294
|
var lineLength = akEditorDefaultLayoutWidth;
|
|
294
295
|
var tableWidth;
|
|
@@ -379,7 +380,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
379
380
|
renderWidth: renderWidth,
|
|
380
381
|
tableNode: tableNode,
|
|
381
382
|
rendererAppearance: rendererAppearance,
|
|
382
|
-
isInsideOfBlockNode: isInsideOfBlockNode
|
|
383
|
+
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
384
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension
|
|
383
385
|
}, this.grabFirstRowRef(children)))));
|
|
384
386
|
}
|
|
385
387
|
}]);
|
|
@@ -24,4 +24,10 @@ export var insideBlockNode = function insideBlockNode(path, schema) {
|
|
|
24
24
|
return path && path.some(function (n) {
|
|
25
25
|
return n.type && blockNodeNames.indexOf(n.type.name) > -1;
|
|
26
26
|
});
|
|
27
|
+
};
|
|
28
|
+
export var insideMultiBodiedExtension = function insideMultiBodiedExtension(path, schema) {
|
|
29
|
+
var multiBodiedExtension = schema.nodes.multiBodiedExtension;
|
|
30
|
+
return path.some(function (n) {
|
|
31
|
+
return n.type === multiBodiedExtension;
|
|
32
|
+
});
|
|
27
33
|
};
|
|
@@ -45,7 +45,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
45
45
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
46
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
47
|
var packageName = "@atlaskit/renderer";
|
|
48
|
-
var packageVersion = "109.6.
|
|
48
|
+
var packageVersion = "109.6.2";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
|
@@ -7,13 +7,16 @@ export declare class CardErrorBoundary extends React.PureComponent<{
|
|
|
7
7
|
onClick?: (e: React.MouseEvent<HTMLElement>, url?: string) => void;
|
|
8
8
|
isDatasource?: boolean;
|
|
9
9
|
children?: React.ReactNode;
|
|
10
|
+
datasourceId?: string;
|
|
10
11
|
} & CardErrorBoundaryProps> {
|
|
11
12
|
state: {
|
|
12
13
|
isError: boolean;
|
|
14
|
+
error: null;
|
|
13
15
|
};
|
|
14
16
|
onClickFallback: (e: React.MouseEvent<HTMLElement>) => void;
|
|
15
|
-
static getDerivedStateFromError(): {
|
|
17
|
+
static getDerivedStateFromError(error: Error): {
|
|
16
18
|
isError: boolean;
|
|
19
|
+
error: Error;
|
|
17
20
|
};
|
|
18
21
|
render(): React.ReactNode;
|
|
19
22
|
componentDidCatch(_error: Error): void;
|
|
@@ -4,4 +4,4 @@ export 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, }: TableProps) => JSX.Element>;
|
|
7
|
+
export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, isInsideOfBlockNode, isinsideMultiBodiedExtension, }: TableProps) => JSX.Element>;
|
|
@@ -3,3 +3,4 @@ export declare const isLayoutNode: (node: Node) => boolean;
|
|
|
3
3
|
export declare const hasBreakOutMark: (node: Node) => boolean;
|
|
4
4
|
export declare const insideBreakoutLayout: (path: Node[]) => boolean;
|
|
5
5
|
export declare const insideBlockNode: (path: Node[], schema: Schema) => boolean;
|
|
6
|
+
export declare const insideMultiBodiedExtension: (path: Node[], schema: Schema) => boolean;
|
|
@@ -7,13 +7,16 @@ export declare class CardErrorBoundary extends React.PureComponent<{
|
|
|
7
7
|
onClick?: (e: React.MouseEvent<HTMLElement>, url?: string) => void;
|
|
8
8
|
isDatasource?: boolean;
|
|
9
9
|
children?: React.ReactNode;
|
|
10
|
+
datasourceId?: string;
|
|
10
11
|
} & CardErrorBoundaryProps> {
|
|
11
12
|
state: {
|
|
12
13
|
isError: boolean;
|
|
14
|
+
error: null;
|
|
13
15
|
};
|
|
14
16
|
onClickFallback: (e: React.MouseEvent<HTMLElement>) => void;
|
|
15
|
-
static getDerivedStateFromError(): {
|
|
17
|
+
static getDerivedStateFromError(error: Error): {
|
|
16
18
|
isError: boolean;
|
|
19
|
+
error: Error;
|
|
17
20
|
};
|
|
18
21
|
render(): React.ReactNode;
|
|
19
22
|
componentDidCatch(_error: Error): void;
|
|
@@ -4,4 +4,4 @@ export 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, }: TableProps) => JSX.Element>;
|
|
7
|
+
export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, isInsideOfBlockNode, isinsideMultiBodiedExtension, }: TableProps) => JSX.Element>;
|
|
@@ -3,3 +3,4 @@ export declare const isLayoutNode: (node: Node) => boolean;
|
|
|
3
3
|
export declare const hasBreakOutMark: (node: Node) => boolean;
|
|
4
4
|
export declare const insideBreakoutLayout: (path: Node[]) => boolean;
|
|
5
5
|
export declare const insideBlockNode: (path: Node[], schema: Schema) => boolean;
|
|
6
|
+
export declare const insideMultiBodiedExtension: (path: Node[], schema: Schema) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.6.
|
|
3
|
+
"version": "109.6.2",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,23 +29,23 @@
|
|
|
29
29
|
"@atlaskit/analytics-listeners": "^8.9.0",
|
|
30
30
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
31
31
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
32
|
-
"@atlaskit/button": "^17.
|
|
32
|
+
"@atlaskit/button": "^17.6.0",
|
|
33
33
|
"@atlaskit/code": "^15.1.0",
|
|
34
|
-
"@atlaskit/editor-common": "^78.
|
|
34
|
+
"@atlaskit/editor-common": "^78.9.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.2",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
38
38
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
39
39
|
"@atlaskit/emoji": "^67.6.0",
|
|
40
40
|
"@atlaskit/icon": "^22.1.0",
|
|
41
|
-
"@atlaskit/link-datasource": "^1.
|
|
41
|
+
"@atlaskit/link-datasource": "^1.23.0",
|
|
42
42
|
"@atlaskit/media-card": "^77.10.0",
|
|
43
43
|
"@atlaskit/media-client": "^26.2.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^2.0.0",
|
|
45
45
|
"@atlaskit/media-common": "^11.0.0",
|
|
46
46
|
"@atlaskit/media-filmstrip": "^47.0.0",
|
|
47
|
-
"@atlaskit/media-ui": "^25.
|
|
48
|
-
"@atlaskit/media-viewer": "^48.
|
|
47
|
+
"@atlaskit/media-ui": "^25.3.0",
|
|
48
|
+
"@atlaskit/media-viewer": "^48.3.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
50
50
|
"@atlaskit/smart-card": "^26.48.0",
|
|
51
51
|
"@atlaskit/status": "^1.4.0",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"@atlaskit/css-reset": "^6.6.0",
|
|
75
75
|
"@atlaskit/link-provider": "^1.7.0",
|
|
76
76
|
"@atlaskit/link-test-helpers": "^6.2.0",
|
|
77
|
+
"@atlaskit/linking-common": "^5.3.0",
|
|
77
78
|
"@atlaskit/media-core": "^34.2.0",
|
|
78
79
|
"@atlaskit/media-integration-test-helpers": "^3.0.0",
|
|
79
80
|
"@atlaskit/media-test-helpers": "^33.0.0",
|