@atlaskit/smart-card 36.8.2 → 36.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/cjs/constants.js +2 -0
- package/dist/cjs/extractors/common/context/index.js +41 -1
- package/dist/cjs/extractors/common/icon/extractIconFromDocument.js +7 -61
- package/dist/cjs/extractors/embed/index.js +3 -35
- package/dist/cjs/extractors/flexible/extract-preview.js +24 -2
- package/dist/cjs/extractors/flexible/icon/extract-provider-icon.js +40 -2
- package/dist/cjs/extractors/flexible/icon/index.js +15 -1
- package/dist/cjs/extractors/flexible/index.js +78 -3
- package/dist/cjs/extractors/flexible/utils.js +4 -1
- package/dist/cjs/extractors/inline/index.js +5 -1
- package/dist/cjs/messages.js +4 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +12 -260
- package/dist/cjs/utils/mocks.js +12 -2
- package/dist/cjs/view/BlockCard/views/ErroredView.js +1 -12
- package/dist/cjs/view/BlockCard/views/ForbiddenView.js +2 -11
- package/dist/cjs/view/BlockCard/views/NotFoundView.js +5 -15
- package/dist/cjs/view/BlockCard/views/UnauthorisedView.js +3 -3
- package/dist/cjs/view/BlockCard/views/utils/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -5
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.js +12 -36
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +4 -17
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +2 -10
- package/dist/cjs/view/FlexibleCard/components/elements/applied-to-components-count/index.js +35 -0
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +7 -0
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +14 -7
- package/dist/cjs/view/FlexibleCard/utils.js +21 -10
- package/dist/cjs/view/HoverCard/components/views/resolving/index.js +5 -18
- package/dist/cjs/view/InlineCard/ErroredView/index.js +5 -15
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +1 -7
- package/dist/cjs/view/InlineCard/Icon.compiled.css +0 -1
- package/dist/cjs/view/InlineCard/Icon.js +4 -24
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +7 -15
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +2 -2
- package/dist/es2019/constants.js +2 -0
- package/dist/es2019/extractors/common/context/index.js +36 -1
- package/dist/es2019/extractors/common/icon/extractIconFromDocument.js +6 -61
- package/dist/es2019/extractors/embed/index.js +2 -35
- package/dist/es2019/extractors/flexible/extract-preview.js +25 -2
- package/dist/es2019/extractors/flexible/icon/extract-provider-icon.js +42 -2
- package/dist/es2019/extractors/flexible/icon/index.js +14 -0
- package/dist/es2019/extractors/flexible/index.js +77 -6
- package/dist/es2019/extractors/flexible/utils.js +1 -0
- package/dist/es2019/extractors/inline/index.js +5 -1
- package/dist/es2019/messages.js +4 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +5 -56
- package/dist/es2019/utils/mocks.js +13 -2
- package/dist/es2019/view/BlockCard/views/ErroredView.js +1 -12
- package/dist/es2019/view/BlockCard/views/ForbiddenView.js +3 -12
- package/dist/es2019/view/BlockCard/views/NotFoundView.js +8 -16
- package/dist/es2019/view/BlockCard/views/UnauthorisedView.js +4 -4
- package/dist/es2019/view/BlockCard/views/utils/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +4 -6
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.js +11 -33
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +5 -18
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +2 -10
- package/dist/es2019/view/FlexibleCard/components/elements/applied-to-components-count/index.js +26 -0
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +8 -0
- package/dist/es2019/view/FlexibleCard/utils.js +19 -11
- package/dist/es2019/view/HoverCard/components/views/resolving/index.js +5 -18
- package/dist/es2019/view/InlineCard/ErroredView/index.js +5 -15
- package/dist/es2019/view/InlineCard/ForbiddenView/index.js +2 -8
- package/dist/es2019/view/InlineCard/Icon.compiled.css +0 -1
- package/dist/es2019/view/InlineCard/Icon.js +0 -19
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +8 -16
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +1 -1
- package/dist/esm/constants.js +2 -0
- package/dist/esm/extractors/common/context/index.js +38 -1
- package/dist/esm/extractors/common/icon/extractIconFromDocument.js +6 -61
- package/dist/esm/extractors/embed/index.js +2 -34
- package/dist/esm/extractors/flexible/extract-preview.js +25 -2
- package/dist/esm/extractors/flexible/icon/extract-provider-icon.js +41 -2
- package/dist/esm/extractors/flexible/icon/index.js +14 -0
- package/dist/esm/extractors/flexible/index.js +78 -6
- package/dist/esm/extractors/flexible/utils.js +3 -0
- package/dist/esm/extractors/inline/index.js +5 -1
- package/dist/esm/messages.js +4 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +10 -160
- package/dist/esm/utils/mocks.js +12 -2
- package/dist/esm/view/BlockCard/views/ErroredView.js +1 -12
- package/dist/esm/view/BlockCard/views/ForbiddenView.js +3 -12
- package/dist/esm/view/BlockCard/views/NotFoundView.js +6 -16
- package/dist/esm/view/BlockCard/views/UnauthorisedView.js +4 -4
- package/dist/esm/view/BlockCard/views/utils/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -5
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.js +11 -33
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +5 -18
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +2 -10
- package/dist/esm/view/FlexibleCard/components/elements/applied-to-components-count/index.js +25 -0
- package/dist/esm/view/FlexibleCard/components/elements/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +14 -7
- package/dist/esm/view/FlexibleCard/utils.js +19 -11
- package/dist/esm/view/HoverCard/components/views/resolving/index.js +5 -18
- package/dist/esm/view/InlineCard/ErroredView/index.js +5 -15
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +2 -8
- package/dist/esm/view/InlineCard/Icon.compiled.css +0 -1
- package/dist/esm/view/InlineCard/Icon.js +3 -23
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +8 -16
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +1 -1
- package/dist/types/__fixtures__/compass-scorecard.d.ts +44 -0
- package/dist/types/__fixtures__/figma-entity.d.ts +58 -0
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/extractors/common/context/index.d.ts +8 -0
- package/dist/types/extractors/flexible/extract-preview.d.ts +5 -0
- package/dist/types/extractors/flexible/icon/extract-provider-icon.d.ts +5 -0
- package/dist/types/extractors/flexible/icon/index.d.ts +13 -0
- package/dist/types/extractors/flexible/index.d.ts +1 -1
- package/dist/types/extractors/flexible/utils.d.ts +1 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolving/index.d.ts +2 -6
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +8 -1
- package/dist/types/view/FlexibleCard/components/common/loading-skeleton/index.d.ts +2 -4
- package/dist/types/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +1 -17
- package/dist/types/view/FlexibleCard/components/elements/applied-to-components-count/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/elements/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/types.d.ts +2 -2
- package/dist/types/view/FlexibleCard/utils.d.ts +2 -2
- package/dist/types/view/InlineCard/Icon.d.ts +0 -1
- package/dist/types-ts4.5/__fixtures__/compass-scorecard.d.ts +44 -0
- package/dist/types-ts4.5/__fixtures__/figma-entity.d.ts +58 -0
- package/dist/types-ts4.5/constants.d.ts +2 -0
- package/dist/types-ts4.5/extractors/common/context/index.d.ts +8 -0
- package/dist/types-ts4.5/extractors/flexible/extract-preview.d.ts +5 -0
- package/dist/types-ts4.5/extractors/flexible/icon/extract-provider-icon.d.ts +5 -0
- package/dist/types-ts4.5/extractors/flexible/icon/index.d.ts +13 -0
- package/dist/types-ts4.5/extractors/flexible/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/utils.d.ts +1 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +6 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolving/index.d.ts +2 -6
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +8 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/common/loading-skeleton/index.d.ts +2 -4
- package/dist/types-ts4.5/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +1 -17
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/applied-to-components-count/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/utils.d.ts +2 -2
- package/dist/types-ts4.5/view/InlineCard/Icon.d.ts +0 -1
- package/package.json +6 -6
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +0 -55
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +0 -55
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +0 -55
|
@@ -3,9 +3,6 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["testId"];
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import WarningIcon from '@atlaskit/icon/core/migration/warning';
|
|
6
|
-
import LegacyWarningIcon from '@atlaskit/icon/glyph/warning';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
-
import { R300 } from '@atlaskit/theme/colors';
|
|
9
6
|
import { messages } from '../../../messages';
|
|
10
7
|
import Text from '../../FlexibleCard/components/elements/text';
|
|
11
8
|
import { RetryAction } from '../actions/RetryAction';
|
|
@@ -28,19 +25,11 @@ var ErroredView = function ErroredView(_ref) {
|
|
|
28
25
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
|
|
29
26
|
actions: actions,
|
|
30
27
|
testId: testId
|
|
31
|
-
}),
|
|
28
|
+
}), /*#__PURE__*/React.createElement(WarningIcon, {
|
|
32
29
|
label: "errored-warning-icon",
|
|
33
30
|
color: "var(--ds-icon-warning, #E56910)",
|
|
34
31
|
LEGACY_size: "small",
|
|
35
32
|
testId: "".concat(testId, "-warning-icon")
|
|
36
|
-
}) :
|
|
37
|
-
/*#__PURE__*/
|
|
38
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19497
|
|
39
|
-
React.createElement(LegacyWarningIcon, {
|
|
40
|
-
label: "errored-warning-icon",
|
|
41
|
-
size: "small",
|
|
42
|
-
primaryColor: "var(--ds-icon-warning, ".concat(R300, ")"),
|
|
43
|
-
testId: "".concat(testId, "-warning-icon")
|
|
44
33
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
45
34
|
maxLines: 3,
|
|
46
35
|
message: {
|
|
@@ -11,9 +11,8 @@ import { useIntl } from 'react-intl-next';
|
|
|
11
11
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
12
|
import LockLockedIcon from '@atlaskit/icon/core/lock-locked';
|
|
13
13
|
import LegacyLockIcon from '@atlaskit/icon/glyph/lock';
|
|
14
|
-
import { extractProvider } from '@atlaskit/link-extractors';
|
|
14
|
+
import { extractProvider, extractSmartLinkProvider } from '@atlaskit/link-extractors';
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
|
-
import { R300 } from '@atlaskit/theme/colors';
|
|
17
16
|
import { extractRequestAccessContextImproved } from '../../../extractors/common/context/extractAccessContext';
|
|
18
17
|
import extractHostname from '../../../extractors/common/hostname/extractHostname';
|
|
19
18
|
import { messages } from '../../../messages';
|
|
@@ -45,7 +44,7 @@ var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
45
44
|
url = props.url;
|
|
46
45
|
var details = cardState === null || cardState === void 0 ? void 0 : cardState.details;
|
|
47
46
|
var cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : getForbiddenJsonLd().meta;
|
|
48
|
-
var provider = extractProvider(details === null || details === void 0 ? void 0 : details.data);
|
|
47
|
+
var provider = fg('smart_links_noun_support') ? extractSmartLinkProvider(details) : extractProvider(details === null || details === void 0 ? void 0 : details.data);
|
|
49
48
|
var providerName = (provider === null || provider === void 0 ? void 0 : provider.text) || '';
|
|
50
49
|
var messageContext = useMemo(function () {
|
|
51
50
|
var hostname = /*#__PURE__*/React.createElement("b", null, extractHostname(url));
|
|
@@ -83,20 +82,12 @@ var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
83
82
|
showPreview: true,
|
|
84
83
|
testId: testId,
|
|
85
84
|
title: title
|
|
86
|
-
}),
|
|
85
|
+
}), /*#__PURE__*/React.createElement(LockLockedIcon, {
|
|
87
86
|
label: "forbidden-lock-icon",
|
|
88
87
|
color: "var(--ds-icon-danger, #C9372C)",
|
|
89
88
|
LEGACY_fallbackIcon: LegacyLockIcon,
|
|
90
89
|
LEGACY_size: "small",
|
|
91
90
|
testId: "".concat(testId, "-lock-icon")
|
|
92
|
-
}) :
|
|
93
|
-
/*#__PURE__*/
|
|
94
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19497
|
|
95
|
-
React.createElement(LegacyLockIcon, {
|
|
96
|
-
label: "forbidden-lock-icon",
|
|
97
|
-
size: "small",
|
|
98
|
-
primaryColor: "var(--ds-icon-danger, ".concat(R300, ")"),
|
|
99
|
-
testId: "".concat(testId, "-lock-icon")
|
|
100
91
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
101
92
|
maxLines: 3,
|
|
102
93
|
message: {
|
|
@@ -9,9 +9,8 @@ import { useMemo } from 'react';
|
|
|
9
9
|
import { useIntl } from 'react-intl-next';
|
|
10
10
|
import LockLockedIcon from '@atlaskit/icon/core/lock-locked';
|
|
11
11
|
import LegacyLockIcon from '@atlaskit/icon/glyph/lock';
|
|
12
|
-
import { extractProvider } from '@atlaskit/link-extractors';
|
|
12
|
+
import { extractProvider, extractSmartLinkProvider } from '@atlaskit/link-extractors';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
-
import { R300 } from '@atlaskit/theme/colors';
|
|
15
14
|
import { messages } from '../../../messages';
|
|
16
15
|
import Text from '../../FlexibleCard/components/elements/text';
|
|
17
16
|
import UnresolvedView from './unresolved-view';
|
|
@@ -25,17 +24,16 @@ var textStyles = null;
|
|
|
25
24
|
* @see FlexibleCardProps
|
|
26
25
|
*/
|
|
27
26
|
var NotFoundView = function NotFoundView(_ref) {
|
|
28
|
-
var _cardState$details2;
|
|
29
27
|
var _ref$testId = _ref.testId,
|
|
30
28
|
testId = _ref$testId === void 0 ? 'smart-block-not-found-view' : _ref$testId,
|
|
31
29
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
32
30
|
var intl = useIntl();
|
|
33
|
-
var
|
|
31
|
+
var details = props.cardState.details;
|
|
34
32
|
var product = useMemo(function () {
|
|
35
|
-
var
|
|
36
|
-
var provider =
|
|
33
|
+
var _provider$text;
|
|
34
|
+
var provider = fg('smart_links_noun_support') ? extractSmartLinkProvider(details) : extractProvider(details === null || details === void 0 ? void 0 : details.data);
|
|
37
35
|
return (_provider$text = provider === null || provider === void 0 ? void 0 : provider.text) !== null && _provider$text !== void 0 ? _provider$text : '';
|
|
38
|
-
}, [
|
|
36
|
+
}, [details]);
|
|
39
37
|
var title = useMemo(function () {
|
|
40
38
|
return intl.formatMessage(messages.not_found_title, {
|
|
41
39
|
product: product
|
|
@@ -49,20 +47,12 @@ var NotFoundView = function NotFoundView(_ref) {
|
|
|
49
47
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
|
|
50
48
|
testId: testId,
|
|
51
49
|
title: title
|
|
52
|
-
}),
|
|
50
|
+
}), /*#__PURE__*/React.createElement(LockLockedIcon, {
|
|
53
51
|
label: "not-found-lock-icon",
|
|
54
52
|
color: "var(--ds-icon-danger, #C9372C)",
|
|
55
53
|
LEGACY_fallbackIcon: LegacyLockIcon,
|
|
56
54
|
LEGACY_size: "small",
|
|
57
55
|
testId: "".concat(testId, "-lock-icon")
|
|
58
|
-
}) :
|
|
59
|
-
/*#__PURE__*/
|
|
60
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19497
|
|
61
|
-
React.createElement(LegacyLockIcon, {
|
|
62
|
-
label: "not-found-lock-icon",
|
|
63
|
-
size: "small",
|
|
64
|
-
primaryColor: "var(--ds-icon-danger, ".concat(R300, ")"),
|
|
65
|
-
testId: "".concat(testId, "-lock-icon")
|
|
66
56
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
67
57
|
message: description,
|
|
68
58
|
testId: "".concat(testId, "-message"),
|
|
@@ -7,7 +7,7 @@ import * as React from 'react';
|
|
|
7
7
|
import { ax, ix } from "@compiled/react/runtime";
|
|
8
8
|
import { useCallback, useMemo } from 'react';
|
|
9
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
10
|
-
import { extractProvider } from '@atlaskit/link-extractors';
|
|
10
|
+
import { extractProvider, extractSmartLinkProvider } from '@atlaskit/link-extractors';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
13
13
|
import { messages } from '../../../messages';
|
|
@@ -27,15 +27,15 @@ var contentStyles = null;
|
|
|
27
27
|
* @see FlexibleCardProps
|
|
28
28
|
*/
|
|
29
29
|
var UnauthorisedView = function UnauthorisedView(_ref) {
|
|
30
|
-
var _cardState$details, _extractProvider;
|
|
30
|
+
var _cardState$details, _extractSmartLinkProv, _extractProvider;
|
|
31
31
|
var _ref$testId = _ref.testId,
|
|
32
32
|
testId = _ref$testId === void 0 ? 'smart-block-unauthorized-view' : _ref$testId,
|
|
33
33
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
34
34
|
var cardState = props.cardState,
|
|
35
35
|
onAuthorize = props.onAuthorize;
|
|
36
36
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
37
|
-
var providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
38
|
-
var isProductIntegrationSupported = hasAuthScopeOverrides(cardState
|
|
37
|
+
var providerName = fg('smart_links_noun_support') ? (_extractSmartLinkProv = extractSmartLinkProvider(cardState.details)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text : (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
38
|
+
var isProductIntegrationSupported = hasAuthScopeOverrides(cardState.details);
|
|
39
39
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
40
40
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
41
41
|
var handleAuthorize = useCallback(function () {
|
|
@@ -65,7 +65,9 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
|
|
|
65
65
|
}, {
|
|
66
66
|
name: ElementName.OwnedBy
|
|
67
67
|
}].concat(baseTopMetadata) : defaultTopMetadata,
|
|
68
|
-
bottomMetadata:
|
|
68
|
+
bottomMetadata: [{
|
|
69
|
+
name: ElementName.AppliedToComponentsCount
|
|
70
|
+
}].concat(baseBottomMetaData)
|
|
69
71
|
};
|
|
70
72
|
} else {
|
|
71
73
|
return {
|
|
@@ -5,7 +5,6 @@ var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "t
|
|
|
5
5
|
import "./index.compiled.css";
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { ax, ix } from "@compiled/react/runtime";
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkPosition, SmartLinkWidth } from '../../../../../../constants';
|
|
10
9
|
import { LinkIcon } from '../../../elements';
|
|
11
10
|
import Block from '../../block';
|
|
@@ -37,12 +36,11 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
37
36
|
var subtitleElements = renderElementItems(subtitle);
|
|
38
37
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
39
38
|
testId: "".concat(testId, "-resolved-view")
|
|
40
|
-
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon,
|
|
39
|
+
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
41
40
|
overrideIcon: icon,
|
|
42
|
-
position: position
|
|
43
|
-
}, fg('platform-smart-card-icon-migration') && {
|
|
41
|
+
position: position,
|
|
44
42
|
size: size
|
|
45
|
-
})
|
|
43
|
+
}), /*#__PURE__*/React.createElement(ElementGroup, {
|
|
46
44
|
direction: SmartLinkDirection.Vertical,
|
|
47
45
|
width: SmartLinkWidth.Flexible,
|
|
48
46
|
size: blockProps.size,
|
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
3
|
var _excluded = ["actionGroup", "testId", "title", "hideIcon"];
|
|
5
|
-
import "./index.compiled.css";
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
8
4
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
9
|
-
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
import React from 'react';
|
|
11
6
|
import { SmartLinkSize } from '../../../../../../constants';
|
|
12
|
-
import {
|
|
7
|
+
import { LoadingSkeleton } from '../../../common/loading-skeleton';
|
|
13
8
|
import { getIconWidthNew } from '../../../utils';
|
|
14
9
|
import Block from '../../block';
|
|
15
|
-
var iconStyle = {
|
|
16
|
-
xlarge: "_16jlidpf _1o9zidpf _i0dl1wug _4t3iviql _1tkeviql _c71lviql _1bsbviql _1ul9viql _p12fviql _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna7viql _1xjxviql _1752viql _qci8viql _15izviql _erubviql _19l3viql _1pr2viql _1u5tviql _mezjviql _e2ooviql _w8l5viql _1rg2viql _q7cvviql _xwbjviql _rtysviql _b8nkviql _4x20viql",
|
|
17
|
-
large: "_16jlidpf _1o9zidpf _i0dl1wug _4t3i1k8s _1tke1k8s _c71l1k8s _1bsb1k8s _1ul91k8s _p12f1k8s _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna71k8s _1xjx1k8s _17521k8s _qci81k8s _15iz1k8s _erub1k8s _19l31k8s _1pr21k8s _1u5t1k8s _mezj1k8s _e2oo1k8s _w8l51k8s _1rg21k8s _q7cv1k8s _xwbj1k8s _rtys1k8s _b8nk1k8s _4x201k8s",
|
|
18
|
-
medium: "_16jlidpf _1o9zidpf _i0dl1wug _4t3i1j6v _1tke1j6v _c71l1j6v _1bsb1j6v _1ul91j6v _p12f1j6v _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna71j6v _1xjx1j6v _17521j6v _qci81j6v _15iz1j6v _erub1j6v _19l31j6v _1pr21j6v _1u5t1j6v _mezj1j6v _e2oo1j6v _w8l51j6v _1rg21j6v _q7cv1j6v _xwbj1j6v _rtys1j6v _b8nk1j6v _4x201j6v",
|
|
19
|
-
small: "_16jlidpf _1o9zidpf _i0dl1wug _4t3ioqnp _1tkeoqnp _c71loqnp _1bsboqnp _1ul9oqnp _p12foqnp _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna7oqnp _1xjxoqnp _1752oqnp _qci8oqnp _15izoqnp _eruboqnp _19l3oqnp _1pr2oqnp _1u5toqnp _mezjoqnp _e2oooqnp _w8l5oqnp _1rg2oqnp _q7cvoqnp _xwbjoqnp _rtysoqnp _b8nkoqnp _4x20oqnp"
|
|
20
|
-
};
|
|
21
|
-
|
|
22
10
|
/**
|
|
23
11
|
* This represents a TitleBlock for a Smart Link that is currently waiting
|
|
24
12
|
* for a request to finish.
|
|
@@ -33,28 +21,18 @@ var TitleBlockResolvingView = function TitleBlockResolvingView(_ref) {
|
|
|
33
21
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
34
22
|
var _blockProps$size = blockProps.size,
|
|
35
23
|
size = _blockProps$size === void 0 ? SmartLinkSize.Medium : _blockProps$size;
|
|
36
|
-
|
|
37
|
-
var iconWidth = getIconWidthNew(size);
|
|
38
|
-
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
39
|
-
testId: "".concat(testId, "-resolving-view")
|
|
40
|
-
}), !hideIcon && /*#__PURE__*/React.createElement("span", {
|
|
41
|
-
style: {
|
|
42
|
-
width: iconWidth,
|
|
43
|
-
height: iconWidth
|
|
44
|
-
},
|
|
45
|
-
"data-testid": "".concat(testId, "-icon")
|
|
46
|
-
}, /*#__PURE__*/React.createElement(LoadingSkeletonNew, {
|
|
47
|
-
width: iconWidth,
|
|
48
|
-
height: iconWidth,
|
|
49
|
-
testId: "".concat(testId, "-icon-loading")
|
|
50
|
-
})), title, actionGroup);
|
|
51
|
-
}
|
|
24
|
+
var iconWidth = getIconWidthNew(size);
|
|
52
25
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
53
26
|
testId: "".concat(testId, "-resolving-view")
|
|
54
27
|
}), !hideIcon && /*#__PURE__*/React.createElement("span", {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
28
|
+
style: {
|
|
29
|
+
width: iconWidth,
|
|
30
|
+
height: iconWidth
|
|
31
|
+
},
|
|
32
|
+
"data-testid": "".concat(testId, "-icon")
|
|
33
|
+
}, /*#__PURE__*/React.createElement(LoadingSkeleton, {
|
|
34
|
+
width: iconWidth,
|
|
35
|
+
height: iconWidth,
|
|
58
36
|
testId: "".concat(testId, "-icon-loading")
|
|
59
37
|
})), title, actionGroup);
|
|
60
38
|
};
|
|
@@ -13,7 +13,7 @@ import ElementGroup from './element-group';
|
|
|
13
13
|
|
|
14
14
|
// Determine whether the element can be display as inline/block.
|
|
15
15
|
|
|
16
|
-
export var ElementDisplaySchema = (_ElementDisplaySchema = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ElementDisplaySchema, ElementName.AssignedTo, ['inline']), ElementName.AssignedToGroup, ['inline']), ElementName.AttachmentCount, ['inline']), ElementName.AuthorGroup, ['inline']), ElementName.
|
|
16
|
+
export var ElementDisplaySchema = (_ElementDisplaySchema = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ElementDisplaySchema, ElementName.AssignedTo, ['inline']), ElementName.AssignedToGroup, ['inline']), ElementName.AttachmentCount, ['inline']), ElementName.AuthorGroup, ['inline']), ElementName.AppliedToComponentsCount, ['inline']), ElementName.ChecklistProgress, ['inline']), ElementName.CollaboratorGroup, ['inline']), ElementName.CommentCount, ['inline']), ElementName.CreatedBy, ['inline']), ElementName.CreatedOn, ['inline']), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ElementDisplaySchema, ElementName.DueOn, ['inline']), ElementName.LatestCommit, ['inline']), ElementName.LinkIcon, ['inline']), ElementName.Location, ['inline']), ElementName.ModifiedBy, ['inline']), ElementName.ModifiedOn, ['inline']), ElementName.OwnedBy, ['inline']), ElementName.OwnedByGroup, ['inline']), ElementName.Preview, ['block']), ElementName.Priority, ['inline']), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ElementDisplaySchema, ElementName.ProgrammingLanguage, ['inline']), ElementName.Provider, ['inline']), ElementName.ReactCount, ['inline']), ElementName.ReadTime, ['inline']), ElementName.Snippet, ['block']), ElementName.SourceBranch, ['inline']), ElementName.SentOn, ['inline']), ElementName.State, ['inline']), ElementName.SubscriberCount, ['inline']), ElementName.SubTasksProgress, ['inline']), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ElementDisplaySchema, ElementName.StoryPoints, ['inline']), ElementName.TargetBranch, ['inline']), ElementName.Title, ['inline']), ElementName.ViewCount, ['inline']), ElementName.VoteCount, ['inline']));
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Get gap size between elements inside a block
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import ImageLoader from 'react-render-image';
|
|
4
|
-
import {
|
|
5
|
-
import { LoadingSkeletonNew, LoadingSkeletonOld } from '../loading-skeleton';
|
|
3
|
+
import { LoadingSkeleton } from '../loading-skeleton';
|
|
6
4
|
var ImageIcon = function ImageIcon(_ref) {
|
|
7
5
|
var defaultIcon = _ref.defaultIcon,
|
|
8
6
|
testId = _ref.testId,
|
|
@@ -11,10 +9,9 @@ var ImageIcon = function ImageIcon(_ref) {
|
|
|
11
9
|
height = _ref.height,
|
|
12
10
|
onError = _ref.onError,
|
|
13
11
|
onLoad = _ref.onLoad;
|
|
14
|
-
return /*#__PURE__*/React.createElement(ImageLoader,
|
|
15
|
-
src: url
|
|
16
|
-
|
|
17
|
-
loading: /*#__PURE__*/React.createElement(LoadingSkeletonNew, {
|
|
12
|
+
return /*#__PURE__*/React.createElement(ImageLoader, {
|
|
13
|
+
src: url,
|
|
14
|
+
loading: /*#__PURE__*/React.createElement(LoadingSkeleton, {
|
|
18
15
|
testId: "".concat(testId, "-loading"),
|
|
19
16
|
width: width,
|
|
20
17
|
height: height
|
|
@@ -27,20 +24,10 @@ var ImageIcon = function ImageIcon(_ref) {
|
|
|
27
24
|
width: width,
|
|
28
25
|
height: height
|
|
29
26
|
}
|
|
30
|
-
})
|
|
31
|
-
} : {
|
|
32
|
-
loading: /*#__PURE__*/React.createElement(LoadingSkeletonOld, {
|
|
33
|
-
testId: "".concat(testId, "-loading")
|
|
34
27
|
}),
|
|
35
|
-
loaded: /*#__PURE__*/React.createElement("img", {
|
|
36
|
-
src: url,
|
|
37
|
-
"data-testid": "".concat(testId, "-image"),
|
|
38
|
-
alt: ""
|
|
39
|
-
})
|
|
40
|
-
}, {
|
|
41
28
|
errored: defaultIcon,
|
|
42
29
|
onError: onError,
|
|
43
30
|
onLoad: onLoad
|
|
44
|
-
})
|
|
31
|
+
});
|
|
45
32
|
};
|
|
46
33
|
export default ImageIcon;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import "./index.compiled.css";
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
var animationNameStyles = null;
|
|
7
6
|
var loadingSkeletonStyle = null;
|
|
8
|
-
var
|
|
7
|
+
export var LoadingSkeleton = function LoadingSkeleton(_ref) {
|
|
9
8
|
var testId = _ref.testId,
|
|
10
9
|
width = _ref.width,
|
|
11
10
|
height = _ref.height;
|
|
@@ -18,11 +17,4 @@ var LoadingSkeletonNew = function LoadingSkeletonNew(_ref) {
|
|
|
18
17
|
"--_16116mi": ix("linear-gradient( to right, transparent 0%, ".concat("var(--ds-skeleton, #edeef1)", " 20%, transparent 40%, transparent 100% )"))
|
|
19
18
|
}
|
|
20
19
|
});
|
|
21
|
-
};
|
|
22
|
-
var LoadingSkeletonOld = function LoadingSkeletonOld(props) {
|
|
23
|
-
return /*#__PURE__*/React.createElement(LoadingSkeletonNew, _extends({}, props, {
|
|
24
|
-
width: "".concat(props.width, "rem"),
|
|
25
|
-
height: "".concat(props.height, "rem")
|
|
26
|
-
}));
|
|
27
|
-
};
|
|
28
|
-
export { LoadingSkeletonOld, LoadingSkeletonNew };
|
|
20
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import { useIntl } from 'react-intl-next';
|
|
4
|
+
import { IconType } from '../../../../../constants';
|
|
5
|
+
import { messages } from '../../../../../messages';
|
|
6
|
+
import { FlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
7
|
+
import Badge from '../badge';
|
|
8
|
+
var AppliedToComponentsCount = function AppliedToComponentsCount(props) {
|
|
9
|
+
var _useIntl = useIntl(),
|
|
10
|
+
formatMessage = _useIntl.formatMessage;
|
|
11
|
+
var context = useContext(FlexibleUiContext);
|
|
12
|
+
if (
|
|
13
|
+
// Check for null and undefined, render if it's 0.
|
|
14
|
+
(context === null || context === void 0 ? void 0 : context.appliedToComponentsCount) === null || (context === null || context === void 0 ? void 0 : context.appliedToComponentsCount) === undefined) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
var label = formatMessage(messages.compass_applied_components_count, {
|
|
18
|
+
numberOfComponents: context.appliedToComponentsCount
|
|
19
|
+
});
|
|
20
|
+
return /*#__PURE__*/React.createElement(Badge, _extends({
|
|
21
|
+
icon: IconType.Component,
|
|
22
|
+
label: label
|
|
23
|
+
}, props));
|
|
24
|
+
};
|
|
25
|
+
export default AppliedToComponentsCount;
|
|
@@ -173,4 +173,5 @@ export var ViewCount = createElement(ElementName.ViewCount);
|
|
|
173
173
|
* Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
|
|
174
174
|
* @see Badge
|
|
175
175
|
*/
|
|
176
|
-
export var VoteCount = createElement(ElementName.VoteCount);
|
|
176
|
+
export var VoteCount = createElement(ElementName.VoteCount);
|
|
177
|
+
export { default as AppliedToComponentsCount } from './applied-to-components-count';
|
|
@@ -7,6 +7,7 @@ import { FormattedDate } from 'react-intl-next';
|
|
|
7
7
|
import { ElementName, IconType, SmartLinkInternalTheme } from '../../../../constants';
|
|
8
8
|
import { messages } from '../../../../messages';
|
|
9
9
|
import { FlexibleUiContext } from '../../../../state/flexible-ui-context';
|
|
10
|
+
import AppliedToComponentsCount from './applied-to-components-count';
|
|
10
11
|
import AtlaskitBadge from './atlaskit-badge';
|
|
11
12
|
import AvatarGroup from './avatar-group';
|
|
12
13
|
import Badge from './badge';
|
|
@@ -16,7 +17,12 @@ import Link from './link';
|
|
|
16
17
|
import Lozenge from './lozenge';
|
|
17
18
|
import Media from './media';
|
|
18
19
|
import Text from './text';
|
|
19
|
-
var elementMappings = (_elementMappings = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_elementMappings, ElementName.
|
|
20
|
+
var elementMappings = (_elementMappings = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_elementMappings, ElementName.AppliedToComponentsCount, {
|
|
21
|
+
component: AppliedToComponentsCount,
|
|
22
|
+
props: {
|
|
23
|
+
icon: IconType.Component
|
|
24
|
+
}
|
|
25
|
+
}), ElementName.AttachmentCount, {
|
|
20
26
|
component: Badge,
|
|
21
27
|
props: {
|
|
22
28
|
icon: IconType.Attachment
|
|
@@ -52,9 +58,9 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_defineProperty(_d
|
|
|
52
58
|
}
|
|
53
59
|
}), ElementName.CreatedBy, {
|
|
54
60
|
component: Text
|
|
55
|
-
}), ElementName.OwnedBy, {
|
|
61
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_elementMappings, ElementName.OwnedBy, {
|
|
56
62
|
component: Text
|
|
57
|
-
}),
|
|
63
|
+
}), ElementName.AssignedTo, {
|
|
58
64
|
component: Text
|
|
59
65
|
}), ElementName.AssignedToGroup, {
|
|
60
66
|
component: AvatarGroup
|
|
@@ -75,9 +81,9 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_defineProperty(_d
|
|
|
75
81
|
component: Text
|
|
76
82
|
}), ElementName.ModifiedOn, {
|
|
77
83
|
component: DateTime
|
|
78
|
-
}), ElementName.Preview, {
|
|
84
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_elementMappings, ElementName.Preview, {
|
|
79
85
|
component: Media
|
|
80
|
-
}),
|
|
86
|
+
}), ElementName.Priority, {
|
|
81
87
|
component: Badge
|
|
82
88
|
}), ElementName.ProgrammingLanguage, {
|
|
83
89
|
component: Badge,
|
|
@@ -104,9 +110,9 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_defineProperty(_d
|
|
|
104
110
|
props: {
|
|
105
111
|
icon: IconType.SubTasksProgress
|
|
106
112
|
}
|
|
107
|
-
}), ElementName.StoryPoints, {
|
|
113
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_elementMappings, ElementName.StoryPoints, {
|
|
108
114
|
component: AtlaskitBadge
|
|
109
|
-
}),
|
|
115
|
+
}), ElementName.TargetBranch, {
|
|
110
116
|
component: Text
|
|
111
117
|
}), ElementName.Title, {
|
|
112
118
|
component: Link
|
|
@@ -134,6 +140,7 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
134
140
|
var AvatarGroupsWithFallback = [ElementName.AssignedToGroup];
|
|
135
141
|
var showFallbackAvatar = AvatarGroupsWithFallback.includes(elementName);
|
|
136
142
|
return toAvatarGroupProps(data, showFallbackAvatar);
|
|
143
|
+
case ElementName.AppliedToComponentsCount:
|
|
137
144
|
case ElementName.AttachmentCount:
|
|
138
145
|
case ElementName.ChecklistProgress:
|
|
139
146
|
case ElementName.CommentCount:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { extractProvider } from '@atlaskit/link-extractors';
|
|
1
|
+
import { extractProvider, extractSmartLinkProvider, isEntityPresent } from '@atlaskit/link-extractors';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { SmartLinkStatus } from '../../constants';
|
|
4
4
|
import { extractRequestAccessContextImproved } from '../../extractors/common/context';
|
|
5
5
|
import extractFlexibleUiContext from '../../extractors/flexible';
|
|
6
|
-
import extractPreview from '../../extractors/flexible/extract-preview';
|
|
6
|
+
import extractPreview, { extractSmartLinkPreviewImage } from '../../extractors/flexible/extract-preview';
|
|
7
7
|
import { extractErrorIcon } from '../../extractors/flexible/icon';
|
|
8
|
-
import extractProviderIcon from '../../extractors/flexible/icon/extract-provider-icon';
|
|
8
|
+
import extractProviderIcon, { extractSmartLinkProviderIcon } from '../../extractors/flexible/icon/extract-provider-icon';
|
|
9
9
|
import { messages } from '../../messages';
|
|
10
10
|
import { handleOnClick } from '../../utils';
|
|
11
11
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
@@ -29,15 +29,23 @@ export var getContextByStatus = function getContextByStatus(params) {
|
|
|
29
29
|
case SmartLinkStatus.Errored:
|
|
30
30
|
case SmartLinkStatus.Fallback:
|
|
31
31
|
default:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
if (fg('smart_links_noun_support')) {
|
|
33
|
+
if (isEntityPresent(response)) {
|
|
34
|
+
return {
|
|
35
|
+
url: url,
|
|
36
|
+
title: url,
|
|
37
|
+
linkIcon: extractErrorIcon(response, status),
|
|
38
|
+
preview: extractSmartLinkPreviewImage(response),
|
|
39
|
+
provider: extractSmartLinkProviderIcon(response)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
35
43
|
return {
|
|
36
|
-
linkIcon: linkIcon,
|
|
37
|
-
title: url,
|
|
38
44
|
url: url,
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
title: url,
|
|
46
|
+
linkIcon: extractErrorIcon(response, status),
|
|
47
|
+
preview: extractPreview(response === null || response === void 0 ? void 0 : response.data),
|
|
48
|
+
provider: extractProviderIcon(response === null || response === void 0 ? void 0 : response.data)
|
|
41
49
|
};
|
|
42
50
|
}
|
|
43
51
|
};
|
|
@@ -62,7 +70,7 @@ var getForbiddenMessageKey = function getForbiddenMessageKey(meta) {
|
|
|
62
70
|
export var getRetryOptions = function getRetryOptions(url, status, response, onAuthorize) {
|
|
63
71
|
var _response$meta, _access$action, _access$buttonDisable;
|
|
64
72
|
var data = response && response.data || getEmptyJsonLd();
|
|
65
|
-
var provider = extractProvider(data);
|
|
73
|
+
var provider = fg('smart_links_noun_support') ? extractSmartLinkProvider(response) : extractProvider(data);
|
|
66
74
|
var context = provider === null || provider === void 0 ? void 0 : provider.text;
|
|
67
75
|
var values = context ? {
|
|
68
76
|
context: context
|
|
@@ -3,10 +3,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import "./index.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { CustomBlock } from '../../../../FlexibleCard/components/blocks';
|
|
8
7
|
import ActionGroup from '../../../../FlexibleCard/components/blocks/action-group';
|
|
9
|
-
import {
|
|
8
|
+
import { LoadingSkeleton } from '../../../../FlexibleCard/components/common/loading-skeleton';
|
|
10
9
|
import Icon from '../../../../FlexibleCard/components/elements/icon';
|
|
11
10
|
import { CARD_WIDTH_REM } from '../../../styled';
|
|
12
11
|
var loadingViewContainer = null;
|
|
@@ -24,7 +23,6 @@ var HoverCardLoadingView = function HoverCardLoadingView(_ref) {
|
|
|
24
23
|
items: actions,
|
|
25
24
|
visibleButtonsNum: 2
|
|
26
25
|
});
|
|
27
|
-
var LoadingSkeleton = fg('platform-smart-card-icon-migration') ? LoadingSkeletonNew : LoadingSkeletonOld;
|
|
28
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
29
27
|
"data-testid": testId,
|
|
30
28
|
className: ax(["_1e0c1txw _2lx21bp4 _ca0q1e9d _u5f31e9d _n3td1e9d _19bv1e9d"])
|
|
@@ -41,28 +39,17 @@ var HoverCardLoadingView = function HoverCardLoadingView(_ref) {
|
|
|
41
39
|
}), /*#__PURE__*/React.createElement("span", {
|
|
42
40
|
"data-testid": "".concat(testId, "-title"),
|
|
43
41
|
className: ax(["_16jlkb7n _1o9zidpf _i0dl1wug _4t3i1k92 _e2oo1osq"])
|
|
44
|
-
},
|
|
42
|
+
}, /*#__PURE__*/React.createElement(LoadingSkeleton, {
|
|
45
43
|
height: "".concat(lineHeightRem, "rem")
|
|
46
|
-
})
|
|
47
|
-
height: lineHeightRem
|
|
48
|
-
})), actionGroup), fg('platform-smart-card-icon-migration') ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LoadingSkeletonNew, {
|
|
44
|
+
})), actionGroup), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LoadingSkeleton, {
|
|
49
45
|
width: "".concat(skeletonWidth, "rem"),
|
|
50
46
|
height: "".concat(lineHeightRem, "rem")
|
|
51
|
-
}), /*#__PURE__*/React.createElement(
|
|
47
|
+
}), /*#__PURE__*/React.createElement(LoadingSkeleton, {
|
|
52
48
|
width: "".concat(skeletonWidth, "rem"),
|
|
53
49
|
height: "".concat(lineHeightRem * 3, "rem")
|
|
54
|
-
}), /*#__PURE__*/React.createElement(
|
|
50
|
+
}), /*#__PURE__*/React.createElement(LoadingSkeleton, {
|
|
55
51
|
width: "".concat(skeletonWidth, "rem"),
|
|
56
52
|
height: "".concat(lineHeightRem, "rem")
|
|
57
|
-
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LoadingSkeletonOld, {
|
|
58
|
-
width: skeletonWidth,
|
|
59
|
-
height: lineHeightRem
|
|
60
|
-
}), /*#__PURE__*/React.createElement(LoadingSkeletonOld, {
|
|
61
|
-
width: skeletonWidth,
|
|
62
|
-
height: lineHeightRem * 3
|
|
63
|
-
}), /*#__PURE__*/React.createElement(LoadingSkeletonOld, {
|
|
64
|
-
width: skeletonWidth,
|
|
65
|
-
height: lineHeightRem
|
|
66
53
|
}))));
|
|
67
54
|
};
|
|
68
55
|
export default HoverCardLoadingView;
|
|
@@ -8,12 +8,10 @@ import ErrorIconCore from '@atlaskit/icon/core/migration/error';
|
|
|
8
8
|
import ErrorIcon from '@atlaskit/icon/utility/migration/error';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
11
|
-
import { R300 } from '@atlaskit/theme/colors';
|
|
12
11
|
import { messages } from '../../../messages';
|
|
13
12
|
import { HoverCard } from '../../HoverCard';
|
|
14
13
|
import { ActionButton } from '../common/action-button';
|
|
15
14
|
import { Frame } from '../Frame';
|
|
16
|
-
import { AKIconWrapper } from '../Icon';
|
|
17
15
|
import { IconAndTitleLayout } from '../IconAndTitleLayout';
|
|
18
16
|
import { IconStyledButtonOldVisualRefresh } from '../styled';
|
|
19
17
|
import withFrameStyleControl from '../utils/withFrameStyleControl';
|
|
@@ -29,21 +27,13 @@ var fallbackIcon = function fallbackIcon() {
|
|
|
29
27
|
testId: "errored-view-default-icon"
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
color: "var(--ds-icon-danger, #C9372C)",
|
|
38
|
-
label: "error",
|
|
39
|
-
LEGACY_size: "small",
|
|
40
|
-
testId: "errored-view-default-icon"
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
return /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
30
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
31
|
+
as: "span",
|
|
32
|
+
xcss: styles.iconWrapper
|
|
33
|
+
}, /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
34
|
+
color: "var(--ds-icon-danger, #C9372C)",
|
|
44
35
|
label: "error",
|
|
45
36
|
LEGACY_size: "small",
|
|
46
|
-
color: "var(--ds-icon-danger, ".concat(R300, ")"),
|
|
47
37
|
testId: "errored-view-default-icon"
|
|
48
38
|
}));
|
|
49
39
|
};
|
|
@@ -11,12 +11,11 @@ import LegacyLockIcon from '@atlaskit/icon/glyph/lock-filled';
|
|
|
11
11
|
import Lozenge from '@atlaskit/lozenge';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import { Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
14
|
-
import { N500
|
|
14
|
+
import { N500 } from '@atlaskit/theme/colors';
|
|
15
15
|
import { messages } from '../../../messages';
|
|
16
16
|
import { HoverCard } from '../../HoverCard';
|
|
17
17
|
import { ActionButton } from '../common/action-button';
|
|
18
18
|
import { Frame } from '../Frame';
|
|
19
|
-
import { AKIconWrapper } from '../Icon';
|
|
20
19
|
import { IconAndTitleLayout, LozengeWrapper } from '../IconAndTitleLayout';
|
|
21
20
|
import { IconStyledButtonOldVisualRefresh } from '../styled';
|
|
22
21
|
import withFrameStyleControl from '../utils/withFrameStyleControl';
|
|
@@ -34,7 +33,7 @@ var fallbackForbiddenIcon = function fallbackForbiddenIcon() {
|
|
|
34
33
|
testId: "forbidden-view-fallback-icon"
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
|
-
return
|
|
36
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
38
37
|
as: "span",
|
|
39
38
|
xcss: styles.iconWrapper
|
|
40
39
|
}, /*#__PURE__*/React.createElement(LockLockedIcon, {
|
|
@@ -43,11 +42,6 @@ var fallbackForbiddenIcon = function fallbackForbiddenIcon() {
|
|
|
43
42
|
LEGACY_fallbackIcon: LegacyLockIcon,
|
|
44
43
|
LEGACY_size: "small",
|
|
45
44
|
testId: "forbidden-view-fallback-icon"
|
|
46
|
-
})) : /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(LegacyLockIcon, {
|
|
47
|
-
label: "error",
|
|
48
|
-
size: "small",
|
|
49
|
-
primaryColor: "var(--ds-icon-danger, ".concat(R400, ")"),
|
|
50
|
-
testId: "forbidden-view-fallback-icon"
|
|
51
45
|
}));
|
|
52
46
|
};
|
|
53
47
|
export var InlineCardForbiddenView = function InlineCardForbiddenView(_ref) {
|