@atlaskit/editor-plugin-block-controls 7.2.12 → 7.3.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 +25 -0
- package/dist/cjs/editor-commands/move-node.js +34 -59
- package/dist/cjs/pm-plugins/handle-mouse-over.js +9 -8
- package/dist/cjs/pm-plugins/utils/getSelection.js +18 -37
- package/dist/cjs/pm-plugins/utils/validation.js +1 -1
- package/dist/cjs/ui/drag-handle.js +13 -4
- package/dist/cjs/ui/inline-drop-target.js +2 -1
- package/dist/cjs/ui/quick-insert-button.js +14 -1
- package/dist/es2019/editor-commands/move-node.js +35 -61
- package/dist/es2019/pm-plugins/handle-mouse-over.js +9 -8
- package/dist/es2019/pm-plugins/utils/getSelection.js +18 -37
- package/dist/es2019/pm-plugins/utils/validation.js +1 -1
- package/dist/es2019/ui/drag-handle.js +14 -5
- package/dist/es2019/ui/inline-drop-target.js +2 -1
- package/dist/es2019/ui/quick-insert-button.js +15 -2
- package/dist/esm/editor-commands/move-node.js +34 -59
- package/dist/esm/pm-plugins/handle-mouse-over.js +9 -8
- package/dist/esm/pm-plugins/utils/getSelection.js +18 -37
- package/dist/esm/pm-plugins/utils/validation.js +1 -1
- package/dist/esm/ui/drag-handle.js +14 -5
- package/dist/esm/ui/inline-drop-target.js +2 -1
- package/dist/esm/ui/quick-insert-button.js +15 -2
- package/package.json +12 -12
|
@@ -2,7 +2,6 @@ import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
|
2
2
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
export const getInlineNodePos = (tr, start, nodeSize) => {
|
|
@@ -67,7 +66,7 @@ const oldGetSelection = (tr, start) => {
|
|
|
67
66
|
// we need a quick way to make all child media nodes appear as selected without the need for a custom selection
|
|
68
67
|
nodeName === 'mediaGroup') {
|
|
69
68
|
return new NodeSelection($startPos);
|
|
70
|
-
} else if (nodeName === 'taskList'
|
|
69
|
+
} else if (nodeName === 'taskList') {
|
|
71
70
|
return TextSelection.create(tr.doc, start, start + nodeSize);
|
|
72
71
|
} else {
|
|
73
72
|
const {
|
|
@@ -109,7 +108,7 @@ const newGetSelection = (tr, start) => {
|
|
|
109
108
|
const $mediaStartPos = tr.doc.resolve(start + 1);
|
|
110
109
|
return new NodeSelection($mediaStartPos);
|
|
111
110
|
}
|
|
112
|
-
if (nodeName === 'taskList' && !expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)
|
|
111
|
+
if (nodeName === 'taskList' && !expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
113
112
|
return TextSelection.create(tr.doc, start, start + nodeSize);
|
|
114
113
|
}
|
|
115
114
|
const {
|
|
@@ -176,40 +175,22 @@ export const isHandleCorrelatedToSelection = (state, selection, handlePos) => {
|
|
|
176
175
|
}
|
|
177
176
|
let nodeStart;
|
|
178
177
|
const $selectionFrom = selection.$from;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
nodeStart = $resolvedNodePos.before();
|
|
196
|
-
}
|
|
197
|
-
} else {
|
|
198
|
-
const selectionFrom = $selectionFrom.pos;
|
|
199
|
-
nodeStart = $selectionFrom.depth ? $selectionFrom.before() : selectionFrom;
|
|
200
|
-
const $resolvedNodePos = state.doc.resolve(nodeStart);
|
|
201
|
-
if (['tableRow', 'tableCell', 'tableHeader'].includes($resolvedNodePos.node().type.name)) {
|
|
202
|
-
const parentNodeFindRes = findParentNodeOfType(state.schema.nodes['table'])(selection);
|
|
203
|
-
const tablePos = parentNodeFindRes === null || parentNodeFindRes === void 0 ? void 0 : parentNodeFindRes.pos;
|
|
204
|
-
nodeStart = typeof tablePos === 'undefined' ? nodeStart : tablePos;
|
|
205
|
-
} else if (['listItem'].includes($resolvedNodePos.node().type.name)) {
|
|
206
|
-
nodeStart = $resolvedNodePos.before(rootListDepth($resolvedNodePos));
|
|
207
|
-
} else if (['taskList'].includes($resolvedNodePos.node().type.name)) {
|
|
208
|
-
const listdepth = rootTaskListDepth($resolvedNodePos);
|
|
209
|
-
nodeStart = $resolvedNodePos.before(listdepth);
|
|
210
|
-
} else if (['blockquote'].includes($resolvedNodePos.node().type.name)) {
|
|
211
|
-
nodeStart = $resolvedNodePos.before();
|
|
212
|
-
}
|
|
178
|
+
nodeStart = $selectionFrom.before($selectionFrom.sharedDepth(selection.to) + 1);
|
|
179
|
+
if (nodeStart === $selectionFrom.pos) {
|
|
180
|
+
nodeStart = $selectionFrom.depth ? $selectionFrom.before() : $selectionFrom.pos;
|
|
181
|
+
}
|
|
182
|
+
const $resolvedNodePos = state.doc.resolve(nodeStart);
|
|
183
|
+
if (['tableRow', 'tableCell', 'tableHeader'].includes($resolvedNodePos.node().type.name)) {
|
|
184
|
+
const parentNodeFindRes = findParentNodeOfType(state.schema.nodes['table'])(selection);
|
|
185
|
+
const tablePos = parentNodeFindRes === null || parentNodeFindRes === void 0 ? void 0 : parentNodeFindRes.pos;
|
|
186
|
+
nodeStart = typeof tablePos === 'undefined' ? nodeStart : tablePos;
|
|
187
|
+
} else if (['listItem'].includes($resolvedNodePos.node().type.name)) {
|
|
188
|
+
nodeStart = $resolvedNodePos.before(rootListDepth($resolvedNodePos));
|
|
189
|
+
} else if (['taskList'].includes($resolvedNodePos.node().type.name)) {
|
|
190
|
+
const listdepth = rootTaskListDepth($resolvedNodePos);
|
|
191
|
+
nodeStart = $resolvedNodePos.before(listdepth);
|
|
192
|
+
} else if (['blockquote'].includes($resolvedNodePos.node().type.name)) {
|
|
193
|
+
nodeStart = $resolvedNodePos.before();
|
|
213
194
|
}
|
|
214
195
|
return Boolean(handlePos < selection.$to.pos && handlePos >= nodeStart);
|
|
215
196
|
};
|
|
@@ -164,7 +164,7 @@ export function canMoveSliceToIndex(slice, sliceFromPos, sliceToPos, destParent,
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
// Multiple layout columns do not drop correctly.
|
|
167
|
-
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type.name) === 'layoutColumn'
|
|
167
|
+
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type.name) === 'layoutColumn') {
|
|
168
168
|
return false;
|
|
169
169
|
}
|
|
170
170
|
for (let i = 0; i < slice.content.childCount; i++) {
|
|
@@ -17,7 +17,7 @@ import { tableControlsSpacing, DRAG_HANDLE_WIDTH } from '@atlaskit/editor-common
|
|
|
17
17
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
18
18
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
19
19
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
20
|
-
import { akEditorTableToolbarSize, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles/consts';
|
|
20
|
+
import { akEditorTableToolbarSize, akEditorFullPageNarrowBreakout, akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles/consts';
|
|
21
21
|
import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
|
|
22
22
|
import DragHandlerIcon from '@atlaskit/icon/glyph/drag-handler';
|
|
23
23
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -127,6 +127,16 @@ const dragHandleButtonStyles = css({
|
|
|
127
127
|
backgroundColor: "var(--ds-background-disabled, transparent)"
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
|
+
|
|
131
|
+
// Calculate scaled dimensions based on the base font size using CSS calc()
|
|
132
|
+
// Default font size is 16px, scale proportionally
|
|
133
|
+
// Standard: 16px -> 24h x 12w, Dense: 13px -> 18h x 9w
|
|
134
|
+
const dragHandleButtonDenseModeStyles = css({
|
|
135
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
136
|
+
height: `calc(${DRAG_HANDLE_HEIGHT}px * var(--ak-editor-base-font-size) / ${akEditorFullPageDefaultFontSize}px)`,
|
|
137
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
138
|
+
width: `calc(${DRAG_HANDLE_WIDTH}px * var(--ak-editor-base-font-size) / ${akEditorFullPageDefaultFontSize}px)`
|
|
139
|
+
});
|
|
130
140
|
const dragHandleButtonSmallScreenStyles = css({
|
|
131
141
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-container-queries, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
132
142
|
[`@container editor-area (max-width: ${akEditorFullPageNarrowBreakout}px)`]: {
|
|
@@ -513,9 +523,8 @@ export const DragHandle = ({
|
|
|
513
523
|
if (typeof handlePos !== 'number') {
|
|
514
524
|
return tr;
|
|
515
525
|
}
|
|
516
|
-
const oldHandlePosCheck = handlePos >= tr.selection.$from.start() - 1 && handlePos <= tr.selection.to;
|
|
517
526
|
const newHandlePosCheck = isHandleCorrelatedToSelection(view.state, tr.selection, handlePos);
|
|
518
|
-
if (!tr.selection.empty &&
|
|
527
|
+
if (!tr.selection.empty && newHandlePosCheck) {
|
|
519
528
|
var _api$blockControls7;
|
|
520
529
|
api === null || api === void 0 ? void 0 : (_api$blockControls7 = api.blockControls) === null || _api$blockControls7 === void 0 ? void 0 : _api$blockControls7.commands.setMultiSelectPositions()({
|
|
521
530
|
tr
|
|
@@ -714,7 +723,7 @@ export const DragHandle = ({
|
|
|
714
723
|
const bottom = editorExperiment('platform_editor_controls', 'variant1') ? getControlBottomCSSValue(safeAnchorName, isSticky, isTopLevelNode, isLayoutColumn) : {};
|
|
715
724
|
return {
|
|
716
725
|
left: isEdgeCase ? `calc(anchor(${safeAnchorName} start) + ${getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType)})` : editorExperiment('advanced_layouts', true) && isLayoutColumn ? `calc((anchor(${safeAnchorName} right) + anchor(${safeAnchorName} left))/2 - ${DRAG_HANDLE_HEIGHT / 2}px)` : `calc(anchor(${safeAnchorName} start) - ${DRAG_HANDLE_WIDTH}px - ${dragHandleGap(nodeType, parentNodeType)}px)`,
|
|
717
|
-
top: editorExperiment('advanced_layouts', true) && isLayoutColumn ? `calc(anchor(${safeAnchorName} top) - ${DRAG_HANDLE_WIDTH}px)` : `calc(anchor(${safeAnchorName} start)
|
|
726
|
+
top: editorExperiment('advanced_layouts', true) && isLayoutColumn ? `calc(anchor(${safeAnchorName} top) - ${DRAG_HANDLE_WIDTH}px)` : `calc(anchor(${safeAnchorName} start)+ ${topPositionAdjustment(expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? $pos && $pos.nodeAfter && getNodeTypeWithLevel($pos.nodeAfter) || nodeType : nodeType)}px)`,
|
|
718
727
|
...bottom
|
|
719
728
|
};
|
|
720
729
|
}
|
|
@@ -942,7 +951,7 @@ export const DragHandle = ({
|
|
|
942
951
|
css: [editorExperiment('platform_editor_controls', 'variant1') ? dragHandleButtonStyles : dragHandleButtonStylesOld, editorExperiment('platform_editor_controls', 'variant1') && dragHandleColor,
|
|
943
952
|
// ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
|
|
944
953
|
// See https://product-fabric.atlassian.net/browse/ED-26266
|
|
945
|
-
browser.gecko && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && hasHadInteraction && selectedStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorExperiment('platform_editor_controls', 'control') && dragHandleButtonSmallScreenStyles, expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) && isFocused && keyboardFocusedDragHandleStyles, expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) ? focusedStyles : focusedStylesOld],
|
|
954
|
+
browser.gecko && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && hasHadInteraction && selectedStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorExperiment('platform_editor_controls', 'control') && dragHandleButtonSmallScreenStyles, expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) && isFocused && keyboardFocusedDragHandleStyles, expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) ? focusedStyles : focusedStylesOld, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && dragHandleButtonDenseModeStyles],
|
|
946
955
|
ref: buttonRef
|
|
947
956
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
948
957
|
,
|
|
@@ -90,7 +90,8 @@ export const InlineDropTarget = ({
|
|
|
90
90
|
const [isDraggedOver, setIsDraggedOver] = useState(false);
|
|
91
91
|
const anchorName = useMemo(() => {
|
|
92
92
|
if (expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
93
|
-
|
|
93
|
+
var _getPos;
|
|
94
|
+
return nextNode ? (api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(nextNode, (_getPos = getPos()) !== null && _getPos !== void 0 ? _getPos : -1)) || '' : '';
|
|
94
95
|
}
|
|
95
96
|
return nextNode ? getNodeAnchor(nextNode) : '';
|
|
96
97
|
}, [api, getPos, nextNode]);
|
|
@@ -14,14 +14,17 @@ import { tableControlsSpacing } from '@atlaskit/editor-common/styles';
|
|
|
14
14
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
15
15
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
16
16
|
import { findParentNode, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
17
|
+
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
17
18
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
18
19
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
20
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
21
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
20
22
|
import { Box, Pressable, xcss } from '@atlaskit/primitives';
|
|
23
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
24
|
import Tooltip from '@atlaskit/tooltip';
|
|
22
25
|
import { getControlBottomCSSValue, getControlHeightCSSValue, getNodeHeight, getTopPosition, shouldBeSticky } from '../pm-plugins/utils/drag-handle-positions';
|
|
23
26
|
import { getLeftPositionForRootElement } from '../pm-plugins/utils/widget-positions';
|
|
24
|
-
import { QUICK_INSERT_DIMENSIONS, QUICK_INSERT_LEFT_OFFSET, rootElementGap, topPositionAdjustment } from './consts';
|
|
27
|
+
import { QUICK_INSERT_DIMENSIONS, QUICK_INSERT_HEIGHT, QUICK_INSERT_LEFT_OFFSET, QUICK_INSERT_WIDTH, rootElementGap, topPositionAdjustment } from './consts';
|
|
25
28
|
import { refreshAnchorName } from './utils/anchor-name';
|
|
26
29
|
import { isInTextSelection, isNestedNodeSelected, isNonEditableBlock, isSelectionInNode } from './utils/document-checks';
|
|
27
30
|
import { getAnchorAttrName } from './utils/dom-attr-name';
|
|
@@ -53,6 +56,16 @@ const stickyButtonStyles = xcss({
|
|
|
53
56
|
outline: `${"var(--ds-border-width-focused, 2px)"} solid ${"var(--ds-border-focused, #388BFF)"}`
|
|
54
57
|
}
|
|
55
58
|
});
|
|
59
|
+
|
|
60
|
+
// Calculate scaled dimensions based on the base font size using CSS calc()
|
|
61
|
+
// Default font size is 16px, scale proportionally
|
|
62
|
+
// Standard: 16px -> 24px x 24px, Dense: 13px -> ~18.5px x ~18.5px
|
|
63
|
+
const stickyButtonDenseModeStyles = xcss({
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
65
|
+
height: `calc(${QUICK_INSERT_HEIGHT}px * var(--ak-editor-base-font-size) / ${akEditorFullPageDefaultFontSize}px)`,
|
|
66
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
67
|
+
width: `calc(${QUICK_INSERT_WIDTH}px * var(--ak-editor-base-font-size) / ${akEditorFullPageDefaultFontSize}px)`
|
|
68
|
+
});
|
|
56
69
|
const containerStaticStyles = xcss({
|
|
57
70
|
position: 'absolute',
|
|
58
71
|
zIndex: 'card'
|
|
@@ -273,7 +286,7 @@ export const TypeAheadControl = ({
|
|
|
273
286
|
testId: "editor-quick-insert-button",
|
|
274
287
|
type: "button",
|
|
275
288
|
"aria-label": formatMessage(messages.insert),
|
|
276
|
-
xcss: [stickyButtonStyles],
|
|
289
|
+
xcss: [stickyButtonStyles, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && stickyButtonDenseModeStyles],
|
|
277
290
|
onClick: handleQuickInsert,
|
|
278
291
|
onMouseDown: handleMouseDown
|
|
279
292
|
}, jsx(AddIcon, {
|
|
@@ -34,50 +34,37 @@ import { getPosWhenMoveNodeDown, getPosWhenMoveNodeUp } from './utils/move-node-
|
|
|
34
34
|
function transformSourceSlice(nodeCopy, destType) {
|
|
35
35
|
var srcNode = nodeCopy.content.firstChild;
|
|
36
36
|
var schema = srcNode === null || srcNode === void 0 ? void 0 : srcNode.type.schema;
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var destTypeInDocOrLayoutCol = [doc, layoutColumn].includes(destType);
|
|
37
|
+
if (!schema) {
|
|
38
|
+
return nodeCopy;
|
|
39
|
+
}
|
|
40
|
+
var _schema$nodes = schema.nodes,
|
|
41
|
+
doc = _schema$nodes.doc,
|
|
42
|
+
layoutColumn = _schema$nodes.layoutColumn;
|
|
43
|
+
var destTypeInTable = isInsideTable(destType);
|
|
44
|
+
var destTypeInDocOrLayoutCol = [doc, layoutColumn].includes(destType);
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
if (containsExpand && containsNestedExpand) {
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (containsExpand && destTypeInTable) {
|
|
65
|
-
return transformSliceExpandToNestedExpand(nodeCopy);
|
|
66
|
-
} else if (containsNestedExpand && destTypeInDocOrLayoutCol) {
|
|
67
|
-
return transformSliceNestedExpandToExpand(nodeCopy, schema);
|
|
46
|
+
// No need to loop over slice content if destination requires no transformations
|
|
47
|
+
if (!destTypeInTable && !destTypeInDocOrLayoutCol) {
|
|
48
|
+
return nodeCopy;
|
|
49
|
+
}
|
|
50
|
+
var containsExpand = false;
|
|
51
|
+
var containsNestedExpand = false;
|
|
52
|
+
for (var i = 0; i < nodeCopy.content.childCount; i++) {
|
|
53
|
+
var node = nodeCopy.content.child(i);
|
|
54
|
+
if (node.type === schema.nodes.expand) {
|
|
55
|
+
containsExpand = true;
|
|
56
|
+
} else if (node.type === schema.nodes.nestedExpand) {
|
|
57
|
+
containsNestedExpand = true;
|
|
68
58
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var _schema$nodes2 = schema.nodes,
|
|
72
|
-
_doc = _schema$nodes2.doc,
|
|
73
|
-
_layoutColumn = _schema$nodes2.layoutColumn;
|
|
74
|
-
if (srcNode.type === schema.nodes.nestedExpand && [_doc, _layoutColumn].includes(destType)) {
|
|
75
|
-
return transformSliceNestedExpandToExpand(nodeCopy, schema);
|
|
76
|
-
} else if (srcNode.type === schema.nodes.expand && isInsideTable(destType)) {
|
|
77
|
-
return transformSliceExpandToNestedExpand(nodeCopy);
|
|
78
|
-
}
|
|
59
|
+
if (containsExpand && containsNestedExpand) {
|
|
60
|
+
break;
|
|
79
61
|
}
|
|
80
62
|
}
|
|
63
|
+
if (containsExpand && destTypeInTable) {
|
|
64
|
+
return transformSliceExpandToNestedExpand(nodeCopy);
|
|
65
|
+
} else if (containsNestedExpand && destTypeInDocOrLayoutCol) {
|
|
66
|
+
return transformSliceNestedExpandToExpand(nodeCopy, schema);
|
|
67
|
+
}
|
|
81
68
|
return nodeCopy;
|
|
82
69
|
}
|
|
83
70
|
var nodesSupportDragLayoutColumnInto = ['tableCell', 'tableHeader', 'panel', 'expand', 'nestedExpand'];
|
|
@@ -140,7 +127,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
140
127
|
var hoistedPos;
|
|
141
128
|
var from = Math.min(expandedAnchor, expandedHead);
|
|
142
129
|
// Nodes like lists nest within themselves, we need to find the top most position
|
|
143
|
-
if (isParentNodeOfTypeLayout
|
|
130
|
+
if (isParentNodeOfTypeLayout) {
|
|
144
131
|
var LAYOUT_COL_DEPTH = 3;
|
|
145
132
|
hoistedPos = state.doc.resolve(from).before(LAYOUT_COL_DEPTH);
|
|
146
133
|
}
|
|
@@ -282,15 +269,9 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
282
269
|
var _api$core7;
|
|
283
270
|
api === null || api === void 0 || (_api$core7 = api.core) === null || _api$core7 === void 0 || _api$core7.actions.execute(function (_ref4) {
|
|
284
271
|
var tr = _ref4.tr;
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
});
|
|
289
|
-
} else {
|
|
290
|
-
api === null || api === void 0 || api.blockControls.commands.setMultiSelectPositions(expandedAnchor, expandedHead)({
|
|
291
|
-
tr: tr
|
|
292
|
-
});
|
|
293
|
-
}
|
|
272
|
+
api === null || api === void 0 || api.blockControls.commands.setMultiSelectPositions($newAnchor.pos, $newHead.pos)({
|
|
273
|
+
tr: tr
|
|
274
|
+
});
|
|
294
275
|
moveNode(api)(currentNodePos, moveToPos, INPUT_METHOD.SHORTCUT, formatMessage)({
|
|
295
276
|
tr: tr
|
|
296
277
|
});
|
|
@@ -312,15 +293,9 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
312
293
|
var _api$core9;
|
|
313
294
|
api === null || api === void 0 || (_api$core9 = api.core) === null || _api$core9 === void 0 || _api$core9.actions.execute(function (_ref6) {
|
|
314
295
|
var tr = _ref6.tr;
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
});
|
|
319
|
-
} else {
|
|
320
|
-
api === null || api === void 0 || api.blockControls.commands.setMultiSelectPositions(expandedAnchor, expandedHead)({
|
|
321
|
-
tr: tr
|
|
322
|
-
});
|
|
323
|
-
}
|
|
296
|
+
api === null || api === void 0 || api.blockControls.commands.setMultiSelectPositions($newAnchor.pos, $newHead.pos)({
|
|
297
|
+
tr: tr
|
|
298
|
+
});
|
|
324
299
|
tr.scrollIntoView();
|
|
325
300
|
return tr;
|
|
326
301
|
});
|
|
@@ -29,7 +29,7 @@ var getNodeSelector = function getNodeSelector(ignoreNodes, ignoreNodeDescendant
|
|
|
29
29
|
};
|
|
30
30
|
var getDefaultNodeSelector = memoizeOne(function () {
|
|
31
31
|
// we don't show handler for node nested in table
|
|
32
|
-
return getNodeSelector(_toConsumableArray(IGNORE_NODES_NEXT), [].concat(_toConsumableArray(IGNORE_NODE_DESCENDANTS_ADVANCED_LAYOUT), ['table']));
|
|
32
|
+
return getNodeSelector([].concat(_toConsumableArray(IGNORE_NODES_NEXT), ['media']), [].concat(_toConsumableArray(IGNORE_NODE_DESCENDANTS_ADVANCED_LAYOUT), ['table']));
|
|
33
33
|
});
|
|
34
34
|
export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
35
35
|
var _api$blockControls, _api$editorDisabled, _target$classList;
|
|
@@ -44,7 +44,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
44
44
|
editorDisabled = _ref2.editorDisabled;
|
|
45
45
|
|
|
46
46
|
// We shouldn't be firing mouse over transactions when the editor is disabled
|
|
47
|
-
if (editorDisabled && fg('
|
|
47
|
+
if (editorDisabled && fg('aifc_create_enabled')) {
|
|
48
48
|
return false;
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -57,24 +57,25 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
57
57
|
// Ignored via go/ees005
|
|
58
58
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
59
59
|
var target = event.target;
|
|
60
|
+
var isNativeAnchorSupported = expValEquals('platform_editor_native_anchor_support', 'isEnabled', true);
|
|
60
61
|
if (target !== null && target !== void 0 && (_target$classList = target.classList) !== null && _target$classList !== void 0 && _target$classList.contains('ProseMirror')) {
|
|
61
62
|
return false;
|
|
62
63
|
}
|
|
63
|
-
var rootElement = target === null || target === void 0 ? void 0 : target.closest(
|
|
64
|
+
var rootElement = target === null || target === void 0 ? void 0 : target.closest(isNativeAnchorSupported ? getDefaultNodeSelector() : "[data-drag-handler-anchor-name]");
|
|
64
65
|
if (rootElement) {
|
|
65
66
|
var _rootElement$parentEl;
|
|
66
67
|
// We want to exlude handles from showing for empty paragraph and heading nodes
|
|
67
68
|
if (isEmptyNestedParagraphOrHeading(rootElement)) {
|
|
68
69
|
return false;
|
|
69
70
|
}
|
|
70
|
-
if (rootElement.getAttribute(getTypeNameAttrName()) === 'media' && editorExperiment('advanced_layouts', true)) {
|
|
71
|
+
if (rootElement.getAttribute(getTypeNameAttrName()) === 'media' && editorExperiment('advanced_layouts', true) && !isNativeAnchorSupported) {
|
|
71
72
|
rootElement = rootElement.closest("[".concat(getAnchorAttrName(), "][").concat(getTypeNameAttrName(), "=\"mediaSingle\"]"));
|
|
72
73
|
if (!rootElement) {
|
|
73
74
|
return false;
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
var parentElement = (_rootElement$parentEl = rootElement.parentElement) === null || _rootElement$parentEl === void 0 ? void 0 : _rootElement$parentEl.closest("[".concat(getAnchorAttrName(), "]"));
|
|
77
|
-
var parentElementType =
|
|
78
|
+
var parentElementType = isNativeAnchorSupported ? getTypeNameFromDom(parentElement) : parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute('data-drag-handler-node-type');
|
|
78
79
|
if (editorExperiment('advanced_layouts', true)) {
|
|
79
80
|
// We want to exclude handles from showing for direct descendant of table nodes (i.e. nodes in cells)
|
|
80
81
|
if (parentElement && parentElementType === 'table') {
|
|
@@ -82,7 +83,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
82
83
|
} else if (parentElement && parentElementType === 'tableRow') {
|
|
83
84
|
var _parentElement$parent;
|
|
84
85
|
var grandparentElement = parentElement === null || parentElement === void 0 || (_parentElement$parent = parentElement.parentElement) === null || _parentElement$parent === void 0 ? void 0 : _parentElement$parent.closest("[".concat(getAnchorAttrName(), "]"));
|
|
85
|
-
var grandparentElementType =
|
|
86
|
+
var grandparentElementType = isNativeAnchorSupported ? getTypeNameFromDom(grandparentElement) : grandparentElement === null || grandparentElement === void 0 ? void 0 : grandparentElement.getAttribute('data-drag-handler-node-type');
|
|
86
87
|
if (grandparentElement && grandparentElementType === 'table') {
|
|
87
88
|
rootElement = grandparentElement;
|
|
88
89
|
}
|
|
@@ -149,11 +150,11 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
149
150
|
if (rootDOM instanceof HTMLElement) {
|
|
150
151
|
var _rootDOM$getAttribute;
|
|
151
152
|
rootAnchorName = (_rootDOM$getAttribute = rootDOM.getAttribute(getAnchorAttrName())) !== null && _rootDOM$getAttribute !== void 0 ? _rootDOM$getAttribute : undefined;
|
|
152
|
-
rootNodeType =
|
|
153
|
+
rootNodeType = isNativeAnchorSupported ? getTypeNameFromDom(rootDOM) : rootDOM.getAttribute('data-drag-handler-node-type');
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
|
-
var nodeType =
|
|
157
|
+
var nodeType = isNativeAnchorSupported ? getTypeNameFromDom(rootElement) : rootElement.getAttribute('data-drag-handler-node-type');
|
|
157
158
|
if (nodeType) {
|
|
158
159
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
159
160
|
var _api$core, _api$blockControls2;
|
|
@@ -2,7 +2,6 @@ import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
|
2
2
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
export var getInlineNodePos = function getInlineNodePos(tr, start, nodeSize) {
|
|
@@ -67,7 +66,7 @@ var oldGetSelection = function oldGetSelection(tr, start) {
|
|
|
67
66
|
// we need a quick way to make all child media nodes appear as selected without the need for a custom selection
|
|
68
67
|
nodeName === 'mediaGroup') {
|
|
69
68
|
return new NodeSelection($startPos);
|
|
70
|
-
} else if (nodeName === 'taskList'
|
|
69
|
+
} else if (nodeName === 'taskList') {
|
|
71
70
|
return TextSelection.create(tr.doc, start, start + nodeSize);
|
|
72
71
|
} else {
|
|
73
72
|
var _getInlineNodePos = getInlineNodePos(tr, start, nodeSize),
|
|
@@ -108,7 +107,7 @@ var newGetSelection = function newGetSelection(tr, start) {
|
|
|
108
107
|
var $mediaStartPos = tr.doc.resolve(start + 1);
|
|
109
108
|
return new NodeSelection($mediaStartPos);
|
|
110
109
|
}
|
|
111
|
-
if (nodeName === 'taskList' && !expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)
|
|
110
|
+
if (nodeName === 'taskList' && !expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
112
111
|
return TextSelection.create(tr.doc, start, start + nodeSize);
|
|
113
112
|
}
|
|
114
113
|
var _getInlineNodePos2 = getInlineNodePos(tr, start, nodeSize),
|
|
@@ -173,40 +172,22 @@ export var isHandleCorrelatedToSelection = function isHandleCorrelatedToSelectio
|
|
|
173
172
|
}
|
|
174
173
|
var nodeStart;
|
|
175
174
|
var $selectionFrom = selection.$from;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
nodeStart = $resolvedNodePos.before();
|
|
193
|
-
}
|
|
194
|
-
} else {
|
|
195
|
-
var selectionFrom = $selectionFrom.pos;
|
|
196
|
-
nodeStart = $selectionFrom.depth ? $selectionFrom.before() : selectionFrom;
|
|
197
|
-
var _$resolvedNodePos = state.doc.resolve(nodeStart);
|
|
198
|
-
if (['tableRow', 'tableCell', 'tableHeader'].includes(_$resolvedNodePos.node().type.name)) {
|
|
199
|
-
var _parentNodeFindRes = findParentNodeOfType(state.schema.nodes['table'])(selection);
|
|
200
|
-
var _tablePos = _parentNodeFindRes === null || _parentNodeFindRes === void 0 ? void 0 : _parentNodeFindRes.pos;
|
|
201
|
-
nodeStart = typeof _tablePos === 'undefined' ? nodeStart : _tablePos;
|
|
202
|
-
} else if (['listItem'].includes(_$resolvedNodePos.node().type.name)) {
|
|
203
|
-
nodeStart = _$resolvedNodePos.before(rootListDepth(_$resolvedNodePos));
|
|
204
|
-
} else if (['taskList'].includes(_$resolvedNodePos.node().type.name)) {
|
|
205
|
-
var _listdepth = rootTaskListDepth(_$resolvedNodePos);
|
|
206
|
-
nodeStart = _$resolvedNodePos.before(_listdepth);
|
|
207
|
-
} else if (['blockquote'].includes(_$resolvedNodePos.node().type.name)) {
|
|
208
|
-
nodeStart = _$resolvedNodePos.before();
|
|
209
|
-
}
|
|
175
|
+
nodeStart = $selectionFrom.before($selectionFrom.sharedDepth(selection.to) + 1);
|
|
176
|
+
if (nodeStart === $selectionFrom.pos) {
|
|
177
|
+
nodeStart = $selectionFrom.depth ? $selectionFrom.before() : $selectionFrom.pos;
|
|
178
|
+
}
|
|
179
|
+
var $resolvedNodePos = state.doc.resolve(nodeStart);
|
|
180
|
+
if (['tableRow', 'tableCell', 'tableHeader'].includes($resolvedNodePos.node().type.name)) {
|
|
181
|
+
var parentNodeFindRes = findParentNodeOfType(state.schema.nodes['table'])(selection);
|
|
182
|
+
var tablePos = parentNodeFindRes === null || parentNodeFindRes === void 0 ? void 0 : parentNodeFindRes.pos;
|
|
183
|
+
nodeStart = typeof tablePos === 'undefined' ? nodeStart : tablePos;
|
|
184
|
+
} else if (['listItem'].includes($resolvedNodePos.node().type.name)) {
|
|
185
|
+
nodeStart = $resolvedNodePos.before(rootListDepth($resolvedNodePos));
|
|
186
|
+
} else if (['taskList'].includes($resolvedNodePos.node().type.name)) {
|
|
187
|
+
var listdepth = rootTaskListDepth($resolvedNodePos);
|
|
188
|
+
nodeStart = $resolvedNodePos.before(listdepth);
|
|
189
|
+
} else if (['blockquote'].includes($resolvedNodePos.node().type.name)) {
|
|
190
|
+
nodeStart = $resolvedNodePos.before();
|
|
210
191
|
}
|
|
211
192
|
return Boolean(handlePos < selection.$to.pos && handlePos >= nodeStart);
|
|
212
193
|
};
|
|
@@ -163,7 +163,7 @@ export function canMoveSliceToIndex(slice, sliceFromPos, sliceToPos, destParent,
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
// Multiple layout columns do not drop correctly.
|
|
166
|
-
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type.name) === 'layoutColumn'
|
|
166
|
+
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type.name) === 'layoutColumn') {
|
|
167
167
|
return false;
|
|
168
168
|
}
|
|
169
169
|
for (var i = 0; i < slice.content.childCount; i++) {
|
|
@@ -22,7 +22,7 @@ import { tableControlsSpacing, DRAG_HANDLE_WIDTH } from '@atlaskit/editor-common
|
|
|
22
22
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
23
23
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
24
24
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
25
|
-
import { akEditorTableToolbarSize, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles/consts';
|
|
25
|
+
import { akEditorTableToolbarSize, akEditorFullPageNarrowBreakout, akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles/consts';
|
|
26
26
|
import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
|
|
27
27
|
import DragHandlerIcon from '@atlaskit/icon/glyph/drag-handler';
|
|
28
28
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -132,6 +132,16 @@ var dragHandleButtonStyles = css({
|
|
|
132
132
|
backgroundColor: "var(--ds-background-disabled, transparent)"
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
|
+
|
|
136
|
+
// Calculate scaled dimensions based on the base font size using CSS calc()
|
|
137
|
+
// Default font size is 16px, scale proportionally
|
|
138
|
+
// Standard: 16px -> 24h x 12w, Dense: 13px -> 18h x 9w
|
|
139
|
+
var dragHandleButtonDenseModeStyles = css({
|
|
140
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
141
|
+
height: "calc(".concat(DRAG_HANDLE_HEIGHT, "px * var(--ak-editor-base-font-size) / ").concat(akEditorFullPageDefaultFontSize, "px)"),
|
|
142
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
143
|
+
width: "calc(".concat(DRAG_HANDLE_WIDTH, "px * var(--ak-editor-base-font-size) / ").concat(akEditorFullPageDefaultFontSize, "px)")
|
|
144
|
+
});
|
|
135
145
|
var dragHandleButtonSmallScreenStyles = css(_defineProperty({}, "@container editor-area (max-width: ".concat(akEditorFullPageNarrowBreakout, "px)"), {
|
|
136
146
|
opacity: 0,
|
|
137
147
|
visibility: 'hidden'
|
|
@@ -535,9 +545,8 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
535
545
|
if (typeof handlePos !== 'number') {
|
|
536
546
|
return tr;
|
|
537
547
|
}
|
|
538
|
-
var oldHandlePosCheck = handlePos >= tr.selection.$from.start() - 1 && handlePos <= tr.selection.to;
|
|
539
548
|
var newHandlePosCheck = isHandleCorrelatedToSelection(view.state, tr.selection, handlePos);
|
|
540
|
-
if (!tr.selection.empty &&
|
|
549
|
+
if (!tr.selection.empty && newHandlePosCheck) {
|
|
541
550
|
var _api$blockControls7;
|
|
542
551
|
api === null || api === void 0 || (_api$blockControls7 = api.blockControls) === null || _api$blockControls7 === void 0 || _api$blockControls7.commands.setMultiSelectPositions()({
|
|
543
552
|
tr: tr
|
|
@@ -729,7 +738,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
729
738
|
var bottom = editorExperiment('platform_editor_controls', 'variant1') ? getControlBottomCSSValue(safeAnchorName, isSticky, isTopLevelNode, isLayoutColumn) : {};
|
|
730
739
|
return _objectSpread({
|
|
731
740
|
left: isEdgeCase ? "calc(anchor(".concat(safeAnchorName, " start) + ").concat(getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : editorExperiment('advanced_layouts', true) && isLayoutColumn ? "calc((anchor(".concat(safeAnchorName, " right) + anchor(").concat(safeAnchorName, " left))/2 - ").concat(DRAG_HANDLE_HEIGHT / 2, "px)") : "calc(anchor(".concat(safeAnchorName, " start) - ").concat(DRAG_HANDLE_WIDTH, "px - ").concat(dragHandleGap(nodeType, parentNodeType), "px)"),
|
|
732
|
-
top: editorExperiment('advanced_layouts', true) && isLayoutColumn ? "calc(anchor(".concat(safeAnchorName, " top) - ").concat(DRAG_HANDLE_WIDTH, "px)") : "calc(anchor(".concat(safeAnchorName, " start)
|
|
741
|
+
top: editorExperiment('advanced_layouts', true) && isLayoutColumn ? "calc(anchor(".concat(safeAnchorName, " top) - ").concat(DRAG_HANDLE_WIDTH, "px)") : "calc(anchor(".concat(safeAnchorName, " start)+ ").concat(topPositionAdjustment(expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? $pos && $pos.nodeAfter && getNodeTypeWithLevel($pos.nodeAfter) || nodeType : nodeType), "px)")
|
|
733
742
|
}, bottom);
|
|
734
743
|
}
|
|
735
744
|
var height = editorExperiment('platform_editor_controls', 'variant1') ? getControlHeightCSSValue(getNodeHeight(dom, safeAnchorName, anchorRectCache) || 0, isSticky, isTopLevelNode, "".concat(DRAG_HANDLE_HEIGHT), isLayoutColumn) : {};
|
|
@@ -954,7 +963,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
954
963
|
css: [editorExperiment('platform_editor_controls', 'variant1') ? dragHandleButtonStyles : dragHandleButtonStylesOld, editorExperiment('platform_editor_controls', 'variant1') && dragHandleColor,
|
|
955
964
|
// ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
|
|
956
965
|
// See https://product-fabric.atlassian.net/browse/ED-26266
|
|
957
|
-
browser.gecko && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && hasHadInteraction && selectedStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorExperiment('platform_editor_controls', 'control') && dragHandleButtonSmallScreenStyles, expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) && isFocused && keyboardFocusedDragHandleStyles, expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) ? focusedStyles : focusedStylesOld],
|
|
966
|
+
browser.gecko && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && hasHadInteraction && selectedStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorExperiment('platform_editor_controls', 'control') && dragHandleButtonSmallScreenStyles, expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) && isFocused && keyboardFocusedDragHandleStyles, expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) ? focusedStyles : focusedStylesOld, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && dragHandleButtonDenseModeStyles],
|
|
958
967
|
ref: buttonRef
|
|
959
968
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
960
969
|
,
|
|
@@ -94,7 +94,8 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
|
|
|
94
94
|
setIsDraggedOver = _useState2[1];
|
|
95
95
|
var anchorName = useMemo(function () {
|
|
96
96
|
if (expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
97
|
-
|
|
97
|
+
var _getPos;
|
|
98
|
+
return nextNode ? (api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(nextNode, (_getPos = getPos()) !== null && _getPos !== void 0 ? _getPos : -1)) || '' : '';
|
|
98
99
|
}
|
|
99
100
|
return nextNode ? getNodeAnchor(nextNode) : '';
|
|
100
101
|
}, [api, getPos, nextNode]);
|