@atlaskit/editor-plugin-block-controls 6.3.7 → 6.3.9
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 +19 -0
- package/dist/cjs/blockControlsPlugin.js +3 -0
- package/dist/cjs/editor-commands/move-node-with-block-menu.js +4 -0
- package/dist/cjs/editor-commands/utils/move-node-utils.js +3 -0
- package/dist/cjs/pm-plugins/handle-mouse-over.js +8 -12
- package/dist/cjs/ui/drag-handle.js +12 -4
- package/dist/es2019/blockControlsPlugin.js +3 -0
- package/dist/es2019/editor-commands/move-node-with-block-menu.js +4 -0
- package/dist/es2019/editor-commands/utils/move-node-utils.js +3 -0
- package/dist/es2019/pm-plugins/handle-mouse-over.js +8 -12
- package/dist/es2019/ui/drag-handle.js +12 -4
- package/dist/esm/blockControlsPlugin.js +3 -0
- package/dist/esm/editor-commands/move-node-with-block-menu.js +4 -0
- package/dist/esm/editor-commands/utils/move-node-utils.js +3 -0
- package/dist/esm/pm-plugins/handle-mouse-over.js +8 -12
- package/dist/esm/ui/drag-handle.js +12 -4
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 6.3.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f74cedd969dd0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f74cedd969dd0) -
|
|
8
|
+
FD-97663 clean up fg platform_editor_table_drag_handle_shift_fix
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 6.3.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`f7bc2f60e0fc6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f7bc2f60e0fc6) -
|
|
16
|
+
[ux] Updates copy text for drag handle, copy block, copy link and updates order of items in Turn
|
|
17
|
+
into menu.
|
|
18
|
+
- [`a6522c44ddfbb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a6522c44ddfbb) -
|
|
19
|
+
[ux] ED-29408 Fix move up option being enabled for first node in layoutColumn
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 6.3.7
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -76,6 +76,9 @@ var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPl
|
|
|
76
76
|
return function (_ref4) {
|
|
77
77
|
var _api$userIntent, _options$anchorName, _api$blockControls;
|
|
78
78
|
var tr = _ref4.tr;
|
|
79
|
+
if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
|
|
80
|
+
return tr;
|
|
81
|
+
}
|
|
79
82
|
var currMeta = tr.getMeta(_main.key);
|
|
80
83
|
var currentUserIntent = api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent;
|
|
81
84
|
if (options !== null && options !== void 0 && options.closeMenu) {
|
|
@@ -13,6 +13,10 @@ var _moveNodeUtils = require("./utils/move-node-utils");
|
|
|
13
13
|
var moveNodeWithBlockMenu = exports.moveNodeWithBlockMenu = function moveNodeWithBlockMenu(api, direction) {
|
|
14
14
|
return function (_ref) {
|
|
15
15
|
var tr = _ref.tr;
|
|
16
|
+
if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
|
|
17
|
+
return tr;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
// Nodes like lists nest within themselves, we need to find the top most position
|
|
17
21
|
var currentNodePos = (0, _moveNodeUtils.getCurrentNodePosFromDragHandleSelection)({
|
|
18
22
|
selection: tr.selection,
|
|
@@ -38,6 +38,9 @@ var getCurrentNodePosFromDragHandleSelection = exports.getCurrentNodePosFromDrag
|
|
|
38
38
|
var getPosWhenMoveNodeUp = exports.getPosWhenMoveNodeUp = function getPosWhenMoveNodeUp($currentNodePos, currentNodePos) {
|
|
39
39
|
var nodeIndex = $currentNodePos.index();
|
|
40
40
|
var nodeBefore = $currentNodePos.depth > 1 && nodeIndex === 0 ? $currentNodePos.node($currentNodePos.depth) : $currentNodePos.nodeBefore;
|
|
41
|
+
if ((nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.type.name) === 'layoutColumn' && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
|
|
42
|
+
return -1;
|
|
43
|
+
}
|
|
41
44
|
return nodeBefore ? currentNodePos - nodeBefore.nodeSize : -1;
|
|
42
45
|
};
|
|
43
46
|
var getPosWhenMoveNodeDown = exports.getPosWhenMoveNodeDown = function getPosWhenMoveNodeDown(_ref2) {
|
|
@@ -84,19 +84,15 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
84
84
|
var parentElementType = (0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true) ? (0, _domAttrName.getTypeNameFromDom)(parentElement) : parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute('data-drag-handler-node-type');
|
|
85
85
|
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
86
86
|
// We want to exclude handles from showing for direct descendant of table nodes (i.e. nodes in cells)
|
|
87
|
-
if (
|
|
88
|
-
if (parentElement && parentElementType === 'table') {
|
|
89
|
-
rootElement = parentElement;
|
|
90
|
-
} else if (parentElement && parentElementType === 'tableRow') {
|
|
91
|
-
var _parentElement$parent;
|
|
92
|
-
var grandparentElement = parentElement === null || parentElement === void 0 || (_parentElement$parent = parentElement.parentElement) === null || _parentElement$parent === void 0 ? void 0 : _parentElement$parent.closest("[".concat((0, _domAttrName.getAnchorAttrName)(), "]"));
|
|
93
|
-
var grandparentElementType = (0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true) ? (0, _domAttrName.getTypeNameFromDom)(grandparentElement) : grandparentElement === null || grandparentElement === void 0 ? void 0 : grandparentElement.getAttribute('data-drag-handler-node-type');
|
|
94
|
-
if (grandparentElement && grandparentElementType === 'table') {
|
|
95
|
-
rootElement = grandparentElement;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
} else if (parentElement && (parentElementType === 'table' || parentElementType === 'tableRow')) {
|
|
87
|
+
if (parentElement && parentElementType === 'table') {
|
|
99
88
|
rootElement = parentElement;
|
|
89
|
+
} else if (parentElement && parentElementType === 'tableRow') {
|
|
90
|
+
var _parentElement$parent;
|
|
91
|
+
var grandparentElement = parentElement === null || parentElement === void 0 || (_parentElement$parent = parentElement.parentElement) === null || _parentElement$parent === void 0 ? void 0 : _parentElement$parent.closest("[".concat((0, _domAttrName.getAnchorAttrName)(), "]"));
|
|
92
|
+
var grandparentElementType = (0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true) ? (0, _domAttrName.getTypeNameFromDom)(grandparentElement) : grandparentElement === null || grandparentElement === void 0 ? void 0 : grandparentElement.getAttribute('data-drag-handler-node-type');
|
|
93
|
+
if (grandparentElement && grandparentElementType === 'table') {
|
|
94
|
+
rootElement = grandparentElement;
|
|
95
|
+
}
|
|
100
96
|
}
|
|
101
97
|
} else {
|
|
102
98
|
// We want to exclude handles from showing for direct descendant of table nodes (i.e. nodes in cells)
|
|
@@ -828,8 +828,16 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
828
828
|
setDragHandleDisabled(false);
|
|
829
829
|
}
|
|
830
830
|
}, [api === null || api === void 0 ? void 0 : api.blockControls.sharedState, isMultiSelect, isShiftDown, isTopLevelNode, view]);
|
|
831
|
+
var dragHandleMessage = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_patch_1') ? formatMessage(_messages.blockControlsMessages.dragToMoveClickToOpen, {
|
|
832
|
+
br: (0, _react2.jsx)("br", null)
|
|
833
|
+
}) : formatMessage(_messages.blockControlsMessages.dragToMove);
|
|
834
|
+
|
|
835
|
+
// Create a string version for aria-label
|
|
836
|
+
var dragHandleAriaLabel = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_patch_1') ? formatMessage(_messages.blockControlsMessages.dragToMoveClickToOpen, {
|
|
837
|
+
br: ' '
|
|
838
|
+
}) : formatMessage(_messages.blockControlsMessages.dragToMove);
|
|
831
839
|
var helpDescriptors = isTopLevelNode ? [{
|
|
832
|
-
description:
|
|
840
|
+
description: dragHandleMessage
|
|
833
841
|
}, {
|
|
834
842
|
description: formatMessage(_messages.blockControlsMessages.moveUp),
|
|
835
843
|
keymap: _keymaps.dragToMoveUp
|
|
@@ -843,7 +851,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
843
851
|
description: formatMessage(_messages.blockControlsMessages.moveRight),
|
|
844
852
|
keymap: _keymaps.dragToMoveRight
|
|
845
853
|
}] : [{
|
|
846
|
-
description:
|
|
854
|
+
description: dragHandleMessage
|
|
847
855
|
}, {
|
|
848
856
|
description: formatMessage(_messages.blockControlsMessages.moveUp),
|
|
849
857
|
keymap: _keymaps.dragToMoveUp
|
|
@@ -890,7 +898,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
890
898
|
}
|
|
891
899
|
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
892
900
|
helpDescriptors = [{
|
|
893
|
-
description:
|
|
901
|
+
description: dragHandleMessage
|
|
894
902
|
}];
|
|
895
903
|
}
|
|
896
904
|
var message = helpDescriptors.map(function (descriptor) {
|
|
@@ -922,7 +930,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
922
930
|
disabled: dragHandleDisabled,
|
|
923
931
|
"data-editor-block-ctrl-drag-handle": true,
|
|
924
932
|
"data-testid": "block-ctrl-drag-handle",
|
|
925
|
-
"aria-label": (0, _expValEquals.expValEquals)('platform_editor_drag_handle_aria_label', 'isEnabled', true) ?
|
|
933
|
+
"aria-label": (0, _expValEquals.expValEquals)('platform_editor_drag_handle_aria_label', 'isEnabled', true) ? dragHandleAriaLabel : ''
|
|
926
934
|
}, (0, _react2.jsx)(_primitives.Box, {
|
|
927
935
|
xcss: iconWrapperStyles
|
|
928
936
|
// eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
|
|
@@ -65,6 +65,9 @@ export const blockControlsPlugin = ({
|
|
|
65
65
|
tr
|
|
66
66
|
}) => {
|
|
67
67
|
var _api$userIntent, _api$userIntent$share, _options$anchorName, _api$blockControls, _api$blockControls$sh;
|
|
68
|
+
if (!expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
69
|
+
return tr;
|
|
70
|
+
}
|
|
68
71
|
const currMeta = tr.getMeta(key);
|
|
69
72
|
const currentUserIntent = api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : (_api$userIntent$share = _api$userIntent.sharedState.currentState()) === null || _api$userIntent$share === void 0 ? void 0 : _api$userIntent$share.currentUserIntent;
|
|
70
73
|
if (options !== null && options !== void 0 && options.closeMenu) {
|
|
@@ -8,6 +8,10 @@ export const moveNodeWithBlockMenu = (api, direction) => {
|
|
|
8
8
|
return ({
|
|
9
9
|
tr
|
|
10
10
|
}) => {
|
|
11
|
+
if (!expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
12
|
+
return tr;
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
// Nodes like lists nest within themselves, we need to find the top most position
|
|
12
16
|
const currentNodePos = getCurrentNodePosFromDragHandleSelection({
|
|
13
17
|
selection: tr.selection,
|
|
@@ -33,6 +33,9 @@ export const getCurrentNodePosFromDragHandleSelection = ({
|
|
|
33
33
|
export const getPosWhenMoveNodeUp = ($currentNodePos, currentNodePos) => {
|
|
34
34
|
const nodeIndex = $currentNodePos.index();
|
|
35
35
|
const nodeBefore = $currentNodePos.depth > 1 && nodeIndex === 0 ? $currentNodePos.node($currentNodePos.depth) : $currentNodePos.nodeBefore;
|
|
36
|
+
if ((nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.type.name) === 'layoutColumn' && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
37
|
+
return -1;
|
|
38
|
+
}
|
|
36
39
|
return nodeBefore ? currentNodePos - nodeBefore.nodeSize : -1;
|
|
37
40
|
};
|
|
38
41
|
export const getPosWhenMoveNodeDown = ({
|
|
@@ -74,19 +74,15 @@ export const handleMouseOver = (view, event, api) => {
|
|
|
74
74
|
const parentElementType = expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? getTypeNameFromDom(parentElement) : parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute('data-drag-handler-node-type');
|
|
75
75
|
if (editorExperiment('advanced_layouts', true)) {
|
|
76
76
|
// We want to exclude handles from showing for direct descendant of table nodes (i.e. nodes in cells)
|
|
77
|
-
if (
|
|
78
|
-
if (parentElement && parentElementType === 'table') {
|
|
79
|
-
rootElement = parentElement;
|
|
80
|
-
} else if (parentElement && parentElementType === 'tableRow') {
|
|
81
|
-
var _parentElement$parent;
|
|
82
|
-
const grandparentElement = parentElement === null || parentElement === void 0 ? void 0 : (_parentElement$parent = parentElement.parentElement) === null || _parentElement$parent === void 0 ? void 0 : _parentElement$parent.closest(`[${getAnchorAttrName()}]`);
|
|
83
|
-
const grandparentElementType = expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? getTypeNameFromDom(grandparentElement) : grandparentElement === null || grandparentElement === void 0 ? void 0 : grandparentElement.getAttribute('data-drag-handler-node-type');
|
|
84
|
-
if (grandparentElement && grandparentElementType === 'table') {
|
|
85
|
-
rootElement = grandparentElement;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
} else if (parentElement && (parentElementType === 'table' || parentElementType === 'tableRow')) {
|
|
77
|
+
if (parentElement && parentElementType === 'table') {
|
|
89
78
|
rootElement = parentElement;
|
|
79
|
+
} else if (parentElement && parentElementType === 'tableRow') {
|
|
80
|
+
var _parentElement$parent;
|
|
81
|
+
const grandparentElement = parentElement === null || parentElement === void 0 ? void 0 : (_parentElement$parent = parentElement.parentElement) === null || _parentElement$parent === void 0 ? void 0 : _parentElement$parent.closest(`[${getAnchorAttrName()}]`);
|
|
82
|
+
const grandparentElementType = expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? getTypeNameFromDom(grandparentElement) : grandparentElement === null || grandparentElement === void 0 ? void 0 : grandparentElement.getAttribute('data-drag-handler-node-type');
|
|
83
|
+
if (grandparentElement && grandparentElementType === 'table') {
|
|
84
|
+
rootElement = grandparentElement;
|
|
85
|
+
}
|
|
90
86
|
}
|
|
91
87
|
} else {
|
|
92
88
|
// We want to exclude handles from showing for direct descendant of table nodes (i.e. nodes in cells)
|
|
@@ -819,8 +819,16 @@ export const DragHandle = ({
|
|
|
819
819
|
setDragHandleDisabled(false);
|
|
820
820
|
}
|
|
821
821
|
}, [api === null || api === void 0 ? void 0 : api.blockControls.sharedState, isMultiSelect, isShiftDown, isTopLevelNode, view]);
|
|
822
|
+
const dragHandleMessage = expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_patch_1') ? formatMessage(blockControlsMessages.dragToMoveClickToOpen, {
|
|
823
|
+
br: jsx("br", null)
|
|
824
|
+
}) : formatMessage(blockControlsMessages.dragToMove);
|
|
825
|
+
|
|
826
|
+
// Create a string version for aria-label
|
|
827
|
+
const dragHandleAriaLabel = expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_patch_1') ? formatMessage(blockControlsMessages.dragToMoveClickToOpen, {
|
|
828
|
+
br: ' '
|
|
829
|
+
}) : formatMessage(blockControlsMessages.dragToMove);
|
|
822
830
|
let helpDescriptors = isTopLevelNode ? [{
|
|
823
|
-
description:
|
|
831
|
+
description: dragHandleMessage
|
|
824
832
|
}, {
|
|
825
833
|
description: formatMessage(blockControlsMessages.moveUp),
|
|
826
834
|
keymap: dragToMoveUp
|
|
@@ -834,7 +842,7 @@ export const DragHandle = ({
|
|
|
834
842
|
description: formatMessage(blockControlsMessages.moveRight),
|
|
835
843
|
keymap: dragToMoveRight
|
|
836
844
|
}] : [{
|
|
837
|
-
description:
|
|
845
|
+
description: dragHandleMessage
|
|
838
846
|
}, {
|
|
839
847
|
description: formatMessage(blockControlsMessages.moveUp),
|
|
840
848
|
keymap: dragToMoveUp
|
|
@@ -881,7 +889,7 @@ export const DragHandle = ({
|
|
|
881
889
|
}
|
|
882
890
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
883
891
|
helpDescriptors = [{
|
|
884
|
-
description:
|
|
892
|
+
description: dragHandleMessage
|
|
885
893
|
}];
|
|
886
894
|
}
|
|
887
895
|
const message = helpDescriptors.map(descriptor => {
|
|
@@ -912,7 +920,7 @@ export const DragHandle = ({
|
|
|
912
920
|
disabled: dragHandleDisabled,
|
|
913
921
|
"data-editor-block-ctrl-drag-handle": true,
|
|
914
922
|
"data-testid": "block-ctrl-drag-handle",
|
|
915
|
-
"aria-label": expValEquals('platform_editor_drag_handle_aria_label', 'isEnabled', true) ?
|
|
923
|
+
"aria-label": expValEquals('platform_editor_drag_handle_aria_label', 'isEnabled', true) ? dragHandleAriaLabel : ''
|
|
916
924
|
}, jsx(Box, {
|
|
917
925
|
xcss: iconWrapperStyles
|
|
918
926
|
// eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
|
|
@@ -69,6 +69,9 @@ export var blockControlsPlugin = function blockControlsPlugin(_ref) {
|
|
|
69
69
|
return function (_ref4) {
|
|
70
70
|
var _api$userIntent, _options$anchorName, _api$blockControls;
|
|
71
71
|
var tr = _ref4.tr;
|
|
72
|
+
if (!expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
73
|
+
return tr;
|
|
74
|
+
}
|
|
72
75
|
var currMeta = tr.getMeta(key);
|
|
73
76
|
var currentUserIntent = api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent;
|
|
74
77
|
if (options !== null && options !== void 0 && options.closeMenu) {
|
|
@@ -7,6 +7,10 @@ import { getCurrentNodePosFromDragHandleSelection, getPosWhenMoveNodeDown, getPo
|
|
|
7
7
|
export var moveNodeWithBlockMenu = function moveNodeWithBlockMenu(api, direction) {
|
|
8
8
|
return function (_ref) {
|
|
9
9
|
var tr = _ref.tr;
|
|
10
|
+
if (!expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
11
|
+
return tr;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
// Nodes like lists nest within themselves, we need to find the top most position
|
|
11
15
|
var currentNodePos = getCurrentNodePosFromDragHandleSelection({
|
|
12
16
|
selection: tr.selection,
|
|
@@ -32,6 +32,9 @@ export var getCurrentNodePosFromDragHandleSelection = function getCurrentNodePos
|
|
|
32
32
|
export var getPosWhenMoveNodeUp = function getPosWhenMoveNodeUp($currentNodePos, currentNodePos) {
|
|
33
33
|
var nodeIndex = $currentNodePos.index();
|
|
34
34
|
var nodeBefore = $currentNodePos.depth > 1 && nodeIndex === 0 ? $currentNodePos.node($currentNodePos.depth) : $currentNodePos.nodeBefore;
|
|
35
|
+
if ((nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.type.name) === 'layoutColumn' && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
36
|
+
return -1;
|
|
37
|
+
}
|
|
35
38
|
return nodeBefore ? currentNodePos - nodeBefore.nodeSize : -1;
|
|
36
39
|
};
|
|
37
40
|
export var getPosWhenMoveNodeDown = function getPosWhenMoveNodeDown(_ref2) {
|
|
@@ -77,19 +77,15 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
77
77
|
var parentElementType = expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? getTypeNameFromDom(parentElement) : parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute('data-drag-handler-node-type');
|
|
78
78
|
if (editorExperiment('advanced_layouts', true)) {
|
|
79
79
|
// We want to exclude handles from showing for direct descendant of table nodes (i.e. nodes in cells)
|
|
80
|
-
if (
|
|
81
|
-
if (parentElement && parentElementType === 'table') {
|
|
82
|
-
rootElement = parentElement;
|
|
83
|
-
} else if (parentElement && parentElementType === 'tableRow') {
|
|
84
|
-
var _parentElement$parent;
|
|
85
|
-
var grandparentElement = parentElement === null || parentElement === void 0 || (_parentElement$parent = parentElement.parentElement) === null || _parentElement$parent === void 0 ? void 0 : _parentElement$parent.closest("[".concat(getAnchorAttrName(), "]"));
|
|
86
|
-
var grandparentElementType = expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? getTypeNameFromDom(grandparentElement) : grandparentElement === null || grandparentElement === void 0 ? void 0 : grandparentElement.getAttribute('data-drag-handler-node-type');
|
|
87
|
-
if (grandparentElement && grandparentElementType === 'table') {
|
|
88
|
-
rootElement = grandparentElement;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
} else if (parentElement && (parentElementType === 'table' || parentElementType === 'tableRow')) {
|
|
80
|
+
if (parentElement && parentElementType === 'table') {
|
|
92
81
|
rootElement = parentElement;
|
|
82
|
+
} else if (parentElement && parentElementType === 'tableRow') {
|
|
83
|
+
var _parentElement$parent;
|
|
84
|
+
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 = expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? getTypeNameFromDom(grandparentElement) : grandparentElement === null || grandparentElement === void 0 ? void 0 : grandparentElement.getAttribute('data-drag-handler-node-type');
|
|
86
|
+
if (grandparentElement && grandparentElementType === 'table') {
|
|
87
|
+
rootElement = grandparentElement;
|
|
88
|
+
}
|
|
93
89
|
}
|
|
94
90
|
} else {
|
|
95
91
|
// We want to exclude handles from showing for direct descendant of table nodes (i.e. nodes in cells)
|
|
@@ -825,8 +825,16 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
825
825
|
setDragHandleDisabled(false);
|
|
826
826
|
}
|
|
827
827
|
}, [api === null || api === void 0 ? void 0 : api.blockControls.sharedState, isMultiSelect, isShiftDown, isTopLevelNode, view]);
|
|
828
|
+
var dragHandleMessage = expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_patch_1') ? formatMessage(blockControlsMessages.dragToMoveClickToOpen, {
|
|
829
|
+
br: jsx("br", null)
|
|
830
|
+
}) : formatMessage(blockControlsMessages.dragToMove);
|
|
831
|
+
|
|
832
|
+
// Create a string version for aria-label
|
|
833
|
+
var dragHandleAriaLabel = expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_patch_1') ? formatMessage(blockControlsMessages.dragToMoveClickToOpen, {
|
|
834
|
+
br: ' '
|
|
835
|
+
}) : formatMessage(blockControlsMessages.dragToMove);
|
|
828
836
|
var helpDescriptors = isTopLevelNode ? [{
|
|
829
|
-
description:
|
|
837
|
+
description: dragHandleMessage
|
|
830
838
|
}, {
|
|
831
839
|
description: formatMessage(blockControlsMessages.moveUp),
|
|
832
840
|
keymap: dragToMoveUp
|
|
@@ -840,7 +848,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
840
848
|
description: formatMessage(blockControlsMessages.moveRight),
|
|
841
849
|
keymap: dragToMoveRight
|
|
842
850
|
}] : [{
|
|
843
|
-
description:
|
|
851
|
+
description: dragHandleMessage
|
|
844
852
|
}, {
|
|
845
853
|
description: formatMessage(blockControlsMessages.moveUp),
|
|
846
854
|
keymap: dragToMoveUp
|
|
@@ -887,7 +895,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
887
895
|
}
|
|
888
896
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
889
897
|
helpDescriptors = [{
|
|
890
|
-
description:
|
|
898
|
+
description: dragHandleMessage
|
|
891
899
|
}];
|
|
892
900
|
}
|
|
893
901
|
var message = helpDescriptors.map(function (descriptor) {
|
|
@@ -919,7 +927,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
919
927
|
disabled: dragHandleDisabled,
|
|
920
928
|
"data-editor-block-ctrl-drag-handle": true,
|
|
921
929
|
"data-testid": "block-ctrl-drag-handle",
|
|
922
|
-
"aria-label": expValEquals('platform_editor_drag_handle_aria_label', 'isEnabled', true) ?
|
|
930
|
+
"aria-label": expValEquals('platform_editor_drag_handle_aria_label', 'isEnabled', true) ? dragHandleAriaLabel : ''
|
|
923
931
|
}, jsx(Box, {
|
|
924
932
|
xcss: iconWrapperStyles
|
|
925
933
|
// eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.9",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
45
45
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
46
46
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
47
|
-
"@atlaskit/icon": "^28.
|
|
47
|
+
"@atlaskit/icon": "^28.3.0",
|
|
48
48
|
"@atlaskit/link": "^3.2.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"uuid": "^3.1.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@atlaskit/editor-common": "^109.
|
|
67
|
+
"@atlaskit/editor-common": "^109.15.0",
|
|
68
68
|
"react": "^18.2.0",
|
|
69
69
|
"react-dom": "^18.2.0",
|
|
70
70
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -153,15 +153,15 @@
|
|
|
153
153
|
"platform_editor_fix_widget_destroy": {
|
|
154
154
|
"type": "boolean"
|
|
155
155
|
},
|
|
156
|
-
"platform_editor_table_drag_handle_shift_fix": {
|
|
157
|
-
"type": "boolean"
|
|
158
|
-
},
|
|
159
156
|
"dst-a11y__replace-anchor-with-link__editor-jenga": {
|
|
160
157
|
"type": "boolean"
|
|
161
158
|
},
|
|
162
159
|
"platform_editor_breakout_resizing_hello_release": {
|
|
163
160
|
"type": "boolean"
|
|
164
161
|
},
|
|
162
|
+
"platform_editor_block_menu_patch_1": {
|
|
163
|
+
"type": "boolean"
|
|
164
|
+
},
|
|
165
165
|
"platform_editor_breakout_resizing_widget_fix": {
|
|
166
166
|
"type": "boolean"
|
|
167
167
|
},
|