@atlaskit/editor-plugin-block-controls 31.0.1 → 31.0.3
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 -1
- package/dist/cjs/pm-plugins/decorations-drag-handle.js +1 -4
- package/dist/cjs/pm-plugins/decorations-find-surrounding-nodes.js +2 -3
- package/dist/cjs/pm-plugins/decorations-quick-insert-button.js +1 -4
- package/dist/cjs/pm-plugins/handle-mouse-over.js +2 -2
- package/dist/cjs/pm-plugins/interaction-tracking/handle-mouse-move.js +2 -2
- package/dist/cjs/pm-plugins/interaction-tracking/pm-plugin.js +0 -2
- package/dist/cjs/pm-plugins/main.js +14 -17
- package/dist/cjs/ui/block-controls-surface-drag-handle.js +1 -2
- package/dist/cjs/ui/drag-handle.js +14 -2
- package/dist/cjs/ui/drop-target.js +3 -6
- package/dist/cjs/ui/quick-insert-button.js +17 -1
- package/dist/cjs/ui/visibility-container.js +0 -1
- package/dist/es2019/blockControlsPlugin.js +0 -1
- package/dist/es2019/pm-plugins/decorations-drag-handle.js +1 -4
- package/dist/es2019/pm-plugins/decorations-find-surrounding-nodes.js +2 -3
- package/dist/es2019/pm-plugins/decorations-quick-insert-button.js +1 -4
- package/dist/es2019/pm-plugins/handle-mouse-over.js +2 -2
- package/dist/es2019/pm-plugins/interaction-tracking/handle-mouse-move.js +2 -2
- package/dist/es2019/pm-plugins/interaction-tracking/pm-plugin.js +0 -2
- package/dist/es2019/pm-plugins/main.js +14 -17
- package/dist/es2019/ui/block-controls-surface-drag-handle.js +1 -2
- package/dist/es2019/ui/consts.js +3 -3
- package/dist/es2019/ui/drag-handle.js +14 -2
- package/dist/es2019/ui/drop-target.js +3 -6
- package/dist/es2019/ui/quick-insert-button.js +17 -1
- package/dist/es2019/ui/visibility-container.js +0 -1
- package/dist/esm/blockControlsPlugin.js +0 -1
- package/dist/esm/pm-plugins/decorations-drag-handle.js +1 -4
- package/dist/esm/pm-plugins/decorations-find-surrounding-nodes.js +2 -3
- package/dist/esm/pm-plugins/decorations-quick-insert-button.js +1 -4
- package/dist/esm/pm-plugins/handle-mouse-over.js +2 -2
- package/dist/esm/pm-plugins/interaction-tracking/handle-mouse-move.js +2 -2
- package/dist/esm/pm-plugins/interaction-tracking/pm-plugin.js +0 -2
- package/dist/esm/pm-plugins/main.js +14 -17
- package/dist/esm/ui/block-controls-surface-drag-handle.js +1 -2
- package/dist/esm/ui/consts.js +3 -3
- package/dist/esm/ui/drag-handle.js +14 -2
- package/dist/esm/ui/drop-target.js +3 -6
- package/dist/esm/ui/quick-insert-button.js +17 -1
- package/dist/esm/ui/visibility-container.js +0 -1
- package/package.json +3 -9
|
@@ -16,7 +16,6 @@ import { messages as blockControlsMessages } from '@atlaskit/editor-common/messa
|
|
|
16
16
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
17
17
|
import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
|
|
18
18
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
19
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
20
19
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
21
20
|
import { selectionPreservationPluginKey } from '../pm-plugins/selection-preservation/plugin-key';
|
|
22
21
|
import { prepareCollapsedHeadingSelection } from '../pm-plugins/utils/collapsed-heading';
|
|
@@ -265,7 +264,7 @@ export const BlockControlsSurfaceDragHandle = ({
|
|
|
265
264
|
,
|
|
266
265
|
onDrop: event => event.stopPropagation(),
|
|
267
266
|
"data-editor-block-ctrl-drag-handle": true,
|
|
268
|
-
"data-blocks-drag-handle":
|
|
267
|
+
"data-blocks-drag-handle": true,
|
|
269
268
|
"data-testid": "block-controls-surface-drag-handle",
|
|
270
269
|
className: ax([dragHandleStyles.root, browser.gecko && dragHandleStyles.firefoxSelection, isLayoutColumn && dragHandleStyles.layoutColumn, dragHandleSelected && interactionState !== 'hasNotHadInteraction' && dragHandleStyles.selected, (handleOptions === null || handleOptions === void 0 ? void 0 : handleOptions.isFocused) && dragHandleStyles.keyboardFocused, dragHandleStyles.scaled])
|
|
271
270
|
}, /*#__PURE__*/React.createElement("span", {
|
package/dist/es2019/ui/consts.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DRAG_HANDLE_WIDTH } from '@atlaskit/editor-common/styles/drag-handle';
|
|
2
|
-
import { breakoutResizableNodes
|
|
2
|
+
import { breakoutResizableNodes, getBreakoutResizableNodes } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles/constants';
|
|
4
4
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
5
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
@@ -56,7 +56,7 @@ export const dragHandleGap = (nodeType, parentNodeType) => {
|
|
|
56
56
|
if (isExperimentEnabled('platform_editor_lovability_resize_extensions')) {
|
|
57
57
|
breakoutResizableNodesList = getBreakoutResizableNodes();
|
|
58
58
|
} else {
|
|
59
|
-
breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [...
|
|
59
|
+
breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [...breakoutResizableNodes, 'rule', 'panel'] : breakoutResizableNodes;
|
|
60
60
|
}
|
|
61
61
|
if (breakoutResizableNodesList.includes(nodeType)) {
|
|
62
62
|
if (nodeType === 'layoutSection') {
|
|
@@ -80,7 +80,7 @@ export const rootElementGap = nodeType => {
|
|
|
80
80
|
if (isExperimentEnabled('platform_editor_lovability_resize_extensions')) {
|
|
81
81
|
breakoutResizableNodesList = getBreakoutResizableNodes();
|
|
82
82
|
} else {
|
|
83
|
-
breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [...
|
|
83
|
+
breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [...breakoutResizableNodes, 'rule', 'panel'] : breakoutResizableNodes;
|
|
84
84
|
}
|
|
85
85
|
if (nodeTypeExcludeList.includes(nodeType) || breakoutResizableNodesList.includes(nodeType)) {
|
|
86
86
|
if (nodeType === 'layoutSection') {
|
|
@@ -206,6 +206,18 @@ const tooltipContainerStyles = css({
|
|
|
206
206
|
display: 'block',
|
|
207
207
|
zIndex: 100 // card = 100
|
|
208
208
|
});
|
|
209
|
+
const tooltipContainerStylesStickyHeaderWithMask = css({
|
|
210
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
211
|
+
top: `${STICKY_CONTROLS_TOP_MARGIN}px`,
|
|
212
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
213
|
+
'[data-blocks-drag-handle-container]:has(+ [data-prosemirror-node-name="table"] .pm-table-with-controls tr.sticky) &': {
|
|
214
|
+
top: '0'
|
|
215
|
+
},
|
|
216
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
217
|
+
'[data-prosemirror-mark-name="breakout"]:has([data-blocks-drag-handle-container]):has(+ [data-prosemirror-node-name="table"] .pm-table-with-controls tr.sticky) &': {
|
|
218
|
+
top: '0'
|
|
219
|
+
}
|
|
220
|
+
});
|
|
209
221
|
const tooltipContainerStylesImprovedStickyHeaderWithMask = css({
|
|
210
222
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
211
223
|
top: `${STICKY_CONTROLS_TOP_MARGIN}px`,
|
|
@@ -1013,7 +1025,7 @@ export const DragHandle = ({
|
|
|
1013
1025
|
,
|
|
1014
1026
|
onDrop: handleOnDrop,
|
|
1015
1027
|
"data-editor-block-ctrl-drag-handle": true,
|
|
1016
|
-
"data-blocks-drag-handle":
|
|
1028
|
+
"data-blocks-drag-handle": true,
|
|
1017
1029
|
"data-testid": "block-ctrl-drag-handle",
|
|
1018
1030
|
"aria-label": dragHandleAriaLabel,
|
|
1019
1031
|
onBlur: () => {
|
|
@@ -1058,7 +1070,7 @@ export const DragHandle = ({
|
|
|
1058
1070
|
as: "span",
|
|
1059
1071
|
testId: "block-ctrl-drag-handle-container"
|
|
1060
1072
|
}, jsx("span", {
|
|
1061
|
-
css: [tooltipContainerStyles, shouldMaskNodeControls(nodeType, isTopLevelNodeValue) && tooltipContainerStylesImprovedStickyHeaderWithMask, !shouldMaskNodeControls(nodeType, isTopLevelNodeValue) && tooltipContainerStylesStickyHeaderWithoutMask]
|
|
1073
|
+
css: [tooltipContainerStyles, shouldMaskNodeControls(nodeType, isTopLevelNodeValue) && (expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') ? tooltipContainerStylesImprovedStickyHeaderWithMask : tooltipContainerStylesStickyHeaderWithMask), !shouldMaskNodeControls(nodeType, isTopLevelNodeValue) && tooltipContainerStylesStickyHeaderWithoutMask]
|
|
1062
1074
|
}, jsx(Tooltip, {
|
|
1063
1075
|
content: tooltipContent,
|
|
1064
1076
|
ignoreTooltipPointerEvents: true,
|
|
@@ -61,10 +61,7 @@ const nestedDropZoneStyle = css({
|
|
|
61
61
|
right: '4px',
|
|
62
62
|
width: 'unset'
|
|
63
63
|
});
|
|
64
|
-
const
|
|
65
|
-
const getEnableDropZone = () => {
|
|
66
|
-
return enableDropZoneNext;
|
|
67
|
-
};
|
|
64
|
+
const ENABLE_DROP_ZONE = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard', 'syncBlock'];
|
|
68
65
|
|
|
69
66
|
// This z index is used in container like layout
|
|
70
67
|
const fullHeightStyleAdjustZIndexStyle = css({
|
|
@@ -116,7 +113,7 @@ const HoverZone = ({
|
|
|
116
113
|
const hoverZoneUpperStyle = useMemo(() => {
|
|
117
114
|
const heightStyleOffset = `var(--editor-block-controls-drop-indicator-gap, 0)/2`;
|
|
118
115
|
const transformOffset = `var(${EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET}, 0)`;
|
|
119
|
-
const heightStyle = anchorName &&
|
|
116
|
+
const heightStyle = anchorName && ENABLE_DROP_ZONE.includes((node === null || node === void 0 ? void 0 : node.type.name) || '') ? isAnchorSupported() ? `calc(anchor-size(${anchorName} height)/2 + ${heightStyleOffset})` : `calc(${((anchorRectCache === null || anchorRectCache === void 0 ? void 0 : anchorRectCache.getHeight(anchorName)) || 0) / 2}px + ${heightStyleOffset})` : '4px';
|
|
120
117
|
const transform = position === 'upper' ? `translateY(calc(-100% + ${transformOffset}))` : `translateY(${transformOffset})`;
|
|
121
118
|
return css({
|
|
122
119
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
@@ -141,7 +138,7 @@ const HoverZone = ({
|
|
|
141
138
|
const anchorName = node ? expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) || isExperimentEnabled('platform_editor_block_control_migration') ? (api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(node, pos || -1)) || '' : getNodeAnchor(node) : '';
|
|
142
139
|
let top = 'unset';
|
|
143
140
|
if (anchorName) {
|
|
144
|
-
const enabledDropZone =
|
|
141
|
+
const enabledDropZone = ENABLE_DROP_ZONE.includes((node === null || node === void 0 ? void 0 : node.type.name) || '');
|
|
145
142
|
if (isAnchorSupported()) {
|
|
146
143
|
top = enabledDropZone ? `calc(anchor(${anchorName} 50%))` : `calc(anchor(${anchorName} bottom) - 4px)`;
|
|
147
144
|
} else if (anchorRectCache) {
|
|
@@ -80,6 +80,13 @@ const tooltipContainerStyles = css({
|
|
|
80
80
|
display: 'block',
|
|
81
81
|
zIndex: 'card'
|
|
82
82
|
});
|
|
83
|
+
const tooltipContainerStylesStickyHeader = css({
|
|
84
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
85
|
+
'[data-blocks-quick-insert-container]:has(~ [data-prosemirror-node-name="table"] .pm-table-with-controls tr.sticky) &': {
|
|
86
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
87
|
+
top: tableControlsSpacing
|
|
88
|
+
}
|
|
89
|
+
});
|
|
83
90
|
const tooltipContainerImprovedStylesStickyHeader = css({
|
|
84
91
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
85
92
|
'[data-blocks-quick-insert-container]:has(~ [data-prosemirror-node-name="table"] .pm-table-with-controls tr.sticky) &': {
|
|
@@ -103,6 +110,15 @@ const tooltipContainerImprovedStylesStickyHeader = css({
|
|
|
103
110
|
}
|
|
104
111
|
});
|
|
105
112
|
|
|
113
|
+
// We need this to work around adjacent breakout marks wrapping the controls widget decorations
|
|
114
|
+
const tooltipContainerStylesStickyHeaderWithMarksFix = css({
|
|
115
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
116
|
+
'[data-prosemirror-mark-name="breakout"]:has([data-blocks-quick-insert-container]):has(~ [data-prosemirror-node-name="table"] .pm-table-with-controls tr.sticky) &': {
|
|
117
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
118
|
+
top: tableControlsSpacing
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
106
122
|
// We need this to work around adjacent breakout marks wrapping the controls widget decorations
|
|
107
123
|
const tooltipContainerStylesImprovedStickyHeaderWithMarksFix = css({
|
|
108
124
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
@@ -376,7 +392,7 @@ export const TypeAheadControl = ({
|
|
|
376
392
|
,
|
|
377
393
|
xcss: [containerStaticStyles]
|
|
378
394
|
}, jsx("span", {
|
|
379
|
-
css: [tooltipContainerStyles, tooltipContainerImprovedStylesStickyHeader, tooltipContainerStylesImprovedStickyHeaderWithMarksFix]
|
|
395
|
+
css: [tooltipContainerStyles, expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') ? tooltipContainerImprovedStylesStickyHeader : tooltipContainerStylesStickyHeader, expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') ? tooltipContainerStylesImprovedStickyHeaderWithMarksFix : tooltipContainerStylesStickyHeaderWithMarksFix]
|
|
380
396
|
}, tooltipPressable()));
|
|
381
397
|
};
|
|
382
398
|
export const QuickInsertWithVisibility = ({
|
|
@@ -81,7 +81,6 @@ export const useBlockControlsVisibility = ({
|
|
|
81
81
|
};
|
|
82
82
|
});
|
|
83
83
|
const isViewMode = editorViewMode === 'view';
|
|
84
|
-
// rightSideControlsEnabled is the single source of truth (confluence_remix_button_right_side_block_fg from preset)
|
|
85
84
|
// Both controls are restricted by side: the drag handle shows on the left half, the Remix button on
|
|
86
85
|
// the right half (and the right margin), matching the midpoint split in handle-mouse-move.
|
|
87
86
|
const shouldRestrictBySide = rightSideControlsEnabled && controlSide !== undefined && !isViewMode;
|
|
@@ -485,7 +485,6 @@ export var blockControlsPlugin = function blockControlsPlugin(_ref) {
|
|
|
485
485
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
486
486
|
var _interactionTrackingP2, _interactionTrackingP3, _interactionTrackingP4;
|
|
487
487
|
sharedState.isMouseOut = (_interactionTrackingP2 = (_interactionTrackingP3 = interactionTrackingPluginKey.getState(editorState)) === null || _interactionTrackingP3 === void 0 ? void 0 : _interactionTrackingP3.isMouseOut) !== null && _interactionTrackingP2 !== void 0 ? _interactionTrackingP2 : false;
|
|
488
|
-
// rightSideControlsEnabled is the single source of truth (confluence_remix_button_right_side_block_fg from preset)
|
|
489
488
|
sharedState.rightSideControlsEnabled = rightSideControlsEnabled;
|
|
490
489
|
sharedState.hoverSide = rightSideControlsEnabled ? (_interactionTrackingP4 = interactionTrackingPluginKey.getState(editorState)) === null || _interactionTrackingP4 === void 0 ? void 0 : _interactionTrackingP4.hoverSide : undefined;
|
|
491
490
|
}
|
|
@@ -6,7 +6,6 @@ import { createElement } from 'react';
|
|
|
6
6
|
import { v4 as uuid } from 'uuid';
|
|
7
7
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
11
10
|
import { ACTIVE_DRAG_HANDLE_ATTR } from '../ui/consts';
|
|
12
11
|
import { DragHandle, DragHandleWithVisibility } from '../ui/drag-handle';
|
|
@@ -88,9 +87,7 @@ export var dragHandleDecoration = function dragHandleDecoration(_ref) {
|
|
|
88
87
|
var element = document.createElement('span');
|
|
89
88
|
// inline decoration causes focus issues when refocusing Editor into first line
|
|
90
89
|
element.style.display = 'block';
|
|
91
|
-
|
|
92
|
-
element.setAttribute('data-blocks-decorator-widget', 'true');
|
|
93
|
-
}
|
|
90
|
+
element.setAttribute('data-blocks-decorator-widget', 'true');
|
|
94
91
|
element.setAttribute('data-testid', 'block-ctrl-decorator-widget');
|
|
95
92
|
element.setAttribute('data-blocks-drag-handle-container', 'true');
|
|
96
93
|
element.setAttribute('data-blocks-drag-handle-key', key);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var IGNORE_NODES = ['tableRow', 'listItem', 'caption', 'media'];
|
|
2
|
-
var
|
|
2
|
+
var BLOCK_LEAF_NODES = ['blockCard', 'rule', 'extension', 'syncBlock'];
|
|
3
3
|
var DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -13,10 +13,9 @@ var DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
|
|
|
13
13
|
*/
|
|
14
14
|
var _findSurroundingNodes = function findSurroundingNodes(state, $pos, nodeType) {
|
|
15
15
|
var depth = $pos.depth;
|
|
16
|
-
var blockLeafNodeList = blockLeafNodeNext;
|
|
17
16
|
|
|
18
17
|
// special cases like hr rule here
|
|
19
|
-
if (
|
|
18
|
+
if (BLOCK_LEAF_NODES.includes(nodeType || '') || $pos.pos === 0) {
|
|
20
19
|
var _parent = $pos.node(depth);
|
|
21
20
|
var _node = $pos.nodeAfter;
|
|
22
21
|
var _index = $pos.index();
|
|
@@ -3,7 +3,6 @@ import { createElement } from 'react';
|
|
|
3
3
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
4
|
import { v4 as uuid } from 'uuid';
|
|
5
5
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
6
|
import { ACTIVE_QUICK_INSERT_ATTR } from '../ui/consts';
|
|
8
7
|
import { QuickInsertWithVisibility } from '../ui/quick-insert-button';
|
|
9
8
|
import { getMatchingBlockMarks } from './utils/marks';
|
|
@@ -69,9 +68,7 @@ export var quickInsertButtonDecoration = function quickInsertButtonDecoration(_r
|
|
|
69
68
|
element.style.clear = 'unset';
|
|
70
69
|
element.contentEditable = 'false';
|
|
71
70
|
element.setAttribute('data-blocks-quick-insert-container', 'true');
|
|
72
|
-
|
|
73
|
-
element.setAttribute('data-blocks-quick-insert-button', 'true');
|
|
74
|
-
}
|
|
71
|
+
element.setAttribute('data-blocks-quick-insert-button', 'true');
|
|
75
72
|
element.setAttribute('data-testid', 'block-ctrl-quick-insert-button');
|
|
76
73
|
nodeViewPortalProviderAPI.render(function () {
|
|
77
74
|
return /*#__PURE__*/createElement(QuickInsertWithVisibility, {
|
|
@@ -115,7 +115,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
115
115
|
// We shouldn't be firing mouse over transactions when the editor is disabled,
|
|
116
116
|
// except in view mode when right-side controls are enabled (show controls on block hover)
|
|
117
117
|
var rightSideControlsEnabled = (_api$blockControls$sh = api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.sharedState.currentState()) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.rightSideControlsEnabled) !== null && _api$blockControls$sh !== void 0 ? _api$blockControls$sh : false;
|
|
118
|
-
if (editorDisabled && (!isViewMode || !
|
|
118
|
+
if (editorDisabled && (!isViewMode || !rightSideControlsEnabled)) {
|
|
119
119
|
return false;
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -154,7 +154,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
154
154
|
|
|
155
155
|
// When hovering over the right-edge button (rendered in a portal outside the block), resolve the
|
|
156
156
|
// block from the container's anchor so activeNode stays set and the button remains visible.
|
|
157
|
-
if (!rootElement && rightSideControlsEnabled
|
|
157
|
+
if (!rootElement && rightSideControlsEnabled) {
|
|
158
158
|
var rightEdgeContainer = target === null || target === void 0 ? void 0 : target.closest('[data-blocks-right-edge-button-container]');
|
|
159
159
|
if (rightEdgeContainer) {
|
|
160
160
|
var anchor = rightEdgeContainer.getAttribute('data-blocks-right-edge-button-anchor');
|
|
@@ -92,7 +92,7 @@ var classifyRightMarginPosition = function classifyRightMarginPosition(view, eve
|
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* Process hover position and set left/right side. Only invoked when right-side controls are
|
|
95
|
-
* enabled
|
|
95
|
+
* enabled; handleMouseMove returns early otherwise.
|
|
96
96
|
*/
|
|
97
97
|
var processHoverSide = function processHoverSide(view, api) {
|
|
98
98
|
var _api$userIntent, _api$showDiff$sharedS, _api$showDiff;
|
|
@@ -195,7 +195,7 @@ export var handleMouseMove = function handleMouseMove(view, event, rightSideCont
|
|
|
195
195
|
stopEditing(view);
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
// Only track hover side when right-side controls are enabled
|
|
198
|
+
// Only track hover side when right-side controls are enabled.
|
|
199
199
|
if (!rightSideControlsEnabled) {
|
|
200
200
|
return false;
|
|
201
201
|
}
|
|
@@ -112,8 +112,6 @@ export var createInteractionTrackingPlugin = function createInteractionTrackingP
|
|
|
112
112
|
},
|
|
113
113
|
view: editorExperiment('platform_editor_controls', 'variant1') ? function (view) {
|
|
114
114
|
var editorContentArea = view.dom.closest('.ak-editor-content-area');
|
|
115
|
-
// rightSideControlsEnabled is the single source of truth (confluence_remix_button_right_side_block_fg from preset)
|
|
116
|
-
|
|
117
115
|
var unbindMouseEnter;
|
|
118
116
|
var unbindMouseLeave;
|
|
119
117
|
var unbindDocumentMouseMove;
|
|
@@ -184,19 +184,19 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
184
184
|
var activeNode = currentState.activeNode,
|
|
185
185
|
decorations = currentState.decorations,
|
|
186
186
|
isResizerResizing = currentState.isResizerResizing,
|
|
187
|
-
multiSelectDnD = currentState.multiSelectDnD
|
|
187
|
+
multiSelectDnD = currentState.multiSelectDnD,
|
|
188
|
+
isMenuOpen = currentState.isMenuOpen,
|
|
189
|
+
isSelectedViaDragHandle = currentState.isSelectedViaDragHandle;
|
|
188
190
|
var surfaceNodePositions = currentState.surfaceNodePositions;
|
|
189
191
|
var editorHeight = currentState.editorHeight,
|
|
190
192
|
editorWidthLeft = currentState.editorWidthLeft,
|
|
191
193
|
editorWidthRight = currentState.editorWidthRight,
|
|
192
194
|
isDragging = currentState.isDragging,
|
|
193
|
-
isMenuOpen = currentState.isMenuOpen,
|
|
194
195
|
menuTriggerBy = currentState.menuTriggerBy,
|
|
195
196
|
menuTriggerByNode = currentState.menuTriggerByNode,
|
|
196
197
|
blockMenuOptions = currentState.blockMenuOptions,
|
|
197
198
|
isPMDragging = currentState.isPMDragging,
|
|
198
|
-
lastDragCancelled = currentState.lastDragCancelled
|
|
199
|
-
isSelectedViaDragHandle = currentState.isSelectedViaDragHandle;
|
|
199
|
+
lastDragCancelled = currentState.lastDragCancelled;
|
|
200
200
|
var isActiveNodeDeleted = false;
|
|
201
201
|
var _getTrMetadata = getTrMetadata(tr, flags),
|
|
202
202
|
from = _getTrMetadata.from,
|
|
@@ -516,7 +516,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
516
516
|
} finally {
|
|
517
517
|
_iterator.f();
|
|
518
518
|
}
|
|
519
|
-
if (rightSideControlsEnabled && isViewMode
|
|
519
|
+
if (rightSideControlsEnabled && isViewMode) {
|
|
520
520
|
var _iterator2 = _createForOfIteratorHelper(nodeDecorationRegistry),
|
|
521
521
|
_step2;
|
|
522
522
|
try {
|
|
@@ -772,7 +772,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
772
772
|
} finally {
|
|
773
773
|
_iterator5.f();
|
|
774
774
|
}
|
|
775
|
-
} else if (isViewMode && rightSideControlsEnabled
|
|
775
|
+
} else if (isViewMode && rightSideControlsEnabled) {
|
|
776
776
|
// Remove view-mode right-side decorations when no active node
|
|
777
777
|
var _iterator6 = _createForOfIteratorHelper(nodeDecorationRegistry),
|
|
778
778
|
_step6;
|
|
@@ -856,7 +856,6 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
856
856
|
var _latestActiveNode13, _latestActiveNode14;
|
|
857
857
|
newActiveNode = isEmptyDoc || !(meta !== null && meta !== void 0 && meta.activeNode) && !isExperimentEnabled('platform_editor_block_control_migration') && findHandleDec(decorations, (_latestActiveNode13 = latestActiveNode) === null || _latestActiveNode13 === void 0 ? void 0 : _latestActiveNode13.pos, (_latestActiveNode14 = latestActiveNode) === null || _latestActiveNode14 === void 0 ? void 0 : _latestActiveNode14.pos).length === 0 ? null : latestActiveNode;
|
|
858
858
|
}
|
|
859
|
-
var isMenuOpenNew = isMenuOpen;
|
|
860
859
|
var nextMenuTriggerByNode = (meta === null || meta === void 0 || (_meta$toggleMenu = meta.toggleMenu) === null || _meta$toggleMenu === void 0 ? void 0 : _meta$toggleMenu.triggerByNode) || menuTriggerByNode;
|
|
861
860
|
if (isExperimentEnabled('platform_editor_block_control_migration') && tr.docChanged && menuTriggerByNode && !(meta !== null && meta !== void 0 && meta.toggleMenu)) {
|
|
862
861
|
var _menuTriggerByNode$ro, _newState$doc$nodeAt4;
|
|
@@ -864,7 +863,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
864
863
|
var mappedRoot = tr.mapping.mapResult((_menuTriggerByNode$ro = menuTriggerByNode.rootPos) !== null && _menuTriggerByNode$ro !== void 0 ? _menuTriggerByNode$ro : menuTriggerByNode.pos, 1);
|
|
865
864
|
if (mapped.deleted || mappedRoot.deleted || !((_newState$doc$nodeAt4 = newState.doc.nodeAt(mapped.pos)) !== null && _newState$doc$nodeAt4 !== void 0 && _newState$doc$nodeAt4.isBlock)) {
|
|
866
865
|
nextMenuTriggerByNode = undefined;
|
|
867
|
-
|
|
866
|
+
isMenuOpen = false;
|
|
868
867
|
} else {
|
|
869
868
|
nextMenuTriggerByNode = _objectSpread(_objectSpread({}, menuTriggerByNode), {}, {
|
|
870
869
|
pos: mapped.pos,
|
|
@@ -873,16 +872,15 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
873
872
|
}
|
|
874
873
|
}
|
|
875
874
|
if (meta !== null && meta !== void 0 && meta.closeMenu) {
|
|
876
|
-
|
|
875
|
+
isMenuOpen = false;
|
|
877
876
|
} else if (meta !== null && meta !== void 0 && meta.toggleMenu) {
|
|
878
877
|
var isSameAnchor = (meta === null || meta === void 0 ? void 0 : meta.toggleMenu.anchorName) === menuTriggerBy;
|
|
879
|
-
|
|
878
|
+
isMenuOpen = menuTriggerBy === undefined || isSameAnchor || !isMenuOpen && !isSameAnchor ? !isMenuOpen : isMenuOpen;
|
|
880
879
|
}
|
|
881
|
-
var isSelectedViaDragHandleNew;
|
|
882
880
|
if (flags.toolbarFlagsEnabled) {
|
|
883
|
-
|
|
881
|
+
isSelectedViaDragHandle = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined ? meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle : isSelectedViaDragHandle;
|
|
884
882
|
} else {
|
|
885
|
-
|
|
883
|
+
isSelectedViaDragHandle = (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle) !== undefined && flags.toolbarFlagsEnabled && (meta === null || meta === void 0 ? void 0 : meta.isSelectedViaDragHandle);
|
|
886
884
|
}
|
|
887
885
|
return {
|
|
888
886
|
decorations: decorations,
|
|
@@ -890,7 +888,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
890
888
|
activeNode: newActiveNode,
|
|
891
889
|
activeDropTargetNode: currentActiveDropTargetNode,
|
|
892
890
|
isDragging: (_meta$isDragging3 = meta === null || meta === void 0 ? void 0 : meta.isDragging) !== null && _meta$isDragging3 !== void 0 ? _meta$isDragging3 : isDragging,
|
|
893
|
-
isMenuOpen:
|
|
891
|
+
isMenuOpen: isMenuOpen,
|
|
894
892
|
menuTriggerBy: (meta === null || meta === void 0 || (_meta$toggleMenu2 = meta.toggleMenu) === null || _meta$toggleMenu2 === void 0 ? void 0 : _meta$toggleMenu2.anchorName) || menuTriggerBy,
|
|
895
893
|
menuTriggerByNode: nextMenuTriggerByNode,
|
|
896
894
|
blockMenuOptions: {
|
|
@@ -906,7 +904,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
906
904
|
isPMDragging: (_meta$isPMDragging = meta === null || meta === void 0 ? void 0 : meta.isPMDragging) !== null && _meta$isPMDragging !== void 0 ? _meta$isPMDragging : isPMDragging,
|
|
907
905
|
multiSelectDnD: multiSelectDnD,
|
|
908
906
|
lastDragCancelled: (_meta$lastDragCancell = meta === null || meta === void 0 ? void 0 : meta.lastDragCancelled) !== null && _meta$lastDragCancell !== void 0 ? _meta$lastDragCancell : lastDragCancelled,
|
|
909
|
-
isSelectedViaDragHandle:
|
|
907
|
+
isSelectedViaDragHandle: isSelectedViaDragHandle
|
|
910
908
|
};
|
|
911
909
|
};
|
|
912
910
|
export { _apply as apply };
|
|
@@ -982,9 +980,8 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
|
|
|
982
980
|
var isDisabled = api === null || api === void 0 || (_api$editorDisabled = api.editorDisabled) === null || _api$editorDisabled === void 0 || (_api$editorDisabled = _api$editorDisabled.sharedState.currentState()) === null || _api$editorDisabled === void 0 ? void 0 : _api$editorDisabled.editorDisabled;
|
|
983
981
|
if (isDisabled) {
|
|
984
982
|
var _api$editorViewMode2;
|
|
985
|
-
var remixRightSideEnabled = rightSideControlsEnabled && fg('confluence_remix_button_right_side_block_fg');
|
|
986
983
|
// Hide decorations when disabled, except in view mode when right-side controls are enabled
|
|
987
|
-
if (!
|
|
984
|
+
if (!rightSideControlsEnabled || (api === null || api === void 0 || (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 || (_api$editorViewMode2 = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2 === void 0 ? void 0 : _api$editorViewMode2.mode) !== 'view') {
|
|
988
985
|
return;
|
|
989
986
|
}
|
|
990
987
|
}
|
|
@@ -17,7 +17,6 @@ import { messages as blockControlsMessages } from '@atlaskit/editor-common/messa
|
|
|
17
17
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
18
18
|
import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
|
|
19
19
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
20
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
21
20
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
22
21
|
import { selectionPreservationPluginKey } from '../pm-plugins/selection-preservation/plugin-key';
|
|
23
22
|
import { prepareCollapsedHeadingSelection } from '../pm-plugins/utils/collapsed-heading';
|
|
@@ -273,7 +272,7 @@ export var BlockControlsSurfaceDragHandle = function BlockControlsSurfaceDragHan
|
|
|
273
272
|
return event.stopPropagation();
|
|
274
273
|
},
|
|
275
274
|
"data-editor-block-ctrl-drag-handle": true,
|
|
276
|
-
"data-blocks-drag-handle":
|
|
275
|
+
"data-blocks-drag-handle": true,
|
|
277
276
|
"data-testid": "block-controls-surface-drag-handle",
|
|
278
277
|
className: ax([dragHandleStyles.root, browser.gecko && dragHandleStyles.firefoxSelection, isLayoutColumn && dragHandleStyles.layoutColumn, dragHandleSelected && interactionState !== 'hasNotHadInteraction' && dragHandleStyles.selected, (handleOptions === null || handleOptions === void 0 ? void 0 : handleOptions.isFocused) && dragHandleStyles.keyboardFocused, dragHandleStyles.scaled])
|
|
279
278
|
}, /*#__PURE__*/React.createElement("span", {
|
package/dist/esm/ui/consts.js
CHANGED
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
var _dropTargetMarginMap;
|
|
4
4
|
import { DRAG_HANDLE_WIDTH } from '@atlaskit/editor-common/styles/drag-handle';
|
|
5
|
-
import { breakoutResizableNodes
|
|
5
|
+
import { breakoutResizableNodes, getBreakoutResizableNodes } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles/constants';
|
|
7
7
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
8
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
@@ -61,7 +61,7 @@ export var dragHandleGap = function dragHandleGap(nodeType, parentNodeType) {
|
|
|
61
61
|
if (isExperimentEnabled('platform_editor_lovability_resize_extensions')) {
|
|
62
62
|
breakoutResizableNodesList = getBreakoutResizableNodes();
|
|
63
63
|
} else {
|
|
64
|
-
breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(_toConsumableArray(
|
|
64
|
+
breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(_toConsumableArray(breakoutResizableNodes), ['rule', 'panel']) : breakoutResizableNodes;
|
|
65
65
|
}
|
|
66
66
|
if (breakoutResizableNodesList.includes(nodeType)) {
|
|
67
67
|
if (nodeType === 'layoutSection') {
|
|
@@ -85,7 +85,7 @@ export var rootElementGap = function rootElementGap(nodeType) {
|
|
|
85
85
|
if (isExperimentEnabled('platform_editor_lovability_resize_extensions')) {
|
|
86
86
|
breakoutResizableNodesList = getBreakoutResizableNodes();
|
|
87
87
|
} else {
|
|
88
|
-
breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(_toConsumableArray(
|
|
88
|
+
breakoutResizableNodesList = expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) ? [].concat(_toConsumableArray(breakoutResizableNodes), ['rule', 'panel']) : breakoutResizableNodes;
|
|
89
89
|
}
|
|
90
90
|
if (nodeTypeExcludeList.includes(nodeType) || breakoutResizableNodesList.includes(nodeType)) {
|
|
91
91
|
if (nodeType === 'layoutSection') {
|
|
@@ -208,6 +208,18 @@ var tooltipContainerStyles = css({
|
|
|
208
208
|
display: 'block',
|
|
209
209
|
zIndex: 100 // card = 100
|
|
210
210
|
});
|
|
211
|
+
var tooltipContainerStylesStickyHeaderWithMask = css({
|
|
212
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
213
|
+
top: "".concat(STICKY_CONTROLS_TOP_MARGIN, "px"),
|
|
214
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
215
|
+
'[data-blocks-drag-handle-container]:has(+ [data-prosemirror-node-name="table"] .pm-table-with-controls tr.sticky) &': {
|
|
216
|
+
top: '0'
|
|
217
|
+
},
|
|
218
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
219
|
+
'[data-prosemirror-mark-name="breakout"]:has([data-blocks-drag-handle-container]):has(+ [data-prosemirror-node-name="table"] .pm-table-with-controls tr.sticky) &': {
|
|
220
|
+
top: '0'
|
|
221
|
+
}
|
|
222
|
+
});
|
|
211
223
|
var tooltipContainerStylesImprovedStickyHeaderWithMask = css({
|
|
212
224
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
213
225
|
top: "".concat(STICKY_CONTROLS_TOP_MARGIN, "px"),
|
|
@@ -1025,7 +1037,7 @@ export var DragHandle = function DragHandle(_ref2) {
|
|
|
1025
1037
|
,
|
|
1026
1038
|
onDrop: handleOnDrop,
|
|
1027
1039
|
"data-editor-block-ctrl-drag-handle": true,
|
|
1028
|
-
"data-blocks-drag-handle":
|
|
1040
|
+
"data-blocks-drag-handle": true,
|
|
1029
1041
|
"data-testid": "block-ctrl-drag-handle",
|
|
1030
1042
|
"aria-label": dragHandleAriaLabel,
|
|
1031
1043
|
onBlur: function onBlur() {
|
|
@@ -1072,7 +1084,7 @@ export var DragHandle = function DragHandle(_ref2) {
|
|
|
1072
1084
|
as: "span",
|
|
1073
1085
|
testId: "block-ctrl-drag-handle-container"
|
|
1074
1086
|
}, jsx("span", {
|
|
1075
|
-
css: [tooltipContainerStyles, shouldMaskNodeControls(nodeType, isTopLevelNodeValue) && tooltipContainerStylesImprovedStickyHeaderWithMask, !shouldMaskNodeControls(nodeType, isTopLevelNodeValue) && tooltipContainerStylesStickyHeaderWithoutMask]
|
|
1087
|
+
css: [tooltipContainerStyles, shouldMaskNodeControls(nodeType, isTopLevelNodeValue) && (expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') ? tooltipContainerStylesImprovedStickyHeaderWithMask : tooltipContainerStylesStickyHeaderWithMask), !shouldMaskNodeControls(nodeType, isTopLevelNodeValue) && tooltipContainerStylesStickyHeaderWithoutMask]
|
|
1076
1088
|
}, jsx(Tooltip, {
|
|
1077
1089
|
content: tooltipContent,
|
|
1078
1090
|
ignoreTooltipPointerEvents: true,
|
|
@@ -63,10 +63,7 @@ var nestedDropZoneStyle = css({
|
|
|
63
63
|
right: '4px',
|
|
64
64
|
width: 'unset'
|
|
65
65
|
});
|
|
66
|
-
var
|
|
67
|
-
var getEnableDropZone = function getEnableDropZone() {
|
|
68
|
-
return enableDropZoneNext;
|
|
69
|
-
};
|
|
66
|
+
var ENABLE_DROP_ZONE = ['paragraph', 'mediaSingle', 'heading', 'codeBlock', 'decisionList', 'bulletList', 'orderedList', 'taskList', 'extension', 'blockCard', 'syncBlock'];
|
|
70
67
|
|
|
71
68
|
// This z index is used in container like layout
|
|
72
69
|
var fullHeightStyleAdjustZIndexStyle = css({
|
|
@@ -120,7 +117,7 @@ var HoverZone = function HoverZone(_ref) {
|
|
|
120
117
|
var hoverZoneUpperStyle = useMemo(function () {
|
|
121
118
|
var heightStyleOffset = "var(--editor-block-controls-drop-indicator-gap, 0)/2";
|
|
122
119
|
var transformOffset = "var(".concat(EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET, ", 0)");
|
|
123
|
-
var heightStyle = anchorName &&
|
|
120
|
+
var heightStyle = anchorName && ENABLE_DROP_ZONE.includes((node === null || node === void 0 ? void 0 : node.type.name) || '') ? isAnchorSupported() ? "calc(anchor-size(".concat(anchorName, " height)/2 + ").concat(heightStyleOffset, ")") : "calc(".concat(((anchorRectCache === null || anchorRectCache === void 0 ? void 0 : anchorRectCache.getHeight(anchorName)) || 0) / 2, "px + ").concat(heightStyleOffset, ")") : '4px';
|
|
124
121
|
var transform = position === 'upper' ? "translateY(calc(-100% + ".concat(transformOffset, "))") : "translateY(".concat(transformOffset, ")");
|
|
125
122
|
return css({
|
|
126
123
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
@@ -145,7 +142,7 @@ var HoverZone = function HoverZone(_ref) {
|
|
|
145
142
|
var _anchorName = node ? expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) || isExperimentEnabled('platform_editor_block_control_migration') ? (api === null || api === void 0 ? void 0 : api.core.actions.getAnchorIdForNode(node, pos || -1)) || '' : getNodeAnchor(node) : '';
|
|
146
143
|
var top = 'unset';
|
|
147
144
|
if (_anchorName) {
|
|
148
|
-
var enabledDropZone =
|
|
145
|
+
var enabledDropZone = ENABLE_DROP_ZONE.includes((node === null || node === void 0 ? void 0 : node.type.name) || '');
|
|
149
146
|
if (isAnchorSupported()) {
|
|
150
147
|
top = enabledDropZone ? "calc(anchor(".concat(_anchorName, " 50%))") : "calc(anchor(".concat(_anchorName, " bottom) - 4px)");
|
|
151
148
|
} else if (anchorRectCache) {
|
|
@@ -84,6 +84,13 @@ var tooltipContainerStyles = css({
|
|
|
84
84
|
display: 'block',
|
|
85
85
|
zIndex: 'card'
|
|
86
86
|
});
|
|
87
|
+
var tooltipContainerStylesStickyHeader = css({
|
|
88
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
89
|
+
'[data-blocks-quick-insert-container]:has(~ [data-prosemirror-node-name="table"] .pm-table-with-controls tr.sticky) &': {
|
|
90
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
91
|
+
top: tableControlsSpacing
|
|
92
|
+
}
|
|
93
|
+
});
|
|
87
94
|
var tooltipContainerImprovedStylesStickyHeader = css({
|
|
88
95
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
89
96
|
'[data-blocks-quick-insert-container]:has(~ [data-prosemirror-node-name="table"] .pm-table-with-controls tr.sticky) &': {
|
|
@@ -107,6 +114,15 @@ var tooltipContainerImprovedStylesStickyHeader = css({
|
|
|
107
114
|
}
|
|
108
115
|
});
|
|
109
116
|
|
|
117
|
+
// We need this to work around adjacent breakout marks wrapping the controls widget decorations
|
|
118
|
+
var tooltipContainerStylesStickyHeaderWithMarksFix = css({
|
|
119
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
120
|
+
'[data-prosemirror-mark-name="breakout"]:has([data-blocks-quick-insert-container]):has(~ [data-prosemirror-node-name="table"] .pm-table-with-controls tr.sticky) &': {
|
|
121
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
122
|
+
top: tableControlsSpacing
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
110
126
|
// We need this to work around adjacent breakout marks wrapping the controls widget decorations
|
|
111
127
|
var tooltipContainerStylesImprovedStickyHeaderWithMarksFix = css({
|
|
112
128
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
@@ -375,7 +391,7 @@ export var TypeAheadControl = function TypeAheadControl(_ref2) {
|
|
|
375
391
|
,
|
|
376
392
|
xcss: [containerStaticStyles]
|
|
377
393
|
}, jsx("span", {
|
|
378
|
-
css: [tooltipContainerStyles, tooltipContainerImprovedStylesStickyHeader, tooltipContainerStylesImprovedStickyHeaderWithMarksFix]
|
|
394
|
+
css: [tooltipContainerStyles, expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') ? tooltipContainerImprovedStylesStickyHeader : tooltipContainerStylesStickyHeader, expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') ? tooltipContainerStylesImprovedStickyHeaderWithMarksFix : tooltipContainerStylesStickyHeaderWithMarksFix]
|
|
379
395
|
}, tooltipPressable()));
|
|
380
396
|
};
|
|
381
397
|
export var QuickInsertWithVisibility = function QuickInsertWithVisibility(_ref6) {
|
|
@@ -79,7 +79,6 @@ export var useBlockControlsVisibility = function useBlockControlsVisibility(_ref
|
|
|
79
79
|
isDisplayingDiff = _useSharedPluginState.isDisplayingDiff,
|
|
80
80
|
rightSideControlsEnabled = _useSharedPluginState.rightSideControlsEnabled;
|
|
81
81
|
var isViewMode = editorViewMode === 'view';
|
|
82
|
-
// rightSideControlsEnabled is the single source of truth (confluence_remix_button_right_side_block_fg from preset)
|
|
83
82
|
// Both controls are restricted by side: the drag handle shows on the left half, the Remix button on
|
|
84
83
|
// the right half (and the right margin), matching the midpoint split in handle-mouse-move.
|
|
85
84
|
var shouldRestrictBySide = rightSideControlsEnabled && controlSide !== undefined && !isViewMode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "31.0.
|
|
3
|
+
"version": "31.0.3",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@atlaskit/primitives": "^22.6.0",
|
|
62
62
|
"@atlaskit/section-message": "^10.2.0",
|
|
63
63
|
"@atlaskit/theme": "^28.2.0",
|
|
64
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
64
|
+
"@atlaskit/tmp-editor-statsig": "^248.0.0",
|
|
65
65
|
"@atlaskit/tokens": "^20.8.0",
|
|
66
66
|
"@atlaskit/tooltip": "^24.4.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"uuid": "^11.1.1"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@atlaskit/editor-common": "^134.
|
|
76
|
+
"@atlaskit/editor-common": "^134.1.0",
|
|
77
77
|
"react": "^18.2.0 || ^19.2.0",
|
|
78
78
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
79
79
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -82,15 +82,9 @@
|
|
|
82
82
|
"platform_editor_ease_of_use_metrics": {
|
|
83
83
|
"type": "boolean"
|
|
84
84
|
},
|
|
85
|
-
"platform_editor_content_mode_button_mvp": {
|
|
86
|
-
"type": "boolean"
|
|
87
|
-
},
|
|
88
85
|
"platform_editor_maui_jira_updates": {
|
|
89
86
|
"type": "boolean"
|
|
90
87
|
},
|
|
91
|
-
"confluence_remix_button_right_side_block_fg": {
|
|
92
|
-
"type": "boolean"
|
|
93
|
-
},
|
|
94
88
|
"platform_editor_controls_reliable_anchor_patch_1": {
|
|
95
89
|
"type": "boolean"
|
|
96
90
|
},
|