@atlaskit/renderer 107.1.0 → 107.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 107.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`0078ddc7e2e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0078ddc7e2e) - New smartLinks prop to allow renderer and editor to determine whether smart link should show actions that can change the link resource.
8
+
9
+ ### Patch Changes
10
+
11
+ - [`2367ba14aa0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2367ba14aa0) - [ux] ED-16758 Added support for theme tokens in table cell background color.
12
+ - Updated dependencies
13
+
3
14
  ## 107.1.0
4
15
 
5
16
  ### Minor Changes
@@ -20,7 +20,10 @@ function BlockCard(props) {
20
20
  data = props.data,
21
21
  eventHandlers = props.eventHandlers,
22
22
  portal = props.portal,
23
- rendererAppearance = props.rendererAppearance;
23
+ rendererAppearance = props.rendererAppearance,
24
+ smartLinks = props.smartLinks;
25
+ var _ref = smartLinks || {},
26
+ showServerActions = _ref.showServerActions;
24
27
  var onClick = (0, _getCardClickHandler.getCardClickHandler)(eventHandlers, url);
25
28
  var platform = (0, _react.useMemo)(function () {
26
29
  return (0, _utils.getPlatform)(rendererAppearance);
@@ -41,6 +44,7 @@ function BlockCard(props) {
41
44
  }, cardProps), /*#__PURE__*/_react.default.createElement(_smartCard.Card, (0, _extends2.default)({
42
45
  appearance: "block",
43
46
  showActions: rendererAppearance !== 'mobile',
44
- platform: platform
47
+ platform: platform,
48
+ showServerActions: showServerActions
45
49
  }, cardProps))));
46
50
  }
@@ -30,12 +30,14 @@ var InlineCard = function InlineCard(props) {
30
30
  var featureFlags = (0, _useFeatureFlags.useFeatureFlags)();
31
31
  var _ref = smartLinks || {},
32
32
  showAuthTooltip = _ref.showAuthTooltip,
33
+ showServerActions = _ref.showServerActions,
33
34
  ssr = _ref.ssr;
34
35
  if (ssr && url) {
35
36
  return /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
36
37
  appearance: "inline",
37
38
  url: url,
38
- showAuthTooltip: showAuthTooltip
39
+ showAuthTooltip: showAuthTooltip,
40
+ showServerActions: showServerActions
39
41
  });
40
42
  }
41
43
  return /*#__PURE__*/_react.default.createElement("span", {
@@ -47,7 +49,8 @@ var InlineCard = function InlineCard(props) {
47
49
  }, cardProps), /*#__PURE__*/_react.default.createElement(_smartCard.Card, (0, _extends2.default)({
48
50
  appearance: "inline",
49
51
  showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview,
50
- showAuthTooltip: showAuthTooltip
52
+ showAuthTooltip: showAuthTooltip,
53
+ showServerActions: showServerActions
51
54
  }, cardProps, {
52
55
  onResolve: function onResolve(data) {
53
56
  if (!data.url || !data.title) {
@@ -17,6 +17,8 @@ var _react = _interopRequireDefault(require("react"));
17
17
  var _adfSchema = require("@atlaskit/adf-schema");
18
18
  var _utils = require("@atlaskit/editor-common/utils");
19
19
  var _types = require("@atlaskit/editor-common/types");
20
+ var _editorPalette = require("@atlaskit/editor-palette");
21
+ var _tokens = require("@atlaskit/tokens");
20
22
  var _SortingIcon = _interopRequireDefault(require("../../ui/SortingIcon"));
21
23
  var _events = require("../../analytics/events");
22
24
  var _analytics = require("@atlaskit/editor-common/analytics");
@@ -81,7 +83,10 @@ var getStyle = function getStyle(background, colGroupWidth, offsetTop) {
81
83
  if (background &&
82
84
  // ignore setting inline styles if ds neutral token is detected
83
85
  !background.includes('--ds-background-neutral')) {
84
- style.backgroundColor = background;
86
+ var tokenName = (0, _editorPalette.hexToEditorBackgroundPaletteColorTokenName)(background);
87
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
88
+ var tokenColor = tokenName ? (0, _tokens.getTokenValue)(tokenName) : background;
89
+ style.backgroundColor = tokenColor;
85
90
  }
86
91
  if (colGroupWidth) {
87
92
  style.width = colGroupWidth;
@@ -55,7 +55,7 @@ exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
55
55
  var DEGRADED_SEVERITY_THRESHOLD = 3000;
56
56
  exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
57
57
  var packageName = "@atlaskit/renderer";
58
- var packageVersion = "107.1.0";
58
+ var packageVersion = "107.2.0";
59
59
  var Renderer = /*#__PURE__*/function (_PureComponent) {
60
60
  (0, _inherits2.default)(Renderer, _PureComponent);
61
61
  var _super = _createSuper(Renderer);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "107.1.0",
3
+ "version": "107.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -11,8 +11,12 @@ export default function BlockCard(props) {
11
11
  data,
12
12
  eventHandlers,
13
13
  portal,
14
- rendererAppearance
14
+ rendererAppearance,
15
+ smartLinks
15
16
  } = props;
17
+ const {
18
+ showServerActions
19
+ } = smartLinks || {};
16
20
  const onClick = getCardClickHandler(eventHandlers, url);
17
21
  const platform = useMemo(() => getPlatform(rendererAppearance), [rendererAppearance]);
18
22
  const cardProps = {
@@ -31,6 +35,7 @@ export default function BlockCard(props) {
31
35
  }, cardProps), /*#__PURE__*/React.createElement(Card, _extends({
32
36
  appearance: "block",
33
37
  showActions: rendererAppearance !== 'mobile',
34
- platform: platform
38
+ platform: platform,
39
+ showServerActions: showServerActions
35
40
  }, cardProps))));
36
41
  }
@@ -25,13 +25,15 @@ const InlineCard = props => {
25
25
  const featureFlags = useFeatureFlags();
26
26
  const {
27
27
  showAuthTooltip,
28
+ showServerActions,
28
29
  ssr
29
30
  } = smartLinks || {};
30
31
  if (ssr && url) {
31
32
  return /*#__PURE__*/React.createElement(CardSSR, {
32
33
  appearance: "inline",
33
34
  url: url,
34
- showAuthTooltip: showAuthTooltip
35
+ showAuthTooltip: showAuthTooltip,
36
+ showServerActions: showServerActions
35
37
  });
36
38
  }
37
39
  return /*#__PURE__*/React.createElement("span", {
@@ -43,7 +45,8 @@ const InlineCard = props => {
43
45
  }, cardProps), /*#__PURE__*/React.createElement(Card, _extends({
44
46
  appearance: "inline",
45
47
  showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview,
46
- showAuthTooltip: showAuthTooltip
48
+ showAuthTooltip: showAuthTooltip,
49
+ showServerActions: showServerActions
47
50
  }, cardProps, {
48
51
  onResolve: data => {
49
52
  if (!data.url || !data.title) {
@@ -4,6 +4,8 @@ import React from 'react';
4
4
  import { tableBackgroundColorPalette } from '@atlaskit/adf-schema';
5
5
  import { compose } from '@atlaskit/editor-common/utils';
6
6
  import { SortOrder } from '@atlaskit/editor-common/types';
7
+ import { hexToEditorBackgroundPaletteColorTokenName } from '@atlaskit/editor-palette';
8
+ import { getTokenValue } from '@atlaskit/tokens';
7
9
  import SortingIcon from '../../ui/SortingIcon';
8
10
  import { MODE, PLATFORM } from '../../analytics/events';
9
11
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
@@ -68,7 +70,10 @@ const getStyle = (background, colGroupWidth, offsetTop) => {
68
70
  if (background &&
69
71
  // ignore setting inline styles if ds neutral token is detected
70
72
  !background.includes('--ds-background-neutral')) {
71
- style.backgroundColor = background;
73
+ const tokenName = hexToEditorBackgroundPaletteColorTokenName(background);
74
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
75
+ const tokenColor = tokenName ? getTokenValue(tokenName) : background;
76
+ style.backgroundColor = tokenColor;
72
77
  }
73
78
  if (colGroupWidth) {
74
79
  style.width = colGroupWidth;
@@ -35,7 +35,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
35
35
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
36
36
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
37
37
  const packageName = "@atlaskit/renderer";
38
- const packageVersion = "107.1.0";
38
+ const packageVersion = "107.2.0";
39
39
  export class Renderer extends PureComponent {
40
40
  /**
41
41
  * This is used in measuring the Renderer Mount time and is then
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "107.1.0",
3
+ "version": "107.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -10,7 +10,10 @@ export default function BlockCard(props) {
10
10
  data = props.data,
11
11
  eventHandlers = props.eventHandlers,
12
12
  portal = props.portal,
13
- rendererAppearance = props.rendererAppearance;
13
+ rendererAppearance = props.rendererAppearance,
14
+ smartLinks = props.smartLinks;
15
+ var _ref = smartLinks || {},
16
+ showServerActions = _ref.showServerActions;
14
17
  var onClick = getCardClickHandler(eventHandlers, url);
15
18
  var platform = useMemo(function () {
16
19
  return getPlatform(rendererAppearance);
@@ -31,6 +34,7 @@ export default function BlockCard(props) {
31
34
  }, cardProps), /*#__PURE__*/React.createElement(Card, _extends({
32
35
  appearance: "block",
33
36
  showActions: rendererAppearance !== 'mobile',
34
- platform: platform
37
+ platform: platform,
38
+ showServerActions: showServerActions
35
39
  }, cardProps))));
36
40
  }
@@ -23,12 +23,14 @@ var InlineCard = function InlineCard(props) {
23
23
  var featureFlags = useFeatureFlags();
24
24
  var _ref = smartLinks || {},
25
25
  showAuthTooltip = _ref.showAuthTooltip,
26
+ showServerActions = _ref.showServerActions,
26
27
  ssr = _ref.ssr;
27
28
  if (ssr && url) {
28
29
  return /*#__PURE__*/React.createElement(CardSSR, {
29
30
  appearance: "inline",
30
31
  url: url,
31
- showAuthTooltip: showAuthTooltip
32
+ showAuthTooltip: showAuthTooltip,
33
+ showServerActions: showServerActions
32
34
  });
33
35
  }
34
36
  return /*#__PURE__*/React.createElement("span", {
@@ -40,7 +42,8 @@ var InlineCard = function InlineCard(props) {
40
42
  }, cardProps), /*#__PURE__*/React.createElement(Card, _extends({
41
43
  appearance: "inline",
42
44
  showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview,
43
- showAuthTooltip: showAuthTooltip
45
+ showAuthTooltip: showAuthTooltip,
46
+ showServerActions: showServerActions
44
47
  }, cardProps, {
45
48
  onResolve: function onResolve(data) {
46
49
  if (!data.url || !data.title) {
@@ -12,6 +12,8 @@ import React from 'react';
12
12
  import { tableBackgroundColorPalette } from '@atlaskit/adf-schema';
13
13
  import { compose } from '@atlaskit/editor-common/utils';
14
14
  import { SortOrder } from '@atlaskit/editor-common/types';
15
+ import { hexToEditorBackgroundPaletteColorTokenName } from '@atlaskit/editor-palette';
16
+ import { getTokenValue } from '@atlaskit/tokens';
15
17
  import SortingIcon from '../../ui/SortingIcon';
16
18
  import { MODE, PLATFORM } from '../../analytics/events';
17
19
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
@@ -74,7 +76,10 @@ var getStyle = function getStyle(background, colGroupWidth, offsetTop) {
74
76
  if (background &&
75
77
  // ignore setting inline styles if ds neutral token is detected
76
78
  !background.includes('--ds-background-neutral')) {
77
- style.backgroundColor = background;
79
+ var tokenName = hexToEditorBackgroundPaletteColorTokenName(background);
80
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
81
+ var tokenColor = tokenName ? getTokenValue(tokenName) : background;
82
+ style.backgroundColor = tokenColor;
78
83
  }
79
84
  if (colGroupWidth) {
80
85
  style.width = colGroupWidth;
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
45
45
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
46
46
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
47
47
  var packageName = "@atlaskit/renderer";
48
- var packageVersion = "107.1.0";
48
+ var packageVersion = "107.2.0";
49
49
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
50
50
  _inherits(Renderer, _PureComponent);
51
51
  var _super = _createSuper(Renderer);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "107.1.0",
3
+ "version": "107.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,10 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import type { EventHandlers } from '@atlaskit/editor-common/ui';
3
3
  import { RendererAppearance } from '../../ui/Renderer/types';
4
+ import { SmartLinksOptions } from '../../types/smartLinksOptions';
4
5
  export default function BlockCard(props: {
5
6
  url?: string;
6
7
  data?: object;
7
8
  eventHandlers?: EventHandlers;
8
9
  portal?: HTMLElement;
9
10
  rendererAppearance?: RendererAppearance;
11
+ smartLinks?: SmartLinksOptions;
10
12
  }): JSX.Element;
@@ -51,6 +51,7 @@ declare const BlockCard: React.ComponentType<{
51
51
  eventHandlers?: import("@atlaskit/editor-common/ui").EventHandlers | undefined;
52
52
  portal?: HTMLElement | undefined;
53
53
  rendererAppearance?: import("../../ui/Renderer/types").RendererAppearance;
54
+ smartLinks?: import("../../types/smartLinksOptions").SmartLinksOptions | undefined;
54
55
  }> & Loadable.LoadableComponent;
55
56
  declare const Media: React.ComponentType<import("./media").MediaProps> & Loadable.LoadableComponent;
56
57
  declare const MediaGroup: React.ComponentType<import("./mediaGroup").MediaGroupProps> & Loadable.LoadableComponent;
@@ -1,4 +1,5 @@
1
1
  export interface SmartLinksOptions {
2
2
  ssr?: boolean;
3
3
  showAuthTooltip?: boolean;
4
+ showServerActions?: boolean;
4
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "107.1.0",
3
+ "version": "107.2.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,24 +29,24 @@
29
29
  "@atlaskit/analytics-listeners": "^8.5.0",
30
30
  "@atlaskit/analytics-namespaced-context": "^6.6.0",
31
31
  "@atlaskit/analytics-next": "^9.0.0",
32
- "@atlaskit/button": "^16.5.0",
32
+ "@atlaskit/button": "^16.6.0",
33
33
  "@atlaskit/code": "^14.5.0",
34
- "@atlaskit/editor-common": "^72.5.0",
34
+ "@atlaskit/editor-common": "^72.6.0",
35
35
  "@atlaskit/editor-json-transformer": "^8.8.0",
36
- "@atlaskit/editor-palette": "1.0.0",
36
+ "@atlaskit/editor-palette": "1.1.0",
37
37
  "@atlaskit/editor-shared-styles": "^2.3.0",
38
- "@atlaskit/emoji": "^67.1.0",
38
+ "@atlaskit/emoji": "^67.2.0",
39
39
  "@atlaskit/icon": "^21.11.0",
40
40
  "@atlaskit/media-card": "^74.7.0",
41
- "@atlaskit/media-client": "^20.1.0",
42
- "@atlaskit/media-common": "^3.0.0",
41
+ "@atlaskit/media-client": "^20.2.0",
42
+ "@atlaskit/media-common": "^4.0.0",
43
43
  "@atlaskit/media-filmstrip": "^46.1.0",
44
44
  "@atlaskit/media-ui": "^22.3.0",
45
45
  "@atlaskit/media-viewer": "^47.5.0",
46
- "@atlaskit/smart-card": "^25.0.0",
46
+ "@atlaskit/smart-card": "^25.1.0",
47
47
  "@atlaskit/status": "^1.2.0",
48
48
  "@atlaskit/task-decision": "^17.5.0",
49
- "@atlaskit/theme": "^12.2.0",
49
+ "@atlaskit/theme": "^12.3.0",
50
50
  "@atlaskit/tokens": "^1.2.0",
51
51
  "@atlaskit/tooltip": "^17.7.0",
52
52
  "@babel/runtime": "^7.0.0",
@@ -61,7 +61,7 @@
61
61
  "uuid": "^3.1.0"
62
62
  },
63
63
  "peerDependencies": {
64
- "@atlaskit/link-provider": "^1.5.0",
64
+ "@atlaskit/link-provider": "^1.5.1",
65
65
  "@atlaskit/media-core": "^34.0.2",
66
66
  "react": "^16.8.0",
67
67
  "react-dom": "^16.8.0"
@@ -71,20 +71,20 @@
71
71
  "@atlaskit/avatar": "^21.2.0",
72
72
  "@atlaskit/css-reset": "^6.3.0",
73
73
  "@atlaskit/docs": "*",
74
- "@atlaskit/editor-core": "^180.1.0",
75
- "@atlaskit/editor-test-helpers": "^18.0.0",
74
+ "@atlaskit/editor-core": "^181.0.0",
75
+ "@atlaskit/editor-test-helpers": "^18.1.0",
76
76
  "@atlaskit/link-provider": "^1.5.0",
77
77
  "@atlaskit/logo": "^13.11.0",
78
78
  "@atlaskit/media-core": "^34.0.0",
79
79
  "@atlaskit/media-integration-test-helpers": "^2.6.0",
80
- "@atlaskit/media-test-helpers": "^30.1.0",
81
- "@atlaskit/mention": "^21.0.0",
80
+ "@atlaskit/media-test-helpers": "^31.0.0",
81
+ "@atlaskit/mention": "^22.0.0",
82
82
  "@atlaskit/navigation-next": "^9.0.0",
83
- "@atlaskit/profilecard": "^18.4.0",
83
+ "@atlaskit/profilecard": "^19.2.0",
84
84
  "@atlaskit/radio": "^5.4.0",
85
85
  "@atlaskit/range": "^7.0.0",
86
86
  "@atlaskit/ssr": "*",
87
- "@atlaskit/util-data-test": "^17.6.0",
87
+ "@atlaskit/util-data-test": "^17.7.0",
88
88
  "@atlaskit/visual-regression": "*",
89
89
  "@atlaskit/webdriver-runner": "*",
90
90
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
package/report.api.md CHANGED
@@ -631,6 +631,8 @@ interface SmartLinksOptions {
631
631
  // (undocumented)
632
632
  showAuthTooltip?: boolean;
633
633
  // (undocumented)
634
+ showServerActions?: boolean;
635
+ // (undocumented)
634
636
  ssr?: boolean;
635
637
  }
636
638
 
@@ -740,7 +742,7 @@ type VisitMediaLinkAEP = AEP<
740
742
 
741
743
  ```json
742
744
  {
743
- "@atlaskit/link-provider": "^1.4.0",
745
+ "@atlaskit/link-provider": "^1.5.0",
744
746
  "@atlaskit/media-core": "^34.0.1",
745
747
  "react": "^16.8.0",
746
748
  "react-dom": "^16.8.0"