@atlaskit/smart-card 26.43.6 → 26.43.7
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 +6 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/index.js +2 -9
- package/dist/cjs/view/EmbedCard/index.js +33 -73
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +4 -7
- package/dist/cjs/view/InlineCard/ErroredView/index.js +1 -2
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +5 -10
- package/dist/cjs/view/InlineCard/index.js +1 -7
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/index.js +2 -9
- package/dist/es2019/view/EmbedCard/index.js +33 -73
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +4 -7
- package/dist/es2019/view/InlineCard/ErroredView/index.js +1 -2
- package/dist/es2019/view/InlineCard/ForbiddenView/index.js +5 -10
- package/dist/es2019/view/InlineCard/index.js +1 -7
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/index.js +2 -9
- package/dist/esm/view/EmbedCard/index.js +33 -73
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +4 -7
- package/dist/esm/view/InlineCard/ErroredView/index.js +1 -2
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +5 -10
- package/dist/esm/view/InlineCard/index.js +1 -7
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/package.json +1 -4
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +0 -84
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundViewOld.js +0 -48
- package/dist/cjs/view/EmbedCard/views/ForbiddenView.js +0 -75
- package/dist/cjs/view/EmbedCard/views/NotFoundView.js +0 -46
- package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +0 -87
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +0 -76
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundViewOld.js +0 -38
- package/dist/es2019/view/EmbedCard/views/ForbiddenView.js +0 -69
- package/dist/es2019/view/EmbedCard/views/NotFoundView.js +0 -39
- package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +0 -77
- package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +0 -75
- package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundViewOld.js +0 -42
- package/dist/esm/view/EmbedCard/views/ForbiddenView.js +0 -68
- package/dist/esm/view/EmbedCard/views/NotFoundView.js +0 -39
- package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +0 -77
- package/dist/types/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.d.ts +0 -8
- package/dist/types/view/BlockCard/views/flexible/FlexibleNotFoundViewOld.d.ts +0 -8
- package/dist/types/view/EmbedCard/views/ForbiddenView.d.ts +0 -17
- package/dist/types/view/EmbedCard/views/NotFoundView.d.ts +0 -15
- package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +0 -20
- package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.d.ts +0 -8
- package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleNotFoundViewOld.d.ts +0 -8
- package/dist/types-ts4.5/view/EmbedCard/views/ForbiddenView.d.ts +0 -17
- package/dist/types-ts4.5/view/EmbedCard/views/NotFoundView.d.ts +0 -15
- package/dist/types-ts4.5/view/EmbedCard/views/UnauthorisedView.d.ts +0 -20
|
@@ -14,7 +14,6 @@ import Lozenge from '@atlaskit/lozenge';
|
|
|
14
14
|
import { LozengeWrapper } from '../IconAndTitleLayout/styled';
|
|
15
15
|
import withFrameStyleControl from '../utils/withFrameStyleControl';
|
|
16
16
|
import { HoverCard } from '../../HoverCard';
|
|
17
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
18
17
|
const FallbackForbiddenIcon = /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(LockIcon, {
|
|
19
18
|
label: "error",
|
|
20
19
|
size: "small",
|
|
@@ -48,13 +47,10 @@ export class InlineCardForbiddenView extends React.Component {
|
|
|
48
47
|
const {
|
|
49
48
|
callToActionMessageKey
|
|
50
49
|
} = this.props.requestAccessContext;
|
|
51
|
-
const values = getBooleanFF('platform.linking-platform.smart-card.cross-join') ? {
|
|
52
|
-
product: this.props.context
|
|
53
|
-
} : {
|
|
54
|
-
context: this.props.context
|
|
55
|
-
};
|
|
56
50
|
return /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[callToActionMessageKey], {
|
|
57
|
-
values:
|
|
51
|
+
values: {
|
|
52
|
+
product: this.props.context
|
|
53
|
+
}
|
|
58
54
|
}));
|
|
59
55
|
}
|
|
60
56
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.invalid_permissions, formattedMessage => {
|
|
@@ -68,7 +64,6 @@ export class InlineCardForbiddenView extends React.Component {
|
|
|
68
64
|
} = this.props;
|
|
69
65
|
const ActionButton = withFrameStyleControl(Button, this.frameRef);
|
|
70
66
|
const accessType = (_this$props$requestAc2 = this.props.requestAccessContext) === null || _this$props$requestAc2 === void 0 ? void 0 : _this$props$requestAc2.accessType;
|
|
71
|
-
const isButtonDisabled = getBooleanFF('platform.linking-platform.smart-card.cross-join') && accessType === 'PENDING_REQUEST_EXISTS';
|
|
72
67
|
if (this.state.hasRequestAccessContextMessage) {
|
|
73
68
|
return /*#__PURE__*/React.createElement(ActionButton, {
|
|
74
69
|
spacing: "none",
|
|
@@ -76,7 +71,7 @@ export class InlineCardForbiddenView extends React.Component {
|
|
|
76
71
|
component: IconStyledButton,
|
|
77
72
|
testId: "button-connect-other-account",
|
|
78
73
|
role: "button",
|
|
79
|
-
isDisabled:
|
|
74
|
+
isDisabled: accessType === 'PENDING_REQUEST_EXISTS'
|
|
80
75
|
}, this.renderForbiddenAccessMessage());
|
|
81
76
|
}
|
|
82
77
|
if (onAuthorise) {
|
|
@@ -112,7 +107,7 @@ export class InlineCardForbiddenView extends React.Component {
|
|
|
112
107
|
onClick: onClick,
|
|
113
108
|
titleColor: `var(--ds-text-subtle, ${N500})`
|
|
114
109
|
}), this.renderActionButton());
|
|
115
|
-
if (this.props.showHoverPreview
|
|
110
|
+
if (this.props.showHoverPreview) {
|
|
116
111
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
117
112
|
url: url
|
|
118
113
|
}, content);
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
3
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
4
4
|
import { extractInlineProps } from '../../extractors/inline';
|
|
5
|
-
import { extractRequestAccessContext } from '../../extractors/common/context';
|
|
6
5
|
import { extractRequestAccessContextImproved } from '../../extractors/common/context/extractAccessContext';
|
|
7
6
|
import { CardLinkView } from '../LinkView';
|
|
8
7
|
import { InlineCardErroredView } from './ErroredView';
|
|
@@ -13,7 +12,6 @@ import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
|
13
12
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
14
13
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
15
14
|
import { getExtensionKey } from '../../state/helpers';
|
|
16
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
17
15
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
18
16
|
import { SmartLinkStatus } from '../../constants';
|
|
19
17
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView };
|
|
@@ -112,15 +110,11 @@ export const InlineCard = ({
|
|
|
112
110
|
case 'forbidden':
|
|
113
111
|
const providerForbidden = extractProvider(cardDetails);
|
|
114
112
|
const cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : getForbiddenJsonLd().meta;
|
|
115
|
-
const requestAccessContext =
|
|
113
|
+
const requestAccessContext = extractRequestAccessContextImproved({
|
|
116
114
|
jsonLd: cardMetadata,
|
|
117
115
|
url,
|
|
118
116
|
product: (_providerForbidden$te = providerForbidden === null || providerForbidden === void 0 ? void 0 : providerForbidden.text) !== null && _providerForbidden$te !== void 0 ? _providerForbidden$te : '',
|
|
119
117
|
createAnalyticsEvent
|
|
120
|
-
}) : extractRequestAccessContext({
|
|
121
|
-
jsonLd: cardMetadata,
|
|
122
|
-
url,
|
|
123
|
-
context: providerForbidden === null || providerForbidden === void 0 ? void 0 : providerForbidden.text
|
|
124
118
|
});
|
|
125
119
|
return /*#__PURE__*/React.createElement(InlineCardForbiddenView, {
|
|
126
120
|
url: url,
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "26.43.
|
|
10
|
+
packageVersion: "26.43.7",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.43.
|
|
18
|
+
packageVersion: "26.43.7"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -17,13 +17,10 @@ import { ErroredView as BlockCardErroredView } from './views/ErroredView';
|
|
|
17
17
|
import FlexibleResolvedView from './views/flexible/FlexibleResolvedView';
|
|
18
18
|
import FlexibleUnauthorisedView from './views/flexible/FlexibleUnauthorisedView';
|
|
19
19
|
import FlexibleNotFoundView from './views/flexible/FlexibleNotFoundView';
|
|
20
|
-
import FlexibleNotFoundViewOld from './views/flexible/FlexibleNotFoundViewOld';
|
|
21
20
|
import FlexibleForbiddenView from './views/flexible/FlexibleForbiddenView';
|
|
22
|
-
import FlexibleForbiddenViewOld from './views/flexible/FlexibleForbiddenViewOld';
|
|
23
21
|
import FlexibleErroredView from './views/flexible/FlexibleErroredView';
|
|
24
22
|
import { jsx } from '@emotion/react';
|
|
25
23
|
import { handleClickCommon } from './utils/handlers';
|
|
26
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
27
24
|
export { default as PreviewAction } from './actions/PreviewAction';
|
|
28
25
|
export { ForbiddenAction, AuthorizeAction, BlockCardResolvedView, BlockCardResolvingView, BlockCardUnauthorisedView, BlockCardForbiddenView, BlockCardErroredView, BlockCardNotFoundView };
|
|
29
26
|
export var BlockCard = function BlockCard(_ref) {
|
|
@@ -85,15 +82,11 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
85
82
|
onAuthorize: handleAuthorize
|
|
86
83
|
}));
|
|
87
84
|
case 'forbidden':
|
|
88
|
-
return
|
|
89
|
-
onAuthorize: handleAuthorize
|
|
90
|
-
})) : jsx(FlexibleForbiddenViewOld, _extends({}, flexibleBlockCardProps, {
|
|
85
|
+
return jsx(FlexibleForbiddenView, _extends({}, flexibleBlockCardProps, {
|
|
91
86
|
onAuthorize: handleAuthorize
|
|
92
87
|
}));
|
|
93
88
|
case 'not_found':
|
|
94
|
-
return
|
|
95
|
-
onAuthorize: handleAuthorize
|
|
96
|
-
})) : jsx(FlexibleNotFoundViewOld, _extends({}, flexibleBlockCardProps, {
|
|
89
|
+
return jsx(FlexibleNotFoundView, _extends({}, flexibleBlockCardProps, {
|
|
97
90
|
onAuthorize: handleAuthorize
|
|
98
91
|
}));
|
|
99
92
|
case 'fallback':
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { extractRequestAccessContextImproved } from '../../extractors/common/context/extractAccessContext';
|
|
5
4
|
import { extractEmbedProps } from '../../extractors/embed';
|
|
6
5
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
7
6
|
import { extractInlineProps } from '../../extractors/inline';
|
|
8
7
|
import { extractBlockProps } from '../../extractors/block';
|
|
9
8
|
import { getExtensionKey, hasAuthScopeOverrides } from '../../state/helpers';
|
|
10
|
-
import { extractRequestAccessContext } from '../../extractors/common/context';
|
|
11
9
|
import { BlockCardResolvedView, BlockCardResolvingView } from '../BlockCard';
|
|
12
10
|
import { InlineCardResolvedView } from '../InlineCard/ResolvedView';
|
|
13
|
-
import { EmbedCardForbiddenView } from './views/ForbiddenView';
|
|
14
|
-
import { EmbedCardNotFoundView } from './views/NotFoundView';
|
|
15
11
|
import { EmbedCardResolvedView } from './views/ResolvedView';
|
|
16
|
-
import { EmbedCardUnauthorisedView } from './views/UnauthorisedView';
|
|
17
12
|
import { EmbedCardErroredView } from './views/ErroredView';
|
|
18
13
|
import ForbiddenView from './views/forbidden-view';
|
|
19
14
|
import NotFoundView from './views/not-found-view';
|
|
20
15
|
import UnauthorizedView from './views/unauthorized-view';
|
|
21
16
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
22
17
|
export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
23
|
-
var _details$meta, _forbiddenViewProps$
|
|
18
|
+
var _details$meta, _forbiddenViewProps$c, _forbiddenViewProps$c2, _notFoundViewProps$co, _notFoundViewProps$co2;
|
|
24
19
|
var url = _ref.url,
|
|
25
20
|
_ref$cardState = _ref.cardState,
|
|
26
21
|
status = _ref$cardState.status,
|
|
@@ -108,30 +103,18 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
108
103
|
});
|
|
109
104
|
}
|
|
110
105
|
var unauthorisedViewProps = extractEmbedProps(data, meta, platform);
|
|
111
|
-
|
|
112
|
-
return /*#__PURE__*/React.createElement(UnauthorizedView, {
|
|
113
|
-
analytics: analytics,
|
|
114
|
-
context: unauthorisedViewProps.context,
|
|
115
|
-
extensionKey: extensionKey,
|
|
116
|
-
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
117
|
-
inheritDimensions: inheritDimensions,
|
|
118
|
-
isSelected: isSelected,
|
|
119
|
-
onAuthorize: handleAuthorize,
|
|
120
|
-
onClick: handleFrameClick,
|
|
121
|
-
testId: testId,
|
|
122
|
-
url: unauthorisedViewProps.link
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
return /*#__PURE__*/React.createElement(EmbedCardUnauthorisedView, _extends({}, unauthorisedViewProps, {
|
|
126
|
-
isSelected: isSelected,
|
|
127
|
-
onAuthorise: handleAuthorize,
|
|
128
|
-
inheritDimensions: inheritDimensions,
|
|
129
|
-
onClick: handleFrameClick,
|
|
106
|
+
return /*#__PURE__*/React.createElement(UnauthorizedView, {
|
|
130
107
|
analytics: analytics,
|
|
108
|
+
context: unauthorisedViewProps.context,
|
|
131
109
|
extensionKey: extensionKey,
|
|
132
110
|
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
133
|
-
|
|
134
|
-
|
|
111
|
+
inheritDimensions: inheritDimensions,
|
|
112
|
+
isSelected: isSelected,
|
|
113
|
+
onAuthorize: handleAuthorize,
|
|
114
|
+
onClick: handleFrameClick,
|
|
115
|
+
testId: testId,
|
|
116
|
+
url: unauthorisedViewProps.link
|
|
117
|
+
});
|
|
135
118
|
case 'forbidden':
|
|
136
119
|
if (onError) {
|
|
137
120
|
onError({
|
|
@@ -151,36 +134,21 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
151
134
|
ref: iframeRef
|
|
152
135
|
}));
|
|
153
136
|
}
|
|
154
|
-
|
|
155
|
-
var _forbiddenViewProps$c, _forbiddenViewProps$c2;
|
|
156
|
-
var accessContext = extractRequestAccessContextImproved({
|
|
157
|
-
jsonLd: cardMetadata,
|
|
158
|
-
url: url,
|
|
159
|
-
product: (_forbiddenViewProps$c = (_forbiddenViewProps$c2 = forbiddenViewProps.context) === null || _forbiddenViewProps$c2 === void 0 ? void 0 : _forbiddenViewProps$c2.text) !== null && _forbiddenViewProps$c !== void 0 ? _forbiddenViewProps$c : '',
|
|
160
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
161
|
-
});
|
|
162
|
-
return /*#__PURE__*/React.createElement(ForbiddenView, {
|
|
163
|
-
context: forbiddenViewProps.context,
|
|
164
|
-
inheritDimensions: inheritDimensions,
|
|
165
|
-
isSelected: isSelected,
|
|
166
|
-
onAuthorize: handleAuthorize,
|
|
167
|
-
onClick: handleFrameClick,
|
|
168
|
-
accessContext: accessContext,
|
|
169
|
-
url: forbiddenViewProps.link
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
var requestAccessContext = extractRequestAccessContext({
|
|
137
|
+
var forbiddenAccessContext = extractRequestAccessContextImproved({
|
|
173
138
|
jsonLd: cardMetadata,
|
|
174
139
|
url: url,
|
|
175
|
-
|
|
140
|
+
product: (_forbiddenViewProps$c = (_forbiddenViewProps$c2 = forbiddenViewProps.context) === null || _forbiddenViewProps$c2 === void 0 ? void 0 : _forbiddenViewProps$c2.text) !== null && _forbiddenViewProps$c !== void 0 ? _forbiddenViewProps$c : '',
|
|
141
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
176
142
|
});
|
|
177
|
-
return /*#__PURE__*/React.createElement(
|
|
178
|
-
|
|
179
|
-
onAuthorise: handleAuthorize,
|
|
143
|
+
return /*#__PURE__*/React.createElement(ForbiddenView, {
|
|
144
|
+
context: forbiddenViewProps.context,
|
|
180
145
|
inheritDimensions: inheritDimensions,
|
|
146
|
+
isSelected: isSelected,
|
|
147
|
+
onAuthorize: handleAuthorize,
|
|
181
148
|
onClick: handleFrameClick,
|
|
182
|
-
|
|
183
|
-
|
|
149
|
+
accessContext: forbiddenAccessContext,
|
|
150
|
+
url: forbiddenViewProps.link
|
|
151
|
+
});
|
|
184
152
|
case 'not_found':
|
|
185
153
|
if (onError) {
|
|
186
154
|
onError({
|
|
@@ -189,28 +157,20 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
189
157
|
});
|
|
190
158
|
}
|
|
191
159
|
var notFoundViewProps = extractEmbedProps(data, meta, platform);
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return /*#__PURE__*/React.createElement(NotFoundView, {
|
|
201
|
-
context: notFoundViewProps.context,
|
|
202
|
-
inheritDimensions: inheritDimensions,
|
|
203
|
-
isSelected: isSelected,
|
|
204
|
-
onClick: handleFrameClick,
|
|
205
|
-
accessContext: _accessContext,
|
|
206
|
-
url: notFoundViewProps.link
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
return /*#__PURE__*/React.createElement(EmbedCardNotFoundView, _extends({}, notFoundViewProps, {
|
|
210
|
-
isSelected: isSelected,
|
|
160
|
+
var notFoundAccessContext = details !== null && details !== void 0 && details.meta ? extractRequestAccessContextImproved({
|
|
161
|
+
jsonLd: details === null || details === void 0 ? void 0 : details.meta,
|
|
162
|
+
url: url,
|
|
163
|
+
product: (_notFoundViewProps$co = (_notFoundViewProps$co2 = notFoundViewProps.context) === null || _notFoundViewProps$co2 === void 0 ? void 0 : _notFoundViewProps$co2.text) !== null && _notFoundViewProps$co !== void 0 ? _notFoundViewProps$co : '',
|
|
164
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
165
|
+
}) : undefined;
|
|
166
|
+
return /*#__PURE__*/React.createElement(NotFoundView, {
|
|
167
|
+
context: notFoundViewProps.context,
|
|
211
168
|
inheritDimensions: inheritDimensions,
|
|
212
|
-
|
|
213
|
-
|
|
169
|
+
isSelected: isSelected,
|
|
170
|
+
onClick: handleFrameClick,
|
|
171
|
+
accessContext: notFoundAccessContext,
|
|
172
|
+
url: notFoundViewProps.link
|
|
173
|
+
});
|
|
214
174
|
case 'fallback':
|
|
215
175
|
case 'errored':
|
|
216
176
|
default:
|
|
@@ -20,7 +20,6 @@ import { messages } from '../../../messages';
|
|
|
20
20
|
import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
21
21
|
import { useSmartCardState } from '../../../state/store';
|
|
22
22
|
import HoverCardForbiddenView from './views/forbidden';
|
|
23
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
24
23
|
export var hoverCardClassName = 'smart-links-hover-preview';
|
|
25
24
|
export var getCopyAction = function getCopyAction(url) {
|
|
26
25
|
return {
|
|
@@ -171,12 +170,10 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
171
170
|
url: url
|
|
172
171
|
});
|
|
173
172
|
}
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
});
|
|
179
|
-
}
|
|
173
|
+
if (cardState.status === 'forbidden' || cardState.status === 'not_found') {
|
|
174
|
+
return jsx(HoverCardForbiddenView, {
|
|
175
|
+
flexibleCardProps: flexibleCardProps
|
|
176
|
+
});
|
|
180
177
|
}
|
|
181
178
|
if (cardState.status === 'resolved') {
|
|
182
179
|
return jsx(HoverCardResolvedView, {
|
|
@@ -19,7 +19,6 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
19
19
|
import { IconStyledButton } from '../styled';
|
|
20
20
|
import withFrameStyleControl from '../utils/withFrameStyleControl';
|
|
21
21
|
import { HoverCard } from '../../HoverCard';
|
|
22
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
23
22
|
export var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
|
|
24
23
|
_inherits(InlineCardErroredView, _React$Component);
|
|
25
24
|
var _super = _createSuper(InlineCardErroredView);
|
|
@@ -78,7 +77,7 @@ export var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
|
|
|
78
77
|
onClick: onClick,
|
|
79
78
|
rightSide: message
|
|
80
79
|
}), this.renderActionButton());
|
|
81
|
-
if (this.props.showHoverPreview
|
|
80
|
+
if (this.props.showHoverPreview) {
|
|
82
81
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
83
82
|
url: url
|
|
84
83
|
}, content);
|
|
@@ -22,7 +22,6 @@ import Lozenge from '@atlaskit/lozenge';
|
|
|
22
22
|
import { LozengeWrapper } from '../IconAndTitleLayout/styled';
|
|
23
23
|
import withFrameStyleControl from '../utils/withFrameStyleControl';
|
|
24
24
|
import { HoverCard } from '../../HoverCard';
|
|
25
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
26
25
|
var FallbackForbiddenIcon = /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(LockIcon, {
|
|
27
26
|
label: "error",
|
|
28
27
|
size: "small",
|
|
@@ -59,13 +58,10 @@ export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
|
59
58
|
var _this$props3;
|
|
60
59
|
if ((_this$props3 = _this.props) !== null && _this$props3 !== void 0 && (_this$props3 = _this$props3.requestAccessContext) !== null && _this$props3 !== void 0 && _this$props3.callToActionMessageKey) {
|
|
61
60
|
var callToActionMessageKey = _this.props.requestAccessContext.callToActionMessageKey;
|
|
62
|
-
var values = getBooleanFF('platform.linking-platform.smart-card.cross-join') ? {
|
|
63
|
-
product: _this.props.context
|
|
64
|
-
} : {
|
|
65
|
-
context: _this.props.context
|
|
66
|
-
};
|
|
67
61
|
return /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[callToActionMessageKey], {
|
|
68
|
-
values:
|
|
62
|
+
values: {
|
|
63
|
+
product: _this.props.context
|
|
64
|
+
}
|
|
69
65
|
}));
|
|
70
66
|
}
|
|
71
67
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.invalid_permissions, function (formattedMessage) {
|
|
@@ -77,7 +73,6 @@ export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
|
77
73
|
var onAuthorise = _this.props.onAuthorise;
|
|
78
74
|
var ActionButton = withFrameStyleControl(Button, _this.frameRef);
|
|
79
75
|
var accessType = (_this$props$requestAc = _this.props.requestAccessContext) === null || _this$props$requestAc === void 0 ? void 0 : _this$props$requestAc.accessType;
|
|
80
|
-
var isButtonDisabled = getBooleanFF('platform.linking-platform.smart-card.cross-join') && accessType === 'PENDING_REQUEST_EXISTS';
|
|
81
76
|
if (_this.state.hasRequestAccessContextMessage) {
|
|
82
77
|
return /*#__PURE__*/React.createElement(ActionButton, {
|
|
83
78
|
spacing: "none",
|
|
@@ -85,7 +80,7 @@ export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
|
85
80
|
component: IconStyledButton,
|
|
86
81
|
testId: "button-connect-other-account",
|
|
87
82
|
role: "button",
|
|
88
|
-
isDisabled:
|
|
83
|
+
isDisabled: accessType === 'PENDING_REQUEST_EXISTS'
|
|
89
84
|
}, _this.renderForbiddenAccessMessage());
|
|
90
85
|
}
|
|
91
86
|
if (onAuthorise) {
|
|
@@ -124,7 +119,7 @@ export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
|
124
119
|
onClick: onClick,
|
|
125
120
|
titleColor: "var(--ds-text-subtle, ".concat(N500, ")")
|
|
126
121
|
}), this.renderActionButton());
|
|
127
|
-
if (this.props.showHoverPreview
|
|
122
|
+
if (this.props.showHoverPreview) {
|
|
128
123
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
129
124
|
url: url
|
|
130
125
|
}, content);
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
3
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
4
4
|
import { extractInlineProps } from '../../extractors/inline';
|
|
5
|
-
import { extractRequestAccessContext } from '../../extractors/common/context';
|
|
6
5
|
import { extractRequestAccessContextImproved } from '../../extractors/common/context/extractAccessContext';
|
|
7
6
|
import { CardLinkView } from '../LinkView';
|
|
8
7
|
import { InlineCardErroredView } from './ErroredView';
|
|
@@ -13,7 +12,6 @@ import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
|
13
12
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
14
13
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
15
14
|
import { getExtensionKey } from '../../state/helpers';
|
|
16
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
17
15
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
18
16
|
import { SmartLinkStatus } from '../../constants';
|
|
19
17
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView };
|
|
@@ -108,15 +106,11 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
108
106
|
case 'forbidden':
|
|
109
107
|
var providerForbidden = extractProvider(cardDetails);
|
|
110
108
|
var cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : getForbiddenJsonLd().meta;
|
|
111
|
-
var requestAccessContext =
|
|
109
|
+
var requestAccessContext = extractRequestAccessContextImproved({
|
|
112
110
|
jsonLd: cardMetadata,
|
|
113
111
|
url: url,
|
|
114
112
|
product: (_providerForbidden$te = providerForbidden === null || providerForbidden === void 0 ? void 0 : providerForbidden.text) !== null && _providerForbidden$te !== void 0 ? _providerForbidden$te : '',
|
|
115
113
|
createAnalyticsEvent: createAnalyticsEvent
|
|
116
|
-
}) : extractRequestAccessContext({
|
|
117
|
-
jsonLd: cardMetadata,
|
|
118
|
-
url: url,
|
|
119
|
-
context: providerForbidden === null || providerForbidden === void 0 ? void 0 : providerForbidden.text
|
|
120
114
|
});
|
|
121
115
|
return /*#__PURE__*/React.createElement(InlineCardForbiddenView, {
|
|
122
116
|
url: url,
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.43.
|
|
13
|
+
packageVersion: "26.43.7",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.43.
|
|
3
|
+
"version": "26.43.7",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -144,9 +144,6 @@
|
|
|
144
144
|
"platform.linking-platform.smart-card.iframes-allow-storage-access-by-user-activation": {
|
|
145
145
|
"type": "boolean"
|
|
146
146
|
},
|
|
147
|
-
"platform.linking-platform.smart-card.cross-join": {
|
|
148
|
-
"type": "boolean"
|
|
149
|
-
},
|
|
150
147
|
"platform.linking-platform.smart-card.enable-hover-card-related-urls": {
|
|
151
148
|
"type": "boolean"
|
|
152
149
|
},
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
14
|
-
var _messages = require("../../../../messages");
|
|
15
|
-
var _lockFilled = _interopRequireDefault(require("@atlaskit/icon/glyph/lock-filled"));
|
|
16
|
-
var _ForbiddenAction = require("../../actions/flexible/ForbiddenAction");
|
|
17
|
-
var _text = _interopRequireDefault(require("../../../FlexibleCard/components/elements/text"));
|
|
18
|
-
var _jsonld = require("../../../../utils/jsonld");
|
|
19
|
-
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
20
|
-
var _context = require("../../../../extractors/common/context");
|
|
21
|
-
var _unresolvedView = _interopRequireDefault(require("./unresolved-view"));
|
|
22
|
-
var _withFlexibleUIBlockCardStyle = require("./utils/withFlexibleUIBlockCardStyle");
|
|
23
|
-
var _excluded = ["testId"];
|
|
24
|
-
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); }
|
|
25
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
-
/**
|
|
27
|
-
* @private
|
|
28
|
-
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
|
|
29
|
-
* @deprecated Replaced by FlexibleForbiddenView
|
|
30
|
-
*/
|
|
31
|
-
var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
|
|
32
|
-
var _details$meta;
|
|
33
|
-
var _ref$testId = _ref.testId,
|
|
34
|
-
testId = _ref$testId === void 0 ? 'smart-block-forbidden-view' : _ref$testId,
|
|
35
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
36
|
-
var cardState = props.cardState,
|
|
37
|
-
onAuthorize = props.onAuthorize,
|
|
38
|
-
url = props.url;
|
|
39
|
-
var details = cardState === null || cardState === void 0 ? void 0 : cardState.details;
|
|
40
|
-
var cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : (0, _jsonld.getForbiddenJsonLd)().meta;
|
|
41
|
-
var provider = (0, _linkExtractors.extractProvider)(details === null || details === void 0 ? void 0 : details.data);
|
|
42
|
-
var providerName = (provider === null || provider === void 0 ? void 0 : provider.text) || '';
|
|
43
|
-
var requestAccessContext = (0, _context.extractRequestAccessContext)({
|
|
44
|
-
jsonLd: cardMetadata,
|
|
45
|
-
url: url,
|
|
46
|
-
context: providerName
|
|
47
|
-
});
|
|
48
|
-
var descriptiveMessageKey = requestAccessContext && requestAccessContext.descriptiveMessageKey ? requestAccessContext.descriptiveMessageKey : 'invalid_permissions_description';
|
|
49
|
-
var actions = (0, _react.useMemo)(function () {
|
|
50
|
-
var actionFromAccessContext = [];
|
|
51
|
-
var tryAnotherAccountAction = onAuthorize ? [(0, _ForbiddenAction.ForbiddenAction)(onAuthorize, 'try_another_account')] : [];
|
|
52
|
-
if (requestAccessContext) {
|
|
53
|
-
var action = requestAccessContext.action,
|
|
54
|
-
callToActionMessageKey = requestAccessContext.callToActionMessageKey;
|
|
55
|
-
actionFromAccessContext = action && callToActionMessageKey ? [(0, _ForbiddenAction.ForbiddenAction)(action.promise, callToActionMessageKey, {
|
|
56
|
-
context: providerName
|
|
57
|
-
})] : [];
|
|
58
|
-
}
|
|
59
|
-
return [].concat(tryAnotherAccountAction, (0, _toConsumableArray2.default)(actionFromAccessContext));
|
|
60
|
-
}, [onAuthorize, requestAccessContext, providerName]);
|
|
61
|
-
return /*#__PURE__*/_react.default.createElement(_unresolvedView.default, (0, _extends2.default)({}, props, {
|
|
62
|
-
actions: actions,
|
|
63
|
-
testId: testId
|
|
64
|
-
}), /*#__PURE__*/_react.default.createElement(_lockFilled.default, {
|
|
65
|
-
label: "forbidden-lock-icon",
|
|
66
|
-
size: "small",
|
|
67
|
-
primaryColor: "var(--ds-icon-danger, ".concat(_colors.R300, ")"),
|
|
68
|
-
testId: "".concat(testId, "-lock-icon")
|
|
69
|
-
}), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
70
|
-
message: {
|
|
71
|
-
descriptor: _messages.messages[descriptiveMessageKey],
|
|
72
|
-
values: {
|
|
73
|
-
context: providerName
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}));
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @private
|
|
81
|
-
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
|
|
82
|
-
* @deprecated Replaced by FlexibleForbiddenView
|
|
83
|
-
*/
|
|
84
|
-
var _default = exports.default = (0, _withFlexibleUIBlockCardStyle.withFlexibleUIBlockCardStyle)(FlexibleForbiddenView);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _messages = require("../../../../messages");
|
|
12
|
-
var _warning = _interopRequireDefault(require("@atlaskit/icon/glyph/warning"));
|
|
13
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
14
|
-
var _text = _interopRequireDefault(require("../../../FlexibleCard/components/elements/text"));
|
|
15
|
-
var _unresolvedView = _interopRequireDefault(require("./unresolved-view"));
|
|
16
|
-
var _withFlexibleUIBlockCardStyle = require("./utils/withFlexibleUIBlockCardStyle");
|
|
17
|
-
var _excluded = ["testId"];
|
|
18
|
-
/**
|
|
19
|
-
* This view represents a Block Card with a 'Not_Found' status.
|
|
20
|
-
*
|
|
21
|
-
* @see SmartLinkStatus
|
|
22
|
-
* @see FlexibleCardProps
|
|
23
|
-
*/
|
|
24
|
-
var FlexibleNotFoundViewOld = function FlexibleNotFoundViewOld(_ref) {
|
|
25
|
-
var _ref$testId = _ref.testId,
|
|
26
|
-
testId = _ref$testId === void 0 ? 'smart-block-not-found-view' : _ref$testId,
|
|
27
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
28
|
-
return /*#__PURE__*/_react.default.createElement(_unresolvedView.default, (0, _extends2.default)({}, props, {
|
|
29
|
-
testId: testId
|
|
30
|
-
}), /*#__PURE__*/_react.default.createElement(_warning.default, {
|
|
31
|
-
label: "not-found-warning-icon",
|
|
32
|
-
size: "small",
|
|
33
|
-
primaryColor: "var(--ds-icon-warning, ".concat(_colors.R300, ")"),
|
|
34
|
-
testId: "".concat(testId, "-warning-icon")
|
|
35
|
-
}), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
36
|
-
message: {
|
|
37
|
-
descriptor: _messages.messages.not_found_description
|
|
38
|
-
},
|
|
39
|
-
testId: "".concat(testId, "-message")
|
|
40
|
-
}));
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @private
|
|
45
|
-
* @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
|
|
46
|
-
* @deprecated Replaced by FlexibleNotFoundView
|
|
47
|
-
*/
|
|
48
|
-
var _default = exports.default = (0, _withFlexibleUIBlockCardStyle.withFlexibleUIBlockCardStyle)(FlexibleNotFoundViewOld);
|