@atlaskit/editor-plugin-block-controls 2.21.4 → 2.21.6
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 +17 -0
- package/dist/cjs/blockControlsPlugin.js +0 -2
- package/dist/cjs/editor-commands/move-node.js +2 -5
- package/dist/cjs/editor-commands/move-to-layout.js +186 -60
- package/dist/cjs/pm-plugins/decorations-anchor.js +1 -6
- package/dist/cjs/pm-plugins/decorations-drag-handle.js +1 -4
- package/dist/cjs/pm-plugins/decorations-drop-target.js +4 -17
- package/dist/cjs/pm-plugins/main.js +6 -15
- package/dist/cjs/pm-plugins/utils/check-fragment.js +26 -0
- package/dist/cjs/pm-plugins/utils/drag-handle-positions.js +1 -4
- package/dist/cjs/pm-plugins/utils/fire-analytics.js +1 -4
- package/dist/cjs/pm-plugins/utils/inline-drop-target.js +1 -4
- package/dist/cjs/pm-plugins/utils/remove-from-source.js +15 -6
- package/dist/cjs/pm-plugins/utils/update-column-widths.js +1 -4
- package/dist/cjs/pm-plugins/utils/validation.js +0 -3
- package/dist/cjs/ui/drop-target-layout.js +1 -2
- package/dist/cjs/ui/drop-target.js +7 -6
- package/dist/cjs/ui/inline-drop-target.js +1 -2
- package/dist/es2019/blockControlsPlugin.js +0 -2
- package/dist/es2019/editor-commands/move-node.js +2 -5
- package/dist/es2019/editor-commands/move-to-layout.js +171 -50
- package/dist/es2019/pm-plugins/decorations-anchor.js +1 -6
- package/dist/es2019/pm-plugins/decorations-drag-handle.js +1 -4
- package/dist/es2019/pm-plugins/decorations-drop-target.js +4 -17
- package/dist/es2019/pm-plugins/main.js +6 -15
- package/dist/es2019/pm-plugins/utils/check-fragment.js +20 -0
- package/dist/es2019/pm-plugins/utils/drag-handle-positions.js +1 -4
- package/dist/es2019/pm-plugins/utils/fire-analytics.js +1 -4
- package/dist/es2019/pm-plugins/utils/inline-drop-target.js +1 -4
- package/dist/es2019/pm-plugins/utils/remove-from-source.js +15 -6
- package/dist/es2019/pm-plugins/utils/update-column-widths.js +1 -4
- package/dist/es2019/pm-plugins/utils/validation.js +0 -3
- package/dist/es2019/ui/drop-target-layout.js +1 -2
- package/dist/es2019/ui/drop-target.js +7 -6
- package/dist/es2019/ui/inline-drop-target.js +1 -2
- package/dist/esm/blockControlsPlugin.js +0 -2
- package/dist/esm/editor-commands/move-node.js +2 -5
- package/dist/esm/editor-commands/move-to-layout.js +187 -61
- package/dist/esm/pm-plugins/decorations-anchor.js +1 -6
- package/dist/esm/pm-plugins/decorations-drag-handle.js +1 -4
- package/dist/esm/pm-plugins/decorations-drop-target.js +4 -17
- package/dist/esm/pm-plugins/main.js +6 -15
- package/dist/esm/pm-plugins/utils/check-fragment.js +20 -0
- package/dist/esm/pm-plugins/utils/drag-handle-positions.js +1 -4
- package/dist/esm/pm-plugins/utils/fire-analytics.js +1 -4
- package/dist/esm/pm-plugins/utils/inline-drop-target.js +1 -4
- package/dist/esm/pm-plugins/utils/remove-from-source.js +15 -6
- package/dist/esm/pm-plugins/utils/update-column-widths.js +1 -4
- package/dist/esm/pm-plugins/utils/validation.js +0 -3
- package/dist/esm/ui/drop-target-layout.js +1 -2
- package/dist/esm/ui/drop-target.js +7 -6
- package/dist/esm/ui/inline-drop-target.js +1 -2
- package/dist/types/pm-plugins/utils/check-fragment.d.ts +9 -0
- package/dist/types/pm-plugins/utils/remove-from-source.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/check-fragment.d.ts +9 -0
- package/dist/types-ts4.5/pm-plugins/utils/remove-from-source.d.ts +1 -1
- package/package.json +5 -8
- package/dist/cjs/pm-plugins/utils/drag-target-debug.js +0 -11
- package/dist/es2019/pm-plugins/utils/drag-target-debug.js +0 -5
- package/dist/esm/pm-plugins/utils/drag-target-debug.js +0 -5
- package/dist/types/pm-plugins/utils/drag-target-debug.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/utils/drag-target-debug.d.ts +0 -1
|
@@ -20,7 +20,6 @@ import { handleMouseOver } from './handle-mouse-over';
|
|
|
20
20
|
import { boundKeydownHandler } from './keymap';
|
|
21
21
|
import { defaultActiveAnchorTracker } from './utils/active-anchor-tracker';
|
|
22
22
|
import { AnchorRectCache, isAnchorSupported } from './utils/anchor-utils';
|
|
23
|
-
import { isBlocksDragTargetDebug } from './utils/drag-target-debug';
|
|
24
23
|
import { getTrMetadata } from './utils/transactions';
|
|
25
24
|
export var key = new PluginKey('blockControls');
|
|
26
25
|
var EDITOR_BLOCKS_DRAG_INIT = 'Editor Blocks Drag Initialization Time';
|
|
@@ -111,10 +110,7 @@ var initialState = {
|
|
|
111
110
|
isDocSizeLimitEnabled: null,
|
|
112
111
|
isPMDragging: false
|
|
113
112
|
};
|
|
114
|
-
export var newApply = function newApply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache
|
|
115
|
-
// Ignored via go/ees005
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
117
|
-
) {
|
|
113
|
+
export var newApply = function newApply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache) {
|
|
118
114
|
var _meta$activeNode, _activeNode, _activeNode2, _meta$activeNode$hand, _meta$isDragging, _meta$isDragging2, _meta$editorHeight, _meta$editorWidthLeft, _meta$editorWidthRigh, _meta$isPMDragging;
|
|
119
115
|
var activeNode = currentState.activeNode,
|
|
120
116
|
decorations = currentState.decorations,
|
|
@@ -212,14 +208,14 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
212
208
|
var isDropTargetsMissing = ((_meta$isDragging = meta === null || meta === void 0 ? void 0 : meta.isDragging) !== null && _meta$isDragging !== void 0 ? _meta$isDragging : isDragging) && maybeNodeCountChanged && !(meta !== null && meta !== void 0 && meta.nodeMoved);
|
|
213
209
|
|
|
214
210
|
// Remove drop target decorations when dragging stops or they need to be redrawn
|
|
215
|
-
if ((meta === null || meta === void 0 ? void 0 : meta.isDragging) === false || isDropTargetsMissing
|
|
211
|
+
if ((meta === null || meta === void 0 ? void 0 : meta.isDragging) === false || isDropTargetsMissing) {
|
|
216
212
|
var dropTargetDecs = findDropTargetDecs(decorations);
|
|
217
213
|
decorations = decorations.remove(dropTargetDecs);
|
|
218
214
|
}
|
|
219
215
|
|
|
220
216
|
// Add drop targets when dragging starts or some are missing
|
|
221
217
|
if (api) {
|
|
222
|
-
if (meta !== null && meta !== void 0 && meta.isDragging || isDropTargetsMissing
|
|
218
|
+
if (meta !== null && meta !== void 0 && meta.isDragging || isDropTargetsMissing) {
|
|
223
219
|
var decs = dropTargetDecorations(newState, api, formatMessage, nodeViewPortalProviderAPI, latestActiveNode, anchorRectCache);
|
|
224
220
|
decorations = decorations.add(newState.doc, decs);
|
|
225
221
|
}
|
|
@@ -245,10 +241,7 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
245
241
|
isPMDragging: (_meta$isPMDragging = meta === null || meta === void 0 ? void 0 : meta.isPMDragging) !== null && _meta$isPMDragging !== void 0 ? _meta$isPMDragging : isPMDragging
|
|
246
242
|
};
|
|
247
243
|
};
|
|
248
|
-
export var oldApply = function oldApply(api, formatMessage, tr, currentState, oldState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache
|
|
249
|
-
// Ignored via go/ees005
|
|
250
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
251
|
-
) {
|
|
244
|
+
export var oldApply = function oldApply(api, formatMessage, tr, currentState, oldState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache) {
|
|
252
245
|
var _meta$activeNode2, _meta$activeNode$hand2, _meta$activeNode8, _meta$isDragging4, _meta$editorHeight2, _meta$editorWidthLeft2, _meta$editorWidthRigh2, _meta$isPMDragging2;
|
|
253
246
|
var isNestedEnabled = flags.isNestedEnabled;
|
|
254
247
|
var activeNode = currentState.activeNode,
|
|
@@ -361,7 +354,7 @@ export var oldApply = function oldApply(api, formatMessage, tr, currentState, ol
|
|
|
361
354
|
var decs = dragHandleDecoration(api, formatMessage, meta.activeNode.pos, meta.activeNode.anchorName, meta.activeNode.nodeType, nodeViewPortalProviderAPI, meta.activeNode.handleOptions);
|
|
362
355
|
decorations = decorations.add(newState.doc, [decs]);
|
|
363
356
|
}
|
|
364
|
-
if ((meta === null || meta === void 0 ? void 0 : meta.isDragging) === false || isDropTargetsMissing
|
|
357
|
+
if ((meta === null || meta === void 0 ? void 0 : meta.isDragging) === false || isDropTargetsMissing) {
|
|
365
358
|
// Remove drop target decoration when dragging stops
|
|
366
359
|
var dropTargetDecs = decorations.find(undefined, undefined, function (spec) {
|
|
367
360
|
return spec.type === 'drop-target-decoration';
|
|
@@ -379,7 +372,7 @@ export var oldApply = function oldApply(api, formatMessage, tr, currentState, ol
|
|
|
379
372
|
if (api) {
|
|
380
373
|
// Add drop targets when node is being dragged
|
|
381
374
|
// if the transaction is only for analytics and user is dragging, continue to draw drop targets
|
|
382
|
-
if (shouldCreateDropTargets
|
|
375
|
+
if (shouldCreateDropTargets) {
|
|
383
376
|
var _meta$activeNode7;
|
|
384
377
|
var _decs = dropTargetDecorations(newState, api, formatMessage, nodeViewPortalProviderAPI, isNestedEnabled ? (_meta$activeNode7 = meta === null || meta === void 0 ? void 0 : meta.activeNode) !== null && _meta$activeNode7 !== void 0 ? _meta$activeNode7 : mappedActiveNodePos : meta === null || meta === void 0 ? void 0 : meta.activeNode, anchorRectCache);
|
|
385
378
|
decorations = decorations.add(newState.doc, _decs);
|
|
@@ -432,8 +425,6 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
|
|
|
432
425
|
init: function init() {
|
|
433
426
|
return initialState;
|
|
434
427
|
},
|
|
435
|
-
// Ignored via go/ees005
|
|
436
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
437
428
|
apply: function apply(tr, currentState, oldState, newState) {
|
|
438
429
|
if (isNestedEnabled) {
|
|
439
430
|
return newApply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if the fragment has only one node of the specified type
|
|
3
|
+
*/
|
|
4
|
+
export var isFragmentOfType = function isFragmentOfType(fragment, type) {
|
|
5
|
+
var _fragment$firstChild;
|
|
6
|
+
return fragment.childCount === 1 && ((_fragment$firstChild = fragment.firstChild) === null || _fragment$firstChild === void 0 ? void 0 : _fragment$firstChild.type.name) === type;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Check if the fragment contains at least a node of the specified type
|
|
11
|
+
*/
|
|
12
|
+
export var containsNodeOfType = function containsNodeOfType(fragment, type) {
|
|
13
|
+
for (var i = 0; i < fragment.childCount; i++) {
|
|
14
|
+
var child = fragment.child(i);
|
|
15
|
+
if (child.type.name === type) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
};
|
|
@@ -34,10 +34,7 @@ export var getTopPosition = function getTopPosition(dom, type) {
|
|
|
34
34
|
return "".concat(dom.offsetTop, "px");
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
export var getLeftPosition = function getLeftPosition(dom, type, innerContainer, macroInteractionUpdates, parentType
|
|
38
|
-
// Ignored via go/ees005
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
40
|
-
) {
|
|
37
|
+
export var getLeftPosition = function getLeftPosition(dom, type, innerContainer, macroInteractionUpdates, parentType) {
|
|
41
38
|
if (!dom) {
|
|
42
39
|
return 'auto';
|
|
43
40
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
export var attachMoveNodeAnalytics = function attachMoveNodeAnalytics(tr, inputMethod, fromDepth, fromNodeType, toDepth, toNodeType, isSameParent, api
|
|
3
|
-
// Ignored via go/ees005
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
5
|
-
) {
|
|
2
|
+
export var attachMoveNodeAnalytics = function attachMoveNodeAnalytics(tr, inputMethod, fromDepth, fromNodeType, toDepth, toNodeType, isSameParent, api) {
|
|
6
3
|
var _api$analytics;
|
|
7
4
|
return api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.attachAnalyticsEvent({
|
|
8
5
|
eventType: EVENT_TYPE.TRACK,
|
|
@@ -4,10 +4,7 @@ import { isWrappedMedia } from './check-media-layout';
|
|
|
4
4
|
import { maxLayoutColumnSupported } from './consts';
|
|
5
5
|
export var shouldAllowInlineDropTarget = function shouldAllowInlineDropTarget(isNested, node) {
|
|
6
6
|
var isSameLayout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7
|
-
var activeNode
|
|
8
|
-
// Ignored via go/ees005
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
10
|
-
= arguments.length > 3 ? arguments[3] : undefined;
|
|
7
|
+
var activeNode = arguments.length > 3 ? arguments[3] : undefined;
|
|
11
8
|
if (editorExperiment('advanced_layouts', false) || isNested) {
|
|
12
9
|
return false;
|
|
13
10
|
}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
+
import { isFragmentOfType } from './check-fragment';
|
|
4
6
|
import { MIN_LAYOUT_COLUMN } from './consts';
|
|
5
7
|
import { updateColumnWidths } from './update-column-widths';
|
|
6
|
-
export var removeFromSource = function removeFromSource(tr, $from) {
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
8
|
+
export var removeFromSource = function removeFromSource(tr, $from, to) {
|
|
9
|
+
var _sourceContent, _sourceContent2;
|
|
10
|
+
var sourceContent = $from.nodeAfter;
|
|
11
|
+
var isLayoutColumn = ((_sourceContent = sourceContent) === null || _sourceContent === void 0 ? void 0 : _sourceContent.type.name) === 'layoutColumn';
|
|
12
|
+
var sourceNodeEndPos = $from.pos + (((_sourceContent2 = sourceContent) === null || _sourceContent2 === void 0 ? void 0 : _sourceContent2.nodeSize) || 1);
|
|
13
|
+
if (editorExperiment('platform_editor_element_drag_and_drop_multiselect', true)) {
|
|
14
|
+
sourceContent = tr.doc.slice($from.pos, to).content;
|
|
15
|
+
isLayoutColumn = isFragmentOfType(sourceContent, 'layoutColumn');
|
|
16
|
+
sourceNodeEndPos = to === undefined ? $from.pos + sourceContent.size : to;
|
|
17
|
+
}
|
|
18
|
+
if (!sourceContent) {
|
|
10
19
|
return tr;
|
|
11
20
|
}
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
if (isLayoutColumn) {
|
|
22
|
+
var sourceParent = $from.parent;
|
|
14
23
|
if (sourceParent.childCount === MIN_LAYOUT_COLUMN) {
|
|
15
24
|
tr.delete($from.pos + 1, sourceNodeEndPos - 1);
|
|
16
25
|
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_COLUMN_DISTRIBUTIONS } from '../../ui/consts';
|
|
2
|
-
export var updateColumnWidths = function updateColumnWidths(tr, layoutNode, layoutNodePos, childCount
|
|
3
|
-
// Ignored via go/ees005
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
5
|
-
) {
|
|
2
|
+
export var updateColumnWidths = function updateColumnWidths(tr, layoutNode, layoutNodePos, childCount) {
|
|
6
3
|
var newColumnWidth = DEFAULT_COLUMN_DISTRIBUTIONS[childCount];
|
|
7
4
|
if (newColumnWidth) {
|
|
8
5
|
layoutNode.content.forEach(function (node, offset) {
|
|
@@ -70,9 +70,6 @@ export var memoizedTransformExpandToNestedExpand = memoizeOne(function (node) {
|
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
|
|
74
|
-
// Ignored via go/ees005
|
|
75
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
76
73
|
export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNodePos, destNode) {
|
|
77
74
|
var srcNodeType = srcNode.type;
|
|
78
75
|
var parentNodeType = destParent === null || destParent === void 0 ? void 0 : destParent.type.name;
|
|
@@ -16,7 +16,6 @@ import { B200 } from '@atlaskit/theme/colors';
|
|
|
16
16
|
import { getNodeAnchor } from '../pm-plugins/decorations-common';
|
|
17
17
|
import { useActiveAnchorTracker } from '../pm-plugins/utils/active-anchor-tracker';
|
|
18
18
|
import { isAnchorSupported } from '../pm-plugins/utils/anchor-utils';
|
|
19
|
-
import { isBlocksDragTargetDebug } from '../pm-plugins/utils/drag-target-debug';
|
|
20
19
|
import { getInsertLayoutStep, updateSelection } from '../pm-plugins/utils/update-selection';
|
|
21
20
|
|
|
22
21
|
// 8px gap + 16px on left and right
|
|
@@ -124,7 +123,7 @@ export var DropTargetLayout = function DropTargetLayout(props) {
|
|
|
124
123
|
,
|
|
125
124
|
css: [dropTargetLayoutStyle, dropTargetStackLayoutHintStyle],
|
|
126
125
|
"data-testid": "block-ctrl-drop-indicator"
|
|
127
|
-
}, isDraggedOver
|
|
126
|
+
}, isDraggedOver ? jsx(DropIndicator, {
|
|
128
127
|
edge: "right",
|
|
129
128
|
gap: "-".concat(DROP_TARGET_LAYOUT_DROP_ZONE_WIDTH, "px")
|
|
130
129
|
}) : isActiveAnchor && jsx("div", {
|
|
@@ -17,7 +17,6 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
|
17
17
|
import { getNodeAnchor } from '../pm-plugins/decorations-common';
|
|
18
18
|
import { useActiveAnchorTracker } from '../pm-plugins/utils/active-anchor-tracker';
|
|
19
19
|
import { isAnchorSupported } from '../pm-plugins/utils/anchor-utils';
|
|
20
|
-
import { isBlocksDragTargetDebug } from '../pm-plugins/utils/drag-target-debug';
|
|
21
20
|
import { shouldAllowInlineDropTarget } from '../pm-plugins/utils/inline-drop-target';
|
|
22
21
|
import { getNestedNodeLeftPaddingMargin } from './consts';
|
|
23
22
|
import { InlineDropTarget } from './inline-drop-target';
|
|
@@ -40,7 +39,11 @@ var styleDropIndicator = css({
|
|
|
40
39
|
height: '100%',
|
|
41
40
|
margin: '0 auto',
|
|
42
41
|
position: 'relative',
|
|
43
|
-
width: "var(".concat(EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_WIDTH, ", 100%)")
|
|
42
|
+
width: "var(".concat(EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_WIDTH, ", 100%)"),
|
|
43
|
+
display: 'none'
|
|
44
|
+
});
|
|
45
|
+
var styleDropIndicatorVisible = css({
|
|
46
|
+
display: 'block'
|
|
44
47
|
});
|
|
45
48
|
var nestedDropIndicatorStyle = css({
|
|
46
49
|
position: 'relative'
|
|
@@ -224,10 +227,8 @@ export var DropTarget = function DropTarget(props) {
|
|
|
224
227
|
,
|
|
225
228
|
style: dynamicStyle,
|
|
226
229
|
"data-testid": "block-ctrl-drop-target"
|
|
227
|
-
},
|
|
228
|
-
|
|
229
|
-
(isDraggedOver || isBlocksDragTargetDebug()) && jsx("div", {
|
|
230
|
-
css: styleDropIndicator,
|
|
230
|
+
}, jsx("div", {
|
|
231
|
+
css: [styleDropIndicator, isDraggedOver && styleDropIndicatorVisible],
|
|
231
232
|
"data-testid": "block-ctrl-drop-indicator"
|
|
232
233
|
}, jsx(DropIndicator, {
|
|
233
234
|
edge: "bottom"
|
|
@@ -18,7 +18,6 @@ import { B200 } from '@atlaskit/theme/colors';
|
|
|
18
18
|
import { getNodeAnchor } from '../pm-plugins/decorations-common';
|
|
19
19
|
import { useActiveAnchorTracker } from '../pm-plugins/utils/active-anchor-tracker';
|
|
20
20
|
import { isAnchorSupported } from '../pm-plugins/utils/anchor-utils';
|
|
21
|
-
import { isBlocksDragTargetDebug } from '../pm-plugins/utils/drag-target-debug';
|
|
22
21
|
import { getInsertLayoutStep, updateSelection } from '../pm-plugins/utils/update-selection';
|
|
23
22
|
var HOVER_ZONE_WIDTH = '--editor-blocks-inline-hover-zone-width';
|
|
24
23
|
var HOVER_ZONE_HEIGHT = '--editor-blocks-inline-hover-zone-height';
|
|
@@ -247,7 +246,7 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
|
|
|
247
246
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
248
247
|
,
|
|
249
248
|
style: hoverZoneRectStyle
|
|
250
|
-
}, isDraggedOver
|
|
249
|
+
}, isDraggedOver ? jsx(DropIndicator, {
|
|
251
250
|
edge: dropIndicatorPos
|
|
252
251
|
}) : isActiveAnchor && jsx("div", {
|
|
253
252
|
"data-testid": "block-ctrl-drop-hint",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
/**
|
|
3
|
+
* Check if the fragment has only one node of the specified type
|
|
4
|
+
*/
|
|
5
|
+
export declare const isFragmentOfType: (fragment: Fragment, type: string) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Check if the fragment contains at least a node of the specified type
|
|
8
|
+
*/
|
|
9
|
+
export declare const containsNodeOfType: (fragment: Fragment, type: string) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const removeFromSource: (tr: Transaction, $from: ResolvedPos) => Transaction;
|
|
3
|
+
export declare const removeFromSource: (tr: Transaction, $from: ResolvedPos, to?: number) => Transaction;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
/**
|
|
3
|
+
* Check if the fragment has only one node of the specified type
|
|
4
|
+
*/
|
|
5
|
+
export declare const isFragmentOfType: (fragment: Fragment, type: string) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Check if the fragment contains at least a node of the specified type
|
|
8
|
+
*/
|
|
9
|
+
export declare const containsNodeOfType: (fragment: Fragment, type: string) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const removeFromSource: (tr: Transaction, $from: ResolvedPos) => Transaction;
|
|
3
|
+
export declare const removeFromSource: (tr: Transaction, $from: ResolvedPos, to?: number) => Transaction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.6",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
34
|
-
"@atlaskit/editor-common": "^99.
|
|
34
|
+
"@atlaskit/editor-common": "^99.5.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
36
|
+
"@atlaskit/editor-plugin-analytics": "^1.11.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
38
38
|
"@atlaskit/editor-plugin-feature-flags": "^1.2.0",
|
|
39
39
|
"@atlaskit/editor-plugin-quick-insert": "^1.8.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
|
|
49
49
|
"@atlaskit/primitives": "^13.3.0",
|
|
50
50
|
"@atlaskit/theme": "^14.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
52
|
-
"@atlaskit/tokens": "^3.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^2.41.0",
|
|
52
|
+
"@atlaskit/tokens": "^3.2.0",
|
|
53
53
|
"@atlaskit/tooltip": "^19.0.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
@@ -115,9 +115,6 @@
|
|
|
115
115
|
"platform_editor_element_drag_and_drop_ed_24321": {
|
|
116
116
|
"type": "boolean"
|
|
117
117
|
},
|
|
118
|
-
"platform_editor_element_drag_and_drop_debug": {
|
|
119
|
-
"type": "boolean"
|
|
120
|
-
},
|
|
121
118
|
"platform_editor_element_dnd_nested_fix_patch_6": {
|
|
122
119
|
"type": "boolean"
|
|
123
120
|
},
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isBlocksDragTargetDebug = void 0;
|
|
7
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
|
-
var IS_GEMINI_TEST_ENV = Boolean(process.env.NODE_ENV === 'development') && Boolean(window.__gemini_set_feature_flag__);
|
|
9
|
-
var isBlocksDragTargetDebug = exports.isBlocksDragTargetDebug = function isBlocksDragTargetDebug() {
|
|
10
|
-
return IS_GEMINI_TEST_ENV && (0, _platformFeatureFlags.fg)('platform_editor_element_drag_and_drop_debug');
|
|
11
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
const IS_GEMINI_TEST_ENV = Boolean(process.env.NODE_ENV === 'development') && Boolean(window.__gemini_set_feature_flag__);
|
|
3
|
-
export const isBlocksDragTargetDebug = () => {
|
|
4
|
-
return IS_GEMINI_TEST_ENV && fg('platform_editor_element_drag_and_drop_debug');
|
|
5
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
var IS_GEMINI_TEST_ENV = Boolean(process.env.NODE_ENV === 'development') && Boolean(window.__gemini_set_feature_flag__);
|
|
3
|
-
export var isBlocksDragTargetDebug = function isBlocksDragTargetDebug() {
|
|
4
|
-
return IS_GEMINI_TEST_ENV && fg('platform_editor_element_drag_and_drop_debug');
|
|
5
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isBlocksDragTargetDebug: () => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isBlocksDragTargetDebug: () => boolean;
|