@atlaskit/editor-plugin-type-ahead 3.0.1 → 3.0.3

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,20 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 3.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#183158](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/183158)
8
+ [`d6096ec5c8ad9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d6096ec5c8ad9) -
9
+ Migrate to useSharedPluginStateWithSelector
10
+ - Updated dependencies
11
+
12
+ ## 3.0.2
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 3.0.1
4
19
 
5
20
  ### Patch Changes
@@ -8,18 +8,29 @@ exports.ContentComponent = ContentComponent;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _hooks = require("@atlaskit/editor-common/hooks");
10
10
  var _typeAhead = require("@atlaskit/editor-common/type-ahead");
11
- var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
12
11
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
13
12
  var _TypeAheadMenu = require("./modern/TypeAheadMenu");
14
13
  var _TypeAheadMenu2 = require("./TypeAheadMenu");
15
14
  var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
16
- var triggerHandler = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'typeAhead.triggerHandler');
17
- var errorInfo = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'typeAhead.errorInfo');
18
- var decorationElement = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'typeAhead.decorationElement');
19
- var decorationSet = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'typeAhead.decorationSet');
20
- var query = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'typeAhead.query');
21
- var selectedIndex = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'typeAhead.selectedIndex');
22
- var items = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'typeAhead.items');
15
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['typeAhead'], function (states) {
16
+ var _states$typeAheadStat, _states$typeAheadStat2, _states$typeAheadStat3, _states$typeAheadStat4, _states$typeAheadStat5, _states$typeAheadStat6, _states$typeAheadStat7;
17
+ return {
18
+ triggerHandler: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.triggerHandler,
19
+ items: (_states$typeAheadStat2 = states.typeAheadState) === null || _states$typeAheadStat2 === void 0 ? void 0 : _states$typeAheadStat2.items,
20
+ errorInfo: (_states$typeAheadStat3 = states.typeAheadState) === null || _states$typeAheadStat3 === void 0 ? void 0 : _states$typeAheadStat3.errorInfo,
21
+ decorationElement: (_states$typeAheadStat4 = states.typeAheadState) === null || _states$typeAheadStat4 === void 0 ? void 0 : _states$typeAheadStat4.decorationElement,
22
+ decorationSet: (_states$typeAheadStat5 = states.typeAheadState) === null || _states$typeAheadStat5 === void 0 ? void 0 : _states$typeAheadStat5.decorationSet,
23
+ query: (_states$typeAheadStat6 = states.typeAheadState) === null || _states$typeAheadStat6 === void 0 ? void 0 : _states$typeAheadStat6.query,
24
+ selectedIndex: (_states$typeAheadStat7 = states.typeAheadState) === null || _states$typeAheadStat7 === void 0 ? void 0 : _states$typeAheadStat7.selectedIndex
25
+ };
26
+ }),
27
+ triggerHandler = _useSharedPluginState.triggerHandler,
28
+ items = _useSharedPluginState.items,
29
+ errorInfo = _useSharedPluginState.errorInfo,
30
+ decorationElement = _useSharedPluginState.decorationElement,
31
+ decorationSet = _useSharedPluginState.decorationSet,
32
+ query = _useSharedPluginState.query,
33
+ selectedIndex = _useSharedPluginState.selectedIndex;
23
34
  return {
24
35
  triggerHandler: triggerHandler,
25
36
  items: items,
@@ -30,8 +41,8 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
30
41
  selectedIndex: selectedIndex
31
42
  };
32
43
  }, function (api) {
33
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['typeAhead']),
34
- typeAheadState = _useSharedPluginState.typeAheadState;
44
+ var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['typeAhead']),
45
+ typeAheadState = _useSharedPluginState2.typeAheadState;
35
46
  return {
36
47
  triggerHandler: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.triggerHandler,
37
48
  items: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.items,
@@ -13,7 +13,6 @@ var _reactIntlNext = require("react-intl-next");
13
13
  var _hooks = require("@atlaskit/editor-common/hooks");
14
14
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
15
15
  var _typeAhead = require("@atlaskit/editor-common/type-ahead");
16
- var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
17
16
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
18
17
  var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
19
18
  var _menu = require("@atlaskit/menu");
@@ -159,13 +158,19 @@ var CustomItemComponentWrapper = /*#__PURE__*/_react.default.memo(function (prop
159
158
  })));
160
159
  });
161
160
  var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
162
- var connectivityMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'connectivity.mode');
161
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['connectivity'], function (states) {
162
+ var _states$connectivityS;
163
+ return {
164
+ mode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
165
+ };
166
+ }),
167
+ mode = _useSharedPluginState.mode;
163
168
  return {
164
- connectivityMode: connectivityMode
169
+ connectivityMode: mode
165
170
  };
166
171
  }, function (api) {
167
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['connectivity']),
168
- connectivityState = _useSharedPluginState.connectivityState;
172
+ var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['connectivity']),
173
+ connectivityState = _useSharedPluginState2.connectivityState;
169
174
  return {
170
175
  connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode
171
176
  };
@@ -14,7 +14,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
14
14
  var _hooks = require("@atlaskit/editor-common/hooks");
15
15
  var _typeAhead = require("@atlaskit/editor-common/type-ahead");
16
16
  var _ui = require("@atlaskit/editor-common/ui");
17
- var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
18
17
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
19
18
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
19
  var _colors = require("@atlaskit/theme/colors");
@@ -64,13 +63,19 @@ var Highlight = function Highlight(_ref) {
64
63
  };
65
64
  var OFFSET = [0, 8];
66
65
  var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
67
- var moreElementsInQuickInsertView = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'featureFlags.moreElementsInQuickInsertView');
66
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['featureFlags'], function (states) {
67
+ var _states$featureFlagsS;
68
+ return {
69
+ moreElementsInQuickInsertView: (_states$featureFlagsS = states.featureFlagsState) === null || _states$featureFlagsS === void 0 ? void 0 : _states$featureFlagsS.moreElementsInQuickInsertView
70
+ };
71
+ }),
72
+ moreElementsInQuickInsertView = _useSharedPluginState.moreElementsInQuickInsertView;
68
73
  return {
69
74
  moreElementsInQuickInsertView: moreElementsInQuickInsertView
70
75
  };
71
76
  }, function (api) {
72
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['featureFlags']),
73
- featureFlagsState = _useSharedPluginState.featureFlagsState;
77
+ var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['featureFlags']),
78
+ featureFlagsState = _useSharedPluginState2.featureFlagsState;
74
79
  return {
75
80
  moreElementsInQuickInsertView: featureFlagsState === null || featureFlagsState === void 0 ? void 0 : featureFlagsState.moreElementsInQuickInsertView
76
81
  };
@@ -1,18 +1,30 @@
1
1
  import React from 'react';
2
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
2
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
4
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
5
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
5
  import { TypeAheadMenu as TypeAheadMenuModern } from './modern/TypeAheadMenu';
7
6
  import { TypeAheadMenu } from './TypeAheadMenu';
8
7
  const useSharedState = sharedPluginStateHookMigratorFactory(api => {
9
- const triggerHandler = useSharedPluginStateSelector(api, 'typeAhead.triggerHandler');
10
- const errorInfo = useSharedPluginStateSelector(api, 'typeAhead.errorInfo');
11
- const decorationElement = useSharedPluginStateSelector(api, 'typeAhead.decorationElement');
12
- const decorationSet = useSharedPluginStateSelector(api, 'typeAhead.decorationSet');
13
- const query = useSharedPluginStateSelector(api, 'typeAhead.query');
14
- const selectedIndex = useSharedPluginStateSelector(api, 'typeAhead.selectedIndex');
15
- const items = useSharedPluginStateSelector(api, 'typeAhead.items');
8
+ const {
9
+ triggerHandler,
10
+ items,
11
+ errorInfo,
12
+ decorationElement,
13
+ decorationSet,
14
+ query,
15
+ selectedIndex
16
+ } = useSharedPluginStateWithSelector(api, ['typeAhead'], states => {
17
+ var _states$typeAheadStat, _states$typeAheadStat2, _states$typeAheadStat3, _states$typeAheadStat4, _states$typeAheadStat5, _states$typeAheadStat6, _states$typeAheadStat7;
18
+ return {
19
+ triggerHandler: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.triggerHandler,
20
+ items: (_states$typeAheadStat2 = states.typeAheadState) === null || _states$typeAheadStat2 === void 0 ? void 0 : _states$typeAheadStat2.items,
21
+ errorInfo: (_states$typeAheadStat3 = states.typeAheadState) === null || _states$typeAheadStat3 === void 0 ? void 0 : _states$typeAheadStat3.errorInfo,
22
+ decorationElement: (_states$typeAheadStat4 = states.typeAheadState) === null || _states$typeAheadStat4 === void 0 ? void 0 : _states$typeAheadStat4.decorationElement,
23
+ decorationSet: (_states$typeAheadStat5 = states.typeAheadState) === null || _states$typeAheadStat5 === void 0 ? void 0 : _states$typeAheadStat5.decorationSet,
24
+ query: (_states$typeAheadStat6 = states.typeAheadState) === null || _states$typeAheadStat6 === void 0 ? void 0 : _states$typeAheadStat6.query,
25
+ selectedIndex: (_states$typeAheadStat7 = states.typeAheadState) === null || _states$typeAheadStat7 === void 0 ? void 0 : _states$typeAheadStat7.selectedIndex
26
+ };
27
+ });
16
28
  return {
17
29
  triggerHandler,
18
30
  items,
@@ -7,10 +7,9 @@ import React, { useCallback, useLayoutEffect, useMemo } from 'react';
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import { useIntl } from 'react-intl-next';
10
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
10
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
11
11
  import { IconFallback } from '@atlaskit/editor-common/quick-insert';
12
12
  import { SelectItemMode, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
13
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
14
13
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
15
14
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
16
15
  import { ButtonItem } from '@atlaskit/menu';
@@ -169,9 +168,16 @@ const CustomItemComponentWrapper = /*#__PURE__*/React.memo(props => {
169
168
  })));
170
169
  });
171
170
  const useSharedState = sharedPluginStateHookMigratorFactory(api => {
172
- const connectivityMode = useSharedPluginStateSelector(api, 'connectivity.mode');
171
+ const {
172
+ mode
173
+ } = useSharedPluginStateWithSelector(api, ['connectivity'], states => {
174
+ var _states$connectivityS;
175
+ return {
176
+ mode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
177
+ };
178
+ });
173
179
  return {
174
- connectivityMode
180
+ connectivityMode: mode
175
181
  };
176
182
  }, api => {
177
183
  const {
@@ -8,10 +8,9 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSta
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import rafSchedule from 'raf-schd';
10
10
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
11
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
11
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
12
12
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
13
13
  import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
14
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
15
14
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
16
15
  import { fg } from '@atlaskit/platform-feature-flags';
17
16
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
@@ -54,7 +53,14 @@ const Highlight = ({
54
53
  };
55
54
  const OFFSET = [0, 8];
56
55
  const useSharedState = sharedPluginStateHookMigratorFactory(api => {
57
- const moreElementsInQuickInsertView = useSharedPluginStateSelector(api, 'featureFlags.moreElementsInQuickInsertView');
56
+ const {
57
+ moreElementsInQuickInsertView
58
+ } = useSharedPluginStateWithSelector(api, ['featureFlags'], states => {
59
+ var _states$featureFlagsS;
60
+ return {
61
+ moreElementsInQuickInsertView: (_states$featureFlagsS = states.featureFlagsState) === null || _states$featureFlagsS === void 0 ? void 0 : _states$featureFlagsS.moreElementsInQuickInsertView
62
+ };
63
+ });
58
64
  return {
59
65
  moreElementsInQuickInsertView
60
66
  };
@@ -1,18 +1,29 @@
1
1
  import React from 'react';
2
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
2
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
4
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
5
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
5
  import { TypeAheadMenu as TypeAheadMenuModern } from './modern/TypeAheadMenu';
7
6
  import { TypeAheadMenu } from './TypeAheadMenu';
8
7
  var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
9
- var triggerHandler = useSharedPluginStateSelector(api, 'typeAhead.triggerHandler');
10
- var errorInfo = useSharedPluginStateSelector(api, 'typeAhead.errorInfo');
11
- var decorationElement = useSharedPluginStateSelector(api, 'typeAhead.decorationElement');
12
- var decorationSet = useSharedPluginStateSelector(api, 'typeAhead.decorationSet');
13
- var query = useSharedPluginStateSelector(api, 'typeAhead.query');
14
- var selectedIndex = useSharedPluginStateSelector(api, 'typeAhead.selectedIndex');
15
- var items = useSharedPluginStateSelector(api, 'typeAhead.items');
8
+ var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['typeAhead'], function (states) {
9
+ var _states$typeAheadStat, _states$typeAheadStat2, _states$typeAheadStat3, _states$typeAheadStat4, _states$typeAheadStat5, _states$typeAheadStat6, _states$typeAheadStat7;
10
+ return {
11
+ triggerHandler: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.triggerHandler,
12
+ items: (_states$typeAheadStat2 = states.typeAheadState) === null || _states$typeAheadStat2 === void 0 ? void 0 : _states$typeAheadStat2.items,
13
+ errorInfo: (_states$typeAheadStat3 = states.typeAheadState) === null || _states$typeAheadStat3 === void 0 ? void 0 : _states$typeAheadStat3.errorInfo,
14
+ decorationElement: (_states$typeAheadStat4 = states.typeAheadState) === null || _states$typeAheadStat4 === void 0 ? void 0 : _states$typeAheadStat4.decorationElement,
15
+ decorationSet: (_states$typeAheadStat5 = states.typeAheadState) === null || _states$typeAheadStat5 === void 0 ? void 0 : _states$typeAheadStat5.decorationSet,
16
+ query: (_states$typeAheadStat6 = states.typeAheadState) === null || _states$typeAheadStat6 === void 0 ? void 0 : _states$typeAheadStat6.query,
17
+ selectedIndex: (_states$typeAheadStat7 = states.typeAheadState) === null || _states$typeAheadStat7 === void 0 ? void 0 : _states$typeAheadStat7.selectedIndex
18
+ };
19
+ }),
20
+ triggerHandler = _useSharedPluginState.triggerHandler,
21
+ items = _useSharedPluginState.items,
22
+ errorInfo = _useSharedPluginState.errorInfo,
23
+ decorationElement = _useSharedPluginState.decorationElement,
24
+ decorationSet = _useSharedPluginState.decorationSet,
25
+ query = _useSharedPluginState.query,
26
+ selectedIndex = _useSharedPluginState.selectedIndex;
16
27
  return {
17
28
  triggerHandler: triggerHandler,
18
29
  items: items,
@@ -23,8 +34,8 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
23
34
  selectedIndex: selectedIndex
24
35
  };
25
36
  }, function (api) {
26
- var _useSharedPluginState = useSharedPluginState(api, ['typeAhead']),
27
- typeAheadState = _useSharedPluginState.typeAheadState;
37
+ var _useSharedPluginState2 = useSharedPluginState(api, ['typeAhead']),
38
+ typeAheadState = _useSharedPluginState2.typeAheadState;
28
39
  return {
29
40
  triggerHandler: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.triggerHandler,
30
41
  items: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.items,
@@ -9,10 +9,9 @@ import React, { useCallback, useLayoutEffect, useMemo } from 'react';
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
11
11
  import { useIntl } from 'react-intl-next';
12
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
12
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
13
13
  import { IconFallback } from '@atlaskit/editor-common/quick-insert';
14
14
  import { SelectItemMode, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
15
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
16
15
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
17
16
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
18
17
  import { ButtonItem } from '@atlaskit/menu';
@@ -151,13 +150,19 @@ var CustomItemComponentWrapper = /*#__PURE__*/React.memo(function (props) {
151
150
  })));
152
151
  });
153
152
  var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
154
- var connectivityMode = useSharedPluginStateSelector(api, 'connectivity.mode');
153
+ var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['connectivity'], function (states) {
154
+ var _states$connectivityS;
155
+ return {
156
+ mode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
157
+ };
158
+ }),
159
+ mode = _useSharedPluginState.mode;
155
160
  return {
156
- connectivityMode: connectivityMode
161
+ connectivityMode: mode
157
162
  };
158
163
  }, function (api) {
159
- var _useSharedPluginState = useSharedPluginState(api, ['connectivity']),
160
- connectivityState = _useSharedPluginState.connectivityState;
164
+ var _useSharedPluginState2 = useSharedPluginState(api, ['connectivity']),
165
+ connectivityState = _useSharedPluginState2.connectivityState;
161
166
  return {
162
167
  connectivityMode: connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode
163
168
  };
@@ -9,10 +9,9 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSta
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import rafSchedule from 'raf-schd';
11
11
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
12
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
12
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
13
13
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
14
14
  import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
15
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
16
15
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
17
16
  import { fg } from '@atlaskit/platform-feature-flags';
18
17
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
@@ -54,13 +53,19 @@ var Highlight = function Highlight(_ref) {
54
53
  };
55
54
  var OFFSET = [0, 8];
56
55
  var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
57
- var moreElementsInQuickInsertView = useSharedPluginStateSelector(api, 'featureFlags.moreElementsInQuickInsertView');
56
+ var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['featureFlags'], function (states) {
57
+ var _states$featureFlagsS;
58
+ return {
59
+ moreElementsInQuickInsertView: (_states$featureFlagsS = states.featureFlagsState) === null || _states$featureFlagsS === void 0 ? void 0 : _states$featureFlagsS.moreElementsInQuickInsertView
60
+ };
61
+ }),
62
+ moreElementsInQuickInsertView = _useSharedPluginState.moreElementsInQuickInsertView;
58
63
  return {
59
64
  moreElementsInQuickInsertView: moreElementsInQuickInsertView
60
65
  };
61
66
  }, function (api) {
62
- var _useSharedPluginState = useSharedPluginState(api, ['featureFlags']),
63
- featureFlagsState = _useSharedPluginState.featureFlagsState;
67
+ var _useSharedPluginState2 = useSharedPluginState(api, ['featureFlags']),
68
+ featureFlagsState = _useSharedPluginState2.featureFlagsState;
64
69
  return {
65
70
  moreElementsInQuickInsertView: featureFlagsState === null || featureFlagsState === void 0 ? void 0 : featureFlagsState.moreElementsInQuickInsertView
66
71
  };
@@ -30,7 +30,7 @@ export declare const createTypeAheadTools: (editorView: EditorView) => {
30
30
  close: (options?: CloseOptions) => boolean;
31
31
  insert: ({ index, mode }: {
32
32
  index: number;
33
- mode?: SelectItemMode;
33
+ mode?: SelectItemMode | undefined;
34
34
  }) => Promise<void>;
35
35
  };
36
36
  openQuickInsert: (inputMethod: TypeAheadInputMethod) => boolean;
@@ -40,7 +40,7 @@ export declare const createTypeAheadTools: (editorView: EditorView) => {
40
40
  close: (options?: CloseOptions) => boolean;
41
41
  insert: ({ index, mode }: {
42
42
  index: number;
43
- mode?: SelectItemMode;
43
+ mode?: SelectItemMode | undefined;
44
44
  }) => Promise<void>;
45
45
  };
46
46
  openEmoji: (inputMethod: TypeAheadInputMethod) => boolean;
@@ -50,7 +50,7 @@ export declare const createTypeAheadTools: (editorView: EditorView) => {
50
50
  close: (options?: CloseOptions) => boolean;
51
51
  insert: ({ index, mode }: {
52
52
  index: number;
53
- mode?: SelectItemMode;
53
+ mode?: SelectItemMode | undefined;
54
54
  }) => Promise<void>;
55
55
  };
56
56
  insertItemMention: ({ contentItem, query, sourceListItem }: InsertItemProps) => boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { jsx } from '@emotion/react';
2
3
  type Props = {
3
4
  onClick: () => void;
@@ -17,11 +17,11 @@ export declare const TypeAheadList: React.FC<import("react-intl-next").WithIntlP
17
17
  onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
18
18
  fitHeight: number;
19
19
  decorationElement: HTMLElement;
20
- triggerHandler?: TypeAheadHandler;
21
- moreElementsInQuickInsertViewEnabled?: boolean;
20
+ triggerHandler?: TypeAheadHandler | undefined;
21
+ moreElementsInQuickInsertViewEnabled?: boolean | undefined;
22
22
  api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
23
- showMoreOptionsButton?: boolean;
24
- onMoreOptionsClicked?: () => void;
23
+ showMoreOptionsButton?: boolean | undefined;
24
+ onMoreOptionsClicked?: (() => void) | undefined;
25
25
  } & WrappedComponentProps>> & {
26
26
  WrappedComponent: React.ComponentType<{
27
27
  items: Array<TypeAheadItem>;
@@ -30,10 +30,10 @@ export declare const TypeAheadList: React.FC<import("react-intl-next").WithIntlP
30
30
  onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
31
31
  fitHeight: number;
32
32
  decorationElement: HTMLElement;
33
- triggerHandler?: TypeAheadHandler;
34
- moreElementsInQuickInsertViewEnabled?: boolean;
33
+ triggerHandler?: TypeAheadHandler | undefined;
34
+ moreElementsInQuickInsertViewEnabled?: boolean | undefined;
35
35
  api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
36
- showMoreOptionsButton?: boolean;
37
- onMoreOptionsClicked?: () => void;
36
+ showMoreOptionsButton?: boolean | undefined;
37
+ onMoreOptionsClicked?: (() => void) | undefined;
38
38
  } & WrappedComponentProps>;
39
39
  };
@@ -30,7 +30,7 @@ export declare const createTypeAheadTools: (editorView: EditorView) => {
30
30
  close: (options?: CloseOptions) => boolean;
31
31
  insert: ({ index, mode }: {
32
32
  index: number;
33
- mode?: SelectItemMode;
33
+ mode?: SelectItemMode | undefined;
34
34
  }) => Promise<void>;
35
35
  };
36
36
  openQuickInsert: (inputMethod: TypeAheadInputMethod) => boolean;
@@ -40,7 +40,7 @@ export declare const createTypeAheadTools: (editorView: EditorView) => {
40
40
  close: (options?: CloseOptions) => boolean;
41
41
  insert: ({ index, mode }: {
42
42
  index: number;
43
- mode?: SelectItemMode;
43
+ mode?: SelectItemMode | undefined;
44
44
  }) => Promise<void>;
45
45
  };
46
46
  openEmoji: (inputMethod: TypeAheadInputMethod) => boolean;
@@ -50,7 +50,7 @@ export declare const createTypeAheadTools: (editorView: EditorView) => {
50
50
  close: (options?: CloseOptions) => boolean;
51
51
  insert: ({ index, mode }: {
52
52
  index: number;
53
- mode?: SelectItemMode;
53
+ mode?: SelectItemMode | undefined;
54
54
  }) => Promise<void>;
55
55
  };
56
56
  insertItemMention: ({ contentItem, query, sourceListItem }: InsertItemProps) => boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { jsx } from '@emotion/react';
2
3
  type Props = {
3
4
  onClick: () => void;
@@ -17,11 +17,11 @@ export declare const TypeAheadList: React.FC<import("react-intl-next").WithIntlP
17
17
  onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
18
18
  fitHeight: number;
19
19
  decorationElement: HTMLElement;
20
- triggerHandler?: TypeAheadHandler;
21
- moreElementsInQuickInsertViewEnabled?: boolean;
20
+ triggerHandler?: TypeAheadHandler | undefined;
21
+ moreElementsInQuickInsertViewEnabled?: boolean | undefined;
22
22
  api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
23
- showMoreOptionsButton?: boolean;
24
- onMoreOptionsClicked?: () => void;
23
+ showMoreOptionsButton?: boolean | undefined;
24
+ onMoreOptionsClicked?: (() => void) | undefined;
25
25
  } & WrappedComponentProps>> & {
26
26
  WrappedComponent: React.ComponentType<{
27
27
  items: Array<TypeAheadItem>;
@@ -30,10 +30,10 @@ export declare const TypeAheadList: React.FC<import("react-intl-next").WithIntlP
30
30
  onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
31
31
  fitHeight: number;
32
32
  decorationElement: HTMLElement;
33
- triggerHandler?: TypeAheadHandler;
34
- moreElementsInQuickInsertViewEnabled?: boolean;
33
+ triggerHandler?: TypeAheadHandler | undefined;
34
+ moreElementsInQuickInsertViewEnabled?: boolean | undefined;
35
35
  api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
36
- showMoreOptionsButton?: boolean;
37
- onMoreOptionsClicked?: () => void;
36
+ showMoreOptionsButton?: boolean | undefined;
37
+ onMoreOptionsClicked?: (() => void) | undefined;
38
38
  } & WrappedComponentProps>;
39
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -41,13 +41,13 @@
41
41
  "@atlaskit/editor-prosemirror": "7.0.0",
42
42
  "@atlaskit/editor-shared-styles": "^3.4.0",
43
43
  "@atlaskit/heading": "^5.2.0",
44
- "@atlaskit/icon": "^27.2.0",
44
+ "@atlaskit/icon": "^27.3.0",
45
45
  "@atlaskit/menu": "^8.0.0",
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
47
  "@atlaskit/primitives": "^14.10.0",
48
48
  "@atlaskit/prosemirror-input-rules": "^3.3.0",
49
- "@atlaskit/theme": "^18.0.0",
50
- "@atlaskit/tmp-editor-statsig": "^8.8.0",
49
+ "@atlaskit/theme": "^19.0.0",
50
+ "@atlaskit/tmp-editor-statsig": "^9.1.0",
51
51
  "@atlaskit/tokens": "^5.4.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@emotion/react": "^11.7.1",