@atlaskit/smart-card 26.55.2 → 26.56.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +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/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 +6 -4
- 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/types.js +5 -1
- 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 +15 -1
- 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/HoverCardComponent.js +1 -1
- package/dist/cjs/view/HoverCard/components/views/forbidden/styled.js +16 -6
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +2 -1
- 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/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 +6 -4
- 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/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 +15 -1
- 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/HoverCardComponent.js +2 -2
- package/dist/es2019/view/HoverCard/components/views/forbidden/styled.js +16 -16
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +2 -1
- 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/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 +6 -4
- 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/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 +15 -1
- 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/HoverCardComponent.js +2 -2
- package/dist/esm/view/HoverCard/components/views/forbidden/styled.js +16 -5
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +2 -1
- 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 +1 -1
- 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/action-block/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.d.ts +3 -2
- 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 +1 -1
- 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/view/HoverCard/components/views/resolved/types.d.ts +2 -1
- package/dist/types/view/HoverCard/types.d.ts +2 -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 +2 -1
- 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/action-block/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.d.ts +3 -2
- 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 +1 -1
- 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/dist/types-ts4.5/view/HoverCard/components/views/resolved/types.d.ts +2 -1
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +2 -1
- package/package.json +3 -2
|
@@ -9,21 +9,17 @@ import { aiThemeTokens } from '../ai-prism/constants';
|
|
|
9
9
|
* with modifications
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
const bounce = keyframes
|
|
13
|
-
from {
|
|
14
|
-
transform: translateY(0)
|
|
12
|
+
const bounce = keyframes({
|
|
13
|
+
from: {
|
|
14
|
+
transform: 'translateY(0)'
|
|
15
|
+
},
|
|
16
|
+
'16.67%': {
|
|
17
|
+
transform: 'translateY(-2px)'
|
|
18
|
+
},
|
|
19
|
+
'33.33%': {
|
|
20
|
+
transform: 'translateY(0px)'
|
|
15
21
|
}
|
|
16
|
-
|
|
17
|
-
// 200ms of 1200ms = 16.67%
|
|
18
|
-
16.67% {
|
|
19
|
-
transform: translateY(-2px);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// 400ms of 1200ms = 33.33%
|
|
23
|
-
33.33% {
|
|
24
|
-
transform: translateY(0px);
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
22
|
+
});
|
|
27
23
|
const BASE_DELAY = 400;
|
|
28
24
|
const QUEUE_DELAY = 200;
|
|
29
25
|
const animationStyles = css({
|
package/dist/esm/constants.js
CHANGED
|
@@ -145,6 +145,7 @@ export var ElementName = /*#__PURE__*/function (ElementName) {
|
|
|
145
145
|
* Flexible UI action (button)
|
|
146
146
|
*/
|
|
147
147
|
export var ActionName = /*#__PURE__*/function (ActionName) {
|
|
148
|
+
ActionName["CopyLinkAction"] = "CopyLinkAction";
|
|
148
149
|
ActionName["DeleteAction"] = "DeleteAction";
|
|
149
150
|
ActionName["EditAction"] = "EditAction";
|
|
150
151
|
ActionName["FollowAction"] = "FollowAction";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { extractLink } from '@atlaskit/link-extractors';
|
|
2
|
+
import { CardAction } from '../../../view/Card/types';
|
|
3
|
+
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
4
|
+
export var extractCopyLinkAction = function extractCopyLinkAction(data, actionOptions) {
|
|
5
|
+
if (!canShowAction(CardAction.CopyLinkAction, actionOptions)) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
var url = extractLink(data);
|
|
9
|
+
if (!url) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
url: url
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -3,9 +3,10 @@ import { ActionName } from '../../../constants';
|
|
|
3
3
|
import { extractDownloadAction } from './extract-download-action';
|
|
4
4
|
import { extractPreviewAction } from './extract-preview-action';
|
|
5
5
|
import extractFollowAction from './extract-follow-action';
|
|
6
|
+
import { extractCopyLinkAction } from './extract-copy-link-action';
|
|
6
7
|
var extractActions = function extractActions(response, data, actionOptions, id) {
|
|
7
8
|
var _action;
|
|
8
|
-
var action = (_action = {}, _defineProperty(_action, ActionName.DownloadAction, extractDownloadAction(data, actionOptions)), _defineProperty(_action, ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), _defineProperty(_action, ActionName.PreviewAction, extractPreviewAction(response, actionOptions)), _action);
|
|
9
|
+
var action = (_action = {}, _defineProperty(_action, ActionName.CopyLinkAction, extractCopyLinkAction(data, actionOptions)), _defineProperty(_action, ActionName.DownloadAction, extractDownloadAction(data, actionOptions)), _defineProperty(_action, ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), _defineProperty(_action, ActionName.PreviewAction, extractPreviewAction(response, actionOptions)), _action);
|
|
9
10
|
return Object.values(action).some(function (value) {
|
|
10
11
|
return Boolean(value);
|
|
11
12
|
}) ? action : undefined;
|
package/dist/esm/messages.js
CHANGED
|
@@ -45,6 +45,11 @@ export var messages = defineMessages({
|
|
|
45
45
|
defaultMessage: "We cannot show the results of this summary as it goes against <a>Atlassian's Acceptable Use Policy</a>.",
|
|
46
46
|
description: 'Shown when AI summary is summarising the link resource content and the content violates atlassians acceptable use policy.'
|
|
47
47
|
},
|
|
48
|
+
ai_summary_error_hipaa_content_detected: {
|
|
49
|
+
id: 'fabric.linking.ai_summary_error_hipaa_content_detected',
|
|
50
|
+
defaultMessage: 'Atlassian Intelligence was unable to process your request as your content contains links to HIPAA restricted content.',
|
|
51
|
+
description: 'Shown when the AI summary is summarising the link resource content and the content contains HIPAA restricted content.'
|
|
52
|
+
},
|
|
48
53
|
assigned_to: {
|
|
49
54
|
id: 'fabric.linking.assigned_to',
|
|
50
55
|
defaultMessage: 'Assigned to {context}',
|
|
@@ -145,6 +150,11 @@ export var messages = defineMessages({
|
|
|
145
150
|
defaultMessage: 'Copy link',
|
|
146
151
|
description: ''
|
|
147
152
|
},
|
|
153
|
+
copied_url_to_clipboard: {
|
|
154
|
+
id: 'fabric.linking.copied_url_to_clipboard.nonfinal',
|
|
155
|
+
defaultMessage: 'Copied!',
|
|
156
|
+
description: 'Url has been copied to the clipboard'
|
|
157
|
+
},
|
|
148
158
|
could_not_load_link: {
|
|
149
159
|
id: 'fabric.linking.couldnt_load_link',
|
|
150
160
|
defaultMessage: "We couldn't load this link for an unknown reason.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var errorMessages = ['NETWORK_ERROR', 'NO_ANSWER', 'RATE_LIMIT', 'NO_AGENT', 'PLUGIN_ERRORED', 'OPENAI_RATE_LIMIT_USER_ABUSE', 'ACCEPTABLE_USE_VIOLATIONS', 'AI_DISABLED', 'UNEXPECTED'];
|
|
1
|
+
export var errorMessages = ['NETWORK_ERROR', 'NO_ANSWER', 'RATE_LIMIT', 'NO_AGENT', 'PLUGIN_ERRORED', 'OPENAI_RATE_LIMIT_USER_ABUSE', 'ACCEPTABLE_USE_VIOLATIONS', 'AI_DISABLED', 'UNEXPECTED', 'HIPAA_CONTENT_DETECTED'];
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.
|
|
18
|
+
packageVersion: "26.56.1"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
3
|
var _excluded = ["testId"];
|
|
5
|
-
var _templateObject;
|
|
6
4
|
/** @jsx jsx */
|
|
7
5
|
import { css, jsx } from '@emotion/react';
|
|
8
6
|
import { useCallback, useMemo } from 'react';
|
|
@@ -14,7 +12,11 @@ import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
|
|
|
14
12
|
import { messages } from '../../../../messages';
|
|
15
13
|
import UnresolvedView from './unresolved-view';
|
|
16
14
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
17
|
-
var contentStyles = css(
|
|
15
|
+
var contentStyles = css({
|
|
16
|
+
color: "var(--ds-text-subtlest, #626F86)",
|
|
17
|
+
marginTop: "var(--ds-space-100, 0.5rem)",
|
|
18
|
+
fontSize: '0.75rem'
|
|
19
|
+
});
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* This view represents a Block card that has an 'Unauthorized' status .
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
import styled from '@emotion/styled';
|
|
4
2
|
// TODO: Replace overrides with proper AtlasKit solution.
|
|
5
|
-
export var LozengeBlockWrapper = styled.span(
|
|
3
|
+
export var LozengeBlockWrapper = styled.span({
|
|
4
|
+
'& > span': {
|
|
5
|
+
marginLeft: "var(--ds-space-050, 4px)"
|
|
6
|
+
}
|
|
7
|
+
});
|
|
@@ -4,5 +4,6 @@ export var CardAction = /*#__PURE__*/function (CardAction) {
|
|
|
4
4
|
CardAction["ViewAction"] = "ViewAction";
|
|
5
5
|
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
6
6
|
CardAction["FollowAction"] = "FollowAction";
|
|
7
|
+
CardAction["CopyLinkAction"] = "CopyLinkAction";
|
|
7
8
|
return CardAction;
|
|
8
9
|
}({});
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
3
1
|
import { css } from '@emotion/react';
|
|
4
2
|
import { gs } from '../../../common/utils';
|
|
5
|
-
export var containerStyles = css(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export var
|
|
3
|
+
export var containerStyles = css({
|
|
4
|
+
display: 'grid',
|
|
5
|
+
height: 'inherit'
|
|
6
|
+
});
|
|
7
|
+
export var contentStyles = css({
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flexDirection: 'column',
|
|
10
|
+
justifyContent: 'center',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
margin: 'auto',
|
|
13
|
+
padding: "var(--ds-space-200, 16px)",
|
|
14
|
+
gap: "var(--ds-space-250, 20px)",
|
|
15
|
+
maxWidth: gs(50)
|
|
16
|
+
});
|
|
17
|
+
export var imageStyles = css({
|
|
18
|
+
height: '120px',
|
|
19
|
+
width: '180px',
|
|
20
|
+
objectFit: 'contain',
|
|
21
|
+
objectPosition: 'center center'
|
|
22
|
+
});
|
|
23
|
+
export var titleStyles = css({
|
|
24
|
+
textAlign: 'center',
|
|
25
|
+
margin: 0,
|
|
26
|
+
padding: 0
|
|
27
|
+
});
|
|
28
|
+
export var descriptionStyles = css({
|
|
29
|
+
fontSize: '1em',
|
|
30
|
+
textAlign: 'center'
|
|
31
|
+
});
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
/** @jsx jsx */
|
|
4
2
|
|
|
5
3
|
import { di } from 'react-magnetic-di';
|
|
6
4
|
import { css, jsx } from '@emotion/react';
|
|
7
5
|
import { getIframeSandboxAttribute } from '../../../../utils';
|
|
8
6
|
import { IFrame } from '../../../EmbedCard/components/IFrame';
|
|
9
|
-
var iframeCss = css(
|
|
7
|
+
var iframeCss = css({
|
|
8
|
+
width: '100%',
|
|
9
|
+
height: 'calc(100vh - 208px)'
|
|
10
|
+
});
|
|
10
11
|
var EmbedContent = function EmbedContent(_ref) {
|
|
11
12
|
var isTrusted = _ref.isTrusted,
|
|
12
13
|
name = _ref.name,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
3
1
|
/** @jsx jsx */
|
|
4
2
|
import React, { useCallback } from 'react';
|
|
5
3
|
import { css, jsx } from '@emotion/react';
|
|
@@ -10,9 +8,23 @@ import { sizeToButtonSpacing } from '../../../utils';
|
|
|
10
8
|
var getButtonStyle = function getButtonStyle(size, iconOnly) {
|
|
11
9
|
switch (size) {
|
|
12
10
|
case SmartLinkSize.Large:
|
|
13
|
-
return iconOnly ? css(
|
|
11
|
+
return iconOnly ? css({
|
|
12
|
+
'button, button:hover, button:focus, button:active': {
|
|
13
|
+
padding: 0,
|
|
14
|
+
'> span': {
|
|
15
|
+
margin: 0
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}) : '';
|
|
14
19
|
case SmartLinkSize.Small:
|
|
15
|
-
return css(
|
|
20
|
+
return css({
|
|
21
|
+
fontSize: '0.75rem',
|
|
22
|
+
fontWeight: 500,
|
|
23
|
+
lineHeight: '1rem',
|
|
24
|
+
'button, button:hover, button:focus, button:active': [{
|
|
25
|
+
lineHeight: '1rem'
|
|
26
|
+
}, iconOnly ? "\n padding: 0.125rem;\n " : "\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n "]
|
|
27
|
+
});
|
|
16
28
|
case SmartLinkSize.XLarge:
|
|
17
29
|
case SmartLinkSize.Medium:
|
|
18
30
|
default:
|
|
@@ -30,7 +42,9 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
30
42
|
size = _ref.size,
|
|
31
43
|
testId = _ref.testId,
|
|
32
44
|
tooltipMessage = _ref.tooltipMessage,
|
|
33
|
-
isDisabled = _ref.isDisabled
|
|
45
|
+
isDisabled = _ref.isDisabled,
|
|
46
|
+
href = _ref.href,
|
|
47
|
+
ariaLabel = _ref.ariaLabel;
|
|
34
48
|
var iconOnly = !content;
|
|
35
49
|
var onButtonClick = useCallback(function (handler) {
|
|
36
50
|
return function (e) {
|
|
@@ -53,7 +67,9 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
53
67
|
isLoading: isLoading,
|
|
54
68
|
onClick: onButtonClick(onClick),
|
|
55
69
|
spacing: sizeToButtonSpacing[size],
|
|
56
|
-
testId: testId
|
|
70
|
+
testId: testId,
|
|
71
|
+
href: href,
|
|
72
|
+
"aria-label": ariaLabel
|
|
57
73
|
}, content)));
|
|
58
74
|
};
|
|
59
75
|
export default ActionButton;
|
|
@@ -46,7 +46,8 @@ var ActionStackItem = function ActionStackItem(_ref) {
|
|
|
46
46
|
spaceOption = _ref.space,
|
|
47
47
|
testId = _ref.testId,
|
|
48
48
|
tooltipMessage = _ref.tooltipMessage,
|
|
49
|
-
xcss = _ref.xcss
|
|
49
|
+
xcss = _ref.xcss,
|
|
50
|
+
tooltipOnHide = _ref.tooltipOnHide;
|
|
50
51
|
var space = spaceOption !== null && spaceOption !== void 0 ? spaceOption : getPrimitivesInlineSpaceBySize(size);
|
|
51
52
|
var onClick = useCallback(function () {
|
|
52
53
|
if (!isDisabled && !isLoading && onClickCallback) {
|
|
@@ -64,18 +65,19 @@ var ActionStackItem = function ActionStackItem(_ref) {
|
|
|
64
65
|
// Replace Box with Pressable once it becomes stable (currently beta)
|
|
65
66
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
66
67
|
content: tooltipMessage || content,
|
|
68
|
+
onHide: tooltipOnHide,
|
|
67
69
|
hideTooltipOnMouseDown: true
|
|
68
70
|
}, function (tooltipProps) {
|
|
69
71
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
70
72
|
as: "button",
|
|
71
73
|
xcss: [buttonStyles, xcss]
|
|
72
74
|
}, tooltipProps, {
|
|
73
|
-
onClick: onClick
|
|
75
|
+
onClick: onClick,
|
|
76
|
+
testId: testId
|
|
74
77
|
}), /*#__PURE__*/React.createElement(Inline, {
|
|
75
78
|
alignBlock: "center",
|
|
76
79
|
grow: "fill",
|
|
77
|
-
space: space
|
|
78
|
-
testId: testId
|
|
80
|
+
space: space
|
|
79
81
|
}, icon, /*#__PURE__*/React.createElement(Box, {
|
|
80
82
|
xcss: contentStyles
|
|
81
83
|
}, content)));
|
|
@@ -29,10 +29,14 @@ var Action = function Action(_ref) {
|
|
|
29
29
|
iconPosition = _ref$iconPosition === void 0 ? 'before' : _ref$iconPosition,
|
|
30
30
|
spaceInline = _ref.spaceInline,
|
|
31
31
|
tooltipMessage = _ref.tooltipMessage,
|
|
32
|
+
tooltipOnHide = _ref.tooltipOnHide,
|
|
32
33
|
xcss = _ref.xcss,
|
|
33
34
|
asDropDownItem = _ref.asDropDownItem,
|
|
34
35
|
overrideCss = _ref.overrideCss,
|
|
35
|
-
isDisabled = _ref.isDisabled
|
|
36
|
+
isDisabled = _ref.isDisabled,
|
|
37
|
+
href = _ref.href,
|
|
38
|
+
ariaLabel = _ref.ariaLabel,
|
|
39
|
+
Wrapper = _ref.wrapper;
|
|
36
40
|
if (!onClick) {
|
|
37
41
|
return null;
|
|
38
42
|
}
|
|
@@ -58,7 +62,8 @@ var Action = function Action(_ref) {
|
|
|
58
62
|
size: size,
|
|
59
63
|
testId: testId,
|
|
60
64
|
tooltipMessage: tooltipMessage || content,
|
|
61
|
-
xcss: xcss
|
|
65
|
+
xcss: xcss,
|
|
66
|
+
tooltipOnHide: tooltipOnHide
|
|
62
67
|
});
|
|
63
68
|
}
|
|
64
69
|
if (isDropdownItem) {
|
|
@@ -71,7 +76,7 @@ var Action = function Action(_ref) {
|
|
|
71
76
|
testId: testId
|
|
72
77
|
});
|
|
73
78
|
}
|
|
74
|
-
|
|
79
|
+
var button = jsx(ActionButton, {
|
|
75
80
|
appearance: appearance,
|
|
76
81
|
content: content,
|
|
77
82
|
iconAfter: iconAfter,
|
|
@@ -82,7 +87,10 @@ var Action = function Action(_ref) {
|
|
|
82
87
|
size: size,
|
|
83
88
|
testId: testId,
|
|
84
89
|
tooltipMessage: tooltipMessage || content,
|
|
85
|
-
isDisabled: isDisabled
|
|
90
|
+
isDisabled: isDisabled,
|
|
91
|
+
href: href,
|
|
92
|
+
ariaLabel: ariaLabel
|
|
86
93
|
});
|
|
94
|
+
return Wrapper !== undefined ? jsx(Wrapper, null, button) : button;
|
|
87
95
|
};
|
|
88
96
|
export default Action;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["onClick"];
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
+
import React, { useCallback, useState } from 'react';
|
|
8
|
+
import Action from '../action';
|
|
9
|
+
import { messages } from '../../../../../messages';
|
|
10
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
11
|
+
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
12
|
+
import { useFlexibleUiAnalyticsContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
13
|
+
import { ActionName } from '../../../../../constants';
|
|
14
|
+
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
15
|
+
var CopyLinkAction = function CopyLinkAction(_ref) {
|
|
16
|
+
var _context$actions;
|
|
17
|
+
var onClickCallback = _ref.onClick,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var context = useFlexibleUiContext();
|
|
20
|
+
var analytics = useFlexibleUiAnalyticsContext();
|
|
21
|
+
var invoke = useInvokeClientAction({
|
|
22
|
+
analytics: analytics
|
|
23
|
+
});
|
|
24
|
+
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.CopyLinkAction];
|
|
25
|
+
var _useState = useState(messages.copy_url_to_clipboard),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
tooltipMessage = _useState2[0],
|
|
28
|
+
setTooltipMessage = _useState2[1];
|
|
29
|
+
var onClick = useCallback(function () {
|
|
30
|
+
if (data && data.url) {
|
|
31
|
+
invoke({
|
|
32
|
+
actionType: ActionName.CopyLinkAction,
|
|
33
|
+
actionFn: function () {
|
|
34
|
+
var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
35
|
+
var _data$url;
|
|
36
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
37
|
+
while (1) switch (_context.prev = _context.next) {
|
|
38
|
+
case 0:
|
|
39
|
+
_context.next = 2;
|
|
40
|
+
return navigator.clipboard.writeText((_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : '');
|
|
41
|
+
case 2:
|
|
42
|
+
setTooltipMessage(messages.copied_url_to_clipboard);
|
|
43
|
+
case 3:
|
|
44
|
+
case "end":
|
|
45
|
+
return _context.stop();
|
|
46
|
+
}
|
|
47
|
+
}, _callee);
|
|
48
|
+
}));
|
|
49
|
+
function actionFn() {
|
|
50
|
+
return _actionFn.apply(this, arguments);
|
|
51
|
+
}
|
|
52
|
+
return actionFn;
|
|
53
|
+
}(),
|
|
54
|
+
// These values have already been set in analytics context.
|
|
55
|
+
// We only pass these here for ufo experience.
|
|
56
|
+
display: analytics === null || analytics === void 0 ? void 0 : analytics.display,
|
|
57
|
+
extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (onClickCallback) {
|
|
61
|
+
onClickCallback();
|
|
62
|
+
}
|
|
63
|
+
}, [analytics, data, invoke, onClickCallback]);
|
|
64
|
+
return data ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
65
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_url_to_clipboard),
|
|
66
|
+
icon: /*#__PURE__*/React.createElement(LinkIcon, {
|
|
67
|
+
label: "copy url",
|
|
68
|
+
size: "medium"
|
|
69
|
+
}),
|
|
70
|
+
onClick: onClick,
|
|
71
|
+
testId: "smart-action-copy-link-action",
|
|
72
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
|
|
73
|
+
tooltipOnHide: function tooltipOnHide() {
|
|
74
|
+
return setTooltipMessage(messages.copy_url_to_clipboard);
|
|
75
|
+
}
|
|
76
|
+
}, data, props)) : null;
|
|
77
|
+
};
|
|
78
|
+
export default CopyLinkAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,4 +3,5 @@ export { default as DeleteAction } from './delete-action';
|
|
|
3
3
|
export { default as EditAction } from './edit-action';
|
|
4
4
|
export { default as DownloadAction } from './download-action';
|
|
5
5
|
export { default as FollowAction } from './follow-action';
|
|
6
|
-
export { default as PreviewAction } from './preview-action';
|
|
6
|
+
export { default as PreviewAction } from './preview-action';
|
|
7
|
+
export { default as CopyLinkAction } from './copy-link-action';
|
package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,7 +14,7 @@ var contentStyles = xcss({
|
|
|
14
14
|
fontWeight: '400',
|
|
15
15
|
lineHeight: '14px'
|
|
16
16
|
});
|
|
17
|
-
var
|
|
17
|
+
var FormattedErrorMessage = function FormattedErrorMessage(_ref) {
|
|
18
18
|
var message = _ref.message,
|
|
19
19
|
url = _ref.url;
|
|
20
20
|
return /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
|
|
@@ -34,6 +34,10 @@ var getErrorMesssageProps = function getErrorMesssageProps(error) {
|
|
|
34
34
|
message: messages.ai_summary_error_acceptable_use_violation,
|
|
35
35
|
url: CONTENT_URL_ACCEPTABLE_USE_POLICY
|
|
36
36
|
};
|
|
37
|
+
case 'HIPAA_CONTENT_DETECTED':
|
|
38
|
+
return {
|
|
39
|
+
message: messages.ai_summary_error_hipaa_content_detected
|
|
40
|
+
};
|
|
37
41
|
default:
|
|
38
42
|
return {
|
|
39
43
|
message: messages.ai_summary_error_generic,
|
|
@@ -62,7 +66,7 @@ var AIStateError = function AIStateError(_ref2) {
|
|
|
62
66
|
content: /*#__PURE__*/React.createElement(Box, {
|
|
63
67
|
testId: "".concat(testId, "-error-message"),
|
|
64
68
|
xcss: contentStyles
|
|
65
|
-
}, /*#__PURE__*/React.createElement(
|
|
69
|
+
}, /*#__PURE__*/React.createElement(FormattedErrorMessage, {
|
|
66
70
|
message: message,
|
|
67
71
|
url: url
|
|
68
72
|
})),
|
package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
4
|
+
import { StorageClient } from '@atlaskit/frontend-utilities/storage-client';
|
|
5
|
+
import { getPulseStyles } from './styled';
|
|
6
|
+
var LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
|
|
7
|
+
var LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-ai-summarise';
|
|
8
|
+
var LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
|
|
9
|
+
var LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
|
|
10
|
+
var LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME = 2000;
|
|
11
|
+
/**
|
|
12
|
+
* This is a hacky solution to help with the feature discovery.
|
|
13
|
+
* This implementation must be removed once the experiment is completed.
|
|
14
|
+
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-9649
|
|
15
|
+
*/
|
|
16
|
+
var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
17
|
+
var children = _ref.children,
|
|
18
|
+
testId = _ref.testId;
|
|
19
|
+
var renderedTime = useRef();
|
|
20
|
+
var storageClient = useMemo(function () {
|
|
21
|
+
return new StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
22
|
+
}, []);
|
|
23
|
+
var discovered = useMemo(function () {
|
|
24
|
+
return storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE;
|
|
25
|
+
}, [storageClient]);
|
|
26
|
+
useEffect(function () {
|
|
27
|
+
renderedTime.current = Date.now();
|
|
28
|
+
return function () {
|
|
29
|
+
if (!discovered && renderedTime.current) {
|
|
30
|
+
var duration = Date.now() - renderedTime.current;
|
|
31
|
+
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
32
|
+
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}, [storageClient, discovered]);
|
|
37
|
+
var component = useMemo(function () {
|
|
38
|
+
if (!discovered) {
|
|
39
|
+
return jsx("span", {
|
|
40
|
+
css: getPulseStyles(),
|
|
41
|
+
"data-testid": "".concat(testId, "-discovery")
|
|
42
|
+
}, children);
|
|
43
|
+
}
|
|
44
|
+
}, [children, discovered, testId]);
|
|
45
|
+
return component !== null && component !== void 0 ? component : children;
|
|
46
|
+
};
|
|
47
|
+
export default FeatureDiscovery;
|
package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { css, keyframes } from '@emotion/react';
|
|
2
|
+
export var getPulseStyles = function getPulseStyles() {
|
|
3
|
+
var color = "var(--ds-border-discovery, #8270DB)";
|
|
4
|
+
var pulseKeyframes = keyframes({
|
|
5
|
+
to: {
|
|
6
|
+
boxShadow: '0 0 0 7px rgba(0, 0, 0, 0)'
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
return css({
|
|
10
|
+
display: 'inline-flex',
|
|
11
|
+
borderRadius: '3px',
|
|
12
|
+
boxShadow: "0 0 0 0 ".concat(color),
|
|
13
|
+
animation: "".concat(pulseKeyframes, " 2s cubic-bezier(0.5, 0, 0, 1) 0.25s both 2")
|
|
14
|
+
});
|
|
15
|
+
};
|
|
@@ -20,6 +20,8 @@ import { useAnalyticsEvents } from '../../../../../../common/analytics/generated
|
|
|
20
20
|
import AIEventSummaryViewed from '../ai-event-summary-viewed';
|
|
21
21
|
import AIEventErrorViewed from '../ai-event-error-viewed';
|
|
22
22
|
import { di } from 'react-magnetic-di';
|
|
23
|
+
import { css } from '@emotion/react';
|
|
24
|
+
import FeatureDiscovery from '../feature-discovery';
|
|
23
25
|
export var AISummaryBlockErrorIndicator = function AISummaryBlockErrorIndicator(_ref) {
|
|
24
26
|
var showErrorIndicator = _ref.showErrorIndicator,
|
|
25
27
|
error = _ref.error,
|
|
@@ -107,7 +109,12 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
107
109
|
testId: "".concat(testId, "-ai-summary-action"),
|
|
108
110
|
icon: /*#__PURE__*/React.createElement(AIIcon, {
|
|
109
111
|
label: "AIIcon"
|
|
110
|
-
})
|
|
112
|
+
}),
|
|
113
|
+
/**
|
|
114
|
+
* Enabling feature discovery pulse
|
|
115
|
+
* Cleanup: https://product-fabric.atlassian.net/browse/EDM-9693
|
|
116
|
+
*/
|
|
117
|
+
wrapper: FeatureDiscovery
|
|
111
118
|
};
|
|
112
119
|
return [aiAction].concat(_toConsumableArray(actions));
|
|
113
120
|
}
|
|
@@ -123,6 +130,13 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
123
130
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
124
131
|
direction: SmartLinkDirection.Vertical,
|
|
125
132
|
testId: "".concat(testId, "-resolved-view")
|
|
133
|
+
/**
|
|
134
|
+
* Enabled for feature discovery to allow box shadow to overflow
|
|
135
|
+
* Cleanup: https://product-fabric.atlassian.net/browse/EDM-8681
|
|
136
|
+
*/,
|
|
137
|
+
overrideCss: css({
|
|
138
|
+
overflow: 'visible'
|
|
139
|
+
}, props.overrideCss)
|
|
126
140
|
}), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
|
|
127
141
|
fromCache: isSummarisedOnMountRef.current
|
|
128
142
|
}), /*#__PURE__*/React.createElement(AIMotionWrapper, {
|
|
@@ -5,7 +5,9 @@ import { useEffect } from 'react';
|
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { ElementName, SmartLinkDirection, SmartLinkSize } from '../../../../../constants';
|
|
7
7
|
import { getBaseStyles, getGapSize, highlightRemoveStyles, renderChildren } from '../utils';
|
|
8
|
-
var getBlockStyles = function getBlockStyles(direction, size
|
|
8
|
+
var getBlockStyles = function getBlockStyles(direction, size
|
|
9
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
10
|
+
) {
|
|
9
11
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])), getBaseStyles(direction, size), highlightRemoveStyles, getGapSize(size), ElementName.SourceBranch, ElementName.TargetBranch, ElementName.TargetBranch, ElementName.SourceBranch);
|
|
10
12
|
};
|
|
11
13
|
|