@atlaskit/editor-plugin-selection-extension 10.0.3 → 10.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 +13 -0
- package/dist/cjs/pm-plugins/utils/index.js +6 -1
- package/dist/cjs/pm-plugins/utils/selection-helpers.js +2 -2
- package/dist/es2019/pm-plugins/utils/index.js +7 -2
- package/dist/es2019/pm-plugins/utils/selection-helpers.js +2 -2
- package/dist/esm/pm-plugins/utils/index.js +7 -2
- package/dist/esm/pm-plugins/utils/selection-helpers.js +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-extension
|
|
2
2
|
|
|
3
|
+
## 10.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 10.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`01e7a0b3e1d7a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/01e7a0b3e1d7a) -
|
|
14
|
+
Fix range error when select multiple paragraphs
|
|
15
|
+
|
|
3
16
|
## 10.0.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -185,12 +185,17 @@ function getSelectionAdfInfoNew(selection) {
|
|
|
185
185
|
} else {
|
|
186
186
|
var $from = selection.$from,
|
|
187
187
|
$to = selection.$to;
|
|
188
|
-
if ($from.parent === $to.parent) {
|
|
188
|
+
if ($from.parent === $to.parent && $from.depth > 0) {
|
|
189
189
|
selectionInfo = (0, _selectionHelpers.getSelectionInfoFromSameNode)(selection);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
} else if (selection instanceof _editorTables.CellSelection) {
|
|
193
193
|
selectionInfo = getSelectionInfoFromCellSelection(selection);
|
|
194
|
+
} else if (selection instanceof _state.NodeSelection) {
|
|
195
|
+
selectionInfo = {
|
|
196
|
+
selectedNode: selection.node,
|
|
197
|
+
nodePos: selection.from
|
|
198
|
+
};
|
|
194
199
|
}
|
|
195
200
|
var serializer = new _editorJsonTransformer.JSONTransformer();
|
|
196
201
|
var selectedNodeAdf = serializer.encodeNode(selectionInfo.selectedNode);
|
|
@@ -208,8 +208,8 @@ var getSelectionInfo = exports.getSelectionInfo = function getSelectionInfo(sele
|
|
|
208
208
|
var $from = selection.$from,
|
|
209
209
|
$to = selection.$to;
|
|
210
210
|
|
|
211
|
-
// For same parent selections, check for parent container
|
|
212
|
-
if ($from.parent === $to.parent) {
|
|
211
|
+
// For same parent selections but not the r, check for parent container
|
|
212
|
+
if ($from.parent === $to.parent && $from.depth > 0) {
|
|
213
213
|
var _getCommonParentConta = getCommonParentContainer($from, $to),
|
|
214
214
|
parentNode = _getCommonParentConta.node,
|
|
215
215
|
parentNodePos = _getCommonParentConta.pos;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
2
2
|
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
3
3
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { Transform } from '@atlaskit/editor-prosemirror/transform';
|
|
6
6
|
import { akEditorFullPageToolbarHeight } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { CellSelection, TableMap } from '@atlaskit/editor-tables';
|
|
@@ -191,12 +191,17 @@ export function getSelectionAdfInfoNew(selection) {
|
|
|
191
191
|
$from,
|
|
192
192
|
$to
|
|
193
193
|
} = selection;
|
|
194
|
-
if ($from.parent === $to.parent) {
|
|
194
|
+
if ($from.parent === $to.parent && $from.depth > 0) {
|
|
195
195
|
selectionInfo = getSelectionInfoFromSameNode(selection);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
} else if (selection instanceof CellSelection) {
|
|
199
199
|
selectionInfo = getSelectionInfoFromCellSelection(selection);
|
|
200
|
+
} else if (selection instanceof NodeSelection) {
|
|
201
|
+
selectionInfo = {
|
|
202
|
+
selectedNode: selection.node,
|
|
203
|
+
nodePos: selection.from
|
|
204
|
+
};
|
|
200
205
|
}
|
|
201
206
|
const serializer = new JSONTransformer();
|
|
202
207
|
const selectedNodeAdf = serializer.encodeNode(selectionInfo.selectedNode);
|
|
@@ -200,8 +200,8 @@ export const getSelectionInfo = (selection, schema) => {
|
|
|
200
200
|
$to
|
|
201
201
|
} = selection;
|
|
202
202
|
|
|
203
|
-
// For same parent selections, check for parent container
|
|
204
|
-
if ($from.parent === $to.parent) {
|
|
203
|
+
// For same parent selections but not the r, check for parent container
|
|
204
|
+
if ($from.parent === $to.parent && $from.depth > 0) {
|
|
205
205
|
const {
|
|
206
206
|
node: parentNode,
|
|
207
207
|
pos: parentNodePos
|
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
5
5
|
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
6
6
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
8
8
|
import { Transform } from '@atlaskit/editor-prosemirror/transform';
|
|
9
9
|
import { akEditorFullPageToolbarHeight } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { CellSelection, TableMap } from '@atlaskit/editor-tables';
|
|
@@ -175,12 +175,17 @@ export function getSelectionAdfInfoNew(selection) {
|
|
|
175
175
|
} else {
|
|
176
176
|
var $from = selection.$from,
|
|
177
177
|
$to = selection.$to;
|
|
178
|
-
if ($from.parent === $to.parent) {
|
|
178
|
+
if ($from.parent === $to.parent && $from.depth > 0) {
|
|
179
179
|
selectionInfo = getSelectionInfoFromSameNode(selection);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
} else if (selection instanceof CellSelection) {
|
|
183
183
|
selectionInfo = getSelectionInfoFromCellSelection(selection);
|
|
184
|
+
} else if (selection instanceof NodeSelection) {
|
|
185
|
+
selectionInfo = {
|
|
186
|
+
selectedNode: selection.node,
|
|
187
|
+
nodePos: selection.from
|
|
188
|
+
};
|
|
184
189
|
}
|
|
185
190
|
var serializer = new JSONTransformer();
|
|
186
191
|
var selectedNodeAdf = serializer.encodeNode(selectionInfo.selectedNode);
|
|
@@ -201,8 +201,8 @@ export var getSelectionInfo = function getSelectionInfo(selection, schema) {
|
|
|
201
201
|
var $from = selection.$from,
|
|
202
202
|
$to = selection.$to;
|
|
203
203
|
|
|
204
|
-
// For same parent selections, check for parent container
|
|
205
|
-
if ($from.parent === $to.parent) {
|
|
204
|
+
// For same parent selections but not the r, check for parent container
|
|
205
|
+
if ($from.parent === $to.parent && $from.depth > 0) {
|
|
206
206
|
var _getCommonParentConta = getCommonParentContainer($from, $to),
|
|
207
207
|
parentNode = _getCommonParentConta.node,
|
|
208
208
|
parentNodePos = _getCommonParentConta.pos;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.5",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
48
48
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
49
49
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
50
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
50
|
+
"@atlaskit/editor-toolbar": "^0.19.0",
|
|
51
51
|
"@atlaskit/icon": "^29.4.0",
|
|
52
52
|
"@atlaskit/lozenge": "^13.3.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
54
54
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
55
55
|
"@atlaskit/primitives": "^17.0.0",
|
|
56
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^16.11.0",
|
|
57
57
|
"@atlaskit/tokens": "^9.1.0",
|
|
58
58
|
"@babel/runtime": "^7.0.0",
|
|
59
59
|
"lodash": "^4.17.21",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"uuid": "^3.1.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@atlaskit/editor-common": "^111.
|
|
64
|
+
"@atlaskit/editor-common": "^111.7.0",
|
|
65
65
|
"react": "^18.2.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|