@atlaskit/editor-plugin-type-ahead 3.0.2 → 3.0.4
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 +18 -0
- package/dist/cjs/ui/ContentComponent.js +21 -10
- package/dist/cjs/ui/TypeAheadErrorFallback/EmptyState.js +2 -0
- package/dist/cjs/ui/TypeAheadListItem.js +10 -5
- package/dist/cjs/ui/TypeAheadPopup.js +9 -4
- package/dist/es2019/ui/ContentComponent.js +21 -9
- package/dist/es2019/ui/TypeAheadErrorFallback/EmptyState.js +1 -0
- package/dist/es2019/ui/TypeAheadListItem.js +10 -4
- package/dist/es2019/ui/TypeAheadPopup.js +9 -3
- package/dist/esm/ui/ContentComponent.js +22 -11
- package/dist/esm/ui/TypeAheadErrorFallback/EmptyState.js +1 -0
- package/dist/esm/ui/TypeAheadListItem.js +11 -6
- package/dist/esm/ui/TypeAheadPopup.js +10 -5
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 3.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#187144](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/187144)
|
|
8
|
+
[`a16147d8fbdfe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a16147d8fbdfe) -
|
|
9
|
+
Bump @atlaskit/adf-schema to v49.0.5
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.0.3
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#183158](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/183158)
|
|
17
|
+
[`d6096ec5c8ad9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d6096ec5c8ad9) -
|
|
18
|
+
Migrate to useSharedPluginStateWithSelector
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 3.0.2
|
|
4
22
|
|
|
5
23
|
### 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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
34
|
-
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,
|
|
@@ -8,6 +8,8 @@ exports.EmptyState = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
10
10
|
var _primitives = require("@atlaskit/primitives");
|
|
11
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
12
|
+
|
|
11
13
|
var containerStyles = (0, _primitives.xcss)({
|
|
12
14
|
marginBlockStart: 'space.600',
|
|
13
15
|
marginBlockEnd: 'space.600',
|
|
@@ -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
|
|
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:
|
|
169
|
+
connectivityMode: mode
|
|
165
170
|
};
|
|
166
171
|
}, function (api) {
|
|
167
|
-
var
|
|
168
|
-
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
|
|
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
|
|
73
|
-
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Heading from '@atlaskit/heading';
|
|
3
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
3
4
|
import { Flex, Text, xcss } from '@atlaskit/primitives';
|
|
4
5
|
const containerStyles = xcss({
|
|
5
6
|
marginBlockStart: 'space.600',
|
|
@@ -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
|
|
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
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
27
|
-
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,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Heading from '@atlaskit/heading';
|
|
3
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
3
4
|
import { Flex, Text, xcss } from '@atlaskit/primitives';
|
|
4
5
|
var containerStyles = xcss({
|
|
5
6
|
marginBlockStart: 'space.600',
|
|
@@ -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
|
|
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:
|
|
161
|
+
connectivityMode: mode
|
|
157
162
|
};
|
|
158
163
|
}, function (api) {
|
|
159
|
-
var
|
|
160
|
-
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
|
|
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
|
|
63
|
-
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
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^
|
|
35
|
+
"@atlaskit/adf-schema": "^49.0.6",
|
|
36
36
|
"@atlaskit/editor-element-browser": "^1.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-connectivity": "^3.0.0",
|
|
@@ -46,9 +46,9 @@
|
|
|
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": "^
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
51
|
-
"@atlaskit/tokens": "^5.
|
|
49
|
+
"@atlaskit/theme": "^19.0.0",
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^9.7.0",
|
|
51
|
+
"@atlaskit/tokens": "^5.5.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@emotion/react": "^11.7.1",
|
|
54
54
|
"lodash": "^4.17.21",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"w3c-keyname": "^2.1.8"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@atlaskit/editor-common": "^107.
|
|
61
|
+
"@atlaskit/editor-common": "^107.8.0",
|
|
62
62
|
"react": "^18.2.0",
|
|
63
63
|
"react-dom": "^18.2.0",
|
|
64
64
|
"react-intl-next": "npm:react-intl@^5.18.1"
|