@atlaskit/editor-plugin-selection 19.0.0 → 19.0.2
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/selection-main.js +7 -13
- package/dist/cjs/pm-plugins/utils.js +1 -4
- package/dist/es2019/entry-points/selection-plugin.js +1 -0
- package/dist/es2019/entry-points/types.js +1 -0
- package/dist/es2019/pm-plugins/commands.js +1 -0
- package/dist/es2019/pm-plugins/selection-main.js +7 -13
- package/dist/es2019/pm-plugins/utils.js +1 -4
- package/dist/esm/entry-points/selection-plugin.js +1 -0
- package/dist/esm/entry-points/types.js +1 -0
- package/dist/esm/pm-plugins/commands.js +1 -0
- package/dist/esm/pm-plugins/selection-main.js +7 -13
- package/dist/esm/pm-plugins/utils.js +1 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection
|
|
2
2
|
|
|
3
|
+
## 19.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 19.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`8d37dc7e55d62`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d37dc7e55d62) -
|
|
14
|
+
Clean up shipped experiment `platform_editor_block_menu`
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 19.0.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -8,7 +8,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
9
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
10
10
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
|
-
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
12
11
|
var _types = require("../types");
|
|
13
12
|
var _actions = require("./actions");
|
|
14
13
|
var _createSelectionBetween = require("./events/create-selection-between");
|
|
@@ -36,9 +35,6 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
|
|
|
36
35
|
var manualSelection;
|
|
37
36
|
var hideCursorChanged = false;
|
|
38
37
|
var blockSelectionChanged = false;
|
|
39
|
-
var needsBlockSelection = (0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true, {
|
|
40
|
-
exposure: true
|
|
41
|
-
});
|
|
42
38
|
for (var i = transactions.length - 1; i >= 0; i--) {
|
|
43
39
|
var meta = transactions[i].getMeta(_types.selectionPluginKey);
|
|
44
40
|
if ((meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
|
|
@@ -51,15 +47,13 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
|
|
|
51
47
|
if (meta !== null && meta !== void 0 && meta.manualSelection && !manualSelection) {
|
|
52
48
|
manualSelection = meta.manualSelection;
|
|
53
49
|
}
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
blockSelectionChanged = true;
|
|
62
|
-
}
|
|
50
|
+
if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
|
|
51
|
+
blockSelection = meta.setBlockSelection;
|
|
52
|
+
blockSelectionChanged = true;
|
|
53
|
+
}
|
|
54
|
+
if (meta !== null && meta !== void 0 && meta.clearBlockSelection) {
|
|
55
|
+
blockSelection = undefined;
|
|
56
|
+
blockSelectionChanged = true;
|
|
63
57
|
}
|
|
64
58
|
}
|
|
65
59
|
if (!(0, _utils.shouldRecalcDecorations)({
|
|
@@ -15,7 +15,6 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
|
15
15
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
16
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
17
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
|
-
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
19
18
|
var _types = require("../types");
|
|
20
19
|
var _hideCursorDecoration = require("./cursor/ui/hide-cursor-decoration");
|
|
21
20
|
var getDecorations = exports.getDecorations = function getDecorations(tr, manualSelection, hideCursor, blockSelection) {
|
|
@@ -37,9 +36,7 @@ var getDecorations = exports.getDecorations = function getDecorations(tr, manual
|
|
|
37
36
|
|
|
38
37
|
// Only apply node decorations when there is an active block selection.
|
|
39
38
|
// When there is no block selection, text selections should use native browser selection appearance.
|
|
40
|
-
if (
|
|
41
|
-
exposure: true
|
|
42
|
-
}) || blockSelection) {
|
|
39
|
+
if (blockSelection) {
|
|
43
40
|
var selectionDecorations = getNodesToDecorateFromSelection(selection, tr.doc).map(function (_ref) {
|
|
44
41
|
var node = _ref.node,
|
|
45
42
|
pos = _ref.pos;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
|
|
2
3
|
import { isIgnored as isIgnoredByGapCursor, RelativeSelectionPos, GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
3
4
|
import { isEmptyParagraph, isNodeEmpty } from '@atlaskit/editor-common/utils';
|
|
4
5
|
import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -5,7 +5,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
5
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
9
8
|
import { selectionPluginKey } from '../types';
|
|
10
9
|
import { SelectionActionTypes } from './actions';
|
|
11
10
|
import { onCreateSelectionBetween } from './events/create-selection-between';
|
|
@@ -30,9 +29,6 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
|
|
|
30
29
|
let manualSelection;
|
|
31
30
|
let hideCursorChanged = false;
|
|
32
31
|
let blockSelectionChanged = false;
|
|
33
|
-
const needsBlockSelection = editorExperiment('platform_editor_block_menu', true, {
|
|
34
|
-
exposure: true
|
|
35
|
-
});
|
|
36
32
|
for (let i = transactions.length - 1; i >= 0; i--) {
|
|
37
33
|
const meta = transactions[i].getMeta(selectionPluginKey);
|
|
38
34
|
if ((meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
|
|
@@ -45,15 +41,13 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
|
|
|
45
41
|
if (meta !== null && meta !== void 0 && meta.manualSelection && !manualSelection) {
|
|
46
42
|
manualSelection = meta.manualSelection;
|
|
47
43
|
}
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
blockSelectionChanged = true;
|
|
56
|
-
}
|
|
44
|
+
if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
|
|
45
|
+
blockSelection = meta.setBlockSelection;
|
|
46
|
+
blockSelectionChanged = true;
|
|
47
|
+
}
|
|
48
|
+
if (meta !== null && meta !== void 0 && meta.clearBlockSelection) {
|
|
49
|
+
blockSelection = undefined;
|
|
50
|
+
blockSelectionChanged = true;
|
|
57
51
|
}
|
|
58
52
|
}
|
|
59
53
|
if (!shouldRecalcDecorations({
|
|
@@ -6,7 +6,6 @@ import { findParentNode, findParentNodeClosestToPos, flatten, hasParentNode } fr
|
|
|
6
6
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
10
9
|
import { selectionPluginKey } from '../types';
|
|
11
10
|
import { createHideCursorDecoration } from './cursor/ui/hide-cursor-decoration';
|
|
12
11
|
export const getDecorations = (tr, manualSelection, hideCursor, blockSelection) => {
|
|
@@ -28,9 +27,7 @@ export const getDecorations = (tr, manualSelection, hideCursor, blockSelection)
|
|
|
28
27
|
|
|
29
28
|
// Only apply node decorations when there is an active block selection.
|
|
30
29
|
// When there is no block selection, text selections should use native browser selection appearance.
|
|
31
|
-
if (
|
|
32
|
-
exposure: true
|
|
33
|
-
}) || blockSelection) {
|
|
30
|
+
if (blockSelection) {
|
|
34
31
|
const selectionDecorations = getNodesToDecorateFromSelection(selection, tr.doc).map(({
|
|
35
32
|
node,
|
|
36
33
|
pos
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
|
|
2
3
|
import { isIgnored as isIgnoredByGapCursor, RelativeSelectionPos, GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
3
4
|
import { isEmptyParagraph, isNodeEmpty } from '@atlaskit/editor-common/utils';
|
|
4
5
|
import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -5,7 +5,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
5
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
9
8
|
import { selectionPluginKey } from '../types';
|
|
10
9
|
import { SelectionActionTypes } from './actions';
|
|
11
10
|
import { onCreateSelectionBetween } from './events/create-selection-between';
|
|
@@ -31,9 +30,6 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
|
|
|
31
30
|
var manualSelection;
|
|
32
31
|
var hideCursorChanged = false;
|
|
33
32
|
var blockSelectionChanged = false;
|
|
34
|
-
var needsBlockSelection = editorExperiment('platform_editor_block_menu', true, {
|
|
35
|
-
exposure: true
|
|
36
|
-
});
|
|
37
33
|
for (var i = transactions.length - 1; i >= 0; i--) {
|
|
38
34
|
var meta = transactions[i].getMeta(selectionPluginKey);
|
|
39
35
|
if ((meta === null || meta === void 0 ? void 0 : meta.hideCursor) !== undefined) {
|
|
@@ -46,15 +42,13 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
|
|
|
46
42
|
if (meta !== null && meta !== void 0 && meta.manualSelection && !manualSelection) {
|
|
47
43
|
manualSelection = meta.manualSelection;
|
|
48
44
|
}
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
blockSelectionChanged = true;
|
|
57
|
-
}
|
|
45
|
+
if (meta !== null && meta !== void 0 && meta.setBlockSelection) {
|
|
46
|
+
blockSelection = meta.setBlockSelection;
|
|
47
|
+
blockSelectionChanged = true;
|
|
48
|
+
}
|
|
49
|
+
if (meta !== null && meta !== void 0 && meta.clearBlockSelection) {
|
|
50
|
+
blockSelection = undefined;
|
|
51
|
+
blockSelectionChanged = true;
|
|
58
52
|
}
|
|
59
53
|
}
|
|
60
54
|
if (!shouldRecalcDecorations({
|
|
@@ -7,7 +7,6 @@ import { findParentNode, findParentNodeClosestToPos, flatten, hasParentNode } fr
|
|
|
7
7
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
11
10
|
import { selectionPluginKey } from '../types';
|
|
12
11
|
import { createHideCursorDecoration } from './cursor/ui/hide-cursor-decoration';
|
|
13
12
|
export var getDecorations = function getDecorations(tr, manualSelection, hideCursor, blockSelection) {
|
|
@@ -29,9 +28,7 @@ export var getDecorations = function getDecorations(tr, manualSelection, hideCur
|
|
|
29
28
|
|
|
30
29
|
// Only apply node decorations when there is an active block selection.
|
|
31
30
|
// When there is no block selection, text selections should use native browser selection appearance.
|
|
32
|
-
if (
|
|
33
|
-
exposure: true
|
|
34
|
-
}) || blockSelection) {
|
|
31
|
+
if (blockSelection) {
|
|
35
32
|
var selectionDecorations = getNodesToDecorateFromSelection(selection, tr.doc).map(function (_ref) {
|
|
36
33
|
var node = _ref.node,
|
|
37
34
|
pos = _ref.pos;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.2",
|
|
4
4
|
"description": "Selection plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
25
25
|
"@atlaskit/editor-shared-styles": "^4.3.0",
|
|
26
26
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
27
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
27
|
+
"@atlaskit/tmp-editor-statsig": "^201.0.0",
|
|
28
28
|
"@atlaskit/tokens": "^18.2.0",
|
|
29
29
|
"@babel/runtime": "^7.0.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@atlaskit/editor-common": "^123.
|
|
32
|
+
"@atlaskit/editor-common": "^123.2.0",
|
|
33
33
|
"react": "^18.2.0 || ^19.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|