@atlaskit/editor-plugin-type-ahead 10.0.4 → 10.0.5
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 +8 -0
- package/dist/cjs/ui/InputQuery.js +1 -21
- package/dist/cjs/ui/MoreOptions.js +0 -5
- package/dist/cjs/ui/TypeAheadList.js +2 -12
- package/dist/es2019/ui/InputQuery.js +1 -21
- package/dist/es2019/ui/MoreOptions.js +0 -5
- package/dist/es2019/ui/TypeAheadList.js +2 -12
- package/dist/esm/ui/InputQuery.js +1 -21
- package/dist/esm/ui/MoreOptions.js +0 -5
- package/dist/esm/ui/TypeAheadList.js +2 -12
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 10.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e6835136c4227`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e6835136c4227) -
|
|
8
|
+
[FFCLEANUP-98435] remove stale experiment `platform_editor_a11y_typeahead_tab_keypress`
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 10.0.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -17,7 +17,6 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
17
17
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
18
18
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
19
19
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
21
20
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
22
21
|
var _constants = require("../pm-plugins/constants");
|
|
23
22
|
var _utils2 = require("../pm-plugins/utils");
|
|
@@ -211,26 +210,7 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
|
|
|
211
210
|
}
|
|
212
211
|
break;
|
|
213
212
|
case 'Tab':
|
|
214
|
-
|
|
215
|
-
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
216
|
-
break;
|
|
217
|
-
} else {
|
|
218
|
-
if (selectedIndex === -1) {
|
|
219
|
-
/**
|
|
220
|
-
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
221
|
-
* here, either
|
|
222
|
-
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
223
|
-
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
224
|
-
* focus changes,
|
|
225
|
-
* - or do this jank at the cost of some small analytics noise.
|
|
226
|
-
*
|
|
227
|
-
*/
|
|
228
|
-
selectPreviousItem();
|
|
229
|
-
selectNextItem();
|
|
230
|
-
}
|
|
231
|
-
// TODO: DTR-1401 - why is this calling select item when hitting tab? fix this in DTR-1401
|
|
232
|
-
onItemSelect(_typeAhead.SelectItemMode.TAB);
|
|
233
|
-
}
|
|
213
|
+
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
234
214
|
break;
|
|
235
215
|
case 'ArrowDown':
|
|
236
216
|
selectNextItem();
|
|
@@ -55,11 +55,6 @@ var MoreOptions = exports.MoreOptions = function MoreOptions(_ref) {
|
|
|
55
55
|
onClick();
|
|
56
56
|
// Prevent keydown listener in TypeaheadList from handling Enter pressed
|
|
57
57
|
e.stopPropagation();
|
|
58
|
-
} else if (e.key === 'Tab' && !(0, _expValEquals.expValEquals)('platform_editor_a11y_typeahead_tab_keypress', 'isEnabled', true)) {
|
|
59
|
-
// TypeaheadList will try to insert selected item on Tab press
|
|
60
|
-
// hence stop propagation to prevent that and treat this as noop
|
|
61
|
-
e.stopPropagation();
|
|
62
|
-
e.preventDefault();
|
|
63
58
|
}
|
|
64
59
|
};
|
|
65
60
|
|
|
@@ -18,7 +18,6 @@ var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
|
18
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
19
19
|
var _menu = require("@atlaskit/menu");
|
|
20
20
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
21
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
22
21
|
var _closeTypeAhead = require("../pm-plugins/commands/close-type-ahead");
|
|
23
22
|
var _updateSelectedIndex = require("../pm-plugins/commands/update-selected-index");
|
|
24
23
|
var _constants = require("../pm-plugins/constants");
|
|
@@ -103,10 +102,7 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
|
|
|
103
102
|
};
|
|
104
103
|
}, [onItemClick]);
|
|
105
104
|
var isNavigationKey = function isNavigationKey(event) {
|
|
106
|
-
|
|
107
|
-
return ['ArrowDown', 'ArrowUp', 'Tab', 'Enter', 'Shift'].includes(event.key);
|
|
108
|
-
}
|
|
109
|
-
return ['ArrowDown', 'ArrowUp', 'Tab', 'Enter'].includes(event.key);
|
|
105
|
+
return ['ArrowDown', 'ArrowUp', 'Tab', 'Enter', 'Shift'].includes(event.key);
|
|
110
106
|
};
|
|
111
107
|
var focusTargetElement = (0, _react.useCallback)(function () {
|
|
112
108
|
var _decorationElement$qu;
|
|
@@ -251,13 +247,7 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
|
|
|
251
247
|
event.stopPropagation();
|
|
252
248
|
break;
|
|
253
249
|
case 'Tab':
|
|
254
|
-
|
|
255
|
-
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
256
|
-
break;
|
|
257
|
-
} else {
|
|
258
|
-
//Tab key quick inserts the selected item.
|
|
259
|
-
onItemClick(_typeAhead.SelectItemMode.TAB, selectedIndex, _analytics.INPUT_METHOD.KEYBOARD);
|
|
260
|
-
}
|
|
250
|
+
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
261
251
|
event.preventDefault();
|
|
262
252
|
break;
|
|
263
253
|
case 'Enter':
|
|
@@ -14,7 +14,6 @@ import { AssistiveText } from '@atlaskit/editor-common/ui';
|
|
|
14
14
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
15
15
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
17
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
19
18
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_ELEMENT_ID, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../pm-plugins/constants';
|
|
20
19
|
import { getPluginState } from '../pm-plugins/utils';
|
|
@@ -195,26 +194,7 @@ export const InputQuery = /*#__PURE__*/React.memo(({
|
|
|
195
194
|
}
|
|
196
195
|
break;
|
|
197
196
|
case 'Tab':
|
|
198
|
-
|
|
199
|
-
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
200
|
-
break;
|
|
201
|
-
} else {
|
|
202
|
-
if (selectedIndex === -1) {
|
|
203
|
-
/**
|
|
204
|
-
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
205
|
-
* here, either
|
|
206
|
-
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
207
|
-
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
208
|
-
* focus changes,
|
|
209
|
-
* - or do this jank at the cost of some small analytics noise.
|
|
210
|
-
*
|
|
211
|
-
*/
|
|
212
|
-
selectPreviousItem();
|
|
213
|
-
selectNextItem();
|
|
214
|
-
}
|
|
215
|
-
// TODO: DTR-1401 - why is this calling select item when hitting tab? fix this in DTR-1401
|
|
216
|
-
onItemSelect(SelectItemMode.TAB);
|
|
217
|
-
}
|
|
197
|
+
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
218
198
|
break;
|
|
219
199
|
case 'ArrowDown':
|
|
220
200
|
selectNextItem();
|
|
@@ -49,11 +49,6 @@ export const MoreOptions = ({
|
|
|
49
49
|
onClick();
|
|
50
50
|
// Prevent keydown listener in TypeaheadList from handling Enter pressed
|
|
51
51
|
e.stopPropagation();
|
|
52
|
-
} else if (e.key === 'Tab' && !expValEquals('platform_editor_a11y_typeahead_tab_keypress', 'isEnabled', true)) {
|
|
53
|
-
// TypeaheadList will try to insert selected item on Tab press
|
|
54
|
-
// hence stop propagation to prevent that and treat this as noop
|
|
55
|
-
e.stopPropagation();
|
|
56
|
-
e.preventDefault();
|
|
57
52
|
}
|
|
58
53
|
};
|
|
59
54
|
|
|
@@ -16,7 +16,6 @@ import { SelectItemMode, typeAheadListMessages } from '@atlaskit/editor-common/t
|
|
|
16
16
|
import { AssistiveText } from '@atlaskit/editor-common/ui';
|
|
17
17
|
import { MenuGroup } from '@atlaskit/menu';
|
|
18
18
|
import { Text, Box } from '@atlaskit/primitives/compiled';
|
|
19
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
20
19
|
import { closeTypeAhead } from '../pm-plugins/commands/close-type-ahead';
|
|
21
20
|
import { updateSelectedIndex } from '../pm-plugins/commands/update-selected-index';
|
|
22
21
|
import { TYPE_AHEAD_DECORATION_ELEMENT_ID } from '../pm-plugins/constants';
|
|
@@ -87,10 +86,7 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
|
|
|
87
86
|
onItemClick
|
|
88
87
|
}), [onItemClick]);
|
|
89
88
|
const isNavigationKey = event => {
|
|
90
|
-
|
|
91
|
-
return ['ArrowDown', 'ArrowUp', 'Tab', 'Enter', 'Shift'].includes(event.key);
|
|
92
|
-
}
|
|
93
|
-
return ['ArrowDown', 'ArrowUp', 'Tab', 'Enter'].includes(event.key);
|
|
89
|
+
return ['ArrowDown', 'ArrowUp', 'Tab', 'Enter', 'Shift'].includes(event.key);
|
|
94
90
|
};
|
|
95
91
|
const focusTargetElement = useCallback(() => {
|
|
96
92
|
var _decorationElement$qu;
|
|
@@ -234,13 +230,7 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
|
|
|
234
230
|
event.stopPropagation();
|
|
235
231
|
break;
|
|
236
232
|
case 'Tab':
|
|
237
|
-
|
|
238
|
-
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
239
|
-
break;
|
|
240
|
-
} else {
|
|
241
|
-
//Tab key quick inserts the selected item.
|
|
242
|
-
onItemClick(SelectItemMode.TAB, selectedIndex, INPUT_METHOD.KEYBOARD);
|
|
243
|
-
}
|
|
233
|
+
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
244
234
|
event.preventDefault();
|
|
245
235
|
break;
|
|
246
236
|
case 'Enter':
|
|
@@ -15,7 +15,6 @@ import { AssistiveText } from '@atlaskit/editor-common/ui';
|
|
|
15
15
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
16
16
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
17
17
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
18
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
19
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_ELEMENT_ID, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../pm-plugins/constants';
|
|
21
20
|
import { getPluginState } from '../pm-plugins/utils';
|
|
@@ -201,26 +200,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
201
200
|
}
|
|
202
201
|
break;
|
|
203
202
|
case 'Tab':
|
|
204
|
-
|
|
205
|
-
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
206
|
-
break;
|
|
207
|
-
} else {
|
|
208
|
-
if (selectedIndex === -1) {
|
|
209
|
-
/**
|
|
210
|
-
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
211
|
-
* here, either
|
|
212
|
-
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
213
|
-
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
214
|
-
* focus changes,
|
|
215
|
-
* - or do this jank at the cost of some small analytics noise.
|
|
216
|
-
*
|
|
217
|
-
*/
|
|
218
|
-
selectPreviousItem();
|
|
219
|
-
selectNextItem();
|
|
220
|
-
}
|
|
221
|
-
// TODO: DTR-1401 - why is this calling select item when hitting tab? fix this in DTR-1401
|
|
222
|
-
onItemSelect(SelectItemMode.TAB);
|
|
223
|
-
}
|
|
203
|
+
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
224
204
|
break;
|
|
225
205
|
case 'ArrowDown':
|
|
226
206
|
selectNextItem();
|
|
@@ -46,11 +46,6 @@ export var MoreOptions = function MoreOptions(_ref) {
|
|
|
46
46
|
onClick();
|
|
47
47
|
// Prevent keydown listener in TypeaheadList from handling Enter pressed
|
|
48
48
|
e.stopPropagation();
|
|
49
|
-
} else if (e.key === 'Tab' && !expValEquals('platform_editor_a11y_typeahead_tab_keypress', 'isEnabled', true)) {
|
|
50
|
-
// TypeaheadList will try to insert selected item on Tab press
|
|
51
|
-
// hence stop propagation to prevent that and treat this as noop
|
|
52
|
-
e.stopPropagation();
|
|
53
|
-
e.preventDefault();
|
|
54
49
|
}
|
|
55
50
|
};
|
|
56
51
|
|
|
@@ -17,7 +17,6 @@ import { SelectItemMode, typeAheadListMessages } from '@atlaskit/editor-common/t
|
|
|
17
17
|
import { AssistiveText } from '@atlaskit/editor-common/ui';
|
|
18
18
|
import { MenuGroup } from '@atlaskit/menu';
|
|
19
19
|
import { Text, Box } from '@atlaskit/primitives/compiled';
|
|
20
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
20
|
import { closeTypeAhead } from '../pm-plugins/commands/close-type-ahead';
|
|
22
21
|
import { updateSelectedIndex } from '../pm-plugins/commands/update-selected-index';
|
|
23
22
|
import { TYPE_AHEAD_DECORATION_ELEMENT_ID } from '../pm-plugins/constants';
|
|
@@ -94,10 +93,7 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
94
93
|
};
|
|
95
94
|
}, [onItemClick]);
|
|
96
95
|
var isNavigationKey = function isNavigationKey(event) {
|
|
97
|
-
|
|
98
|
-
return ['ArrowDown', 'ArrowUp', 'Tab', 'Enter', 'Shift'].includes(event.key);
|
|
99
|
-
}
|
|
100
|
-
return ['ArrowDown', 'ArrowUp', 'Tab', 'Enter'].includes(event.key);
|
|
96
|
+
return ['ArrowDown', 'ArrowUp', 'Tab', 'Enter', 'Shift'].includes(event.key);
|
|
101
97
|
};
|
|
102
98
|
var focusTargetElement = useCallback(function () {
|
|
103
99
|
var _decorationElement$qu;
|
|
@@ -242,13 +238,7 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
242
238
|
event.stopPropagation();
|
|
243
239
|
break;
|
|
244
240
|
case 'Tab':
|
|
245
|
-
|
|
246
|
-
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
247
|
-
break;
|
|
248
|
-
} else {
|
|
249
|
-
//Tab key quick inserts the selected item.
|
|
250
|
-
onItemClick(SelectItemMode.TAB, selectedIndex, INPUT_METHOD.KEYBOARD);
|
|
251
|
-
}
|
|
241
|
+
event.shiftKey ? selectPreviousItem() : selectNextItem();
|
|
252
242
|
event.preventDefault();
|
|
253
243
|
break;
|
|
254
244
|
case 'Enter':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.5",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/primitives": "^19.0.0",
|
|
45
45
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
46
46
|
"@atlaskit/prosemirror-input-rules": "^3.6.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^67.0.0",
|
|
48
48
|
"@atlaskit/tokens": "^13.0.0",
|
|
49
49
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"w3c-keyname": "^2.1.8"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@atlaskit/editor-common": "^114.
|
|
59
|
+
"@atlaskit/editor-common": "^114.8.0",
|
|
60
60
|
"react": "^18.2.0",
|
|
61
61
|
"react-dom": "^18.2.0",
|
|
62
62
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|