@atlaskit/editor-plugin-type-ahead 18.0.7 → 18.0.10
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 +22 -0
- package/dist/cjs/pm-plugins/utils.js +7 -10
- package/dist/cjs/ui/hooks/use-load-items.js +11 -15
- package/dist/es2019/pm-plugins/utils.js +7 -10
- package/dist/es2019/ui/hooks/use-load-items.js +11 -15
- package/dist/esm/pm-plugins/utils.js +7 -10
- package/dist/esm/ui/hooks/use-load-items.js +11 -15
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 18.0.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 18.0.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`962e8dc0188bf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/962e8dc0188bf) -
|
|
14
|
+
Clean up `platform_editor_offline_editing_web` with `isEnabled: true` for Confluence, keeping
|
|
15
|
+
offline editing and recovery behavior enabled. Remove the retired experiment from the editor
|
|
16
|
+
Statsig configuration; consumers must stop querying or overriding this experiment.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## 18.0.8
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 18.0.7
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -62,11 +62,9 @@ var skipForwardToSafeItem = exports.skipForwardToSafeItem = function skipForward
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// We got to the end of the list ^, now try from the start
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return _idx;
|
|
69
|
-
}
|
|
65
|
+
for (var _idx = 0; _idx < nextIndex; _idx++) {
|
|
66
|
+
if (!itemIsDisabled(_idx)) {
|
|
67
|
+
return _idx;
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
70
|
|
|
@@ -86,13 +84,12 @@ var skipBackwardToSafeItem = exports.skipBackwardToSafeItem = function skipBackw
|
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
// We got to the start of the list ^, now try from the end
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return _idx2;
|
|
93
|
-
}
|
|
87
|
+
for (var _idx2 = listSize; _idx2 > nextIndex; _idx2--) {
|
|
88
|
+
if (!itemIsDisabled(_idx2)) {
|
|
89
|
+
return _idx2;
|
|
94
90
|
}
|
|
95
91
|
}
|
|
92
|
+
|
|
96
93
|
// If no non-selectable items are found, return currentIndex
|
|
97
94
|
return currentIndex;
|
|
98
95
|
};
|
|
@@ -8,7 +8,6 @@ exports.useLoadItems = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
11
|
-
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
12
11
|
var _clearListError = require("../../pm-plugins/commands/clear-list-error");
|
|
13
12
|
var _updateListError = require("../../pm-plugins/commands/update-list-error");
|
|
14
13
|
var _updateListItems = require("../../pm-plugins/commands/update-list-items");
|
|
@@ -38,12 +37,11 @@ var useLoadItems = exports.useLoadItems = function useLoadItems(triggerHandler,
|
|
|
38
37
|
editorState: editorView.state
|
|
39
38
|
};
|
|
40
39
|
var view = editorViewRef.current;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
40
|
+
|
|
41
|
+
// Clear any existing error state before making a new request
|
|
42
|
+
queueMicrotask(function () {
|
|
43
|
+
api === null || api === void 0 || api.core.actions.execute((0, _clearListError.clearListError)());
|
|
44
|
+
});
|
|
47
45
|
|
|
48
46
|
/**
|
|
49
47
|
* Shared render pipeline used by both the single-shot `getItems`
|
|
@@ -83,15 +81,13 @@ var useLoadItems = exports.useLoadItems = function useLoadItems(triggerHandler,
|
|
|
83
81
|
// `.catch((e) => updateListError(e)(...))` path.
|
|
84
82
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
83
|
var handleError = function handleError(e) {
|
|
86
|
-
if (
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
setItems(EMPTY_LIST_ITEM);
|
|
90
|
-
}
|
|
91
|
-
queueMicrotask(function () {
|
|
92
|
-
(0, _updateListError.updateListError)(e)(view.state, view.dispatch);
|
|
93
|
-
});
|
|
84
|
+
if (e) {
|
|
85
|
+
if (componentIsMounted.current) {
|
|
86
|
+
setItems(EMPTY_LIST_ITEM);
|
|
94
87
|
}
|
|
88
|
+
queueMicrotask(function () {
|
|
89
|
+
(0, _updateListError.updateListError)(e)(view.state, view.dispatch);
|
|
90
|
+
});
|
|
95
91
|
}
|
|
96
92
|
};
|
|
97
93
|
|
|
@@ -57,11 +57,9 @@ export const skipForwardToSafeItem = ({
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// We got to the end of the list ^, now try from the start
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return idx;
|
|
64
|
-
}
|
|
60
|
+
for (let idx = 0; idx < nextIndex; idx++) {
|
|
61
|
+
if (!itemIsDisabled(idx)) {
|
|
62
|
+
return idx;
|
|
65
63
|
}
|
|
66
64
|
}
|
|
67
65
|
|
|
@@ -82,13 +80,12 @@ export const skipBackwardToSafeItem = ({
|
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
// We got to the start of the list ^, now try from the end
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return idx;
|
|
89
|
-
}
|
|
83
|
+
for (let idx = listSize; idx > nextIndex; idx--) {
|
|
84
|
+
if (!itemIsDisabled(idx)) {
|
|
85
|
+
return idx;
|
|
90
86
|
}
|
|
91
87
|
}
|
|
88
|
+
|
|
92
89
|
// If no non-selectable items are found, return currentIndex
|
|
93
90
|
return currentIndex;
|
|
94
91
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
3
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
4
3
|
import { clearListError } from '../../pm-plugins/commands/clear-list-error';
|
|
5
4
|
import { updateListError } from '../../pm-plugins/commands/update-list-error';
|
|
6
5
|
import { updateListItem } from '../../pm-plugins/commands/update-list-items';
|
|
@@ -26,12 +25,11 @@ export const useLoadItems = (triggerHandler, editorView, query, showViewMore, ap
|
|
|
26
25
|
const {
|
|
27
26
|
current: view
|
|
28
27
|
} = editorViewRef;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
28
|
+
|
|
29
|
+
// Clear any existing error state before making a new request
|
|
30
|
+
queueMicrotask(() => {
|
|
31
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(clearListError());
|
|
32
|
+
});
|
|
35
33
|
|
|
36
34
|
/**
|
|
37
35
|
* Shared render pipeline used by both the single-shot `getItems`
|
|
@@ -72,15 +70,13 @@ export const useLoadItems = (triggerHandler, editorView, query, showViewMore, ap
|
|
|
72
70
|
// `.catch((e) => updateListError(e)(...))` path.
|
|
73
71
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
72
|
const handleError = e => {
|
|
75
|
-
if (
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
setItems(EMPTY_LIST_ITEM);
|
|
79
|
-
}
|
|
80
|
-
queueMicrotask(() => {
|
|
81
|
-
updateListError(e)(view.state, view.dispatch);
|
|
82
|
-
});
|
|
73
|
+
if (e) {
|
|
74
|
+
if (componentIsMounted.current) {
|
|
75
|
+
setItems(EMPTY_LIST_ITEM);
|
|
83
76
|
}
|
|
77
|
+
queueMicrotask(() => {
|
|
78
|
+
updateListError(e)(view.state, view.dispatch);
|
|
79
|
+
});
|
|
84
80
|
}
|
|
85
81
|
};
|
|
86
82
|
|
|
@@ -56,11 +56,9 @@ export var skipForwardToSafeItem = function skipForwardToSafeItem(_ref) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// We got to the end of the list ^, now try from the start
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return _idx;
|
|
63
|
-
}
|
|
59
|
+
for (var _idx = 0; _idx < nextIndex; _idx++) {
|
|
60
|
+
if (!itemIsDisabled(_idx)) {
|
|
61
|
+
return _idx;
|
|
64
62
|
}
|
|
65
63
|
}
|
|
66
64
|
|
|
@@ -80,13 +78,12 @@ export var skipBackwardToSafeItem = function skipBackwardToSafeItem(_ref2) {
|
|
|
80
78
|
}
|
|
81
79
|
|
|
82
80
|
// We got to the start of the list ^, now try from the end
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return _idx2;
|
|
87
|
-
}
|
|
81
|
+
for (var _idx2 = listSize; _idx2 > nextIndex; _idx2--) {
|
|
82
|
+
if (!itemIsDisabled(_idx2)) {
|
|
83
|
+
return _idx2;
|
|
88
84
|
}
|
|
89
85
|
}
|
|
86
|
+
|
|
90
87
|
// If no non-selectable items are found, return currentIndex
|
|
91
88
|
return currentIndex;
|
|
92
89
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
4
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
5
4
|
import { clearListError } from '../../pm-plugins/commands/clear-list-error';
|
|
6
5
|
import { updateListError } from '../../pm-plugins/commands/update-list-error';
|
|
7
6
|
import { updateListItem } from '../../pm-plugins/commands/update-list-items';
|
|
@@ -31,12 +30,11 @@ export var useLoadItems = function useLoadItems(triggerHandler, editorView, quer
|
|
|
31
30
|
editorState: editorView.state
|
|
32
31
|
};
|
|
33
32
|
var view = editorViewRef.current;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
33
|
+
|
|
34
|
+
// Clear any existing error state before making a new request
|
|
35
|
+
queueMicrotask(function () {
|
|
36
|
+
api === null || api === void 0 || api.core.actions.execute(clearListError());
|
|
37
|
+
});
|
|
40
38
|
|
|
41
39
|
/**
|
|
42
40
|
* Shared render pipeline used by both the single-shot `getItems`
|
|
@@ -76,15 +74,13 @@ export var useLoadItems = function useLoadItems(triggerHandler, editorView, quer
|
|
|
76
74
|
// `.catch((e) => updateListError(e)(...))` path.
|
|
77
75
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
76
|
var handleError = function handleError(e) {
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
setItems(EMPTY_LIST_ITEM);
|
|
83
|
-
}
|
|
84
|
-
queueMicrotask(function () {
|
|
85
|
-
updateListError(e)(view.state, view.dispatch);
|
|
86
|
-
});
|
|
77
|
+
if (e) {
|
|
78
|
+
if (componentIsMounted.current) {
|
|
79
|
+
setItems(EMPTY_LIST_ITEM);
|
|
87
80
|
}
|
|
81
|
+
queueMicrotask(function () {
|
|
82
|
+
updateListError(e)(view.state, view.dispatch);
|
|
83
|
+
});
|
|
88
84
|
}
|
|
89
85
|
};
|
|
90
86
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "18.0.
|
|
3
|
+
"version": "18.0.10",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"@atlaskit/heading": "^7.2.0",
|
|
36
36
|
"@atlaskit/icon": "^37.6.0",
|
|
37
37
|
"@atlaskit/insm": "^3.0.0",
|
|
38
|
-
"@atlaskit/mention": "^
|
|
38
|
+
"@atlaskit/mention": "^29.0.0",
|
|
39
39
|
"@atlaskit/menu": "^10.2.0",
|
|
40
40
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
42
42
|
"@atlaskit/primitives": "^22.5.0",
|
|
43
43
|
"@atlaskit/prosemirror-history": "^1.2.0",
|
|
44
44
|
"@atlaskit/prosemirror-input-rules": "^4.1.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^188.0.0",
|
|
46
46
|
"@atlaskit/tokens": "^16.12.0",
|
|
47
47
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"w3c-keyname": "^2.1.8"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@atlaskit/editor-common": "^121.
|
|
57
|
+
"@atlaskit/editor-common": "^121.5.0",
|
|
58
58
|
"react": "^18.2.0 || ^19.2.0",
|
|
59
59
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
60
60
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|