@atlaskit/smart-card 34.10.2 → 34.10.4

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 (30) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/extractors/common/icon/extractIconFromDocument.js +61 -7
  3. package/dist/cjs/utils/analytics/analytics.js +1 -1
  4. package/dist/cjs/view/EmbedCard/components/ExpandedFrame.compiled.css +50 -0
  5. package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +70 -7
  6. package/dist/cjs/view/EmbedCard/components/styled.js +22 -15
  7. package/dist/cjs/view/InlineCard/common/action-button/index.js +4 -1
  8. package/dist/cjs/view/LinkUrl/index.js +1 -1
  9. package/dist/cjs/view/common/UnauthorisedViewContent.js +8 -1
  10. package/dist/es2019/extractors/common/icon/extractIconFromDocument.js +61 -6
  11. package/dist/es2019/utils/analytics/analytics.js +1 -1
  12. package/dist/es2019/view/EmbedCard/components/ExpandedFrame.compiled.css +50 -0
  13. package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +71 -8
  14. package/dist/es2019/view/EmbedCard/components/styled.js +21 -14
  15. package/dist/es2019/view/InlineCard/common/action-button/index.js +6 -1
  16. package/dist/es2019/view/LinkUrl/index.js +1 -1
  17. package/dist/es2019/view/common/UnauthorisedViewContent.js +8 -1
  18. package/dist/esm/extractors/common/icon/extractIconFromDocument.js +61 -6
  19. package/dist/esm/utils/analytics/analytics.js +1 -1
  20. package/dist/esm/view/EmbedCard/components/ExpandedFrame.compiled.css +50 -0
  21. package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +71 -8
  22. package/dist/esm/view/EmbedCard/components/styled.js +21 -14
  23. package/dist/esm/view/InlineCard/common/action-button/index.js +4 -1
  24. package/dist/esm/view/LinkUrl/index.js +1 -1
  25. package/dist/esm/view/common/UnauthorisedViewContent.js +8 -1
  26. package/dist/types/view/EmbedCard/components/styled.d.ts +7 -7
  27. package/dist/types/view/InlineCard/common/action-button/index.d.ts +1 -0
  28. package/dist/types-ts4.5/view/EmbedCard/components/styled.d.ts +7 -7
  29. package/dist/types-ts4.5/view/InlineCard/common/action-button/index.d.ts +1 -0
  30. package/package.json +4 -4
@@ -1,4 +1,6 @@
1
1
  /* ExpandedFrame.tsx generated by @compiled/babel-plugin v0.36.0 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import "./ExpandedFrame.compiled.css";
2
4
  import * as React from 'react';
3
5
  import { ax, ix } from "@compiled/react/runtime";
4
6
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -6,7 +8,7 @@ import Tooltip from '@atlaskit/tooltip';
6
8
  import { useMouseDownEvent } from '../../../state/analytics/useLinkClicked';
7
9
  import { handleClickCommon } from '../../common/utils';
8
10
  import { ExpandedFrameOld } from './ExpandedFrameOld';
9
- import { className, Content, Header, IconWrapper, LinkWrapper, TextWrapper, TooltipWrapper, Wrapper } from './styled';
11
+ import { className, ContentOldVisualRefresh, HeaderOldVisualRefresh, IconWrapperOldVisualRefresh, LinkWrapperOldVisualRefresh, TextWrapperOldVisualRefresh, TooltipWrapperOldVisualRefresh, WrapperOldVisualRefresh } from './styled';
10
12
  const ExpandedFrameNew = ({
11
13
  isPlaceholder = false,
12
14
  children,
@@ -27,18 +29,35 @@ const ExpandedFrameNew = ({
27
29
  const handleClick = event => handleClickCommon(event, onClick);
28
30
  const handleMouseDown = useMouseDownEvent();
29
31
  const renderHeader = () => {
32
+ if (fg('platform-linking-visual-refresh-v1')) {
33
+ return frameStyle !== 'hide' && /*#__PURE__*/React.createElement("div", {
34
+ className: ax([styles.header, "embed-header"])
35
+ }, /*#__PURE__*/React.createElement("div", {
36
+ className: ax([styles.headerIcon])
37
+ }, icon), /*#__PURE__*/React.createElement("div", {
38
+ className: ax([styles.tooltipWrapper])
39
+ }, !isPlaceholder && /*#__PURE__*/React.createElement(Tooltip, {
40
+ content: text,
41
+ hideTooltipOnMouseDown: true
42
+ }, /*#__PURE__*/React.createElement("a", {
43
+ href: href,
44
+ onClick: handleClick,
45
+ onMouseDown: handleMouseDown,
46
+ className: ax([styles.headerAnchor])
47
+ }, text))));
48
+ }
30
49
  return (
31
50
  /*#__PURE__*/
32
51
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
33
- React.createElement(Header, {
52
+ React.createElement(HeaderOldVisualRefresh, {
34
53
  className: "embed-header",
35
54
  frameStyle: frameStyle
36
- }, /*#__PURE__*/React.createElement(IconWrapper, {
55
+ }, /*#__PURE__*/React.createElement(IconWrapperOldVisualRefresh, {
37
56
  isPlaceholder: isPlaceholder
38
- }, !isPlaceholder && icon), /*#__PURE__*/React.createElement(TooltipWrapper, null, /*#__PURE__*/React.createElement(Tooltip, {
57
+ }, !isPlaceholder && icon), /*#__PURE__*/React.createElement(TooltipWrapperOldVisualRefresh, null, /*#__PURE__*/React.createElement(Tooltip, {
39
58
  content: text,
40
59
  hideTooltipOnMouseDown: true
41
- }, /*#__PURE__*/React.createElement(TextWrapper, {
60
+ }, /*#__PURE__*/React.createElement(TextWrapperOldVisualRefresh, {
42
61
  isPlaceholder: isPlaceholder
43
62
  }, !isPlaceholder && /*#__PURE__*/React.createElement("a", {
44
63
  href: href,
@@ -47,8 +66,20 @@ const ExpandedFrameNew = ({
47
66
  }, text)))))
48
67
  );
49
68
  };
69
+ const interactive = isInteractive();
70
+ const showBackgroundAlways = frameStyle === 'show' || isSelected && frameStyle !== 'hide';
71
+ const showBackgroundOnHover = interactive && frameStyle !== 'hide';
50
72
  const renderContent = () => {
51
- return /*#__PURE__*/React.createElement(Content, {
73
+ if (fg('platform-linking-visual-refresh-v1')) {
74
+ return /*#__PURE__*/React.createElement("div", {
75
+ "data-testid": "embed-content-wrapper",
76
+ // This fixes an issue with input fields in cross domain iframes (ie. databases and jira fields from different domains)
77
+ // See: HOT-107830
78
+ contentEditable: false,
79
+ className: ax([styles.contentStyle, setOverflow && allowScrollBar && styles.contentOverflowAuto, interactive && !showBackgroundAlways && !showBackgroundOnHover && styles.contentInteractiveActiveBorder])
80
+ }, children);
81
+ }
82
+ return /*#__PURE__*/React.createElement(ContentOldVisualRefresh, {
52
83
  "data-testid": "embed-content-wrapper",
53
84
  allowScrollBar: allowScrollBar,
54
85
  removeOverflow: !setOverflow,
@@ -61,8 +92,26 @@ const ExpandedFrameNew = ({
61
92
  suppressContentEditableWarning: true
62
93
  }, children);
63
94
  };
95
+ if (fg('platform-linking-visual-refresh-v1')) {
96
+ return /*#__PURE__*/React.createElement("div", _extends({
97
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
98
+ className: ax([styles.linkWrapper, inheritDimensions && styles.linkWrapperInheritDimensions, isSelected && frameStyle !== 'hide' && styles.linkWrapperSelected, showBackgroundAlways && styles.linkWrapperBorderAndBackground, showBackgroundOnHover && !showBackgroundAlways && styles.linkWrapperInteractiveNotHidden, className]),
99
+ style: {
100
+ minWidth: minWidth ? `${minWidth}px` : '',
101
+ maxWidth: maxWidth ? `${maxWidth}px` : ''
102
+ },
103
+ "data-testid": testId,
104
+ "data-trello-do-not-use-override": testId
105
+ // Due to limitations of testing library, we can't assert ::after
106
+ ,
107
+ "data-is-selected": isSelected
108
+ }, (isPlaceholder || !href) && {
109
+ 'data-wrapper-type': 'default',
110
+ 'data-is-interactive': isInteractive()
111
+ }), renderHeader(), renderContent());
112
+ }
64
113
  if (!isPlaceholder && href) {
65
- return /*#__PURE__*/React.createElement(LinkWrapper
114
+ return /*#__PURE__*/React.createElement(LinkWrapperOldVisualRefresh
66
115
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
67
116
  , {
68
117
  className: className,
@@ -79,7 +128,7 @@ const ExpandedFrameNew = ({
79
128
  inheritDimensions: inheritDimensions
80
129
  }, renderHeader(), renderContent());
81
130
  } else {
82
- return /*#__PURE__*/React.createElement(Wrapper
131
+ return /*#__PURE__*/React.createElement(WrapperOldVisualRefresh
83
132
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
84
133
  , {
85
134
  className: className,
@@ -102,4 +151,18 @@ export const ExpandedFrame = props => {
102
151
  } else {
103
152
  return /*#__PURE__*/React.createElement(ExpandedFrameOld, props);
104
153
  }
154
+ };
155
+ const styles = {
156
+ linkWrapper: "_zulpu2gc _kqswh2mm _1e0c1txw _2lx21bp4 _4t3ik5xz _ca0qu2gc _u5f3u2gc _n3tdu2gc _19bvu2gc _uiztglyw _qc5o94zs _14mj1crf _aetrb3bt _18postnw _15l2idpf _32rxidpf _1x88idpf _19doidpf _1hfk18uv _1bqqidpf _u94kidpf _1ifiidpf",
157
+ linkWrapperInheritDimensions: "_4t3i1osq",
158
+ linkWrapperSelected: "_8x3u92p9",
159
+ linkWrapperBorderAndBackground: "_1tqzzgxb _1hfkhp5a _1ifikb7n",
160
+ linkWrapperInteractiveNotHidden: "_hcgvzgxb _4tpuhp5a _x148kb7n",
161
+ header: "_zulp1b66 _1e0c1txw _4cvr1h6o _4t3igktf _1pbykb7n",
162
+ tooltipWrapper: "_1reo15vq _18m915vq",
163
+ headerAnchor: "_11c81il0 _9oik18uv _1bnxglyw _jf4cnqa1",
164
+ headerIcon: "_1bsb7vkz _4t3i7vkz",
165
+ contentStyle: "_19it1pvm _2rko1y44 _1reo15vq _18m915vq _v56414au _bfhkhp5a _16jlkb7n _4t3i1osq _1pbykb7n",
166
+ contentInteractiveActiveBorder: "_1jhm1ips",
167
+ contentOverflowAuto: "_1reo1wug _18m91wug"
105
168
  };
@@ -9,8 +9,9 @@ import { ax, ix } from "@compiled/react/runtime";
9
9
  import { B100, B50, N30, N300, N40 } from '@atlaskit/theme/colors';
10
10
  export const className = 'media-card-frame';
11
11
  export const embedHeaderHeight = 32;
12
+ // TODO Delete when cleaning platform-linking-visual-refresh-v1
12
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled,@atlaskit/ui-styling-standard/no-exported-styles
13
- export const LinkWrapper = forwardRef(({
14
+ export const LinkWrapperOldVisualRefresh = forwardRef(({
14
15
  as: C = "div",
15
16
  style: __cmpls,
16
17
  ...__cmplp
@@ -35,11 +36,12 @@ export const LinkWrapper = forwardRef(({
35
36
  }));
36
37
  });
37
38
 
39
+ // TODO Delete when cleaning platform-linking-visual-refresh-v1
38
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled,@atlaskit/ui-styling-standard/no-exported-styles
39
41
  if (process.env.NODE_ENV !== 'production') {
40
- LinkWrapper.displayName = 'LinkWrapper';
42
+ LinkWrapperOldVisualRefresh.displayName = 'LinkWrapperOldVisualRefresh';
41
43
  }
42
- export const Wrapper = forwardRef(({
44
+ export const WrapperOldVisualRefresh = forwardRef(({
43
45
  as: C = "div",
44
46
  style: __cmpls,
45
47
  ...__cmplp
@@ -64,11 +66,12 @@ export const Wrapper = forwardRef(({
64
66
  }));
65
67
  });
66
68
 
69
+ // TODO Delete when cleaning platform-linking-visual-refresh-v1
67
70
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled,@atlaskit/ui-styling-standard/no-exported-styles
68
71
  if (process.env.NODE_ENV !== 'production') {
69
- Wrapper.displayName = 'Wrapper';
72
+ WrapperOldVisualRefresh.displayName = 'WrapperOldVisualRefresh';
70
73
  }
71
- export const Header = forwardRef(({
74
+ export const HeaderOldVisualRefresh = forwardRef(({
72
75
  as: C = "div",
73
76
  style: __cmpls,
74
77
  ...__cmplp
@@ -84,11 +87,12 @@ export const Header = forwardRef(({
84
87
  }));
85
88
  });
86
89
 
90
+ // TODO Delete when cleaning platform-linking-visual-refresh-v1
87
91
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled,@atlaskit/ui-styling-standard/no-exported-styles
88
92
  if (process.env.NODE_ENV !== 'production') {
89
- Header.displayName = 'Header';
93
+ HeaderOldVisualRefresh.displayName = 'HeaderOldVisualRefresh';
90
94
  }
91
- export const IconWrapper = forwardRef(({
95
+ export const IconWrapperOldVisualRefresh = forwardRef(({
92
96
  as: C = "div",
93
97
  style: __cmpls,
94
98
  ...__cmplp
@@ -104,11 +108,12 @@ export const IconWrapper = forwardRef(({
104
108
  }));
105
109
  });
106
110
 
111
+ // TODO Delete when cleaning platform-linking-visual-refresh-v1
107
112
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled,@atlaskit/ui-styling-standard/no-exported-styles
108
113
  if (process.env.NODE_ENV !== 'production') {
109
- IconWrapper.displayName = 'IconWrapper';
114
+ IconWrapperOldVisualRefresh.displayName = 'IconWrapperOldVisualRefresh';
110
115
  }
111
- export const TextWrapper = forwardRef(({
116
+ export const TextWrapperOldVisualRefresh = forwardRef(({
112
117
  as: C = "div",
113
118
  style: __cmpls,
114
119
  ...__cmplp
@@ -124,11 +129,12 @@ export const TextWrapper = forwardRef(({
124
129
  }));
125
130
  });
126
131
 
132
+ // TODO Delete when cleaning platform-linking-visual-refresh-v1
127
133
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled,@atlaskit/ui-styling-standard/no-exported-styles
128
134
  if (process.env.NODE_ENV !== 'production') {
129
- TextWrapper.displayName = 'TextWrapper';
135
+ TextWrapperOldVisualRefresh.displayName = 'TextWrapperOldVisualRefresh';
130
136
  }
131
- export const TooltipWrapper = forwardRef(({
137
+ export const TooltipWrapperOldVisualRefresh = forwardRef(({
132
138
  as: C = "div",
133
139
  style: __cmpls,
134
140
  ...__cmplp
@@ -140,14 +146,15 @@ export const TooltipWrapper = forwardRef(({
140
146
  }));
141
147
  });
142
148
 
149
+ // TODO Delete when cleaning platform-linking-visual-refresh-v1
143
150
  // NB: `overflow` is kept as `hidden` since
144
151
  // the internal contents of the `iframe` should
145
152
  // manage scrolling behaviour.
146
153
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled,@atlaskit/ui-styling-standard/no-exported-styles
147
154
  if (process.env.NODE_ENV !== 'production') {
148
- TooltipWrapper.displayName = 'TooltipWrapper';
155
+ TooltipWrapperOldVisualRefresh.displayName = 'TooltipWrapperOldVisualRefresh';
149
156
  }
150
- export const Content = forwardRef(({
157
+ export const ContentOldVisualRefresh = forwardRef(({
151
158
  as: C = "div",
152
159
  style: __cmpls,
153
160
  ...__cmplp
@@ -165,7 +172,7 @@ export const Content = forwardRef(({
165
172
  }));
166
173
  });
167
174
  if (process.env.NODE_ENV !== 'production') {
168
- Content.displayName = 'Content';
175
+ ContentOldVisualRefresh.displayName = 'ContentOldVisualRefresh';
169
176
  }
170
177
  const getSizeWithUnit = (value = '100%') => {
171
178
  const unit = typeof value === 'number' ? 'px' : '';
@@ -8,13 +8,18 @@ export const ActionButton = /*#__PURE__*/forwardRef(({
8
8
  children,
9
9
  ...props
10
10
  }, ref) => {
11
+ // `Button transforms `testId` into `data-testid`. We need to transform it back to `testId`
12
+ const {
13
+ [`data-testid`]: testId
14
+ } = props;
11
15
  return /*#__PURE__*/React.createElement(Box, _extends({
12
16
  as: "span",
13
17
  ref: ref,
14
18
  xcss: [actionButtonStyle, !props.disabled && actionButtonNotDisabledStyle]
15
19
  }, props, {
16
20
  "aria-disabled": props.disabled,
17
- role: "button"
21
+ role: "button",
22
+ testId: testId
18
23
  }), /*#__PURE__*/React.createElement(Box, {
19
24
  as: "span",
20
25
  xcss: internalButtonStyle
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  const PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "34.10.2",
13
+ packageVersion: "34.10.4",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  const Anchor = withLinkClickedEvent('a');
@@ -1,6 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback } from 'react';
3
3
  import { FormattedMessage } from 'react-intl-next';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { Anchor } from '@atlaskit/primitives';
4
6
  import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
5
7
  import { CONTENT_URL_3P_ACCOUNT_AUTH, CONTENT_URL_SECURITY_AND_PERMISSIONS } from '../../constants';
6
8
  import { messages } from '../../messages';
@@ -24,7 +26,12 @@ const UnauthorisedViewContent = ({
24
26
  values: {
25
27
  context: providerName
26
28
  }
27
- })) : /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_unauthorised_account_description_no_provider), ' ', /*#__PURE__*/React.createElement("a", {
29
+ })) : /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_unauthorised_account_description_no_provider), ' ', fg('platform-linking-visual-refresh-v1') ? /*#__PURE__*/React.createElement(Anchor, {
30
+ href: isProductIntegrationSupported ? CONTENT_URL_3P_ACCOUNT_AUTH : CONTENT_URL_SECURITY_AND_PERMISSIONS,
31
+ target: "_blank",
32
+ testId: `${testId}-learn-more`,
33
+ onClick: handleLearnMoreClick
34
+ }, /*#__PURE__*/React.createElement(FormattedMessage, learnMoreMessage)) : /*#__PURE__*/React.createElement("a", {
28
35
  href: isProductIntegrationSupported ? CONTENT_URL_3P_ACCOUNT_AUTH : CONTENT_URL_SECURITY_AND_PERMISSIONS,
29
36
  target: "_blank",
30
37
  "data-testid": `${testId}-learn-more`,
@@ -1,14 +1,69 @@
1
1
  import React from 'react';
2
- import DocumentIcon from '@atlaskit/icon-file-type/glyph/document/16';
3
- import FileIcon from '@atlaskit/icon-file-type/glyph/generic/16';
4
- import PresentationIcon from '@atlaskit/icon-file-type/glyph/presentation/16';
5
- import SpreadsheetIcon from '@atlaskit/icon-file-type/glyph/spreadsheet/16';
2
+ import DocumentIconOld from '@atlaskit/icon-file-type/glyph/document/16';
3
+ import FileIconOld from '@atlaskit/icon-file-type/glyph/generic/16';
4
+ import PresentationIconOld from '@atlaskit/icon-file-type/glyph/presentation/16';
5
+ import SpreadsheetIconOld from '@atlaskit/icon-file-type/glyph/spreadsheet/16';
6
6
  import LiveDocumentIcon from '@atlaskit/icon-lab/core/page-live-doc';
7
- import BlogIcon from '@atlaskit/icon-object/glyph/blog/16';
8
- import DocumentFilledIcon from '@atlaskit/icon/core/migration/page--document-filled';
7
+ import BlogIconOld from '@atlaskit/icon-object/glyph/blog/16';
8
+ import DocumentFilledIconNew from '@atlaskit/icon/core/migration/file--document-filled';
9
+ import DocumentFilledIconOld from '@atlaskit/icon/core/migration/page--document-filled';
9
10
  import { isConfluenceGenerator } from '@atlaskit/link-extractors';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
12
+ import BlogIconNew from '../../../common/ui/icons/blog-icon';
13
+ import PresentationIconNew from '../../../common/ui/icons/chart-bar-icon';
14
+ import FileIconNew from '../../../common/ui/icons/file-icon';
15
+ import SpreadsheetIconNew from '../../../common/ui/icons/list-bullet-icon';
16
+ import DocumentIconNew from '../../../common/ui/icons/page-icon';
10
17
  import { getIconForFileType } from '../../../utils';
11
18
  import { prioritiseIcon } from './prioritiseIcon';
19
+
20
+ // TODO Delete this and rename BlogIconNew to BlogIcon when cleaning platform-smart-card-icon-migration
21
+ var BlogIcon = function BlogIcon(props) {
22
+ if (fg('platform-smart-card-icon-migration')) {
23
+ return /*#__PURE__*/React.createElement(BlogIconNew, props);
24
+ }
25
+ return /*#__PURE__*/React.createElement(BlogIconOld, props);
26
+ };
27
+
28
+ // TODO Delete this and rename FileIconNew to FileIcon when cleaning platform-smart-card-icon-migration
29
+ var FileIcon = function FileIcon(props) {
30
+ if (fg('platform-smart-card-icon-migration')) {
31
+ return /*#__PURE__*/React.createElement(FileIconNew, props);
32
+ }
33
+ return /*#__PURE__*/React.createElement(FileIconOld, props);
34
+ };
35
+
36
+ // TODO Delete this and rename DocumentIconNew to DocumentIcon when cleaning platform-smart-card-icon-migration
37
+ var DocumentIcon = function DocumentIcon(props) {
38
+ if (fg('platform-smart-card-icon-migration')) {
39
+ return /*#__PURE__*/React.createElement(DocumentIconNew, props);
40
+ }
41
+ return /*#__PURE__*/React.createElement(DocumentIconOld, props);
42
+ };
43
+
44
+ // TODO Delete this and rename PresentationIconNew to PresentationIcon when cleaning platform-smart-card-icon-migration
45
+ var PresentationIcon = function PresentationIcon(props) {
46
+ if (fg('platform-smart-card-icon-migration')) {
47
+ return /*#__PURE__*/React.createElement(PresentationIconNew, props);
48
+ }
49
+ return /*#__PURE__*/React.createElement(PresentationIconOld, props);
50
+ };
51
+
52
+ // TODO Delete this and rename SpreadsheetIconNew to SpreadsheetIcon when cleaning platform-smart-card-icon-migration
53
+ var SpreadsheetIcon = function SpreadsheetIcon(props) {
54
+ if (fg('platform-smart-card-icon-migration')) {
55
+ return /*#__PURE__*/React.createElement(SpreadsheetIconNew, props);
56
+ }
57
+ return /*#__PURE__*/React.createElement(SpreadsheetIconOld, props);
58
+ };
59
+
60
+ // TODO Delete this and rename DocumentFilledIconNew to DocumentFilledIcon when cleaning platform-smart-card-icon-migration
61
+ var DocumentFilledIcon = function DocumentFilledIcon(props) {
62
+ if (fg('platform-smart-card-icon-migration')) {
63
+ return /*#__PURE__*/React.createElement(DocumentFilledIconNew, props);
64
+ }
65
+ return /*#__PURE__*/React.createElement(DocumentFilledIconOld, props);
66
+ };
12
67
  /**
13
68
  * Extracts an icon for a document pbject
14
69
  *
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "34.10.2"
7
+ packageVersion: "34.10.4"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -0,0 +1,50 @@
1
+ ._11c81il0{font:var(--ds-font-heading-xsmall,normal 600 14px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._14mj1crf:after{border-radius:9pt}
3
+ ._19it1pvm{border:solid 1px var(--ds-border,#091e4224)}
4
+ ._1tqzzgxb:after{outline:1px solid var(--ds-border,#091e4224)}
5
+ ._2rko1y44{border-radius:4px}
6
+ ._hcgvzgxb:hover:after{outline:1px solid var(--ds-border,#091e4224)}
7
+ ._qc5o94zs:after{transition:background .3s,box-shadow .3s}
8
+ ._v56414au{transition:outline .3s}
9
+ ._zulp1b66{gap:var(--ds-space-050,4px)}
10
+ ._zulpu2gc{gap:var(--ds-space-100,8px)}
11
+ ._15l2idpf:after{top:0}
12
+ ._16jlkb7n{flex-grow:1}
13
+ ._18m915vq{overflow-y:hidden}
14
+ ._18m91wug{overflow-y:auto}
15
+ ._18postnw:after{position:absolute}
16
+ ._19bvu2gc{padding-left:var(--ds-space-100,8px)}
17
+ ._19doidpf:after{left:0}
18
+ ._1bqqidpf:after{z-index:0}
19
+ ._1bsb7vkz{width:1pc}
20
+ ._1e0c1txw{display:flex}
21
+ ._1hfk18uv:after{background-color:initial}
22
+ ._1hfkhp5a:after{background-color:var(--ds-surface-raised,#fff)}
23
+ ._1ifiidpf .embed-header{opacity:0}
24
+ ._1ifikb7n .embed-header{opacity:1}
25
+ ._1pbykb7n{z-index:1}
26
+ ._1reo15vq{overflow-x:hidden}
27
+ ._1reo1wug{overflow-x:auto}
28
+ ._1x88idpf:after{bottom:0}
29
+ ._2lx21bp4{flex-direction:column}
30
+ ._32rxidpf:after{right:0}
31
+ ._4cvr1h6o{align-items:center}
32
+ ._4t3i1osq{height:100%}
33
+ ._4t3i7vkz{height:1pc}
34
+ ._4t3igktf{height:20px}
35
+ ._4t3ik5xz{height:27pc}
36
+ ._4tpuhp5a:hover:after{background-color:var(--ds-surface-raised,#fff)}
37
+ ._8x3u92p9:after{box-shadow:0 0 0 3px var(--ds-border-selected,#0c66e4)}
38
+ ._aetrb3bt:after{content:""}
39
+ ._bfhkhp5a{background-color:var(--ds-surface-raised,#fff)}
40
+ ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
41
+ ._kqswh2mm{position:relative}
42
+ ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
43
+ ._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
44
+ ._u94kidpf:after{flex-grow:0}
45
+ ._uiztglyw{-webkit-user-select:none;-ms-user-select:none;user-select:none}
46
+ ._x148kb7n:hover .embed-header{opacity:1}
47
+ ._1bnxglyw:hover{text-decoration-line:none}
48
+ ._9oik18uv:hover{text-decoration-color:initial}
49
+ ._jf4cnqa1:hover{text-decoration-style:solid}
50
+ ._1jhm1ips:active{outline:8px solid var(--ds-background-selected,#e9f2ff)}
@@ -1,4 +1,6 @@
1
1
  /* ExpandedFrame.tsx generated by @compiled/babel-plugin v0.36.0 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import "./ExpandedFrame.compiled.css";
2
4
  import * as React from 'react';
3
5
  import { ax, ix } from "@compiled/react/runtime";
4
6
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -6,7 +8,7 @@ import Tooltip from '@atlaskit/tooltip';
6
8
  import { useMouseDownEvent } from '../../../state/analytics/useLinkClicked';
7
9
  import { handleClickCommon } from '../../common/utils';
8
10
  import { ExpandedFrameOld } from './ExpandedFrameOld';
9
- import { className, Content, Header, IconWrapper, LinkWrapper, TextWrapper, TooltipWrapper, Wrapper } from './styled';
11
+ import { className, ContentOldVisualRefresh, HeaderOldVisualRefresh, IconWrapperOldVisualRefresh, LinkWrapperOldVisualRefresh, TextWrapperOldVisualRefresh, TooltipWrapperOldVisualRefresh, WrapperOldVisualRefresh } from './styled';
10
12
  var ExpandedFrameNew = function ExpandedFrameNew(_ref) {
11
13
  var _ref$isPlaceholder = _ref.isPlaceholder,
12
14
  isPlaceholder = _ref$isPlaceholder === void 0 ? false : _ref$isPlaceholder,
@@ -35,18 +37,35 @@ var ExpandedFrameNew = function ExpandedFrameNew(_ref) {
35
37
  };
36
38
  var handleMouseDown = useMouseDownEvent();
37
39
  var renderHeader = function renderHeader() {
40
+ if (fg('platform-linking-visual-refresh-v1')) {
41
+ return frameStyle !== 'hide' && /*#__PURE__*/React.createElement("div", {
42
+ className: ax([styles.header, "embed-header"])
43
+ }, /*#__PURE__*/React.createElement("div", {
44
+ className: ax([styles.headerIcon])
45
+ }, icon), /*#__PURE__*/React.createElement("div", {
46
+ className: ax([styles.tooltipWrapper])
47
+ }, !isPlaceholder && /*#__PURE__*/React.createElement(Tooltip, {
48
+ content: text,
49
+ hideTooltipOnMouseDown: true
50
+ }, /*#__PURE__*/React.createElement("a", {
51
+ href: href,
52
+ onClick: handleClick,
53
+ onMouseDown: handleMouseDown,
54
+ className: ax([styles.headerAnchor])
55
+ }, text))));
56
+ }
38
57
  return (
39
58
  /*#__PURE__*/
40
59
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
41
- React.createElement(Header, {
60
+ React.createElement(HeaderOldVisualRefresh, {
42
61
  className: "embed-header",
43
62
  frameStyle: frameStyle
44
- }, /*#__PURE__*/React.createElement(IconWrapper, {
63
+ }, /*#__PURE__*/React.createElement(IconWrapperOldVisualRefresh, {
45
64
  isPlaceholder: isPlaceholder
46
- }, !isPlaceholder && icon), /*#__PURE__*/React.createElement(TooltipWrapper, null, /*#__PURE__*/React.createElement(Tooltip, {
65
+ }, !isPlaceholder && icon), /*#__PURE__*/React.createElement(TooltipWrapperOldVisualRefresh, null, /*#__PURE__*/React.createElement(Tooltip, {
47
66
  content: text,
48
67
  hideTooltipOnMouseDown: true
49
- }, /*#__PURE__*/React.createElement(TextWrapper, {
68
+ }, /*#__PURE__*/React.createElement(TextWrapperOldVisualRefresh, {
50
69
  isPlaceholder: isPlaceholder
51
70
  }, !isPlaceholder && /*#__PURE__*/React.createElement("a", {
52
71
  href: href,
@@ -55,8 +74,20 @@ var ExpandedFrameNew = function ExpandedFrameNew(_ref) {
55
74
  }, text)))))
56
75
  );
57
76
  };
77
+ var interactive = isInteractive();
78
+ var showBackgroundAlways = frameStyle === 'show' || isSelected && frameStyle !== 'hide';
79
+ var showBackgroundOnHover = interactive && frameStyle !== 'hide';
58
80
  var renderContent = function renderContent() {
59
- return /*#__PURE__*/React.createElement(Content, {
81
+ if (fg('platform-linking-visual-refresh-v1')) {
82
+ return /*#__PURE__*/React.createElement("div", {
83
+ "data-testid": "embed-content-wrapper",
84
+ // This fixes an issue with input fields in cross domain iframes (ie. databases and jira fields from different domains)
85
+ // See: HOT-107830
86
+ contentEditable: false,
87
+ className: ax([styles.contentStyle, setOverflow && allowScrollBar && styles.contentOverflowAuto, interactive && !showBackgroundAlways && !showBackgroundOnHover && styles.contentInteractiveActiveBorder])
88
+ }, children);
89
+ }
90
+ return /*#__PURE__*/React.createElement(ContentOldVisualRefresh, {
60
91
  "data-testid": "embed-content-wrapper",
61
92
  allowScrollBar: allowScrollBar,
62
93
  removeOverflow: !setOverflow,
@@ -69,8 +100,26 @@ var ExpandedFrameNew = function ExpandedFrameNew(_ref) {
69
100
  suppressContentEditableWarning: true
70
101
  }, children);
71
102
  };
103
+ if (fg('platform-linking-visual-refresh-v1')) {
104
+ return /*#__PURE__*/React.createElement("div", _extends({
105
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
106
+ className: ax([styles.linkWrapper, inheritDimensions && styles.linkWrapperInheritDimensions, isSelected && frameStyle !== 'hide' && styles.linkWrapperSelected, showBackgroundAlways && styles.linkWrapperBorderAndBackground, showBackgroundOnHover && !showBackgroundAlways && styles.linkWrapperInteractiveNotHidden, className]),
107
+ style: {
108
+ minWidth: minWidth ? "".concat(minWidth, "px") : '',
109
+ maxWidth: maxWidth ? "".concat(maxWidth, "px") : ''
110
+ },
111
+ "data-testid": testId,
112
+ "data-trello-do-not-use-override": testId
113
+ // Due to limitations of testing library, we can't assert ::after
114
+ ,
115
+ "data-is-selected": isSelected
116
+ }, (isPlaceholder || !href) && {
117
+ 'data-wrapper-type': 'default',
118
+ 'data-is-interactive': isInteractive()
119
+ }), renderHeader(), renderContent());
120
+ }
72
121
  if (!isPlaceholder && href) {
73
- return /*#__PURE__*/React.createElement(LinkWrapper
122
+ return /*#__PURE__*/React.createElement(LinkWrapperOldVisualRefresh
74
123
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
75
124
  , {
76
125
  className: className,
@@ -87,7 +136,7 @@ var ExpandedFrameNew = function ExpandedFrameNew(_ref) {
87
136
  inheritDimensions: inheritDimensions
88
137
  }, renderHeader(), renderContent());
89
138
  } else {
90
- return /*#__PURE__*/React.createElement(Wrapper
139
+ return /*#__PURE__*/React.createElement(WrapperOldVisualRefresh
91
140
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
92
141
  , {
93
142
  className: className,
@@ -110,4 +159,18 @@ export var ExpandedFrame = function ExpandedFrame(props) {
110
159
  } else {
111
160
  return /*#__PURE__*/React.createElement(ExpandedFrameOld, props);
112
161
  }
162
+ };
163
+ var styles = {
164
+ linkWrapper: "_zulpu2gc _kqswh2mm _1e0c1txw _2lx21bp4 _4t3ik5xz _ca0qu2gc _u5f3u2gc _n3tdu2gc _19bvu2gc _uiztglyw _qc5o94zs _14mj1crf _aetrb3bt _18postnw _15l2idpf _32rxidpf _1x88idpf _19doidpf _1hfk18uv _1bqqidpf _u94kidpf _1ifiidpf",
165
+ linkWrapperInheritDimensions: "_4t3i1osq",
166
+ linkWrapperSelected: "_8x3u92p9",
167
+ linkWrapperBorderAndBackground: "_1tqzzgxb _1hfkhp5a _1ifikb7n",
168
+ linkWrapperInteractiveNotHidden: "_hcgvzgxb _4tpuhp5a _x148kb7n",
169
+ header: "_zulp1b66 _1e0c1txw _4cvr1h6o _4t3igktf _1pbykb7n",
170
+ tooltipWrapper: "_1reo15vq _18m915vq",
171
+ headerAnchor: "_11c81il0 _9oik18uv _1bnxglyw _jf4cnqa1",
172
+ headerIcon: "_1bsb7vkz _4t3i7vkz",
173
+ contentStyle: "_19it1pvm _2rko1y44 _1reo15vq _18m915vq _v56414au _bfhkhp5a _16jlkb7n _4t3i1osq _1pbykb7n",
174
+ contentInteractiveActiveBorder: "_1jhm1ips",
175
+ contentOverflowAuto: "_1reo1wug _18m91wug"
113
176
  };