@atlaskit/smart-card 38.18.0 → 38.20.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 +16 -0
- package/dist/cjs/ssr.js +8 -3
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +2 -1
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.compiled.css +2 -0
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +13 -3
- package/dist/cjs/view/EmbedCard/index.js +4 -2
- package/dist/cjs/view/EmbedCard/views/ResolvedView.js +4 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/ssr.js +8 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +2 -1
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.compiled.css +2 -0
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +13 -3
- package/dist/es2019/view/EmbedCard/index.js +4 -2
- package/dist/es2019/view/EmbedCard/views/ResolvedView.js +4 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/ssr.js +8 -3
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +2 -1
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.compiled.css +2 -0
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +13 -3
- package/dist/esm/view/EmbedCard/index.js +4 -2
- package/dist/esm/view/EmbedCard/views/ResolvedView.js +4 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/EmbedCard/components/ExpandedFrame.d.ts +6 -1
- package/dist/types/view/EmbedCard/types.d.ts +4 -0
- package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +5 -0
- package/dist/types-ts4.5/view/EmbedCard/components/ExpandedFrame.d.ts +6 -1
- package/dist/types-ts4.5/view/EmbedCard/types.d.ts +4 -0
- package/dist/types-ts4.5/view/EmbedCard/views/ResolvedView.d.ts +5 -0
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 38.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#175651](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/175651)
|
|
8
|
+
[`ac94e060dd41f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ac94e060dd41f) -
|
|
9
|
+
[ux] updated error handling of CardSSR component to use fallback component
|
|
10
|
+
|
|
11
|
+
## 38.19.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#177020](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/177020)
|
|
16
|
+
[`206ae7b37b4af`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/206ae7b37b4af) -
|
|
17
|
+
[ux] Add Competitor Prompt for Embed Smart Link
|
|
18
|
+
|
|
3
19
|
## 38.18.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/dist/cjs/ssr.js
CHANGED
|
@@ -31,11 +31,16 @@ var CardSSR = exports.CardSSR = function CardSSR(props) {
|
|
|
31
31
|
var cardProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
32
32
|
id: id
|
|
33
33
|
});
|
|
34
|
+
var ErrorFallbackComponent = cardProps.fallbackComponent;
|
|
35
|
+
var errorBoundaryFallbackComponent = function errorBoundaryFallbackComponent() {
|
|
36
|
+
if (ErrorFallbackComponent) {
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(ErrorFallbackComponent, null);
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_LoadingCardLink.LoadingCardLink, cardProps);
|
|
40
|
+
};
|
|
34
41
|
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
35
42
|
data: _analytics.context
|
|
36
43
|
}, /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, {
|
|
37
|
-
FallbackComponent:
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(_LoadingCardLink.LoadingCardLink, cardProps);
|
|
39
|
-
}
|
|
44
|
+
FallbackComponent: errorBoundaryFallbackComponent
|
|
40
45
|
}, /*#__PURE__*/_react.default.createElement(_component.CardWithUrlContent, cardProps)));
|
|
41
46
|
};
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "38.
|
|
14
|
+
packageVersion: "38.19.0"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
._18postnw:after{position:absolute}
|
|
16
16
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
17
17
|
._19doidpf:after{left:0}
|
|
18
|
+
._1bah1yb4{justify-content:space-between}
|
|
18
19
|
._1bqqidpf:after{z-index:0}
|
|
19
20
|
._1bsb7vkz{width:1pc}
|
|
20
21
|
._1bto1l2s{text-overflow:ellipsis}
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
._1pbykb7n{z-index:1}
|
|
28
29
|
._1reo15vq{overflow-x:hidden}
|
|
29
30
|
._1reo1wug{overflow-x:auto}
|
|
31
|
+
._1ul9idpf{min-width:0}
|
|
30
32
|
._1x88idpf:after{bottom:0}
|
|
31
33
|
._2lx21bp4{flex-direction:column}
|
|
32
34
|
._32rxidpf:after{right:0}
|
|
@@ -36,7 +36,8 @@ var ExpandedFrame = exports.ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
36
36
|
_ref$allowScrollBar = _ref.allowScrollBar,
|
|
37
37
|
allowScrollBar = _ref$allowScrollBar === void 0 ? false : _ref$allowScrollBar,
|
|
38
38
|
_ref$setOverflow = _ref.setOverflow,
|
|
39
|
-
setOverflow = _ref$setOverflow === void 0 ? true : _ref$setOverflow
|
|
39
|
+
setOverflow = _ref$setOverflow === void 0 ? true : _ref$setOverflow,
|
|
40
|
+
CompetitorPrompt = _ref.CompetitorPrompt;
|
|
40
41
|
var isInteractive = function isInteractive() {
|
|
41
42
|
return !isPlaceholder && (Boolean(href) || Boolean(onClick));
|
|
42
43
|
};
|
|
@@ -44,10 +45,18 @@ var ExpandedFrame = exports.ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
44
45
|
return (0, _utils.handleClickCommon)(event, onClick);
|
|
45
46
|
};
|
|
46
47
|
var handleMouseDown = (0, _useLinkClicked.useMouseDownEvent)();
|
|
48
|
+
|
|
49
|
+
// Note: cleanup fg based on results of prompt_whiteboard_competitor_link experiment
|
|
50
|
+
var CompetitorPromptComponent = CompetitorPrompt && href && (0, _platformFeatureFlags.fg)('prompt_whiteboard_competitor_link_gate') ? /*#__PURE__*/React.createElement(CompetitorPrompt, {
|
|
51
|
+
sourceUrl: href,
|
|
52
|
+
linkType: "embed"
|
|
53
|
+
}) : null;
|
|
47
54
|
var renderHeader = function renderHeader() {
|
|
48
55
|
if ((0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1')) {
|
|
49
56
|
return frameStyle !== 'hide' && /*#__PURE__*/React.createElement("div", {
|
|
50
57
|
className: (0, _runtime.ax)([styles.header, "embed-header"])
|
|
58
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: (0, _runtime.ax)([styles.leftSection])
|
|
51
60
|
}, /*#__PURE__*/React.createElement("div", {
|
|
52
61
|
className: (0, _runtime.ax)([styles.headerIcon])
|
|
53
62
|
}, icon), /*#__PURE__*/React.createElement("div", {
|
|
@@ -60,7 +69,7 @@ var ExpandedFrame = exports.ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
60
69
|
onClick: handleClick,
|
|
61
70
|
onMouseDown: handleMouseDown,
|
|
62
71
|
className: (0, _runtime.ax)([styles.headerAnchor])
|
|
63
|
-
}, text))));
|
|
72
|
+
}, text)))), CompetitorPromptComponent);
|
|
64
73
|
}
|
|
65
74
|
return (
|
|
66
75
|
/*#__PURE__*/
|
|
@@ -170,7 +179,8 @@ var styles = {
|
|
|
170
179
|
linkWrapperSelected: "_8x3u92p9",
|
|
171
180
|
linkWrapperBorderAndBackground: "_1tqzzgxb _1hfkhp5a _1ifikb7n",
|
|
172
181
|
linkWrapperInteractiveNotHidden: "_hcgvzgxb _4tpuhp5a _x148kb7n",
|
|
173
|
-
header: "_11c8140y _zulp1b66 _1e0c1txw _4cvr1h6o _4t3igktf _1pbykb7n",
|
|
182
|
+
header: "_11c8140y _zulp1b66 _1e0c1txw _4cvr1h6o _1bah1yb4 _4t3igktf _1pbykb7n",
|
|
183
|
+
leftSection: "_zulp1b66 _1e0c1txw _4cvr1h6o _1ul9idpf",
|
|
174
184
|
tooltipWrapper: "_1reo15vq _18m915vq",
|
|
175
185
|
headerAnchor: "_11c8140y _1reo15vq _18m915vq _1e0c1ule _1bto1l2s _o5721q9c _9oik1r31 _1bnxglyw _jf4cnqa1",
|
|
176
186
|
headerIcon: "_11c8140y _1bsb7vkz _4t3i7vkz",
|
|
@@ -41,7 +41,8 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
41
41
|
onIframeFocus = _ref.onIframeFocus,
|
|
42
42
|
iframeUrlType = _ref.iframeUrlType,
|
|
43
43
|
actionOptions = _ref.actionOptions,
|
|
44
|
-
renderers = _ref.renderers
|
|
44
|
+
renderers = _ref.renderers,
|
|
45
|
+
CompetitorPrompt = _ref.CompetitorPrompt;
|
|
45
46
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
46
47
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
47
48
|
var status = cardState.status,
|
|
@@ -100,7 +101,8 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
100
101
|
ref: iframeRef,
|
|
101
102
|
onIframeDwell: onIframeDwell,
|
|
102
103
|
onIframeFocus: onIframeFocus,
|
|
103
|
-
testId: testId
|
|
104
|
+
testId: testId,
|
|
105
|
+
CompetitorPrompt: CompetitorPrompt
|
|
104
106
|
}));
|
|
105
107
|
} else {
|
|
106
108
|
if (platform === 'mobile') {
|
|
@@ -29,7 +29,8 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.
|
|
|
29
29
|
onIframeDwell = _ref.onIframeDwell,
|
|
30
30
|
onIframeFocus = _ref.onIframeFocus,
|
|
31
31
|
isSupportTheming = _ref.isSupportTheming,
|
|
32
|
-
type = _ref.type
|
|
32
|
+
type = _ref.type,
|
|
33
|
+
CompetitorPrompt = _ref.CompetitorPrompt;
|
|
33
34
|
var iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
|
|
34
35
|
var src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
|
|
35
36
|
var text = title || (context === null || context === void 0 ? void 0 : context.text);
|
|
@@ -67,7 +68,8 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.
|
|
|
67
68
|
text: text,
|
|
68
69
|
onClick: onClick,
|
|
69
70
|
inheritDimensions: inheritDimensions,
|
|
70
|
-
setOverflow: false
|
|
71
|
+
setOverflow: false,
|
|
72
|
+
CompetitorPrompt: CompetitorPrompt
|
|
71
73
|
}, /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
|
|
72
74
|
url: previewUrl,
|
|
73
75
|
isTrusted: isTrusted,
|
|
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
20
20
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
21
21
|
var PACKAGE_DATA = {
|
|
22
22
|
packageName: "@atlaskit/smart-card",
|
|
23
|
-
packageVersion: "38.
|
|
23
|
+
packageVersion: "38.19.0",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
package/dist/es2019/ssr.js
CHANGED
|
@@ -17,9 +17,16 @@ export const CardSSR = props => {
|
|
|
17
17
|
...props,
|
|
18
18
|
id
|
|
19
19
|
};
|
|
20
|
+
const ErrorFallbackComponent = cardProps.fallbackComponent;
|
|
21
|
+
const errorBoundaryFallbackComponent = () => {
|
|
22
|
+
if (ErrorFallbackComponent) {
|
|
23
|
+
return /*#__PURE__*/React.createElement(ErrorFallbackComponent, null);
|
|
24
|
+
}
|
|
25
|
+
return /*#__PURE__*/React.createElement(LoadingCardLink, cardProps);
|
|
26
|
+
};
|
|
20
27
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
21
28
|
data: context
|
|
22
29
|
}, /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
23
|
-
FallbackComponent:
|
|
30
|
+
FallbackComponent: errorBoundaryFallbackComponent
|
|
24
31
|
}, /*#__PURE__*/React.createElement(CardWithUrlContent, cardProps)));
|
|
25
32
|
};
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "38.
|
|
5
|
+
packageVersion: "38.19.0"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
._18postnw:after{position:absolute}
|
|
16
16
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
17
17
|
._19doidpf:after{left:0}
|
|
18
|
+
._1bah1yb4{justify-content:space-between}
|
|
18
19
|
._1bqqidpf:after{z-index:0}
|
|
19
20
|
._1bsb7vkz{width:1pc}
|
|
20
21
|
._1bto1l2s{text-overflow:ellipsis}
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
._1pbykb7n{z-index:1}
|
|
28
29
|
._1reo15vq{overflow-x:hidden}
|
|
29
30
|
._1reo1wug{overflow-x:auto}
|
|
31
|
+
._1ul9idpf{min-width:0}
|
|
30
32
|
._1x88idpf:after{bottom:0}
|
|
31
33
|
._2lx21bp4{flex-direction:column}
|
|
32
34
|
._32rxidpf:after{right:0}
|
|
@@ -22,15 +22,24 @@ export const ExpandedFrame = ({
|
|
|
22
22
|
testId = 'expanded-frame',
|
|
23
23
|
inheritDimensions,
|
|
24
24
|
allowScrollBar = false,
|
|
25
|
-
setOverflow = true
|
|
25
|
+
setOverflow = true,
|
|
26
|
+
CompetitorPrompt
|
|
26
27
|
}) => {
|
|
27
28
|
const isInteractive = () => !isPlaceholder && (Boolean(href) || Boolean(onClick));
|
|
28
29
|
const handleClick = event => handleClickCommon(event, onClick);
|
|
29
30
|
const handleMouseDown = useMouseDownEvent();
|
|
31
|
+
|
|
32
|
+
// Note: cleanup fg based on results of prompt_whiteboard_competitor_link experiment
|
|
33
|
+
const CompetitorPromptComponent = CompetitorPrompt && href && fg('prompt_whiteboard_competitor_link_gate') ? /*#__PURE__*/React.createElement(CompetitorPrompt, {
|
|
34
|
+
sourceUrl: href,
|
|
35
|
+
linkType: "embed"
|
|
36
|
+
}) : null;
|
|
30
37
|
const renderHeader = () => {
|
|
31
38
|
if (fg('platform-linking-visual-refresh-v1')) {
|
|
32
39
|
return frameStyle !== 'hide' && /*#__PURE__*/React.createElement("div", {
|
|
33
40
|
className: ax([styles.header, "embed-header"])
|
|
41
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: ax([styles.leftSection])
|
|
34
43
|
}, /*#__PURE__*/React.createElement("div", {
|
|
35
44
|
className: ax([styles.headerIcon])
|
|
36
45
|
}, icon), /*#__PURE__*/React.createElement("div", {
|
|
@@ -43,7 +52,7 @@ export const ExpandedFrame = ({
|
|
|
43
52
|
onClick: handleClick,
|
|
44
53
|
onMouseDown: handleMouseDown,
|
|
45
54
|
className: ax([styles.headerAnchor])
|
|
46
|
-
}, text))));
|
|
55
|
+
}, text)))), CompetitorPromptComponent);
|
|
47
56
|
}
|
|
48
57
|
return (
|
|
49
58
|
/*#__PURE__*/
|
|
@@ -153,7 +162,8 @@ const styles = {
|
|
|
153
162
|
linkWrapperSelected: "_8x3u92p9",
|
|
154
163
|
linkWrapperBorderAndBackground: "_1tqzzgxb _1hfkhp5a _1ifikb7n",
|
|
155
164
|
linkWrapperInteractiveNotHidden: "_hcgvzgxb _4tpuhp5a _x148kb7n",
|
|
156
|
-
header: "_11c8140y _zulp1b66 _1e0c1txw _4cvr1h6o _4t3igktf _1pbykb7n",
|
|
165
|
+
header: "_11c8140y _zulp1b66 _1e0c1txw _4cvr1h6o _1bah1yb4 _4t3igktf _1pbykb7n",
|
|
166
|
+
leftSection: "_zulp1b66 _1e0c1txw _4cvr1h6o _1ul9idpf",
|
|
157
167
|
tooltipWrapper: "_1reo15vq _18m915vq",
|
|
158
168
|
headerAnchor: "_11c8140y _1reo15vq _18m915vq _1e0c1ule _1bto1l2s _o5721q9c _9oik1r31 _1bnxglyw _jf4cnqa1",
|
|
159
169
|
headerIcon: "_11c8140y _1bsb7vkz _4t3i7vkz",
|
|
@@ -33,7 +33,8 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
33
33
|
onIframeFocus,
|
|
34
34
|
iframeUrlType,
|
|
35
35
|
actionOptions,
|
|
36
|
-
renderers
|
|
36
|
+
renderers,
|
|
37
|
+
CompetitorPrompt
|
|
37
38
|
}, iframeRef) => {
|
|
38
39
|
var _details$meta, _forbiddenViewProps$c, _forbiddenViewProps$c2, _notFoundViewProps$co, _notFoundViewProps$co2;
|
|
39
40
|
const {
|
|
@@ -97,7 +98,8 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
97
98
|
ref: iframeRef,
|
|
98
99
|
onIframeDwell: onIframeDwell,
|
|
99
100
|
onIframeFocus: onIframeFocus,
|
|
100
|
-
testId: testId
|
|
101
|
+
testId: testId,
|
|
102
|
+
CompetitorPrompt: CompetitorPrompt
|
|
101
103
|
}));
|
|
102
104
|
} else {
|
|
103
105
|
if (platform === 'mobile') {
|
|
@@ -21,7 +21,8 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
|
|
|
21
21
|
onIframeDwell,
|
|
22
22
|
onIframeFocus,
|
|
23
23
|
isSupportTheming,
|
|
24
|
-
type
|
|
24
|
+
type,
|
|
25
|
+
CompetitorPrompt
|
|
25
26
|
}, embedIframeRef) => {
|
|
26
27
|
const iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
|
|
27
28
|
const src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
|
|
@@ -58,7 +59,8 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
|
|
|
58
59
|
text: text,
|
|
59
60
|
onClick: onClick,
|
|
60
61
|
inheritDimensions: inheritDimensions,
|
|
61
|
-
setOverflow: false
|
|
62
|
+
setOverflow: false,
|
|
63
|
+
CompetitorPrompt: CompetitorPrompt
|
|
62
64
|
}, /*#__PURE__*/React.createElement(Frame, {
|
|
63
65
|
url: previewUrl,
|
|
64
66
|
isTrusted: isTrusted,
|
|
@@ -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: "38.
|
|
13
|
+
packageVersion: "38.19.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
const Anchor = withLinkClickedEvent('a');
|
package/dist/esm/ssr.js
CHANGED
|
@@ -22,11 +22,16 @@ export var CardSSR = function CardSSR(props) {
|
|
|
22
22
|
var cardProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
23
23
|
id: id
|
|
24
24
|
});
|
|
25
|
+
var ErrorFallbackComponent = cardProps.fallbackComponent;
|
|
26
|
+
var errorBoundaryFallbackComponent = function errorBoundaryFallbackComponent() {
|
|
27
|
+
if (ErrorFallbackComponent) {
|
|
28
|
+
return /*#__PURE__*/React.createElement(ErrorFallbackComponent, null);
|
|
29
|
+
}
|
|
30
|
+
return /*#__PURE__*/React.createElement(LoadingCardLink, cardProps);
|
|
31
|
+
};
|
|
25
32
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
26
33
|
data: context
|
|
27
34
|
}, /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
28
|
-
FallbackComponent:
|
|
29
|
-
return /*#__PURE__*/React.createElement(LoadingCardLink, cardProps);
|
|
30
|
-
}
|
|
35
|
+
FallbackComponent: errorBoundaryFallbackComponent
|
|
31
36
|
}, /*#__PURE__*/React.createElement(CardWithUrlContent, cardProps)));
|
|
32
37
|
};
|
|
@@ -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: "38.
|
|
7
|
+
packageVersion: "38.19.0"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
._18postnw:after{position:absolute}
|
|
16
16
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
17
17
|
._19doidpf:after{left:0}
|
|
18
|
+
._1bah1yb4{justify-content:space-between}
|
|
18
19
|
._1bqqidpf:after{z-index:0}
|
|
19
20
|
._1bsb7vkz{width:1pc}
|
|
20
21
|
._1bto1l2s{text-overflow:ellipsis}
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
._1pbykb7n{z-index:1}
|
|
28
29
|
._1reo15vq{overflow-x:hidden}
|
|
29
30
|
._1reo1wug{overflow-x:auto}
|
|
31
|
+
._1ul9idpf{min-width:0}
|
|
30
32
|
._1x88idpf:after{bottom:0}
|
|
31
33
|
._2lx21bp4{flex-direction:column}
|
|
32
34
|
._32rxidpf:after{right:0}
|
|
@@ -27,7 +27,8 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
27
27
|
_ref$allowScrollBar = _ref.allowScrollBar,
|
|
28
28
|
allowScrollBar = _ref$allowScrollBar === void 0 ? false : _ref$allowScrollBar,
|
|
29
29
|
_ref$setOverflow = _ref.setOverflow,
|
|
30
|
-
setOverflow = _ref$setOverflow === void 0 ? true : _ref$setOverflow
|
|
30
|
+
setOverflow = _ref$setOverflow === void 0 ? true : _ref$setOverflow,
|
|
31
|
+
CompetitorPrompt = _ref.CompetitorPrompt;
|
|
31
32
|
var isInteractive = function isInteractive() {
|
|
32
33
|
return !isPlaceholder && (Boolean(href) || Boolean(onClick));
|
|
33
34
|
};
|
|
@@ -35,10 +36,18 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
35
36
|
return handleClickCommon(event, onClick);
|
|
36
37
|
};
|
|
37
38
|
var handleMouseDown = useMouseDownEvent();
|
|
39
|
+
|
|
40
|
+
// Note: cleanup fg based on results of prompt_whiteboard_competitor_link experiment
|
|
41
|
+
var CompetitorPromptComponent = CompetitorPrompt && href && fg('prompt_whiteboard_competitor_link_gate') ? /*#__PURE__*/React.createElement(CompetitorPrompt, {
|
|
42
|
+
sourceUrl: href,
|
|
43
|
+
linkType: "embed"
|
|
44
|
+
}) : null;
|
|
38
45
|
var renderHeader = function renderHeader() {
|
|
39
46
|
if (fg('platform-linking-visual-refresh-v1')) {
|
|
40
47
|
return frameStyle !== 'hide' && /*#__PURE__*/React.createElement("div", {
|
|
41
48
|
className: ax([styles.header, "embed-header"])
|
|
49
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: ax([styles.leftSection])
|
|
42
51
|
}, /*#__PURE__*/React.createElement("div", {
|
|
43
52
|
className: ax([styles.headerIcon])
|
|
44
53
|
}, icon), /*#__PURE__*/React.createElement("div", {
|
|
@@ -51,7 +60,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
51
60
|
onClick: handleClick,
|
|
52
61
|
onMouseDown: handleMouseDown,
|
|
53
62
|
className: ax([styles.headerAnchor])
|
|
54
|
-
}, text))));
|
|
63
|
+
}, text)))), CompetitorPromptComponent);
|
|
55
64
|
}
|
|
56
65
|
return (
|
|
57
66
|
/*#__PURE__*/
|
|
@@ -161,7 +170,8 @@ var styles = {
|
|
|
161
170
|
linkWrapperSelected: "_8x3u92p9",
|
|
162
171
|
linkWrapperBorderAndBackground: "_1tqzzgxb _1hfkhp5a _1ifikb7n",
|
|
163
172
|
linkWrapperInteractiveNotHidden: "_hcgvzgxb _4tpuhp5a _x148kb7n",
|
|
164
|
-
header: "_11c8140y _zulp1b66 _1e0c1txw _4cvr1h6o _4t3igktf _1pbykb7n",
|
|
173
|
+
header: "_11c8140y _zulp1b66 _1e0c1txw _4cvr1h6o _1bah1yb4 _4t3igktf _1pbykb7n",
|
|
174
|
+
leftSection: "_zulp1b66 _1e0c1txw _4cvr1h6o _1ul9idpf",
|
|
165
175
|
tooltipWrapper: "_1reo15vq _18m915vq",
|
|
166
176
|
headerAnchor: "_11c8140y _1reo15vq _18m915vq _1e0c1ule _1bto1l2s _o5721q9c _9oik1r31 _1bnxglyw _jf4cnqa1",
|
|
167
177
|
headerIcon: "_11c8140y _1bsb7vkz _4t3i7vkz",
|
|
@@ -34,7 +34,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
34
34
|
onIframeFocus = _ref.onIframeFocus,
|
|
35
35
|
iframeUrlType = _ref.iframeUrlType,
|
|
36
36
|
actionOptions = _ref.actionOptions,
|
|
37
|
-
renderers = _ref.renderers
|
|
37
|
+
renderers = _ref.renderers,
|
|
38
|
+
CompetitorPrompt = _ref.CompetitorPrompt;
|
|
38
39
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
39
40
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
40
41
|
var status = cardState.status,
|
|
@@ -93,7 +94,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
93
94
|
ref: iframeRef,
|
|
94
95
|
onIframeDwell: onIframeDwell,
|
|
95
96
|
onIframeFocus: onIframeFocus,
|
|
96
|
-
testId: testId
|
|
97
|
+
testId: testId,
|
|
98
|
+
CompetitorPrompt: CompetitorPrompt
|
|
97
99
|
}));
|
|
98
100
|
} else {
|
|
99
101
|
if (platform === 'mobile') {
|
|
@@ -22,7 +22,8 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
|
|
|
22
22
|
onIframeDwell = _ref.onIframeDwell,
|
|
23
23
|
onIframeFocus = _ref.onIframeFocus,
|
|
24
24
|
isSupportTheming = _ref.isSupportTheming,
|
|
25
|
-
type = _ref.type
|
|
25
|
+
type = _ref.type,
|
|
26
|
+
CompetitorPrompt = _ref.CompetitorPrompt;
|
|
26
27
|
var iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
|
|
27
28
|
var src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
|
|
28
29
|
var text = title || (context === null || context === void 0 ? void 0 : context.text);
|
|
@@ -60,7 +61,8 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
|
|
|
60
61
|
text: text,
|
|
61
62
|
onClick: onClick,
|
|
62
63
|
inheritDimensions: inheritDimensions,
|
|
63
|
-
setOverflow: false
|
|
64
|
+
setOverflow: false,
|
|
65
|
+
CompetitorPrompt: CompetitorPrompt
|
|
64
66
|
}, /*#__PURE__*/React.createElement(Frame, {
|
|
65
67
|
url: previewUrl,
|
|
66
68
|
isTrusted: isTrusted,
|
|
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
13
13
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
14
14
|
var PACKAGE_DATA = {
|
|
15
15
|
packageName: "@atlaskit/smart-card",
|
|
16
|
-
packageVersion: "38.
|
|
16
|
+
packageVersion: "38.19.0",
|
|
17
17
|
componentName: 'linkUrl'
|
|
18
18
|
};
|
|
19
19
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -36,5 +36,10 @@ export interface ExpandedFrameProps {
|
|
|
36
36
|
* @default true
|
|
37
37
|
*/
|
|
38
38
|
setOverflow?: boolean;
|
|
39
|
+
/** Component to prompt for competitor link */
|
|
40
|
+
CompetitorPrompt?: React.ComponentType<{
|
|
41
|
+
sourceUrl: string;
|
|
42
|
+
linkType?: string;
|
|
43
|
+
}>;
|
|
39
44
|
}
|
|
40
|
-
export declare const ExpandedFrame: ({ isPlaceholder, children, onClick, icon, text, isSelected, frameStyle, href, minWidth, maxWidth, testId, inheritDimensions, allowScrollBar, setOverflow, }: ExpandedFrameProps) => JSX.Element;
|
|
45
|
+
export declare const ExpandedFrame: ({ isPlaceholder, children, onClick, icon, text, isSelected, frameStyle, href, minWidth, maxWidth, testId, inheritDimensions, allowScrollBar, setOverflow, CompetitorPrompt, }: ExpandedFrameProps) => JSX.Element;
|
|
@@ -24,6 +24,10 @@ export type EmbedCardProps = {
|
|
|
24
24
|
onIframeFocus?: () => void;
|
|
25
25
|
iframeUrlType?: EmbedIframeUrlType;
|
|
26
26
|
renderers?: CardProviderRenderers;
|
|
27
|
+
CompetitorPrompt?: React.ComponentType<{
|
|
28
|
+
sourceUrl: string;
|
|
29
|
+
linkType?: string;
|
|
30
|
+
}>;
|
|
27
31
|
};
|
|
28
32
|
export interface WithShowControlMethodProp {
|
|
29
33
|
showControls?: () => void;
|
|
@@ -30,5 +30,10 @@ export interface EmbedCardResolvedViewProps {
|
|
|
30
30
|
onIframeFocus?: () => void;
|
|
31
31
|
/** Type of the object */
|
|
32
32
|
type?: string[];
|
|
33
|
+
/** Component to prompt for competitor link */
|
|
34
|
+
CompetitorPrompt?: React.ComponentType<{
|
|
35
|
+
sourceUrl: string;
|
|
36
|
+
linkType?: string;
|
|
37
|
+
}>;
|
|
33
38
|
}
|
|
34
39
|
export declare const EmbedCardResolvedView: React.ForwardRefExoticComponent<EmbedCardResolvedViewProps & React.RefAttributes<HTMLIFrameElement>>;
|
|
@@ -36,5 +36,10 @@ export interface ExpandedFrameProps {
|
|
|
36
36
|
* @default true
|
|
37
37
|
*/
|
|
38
38
|
setOverflow?: boolean;
|
|
39
|
+
/** Component to prompt for competitor link */
|
|
40
|
+
CompetitorPrompt?: React.ComponentType<{
|
|
41
|
+
sourceUrl: string;
|
|
42
|
+
linkType?: string;
|
|
43
|
+
}>;
|
|
39
44
|
}
|
|
40
|
-
export declare const ExpandedFrame: ({ isPlaceholder, children, onClick, icon, text, isSelected, frameStyle, href, minWidth, maxWidth, testId, inheritDimensions, allowScrollBar, setOverflow, }: ExpandedFrameProps) => JSX.Element;
|
|
45
|
+
export declare const ExpandedFrame: ({ isPlaceholder, children, onClick, icon, text, isSelected, frameStyle, href, minWidth, maxWidth, testId, inheritDimensions, allowScrollBar, setOverflow, CompetitorPrompt, }: ExpandedFrameProps) => JSX.Element;
|
|
@@ -24,6 +24,10 @@ export type EmbedCardProps = {
|
|
|
24
24
|
onIframeFocus?: () => void;
|
|
25
25
|
iframeUrlType?: EmbedIframeUrlType;
|
|
26
26
|
renderers?: CardProviderRenderers;
|
|
27
|
+
CompetitorPrompt?: React.ComponentType<{
|
|
28
|
+
sourceUrl: string;
|
|
29
|
+
linkType?: string;
|
|
30
|
+
}>;
|
|
27
31
|
};
|
|
28
32
|
export interface WithShowControlMethodProp {
|
|
29
33
|
showControls?: () => void;
|
|
@@ -30,5 +30,10 @@ export interface EmbedCardResolvedViewProps {
|
|
|
30
30
|
onIframeFocus?: () => void;
|
|
31
31
|
/** Type of the object */
|
|
32
32
|
type?: string[];
|
|
33
|
+
/** Component to prompt for competitor link */
|
|
34
|
+
CompetitorPrompt?: React.ComponentType<{
|
|
35
|
+
sourceUrl: string;
|
|
36
|
+
linkType?: string;
|
|
37
|
+
}>;
|
|
33
38
|
}
|
|
34
39
|
export declare const EmbedCardResolvedView: React.ForwardRefExoticComponent<EmbedCardResolvedViewProps & React.RefAttributes<HTMLIFrameElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "38.
|
|
3
|
+
"version": "38.20.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
"team": "Linking Platform",
|
|
21
21
|
"website": {
|
|
22
22
|
"name": "Smart Card"
|
|
23
|
-
}
|
|
24
|
-
"runReact18": true
|
|
23
|
+
}
|
|
25
24
|
},
|
|
26
25
|
"scripts": {
|
|
27
26
|
"analytics:codegen": "yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card --output ./src/common/analytics/generated"
|
|
@@ -54,7 +53,7 @@
|
|
|
54
53
|
"@atlaskit/link-test-helpers": "^8.1.0",
|
|
55
54
|
"@atlaskit/linking-common": "^9.1.0",
|
|
56
55
|
"@atlaskit/linking-types": "^13.0.0",
|
|
57
|
-
"@atlaskit/logo": "^19.
|
|
56
|
+
"@atlaskit/logo": "^19.5.0",
|
|
58
57
|
"@atlaskit/lozenge": "^13.0.0",
|
|
59
58
|
"@atlaskit/menu": "^8.0.0",
|
|
60
59
|
"@atlaskit/modal-dialog": "^14.2.0",
|