@atlaskit/editor-plugin-selection-extension 10.3.10 → 10.3.12
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 +16 -0
- package/dist/cjs/ui/menu/SelectionExtensionDropdownItem.compiled.css +9 -1
- package/dist/cjs/ui/menu/SelectionExtensionDropdownItem.js +44 -2
- package/dist/cjs/ui/menu/SelectionExtensionNestedDropdownMenu.js +4 -1
- package/dist/cjs/ui/toolbar-components/MenuItem.js +1 -2
- package/dist/es2019/ui/menu/SelectionExtensionDropdownItem.compiled.css +9 -1
- package/dist/es2019/ui/menu/SelectionExtensionDropdownItem.js +39 -3
- package/dist/es2019/ui/menu/SelectionExtensionNestedDropdownMenu.js +4 -1
- package/dist/es2019/ui/toolbar-components/MenuItem.js +1 -2
- package/dist/esm/ui/menu/SelectionExtensionDropdownItem.compiled.css +9 -1
- package/dist/esm/ui/menu/SelectionExtensionDropdownItem.js +43 -3
- package/dist/esm/ui/menu/SelectionExtensionNestedDropdownMenu.js +4 -1
- package/dist/esm/ui/toolbar-components/MenuItem.js +1 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-extension
|
|
2
2
|
|
|
3
|
+
## 10.3.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 10.3.11
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`25ad5c762c280`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/25ad5c762c280) -
|
|
14
|
+
[ux] Add truncation on the extention label in block menu
|
|
15
|
+
- [`ea60429849f59`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ea60429849f59) -
|
|
16
|
+
Clean up platform_editor_selection_extension_lozenge fg
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 10.3.10
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
.
|
|
1
|
+
._18m915vq{overflow-y:hidden}
|
|
2
|
+
._18u01b66{margin-left:var(--ds-space-050,4px)}
|
|
3
|
+
._1bto1l2s{text-overflow:ellipsis}
|
|
4
|
+
._1e0c1txw{display:flex}
|
|
5
|
+
._1o9zidpf{flex-shrink:0}
|
|
6
|
+
._1reo15vq{overflow-x:hidden}
|
|
7
|
+
._1ul9idpf{min-width:0}
|
|
8
|
+
._4cvr1h6o{align-items:center}
|
|
9
|
+
._o5721q9c{white-space:nowrap}
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
6
|
Object.defineProperty(exports, "__esModule", {
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.SelectionExtensionDropdownItem = void 0;
|
|
9
10
|
require("./SelectionExtensionDropdownItem.compiled.css");
|
|
10
11
|
var _runtime = require("@compiled/react/runtime");
|
|
11
|
-
var
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
14
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
15
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
14
16
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
@@ -18,8 +20,11 @@ var _main = require("../../pm-plugins/main");
|
|
|
18
20
|
var _utils = require("../../pm-plugins/utils");
|
|
19
21
|
var _types = require("../../types");
|
|
20
22
|
var _SelectionExtensionComponentContext = require("../SelectionExtensionComponentContext");
|
|
23
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
21
24
|
var styles = {
|
|
22
|
-
|
|
25
|
+
contentWrapper: "_1e0c1txw _4cvr1h6o _1ul9idpf",
|
|
26
|
+
label: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c _1ul9idpf",
|
|
27
|
+
lozenge: "_18u01b66 _1o9zidpf"
|
|
23
28
|
};
|
|
24
29
|
var SelectionExtensionDropdownItem = exports.SelectionExtensionDropdownItem = function SelectionExtensionDropdownItem(_ref) {
|
|
25
30
|
var dropdownItem = _ref.dropdownItem;
|
|
@@ -85,6 +90,43 @@ var SelectionExtensionDropdownItem = exports.SelectionExtensionDropdownItem = fu
|
|
|
85
90
|
}
|
|
86
91
|
});
|
|
87
92
|
};
|
|
93
|
+
var labelRef = (0, _react.useRef)(null);
|
|
94
|
+
var _useState = (0, _react.useState)(false),
|
|
95
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
96
|
+
isTruncated = _useState2[0],
|
|
97
|
+
setIsTruncated = _useState2[1];
|
|
98
|
+
var handleMouseEnter = (0, _react.useCallback)(function () {
|
|
99
|
+
var el = labelRef.current;
|
|
100
|
+
if (el) {
|
|
101
|
+
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
102
|
+
}
|
|
103
|
+
}, []);
|
|
104
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_2')) {
|
|
105
|
+
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
|
|
106
|
+
content: isTruncated ? dropdownItem.label : null,
|
|
107
|
+
position: "top"
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
109
|
+
elemBefore: IconComponent ? /*#__PURE__*/_react.default.createElement(IconComponent, {
|
|
110
|
+
size: extensionLocation === 'inline-toolbar' && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_1') ? 'small' : undefined,
|
|
111
|
+
label: ""
|
|
112
|
+
}) : undefined,
|
|
113
|
+
onClick: handleClick,
|
|
114
|
+
isDisabled: dropdownItem.isDisabled
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
116
|
+
as: "span",
|
|
117
|
+
xcss: styles.contentWrapper,
|
|
118
|
+
onMouseOver: handleMouseEnter
|
|
119
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
120
|
+
as: "span",
|
|
121
|
+
xcss: styles.label,
|
|
122
|
+
ref: labelRef
|
|
123
|
+
}, dropdownItem.label), dropdownItem.lozenge ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
124
|
+
as: "span",
|
|
125
|
+
xcss: styles.lozenge
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
127
|
+
appearance: "new"
|
|
128
|
+
}, dropdownItem.lozenge.label)) : undefined)));
|
|
129
|
+
}
|
|
88
130
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
89
131
|
elemBefore: IconComponent ? /*#__PURE__*/_react.default.createElement(IconComponent, {
|
|
90
132
|
size: extensionLocation === 'inline-toolbar' && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_1') ? 'small' : undefined,
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
11
11
|
var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
var _SelectionExtensionComponentContext = require("../SelectionExtensionComponentContext");
|
|
13
14
|
var _SelectionExtensionDropdownItem = require("./SelectionExtensionDropdownItem");
|
|
14
15
|
var ChildItems = function ChildItems(_ref) {
|
|
@@ -54,7 +55,9 @@ var SelectionExtensionNestedDropdownMenu = exports.SelectionExtensionNestedDropd
|
|
|
54
55
|
label: ""
|
|
55
56
|
}),
|
|
56
57
|
onClick: handleClick,
|
|
57
|
-
dropdownTestId: "editor-selection-extension-menu"
|
|
58
|
+
dropdownTestId: "editor-selection-extension-menu",
|
|
59
|
+
shouldTitleWrap: (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_2') ? false : undefined,
|
|
60
|
+
tooltipContent: (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_2') ? nestedDropdownMenu.label : undefined
|
|
58
61
|
}, /*#__PURE__*/_react.default.createElement(ChildItems, {
|
|
59
62
|
nestedDropdownMenu: nestedDropdownMenu
|
|
60
63
|
}));
|
|
@@ -9,7 +9,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
10
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
11
11
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
14
13
|
var _main = require("../../pm-plugins/main");
|
|
15
14
|
var _utils = require("../../pm-plugins/utils");
|
|
@@ -56,7 +55,7 @@ var MenuItem = exports.MenuItem = function MenuItem(_ref) {
|
|
|
56
55
|
}),
|
|
57
56
|
onClick: onClickHandle(extension),
|
|
58
57
|
isDisabled: extension.isDisabled
|
|
59
|
-
}, extension.label, extension.lozenge &&
|
|
58
|
+
}, extension.label, extension.lozenge && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
60
59
|
as: "span",
|
|
61
60
|
paddingInline: "space.100"
|
|
62
61
|
}, /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
.
|
|
1
|
+
._18m915vq{overflow-y:hidden}
|
|
2
|
+
._18u01b66{margin-left:var(--ds-space-050,4px)}
|
|
3
|
+
._1bto1l2s{text-overflow:ellipsis}
|
|
4
|
+
._1e0c1txw{display:flex}
|
|
5
|
+
._1o9zidpf{flex-shrink:0}
|
|
6
|
+
._1reo15vq{overflow-x:hidden}
|
|
7
|
+
._1ul9idpf{min-width:0}
|
|
8
|
+
._4cvr1h6o{align-items:center}
|
|
9
|
+
._o5721q9c{white-space:nowrap}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* SelectionExtensionDropdownItem.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./SelectionExtensionDropdownItem.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
6
|
+
import { ToolbarDropdownItem, ToolbarTooltip } from '@atlaskit/editor-toolbar';
|
|
7
7
|
import Lozenge from '@atlaskit/lozenge';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
@@ -12,7 +12,9 @@ import { getSelectionAdfInfoNew, getSelectionTextInfoNew } from '../../pm-plugin
|
|
|
12
12
|
import { SelectionExtensionActionTypes } from '../../types';
|
|
13
13
|
import { useSelectionExtensionComponentContext } from '../SelectionExtensionComponentContext';
|
|
14
14
|
const styles = {
|
|
15
|
-
|
|
15
|
+
contentWrapper: "_1e0c1txw _4cvr1h6o _1ul9idpf",
|
|
16
|
+
label: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c _1ul9idpf",
|
|
17
|
+
lozenge: "_18u01b66 _1o9zidpf"
|
|
16
18
|
};
|
|
17
19
|
export const SelectionExtensionDropdownItem = ({
|
|
18
20
|
dropdownItem
|
|
@@ -82,6 +84,40 @@ export const SelectionExtensionDropdownItem = ({
|
|
|
82
84
|
}
|
|
83
85
|
});
|
|
84
86
|
};
|
|
87
|
+
const labelRef = useRef(null);
|
|
88
|
+
const [isTruncated, setIsTruncated] = useState(false);
|
|
89
|
+
const handleMouseEnter = useCallback(() => {
|
|
90
|
+
const el = labelRef.current;
|
|
91
|
+
if (el) {
|
|
92
|
+
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
93
|
+
}
|
|
94
|
+
}, []);
|
|
95
|
+
if (fg('platform_editor_block_menu_v2_patch_2')) {
|
|
96
|
+
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
97
|
+
content: isTruncated ? dropdownItem.label : null,
|
|
98
|
+
position: "top"
|
|
99
|
+
}, /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
100
|
+
elemBefore: IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
101
|
+
size: extensionLocation === 'inline-toolbar' && fg('platform_editor_block_menu_v2_patch_1') ? 'small' : undefined,
|
|
102
|
+
label: ""
|
|
103
|
+
}) : undefined,
|
|
104
|
+
onClick: handleClick,
|
|
105
|
+
isDisabled: dropdownItem.isDisabled
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
107
|
+
as: "span",
|
|
108
|
+
xcss: styles.contentWrapper,
|
|
109
|
+
onMouseOver: handleMouseEnter
|
|
110
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
111
|
+
as: "span",
|
|
112
|
+
xcss: styles.label,
|
|
113
|
+
ref: labelRef
|
|
114
|
+
}, dropdownItem.label), dropdownItem.lozenge ? /*#__PURE__*/React.createElement(Box, {
|
|
115
|
+
as: "span",
|
|
116
|
+
xcss: styles.lozenge
|
|
117
|
+
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
118
|
+
appearance: "new"
|
|
119
|
+
}, dropdownItem.lozenge.label)) : undefined)));
|
|
120
|
+
}
|
|
85
121
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
86
122
|
elemBefore: IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
87
123
|
size: extensionLocation === 'inline-toolbar' && fg('platform_editor_block_menu_v2_patch_1') ? 'small' : undefined,
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { ToolbarDropdownItemSection, ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
4
4
|
import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { useSelectionExtensionComponentContext } from '../SelectionExtensionComponentContext';
|
|
6
7
|
import { SelectionExtensionDropdownItem } from './SelectionExtensionDropdownItem';
|
|
7
8
|
const ChildItems = ({
|
|
@@ -48,7 +49,9 @@ export const SelectionExtensionNestedDropdownMenu = ({
|
|
|
48
49
|
label: ""
|
|
49
50
|
}),
|
|
50
51
|
onClick: handleClick,
|
|
51
|
-
dropdownTestId: "editor-selection-extension-menu"
|
|
52
|
+
dropdownTestId: "editor-selection-extension-menu",
|
|
53
|
+
shouldTitleWrap: fg('platform_editor_block_menu_v2_patch_2') ? false : undefined,
|
|
54
|
+
tooltipContent: fg('platform_editor_block_menu_v2_patch_2') ? nestedDropdownMenu.label : undefined
|
|
52
55
|
}, /*#__PURE__*/React.createElement(ChildItems, {
|
|
53
56
|
nestedDropdownMenu: nestedDropdownMenu
|
|
54
57
|
}));
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
4
4
|
import Lozenge from '@atlaskit/lozenge';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import { selectionExtensionPluginKey } from '../../pm-plugins/main';
|
|
8
7
|
import { getSelectionAdfInfoNew, getSelectionTextInfo } from '../../pm-plugins/utils';
|
|
@@ -51,7 +50,7 @@ export const MenuItem = ({
|
|
|
51
50
|
}),
|
|
52
51
|
onClick: onClickHandle(extension),
|
|
53
52
|
isDisabled: extension.isDisabled
|
|
54
|
-
}, extension.label, extension.lozenge &&
|
|
53
|
+
}, extension.label, extension.lozenge && /*#__PURE__*/React.createElement(Box, {
|
|
55
54
|
as: "span",
|
|
56
55
|
paddingInline: "space.100"
|
|
57
56
|
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
.
|
|
1
|
+
._18m915vq{overflow-y:hidden}
|
|
2
|
+
._18u01b66{margin-left:var(--ds-space-050,4px)}
|
|
3
|
+
._1bto1l2s{text-overflow:ellipsis}
|
|
4
|
+
._1e0c1txw{display:flex}
|
|
5
|
+
._1o9zidpf{flex-shrink:0}
|
|
6
|
+
._1reo15vq{overflow-x:hidden}
|
|
7
|
+
._1ul9idpf{min-width:0}
|
|
8
|
+
._4cvr1h6o{align-items:center}
|
|
9
|
+
._o5721q9c{white-space:nowrap}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/* SelectionExtensionDropdownItem.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import "./SelectionExtensionDropdownItem.compiled.css";
|
|
3
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React from 'react';
|
|
5
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
5
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
7
|
+
import { ToolbarDropdownItem, ToolbarTooltip } from '@atlaskit/editor-toolbar';
|
|
7
8
|
import Lozenge from '@atlaskit/lozenge';
|
|
8
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
@@ -12,7 +13,9 @@ import { getSelectionAdfInfoNew, getSelectionTextInfoNew } from '../../pm-plugin
|
|
|
12
13
|
import { SelectionExtensionActionTypes } from '../../types';
|
|
13
14
|
import { useSelectionExtensionComponentContext } from '../SelectionExtensionComponentContext';
|
|
14
15
|
var styles = {
|
|
15
|
-
|
|
16
|
+
contentWrapper: "_1e0c1txw _4cvr1h6o _1ul9idpf",
|
|
17
|
+
label: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c _1ul9idpf",
|
|
18
|
+
lozenge: "_18u01b66 _1o9zidpf"
|
|
16
19
|
};
|
|
17
20
|
export var SelectionExtensionDropdownItem = function SelectionExtensionDropdownItem(_ref) {
|
|
18
21
|
var dropdownItem = _ref.dropdownItem;
|
|
@@ -78,6 +81,43 @@ export var SelectionExtensionDropdownItem = function SelectionExtensionDropdownI
|
|
|
78
81
|
}
|
|
79
82
|
});
|
|
80
83
|
};
|
|
84
|
+
var labelRef = useRef(null);
|
|
85
|
+
var _useState = useState(false),
|
|
86
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
87
|
+
isTruncated = _useState2[0],
|
|
88
|
+
setIsTruncated = _useState2[1];
|
|
89
|
+
var handleMouseEnter = useCallback(function () {
|
|
90
|
+
var el = labelRef.current;
|
|
91
|
+
if (el) {
|
|
92
|
+
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
93
|
+
}
|
|
94
|
+
}, []);
|
|
95
|
+
if (fg('platform_editor_block_menu_v2_patch_2')) {
|
|
96
|
+
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
97
|
+
content: isTruncated ? dropdownItem.label : null,
|
|
98
|
+
position: "top"
|
|
99
|
+
}, /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
100
|
+
elemBefore: IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
101
|
+
size: extensionLocation === 'inline-toolbar' && fg('platform_editor_block_menu_v2_patch_1') ? 'small' : undefined,
|
|
102
|
+
label: ""
|
|
103
|
+
}) : undefined,
|
|
104
|
+
onClick: handleClick,
|
|
105
|
+
isDisabled: dropdownItem.isDisabled
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
107
|
+
as: "span",
|
|
108
|
+
xcss: styles.contentWrapper,
|
|
109
|
+
onMouseOver: handleMouseEnter
|
|
110
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
111
|
+
as: "span",
|
|
112
|
+
xcss: styles.label,
|
|
113
|
+
ref: labelRef
|
|
114
|
+
}, dropdownItem.label), dropdownItem.lozenge ? /*#__PURE__*/React.createElement(Box, {
|
|
115
|
+
as: "span",
|
|
116
|
+
xcss: styles.lozenge
|
|
117
|
+
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
118
|
+
appearance: "new"
|
|
119
|
+
}, dropdownItem.lozenge.label)) : undefined)));
|
|
120
|
+
}
|
|
81
121
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
82
122
|
elemBefore: IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
83
123
|
size: extensionLocation === 'inline-toolbar' && fg('platform_editor_block_menu_v2_patch_1') ? 'small' : undefined,
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { ToolbarDropdownItemSection, ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
4
4
|
import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { useSelectionExtensionComponentContext } from '../SelectionExtensionComponentContext';
|
|
6
7
|
import { SelectionExtensionDropdownItem } from './SelectionExtensionDropdownItem';
|
|
7
8
|
var ChildItems = function ChildItems(_ref) {
|
|
@@ -47,7 +48,9 @@ export var SelectionExtensionNestedDropdownMenu = function SelectionExtensionNes
|
|
|
47
48
|
label: ""
|
|
48
49
|
}),
|
|
49
50
|
onClick: handleClick,
|
|
50
|
-
dropdownTestId: "editor-selection-extension-menu"
|
|
51
|
+
dropdownTestId: "editor-selection-extension-menu",
|
|
52
|
+
shouldTitleWrap: fg('platform_editor_block_menu_v2_patch_2') ? false : undefined,
|
|
53
|
+
tooltipContent: fg('platform_editor_block_menu_v2_patch_2') ? nestedDropdownMenu.label : undefined
|
|
51
54
|
}, /*#__PURE__*/React.createElement(ChildItems, {
|
|
52
55
|
nestedDropdownMenu: nestedDropdownMenu
|
|
53
56
|
}));
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
4
4
|
import Lozenge from '@atlaskit/lozenge';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import { selectionExtensionPluginKey } from '../../pm-plugins/main';
|
|
8
7
|
import { getSelectionAdfInfoNew, getSelectionTextInfo } from '../../pm-plugins/utils';
|
|
@@ -49,7 +48,7 @@ export var MenuItem = function MenuItem(_ref) {
|
|
|
49
48
|
}),
|
|
50
49
|
onClick: onClickHandle(extension),
|
|
51
50
|
isDisabled: extension.isDisabled
|
|
52
|
-
}, extension.label, extension.lozenge &&
|
|
51
|
+
}, extension.label, extension.lozenge && /*#__PURE__*/React.createElement(Box, {
|
|
53
52
|
as: "span",
|
|
54
53
|
paddingInline: "space.100"
|
|
55
54
|
}, /*#__PURE__*/React.createElement(Lozenge, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.12",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
49
49
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
50
50
|
"@atlaskit/editor-toolbar": "^0.19.0",
|
|
51
|
-
"@atlaskit/icon": "^
|
|
51
|
+
"@atlaskit/icon": "^31.0.0",
|
|
52
52
|
"@atlaskit/lozenge": "^13.4.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
54
54
|
"@atlaskit/primitives": "^18.0.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^25.0.0",
|
|
56
56
|
"@atlaskit/tokens": "^11.0.0",
|
|
57
57
|
"@babel/runtime": "^7.0.0",
|
|
58
58
|
"lodash": "^4.17.21",
|
|
@@ -110,14 +110,14 @@
|
|
|
110
110
|
"platform_editor_use_preferences_plugin": {
|
|
111
111
|
"type": "boolean"
|
|
112
112
|
},
|
|
113
|
-
"platform_editor_selection_extension_lozenge": {
|
|
114
|
-
"type": "boolean"
|
|
115
|
-
},
|
|
116
113
|
"platform_editor_selection_extension_improvement": {
|
|
117
114
|
"type": "boolean"
|
|
118
115
|
},
|
|
119
116
|
"platform_editor_block_menu_v2_patch_1": {
|
|
120
117
|
"type": "boolean"
|
|
118
|
+
},
|
|
119
|
+
"platform_editor_block_menu_v2_patch_2": {
|
|
120
|
+
"type": "boolean"
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
}
|