@atlaskit/editor-plugin-block-controls 11.4.0 → 11.4.1
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 +8 -0
- package/dist/cjs/editor-commands/move-to-layout.js +1 -3
- package/dist/cjs/pm-plugins/decorations-drop-target-active.js +1 -3
- package/dist/cjs/pm-plugins/decorations-find-surrounding-nodes.js +1 -5
- package/dist/cjs/pm-plugins/utils/inline-drop-target.js +1 -1
- package/dist/cjs/ui/drop-target.js +2 -10
- package/dist/es2019/editor-commands/move-to-layout.js +1 -3
- package/dist/es2019/pm-plugins/decorations-drop-target-active.js +1 -3
- package/dist/es2019/pm-plugins/decorations-find-surrounding-nodes.js +1 -5
- package/dist/es2019/pm-plugins/utils/inline-drop-target.js +1 -1
- package/dist/es2019/ui/drop-target.js +2 -10
- package/dist/esm/editor-commands/move-to-layout.js +1 -3
- package/dist/esm/pm-plugins/decorations-drop-target-active.js +1 -3
- package/dist/esm/pm-plugins/decorations-find-surrounding-nodes.js +1 -5
- package/dist/esm/pm-plugins/utils/inline-drop-target.js +1 -1
- package/dist/esm/ui/drop-target.js +2 -10
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 11.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4c459a2718b67`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4c459a2718b67) -
|
|
8
|
+
Clean up synced block feature gates
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 11.4.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -116,9 +116,7 @@ var canMoveToLayout = function canMoveToLayout(api, from, to, tr, moveNodeAtCurs
|
|
|
116
116
|
}
|
|
117
117
|
var $to = tr.doc.resolve(to);
|
|
118
118
|
var allowedParentTypes = [doc, layoutSection];
|
|
119
|
-
if (bodiedSyncBlock && (0, _experiments.editorExperiment)('platform_synced_block', true)
|
|
120
|
-
exposure: true
|
|
121
|
-
})) {
|
|
119
|
+
if (bodiedSyncBlock && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
|
|
122
120
|
allowedParentTypes.push(bodiedSyncBlock);
|
|
123
121
|
}
|
|
124
122
|
|
|
@@ -209,9 +209,7 @@ var getActiveDropTargetDecorations = exports.getActiveDropTargetDecorations = fu
|
|
|
209
209
|
}
|
|
210
210
|
var anchorEmitNodeWithPos = rootNodeWithPos;
|
|
211
211
|
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
212
|
-
if ((0, _experiments.editorExperiment)('platform_synced_block', true)
|
|
213
|
-
exposure: true
|
|
214
|
-
})) {
|
|
212
|
+
if ((0, _experiments.editorExperiment)('platform_synced_block', true)) {
|
|
215
213
|
var schema = rootNodeWithPos.node.type.schema;
|
|
216
214
|
var layoutSection = schema.nodes.layoutSection;
|
|
217
215
|
var isLayoutSectionChildOfRoot = (0, _utils2.findChildrenByType)(rootNodeWithPos.node, layoutSection, false).length > 0;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.findSurroundingNodes = void 0;
|
|
7
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
8
7
|
var IGNORE_NODES = ['tableRow', 'listItem', 'caption', 'media'];
|
|
9
|
-
var blockLeafNodes = ['blockCard', 'rule', 'extension'];
|
|
10
8
|
var blockLeafNodeNext = ['blockCard', 'rule', 'extension', 'syncBlock'];
|
|
11
9
|
var DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
|
|
12
10
|
|
|
@@ -21,9 +19,7 @@ var DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
|
|
|
21
19
|
*/
|
|
22
20
|
var _findSurroundingNodes = exports.findSurroundingNodes = function findSurroundingNodes(state, $pos, nodeType) {
|
|
23
21
|
var depth = $pos.depth;
|
|
24
|
-
var blockLeafNodeList =
|
|
25
|
-
exposure: true
|
|
26
|
-
}) ? blockLeafNodeNext : blockLeafNodes;
|
|
22
|
+
var blockLeafNodeList = blockLeafNodeNext;
|
|
27
23
|
|
|
28
24
|
// special cases like hr rule here
|
|
29
25
|
if (blockLeafNodeList.includes(nodeType || '') || $pos.pos === 0) {
|
|
@@ -16,7 +16,7 @@ var shouldAllowInlineDropTarget = exports.shouldAllowInlineDropTarget = function
|
|
|
16
16
|
var isInsideBodiedSyncBlock = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock';
|
|
17
17
|
if ((0, _experiments.editorExperiment)('advanced_layouts', false) || isNested) {
|
|
18
18
|
// If nested inside bodiedSyncBlock, enable inline drop target so user can drop to create a layout inside it
|
|
19
|
-
if (isInsideBodiedSyncBlock && (0, _experiments.editorExperiment)('platform_synced_block', true)
|
|
19
|
+
if (isInsideBodiedSyncBlock && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
|
|
20
20
|
return true;
|
|
21
21
|
}
|
|
22
22
|
return false;
|
|
@@ -69,15 +69,9 @@ var nestedDropZoneStyle = (0, _react2.css)({
|
|
|
69
69
|
right: '4px',
|
|
70
70
|
width: 'unset'
|
|
71
71
|
});
|
|
72
|
-
var enableDropZone = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard'];
|
|
73
72
|
var enableDropZoneNext = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard', 'syncBlock'];
|
|
74
73
|
var getEnableDropZone = function getEnableDropZone() {
|
|
75
|
-
|
|
76
|
-
exposure: true
|
|
77
|
-
})) {
|
|
78
|
-
return enableDropZoneNext;
|
|
79
|
-
}
|
|
80
|
-
return enableDropZone;
|
|
74
|
+
return enableDropZoneNext;
|
|
81
75
|
};
|
|
82
76
|
|
|
83
77
|
// This z index is used in container like layout
|
|
@@ -113,9 +107,7 @@ var HoverZone = function HoverZone(_ref) {
|
|
|
113
107
|
_useActiveAnchorTrack2 = (0, _slicedToArray2.default)(_useActiveAnchorTrack, 2),
|
|
114
108
|
_isActive = _useActiveAnchorTrack2[0],
|
|
115
109
|
setActiveAnchor = _useActiveAnchorTrack2[1];
|
|
116
|
-
var isInsideBodiedSyncBlock = parent && parent.type.name === 'bodiedSyncBlock' && (0, _experiments.editorExperiment)('platform_synced_block', true)
|
|
117
|
-
exposure: true
|
|
118
|
-
});
|
|
110
|
+
var isInsideBodiedSyncBlock = parent && parent.type.name === 'bodiedSyncBlock' && (0, _experiments.editorExperiment)('platform_synced_block', true);
|
|
119
111
|
(0, _react.useEffect)(function () {
|
|
120
112
|
if (ref.current) {
|
|
121
113
|
return (0, _adapter.dropTargetForElements)({
|
|
@@ -115,9 +115,7 @@ const canMoveToLayout = (api, from, to, tr, moveNodeAtCursorPos) => {
|
|
|
115
115
|
}
|
|
116
116
|
const $to = tr.doc.resolve(to);
|
|
117
117
|
const allowedParentTypes = [doc, layoutSection];
|
|
118
|
-
if (bodiedSyncBlock && editorExperiment('platform_synced_block', true)
|
|
119
|
-
exposure: true
|
|
120
|
-
})) {
|
|
118
|
+
if (bodiedSyncBlock && editorExperiment('platform_synced_block', true)) {
|
|
121
119
|
allowedParentTypes.push(bodiedSyncBlock);
|
|
122
120
|
}
|
|
123
121
|
|
|
@@ -192,9 +192,7 @@ export const getActiveDropTargetDecorations = (activeDropTargetNode, state, api,
|
|
|
192
192
|
}
|
|
193
193
|
let anchorEmitNodeWithPos = rootNodeWithPos;
|
|
194
194
|
if (editorExperiment('advanced_layouts', true)) {
|
|
195
|
-
if (editorExperiment('platform_synced_block', true)
|
|
196
|
-
exposure: true
|
|
197
|
-
})) {
|
|
195
|
+
if (editorExperiment('platform_synced_block', true)) {
|
|
198
196
|
const schema = rootNodeWithPos.node.type.schema;
|
|
199
197
|
const {
|
|
200
198
|
layoutSection
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
1
|
const IGNORE_NODES = ['tableRow', 'listItem', 'caption', 'media'];
|
|
3
|
-
const blockLeafNodes = ['blockCard', 'rule', 'extension'];
|
|
4
2
|
const blockLeafNodeNext = ['blockCard', 'rule', 'extension', 'syncBlock'];
|
|
5
3
|
const DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
|
|
6
4
|
|
|
@@ -15,9 +13,7 @@ const DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
|
|
|
15
13
|
*/
|
|
16
14
|
export const findSurroundingNodes = (state, $pos, nodeType) => {
|
|
17
15
|
const depth = $pos.depth;
|
|
18
|
-
const blockLeafNodeList =
|
|
19
|
-
exposure: true
|
|
20
|
-
}) ? blockLeafNodeNext : blockLeafNodes;
|
|
16
|
+
const blockLeafNodeList = blockLeafNodeNext;
|
|
21
17
|
|
|
22
18
|
// special cases like hr rule here
|
|
23
19
|
if (blockLeafNodeList.includes(nodeType || '') || $pos.pos === 0) {
|
|
@@ -11,7 +11,7 @@ isSameLayout = false, activeNode, parentNode) => {
|
|
|
11
11
|
const isInsideBodiedSyncBlock = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock';
|
|
12
12
|
if (editorExperiment('advanced_layouts', false) || isNested) {
|
|
13
13
|
// If nested inside bodiedSyncBlock, enable inline drop target so user can drop to create a layout inside it
|
|
14
|
-
if (isInsideBodiedSyncBlock && editorExperiment('platform_synced_block', true)
|
|
14
|
+
if (isInsideBodiedSyncBlock && editorExperiment('platform_synced_block', true)) {
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
17
17
|
return false;
|
|
@@ -58,15 +58,9 @@ const nestedDropZoneStyle = css({
|
|
|
58
58
|
right: '4px',
|
|
59
59
|
width: 'unset'
|
|
60
60
|
});
|
|
61
|
-
const enableDropZone = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard'];
|
|
62
61
|
const enableDropZoneNext = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard', 'syncBlock'];
|
|
63
62
|
const getEnableDropZone = () => {
|
|
64
|
-
|
|
65
|
-
exposure: true
|
|
66
|
-
})) {
|
|
67
|
-
return enableDropZoneNext;
|
|
68
|
-
}
|
|
69
|
-
return enableDropZone;
|
|
63
|
+
return enableDropZoneNext;
|
|
70
64
|
};
|
|
71
65
|
|
|
72
66
|
// This z index is used in container like layout
|
|
@@ -100,9 +94,7 @@ const HoverZone = ({
|
|
|
100
94
|
return node ? getNodeAnchor(node) : '';
|
|
101
95
|
}, [api, node, pos, position]);
|
|
102
96
|
const [_isActive, setActiveAnchor] = useActiveAnchorTracker(anchorName);
|
|
103
|
-
const isInsideBodiedSyncBlock = parent && parent.type.name === 'bodiedSyncBlock' && editorExperiment('platform_synced_block', true)
|
|
104
|
-
exposure: true
|
|
105
|
-
});
|
|
97
|
+
const isInsideBodiedSyncBlock = parent && parent.type.name === 'bodiedSyncBlock' && editorExperiment('platform_synced_block', true);
|
|
106
98
|
useEffect(() => {
|
|
107
99
|
if (ref.current) {
|
|
108
100
|
return dropTargetForElements({
|
|
@@ -110,9 +110,7 @@ var canMoveToLayout = function canMoveToLayout(api, from, to, tr, moveNodeAtCurs
|
|
|
110
110
|
}
|
|
111
111
|
var $to = tr.doc.resolve(to);
|
|
112
112
|
var allowedParentTypes = [doc, layoutSection];
|
|
113
|
-
if (bodiedSyncBlock && editorExperiment('platform_synced_block', true)
|
|
114
|
-
exposure: true
|
|
115
|
-
})) {
|
|
113
|
+
if (bodiedSyncBlock && editorExperiment('platform_synced_block', true)) {
|
|
116
114
|
allowedParentTypes.push(bodiedSyncBlock);
|
|
117
115
|
}
|
|
118
116
|
|
|
@@ -204,9 +204,7 @@ export var getActiveDropTargetDecorations = function getActiveDropTargetDecorati
|
|
|
204
204
|
}
|
|
205
205
|
var anchorEmitNodeWithPos = rootNodeWithPos;
|
|
206
206
|
if (editorExperiment('advanced_layouts', true)) {
|
|
207
|
-
if (editorExperiment('platform_synced_block', true)
|
|
208
|
-
exposure: true
|
|
209
|
-
})) {
|
|
207
|
+
if (editorExperiment('platform_synced_block', true)) {
|
|
210
208
|
var schema = rootNodeWithPos.node.type.schema;
|
|
211
209
|
var layoutSection = schema.nodes.layoutSection;
|
|
212
210
|
var isLayoutSectionChildOfRoot = findChildrenByType(rootNodeWithPos.node, layoutSection, false).length > 0;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
1
|
var IGNORE_NODES = ['tableRow', 'listItem', 'caption', 'media'];
|
|
3
|
-
var blockLeafNodes = ['blockCard', 'rule', 'extension'];
|
|
4
2
|
var blockLeafNodeNext = ['blockCard', 'rule', 'extension', 'syncBlock'];
|
|
5
3
|
var DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
|
|
6
4
|
|
|
@@ -15,9 +13,7 @@ var DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
|
|
|
15
13
|
*/
|
|
16
14
|
var _findSurroundingNodes = function findSurroundingNodes(state, $pos, nodeType) {
|
|
17
15
|
var depth = $pos.depth;
|
|
18
|
-
var blockLeafNodeList =
|
|
19
|
-
exposure: true
|
|
20
|
-
}) ? blockLeafNodeNext : blockLeafNodes;
|
|
16
|
+
var blockLeafNodeList = blockLeafNodeNext;
|
|
21
17
|
|
|
22
18
|
// special cases like hr rule here
|
|
23
19
|
if (blockLeafNodeList.includes(nodeType || '') || $pos.pos === 0) {
|
|
@@ -10,7 +10,7 @@ export var shouldAllowInlineDropTarget = function shouldAllowInlineDropTarget(is
|
|
|
10
10
|
var isInsideBodiedSyncBlock = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) === 'bodiedSyncBlock';
|
|
11
11
|
if (editorExperiment('advanced_layouts', false) || isNested) {
|
|
12
12
|
// If nested inside bodiedSyncBlock, enable inline drop target so user can drop to create a layout inside it
|
|
13
|
-
if (isInsideBodiedSyncBlock && editorExperiment('platform_synced_block', true)
|
|
13
|
+
if (isInsideBodiedSyncBlock && editorExperiment('platform_synced_block', true)) {
|
|
14
14
|
return true;
|
|
15
15
|
}
|
|
16
16
|
return false;
|
|
@@ -60,15 +60,9 @@ var nestedDropZoneStyle = css({
|
|
|
60
60
|
right: '4px',
|
|
61
61
|
width: 'unset'
|
|
62
62
|
});
|
|
63
|
-
var enableDropZone = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard'];
|
|
64
63
|
var enableDropZoneNext = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard', 'syncBlock'];
|
|
65
64
|
var getEnableDropZone = function getEnableDropZone() {
|
|
66
|
-
|
|
67
|
-
exposure: true
|
|
68
|
-
})) {
|
|
69
|
-
return enableDropZoneNext;
|
|
70
|
-
}
|
|
71
|
-
return enableDropZone;
|
|
65
|
+
return enableDropZoneNext;
|
|
72
66
|
};
|
|
73
67
|
|
|
74
68
|
// This z index is used in container like layout
|
|
@@ -104,9 +98,7 @@ var HoverZone = function HoverZone(_ref) {
|
|
|
104
98
|
_useActiveAnchorTrack2 = _slicedToArray(_useActiveAnchorTrack, 2),
|
|
105
99
|
_isActive = _useActiveAnchorTrack2[0],
|
|
106
100
|
setActiveAnchor = _useActiveAnchorTrack2[1];
|
|
107
|
-
var isInsideBodiedSyncBlock = parent && parent.type.name === 'bodiedSyncBlock' && editorExperiment('platform_synced_block', true)
|
|
108
|
-
exposure: true
|
|
109
|
-
});
|
|
101
|
+
var isInsideBodiedSyncBlock = parent && parent.type.name === 'bodiedSyncBlock' && editorExperiment('platform_synced_block', true);
|
|
110
102
|
useEffect(function () {
|
|
111
103
|
if (ref.current) {
|
|
112
104
|
return dropTargetForElements({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "11.4.
|
|
3
|
+
"version": "11.4.1",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"uuid": "^3.1.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@atlaskit/editor-common": "^114.
|
|
70
|
+
"@atlaskit/editor-common": "^114.32.0",
|
|
71
71
|
"react": "^18.2.0",
|
|
72
72
|
"react-dom": "^18.2.0",
|
|
73
73
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|