@atlaskit/smart-card 26.43.6 → 26.43.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/BlockCard/index.js +2 -9
  4. package/dist/cjs/view/EmbedCard/index.js +33 -73
  5. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +4 -7
  6. package/dist/cjs/view/InlineCard/ErroredView/index.js +1 -2
  7. package/dist/cjs/view/InlineCard/ForbiddenView/index.js +5 -10
  8. package/dist/cjs/view/InlineCard/index.js +1 -7
  9. package/dist/cjs/view/LinkUrl/index.js +1 -1
  10. package/dist/es2019/utils/analytics/analytics.js +1 -1
  11. package/dist/es2019/view/BlockCard/index.js +2 -9
  12. package/dist/es2019/view/EmbedCard/index.js +33 -73
  13. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +4 -7
  14. package/dist/es2019/view/InlineCard/ErroredView/index.js +1 -2
  15. package/dist/es2019/view/InlineCard/ForbiddenView/index.js +5 -10
  16. package/dist/es2019/view/InlineCard/index.js +1 -7
  17. package/dist/es2019/view/LinkUrl/index.js +1 -1
  18. package/dist/esm/utils/analytics/analytics.js +1 -1
  19. package/dist/esm/view/BlockCard/index.js +2 -9
  20. package/dist/esm/view/EmbedCard/index.js +33 -73
  21. package/dist/esm/view/HoverCard/components/HoverCardContent.js +4 -7
  22. package/dist/esm/view/InlineCard/ErroredView/index.js +1 -2
  23. package/dist/esm/view/InlineCard/ForbiddenView/index.js +5 -10
  24. package/dist/esm/view/InlineCard/index.js +1 -7
  25. package/dist/esm/view/LinkUrl/index.js +1 -1
  26. package/package.json +2 -5
  27. package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +0 -84
  28. package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundViewOld.js +0 -48
  29. package/dist/cjs/view/EmbedCard/views/ForbiddenView.js +0 -75
  30. package/dist/cjs/view/EmbedCard/views/NotFoundView.js +0 -46
  31. package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +0 -87
  32. package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +0 -76
  33. package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundViewOld.js +0 -38
  34. package/dist/es2019/view/EmbedCard/views/ForbiddenView.js +0 -69
  35. package/dist/es2019/view/EmbedCard/views/NotFoundView.js +0 -39
  36. package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +0 -77
  37. package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +0 -75
  38. package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundViewOld.js +0 -42
  39. package/dist/esm/view/EmbedCard/views/ForbiddenView.js +0 -68
  40. package/dist/esm/view/EmbedCard/views/NotFoundView.js +0 -39
  41. package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +0 -77
  42. package/dist/types/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.d.ts +0 -8
  43. package/dist/types/view/BlockCard/views/flexible/FlexibleNotFoundViewOld.d.ts +0 -8
  44. package/dist/types/view/EmbedCard/views/ForbiddenView.d.ts +0 -17
  45. package/dist/types/view/EmbedCard/views/NotFoundView.d.ts +0 -15
  46. package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +0 -20
  47. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.d.ts +0 -8
  48. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleNotFoundViewOld.d.ts +0 -8
  49. package/dist/types-ts4.5/view/EmbedCard/views/ForbiddenView.d.ts +0 -17
  50. package/dist/types-ts4.5/view/EmbedCard/views/NotFoundView.d.ts +0 -15
  51. package/dist/types-ts4.5/view/EmbedCard/views/UnauthorisedView.d.ts +0 -20
@@ -1,75 +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.EmbedCardForbiddenView = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _UnresolvedView = require("./UnresolvedView");
10
- var _ExpandedFrame = require("../components/ExpandedFrame");
11
- var _ImageIcon = require("../components/ImageIcon");
12
- var _utils = require("../utils");
13
- var _reactMagneticDi = require("react-magnetic-di");
14
- /**
15
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
16
- * @deprecated Replaced by forbidden-view
17
- */
18
- var EmbedCardForbiddenView = exports.EmbedCardForbiddenView = function EmbedCardForbiddenView(_ref) {
19
- var _action$promise;
20
- var link = _ref.link,
21
- context = _ref.context,
22
- isSelected = _ref.isSelected,
23
- _ref$testId = _ref.testId,
24
- testId = _ref$testId === void 0 ? 'embed-card-forbidden-view' : _ref$testId,
25
- onAuthorise = _ref.onAuthorise,
26
- inheritDimensions = _ref.inheritDimensions,
27
- onClick = _ref.onClick,
28
- _ref$requestAccessCon = _ref.requestAccessContext,
29
- requestAccessContext = _ref$requestAccessCon === void 0 ? {} : _ref$requestAccessCon;
30
- var icon = context && context.icon && /*#__PURE__*/_react.default.createElement(_ImageIcon.ImageIcon, {
31
- src: typeof context.icon === 'string' ? context.icon : undefined
32
- });
33
- var descriptiveMessageKey = requestAccessContext.descriptiveMessageKey,
34
- callToActionMessageKey = requestAccessContext.callToActionMessageKey,
35
- action = requestAccessContext.action;
36
- var onEmbedCardClick = (_action$promise = action === null || action === void 0 ? void 0 : action.promise) !== null && _action$promise !== void 0 ? _action$promise : onAuthorise;
37
- var showButton = true;
38
- /**
39
- * if there is a request access context, but no action to perform, do not show any button.
40
- * By default, a "Try another account" button shows, but with request access context, we don't
41
- * want to encourage users to try another account, if their request is already pending, etc.
42
- */
43
- if (!callToActionMessageKey && descriptiveMessageKey) {
44
- showButton = false;
45
- }
46
- var descriptionKey = descriptiveMessageKey !== null && descriptiveMessageKey !== void 0 ? descriptiveMessageKey : 'invalid_permissions_description';
47
- var buttonTextKey = callToActionMessageKey !== null && callToActionMessageKey !== void 0 ? callToActionMessageKey : 'try_another_account';
48
- var buttonProps;
49
- if (showButton) {
50
- buttonProps = {
51
- appearance: 'default',
52
- text: buttonTextKey,
53
- testId: (action === null || action === void 0 ? void 0 : action.id) || 'connect-other-account'
54
- };
55
- }
56
- return /*#__PURE__*/_react.default.createElement(_ExpandedFrame.ExpandedFrame, {
57
- href: link,
58
- icon: icon,
59
- text: context && context.text,
60
- frameStyle: "show",
61
- isSelected: isSelected,
62
- inheritDimensions: inheritDimensions,
63
- onClick: onClick,
64
- testId: testId,
65
- allowScrollBar: true
66
- }, /*#__PURE__*/_react.default.createElement(_UnresolvedView.EmbedCardUnresolvedView, {
67
- image: (0, _utils.getUnresolvedEmbedCardImage)('forbidden'),
68
- title: "invalid_permissions",
69
- description: descriptionKey,
70
- context: context && context.text,
71
- button: buttonProps,
72
- onClick: onEmbedCardClick,
73
- testId: testId
74
- }));
75
- };
@@ -1,46 +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.EmbedCardNotFoundView = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _UnresolvedView = require("./UnresolvedView");
10
- var _ExpandedFrame = require("../components/ExpandedFrame");
11
- var _ImageIcon = require("../components/ImageIcon");
12
- var _utils = require("../utils");
13
- var _reactMagneticDi = require("react-magnetic-di");
14
- /**
15
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
16
- * @deprecated Replaced by not-found-view
17
- */
18
- var EmbedCardNotFoundView = exports.EmbedCardNotFoundView = function EmbedCardNotFoundView(_ref) {
19
- var link = _ref.link,
20
- context = _ref.context,
21
- isSelected = _ref.isSelected,
22
- inheritDimensions = _ref.inheritDimensions,
23
- _ref$testId = _ref.testId,
24
- testId = _ref$testId === void 0 ? 'embed-card-not-found-view' : _ref$testId,
25
- onClick = _ref.onClick;
26
- var icon = context && context.icon && /*#__PURE__*/_react.default.createElement(_ImageIcon.ImageIcon, {
27
- src: typeof context.icon === 'string' ? context.icon : undefined
28
- });
29
- return /*#__PURE__*/_react.default.createElement(_ExpandedFrame.ExpandedFrame, {
30
- href: link,
31
- icon: icon,
32
- text: context && context.text,
33
- frameStyle: "show",
34
- isSelected: isSelected,
35
- inheritDimensions: inheritDimensions,
36
- onClick: onClick,
37
- testId: testId,
38
- allowScrollBar: true
39
- }, /*#__PURE__*/_react.default.createElement(_UnresolvedView.EmbedCardUnresolvedView, {
40
- image: (0, _utils.getUnresolvedEmbedCardImage)('notFound'),
41
- title: "not_found_title",
42
- description: "not_found_description",
43
- context: context && context.text,
44
- testId: testId
45
- }));
46
- };
@@ -1,87 +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.EmbedCardUnauthorisedView = void 0;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _reactMagneticDi = require("react-magnetic-di");
11
- var _UnresolvedView = require("./UnresolvedView");
12
- var _ExpandedFrame = require("../components/ExpandedFrame");
13
- var _ImageIcon = require("../components/ImageIcon");
14
- var _UnauthorisedViewContent = _interopRequireDefault(require("../../common/UnauthorisedViewContent"));
15
- var _utils = require("../utils");
16
- 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); }
17
- 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; }
18
- /**
19
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
20
- * @deprecated Replaced by unauthorized-view
21
- */
22
- var EmbedCardUnauthorisedView = exports.EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref) {
23
- var analytics = _ref.analytics,
24
- link = _ref.link,
25
- context = _ref.context,
26
- isSelected = _ref.isSelected,
27
- _ref$testId = _ref.testId,
28
- testId = _ref$testId === void 0 ? 'embed-card-unauthorized-view' : _ref$testId,
29
- onAuthorise = _ref.onAuthorise,
30
- inheritDimensions = _ref.inheritDimensions,
31
- onClick = _ref.onClick,
32
- extensionKey = _ref.extensionKey,
33
- isProductIntegrationSupported = _ref.isProductIntegrationSupported;
34
- var icon = context && context.icon && /*#__PURE__*/_react.default.createElement(_ImageIcon.ImageIcon, {
35
- src: typeof context.icon === 'string' ? context.icon : undefined
36
- });
37
- var handleOnAuthorizeClick = (0, _react.useCallback)(function () {
38
- if (onAuthorise) {
39
- analytics.track.appAccountAuthStarted({
40
- extensionKey: extensionKey
41
- });
42
- onAuthorise();
43
- }
44
- }, [onAuthorise, analytics.track, extensionKey]);
45
- var view = (0, _react.useMemo)(function () {
46
- var _context$image2;
47
- if (onAuthorise) {
48
- var _context$image;
49
- return /*#__PURE__*/_react.default.createElement(_UnresolvedView.EmbedCardUnresolvedView, {
50
- button: {
51
- appearance: 'primary',
52
- text: 'connect_unauthorised_account_action',
53
- testId: 'connect-account'
54
- },
55
- context: context && context.text,
56
- description: "connect_unauthorised_account_description",
57
- image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : (0, _utils.getUnresolvedEmbedCardImage)('unauthorized'),
58
- onClick: handleOnAuthorizeClick,
59
- testId: testId,
60
- title: "connect_link_account_card_name"
61
- }, /*#__PURE__*/_react.default.createElement(_UnauthorisedViewContent.default, {
62
- analytics: analytics,
63
- providerName: context === null || context === void 0 ? void 0 : context.text,
64
- isProductIntegrationSupported: isProductIntegrationSupported,
65
- testId: testId
66
- }));
67
- }
68
- return /*#__PURE__*/_react.default.createElement(_UnresolvedView.EmbedCardUnresolvedView, {
69
- description: context !== null && context !== void 0 && context.text ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider',
70
- image: (_context$image2 = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image2 !== void 0 ? _context$image2 : (0, _utils.getUnresolvedEmbedCardImage)('forbidden'),
71
- context: context === null || context === void 0 ? void 0 : context.text,
72
- testId: testId,
73
- title: context !== null && context !== void 0 && context.text ? 'unauthorised_account_name' : 'unauthorised_account_name_no_provider'
74
- });
75
- }, [analytics, context, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorise, testId]);
76
- return /*#__PURE__*/_react.default.createElement(_ExpandedFrame.ExpandedFrame, {
77
- href: link,
78
- icon: icon,
79
- text: context && context.text,
80
- frameStyle: "show",
81
- isSelected: isSelected,
82
- inheritDimensions: inheritDimensions,
83
- onClick: onClick,
84
- testId: testId,
85
- allowScrollBar: true
86
- }, view);
87
- };
@@ -1,76 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React, { useMemo } from 'react';
3
- import { R300 } from '@atlaskit/theme/colors';
4
- import { messages } from '../../../../messages';
5
- import LockIcon from '@atlaskit/icon/glyph/lock-filled';
6
- import { ForbiddenAction } from '../../actions/flexible/ForbiddenAction';
7
- import Text from '../../../FlexibleCard/components/elements/text';
8
- import { getForbiddenJsonLd } from '../../../../utils/jsonld';
9
- import { extractProvider } from '@atlaskit/link-extractors';
10
- import { extractRequestAccessContext } from '../../../../extractors/common/context';
11
- import UnresolvedView from './unresolved-view';
12
- import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
13
-
14
- /**
15
- * @private
16
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
17
- * @deprecated Replaced by FlexibleForbiddenView
18
- */
19
- const FlexibleForbiddenView = ({
20
- testId = 'smart-block-forbidden-view',
21
- ...props
22
- }) => {
23
- var _details$meta;
24
- const {
25
- cardState,
26
- onAuthorize,
27
- url
28
- } = props;
29
- const details = cardState === null || cardState === void 0 ? void 0 : cardState.details;
30
- const cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : getForbiddenJsonLd().meta;
31
- const provider = extractProvider(details === null || details === void 0 ? void 0 : details.data);
32
- const providerName = (provider === null || provider === void 0 ? void 0 : provider.text) || '';
33
- const requestAccessContext = extractRequestAccessContext({
34
- jsonLd: cardMetadata,
35
- url,
36
- context: providerName
37
- });
38
- const descriptiveMessageKey = requestAccessContext && requestAccessContext.descriptiveMessageKey ? requestAccessContext.descriptiveMessageKey : 'invalid_permissions_description';
39
- const actions = useMemo(() => {
40
- let actionFromAccessContext = [];
41
- const tryAnotherAccountAction = onAuthorize ? [ForbiddenAction(onAuthorize, 'try_another_account')] : [];
42
- if (requestAccessContext) {
43
- const {
44
- action,
45
- callToActionMessageKey
46
- } = requestAccessContext;
47
- actionFromAccessContext = action && callToActionMessageKey ? [ForbiddenAction(action.promise, callToActionMessageKey, {
48
- context: providerName
49
- })] : [];
50
- }
51
- return [...tryAnotherAccountAction, ...actionFromAccessContext];
52
- }, [onAuthorize, requestAccessContext, providerName]);
53
- return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
54
- actions: actions,
55
- testId: testId
56
- }), /*#__PURE__*/React.createElement(LockIcon, {
57
- label: "forbidden-lock-icon",
58
- size: "small",
59
- primaryColor: `var(--ds-icon-danger, ${R300})`,
60
- testId: `${testId}-lock-icon`
61
- }), /*#__PURE__*/React.createElement(Text, {
62
- message: {
63
- descriptor: messages[descriptiveMessageKey],
64
- values: {
65
- context: providerName
66
- }
67
- }
68
- }));
69
- };
70
-
71
- /**
72
- * @private
73
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
74
- * @deprecated Replaced by FlexibleForbiddenView
75
- */
76
- export default withFlexibleUIBlockCardStyle(FlexibleForbiddenView);
@@ -1,38 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { messages } from '../../../../messages';
4
- import WarningIcon from '@atlaskit/icon/glyph/warning';
5
- import { R300 } from '@atlaskit/theme/colors';
6
- import Text from '../../../FlexibleCard/components/elements/text';
7
- import UnresolvedView from './unresolved-view';
8
- import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
9
-
10
- /**
11
- * This view represents a Block Card with a 'Not_Found' status.
12
- *
13
- * @see SmartLinkStatus
14
- * @see FlexibleCardProps
15
- */
16
- const FlexibleNotFoundViewOld = ({
17
- testId = 'smart-block-not-found-view',
18
- ...props
19
- }) => /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
20
- testId: testId
21
- }), /*#__PURE__*/React.createElement(WarningIcon, {
22
- label: "not-found-warning-icon",
23
- size: "small",
24
- primaryColor: `var(--ds-icon-warning, ${R300})`,
25
- testId: `${testId}-warning-icon`
26
- }), /*#__PURE__*/React.createElement(Text, {
27
- message: {
28
- descriptor: messages.not_found_description
29
- },
30
- testId: `${testId}-message`
31
- }));
32
-
33
- /**
34
- * @private
35
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
36
- * @deprecated Replaced by FlexibleNotFoundView
37
- */
38
- export default withFlexibleUIBlockCardStyle(FlexibleNotFoundViewOld);
@@ -1,69 +0,0 @@
1
- import React from 'react';
2
- import { EmbedCardUnresolvedView } from './UnresolvedView';
3
- import { ExpandedFrame } from '../components/ExpandedFrame';
4
- import { ImageIcon } from '../components/ImageIcon';
5
- import { getUnresolvedEmbedCardImage } from '../utils';
6
- import { di } from 'react-magnetic-di';
7
- /**
8
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
9
- * @deprecated Replaced by forbidden-view
10
- */
11
- export const EmbedCardForbiddenView = ({
12
- link,
13
- context,
14
- isSelected,
15
- testId = 'embed-card-forbidden-view',
16
- onAuthorise,
17
- inheritDimensions,
18
- onClick,
19
- requestAccessContext = {}
20
- }) => {
21
- var _action$promise;
22
- const icon = context && context.icon && /*#__PURE__*/React.createElement(ImageIcon, {
23
- src: typeof context.icon === 'string' ? context.icon : undefined
24
- });
25
- const {
26
- descriptiveMessageKey,
27
- callToActionMessageKey,
28
- action
29
- } = requestAccessContext;
30
- const onEmbedCardClick = (_action$promise = action === null || action === void 0 ? void 0 : action.promise) !== null && _action$promise !== void 0 ? _action$promise : onAuthorise;
31
- let showButton = true;
32
- /**
33
- * if there is a request access context, but no action to perform, do not show any button.
34
- * By default, a "Try another account" button shows, but with request access context, we don't
35
- * want to encourage users to try another account, if their request is already pending, etc.
36
- */
37
- if (!callToActionMessageKey && descriptiveMessageKey) {
38
- showButton = false;
39
- }
40
- const descriptionKey = descriptiveMessageKey !== null && descriptiveMessageKey !== void 0 ? descriptiveMessageKey : 'invalid_permissions_description';
41
- const buttonTextKey = callToActionMessageKey !== null && callToActionMessageKey !== void 0 ? callToActionMessageKey : 'try_another_account';
42
- let buttonProps;
43
- if (showButton) {
44
- buttonProps = {
45
- appearance: 'default',
46
- text: buttonTextKey,
47
- testId: (action === null || action === void 0 ? void 0 : action.id) || 'connect-other-account'
48
- };
49
- }
50
- return /*#__PURE__*/React.createElement(ExpandedFrame, {
51
- href: link,
52
- icon: icon,
53
- text: context && context.text,
54
- frameStyle: "show",
55
- isSelected: isSelected,
56
- inheritDimensions: inheritDimensions,
57
- onClick: onClick,
58
- testId: testId,
59
- allowScrollBar: true
60
- }, /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
61
- image: getUnresolvedEmbedCardImage('forbidden'),
62
- title: "invalid_permissions",
63
- description: descriptionKey,
64
- context: context && context.text,
65
- button: buttonProps,
66
- onClick: onEmbedCardClick,
67
- testId: testId
68
- }));
69
- };
@@ -1,39 +0,0 @@
1
- import React from 'react';
2
- import { EmbedCardUnresolvedView } from './UnresolvedView';
3
- import { ExpandedFrame } from '../components/ExpandedFrame';
4
- import { ImageIcon } from '../components/ImageIcon';
5
- import { getUnresolvedEmbedCardImage } from '../utils';
6
- import { di } from 'react-magnetic-di';
7
- /**
8
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
9
- * @deprecated Replaced by not-found-view
10
- */
11
- export const EmbedCardNotFoundView = ({
12
- link,
13
- context,
14
- isSelected,
15
- inheritDimensions,
16
- testId = 'embed-card-not-found-view',
17
- onClick
18
- }) => {
19
- const icon = context && context.icon && /*#__PURE__*/React.createElement(ImageIcon, {
20
- src: typeof context.icon === 'string' ? context.icon : undefined
21
- });
22
- return /*#__PURE__*/React.createElement(ExpandedFrame, {
23
- href: link,
24
- icon: icon,
25
- text: context && context.text,
26
- frameStyle: "show",
27
- isSelected: isSelected,
28
- inheritDimensions: inheritDimensions,
29
- onClick: onClick,
30
- testId: testId,
31
- allowScrollBar: true
32
- }, /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
33
- image: getUnresolvedEmbedCardImage('notFound'),
34
- title: "not_found_title",
35
- description: "not_found_description",
36
- context: context && context.text,
37
- testId: testId
38
- }));
39
- };
@@ -1,77 +0,0 @@
1
- import React, { useCallback, useMemo } from 'react';
2
- import { di } from 'react-magnetic-di';
3
- import { EmbedCardUnresolvedView } from './UnresolvedView';
4
- import { ExpandedFrame } from '../components/ExpandedFrame';
5
- import { ImageIcon } from '../components/ImageIcon';
6
- import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
7
- import { getUnresolvedEmbedCardImage } from '../utils';
8
- /**
9
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}\
10
- * @deprecated Replaced by unauthorized-view
11
- */
12
- export const EmbedCardUnauthorisedView = ({
13
- analytics,
14
- link,
15
- context,
16
- isSelected,
17
- testId = 'embed-card-unauthorized-view',
18
- onAuthorise,
19
- inheritDimensions,
20
- onClick,
21
- extensionKey,
22
- isProductIntegrationSupported
23
- }) => {
24
- const icon = context && context.icon && /*#__PURE__*/React.createElement(ImageIcon, {
25
- src: typeof context.icon === 'string' ? context.icon : undefined
26
- });
27
- const handleOnAuthorizeClick = useCallback(() => {
28
- if (onAuthorise) {
29
- analytics.track.appAccountAuthStarted({
30
- extensionKey: extensionKey
31
- });
32
- onAuthorise();
33
- }
34
- }, [onAuthorise, analytics.track, extensionKey]);
35
- const view = useMemo(() => {
36
- var _context$image2;
37
- if (onAuthorise) {
38
- var _context$image;
39
- return /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
40
- button: {
41
- appearance: 'primary',
42
- text: 'connect_unauthorised_account_action',
43
- testId: 'connect-account'
44
- },
45
- context: context && context.text,
46
- description: "connect_unauthorised_account_description",
47
- image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : getUnresolvedEmbedCardImage('unauthorized'),
48
- onClick: handleOnAuthorizeClick,
49
- testId: testId,
50
- title: "connect_link_account_card_name"
51
- }, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
52
- analytics: analytics,
53
- providerName: context === null || context === void 0 ? void 0 : context.text,
54
- isProductIntegrationSupported: isProductIntegrationSupported,
55
- testId: testId
56
- }));
57
- }
58
- return /*#__PURE__*/React.createElement(EmbedCardUnresolvedView, {
59
- description: context !== null && context !== void 0 && context.text ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider',
60
- image: (_context$image2 = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image2 !== void 0 ? _context$image2 : getUnresolvedEmbedCardImage('forbidden'),
61
- context: context === null || context === void 0 ? void 0 : context.text,
62
- testId: testId,
63
- title: context !== null && context !== void 0 && context.text ? 'unauthorised_account_name' : 'unauthorised_account_name_no_provider'
64
- });
65
- }, [analytics, context, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorise, testId]);
66
- return /*#__PURE__*/React.createElement(ExpandedFrame, {
67
- href: link,
68
- icon: icon,
69
- text: context && context.text,
70
- frameStyle: "show",
71
- isSelected: isSelected,
72
- inheritDimensions: inheritDimensions,
73
- onClick: onClick,
74
- testId: testId,
75
- allowScrollBar: true
76
- }, view);
77
- };
@@ -1,75 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["testId"];
5
- import React, { useMemo } from 'react';
6
- import { R300 } from '@atlaskit/theme/colors';
7
- import { messages } from '../../../../messages';
8
- import LockIcon from '@atlaskit/icon/glyph/lock-filled';
9
- import { ForbiddenAction } from '../../actions/flexible/ForbiddenAction';
10
- import Text from '../../../FlexibleCard/components/elements/text';
11
- import { getForbiddenJsonLd } from '../../../../utils/jsonld';
12
- import { extractProvider } from '@atlaskit/link-extractors';
13
- import { extractRequestAccessContext } from '../../../../extractors/common/context';
14
- import UnresolvedView from './unresolved-view';
15
- import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
16
-
17
- /**
18
- * @private
19
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
20
- * @deprecated Replaced by FlexibleForbiddenView
21
- */
22
- var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
23
- var _details$meta;
24
- var _ref$testId = _ref.testId,
25
- testId = _ref$testId === void 0 ? 'smart-block-forbidden-view' : _ref$testId,
26
- props = _objectWithoutProperties(_ref, _excluded);
27
- var cardState = props.cardState,
28
- onAuthorize = props.onAuthorize,
29
- url = props.url;
30
- var details = cardState === null || cardState === void 0 ? void 0 : cardState.details;
31
- var cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : getForbiddenJsonLd().meta;
32
- var provider = extractProvider(details === null || details === void 0 ? void 0 : details.data);
33
- var providerName = (provider === null || provider === void 0 ? void 0 : provider.text) || '';
34
- var requestAccessContext = extractRequestAccessContext({
35
- jsonLd: cardMetadata,
36
- url: url,
37
- context: providerName
38
- });
39
- var descriptiveMessageKey = requestAccessContext && requestAccessContext.descriptiveMessageKey ? requestAccessContext.descriptiveMessageKey : 'invalid_permissions_description';
40
- var actions = useMemo(function () {
41
- var actionFromAccessContext = [];
42
- var tryAnotherAccountAction = onAuthorize ? [ForbiddenAction(onAuthorize, 'try_another_account')] : [];
43
- if (requestAccessContext) {
44
- var action = requestAccessContext.action,
45
- callToActionMessageKey = requestAccessContext.callToActionMessageKey;
46
- actionFromAccessContext = action && callToActionMessageKey ? [ForbiddenAction(action.promise, callToActionMessageKey, {
47
- context: providerName
48
- })] : [];
49
- }
50
- return [].concat(tryAnotherAccountAction, _toConsumableArray(actionFromAccessContext));
51
- }, [onAuthorize, requestAccessContext, providerName]);
52
- return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
53
- actions: actions,
54
- testId: testId
55
- }), /*#__PURE__*/React.createElement(LockIcon, {
56
- label: "forbidden-lock-icon",
57
- size: "small",
58
- primaryColor: "var(--ds-icon-danger, ".concat(R300, ")"),
59
- testId: "".concat(testId, "-lock-icon")
60
- }), /*#__PURE__*/React.createElement(Text, {
61
- message: {
62
- descriptor: messages[descriptiveMessageKey],
63
- values: {
64
- context: providerName
65
- }
66
- }
67
- }));
68
- };
69
-
70
- /**
71
- * @private
72
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
73
- * @deprecated Replaced by FlexibleForbiddenView
74
- */
75
- export default withFlexibleUIBlockCardStyle(FlexibleForbiddenView);
@@ -1,42 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["testId"];
4
- import React from 'react';
5
- import { messages } from '../../../../messages';
6
- import WarningIcon from '@atlaskit/icon/glyph/warning';
7
- import { R300 } from '@atlaskit/theme/colors';
8
- import Text from '../../../FlexibleCard/components/elements/text';
9
- import UnresolvedView from './unresolved-view';
10
- import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
11
-
12
- /**
13
- * This view represents a Block Card with a 'Not_Found' status.
14
- *
15
- * @see SmartLinkStatus
16
- * @see FlexibleCardProps
17
- */
18
- var FlexibleNotFoundViewOld = function FlexibleNotFoundViewOld(_ref) {
19
- var _ref$testId = _ref.testId,
20
- testId = _ref$testId === void 0 ? 'smart-block-not-found-view' : _ref$testId,
21
- props = _objectWithoutProperties(_ref, _excluded);
22
- return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
23
- testId: testId
24
- }), /*#__PURE__*/React.createElement(WarningIcon, {
25
- label: "not-found-warning-icon",
26
- size: "small",
27
- primaryColor: "var(--ds-icon-warning, ".concat(R300, ")"),
28
- testId: "".concat(testId, "-warning-icon")
29
- }), /*#__PURE__*/React.createElement(Text, {
30
- message: {
31
- descriptor: messages.not_found_description
32
- },
33
- testId: "".concat(testId, "-message")
34
- }));
35
- };
36
-
37
- /**
38
- * @private
39
- * @deprecated {@link https://product-fabric.atlassian.net/browse/EDM-7977 Internal documentation for deprecation (no external access)}
40
- * @deprecated Replaced by FlexibleNotFoundView
41
- */
42
- export default withFlexibleUIBlockCardStyle(FlexibleNotFoundViewOld);