@atlaskit/editor-toolbar 2.9.2 → 2.10.0
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
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 2.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`1bade6c23d0b8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1bade6c23d0b8) -
|
|
8
|
+
Add optional product-owned Writing Styles discovery, reactive toolbar badge wrappers, and
|
|
9
|
+
style-selection callbacks that receive the selected item's stable ID before rewriting. Observer
|
|
10
|
+
errors do not prevent rewrites, and local actions keep their existing callbacks. Add controlled
|
|
11
|
+
nested-menu props for opening the Writing Styles submenu. Consumers that omit the new options
|
|
12
|
+
retain their current menu behavior. Confluence supplies the discovery component and badge
|
|
13
|
+
visibility separately under the existing rovo_response_and_writing_styles_mvt assignment.
|
|
14
|
+
|
|
3
15
|
## 2.9.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -45,12 +45,15 @@ var PopupVisibilityController = function PopupVisibilityController(_ref) {
|
|
|
45
45
|
return null;
|
|
46
46
|
};
|
|
47
47
|
var ToolbarNestedDropdownMenu = exports.ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref2) {
|
|
48
|
-
var
|
|
48
|
+
var autoFocus = _ref2.autoFocus,
|
|
49
|
+
elemBefore = _ref2.elemBefore,
|
|
49
50
|
text = _ref2.text,
|
|
50
51
|
elemAfterText = _ref2.elemAfterText,
|
|
51
52
|
elemAfter = _ref2.elemAfter,
|
|
52
53
|
children = _ref2.children,
|
|
53
54
|
isDisabled = _ref2.isDisabled,
|
|
55
|
+
isOpen = _ref2.isOpen,
|
|
56
|
+
onOpenChange = _ref2.onOpenChange,
|
|
54
57
|
testId = _ref2.testId,
|
|
55
58
|
dropdownTestId = _ref2.dropdownTestId,
|
|
56
59
|
_ref2$enableMaxHeight = _ref2.enableMaxHeight,
|
|
@@ -66,6 +69,9 @@ var ToolbarNestedDropdownMenu = exports.ToolbarNestedDropdownMenu = function Too
|
|
|
66
69
|
var popupContentIdRef = (0, _react.useRef)(undefined);
|
|
67
70
|
var triggerElementRef = (0, _react.useRef)(null);
|
|
68
71
|
return /*#__PURE__*/React.createElement(_dropdownMenu.default, {
|
|
72
|
+
autoFocus: autoFocus,
|
|
73
|
+
isOpen: isOpen,
|
|
74
|
+
onOpenChange: onOpenChange,
|
|
69
75
|
shouldFitContainer: shouldFitContainer,
|
|
70
76
|
shouldIgnoreCloseEvent: shouldIgnoreCloseEvent,
|
|
71
77
|
placement: "right-start",
|
|
@@ -38,12 +38,15 @@ const PopupVisibilityController = ({
|
|
|
38
38
|
return null;
|
|
39
39
|
};
|
|
40
40
|
export const ToolbarNestedDropdownMenu = ({
|
|
41
|
+
autoFocus,
|
|
41
42
|
elemBefore,
|
|
42
43
|
text,
|
|
43
44
|
elemAfterText,
|
|
44
45
|
elemAfter,
|
|
45
46
|
children,
|
|
46
47
|
isDisabled,
|
|
48
|
+
isOpen,
|
|
49
|
+
onOpenChange,
|
|
47
50
|
testId,
|
|
48
51
|
dropdownTestId,
|
|
49
52
|
enableMaxHeight = false,
|
|
@@ -58,6 +61,9 @@ export const ToolbarNestedDropdownMenu = ({
|
|
|
58
61
|
const popupContentIdRef = useRef(undefined);
|
|
59
62
|
const triggerElementRef = useRef(null);
|
|
60
63
|
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
64
|
+
autoFocus: autoFocus,
|
|
65
|
+
isOpen: isOpen,
|
|
66
|
+
onOpenChange: onOpenChange,
|
|
61
67
|
shouldFitContainer: shouldFitContainer,
|
|
62
68
|
shouldIgnoreCloseEvent: shouldIgnoreCloseEvent,
|
|
63
69
|
placement: "right-start",
|
|
@@ -37,12 +37,15 @@ var PopupVisibilityController = function PopupVisibilityController(_ref) {
|
|
|
37
37
|
return null;
|
|
38
38
|
};
|
|
39
39
|
export var ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref2) {
|
|
40
|
-
var
|
|
40
|
+
var autoFocus = _ref2.autoFocus,
|
|
41
|
+
elemBefore = _ref2.elemBefore,
|
|
41
42
|
text = _ref2.text,
|
|
42
43
|
elemAfterText = _ref2.elemAfterText,
|
|
43
44
|
elemAfter = _ref2.elemAfter,
|
|
44
45
|
children = _ref2.children,
|
|
45
46
|
isDisabled = _ref2.isDisabled,
|
|
47
|
+
isOpen = _ref2.isOpen,
|
|
48
|
+
onOpenChange = _ref2.onOpenChange,
|
|
46
49
|
testId = _ref2.testId,
|
|
47
50
|
dropdownTestId = _ref2.dropdownTestId,
|
|
48
51
|
_ref2$enableMaxHeight = _ref2.enableMaxHeight,
|
|
@@ -58,6 +61,9 @@ export var ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref2)
|
|
|
58
61
|
var popupContentIdRef = useRef(undefined);
|
|
59
62
|
var triggerElementRef = useRef(null);
|
|
60
63
|
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
64
|
+
autoFocus: autoFocus,
|
|
65
|
+
isOpen: isOpen,
|
|
66
|
+
onOpenChange: onOpenChange,
|
|
61
67
|
shouldFitContainer: shouldFitContainer,
|
|
62
68
|
shouldIgnoreCloseEvent: shouldIgnoreCloseEvent,
|
|
63
69
|
placement: "right-start",
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type KeyboardEvent, type MouseEvent, type ReactNode } from 'react';
|
|
6
|
+
import type { OnOpenChangeArgs } from '@atlaskit/dropdown-menu/types';
|
|
6
7
|
type ToolbarNestedDropdownMenuProps = {
|
|
8
|
+
autoFocus?: boolean;
|
|
7
9
|
children?: ReactNode;
|
|
8
10
|
'data-extension-item-key'?: string;
|
|
9
11
|
dropdownTestId?: string;
|
|
@@ -15,8 +17,11 @@ type ToolbarNestedDropdownMenuProps = {
|
|
|
15
17
|
*/
|
|
16
18
|
enableMaxHeight?: boolean;
|
|
17
19
|
isDisabled?: boolean;
|
|
20
|
+
/** When omitted, the native dropdown continues to own its open state. */
|
|
21
|
+
isOpen?: boolean;
|
|
18
22
|
isPopupVisible?: boolean;
|
|
19
23
|
onClick?: (e: MouseEvent | KeyboardEvent) => void;
|
|
24
|
+
onOpenChange?: (args: OnOpenChangeArgs) => void;
|
|
20
25
|
shouldFitContainer?: boolean;
|
|
21
26
|
shouldIgnoreCloseEvent?: (event: Event | MouseEvent | KeyboardEvent) => boolean;
|
|
22
27
|
shouldTitleWrap?: boolean;
|
|
@@ -24,5 +29,5 @@ type ToolbarNestedDropdownMenuProps = {
|
|
|
24
29
|
text?: string;
|
|
25
30
|
tooltipContent?: ReactNode;
|
|
26
31
|
};
|
|
27
|
-
export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfterText, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, isPopupVisible, onClick, shouldFitContainer, shouldIgnoreCloseEvent, shouldTitleWrap, tooltipContent, 'data-extension-item-key': dataExtensionItemKey, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
|
|
32
|
+
export declare const ToolbarNestedDropdownMenu: ({ autoFocus, elemBefore, text, elemAfterText, elemAfter, children, isDisabled, isOpen, onOpenChange, testId, dropdownTestId, enableMaxHeight, isPopupVisible, onClick, shouldFitContainer, shouldIgnoreCloseEvent, shouldTitleWrap, tooltipContent, 'data-extension-item-key': dataExtensionItemKey, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
|
|
28
33
|
export {};
|