@atlaskit/editor-plugin-block-controls 2.27.4 → 3.0.0
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 +26 -0
- package/dist/cjs/pm-plugins/decorations-drop-target.js +1 -1
- package/dist/cjs/pm-plugins/utils/validation.js +6 -1
- package/dist/es2019/pm-plugins/decorations-drop-target.js +1 -1
- package/dist/es2019/pm-plugins/utils/validation.js +6 -1
- package/dist/esm/pm-plugins/decorations-drop-target.js +1 -1
- package/dist/esm/pm-plugins/utils/validation.js +6 -1
- package/dist/types/pm-plugins/utils/validation.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/validation.d.ts +1 -1
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)
|
|
8
|
+
[`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -
|
|
9
|
+
This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the
|
|
10
|
+
status of only supporting React 18 going forward. No explicit breaking change to React support has
|
|
11
|
+
been made in this release, but this is to signify going forward, breaking changes for React 16 or
|
|
12
|
+
React 17 may come via non-major semver releases.
|
|
13
|
+
|
|
14
|
+
Please refer this community post for more details:
|
|
15
|
+
https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 2.27.5
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#116263](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116263)
|
|
26
|
+
[`1810b6677a5df`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1810b6677a5df) -
|
|
27
|
+
ED-26616:Multi select should not support drag to itself
|
|
28
|
+
|
|
3
29
|
## 2.27.4
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -217,7 +217,7 @@ var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetD
|
|
|
217
217
|
|
|
218
218
|
// when there is only one node in the slice, use the same logic as when multi select is not on
|
|
219
219
|
if (selectionSliceChildCount > 1 && handleInsideSelection) {
|
|
220
|
-
canDropMultipleNodes = (0, _validation.canMoveSliceToIndex)(selectionSlice, selectionFrom, parent, index, $pos);
|
|
220
|
+
canDropMultipleNodes = (0, _validation.canMoveSliceToIndex)(selectionSlice, selectionFrom, selectionTo, parent, index, $pos);
|
|
221
221
|
} else {
|
|
222
222
|
canDropSingleNode = !!(activePMNode && (0, _validation.canMoveNodeToIndex)(parent, index, activePMNode, $pos, node));
|
|
223
223
|
}
|
|
@@ -121,10 +121,15 @@ function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNodePos,
|
|
|
121
121
|
}
|
|
122
122
|
return destParent.canReplaceWith(indexIntoParent, indexIntoParent, srcNodeType);
|
|
123
123
|
}
|
|
124
|
-
function canMoveSliceToIndex(slice, sliceFromPos, destParent, indexIntoParent, $destNodePos, destNode) {
|
|
124
|
+
function canMoveSliceToIndex(slice, sliceFromPos, sliceToPos, destParent, indexIntoParent, $destNodePos, destNode) {
|
|
125
125
|
var canMoveNodes = true;
|
|
126
126
|
var doc = $destNodePos.doc;
|
|
127
127
|
var nodesPos = [];
|
|
128
|
+
|
|
129
|
+
// Drag multiple nodes to be inside themselves not allowed
|
|
130
|
+
if ($destNodePos.pos < sliceToPos && $destNodePos.pos >= sliceFromPos) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
128
133
|
for (var i = 0; i < slice.content.childCount; i++) {
|
|
129
134
|
var node = slice.content.maybeChild(i);
|
|
130
135
|
if (i === 0) {
|
|
@@ -205,7 +205,7 @@ export const dropTargetDecorations = (newState, api, formatMessage, nodeViewPort
|
|
|
205
205
|
|
|
206
206
|
// when there is only one node in the slice, use the same logic as when multi select is not on
|
|
207
207
|
if (selectionSliceChildCount > 1 && handleInsideSelection) {
|
|
208
|
-
canDropMultipleNodes = canMoveSliceToIndex(selectionSlice, selectionFrom, parent, index, $pos);
|
|
208
|
+
canDropMultipleNodes = canMoveSliceToIndex(selectionSlice, selectionFrom, selectionTo, parent, index, $pos);
|
|
209
209
|
} else {
|
|
210
210
|
canDropSingleNode = !!(activePMNode && canMoveNodeToIndex(parent, index, activePMNode, $pos, node));
|
|
211
211
|
}
|
|
@@ -114,10 +114,15 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
|
|
|
114
114
|
}
|
|
115
115
|
return destParent.canReplaceWith(indexIntoParent, indexIntoParent, srcNodeType);
|
|
116
116
|
}
|
|
117
|
-
export function canMoveSliceToIndex(slice, sliceFromPos, destParent, indexIntoParent, $destNodePos, destNode) {
|
|
117
|
+
export function canMoveSliceToIndex(slice, sliceFromPos, sliceToPos, destParent, indexIntoParent, $destNodePos, destNode) {
|
|
118
118
|
let canMoveNodes = true;
|
|
119
119
|
const doc = $destNodePos.doc;
|
|
120
120
|
const nodesPos = [];
|
|
121
|
+
|
|
122
|
+
// Drag multiple nodes to be inside themselves not allowed
|
|
123
|
+
if ($destNodePos.pos < sliceToPos && $destNodePos.pos >= sliceFromPos) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
121
126
|
for (let i = 0; i < slice.content.childCount; i++) {
|
|
122
127
|
const node = slice.content.maybeChild(i);
|
|
123
128
|
if (i === 0) {
|
|
@@ -210,7 +210,7 @@ export var dropTargetDecorations = function dropTargetDecorations(newState, api,
|
|
|
210
210
|
|
|
211
211
|
// when there is only one node in the slice, use the same logic as when multi select is not on
|
|
212
212
|
if (selectionSliceChildCount > 1 && handleInsideSelection) {
|
|
213
|
-
canDropMultipleNodes = canMoveSliceToIndex(selectionSlice, selectionFrom, parent, index, $pos);
|
|
213
|
+
canDropMultipleNodes = canMoveSliceToIndex(selectionSlice, selectionFrom, selectionTo, parent, index, $pos);
|
|
214
214
|
} else {
|
|
215
215
|
canDropSingleNode = !!(activePMNode && canMoveNodeToIndex(parent, index, activePMNode, $pos, node));
|
|
216
216
|
}
|
|
@@ -112,10 +112,15 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
|
|
|
112
112
|
}
|
|
113
113
|
return destParent.canReplaceWith(indexIntoParent, indexIntoParent, srcNodeType);
|
|
114
114
|
}
|
|
115
|
-
export function canMoveSliceToIndex(slice, sliceFromPos, destParent, indexIntoParent, $destNodePos, destNode) {
|
|
115
|
+
export function canMoveSliceToIndex(slice, sliceFromPos, sliceToPos, destParent, indexIntoParent, $destNodePos, destNode) {
|
|
116
116
|
var canMoveNodes = true;
|
|
117
117
|
var doc = $destNodePos.doc;
|
|
118
118
|
var nodesPos = [];
|
|
119
|
+
|
|
120
|
+
// Drag multiple nodes to be inside themselves not allowed
|
|
121
|
+
if ($destNodePos.pos < sliceToPos && $destNodePos.pos >= sliceFromPos) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
119
124
|
for (var i = 0; i < slice.content.childCount; i++) {
|
|
120
125
|
var node = slice.content.maybeChild(i);
|
|
121
126
|
if (i === 0) {
|
|
@@ -17,4 +17,4 @@ export declare const transformExpandToNestedExpand: (expandNode: PMNode) => PMNo
|
|
|
17
17
|
export declare const transformSliceExpandToNestedExpand: (slice: Slice) => Slice | null;
|
|
18
18
|
export declare const memoizedTransformExpandToNestedExpand: import("memoize-one").MemoizedFn<(node: PMNode) => PMNode | null>;
|
|
19
19
|
export declare function canMoveNodeToIndex(destParent: PMNode, indexIntoParent: number, srcNode: PMNode, $destNodePos: ResolvedPos, destNode?: PMNode): boolean;
|
|
20
|
-
export declare function canMoveSliceToIndex(slice: Slice, sliceFromPos: number, destParent: PMNode, indexIntoParent: number, $destNodePos: ResolvedPos, destNode?: PMNode): boolean;
|
|
20
|
+
export declare function canMoveSliceToIndex(slice: Slice, sliceFromPos: number, sliceToPos: number, destParent: PMNode, indexIntoParent: number, $destNodePos: ResolvedPos, destNode?: PMNode): boolean;
|
|
@@ -17,4 +17,4 @@ export declare const transformExpandToNestedExpand: (expandNode: PMNode) => PMNo
|
|
|
17
17
|
export declare const transformSliceExpandToNestedExpand: (slice: Slice) => Slice | null;
|
|
18
18
|
export declare const memoizedTransformExpandToNestedExpand: import("memoize-one").MemoizedFn<(node: PMNode) => PMNode | null>;
|
|
19
19
|
export declare function canMoveNodeToIndex(destParent: PMNode, indexIntoParent: number, srcNode: PMNode, $destNodePos: ResolvedPos, destNode?: PMNode): boolean;
|
|
20
|
-
export declare function canMoveSliceToIndex(slice: Slice, sliceFromPos: number, destParent: PMNode, indexIntoParent: number, $destNodePos: ResolvedPos, destNode?: PMNode): boolean;
|
|
20
|
+
export declare function canMoveSliceToIndex(slice: Slice, sliceFromPos: number, sliceToPos: number, destParent: PMNode, indexIntoParent: number, $destNodePos: ResolvedPos, destNode?: PMNode): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,27 +31,27 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/adf-schema": "^47.2.1",
|
|
34
|
-
"@atlaskit/editor-common": "^
|
|
35
|
-
"@atlaskit/editor-plugin-accessibility-utils": "^
|
|
36
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
37
|
-
"@atlaskit/editor-plugin-editor-disabled": "^
|
|
34
|
+
"@atlaskit/editor-common": "^100.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-analytics": "^2.0.0",
|
|
37
|
+
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-feature-flags": "^1.3.0",
|
|
39
|
-
"@atlaskit/editor-plugin-quick-insert": "^
|
|
40
|
-
"@atlaskit/editor-plugin-selection": "^
|
|
41
|
-
"@atlaskit/editor-plugin-width": "^
|
|
39
|
+
"@atlaskit/editor-plugin-quick-insert": "^2.0.0",
|
|
40
|
+
"@atlaskit/editor-plugin-selection": "^2.0.0",
|
|
41
|
+
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
43
43
|
"@atlaskit/editor-shared-styles": "^3.3.0",
|
|
44
44
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
45
|
-
"@atlaskit/icon": "^
|
|
45
|
+
"@atlaskit/icon": "^24.0.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
47
|
"@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
|
|
48
48
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
49
|
-
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^
|
|
50
|
-
"@atlaskit/primitives": "^
|
|
51
|
-
"@atlaskit/theme": "^
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
53
|
-
"@atlaskit/tokens": "^
|
|
54
|
-
"@atlaskit/tooltip": "^
|
|
49
|
+
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^2.0.0",
|
|
50
|
+
"@atlaskit/primitives": "^14.0.0",
|
|
51
|
+
"@atlaskit/theme": "^17.0.0",
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^3.0.0",
|
|
53
|
+
"@atlaskit/tokens": "^4.0.0",
|
|
54
|
+
"@atlaskit/tooltip": "^20.0.0",
|
|
55
55
|
"@babel/runtime": "^7.0.0",
|
|
56
56
|
"@emotion/react": "^11.7.1",
|
|
57
57
|
"bind-event-listener": "^3.0.0",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"uuid": "^3.1.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"react": "^
|
|
64
|
-
"react-dom": "^
|
|
63
|
+
"react": "^18.2.0",
|
|
64
|
+
"react-dom": "^18.2.0",
|
|
65
65
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
66
66
|
},
|
|
67
67
|
"techstack": {
|