@atlaskit/smart-card 26.55.2 → 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 +13 -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 +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/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/views/forbidden/styled.js +16 -6
- 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 +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/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/views/forbidden/styled.js +16 -16
- 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 +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/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/views/forbidden/styled.js +16 -5
- 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/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-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/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/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.56.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#89847](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89847) [`6dcb5cb39c7c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6dcb5cb39c7c) - "Adding accessibility option for flexible link card custom action"
|
|
8
|
+
- [#90020](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90020) [`4772c11ddb2a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4772c11ddb2a) - Add HIPAA content detected error message to AI Summary within hovercard
|
|
9
|
+
- [#90445](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90445) [`88f0e72ecc1e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/88f0e72ecc1e) - [ux] Create CopyLinkAction for ActionBlock
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#90431](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90431) [`8e9354e9cdfe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8e9354e9cdfe) - [ux] Add purple pulse to AI summarise on hover card
|
|
14
|
+
- [#91203](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91203) [`3c8348468618`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3c8348468618) - Minor Typescript changes to improve compatibility with React 18
|
|
15
|
+
|
|
3
16
|
## 26.55.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -143,6 +143,7 @@ var ElementName = exports.ElementName = /*#__PURE__*/function (ElementName) {
|
|
|
143
143
|
* Flexible UI action (button)
|
|
144
144
|
*/
|
|
145
145
|
var ActionName = exports.ActionName = /*#__PURE__*/function (ActionName) {
|
|
146
|
+
ActionName["CopyLinkAction"] = "CopyLinkAction";
|
|
146
147
|
ActionName["DeleteAction"] = "DeleteAction";
|
|
147
148
|
ActionName["EditAction"] = "EditAction";
|
|
148
149
|
ActionName["FollowAction"] = "FollowAction";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.extractCopyLinkAction = void 0;
|
|
7
|
+
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
8
|
+
var _types = require("../../../view/Card/types");
|
|
9
|
+
var _canShowAction = require("../../../utils/actions/can-show-action");
|
|
10
|
+
var extractCopyLinkAction = exports.extractCopyLinkAction = function extractCopyLinkAction(data, actionOptions) {
|
|
11
|
+
if (!(0, _canShowAction.canShowAction)(_types.CardAction.CopyLinkAction, actionOptions)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
var url = (0, _linkExtractors.extractLink)(data);
|
|
15
|
+
if (!url) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
url: url
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -10,9 +10,10 @@ var _constants = require("../../../constants");
|
|
|
10
10
|
var _extractDownloadAction = require("./extract-download-action");
|
|
11
11
|
var _extractPreviewAction = require("./extract-preview-action");
|
|
12
12
|
var _extractFollowAction = _interopRequireDefault(require("./extract-follow-action"));
|
|
13
|
+
var _extractCopyLinkAction = require("./extract-copy-link-action");
|
|
13
14
|
var extractActions = function extractActions(response, data, actionOptions, id) {
|
|
14
15
|
var _action;
|
|
15
|
-
var action = (_action = {}, (0, _defineProperty2.default)(_action, _constants.ActionName.DownloadAction, (0, _extractDownloadAction.extractDownloadAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.FollowAction, (0, _extractFollowAction.default)(response, actionOptions, id)), (0, _defineProperty2.default)(_action, _constants.ActionName.PreviewAction, (0, _extractPreviewAction.extractPreviewAction)(response, actionOptions)), _action);
|
|
16
|
+
var action = (_action = {}, (0, _defineProperty2.default)(_action, _constants.ActionName.CopyLinkAction, (0, _extractCopyLinkAction.extractCopyLinkAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.DownloadAction, (0, _extractDownloadAction.extractDownloadAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.FollowAction, (0, _extractFollowAction.default)(response, actionOptions, id)), (0, _defineProperty2.default)(_action, _constants.ActionName.PreviewAction, (0, _extractPreviewAction.extractPreviewAction)(response, actionOptions)), _action);
|
|
16
17
|
return Object.values(action).some(function (value) {
|
|
17
18
|
return Boolean(value);
|
|
18
19
|
}) ? action : undefined;
|
package/dist/cjs/messages.js
CHANGED
|
@@ -51,6 +51,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
51
51
|
defaultMessage: "We cannot show the results of this summary as it goes against <a>Atlassian's Acceptable Use Policy</a>.",
|
|
52
52
|
description: 'Shown when AI summary is summarising the link resource content and the content violates atlassians acceptable use policy.'
|
|
53
53
|
},
|
|
54
|
+
ai_summary_error_hipaa_content_detected: {
|
|
55
|
+
id: 'fabric.linking.ai_summary_error_hipaa_content_detected',
|
|
56
|
+
defaultMessage: 'Atlassian Intelligence was unable to process your request as your content contains links to HIPAA restricted content.',
|
|
57
|
+
description: 'Shown when the AI summary is summarising the link resource content and the content contains HIPAA restricted content.'
|
|
58
|
+
},
|
|
54
59
|
assigned_to: {
|
|
55
60
|
id: 'fabric.linking.assigned_to',
|
|
56
61
|
defaultMessage: 'Assigned to {context}',
|
|
@@ -151,6 +156,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
151
156
|
defaultMessage: 'Copy link',
|
|
152
157
|
description: ''
|
|
153
158
|
},
|
|
159
|
+
copied_url_to_clipboard: {
|
|
160
|
+
id: 'fabric.linking.copied_url_to_clipboard.nonfinal',
|
|
161
|
+
defaultMessage: 'Copied!',
|
|
162
|
+
description: 'Url has been copied to the clipboard'
|
|
163
|
+
},
|
|
154
164
|
could_not_load_link: {
|
|
155
165
|
id: 'fabric.linking.couldnt_load_link',
|
|
156
166
|
defaultMessage: "We couldn't load this link for an unknown reason.",
|
|
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.errorMessages = void 0;
|
|
7
|
-
var errorMessages = exports.errorMessages = ['NETWORK_ERROR', 'NO_ANSWER', 'RATE_LIMIT', 'NO_AGENT', 'PLUGIN_ERRORED', 'OPENAI_RATE_LIMIT_USER_ABUSE', 'ACCEPTABLE_USE_VIOLATIONS', 'AI_DISABLED', 'UNEXPECTED'];
|
|
7
|
+
var errorMessages = exports.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'];
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.
|
|
25
|
+
packageVersion: "26.56.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -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 = require("@emotion/react");
|
|
12
11
|
var _react2 = require("react");
|
|
13
12
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -19,9 +18,12 @@ var _messages = require("../../../../messages");
|
|
|
19
18
|
var _unresolvedView = _interopRequireDefault(require("./unresolved-view"));
|
|
20
19
|
var _withFlexibleUIBlockCardStyle = require("./utils/withFlexibleUIBlockCardStyle");
|
|
21
20
|
var _excluded = ["testId"];
|
|
22
|
-
var _templateObject;
|
|
23
21
|
/** @jsx jsx */
|
|
24
|
-
var contentStyles = (0, _react.css)(
|
|
22
|
+
var contentStyles = (0, _react.css)({
|
|
23
|
+
color: "var(--ds-text-subtlest, #626F86)",
|
|
24
|
+
marginTop: "var(--ds-space-100, 0.5rem)",
|
|
25
|
+
fontSize: '0.75rem'
|
|
26
|
+
});
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* This view represents a Block card that has an 'Unauthorized' status .
|
|
@@ -5,8 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.LozengeBlockWrapper = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
|
-
var _templateObject;
|
|
11
9
|
// TODO: Replace overrides with proper AtlasKit solution.
|
|
12
|
-
var LozengeBlockWrapper = exports.LozengeBlockWrapper = _styled.default.span(
|
|
10
|
+
var LozengeBlockWrapper = exports.LozengeBlockWrapper = _styled.default.span({
|
|
11
|
+
'& > span': {
|
|
12
|
+
marginLeft: "var(--ds-space-050, 4px)"
|
|
13
|
+
}
|
|
14
|
+
});
|
|
@@ -10,5 +10,6 @@ var CardAction = exports.CardAction = /*#__PURE__*/function (CardAction) {
|
|
|
10
10
|
CardAction["ViewAction"] = "ViewAction";
|
|
11
11
|
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
12
12
|
CardAction["FollowAction"] = "FollowAction";
|
|
13
|
+
CardAction["CopyLinkAction"] = "CopyLinkAction";
|
|
13
14
|
return CardAction;
|
|
14
15
|
}({});
|
|
@@ -1,16 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.titleStyles = exports.imageStyles = exports.descriptionStyles = exports.contentStyles = exports.containerStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
7
|
var _react = require("@emotion/react");
|
|
10
8
|
var _utils = require("../../../common/utils");
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
9
|
+
var containerStyles = exports.containerStyles = (0, _react.css)({
|
|
10
|
+
display: 'grid',
|
|
11
|
+
height: 'inherit'
|
|
12
|
+
});
|
|
13
|
+
var contentStyles = exports.contentStyles = (0, _react.css)({
|
|
14
|
+
display: 'flex',
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
margin: 'auto',
|
|
19
|
+
padding: "var(--ds-space-200, 16px)",
|
|
20
|
+
gap: "var(--ds-space-250, 20px)",
|
|
21
|
+
maxWidth: (0, _utils.gs)(50)
|
|
22
|
+
});
|
|
23
|
+
var imageStyles = exports.imageStyles = (0, _react.css)({
|
|
24
|
+
height: '120px',
|
|
25
|
+
width: '180px',
|
|
26
|
+
objectFit: 'contain',
|
|
27
|
+
objectPosition: 'center center'
|
|
28
|
+
});
|
|
29
|
+
var titleStyles = exports.titleStyles = (0, _react.css)({
|
|
30
|
+
textAlign: 'center',
|
|
31
|
+
margin: 0,
|
|
32
|
+
padding: 0
|
|
33
|
+
});
|
|
34
|
+
var descriptionStyles = exports.descriptionStyles = (0, _react.css)({
|
|
35
|
+
fontSize: '1em',
|
|
36
|
+
textAlign: 'center'
|
|
37
|
+
});
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
7
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
10
8
|
var _react = require("@emotion/react");
|
|
11
9
|
var _utils = require("../../../../utils");
|
|
12
10
|
var _IFrame = require("../../../EmbedCard/components/IFrame");
|
|
13
|
-
var _templateObject;
|
|
14
11
|
/** @jsx jsx */
|
|
15
|
-
|
|
12
|
+
|
|
13
|
+
var iframeCss = (0, _react.css)({
|
|
14
|
+
width: '100%',
|
|
15
|
+
height: 'calc(100vh - 208px)'
|
|
16
|
+
});
|
|
16
17
|
var EmbedContent = function EmbedContent(_ref) {
|
|
17
18
|
var isTrusted = _ref.isTrusted,
|
|
18
19
|
name = _ref.name,
|
|
@@ -6,23 +6,36 @@ 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 _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _react2 = require("@emotion/react");
|
|
12
11
|
var _button = require("@atlaskit/button");
|
|
13
12
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
14
13
|
var _constants = require("../../../../../../constants");
|
|
15
14
|
var _utils = require("../../../utils");
|
|
16
|
-
var _templateObject, _templateObject2;
|
|
17
|
-
/** @jsx jsx */
|
|
18
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
16
|
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; }
|
|
17
|
+
/** @jsx jsx */
|
|
18
|
+
|
|
20
19
|
var getButtonStyle = function getButtonStyle(size, iconOnly) {
|
|
21
20
|
switch (size) {
|
|
22
21
|
case _constants.SmartLinkSize.Large:
|
|
23
|
-
return iconOnly ? (0, _react2.css)(
|
|
22
|
+
return iconOnly ? (0, _react2.css)({
|
|
23
|
+
'button, button:hover, button:focus, button:active': {
|
|
24
|
+
padding: 0,
|
|
25
|
+
'> span': {
|
|
26
|
+
margin: 0
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}) : '';
|
|
24
30
|
case _constants.SmartLinkSize.Small:
|
|
25
|
-
return (0, _react2.css)(
|
|
31
|
+
return (0, _react2.css)({
|
|
32
|
+
fontSize: '0.75rem',
|
|
33
|
+
fontWeight: 500,
|
|
34
|
+
lineHeight: '1rem',
|
|
35
|
+
'button, button:hover, button:focus, button:active': [{
|
|
36
|
+
lineHeight: '1rem'
|
|
37
|
+
}, iconOnly ? "\n padding: 0.125rem;\n " : "\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n "]
|
|
38
|
+
});
|
|
26
39
|
case _constants.SmartLinkSize.XLarge:
|
|
27
40
|
case _constants.SmartLinkSize.Medium:
|
|
28
41
|
default:
|
|
@@ -40,7 +53,9 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
40
53
|
size = _ref.size,
|
|
41
54
|
testId = _ref.testId,
|
|
42
55
|
tooltipMessage = _ref.tooltipMessage,
|
|
43
|
-
isDisabled = _ref.isDisabled
|
|
56
|
+
isDisabled = _ref.isDisabled,
|
|
57
|
+
href = _ref.href,
|
|
58
|
+
ariaLabel = _ref.ariaLabel;
|
|
44
59
|
var iconOnly = !content;
|
|
45
60
|
var onButtonClick = (0, _react.useCallback)(function (handler) {
|
|
46
61
|
return function (e) {
|
|
@@ -63,7 +78,9 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
63
78
|
isLoading: isLoading,
|
|
64
79
|
onClick: onButtonClick(onClick),
|
|
65
80
|
spacing: _utils.sizeToButtonSpacing[size],
|
|
66
|
-
testId: testId
|
|
81
|
+
testId: testId,
|
|
82
|
+
href: href,
|
|
83
|
+
"aria-label": ariaLabel
|
|
67
84
|
}, content)));
|
|
68
85
|
};
|
|
69
86
|
var _default = exports.default = ActionButton;
|
|
@@ -56,7 +56,8 @@ var ActionStackItem = function ActionStackItem(_ref) {
|
|
|
56
56
|
spaceOption = _ref.space,
|
|
57
57
|
testId = _ref.testId,
|
|
58
58
|
tooltipMessage = _ref.tooltipMessage,
|
|
59
|
-
xcss = _ref.xcss
|
|
59
|
+
xcss = _ref.xcss,
|
|
60
|
+
tooltipOnHide = _ref.tooltipOnHide;
|
|
60
61
|
var space = spaceOption !== null && spaceOption !== void 0 ? spaceOption : (0, _utils.getPrimitivesInlineSpaceBySize)(size);
|
|
61
62
|
var onClick = (0, _react.useCallback)(function () {
|
|
62
63
|
if (!isDisabled && !isLoading && onClickCallback) {
|
|
@@ -74,6 +75,7 @@ var ActionStackItem = function ActionStackItem(_ref) {
|
|
|
74
75
|
// Replace Box with Pressable once it becomes stable (currently beta)
|
|
75
76
|
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
76
77
|
content: tooltipMessage || content,
|
|
78
|
+
onHide: tooltipOnHide,
|
|
77
79
|
hideTooltipOnMouseDown: true
|
|
78
80
|
}, function (tooltipProps) {
|
|
79
81
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, (0, _extends2.default)({
|
|
@@ -35,10 +35,14 @@ var Action = function Action(_ref) {
|
|
|
35
35
|
iconPosition = _ref$iconPosition === void 0 ? 'before' : _ref$iconPosition,
|
|
36
36
|
spaceInline = _ref.spaceInline,
|
|
37
37
|
tooltipMessage = _ref.tooltipMessage,
|
|
38
|
+
tooltipOnHide = _ref.tooltipOnHide,
|
|
38
39
|
xcss = _ref.xcss,
|
|
39
40
|
asDropDownItem = _ref.asDropDownItem,
|
|
40
41
|
overrideCss = _ref.overrideCss,
|
|
41
|
-
isDisabled = _ref.isDisabled
|
|
42
|
+
isDisabled = _ref.isDisabled,
|
|
43
|
+
href = _ref.href,
|
|
44
|
+
ariaLabel = _ref.ariaLabel,
|
|
45
|
+
Wrapper = _ref.wrapper;
|
|
42
46
|
if (!onClick) {
|
|
43
47
|
return null;
|
|
44
48
|
}
|
|
@@ -64,7 +68,8 @@ var Action = function Action(_ref) {
|
|
|
64
68
|
size: size,
|
|
65
69
|
testId: testId,
|
|
66
70
|
tooltipMessage: tooltipMessage || content,
|
|
67
|
-
xcss: xcss
|
|
71
|
+
xcss: xcss,
|
|
72
|
+
tooltipOnHide: tooltipOnHide
|
|
68
73
|
});
|
|
69
74
|
}
|
|
70
75
|
if (isDropdownItem) {
|
|
@@ -77,7 +82,7 @@ var Action = function Action(_ref) {
|
|
|
77
82
|
testId: testId
|
|
78
83
|
});
|
|
79
84
|
}
|
|
80
|
-
|
|
85
|
+
var button = (0, _react.jsx)(_actionButton.default, {
|
|
81
86
|
appearance: appearance,
|
|
82
87
|
content: content,
|
|
83
88
|
iconAfter: iconAfter,
|
|
@@ -88,7 +93,10 @@ var Action = function Action(_ref) {
|
|
|
88
93
|
size: size,
|
|
89
94
|
testId: testId,
|
|
90
95
|
tooltipMessage: tooltipMessage || content,
|
|
91
|
-
isDisabled: isDisabled
|
|
96
|
+
isDisabled: isDisabled,
|
|
97
|
+
href: href,
|
|
98
|
+
ariaLabel: ariaLabel
|
|
92
99
|
});
|
|
100
|
+
return Wrapper !== undefined ? (0, _react.jsx)(Wrapper, null, button) : button;
|
|
93
101
|
};
|
|
94
102
|
var _default = exports.default = Action;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _action = _interopRequireDefault(require("../action"));
|
|
16
|
+
var _messages = require("../../../../../messages");
|
|
17
|
+
var _reactIntlNext = require("react-intl-next");
|
|
18
|
+
var _link = _interopRequireDefault(require("@atlaskit/icon/glyph/link"));
|
|
19
|
+
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
20
|
+
var _constants = require("../../../../../constants");
|
|
21
|
+
var _useInvokeClientAction = _interopRequireDefault(require("../../../../../state/hooks/use-invoke-client-action"));
|
|
22
|
+
var _excluded = ["onClick"];
|
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && 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; }
|
|
25
|
+
var CopyLinkAction = function CopyLinkAction(_ref) {
|
|
26
|
+
var _context$actions;
|
|
27
|
+
var onClickCallback = _ref.onClick,
|
|
28
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
|
+
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
30
|
+
var analytics = (0, _flexibleUiContext.useFlexibleUiAnalyticsContext)();
|
|
31
|
+
var invoke = (0, _useInvokeClientAction.default)({
|
|
32
|
+
analytics: analytics
|
|
33
|
+
});
|
|
34
|
+
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.CopyLinkAction];
|
|
35
|
+
var _useState = (0, _react.useState)(_messages.messages.copy_url_to_clipboard),
|
|
36
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
|
+
tooltipMessage = _useState2[0],
|
|
38
|
+
setTooltipMessage = _useState2[1];
|
|
39
|
+
var onClick = (0, _react.useCallback)(function () {
|
|
40
|
+
if (data && data.url) {
|
|
41
|
+
invoke({
|
|
42
|
+
actionType: _constants.ActionName.CopyLinkAction,
|
|
43
|
+
actionFn: function () {
|
|
44
|
+
var _actionFn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
45
|
+
var _data$url;
|
|
46
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
47
|
+
while (1) switch (_context.prev = _context.next) {
|
|
48
|
+
case 0:
|
|
49
|
+
_context.next = 2;
|
|
50
|
+
return navigator.clipboard.writeText((_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : '');
|
|
51
|
+
case 2:
|
|
52
|
+
setTooltipMessage(_messages.messages.copied_url_to_clipboard);
|
|
53
|
+
case 3:
|
|
54
|
+
case "end":
|
|
55
|
+
return _context.stop();
|
|
56
|
+
}
|
|
57
|
+
}, _callee);
|
|
58
|
+
}));
|
|
59
|
+
function actionFn() {
|
|
60
|
+
return _actionFn.apply(this, arguments);
|
|
61
|
+
}
|
|
62
|
+
return actionFn;
|
|
63
|
+
}(),
|
|
64
|
+
// These values have already been set in analytics context.
|
|
65
|
+
// We only pass these here for ufo experience.
|
|
66
|
+
display: analytics === null || analytics === void 0 ? void 0 : analytics.display,
|
|
67
|
+
extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (onClickCallback) {
|
|
71
|
+
onClickCallback();
|
|
72
|
+
}
|
|
73
|
+
}, [analytics, data, invoke, onClickCallback]);
|
|
74
|
+
return data ? /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
75
|
+
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.copy_url_to_clipboard),
|
|
76
|
+
icon: /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
77
|
+
label: "copy url",
|
|
78
|
+
size: "medium"
|
|
79
|
+
}),
|
|
80
|
+
onClick: onClick,
|
|
81
|
+
testId: "smart-action-copy-link-action",
|
|
82
|
+
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, tooltipMessage),
|
|
83
|
+
tooltipOnHide: function tooltipOnHide() {
|
|
84
|
+
return setTooltipMessage(_messages.messages.copy_url_to_clipboard);
|
|
85
|
+
}
|
|
86
|
+
}, data, props)) : null;
|
|
87
|
+
};
|
|
88
|
+
var _default = exports.default = CopyLinkAction;
|
|
@@ -4,6 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
Object.defineProperty(exports, "CopyLinkAction", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _copyLinkAction.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
7
13
|
Object.defineProperty(exports, "CustomAction", {
|
|
8
14
|
enumerable: true,
|
|
9
15
|
get: function get() {
|
|
@@ -45,4 +51,5 @@ var _deleteAction = _interopRequireDefault(require("./delete-action"));
|
|
|
45
51
|
var _editAction = _interopRequireDefault(require("./edit-action"));
|
|
46
52
|
var _downloadAction = _interopRequireDefault(require("./download-action"));
|
|
47
53
|
var _followAction = _interopRequireDefault(require("./follow-action"));
|
|
48
|
-
var _previewAction = _interopRequireDefault(require("./preview-action"));
|
|
54
|
+
var _previewAction = _interopRequireDefault(require("./preview-action"));
|
|
55
|
+
var _copyLinkAction = _interopRequireDefault(require("./copy-link-action"));
|
|
@@ -21,7 +21,7 @@ var contentStyles = (0, _primitives.xcss)({
|
|
|
21
21
|
fontWeight: '400',
|
|
22
22
|
lineHeight: '14px'
|
|
23
23
|
});
|
|
24
|
-
var
|
|
24
|
+
var FormattedErrorMessage = function FormattedErrorMessage(_ref) {
|
|
25
25
|
var message = _ref.message,
|
|
26
26
|
url = _ref.url;
|
|
27
27
|
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, message, {
|
|
@@ -41,6 +41,10 @@ var getErrorMesssageProps = function getErrorMesssageProps(error) {
|
|
|
41
41
|
message: _messages.messages.ai_summary_error_acceptable_use_violation,
|
|
42
42
|
url: _constants.CONTENT_URL_ACCEPTABLE_USE_POLICY
|
|
43
43
|
};
|
|
44
|
+
case 'HIPAA_CONTENT_DETECTED':
|
|
45
|
+
return {
|
|
46
|
+
message: _messages.messages.ai_summary_error_hipaa_content_detected
|
|
47
|
+
};
|
|
44
48
|
default:
|
|
45
49
|
return {
|
|
46
50
|
message: _messages.messages.ai_summary_error_generic,
|
|
@@ -69,7 +73,7 @@ var AIStateError = function AIStateError(_ref2) {
|
|
|
69
73
|
content: /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
70
74
|
testId: "".concat(testId, "-error-message"),
|
|
71
75
|
xcss: contentStyles
|
|
72
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(FormattedErrorMessage, {
|
|
73
77
|
message: message,
|
|
74
78
|
url: url
|
|
75
79
|
})),
|
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
|
+
};
|
|
@@ -28,6 +28,8 @@ var _useAnalyticsEvents2 = require("../../../../../../common/analytics/generated
|
|
|
28
28
|
var _aiEventSummaryViewed = _interopRequireDefault(require("../ai-event-summary-viewed"));
|
|
29
29
|
var _aiEventErrorViewed = _interopRequireDefault(require("../ai-event-error-viewed"));
|
|
30
30
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
31
|
+
var _react2 = require("@emotion/react");
|
|
32
|
+
var _featureDiscovery = _interopRequireDefault(require("../feature-discovery"));
|
|
31
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); }
|
|
32
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; }
|
|
33
35
|
var AISummaryBlockErrorIndicator = exports.AISummaryBlockErrorIndicator = function AISummaryBlockErrorIndicator(_ref) {
|
|
@@ -117,7 +119,12 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
117
119
|
testId: "".concat(testId, "-ai-summary-action"),
|
|
118
120
|
icon: /*#__PURE__*/_react.default.createElement(_aiIcon.default, {
|
|
119
121
|
label: "AIIcon"
|
|
120
|
-
})
|
|
122
|
+
}),
|
|
123
|
+
/**
|
|
124
|
+
* Enabling feature discovery pulse
|
|
125
|
+
* Cleanup: https://product-fabric.atlassian.net/browse/EDM-9693
|
|
126
|
+
*/
|
|
127
|
+
wrapper: _featureDiscovery.default
|
|
121
128
|
};
|
|
122
129
|
return [aiAction].concat((0, _toConsumableArray2.default)(actions));
|
|
123
130
|
}
|
|
@@ -133,6 +140,13 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
133
140
|
return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, props, {
|
|
134
141
|
direction: _constants.SmartLinkDirection.Vertical,
|
|
135
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)
|
|
136
150
|
}), status === 'done' && /*#__PURE__*/_react.default.createElement(_aiEventSummaryViewed.default, {
|
|
137
151
|
fromCache: isSummarisedOnMountRef.current
|
|
138
152
|
}), /*#__PURE__*/_react.default.createElement(_aiMotionWrapper.default, {
|
|
@@ -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
|
|