@atlaskit/smart-card 34.6.2 → 34.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.compiled.css +1 -0
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/ActionBlockOld.js +116 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.compiled.css +7 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +21 -26
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/ActionGroupOld.js +147 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -8
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.compiled.css +4 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +28 -32
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/FeatureDiscoveryOld.js +71 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.compiled.css +4 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +30 -18
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js +3 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/AISummaryBlockResolvedViewOld.js +65 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.compiled.css +2 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +22 -15
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.compiled.css +4 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +7 -6
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +2 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +7 -4
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +3 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.compiled.css +4 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.js +20 -12
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.compiled.css +1 -0
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/ActionBlockOld.js +96 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.compiled.css +7 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +20 -24
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/ActionGroupOld.js +121 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -9
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.compiled.css +4 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +24 -32
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/FeatureDiscoveryOld.js +63 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.compiled.css +5 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +21 -16
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/AISummaryBlockResolvedViewOld.js +58 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.compiled.css +2 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +18 -11
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.compiled.css +4 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +7 -6
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +8 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +3 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.compiled.css +4 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.js +12 -7
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.compiled.css +1 -0
- package/dist/esm/view/BlockCard/views/ResolvedView.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/ActionBlockOld.js +105 -0
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.compiled.css +7 -0
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +20 -24
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/ActionGroupOld.js +141 -0
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -9
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.compiled.css +4 -0
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +24 -32
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/FeatureDiscoveryOld.js +64 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.compiled.css +4 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +25 -16
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js +3 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/AISummaryBlockResolvedViewOld.js +55 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.compiled.css +2 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +18 -11
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.compiled.css +4 -1
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +7 -6
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +8 -4
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +3 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.compiled.css +4 -0
- package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.js +12 -7
- package/dist/types/view/FlexibleCard/components/blocks/action-block/ActionBlockOld.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-block/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/blocks/action-group/ActionGroupOld.d.ts +11 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-group/action-group-item/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/blocks/action-group/index.d.ts +2 -9
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/FeatureDiscoveryOld.d.ts +12 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.d.ts +1 -6
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/resolved/AISummaryBlockResolvedViewOld.d.ts +10 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/ActionBlockOld.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/index.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-group/ActionGroupOld.d.ts +11 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-group/action-group-item/index.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-group/index.d.ts +2 -9
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/FeatureDiscoveryOld.d.ts +12 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.d.ts +1 -6
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/resolved/AISummaryBlockResolvedViewOld.d.ts +10 -0
- package/package.json +1 -1
package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
6
|
Object.defineProperty(exports, "__esModule", {
|
|
4
7
|
value: true
|
|
5
8
|
});
|
|
6
9
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var
|
|
10
|
+
require("./index.compiled.css");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
9
14
|
var _storageClient = require("@atlaskit/frontend-utilities/storage-client");
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
|
-
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
+
var _FeatureDiscoveryOld = _interopRequireDefault(require("./FeatureDiscoveryOld"));
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
|
+
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; }
|
|
18
19
|
var LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
|
|
19
20
|
var LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-ai-summarise';
|
|
20
21
|
var LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
|
|
21
22
|
var LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
|
|
22
23
|
var LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME = 2000;
|
|
24
|
+
var pulseKeyframes = null;
|
|
25
|
+
var pulseStyles = null;
|
|
26
|
+
|
|
23
27
|
/**
|
|
24
28
|
* This is a hacky solution to help with the feature discovery.
|
|
25
29
|
* This implementation must be removed once the experiment is completed.
|
|
26
30
|
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-9649
|
|
27
31
|
*/
|
|
28
|
-
var
|
|
32
|
+
var FeatureDiscoveryNew = function FeatureDiscoveryNew(_ref) {
|
|
29
33
|
var children = _ref.children,
|
|
30
34
|
testId = _ref.testId;
|
|
31
35
|
var renderedTime = (0, _react.useRef)();
|
|
@@ -57,15 +61,23 @@ var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
|
57
61
|
}, [storageClient, discovered]);
|
|
58
62
|
var component = (0, _react.useMemo)(function () {
|
|
59
63
|
if (!discovered) {
|
|
60
|
-
return (
|
|
61
|
-
|
|
62
|
-
(0,
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
65
|
+
"data-testid": "".concat(testId, "-discovery"),
|
|
66
|
+
className: (0, _runtime.ax)(["_2rko1l7b _y44v1kew _1e0c116y _16qs10kv"]),
|
|
67
|
+
style: {
|
|
68
|
+
"--_zsb6fb": (0, _runtime.ix)("0 0 0 0 ".concat("var(--ds-border-discovery, #8270DB)")),
|
|
69
|
+
"--_d0o24t": (0, _runtime.ix)("".concat(pulseKeyframes, " 2s cubic-bezier(0.5, 0, 0, 1) 0.25s both 2"))
|
|
70
|
+
}
|
|
71
|
+
}, children);
|
|
67
72
|
}
|
|
68
73
|
}, [children, discovered, testId]);
|
|
69
74
|
return component !== null && component !== void 0 ? component : children;
|
|
70
75
|
};
|
|
76
|
+
var FeatureDiscovery = function FeatureDiscovery(props) {
|
|
77
|
+
if ((0, _platformFeatureFlags.fg)('bandicoots-compiled-migration-smartcard')) {
|
|
78
|
+
return /*#__PURE__*/React.createElement(FeatureDiscoveryNew, props);
|
|
79
|
+
} else {
|
|
80
|
+
return /*#__PURE__*/React.createElement(_FeatureDiscoveryOld.default, props);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
71
83
|
var _default = exports.default = FeatureDiscovery;
|
package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js
CHANGED
|
@@ -7,6 +7,9 @@ exports.getPulseStyles = void 0;
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated remove on FF cleanup of bandicoots-compiled-migration-smartcard
|
|
12
|
+
*/
|
|
10
13
|
var getPulseStyles = exports.getPulseStyles = function getPulseStyles() {
|
|
11
14
|
var color = "var(--ds-border-discovery, #8270DB)";
|
|
12
15
|
var pulseKeyframes = (0, _react.keyframes)({
|
|
@@ -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 _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
12
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
13
|
+
var _constants = require("../../../../../../constants");
|
|
14
|
+
var _useAiSummaryAction = _interopRequireDefault(require("../../../../../../state/hooks/use-ai-summary-action"));
|
|
15
|
+
var _aiSummary = _interopRequireDefault(require("../../../../../common/ai-summary"));
|
|
16
|
+
var _motionWrapper = _interopRequireDefault(require("../../../common/motion-wrapper"));
|
|
17
|
+
var _block = _interopRequireDefault(require("../../block"));
|
|
18
|
+
var _aiEventSummaryViewed = _interopRequireDefault(require("../ai-event-summary-viewed"));
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
21
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
|
+
|
|
23
|
+
var AISummaryBlockResolvedViewOld = function AISummaryBlockResolvedViewOld(props) {
|
|
24
|
+
var testId = props.testId,
|
|
25
|
+
_props$aiSummaryMinHe = props.aiSummaryMinHeight,
|
|
26
|
+
aiSummaryMinHeight = _props$aiSummaryMinHe === void 0 ? 0 : _props$aiSummaryMinHe,
|
|
27
|
+
placeholder = props.placeholder,
|
|
28
|
+
url = props.url;
|
|
29
|
+
var _useAISummaryAction = (0, _useAiSummaryAction.default)(url),
|
|
30
|
+
_useAISummaryAction$s = _useAISummaryAction.state,
|
|
31
|
+
content = _useAISummaryAction$s.content,
|
|
32
|
+
status = _useAISummaryAction$s.status;
|
|
33
|
+
var showAISummary = status === 'done' ||
|
|
34
|
+
// We want to display the AI Summary component only when there is content available during the loading process.
|
|
35
|
+
status === 'loading' && !!content;
|
|
36
|
+
var isSummarisedOnMountRef = (0, _react.useRef)(status === 'done');
|
|
37
|
+
var minHeight = isSummarisedOnMountRef.current ? 0 : aiSummaryMinHeight;
|
|
38
|
+
if (!showAISummary) {
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, placeholder);
|
|
40
|
+
}
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, props, {
|
|
42
|
+
direction: _constants.SmartLinkDirection.Vertical,
|
|
43
|
+
testId: "".concat(testId, "-resolved-view")
|
|
44
|
+
/**
|
|
45
|
+
* Enabled for feature discovery to allow box shadow to overflow
|
|
46
|
+
* Cleanup: https://product-fabric.atlassian.net/browse/EDM-8681
|
|
47
|
+
*/,
|
|
48
|
+
overrideCss: (0, _react2.css)({
|
|
49
|
+
overflow: 'visible'
|
|
50
|
+
},
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
52
|
+
props.overrideCss)
|
|
53
|
+
}), status === 'done' && /*#__PURE__*/_react.default.createElement(_aiEventSummaryViewed.default, {
|
|
54
|
+
fromCache: isSummarisedOnMountRef.current
|
|
55
|
+
}), /*#__PURE__*/_react.default.createElement(_motionWrapper.default, {
|
|
56
|
+
minHeight: minHeight,
|
|
57
|
+
show: showAISummary,
|
|
58
|
+
showTransition: !isSummarisedOnMountRef.current
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement(_aiSummary.default, {
|
|
60
|
+
testId: "".concat(testId, "-ai-summary"),
|
|
61
|
+
minHeight: minHeight,
|
|
62
|
+
content: content
|
|
63
|
+
})));
|
|
64
|
+
};
|
|
65
|
+
var _default = exports.default = AISummaryBlockResolvedViewOld;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -6,21 +7,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
+
require("./index.compiled.css");
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
15
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
17
|
var _constants = require("../../../../../../constants");
|
|
14
18
|
var _useAiSummaryAction = _interopRequireDefault(require("../../../../../../state/hooks/use-ai-summary-action"));
|
|
15
19
|
var _aiSummary = _interopRequireDefault(require("../../../../../common/ai-summary"));
|
|
16
20
|
var _motionWrapper = _interopRequireDefault(require("../../../common/motion-wrapper"));
|
|
17
21
|
var _block = _interopRequireDefault(require("../../block"));
|
|
18
22
|
var _aiEventSummaryViewed = _interopRequireDefault(require("../ai-event-summary-viewed"));
|
|
23
|
+
var _AISummaryBlockResolvedViewOld = _interopRequireDefault(require("./AISummaryBlockResolvedViewOld"));
|
|
19
24
|
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); }
|
|
20
25
|
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; }
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
26
|
+
var styles = null;
|
|
27
|
+
var AISummaryBlockResolvedViewNew = function AISummaryBlockResolvedViewNew(props) {
|
|
24
28
|
var testId = props.testId,
|
|
25
29
|
_props$aiSummaryMinHe = props.aiSummaryMinHeight,
|
|
26
30
|
aiSummaryMinHeight = _props$aiSummaryMinHe === void 0 ? 0 : _props$aiSummaryMinHe,
|
|
@@ -36,30 +40,33 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
36
40
|
var isSummarisedOnMountRef = (0, _react.useRef)(status === 'done');
|
|
37
41
|
var minHeight = isSummarisedOnMountRef.current ? 0 : aiSummaryMinHeight;
|
|
38
42
|
if (!showAISummary) {
|
|
39
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/React.createElement(_react.Fragment, null, placeholder);
|
|
40
44
|
}
|
|
41
|
-
return /*#__PURE__*/
|
|
45
|
+
return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, props, {
|
|
42
46
|
direction: _constants.SmartLinkDirection.Vertical,
|
|
43
47
|
testId: "".concat(testId, "-resolved-view")
|
|
44
48
|
/**
|
|
45
49
|
* Enabled for feature discovery to allow box shadow to overflow
|
|
46
50
|
* Cleanup: https://product-fabric.atlassian.net/browse/EDM-8681
|
|
47
51
|
*/,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
52
|
-
props.overrideCss)
|
|
53
|
-
}), status === 'done' && /*#__PURE__*/_react.default.createElement(_aiEventSummaryViewed.default, {
|
|
52
|
+
className: (0, _runtime.ax)(["_1reoewfl _18m9ewfl"])
|
|
53
|
+
}), status === 'done' && /*#__PURE__*/React.createElement(_aiEventSummaryViewed.default, {
|
|
54
54
|
fromCache: isSummarisedOnMountRef.current
|
|
55
|
-
}), /*#__PURE__*/
|
|
55
|
+
}), /*#__PURE__*/React.createElement(_motionWrapper.default, {
|
|
56
56
|
minHeight: minHeight,
|
|
57
57
|
show: showAISummary,
|
|
58
58
|
showTransition: !isSummarisedOnMountRef.current
|
|
59
|
-
}, /*#__PURE__*/
|
|
59
|
+
}, /*#__PURE__*/React.createElement(_aiSummary.default, {
|
|
60
60
|
testId: "".concat(testId, "-ai-summary"),
|
|
61
61
|
minHeight: minHeight,
|
|
62
62
|
content: content
|
|
63
63
|
})));
|
|
64
64
|
};
|
|
65
|
+
var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
66
|
+
if ((0, _platformFeatureFlags.fg)('bandicoots-compiled-migration-smartcard')) {
|
|
67
|
+
return /*#__PURE__*/React.createElement(AISummaryBlockResolvedViewNew, props);
|
|
68
|
+
} else {
|
|
69
|
+
return /*#__PURE__*/React.createElement(_AISummaryBlockResolvedViewOld.default, props);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
65
72
|
var _default = exports.default = AISummaryBlockResolvedView;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
._1dthv2br{-webkit-box-align:start}
|
|
13
13
|
._1e0c1txw{display:flex}
|
|
14
14
|
._1e0c1ule{display:block}
|
|
15
|
+
._1e0ccj1k{display:-webkit-box}
|
|
15
16
|
._1iu61nu9 >div[data-smart-element-date-time], ._166k1nu9 >div[data-smart-element-text], ._1div1nu9 >span[data-smart-element-date-time], ._bmfb1nu9 >span[data-smart-element-text]{display:inline}
|
|
16
17
|
._1nmz1hna{word-break:break-word}
|
|
17
18
|
._1o9z11wp{flex-shrink:3}
|
|
@@ -42,5 +43,7 @@
|
|
|
42
43
|
._r291v2br{-ms-flex-align:start}
|
|
43
44
|
._s7n4nkob{vertical-align:middle}
|
|
44
45
|
._sudp1e54{-webkit-box-orient:vertical}
|
|
46
|
+
._vwz41j6v{line-height:1rem}
|
|
45
47
|
._y3gn1e5h{text-align:left}
|
|
46
|
-
._y3gnusic{text-align:right}
|
|
48
|
+
._y3gnusic{text-align:right}
|
|
49
|
+
@supports not (-webkit-line-clamp:1){._102k1k8s{max-height:1.5rem}._102k1m1q{max-height:1.75rem}}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
|
+
/* eslint-disable @atlaskit/design-system/use-tokens-typography */
|
|
2
3
|
"use strict";
|
|
3
4
|
|
|
4
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -21,10 +22,10 @@ var alignmentStyleMap = {
|
|
|
21
22
|
left: "_1dthv2br _r291v2br _1bah1y6m _y3gn1e5h"
|
|
22
23
|
};
|
|
23
24
|
var baseStyleBySize = {
|
|
24
|
-
xlarge: "_zulp147b _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf",
|
|
25
|
-
large: "_zulp1e9d _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf",
|
|
26
|
-
medium: "_zulpcxkx _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf",
|
|
27
|
-
small: "_zulppdf9 _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf"
|
|
25
|
+
xlarge: "_zulp147b _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf _vwz41j6v",
|
|
26
|
+
large: "_zulp1e9d _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf _vwz41j6v",
|
|
27
|
+
medium: "_zulpcxkx _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf _vwz41j6v",
|
|
28
|
+
small: "_zulppdf9 _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf _vwz41j6v"
|
|
28
29
|
};
|
|
29
30
|
var baseStyleByDirection = {
|
|
30
31
|
horizontal: "_2lx2vrvc _4cvr1h6o",
|
|
@@ -58,6 +59,7 @@ var gapStylesRight = {
|
|
|
58
59
|
medium: "_24rccxkx _3dveidpf",
|
|
59
60
|
small: "_24rcpdf9 _3dveidpf"
|
|
60
61
|
};
|
|
62
|
+
var minWidthStyle = null;
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
65
|
* Creates a group of Action components. Accepts an array of Actions, in addition to some styling
|
|
@@ -81,13 +83,12 @@ var ElementGroupNew = function ElementGroupNew(_ref) {
|
|
|
81
83
|
_ref$position = _ref.position,
|
|
82
84
|
position = _ref$position === void 0 ? _constants.SmartLinkPosition.Center : _ref$position,
|
|
83
85
|
className = _ref.className;
|
|
84
|
-
var totalCss = [baseStyleBySize[size], baseStyleByDirection[direction], baseStyle, alignmentStyleMap[align], null, widthStyle[width], direction === _constants.SmartLinkDirection.Horizontal ? horizontalStyleBase : {}, direction === _constants.SmartLinkDirection.Horizontal ? horizontalStyleByHeight[size] : {}, direction === _constants.SmartLinkDirection.Horizontal ? _constants.SmartLinkAlignment.Left ? gapStylesLeft[size] : gapStylesRight[size] : {}, positionStyle[position]];
|
|
85
86
|
return /*#__PURE__*/React.createElement("div", {
|
|
86
87
|
"data-smart-element-group": true,
|
|
87
88
|
"data-testid": testId
|
|
88
89
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
89
90
|
,
|
|
90
|
-
className: (0, _runtime.ax)([baseStyleBySize[size], baseStyleByDirection[direction], "_fiawglyw _1ouwidpf _f6ju1ns9", alignmentStyleMap[align], "_1ul99by0", widthStyle[width], direction === _constants.SmartLinkDirection.Horizontal && "_1reo15vq _18m915vq _1e0c1ule _s7n4nkob _1bto1l2s _1nmz1hna _1yyjkb7n _sudp1e54 _1aaynkob _15tynkob _1iu61nu9 _166k1nu9 _1div1nu9 _bmfb1nu9", direction === _constants.SmartLinkDirection.Horizontal &&
|
|
91
|
+
className: (0, _runtime.ax)([baseStyleBySize[size], baseStyleByDirection[direction], "_fiawglyw _1ouwidpf _f6ju1ns9", alignmentStyleMap[align], "_1ul99by0", widthStyle[width], direction === _constants.SmartLinkDirection.Horizontal && "_1reo15vq _18m915vq _1e0c1ule _s7n4nkob _1bto1l2s _1nmz1hna _1yyjkb7n _sudp1e54 _1aaynkob _15tynkob _1iu61nu9 _166k1nu9 _1div1nu9 _bmfb1nu9", direction === _constants.SmartLinkDirection.Horizontal && horizontalStyleByHeight[size], direction === _constants.SmartLinkDirection.Horizontal && align === _constants.SmartLinkAlignment.Left && gapStylesLeft[size], direction === _constants.SmartLinkDirection.Horizontal && align === _constants.SmartLinkAlignment.Right && gapStylesRight[size], positionStyle[position], className])
|
|
91
92
|
}, (0, _utils.renderChildren)(children, size));
|
|
92
93
|
};
|
|
93
94
|
var ElementGroup = function ElementGroup(props) {
|
|
@@ -56,7 +56,8 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
|
56
56
|
}, /*#__PURE__*/React.createElement(_actionGroup.default, {
|
|
57
57
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
58
58
|
items: actions,
|
|
59
|
-
appearance: "default"
|
|
59
|
+
appearance: "default",
|
|
60
|
+
size: size
|
|
60
61
|
})) : null);
|
|
61
62
|
};
|
|
62
63
|
var FooterBlockResolvedViewExported = function FooterBlockResolvedViewExported(props) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
2
1
|
._18m915vq{overflow-y:hidden}
|
|
3
2
|
._1bto1l2s{text-overflow:ellipsis}
|
|
4
3
|
._1e0ccj1k{display:-webkit-box}
|
|
@@ -7,4 +6,6 @@
|
|
|
7
6
|
._1yyjcs5v{-webkit-line-clamp:2}
|
|
8
7
|
._1yyjkb7n{-webkit-line-clamp:1}
|
|
9
8
|
._sudp1e54{-webkit-box-orient:vertical}
|
|
9
|
+
._vwz41k8s{line-height:1.5rem}
|
|
10
|
+
._vwz41m1q{line-height:1.75rem}
|
|
10
11
|
@supports not (-webkit-line-clamp:1){._102k1k7u{max-height:3.5rem}._102k1wto{max-height:3rem}}
|
|
@@ -19,6 +19,7 @@ var _elementGroup = _interopRequireDefault(require("../element-group"));
|
|
|
19
19
|
var _utils = require("../utils");
|
|
20
20
|
var _MetadataBlockOld = _interopRequireDefault(require("./MetadataBlockOld"));
|
|
21
21
|
var _excluded = ["maxLines", "status", "testId", "primary", "secondary"];
|
|
22
|
+
/* eslint-disable @atlaskit/design-system/use-tokens-typography */
|
|
22
23
|
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); }
|
|
23
24
|
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; }
|
|
24
25
|
var DEFAULT_MAX_LINES = 2;
|
|
@@ -29,10 +30,10 @@ var truncateStyles = {
|
|
|
29
30
|
'2': "_1reo15vq _18m915vq _1e0ccj1k _1bto1l2s _1nmz1hna _1yyjcs5v _sudp1e54"
|
|
30
31
|
};
|
|
31
32
|
var sizeStyles = {
|
|
32
|
-
xlarge: "
|
|
33
|
-
large: "
|
|
34
|
-
medium: "
|
|
35
|
-
small: "
|
|
33
|
+
xlarge: "_vwz41m1q _102k1k7u",
|
|
34
|
+
large: "_vwz41m1q _102k1k7u",
|
|
35
|
+
medium: "_vwz41k8s _102k1wto",
|
|
36
|
+
small: "_vwz41k8s _102k1wto"
|
|
36
37
|
};
|
|
37
38
|
var getMaxLines = function getMaxLines(maxLines) {
|
|
38
39
|
if (maxLines > MAXIMUM_MAX_LINES) {
|
|
@@ -77,11 +78,13 @@ var MetadataBlock = function MetadataBlock(_ref) {
|
|
|
77
78
|
align: _constants.SmartLinkAlignment.Left,
|
|
78
79
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
79
80
|
width: _constants.SmartLinkWidth.Flexible,
|
|
81
|
+
size: size,
|
|
80
82
|
className: (0, _runtime.ax)([truncateStyles[maxLinesTotal], sizeStyles[size]])
|
|
81
83
|
}, primaryElements), secondaryElements && /*#__PURE__*/React.createElement(_elementGroup.default, {
|
|
82
84
|
align: _constants.SmartLinkAlignment.Right,
|
|
83
85
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
84
86
|
width: _constants.SmartLinkWidth.Flexible,
|
|
87
|
+
size: size,
|
|
85
88
|
className: (0, _runtime.ax)([truncateStyles[maxLinesTotal], sizeStyles[size]])
|
|
86
89
|
}, secondaryElements));
|
|
87
90
|
};
|
|
@@ -120,7 +120,9 @@ var TitleBlockNew = function TitleBlockNew(_ref) {
|
|
|
120
120
|
title: title,
|
|
121
121
|
metadataPosition: metadataPosition,
|
|
122
122
|
hideIcon: hideIcon,
|
|
123
|
-
icon: icon
|
|
123
|
+
icon: icon,
|
|
124
|
+
size: props.size,
|
|
125
|
+
theme: theme
|
|
124
126
|
}));
|
|
125
127
|
};
|
|
126
128
|
var TitleBlock = function TitleBlock(props) {
|
|
@@ -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: "34.6.
|
|
23
|
+
packageVersion: "34.6.3",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
._11c81vlj{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._zulputpp{gap:var(--ds-space-150,9pt)}
|
|
3
|
+
._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
|
|
4
|
+
._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.default = void 0;
|
|
8
|
-
|
|
10
|
+
require("./index.compiled.css");
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
9
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
14
|
var _primitives = require("@atlaskit/primitives");
|
|
15
|
+
var _constants = require("../../../../constants");
|
|
11
16
|
var _index = require("../../../../index");
|
|
12
17
|
var _RelatedLinkItemOld = _interopRequireDefault(require("./RelatedLinkItemOld"));
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
20
|
var hoverStyles = (0, _primitives.xcss)({
|
|
14
21
|
':hover': {
|
|
15
22
|
backgroundColor: 'color.background.input.hovered',
|
|
16
23
|
borderRadius: 'border.radius.100',
|
|
17
24
|
marginInline: 'space.negative.100',
|
|
18
25
|
paddingInline: 'space.100'
|
|
19
|
-
}
|
|
20
|
-
paddingTop: 'space.100',
|
|
21
|
-
paddingBottom: 'space.100',
|
|
22
|
-
gap: 'space.150',
|
|
23
|
-
font: 'font.body.small'
|
|
26
|
+
}
|
|
24
27
|
});
|
|
28
|
+
var relatedLinkItemStyles = null;
|
|
25
29
|
var RelatedLinkItem = function RelatedLinkItem(_ref) {
|
|
26
30
|
var url = _ref.url,
|
|
27
31
|
testId = _ref.testId;
|
|
@@ -37,26 +41,30 @@ var RelatedLinkItem = function RelatedLinkItem(_ref) {
|
|
|
37
41
|
clickableContainer: true,
|
|
38
42
|
size: _index.SmartLinkSize.Large
|
|
39
43
|
};
|
|
40
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/React.createElement(_primitives.Box, {
|
|
41
45
|
testId: testId,
|
|
42
46
|
xcss: hoverStyles
|
|
43
|
-
}, /*#__PURE__*/
|
|
47
|
+
}, /*#__PURE__*/React.createElement(_index.Card, {
|
|
44
48
|
appearance: "block",
|
|
45
49
|
ui: ui,
|
|
46
50
|
url: url
|
|
47
|
-
}, /*#__PURE__*/
|
|
51
|
+
}, /*#__PURE__*/React.createElement(_index.TitleBlock, {
|
|
48
52
|
maxLines: 1,
|
|
49
53
|
hideTitleTooltip: true,
|
|
50
54
|
position: _index.SmartLinkPosition.Center,
|
|
51
55
|
subtitle: subtitle,
|
|
52
|
-
anchorTarget: "_blank"
|
|
56
|
+
anchorTarget: "_blank",
|
|
57
|
+
size: ui.size,
|
|
58
|
+
theme: ui.theme,
|
|
59
|
+
status: _constants.SmartLinkStatus.Resolved,
|
|
60
|
+
className: (0, _runtime.ax)(["_zulputpp _11c81vlj _ca0qu2gc _n3tdu2gc"])
|
|
53
61
|
})));
|
|
54
62
|
};
|
|
55
63
|
var RelatedLinkItemExported = function RelatedLinkItemExported(props) {
|
|
56
64
|
if ((0, _platformFeatureFlags.fg)('bandicoots-compiled-migration-smartcard')) {
|
|
57
|
-
return /*#__PURE__*/
|
|
65
|
+
return /*#__PURE__*/React.createElement(RelatedLinkItem, props);
|
|
58
66
|
} else {
|
|
59
|
-
return /*#__PURE__*/
|
|
67
|
+
return /*#__PURE__*/React.createElement(_RelatedLinkItemOld.default, props);
|
|
60
68
|
}
|
|
61
69
|
};
|
|
62
70
|
var _default = exports.default = RelatedLinkItemExported;
|
|
@@ -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: "34.6.
|
|
5
|
+
packageVersion: "34.6.3"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
._1sxbcxkx span[data-smart-element-avatar-group]>ul{margin-right:var(--ds-space-100,.5rem)}
|
|
4
4
|
._4t3i1k8s{height:1.5rem}
|
|
5
5
|
._g0eioxwj .actions-button-group button, ._1qryoxwj .actions-button-group button:active, ._sxbroxwj .actions-button-group button:focus, ._1gyioxwj .actions-button-group button:hover{font-size:.875rem}
|
|
6
|
+
._i8d01j6v [data-smart-element-group]{line-height:1rem}
|
|
6
7
|
._wwyvidpf span[data-smart-element-avatar-group]>ul{padding-left:0}
|
|
@@ -71,12 +71,12 @@ const ResolvedView = ({
|
|
|
71
71
|
primary: topMetadata,
|
|
72
72
|
maxLines: 1,
|
|
73
73
|
status: SmartLinkStatus.Resolved,
|
|
74
|
-
className: ax(["_wwyvidpf _1sxbcxkx"])
|
|
74
|
+
className: ax(["_wwyvidpf _1sxbcxkx _i8d01j6v"])
|
|
75
75
|
}), /*#__PURE__*/React.createElement(SnippetBlock, null), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
76
76
|
primary: bottomMetadata,
|
|
77
77
|
maxLines: 1,
|
|
78
78
|
status: SmartLinkStatus.Resolved,
|
|
79
|
-
className: ax(["_wwyvidpf _1sxbcxkx"])
|
|
79
|
+
className: ax(["_wwyvidpf _1sxbcxkx _i8d01j6v"])
|
|
80
80
|
}), !isPreviewBlockErrored ? /*#__PURE__*/React.createElement(PreviewBlock, _extends({}, PreviewBlockOptions, {
|
|
81
81
|
onError: () => {
|
|
82
82
|
setIsPreviewBlockErrored(true);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
9
|
+
import { di } from 'react-magnetic-di';
|
|
10
|
+
import { xcss } from '@atlaskit/primitives';
|
|
11
|
+
import { SmartLinkSize } from '../../../../../constants';
|
|
12
|
+
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
13
|
+
import * as Actions from '../../actions';
|
|
14
|
+
import { getPrimitivesPaddingSpaceBySize } from '../../utils';
|
|
15
|
+
import { ActionFooter } from './action-footer';
|
|
16
|
+
const ignoreContainerPaddingStyles = css({
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
boxSizing: 'border-box',
|
|
20
|
+
flexGrow: 1,
|
|
21
|
+
width: '100%',
|
|
22
|
+
// We have to find a better way to ignore container padding
|
|
23
|
+
// This has become more and more of a common use case.
|
|
24
|
+
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
25
|
+
marginRight: 'calc(var(--container-gap-right) * -1)'
|
|
26
|
+
});
|
|
27
|
+
const DEFAULT_SORT_ORDER = ['PreviewAction', 'CopyLinkAction', 'AISummaryAction'];
|
|
28
|
+
const sort = (a, b) => {
|
|
29
|
+
let idxA = DEFAULT_SORT_ORDER.indexOf(a);
|
|
30
|
+
let idxB = DEFAULT_SORT_ORDER.indexOf(b);
|
|
31
|
+
if (idxA === -1) {
|
|
32
|
+
idxA = DEFAULT_SORT_ORDER.length;
|
|
33
|
+
}
|
|
34
|
+
if (idxB === -1) {
|
|
35
|
+
idxB = DEFAULT_SORT_ORDER.length;
|
|
36
|
+
}
|
|
37
|
+
return idxA - idxB;
|
|
38
|
+
};
|
|
39
|
+
const ActionBlockOld = ({
|
|
40
|
+
blockRef,
|
|
41
|
+
onClick: onClickCallback,
|
|
42
|
+
size,
|
|
43
|
+
spaceInline,
|
|
44
|
+
testId = 'smart-block-action'
|
|
45
|
+
}) => {
|
|
46
|
+
const context = useFlexibleUiContext();
|
|
47
|
+
const ui = useFlexibleUiOptionContext();
|
|
48
|
+
const [message, setMessage] = useState();
|
|
49
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
50
|
+
const onLoadingChange = useCallback(isLoading => {
|
|
51
|
+
setIsLoading(isLoading);
|
|
52
|
+
}, [setIsLoading]);
|
|
53
|
+
const padding = !(ui !== null && ui !== void 0 && ui.hidePadding) ? getPrimitivesPaddingSpaceBySize((ui === null || ui === void 0 ? void 0 : ui.size) || SmartLinkSize.Medium) : undefined;
|
|
54
|
+
const onClick = useCallback(name => {
|
|
55
|
+
setMessage(undefined);
|
|
56
|
+
onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback(name);
|
|
57
|
+
}, [onClickCallback]);
|
|
58
|
+
const onError = useCallback(error => {
|
|
59
|
+
setMessage(error);
|
|
60
|
+
}, []);
|
|
61
|
+
const actions = useMemo(() => {
|
|
62
|
+
if (!(context !== null && context !== void 0 && context.actions)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const arr = Object.keys(context.actions);
|
|
66
|
+
arr.sort(sort);
|
|
67
|
+
return arr.map(name => {
|
|
68
|
+
const Action = name in Actions ? Actions[name] : undefined;
|
|
69
|
+
return Action ? jsx(Action, {
|
|
70
|
+
as: "stack-item",
|
|
71
|
+
spaceInline: spaceInline,
|
|
72
|
+
key: name,
|
|
73
|
+
onClick: () => onClick(name),
|
|
74
|
+
onError: onError,
|
|
75
|
+
onLoadingChange: onLoadingChange,
|
|
76
|
+
size: size
|
|
77
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
78
|
+
,
|
|
79
|
+
xcss: xcss({
|
|
80
|
+
paddingInline: padding
|
|
81
|
+
}),
|
|
82
|
+
hideTooltip: isLoading
|
|
83
|
+
}) : null;
|
|
84
|
+
});
|
|
85
|
+
}, [context === null || context === void 0 ? void 0 : context.actions, onClick, onError, padding, size, spaceInline, isLoading, onLoadingChange]);
|
|
86
|
+
return actions ? jsx("div", {
|
|
87
|
+
css: ignoreContainerPaddingStyles,
|
|
88
|
+
ref: blockRef,
|
|
89
|
+
"data-testid": testId
|
|
90
|
+
}, actions, jsx(ActionFooter, {
|
|
91
|
+
message: message,
|
|
92
|
+
paddingInline: padding,
|
|
93
|
+
testId: testId
|
|
94
|
+
})) : null;
|
|
95
|
+
};
|
|
96
|
+
export default ActionBlockOld;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
._16jlkb7n{flex-grow:1}
|
|
2
|
+
._18u01ivi{margin-left:calc(var(--container-gap-left)*-1)}
|
|
3
|
+
._1bsb1osq{width:100%}
|
|
4
|
+
._1e0c1txw{display:flex}
|
|
5
|
+
._2hwxc10g{margin-right:calc(var(--container-gap-right)*-1)}
|
|
6
|
+
._2lx21bp4{flex-direction:column}
|
|
7
|
+
._vchhusvi{box-sizing:border-box}
|