@atlaskit/smart-card 26.55.1 → 26.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/extractors/flexible/actions/extract-copy-link-action.js +21 -0
- package/dist/cjs/extractors/flexible/actions/index.js +2 -1
- package/dist/cjs/messages.js +10 -0
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +3 -2
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -3
- package/dist/cjs/view/BlockCard/views/styled.js +5 -3
- package/dist/cjs/view/Card/types.js +1 -0
- package/dist/cjs/view/EmbedCard/views/unresolved-view/styled.js +29 -8
- package/dist/cjs/view/EmbedModal/components/embed-content/index.js +5 -4
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +24 -7
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +12 -4
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +88 -0
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/actions/index.js +8 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.js +55 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.js +6 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +54 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js +21 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +37 -9
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +34 -7
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +3 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +13 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/index.js +3 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +3 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +16 -4
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +2 -0
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +27 -4
- package/dist/cjs/view/FlexibleCard/components/container/index.js +2 -0
- package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +33 -3
- package/dist/cjs/view/FlexibleCard/components/elements/atlaskit-badge/index.js +5 -3
- package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +10 -3
- package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +16 -4
- package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +6 -3
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +23 -7
- package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +38 -8
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +5 -3
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +46 -6
- package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +31 -3
- package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +7 -3
- package/dist/cjs/view/FlexibleCard/components/utils.js +1 -0
- package/dist/cjs/view/HoverCard/components/ContentContainer.js +5 -1
- package/dist/cjs/view/HoverCard/components/views/forbidden/styled.js +16 -6
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +12 -10
- package/dist/cjs/view/HoverCard/components/views/resolved/styled.js +10 -3
- package/dist/cjs/view/HoverCard/components/views/resolving/styled.js +23 -7
- package/dist/cjs/view/HoverCard/components/views/unauthorised/styled.js +14 -6
- package/dist/cjs/view/HoverCard/styled.js +4 -0
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/styled.js +36 -10
- package/dist/cjs/view/InlineCard/ResolvingView/styled.js +4 -3
- package/dist/cjs/view/InlineCard/styled.js +37 -6
- package/dist/cjs/view/LinkUrl/LinkWarningModal/styled.js +4 -4
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/Icon.js +12 -4
- package/dist/cjs/view/common/ai-icon-loading/index.js +12 -3
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/extractors/flexible/actions/extract-copy-link-action.js +15 -0
- package/dist/es2019/extractors/flexible/actions/index.js +2 -0
- package/dist/es2019/messages.js +10 -0
- package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +2 -1
- package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -5
- package/dist/es2019/view/BlockCard/views/styled.js +4 -4
- package/dist/es2019/view/Card/types.js +1 -0
- package/dist/es2019/view/EmbedCard/views/unresolved-view/styled.js +29 -29
- package/dist/es2019/view/EmbedModal/components/embed-content/index.js +4 -4
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +23 -26
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +12 -4
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +53 -0
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.js +39 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.js +6 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +44 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js +15 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +42 -16
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +29 -34
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +3 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +11 -13
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/index.js +3 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +3 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +14 -16
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +25 -26
- package/dist/es2019/view/FlexibleCard/components/container/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +16 -18
- package/dist/es2019/view/FlexibleCard/components/elements/atlaskit-badge/index.js +4 -4
- package/dist/es2019/view/FlexibleCard/components/elements/avatar-group/index.js +8 -7
- package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +14 -12
- package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +5 -6
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +20 -23
- package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +33 -40
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +4 -4
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +42 -53
- package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +28 -32
- package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +6 -7
- package/dist/es2019/view/FlexibleCard/components/utils.js +1 -0
- package/dist/es2019/view/HoverCard/components/ContentContainer.js +6 -1
- package/dist/es2019/view/HoverCard/components/views/forbidden/styled.js +16 -16
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +13 -10
- package/dist/es2019/view/HoverCard/components/views/resolved/styled.js +9 -7
- package/dist/es2019/view/HoverCard/components/views/resolving/styled.js +22 -22
- package/dist/es2019/view/HoverCard/components/views/unauthorised/styled.js +13 -13
- package/dist/es2019/view/HoverCard/styled.js +4 -0
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/styled.js +36 -40
- package/dist/es2019/view/InlineCard/ResolvingView/styled.js +4 -4
- package/dist/es2019/view/InlineCard/styled.js +34 -35
- package/dist/es2019/view/LinkUrl/LinkWarningModal/styled.js +4 -4
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/Icon.js +11 -11
- package/dist/es2019/view/common/ai-icon-loading/index.js +10 -14
- package/dist/esm/constants.js +1 -0
- package/dist/esm/extractors/flexible/actions/extract-copy-link-action.js +15 -0
- package/dist/esm/extractors/flexible/actions/index.js +2 -1
- package/dist/esm/messages.js +10 -0
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +3 -2
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -3
- package/dist/esm/view/BlockCard/views/styled.js +5 -3
- package/dist/esm/view/Card/types.js +1 -0
- package/dist/esm/view/EmbedCard/views/unresolved-view/styled.js +29 -7
- package/dist/esm/view/EmbedModal/components/embed-content/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +22 -6
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +12 -4
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +78 -0
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.js +45 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.js +6 -2
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +47 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js +15 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +37 -9
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +34 -7
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +3 -3
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +13 -3
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/index.js +3 -3
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +3 -3
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +16 -4
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -3
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +2 -0
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +26 -4
- package/dist/esm/view/FlexibleCard/components/container/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +32 -3
- package/dist/esm/view/FlexibleCard/components/elements/atlaskit-badge/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/elements/avatar-group/index.js +11 -3
- package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +16 -4
- package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +5 -3
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +21 -6
- package/dist/esm/view/FlexibleCard/components/elements/link/index.js +36 -7
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +46 -5
- package/dist/esm/view/FlexibleCard/components/elements/media/index.js +30 -3
- package/dist/esm/view/FlexibleCard/components/elements/text/index.js +6 -3
- package/dist/esm/view/FlexibleCard/components/utils.js +1 -0
- package/dist/esm/view/HoverCard/components/ContentContainer.js +5 -1
- package/dist/esm/view/HoverCard/components/views/forbidden/styled.js +16 -5
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +12 -10
- package/dist/esm/view/HoverCard/components/views/resolved/styled.js +10 -3
- package/dist/esm/view/HoverCard/components/views/resolving/styled.js +23 -6
- package/dist/esm/view/HoverCard/components/views/unauthorised/styled.js +14 -5
- package/dist/esm/view/HoverCard/styled.js +4 -0
- package/dist/esm/view/InlineCard/IconAndTitleLayout/styled.js +36 -10
- package/dist/esm/view/InlineCard/ResolvingView/styled.js +4 -3
- package/dist/esm/view/InlineCard/styled.js +37 -6
- package/dist/esm/view/LinkUrl/LinkWarningModal/styled.js +4 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/Icon.js +11 -4
- package/dist/esm/view/common/ai-icon-loading/index.js +11 -3
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/extractors/flexible/actions/extract-copy-link-action.d.ts +4 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +4 -0
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +2 -2
- package/dist/types/view/Card/types.d.ts +2 -1
- package/dist/types/view/FlexibleCard/components/actions/action/action-button/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +19 -0
- package/dist/types/view/FlexibleCard/components/actions/copy-link-action/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/actions/copy-link-action/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.d.ts +12 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +4 -3
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +3 -1
- package/dist/types/view/FlexibleCard/components/elements/avatar-group/index.d.ts +0 -1
- package/dist/types-ts4.5/constants.d.ts +1 -0
- package/dist/types-ts4.5/extractors/flexible/actions/extract-copy-link-action.d.ts +4 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +4 -0
- package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +3 -2
- package/dist/types-ts4.5/view/Card/types.d.ts +2 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-button/types.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +19 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/copy-link-action/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/copy-link-action/types.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.d.ts +7 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.d.ts +12 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +4 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +3 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/avatar-group/index.d.ts +0 -1
- package/package.json +2 -1
package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _react2 = require("react");
|
|
9
|
+
var _storageClient = require("@atlaskit/frontend-utilities/storage-client");
|
|
10
|
+
var _styled = require("./styled");
|
|
11
|
+
/** @jsx jsx */
|
|
12
|
+
|
|
13
|
+
var LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
|
|
14
|
+
var LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-ai-summarise';
|
|
15
|
+
var LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
|
|
16
|
+
var LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
|
|
17
|
+
var LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME = 2000;
|
|
18
|
+
/**
|
|
19
|
+
* This is a hacky solution to help with the feature discovery.
|
|
20
|
+
* This implementation must be removed once the experiment is completed.
|
|
21
|
+
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-9649
|
|
22
|
+
*/
|
|
23
|
+
var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
24
|
+
var children = _ref.children,
|
|
25
|
+
testId = _ref.testId;
|
|
26
|
+
var renderedTime = (0, _react2.useRef)();
|
|
27
|
+
var storageClient = (0, _react2.useMemo)(function () {
|
|
28
|
+
return new _storageClient.StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
29
|
+
}, []);
|
|
30
|
+
var discovered = (0, _react2.useMemo)(function () {
|
|
31
|
+
return storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE;
|
|
32
|
+
}, [storageClient]);
|
|
33
|
+
(0, _react2.useEffect)(function () {
|
|
34
|
+
renderedTime.current = Date.now();
|
|
35
|
+
return function () {
|
|
36
|
+
if (!discovered && renderedTime.current) {
|
|
37
|
+
var duration = Date.now() - renderedTime.current;
|
|
38
|
+
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
39
|
+
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}, [storageClient, discovered]);
|
|
44
|
+
var component = (0, _react2.useMemo)(function () {
|
|
45
|
+
if (!discovered) {
|
|
46
|
+
return (0, _react.jsx)("span", {
|
|
47
|
+
css: (0, _styled.getPulseStyles)(),
|
|
48
|
+
"data-testid": "".concat(testId, "-discovery")
|
|
49
|
+
}, children);
|
|
50
|
+
}
|
|
51
|
+
}, [children, discovered, testId]);
|
|
52
|
+
return component !== null && component !== void 0 ? component : children;
|
|
53
|
+
};
|
|
54
|
+
var _default = exports.default = FeatureDiscovery;
|
package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getPulseStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var getPulseStyles = exports.getPulseStyles = function getPulseStyles() {
|
|
9
|
+
var color = "var(--ds-border-discovery, #8270DB)";
|
|
10
|
+
var pulseKeyframes = (0, _react.keyframes)({
|
|
11
|
+
to: {
|
|
12
|
+
boxShadow: '0 0 0 7px rgba(0, 0, 0, 0)'
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return (0, _react.css)({
|
|
16
|
+
display: 'inline-flex',
|
|
17
|
+
borderRadius: '3px',
|
|
18
|
+
boxShadow: "0 0 0 0 ".concat(color),
|
|
19
|
+
animation: "".concat(pulseKeyframes, " 2s cubic-bezier(0.5, 0, 0, 1) 0.25s both 2")
|
|
20
|
+
});
|
|
21
|
+
};
|
|
@@ -15,32 +15,39 @@ var _constants = require("../../../../../../constants");
|
|
|
15
15
|
var _actionGroup = _interopRequireDefault(require("../../action-group"));
|
|
16
16
|
var _block = _interopRequireDefault(require("../../block"));
|
|
17
17
|
var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
18
|
+
var _aiMotionWrapper = _interopRequireDefault(require("../ai-motion-wrapper"));
|
|
18
19
|
var _aiStateIndicator = _interopRequireDefault(require("../ai-state-indicator"));
|
|
19
20
|
var _utils = require("../../utils");
|
|
20
21
|
var _messages = require("../../../../../../messages");
|
|
21
22
|
var _useAiSummary = require("../../../../../../state/hooks/use-ai-summary");
|
|
22
23
|
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
24
|
+
var _linkProvider = require("@atlaskit/link-provider");
|
|
23
25
|
var _aiIcon = _interopRequireDefault(require("../../../../../common/ai-icon"));
|
|
24
26
|
var _aiSummary = _interopRequireDefault(require("../../../../../common/ai-summary"));
|
|
25
27
|
var _useAnalyticsEvents2 = require("../../../../../../common/analytics/generated/use-analytics-events");
|
|
26
28
|
var _aiEventSummaryViewed = _interopRequireDefault(require("../ai-event-summary-viewed"));
|
|
27
29
|
var _aiEventErrorViewed = _interopRequireDefault(require("../ai-event-error-viewed"));
|
|
28
30
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
31
|
+
var _react2 = require("@emotion/react");
|
|
32
|
+
var _featureDiscovery = _interopRequireDefault(require("../feature-discovery"));
|
|
29
33
|
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); }
|
|
30
34
|
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 && Object.prototype.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; }
|
|
31
35
|
var AISummaryBlockErrorIndicator = exports.AISummaryBlockErrorIndicator = function AISummaryBlockErrorIndicator(_ref) {
|
|
32
36
|
var showErrorIndicator = _ref.showErrorIndicator,
|
|
33
37
|
error = _ref.error,
|
|
38
|
+
showTransition = _ref.showTransition,
|
|
34
39
|
testId = _ref.testId;
|
|
35
|
-
return
|
|
36
|
-
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_aiMotionWrapper.default, {
|
|
41
|
+
isFadeIn: true,
|
|
42
|
+
show: showErrorIndicator,
|
|
43
|
+
showTransition: showTransition
|
|
37
44
|
}, /*#__PURE__*/_react.default.createElement(_aiEventErrorViewed.default, {
|
|
38
45
|
reason: error
|
|
39
46
|
}), /*#__PURE__*/_react.default.createElement(_aiStateIndicator.default, {
|
|
40
47
|
error: error,
|
|
41
|
-
state:
|
|
48
|
+
state: "error",
|
|
42
49
|
testId: testId
|
|
43
|
-
}))
|
|
50
|
+
}));
|
|
44
51
|
};
|
|
45
52
|
var AISummaryBlockStatusIndicator = exports.AISummaryBlockStatusIndicator = function AISummaryBlockStatusIndicator(_ref2) {
|
|
46
53
|
var showStatusIndicator = _ref2.showStatusIndicator,
|
|
@@ -63,16 +70,20 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
63
70
|
_props$size = props.size,
|
|
64
71
|
size = _props$size === void 0 ? _constants.SmartLinkSize.Medium : _props$size,
|
|
65
72
|
testId = props.testId,
|
|
66
|
-
|
|
73
|
+
_props$aiSummaryMinHe = props.aiSummaryMinHeight,
|
|
74
|
+
aiSummaryMinHeight = _props$aiSummaryMinHe === void 0 ? 0 : _props$aiSummaryMinHe,
|
|
67
75
|
metadata = props.metadata;
|
|
68
76
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
69
77
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
70
78
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
71
79
|
var url = (context === null || context === void 0 ? void 0 : context.url) || '';
|
|
72
80
|
var ari = (context === null || context === void 0 ? void 0 : context.ari) || '';
|
|
81
|
+
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
82
|
+
product = _useSmartLinkContext.product;
|
|
73
83
|
var _useAISummary = (0, _useAiSummary.useAISummary)({
|
|
74
84
|
url: url,
|
|
75
|
-
ari: ari
|
|
85
|
+
ari: ari,
|
|
86
|
+
product: product
|
|
76
87
|
}),
|
|
77
88
|
summariseUrl = _useAISummary.summariseUrl,
|
|
78
89
|
_useAISummary$state = _useAISummary.state,
|
|
@@ -108,7 +119,12 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
108
119
|
testId: "".concat(testId, "-ai-summary-action"),
|
|
109
120
|
icon: /*#__PURE__*/_react.default.createElement(_aiIcon.default, {
|
|
110
121
|
label: "AIIcon"
|
|
111
|
-
})
|
|
122
|
+
}),
|
|
123
|
+
/**
|
|
124
|
+
* Enabling feature discovery pulse
|
|
125
|
+
* Cleanup: https://product-fabric.atlassian.net/browse/EDM-9693
|
|
126
|
+
*/
|
|
127
|
+
wrapper: _featureDiscovery.default
|
|
112
128
|
};
|
|
113
129
|
return [aiAction].concat((0, _toConsumableArray2.default)(actions));
|
|
114
130
|
}
|
|
@@ -124,14 +140,25 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
124
140
|
return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, props, {
|
|
125
141
|
direction: _constants.SmartLinkDirection.Vertical,
|
|
126
142
|
testId: "".concat(testId, "-resolved-view")
|
|
143
|
+
/**
|
|
144
|
+
* Enabled for feature discovery to allow box shadow to overflow
|
|
145
|
+
* Cleanup: https://product-fabric.atlassian.net/browse/EDM-8681
|
|
146
|
+
*/,
|
|
147
|
+
overrideCss: (0, _react2.css)({
|
|
148
|
+
overflow: 'visible'
|
|
149
|
+
}, props.overrideCss)
|
|
127
150
|
}), status === 'done' && /*#__PURE__*/_react.default.createElement(_aiEventSummaryViewed.default, {
|
|
128
151
|
fromCache: isSummarisedOnMountRef.current
|
|
129
|
-
}),
|
|
152
|
+
}), /*#__PURE__*/_react.default.createElement(_aiMotionWrapper.default, {
|
|
153
|
+
minHeight: aiSummaryMinHeight,
|
|
154
|
+
show: showAISummary,
|
|
155
|
+
showTransition: !isSummarisedOnMountRef.current
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement(_aiSummary.default, {
|
|
130
157
|
testId: "".concat(testId, "-ai-summary"),
|
|
131
158
|
minHeight: aiSummaryMinHeight,
|
|
132
159
|
content: content,
|
|
133
160
|
showIcon: isSummarisedOnMountRef.current
|
|
134
|
-
}), /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
161
|
+
})), /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
135
162
|
alignBlock: "center",
|
|
136
163
|
alignInline: "end",
|
|
137
164
|
grow: "fill",
|
|
@@ -148,6 +175,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
148
175
|
size: size
|
|
149
176
|
}))), /*#__PURE__*/_react.default.createElement(AISummaryBlockErrorIndicator, {
|
|
150
177
|
showErrorIndicator: !isErroredOnMountRef.current && status === 'error',
|
|
178
|
+
showTransition: !isErroredOnMountRef.current,
|
|
151
179
|
error: error,
|
|
152
180
|
testId: testId
|
|
153
181
|
}));
|
|
@@ -12,7 +12,9 @@ var _constants = require("../../../../../constants");
|
|
|
12
12
|
var _utils = require("../utils");
|
|
13
13
|
var _templateObject;
|
|
14
14
|
/** @jsx jsx */
|
|
15
|
-
var getBlockStyles = function getBlockStyles(direction, size
|
|
15
|
+
var getBlockStyles = function getBlockStyles(direction, size
|
|
16
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
17
|
+
) {
|
|
16
18
|
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n justify-content: flex-start;\n [data-separator] + [data-separator]:before {\n content: '\u2022';\n margin-right: ", "rem;\n }\n // Pull request elements: source branch \u2192 target branch\n [data-smart-element='", "']\n + [data-smart-element='", "']:before {\n content: '\u2192';\n }\n // Pull request elements: target branch \u2190 source branch\n [data-smart-element='", "']\n + [data-smart-element='", "']:before {\n content: '\u2190';\n }\n"])), (0, _utils.getBaseStyles)(direction, size), _utils.highlightRemoveStyles, (0, _utils.getGapSize)(size), _constants.ElementName.SourceBranch, _constants.ElementName.TargetBranch, _constants.ElementName.TargetBranch, _constants.ElementName.SourceBranch);
|
|
17
19
|
};
|
|
18
20
|
|
|
@@ -10,30 +10,57 @@ var _react = require("@emotion/react");
|
|
|
10
10
|
var _constants = require("../../../../../constants");
|
|
11
11
|
var _utils = require("../utils");
|
|
12
12
|
var _utils2 = require("../../utils");
|
|
13
|
-
var _templateObject
|
|
13
|
+
var _templateObject;
|
|
14
14
|
/** @jsx jsx */
|
|
15
15
|
var getAlignmentStyles = function getAlignmentStyles(align) {
|
|
16
16
|
switch (align) {
|
|
17
17
|
case _constants.SmartLinkAlignment.Right:
|
|
18
|
-
return (0, _react.css)(
|
|
18
|
+
return (0, _react.css)({
|
|
19
|
+
WebkitBoxAlign: 'end',
|
|
20
|
+
MsFlexAlign: 'end',
|
|
21
|
+
justifyContent: 'flex-end',
|
|
22
|
+
textAlign: 'right'
|
|
23
|
+
});
|
|
19
24
|
case _constants.SmartLinkAlignment.Left:
|
|
20
25
|
default:
|
|
21
|
-
return (0, _react.css)(
|
|
26
|
+
return (0, _react.css)({
|
|
27
|
+
WebkitBoxAlign: 'start',
|
|
28
|
+
MsFlexAlign: 'start',
|
|
29
|
+
justifyContent: 'flex-start',
|
|
30
|
+
textAlign: 'left'
|
|
31
|
+
});
|
|
22
32
|
}
|
|
23
33
|
};
|
|
24
34
|
var getGapStyles = function getGapStyles(size, align) {
|
|
25
35
|
var gap = (0, _utils.getGapSize)(size);
|
|
26
36
|
if (align === _constants.SmartLinkAlignment.Right) {
|
|
27
|
-
return (0, _react.css)(
|
|
37
|
+
return (0, _react.css)({
|
|
38
|
+
'> span': {
|
|
39
|
+
marginLeft: "".concat(gap, "rem")
|
|
40
|
+
},
|
|
41
|
+
'> span:first-child': {
|
|
42
|
+
marginLeft: 'initial'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
28
45
|
}
|
|
29
|
-
return (0, _react.css)(
|
|
46
|
+
return (0, _react.css)({
|
|
47
|
+
'> span': {
|
|
48
|
+
marginRight: "".concat(gap, "rem"),
|
|
49
|
+
'&:last-child': {
|
|
50
|
+
marginRight: 'initial'
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
30
54
|
};
|
|
31
55
|
var getHorizontalDirectionStyles = function getHorizontalDirectionStyles(size, align) {
|
|
32
56
|
var lineHeight = (0, _utils2.getMaxLineHeight)(size);
|
|
33
|
-
|
|
57
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
58
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n vertical-align: middle;\n ", "\n\n > span, > div {\n vertical-align: middle;\n\n &[data-smart-element-date-time],\n &[data-smart-element-text] {\n // Show all/wrapped/truncated\n display: inline;\n }\n }\n\n ", "\n "])), (0, _utils2.getTruncateStyles)(1, lineHeight + 'rem'), getGapStyles(size, align));
|
|
34
59
|
};
|
|
35
60
|
var getElementGroupStyles = exports.getElementGroupStyles = function getElementGroupStyles(direction, size, align, width, position) {
|
|
36
|
-
return (0, _react.css)(
|
|
61
|
+
return (0, _react.css)((0, _utils.getBaseStyles)(direction, size), getAlignmentStyles(align), {
|
|
62
|
+
minWidth: '10%'
|
|
63
|
+
}, width === _constants.SmartLinkWidth.Flexible ? "flex: 1 3;" : '', direction === _constants.SmartLinkDirection.Horizontal ? getHorizontalDirectionStyles(size, align) : '', position === _constants.SmartLinkPosition.Top ? 'align-self: flex-start;' : '');
|
|
37
64
|
};
|
|
38
65
|
|
|
39
66
|
/**
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
10
|
var _react = _interopRequireDefault(require("react"));
|
|
12
11
|
var _react2 = require("@emotion/react");
|
|
13
12
|
var _constants = require("../../../../../constants");
|
|
@@ -16,7 +15,6 @@ var _block = _interopRequireDefault(require("../block"));
|
|
|
16
15
|
var _elementGroup = _interopRequireDefault(require("../element-group"));
|
|
17
16
|
var _utils2 = require("../../utils");
|
|
18
17
|
var _excluded = ["maxLines", "status", "testId", "primary", "secondary"];
|
|
19
|
-
var _templateObject;
|
|
20
18
|
var DEFAULT_MAX_LINES = 2;
|
|
21
19
|
var MAXIMUM_MAX_LINES = 2;
|
|
22
20
|
var MINIMUM_MAX_LINES = 1;
|
|
@@ -26,7 +24,9 @@ var getElementGroupStyles = function getElementGroupStyles(size, maxLines) {
|
|
|
26
24
|
// We need the height of the line to be equal on both left and right
|
|
27
25
|
// sides so they line up nicely.
|
|
28
26
|
var lineHeight = (0, _utils2.getMaxLineHeight)(size);
|
|
29
|
-
return (0, _react2.css)(
|
|
27
|
+
return (0, _react2.css)({
|
|
28
|
+
lineHeight: "".concat(lineHeight, "rem")
|
|
29
|
+
}, (0, _utils2.getTruncateStyles)(maxLines, lineHeight + 'rem'));
|
|
30
30
|
};
|
|
31
31
|
var getMaxLines = function getMaxLines(maxLines) {
|
|
32
32
|
if (maxLines > MAXIMUM_MAX_LINES) {
|
|
@@ -16,7 +16,7 @@ var _constants = require("../../../../../../constants");
|
|
|
16
16
|
var _block = _interopRequireDefault(require("../../block"));
|
|
17
17
|
var _elements = require("../../../elements");
|
|
18
18
|
var _excluded = ["ignoreContainerPadding", "onError", "overrideCss", "placement", "testId", "overrideUrl"];
|
|
19
|
-
var _templateObject
|
|
19
|
+
var _templateObject;
|
|
20
20
|
/** @jsx jsx */
|
|
21
21
|
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); }
|
|
22
22
|
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 && Object.prototype.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; }
|
|
@@ -38,10 +38,20 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
38
38
|
var getPreviewBlockStyles = function getPreviewBlockStyles(placement, ignoreContainerPadding) {
|
|
39
39
|
if (placement === _constants.MediaPlacement.Left || placement === _constants.MediaPlacement.Right) {
|
|
40
40
|
var containerPadding = ignoreContainerPadding ? '0rem' : 'var(--container-padding)';
|
|
41
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
41
42
|
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: ", ";\n bottom: ", ";\n width: calc(var(--preview-block-width) - ", ");\n\n ", "\n ", "\n\n [data-smart-element-media='image'] {\n aspect-ratio: unset;\n padding-top: unset;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n "])), containerPadding, containerPadding, containerPadding, placement === _constants.MediaPlacement.Left ? "left: ".concat(containerPadding, ";") : '', placement === _constants.MediaPlacement.Right ? "right: ".concat(containerPadding, ";") : '');
|
|
42
43
|
}
|
|
43
44
|
if (ignoreContainerPadding) {
|
|
44
|
-
return (0, _react2.css)(
|
|
45
|
+
return (0, _react2.css)({
|
|
46
|
+
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
47
|
+
marginRight: 'calc(var(--container-gap-right) * -1)',
|
|
48
|
+
'&:first-of-type': {
|
|
49
|
+
marginTop: 'calc(var(--container-padding) * -1)'
|
|
50
|
+
},
|
|
51
|
+
'&:last-of-type': {
|
|
52
|
+
marginBottom: 'calc(var(--container-padding) * -1)'
|
|
53
|
+
}
|
|
54
|
+
});
|
|
45
55
|
}
|
|
46
56
|
};
|
|
47
57
|
|
|
@@ -65,7 +75,7 @@ var PreviewBlockResolvedView = function PreviewBlockResolvedView(_ref) {
|
|
|
65
75
|
styles = _useState2[0],
|
|
66
76
|
setStyles = _useState2[1];
|
|
67
77
|
var updateStyles = (0, _react.useCallback)(function () {
|
|
68
|
-
setStyles((0, _react2.css)(
|
|
78
|
+
setStyles((0, _react2.css)(getPreviewBlockStyles(placement, ignoreContainerPadding), overrideCss));
|
|
69
79
|
}, [ignoreContainerPadding, overrideCss, placement]);
|
|
70
80
|
(0, _react.useEffect)(function () {
|
|
71
81
|
updateStyles();
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
@@ -21,7 +20,6 @@ var _errored = require("./errored");
|
|
|
21
20
|
var _resolved = require("./resolved");
|
|
22
21
|
var _resolving = require("./resolving");
|
|
23
22
|
var _analytics = require("./analytics");
|
|
24
|
-
var _templateObject;
|
|
25
23
|
var _excluded = ["testId", "url", "renderers"];
|
|
26
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); }
|
|
27
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 && Object.prototype.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; }
|
|
@@ -97,7 +95,9 @@ var RelatedUrlsBlock = function RelatedUrlsBlock(_ref) {
|
|
|
97
95
|
if (relatedUrls) {
|
|
98
96
|
return /*#__PURE__*/_react.default.createElement(_resolved.RelatedUrlsResolvedView, (0, _extends2.default)({
|
|
99
97
|
renderers: renderers,
|
|
100
|
-
overrideCss: (0, _react2.css)(
|
|
98
|
+
overrideCss: (0, _react2.css)({
|
|
99
|
+
minHeight: '1.55rem'
|
|
100
|
+
}),
|
|
101
101
|
testId: "".concat(testId, "-resolved-view"),
|
|
102
102
|
relatedUrlsResponse: relatedUrls
|
|
103
103
|
}, blockProps));
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
11
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -18,7 +17,6 @@ var _messages = require("../../../../../../../messages");
|
|
|
18
17
|
var _utils = require("../../../../../components/utils");
|
|
19
18
|
var _text = _interopRequireDefault(require("../../../../elements/text"));
|
|
20
19
|
var _resolvedResultStack = _interopRequireDefault(require("./resolved-result-stack"));
|
|
21
|
-
var _templateObject;
|
|
22
20
|
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
21
|
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 && Object.prototype.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
22
|
var RelatedUrlList = function RelatedUrlList(_ref) {
|
|
@@ -52,7 +50,9 @@ var RelatedUrlList = function RelatedUrlList(_ref) {
|
|
|
52
50
|
alignBlock: "center",
|
|
53
51
|
spread: "space-between"
|
|
54
52
|
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
55
|
-
overrideCss: (0, _react2.css)(
|
|
53
|
+
overrideCss: (0, _react2.css)({
|
|
54
|
+
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
55
|
+
}),
|
|
56
56
|
message: {
|
|
57
57
|
descriptor: title
|
|
58
58
|
}
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
10
|
var _react = _interopRequireDefault(require("react"));
|
|
12
11
|
var _reactIntlNext = require("react-intl-next");
|
|
13
12
|
var _react2 = require("@emotion/react");
|
|
@@ -17,12 +16,25 @@ var _constants = require("../../../../../../constants");
|
|
|
17
16
|
var _utils = require("../../../utils");
|
|
18
17
|
var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
19
18
|
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "hideIcon"];
|
|
20
|
-
var _templateObject, _templateObject2;
|
|
21
19
|
/** @jsx jsx */
|
|
22
|
-
var actionStyles = (0, _react2.css)(
|
|
20
|
+
var actionStyles = (0, _react2.css)({
|
|
21
|
+
cursor: 'pointer',
|
|
22
|
+
':hover': {
|
|
23
|
+
color: "var(--ds-text-subtle, #8993A4)",
|
|
24
|
+
textDecoration: 'underline'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
23
27
|
var getMessageStyles = function getMessageStyles(size, hasAction) {
|
|
24
28
|
var sizeStyles = (0, _utils.getLinkSizeStyles)(size);
|
|
25
|
-
return (0, _react2.css)(
|
|
29
|
+
return (0, _react2.css)({
|
|
30
|
+
flex: '1 1 auto',
|
|
31
|
+
justifyContent: 'flex-end'
|
|
32
|
+
}, hasAction ? actionStyles : '', sizeStyles, (0, _utils.getTruncateStyles)(1, (0, _utils.getLinkLineHeight)(size)), {
|
|
33
|
+
color: "var(--ds-text-disabled, #6B778C)",
|
|
34
|
+
':focus': {
|
|
35
|
+
outline: "var(--ds-border-focused, #388BFF)".concat(" solid 2px")
|
|
36
|
+
}
|
|
37
|
+
});
|
|
26
38
|
};
|
|
27
39
|
|
|
28
40
|
/**
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
10
|
var _react = _interopRequireDefault(require("react"));
|
|
12
11
|
var _react2 = require("@emotion/react");
|
|
@@ -15,7 +14,6 @@ var _block = _interopRequireDefault(require("../../block"));
|
|
|
15
14
|
var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
16
15
|
var _constants = require("../../../../../../constants");
|
|
17
16
|
var _utils = require("../../utils");
|
|
18
|
-
var _templateObject;
|
|
19
17
|
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "title", "metadataPosition", "hideIcon"];
|
|
20
18
|
/**
|
|
21
19
|
* This renders a fully resolved TitleBlock.
|
|
@@ -44,7 +42,9 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
44
42
|
}), /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
45
43
|
direction: _constants.SmartLinkDirection.Vertical,
|
|
46
44
|
width: _constants.SmartLinkWidth.Flexible,
|
|
47
|
-
overrideCss: (0, _react2.css)(
|
|
45
|
+
overrideCss: (0, _react2.css)({
|
|
46
|
+
gap: "var(--ds-space-050, 0.25rem)"
|
|
47
|
+
})
|
|
48
48
|
}, title, subtitleElements && /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
49
49
|
direction: _constants.SmartLinkDirection.Horizontal
|
|
50
50
|
}, subtitleElements)), metadataElements && /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
@@ -79,6 +79,8 @@ var getBaseStyles = exports.getBaseStyles = function getBaseStyles(direction, si
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
|
+
|
|
83
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
82
84
|
var highlightRemoveStyles = exports.highlightRemoveStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n outline: none !important;\n outline-color: inherit;\n color: inherit;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n"])));
|
|
83
85
|
var isActionGroup = function isActionGroup(node) {
|
|
84
86
|
return /*#__PURE__*/_react.default.isValidElement(node) && node.type === _actionGroup.default;
|
|
@@ -5,17 +5,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _react2 = require("@emotion/react");
|
|
11
|
-
var _templateObject, _templateObject2;
|
|
12
10
|
/** @jsx jsx */
|
|
11
|
+
|
|
13
12
|
var LoadingSkeleton = function LoadingSkeleton(_ref) {
|
|
14
13
|
var testId = _ref.testId,
|
|
15
14
|
width = _ref.width,
|
|
16
15
|
height = _ref.height;
|
|
17
|
-
var animationNameStyles = (0, _react2.keyframes)(
|
|
18
|
-
|
|
16
|
+
var animationNameStyles = (0, _react2.keyframes)({
|
|
17
|
+
'0%': {
|
|
18
|
+
backgroundPosition: '50% 0'
|
|
19
|
+
},
|
|
20
|
+
'100%': {
|
|
21
|
+
backgroundPosition: '-50% 0'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var styles = (0, _react2.css)({
|
|
25
|
+
width: "".concat(width, "rem"),
|
|
26
|
+
height: "".concat(height, "rem"),
|
|
27
|
+
borderRadius: '2px',
|
|
28
|
+
userSelect: 'none',
|
|
29
|
+
background: "var(--ds-skeleton-subtle, #f6f7f8)",
|
|
30
|
+
backgroundImage: "linear-gradient( to right, transparent 0%, ".concat("var(--ds-skeleton, #edeef1)", " 20%, transparent 40%, transparent 100% )"),
|
|
31
|
+
backgroundRepeat: 'no-repeat',
|
|
32
|
+
backgroundSize: '280% 100%',
|
|
33
|
+
display: 'inline-block',
|
|
34
|
+
animationDuration: '1s',
|
|
35
|
+
animationFillMode: 'forwards',
|
|
36
|
+
animationIterationCount: 'infinite',
|
|
37
|
+
animationName: animationNameStyles,
|
|
38
|
+
animationTimingFunction: 'linear'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- needs dynamic css
|
|
19
42
|
return (0, _react2.jsx)("span", {
|
|
20
43
|
css: styles,
|
|
21
44
|
"data-testid": testId
|
|
@@ -98,6 +98,8 @@ var getChildrenOptions = function getChildrenOptions(children, context) {
|
|
|
98
98
|
};
|
|
99
99
|
var getContainerStyles = exports.getContainerStyles = function getContainerStyles(size, hideBackground, hideElevation, hidePadding, clickableContainer, childrenOptions) {
|
|
100
100
|
var paddingCss = getContainerPaddingStyles(size, hidePadding, childrenOptions);
|
|
101
|
+
|
|
102
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
101
103
|
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n gap: ", " 0;\n flex-direction: column;\n min-width: 0;\n overflow-x: hidden;\n position: relative;\n ", "\n ", "\n ", "\n ", "\n &:hover ~ .actions-button-group {\n opacity: 1;\n }\n a:focus,\n .has-action:focus {\n outline-offset: -2px;\n }\n "])), getGap(size), hideBackground ? '' : "background-color: ".concat("var(--ds-surface-raised, #FFFFFF)", ";"), paddingCss, hideElevation ? '' : elevationStyles, clickableContainer ? clickableContainerStyles : '');
|
|
102
104
|
};
|
|
103
105
|
var renderChildren = function renderChildren(children, containerSize, containerTheme, status, retry, onClick) {
|
|
@@ -5,13 +5,43 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _react2 = require("@emotion/react");
|
|
11
10
|
var _useLinkClicked = require("../../../../../state/analytics/useLinkClicked");
|
|
12
|
-
var _templateObject;
|
|
13
11
|
/** @jsx jsx */
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
var styles = (0, _react2.css)({
|
|
14
|
+
// Stretch the invisible link over the whole of the post.
|
|
15
|
+
// Hide the link’s text.
|
|
16
|
+
top: 0,
|
|
17
|
+
right: 0,
|
|
18
|
+
bottom: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
overflow: 'hidden',
|
|
21
|
+
textIndent: '100%',
|
|
22
|
+
whiteSpace: 'nowrap',
|
|
23
|
+
// Needs a heightened specificity to trump other anchor.
|
|
24
|
+
// Stack it under all other links in the post text.
|
|
25
|
+
'a&.layered-link': {
|
|
26
|
+
position: 'absolute',
|
|
27
|
+
zIndex: 0
|
|
28
|
+
},
|
|
29
|
+
// When hovering over the layered link, any hidden action buttons inside
|
|
30
|
+
// the Container should become visible.
|
|
31
|
+
// As actions resides inside blocks and layered link is expected to be
|
|
32
|
+
// on the same level of blocks. That makes the blocks, e.g. TitleBlock,
|
|
33
|
+
// its sibling. Using general sibling combinator here to apply styling to
|
|
34
|
+
// all the siblings of layered link.
|
|
35
|
+
// The general sibling combinator (~) separates two selectors and matches all
|
|
36
|
+
// iterations of the second element, that are following the first element
|
|
37
|
+
// (though not necessarily immediately), and are children of the same parent
|
|
38
|
+
// element.
|
|
39
|
+
'&:hover ~ *': {
|
|
40
|
+
'.actions-button-group': {
|
|
41
|
+
opacity: 1
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
15
45
|
|
|
16
46
|
/**
|
|
17
47
|
* An anchor component to cover the entire container creating a clickable area.
|
|
@@ -5,13 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _badge = _interopRequireDefault(require("@atlaskit/badge"));
|
|
11
10
|
var _react2 = require("@emotion/react");
|
|
12
|
-
var _templateObject;
|
|
13
11
|
/** @jsx jsx */
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
var badgeStyles = (0, _react2.css)({
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
display: 'inline-flex'
|
|
16
|
+
});
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* A base element that displays a visual indicator for a numeric value
|