@atlaskit/editor-plugin-block-controls 34.0.1 → 34.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 +15 -0
- package/dist/cjs/ui/block-controls-surface-drag-handle.js +2 -2
- package/dist/cjs/ui/{drag-handle-nested-icon.js → drag-handle-narrow-icon.js} +3 -3
- package/dist/cjs/ui/drag-handle.js +3 -2
- package/dist/es2019/ui/block-controls-surface-drag-handle.js +2 -2
- package/dist/es2019/ui/{drag-handle-nested-icon.js → drag-handle-narrow-icon.js} +2 -2
- package/dist/es2019/ui/drag-handle.js +3 -2
- package/dist/esm/ui/block-controls-surface-drag-handle.js +2 -2
- package/dist/esm/ui/{drag-handle-nested-icon.js → drag-handle-narrow-icon.js} +2 -2
- package/dist/esm/ui/drag-handle.js +3 -2
- package/dist/types/ui/{drag-handle-nested-icon.d.ts → drag-handle-narrow-icon.d.ts} +2 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 34.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e96273d9ce7cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e96273d9ce7cc) -
|
|
8
|
+
Use the existing three-dot block menu icon for all block handles in the
|
|
9
|
+
platform_editor_block_menu_three_dot_icon experiment.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 34.0.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 34.0.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -28,7 +28,7 @@ var _collapsedHeading = require("../pm-plugins/utils/collapsed-heading");
|
|
|
28
28
|
var _expandAndUpdateSelection = require("../pm-plugins/utils/expand-and-update-selection");
|
|
29
29
|
var _getSelection = require("../pm-plugins/utils/getSelection");
|
|
30
30
|
var _blockControlsSurfaceDragHandleUtils = require("./block-controls-surface-drag-handle-utils");
|
|
31
|
-
var
|
|
31
|
+
var _dragHandleNarrowIcon = require("./drag-handle-narrow-icon");
|
|
32
32
|
var _shouldUseNestedDragHandleIcon = require("./should-use-nested-drag-handle-icon");
|
|
33
33
|
var _surfaceEditorViewContext = require("./surface-editor-view-context");
|
|
34
34
|
var _useBlockControlsSurfaceDragSource = require("./use-block-controls-surface-drag-source");
|
|
@@ -284,7 +284,7 @@ var BlockControlsSurfaceDragHandle = exports.BlockControlsSurfaceDragHandle = fu
|
|
|
284
284
|
}, /*#__PURE__*/React.createElement("span", {
|
|
285
285
|
onDragStart: handleIconDragStart,
|
|
286
286
|
className: (0, _runtime.ax)([dragHandleStyles.iconWrapper])
|
|
287
|
-
}, (0, _shouldUseNestedDragHandleIcon.shouldUseNestedDragHandleIcon)(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(
|
|
287
|
+
}, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_block_menu_three_dot_icon') || (0, _shouldUseNestedDragHandleIcon.shouldUseNestedDragHandleIcon)(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(_dragHandleNarrowIcon.DragHandleNarrowIcon, null) : /*#__PURE__*/React.createElement(_dragHandleVertical.default, {
|
|
288
288
|
label: "",
|
|
289
289
|
size: "small",
|
|
290
290
|
spacing: "spacious"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.DragHandleNarrowIcon = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
/** @jsxRuntime classic */
|
|
9
9
|
/**
|
|
@@ -29,11 +29,11 @@ var svgStyles = (0, _react.css)({
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Custom 3-dot vertical drag handle icon
|
|
32
|
+
* Custom 3-dot vertical drag handle icon.
|
|
33
33
|
* Similar to DragHandleVerticalIcon but with only 3 dots instead of 6.
|
|
34
34
|
* Hardcoded to medium size with spacious spacing.
|
|
35
35
|
*/
|
|
36
|
-
var
|
|
36
|
+
var DragHandleNarrowIcon = exports.DragHandleNarrowIcon = function DragHandleNarrowIcon() {
|
|
37
37
|
return (0, _react.jsx)("span", {
|
|
38
38
|
"aria-hidden": true,
|
|
39
39
|
css: spanStyles
|
|
@@ -21,6 +21,7 @@ var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useShar
|
|
|
21
21
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
22
22
|
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
23
23
|
var _dragHandleVertical = _interopRequireDefault(require("@atlaskit/icon/core/drag-handle-vertical"));
|
|
24
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
24
25
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
25
26
|
var _elementAdapter = require("@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter");
|
|
26
27
|
var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/utils/set-custom-native-drag-preview");
|
|
@@ -38,7 +39,7 @@ var _dragHandlePositions = require("../pm-plugins/utils/drag-handle-positions");
|
|
|
38
39
|
var _expandAndUpdateSelection = require("../pm-plugins/utils/expand-and-update-selection");
|
|
39
40
|
var _getSelection = require("../pm-plugins/utils/getSelection");
|
|
40
41
|
var _consts = require("./consts");
|
|
41
|
-
var
|
|
42
|
+
var _dragHandleNarrowIcon = require("./drag-handle-narrow-icon");
|
|
42
43
|
var _dragPreview = require("./drag-preview");
|
|
43
44
|
var _shouldUseNestedDragHandleIcon = require("./should-use-nested-drag-handle-icon");
|
|
44
45
|
var _anchorName = require("./utils/anchor-name");
|
|
@@ -940,7 +941,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref2) {
|
|
|
940
941
|
// eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
|
|
941
942
|
,
|
|
942
943
|
onDragStart: handleIconDragStart
|
|
943
|
-
}, (0, _shouldUseNestedDragHandleIcon.shouldUseNestedDragHandleIcon)(isTopLevelNodeValue, isLayoutColumn) ? (0, _react2.jsx)(
|
|
944
|
+
}, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_block_menu_three_dot_icon') || (0, _shouldUseNestedDragHandleIcon.shouldUseNestedDragHandleIcon)(isTopLevelNodeValue, isLayoutColumn) ? (0, _react2.jsx)(_dragHandleNarrowIcon.DragHandleNarrowIcon, null) : (0, _react2.jsx)(_dragHandleVertical.default, {
|
|
944
945
|
spacing: "spacious",
|
|
945
946
|
label: "",
|
|
946
947
|
size: "small"
|
|
@@ -22,7 +22,7 @@ import { prepareCollapsedHeadingSelection } from '../pm-plugins/utils/collapsed-
|
|
|
22
22
|
import { expandAndUpdateSelection } from '../pm-plugins/utils/expand-and-update-selection';
|
|
23
23
|
import { isHandleCorrelatedToSelection } from '../pm-plugins/utils/getSelection';
|
|
24
24
|
import { buildLayoutColumnMenuMeta } from './block-controls-surface-drag-handle-utils';
|
|
25
|
-
import {
|
|
25
|
+
import { DragHandleNarrowIcon } from './drag-handle-narrow-icon';
|
|
26
26
|
import { shouldUseNestedDragHandleIcon } from './should-use-nested-drag-handle-icon';
|
|
27
27
|
import { useSurfaceEditorView } from './surface-editor-view-context';
|
|
28
28
|
import { useBlockControlsSurfaceDragSource } from './use-block-controls-surface-drag-source';
|
|
@@ -270,7 +270,7 @@ export const BlockControlsSurfaceDragHandle = ({
|
|
|
270
270
|
}, /*#__PURE__*/React.createElement("span", {
|
|
271
271
|
onDragStart: handleIconDragStart,
|
|
272
272
|
className: ax([dragHandleStyles.iconWrapper])
|
|
273
|
-
}, shouldUseNestedDragHandleIcon(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(
|
|
273
|
+
}, isExperimentEnabled('platform_editor_block_menu_three_dot_icon') || shouldUseNestedDragHandleIcon(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(DragHandleNarrowIcon, null) : /*#__PURE__*/React.createElement(DragHandleVerticalIcon, {
|
|
274
274
|
label: "",
|
|
275
275
|
size: "small",
|
|
276
276
|
spacing: "spacious"
|
|
@@ -22,11 +22,11 @@ const svgStyles = css({
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Custom 3-dot vertical drag handle icon
|
|
25
|
+
* Custom 3-dot vertical drag handle icon.
|
|
26
26
|
* Similar to DragHandleVerticalIcon but with only 3 dots instead of 6.
|
|
27
27
|
* Hardcoded to medium size with spacious spacing.
|
|
28
28
|
*/
|
|
29
|
-
export const
|
|
29
|
+
export const DragHandleNarrowIcon = () => {
|
|
30
30
|
return jsx("span", {
|
|
31
31
|
"aria-hidden": true,
|
|
32
32
|
css: spanStyles
|
|
@@ -18,6 +18,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSha
|
|
|
18
18
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
19
19
|
import { akEditorTableToolbarSize, relativeSizeToBaseFontSize } from '@atlaskit/editor-shared-styles/constants';
|
|
20
20
|
import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
|
|
21
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
21
22
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
23
|
import { draggable } from '@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter';
|
|
23
24
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/utils/set-custom-native-drag-preview';
|
|
@@ -37,7 +38,7 @@ import { getControlBottomCSSValue, getControlHeightCSSValue, getLeftPosition, ge
|
|
|
37
38
|
import { expandAndUpdateSelection } from '../pm-plugins/utils/expand-and-update-selection';
|
|
38
39
|
import { isHandleCorrelatedToSelection, selectNode } from '../pm-plugins/utils/getSelection';
|
|
39
40
|
import { ACTIVE_DRAG_HANDLE_ATTR, ACTIVE_DRAG_HANDLE_FALLBACK_ANCHOR_NAME, DRAG_HANDLE_BORDER_RADIUS, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_ZINDEX, dragHandleGap, nodeMargins, spacingBetweenNodesForPreview, STICKY_CONTROLS_TOP_MARGIN, STICKY_CONTROLS_TOP_MARGIN_FOR_STICKY_HEADER, topPositionAdjustment } from './consts';
|
|
40
|
-
import {
|
|
41
|
+
import { DragHandleNarrowIcon } from './drag-handle-narrow-icon';
|
|
41
42
|
import { dragPreview } from './drag-preview';
|
|
42
43
|
import { shouldUseNestedDragHandleIcon } from './should-use-nested-drag-handle-icon';
|
|
43
44
|
import { refreshAnchorName } from './utils/anchor-name';
|
|
@@ -921,7 +922,7 @@ export const DragHandle = ({
|
|
|
921
922
|
// eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
|
|
922
923
|
,
|
|
923
924
|
onDragStart: handleIconDragStart
|
|
924
|
-
}, shouldUseNestedDragHandleIcon(isTopLevelNodeValue, isLayoutColumn) ? jsx(
|
|
925
|
+
}, isExperimentEnabled('platform_editor_block_menu_three_dot_icon') || shouldUseNestedDragHandleIcon(isTopLevelNodeValue, isLayoutColumn) ? jsx(DragHandleNarrowIcon, null) : jsx(DragHandleVerticalIcon, {
|
|
925
926
|
spacing: "spacious",
|
|
926
927
|
label: "",
|
|
927
928
|
size: "small"
|
|
@@ -23,7 +23,7 @@ import { prepareCollapsedHeadingSelection } from '../pm-plugins/utils/collapsed-
|
|
|
23
23
|
import { expandAndUpdateSelection } from '../pm-plugins/utils/expand-and-update-selection';
|
|
24
24
|
import { isHandleCorrelatedToSelection } from '../pm-plugins/utils/getSelection';
|
|
25
25
|
import { buildLayoutColumnMenuMeta } from './block-controls-surface-drag-handle-utils';
|
|
26
|
-
import {
|
|
26
|
+
import { DragHandleNarrowIcon } from './drag-handle-narrow-icon';
|
|
27
27
|
import { shouldUseNestedDragHandleIcon } from './should-use-nested-drag-handle-icon';
|
|
28
28
|
import { useSurfaceEditorView } from './surface-editor-view-context';
|
|
29
29
|
import { useBlockControlsSurfaceDragSource } from './use-block-controls-surface-drag-source';
|
|
@@ -278,7 +278,7 @@ export var BlockControlsSurfaceDragHandle = function BlockControlsSurfaceDragHan
|
|
|
278
278
|
}, /*#__PURE__*/React.createElement("span", {
|
|
279
279
|
onDragStart: handleIconDragStart,
|
|
280
280
|
className: ax([dragHandleStyles.iconWrapper])
|
|
281
|
-
}, shouldUseNestedDragHandleIcon(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(
|
|
281
|
+
}, isExperimentEnabled('platform_editor_block_menu_three_dot_icon') || shouldUseNestedDragHandleIcon(Boolean(isTopLevelNode), isLayoutColumn) ? /*#__PURE__*/React.createElement(DragHandleNarrowIcon, null) : /*#__PURE__*/React.createElement(DragHandleVerticalIcon, {
|
|
282
282
|
label: "",
|
|
283
283
|
size: "small",
|
|
284
284
|
spacing: "spacious"
|
|
@@ -22,11 +22,11 @@ var svgStyles = css({
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Custom 3-dot vertical drag handle icon
|
|
25
|
+
* Custom 3-dot vertical drag handle icon.
|
|
26
26
|
* Similar to DragHandleVerticalIcon but with only 3 dots instead of 6.
|
|
27
27
|
* Hardcoded to medium size with spacious spacing.
|
|
28
28
|
*/
|
|
29
|
-
export var
|
|
29
|
+
export var DragHandleNarrowIcon = function DragHandleNarrowIcon() {
|
|
30
30
|
return jsx("span", {
|
|
31
31
|
"aria-hidden": true,
|
|
32
32
|
css: spanStyles
|
|
@@ -22,6 +22,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSha
|
|
|
22
22
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
23
23
|
import { akEditorTableToolbarSize, relativeSizeToBaseFontSize } from '@atlaskit/editor-shared-styles/constants';
|
|
24
24
|
import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
|
|
25
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
25
26
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
26
27
|
import { draggable } from '@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter';
|
|
27
28
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/utils/set-custom-native-drag-preview';
|
|
@@ -41,7 +42,7 @@ import { getControlBottomCSSValue, getControlHeightCSSValue, getLeftPosition, ge
|
|
|
41
42
|
import { expandAndUpdateSelection } from '../pm-plugins/utils/expand-and-update-selection';
|
|
42
43
|
import { isHandleCorrelatedToSelection, selectNode } from '../pm-plugins/utils/getSelection';
|
|
43
44
|
import { ACTIVE_DRAG_HANDLE_ATTR, ACTIVE_DRAG_HANDLE_FALLBACK_ANCHOR_NAME, DRAG_HANDLE_BORDER_RADIUS, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_ZINDEX, dragHandleGap, nodeMargins, spacingBetweenNodesForPreview, STICKY_CONTROLS_TOP_MARGIN, STICKY_CONTROLS_TOP_MARGIN_FOR_STICKY_HEADER, topPositionAdjustment } from './consts';
|
|
44
|
-
import {
|
|
45
|
+
import { DragHandleNarrowIcon } from './drag-handle-narrow-icon';
|
|
45
46
|
import { dragPreview } from './drag-preview';
|
|
46
47
|
import { shouldUseNestedDragHandleIcon } from './should-use-nested-drag-handle-icon';
|
|
47
48
|
import { refreshAnchorName } from './utils/anchor-name';
|
|
@@ -936,7 +937,7 @@ export var DragHandle = function DragHandle(_ref2) {
|
|
|
936
937
|
// eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
|
|
937
938
|
,
|
|
938
939
|
onDragStart: handleIconDragStart
|
|
939
|
-
}, shouldUseNestedDragHandleIcon(isTopLevelNodeValue, isLayoutColumn) ? jsx(
|
|
940
|
+
}, isExperimentEnabled('platform_editor_block_menu_three_dot_icon') || shouldUseNestedDragHandleIcon(isTopLevelNodeValue, isLayoutColumn) ? jsx(DragHandleNarrowIcon, null) : jsx(DragHandleVerticalIcon, {
|
|
940
941
|
spacing: "spacious",
|
|
941
942
|
label: "",
|
|
942
943
|
size: "small"
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
/**
|
|
8
|
-
* Custom 3-dot vertical drag handle icon
|
|
8
|
+
* Custom 3-dot vertical drag handle icon.
|
|
9
9
|
* Similar to DragHandleVerticalIcon but with only 3 dots instead of 6.
|
|
10
10
|
* Hardcoded to medium size with spacious spacing.
|
|
11
11
|
*/
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const DragHandleNarrowIcon: () => jsx.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "34.0.
|
|
3
|
+
"version": "34.0.3",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
|
|
58
58
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
|
|
59
59
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^4.3.0",
|
|
60
|
-
"@atlaskit/primitives": "^22.
|
|
60
|
+
"@atlaskit/primitives": "^22.8.0",
|
|
61
61
|
"@atlaskit/section-message": "^10.3.0",
|
|
62
62
|
"@atlaskit/theme": "^28.2.0",
|
|
63
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
64
|
-
"@atlaskit/tokens": "^20.
|
|
63
|
+
"@atlaskit/tmp-editor-statsig": "^266.0.0",
|
|
64
|
+
"@atlaskit/tokens": "^20.14.0",
|
|
65
65
|
"@atlaskit/tooltip": "^24.4.0",
|
|
66
66
|
"@babel/runtime": "^7.0.0",
|
|
67
67
|
"@compiled/react": "^1.0.2",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^11.1.1"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^137.
|
|
75
|
+
"@atlaskit/editor-common": "^137.2.0",
|
|
76
76
|
"react": "^18.2.0 || ^19.2.0",
|
|
77
77
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
78
78
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@af/editor-examples-helpers": "workspace:^",
|
|
100
|
-
"@atlaskit/editor-common": "^137.
|
|
100
|
+
"@atlaskit/editor-common": "^137.2.0",
|
|
101
101
|
"@atlaskit/editor-plugins": "^17.0.0",
|
|
102
102
|
"@atlaskit/synchrony-test-helpers": "workspace:^",
|
|
103
103
|
"@atlassian/structured-docs-types": "workspace:^",
|