@atlaskit/editor-plugin-type-ahead 6.5.25 → 6.6.0
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 +17 -0
- package/dist/cjs/pm-plugins/item-is-disabled.js +2 -1
- package/dist/cjs/ui/TypeAheadListItem.js +3 -2
- package/dist/es2019/pm-plugins/item-is-disabled.js +2 -1
- package/dist/es2019/ui/TypeAheadListItem.js +3 -2
- package/dist/esm/pm-plugins/item-is-disabled.js +2 -1
- package/dist/esm/ui/TypeAheadListItem.js +3 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 6.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`82d57d01a0f61`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/82d57d01a0f61) -
|
|
8
|
+
Distinguish between collab offline and internet offline cases for connectivity mode
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 6.5.26
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 6.5.25
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.itemIsDisabled = void 0;
|
|
7
|
+
var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
7
8
|
var itemIsDisabled = exports.itemIsDisabled = function itemIsDisabled(item, api) {
|
|
8
9
|
var _api$connectivity;
|
|
9
|
-
var isOffline = (api === null || api === void 0 || (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.sharedState.currentState()) === null || _api$connectivity === void 0 ? void 0 : _api$connectivity.mode)
|
|
10
|
+
var isOffline = (0, _editorPluginConnectivity.isOfflineMode)(api === null || api === void 0 || (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.sharedState.currentState()) === null || _api$connectivity === void 0 ? void 0 : _api$connectivity.mode);
|
|
10
11
|
return isOffline && (item === null || item === void 0 ? void 0 : item.isDisabledOffline) === true;
|
|
11
12
|
};
|
|
@@ -13,6 +13,7 @@ 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 _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
16
17
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
18
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
18
19
|
var _menu = require("@atlaskit/menu");
|
|
@@ -177,10 +178,10 @@ var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.
|
|
|
177
178
|
connectivityMode = _useSharedPluginState.connectivityMode;
|
|
178
179
|
var isItemDisabled = function isItemDisabled(item) {
|
|
179
180
|
var _item$isDisabledOffli;
|
|
180
|
-
return connectivityMode
|
|
181
|
+
return (0, _editorPluginConnectivity.isOfflineMode)(connectivityMode) && ((_item$isDisabledOffli = item === null || item === void 0 ? void 0 : item.isDisabledOffline) !== null && _item$isDisabledOffli !== void 0 ? _item$isDisabledOffli : false);
|
|
181
182
|
};
|
|
182
183
|
var itemIsDisabled = isItemDisabled(item);
|
|
183
|
-
var isFirstEnabledIndex = connectivityMode
|
|
184
|
+
var isFirstEnabledIndex = (0, _editorPluginConnectivity.isOfflineMode)(connectivityMode) && itemIndex === firstOnlineSupportedIndex && selectedIndex === -1;
|
|
184
185
|
|
|
185
186
|
/**
|
|
186
187
|
* To select and highlight the first Item when no item is selected
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
1
2
|
export const itemIsDisabled = (item, api) => {
|
|
2
3
|
var _api$connectivity, _api$connectivity$sha;
|
|
3
|
-
const isOffline = (api === null || api === void 0 ? void 0 : (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 ? void 0 : (_api$connectivity$sha = _api$connectivity.sharedState.currentState()) === null || _api$connectivity$sha === void 0 ? void 0 : _api$connectivity$sha.mode)
|
|
4
|
+
const isOffline = isOfflineMode(api === null || api === void 0 ? void 0 : (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 ? void 0 : (_api$connectivity$sha = _api$connectivity.sharedState.currentState()) === null || _api$connectivity$sha === void 0 ? void 0 : _api$connectivity$sha.mode);
|
|
4
5
|
return isOffline && (item === null || item === void 0 ? void 0 : item.isDisabledOffline) === true;
|
|
5
6
|
};
|
|
@@ -10,6 +10,7 @@ import { useIntl } from 'react-intl-next';
|
|
|
10
10
|
import { 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 { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
13
14
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
14
15
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
15
16
|
import { ButtonItem } from '@atlaskit/menu';
|
|
@@ -189,10 +190,10 @@ export const TypeAheadListItem = /*#__PURE__*/React.memo(({
|
|
|
189
190
|
});
|
|
190
191
|
const isItemDisabled = item => {
|
|
191
192
|
var _item$isDisabledOffli;
|
|
192
|
-
return connectivityMode
|
|
193
|
+
return isOfflineMode(connectivityMode) && ((_item$isDisabledOffli = item === null || item === void 0 ? void 0 : item.isDisabledOffline) !== null && _item$isDisabledOffli !== void 0 ? _item$isDisabledOffli : false);
|
|
193
194
|
};
|
|
194
195
|
const itemIsDisabled = isItemDisabled(item);
|
|
195
|
-
const isFirstEnabledIndex = connectivityMode
|
|
196
|
+
const isFirstEnabledIndex = isOfflineMode(connectivityMode) && itemIndex === firstOnlineSupportedIndex && selectedIndex === -1;
|
|
196
197
|
|
|
197
198
|
/**
|
|
198
199
|
* To select and highlight the first Item when no item is selected
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
1
2
|
export var itemIsDisabled = function itemIsDisabled(item, api) {
|
|
2
3
|
var _api$connectivity;
|
|
3
|
-
var isOffline = (api === null || api === void 0 || (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.sharedState.currentState()) === null || _api$connectivity === void 0 ? void 0 : _api$connectivity.mode)
|
|
4
|
+
var isOffline = isOfflineMode(api === null || api === void 0 || (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.sharedState.currentState()) === null || _api$connectivity === void 0 ? void 0 : _api$connectivity.mode);
|
|
4
5
|
return isOffline && (item === null || item === void 0 ? void 0 : item.isDisabledOffline) === true;
|
|
5
6
|
};
|
|
@@ -12,6 +12,7 @@ import { useIntl } from 'react-intl-next';
|
|
|
12
12
|
import { 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 { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
15
16
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
16
17
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
17
18
|
import { ButtonItem } from '@atlaskit/menu';
|
|
@@ -169,10 +170,10 @@ export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
169
170
|
connectivityMode = _useSharedPluginState.connectivityMode;
|
|
170
171
|
var isItemDisabled = function isItemDisabled(item) {
|
|
171
172
|
var _item$isDisabledOffli;
|
|
172
|
-
return connectivityMode
|
|
173
|
+
return isOfflineMode(connectivityMode) && ((_item$isDisabledOffli = item === null || item === void 0 ? void 0 : item.isDisabledOffline) !== null && _item$isDisabledOffli !== void 0 ? _item$isDisabledOffli : false);
|
|
173
174
|
};
|
|
174
175
|
var itemIsDisabled = isItemDisabled(item);
|
|
175
|
-
var isFirstEnabledIndex = connectivityMode
|
|
176
|
+
var isFirstEnabledIndex = isOfflineMode(connectivityMode) && itemIndex === firstOnlineSupportedIndex && selectedIndex === -1;
|
|
176
177
|
|
|
177
178
|
/**
|
|
178
179
|
* To select and highlight the first Item when no item is selected
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/adf-schema": "^51.5.0",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
34
|
-
"@atlaskit/editor-plugin-connectivity": "^6.
|
|
34
|
+
"@atlaskit/editor-plugin-connectivity": "^6.1.0",
|
|
35
35
|
"@atlaskit/editor-plugin-context-panel": "^8.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-metrics": "^7.1.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"@atlaskit/insm": "^0.2.0",
|
|
42
42
|
"@atlaskit/menu": "^8.4.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
|
-
"@atlaskit/primitives": "^
|
|
44
|
+
"@atlaskit/primitives": "^17.0.0",
|
|
45
45
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
46
46
|
"@atlaskit/prosemirror-input-rules": "^3.6.0",
|
|
47
47
|
"@atlaskit/theme": "^21.0.0",
|
|
48
48
|
"@atlaskit/tmp-editor-statsig": "^16.0.0",
|
|
49
|
-
"@atlaskit/tokens": "^
|
|
49
|
+
"@atlaskit/tokens": "^9.0.0",
|
|
50
50
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"@emotion/react": "^11.7.1",
|