@atlaskit/renderer 93.0.3 → 95.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 (45) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/cjs/react/marks/link.js +3 -1
  3. package/dist/cjs/react/nodes/codeBlock.js +5 -0
  4. package/dist/cjs/react/nodes/codeBlockCopyButton.js +3 -1
  5. package/dist/cjs/react/nodes/heading-anchor.js +4 -2
  6. package/dist/cjs/react/nodes/table/sticky.js +19 -17
  7. package/dist/cjs/render-document.js +141 -54
  8. package/dist/cjs/ui/Expand.js +9 -3
  9. package/dist/cjs/ui/Renderer/index.js +19 -23
  10. package/dist/cjs/ui/Renderer/style.js +30 -28
  11. package/dist/cjs/ui/Renderer/truncated-wrapper.js +6 -3
  12. package/dist/cjs/ui/SortingIcon.js +6 -2
  13. package/dist/cjs/ui/annotations/draft/component.js +1 -1
  14. package/dist/cjs/ui/annotations/element/mark.js +1 -1
  15. package/dist/cjs/version.json +1 -1
  16. package/dist/es2019/react/marks/link.js +8 -3
  17. package/dist/es2019/react/nodes/codeBlock.js +5 -0
  18. package/dist/es2019/react/nodes/codeBlockCopyButton.js +7 -6
  19. package/dist/es2019/react/nodes/heading-anchor.js +3 -2
  20. package/dist/es2019/react/nodes/table/sticky.js +28 -24
  21. package/dist/es2019/render-document.js +116 -55
  22. package/dist/es2019/ui/Expand.js +9 -3
  23. package/dist/es2019/ui/Renderer/index.js +3 -8
  24. package/dist/es2019/ui/Renderer/style.js +34 -29
  25. package/dist/es2019/ui/Renderer/truncated-wrapper.js +5 -3
  26. package/dist/es2019/ui/SortingIcon.js +7 -5
  27. package/dist/es2019/ui/annotations/draft/component.js +1 -1
  28. package/dist/es2019/ui/annotations/element/mark.js +1 -1
  29. package/dist/es2019/version.json +1 -1
  30. package/dist/esm/react/marks/link.js +3 -2
  31. package/dist/esm/react/nodes/codeBlock.js +5 -0
  32. package/dist/esm/react/nodes/codeBlockCopyButton.js +2 -1
  33. package/dist/esm/react/nodes/heading-anchor.js +3 -2
  34. package/dist/esm/react/nodes/table/sticky.js +18 -18
  35. package/dist/esm/render-document.js +136 -54
  36. package/dist/esm/ui/Expand.js +9 -3
  37. package/dist/esm/ui/Renderer/index.js +19 -23
  38. package/dist/esm/ui/Renderer/style.js +29 -28
  39. package/dist/esm/ui/Renderer/truncated-wrapper.js +5 -3
  40. package/dist/esm/ui/SortingIcon.js +5 -3
  41. package/dist/esm/ui/annotations/draft/component.js +1 -1
  42. package/dist/esm/ui/annotations/element/mark.js +1 -1
  43. package/dist/esm/version.json +1 -1
  44. package/dist/types/render-document.d.ts +1 -1
  45. package/package.json +22 -16
@@ -31,7 +31,9 @@ const Container = props => {
31
31
  const sharedContainerStyles = sharedExpandStyles.containerStyles(props);
32
32
 
33
33
  const styles = themeProps => css`
34
- ${sharedContainerStyles(themeProps)}
34
+ ${sharedContainerStyles({
35
+ theme: themeProps
36
+ })}
35
37
  padding: 0;
36
38
  padding-bottom: ${paddingBottom};
37
39
  `;
@@ -45,7 +47,9 @@ const TitleContainer = props => {
45
47
  const paddingBottom = `${!props.expanded ? gridSize() : 0}px`;
46
48
 
47
49
  const styles = themeProps => css`
48
- ${sharedExpandStyles.titleContainerStyles(themeProps)}
50
+ ${sharedExpandStyles.titleContainerStyles({
51
+ theme: themeProps
52
+ })}
49
53
  padding: ${gridSize()}px;
50
54
  padding-bottom: ${paddingBottom};
51
55
  `;
@@ -62,7 +66,9 @@ const ContentContainer = props => {
62
66
  const visibility = props.expanded ? 'visible' : 'hidden';
63
67
 
64
68
  const styles = themeProps => css`
65
- ${sharedContentStyles(themeProps)};
69
+ ${sharedContentStyles({
70
+ theme: themeProps
71
+ })};
66
72
  padding-right: ${gridSize() * 2}px;
67
73
  padding-left: ${gridSize() * 5 - gridSize() / 2}px;
68
74
  visibility: ${visibility};
@@ -61,18 +61,13 @@ export class Renderer extends PureComponent {
61
61
  }
62
62
  });
63
63
 
64
- _defineProperty(this, "getSchema", () => {
65
- const {
66
- schema,
67
- adfStage
68
- } = this.props;
69
-
64
+ _defineProperty(this, "getSchema", memoizeOne((schema, adfStage) => {
70
65
  if (schema) {
71
66
  return schema;
72
67
  }
73
68
 
74
69
  return getSchemaBasedOnStage(adfStage);
75
- });
70
+ }));
76
71
 
77
72
  _defineProperty(this, "onMouseDownEditView", () => {
78
73
  // When the user is deselecting text on the screen by clicking, if they are clicking outside
@@ -283,7 +278,7 @@ export class Renderer extends PureComponent {
283
278
  try {
284
279
  var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
285
280
 
286
- const schema = this.getSchema();
281
+ const schema = this.getSchema(this.props.schema, this.props.adfStage);
287
282
  const {
288
283
  result,
289
284
  stat,
@@ -3,6 +3,7 @@ import { themed } from '@atlaskit/theme/components';
3
3
  import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/constants';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
5
  import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
6
+ import { token } from '@atlaskit/tokens';
6
7
  import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles } from '@atlaskit/editor-common/styles';
7
8
  import { shadowClassNames } from '@atlaskit/editor-common/ui';
8
9
  import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
@@ -213,7 +214,7 @@ const tableSortableColumnStyle = ({
213
214
  outline: unset;
214
215
  }
215
216
  &:focus-visible {
216
- border-color: ${colors.B300};
217
+ border-color: ${token('color.border.focused', colors.B300)};
217
218
  }
218
219
  }
219
220
 
@@ -288,8 +289,8 @@ export const rendererStyles = wrapperProps => theme => {
288
289
  font-size: ${editorFontSize(themeProps)}px;
289
290
  line-height: 1.5rem;
290
291
  color: ${themed({
291
- light: colors.N800,
292
- dark: '#B8C7E0'
292
+ light: token('color.text', colors.N800),
293
+ dark: token('color.text', '#B8C7E0')
293
294
  })(themeProps)};
294
295
 
295
296
  .${RendererCssClassName.DOCUMENT}::after {
@@ -331,13 +332,17 @@ export const rendererStyles = wrapperProps => theme => {
331
332
  }
332
333
 
333
334
  & span.akActionMark {
334
- color: ${colors.B400};
335
+ color: ${token('color.link', colors.B400)};
335
336
  text-decoration: none;
336
337
 
337
338
  &:hover {
338
- color: ${colors.B300};
339
+ color: ${token('color.link', colors.B300)};
339
340
  text-decoration: underline;
340
341
  }
342
+
343
+ &:active {
344
+ color: ${token('color.link.pressed', colors.B500)};
345
+ }
341
346
  }
342
347
 
343
348
  & span.akActionMark {
@@ -373,13 +378,13 @@ export const rendererStyles = wrapperProps => theme => {
373
378
 
374
379
  & span.date-node {
375
380
  background: ${themed({
376
- light: colors.N30A,
377
- dark: colors.DN70
381
+ light: token('color.background.neutral', colors.N30A),
382
+ dark: token('color.background.neutral', colors.DN70)
378
383
  })(themeProps)};
379
384
  border-radius: ${borderRadius()}px;
380
385
  color: ${themed({
381
- light: colors.N800,
382
- dark: colors.DN600
386
+ light: token('color.text', colors.N800),
387
+ dark: token('color.text', colors.DN600)
383
388
  })(themeProps)};
384
389
  padding: 2px 4px;
385
390
  margin: 0 1px;
@@ -387,8 +392,8 @@ export const rendererStyles = wrapperProps => theme => {
387
392
  }
388
393
 
389
394
  & span.date-node-highlighted {
390
- background: ${colors.R50};
391
- color: ${colors.R500};
395
+ background: ${token('color.background.danger', colors.R50)};
396
+ color: ${token('color.text.danger', colors.R500)};
392
397
  }
393
398
 
394
399
  & .renderer-image {
@@ -506,19 +511,19 @@ export const rendererStyles = wrapperProps => theme => {
506
511
  table[data-number-column='true'] {
507
512
  .${RendererCssClassName.NUMBER_COLUMN} {
508
513
  background-color: ${themed({
509
- light: akEditorTableToolbar,
510
- dark: akEditorTableToolbarDark
514
+ light: token('color.background.neutral', akEditorTableToolbar),
515
+ dark: token('color.background.neutral', akEditorTableToolbarDark)
511
516
  })(themeProps)};
512
517
  border-right: 1px solid
513
518
  ${themed({
514
- light: akEditorTableBorder,
515
- dark: akEditorTableBorderDark
519
+ light: token('color.border', akEditorTableBorder),
520
+ dark: token('color.border', akEditorTableBorderDark)
516
521
  })(themeProps)};
517
522
  width: ${akEditorTableNumberColumnWidth}px;
518
523
  text-align: center;
519
524
  color: ${themed({
520
- light: colors.N200,
521
- dark: colors.DN400
525
+ light: token('color.text.subtlest', colors.N200),
526
+ dark: token('color.text.subtlest', colors.DN400)
522
527
  })(themeProps)};
523
528
  font-size: ${relativeFontSizeToBase16(fontSize())};
524
529
  }
@@ -537,13 +542,13 @@ export const rendererStyles = wrapperProps => theme => {
537
542
 
538
543
  border-right: 1px solid
539
544
  ${themed({
540
- light: akEditorTableBorder,
541
- dark: akEditorTableBorderDark
545
+ light: token('color.border', akEditorTableBorder),
546
+ dark: token('color.border', akEditorTableBorderDark)
542
547
  })(themeProps)};
543
548
  border-bottom: 1px solid
544
549
  ${themed({
545
- light: akEditorTableBorder,
546
- dark: akEditorTableBorderDark
550
+ light: token('color.border', akEditorTableBorder),
551
+ dark: token('color.border', akEditorTableBorderDark)
547
552
  })(themeProps)};
548
553
 
549
554
  /* this is to compensate for the table border */
@@ -569,20 +574,20 @@ export const rendererStyles = wrapperProps => theme => {
569
574
  .sticky td {
570
575
  box-shadow: 0px 1px
571
576
  ${themed({
572
- light: akEditorTableBorder,
573
- dark: akEditorTableBorderDark
577
+ light: token('color.border', akEditorTableBorder),
578
+ dark: token('color.border', akEditorTableBorderDark)
574
579
  })(themeProps)},
575
580
  0px -0.5px ${themed({
576
- light: akEditorTableBorder,
577
- dark: akEditorTableBorderDark
581
+ light: token('color.border', akEditorTableBorder),
582
+ dark: token('color.border', akEditorTableBorderDark)
578
583
  })(themeProps)},
579
584
  inset -1px 0px ${themed({
580
- light: akEditorTableToolbar,
581
- dark: akEditorTableToolbarDark
585
+ light: token('color.border', akEditorTableToolbar),
586
+ dark: token('color.border', akEditorTableToolbarDark)
582
587
  })(themeProps)},
583
588
  0px -1px ${themed({
584
- light: akEditorTableToolbar,
585
- dark: akEditorTableToolbarDark
589
+ light: token('color.border', akEditorTableToolbar),
590
+ dark: token('color.border', akEditorTableToolbarDark)
586
591
  })(themeProps)};
587
592
  }
588
593
 
@@ -1,6 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { css, jsx } from '@emotion/react';
3
3
  import { Component } from 'react';
4
+ import { token } from '@atlaskit/tokens';
4
5
 
5
6
  const fadeOutStyles = (maxHeight, top, backgroundColor) => css`
6
7
  position: relative;
@@ -14,7 +15,7 @@ const fadeOutStyles = (maxHeight, top, backgroundColor) => css`
14
15
  left: 0;
15
16
  right: 0;
16
17
  background-image: linear-gradient(
17
- rgba(255, 255, 255, 0),
18
+ ${token('color.background.neutral.subtle', 'rgba(255, 255, 255, 0)')},
18
19
  ${backgroundColor}
19
20
  );
20
21
  }
@@ -37,13 +38,14 @@ const FadeOut = props => {
37
38
  export class TruncatedWrapper extends Component {
38
39
  constructor(props) {
39
40
  super(props);
40
- }
41
+ } // TODO: Quality ticket as elevation.surface will be issue when sits top of modal. https://product-fabric.atlassian.net/browse/DSP-4123
42
+
41
43
 
42
44
  render() {
43
45
  const {
44
46
  height = 95,
45
47
  fadeHeight = 24,
46
- backgroundColor = 'white',
48
+ backgroundColor = token('elevation.surface', 'white'),
47
49
  children
48
50
  } = this.props;
49
51
  return jsx(FadeOut, {
@@ -5,13 +5,15 @@ import { gridSize } from '@atlaskit/theme/constants';
5
5
  import { N20, N30 } from '@atlaskit/theme/colors';
6
6
  import { SortOrder } from '@atlaskit/editor-common/types';
7
7
  import { sortingIconMessages } from '../messages';
8
- import { injectIntl } from 'react-intl-next'; // We use data url here because of this issue:
8
+ import { injectIntl } from 'react-intl-next';
9
+ import { token } from '@atlaskit/tokens'; // We use data url here because of this issue:
9
10
  // https://product-fabric.atlassian.net/browse/ED-8001
10
11
  // Remove this workaround if Firefox has fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
12
+ // TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4136
11
13
 
12
14
  export const TableSortIconDataUrl = `data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M-8-6h24v24H-8z"></path><path d="M3 8.509V1c0-.552.449-1 1-1 .552 0 1 .448 1 1V8.51l1.217-1.206a1.05 1.05 0 011.477 0 1.03 1.03 0 01.004 1.463l-.003.002-2.956 2.93a1.053 1.053 0 01-1.478 0L.305 8.767a1.03 1.03 0 01.001-1.464 1.05 1.05 0 011.477 0L3 8.508z" fill="#42526E"></path></g></svg>`)}`;
13
15
  const TABLE_SORTING_ICON_CLASS = 'table-sorting-icon';
14
- export let StatusClassNames;
16
+ export let StatusClassNames; // TODO: get design to check border
15
17
 
16
18
  (function (StatusClassNames) {
17
19
  StatusClassNames["ASC"] = "sorting-icon-svg__asc";
@@ -28,14 +30,14 @@ const wrapperStyles = css`
28
30
  margin: 6px;
29
31
  right: 0;
30
32
  top: 0;
31
- border: 2px solid #fff;
33
+ border: 2px solid ${token('color.border.inverse', '#fff')};
32
34
  border-radius: ${gridSize() / 2}px;
33
- background-color: ${N20};
35
+ background-color: ${token('color.background.neutral.subtle', N20)};
34
36
  justify-content: center;
35
37
  align-items: center;
36
38
 
37
39
  &:hover {
38
- background-color: ${N30};
40
+ background-color: ${token('color.background.neutral.subtle.hovered', N30)};
39
41
  }
40
42
 
41
43
  &.${StatusClassNames.SORTING_NOT_ALLOWED} {
@@ -13,7 +13,7 @@ import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
13
13
  const markStyles = props => css`
14
14
  color: inherit;
15
15
  background-color: unset;
16
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
16
+ -webkit-tap-highlight-color: transparent;
17
17
 
18
18
  ${AnnotationSharedCSSByState(props).focus};
19
19
  `;
@@ -9,7 +9,7 @@ import { AnnotationMarkStates } from '@atlaskit/adf-schema';
9
9
  const markStyles = props => css`
10
10
  color: inherit;
11
11
  background-color: unset;
12
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
12
+ -webkit-tap-highlight-color: transparent;
13
13
 
14
14
  &[data-mark-annotation-state='${AnnotationMarkStates.ACTIVE}'] {
15
15
  ${AnnotationSharedCSSByState({
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "93.0.3",
3
+ "version": "95.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -6,11 +6,12 @@ var _templateObject;
6
6
  /** @jsx jsx */
7
7
  import React, { Fragment } from 'react';
8
8
  import { css, jsx } from '@emotion/react';
9
- import { B400, B300 } from '@atlaskit/theme/colors';
9
+ import { B400, B300, B500 } from '@atlaskit/theme/colors';
10
10
  import { getEventHandler } from '../../utils';
11
11
  import { PLATFORM, MODE } from '../../analytics/events';
12
12
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
13
- var anchorStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n"])), B400, B300);
13
+ import { token } from '@atlaskit/tokens';
14
+ var anchorStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n"])), token('color.link', B400), token('color.link', B300), token('color.link.pressed', B500));
14
15
  export default function Link(props) {
15
16
  var href = props.href,
16
17
  target = props.target,
@@ -14,6 +14,9 @@ import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
14
14
  import { useFeatureFlags } from '../../use-feature-flags';
15
15
  import CopyButton from './codeBlockCopyButton';
16
16
 
17
+ // TODO: Quality ticket https://product-fabric.atlassian.net/browse/DSP-4118
18
+
19
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
17
20
  var codeBlockStyle = function codeBlockStyle(props) {
18
21
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n tab-size: 4;\n [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n }\n "])), relativeFontSizeToBase16(fontSize()), overflowShadow({
19
22
  background: themed({
@@ -23,6 +26,8 @@ var codeBlockStyle = function codeBlockStyle(props) {
23
26
  width: "".concat(gridSize(), "px")
24
27
  }));
25
28
  };
29
+ /* eslint-enable */
30
+
26
31
 
27
32
  function CodeBlock(props) {
28
33
  var text = props.text,
@@ -13,7 +13,8 @@ import CopyIcon from '@atlaskit/icon/glyph/copy';
13
13
  import { N20, N30, N700 } from '@atlaskit/theme/colors';
14
14
  import { CopyTextConsumer } from './copy-text-provider';
15
15
  import { codeBlockCopyButtonMessages } from '../../messages';
16
- var copyButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n position: sticky;\n justify-content: flex-end;\n top: 0;\n\n button {\n position: absolute;\n display: flex;\n justify-content: center;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n opacity: 0;\n transition: opacity 0.2s ease 0s;\n border: 2px solid #fff;\n border-radius: 4px;\n background-color: ", ";\n color: rgb(66, 82, 110);\n }\n\n button:hover {\n background-color: ", ";\n }\n\n button.clicked {\n background-color: ", ";\n color: #fff !important;\n }\n"])), N20, N30, N700);
16
+ import { token } from '@atlaskit/tokens';
17
+ var copyButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n position: sticky;\n justify-content: flex-end;\n top: 0;\n\n button {\n position: absolute;\n display: flex;\n justify-content: center;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n opacity: 0;\n transition: opacity 0.2s ease 0s;\n border: 2px solid ", ";\n border-radius: 4px;\n background-color: ", ";\n color: ", ";\n }\n\n button:hover {\n background-color: ", ";\n }\n\n button.clicked {\n background-color: ", ";\n color: ", " !important;\n }\n"])), token('color.border.inverse', '#fff'), token('color.background.neutral.subtle', N20), token('color.icon', 'rgb(66, 82, 110)'), token('color.background.neutral.hovered', N30), token('color.background.neutral.bold.pressed', N700), token('color.icon.inverse', '#fff'));
17
18
 
18
19
  var CopyButton = function CopyButton(_ref) {
19
20
  var content = _ref.content,
@@ -27,6 +27,7 @@ import LinkIcon from '@atlaskit/icon/glyph/link';
27
27
  import Tooltip from '@atlaskit/tooltip';
28
28
  import { injectIntl } from 'react-intl-next';
29
29
  import { headingAnchorLinkMessages } from '../../messages';
30
+ import { token } from '@atlaskit/tokens';
30
31
  export var HeadingAnchorWrapperClassName = 'heading-anchor-wrapper';
31
32
  var CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef(function (props, ref) {
32
33
  var children = props.children,
@@ -37,7 +38,7 @@ var CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef(function (props, re
37
38
  ref: ref
38
39
  }), children);
39
40
  });
40
- var copyAnchorButtonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline;\n outline: none;\n background-color: transparent;\n border: none;\n color: ", ";\n cursor: pointer;\n right: 0;\n"])), N500);
41
+ var copyAnchorButtonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline;\n outline: none;\n background-color: transparent;\n border: none;\n color: ", ";\n cursor: pointer;\n right: 0;\n"])), token('color.icon', N500));
41
42
 
42
43
  var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
43
44
  _inherits(HeadingAnchor, _React$PureComponent);
@@ -126,7 +127,7 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
126
127
  }, jsx(LinkIcon, {
127
128
  label: _this.getCopyAriaLabel(),
128
129
  size: _this.props.level > 3 ? 'small' : 'medium',
129
- primaryColor: _this.state.isClicked ? B400 : N200
130
+ primaryColor: _this.state.isClicked ? token('color.icon.selected', B400) : token('color.icon.subtle', N200)
130
131
  }));
131
132
  });
132
133
 
@@ -1,45 +1,45 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _extends from "@babel/runtime/helpers/extends";
3
4
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
5
 
5
- var _templateObject, _templateObject2, _templateObject3;
6
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
6
7
 
7
8
  /** @jsx jsx */
8
9
  import React from 'react';
9
10
  import { css, jsx } from '@emotion/react';
10
11
  import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
11
12
  import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
12
- import * as colors from '@atlaskit/theme/colors';
13
+ import * as colors from '@atlaskit/theme/colors'; // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
14
+
13
15
  var N40A = colors.N40A;
16
+ import { token } from '@atlaskit/tokens';
14
17
  import { findHorizontalOverflowScrollParent } from '../../../utils';
15
18
  import { Table } from './table';
16
19
  import { recursivelyInjectProps } from '../../utils/inject-props';
17
20
  export var tableStickyPadding = 8;
18
- var fixedTableDivModeToPosition = {
19
- stick: 'fixed',
20
- 'pin-bottom': 'absolute'
21
- };
22
-
23
- var getModeSpecificStyles = function getModeSpecificStyles(mode) {
24
- if (mode === 'none') {
25
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n "])));
26
- } else {
27
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: ", ";\n "])), fixedTableDivModeToPosition[mode]);
28
- }
29
- };
21
+ var modeSpecficStyles = {
22
+ none: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n "]))),
23
+ stick: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: fixed;\n "]))),
24
+ 'pin-bottom': css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n "])))
25
+ }; // TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4123
30
26
 
31
27
  var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width) {
32
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n top: ", "px;\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n border-top: ", "px solid white;\n background: white;\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".right-shadow::after,\n &\n .", ".left-shadow::before {\n top: 0px;\n height: 100%;\n }\n"])), top, width, akEditorStickyHeaderZIndex, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableStickyPadding, N40A, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
28
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n border-top: ", "px solid\n ", ";\n background: ", ";\n box-shadow: ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".right-shadow::after,\n &\n .", ".left-shadow::before {\n top: 0px;\n height: 100%;\n }\n"])), typeof top === 'number' && "top: ".concat(top, "px;"), width, akEditorStickyHeaderZIndex, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableStickyPadding, token('elevation.surface', 'white'), token('elevation.surface.overlay', 'white'), token('elevation.shadow.overflow', "0 6px 4px -4px ".concat(N40A)), TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
33
29
  };
34
30
 
35
31
  export var FixedTableDiv = function FixedTableDiv(props) {
36
32
  var top = props.top,
37
33
  wrapperWidth = props.wrapperWidth,
38
34
  mode = props.mode;
39
- var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth), getModeSpecificStyles(mode)];
40
- return jsx("div", {
35
+ var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth), modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]];
36
+ var attrs = {
37
+ mode: mode
38
+ };
39
+ return jsx("div", _extends({}, attrs, {
40
+ "data-testid": "sticky-table-fixed",
41
41
  css: fixedTableCss
42
- }, props.children);
42
+ }), props.children);
43
43
  };
44
44
  export var StickyTable = function StickyTable(_ref) {
45
45
  var top = _ref.top,