@atlaskit/renderer 105.0.4 → 105.1.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
+ ## 105.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`a40ac7f5614`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a40ac7f5614) - New Smartlinks prop to allow renderer to determine whether smart link component inside AK renderer should show auth tooltip on unauthenticated inline links
8
+
9
+ ### Patch Changes
10
+
11
+ - [`a1031a55381`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a1031a55381) - [ux][ed-16466] Tooltip that notifies if expand is open or closed should not render on mobile
12
+ - Updated dependencies
13
+
3
14
  ## 105.0.4
4
15
 
5
16
  ### Patch Changes
@@ -40,10 +40,15 @@ var InlineCard = function InlineCard(props) {
40
40
  };
41
41
  var featureFlags = (0, _useFeatureFlags.useFeatureFlags)();
42
42
 
43
- if (smartLinks !== null && smartLinks !== void 0 && smartLinks.ssr && url) {
43
+ var _ref = smartLinks || {},
44
+ showAuthTooltip = _ref.showAuthTooltip,
45
+ ssr = _ref.ssr;
46
+
47
+ if (ssr && url) {
44
48
  return /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
45
49
  appearance: "inline",
46
- url: url
50
+ url: url,
51
+ showAuthTooltip: showAuthTooltip
47
52
  });
48
53
  }
49
54
 
@@ -55,7 +60,8 @@ var InlineCard = function InlineCard(props) {
55
60
  unsupportedComponent: _ui.UnsupportedInline
56
61
  }, cardProps), /*#__PURE__*/_react.default.createElement(_smartCard.Card, (0, _extends2.default)({
57
62
  appearance: "inline",
58
- showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview
63
+ showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview,
64
+ showAuthTooltip: showAuthTooltip
59
65
  }, cardProps, {
60
66
  onResolve: function onResolve(data) {
61
67
  if (!data.url || !data.title) {
@@ -39,6 +39,8 @@ var _activeHeaderIdProvider = require("./active-header-id-provider");
39
39
 
40
40
  var _uniqueId2 = _interopRequireDefault(require("lodash/uniqueId"));
41
41
 
42
+ var _utils = require("../utils");
43
+
42
44
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
43
45
 
44
46
  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); }
@@ -118,7 +120,8 @@ function Expand(_ref) {
118
120
  nodeType = _ref.nodeType,
119
121
  intl = _ref.intl,
120
122
  fireAnalyticsEvent = _ref.fireAnalyticsEvent,
121
- nestedHeaderIds = _ref.nestedHeaderIds;
123
+ nestedHeaderIds = _ref.nestedHeaderIds,
124
+ rendererAppearance = _ref.rendererAppearance;
122
125
 
123
126
  var _React$useState = _react.default.useState(false),
124
127
  _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
@@ -130,6 +133,9 @@ function Expand(_ref) {
130
133
  focused = _React$useState4[0],
131
134
  setFocused = _React$useState4[1];
132
135
 
136
+ var isMobile = (0, _react.useMemo)(function () {
137
+ return (0, _utils.getPlatform)(rendererAppearance) === 'mobile';
138
+ }, [rendererAppearance]);
133
139
  var label = intl.formatMessage(expanded ? _ui.expandMessages.collapseNode : _ui.expandMessages.expandNode);
134
140
 
135
141
  var _useRef = (0, _react.useRef)((0, _uniqueId2.default)('expand-title-')),
@@ -167,10 +173,15 @@ function Expand(_ref) {
167
173
  "aria-expanded": expanded,
168
174
  contentEditable: false,
169
175
  expanded: expanded
170
- }, (0, _react2.jsx)(_tooltip.default, {
176
+ }, isMobile ? (0, _react2.jsx)(_ui.ExpandIconWrapper, {
177
+ expanded: expanded
178
+ }, (0, _react2.jsx)(_chevronRight.default, {
179
+ label: label
180
+ })) : (0, _react2.jsx)(_tooltip.default, {
171
181
  content: label,
172
182
  position: "top",
173
- tag: _ui.ExpandLayoutWrapperWithRef
183
+ tag: _ui.ExpandLayoutWrapperWithRef,
184
+ testId: 'tooltip'
174
185
  }, (0, _react2.jsx)(_ui.ExpandIconWrapper, {
175
186
  expanded: expanded
176
187
  }, (0, _react2.jsx)(_chevronRight.default, {
@@ -102,7 +102,7 @@ exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
102
102
  var DEGRADED_SEVERITY_THRESHOLD = 3000;
103
103
  exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
104
104
  var packageName = "@atlaskit/renderer";
105
- var packageVersion = "105.0.4";
105
+ var packageVersion = "105.1.0";
106
106
 
107
107
  var Renderer = /*#__PURE__*/function (_PureComponent) {
108
108
  (0, _inherits2.default)(Renderer, _PureComponent);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "105.0.4",
3
+ "version": "105.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -24,11 +24,16 @@ const InlineCard = props => {
24
24
  container: portal
25
25
  };
26
26
  const featureFlags = useFeatureFlags();
27
+ const {
28
+ showAuthTooltip,
29
+ ssr
30
+ } = smartLinks || {};
27
31
 
28
- if (smartLinks !== null && smartLinks !== void 0 && smartLinks.ssr && url) {
32
+ if (ssr && url) {
29
33
  return /*#__PURE__*/React.createElement(CardSSR, {
30
34
  appearance: "inline",
31
- url: url
35
+ url: url,
36
+ showAuthTooltip: showAuthTooltip
32
37
  });
33
38
  }
34
39
 
@@ -40,7 +45,8 @@ const InlineCard = props => {
40
45
  unsupportedComponent: UnsupportedInline
41
46
  }, cardProps), /*#__PURE__*/React.createElement(Card, _extends({
42
47
  appearance: "inline",
43
- showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview
48
+ showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview,
49
+ showAuthTooltip: showAuthTooltip
44
50
  }, cardProps, {
45
51
  onResolve: data => {
46
52
  if (!data.url || !data.title) {
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
- import React, { useRef, useCallback } from 'react';
4
+ import React, { useRef, useCallback, useMemo } from 'react';
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import { gridSize, fontSize } from '@atlaskit/theme/constants';
7
7
  import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
@@ -13,6 +13,7 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/anal
13
13
  import { injectIntl } from 'react-intl-next';
14
14
  import { ActiveHeaderIdConsumer } from './active-header-id-provider';
15
15
  import _uniqueId from 'lodash/uniqueId';
16
+ import { getPlatform } from '../utils';
16
17
  const titleStyles = css`
17
18
  outline: none;
18
19
  border: none;
@@ -102,10 +103,12 @@ function Expand({
102
103
  nodeType,
103
104
  intl,
104
105
  fireAnalyticsEvent,
105
- nestedHeaderIds
106
+ nestedHeaderIds,
107
+ rendererAppearance
106
108
  }) {
107
109
  const [expanded, setExpanded] = React.useState(false);
108
110
  const [focused, setFocused] = React.useState(false);
111
+ const isMobile = useMemo(() => getPlatform(rendererAppearance) === 'mobile', [rendererAppearance]);
109
112
  const label = intl.formatMessage(expanded ? expandMessages.collapseNode : expandMessages.expandNode);
110
113
  const {
111
114
  current: id
@@ -136,10 +139,15 @@ function Expand({
136
139
  "aria-expanded": expanded,
137
140
  contentEditable: false,
138
141
  expanded: expanded
139
- }, jsx(Tooltip, {
142
+ }, isMobile ? jsx(ExpandIconWrapper, {
143
+ expanded: expanded
144
+ }, jsx(ChevronRightIcon, {
145
+ label: label
146
+ })) : jsx(Tooltip, {
140
147
  content: label,
141
148
  position: "top",
142
- tag: ExpandLayoutWrapperWithRef
149
+ tag: ExpandLayoutWrapperWithRef,
150
+ testId: 'tooltip'
143
151
  }, jsx(ExpandIconWrapper, {
144
152
  expanded: expanded
145
153
  }, jsx(ChevronRightIcon, {
@@ -36,7 +36,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
36
36
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
37
37
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
38
38
  const packageName = "@atlaskit/renderer";
39
- const packageVersion = "105.0.4";
39
+ const packageVersion = "105.1.0";
40
40
  export class Renderer extends PureComponent {
41
41
  /**
42
42
  * 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": "105.0.4",
3
+ "version": "105.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -23,10 +23,15 @@ var InlineCard = function InlineCard(props) {
23
23
  };
24
24
  var featureFlags = useFeatureFlags();
25
25
 
26
- if (smartLinks !== null && smartLinks !== void 0 && smartLinks.ssr && url) {
26
+ var _ref = smartLinks || {},
27
+ showAuthTooltip = _ref.showAuthTooltip,
28
+ ssr = _ref.ssr;
29
+
30
+ if (ssr && url) {
27
31
  return /*#__PURE__*/React.createElement(CardSSR, {
28
32
  appearance: "inline",
29
- url: url
33
+ url: url,
34
+ showAuthTooltip: showAuthTooltip
30
35
  });
31
36
  }
32
37
 
@@ -38,7 +43,8 @@ var InlineCard = function InlineCard(props) {
38
43
  unsupportedComponent: UnsupportedInline
39
44
  }, cardProps), /*#__PURE__*/React.createElement(Card, _extends({
40
45
  appearance: "inline",
41
- showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview
46
+ showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview,
47
+ showAuthTooltip: showAuthTooltip
42
48
  }, cardProps, {
43
49
  onResolve: function onResolve(data) {
44
50
  if (!data.url || !data.title) {
@@ -5,7 +5,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
5
5
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
6
6
 
7
7
  /** @jsx jsx */
8
- import React, { useRef, useCallback } from 'react';
8
+ import React, { useRef, useCallback, useMemo } from 'react';
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { gridSize, fontSize } from '@atlaskit/theme/constants';
11
11
  import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
@@ -17,6 +17,7 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/anal
17
17
  import { injectIntl } from 'react-intl-next';
18
18
  import { ActiveHeaderIdConsumer } from './active-header-id-provider';
19
19
  import _uniqueId from 'lodash/uniqueId';
20
+ import { getPlatform } from '../utils';
20
21
  var titleStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n display: flex;\n flex: 1;\n margin: 0;\n padding: 0 0 0 ", "px;\n text-align: left;\n"])), relativeFontSizeToBase16(fontSize()), akEditorLineHeight, gridSize() / 2);
21
22
 
22
23
  var Container = function Container(props) {
@@ -88,7 +89,8 @@ function Expand(_ref) {
88
89
  nodeType = _ref.nodeType,
89
90
  intl = _ref.intl,
90
91
  fireAnalyticsEvent = _ref.fireAnalyticsEvent,
91
- nestedHeaderIds = _ref.nestedHeaderIds;
92
+ nestedHeaderIds = _ref.nestedHeaderIds,
93
+ rendererAppearance = _ref.rendererAppearance;
92
94
 
93
95
  var _React$useState = React.useState(false),
94
96
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -100,6 +102,9 @@ function Expand(_ref) {
100
102
  focused = _React$useState4[0],
101
103
  setFocused = _React$useState4[1];
102
104
 
105
+ var isMobile = useMemo(function () {
106
+ return getPlatform(rendererAppearance) === 'mobile';
107
+ }, [rendererAppearance]);
103
108
  var label = intl.formatMessage(expanded ? expandMessages.collapseNode : expandMessages.expandNode);
104
109
 
105
110
  var _useRef = useRef(_uniqueId('expand-title-')),
@@ -137,10 +142,15 @@ function Expand(_ref) {
137
142
  "aria-expanded": expanded,
138
143
  contentEditable: false,
139
144
  expanded: expanded
140
- }, jsx(Tooltip, {
145
+ }, isMobile ? jsx(ExpandIconWrapper, {
146
+ expanded: expanded
147
+ }, jsx(ChevronRightIcon, {
148
+ label: label
149
+ })) : jsx(Tooltip, {
141
150
  content: label,
142
151
  position: "top",
143
- tag: ExpandLayoutWrapperWithRef
152
+ tag: ExpandLayoutWrapperWithRef,
153
+ testId: 'tooltip'
144
154
  }, jsx(ExpandIconWrapper, {
145
155
  expanded: expanded
146
156
  }, jsx(ChevronRightIcon, {
@@ -50,7 +50,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
50
50
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
51
51
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
52
52
  var packageName = "@atlaskit/renderer";
53
- var packageVersion = "105.0.4";
53
+ var packageVersion = "105.1.0";
54
54
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
55
55
  _inherits(Renderer, _PureComponent);
56
56
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "105.0.4",
3
+ "version": "105.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,4 @@
1
1
  export interface SmartLinksOptions {
2
2
  ssr?: boolean;
3
+ showAuthTooltip?: boolean;
3
4
  }
@@ -2,6 +2,7 @@
2
2
  import React from 'react';
3
3
  import { AnalyticsEventPayload } from '../analytics/events';
4
4
  import { WrappedComponentProps } from 'react-intl-next';
5
+ import { RendererAppearance } from './Renderer/types';
5
6
  export declare type StyleProps = {
6
7
  expanded?: boolean;
7
8
  focused?: boolean;
@@ -14,6 +15,7 @@ export interface ExpandProps {
14
15
  children: React.ReactNode;
15
16
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
16
17
  nestedHeaderIds?: Array<string>;
18
+ rendererAppearance?: RendererAppearance;
17
19
  }
18
20
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<ExpandProps & WrappedComponentProps<"intl">>> & {
19
21
  WrappedComponent: React.ComponentType<ExpandProps & WrappedComponentProps<"intl">>;
package/docs/0-intro.tsx CHANGED
@@ -137,6 +137,15 @@ ${(
137
137
  />
138
138
  )}
139
139
 
140
+ ## Theming and dark mode support
141
+ To render certain ADF content correctly in different color themes, such as light and dark mode, this package utilise
142
+ the \`@atlaskit/editor-palette\` package, which converts colors stored in ADF to Atlassian Design Tokens.
143
+ Learn more about this utility in the [Editor Palette docs](/packages/editor/editor-palette).
144
+
145
+ Full light and dark mode support for the Editor is a work in progress. Currently, the following experiences do not yet support theming:
146
+ - Custom table backgrounds
147
+ - Custom panel backgrounds
148
+
140
149
  ${(
141
150
  <Props
142
151
  heading="Props"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "105.0.4",
3
+ "version": "105.1.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,19 +31,19 @@
31
31
  "@atlaskit/analytics-next": "^8.2.0",
32
32
  "@atlaskit/button": "^16.5.0",
33
33
  "@atlaskit/code": "^14.4.0",
34
- "@atlaskit/editor-common": "^72.1.0",
34
+ "@atlaskit/editor-common": "^72.2.0",
35
35
  "@atlaskit/editor-json-transformer": "^8.8.0",
36
- "@atlaskit/editor-palette": "0.1.0",
36
+ "@atlaskit/editor-palette": "1.0.0",
37
37
  "@atlaskit/editor-shared-styles": "^2.3.0",
38
38
  "@atlaskit/emoji": "^67.0.0",
39
39
  "@atlaskit/icon": "^21.11.0",
40
- "@atlaskit/media-card": "^74.4.0",
40
+ "@atlaskit/media-card": "^74.5.0",
41
41
  "@atlaskit/media-client": "^20.0.0",
42
- "@atlaskit/media-common": "^2.18.0",
42
+ "@atlaskit/media-common": "^2.19.0",
43
43
  "@atlaskit/media-filmstrip": "^46.1.0",
44
- "@atlaskit/media-ui": "^22.2.0",
45
- "@atlaskit/media-viewer": "^47.3.0",
46
- "@atlaskit/smart-card": "^23.13.0",
44
+ "@atlaskit/media-ui": "^22.3.0",
45
+ "@atlaskit/media-viewer": "^47.4.0",
46
+ "@atlaskit/smart-card": "^23.14.0",
47
47
  "@atlaskit/status": "^1.2.0",
48
48
  "@atlaskit/task-decision": "^17.5.0",
49
49
  "@atlaskit/theme": "^12.2.0",
@@ -71,7 +71,7 @@
71
71
  "@atlaskit/avatar": "^21.1.0",
72
72
  "@atlaskit/css-reset": "^6.3.0",
73
73
  "@atlaskit/docs": "*",
74
- "@atlaskit/editor-core": "^178.0.0",
74
+ "@atlaskit/editor-core": "^178.1.0",
75
75
  "@atlaskit/editor-test-helpers": "^18.0.0",
76
76
  "@atlaskit/link-provider": "^1.3.0",
77
77
  "@atlaskit/logo": "^13.10.0",
package/report.api.md CHANGED
@@ -625,6 +625,8 @@ export interface Serializer<T> {
625
625
 
626
626
  // @public (undocumented)
627
627
  interface SmartLinksOptions {
628
+ // (undocumented)
629
+ showAuthTooltip?: boolean;
628
630
  // (undocumented)
629
631
  ssr?: boolean;
630
632
  }
@@ -735,7 +737,7 @@ type VisitMediaLinkAEP = AEP<
735
737
 
736
738
  ```json
737
739
  {
738
- "@atlaskit/link-provider": "^1.3.4",
740
+ "@atlaskit/link-provider": "^1.3.8",
739
741
  "@atlaskit/media-core": "^34.0.1",
740
742
  "react": "^16.8.0",
741
743
  "react-dom": "^16.8.0"