@atlaskit/editor-plugin-block-controls 7.5.2 → 7.5.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 +7 -0
- package/dist/cjs/editor-commands/move-to-layout.js +1 -1
- package/dist/cjs/ui/drag-handle.js +2 -17
- package/dist/es2019/editor-commands/move-to-layout.js +1 -1
- package/dist/es2019/ui/drag-handle.js +2 -17
- package/dist/esm/editor-commands/move-to-layout.js +1 -1
- package/dist/esm/ui/drag-handle.js +2 -17
- package/package.json +4 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 7.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3b9ebe635ab0a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3b9ebe635ab0a) -
|
|
8
|
+
Cleanup of platform_editor_draghandle_safari_scroll_fix
|
|
9
|
+
|
|
3
10
|
## 7.5.2
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -321,7 +321,7 @@ var moveToLayout = exports.moveToLayout = function moveToLayout(api) {
|
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
// we don't want to remove marks when moving/re-ordering layoutSection
|
|
324
|
-
var shouldRemoveMarks = !($sourceFrom.node().type === layoutSection && (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true)
|
|
324
|
+
var shouldRemoveMarks = !($sourceFrom.node().type === layoutSection && (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true));
|
|
325
325
|
var fromContentBeforeBreakoutMarksRemoved = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true) ? tr.doc.slice($sourceFrom.pos, sourceTo).content : $sourceFrom.nodeAfter;
|
|
326
326
|
|
|
327
327
|
// remove breakout from source content
|
|
@@ -441,20 +441,6 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
441
441
|
});
|
|
442
442
|
view.focus();
|
|
443
443
|
}, [isMultiSelect, api, view, dragHandleSelected, getPos, isTopLevelNode, nodeType, anchorName]);
|
|
444
|
-
|
|
445
|
-
// TODO: ED-26959 - This needs to be investigated further. Drag preview generation is not always working
|
|
446
|
-
// as expected with a node selection. This workaround sets the selection to the node on mouseDown,
|
|
447
|
-
// but ensures the preview is generated correctly.
|
|
448
|
-
var handleMouseDown = (0, _react.useCallback)(function () {
|
|
449
|
-
if ((0, _experiments.editorExperiment)('advanced_layouts', true) && !(0, _platformFeatureFlags.fg)('platform_editor_draghandle_safari_scroll_fix')) {
|
|
450
|
-
var _buttonRef$current;
|
|
451
|
-
// prevent native drag and drop.
|
|
452
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
453
|
-
if (!isLayoutColumn) {
|
|
454
|
-
return undefined;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}, [isLayoutColumn]);
|
|
458
444
|
var handleKeyDown = (0, _react.useCallback)(function (e) {
|
|
459
445
|
// allow user to use spacebar to select the node
|
|
460
446
|
if (!e.repeat && e.key === ' ') {
|
|
@@ -847,8 +833,8 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
847
833
|
(0, _react.useEffect)(function () {
|
|
848
834
|
if (handleOptions !== null && handleOptions !== void 0 && handleOptions.isFocused && buttonRef.current) {
|
|
849
835
|
var id = requestAnimationFrame(function () {
|
|
850
|
-
var _buttonRef$
|
|
851
|
-
(_buttonRef$
|
|
836
|
+
var _buttonRef$current;
|
|
837
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
852
838
|
});
|
|
853
839
|
return function () {
|
|
854
840
|
cancelAnimationFrame(id);
|
|
@@ -972,7 +958,6 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
972
958
|
,
|
|
973
959
|
style: !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? (0, _experiments.editorExperiment)('platform_editor_block_control_optimise_render', true) ? positionStyles : positionStylesOld : {},
|
|
974
960
|
onClick: handleOnClick,
|
|
975
|
-
onMouseDown: handleMouseDown,
|
|
976
961
|
onKeyDown: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) ? handleKeyDownNew : handleKeyDown
|
|
977
962
|
// eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
|
|
978
963
|
,
|
|
@@ -308,7 +308,7 @@ export const moveToLayout = api => (from, to, options) => ({
|
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
// we don't want to remove marks when moving/re-ordering layoutSection
|
|
311
|
-
const shouldRemoveMarks = !($sourceFrom.node().type === layoutSection && editorExperiment('platform_editor_element_drag_and_drop_multiselect', true)
|
|
311
|
+
const shouldRemoveMarks = !($sourceFrom.node().type === layoutSection && editorExperiment('platform_editor_element_drag_and_drop_multiselect', true));
|
|
312
312
|
const fromContentBeforeBreakoutMarksRemoved = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true) ? tr.doc.slice($sourceFrom.pos, sourceTo).content : $sourceFrom.nodeAfter;
|
|
313
313
|
|
|
314
314
|
// remove breakout from source content
|
|
@@ -418,20 +418,6 @@ export const DragHandle = ({
|
|
|
418
418
|
});
|
|
419
419
|
view.focus();
|
|
420
420
|
}, [isMultiSelect, api, view, dragHandleSelected, getPos, isTopLevelNode, nodeType, anchorName]);
|
|
421
|
-
|
|
422
|
-
// TODO: ED-26959 - This needs to be investigated further. Drag preview generation is not always working
|
|
423
|
-
// as expected with a node selection. This workaround sets the selection to the node on mouseDown,
|
|
424
|
-
// but ensures the preview is generated correctly.
|
|
425
|
-
const handleMouseDown = useCallback(() => {
|
|
426
|
-
if (editorExperiment('advanced_layouts', true) && !fg('platform_editor_draghandle_safari_scroll_fix')) {
|
|
427
|
-
var _buttonRef$current;
|
|
428
|
-
// prevent native drag and drop.
|
|
429
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
430
|
-
if (!isLayoutColumn) {
|
|
431
|
-
return undefined;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
}, [isLayoutColumn]);
|
|
435
421
|
const handleKeyDown = useCallback(e => {
|
|
436
422
|
// allow user to use spacebar to select the node
|
|
437
423
|
if (!e.repeat && e.key === ' ') {
|
|
@@ -833,8 +819,8 @@ export const DragHandle = ({
|
|
|
833
819
|
useEffect(() => {
|
|
834
820
|
if (handleOptions !== null && handleOptions !== void 0 && handleOptions.isFocused && buttonRef.current) {
|
|
835
821
|
const id = requestAnimationFrame(() => {
|
|
836
|
-
var _buttonRef$
|
|
837
|
-
(_buttonRef$
|
|
822
|
+
var _buttonRef$current;
|
|
823
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
|
838
824
|
});
|
|
839
825
|
return () => {
|
|
840
826
|
cancelAnimationFrame(id);
|
|
@@ -957,7 +943,6 @@ export const DragHandle = ({
|
|
|
957
943
|
,
|
|
958
944
|
style: !editorExperiment('platform_editor_controls', 'variant1') ? editorExperiment('platform_editor_block_control_optimise_render', true) ? positionStyles : positionStylesOld : {},
|
|
959
945
|
onClick: handleOnClick,
|
|
960
|
-
onMouseDown: handleMouseDown,
|
|
961
946
|
onKeyDown: expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) ? handleKeyDownNew : handleKeyDown
|
|
962
947
|
// eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
|
|
963
948
|
,
|
|
@@ -315,7 +315,7 @@ export var moveToLayout = function moveToLayout(api) {
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
// we don't want to remove marks when moving/re-ordering layoutSection
|
|
318
|
-
var shouldRemoveMarks = !($sourceFrom.node().type === layoutSection && editorExperiment('platform_editor_element_drag_and_drop_multiselect', true)
|
|
318
|
+
var shouldRemoveMarks = !($sourceFrom.node().type === layoutSection && editorExperiment('platform_editor_element_drag_and_drop_multiselect', true));
|
|
319
319
|
var fromContentBeforeBreakoutMarksRemoved = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true) ? tr.doc.slice($sourceFrom.pos, sourceTo).content : $sourceFrom.nodeAfter;
|
|
320
320
|
|
|
321
321
|
// remove breakout from source content
|
|
@@ -438,20 +438,6 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
438
438
|
});
|
|
439
439
|
view.focus();
|
|
440
440
|
}, [isMultiSelect, api, view, dragHandleSelected, getPos, isTopLevelNode, nodeType, anchorName]);
|
|
441
|
-
|
|
442
|
-
// TODO: ED-26959 - This needs to be investigated further. Drag preview generation is not always working
|
|
443
|
-
// as expected with a node selection. This workaround sets the selection to the node on mouseDown,
|
|
444
|
-
// but ensures the preview is generated correctly.
|
|
445
|
-
var handleMouseDown = useCallback(function () {
|
|
446
|
-
if (editorExperiment('advanced_layouts', true) && !fg('platform_editor_draghandle_safari_scroll_fix')) {
|
|
447
|
-
var _buttonRef$current;
|
|
448
|
-
// prevent native drag and drop.
|
|
449
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
450
|
-
if (!isLayoutColumn) {
|
|
451
|
-
return undefined;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
}, [isLayoutColumn]);
|
|
455
441
|
var handleKeyDown = useCallback(function (e) {
|
|
456
442
|
// allow user to use spacebar to select the node
|
|
457
443
|
if (!e.repeat && e.key === ' ') {
|
|
@@ -844,8 +830,8 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
844
830
|
useEffect(function () {
|
|
845
831
|
if (handleOptions !== null && handleOptions !== void 0 && handleOptions.isFocused && buttonRef.current) {
|
|
846
832
|
var id = requestAnimationFrame(function () {
|
|
847
|
-
var _buttonRef$
|
|
848
|
-
(_buttonRef$
|
|
833
|
+
var _buttonRef$current;
|
|
834
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
849
835
|
});
|
|
850
836
|
return function () {
|
|
851
837
|
cancelAnimationFrame(id);
|
|
@@ -969,7 +955,6 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
969
955
|
,
|
|
970
956
|
style: !editorExperiment('platform_editor_controls', 'variant1') ? editorExperiment('platform_editor_block_control_optimise_render', true) ? positionStyles : positionStylesOld : {},
|
|
971
957
|
onClick: handleOnClick,
|
|
972
|
-
onMouseDown: handleMouseDown,
|
|
973
958
|
onKeyDown: expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_keyboard_navigation', 'isEnabled', true) ? handleKeyDownNew : handleKeyDown
|
|
974
959
|
// eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
|
|
975
960
|
,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.3",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
54
54
|
"@atlaskit/primitives": "^16.1.0",
|
|
55
55
|
"@atlaskit/theme": "^21.0.0",
|
|
56
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
57
|
-
"@atlaskit/tokens": "^7.
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^13.27.0",
|
|
57
|
+
"@atlaskit/tokens": "^7.1.0",
|
|
58
58
|
"@atlaskit/tooltip": "^20.7.0",
|
|
59
59
|
"@babel/runtime": "^7.0.0",
|
|
60
60
|
"@emotion/react": "^11.7.1",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"uuid": "^3.1.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@atlaskit/editor-common": "^110.
|
|
68
|
+
"@atlaskit/editor-common": "^110.22.0",
|
|
69
69
|
"react": "^18.2.0",
|
|
70
70
|
"react-dom": "^18.2.0",
|
|
71
71
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -127,9 +127,6 @@
|
|
|
127
127
|
"platform_editor_multi_body_extension_extensibility": {
|
|
128
128
|
"type": "boolean"
|
|
129
129
|
},
|
|
130
|
-
"platform_editor_elements_dnd_multi_select_patch_3": {
|
|
131
|
-
"type": "boolean"
|
|
132
|
-
},
|
|
133
130
|
"platform_editor_drag_and_drop_perf_analytics": {
|
|
134
131
|
"type": "boolean"
|
|
135
132
|
},
|
|
@@ -151,9 +148,6 @@
|
|
|
151
148
|
"platform_editor_breakout_resizing_widget_fix": {
|
|
152
149
|
"type": "boolean"
|
|
153
150
|
},
|
|
154
|
-
"platform_editor_draghandle_safari_scroll_fix": {
|
|
155
|
-
"type": "boolean"
|
|
156
|
-
},
|
|
157
151
|
"platform_editor_content_mode_button_mvp": {
|
|
158
152
|
"type": "boolean"
|
|
159
153
|
},
|