@atlaskit/editor-plugin-type-ahead 1.7.1 → 1.8.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 1.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#132619](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/132619)
|
|
8
|
+
[`492710c431738`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/492710c431738) -
|
|
9
|
+
[ux] [EO2024-22] Fix typeahead interaction when node or table selection
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 1.8.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#130825](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/130825)
|
|
17
|
+
[`d8a00de5637ff`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d8a00de5637ff) -
|
|
18
|
+
ENGHEALTH-9890: Bumps React peer dependency for Lego editor plugins
|
|
19
|
+
|
|
3
20
|
## 1.7.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -35,7 +35,8 @@ var openTypeAheadAtCursor = exports.openTypeAheadAtCursor = function openTypeAhe
|
|
|
35
35
|
query: query
|
|
36
36
|
})(tr);
|
|
37
37
|
var selection = tr.selection;
|
|
38
|
-
|
|
38
|
+
var isInline = selection instanceof _state.NodeSelection && selection.node.type.isInline;
|
|
39
|
+
if (!(selection instanceof _state.TextSelection || selection instanceof _selection.GapCursorSelection || selection instanceof _state.NodeSelection)) {
|
|
39
40
|
return tr;
|
|
40
41
|
}
|
|
41
42
|
if (selection instanceof _selection.GapCursorSelection) {
|
|
@@ -45,6 +46,13 @@ var openTypeAheadAtCursor = exports.openTypeAheadAtCursor = function openTypeAhe
|
|
|
45
46
|
tr.delete(tr.selection.from - 1, tr.selection.from);
|
|
46
47
|
} else {
|
|
47
48
|
var _selection$$head, _selection$$head$pare, _selection$$head$pare2;
|
|
49
|
+
if (selection instanceof _state.NodeSelection) {
|
|
50
|
+
if (isInline) {
|
|
51
|
+
tr.deleteSelection();
|
|
52
|
+
return tr;
|
|
53
|
+
}
|
|
54
|
+
return tr;
|
|
55
|
+
}
|
|
48
56
|
if (!selection.$cursor) {
|
|
49
57
|
tr.deleteSelection();
|
|
50
58
|
return tr;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
2
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { ACTIONS } from '../pm-plugins/actions';
|
|
4
4
|
import { pluginKey } from '../pm-plugins/key';
|
|
5
5
|
export const openTypeAhead = props => tr => {
|
|
@@ -32,7 +32,8 @@ export const openTypeAheadAtCursor = ({
|
|
|
32
32
|
const {
|
|
33
33
|
selection
|
|
34
34
|
} = tr;
|
|
35
|
-
|
|
35
|
+
const isInline = selection instanceof NodeSelection && selection.node.type.isInline;
|
|
36
|
+
if (!(selection instanceof TextSelection || selection instanceof GapCursorSelection || selection instanceof NodeSelection)) {
|
|
36
37
|
return tr;
|
|
37
38
|
}
|
|
38
39
|
if (selection instanceof GapCursorSelection) {
|
|
@@ -42,6 +43,13 @@ export const openTypeAheadAtCursor = ({
|
|
|
42
43
|
tr.delete(tr.selection.from - 1, tr.selection.from);
|
|
43
44
|
} else {
|
|
44
45
|
var _selection$$head, _selection$$head$pare, _selection$$head$pare2, _selection$$head$pare3;
|
|
46
|
+
if (selection instanceof NodeSelection) {
|
|
47
|
+
if (isInline) {
|
|
48
|
+
tr.deleteSelection();
|
|
49
|
+
return tr;
|
|
50
|
+
}
|
|
51
|
+
return tr;
|
|
52
|
+
}
|
|
45
53
|
if (!selection.$cursor) {
|
|
46
54
|
tr.deleteSelection();
|
|
47
55
|
return tr;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
2
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { ACTIONS } from '../pm-plugins/actions';
|
|
4
4
|
import { pluginKey } from '../pm-plugins/key';
|
|
5
5
|
export var openTypeAhead = function openTypeAhead(props) {
|
|
@@ -29,7 +29,8 @@ export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
|
|
|
29
29
|
query: query
|
|
30
30
|
})(tr);
|
|
31
31
|
var selection = tr.selection;
|
|
32
|
-
|
|
32
|
+
var isInline = selection instanceof NodeSelection && selection.node.type.isInline;
|
|
33
|
+
if (!(selection instanceof TextSelection || selection instanceof GapCursorSelection || selection instanceof NodeSelection)) {
|
|
33
34
|
return tr;
|
|
34
35
|
}
|
|
35
36
|
if (selection instanceof GapCursorSelection) {
|
|
@@ -39,6 +40,13 @@ export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
|
|
|
39
40
|
tr.delete(tr.selection.from - 1, tr.selection.from);
|
|
40
41
|
} else {
|
|
41
42
|
var _selection$$head, _selection$$head$pare, _selection$$head$pare2;
|
|
43
|
+
if (selection instanceof NodeSelection) {
|
|
44
|
+
if (isInline) {
|
|
45
|
+
tr.deleteSelection();
|
|
46
|
+
return tr;
|
|
47
|
+
}
|
|
48
|
+
return tr;
|
|
49
|
+
}
|
|
42
50
|
if (!selection.$cursor) {
|
|
43
51
|
tr.deleteSelection();
|
|
44
52
|
return tr;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^40.8.1",
|
|
36
|
-
"@atlaskit/editor-common": "^
|
|
37
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
36
|
+
"@atlaskit/editor-common": "^88.0.0",
|
|
37
|
+
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
39
39
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
40
40
|
"@atlaskit/menu": "^2.12.0",
|
|
41
41
|
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
|
42
42
|
"@atlaskit/theme": "^13.0.0",
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
43
|
+
"@atlaskit/tokens": "^1.59.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@emotion/react": "^11.7.1",
|
|
46
46
|
"lodash": "^4.17.21",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"w3c-keyname": "^2.1.8"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"react": "^16.8.0",
|
|
54
|
-
"react-dom": "^16.8.0",
|
|
53
|
+
"react": "^16.8.0 || ^17.0.0 || ~18.2.0",
|
|
54
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ~18.2.0",
|
|
55
55
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|