@atlaskit/editor-plugin-selection 30.0.8 → 30.0.9
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,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection
|
|
2
2
|
|
|
3
|
+
## 30.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`cbe7f7f57f1c6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cbe7f7f57f1c6) -
|
|
8
|
+
EDITOR-10030: Behind the `platform_editor_improve_inp_batch_2` experiment, the gap cursor click
|
|
9
|
+
handler checks for ignored clicks before calling `posAtCoords`, so ignored clicks no longer force
|
|
10
|
+
a synchronous layout.
|
|
11
|
+
|
|
3
12
|
## 30.0.8
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
12
12
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
13
13
|
var _view2 = require("@atlaskit/editor-prosemirror/view");
|
|
14
14
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
15
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
15
16
|
var _types = require("../types");
|
|
16
17
|
var _gapCursorPluginKey = require("./gap-cursor-plugin-key");
|
|
17
18
|
var _actions2 = require("./gap-cursor/actions");
|
|
@@ -100,11 +101,21 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
100
101
|
},
|
|
101
102
|
handleClick: function handleClick(view, nodePos, event) {
|
|
102
103
|
var _$pos$parent;
|
|
104
|
+
var target = event.target instanceof HTMLElement ? event.target : null;
|
|
105
|
+
// Check the experiment first so the control group runs isIgnoredClick once, after
|
|
106
|
+
// posAtCoords, exactly as before.
|
|
107
|
+
var checkIgnoredClickFirst = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_improve_inp_batch_2');
|
|
108
|
+
if (checkIgnoredClickFirst && target && (0, _utils2.isIgnoredClick)(target)) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// posAtCoords reads layout (elementFromPoint, caret position and client rects), so only
|
|
113
|
+
// call it once nothing cheaper can rule the click out.
|
|
103
114
|
var posAtCoords = view.posAtCoords({
|
|
104
115
|
left: event.clientX,
|
|
105
116
|
top: event.clientY
|
|
106
117
|
});
|
|
107
|
-
if (!posAtCoords || (0, _utils2.isIgnoredClick)(
|
|
118
|
+
if (!posAtCoords || !checkIgnoredClickFirst && (0, _utils2.isIgnoredClick)(target)) {
|
|
108
119
|
return false;
|
|
109
120
|
}
|
|
110
121
|
var isInsideTheTarget = posAtCoords.pos === posAtCoords.inside;
|
|
@@ -6,6 +6,7 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
6
6
|
import { findPositionOfNodeBefore } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
9
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
10
|
import { selectionPluginKey } from '../types';
|
|
10
11
|
import { gapCursorPluginKey } from './gap-cursor-plugin-key';
|
|
11
12
|
import { deleteNode } from './gap-cursor/actions';
|
|
@@ -97,11 +98,21 @@ const plugin = new SafePlugin({
|
|
|
97
98
|
},
|
|
98
99
|
handleClick(view, nodePos, event) {
|
|
99
100
|
var _$pos$parent;
|
|
101
|
+
const target = event.target instanceof HTMLElement ? event.target : null;
|
|
102
|
+
// Check the experiment first so the control group runs isIgnoredClick once, after
|
|
103
|
+
// posAtCoords, exactly as before.
|
|
104
|
+
const checkIgnoredClickFirst = isExperimentEnabled('platform_editor_improve_inp_batch_2');
|
|
105
|
+
if (checkIgnoredClickFirst && target && isIgnoredClick(target)) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// posAtCoords reads layout (elementFromPoint, caret position and client rects), so only
|
|
110
|
+
// call it once nothing cheaper can rule the click out.
|
|
100
111
|
const posAtCoords = view.posAtCoords({
|
|
101
112
|
left: event.clientX,
|
|
102
113
|
top: event.clientY
|
|
103
114
|
});
|
|
104
|
-
if (!posAtCoords || isIgnoredClick(
|
|
115
|
+
if (!posAtCoords || !checkIgnoredClickFirst && isIgnoredClick(target)) {
|
|
105
116
|
return false;
|
|
106
117
|
}
|
|
107
118
|
const isInsideTheTarget = posAtCoords.pos === posAtCoords.inside;
|
|
@@ -6,6 +6,7 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
6
6
|
import { findPositionOfNodeBefore } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
9
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
10
|
import { selectionPluginKey } from '../types';
|
|
10
11
|
import { gapCursorPluginKey } from './gap-cursor-plugin-key';
|
|
11
12
|
import { deleteNode } from './gap-cursor/actions';
|
|
@@ -94,11 +95,21 @@ var plugin = new SafePlugin({
|
|
|
94
95
|
},
|
|
95
96
|
handleClick: function handleClick(view, nodePos, event) {
|
|
96
97
|
var _$pos$parent;
|
|
98
|
+
var target = event.target instanceof HTMLElement ? event.target : null;
|
|
99
|
+
// Check the experiment first so the control group runs isIgnoredClick once, after
|
|
100
|
+
// posAtCoords, exactly as before.
|
|
101
|
+
var checkIgnoredClickFirst = isExperimentEnabled('platform_editor_improve_inp_batch_2');
|
|
102
|
+
if (checkIgnoredClickFirst && target && isIgnoredClick(target)) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// posAtCoords reads layout (elementFromPoint, caret position and client rects), so only
|
|
107
|
+
// call it once nothing cheaper can rule the click out.
|
|
97
108
|
var posAtCoords = view.posAtCoords({
|
|
98
109
|
left: event.clientX,
|
|
99
110
|
top: event.clientY
|
|
100
111
|
});
|
|
101
|
-
if (!posAtCoords || isIgnoredClick(
|
|
112
|
+
if (!posAtCoords || !checkIgnoredClickFirst && isIgnoredClick(target)) {
|
|
102
113
|
return false;
|
|
103
114
|
}
|
|
104
115
|
var isInsideTheTarget = posAtCoords.pos === posAtCoords.inside;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.9",
|
|
4
4
|
"description": "Selection plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -25,17 +25,18 @@
|
|
|
25
25
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
26
26
|
"@atlaskit/editor-shared-styles": "^5.0.0",
|
|
27
27
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
28
|
+
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
28
29
|
"@atlaskit/primitives": "^22.6.0",
|
|
29
30
|
"@atlaskit/tmp-editor-statsig": "^253.0.0",
|
|
30
31
|
"@atlaskit/tokens": "^20.9.0",
|
|
31
32
|
"@babel/runtime": "^7.0.0"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
|
-
"@atlaskit/editor-common": "^134.
|
|
35
|
+
"@atlaskit/editor-common": "^134.6.0",
|
|
35
36
|
"react": "^18.2.0 || ^19.2.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@atlaskit/editor-common": "^134.
|
|
39
|
+
"@atlaskit/editor-common": "^134.6.0",
|
|
39
40
|
"react": "^19.2.0"
|
|
40
41
|
}
|
|
41
42
|
}
|