@atlaskit/smart-card 45.24.1 → 45.24.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-dropbox-in-atlas-slide1--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide1--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide2--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide3--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide1--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide2--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide3--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card--light-mode.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-actions--light-mode.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-actions-with-related-urls--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-entities-support--light-mode.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-ssrerror--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-ssrloading--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-forbidden-view-renders-correctly-when-hovering-over-url-in-forbidden-view--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-not-found-view-renders-correctly-when-hovering-over-url-in-not-found-view--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-renders-correctly-when-hovering-over-url--default--jfp-magma-platform-lozenge-jump-fix-false.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-renders-correctly-when-hovering-over-url--default--jfp-magma-platform-lozenge-jump-fix-true.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-unauthorised-view-renders-correctly-when-hovering-over-connect-account--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-unauthorised-view-renders-correctly-when-hovering-over-url-in-unauthorized-view--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-unauthorised-view-with-truncation--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-when-selected--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden--default--jfp-magma-platform-lozenge-jump-fix-false.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden--default--jfp-magma-platform-lozenge-jump-fix-true.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden-with-site-pending-request--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden-with-site-request-access--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-not-found-with-site-access-exists--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-resolving--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-un-auth--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/vrinline-profile-card--default.png +2 -2
- package/dist/cjs/state/getFirstPartyIdentifier.js +1 -2
- package/dist/cjs/state/getThirdPartyARI.js +7 -10
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +2 -4
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +3 -5
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -6
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +7 -5
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +2 -5
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/index.js +4 -7
- package/dist/cjs/view/LinkUrl/HyperlinkResolver/index.js +2 -5
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-dropbox-in-atlas-slide1--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide1--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide2--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide3--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide1--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide2--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide3--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card--light-mode.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-actions--light-mode.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-actions-with-related-urls--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-entities-support--light-mode.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-ssrerror--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-ssrloading--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-forbidden-view-renders-correctly-when-hovering-over-url-in-forbidden-view--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-not-found-view-renders-correctly-when-hovering-over-url-in-not-found-view--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-renders-correctly-when-hovering-over-url--default--jfp-magma-platform-lozenge-jump-fix-false.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-renders-correctly-when-hovering-over-url--default--jfp-magma-platform-lozenge-jump-fix-true.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-unauthorised-view-renders-correctly-when-hovering-over-connect-account--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-unauthorised-view-renders-correctly-when-hovering-over-url-in-unauthorized-view--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-unauthorised-view-with-truncation--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-when-selected--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden--default--jfp-magma-platform-lozenge-jump-fix-false.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden--default--jfp-magma-platform-lozenge-jump-fix-true.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden-with-site-pending-request--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden-with-site-request-access--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-not-found-with-site-access-exists--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-resolving--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-un-auth--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/vrinline-profile-card--default.png +2 -2
- package/dist/es2019/state/getFirstPartyIdentifier.js +1 -3
- package/dist/es2019/state/getThirdPartyARI.js +7 -10
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +2 -4
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +3 -5
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -6
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +5 -4
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +2 -5
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/index.js +4 -7
- package/dist/es2019/view/LinkUrl/HyperlinkResolver/index.js +2 -5
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-dropbox-in-atlas-slide1--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide1--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide2--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-figma-in-trello-slide3--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide1--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide2--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-unauthorized-carousel-google-in-confluence-slide3--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card--light-mode.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-actions--light-mode.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-actions-with-related-urls--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-entities-support--light-mode.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-ssrerror--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-ssrloading--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-forbidden-view-renders-correctly-when-hovering-over-url-in-forbidden-view--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-not-found-view-renders-correctly-when-hovering-over-url-in-not-found-view--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-renders-correctly-when-hovering-over-url--default--jfp-magma-platform-lozenge-jump-fix-false.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-renders-correctly-when-hovering-over-url--default--jfp-magma-platform-lozenge-jump-fix-true.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-unauthorised-view-renders-correctly-when-hovering-over-connect-account--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-unauthorised-view-renders-correctly-when-hovering-over-url-in-unauthorized-view--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-unauthorised-view-with-truncation--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-when-selected--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden--default--jfp-magma-platform-lozenge-jump-fix-false.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden--default--jfp-magma-platform-lozenge-jump-fix-true.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden-with-site-pending-request--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-forbidden-with-site-request-access--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-not-found-with-site-access-exists--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-resolving--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-word-wrap-un-auth--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/vrinline-profile-card--default.png +2 -2
- package/dist/esm/state/getFirstPartyIdentifier.js +1 -3
- package/dist/esm/state/getThirdPartyARI.js +7 -10
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +2 -4
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +3 -5
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -6
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +7 -5
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +2 -5
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/index.js +4 -7
- package/dist/esm/view/LinkUrl/HyperlinkResolver/index.js +2 -5
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.d.ts +2 -2
- package/package.json +9 -12
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action-new.js +0 -66
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action-new.js +0 -38
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action-new.js +0 -57
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action-new.d.ts +0 -6
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
1
|
export var getThirdPartyARI = function getThirdPartyARI(details) {
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return ari;
|
|
11
|
-
}
|
|
2
|
+
if (details !== null && details !== void 0 && details.entityData && 'thirdPartyAri' in details.entityData && details.entityData.thirdPartyAri) {
|
|
3
|
+
return details.entityData.thirdPartyAri;
|
|
4
|
+
}
|
|
5
|
+
if (details !== null && details !== void 0 && details.data && 'atlassian:ari' in details.data && typeof details.data['atlassian:ari'] === 'string') {
|
|
6
|
+
var ari = details.data['atlassian:ari'];
|
|
7
|
+
if (ari.includes('ari:third-party')) {
|
|
8
|
+
return ari;
|
|
12
9
|
}
|
|
13
10
|
}
|
|
14
11
|
return undefined;
|
|
@@ -3,7 +3,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
3
3
|
export var context = {
|
|
4
4
|
componentName: 'smart-cards',
|
|
5
5
|
packageName: "@atlaskit/smart-card" || '',
|
|
6
|
-
packageVersion: "45.24.
|
|
6
|
+
packageVersion: "45.24.2" || ''
|
|
7
7
|
};
|
|
8
8
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
9
9
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -115,12 +115,10 @@ function Component(_ref) {
|
|
|
115
115
|
|
|
116
116
|
// TODO: [ZS] Add new experiment flag to determine if the Rovo Actions CTA should be shown
|
|
117
117
|
var rovoActionsCtaShown = false;
|
|
118
|
-
var fire3PClickEvent =
|
|
119
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
120
|
-
useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) : undefined;
|
|
118
|
+
var fire3PClickEvent = useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI);
|
|
121
119
|
|
|
122
120
|
// Shared scope guard for all 3P-click handlers.
|
|
123
|
-
var shouldFire3PClickEvent = thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix) && getClickUrl(url, state.details) === url && fire3PClickEvent
|
|
121
|
+
var shouldFire3PClickEvent = thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix) && getClickUrl(url, state.details) === url && fire3PClickEvent;
|
|
124
122
|
var getDestinationUrl = useCallback(function () {
|
|
125
123
|
var _getClickUrl, _appendCrossProductAn;
|
|
126
124
|
// FIXME: destinationUrl should be rendered in the DOM anchor href instead of derived at click time
|
package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js
CHANGED
|
@@ -5,7 +5,6 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback } from 'react';
|
|
7
7
|
import { cx } from '@atlaskit/css';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
8
|
import { Box, Inline, Pressable } from '@atlaskit/primitives/compiled';
|
|
10
9
|
import Spinner from '@atlaskit/spinner/spinner';
|
|
11
10
|
import { getPrimitivesInlineSpaceBySize } from '../../../getPrimitivesInlineSpaceBySize';
|
|
@@ -56,10 +55,9 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
56
55
|
testId: testId
|
|
57
56
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
58
57
|
,
|
|
59
|
-
style: style
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} : {}), /*#__PURE__*/React.createElement(Inline, {
|
|
58
|
+
style: style,
|
|
59
|
+
"aria-label": ariaLabel
|
|
60
|
+
}), /*#__PURE__*/React.createElement(Inline, {
|
|
63
61
|
alignBlock: "center",
|
|
64
62
|
grow: "fill",
|
|
65
63
|
space: space
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
3
|
import { di } from 'react-magnetic-di';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
4
|
import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
|
|
6
5
|
import { AISummariseAction } from './ai-summarise-action';
|
|
7
6
|
import { CopySummaryAction } from './copy-summary-action';
|
|
8
|
-
import { CopySummaryActionNew } from './copy-summary-action-new';
|
|
9
7
|
export var AISummaryActionComponent = function AISummaryActionComponent(props) {
|
|
10
8
|
var url = props.url,
|
|
11
9
|
onLoadingChange = props.onLoadingChange,
|
|
@@ -19,12 +17,9 @@ export var AISummaryActionComponent = function AISummaryActionComponent(props) {
|
|
|
19
17
|
useEffect(function () {
|
|
20
18
|
onLoadingChange === null || onLoadingChange === void 0 || onLoadingChange(status === 'loading');
|
|
21
19
|
}, [onLoadingChange, status]);
|
|
22
|
-
return status === 'done' ?
|
|
20
|
+
return status === 'done' ? /*#__PURE__*/React.createElement(CopySummaryAction, _extends({}, props, {
|
|
23
21
|
summary: content,
|
|
24
22
|
testId: testId
|
|
25
|
-
})) : /*#__PURE__*/React.createElement(CopySummaryAction, _extends({}, props, {
|
|
26
|
-
testId: testId,
|
|
27
|
-
content: content
|
|
28
23
|
})) : /*#__PURE__*/React.createElement(AISummariseAction, _extends({}, props, {
|
|
29
24
|
testId: testId,
|
|
30
25
|
summariseUrl: summariseUrl,
|
package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["url", "onClick", "
|
|
5
|
+
var _excluded = ["url", "onClick", "summary", "testId"];
|
|
6
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
import React, { useCallback, useState } from 'react';
|
|
8
8
|
import { FormattedMessage } from 'react-intl';
|
|
@@ -13,8 +13,9 @@ import Action from '../action';
|
|
|
13
13
|
export function CopySummaryAction(_ref) {
|
|
14
14
|
var url = _ref.url,
|
|
15
15
|
onClickCallback = _ref.onClick,
|
|
16
|
+
_ref$summary = _ref.summary,
|
|
17
|
+
summary = _ref$summary === void 0 ? '' : _ref$summary,
|
|
16
18
|
testId = _ref.testId,
|
|
17
|
-
content = _ref.content,
|
|
18
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
20
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
20
21
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
@@ -28,7 +29,7 @@ export function CopySummaryAction(_ref) {
|
|
|
28
29
|
case 0:
|
|
29
30
|
fireEvent('ui.button.clicked.copySummary', {});
|
|
30
31
|
_context.next = 1;
|
|
31
|
-
return navigator.clipboard.writeText(
|
|
32
|
+
return navigator.clipboard.writeText(summary);
|
|
32
33
|
case 1:
|
|
33
34
|
setTooltipMessage(messages.copied_summary_action_description);
|
|
34
35
|
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
@@ -37,13 +38,14 @@ export function CopySummaryAction(_ref) {
|
|
|
37
38
|
return _context.stop();
|
|
38
39
|
}
|
|
39
40
|
}, _callee);
|
|
40
|
-
})), [fireEvent, onClickCallback,
|
|
41
|
+
})), [fireEvent, onClickCallback, summary]);
|
|
41
42
|
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
42
43
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_summary_action),
|
|
43
44
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
44
45
|
color: "currentColor",
|
|
45
46
|
spacing: "spacious",
|
|
46
|
-
label: "Copy Summary"
|
|
47
|
+
label: "Copy Summary",
|
|
48
|
+
size: props.iconSize
|
|
47
49
|
}),
|
|
48
50
|
onClick: handleCopySummaryClick,
|
|
49
51
|
testId: "".concat(testId, "-copy-summary-action"),
|
|
@@ -4,7 +4,6 @@ var _excluded = ["value", "isProject"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
6
6
|
import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
7
|
import { ActionName } from '../../../../../constants';
|
|
9
8
|
import { messages } from '../../../../../messages';
|
|
10
9
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context/useFlexibleUiContext';
|
|
@@ -72,10 +71,8 @@ var FollowAction = function FollowAction(props) {
|
|
|
72
71
|
});
|
|
73
72
|
};
|
|
74
73
|
return /*#__PURE__*/React.createElement(ServerAction, _extends({
|
|
75
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, label)
|
|
76
|
-
|
|
77
|
-
ariaLabel: intl.formatMessage(label)
|
|
78
|
-
} : {}, {
|
|
74
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, label),
|
|
75
|
+
ariaLabel: intl.formatMessage(label),
|
|
79
76
|
icon: followIcon,
|
|
80
77
|
testId: "smart-action-follow-action",
|
|
81
78
|
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
|
|
@@ -3,7 +3,6 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["onClick"];
|
|
4
4
|
import React, { lazy, useCallback } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
6
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
8
7
|
import { messages } from '../../../../../messages';
|
|
9
8
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context/useFlexibleUiContext';
|
|
@@ -37,13 +36,11 @@ var ViewRelatedLinksAction = function ViewRelatedLinksAction(_ref) {
|
|
|
37
36
|
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
38
37
|
}, [actionData === null || actionData === void 0 ? void 0 : actionData.ari, fireEvent, modal, onClickCallback]);
|
|
39
38
|
return actionData ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
40
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} : {}, {
|
|
44
|
-
icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, fg('platform_sl_action_refactoring') ? {
|
|
39
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links),
|
|
40
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links),
|
|
41
|
+
icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, {
|
|
45
42
|
iconSize: props.iconSize
|
|
46
|
-
}
|
|
43
|
+
}),
|
|
47
44
|
onClick: onClick,
|
|
48
45
|
testId: "smart-action-view-related-links-action",
|
|
49
46
|
ariaLabel: "View most recent pages or content types coming from or found on this link"
|
|
@@ -4,7 +4,6 @@ var _excluded = ["onClick"];
|
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
5
|
import { withErrorBoundary as withReactErrorBoundary } from 'react-error-boundary';
|
|
6
6
|
import { injectIntl } from 'react-intl';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
7
|
import { getFirstPartyIdentifier } from '../../../state/getFirstPartyIdentifier';
|
|
9
8
|
import { getThirdPartyARI } from '../../../state/getThirdPartyARI';
|
|
10
9
|
import useResolveHyperlink from '../../../state/hooks/use-resolve-hyperlink';
|
|
@@ -35,12 +34,10 @@ var HyperlinkWithSmartLinkResolverInner = function HyperlinkWithSmartLinkResolve
|
|
|
35
34
|
state = _useResolveHyperlink.state;
|
|
36
35
|
var thirdPartyARI = getThirdPartyARI(state === null || state === void 0 ? void 0 : state.details);
|
|
37
36
|
var firstPartyIdentifier = getFirstPartyIdentifier();
|
|
38
|
-
var fire3PClickEvent =
|
|
39
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
40
|
-
useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) : undefined;
|
|
37
|
+
var fire3PClickEvent = useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI);
|
|
41
38
|
|
|
42
39
|
// Shared scope guard for all 3P-click handlers.
|
|
43
|
-
var shouldFire3PClickEvent = (state === null || state === void 0 ? void 0 : state.status) === 'resolved' && fire3PClickEvent
|
|
40
|
+
var shouldFire3PClickEvent = (state === null || state === void 0 ? void 0 : state.status) === 'resolved' && fire3PClickEvent;
|
|
44
41
|
var onClick = useCallback(function (e) {
|
|
45
42
|
// button === 0 is left-click, see
|
|
46
43
|
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
var PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "45.24.
|
|
15
|
+
packageVersion: "45.24.2",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
|
|
3
3
|
import type { AISummaryActionProps } from './types';
|
|
4
|
-
export declare function CopySummaryAction({ url, onClick: onClickCallback,
|
|
5
|
-
|
|
4
|
+
export declare function CopySummaryAction({ url, onClick: onClickCallback, summary, testId, ...props }: AISummaryActionProps & AISummaryActionData & {
|
|
5
|
+
summary?: string;
|
|
6
6
|
}): React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "45.24.
|
|
3
|
+
"version": "45.24.3",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"team": "Navigation Experiences - Linking Platform",
|
|
29
29
|
"website": {
|
|
30
|
+
"tags": [
|
|
31
|
+
"platform-labs"
|
|
32
|
+
],
|
|
30
33
|
"name": "Smart Card"
|
|
31
34
|
}
|
|
32
35
|
},
|
|
@@ -70,7 +73,7 @@
|
|
|
70
73
|
"@atlaskit/lozenge": "^15.4.0",
|
|
71
74
|
"@atlaskit/menu": "^10.2.0",
|
|
72
75
|
"@atlaskit/modal-dialog": "^16.6.0",
|
|
73
|
-
"@atlaskit/motion": "^8.
|
|
76
|
+
"@atlaskit/motion": "^8.7.0",
|
|
74
77
|
"@atlaskit/object": "^2.3.0",
|
|
75
78
|
"@atlaskit/outbound-auth-flow-client": "^4.2.0",
|
|
76
79
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
@@ -80,7 +83,7 @@
|
|
|
80
83
|
"@atlaskit/primitives": "^22.5.0",
|
|
81
84
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
82
85
|
"@atlaskit/react-ufo": "^7.11.0",
|
|
83
|
-
"@atlaskit/rovo-triggers": "^11.
|
|
86
|
+
"@atlaskit/rovo-triggers": "^11.1.0",
|
|
84
87
|
"@atlaskit/section-message": "^10.2.0",
|
|
85
88
|
"@atlaskit/select": "^22.11.0",
|
|
86
89
|
"@atlaskit/spinner": "^20.4.0",
|
|
@@ -90,8 +93,8 @@
|
|
|
90
93
|
"@atlaskit/textfield": "^10.2.0",
|
|
91
94
|
"@atlaskit/theme": "^28.2.0",
|
|
92
95
|
"@atlaskit/tile": "^4.1.0",
|
|
93
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
94
|
-
"@atlaskit/tokens": "^
|
|
96
|
+
"@atlaskit/tmp-editor-statsig": "^199.0.0",
|
|
97
|
+
"@atlaskit/tokens": "^18.0.0",
|
|
95
98
|
"@atlaskit/tooltip": "^24.3.0",
|
|
96
99
|
"@atlaskit/ufo": "^1.2.0",
|
|
97
100
|
"@atlaskit/width-detector": "^7.2.0",
|
|
@@ -133,7 +136,7 @@
|
|
|
133
136
|
"@atlassian/analytics-tooling": "workspace:^",
|
|
134
137
|
"@atlassian/experiment-test-utils": "^0.2.0",
|
|
135
138
|
"@atlassian/feature-flags-test-utils": "^1.3.0",
|
|
136
|
-
"@atlassian/gemini": "^1.
|
|
139
|
+
"@atlassian/gemini": "^1.54.0",
|
|
137
140
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
138
141
|
"@atlassian/testing-library": "^0.11.0",
|
|
139
142
|
"@atlassian/workbench": "workspace:*",
|
|
@@ -184,18 +187,12 @@
|
|
|
184
187
|
"product-terminology-refresh": {
|
|
185
188
|
"type": "boolean"
|
|
186
189
|
},
|
|
187
|
-
"platform_smartlink_3pclick_analytics": {
|
|
188
|
-
"type": "boolean"
|
|
189
|
-
},
|
|
190
190
|
"jfp-magma-platform-lozenge-jump-fix": {
|
|
191
191
|
"type": "boolean"
|
|
192
192
|
},
|
|
193
193
|
"platform_sl_priority_icon": {
|
|
194
194
|
"type": "boolean"
|
|
195
195
|
},
|
|
196
|
-
"platform_sl_action_refactoring": {
|
|
197
|
-
"type": "boolean"
|
|
198
|
-
},
|
|
199
196
|
"jpx-1074-smart-links-iframe": {
|
|
200
197
|
"type": "boolean"
|
|
201
198
|
},
|
package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action-new.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
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.CopySummaryActionNew = CopySummaryActionNew;
|
|
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 _reactIntl = require("react-intl");
|
|
16
|
-
var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
|
|
17
|
-
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
18
|
-
var _messages = require("../../../../../messages");
|
|
19
|
-
var _action = _interopRequireDefault(require("../action"));
|
|
20
|
-
var _excluded = ["url", "onClick", "summary", "testId"];
|
|
21
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
|
-
function CopySummaryActionNew(_ref) {
|
|
23
|
-
var url = _ref.url,
|
|
24
|
-
onClickCallback = _ref.onClick,
|
|
25
|
-
_ref$summary = _ref.summary,
|
|
26
|
-
summary = _ref$summary === void 0 ? '' : _ref$summary,
|
|
27
|
-
testId = _ref.testId,
|
|
28
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
|
-
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
30
|
-
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
31
|
-
var _useState = (0, _react.useState)(_messages.messages.copy_summary_action_description),
|
|
32
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
33
|
-
tooltipMessage = _useState2[0],
|
|
34
|
-
setTooltipMessage = _useState2[1];
|
|
35
|
-
var handleCopySummaryClick = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
36
|
-
return _regenerator.default.wrap(function (_context) {
|
|
37
|
-
while (1) switch (_context.prev = _context.next) {
|
|
38
|
-
case 0:
|
|
39
|
-
fireEvent('ui.button.clicked.copySummary', {});
|
|
40
|
-
_context.next = 1;
|
|
41
|
-
return navigator.clipboard.writeText(summary);
|
|
42
|
-
case 1:
|
|
43
|
-
setTooltipMessage(_messages.messages.copied_summary_action_description);
|
|
44
|
-
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
45
|
-
case 2:
|
|
46
|
-
case "end":
|
|
47
|
-
return _context.stop();
|
|
48
|
-
}
|
|
49
|
-
}, _callee);
|
|
50
|
-
})), [fireEvent, onClickCallback, summary]);
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
52
|
-
content: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.copy_summary_action),
|
|
53
|
-
icon: /*#__PURE__*/_react.default.createElement(_copy.default, {
|
|
54
|
-
color: "currentColor",
|
|
55
|
-
spacing: "spacious",
|
|
56
|
-
label: "Copy Summary",
|
|
57
|
-
size: props.iconSize
|
|
58
|
-
}),
|
|
59
|
-
onClick: handleCopySummaryClick,
|
|
60
|
-
testId: "".concat(testId, "-copy-summary-action"),
|
|
61
|
-
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, tooltipMessage),
|
|
62
|
-
tooltipOnHide: function tooltipOnHide() {
|
|
63
|
-
return setTooltipMessage(_messages.messages.copy_summary_action_description);
|
|
64
|
-
}
|
|
65
|
-
}, props));
|
|
66
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useCallback, useState } from 'react';
|
|
3
|
-
import { FormattedMessage } from 'react-intl';
|
|
4
|
-
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
5
|
-
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
6
|
-
import { messages } from '../../../../../messages';
|
|
7
|
-
import Action from '../action';
|
|
8
|
-
export function CopySummaryActionNew({
|
|
9
|
-
url,
|
|
10
|
-
onClick: onClickCallback,
|
|
11
|
-
summary = '',
|
|
12
|
-
testId,
|
|
13
|
-
...props
|
|
14
|
-
}) {
|
|
15
|
-
const {
|
|
16
|
-
fireEvent
|
|
17
|
-
} = useAnalyticsEvents();
|
|
18
|
-
const [tooltipMessage, setTooltipMessage] = useState(messages.copy_summary_action_description);
|
|
19
|
-
const handleCopySummaryClick = useCallback(async () => {
|
|
20
|
-
fireEvent('ui.button.clicked.copySummary', {});
|
|
21
|
-
await navigator.clipboard.writeText(summary);
|
|
22
|
-
setTooltipMessage(messages.copied_summary_action_description);
|
|
23
|
-
onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback();
|
|
24
|
-
}, [fireEvent, onClickCallback, summary]);
|
|
25
|
-
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
26
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_summary_action),
|
|
27
|
-
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
28
|
-
color: "currentColor",
|
|
29
|
-
spacing: "spacious",
|
|
30
|
-
label: "Copy Summary",
|
|
31
|
-
size: props.iconSize
|
|
32
|
-
}),
|
|
33
|
-
onClick: handleCopySummaryClick,
|
|
34
|
-
testId: `${testId}-copy-summary-action`,
|
|
35
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
|
|
36
|
-
tooltipOnHide: () => setTooltipMessage(messages.copy_summary_action_description)
|
|
37
|
-
}, props));
|
|
38
|
-
}
|
package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action-new.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["url", "onClick", "summary", "testId"];
|
|
6
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
-
import React, { useCallback, useState } from 'react';
|
|
8
|
-
import { FormattedMessage } from 'react-intl';
|
|
9
|
-
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
10
|
-
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
11
|
-
import { messages } from '../../../../../messages';
|
|
12
|
-
import Action from '../action';
|
|
13
|
-
export function CopySummaryActionNew(_ref) {
|
|
14
|
-
var url = _ref.url,
|
|
15
|
-
onClickCallback = _ref.onClick,
|
|
16
|
-
_ref$summary = _ref.summary,
|
|
17
|
-
summary = _ref$summary === void 0 ? '' : _ref$summary,
|
|
18
|
-
testId = _ref.testId,
|
|
19
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
21
|
-
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
22
|
-
var _useState = useState(messages.copy_summary_action_description),
|
|
23
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
-
tooltipMessage = _useState2[0],
|
|
25
|
-
setTooltipMessage = _useState2[1];
|
|
26
|
-
var handleCopySummaryClick = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
27
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
28
|
-
while (1) switch (_context.prev = _context.next) {
|
|
29
|
-
case 0:
|
|
30
|
-
fireEvent('ui.button.clicked.copySummary', {});
|
|
31
|
-
_context.next = 1;
|
|
32
|
-
return navigator.clipboard.writeText(summary);
|
|
33
|
-
case 1:
|
|
34
|
-
setTooltipMessage(messages.copied_summary_action_description);
|
|
35
|
-
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
36
|
-
case 2:
|
|
37
|
-
case "end":
|
|
38
|
-
return _context.stop();
|
|
39
|
-
}
|
|
40
|
-
}, _callee);
|
|
41
|
-
})), [fireEvent, onClickCallback, summary]);
|
|
42
|
-
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
43
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_summary_action),
|
|
44
|
-
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
45
|
-
color: "currentColor",
|
|
46
|
-
spacing: "spacious",
|
|
47
|
-
label: "Copy Summary",
|
|
48
|
-
size: props.iconSize
|
|
49
|
-
}),
|
|
50
|
-
onClick: handleCopySummaryClick,
|
|
51
|
-
testId: "".concat(testId, "-copy-summary-action"),
|
|
52
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
|
|
53
|
-
tooltipOnHide: function tooltipOnHide() {
|
|
54
|
-
return setTooltipMessage(messages.copy_summary_action_description);
|
|
55
|
-
}
|
|
56
|
-
}, props));
|
|
57
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
|
|
3
|
-
import type { AISummaryActionProps } from './types';
|
|
4
|
-
export declare function CopySummaryActionNew({ url, onClick: onClickCallback, summary, testId, ...props }: AISummaryActionProps & AISummaryActionData & {
|
|
5
|
-
summary?: string;
|
|
6
|
-
}): React.JSX.Element;
|