@atlaskit/editor-plugin-block-controls 2.7.1 → 2.8.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 +7 -0
- package/dist/cjs/pm-plugins/decorations.js +11 -8
- package/dist/cjs/ui/consts.js +4 -0
- package/dist/cjs/ui/drop-target-v2.js +52 -20
- package/dist/es2019/pm-plugins/decorations.js +11 -8
- package/dist/es2019/ui/consts.js +4 -0
- package/dist/es2019/ui/drop-target-v2.js +51 -20
- package/dist/esm/pm-plugins/decorations.js +11 -8
- package/dist/esm/ui/consts.js +4 -0
- package/dist/esm/ui/drop-target-v2.js +52 -20
- package/dist/types/ui/drop-target.d.ts +1 -1
- package/dist/types-ts4.5/ui/drop-target.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 2.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ed73a2928e080`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ed73a2928e080) -
|
|
8
|
+
ED-25375 fix drop target v2 end position drop area
|
|
9
|
+
|
|
3
10
|
## 2.7.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -48,6 +48,12 @@ var getNodeMargins = function getNodeMargins(node) {
|
|
|
48
48
|
}
|
|
49
49
|
return _consts.nodeMargins[nodeTypeName] || _consts.nodeMargins['default'];
|
|
50
50
|
};
|
|
51
|
+
var shouldCollapseMargin = function shouldCollapseMargin(prevNode, nextNode) {
|
|
52
|
+
if (((prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) === 'mediaSingle' || (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'mediaSingle') && (prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) !== (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
};
|
|
51
57
|
var getGapAndOffset = function getGapAndOffset(prevNode, nextNode, parentNode) {
|
|
52
58
|
if (!prevNode && nextNode) {
|
|
53
59
|
// first node
|
|
@@ -63,7 +69,7 @@ var getGapAndOffset = function getGapAndOffset(prevNode, nextNode, parentNode) {
|
|
|
63
69
|
}
|
|
64
70
|
var top = getNodeMargins(nextNode).top || 4;
|
|
65
71
|
var bottom = getNodeMargins(prevNode).bottom || 4;
|
|
66
|
-
var gap = Math.max(top, bottom);
|
|
72
|
+
var gap = shouldCollapseMargin(prevNode, nextNode) ? Math.max(top, bottom) : top + bottom;
|
|
67
73
|
var offset = top - gap / 2;
|
|
68
74
|
if ((prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) === 'mediaSingle' && (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'mediaSingle') {
|
|
69
75
|
offset = -offset;
|
|
@@ -140,8 +146,7 @@ var createDropTargetDecoration = exports.createDropTargetDecoration = function c
|
|
|
140
146
|
offset = _getGapAndOffset.offset;
|
|
141
147
|
element.style.setProperty(_dropTargetV.EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET, "".concat(offset, "px"));
|
|
142
148
|
element.style.setProperty(_dropTargetV.EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_GAP, "".concat(gap, "px"));
|
|
143
|
-
|
|
144
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_drag_and_drop_target_v2')) {
|
|
149
|
+
element.style.setProperty('display', 'block');
|
|
145
150
|
_reactDom.default.render( /*#__PURE__*/(0, _react.createElement)(_dropTargetV.DropTargetV2, _objectSpread(_objectSpread({}, props), {}, {
|
|
146
151
|
getPos: getPos,
|
|
147
152
|
anchorRectCache: anchorRectCache
|
|
@@ -221,16 +226,14 @@ var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetD
|
|
|
221
226
|
|
|
222
227
|
// only table and layout need to render full height drop target
|
|
223
228
|
var isInSupportedContainer = (0, _platformFeatureFlags.fg)('platform_editor_drag_and_drop_target_v2') && ['tableCell', 'tableHeader', 'layoutColumn'].includes((parent === null || parent === void 0 ? void 0 : parent.type.name) || '');
|
|
224
|
-
|
|
225
|
-
// container with only an empty paragrah
|
|
226
|
-
var shouldShowFullHeight = isInSupportedContainer && (parent === null || parent === void 0 ? void 0 : parent.lastChild) === node && (parent === null || parent === void 0 ? void 0 : parent.childCount) === 1 && (0, _utils.isEmptyParagraph)(node) && (0, _platformFeatureFlags.fg)('platform_editor_drag_and_drop_target_v2');
|
|
229
|
+
var shouldShowFullHeight = isInSupportedContainer && (parent === null || parent === void 0 ? void 0 : parent.lastChild) === node && (0, _utils.isEmptyParagraph)(node);
|
|
227
230
|
decs.push(createDropTargetDecoration(pos, {
|
|
228
231
|
api: api,
|
|
229
232
|
prevNode: previousNode,
|
|
230
233
|
nextNode: node,
|
|
231
234
|
parentNode: parent || undefined,
|
|
232
235
|
formatMessage: formatMessage,
|
|
233
|
-
dropTargetStyle: shouldShowFullHeight ? '
|
|
236
|
+
dropTargetStyle: shouldShowFullHeight ? 'remainingHeight' : 'default'
|
|
234
237
|
}, -1, anchorRectCache));
|
|
235
238
|
if (endPos !== undefined) {
|
|
236
239
|
decs.push(createDropTargetDecoration(endPos, {
|
|
@@ -238,7 +241,7 @@ var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetD
|
|
|
238
241
|
prevNode: (0, _platformFeatureFlags.fg)('platform_editor_drag_and_drop_target_v2') ? node : undefined,
|
|
239
242
|
parentNode: parent || undefined,
|
|
240
243
|
formatMessage: formatMessage,
|
|
241
|
-
dropTargetStyle:
|
|
244
|
+
dropTargetStyle: 'remainingHeight'
|
|
242
245
|
}, -1, anchorRectCache));
|
|
243
246
|
}
|
|
244
247
|
if ((0, _platformFeatureFlags.fg)('platform_editor_drag_and_drop_target_v2')) {
|
package/dist/cjs/ui/consts.js
CHANGED
|
@@ -65,12 +65,6 @@ var nestedDropZoneStyle = (0, _react2.css)({
|
|
|
65
65
|
width: 'unset'
|
|
66
66
|
});
|
|
67
67
|
var enableDropZone = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard'];
|
|
68
|
-
var fullHeightStyle = (0, _react2.css)({
|
|
69
|
-
top: '4px',
|
|
70
|
-
bottom: '4px',
|
|
71
|
-
height: 'unset',
|
|
72
|
-
zIndex: 10
|
|
73
|
-
});
|
|
74
68
|
|
|
75
69
|
// This z index is used in container like layout
|
|
76
70
|
var fullHeightStyleAdjustZIndexStyle = (0, _react2.css)({
|
|
@@ -98,6 +92,7 @@ var HoverZone = function HoverZone(_ref) {
|
|
|
98
92
|
});
|
|
99
93
|
}
|
|
100
94
|
}, [onDragEnter, onDragLeave, onDrop]);
|
|
95
|
+
var isRemainingheight = dropTargetStyle === 'remainingHeight';
|
|
101
96
|
var hoverZoneUpperStyle = (0, _react.useMemo)(function () {
|
|
102
97
|
var anchorName = node ? (0, _decorations.getNodeAnchor)(node) : '';
|
|
103
98
|
var heightStyleOffset = "var(--editor-block-controls-drop-indicator-gap, 0)/2";
|
|
@@ -113,12 +108,47 @@ var HoverZone = function HoverZone(_ref) {
|
|
|
113
108
|
maxWidth: "".concat(editorWidth || 0, "px")
|
|
114
109
|
});
|
|
115
110
|
}, [anchorRectCache, editorWidth, node, position]);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 1. Above the last empty line
|
|
114
|
+
* 2. Below the last element
|
|
115
|
+
*
|
|
116
|
+
* Both cases will take the remaining height of the the container
|
|
117
|
+
*/
|
|
118
|
+
var heightStyle = (0, _react.useMemo)(function () {
|
|
119
|
+
// only apply upper drop zone
|
|
120
|
+
if (isRemainingheight && position === 'upper') {
|
|
121
|
+
// previous node
|
|
122
|
+
var anchorName = node ? (0, _decorations.getNodeAnchor)(node) : '';
|
|
123
|
+
var top = 'unset';
|
|
124
|
+
if (anchorName) {
|
|
125
|
+
var enabledDropZone = enableDropZone.includes((node === null || node === void 0 ? void 0 : node.type.name) || '');
|
|
126
|
+
if ((0, _anchorUtils.isAnchorSupported)()) {
|
|
127
|
+
top = enabledDropZone ? "calc(anchor(".concat(anchorName, " 50%))") : "calc(anchor(".concat(anchorName, " bottom) - 4px)");
|
|
128
|
+
} else if (anchorRectCache) {
|
|
129
|
+
var preNodeTopPos = anchorRectCache.getTop(anchorName) || 0;
|
|
130
|
+
var prevNodeHeight = anchorRectCache.getHeight(anchorName) || 0;
|
|
131
|
+
top = enabledDropZone ? "calc(".concat(preNodeTopPos, "px + ").concat(prevNodeHeight / 2, "px)") : "calc(".concat(preNodeTopPos, "px + ").concat(prevNodeHeight, "px - 4px)");
|
|
132
|
+
} else {
|
|
133
|
+
// Should not happen
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
// first empty paragraph
|
|
138
|
+
top = '4px';
|
|
139
|
+
}
|
|
140
|
+
return (0, _react2.css)({
|
|
141
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
142
|
+
top: top,
|
|
143
|
+
bottom: '4px',
|
|
144
|
+
height: 'unset',
|
|
145
|
+
zIndex: 10,
|
|
146
|
+
transform: 'none'
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
}, [anchorRectCache, isRemainingheight, node, position]);
|
|
151
|
+
var isFullHeightInLayout = isRemainingheight && (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'layoutColumn';
|
|
122
152
|
return (0, _react2.jsx)("div", {
|
|
123
153
|
ref: ref
|
|
124
154
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -129,7 +159,9 @@ var HoverZone = function HoverZone(_ref) {
|
|
|
129
159
|
,
|
|
130
160
|
css: [dropZoneStyles, isNestedDropTarget && nestedDropZoneStyle,
|
|
131
161
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
132
|
-
hoverZoneUpperStyle,
|
|
162
|
+
hoverZoneUpperStyle,
|
|
163
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
164
|
+
heightStyle, isFullHeightInLayout && fullHeightStyleAdjustZIndexStyle]
|
|
133
165
|
});
|
|
134
166
|
};
|
|
135
167
|
var DropTargetV2 = exports.DropTargetV2 = function DropTargetV2(props) {
|
|
@@ -141,7 +173,8 @@ var DropTargetV2 = exports.DropTargetV2 = function DropTargetV2(props) {
|
|
|
141
173
|
parentNode = props.parentNode,
|
|
142
174
|
formatMessage = props.formatMessage,
|
|
143
175
|
anchorRectCache = props.anchorRectCache,
|
|
144
|
-
|
|
176
|
+
_props$dropTargetStyl = props.dropTargetStyle,
|
|
177
|
+
dropTargetStyle = _props$dropTargetStyl === void 0 ? 'default' : _props$dropTargetStyl;
|
|
145
178
|
var _useState = (0, _react.useState)(false),
|
|
146
179
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
147
180
|
isDraggedOver = _useState2[0],
|
|
@@ -163,11 +196,10 @@ var DropTargetV2 = exports.DropTargetV2 = function DropTargetV2(props) {
|
|
|
163
196
|
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.commands) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.moveNode(start, pos, undefined, formatMessage));
|
|
164
197
|
}
|
|
165
198
|
};
|
|
166
|
-
var isFullHeight = dropTargetStyle === 'fullHeight';
|
|
167
199
|
var dynamicStyle = (_dynamicStyle = {
|
|
168
200
|
width: isNestedDropTarget ? 'unset' : '100%'
|
|
169
201
|
}, (0, _defineProperty2.default)(_dynamicStyle, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_WIDTH, isNestedDropTarget ? '100%' : "".concat((widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || DEFAULT_DROP_INDICATOR_WIDTH, "px")), (0, _defineProperty2.default)(_dynamicStyle, EDITOR_BLOCK_CONTROLS_DROP_TARGET_LEFT_MARGIN, isNestedDropTarget ? (0, _consts.getNestedNodeLeftPaddingMargin)(parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) : '0'), (0, _defineProperty2.default)(_dynamicStyle, EDITOR_BLOCK_CONTROLS_DROP_TARGET_ZINDEX, (0, _experiments.editorExperiment)('nested-dnd', true) ? _constants.layers.navigation() : _constants.layers.card()), _dynamicStyle);
|
|
170
|
-
return (0, _react2.jsx)(_react.Fragment, null,
|
|
202
|
+
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(HoverZone, {
|
|
171
203
|
onDragEnter: function onDragEnter() {
|
|
172
204
|
return setIsDraggedOver(true);
|
|
173
205
|
},
|
|
@@ -179,7 +211,8 @@ var DropTargetV2 = exports.DropTargetV2 = function DropTargetV2(props) {
|
|
|
179
211
|
editorWidth: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
180
212
|
anchorRectCache: anchorRectCache,
|
|
181
213
|
position: "upper",
|
|
182
|
-
isNestedDropTarget: isNestedDropTarget
|
|
214
|
+
isNestedDropTarget: isNestedDropTarget,
|
|
215
|
+
dropTargetStyle: dropTargetStyle
|
|
183
216
|
}), (0, _react2.jsx)("div", {
|
|
184
217
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
185
218
|
css: [styleDropTarget, isNestedDropTarget && nestedDropIndicatorStyle]
|
|
@@ -194,7 +227,7 @@ var DropTargetV2 = exports.DropTargetV2 = function DropTargetV2(props) {
|
|
|
194
227
|
"data-testid": "block-ctrl-drop-indicator"
|
|
195
228
|
}, (0, _react2.jsx)(_box.DropIndicator, {
|
|
196
229
|
edge: "bottom"
|
|
197
|
-
}))), (0, _react2.jsx)(HoverZone, {
|
|
230
|
+
}))), dropTargetStyle !== 'remainingHeight' && (0, _react2.jsx)(HoverZone, {
|
|
198
231
|
onDragEnter: function onDragEnter() {
|
|
199
232
|
return setIsDraggedOver(true);
|
|
200
233
|
},
|
|
@@ -207,8 +240,7 @@ var DropTargetV2 = exports.DropTargetV2 = function DropTargetV2(props) {
|
|
|
207
240
|
editorWidth: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
208
241
|
anchorRectCache: anchorRectCache,
|
|
209
242
|
position: "lower",
|
|
210
|
-
isNestedDropTarget: isNestedDropTarget
|
|
211
|
-
dropTargetStyle: dropTargetStyle
|
|
243
|
+
isNestedDropTarget: isNestedDropTarget
|
|
212
244
|
}), (0, _inlineDropTarget.shouldAllowInlineDropTarget)(isNestedDropTarget, nextNode) && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_inlineDropTarget2.InlineDropTarget, (0, _extends2.default)({}, props, {
|
|
213
245
|
position: "left"
|
|
214
246
|
})), (0, _react2.jsx)(_inlineDropTarget2.InlineDropTarget, (0, _extends2.default)({}, props, {
|
|
@@ -35,6 +35,12 @@ const getNodeMargins = node => {
|
|
|
35
35
|
}
|
|
36
36
|
return nodeMargins[nodeTypeName] || nodeMargins['default'];
|
|
37
37
|
};
|
|
38
|
+
const shouldCollapseMargin = (prevNode, nextNode) => {
|
|
39
|
+
if (((prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) === 'mediaSingle' || (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'mediaSingle') && (prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) !== (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name)) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
};
|
|
38
44
|
const getGapAndOffset = (prevNode, nextNode, parentNode) => {
|
|
39
45
|
if (!prevNode && nextNode) {
|
|
40
46
|
// first node
|
|
@@ -50,7 +56,7 @@ const getGapAndOffset = (prevNode, nextNode, parentNode) => {
|
|
|
50
56
|
}
|
|
51
57
|
const top = getNodeMargins(nextNode).top || 4;
|
|
52
58
|
const bottom = getNodeMargins(prevNode).bottom || 4;
|
|
53
|
-
const gap = Math.max(top, bottom);
|
|
59
|
+
const gap = shouldCollapseMargin(prevNode, nextNode) ? Math.max(top, bottom) : top + bottom;
|
|
54
60
|
let offset = top - gap / 2;
|
|
55
61
|
if ((prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) === 'mediaSingle' && (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'mediaSingle') {
|
|
56
62
|
offset = -offset;
|
|
@@ -122,8 +128,7 @@ export const createDropTargetDecoration = (pos, props, side, anchorRectCache) =>
|
|
|
122
128
|
} = getGapAndOffset(props.prevNode, props.nextNode, props.parentNode);
|
|
123
129
|
element.style.setProperty(EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET, `${offset}px`);
|
|
124
130
|
element.style.setProperty(EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_GAP, `${gap}px`);
|
|
125
|
-
|
|
126
|
-
if (fg('platform_editor_drag_and_drop_target_v2')) {
|
|
131
|
+
element.style.setProperty('display', 'block');
|
|
127
132
|
ReactDOM.render( /*#__PURE__*/createElement(DropTargetV2, {
|
|
128
133
|
...props,
|
|
129
134
|
getPos,
|
|
@@ -205,16 +210,14 @@ export const dropTargetDecorations = (newState, api, formatMessage, activeNode,
|
|
|
205
210
|
|
|
206
211
|
// only table and layout need to render full height drop target
|
|
207
212
|
const isInSupportedContainer = fg('platform_editor_drag_and_drop_target_v2') && ['tableCell', 'tableHeader', 'layoutColumn'].includes((parent === null || parent === void 0 ? void 0 : parent.type.name) || '');
|
|
208
|
-
|
|
209
|
-
// container with only an empty paragrah
|
|
210
|
-
const shouldShowFullHeight = isInSupportedContainer && (parent === null || parent === void 0 ? void 0 : parent.lastChild) === node && (parent === null || parent === void 0 ? void 0 : parent.childCount) === 1 && isEmptyParagraph(node) && fg('platform_editor_drag_and_drop_target_v2');
|
|
213
|
+
const shouldShowFullHeight = isInSupportedContainer && (parent === null || parent === void 0 ? void 0 : parent.lastChild) === node && isEmptyParagraph(node);
|
|
211
214
|
decs.push(createDropTargetDecoration(pos, {
|
|
212
215
|
api,
|
|
213
216
|
prevNode: previousNode,
|
|
214
217
|
nextNode: node,
|
|
215
218
|
parentNode: parent || undefined,
|
|
216
219
|
formatMessage,
|
|
217
|
-
dropTargetStyle: shouldShowFullHeight ? '
|
|
220
|
+
dropTargetStyle: shouldShowFullHeight ? 'remainingHeight' : 'default'
|
|
218
221
|
}, -1, anchorRectCache));
|
|
219
222
|
if (endPos !== undefined) {
|
|
220
223
|
decs.push(createDropTargetDecoration(endPos, {
|
|
@@ -222,7 +225,7 @@ export const dropTargetDecorations = (newState, api, formatMessage, activeNode,
|
|
|
222
225
|
prevNode: fg('platform_editor_drag_and_drop_target_v2') ? node : undefined,
|
|
223
226
|
parentNode: parent || undefined,
|
|
224
227
|
formatMessage,
|
|
225
|
-
dropTargetStyle:
|
|
228
|
+
dropTargetStyle: 'remainingHeight'
|
|
226
229
|
}, -1, anchorRectCache));
|
|
227
230
|
}
|
|
228
231
|
if (fg('platform_editor_drag_and_drop_target_v2')) {
|
package/dist/es2019/ui/consts.js
CHANGED
|
@@ -55,12 +55,6 @@ const nestedDropZoneStyle = css({
|
|
|
55
55
|
width: 'unset'
|
|
56
56
|
});
|
|
57
57
|
const enableDropZone = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard'];
|
|
58
|
-
const fullHeightStyle = css({
|
|
59
|
-
top: '4px',
|
|
60
|
-
bottom: '4px',
|
|
61
|
-
height: 'unset',
|
|
62
|
-
zIndex: 10
|
|
63
|
-
});
|
|
64
58
|
|
|
65
59
|
// This z index is used in container like layout
|
|
66
60
|
const fullHeightStyleAdjustZIndexStyle = css({
|
|
@@ -89,6 +83,7 @@ const HoverZone = ({
|
|
|
89
83
|
});
|
|
90
84
|
}
|
|
91
85
|
}, [onDragEnter, onDragLeave, onDrop]);
|
|
86
|
+
const isRemainingheight = dropTargetStyle === 'remainingHeight';
|
|
92
87
|
const hoverZoneUpperStyle = useMemo(() => {
|
|
93
88
|
const anchorName = node ? getNodeAnchor(node) : '';
|
|
94
89
|
const heightStyleOffset = `var(--editor-block-controls-drop-indicator-gap, 0)/2`;
|
|
@@ -104,12 +99,47 @@ const HoverZone = ({
|
|
|
104
99
|
maxWidth: `${editorWidth || 0}px`
|
|
105
100
|
});
|
|
106
101
|
}, [anchorRectCache, editorWidth, node, position]);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 1. Above the last empty line
|
|
105
|
+
* 2. Below the last element
|
|
106
|
+
*
|
|
107
|
+
* Both cases will take the remaining height of the the container
|
|
108
|
+
*/
|
|
109
|
+
const heightStyle = useMemo(() => {
|
|
110
|
+
// only apply upper drop zone
|
|
111
|
+
if (isRemainingheight && position === 'upper') {
|
|
112
|
+
// previous node
|
|
113
|
+
const anchorName = node ? getNodeAnchor(node) : '';
|
|
114
|
+
let top = 'unset';
|
|
115
|
+
if (anchorName) {
|
|
116
|
+
const enabledDropZone = enableDropZone.includes((node === null || node === void 0 ? void 0 : node.type.name) || '');
|
|
117
|
+
if (isAnchorSupported()) {
|
|
118
|
+
top = enabledDropZone ? `calc(anchor(${anchorName} 50%))` : `calc(anchor(${anchorName} bottom) - 4px)`;
|
|
119
|
+
} else if (anchorRectCache) {
|
|
120
|
+
const preNodeTopPos = anchorRectCache.getTop(anchorName) || 0;
|
|
121
|
+
const prevNodeHeight = anchorRectCache.getHeight(anchorName) || 0;
|
|
122
|
+
top = enabledDropZone ? `calc(${preNodeTopPos}px + ${prevNodeHeight / 2}px)` : `calc(${preNodeTopPos}px + ${prevNodeHeight}px - 4px)`;
|
|
123
|
+
} else {
|
|
124
|
+
// Should not happen
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
} else {
|
|
128
|
+
// first empty paragraph
|
|
129
|
+
top = '4px';
|
|
130
|
+
}
|
|
131
|
+
return css({
|
|
132
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
133
|
+
top: top,
|
|
134
|
+
bottom: '4px',
|
|
135
|
+
height: 'unset',
|
|
136
|
+
zIndex: 10,
|
|
137
|
+
transform: 'none'
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
}, [anchorRectCache, isRemainingheight, node, position]);
|
|
142
|
+
const isFullHeightInLayout = isRemainingheight && (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'layoutColumn';
|
|
113
143
|
return jsx("div", {
|
|
114
144
|
ref: ref
|
|
115
145
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -120,7 +150,9 @@ const HoverZone = ({
|
|
|
120
150
|
,
|
|
121
151
|
css: [dropZoneStyles, isNestedDropTarget && nestedDropZoneStyle,
|
|
122
152
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
123
|
-
hoverZoneUpperStyle,
|
|
153
|
+
hoverZoneUpperStyle,
|
|
154
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
155
|
+
heightStyle, isFullHeightInLayout && fullHeightStyleAdjustZIndexStyle]
|
|
124
156
|
});
|
|
125
157
|
};
|
|
126
158
|
export const DropTargetV2 = props => {
|
|
@@ -132,7 +164,7 @@ export const DropTargetV2 = props => {
|
|
|
132
164
|
parentNode,
|
|
133
165
|
formatMessage,
|
|
134
166
|
anchorRectCache,
|
|
135
|
-
dropTargetStyle
|
|
167
|
+
dropTargetStyle = 'default'
|
|
136
168
|
} = props;
|
|
137
169
|
const [isDraggedOver, setIsDraggedOver] = useState(false);
|
|
138
170
|
const {
|
|
@@ -156,14 +188,13 @@ export const DropTargetV2 = props => {
|
|
|
156
188
|
api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : (_api$blockControls2$c = _api$blockControls2.commands) === null || _api$blockControls2$c === void 0 ? void 0 : _api$blockControls2$c.moveNode(start, pos, undefined, formatMessage));
|
|
157
189
|
}
|
|
158
190
|
};
|
|
159
|
-
const isFullHeight = dropTargetStyle === 'fullHeight';
|
|
160
191
|
const dynamicStyle = {
|
|
161
192
|
width: isNestedDropTarget ? 'unset' : '100%',
|
|
162
193
|
[EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_WIDTH]: isNestedDropTarget ? '100%' : `${(widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || DEFAULT_DROP_INDICATOR_WIDTH}px`,
|
|
163
194
|
[EDITOR_BLOCK_CONTROLS_DROP_TARGET_LEFT_MARGIN]: isNestedDropTarget ? getNestedNodeLeftPaddingMargin(parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) : '0',
|
|
164
195
|
[EDITOR_BLOCK_CONTROLS_DROP_TARGET_ZINDEX]: editorExperiment('nested-dnd', true) ? layers.navigation() : layers.card()
|
|
165
196
|
};
|
|
166
|
-
return jsx(Fragment, null,
|
|
197
|
+
return jsx(Fragment, null, jsx(HoverZone, {
|
|
167
198
|
onDragEnter: () => setIsDraggedOver(true),
|
|
168
199
|
onDragLeave: () => setIsDraggedOver(false),
|
|
169
200
|
onDrop: onDrop,
|
|
@@ -171,7 +202,8 @@ export const DropTargetV2 = props => {
|
|
|
171
202
|
editorWidth: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
172
203
|
anchorRectCache: anchorRectCache,
|
|
173
204
|
position: "upper",
|
|
174
|
-
isNestedDropTarget: isNestedDropTarget
|
|
205
|
+
isNestedDropTarget: isNestedDropTarget,
|
|
206
|
+
dropTargetStyle: dropTargetStyle
|
|
175
207
|
}), jsx("div", {
|
|
176
208
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
177
209
|
css: [styleDropTarget, isNestedDropTarget && nestedDropIndicatorStyle]
|
|
@@ -186,7 +218,7 @@ export const DropTargetV2 = props => {
|
|
|
186
218
|
"data-testid": "block-ctrl-drop-indicator"
|
|
187
219
|
}, jsx(DropIndicator, {
|
|
188
220
|
edge: "bottom"
|
|
189
|
-
}))), jsx(HoverZone, {
|
|
221
|
+
}))), dropTargetStyle !== 'remainingHeight' && jsx(HoverZone, {
|
|
190
222
|
onDragEnter: () => setIsDraggedOver(true),
|
|
191
223
|
onDragLeave: () => setIsDraggedOver(false),
|
|
192
224
|
onDrop: onDrop,
|
|
@@ -195,8 +227,7 @@ export const DropTargetV2 = props => {
|
|
|
195
227
|
editorWidth: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
196
228
|
anchorRectCache: anchorRectCache,
|
|
197
229
|
position: "lower",
|
|
198
|
-
isNestedDropTarget: isNestedDropTarget
|
|
199
|
-
dropTargetStyle: dropTargetStyle
|
|
230
|
+
isNestedDropTarget: isNestedDropTarget
|
|
200
231
|
}), shouldAllowInlineDropTarget(isNestedDropTarget, nextNode) && jsx(Fragment, null, jsx(InlineDropTarget, _extends({}, props, {
|
|
201
232
|
position: "left"
|
|
202
233
|
})), jsx(InlineDropTarget, _extends({}, props, {
|
|
@@ -41,6 +41,12 @@ var getNodeMargins = function getNodeMargins(node) {
|
|
|
41
41
|
}
|
|
42
42
|
return nodeMargins[nodeTypeName] || nodeMargins['default'];
|
|
43
43
|
};
|
|
44
|
+
var shouldCollapseMargin = function shouldCollapseMargin(prevNode, nextNode) {
|
|
45
|
+
if (((prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) === 'mediaSingle' || (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'mediaSingle') && (prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) !== (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
return true;
|
|
49
|
+
};
|
|
44
50
|
var getGapAndOffset = function getGapAndOffset(prevNode, nextNode, parentNode) {
|
|
45
51
|
if (!prevNode && nextNode) {
|
|
46
52
|
// first node
|
|
@@ -56,7 +62,7 @@ var getGapAndOffset = function getGapAndOffset(prevNode, nextNode, parentNode) {
|
|
|
56
62
|
}
|
|
57
63
|
var top = getNodeMargins(nextNode).top || 4;
|
|
58
64
|
var bottom = getNodeMargins(prevNode).bottom || 4;
|
|
59
|
-
var gap = Math.max(top, bottom);
|
|
65
|
+
var gap = shouldCollapseMargin(prevNode, nextNode) ? Math.max(top, bottom) : top + bottom;
|
|
60
66
|
var offset = top - gap / 2;
|
|
61
67
|
if ((prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) === 'mediaSingle' && (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'mediaSingle') {
|
|
62
68
|
offset = -offset;
|
|
@@ -133,8 +139,7 @@ export var createDropTargetDecoration = function createDropTargetDecoration(pos,
|
|
|
133
139
|
offset = _getGapAndOffset.offset;
|
|
134
140
|
element.style.setProperty(EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET, "".concat(offset, "px"));
|
|
135
141
|
element.style.setProperty(EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_GAP, "".concat(gap, "px"));
|
|
136
|
-
|
|
137
|
-
if (fg('platform_editor_drag_and_drop_target_v2')) {
|
|
142
|
+
element.style.setProperty('display', 'block');
|
|
138
143
|
ReactDOM.render( /*#__PURE__*/createElement(DropTargetV2, _objectSpread(_objectSpread({}, props), {}, {
|
|
139
144
|
getPos: getPos,
|
|
140
145
|
anchorRectCache: anchorRectCache
|
|
@@ -214,16 +219,14 @@ export var dropTargetDecorations = function dropTargetDecorations(newState, api,
|
|
|
214
219
|
|
|
215
220
|
// only table and layout need to render full height drop target
|
|
216
221
|
var isInSupportedContainer = fg('platform_editor_drag_and_drop_target_v2') && ['tableCell', 'tableHeader', 'layoutColumn'].includes((parent === null || parent === void 0 ? void 0 : parent.type.name) || '');
|
|
217
|
-
|
|
218
|
-
// container with only an empty paragrah
|
|
219
|
-
var shouldShowFullHeight = isInSupportedContainer && (parent === null || parent === void 0 ? void 0 : parent.lastChild) === node && (parent === null || parent === void 0 ? void 0 : parent.childCount) === 1 && isEmptyParagraph(node) && fg('platform_editor_drag_and_drop_target_v2');
|
|
222
|
+
var shouldShowFullHeight = isInSupportedContainer && (parent === null || parent === void 0 ? void 0 : parent.lastChild) === node && isEmptyParagraph(node);
|
|
220
223
|
decs.push(createDropTargetDecoration(pos, {
|
|
221
224
|
api: api,
|
|
222
225
|
prevNode: previousNode,
|
|
223
226
|
nextNode: node,
|
|
224
227
|
parentNode: parent || undefined,
|
|
225
228
|
formatMessage: formatMessage,
|
|
226
|
-
dropTargetStyle: shouldShowFullHeight ? '
|
|
229
|
+
dropTargetStyle: shouldShowFullHeight ? 'remainingHeight' : 'default'
|
|
227
230
|
}, -1, anchorRectCache));
|
|
228
231
|
if (endPos !== undefined) {
|
|
229
232
|
decs.push(createDropTargetDecoration(endPos, {
|
|
@@ -231,7 +234,7 @@ export var dropTargetDecorations = function dropTargetDecorations(newState, api,
|
|
|
231
234
|
prevNode: fg('platform_editor_drag_and_drop_target_v2') ? node : undefined,
|
|
232
235
|
parentNode: parent || undefined,
|
|
233
236
|
formatMessage: formatMessage,
|
|
234
|
-
dropTargetStyle:
|
|
237
|
+
dropTargetStyle: 'remainingHeight'
|
|
235
238
|
}, -1, anchorRectCache));
|
|
236
239
|
}
|
|
237
240
|
if (fg('platform_editor_drag_and_drop_target_v2')) {
|
package/dist/esm/ui/consts.js
CHANGED
|
@@ -57,12 +57,6 @@ var nestedDropZoneStyle = css({
|
|
|
57
57
|
width: 'unset'
|
|
58
58
|
});
|
|
59
59
|
var enableDropZone = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard'];
|
|
60
|
-
var fullHeightStyle = css({
|
|
61
|
-
top: '4px',
|
|
62
|
-
bottom: '4px',
|
|
63
|
-
height: 'unset',
|
|
64
|
-
zIndex: 10
|
|
65
|
-
});
|
|
66
60
|
|
|
67
61
|
// This z index is used in container like layout
|
|
68
62
|
var fullHeightStyleAdjustZIndexStyle = css({
|
|
@@ -90,6 +84,7 @@ var HoverZone = function HoverZone(_ref) {
|
|
|
90
84
|
});
|
|
91
85
|
}
|
|
92
86
|
}, [onDragEnter, onDragLeave, onDrop]);
|
|
87
|
+
var isRemainingheight = dropTargetStyle === 'remainingHeight';
|
|
93
88
|
var hoverZoneUpperStyle = useMemo(function () {
|
|
94
89
|
var anchorName = node ? getNodeAnchor(node) : '';
|
|
95
90
|
var heightStyleOffset = "var(--editor-block-controls-drop-indicator-gap, 0)/2";
|
|
@@ -105,12 +100,47 @@ var HoverZone = function HoverZone(_ref) {
|
|
|
105
100
|
maxWidth: "".concat(editorWidth || 0, "px")
|
|
106
101
|
});
|
|
107
102
|
}, [anchorRectCache, editorWidth, node, position]);
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 1. Above the last empty line
|
|
106
|
+
* 2. Below the last element
|
|
107
|
+
*
|
|
108
|
+
* Both cases will take the remaining height of the the container
|
|
109
|
+
*/
|
|
110
|
+
var heightStyle = useMemo(function () {
|
|
111
|
+
// only apply upper drop zone
|
|
112
|
+
if (isRemainingheight && position === 'upper') {
|
|
113
|
+
// previous node
|
|
114
|
+
var anchorName = node ? getNodeAnchor(node) : '';
|
|
115
|
+
var top = 'unset';
|
|
116
|
+
if (anchorName) {
|
|
117
|
+
var enabledDropZone = enableDropZone.includes((node === null || node === void 0 ? void 0 : node.type.name) || '');
|
|
118
|
+
if (isAnchorSupported()) {
|
|
119
|
+
top = enabledDropZone ? "calc(anchor(".concat(anchorName, " 50%))") : "calc(anchor(".concat(anchorName, " bottom) - 4px)");
|
|
120
|
+
} else if (anchorRectCache) {
|
|
121
|
+
var preNodeTopPos = anchorRectCache.getTop(anchorName) || 0;
|
|
122
|
+
var prevNodeHeight = anchorRectCache.getHeight(anchorName) || 0;
|
|
123
|
+
top = enabledDropZone ? "calc(".concat(preNodeTopPos, "px + ").concat(prevNodeHeight / 2, "px)") : "calc(".concat(preNodeTopPos, "px + ").concat(prevNodeHeight, "px - 4px)");
|
|
124
|
+
} else {
|
|
125
|
+
// Should not happen
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
// first empty paragraph
|
|
130
|
+
top = '4px';
|
|
131
|
+
}
|
|
132
|
+
return css({
|
|
133
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
134
|
+
top: top,
|
|
135
|
+
bottom: '4px',
|
|
136
|
+
height: 'unset',
|
|
137
|
+
zIndex: 10,
|
|
138
|
+
transform: 'none'
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}, [anchorRectCache, isRemainingheight, node, position]);
|
|
143
|
+
var isFullHeightInLayout = isRemainingheight && (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'layoutColumn';
|
|
114
144
|
return jsx("div", {
|
|
115
145
|
ref: ref
|
|
116
146
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -121,7 +151,9 @@ var HoverZone = function HoverZone(_ref) {
|
|
|
121
151
|
,
|
|
122
152
|
css: [dropZoneStyles, isNestedDropTarget && nestedDropZoneStyle,
|
|
123
153
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
124
|
-
hoverZoneUpperStyle,
|
|
154
|
+
hoverZoneUpperStyle,
|
|
155
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
156
|
+
heightStyle, isFullHeightInLayout && fullHeightStyleAdjustZIndexStyle]
|
|
125
157
|
});
|
|
126
158
|
};
|
|
127
159
|
export var DropTargetV2 = function DropTargetV2(props) {
|
|
@@ -133,7 +165,8 @@ export var DropTargetV2 = function DropTargetV2(props) {
|
|
|
133
165
|
parentNode = props.parentNode,
|
|
134
166
|
formatMessage = props.formatMessage,
|
|
135
167
|
anchorRectCache = props.anchorRectCache,
|
|
136
|
-
|
|
168
|
+
_props$dropTargetStyl = props.dropTargetStyle,
|
|
169
|
+
dropTargetStyle = _props$dropTargetStyl === void 0 ? 'default' : _props$dropTargetStyl;
|
|
137
170
|
var _useState = useState(false),
|
|
138
171
|
_useState2 = _slicedToArray(_useState, 2),
|
|
139
172
|
isDraggedOver = _useState2[0],
|
|
@@ -155,11 +188,10 @@ export var DropTargetV2 = function DropTargetV2(props) {
|
|
|
155
188
|
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.commands) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.moveNode(start, pos, undefined, formatMessage));
|
|
156
189
|
}
|
|
157
190
|
};
|
|
158
|
-
var isFullHeight = dropTargetStyle === 'fullHeight';
|
|
159
191
|
var dynamicStyle = (_dynamicStyle = {
|
|
160
192
|
width: isNestedDropTarget ? 'unset' : '100%'
|
|
161
193
|
}, _defineProperty(_dynamicStyle, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_WIDTH, isNestedDropTarget ? '100%' : "".concat((widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || DEFAULT_DROP_INDICATOR_WIDTH, "px")), _defineProperty(_dynamicStyle, EDITOR_BLOCK_CONTROLS_DROP_TARGET_LEFT_MARGIN, isNestedDropTarget ? getNestedNodeLeftPaddingMargin(parentNode === null || parentNode === void 0 ? void 0 : parentNode.type.name) : '0'), _defineProperty(_dynamicStyle, EDITOR_BLOCK_CONTROLS_DROP_TARGET_ZINDEX, editorExperiment('nested-dnd', true) ? layers.navigation() : layers.card()), _dynamicStyle);
|
|
162
|
-
return jsx(Fragment, null,
|
|
194
|
+
return jsx(Fragment, null, jsx(HoverZone, {
|
|
163
195
|
onDragEnter: function onDragEnter() {
|
|
164
196
|
return setIsDraggedOver(true);
|
|
165
197
|
},
|
|
@@ -171,7 +203,8 @@ export var DropTargetV2 = function DropTargetV2(props) {
|
|
|
171
203
|
editorWidth: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
172
204
|
anchorRectCache: anchorRectCache,
|
|
173
205
|
position: "upper",
|
|
174
|
-
isNestedDropTarget: isNestedDropTarget
|
|
206
|
+
isNestedDropTarget: isNestedDropTarget,
|
|
207
|
+
dropTargetStyle: dropTargetStyle
|
|
175
208
|
}), jsx("div", {
|
|
176
209
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
177
210
|
css: [styleDropTarget, isNestedDropTarget && nestedDropIndicatorStyle]
|
|
@@ -186,7 +219,7 @@ export var DropTargetV2 = function DropTargetV2(props) {
|
|
|
186
219
|
"data-testid": "block-ctrl-drop-indicator"
|
|
187
220
|
}, jsx(DropIndicator, {
|
|
188
221
|
edge: "bottom"
|
|
189
|
-
}))), jsx(HoverZone, {
|
|
222
|
+
}))), dropTargetStyle !== 'remainingHeight' && jsx(HoverZone, {
|
|
190
223
|
onDragEnter: function onDragEnter() {
|
|
191
224
|
return setIsDraggedOver(true);
|
|
192
225
|
},
|
|
@@ -199,8 +232,7 @@ export var DropTargetV2 = function DropTargetV2(props) {
|
|
|
199
232
|
editorWidth: widthState === null || widthState === void 0 ? void 0 : widthState.lineLength,
|
|
200
233
|
anchorRectCache: anchorRectCache,
|
|
201
234
|
position: "lower",
|
|
202
|
-
isNestedDropTarget: isNestedDropTarget
|
|
203
|
-
dropTargetStyle: dropTargetStyle
|
|
235
|
+
isNestedDropTarget: isNestedDropTarget
|
|
204
236
|
}), shouldAllowInlineDropTarget(isNestedDropTarget, nextNode) && jsx(Fragment, null, jsx(InlineDropTarget, _extends({}, props, {
|
|
205
237
|
position: "left"
|
|
206
238
|
})), jsx(InlineDropTarget, _extends({}, props, {
|
|
@@ -3,7 +3,7 @@ import { type IntlShape } from 'react-intl-next';
|
|
|
3
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { BlockControlsPlugin } from '../types';
|
|
6
|
-
export type DropTargetStyle = 'default' | '
|
|
6
|
+
export type DropTargetStyle = 'default' | 'remainingHeight';
|
|
7
7
|
export type DropTargetProps = {
|
|
8
8
|
api: ExtractInjectionAPI<BlockControlsPlugin> | undefined;
|
|
9
9
|
getPos: () => number | undefined;
|
|
@@ -3,7 +3,7 @@ import { type IntlShape } from 'react-intl-next';
|
|
|
3
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { BlockControlsPlugin } from '../types';
|
|
6
|
-
export type DropTargetStyle = 'default' | '
|
|
6
|
+
export type DropTargetStyle = 'default' | 'remainingHeight';
|
|
7
7
|
export type DropTargetProps = {
|
|
8
8
|
api: ExtractInjectionAPI<BlockControlsPlugin> | undefined;
|
|
9
9
|
getPos: () => number | undefined;
|