@atlaskit/editor-toolbar 0.9.3 → 0.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 +21 -0
- package/dist/cjs/hooks/ui-context.js +6 -3
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/ui/ColorPalette/Color.compiled.css +6 -4
- package/dist/cjs/ui/ColorPalette/Color.js +5 -7
- package/dist/cjs/ui/ColorPalette/index.js +1 -1
- package/dist/cjs/ui/ResponsiveContainer.compiled.css +8 -2
- package/dist/cjs/ui/ResponsiveContainer.js +1 -1
- package/dist/cjs/ui/Toolbar.compiled.css +3 -2
- package/dist/cjs/ui/Toolbar.js +30 -5
- package/dist/cjs/ui/ToolbarButton.js +1 -1
- package/dist/cjs/ui/ToolbarButtonGroup.js +1 -1
- package/dist/cjs/ui/ToolbarColorSwatch.js +1 -1
- package/dist/cjs/ui/ToolbarDropdownItem.js +4 -2
- package/dist/cjs/ui/ToolbarDropdownMenu.js +1 -1
- package/dist/cjs/ui/ToolbarKeyboardNavigationProvider.js +65 -0
- package/dist/cjs/ui/ToolbarNestedDropdownMenu.js +3 -1
- package/dist/cjs/ui/ToolbarSection.js +1 -1
- package/dist/cjs/ui/icons/AIChatIcon.js +2 -2
- package/dist/cjs/ui/icons/TextColorIcon.js +1 -1
- package/dist/es2019/hooks/ui-context.js +6 -3
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/ui/ColorPalette/Color.compiled.css +4 -2
- package/dist/es2019/ui/ColorPalette/Color.js +1 -1
- package/dist/es2019/ui/ColorPalette/index.js +1 -1
- package/dist/es2019/ui/ResponsiveContainer.compiled.css +8 -2
- package/dist/es2019/ui/ResponsiveContainer.js +1 -1
- package/dist/es2019/ui/Toolbar.compiled.css +3 -2
- package/dist/es2019/ui/Toolbar.js +33 -5
- package/dist/es2019/ui/ToolbarButton.js +1 -1
- package/dist/es2019/ui/ToolbarButtonGroup.js +1 -1
- package/dist/es2019/ui/ToolbarColorSwatch.js +1 -1
- package/dist/es2019/ui/ToolbarDropdownItem.js +4 -2
- package/dist/es2019/ui/ToolbarDropdownMenu.js +1 -1
- package/dist/es2019/ui/ToolbarKeyboardNavigationProvider.js +60 -0
- package/dist/es2019/ui/ToolbarNestedDropdownMenu.js +3 -1
- package/dist/es2019/ui/ToolbarSection.js +1 -1
- package/dist/es2019/ui/icons/AIChatIcon.js +7 -7
- package/dist/es2019/ui/icons/TextColorIcon.js +1 -1
- package/dist/esm/hooks/ui-context.js +6 -3
- package/dist/esm/index.js +1 -0
- package/dist/esm/ui/ColorPalette/Color.compiled.css +6 -4
- package/dist/esm/ui/ColorPalette/Color.js +5 -7
- package/dist/esm/ui/ColorPalette/index.js +1 -1
- package/dist/esm/ui/ResponsiveContainer.compiled.css +8 -2
- package/dist/esm/ui/ResponsiveContainer.js +1 -1
- package/dist/esm/ui/Toolbar.compiled.css +3 -2
- package/dist/esm/ui/Toolbar.js +30 -5
- package/dist/esm/ui/ToolbarButton.js +1 -1
- package/dist/esm/ui/ToolbarButtonGroup.js +1 -1
- package/dist/esm/ui/ToolbarColorSwatch.js +1 -1
- package/dist/esm/ui/ToolbarDropdownItem.js +4 -2
- package/dist/esm/ui/ToolbarDropdownMenu.js +1 -1
- package/dist/esm/ui/ToolbarKeyboardNavigationProvider.js +57 -0
- package/dist/esm/ui/ToolbarNestedDropdownMenu.js +3 -1
- package/dist/esm/ui/ToolbarSection.js +1 -1
- package/dist/esm/ui/icons/AIChatIcon.js +2 -2
- package/dist/esm/ui/icons/TextColorIcon.js +1 -1
- package/dist/types/hooks/ui-context.d.ts +6 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/types.d.ts +9 -0
- package/dist/types/ui/Toolbar.d.ts +2 -1
- package/dist/types/ui/ToolbarKeyboardNavigationProvider.d.ts +7 -0
- package/dist/types/ui/ToolbarNestedDropdownMenu.d.ts +2 -1
- package/dist/types-ts4.5/hooks/ui-context.d.ts +6 -1
- package/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/types.d.ts +9 -0
- package/dist/types-ts4.5/ui/Toolbar.d.ts +2 -1
- package/dist/types-ts4.5/ui/ToolbarKeyboardNavigationProvider.d.ts +7 -0
- package/dist/types-ts4.5/ui/ToolbarNestedDropdownMenu.d.ts +2 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ToolbarDropdownItem.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ToolbarDropdownItem.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./ToolbarDropdownItem.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { forwardRef, isValidElement, cloneElement } from 'react';
|
|
@@ -81,7 +81,9 @@ export const ToolbarDropdownItem = ({
|
|
|
81
81
|
ref: triggerRef,
|
|
82
82
|
href: href,
|
|
83
83
|
target: target,
|
|
84
|
-
rel: rel
|
|
84
|
+
rel: rel
|
|
85
|
+
// @ts-ignore -- This `CustomDropdownMenuItemButton` has type conflicts with the `DropdownItem` component in a way that cannot be reconciled (ignored as it fails types in Jira and should in Platform)
|
|
86
|
+
,
|
|
85
87
|
component: href && expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true) ? undefined : CustomDropdownMenuItemButton,
|
|
86
88
|
testId: testId,
|
|
87
89
|
"data-toolbar-component": "menu-item",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ToolbarDropdownMenu.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ToolbarDropdownMenu.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./ToolbarDropdownMenu.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React, { useLayoutEffect, useRef } from 'react';
|
|
2
|
+
export const ToolbarKeyboardNavigationProvider = ({
|
|
3
|
+
children,
|
|
4
|
+
childComponentSelector,
|
|
5
|
+
dom,
|
|
6
|
+
isShortcutToFocusToolbar,
|
|
7
|
+
handleFocus,
|
|
8
|
+
handleEscape,
|
|
9
|
+
ariaLabel,
|
|
10
|
+
ariaControls
|
|
11
|
+
}) => {
|
|
12
|
+
const wrapperRef = useRef(null);
|
|
13
|
+
useLayoutEffect(() => {
|
|
14
|
+
if (!wrapperRef.current) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const {
|
|
18
|
+
current: element
|
|
19
|
+
} = wrapperRef;
|
|
20
|
+
const handleKeyDown = event => {
|
|
21
|
+
const targetElement = event.target;
|
|
22
|
+
if (targetElement instanceof HTMLElement && !targetElement.closest(`${childComponentSelector}`)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
switch (event.key) {
|
|
26
|
+
case 'Escape':
|
|
27
|
+
handleEscape(event);
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const globalKeyDownHandler = event => {
|
|
33
|
+
if (isShortcutToFocusToolbar && isShortcutToFocusToolbar(event)) {
|
|
34
|
+
handleFocus(event);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// ignored via go/ees005
|
|
39
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
40
|
+
element === null || element === void 0 ? void 0 : element.addEventListener('keydown', handleKeyDown);
|
|
41
|
+
// ignored via go/ees005
|
|
42
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
43
|
+
dom === null || dom === void 0 ? void 0 : dom.addEventListener('keydown', globalKeyDownHandler);
|
|
44
|
+
return () => {
|
|
45
|
+
// ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
47
|
+
element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', handleKeyDown);
|
|
48
|
+
// ignored via go/ees005
|
|
49
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
50
|
+
dom === null || dom === void 0 ? void 0 : dom.removeEventListener('keydown', globalKeyDownHandler);
|
|
51
|
+
};
|
|
52
|
+
}, [wrapperRef, childComponentSelector, dom, isShortcutToFocusToolbar, handleFocus, handleEscape]);
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- ignored via go/DSP-18766
|
|
55
|
+
className: "custom-key-handler-wrapper",
|
|
56
|
+
ref: wrapperRef,
|
|
57
|
+
"aria-label": ariaLabel,
|
|
58
|
+
"aria-controls": ariaControls
|
|
59
|
+
}, children);
|
|
60
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ToolbarNestedDropdownMenu.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ToolbarNestedDropdownMenu.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
3
|
import "./ToolbarNestedDropdownMenu.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
@@ -17,11 +17,13 @@ export const ToolbarNestedDropdownMenu = ({
|
|
|
17
17
|
children,
|
|
18
18
|
isDisabled,
|
|
19
19
|
testId,
|
|
20
|
+
dropdownTestId,
|
|
20
21
|
enableMaxHeight = false,
|
|
21
22
|
onClick
|
|
22
23
|
}) => {
|
|
23
24
|
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
24
25
|
placement: "right-start",
|
|
26
|
+
testId: dropdownTestId,
|
|
25
27
|
trigger: triggerProps => /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
26
28
|
elemBefore: elemBefore,
|
|
27
29
|
elemAfter: elemAfter,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AIChatIcon.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* AIChatIcon.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./AIChatIcon.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -7,12 +7,12 @@ const styles = {
|
|
|
7
7
|
container: "_1e0c1txw _4cvr1h6o _1bah1h6o _4t3i1crf _1bsb1crf"
|
|
8
8
|
};
|
|
9
9
|
const NEW_ROVO_SVG_PATH = `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
10
|
-
<path d="M5.
|
|
11
|
-
<path d="M4.35709 0.
|
|
12
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.64872 7.
|
|
13
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.
|
|
14
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7381 2.
|
|
15
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.
|
|
10
|
+
<path d="M5.38007 0.169224C5.79665 -0.0605531 6.30508 -0.0563317 6.71827 0.181888L9.96761 2.05659L10.7381 2.50115C11.1589 2.7437 11.4193 3.1937 11.4193 3.67848V8.31707C11.4193 8.80377 11.1604 9.25178 10.7385 9.4942L7.71671 11.2376C7.72332 11.219 7.72963 11.2003 7.73565 11.1815C7.79172 11.0077 7.82146 10.8241 7.82146 10.6363V5.99777C7.82146 5.36053 7.4823 4.7729 6.92908 4.45501L6.37094 4.13313L4.67654 3.15598V1.35919C4.67654 1.21761 4.69845 1.0793 4.7399 0.948371C4.8418 0.631497 5.05854 0.357177 5.35505 0.185934L5.35594 0.185415C5.36443 0.180511 5.37252 0.175072 5.38007 0.169224Z" fill="#FCA700"/>
|
|
11
|
+
<path d="M4.35709 0.762451L1.33533 2.50585C0.91337 2.74828 0.654541 3.19629 0.654541 3.68299V8.32158C0.654541 8.80636 0.914895 9.25633 1.33561 9.49887L2.05206 9.91223L5.35553 11.8182C5.76872 12.0563 6.27717 12.0606 6.69373 11.8308C6.70128 11.825 6.7093 11.8196 6.71781 11.8147C7.01463 11.6435 7.2317 11.3691 7.33376 11.0521C7.3753 10.9211 7.39725 10.7826 7.39725 10.6409V8.84408L5.64872 7.83569L5.14485 7.54513C4.59174 7.22722 4.25234 6.63946 4.25234 6.00228V1.3637C4.25234 1.17625 4.28199 0.992849 4.33793 0.81927C4.344 0.800208 4.35039 0.781265 4.35709 0.762451Z" fill="#FCA700"/>
|
|
12
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.64872 7.83569L2.05206 9.91223L1.33561 9.49887C0.914895 9.25633 0.654541 8.80636 0.654541 8.32158V3.68299C0.654541 3.19629 0.91337 2.74828 1.33533 2.50585L4.35709 0.762451C4.35039 0.781265 4.344 0.800208 4.33793 0.81927C4.28199 0.992849 4.25234 1.17625 4.25234 1.3637V6.00228C4.25234 6.63946 4.59174 7.22722 5.14485 7.54513L5.64872 7.83569Z" fill="#1868DB"/>
|
|
13
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.37094 4.13313L4.67654 3.15598V1.35919C4.67654 1.21761 4.69845 1.0793 4.7399 0.948371C4.8418 0.631497 5.05854 0.357177 5.35505 0.185934L5.35594 0.185415C5.36443 0.180511 5.37252 0.175072 5.38007 0.169224C5.79665 -0.0605531 6.30508 -0.0563317 6.71827 0.181888L9.96761 2.05659L6.37094 4.13313Z" fill="#FCA700"/>
|
|
14
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7381 2.5012L9.9676 2.05664L6.37094 4.13318L6.92907 4.45507C7.48229 4.77296 7.82146 5.36059 7.82146 5.99783V10.6364C7.82146 10.8241 7.79172 11.0078 7.73565 11.1816C7.72963 11.2004 7.72332 11.2191 7.71671 11.2377L10.7385 9.49426C11.1604 9.25184 11.4193 8.80382 11.4193 8.31712V3.67853C11.4193 3.19376 11.1589 2.74376 10.7381 2.5012Z" fill="#AF59E0"/>
|
|
15
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.64873 7.83569L2.05206 9.91224L5.35553 11.8182C5.76873 12.0564 6.27718 12.0606 6.69373 11.8308C6.70128 11.825 6.70931 11.8196 6.71782 11.8147C7.01463 11.6436 7.2317 11.3691 7.33377 11.0521C7.37531 10.9211 7.39726 10.7826 7.39726 10.6409V8.84409L5.64873 7.83569Z" fill="#6A9A23"/>
|
|
16
16
|
</svg>`;
|
|
17
17
|
const ROVO_SVG_PATH = `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
18
18
|
<path d="M5.4905 0.135176C5.80591 -0.0450587 6.19311 -0.0450584 6.50852 0.135176L10.8688 2.62676C11.1885 2.80943 11.3857 3.14937 11.3857 3.51754V8.48246C11.3857 8.85063 11.1885 9.19057 10.8688 9.37324L6.50852 11.8648C6.19311 12.0451 5.80591 12.0451 5.4905 11.8648L1.13022 9.37324C0.810557 9.19057 0.613281 8.85063 0.613281 8.48246V3.51754C0.613281 3.14937 0.810557 2.80943 1.13022 2.62676L5.4905 0.135176Z" fill="#BF63F3"/>
|
|
@@ -4,7 +4,8 @@ var ToolbarUIContext = /*#__PURE__*/createContext({
|
|
|
4
4
|
preventDefaultOnMouseDown: false,
|
|
5
5
|
isDisabled: false,
|
|
6
6
|
popupsMountPoint: undefined,
|
|
7
|
-
fireAnalyticsEvent: undefined
|
|
7
|
+
fireAnalyticsEvent: undefined,
|
|
8
|
+
keyboardNavigation: undefined
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -25,7 +26,8 @@ export var ToolbarUIProvider = function ToolbarUIProvider(_ref) {
|
|
|
25
26
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
26
27
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
27
28
|
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
28
|
-
fireAnalyticsEvent = _ref.fireAnalyticsEvent
|
|
29
|
+
fireAnalyticsEvent = _ref.fireAnalyticsEvent,
|
|
30
|
+
keyboardNavigation = _ref.keyboardNavigation;
|
|
29
31
|
return /*#__PURE__*/React.createElement(ToolbarUIContext.Provider, {
|
|
30
32
|
value: {
|
|
31
33
|
onDropdownOpenChanged: onDropdownOpenChanged,
|
|
@@ -34,7 +36,8 @@ export var ToolbarUIProvider = function ToolbarUIProvider(_ref) {
|
|
|
34
36
|
popupsMountPoint: popupsMountPoint,
|
|
35
37
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
36
38
|
popupsScrollableElement: popupsScrollableElement,
|
|
37
|
-
fireAnalyticsEvent: fireAnalyticsEvent
|
|
39
|
+
fireAnalyticsEvent: fireAnalyticsEvent,
|
|
40
|
+
keyboardNavigation: keyboardNavigation
|
|
38
41
|
}
|
|
39
42
|
}, children);
|
|
40
43
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { ToolbarDropdownMenu } from './ui/ToolbarDropdownMenu';
|
|
|
6
6
|
export { ToolbarDropdownItem } from './ui/ToolbarDropdownItem';
|
|
7
7
|
export { ToolbarDropdownItemSection } from './ui/ToolbarDropdownItemSection';
|
|
8
8
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
9
|
+
export { ToolbarKeyboardNavigationProvider } from './ui/ToolbarKeyboardNavigationProvider';
|
|
9
10
|
export { ToolbarKeyboardShortcutHint } from './ui/ToolbarKeyboardShortcutHint';
|
|
10
11
|
export { ToolbarSection } from './ui/ToolbarSection';
|
|
11
12
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
.
|
|
2
|
+
._19it1ps9{border:var(--ds-border-width,1px) solid var(--ds-border-inverse,#fff)}
|
|
3
3
|
._2rko12b0{border-radius:var(--ds-radius-small,4px)}._189ee4h9{border-width:var(--ds-border-width,1px)}
|
|
4
4
|
._1dqonqa1{border-style:solid}
|
|
5
5
|
._1h6d1j28{border-color:transparent}
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
20
20
|
._u5f3idpf{padding-right:0}
|
|
21
21
|
._u5f3v77o{padding-right:var(--ds-space-025,2px)}
|
|
22
|
-
.
|
|
23
|
-
.
|
|
24
|
-
.
|
|
22
|
+
._jyzfmuej:focus-within{border-color:var(--ds-border,#091e4224)}
|
|
23
|
+
._y2mv1q03:focus{outline:var(--ds-border-width-focused,2px) solid var(--ds-border-focused,#388bff)}
|
|
24
|
+
._858umuej:focus{border-color:var(--ds-border,#091e4224)}
|
|
25
|
+
._1bg4v77o:focus{outline-offset:var(--ds-space-025,2px)}
|
|
26
|
+
._4cvxmuej:hover{border-color:var(--ds-border,#091e4224)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Color.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* Color.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./Color.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback, memo } from 'react';
|
|
@@ -52,14 +52,12 @@ export var Color = /*#__PURE__*/memo(function (_ref) {
|
|
|
52
52
|
onKeyDown: handleKeyDown,
|
|
53
53
|
onMouseDown: handleMouseDown,
|
|
54
54
|
tabIndex: tabIndex,
|
|
55
|
-
autoFocus: autoFocus,
|
|
56
|
-
className: ax(["_ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _2rko12b0 _19it1oet _4t3icr4y _1bsbcr4y _bfhkm7j4 _80omtlke _1e0c1ule _kqswh2mm _y2mvuigy _1bg4v77o"]),
|
|
57
55
|
style: {
|
|
58
56
|
backgroundColor: colorStyle || "var(--ds-background-input, #FFFFFF)",
|
|
59
|
-
border: "var(--ds-border-width, 1px)".concat(" solid ", borderColor)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
border: "var(--ds-border-width, 1px)".concat(" solid ", borderColor)
|
|
58
|
+
},
|
|
59
|
+
autoFocus: autoFocus,
|
|
60
|
+
className: ax(["_ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _2rko12b0 _19it1ps9 _4t3icr4y _1bsbcr4y _bfhkm7j4 _80omtlke _1e0c1ule _kqswh2mm _y2mv1q03 _1bg4v77o"])
|
|
63
61
|
}, !decorator && isSelected && /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
64
62
|
color: checkMarkColor,
|
|
65
63
|
LEGACY_primaryColor: checkMarkColor,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useMemo, useCallback, useRef, useEffect } from 'react';
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
._1a2cglyw .show-below-md{display:none}
|
|
1
2
|
._1bsb1osq{width:100%}
|
|
2
|
-
._1bx91ule .show-above-lg
|
|
3
|
+
._1bx91ule .show-above-lg{display:block}
|
|
4
|
+
._1ehg1ule .show-above-md{display:block}
|
|
3
5
|
._1f38ptqj{container-name:toolbar-container}
|
|
6
|
+
._1onx1ule .show-above-sm{display:block}
|
|
7
|
+
._1vtcglyw .show-below-xl{display:none}
|
|
8
|
+
._1xt01ule .show-above-xl{display:block}
|
|
4
9
|
._7cca15wb{container-type:inline-size}
|
|
5
|
-
.
|
|
10
|
+
._sum2glyw .show-below-sm{display:none}
|
|
11
|
+
._zg9wglyw .show-below-lg{display:none}
|
|
6
12
|
@container editor-area (max-width: 365px){._33p2glyw .show-above-sm{display:none}._1dre1ule .show-below-sm{display:block}}
|
|
7
13
|
@container editor-area (max-width: 533px){._u47mglyw .show-above-md{display:none}._rut51ule .show-below-md{display:block}}
|
|
8
14
|
@container editor-area (max-width: 700px){._fj5dglyw .show-above-lg{display:none}._5wt61ule .show-below-lg{display:block}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ResponsiveContainer.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ResponsiveContainer.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
3
3
|
/* eslint-disable @atlaskit/ui-styling-standard/no-container-queries */
|
|
4
4
|
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
3
3
|
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
4
4
|
._195gpxbi{margin-inline:var(--ds-space-200,1pc)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
|
|
5
|
-
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button]))
|
|
5
|
+
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
|
6
6
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
7
7
|
._1e0c1txw{display:flex}
|
|
8
8
|
._1tkezwfg{min-height:2pc}
|
|
@@ -11,4 +11,5 @@
|
|
|
11
11
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
12
12
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
13
13
|
._fy9oglyw [data-toolbar-component=section]:not(:has([data-toolbar-component=button])){display:none}
|
|
14
|
-
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
14
|
+
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
15
|
+
._ze7rglyw [class*=show-below-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Toolbar.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* Toolbar.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
3
3
|
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
4
4
|
import "./Toolbar.compiled.css";
|
|
@@ -7,7 +7,9 @@ import React from 'react';
|
|
|
7
7
|
import { cx } from '@atlaskit/css';
|
|
8
8
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
9
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
|
+
import { useToolbarUI } from '../hooks/ui-context';
|
|
10
11
|
import { ResponsiveContainer, ResponsiveWrapper } from './ResponsiveContainer';
|
|
12
|
+
import { ToolbarKeyboardNavigationProvider } from './ToolbarKeyboardNavigationProvider';
|
|
11
13
|
import { ACTION_SUBJECT, ViewEventEmitter } from './ViewEventEmitter';
|
|
12
14
|
var styles = {
|
|
13
15
|
toolbarBase: "_2rko1qi0 _zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
@@ -24,20 +26,43 @@ var styles = {
|
|
|
24
26
|
export var Toolbar = function Toolbar(_ref) {
|
|
25
27
|
var children = _ref.children,
|
|
26
28
|
label = _ref.label,
|
|
27
|
-
actionSubjectId = _ref.actionSubjectId
|
|
29
|
+
actionSubjectId = _ref.actionSubjectId,
|
|
30
|
+
testId = _ref.testId;
|
|
28
31
|
var isResponsiveEnabled = expValEquals('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
29
32
|
var toolbar = /*#__PURE__*/React.createElement(Box, {
|
|
30
33
|
xcss: cx(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
31
34
|
role: "toolbar",
|
|
32
|
-
"aria-label": label
|
|
35
|
+
"aria-label": label,
|
|
36
|
+
testId: testId
|
|
33
37
|
}, expValEquals('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ViewEventEmitter, {
|
|
34
38
|
actionSubject: ACTION_SUBJECT.TOOLBAR,
|
|
35
39
|
actionSubjectId: actionSubjectId
|
|
36
40
|
}) : null, children);
|
|
41
|
+
var wrappedToolbar = toolbar;
|
|
42
|
+
var _useToolbarUI = useToolbarUI(),
|
|
43
|
+
keyboardNavigation = _useToolbarUI.keyboardNavigation;
|
|
44
|
+
if (keyboardNavigation) {
|
|
45
|
+
var childComponentSelector = keyboardNavigation.childComponentSelector,
|
|
46
|
+
dom = keyboardNavigation.dom,
|
|
47
|
+
handleEscape = keyboardNavigation.handleEscape,
|
|
48
|
+
handleFocus = keyboardNavigation.handleFocus,
|
|
49
|
+
isShortcutToFocusToolbar = keyboardNavigation.isShortcutToFocusToolbar,
|
|
50
|
+
ariaControls = keyboardNavigation.ariaControls,
|
|
51
|
+
ariaLabel = keyboardNavigation.ariaLabel;
|
|
52
|
+
wrappedToolbar = /*#__PURE__*/React.createElement(ToolbarKeyboardNavigationProvider, {
|
|
53
|
+
childComponentSelector: childComponentSelector,
|
|
54
|
+
dom: dom,
|
|
55
|
+
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
56
|
+
handleEscape: handleEscape,
|
|
57
|
+
handleFocus: handleFocus,
|
|
58
|
+
ariaControls: ariaControls,
|
|
59
|
+
ariaLabel: ariaLabel
|
|
60
|
+
}, toolbar);
|
|
61
|
+
}
|
|
37
62
|
if (isResponsiveEnabled) {
|
|
38
|
-
return /*#__PURE__*/React.createElement(ResponsiveWrapper, null,
|
|
63
|
+
return /*#__PURE__*/React.createElement(ResponsiveWrapper, null, wrappedToolbar);
|
|
39
64
|
} else {
|
|
40
|
-
return
|
|
65
|
+
return wrappedToolbar;
|
|
41
66
|
}
|
|
42
67
|
};
|
|
43
68
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ToolbarButton.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ToolbarButton.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./ToolbarButton.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ToolbarButtonGroup.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ToolbarButtonGroup.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./ToolbarButtonGroup.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ToolbarColorSwatch.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ToolbarColorSwatch.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./ToolbarColorSwatch.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ToolbarDropdownItem.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ToolbarDropdownItem.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import "./ToolbarDropdownItem.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -84,7 +84,9 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
|
|
|
84
84
|
ref: triggerRef,
|
|
85
85
|
href: href,
|
|
86
86
|
target: target,
|
|
87
|
-
rel: rel
|
|
87
|
+
rel: rel
|
|
88
|
+
// @ts-ignore -- This `CustomDropdownMenuItemButton` has type conflicts with the `DropdownItem` component in a way that cannot be reconciled (ignored as it fails types in Jira and should in Platform)
|
|
89
|
+
,
|
|
88
90
|
component: href && expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true) ? undefined : CustomDropdownMenuItemButton,
|
|
89
91
|
testId: testId,
|
|
90
92
|
"data-toolbar-component": "menu-item",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ToolbarDropdownMenu.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ToolbarDropdownMenu.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./ToolbarDropdownMenu.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useLayoutEffect, useRef } from 'react';
|
|
2
|
+
export var ToolbarKeyboardNavigationProvider = function ToolbarKeyboardNavigationProvider(_ref) {
|
|
3
|
+
var children = _ref.children,
|
|
4
|
+
childComponentSelector = _ref.childComponentSelector,
|
|
5
|
+
dom = _ref.dom,
|
|
6
|
+
isShortcutToFocusToolbar = _ref.isShortcutToFocusToolbar,
|
|
7
|
+
handleFocus = _ref.handleFocus,
|
|
8
|
+
handleEscape = _ref.handleEscape,
|
|
9
|
+
ariaLabel = _ref.ariaLabel,
|
|
10
|
+
ariaControls = _ref.ariaControls;
|
|
11
|
+
var wrapperRef = useRef(null);
|
|
12
|
+
useLayoutEffect(function () {
|
|
13
|
+
if (!wrapperRef.current) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
var element = wrapperRef.current;
|
|
17
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
18
|
+
var targetElement = event.target;
|
|
19
|
+
if (targetElement instanceof HTMLElement && !targetElement.closest("".concat(childComponentSelector))) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
switch (event.key) {
|
|
23
|
+
case 'Escape':
|
|
24
|
+
handleEscape(event);
|
|
25
|
+
break;
|
|
26
|
+
default:
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var globalKeyDownHandler = function globalKeyDownHandler(event) {
|
|
30
|
+
if (isShortcutToFocusToolbar && isShortcutToFocusToolbar(event)) {
|
|
31
|
+
handleFocus(event);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
37
|
+
element === null || element === void 0 || element.addEventListener('keydown', handleKeyDown);
|
|
38
|
+
// ignored via go/ees005
|
|
39
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
40
|
+
dom === null || dom === void 0 || dom.addEventListener('keydown', globalKeyDownHandler);
|
|
41
|
+
return function () {
|
|
42
|
+
// ignored via go/ees005
|
|
43
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
44
|
+
element === null || element === void 0 || element.removeEventListener('keydown', handleKeyDown);
|
|
45
|
+
// ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
47
|
+
dom === null || dom === void 0 || dom.removeEventListener('keydown', globalKeyDownHandler);
|
|
48
|
+
};
|
|
49
|
+
}, [wrapperRef, childComponentSelector, dom, isShortcutToFocusToolbar, handleFocus, handleEscape]);
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- ignored via go/DSP-18766
|
|
52
|
+
className: "custom-key-handler-wrapper",
|
|
53
|
+
ref: wrapperRef,
|
|
54
|
+
"aria-label": ariaLabel,
|
|
55
|
+
"aria-controls": ariaControls
|
|
56
|
+
}, children);
|
|
57
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ToolbarNestedDropdownMenu.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* ToolbarNestedDropdownMenu.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
3
|
import "./ToolbarNestedDropdownMenu.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
@@ -17,11 +17,13 @@ export var ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref)
|
|
|
17
17
|
children = _ref.children,
|
|
18
18
|
isDisabled = _ref.isDisabled,
|
|
19
19
|
testId = _ref.testId,
|
|
20
|
+
dropdownTestId = _ref.dropdownTestId,
|
|
20
21
|
_ref$enableMaxHeight = _ref.enableMaxHeight,
|
|
21
22
|
enableMaxHeight = _ref$enableMaxHeight === void 0 ? false : _ref$enableMaxHeight,
|
|
22
23
|
_onClick = _ref.onClick;
|
|
23
24
|
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
24
25
|
placement: "right-start",
|
|
26
|
+
testId: dropdownTestId,
|
|
25
27
|
trigger: function trigger(triggerProps) {
|
|
26
28
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
27
29
|
elemBefore: elemBefore,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AIChatIcon.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* AIChatIcon.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./AIChatIcon.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -6,7 +6,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
6
6
|
var styles = {
|
|
7
7
|
container: "_1e0c1txw _4cvr1h6o _1bah1h6o _4t3i1crf _1bsb1crf"
|
|
8
8
|
};
|
|
9
|
-
var NEW_ROVO_SVG_PATH = "<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<path d=\"M5.
|
|
9
|
+
var NEW_ROVO_SVG_PATH = "<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<path d=\"M5.38007 0.169224C5.79665 -0.0605531 6.30508 -0.0563317 6.71827 0.181888L9.96761 2.05659L10.7381 2.50115C11.1589 2.7437 11.4193 3.1937 11.4193 3.67848V8.31707C11.4193 8.80377 11.1604 9.25178 10.7385 9.4942L7.71671 11.2376C7.72332 11.219 7.72963 11.2003 7.73565 11.1815C7.79172 11.0077 7.82146 10.8241 7.82146 10.6363V5.99777C7.82146 5.36053 7.4823 4.7729 6.92908 4.45501L6.37094 4.13313L4.67654 3.15598V1.35919C4.67654 1.21761 4.69845 1.0793 4.7399 0.948371C4.8418 0.631497 5.05854 0.357177 5.35505 0.185934L5.35594 0.185415C5.36443 0.180511 5.37252 0.175072 5.38007 0.169224Z\" fill=\"#FCA700\"/>\n\t\t<path d=\"M4.35709 0.762451L1.33533 2.50585C0.91337 2.74828 0.654541 3.19629 0.654541 3.68299V8.32158C0.654541 8.80636 0.914895 9.25633 1.33561 9.49887L2.05206 9.91223L5.35553 11.8182C5.76872 12.0563 6.27717 12.0606 6.69373 11.8308C6.70128 11.825 6.7093 11.8196 6.71781 11.8147C7.01463 11.6435 7.2317 11.3691 7.33376 11.0521C7.3753 10.9211 7.39725 10.7826 7.39725 10.6409V8.84408L5.64872 7.83569L5.14485 7.54513C4.59174 7.22722 4.25234 6.63946 4.25234 6.00228V1.3637C4.25234 1.17625 4.28199 0.992849 4.33793 0.81927C4.344 0.800208 4.35039 0.781265 4.35709 0.762451Z\" fill=\"#FCA700\"/>\n\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.64872 7.83569L2.05206 9.91223L1.33561 9.49887C0.914895 9.25633 0.654541 8.80636 0.654541 8.32158V3.68299C0.654541 3.19629 0.91337 2.74828 1.33533 2.50585L4.35709 0.762451C4.35039 0.781265 4.344 0.800208 4.33793 0.81927C4.28199 0.992849 4.25234 1.17625 4.25234 1.3637V6.00228C4.25234 6.63946 4.59174 7.22722 5.14485 7.54513L5.64872 7.83569Z\" fill=\"#1868DB\"/>\n\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6.37094 4.13313L4.67654 3.15598V1.35919C4.67654 1.21761 4.69845 1.0793 4.7399 0.948371C4.8418 0.631497 5.05854 0.357177 5.35505 0.185934L5.35594 0.185415C5.36443 0.180511 5.37252 0.175072 5.38007 0.169224C5.79665 -0.0605531 6.30508 -0.0563317 6.71827 0.181888L9.96761 2.05659L6.37094 4.13313Z\" fill=\"#FCA700\"/>\n\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M10.7381 2.5012L9.9676 2.05664L6.37094 4.13318L6.92907 4.45507C7.48229 4.77296 7.82146 5.36059 7.82146 5.99783V10.6364C7.82146 10.8241 7.79172 11.0078 7.73565 11.1816C7.72963 11.2004 7.72332 11.2191 7.71671 11.2377L10.7385 9.49426C11.1604 9.25184 11.4193 8.80382 11.4193 8.31712V3.67853C11.4193 3.19376 11.1589 2.74376 10.7381 2.5012Z\" fill=\"#AF59E0\"/>\n\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.64873 7.83569L2.05206 9.91224L5.35553 11.8182C5.76873 12.0564 6.27718 12.0606 6.69373 11.8308C6.70128 11.825 6.70931 11.8196 6.71782 11.8147C7.01463 11.6436 7.2317 11.3691 7.33377 11.0521C7.37531 10.9211 7.39726 10.7826 7.39726 10.6409V8.84409L5.64873 7.83569Z\" fill=\"#6A9A23\"/>\n\t</svg>";
|
|
10
10
|
var ROVO_SVG_PATH = "<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<path d=\"M5.4905 0.135176C5.80591 -0.0450587 6.19311 -0.0450584 6.50852 0.135176L10.8688 2.62676C11.1885 2.80943 11.3857 3.14937 11.3857 3.51754V8.48246C11.3857 8.85063 11.1885 9.19057 10.8688 9.37324L6.50852 11.8648C6.19311 12.0451 5.80591 12.0451 5.4905 11.8648L1.13022 9.37324C0.810557 9.19057 0.613281 8.85063 0.613281 8.48246V3.51754C0.613281 3.14937 0.810557 2.80943 1.13022 2.62676L5.4905 0.135176Z\" fill=\"#BF63F3\"/>\n\t\t<mask id=\"mask0_7293_80230\" style=\"mask-type:alpha\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"12\" height=\"12\">\n\t\t\t<path d=\"M5.49147 0.135176C5.80688 -0.0450587 6.19409 -0.0450584 6.5095 0.135176L10.8698 2.62676C11.1894 2.80943 11.3867 3.14937 11.3867 3.51754V8.48246C11.3867 8.85063 11.1894 9.19057 10.8698 9.37324L6.5095 11.8648C6.19409 12.0451 5.80688 12.0451 5.49147 11.8648L1.13119 9.37324C0.811533 9.19057 0.614258 8.85063 0.614258 8.48246V3.51754C0.614258 3.14937 0.811533 2.80943 1.13119 2.62676L5.49147 0.135176Z\" fill=\"#BF63F3\"/>\n\t\t</mask>\n\t\t<g mask=\"url(#mask0_7293_80230)\">\n\t\t\t<path d=\"M1.16288 17.7949C1.88804 16.4071 2.9469 15.3192 4.34131 14.5785C5.73572 13.8378 7.35499 13.5206 8.99441 13.7092L0.174767 -2.55519C-1.28774 -2.29055 -2.70974 -1.80225 -4.07832 -1.07526C-5.44691 -0.348264 -6.62375 0.522036 -7.64571 1.5465L1.16656 17.7973L1.16288 17.7949Z\" fill=\"#82B536\"/>\n\t\t\t<path d=\"M6.2482 7.95377C3.81481 8.96062 1.95638 10.6236 1.88069 12.9253C1.88069 12.9253 1.88199 12.9371 1.88076 12.9428C1.87578 13.1139 1.87896 13.2868 1.89469 13.4633C1.89533 13.4648 1.89596 13.4663 1.89659 13.4678C1.91139 13.6465 1.93718 13.8294 1.97333 14.0151C1.98259 14.0588 1.99625 14.1041 2.00551 14.1478C2.03868 14.296 2.07186 14.4442 2.11979 14.5968C2.18327 14.7994 2.25711 15.0047 2.3457 15.2144C2.50959 15.6024 2.70185 15.9488 2.90932 16.2571C3.18552 16.6673 3.48842 17.0101 3.79015 17.2936C3.86597 17.3643 3.94053 17.432 4.01695 17.4954C4.37212 17.7357 4.89091 18.0543 5.7602 18.4584C6.328 18.7233 7.04924 19.025 7.97282 19.3662C8.7114 18.2422 10.0629 17.368 11.3277 16.3888C12.3263 15.6149 13.2681 14.7764 13.805 13.6971C14.2974 12.7085 14.3102 11.4765 13.7704 10.1986C12.4194 7.00012 9.42898 6.63591 6.2507 7.95097L6.2482 7.95377Z\" fill=\"#FCA700\"/>\n\t\t\t<path d=\"M11.6634 -7.61136L-2.81461 -5.02797C-2.81461 -5.02797 -1.3238 1.52224 -4.55981 7.48526C-4.11672 7.5189 -3.66847 7.5392 -3.21522 7.53288C5.12023 7.41664 11.7808 0.635945 11.6634 -7.61401L11.6634 -7.61136Z\" fill=\"#1868DB\"/>\n\t\t</g>\n\t\t<path d=\"M5.67239 2.71364C5.90711 2.58408 6.19359 2.58646 6.42641 2.72078L8.69144 4.02848C8.92849 4.16524 9.07522 4.41898 9.07522 4.69232V7.30776C9.07522 7.58218 8.92938 7.83479 8.69162 7.97148L6.98899 8.95449C6.99272 8.94401 6.99627 8.93347 6.99965 8.92286C7.03126 8.82487 7.04801 8.72132 7.04801 8.61548V6.00004C7.04801 5.64073 6.8569 5.3094 6.54519 5.13016L5.27598 4.39771V3.3846C5.27598 3.30477 5.28833 3.22678 5.31168 3.15296C5.3691 2.97429 5.49122 2.81962 5.65828 2.72306L5.65879 2.72277C5.66358 2.72001 5.66814 2.71694 5.67239 2.71364Z\" fill=\"white\"/>\n\t\t<path d=\"M5.09599 3.04811L3.39336 4.03112C3.1556 4.1678 3.00977 4.42042 3.00977 4.69484V7.31028C3.00977 7.58362 3.15646 7.83734 3.39352 7.9741L5.65857 9.28182C5.89139 9.41612 6.17789 9.41851 6.4126 9.28896C6.41685 9.28566 6.42137 9.28261 6.42616 9.27985C6.59341 9.18336 6.71572 9.02863 6.77323 8.84989C6.79663 8.77599 6.809 8.69792 6.809 8.618V7.60489L5.53987 6.87249C5.22822 6.69323 5.03697 6.36183 5.03697 6.00256V3.38712C5.03697 3.28142 5.05368 3.17802 5.0852 3.08015C5.08862 3.0694 5.09222 3.05872 5.09599 3.04811Z\" fill=\"white\"/>\n\t</svg>";
|
|
11
11
|
var RovoLogoSVG = function RovoLogoSVG(_ref) {
|
|
12
12
|
var label = _ref.label,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { OnOpenChangeArgs } from '@atlaskit/dropdown-menu';
|
|
3
|
+
import type { ToolbarKeyboardNavigationProviderConfig } from '../types';
|
|
3
4
|
type AnalyticsEventPayload = {
|
|
4
5
|
action: string;
|
|
5
6
|
actionSubject?: string;
|
|
@@ -13,6 +14,10 @@ export type ToolbarUIContextType = {
|
|
|
13
14
|
* Indicates whether the toolbar is disabled when the editor is offline.
|
|
14
15
|
*/
|
|
15
16
|
isDisabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Configuration for Keyboard Shortcuts/ Navigation
|
|
19
|
+
*/
|
|
20
|
+
keyboardNavigation?: ToolbarKeyboardNavigationProviderConfig;
|
|
16
21
|
/**
|
|
17
22
|
* Callback for when the dropdown is open/closed. Receives an object with `isOpen` state.
|
|
18
23
|
*
|
|
@@ -34,5 +39,5 @@ export declare const useToolbarUI: () => ToolbarUIContextType;
|
|
|
34
39
|
type ToolbarUIProviderProps = {
|
|
35
40
|
children: React.ReactNode;
|
|
36
41
|
} & ToolbarUIContextType;
|
|
37
|
-
export declare const ToolbarUIProvider: ({ children, onDropdownOpenChanged, preventDefaultOnMouseDown, isDisabled, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, fireAnalyticsEvent, }: ToolbarUIProviderProps) => React.JSX.Element;
|
|
42
|
+
export declare const ToolbarUIProvider: ({ children, onDropdownOpenChanged, preventDefaultOnMouseDown, isDisabled, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, fireAnalyticsEvent, keyboardNavigation, }: ToolbarUIProviderProps) => React.JSX.Element;
|
|
38
43
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { ToolbarDropdownMenu } from './ui/ToolbarDropdownMenu';
|
|
|
5
5
|
export { ToolbarDropdownItem } from './ui/ToolbarDropdownItem';
|
|
6
6
|
export { ToolbarDropdownItemSection } from './ui/ToolbarDropdownItemSection';
|
|
7
7
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
8
|
+
export { ToolbarKeyboardNavigationProvider } from './ui/ToolbarKeyboardNavigationProvider';
|
|
8
9
|
export { ToolbarKeyboardShortcutHint } from './ui/ToolbarKeyboardShortcutHint';
|
|
9
10
|
export { ToolbarSection } from './ui/ToolbarSection';
|
|
10
11
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
@@ -71,5 +72,5 @@ export { LoomIcon } from './ui/icons/LoomIcon';
|
|
|
71
72
|
export { PlusIcon } from './ui/icons/PlusIcon';
|
|
72
73
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
73
74
|
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
74
|
-
export type { IconComponent } from './types';
|
|
75
|
+
export type { IconComponent, ToolbarKeyboardNavigationProviderConfig } from './types';
|
|
75
76
|
export { useToolbarUI, ToolbarUIProvider, type ToolbarUIContextType } from './hooks/ui-context';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import { type NewCoreIconProps } from '@atlaskit/icon';
|
|
2
2
|
export type IconComponent = (props: NewCoreIconProps) => JSX.Element;
|
|
3
|
+
export type ToolbarKeyboardNavigationProviderConfig = {
|
|
4
|
+
ariaControls?: string;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
childComponentSelector: string;
|
|
7
|
+
dom?: HTMLElement;
|
|
8
|
+
handleEscape: (event: KeyboardEvent) => void;
|
|
9
|
+
handleFocus: (event: KeyboardEvent) => void;
|
|
10
|
+
isShortcutToFocusToolbar: (event: KeyboardEvent) => boolean;
|
|
11
|
+
};
|
|
@@ -9,13 +9,14 @@ type ToolbarProps = {
|
|
|
9
9
|
* use case: query select the toolbar to position floating toolbar
|
|
10
10
|
*/
|
|
11
11
|
label: string;
|
|
12
|
+
testId?: string;
|
|
12
13
|
} & ViewEventEmitterProps;
|
|
13
14
|
/**
|
|
14
15
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
15
16
|
*
|
|
16
17
|
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
17
18
|
*/
|
|
18
|
-
export declare const Toolbar: ({ children, label, actionSubjectId }: ToolbarProps) => React.JSX.Element;
|
|
19
|
+
export declare const Toolbar: ({ children, label, actionSubjectId, testId }: ToolbarProps) => React.JSX.Element;
|
|
19
20
|
type PrimaryToolbarProps = ToolbarProps & ResponsiveContainerProps;
|
|
20
21
|
/**
|
|
21
22
|
* A simple component representing a toolbar without box shadows - used to represent a primary toolbar
|