@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
3
|
+
import Action from '../action';
|
|
4
|
+
import { messages } from '../../../../../messages';
|
|
5
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
7
|
+
import { useFlexibleUiAnalyticsContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
8
|
+
import { ActionName } from '../../../../../constants';
|
|
9
|
+
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
10
|
+
const CopyLinkAction = ({
|
|
11
|
+
onClick: onClickCallback,
|
|
12
|
+
...props
|
|
13
|
+
}) => {
|
|
14
|
+
var _context$actions;
|
|
15
|
+
const context = useFlexibleUiContext();
|
|
16
|
+
const analytics = useFlexibleUiAnalyticsContext();
|
|
17
|
+
const invoke = useInvokeClientAction({
|
|
18
|
+
analytics
|
|
19
|
+
});
|
|
20
|
+
const data = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.CopyLinkAction];
|
|
21
|
+
const [tooltipMessage, setTooltipMessage] = useState(messages.copy_url_to_clipboard);
|
|
22
|
+
const onClick = useCallback(() => {
|
|
23
|
+
if (data && data.url) {
|
|
24
|
+
invoke({
|
|
25
|
+
actionType: ActionName.CopyLinkAction,
|
|
26
|
+
actionFn: async () => {
|
|
27
|
+
var _data$url;
|
|
28
|
+
await navigator.clipboard.writeText((_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : '');
|
|
29
|
+
setTooltipMessage(messages.copied_url_to_clipboard);
|
|
30
|
+
},
|
|
31
|
+
// These values have already been set in analytics context.
|
|
32
|
+
// We only pass these here for ufo experience.
|
|
33
|
+
display: analytics === null || analytics === void 0 ? void 0 : analytics.display,
|
|
34
|
+
extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (onClickCallback) {
|
|
38
|
+
onClickCallback();
|
|
39
|
+
}
|
|
40
|
+
}, [analytics, data, invoke, onClickCallback]);
|
|
41
|
+
return data ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
42
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_url_to_clipboard),
|
|
43
|
+
icon: /*#__PURE__*/React.createElement(LinkIcon, {
|
|
44
|
+
label: "copy url",
|
|
45
|
+
size: "medium"
|
|
46
|
+
}),
|
|
47
|
+
onClick: onClick,
|
|
48
|
+
testId: "smart-action-copy-link-action",
|
|
49
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
|
|
50
|
+
tooltipOnHide: () => setTooltipMessage(messages.copy_url_to_clipboard)
|
|
51
|
+
}, data, props)) : null;
|
|
52
|
+
};
|
|
53
|
+
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/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Box } from '@atlaskit/primitives';
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
export const AIMotionWrapper = ({
|
|
4
|
+
children,
|
|
5
|
+
isFadeIn = false,
|
|
6
|
+
minHeight = 0,
|
|
7
|
+
show,
|
|
8
|
+
showTransition = false
|
|
9
|
+
}) => {
|
|
10
|
+
const [height, setHeight] = useState(0);
|
|
11
|
+
const ref = useRef(null);
|
|
12
|
+
const transition = isFadeIn ? 'height, opacity' : 'height';
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (show && ref.current) {
|
|
15
|
+
// set the height of the error message container explicitly to the height
|
|
16
|
+
// of its contents (including anything hidden due to overflow) so that we
|
|
17
|
+
// can animate the height of the container
|
|
18
|
+
setHeight(ref.current.scrollHeight);
|
|
19
|
+
} else {
|
|
20
|
+
setHeight(0);
|
|
21
|
+
}
|
|
22
|
+
}, [children, show]);
|
|
23
|
+
return show ? /*#__PURE__*/React.createElement(Box, {
|
|
24
|
+
style: {
|
|
25
|
+
height,
|
|
26
|
+
minHeight,
|
|
27
|
+
lineHeight: 0,
|
|
28
|
+
overflow: 'hidden',
|
|
29
|
+
// a fit for purpose state variable to control when the 'visible' styles should be appled
|
|
30
|
+
opacity: height > 0 ? 1 : 0,
|
|
31
|
+
// we only want to transition opacity and height when the error message is initially shown
|
|
32
|
+
// not if its to be shown on mount
|
|
33
|
+
transitionProperty: showTransition ? transition : 'none',
|
|
34
|
+
transitionDuration: '0.3s'
|
|
35
|
+
},
|
|
36
|
+
ref: ref
|
|
37
|
+
}, children) : null;
|
|
38
|
+
};
|
|
39
|
+
export default AIMotionWrapper;
|
package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,7 +14,7 @@ const contentStyles = xcss({
|
|
|
14
14
|
fontWeight: '400',
|
|
15
15
|
lineHeight: '14px'
|
|
16
16
|
});
|
|
17
|
-
const
|
|
17
|
+
const FormattedErrorMessage = ({
|
|
18
18
|
message,
|
|
19
19
|
url
|
|
20
20
|
}) => /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
|
|
@@ -31,6 +31,10 @@ const getErrorMesssageProps = error => {
|
|
|
31
31
|
message: messages.ai_summary_error_acceptable_use_violation,
|
|
32
32
|
url: CONTENT_URL_ACCEPTABLE_USE_POLICY
|
|
33
33
|
};
|
|
34
|
+
case 'HIPAA_CONTENT_DETECTED':
|
|
35
|
+
return {
|
|
36
|
+
message: messages.ai_summary_error_hipaa_content_detected
|
|
37
|
+
};
|
|
34
38
|
default:
|
|
35
39
|
return {
|
|
36
40
|
message: messages.ai_summary_error_generic,
|
|
@@ -61,7 +65,7 @@ const AIStateError = ({
|
|
|
61
65
|
content: /*#__PURE__*/React.createElement(Box, {
|
|
62
66
|
testId: `${testId}-error-message`,
|
|
63
67
|
xcss: contentStyles
|
|
64
|
-
}, /*#__PURE__*/React.createElement(
|
|
68
|
+
}, /*#__PURE__*/React.createElement(FormattedErrorMessage, {
|
|
65
69
|
message: message,
|
|
66
70
|
url: url
|
|
67
71
|
})),
|
package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
const LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
|
|
7
|
+
const LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-ai-summarise';
|
|
8
|
+
const LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
|
|
9
|
+
const LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
|
|
10
|
+
const 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
|
+
const FeatureDiscovery = ({
|
|
17
|
+
children,
|
|
18
|
+
testId
|
|
19
|
+
}) => {
|
|
20
|
+
const renderedTime = useRef();
|
|
21
|
+
const storageClient = useMemo(() => new StorageClient(LOCAL_STORAGE_CLIENT_KEY), []);
|
|
22
|
+
const discovered = useMemo(() => storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE, [storageClient]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
renderedTime.current = Date.now();
|
|
25
|
+
return () => {
|
|
26
|
+
if (!discovered && renderedTime.current) {
|
|
27
|
+
const duration = Date.now() - renderedTime.current;
|
|
28
|
+
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
29
|
+
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}, [storageClient, discovered]);
|
|
34
|
+
const component = useMemo(() => {
|
|
35
|
+
if (!discovered) {
|
|
36
|
+
return jsx("span", {
|
|
37
|
+
css: getPulseStyles(),
|
|
38
|
+
"data-testid": `${testId}-discovery`
|
|
39
|
+
}, children);
|
|
40
|
+
}
|
|
41
|
+
}, [children, discovered, testId]);
|
|
42
|
+
return component !== null && component !== void 0 ? component : children;
|
|
43
|
+
};
|
|
44
|
+
export default FeatureDiscovery;
|
package/dist/es2019/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 const getPulseStyles = () => {
|
|
3
|
+
const color = "var(--ds-border-discovery, #8270DB)";
|
|
4
|
+
const 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 ${color}`,
|
|
13
|
+
animation: `${pulseKeyframes} 2s cubic-bezier(0.5, 0, 0, 1) 0.25s both 2`
|
|
14
|
+
});
|
|
15
|
+
};
|
|
@@ -6,32 +6,37 @@ import { ActionName, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '.
|
|
|
6
6
|
import ActionGroup from '../../action-group';
|
|
7
7
|
import Block from '../../block';
|
|
8
8
|
import ElementGroup from '../../element-group';
|
|
9
|
+
import AIMotionWrapper from '../ai-motion-wrapper';
|
|
9
10
|
import AIStateIndicator from '../ai-state-indicator';
|
|
10
11
|
import { renderElementItems } from '../../utils';
|
|
11
12
|
import { messages } from '../../../../../../messages';
|
|
12
13
|
import { useAISummary } from '../../../../../../state/hooks/use-ai-summary';
|
|
13
14
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
15
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
14
16
|
import AIIcon from '../../../../../common/ai-icon';
|
|
15
17
|
import AISummary from '../../../../../common/ai-summary';
|
|
16
18
|
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
17
19
|
import AIEventSummaryViewed from '../ai-event-summary-viewed';
|
|
18
20
|
import AIEventErrorViewed from '../ai-event-error-viewed';
|
|
19
21
|
import { di } from 'react-magnetic-di';
|
|
22
|
+
import { css } from '@emotion/react';
|
|
23
|
+
import FeatureDiscovery from '../feature-discovery';
|
|
20
24
|
export const AISummaryBlockErrorIndicator = ({
|
|
21
25
|
showErrorIndicator,
|
|
22
26
|
error,
|
|
27
|
+
showTransition,
|
|
23
28
|
testId
|
|
24
|
-
}) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
29
|
+
}) => /*#__PURE__*/React.createElement(AIMotionWrapper, {
|
|
30
|
+
isFadeIn: true,
|
|
31
|
+
show: showErrorIndicator,
|
|
32
|
+
showTransition: showTransition
|
|
33
|
+
}, /*#__PURE__*/React.createElement(AIEventErrorViewed, {
|
|
34
|
+
reason: error
|
|
35
|
+
}), /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
36
|
+
error: error,
|
|
37
|
+
state: "error",
|
|
38
|
+
testId: testId
|
|
39
|
+
}));
|
|
35
40
|
export const AISummaryBlockStatusIndicator = ({
|
|
36
41
|
showStatusIndicator,
|
|
37
42
|
metadata,
|
|
@@ -53,7 +58,7 @@ const AISummaryBlockResolvedView = props => {
|
|
|
53
58
|
onActionMenuOpenChange,
|
|
54
59
|
size = SmartLinkSize.Medium,
|
|
55
60
|
testId,
|
|
56
|
-
aiSummaryMinHeight,
|
|
61
|
+
aiSummaryMinHeight = 0,
|
|
57
62
|
metadata
|
|
58
63
|
} = props;
|
|
59
64
|
const {
|
|
@@ -62,6 +67,9 @@ const AISummaryBlockResolvedView = props => {
|
|
|
62
67
|
const context = useFlexibleUiContext();
|
|
63
68
|
const url = (context === null || context === void 0 ? void 0 : context.url) || '';
|
|
64
69
|
const ari = (context === null || context === void 0 ? void 0 : context.ari) || '';
|
|
70
|
+
const {
|
|
71
|
+
product
|
|
72
|
+
} = useSmartLinkContext();
|
|
65
73
|
const {
|
|
66
74
|
summariseUrl,
|
|
67
75
|
state: {
|
|
@@ -71,7 +79,8 @@ const AISummaryBlockResolvedView = props => {
|
|
|
71
79
|
}
|
|
72
80
|
} = useAISummary({
|
|
73
81
|
url,
|
|
74
|
-
ari
|
|
82
|
+
ari,
|
|
83
|
+
product
|
|
75
84
|
});
|
|
76
85
|
const showAISummary = status === 'done' ||
|
|
77
86
|
// We want to display the AI Summary component only when there is content available during the loading process.
|
|
@@ -102,7 +111,12 @@ const AISummaryBlockResolvedView = props => {
|
|
|
102
111
|
testId: `${testId}-ai-summary-action`,
|
|
103
112
|
icon: /*#__PURE__*/React.createElement(AIIcon, {
|
|
104
113
|
label: "AIIcon"
|
|
105
|
-
})
|
|
114
|
+
}),
|
|
115
|
+
/**
|
|
116
|
+
* Enabling feature discovery pulse
|
|
117
|
+
* Cleanup: https://product-fabric.atlassian.net/browse/EDM-9693
|
|
118
|
+
*/
|
|
119
|
+
wrapper: FeatureDiscovery
|
|
106
120
|
};
|
|
107
121
|
return [aiAction, ...actions];
|
|
108
122
|
}
|
|
@@ -118,14 +132,25 @@ const AISummaryBlockResolvedView = props => {
|
|
|
118
132
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
119
133
|
direction: SmartLinkDirection.Vertical,
|
|
120
134
|
testId: `${testId}-resolved-view`
|
|
135
|
+
/**
|
|
136
|
+
* Enabled for feature discovery to allow box shadow to overflow
|
|
137
|
+
* Cleanup: https://product-fabric.atlassian.net/browse/EDM-8681
|
|
138
|
+
*/,
|
|
139
|
+
overrideCss: css({
|
|
140
|
+
overflow: 'visible'
|
|
141
|
+
}, props.overrideCss)
|
|
121
142
|
}), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
|
|
122
143
|
fromCache: isSummarisedOnMountRef.current
|
|
123
|
-
}),
|
|
144
|
+
}), /*#__PURE__*/React.createElement(AIMotionWrapper, {
|
|
145
|
+
minHeight: aiSummaryMinHeight,
|
|
146
|
+
show: showAISummary,
|
|
147
|
+
showTransition: !isSummarisedOnMountRef.current
|
|
148
|
+
}, /*#__PURE__*/React.createElement(AISummary, {
|
|
124
149
|
testId: `${testId}-ai-summary`,
|
|
125
150
|
minHeight: aiSummaryMinHeight,
|
|
126
151
|
content: content,
|
|
127
152
|
showIcon: isSummarisedOnMountRef.current
|
|
128
|
-
}), /*#__PURE__*/React.createElement(Inline, {
|
|
153
|
+
})), /*#__PURE__*/React.createElement(Inline, {
|
|
129
154
|
alignBlock: "center",
|
|
130
155
|
alignInline: "end",
|
|
131
156
|
grow: "fill",
|
|
@@ -142,6 +167,7 @@ const AISummaryBlockResolvedView = props => {
|
|
|
142
167
|
size: size
|
|
143
168
|
}))), /*#__PURE__*/React.createElement(AISummaryBlockErrorIndicator, {
|
|
144
169
|
showErrorIndicator: !isErroredOnMountRef.current && status === 'error',
|
|
170
|
+
showTransition: !isErroredOnMountRef.current,
|
|
145
171
|
error: error,
|
|
146
172
|
testId: testId
|
|
147
173
|
}));
|
|
@@ -3,7 +3,9 @@ import { useEffect } from 'react';
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { ElementName, SmartLinkDirection, SmartLinkSize } from '../../../../../constants';
|
|
5
5
|
import { getBaseStyles, getGapSize, highlightRemoveStyles, renderChildren } from '../utils';
|
|
6
|
-
const getBlockStyles = (direction, size
|
|
6
|
+
const getBlockStyles = (direction, size
|
|
7
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
8
|
+
) => css`
|
|
7
9
|
${getBaseStyles(direction, size)}
|
|
8
10
|
${highlightRemoveStyles}
|
|
9
11
|
justify-content: flex-start;
|
|
@@ -6,46 +6,46 @@ import { getMaxLineHeight, getTruncateStyles } from '../../utils';
|
|
|
6
6
|
const getAlignmentStyles = align => {
|
|
7
7
|
switch (align) {
|
|
8
8
|
case SmartLinkAlignment.Right:
|
|
9
|
-
return css
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
return css({
|
|
10
|
+
WebkitBoxAlign: 'end',
|
|
11
|
+
MsFlexAlign: 'end',
|
|
12
|
+
justifyContent: 'flex-end',
|
|
13
|
+
textAlign: 'right'
|
|
14
|
+
});
|
|
15
15
|
case SmartLinkAlignment.Left:
|
|
16
16
|
default:
|
|
17
|
-
return css
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
return css({
|
|
18
|
+
WebkitBoxAlign: 'start',
|
|
19
|
+
MsFlexAlign: 'start',
|
|
20
|
+
justifyContent: 'flex-start',
|
|
21
|
+
textAlign: 'left'
|
|
22
|
+
});
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
const getGapStyles = (size, align) => {
|
|
26
26
|
const gap = getGapSize(size);
|
|
27
27
|
if (align === SmartLinkAlignment.Right) {
|
|
28
|
-
return css
|
|
29
|
-
> span {
|
|
30
|
-
|
|
28
|
+
return css({
|
|
29
|
+
'> span': {
|
|
30
|
+
marginLeft: `${gap}rem`
|
|
31
|
+
},
|
|
32
|
+
'> span:first-child': {
|
|
33
|
+
marginLeft: 'initial'
|
|
31
34
|
}
|
|
32
|
-
|
|
33
|
-
> span:first-child {
|
|
34
|
-
margin-left: initial;
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
35
|
+
});
|
|
37
36
|
}
|
|
38
|
-
return css
|
|
39
|
-
> span {
|
|
40
|
-
|
|
41
|
-
&:last-child {
|
|
42
|
-
|
|
37
|
+
return css({
|
|
38
|
+
'> span': {
|
|
39
|
+
marginRight: `${gap}rem`,
|
|
40
|
+
'&:last-child': {
|
|
41
|
+
marginRight: 'initial'
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
|
|
44
|
+
});
|
|
46
45
|
};
|
|
47
46
|
const getHorizontalDirectionStyles = (size, align) => {
|
|
48
47
|
const lineHeight = getMaxLineHeight(size);
|
|
48
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
49
49
|
return css`
|
|
50
50
|
display: block;
|
|
51
51
|
vertical-align: middle;
|
|
@@ -64,14 +64,9 @@ const getHorizontalDirectionStyles = (size, align) => {
|
|
|
64
64
|
${getGapStyles(size, align)}
|
|
65
65
|
`;
|
|
66
66
|
};
|
|
67
|
-
export const getElementGroupStyles = (direction, size, align, width, position) => css
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
min-width: 10%;
|
|
71
|
-
${width === SmartLinkWidth.Flexible ? `flex: 1 3;` : ''}
|
|
72
|
-
${direction === SmartLinkDirection.Horizontal ? getHorizontalDirectionStyles(size, align) : ''}
|
|
73
|
-
${position === SmartLinkPosition.Top ? 'align-self: flex-start;' : ''}
|
|
74
|
-
`;
|
|
67
|
+
export const getElementGroupStyles = (direction, size, align, width, position) => css(getBaseStyles(direction, size), getAlignmentStyles(align), {
|
|
68
|
+
minWidth: '10%'
|
|
69
|
+
}, width === SmartLinkWidth.Flexible ? `flex: 1 3;` : '', direction === SmartLinkDirection.Horizontal ? getHorizontalDirectionStyles(size, align) : '', position === SmartLinkPosition.Top ? 'align-self: flex-start;' : '');
|
|
75
70
|
|
|
76
71
|
/**
|
|
77
72
|
* Creates a group of Action components. Accepts an array of Actions, in addition to some styling
|
|
@@ -15,10 +15,9 @@ const getElementGroupStyles = (size, maxLines) => {
|
|
|
15
15
|
// We need the height of the line to be equal on both left and right
|
|
16
16
|
// sides so they line up nicely.
|
|
17
17
|
const lineHeight = getMaxLineHeight(size);
|
|
18
|
-
return css
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`;
|
|
18
|
+
return css({
|
|
19
|
+
lineHeight: `${lineHeight}rem`
|
|
20
|
+
}, getTruncateStyles(maxLines, lineHeight + 'rem'));
|
|
22
21
|
};
|
|
23
22
|
const getMaxLines = maxLines => {
|
|
24
23
|
if (maxLines > MAXIMUM_MAX_LINES) {
|
|
@@ -24,6 +24,7 @@ import { Preview } from '../../../elements';
|
|
|
24
24
|
const getPreviewBlockStyles = (placement, ignoreContainerPadding) => {
|
|
25
25
|
if (placement === MediaPlacement.Left || placement === MediaPlacement.Right) {
|
|
26
26
|
const containerPadding = ignoreContainerPadding ? '0rem' : 'var(--container-padding)';
|
|
27
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
27
28
|
return css`
|
|
28
29
|
position: absolute;
|
|
29
30
|
top: ${containerPadding};
|
|
@@ -43,16 +44,16 @@ const getPreviewBlockStyles = (placement, ignoreContainerPadding) => {
|
|
|
43
44
|
`;
|
|
44
45
|
}
|
|
45
46
|
if (ignoreContainerPadding) {
|
|
46
|
-
return css
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
&:first-of-type {
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
&:last-of-type {
|
|
53
|
-
|
|
47
|
+
return css({
|
|
48
|
+
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
49
|
+
marginRight: 'calc(var(--container-gap-right) * -1)',
|
|
50
|
+
'&:first-of-type': {
|
|
51
|
+
marginTop: 'calc(var(--container-padding) * -1)'
|
|
52
|
+
},
|
|
53
|
+
'&:last-of-type': {
|
|
54
|
+
marginBottom: 'calc(var(--container-padding) * -1)'
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
+
});
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
59
|
|
|
@@ -73,10 +74,7 @@ const PreviewBlockResolvedView = ({
|
|
|
73
74
|
}) => {
|
|
74
75
|
const [styles, setStyles] = useState(overrideCss);
|
|
75
76
|
const updateStyles = useCallback(() => {
|
|
76
|
-
setStyles(css
|
|
77
|
-
${getPreviewBlockStyles(placement, ignoreContainerPadding)}
|
|
78
|
-
${overrideCss}
|
|
79
|
-
`);
|
|
77
|
+
setStyles(css(getPreviewBlockStyles(placement, ignoreContainerPadding), overrideCss));
|
|
80
78
|
}, [ignoreContainerPadding, overrideCss, placement]);
|
|
81
79
|
useEffect(() => {
|
|
82
80
|
updateStyles();
|
|
@@ -52,9 +52,9 @@ const RelatedUrlsBlock = ({
|
|
|
52
52
|
if (relatedUrls) {
|
|
53
53
|
return /*#__PURE__*/React.createElement(RelatedUrlsResolvedView, _extends({
|
|
54
54
|
renderers: renderers,
|
|
55
|
-
overrideCss: css
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
overrideCss: css({
|
|
56
|
+
minHeight: '1.55rem'
|
|
57
|
+
}),
|
|
58
58
|
testId: `${testId}-resolved-view`,
|
|
59
59
|
relatedUrlsResponse: relatedUrls
|
|
60
60
|
}, blockProps));
|
|
@@ -35,9 +35,9 @@ const RelatedUrlList = ({
|
|
|
35
35
|
alignBlock: "center",
|
|
36
36
|
spread: "space-between"
|
|
37
37
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
38
|
-
overrideCss: css
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
overrideCss: css({
|
|
39
|
+
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
40
|
+
}),
|
|
41
41
|
message: {
|
|
42
42
|
descriptor: title
|
|
43
43
|
}
|
|
@@ -8,26 +8,24 @@ import Block from '../../block';
|
|
|
8
8
|
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkSize } from '../../../../../../constants';
|
|
9
9
|
import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles } from '../../../utils';
|
|
10
10
|
import ElementGroup from '../../element-group';
|
|
11
|
-
const actionStyles = css
|
|
12
|
-
cursor: pointer
|
|
13
|
-
:hover {
|
|
14
|
-
color:
|
|
15
|
-
|
|
11
|
+
const actionStyles = css({
|
|
12
|
+
cursor: 'pointer',
|
|
13
|
+
':hover': {
|
|
14
|
+
color: "var(--ds-text-subtle, #8993A4)",
|
|
15
|
+
textDecoration: 'underline'
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
});
|
|
18
18
|
const getMessageStyles = (size, hasAction) => {
|
|
19
19
|
const sizeStyles = getLinkSizeStyles(size);
|
|
20
|
-
return css
|
|
21
|
-
flex: 1 1 auto
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
:focus {
|
|
28
|
-
outline: ${"var(--ds-border-focused, #388BFF)"} solid 2px;
|
|
20
|
+
return css({
|
|
21
|
+
flex: '1 1 auto',
|
|
22
|
+
justifyContent: 'flex-end'
|
|
23
|
+
}, hasAction ? actionStyles : '', sizeStyles, getTruncateStyles(1, getLinkLineHeight(size)), {
|
|
24
|
+
color: "var(--ds-text-disabled, #6B778C)",
|
|
25
|
+
':focus': {
|
|
26
|
+
outline: `${"var(--ds-border-focused, #388BFF)"} solid 2px`
|
|
29
27
|
}
|
|
30
|
-
|
|
28
|
+
});
|
|
31
29
|
};
|
|
32
30
|
|
|
33
31
|
/**
|
|
@@ -33,9 +33,9 @@ const TitleBlockResolvedView = ({
|
|
|
33
33
|
}), /*#__PURE__*/React.createElement(ElementGroup, {
|
|
34
34
|
direction: SmartLinkDirection.Vertical,
|
|
35
35
|
width: SmartLinkWidth.Flexible,
|
|
36
|
-
overrideCss: css
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
overrideCss: css({
|
|
37
|
+
gap: "var(--ds-space-050, 0.25rem)"
|
|
38
|
+
})
|
|
39
39
|
}, title, subtitleElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
40
40
|
direction: SmartLinkDirection.Horizontal
|
|
41
41
|
}, subtitleElements)), metadataElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
@@ -97,6 +97,8 @@ export const getBaseStyles = (direction, size) => css({
|
|
|
97
97
|
minWidth: 'fit-content'
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
|
+
|
|
101
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
100
102
|
export const highlightRemoveStyles = css`
|
|
101
103
|
outline: none !important;
|
|
102
104
|
outline-color: inherit;
|
|
@@ -6,33 +6,32 @@ const LoadingSkeleton = ({
|
|
|
6
6
|
width,
|
|
7
7
|
height
|
|
8
8
|
}) => {
|
|
9
|
-
const animationNameStyles = keyframes
|
|
10
|
-
0% {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
9
|
+
const animationNameStyles = keyframes({
|
|
10
|
+
'0%': {
|
|
11
|
+
backgroundPosition: '50% 0'
|
|
12
|
+
},
|
|
13
|
+
'100%': {
|
|
14
|
+
backgroundPosition: '-50% 0'
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const styles = css({
|
|
18
|
+
width: `${width}rem`,
|
|
19
|
+
height: `${height}rem`,
|
|
20
|
+
borderRadius: '2px',
|
|
21
|
+
userSelect: 'none',
|
|
22
|
+
background: "var(--ds-skeleton-subtle, #f6f7f8)",
|
|
23
|
+
backgroundImage: `linear-gradient( to right, transparent 0%, ${"var(--ds-skeleton, #edeef1)"} 20%, transparent 40%, transparent 100% )`,
|
|
24
|
+
backgroundRepeat: 'no-repeat',
|
|
25
|
+
backgroundSize: '280% 100%',
|
|
26
|
+
display: 'inline-block',
|
|
27
|
+
animationDuration: '1s',
|
|
28
|
+
animationFillMode: 'forwards',
|
|
29
|
+
animationIterationCount: 'infinite',
|
|
30
|
+
animationName: animationNameStyles,
|
|
31
|
+
animationTimingFunction: 'linear'
|
|
32
|
+
});
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
animation-fill-mode: forwards;
|
|
32
|
-
animation-iteration-count: infinite;
|
|
33
|
-
animation-name: ${animationNameStyles};
|
|
34
|
-
animation-timing-function: linear;
|
|
35
|
-
`;
|
|
34
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- needs dynamic css
|
|
36
35
|
return jsx("span", {
|
|
37
36
|
css: styles,
|
|
38
37
|
"data-testid": testId
|
|
@@ -90,6 +90,8 @@ const getChildrenOptions = (children, context) => {
|
|
|
90
90
|
};
|
|
91
91
|
export const getContainerStyles = (size, hideBackground, hideElevation, hidePadding, clickableContainer, childrenOptions) => {
|
|
92
92
|
const paddingCss = getContainerPaddingStyles(size, hidePadding, childrenOptions);
|
|
93
|
+
|
|
94
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
93
95
|
return css`
|
|
94
96
|
display: flex;
|
|
95
97
|
gap: ${getGap(size)} 0;
|