@atlaskit/editor-plugin-selection 2.0.3 → 2.0.5
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 +14 -0
- package/dist/cjs/pm-plugins/auto-expand-selection-range-on-inline-node-main.js +16 -4
- package/dist/es2019/pm-plugins/auto-expand-selection-range-on-inline-node-main.js +16 -4
- package/dist/esm/pm-plugins/auto-expand-selection-range-on-inline-node-main.js +16 -4
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection
|
|
2
2
|
|
|
3
|
+
## 2.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#120517](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120517)
|
|
14
|
+
[`cfcd496e4d6f2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cfcd496e4d6f2) -
|
|
15
|
+
[ED-26790] Fix selecting an Emoji or Mention Selects All LCMs
|
|
16
|
+
|
|
3
17
|
## 2.0.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createAutoExpandSelectionRangeOnInlineNodePlugin = void 0;
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
10
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
10
11
|
var _autoExpandSelectionRangeOnInlineNodeKey = require("./auto-expand-selection-range-on-inline-node-key");
|
|
11
12
|
var createAutoExpandSelectionRangeOnInlineNodePlugin = exports.createAutoExpandSelectionRangeOnInlineNodePlugin = function createAutoExpandSelectionRangeOnInlineNodePlugin() {
|
|
@@ -23,10 +24,21 @@ var createAutoExpandSelectionRangeOnInlineNodePlugin = exports.createAutoExpandS
|
|
|
23
24
|
// Ignored via go/ees005
|
|
24
25
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
25
26
|
var mouseUpElement = event.target;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_lcm_inline_node_selection_fix')) {
|
|
28
|
+
// terminate early if mouse down and mouse up elements are the same -> e.g a click event
|
|
29
|
+
// or mouse down doesn't trigger
|
|
30
|
+
if (!mouseDownElement || mouseDownElement === mouseUpElement) {
|
|
31
|
+
mouseDownElement = null;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// reset mouse down element after mouse up event
|
|
35
|
+
// so that we can detect the next mouse down event is triggered right after mouse up event or not
|
|
36
|
+
mouseDownElement = null;
|
|
37
|
+
} else {
|
|
38
|
+
// terminate early if mouse down and mouse up elements are the same -> e.g a click event
|
|
39
|
+
if (mouseDownElement === mouseUpElement) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
30
42
|
}
|
|
31
43
|
|
|
32
44
|
// terminate early if mouse up event is not fired on inline node
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
5
|
import { autoExpandSelectionRangeOnInlineNodePluginKey } from './auto-expand-selection-range-on-inline-node-key';
|
|
5
6
|
export const createAutoExpandSelectionRangeOnInlineNodePlugin = () => {
|
|
@@ -17,10 +18,21 @@ export const createAutoExpandSelectionRangeOnInlineNodePlugin = () => {
|
|
|
17
18
|
// Ignored via go/ees005
|
|
18
19
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
19
20
|
const mouseUpElement = event.target;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
if (fg('platform_editor_lcm_inline_node_selection_fix')) {
|
|
22
|
+
// terminate early if mouse down and mouse up elements are the same -> e.g a click event
|
|
23
|
+
// or mouse down doesn't trigger
|
|
24
|
+
if (!mouseDownElement || mouseDownElement === mouseUpElement) {
|
|
25
|
+
mouseDownElement = null;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// reset mouse down element after mouse up event
|
|
29
|
+
// so that we can detect the next mouse down event is triggered right after mouse up event or not
|
|
30
|
+
mouseDownElement = null;
|
|
31
|
+
} else {
|
|
32
|
+
// terminate early if mouse down and mouse up elements are the same -> e.g a click event
|
|
33
|
+
if (mouseDownElement === mouseUpElement) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
24
36
|
}
|
|
25
37
|
|
|
26
38
|
// terminate early if mouse up event is not fired on inline node
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
5
|
import { autoExpandSelectionRangeOnInlineNodePluginKey } from './auto-expand-selection-range-on-inline-node-key';
|
|
5
6
|
export var createAutoExpandSelectionRangeOnInlineNodePlugin = function createAutoExpandSelectionRangeOnInlineNodePlugin() {
|
|
@@ -17,10 +18,21 @@ export var createAutoExpandSelectionRangeOnInlineNodePlugin = function createAut
|
|
|
17
18
|
// Ignored via go/ees005
|
|
18
19
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
19
20
|
var mouseUpElement = event.target;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
if (fg('platform_editor_lcm_inline_node_selection_fix')) {
|
|
22
|
+
// terminate early if mouse down and mouse up elements are the same -> e.g a click event
|
|
23
|
+
// or mouse down doesn't trigger
|
|
24
|
+
if (!mouseDownElement || mouseDownElement === mouseUpElement) {
|
|
25
|
+
mouseDownElement = null;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// reset mouse down element after mouse up event
|
|
29
|
+
// so that we can detect the next mouse down event is triggered right after mouse up event or not
|
|
30
|
+
mouseDownElement = null;
|
|
31
|
+
} else {
|
|
32
|
+
// terminate early if mouse down and mouse up elements are the same -> e.g a click event
|
|
33
|
+
if (mouseDownElement === mouseUpElement) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
24
36
|
}
|
|
25
37
|
|
|
26
38
|
// terminate early if mouse up event is not fired on inline node
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Selection plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"runReact18": true
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@atlaskit/editor-common": "^100.
|
|
23
|
+
"@atlaskit/editor-common": "^100.5.0",
|
|
24
24
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
25
25
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
26
26
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
27
27
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
28
|
-
"@atlaskit/tmp-editor-statsig": "3.
|
|
29
|
-
"@atlaskit/tokens": "^4.
|
|
28
|
+
"@atlaskit/tmp-editor-statsig": "3.4.0",
|
|
29
|
+
"@atlaskit/tokens": "^4.3.0",
|
|
30
30
|
"@babel/runtime": "^7.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -89,6 +89,9 @@
|
|
|
89
89
|
},
|
|
90
90
|
"editor_auto_expand_selection_on_inline_node": {
|
|
91
91
|
"type": "boolean"
|
|
92
|
+
},
|
|
93
|
+
"platform_editor_lcm_inline_node_selection_fix": {
|
|
94
|
+
"type": "boolean"
|
|
92
95
|
}
|
|
93
96
|
}
|
|
94
97
|
}
|