@atlaskit/editor-plugin-block-controls 2.6.0 → 2.6.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
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 2.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#152656](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/152656)
|
|
8
|
+
[`07cd0baf1bb6f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/07cd0baf1bb6f) -
|
|
9
|
+
Fix corner case where getTrMetadata does not give full pos range
|
|
10
|
+
|
|
11
|
+
## 2.6.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#152510](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/152510)
|
|
16
|
+
[`dcf9edde7ac7b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dcf9edde7ac7b) -
|
|
17
|
+
bump adf-schema to 42.0.1
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 2.6.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -28,7 +28,7 @@ var isStepDelete = exports.isStepDelete = function isStepDelete(s) {
|
|
|
28
28
|
/**
|
|
29
29
|
* Get metadata from the transaction.
|
|
30
30
|
* @param tr
|
|
31
|
-
* @returns Min 'from', max 'to' (from + slice size). If no steps, returns pos range of entire doc.
|
|
31
|
+
* @returns Min 'from', max 'to' (from + slice size, or mapped 'to', whichever is larger). If no steps, returns pos range of entire doc.
|
|
32
32
|
* Number of ReplaceStep and ReplaceAroundStep steps 'numReplaceSteps'.
|
|
33
33
|
* 'isAllText' if all steps are represent adding inline text or a backspace/delete or no-op
|
|
34
34
|
*/
|
|
@@ -42,7 +42,9 @@ var getTrMetadata = exports.getTrMetadata = function getTrMetadata(tr) {
|
|
|
42
42
|
if (s instanceof _transform.ReplaceAroundStep || s instanceof _transform.ReplaceStep && !isStepText(s) && !isStepDelete(s)) {
|
|
43
43
|
isAllText = false;
|
|
44
44
|
}
|
|
45
|
+
var mappedTo = tr.mapping.map(s.to);
|
|
45
46
|
var $to = s.from + s.slice.size;
|
|
47
|
+
$to = $to > mappedTo ? $to : mappedTo;
|
|
46
48
|
from = from === undefined || from > s.from ? s.from : from;
|
|
47
49
|
to = to === undefined || to < $to ? $to : to;
|
|
48
50
|
numReplaceSteps++;
|
|
@@ -22,7 +22,7 @@ export const isStepDelete = s => {
|
|
|
22
22
|
/**
|
|
23
23
|
* Get metadata from the transaction.
|
|
24
24
|
* @param tr
|
|
25
|
-
* @returns Min 'from', max 'to' (from + slice size). If no steps, returns pos range of entire doc.
|
|
25
|
+
* @returns Min 'from', max 'to' (from + slice size, or mapped 'to', whichever is larger). If no steps, returns pos range of entire doc.
|
|
26
26
|
* Number of ReplaceStep and ReplaceAroundStep steps 'numReplaceSteps'.
|
|
27
27
|
* 'isAllText' if all steps are represent adding inline text or a backspace/delete or no-op
|
|
28
28
|
*/
|
|
@@ -36,7 +36,9 @@ export const getTrMetadata = tr => {
|
|
|
36
36
|
if (s instanceof ReplaceAroundStep || s instanceof ReplaceStep && !isStepText(s) && !isStepDelete(s)) {
|
|
37
37
|
isAllText = false;
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const mappedTo = tr.mapping.map(s.to);
|
|
40
|
+
let $to = s.from + s.slice.size;
|
|
41
|
+
$to = $to > mappedTo ? $to : mappedTo;
|
|
40
42
|
from = from === undefined || from > s.from ? s.from : from;
|
|
41
43
|
to = to === undefined || to < $to ? $to : to;
|
|
42
44
|
numReplaceSteps++;
|
|
@@ -22,7 +22,7 @@ export var isStepDelete = function isStepDelete(s) {
|
|
|
22
22
|
/**
|
|
23
23
|
* Get metadata from the transaction.
|
|
24
24
|
* @param tr
|
|
25
|
-
* @returns Min 'from', max 'to' (from + slice size). If no steps, returns pos range of entire doc.
|
|
25
|
+
* @returns Min 'from', max 'to' (from + slice size, or mapped 'to', whichever is larger). If no steps, returns pos range of entire doc.
|
|
26
26
|
* Number of ReplaceStep and ReplaceAroundStep steps 'numReplaceSteps'.
|
|
27
27
|
* 'isAllText' if all steps are represent adding inline text or a backspace/delete or no-op
|
|
28
28
|
*/
|
|
@@ -36,7 +36,9 @@ export var getTrMetadata = function getTrMetadata(tr) {
|
|
|
36
36
|
if (s instanceof ReplaceAroundStep || s instanceof ReplaceStep && !isStepText(s) && !isStepDelete(s)) {
|
|
37
37
|
isAllText = false;
|
|
38
38
|
}
|
|
39
|
+
var mappedTo = tr.mapping.map(s.to);
|
|
39
40
|
var $to = s.from + s.slice.size;
|
|
41
|
+
$to = $to > mappedTo ? $to : mappedTo;
|
|
40
42
|
from = from === undefined || from > s.from ? s.from : from;
|
|
41
43
|
to = to === undefined || to < $to ? $to : to;
|
|
42
44
|
numReplaceSteps++;
|
|
@@ -21,7 +21,7 @@ export declare const isStepDelete: (s: ReplaceStep) => boolean;
|
|
|
21
21
|
/**
|
|
22
22
|
* Get metadata from the transaction.
|
|
23
23
|
* @param tr
|
|
24
|
-
* @returns Min 'from', max 'to' (from + slice size). If no steps, returns pos range of entire doc.
|
|
24
|
+
* @returns Min 'from', max 'to' (from + slice size, or mapped 'to', whichever is larger). If no steps, returns pos range of entire doc.
|
|
25
25
|
* Number of ReplaceStep and ReplaceAroundStep steps 'numReplaceSteps'.
|
|
26
26
|
* 'isAllText' if all steps are represent adding inline text or a backspace/delete or no-op
|
|
27
27
|
*/
|
|
@@ -21,7 +21,7 @@ export declare const isStepDelete: (s: ReplaceStep) => boolean;
|
|
|
21
21
|
/**
|
|
22
22
|
* Get metadata from the transaction.
|
|
23
23
|
* @param tr
|
|
24
|
-
* @returns Min 'from', max 'to' (from + slice size). If no steps, returns pos range of entire doc.
|
|
24
|
+
* @returns Min 'from', max 'to' (from + slice size, or mapped 'to', whichever is larger). If no steps, returns pos range of entire doc.
|
|
25
25
|
* Number of ReplaceStep and ReplaceAroundStep steps 'numReplaceSteps'.
|
|
26
26
|
* 'isAllText' if all steps are represent adding inline text or a backspace/delete or no-op
|
|
27
27
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
".": "./src/index.ts"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@atlaskit/adf-schema": "^
|
|
34
|
-
"@atlaskit/editor-common": "^93.
|
|
33
|
+
"@atlaskit/adf-schema": "^42.0.2",
|
|
34
|
+
"@atlaskit/editor-common": "^93.5.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
|
|
49
49
|
"@atlaskit/primitives": "^12.2.0",
|
|
50
50
|
"@atlaskit/theme": "^13.1.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^2.5.0",
|
|
52
52
|
"@atlaskit/tokens": "^2.0.0",
|
|
53
53
|
"@atlaskit/tooltip": "^18.8.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|