@atlaskit/renderer 108.11.14 → 108.11.16
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 +12 -0
- package/dist/cjs/react/index.js +6 -29
- package/dist/cjs/react/nodes/table/colgroup.js +5 -4
- package/dist/cjs/react/nodes/table/table.js +4 -2
- package/dist/cjs/react/nodes/table.js +49 -19
- package/dist/cjs/react/renderer-node.js +17 -2
- package/dist/cjs/ui/Renderer/breakout-ssr.js +12 -4
- package/dist/cjs/ui/Renderer/index.js +3 -2
- package/dist/es2019/react/index.js +6 -20
- package/dist/es2019/react/nodes/table/colgroup.js +5 -4
- package/dist/es2019/react/nodes/table/table.js +4 -2
- package/dist/es2019/react/nodes/table.js +35 -7
- package/dist/es2019/react/renderer-node.js +12 -1
- package/dist/es2019/ui/Renderer/breakout-ssr.js +12 -4
- package/dist/es2019/ui/Renderer/index.js +3 -2
- package/dist/esm/react/index.js +7 -30
- package/dist/esm/react/nodes/table/colgroup.js +5 -4
- package/dist/esm/react/nodes/table/table.js +4 -2
- package/dist/esm/react/nodes/table.js +50 -21
- package/dist/esm/react/renderer-node.js +14 -0
- package/dist/esm/ui/Renderer/breakout-ssr.js +12 -4
- package/dist/esm/ui/Renderer/index.js +3 -2
- package/dist/types/react/index.d.ts +10 -10
- package/dist/types/react/nodes/table/table.d.ts +2 -2
- package/dist/types/react/nodes/table/types.d.ts +4 -3
- package/dist/types/react/renderer-node.d.ts +2 -1
- package/dist/types-ts4.5/react/index.d.ts +10 -10
- package/dist/types-ts4.5/react/nodes/table/table.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/table/types.d.ts +4 -3
- package/dist/types-ts4.5/react/renderer-node.d.ts +2 -1
- package/package.json +6 -6
- package/report.api.md +1 -1
- package/tmp/api-report-tmp.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 108.11.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b821b2d7ac1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b821b2d7ac1) - Fix issue where tables with no column widths would render at their layout value when nested inside another node, render tables with no column widths in this scenario so they scale with the parent node.
|
|
8
|
+
|
|
9
|
+
## 108.11.15
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`2325dd0eb57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2325dd0eb57) - fix width issue on initial load
|
|
14
|
+
|
|
3
15
|
## 108.11.14
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -340,11 +340,13 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
340
340
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
341
341
|
// TODO: https://product-fabric.atlassian.net/browse/CEMS-1048
|
|
342
342
|
var stickyHeaders = !(0, _rendererNode.insideBreakoutLayout)(path) ? this.stickyHeaders : undefined;
|
|
343
|
+
var isInsideOfBlockNode = (0, _rendererNode.insideBlockNode)(path, node.type.schema);
|
|
343
344
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
344
345
|
allowColumnSorting: this.allowColumnSorting,
|
|
345
346
|
columnWidths: (0, _utils.calcTableColumnWidths)(node),
|
|
346
347
|
tableNode: node,
|
|
347
|
-
stickyHeaders: stickyHeaders
|
|
348
|
+
stickyHeaders: stickyHeaders,
|
|
349
|
+
isInsideOfBlockNode: isInsideOfBlockNode
|
|
348
350
|
});
|
|
349
351
|
}
|
|
350
352
|
}, {
|
|
@@ -360,21 +362,8 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
360
362
|
value: function getMediaSingleProps(node) {
|
|
361
363
|
var _this5 = this;
|
|
362
364
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
363
|
-
var
|
|
364
|
-
|
|
365
|
-
expand = _node$type$schema$nod.expand,
|
|
366
|
-
nestedExpand = _node$type$schema$nod.nestedExpand,
|
|
367
|
-
layoutColumn = _node$type$schema$nod.layoutColumn,
|
|
368
|
-
link = _node$type$schema.marks.link;
|
|
369
|
-
var blockNodeNames = [expand, nestedExpand, layoutColumn].filter(function (node) {
|
|
370
|
-
return Boolean(node);
|
|
371
|
-
}) // Check if the node exist first
|
|
372
|
-
.map(function (node) {
|
|
373
|
-
return node.name;
|
|
374
|
-
});
|
|
375
|
-
var isInsideOfBlockNode = path && path.some(function (n) {
|
|
376
|
-
return n.type && blockNodeNames.indexOf(n.type.name) > -1;
|
|
377
|
-
});
|
|
365
|
+
var link = node.type.schema.marks.link;
|
|
366
|
+
var isInsideOfBlockNode = (0, _rendererNode.insideBlockNode)(path, node.type.schema);
|
|
378
367
|
var isLinkMark = function isLinkMark(mark) {
|
|
379
368
|
return mark.type === link;
|
|
380
369
|
};
|
|
@@ -429,19 +418,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
429
418
|
key: "getEmbedCardProps",
|
|
430
419
|
value: function getEmbedCardProps(node) {
|
|
431
420
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
432
|
-
var
|
|
433
|
-
expand = _node$type$schema$nod2.expand,
|
|
434
|
-
nestedExpand = _node$type$schema$nod2.nestedExpand,
|
|
435
|
-
layoutColumn = _node$type$schema$nod2.layoutColumn;
|
|
436
|
-
var blockNodeNames = [expand, nestedExpand, layoutColumn].filter(function (node) {
|
|
437
|
-
return Boolean(node);
|
|
438
|
-
}) // Check if the node exist first
|
|
439
|
-
.map(function (node) {
|
|
440
|
-
return node.name;
|
|
441
|
-
});
|
|
442
|
-
var isInsideOfBlockNode = path && path.some(function (n) {
|
|
443
|
-
return n.type && blockNodeNames.indexOf(n.type.name) > -1;
|
|
444
|
-
});
|
|
421
|
+
var isInsideOfBlockNode = (0, _rendererNode.insideBlockNode)(path, node.type.schema);
|
|
445
422
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
446
423
|
isInsideOfBlockNode: isInsideOfBlockNode
|
|
447
424
|
});
|
|
@@ -60,7 +60,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
60
60
|
isNumberColumnEnabled = props.isNumberColumnEnabled,
|
|
61
61
|
renderWidth = props.renderWidth,
|
|
62
62
|
tableNode = props.tableNode,
|
|
63
|
-
rendererAppearance = props.rendererAppearance
|
|
63
|
+
rendererAppearance = props.rendererAppearance,
|
|
64
|
+
isInsideOfBlockNode = props.isInsideOfBlockNode;
|
|
64
65
|
if (!columnWidths) {
|
|
65
66
|
return [];
|
|
66
67
|
}
|
|
@@ -73,12 +74,12 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
73
74
|
} else {
|
|
74
75
|
tableContainerWidth = getTableLayoutWidth(layout);
|
|
75
76
|
}
|
|
76
|
-
if ((0, _table.isTableResizingEnabled)(rendererAppearance) && !tableResized) {
|
|
77
|
+
if ((0, _table.isTableResizingEnabled)(rendererAppearance) && !isInsideOfBlockNode && !tableResized) {
|
|
77
78
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width-scale-down-undefined-column_nkyvx')) {
|
|
78
79
|
// for tables with no column widths defined, assume that the real table width
|
|
79
80
|
// is defined by node.attrs.width
|
|
80
|
-
var _tableWidth2 = isNumberColumnEnabled ? tableContainerWidth - _editorSharedStyles.akEditorTableNumberColumnWidth : tableContainerWidth;
|
|
81
|
-
var defaultColumnWidth =
|
|
81
|
+
var _tableWidth2 = (isNumberColumnEnabled ? tableContainerWidth - _editorSharedStyles.akEditorTableNumberColumnWidth : tableContainerWidth) - 1;
|
|
82
|
+
var defaultColumnWidth = _tableWidth2 / noOfColumns;
|
|
82
83
|
targetWidths = new Array(noOfColumns).fill(defaultColumnWidth);
|
|
83
84
|
} else {
|
|
84
85
|
return new Array(noOfColumns).fill({
|
|
@@ -15,7 +15,8 @@ var Table = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
15
15
|
renderWidth = _ref.renderWidth,
|
|
16
16
|
children = _ref.children,
|
|
17
17
|
tableNode = _ref.tableNode,
|
|
18
|
-
rendererAppearance = _ref.rendererAppearance
|
|
18
|
+
rendererAppearance = _ref.rendererAppearance,
|
|
19
|
+
isInsideOfBlockNode = _ref.isInsideOfBlockNode;
|
|
19
20
|
return /*#__PURE__*/_react.default.createElement("table", {
|
|
20
21
|
"data-testid": "renderer-table",
|
|
21
22
|
"data-number-column": isNumberColumnEnabled,
|
|
@@ -26,7 +27,8 @@ var Table = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
26
27
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
27
28
|
renderWidth: renderWidth,
|
|
28
29
|
tableNode: tableNode,
|
|
29
|
-
rendererAppearance: rendererAppearance
|
|
30
|
+
rendererAppearance: rendererAppearance,
|
|
31
|
+
isInsideOfBlockNode: isInsideOfBlockNode
|
|
30
32
|
}), /*#__PURE__*/_react.default.createElement("tbody", null, children));
|
|
31
33
|
});
|
|
32
34
|
exports.Table = Table;
|
|
@@ -295,13 +295,26 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
295
295
|
columnWidths = _this$props.columnWidths,
|
|
296
296
|
stickyHeaders = _this$props.stickyHeaders,
|
|
297
297
|
tableNode = _this$props.tableNode,
|
|
298
|
-
rendererAppearance = _this$props.rendererAppearance
|
|
298
|
+
rendererAppearance = _this$props.rendererAppearance,
|
|
299
|
+
isInsideOfBlockNode = _this$props.isInsideOfBlockNode;
|
|
299
300
|
var stickyMode = this.state.stickyMode;
|
|
300
301
|
var lineLength = _editorSharedStyles.akEditorDefaultLayoutWidth;
|
|
301
302
|
var tableWidth;
|
|
302
303
|
var left;
|
|
304
|
+
var updatedLayout;
|
|
305
|
+
|
|
306
|
+
// The tableWidth and left offset logic below must stay aligned with the `breakout-ssr.tsx` logic
|
|
307
|
+
// Please consider changes below carefully to not negatively impact SSR
|
|
308
|
+
// `renderWidth` cannot be depended on during SSR
|
|
309
|
+
var isRenderWidthValid = !!renderWidth && renderWidth > 0;
|
|
303
310
|
var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance) {
|
|
304
|
-
|
|
311
|
+
if (rendererAppearance === 'full-width' && !tableNode.attrs.width) {
|
|
312
|
+
return isRenderWidthValid ? Math.min(_editorSharedStyles.akEditorFullWidthLayoutWidth, renderWidth) : _editorSharedStyles.akEditorFullWidthLayoutWidth;
|
|
313
|
+
} else {
|
|
314
|
+
// custom width, or width mapped to breakpoint
|
|
315
|
+
var tableContainerWidth = (0, _nodeWidth.getTableContainerWidth)(tableNode);
|
|
316
|
+
return isRenderWidthValid ? Math.min(tableContainerWidth, renderWidth) : tableContainerWidth;
|
|
317
|
+
}
|
|
305
318
|
};
|
|
306
319
|
if (isTableResizingEnabled(rendererAppearance) && tableNode) {
|
|
307
320
|
tableWidth = calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance);
|
|
@@ -312,6 +325,18 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
312
325
|
left = lineLength / 2 - tableWidth / 2;
|
|
313
326
|
}
|
|
314
327
|
var children = _react.default.Children.toArray(this.props.children);
|
|
328
|
+
|
|
329
|
+
// Historically, tables in the full-width renderer had their layout set to 'default' which is deceiving.
|
|
330
|
+
// This check caters for those tables and helps with SSR logic
|
|
331
|
+
var isFullWidth = !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width) && rendererAppearance === 'full-width' && layout !== 'full-width';
|
|
332
|
+
var hasCustomWidth = isTableResizingEnabled(rendererAppearance) && (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.width);
|
|
333
|
+
if (isFullWidth) {
|
|
334
|
+
updatedLayout = 'full-width';
|
|
335
|
+
} else if (hasCustomWidth) {
|
|
336
|
+
updatedLayout = 'custom';
|
|
337
|
+
} else {
|
|
338
|
+
updatedLayout = layout;
|
|
339
|
+
}
|
|
315
340
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/_react.default.createElement(_sticky.StickyTable, {
|
|
316
341
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
317
342
|
tableWidth: tableWidth,
|
|
@@ -329,7 +354,7 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
329
354
|
rendererAppearance: rendererAppearance
|
|
330
355
|
}, [children && children[0]]), /*#__PURE__*/_react.default.createElement("div", {
|
|
331
356
|
className: "".concat(_styles.TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames || ''),
|
|
332
|
-
"data-layout":
|
|
357
|
+
"data-layout": updatedLayout,
|
|
333
358
|
ref: this.props.handleRef,
|
|
334
359
|
style: {
|
|
335
360
|
width: tableWidth,
|
|
@@ -361,7 +386,8 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
361
386
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
362
387
|
renderWidth: renderWidth,
|
|
363
388
|
tableNode: tableNode,
|
|
364
|
-
rendererAppearance: rendererAppearance
|
|
389
|
+
rendererAppearance: rendererAppearance,
|
|
390
|
+
isInsideOfBlockNode: isInsideOfBlockNode
|
|
365
391
|
}, this.grabFirstRowRef(children)))));
|
|
366
392
|
}
|
|
367
393
|
}]);
|
|
@@ -435,23 +461,27 @@ var TableWithShadows = (0, _ui.overflowShadow)(TableProcessor, {
|
|
|
435
461
|
useShadowObserver: true
|
|
436
462
|
});
|
|
437
463
|
var TableWithWidth = function TableWithWidth(props) {
|
|
438
|
-
return
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
464
|
+
return (
|
|
465
|
+
/*#__PURE__*/
|
|
466
|
+
// Remember, `width` will be 0 during SSR
|
|
467
|
+
_react.default.createElement(_ui.WidthConsumer, null, function (_ref2) {
|
|
468
|
+
var _props$columnWidths;
|
|
469
|
+
var width = _ref2.width;
|
|
470
|
+
var renderWidth = props.rendererAppearance === 'full-page' ? width - _style.FullPagePadding * 2 : width;
|
|
471
|
+
var colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
472
|
+
return total + val;
|
|
473
|
+
}, 0)) || 0;
|
|
474
|
+
if (colWidthsSum || (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width-scale-down-undefined-column_nkyvx') && isTableResizingEnabled(props.rendererAppearance)) {
|
|
475
|
+
return /*#__PURE__*/_react.default.createElement(TableWithShadows, (0, _extends2.default)({
|
|
476
|
+
renderWidth: renderWidth
|
|
477
|
+
}, props));
|
|
478
|
+
}
|
|
479
|
+
// there should not be a case when colWidthsSum is 0 and table is in overflow state - so no need to render shadows in this case
|
|
480
|
+
return /*#__PURE__*/_react.default.createElement(TableProcessor, (0, _extends2.default)({
|
|
447
481
|
renderWidth: renderWidth
|
|
448
482
|
}, props));
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
return /*#__PURE__*/_react.default.createElement(TableProcessor, (0, _extends2.default)({
|
|
452
|
-
renderWidth: renderWidth
|
|
453
|
-
}, props));
|
|
454
|
-
});
|
|
483
|
+
})
|
|
484
|
+
);
|
|
455
485
|
};
|
|
456
486
|
var _default = (0, _SmartCardStorage.withSmartCardStorage)(TableWithWidth);
|
|
457
487
|
exports.default = _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isLayoutNode = exports.insideBreakoutLayout = exports.hasBreakOutMark = void 0;
|
|
6
|
+
exports.isLayoutNode = exports.insideBreakoutLayout = exports.insideBlockNode = exports.hasBreakOutMark = void 0;
|
|
7
7
|
var isLayoutNode = function isLayoutNode(node) {
|
|
8
8
|
return node.type.name === 'layoutSection';
|
|
9
9
|
};
|
|
@@ -19,4 +19,19 @@ var insideBreakoutLayout = function insideBreakoutLayout(path) {
|
|
|
19
19
|
return isLayoutNode(item) && hasBreakOutMark(item);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
exports.insideBreakoutLayout = insideBreakoutLayout;
|
|
22
|
+
exports.insideBreakoutLayout = insideBreakoutLayout;
|
|
23
|
+
var insideBlockNode = function insideBlockNode(path, schema) {
|
|
24
|
+
var _schema$nodes = schema.nodes,
|
|
25
|
+
expand = _schema$nodes.expand,
|
|
26
|
+
nestedExpand = _schema$nodes.nestedExpand,
|
|
27
|
+
layoutColumn = _schema$nodes.layoutColumn;
|
|
28
|
+
var blockNodeNames = [expand, nestedExpand, layoutColumn].filter(function (node) {
|
|
29
|
+
return Boolean(node);
|
|
30
|
+
}).map(function (node) {
|
|
31
|
+
return node.name;
|
|
32
|
+
});
|
|
33
|
+
return path && path.some(function (n) {
|
|
34
|
+
return n.type && blockNodeNames.indexOf(n.type.name) > -1;
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.insideBlockNode = insideBlockNode;
|
|
@@ -42,7 +42,7 @@ var breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.string
|
|
|
42
42
|
exports.breakoutInlineScriptContext = breakoutInlineScriptContext;
|
|
43
43
|
function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
44
44
|
var MEDIA_NODE_TYPE = 'mediaSingle';
|
|
45
|
-
var WIDE_LAYOUT_MODES = ['full-width', 'wide'];
|
|
45
|
+
var WIDE_LAYOUT_MODES = ['full-width', 'wide', 'custom'];
|
|
46
46
|
function findUp(element, condition) {
|
|
47
47
|
if (!element) {
|
|
48
48
|
return;
|
|
@@ -68,12 +68,18 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
68
68
|
}
|
|
69
69
|
if (item.target.classList.contains('ak-renderer-document')) {
|
|
70
70
|
item.addedNodes.forEach(function (maybeNode) {
|
|
71
|
+
var width;
|
|
71
72
|
var node = maybeNode;
|
|
72
73
|
var mode = node.dataset.mode || node.dataset.layout || '';
|
|
73
74
|
if (!mode || !WIDE_LAYOUT_MODES.includes(mode)) {
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
+
if (node.classList.contains('pm-table-container') && mode === 'custom') {
|
|
78
|
+
var effectiveWidth = renderer.offsetWidth - breakoutConsts.padding;
|
|
79
|
+
width = "".concat(Math.min(parseInt(node.style.width), effectiveWidth), "px");
|
|
80
|
+
} else {
|
|
81
|
+
width = breakoutConsts.calcBreakoutWidth(mode, renderer.offsetWidth);
|
|
82
|
+
}
|
|
77
83
|
if (node.style.width === width) {
|
|
78
84
|
return;
|
|
79
85
|
}
|
|
@@ -82,11 +88,13 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
82
88
|
// Tables require some special logic, as they are not using common css transform approach,
|
|
83
89
|
// because it breaks with sticky headers. This logic is copied from a table node:
|
|
84
90
|
// https://bitbucket.org/atlassian/atlassian-frontend/src/77938aee0c140d02ff99b98a03849be1236865b4/packages/editor/renderer/src/react/nodes/table.tsx#table.tsx-235:245
|
|
85
|
-
if (node.classList.contains('pm-table-container')) {
|
|
91
|
+
if (node.classList.contains('pm-table-container') && !renderer.classList.contains('is-full-width')) {
|
|
86
92
|
var lineLength = breakoutConsts.calcLineLength();
|
|
87
93
|
var left = lineLength / 2 - parseInt(width) / 2;
|
|
88
|
-
if (left < 0) {
|
|
94
|
+
if (left < 0 && parseInt(width) > lineLength) {
|
|
89
95
|
node.style.left = left + 'px';
|
|
96
|
+
} else {
|
|
97
|
+
node.style.left = '';
|
|
90
98
|
}
|
|
91
99
|
}
|
|
92
100
|
});
|
|
@@ -55,7 +55,7 @@ exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
|
|
|
55
55
|
var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
56
56
|
exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
|
|
57
57
|
var packageName = "@atlaskit/renderer";
|
|
58
|
-
var packageVersion = "108.11.
|
|
58
|
+
var packageVersion = "108.11.16";
|
|
59
59
|
var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
60
60
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
61
61
|
var _super = _createSuper(Renderer);
|
|
@@ -468,7 +468,8 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
468
468
|
onMouseDown = props.onMouseDown,
|
|
469
469
|
useBlockRenderForCodeBlock = props.useBlockRenderForCodeBlock;
|
|
470
470
|
return (0, _react2.jsx)(_ui.WidthProvider, {
|
|
471
|
-
className: "ak-renderer-wrapper"
|
|
471
|
+
className: "ak-renderer-wrapper is-".concat(appearance),
|
|
472
|
+
"data-appearance": appearance
|
|
472
473
|
}, (0, _react2.jsx)(_ui.BaseTheme, {
|
|
473
474
|
baseFontSize: appearance && appearance !== 'comment' ? _editorSharedStyles.akEditorFullPageDefaultFontSize : undefined
|
|
474
475
|
}, (0, _react2.jsx)("div", {
|
|
@@ -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 { insideBreakoutLayout } from './renderer-node';
|
|
13
|
+
import { insideBlockNode, insideBreakoutLayout } from './renderer-node';
|
|
14
14
|
import { isCodeMark } from './marks/code';
|
|
15
15
|
function mergeMarks(marksAndNodes) {
|
|
16
16
|
return marksAndNodes.reduce((acc, markOrNode) => {
|
|
@@ -300,12 +300,14 @@ export default class ReactSerializer {
|
|
|
300
300
|
getTableProps(node, path = []) {
|
|
301
301
|
// TODO: https://product-fabric.atlassian.net/browse/CEMS-1048
|
|
302
302
|
const stickyHeaders = !insideBreakoutLayout(path) ? this.stickyHeaders : undefined;
|
|
303
|
+
const isInsideOfBlockNode = insideBlockNode(path, node.type.schema);
|
|
303
304
|
return {
|
|
304
305
|
...this.getProps(node),
|
|
305
306
|
allowColumnSorting: this.allowColumnSorting,
|
|
306
307
|
columnWidths: calcTableColumnWidths(node),
|
|
307
308
|
tableNode: node,
|
|
308
|
-
stickyHeaders
|
|
309
|
+
stickyHeaders,
|
|
310
|
+
isInsideOfBlockNode
|
|
309
311
|
};
|
|
310
312
|
}
|
|
311
313
|
getDateProps(node, parentInfo) {
|
|
@@ -316,18 +318,11 @@ export default class ReactSerializer {
|
|
|
316
318
|
}
|
|
317
319
|
getMediaSingleProps(node, path = []) {
|
|
318
320
|
const {
|
|
319
|
-
nodes: {
|
|
320
|
-
expand,
|
|
321
|
-
nestedExpand,
|
|
322
|
-
layoutColumn
|
|
323
|
-
},
|
|
324
321
|
marks: {
|
|
325
322
|
link
|
|
326
323
|
}
|
|
327
324
|
} = node.type.schema;
|
|
328
|
-
const
|
|
329
|
-
.map(node => node.name);
|
|
330
|
-
const isInsideOfBlockNode = path && path.some(n => n.type && blockNodeNames.indexOf(n.type.name) > -1);
|
|
325
|
+
const isInsideOfBlockNode = insideBlockNode(path, node.type.schema);
|
|
331
326
|
const isLinkMark = mark => mark.type === link;
|
|
332
327
|
const childHasLink = node.firstChild && node.firstChild.marks.filter(m => isLinkMark(m) || this.allowMediaLinking === true).length;
|
|
333
328
|
return {
|
|
@@ -369,16 +364,7 @@ export default class ReactSerializer {
|
|
|
369
364
|
};
|
|
370
365
|
}
|
|
371
366
|
getEmbedCardProps(node, path = []) {
|
|
372
|
-
const
|
|
373
|
-
nodes: {
|
|
374
|
-
expand,
|
|
375
|
-
nestedExpand,
|
|
376
|
-
layoutColumn
|
|
377
|
-
}
|
|
378
|
-
} = node.type.schema;
|
|
379
|
-
const blockNodeNames = [expand, nestedExpand, layoutColumn].filter(node => Boolean(node)) // Check if the node exist first
|
|
380
|
-
.map(node => node.name);
|
|
381
|
-
const isInsideOfBlockNode = path && path.some(n => n.type && blockNodeNames.indexOf(n.type.name) > -1);
|
|
367
|
+
const isInsideOfBlockNode = insideBlockNode(path, node.type.schema);
|
|
382
368
|
return {
|
|
383
369
|
...this.getProps(node),
|
|
384
370
|
isInsideOfBlockNode
|
|
@@ -53,7 +53,8 @@ const renderScaleDownColgroup = props => {
|
|
|
53
53
|
isNumberColumnEnabled,
|
|
54
54
|
renderWidth,
|
|
55
55
|
tableNode,
|
|
56
|
-
rendererAppearance
|
|
56
|
+
rendererAppearance,
|
|
57
|
+
isInsideOfBlockNode
|
|
57
58
|
} = props;
|
|
58
59
|
if (!columnWidths) {
|
|
59
60
|
return [];
|
|
@@ -67,12 +68,12 @@ const renderScaleDownColgroup = props => {
|
|
|
67
68
|
} else {
|
|
68
69
|
tableContainerWidth = getTableLayoutWidth(layout);
|
|
69
70
|
}
|
|
70
|
-
if (isTableResizingEnabled(rendererAppearance) && !tableResized) {
|
|
71
|
+
if (isTableResizingEnabled(rendererAppearance) && !isInsideOfBlockNode && !tableResized) {
|
|
71
72
|
if (getBooleanFF('platform.editor.custom-table-width-scale-down-undefined-column_nkyvx')) {
|
|
72
73
|
// for tables with no column widths defined, assume that the real table width
|
|
73
74
|
// is defined by node.attrs.width
|
|
74
|
-
const tableWidth = isNumberColumnEnabled ? tableContainerWidth - akEditorTableNumberColumnWidth : tableContainerWidth;
|
|
75
|
-
const defaultColumnWidth =
|
|
75
|
+
const tableWidth = (isNumberColumnEnabled ? tableContainerWidth - akEditorTableNumberColumnWidth : tableContainerWidth) - 1;
|
|
76
|
+
const defaultColumnWidth = tableWidth / noOfColumns;
|
|
76
77
|
targetWidths = new Array(noOfColumns).fill(defaultColumnWidth);
|
|
77
78
|
} else {
|
|
78
79
|
return new Array(noOfColumns).fill({
|
|
@@ -8,7 +8,8 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
8
8
|
renderWidth,
|
|
9
9
|
children,
|
|
10
10
|
tableNode,
|
|
11
|
-
rendererAppearance
|
|
11
|
+
rendererAppearance,
|
|
12
|
+
isInsideOfBlockNode
|
|
12
13
|
}) => {
|
|
13
14
|
return /*#__PURE__*/React.createElement("table", {
|
|
14
15
|
"data-testid": "renderer-table",
|
|
@@ -20,6 +21,7 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
20
21
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
21
22
|
renderWidth: renderWidth,
|
|
22
23
|
tableNode: tableNode,
|
|
23
|
-
rendererAppearance: rendererAppearance
|
|
24
|
+
rendererAppearance: rendererAppearance,
|
|
25
|
+
isInsideOfBlockNode: isInsideOfBlockNode
|
|
24
26
|
}), /*#__PURE__*/React.createElement("tbody", null, children));
|
|
25
27
|
});
|
|
@@ -5,10 +5,9 @@ import { calcTableWidth, TableSharedCssClassName, tableMarginTop } from '@atlask
|
|
|
5
5
|
import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
|
|
6
6
|
import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
8
|
-
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
8
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
11
|
-
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
12
11
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
13
12
|
import { TableHeader } from './tableCell';
|
|
14
13
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
@@ -239,7 +238,8 @@ export class TableContainer extends React.Component {
|
|
|
239
238
|
columnWidths,
|
|
240
239
|
stickyHeaders,
|
|
241
240
|
tableNode,
|
|
242
|
-
rendererAppearance
|
|
241
|
+
rendererAppearance,
|
|
242
|
+
isInsideOfBlockNode
|
|
243
243
|
} = this.props;
|
|
244
244
|
const {
|
|
245
245
|
stickyMode
|
|
@@ -247,8 +247,20 @@ export class TableContainer extends React.Component {
|
|
|
247
247
|
const lineLength = akEditorDefaultLayoutWidth;
|
|
248
248
|
let tableWidth;
|
|
249
249
|
let left;
|
|
250
|
+
let updatedLayout;
|
|
251
|
+
|
|
252
|
+
// The tableWidth and left offset logic below must stay aligned with the `breakout-ssr.tsx` logic
|
|
253
|
+
// Please consider changes below carefully to not negatively impact SSR
|
|
254
|
+
// `renderWidth` cannot be depended on during SSR
|
|
255
|
+
const isRenderWidthValid = !!renderWidth && renderWidth > 0;
|
|
250
256
|
const calcDefaultLayoutWidthByAppearance = (tableNode, rendererAppearance) => {
|
|
251
|
-
|
|
257
|
+
if (rendererAppearance === 'full-width' && !tableNode.attrs.width) {
|
|
258
|
+
return isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth;
|
|
259
|
+
} else {
|
|
260
|
+
// custom width, or width mapped to breakpoint
|
|
261
|
+
const tableContainerWidth = getTableContainerWidth(tableNode);
|
|
262
|
+
return isRenderWidthValid ? Math.min(tableContainerWidth, renderWidth) : tableContainerWidth;
|
|
263
|
+
}
|
|
252
264
|
};
|
|
253
265
|
if (isTableResizingEnabled(rendererAppearance) && tableNode) {
|
|
254
266
|
tableWidth = calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance);
|
|
@@ -259,6 +271,18 @@ export class TableContainer extends React.Component {
|
|
|
259
271
|
left = lineLength / 2 - tableWidth / 2;
|
|
260
272
|
}
|
|
261
273
|
const children = React.Children.toArray(this.props.children);
|
|
274
|
+
|
|
275
|
+
// Historically, tables in the full-width renderer had their layout set to 'default' which is deceiving.
|
|
276
|
+
// This check caters for those tables and helps with SSR logic
|
|
277
|
+
const isFullWidth = !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width) && rendererAppearance === 'full-width' && layout !== 'full-width';
|
|
278
|
+
const hasCustomWidth = isTableResizingEnabled(rendererAppearance) && (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.width);
|
|
279
|
+
if (isFullWidth) {
|
|
280
|
+
updatedLayout = 'full-width';
|
|
281
|
+
} else if (hasCustomWidth) {
|
|
282
|
+
updatedLayout = 'custom';
|
|
283
|
+
} else {
|
|
284
|
+
updatedLayout = layout;
|
|
285
|
+
}
|
|
262
286
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !getBooleanFF('platform.editor.custom-table-width') && stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
|
|
263
287
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
264
288
|
tableWidth: tableWidth,
|
|
@@ -276,7 +300,7 @@ export class TableContainer extends React.Component {
|
|
|
276
300
|
rendererAppearance: rendererAppearance
|
|
277
301
|
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
278
302
|
className: `${TableSharedCssClassName.TABLE_CONTAINER} ${this.props.shadowClassNames || ''}`,
|
|
279
|
-
"data-layout":
|
|
303
|
+
"data-layout": updatedLayout,
|
|
280
304
|
ref: this.props.handleRef,
|
|
281
305
|
style: {
|
|
282
306
|
width: tableWidth,
|
|
@@ -308,7 +332,8 @@ export class TableContainer extends React.Component {
|
|
|
308
332
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
309
333
|
renderWidth: renderWidth,
|
|
310
334
|
tableNode: tableNode,
|
|
311
|
-
rendererAppearance: rendererAppearance
|
|
335
|
+
rendererAppearance: rendererAppearance,
|
|
336
|
+
isInsideOfBlockNode: isInsideOfBlockNode
|
|
312
337
|
}, this.grabFirstRowRef(children)))));
|
|
313
338
|
}
|
|
314
339
|
}
|
|
@@ -372,7 +397,10 @@ const TableWithShadows = overflowShadow(TableProcessor, {
|
|
|
372
397
|
overflowSelector: `.${TableSharedCssClassName.TABLE_NODE_WRAPPER}`,
|
|
373
398
|
useShadowObserver: true
|
|
374
399
|
});
|
|
375
|
-
const TableWithWidth = props =>
|
|
400
|
+
const TableWithWidth = props =>
|
|
401
|
+
/*#__PURE__*/
|
|
402
|
+
// Remember, `width` will be 0 during SSR
|
|
403
|
+
React.createElement(WidthConsumer, null, ({
|
|
376
404
|
width
|
|
377
405
|
}) => {
|
|
378
406
|
var _props$columnWidths;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
export const isLayoutNode = node => node.type.name === 'layoutSection';
|
|
2
2
|
export const hasBreakOutMark = node => node.marks.some(m => m.type.name === 'breakout');
|
|
3
|
-
export const insideBreakoutLayout = path => path.some(item => isLayoutNode(item) && hasBreakOutMark(item));
|
|
3
|
+
export const insideBreakoutLayout = path => path.some(item => isLayoutNode(item) && hasBreakOutMark(item));
|
|
4
|
+
export const insideBlockNode = (path, schema) => {
|
|
5
|
+
const {
|
|
6
|
+
nodes: {
|
|
7
|
+
expand,
|
|
8
|
+
nestedExpand,
|
|
9
|
+
layoutColumn
|
|
10
|
+
}
|
|
11
|
+
} = schema;
|
|
12
|
+
const blockNodeNames = [expand, nestedExpand, layoutColumn].filter(node => Boolean(node)).map(node => node.name);
|
|
13
|
+
return path && path.some(n => n.type && blockNodeNames.indexOf(n.type.name) > -1);
|
|
14
|
+
};
|
|
@@ -45,7 +45,7 @@ export const breakoutInlineScriptContext = `
|
|
|
45
45
|
`;
|
|
46
46
|
function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
47
47
|
const MEDIA_NODE_TYPE = 'mediaSingle';
|
|
48
|
-
const WIDE_LAYOUT_MODES = ['full-width', 'wide'];
|
|
48
|
+
const WIDE_LAYOUT_MODES = ['full-width', 'wide', 'custom'];
|
|
49
49
|
function findUp(element, condition) {
|
|
50
50
|
if (!element) {
|
|
51
51
|
return;
|
|
@@ -71,12 +71,18 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
71
71
|
}
|
|
72
72
|
if (item.target.classList.contains('ak-renderer-document')) {
|
|
73
73
|
item.addedNodes.forEach(maybeNode => {
|
|
74
|
+
let width;
|
|
74
75
|
const node = maybeNode;
|
|
75
76
|
const mode = node.dataset.mode || node.dataset.layout || '';
|
|
76
77
|
if (!mode || !WIDE_LAYOUT_MODES.includes(mode)) {
|
|
77
78
|
return;
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
+
if (node.classList.contains('pm-table-container') && mode === 'custom') {
|
|
81
|
+
const effectiveWidth = renderer.offsetWidth - breakoutConsts.padding;
|
|
82
|
+
width = `${Math.min(parseInt(node.style.width), effectiveWidth)}px`;
|
|
83
|
+
} else {
|
|
84
|
+
width = breakoutConsts.calcBreakoutWidth(mode, renderer.offsetWidth);
|
|
85
|
+
}
|
|
80
86
|
if (node.style.width === width) {
|
|
81
87
|
return;
|
|
82
88
|
}
|
|
@@ -85,11 +91,13 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
85
91
|
// Tables require some special logic, as they are not using common css transform approach,
|
|
86
92
|
// because it breaks with sticky headers. This logic is copied from a table node:
|
|
87
93
|
// https://bitbucket.org/atlassian/atlassian-frontend/src/77938aee0c140d02ff99b98a03849be1236865b4/packages/editor/renderer/src/react/nodes/table.tsx#table.tsx-235:245
|
|
88
|
-
if (node.classList.contains('pm-table-container')) {
|
|
94
|
+
if (node.classList.contains('pm-table-container') && !renderer.classList.contains('is-full-width')) {
|
|
89
95
|
const lineLength = breakoutConsts.calcLineLength();
|
|
90
96
|
const left = lineLength / 2 - parseInt(width) / 2;
|
|
91
|
-
if (left < 0) {
|
|
97
|
+
if (left < 0 && parseInt(width) > lineLength) {
|
|
92
98
|
node.style.left = left + 'px';
|
|
99
|
+
} else {
|
|
100
|
+
node.style.left = '';
|
|
93
101
|
}
|
|
94
102
|
}
|
|
95
103
|
});
|
|
@@ -35,7 +35,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
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 = "108.11.
|
|
38
|
+
const packageVersion = "108.11.16";
|
|
39
39
|
export class Renderer extends PureComponent {
|
|
40
40
|
constructor(props) {
|
|
41
41
|
super(props);
|
|
@@ -440,7 +440,8 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
440
440
|
useBlockRenderForCodeBlock
|
|
441
441
|
} = props;
|
|
442
442
|
return jsx(WidthProvider, {
|
|
443
|
-
className:
|
|
443
|
+
className: `ak-renderer-wrapper is-${appearance}`,
|
|
444
|
+
"data-appearance": appearance
|
|
444
445
|
}, jsx(BaseTheme, {
|
|
445
446
|
baseFontSize: appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
446
447
|
}, jsx("div", {
|
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 { insideBreakoutLayout } from './renderer-node';
|
|
20
|
+
import { insideBlockNode, insideBreakoutLayout } from './renderer-node';
|
|
21
21
|
import { isCodeMark } from './marks/code';
|
|
22
22
|
function mergeMarks(marksAndNodes) {
|
|
23
23
|
return marksAndNodes.reduce(function (acc, markOrNode) {
|
|
@@ -333,11 +333,13 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
333
333
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
334
334
|
// TODO: https://product-fabric.atlassian.net/browse/CEMS-1048
|
|
335
335
|
var stickyHeaders = !insideBreakoutLayout(path) ? this.stickyHeaders : undefined;
|
|
336
|
+
var isInsideOfBlockNode = insideBlockNode(path, node.type.schema);
|
|
336
337
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
337
338
|
allowColumnSorting: this.allowColumnSorting,
|
|
338
339
|
columnWidths: calcTableColumnWidths(node),
|
|
339
340
|
tableNode: node,
|
|
340
|
-
stickyHeaders: stickyHeaders
|
|
341
|
+
stickyHeaders: stickyHeaders,
|
|
342
|
+
isInsideOfBlockNode: isInsideOfBlockNode
|
|
341
343
|
});
|
|
342
344
|
}
|
|
343
345
|
}, {
|
|
@@ -353,21 +355,8 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
353
355
|
value: function getMediaSingleProps(node) {
|
|
354
356
|
var _this5 = this;
|
|
355
357
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
356
|
-
var
|
|
357
|
-
|
|
358
|
-
expand = _node$type$schema$nod.expand,
|
|
359
|
-
nestedExpand = _node$type$schema$nod.nestedExpand,
|
|
360
|
-
layoutColumn = _node$type$schema$nod.layoutColumn,
|
|
361
|
-
link = _node$type$schema.marks.link;
|
|
362
|
-
var blockNodeNames = [expand, nestedExpand, layoutColumn].filter(function (node) {
|
|
363
|
-
return Boolean(node);
|
|
364
|
-
}) // Check if the node exist first
|
|
365
|
-
.map(function (node) {
|
|
366
|
-
return node.name;
|
|
367
|
-
});
|
|
368
|
-
var isInsideOfBlockNode = path && path.some(function (n) {
|
|
369
|
-
return n.type && blockNodeNames.indexOf(n.type.name) > -1;
|
|
370
|
-
});
|
|
358
|
+
var link = node.type.schema.marks.link;
|
|
359
|
+
var isInsideOfBlockNode = insideBlockNode(path, node.type.schema);
|
|
371
360
|
var isLinkMark = function isLinkMark(mark) {
|
|
372
361
|
return mark.type === link;
|
|
373
362
|
};
|
|
@@ -422,19 +411,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
422
411
|
key: "getEmbedCardProps",
|
|
423
412
|
value: function getEmbedCardProps(node) {
|
|
424
413
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
425
|
-
var
|
|
426
|
-
expand = _node$type$schema$nod2.expand,
|
|
427
|
-
nestedExpand = _node$type$schema$nod2.nestedExpand,
|
|
428
|
-
layoutColumn = _node$type$schema$nod2.layoutColumn;
|
|
429
|
-
var blockNodeNames = [expand, nestedExpand, layoutColumn].filter(function (node) {
|
|
430
|
-
return Boolean(node);
|
|
431
|
-
}) // Check if the node exist first
|
|
432
|
-
.map(function (node) {
|
|
433
|
-
return node.name;
|
|
434
|
-
});
|
|
435
|
-
var isInsideOfBlockNode = path && path.some(function (n) {
|
|
436
|
-
return n.type && blockNodeNames.indexOf(n.type.name) > -1;
|
|
437
|
-
});
|
|
414
|
+
var isInsideOfBlockNode = insideBlockNode(path, node.type.schema);
|
|
438
415
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
439
416
|
isInsideOfBlockNode: isInsideOfBlockNode
|
|
440
417
|
});
|
|
@@ -53,7 +53,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
53
53
|
isNumberColumnEnabled = props.isNumberColumnEnabled,
|
|
54
54
|
renderWidth = props.renderWidth,
|
|
55
55
|
tableNode = props.tableNode,
|
|
56
|
-
rendererAppearance = props.rendererAppearance
|
|
56
|
+
rendererAppearance = props.rendererAppearance,
|
|
57
|
+
isInsideOfBlockNode = props.isInsideOfBlockNode;
|
|
57
58
|
if (!columnWidths) {
|
|
58
59
|
return [];
|
|
59
60
|
}
|
|
@@ -66,12 +67,12 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
66
67
|
} else {
|
|
67
68
|
tableContainerWidth = getTableLayoutWidth(layout);
|
|
68
69
|
}
|
|
69
|
-
if (isTableResizingEnabled(rendererAppearance) && !tableResized) {
|
|
70
|
+
if (isTableResizingEnabled(rendererAppearance) && !isInsideOfBlockNode && !tableResized) {
|
|
70
71
|
if (getBooleanFF('platform.editor.custom-table-width-scale-down-undefined-column_nkyvx')) {
|
|
71
72
|
// for tables with no column widths defined, assume that the real table width
|
|
72
73
|
// is defined by node.attrs.width
|
|
73
|
-
var _tableWidth2 = isNumberColumnEnabled ? tableContainerWidth - akEditorTableNumberColumnWidth : tableContainerWidth;
|
|
74
|
-
var defaultColumnWidth =
|
|
74
|
+
var _tableWidth2 = (isNumberColumnEnabled ? tableContainerWidth - akEditorTableNumberColumnWidth : tableContainerWidth) - 1;
|
|
75
|
+
var defaultColumnWidth = _tableWidth2 / noOfColumns;
|
|
75
76
|
targetWidths = new Array(noOfColumns).fill(defaultColumnWidth);
|
|
76
77
|
} else {
|
|
77
78
|
return new Array(noOfColumns).fill({
|
|
@@ -8,7 +8,8 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
8
8
|
renderWidth = _ref.renderWidth,
|
|
9
9
|
children = _ref.children,
|
|
10
10
|
tableNode = _ref.tableNode,
|
|
11
|
-
rendererAppearance = _ref.rendererAppearance
|
|
11
|
+
rendererAppearance = _ref.rendererAppearance,
|
|
12
|
+
isInsideOfBlockNode = _ref.isInsideOfBlockNode;
|
|
12
13
|
return /*#__PURE__*/React.createElement("table", {
|
|
13
14
|
"data-testid": "renderer-table",
|
|
14
15
|
"data-number-column": isNumberColumnEnabled,
|
|
@@ -19,6 +20,7 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
19
20
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
20
21
|
renderWidth: renderWidth,
|
|
21
22
|
tableNode: tableNode,
|
|
22
|
-
rendererAppearance: rendererAppearance
|
|
23
|
+
rendererAppearance: rendererAppearance,
|
|
24
|
+
isInsideOfBlockNode: isInsideOfBlockNode
|
|
23
25
|
}), /*#__PURE__*/React.createElement("tbody", null, children));
|
|
24
26
|
});
|
|
@@ -16,10 +16,9 @@ import { calcTableWidth, TableSharedCssClassName, tableMarginTop } from '@atlask
|
|
|
16
16
|
import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
|
|
17
17
|
import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
|
|
18
18
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
19
|
-
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
19
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
20
20
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
21
21
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
22
|
-
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
23
22
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
24
23
|
import { TableHeader } from './tableCell';
|
|
25
24
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
@@ -288,13 +287,26 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
288
287
|
columnWidths = _this$props.columnWidths,
|
|
289
288
|
stickyHeaders = _this$props.stickyHeaders,
|
|
290
289
|
tableNode = _this$props.tableNode,
|
|
291
|
-
rendererAppearance = _this$props.rendererAppearance
|
|
290
|
+
rendererAppearance = _this$props.rendererAppearance,
|
|
291
|
+
isInsideOfBlockNode = _this$props.isInsideOfBlockNode;
|
|
292
292
|
var stickyMode = this.state.stickyMode;
|
|
293
293
|
var lineLength = akEditorDefaultLayoutWidth;
|
|
294
294
|
var tableWidth;
|
|
295
295
|
var left;
|
|
296
|
+
var updatedLayout;
|
|
297
|
+
|
|
298
|
+
// The tableWidth and left offset logic below must stay aligned with the `breakout-ssr.tsx` logic
|
|
299
|
+
// Please consider changes below carefully to not negatively impact SSR
|
|
300
|
+
// `renderWidth` cannot be depended on during SSR
|
|
301
|
+
var isRenderWidthValid = !!renderWidth && renderWidth > 0;
|
|
296
302
|
var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance) {
|
|
297
|
-
|
|
303
|
+
if (rendererAppearance === 'full-width' && !tableNode.attrs.width) {
|
|
304
|
+
return isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth;
|
|
305
|
+
} else {
|
|
306
|
+
// custom width, or width mapped to breakpoint
|
|
307
|
+
var tableContainerWidth = getTableContainerWidth(tableNode);
|
|
308
|
+
return isRenderWidthValid ? Math.min(tableContainerWidth, renderWidth) : tableContainerWidth;
|
|
309
|
+
}
|
|
298
310
|
};
|
|
299
311
|
if (isTableResizingEnabled(rendererAppearance) && tableNode) {
|
|
300
312
|
tableWidth = calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance);
|
|
@@ -305,6 +317,18 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
305
317
|
left = lineLength / 2 - tableWidth / 2;
|
|
306
318
|
}
|
|
307
319
|
var children = React.Children.toArray(this.props.children);
|
|
320
|
+
|
|
321
|
+
// Historically, tables in the full-width renderer had their layout set to 'default' which is deceiving.
|
|
322
|
+
// This check caters for those tables and helps with SSR logic
|
|
323
|
+
var isFullWidth = !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width) && rendererAppearance === 'full-width' && layout !== 'full-width';
|
|
324
|
+
var hasCustomWidth = isTableResizingEnabled(rendererAppearance) && (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.width);
|
|
325
|
+
if (isFullWidth) {
|
|
326
|
+
updatedLayout = 'full-width';
|
|
327
|
+
} else if (hasCustomWidth) {
|
|
328
|
+
updatedLayout = 'custom';
|
|
329
|
+
} else {
|
|
330
|
+
updatedLayout = layout;
|
|
331
|
+
}
|
|
308
332
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !getBooleanFF('platform.editor.custom-table-width') && stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
|
|
309
333
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
310
334
|
tableWidth: tableWidth,
|
|
@@ -322,7 +346,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
322
346
|
rendererAppearance: rendererAppearance
|
|
323
347
|
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
324
348
|
className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames || ''),
|
|
325
|
-
"data-layout":
|
|
349
|
+
"data-layout": updatedLayout,
|
|
326
350
|
ref: this.props.handleRef,
|
|
327
351
|
style: {
|
|
328
352
|
width: tableWidth,
|
|
@@ -354,7 +378,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
354
378
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
355
379
|
renderWidth: renderWidth,
|
|
356
380
|
tableNode: tableNode,
|
|
357
|
-
rendererAppearance: rendererAppearance
|
|
381
|
+
rendererAppearance: rendererAppearance,
|
|
382
|
+
isInsideOfBlockNode: isInsideOfBlockNode
|
|
358
383
|
}, this.grabFirstRowRef(children)))));
|
|
359
384
|
}
|
|
360
385
|
}]);
|
|
@@ -426,22 +451,26 @@ var TableWithShadows = overflowShadow(TableProcessor, {
|
|
|
426
451
|
useShadowObserver: true
|
|
427
452
|
});
|
|
428
453
|
var TableWithWidth = function TableWithWidth(props) {
|
|
429
|
-
return
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
454
|
+
return (
|
|
455
|
+
/*#__PURE__*/
|
|
456
|
+
// Remember, `width` will be 0 during SSR
|
|
457
|
+
React.createElement(WidthConsumer, null, function (_ref2) {
|
|
458
|
+
var _props$columnWidths;
|
|
459
|
+
var width = _ref2.width;
|
|
460
|
+
var renderWidth = props.rendererAppearance === 'full-page' ? width - FullPagePadding * 2 : width;
|
|
461
|
+
var colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
462
|
+
return total + val;
|
|
463
|
+
}, 0)) || 0;
|
|
464
|
+
if (colWidthsSum || getBooleanFF('platform.editor.custom-table-width-scale-down-undefined-column_nkyvx') && isTableResizingEnabled(props.rendererAppearance)) {
|
|
465
|
+
return /*#__PURE__*/React.createElement(TableWithShadows, _extends({
|
|
466
|
+
renderWidth: renderWidth
|
|
467
|
+
}, props));
|
|
468
|
+
}
|
|
469
|
+
// there should not be a case when colWidthsSum is 0 and table is in overflow state - so no need to render shadows in this case
|
|
470
|
+
return /*#__PURE__*/React.createElement(TableProcessor, _extends({
|
|
438
471
|
renderWidth: renderWidth
|
|
439
472
|
}, props));
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
return /*#__PURE__*/React.createElement(TableProcessor, _extends({
|
|
443
|
-
renderWidth: renderWidth
|
|
444
|
-
}, props));
|
|
445
|
-
});
|
|
473
|
+
})
|
|
474
|
+
);
|
|
446
475
|
};
|
|
447
476
|
export default withSmartCardStorage(TableWithWidth);
|
|
@@ -10,4 +10,18 @@ export var insideBreakoutLayout = function insideBreakoutLayout(path) {
|
|
|
10
10
|
return path.some(function (item) {
|
|
11
11
|
return isLayoutNode(item) && hasBreakOutMark(item);
|
|
12
12
|
});
|
|
13
|
+
};
|
|
14
|
+
export var insideBlockNode = function insideBlockNode(path, schema) {
|
|
15
|
+
var _schema$nodes = schema.nodes,
|
|
16
|
+
expand = _schema$nodes.expand,
|
|
17
|
+
nestedExpand = _schema$nodes.nestedExpand,
|
|
18
|
+
layoutColumn = _schema$nodes.layoutColumn;
|
|
19
|
+
var blockNodeNames = [expand, nestedExpand, layoutColumn].filter(function (node) {
|
|
20
|
+
return Boolean(node);
|
|
21
|
+
}).map(function (node) {
|
|
22
|
+
return node.name;
|
|
23
|
+
});
|
|
24
|
+
return path && path.some(function (n) {
|
|
25
|
+
return n.type && blockNodeNames.indexOf(n.type.name) > -1;
|
|
26
|
+
});
|
|
13
27
|
};
|
|
@@ -33,7 +33,7 @@ export function createBreakoutInlineScript(id) {
|
|
|
33
33
|
export var breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(breakoutConsts.calcWideWidth.toString(), ";\n");
|
|
34
34
|
function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
35
35
|
var MEDIA_NODE_TYPE = 'mediaSingle';
|
|
36
|
-
var WIDE_LAYOUT_MODES = ['full-width', 'wide'];
|
|
36
|
+
var WIDE_LAYOUT_MODES = ['full-width', 'wide', 'custom'];
|
|
37
37
|
function findUp(element, condition) {
|
|
38
38
|
if (!element) {
|
|
39
39
|
return;
|
|
@@ -59,12 +59,18 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
59
59
|
}
|
|
60
60
|
if (item.target.classList.contains('ak-renderer-document')) {
|
|
61
61
|
item.addedNodes.forEach(function (maybeNode) {
|
|
62
|
+
var width;
|
|
62
63
|
var node = maybeNode;
|
|
63
64
|
var mode = node.dataset.mode || node.dataset.layout || '';
|
|
64
65
|
if (!mode || !WIDE_LAYOUT_MODES.includes(mode)) {
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
if (node.classList.contains('pm-table-container') && mode === 'custom') {
|
|
69
|
+
var effectiveWidth = renderer.offsetWidth - breakoutConsts.padding;
|
|
70
|
+
width = "".concat(Math.min(parseInt(node.style.width), effectiveWidth), "px");
|
|
71
|
+
} else {
|
|
72
|
+
width = breakoutConsts.calcBreakoutWidth(mode, renderer.offsetWidth);
|
|
73
|
+
}
|
|
68
74
|
if (node.style.width === width) {
|
|
69
75
|
return;
|
|
70
76
|
}
|
|
@@ -73,11 +79,13 @@ function applyBreakoutAfterSSR(id, breakoutConsts) {
|
|
|
73
79
|
// Tables require some special logic, as they are not using common css transform approach,
|
|
74
80
|
// because it breaks with sticky headers. This logic is copied from a table node:
|
|
75
81
|
// https://bitbucket.org/atlassian/atlassian-frontend/src/77938aee0c140d02ff99b98a03849be1236865b4/packages/editor/renderer/src/react/nodes/table.tsx#table.tsx-235:245
|
|
76
|
-
if (node.classList.contains('pm-table-container')) {
|
|
82
|
+
if (node.classList.contains('pm-table-container') && !renderer.classList.contains('is-full-width')) {
|
|
77
83
|
var lineLength = breakoutConsts.calcLineLength();
|
|
78
84
|
var left = lineLength / 2 - parseInt(width) / 2;
|
|
79
|
-
if (left < 0) {
|
|
85
|
+
if (left < 0 && parseInt(width) > lineLength) {
|
|
80
86
|
node.style.left = left + 'px';
|
|
87
|
+
} else {
|
|
88
|
+
node.style.left = '';
|
|
81
89
|
}
|
|
82
90
|
}
|
|
83
91
|
});
|
|
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
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 = "108.11.
|
|
48
|
+
var packageVersion = "108.11.16";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
|
@@ -457,7 +457,8 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
457
457
|
onMouseDown = props.onMouseDown,
|
|
458
458
|
useBlockRenderForCodeBlock = props.useBlockRenderForCodeBlock;
|
|
459
459
|
return jsx(WidthProvider, {
|
|
460
|
-
className: "ak-renderer-wrapper"
|
|
460
|
+
className: "ak-renderer-wrapper is-".concat(appearance),
|
|
461
|
+
"data-appearance": appearance
|
|
461
462
|
}, jsx(BaseTheme, {
|
|
462
463
|
baseFontSize: appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
463
464
|
}, jsx("div", {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Fragment, Mark, Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { Serializer } from '../';
|
|
4
|
-
import { RendererAppearance, StickyHeaderConfig, HeadingAnchorLinksProps, NodeComponentsProps } from '../ui/Renderer/types';
|
|
5
|
-
import { AnalyticsEventPayload } from '../analytics/events';
|
|
6
|
-
import { TextWrapper } from './nodes';
|
|
2
|
+
import type { Fragment, Mark, Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Serializer } from '../';
|
|
4
|
+
import type { RendererAppearance, StickyHeaderConfig, HeadingAnchorLinksProps, NodeComponentsProps } from '../ui/Renderer/types';
|
|
5
|
+
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
6
|
+
import type { TextWrapper } from './nodes';
|
|
7
7
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
8
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
9
9
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
10
|
-
import { RendererContext } from './types';
|
|
11
|
-
import { MediaOptions } from '../types/mediaOptions';
|
|
12
|
-
import { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
13
|
-
import { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
10
|
+
import type { RendererContext } from './types';
|
|
11
|
+
import type { MediaOptions } from '../types/mediaOptions';
|
|
12
|
+
import type { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
13
|
+
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
14
14
|
export interface ReactSerializerInit {
|
|
15
15
|
providers?: ProviderFactory;
|
|
16
16
|
eventHandlers?: EventHandlers;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SharedTableProps } from './types';
|
|
2
|
+
import type { SharedTableProps } from './types';
|
|
3
3
|
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, }: TableProps) => JSX.Element>;
|
|
7
|
+
export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, isInsideOfBlockNode, }: TableProps) => JSX.Element>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
-
import { RendererAppearance } from '../../../ui/Renderer/types';
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { RendererAppearance } from '../../../ui/Renderer/types';
|
|
4
4
|
export type SharedTableProps = {
|
|
5
5
|
columnWidths?: Array<number>;
|
|
6
6
|
layout: TableLayout;
|
|
@@ -8,4 +8,5 @@ export type SharedTableProps = {
|
|
|
8
8
|
renderWidth: number;
|
|
9
9
|
tableNode?: PMNode;
|
|
10
10
|
rendererAppearance: RendererAppearance;
|
|
11
|
+
isInsideOfBlockNode?: boolean;
|
|
11
12
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { Node, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
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
|
+
export declare const insideBlockNode: (path: Node[], schema: Schema) => boolean;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Fragment, Mark, Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { Serializer } from '../';
|
|
4
|
-
import { RendererAppearance, StickyHeaderConfig, HeadingAnchorLinksProps, NodeComponentsProps } from '../ui/Renderer/types';
|
|
5
|
-
import { AnalyticsEventPayload } from '../analytics/events';
|
|
6
|
-
import { TextWrapper } from './nodes';
|
|
2
|
+
import type { Fragment, Mark, Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Serializer } from '../';
|
|
4
|
+
import type { RendererAppearance, StickyHeaderConfig, HeadingAnchorLinksProps, NodeComponentsProps } from '../ui/Renderer/types';
|
|
5
|
+
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
6
|
+
import type { TextWrapper } from './nodes';
|
|
7
7
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
8
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
9
9
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
10
|
-
import { RendererContext } from './types';
|
|
11
|
-
import { MediaOptions } from '../types/mediaOptions';
|
|
12
|
-
import { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
13
|
-
import { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
10
|
+
import type { RendererContext } from './types';
|
|
11
|
+
import type { MediaOptions } from '../types/mediaOptions';
|
|
12
|
+
import type { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
13
|
+
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
14
14
|
export interface ReactSerializerInit {
|
|
15
15
|
providers?: ProviderFactory;
|
|
16
16
|
eventHandlers?: EventHandlers;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SharedTableProps } from './types';
|
|
2
|
+
import type { SharedTableProps } from './types';
|
|
3
3
|
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, }: TableProps) => JSX.Element>;
|
|
7
|
+
export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, isInsideOfBlockNode, }: TableProps) => JSX.Element>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
-
import { RendererAppearance } from '../../../ui/Renderer/types';
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { RendererAppearance } from '../../../ui/Renderer/types';
|
|
4
4
|
export type SharedTableProps = {
|
|
5
5
|
columnWidths?: Array<number>;
|
|
6
6
|
layout: TableLayout;
|
|
@@ -8,4 +8,5 @@ export type SharedTableProps = {
|
|
|
8
8
|
renderWidth: number;
|
|
9
9
|
tableNode?: PMNode;
|
|
10
10
|
rendererAppearance: RendererAppearance;
|
|
11
|
+
isInsideOfBlockNode?: boolean;
|
|
11
12
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { Node, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
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
|
+
export declare const insideBlockNode: (path: Node[], schema: Schema) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "108.11.
|
|
3
|
+
"version": "108.11.16",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
32
32
|
"@atlaskit/button": "^16.10.0",
|
|
33
33
|
"@atlaskit/code": "^14.6.0",
|
|
34
|
-
"@atlaskit/editor-common": "^74.
|
|
34
|
+
"@atlaskit/editor-common": "^74.59.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.1",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
38
38
|
"@atlaskit/editor-shared-styles": "^2.6.0",
|
|
39
39
|
"@atlaskit/emoji": "^67.5.0",
|
|
40
40
|
"@atlaskit/icon": "^21.12.0",
|
|
41
|
-
"@atlaskit/link-datasource": "^1.
|
|
41
|
+
"@atlaskit/link-datasource": "^1.1.0",
|
|
42
42
|
"@atlaskit/media-card": "^76.2.0",
|
|
43
43
|
"@atlaskit/media-client": "^24.0.0",
|
|
44
44
|
"@atlaskit/media-common": "^9.0.0",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"@atlaskit/media-ui": "^24.0.0",
|
|
47
47
|
"@atlaskit/media-viewer": "^48.0.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
49
|
-
"@atlaskit/smart-card": "^26.
|
|
49
|
+
"@atlaskit/smart-card": "^26.25.0",
|
|
50
50
|
"@atlaskit/status": "^1.3.0",
|
|
51
51
|
"@atlaskit/task-decision": "^17.8.0",
|
|
52
52
|
"@atlaskit/theme": "^12.6.0",
|
|
53
|
-
"@atlaskit/tokens": "^1.
|
|
53
|
+
"@atlaskit/tokens": "^1.22.0",
|
|
54
54
|
"@atlaskit/tooltip": "^17.8.0",
|
|
55
55
|
"@babel/runtime": "^7.0.0",
|
|
56
56
|
"@emotion/react": "^11.7.1",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
72
72
|
"@atlaskit/css-reset": "^6.5.0",
|
|
73
73
|
"@atlaskit/link-provider": "^1.6.0",
|
|
74
|
-
"@atlaskit/link-test-helpers": "^6.
|
|
74
|
+
"@atlaskit/link-test-helpers": "^6.1.0",
|
|
75
75
|
"@atlaskit/media-core": "^34.1.0",
|
|
76
76
|
"@atlaskit/media-integration-test-helpers": "^3.0.0",
|
|
77
77
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
package/report.api.md
CHANGED
|
@@ -30,7 +30,7 @@ import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
|
30
30
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
31
31
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
32
32
|
import { jsx } from '@emotion/react';
|
|
33
|
-
import { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
33
|
+
import type { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
34
34
|
import { MediaClientConfig } from '@atlaskit/media-core';
|
|
35
35
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
36
36
|
import { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
|
19
19
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
20
20
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
21
21
|
import { jsx } from '@emotion/react';
|
|
22
|
-
import { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
22
|
+
import type { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
23
23
|
import { MediaClientConfig } from '@atlaskit/media-core';
|
|
24
24
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
25
25
|
import { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
|