@atlaskit/editor-common 72.0.0 → 72.0.1

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 (56) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/keymaps/index.js +1 -3
  3. package/dist/cjs/styles/shared/annotation.js +9 -11
  4. package/dist/cjs/styles/shared/blockquote.js +1 -3
  5. package/dist/cjs/styles/shared/code-block.js +11 -13
  6. package/dist/cjs/styles/shared/code-mark.js +2 -4
  7. package/dist/cjs/styles/shared/panel.js +24 -28
  8. package/dist/cjs/styles/shared/rule.js +2 -4
  9. package/dist/cjs/styles/shared/shadow.js +1 -3
  10. package/dist/cjs/styles/shared/table.js +22 -24
  11. package/dist/cjs/ui/Caption/index.js +2 -4
  12. package/dist/cjs/ui/DropList/index.js +5 -7
  13. package/dist/cjs/ui/Expand/index.js +17 -19
  14. package/dist/cjs/ui/Messages/index.js +3 -5
  15. package/dist/cjs/ui/UnsupportedBlock/index.js +1 -3
  16. package/dist/cjs/ui/UnsupportedInline/index.js +1 -3
  17. package/dist/cjs/ui-color/ColorPalette/index.js +1 -1
  18. package/dist/cjs/ui-menu/DropdownMenu/index.js +10 -12
  19. package/dist/cjs/version.json +1 -1
  20. package/dist/es2019/keymaps/index.js +1 -2
  21. package/dist/es2019/styles/shared/annotation.js +9 -10
  22. package/dist/es2019/styles/shared/blockquote.js +1 -2
  23. package/dist/es2019/styles/shared/code-block.js +11 -12
  24. package/dist/es2019/styles/shared/code-mark.js +2 -3
  25. package/dist/es2019/styles/shared/panel.js +24 -27
  26. package/dist/es2019/styles/shared/rule.js +2 -3
  27. package/dist/es2019/styles/shared/shadow.js +4 -5
  28. package/dist/es2019/styles/shared/table.js +22 -23
  29. package/dist/es2019/ui/Caption/index.js +2 -3
  30. package/dist/es2019/ui/DropList/index.js +5 -6
  31. package/dist/es2019/ui/Expand/index.js +17 -18
  32. package/dist/es2019/ui/Messages/index.js +3 -4
  33. package/dist/es2019/ui/UnsupportedBlock/index.js +2 -3
  34. package/dist/es2019/ui/UnsupportedInline/index.js +2 -3
  35. package/dist/es2019/ui-color/ColorPalette/index.js +2 -2
  36. package/dist/es2019/ui-menu/DropdownMenu/index.js +11 -12
  37. package/dist/es2019/version.json +1 -1
  38. package/dist/esm/keymaps/index.js +1 -2
  39. package/dist/esm/styles/shared/annotation.js +9 -10
  40. package/dist/esm/styles/shared/blockquote.js +1 -2
  41. package/dist/esm/styles/shared/code-block.js +11 -12
  42. package/dist/esm/styles/shared/code-mark.js +2 -3
  43. package/dist/esm/styles/shared/panel.js +24 -27
  44. package/dist/esm/styles/shared/rule.js +2 -3
  45. package/dist/esm/styles/shared/shadow.js +1 -2
  46. package/dist/esm/styles/shared/table.js +22 -23
  47. package/dist/esm/ui/Caption/index.js +2 -3
  48. package/dist/esm/ui/DropList/index.js +5 -6
  49. package/dist/esm/ui/Expand/index.js +17 -18
  50. package/dist/esm/ui/Messages/index.js +3 -4
  51. package/dist/esm/ui/UnsupportedBlock/index.js +1 -2
  52. package/dist/esm/ui/UnsupportedInline/index.js +1 -2
  53. package/dist/esm/ui-color/ColorPalette/index.js +2 -2
  54. package/dist/esm/ui-menu/DropdownMenu/index.js +10 -11
  55. package/dist/esm/version.json +1 -1
  56. package/package.json +3 -3
@@ -25,8 +25,6 @@ var _colors = require("@atlaskit/theme/colors");
25
25
 
26
26
  var _constants = require("@atlaskit/theme/constants");
27
27
 
28
- var _tokens = require("@atlaskit/tokens");
29
-
30
28
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
31
29
 
32
30
  var _analytics = require("../../analytics");
@@ -43,7 +41,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
43
41
 
44
42
  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; }
45
43
 
46
- var inlineNodeStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background: ", ";\n border: 1px dashed ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n font-size: ", ";\n margin: 0 2px;\n min-height: 24px;\n padding: 0 10px;\n vertical-align: middle;\n white-space: nowrap;\n"])), (0, _tokens.token)('color.background.disabled', _colors.N30), (0, _tokens.token)('color.border.disabled', _colors.N50), (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
44
+ var inlineNodeStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background: ", ";\n border: 1px dashed ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n font-size: ", ";\n margin: 0 2px;\n min-height: 24px;\n padding: 0 10px;\n vertical-align: middle;\n white-space: nowrap;\n"])), "var(--ds-background-disabled, ".concat(_colors.N30, ")"), "var(--ds-border-disabled, ".concat(_colors.N50, ")"), (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
47
45
 
48
46
  var UnsupportedInlineNode = function UnsupportedInlineNode(_ref) {
49
47
  var node = _ref.node,
@@ -50,7 +50,7 @@ function getCheckMarkColor(color, textPalette) {
50
50
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
51
51
 
52
52
 
53
- return contrastColor === _colors.N0 ? (0, _tokens.token)('color.icon.inverse', _colors.N0) : (0, _tokens.token)('color.icon', _colors.N500);
53
+ return contrastColor === _colors.N0 ? "var(--ds-icon-inverse, ".concat(_colors.N0, ")") : "var(--ds-icon, ".concat(_colors.N500, ")");
54
54
  }
55
55
 
56
56
  var ColorPalette = function ColorPalette(props) {
@@ -41,8 +41,6 @@ var _colors = require("@atlaskit/theme/colors");
41
41
 
42
42
  var _components = require("@atlaskit/theme/components");
43
43
 
44
- var _tokens = require("@atlaskit/tokens");
45
-
46
44
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
47
45
 
48
46
  var _uiReact = require("../../ui-react");
@@ -66,7 +64,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
66
64
  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; } }
67
65
 
68
66
  var wrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* tooltip in ToolbarButton is display:block */\n & > div > div {\n display: flex;\n }\n"])));
69
- var focusedMenuItemStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n box-shadow: inset 0px 0px 0px 2px ", ";\n outline: none;\n"])), (0, _tokens.token)('color.border.focused', _colors.B100));
67
+ var focusedMenuItemStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n box-shadow: inset 0px 0px 0px 2px ", ";\n outline: none;\n"])), "var(--ds-border-focused, ".concat(_colors.B100, ")"));
70
68
 
71
69
  var buttonStyles = function buttonStyles(isActive) {
72
70
  return function (theme) {
@@ -74,20 +72,20 @@ var buttonStyles = function buttonStyles(isActive) {
74
72
  /**
75
73
  * Hack for item to imitate old dropdown-menu selected styles
76
74
  */
77
- return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n > span,\n > span:hover,\n > span:active {\n background: ", ";\n color: ", ";\n }\n :focus > span[aria-disabled='false'] {\n ", ";\n }\n :focus-visible,\n :focus-visible > span[aria-disabled='false'] {\n outline: none;\n }\n "])), (0, _tokens.token)('color.background.selected', '#6c798f'), (0, _tokens.token)('color.text', '#fff'), focusedMenuItemStyle);
75
+ return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n > span,\n > span:hover,\n > span:active {\n background: ", ";\n color: ", ";\n }\n :focus > span[aria-disabled='false'] {\n ", ";\n }\n :focus-visible,\n :focus-visible > span[aria-disabled='false'] {\n outline: none;\n }\n "])), "var(--ds-background-selected, #6c798f)", "var(--ds-text, #fff)", focusedMenuItemStyle);
78
76
  } else {
79
77
  return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n > span:hover[aria-disabled='false'] {\n color: ", ";\n background-color: ", ";\n }\n > span:active[aria-disabled='false'] {\n background-color: ", ";\n }\n > span[aria-disabled='true'] {\n color: ", ";\n }\n :focus > span[aria-disabled='false'] {\n ", ";\n }\n :focus-visible,\n :focus-visible > span[aria-disabled='false'] {\n outline: none;\n }\n "])), (0, _components.themed)({
80
- light: (0, _tokens.token)('color.text', _colors.N900),
81
- dark: (0, _tokens.token)('color.text', _colors.DN600)
78
+ light: "var(--ds-text, ".concat(_colors.N900, ")"),
79
+ dark: "var(--ds-text, ".concat(_colors.DN600, ")")
82
80
  })(theme), (0, _components.themed)({
83
- light: (0, _tokens.token)('color.background.neutral.subtle.hovered', 'rgb(244, 245, 247)'),
84
- dark: (0, _tokens.token)('color.background.neutral.subtle.hovered', 'rgb(59, 71, 92)')
81
+ light: "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))",
82
+ dark: "var(--ds-background-neutral-subtle-hovered, rgb(59, 71, 92))"
85
83
  })(theme), (0, _components.themed)({
86
- light: (0, _tokens.token)('color.background.neutral.subtle.pressed', 'rgb(179, 212, 255)'),
87
- dark: (0, _tokens.token)('color.background.neutral.subtle.pressed', 'rgb(179, 212, 255)')
84
+ light: "var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))",
85
+ dark: "var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))"
88
86
  })(theme), (0, _components.themed)({
89
- light: (0, _tokens.token)('color.text.disabled', _colors.N70),
90
- dark: (0, _tokens.token)('color.text.disabled', _colors.DN80)
87
+ light: "var(--ds-text-disabled, ".concat(_colors.N70, ")"),
88
+ dark: "var(--ds-text-disabled, ".concat(_colors.DN80, ")")
91
89
  })(theme), focusedMenuItemStyle); // The deafut focus-visible style is removed to ensure consistency across browsers
92
90
  }
93
91
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "72.0.0",
3
+ "version": "72.0.1",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,6 @@
2
2
  import React, { Fragment } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { N400 } from '@atlaskit/theme/colors';
5
- import { token } from '@atlaskit/tokens';
6
5
  import { browser } from '../utils';
7
6
  export const addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
8
7
  export const toggleBold = makeKeyMapWithCommon('Bold', 'Mod-b');
@@ -75,7 +74,7 @@ const arrowKeysMap = {
75
74
  };
76
75
  const tooltipShortcutStyle = css`
77
76
  border-radius: 2px;
78
- background-color: ${token('color.background.inverse.subtle', N400)};
77
+ background-color: ${`var(--ds-background-inverse-subtle, ${N400})`};
79
78
  padding: 0 2px;
80
79
 
81
80
  /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */
@@ -1,7 +1,6 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { N60A, Y300, Y75 } from '@atlaskit/theme/colors';
3
3
  import { themed } from '@atlaskit/theme/components';
4
- import { token } from '@atlaskit/tokens';
5
4
  export const annotationPrefix = 'ak-editor-annotation';
6
5
  export const AnnotationSharedClassNames = {
7
6
  focus: `${annotationPrefix}-focus`,
@@ -20,27 +19,27 @@ export const AnnotationSharedCSSByState = props => ({
20
19
  // emotion and token look up
21
20
 
22
21
  background: ${themed({
23
- light: token('color.background.accent.yellow.subtler', Y75),
24
- dark: token('color.background.accent.yellow.subtler', DY75)
22
+ light: `var(--ds-background-accent-yellow-subtler, ${Y75})`,
23
+ dark: `var(--ds-background-accent-yellow-subtler, ${DY75})`
25
24
  })(props)};
26
25
  border-bottom: 2px solid
27
26
  ${themed({
28
- light: token('color.border.accent.yellow', Y300),
29
- dark: token('color.border.accent.yellow', DY300)
27
+ light: `var(--ds-border-accent-yellow, ${Y300})`,
28
+ dark: `var(--ds-border-accent-yellow, ${DY300})`
30
29
  })(props)};
31
30
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4147
32
- box-shadow: ${token('elevation.shadow.overlay', `1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`)};
31
+ box-shadow: ${`var(--ds-shadow-overlay, ${`1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`})`};
33
32
  cursor: pointer;
34
33
  `,
35
34
  blur: css`
36
35
  background: ${themed({
37
- light: token('color.background.accent.yellow.subtlest', Y75a),
38
- dark: token('color.background.accent.yellow.subtlest', DY75a)
36
+ light: `var(--ds-background-accent-yellow-subtlest, ${Y75a})`,
37
+ dark: `var(--ds-background-accent-yellow-subtlest, ${DY75a})`
39
38
  })(props)};
40
39
  border-bottom: 2px solid
41
40
  ${themed({
42
- light: token('color.border.accent.yellow', Y200a),
43
- dark: token('color.border.accent.yellow', DY200)
41
+ light: `var(--ds-border-accent-yellow, ${Y200a})`,
42
+ dark: `var(--ds-border-accent-yellow, ${DY200})`
44
43
  })(props)};
45
44
  cursor: pointer;
46
45
  `
@@ -1,13 +1,12 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { akEditorBlockquoteBorderColor, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
3
3
  import { gridSize } from '@atlaskit/theme/constants';
4
- import { token } from '@atlaskit/tokens';
5
4
  export const blockquoteSharedStyles = css`
6
5
  & blockquote {
7
6
  box-sizing: border-box;
8
7
  padding-left: ${gridSize() * 2}px;
9
8
  border-left: 2px solid
10
- ${token('color.border', akEditorBlockquoteBorderColor)};
9
+ ${`var(--ds-border, ${akEditorBlockquoteBorderColor})`};
11
10
  margin: ${blockNodesVerticalMargin} 0 0 0;
12
11
  margin-right: 0;
13
12
 
@@ -3,7 +3,6 @@ import { akEditorCodeFontFamily, akEditorLineHeight, akEditorTableCellMinWidth,
3
3
  import { DN20, DN400, DN50, DN800, N20, N30, N400, N800 } from '@atlaskit/theme/colors';
4
4
  import { themed } from '@atlaskit/theme/components';
5
5
  import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
6
- import { token } from '@atlaskit/tokens';
7
6
  export const CodeBlockSharedCssClassName = {
8
7
  CODEBLOCK_CONTAINER: 'code-block',
9
8
  CODEBLOCK_START: 'code-block--start',
@@ -16,7 +15,7 @@ export const CodeBlockSharedCssClassName = {
16
15
  export const codeBlockSharedStyles = props => css`
17
16
  .${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER} {
18
17
  position: relative;
19
- background-color: ${token('elevation.surface.raised', 'transparent')};
18
+ background-color: ${"var(--ds-surface-raised, transparent)"};
20
19
  border-radius: ${borderRadius()}px;
21
20
  margin: ${blockNodesVerticalMargin} 0 0 0;
22
21
  font-family: ${akEditorCodeFontFamily};
@@ -46,8 +45,8 @@ export const codeBlockSharedStyles = props => css`
46
45
 
47
46
  .${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER} {
48
47
  background-color: ${themed({
49
- light: token('color.background.neutral', N20),
50
- dark: token('color.background.neutral', DN50)
48
+ light: `var(--ds-background-neutral, ${N20})`,
49
+ dark: `var(--ds-background-neutral, ${DN50})`
51
50
  })(props)};
52
51
  display: flex;
53
52
  border-radius: ${borderRadius()}px;
@@ -57,8 +56,8 @@ export const codeBlockSharedStyles = props => css`
57
56
 
58
57
  background-image: ${overflowShadow({
59
58
  background: themed({
60
- light: token('color.background.neutral', N20),
61
- dark: token('color.background.neutral', DN50)
59
+ light: `var(--ds-background-neutral, ${N20})`,
60
+ dark: `var(--ds-background-neutral, ${DN50})`
62
61
  })(props),
63
62
  leftCoverWidth: `${gridSize() * 3}px`
64
63
  })};
@@ -79,8 +78,8 @@ export const codeBlockSharedStyles = props => css`
79
78
  flex-shrink: 0;
80
79
  text-align: right;
81
80
  background-color: ${themed({
82
- light: token('color.background.neutral', N30),
83
- dark: token('color.background.neutral', DN20)
81
+ light: `var(--ds-background-neutral, ${N30})`,
82
+ dark: `var(--ds-background-neutral, ${DN20})`
84
83
  })(props)};
85
84
  padding: ${gridSize()}px;
86
85
  position: relative;
@@ -95,8 +94,8 @@ export const codeBlockSharedStyles = props => css`
95
94
  content: counter(line);
96
95
  counter-increment: line;
97
96
  color: ${themed({
98
- light: token('color.text.subtlest', N400),
99
- dark: token('color.text.subtlest', DN400)
97
+ light: `var(--ds-text-subtlest, ${N400})`,
98
+ dark: `var(--ds-text-subtlest, ${DN400})`
100
99
  })(props)};
101
100
  font-size: ${relativeFontSizeToBase16(fontSize())};
102
101
  line-height: 1.5rem;
@@ -113,8 +112,8 @@ export const codeBlockSharedStyles = props => css`
113
112
  tab-size: 4;
114
113
  cursor: text;
115
114
  color: ${themed({
116
- light: token('color.text', N800),
117
- dark: token('color.text', DN800)
115
+ light: `var(--ds-text, ${N800})`,
116
+ dark: `var(--ds-text, ${DN800})`
118
117
  })(props)};
119
118
  border-radius: ${borderRadius()}px;
120
119
  margin: ${gridSize()}px;
@@ -2,14 +2,13 @@ import { css } from '@emotion/react';
2
2
  import { getCodeStyles } from '@atlaskit/code/inline';
3
3
  import { DN70, N30A } from '@atlaskit/theme/colors';
4
4
  import { getTheme, themed } from '@atlaskit/theme/components';
5
- import { token } from '@atlaskit/tokens';
6
5
  export const codeMarkSharedStyles = props => {
7
6
  const theme = getTheme(props);
8
7
  return css`
9
8
  .code {
10
9
  --ds--code--bg-color: ${themed({
11
- light: token('color.background.neutral', N30A),
12
- dark: token('color.background.neutral', DN70)
10
+ light: `var(--ds-background-neutral, ${N30A})`,
11
+ dark: `var(--ds-background-neutral, ${DN70})`
13
12
  })(props)};
14
13
  ${getCodeStyles(theme)}
15
14
  }
@@ -8,16 +8,7 @@ import { emojiImage, emojiSprite } from '@atlaskit/emoji';
8
8
  import * as colors from '@atlaskit/theme/colors';
9
9
  import { themed } from '@atlaskit/theme/components';
10
10
  import { borderRadius, gridSize } from '@atlaskit/theme/constants';
11
- import { token } from '@atlaskit/tokens';
12
- const tokenPanelColor = {
13
- info: 'color.background.information',
14
- note: 'color.background.discovery',
15
- tip: 'color.background.success',
16
- success: 'color.background.success',
17
- warning: 'color.background.warning',
18
- error: 'color.background.danger'
19
- };
20
- const lightPanelColor = {
11
+ const lightPanelColors = {
21
12
  info: colors.B50,
22
13
  note: colors.P50,
23
14
  tip: colors.G50,
@@ -88,20 +79,28 @@ export const darkPanelColors = {
88
79
  TextColor: '#D9DDE3'
89
80
  };
90
81
  const lightIconColor = {
91
- info: token('color.icon.information', colors.B400),
92
- note: token('color.icon.discovery', colors.P400),
93
- tip: token('color.icon.success', colors.G400),
94
- success: token('color.icon.success', colors.G400),
95
- warning: token('color.icon.warning', colors.Y400),
96
- error: token('color.icon.danger', colors.R400)
82
+ info: `var(--ds-icon-information, ${colors.B400})`,
83
+ note: `var(--ds-icon-discovery, ${colors.P400})`,
84
+ tip: `var(--ds-icon-success, ${colors.G400})`,
85
+ success: `var(--ds-icon-success, ${colors.G400})`,
86
+ warning: `var(--ds-icon-warning, ${colors.Y400})`,
87
+ error: `var(--ds-icon-danger, ${colors.R400})`
97
88
  };
98
89
  const darkIconColor = {
99
- info: token('color.icon.information', colors.B100),
100
- note: token('color.icon.discovery', colors.P100),
101
- tip: token('color.icon.success', colors.G200),
102
- success: token('color.icon.success', colors.G200),
103
- warning: token('color.icon.warning', colors.Y100),
104
- error: token('color.icon.danger', colors.R200)
90
+ info: `var(--ds-icon-information, ${colors.B100})`,
91
+ note: `var(--ds-icon-discovery, ${colors.P100})`,
92
+ tip: `var(--ds-icon-success, ${colors.G200})`,
93
+ success: `var(--ds-icon-success, ${colors.G200})`,
94
+ warning: `var(--ds-icon-warning, ${colors.Y100})`,
95
+ error: `var(--ds-icon-danger, ${colors.R200})`
96
+ };
97
+ const tokenDarkPanelColors = {
98
+ info: `var(--ds-background-information, ${darkPanelColors['info']})`,
99
+ note: `var(--ds-background-discovery, ${darkPanelColors['note']})`,
100
+ tip: `var(--ds-background-success, ${darkPanelColors['tip']})`,
101
+ success: `var(--ds-background-success, ${darkPanelColors['success']})`,
102
+ warning: `var(--ds-background-warning, ${darkPanelColors['warning']})`,
103
+ error: `var(--ds-background-danger, ${darkPanelColors['error']})`
105
104
  }; // New custom icons are a little smaller than predefined icons.
106
105
  // To fix alignment issues with custom icons, vertical alignment is updated.
107
106
 
@@ -168,7 +167,7 @@ const iconDynamicStyles = panelType => props => {
168
167
 
169
168
 
170
169
  export const getPanelTypeBackgroundNoTokens = (panelType, props = {}) => {
171
- const light = lightPanelColor[panelType];
170
+ const light = lightPanelColors[panelType];
172
171
  const dark = darkPanelColors[panelType];
173
172
  const background = themed({
174
173
  light,
@@ -177,11 +176,9 @@ export const getPanelTypeBackgroundNoTokens = (panelType, props = {}) => {
177
176
  return background || 'none';
178
177
  };
179
178
  export const getPanelTypeBackground = (panelType, props = {}) => {
180
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4066
179
+ const light = hexToEditorBackgroundPaletteColor(lightPanelColors[panelType]); // hexToEditorBackgroundPaletteColor has a light mode as a fallback color - for legacy dark mode we define the tokens locally
181
180
 
182
- /* eslint-disable @atlaskit/design-system/no-unsafe-design-token-usage */
183
- const light = hexToEditorBackgroundPaletteColor(lightPanelColor[panelType]);
184
- const dark = token(tokenPanelColor[panelType], darkPanelColors[panelType]);
181
+ const dark = tokenDarkPanelColors[panelType];
185
182
  const background = themed({
186
183
  light,
187
184
  dark
@@ -2,10 +2,9 @@ import { css } from '@emotion/react';
2
2
  import { akEditorLineHeight } from '@atlaskit/editor-shared-styles';
3
3
  import { DN50, N30A } from '@atlaskit/theme/colors';
4
4
  import { themed } from '@atlaskit/theme/components';
5
- import { token } from '@atlaskit/tokens';
6
5
  const divider = themed({
7
- light: token('color.border', N30A),
8
- dark: token('color.border', DN50)
6
+ light: `var(--ds-border, ${N30A})`,
7
+ dark: `var(--ds-border, ${DN50})`
9
8
  }); // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
10
9
 
11
10
  export const ruleSharedStyles = props => css`
@@ -2,7 +2,6 @@
2
2
  import { css } from '@emotion/react';
3
3
  import { akEditorShadowZIndex } from '@atlaskit/editor-shared-styles';
4
4
  import { N40A } from '@atlaskit/theme/colors';
5
- import { token } from '@atlaskit/tokens';
6
5
  import { shadowClassNames } from '../../ui/OverflowShadow';
7
6
  import { shadowObserverClassNames } from '../../ui/OverflowShadow/shadowObserver';
8
7
  const shadowWidth = 8;
@@ -44,11 +43,11 @@ const shadowSharedStyle = css`
44
43
  background: linear-gradient(
45
44
  to left,
46
45
  transparent 0,
47
- ${token('elevation.shadow.overflow.spread', N40A)} 100%
46
+ ${`var(--ds-shadow-overflow-spread, ${N40A})`} 100%
48
47
  ),
49
48
  linear-gradient(
50
49
  to right,
51
- ${token('elevation.shadow.overflow.perimeter', 'transparent')} 0px,
50
+ ${"var(--ds-shadow-overflow-perimeter, transparent)"} 0px,
52
51
  transparent 1px
53
52
  );
54
53
  top: 0px;
@@ -60,11 +59,11 @@ const shadowSharedStyle = css`
60
59
  background: linear-gradient(
61
60
  to right,
62
61
  transparent 0,
63
- ${token('elevation.shadow.overflow.spread', N40A)} 100%
62
+ ${`var(--ds-shadow-overflow-spread, ${N40A})`} 100%
64
63
  ),
65
64
  linear-gradient(
66
65
  to left,
67
- ${token('elevation.shadow.overflow.perimeter', 'transparent')} 0px,
66
+ ${"var(--ds-shadow-overflow-perimeter, transparent)"} 0px,
68
67
  transparent 1px
69
68
  );
70
69
  left: calc(100% - ${shadowWidth}px);
@@ -5,7 +5,6 @@ import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorSelected
5
5
  import { DN20 } from '@atlaskit/theme/colors';
6
6
  import { themed } from '@atlaskit/theme/components';
7
7
  import { gridSize } from '@atlaskit/theme/constants';
8
- import { token } from '@atlaskit/tokens';
9
8
  import browser from '../../utils/browser';
10
9
  import { CodeBlockSharedCssClassName } from './code-block';
11
10
  export const tableMarginTop = 24;
@@ -65,8 +64,8 @@ const tableSharedStyle = props => css`
65
64
  border-collapse: collapse;
66
65
  border: ${tableCellBorderWidth}px solid
67
66
  ${themed({
68
- light: token('color.border', akEditorTableBorder),
69
- dark: token('color.border', akEditorTableBorderDark)
67
+ light: `var(--ds-border, ${akEditorTableBorder})`,
68
+ dark: `var(--ds-border, ${akEditorTableBorderDark})`
70
69
  })(props)};
71
70
  table-layout: fixed;
72
71
  font-size: 1em;
@@ -88,7 +87,7 @@ const tableSharedStyle = props => css`
88
87
  border-bottom: none;
89
88
  }
90
89
  th td {
91
- background-color: ${token('color.background.neutral.subtle', 'white')};
90
+ background-color: ${"var(--ds-background-neutral-subtle, white)"};
92
91
  }
93
92
  th,
94
93
  td {
@@ -97,8 +96,8 @@ const tableSharedStyle = props => css`
97
96
  vertical-align: top;
98
97
  border: 1px solid
99
98
  ${themed({
100
- light: token('color.border', akEditorTableBorder),
101
- dark: token('color.border', akEditorTableBorderDark)
99
+ light: `var(--ds-border, ${akEditorTableBorder})`,
100
+ dark: `var(--ds-border, ${akEditorTableBorderDark})`
102
101
  })(props)};
103
102
  border-right-width: 0;
104
103
  border-bottom-width: 0;
@@ -132,8 +131,8 @@ const tableSharedStyle = props => css`
132
131
  }
133
132
  th {
134
133
  background-color: ${themed({
135
- light: token('color.background.neutral', akEditorTableToolbar),
136
- dark: token('color.background.neutral', akEditorTableToolbarDark)
134
+ light: `var(--ds-background-neutral, ${akEditorTableToolbar})`,
135
+ dark: `var(--ds-background-neutral, ${akEditorTableToolbarDark})`
137
136
  })(props)};
138
137
  text-align: left;
139
138
 
@@ -142,34 +141,34 @@ const tableSharedStyle = props => css`
142
141
  &:not([style]):not(.danger) {
143
142
  .${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER}:not(.danger) {
144
143
  background-color: ${themed({
145
- light: token('elevation.surface.raised', 'rgb(235, 237, 240)'),
146
- dark: token('elevation.surface.raised', 'rgb(36, 47, 66)')
144
+ light: "var(--ds-surface-raised, rgb(235, 237, 240))",
145
+ dark: "var(--ds-surface-raised, rgb(36, 47, 66))"
147
146
  })(props)};
148
147
 
149
148
  :not(.${akEditorSelectedNodeClassName}) {
150
149
  box-shadow: 0px 0px 0px 1px
151
- ${token('color.border', 'transparent')};
150
+ ${"var(--ds-border, transparent)"};
152
151
  }
153
152
 
154
153
  .${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER} {
155
154
  background-image: ${overflowShadow({
156
155
  background: themed({
157
- light: token('color.background.neutral', 'rgb(235, 237, 240)'),
158
- dark: token('color.background.neutral', 'rgb(36, 47, 66)')
156
+ light: "var(--ds-background-neutral, rgb(235, 237, 240))",
157
+ dark: "var(--ds-background-neutral, rgb(36, 47, 66))"
159
158
  })(props),
160
159
  leftCoverWidth: `${gridSize() * 3}px`
161
160
  })};
162
161
 
163
162
  background-color: ${themed({
164
- light: token('color.background.neutral', 'rgb(235, 237, 240)'),
165
- dark: token('color.background.neutral', 'rgb(36, 47, 66)')
163
+ light: "var(--ds-background-neutral, rgb(235, 237, 240))",
164
+ dark: "var(--ds-background-neutral, rgb(36, 47, 66))"
166
165
  })(props)};
167
166
  }
168
167
 
169
168
  .${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER} {
170
169
  background-color: ${themed({
171
- light: token('color.background.neutral', 'rgb(226, 229, 233)'),
172
- dark: token('color.background.neutral', DN20)
170
+ light: "var(--ds-background-neutral, rgb(226, 229, 233))",
171
+ dark: `var(--ds-background-neutral, ${DN20})`
173
172
  })(props)};
174
173
  }
175
174
 
@@ -177,21 +176,21 @@ const tableSharedStyle = props => css`
177
176
  > [data-ds--code--code-block] {
178
177
  background-image: ${overflowShadow({
179
178
  background: themed({
180
- light: token('color.background.neutral', 'rgb(235, 237, 240)'),
181
- dark: token('color.background.neutral', 'rgb(36, 47, 66)')
179
+ light: "var(--ds-background-neutral, rgb(235, 237, 240))",
180
+ dark: "var(--ds-background-neutral, rgb(36, 47, 66))"
182
181
  })(props),
183
182
  leftCoverWidth: `${gridSize() * 3}px`
184
183
  })}!important;
185
184
 
186
185
  background-color: ${themed({
187
- light: token('color.background.neutral', 'rgb(235, 237, 240)'),
188
- dark: token('color.background.neutral', 'rgb(36, 47, 66)')
186
+ light: "var(--ds-background-neutral, rgb(235, 237, 240))",
187
+ dark: "var(--ds-background-neutral, rgb(36, 47, 66))"
189
188
  })(props)}!important;
190
189
 
191
190
  // selector lives inside @atlaskit/code
192
191
  --ds--code--line-number-bg-color: ${themed({
193
- light: token('color.background.neutral', 'rgb(226, 229, 233)'),
194
- dark: token('color.background.neutral', DN20)
192
+ light: "var(--ds-background-neutral, rgb(226, 229, 233))",
193
+ dark: `var(--ds-background-neutral, ${DN20})`
195
194
  })(props)};
196
195
  }
197
196
  }
@@ -5,16 +5,15 @@ import React from 'react';
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import { injectIntl } from 'react-intl-next';
7
7
  import { N200, N400 } from '@atlaskit/theme/colors';
8
- import { token } from '@atlaskit/tokens';
9
8
  import { messages } from './messages';
10
9
  const captionWrapperStyle = css`
11
10
  margin-top: 8px;
12
11
  text-align: center;
13
12
  position: relative;
14
- color: ${token('color.text.subtle', N400)};
13
+ color: ${`var(--ds-text-subtle, ${N400})`};
15
14
  `;
16
15
  const placeholderStyle = css`
17
- color: ${token('color.text.subtlest', N200)};
16
+ color: ${`var(--ds-text-subtlest, ${N200})`};
18
17
  position: absolute;
19
18
  top: 0;
20
19
  width: 100%;
@@ -7,10 +7,9 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { DN50, DN600, N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import { themed } from '@atlaskit/theme/components';
9
9
  import { borderRadius, gridSize } from '@atlaskit/theme/constants';
10
- import { token } from '@atlaskit/tokens';
11
10
  import Layer from '../Layer';
12
11
  const packageName = "@atlaskit/editor-common";
13
- const packageVersion = "72.0.0";
12
+ const packageVersion = "72.0.1";
14
13
  const halfFocusRing = 1;
15
14
  const dropOffset = `0, ${gridSize()}px`;
16
15
 
@@ -33,12 +32,12 @@ class DropList extends Component {
33
32
  _defineProperty(this, "menuWrapper", theme => {
34
33
  return css`
35
34
  color: ${themed({
36
- light: token('color.text', N900),
37
- dark: token('color.text', DN600)
35
+ light: `var(--ds-text, ${N900})`,
36
+ dark: `var(--ds-text, ${DN600})`
38
37
  })(theme)};
39
38
  background-color: ${themed({
40
- light: token('elevation.surface.overlay', N0),
41
- dark: token('elevation.surface.overlay', DN50)
39
+ light: `var(--ds-surface-overlay, ${N0})`,
40
+ dark: `var(--ds-surface-overlay, ${DN50})`
42
41
  })(theme)};
43
42
  border-radius: ${borderRadius()}px;
44
43
  box-shadow: 0 ${gridSize() / 2}px ${gridSize()}px -${gridSize() / 4}px ${N50A},