@atlaskit/editor-toolbar 0.9.2 → 0.9.4

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/hooks/ui-context.js +6 -3
  3. package/dist/cjs/index.js +7 -0
  4. package/dist/cjs/ui/ColorPalette/Color.compiled.css +6 -4
  5. package/dist/cjs/ui/ColorPalette/Color.js +5 -7
  6. package/dist/cjs/ui/ColorPalette/index.js +1 -1
  7. package/dist/cjs/ui/ResponsiveContainer.compiled.css +8 -2
  8. package/dist/cjs/ui/ResponsiveContainer.js +1 -1
  9. package/dist/cjs/ui/Toolbar.compiled.css +3 -2
  10. package/dist/cjs/ui/Toolbar.js +30 -5
  11. package/dist/cjs/ui/ToolbarButton.js +1 -1
  12. package/dist/cjs/ui/ToolbarButtonGroup.js +1 -1
  13. package/dist/cjs/ui/ToolbarColorSwatch.js +1 -1
  14. package/dist/cjs/ui/ToolbarDropdownItem.js +22 -3
  15. package/dist/cjs/ui/ToolbarDropdownMenu.js +1 -1
  16. package/dist/cjs/ui/ToolbarKeyboardNavigationProvider.js +65 -0
  17. package/dist/cjs/ui/ToolbarKeyboardShortcutHint.js +11 -1
  18. package/dist/cjs/ui/ToolbarNestedDropdownMenu.js +1 -1
  19. package/dist/cjs/ui/ToolbarSection.js +1 -1
  20. package/dist/cjs/ui/icons/AIChatIcon.js +2 -2
  21. package/dist/cjs/ui/icons/TextColorIcon.js +1 -1
  22. package/dist/es2019/hooks/ui-context.js +6 -3
  23. package/dist/es2019/index.js +1 -0
  24. package/dist/es2019/ui/ColorPalette/Color.compiled.css +4 -2
  25. package/dist/es2019/ui/ColorPalette/Color.js +1 -1
  26. package/dist/es2019/ui/ColorPalette/index.js +1 -1
  27. package/dist/es2019/ui/ResponsiveContainer.compiled.css +8 -2
  28. package/dist/es2019/ui/ResponsiveContainer.js +1 -1
  29. package/dist/es2019/ui/Toolbar.compiled.css +3 -2
  30. package/dist/es2019/ui/Toolbar.js +33 -5
  31. package/dist/es2019/ui/ToolbarButton.js +1 -1
  32. package/dist/es2019/ui/ToolbarButtonGroup.js +1 -1
  33. package/dist/es2019/ui/ToolbarColorSwatch.js +1 -1
  34. package/dist/es2019/ui/ToolbarDropdownItem.js +20 -4
  35. package/dist/es2019/ui/ToolbarDropdownMenu.js +1 -1
  36. package/dist/es2019/ui/ToolbarKeyboardNavigationProvider.js +60 -0
  37. package/dist/es2019/ui/ToolbarKeyboardShortcutHint.js +11 -1
  38. package/dist/es2019/ui/ToolbarNestedDropdownMenu.js +1 -1
  39. package/dist/es2019/ui/ToolbarSection.js +1 -1
  40. package/dist/es2019/ui/icons/AIChatIcon.js +7 -7
  41. package/dist/es2019/ui/icons/TextColorIcon.js +1 -1
  42. package/dist/esm/hooks/ui-context.js +6 -3
  43. package/dist/esm/index.js +1 -0
  44. package/dist/esm/ui/ColorPalette/Color.compiled.css +6 -4
  45. package/dist/esm/ui/ColorPalette/Color.js +5 -7
  46. package/dist/esm/ui/ColorPalette/index.js +1 -1
  47. package/dist/esm/ui/ResponsiveContainer.compiled.css +8 -2
  48. package/dist/esm/ui/ResponsiveContainer.js +1 -1
  49. package/dist/esm/ui/Toolbar.compiled.css +3 -2
  50. package/dist/esm/ui/Toolbar.js +30 -5
  51. package/dist/esm/ui/ToolbarButton.js +1 -1
  52. package/dist/esm/ui/ToolbarButtonGroup.js +1 -1
  53. package/dist/esm/ui/ToolbarColorSwatch.js +1 -1
  54. package/dist/esm/ui/ToolbarDropdownItem.js +22 -4
  55. package/dist/esm/ui/ToolbarDropdownMenu.js +1 -1
  56. package/dist/esm/ui/ToolbarKeyboardNavigationProvider.js +57 -0
  57. package/dist/esm/ui/ToolbarKeyboardShortcutHint.js +11 -1
  58. package/dist/esm/ui/ToolbarNestedDropdownMenu.js +1 -1
  59. package/dist/esm/ui/ToolbarSection.js +1 -1
  60. package/dist/esm/ui/icons/AIChatIcon.js +2 -2
  61. package/dist/esm/ui/icons/TextColorIcon.js +1 -1
  62. package/dist/types/hooks/ui-context.d.ts +6 -1
  63. package/dist/types/index.d.ts +2 -1
  64. package/dist/types/types.d.ts +9 -0
  65. package/dist/types/ui/Toolbar.d.ts +2 -1
  66. package/dist/types/ui/ToolbarKeyboardNavigationProvider.d.ts +7 -0
  67. package/dist/types/ui/ToolbarKeyboardShortcutHint.d.ts +2 -1
  68. package/dist/types-ts4.5/hooks/ui-context.d.ts +6 -1
  69. package/dist/types-ts4.5/index.d.ts +2 -1
  70. package/dist/types-ts4.5/types.d.ts +9 -0
  71. package/dist/types-ts4.5/ui/Toolbar.d.ts +2 -1
  72. package/dist/types-ts4.5/ui/ToolbarKeyboardNavigationProvider.d.ts +7 -0
  73. package/dist/types-ts4.5/ui/ToolbarKeyboardShortcutHint.d.ts +2 -1
  74. package/package.json +3 -3
@@ -1,6 +1,16 @@
1
1
  import React from 'react';
2
2
  import Badge from '@atlaskit/badge';
3
+ import { Text } from '@atlaskit/primitives/compiled';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
5
  export var ToolbarKeyboardShortcutHint = function ToolbarKeyboardShortcutHint(_ref) {
4
- var shortcut = _ref.shortcut;
6
+ var shortcut = _ref.shortcut,
7
+ isDisabled = _ref.isDisabled;
8
+ if (isDisabled && expValEquals('platform_editor_toolbar_aifc_patch_5', 'isEnabled', true)) {
9
+ return /*#__PURE__*/React.createElement(Badge, {
10
+ appearance: "primaryInverted"
11
+ }, /*#__PURE__*/React.createElement(Text, {
12
+ color: "color.text.disabled"
13
+ }, shortcut));
14
+ }
5
15
  return /*#__PURE__*/React.createElement(Badge, null, shortcut);
6
16
  };
@@ -1,4 +1,4 @@
1
- /* ToolbarNestedDropdownMenu.tsx generated by @compiled/babel-plugin v0.36.1 */
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';
@@ -1,4 +1,4 @@
1
- /* ToolbarSection.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* ToolbarSection.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./ToolbarSection.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* AIChatIcon.tsx generated by @compiled/babel-plugin v0.36.1 */
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.38005 0.169224C5.79662 -0.0605531 6.30506 -0.0563318 6.71826 0.181888L9.96759 2.05659L10.7381 2.50115C11.1588 2.7437 11.4192 3.1937 11.4192 3.67848V8.31706C11.4192 8.80376 11.1604 9.25178 10.7385 9.4942L7.7167 11.2376C7.72331 11.219 7.72962 11.2003 7.73562 11.1815C7.79171 11.0077 7.82145 10.8241 7.82145 10.6363V5.99777C7.82145 5.36053 7.48227 4.77289 6.92906 4.455L6.37092 4.13312L4.67653 3.15598V1.35919C4.67653 1.21761 4.69843 1.0793 4.73988 0.94837C4.84178 0.631497 5.05851 0.357177 5.35502 0.185934L5.35592 0.185415C5.36442 0.180511 5.3725 0.175072 5.38005 0.169224Z\" fill=\"#BF63F3\"/>\n\t\t<path d=\"M4.35709 0.762414L1.33533 2.50581C0.91337 2.74824 0.654541 3.19625 0.654541 3.68296V8.32154C0.654541 8.80632 0.914896 9.25629 1.33561 9.49884L2.05206 9.91219L5.35553 11.8181C5.76872 12.0563 6.27718 12.0606 6.69374 11.8308C6.70128 11.8249 6.70931 11.8195 6.71781 11.8146C7.01464 11.6435 7.2317 11.3691 7.33377 11.0521C7.37531 10.921 7.39726 10.7826 7.39726 10.6408V8.84403L5.64872 7.83566L5.14486 7.54509C4.59175 7.22718 4.25234 6.63942 4.25234 6.00225V1.36366C4.25234 1.17621 4.28199 0.992813 4.33793 0.819233C4.344 0.800172 4.35039 0.781229 4.35709 0.762414Z\" fill=\"#BF63F3\"/>\n\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.64872 7.83566L2.05206 9.91219L1.33561 9.49884C0.914896 9.25629 0.654541 8.80632 0.654541 8.32154V3.68296C0.654541 3.19625 0.91337 2.74824 1.33533 2.50581L4.35709 0.762414C4.35039 0.781229 4.344 0.800172 4.33793 0.819233C4.28199 0.992813 4.25234 1.17621 4.25234 1.36366V6.00225C4.25234 6.63942 4.59175 7.22718 5.14486 7.54509L5.64872 7.83566Z\" fill=\"#1868DB\"/>\n\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6.37092 4.13312L4.67653 3.15598V1.35919C4.67653 1.21761 4.69843 1.0793 4.73988 0.94837C4.84178 0.631497 5.05851 0.357177 5.35502 0.185934L5.35592 0.185415C5.36442 0.180511 5.3725 0.175072 5.38005 0.169224C5.79662 -0.0605531 6.30506 -0.0563318 6.71826 0.181888L9.96759 2.05659L6.37092 4.13312Z\" fill=\"#BF63F3\"/>\n\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M10.7381 2.50115L9.96759 2.05659L6.37092 4.13312L6.92906 4.455C7.48227 4.77289 7.82145 5.36053 7.82145 5.99777V10.6363C7.82145 10.8241 7.79171 11.0077 7.73562 11.1815C7.72962 11.2003 7.72331 11.219 7.7167 11.2376L10.7385 9.4942C11.1604 9.25178 11.4192 8.80376 11.4192 8.31706V3.67848C11.4192 3.1937 11.1588 2.7437 10.7381 2.50115Z\" fill=\"#FCA700\"/>\n\t\t<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.64872 7.83566L2.05206 9.91219L5.35553 11.8181C5.76872 12.0563 6.27718 12.0606 6.69374 11.8308C6.70128 11.8249 6.70931 11.8195 6.71781 11.8146C7.01464 11.6435 7.2317 11.3691 7.33377 11.0521C7.37531 10.921 7.39726 10.7826 7.39726 10.6408V8.84403L5.64872 7.83566Z\" fill=\"#82B536\"/>\n\t</svg>";
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,4 +1,4 @@
1
- /* TextColorIcon.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* TextColorIcon.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./TextColorIcon.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -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 {};
@@ -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';
@@ -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
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { ToolbarKeyboardNavigationProviderConfig } from '../types';
3
+ type ToolbarKeyboardNavigationProviderProps = ToolbarKeyboardNavigationProviderConfig & {
4
+ children: React.ReactNode;
5
+ };
6
+ export declare const ToolbarKeyboardNavigationProvider: ({ children, childComponentSelector, dom, isShortcutToFocusToolbar, handleFocus, handleEscape, ariaLabel, ariaControls }: ToolbarKeyboardNavigationProviderProps) => React.JSX.Element;
7
+ export {};
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  type ToolbarKeyboardShortcutHintProps = {
3
+ isDisabled?: boolean;
3
4
  shortcut: string;
4
5
  };
5
- export declare const ToolbarKeyboardShortcutHint: ({ shortcut }: ToolbarKeyboardShortcutHintProps) => React.JSX.Element;
6
+ export declare const ToolbarKeyboardShortcutHint: ({ shortcut, isDisabled, }: ToolbarKeyboardShortcutHintProps) => React.JSX.Element;
6
7
  export {};
@@ -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 {};
@@ -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';
@@ -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
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { ToolbarKeyboardNavigationProviderConfig } from '../types';
3
+ type ToolbarKeyboardNavigationProviderProps = ToolbarKeyboardNavigationProviderConfig & {
4
+ children: React.ReactNode;
5
+ };
6
+ export declare const ToolbarKeyboardNavigationProvider: ({ children, childComponentSelector, dom, isShortcutToFocusToolbar, handleFocus, handleEscape, ariaLabel, ariaControls }: ToolbarKeyboardNavigationProviderProps) => React.JSX.Element;
7
+ export {};
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  type ToolbarKeyboardShortcutHintProps = {
3
+ isDisabled?: boolean;
3
4
  shortcut: string;
4
5
  };
5
- export declare const ToolbarKeyboardShortcutHint: ({ shortcut }: ToolbarKeyboardShortcutHintProps) => React.JSX.Element;
6
+ export declare const ToolbarKeyboardShortcutHint: ({ shortcut, isDisabled, }: ToolbarKeyboardShortcutHintProps) => React.JSX.Element;
6
7
  export {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org/"
5
5
  },
6
- "version": "0.9.2",
6
+ "version": "0.9.4",
7
7
  "description": "Common UI for Toolbars across the platform",
8
8
  "atlassian": {
9
9
  "team": "Editor: Jenga",
@@ -31,8 +31,8 @@
31
31
  "@atlaskit/platform-feature-flags": "^1.1.0",
32
32
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
33
33
  "@atlaskit/popup": "^4.4.0",
34
- "@atlaskit/primitives": "^14.14.0",
35
- "@atlaskit/tmp-editor-statsig": "^12.24.0",
34
+ "@atlaskit/primitives": "^14.15.0",
35
+ "@atlaskit/tmp-editor-statsig": "^12.28.0",
36
36
  "@atlaskit/tokens": "^6.3.0",
37
37
  "@atlaskit/tooltip": "^20.4.0",
38
38
  "@babel/runtime": "^7.0.0",