@atlaskit/smart-card 38.5.1 → 38.5.3
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 +17 -0
- package/dist/cjs/extractors/flexible/extract-link-title.js +23 -0
- package/dist/cjs/extractors/flexible/index.js +13 -5
- package/dist/cjs/state/helpers.js +4 -1
- package/dist/cjs/state/hooks/useSmartLink.js +6 -2
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +24 -15
- package/dist/cjs/view/BlockCard/views/unresolved-view/index.js +15 -10
- package/dist/cjs/view/BlockCard/views/utils/index.js +10 -2
- package/dist/cjs/view/CardWithUrl/component.js +29 -8
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-footer-block/index.js +17 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/index.js +16 -4
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +11 -4
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +17 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +64 -17
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +9 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +19 -5
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +18 -6
- package/dist/cjs/view/FlexibleCard/components/container/index.js +12 -2
- package/dist/cjs/view/FlexibleCard/components/elements/title-element/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +3 -0
- package/dist/cjs/view/FlexibleCard/index.js +5 -2
- package/dist/cjs/view/FlexibleCard/utils.js +11 -18
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +2 -1
- package/dist/cjs/view/HoverCard/components/views/forbidden/index.js +21 -14
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +22 -14
- package/dist/cjs/view/HoverCard/styled.js +13 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/extract-link-title.js +17 -0
- package/dist/es2019/extractors/flexible/index.js +9 -1
- package/dist/es2019/state/helpers.js +1 -0
- package/dist/es2019/state/hooks/useSmartLink.js +6 -2
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +25 -16
- package/dist/es2019/view/BlockCard/views/unresolved-view/index.js +16 -11
- package/dist/es2019/view/BlockCard/views/utils/index.js +9 -1
- package/dist/es2019/view/CardWithUrl/component.js +30 -9
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-footer-block/index.js +17 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/index.js +17 -5
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +11 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +17 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +48 -5
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +9 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +20 -6
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +19 -7
- package/dist/es2019/view/FlexibleCard/components/container/index.js +10 -2
- package/dist/es2019/view/FlexibleCard/components/elements/title-element/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +3 -0
- package/dist/es2019/view/FlexibleCard/index.js +5 -2
- package/dist/es2019/view/FlexibleCard/utils.js +14 -21
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +3 -2
- package/dist/es2019/view/HoverCard/components/views/forbidden/index.js +21 -14
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +22 -14
- package/dist/es2019/view/HoverCard/styled.js +12 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/extract-link-title.js +17 -0
- package/dist/esm/extractors/flexible/index.js +13 -5
- package/dist/esm/state/helpers.js +3 -0
- package/dist/esm/state/hooks/useSmartLink.js +6 -2
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +25 -16
- package/dist/esm/view/BlockCard/views/unresolved-view/index.js +16 -11
- package/dist/esm/view/BlockCard/views/utils/index.js +9 -1
- package/dist/esm/view/CardWithUrl/component.js +30 -9
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/index.js +17 -3
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/index.js +17 -5
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +11 -4
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +17 -3
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +64 -17
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +9 -1
- package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +20 -6
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +18 -6
- package/dist/esm/view/FlexibleCard/components/container/index.js +12 -2
- package/dist/esm/view/FlexibleCard/components/elements/title-element/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +3 -0
- package/dist/esm/view/FlexibleCard/index.js +5 -2
- package/dist/esm/view/FlexibleCard/utils.js +12 -19
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +3 -2
- package/dist/esm/view/HoverCard/components/views/forbidden/index.js +21 -14
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +22 -14
- package/dist/esm/view/HoverCard/styled.js +12 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/flexible/extract-link-title.d.ts +4 -0
- package/dist/types/extractors/flexible/index.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +11 -0
- package/dist/types/state/helpers.d.ts +1 -0
- package/dist/types/state/hooks/useSmartLink.d.ts +2 -0
- package/dist/types/utils/analytics/types.d.ts +1 -1
- package/dist/types/view/BlockCard/views/utils/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/elements/common/base-icon-element/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/types.d.ts +1 -1
- package/dist/types/view/HoverCard/styled.d.ts +4 -0
- package/dist/types-ts4.5/extractors/flexible/extract-link-title.d.ts +4 -0
- package/dist/types-ts4.5/extractors/flexible/index.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +11 -0
- package/dist/types-ts4.5/state/helpers.d.ts +1 -0
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +2 -0
- package/dist/types-ts4.5/utils/analytics/types.d.ts +1 -1
- package/dist/types-ts4.5/view/BlockCard/views/utils/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/types.d.ts +6 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-icon-element/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/styled.d.ts +4 -0
- package/package.json +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 38.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#160142](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160142)
|
|
8
|
+
[`70707418f5391`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/70707418f5391) -
|
|
9
|
+
CCP-6429 Fix VC offender - shortcut smartlink
|
|
10
|
+
|
|
11
|
+
## 38.5.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#160330](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160330)
|
|
16
|
+
[`f1c0f21f646c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f1c0f21f646c9) -
|
|
17
|
+
Remove renderChildren prop pass through (behind platform-linking-flexible-card-context)
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 38.5.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
8
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
|
+
var _constants = require("../../constants");
|
|
10
|
+
var extractLinkTitle = function extractLinkTitle(status, propUrl, response, onClick) {
|
|
11
|
+
var _ref;
|
|
12
|
+
var data = response === null || response === void 0 ? void 0 : response.data;
|
|
13
|
+
var responseUrl = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkUrl)(response) : (0, _linkExtractors.extractLink)(data);
|
|
14
|
+
var url = status === _constants.SmartLinkStatus.Resolved ? responseUrl !== null && responseUrl !== void 0 ? responseUrl : propUrl : propUrl;
|
|
15
|
+
var name = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkTitle)(response) : (0, _linkExtractors.extractTitle)(data);
|
|
16
|
+
var text = status === _constants.SmartLinkStatus.Resolved ? (_ref = name !== null && name !== void 0 ? name : responseUrl) !== null && _ref !== void 0 ? _ref : propUrl : propUrl;
|
|
17
|
+
return {
|
|
18
|
+
onClick: onClick,
|
|
19
|
+
text: text,
|
|
20
|
+
url: url
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
var _default = exports.default = extractLinkTitle;
|
|
@@ -13,6 +13,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
13
13
|
var _primitives = require("../common/primitives");
|
|
14
14
|
var _actions = require("./actions");
|
|
15
15
|
var _collaboratorGroup = require("./collaboratorGroup");
|
|
16
|
+
var _extractLinkTitle = _interopRequireDefault(require("./extract-link-title"));
|
|
16
17
|
var _extractPreview = _interopRequireWildcard(require("./extract-preview"));
|
|
17
18
|
var _extractPriority = _interopRequireDefault(require("./extract-priority"));
|
|
18
19
|
var _extractState = _interopRequireDefault(require("./extract-state"));
|
|
@@ -20,7 +21,7 @@ var _icon = require("./icon");
|
|
|
20
21
|
var _extractProviderIcon = _interopRequireWildcard(require("./icon/extract-provider-icon"));
|
|
21
22
|
var _latestCommit = require("./latest-commit");
|
|
22
23
|
var _utils = require("./utils");
|
|
23
|
-
var _excluded = ["appearance", "fireEvent", "id", "origin", "renderers", "resolve", "actionOptions", "response", "aiSummaryConfig"];
|
|
24
|
+
var _excluded = ["appearance", "fireEvent", "id", "onClick", "origin", "renderers", "resolve", "actionOptions", "response", "status", "aiSummaryConfig"];
|
|
24
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
26
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
27
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -30,11 +31,13 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
30
31
|
var appearance = _ref.appearance,
|
|
31
32
|
fireEvent = _ref.fireEvent,
|
|
32
33
|
id = _ref.id,
|
|
34
|
+
onClick = _ref.onClick,
|
|
33
35
|
origin = _ref.origin,
|
|
34
36
|
renderers = _ref.renderers,
|
|
35
37
|
resolve = _ref.resolve,
|
|
36
38
|
actionOptions = _ref.actionOptions,
|
|
37
39
|
response = _ref.response,
|
|
40
|
+
status = _ref.status,
|
|
38
41
|
aiSummaryConfig = _ref.aiSummaryConfig,
|
|
39
42
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
40
43
|
if (!response) {
|
|
@@ -43,7 +46,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
43
46
|
var data = response.data;
|
|
44
47
|
var meta = response.meta;
|
|
45
48
|
var url = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkUrl)(response) : (0, _linkExtractors.extractLink)(data);
|
|
46
|
-
return _objectSpread(_objectSpread({
|
|
49
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
47
50
|
actions: (0, _actions.extractFlexibleCardActions)({
|
|
48
51
|
actionOptions: actionOptions,
|
|
49
52
|
aiSummaryConfig: aiSummaryConfig,
|
|
@@ -71,7 +74,10 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
71
74
|
createdOn: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkCreatedOn)(response) : (0, _linkExtractors.extractDateCreated)(data),
|
|
72
75
|
dueOn: (0, _utils.extractDueOn)(data),
|
|
73
76
|
latestCommit: (0, _latestCommit.extractLatestCommit)(data),
|
|
74
|
-
linkIcon: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _icon.extractSmartLinkIcon)(response) : (0, _icon.extractLinkIcon)(response, renderers)
|
|
77
|
+
linkIcon: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _icon.extractSmartLinkIcon)(response) : (0, _icon.extractLinkIcon)(response, renderers)
|
|
78
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') && {
|
|
79
|
+
linkTitle: (0, _extractLinkTitle.default)(status, props.url, response, onClick)
|
|
80
|
+
}), {}, {
|
|
75
81
|
location: (0, _utils.extractLocation)(data),
|
|
76
82
|
modifiedBy: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkModifiedBy)(response) : (0, _utils.extractModifiedBy)(data),
|
|
77
83
|
modifiedOn: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkModifiedOn)(response) : (0, _linkExtractors.extractDateUpdated)(data),
|
|
@@ -88,8 +94,10 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
88
94
|
subscriberCount: (0, _utils.extractSubscriberCount)(data),
|
|
89
95
|
subTasksProgress: (0, _utils.extractSubTasksProgress)(data),
|
|
90
96
|
storyPoints: (0, _utils.extractStoryPoints)(data),
|
|
91
|
-
targetBranch: (0, _utils.extractTargetBranch)(data)
|
|
92
|
-
|
|
97
|
+
targetBranch: (0, _utils.extractTargetBranch)(data)
|
|
98
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? undefined : {
|
|
99
|
+
title: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkTitle)(response) || url : (0, _linkExtractors.extractTitle)(data) || url
|
|
100
|
+
}), {}, {
|
|
93
101
|
url: url,
|
|
94
102
|
ari: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkAri)(response) : (0, _linkExtractors.extractAri)(data)
|
|
95
103
|
}, (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v2') && {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isVisible = exports.isFinalState = exports.isAccessible = exports.hasResolved = exports.hasAuthScopeOverrides = exports.getSubproduct = exports.getStatusDetails = exports.getServices = exports.getResourceType = exports.getProduct = exports.getExtensionKey = exports.getDefinitionId = exports.getDatasources = exports.getClickUrl = exports.getCanBeDatasource = exports.getByDefinitionId = void 0;
|
|
6
|
+
exports.isVisible = exports.isFinalState = exports.isAccessible = exports.hasResolved = exports.hasAuthScopeOverrides = exports.getSubproduct = exports.getStatusDetails = exports.getServices = exports.getResourceType = exports.getProduct = exports.getObjectAri = exports.getExtensionKey = exports.getDefinitionId = exports.getDatasources = exports.getClickUrl = exports.getCanBeDatasource = exports.getByDefinitionId = void 0;
|
|
7
7
|
var _extractVisitUrl = require("../extractors/common/primitives/extractVisitUrl");
|
|
8
8
|
var getByDefinitionId = exports.getByDefinitionId = function getByDefinitionId(definitionId, store) {
|
|
9
9
|
var urls = Object.keys(store);
|
|
@@ -29,6 +29,9 @@ var getExtensionKey = exports.getExtensionKey = function getExtensionKey(details
|
|
|
29
29
|
var _details$meta2;
|
|
30
30
|
return details === null || details === void 0 || (_details$meta2 = details.meta) === null || _details$meta2 === void 0 ? void 0 : _details$meta2.key;
|
|
31
31
|
};
|
|
32
|
+
var getObjectAri = exports.getObjectAri = function getObjectAri(details) {
|
|
33
|
+
return (details === null || details === void 0 ? void 0 : details.data) && 'atlassian:ari' in details.data && details.data['atlassian:ari'] || undefined;
|
|
34
|
+
};
|
|
32
35
|
var getResourceType = exports.getResourceType = function getResourceType(details) {
|
|
33
36
|
var _details$meta3;
|
|
34
37
|
return details === null || details === void 0 || (_details$meta3 = details.meta) === null || _details$meta3 === void 0 ? void 0 : _details$meta3.resourceType;
|
|
@@ -15,7 +15,9 @@ var _store = require("../store");
|
|
|
15
15
|
function useSmartLink(id, url) {
|
|
16
16
|
var state = (0, _store.useSmartCardState)(url);
|
|
17
17
|
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
18
|
-
store = _useSmartLinkContext.store
|
|
18
|
+
store = _useSmartLinkContext.store,
|
|
19
|
+
isGlancePanelAvailable = _useSmartLinkContext.isGlancePanelAvailable,
|
|
20
|
+
openGlancePanel = _useSmartLinkContext.openGlancePanel;
|
|
19
21
|
var actions = (0, _actions.useSmartCardActions)(id, url);
|
|
20
22
|
var config = (0, _config.useSmartLinkConfig)();
|
|
21
23
|
var renderers = (0, _renderers.useSmartLinkRenderers)();
|
|
@@ -41,6 +43,8 @@ function useSmartLink(id, url) {
|
|
|
41
43
|
actions: actions,
|
|
42
44
|
config: config,
|
|
43
45
|
renderers: renderers,
|
|
44
|
-
error: error
|
|
46
|
+
error: error,
|
|
47
|
+
isGlancePanelAvailable: isGlancePanelAvailable,
|
|
48
|
+
openGlancePanel: openGlancePanel
|
|
45
49
|
};
|
|
46
50
|
}
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "38.5.
|
|
14
|
+
packageVersion: "38.5.3"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -83,35 +83,44 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
83
83
|
origin: "smartLinkCard",
|
|
84
84
|
actionOptions: actionOptions,
|
|
85
85
|
testId: testId,
|
|
86
|
-
ui: _utils.FlexibleCardUiOptions,
|
|
86
|
+
ui: (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? _utils.FlexibleCardUiOptions : _utils.FlexibleCardUiOptionsOld,
|
|
87
87
|
url: url
|
|
88
88
|
}, /*#__PURE__*/React.createElement(_blocks.TitleBlock, (0, _extends2.default)({}, _utils.titleBlockOptions, {
|
|
89
89
|
metadata: titleMetadata,
|
|
90
90
|
subtitle: [{
|
|
91
91
|
name: _constants.ElementName.Location
|
|
92
92
|
}],
|
|
93
|
-
metadataPosition: _constants.SmartLinkPosition.Top
|
|
94
|
-
|
|
93
|
+
metadataPosition: _constants.SmartLinkPosition.Top
|
|
94
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? undefined : {
|
|
95
|
+
status: status
|
|
96
|
+
}, {
|
|
95
97
|
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') ? "_zulpu2gc _13mh1pd9 _2yhz14q2" : "_zulpcxkx _13mh1pd9"])
|
|
96
|
-
})), /*#__PURE__*/React.createElement(_blocks.MetadataBlock, {
|
|
98
|
+
})), /*#__PURE__*/React.createElement(_blocks.MetadataBlock, (0, _extends2.default)({
|
|
97
99
|
primary: topMetadata,
|
|
98
|
-
maxLines: 1
|
|
99
|
-
|
|
100
|
+
maxLines: 1
|
|
101
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? undefined : {
|
|
102
|
+
status: _constants.SmartLinkStatus.Resolved
|
|
103
|
+
}, {
|
|
100
104
|
className: (0, _runtime.ax)([!(0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') && "_wwyvidpf _1sxbcxkx _i8d01j6v"])
|
|
101
|
-
}), /*#__PURE__*/React.createElement(_blocks.SnippetBlock, null), /*#__PURE__*/React.createElement(_blocks.MetadataBlock, {
|
|
105
|
+
})), /*#__PURE__*/React.createElement(_blocks.SnippetBlock, null), /*#__PURE__*/React.createElement(_blocks.MetadataBlock, (0, _extends2.default)({
|
|
102
106
|
primary: bottomMetadata,
|
|
103
|
-
maxLines: 1
|
|
104
|
-
|
|
107
|
+
maxLines: 1
|
|
108
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? undefined : {
|
|
109
|
+
status: _constants.SmartLinkStatus.Resolved
|
|
110
|
+
}, {
|
|
105
111
|
className: (0, _runtime.ax)([!(0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') && "_wwyvidpf _1sxbcxkx _i8d01j6v"])
|
|
106
|
-
}), !isPreviewBlockErrored ? /*#__PURE__*/React.createElement(_blocks.PreviewBlock, (0, _extends2.default)({}, _utils.PreviewBlockOptions, {
|
|
112
|
+
})), !isPreviewBlockErrored ? /*#__PURE__*/React.createElement(_blocks.PreviewBlock, (0, _extends2.default)({}, _utils.PreviewBlockOptions, {
|
|
107
113
|
onError: function onError() {
|
|
108
114
|
setIsPreviewBlockErrored(true);
|
|
109
|
-
}
|
|
115
|
+
}
|
|
116
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? undefined : {
|
|
117
|
+
status: _constants.SmartLinkStatus.Resolved
|
|
118
|
+
})) : null, /*#__PURE__*/React.createElement(_blocks.FooterBlock, (0, _extends2.default)({
|
|
119
|
+
actions: footerActions
|
|
120
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? undefined : {
|
|
110
121
|
status: _constants.SmartLinkStatus.Resolved
|
|
111
|
-
}
|
|
112
|
-
actions: footerActions,
|
|
113
|
-
status: _constants.SmartLinkStatus.Resolved,
|
|
122
|
+
}, {
|
|
114
123
|
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') ? "_4t3i1k8s _1e0c1txw _1bah1yb4 _4cvresu3 _1wpz1fhb" : "_4t3i1k8s _g0eioxwj _1qryoxwj _sxbroxwj _1gyioxwj", safari && (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v2') && "_4t3i1osq"])
|
|
115
|
-
}));
|
|
124
|
+
})));
|
|
116
125
|
};
|
|
117
126
|
var _default = exports.default = (0, _withFlexibleUIBlockCardStyle.withFlexibleUIBlockCardStyle)(ResolvedView);
|
|
@@ -53,23 +53,28 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
53
53
|
onError: onError,
|
|
54
54
|
origin: "smartLinkCard",
|
|
55
55
|
testId: testId,
|
|
56
|
-
ui: _utils.FlexibleCardUiOptions,
|
|
56
|
+
ui: (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? _utils.FlexibleCardUiOptions : _utils.FlexibleCardUiOptionsOld,
|
|
57
57
|
url: url
|
|
58
58
|
}, /*#__PURE__*/React.createElement(_blocks.TitleBlock, (0, _extends2.default)({}, _utils.titleBlockOptions, {
|
|
59
59
|
hideIcon: !!title,
|
|
60
|
-
text: title
|
|
61
|
-
|
|
60
|
+
text: title
|
|
61
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? undefined : {
|
|
62
|
+
status: cardState.status
|
|
63
|
+
}, {
|
|
62
64
|
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') ? "_zulpu2gc _13mh1pd9 _2yhz14q2" : "_zulp1f3t _13mh1pd9"])
|
|
63
|
-
})), /*#__PURE__*/React.createElement(_blocks.CustomBlock, {
|
|
64
|
-
status: cardState.status
|
|
65
|
+
})), /*#__PURE__*/React.createElement(_blocks.CustomBlock, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? undefined : {
|
|
66
|
+
status: cardState.status
|
|
67
|
+
}, {
|
|
65
68
|
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') ? "_zulp1b66 _1e0c1txw _4cvr1y6m _1wpz1fhb _7yjtidpf _ngc01fxt" : "_4cvr1y6m"])
|
|
66
|
-
}, children), showPreview && /*#__PURE__*/React.createElement(_blocks.PreviewBlock, (0, _extends2.default)({}, _utils.PreviewBlockOptions, {
|
|
69
|
+
}), children), showPreview && /*#__PURE__*/React.createElement(_blocks.PreviewBlock, (0, _extends2.default)({}, _utils.PreviewBlockOptions, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? undefined : {
|
|
67
70
|
status: cardState.status
|
|
68
|
-
})), /*#__PURE__*/React.createElement(_blocks.InternalFooterBlock, {
|
|
71
|
+
})), /*#__PURE__*/React.createElement(_blocks.InternalFooterBlock, (0, _extends2.default)({
|
|
69
72
|
actions: actions,
|
|
70
|
-
testId: "smart-block-card-footer"
|
|
71
|
-
|
|
73
|
+
testId: "smart-block-card-footer"
|
|
74
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? undefined : {
|
|
75
|
+
status: cardState.status
|
|
76
|
+
}, {
|
|
72
77
|
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') ? "_4t3i1k8s _1e0c1txw _1bah1yb4 _4cvresu3 _1wpz1fhb" : "_4t3i1k8s _g0eioxwj _1qryoxwj _sxbroxwj _1gyioxwj", safari && (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v2') && "_4t3i1osq"])
|
|
73
|
-
}));
|
|
78
|
+
})));
|
|
74
79
|
};
|
|
75
80
|
var _default = exports.default = UnresolvedView;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.titleBlockOptions = exports.getSimulatedBetterMetadata = exports.PreviewBlockOptions = exports.FlexibleCardUiOptions = void 0;
|
|
6
|
+
exports.titleBlockOptions = exports.getSimulatedBetterMetadata = exports.PreviewBlockOptions = exports.FlexibleCardUiOptionsOld = exports.FlexibleCardUiOptions = void 0;
|
|
7
7
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
8
|
var _constants = require("../../../../constants");
|
|
9
9
|
var _utils = require("../../../../extractors/flexible/utils");
|
|
@@ -158,10 +158,18 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
|
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
|
-
|
|
161
|
+
/**
|
|
162
|
+
* @deprecated Remove on platform-linking-flexible-card-context cleanup
|
|
163
|
+
*/
|
|
164
|
+
var FlexibleCardUiOptionsOld = exports.FlexibleCardUiOptionsOld = {
|
|
162
165
|
hideElevation: true,
|
|
163
166
|
hideLegacyButton: true
|
|
164
167
|
};
|
|
168
|
+
var FlexibleCardUiOptions = exports.FlexibleCardUiOptions = {
|
|
169
|
+
hideElevation: true,
|
|
170
|
+
hideLegacyButton: true,
|
|
171
|
+
removeBlockRestriction: true
|
|
172
|
+
};
|
|
165
173
|
var titleBlockOptions = exports.titleBlockOptions = {
|
|
166
174
|
anchorTarget: '_self',
|
|
167
175
|
position: _constants.SmartLinkPosition.Center,
|
|
@@ -62,7 +62,10 @@ function Component(_ref) {
|
|
|
62
62
|
actions = _useSmartLink.actions,
|
|
63
63
|
config = _useSmartLink.config,
|
|
64
64
|
renderers = _useSmartLink.renderers,
|
|
65
|
-
error = _useSmartLink.error
|
|
65
|
+
error = _useSmartLink.error,
|
|
66
|
+
isGlancePanelAvailable = _useSmartLink.isGlancePanelAvailable,
|
|
67
|
+
openGlancePanel = _useSmartLink.openGlancePanel;
|
|
68
|
+
var ari = (0, _platformFeatureFlags.fg)('fun-1765_wire_up_glance_panel_to_smart_cards') ? (0, _helpers.getObjectAri)(state.details) : undefined;
|
|
66
69
|
var definitionId = (0, _helpers.getDefinitionId)(state.details);
|
|
67
70
|
var extensionKey = (0, _helpers.getExtensionKey)(state.details);
|
|
68
71
|
var resourceType = (0, _helpers.getResourceType)(state.details);
|
|
@@ -78,19 +81,37 @@ function Component(_ref) {
|
|
|
78
81
|
// Setup UI handlers.
|
|
79
82
|
var handleClickWrapper = (0, _react.useCallback)(function (event) {
|
|
80
83
|
var isModifierKeyPressed = (0, _utils.isSpecialEvent)(event);
|
|
84
|
+
// Ctrl+left click on mac typically doesn't trigger onClick
|
|
85
|
+
// The event could have potentially had `e.preventDefault()` called on it by now
|
|
86
|
+
// event by smart card internally
|
|
87
|
+
// If it has been called then only then can `isModifierKeyPressed` be true.
|
|
88
|
+
var target = isModifierKeyPressed ? '_blank' : '_self';
|
|
81
89
|
fireEvent('ui.smartLink.clicked', {
|
|
82
90
|
id: id,
|
|
83
91
|
display: isFlexibleUi ? _constants.CardDisplay.Flexible : appearance,
|
|
84
92
|
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
85
93
|
isModifierKeyPressed: isModifierKeyPressed
|
|
86
94
|
});
|
|
87
|
-
|
|
95
|
+
|
|
96
|
+
// If glance panel is available and the user clicked on the link,
|
|
97
|
+
// delegate the click to the glance panel handler
|
|
98
|
+
if (
|
|
99
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
100
|
+
(0, _platformFeatureFlags.fg)('fun-1765_wire_up_glance_panel_to_smart_cards') && target !== '_blank' && ari && isGlancePanelAvailable !== null && isGlancePanelAvailable !== void 0 && isGlancePanelAvailable({
|
|
101
|
+
url: url,
|
|
102
|
+
ari: ari
|
|
103
|
+
}) && openGlancePanel) {
|
|
104
|
+
openGlancePanel({
|
|
105
|
+
url: url,
|
|
106
|
+
ari: ari
|
|
107
|
+
});
|
|
108
|
+
(0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event, {
|
|
109
|
+
attributes: {
|
|
110
|
+
clickOutcome: 'glancePanel'
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
} else if (!onClick && !isFlexibleUi) {
|
|
88
114
|
var clickUrl = (0, _helpers.getClickUrl)(url, state.details);
|
|
89
|
-
// Ctrl+left click on mac typically doesn't trigger onClick
|
|
90
|
-
// The event could have potentially had `e.preventDefault()` called on it by now
|
|
91
|
-
// event by smart card internally
|
|
92
|
-
// If it has been called then only then can `isModifierKeyPressed` be true.
|
|
93
|
-
var target = isModifierKeyPressed ? '_blank' : '_self';
|
|
94
115
|
window.open(clickUrl, target);
|
|
95
116
|
(0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event, {
|
|
96
117
|
attributes: {
|
|
@@ -103,7 +124,7 @@ function Component(_ref) {
|
|
|
103
124
|
}
|
|
104
125
|
(0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event);
|
|
105
126
|
}
|
|
106
|
-
}, [
|
|
127
|
+
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, isGlancePanelAvailable, openGlancePanel, createAnalyticsEvent]);
|
|
107
128
|
var handleAuthorize = (0, _react.useCallback)(function () {
|
|
108
129
|
return actions.authorize(appearance);
|
|
109
130
|
}, [actions, appearance]);
|
|
@@ -99,7 +99,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
99
99
|
},
|
|
100
100
|
onError: onError,
|
|
101
101
|
onLoadingChange: onLoadingChange,
|
|
102
|
-
size: size
|
|
102
|
+
size: (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? size || (ui === null || ui === void 0 ? void 0 : ui.size) : size
|
|
103
103
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/design-system/no-unsafe-design-token-usage
|
|
104
104
|
,
|
|
105
105
|
style: padding && {
|
|
@@ -108,7 +108,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
108
108
|
hideTooltip: isLoading
|
|
109
109
|
}) : null;
|
|
110
110
|
});
|
|
111
|
-
}, [context === null || context === void 0 ? void 0 : context.actions,
|
|
111
|
+
}, [context === null || context === void 0 ? void 0 : context.actions, spaceInline, onError, onLoadingChange, size, ui === null || ui === void 0 ? void 0 : ui.size, padding, isLoading, _onClick]);
|
|
112
112
|
return actions ? /*#__PURE__*/React.createElement("div", {
|
|
113
113
|
ref: blockRef,
|
|
114
114
|
"data-testid": testId
|
|
@@ -8,7 +8,9 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _constants = require("../../../../../constants");
|
|
13
|
+
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
12
14
|
var _resolved = _interopRequireDefault(require("./resolved"));
|
|
13
15
|
var _excluded = ["status", "testId"];
|
|
14
16
|
/**
|
|
@@ -18,14 +20,26 @@ var _excluded = ["status", "testId"];
|
|
|
18
20
|
* @see Block
|
|
19
21
|
*/
|
|
20
22
|
var AIFooterBlock = function AIFooterBlock(_ref) {
|
|
23
|
+
var _props$size, _cardContext$ui;
|
|
21
24
|
var status = _ref.status,
|
|
22
25
|
_ref$testId = _ref.testId,
|
|
23
26
|
testId = _ref$testId === void 0 ? 'smart-ai-footer-block' : _ref$testId,
|
|
24
27
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
var cardContext = (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ?
|
|
29
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
30
|
+
(0, _flexibleUiContext.useFlexibleCardContext)() : undefined;
|
|
31
|
+
if ((0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context')) {
|
|
32
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== _constants.SmartLinkStatus.Resolved) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
if (status !== _constants.SmartLinkStatus.Resolved) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
27
39
|
}
|
|
28
|
-
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, props, {
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, props, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? {
|
|
41
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
42
|
+
} : undefined, {
|
|
29
43
|
testId: testId
|
|
30
44
|
}));
|
|
31
45
|
};
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _constants = require("../../../../../constants");
|
|
12
13
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
13
14
|
var _resolved = _interopRequireDefault(require("./resolved"));
|
|
@@ -20,20 +21,31 @@ var _excluded = ["status", "testId"];
|
|
|
20
21
|
* @see Block
|
|
21
22
|
*/
|
|
22
23
|
var AISummaryBlock = function AISummaryBlock(_ref) {
|
|
23
|
-
var _context$actions;
|
|
24
|
+
var _context$actions, _props$size, _cardContext$ui;
|
|
24
25
|
var status = _ref.status,
|
|
25
26
|
_ref$testId = _ref.testId,
|
|
26
27
|
testId = _ref$testId === void 0 ? 'smart-ai-summary-block' : _ref$testId,
|
|
27
28
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
|
+
var cardContext = (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ?
|
|
30
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
31
|
+
(0, _flexibleUiContext.useFlexibleCardContext)() : undefined;
|
|
28
32
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
29
33
|
var actionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.InternalActionName.AISummaryAction];
|
|
30
|
-
if (
|
|
31
|
-
|
|
34
|
+
if ((0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context')) {
|
|
35
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== _constants.SmartLinkStatus.Resolved) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
if (status !== _constants.SmartLinkStatus.Resolved) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
32
42
|
}
|
|
33
43
|
if (!(actionData !== null && actionData !== void 0 && actionData.url)) {
|
|
34
44
|
return null;
|
|
35
45
|
}
|
|
36
|
-
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, props, {
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, props, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? {
|
|
47
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
48
|
+
} : undefined, {
|
|
37
49
|
testId: testId,
|
|
38
50
|
url: actionData.url
|
|
39
51
|
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
-
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
3
2
|
"use strict";
|
|
4
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
5
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
@@ -11,11 +11,13 @@ require("./index.compiled.css");
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _constants = require("../../../../../constants");
|
|
16
17
|
var _utils = require("../utils");
|
|
17
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
19
21
|
// TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
|
|
20
22
|
var BaseBlockStylesOld = null;
|
|
21
23
|
var baseBlockStyles = null;
|
|
@@ -58,11 +60,16 @@ var Block = function Block(_ref) {
|
|
|
58
60
|
blockRef = _ref.blockRef,
|
|
59
61
|
onRender = _ref.onRender,
|
|
60
62
|
onTransitionEnd = _ref.onTransitionEnd,
|
|
61
|
-
style = _ref.style
|
|
63
|
+
style = _ref.style,
|
|
64
|
+
placeholderId = _ref.placeholderId;
|
|
62
65
|
(0, _react.useEffect)(function () {
|
|
63
66
|
onRender && onRender();
|
|
64
67
|
}, [onRender]);
|
|
65
|
-
|
|
68
|
+
var ssrPlacholderProps = (0, _platformFeatureFlags.fg)('cc_shortcut_ssr_placeholder') ? {
|
|
69
|
+
'data-ssr-placeholder': placeholderId,
|
|
70
|
+
'data-ssr-placeholder-replace': placeholderId
|
|
71
|
+
} : {};
|
|
72
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
66
73
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
67
74
|
className: (0, _runtime.ax)([!(0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') && "_1reo15vq _18m915vq _4cvr1h6o _vwz41j6v _1e0c1txw _1ul9idpf _1bah1y6m _fiawglyw _1ouwidpf _f6ju1ns9 _1uzp1mp2 _ytq1bjq5 _a7e8uxlv", (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') && "_1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf _1bah1y6m _fiawglyw _1uzp1mp2 _a6bxmuej _e4i5bjq5 _1gu21oju _5b7tuxlv _17ae1oju", "_12ji1snc _1qu2agmp _12y310yn _12ji1kw7 _syaz1kw7 _18ql1j28 _1ifmglyw _181uglyw _1rkwglyw _te17glyw _uiztglyw", directionStyles[direction], !(0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') && gapsStylesOld[size], (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') && gapStyles[size], className]),
|
|
68
75
|
"data-smart-block": true,
|
|
@@ -72,6 +79,6 @@ var Block = function Block(_ref) {
|
|
|
72
79
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
73
80
|
,
|
|
74
81
|
style: style
|
|
75
|
-
}, (0, _utils.renderChildren)(children, size));
|
|
82
|
+
}, ssrPlacholderProps), (0, _utils.renderChildren)(children, size));
|
|
76
83
|
};
|
|
77
84
|
var _default = exports.default = Block;
|
|
@@ -8,7 +8,9 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _constants = require("../../../../../constants");
|
|
13
|
+
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
12
14
|
var _resolved = _interopRequireDefault(require("./resolved"));
|
|
13
15
|
var _excluded = ["status", "testId", "alwaysShow"];
|
|
14
16
|
/**
|
|
@@ -19,15 +21,27 @@ var _excluded = ["status", "testId", "alwaysShow"];
|
|
|
19
21
|
* @see Block
|
|
20
22
|
*/
|
|
21
23
|
var FooterBlock = function FooterBlock(_ref) {
|
|
24
|
+
var _props$size, _cardContext$ui;
|
|
22
25
|
var status = _ref.status,
|
|
23
26
|
_ref$testId = _ref.testId,
|
|
24
27
|
testId = _ref$testId === void 0 ? 'smart-footer-block' : _ref$testId,
|
|
25
28
|
alwaysShow = _ref.alwaysShow,
|
|
26
29
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
var cardContext = (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ?
|
|
31
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
32
|
+
(0, _flexibleUiContext.useFlexibleCardContext)() : undefined;
|
|
33
|
+
if ((0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context')) {
|
|
34
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== _constants.SmartLinkStatus.Resolved && !alwaysShow) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
if (status !== _constants.SmartLinkStatus.Resolved && !alwaysShow) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
29
41
|
}
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, props, {
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, props, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-context') ? {
|
|
43
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
44
|
+
} : undefined, {
|
|
31
45
|
testId: testId
|
|
32
46
|
}));
|
|
33
47
|
};
|