@atlaskit/editor-core 187.15.0 → 187.15.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/create-editor/create-plugins-list.js +2 -7
  3. package/dist/cjs/create-editor/feature-flags-from-props.js +23 -28
  4. package/dist/cjs/plugins/type-ahead/index.js +1 -4
  5. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +2 -4
  6. package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +2 -4
  7. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +21 -40
  8. package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
  9. package/dist/cjs/plugins/type-ahead/utils.js +15 -19
  10. package/dist/cjs/version-wrapper.js +1 -1
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/es2019/create-editor/create-plugins-list.js +2 -7
  13. package/dist/es2019/create-editor/feature-flags-from-props.js +23 -28
  14. package/dist/es2019/plugins/type-ahead/index.js +1 -4
  15. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -4
  16. package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +2 -4
  17. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +21 -40
  18. package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
  19. package/dist/es2019/plugins/type-ahead/utils.js +15 -19
  20. package/dist/es2019/version-wrapper.js +1 -1
  21. package/dist/es2019/version.json +1 -1
  22. package/dist/esm/create-editor/create-plugins-list.js +2 -7
  23. package/dist/esm/create-editor/feature-flags-from-props.js +23 -28
  24. package/dist/esm/plugins/type-ahead/index.js +1 -4
  25. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -4
  26. package/dist/esm/plugins/type-ahead/pm-plugins/main.js +2 -4
  27. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +21 -40
  28. package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
  29. package/dist/esm/plugins/type-ahead/utils.js +15 -19
  30. package/dist/esm/version-wrapper.js +1 -1
  31. package/dist/esm/version.json +1 -1
  32. package/dist/types/create-editor/create-plugins-list.d.ts +6 -6
  33. package/dist/types/plugins/type-ahead/index.d.ts +0 -1
  34. package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +1 -2
  35. package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +1 -2
  36. package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +0 -1
  37. package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -1
  38. package/dist/types/plugins/type-ahead/utils.d.ts +1 -2
  39. package/dist/types-ts4.5/create-editor/create-plugins-list.d.ts +6 -6
  40. package/dist/types-ts4.5/plugins/type-ahead/index.d.ts +0 -1
  41. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/decorations.d.ts +1 -2
  42. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/main.d.ts +1 -2
  43. package/dist/types-ts4.5/plugins/type-ahead/ui/InputQuery.d.ts +0 -1
  44. package/dist/types-ts4.5/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -1
  45. package/dist/types-ts4.5/plugins/type-ahead/utils.d.ts +1 -2
  46. package/package.json +1 -1
  47. package/report.api.md +1 -2
  48. package/tmp/api-report-tmp.d.ts +1 -2
@@ -23,8 +23,7 @@ export function createPlugin({
23
23
  popupMountRef,
24
24
  createAnalyticsEvent,
25
25
  typeAheadHandlers,
26
- getIntl,
27
- useBetterTypeaheadNavigation
26
+ getIntl
28
27
  }) {
29
28
  const intl = getIntl();
30
29
  const {
@@ -33,8 +32,7 @@ export function createPlugin({
33
32
  } = factoryDecorations({
34
33
  intl,
35
34
  popupMountRef,
36
- createAnalyticsEvent: createAnalyticsEvent,
37
- useBetterTypeaheadNavigation
35
+ createAnalyticsEvent: createAnalyticsEvent
38
36
  });
39
37
  const reducer = createReducer({
40
38
  createDecorations,
@@ -65,8 +65,7 @@ export const InputQuery = /*#__PURE__*/React.memo(({
65
65
  onQueryFocus,
66
66
  onUndoRedo,
67
67
  editorView,
68
- items,
69
- useBetterTypeaheadNavigation
68
+ items
70
69
  }) => {
71
70
  const ref = useRef(document.createElement('span'));
72
71
  const inputRef = useRef(null);
@@ -135,27 +134,6 @@ export const InputQuery = /*#__PURE__*/React.memo(({
135
134
  // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
136
135
  if (!event.isComposing && event.which !== 229 && event.keyCode !== 229) {
137
136
  if (selectedIndex === -1) {
138
- if (useBetterTypeaheadNavigation) {
139
- /**
140
- * TODO DTR-1401: (also see ED-17200) There are two options
141
- * here, either
142
- * - set the index directly to 1 in WrapperTypeAhead.tsx's
143
- * `insertSelectedItem` at the cost of breaking some of the a11y
144
- * focus changes,
145
- * - or do this jank at the cost of some small analytics noise.
146
- *
147
- * The focus behaviour still needs cleanup
148
- */
149
- selectPreviousItem();
150
- }
151
- selectNextItem();
152
- }
153
- onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
154
- }
155
- break;
156
- case 'Tab':
157
- if (selectedIndex === -1) {
158
- if (useBetterTypeaheadNavigation) {
159
137
  /**
160
138
  * TODO DTR-1401: (also see ED-17200) There are two options
161
139
  * here, either
@@ -164,33 +142,36 @@ export const InputQuery = /*#__PURE__*/React.memo(({
164
142
  * focus changes,
165
143
  * - or do this jank at the cost of some small analytics noise.
166
144
  *
145
+ * The focus behaviour still needs cleanup
167
146
  */
168
147
  selectPreviousItem();
148
+ selectNextItem();
169
149
  }
150
+ onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
151
+ }
152
+ break;
153
+ case 'Tab':
154
+ if (selectedIndex === -1) {
155
+ /**
156
+ * TODO DTR-1401: (also see ED-17200) There are two options
157
+ * here, either
158
+ * - set the index directly to 1 in WrapperTypeAhead.tsx's
159
+ * `insertSelectedItem` at the cost of breaking some of the a11y
160
+ * focus changes,
161
+ * - or do this jank at the cost of some small analytics noise.
162
+ *
163
+ */
164
+ selectPreviousItem();
170
165
  selectNextItem();
171
166
  }
172
167
  // TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
173
168
  onItemSelect(SelectItemMode.TAB);
174
169
  break;
175
170
  case 'ArrowDown':
176
- if (useBetterTypeaheadNavigation) {
177
- selectNextItem();
178
- } else {
179
- // TODO DTR-1401: why were we preventing selection?
180
- if (selectedIndex === -1) {
181
- selectNextItem();
182
- }
183
- }
171
+ selectNextItem();
184
172
  break;
185
173
  case 'ArrowUp':
186
- if (useBetterTypeaheadNavigation) {
187
- selectPreviousItem();
188
- } else {
189
- // TODO DTR-1401: why were we preventing selection?
190
- if (selectedIndex === -1) {
191
- selectPreviousItem();
192
- }
193
- }
174
+ selectPreviousItem();
194
175
  break;
195
176
  }
196
177
  const undoRedoType = isUndoRedoShortcut(event);
@@ -202,7 +183,7 @@ export const InputQuery = /*#__PURE__*/React.memo(({
202
183
  event.preventDefault();
203
184
  return false;
204
185
  }
205
- }, [useBetterTypeaheadNavigation, onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
186
+ }, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
206
187
  const onClick = useCallback(event => {
207
188
  var _inputRef$current;
208
189
  event.stopPropagation();
@@ -18,8 +18,7 @@ export const WrapperTypeAhead = /*#__PURE__*/React.memo(({
18
18
  inputMethod,
19
19
  getDecorationPosition,
20
20
  reopenQuery,
21
- onUndoRedo,
22
- useBetterTypeaheadNavigation
21
+ onUndoRedo
23
22
  }) => {
24
23
  const [closed, setClosed] = useState(false);
25
24
  const [query, setQuery] = useState(reopenQuery || '');
@@ -32,14 +31,12 @@ export const WrapperTypeAhead = /*#__PURE__*/React.memo(({
32
31
  const [onItemInsert, onTextInsert] = useItemInsert(triggerHandler, editorView, items);
33
32
  const selectNextItem = useMemo(() => moveSelectedIndex({
34
33
  editorView,
35
- direction: 'next',
36
- useBetterTypeaheadNavigation
37
- }), [editorView, useBetterTypeaheadNavigation]);
34
+ direction: 'next'
35
+ }), [editorView]);
38
36
  const selectPreviousItem = useMemo(() => moveSelectedIndex({
39
37
  editorView,
40
- direction: 'previous',
41
- useBetterTypeaheadNavigation
42
- }), [editorView, useBetterTypeaheadNavigation]);
38
+ direction: 'previous'
39
+ }), [editorView]);
43
40
  const cancel = useCallback(({
44
41
  setSelectionAt,
45
42
  addPrefixTrigger,
@@ -95,7 +92,6 @@ export const WrapperTypeAhead = /*#__PURE__*/React.memo(({
95
92
  return null;
96
93
  }
97
94
  return /*#__PURE__*/React.createElement(InputQuery, {
98
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
99
95
  triggerQueryPrefix: triggerHandler.trigger,
100
96
  onQueryChange: setQuery,
101
97
  onItemSelect: insertSelectedItem,
@@ -54,8 +54,7 @@ export const findHandlerByTrigger = ({
54
54
  };
55
55
  export const moveSelectedIndex = ({
56
56
  editorView,
57
- direction,
58
- useBetterTypeaheadNavigation
57
+ direction
59
58
  }) => () => {
60
59
  const typeAheadState = getPluginState(editorView.state);
61
60
  if (!typeAheadState) {
@@ -69,23 +68,20 @@ export const moveSelectedIndex = ({
69
68
  let nextIndex;
70
69
  if (direction === 'next') {
71
70
  stats.increaseArrowDown();
72
- if (useBetterTypeaheadNavigation) {
73
- /**
74
- * See: https://product-fabric.atlassian.net/browse/ED-17200
75
- * `selectedIndex` is forced to -1 now to not immediately focus the typeahead
76
- * and only do so when there is explicit logic to focus into the typeahead
77
- * options.
78
- *
79
- * This check for "set index to 1 when -1"
80
- * - is a temporary workaround to get back the previous behaviour without
81
- * entirely reverting the a11y improvements
82
- *
83
- */
84
- if (selectedIndex === -1 && items.length > 1) {
85
- nextIndex = 1;
86
- } else {
87
- nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
88
- }
71
+
72
+ /**
73
+ * See: https://product-fabric.atlassian.net/browse/ED-17200
74
+ * `selectedIndex` is forced to -1 now to not immediately focus the typeahead
75
+ * and only do so when there is explicit logic to focus into the typeahead
76
+ * options.
77
+ *
78
+ * This check for "set index to 1 when -1"
79
+ * - is a temporary workaround to get back the previous behaviour without
80
+ * entirely reverting the a11y improvements
81
+ *
82
+ */
83
+ if (selectedIndex === -1 && items.length > 1) {
84
+ nextIndex = 1;
89
85
  } else {
90
86
  nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
91
87
  }
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "187.15.0";
2
+ export const version = "187.15.1";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.15.0",
3
+ "version": "187.15.1",
4
4
  "sideEffects": false
5
5
  }
@@ -34,21 +34,16 @@ export function getScrollGutterOptions(props) {
34
34
  return undefined;
35
35
  }
36
36
  export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
37
- var _props$performanceTra, _props$linking, _ref, _props$featureFlags$u, _props$featureFlags, _props$featureFlags2, _props$performanceTra2, _props$textFormatting, _props$linking2;
37
+ var _props$performanceTra, _props$linking, _props$performanceTra2, _props$textFormatting, _props$linking2;
38
38
  var appearance = props.appearance;
39
39
  var isMobile = appearance === 'mobile';
40
40
  var inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
41
41
  var cardOptions = ((_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks) || props.smartLinks || props.UNSAFE_cards;
42
-
43
- // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
44
- var pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
45
- var useBetterTypeaheadNavigation = Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true);
46
42
  return _objectSpread(_objectSpread({}, props), {}, {
47
43
  createAnalyticsEvent: createAnalyticsEvent,
48
44
  typeAhead: {
49
45
  createAnalyticsEvent: createAnalyticsEvent,
50
- isMobile: isMobile,
51
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
46
+ isMobile: isMobile
52
47
  },
53
48
  featureFlags: createFeatureFlagsFromProps(props),
54
49
  paste: {
@@ -25,12 +25,9 @@ function getSpellCheck(featureFlags) {
25
25
  * which is used by both current and archv3 editors.
26
26
  */
27
27
  export function createFeatureFlagsFromProps(props) {
28
- var _props$featureFlags, _ref, _props$featureFlags$u, _props$featureFlags2, _props$featureFlags3, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags4, _props$featureFlags5, _props$allowTables, _props$featureFlags6, _props$featureFlags7, _props$allowTables2, _props$featureFlags8, _props$featureFlags9, _props$allowTables3, _props$featureFlags10, _props$featureFlags11, _props$allowTables4, _props$allowTables5, _props$featureFlags12, _props$featureFlags13, _props$allowTables6, _props$allowExtension, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$collabEdit, _props$collabEdit2, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44;
28
+ var _props$featureFlags, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$collabEdit, _props$collabEdit2, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42;
29
29
  var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
30
30
  var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
31
-
32
- // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
33
- var pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
34
31
  return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
35
32
  newInsertionBehaviour: props.allowNewInsertionBehaviour,
36
33
  interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
@@ -41,36 +38,34 @@ export function createFeatureFlagsFromProps(props) {
41
38
  singleLayout: _typeof(props.allowLayouts) === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
42
39
  undoRedoButtons: props.allowUndoRedoButtons,
43
40
  catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
44
- stickyHeadersOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.stickyHeadersOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
45
- initialRenderOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.initialRenderOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
46
- mouseMoveOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.mouseMoveOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
47
- tableRenderOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableRenderOptimization) : _typeof(props.allowTables) === 'object' && typeof ((_props$allowTables4 = props.allowTables) === null || _props$allowTables4 === void 0 ? void 0 : _props$allowTables4.tableRenderOptimization) === 'boolean' ? (_props$allowTables5 = props.allowTables) === null || _props$allowTables5 === void 0 ? void 0 : _props$allowTables5.tableRenderOptimization : true,
48
- tableOverflowShadowsOptimization: typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.tableOverflowShadowsOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
41
+ stickyHeadersOptimization: typeof ((_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.stickyHeadersOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
42
+ initialRenderOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.initialRenderOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
43
+ mouseMoveOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.mouseMoveOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
44
+ tableRenderOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.tableRenderOptimization) : _typeof(props.allowTables) === 'object' && typeof ((_props$allowTables4 = props.allowTables) === null || _props$allowTables4 === void 0 ? void 0 : _props$allowTables4.tableRenderOptimization) === 'boolean' ? (_props$allowTables5 = props.allowTables) === null || _props$allowTables5 === void 0 ? void 0 : _props$allowTables5.tableRenderOptimization : true,
45
+ tableOverflowShadowsOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableOverflowShadowsOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
49
46
  extendFloatingToolbar: Boolean(_typeof(props.allowExtension) === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
50
- showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.showAvatarGroupAsPlugin) : false),
51
- errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.useErrorBoundaryDocStructure) : false),
52
- synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.synchronyErrorDocStructure) : false),
53
- enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.enableViewUpdateSubscription) : false),
54
- collabAvatarScroll: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.collabAvatarScroll) : false),
55
- ufo: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.ufo) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.ufo) : false),
56
- twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.twoLineEditorToolbar) : false),
57
- saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactions) : false)),
58
- saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.saferDispatchedTransactionsAnalyticsOnly) : false)),
47
+ showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.showAvatarGroupAsPlugin) : false),
48
+ errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.useErrorBoundaryDocStructure) : false),
49
+ synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.synchronyErrorDocStructure) : false),
50
+ enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.enableViewUpdateSubscription) : false),
51
+ collabAvatarScroll: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.collabAvatarScroll) : false),
52
+ ufo: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.ufo) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.ufo) : false),
53
+ twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.twoLineEditorToolbar) : false),
54
+ saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.saferDispatchedTransactions) : false)),
55
+ saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactionsAnalyticsOnly) : false)),
59
56
  useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
60
- chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
57
+ chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
61
58
  tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
62
- showHoverPreview: Boolean(typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.showHoverPreview) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.showHoverPreview) : false),
63
- indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.indentationButtonsInTheToolbar) : false)),
64
- floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags38 = props.featureFlags) !== null && _props$featureFlags38 !== void 0 && _props$featureFlags38.floatingToolbarCopyButton) : false)),
65
- floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
59
+ showHoverPreview: Boolean(typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.showHoverPreview) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.showHoverPreview) : false),
60
+ indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.indentationButtonsInTheToolbar) : false)),
61
+ floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.floatingToolbarCopyButton) : false)),
62
+ floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
66
63
  disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
67
64
  // Including fallback to props.featureFlags so that mobile feature flags
68
65
  // are included (they are not kebab cased)
69
- restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedLists) === true,
70
- useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42.useSomewhatSemanticTextColorNames) : false)),
66
+ restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedLists) === true,
67
+ useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags40 = props.featureFlags) !== null && _props$featureFlags40 !== void 0 && _props$featureFlags40.useSomewhatSemanticTextColorNames) : false)),
71
68
  lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
72
- preventPopupOverflow: Boolean(typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44['prevent-popup-overflow']) : false),
73
- // duplicated logic from `create-plugins-list.ts` due to presets not being finalised
74
- useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
69
+ preventPopupOverflow: Boolean(typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42['prevent-popup-overflow']) : false)
75
70
  });
76
71
  }
@@ -113,8 +113,6 @@ var TypeAheadMenu = /*#__PURE__*/React.memo(function (_ref) {
113
113
  *
114
114
  */
115
115
  var typeAheadPlugin = function typeAheadPlugin(options) {
116
- var _options$useBetterTyp;
117
- var useBetterTypeaheadNavigation = (_options$useBetterTyp = options === null || options === void 0 ? void 0 : options.useBetterTypeaheadNavigation) !== null && _options$useBetterTyp !== void 0 ? _options$useBetterTyp : true;
118
116
  var fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
119
117
  var popupMountRef = {
120
118
  current: null
@@ -141,8 +139,7 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
141
139
  popupMountRef: popupMountRef,
142
140
  reactDispatch: dispatch,
143
141
  typeAheadHandlers: typeAhead,
144
- createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent,
145
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
142
+ createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent
146
143
  });
147
144
  }
148
145
  }, {
@@ -15,8 +15,7 @@ import { closeTypeAhead } from '../transforms/close-type-ahead';
15
15
  export var factoryDecorations = function factoryDecorations(_ref) {
16
16
  var intl = _ref.intl,
17
17
  popupMountRef = _ref.popupMountRef,
18
- createAnalyticsEvent = _ref.createAnalyticsEvent,
19
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
18
+ createAnalyticsEvent = _ref.createAnalyticsEvent;
20
19
  var createDecorations = function createDecorations(tr, _ref2) {
21
20
  var triggerHandler = _ref2.triggerHandler,
22
21
  inputMethod = _ref2.inputMethod,
@@ -88,8 +87,7 @@ export var factoryDecorations = function factoryDecorations(_ref) {
88
87
  popupsBoundariesElement: (_popupMountRef$curren2 = popupMountRef.current) === null || _popupMountRef$curren2 === void 0 ? void 0 : _popupMountRef$curren2.popupsBoundariesElement,
89
88
  popupsScrollableElement: (_popupMountRef$curren3 = popupMountRef.current) === null || _popupMountRef$curren3 === void 0 ? void 0 : _popupMountRef$curren3.popupsScrollableElement,
90
89
  onUndoRedo: onUndoRedo,
91
- reopenQuery: reopenQuery,
92
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
90
+ reopenQuery: reopenQuery
93
91
  })), typeaheadComponent);
94
92
  shouldFocusCursorInsideQuery = false;
95
93
  return typeaheadComponent;
@@ -25,14 +25,12 @@ export function createPlugin(_ref) {
25
25
  popupMountRef = _ref.popupMountRef,
26
26
  createAnalyticsEvent = _ref.createAnalyticsEvent,
27
27
  typeAheadHandlers = _ref.typeAheadHandlers,
28
- getIntl = _ref.getIntl,
29
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
28
+ getIntl = _ref.getIntl;
30
29
  var intl = getIntl();
31
30
  var _factoryDecorations = factoryDecorations({
32
31
  intl: intl,
33
32
  popupMountRef: popupMountRef,
34
- createAnalyticsEvent: createAnalyticsEvent,
35
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
33
+ createAnalyticsEvent: createAnalyticsEvent
36
34
  }),
37
35
  createDecorations = _factoryDecorations.createDecorations,
38
36
  removeDecorations = _factoryDecorations.removeDecorations;
@@ -66,8 +66,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
66
66
  onQueryFocus = _ref.onQueryFocus,
67
67
  onUndoRedo = _ref.onUndoRedo,
68
68
  editorView = _ref.editorView,
69
- items = _ref.items,
70
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
69
+ items = _ref.items;
71
70
  var ref = useRef(document.createElement('span'));
72
71
  var inputRef = useRef(null);
73
72
  var _useState = useState(null),
@@ -140,27 +139,6 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
140
139
  // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
141
140
  if (!event.isComposing && event.which !== 229 && event.keyCode !== 229) {
142
141
  if (selectedIndex === -1) {
143
- if (useBetterTypeaheadNavigation) {
144
- /**
145
- * TODO DTR-1401: (also see ED-17200) There are two options
146
- * here, either
147
- * - set the index directly to 1 in WrapperTypeAhead.tsx's
148
- * `insertSelectedItem` at the cost of breaking some of the a11y
149
- * focus changes,
150
- * - or do this jank at the cost of some small analytics noise.
151
- *
152
- * The focus behaviour still needs cleanup
153
- */
154
- selectPreviousItem();
155
- }
156
- selectNextItem();
157
- }
158
- onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
159
- }
160
- break;
161
- case 'Tab':
162
- if (selectedIndex === -1) {
163
- if (useBetterTypeaheadNavigation) {
164
142
  /**
165
143
  * TODO DTR-1401: (also see ED-17200) There are two options
166
144
  * here, either
@@ -169,33 +147,36 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
169
147
  * focus changes,
170
148
  * - or do this jank at the cost of some small analytics noise.
171
149
  *
150
+ * The focus behaviour still needs cleanup
172
151
  */
173
152
  selectPreviousItem();
153
+ selectNextItem();
174
154
  }
155
+ onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
156
+ }
157
+ break;
158
+ case 'Tab':
159
+ if (selectedIndex === -1) {
160
+ /**
161
+ * TODO DTR-1401: (also see ED-17200) There are two options
162
+ * here, either
163
+ * - set the index directly to 1 in WrapperTypeAhead.tsx's
164
+ * `insertSelectedItem` at the cost of breaking some of the a11y
165
+ * focus changes,
166
+ * - or do this jank at the cost of some small analytics noise.
167
+ *
168
+ */
169
+ selectPreviousItem();
175
170
  selectNextItem();
176
171
  }
177
172
  // TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
178
173
  onItemSelect(SelectItemMode.TAB);
179
174
  break;
180
175
  case 'ArrowDown':
181
- if (useBetterTypeaheadNavigation) {
182
- selectNextItem();
183
- } else {
184
- // TODO DTR-1401: why were we preventing selection?
185
- if (selectedIndex === -1) {
186
- selectNextItem();
187
- }
188
- }
176
+ selectNextItem();
189
177
  break;
190
178
  case 'ArrowUp':
191
- if (useBetterTypeaheadNavigation) {
192
- selectPreviousItem();
193
- } else {
194
- // TODO DTR-1401: why were we preventing selection?
195
- if (selectedIndex === -1) {
196
- selectPreviousItem();
197
- }
198
- }
179
+ selectPreviousItem();
199
180
  break;
200
181
  }
201
182
  var undoRedoType = isUndoRedoShortcut(event);
@@ -207,7 +188,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
207
188
  event.preventDefault();
208
189
  return false;
209
190
  }
210
- }, [useBetterTypeaheadNavigation, onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
191
+ }, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
211
192
  var onClick = useCallback(function (event) {
212
193
  var _inputRef$current;
213
194
  event.stopPropagation();
@@ -19,8 +19,7 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
19
19
  inputMethod = _ref.inputMethod,
20
20
  getDecorationPosition = _ref.getDecorationPosition,
21
21
  reopenQuery = _ref.reopenQuery,
22
- onUndoRedo = _ref.onUndoRedo,
23
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
22
+ onUndoRedo = _ref.onUndoRedo;
24
23
  var _useState = useState(false),
25
24
  _useState2 = _slicedToArray(_useState, 2),
26
25
  closed = _useState2[0],
@@ -42,17 +41,15 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
42
41
  var selectNextItem = useMemo(function () {
43
42
  return moveSelectedIndex({
44
43
  editorView: editorView,
45
- direction: 'next',
46
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
44
+ direction: 'next'
47
45
  });
48
- }, [editorView, useBetterTypeaheadNavigation]);
46
+ }, [editorView]);
49
47
  var selectPreviousItem = useMemo(function () {
50
48
  return moveSelectedIndex({
51
49
  editorView: editorView,
52
- direction: 'previous',
53
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
50
+ direction: 'previous'
54
51
  });
55
- }, [editorView, useBetterTypeaheadNavigation]);
52
+ }, [editorView]);
56
53
  var cancel = useCallback(function (_ref2) {
57
54
  var setSelectionAt = _ref2.setSelectionAt,
58
55
  addPrefixTrigger = _ref2.addPrefixTrigger,
@@ -103,7 +100,6 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
103
100
  return null;
104
101
  }
105
102
  return /*#__PURE__*/React.createElement(InputQuery, {
106
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
107
103
  triggerQueryPrefix: triggerHandler.trigger,
108
104
  onQueryChange: setQuery,
109
105
  onItemSelect: insertSelectedItem,
@@ -53,8 +53,7 @@ export var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
53
53
  };
54
54
  export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
55
55
  var editorView = _ref2.editorView,
56
- direction = _ref2.direction,
57
- useBetterTypeaheadNavigation = _ref2.useBetterTypeaheadNavigation;
56
+ direction = _ref2.direction;
58
57
  return function () {
59
58
  var typeAheadState = getPluginState(editorView.state);
60
59
  if (!typeAheadState) {
@@ -66,23 +65,20 @@ export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
66
65
  var nextIndex;
67
66
  if (direction === 'next') {
68
67
  stats.increaseArrowDown();
69
- if (useBetterTypeaheadNavigation) {
70
- /**
71
- * See: https://product-fabric.atlassian.net/browse/ED-17200
72
- * `selectedIndex` is forced to -1 now to not immediately focus the typeahead
73
- * and only do so when there is explicit logic to focus into the typeahead
74
- * options.
75
- *
76
- * This check for "set index to 1 when -1"
77
- * - is a temporary workaround to get back the previous behaviour without
78
- * entirely reverting the a11y improvements
79
- *
80
- */
81
- if (selectedIndex === -1 && items.length > 1) {
82
- nextIndex = 1;
83
- } else {
84
- nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
85
- }
68
+
69
+ /**
70
+ * See: https://product-fabric.atlassian.net/browse/ED-17200
71
+ * `selectedIndex` is forced to -1 now to not immediately focus the typeahead
72
+ * and only do so when there is explicit logic to focus into the typeahead
73
+ * options.
74
+ *
75
+ * This check for "set index to 1 when -1"
76
+ * - is a temporary workaround to get back the previous behaviour without
77
+ * entirely reverting the a11y improvements
78
+ *
79
+ */
80
+ if (selectedIndex === -1 && items.length > 1) {
81
+ nextIndex = 1;
86
82
  } else {
87
83
  nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
88
84
  }
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.15.0";
2
+ export var version = "187.15.1";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.15.0",
3
+ "version": "187.15.1",
4
4
  "sideEffects": false
5
5
  }