@atlaskit/renderer 130.5.0 → 130.6.0
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 +20 -0
- package/actions/main/package.json +17 -0
- package/actions/renderer-actions-context/package.json +17 -0
- package/actions/with-renderer-actions/package.json +17 -0
- package/annotations/package.json +17 -0
- package/consts/package.json +5 -5
- package/custom-nodes/loosely-lazy/package.json +17 -0
- package/dist/cjs/entry-points/actions-main.js +1 -0
- package/dist/cjs/entry-points/actions-renderer-actions-context.js +18 -0
- package/dist/cjs/entry-points/actions-with-renderer-actions.js +12 -0
- package/dist/cjs/entry-points/annotations.js +24 -0
- package/dist/cjs/entry-points/consts.js +12 -0
- package/dist/cjs/entry-points/custom-nodes-loosely-lazy.js +12 -0
- package/dist/cjs/entry-points/events.js +18 -0
- package/dist/cjs/entry-points/extension-renderer.js +20 -0
- package/dist/cjs/entry-points/loosely-lazy.js +12 -0
- package/dist/cjs/entry-points/media-options.js +1 -0
- package/dist/cjs/entry-points/messages.js +24 -0
- package/dist/cjs/entry-points/nodes.js +300 -0
- package/dist/cjs/entry-points/react-types.js +1 -0
- package/dist/cjs/entry-points/react.js +13 -0
- package/dist/cjs/entry-points/render-document.js +12 -0
- package/dist/cjs/entry-points/renderer-actions-context.js +24 -0
- package/dist/cjs/entry-points/renderer-context.js +18 -0
- package/dist/cjs/entry-points/renderer-props.js +1 -0
- package/dist/cjs/entry-points/renderer.js +44 -0
- package/dist/cjs/entry-points/serializer.js +1 -0
- package/dist/cjs/entry-points/text-serializer-text.js +13 -0
- package/dist/cjs/entry-points/text.js +13 -0
- package/dist/cjs/entry-points/types.js +1 -0
- package/dist/cjs/entry-points/use-feature-flags.js +12 -0
- package/dist/cjs/entry-points/utils.js +30 -0
- package/dist/cjs/entry-points/validation-context.js +18 -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/entry-points/actions-main.js +0 -0
- package/dist/es2019/entry-points/actions-renderer-actions-context.js +2 -0
- package/dist/es2019/entry-points/actions-with-renderer-actions.js +2 -0
- package/dist/es2019/entry-points/annotations.js +2 -0
- package/dist/es2019/entry-points/consts.js +2 -0
- package/dist/es2019/entry-points/custom-nodes-loosely-lazy.js +2 -0
- package/dist/es2019/entry-points/events.js +2 -0
- package/dist/es2019/entry-points/extension-renderer.js +3 -0
- package/dist/es2019/entry-points/loosely-lazy.js +2 -0
- package/dist/es2019/entry-points/media-options.js +0 -0
- package/dist/es2019/entry-points/messages.js +2 -0
- package/dist/es2019/entry-points/nodes.js +2 -0
- package/dist/es2019/entry-points/react-types.js +0 -0
- package/dist/es2019/entry-points/react.js +3 -0
- package/dist/es2019/entry-points/render-document.js +2 -0
- package/dist/es2019/entry-points/renderer-actions-context.js +2 -0
- package/dist/es2019/entry-points/renderer-context.js +2 -0
- package/dist/es2019/entry-points/renderer-props.js +0 -0
- package/dist/es2019/entry-points/renderer.js +3 -0
- package/dist/es2019/entry-points/serializer.js +0 -0
- package/dist/es2019/entry-points/text-serializer-text.js +2 -0
- package/dist/es2019/entry-points/text.js +2 -0
- package/dist/es2019/entry-points/types.js +0 -0
- package/dist/es2019/entry-points/use-feature-flags.js +2 -0
- package/dist/es2019/entry-points/utils.js +2 -0
- package/dist/es2019/entry-points/validation-context.js +2 -0
- 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/entry-points/actions-main.js +0 -0
- package/dist/esm/entry-points/actions-renderer-actions-context.js +2 -0
- package/dist/esm/entry-points/actions-with-renderer-actions.js +2 -0
- package/dist/esm/entry-points/annotations.js +2 -0
- package/dist/esm/entry-points/consts.js +2 -0
- package/dist/esm/entry-points/custom-nodes-loosely-lazy.js +2 -0
- package/dist/esm/entry-points/events.js +2 -0
- package/dist/esm/entry-points/extension-renderer.js +3 -0
- package/dist/esm/entry-points/loosely-lazy.js +2 -0
- package/dist/esm/entry-points/media-options.js +0 -0
- package/dist/esm/entry-points/messages.js +2 -0
- package/dist/esm/entry-points/nodes.js +2 -0
- package/dist/esm/entry-points/react-types.js +0 -0
- package/dist/esm/entry-points/react.js +3 -0
- package/dist/esm/entry-points/render-document.js +2 -0
- package/dist/esm/entry-points/renderer-actions-context.js +2 -0
- package/dist/esm/entry-points/renderer-context.js +2 -0
- package/dist/esm/entry-points/renderer-props.js +0 -0
- package/dist/esm/entry-points/renderer.js +3 -0
- package/dist/esm/entry-points/serializer.js +0 -0
- package/dist/esm/entry-points/text-serializer-text.js +2 -0
- package/dist/esm/entry-points/text.js +2 -0
- package/dist/esm/entry-points/types.js +0 -0
- package/dist/esm/entry-points/use-feature-flags.js +2 -0
- package/dist/esm/entry-points/utils.js +2 -0
- package/dist/esm/entry-points/validation-context.js +2 -0
- 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/entry-points/actions-main.d.ts +1 -0
- package/dist/types/entry-points/actions-renderer-actions-context.d.ts +1 -0
- package/dist/types/entry-points/actions-with-renderer-actions.d.ts +1 -0
- package/dist/types/entry-points/annotations.d.ts +1 -0
- package/dist/types/entry-points/consts.d.ts +1 -0
- package/dist/types/entry-points/custom-nodes-loosely-lazy.d.ts +1 -0
- package/dist/types/entry-points/events.d.ts +2 -0
- package/dist/types/entry-points/extension-renderer.d.ts +2 -0
- package/dist/types/entry-points/loosely-lazy.d.ts +1 -0
- package/dist/types/entry-points/media-options.d.ts +1 -0
- package/dist/types/entry-points/messages.d.ts +1 -0
- package/dist/types/entry-points/nodes.d.ts +2 -0
- package/dist/types/entry-points/react-types.d.ts +1 -0
- package/dist/types/entry-points/react.d.ts +2 -0
- package/dist/types/entry-points/render-document.d.ts +2 -0
- package/dist/types/entry-points/renderer-actions-context.d.ts +1 -0
- package/dist/types/entry-points/renderer-context.d.ts +2 -0
- package/dist/types/entry-points/renderer-props.d.ts +1 -0
- package/dist/types/entry-points/renderer.d.ts +3 -0
- package/dist/types/entry-points/serializer.d.ts +1 -0
- package/dist/types/entry-points/text-serializer-text.d.ts +1 -0
- package/dist/types/entry-points/text.d.ts +1 -0
- package/dist/types/entry-points/types.d.ts +1 -0
- package/dist/types/entry-points/use-feature-flags.d.ts +1 -0
- package/dist/types/entry-points/utils.d.ts +2 -0
- package/dist/types/entry-points/validation-context.d.ts +1 -0
- 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/entry-points/actions-main.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/actions-renderer-actions-context.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/actions-with-renderer-actions.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/annotations.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/consts.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/custom-nodes-loosely-lazy.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/events.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/extension-renderer.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/loosely-lazy.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/media-options.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/messages.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/nodes.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/react-types.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/react.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/render-document.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/renderer-actions-context.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/renderer-context.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/renderer-props.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/renderer.d.ts +3 -0
- package/dist/types-ts4.5/entry-points/serializer.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/text-serializer-text.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/text.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/types.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/use-feature-flags.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/utils.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/validation-context.d.ts +1 -0
- 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/events/package.json +17 -0
- package/extension-renderer/package.json +17 -0
- package/loosely-lazy/package.json +17 -0
- package/media-options/package.json +17 -0
- package/messages/package.json +5 -5
- package/nodes/package.json +17 -0
- package/package.json +9 -9
- package/react/package.json +17 -0
- package/react/types/package.json +17 -0
- package/render-document/package.json +5 -5
- package/renderer/package.json +17 -0
- package/renderer-actions-context/package.json +17 -0
- package/renderer-context/package.json +5 -5
- package/renderer-props/package.json +17 -0
- package/serializer/package.json +5 -5
- package/text/package.json +17 -0
- package/text-serializer/text/package.json +17 -0
- package/types/package.json +17 -0
- package/use-feature-flags/package.json +5 -5
- package/utils/package.json +5 -5
- package/validation-context/package.json +17 -0
|
@@ -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
|
};
|
|
@@ -278,6 +278,7 @@ export class TableContainer extends React.Component {
|
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
280
|
/**
|
|
281
|
+
* Starts observing table dimensions and wires sticky header/scrollbar behavior after mount.
|
|
281
282
|
*
|
|
282
283
|
* @example
|
|
283
284
|
*/
|
|
@@ -302,6 +303,7 @@ export class TableContainer extends React.Component {
|
|
|
302
303
|
}
|
|
303
304
|
|
|
304
305
|
/**
|
|
306
|
+
* Updates sticky header wiring and scroll synchronization after prop or state changes.
|
|
305
307
|
*
|
|
306
308
|
* @param prevProps
|
|
307
309
|
* @param prevState
|
|
@@ -330,7 +332,7 @@ export class TableContainer extends React.Component {
|
|
|
330
332
|
}
|
|
331
333
|
}
|
|
332
334
|
/**
|
|
333
|
-
*
|
|
335
|
+
* Calculates the top offset used when the sticky header is pinned to the table bottom.
|
|
334
336
|
*/
|
|
335
337
|
get pinTop() {
|
|
336
338
|
if (!this.tableRef.current || !this.stickyHeaderRef.current) {
|
|
@@ -340,7 +342,7 @@ export class TableContainer extends React.Component {
|
|
|
340
342
|
}
|
|
341
343
|
|
|
342
344
|
/**
|
|
343
|
-
*
|
|
345
|
+
* Determines whether sticky header positioning should include the default scroll root offset.
|
|
344
346
|
*/
|
|
345
347
|
get shouldAddOverflowParentOffsetTop_DO_NOT_USE() {
|
|
346
348
|
// IF the StickyHeaderConfig specifies that the default scroll root offsetTop should be added
|
|
@@ -351,7 +353,7 @@ export class TableContainer extends React.Component {
|
|
|
351
353
|
}
|
|
352
354
|
|
|
353
355
|
/**
|
|
354
|
-
*
|
|
356
|
+
* Resolves the top position for the sticky header based on the current sticky mode.
|
|
355
357
|
*/
|
|
356
358
|
get stickyTop() {
|
|
357
359
|
switch (this.state.stickyMode) {
|
|
@@ -371,6 +373,7 @@ export class TableContainer extends React.Component {
|
|
|
371
373
|
}
|
|
372
374
|
|
|
373
375
|
/**
|
|
376
|
+
* Renders the table container, sticky header, table content, sticky scrollbar, and synced block borders.
|
|
374
377
|
*
|
|
375
378
|
* @example
|
|
376
379
|
*/
|
|
@@ -565,14 +568,91 @@ export class TableContainer extends React.Component {
|
|
|
565
568
|
})));
|
|
566
569
|
}
|
|
567
570
|
}
|
|
571
|
+
const getCellEdgePropsByCellOffset = tableNode => {
|
|
572
|
+
const cellEdgePropsByCellOffset = new Map();
|
|
573
|
+
const cellRightByCellOffset = new Map();
|
|
574
|
+
const occupiedGrid = [];
|
|
575
|
+
let tableWidth = 0;
|
|
576
|
+
let cellOffset = 0;
|
|
577
|
+
tableNode.forEach((rowNode, _rowOffset, rowIndex) => {
|
|
578
|
+
var _occupiedGrid$rowInde;
|
|
579
|
+
occupiedGrid[rowIndex] = (_occupiedGrid$rowInde = occupiedGrid[rowIndex]) !== null && _occupiedGrid$rowInde !== void 0 ? _occupiedGrid$rowInde : [];
|
|
580
|
+
let columnIndex = 0;
|
|
581
|
+
cellOffset += 1;
|
|
582
|
+
rowNode.forEach(cellNode => {
|
|
583
|
+
while (occupiedGrid[rowIndex][columnIndex]) {
|
|
584
|
+
columnIndex += 1;
|
|
585
|
+
}
|
|
586
|
+
const colspan = cellNode.attrs.colspan || 1;
|
|
587
|
+
const rowspan = cellNode.attrs.rowspan || 1;
|
|
588
|
+
const cellLeft = columnIndex;
|
|
589
|
+
const cellRight = cellLeft + colspan;
|
|
590
|
+
const cellTop = rowIndex;
|
|
591
|
+
const cellBottom = cellTop + rowspan;
|
|
592
|
+
for (let row = cellTop; row < cellBottom; row += 1) {
|
|
593
|
+
var _occupiedGrid$row;
|
|
594
|
+
occupiedGrid[row] = (_occupiedGrid$row = occupiedGrid[row]) !== null && _occupiedGrid$row !== void 0 ? _occupiedGrid$row : [];
|
|
595
|
+
for (let column = cellLeft; column < cellRight; column += 1) {
|
|
596
|
+
occupiedGrid[row][column] = true;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
tableWidth = Math.max(tableWidth, cellRight);
|
|
600
|
+
cellRightByCellOffset.set(cellOffset, cellRight);
|
|
601
|
+
cellEdgePropsByCellOffset.set(cellOffset, {
|
|
602
|
+
reachesBottom: cellBottom >= tableNode.childCount,
|
|
603
|
+
reachesLeft: cellLeft === 0,
|
|
604
|
+
reachesRight: false,
|
|
605
|
+
reachesTop: cellTop === 0
|
|
606
|
+
});
|
|
607
|
+
columnIndex = cellRight;
|
|
608
|
+
cellOffset += cellNode.nodeSize;
|
|
609
|
+
});
|
|
610
|
+
cellOffset += 1;
|
|
611
|
+
});
|
|
612
|
+
cellRightByCellOffset.forEach((cellRight, currentCellOffset) => {
|
|
613
|
+
const edgeProps = cellEdgePropsByCellOffset.get(currentCellOffset);
|
|
614
|
+
if (edgeProps) {
|
|
615
|
+
edgeProps.reachesRight = cellRight >= tableWidth;
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
return cellEdgePropsByCellOffset;
|
|
619
|
+
};
|
|
620
|
+
const addTableCellEdgeProps = (rows, tableNode) => {
|
|
621
|
+
try {
|
|
622
|
+
if (!tableNode) {
|
|
623
|
+
return rows;
|
|
624
|
+
}
|
|
625
|
+
const cellEdgePropsByCellOffset = getCellEdgePropsByCellOffset(tableNode);
|
|
626
|
+
let cellOffset = 0;
|
|
627
|
+
return React.Children.map(rows, (row, rowIndex) => {
|
|
628
|
+
const rowNode = tableNode.child(rowIndex);
|
|
629
|
+
cellOffset += 1;
|
|
630
|
+
let cellIndex = 0;
|
|
631
|
+
const rowChildren = React.Children.map(row.props.children, child => {
|
|
632
|
+
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
633
|
+
return child;
|
|
634
|
+
}
|
|
635
|
+
const cellNode = rowNode.child(cellIndex);
|
|
636
|
+
const edgeProps = cellEdgePropsByCellOffset.get(cellOffset);
|
|
637
|
+
cellIndex += 1;
|
|
638
|
+
cellOffset += cellNode.nodeSize;
|
|
639
|
+
return edgeProps ? /*#__PURE__*/React.cloneElement(child, edgeProps) : child;
|
|
640
|
+
});
|
|
641
|
+
cellOffset += 1;
|
|
642
|
+
return /*#__PURE__*/React.cloneElement(row, undefined, rowChildren);
|
|
643
|
+
});
|
|
644
|
+
} catch {
|
|
645
|
+
// Renderer can receive malformed historical ADF. If the table shape cannot
|
|
646
|
+
// be described safely, keep rendering without rounded edge metadata.
|
|
647
|
+
return rows;
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
|
|
568
651
|
/**
|
|
569
|
-
*
|
|
652
|
+
* Processes table children before passing them to the styled table container.
|
|
570
653
|
*/
|
|
571
654
|
// Ignored via go/ees005
|
|
572
655
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
573
|
-
/**
|
|
574
|
-
*
|
|
575
|
-
*/
|
|
576
656
|
export class TableProcessorWithContainerStyles extends React.Component {
|
|
577
657
|
constructor(...args) {
|
|
578
658
|
super(...args);
|
|
@@ -618,23 +698,63 @@ export class TableProcessorWithContainerStyles extends React.Component {
|
|
|
618
698
|
});
|
|
619
699
|
}
|
|
620
700
|
/**
|
|
701
|
+
* Renders processed table children inside the table container.
|
|
621
702
|
*
|
|
622
703
|
* @example
|
|
623
704
|
*/
|
|
624
705
|
render() {
|
|
625
706
|
const {
|
|
626
|
-
|
|
707
|
+
allowColumnSorting,
|
|
708
|
+
allowFixedColumnWidthOption,
|
|
709
|
+
allowTableAlignment,
|
|
710
|
+
allowTableResizing,
|
|
711
|
+
children,
|
|
712
|
+
columnWidths,
|
|
713
|
+
disableTableOverflowShadow,
|
|
714
|
+
handleRef,
|
|
715
|
+
isinsideMultiBodiedExtension,
|
|
716
|
+
isInsideOfBlockNode,
|
|
717
|
+
isInsideOfTable,
|
|
718
|
+
isNumberColumnEnabled,
|
|
719
|
+
isPresentational,
|
|
720
|
+
layout,
|
|
721
|
+
rendererAppearance,
|
|
722
|
+
renderWidth,
|
|
723
|
+
shadowClassNames,
|
|
724
|
+
smartCardStorage,
|
|
725
|
+
stickyHeaders,
|
|
726
|
+
tabIndex,
|
|
727
|
+
tableNode
|
|
627
728
|
} = this.props;
|
|
628
729
|
if (!children) {
|
|
629
730
|
return null;
|
|
630
731
|
}
|
|
631
732
|
const childrenArray = React.Children.toArray(children);
|
|
733
|
+
const childrenWithTableEdgeProps = expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? addTableCellEdgeProps(childrenArray, tableNode) : childrenArray;
|
|
632
734
|
const orderedChildren = compose(this.addNumberColumnIndexes, this.addSortableColumn
|
|
633
735
|
// @ts-expect-error TS2345: Argument of type '(ReactChild | ReactFragment | ReactPortal)[]' is not assignable to parameter of type 'ReactElement<any, string | JSXElementConstructor<any>>[]'
|
|
634
|
-
)(
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
736
|
+
)(childrenWithTableEdgeProps);
|
|
737
|
+
return /*#__PURE__*/React.createElement(TableContainer, {
|
|
738
|
+
allowColumnSorting: allowColumnSorting,
|
|
739
|
+
allowFixedColumnWidthOption: allowFixedColumnWidthOption,
|
|
740
|
+
allowTableAlignment: allowTableAlignment,
|
|
741
|
+
allowTableResizing: allowTableResizing,
|
|
742
|
+
columnWidths: columnWidths,
|
|
743
|
+
disableTableOverflowShadow: disableTableOverflowShadow,
|
|
744
|
+
handleRef: handleRef,
|
|
745
|
+
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension,
|
|
746
|
+
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
747
|
+
isInsideOfTable: isInsideOfTable,
|
|
748
|
+
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
749
|
+
isPresentational: isPresentational,
|
|
750
|
+
layout: layout,
|
|
751
|
+
rendererAppearance: rendererAppearance,
|
|
752
|
+
renderWidth: renderWidth,
|
|
753
|
+
shadowClassNames: shadowClassNames,
|
|
754
|
+
smartCardStorage: smartCardStorage,
|
|
755
|
+
stickyHeaders: stickyHeaders,
|
|
756
|
+
tabIndex: tabIndex,
|
|
757
|
+
tableNode: tableNode
|
|
758
|
+
}, orderedChildren);
|
|
639
759
|
}
|
|
640
760
|
}
|
|
@@ -182,7 +182,10 @@ const headingAnchorStylesDuplicateAnchor = css({
|
|
|
182
182
|
'> button': {
|
|
183
183
|
opacity: 0,
|
|
184
184
|
transform: 'translate(-8px, 0px)',
|
|
185
|
-
|
|
185
|
+
transitionProperty: 'opacity, transform',
|
|
186
|
+
transitionDuration: `${"var(--ds-duration-medium, 0.2s)"}, ${"var(--ds-duration-medium, 0.2s)"}`,
|
|
187
|
+
transitionTimingFunction: `${"var(--ds-easing-out-practical, ease)"}, ${"var(--ds-easing-out-practical, ease)"}`,
|
|
188
|
+
transitionDelay: '0s, 0s'
|
|
186
189
|
}
|
|
187
190
|
},
|
|
188
191
|
'&:hover': {
|
|
@@ -1883,6 +1886,47 @@ const tableSharedStyle = css({
|
|
|
1883
1886
|
}
|
|
1884
1887
|
}
|
|
1885
1888
|
});
|
|
1889
|
+
const roundedTableOuterBorderOverlayStyles = css({
|
|
1890
|
+
[`.${TableSharedCssClassName.TABLE_CONTAINER} > table,
|
|
1891
|
+
.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
|
|
1892
|
+
.${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table`]: {
|
|
1893
|
+
borderColor: 'transparent',
|
|
1894
|
+
position: 'relative',
|
|
1895
|
+
'&::after': {
|
|
1896
|
+
content: "''",
|
|
1897
|
+
position: 'absolute',
|
|
1898
|
+
inset: 0,
|
|
1899
|
+
border: `${tableCellBorderWidth}px solid ${"var(--ds-background-accent-gray-subtler, #DDDEE1)"}`,
|
|
1900
|
+
borderRadius: "var(--ds-radius-medium, 6px)",
|
|
1901
|
+
pointerEvents: 'none',
|
|
1902
|
+
zIndex: 1
|
|
1903
|
+
},
|
|
1904
|
+
'> tbody > tr:first-of-type > th, > tbody > tr:first-of-type > td, > tbody > tr > th[data-reaches-top], > tbody > tr > td[data-reaches-top]': {
|
|
1905
|
+
borderTopColor: 'transparent'
|
|
1906
|
+
},
|
|
1907
|
+
'> tbody > tr > th:first-child, > tbody > tr > td:first-child, > tbody > tr > th[data-reaches-left], > tbody > tr > td[data-reaches-left]': {
|
|
1908
|
+
borderLeftColor: 'transparent'
|
|
1909
|
+
},
|
|
1910
|
+
'> tbody > tr > th[data-reaches-right], > tbody > tr > td[data-reaches-right]': {
|
|
1911
|
+
borderRightColor: 'transparent'
|
|
1912
|
+
},
|
|
1913
|
+
'> tbody > tr > th[data-reaches-bottom], > tbody > tr > td[data-reaches-bottom]': {
|
|
1914
|
+
borderBottomColor: 'transparent'
|
|
1915
|
+
},
|
|
1916
|
+
'> tbody > tr > th[data-reaches-top][data-reaches-left], > tbody > tr > td[data-reaches-top][data-reaches-left]': {
|
|
1917
|
+
borderTopLeftRadius: "var(--ds-radius-medium, 6px)"
|
|
1918
|
+
},
|
|
1919
|
+
'> tbody > tr > th[data-reaches-top][data-reaches-right], > tbody > tr > td[data-reaches-top][data-reaches-right]': {
|
|
1920
|
+
borderTopRightRadius: "var(--ds-radius-medium, 6px)"
|
|
1921
|
+
},
|
|
1922
|
+
'> tbody > tr > th[data-reaches-bottom][data-reaches-left], > tbody > tr > td[data-reaches-bottom][data-reaches-left]': {
|
|
1923
|
+
borderBottomLeftRadius: "var(--ds-radius-medium, 6px)"
|
|
1924
|
+
},
|
|
1925
|
+
'> tbody > tr > th[data-reaches-bottom][data-reaches-right], > tbody > tr > td[data-reaches-bottom][data-reaches-right]': {
|
|
1926
|
+
borderBottomRightRadius: "var(--ds-radius-medium, 6px)"
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
});
|
|
1886
1930
|
const tableContentModeStyles = css({
|
|
1887
1931
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
1888
1932
|
[`.${RendererCssClassName.DOCUMENT} .${TableSharedCssClassName.TABLE_CONTAINER}:has(table[data-initial-width-mode="content"])`]: {
|
|
@@ -2690,6 +2734,14 @@ const tableFakeBorderStyles = css({
|
|
|
2690
2734
|
borderRightColor: 'transparent'
|
|
2691
2735
|
}
|
|
2692
2736
|
});
|
|
2737
|
+
const roundedTableFakeBorderOverlayStyles = css({
|
|
2738
|
+
[`.${TableSharedCssClassName.TABLE_CONTAINER}`]: {
|
|
2739
|
+
[`.${TableSharedCssClassName.TABLE_RIGHT_BORDER},
|
|
2740
|
+
.${TableSharedCssClassName.TABLE_LEFT_BORDER}`]: {
|
|
2741
|
+
display: 'none'
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
});
|
|
2693
2745
|
const syncBlockStyles = css({
|
|
2694
2746
|
[`.${SyncBlockSharedCssClassName.renderer}, .${BodiedSyncBlockSharedCssClassName.renderer}, .${SyncBlockSharedCssClassName.error}, .${SyncBlockSharedCssClassName.loading}`]: {
|
|
2695
2747
|
borderRadius: "var(--ds-radius-small, 3px)",
|
|
@@ -2767,7 +2819,7 @@ export const RendererStyleContainer = props => {
|
|
|
2767
2819
|
// this should be placed after baseOtherStyles
|
|
2768
2820
|
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle,
|
|
2769
2821
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
2770
|
-
fg('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, fg('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, isStickyScrollbarEnabled(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && (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' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? expValEquals('platform_editor_emojis_in_renderer_smart_links', 'isEnabled', true) ? isCompactModeEnabled ? scaledDenseEmojiStylesNew : scaledEmojiStylesNew : isCompactModeEnabled ? scaledDenseEmojiStyles : scaledEmojiStyles : isCompactModeEnabled ? denseStyles : undefined, editorExperiment('platform_synced_block', true) && syncBlockStyles, centerWrapperStyles, editorExperiment('platform_synced_block', true) && isInsideSyncBlock && fg('platform_synced_block_patch_9') ? syncBlockRendererStyles : null, isInsideSyncBlock && editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_9') && tableFakeBorderStyles, expValEquals('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2822
|
+
fg('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, fg('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, isStickyScrollbarEnabled(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && (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' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? expValEquals('platform_editor_emojis_in_renderer_smart_links', 'isEnabled', true) ? isCompactModeEnabled ? scaledDenseEmojiStylesNew : scaledEmojiStylesNew : isCompactModeEnabled ? scaledDenseEmojiStyles : scaledEmojiStyles : isCompactModeEnabled ? denseStyles : undefined, editorExperiment('platform_synced_block', true) && syncBlockStyles, centerWrapperStyles, editorExperiment('platform_synced_block', true) && isInsideSyncBlock && fg('platform_synced_block_patch_9') ? syncBlockRendererStyles : null, isInsideSyncBlock && editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_9') && tableFakeBorderStyles, isInsideSyncBlock && editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_9') ? expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableFakeBorderOverlayStyles : null : null, expValEquals('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2771
2823
|
"data-testid": testId
|
|
2772
2824
|
}, children);
|
|
2773
2825
|
};
|
|
@@ -57,7 +57,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
57
57
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
58
58
|
const RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
59
59
|
const packageName = "@atlaskit/renderer";
|
|
60
|
-
const packageVersion = "130.
|
|
60
|
+
const packageVersion = "130.5.1";
|
|
61
61
|
const setAsQueryContainerStyles = css({
|
|
62
62
|
containerName: 'ak-renderer-wrapper',
|
|
63
63
|
containerType: 'inline-size'
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
|
+
export { BlockCard, Blockquote, BodiedExtension, BulletList, Caption, CodeBlock, Date, DecisionItem, DecisionList, Doc, DocWithSelectAllTrap, EmbedCard, Emoji, Expand, Extension, ExtensionFrame, HardBreak, Heading, InlineCard, InlineExtension, LayoutColumn, LayoutSection, ListItem, Media, MediaGroup, MediaInline, MediaSingle, Mention, MultiBodiedExtension, OrderedList, Panel, Paragraph, Placeholder, Rule, Status, Table, TableCell, TableRow, TaskItem, TaskList, UnknownBlock, WindowedCodeBlock, isEmojiDoc, isText, isTextNode, isTextWrapper, mergeTextNodes, nodeToReact, toReact } from '../react/nodes/index';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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
|
var IgnoreSorting = ['LABEL', 'INPUT'];
|
|
14
15
|
var nextStatusOrder = function nextStatusOrder(currentSortOrder) {
|
|
15
16
|
switch (currentSortOrder) {
|
|
@@ -37,16 +38,26 @@ var getSortOrderLabel = function getSortOrderLabel(intl, currentSortOrder) {
|
|
|
37
38
|
return intl.formatMessage(noneSortingLabel);
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
|
-
|
|
41
|
-
// Ignored via go/ees005
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
-
var getDataAttributes = function getDataAttributes(colwidth, background) {
|
|
44
|
-
// Ignored via go/ees005
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
var getDataAttributes = function getDataAttributes(colwidth, background, cellEdgeProps) {
|
|
46
42
|
var attrs = {};
|
|
47
43
|
if (colwidth) {
|
|
48
44
|
attrs['data-colwidth'] = colwidth.join(',');
|
|
49
45
|
}
|
|
46
|
+
if (expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true)) {
|
|
47
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesTop) {
|
|
48
|
+
attrs['data-reaches-top'] = true;
|
|
49
|
+
}
|
|
50
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesBottom) {
|
|
51
|
+
attrs['data-reaches-bottom'] = true;
|
|
52
|
+
}
|
|
53
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesLeft) {
|
|
54
|
+
attrs['data-reaches-left'] = true;
|
|
55
|
+
}
|
|
56
|
+
if (cellEdgeProps !== null && cellEdgeProps !== void 0 && cellEdgeProps.reachesRight) {
|
|
57
|
+
attrs['data-reaches-right'] = true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
50
61
|
/**
|
|
51
62
|
* Storing hex code in data-cell-background because
|
|
52
63
|
* we want to have DST token (css variable) or
|
|
@@ -140,7 +151,11 @@ var getWithCellProps = function getWithCellProps(WrapperComponent) {
|
|
|
140
151
|
colspan = props.colspan,
|
|
141
152
|
background = props.background,
|
|
142
153
|
offsetTop = props.offsetTop,
|
|
143
|
-
ariaSort = props.ariaSort
|
|
154
|
+
ariaSort = props.ariaSort,
|
|
155
|
+
reachesTop = props.reachesTop,
|
|
156
|
+
reachesBottom = props.reachesBottom,
|
|
157
|
+
reachesLeft = props.reachesLeft,
|
|
158
|
+
reachesRight = props.reachesRight;
|
|
144
159
|
|
|
145
160
|
// This is used to set the background color of the cell
|
|
146
161
|
// to a dark mode color in mobile dark mode
|
|
@@ -167,7 +182,12 @@ var getWithCellProps = function getWithCellProps(WrapperComponent) {
|
|
|
167
182
|
className: className
|
|
168
183
|
// Ignored via go/ees005
|
|
169
184
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
170
|
-
}, getDataAttributes(colwidth, background
|
|
185
|
+
}, getDataAttributes(colwidth, background, {
|
|
186
|
+
reachesTop: reachesTop,
|
|
187
|
+
reachesBottom: reachesBottom,
|
|
188
|
+
reachesLeft: reachesLeft,
|
|
189
|
+
reachesRight: reachesRight
|
|
190
|
+
}), {
|
|
171
191
|
"aria-sort": ariaSort
|
|
172
192
|
}), children);
|
|
173
193
|
};
|