@atlaskit/editor-plugin-table 15.4.22 → 15.4.23
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 +7 -0
- package/dist/cjs/nodeviews/TableComponent.js +2 -1
- package/dist/cjs/nodeviews/table-node-views.js +1 -1
- package/dist/cjs/pm-plugins/main.js +2 -1
- package/dist/cjs/ui/ContentComponent.js +2 -1
- package/dist/cjs/ui/FloatingContextualButton/index.js +4 -1
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +3 -2
- package/dist/es2019/nodeviews/TableComponent.js +2 -1
- package/dist/es2019/nodeviews/table-node-views.js +1 -1
- package/dist/es2019/pm-plugins/main.js +2 -1
- package/dist/es2019/ui/ContentComponent.js +2 -1
- package/dist/es2019/ui/FloatingContextualButton/index.js +4 -1
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +3 -2
- package/dist/esm/nodeviews/TableComponent.js +2 -1
- package/dist/esm/nodeviews/table-node-views.js +1 -1
- package/dist/esm/pm-plugins/main.js +2 -1
- package/dist/esm/ui/ContentComponent.js +2 -1
- package/dist/esm/ui/FloatingContextualButton/index.js +4 -1
- package/dist/esm/ui/TableFloatingColumnControls/index.js +3 -2
- package/dist/types/nodeviews/table-node-views.d.ts +1 -0
- package/dist/types/ui/FloatingContextualButton/index.d.ts +1 -0
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/table-node-views.d.ts +1 -0
- package/dist/types-ts4.5/ui/FloatingContextualButton/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 15.4.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`21089bb0ca0d2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/21089bb0ca0d2) -
|
|
8
|
+
Only enable new table sticky header if drag and drop flag enabled
|
|
9
|
+
|
|
3
10
|
## 15.4.22
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -857,7 +857,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
857
857
|
},
|
|
858
858
|
tableWrapperHeight: this.state.tableWrapperHeight,
|
|
859
859
|
api: pluginInjectionApi,
|
|
860
|
-
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor
|
|
860
|
+
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
861
|
+
isDragAndDropEnabled: isDragAndDropEnabled
|
|
861
862
|
}) : null;
|
|
862
863
|
|
|
863
864
|
/**
|
|
@@ -32,7 +32,7 @@ var tableHeaderView = exports.tableHeaderView = function tableHeaderView(options
|
|
|
32
32
|
};
|
|
33
33
|
var tableRowView = exports.tableRowView = function tableRowView(options) {
|
|
34
34
|
return function (node, view, getPos) {
|
|
35
|
-
if ((0, _anchor.isAnchorSupported)() && (0, _expValEquals.expValEquals)('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
35
|
+
if ((0, _anchor.isAnchorSupported)() && options.isDragAndDropEnabled && (0, _expValEquals.expValEquals)('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
36
36
|
return new _TableRowNativeStickyWithFallback.default(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi);
|
|
37
37
|
} else {
|
|
38
38
|
return new _TableRow.default(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi);
|
|
@@ -76,7 +76,8 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
76
76
|
}),
|
|
77
77
|
tableRow: (0, _tableNodeViews.tableRowView)({
|
|
78
78
|
eventDispatcher: eventDispatcher,
|
|
79
|
-
pluginInjectionApi: pluginInjectionApi
|
|
79
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
80
|
+
isDragAndDropEnabled: dragAndDropEnabled
|
|
80
81
|
}),
|
|
81
82
|
tableCell: (0, _tableNodeViews.tableCellView)({
|
|
82
83
|
eventDispatcher: eventDispatcher,
|
|
@@ -112,7 +112,8 @@ var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
|
112
112
|
isContextualMenuOpen: isContextualMenuOpen,
|
|
113
113
|
stickyHeader: stickyHeader,
|
|
114
114
|
tableWrapper: tableWrapperTarget,
|
|
115
|
-
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
115
|
+
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
116
|
+
isDragAndDropEnabled: isDragAndDropEnabled
|
|
116
117
|
}), allowControls && /*#__PURE__*/_react.default.createElement(_FloatingInsertButton.default, {
|
|
117
118
|
tableNode: tableNode,
|
|
118
119
|
tableRef: tableRef,
|
|
@@ -51,6 +51,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
|
|
|
51
51
|
tableWrapper = props.tableWrapper,
|
|
52
52
|
targetCellPosition = props.targetCellPosition,
|
|
53
53
|
isCellMenuOpenByKeyboard = props.isCellMenuOpenByKeyboard,
|
|
54
|
+
isDragAndDropEnabled = props.isDragAndDropEnabled,
|
|
54
55
|
formatMessage = props.intl.formatMessage; // : Props & WrappedComponentProps
|
|
55
56
|
|
|
56
57
|
var handleClick = function handleClick() {
|
|
@@ -103,7 +104,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
|
|
|
103
104
|
}));
|
|
104
105
|
var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
|
|
105
106
|
var parentStickyNative = targetCellRef.parentElement && targetCellRef.parentElement.classList.contains(_types.TableCssClassName.NATIVE_STICKY);
|
|
106
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && (0, _anchor.isAnchorSupported)() && targetCellRef.nodeName === 'TH' && parentStickyNative) {
|
|
107
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && (0, _anchor.isAnchorSupported)() && targetCellRef.nodeName === 'TH' && parentStickyNative && isDragAndDropEnabled) {
|
|
107
108
|
var _targetCellRef$datase, _targetCellRef$parent, _targetCellRef$parent2;
|
|
108
109
|
var anchorName = (_targetCellRef$datase = targetCellRef.dataset.nodeAnchor) !== null && _targetCellRef$datase !== void 0 ? _targetCellRef$datase : '';
|
|
109
110
|
var rowAnchorName = (_targetCellRef$parent = (_targetCellRef$parent2 = targetCellRef.parentElement) === null || _targetCellRef$parent2 === void 0 ? void 0 : _targetCellRef$parent2.dataset.nodeAnchor) !== null && _targetCellRef$parent !== void 0 ? _targetCellRef$parent : '';
|
|
@@ -116,6 +117,8 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
|
|
|
116
117
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
117
118
|
positionAnchor: anchorName
|
|
118
119
|
} // need to do this because CSSProperties doesn't have positionAnchor property even though it's a valid CSS property
|
|
120
|
+
,
|
|
121
|
+
"data-testid": "table-cell-options-anchor-wrapper"
|
|
119
122
|
}, button);
|
|
120
123
|
}
|
|
121
124
|
if (stickyHeader && parentSticky && tableWrapper) {
|
|
@@ -35,7 +35,8 @@ var TableFloatingColumnControls = function TableFloatingColumnControls(_ref) {
|
|
|
35
35
|
getScrollOffset = _ref.getScrollOffset,
|
|
36
36
|
tableWrapperHeight = _ref.tableWrapperHeight,
|
|
37
37
|
api = _ref.api,
|
|
38
|
-
isChromelessEditor = _ref.isChromelessEditor
|
|
38
|
+
isChromelessEditor = _ref.isChromelessEditor,
|
|
39
|
+
isDragAndDropEnabled = _ref.isDragAndDropEnabled;
|
|
39
40
|
var _useState = (0, _react.useState)(false),
|
|
40
41
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
41
42
|
isDragging = _useState2[0],
|
|
@@ -83,7 +84,7 @@ var TableFloatingColumnControls = function TableFloatingColumnControls(_ref) {
|
|
|
83
84
|
containerRef === null || containerRef === void 0 || (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 || _containerRef$current2.style.removeProperty('top');
|
|
84
85
|
}
|
|
85
86
|
var anchorStyles = {};
|
|
86
|
-
if ((0, _anchor.isAnchorSupported)() && (0, _expValEquals.expValEquals)('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
87
|
+
if ((0, _anchor.isAnchorSupported)() && isDragAndDropEnabled && (0, _expValEquals.expValEquals)('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
87
88
|
var _tableRef$querySelect;
|
|
88
89
|
// cast here is due to CSSProperties missing valid positionAnchor property
|
|
89
90
|
anchorStyles = {
|
|
@@ -816,7 +816,8 @@ class TableComponent extends React.Component {
|
|
|
816
816
|
},
|
|
817
817
|
tableWrapperHeight: this.state.tableWrapperHeight,
|
|
818
818
|
api: pluginInjectionApi,
|
|
819
|
-
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor
|
|
819
|
+
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
820
|
+
isDragAndDropEnabled: isDragAndDropEnabled
|
|
820
821
|
}) : null;
|
|
821
822
|
|
|
822
823
|
/**
|
|
@@ -24,7 +24,7 @@ export const tableHeaderView = options => {
|
|
|
24
24
|
};
|
|
25
25
|
export const tableRowView = options => {
|
|
26
26
|
return (node, view, getPos) => {
|
|
27
|
-
if (isAnchorSupported() && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
27
|
+
if (isAnchorSupported() && options.isDragAndDropEnabled && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
28
28
|
return new TableRowNativeStickyWithFallback(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi);
|
|
29
29
|
} else {
|
|
30
30
|
return new TableRow(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi);
|
|
@@ -67,7 +67,8 @@ export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI
|
|
|
67
67
|
}),
|
|
68
68
|
tableRow: tableRowView({
|
|
69
69
|
eventDispatcher,
|
|
70
|
-
pluginInjectionApi
|
|
70
|
+
pluginInjectionApi,
|
|
71
|
+
isDragAndDropEnabled: dragAndDropEnabled
|
|
71
72
|
}),
|
|
72
73
|
tableCell: tableCellView({
|
|
73
74
|
eventDispatcher,
|
|
@@ -107,7 +107,8 @@ const ContentComponentInternal = ({
|
|
|
107
107
|
isContextualMenuOpen: isContextualMenuOpen,
|
|
108
108
|
stickyHeader: stickyHeader,
|
|
109
109
|
tableWrapper: tableWrapperTarget,
|
|
110
|
-
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
110
|
+
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
111
|
+
isDragAndDropEnabled: isDragAndDropEnabled
|
|
111
112
|
}), allowControls && /*#__PURE__*/React.createElement(FloatingInsertButton, {
|
|
112
113
|
tableNode: tableNode,
|
|
113
114
|
tableRef: tableRef,
|
|
@@ -42,6 +42,7 @@ const FloatingContextualButtonInner = /*#__PURE__*/React.memo(props => {
|
|
|
42
42
|
tableWrapper,
|
|
43
43
|
targetCellPosition,
|
|
44
44
|
isCellMenuOpenByKeyboard,
|
|
45
|
+
isDragAndDropEnabled,
|
|
45
46
|
intl: {
|
|
46
47
|
formatMessage
|
|
47
48
|
}
|
|
@@ -101,7 +102,7 @@ const FloatingContextualButtonInner = /*#__PURE__*/React.memo(props => {
|
|
|
101
102
|
}));
|
|
102
103
|
const parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
|
|
103
104
|
const parentStickyNative = targetCellRef.parentElement && targetCellRef.parentElement.classList.contains(ClassName.NATIVE_STICKY);
|
|
104
|
-
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && isAnchorSupported() && targetCellRef.nodeName === 'TH' && parentStickyNative) {
|
|
105
|
+
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && isAnchorSupported() && targetCellRef.nodeName === 'TH' && parentStickyNative && isDragAndDropEnabled) {
|
|
105
106
|
var _targetCellRef$datase, _targetCellRef$parent, _targetCellRef$parent2;
|
|
106
107
|
const anchorName = (_targetCellRef$datase = targetCellRef.dataset.nodeAnchor) !== null && _targetCellRef$datase !== void 0 ? _targetCellRef$datase : '';
|
|
107
108
|
const rowAnchorName = (_targetCellRef$parent = (_targetCellRef$parent2 = targetCellRef.parentElement) === null || _targetCellRef$parent2 === void 0 ? void 0 : _targetCellRef$parent2.dataset.nodeAnchor) !== null && _targetCellRef$parent !== void 0 ? _targetCellRef$parent : '';
|
|
@@ -114,6 +115,8 @@ const FloatingContextualButtonInner = /*#__PURE__*/React.memo(props => {
|
|
|
114
115
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
115
116
|
positionAnchor: anchorName
|
|
116
117
|
} // need to do this because CSSProperties doesn't have positionAnchor property even though it's a valid CSS property
|
|
118
|
+
,
|
|
119
|
+
"data-testid": "table-cell-options-anchor-wrapper"
|
|
117
120
|
}, button);
|
|
118
121
|
}
|
|
119
122
|
if (stickyHeader && parentSticky && tableWrapper) {
|
|
@@ -25,7 +25,8 @@ const TableFloatingColumnControls = ({
|
|
|
25
25
|
getScrollOffset,
|
|
26
26
|
tableWrapperHeight,
|
|
27
27
|
api,
|
|
28
|
-
isChromelessEditor
|
|
28
|
+
isChromelessEditor,
|
|
29
|
+
isDragAndDropEnabled
|
|
29
30
|
}) => {
|
|
30
31
|
const [isDragging, setIsDragging] = useState(false);
|
|
31
32
|
const containerRef = useRef(null);
|
|
@@ -73,7 +74,7 @@ const TableFloatingColumnControls = ({
|
|
|
73
74
|
containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.style.removeProperty('top');
|
|
74
75
|
}
|
|
75
76
|
let anchorStyles = {};
|
|
76
|
-
if (isAnchorSupported() && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
77
|
+
if (isAnchorSupported() && isDragAndDropEnabled && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
77
78
|
var _tableRef$querySelect;
|
|
78
79
|
// cast here is due to CSSProperties missing valid positionAnchor property
|
|
79
80
|
anchorStyles = {
|
|
@@ -851,7 +851,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
851
851
|
},
|
|
852
852
|
tableWrapperHeight: this.state.tableWrapperHeight,
|
|
853
853
|
api: pluginInjectionApi,
|
|
854
|
-
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor
|
|
854
|
+
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
855
|
+
isDragAndDropEnabled: isDragAndDropEnabled
|
|
855
856
|
}) : null;
|
|
856
857
|
|
|
857
858
|
/**
|
|
@@ -24,7 +24,7 @@ export var tableHeaderView = function tableHeaderView(options) {
|
|
|
24
24
|
};
|
|
25
25
|
export var tableRowView = function tableRowView(options) {
|
|
26
26
|
return function (node, view, getPos) {
|
|
27
|
-
if (isAnchorSupported() && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
27
|
+
if (isAnchorSupported() && options.isDragAndDropEnabled && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
28
28
|
return new TableRowNativeStickyWithFallback(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi);
|
|
29
29
|
} else {
|
|
30
30
|
return new TableRow(node, view, getPos, options.eventDispatcher, options.pluginInjectionApi);
|
|
@@ -69,7 +69,8 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
69
69
|
}),
|
|
70
70
|
tableRow: tableRowView({
|
|
71
71
|
eventDispatcher: eventDispatcher,
|
|
72
|
-
pluginInjectionApi: pluginInjectionApi
|
|
72
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
73
|
+
isDragAndDropEnabled: dragAndDropEnabled
|
|
73
74
|
}),
|
|
74
75
|
tableCell: tableCellView({
|
|
75
76
|
eventDispatcher: eventDispatcher,
|
|
@@ -104,7 +104,8 @@ var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
|
104
104
|
isContextualMenuOpen: isContextualMenuOpen,
|
|
105
105
|
stickyHeader: stickyHeader,
|
|
106
106
|
tableWrapper: tableWrapperTarget,
|
|
107
|
-
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
107
|
+
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
108
|
+
isDragAndDropEnabled: isDragAndDropEnabled
|
|
108
109
|
}), allowControls && /*#__PURE__*/React.createElement(FloatingInsertButton, {
|
|
109
110
|
tableNode: tableNode,
|
|
110
111
|
tableRef: tableRef,
|
|
@@ -41,6 +41,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
|
|
|
41
41
|
tableWrapper = props.tableWrapper,
|
|
42
42
|
targetCellPosition = props.targetCellPosition,
|
|
43
43
|
isCellMenuOpenByKeyboard = props.isCellMenuOpenByKeyboard,
|
|
44
|
+
isDragAndDropEnabled = props.isDragAndDropEnabled,
|
|
44
45
|
formatMessage = props.intl.formatMessage; // : Props & WrappedComponentProps
|
|
45
46
|
|
|
46
47
|
var handleClick = function handleClick() {
|
|
@@ -93,7 +94,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
|
|
|
93
94
|
}));
|
|
94
95
|
var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
|
|
95
96
|
var parentStickyNative = targetCellRef.parentElement && targetCellRef.parentElement.classList.contains(ClassName.NATIVE_STICKY);
|
|
96
|
-
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && isAnchorSupported() && targetCellRef.nodeName === 'TH' && parentStickyNative) {
|
|
97
|
+
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && isAnchorSupported() && targetCellRef.nodeName === 'TH' && parentStickyNative && isDragAndDropEnabled) {
|
|
97
98
|
var _targetCellRef$datase, _targetCellRef$parent, _targetCellRef$parent2;
|
|
98
99
|
var anchorName = (_targetCellRef$datase = targetCellRef.dataset.nodeAnchor) !== null && _targetCellRef$datase !== void 0 ? _targetCellRef$datase : '';
|
|
99
100
|
var rowAnchorName = (_targetCellRef$parent = (_targetCellRef$parent2 = targetCellRef.parentElement) === null || _targetCellRef$parent2 === void 0 ? void 0 : _targetCellRef$parent2.dataset.nodeAnchor) !== null && _targetCellRef$parent !== void 0 ? _targetCellRef$parent : '';
|
|
@@ -106,6 +107,8 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
|
|
|
106
107
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
107
108
|
positionAnchor: anchorName
|
|
108
109
|
} // need to do this because CSSProperties doesn't have positionAnchor property even though it's a valid CSS property
|
|
110
|
+
,
|
|
111
|
+
"data-testid": "table-cell-options-anchor-wrapper"
|
|
109
112
|
}, button);
|
|
110
113
|
}
|
|
111
114
|
if (stickyHeader && parentSticky && tableWrapper) {
|
|
@@ -26,7 +26,8 @@ var TableFloatingColumnControls = function TableFloatingColumnControls(_ref) {
|
|
|
26
26
|
getScrollOffset = _ref.getScrollOffset,
|
|
27
27
|
tableWrapperHeight = _ref.tableWrapperHeight,
|
|
28
28
|
api = _ref.api,
|
|
29
|
-
isChromelessEditor = _ref.isChromelessEditor
|
|
29
|
+
isChromelessEditor = _ref.isChromelessEditor,
|
|
30
|
+
isDragAndDropEnabled = _ref.isDragAndDropEnabled;
|
|
30
31
|
var _useState = useState(false),
|
|
31
32
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
33
|
isDragging = _useState2[0],
|
|
@@ -74,7 +75,7 @@ var TableFloatingColumnControls = function TableFloatingColumnControls(_ref) {
|
|
|
74
75
|
containerRef === null || containerRef === void 0 || (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 || _containerRef$current2.style.removeProperty('top');
|
|
75
76
|
}
|
|
76
77
|
var anchorStyles = {};
|
|
77
|
-
if (isAnchorSupported() && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
78
|
+
if (isAnchorSupported() && isDragAndDropEnabled && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) && expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow')) {
|
|
78
79
|
var _tableRef$querySelect;
|
|
79
80
|
// cast here is due to CSSProperties missing valid positionAnchor property
|
|
80
81
|
anchorStyles = {
|
|
@@ -21,6 +21,7 @@ type TableViewOptions = {
|
|
|
21
21
|
export declare const tableView: (options: TableViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => import("prosemirror-view").NodeView;
|
|
22
22
|
type TableCellViewOptions = {
|
|
23
23
|
eventDispatcher: EventDispatcher;
|
|
24
|
+
isDragAndDropEnabled?: boolean;
|
|
24
25
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
25
26
|
};
|
|
26
27
|
export declare const tableCellView: (options: TableCellViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => TableCell;
|
|
@@ -17,6 +17,7 @@ interface Props {
|
|
|
17
17
|
hoveredCell?: CellHoverMeta;
|
|
18
18
|
hoveredRows?: number[];
|
|
19
19
|
isChromelessEditor?: boolean;
|
|
20
|
+
isDragAndDropEnabled?: boolean;
|
|
20
21
|
isInDanger?: boolean;
|
|
21
22
|
isNumberColumnEnabled?: boolean;
|
|
22
23
|
isResizing?: boolean;
|
|
@@ -29,5 +30,5 @@ interface Props {
|
|
|
29
30
|
tableRef?: HTMLTableElement;
|
|
30
31
|
tableWrapperHeight?: number;
|
|
31
32
|
}
|
|
32
|
-
declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, }: Props) => React.JSX.Element | null;
|
|
33
|
+
declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, isDragAndDropEnabled, }: Props) => React.JSX.Element | null;
|
|
33
34
|
export default TableFloatingColumnControls;
|
|
@@ -21,6 +21,7 @@ type TableViewOptions = {
|
|
|
21
21
|
export declare const tableView: (options: TableViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => import("prosemirror-view").NodeView;
|
|
22
22
|
type TableCellViewOptions = {
|
|
23
23
|
eventDispatcher: EventDispatcher;
|
|
24
|
+
isDragAndDropEnabled?: boolean;
|
|
24
25
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
25
26
|
};
|
|
26
27
|
export declare const tableCellView: (options: TableCellViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => TableCell;
|
|
@@ -17,6 +17,7 @@ interface Props {
|
|
|
17
17
|
hoveredCell?: CellHoverMeta;
|
|
18
18
|
hoveredRows?: number[];
|
|
19
19
|
isChromelessEditor?: boolean;
|
|
20
|
+
isDragAndDropEnabled?: boolean;
|
|
20
21
|
isInDanger?: boolean;
|
|
21
22
|
isNumberColumnEnabled?: boolean;
|
|
22
23
|
isResizing?: boolean;
|
|
@@ -29,5 +30,5 @@ interface Props {
|
|
|
29
30
|
tableRef?: HTMLTableElement;
|
|
30
31
|
tableWrapperHeight?: number;
|
|
31
32
|
}
|
|
32
|
-
declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, }: Props) => React.JSX.Element | null;
|
|
33
|
+
declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, isDragAndDropEnabled, }: Props) => React.JSX.Element | null;
|
|
33
34
|
export default TableFloatingColumnControls;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "15.4.
|
|
3
|
+
"version": "15.4.23",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^51.5.1",
|
|
32
|
-
"@atlaskit/button": "^23.
|
|
32
|
+
"@atlaskit/button": "^23.7.0",
|
|
33
33
|
"@atlaskit/custom-steps": "^0.16.0",
|
|
34
34
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^6.0.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@atlaskit/primitives": "^16.4.0",
|
|
59
59
|
"@atlaskit/theme": "^21.0.0",
|
|
60
60
|
"@atlaskit/tmp-editor-statsig": "^15.7.0",
|
|
61
|
-
"@atlaskit/toggle": "^15.
|
|
61
|
+
"@atlaskit/toggle": "^15.2.0",
|
|
62
62
|
"@atlaskit/tokens": "^8.4.0",
|
|
63
63
|
"@atlaskit/tooltip": "^20.11.0",
|
|
64
64
|
"@babel/runtime": "^7.0.0",
|