@atlaskit/smart-card 36.12.1 → 36.13.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 +14 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/index.js +7 -0
- package/dist/cjs/view/FlexibleCard/components/actions/unresolved-action/index.compiled.css +3 -0
- package/dist/cjs/view/FlexibleCard/components/actions/unresolved-action/index.js +51 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +15 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +9 -3
- package/dist/cjs/view/FlexibleCard/components/container/index.js +6 -7
- package/dist/cjs/view/FlexibleCard/external.js +4 -1
- package/dist/cjs/view/FlexibleCard/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/utils.js +6 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/unresolved-action/index.compiled.css +3 -0
- package/dist/es2019/view/FlexibleCard/components/actions/unresolved-action/index.js +46 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +15 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +9 -3
- package/dist/es2019/view/FlexibleCard/components/container/index.js +4 -2
- package/dist/es2019/view/FlexibleCard/external.js +3 -2
- package/dist/es2019/view/FlexibleCard/index.js +4 -2
- package/dist/es2019/view/FlexibleCard/utils.js +8 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/constants.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/unresolved-action/index.compiled.css +3 -0
- package/dist/esm/view/FlexibleCard/components/actions/unresolved-action/index.js +44 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +16 -3
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +9 -3
- package/dist/esm/view/FlexibleCard/components/container/index.js +5 -4
- package/dist/esm/view/FlexibleCard/external.js +4 -1
- package/dist/esm/view/FlexibleCard/index.js +4 -2
- package/dist/esm/view/FlexibleCard/utils.js +7 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/unresolved-action/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/external.d.ts +1 -0
- package/dist/types/view/FlexibleCard/types.d.ts +1 -1
- package/dist/types-ts4.5/constants.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/unresolved-action/index.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/external.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 36.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 36.13.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#148306](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148306)
|
|
14
|
+
[`4bd610f4ddae6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4bd610f4ddae6) -
|
|
15
|
+
[ux] Export unresolved action behind platform-linking-flexible-card-unresolved-action fg
|
|
16
|
+
|
|
3
17
|
## 36.12.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -158,6 +158,7 @@ var ActionName = exports.ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
158
158
|
}({});
|
|
159
159
|
var InternalActionName = exports.InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
160
160
|
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
161
|
+
InternalActionName["UnresolvedAction"] = "UnresolvedAction";
|
|
161
162
|
InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
|
|
162
163
|
return InternalActionName;
|
|
163
164
|
}({});
|
package/dist/cjs/index.js
CHANGED
|
@@ -339,6 +339,12 @@ Object.defineProperty(exports, "TitleElement", {
|
|
|
339
339
|
return _external.TitleElement;
|
|
340
340
|
}
|
|
341
341
|
});
|
|
342
|
+
Object.defineProperty(exports, "UnresolvedAction", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function get() {
|
|
345
|
+
return _external.UnresolvedAction;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
342
348
|
Object.defineProperty(exports, "ViewCountElement", {
|
|
343
349
|
enumerable: true,
|
|
344
350
|
get: function get() {
|
|
@@ -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: "36.
|
|
14
|
+
packageVersion: "36.13.1"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -58,6 +58,12 @@ Object.defineProperty(exports, "PreviewAction", {
|
|
|
58
58
|
return _previewAction.default;
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
+
Object.defineProperty(exports, "UnresolvedAction", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function get() {
|
|
64
|
+
return _unresolvedAction.default;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
61
67
|
Object.defineProperty(exports, "ViewRelatedLinksAction", {
|
|
62
68
|
enumerable: true,
|
|
63
69
|
get: function get() {
|
|
@@ -71,6 +77,7 @@ var _downloadAction = _interopRequireDefault(require("./download-action"));
|
|
|
71
77
|
var _followAction = _interopRequireDefault(require("./follow-action"));
|
|
72
78
|
var _previewAction = _interopRequireDefault(require("./preview-action"));
|
|
73
79
|
var _copyLinkAction = _interopRequireDefault(require("./copy-link-action"));
|
|
80
|
+
var _unresolvedAction = _interopRequireDefault(require("./unresolved-action"));
|
|
74
81
|
var _aiSummaryAction = _interopRequireDefault(require("./ai-summary-action"));
|
|
75
82
|
var _automationAction = _interopRequireDefault(require("./automation-action"));
|
|
76
83
|
var _viewRelatedLinksAction = _interopRequireDefault(require("./view-related-links-action"));
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
require("./index.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
11
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
var _reactIntlNext = require("react-intl-next");
|
|
14
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
|
+
var _constants = require("../../../../../constants");
|
|
16
|
+
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
17
|
+
var styles = {
|
|
18
|
+
button: "_1e0c1bgi",
|
|
19
|
+
message: "_1rjcze3t _18zrze3t"
|
|
20
|
+
};
|
|
21
|
+
var UnresolvedAction = function UnresolvedAction(_ref) {
|
|
22
|
+
var _context$actions;
|
|
23
|
+
var _ref$testId = _ref.testId,
|
|
24
|
+
testId = _ref$testId === void 0 ? 'unresolved-action' : _ref$testId;
|
|
25
|
+
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
26
|
+
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.InternalActionName.UnresolvedAction];
|
|
27
|
+
if (!data) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
var descriptor = data.descriptor,
|
|
31
|
+
onClick = data.onClick,
|
|
32
|
+
values = data.values;
|
|
33
|
+
var hasAction = onClick !== undefined;
|
|
34
|
+
var message = /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
35
|
+
testId: "".concat(testId, "-errored-view-message"),
|
|
36
|
+
tabIndex: hasAction ? 0 : undefined,
|
|
37
|
+
xcss: styles.message
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, descriptor, {
|
|
39
|
+
values: values
|
|
40
|
+
})));
|
|
41
|
+
return hasAction ? /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
|
|
42
|
+
onClick: data.onClick,
|
|
43
|
+
style: {
|
|
44
|
+
color: "inherit",
|
|
45
|
+
font: "inherit",
|
|
46
|
+
textAlign: "inherit"
|
|
47
|
+
},
|
|
48
|
+
xcss: styles.button
|
|
49
|
+
}, message) : message;
|
|
50
|
+
};
|
|
51
|
+
var _default = exports.default = UnresolvedAction;
|
|
@@ -9,12 +9,15 @@ 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
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
13
14
|
var _constants = require("../../../../../../constants");
|
|
15
|
+
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
16
|
+
var _actions = require("../../../actions");
|
|
14
17
|
var _elements = require("../../../elements");
|
|
15
18
|
var _block = _interopRequireDefault(require("../../block"));
|
|
16
19
|
var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
17
|
-
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
20
|
+
var _excluded = ["actionGroup", "hideRetry", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
18
21
|
/**
|
|
19
22
|
* Represents an Errored TitleBlock view.
|
|
20
23
|
* This will render when a Smart Link did not successfully resolve.
|
|
@@ -23,7 +26,9 @@ var _excluded = ["actionGroup", "retry", "position", "testId", "title", "icon",
|
|
|
23
26
|
* @see TitleBlock
|
|
24
27
|
*/
|
|
25
28
|
var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
29
|
+
var _context$actions;
|
|
26
30
|
var actionGroup = _ref.actionGroup,
|
|
31
|
+
hideRetry = _ref.hideRetry,
|
|
27
32
|
retry = _ref.retry,
|
|
28
33
|
position = _ref.position,
|
|
29
34
|
testId = _ref.testId,
|
|
@@ -36,12 +41,20 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
36
41
|
onClick = _ref2.onClick,
|
|
37
42
|
values = _ref2.values;
|
|
38
43
|
var hasAction = onClick !== undefined;
|
|
44
|
+
var context = (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-unresolved-action') ?
|
|
45
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
46
|
+
(0, _flexibleUiContext.useFlexibleUiContext)() : {};
|
|
47
|
+
var showRetry = (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-unresolved-action') ? !hideRetry && Boolean(context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.InternalActionName.UnresolvedAction]) : false;
|
|
39
48
|
return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
40
49
|
testId: "".concat(testId, "-errored-view")
|
|
41
50
|
}), !hideIcon && /*#__PURE__*/_react.default.createElement(_elements.LinkIcon, {
|
|
42
51
|
overrideIcon: icon,
|
|
43
52
|
position: position
|
|
44
|
-
}), title,
|
|
53
|
+
}), title, showRetry && /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
54
|
+
align: _constants.SmartLinkAlignment.Right
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_actions.UnresolvedAction, {
|
|
56
|
+
testId: testId
|
|
57
|
+
})), !(0, _platformFeatureFlags.fg)('platform-linking-flexible-card-unresolved-action') && descriptor && /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
45
58
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
46
59
|
align: _constants.SmartLinkAlignment.Right
|
|
47
60
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
@@ -14,6 +14,7 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
18
|
var _constants = require("../../../../../constants");
|
|
18
19
|
var _useLinkClicked = require("../../../../../state/analytics/useLinkClicked");
|
|
19
20
|
var _elements = require("../../elements");
|
|
@@ -76,8 +77,10 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
76
77
|
hideIcon = _ref$hideIcon === void 0 ? false : _ref$hideIcon,
|
|
77
78
|
className = _ref.className,
|
|
78
79
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
79
|
-
if (
|
|
80
|
-
|
|
80
|
+
if (!(0, _platformFeatureFlags.fg)('platform-linking-flexible-card-unresolved-action')) {
|
|
81
|
+
if (hideRetry && props.retry) {
|
|
82
|
+
delete props.retry;
|
|
83
|
+
}
|
|
81
84
|
}
|
|
82
85
|
var _useState = (0, _react.useState)(false),
|
|
83
86
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -117,7 +120,10 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
117
120
|
testId: testId,
|
|
118
121
|
title: title,
|
|
119
122
|
metadataPosition: metadataPosition,
|
|
120
|
-
hideIcon: hideIcon
|
|
123
|
+
hideIcon: hideIcon
|
|
124
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-unresolved-action') ? {
|
|
125
|
+
hideRetry: hideRetry
|
|
126
|
+
} : undefined, {
|
|
121
127
|
icon: icon,
|
|
122
128
|
size: props.size,
|
|
123
129
|
theme: theme
|
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.getFlexibleUiBlock = exports.getChildrenOptions = exports.default = void 0;
|
|
10
10
|
require("./index.compiled.css");
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
16
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -23,12 +23,10 @@ var _blocks = require("../blocks");
|
|
|
23
23
|
var _hoverCardControl = _interopRequireDefault(require("./hover-card-control"));
|
|
24
24
|
var _layeredLink = _interopRequireDefault(require("./layered-link"));
|
|
25
25
|
var _excluded = ["containerSize"];
|
|
26
|
-
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
27
|
-
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
28
26
|
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); }
|
|
29
27
|
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; }
|
|
30
28
|
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; }
|
|
31
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */ /* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
32
30
|
var getChildrenOptions = exports.getChildrenOptions = function getChildrenOptions(children, context) {
|
|
33
31
|
var options = {};
|
|
34
32
|
if ((0, _utils.isFlexUiPreviewPresent)(context)) {
|
|
@@ -63,14 +61,15 @@ var renderChildren = function renderChildren(children, containerSize, containerT
|
|
|
63
61
|
} else {
|
|
64
62
|
var _blockSize = child.props.size;
|
|
65
63
|
var _size = _blockSize || containerSize;
|
|
66
|
-
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
64
|
+
return /*#__PURE__*/_react.default.cloneElement(child, _objectSpread({
|
|
67
65
|
// @ts-expect-error
|
|
68
66
|
onClick: onClick,
|
|
69
|
-
retry: retry,
|
|
70
67
|
size: _size,
|
|
71
68
|
status: status,
|
|
72
69
|
theme: containerTheme
|
|
73
|
-
})
|
|
70
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-unresolved-action') ? undefined : {
|
|
71
|
+
retry: retry
|
|
72
|
+
}));
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
var blockSize = child.props.size;
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.toActionProps = exports.VoteCountElement = exports.ViewCountElement = exports.TitleElement = exports.TargetBranchElement = exports.SubscriberCountElement = exports.SubTasksProgressElement = exports.StoryPointsElement = exports.StateElement = exports.SourceBranchElement = exports.SnippetElement = exports.SentOnElement = exports.ReadTimeElement = exports.ReactCountElement = exports.ProviderElement = exports.ProgrammingLanguageElement = exports.PriorityElement = exports.PreviewElement = exports.PreviewAction = exports.OwnedByGroupElement = exports.OwnedByElement = exports.ModifiedOnElement = exports.ModifiedByElement = exports.LocationElement = exports.LinkIconElement = exports.LatestCommitElement = exports.FollowAction = exports.DueOnElement = exports.DownloadAction = exports.CustomAction = exports.CreatedOnElement = exports.CreatedByElement = exports.CopyLinkAction = exports.CommentCountElement = exports.CollaboratorGroupElement = exports.ChecklistProgressElement = exports.AuthorGroupElement = exports.AttachmentCountElement = exports.AssignedToGroupElement = exports.AssignedToElement = void 0;
|
|
7
|
+
exports.toActionProps = exports.VoteCountElement = exports.ViewCountElement = exports.UnresolvedAction = exports.TitleElement = exports.TargetBranchElement = exports.SubscriberCountElement = exports.SubTasksProgressElement = exports.StoryPointsElement = exports.StateElement = exports.SourceBranchElement = exports.SnippetElement = exports.SentOnElement = exports.ReadTimeElement = exports.ReactCountElement = exports.ProviderElement = exports.ProgrammingLanguageElement = exports.PriorityElement = exports.PreviewElement = exports.PreviewAction = exports.OwnedByGroupElement = exports.OwnedByElement = exports.ModifiedOnElement = exports.ModifiedByElement = exports.LocationElement = exports.LinkIconElement = exports.LatestCommitElement = exports.FollowAction = exports.DueOnElement = exports.DownloadAction = exports.CustomAction = exports.CreatedOnElement = exports.CreatedByElement = exports.CopyLinkAction = exports.CommentCountElement = exports.CollaboratorGroupElement = exports.ChecklistProgressElement = exports.AuthorGroupElement = exports.AttachmentCountElement = exports.AssignedToGroupElement = exports.AssignedToElement = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _actions = require("./components/actions");
|
|
@@ -157,4 +157,7 @@ var FollowAction = exports.FollowAction = function FollowAction(props) {
|
|
|
157
157
|
};
|
|
158
158
|
var PreviewAction = exports.PreviewAction = function PreviewAction(props) {
|
|
159
159
|
return /*#__PURE__*/_react.default.createElement(_actions.PreviewAction, toActionProps(props));
|
|
160
|
+
};
|
|
161
|
+
var UnresolvedAction = exports.UnresolvedAction = function UnresolvedAction() {
|
|
162
|
+
return /*#__PURE__*/_react.default.createElement(_actions.UnresolvedAction, null);
|
|
160
163
|
};
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
|
|
12
13
|
var _constants = require("../../constants");
|
|
13
14
|
var _flexibleUiContext = require("../../state/flexible-ui-context");
|
|
@@ -55,6 +56,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
55
56
|
fireEvent: fireEvent,
|
|
56
57
|
response: details,
|
|
57
58
|
id: id,
|
|
59
|
+
onAuthorize: onAuthorize,
|
|
58
60
|
origin: origin,
|
|
59
61
|
renderers: renderers,
|
|
60
62
|
resolve: resolve,
|
|
@@ -62,8 +64,8 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
62
64
|
status: status,
|
|
63
65
|
url: url
|
|
64
66
|
});
|
|
65
|
-
}, [aiSummaryConfig, appearance, details, fireEvent, id, origin, renderers, actionOptions, resolve, status, url]);
|
|
66
|
-
var retry = (0, _utils.getRetryOptions)(url, status, details, onAuthorize);
|
|
67
|
+
}, [aiSummaryConfig, appearance, details, fireEvent, id, onAuthorize, origin, renderers, actionOptions, resolve, status, url]);
|
|
68
|
+
var retry = (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-unresolved-action') ? undefined : (0, _utils.getRetryOptions)(url, status, details, onAuthorize);
|
|
67
69
|
var _ref2 = context || {},
|
|
68
70
|
title = _ref2.title;
|
|
69
71
|
(0, _react.useEffect)(function () {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.getRetryOptions = exports.getContextByStatus = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
10
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _constants = require("../../constants");
|
|
@@ -39,6 +40,7 @@ var getContextByStatus = exports.getContextByStatus = function getContextByStatu
|
|
|
39
40
|
case _constants.SmartLinkStatus.Errored:
|
|
40
41
|
case _constants.SmartLinkStatus.Fallback:
|
|
41
42
|
default:
|
|
43
|
+
var actions = (0, _platformFeatureFlags.fg)('platform-linking-flexible-card-unresolved-action') ? (0, _defineProperty2.default)({}, _constants.InternalActionName.UnresolvedAction, getRetryOptions(url, status, response, params.onAuthorize)) : undefined;
|
|
42
44
|
if ((0, _platformFeatureFlags.fg)('smart_links_noun_support')) {
|
|
43
45
|
if ((0, _linkExtractors.isEntityPresent)(response)) {
|
|
44
46
|
return {
|
|
@@ -46,7 +48,8 @@ var getContextByStatus = exports.getContextByStatus = function getContextByStatu
|
|
|
46
48
|
title: url,
|
|
47
49
|
linkIcon: (0, _icon.extractErrorIcon)(response, status),
|
|
48
50
|
preview: (0, _extractPreview.extractSmartLinkPreviewImage)(response),
|
|
49
|
-
provider: (0, _extractProviderIcon.extractSmartLinkProviderIcon)(response)
|
|
51
|
+
provider: (0, _extractProviderIcon.extractSmartLinkProviderIcon)(response),
|
|
52
|
+
actions: actions
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
55
|
}
|
|
@@ -55,7 +58,8 @@ var getContextByStatus = exports.getContextByStatus = function getContextByStatu
|
|
|
55
58
|
title: url,
|
|
56
59
|
linkIcon: (0, _icon.extractErrorIcon)(response, status),
|
|
57
60
|
preview: (0, _extractPreview.default)(response === null || response === void 0 ? void 0 : response.data),
|
|
58
|
-
provider: (0, _extractProviderIcon.default)(response === null || response === void 0 ? void 0 : response.data)
|
|
61
|
+
provider: (0, _extractProviderIcon.default)(response === null || response === void 0 ? void 0 : response.data),
|
|
62
|
+
actions: actions
|
|
59
63
|
};
|
|
60
64
|
}
|
|
61
65
|
};
|
|
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
20
20
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
21
21
|
var PACKAGE_DATA = {
|
|
22
22
|
packageName: "@atlaskit/smart-card",
|
|
23
|
-
packageVersion: "36.
|
|
23
|
+
packageVersion: "36.13.1",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
package/dist/es2019/constants.js
CHANGED
|
@@ -160,6 +160,7 @@ export let ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
160
160
|
}({});
|
|
161
161
|
export let InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
162
162
|
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
163
|
+
InternalActionName["UnresolvedAction"] = "UnresolvedAction";
|
|
163
164
|
InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
|
|
164
165
|
return InternalActionName;
|
|
165
166
|
}({});
|
package/dist/es2019/index.js
CHANGED
|
@@ -15,6 +15,6 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
|
|
|
15
15
|
export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from './constants';
|
|
16
16
|
export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock } from './view/FlexibleCard/components/blocks';
|
|
17
17
|
export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement } from './view/FlexibleCard/external';
|
|
18
|
-
export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction } from './view/FlexibleCard/external';
|
|
18
|
+
export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction } from './view/FlexibleCard/external';
|
|
19
19
|
/** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
|
|
20
20
|
export { editorCardProvider, EditorCardProvider } from '@atlaskit/link-provider';
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "36.
|
|
5
|
+
packageVersion: "36.13.1"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,6 +5,7 @@ export { default as DownloadAction } from './download-action';
|
|
|
5
5
|
export { default as FollowAction } from './follow-action';
|
|
6
6
|
export { default as PreviewAction } from './preview-action';
|
|
7
7
|
export { default as CopyLinkAction } from './copy-link-action';
|
|
8
|
+
export { default as UnresolvedAction } from './unresolved-action';
|
|
8
9
|
export { default as AISummaryAction } from './ai-summary-action';
|
|
9
10
|
export { default as AutomationAction } from './automation-action';
|
|
10
11
|
export { default as ViewRelatedLinksAction } from './view-related-links-action';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
+
import { Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { InternalActionName } from '../../../../../constants';
|
|
9
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
10
|
+
const styles = {
|
|
11
|
+
button: "_1e0c1bgi",
|
|
12
|
+
message: "_1rjcze3t _18zrze3t"
|
|
13
|
+
};
|
|
14
|
+
const UnresolvedAction = ({
|
|
15
|
+
testId = 'unresolved-action'
|
|
16
|
+
}) => {
|
|
17
|
+
var _context$actions;
|
|
18
|
+
const context = useFlexibleUiContext();
|
|
19
|
+
const data = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction];
|
|
20
|
+
if (!data) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const {
|
|
24
|
+
descriptor,
|
|
25
|
+
onClick,
|
|
26
|
+
values
|
|
27
|
+
} = data;
|
|
28
|
+
const hasAction = onClick !== undefined;
|
|
29
|
+
const message = /*#__PURE__*/React.createElement(Box, {
|
|
30
|
+
testId: `${testId}-errored-view-message`,
|
|
31
|
+
tabIndex: hasAction ? 0 : undefined,
|
|
32
|
+
xcss: styles.message
|
|
33
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, descriptor, {
|
|
34
|
+
values: values
|
|
35
|
+
})));
|
|
36
|
+
return hasAction ? /*#__PURE__*/React.createElement(Pressable, {
|
|
37
|
+
onClick: data.onClick,
|
|
38
|
+
style: {
|
|
39
|
+
color: `inherit`,
|
|
40
|
+
font: `inherit`,
|
|
41
|
+
textAlign: `inherit`
|
|
42
|
+
},
|
|
43
|
+
xcss: styles.button
|
|
44
|
+
}, message) : message;
|
|
45
|
+
};
|
|
46
|
+
export default UnresolvedAction;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
5
|
-
import { SmartLinkAlignment, SmartLinkDirection } from '../../../../../../constants';
|
|
6
|
+
import { InternalActionName, SmartLinkAlignment, SmartLinkDirection } from '../../../../../../constants';
|
|
7
|
+
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
8
|
+
import { UnresolvedAction } from '../../../actions';
|
|
6
9
|
import { LinkIcon } from '../../../elements';
|
|
7
10
|
import Block from '../../block';
|
|
8
11
|
import ElementGroup from '../../element-group';
|
|
@@ -15,6 +18,7 @@ import ElementGroup from '../../element-group';
|
|
|
15
18
|
*/
|
|
16
19
|
const TitleBlockErroredView = ({
|
|
17
20
|
actionGroup,
|
|
21
|
+
hideRetry,
|
|
18
22
|
retry,
|
|
19
23
|
position,
|
|
20
24
|
testId,
|
|
@@ -23,18 +27,27 @@ const TitleBlockErroredView = ({
|
|
|
23
27
|
hideIcon,
|
|
24
28
|
...blockProps
|
|
25
29
|
}) => {
|
|
30
|
+
var _context$actions;
|
|
26
31
|
const {
|
|
27
32
|
descriptor,
|
|
28
33
|
onClick,
|
|
29
34
|
values
|
|
30
35
|
} = retry || {};
|
|
31
36
|
const hasAction = onClick !== undefined;
|
|
37
|
+
const context = fg('platform-linking-flexible-card-unresolved-action') ?
|
|
38
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
39
|
+
useFlexibleUiContext() : {};
|
|
40
|
+
const showRetry = fg('platform-linking-flexible-card-unresolved-action') ? !hideRetry && Boolean(context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction]) : false;
|
|
32
41
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
33
42
|
testId: `${testId}-errored-view`
|
|
34
43
|
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
35
44
|
overrideIcon: icon,
|
|
36
45
|
position: position
|
|
37
|
-
}), title,
|
|
46
|
+
}), title, showRetry && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
47
|
+
align: SmartLinkAlignment.Right
|
|
48
|
+
}, /*#__PURE__*/React.createElement(UnresolvedAction, {
|
|
49
|
+
testId: testId
|
|
50
|
+
})), !fg('platform-linking-flexible-card-unresolved-action') && descriptor && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
38
51
|
direction: SmartLinkDirection.Horizontal,
|
|
39
52
|
align: SmartLinkAlignment.Right
|
|
40
53
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
@@ -4,6 +4,7 @@ import "./index.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useState } from 'react';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
8
9
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
9
10
|
import { Title } from '../../elements';
|
|
@@ -60,8 +61,10 @@ const TitleBlock = ({
|
|
|
60
61
|
className,
|
|
61
62
|
...props
|
|
62
63
|
}) => {
|
|
63
|
-
if (
|
|
64
|
-
|
|
64
|
+
if (!fg('platform-linking-flexible-card-unresolved-action')) {
|
|
65
|
+
if (hideRetry && props.retry) {
|
|
66
|
+
delete props.retry;
|
|
67
|
+
}
|
|
65
68
|
}
|
|
66
69
|
const [actionDropdownOpen, setActionDropdownOpen] = useState(false);
|
|
67
70
|
const onDropdownOpenChange = useCallback(isOpen => {
|
|
@@ -98,7 +101,10 @@ const TitleBlock = ({
|
|
|
98
101
|
testId: testId,
|
|
99
102
|
title: title,
|
|
100
103
|
metadataPosition: metadataPosition,
|
|
101
|
-
hideIcon: hideIcon
|
|
104
|
+
hideIcon: hideIcon
|
|
105
|
+
}, fg('platform-linking-flexible-card-unresolved-action') ? {
|
|
106
|
+
hideRetry
|
|
107
|
+
} : undefined, {
|
|
102
108
|
icon: icon,
|
|
103
109
|
size: props.size,
|
|
104
110
|
theme: theme
|
|
@@ -55,10 +55,12 @@ const renderChildren = (children, containerSize, containerTheme, status, retry,
|
|
|
55
55
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
56
56
|
// @ts-expect-error
|
|
57
57
|
onClick,
|
|
58
|
-
retry,
|
|
59
58
|
size,
|
|
60
59
|
status,
|
|
61
|
-
theme: containerTheme
|
|
60
|
+
theme: containerTheme,
|
|
61
|
+
...(fg('platform-linking-flexible-card-unresolved-action') ? undefined : {
|
|
62
|
+
retry
|
|
63
|
+
})
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
66
|
}
|
|
@@ -8,7 +8,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
8
8
|
* DO NOT add a new prop to these components until we are ready to support it externally.
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import { CopyLinkAction as CopyLinkActionComponent, CustomAction as CustomActionComponent, DownloadAction as DownloadActionComponent, FollowAction as FollowActionComponent, PreviewAction as PreviewActionComponent } from './components/actions';
|
|
11
|
+
import { CopyLinkAction as CopyLinkActionComponent, CustomAction as CustomActionComponent, DownloadAction as DownloadActionComponent, FollowAction as FollowActionComponent, PreviewAction as PreviewActionComponent, UnresolvedAction as UnresolvedActionComponent } from './components/actions';
|
|
12
12
|
import { AssignedTo, AssignedToGroup, AttachmentCount, AuthorGroup, ChecklistProgress, CollaboratorGroup, CommentCount, CreatedBy, CreatedOn, DueOn, LatestCommit, LinkIcon, Location, ModifiedBy, ModifiedOn, OwnedBy, OwnedByGroup, Preview, Priority, ProgrammingLanguage, Provider, ReactCount, ReadTime, SentOn, Snippet, SourceBranch, State, StoryPoints, SubscriberCount, SubTasksProgress, TargetBranch, Title, ViewCount, VoteCount } from './components/elements';
|
|
13
13
|
// ---- EXPORTED METADATA COMPONENT ---- //
|
|
14
14
|
export const AssignedToElement = () => /*#__PURE__*/React.createElement(AssignedTo, null);
|
|
@@ -71,4 +71,5 @@ export const CustomAction = props => /*#__PURE__*/React.createElement(CustomActi
|
|
|
71
71
|
}));
|
|
72
72
|
export const DownloadAction = props => /*#__PURE__*/React.createElement(DownloadActionComponent, toActionProps(props));
|
|
73
73
|
export const FollowAction = props => /*#__PURE__*/React.createElement(FollowActionComponent, toActionProps(props));
|
|
74
|
-
export const PreviewAction = props => /*#__PURE__*/React.createElement(PreviewActionComponent, toActionProps(props));
|
|
74
|
+
export const PreviewAction = props => /*#__PURE__*/React.createElement(PreviewActionComponent, toActionProps(props));
|
|
75
|
+
export const UnresolvedAction = () => /*#__PURE__*/React.createElement(UnresolvedActionComponent, null);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useEffect, useMemo } from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
4
5
|
import { SmartLinkStatus } from '../../constants';
|
|
5
6
|
import { FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
|
|
@@ -48,14 +49,15 @@ const FlexibleCard = ({
|
|
|
48
49
|
fireEvent,
|
|
49
50
|
response: details,
|
|
50
51
|
id,
|
|
52
|
+
onAuthorize,
|
|
51
53
|
origin,
|
|
52
54
|
renderers,
|
|
53
55
|
resolve,
|
|
54
56
|
actionOptions,
|
|
55
57
|
status,
|
|
56
58
|
url
|
|
57
|
-
}), [aiSummaryConfig, appearance, details, fireEvent, id, origin, renderers, actionOptions, resolve, status, url]);
|
|
58
|
-
const retry = getRetryOptions(url, status, details, onAuthorize);
|
|
59
|
+
}), [aiSummaryConfig, appearance, details, fireEvent, id, onAuthorize, origin, renderers, actionOptions, resolve, status, url]);
|
|
60
|
+
const retry = fg('platform-linking-flexible-card-unresolved-action') ? undefined : getRetryOptions(url, status, details, onAuthorize);
|
|
59
61
|
const {
|
|
60
62
|
title
|
|
61
63
|
} = context || {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extractProvider, extractSmartLinkProvider, isEntityPresent } from '@atlaskit/link-extractors';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import { SmartLinkStatus } from '../../constants';
|
|
3
|
+
import { InternalActionName, SmartLinkStatus } from '../../constants';
|
|
4
4
|
import { extractRequestAccessContextImproved } from '../../extractors/common/context';
|
|
5
5
|
import extractFlexibleUiContext from '../../extractors/flexible';
|
|
6
6
|
import extractPreview, { extractSmartLinkPreviewImage } from '../../extractors/flexible/extract-preview';
|
|
@@ -30,6 +30,9 @@ export const getContextByStatus = params => {
|
|
|
30
30
|
case SmartLinkStatus.Errored:
|
|
31
31
|
case SmartLinkStatus.Fallback:
|
|
32
32
|
default:
|
|
33
|
+
const actions = fg('platform-linking-flexible-card-unresolved-action') ? {
|
|
34
|
+
[InternalActionName.UnresolvedAction]: getRetryOptions(url, status, response, params.onAuthorize)
|
|
35
|
+
} : undefined;
|
|
33
36
|
if (fg('smart_links_noun_support')) {
|
|
34
37
|
if (isEntityPresent(response)) {
|
|
35
38
|
return {
|
|
@@ -37,7 +40,8 @@ export const getContextByStatus = params => {
|
|
|
37
40
|
title: url,
|
|
38
41
|
linkIcon: extractErrorIcon(response, status),
|
|
39
42
|
preview: extractSmartLinkPreviewImage(response),
|
|
40
|
-
provider: extractSmartLinkProviderIcon(response)
|
|
43
|
+
provider: extractSmartLinkProviderIcon(response),
|
|
44
|
+
actions
|
|
41
45
|
};
|
|
42
46
|
}
|
|
43
47
|
}
|
|
@@ -46,7 +50,8 @@ export const getContextByStatus = params => {
|
|
|
46
50
|
title: url,
|
|
47
51
|
linkIcon: extractErrorIcon(response, status),
|
|
48
52
|
preview: extractPreview(response === null || response === void 0 ? void 0 : response.data),
|
|
49
|
-
provider: extractProviderIcon(response === null || response === void 0 ? void 0 : response.data)
|
|
53
|
+
provider: extractProviderIcon(response === null || response === void 0 ? void 0 : response.data),
|
|
54
|
+
actions
|
|
50
55
|
};
|
|
51
56
|
}
|
|
52
57
|
};
|
|
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
10
10
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
11
11
|
const PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "36.
|
|
13
|
+
packageVersion: "36.13.1",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
const Anchor = withLinkClickedEvent('a');
|
package/dist/esm/constants.js
CHANGED
|
@@ -160,6 +160,7 @@ export var ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
160
160
|
}({});
|
|
161
161
|
export var InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
162
162
|
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
163
|
+
InternalActionName["UnresolvedAction"] = "UnresolvedAction";
|
|
163
164
|
InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
|
|
164
165
|
return InternalActionName;
|
|
165
166
|
}({});
|
package/dist/esm/index.js
CHANGED
|
@@ -15,6 +15,6 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
|
|
|
15
15
|
export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from './constants';
|
|
16
16
|
export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock } from './view/FlexibleCard/components/blocks';
|
|
17
17
|
export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement } from './view/FlexibleCard/external';
|
|
18
|
-
export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction } from './view/FlexibleCard/external';
|
|
18
|
+
export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction } from './view/FlexibleCard/external';
|
|
19
19
|
/** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
|
|
20
20
|
export { editorCardProvider, EditorCardProvider } from '@atlaskit/link-provider';
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "36.
|
|
7
|
+
packageVersion: "36.13.1"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,6 +5,7 @@ export { default as DownloadAction } from './download-action';
|
|
|
5
5
|
export { default as FollowAction } from './follow-action';
|
|
6
6
|
export { default as PreviewAction } from './preview-action';
|
|
7
7
|
export { default as CopyLinkAction } from './copy-link-action';
|
|
8
|
+
export { default as UnresolvedAction } from './unresolved-action';
|
|
8
9
|
export { default as AISummaryAction } from './ai-summary-action';
|
|
9
10
|
export { default as AutomationAction } from './automation-action';
|
|
10
11
|
export { default as ViewRelatedLinksAction } from './view-related-links-action';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
+
import { Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { InternalActionName } from '../../../../../constants';
|
|
9
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
10
|
+
var styles = {
|
|
11
|
+
button: "_1e0c1bgi",
|
|
12
|
+
message: "_1rjcze3t _18zrze3t"
|
|
13
|
+
};
|
|
14
|
+
var UnresolvedAction = function UnresolvedAction(_ref) {
|
|
15
|
+
var _context$actions;
|
|
16
|
+
var _ref$testId = _ref.testId,
|
|
17
|
+
testId = _ref$testId === void 0 ? 'unresolved-action' : _ref$testId;
|
|
18
|
+
var context = useFlexibleUiContext();
|
|
19
|
+
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction];
|
|
20
|
+
if (!data) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
var descriptor = data.descriptor,
|
|
24
|
+
onClick = data.onClick,
|
|
25
|
+
values = data.values;
|
|
26
|
+
var hasAction = onClick !== undefined;
|
|
27
|
+
var message = /*#__PURE__*/React.createElement(Box, {
|
|
28
|
+
testId: "".concat(testId, "-errored-view-message"),
|
|
29
|
+
tabIndex: hasAction ? 0 : undefined,
|
|
30
|
+
xcss: styles.message
|
|
31
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, descriptor, {
|
|
32
|
+
values: values
|
|
33
|
+
})));
|
|
34
|
+
return hasAction ? /*#__PURE__*/React.createElement(Pressable, {
|
|
35
|
+
onClick: data.onClick,
|
|
36
|
+
style: {
|
|
37
|
+
color: "inherit",
|
|
38
|
+
font: "inherit",
|
|
39
|
+
textAlign: "inherit"
|
|
40
|
+
},
|
|
41
|
+
xcss: styles.button
|
|
42
|
+
}, message) : message;
|
|
43
|
+
};
|
|
44
|
+
export default UnresolvedAction;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
3
|
+
var _excluded = ["actionGroup", "hideRetry", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
|
-
import { SmartLinkAlignment, SmartLinkDirection } from '../../../../../../constants';
|
|
8
|
+
import { InternalActionName, SmartLinkAlignment, SmartLinkDirection } from '../../../../../../constants';
|
|
9
|
+
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
10
|
+
import { UnresolvedAction } from '../../../actions';
|
|
8
11
|
import { LinkIcon } from '../../../elements';
|
|
9
12
|
import Block from '../../block';
|
|
10
13
|
import ElementGroup from '../../element-group';
|
|
@@ -16,7 +19,9 @@ import ElementGroup from '../../element-group';
|
|
|
16
19
|
* @see TitleBlock
|
|
17
20
|
*/
|
|
18
21
|
var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
22
|
+
var _context$actions;
|
|
19
23
|
var actionGroup = _ref.actionGroup,
|
|
24
|
+
hideRetry = _ref.hideRetry,
|
|
20
25
|
retry = _ref.retry,
|
|
21
26
|
position = _ref.position,
|
|
22
27
|
testId = _ref.testId,
|
|
@@ -29,12 +34,20 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
29
34
|
onClick = _ref2.onClick,
|
|
30
35
|
values = _ref2.values;
|
|
31
36
|
var hasAction = onClick !== undefined;
|
|
37
|
+
var context = fg('platform-linking-flexible-card-unresolved-action') ?
|
|
38
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
39
|
+
useFlexibleUiContext() : {};
|
|
40
|
+
var showRetry = fg('platform-linking-flexible-card-unresolved-action') ? !hideRetry && Boolean(context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction]) : false;
|
|
32
41
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
33
42
|
testId: "".concat(testId, "-errored-view")
|
|
34
43
|
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
35
44
|
overrideIcon: icon,
|
|
36
45
|
position: position
|
|
37
|
-
}), title,
|
|
46
|
+
}), title, showRetry && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
47
|
+
align: SmartLinkAlignment.Right
|
|
48
|
+
}, /*#__PURE__*/React.createElement(UnresolvedAction, {
|
|
49
|
+
testId: testId
|
|
50
|
+
})), !fg('platform-linking-flexible-card-unresolved-action') && descriptor && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
38
51
|
direction: SmartLinkDirection.Horizontal,
|
|
39
52
|
align: SmartLinkAlignment.Right
|
|
40
53
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
@@ -7,6 +7,7 @@ import "./index.compiled.css";
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { ax, ix } from "@compiled/react/runtime";
|
|
9
9
|
import { useCallback, useState } from 'react';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
11
12
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
12
13
|
import { Title } from '../../elements';
|
|
@@ -66,8 +67,10 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
66
67
|
hideIcon = _ref$hideIcon === void 0 ? false : _ref$hideIcon,
|
|
67
68
|
className = _ref.className,
|
|
68
69
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
69
|
-
if (
|
|
70
|
-
|
|
70
|
+
if (!fg('platform-linking-flexible-card-unresolved-action')) {
|
|
71
|
+
if (hideRetry && props.retry) {
|
|
72
|
+
delete props.retry;
|
|
73
|
+
}
|
|
71
74
|
}
|
|
72
75
|
var _useState = useState(false),
|
|
73
76
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -107,7 +110,10 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
107
110
|
testId: testId,
|
|
108
111
|
title: title,
|
|
109
112
|
metadataPosition: metadataPosition,
|
|
110
|
-
hideIcon: hideIcon
|
|
113
|
+
hideIcon: hideIcon
|
|
114
|
+
}, fg('platform-linking-flexible-card-unresolved-action') ? {
|
|
115
|
+
hideRetry: hideRetry
|
|
116
|
+
} : undefined, {
|
|
111
117
|
icon: icon,
|
|
112
118
|
size: props.size,
|
|
113
119
|
theme: theme
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
var _excluded = ["containerSize"];
|
|
5
5
|
import "./index.compiled.css";
|
|
6
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -54,14 +54,15 @@ var renderChildren = function renderChildren(children, containerSize, containerT
|
|
|
54
54
|
} else {
|
|
55
55
|
var _blockSize = child.props.size;
|
|
56
56
|
var _size = _blockSize || containerSize;
|
|
57
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
57
|
+
return /*#__PURE__*/React.cloneElement(child, _objectSpread({
|
|
58
58
|
// @ts-expect-error
|
|
59
59
|
onClick: onClick,
|
|
60
|
-
retry: retry,
|
|
61
60
|
size: _size,
|
|
62
61
|
status: status,
|
|
63
62
|
theme: containerTheme
|
|
64
|
-
})
|
|
63
|
+
}, fg('platform-linking-flexible-card-unresolved-action') ? undefined : {
|
|
64
|
+
retry: retry
|
|
65
|
+
}));
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
var blockSize = child.props.size;
|
|
@@ -8,7 +8,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
8
8
|
* DO NOT add a new prop to these components until we are ready to support it externally.
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import { CopyLinkAction as CopyLinkActionComponent, CustomAction as CustomActionComponent, DownloadAction as DownloadActionComponent, FollowAction as FollowActionComponent, PreviewAction as PreviewActionComponent } from './components/actions';
|
|
11
|
+
import { CopyLinkAction as CopyLinkActionComponent, CustomAction as CustomActionComponent, DownloadAction as DownloadActionComponent, FollowAction as FollowActionComponent, PreviewAction as PreviewActionComponent, UnresolvedAction as UnresolvedActionComponent } from './components/actions';
|
|
12
12
|
import { AssignedTo, AssignedToGroup, AttachmentCount, AuthorGroup, ChecklistProgress, CollaboratorGroup, CommentCount, CreatedBy, CreatedOn, DueOn, LatestCommit, LinkIcon, Location, ModifiedBy, ModifiedOn, OwnedBy, OwnedByGroup, Preview, Priority, ProgrammingLanguage, Provider, ReactCount, ReadTime, SentOn, Snippet, SourceBranch, State, StoryPoints, SubscriberCount, SubTasksProgress, TargetBranch, Title, ViewCount, VoteCount } from './components/elements';
|
|
13
13
|
// ---- EXPORTED METADATA COMPONENT ---- //
|
|
14
14
|
export var AssignedToElement = function AssignedToElement() {
|
|
@@ -149,4 +149,7 @@ export var FollowAction = function FollowAction(props) {
|
|
|
149
149
|
};
|
|
150
150
|
export var PreviewAction = function PreviewAction(props) {
|
|
151
151
|
return /*#__PURE__*/React.createElement(PreviewActionComponent, toActionProps(props));
|
|
152
|
+
};
|
|
153
|
+
export var UnresolvedAction = function UnresolvedAction() {
|
|
154
|
+
return /*#__PURE__*/React.createElement(UnresolvedActionComponent, null);
|
|
152
155
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useEffect, useMemo } from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
4
5
|
import { SmartLinkStatus } from '../../constants';
|
|
5
6
|
import { FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
|
|
@@ -46,6 +47,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
46
47
|
fireEvent: fireEvent,
|
|
47
48
|
response: details,
|
|
48
49
|
id: id,
|
|
50
|
+
onAuthorize: onAuthorize,
|
|
49
51
|
origin: origin,
|
|
50
52
|
renderers: renderers,
|
|
51
53
|
resolve: resolve,
|
|
@@ -53,8 +55,8 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
53
55
|
status: status,
|
|
54
56
|
url: url
|
|
55
57
|
});
|
|
56
|
-
}, [aiSummaryConfig, appearance, details, fireEvent, id, origin, renderers, actionOptions, resolve, status, url]);
|
|
57
|
-
var retry = getRetryOptions(url, status, details, onAuthorize);
|
|
58
|
+
}, [aiSummaryConfig, appearance, details, fireEvent, id, onAuthorize, origin, renderers, actionOptions, resolve, status, url]);
|
|
59
|
+
var retry = fg('platform-linking-flexible-card-unresolved-action') ? undefined : getRetryOptions(url, status, details, onAuthorize);
|
|
58
60
|
var _ref2 = context || {},
|
|
59
61
|
title = _ref2.title;
|
|
60
62
|
useEffect(function () {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import { extractProvider, extractSmartLinkProvider, isEntityPresent } from '@atlaskit/link-extractors';
|
|
2
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import { SmartLinkStatus } from '../../constants';
|
|
4
|
+
import { InternalActionName, SmartLinkStatus } from '../../constants';
|
|
4
5
|
import { extractRequestAccessContextImproved } from '../../extractors/common/context';
|
|
5
6
|
import extractFlexibleUiContext from '../../extractors/flexible';
|
|
6
7
|
import extractPreview, { extractSmartLinkPreviewImage } from '../../extractors/flexible/extract-preview';
|
|
@@ -29,6 +30,7 @@ export var getContextByStatus = function getContextByStatus(params) {
|
|
|
29
30
|
case SmartLinkStatus.Errored:
|
|
30
31
|
case SmartLinkStatus.Fallback:
|
|
31
32
|
default:
|
|
33
|
+
var actions = fg('platform-linking-flexible-card-unresolved-action') ? _defineProperty({}, InternalActionName.UnresolvedAction, getRetryOptions(url, status, response, params.onAuthorize)) : undefined;
|
|
32
34
|
if (fg('smart_links_noun_support')) {
|
|
33
35
|
if (isEntityPresent(response)) {
|
|
34
36
|
return {
|
|
@@ -36,7 +38,8 @@ export var getContextByStatus = function getContextByStatus(params) {
|
|
|
36
38
|
title: url,
|
|
37
39
|
linkIcon: extractErrorIcon(response, status),
|
|
38
40
|
preview: extractSmartLinkPreviewImage(response),
|
|
39
|
-
provider: extractSmartLinkProviderIcon(response)
|
|
41
|
+
provider: extractSmartLinkProviderIcon(response),
|
|
42
|
+
actions: actions
|
|
40
43
|
};
|
|
41
44
|
}
|
|
42
45
|
}
|
|
@@ -45,7 +48,8 @@ export var getContextByStatus = function getContextByStatus(params) {
|
|
|
45
48
|
title: url,
|
|
46
49
|
linkIcon: extractErrorIcon(response, status),
|
|
47
50
|
preview: extractPreview(response === null || response === void 0 ? void 0 : response.data),
|
|
48
|
-
provider: extractProviderIcon(response === null || response === void 0 ? void 0 : response.data)
|
|
51
|
+
provider: extractProviderIcon(response === null || response === void 0 ? void 0 : response.data),
|
|
52
|
+
actions: actions
|
|
49
53
|
};
|
|
50
54
|
}
|
|
51
55
|
};
|
|
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
13
13
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
14
14
|
var PACKAGE_DATA = {
|
|
15
15
|
packageName: "@atlaskit/smart-card",
|
|
16
|
-
packageVersion: "36.
|
|
16
|
+
packageVersion: "36.13.1",
|
|
17
17
|
componentName: 'linkUrl'
|
|
18
18
|
};
|
|
19
19
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -139,6 +139,7 @@ export declare enum ActionName {
|
|
|
139
139
|
}
|
|
140
140
|
export declare enum InternalActionName {
|
|
141
141
|
AISummaryAction = "AISummaryAction",
|
|
142
|
+
UnresolvedAction = "UnresolvedAction",
|
|
142
143
|
ViewRelatedLinksAction = "ViewRelatedLinksAction"
|
|
143
144
|
}
|
|
144
145
|
export type FlexibleUiActionName = keyof typeof ActionName | keyof typeof InternalActionName;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
|
|
|
11
11
|
export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, } from './constants';
|
|
12
12
|
export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock, } from './view/FlexibleCard/components/blocks';
|
|
13
13
|
export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement, } from './view/FlexibleCard/external';
|
|
14
|
-
export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, } from './view/FlexibleCard/external';
|
|
14
|
+
export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, } from './view/FlexibleCard/external';
|
|
15
15
|
export type { ActionItem, ElementItem, OnActionMenuOpenChangeOptions, } from './view/FlexibleCard/components/blocks/types';
|
|
16
16
|
export type { AnalyticsAction, AnalyticsActionSubject, AnalyticsPayload, AnalyticsHandler, } from './utils/types';
|
|
17
17
|
/** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type LinkPerson } from '@atlaskit/link-extractors';
|
|
2
2
|
import { type ActionName, type IconType, type InternalActionName, type MediaType } from '../../constants';
|
|
3
3
|
import { type LinkLozenge } from '../../extractors/common/lozenge/types';
|
|
4
|
+
import { type RetryOptions } from '../../view/FlexibleCard/types';
|
|
4
5
|
import { type InvokeClientActionProps } from '../hooks/use-invoke-client-action/types';
|
|
5
6
|
import { type InvokeRequestWithCardDetails } from '../hooks/use-invoke/types';
|
|
6
7
|
/**
|
|
@@ -257,6 +258,7 @@ export type FlexibleUiActions = {
|
|
|
257
258
|
[ActionName.CopyLinkAction]?: CopyLinkActionData;
|
|
258
259
|
[InternalActionName.AISummaryAction]?: AISummaryActionData;
|
|
259
260
|
[ActionName.AutomationAction]?: AutomationActionData;
|
|
261
|
+
[InternalActionName.UnresolvedAction]?: UnresolvedActionData;
|
|
260
262
|
[InternalActionName.ViewRelatedLinksAction]?: ViewRelatedLinksActionData;
|
|
261
263
|
};
|
|
262
264
|
export type PreviewActionData = {
|
|
@@ -281,6 +283,7 @@ export type AutomationActionData = {
|
|
|
281
283
|
analyticsSource: string;
|
|
282
284
|
objectName?: string;
|
|
283
285
|
};
|
|
286
|
+
export type UnresolvedActionData = RetryOptions;
|
|
284
287
|
export type ViewRelatedLinksActionData = {
|
|
285
288
|
ari: string;
|
|
286
289
|
};
|
|
@@ -5,6 +5,7 @@ export { default as DownloadAction } from './download-action';
|
|
|
5
5
|
export { default as FollowAction } from './follow-action';
|
|
6
6
|
export { default as PreviewAction } from './preview-action';
|
|
7
7
|
export { default as CopyLinkAction } from './copy-link-action';
|
|
8
|
+
export { default as UnresolvedAction } from './unresolved-action';
|
|
8
9
|
export { default as AISummaryAction } from './ai-summary-action';
|
|
9
10
|
export { default as AutomationAction } from './automation-action';
|
|
10
11
|
export { default as ViewRelatedLinksAction } from './view-related-links-action';
|
|
@@ -7,5 +7,5 @@ import { type TitleBlockViewProps } from '../types';
|
|
|
7
7
|
* or the backend response was errored or malformed.
|
|
8
8
|
* @see TitleBlock
|
|
9
9
|
*/
|
|
10
|
-
declare const TitleBlockErroredView: ({ actionGroup, retry, position, testId, title, icon, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
|
|
10
|
+
declare const TitleBlockErroredView: ({ actionGroup, hideRetry, retry, position, testId, title, icon, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
|
|
11
11
|
export default TitleBlockErroredView;
|
|
@@ -67,4 +67,5 @@ export type FollowActionProps = BaseActionProps;
|
|
|
67
67
|
export declare const FollowAction: (props: FollowActionProps) => React.JSX.Element;
|
|
68
68
|
export type PreviewActionProps = BaseActionProps;
|
|
69
69
|
export declare const PreviewAction: (props: PreviewActionProps) => React.JSX.Element;
|
|
70
|
+
export declare const UnresolvedAction: () => React.JSX.Element;
|
|
70
71
|
export {};
|
|
@@ -148,7 +148,7 @@ export type RetryOptions = {
|
|
|
148
148
|
*/
|
|
149
149
|
values?: Record<string, string>;
|
|
150
150
|
};
|
|
151
|
-
export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'renderers' | 'url'> & {
|
|
151
|
+
export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'onAuthorize' | 'renderers' | 'url'> & {
|
|
152
152
|
fireEvent?: FireEventFunction;
|
|
153
153
|
status?: SmartLinkStatus;
|
|
154
154
|
response?: SmartLinkResponse;
|
|
@@ -139,6 +139,7 @@ export declare enum ActionName {
|
|
|
139
139
|
}
|
|
140
140
|
export declare enum InternalActionName {
|
|
141
141
|
AISummaryAction = "AISummaryAction",
|
|
142
|
+
UnresolvedAction = "UnresolvedAction",
|
|
142
143
|
ViewRelatedLinksAction = "ViewRelatedLinksAction"
|
|
143
144
|
}
|
|
144
145
|
export type FlexibleUiActionName = keyof typeof ActionName | keyof typeof InternalActionName;
|
|
@@ -11,7 +11,7 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
|
|
|
11
11
|
export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, } from './constants';
|
|
12
12
|
export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock, } from './view/FlexibleCard/components/blocks';
|
|
13
13
|
export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement, } from './view/FlexibleCard/external';
|
|
14
|
-
export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, } from './view/FlexibleCard/external';
|
|
14
|
+
export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, } from './view/FlexibleCard/external';
|
|
15
15
|
export type { ActionItem, ElementItem, OnActionMenuOpenChangeOptions, } from './view/FlexibleCard/components/blocks/types';
|
|
16
16
|
export type { AnalyticsAction, AnalyticsActionSubject, AnalyticsPayload, AnalyticsHandler, } from './utils/types';
|
|
17
17
|
/** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type LinkPerson } from '@atlaskit/link-extractors';
|
|
2
2
|
import { type ActionName, type IconType, type InternalActionName, type MediaType } from '../../constants';
|
|
3
3
|
import { type LinkLozenge } from '../../extractors/common/lozenge/types';
|
|
4
|
+
import { type RetryOptions } from '../../view/FlexibleCard/types';
|
|
4
5
|
import { type InvokeClientActionProps } from '../hooks/use-invoke-client-action/types';
|
|
5
6
|
import { type InvokeRequestWithCardDetails } from '../hooks/use-invoke/types';
|
|
6
7
|
/**
|
|
@@ -257,6 +258,7 @@ export type FlexibleUiActions = {
|
|
|
257
258
|
[ActionName.CopyLinkAction]?: CopyLinkActionData;
|
|
258
259
|
[InternalActionName.AISummaryAction]?: AISummaryActionData;
|
|
259
260
|
[ActionName.AutomationAction]?: AutomationActionData;
|
|
261
|
+
[InternalActionName.UnresolvedAction]?: UnresolvedActionData;
|
|
260
262
|
[InternalActionName.ViewRelatedLinksAction]?: ViewRelatedLinksActionData;
|
|
261
263
|
};
|
|
262
264
|
export type PreviewActionData = {
|
|
@@ -281,6 +283,7 @@ export type AutomationActionData = {
|
|
|
281
283
|
analyticsSource: string;
|
|
282
284
|
objectName?: string;
|
|
283
285
|
};
|
|
286
|
+
export type UnresolvedActionData = RetryOptions;
|
|
284
287
|
export type ViewRelatedLinksActionData = {
|
|
285
288
|
ari: string;
|
|
286
289
|
};
|
|
@@ -5,6 +5,7 @@ export { default as DownloadAction } from './download-action';
|
|
|
5
5
|
export { default as FollowAction } from './follow-action';
|
|
6
6
|
export { default as PreviewAction } from './preview-action';
|
|
7
7
|
export { default as CopyLinkAction } from './copy-link-action';
|
|
8
|
+
export { default as UnresolvedAction } from './unresolved-action';
|
|
8
9
|
export { default as AISummaryAction } from './ai-summary-action';
|
|
9
10
|
export { default as AutomationAction } from './automation-action';
|
|
10
11
|
export { default as ViewRelatedLinksAction } from './view-related-links-action';
|
|
@@ -7,5 +7,5 @@ import { type TitleBlockViewProps } from '../types';
|
|
|
7
7
|
* or the backend response was errored or malformed.
|
|
8
8
|
* @see TitleBlock
|
|
9
9
|
*/
|
|
10
|
-
declare const TitleBlockErroredView: ({ actionGroup, retry, position, testId, title, icon, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
|
|
10
|
+
declare const TitleBlockErroredView: ({ actionGroup, hideRetry, retry, position, testId, title, icon, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
|
|
11
11
|
export default TitleBlockErroredView;
|
|
@@ -67,4 +67,5 @@ export type FollowActionProps = BaseActionProps;
|
|
|
67
67
|
export declare const FollowAction: (props: FollowActionProps) => React.JSX.Element;
|
|
68
68
|
export type PreviewActionProps = BaseActionProps;
|
|
69
69
|
export declare const PreviewAction: (props: PreviewActionProps) => React.JSX.Element;
|
|
70
|
+
export declare const UnresolvedAction: () => React.JSX.Element;
|
|
70
71
|
export {};
|
|
@@ -148,7 +148,7 @@ export type RetryOptions = {
|
|
|
148
148
|
*/
|
|
149
149
|
values?: Record<string, string>;
|
|
150
150
|
};
|
|
151
|
-
export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'renderers' | 'url'> & {
|
|
151
|
+
export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'onAuthorize' | 'renderers' | 'url'> & {
|
|
152
152
|
fireEvent?: FireEventFunction;
|
|
153
153
|
status?: SmartLinkStatus;
|
|
154
154
|
response?: SmartLinkResponse;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.13.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"@atlaskit/link-extractors": "^2.3.0",
|
|
54
54
|
"@atlaskit/linking-common": "^8.0.0",
|
|
55
55
|
"@atlaskit/linking-types": "^9.10.0",
|
|
56
|
-
"@atlaskit/logo": "^
|
|
56
|
+
"@atlaskit/logo": "^17.0.0",
|
|
57
57
|
"@atlaskit/lozenge": "^12.2.0",
|
|
58
58
|
"@atlaskit/menu": "^5.0.0",
|
|
59
59
|
"@atlaskit/modal-dialog": "^14.1.0",
|
|
60
60
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
61
61
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
62
62
|
"@atlaskit/popup": "^4.1.0",
|
|
63
|
-
"@atlaskit/primitives": "^14.
|
|
63
|
+
"@atlaskit/primitives": "^14.6.0",
|
|
64
64
|
"@atlaskit/section-message": "^8.2.0",
|
|
65
65
|
"@atlaskit/select": "^20.4.0",
|
|
66
66
|
"@atlaskit/spinner": "^18.0.0",
|
|
@@ -224,6 +224,9 @@
|
|
|
224
224
|
"platform-linking-flexible-card-openness": {
|
|
225
225
|
"type": "boolean"
|
|
226
226
|
},
|
|
227
|
+
"platform-linking-flexible-card-unresolved-action": {
|
|
228
|
+
"type": "boolean"
|
|
229
|
+
},
|
|
227
230
|
"smart_links_noun_support": {
|
|
228
231
|
"type": "boolean"
|
|
229
232
|
},
|