@atlaskit/smart-card 46.14.6 → 46.16.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 +31 -0
- package/analytics.spec.yaml +2 -2
- package/dist/cjs/__tests__/vr-tests/bitbucket-favicon.svg +1 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/get-icon-for-file-type.js +6 -25
- package/dist/cjs/view/EmbedCard/views/ResolvedView.js +1 -20
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +5 -41
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +3 -35
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/PreAuthValuePropositionModal/index.js +56 -110
- package/dist/cjs/view/PreAuthValuePropositionModal/use-pre-auth-value-proposition-modal.js +175 -0
- package/dist/es2019/__tests__/vr-tests/bitbucket-favicon.svg +1 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/get-icon-for-file-type.js +6 -19
- package/dist/es2019/view/EmbedCard/views/ResolvedView.js +1 -11
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +1 -26
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +3 -29
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/PreAuthValuePropositionModal/index.js +54 -102
- package/dist/es2019/view/PreAuthValuePropositionModal/use-pre-auth-value-proposition-modal.js +160 -0
- package/dist/esm/__tests__/vr-tests/bitbucket-favicon.svg +1 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/get-icon-for-file-type.js +6 -25
- package/dist/esm/view/EmbedCard/views/ResolvedView.js +1 -17
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +5 -36
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +3 -35
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/PreAuthValuePropositionModal/index.js +56 -110
- package/dist/esm/view/PreAuthValuePropositionModal/use-pre-auth-value-proposition-modal.js +167 -0
- package/dist/types/common/analytics/generated/analytics.types.d.ts +2 -2
- package/dist/types/view/PreAuthValuePropositionModal/index.d.ts +1 -1
- package/dist/types/view/PreAuthValuePropositionModal/use-pre-auth-value-proposition-modal.d.ts +31 -0
- package/package.json +7 -7
- package/dist/cjs/view/FlexibleCard/components/importIcon.js +0 -20
- package/dist/es2019/view/FlexibleCard/components/importIcon.js +0 -7
- package/dist/esm/view/FlexibleCard/components/importIcon.js +0 -13
- package/dist/types/view/FlexibleCard/components/importIcon.d.ts +0 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { extractSmartLinkProvider } from '@atlaskit/link-extractors/extract-smart-link-provider';
|
|
3
|
+
import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
4
|
+
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
5
|
+
import { getExtensionKey, getServices } from '../../state/helpers';
|
|
6
|
+
import useSocialProof from '../../state/hooks/use-social-proof';
|
|
7
|
+
import { useSmartLink } from '../../state/hooks/useSmartLink';
|
|
8
|
+
import { preAuthValuePropositionModalService } from '../../state/services/pre-auth-value-proposition-modal';
|
|
9
|
+
export const SMART_LINK_MODAL_ID = 'pre-auth-value-proposition-modal';
|
|
10
|
+
const getModalCloseMethod = event => 'key' in event && event.key === 'Escape' ? 'escape' : 'overlay';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Eligibility, assignment and modal actions for one URL attempt.
|
|
14
|
+
* The existing choreographer adapter owns display permission and cleanup.
|
|
15
|
+
*/
|
|
16
|
+
export function usePreAuthValuePropositionModal({
|
|
17
|
+
url,
|
|
18
|
+
onFinished
|
|
19
|
+
}) {
|
|
20
|
+
const {
|
|
21
|
+
actions,
|
|
22
|
+
config,
|
|
23
|
+
state
|
|
24
|
+
} = useSmartLink(SMART_LINK_MODAL_ID, url, 'inline');
|
|
25
|
+
const {
|
|
26
|
+
fireEvent
|
|
27
|
+
} = useAnalyticsEvents();
|
|
28
|
+
const [isRequested, setIsRequested] = useState(false);
|
|
29
|
+
const finished = useRef(false);
|
|
30
|
+
const hasOpened = useRef(false);
|
|
31
|
+
const hasRecordedShow = useRef(false);
|
|
32
|
+
const [visibleVariant, setVisibleVariant] = useState('modal_text_only');
|
|
33
|
+
const modalOpenTimeRef = useRef(Date.now());
|
|
34
|
+
const provider = useMemo(() => extractSmartLinkProvider(state.details), [state.details]);
|
|
35
|
+
const providerName = provider === null || provider === void 0 ? void 0 : provider.text;
|
|
36
|
+
const services = getServices(state.details);
|
|
37
|
+
const extensionKey = getExtensionKey(state.details);
|
|
38
|
+
const {
|
|
39
|
+
connectedPct,
|
|
40
|
+
isEnabled: isSocialProofAvailable
|
|
41
|
+
} = useSocialProof(extensionKey, true);
|
|
42
|
+
const hasSupportedAuthorization = (config === null || config === void 0 ? void 0 : config.authFlow) !== 'disabled' && services.length > 0;
|
|
43
|
+
const isBaseEligible = state.status === 'unauthorized' && Boolean(providerName) && Boolean(extensionKey) && hasSupportedAuthorization;
|
|
44
|
+
const finishCoordinatedAttempt = useCallback(() => {
|
|
45
|
+
if (finished.current) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
finished.current = true;
|
|
49
|
+
setIsRequested(false);
|
|
50
|
+
onFinished();
|
|
51
|
+
}, [onFinished]);
|
|
52
|
+
const handleUnavailable = useCallback(() => {
|
|
53
|
+
if (finished.current) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (hasOpened.current) {
|
|
57
|
+
fireEvent('ui.modal.closed.preAuthValueProposition', {
|
|
58
|
+
closeMethod: 'coordinator',
|
|
59
|
+
dwellTime: Date.now() - modalOpenTimeRef.current
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
finishCoordinatedAttempt();
|
|
63
|
+
}, [fireEvent, finishCoordinatedAttempt]);
|
|
64
|
+
const shouldClaim = useCallback(() => {
|
|
65
|
+
// Recheck at offer time: another attempt may have consumed the cap while we waited.
|
|
66
|
+
if (finished.current || !isBaseEligible || !extensionKey || preAuthValuePropositionModalService.hasReachedShowLimit(extensionKey)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
const variant = expVal('platform_sl_3p_preauth_value_modal', 'variant', 'control');
|
|
70
|
+
if (variant !== 'modal_text_only' && variant !== 'modal_with_image') {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
setVisibleVariant(variant);
|
|
74
|
+
return true;
|
|
75
|
+
}, [extensionKey, isBaseEligible]);
|
|
76
|
+
|
|
77
|
+
// The editor mounts this flow only when platform_sl_3p_preauth_value_modal_killswitch is on.
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (finished.current) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (state.status === 'pending' || state.status === 'resolving') {
|
|
83
|
+
// A previously eligible link that starts resolving again must release its slot.
|
|
84
|
+
if (isRequested) {
|
|
85
|
+
handleUnavailable();
|
|
86
|
+
}
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (!isBaseEligible || !extensionKey) {
|
|
90
|
+
handleUnavailable();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (!isRequested) {
|
|
94
|
+
if (preAuthValuePropositionModalService.hasReachedShowLimit(extensionKey)) {
|
|
95
|
+
finishCoordinatedAttempt();
|
|
96
|
+
} else {
|
|
97
|
+
setIsRequested(true);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, [extensionKey, isBaseEligible, state.status, isRequested, handleUnavailable, finishCoordinatedAttempt]);
|
|
101
|
+
const recordShowOnce = useCallback(() => {
|
|
102
|
+
if (hasRecordedShow.current || !extensionKey) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
hasRecordedShow.current = true;
|
|
106
|
+
preAuthValuePropositionModalService.recordShow(extensionKey);
|
|
107
|
+
}, [extensionKey]);
|
|
108
|
+
const dismissModal = useCallback(closeMethod => {
|
|
109
|
+
if (finished.current) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
// A user can dismiss the visible modal before its entrance animation completes.
|
|
113
|
+
recordShowOnce();
|
|
114
|
+
fireEvent('ui.modal.closed.preAuthValueProposition', {
|
|
115
|
+
closeMethod,
|
|
116
|
+
dwellTime: Date.now() - modalOpenTimeRef.current
|
|
117
|
+
});
|
|
118
|
+
finishCoordinatedAttempt();
|
|
119
|
+
}, [fireEvent, finishCoordinatedAttempt, recordShowOnce]);
|
|
120
|
+
const handleCloseButton = useCallback(() => {
|
|
121
|
+
dismissModal('button');
|
|
122
|
+
}, [dismissModal]);
|
|
123
|
+
const handleModalClose = useCallback(event => {
|
|
124
|
+
dismissModal(getModalCloseMethod(event));
|
|
125
|
+
}, [dismissModal]);
|
|
126
|
+
const handleOpenComplete = useCallback(() => {
|
|
127
|
+
if (finished.current || hasOpened.current || !extensionKey) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
hasOpened.current = true;
|
|
131
|
+
recordShowOnce();
|
|
132
|
+
modalOpenTimeRef.current = Date.now();
|
|
133
|
+
fireEvent('ui.modal.opened.preAuthValueProposition', {});
|
|
134
|
+
}, [fireEvent, extensionKey, recordShowOnce]);
|
|
135
|
+
const connectAccount = useCallback(() => {
|
|
136
|
+
if (finished.current) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
recordShowOnce();
|
|
140
|
+
fireEvent('track.applicationAccount.authStarted', {});
|
|
141
|
+
finishCoordinatedAttempt();
|
|
142
|
+
actions.authorize('inline');
|
|
143
|
+
}, [actions, fireEvent, finishCoordinatedAttempt, recordShowOnce]);
|
|
144
|
+
return {
|
|
145
|
+
isActive: isRequested,
|
|
146
|
+
isEligible: isBaseEligible,
|
|
147
|
+
onUnavailable: handleUnavailable,
|
|
148
|
+
shouldClaim,
|
|
149
|
+
modal: {
|
|
150
|
+
provider,
|
|
151
|
+
variant: visibleVariant,
|
|
152
|
+
connectedPct,
|
|
153
|
+
isSocialProofAvailable,
|
|
154
|
+
onClose: handleModalClose,
|
|
155
|
+
onCloseButton: handleCloseButton,
|
|
156
|
+
onConnect: connectAccount,
|
|
157
|
+
onOpenComplete: handleOpenComplete
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" viewBox="0 0 32 32"><image href="data:image/png;base64,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" width="32" height="32" /></svg>
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card" || '',
|
|
7
|
-
packageVersion: "46.
|
|
7
|
+
packageVersion: "46.15.0" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import Loadable from 'react-loadable';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
3
|
import extractFileFormatIcon from '../extractors/flexible/icon/extract-file-formatIcon';
|
|
6
4
|
import { getLazyIcons } from './get-lazy-icons';
|
|
7
5
|
import { getLazyIconComponent } from './lazy-component';
|
|
@@ -15,6 +13,7 @@ var getTypeToIconMap = function getTypeToIconMap(fileFormat) {
|
|
|
15
13
|
return [(_lazyIcons$iconDescri = lazyIcons[iconDescriptor.icon]) === null || _lazyIcons$iconDescri === void 0 ? void 0 : _lazyIcons$iconDescri.default, (_iconDescriptor$label = iconDescriptor.label) !== null && _iconDescriptor$label !== void 0 ? _iconDescriptor$label : ''];
|
|
16
14
|
};
|
|
17
15
|
export var getIconForFileType = function getIconForFileType(fileMimeType, showIconLabel) {
|
|
16
|
+
var _extractFileFormatIco;
|
|
18
17
|
if (!fileMimeType) {
|
|
19
18
|
return;
|
|
20
19
|
}
|
|
@@ -27,31 +26,13 @@ export var getIconForFileType = function getIconForFileType(fileMimeType, showIc
|
|
|
27
26
|
if (!importCb) {
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (iconType) {
|
|
34
|
-
var LazyIcon = getLazyIconComponent("".concat(iconType, ":default"), importCb);
|
|
35
|
-
var lazyLabel = (showIconLabel !== null && showIconLabel !== void 0 ? showIconLabel : true) ? icon[1] || '' : '';
|
|
36
|
-
return /*#__PURE__*/React.createElement(LazyIcon, {
|
|
37
|
-
testId: "document-file-format-icon",
|
|
38
|
-
label: lazyLabel
|
|
39
|
-
});
|
|
40
|
-
}
|
|
29
|
+
var iconType = (_extractFileFormatIco = extractFileFormatIcon(fileMimeType.toLowerCase())) === null || _extractFileFormatIco === void 0 ? void 0 : _extractFileFormatIco.icon;
|
|
30
|
+
if (!iconType) {
|
|
31
|
+
return;
|
|
41
32
|
}
|
|
42
|
-
var
|
|
43
|
-
loader: function loader() {
|
|
44
|
-
return importCb().then(function (module) {
|
|
45
|
-
return module.default;
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
loading: function loading() {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
}); // because we're using dynamic loading here, TS will not be able to infer the type
|
|
52
|
-
|
|
33
|
+
var LazyIcon = getLazyIconComponent("".concat(iconType, ":default"), importCb);
|
|
53
34
|
var label = (showIconLabel !== null && showIconLabel !== void 0 ? showIconLabel : true) ? icon[1] || '' : '';
|
|
54
|
-
return /*#__PURE__*/React.createElement(
|
|
35
|
+
return /*#__PURE__*/React.createElement(LazyIcon, {
|
|
55
36
|
testId: "document-file-format-icon",
|
|
56
37
|
label: label
|
|
57
38
|
});
|
|
@@ -3,7 +3,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import "./ResolvedView.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React, { lazy } from 'react';
|
|
6
|
-
import Loadable from 'react-loadable';
|
|
7
6
|
import LinkGlyph from '@atlaskit/icon/core/link';
|
|
8
7
|
import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
|
|
9
8
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -21,17 +20,6 @@ import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
|
21
20
|
import { Frame } from '../components/Frame';
|
|
22
21
|
import { ImageIcon } from '../components/ImageIcon';
|
|
23
22
|
import { useEmbedResolvePostMessageListener } from '../useEmbedResolvePostMessageListener';
|
|
24
|
-
var EmbedRovoActionsFooter = Loadable({
|
|
25
|
-
loader: function loader() {
|
|
26
|
-
return import( /* webpackChunkName: "smart-card-embed-rovo-actions-footer" */'../components/rovo-actions-footer').then(function (module) {
|
|
27
|
-
return module.default;
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
loading: function loading() {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
EmbedRovoActionsFooter.displayName = 'lazy(EmbedRovoActionsFooter)';
|
|
35
23
|
|
|
36
24
|
// Inline module-scope lazy() so product SSR tooling can preload it before hydration.
|
|
37
25
|
var LazyEmbedRovoActionsFooter = withSuspense( /*#__PURE__*/lazy(function () {
|
|
@@ -77,11 +65,7 @@ var EmbedFrameWithRovoFooter = function EmbedFrameWithRovoFooter(_ref) {
|
|
|
77
65
|
});
|
|
78
66
|
}, [details, isEmbedRovoActionsFooterEnabled, product, rovoActionData]);
|
|
79
67
|
var footer = React.useMemo(function () {
|
|
80
|
-
return rovoActionData && prompts.length > 0 ?
|
|
81
|
-
actionData: rovoActionData,
|
|
82
|
-
prompts: prompts,
|
|
83
|
-
testId: "".concat(testId, "-rovo-actions-footer")
|
|
84
|
-
}) : /*#__PURE__*/React.createElement(EmbedRovoActionsFooter, {
|
|
68
|
+
return rovoActionData && prompts.length > 0 ? /*#__PURE__*/React.createElement(LazyEmbedRovoActionsFooter, {
|
|
85
69
|
actionData: rovoActionData,
|
|
86
70
|
prompts: prompts,
|
|
87
71
|
testId: "".concat(testId, "-rovo-actions-footer")
|
|
@@ -4,63 +4,32 @@ var _excluded = ["value", "isProject"];
|
|
|
4
4
|
import React, { lazy } 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';
|
|
11
10
|
import { renderNothingOnLoadError, withSuspense } from '../../../../../utils/lazy-component';
|
|
12
|
-
import { importIcon } from '../../importIcon';
|
|
13
11
|
import ServerAction from '../action/server-action';
|
|
14
12
|
import { getFollowActionErrorMessage } from './utils';
|
|
15
|
-
var importIconMapper = {
|
|
16
|
-
goal: function goal() {
|
|
17
|
-
return import( /* webpackChunkName: "glyphGoal" */'./goal-icon').then(function (_ref) {
|
|
18
|
-
var GoalIcon = _ref.GoalIcon;
|
|
19
|
-
return {
|
|
20
|
-
default: GoalIcon
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
projects: function projects() {
|
|
25
|
-
return import( /* webpackChunkName: "glyphProjects" */'./projects-icon').then(function (_ref2) {
|
|
26
|
-
var ProjectsIcon = _ref2.ProjectsIcon;
|
|
27
|
-
return {
|
|
28
|
-
default: ProjectsIcon
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
13
|
|
|
34
14
|
// Inline module-scope lazy() calls so product SSR tooling can preload them before hydration.
|
|
35
15
|
var lazyIconMapper = {
|
|
36
16
|
goal: withSuspense( /*#__PURE__*/lazy(function () {
|
|
37
|
-
return import( /* webpackChunkName: "glyphGoal" */'./goal-icon').then(function (
|
|
38
|
-
var GoalIcon =
|
|
17
|
+
return import( /* webpackChunkName: "glyphGoal" */'./goal-icon').then(function (_ref) {
|
|
18
|
+
var GoalIcon = _ref.GoalIcon;
|
|
39
19
|
return {
|
|
40
20
|
default: GoalIcon
|
|
41
21
|
};
|
|
42
22
|
}).catch(renderNothingOnLoadError);
|
|
43
23
|
}), 'lazy(GoalIcon)'),
|
|
44
24
|
projects: withSuspense( /*#__PURE__*/lazy(function () {
|
|
45
|
-
return import( /* webpackChunkName: "glyphProjects" */'./projects-icon').then(function (
|
|
46
|
-
var ProjectsIcon =
|
|
25
|
+
return import( /* webpackChunkName: "glyphProjects" */'./projects-icon').then(function (_ref2) {
|
|
26
|
+
var ProjectsIcon = _ref2.ProjectsIcon;
|
|
47
27
|
return {
|
|
48
28
|
default: ProjectsIcon
|
|
49
29
|
};
|
|
50
30
|
}).catch(renderNothingOnLoadError);
|
|
51
31
|
}), 'lazy(ProjectsIcon)')
|
|
52
32
|
};
|
|
53
|
-
var getIcon = function getIcon(stackIconType) {
|
|
54
|
-
if (fg('platform_sl_replace_react_loadable')) {
|
|
55
|
-
var _lazyIconMapper$stack;
|
|
56
|
-
return (_lazyIconMapper$stack = lazyIconMapper[stackIconType]) !== null && _lazyIconMapper$stack !== void 0 ? _lazyIconMapper$stack : null;
|
|
57
|
-
}
|
|
58
|
-
var importFn = importIconMapper[stackIconType];
|
|
59
|
-
if (!importFn) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
return importIcon(importFn);
|
|
63
|
-
};
|
|
64
33
|
var FollowAction = function FollowAction(props) {
|
|
65
34
|
var _context$actions;
|
|
66
35
|
var context = useFlexibleUiContext();
|
|
@@ -83,7 +52,7 @@ var FollowAction = function FollowAction(props) {
|
|
|
83
52
|
var stackTooltipMessage = isProject ? projectTooltipMessage : goalTooltipMessage;
|
|
84
53
|
var tooltipMessage = isStackItem ? stackTooltipMessage : message;
|
|
85
54
|
var stackIconType = isProject ? 'projects' : 'goal';
|
|
86
|
-
var ImportedIcon =
|
|
55
|
+
var ImportedIcon = lazyIconMapper[stackIconType];
|
|
87
56
|
var followIcon = /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
88
57
|
label: "",
|
|
89
58
|
testId: "smart-action-follow-action-".concat(stackIconType, "-icon")
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import Loadable from 'react-loadable';
|
|
4
3
|
import IconTile from '@atlaskit/icon/icon-tile';
|
|
5
4
|
import { ConfluenceIcon } from '@atlaskit/logo/confluence-icon';
|
|
6
5
|
import { JiraIcon } from '@atlaskit/logo/jira-icon';
|
|
@@ -10,16 +9,6 @@ import { IconType, SmartLinkSize } from '../../../../../constants';
|
|
|
10
9
|
import { getLazyIcons } from '../../../../../utils/get-lazy-icons';
|
|
11
10
|
import { isIconSizeLarge } from '../../../../../utils/is-icon-size-large';
|
|
12
11
|
import { getLazyIconComponent } from '../../../../../utils/lazy-component';
|
|
13
|
-
var getIconImportFn = function getIconImportFn(icon, size) {
|
|
14
|
-
var item = getLazyIcons()[icon];
|
|
15
|
-
if (isIconSizeLarge(size) && item !== null && item !== void 0 && item.large) {
|
|
16
|
-
return item.large;
|
|
17
|
-
}
|
|
18
|
-
return item === null || item === void 0 ? void 0 : item.default;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// Only used when platform_sl_replace_react_loadable is on. Kept separate from getIconImportFn so
|
|
22
|
-
// the gate-off path is unchanged.
|
|
23
12
|
var getLazyIcon = function getLazyIcon(icon, size) {
|
|
24
13
|
var item = getLazyIcons()[icon];
|
|
25
14
|
if (isIconSizeLarge(size) && item !== null && item !== void 0 && item.large) {
|
|
@@ -27,18 +16,6 @@ var getLazyIcon = function getLazyIcon(icon, size) {
|
|
|
27
16
|
}
|
|
28
17
|
return item !== null && item !== void 0 && item.default ? getLazyIconComponent("".concat(icon, ":default"), item.default) : undefined;
|
|
29
18
|
};
|
|
30
|
-
var importIcon = function importIcon(importFn) {
|
|
31
|
-
return Loadable({
|
|
32
|
-
loader: function loader() {
|
|
33
|
-
return importFn().then(function (module) {
|
|
34
|
-
return module.default;
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
loading: function loading() {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
}); // Because we're using dynamic loading here, TS will not be able to infer the type.
|
|
41
|
-
};
|
|
42
19
|
var getBlogIcon = function getBlogIcon() {
|
|
43
20
|
return require('../../../../../common/ui/icons/blog-icon').default;
|
|
44
21
|
};
|
|
@@ -94,18 +71,9 @@ var AtlaskitIcon = function AtlaskitIcon(_ref) {
|
|
|
94
71
|
});
|
|
95
72
|
}
|
|
96
73
|
}
|
|
97
|
-
var ImportedIcon;
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
if (!ImportedIcon) {
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
} else {
|
|
104
|
-
var importFn = getIconImportFn(icon, size);
|
|
105
|
-
if (!importFn) {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
ImportedIcon = importIcon(importFn);
|
|
74
|
+
var ImportedIcon = getLazyIcon(icon, size);
|
|
75
|
+
if (!ImportedIcon) {
|
|
76
|
+
return null;
|
|
109
77
|
}
|
|
110
78
|
if (isCoreIcon(icon)) {
|
|
111
79
|
var color;
|
|
@@ -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: "46.
|
|
15
|
+
packageVersion: "46.15.0",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v3.0.4 */
|
|
2
|
-
import
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
var _excluded = ["onOpenChange"];
|
|
4
5
|
import "./index.compiled.css";
|
|
5
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
-
import React, { lazy, Suspense,
|
|
7
|
+
import React, { lazy, Suspense, useEffect } from 'react';
|
|
8
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
7
9
|
import { defineMessages, FormattedMessage } from 'react-intl';
|
|
8
10
|
import Button from '@atlaskit/button/default/button';
|
|
9
11
|
import Heading from '@atlaskit/heading/heading';
|
|
10
|
-
import {
|
|
12
|
+
import { ChoreographedContent } from '@atlaskit/link-provider/choreographed-content';
|
|
11
13
|
import ModalBody from '@atlaskit/modal-dialog/modal-body';
|
|
12
14
|
import Modal from '@atlaskit/modal-dialog/modal-dialog';
|
|
13
15
|
import ModalTitle from '@atlaskit/modal-dialog/modal-title';
|
|
14
16
|
import ModalTransition from '@atlaskit/modal-dialog/modal-transition';
|
|
15
|
-
import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
16
17
|
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
17
18
|
import { Flex } from '@atlaskit/primitives/compiled/flex';
|
|
18
19
|
import { Stack } from '@atlaskit/primitives/compiled/stack';
|
|
19
20
|
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
20
|
-
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
21
21
|
import { messages as smartCardMessages } from '../../messages';
|
|
22
|
-
import { getExtensionKey, getServices } from '../../state/helpers';
|
|
23
|
-
import useSocialProof from '../../state/hooks/use-social-proof';
|
|
24
|
-
import { useSmartLink } from '../../state/hooks/useSmartLink';
|
|
25
|
-
import { preAuthValuePropositionModalService } from '../../state/services/pre-auth-value-proposition-modal';
|
|
26
22
|
import { SmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
|
|
27
23
|
import ImageIcon from '../common/image-icon';
|
|
24
|
+
import { SMART_LINK_MODAL_ID, usePreAuthValuePropositionModal } from './use-pre-auth-value-proposition-modal';
|
|
28
25
|
var IllustrationPane = /*#__PURE__*/lazy(function () {
|
|
29
26
|
return import( /* webpackChunkName: "@atlaskit-internal_smart-card-pre-auth-value-proposition-illustration" */'./IllustrationPane');
|
|
30
27
|
});
|
|
31
28
|
var SOCIAL_PROOF_TEAM_PREVIEW_THRESHOLD = 30;
|
|
32
|
-
var SMART_LINK_MODAL_ID = 'pre-auth-value-proposition-modal';
|
|
33
29
|
var messages = defineMessages({
|
|
34
30
|
close: {
|
|
35
31
|
id: 'smart-card.view.PreAuthValuePropositionModal.close',
|
|
@@ -77,9 +73,6 @@ var bold = function bold(chunks) {
|
|
|
77
73
|
as: "strong"
|
|
78
74
|
}, chunks);
|
|
79
75
|
};
|
|
80
|
-
var getModalCloseMethod = function getModalCloseMethod(event) {
|
|
81
|
-
return 'key' in event && event.key === 'Escape' ? 'escape' : 'overlay';
|
|
82
|
-
};
|
|
83
76
|
var ModalCopy = function ModalCopy(_ref) {
|
|
84
77
|
var connectedPct = _ref.connectedPct,
|
|
85
78
|
isSocialProofAvailable = _ref.isSocialProofAvailable,
|
|
@@ -171,40 +164,26 @@ var ModalCopy = function ModalCopy(_ref) {
|
|
|
171
164
|
onClick: onClose
|
|
172
165
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.close))))));
|
|
173
166
|
};
|
|
174
|
-
|
|
167
|
+
|
|
168
|
+
/** Mounted only while the existing choreographer grants permission. */
|
|
169
|
+
var ModalContent = function ModalContent(_ref2) {
|
|
175
170
|
var _provider$iconLabel;
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
var _useState = useState(false),
|
|
186
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
187
|
-
isOpen = _useState2[0],
|
|
188
|
-
setIsOpen = _useState2[1];
|
|
189
|
-
var _useState3 = useState('modal_text_only'),
|
|
190
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
191
|
-
visibleVariant = _useState4[0],
|
|
192
|
-
setVisibleVariant = _useState4[1];
|
|
193
|
-
var modalOpenTimeRef = useRef(Date.now());
|
|
194
|
-
var provider = useMemo(function () {
|
|
195
|
-
return extractSmartLinkProvider(state.details);
|
|
196
|
-
}, [state.details]);
|
|
197
|
-
var providerName = provider === null || provider === void 0 ? void 0 : provider.text;
|
|
198
|
-
var isVisible = isOpen && Boolean(providerName);
|
|
171
|
+
var provider = _ref2.provider,
|
|
172
|
+
variant = _ref2.variant,
|
|
173
|
+
connectedPct = _ref2.connectedPct,
|
|
174
|
+
isSocialProofAvailable = _ref2.isSocialProofAvailable,
|
|
175
|
+
onClose = _ref2.onClose,
|
|
176
|
+
onCloseButton = _ref2.onCloseButton,
|
|
177
|
+
onConnect = _ref2.onConnect,
|
|
178
|
+
onOpenComplete = _ref2.onOpenComplete,
|
|
179
|
+
onOpenChange = _ref2.onOpenChange;
|
|
199
180
|
useEffect(function () {
|
|
200
|
-
if (!isVisible) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
181
|
onOpenChange === null || onOpenChange === void 0 || onOpenChange(true);
|
|
204
182
|
return function () {
|
|
205
183
|
return onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
|
|
206
184
|
};
|
|
207
|
-
}, [
|
|
185
|
+
}, [onOpenChange]);
|
|
186
|
+
var providerName = provider === null || provider === void 0 ? void 0 : provider.text;
|
|
208
187
|
var providerIconUrl = typeof (provider === null || provider === void 0 ? void 0 : provider.icon) === 'string' ? provider.icon : undefined;
|
|
209
188
|
var renderProviderIcon = function renderProviderIcon(size, testId, label) {
|
|
210
189
|
if (providerIconUrl) {
|
|
@@ -221,69 +200,18 @@ var PreAuthValuePropositionModalContent = function PreAuthValuePropositionModalC
|
|
|
221
200
|
return provider === null || provider === void 0 ? void 0 : provider.icon;
|
|
222
201
|
};
|
|
223
202
|
var providerIcon = renderProviderIcon(24, 'pre-auth-value-proposition-modal-provider-icon', (_provider$iconLabel = provider === null || provider === void 0 ? void 0 : provider.iconLabel) !== null && _provider$iconLabel !== void 0 ? _provider$iconLabel : providerName);
|
|
224
|
-
var services = getServices(state.details);
|
|
225
|
-
var extensionKey = getExtensionKey(state.details);
|
|
226
|
-
var _useSocialProof = useSocialProof(extensionKey, true),
|
|
227
|
-
connectedPct = _useSocialProof.connectedPct,
|
|
228
|
-
isSocialProofAvailable = _useSocialProof.isEnabled;
|
|
229
|
-
var hasSupportedAuthorization = (config === null || config === void 0 ? void 0 : config.authFlow) !== 'disabled' && services.length > 0;
|
|
230
|
-
var isBaseEligible = state.status === 'unauthorized' && Boolean(providerName) && Boolean(extensionKey) && hasSupportedAuthorization;
|
|
231
|
-
useEffect(function () {
|
|
232
|
-
if (state.status === 'pending' || state.status === 'resolving') {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
if (!isBaseEligible || !extensionKey || preAuthValuePropositionModalService.hasReachedShowLimit(extensionKey)) {
|
|
236
|
-
onFinished();
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
var experimentVariant = expVal('platform_sl_3p_preauth_value_modal', 'variant', 'control');
|
|
240
|
-
if (experimentVariant === 'modal_text_only' || experimentVariant === 'modal_with_image') {
|
|
241
|
-
preAuthValuePropositionModalService.recordShow(extensionKey);
|
|
242
|
-
setVisibleVariant(experimentVariant);
|
|
243
|
-
setIsOpen(true);
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
onFinished();
|
|
247
|
-
}, [extensionKey, isBaseEligible, onFinished, state.status]);
|
|
248
|
-
var dismissModal = useCallback(function (closeMethod) {
|
|
249
|
-
fireEvent('ui.modal.closed.preAuthValueProposition', {
|
|
250
|
-
closeMethod: closeMethod,
|
|
251
|
-
dwellTime: Date.now() - modalOpenTimeRef.current
|
|
252
|
-
});
|
|
253
|
-
setIsOpen(false);
|
|
254
|
-
onFinished();
|
|
255
|
-
}, [fireEvent, onFinished]);
|
|
256
|
-
var handleCloseButton = useCallback(function () {
|
|
257
|
-
dismissModal('button');
|
|
258
|
-
}, [dismissModal]);
|
|
259
|
-
var handleModalClose = useCallback(function (event) {
|
|
260
|
-
dismissModal(getModalCloseMethod(event));
|
|
261
|
-
}, [dismissModal]);
|
|
262
|
-
var handleOpenComplete = useCallback(function () {
|
|
263
|
-
modalOpenTimeRef.current = Date.now();
|
|
264
|
-
fireEvent('ui.modal.opened.preAuthValueProposition', {});
|
|
265
|
-
}, [fireEvent]);
|
|
266
|
-
var connectAccount = useCallback(function () {
|
|
267
|
-
fireEvent('track.applicationAccount.authStarted', {});
|
|
268
|
-
setIsOpen(false);
|
|
269
|
-
actions.authorize('inline');
|
|
270
|
-
onFinished();
|
|
271
|
-
}, [actions, fireEvent, onFinished]);
|
|
272
|
-
if (!isOpen || !providerName) {
|
|
273
|
-
return null;
|
|
274
|
-
}
|
|
275
203
|
var modalCopy = /*#__PURE__*/React.createElement(ModalCopy, {
|
|
276
204
|
connectedPct: connectedPct,
|
|
277
205
|
isSocialProofAvailable: isSocialProofAvailable,
|
|
278
|
-
onClose:
|
|
279
|
-
onConnect:
|
|
206
|
+
onClose: onCloseButton,
|
|
207
|
+
onConnect: onConnect,
|
|
280
208
|
providerIcon: providerIcon,
|
|
281
|
-
providerName: providerName
|
|
209
|
+
providerName: providerName !== null && providerName !== void 0 ? providerName : ''
|
|
282
210
|
});
|
|
283
|
-
var showIllustration =
|
|
284
|
-
|
|
285
|
-
onClose:
|
|
286
|
-
onOpenComplete:
|
|
211
|
+
var showIllustration = variant === 'modal_with_image';
|
|
212
|
+
var modal = providerName ? /*#__PURE__*/React.createElement(ModalTransition, null, /*#__PURE__*/React.createElement(Modal, {
|
|
213
|
+
onClose: onClose,
|
|
214
|
+
onOpenComplete: onOpenComplete,
|
|
287
215
|
testId: "pre-auth-value-proposition-modal",
|
|
288
216
|
width: showIllustration ? 800 : 400
|
|
289
217
|
}, showIllustration ? /*#__PURE__*/React.createElement(Box, {
|
|
@@ -294,20 +222,38 @@ var PreAuthValuePropositionModalContent = function PreAuthValuePropositionModalC
|
|
|
294
222
|
fallback: null
|
|
295
223
|
}, /*#__PURE__*/React.createElement(IllustrationPane, {
|
|
296
224
|
renderProviderIcon: renderProviderIcon
|
|
297
|
-
}))) : modalCopy));
|
|
225
|
+
}))) : modalCopy)) : null;
|
|
226
|
+
return modal;
|
|
227
|
+
};
|
|
228
|
+
var PreAuthValuePropositionModalContent = function PreAuthValuePropositionModalContent(_ref3) {
|
|
229
|
+
var onOpenChange = _ref3.onOpenChange,
|
|
230
|
+
options = _objectWithoutProperties(_ref3, _excluded);
|
|
231
|
+
var _usePreAuthValuePropo = usePreAuthValuePropositionModal(options),
|
|
232
|
+
isActive = _usePreAuthValuePropo.isActive,
|
|
233
|
+
isEligible = _usePreAuthValuePropo.isEligible,
|
|
234
|
+
onUnavailable = _usePreAuthValuePropo.onUnavailable,
|
|
235
|
+
shouldClaim = _usePreAuthValuePropo.shouldClaim,
|
|
236
|
+
modal = _usePreAuthValuePropo.modal;
|
|
237
|
+
return /*#__PURE__*/React.createElement(ChoreographedContent, {
|
|
238
|
+
messageId: "smart-link-pre-auth-value-proposition-modal",
|
|
239
|
+
isActive: isActive,
|
|
240
|
+
onUnavailable: onUnavailable,
|
|
241
|
+
shouldClaim: shouldClaim
|
|
242
|
+
}, function (_ref4) {
|
|
243
|
+
var hasPermission = _ref4.hasPermission;
|
|
244
|
+
return hasPermission && isEligible ? /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
245
|
+
fallback: null,
|
|
246
|
+
onError: onUnavailable
|
|
247
|
+
}, /*#__PURE__*/React.createElement(ModalContent, _extends({}, modal, {
|
|
248
|
+
onOpenChange: onOpenChange
|
|
249
|
+
}))) : null;
|
|
250
|
+
});
|
|
298
251
|
};
|
|
299
|
-
export var PreAuthValuePropositionModal = function PreAuthValuePropositionModal(
|
|
300
|
-
var onFinished = _ref3.onFinished,
|
|
301
|
-
onOpenChange = _ref3.onOpenChange,
|
|
302
|
-
url = _ref3.url;
|
|
252
|
+
export var PreAuthValuePropositionModal = function PreAuthValuePropositionModal(props) {
|
|
303
253
|
return /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
|
|
304
254
|
display: "inline",
|
|
305
255
|
id: SMART_LINK_MODAL_ID,
|
|
306
256
|
source: "preAuthValuePropositionModal",
|
|
307
|
-
url: url
|
|
308
|
-
}, /*#__PURE__*/React.createElement(PreAuthValuePropositionModalContent,
|
|
309
|
-
onFinished: onFinished,
|
|
310
|
-
onOpenChange: onOpenChange,
|
|
311
|
-
url: url
|
|
312
|
-
}));
|
|
257
|
+
url: props.url
|
|
258
|
+
}, /*#__PURE__*/React.createElement(PreAuthValuePropositionModalContent, props));
|
|
313
259
|
};
|