@atlaskit/editor-plugin-selection 6.1.3 → 6.1.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 +16 -0
- package/dist/cjs/pm-plugins/auto-expand-selection-range-on-inline-node-main.js +9 -1
- package/dist/cjs/pm-plugins/gap-cursor-main.js +10 -0
- package/dist/cjs/pm-plugins/mark-boundary-cursor/ui/mark-boundary-cursor-decoration.js +1 -1
- package/dist/cjs/pm-plugins/mark-boundary-cursor-main.js +1 -0
- package/dist/cjs/pm-plugins/selection-main.js +9 -0
- package/dist/cjs/pm-plugins/utils.js +1 -1
- package/dist/es2019/pm-plugins/auto-expand-selection-range-on-inline-node-main.js +9 -1
- package/dist/es2019/pm-plugins/gap-cursor-main.js +13 -0
- package/dist/es2019/pm-plugins/mark-boundary-cursor/ui/mark-boundary-cursor-decoration.js +1 -1
- package/dist/es2019/pm-plugins/mark-boundary-cursor-main.js +2 -0
- package/dist/es2019/pm-plugins/selection-main.js +12 -0
- package/dist/es2019/pm-plugins/utils.js +1 -1
- package/dist/esm/pm-plugins/auto-expand-selection-range-on-inline-node-main.js +9 -1
- package/dist/esm/pm-plugins/gap-cursor-main.js +10 -0
- package/dist/esm/pm-plugins/mark-boundary-cursor/ui/mark-boundary-cursor-decoration.js +1 -1
- package/dist/esm/pm-plugins/mark-boundary-cursor-main.js +1 -0
- package/dist/esm/pm-plugins/selection-main.js +9 -0
- package/dist/esm/pm-plugins/utils.js +1 -1
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection
|
|
2
2
|
|
|
3
|
+
## 6.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
|
|
8
|
+
ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
|
|
9
|
+
project refs are setup
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 6.1.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`43fc1f554344a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/43fc1f554344a) -
|
|
17
|
+
[EDITOR-3092] fg platform_editor_fix_right_arrow_nav_bug_in_layout cleanup
|
|
18
|
+
|
|
3
19
|
## 6.1.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -12,12 +12,18 @@ var createAutoExpandSelectionRangeOnInlineNodePlugin = exports.createAutoExpandS
|
|
|
12
12
|
return new _safePlugin.SafePlugin({
|
|
13
13
|
key: _autoExpandSelectionRangeOnInlineNodeKey.autoExpandSelectionRangeOnInlineNodePluginKey,
|
|
14
14
|
props: {
|
|
15
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
16
|
+
|
|
15
17
|
handleDOMEvents: {
|
|
18
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
19
|
+
|
|
16
20
|
mousedown: function mousedown(_view, event) {
|
|
17
21
|
// Ignored via go/ees005
|
|
18
22
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
19
23
|
mouseDownElement = event.target;
|
|
20
24
|
},
|
|
25
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
26
|
+
|
|
21
27
|
mouseup: function mouseup(view, event) {
|
|
22
28
|
// Ignored via go/ees005
|
|
23
29
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -63,7 +69,9 @@ var createAutoExpandSelectionRangeOnInlineNodePlugin = exports.createAutoExpandS
|
|
|
63
69
|
};
|
|
64
70
|
var isMouseUpOnSupportedNode = function isMouseUpOnSupportedNode(mouseUpElement) {
|
|
65
71
|
var supportedNodes = ['emoji', 'status', 'date', 'mention', 'inlineCard'];
|
|
66
|
-
var supportedNodeViewContentClassNamesList = supportedNodes
|
|
72
|
+
var supportedNodeViewContentClassNamesList = supportedNodes
|
|
73
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
74
|
+
.map(function (nodeType) {
|
|
67
75
|
return ".".concat(nodeType, "View-content-wrap");
|
|
68
76
|
}).join(', ');
|
|
69
77
|
return !!mouseUpElement.closest(supportedNodeViewContentClassNamesList);
|
|
@@ -26,6 +26,8 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
26
26
|
hideCursor: false
|
|
27
27
|
};
|
|
28
28
|
},
|
|
29
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
30
|
+
|
|
29
31
|
apply: function apply(tr, pluginState, _oldState, newState) {
|
|
30
32
|
var _meta$displayGapCurso, _selectionMeta$hideCu;
|
|
31
33
|
var meta = tr.getMeta(_gapCursorPluginKey.gapCursorPluginKey);
|
|
@@ -40,6 +42,8 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
},
|
|
45
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
46
|
+
|
|
43
47
|
view: function view(_view) {
|
|
44
48
|
/**
|
|
45
49
|
* If the selection is at the beginning of a document and is a NodeSelection,
|
|
@@ -53,6 +57,7 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
53
57
|
});
|
|
54
58
|
}
|
|
55
59
|
return {
|
|
60
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
56
61
|
update: function update(view) {
|
|
57
62
|
var _gapCursorPluginKey$g = _gapCursorPluginKey.gapCursorPluginKey.getState(view.state),
|
|
58
63
|
selectionIsGapCursor = _gapCursorPluginKey$g.selectionIsGapCursor;
|
|
@@ -102,6 +107,7 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
102
107
|
return null;
|
|
103
108
|
},
|
|
104
109
|
// render gap cursor only when its valid
|
|
110
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
105
111
|
createSelectionBetween: function createSelectionBetween(view, $anchor, $head) {
|
|
106
112
|
if (view && view.state && view.state.selection instanceof _cellSelection.CellSelection) {
|
|
107
113
|
// Do not show GapCursor when there is a CellSection happening
|
|
@@ -112,6 +118,7 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
112
118
|
}
|
|
113
119
|
return null;
|
|
114
120
|
},
|
|
121
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
115
122
|
handleClick: function handleClick(view, nodePos, event) {
|
|
116
123
|
var _$pos$parent;
|
|
117
124
|
var posAtCoords = view.posAtCoords({
|
|
@@ -145,6 +152,8 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
145
152
|
}
|
|
146
153
|
return (0, _selection.setGapCursorAtPos)(nodePos, side)(view.state, view.dispatch);
|
|
147
154
|
},
|
|
155
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
156
|
+
|
|
148
157
|
handleDOMEvents: {
|
|
149
158
|
/**
|
|
150
159
|
* Android composition events aren't handled well by Prosemirror
|
|
@@ -153,6 +162,7 @@ var plugin = new _safePlugin.SafePlugin({
|
|
|
153
162
|
* @see https://github.com/ProseMirror/prosemirror/issues/543
|
|
154
163
|
*/
|
|
155
164
|
// Ignored via go/ees005
|
|
165
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
156
166
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
157
167
|
beforeinput: function beforeinput(view, event) {
|
|
158
168
|
if (event.inputType === 'deleteContentBackward' && view.state.selection instanceof _selection.GapCursorSelection) {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createMarkBoundaryCursorDecoration = void 0;
|
|
7
7
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
8
8
|
var containerStyle = "\n\tposition: relative;\n";
|
|
9
|
-
var caretStyle = "\n\tposition: absolute;\n\theight: 100%;\n\twidth: 1px;\n\tleft: -0.5px;\n\tbottom: 0;\n\tbackground-color: ".concat("var(--ds-text, #
|
|
9
|
+
var caretStyle = "\n\tposition: absolute;\n\theight: 100%;\n\twidth: 1px;\n\tleft: -0.5px;\n\tbottom: 0;\n\tbackground-color: ".concat("var(--ds-text, #292A2E)", ";\n");
|
|
10
10
|
var toDOM = function toDOM() {
|
|
11
11
|
var _caret$animate;
|
|
12
12
|
var container = document.createElement('span');
|
|
@@ -18,6 +18,7 @@ var createMarkBoundaryCursorPlugin = exports.createMarkBoundaryCursorPlugin = fu
|
|
|
18
18
|
decorations: _view.DecorationSet.empty
|
|
19
19
|
};
|
|
20
20
|
},
|
|
21
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
21
22
|
apply: function apply(tr, currentState) {
|
|
22
23
|
var selection = tr.selection,
|
|
23
24
|
storedMarks = tr.storedMarks,
|
|
@@ -29,6 +29,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
|
|
|
29
29
|
return new _safePlugin.SafePlugin({
|
|
30
30
|
key: _types.selectionPluginKey,
|
|
31
31
|
state: (0, _pluginFactory.createPluginState)(dispatch, getInitialState),
|
|
32
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
32
33
|
appendTransaction: function appendTransaction(transactions, oldEditorState, newEditorState) {
|
|
33
34
|
var tr = newEditorState.tr;
|
|
34
35
|
var manualSelection;
|
|
@@ -66,6 +67,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
|
|
|
66
67
|
});
|
|
67
68
|
return tr;
|
|
68
69
|
},
|
|
70
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
69
71
|
filterTransaction: function filterTransaction(tr, state) {
|
|
70
72
|
// Prevent single click selecting atom nodes on mobile (we want to select with long press gesture instead)
|
|
71
73
|
if (options.useLongPressSelection && tr.selectionSet && tr.selection instanceof _state.NodeSelection && !tr.getMeta(_types.selectionPluginKey)) {
|
|
@@ -81,7 +83,10 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
|
|
|
81
83
|
return true;
|
|
82
84
|
},
|
|
83
85
|
props: {
|
|
86
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
87
|
+
|
|
84
88
|
createSelectionBetween: _createSelectionBetween.onCreateSelectionBetween,
|
|
89
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
85
90
|
decorations: function decorations(state) {
|
|
86
91
|
var _api$interaction;
|
|
87
92
|
var interactionState = api === null || api === void 0 || (_api$interaction = api.interaction) === null || _api$interaction === void 0 || (_api$interaction = _api$interaction.sharedState.currentState()) === null || _api$interaction === void 0 ? void 0 : _api$interaction.interactionState;
|
|
@@ -94,7 +99,11 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
|
|
|
94
99
|
}
|
|
95
100
|
return (0, _pluginFactory.getPluginState)(state).decorationSet;
|
|
96
101
|
},
|
|
102
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
103
|
+
|
|
97
104
|
handleDOMEvents: {
|
|
105
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
106
|
+
|
|
98
107
|
keydown: (0, _keydown.createOnKeydown)({
|
|
99
108
|
__livePage: options.__livePage
|
|
100
109
|
}),
|
|
@@ -275,7 +275,7 @@ var isSelectionAtEndOfParentNode = exports.isSelectionAtEndOfParentNode = functi
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
// Handle layout columns: if another node follows, not at end
|
|
278
|
-
if (isSelectionAtEndOfLayoutColumn($pos)
|
|
278
|
+
if (isSelectionAtEndOfLayoutColumn($pos)) {
|
|
279
279
|
return false;
|
|
280
280
|
}
|
|
281
281
|
|
|
@@ -6,12 +6,18 @@ export const createAutoExpandSelectionRangeOnInlineNodePlugin = () => {
|
|
|
6
6
|
return new SafePlugin({
|
|
7
7
|
key: autoExpandSelectionRangeOnInlineNodePluginKey,
|
|
8
8
|
props: {
|
|
9
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
10
|
+
|
|
9
11
|
handleDOMEvents: {
|
|
12
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
13
|
+
|
|
10
14
|
mousedown: (_view, event) => {
|
|
11
15
|
// Ignored via go/ees005
|
|
12
16
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
13
17
|
mouseDownElement = event.target;
|
|
14
18
|
},
|
|
19
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
20
|
+
|
|
15
21
|
mouseup: (view, event) => {
|
|
16
22
|
// Ignored via go/ees005
|
|
17
23
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -61,6 +67,8 @@ export const createAutoExpandSelectionRangeOnInlineNodePlugin = () => {
|
|
|
61
67
|
};
|
|
62
68
|
const isMouseUpOnSupportedNode = mouseUpElement => {
|
|
63
69
|
const supportedNodes = ['emoji', 'status', 'date', 'mention', 'inlineCard'];
|
|
64
|
-
const supportedNodeViewContentClassNamesList = supportedNodes
|
|
70
|
+
const supportedNodeViewContentClassNamesList = supportedNodes
|
|
71
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
72
|
+
.map(nodeType => `.${nodeType}View-content-wrap`).join(', ');
|
|
65
73
|
return !!mouseUpElement.closest(supportedNodeViewContentClassNamesList);
|
|
66
74
|
};
|
|
@@ -18,6 +18,8 @@ const plugin = new SafePlugin({
|
|
|
18
18
|
displayGapCursor: true,
|
|
19
19
|
hideCursor: false
|
|
20
20
|
}),
|
|
21
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
22
|
+
|
|
21
23
|
apply: (tr, pluginState, _oldState, newState) => {
|
|
22
24
|
var _meta$displayGapCurso, _selectionMeta$hideCu;
|
|
23
25
|
const meta = tr.getMeta(gapCursorPluginKey);
|
|
@@ -32,6 +34,8 @@ const plugin = new SafePlugin({
|
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
36
|
},
|
|
37
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
38
|
+
|
|
35
39
|
view: view => {
|
|
36
40
|
/**
|
|
37
41
|
* If the selection is at the beginning of a document and is a NodeSelection,
|
|
@@ -45,6 +49,8 @@ const plugin = new SafePlugin({
|
|
|
45
49
|
});
|
|
46
50
|
}
|
|
47
51
|
return {
|
|
52
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
53
|
+
|
|
48
54
|
update(view) {
|
|
49
55
|
const {
|
|
50
56
|
selectionIsGapCursor
|
|
@@ -100,6 +106,8 @@ const plugin = new SafePlugin({
|
|
|
100
106
|
return null;
|
|
101
107
|
},
|
|
102
108
|
// render gap cursor only when its valid
|
|
109
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
110
|
+
|
|
103
111
|
createSelectionBetween(view, $anchor, $head) {
|
|
104
112
|
if (view && view.state && view.state.selection instanceof CellSelection) {
|
|
105
113
|
// Do not show GapCursor when there is a CellSection happening
|
|
@@ -110,6 +118,8 @@ const plugin = new SafePlugin({
|
|
|
110
118
|
}
|
|
111
119
|
return null;
|
|
112
120
|
},
|
|
121
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
122
|
+
|
|
113
123
|
handleClick(view, nodePos, event) {
|
|
114
124
|
var _$pos$parent;
|
|
115
125
|
const posAtCoords = view.posAtCoords({
|
|
@@ -143,6 +153,8 @@ const plugin = new SafePlugin({
|
|
|
143
153
|
}
|
|
144
154
|
return setGapCursorAtPos(nodePos, side)(view.state, view.dispatch);
|
|
145
155
|
},
|
|
156
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
157
|
+
|
|
146
158
|
handleDOMEvents: {
|
|
147
159
|
/**
|
|
148
160
|
* Android composition events aren't handled well by Prosemirror
|
|
@@ -151,6 +163,7 @@ const plugin = new SafePlugin({
|
|
|
151
163
|
* @see https://github.com/ProseMirror/prosemirror/issues/543
|
|
152
164
|
*/
|
|
153
165
|
// Ignored via go/ees005
|
|
166
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
154
167
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
155
168
|
beforeinput: (view, event) => {
|
|
156
169
|
if (event.inputType === 'deleteContentBackward' && view.state.selection instanceof GapCursorSelection) {
|
|
@@ -20,6 +20,8 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
|
|
|
20
20
|
return new SafePlugin({
|
|
21
21
|
key: selectionPluginKey,
|
|
22
22
|
state: createPluginState(dispatch, getInitialState),
|
|
23
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
24
|
+
|
|
23
25
|
appendTransaction(transactions, oldEditorState, newEditorState) {
|
|
24
26
|
const {
|
|
25
27
|
tr
|
|
@@ -59,6 +61,8 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
|
|
|
59
61
|
});
|
|
60
62
|
return tr;
|
|
61
63
|
},
|
|
64
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
65
|
+
|
|
62
66
|
filterTransaction(tr, state) {
|
|
63
67
|
// Prevent single click selecting atom nodes on mobile (we want to select with long press gesture instead)
|
|
64
68
|
if (options.useLongPressSelection && tr.selectionSet && tr.selection instanceof NodeSelection && !tr.getMeta(selectionPluginKey)) {
|
|
@@ -74,7 +78,11 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
|
|
|
74
78
|
return true;
|
|
75
79
|
},
|
|
76
80
|
props: {
|
|
81
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
82
|
+
|
|
77
83
|
createSelectionBetween: onCreateSelectionBetween,
|
|
84
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
85
|
+
|
|
78
86
|
decorations(state) {
|
|
79
87
|
var _api$interaction, _api$interaction$shar;
|
|
80
88
|
const interactionState = api === null || api === void 0 ? void 0 : (_api$interaction = api.interaction) === null || _api$interaction === void 0 ? void 0 : (_api$interaction$shar = _api$interaction.sharedState.currentState()) === null || _api$interaction$shar === void 0 ? void 0 : _api$interaction$shar.interactionState;
|
|
@@ -87,7 +95,11 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
|
|
|
87
95
|
}
|
|
88
96
|
return getPluginState(state).decorationSet;
|
|
89
97
|
},
|
|
98
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
99
|
+
|
|
90
100
|
handleDOMEvents: {
|
|
101
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
102
|
+
|
|
91
103
|
keydown: createOnKeydown({
|
|
92
104
|
__livePage: options.__livePage
|
|
93
105
|
}),
|
|
@@ -262,7 +262,7 @@ export const isSelectionAtEndOfParentNode = ($pos, selection) => {
|
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
// Handle layout columns: if another node follows, not at end
|
|
265
|
-
if (isSelectionAtEndOfLayoutColumn($pos)
|
|
265
|
+
if (isSelectionAtEndOfLayoutColumn($pos)) {
|
|
266
266
|
return false;
|
|
267
267
|
}
|
|
268
268
|
|
|
@@ -6,12 +6,18 @@ export var createAutoExpandSelectionRangeOnInlineNodePlugin = function createAut
|
|
|
6
6
|
return new SafePlugin({
|
|
7
7
|
key: autoExpandSelectionRangeOnInlineNodePluginKey,
|
|
8
8
|
props: {
|
|
9
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
10
|
+
|
|
9
11
|
handleDOMEvents: {
|
|
12
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
13
|
+
|
|
10
14
|
mousedown: function mousedown(_view, event) {
|
|
11
15
|
// Ignored via go/ees005
|
|
12
16
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
13
17
|
mouseDownElement = event.target;
|
|
14
18
|
},
|
|
19
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
20
|
+
|
|
15
21
|
mouseup: function mouseup(view, event) {
|
|
16
22
|
// Ignored via go/ees005
|
|
17
23
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -57,7 +63,9 @@ export var createAutoExpandSelectionRangeOnInlineNodePlugin = function createAut
|
|
|
57
63
|
};
|
|
58
64
|
var isMouseUpOnSupportedNode = function isMouseUpOnSupportedNode(mouseUpElement) {
|
|
59
65
|
var supportedNodes = ['emoji', 'status', 'date', 'mention', 'inlineCard'];
|
|
60
|
-
var supportedNodeViewContentClassNamesList = supportedNodes
|
|
66
|
+
var supportedNodeViewContentClassNamesList = supportedNodes
|
|
67
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
68
|
+
.map(function (nodeType) {
|
|
61
69
|
return ".".concat(nodeType, "View-content-wrap");
|
|
62
70
|
}).join(', ');
|
|
63
71
|
return !!mouseUpElement.closest(supportedNodeViewContentClassNamesList);
|
|
@@ -20,6 +20,8 @@ var plugin = new SafePlugin({
|
|
|
20
20
|
hideCursor: false
|
|
21
21
|
};
|
|
22
22
|
},
|
|
23
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
24
|
+
|
|
23
25
|
apply: function apply(tr, pluginState, _oldState, newState) {
|
|
24
26
|
var _meta$displayGapCurso, _selectionMeta$hideCu;
|
|
25
27
|
var meta = tr.getMeta(gapCursorPluginKey);
|
|
@@ -34,6 +36,8 @@ var plugin = new SafePlugin({
|
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
},
|
|
39
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
40
|
+
|
|
37
41
|
view: function view(_view) {
|
|
38
42
|
/**
|
|
39
43
|
* If the selection is at the beginning of a document and is a NodeSelection,
|
|
@@ -47,6 +51,7 @@ var plugin = new SafePlugin({
|
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
53
|
return {
|
|
54
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
50
55
|
update: function update(view) {
|
|
51
56
|
var _gapCursorPluginKey$g = gapCursorPluginKey.getState(view.state),
|
|
52
57
|
selectionIsGapCursor = _gapCursorPluginKey$g.selectionIsGapCursor;
|
|
@@ -96,6 +101,7 @@ var plugin = new SafePlugin({
|
|
|
96
101
|
return null;
|
|
97
102
|
},
|
|
98
103
|
// render gap cursor only when its valid
|
|
104
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
99
105
|
createSelectionBetween: function createSelectionBetween(view, $anchor, $head) {
|
|
100
106
|
if (view && view.state && view.state.selection instanceof CellSelection) {
|
|
101
107
|
// Do not show GapCursor when there is a CellSection happening
|
|
@@ -106,6 +112,7 @@ var plugin = new SafePlugin({
|
|
|
106
112
|
}
|
|
107
113
|
return null;
|
|
108
114
|
},
|
|
115
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
109
116
|
handleClick: function handleClick(view, nodePos, event) {
|
|
110
117
|
var _$pos$parent;
|
|
111
118
|
var posAtCoords = view.posAtCoords({
|
|
@@ -139,6 +146,8 @@ var plugin = new SafePlugin({
|
|
|
139
146
|
}
|
|
140
147
|
return setGapCursorAtPos(nodePos, side)(view.state, view.dispatch);
|
|
141
148
|
},
|
|
149
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
150
|
+
|
|
142
151
|
handleDOMEvents: {
|
|
143
152
|
/**
|
|
144
153
|
* Android composition events aren't handled well by Prosemirror
|
|
@@ -147,6 +156,7 @@ var plugin = new SafePlugin({
|
|
|
147
156
|
* @see https://github.com/ProseMirror/prosemirror/issues/543
|
|
148
157
|
*/
|
|
149
158
|
// Ignored via go/ees005
|
|
159
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
150
160
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
151
161
|
beforeinput: function beforeinput(view, event) {
|
|
152
162
|
if (event.inputType === 'deleteContentBackward' && view.state.selection instanceof GapCursorSelection) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
var containerStyle = "\n\tposition: relative;\n";
|
|
3
|
-
var caretStyle = "\n\tposition: absolute;\n\theight: 100%;\n\twidth: 1px;\n\tleft: -0.5px;\n\tbottom: 0;\n\tbackground-color: ".concat("var(--ds-text, #
|
|
3
|
+
var caretStyle = "\n\tposition: absolute;\n\theight: 100%;\n\twidth: 1px;\n\tleft: -0.5px;\n\tbottom: 0;\n\tbackground-color: ".concat("var(--ds-text, #292A2E)", ";\n");
|
|
4
4
|
var toDOM = function toDOM() {
|
|
5
5
|
var _caret$animate;
|
|
6
6
|
var container = document.createElement('span');
|
|
@@ -12,6 +12,7 @@ export var createMarkBoundaryCursorPlugin = function createMarkBoundaryCursorPlu
|
|
|
12
12
|
decorations: DecorationSet.empty
|
|
13
13
|
};
|
|
14
14
|
},
|
|
15
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
15
16
|
apply: function apply(tr, currentState) {
|
|
16
17
|
var selection = tr.selection,
|
|
17
18
|
storedMarks = tr.storedMarks,
|
|
@@ -23,6 +23,7 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
|
|
|
23
23
|
return new SafePlugin({
|
|
24
24
|
key: selectionPluginKey,
|
|
25
25
|
state: createPluginState(dispatch, getInitialState),
|
|
26
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
26
27
|
appendTransaction: function appendTransaction(transactions, oldEditorState, newEditorState) {
|
|
27
28
|
var tr = newEditorState.tr;
|
|
28
29
|
var manualSelection;
|
|
@@ -60,6 +61,7 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
|
|
|
60
61
|
});
|
|
61
62
|
return tr;
|
|
62
63
|
},
|
|
64
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
63
65
|
filterTransaction: function filterTransaction(tr, state) {
|
|
64
66
|
// Prevent single click selecting atom nodes on mobile (we want to select with long press gesture instead)
|
|
65
67
|
if (options.useLongPressSelection && tr.selectionSet && tr.selection instanceof NodeSelection && !tr.getMeta(selectionPluginKey)) {
|
|
@@ -75,7 +77,10 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
|
|
|
75
77
|
return true;
|
|
76
78
|
},
|
|
77
79
|
props: {
|
|
80
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
81
|
+
|
|
78
82
|
createSelectionBetween: onCreateSelectionBetween,
|
|
83
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
79
84
|
decorations: function decorations(state) {
|
|
80
85
|
var _api$interaction;
|
|
81
86
|
var interactionState = api === null || api === void 0 || (_api$interaction = api.interaction) === null || _api$interaction === void 0 || (_api$interaction = _api$interaction.sharedState.currentState()) === null || _api$interaction === void 0 ? void 0 : _api$interaction.interactionState;
|
|
@@ -88,7 +93,11 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
|
|
|
88
93
|
}
|
|
89
94
|
return getPluginState(state).decorationSet;
|
|
90
95
|
},
|
|
96
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
97
|
+
|
|
91
98
|
handleDOMEvents: {
|
|
99
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
100
|
+
|
|
92
101
|
keydown: createOnKeydown({
|
|
93
102
|
__livePage: options.__livePage
|
|
94
103
|
}),
|
|
@@ -267,7 +267,7 @@ export var isSelectionAtEndOfParentNode = function isSelectionAtEndOfParentNode(
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
// Handle layout columns: if another node follows, not at end
|
|
270
|
-
if (isSelectionAtEndOfLayoutColumn($pos)
|
|
270
|
+
if (isSelectionAtEndOfLayoutColumn($pos)) {
|
|
271
271
|
return false;
|
|
272
272
|
}
|
|
273
273
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.5",
|
|
4
4
|
"description": "Selection plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
23
23
|
"@atlaskit/editor-plugin-interaction": "^10.0.0",
|
|
24
24
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
25
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
25
|
+
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
26
26
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
27
27
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
28
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
29
|
-
"@atlaskit/tokens": "^8.
|
|
28
|
+
"@atlaskit/tmp-editor-statsig": "^13.42.0",
|
|
29
|
+
"@atlaskit/tokens": "^8.3.0",
|
|
30
30
|
"@babel/runtime": "^7.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@atlaskit/editor-common": "^110.
|
|
33
|
+
"@atlaskit/editor-common": "^110.34.0",
|
|
34
34
|
"react": "^18.2.0"
|
|
35
35
|
},
|
|
36
36
|
"techstack": {
|
|
@@ -81,9 +81,6 @@
|
|
|
81
81
|
"platform_editor_nested_tables_gap_cursor": {
|
|
82
82
|
"type": "boolean"
|
|
83
83
|
},
|
|
84
|
-
"platform_editor_fix_right_arrow_nav_bug_in_layout": {
|
|
85
|
-
"type": "boolean"
|
|
86
|
-
},
|
|
87
84
|
"platform_editor_fix_list_item_nav_bug_in_layout": {
|
|
88
85
|
"type": "boolean"
|
|
89
86
|
},
|