@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`f4c0936dc05fe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f4c0936dc05fe) -
|
|
8
|
+
ED-29391 Add keyboard support for block menu
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 0.9.4
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`8adbc2f7e1db0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8adbc2f7e1db0) -
|
|
19
|
+
Updated the rovo logo to the latest iterations
|
|
20
|
+
- [`bb498825fca37`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bb498825fca37) -
|
|
21
|
+
[ux] [ED-29266] add ToolbarKeyboardNavigationProvider to selection toolbar with Alt+F10 shortcut
|
|
22
|
+
to focus
|
|
23
|
+
|
|
3
24
|
## 0.9.3
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -12,7 +12,8 @@ var ToolbarUIContext = /*#__PURE__*/(0, _react.createContext)({
|
|
|
12
12
|
preventDefaultOnMouseDown: false,
|
|
13
13
|
isDisabled: false,
|
|
14
14
|
popupsMountPoint: undefined,
|
|
15
|
-
fireAnalyticsEvent: undefined
|
|
15
|
+
fireAnalyticsEvent: undefined,
|
|
16
|
+
keyboardNavigation: undefined
|
|
16
17
|
});
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -33,7 +34,8 @@ var ToolbarUIProvider = exports.ToolbarUIProvider = function ToolbarUIProvider(_
|
|
|
33
34
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
34
35
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
35
36
|
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
36
|
-
fireAnalyticsEvent = _ref.fireAnalyticsEvent
|
|
37
|
+
fireAnalyticsEvent = _ref.fireAnalyticsEvent,
|
|
38
|
+
keyboardNavigation = _ref.keyboardNavigation;
|
|
37
39
|
return /*#__PURE__*/_react.default.createElement(ToolbarUIContext.Provider, {
|
|
38
40
|
value: {
|
|
39
41
|
onDropdownOpenChanged: onDropdownOpenChanged,
|
|
@@ -42,7 +44,8 @@ var ToolbarUIProvider = exports.ToolbarUIProvider = function ToolbarUIProvider(_
|
|
|
42
44
|
popupsMountPoint: popupsMountPoint,
|
|
43
45
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
44
46
|
popupsScrollableElement: popupsScrollableElement,
|
|
45
|
-
fireAnalyticsEvent: fireAnalyticsEvent
|
|
47
|
+
fireAnalyticsEvent: fireAnalyticsEvent,
|
|
48
|
+
keyboardNavigation: keyboardNavigation
|
|
46
49
|
}
|
|
47
50
|
}, children);
|
|
48
51
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -406,6 +406,12 @@ Object.defineProperty(exports, "ToolbarDropdownMenuProvider", {
|
|
|
406
406
|
return _ToolbarDropdownMenuContext.ToolbarDropdownMenuProvider;
|
|
407
407
|
}
|
|
408
408
|
});
|
|
409
|
+
Object.defineProperty(exports, "ToolbarKeyboardNavigationProvider", {
|
|
410
|
+
enumerable: true,
|
|
411
|
+
get: function get() {
|
|
412
|
+
return _ToolbarKeyboardNavigationProvider.ToolbarKeyboardNavigationProvider;
|
|
413
|
+
}
|
|
414
|
+
});
|
|
409
415
|
Object.defineProperty(exports, "ToolbarKeyboardShortcutHint", {
|
|
410
416
|
enumerable: true,
|
|
411
417
|
get: function get() {
|
|
@@ -473,6 +479,7 @@ var _ToolbarDropdownMenu = require("./ui/ToolbarDropdownMenu");
|
|
|
473
479
|
var _ToolbarDropdownItem = require("./ui/ToolbarDropdownItem");
|
|
474
480
|
var _ToolbarDropdownItemSection = require("./ui/ToolbarDropdownItemSection");
|
|
475
481
|
var _ToolbarNestedDropdownMenu = require("./ui/ToolbarNestedDropdownMenu");
|
|
482
|
+
var _ToolbarKeyboardNavigationProvider = require("./ui/ToolbarKeyboardNavigationProvider");
|
|
476
483
|
var _ToolbarKeyboardShortcutHint = require("./ui/ToolbarKeyboardShortcutHint");
|
|
477
484
|
var _ToolbarSection = require("./ui/ToolbarSection");
|
|
478
485
|
var _ToolbarTooltip = require("./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
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -61,14 +61,12 @@ var Color = exports.Color = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
61
61
|
onKeyDown: handleKeyDown,
|
|
62
62
|
onMouseDown: handleMouseDown,
|
|
63
63
|
tabIndex: tabIndex,
|
|
64
|
-
autoFocus: autoFocus,
|
|
65
|
-
className: (0, _runtime.ax)(["_ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _2rko12b0 _19it1oet _4t3icr4y _1bsbcr4y _bfhkm7j4 _80omtlke _1e0c1ule _kqswh2mm _y2mvuigy _1bg4v77o"]),
|
|
66
64
|
style: {
|
|
67
65
|
backgroundColor: colorStyle || "var(--ds-background-input, #FFFFFF)",
|
|
68
|
-
border: "var(--ds-border-width, 1px)".concat(" solid ", borderColor)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
border: "var(--ds-border-width, 1px)".concat(" solid ", borderColor)
|
|
67
|
+
},
|
|
68
|
+
autoFocus: autoFocus,
|
|
69
|
+
className: (0, _runtime.ax)(["_ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _2rko12b0 _19it1ps9 _4t3icr4y _1bsbcr4y _bfhkm7j4 _80omtlke _1e0c1ule _kqswh2mm _y2mv1q03 _1bg4v77o"])
|
|
72
70
|
}, !decorator && isSelected && /*#__PURE__*/_react.default.createElement(_checkMarkEditorDone.default, {
|
|
73
71
|
color: checkMarkColor,
|
|
74
72
|
LEGACY_primaryColor: checkMarkColor,
|
|
@@ -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/cjs/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
|
"use strict";
|
|
@@ -14,7 +14,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
14
14
|
var _css = require("@atlaskit/css");
|
|
15
15
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
16
16
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
|
+
var _uiContext = require("../hooks/ui-context");
|
|
17
18
|
var _ResponsiveContainer = require("./ResponsiveContainer");
|
|
19
|
+
var _ToolbarKeyboardNavigationProvider = require("./ToolbarKeyboardNavigationProvider");
|
|
18
20
|
var _ViewEventEmitter = require("./ViewEventEmitter");
|
|
19
21
|
var styles = {
|
|
20
22
|
toolbarBase: "_2rko1qi0 _zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
@@ -31,20 +33,43 @@ var styles = {
|
|
|
31
33
|
var Toolbar = exports.Toolbar = function Toolbar(_ref) {
|
|
32
34
|
var children = _ref.children,
|
|
33
35
|
label = _ref.label,
|
|
34
|
-
actionSubjectId = _ref.actionSubjectId
|
|
36
|
+
actionSubjectId = _ref.actionSubjectId,
|
|
37
|
+
testId = _ref.testId;
|
|
35
38
|
var isResponsiveEnabled = (0, _expValEquals.expValEquals)('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
36
39
|
var toolbar = /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
37
40
|
xcss: (0, _css.cx)(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
38
41
|
role: "toolbar",
|
|
39
|
-
"aria-label": label
|
|
42
|
+
"aria-label": label,
|
|
43
|
+
testId: testId
|
|
40
44
|
}, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(_ViewEventEmitter.ViewEventEmitter, {
|
|
41
45
|
actionSubject: _ViewEventEmitter.ACTION_SUBJECT.TOOLBAR,
|
|
42
46
|
actionSubjectId: actionSubjectId
|
|
43
47
|
}) : null, children);
|
|
48
|
+
var wrappedToolbar = toolbar;
|
|
49
|
+
var _useToolbarUI = (0, _uiContext.useToolbarUI)(),
|
|
50
|
+
keyboardNavigation = _useToolbarUI.keyboardNavigation;
|
|
51
|
+
if (keyboardNavigation) {
|
|
52
|
+
var childComponentSelector = keyboardNavigation.childComponentSelector,
|
|
53
|
+
dom = keyboardNavigation.dom,
|
|
54
|
+
handleEscape = keyboardNavigation.handleEscape,
|
|
55
|
+
handleFocus = keyboardNavigation.handleFocus,
|
|
56
|
+
isShortcutToFocusToolbar = keyboardNavigation.isShortcutToFocusToolbar,
|
|
57
|
+
ariaControls = keyboardNavigation.ariaControls,
|
|
58
|
+
ariaLabel = keyboardNavigation.ariaLabel;
|
|
59
|
+
wrappedToolbar = /*#__PURE__*/_react.default.createElement(_ToolbarKeyboardNavigationProvider.ToolbarKeyboardNavigationProvider, {
|
|
60
|
+
childComponentSelector: childComponentSelector,
|
|
61
|
+
dom: dom,
|
|
62
|
+
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
63
|
+
handleEscape: handleEscape,
|
|
64
|
+
handleFocus: handleFocus,
|
|
65
|
+
ariaControls: ariaControls,
|
|
66
|
+
ariaLabel: ariaLabel
|
|
67
|
+
}, toolbar);
|
|
68
|
+
}
|
|
44
69
|
if (isResponsiveEnabled) {
|
|
45
|
-
return /*#__PURE__*/_react.default.createElement(_ResponsiveContainer.ResponsiveWrapper, null,
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement(_ResponsiveContainer.ResponsiveWrapper, null, wrappedToolbar);
|
|
46
71
|
} else {
|
|
47
|
-
return
|
|
72
|
+
return wrappedToolbar;
|
|
48
73
|
}
|
|
49
74
|
};
|
|
50
75
|
/**
|
|
@@ -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
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -93,7 +93,9 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
|
|
|
93
93
|
ref: triggerRef,
|
|
94
94
|
href: href,
|
|
95
95
|
target: target,
|
|
96
|
-
rel: rel
|
|
96
|
+
rel: rel
|
|
97
|
+
// @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)
|
|
98
|
+
,
|
|
97
99
|
component: href && (0, _expValEquals.expValEquals)('platform_editor_toolbar_migrate_loom', 'isEnabled', true) ? undefined : CustomDropdownMenuItemButton,
|
|
98
100
|
testId: testId,
|
|
99
101
|
"data-toolbar-component": "menu-item",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ToolbarKeyboardNavigationProvider = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
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); }
|
|
10
|
+
var ToolbarKeyboardNavigationProvider = exports.ToolbarKeyboardNavigationProvider = function ToolbarKeyboardNavigationProvider(_ref) {
|
|
11
|
+
var children = _ref.children,
|
|
12
|
+
childComponentSelector = _ref.childComponentSelector,
|
|
13
|
+
dom = _ref.dom,
|
|
14
|
+
isShortcutToFocusToolbar = _ref.isShortcutToFocusToolbar,
|
|
15
|
+
handleFocus = _ref.handleFocus,
|
|
16
|
+
handleEscape = _ref.handleEscape,
|
|
17
|
+
ariaLabel = _ref.ariaLabel,
|
|
18
|
+
ariaControls = _ref.ariaControls;
|
|
19
|
+
var wrapperRef = (0, _react.useRef)(null);
|
|
20
|
+
(0, _react.useLayoutEffect)(function () {
|
|
21
|
+
if (!wrapperRef.current) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
var element = wrapperRef.current;
|
|
25
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
26
|
+
var targetElement = event.target;
|
|
27
|
+
if (targetElement instanceof HTMLElement && !targetElement.closest("".concat(childComponentSelector))) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
switch (event.key) {
|
|
31
|
+
case 'Escape':
|
|
32
|
+
handleEscape(event);
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var globalKeyDownHandler = function globalKeyDownHandler(event) {
|
|
38
|
+
if (isShortcutToFocusToolbar && isShortcutToFocusToolbar(event)) {
|
|
39
|
+
handleFocus(event);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
45
|
+
element === null || element === void 0 || element.addEventListener('keydown', handleKeyDown);
|
|
46
|
+
// ignored via go/ees005
|
|
47
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
48
|
+
dom === null || dom === void 0 || dom.addEventListener('keydown', globalKeyDownHandler);
|
|
49
|
+
return function () {
|
|
50
|
+
// ignored via go/ees005
|
|
51
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
52
|
+
element === null || element === void 0 || element.removeEventListener('keydown', handleKeyDown);
|
|
53
|
+
// ignored via go/ees005
|
|
54
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
55
|
+
dom === null || dom === void 0 || dom.removeEventListener('keydown', globalKeyDownHandler);
|
|
56
|
+
};
|
|
57
|
+
}, [wrapperRef, childComponentSelector, dom, isShortcutToFocusToolbar, handleFocus, handleEscape]);
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- ignored via go/DSP-18766
|
|
60
|
+
className: "custom-key-handler-wrapper",
|
|
61
|
+
ref: wrapperRef,
|
|
62
|
+
"aria-label": ariaLabel,
|
|
63
|
+
"aria-controls": ariaControls
|
|
64
|
+
}, children);
|
|
65
|
+
};
|
|
@@ -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
|
"use strict";
|
|
4
4
|
|
|
@@ -26,11 +26,13 @@ var ToolbarNestedDropdownMenu = exports.ToolbarNestedDropdownMenu = function Too
|
|
|
26
26
|
children = _ref.children,
|
|
27
27
|
isDisabled = _ref.isDisabled,
|
|
28
28
|
testId = _ref.testId,
|
|
29
|
+
dropdownTestId = _ref.dropdownTestId,
|
|
29
30
|
_ref$enableMaxHeight = _ref.enableMaxHeight,
|
|
30
31
|
enableMaxHeight = _ref$enableMaxHeight === void 0 ? false : _ref$enableMaxHeight,
|
|
31
32
|
_onClick = _ref.onClick;
|
|
32
33
|
return /*#__PURE__*/React.createElement(_dropdownMenu.default, {
|
|
33
34
|
placement: "right-start",
|
|
35
|
+
testId: dropdownTestId,
|
|
34
36
|
trigger: function trigger(triggerProps) {
|
|
35
37
|
return /*#__PURE__*/React.createElement(_ToolbarDropdownItem.ToolbarDropdownItem, {
|
|
36
38
|
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
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -14,7 +14,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
14
14
|
var styles = {
|
|
15
15
|
container: "_1e0c1txw _4cvr1h6o _1bah1h6o _4t3i1crf _1bsb1crf"
|
|
16
16
|
};
|
|
17
|
-
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.
|
|
17
|
+
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>";
|
|
18
18
|
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>";
|
|
19
19
|
var RovoLogoSVG = function RovoLogoSVG(_ref) {
|
|
20
20
|
var label = _ref.label,
|
|
@@ -4,7 +4,8 @@ const 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 const ToolbarUIProvider = ({
|
|
|
25
26
|
popupsMountPoint,
|
|
26
27
|
popupsBoundariesElement,
|
|
27
28
|
popupsScrollableElement,
|
|
28
|
-
fireAnalyticsEvent
|
|
29
|
+
fireAnalyticsEvent,
|
|
30
|
+
keyboardNavigation
|
|
29
31
|
}) => {
|
|
30
32
|
return /*#__PURE__*/React.createElement(ToolbarUIContext.Provider, {
|
|
31
33
|
value: {
|
|
@@ -35,7 +37,8 @@ export const ToolbarUIProvider = ({
|
|
|
35
37
|
popupsMountPoint,
|
|
36
38
|
popupsBoundariesElement,
|
|
37
39
|
popupsScrollableElement,
|
|
38
|
-
fireAnalyticsEvent
|
|
40
|
+
fireAnalyticsEvent,
|
|
41
|
+
keyboardNavigation
|
|
39
42
|
}
|
|
40
43
|
}, children);
|
|
41
44
|
};
|
package/dist/es2019/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';
|
|
@@ -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
|
+
._jyzfmuej:focus-within{border-color:var(--ds-border,#091e4224)}
|
|
22
23
|
._y2mv1q03:focus{outline:var(--ds-border-width-focused,2px) solid var(--ds-border-focused,#388bff)}
|
|
23
|
-
._858umuej:focus
|
|
24
|
-
._1bg4v77o:focus{outline-offset:var(--ds-space-025,2px)}
|
|
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
|
-
/* 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}
|
|
@@ -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
|
const styles = {
|
|
13
15
|
toolbarBase: "_2rko1qi0 _zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
@@ -24,21 +26,47 @@ const styles = {
|
|
|
24
26
|
export const Toolbar = ({
|
|
25
27
|
children,
|
|
26
28
|
label,
|
|
27
|
-
actionSubjectId
|
|
29
|
+
actionSubjectId,
|
|
30
|
+
testId
|
|
28
31
|
}) => {
|
|
29
32
|
const isResponsiveEnabled = expValEquals('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
30
33
|
const toolbar = /*#__PURE__*/React.createElement(Box, {
|
|
31
34
|
xcss: cx(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
32
35
|
role: "toolbar",
|
|
33
|
-
"aria-label": label
|
|
36
|
+
"aria-label": label,
|
|
37
|
+
testId: testId
|
|
34
38
|
}, expValEquals('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ViewEventEmitter, {
|
|
35
39
|
actionSubject: ACTION_SUBJECT.TOOLBAR,
|
|
36
40
|
actionSubjectId: actionSubjectId
|
|
37
41
|
}) : null, children);
|
|
42
|
+
let wrappedToolbar = toolbar;
|
|
43
|
+
const {
|
|
44
|
+
keyboardNavigation
|
|
45
|
+
} = useToolbarUI();
|
|
46
|
+
if (keyboardNavigation) {
|
|
47
|
+
const {
|
|
48
|
+
childComponentSelector,
|
|
49
|
+
dom,
|
|
50
|
+
handleEscape,
|
|
51
|
+
handleFocus,
|
|
52
|
+
isShortcutToFocusToolbar,
|
|
53
|
+
ariaControls,
|
|
54
|
+
ariaLabel
|
|
55
|
+
} = keyboardNavigation;
|
|
56
|
+
wrappedToolbar = /*#__PURE__*/React.createElement(ToolbarKeyboardNavigationProvider, {
|
|
57
|
+
childComponentSelector: childComponentSelector,
|
|
58
|
+
dom: dom,
|
|
59
|
+
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
60
|
+
handleEscape: handleEscape,
|
|
61
|
+
handleFocus: handleFocus,
|
|
62
|
+
ariaControls: ariaControls,
|
|
63
|
+
ariaLabel: ariaLabel
|
|
64
|
+
}, toolbar);
|
|
65
|
+
}
|
|
38
66
|
if (isResponsiveEnabled) {
|
|
39
|
-
return /*#__PURE__*/React.createElement(ResponsiveWrapper, null,
|
|
67
|
+
return /*#__PURE__*/React.createElement(ResponsiveWrapper, null, wrappedToolbar);
|
|
40
68
|
} else {
|
|
41
|
-
return
|
|
69
|
+
return wrappedToolbar;
|
|
42
70
|
}
|
|
43
71
|
};
|
|
44
72
|
/**
|
|
@@ -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';
|