@atlaskit/editor-plugin-table 7.11.4 → 7.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/nodeviews/TableComponent.js +0 -3
- package/dist/cjs/nodeviews/table.js +8 -19
- package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +1 -28
- package/dist/es2019/nodeviews/TableComponent.js +0 -3
- package/dist/es2019/nodeviews/table.js +7 -19
- package/dist/es2019/ui/FloatingDragMenu/DropdownMenu.js +1 -28
- package/dist/esm/nodeviews/TableComponent.js +0 -3
- package/dist/esm/nodeviews/table.js +8 -19
- package/dist/esm/ui/FloatingDragMenu/DropdownMenu.js +1 -28
- package/package.json +2 -5
- package/src/nodeviews/TableComponent.tsx +0 -8
- package/src/nodeviews/table.tsx +22 -29
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +42 -72
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.11.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#94875](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94875)
|
|
8
|
+
[`df9008092ea1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/df9008092ea1) -
|
|
9
|
+
remove ff for color picker position fix in table
|
|
10
|
+
|
|
11
|
+
## 7.11.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#96014](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/96014)
|
|
16
|
+
[`a24dcb2018ae`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a24dcb2018ae) -
|
|
17
|
+
Ensure tables in fixed mode always have explicit width set
|
|
18
|
+
|
|
3
19
|
## 7.11.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -543,9 +543,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
543
543
|
shouldScale = true;
|
|
544
544
|
shouldHandleColgroupUpdates = true;
|
|
545
545
|
}
|
|
546
|
-
if (isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button') && getNode().attrs.displayMode !== this.node.attrs.displayMode) {
|
|
547
|
-
shouldHandleColgroupUpdates = true;
|
|
548
|
-
}
|
|
549
546
|
if (shouldHandleColgroupUpdates) {
|
|
550
547
|
this.handleColgroupUpdates();
|
|
551
548
|
}
|
|
@@ -90,24 +90,12 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
90
90
|
value: function getContentDOM() {
|
|
91
91
|
var rendered = _model.DOMSerializer.renderSpec(document, toDOM(this.node, this.reactComponentProps));
|
|
92
92
|
if (rendered.dom) {
|
|
93
|
+
var _this$options, _this$options2;
|
|
93
94
|
this.table = rendered.dom;
|
|
94
|
-
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button')) {
|
|
95
|
-
var
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
var tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos());
|
|
99
|
-
if (tableInlineWidth) {
|
|
100
|
-
handleInlineTableWidth(this.table, tableInlineWidth);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
} else {
|
|
104
|
-
var _this$options2;
|
|
105
|
-
if (!((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled) || this.node.attrs.displayMode === 'fixed') {
|
|
106
|
-
// Preserve Table Width cannot have inline width set on the table
|
|
107
|
-
var _tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos());
|
|
108
|
-
if (_tableInlineWidth) {
|
|
109
|
-
handleInlineTableWidth(this.table, _tableInlineWidth);
|
|
110
|
-
}
|
|
95
|
+
if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.isTableScalingEnabled) || (_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button') && this.node.attrs.displayMode === 'fixed') {
|
|
96
|
+
var tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos());
|
|
97
|
+
if (tableInlineWidth) {
|
|
98
|
+
handleInlineTableWidth(this.table, tableInlineWidth);
|
|
111
99
|
}
|
|
112
100
|
}
|
|
113
101
|
}
|
|
@@ -117,7 +105,8 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
117
105
|
key: "setDomAttrs",
|
|
118
106
|
value: function setDomAttrs(node) {
|
|
119
107
|
var _this2 = this,
|
|
120
|
-
_this$options3
|
|
108
|
+
_this$options3,
|
|
109
|
+
_this$options4;
|
|
121
110
|
if (!this.table) {
|
|
122
111
|
return;
|
|
123
112
|
}
|
|
@@ -127,7 +116,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
127
116
|
});
|
|
128
117
|
|
|
129
118
|
// Preserve Table Width cannot have inline width set on the table
|
|
130
|
-
if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled)) {
|
|
119
|
+
if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled) || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button') && node.attrs.displayMode === 'fixed') {
|
|
131
120
|
var _tableWidthPluginKey$;
|
|
132
121
|
// handle inline style when table been resized
|
|
133
122
|
var tableInlineWidth = getInlineWidth(node, this.reactComponentProps.options, this.view.state, this.getPos());
|
|
@@ -13,7 +13,6 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
13
13
|
var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
var _menu = require("@atlaskit/menu");
|
|
16
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _consts = require("../consts");
|
|
18
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -94,32 +93,6 @@ var DropdownMenu = exports.DropdownMenu = function DropdownMenu(_ref) {
|
|
|
94
93
|
}));
|
|
95
94
|
})));
|
|
96
95
|
};
|
|
97
|
-
if (disableKeyboardHandling) {
|
|
98
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.background-color-flicker-in-drag-menu')) {
|
|
99
|
-
// This part need be refactor when clean up the ff, to reuse the wrapper
|
|
100
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
-
className: "drag-dropdown-menu-wrapper"
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
103
|
-
className: "drag-dropdown-menu-popup-ref",
|
|
104
|
-
ref: handleRef
|
|
105
|
-
}), /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
106
|
-
target: targetRefDiv,
|
|
107
|
-
mountTo: mountPoint,
|
|
108
|
-
boundariesElement: boundariesElement,
|
|
109
|
-
scrollableElement: scrollableElement,
|
|
110
|
-
onPlacementChanged: function onPlacementChanged(placement) {
|
|
111
|
-
setPopupPlacement(placement);
|
|
112
|
-
},
|
|
113
|
-
fitHeight: fitHeight,
|
|
114
|
-
fitWidth: fitWidth,
|
|
115
|
-
zIndex: _editorSharedStyles.akEditorFloatingPanelZIndex,
|
|
116
|
-
offset: [offsetX, offsetY],
|
|
117
|
-
allowOutOfBounds: true // required as this popup is child of a parent popup, should be allowed to be out of bound of the parent popup, otherwise horizontal offset is not right
|
|
118
|
-
}, innerMenu()));
|
|
119
|
-
} else {
|
|
120
|
-
return innerMenu();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
96
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
124
97
|
className: "drag-dropdown-menu-wrapper"
|
|
125
98
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -138,7 +111,7 @@ var DropdownMenu = exports.DropdownMenu = function DropdownMenu(_ref) {
|
|
|
138
111
|
zIndex: _editorSharedStyles.akEditorFloatingPanelZIndex,
|
|
139
112
|
offset: [offsetX, offsetY],
|
|
140
113
|
allowOutOfBounds: true // required as this popup is child of a parent popup, should be allowed to be out of bound of the parent popup, otherwise horizontal offset is not right
|
|
141
|
-
}, /*#__PURE__*/_react.default.createElement(_uiMenu.ArrowKeyNavigationProvider, {
|
|
114
|
+
}, disableKeyboardHandling ? innerMenu() : /*#__PURE__*/_react.default.createElement(_uiMenu.ArrowKeyNavigationProvider, {
|
|
142
115
|
closeOnTab: true,
|
|
143
116
|
type: _uiMenu.ArrowKeyNavigationType.MENU,
|
|
144
117
|
handleClose: function handleClose() {
|
|
@@ -529,9 +529,6 @@ class TableComponent extends React.Component {
|
|
|
529
529
|
shouldScale = true;
|
|
530
530
|
shouldHandleColgroupUpdates = true;
|
|
531
531
|
}
|
|
532
|
-
if (isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getNode().attrs.displayMode !== this.node.attrs.displayMode) {
|
|
533
|
-
shouldHandleColgroupUpdates = true;
|
|
534
|
-
}
|
|
535
532
|
if (shouldHandleColgroupUpdates) {
|
|
536
533
|
this.handleColgroupUpdates();
|
|
537
534
|
}
|
|
@@ -65,31 +65,19 @@ export default class TableView extends ReactNodeView {
|
|
|
65
65
|
getContentDOM() {
|
|
66
66
|
const rendered = DOMSerializer.renderSpec(document, toDOM(this.node, this.reactComponentProps));
|
|
67
67
|
if (rendered.dom) {
|
|
68
|
+
var _this$options, _this$options2;
|
|
68
69
|
this.table = rendered.dom;
|
|
69
|
-
if (!getBooleanFF('platform.editor.table.preserve-widths-with-lock-button')) {
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
const tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos());
|
|
74
|
-
if (tableInlineWidth) {
|
|
75
|
-
handleInlineTableWidth(this.table, tableInlineWidth);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
} else {
|
|
79
|
-
var _this$options2;
|
|
80
|
-
if (!((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled) || this.node.attrs.displayMode === 'fixed') {
|
|
81
|
-
// Preserve Table Width cannot have inline width set on the table
|
|
82
|
-
const tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos());
|
|
83
|
-
if (tableInlineWidth) {
|
|
84
|
-
handleInlineTableWidth(this.table, tableInlineWidth);
|
|
85
|
-
}
|
|
70
|
+
if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.isTableScalingEnabled) || (_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && this.node.attrs.displayMode === 'fixed') {
|
|
71
|
+
const tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos());
|
|
72
|
+
if (tableInlineWidth) {
|
|
73
|
+
handleInlineTableWidth(this.table, tableInlineWidth);
|
|
86
74
|
}
|
|
87
75
|
}
|
|
88
76
|
}
|
|
89
77
|
return rendered;
|
|
90
78
|
}
|
|
91
79
|
setDomAttrs(node) {
|
|
92
|
-
var _this$options3;
|
|
80
|
+
var _this$options3, _this$options4;
|
|
93
81
|
if (!this.table) {
|
|
94
82
|
return;
|
|
95
83
|
}
|
|
@@ -99,7 +87,7 @@ export default class TableView extends ReactNodeView {
|
|
|
99
87
|
});
|
|
100
88
|
|
|
101
89
|
// Preserve Table Width cannot have inline width set on the table
|
|
102
|
-
if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled)) {
|
|
90
|
+
if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled) || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && node.attrs.displayMode === 'fixed') {
|
|
103
91
|
var _tableWidthPluginKey$;
|
|
104
92
|
// handle inline style when table been resized
|
|
105
93
|
const tableInlineWidth = getInlineWidth(node, this.reactComponentProps.options, this.view.state, this.getPos());
|
|
@@ -5,7 +5,6 @@ import { ArrowKeyNavigationProvider, ArrowKeyNavigationType, DropdownMenuItem }
|
|
|
5
5
|
import { withReactEditorViewOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
6
6
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { MenuGroup, Section } from '@atlaskit/menu';
|
|
8
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { dragMenuDropdownWidth } from '../consts';
|
|
10
9
|
const DropListWithOutsideListeners = withReactEditorViewOuterListeners(DropList);
|
|
11
10
|
export const DropdownMenu = ({
|
|
@@ -73,32 +72,6 @@ export const DropdownMenu = ({
|
|
|
73
72
|
});
|
|
74
73
|
})))));
|
|
75
74
|
};
|
|
76
|
-
if (disableKeyboardHandling) {
|
|
77
|
-
if (getBooleanFF('platform.editor.table.background-color-flicker-in-drag-menu')) {
|
|
78
|
-
// This part need be refactor when clean up the ff, to reuse the wrapper
|
|
79
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
80
|
-
className: "drag-dropdown-menu-wrapper"
|
|
81
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
82
|
-
className: "drag-dropdown-menu-popup-ref",
|
|
83
|
-
ref: handleRef
|
|
84
|
-
}), /*#__PURE__*/React.createElement(Popup, {
|
|
85
|
-
target: targetRefDiv,
|
|
86
|
-
mountTo: mountPoint,
|
|
87
|
-
boundariesElement: boundariesElement,
|
|
88
|
-
scrollableElement: scrollableElement,
|
|
89
|
-
onPlacementChanged: placement => {
|
|
90
|
-
setPopupPlacement(placement);
|
|
91
|
-
},
|
|
92
|
-
fitHeight: fitHeight,
|
|
93
|
-
fitWidth: fitWidth,
|
|
94
|
-
zIndex: akEditorFloatingPanelZIndex,
|
|
95
|
-
offset: [offsetX, offsetY],
|
|
96
|
-
allowOutOfBounds: true // required as this popup is child of a parent popup, should be allowed to be out of bound of the parent popup, otherwise horizontal offset is not right
|
|
97
|
-
}, innerMenu()));
|
|
98
|
-
} else {
|
|
99
|
-
return innerMenu();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
75
|
return /*#__PURE__*/React.createElement("div", {
|
|
103
76
|
className: "drag-dropdown-menu-wrapper"
|
|
104
77
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -117,7 +90,7 @@ export const DropdownMenu = ({
|
|
|
117
90
|
zIndex: akEditorFloatingPanelZIndex,
|
|
118
91
|
offset: [offsetX, offsetY],
|
|
119
92
|
allowOutOfBounds: true // required as this popup is child of a parent popup, should be allowed to be out of bound of the parent popup, otherwise horizontal offset is not right
|
|
120
|
-
}, /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
|
|
93
|
+
}, disableKeyboardHandling ? innerMenu() : /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
|
|
121
94
|
closeOnTab: true,
|
|
122
95
|
type: ArrowKeyNavigationType.MENU,
|
|
123
96
|
handleClose: () => handleClose('handle'),
|
|
@@ -536,9 +536,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
536
536
|
shouldScale = true;
|
|
537
537
|
shouldHandleColgroupUpdates = true;
|
|
538
538
|
}
|
|
539
|
-
if (isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getNode().attrs.displayMode !== this.node.attrs.displayMode) {
|
|
540
|
-
shouldHandleColgroupUpdates = true;
|
|
541
|
-
}
|
|
542
539
|
if (shouldHandleColgroupUpdates) {
|
|
543
540
|
this.handleColgroupUpdates();
|
|
544
541
|
}
|
|
@@ -83,24 +83,12 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
83
83
|
value: function getContentDOM() {
|
|
84
84
|
var rendered = DOMSerializer.renderSpec(document, toDOM(this.node, this.reactComponentProps));
|
|
85
85
|
if (rendered.dom) {
|
|
86
|
+
var _this$options, _this$options2;
|
|
86
87
|
this.table = rendered.dom;
|
|
87
|
-
if (!getBooleanFF('platform.editor.table.preserve-widths-with-lock-button')) {
|
|
88
|
-
var
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
var tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos());
|
|
92
|
-
if (tableInlineWidth) {
|
|
93
|
-
handleInlineTableWidth(this.table, tableInlineWidth);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
var _this$options2;
|
|
98
|
-
if (!((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled) || this.node.attrs.displayMode === 'fixed') {
|
|
99
|
-
// Preserve Table Width cannot have inline width set on the table
|
|
100
|
-
var _tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos());
|
|
101
|
-
if (_tableInlineWidth) {
|
|
102
|
-
handleInlineTableWidth(this.table, _tableInlineWidth);
|
|
103
|
-
}
|
|
88
|
+
if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.isTableScalingEnabled) || (_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && this.node.attrs.displayMode === 'fixed') {
|
|
89
|
+
var tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos());
|
|
90
|
+
if (tableInlineWidth) {
|
|
91
|
+
handleInlineTableWidth(this.table, tableInlineWidth);
|
|
104
92
|
}
|
|
105
93
|
}
|
|
106
94
|
}
|
|
@@ -110,7 +98,8 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
110
98
|
key: "setDomAttrs",
|
|
111
99
|
value: function setDomAttrs(node) {
|
|
112
100
|
var _this2 = this,
|
|
113
|
-
_this$options3
|
|
101
|
+
_this$options3,
|
|
102
|
+
_this$options4;
|
|
114
103
|
if (!this.table) {
|
|
115
104
|
return;
|
|
116
105
|
}
|
|
@@ -120,7 +109,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
120
109
|
});
|
|
121
110
|
|
|
122
111
|
// Preserve Table Width cannot have inline width set on the table
|
|
123
|
-
if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled)) {
|
|
112
|
+
if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled) || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && node.attrs.displayMode === 'fixed') {
|
|
124
113
|
var _tableWidthPluginKey$;
|
|
125
114
|
// handle inline style when table been resized
|
|
126
115
|
var tableInlineWidth = getInlineWidth(node, this.reactComponentProps.options, this.view.state, this.getPos());
|
|
@@ -6,7 +6,6 @@ import { ArrowKeyNavigationProvider, ArrowKeyNavigationType, DropdownMenuItem }
|
|
|
6
6
|
import { withReactEditorViewOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
7
7
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { MenuGroup, Section } from '@atlaskit/menu';
|
|
9
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { dragMenuDropdownWidth } from '../consts';
|
|
11
10
|
var DropListWithOutsideListeners = withReactEditorViewOuterListeners(DropList);
|
|
12
11
|
export var DropdownMenu = function DropdownMenu(_ref) {
|
|
@@ -83,32 +82,6 @@ export var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
83
82
|
}));
|
|
84
83
|
})));
|
|
85
84
|
};
|
|
86
|
-
if (disableKeyboardHandling) {
|
|
87
|
-
if (getBooleanFF('platform.editor.table.background-color-flicker-in-drag-menu')) {
|
|
88
|
-
// This part need be refactor when clean up the ff, to reuse the wrapper
|
|
89
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
90
|
-
className: "drag-dropdown-menu-wrapper"
|
|
91
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
92
|
-
className: "drag-dropdown-menu-popup-ref",
|
|
93
|
-
ref: handleRef
|
|
94
|
-
}), /*#__PURE__*/React.createElement(Popup, {
|
|
95
|
-
target: targetRefDiv,
|
|
96
|
-
mountTo: mountPoint,
|
|
97
|
-
boundariesElement: boundariesElement,
|
|
98
|
-
scrollableElement: scrollableElement,
|
|
99
|
-
onPlacementChanged: function onPlacementChanged(placement) {
|
|
100
|
-
setPopupPlacement(placement);
|
|
101
|
-
},
|
|
102
|
-
fitHeight: fitHeight,
|
|
103
|
-
fitWidth: fitWidth,
|
|
104
|
-
zIndex: akEditorFloatingPanelZIndex,
|
|
105
|
-
offset: [offsetX, offsetY],
|
|
106
|
-
allowOutOfBounds: true // required as this popup is child of a parent popup, should be allowed to be out of bound of the parent popup, otherwise horizontal offset is not right
|
|
107
|
-
}, innerMenu()));
|
|
108
|
-
} else {
|
|
109
|
-
return innerMenu();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
113
86
|
className: "drag-dropdown-menu-wrapper"
|
|
114
87
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -127,7 +100,7 @@ export var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
127
100
|
zIndex: akEditorFloatingPanelZIndex,
|
|
128
101
|
offset: [offsetX, offsetY],
|
|
129
102
|
allowOutOfBounds: true // required as this popup is child of a parent popup, should be allowed to be out of bound of the parent popup, otherwise horizontal offset is not right
|
|
130
|
-
}, /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
|
|
103
|
+
}, disableKeyboardHandling ? innerMenu() : /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, {
|
|
131
104
|
closeOnTab: true,
|
|
132
105
|
type: ArrowKeyNavigationType.MENU,
|
|
133
106
|
handleClose: function handleClose() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.11.
|
|
3
|
+
"version": "7.11.6",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^35.12.1",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.1.0",
|
|
33
|
-
"@atlaskit/editor-common": "^78.
|
|
33
|
+
"@atlaskit/editor-common": "^78.37.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.6.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.1.0",
|
|
@@ -118,9 +118,6 @@
|
|
|
118
118
|
"platform.editor.transform-slice-for-nested-expand": {
|
|
119
119
|
"type": "boolean"
|
|
120
120
|
},
|
|
121
|
-
"platform.editor.table.background-color-flicker-in-drag-menu": {
|
|
122
|
-
"type": "boolean"
|
|
123
|
-
},
|
|
124
121
|
"platform.editor.table.cmd-a-select-table": {
|
|
125
122
|
"type": "boolean"
|
|
126
123
|
},
|
|
@@ -490,14 +490,6 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
490
490
|
shouldHandleColgroupUpdates = true;
|
|
491
491
|
}
|
|
492
492
|
|
|
493
|
-
if (
|
|
494
|
-
isTableScalingEnabled &&
|
|
495
|
-
getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') &&
|
|
496
|
-
getNode().attrs.displayMode !== this.node.attrs.displayMode
|
|
497
|
-
) {
|
|
498
|
-
shouldHandleColgroupUpdates = true;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
493
|
if (shouldHandleColgroupUpdates) {
|
|
502
494
|
this.handleColgroupUpdates();
|
|
503
495
|
}
|
package/src/nodeviews/table.tsx
CHANGED
|
@@ -138,35 +138,21 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
138
138
|
this.table = rendered.dom;
|
|
139
139
|
|
|
140
140
|
if (
|
|
141
|
-
!
|
|
141
|
+
!this.options?.isTableScalingEnabled ||
|
|
142
|
+
(this.options?.isTableScalingEnabled &&
|
|
143
|
+
getBooleanFF(
|
|
144
|
+
'platform.editor.table.preserve-widths-with-lock-button',
|
|
145
|
+
) &&
|
|
146
|
+
this.node.attrs.displayMode === 'fixed')
|
|
142
147
|
) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
);
|
|
151
|
-
if (tableInlineWidth) {
|
|
152
|
-
handleInlineTableWidth(this.table, tableInlineWidth);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
} else {
|
|
156
|
-
if (
|
|
157
|
-
!this.options?.isTableScalingEnabled ||
|
|
158
|
-
this.node.attrs.displayMode === 'fixed'
|
|
159
|
-
) {
|
|
160
|
-
// Preserve Table Width cannot have inline width set on the table
|
|
161
|
-
const tableInlineWidth = getInlineWidth(
|
|
162
|
-
this.node,
|
|
163
|
-
this.reactComponentProps.options,
|
|
164
|
-
this.reactComponentProps.view.state,
|
|
165
|
-
this.reactComponentProps.getPos(),
|
|
166
|
-
);
|
|
167
|
-
if (tableInlineWidth) {
|
|
168
|
-
handleInlineTableWidth(this.table, tableInlineWidth);
|
|
169
|
-
}
|
|
148
|
+
const tableInlineWidth = getInlineWidth(
|
|
149
|
+
this.node,
|
|
150
|
+
this.reactComponentProps.options,
|
|
151
|
+
this.reactComponentProps.view.state,
|
|
152
|
+
this.reactComponentProps.getPos(),
|
|
153
|
+
);
|
|
154
|
+
if (tableInlineWidth) {
|
|
155
|
+
handleInlineTableWidth(this.table, tableInlineWidth);
|
|
170
156
|
}
|
|
171
157
|
}
|
|
172
158
|
}
|
|
@@ -184,7 +170,14 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
184
170
|
});
|
|
185
171
|
|
|
186
172
|
// Preserve Table Width cannot have inline width set on the table
|
|
187
|
-
if (
|
|
173
|
+
if (
|
|
174
|
+
!this.options?.isTableScalingEnabled ||
|
|
175
|
+
(this.options?.isTableScalingEnabled &&
|
|
176
|
+
getBooleanFF(
|
|
177
|
+
'platform.editor.table.preserve-widths-with-lock-button',
|
|
178
|
+
) &&
|
|
179
|
+
node.attrs.displayMode === 'fixed')
|
|
180
|
+
) {
|
|
188
181
|
// handle inline style when table been resized
|
|
189
182
|
const tableInlineWidth = getInlineWidth(
|
|
190
183
|
node,
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
import { withReactEditorViewOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
12
12
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
13
13
|
import { MenuGroup, Section } from '@atlaskit/menu';
|
|
14
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
|
|
16
15
|
import { dragMenuDropdownWidth } from '../consts';
|
|
17
16
|
|
|
@@ -116,39 +115,6 @@ export const DropdownMenu = ({
|
|
|
116
115
|
);
|
|
117
116
|
};
|
|
118
117
|
|
|
119
|
-
if (disableKeyboardHandling) {
|
|
120
|
-
if (
|
|
121
|
-
getBooleanFF(
|
|
122
|
-
'platform.editor.table.background-color-flicker-in-drag-menu',
|
|
123
|
-
)
|
|
124
|
-
) {
|
|
125
|
-
// This part need be refactor when clean up the ff, to reuse the wrapper
|
|
126
|
-
return (
|
|
127
|
-
<div className="drag-dropdown-menu-wrapper">
|
|
128
|
-
<div className="drag-dropdown-menu-popup-ref" ref={handleRef}></div>
|
|
129
|
-
<Popup
|
|
130
|
-
target={targetRefDiv as HTMLElement}
|
|
131
|
-
mountTo={mountPoint}
|
|
132
|
-
boundariesElement={boundariesElement}
|
|
133
|
-
scrollableElement={scrollableElement}
|
|
134
|
-
onPlacementChanged={(placement: [string, string]) => {
|
|
135
|
-
setPopupPlacement(placement);
|
|
136
|
-
}}
|
|
137
|
-
fitHeight={fitHeight}
|
|
138
|
-
fitWidth={fitWidth}
|
|
139
|
-
zIndex={akEditorFloatingPanelZIndex}
|
|
140
|
-
offset={[offsetX, offsetY]}
|
|
141
|
-
allowOutOfBounds // required as this popup is child of a parent popup, should be allowed to be out of bound of the parent popup, otherwise horizontal offset is not right
|
|
142
|
-
>
|
|
143
|
-
{innerMenu()}
|
|
144
|
-
</Popup>
|
|
145
|
-
</div>
|
|
146
|
-
);
|
|
147
|
-
} else {
|
|
148
|
-
return innerMenu();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
118
|
return (
|
|
153
119
|
<div className="drag-dropdown-menu-wrapper">
|
|
154
120
|
<div className="drag-dropdown-menu-popup-ref" ref={handleRef}></div>
|
|
@@ -166,51 +132,55 @@ export const DropdownMenu = ({
|
|
|
166
132
|
offset={[offsetX, offsetY]}
|
|
167
133
|
allowOutOfBounds // required as this popup is child of a parent popup, should be allowed to be out of bound of the parent popup, otherwise horizontal offset is not right
|
|
168
134
|
>
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
// in the callback to be outside of array length.
|
|
181
|
-
// The logic below normalises the index value based on the number
|
|
182
|
-
// of menu items with 2 focusable elements, and adjusts the index to ensure
|
|
183
|
-
// the correct menu item is sent in onItemActivated callback
|
|
184
|
-
const keys = ['row_numbers', 'header_row', 'header_column'];
|
|
185
|
-
let doubleItemCount = 0;
|
|
135
|
+
{disableKeyboardHandling ? (
|
|
136
|
+
innerMenu()
|
|
137
|
+
) : (
|
|
138
|
+
<ArrowKeyNavigationProvider
|
|
139
|
+
closeOnTab
|
|
140
|
+
type={ArrowKeyNavigationType.MENU}
|
|
141
|
+
handleClose={() => handleClose('handle')}
|
|
142
|
+
onSelection={(index) => {
|
|
143
|
+
const results = items.flatMap((item) =>
|
|
144
|
+
'items' in item ? item.items : item,
|
|
145
|
+
);
|
|
186
146
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
147
|
+
// onSelection is called when any focusable element is 'activated'
|
|
148
|
+
// this is an issue as some menu items have toggles, which cause the index value
|
|
149
|
+
// in the callback to be outside of array length.
|
|
150
|
+
// The logic below normalises the index value based on the number
|
|
151
|
+
// of menu items with 2 focusable elements, and adjusts the index to ensure
|
|
152
|
+
// the correct menu item is sent in onItemActivated callback
|
|
153
|
+
const keys = ['row_numbers', 'header_row', 'header_column'];
|
|
154
|
+
let doubleItemCount = 0;
|
|
190
155
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
156
|
+
const firstIndex = results.findIndex((value) =>
|
|
157
|
+
keys.includes(value.key!),
|
|
158
|
+
);
|
|
195
159
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
doubleItemCount += 1;
|
|
199
|
-
}
|
|
200
|
-
if (firstIndex % 2 === 0 && index - doubleItemCount === i) {
|
|
201
|
-
onItemActivated && onItemActivated({ item: results[i] });
|
|
160
|
+
if (firstIndex === -1 || index <= firstIndex) {
|
|
161
|
+
onItemActivated && onItemActivated({ item: results[index] });
|
|
202
162
|
return;
|
|
203
163
|
}
|
|
204
164
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
165
|
+
for (let i = firstIndex; i < results.length; i += 1) {
|
|
166
|
+
if (keys.includes(results[i].key!)) {
|
|
167
|
+
doubleItemCount += 1;
|
|
168
|
+
}
|
|
169
|
+
if (firstIndex % 2 === 0 && index - doubleItemCount === i) {
|
|
170
|
+
onItemActivated && onItemActivated({ item: results[i] });
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (firstIndex % 2 === 1 && index - doubleItemCount === i) {
|
|
175
|
+
onItemActivated && onItemActivated({ item: results[i] });
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
208
178
|
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
179
|
+
}}
|
|
180
|
+
>
|
|
181
|
+
{innerMenu()}
|
|
182
|
+
</ArrowKeyNavigationProvider>
|
|
183
|
+
)}
|
|
214
184
|
</Popup>
|
|
215
185
|
</div>
|
|
216
186
|
);
|