@atlaskit/editor-common 70.3.0 → 71.0.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.
Files changed (75) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/cjs/analytics/types/enums.js +1 -0
  3. package/dist/cjs/keymaps/index.js +5 -8
  4. package/dist/cjs/messages/insert-block.js +12 -7
  5. package/dist/cjs/panel.js +6 -0
  6. package/dist/cjs/styles/shared/code-block.js +5 -5
  7. package/dist/cjs/styles/shared/panel.js +54 -17
  8. package/dist/cjs/styles/shared/table.js +12 -7
  9. package/dist/cjs/styles/shared/text-color.js +1 -1
  10. package/dist/cjs/ui/DropList/index.js +1 -1
  11. package/dist/cjs/ui-color/ColorPalette/Color/index.js +6 -2
  12. package/dist/cjs/ui-color/ColorPalette/index.js +21 -11
  13. package/dist/cjs/ui-menu/Dropdown/index.js +16 -2
  14. package/dist/cjs/ui-menu/DropdownMenu/index.js +27 -8
  15. package/dist/cjs/ui-menu/MenuArrowKeyNavigationProvider/index.js +162 -0
  16. package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +22 -13
  17. package/dist/cjs/utils/index.js +6 -0
  18. package/dist/cjs/utils/performance/measure-render.js +44 -23
  19. package/dist/cjs/version.json +1 -1
  20. package/dist/es2019/analytics/types/enums.js +1 -0
  21. package/dist/es2019/keymaps/index.js +4 -6
  22. package/dist/es2019/messages/insert-block.js +12 -7
  23. package/dist/es2019/panel.js +1 -1
  24. package/dist/es2019/styles/shared/code-block.js +39 -25
  25. package/dist/es2019/styles/shared/panel.js +48 -18
  26. package/dist/es2019/styles/shared/table.js +24 -13
  27. package/dist/es2019/styles/shared/text-color.js +1 -1
  28. package/dist/es2019/ui/DropList/index.js +1 -1
  29. package/dist/es2019/ui-color/ColorPalette/Color/index.js +6 -3
  30. package/dist/es2019/ui-color/ColorPalette/index.js +19 -11
  31. package/dist/es2019/ui-menu/Dropdown/index.js +13 -2
  32. package/dist/es2019/ui-menu/DropdownMenu/index.js +41 -6
  33. package/dist/es2019/ui-menu/MenuArrowKeyNavigationProvider/index.js +146 -0
  34. package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +20 -13
  35. package/dist/es2019/utils/index.js +1 -1
  36. package/dist/es2019/utils/performance/measure-render.js +43 -23
  37. package/dist/es2019/version.json +1 -1
  38. package/dist/esm/analytics/types/enums.js +1 -0
  39. package/dist/esm/keymaps/index.js +3 -6
  40. package/dist/esm/messages/insert-block.js +12 -7
  41. package/dist/esm/panel.js +1 -1
  42. package/dist/esm/styles/shared/code-block.js +5 -5
  43. package/dist/esm/styles/shared/panel.js +49 -18
  44. package/dist/esm/styles/shared/table.js +12 -9
  45. package/dist/esm/styles/shared/text-color.js +1 -1
  46. package/dist/esm/ui/DropList/index.js +1 -1
  47. package/dist/esm/ui-color/ColorPalette/Color/index.js +5 -2
  48. package/dist/esm/ui-color/ColorPalette/index.js +20 -11
  49. package/dist/esm/ui-menu/Dropdown/index.js +15 -2
  50. package/dist/esm/ui-menu/DropdownMenu/index.js +28 -9
  51. package/dist/esm/ui-menu/MenuArrowKeyNavigationProvider/index.js +147 -0
  52. package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +22 -13
  53. package/dist/esm/utils/index.js +1 -1
  54. package/dist/esm/utils/performance/measure-render.js +42 -23
  55. package/dist/esm/version.json +1 -1
  56. package/dist/types/analytics/types/enums.d.ts +1 -0
  57. package/dist/types/analytics/types/general-events.d.ts +2 -1
  58. package/dist/types/keymaps/index.d.ts +0 -1
  59. package/dist/types/messages/insert-block.d.ts +7 -2
  60. package/dist/types/panel.d.ts +1 -1
  61. package/dist/types/styles/shared/code-block.d.ts +1 -0
  62. package/dist/types/styles/shared/panel.d.ts +1 -0
  63. package/dist/types/types/feature-flags.d.ts +27 -6
  64. package/dist/types/types/floating-toolbar.d.ts +4 -0
  65. package/dist/types/ui-color/ColorPalette/Color/index.d.ts +5 -0
  66. package/dist/types/ui-color/ColorPalette/index.d.ts +8 -0
  67. package/dist/types/ui-menu/Dropdown/index.d.ts +3 -0
  68. package/dist/types/ui-menu/DropdownMenu/index.d.ts +1 -0
  69. package/dist/types/ui-menu/DropdownMenu/types.d.ts +7 -0
  70. package/dist/types/ui-menu/MenuArrowKeyNavigationProvider/index.d.ts +15 -0
  71. package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +2 -0
  72. package/dist/types/utils/index.d.ts +1 -1
  73. package/dist/types/utils/performance/measure-render.d.ts +12 -0
  74. package/package.json +8 -7
  75. package/report.api.md +12 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 71.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`2df5ab17c10`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2df5ab17c10) - DSP-6459: Adds a background to code blocks in the editor to remove transparency. E.g. prevents table cell background colors from affecting code blocks. Also modifies code blocks in table headers to have a border instead of a different color when design tokens are enabled.
8
+
9
+ ### Minor Changes
10
+
11
+ - [`2e7d2c81d2f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e7d2c81d2f) - EDM-3626 Remove plain text paste linkification feature flag
12
+ the feature flag will not exist anymore so this cannot be enabled/disabled
13
+ plain text containing URLs will always be 'linkified' using shift-cmd-v/shift-ctrl-v
14
+
15
+ ### Patch Changes
16
+
17
+ - [`25617fe0633`](https://bitbucket.org/atlassian/atlassian-frontend/commits/25617fe0633) - [ux] ED-16010 this updates the text color picker to use design tokens when available.
18
+ - [`94f8a899d36`](https://bitbucket.org/atlassian/atlassian-frontend/commits/94f8a899d36) - [ED-15851] Add feature flags for the restart numbered lists project. These include:
19
+
20
+ - restartNumberedLists: Allow numbered lists to start from any number greater than 0, not just 1
21
+ - listNumberContinuity: Allow lists to continue their numbering when split by other nodes
22
+ - restartNumberedListsToolbar: Show a toolbar for users to restart the numbering of a list
23
+
24
+ We will be encapsulating all dev work under these flags.
25
+
26
+ These flags are for development purposes only, please don't turn these on. Only feature leads can turn these on.
27
+
28
+ - [`01472b73d72`](https://bitbucket.org/atlassian/atlassian-frontend/commits/01472b73d72) - DSP-4815 - Adds design tokens to non-custom panels. Updated appearances only visible in applications configured to use the new Tokens API (currently in alpha).
29
+ - [`7a1a5d392ef`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7a1a5d392ef) - [ux][ed-15366] remove right align shortcut as it was interfering with default browser activity
30
+ - [`d5fd6da78ab`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d5fd6da78ab) - To add arrow key navigation for the main toolbar items and menu items [ED-15497]
31
+
32
+ To make the editor main toolbar items accessible using left and right arrow keys.
33
+ The menus are expandable using Space or Enter key, once the menus are expanded the options are accessible using up/down arrow keys.
34
+ 'Esc' key closes the menus and focuses the toolbar item.
35
+
36
+ - [`34f8542468b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34f8542468b) - [ED-12592] Updates the renderer rendered measurement to indicate when the measurement is distorted. Re uses distorted measurement identification logic from other render measurements.
37
+ - [`7bf4281949a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7bf4281949a) - ED-15704 - Fix missing hover inducators on Delete column and Delete row under table floating toolbar context menu
38
+ - [`977ac74443c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/977ac74443c) - DSP-7235: Fixes issue with overflow shadows on code blocks due to layered transparent colors.
39
+ - [`3a66592edd7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3a66592edd7) - [ED-16104] To fix a regression caused by [ED-15947] The arrow key behaviour is unexpected when we open find and replace button.
40
+ - [`17014a9004c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/17014a9004c) - [ux] ED-15632 preprocess invalid media adf to avoid empty mediaSingle node and duplicated captions and media inside mediaSingle.The document will be transformed for this cases and validation error not thrown.When mediaSingle with empty content is encountered - it will be removed.When mediaSingle with duplicated captions or media nodes is encountered - duplicate captions or media nodes will be removed, prioritising removal of nodes with empty content first.
41
+ - [`c2510fa261f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c2510fa261f) - [ux] ED-15961 [ux] Updates the presentation of text color to use dark and light mode colors when those modes are enabled
42
+ - [`47dfcc04652`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47dfcc04652) - ED-15703 - Minor change on floating toolbar to allow z-index value to be passed as parameter
43
+ - [`70fce47a47b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/70fce47a47b) - DSP-2423: Adds design token to the background color of tooltip keyboard shortcut styles.
44
+ - [`58365aae521`](https://bitbucket.org/atlassian/atlassian-frontend/commits/58365aae521) - [ux] Refactor messages on tooltip of media toolbar item and media slash commend result to show video as an explicit upload option.
45
+ - Updated dependencies
46
+
3
47
  ## 70.3.0
4
48
 
5
49
  ### Minor Changes
@@ -100,6 +100,7 @@ exports.ACTION = ACTION;
100
100
  ACTION["DEDUPE_MARKS_TRANSFORMED"] = "dedupeMarksTransformed";
101
101
  ACTION["NODES_MISSING_CONTENT_TRANSFORMED"] = "nodesMissingContentTransformed";
102
102
  ACTION["INDENTATION_MARKS_TRANSFORMED"] = "indentationMarksTransformed";
103
+ ACTION["INVALID_MEDIA_CONTENT_TRANSFORMED"] = "invalidMediaContentTransformed";
103
104
  ACTION["TOGGLE_EXPAND"] = "toggleExpand";
104
105
  ACTION["TRANSACTION_DISPATCHED"] = "transactionDispatched";
105
106
  ACTION["TRANSACTION_MUTATED_AFTER_DISPATCH"] = "transactionMutatedAfterDispatched";
@@ -80,7 +80,7 @@ Object.defineProperty(exports, "UP", {
80
80
  return _consts.UP;
81
81
  }
82
82
  });
83
- exports.backspace = exports.altPaste = exports.alignRight = exports.alignLeft = exports.addRowBefore = exports.addRowAfter = exports.addLink = exports.addInlineComment = exports.addColumnBefore = exports.addColumnAfter = exports.addAltText = void 0;
83
+ exports.backspace = exports.altPaste = exports.alignLeft = exports.addRowBefore = exports.addRowAfter = exports.addLink = exports.addInlineComment = exports.addColumnBefore = exports.addColumnAfter = exports.addAltText = void 0;
84
84
  exports.bindKeymapWithCommand = bindKeymapWithCommand;
85
85
  exports.find = exports.escape = exports.enter = exports.deleteKey = exports.cut = exports.ctrlBackSpace = exports.copy = exports.clearFormatting = void 0;
86
86
  exports.findKeyMapForBrowser = findKeyMapForBrowser;
@@ -102,6 +102,8 @@ var _react2 = require("@emotion/react");
102
102
 
103
103
  var _colors = require("@atlaskit/theme/colors");
104
104
 
105
+ var _tokens = require("@atlaskit/tokens");
106
+
105
107
  var _utils = require("../utils");
106
108
 
107
109
  var _consts = require("./consts");
@@ -236,19 +238,14 @@ var find = makeKeyMapWithCommon('Find', 'Mod-f');
236
238
  exports.find = find;
237
239
  var alignLeft = makeKeyMapWithCommon('Align Left', 'Mod-Shift-l');
238
240
  exports.alignLeft = alignLeft;
239
- var alignRight = makeKeyMapWithCommon('Align Right', 'Mod-Shift-r');
240
- exports.alignRight = alignRight;
241
241
  var arrowKeysMap = {
242
242
  // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
243
243
  ARROWLEFT: "\u2190",
244
244
  ARROWRIGHT: "\u2192",
245
245
  ARROWUP: "\u2191",
246
246
  ARROWDOWN: "\u2193"
247
- }; // TOOD: https://product-fabric.atlassian.net/browse/DSP-4460
248
-
249
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
250
-
251
- var tooltipShortcutStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 2px;\n background-color: ", ";\n padding: 0 2px;\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: tooltip-shortcut;\n"])), _colors.N400);
247
+ };
248
+ var tooltipShortcutStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 2px;\n background-color: ", ";\n padding: 0 2px;\n\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: tooltip-shortcut;\n"])), (0, _tokens.token)('color.background.inverse.subtle', _colors.N400));
252
249
  /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
253
250
 
254
251
  function formatShortcut(keymap) {
@@ -28,13 +28,18 @@ var toolbarInsertBlockMessages = (0, _reactIntlNext.defineMessages)({
28
28
  defaultMessage: 'Insert a link',
29
29
  description: 'Insert a hyperlink'
30
30
  },
31
- filesAndImages: {
32
- id: 'fabric.editor.filesAndImages',
33
- defaultMessage: 'Files & images',
34
- description: 'Insert one or more files or images'
35
- },
36
- filesAndImagesDescription: {
37
- id: 'fabric.editor.filesAndImages.description',
31
+ mediaFiles: {
32
+ id: 'fabric.editor.mediaFiles',
33
+ defaultMessage: 'Image, video, or file',
34
+ description: 'Insert one or more files, videos or images'
35
+ },
36
+ addMediaFiles: {
37
+ id: 'fabric.editor.addMediaFiles',
38
+ defaultMessage: 'Add image, video, or file',
39
+ description: 'Insert one or more files, videos or images'
40
+ },
41
+ mediaFilesDescription: {
42
+ id: 'fabric.editor.mediaFiles.description',
38
43
  defaultMessage: 'Add images and other files to your page',
39
44
  description: 'Insert one or more files or images'
40
45
  },
package/dist/cjs/panel.js CHANGED
@@ -39,6 +39,12 @@ Object.defineProperty(exports, "getPanelTypeBackground", {
39
39
  return _panel.getPanelTypeBackground;
40
40
  }
41
41
  });
42
+ Object.defineProperty(exports, "getPanelTypeBackgroundNoTokens", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _panel.getPanelTypeBackgroundNoTokens;
46
+ }
47
+ });
42
48
  Object.defineProperty(exports, "panelSharedStyles", {
43
49
  enumerable: true,
44
50
  get: function get() {
@@ -27,6 +27,7 @@ var CodeBlockSharedCssClassName = {
27
27
  CODEBLOCK_CONTAINER: 'code-block',
28
28
  CODEBLOCK_START: 'code-block--start',
29
29
  CODEBLOCK_END: 'code-block--end',
30
+ CODEBLOCK_CONTENT_WRAPPER: 'code-block-content-wrapper',
30
31
  CODEBLOCK_LINE_NUMBER_GUTTER: 'line-number-gutter',
31
32
  CODEBLOCK_CONTENT: 'code-content',
32
33
  DS_CODEBLOCK: '[data-ds--code--code-block]'
@@ -34,18 +35,17 @@ var CodeBlockSharedCssClassName = {
34
35
  exports.CodeBlockSharedCssClassName = CodeBlockSharedCssClassName;
35
36
 
36
37
  var codeBlockSharedStyles = function codeBlockSharedStyles(props) {
37
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n background-color: ", ";\n border-radius: ", "px;\n counter-reset: line;\n display: flex;\n overflow-x: auto;\n\n background-image: ", ";\n\n --ds--code--bg-color: transparent;\n\n background-repeat: no-repeat;\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n margin: ", " 0 0 0;\n min-width: ", "px;\n cursor: pointer;\n\n .", " {\n position: absolute;\n visibility: hidden;\n height: 1.5rem;\n top: 0px;\n left: 0px;\n }\n\n .", " {\n position: absolute;\n visibility: hidden;\n height: 1.5rem;\n bottom: 0px;\n right: 0px;\n }\n\n .", " {\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n ::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n color: ", ";\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: 1;\n\n code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n color: ", ";\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n }\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, (0, _components.themed)({
38
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n background-color: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n font-family: ", ";\n min-width: ", "px;\n cursor: pointer;\n\n --ds--code--bg-color: transparent;\n\n /* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n white-space: normal;\n\n .", " {\n position: absolute;\n visibility: hidden;\n height: 1.5rem;\n top: 0px;\n left: 0px;\n }\n\n .", " {\n position: absolute;\n visibility: hidden;\n height: 1.5rem;\n bottom: 0px;\n right: 0px;\n }\n\n .", " {\n background-color: ", ";\n display: flex;\n border-radius: ", "px;\n width: 100%;\n counter-reset: line;\n overflow-x: auto;\n\n background-image: ", ";\n\n background-repeat: no-repeat;\n background-attachment: local, local, local, local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%, 8px 100%, 8px 100%,\n 8px 100%;\n background-position: 0 0, 0 0, 100% 0, 100% 0, 100% 0, 0 0;\n\n /* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n overflow-y: hidden;\n }\n\n .", " {\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n position: relative;\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n ::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n color: ", ";\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: 1;\n\n code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n color: ", ";\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n }\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, (0, _tokens.token)('elevation.surface.raised', 'transparent'), (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, (0, _components.themed)({
38
39
  light: (0, _tokens.token)('color.background.neutral', _colors.N20),
39
40
  dark: (0, _tokens.token)('color.background.neutral', _colors.DN50)
40
41
  })(props), (0, _constants.borderRadius)(), (0, _editorSharedStyles.overflowShadow)({
41
42
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4118
42
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
43
43
  background: (0, _components.themed)({
44
- light: _colors.N20,
45
- dark: _colors.DN50
44
+ light: (0, _tokens.token)('color.background.neutral', _colors.N20),
45
+ dark: (0, _tokens.token)('color.background.neutral', _colors.DN50)
46
46
  })(props),
47
47
  width: '8px'
48
- }), _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, (0, _components.themed)({
48
+ }), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, (0, _components.themed)({
49
49
  light: (0, _tokens.token)('color.background.neutral', _colors.N30),
50
50
  dark: (0, _tokens.token)('color.background.neutral', _colors.DN20)
51
51
  })(props), (0, _constants.gridSize)(), (0, _components.themed)({
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.getPanelDarkColor = exports.getPanelBackgroundDarkModeColors = exports.darkPanelColors = exports.PanelSharedSelectors = exports.PanelSharedCssClassName = void 0;
11
11
  exports.getPanelDarkModeCSS = getPanelDarkModeCSS;
12
- exports.panelSharedStylesWithoutPrefix = exports.panelSharedStyles = exports.getPanelTypeBackground = void 0;
12
+ exports.panelSharedStylesWithoutPrefix = exports.panelSharedStyles = exports.getPanelTypeBackgroundNoTokens = exports.getPanelTypeBackground = void 0;
13
13
 
14
14
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
15
 
@@ -31,13 +31,26 @@ var _components = require("@atlaskit/theme/components");
31
31
 
32
32
  var _constants = require("@atlaskit/theme/constants");
33
33
 
34
+ var _tokens = require("@atlaskit/tokens");
35
+
34
36
  var _templateObject, _templateObject2;
35
37
 
36
38
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
39
 
38
40
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
41
 
42
+ var tokenPanelColor = {
43
+ info: 'color.background.information',
44
+ note: 'color.background.discovery',
45
+ tip: 'color.background.success',
46
+ success: 'color.background.success',
47
+ warning: 'color.background.warning',
48
+ error: 'color.background.danger'
49
+ };
40
50
  var lightPanelColor = {
51
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4066
52
+
53
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
41
54
  info: colors.B50,
42
55
  note: colors.P50,
43
56
  tip: colors.G50,
@@ -47,7 +60,7 @@ var lightPanelColor = {
47
60
  };
48
61
  var darkPanelColors = {
49
62
  // standard panels
50
- info: '#0C294F',
63
+ info: "#0C294F",
51
64
  error: "#441C13",
52
65
  warning: "#413001",
53
66
  tip: "#052E21",
@@ -107,27 +120,32 @@ var darkPanelColors = {
107
120
  LightGray: '#5A6977',
108
121
  TextColor: '#D9DDE3'
109
122
  };
123
+ /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
124
+
110
125
  exports.darkPanelColors = darkPanelColors;
111
126
  var lightIconColor = {
112
- info: colors.B400,
113
- note: colors.P400,
114
- tip: colors.G400,
115
- success: colors.G400,
116
- warning: colors.Y400,
117
- error: colors.R400
127
+ info: (0, _tokens.token)('color.icon.information', colors.B400),
128
+ note: (0, _tokens.token)('color.icon.discovery', colors.P400),
129
+ tip: (0, _tokens.token)('color.icon.success', colors.G400),
130
+ success: (0, _tokens.token)('color.icon.success', colors.G400),
131
+ warning: (0, _tokens.token)('color.icon.warning', colors.Y400),
132
+ error: (0, _tokens.token)('color.icon.danger', colors.R400)
118
133
  };
119
134
  var darkIconColor = {
120
- info: colors.B100,
121
- note: colors.P100,
122
- tip: colors.G200,
123
- success: colors.G200,
124
- warning: colors.Y100,
125
- error: colors.R200
135
+ info: (0, _tokens.token)('color.icon.information', colors.B100),
136
+ note: (0, _tokens.token)('color.icon.discovery', colors.P100),
137
+ tip: (0, _tokens.token)('color.icon.success', colors.G200),
138
+ success: (0, _tokens.token)('color.icon.success', colors.G200),
139
+ warning: (0, _tokens.token)('color.icon.warning', colors.Y100),
140
+ error: (0, _tokens.token)('color.icon.danger', colors.R200)
126
141
  }; // New custom icons are a little smaller than predefined icons.
127
142
  // To fix alignment issues with custom icons, vertical alignment is updated.
128
143
 
129
144
  var panelEmojiSpriteVerticalAlignment = -((0, _constants.gridSize)() * 3 - _consts.akEditorCustomIconSize) / 2;
130
- var panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
145
+ var panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1; // TODO: https://product-fabric.atlassian.net/browse/DSP-4066
146
+
147
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
148
+
131
149
  var panelDarkModeColors = [[colors.B50, darkPanelColors.B1200S], [colors.B75, darkPanelColors.B900], [colors.B100, darkPanelColors.B800S], [colors.N0, darkPanelColors.LightGray], [colors.N20, darkPanelColors.Gray], [colors.N60, darkPanelColors.DarkGray], [colors.T50, darkPanelColors.T1200S], [colors.T75, darkPanelColors.T900], [colors.T100, darkPanelColors.T900S], [colors.G50, darkPanelColors.G1200S], [colors.G75, darkPanelColors.G900], [colors.G200, darkPanelColors.G900S], [colors.Y50, darkPanelColors.Y1200S], [colors.Y75, darkPanelColors.Y900], [colors.Y200, darkPanelColors.Y800S], [colors.R50, darkPanelColors.R1200S], [colors.R75, darkPanelColors.R900], [colors.R100, darkPanelColors.R800S], [colors.P50, darkPanelColors.P1200S], [colors.P75, darkPanelColors.P900], [colors.P100, darkPanelColors.P800S]];
132
150
 
133
151
  var getPanelDarkColor = function getPanelDarkColor(panelColor) {
@@ -193,9 +211,10 @@ var iconDynamicStyles = function iconDynamicStyles(panelType) {
193
211
  })(props);
194
212
  return "\n color: ".concat(color, ";\n ");
195
213
  };
196
- };
214
+ }; // Provides the color without tokens, used when converting to a custom panel
197
215
 
198
- var getPanelTypeBackground = function getPanelTypeBackground(panelType) {
216
+
217
+ var getPanelTypeBackgroundNoTokens = function getPanelTypeBackgroundNoTokens(panelType) {
199
218
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
200
219
  var light = lightPanelColor[panelType];
201
220
  var dark = darkPanelColors[panelType];
@@ -206,6 +225,24 @@ var getPanelTypeBackground = function getPanelTypeBackground(panelType) {
206
225
  return background || 'none';
207
226
  };
208
227
 
228
+ exports.getPanelTypeBackgroundNoTokens = getPanelTypeBackgroundNoTokens;
229
+
230
+ var getPanelTypeBackground = function getPanelTypeBackground(panelType) {
231
+ var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
232
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4066
233
+
234
+ /* eslint-disable @atlaskit/design-system/no-unsafe-design-token-usage */
235
+ var light = (0, _tokens.token)(tokenPanelColor[panelType], lightPanelColor[panelType]);
236
+ var dark = (0, _tokens.token)(tokenPanelColor[panelType], darkPanelColors[panelType]);
237
+ /* eslint-disable @atlaskit/design-system/no-unsafe-design-token-usage */
238
+
239
+ var background = (0, _components.themed)({
240
+ light: light,
241
+ dark: dark
242
+ })(props);
243
+ return background || 'none';
244
+ };
245
+
209
246
  exports.getPanelTypeBackground = getPanelTypeBackground;
210
247
 
211
248
  var mainDynamicStyles = function mainDynamicStyles(panelType) {
@@ -25,6 +25,8 @@ var _tokens = require("@atlaskit/tokens");
25
25
 
26
26
  var _browser = _interopRequireDefault(require("../../utils/browser"));
27
27
 
28
+ var _codeBlock = require("./code-block");
29
+
28
30
  var _templateObject;
29
31
 
30
32
  var tableMarginTop = 24;
@@ -61,7 +63,7 @@ var TableSharedCssClassName = {
61
63
  exports.TableSharedCssClassName = TableSharedCssClassName;
62
64
 
63
65
  var tableSharedStyle = function tableSharedStyle(props) {
64
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-of-type > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n .", " > table {\n margin: ", "px 0 0 0;\n }\n\n .", " > table,\n .", " > table {\n margin: ", "px ", "px 0 0;\n }\n\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: ", ";\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > :first-child:not(style),\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]) {\n .code-block {\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n background-color: ", ";\n\n .line-number-gutter {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableMarginTop, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, (0, _components.themed)({
66
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-of-type > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n .", " > table {\n margin: ", "px 0 0 0;\n }\n\n .", " > table,\n .", " > table {\n margin: ", "px ", "px 0 0;\n }\n\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: ", ";\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > :first-child:not(style),\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]):not(.danger) {\n .", ":not(.danger) {\n background-color: ", ";\n\n :not(.", ") {\n box-shadow: 0px 0px 0px 1px\n ", ";\n }\n\n .", " {\n background-image: ", ";\n\n background-color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableMarginTop, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, (0, _components.themed)({
65
67
  light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorder),
66
68
  dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorderDark)
67
69
  })(props), (0, _tokens.token)('color.background.neutral.subtle', 'white'), tableCellMinWidth, (0, _components.themed)({
@@ -72,22 +74,25 @@ var tableSharedStyle = function tableSharedStyle(props) {
72
74
  })(props), (0, _components.themed)({
73
75
  light: (0, _tokens.token)('color.background.neutral', _editorSharedStyles.akEditorTableToolbar),
74
76
  dark: (0, _tokens.token)('color.background.neutral', _editorSharedStyles.akEditorTableToolbarDark)
75
- })(props), (0, _editorSharedStyles.overflowShadow)({
77
+ })(props), _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, (0, _components.themed)({
78
+ light: (0, _tokens.token)('elevation.surface.raised', 'rgb(235, 237, 240)'),
79
+ dark: (0, _tokens.token)('elevation.surface.raised', 'rgb(36, 47, 66)')
80
+ })(props), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _tokens.token)('color.border', 'transparent'), _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, (0, _editorSharedStyles.overflowShadow)({
76
81
  background: (0, _components.themed)({
77
- light: 'rgb(235, 237, 240)',
78
- dark: 'rgb(36, 47, 66)'
82
+ light: (0, _tokens.token)('color.background.neutral', 'rgb(235, 237, 240)'),
83
+ dark: (0, _tokens.token)('color.background.neutral', 'rgb(36, 47, 66)')
79
84
  })(props),
80
85
  width: "".concat((0, _constants.gridSize)(), "px")
81
86
  }), (0, _components.themed)({
82
87
  light: (0, _tokens.token)('color.background.neutral', 'rgb(235, 237, 240)'),
83
88
  dark: (0, _tokens.token)('color.background.neutral', 'rgb(36, 47, 66)')
84
- })(props), (0, _components.themed)({
89
+ })(props), _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, (0, _components.themed)({
85
90
  light: (0, _tokens.token)('color.background.neutral', 'rgb(226, 229, 233)'),
86
91
  dark: (0, _tokens.token)('color.background.neutral', _colors.DN20)
87
92
  })(props), (0, _editorSharedStyles.overflowShadow)({
88
93
  background: (0, _components.themed)({
89
- light: 'rgb(235, 237, 240)',
90
- dark: 'rgb(36, 47, 66)'
94
+ light: (0, _tokens.token)('color.background.neutral', 'rgb(235, 237, 240)'),
95
+ dark: (0, _tokens.token)('color.background.neutral', 'rgb(36, 47, 66)')
91
96
  })(props),
92
97
  width: "".concat((0, _constants.gridSize)(), "px")
93
98
  }), (0, _components.themed)({
@@ -13,5 +13,5 @@ var _react = require("@emotion/react");
13
13
 
14
14
  var _templateObject;
15
15
 
16
- var textColorStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .fabric-text-color-mark {\n color: var(--custom-text-color, inherit);\n }\n\n a .fabric-text-color-mark {\n color: unset;\n }\n"])));
16
+ var textColorStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .fabric-text-color-mark {\n color: var(--custom-palette-color, inherit);\n }\n\n a .fabric-text-color-mark {\n color: unset;\n }\n"])));
17
17
  exports.textColorStyles = textColorStyles;
@@ -46,7 +46,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
46
46
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
47
47
 
48
48
  var packageName = "@atlaskit/editor-common";
49
- var packageVersion = "70.3.0";
49
+ var packageVersion = "71.0.0";
50
50
  var halfFocusRing = 1;
51
51
  var dropOffset = "0, ".concat((0, _constants.gridSize)(), "px");
52
52
 
@@ -27,6 +27,8 @@ var _react = _interopRequireWildcard(require("react"));
27
27
 
28
28
  var _react2 = require("@emotion/react");
29
29
 
30
+ var _editorPalette = require("@atlaskit/editor-palette");
31
+
30
32
  var _done = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/done"));
31
33
 
32
34
  var _colors = require("@atlaskit/theme/colors");
@@ -83,7 +85,9 @@ var Color = /*#__PURE__*/function (_PureComponent) {
83
85
  isSelected = _this$props2.isSelected,
84
86
  borderColor = _this$props2.borderColor,
85
87
  _this$props2$checkMar = _this$props2.checkMarkColor,
86
- checkMarkColor = _this$props2$checkMar === void 0 ? _colors.N0 : _this$props2$checkMar;
88
+ checkMarkColor = _this$props2$checkMar === void 0 ? _colors.N0 : _this$props2$checkMar,
89
+ useDesignTokens = _this$props2.useDesignTokens;
90
+ var colorStyle = useDesignTokens ? (0, _editorPalette.hexToEditorTextPaletteColor)(value) : value;
87
91
  return (0, _react2.jsx)(_tooltip.default, {
88
92
  content: label
89
93
  }, (0, _react2.jsx)("span", {
@@ -98,7 +102,7 @@ var Color = /*#__PURE__*/function (_PureComponent) {
98
102
  tabIndex: tabIndex,
99
103
  className: "".concat(isSelected ? 'selected' : ''),
100
104
  style: {
101
- backgroundColor: value || 'transparent',
105
+ backgroundColor: colorStyle || 'transparent',
102
106
  border: "1px solid ".concat(borderColor)
103
107
  },
104
108
  autoFocus: autoFocus
@@ -17,6 +17,8 @@ var _reactIntlNext = require("react-intl-next");
17
17
 
18
18
  var _colors = require("@atlaskit/theme/colors");
19
19
 
20
+ var _tokens = require("@atlaskit/tokens");
21
+
20
22
  var _Color = _interopRequireDefault(require("./Color"));
21
23
 
22
24
  var _styles = require("./styles");
@@ -30,10 +32,21 @@ var _styles = require("./styles");
30
32
  * @param color color string, suppports HEX, RGB, RGBA etc.
31
33
  * @return Highest contrast color in pool
32
34
  */
33
- function getContrastColor(color, pool) {
34
- return pool.sort(function (a, b) {
35
+ function getCheckMarkColor(color, textPalette) {
36
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
37
+ var contrastColor = [_colors.N0, _colors.N500].sort(function (a, b) {
35
38
  return _chromatism.default.difference(b, color) - _chromatism.default.difference(a, color);
36
39
  })[0];
40
+
41
+ if (!textPalette) {
42
+ return contrastColor;
43
+ } // Use of these token comes from guidance from designers in the Design System team
44
+ // they are only intended for use with text colors (and there are different tokens
45
+ // planned to be used when this extended to be used with other palettes).
46
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
47
+
48
+
49
+ return contrastColor === _colors.N0 ? (0, _tokens.token)('color.icon.inverse', _colors.N0) : (0, _tokens.token)('color.icon', _colors.N500);
37
50
  }
38
51
 
39
52
  var ColorPalette = function ColorPalette(props) {
@@ -43,7 +56,9 @@ var ColorPalette = function ColorPalette(props) {
43
56
  onClick = props.onClick,
44
57
  selectedColor = props.selectedColor,
45
58
  className = props.className,
46
- formatMessage = props.intl.formatMessage;
59
+ formatMessage = props.intl.formatMessage,
60
+ _props$textPalette = props.textPalette,
61
+ textPalette = _props$textPalette === void 0 ? false : _props$textPalette;
47
62
 
48
63
  var colorsPerRow = _react.default.useMemo(function () {
49
64
  return palette.reduce(function (resultArray, item, index) {
@@ -72,14 +87,9 @@ var ColorPalette = function ColorPalette(props) {
72
87
  borderColor: border,
73
88
  label: message ? formatMessage(message) : label,
74
89
  onClick: onClick,
75
- isSelected: value === selectedColor
76
- /** this is not new usage - old code extracted from editor-core */
77
-
78
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
79
- ,
80
- checkMarkColor: getContrastColor(value, [_colors.N0, _colors.N500])
81
- /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
82
-
90
+ isSelected: value === selectedColor,
91
+ checkMarkColor: getCheckMarkColor(value, textPalette),
92
+ useDesignTokens: textPalette === true
83
93
  });
84
94
  }));
85
95
  }));
@@ -31,6 +31,8 @@ var _DropList = _interopRequireDefault(require("../../ui/DropList"));
31
31
 
32
32
  var _Popup = _interopRequireDefault(require("../../ui/Popup"));
33
33
 
34
+ var _MenuArrowKeyNavigationProvider = require("../MenuArrowKeyNavigationProvider");
35
+
34
36
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
37
 
36
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -85,7 +87,9 @@ var Dropdown = /*#__PURE__*/function (_PureComponent) {
85
87
  onOpenChange = _this$props.onOpenChange,
86
88
  fitHeight = _this$props.fitHeight,
87
89
  fitWidth = _this$props.fitWidth,
88
- zIndex = _this$props.zIndex;
90
+ zIndex = _this$props.zIndex,
91
+ disableArrowKeyNavigation = _this$props.disableArrowKeyNavigation,
92
+ keyDownHandlerContext = _this$props.keyDownHandlerContext;
89
93
  return /*#__PURE__*/_react.default.createElement(_Popup.default, {
90
94
  target: target,
91
95
  mountTo: mountTo,
@@ -95,6 +99,16 @@ var Dropdown = /*#__PURE__*/function (_PureComponent) {
95
99
  fitHeight: fitHeight,
96
100
  fitWidth: fitWidth,
97
101
  zIndex: zIndex
102
+ }, /*#__PURE__*/_react.default.createElement(_MenuArrowKeyNavigationProvider.MenuArrowKeyNavigationProvider, {
103
+ disableArrowKeyNavigation: disableArrowKeyNavigation,
104
+ keyDownHandlerContext: keyDownHandlerContext,
105
+ closeonTab: true,
106
+ handleClose: function handleClose(event) {
107
+ return onOpenChange && onOpenChange({
108
+ isOpen: false,
109
+ event: event
110
+ });
111
+ }
98
112
  }, /*#__PURE__*/_react.default.createElement("div", {
99
113
  style: {
100
114
  height: 0,
@@ -105,7 +119,7 @@ var Dropdown = /*#__PURE__*/function (_PureComponent) {
105
119
  onOpenChange: onOpenChange,
106
120
  position: popupPlacement.join(' '),
107
121
  shouldFitContainer: true
108
- }, children)));
122
+ }, children))));
109
123
  }
110
124
  }, {
111
125
  key: "render",