@atlaskit/editor-plugin-table 10.1.4 → 10.2.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 +25 -0
- package/commands/package.json +3 -1
- package/dist/cjs/nodeviews/TableComponent.js +46 -7
- package/dist/cjs/nodeviews/TableStickyScrollbar.js +3 -5
- package/dist/cjs/ui/toolbar.js +0 -1
- package/dist/es2019/nodeviews/TableComponent.js +46 -7
- package/dist/es2019/nodeviews/TableStickyScrollbar.js +5 -4
- package/dist/es2019/ui/toolbar.js +0 -1
- package/dist/esm/nodeviews/TableComponent.js +46 -7
- package/dist/esm/nodeviews/TableStickyScrollbar.js +3 -5
- package/dist/esm/ui/toolbar.js +0 -1
- package/package.json +8 -3
- package/plugin-key/package.json +3 -1
- package/src/nodeviews/TableComponent.tsx +101 -33
- package/src/nodeviews/TableStickyScrollbar.ts +5 -5
- package/src/ui/common-styles.ts +3 -6
- package/src/ui/toolbar.tsx +0 -1
- package/types/package.json +3 -1
- package/ui/common-styles/package.json +3 -1
- package/ui/consts/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 10.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#120533](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120533)
|
|
8
|
+
[`f1bec731e278f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f1bec731e278f) -
|
|
9
|
+
Adds a `sideEffects` field to ensure this package does not have Compiled styles tree-shaken in the
|
|
10
|
+
future to avoid an accidental regression.
|
|
11
|
+
|
|
12
|
+
This is related to
|
|
13
|
+
https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953
|
|
14
|
+
|
|
15
|
+
## 10.2.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#119765](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/119765)
|
|
20
|
+
[`5a27b842be965`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5a27b842be965) -
|
|
21
|
+
Add deprecated label to `forceStaticToolbar` in floating toolbar property and remove its usage
|
|
22
|
+
across plugins
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 10.1.4
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/commands/package.json
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
"main": "../dist/cjs/pm-plugins/commands/index.js",
|
|
4
4
|
"module": "../dist/esm/pm-plugins/commands/index.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/pm-plugins/commands/index.js",
|
|
6
|
-
"sideEffects":
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
7
9
|
"types": "../dist/types/pm-plugins/commands/index.d.ts",
|
|
8
10
|
"typesVersions": {
|
|
9
11
|
">=4.5 <5.4": {
|
|
@@ -344,6 +344,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
344
344
|
_getNode = props.getNode;
|
|
345
345
|
_this.node = _getNode();
|
|
346
346
|
_this.containerWidth = _containerWidth;
|
|
347
|
+
var tablePos = props.getPos();
|
|
348
|
+
_this.isNestedInTable = tablePos && (0, _platformFeatureFlags.fg)('nested_table_control_padding_with_css') ? (0, _nesting.getParentOfTypeCount)(props.view.state.schema.nodes.table)(props.view.state.doc.resolve(tablePos)) > 0 : false;
|
|
347
349
|
_this.isInitialOverflowSent = false;
|
|
348
350
|
if (!_this.updateColGroupFromFullWidthChange) {
|
|
349
351
|
_this.updateColGroupFromFullWidthChange = (_options === null || _options === void 0 ? void 0 : _options.isFullWidthModeEnabled) && !(_options !== null && _options !== void 0 && _options.wasFullWidthModeEnabled);
|
|
@@ -449,8 +451,14 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
449
451
|
this.wrapper.addEventListener('scroll', this.handleScrollDebounced, {
|
|
450
452
|
passive: true
|
|
451
453
|
});
|
|
452
|
-
if (
|
|
453
|
-
|
|
454
|
+
if ((0, _platformFeatureFlags.fg)('disable-sticky-scrollbar-for-nested-tables')) {
|
|
455
|
+
if (this.table && !this.isNestedInTable) {
|
|
456
|
+
this.stickyScrollbar = new _TableStickyScrollbar.TableStickyScrollbar(this.wrapper, this.props.view);
|
|
457
|
+
}
|
|
458
|
+
} else {
|
|
459
|
+
if (this.table) {
|
|
460
|
+
this.stickyScrollbar = new _TableStickyScrollbar.TableStickyScrollbar(this.wrapper, this.props.view);
|
|
461
|
+
}
|
|
454
462
|
}
|
|
455
463
|
if (isDragAndDropEnabled) {
|
|
456
464
|
this.dragAndDropCleanupFn = _combine.combine.apply(void 0, (0, _toConsumableArray2.default)((0, _autoscrollers.autoScrollerFactory)({
|
|
@@ -930,7 +938,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
930
938
|
tablePos = undefined;
|
|
931
939
|
}
|
|
932
940
|
var isNested = (0, _nodes.isTableNested)(view.state, tablePos);
|
|
933
|
-
var isNestedInTable = tablePos && (0, _platformFeatureFlags.fg)('nested_table_control_padding_with_css') ? (0, _nesting.getParentOfTypeCount)(view.state.schema.nodes.table)(view.state.doc.resolve(tablePos)) > 0 : false;
|
|
934
941
|
var topShadowPadding = isDragAndDropEnabled ? 0 : shadowPadding;
|
|
935
942
|
var topOffset = 0;
|
|
936
943
|
var topStickyShadowPosition = this.state.stickyHeader && topOffset + this.state.stickyHeader.padding + topShadowPadding + 2;
|
|
@@ -941,7 +948,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
941
948
|
return /*#__PURE__*/_react.default.createElement(_TableContainer.TableContainer
|
|
942
949
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
943
950
|
, {
|
|
944
|
-
className: (0, _classnames2.default)(_types.TableCssClassName.TABLE_CONTAINER, (0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)({}, _types.TableCssClassName.WITH_CONTROLS, allowControls && tableActive), _types.TableCssClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), _types.TableCssClassName.HOVERED_DELETE_BUTTON, isInDanger), _types.TableCssClassName.TABLE_SELECTED, (0, _utils2.isTableSelected)(selection !== null && selection !== void 0 ? selection : view.state.selection)), _types.TableCssClassName.NESTED_TABLE_WITH_CONTROLS, tableActive && allowControls && isNestedInTable)),
|
|
951
|
+
className: (0, _classnames2.default)(_types.TableCssClassName.TABLE_CONTAINER, (0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)({}, _types.TableCssClassName.WITH_CONTROLS, allowControls && tableActive), _types.TableCssClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), _types.TableCssClassName.HOVERED_DELETE_BUTTON, isInDanger), _types.TableCssClassName.TABLE_SELECTED, (0, _utils2.isTableSelected)(selection !== null && selection !== void 0 ? selection : view.state.selection)), _types.TableCssClassName.NESTED_TABLE_WITH_CONTROLS, tableActive && allowControls && this.isNestedInTable)),
|
|
945
952
|
editorView: view,
|
|
946
953
|
getPos: getPos,
|
|
947
954
|
node: node
|
|
@@ -966,7 +973,11 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
966
973
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
967
974
|
className: _types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
968
975
|
"data-testid": "sticky-sentinel-top"
|
|
969
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
976
|
+
}), (0, _platformFeatureFlags.fg)('disable-sticky-scrollbar-for-nested-tables') ? !this.isNestedInTable && /*#__PURE__*/_react.default.createElement("div", {
|
|
977
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
978
|
+
className: _types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP,
|
|
979
|
+
"data-testid": "sticky-scrollbar-sentinel-top"
|
|
980
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
970
981
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
971
982
|
className: _types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP,
|
|
972
983
|
"data-testid": "sticky-scrollbar-sentinel-top"
|
|
@@ -1012,7 +1023,31 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1012
1023
|
}
|
|
1013
1024
|
}
|
|
1014
1025
|
}
|
|
1015
|
-
}, allowControls && colControls), /*#__PURE__*/_react.default.createElement("div", {
|
|
1026
|
+
}, allowControls && colControls), (0, _platformFeatureFlags.fg)('disable-sticky-scrollbar-for-nested-tables') ? !this.isNestedInTable ? /*#__PURE__*/_react.default.createElement("div", {
|
|
1027
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1028
|
+
className: _types.TableCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
1029
|
+
style: {
|
|
1030
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1031
|
+
height: "var(--ds-space-250, 20px)",
|
|
1032
|
+
// MAX_BROWSER_SCROLLBAR_HEIGHT
|
|
1033
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1034
|
+
display: 'none',
|
|
1035
|
+
// prevent unwanted scroll during table resize without removing scrollbar container from the dom
|
|
1036
|
+
width: isResizing ? "var(--ds-space-0, 0px)" : '100%'
|
|
1037
|
+
}
|
|
1038
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1039
|
+
style: {
|
|
1040
|
+
width: tableRef === null || tableRef === void 0 ? void 0 : tableRef.clientWidth,
|
|
1041
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1042
|
+
height: '100%'
|
|
1043
|
+
}
|
|
1044
|
+
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
1045
|
+
style: {
|
|
1046
|
+
width: tableRef === null || tableRef === void 0 ? void 0 : tableRef.clientWidth,
|
|
1047
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1048
|
+
height: '100%'
|
|
1049
|
+
}
|
|
1050
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
1016
1051
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1017
1052
|
className: _types.TableCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
1018
1053
|
style: {
|
|
@@ -1057,7 +1092,11 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1057
1092
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1058
1093
|
className: _types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM,
|
|
1059
1094
|
"data-testid": "sticky-sentinel-bottom"
|
|
1060
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
1095
|
+
}), (0, _platformFeatureFlags.fg)('disable-sticky-scrollbar-for-nested-tables') ? !this.isNestedInTable && /*#__PURE__*/_react.default.createElement("div", {
|
|
1096
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1097
|
+
className: _types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
|
|
1098
|
+
"data-testid": "sticky-scrollbar-sentinel-bottom"
|
|
1099
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
1061
1100
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1062
1101
|
className: _types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
|
|
1063
1102
|
"data-testid": "sticky-scrollbar-sentinel-bottom"
|
|
@@ -115,11 +115,9 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
|
|
|
115
115
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
116
116
|
this.sentinels.top = (_this$wrapper3 = this.wrapper) === null || _this$wrapper3 === void 0 || (_this$wrapper3 = _this$wrapper3.parentElement) === null || _this$wrapper3 === void 0 || (_this$wrapper3 = _this$wrapper3.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper3 === void 0 ? void 0 : _this$wrapper3.item(0);
|
|
117
117
|
[this.sentinels.bottom, this.sentinels.top].forEach(function (el) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
_this2.intersectionObserver.observe(el)
|
|
122
|
-
);
|
|
118
|
+
if (el !== null && _this2.intersectionObserver) {
|
|
119
|
+
_this2.intersectionObserver.observe(el);
|
|
120
|
+
}
|
|
123
121
|
});
|
|
124
122
|
}
|
|
125
123
|
}, {
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -464,7 +464,6 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
|
|
|
464
464
|
},
|
|
465
465
|
zIndex: _editorSharedStyles.akEditorFloatingPanelZIndex + 1,
|
|
466
466
|
// Place the context menu slightly above the others
|
|
467
|
-
forceStaticToolbar: true,
|
|
468
467
|
items: [menu, separator(menu.hidden)].concat((0, _toConsumableArray2.default)(alignmentMenu), [separator(alignmentMenu.length === 0)], (0, _toConsumableArray2.default)(cellItems), (0, _toConsumableArray2.default)(columnSettingsItems), (0, _toConsumableArray2.default)(colorPicker), [
|
|
469
468
|
// TODO: editor controls to move to overflow menu
|
|
470
469
|
{
|
|
@@ -344,6 +344,8 @@ class TableComponent extends React.Component {
|
|
|
344
344
|
} = props;
|
|
345
345
|
this.node = _getNode();
|
|
346
346
|
this.containerWidth = _containerWidth;
|
|
347
|
+
const tablePos = props.getPos();
|
|
348
|
+
this.isNestedInTable = tablePos && fg('nested_table_control_padding_with_css') ? getParentOfTypeCount(props.view.state.schema.nodes.table)(props.view.state.doc.resolve(tablePos)) > 0 : false;
|
|
347
349
|
this.isInitialOverflowSent = false;
|
|
348
350
|
if (!this.updateColGroupFromFullWidthChange) {
|
|
349
351
|
this.updateColGroupFromFullWidthChange = (_options === null || _options === void 0 ? void 0 : _options.isFullWidthModeEnabled) && !(_options !== null && _options !== void 0 && _options.wasFullWidthModeEnabled);
|
|
@@ -423,8 +425,14 @@ class TableComponent extends React.Component {
|
|
|
423
425
|
this.wrapper.addEventListener('scroll', this.handleScrollDebounced, {
|
|
424
426
|
passive: true
|
|
425
427
|
});
|
|
426
|
-
if (
|
|
427
|
-
|
|
428
|
+
if (fg('disable-sticky-scrollbar-for-nested-tables')) {
|
|
429
|
+
if (this.table && !this.isNestedInTable) {
|
|
430
|
+
this.stickyScrollbar = new TableStickyScrollbar(this.wrapper, this.props.view);
|
|
431
|
+
}
|
|
432
|
+
} else {
|
|
433
|
+
if (this.table) {
|
|
434
|
+
this.stickyScrollbar = new TableStickyScrollbar(this.wrapper, this.props.view);
|
|
435
|
+
}
|
|
428
436
|
}
|
|
429
437
|
if (isDragAndDropEnabled) {
|
|
430
438
|
this.dragAndDropCleanupFn = combine(...autoScrollerFactory({
|
|
@@ -900,7 +908,6 @@ class TableComponent extends React.Component {
|
|
|
900
908
|
tablePos = undefined;
|
|
901
909
|
}
|
|
902
910
|
const isNested = isTableNested(view.state, tablePos);
|
|
903
|
-
const isNestedInTable = tablePos && fg('nested_table_control_padding_with_css') ? getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(tablePos)) > 0 : false;
|
|
904
911
|
const topShadowPadding = isDragAndDropEnabled ? 0 : shadowPadding;
|
|
905
912
|
const topOffset = 0;
|
|
906
913
|
const topStickyShadowPosition = this.state.stickyHeader && topOffset + this.state.stickyHeader.padding + topShadowPadding + 2;
|
|
@@ -916,7 +923,7 @@ class TableComponent extends React.Component {
|
|
|
916
923
|
[ClassName.TABLE_STICKY]: this.state.stickyHeader && hasHeaderRow,
|
|
917
924
|
[ClassName.HOVERED_DELETE_BUTTON]: isInDanger,
|
|
918
925
|
[ClassName.TABLE_SELECTED]: isTableSelected(selection !== null && selection !== void 0 ? selection : view.state.selection),
|
|
919
|
-
[ClassName.NESTED_TABLE_WITH_CONTROLS]: tableActive && allowControls && isNestedInTable
|
|
926
|
+
[ClassName.NESTED_TABLE_WITH_CONTROLS]: tableActive && allowControls && this.isNestedInTable
|
|
920
927
|
}),
|
|
921
928
|
editorView: view,
|
|
922
929
|
getPos: getPos,
|
|
@@ -942,7 +949,11 @@ class TableComponent extends React.Component {
|
|
|
942
949
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
943
950
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
944
951
|
"data-testid": "sticky-sentinel-top"
|
|
945
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
952
|
+
}), fg('disable-sticky-scrollbar-for-nested-tables') ? !this.isNestedInTable && /*#__PURE__*/React.createElement("div", {
|
|
953
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
954
|
+
className: ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP,
|
|
955
|
+
"data-testid": "sticky-scrollbar-sentinel-top"
|
|
956
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
946
957
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
947
958
|
className: ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP,
|
|
948
959
|
"data-testid": "sticky-scrollbar-sentinel-top"
|
|
@@ -988,7 +999,31 @@ class TableComponent extends React.Component {
|
|
|
988
999
|
}
|
|
989
1000
|
}
|
|
990
1001
|
}
|
|
991
|
-
}, allowControls && colControls), /*#__PURE__*/React.createElement("div", {
|
|
1002
|
+
}, allowControls && colControls), fg('disable-sticky-scrollbar-for-nested-tables') ? !this.isNestedInTable ? /*#__PURE__*/React.createElement("div", {
|
|
1003
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1004
|
+
className: ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
1005
|
+
style: {
|
|
1006
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1007
|
+
height: "var(--ds-space-250, 20px)",
|
|
1008
|
+
// MAX_BROWSER_SCROLLBAR_HEIGHT
|
|
1009
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1010
|
+
display: 'none',
|
|
1011
|
+
// prevent unwanted scroll during table resize without removing scrollbar container from the dom
|
|
1012
|
+
width: isResizing ? "var(--ds-space-0, 0px)" : '100%'
|
|
1013
|
+
}
|
|
1014
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1015
|
+
style: {
|
|
1016
|
+
width: tableRef === null || tableRef === void 0 ? void 0 : tableRef.clientWidth,
|
|
1017
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1018
|
+
height: '100%'
|
|
1019
|
+
}
|
|
1020
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
1021
|
+
style: {
|
|
1022
|
+
width: tableRef === null || tableRef === void 0 ? void 0 : tableRef.clientWidth,
|
|
1023
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1024
|
+
height: '100%'
|
|
1025
|
+
}
|
|
1026
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
992
1027
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
993
1028
|
className: ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
994
1029
|
style: {
|
|
@@ -1033,7 +1068,11 @@ class TableComponent extends React.Component {
|
|
|
1033
1068
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1034
1069
|
className: ClassName.TABLE_STICKY_SENTINEL_BOTTOM,
|
|
1035
1070
|
"data-testid": "sticky-sentinel-bottom"
|
|
1036
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
1071
|
+
}), fg('disable-sticky-scrollbar-for-nested-tables') ? !this.isNestedInTable && /*#__PURE__*/React.createElement("div", {
|
|
1072
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1073
|
+
className: ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
|
|
1074
|
+
"data-testid": "sticky-scrollbar-sentinel-bottom"
|
|
1075
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
1037
1076
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1038
1077
|
className: ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
|
|
1039
1078
|
"data-testid": "sticky-scrollbar-sentinel-bottom"
|
|
@@ -92,10 +92,11 @@ export class TableStickyScrollbar {
|
|
|
92
92
|
// Ignored via go/ees005
|
|
93
93
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
94
94
|
this.sentinels.top = (_this$wrapper3 = this.wrapper) === null || _this$wrapper3 === void 0 ? void 0 : (_this$wrapper3$parent = _this$wrapper3.parentElement) === null || _this$wrapper3$parent === void 0 ? void 0 : (_this$wrapper3$parent2 = _this$wrapper3$parent.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper3$parent2 === void 0 ? void 0 : _this$wrapper3$parent2.item(0);
|
|
95
|
-
[this.sentinels.bottom, this.sentinels.top].forEach(el =>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
[this.sentinels.bottom, this.sentinels.top].forEach(el => {
|
|
96
|
+
if (el !== null && this.intersectionObserver) {
|
|
97
|
+
this.intersectionObserver.observe(el);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
99
100
|
}
|
|
100
101
|
deleteIntersectionObserver() {
|
|
101
102
|
if (this.intersectionObserver) {
|
|
@@ -436,7 +436,6 @@ export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAP
|
|
|
436
436
|
},
|
|
437
437
|
zIndex: akEditorFloatingPanelZIndex + 1,
|
|
438
438
|
// Place the context menu slightly above the others
|
|
439
|
-
forceStaticToolbar: true,
|
|
440
439
|
items: [menu, separator(menu.hidden), ...alignmentMenu, separator(alignmentMenu.length === 0), ...cellItems, ...columnSettingsItems, ...colorPicker,
|
|
441
440
|
// TODO: editor controls to move to overflow menu
|
|
442
441
|
{
|
|
@@ -338,6 +338,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
338
338
|
_getNode = props.getNode;
|
|
339
339
|
_this.node = _getNode();
|
|
340
340
|
_this.containerWidth = _containerWidth;
|
|
341
|
+
var tablePos = props.getPos();
|
|
342
|
+
_this.isNestedInTable = tablePos && fg('nested_table_control_padding_with_css') ? getParentOfTypeCount(props.view.state.schema.nodes.table)(props.view.state.doc.resolve(tablePos)) > 0 : false;
|
|
341
343
|
_this.isInitialOverflowSent = false;
|
|
342
344
|
if (!_this.updateColGroupFromFullWidthChange) {
|
|
343
345
|
_this.updateColGroupFromFullWidthChange = (_options === null || _options === void 0 ? void 0 : _options.isFullWidthModeEnabled) && !(_options !== null && _options !== void 0 && _options.wasFullWidthModeEnabled);
|
|
@@ -443,8 +445,14 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
443
445
|
this.wrapper.addEventListener('scroll', this.handleScrollDebounced, {
|
|
444
446
|
passive: true
|
|
445
447
|
});
|
|
446
|
-
if (
|
|
447
|
-
|
|
448
|
+
if (fg('disable-sticky-scrollbar-for-nested-tables')) {
|
|
449
|
+
if (this.table && !this.isNestedInTable) {
|
|
450
|
+
this.stickyScrollbar = new TableStickyScrollbar(this.wrapper, this.props.view);
|
|
451
|
+
}
|
|
452
|
+
} else {
|
|
453
|
+
if (this.table) {
|
|
454
|
+
this.stickyScrollbar = new TableStickyScrollbar(this.wrapper, this.props.view);
|
|
455
|
+
}
|
|
448
456
|
}
|
|
449
457
|
if (isDragAndDropEnabled) {
|
|
450
458
|
this.dragAndDropCleanupFn = combine.apply(void 0, _toConsumableArray(autoScrollerFactory({
|
|
@@ -924,7 +932,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
924
932
|
tablePos = undefined;
|
|
925
933
|
}
|
|
926
934
|
var isNested = isTableNested(view.state, tablePos);
|
|
927
|
-
var isNestedInTable = tablePos && fg('nested_table_control_padding_with_css') ? getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(tablePos)) > 0 : false;
|
|
928
935
|
var topShadowPadding = isDragAndDropEnabled ? 0 : shadowPadding;
|
|
929
936
|
var topOffset = 0;
|
|
930
937
|
var topStickyShadowPosition = this.state.stickyHeader && topOffset + this.state.stickyHeader.padding + topShadowPadding + 2;
|
|
@@ -935,7 +942,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
935
942
|
return /*#__PURE__*/React.createElement(TableContainer
|
|
936
943
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
937
944
|
, {
|
|
938
|
-
className: classnames(ClassName.TABLE_CONTAINER, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ClassName.WITH_CONTROLS, allowControls && tableActive), ClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), ClassName.HOVERED_DELETE_BUTTON, isInDanger), ClassName.TABLE_SELECTED, isTableSelected(selection !== null && selection !== void 0 ? selection : view.state.selection)), ClassName.NESTED_TABLE_WITH_CONTROLS, tableActive && allowControls && isNestedInTable)),
|
|
945
|
+
className: classnames(ClassName.TABLE_CONTAINER, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ClassName.WITH_CONTROLS, allowControls && tableActive), ClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), ClassName.HOVERED_DELETE_BUTTON, isInDanger), ClassName.TABLE_SELECTED, isTableSelected(selection !== null && selection !== void 0 ? selection : view.state.selection)), ClassName.NESTED_TABLE_WITH_CONTROLS, tableActive && allowControls && this.isNestedInTable)),
|
|
939
946
|
editorView: view,
|
|
940
947
|
getPos: getPos,
|
|
941
948
|
node: node
|
|
@@ -960,7 +967,11 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
960
967
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
961
968
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
962
969
|
"data-testid": "sticky-sentinel-top"
|
|
963
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
970
|
+
}), fg('disable-sticky-scrollbar-for-nested-tables') ? !this.isNestedInTable && /*#__PURE__*/React.createElement("div", {
|
|
971
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
972
|
+
className: ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP,
|
|
973
|
+
"data-testid": "sticky-scrollbar-sentinel-top"
|
|
974
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
964
975
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
965
976
|
className: ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP,
|
|
966
977
|
"data-testid": "sticky-scrollbar-sentinel-top"
|
|
@@ -1006,7 +1017,31 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1006
1017
|
}
|
|
1007
1018
|
}
|
|
1008
1019
|
}
|
|
1009
|
-
}, allowControls && colControls), /*#__PURE__*/React.createElement("div", {
|
|
1020
|
+
}, allowControls && colControls), fg('disable-sticky-scrollbar-for-nested-tables') ? !this.isNestedInTable ? /*#__PURE__*/React.createElement("div", {
|
|
1021
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1022
|
+
className: ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
1023
|
+
style: {
|
|
1024
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1025
|
+
height: "var(--ds-space-250, 20px)",
|
|
1026
|
+
// MAX_BROWSER_SCROLLBAR_HEIGHT
|
|
1027
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1028
|
+
display: 'none',
|
|
1029
|
+
// prevent unwanted scroll during table resize without removing scrollbar container from the dom
|
|
1030
|
+
width: isResizing ? "var(--ds-space-0, 0px)" : '100%'
|
|
1031
|
+
}
|
|
1032
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1033
|
+
style: {
|
|
1034
|
+
width: tableRef === null || tableRef === void 0 ? void 0 : tableRef.clientWidth,
|
|
1035
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1036
|
+
height: '100%'
|
|
1037
|
+
}
|
|
1038
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
1039
|
+
style: {
|
|
1040
|
+
width: tableRef === null || tableRef === void 0 ? void 0 : tableRef.clientWidth,
|
|
1041
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1042
|
+
height: '100%'
|
|
1043
|
+
}
|
|
1044
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
1010
1045
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1011
1046
|
className: ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
1012
1047
|
style: {
|
|
@@ -1051,7 +1086,11 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1051
1086
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1052
1087
|
className: ClassName.TABLE_STICKY_SENTINEL_BOTTOM,
|
|
1053
1088
|
"data-testid": "sticky-sentinel-bottom"
|
|
1054
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
1089
|
+
}), fg('disable-sticky-scrollbar-for-nested-tables') ? !this.isNestedInTable && /*#__PURE__*/React.createElement("div", {
|
|
1090
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1091
|
+
className: ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
|
|
1092
|
+
"data-testid": "sticky-scrollbar-sentinel-bottom"
|
|
1093
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
1055
1094
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1056
1095
|
className: ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
|
|
1057
1096
|
"data-testid": "sticky-scrollbar-sentinel-bottom"
|
|
@@ -108,11 +108,9 @@ export var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
|
108
108
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
109
109
|
this.sentinels.top = (_this$wrapper3 = this.wrapper) === null || _this$wrapper3 === void 0 || (_this$wrapper3 = _this$wrapper3.parentElement) === null || _this$wrapper3 === void 0 || (_this$wrapper3 = _this$wrapper3.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper3 === void 0 ? void 0 : _this$wrapper3.item(0);
|
|
110
110
|
[this.sentinels.bottom, this.sentinels.top].forEach(function (el) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
_this2.intersectionObserver.observe(el)
|
|
115
|
-
);
|
|
111
|
+
if (el !== null && _this2.intersectionObserver) {
|
|
112
|
+
_this2.intersectionObserver.observe(el);
|
|
113
|
+
}
|
|
116
114
|
});
|
|
117
115
|
}
|
|
118
116
|
}, {
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -456,7 +456,6 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
456
456
|
},
|
|
457
457
|
zIndex: akEditorFloatingPanelZIndex + 1,
|
|
458
458
|
// Place the context menu slightly above the others
|
|
459
|
-
forceStaticToolbar: true,
|
|
460
459
|
items: [menu, separator(menu.hidden)].concat(_toConsumableArray(alignmentMenu), [separator(alignmentMenu.length === 0)], _toConsumableArray(cellItems), _toConsumableArray(columnSettingsItems), _toConsumableArray(colorPicker), [
|
|
461
460
|
// TODO: editor controls to move to overflow menu
|
|
462
461
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "10.1
|
|
3
|
+
"version": "10.2.1",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
"sideEffects":
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"*.compiled.css"
|
|
24
|
+
],
|
|
23
25
|
"atlaskit:src": "src/index.ts",
|
|
24
26
|
"atlassian": {
|
|
25
27
|
"team": "Editor: Jenga",
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
"@atlaskit/adf-schema": "^47.2.1",
|
|
31
33
|
"@atlaskit/button": "^21.1.0",
|
|
32
34
|
"@atlaskit/custom-steps": "^0.10.0",
|
|
33
|
-
"@atlaskit/editor-common": "^100.
|
|
35
|
+
"@atlaskit/editor-common": "^100.4.0",
|
|
34
36
|
"@atlaskit/editor-palette": "2.0.0",
|
|
35
37
|
"@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
|
|
36
38
|
"@atlaskit/editor-plugin-analytics": "^2.0.0",
|
|
@@ -177,6 +179,9 @@
|
|
|
177
179
|
"platform_editor_nested_tables_number_column_fixes": {
|
|
178
180
|
"type": "boolean"
|
|
179
181
|
},
|
|
182
|
+
"disable-sticky-scrollbar-for-nested-tables": {
|
|
183
|
+
"type": "boolean"
|
|
184
|
+
},
|
|
180
185
|
"platform_editor_nested_tables_sticky_header_bug": {
|
|
181
186
|
"type": "boolean"
|
|
182
187
|
},
|
package/plugin-key/package.json
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
"main": "../dist/cjs/pm-plugins/plugin-key.js",
|
|
4
4
|
"module": "../dist/esm/pm-plugins/plugin-key.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/pm-plugins/plugin-key.js",
|
|
6
|
-
"sideEffects":
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
7
9
|
"types": "../dist/types/pm-plugins/plugin-key.d.ts",
|
|
8
10
|
"typesVersions": {
|
|
9
11
|
">=4.5 <5.4": {
|
|
@@ -170,6 +170,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
170
170
|
private stickyScrollbar?: TableStickyScrollbar;
|
|
171
171
|
|
|
172
172
|
private isInitialOverflowSent: boolean;
|
|
173
|
+
private isNestedInTable: boolean;
|
|
173
174
|
private initialOverflowCaptureTimerId?: ReturnType<typeof setTimeout>;
|
|
174
175
|
private resizeObserver?: ResizeObserver;
|
|
175
176
|
|
|
@@ -186,6 +187,15 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
186
187
|
this.node = getNode();
|
|
187
188
|
this.containerWidth = containerWidth;
|
|
188
189
|
|
|
190
|
+
const tablePos = props.getPos();
|
|
191
|
+
|
|
192
|
+
this.isNestedInTable =
|
|
193
|
+
tablePos && fg('nested_table_control_padding_with_css')
|
|
194
|
+
? getParentOfTypeCount(props.view.state.schema.nodes.table)(
|
|
195
|
+
props.view.state.doc.resolve(tablePos),
|
|
196
|
+
) > 0
|
|
197
|
+
: false;
|
|
198
|
+
|
|
189
199
|
this.isInitialOverflowSent = false;
|
|
190
200
|
|
|
191
201
|
if (!this.updateColGroupFromFullWidthChange) {
|
|
@@ -293,8 +303,14 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
293
303
|
passive: true,
|
|
294
304
|
});
|
|
295
305
|
|
|
296
|
-
if (
|
|
297
|
-
|
|
306
|
+
if (fg('disable-sticky-scrollbar-for-nested-tables')) {
|
|
307
|
+
if (this.table && !this.isNestedInTable) {
|
|
308
|
+
this.stickyScrollbar = new TableStickyScrollbar(this.wrapper, this.props.view);
|
|
309
|
+
}
|
|
310
|
+
} else {
|
|
311
|
+
if (this.table) {
|
|
312
|
+
this.stickyScrollbar = new TableStickyScrollbar(this.wrapper, this.props.view);
|
|
313
|
+
}
|
|
298
314
|
}
|
|
299
315
|
|
|
300
316
|
if (isDragAndDropEnabled) {
|
|
@@ -909,10 +925,6 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
909
925
|
}
|
|
910
926
|
|
|
911
927
|
const isNested = isTableNested(view.state, tablePos);
|
|
912
|
-
const isNestedInTable =
|
|
913
|
-
tablePos && fg('nested_table_control_padding_with_css')
|
|
914
|
-
? getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(tablePos)) > 0
|
|
915
|
-
: false;
|
|
916
928
|
|
|
917
929
|
const topShadowPadding = isDragAndDropEnabled ? 0 : shadowPadding;
|
|
918
930
|
const topOffset = 0;
|
|
@@ -934,7 +946,8 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
934
946
|
[ClassName.TABLE_STICKY]: this.state.stickyHeader && hasHeaderRow,
|
|
935
947
|
[ClassName.HOVERED_DELETE_BUTTON]: isInDanger,
|
|
936
948
|
[ClassName.TABLE_SELECTED]: isTableSelected(selection ?? view.state.selection),
|
|
937
|
-
[ClassName.NESTED_TABLE_WITH_CONTROLS]:
|
|
949
|
+
[ClassName.NESTED_TABLE_WITH_CONTROLS]:
|
|
950
|
+
tableActive && allowControls && this.isNestedInTable,
|
|
938
951
|
})}
|
|
939
952
|
editorView={view}
|
|
940
953
|
getPos={getPos}
|
|
@@ -961,11 +974,22 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
961
974
|
className={ClassName.TABLE_STICKY_SENTINEL_TOP}
|
|
962
975
|
data-testid="sticky-sentinel-top"
|
|
963
976
|
/>
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
977
|
+
{fg('disable-sticky-scrollbar-for-nested-tables') ? (
|
|
978
|
+
!this.isNestedInTable && (
|
|
979
|
+
<div
|
|
980
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
981
|
+
className={ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP}
|
|
982
|
+
data-testid="sticky-scrollbar-sentinel-top"
|
|
983
|
+
/>
|
|
984
|
+
)
|
|
985
|
+
) : (
|
|
986
|
+
<div
|
|
987
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
988
|
+
className={ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP}
|
|
989
|
+
data-testid="sticky-scrollbar-sentinel-top"
|
|
990
|
+
/>
|
|
991
|
+
)}
|
|
992
|
+
|
|
969
993
|
{allowControls && rowControls}
|
|
970
994
|
{isDragAndDropEnabled && (
|
|
971
995
|
<ExternalDropTargets
|
|
@@ -1019,26 +1043,59 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
1019
1043
|
>
|
|
1020
1044
|
{allowControls && colControls}
|
|
1021
1045
|
</div>
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1046
|
+
{fg('disable-sticky-scrollbar-for-nested-tables') ? (
|
|
1047
|
+
!this.isNestedInTable ? (
|
|
1048
|
+
<div
|
|
1049
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1050
|
+
className={ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER}
|
|
1051
|
+
style={{
|
|
1052
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1053
|
+
height: token('space.250', '20px'), // MAX_BROWSER_SCROLLBAR_HEIGHT
|
|
1054
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1055
|
+
display: 'none',
|
|
1056
|
+
// prevent unwanted scroll during table resize without removing scrollbar container from the dom
|
|
1057
|
+
width: isResizing ? token('space.0', '0px') : '100%',
|
|
1058
|
+
}}
|
|
1059
|
+
>
|
|
1060
|
+
<div
|
|
1061
|
+
style={{
|
|
1062
|
+
width: tableRef?.clientWidth,
|
|
1063
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1064
|
+
height: '100%',
|
|
1065
|
+
}}
|
|
1066
|
+
></div>
|
|
1067
|
+
</div>
|
|
1068
|
+
) : (
|
|
1069
|
+
<div
|
|
1070
|
+
style={{
|
|
1071
|
+
width: tableRef?.clientWidth,
|
|
1072
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1073
|
+
height: '100%',
|
|
1074
|
+
}}
|
|
1075
|
+
></div>
|
|
1076
|
+
)
|
|
1077
|
+
) : (
|
|
1034
1078
|
<div
|
|
1079
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1080
|
+
className={ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER}
|
|
1035
1081
|
style={{
|
|
1036
|
-
width: tableRef?.clientWidth,
|
|
1037
1082
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1038
|
-
height: '
|
|
1083
|
+
height: token('space.250', '20px'), // MAX_BROWSER_SCROLLBAR_HEIGHT
|
|
1084
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1085
|
+
display: 'none',
|
|
1086
|
+
// prevent unwanted scroll during table resize without removing scrollbar container from the dom
|
|
1087
|
+
width: isResizing ? token('space.0', '0px') : '100%',
|
|
1039
1088
|
}}
|
|
1040
|
-
|
|
1041
|
-
|
|
1089
|
+
>
|
|
1090
|
+
<div
|
|
1091
|
+
style={{
|
|
1092
|
+
width: tableRef?.clientWidth,
|
|
1093
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1094
|
+
height: '100%',
|
|
1095
|
+
}}
|
|
1096
|
+
></div>
|
|
1097
|
+
</div>
|
|
1098
|
+
)}
|
|
1042
1099
|
<div
|
|
1043
1100
|
contentEditable={false}
|
|
1044
1101
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -1070,16 +1127,27 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
1070
1127
|
/>
|
|
1071
1128
|
</div>
|
|
1072
1129
|
)}
|
|
1130
|
+
|
|
1073
1131
|
<div
|
|
1074
1132
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1075
1133
|
className={ClassName.TABLE_STICKY_SENTINEL_BOTTOM}
|
|
1076
1134
|
data-testid="sticky-sentinel-bottom"
|
|
1077
1135
|
/>
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1136
|
+
{fg('disable-sticky-scrollbar-for-nested-tables') ? (
|
|
1137
|
+
!this.isNestedInTable && (
|
|
1138
|
+
<div
|
|
1139
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1140
|
+
className={ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM}
|
|
1141
|
+
data-testid="sticky-scrollbar-sentinel-bottom"
|
|
1142
|
+
/>
|
|
1143
|
+
)
|
|
1144
|
+
) : (
|
|
1145
|
+
<div
|
|
1146
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1147
|
+
className={ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM}
|
|
1148
|
+
data-testid="sticky-scrollbar-sentinel-bottom"
|
|
1149
|
+
/>
|
|
1150
|
+
)}
|
|
1083
1151
|
</TableContainer>
|
|
1084
1152
|
);
|
|
1085
1153
|
}
|
|
@@ -127,11 +127,11 @@ export class TableStickyScrollbar {
|
|
|
127
127
|
?.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)
|
|
128
128
|
?.item(0) as HTMLElement;
|
|
129
129
|
|
|
130
|
-
[this.sentinels.bottom, this.sentinels.top].forEach((el) =>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
);
|
|
130
|
+
[this.sentinels.bottom, this.sentinels.top].forEach((el) => {
|
|
131
|
+
if (el !== null && this.intersectionObserver) {
|
|
132
|
+
this.intersectionObserver.observe(el);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
private deleteIntersectionObserver() {
|
package/src/ui/common-styles.ts
CHANGED
|
@@ -388,8 +388,7 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
388
388
|
border-right: 0 none;
|
|
389
389
|
/* top set by NumberColumn component */
|
|
390
390
|
}
|
|
391
|
-
`
|
|
392
|
-
}
|
|
391
|
+
`}
|
|
393
392
|
|
|
394
393
|
.${ClassName.TABLE_STICKY} .${ClassName.CORNER_CONTROLS}.sticky {
|
|
395
394
|
position: fixed !important;
|
|
@@ -541,8 +540,7 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
541
540
|
.${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
|
|
542
541
|
margin-top: ${tableControlsSpacing + 2}px;
|
|
543
542
|
}
|
|
544
|
-
`
|
|
545
|
-
}
|
|
543
|
+
`}
|
|
546
544
|
|
|
547
545
|
.${ClassName.CORNER_CONTROLS}.sticky {
|
|
548
546
|
border-top: ${tableControlsSpacing - tableToolbarSize + 2}px solid
|
|
@@ -974,8 +972,7 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
974
972
|
left: -1px;
|
|
975
973
|
}
|
|
976
974
|
}
|
|
977
|
-
`
|
|
978
|
-
}
|
|
975
|
+
`}
|
|
979
976
|
|
|
980
977
|
.${ClassName.WITH_CONTROLS} {
|
|
981
978
|
.${ClassName.CORNER_CONTROLS}, .${ClassName.ROW_CONTROLS} {
|
package/src/ui/toolbar.tsx
CHANGED
|
@@ -639,7 +639,6 @@ export const getToolbarConfig =
|
|
|
639
639
|
offset: [0, 18],
|
|
640
640
|
absoluteOffset: { top: -6 },
|
|
641
641
|
zIndex: akEditorFloatingPanelZIndex + 1, // Place the context menu slightly above the others
|
|
642
|
-
forceStaticToolbar: true,
|
|
643
642
|
items: [
|
|
644
643
|
menu,
|
|
645
644
|
separator(menu.hidden),
|
package/types/package.json
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
"main": "../dist/cjs/types/index.js",
|
|
4
4
|
"module": "../dist/esm/types/index.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/types/index.js",
|
|
6
|
-
"sideEffects":
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
7
9
|
"types": "../dist/types/types/index.d.ts",
|
|
8
10
|
"typesVersions": {
|
|
9
11
|
">=4.5 <5.4": {
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
"main": "../../dist/cjs/ui/common-styles.js",
|
|
4
4
|
"module": "../../dist/esm/ui/common-styles.js",
|
|
5
5
|
"module:es2019": "../../dist/es2019/ui/common-styles.js",
|
|
6
|
-
"sideEffects":
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
7
9
|
"types": "../../dist/types/ui/common-styles.d.ts",
|
|
8
10
|
"typesVersions": {
|
|
9
11
|
">=4.5 <5.4": {
|
package/ui/consts/package.json
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
"main": "../../dist/cjs/ui/consts.js",
|
|
4
4
|
"module": "../../dist/esm/ui/consts.js",
|
|
5
5
|
"module:es2019": "../../dist/es2019/ui/consts.js",
|
|
6
|
-
"sideEffects":
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
7
9
|
"types": "../../dist/types/ui/consts.d.ts",
|
|
8
10
|
"typesVersions": {
|
|
9
11
|
">=4.5 <5.4": {
|