@atlaskit/editor-plugin-block-type 3.0.25 → 3.0.27
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,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
|
2
2
|
|
|
3
|
+
## 3.0.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#78224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78224) [`6b4c9dd4ad34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b4c9dd4ad34) - ED-22219: adf-schema updated to 35.5.2
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 3.0.26
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#76093](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/76093) [`fc113e0c416f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fc113e0c416f) - ED-22243 handling of backspace for mediaGroup node nested in panel
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 3.0.25
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -16,6 +16,9 @@ var isSelectedNodeSoleDecisionItem = function isSelectedNodeSoleDecisionItem(sta
|
|
|
16
16
|
var decisionList = (_findParentNodeOfType = (0, _utils.findParentNodeOfType)([state.schema.nodes.decisionList])(state.selection)) === null || _findParentNodeOfType === void 0 ? void 0 : _findParentNodeOfType.node;
|
|
17
17
|
return (decisionList === null || decisionList === void 0 ? void 0 : decisionList.childCount) === 1;
|
|
18
18
|
};
|
|
19
|
+
var isSelectedNodeMediaGroup = function isSelectedNodeMediaGroup(state) {
|
|
20
|
+
return Boolean(state.selection instanceof _state.NodeSelection && state.selection.node.type.name === 'media' && state.selection.$head.parent.type.name === 'mediaGroup');
|
|
21
|
+
};
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
24
|
* Prevent removing the block when deleting block content
|
|
@@ -46,11 +49,12 @@ function deleteBlockContent(isNodeAWrappingBlockNode) {
|
|
|
46
49
|
if (!selectionCrossesWrappingBlockNode) {
|
|
47
50
|
return false;
|
|
48
51
|
}
|
|
49
|
-
var
|
|
52
|
+
var isParentNodeOfTypePanel = (0, _utils.hasParentNodeOfType)([state.schema.nodes.panel])(state.selection);
|
|
50
53
|
|
|
51
54
|
// If decision is inside panel and the decision list have only one decision item which is selected,
|
|
52
55
|
// delete the whole decision list.
|
|
53
|
-
if
|
|
56
|
+
// Also, checks if selection is a mediaGroup node within a panel
|
|
57
|
+
if (isParentNodeOfTypePanel && (isSelectedNodeSoleDecisionItem(state) || isSelectedNodeMediaGroup(state))) {
|
|
54
58
|
tr.setSelection(new _state.TextSelection(tr.doc.resolve($from.before()))).delete($from.before(), $from.after());
|
|
55
59
|
} else {
|
|
56
60
|
tr.delete($from.pos, $to.pos);
|
|
@@ -11,6 +11,9 @@ const isSelectedNodeSoleDecisionItem = state => {
|
|
|
11
11
|
const decisionList = (_findParentNodeOfType = findParentNodeOfType([state.schema.nodes.decisionList])(state.selection)) === null || _findParentNodeOfType === void 0 ? void 0 : _findParentNodeOfType.node;
|
|
12
12
|
return (decisionList === null || decisionList === void 0 ? void 0 : decisionList.childCount) === 1;
|
|
13
13
|
};
|
|
14
|
+
const isSelectedNodeMediaGroup = state => {
|
|
15
|
+
return Boolean(state.selection instanceof NodeSelection && state.selection.node.type.name === 'media' && state.selection.$head.parent.type.name === 'mediaGroup');
|
|
16
|
+
};
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* Prevent removing the block when deleting block content
|
|
@@ -44,11 +47,12 @@ export function deleteBlockContent(isNodeAWrappingBlockNode) {
|
|
|
44
47
|
if (!selectionCrossesWrappingBlockNode) {
|
|
45
48
|
return false;
|
|
46
49
|
}
|
|
47
|
-
const
|
|
50
|
+
const isParentNodeOfTypePanel = hasParentNodeOfType([state.schema.nodes.panel])(state.selection);
|
|
48
51
|
|
|
49
52
|
// If decision is inside panel and the decision list have only one decision item which is selected,
|
|
50
53
|
// delete the whole decision list.
|
|
51
|
-
if
|
|
54
|
+
// Also, checks if selection is a mediaGroup node within a panel
|
|
55
|
+
if (isParentNodeOfTypePanel && (isSelectedNodeSoleDecisionItem(state) || isSelectedNodeMediaGroup(state))) {
|
|
52
56
|
tr.setSelection(new TextSelection(tr.doc.resolve($from.before()))).delete($from.before(), $from.after());
|
|
53
57
|
} else {
|
|
54
58
|
tr.delete($from.pos, $to.pos);
|
|
@@ -11,6 +11,9 @@ var isSelectedNodeSoleDecisionItem = function isSelectedNodeSoleDecisionItem(sta
|
|
|
11
11
|
var decisionList = (_findParentNodeOfType = findParentNodeOfType([state.schema.nodes.decisionList])(state.selection)) === null || _findParentNodeOfType === void 0 ? void 0 : _findParentNodeOfType.node;
|
|
12
12
|
return (decisionList === null || decisionList === void 0 ? void 0 : decisionList.childCount) === 1;
|
|
13
13
|
};
|
|
14
|
+
var isSelectedNodeMediaGroup = function isSelectedNodeMediaGroup(state) {
|
|
15
|
+
return Boolean(state.selection instanceof NodeSelection && state.selection.node.type.name === 'media' && state.selection.$head.parent.type.name === 'mediaGroup');
|
|
16
|
+
};
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* Prevent removing the block when deleting block content
|
|
@@ -41,11 +44,12 @@ export function deleteBlockContent(isNodeAWrappingBlockNode) {
|
|
|
41
44
|
if (!selectionCrossesWrappingBlockNode) {
|
|
42
45
|
return false;
|
|
43
46
|
}
|
|
44
|
-
var
|
|
47
|
+
var isParentNodeOfTypePanel = hasParentNodeOfType([state.schema.nodes.panel])(state.selection);
|
|
45
48
|
|
|
46
49
|
// If decision is inside panel and the decision list have only one decision item which is selected,
|
|
47
50
|
// delete the whole decision list.
|
|
48
|
-
if
|
|
51
|
+
// Also, checks if selection is a mediaGroup node within a panel
|
|
52
|
+
if (isParentNodeOfTypePanel && (isSelectedNodeSoleDecisionItem(state) || isSelectedNodeMediaGroup(state))) {
|
|
49
53
|
tr.setSelection(new TextSelection(tr.doc.resolve($from.before()))).delete($from.before(), $from.after());
|
|
50
54
|
} else {
|
|
51
55
|
tr.delete($from.pos, $to.pos);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.27",
|
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"./styles": "./src/styles.ts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@atlaskit/adf-schema": "^35.5.
|
|
39
|
-
"@atlaskit/editor-common": "^78.
|
|
38
|
+
"@atlaskit/adf-schema": "^35.5.2",
|
|
39
|
+
"@atlaskit/editor-common": "^78.10.0",
|
|
40
40
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
42
42
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.2.5",
|
|
46
46
|
"@atlaskit/prosemirror-input-rules": "^3.0.0",
|
|
47
47
|
"@atlaskit/theme": "^12.6.0",
|
|
48
|
-
"@atlaskit/tokens": "^1.
|
|
48
|
+
"@atlaskit/tokens": "^1.39.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"@emotion/react": "^11.7.1"
|
|
51
51
|
},
|