@atlaskit/smart-card 32.7.2 → 32.7.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.
- package/CHANGELOG.md +20 -0
- package/analytics.spec.yaml +112 -53
- package/dist/cjs/extractors/common/context/extractAccessContext.js +1 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/actions/{flexible/AuthorizeAction.js → AuthorizeAction.js} +2 -2
- package/dist/cjs/view/BlockCard/actions/ForbiddenAction.js +16 -13
- package/dist/cjs/view/BlockCard/actions/{flexible/RetryAction.js → RetryAction.js} +2 -2
- package/dist/cjs/view/BlockCard/index.js +14 -14
- package/dist/cjs/view/BlockCard/views/{flexible/FlexibleErroredView.js → ErroredView.js} +5 -5
- package/dist/cjs/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js} +9 -9
- package/dist/cjs/view/BlockCard/views/{flexible/FlexibleNotFoundView.js → NotFoundView.js} +4 -4
- package/dist/cjs/view/BlockCard/views/{flexible/FlexibleResolvedView.js → ResolvedView.js} +5 -5
- package/dist/cjs/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.js → UnauthorisedView.js} +7 -7
- package/dist/cjs/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.js +2 -2
- package/dist/cjs/view/BlockCard/views/{flexible/utils → utils}/index.js +3 -3
- package/dist/cjs/view/CardWithUrl/component.js +26 -9
- package/dist/cjs/view/CardWithUrl/loader.js +21 -7
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +2 -2
- package/dist/cjs/view/EmbedCard/index.js +8 -8
- package/dist/cjs/view/EmbedCard/views/ErroredView.js +2 -2
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +35 -8
- package/dist/cjs/view/HoverCard/index.js +25 -8
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/access/ForbiddenAction.js +28 -0
- package/dist/cjs/view/common/utils.js +9 -2
- package/dist/es2019/extractors/common/context/extractAccessContext.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/actions/{flexible/AuthorizeAction.js → AuthorizeAction.js} +2 -2
- package/dist/es2019/view/BlockCard/actions/ForbiddenAction.js +16 -6
- package/dist/es2019/view/BlockCard/actions/{flexible/RetryAction.js → RetryAction.js} +2 -2
- package/dist/es2019/view/BlockCard/index.js +13 -13
- package/dist/es2019/view/BlockCard/views/{flexible/FlexibleErroredView.js → ErroredView.js} +5 -5
- package/dist/es2019/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js} +9 -9
- package/dist/es2019/view/BlockCard/views/{flexible/FlexibleNotFoundView.js → NotFoundView.js} +4 -4
- package/dist/es2019/view/BlockCard/views/{flexible/FlexibleResolvedView.js → ResolvedView.js} +5 -5
- package/dist/es2019/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.js → UnauthorisedView.js} +7 -7
- package/dist/es2019/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.js +2 -2
- package/dist/es2019/view/BlockCard/views/{flexible/utils → utils}/index.js +3 -3
- package/dist/es2019/view/CardWithUrl/component.js +26 -9
- package/dist/es2019/view/CardWithUrl/loader.js +21 -7
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +1 -1
- package/dist/es2019/view/EmbedCard/index.js +3 -3
- package/dist/es2019/view/EmbedCard/views/ErroredView.js +1 -1
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +33 -9
- package/dist/es2019/view/HoverCard/index.js +26 -8
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/access/ForbiddenAction.js +12 -0
- package/dist/es2019/view/common/utils.js +8 -1
- package/dist/esm/extractors/common/context/extractAccessContext.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/actions/{flexible/AuthorizeAction.js → AuthorizeAction.js} +2 -2
- package/dist/esm/view/BlockCard/actions/ForbiddenAction.js +16 -13
- package/dist/esm/view/BlockCard/actions/{flexible/RetryAction.js → RetryAction.js} +2 -2
- package/dist/esm/view/BlockCard/index.js +13 -13
- package/dist/esm/view/BlockCard/views/{flexible/FlexibleErroredView.js → ErroredView.js} +5 -5
- package/dist/esm/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js} +9 -9
- package/dist/esm/view/BlockCard/views/{flexible/FlexibleNotFoundView.js → NotFoundView.js} +4 -4
- package/dist/esm/view/BlockCard/views/{flexible/FlexibleResolvedView.js → ResolvedView.js} +5 -5
- package/dist/esm/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.js → UnauthorisedView.js} +7 -7
- package/dist/esm/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.js +2 -2
- package/dist/esm/view/BlockCard/views/{flexible/utils → utils}/index.js +3 -3
- package/dist/esm/view/CardWithUrl/component.js +26 -9
- package/dist/esm/view/CardWithUrl/loader.js +21 -7
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +1 -1
- package/dist/esm/view/EmbedCard/index.js +3 -3
- package/dist/esm/view/EmbedCard/views/ErroredView.js +1 -1
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +36 -9
- package/dist/esm/view/HoverCard/index.js +25 -8
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/access/ForbiddenAction.js +21 -0
- package/dist/esm/view/common/utils.js +8 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +35 -1
- package/dist/types/types.d.ts +4 -11
- package/dist/{types-ts4.5/view/BlockCard/actions/flexible → types/view/BlockCard/actions}/AuthorizeAction.d.ts +1 -1
- package/dist/types/view/BlockCard/actions/ForbiddenAction.d.ts +12 -2
- package/dist/types/view/BlockCard/actions/{flexible/RetryAction.d.ts → RetryAction.d.ts} +1 -1
- package/dist/types/view/BlockCard/views/{flexible/types.d.ts → types.d.ts} +1 -1
- package/dist/{types-ts4.5/view/BlockCard/views/flexible → types/view/BlockCard/views}/unresolved-view/types.d.ts +2 -2
- package/dist/{types-ts4.5/view/BlockCard/views/flexible → types/view/BlockCard/views}/utils/index.d.ts +5 -5
- package/dist/types/view/EmbedCard/types.d.ts +1 -2
- package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types/view/common/access/ForbiddenAction.d.ts +2 -0
- package/dist/types/view/common/utils.d.ts +2 -0
- package/dist/types/view/types.d.ts +8 -6
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +35 -1
- package/dist/types-ts4.5/types.d.ts +4 -11
- package/dist/{types/view/BlockCard/actions/flexible → types-ts4.5/view/BlockCard/actions}/AuthorizeAction.d.ts +1 -1
- package/dist/types-ts4.5/view/BlockCard/actions/ForbiddenAction.d.ts +12 -2
- package/dist/types-ts4.5/view/BlockCard/actions/{flexible/RetryAction.d.ts → RetryAction.d.ts} +1 -1
- package/dist/types-ts4.5/view/BlockCard/views/{flexible/types.d.ts → types.d.ts} +1 -1
- package/dist/{types/view/BlockCard/views/flexible → types-ts4.5/view/BlockCard/views}/unresolved-view/types.d.ts +2 -2
- package/dist/{types/view/BlockCard/views/flexible → types-ts4.5/view/BlockCard/views}/utils/index.d.ts +5 -5
- package/dist/types-ts4.5/view/EmbedCard/types.d.ts +1 -2
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/view/common/access/ForbiddenAction.d.ts +2 -0
- package/dist/types-ts4.5/view/common/utils.d.ts +2 -0
- package/dist/types-ts4.5/view/types.d.ts +8 -6
- package/package.json +1 -1
- package/dist/cjs/view/BlockCard/actions/flexible/ForbiddenAction.js +0 -31
- package/dist/cjs/view/BlockCard/components/Action.js +0 -5
- package/dist/cjs/view/BlockCard/utils/handlers.js +0 -13
- package/dist/es2019/view/BlockCard/actions/flexible/ForbiddenAction.js +0 -22
- package/dist/es2019/view/BlockCard/components/Action.js +0 -1
- package/dist/es2019/view/BlockCard/utils/handlers.js +0 -7
- package/dist/esm/view/BlockCard/actions/flexible/ForbiddenAction.js +0 -24
- package/dist/esm/view/BlockCard/components/Action.js +0 -1
- package/dist/esm/view/BlockCard/utils/handlers.js +0 -7
- package/dist/types/view/BlockCard/actions/flexible/ForbiddenAction.d.ts +0 -12
- package/dist/types/view/BlockCard/components/Action.d.ts +0 -8
- package/dist/types/view/BlockCard/utils/handlers.d.ts +0 -2
- package/dist/types-ts4.5/view/BlockCard/actions/flexible/ForbiddenAction.d.ts +0 -12
- package/dist/types-ts4.5/view/BlockCard/components/Action.d.ts +0 -8
- package/dist/types-ts4.5/view/BlockCard/utils/handlers.d.ts +0 -2
- /package/dist/cjs/view/BlockCard/views/{flexible/styled.js → styled.js} +0 -0
- /package/dist/cjs/view/BlockCard/views/{flexible/types.js → types.js} +0 -0
- /package/dist/cjs/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/types.js +0 -0
- /package/dist/cjs/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.js +0 -0
- /package/dist/cjs/view/{BlockCard/components/Frame.js → EmbedCard/components/ErrorFrame.js} +0 -0
- /package/dist/es2019/view/BlockCard/views/{flexible/styled.js → styled.js} +0 -0
- /package/dist/es2019/view/BlockCard/views/{flexible/types.js → types.js} +0 -0
- /package/dist/es2019/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/types.js +0 -0
- /package/dist/es2019/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.js +0 -0
- /package/dist/es2019/view/{BlockCard/components/Frame.js → EmbedCard/components/ErrorFrame.js} +0 -0
- /package/dist/esm/view/BlockCard/views/{flexible/styled.js → styled.js} +0 -0
- /package/dist/esm/view/BlockCard/views/{flexible/types.js → types.js} +0 -0
- /package/dist/esm/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/types.js +0 -0
- /package/dist/esm/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.js +0 -0
- /package/dist/esm/view/{BlockCard/components/Frame.js → EmbedCard/components/ErrorFrame.js} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/FlexibleErroredView.d.ts → ErroredView.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/FlexibleForbiddenView.d.ts → ForbiddenView.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/FlexibleNotFoundView.d.ts → NotFoundView.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/FlexibleResolvedView.d.ts → ResolvedView.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.d.ts → UnauthorisedView.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/styled.d.ts → styled.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.d.ts +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.d.ts +0 -0
- /package/dist/types/view/{BlockCard/components/Frame.d.ts → EmbedCard/components/ErrorFrame.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleErroredView.d.ts → ErroredView.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleForbiddenView.d.ts → ForbiddenView.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleNotFoundView.d.ts → NotFoundView.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleResolvedView.d.ts → ResolvedView.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.d.ts → UnauthorisedView.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/styled.d.ts → styled.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.d.ts +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.d.ts +0 -0
- /package/dist/types-ts4.5/view/{BlockCard/components/Frame.d.ts → EmbedCard/components/ErrorFrame.d.ts} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { handleClickCommon } from '../common/utils';
|
|
3
4
|
import { CardLinkView } from '../LinkView';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import FlexibleUnauthorisedView from './views/flexible/FlexibleUnauthorisedView';
|
|
5
|
+
import ErroredView from './views/ErroredView';
|
|
6
|
+
import ForbiddenView from './views/ForbiddenView';
|
|
7
|
+
import NotFoundView from './views/NotFoundView';
|
|
8
|
+
import ResolvedView from './views/ResolvedView';
|
|
9
|
+
import UnauthorisedView from './views/UnauthorisedView';
|
|
10
10
|
export const BlockCard = ({
|
|
11
11
|
id,
|
|
12
12
|
url,
|
|
@@ -25,7 +25,7 @@ export const BlockCard = ({
|
|
|
25
25
|
const {
|
|
26
26
|
status
|
|
27
27
|
} = cardState;
|
|
28
|
-
const
|
|
28
|
+
const blockCardProps = {
|
|
29
29
|
id,
|
|
30
30
|
cardState,
|
|
31
31
|
url,
|
|
@@ -40,21 +40,21 @@ export const BlockCard = ({
|
|
|
40
40
|
switch (status) {
|
|
41
41
|
case 'pending':
|
|
42
42
|
case 'resolving':
|
|
43
|
-
return /*#__PURE__*/React.createElement(
|
|
43
|
+
return /*#__PURE__*/React.createElement(ResolvedView, _extends({}, blockCardProps, {
|
|
44
44
|
testId: 'smart-block-resolving-view'
|
|
45
45
|
}));
|
|
46
46
|
case 'resolved':
|
|
47
|
-
return /*#__PURE__*/React.createElement(
|
|
47
|
+
return /*#__PURE__*/React.createElement(ResolvedView, blockCardProps);
|
|
48
48
|
case 'unauthorized':
|
|
49
|
-
return /*#__PURE__*/React.createElement(
|
|
49
|
+
return /*#__PURE__*/React.createElement(UnauthorisedView, _extends({}, blockCardProps, {
|
|
50
50
|
onAuthorize: handleAuthorize
|
|
51
51
|
}));
|
|
52
52
|
case 'forbidden':
|
|
53
|
-
return /*#__PURE__*/React.createElement(
|
|
53
|
+
return /*#__PURE__*/React.createElement(ForbiddenView, _extends({}, blockCardProps, {
|
|
54
54
|
onAuthorize: handleAuthorize
|
|
55
55
|
}));
|
|
56
56
|
case 'not_found':
|
|
57
|
-
return /*#__PURE__*/React.createElement(
|
|
57
|
+
return /*#__PURE__*/React.createElement(NotFoundView, _extends({}, blockCardProps, {
|
|
58
58
|
onAuthorize: handleAuthorize
|
|
59
59
|
}));
|
|
60
60
|
case 'fallback':
|
|
@@ -74,7 +74,7 @@ export const BlockCard = ({
|
|
|
74
74
|
testId: `${testId}-${status}`
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
return /*#__PURE__*/React.createElement(
|
|
77
|
+
return /*#__PURE__*/React.createElement(ErroredView, _extends({}, blockCardProps, {
|
|
78
78
|
onAuthorize: handleAuthorize
|
|
79
79
|
}));
|
|
80
80
|
}
|
|
@@ -2,9 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import WarningIcon from '@atlaskit/icon/glyph/warning';
|
|
4
4
|
import { R300 } from '@atlaskit/theme/colors';
|
|
5
|
-
import { messages } from '
|
|
6
|
-
import Text from '
|
|
7
|
-
import { RetryAction } from '
|
|
5
|
+
import { messages } from '../../../messages';
|
|
6
|
+
import Text from '../../FlexibleCard/components/elements/text';
|
|
7
|
+
import { RetryAction } from '../actions/RetryAction';
|
|
8
8
|
import UnresolvedView from './unresolved-view';
|
|
9
9
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
14
14
|
* @see SmartLinkStatus
|
|
15
15
|
* @see FlexibleCardProps
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const ErroredView = ({
|
|
18
18
|
testId = 'smart-block-errored-view',
|
|
19
19
|
...props
|
|
20
20
|
}) => {
|
|
@@ -34,4 +34,4 @@ const FlexibleErroredView = ({
|
|
|
34
34
|
}
|
|
35
35
|
}));
|
|
36
36
|
};
|
|
37
|
-
export default withFlexibleUIBlockCardStyle(
|
|
37
|
+
export default withFlexibleUIBlockCardStyle(ErroredView);
|
package/dist/es2019/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js}
RENAMED
|
@@ -5,13 +5,13 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
5
5
|
import LockIcon from '@atlaskit/icon/glyph/lock';
|
|
6
6
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
7
7
|
import { R300 } from '@atlaskit/theme/colors';
|
|
8
|
-
import { extractRequestAccessContextImproved } from '
|
|
9
|
-
import extractHostname from '
|
|
10
|
-
import { messages } from '
|
|
11
|
-
import { toMessage } from '
|
|
12
|
-
import { getForbiddenJsonLd } from '
|
|
13
|
-
import Text from '
|
|
14
|
-
import { ForbiddenAction } from '
|
|
8
|
+
import { extractRequestAccessContextImproved } from '../../../extractors/common/context/extractAccessContext';
|
|
9
|
+
import extractHostname from '../../../extractors/common/hostname/extractHostname';
|
|
10
|
+
import { messages } from '../../../messages';
|
|
11
|
+
import { toMessage } from '../../../utils/intl-utils';
|
|
12
|
+
import { getForbiddenJsonLd } from '../../../utils/jsonld';
|
|
13
|
+
import Text from '../../FlexibleCard/components/elements/text';
|
|
14
|
+
import { ForbiddenAction } from '../actions/ForbiddenAction';
|
|
15
15
|
import UnresolvedView from './unresolved-view';
|
|
16
16
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
17
17
|
|
|
@@ -22,7 +22,7 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
22
22
|
* @see SmartLinkStatus
|
|
23
23
|
* @see FlexibleCardProps
|
|
24
24
|
*/
|
|
25
|
-
const
|
|
25
|
+
const ForbiddenView = ({
|
|
26
26
|
testId = 'smart-block-forbidden-view',
|
|
27
27
|
...props
|
|
28
28
|
}) => {
|
|
@@ -91,4 +91,4 @@ const FlexibleForbiddenView = ({
|
|
|
91
91
|
}
|
|
92
92
|
}));
|
|
93
93
|
};
|
|
94
|
-
export default withFlexibleUIBlockCardStyle(
|
|
94
|
+
export default withFlexibleUIBlockCardStyle(ForbiddenView);
|
package/dist/es2019/view/BlockCard/views/{flexible/FlexibleNotFoundView.js → NotFoundView.js}
RENAMED
|
@@ -4,8 +4,8 @@ import { useIntl } from 'react-intl-next';
|
|
|
4
4
|
import LockIcon from '@atlaskit/icon/glyph/lock';
|
|
5
5
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
6
6
|
import { R300 } from '@atlaskit/theme/colors';
|
|
7
|
-
import { messages } from '
|
|
8
|
-
import Text from '
|
|
7
|
+
import { messages } from '../../../messages';
|
|
8
|
+
import Text from '../../FlexibleCard/components/elements/text';
|
|
9
9
|
import UnresolvedView from './unresolved-view';
|
|
10
10
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
15
15
|
* @see SmartLinkStatus
|
|
16
16
|
* @see FlexibleCardProps
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
18
|
+
const NotFoundView = ({
|
|
19
19
|
testId = 'smart-block-not-found-view',
|
|
20
20
|
...props
|
|
21
21
|
}) => {
|
|
@@ -49,4 +49,4 @@ const FlexibleNotFoundView = ({
|
|
|
49
49
|
maxLines: 3
|
|
50
50
|
}));
|
|
51
51
|
};
|
|
52
|
-
export default withFlexibleUIBlockCardStyle(
|
|
52
|
+
export default withFlexibleUIBlockCardStyle(NotFoundView);
|
package/dist/es2019/view/BlockCard/views/{flexible/FlexibleResolvedView.js → ResolvedView.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { ActionName, ElementName, SmartLinkPosition } from '
|
|
4
|
-
import FlexibleCard from '
|
|
5
|
-
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '
|
|
3
|
+
import { ActionName, ElementName, SmartLinkPosition } from '../../../constants';
|
|
4
|
+
import FlexibleCard from '../../FlexibleCard';
|
|
5
|
+
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../FlexibleCard/components/blocks';
|
|
6
6
|
import { metadataBlockCss } from './styled';
|
|
7
7
|
import { FlexibleCardUiOptions, FooterBlockOptions, getSimulatedBetterMetadata, PreviewBlockOptions, titleBlockOptions } from './utils';
|
|
8
8
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
@@ -12,7 +12,7 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
12
12
|
* @see SmartLinkStatus
|
|
13
13
|
* @see FlexibleCardProps
|
|
14
14
|
*/
|
|
15
|
-
const
|
|
15
|
+
const ResolvedView = ({
|
|
16
16
|
cardState,
|
|
17
17
|
onClick,
|
|
18
18
|
onError,
|
|
@@ -75,4 +75,4 @@ const FlexibleResolvedView = ({
|
|
|
75
75
|
actions: footerActions
|
|
76
76
|
})));
|
|
77
77
|
};
|
|
78
|
-
export default withFlexibleUIBlockCardStyle(
|
|
78
|
+
export default withFlexibleUIBlockCardStyle(ResolvedView);
|
|
@@ -9,11 +9,11 @@ import { useCallback, useMemo } from 'react';
|
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { FormattedMessage } from 'react-intl-next';
|
|
11
11
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
12
|
-
import { useAnalyticsEvents } from '
|
|
13
|
-
import { messages } from '
|
|
14
|
-
import { hasAuthScopeOverrides } from '
|
|
15
|
-
import UnauthorisedViewContent from '
|
|
16
|
-
import { AuthorizeAction } from '
|
|
12
|
+
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
13
|
+
import { messages } from '../../../messages';
|
|
14
|
+
import { hasAuthScopeOverrides } from '../../../state/helpers';
|
|
15
|
+
import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
|
|
16
|
+
import { AuthorizeAction } from '../actions/AuthorizeAction';
|
|
17
17
|
import UnresolvedView from './unresolved-view';
|
|
18
18
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
19
19
|
const contentStyles = css({
|
|
@@ -29,7 +29,7 @@ const contentStyles = css({
|
|
|
29
29
|
* @see SmartLinkStatus
|
|
30
30
|
* @see FlexibleCardProps
|
|
31
31
|
*/
|
|
32
|
-
const
|
|
32
|
+
const UnauthorisedView = ({
|
|
33
33
|
testId = 'smart-block-unauthorized-view',
|
|
34
34
|
...props
|
|
35
35
|
}) => {
|
|
@@ -70,4 +70,4 @@ const FlexibleUnauthorisedView = ({
|
|
|
70
70
|
"data-testid": `${testId}-content`
|
|
71
71
|
}, content));
|
|
72
72
|
};
|
|
73
|
-
export default withFlexibleUIBlockCardStyle(
|
|
73
|
+
export default withFlexibleUIBlockCardStyle(UnauthorisedView);
|
package/dist/es2019/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.js
RENAMED
|
@@ -3,8 +3,8 @@ import React from 'react';
|
|
|
3
3
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
|
-
import FlexibleCard from '
|
|
7
|
-
import { CustomBlock, InternalFooterBlock, PreviewBlock, TitleBlock } from '
|
|
6
|
+
import FlexibleCard from '../../../FlexibleCard';
|
|
7
|
+
import { CustomBlock, InternalFooterBlock, PreviewBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
|
|
8
8
|
import { FlexibleCardUiOptions, FooterBlockOptions, PreviewBlockOptions, titleBlockOptions } from '../utils';
|
|
9
9
|
const customBlockStyles = css({
|
|
10
10
|
alignItems: 'flex-start'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '
|
|
3
|
-
import { extractOwnedBy } from '
|
|
4
|
-
import { getExtensionKey } from '
|
|
2
|
+
import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../constants';
|
|
3
|
+
import { extractOwnedBy } from '../../../../extractors/flexible/utils';
|
|
4
|
+
import { getExtensionKey } from '../../../../state/helpers';
|
|
5
5
|
import { footerBlockCss, titleBlockCss } from '../styled';
|
|
6
6
|
const baseTopMetadata = [{
|
|
7
7
|
name: ElementName.ModifiedOn
|
|
@@ -4,6 +4,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
4
4
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
5
5
|
import { CardDisplay } from '../../constants';
|
|
6
6
|
import { useSmartLink } from '../../state';
|
|
7
|
+
import { succeedUfoExperience } from '../../state/analytics';
|
|
7
8
|
import { getCanBeDatasource, getClickUrl, getDefinitionId, getExtensionKey, getProduct, getResourceType, getServices, getSubproduct, isFinalState } from '../../state/helpers';
|
|
8
9
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
9
10
|
import { isSpecialEvent } from '../../utils';
|
|
@@ -154,16 +155,32 @@ function Component({
|
|
|
154
155
|
// - the unresolved states: viz. forbidden, not_found, unauthorized, errored.
|
|
155
156
|
useEffect(() => {
|
|
156
157
|
if (isFinalState(state.status)) {
|
|
157
|
-
analytics
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
159
|
+
succeedUfoExperience('smart-link-rendered', id || 'NULL', {
|
|
160
|
+
extensionKey,
|
|
161
|
+
display: isFlexibleUi ? 'flexible' : appearance
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// UFO will disregard this if authentication experience has not yet been started
|
|
165
|
+
succeedUfoExperience('smart-link-authenticated', id || 'NULL', {
|
|
166
|
+
display: isFlexibleUi ? 'flexible' : appearance
|
|
167
|
+
});
|
|
168
|
+
fireEvent('ui.smartLink.renderSuccess', {
|
|
169
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
170
|
+
display: isFlexibleUi ? 'flexible' : appearance
|
|
171
|
+
});
|
|
172
|
+
} else {
|
|
173
|
+
analytics.ui.renderSuccessEvent({
|
|
174
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
175
|
+
status: state.status,
|
|
176
|
+
id,
|
|
177
|
+
definitionId,
|
|
178
|
+
extensionKey,
|
|
179
|
+
canBeDatasource
|
|
180
|
+
});
|
|
181
|
+
}
|
|
165
182
|
}
|
|
166
|
-
}, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id, canBeDatasource]);
|
|
183
|
+
}, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id, canBeDatasource, fireEvent]);
|
|
167
184
|
const onIframeDwell = useCallback((dwellTime, dwellPercentVisible) => {
|
|
168
185
|
fireEvent('ui.smartLinkIframe.dwelled', {
|
|
169
186
|
id,
|
|
@@ -2,8 +2,10 @@ import React, { lazy, Suspense, useCallback, useEffect, useState } from 'react';
|
|
|
2
2
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
3
3
|
import { di } from 'react-magnetic-di';
|
|
4
4
|
import uuid from 'uuid';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
6
|
-
import { useSmartLinkAnalytics } from '../../state
|
|
7
|
+
import { useSmartLinkAnalytics } from '../../state';
|
|
8
|
+
import { failUfoExperience, startUfoExperience } from '../../state/analytics';
|
|
7
9
|
import { importWithRetry } from '../../utils';
|
|
8
10
|
import { isFlexibleUiCard } from '../../utils/flexible';
|
|
9
11
|
import { clearMarks, clearMeasures } from '../../utils/performance';
|
|
@@ -71,12 +73,24 @@ export function CardWithURLRenderer(props) {
|
|
|
71
73
|
definitionId: null
|
|
72
74
|
});
|
|
73
75
|
} else if (error.name !== 'APIError') {
|
|
74
|
-
analytics
|
|
75
|
-
|
|
76
|
-
id
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
77
|
+
startUfoExperience('smart-link-rendered', id || 'NULL');
|
|
78
|
+
failUfoExperience('smart-link-rendered', id || 'NULL');
|
|
79
|
+
failUfoExperience('smart-link-authenticated', id || 'NULL');
|
|
80
|
+
fireEvent('ui.smartLink.renderFailed', {
|
|
81
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
82
|
+
id: id !== null && id !== void 0 ? id : null,
|
|
83
|
+
error: error,
|
|
84
|
+
errorInfo: errorInfo
|
|
85
|
+
});
|
|
86
|
+
} else {
|
|
87
|
+
analytics.ui.renderFailedEvent({
|
|
88
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
89
|
+
id,
|
|
90
|
+
error,
|
|
91
|
+
errorInfo
|
|
92
|
+
});
|
|
93
|
+
}
|
|
80
94
|
}
|
|
81
95
|
onError && onError({
|
|
82
96
|
status: 'errored',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Tooltip from '@atlaskit/tooltip';
|
|
3
3
|
import { useMouseDownEvent } from '../../../state/analytics/useLinkClicked';
|
|
4
|
-
import { handleClickCommon } from '../../
|
|
4
|
+
import { handleClickCommon } from '../../common/utils';
|
|
5
5
|
import { className, Content, Header, IconWrapper, LinkWrapper, TextWrapper, TooltipWrapper, Wrapper } from './styled';
|
|
6
6
|
export const ExpandedFrame = ({
|
|
7
7
|
isPlaceholder = false,
|
|
@@ -6,7 +6,7 @@ import { extractEmbedProps } from '../../extractors/embed';
|
|
|
6
6
|
import { extractInlineProps } from '../../extractors/inline';
|
|
7
7
|
import { getExtensionKey, hasAuthScopeOverrides } from '../../state/helpers';
|
|
8
8
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
9
|
-
import
|
|
9
|
+
import BlockCardResolvedView from '../BlockCard/views/ResolvedView';
|
|
10
10
|
import { InlineCardResolvedView } from '../InlineCard/ResolvedView';
|
|
11
11
|
import { EmbedCardErroredView } from './views/ErroredView';
|
|
12
12
|
import ForbiddenView from './views/forbidden-view';
|
|
@@ -48,7 +48,7 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
48
48
|
switch (status) {
|
|
49
49
|
case 'pending':
|
|
50
50
|
case 'resolving':
|
|
51
|
-
return /*#__PURE__*/React.createElement(
|
|
51
|
+
return /*#__PURE__*/React.createElement(BlockCardResolvedView, {
|
|
52
52
|
url: url,
|
|
53
53
|
cardState: cardState,
|
|
54
54
|
onClick: handleFrameClick,
|
|
@@ -89,7 +89,7 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
89
89
|
onClick: handleFrameClick
|
|
90
90
|
}));
|
|
91
91
|
}
|
|
92
|
-
return /*#__PURE__*/React.createElement(
|
|
92
|
+
return /*#__PURE__*/React.createElement(BlockCardResolvedView, {
|
|
93
93
|
url: url,
|
|
94
94
|
cardState: cardState,
|
|
95
95
|
onClick: handleFrameClick,
|
|
@@ -10,8 +10,8 @@ import ErrorIcon from '@atlaskit/icon/core/migration/error';
|
|
|
10
10
|
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
11
11
|
import { R300 } from '@atlaskit/theme/colors';
|
|
12
12
|
import { messages } from '../../../messages';
|
|
13
|
-
import { Frame } from '../../BlockCard/components/Frame';
|
|
14
13
|
import { gs } from '../../common/utils';
|
|
14
|
+
import { Frame } from '../components/ErrorFrame';
|
|
15
15
|
const messageStyles = css({
|
|
16
16
|
font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
17
17
|
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
3
5
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize, SmartLinkStatus } from '../../../../../constants';
|
|
4
|
-
import {
|
|
6
|
+
import { succeedUfoExperience } from '../../../../../state/analytics';
|
|
7
|
+
import { getCanBeDatasource, getDefinitionId } from '../../../../../state/helpers';
|
|
5
8
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
6
9
|
import { ActionBlock, AIFooterBlock, AISummaryBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
7
10
|
import { getMetadata } from '../../../utils';
|
|
@@ -14,19 +17,40 @@ const HoverCardResolvedView = ({
|
|
|
14
17
|
flexibleCardProps,
|
|
15
18
|
isAISummaryEnabled,
|
|
16
19
|
onActionClick,
|
|
17
|
-
titleBlockProps
|
|
20
|
+
titleBlockProps,
|
|
21
|
+
id
|
|
18
22
|
}) => {
|
|
19
23
|
var _cardState$details;
|
|
20
|
-
const
|
|
24
|
+
const {
|
|
25
|
+
fireEvent
|
|
26
|
+
} = useAnalyticsEvents();
|
|
27
|
+
const definitionId = React.useMemo(() => getDefinitionId(cardState.details), [cardState.details]);
|
|
28
|
+
const canBeDatasource = React.useMemo(() => getCanBeDatasource(cardState.details), [cardState.details]);
|
|
21
29
|
useEffect(() => {
|
|
22
30
|
// Since this hover view is only rendered on resolved status,
|
|
23
31
|
// there is no need to check for statuses.
|
|
24
|
-
analytics
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
33
|
+
succeedUfoExperience('smart-link-rendered', id || 'NULL', {
|
|
34
|
+
extensionKey,
|
|
35
|
+
display: CardDisplay.HoverCardPreview
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// UFO will disregard this if authentication experience has not yet been started
|
|
39
|
+
succeedUfoExperience('smart-link-authenticated', id || 'NULL', {
|
|
40
|
+
display: CardDisplay.HoverCardPreview
|
|
41
|
+
});
|
|
42
|
+
fireEvent('ui.smartLink.renderSuccess', {
|
|
43
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
44
|
+
display: CardDisplay.HoverCardPreview
|
|
45
|
+
});
|
|
46
|
+
} else {
|
|
47
|
+
analytics.ui.renderSuccessEvent({
|
|
48
|
+
display: CardDisplay.HoverCardPreview,
|
|
49
|
+
status: cardState.status,
|
|
50
|
+
canBeDatasource
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}, [analytics.ui, cardState.status, canBeDatasource, fireEvent, definitionId, extensionKey, id]);
|
|
30
54
|
const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
31
55
|
const {
|
|
32
56
|
primary,
|
|
@@ -9,11 +9,17 @@ import { jsx } from '@emotion/react';
|
|
|
9
9
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
10
10
|
import { di } from 'react-magnetic-di';
|
|
11
11
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
12
14
|
import { CardDisplay } from '../../constants';
|
|
13
|
-
import { useSmartLinkAnalytics } from '../../state
|
|
15
|
+
import { useSmartLinkAnalytics } from '../../state';
|
|
16
|
+
import { failUfoExperience, startUfoExperience } from '../../state/analytics';
|
|
14
17
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
15
18
|
import { HoverCardComponent } from './components/HoverCardComponent';
|
|
16
19
|
const HoverCardWithErrorBoundary = props => {
|
|
20
|
+
const {
|
|
21
|
+
fireEvent
|
|
22
|
+
} = useAnalyticsEvents();
|
|
17
23
|
const {
|
|
18
24
|
url,
|
|
19
25
|
id,
|
|
@@ -21,13 +27,25 @@ const HoverCardWithErrorBoundary = props => {
|
|
|
21
27
|
} = props;
|
|
22
28
|
const analytics = useSmartLinkAnalytics(url, id);
|
|
23
29
|
const onError = useCallback((error, info) => {
|
|
24
|
-
analytics
|
|
25
|
-
|
|
26
|
-
id
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
31
|
+
startUfoExperience('smart-link-rendered', id || 'NULL');
|
|
32
|
+
failUfoExperience('smart-link-rendered', id || 'NULL');
|
|
33
|
+
failUfoExperience('smart-link-authenticated', id || 'NULL');
|
|
34
|
+
fireEvent('ui.smartLink.renderFailed', {
|
|
35
|
+
display: CardDisplay.HoverCardPreview,
|
|
36
|
+
id: id !== null && id !== void 0 ? id : null,
|
|
37
|
+
error: error,
|
|
38
|
+
errorInfo: info
|
|
39
|
+
});
|
|
40
|
+
} else {
|
|
41
|
+
analytics.ui.renderFailedEvent({
|
|
42
|
+
display: CardDisplay.HoverCardPreview,
|
|
43
|
+
id,
|
|
44
|
+
error,
|
|
45
|
+
errorInfo: info
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}, [analytics.ui, id, fireEvent]);
|
|
31
49
|
return jsx(ErrorBoundary, {
|
|
32
50
|
fallback: children,
|
|
33
51
|
onError: onError
|
|
@@ -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: "32.7.
|
|
13
|
+
packageVersion: "32.7.4",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
+
import { messages } from '../../../messages';
|
|
5
|
+
export const ForbiddenAction = (handler, id = 'connect-other-account', message = messages.try_another_account, values = {}) => ({
|
|
6
|
+
id,
|
|
7
|
+
text: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
|
|
8
|
+
values: values
|
|
9
|
+
})),
|
|
10
|
+
promise: () => new Promise(resolve => resolve(handler())),
|
|
11
|
+
buttonAppearance: 'default'
|
|
12
|
+
});
|
|
@@ -6,4 +6,11 @@ import facepaint from 'facepaint';
|
|
|
6
6
|
const gs = times => `${8 * times}px`;
|
|
7
7
|
const br = (times = 1) => `${3 * times}px`;
|
|
8
8
|
const mq = facepaint(['@media(min-width: 576px)']);
|
|
9
|
-
export { gs, br, mq };
|
|
9
|
+
export { gs, br, mq };
|
|
10
|
+
export const handleClickCommon = (event, onClick) => {
|
|
11
|
+
if (onClick) {
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
event.stopPropagation();
|
|
14
|
+
onClick(event);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -3,7 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { messages } from '../../../messages';
|
|
5
5
|
import { ANALYTICS_CHANNEL } from '../../../utils/analytics';
|
|
6
|
-
import { ForbiddenAction } from '../../../view/
|
|
6
|
+
import { ForbiddenAction } from '../../../view/common/access/ForbiddenAction';
|
|
7
7
|
import extractHostname from '../hostname/extractHostname';
|
|
8
8
|
export var extractRequestAccessContextImproved = function extractRequestAccessContextImproved(_ref) {
|
|
9
9
|
var _jsonLd$requestAccess;
|
|
@@ -10,7 +10,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
10
10
|
export var context = {
|
|
11
11
|
componentName: 'smart-cards',
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "32.7.
|
|
13
|
+
packageVersion: "32.7.4"
|
|
14
14
|
};
|
|
15
15
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
16
16
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
-
import { ActionName } from '
|
|
5
|
-
import { messages } from '
|
|
4
|
+
import { ActionName } from '../../../constants';
|
|
5
|
+
import { messages } from '../../../messages';
|
|
6
6
|
/**
|
|
7
7
|
* Returns a CustomActionItem with a "Connect to <providerName>" message
|
|
8
8
|
*
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
+
import { ActionName } from '../../../constants';
|
|
4
5
|
import { messages } from '../../../messages';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Returns a CustomActionItem with a "Try Another Account" default message
|
|
8
|
+
*
|
|
9
|
+
* @see CustomActionItem
|
|
10
|
+
* @param onClick a function that will be called on the click of the button
|
|
11
|
+
* @param content is a message key for a message to be displayed in the action
|
|
12
|
+
* @param context is a variable for a message in case a message contains a placeholder
|
|
13
|
+
*/
|
|
14
|
+
export var ForbiddenAction = function ForbiddenAction(onClick, content, context, isDisabled) {
|
|
9
15
|
return {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
values:
|
|
16
|
+
name: ActionName.CustomAction,
|
|
17
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[content], {
|
|
18
|
+
values: context
|
|
13
19
|
})),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
},
|
|
19
|
-
buttonAppearance: 'default'
|
|
20
|
+
onClick: onClick,
|
|
21
|
+
testId: 'smart-action-connect-other-account',
|
|
22
|
+
isDisabled: isDisabled
|
|
20
23
|
};
|
|
21
24
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
-
import { ActionName } from '
|
|
4
|
-
import { messages } from '
|
|
3
|
+
import { ActionName } from '../../../constants';
|
|
4
|
+
import { messages } from '../../../messages';
|
|
5
5
|
/**
|
|
6
6
|
* Returns a CustomActionItem with a "Retry" default message
|
|
7
7
|
*
|