@atlaskit/smart-card 42.3.4 → 43.0.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 +19 -0
- package/analytics.spec.yaml +63 -7
- package/dist/cjs/state/actions/index.js +6 -8
- package/dist/cjs/state/hooks/useSmartLink.js +3 -3
- package/dist/cjs/state/store/index.js +1 -5
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +15 -14
- package/dist/cjs/view/FlexibleCard/index.js +13 -5
- package/dist/cjs/view/LinkUrl/HyperlinkResolver/index.js +5 -32
- package/dist/cjs/view/LinkUrl/HyperlinkResolver/unauthorize-view.js +11 -15
- package/dist/cjs/view/LinkUrl/index.js +23 -30
- package/dist/es2019/state/actions/index.js +4 -6
- package/dist/es2019/state/hooks/useSmartLink.js +3 -3
- package/dist/es2019/state/store/index.js +1 -5
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +15 -14
- package/dist/es2019/view/FlexibleCard/index.js +12 -5
- package/dist/es2019/view/LinkUrl/HyperlinkResolver/index.js +5 -32
- package/dist/es2019/view/LinkUrl/HyperlinkResolver/unauthorize-view.js +4 -4
- package/dist/es2019/view/LinkUrl/index.js +23 -28
- package/dist/esm/state/actions/index.js +6 -8
- package/dist/esm/state/hooks/useSmartLink.js +3 -3
- package/dist/esm/state/store/index.js +1 -5
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +15 -14
- package/dist/esm/view/FlexibleCard/index.js +12 -5
- package/dist/esm/view/LinkUrl/HyperlinkResolver/index.js +5 -32
- package/dist/esm/view/LinkUrl/HyperlinkResolver/unauthorize-view.js +11 -13
- package/dist/esm/view/LinkUrl/index.js +23 -28
- package/dist/types/common/analytics/generated/analytics.types.d.ts +29 -29
- package/dist/types/state/actions/index.d.ts +1 -2
- package/dist/types/state/hooks/useSmartLink.d.ts +2 -3
- package/dist/types/state/store/index.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/index.d.ts +13 -1
- package/dist/types/view/LinkUrl/HyperlinkResolver/index.d.ts +0 -5
- package/dist/types/view/LinkUrl/HyperlinkResolver/unauthorize-view.d.ts +2 -1
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +29 -29
- package/dist/types-ts4.5/state/actions/index.d.ts +1 -2
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +2 -3
- package/dist/types-ts4.5/state/store/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/index.d.ts +13 -1
- package/dist/types-ts4.5/view/LinkUrl/HyperlinkResolver/index.d.ts +0 -5
- package/dist/types-ts4.5/view/LinkUrl/HyperlinkResolver/unauthorize-view.d.ts +2 -1
- package/package.json +4 -7
- package/dist/cjs/view/LinkUrl/HyperlinkResolver/error-boundary.js +0 -18
- package/dist/cjs/view/LinkUrl/HyperlinkResolver/resolve-hyperlink.js +0 -70
- package/dist/es2019/view/LinkUrl/HyperlinkResolver/error-boundary.js +0 -9
- package/dist/es2019/view/LinkUrl/HyperlinkResolver/resolve-hyperlink.js +0 -60
- package/dist/esm/view/LinkUrl/HyperlinkResolver/error-boundary.js +0 -11
- package/dist/esm/view/LinkUrl/HyperlinkResolver/resolve-hyperlink.js +0 -62
- package/dist/types/view/LinkUrl/HyperlinkResolver/error-boundary.d.ts +0 -4
- package/dist/types/view/LinkUrl/HyperlinkResolver/resolve-hyperlink.d.ts +0 -3
- package/dist/types-ts4.5/view/LinkUrl/HyperlinkResolver/error-boundary.d.ts +0 -4
- package/dist/types-ts4.5/view/LinkUrl/HyperlinkResolver/resolve-hyperlink.d.ts +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["onAuthorize", "provider"];
|
|
4
|
-
import React
|
|
3
|
+
var _excluded = ["onAuthorize", "provider", "showConnectBtn"];
|
|
4
|
+
import React from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import { messages } from '../../../messages';
|
|
7
7
|
import { ActionButton } from '../../InlineCard/common/action-button';
|
|
@@ -9,17 +9,15 @@ import Hyperlink from '../Hyperlink';
|
|
|
9
9
|
var HyperlinkUnauthorizedView = function HyperlinkUnauthorizedView(_ref) {
|
|
10
10
|
var onAuthorize = _ref.onAuthorize,
|
|
11
11
|
provider = _ref.provider,
|
|
12
|
+
showConnectBtn = _ref.showConnectBtn,
|
|
12
13
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}))) : null;
|
|
22
|
-
}, [onAuthorize, provider === null || provider === void 0 ? void 0 : provider.text]);
|
|
23
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Hyperlink, props), actionButton);
|
|
14
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Hyperlink, props), showConnectBtn && /*#__PURE__*/React.createElement(React.Fragment, null, ' ', /*#__PURE__*/React.createElement(ActionButton, {
|
|
15
|
+
onClick: onAuthorize,
|
|
16
|
+
testId: "button-connect-account"
|
|
17
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_link_account_card_name, {
|
|
18
|
+
values: {
|
|
19
|
+
context: provider === null || provider === void 0 ? void 0 : provider.text
|
|
20
|
+
}
|
|
21
|
+
})))));
|
|
24
22
|
};
|
|
25
23
|
export default HyperlinkUnauthorizedView;
|
|
@@ -7,16 +7,15 @@ import { di } from 'react-magnetic-di';
|
|
|
7
7
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
8
8
|
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
9
9
|
import AKLink from '@atlaskit/link';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { withLinkClickedEvent } from '../../utils/analytics/click';
|
|
12
11
|
import { LinkAnalyticsContext } from '../../utils/analytics/LinkAnalyticsContext';
|
|
13
12
|
import Hyperlink from './Hyperlink';
|
|
14
|
-
import
|
|
13
|
+
import { HyperlinkWithSmartLinkResolver } from './HyperlinkResolver';
|
|
15
14
|
import LinkWarningModal from './LinkWarningModal';
|
|
16
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
17
16
|
var PACKAGE_DATA = {
|
|
18
17
|
packageName: "@atlaskit/smart-card",
|
|
19
|
-
packageVersion: "
|
|
18
|
+
packageVersion: "42.3.5",
|
|
20
19
|
componentName: 'linkUrl'
|
|
21
20
|
};
|
|
22
21
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -39,30 +38,28 @@ var LinkUrl = function LinkUrl(_ref) {
|
|
|
39
38
|
showSafetyWarningModal = _useLinkWarningModal.showSafetyWarningModal,
|
|
40
39
|
linkWarningModalProps = _objectWithoutProperties(_useLinkWarningModal, _excluded2);
|
|
41
40
|
var resolveHyperlinkFG = FeatureGates.checkGate('platform_editor_resolve_hyperlinks_killswitch');
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
41
|
+
if (resolveHyperlinkFG) {
|
|
42
|
+
var _Link = enableResolve ? HyperlinkWithSmartLinkResolver : Hyperlink;
|
|
43
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LinkAnalyticsContext, {
|
|
44
|
+
url: href,
|
|
45
|
+
display: "url"
|
|
46
|
+
}, /*#__PURE__*/React.createElement(_Link, _extends({
|
|
47
|
+
href: href,
|
|
48
|
+
isLinkComponent: isLinkComponent,
|
|
49
|
+
onClick: function onClick(e) {
|
|
50
|
+
if (!checkSafety) {
|
|
51
|
+
_onClick && _onClick(e);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
55
|
+
// Only call the onClick if the link is safe
|
|
56
|
+
if (isLinkSafe(e, href)) {
|
|
57
|
+
_onClick && _onClick(e);
|
|
58
|
+
} else {
|
|
59
|
+
showSafetyWarningModal(e, href);
|
|
63
60
|
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
61
|
+
}
|
|
62
|
+
}, props), children)), checkSafety && /*#__PURE__*/React.createElement(LinkWarningModal, linkWarningModalProps));
|
|
66
63
|
}
|
|
67
64
|
var Link = isLinkComponent ? LinkComponent : Anchor;
|
|
68
65
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LinkAnalyticsContext, {
|
|
@@ -87,8 +84,6 @@ var LinkUrl = function LinkUrl(_ref) {
|
|
|
87
84
|
showSafetyWarningModal(e, href);
|
|
88
85
|
}
|
|
89
86
|
}
|
|
90
|
-
}, props), children)), checkSafety && /*#__PURE__*/React.createElement(LinkWarningModal, linkWarningModalProps)
|
|
91
|
-
href: href
|
|
92
|
-
}));
|
|
87
|
+
}, props), children)), checkSafety && /*#__PURE__*/React.createElement(LinkWarningModal, linkWarningModalProps));
|
|
93
88
|
};
|
|
94
89
|
export default withAnalyticsContext(PACKAGE_DATA)(LinkUrl);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::a9e05f4749fe4c5f7aaded5bdf6a8822>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataContextType = {
|
|
@@ -37,35 +37,35 @@ export type ButtonClickedCopyLinkAttributesType = {
|
|
|
37
37
|
actionType: string | null;
|
|
38
38
|
id: string | null;
|
|
39
39
|
definitionId: string | null;
|
|
40
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
40
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
41
41
|
resourceType: string | null;
|
|
42
42
|
};
|
|
43
43
|
export type ButtonClickedDownloadDocumentAttributesType = {
|
|
44
44
|
actionType: string | null;
|
|
45
45
|
id: string | null;
|
|
46
46
|
definitionId: string | null;
|
|
47
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
47
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
48
48
|
resourceType: string | null;
|
|
49
49
|
};
|
|
50
50
|
export type ButtonClickedInvokePreviewScreenAttributesType = {
|
|
51
51
|
actionType: string | null;
|
|
52
52
|
id: string | null;
|
|
53
53
|
definitionId: string | null;
|
|
54
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
54
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
55
55
|
resourceType: string | null;
|
|
56
56
|
};
|
|
57
57
|
export type ButtonClickedShortcutGoToLinkAttributesType = {
|
|
58
58
|
actionType: string | null;
|
|
59
59
|
id: string | null;
|
|
60
60
|
definitionId: string | null;
|
|
61
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
61
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
62
62
|
resourceType: string | null;
|
|
63
63
|
};
|
|
64
64
|
export type ButtonClickedIssueStatusUpdateAttributesType = {
|
|
65
65
|
actionType: string | null;
|
|
66
66
|
id: string | null;
|
|
67
67
|
definitionId: string | null;
|
|
68
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
68
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
69
69
|
resourceType: string | null;
|
|
70
70
|
};
|
|
71
71
|
export type ButtonClickedAiSummaryAttributesType = {};
|
|
@@ -99,14 +99,14 @@ export type RelatedLinksFailedAttributesType = {
|
|
|
99
99
|
};
|
|
100
100
|
export type SmartLinkIframeDwelledAttributesType = {
|
|
101
101
|
id: string;
|
|
102
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
102
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
103
103
|
definitionId: string | null;
|
|
104
104
|
dwellTime: number;
|
|
105
105
|
dwellPercentVisible: number;
|
|
106
106
|
};
|
|
107
107
|
export type SmartLinkIframeFocusedAttributesType = {
|
|
108
108
|
id: string;
|
|
109
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
109
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
110
110
|
definitionId: string | null;
|
|
111
111
|
};
|
|
112
112
|
export type ApplicationAccountConnectedAttributesType = {
|
|
@@ -147,7 +147,7 @@ export type SmartLinkUnresolvedAttributesType = {
|
|
|
147
147
|
reason: string;
|
|
148
148
|
};
|
|
149
149
|
export type SmartLinkChunkLoadFailedAttributesType = {
|
|
150
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
150
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
151
151
|
definitionId: string | null;
|
|
152
152
|
error: Record<string, unknown>;
|
|
153
153
|
errorInfo: Record<string, unknown>;
|
|
@@ -156,7 +156,7 @@ export type SmartLinkActionResolvedAttributesType = {
|
|
|
156
156
|
actionType: string | null;
|
|
157
157
|
id: string | null;
|
|
158
158
|
definitionId: string | null;
|
|
159
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
159
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
160
160
|
resourceType: string | null;
|
|
161
161
|
duration: number | null;
|
|
162
162
|
};
|
|
@@ -164,23 +164,11 @@ export type SmartLinkActionUnresolvedAttributesType = {
|
|
|
164
164
|
actionType: string | null;
|
|
165
165
|
id: string | null;
|
|
166
166
|
definitionId: string | null;
|
|
167
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
167
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
168
168
|
resourceType: string | null;
|
|
169
169
|
duration: number | null;
|
|
170
170
|
reason: string | null;
|
|
171
171
|
};
|
|
172
|
-
export type SmartLinkClickedAttributesType = {
|
|
173
|
-
id: string;
|
|
174
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
175
|
-
definitionId: string | null;
|
|
176
|
-
isModifierKeyPressed: boolean | null;
|
|
177
|
-
};
|
|
178
|
-
export type SmartLinkClickedTitleGoToLinkAttributesType = {
|
|
179
|
-
id: string;
|
|
180
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
181
|
-
definitionId: string | null;
|
|
182
|
-
isModifierKeyPressed: boolean | null;
|
|
183
|
-
};
|
|
184
172
|
export type HyperlinkResolvedAttributesType = {
|
|
185
173
|
definitionId: string | null;
|
|
186
174
|
extensionKey: string | null;
|
|
@@ -191,8 +179,20 @@ export type HyperlinkUnresolvedAttributesType = {
|
|
|
191
179
|
definitionId: string | null;
|
|
192
180
|
extensionKey: string | null;
|
|
193
181
|
resourceType: string | null;
|
|
182
|
+
reason: string | null;
|
|
194
183
|
error: Record<string, unknown> | null;
|
|
195
|
-
|
|
184
|
+
};
|
|
185
|
+
export type SmartLinkClickedAttributesType = {
|
|
186
|
+
id: string;
|
|
187
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
188
|
+
definitionId: string | null;
|
|
189
|
+
isModifierKeyPressed: boolean | null;
|
|
190
|
+
};
|
|
191
|
+
export type SmartLinkClickedTitleGoToLinkAttributesType = {
|
|
192
|
+
id: string;
|
|
193
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
194
|
+
definitionId: string | null;
|
|
195
|
+
isModifierKeyPressed: boolean | null;
|
|
196
196
|
};
|
|
197
197
|
export type SmartLinkClickedPreviewHoverCardAttributesType = {
|
|
198
198
|
id: string;
|
|
@@ -211,15 +211,15 @@ export type HoverCardDismissedAttributesType = {
|
|
|
211
211
|
definitionId: string | null;
|
|
212
212
|
};
|
|
213
213
|
export type ButtonClickedConnectAccountAttributesType = {
|
|
214
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
214
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
215
215
|
definitionId: string | null;
|
|
216
216
|
};
|
|
217
217
|
export type SmartLinkClickedTryAnotherAccountAttributesType = {
|
|
218
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
218
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
219
219
|
definitionId: string | null;
|
|
220
220
|
};
|
|
221
221
|
export type ConsentModalClosedAttributesType = {
|
|
222
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
222
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
223
223
|
definitionId: string | null;
|
|
224
224
|
};
|
|
225
225
|
export type ModalClosedEmbedPreviewAttributesType = {
|
|
@@ -358,10 +358,10 @@ export type AnalyticsEventAttributes = {
|
|
|
358
358
|
* Fires an event when a Smart Link action is failed to resolved. */
|
|
359
359
|
'operational.smartLinkAction.unresolved': SmartLinkActionUnresolvedAttributesType;
|
|
360
360
|
/**
|
|
361
|
-
* Fires an event when a
|
|
361
|
+
* Fires an event when a hyperlink is successfully resolved. */
|
|
362
362
|
'operational.hyperlink.resolved': HyperlinkResolvedAttributesType;
|
|
363
363
|
/**
|
|
364
|
-
* Fires an event when a
|
|
364
|
+
* Fires an event when a hyperlink fails to resolve. */
|
|
365
365
|
'operational.hyperlink.unresolved': HyperlinkUnresolvedAttributesType;
|
|
366
366
|
/**
|
|
367
367
|
* fires an event that represents when a user clicks on a Smart Link. */
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type JsonLd } from '@atlaskit/json-ld-types';
|
|
2
|
-
import { type CardState } from '@atlaskit/linking-common';
|
|
3
2
|
import { type InvokeClientOpts, type InvokeServerOpts } from '../../model/invoke-opts';
|
|
4
3
|
import { type CardInnerAppearance } from '../../view/Card/types';
|
|
5
|
-
export declare const useSmartCardActions: (id: string, url: string
|
|
4
|
+
export declare const useSmartCardActions: (id: string, url: string) => {
|
|
6
5
|
register: () => Promise<void>;
|
|
7
6
|
reload: () => void;
|
|
8
7
|
authorize: (appearance: CardInnerAppearance) => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
state: CardState;
|
|
1
|
+
export declare function useSmartLink(id: string, url: string): {
|
|
2
|
+
state: import("@atlaskit/linking-common").CardState;
|
|
4
3
|
actions: {
|
|
5
4
|
register: () => Promise<void>;
|
|
6
5
|
reload: () => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type CardState } from '@atlaskit/linking-common';
|
|
2
2
|
export type { CardType } from '@atlaskit/linking-common';
|
|
3
|
-
export declare function useSmartCardState(url: string
|
|
3
|
+
export declare function useSmartCardState(url: string): CardState;
|
|
@@ -7,7 +7,7 @@ import { type FlexibleUiOptions } from '../FlexibleCard/types';
|
|
|
7
7
|
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
8
8
|
import { type InlinePreloaderStyle, type OnErrorCallback } from '../types';
|
|
9
9
|
export type { CardAppearance, CardPlatform };
|
|
10
|
-
export type CardInnerAppearance = CardAppearance | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
10
|
+
export type CardInnerAppearance = CardAppearance | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
11
11
|
export type EmbedIframeUrlType = 'href' | 'interactiveHref';
|
|
12
12
|
export type OnResolveCallback = (data: {
|
|
13
13
|
aspectRatio?: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { CardState } from '@atlaskit/linking-common';
|
|
2
3
|
import { type FlexibleCardProps } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* This represents a Flexible Card: a link represented by a card with metadata.
|
|
@@ -6,5 +7,16 @@ import { type FlexibleCardProps } from './types';
|
|
|
6
7
|
* Note: TitleBlock is mandatory for a Flexible Card to render.
|
|
7
8
|
* @see Container
|
|
8
9
|
*/
|
|
9
|
-
declare const FlexibleCard: ({ appearance, cardState, children, id, onAuthorize, onClick, onError, onResolve, origin, renderers, showHoverPreview, hoverPreviewOptions, actionOptions, testId, ui, url, }: FlexibleCardProps
|
|
10
|
+
declare const FlexibleCard: ({ appearance, cardState, placeholderData, children, id, onAuthorize, onClick, onError, onResolve, origin, renderers, showHoverPreview, hoverPreviewOptions, actionOptions, testId, ui, url, }: FlexibleCardProps & {
|
|
11
|
+
/**
|
|
12
|
+
* @experimental
|
|
13
|
+
* This is a new prop that is not part of the public API - DO NOT USE.
|
|
14
|
+
* If provided, the card will display using the respective object for the first render (particularly useful for SSR),
|
|
15
|
+
* while still resolving `url` in the background.
|
|
16
|
+
* Placeholder data should be considered a transient state - in the sense that it will not persisted to the main store -
|
|
17
|
+
* and it will be replaced by the actual data when the given `url` is resolved.
|
|
18
|
+
* ANIP-288: Expose this prop to the public API
|
|
19
|
+
*/
|
|
20
|
+
placeholderData?: CardState;
|
|
21
|
+
}) => React.JSX.Element;
|
|
10
22
|
export default FlexibleCard;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { LinkUrlProps } from '../types';
|
|
3
3
|
export declare const HyperlinkWithSmartLinkResolver: React.ForwardRefExoticComponent<LinkUrlProps & React.RefAttributes<any>>;
|
|
4
|
-
export interface HyperlinkResolverProps {
|
|
5
|
-
href: string;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: (props: HyperlinkResolverProps) => React.JSX.Element;
|
|
8
|
-
export default _default;
|
|
@@ -4,6 +4,7 @@ import type { LinkUrlProps } from '../types';
|
|
|
4
4
|
type HyperlinkUnauthorizedViewProps = LinkUrlProps & {
|
|
5
5
|
onAuthorize?: () => void;
|
|
6
6
|
provider?: LinkProvider;
|
|
7
|
+
showConnectBtn?: boolean;
|
|
7
8
|
};
|
|
8
|
-
declare const HyperlinkUnauthorizedView: ({ onAuthorize, provider, ...props }: HyperlinkUnauthorizedViewProps) => React.JSX.Element;
|
|
9
|
+
declare const HyperlinkUnauthorizedView: ({ onAuthorize, provider, showConnectBtn, ...props }: HyperlinkUnauthorizedViewProps) => React.JSX.Element;
|
|
9
10
|
export default HyperlinkUnauthorizedView;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::a9e05f4749fe4c5f7aaded5bdf6a8822>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataContextType = {
|
|
@@ -37,35 +37,35 @@ export type ButtonClickedCopyLinkAttributesType = {
|
|
|
37
37
|
actionType: string | null;
|
|
38
38
|
id: string | null;
|
|
39
39
|
definitionId: string | null;
|
|
40
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
40
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
41
41
|
resourceType: string | null;
|
|
42
42
|
};
|
|
43
43
|
export type ButtonClickedDownloadDocumentAttributesType = {
|
|
44
44
|
actionType: string | null;
|
|
45
45
|
id: string | null;
|
|
46
46
|
definitionId: string | null;
|
|
47
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
47
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
48
48
|
resourceType: string | null;
|
|
49
49
|
};
|
|
50
50
|
export type ButtonClickedInvokePreviewScreenAttributesType = {
|
|
51
51
|
actionType: string | null;
|
|
52
52
|
id: string | null;
|
|
53
53
|
definitionId: string | null;
|
|
54
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
54
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
55
55
|
resourceType: string | null;
|
|
56
56
|
};
|
|
57
57
|
export type ButtonClickedShortcutGoToLinkAttributesType = {
|
|
58
58
|
actionType: string | null;
|
|
59
59
|
id: string | null;
|
|
60
60
|
definitionId: string | null;
|
|
61
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
61
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
62
62
|
resourceType: string | null;
|
|
63
63
|
};
|
|
64
64
|
export type ButtonClickedIssueStatusUpdateAttributesType = {
|
|
65
65
|
actionType: string | null;
|
|
66
66
|
id: string | null;
|
|
67
67
|
definitionId: string | null;
|
|
68
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
68
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
69
69
|
resourceType: string | null;
|
|
70
70
|
};
|
|
71
71
|
export type ButtonClickedAiSummaryAttributesType = {};
|
|
@@ -99,14 +99,14 @@ export type RelatedLinksFailedAttributesType = {
|
|
|
99
99
|
};
|
|
100
100
|
export type SmartLinkIframeDwelledAttributesType = {
|
|
101
101
|
id: string;
|
|
102
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
102
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
103
103
|
definitionId: string | null;
|
|
104
104
|
dwellTime: number;
|
|
105
105
|
dwellPercentVisible: number;
|
|
106
106
|
};
|
|
107
107
|
export type SmartLinkIframeFocusedAttributesType = {
|
|
108
108
|
id: string;
|
|
109
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
109
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
110
110
|
definitionId: string | null;
|
|
111
111
|
};
|
|
112
112
|
export type ApplicationAccountConnectedAttributesType = {
|
|
@@ -147,7 +147,7 @@ export type SmartLinkUnresolvedAttributesType = {
|
|
|
147
147
|
reason: string;
|
|
148
148
|
};
|
|
149
149
|
export type SmartLinkChunkLoadFailedAttributesType = {
|
|
150
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
150
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
151
151
|
definitionId: string | null;
|
|
152
152
|
error: Record<string, unknown>;
|
|
153
153
|
errorInfo: Record<string, unknown>;
|
|
@@ -156,7 +156,7 @@ export type SmartLinkActionResolvedAttributesType = {
|
|
|
156
156
|
actionType: string | null;
|
|
157
157
|
id: string | null;
|
|
158
158
|
definitionId: string | null;
|
|
159
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
159
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
160
160
|
resourceType: string | null;
|
|
161
161
|
duration: number | null;
|
|
162
162
|
};
|
|
@@ -164,23 +164,11 @@ export type SmartLinkActionUnresolvedAttributesType = {
|
|
|
164
164
|
actionType: string | null;
|
|
165
165
|
id: string | null;
|
|
166
166
|
definitionId: string | null;
|
|
167
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
167
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink' | null;
|
|
168
168
|
resourceType: string | null;
|
|
169
169
|
duration: number | null;
|
|
170
170
|
reason: string | null;
|
|
171
171
|
};
|
|
172
|
-
export type SmartLinkClickedAttributesType = {
|
|
173
|
-
id: string;
|
|
174
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
175
|
-
definitionId: string | null;
|
|
176
|
-
isModifierKeyPressed: boolean | null;
|
|
177
|
-
};
|
|
178
|
-
export type SmartLinkClickedTitleGoToLinkAttributesType = {
|
|
179
|
-
id: string;
|
|
180
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
181
|
-
definitionId: string | null;
|
|
182
|
-
isModifierKeyPressed: boolean | null;
|
|
183
|
-
};
|
|
184
172
|
export type HyperlinkResolvedAttributesType = {
|
|
185
173
|
definitionId: string | null;
|
|
186
174
|
extensionKey: string | null;
|
|
@@ -191,8 +179,20 @@ export type HyperlinkUnresolvedAttributesType = {
|
|
|
191
179
|
definitionId: string | null;
|
|
192
180
|
extensionKey: string | null;
|
|
193
181
|
resourceType: string | null;
|
|
182
|
+
reason: string | null;
|
|
194
183
|
error: Record<string, unknown> | null;
|
|
195
|
-
|
|
184
|
+
};
|
|
185
|
+
export type SmartLinkClickedAttributesType = {
|
|
186
|
+
id: string;
|
|
187
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
188
|
+
definitionId: string | null;
|
|
189
|
+
isModifierKeyPressed: boolean | null;
|
|
190
|
+
};
|
|
191
|
+
export type SmartLinkClickedTitleGoToLinkAttributesType = {
|
|
192
|
+
id: string;
|
|
193
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
194
|
+
definitionId: string | null;
|
|
195
|
+
isModifierKeyPressed: boolean | null;
|
|
196
196
|
};
|
|
197
197
|
export type SmartLinkClickedPreviewHoverCardAttributesType = {
|
|
198
198
|
id: string;
|
|
@@ -211,15 +211,15 @@ export type HoverCardDismissedAttributesType = {
|
|
|
211
211
|
definitionId: string | null;
|
|
212
212
|
};
|
|
213
213
|
export type ButtonClickedConnectAccountAttributesType = {
|
|
214
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
214
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
215
215
|
definitionId: string | null;
|
|
216
216
|
};
|
|
217
217
|
export type SmartLinkClickedTryAnotherAccountAttributesType = {
|
|
218
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
218
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
219
219
|
definitionId: string | null;
|
|
220
220
|
};
|
|
221
221
|
export type ConsentModalClosedAttributesType = {
|
|
222
|
-
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
222
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
223
223
|
definitionId: string | null;
|
|
224
224
|
};
|
|
225
225
|
export type ModalClosedEmbedPreviewAttributesType = {
|
|
@@ -358,10 +358,10 @@ export type AnalyticsEventAttributes = {
|
|
|
358
358
|
* Fires an event when a Smart Link action is failed to resolved. */
|
|
359
359
|
'operational.smartLinkAction.unresolved': SmartLinkActionUnresolvedAttributesType;
|
|
360
360
|
/**
|
|
361
|
-
* Fires an event when a
|
|
361
|
+
* Fires an event when a hyperlink is successfully resolved. */
|
|
362
362
|
'operational.hyperlink.resolved': HyperlinkResolvedAttributesType;
|
|
363
363
|
/**
|
|
364
|
-
* Fires an event when a
|
|
364
|
+
* Fires an event when a hyperlink fails to resolve. */
|
|
365
365
|
'operational.hyperlink.unresolved': HyperlinkUnresolvedAttributesType;
|
|
366
366
|
/**
|
|
367
367
|
* fires an event that represents when a user clicks on a Smart Link. */
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type JsonLd } from '@atlaskit/json-ld-types';
|
|
2
|
-
import { type CardState } from '@atlaskit/linking-common';
|
|
3
2
|
import { type InvokeClientOpts, type InvokeServerOpts } from '../../model/invoke-opts';
|
|
4
3
|
import { type CardInnerAppearance } from '../../view/Card/types';
|
|
5
|
-
export declare const useSmartCardActions: (id: string, url: string
|
|
4
|
+
export declare const useSmartCardActions: (id: string, url: string) => {
|
|
6
5
|
register: () => Promise<void>;
|
|
7
6
|
reload: () => void;
|
|
8
7
|
authorize: (appearance: CardInnerAppearance) => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
state: CardState;
|
|
1
|
+
export declare function useSmartLink(id: string, url: string): {
|
|
2
|
+
state: import("@atlaskit/linking-common").CardState;
|
|
4
3
|
actions: {
|
|
5
4
|
register: () => Promise<void>;
|
|
6
5
|
reload: () => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type CardState } from '@atlaskit/linking-common';
|
|
2
2
|
export type { CardType } from '@atlaskit/linking-common';
|
|
3
|
-
export declare function useSmartCardState(url: string
|
|
3
|
+
export declare function useSmartCardState(url: string): CardState;
|
|
@@ -7,7 +7,7 @@ import { type FlexibleUiOptions } from '../FlexibleCard/types';
|
|
|
7
7
|
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
8
8
|
import { type InlinePreloaderStyle, type OnErrorCallback } from '../types';
|
|
9
9
|
export type { CardAppearance, CardPlatform };
|
|
10
|
-
export type CardInnerAppearance = CardAppearance | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
10
|
+
export type CardInnerAppearance = CardAppearance | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'hyperlink';
|
|
11
11
|
export type EmbedIframeUrlType = 'href' | 'interactiveHref';
|
|
12
12
|
export type OnResolveCallback = (data: {
|
|
13
13
|
aspectRatio?: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { CardState } from '@atlaskit/linking-common';
|
|
2
3
|
import { type FlexibleCardProps } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* This represents a Flexible Card: a link represented by a card with metadata.
|
|
@@ -6,5 +7,16 @@ import { type FlexibleCardProps } from './types';
|
|
|
6
7
|
* Note: TitleBlock is mandatory for a Flexible Card to render.
|
|
7
8
|
* @see Container
|
|
8
9
|
*/
|
|
9
|
-
declare const FlexibleCard: ({ appearance, cardState, children, id, onAuthorize, onClick, onError, onResolve, origin, renderers, showHoverPreview, hoverPreviewOptions, actionOptions, testId, ui, url, }: FlexibleCardProps
|
|
10
|
+
declare const FlexibleCard: ({ appearance, cardState, placeholderData, children, id, onAuthorize, onClick, onError, onResolve, origin, renderers, showHoverPreview, hoverPreviewOptions, actionOptions, testId, ui, url, }: FlexibleCardProps & {
|
|
11
|
+
/**
|
|
12
|
+
* @experimental
|
|
13
|
+
* This is a new prop that is not part of the public API - DO NOT USE.
|
|
14
|
+
* If provided, the card will display using the respective object for the first render (particularly useful for SSR),
|
|
15
|
+
* while still resolving `url` in the background.
|
|
16
|
+
* Placeholder data should be considered a transient state - in the sense that it will not persisted to the main store -
|
|
17
|
+
* and it will be replaced by the actual data when the given `url` is resolved.
|
|
18
|
+
* ANIP-288: Expose this prop to the public API
|
|
19
|
+
*/
|
|
20
|
+
placeholderData?: CardState;
|
|
21
|
+
}) => React.JSX.Element;
|
|
10
22
|
export default FlexibleCard;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { LinkUrlProps } from '../types';
|
|
3
3
|
export declare const HyperlinkWithSmartLinkResolver: React.ForwardRefExoticComponent<LinkUrlProps & React.RefAttributes<any>>;
|
|
4
|
-
export interface HyperlinkResolverProps {
|
|
5
|
-
href: string;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: (props: HyperlinkResolverProps) => React.JSX.Element;
|
|
8
|
-
export default _default;
|
|
@@ -4,6 +4,7 @@ import type { LinkUrlProps } from '../types';
|
|
|
4
4
|
type HyperlinkUnauthorizedViewProps = LinkUrlProps & {
|
|
5
5
|
onAuthorize?: () => void;
|
|
6
6
|
provider?: LinkProvider;
|
|
7
|
+
showConnectBtn?: boolean;
|
|
7
8
|
};
|
|
8
|
-
declare const HyperlinkUnauthorizedView: ({ onAuthorize, provider, ...props }: HyperlinkUnauthorizedViewProps) => React.JSX.Element;
|
|
9
|
+
declare const HyperlinkUnauthorizedView: ({ onAuthorize, provider, showConnectBtn, ...props }: HyperlinkUnauthorizedViewProps) => React.JSX.Element;
|
|
9
10
|
export default HyperlinkUnauthorizedView;
|