@atlaskit/editor-plugin-block-controls 3.1.8 → 3.1.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 +8 -0
- package/dist/cjs/ui/block-menu-items.js +28 -0
- package/dist/cjs/ui/drag-handle.js +6 -0
- package/dist/es2019/ui/block-menu-items.js +29 -1
- package/dist/es2019/ui/drag-handle.js +6 -0
- package/dist/esm/ui/block-menu-items.js +29 -1
- package/dist/esm/ui/drag-handle.js +6 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#121235](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/121235)
|
|
8
|
+
[`fd5c842595a2f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fd5c842595a2f) -
|
|
9
|
+
[ux] Adds moveLeft and moveRight items to the Block menu and updates the tooltip
|
|
10
|
+
|
|
3
11
|
## 3.1.8
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -10,6 +10,8 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
10
10
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
11
11
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
12
12
|
var _arrowDown = _interopRequireDefault(require("@atlaskit/icon/core/arrow-down"));
|
|
13
|
+
var _arrowLeft = _interopRequireDefault(require("@atlaskit/icon/core/arrow-left"));
|
|
14
|
+
var _arrowRight = _interopRequireDefault(require("@atlaskit/icon/core/arrow-right"));
|
|
13
15
|
var _arrowUp = _interopRequireDefault(require("@atlaskit/icon/core/arrow-up"));
|
|
14
16
|
var _moveNode = require("../editor-commands/move-node");
|
|
15
17
|
var _consts = require("../pm-plugins/utils/consts");
|
|
@@ -49,6 +51,32 @@ var getBlockMenuItems = exports.getBlockMenuItems = function getBlockMenuItems(f
|
|
|
49
51
|
elemAfter: (0, _react.jsx)("div", {
|
|
50
52
|
css: _shortcut.shortcutStyle
|
|
51
53
|
}, (0, _keymaps.tooltip)(_keymaps.dragToMoveDown))
|
|
54
|
+
}, {
|
|
55
|
+
content: formatMessage(_messages.blockControlsMessages.moveLeft),
|
|
56
|
+
elemBefore: (0, _react.jsx)(_arrowLeft.default, {
|
|
57
|
+
label: ""
|
|
58
|
+
}),
|
|
59
|
+
value: {
|
|
60
|
+
name: 'moveLeft'
|
|
61
|
+
},
|
|
62
|
+
key: 'move_left',
|
|
63
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
64
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
65
|
+
css: _shortcut.shortcutStyle
|
|
66
|
+
}, (0, _keymaps.tooltip)(_keymaps.dragToMoveLeft))
|
|
67
|
+
}, {
|
|
68
|
+
content: formatMessage(_messages.blockControlsMessages.moveRight),
|
|
69
|
+
elemBefore: (0, _react.jsx)(_arrowRight.default, {
|
|
70
|
+
label: ""
|
|
71
|
+
}),
|
|
72
|
+
value: {
|
|
73
|
+
name: 'moveRight'
|
|
74
|
+
},
|
|
75
|
+
key: 'move_right',
|
|
76
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
77
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
78
|
+
css: _shortcut.shortcutStyle
|
|
79
|
+
}, (0, _keymaps.tooltip)(_keymaps.dragToMoveRight))
|
|
52
80
|
}]
|
|
53
81
|
}];
|
|
54
82
|
};
|
|
@@ -620,6 +620,11 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
620
620
|
description: formatMessage(_messages.blockControlsMessages.dragToMove)
|
|
621
621
|
}];
|
|
622
622
|
}
|
|
623
|
+
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
624
|
+
helpDescriptors = [{
|
|
625
|
+
description: formatMessage(_messages.blockControlsMessages.dragToMove)
|
|
626
|
+
}];
|
|
627
|
+
}
|
|
623
628
|
var message = helpDescriptors.map(function (descriptor) {
|
|
624
629
|
return descriptor.keymap ? [descriptor.description, (0, _keymaps.getAriaKeyshortcuts)(descriptor.keymap)] : [descriptor.description];
|
|
625
630
|
}).join('. ');
|
|
@@ -665,6 +670,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
665
670
|
helpDescriptors: helpDescriptors
|
|
666
671
|
}),
|
|
667
672
|
ignoreTooltipPointerEvents: true,
|
|
673
|
+
position: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? 'top' : undefined,
|
|
668
674
|
onShow: function onShow() {
|
|
669
675
|
var _api$accessibilityUti;
|
|
670
676
|
api === null || api === void 0 || (_api$accessibilityUti = api.accessibilityUtils) === null || _api$accessibilityUti === void 0 || _api$accessibilityUti.actions.ariaNotify(message, {
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
|
-
import { dragToMoveDown, dragToMoveUp, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
9
|
+
import { dragToMoveDown, dragToMoveLeft, dragToMoveRight, dragToMoveUp, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
10
10
|
import { blockControlsMessages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
12
12
|
import ArrowDownIcon from '@atlaskit/icon/core/arrow-down';
|
|
13
|
+
import ArrowLeftIcon from '@atlaskit/icon/core/arrow-left';
|
|
14
|
+
import ArrowRightnIcon from '@atlaskit/icon/core/arrow-right';
|
|
13
15
|
import ArrowUpIcon from '@atlaskit/icon/core/arrow-up';
|
|
14
16
|
import { moveNodeViaShortcut } from '../editor-commands/move-node';
|
|
15
17
|
import { DIRECTION } from '../pm-plugins/utils/consts';
|
|
@@ -41,6 +43,32 @@ export const getBlockMenuItems = formatMessage => {
|
|
|
41
43
|
elemAfter: jsx("div", {
|
|
42
44
|
css: shortcutStyle
|
|
43
45
|
}, tooltip(dragToMoveDown))
|
|
46
|
+
}, {
|
|
47
|
+
content: formatMessage(blockControlsMessages.moveLeft),
|
|
48
|
+
elemBefore: jsx(ArrowLeftIcon, {
|
|
49
|
+
label: ""
|
|
50
|
+
}),
|
|
51
|
+
value: {
|
|
52
|
+
name: 'moveLeft'
|
|
53
|
+
},
|
|
54
|
+
key: 'move_left',
|
|
55
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
56
|
+
elemAfter: jsx("div", {
|
|
57
|
+
css: shortcutStyle
|
|
58
|
+
}, tooltip(dragToMoveLeft))
|
|
59
|
+
}, {
|
|
60
|
+
content: formatMessage(blockControlsMessages.moveRight),
|
|
61
|
+
elemBefore: jsx(ArrowRightnIcon, {
|
|
62
|
+
label: ""
|
|
63
|
+
}),
|
|
64
|
+
value: {
|
|
65
|
+
name: 'moveRight'
|
|
66
|
+
},
|
|
67
|
+
key: 'move_right',
|
|
68
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
69
|
+
elemAfter: jsx("div", {
|
|
70
|
+
css: shortcutStyle
|
|
71
|
+
}, tooltip(dragToMoveRight))
|
|
44
72
|
}]
|
|
45
73
|
}];
|
|
46
74
|
};
|
|
@@ -604,6 +604,11 @@ export const DragHandle = ({
|
|
|
604
604
|
description: formatMessage(blockControlsMessages.dragToMove)
|
|
605
605
|
}];
|
|
606
606
|
}
|
|
607
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
608
|
+
helpDescriptors = [{
|
|
609
|
+
description: formatMessage(blockControlsMessages.dragToMove)
|
|
610
|
+
}];
|
|
611
|
+
}
|
|
607
612
|
const message = helpDescriptors.map(descriptor => {
|
|
608
613
|
return descriptor.keymap ? [descriptor.description, getAriaKeyshortcuts(descriptor.keymap)] : [descriptor.description];
|
|
609
614
|
}).join('. ');
|
|
@@ -646,6 +651,7 @@ export const DragHandle = ({
|
|
|
646
651
|
helpDescriptors: helpDescriptors
|
|
647
652
|
}),
|
|
648
653
|
ignoreTooltipPointerEvents: true,
|
|
654
|
+
position: editorExperiment('platform_editor_controls', 'variant1') ? 'top' : undefined,
|
|
649
655
|
onShow: () => {
|
|
650
656
|
var _api$accessibilityUti;
|
|
651
657
|
api === null || api === void 0 ? void 0 : (_api$accessibilityUti = api.accessibilityUtils) === null || _api$accessibilityUti === void 0 ? void 0 : _api$accessibilityUti.actions.ariaNotify(message, {
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
|
-
import { dragToMoveDown, dragToMoveUp, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
9
|
+
import { dragToMoveDown, dragToMoveLeft, dragToMoveRight, dragToMoveUp, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
10
10
|
import { blockControlsMessages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
12
12
|
import ArrowDownIcon from '@atlaskit/icon/core/arrow-down';
|
|
13
|
+
import ArrowLeftIcon from '@atlaskit/icon/core/arrow-left';
|
|
14
|
+
import ArrowRightnIcon from '@atlaskit/icon/core/arrow-right';
|
|
13
15
|
import ArrowUpIcon from '@atlaskit/icon/core/arrow-up';
|
|
14
16
|
import { moveNodeViaShortcut } from '../editor-commands/move-node';
|
|
15
17
|
import { DIRECTION } from '../pm-plugins/utils/consts';
|
|
@@ -41,6 +43,32 @@ export var getBlockMenuItems = function getBlockMenuItems(formatMessage) {
|
|
|
41
43
|
elemAfter: jsx("div", {
|
|
42
44
|
css: shortcutStyle
|
|
43
45
|
}, tooltip(dragToMoveDown))
|
|
46
|
+
}, {
|
|
47
|
+
content: formatMessage(blockControlsMessages.moveLeft),
|
|
48
|
+
elemBefore: jsx(ArrowLeftIcon, {
|
|
49
|
+
label: ""
|
|
50
|
+
}),
|
|
51
|
+
value: {
|
|
52
|
+
name: 'moveLeft'
|
|
53
|
+
},
|
|
54
|
+
key: 'move_left',
|
|
55
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
56
|
+
elemAfter: jsx("div", {
|
|
57
|
+
css: shortcutStyle
|
|
58
|
+
}, tooltip(dragToMoveLeft))
|
|
59
|
+
}, {
|
|
60
|
+
content: formatMessage(blockControlsMessages.moveRight),
|
|
61
|
+
elemBefore: jsx(ArrowRightnIcon, {
|
|
62
|
+
label: ""
|
|
63
|
+
}),
|
|
64
|
+
value: {
|
|
65
|
+
name: 'moveRight'
|
|
66
|
+
},
|
|
67
|
+
key: 'move_right',
|
|
68
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
69
|
+
elemAfter: jsx("div", {
|
|
70
|
+
css: shortcutStyle
|
|
71
|
+
}, tooltip(dragToMoveRight))
|
|
44
72
|
}]
|
|
45
73
|
}];
|
|
46
74
|
};
|
|
@@ -615,6 +615,11 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
615
615
|
description: formatMessage(blockControlsMessages.dragToMove)
|
|
616
616
|
}];
|
|
617
617
|
}
|
|
618
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
619
|
+
helpDescriptors = [{
|
|
620
|
+
description: formatMessage(blockControlsMessages.dragToMove)
|
|
621
|
+
}];
|
|
622
|
+
}
|
|
618
623
|
var message = helpDescriptors.map(function (descriptor) {
|
|
619
624
|
return descriptor.keymap ? [descriptor.description, getAriaKeyshortcuts(descriptor.keymap)] : [descriptor.description];
|
|
620
625
|
}).join('. ');
|
|
@@ -660,6 +665,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
660
665
|
helpDescriptors: helpDescriptors
|
|
661
666
|
}),
|
|
662
667
|
ignoreTooltipPointerEvents: true,
|
|
668
|
+
position: editorExperiment('platform_editor_controls', 'variant1') ? 'top' : undefined,
|
|
663
669
|
onShow: function onShow() {
|
|
664
670
|
var _api$accessibilityUti;
|
|
665
671
|
api === null || api === void 0 || (_api$accessibilityUti = api.accessibilityUtils) === null || _api$accessibilityUti === void 0 || _api$accessibilityUti.actions.ariaNotify(message, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.9",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/primitives": "^14.1.0",
|
|
53
53
|
"@atlaskit/theme": "^17.0.0",
|
|
54
54
|
"@atlaskit/tmp-editor-statsig": "^3.3.0",
|
|
55
|
-
"@atlaskit/tokens": "^4.
|
|
55
|
+
"@atlaskit/tokens": "^4.3.0",
|
|
56
56
|
"@atlaskit/tooltip": "^20.0.0",
|
|
57
57
|
"@babel/runtime": "^7.0.0",
|
|
58
58
|
"@emotion/react": "^11.7.1",
|