@atlaskit/editor-plugin-selection 15.0.0 → 15.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 +30 -0
- package/dist/cjs/pm-plugins/gap-cursor-main.js +4 -26
- package/dist/cjs/pm-plugins/selection-main.js +2 -0
- package/dist/es2019/pm-plugins/gap-cursor-main.js +2 -25
- package/dist/es2019/pm-plugins/selection-main.js +3 -0
- package/dist/esm/pm-plugins/gap-cursor-main.js +5 -27
- package/dist/esm/pm-plugins/selection-main.js +3 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection
|
|
2
2
|
|
|
3
|
+
## 15.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`76e9f6152bf16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/76e9f6152bf16) -
|
|
8
|
+
Enable launched synced block integrations and remove obsolete experiment scaffolding.
|
|
9
|
+
|
|
10
|
+
BREAKING: `@atlaskit/tmp-editor-statsig` no longer defines the `platform_synced_block` editor
|
|
11
|
+
experiment. Consumers that use `editorExperiment('platform_synced_block', ...)` to conditionally
|
|
12
|
+
enable synced-block integrations will no longer be able to look up that experiment; synced-block
|
|
13
|
+
integrations are now enabled by default. Remove each lookup and its conditional branch:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// Before
|
|
17
|
+
if (editorExperiment('platform_synced_block', true)) {
|
|
18
|
+
enableSyncedBlocks();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// After
|
|
22
|
+
enableSyncedBlocks();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
27
|
+
## 15.0.1
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
|
|
3
33
|
## 15.0.0
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -10,7 +10,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
10
10
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
11
11
|
var _view2 = require("@atlaskit/editor-prosemirror/view");
|
|
12
12
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
13
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
13
|
var _types = require("../types");
|
|
15
14
|
var _gapCursorPluginKey = require("./gap-cursor-plugin-key");
|
|
16
15
|
var _actions = require("./gap-cursor/actions");
|
|
@@ -53,36 +52,15 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
53
52
|
_view.dispatch(_view.state.tr.setSelection(new _selection.GapCursorSelection(_view.state.doc.resolve(0), _selection.Side.LEFT)));
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
|
-
return {
|
|
57
|
-
update: function update(view) {
|
|
58
|
-
if ((0, _experiments.editorExperiment)('platform_synced_block', true)) {
|
|
59
|
-
// Caret visibility now handled directly via CSS selector in gapCursorStyles.ts
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
var _gapCursorPluginKey$g = _gapCursorPluginKey.gapCursorPluginKey.getState(view.state),
|
|
63
|
-
selectionIsGapCursor = _gapCursorPluginKey$g.selectionIsGapCursor;
|
|
64
|
-
/**
|
|
65
|
-
* Starting with prosemirror-view 1.19.4, cursor wrapper that previously was hiding cursor doesn't exist:
|
|
66
|
-
* https://github.com/ProseMirror/prosemirror-view/commit/4a56bc7b7e61e96ef879d1dae1014ede0fc09e43
|
|
67
|
-
*
|
|
68
|
-
* Because it was causing issues with RTL: https://github.com/ProseMirror/prosemirror/issues/948
|
|
69
|
-
*
|
|
70
|
-
* This is the work around which uses `caret-color: transparent` in order to hide regular caret,
|
|
71
|
-
* when gap cursor is visible.
|
|
72
|
-
*
|
|
73
|
-
* Browser support is pretty good: https://caniuse.com/#feat=css-caret-color
|
|
74
|
-
*/
|
|
75
|
-
view.dom.classList.toggle(_selection.hideCaretModifier, selectionIsGapCursor);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
55
|
+
return {};
|
|
78
56
|
},
|
|
79
57
|
props: {
|
|
80
58
|
decorations: function decorations(editorState) {
|
|
81
59
|
var doc = editorState.doc,
|
|
82
60
|
selection = editorState.selection;
|
|
83
|
-
var _gapCursorPluginKey$
|
|
84
|
-
displayGapCursor = _gapCursorPluginKey$
|
|
85
|
-
hideCursor = _gapCursorPluginKey$
|
|
61
|
+
var _gapCursorPluginKey$g = _gapCursorPluginKey.gapCursorPluginKey.getState(editorState),
|
|
62
|
+
displayGapCursor = _gapCursorPluginKey$g.displayGapCursor,
|
|
63
|
+
hideCursor = _gapCursorPluginKey$g.hideCursor;
|
|
86
64
|
if (selection instanceof _selection.GapCursorSelection && displayGapCursor && !hideCursor) {
|
|
87
65
|
var $from = selection.$from,
|
|
88
66
|
side = selection.side;
|
|
@@ -16,6 +16,8 @@ var _keydown = require("./events/keydown");
|
|
|
16
16
|
var _mouseout = require("./events/mouseout");
|
|
17
17
|
var _pluginFactory = require("./plugin-factory");
|
|
18
18
|
var _utils = require("./utils");
|
|
19
|
+
// oxlint-disable-next-line import/no-duplicates
|
|
20
|
+
|
|
19
21
|
var getInitialState = exports.getInitialState = function getInitialState(state) {
|
|
20
22
|
return {
|
|
21
23
|
decorationSet: (0, _utils.getDecorations)(state.tr),
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { GapCursorSelection, Side as GapCursorSide,
|
|
2
|
+
import { GapCursorSelection, Side as GapCursorSide, JSON_ID, setGapCursorAtPos, Side } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { findPositionOfNodeBefore } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
7
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { selectionPluginKey } from '../types';
|
|
9
8
|
import { gapCursorPluginKey } from './gap-cursor-plugin-key';
|
|
10
9
|
import { deleteNode } from './gap-cursor/actions';
|
|
@@ -45,29 +44,7 @@ const plugin = new SafePlugin({
|
|
|
45
44
|
view.dispatch(view.state.tr.setSelection(new GapCursorSelection(view.state.doc.resolve(0), GapCursorSide.LEFT)));
|
|
46
45
|
});
|
|
47
46
|
}
|
|
48
|
-
return {
|
|
49
|
-
update(view) {
|
|
50
|
-
if (editorExperiment('platform_synced_block', true)) {
|
|
51
|
-
// Caret visibility now handled directly via CSS selector in gapCursorStyles.ts
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const {
|
|
55
|
-
selectionIsGapCursor
|
|
56
|
-
} = gapCursorPluginKey.getState(view.state);
|
|
57
|
-
/**
|
|
58
|
-
* Starting with prosemirror-view 1.19.4, cursor wrapper that previously was hiding cursor doesn't exist:
|
|
59
|
-
* https://github.com/ProseMirror/prosemirror-view/commit/4a56bc7b7e61e96ef879d1dae1014ede0fc09e43
|
|
60
|
-
*
|
|
61
|
-
* Because it was causing issues with RTL: https://github.com/ProseMirror/prosemirror/issues/948
|
|
62
|
-
*
|
|
63
|
-
* This is the work around which uses `caret-color: transparent` in order to hide regular caret,
|
|
64
|
-
* when gap cursor is visible.
|
|
65
|
-
*
|
|
66
|
-
* Browser support is pretty good: https://caniuse.com/#feat=css-caret-color
|
|
67
|
-
*/
|
|
68
|
-
view.dom.classList.toggle(hideCaretModifier, selectionIsGapCursor);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
47
|
+
return {};
|
|
71
48
|
},
|
|
72
49
|
props: {
|
|
73
50
|
decorations: editorState => {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
|
|
3
|
+
// oxlint-disable-next-line import/no-duplicates
|
|
4
|
+
|
|
2
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
6
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { GapCursorSelection, Side as GapCursorSide,
|
|
2
|
+
import { GapCursorSelection, Side as GapCursorSide, JSON_ID, setGapCursorAtPos, Side } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { findPositionOfNodeBefore } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
7
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { selectionPluginKey } from '../types';
|
|
9
8
|
import { gapCursorPluginKey } from './gap-cursor-plugin-key';
|
|
10
9
|
import { deleteNode } from './gap-cursor/actions';
|
|
@@ -47,36 +46,15 @@ var plugin = new SafePlugin({
|
|
|
47
46
|
_view.dispatch(_view.state.tr.setSelection(new GapCursorSelection(_view.state.doc.resolve(0), GapCursorSide.LEFT)));
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
|
-
return {
|
|
51
|
-
update: function update(view) {
|
|
52
|
-
if (editorExperiment('platform_synced_block', true)) {
|
|
53
|
-
// Caret visibility now handled directly via CSS selector in gapCursorStyles.ts
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
var _gapCursorPluginKey$g = gapCursorPluginKey.getState(view.state),
|
|
57
|
-
selectionIsGapCursor = _gapCursorPluginKey$g.selectionIsGapCursor;
|
|
58
|
-
/**
|
|
59
|
-
* Starting with prosemirror-view 1.19.4, cursor wrapper that previously was hiding cursor doesn't exist:
|
|
60
|
-
* https://github.com/ProseMirror/prosemirror-view/commit/4a56bc7b7e61e96ef879d1dae1014ede0fc09e43
|
|
61
|
-
*
|
|
62
|
-
* Because it was causing issues with RTL: https://github.com/ProseMirror/prosemirror/issues/948
|
|
63
|
-
*
|
|
64
|
-
* This is the work around which uses `caret-color: transparent` in order to hide regular caret,
|
|
65
|
-
* when gap cursor is visible.
|
|
66
|
-
*
|
|
67
|
-
* Browser support is pretty good: https://caniuse.com/#feat=css-caret-color
|
|
68
|
-
*/
|
|
69
|
-
view.dom.classList.toggle(hideCaretModifier, selectionIsGapCursor);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
49
|
+
return {};
|
|
72
50
|
},
|
|
73
51
|
props: {
|
|
74
52
|
decorations: function decorations(editorState) {
|
|
75
53
|
var doc = editorState.doc,
|
|
76
54
|
selection = editorState.selection;
|
|
77
|
-
var _gapCursorPluginKey$
|
|
78
|
-
displayGapCursor = _gapCursorPluginKey$
|
|
79
|
-
hideCursor = _gapCursorPluginKey$
|
|
55
|
+
var _gapCursorPluginKey$g = gapCursorPluginKey.getState(editorState),
|
|
56
|
+
displayGapCursor = _gapCursorPluginKey$g.displayGapCursor,
|
|
57
|
+
hideCursor = _gapCursorPluginKey$g.hideCursor;
|
|
80
58
|
if (selection instanceof GapCursorSelection && displayGapCursor && !hideCursor) {
|
|
81
59
|
var $from = selection.$from,
|
|
82
60
|
side = selection.side;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
|
|
3
|
+
// oxlint-disable-next-line import/no-duplicates
|
|
4
|
+
|
|
2
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
6
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.2",
|
|
4
4
|
"description": "Selection plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"singleton": true
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@atlaskit/editor-json-transformer": "^9.
|
|
22
|
+
"@atlaskit/editor-json-transformer": "^9.4.0",
|
|
23
23
|
"@atlaskit/editor-plugin-interaction": "^26.0.0",
|
|
24
24
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
25
25
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
26
26
|
"@atlaskit/editor-tables": "^3.0.0",
|
|
27
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
27
|
+
"@atlaskit/tmp-editor-statsig": "^149.0.0",
|
|
28
28
|
"@atlaskit/tokens": "^16.7.0",
|
|
29
29
|
"@babel/runtime": "^7.0.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@atlaskit/editor-common": "^119.
|
|
32
|
+
"@atlaskit/editor-common": "^119.7.0",
|
|
33
33
|
"react": "^18.2.0 || ^19.2.0"
|
|
34
34
|
},
|
|
35
35
|
"techstack": {
|