@atlaskit/editor-plugin-block-controls 3.3.12 → 3.3.14
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 +16 -0
- package/dist/cjs/editor-commands/move-node.js +19 -2
- package/dist/cjs/editor-commands/move-to-layout.js +16 -60
- package/dist/cjs/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/pm-plugins/utils/drag-handle-positions.js +2 -7
- package/dist/cjs/pm-plugins/utils/validation.js +43 -11
- package/dist/cjs/ui/drag-handle.js +2 -4
- package/dist/cjs/ui/drag-preview.js +8 -19
- package/dist/cjs/ui/drop-target-layout.js +9 -15
- package/dist/cjs/ui/global-styles.js +1 -2
- package/dist/cjs/ui/inline-drop-target.js +9 -15
- package/dist/es2019/editor-commands/move-node.js +21 -4
- package/dist/es2019/editor-commands/move-to-layout.js +5 -51
- package/dist/es2019/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/pm-plugins/utils/drag-handle-positions.js +2 -7
- package/dist/es2019/pm-plugins/utils/validation.js +39 -9
- package/dist/es2019/ui/drag-handle.js +2 -4
- package/dist/es2019/ui/drag-preview.js +9 -20
- package/dist/es2019/ui/drop-target-layout.js +10 -16
- package/dist/es2019/ui/global-styles.js +1 -2
- package/dist/es2019/ui/inline-drop-target.js +10 -16
- package/dist/esm/editor-commands/move-node.js +21 -4
- package/dist/esm/editor-commands/move-to-layout.js +18 -62
- package/dist/esm/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/pm-plugins/utils/drag-handle-positions.js +2 -7
- package/dist/esm/pm-plugins/utils/validation.js +42 -10
- package/dist/esm/ui/drag-handle.js +2 -4
- package/dist/esm/ui/drag-preview.js +9 -20
- package/dist/esm/ui/drop-target-layout.js +9 -15
- package/dist/esm/ui/global-styles.js +1 -2
- package/dist/esm/ui/inline-drop-target.js +9 -15
- package/dist/types/pm-plugins/utils/validation.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/utils/validation.d.ts +2 -1
- package/package.json +7 -10
|
@@ -635,7 +635,7 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
|
|
|
635
635
|
// Currently we can only drag one node at a time
|
|
636
636
|
// so we only need to check first child
|
|
637
637
|
var draggable = dragging === null || dragging === void 0 ? void 0 : dragging.slice.content.firstChild;
|
|
638
|
-
if (dndDragCancelled && isMultiSelectEnabled || (draggable === null || draggable === void 0 ? void 0 : draggable.type.name) === 'layoutColumn'
|
|
638
|
+
if (dndDragCancelled && isMultiSelectEnabled || (draggable === null || draggable === void 0 ? void 0 : draggable.type.name) === 'layoutColumn') {
|
|
639
639
|
// we prevent native DnD for layoutColumn to prevent single column layout.
|
|
640
640
|
event.preventDefault();
|
|
641
641
|
return false;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, DRAG_HANDLE_H1_TOP_ADJUSTMENT, DRAG_HANDLE_H2_TOP_ADJUSTMENT, DRAG_HANDLE_H4_TOP_ADJUSTMENT, DRAG_HANDLE_H5_TOP_ADJUSTMENT, DRAG_HANDLE_H6_TOP_ADJUSTMENT, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT, DRAG_HANDLE_WIDTH, dragHandleGap } from '../../ui/consts';
|
|
3
2
|
export var getTopPosition = function getTopPosition(dom, type) {
|
|
4
3
|
if (!dom) {
|
|
5
4
|
return 'auto';
|
|
6
5
|
}
|
|
7
6
|
var table = dom.querySelector('table');
|
|
8
|
-
var isTable =
|
|
7
|
+
var isTable = table && (!type || type === 'table');
|
|
9
8
|
if (isTable) {
|
|
10
9
|
return "".concat(dom.offsetTop + ((table === null || table === void 0 ? void 0 : table.offsetTop) || 0), "px");
|
|
11
10
|
} else if (type === 'rule') {
|
|
12
11
|
return "".concat(dom.offsetTop - DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, "px");
|
|
13
12
|
} else if (type === 'layoutColumn') {
|
|
14
|
-
|
|
15
|
-
return "".concat(-dom.offsetTop / 2, "px");
|
|
16
|
-
} else {
|
|
17
|
-
return "".concat(-DRAG_HANDLE_WIDTH, "px");
|
|
18
|
-
}
|
|
13
|
+
return "".concat(-dom.offsetTop / 2, "px");
|
|
19
14
|
} else if (type === 'heading-1') {
|
|
20
15
|
return "".concat(dom.offsetTop + DRAG_HANDLE_H1_TOP_ADJUSTMENT, "px");
|
|
21
16
|
} else if (type === 'heading-2') {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
|
2
2
|
import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
|
|
3
3
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
7
|
export var isInsideTable = function isInsideTable(nodeType) {
|
|
@@ -45,10 +46,10 @@ export var transformExpandToNestedExpand = function transformExpandToNestedExpan
|
|
|
45
46
|
}
|
|
46
47
|
return null;
|
|
47
48
|
};
|
|
48
|
-
export var
|
|
49
|
+
export var transformFragmentExpandToNestedExpand = function transformFragmentExpandToNestedExpand(fragment) {
|
|
49
50
|
var children = [];
|
|
50
51
|
try {
|
|
51
|
-
|
|
52
|
+
fragment.forEach(function (node) {
|
|
52
53
|
if (isExpand(node.type)) {
|
|
53
54
|
var nestedExpandNode = transformExpandToNestedExpand(node);
|
|
54
55
|
if (nestedExpandNode) {
|
|
@@ -61,7 +62,14 @@ export var transformSliceExpandToNestedExpand = function transformSliceExpandToN
|
|
|
61
62
|
} catch (e) {
|
|
62
63
|
return null;
|
|
63
64
|
}
|
|
64
|
-
return
|
|
65
|
+
return Fragment.fromArray(children);
|
|
66
|
+
};
|
|
67
|
+
export var transformSliceExpandToNestedExpand = function transformSliceExpandToNestedExpand(slice) {
|
|
68
|
+
var fragment = transformFragmentExpandToNestedExpand(slice.content);
|
|
69
|
+
if (!fragment) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return new Slice(fragment, slice.openStart, slice.openEnd);
|
|
65
73
|
};
|
|
66
74
|
export var memoizedTransformExpandToNestedExpand = memoizeOne(function (node) {
|
|
67
75
|
try {
|
|
@@ -74,11 +82,40 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
|
|
|
74
82
|
var srcNodeType = srcNode.type;
|
|
75
83
|
var parentNodeType = destParent === null || destParent === void 0 ? void 0 : destParent.type.name;
|
|
76
84
|
var activeNodeType = srcNode === null || srcNode === void 0 ? void 0 : srcNode.type.name;
|
|
85
|
+
var isNestingTablesSupported = fg('platform_editor_use_nested_table_pm_nodes') && editorExperiment('nested-tables-in-tables', true, {
|
|
86
|
+
exposure: true
|
|
87
|
+
});
|
|
88
|
+
var tableNodeType = srcNode.type.schema.nodes.table;
|
|
89
|
+
var expandNodeType = srcNode.type.schema.nodes.expand;
|
|
77
90
|
if (activeNodeType === 'layoutColumn' && editorExperiment('advanced_layouts', true)) {
|
|
78
91
|
// Allow drag layout column and drop into layout section
|
|
79
92
|
if ((destNode === null || destNode === void 0 ? void 0 : destNode.type.name) === 'layoutSection' || parentNodeType === 'doc') {
|
|
80
93
|
return true;
|
|
81
94
|
}
|
|
95
|
+
if ((parentNodeType === 'tableCell' || parentNodeType === 'tableHeader') && fg('platform_editor_drag_layout_column_into_nodes')) {
|
|
96
|
+
var maybeExpandNodesArray = findChildrenByType(srcNode, expandNodeType);
|
|
97
|
+
var layoutColumnContainExpand = maybeExpandNodesArray.length > 0;
|
|
98
|
+
var layoutColumnContainTable = findChildrenByType(srcNode, tableNodeType).length > 0;
|
|
99
|
+
|
|
100
|
+
// when layout column content does not contain table, allow to drop into table cell
|
|
101
|
+
if (!layoutColumnContainTable) {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// when layout column content contains table, but does not contain expand, allow drop into table cell if nesting tables is supported, and the nesting depth does not exceed 1
|
|
106
|
+
if (layoutColumnContainTable && !layoutColumnContainExpand) {
|
|
107
|
+
var nestingDepth = getParentOfTypeCount(tableNodeType)($destNodePos);
|
|
108
|
+
return isNestingTablesSupported && nestingDepth <= 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// when layout column content contains an expand, and there is a table inside the expand, should not allow to drop into table cell
|
|
112
|
+
if (layoutColumnContainTable && layoutColumnContainExpand) {
|
|
113
|
+
var isAnyTableNestedInExpand = maybeExpandNodesArray.some(function (result) {
|
|
114
|
+
return findChildrenByType(result.node, tableNodeType).length > 0;
|
|
115
|
+
});
|
|
116
|
+
return !isAnyTableNestedInExpand;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
82
119
|
}
|
|
83
120
|
|
|
84
121
|
// Place experiments here instead of just inside move-node.ts as it stops the drag marker from appearing.
|
|
@@ -88,16 +125,11 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
|
|
|
88
125
|
}
|
|
89
126
|
}
|
|
90
127
|
|
|
91
|
-
// Place experiments here instead of just inside move-node.ts as it stops the drag marker from appearing.
|
|
92
|
-
var isNestingTablesSupported = fg('platform_editor_use_nested_table_pm_nodes') && editorExperiment('nested-tables-in-tables', true, {
|
|
93
|
-
exposure: true
|
|
94
|
-
});
|
|
95
|
-
|
|
96
128
|
// NOTE: this will block drop targets from showing for dragging a table into another table
|
|
97
129
|
// unless nested tables are supported and the nesting depth does not exceed 1
|
|
98
130
|
if ((parentNodeType === 'tableCell' || parentNodeType === 'tableHeader') && activeNodeType === 'table') {
|
|
99
|
-
var
|
|
100
|
-
if (!isNestingTablesSupported || isNestingTablesSupported &&
|
|
131
|
+
var _nestingDepth = getParentOfTypeCount(tableNodeType)($destNodePos);
|
|
132
|
+
if (!isNestingTablesSupported || isNestingTablesSupported && _nestingDepth > 1) {
|
|
101
133
|
return false;
|
|
102
134
|
}
|
|
103
135
|
}
|
|
@@ -236,11 +236,9 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
236
236
|
// but ensures the preview is generated correctly.
|
|
237
237
|
var handleMouseDown = useCallback(function () {
|
|
238
238
|
if (editorExperiment('advanced_layouts', true)) {
|
|
239
|
+
var _buttonRef$current;
|
|
239
240
|
// prevent native drag and drop.
|
|
240
|
-
|
|
241
|
-
var _buttonRef$current;
|
|
242
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
243
|
-
}
|
|
241
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
244
242
|
if (!isLayoutColumn) {
|
|
245
243
|
return undefined;
|
|
246
244
|
}
|
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
2
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
var previewStyleNew = {
|
|
3
|
+
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
4
|
+
var previewStyle = {
|
|
6
5
|
borderColor: "var(--ds-border, ".concat(N30, ")"),
|
|
7
6
|
borderStyle: 'solid',
|
|
8
7
|
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
9
8
|
borderWidth: "var(--ds-border-width-outline, 2px)",
|
|
10
9
|
backgroundColor: "var(--ds-skeleton-subtle, ".concat(N20, ")")
|
|
11
10
|
};
|
|
12
|
-
var previewStyleOld = {
|
|
13
|
-
borderColor: "var(--ds-border-focused, ".concat(B200, ")"),
|
|
14
|
-
borderStyle: 'solid',
|
|
15
|
-
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
16
|
-
borderWidth: "var(--ds-border-width-outline, 2px)",
|
|
17
|
-
backgroundColor: "var(--ds-blanket-selected, #388BFF14)"
|
|
18
|
-
};
|
|
19
11
|
var getPreviewContainerDimensionsForSingle = function getPreviewContainerDimensionsForSingle(dom, nodeType) {
|
|
20
12
|
var nodeContainer = dom;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
nodeContainer = iframeContainer;
|
|
27
|
-
}
|
|
13
|
+
var iframeContainer = dom.querySelector('iframe');
|
|
14
|
+
if (nodeType === 'embedCard') {
|
|
15
|
+
nodeContainer = dom.querySelector('.rich-media-item') || dom;
|
|
16
|
+
} else if (nodeType === 'extension' && iframeContainer) {
|
|
17
|
+
nodeContainer = iframeContainer;
|
|
28
18
|
}
|
|
29
19
|
var nodeContainerRect = nodeContainer.getBoundingClientRect();
|
|
30
20
|
return {
|
|
@@ -54,7 +44,6 @@ var createGenericPreview = function createGenericPreview() {
|
|
|
54
44
|
var generalPreview = document.createElement('div');
|
|
55
45
|
// ProseMirror class is required to make sure the cloned dom is styled correctly
|
|
56
46
|
generalPreview.classList.add('ProseMirror', 'block-ctrl-drag-preview');
|
|
57
|
-
var previewStyle = fg('platform_editor_elements_drag_and_drop_ed_23189') ? previewStyleNew : previewStyleOld;
|
|
58
47
|
generalPreview.style.border = "".concat(previewStyle.borderWidth, " ").concat(previewStyle.borderStyle, " ").concat(previewStyle.borderColor);
|
|
59
48
|
generalPreview.style.borderRadius = previewStyle.borderRadius;
|
|
60
49
|
generalPreview.style.backgroundColor = previewStyle.backgroundColor;
|
|
@@ -78,13 +67,13 @@ var createContentPreviewElement = function createContentPreviewElement(dom, node
|
|
|
78
67
|
clonedDom.style.marginRight = '0';
|
|
79
68
|
clonedDom.style.marginBottom = nodeSpacing ? "".concat(nodeSpacing.bottom) : '0';
|
|
80
69
|
clonedDom.style.boxShadow = 'none';
|
|
81
|
-
clonedDom.style.opacity = browser.windows ? '1' :
|
|
70
|
+
clonedDom.style.opacity = browser.windows ? '1' : '0.31';
|
|
82
71
|
contentPreviewOneElement.appendChild(clonedDom);
|
|
83
72
|
return contentPreviewOneElement;
|
|
84
73
|
};
|
|
85
74
|
var isGenericPreview = function isGenericPreview(dom, nodeType) {
|
|
86
75
|
var embedCard = dom.querySelector('.embedCardView-content-wrap');
|
|
87
|
-
return
|
|
76
|
+
return nodeType === 'embedCard' || !!embedCard || nodeType === 'extension' && !!dom.querySelector('iframe');
|
|
88
77
|
};
|
|
89
78
|
var createPreviewForElement = function createPreviewForElement(dom, nodeType, nodeSpacing) {
|
|
90
79
|
var shouldBeGenericPreview = isGenericPreview(dom, nodeType);
|
|
@@ -9,7 +9,6 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { layoutBreakpointWidth } from '@atlaskit/editor-shared-styles';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';
|
|
14
13
|
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
15
14
|
import { B200 } from '@atlaskit/theme/colors';
|
|
@@ -74,7 +73,7 @@ export var DropTargetLayout = function DropTargetLayout(props) {
|
|
|
74
73
|
var to = getPos();
|
|
75
74
|
var mappedTo;
|
|
76
75
|
if (to !== undefined) {
|
|
77
|
-
var _api$core;
|
|
76
|
+
var _api$core, _api$core2;
|
|
78
77
|
var from = activeNode.pos;
|
|
79
78
|
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref2) {
|
|
80
79
|
var _api$blockControls2;
|
|
@@ -82,22 +81,17 @@ export var DropTargetLayout = function DropTargetLayout(props) {
|
|
|
82
81
|
api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.commands) === null || _api$blockControls2 === void 0 || _api$blockControls2.moveToLayout(from, to)({
|
|
83
82
|
tr: tr
|
|
84
83
|
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
var insertColumnStep = getInsertLayoutStep(tr);
|
|
85
|
+
mappedTo = insertColumnStep === null || insertColumnStep === void 0 ? void 0 : insertColumnStep.from;
|
|
86
|
+
return tr;
|
|
87
|
+
});
|
|
88
|
+
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function (_ref3) {
|
|
89
|
+
var tr = _ref3.tr;
|
|
90
|
+
if (mappedTo !== undefined) {
|
|
91
|
+
updateSelection(tr, mappedTo);
|
|
88
92
|
}
|
|
89
93
|
return tr;
|
|
90
94
|
});
|
|
91
|
-
if (fg('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
92
|
-
var _api$core2;
|
|
93
|
-
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function (_ref3) {
|
|
94
|
-
var tr = _ref3.tr;
|
|
95
|
-
if (mappedTo !== undefined) {
|
|
96
|
-
updateSelection(tr, mappedTo);
|
|
97
|
-
}
|
|
98
|
-
return tr;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
95
|
}
|
|
102
96
|
}, [api, getPos, activeNode]);
|
|
103
97
|
useEffect(function () {
|
|
@@ -6,7 +6,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { css, Global, jsx } from '@emotion/react';
|
|
8
8
|
import { akEditorBreakoutPadding, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport } from '@atlaskit/editor-shared-styles';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
10
|
import { DRAG_HANDLE_MAX_WIDTH_PLUS_GAP, DRAG_HANDLE_WIDTH } from './consts';
|
|
12
11
|
|
|
@@ -209,6 +208,6 @@ var blockCardWithoutLayout = css({
|
|
|
209
208
|
});
|
|
210
209
|
export var GlobalStylesWrapper = function GlobalStylesWrapper() {
|
|
211
210
|
return jsx(Global, {
|
|
212
|
-
styles: [globalStyles(),
|
|
211
|
+
styles: [globalStyles(), globalDnDStyle, editorExperiment('nested-dnd', true) ? extendedHoverZoneNested() : extendedHoverZone(), withInlineNodeStyle, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, withRelativePosStyle, topLevelNodeMarginStyles, editorExperiment('nested-dnd', true) ? withAnchorNameZindexNestedStyle : withAnchorNameZindexStyle,,]
|
|
213
212
|
});
|
|
214
213
|
};
|
|
@@ -11,7 +11,6 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
12
12
|
import { css, jsx } from '@emotion/react';
|
|
13
13
|
import { akEditorBreakoutPadding } from '@atlaskit/editor-shared-styles';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';
|
|
16
15
|
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
17
16
|
import { B200 } from '@atlaskit/theme/colors';
|
|
@@ -183,7 +182,7 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
|
|
|
183
182
|
var toPos = getPos();
|
|
184
183
|
var mappedTo;
|
|
185
184
|
if (activeNode && toPos !== undefined) {
|
|
186
|
-
var _api$core;
|
|
185
|
+
var _api$core, _api$core2;
|
|
187
186
|
var start = activeNode.pos;
|
|
188
187
|
var moveToEnd = position === 'right';
|
|
189
188
|
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref3) {
|
|
@@ -194,22 +193,17 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
|
|
|
194
193
|
})({
|
|
195
194
|
tr: tr
|
|
196
195
|
});
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
var insertLayoutStep = getInsertLayoutStep(tr);
|
|
197
|
+
mappedTo = insertLayoutStep === null || insertLayoutStep === void 0 ? void 0 : insertLayoutStep.from;
|
|
198
|
+
return tr;
|
|
199
|
+
});
|
|
200
|
+
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function (_ref4) {
|
|
201
|
+
var tr = _ref4.tr;
|
|
202
|
+
if (mappedTo !== undefined) {
|
|
203
|
+
updateSelection(tr, mappedTo, moveToEnd);
|
|
200
204
|
}
|
|
201
205
|
return tr;
|
|
202
206
|
});
|
|
203
|
-
if (fg('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
204
|
-
var _api$core2;
|
|
205
|
-
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function (_ref4) {
|
|
206
|
-
var tr = _ref4.tr;
|
|
207
|
-
if (mappedTo !== undefined) {
|
|
208
|
-
updateSelection(tr, mappedTo, moveToEnd);
|
|
209
|
-
}
|
|
210
|
-
return tr;
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
207
|
}
|
|
214
208
|
}, [api, getPos, position]);
|
|
215
209
|
var hoverZoneRectStyle = useMemo(function () {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { NodeType, Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
export declare const isInsideTable: (nodeType: NodeType) => Boolean;
|
|
4
4
|
export declare const isLayoutColumn: (nodeType: NodeType) => Boolean;
|
|
@@ -14,6 +14,7 @@ export declare const isInSameLayout: ($from: ResolvedPos, $to: ResolvedPos) => b
|
|
|
14
14
|
* @throws RangeError: Invalid content for node nestedExpand
|
|
15
15
|
*/
|
|
16
16
|
export declare const transformExpandToNestedExpand: (expandNode: PMNode) => PMNode | null;
|
|
17
|
+
export declare const transformFragmentExpandToNestedExpand: (fragment: Fragment) => Fragment | null;
|
|
17
18
|
export declare const transformSliceExpandToNestedExpand: (slice: Slice) => Slice | null;
|
|
18
19
|
export declare const memoizedTransformExpandToNestedExpand: import("memoize-one").MemoizedFn<(node: PMNode) => PMNode | null>;
|
|
19
20
|
export declare function canMoveNodeToIndex(destParent: PMNode, indexIntoParent: number, srcNode: PMNode, $destNodePos: ResolvedPos, destNode?: PMNode): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { NodeType, Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
export declare const isInsideTable: (nodeType: NodeType) => Boolean;
|
|
4
4
|
export declare const isLayoutColumn: (nodeType: NodeType) => Boolean;
|
|
@@ -14,6 +14,7 @@ export declare const isInSameLayout: ($from: ResolvedPos, $to: ResolvedPos) => b
|
|
|
14
14
|
* @throws RangeError: Invalid content for node nestedExpand
|
|
15
15
|
*/
|
|
16
16
|
export declare const transformExpandToNestedExpand: (expandNode: PMNode) => PMNode | null;
|
|
17
|
+
export declare const transformFragmentExpandToNestedExpand: (fragment: Fragment) => Fragment | null;
|
|
17
18
|
export declare const transformSliceExpandToNestedExpand: (slice: Slice) => Slice | null;
|
|
18
19
|
export declare const memoizedTransformExpandToNestedExpand: import("memoize-one").MemoizedFn<(node: PMNode) => PMNode | null>;
|
|
19
20
|
export declare function canMoveNodeToIndex(destParent: PMNode, indexIntoParent: number, srcNode: PMNode, $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.3.
|
|
3
|
+
"version": "3.3.14",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
36
|
-
"@atlaskit/editor-common": "^102.
|
|
36
|
+
"@atlaskit/editor-common": "^102.8.0",
|
|
37
37
|
"@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
|
|
38
|
-
"@atlaskit/editor-plugin-analytics": "^2.
|
|
38
|
+
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-feature-flags": "^1.3.0",
|
|
41
41
|
"@atlaskit/editor-plugin-metrics": "^3.4.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.0.0",
|
|
53
53
|
"@atlaskit/primitives": "^14.1.0",
|
|
54
54
|
"@atlaskit/theme": "^18.0.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^4.0.0",
|
|
56
56
|
"@atlaskit/tokens": "^4.5.0",
|
|
57
57
|
"@atlaskit/tooltip": "^20.0.0",
|
|
58
58
|
"@babel/runtime": "^7.0.0",
|
|
@@ -110,9 +110,6 @@
|
|
|
110
110
|
"type": "boolean",
|
|
111
111
|
"referenceOnly": true
|
|
112
112
|
},
|
|
113
|
-
"platform_editor_elements_drag_and_drop_ed_23189": {
|
|
114
|
-
"type": "boolean"
|
|
115
|
-
},
|
|
116
113
|
"platform_editor_element_drag_and_drop_ed_23873": {
|
|
117
114
|
"type": "boolean"
|
|
118
115
|
},
|
|
@@ -125,9 +122,6 @@
|
|
|
125
122
|
"platform_editor_use_nested_table_pm_nodes": {
|
|
126
123
|
"type": "boolean"
|
|
127
124
|
},
|
|
128
|
-
"platform_editor_advanced_layouts_post_fix_patch_1": {
|
|
129
|
-
"type": "boolean"
|
|
130
|
-
},
|
|
131
125
|
"platform_editor_advanced_layouts_post_fix_patch_2": {
|
|
132
126
|
"type": "boolean"
|
|
133
127
|
},
|
|
@@ -172,6 +166,9 @@
|
|
|
172
166
|
},
|
|
173
167
|
"platform_editor_remove_drag_handle_fix": {
|
|
174
168
|
"type": "boolean"
|
|
169
|
+
},
|
|
170
|
+
"platform_editor_drag_layout_column_into_nodes": {
|
|
171
|
+
"type": "boolean"
|
|
175
172
|
}
|
|
176
173
|
}
|
|
177
174
|
}
|