@atlaskit/editor-plugin-table 7.11.5 → 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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
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
|
+
|
|
3
11
|
## 7.11.5
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -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() {
|
|
@@ -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'),
|
|
@@ -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/"
|
|
@@ -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
|
},
|
|
@@ -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
|
);
|