@atlaskit/renderer 130.4.2 → 130.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/react/nodes/tableCell.js +28 -8
- package/dist/cjs/react/nodes/tableNew.js +134 -13
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +45 -2
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/tableCell.js +28 -8
- package/dist/es2019/react/nodes/tableNew.js +133 -13
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +54 -2
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/tableCell.js +28 -8
- package/dist/esm/react/nodes/tableNew.js +134 -13
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +45 -2
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/nodes/tableCell.d.ts +7 -1
- package/dist/types/react/nodes/tableNew.d.ts +8 -7
- package/dist/types-ts4.5/react/nodes/tableCell.d.ts +7 -1
- package/dist/types-ts4.5/react/nodes/tableNew.d.ts +8 -7
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 130.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3a69722c61c6a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a69722c61c6a) -
|
|
8
|
+
Add rounded corners to table node in editor. This works by hiding the actual table border and
|
|
9
|
+
adding a pseudo element with rounded corners.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 130.5.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [`2feedbf316e9d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2feedbf316e9d) -
|
|
17
|
+
adding new STAR email body to email message templates
|
|
18
|
+
|
|
3
19
|
## 130.4.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -17,6 +17,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
17
17
|
var _consts = require("../../consts");
|
|
18
18
|
var _reactIntl = require("react-intl");
|
|
19
19
|
var _messages = require("../../messages");
|
|
20
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
21
|
var IgnoreSorting = ['LABEL', 'INPUT'];
|
|
21
22
|
var nextStatusOrder = function nextStatusOrder(currentSortOrder) {
|
|
22
23
|
switch (currentSortOrder) {
|
|
@@ -44,16 +45,26 @@ var getSortOrderLabel = function getSortOrderLabel(intl, currentSortOrder) {
|
|
|
44
45
|
return intl.formatMessage(noneSortingLabel);
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
-
// Ignored via go/ees005
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
-
var getDataAttributes = function getDataAttributes(colwidth, background) {
|
|
51
|
-
// Ignored via go/ees005
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
var getDataAttributes = function getDataAttributes(colwidth, background, cellEdgeProps) {
|
|
53
49
|
var attrs = {};
|
|
54
50
|
if (colwidth) {
|
|
55
51
|
attrs['data-colwidth'] = colwidth.join(',');
|
|
56
52
|
}
|
|
53
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true)) {
|
|
54
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesTop) {
|
|
55
|
+
attrs['data-reaches-top'] = true;
|
|
56
|
+
}
|
|
57
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesBottom) {
|
|
58
|
+
attrs['data-reaches-bottom'] = true;
|
|
59
|
+
}
|
|
60
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesLeft) {
|
|
61
|
+
attrs['data-reaches-left'] = true;
|
|
62
|
+
}
|
|
63
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesRight) {
|
|
64
|
+
attrs['data-reaches-right'] = true;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
57
68
|
/**
|
|
58
69
|
* Storing hex code in data-cell-background because
|
|
59
70
|
* we want to have DST token (css variable) or
|
|
@@ -147,7 +158,11 @@ var getWithCellProps = function getWithCellProps(WrapperComponent) {
|
|
|
147
158
|
colspan = props.colspan,
|
|
148
159
|
background = props.background,
|
|
149
160
|
offsetTop = props.offsetTop,
|
|
150
|
-
ariaSort = props.ariaSort
|
|
161
|
+
ariaSort = props.ariaSort,
|
|
162
|
+
reachesTop = props.reachesTop,
|
|
163
|
+
reachesBottom = props.reachesBottom,
|
|
164
|
+
reachesLeft = props.reachesLeft,
|
|
165
|
+
reachesRight = props.reachesRight;
|
|
151
166
|
|
|
152
167
|
// This is used to set the background color of the cell
|
|
153
168
|
// to a dark mode color in mobile dark mode
|
|
@@ -174,7 +189,12 @@ var getWithCellProps = function getWithCellProps(WrapperComponent) {
|
|
|
174
189
|
className: className
|
|
175
190
|
// Ignored via go/ees005
|
|
176
191
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
177
|
-
}, getDataAttributes(colwidth, background
|
|
192
|
+
}, getDataAttributes(colwidth, background, {
|
|
193
|
+
reachesTop: reachesTop,
|
|
194
|
+
reachesBottom: reachesBottom,
|
|
195
|
+
reachesLeft: reachesLeft,
|
|
196
|
+
reachesRight: reachesRight
|
|
197
|
+
}), {
|
|
178
198
|
"aria-sort": ariaSort
|
|
179
199
|
}), children);
|
|
180
200
|
};
|
|
@@ -325,6 +325,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
325
325
|
key: "componentDidMount",
|
|
326
326
|
value:
|
|
327
327
|
/**
|
|
328
|
+
* Starts observing table dimensions and wires sticky header/scrollbar behavior after mount.
|
|
328
329
|
*
|
|
329
330
|
* @example
|
|
330
331
|
*/
|
|
@@ -349,6 +350,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
349
350
|
}
|
|
350
351
|
|
|
351
352
|
/**
|
|
353
|
+
* Updates sticky header wiring and scroll synchronization after prop or state changes.
|
|
352
354
|
*
|
|
353
355
|
* @param prevProps
|
|
354
356
|
* @param prevState
|
|
@@ -382,7 +384,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
382
384
|
key: "pinTop",
|
|
383
385
|
get:
|
|
384
386
|
/**
|
|
385
|
-
*
|
|
387
|
+
* Calculates the top offset used when the sticky header is pinned to the table bottom.
|
|
386
388
|
*/
|
|
387
389
|
function get() {
|
|
388
390
|
if (!this.tableRef.current || !this.stickyHeaderRef.current) {
|
|
@@ -392,7 +394,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
392
394
|
}
|
|
393
395
|
|
|
394
396
|
/**
|
|
395
|
-
*
|
|
397
|
+
* Determines whether sticky header positioning should include the default scroll root offset.
|
|
396
398
|
*/
|
|
397
399
|
}, {
|
|
398
400
|
key: "shouldAddOverflowParentOffsetTop_DO_NOT_USE",
|
|
@@ -405,7 +407,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
405
407
|
}
|
|
406
408
|
|
|
407
409
|
/**
|
|
408
|
-
*
|
|
410
|
+
* Resolves the top position for the sticky header based on the current sticky mode.
|
|
409
411
|
*/
|
|
410
412
|
}, {
|
|
411
413
|
key: "stickyTop",
|
|
@@ -427,6 +429,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
427
429
|
}
|
|
428
430
|
|
|
429
431
|
/**
|
|
432
|
+
* Renders the table container, sticky header, table content, sticky scrollbar, and synced block borders.
|
|
430
433
|
*
|
|
431
434
|
* @example
|
|
432
435
|
*/
|
|
@@ -617,14 +620,91 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
617
620
|
}
|
|
618
621
|
}]);
|
|
619
622
|
}(_react.default.Component);
|
|
623
|
+
var getCellEdgePropsByCellOffset = function getCellEdgePropsByCellOffset(tableNode) {
|
|
624
|
+
var cellEdgePropsByCellOffset = new Map();
|
|
625
|
+
var cellRightByCellOffset = new Map();
|
|
626
|
+
var occupiedGrid = [];
|
|
627
|
+
var tableWidth = 0;
|
|
628
|
+
var cellOffset = 0;
|
|
629
|
+
tableNode.forEach(function (rowNode, _rowOffset, rowIndex) {
|
|
630
|
+
var _occupiedGrid$rowInde;
|
|
631
|
+
occupiedGrid[rowIndex] = (_occupiedGrid$rowInde = occupiedGrid[rowIndex]) !== null && _occupiedGrid$rowInde !== void 0 ? _occupiedGrid$rowInde : [];
|
|
632
|
+
var columnIndex = 0;
|
|
633
|
+
cellOffset += 1;
|
|
634
|
+
rowNode.forEach(function (cellNode) {
|
|
635
|
+
while (occupiedGrid[rowIndex][columnIndex]) {
|
|
636
|
+
columnIndex += 1;
|
|
637
|
+
}
|
|
638
|
+
var colspan = cellNode.attrs.colspan || 1;
|
|
639
|
+
var rowspan = cellNode.attrs.rowspan || 1;
|
|
640
|
+
var cellLeft = columnIndex;
|
|
641
|
+
var cellRight = cellLeft + colspan;
|
|
642
|
+
var cellTop = rowIndex;
|
|
643
|
+
var cellBottom = cellTop + rowspan;
|
|
644
|
+
for (var row = cellTop; row < cellBottom; row += 1) {
|
|
645
|
+
var _occupiedGrid$row;
|
|
646
|
+
occupiedGrid[row] = (_occupiedGrid$row = occupiedGrid[row]) !== null && _occupiedGrid$row !== void 0 ? _occupiedGrid$row : [];
|
|
647
|
+
for (var column = cellLeft; column < cellRight; column += 1) {
|
|
648
|
+
occupiedGrid[row][column] = true;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
tableWidth = Math.max(tableWidth, cellRight);
|
|
652
|
+
cellRightByCellOffset.set(cellOffset, cellRight);
|
|
653
|
+
cellEdgePropsByCellOffset.set(cellOffset, {
|
|
654
|
+
reachesBottom: cellBottom >= tableNode.childCount,
|
|
655
|
+
reachesLeft: cellLeft === 0,
|
|
656
|
+
reachesRight: false,
|
|
657
|
+
reachesTop: cellTop === 0
|
|
658
|
+
});
|
|
659
|
+
columnIndex = cellRight;
|
|
660
|
+
cellOffset += cellNode.nodeSize;
|
|
661
|
+
});
|
|
662
|
+
cellOffset += 1;
|
|
663
|
+
});
|
|
664
|
+
cellRightByCellOffset.forEach(function (cellRight, currentCellOffset) {
|
|
665
|
+
var edgeProps = cellEdgePropsByCellOffset.get(currentCellOffset);
|
|
666
|
+
if (edgeProps) {
|
|
667
|
+
edgeProps.reachesRight = cellRight >= tableWidth;
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
return cellEdgePropsByCellOffset;
|
|
671
|
+
};
|
|
672
|
+
var addTableCellEdgeProps = function addTableCellEdgeProps(rows, tableNode) {
|
|
673
|
+
try {
|
|
674
|
+
if (!tableNode) {
|
|
675
|
+
return rows;
|
|
676
|
+
}
|
|
677
|
+
var cellEdgePropsByCellOffset = getCellEdgePropsByCellOffset(tableNode);
|
|
678
|
+
var cellOffset = 0;
|
|
679
|
+
return _react.default.Children.map(rows, function (row, rowIndex) {
|
|
680
|
+
var rowNode = tableNode.child(rowIndex);
|
|
681
|
+
cellOffset += 1;
|
|
682
|
+
var cellIndex = 0;
|
|
683
|
+
var rowChildren = _react.default.Children.map(row.props.children, function (child) {
|
|
684
|
+
if (! /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
685
|
+
return child;
|
|
686
|
+
}
|
|
687
|
+
var cellNode = rowNode.child(cellIndex);
|
|
688
|
+
var edgeProps = cellEdgePropsByCellOffset.get(cellOffset);
|
|
689
|
+
cellIndex += 1;
|
|
690
|
+
cellOffset += cellNode.nodeSize;
|
|
691
|
+
return edgeProps ? /*#__PURE__*/_react.default.cloneElement(child, edgeProps) : child;
|
|
692
|
+
});
|
|
693
|
+
cellOffset += 1;
|
|
694
|
+
return /*#__PURE__*/_react.default.cloneElement(row, undefined, rowChildren);
|
|
695
|
+
});
|
|
696
|
+
} catch (_unused) {
|
|
697
|
+
// Renderer can receive malformed historical ADF. If the table shape cannot
|
|
698
|
+
// be described safely, keep rendering without rounded edge metadata.
|
|
699
|
+
return rows;
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
|
|
620
703
|
/**
|
|
621
|
-
*
|
|
704
|
+
* Processes table children before passing them to the styled table container.
|
|
622
705
|
*/
|
|
623
706
|
// Ignored via go/ees005
|
|
624
707
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
625
|
-
/**
|
|
626
|
-
*
|
|
627
|
-
*/
|
|
628
708
|
var TableProcessorWithContainerStyles = exports.TableProcessorWithContainerStyles = /*#__PURE__*/function (_React$Component2) {
|
|
629
709
|
function TableProcessorWithContainerStyles() {
|
|
630
710
|
var _this2;
|
|
@@ -675,22 +755,63 @@ var TableProcessorWithContainerStyles = exports.TableProcessorWithContainerStyle
|
|
|
675
755
|
key: "render",
|
|
676
756
|
value:
|
|
677
757
|
/**
|
|
758
|
+
* Renders processed table children inside the table container.
|
|
678
759
|
*
|
|
679
760
|
* @example
|
|
680
761
|
*/
|
|
681
762
|
function render() {
|
|
682
|
-
var
|
|
763
|
+
var _this$props2 = this.props,
|
|
764
|
+
allowColumnSorting = _this$props2.allowColumnSorting,
|
|
765
|
+
allowFixedColumnWidthOption = _this$props2.allowFixedColumnWidthOption,
|
|
766
|
+
allowTableAlignment = _this$props2.allowTableAlignment,
|
|
767
|
+
allowTableResizing = _this$props2.allowTableResizing,
|
|
768
|
+
children = _this$props2.children,
|
|
769
|
+
columnWidths = _this$props2.columnWidths,
|
|
770
|
+
disableTableOverflowShadow = _this$props2.disableTableOverflowShadow,
|
|
771
|
+
handleRef = _this$props2.handleRef,
|
|
772
|
+
isinsideMultiBodiedExtension = _this$props2.isinsideMultiBodiedExtension,
|
|
773
|
+
isInsideOfBlockNode = _this$props2.isInsideOfBlockNode,
|
|
774
|
+
isInsideOfTable = _this$props2.isInsideOfTable,
|
|
775
|
+
isNumberColumnEnabled = _this$props2.isNumberColumnEnabled,
|
|
776
|
+
isPresentational = _this$props2.isPresentational,
|
|
777
|
+
layout = _this$props2.layout,
|
|
778
|
+
rendererAppearance = _this$props2.rendererAppearance,
|
|
779
|
+
renderWidth = _this$props2.renderWidth,
|
|
780
|
+
shadowClassNames = _this$props2.shadowClassNames,
|
|
781
|
+
smartCardStorage = _this$props2.smartCardStorage,
|
|
782
|
+
stickyHeaders = _this$props2.stickyHeaders,
|
|
783
|
+
tabIndex = _this$props2.tabIndex,
|
|
784
|
+
tableNode = _this$props2.tableNode;
|
|
683
785
|
if (!children) {
|
|
684
786
|
return null;
|
|
685
787
|
}
|
|
686
788
|
var childrenArray = _react.default.Children.toArray(children);
|
|
789
|
+
var childrenWithTableEdgeProps = (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) ? addTableCellEdgeProps(childrenArray, tableNode) : childrenArray;
|
|
687
790
|
var orderedChildren = (0, _utils.compose)(this.addNumberColumnIndexes, this.addSortableColumn
|
|
688
791
|
// @ts-expect-error TS2345: Argument of type '(ReactChild | ReactFragment | ReactPortal)[]' is not assignable to parameter of type 'ReactElement<any, string | JSXElementConstructor<any>>[]'
|
|
689
|
-
)(
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
792
|
+
)(childrenWithTableEdgeProps);
|
|
793
|
+
return /*#__PURE__*/_react.default.createElement(TableContainer, {
|
|
794
|
+
allowColumnSorting: allowColumnSorting,
|
|
795
|
+
allowFixedColumnWidthOption: allowFixedColumnWidthOption,
|
|
796
|
+
allowTableAlignment: allowTableAlignment,
|
|
797
|
+
allowTableResizing: allowTableResizing,
|
|
798
|
+
columnWidths: columnWidths,
|
|
799
|
+
disableTableOverflowShadow: disableTableOverflowShadow,
|
|
800
|
+
handleRef: handleRef,
|
|
801
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension,
|
|
802
|
+
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
803
|
+
isInsideOfTable: isInsideOfTable,
|
|
804
|
+
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
805
|
+
isPresentational: isPresentational,
|
|
806
|
+
layout: layout,
|
|
807
|
+
rendererAppearance: rendererAppearance,
|
|
808
|
+
renderWidth: renderWidth,
|
|
809
|
+
shadowClassNames: shadowClassNames,
|
|
810
|
+
smartCardStorage: smartCardStorage,
|
|
811
|
+
stickyHeaders: stickyHeaders,
|
|
812
|
+
tabIndex: tabIndex,
|
|
813
|
+
tableNode: tableNode
|
|
814
|
+
}, orderedChildren);
|
|
694
815
|
}
|
|
695
816
|
}]);
|
|
696
817
|
}(_react.default.Component);
|
|
@@ -147,7 +147,10 @@ var headingAnchorStylesDuplicateAnchor = (0, _react.css)({
|
|
|
147
147
|
'> button': {
|
|
148
148
|
opacity: 0,
|
|
149
149
|
transform: 'translate(-8px, 0px)',
|
|
150
|
-
|
|
150
|
+
transitionProperty: 'opacity, transform',
|
|
151
|
+
transitionDuration: "var(--ds-duration-medium, 0.2s)".concat(", ", "var(--ds-duration-medium, 0.2s)"),
|
|
152
|
+
transitionTimingFunction: "var(--ds-easing-out-practical, ease)".concat(", ", "var(--ds-easing-out-practical, ease)"),
|
|
153
|
+
transitionDelay: '0s, 0s'
|
|
151
154
|
}
|
|
152
155
|
}), '&:hover', (0, _defineProperty2.default)({}, ".".concat(_headingAnchor.HeadingAnchorWrapperClassName, " > button"), {
|
|
153
156
|
opacity: 1,
|
|
@@ -1505,6 +1508,43 @@ var tableSharedStyle = (0, _react.css)((0, _defineProperty2.default)((0, _define
|
|
|
1505
1508
|
}))
|
|
1506
1509
|
}
|
|
1507
1510
|
}));
|
|
1511
|
+
var roundedTableOuterBorderOverlayStyles = (0, _react.css)((0, _defineProperty2.default)({}, ".".concat(_styles.TableSharedCssClassName.TABLE_CONTAINER, " > table,\n\t.").concat(_styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, " > table,\n\t.").concat(_styles.TableSharedCssClassName.TABLE_STICKY_WRAPPER, " > table"), {
|
|
1512
|
+
borderColor: 'transparent',
|
|
1513
|
+
position: 'relative',
|
|
1514
|
+
'&::after': {
|
|
1515
|
+
content: "''",
|
|
1516
|
+
position: 'absolute',
|
|
1517
|
+
inset: 0,
|
|
1518
|
+
border: "".concat(_styles.tableCellBorderWidth, "px solid ", "var(--ds-background-accent-gray-subtler, #DDDEE1)"),
|
|
1519
|
+
borderRadius: "var(--ds-radius-medium, 6px)",
|
|
1520
|
+
pointerEvents: 'none',
|
|
1521
|
+
zIndex: 1
|
|
1522
|
+
},
|
|
1523
|
+
'> tbody > tr:first-of-type > th, > tbody > tr:first-of-type > td, > tbody > tr > th[data-reaches-top], > tbody > tr > td[data-reaches-top]': {
|
|
1524
|
+
borderTopColor: 'transparent'
|
|
1525
|
+
},
|
|
1526
|
+
'> tbody > tr > th:first-child, > tbody > tr > td:first-child, > tbody > tr > th[data-reaches-left], > tbody > tr > td[data-reaches-left]': {
|
|
1527
|
+
borderLeftColor: 'transparent'
|
|
1528
|
+
},
|
|
1529
|
+
'> tbody > tr > th[data-reaches-right], > tbody > tr > td[data-reaches-right]': {
|
|
1530
|
+
borderRightColor: 'transparent'
|
|
1531
|
+
},
|
|
1532
|
+
'> tbody > tr > th[data-reaches-bottom], > tbody > tr > td[data-reaches-bottom]': {
|
|
1533
|
+
borderBottomColor: 'transparent'
|
|
1534
|
+
},
|
|
1535
|
+
'> tbody > tr > th[data-reaches-top][data-reaches-left], > tbody > tr > td[data-reaches-top][data-reaches-left]': {
|
|
1536
|
+
borderTopLeftRadius: "var(--ds-radius-medium, 6px)"
|
|
1537
|
+
},
|
|
1538
|
+
'> tbody > tr > th[data-reaches-top][data-reaches-right], > tbody > tr > td[data-reaches-top][data-reaches-right]': {
|
|
1539
|
+
borderTopRightRadius: "var(--ds-radius-medium, 6px)"
|
|
1540
|
+
},
|
|
1541
|
+
'> tbody > tr > th[data-reaches-bottom][data-reaches-left], > tbody > tr > td[data-reaches-bottom][data-reaches-left]': {
|
|
1542
|
+
borderBottomLeftRadius: "var(--ds-radius-medium, 6px)"
|
|
1543
|
+
},
|
|
1544
|
+
'> tbody > tr > th[data-reaches-bottom][data-reaches-right], > tbody > tr > td[data-reaches-bottom][data-reaches-right]': {
|
|
1545
|
+
borderBottomRightRadius: "var(--ds-radius-medium, 6px)"
|
|
1546
|
+
}
|
|
1547
|
+
}));
|
|
1508
1548
|
var tableContentModeStyles = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_consts.RendererCssClassName.DOCUMENT, " .").concat(_styles.TableSharedCssClassName.TABLE_CONTAINER, ":has(table[data-initial-width-mode=\"content\"])"), {
|
|
1509
1549
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
1510
1550
|
width: 'max-content !important',
|
|
@@ -2110,6 +2150,9 @@ var tableFakeBorderStyles = (0, _react.css)((0, _defineProperty2.default)((0, _d
|
|
|
2110
2150
|
borderLeftColor: 'transparent',
|
|
2111
2151
|
borderRightColor: 'transparent'
|
|
2112
2152
|
}));
|
|
2153
|
+
var roundedTableFakeBorderOverlayStyles = (0, _react.css)((0, _defineProperty2.default)({}, ".".concat(_styles.TableSharedCssClassName.TABLE_CONTAINER), (0, _defineProperty2.default)({}, ".".concat(_styles.TableSharedCssClassName.TABLE_RIGHT_BORDER, ",\n\t\t.").concat(_styles.TableSharedCssClassName.TABLE_LEFT_BORDER), {
|
|
2154
|
+
display: 'none'
|
|
2155
|
+
})));
|
|
2113
2156
|
var syncBlockStyles = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_syncBlock.SyncBlockSharedCssClassName.renderer, ", .").concat(_syncBlock.BodiedSyncBlockSharedCssClassName.renderer, ", .").concat(_syncBlock.SyncBlockSharedCssClassName.error, ", .").concat(_syncBlock.SyncBlockSharedCssClassName.loading), {
|
|
2114
2157
|
borderRadius: "var(--ds-radius-small, 3px)",
|
|
2115
2158
|
marginTop: "var(--ds-space-075, 6px)",
|
|
@@ -2177,7 +2220,7 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
2177
2220
|
// this should be placed after baseOtherStyles
|
|
2178
2221
|
(0, _expValEquals.expValEquals)('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), inlineExtensionRendererMarginFix, allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle,
|
|
2179
2222
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
2180
|
-
(0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeStyles, tableRendererHeaderStylesForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, (0, _table.isStickyScrollbarEnabled)(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, (0, _expValEquals.expValEquals)('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? (0, _expValEquals.expValEquals)('platform_editor_emojis_in_renderer_smart_links', 'isEnabled', true) ? isCompactModeEnabled ? scaledDenseEmojiStylesNew : scaledEmojiStylesNew : isCompactModeEnabled ? scaledDenseEmojiStyles : scaledEmojiStyles : isCompactModeEnabled ? denseStyles : undefined, (0, _experiments.editorExperiment)('platform_synced_block', true) && syncBlockStyles, centerWrapperStyles, (0, _experiments.editorExperiment)('platform_synced_block', true) && isInsideSyncBlock && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_9') ? syncBlockRendererStyles : null, isInsideSyncBlock && (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_9') && tableFakeBorderStyles, (0, _expValEquals.expValEquals)('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2223
|
+
(0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeStyles, tableRendererHeaderStylesForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, (0, _table.isStickyScrollbarEnabled)(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, (0, _expValEquals.expValEquals)('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? (0, _expValEquals.expValEquals)('platform_editor_emojis_in_renderer_smart_links', 'isEnabled', true) ? isCompactModeEnabled ? scaledDenseEmojiStylesNew : scaledEmojiStylesNew : isCompactModeEnabled ? scaledDenseEmojiStyles : scaledEmojiStyles : isCompactModeEnabled ? denseStyles : undefined, (0, _experiments.editorExperiment)('platform_synced_block', true) && syncBlockStyles, centerWrapperStyles, (0, _experiments.editorExperiment)('platform_synced_block', true) && isInsideSyncBlock && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_9') ? syncBlockRendererStyles : null, isInsideSyncBlock && (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_9') && tableFakeBorderStyles, isInsideSyncBlock && (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_9') ? (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableFakeBorderOverlayStyles : null : null, (0, _expValEquals.expValEquals)('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2181
2224
|
"data-testid": testId
|
|
2182
2225
|
}, children);
|
|
2183
2226
|
};
|
|
@@ -71,7 +71,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
71
71
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
72
72
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
73
73
|
var packageName = "@atlaskit/renderer";
|
|
74
|
-
var packageVersion = "
|
|
74
|
+
var packageVersion = "0.0.0-development";
|
|
75
75
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
76
76
|
containerName: 'ak-renderer-wrapper',
|
|
77
77
|
containerType: 'inline-size'
|
|
@@ -10,6 +10,7 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/anal
|
|
|
10
10
|
import { RendererCssClassName } from '../../consts';
|
|
11
11
|
import { useIntl } from 'react-intl';
|
|
12
12
|
import { tableCellMessages } from '../../messages';
|
|
13
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
14
|
const IgnoreSorting = ['LABEL', 'INPUT'];
|
|
14
15
|
const nextStatusOrder = currentSortOrder => {
|
|
15
16
|
switch (currentSortOrder) {
|
|
@@ -39,16 +40,26 @@ const getSortOrderLabel = (intl, currentSortOrder) => {
|
|
|
39
40
|
return intl.formatMessage(noneSortingLabel);
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
|
-
|
|
43
|
-
// Ignored via go/ees005
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
-
const getDataAttributes = (colwidth, background) => {
|
|
46
|
-
// Ignored via go/ees005
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
+
const getDataAttributes = (colwidth, background, cellEdgeProps) => {
|
|
48
44
|
const attrs = {};
|
|
49
45
|
if (colwidth) {
|
|
50
46
|
attrs['data-colwidth'] = colwidth.join(',');
|
|
51
47
|
}
|
|
48
|
+
if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
|
|
49
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesTop) {
|
|
50
|
+
attrs['data-reaches-top'] = true;
|
|
51
|
+
}
|
|
52
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesBottom) {
|
|
53
|
+
attrs['data-reaches-bottom'] = true;
|
|
54
|
+
}
|
|
55
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesLeft) {
|
|
56
|
+
attrs['data-reaches-left'] = true;
|
|
57
|
+
}
|
|
58
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesRight) {
|
|
59
|
+
attrs['data-reaches-right'] = true;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
52
63
|
/**
|
|
53
64
|
* Storing hex code in data-cell-background because
|
|
54
65
|
* we want to have DST token (css variable) or
|
|
@@ -145,7 +156,11 @@ const getWithCellProps = WrapperComponent => {
|
|
|
145
156
|
colspan,
|
|
146
157
|
background,
|
|
147
158
|
offsetTop,
|
|
148
|
-
ariaSort
|
|
159
|
+
ariaSort,
|
|
160
|
+
reachesTop,
|
|
161
|
+
reachesBottom,
|
|
162
|
+
reachesLeft,
|
|
163
|
+
reachesRight
|
|
149
164
|
} = props;
|
|
150
165
|
|
|
151
166
|
// This is used to set the background color of the cell
|
|
@@ -173,7 +188,12 @@ const getWithCellProps = WrapperComponent => {
|
|
|
173
188
|
className: className
|
|
174
189
|
// Ignored via go/ees005
|
|
175
190
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
176
|
-
}, getDataAttributes(colwidth, background
|
|
191
|
+
}, getDataAttributes(colwidth, background, {
|
|
192
|
+
reachesTop,
|
|
193
|
+
reachesBottom,
|
|
194
|
+
reachesLeft,
|
|
195
|
+
reachesRight
|
|
196
|
+
}), {
|
|
177
197
|
"aria-sort": ariaSort
|
|
178
198
|
}), children);
|
|
179
199
|
};
|