@atlaskit/smart-card 26.37.2 → 26.38.1
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 +13 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/actions/flexible/AuthorizeAction.js +1 -0
- package/dist/cjs/view/BlockCard/index.js +5 -18
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleErroredView.js +12 -34
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenView.js +25 -51
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +13 -32
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +9 -31
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +7 -18
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +28 -51
- package/dist/cjs/view/BlockCard/views/flexible/styled.js +5 -5
- package/dist/cjs/view/BlockCard/views/flexible/unresolved-view/index.js +41 -0
- package/dist/cjs/view/BlockCard/views/flexible/utils/index.js +30 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +12 -57
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +65 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/index.js +8 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +3 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/actions/flexible/AuthorizeAction.js +1 -0
- package/dist/es2019/view/BlockCard/index.js +1 -15
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleErroredView.js +8 -32
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenView.js +25 -52
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +12 -31
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +15 -41
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +10 -21
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +24 -43
- package/dist/es2019/view/BlockCard/views/flexible/styled.js +3 -4
- package/dist/es2019/view/BlockCard/views/flexible/unresolved-view/index.js +33 -0
- package/dist/es2019/view/BlockCard/views/flexible/utils/index.js +27 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +11 -54
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +56 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/index.js +4 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +3 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/actions/flexible/AuthorizeAction.js +1 -0
- package/dist/esm/view/BlockCard/index.js +3 -18
- package/dist/esm/view/BlockCard/views/flexible/FlexibleErroredView.js +12 -34
- package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenView.js +26 -52
- package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +13 -32
- package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +9 -31
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +10 -21
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +25 -45
- package/dist/esm/view/BlockCard/views/flexible/styled.js +4 -4
- package/dist/esm/view/BlockCard/views/flexible/unresolved-view/index.js +35 -0
- package/dist/esm/view/BlockCard/views/flexible/utils/index.js +30 -1
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +13 -54
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +55 -0
- package/dist/esm/view/FlexibleCard/components/blocks/index.js +4 -1
- package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/elements/text/index.js +3 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +3 -1
- package/dist/types/view/BlockCard/views/flexible/styled.d.ts +0 -1
- package/dist/types/view/BlockCard/views/flexible/types.d.ts +2 -83
- package/dist/types/view/BlockCard/views/flexible/unresolved-view/index.d.ts +4 -0
- package/dist/types/view/BlockCard/views/flexible/unresolved-view/types.d.ts +7 -0
- package/dist/types/view/BlockCard/views/flexible/utils/index.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/blocks/footer-block/resolved/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/snippet-block/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/elements/text/types.d.ts +4 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +3 -1
- package/dist/types-ts4.5/view/BlockCard/views/flexible/styled.d.ts +0 -1
- package/dist/types-ts4.5/view/BlockCard/views/flexible/types.d.ts +2 -83
- package/dist/types-ts4.5/view/BlockCard/views/flexible/unresolved-view/index.d.ts +4 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/unresolved-view/types.d.ts +7 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/utils/index.d.ts +8 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/footer-block/resolved/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/snippet-block/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/text/types.d.ts +4 -0
- package/package.json +1 -1
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
- package/dist/cjs/view/BlockCard/components/flexible/footer/index.js +0 -56
- package/dist/es2019/view/BlockCard/components/flexible/footer/index.js +0 -52
- package/dist/esm/view/BlockCard/components/flexible/footer/index.js +0 -49
- package/dist/types/view/BlockCard/components/flexible/footer/index.d.ts +0 -12
- package/dist/types/view/BlockCard/components/flexible/footer/types.d.ts +0 -5
- package/dist/types-ts4.5/view/BlockCard/components/flexible/footer/index.d.ts +0 -12
- package/dist/types-ts4.5/view/BlockCard/components/flexible/footer/types.d.ts +0 -5
- /package/dist/cjs/view/BlockCard/{components/flexible/footer → views/flexible/unresolved-view}/types.js +0 -0
- /package/dist/es2019/view/BlockCard/{components/flexible/footer → views/flexible/unresolved-view}/types.js +0 -0
- /package/dist/esm/view/BlockCard/{components/flexible/footer → views/flexible/unresolved-view}/types.js +0 -0
|
@@ -4,18 +4,18 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.titleBlockCss = exports.metadataBlockCss = exports.
|
|
7
|
+
exports.titleBlockCss = exports.metadataBlockCss = exports.footerBlockCss = exports.flexibleBlockCardStyle = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _token = require("../../../../utils/token");
|
|
10
10
|
var _react = require("@emotion/react");
|
|
11
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5
|
|
13
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
14
14
|
// in editor prosemirror adds padding-left so we need to overwrite it
|
|
15
|
-
|
|
15
|
+
// renderer overwrites the margin-right so we need to add it here
|
|
16
|
+
var metadataBlockCss = exports.metadataBlockCss = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* primary element group */\n span[data-smart-element-avatar-group] {\n > ul {\n padding-left: 0px;\n margin-right: 0.5rem;\n }\n }\n [data-smart-element-group] {\n line-height: 1rem;\n }\n"])));
|
|
16
17
|
var titleBlockCss = exports.titleBlockCss = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n"])), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? "gap: 0.5em;" : "", (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "[data-smart-element=\"Title\"] {\n font-weight: 600;\n }" : "");
|
|
17
18
|
var footerBlockCss = exports.footerBlockCss = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n height: 1.5rem;\n\n .actions-button-group {\n button,\n button:hover,\n button:focus,\n button:active {\n font-size: 0.875rem;\n }\n }\n"])));
|
|
18
19
|
var flexibleBlockCardElevationStyle = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 1.5px;\n box-shadow: ", ";\n margin: ", ";\n"])), _token.tokens.elevation, "var(--ds-space-025, 2px)");
|
|
19
20
|
var refreshedFlexibleBlockCardStyle = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n & > div {\n border-radius: ", ";\n border: 1px solid ", ";\n }\n"])), "var(--ds-border-radius-200, 8px)", "var(--ds-border, ".concat(_colors.N40, ")"));
|
|
20
|
-
var flexibleBlockCardStyle = exports.flexibleBlockCardStyle = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? refreshedFlexibleBlockCardStyle : flexibleBlockCardElevationStyle;
|
|
21
|
-
var forbiddenViewTitleStyle = exports.forbiddenViewTitleStyle = (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 600;\n"])));
|
|
21
|
+
var flexibleBlockCardStyle = exports.flexibleBlockCardStyle = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? refreshedFlexibleBlockCardStyle : flexibleBlockCardElevationStyle;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _blocks = require("../../../../FlexibleCard/components/blocks");
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _FlexibleCard = _interopRequireDefault(require("../../../../FlexibleCard"));
|
|
12
|
+
var _utils = require("../utils");
|
|
13
|
+
var UnresolvedView = function UnresolvedView(_ref) {
|
|
14
|
+
var actions = _ref.actions,
|
|
15
|
+
cardState = _ref.cardState,
|
|
16
|
+
children = _ref.children,
|
|
17
|
+
onAuthorize = _ref.onAuthorize,
|
|
18
|
+
onClick = _ref.onClick,
|
|
19
|
+
onError = _ref.onError,
|
|
20
|
+
_ref$showPreview = _ref.showPreview,
|
|
21
|
+
showPreview = _ref$showPreview === void 0 ? false : _ref$showPreview,
|
|
22
|
+
testId = _ref.testId,
|
|
23
|
+
title = _ref.title,
|
|
24
|
+
url = _ref.url;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_FlexibleCard.default, {
|
|
26
|
+
appearance: "block",
|
|
27
|
+
cardState: cardState,
|
|
28
|
+
onAuthorize: onAuthorize,
|
|
29
|
+
onClick: onClick,
|
|
30
|
+
onError: onError,
|
|
31
|
+
testId: testId,
|
|
32
|
+
ui: _utils.FlexibleCardUiOptions,
|
|
33
|
+
url: url
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, (0, _extends2.default)({}, (0, _utils.getTitleBlockOptions)(), {
|
|
35
|
+
text: title
|
|
36
|
+
})), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, null, children), showPreview && /*#__PURE__*/_react.default.createElement(_blocks.PreviewBlock, _utils.PreviewBlockOptions), /*#__PURE__*/_react.default.createElement(_blocks.InternalFooterBlock, (0, _extends2.default)({}, (0, _utils.getFooterBlockOptions)(), {
|
|
37
|
+
actions: actions,
|
|
38
|
+
testId: "smart-block-card-footer"
|
|
39
|
+
})));
|
|
40
|
+
};
|
|
41
|
+
var _default = exports.default = UnresolvedView;
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getSimulatedMetadata = exports.getSimulatedBetterMetadata = void 0;
|
|
6
|
+
exports.getTitleBlockOptions = exports.getSimulatedMetadata = exports.getSimulatedBetterMetadata = exports.getFooterBlockOptions = exports.PreviewBlockOptions = exports.FlexibleCardUiOptions = void 0;
|
|
7
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
7
8
|
var _constants = require("../../../../../constants");
|
|
8
9
|
var _utils = require("../../../../../extractors/flexible/utils");
|
|
9
10
|
var _helpers = require("../../../../../state/helpers");
|
|
11
|
+
var _styled = require("../styled");
|
|
10
12
|
var baseTopMetadata = [{
|
|
11
13
|
name: _constants.ElementName.ModifiedOn
|
|
12
14
|
}, {
|
|
@@ -140,4 +142,31 @@ var getSimulatedMetadata = exports.getSimulatedMetadata = function getSimulatedM
|
|
|
140
142
|
titleMetadata: titleMetadata,
|
|
141
143
|
topMetadata: topMetadata
|
|
142
144
|
};
|
|
145
|
+
};
|
|
146
|
+
var FlexibleCardUiOptions = exports.FlexibleCardUiOptions = {
|
|
147
|
+
hideElevation: true
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// Due to the use of getBooleanFF(), this has to be a function.
|
|
151
|
+
// Make this a const object after ff cleanup.
|
|
152
|
+
var getTitleBlockOptions = exports.getTitleBlockOptions = function getTitleBlockOptions() {
|
|
153
|
+
return {
|
|
154
|
+
anchorTarget: (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-block-card-clicks-opening-in-same-tab') ? '_self' : undefined,
|
|
155
|
+
position: _constants.SmartLinkPosition.Center,
|
|
156
|
+
overrideCss: _styled.titleBlockCss,
|
|
157
|
+
hideRetry: true,
|
|
158
|
+
size: (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? _constants.SmartLinkSize.Large : undefined
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
var PreviewBlockOptions = exports.PreviewBlockOptions = {
|
|
162
|
+
placement: _constants.MediaPlacement.Right,
|
|
163
|
+
ignoreContainerPadding: true
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// Due to the use of getBooleanFF(), this has to be a function.
|
|
167
|
+
// Make this a const object after ff cleanup.
|
|
168
|
+
var getFooterBlockOptions = exports.getFooterBlockOptions = function getFooterBlockOptions() {
|
|
169
|
+
return {
|
|
170
|
+
overrideCss: (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? _styled.footerBlockCss : undefined
|
|
171
|
+
};
|
|
143
172
|
};
|
|
@@ -1,34 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var
|
|
11
|
-
var _react =
|
|
12
|
-
var
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _resolved = _interopRequireDefault(require("./resolved"));
|
|
13
12
|
var _constants = require("../../../../../constants");
|
|
14
|
-
var
|
|
15
|
-
var _elementGroup = _interopRequireDefault(require("../element-group"));
|
|
16
|
-
var _elements = require("../../elements");
|
|
17
|
-
var _actionGroup = _interopRequireDefault(require("../action-group"));
|
|
18
|
-
var _utils = require("../utils");
|
|
19
|
-
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
20
|
-
var _templateObject;
|
|
21
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
var getActionGroupStyles = function getActionGroupStyles(size) {
|
|
24
|
-
if (size === _constants.SmartLinkSize.XLarge) {
|
|
25
|
-
// The biggest height of the action button exceeds the max line-height
|
|
26
|
-
// of the elements causing the action on the block with x-large size to
|
|
27
|
-
// get cut at the bottom.
|
|
28
|
-
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n max-height: 2rem;\n "])));
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
13
|
+
var _excluded = ["status", "testId"];
|
|
32
14
|
/**
|
|
33
15
|
* Represents a FooterBlock, designed to contain elements and actions that should appear
|
|
34
16
|
* at the bottom of a link card.
|
|
@@ -36,43 +18,16 @@ var getActionGroupStyles = function getActionGroupStyles(size) {
|
|
|
36
18
|
* @param {FooterBlockProps} FooterBlockProps
|
|
37
19
|
* @see Block
|
|
38
20
|
*/
|
|
39
|
-
var FooterBlock = function FooterBlock(
|
|
40
|
-
var status =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_props$testId = props.testId,
|
|
45
|
-
testId = _props$testId === void 0 ? 'smart-footer-block' : _props$testId,
|
|
46
|
-
onActionMenuOpenChange = props.onActionMenuOpenChange;
|
|
47
|
-
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
48
|
-
var hasActions = (0, _react.useMemo)(function () {
|
|
49
|
-
var _filterActionItems;
|
|
50
|
-
return ((_filterActionItems = (0, _utils.filterActionItems)(actions, context)) === null || _filterActionItems === void 0 ? void 0 : _filterActionItems.length) > 0;
|
|
51
|
-
}, [actions, context]);
|
|
52
|
-
var onDropdownOpenChange = (0, _react.useCallback)(function (isOpen) {
|
|
53
|
-
if (onActionMenuOpenChange) {
|
|
54
|
-
onActionMenuOpenChange({
|
|
55
|
-
isOpen: isOpen
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}, [onActionMenuOpenChange]);
|
|
21
|
+
var FooterBlock = function FooterBlock(_ref) {
|
|
22
|
+
var status = _ref.status,
|
|
23
|
+
_ref$testId = _ref.testId,
|
|
24
|
+
testId = _ref$testId === void 0 ? 'smart-footer-block' : _ref$testId,
|
|
25
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
59
26
|
if (status !== _constants.SmartLinkStatus.Resolved) {
|
|
60
27
|
return null;
|
|
61
28
|
}
|
|
62
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
63
|
-
testId:
|
|
64
|
-
})
|
|
65
|
-
testId: "".concat(testId, "-provider")
|
|
66
|
-
}), actions && hasActions ? /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
67
|
-
testId: "smart-element-group-actions",
|
|
68
|
-
align: _constants.SmartLinkAlignment.Right,
|
|
69
|
-
direction: _constants.SmartLinkDirection.Horizontal,
|
|
70
|
-
overrideCss: getActionGroupStyles(size),
|
|
71
|
-
width: _constants.SmartLinkWidth.Flexible
|
|
72
|
-
}, /*#__PURE__*/_react.default.createElement(_actionGroup.default, {
|
|
73
|
-
onDropdownOpenChange: onDropdownOpenChange,
|
|
74
|
-
items: actions,
|
|
75
|
-
appearance: "default"
|
|
76
|
-
})) : null);
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, props, {
|
|
30
|
+
testId: testId
|
|
31
|
+
}));
|
|
77
32
|
};
|
|
78
33
|
var _default = exports.default = FooterBlock;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
var _react = require("@emotion/react");
|
|
12
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _constants = require("../../../../../../constants");
|
|
14
|
+
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
15
|
+
var _elements = require("../../../elements");
|
|
16
|
+
var _actionGroup = _interopRequireDefault(require("../../action-group"));
|
|
17
|
+
var _block = _interopRequireDefault(require("../../block"));
|
|
18
|
+
var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
19
|
+
var _utils = require("../../utils");
|
|
20
|
+
var _templateObject;
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
var getActionGroupStyles = function getActionGroupStyles(size) {
|
|
24
|
+
if (size === _constants.SmartLinkSize.XLarge) {
|
|
25
|
+
// The biggest height of the action button exceeds the max line-height
|
|
26
|
+
// of the elements causing the action on the block with x-large size to
|
|
27
|
+
// get cut at the bottom.
|
|
28
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n max-height: 2rem;\n "])));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
32
|
+
var actions = props.actions,
|
|
33
|
+
testId = props.testId,
|
|
34
|
+
onActionMenuOpenChange = props.onActionMenuOpenChange,
|
|
35
|
+
_props$size = props.size,
|
|
36
|
+
size = _props$size === void 0 ? _constants.SmartLinkSize.Medium : _props$size;
|
|
37
|
+
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
38
|
+
var hasActions = (0, _react2.useMemo)(function () {
|
|
39
|
+
var _filterActionItems;
|
|
40
|
+
return ((_filterActionItems = (0, _utils.filterActionItems)(actions, context)) === null || _filterActionItems === void 0 ? void 0 : _filterActionItems.length) > 0;
|
|
41
|
+
}, [actions, context]);
|
|
42
|
+
var onDropdownOpenChange = (0, _react2.useCallback)(function (isOpen) {
|
|
43
|
+
if (onActionMenuOpenChange) {
|
|
44
|
+
onActionMenuOpenChange({
|
|
45
|
+
isOpen: isOpen
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}, [onActionMenuOpenChange]);
|
|
49
|
+
return /*#__PURE__*/_react2.default.createElement(_block.default, (0, _extends2.default)({}, props, {
|
|
50
|
+
testId: "".concat(testId, "-resolved-view")
|
|
51
|
+
}), /*#__PURE__*/_react2.default.createElement(_elements.Provider, {
|
|
52
|
+
testId: "".concat(testId, "-provider")
|
|
53
|
+
}), actions && hasActions ? /*#__PURE__*/_react2.default.createElement(_elementGroup.default, {
|
|
54
|
+
testId: "smart-element-group-actions",
|
|
55
|
+
align: _constants.SmartLinkAlignment.Right,
|
|
56
|
+
direction: _constants.SmartLinkDirection.Horizontal,
|
|
57
|
+
overrideCss: getActionGroupStyles(size),
|
|
58
|
+
width: _constants.SmartLinkWidth.Flexible
|
|
59
|
+
}, /*#__PURE__*/_react2.default.createElement(_actionGroup.default, {
|
|
60
|
+
onDropdownOpenChange: onDropdownOpenChange,
|
|
61
|
+
items: actions,
|
|
62
|
+
appearance: "default"
|
|
63
|
+
})) : null);
|
|
64
|
+
};
|
|
65
|
+
var _default = exports.default = FooterBlockResolvedView;
|
|
@@ -16,6 +16,12 @@ Object.defineProperty(exports, "FooterBlock", {
|
|
|
16
16
|
return _footerBlock.default;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
+
Object.defineProperty(exports, "InternalFooterBlock", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _resolved.default;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
19
25
|
Object.defineProperty(exports, "MetadataBlock", {
|
|
20
26
|
enumerable: true,
|
|
21
27
|
get: function get() {
|
|
@@ -45,4 +51,5 @@ var _metadataBlock = _interopRequireDefault(require("./metadata-block"));
|
|
|
45
51
|
var _previewBlock = _interopRequireDefault(require("./preview-block"));
|
|
46
52
|
var _snippetBlock = _interopRequireDefault(require("./snippet-block"));
|
|
47
53
|
var _titleBlock = _interopRequireDefault(require("./title-block"));
|
|
48
|
-
var _block = _interopRequireDefault(require("./block"));
|
|
54
|
+
var _block = _interopRequireDefault(require("./block"));
|
|
55
|
+
var _resolved = _interopRequireDefault(require("./footer-block/resolved"));
|
|
@@ -12,7 +12,7 @@ var _block = _interopRequireDefault(require("../block"));
|
|
|
12
12
|
var _constants = require("../../../../../constants");
|
|
13
13
|
var _elements = require("../../elements");
|
|
14
14
|
var _utils = require("../../utils");
|
|
15
|
-
var _excluded = ["maxLines", "status", "testId"];
|
|
15
|
+
var _excluded = ["maxLines", "status", "testId", "text"];
|
|
16
16
|
var DEFAULT_MAX_LINES = 3;
|
|
17
17
|
var MAXIMUM_MAX_LINES = 3;
|
|
18
18
|
var MINIMUM_MAX_LINES = 1;
|
|
@@ -30,6 +30,7 @@ var SnippetBlock = function SnippetBlock(_ref) {
|
|
|
30
30
|
status = _ref$status === void 0 ? _constants.SmartLinkStatus.Fallback : _ref$status,
|
|
31
31
|
_ref$testId = _ref.testId,
|
|
32
32
|
testId = _ref$testId === void 0 ? 'smart-block-snippet' : _ref$testId,
|
|
33
|
+
text = _ref.text,
|
|
33
34
|
blockProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
34
35
|
if (status !== _constants.SmartLinkStatus.Resolved) {
|
|
35
36
|
return null;
|
|
@@ -38,7 +39,8 @@ var SnippetBlock = function SnippetBlock(_ref) {
|
|
|
38
39
|
return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
39
40
|
testId: "".concat(testId, "-resolved-view")
|
|
40
41
|
}), /*#__PURE__*/_react.default.createElement(_elements.Snippet, {
|
|
41
|
-
maxLines: snippetMaxLines
|
|
42
|
+
maxLines: snippetMaxLines,
|
|
43
|
+
text: text
|
|
42
44
|
}));
|
|
43
45
|
};
|
|
44
46
|
var _default = exports.default = SnippetBlock;
|
|
@@ -30,7 +30,8 @@ var Text = function Text(_ref) {
|
|
|
30
30
|
name = _ref.name,
|
|
31
31
|
overrideCss = _ref.overrideCss,
|
|
32
32
|
_ref$testId = _ref.testId,
|
|
33
|
-
testId = _ref$testId === void 0 ? 'smart-element-text' : _ref$testId
|
|
33
|
+
testId = _ref$testId === void 0 ? 'smart-element-text' : _ref$testId,
|
|
34
|
+
text = _ref.text;
|
|
34
35
|
if (!message && !content) {
|
|
35
36
|
return null;
|
|
36
37
|
}
|
|
@@ -40,6 +41,6 @@ var Text = function Text(_ref) {
|
|
|
40
41
|
"data-smart-element": name,
|
|
41
42
|
"data-smart-element-text": true,
|
|
42
43
|
"data-testid": testId
|
|
43
|
-
}, (0, _utils.getFormattedMessage)(message) || content);
|
|
44
|
+
}, text ? text : (0, _utils.getFormattedMessage)(message) || content);
|
|
44
45
|
};
|
|
45
46
|
var _default = exports.default = Text;
|
|
@@ -18,7 +18,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
18
18
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
19
19
|
var PACKAGE_DATA = {
|
|
20
20
|
packageName: "@atlaskit/smart-card",
|
|
21
|
-
packageVersion: "26.
|
|
21
|
+
packageVersion: "26.38.1",
|
|
22
22
|
componentName: 'linkUrl'
|
|
23
23
|
};
|
|
24
24
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.
|
|
7
|
+
packageVersion: "26.38.1"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -12,6 +12,7 @@ import { messages } from '../../../../messages';
|
|
|
12
12
|
* @param providerName a string which is inserted into the message of the button
|
|
13
13
|
*/
|
|
14
14
|
export const AuthorizeAction = (onAuthorize, providerName) => ({
|
|
15
|
+
appearance: 'primary',
|
|
15
16
|
name: ActionName.CustomAction,
|
|
16
17
|
content: providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_action, {
|
|
17
18
|
values: {
|
|
@@ -23,8 +23,6 @@ import FlexibleErroredView from './views/flexible/FlexibleErroredView';
|
|
|
23
23
|
import { jsx } from '@emotion/react';
|
|
24
24
|
import { handleClickCommon } from './utils/handlers';
|
|
25
25
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
26
|
-
import { titleBlockCss } from './views/flexible/styled';
|
|
27
|
-
import { SmartLinkSize } from '../../constants';
|
|
28
26
|
export { default as PreviewAction } from './actions/PreviewAction';
|
|
29
27
|
export { ForbiddenAction, AuthorizeAction, BlockCardResolvedView, BlockCardResolvingView, BlockCardUnauthorisedView, BlockCardForbiddenView, BlockCardErroredView, BlockCardNotFoundView };
|
|
30
28
|
export const BlockCard = ({
|
|
@@ -62,13 +60,6 @@ export const BlockCard = ({
|
|
|
62
60
|
extensionKey
|
|
63
61
|
};
|
|
64
62
|
if (enableFlexibleBlockCard) {
|
|
65
|
-
const anchorTarget = getBooleanFF('platform.linking-platform.smart-card.enable-block-card-clicks-opening-in-same-tab') ? '_self' : undefined;
|
|
66
|
-
const titleBlockProps = {
|
|
67
|
-
overrideCss: titleBlockCss,
|
|
68
|
-
...(getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && {
|
|
69
|
-
size: SmartLinkSize.Large
|
|
70
|
-
})
|
|
71
|
-
};
|
|
72
63
|
const flexibleBlockCardProps = {
|
|
73
64
|
id,
|
|
74
65
|
cardState,
|
|
@@ -79,12 +70,7 @@ export const BlockCard = ({
|
|
|
79
70
|
onResolve,
|
|
80
71
|
renderers,
|
|
81
72
|
showServerActions,
|
|
82
|
-
analytics
|
|
83
|
-
extensionKey,
|
|
84
|
-
titleBlockProps: titleBlockProps,
|
|
85
|
-
...(anchorTarget ? {
|
|
86
|
-
anchorTarget
|
|
87
|
-
} : {})
|
|
73
|
+
analytics
|
|
88
74
|
};
|
|
89
75
|
switch (status) {
|
|
90
76
|
case 'pending':
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import FlexibleCard from '../../../FlexibleCard';
|
|
4
|
-
import TitleBlock from '../../../FlexibleCard/components/blocks/title-block';
|
|
5
3
|
import { messages } from '../../../../messages';
|
|
6
4
|
import { R300 } from '@atlaskit/theme/colors';
|
|
7
5
|
import WarningIcon from '@atlaskit/icon/glyph/warning';
|
|
8
|
-
import BlockCardFooter from '../../components/flexible/footer';
|
|
9
6
|
import { RetryAction } from '../../actions/flexible/RetryAction';
|
|
10
|
-
import { CustomBlock } from '../../../FlexibleCard/components/blocks';
|
|
11
7
|
import Text from '../../../FlexibleCard/components/elements/text';
|
|
8
|
+
import UnresolvedView from './unresolved-view';
|
|
12
9
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
13
10
|
|
|
14
11
|
/**
|
|
@@ -18,32 +15,14 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
18
15
|
* @see FlexibleCardProps
|
|
19
16
|
*/
|
|
20
17
|
const FlexibleErroredView = ({
|
|
21
|
-
anchorTarget,
|
|
22
|
-
cardState,
|
|
23
|
-
onAuthorize,
|
|
24
|
-
onError,
|
|
25
|
-
url,
|
|
26
|
-
onClick,
|
|
27
18
|
testId = 'smart-block-errored-view',
|
|
28
|
-
|
|
19
|
+
...props
|
|
29
20
|
}) => {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
onAuthorize: onAuthorize,
|
|
36
|
-
onClick: onClick,
|
|
37
|
-
onError: onError,
|
|
38
|
-
testId: testId,
|
|
39
|
-
ui: {
|
|
40
|
-
hideElevation: true
|
|
41
|
-
},
|
|
42
|
-
url: url
|
|
43
|
-
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({
|
|
44
|
-
hideRetry: true,
|
|
45
|
-
anchorTarget: anchorTarget
|
|
46
|
-
}, titleBlockProps)), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(WarningIcon, {
|
|
21
|
+
const actions = useMemo(() => props.onAuthorize ? [RetryAction(props.onAuthorize)] : [], [props.onAuthorize]);
|
|
22
|
+
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
|
|
23
|
+
actions: actions,
|
|
24
|
+
testId: testId
|
|
25
|
+
}), /*#__PURE__*/React.createElement(WarningIcon, {
|
|
47
26
|
label: "errored-warning-icon",
|
|
48
27
|
size: "small",
|
|
49
28
|
primaryColor: `var(--ds-icon-warning, ${R300})`,
|
|
@@ -52,9 +31,6 @@ const FlexibleErroredView = ({
|
|
|
52
31
|
message: {
|
|
53
32
|
descriptor: messages.could_not_load_link
|
|
54
33
|
}
|
|
55
|
-
}))
|
|
56
|
-
actions: actions,
|
|
57
|
-
status: status
|
|
58
|
-
})));
|
|
34
|
+
}));
|
|
59
35
|
};
|
|
60
36
|
export default withFlexibleUIBlockCardStyle(FlexibleErroredView);
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import { CustomBlock, PreviewBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
|
|
3
|
+
import { toMessage } from '../../../../utils/intl-utils';
|
|
5
4
|
import { R300 } from '@atlaskit/theme/colors';
|
|
6
5
|
import { messages } from '../../../../messages';
|
|
7
6
|
import LockIcon from '@atlaskit/icon/glyph/lock';
|
|
8
|
-
import BlockCardFooter from '../../components/flexible/footer';
|
|
9
7
|
import { ForbiddenAction } from '../../actions/flexible/ForbiddenAction';
|
|
10
8
|
import Text from '../../../FlexibleCard/components/elements/text';
|
|
11
|
-
import { MediaPlacement, SmartLinkSize } from '../../../../constants';
|
|
12
9
|
import { getForbiddenJsonLd } from '../../../../utils/jsonld';
|
|
13
10
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
11
|
+
import UnresolvedView from './unresolved-view';
|
|
14
12
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
15
13
|
import { extractRequestAccessContextImproved } from '../../../../extractors/common/context/extractAccessContext';
|
|
16
|
-
import {
|
|
17
|
-
import { forbiddenViewTitleStyle } from './styled';
|
|
14
|
+
import { useIntl } from 'react-intl-next';
|
|
18
15
|
import extractHostname from '../../../../extractors/common/hostname/extractHostname';
|
|
19
16
|
|
|
20
17
|
/**
|
|
@@ -25,17 +22,16 @@ import extractHostname from '../../../../extractors/common/hostname/extractHostn
|
|
|
25
22
|
* @see FlexibleCardProps
|
|
26
23
|
*/
|
|
27
24
|
const FlexibleForbiddenView = ({
|
|
28
|
-
anchorTarget,
|
|
29
|
-
cardState,
|
|
30
|
-
onAuthorize,
|
|
31
|
-
onClick,
|
|
32
|
-
onError,
|
|
33
25
|
testId = 'smart-block-forbidden-view',
|
|
34
|
-
|
|
35
|
-
titleBlockProps
|
|
26
|
+
...props
|
|
36
27
|
}) => {
|
|
37
28
|
var _details$meta;
|
|
38
|
-
const
|
|
29
|
+
const intl = useIntl();
|
|
30
|
+
const {
|
|
31
|
+
cardState,
|
|
32
|
+
onAuthorize,
|
|
33
|
+
url
|
|
34
|
+
} = props;
|
|
39
35
|
const details = cardState === null || cardState === void 0 ? void 0 : cardState.details;
|
|
40
36
|
const cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : getForbiddenJsonLd().meta;
|
|
41
37
|
const provider = extractProvider(details === null || details === void 0 ? void 0 : details.data);
|
|
@@ -54,11 +50,12 @@ const FlexibleForbiddenView = ({
|
|
|
54
50
|
product: providerName
|
|
55
51
|
});
|
|
56
52
|
}, [cardMetadata, providerName, url]);
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
const title = useMemo(() => {
|
|
54
|
+
const descriptor = toMessage(messages.invalid_permissions, requestAccessContext === null || requestAccessContext === void 0 ? void 0 : requestAccessContext.titleMessageKey);
|
|
55
|
+
return intl.formatMessage(descriptor, {
|
|
56
|
+
product: providerName
|
|
57
|
+
});
|
|
58
|
+
}, [intl, providerName, requestAccessContext === null || requestAccessContext === void 0 ? void 0 : requestAccessContext.titleMessageKey]);
|
|
62
59
|
const actions = useMemo(() => {
|
|
63
60
|
let actionFromAccessContext = [];
|
|
64
61
|
const tryAnotherAccountAction = onAuthorize ? [ForbiddenAction(onAuthorize, 'try_another_account')] : [];
|
|
@@ -67,34 +64,16 @@ const FlexibleForbiddenView = ({
|
|
|
67
64
|
action,
|
|
68
65
|
callToActionMessageKey
|
|
69
66
|
} = requestAccessContext;
|
|
70
|
-
actionFromAccessContext = action && callToActionMessageKey ? [ForbiddenAction(action.promise, callToActionMessageKey, messageContext, buttonDisabled)] : [];
|
|
67
|
+
actionFromAccessContext = action && callToActionMessageKey ? [ForbiddenAction(action.promise, callToActionMessageKey, messageContext, requestAccessContext === null || requestAccessContext === void 0 ? void 0 : requestAccessContext.buttonDisabled)] : [];
|
|
71
68
|
}
|
|
72
69
|
return [...tryAnotherAccountAction, ...actionFromAccessContext];
|
|
73
|
-
}, [onAuthorize, requestAccessContext, messageContext
|
|
74
|
-
return /*#__PURE__*/React.createElement(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
onAuthorize: onAuthorize,
|
|
78
|
-
onClick: onClick,
|
|
79
|
-
onError: onError,
|
|
70
|
+
}, [onAuthorize, requestAccessContext, messageContext]);
|
|
71
|
+
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
|
|
72
|
+
actions: actions,
|
|
73
|
+
showPreview: true,
|
|
80
74
|
testId: testId,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
size: SmartLinkSize.Medium
|
|
84
|
-
},
|
|
85
|
-
url: url
|
|
86
|
-
}, titleMessageKey ? /*#__PURE__*/React.createElement(CustomBlock, {
|
|
87
|
-
overrideCss: forbiddenViewTitleStyle,
|
|
88
|
-
testId: `${testId}-title`
|
|
89
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
90
|
-
target: anchorTarget,
|
|
91
|
-
href: url
|
|
92
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[titleMessageKey], {
|
|
93
|
-
values: messageContext
|
|
94
|
-
})))) : /*#__PURE__*/React.createElement(TitleBlock, _extends({
|
|
95
|
-
hideRetry: true,
|
|
96
|
-
anchorTarget: anchorTarget
|
|
97
|
-
}, titleBlockProps)), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(LockIcon, {
|
|
75
|
+
title: title
|
|
76
|
+
}), /*#__PURE__*/React.createElement(LockIcon, {
|
|
98
77
|
label: "forbidden-lock-icon",
|
|
99
78
|
size: "small",
|
|
100
79
|
primaryColor: `var(--ds-icon-danger, ${R300})`,
|
|
@@ -102,15 +81,9 @@ const FlexibleForbiddenView = ({
|
|
|
102
81
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
103
82
|
maxLines: 2,
|
|
104
83
|
message: {
|
|
105
|
-
descriptor: messages
|
|
84
|
+
descriptor: toMessage(messages.invalid_permissions_description, requestAccessContext === null || requestAccessContext === void 0 ? void 0 : requestAccessContext.descriptiveMessageKey),
|
|
106
85
|
values: messageContext
|
|
107
86
|
}
|
|
108
|
-
}))
|
|
109
|
-
placement: MediaPlacement.Right,
|
|
110
|
-
ignoreContainerPadding: true
|
|
111
|
-
}), /*#__PURE__*/React.createElement(CustomBlock, null, /*#__PURE__*/React.createElement(BlockCardFooter, {
|
|
112
|
-
actions: actions,
|
|
113
|
-
status: status
|
|
114
|
-
})));
|
|
87
|
+
}));
|
|
115
88
|
};
|
|
116
89
|
export default withFlexibleUIBlockCardStyle(FlexibleForbiddenView);
|