@atlaskit/smart-card 26.9.8 → 26.9.10
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 +12 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +9 -9
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +3 -26
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +10 -10
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -21
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +9 -9
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +2 -24
- package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +0 -2
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardContent.d.ts +0 -2
- package/package.json +1 -1
- package/tmp/api-report-tmp.d.ts +937 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.9.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`74c892f10de`](https://bitbucket.org/atlassian/atlassian-frontend/commits/74c892f10de) - [ux] Hover card will open closer to the mouse position, but with a slight offset of 10px to the right and to the top.
|
|
8
|
+
|
|
9
|
+
## 26.9.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4e254433494`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e254433494) - [ux] Remove 'open in new tab' button in Hover Cards
|
|
14
|
+
|
|
3
15
|
## 26.9.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/version.json
CHANGED
|
@@ -67,6 +67,14 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
67
67
|
x: event.clientX,
|
|
68
68
|
y: event.clientY
|
|
69
69
|
};
|
|
70
|
+
|
|
71
|
+
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
72
|
+
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
73
|
+
var _parentSpan$current$g = parentSpan.current.getBoundingClientRect(),
|
|
74
|
+
bottom = _parentSpan$current$g.bottom,
|
|
75
|
+
left = _parentSpan$current$g.left;
|
|
76
|
+
popupOffset.current = [mousePos.current.x - left + _styled.CARD_GAP_PX, mousePos.current.y - bottom + _styled.CARD_GAP_PX];
|
|
77
|
+
}
|
|
70
78
|
}, [canOpen, isOpen]);
|
|
71
79
|
var hideCard = (0, _react2.useCallback)(function () {
|
|
72
80
|
setIsOpen(false);
|
|
@@ -133,21 +141,13 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
133
141
|
|
|
134
142
|
//Set mouse position in the case it's not already set by onMouseMove, as in the case of scrolling
|
|
135
143
|
setMousePosition(event);
|
|
136
|
-
|
|
137
|
-
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
138
|
-
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
139
|
-
var _parentSpan$current$g = parentSpan.current.getBoundingClientRect(),
|
|
140
|
-
bottom = _parentSpan$current$g.bottom,
|
|
141
|
-
left = _parentSpan$current$g.left;
|
|
142
|
-
popupOffset.current = [mousePos.current.x - left, mousePos.current.y - bottom + _styled.CARD_GAP_PX];
|
|
143
|
-
}
|
|
144
144
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
145
145
|
// setting a timeout to show a Hover Card after delay runs out
|
|
146
146
|
fadeInTimeoutId.current = setTimeout(function () {
|
|
147
147
|
setIsOpen(true);
|
|
148
148
|
}, FADE_IN_DELAY);
|
|
149
149
|
}
|
|
150
|
-
}, [
|
|
150
|
+
}, [initResolve, isOpen, setMousePosition]);
|
|
151
151
|
var linkActions = (0, _useSmartLinkActions.useSmartLinkActions)({
|
|
152
152
|
url: url,
|
|
153
153
|
appearance: _constants.CardDisplay.HoverCardPreview,
|
|
@@ -5,12 +5,11 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.hoverCardClassName = exports.
|
|
8
|
+
exports.hoverCardClassName = exports.getCopyAction = exports.default = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _react = require("@emotion/react");
|
|
12
12
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
13
|
-
var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
|
|
14
13
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/glyph/copy"));
|
|
15
14
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
16
15
|
var _constants = require("../../../constants");
|
|
@@ -34,28 +33,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
34
33
|
|
|
35
34
|
var hoverCardClassName = 'smart-links-hover-preview';
|
|
36
35
|
exports.hoverCardClassName = hoverCardClassName;
|
|
37
|
-
var getOpenAction = function getOpenAction(url, analytics, onActionClick) {
|
|
38
|
-
return {
|
|
39
|
-
name: _constants.ActionName.CustomAction,
|
|
40
|
-
icon: (0, _react.jsx)(_shortcut.default, {
|
|
41
|
-
label: "open in new tab",
|
|
42
|
-
size: "medium"
|
|
43
|
-
}),
|
|
44
|
-
iconPosition: 'before',
|
|
45
|
-
onClick: function onClick() {
|
|
46
|
-
if (onActionClick) {
|
|
47
|
-
onActionClick('open-content');
|
|
48
|
-
}
|
|
49
|
-
window.open(url, '_blank');
|
|
50
|
-
analytics.ui.hoverCardOpenLinkClickedEvent({
|
|
51
|
-
previewDisplay: 'card'
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
tooltipMessage: (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.open_link_in_a_new_tab),
|
|
55
|
-
testId: 'hover-card-open-button'
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
exports.getOpenAction = getOpenAction;
|
|
59
36
|
var getCopyAction = function getCopyAction(url) {
|
|
60
37
|
return {
|
|
61
38
|
name: _constants.ActionName.CustomAction,
|
|
@@ -177,8 +154,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
177
154
|
(0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event);
|
|
178
155
|
}, [createAnalyticsEvent, cardState.status, analytics.ui, id]);
|
|
179
156
|
var titleActions = (0, _react2.useMemo)(function () {
|
|
180
|
-
return [getCopyAction(url)
|
|
181
|
-
}, [url
|
|
157
|
+
return [getCopyAction(url)];
|
|
158
|
+
}, [url]);
|
|
182
159
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
183
160
|
var _extractMetadata = (0, _extractMetadata2.extractMetadata)((0, _utils2.getSimulatedMetadata)(extensionKey, data)),
|
|
184
161
|
subtitle = _extractMetadata.subtitle;
|
package/dist/es2019/version.json
CHANGED
|
@@ -48,6 +48,15 @@ export const HoverCardComponent = ({
|
|
|
48
48
|
x: event.clientX,
|
|
49
49
|
y: event.clientY
|
|
50
50
|
};
|
|
51
|
+
|
|
52
|
+
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
53
|
+
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
54
|
+
const {
|
|
55
|
+
bottom,
|
|
56
|
+
left
|
|
57
|
+
} = parentSpan.current.getBoundingClientRect();
|
|
58
|
+
popupOffset.current = [mousePos.current.x - left + CARD_GAP_PX, mousePos.current.y - bottom + CARD_GAP_PX];
|
|
59
|
+
}
|
|
51
60
|
}, [canOpen, isOpen]);
|
|
52
61
|
const hideCard = useCallback(() => {
|
|
53
62
|
setIsOpen(false);
|
|
@@ -112,22 +121,13 @@ export const HoverCardComponent = ({
|
|
|
112
121
|
|
|
113
122
|
//Set mouse position in the case it's not already set by onMouseMove, as in the case of scrolling
|
|
114
123
|
setMousePosition(event);
|
|
115
|
-
|
|
116
|
-
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
117
|
-
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
118
|
-
const {
|
|
119
|
-
bottom,
|
|
120
|
-
left
|
|
121
|
-
} = parentSpan.current.getBoundingClientRect();
|
|
122
|
-
popupOffset.current = [mousePos.current.x - left, mousePos.current.y - bottom + CARD_GAP_PX];
|
|
123
|
-
}
|
|
124
124
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
125
125
|
// setting a timeout to show a Hover Card after delay runs out
|
|
126
126
|
fadeInTimeoutId.current = setTimeout(() => {
|
|
127
127
|
setIsOpen(true);
|
|
128
128
|
}, FADE_IN_DELAY);
|
|
129
129
|
}
|
|
130
|
-
}, [
|
|
130
|
+
}, [initResolve, isOpen, setMousePosition]);
|
|
131
131
|
const linkActions = useSmartLinkActions({
|
|
132
132
|
url,
|
|
133
133
|
appearance: CardDisplay.HoverCardPreview,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
|
-
import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
5
4
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
6
5
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
7
6
|
import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
@@ -20,25 +19,6 @@ import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
|
20
19
|
import { useSmartCardState } from '../../../state/store';
|
|
21
20
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
22
21
|
export const hoverCardClassName = 'smart-links-hover-preview';
|
|
23
|
-
export const getOpenAction = (url, analytics, onActionClick) => ({
|
|
24
|
-
name: ActionName.CustomAction,
|
|
25
|
-
icon: jsx(ShortcutIcon, {
|
|
26
|
-
label: "open in new tab",
|
|
27
|
-
size: "medium"
|
|
28
|
-
}),
|
|
29
|
-
iconPosition: 'before',
|
|
30
|
-
onClick: () => {
|
|
31
|
-
if (onActionClick) {
|
|
32
|
-
onActionClick('open-content');
|
|
33
|
-
}
|
|
34
|
-
window.open(url, '_blank');
|
|
35
|
-
analytics.ui.hoverCardOpenLinkClickedEvent({
|
|
36
|
-
previewDisplay: 'card'
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
tooltipMessage: jsx(FormattedMessage, messages.open_link_in_a_new_tab),
|
|
40
|
-
testId: 'hover-card-open-button'
|
|
41
|
-
});
|
|
42
22
|
export const getCopyAction = url => ({
|
|
43
23
|
name: ActionName.CustomAction,
|
|
44
24
|
icon: jsx(CopyIcon, {
|
|
@@ -135,7 +115,7 @@ const HoverCardContent = ({
|
|
|
135
115
|
});
|
|
136
116
|
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
137
117
|
}, [createAnalyticsEvent, cardState.status, analytics.ui, id]);
|
|
138
|
-
const titleActions = useMemo(() => [getCopyAction(url)
|
|
118
|
+
const titleActions = useMemo(() => [getCopyAction(url)], [url]);
|
|
139
119
|
const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
140
120
|
const {
|
|
141
121
|
subtitle
|
package/dist/esm/version.json
CHANGED
|
@@ -56,6 +56,14 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
56
56
|
x: event.clientX,
|
|
57
57
|
y: event.clientY
|
|
58
58
|
};
|
|
59
|
+
|
|
60
|
+
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
61
|
+
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
62
|
+
var _parentSpan$current$g = parentSpan.current.getBoundingClientRect(),
|
|
63
|
+
bottom = _parentSpan$current$g.bottom,
|
|
64
|
+
left = _parentSpan$current$g.left;
|
|
65
|
+
popupOffset.current = [mousePos.current.x - left + CARD_GAP_PX, mousePos.current.y - bottom + CARD_GAP_PX];
|
|
66
|
+
}
|
|
59
67
|
}, [canOpen, isOpen]);
|
|
60
68
|
var hideCard = useCallback(function () {
|
|
61
69
|
setIsOpen(false);
|
|
@@ -122,21 +130,13 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
122
130
|
|
|
123
131
|
//Set mouse position in the case it's not already set by onMouseMove, as in the case of scrolling
|
|
124
132
|
setMousePosition(event);
|
|
125
|
-
|
|
126
|
-
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
127
|
-
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
128
|
-
var _parentSpan$current$g = parentSpan.current.getBoundingClientRect(),
|
|
129
|
-
bottom = _parentSpan$current$g.bottom,
|
|
130
|
-
left = _parentSpan$current$g.left;
|
|
131
|
-
popupOffset.current = [mousePos.current.x - left, mousePos.current.y - bottom + CARD_GAP_PX];
|
|
132
|
-
}
|
|
133
133
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
134
134
|
// setting a timeout to show a Hover Card after delay runs out
|
|
135
135
|
fadeInTimeoutId.current = setTimeout(function () {
|
|
136
136
|
setIsOpen(true);
|
|
137
137
|
}, FADE_IN_DELAY);
|
|
138
138
|
}
|
|
139
|
-
}, [
|
|
139
|
+
}, [initResolve, isOpen, setMousePosition]);
|
|
140
140
|
var linkActions = useSmartLinkActions({
|
|
141
141
|
url: url,
|
|
142
142
|
appearance: CardDisplay.HoverCardPreview,
|
|
@@ -3,7 +3,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
|
-
import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
7
6
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
8
7
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
9
8
|
import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
@@ -22,27 +21,6 @@ import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
|
22
21
|
import { useSmartCardState } from '../../../state/store';
|
|
23
22
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
24
23
|
export var hoverCardClassName = 'smart-links-hover-preview';
|
|
25
|
-
export var getOpenAction = function getOpenAction(url, analytics, onActionClick) {
|
|
26
|
-
return {
|
|
27
|
-
name: ActionName.CustomAction,
|
|
28
|
-
icon: jsx(ShortcutIcon, {
|
|
29
|
-
label: "open in new tab",
|
|
30
|
-
size: "medium"
|
|
31
|
-
}),
|
|
32
|
-
iconPosition: 'before',
|
|
33
|
-
onClick: function onClick() {
|
|
34
|
-
if (onActionClick) {
|
|
35
|
-
onActionClick('open-content');
|
|
36
|
-
}
|
|
37
|
-
window.open(url, '_blank');
|
|
38
|
-
analytics.ui.hoverCardOpenLinkClickedEvent({
|
|
39
|
-
previewDisplay: 'card'
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
tooltipMessage: jsx(FormattedMessage, messages.open_link_in_a_new_tab),
|
|
43
|
-
testId: 'hover-card-open-button'
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
24
|
export var getCopyAction = function getCopyAction(url) {
|
|
47
25
|
return {
|
|
48
26
|
name: ActionName.CustomAction,
|
|
@@ -163,8 +141,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
163
141
|
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
164
142
|
}, [createAnalyticsEvent, cardState.status, analytics.ui, id]);
|
|
165
143
|
var titleActions = useMemo(function () {
|
|
166
|
-
return [getCopyAction(url)
|
|
167
|
-
}, [url
|
|
144
|
+
return [getCopyAction(url)];
|
|
145
|
+
}, [url]);
|
|
168
146
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
169
147
|
var _extractMetadata = extractMetadata(getSimulatedMetadata(extensionKey, data)),
|
|
170
148
|
subtitle = _extractMetadata.subtitle;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AnalyticsFacade } from '../../../state/analytics';
|
|
3
2
|
import { ActionItem } from '../../FlexibleCard/components/blocks/types';
|
|
4
3
|
import { HoverCardContentProps } from '../types';
|
|
5
4
|
export declare const hoverCardClassName = "smart-links-hover-preview";
|
|
6
|
-
export declare const getOpenAction: (url: string, analytics: AnalyticsFacade, onActionClick?: ((actionId: string) => void) | undefined) => ActionItem;
|
|
7
5
|
export declare const getCopyAction: (url: string) => ActionItem;
|
|
8
6
|
declare const HoverCardContent: React.FC<HoverCardContentProps>;
|
|
9
7
|
export default HoverCardContent;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AnalyticsFacade } from '../../../state/analytics';
|
|
3
2
|
import { ActionItem } from '../../FlexibleCard/components/blocks/types';
|
|
4
3
|
import { HoverCardContentProps } from '../types';
|
|
5
4
|
export declare const hoverCardClassName = "smart-links-hover-preview";
|
|
6
|
-
export declare const getOpenAction: (url: string, analytics: AnalyticsFacade, onActionClick?: ((actionId: string) => void) | undefined) => ActionItem;
|
|
7
5
|
export declare const getCopyAction: (url: string) => ActionItem;
|
|
8
6
|
declare const HoverCardContent: React.FC<HoverCardContentProps>;
|
|
9
7
|
export default HoverCardContent;
|
package/package.json
CHANGED
|
@@ -0,0 +1,937 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/smart-card"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
|
|
9
|
+
import { APIError } from '@atlaskit/linking-common';
|
|
10
|
+
import { Appearance } from '@atlaskit/button/types';
|
|
11
|
+
import { BlockCardAdf } from '@atlaskit/linking-common';
|
|
12
|
+
import { CardAdf } from '@atlaskit/linking-common';
|
|
13
|
+
import { CardAppearance } from '@atlaskit/linking-common';
|
|
14
|
+
import { CardContext } from '@atlaskit/link-provider';
|
|
15
|
+
import { CardPlatform } from '@atlaskit/link-extractors';
|
|
16
|
+
import { CardType } from '@atlaskit/linking-common';
|
|
17
|
+
import { CardClient as Client } from '@atlaskit/link-provider';
|
|
18
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
19
|
+
import { DatasourceAdf } from '@atlaskit/linking-common';
|
|
20
|
+
import { DatasourceAdfView } from '@atlaskit/linking-common';
|
|
21
|
+
import { EditorCardProvider } from '@atlaskit/link-provider';
|
|
22
|
+
import { editorCardProvider } from '@atlaskit/link-provider';
|
|
23
|
+
import { EmbedCardAdf } from '@atlaskit/linking-common';
|
|
24
|
+
import { ErrorInfo } from 'react';
|
|
25
|
+
import { GasPayload } from '@atlaskit/analytics-gas-types';
|
|
26
|
+
import { InlineCardAdf } from '@atlaskit/linking-common';
|
|
27
|
+
import { JsonLd } from 'json-ld-types';
|
|
28
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
29
|
+
import { SmartCardProvider as Provider } from '@atlaskit/link-provider';
|
|
30
|
+
import { ProviderProps } from '@atlaskit/link-provider';
|
|
31
|
+
import { default as React_2 } from 'react';
|
|
32
|
+
import { ReactChild } from 'react';
|
|
33
|
+
import { Ref } from 'react';
|
|
34
|
+
import { SerializedStyles } from '@emotion/react';
|
|
35
|
+
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
36
|
+
import { SmartLinkActionType } from '@atlaskit/linking-types';
|
|
37
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
38
|
+
import { WithContextProps } from '@atlaskit/analytics-next';
|
|
39
|
+
import { WithIntlProps } from 'react-intl-next';
|
|
40
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
41
|
+
|
|
42
|
+
// @public (undocumented)
|
|
43
|
+
export type ActionItem = CustomActionItem | NamedActionItem | NamedDataActionItem;
|
|
44
|
+
|
|
45
|
+
// @public
|
|
46
|
+
export enum ActionName {
|
|
47
|
+
// (undocumented)
|
|
48
|
+
CustomAction = "CustomAction",
|
|
49
|
+
// (undocumented)
|
|
50
|
+
DeleteAction = "DeleteAction",
|
|
51
|
+
// (undocumented)
|
|
52
|
+
DownloadAction = "DownloadAction",
|
|
53
|
+
// (undocumented)
|
|
54
|
+
EditAction = "EditAction",
|
|
55
|
+
// (undocumented)
|
|
56
|
+
PreviewAction = "PreviewAction",
|
|
57
|
+
// (undocumented)
|
|
58
|
+
ViewAction = "ViewAction"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// @public (undocumented)
|
|
62
|
+
type ActionProps = {
|
|
63
|
+
size?: SmartLinkSize;
|
|
64
|
+
content?: React.ReactNode;
|
|
65
|
+
appearance?: Appearance;
|
|
66
|
+
onClick: () => any;
|
|
67
|
+
icon?: ReactChild;
|
|
68
|
+
iconPosition?: 'after' | 'before';
|
|
69
|
+
tooltipMessage?: React.ReactNode;
|
|
70
|
+
asDropDownItem?: boolean;
|
|
71
|
+
overrideCss?: SerializedStyles;
|
|
72
|
+
testId?: string;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// @public (undocumented)
|
|
76
|
+
export type AnalyticsAction = 'authStarted' | 'chunkLoadFailed' | 'clicked' | 'closed' | 'connectFailed' | 'connectSucceeded' | 'connected' | 'created' | 'dismissed' | 'dwelled' | 'failed' | 'focused' | 'inserted' | 'renderFailed' | 'renderSuccess' | 'renderWithStatus' | 'resolved' | 'started' | 'success' | 'unresolved' | 'updated' | 'viewed';
|
|
77
|
+
|
|
78
|
+
// @public (undocumented)
|
|
79
|
+
export type AnalyticsActionSubject = 'applicationAccount' | 'button' | 'consentModal' | 'embedPreviewModal' | 'hoverCard' | 'link' | 'modal' | 'smartLink' | 'smartLinkAction' | 'smartLinkIframe' | 'smartLinkQuickAction';
|
|
80
|
+
|
|
81
|
+
// @public (undocumented)
|
|
82
|
+
type AnalyticsFacade = ReturnType<typeof useSmartLinkAnalytics>;
|
|
83
|
+
|
|
84
|
+
// @public (undocumented)
|
|
85
|
+
export type AnalyticsHandler = (event: AnalyticsPayload) => void;
|
|
86
|
+
|
|
87
|
+
// @public (undocumented)
|
|
88
|
+
type AnalyticsName = 'embedPreviewModal';
|
|
89
|
+
|
|
90
|
+
// @public (undocumented)
|
|
91
|
+
export type AnalyticsPayload = GasPayload & {
|
|
92
|
+
action?: AnalyticsAction;
|
|
93
|
+
actionSubject: AnalyticsActionSubject;
|
|
94
|
+
attributes: GasPayload['attributes'] & {
|
|
95
|
+
display?: CardInnerAppearance;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// @public (undocumented)
|
|
100
|
+
type AnchorTarget = '_blank' | '_parent' | '_self' | '_top';
|
|
101
|
+
|
|
102
|
+
export { APIError }
|
|
103
|
+
|
|
104
|
+
// @public
|
|
105
|
+
type AttachmentCount = {
|
|
106
|
+
name: ElementName.AttachmentCount;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// @public
|
|
110
|
+
type AuthorGroup = {
|
|
111
|
+
name: ElementName.AuthorGroup;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// @public
|
|
115
|
+
type BaseActionItem = {
|
|
116
|
+
hideContent?: boolean;
|
|
117
|
+
hideIcon?: boolean;
|
|
118
|
+
name: ActionName;
|
|
119
|
+
onClick: () => any;
|
|
120
|
+
overrideCss?: SerializedStyles;
|
|
121
|
+
size?: SmartLinkSize;
|
|
122
|
+
testId?: string;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// @public
|
|
126
|
+
type BaseDataActionItem = {
|
|
127
|
+
hideContent?: boolean;
|
|
128
|
+
hideIcon?: boolean;
|
|
129
|
+
name: ActionName;
|
|
130
|
+
onClick?: () => any;
|
|
131
|
+
overrideCss?: SerializedStyles;
|
|
132
|
+
size?: SmartLinkSize;
|
|
133
|
+
testId?: string;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export { BlockCardAdf }
|
|
137
|
+
|
|
138
|
+
// @public (undocumented)
|
|
139
|
+
export const blockCardContentClassName = "block-card-content";
|
|
140
|
+
|
|
141
|
+
// @public (undocumented)
|
|
142
|
+
export const blockCardContentHeaderClassName = "block-card-content-header";
|
|
143
|
+
|
|
144
|
+
// @public (undocumented)
|
|
145
|
+
export const blockCardContentHeaderNameClassName = "block-card-content-header-name";
|
|
146
|
+
|
|
147
|
+
// @public (undocumented)
|
|
148
|
+
export const blockCardErroredViewClassName = "block-card-errored-view";
|
|
149
|
+
|
|
150
|
+
// @public (undocumented)
|
|
151
|
+
export const blockCardForbiddenViewClassName = "block-card-forbidden-view";
|
|
152
|
+
|
|
153
|
+
// @public (undocumented)
|
|
154
|
+
export const blockCardForbiddenViewLinkClassName = "block-card-forbidden-view-link";
|
|
155
|
+
|
|
156
|
+
// @public (undocumented)
|
|
157
|
+
export const blockCardIconImageClassName = "block-card-icon-image";
|
|
158
|
+
|
|
159
|
+
// @public (undocumented)
|
|
160
|
+
export const blockCardNotFoundViewClassName = "block-card-not-found-view";
|
|
161
|
+
|
|
162
|
+
// @public (undocumented)
|
|
163
|
+
export const blockCardResolvedViewByClassName = "block-card-resolved-view-by";
|
|
164
|
+
|
|
165
|
+
// @public (undocumented)
|
|
166
|
+
export const blockCardResolvedViewClassName = "block-card-resolved-view";
|
|
167
|
+
|
|
168
|
+
// @public (undocumented)
|
|
169
|
+
export const blockCardResolvingViewClassName = "block-card-resolving-view";
|
|
170
|
+
|
|
171
|
+
// @public (undocumented)
|
|
172
|
+
type BlockProps = {
|
|
173
|
+
direction?: SmartLinkDirection;
|
|
174
|
+
overrideCss?: SerializedStyles;
|
|
175
|
+
size?: SmartLinkSize;
|
|
176
|
+
status?: SmartLinkStatus;
|
|
177
|
+
testId?: string;
|
|
178
|
+
blockRef?: Ref<HTMLDivElement>;
|
|
179
|
+
onRender?: () => void;
|
|
180
|
+
onTransitionEnd?: () => void;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// @public (undocumented)
|
|
184
|
+
export const Card: React_2.ForwardRefExoticComponent<Pick<Omit<React_2.PropsWithChildren<WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof WithAnalyticsEventsProps> & React_2.RefAttributes<any> & WithContextProps, "analyticsContext" | "analyticsEvents" | "appearance" | "children" | "container" | "data" | "embedIframeRef" | "embedIframeUrlType" | "fallbackComponent" | "forwardedRef" | "frameStyle" | "id" | "importer" | "inheritDimensions" | "inlinePreloaderStyle" | "isFrameVisible" | "isSelected" | "key" | "onClick" | "onError" | "onResolve" | "placeholder" | "platform" | "showActions" | "showAuthTooltip" | "showHoverPreview" | "showServerActions" | "testId" | "ui" | "url"> & React_2.RefAttributes<any>>;
|
|
185
|
+
|
|
186
|
+
export { CardAdf }
|
|
187
|
+
|
|
188
|
+
export { CardAppearance }
|
|
189
|
+
|
|
190
|
+
export { CardContext }
|
|
191
|
+
|
|
192
|
+
// @public (undocumented)
|
|
193
|
+
type CardInnerAppearance = 'embedPreview' | 'flexible' | 'hoverCardPreview' | CardAppearance;
|
|
194
|
+
|
|
195
|
+
export { CardPlatform }
|
|
196
|
+
|
|
197
|
+
// @public (undocumented)
|
|
198
|
+
export interface CardProps extends WithAnalyticsEventsProps {
|
|
199
|
+
// @deprecated (undocumented)
|
|
200
|
+
analyticsEvents?: AnalyticsFacade;
|
|
201
|
+
// (undocumented)
|
|
202
|
+
appearance: CardAppearance;
|
|
203
|
+
// (undocumented)
|
|
204
|
+
children?: React.ReactNode;
|
|
205
|
+
// (undocumented)
|
|
206
|
+
container?: HTMLElement;
|
|
207
|
+
// @deprecated (undocumented)
|
|
208
|
+
data?: any;
|
|
209
|
+
// (undocumented)
|
|
210
|
+
embedIframeRef?: React.Ref<HTMLIFrameElement>;
|
|
211
|
+
// (undocumented)
|
|
212
|
+
embedIframeUrlType?: EmbedIframeUrlType;
|
|
213
|
+
fallbackComponent?: React.ComponentType;
|
|
214
|
+
frameStyle?: FrameStyle;
|
|
215
|
+
// (undocumented)
|
|
216
|
+
id?: string;
|
|
217
|
+
// (undocumented)
|
|
218
|
+
importer?: (target: any) => void;
|
|
219
|
+
inheritDimensions?: boolean;
|
|
220
|
+
// (undocumented)
|
|
221
|
+
inlinePreloaderStyle?: InlinePreloaderStyle;
|
|
222
|
+
// @deprecated (undocumented)
|
|
223
|
+
isFrameVisible?: boolean;
|
|
224
|
+
// (undocumented)
|
|
225
|
+
isSelected?: boolean;
|
|
226
|
+
// (undocumented)
|
|
227
|
+
onClick?: React.EventHandler<React.KeyboardEvent | React.MouseEvent>;
|
|
228
|
+
onError?: OnErrorCallback;
|
|
229
|
+
// (undocumented)
|
|
230
|
+
onResolve?: OnResolveCallback;
|
|
231
|
+
// (undocumented)
|
|
232
|
+
placeholder?: string;
|
|
233
|
+
// (undocumented)
|
|
234
|
+
platform?: CardPlatform;
|
|
235
|
+
showActions?: boolean;
|
|
236
|
+
// (undocumented)
|
|
237
|
+
showAuthTooltip?: boolean;
|
|
238
|
+
// (undocumented)
|
|
239
|
+
showHoverPreview?: boolean;
|
|
240
|
+
showServerActions?: boolean;
|
|
241
|
+
// (undocumented)
|
|
242
|
+
testId?: string;
|
|
243
|
+
// (undocumented)
|
|
244
|
+
ui?: FlexibleUiOptions;
|
|
245
|
+
// (undocumented)
|
|
246
|
+
url?: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export { CardType }
|
|
250
|
+
|
|
251
|
+
// @public
|
|
252
|
+
type ChecklistProgress = {
|
|
253
|
+
name: ElementName.ChecklistProgress;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
export { Client }
|
|
257
|
+
|
|
258
|
+
// @public
|
|
259
|
+
type CollaboratorGroup = {
|
|
260
|
+
name: ElementName.CollaboratorGroup;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
// @public
|
|
264
|
+
type CommentCount = {
|
|
265
|
+
name: ElementName.CommentCount;
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
// @public (undocumented)
|
|
269
|
+
interface CommonEventProps {
|
|
270
|
+
// (undocumented)
|
|
271
|
+
definitionId?: string;
|
|
272
|
+
// (undocumented)
|
|
273
|
+
destinatinoObjectType?: string;
|
|
274
|
+
// (undocumented)
|
|
275
|
+
destinationProduct?: DestinationProduct | string;
|
|
276
|
+
// (undocumented)
|
|
277
|
+
destinationSubproduct?: DestinationSubproduct | string;
|
|
278
|
+
// (undocumented)
|
|
279
|
+
extensionKey?: string;
|
|
280
|
+
// (undocumented)
|
|
281
|
+
id?: string;
|
|
282
|
+
// (undocumented)
|
|
283
|
+
location?: string;
|
|
284
|
+
// (undocumented)
|
|
285
|
+
resourceType?: string;
|
|
286
|
+
// (undocumented)
|
|
287
|
+
statusDetails?: string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// @public (undocumented)
|
|
291
|
+
type ConnectFailedEventProps = CommonEventProps & {
|
|
292
|
+
id?: string;
|
|
293
|
+
reason?: string;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
// @public (undocumented)
|
|
297
|
+
type ConnectSucceededEventProps = CommonEventProps & {
|
|
298
|
+
id?: string;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// @public (undocumented)
|
|
302
|
+
export const contentFooterClassName = "smart-link-content-footer";
|
|
303
|
+
|
|
304
|
+
// @public
|
|
305
|
+
type CreatedBy = {
|
|
306
|
+
name: ElementName.CreatedBy;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
// @public
|
|
310
|
+
type CreatedOn = {
|
|
311
|
+
name: ElementName.CreatedOn;
|
|
312
|
+
text?: string;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
// @public
|
|
316
|
+
type CustomActionItem = BaseActionItem & {
|
|
317
|
+
name: ActionName.CustomAction;
|
|
318
|
+
} & (((Required<Pick<ActionProps, 'content'>> & Pick<ActionProps, 'icon' | 'iconPosition'>) & Pick<ActionProps, 'tooltipMessage'>) | (Required<Pick<ActionProps, 'icon' | 'iconPosition'>> & Pick<ActionProps, 'content'>));
|
|
319
|
+
|
|
320
|
+
export { DatasourceAdf }
|
|
321
|
+
|
|
322
|
+
export { DatasourceAdfView }
|
|
323
|
+
|
|
324
|
+
// @public (undocumented)
|
|
325
|
+
type DestinationProduct = 'bitbucket' | 'confluence' | 'jira' | 'trello';
|
|
326
|
+
|
|
327
|
+
// @public (undocumented)
|
|
328
|
+
type DestinationSubproduct = 'core' | 'servicedesk' | 'software';
|
|
329
|
+
|
|
330
|
+
// @public
|
|
331
|
+
type DueOn = {
|
|
332
|
+
name: ElementName.DueOn;
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
export { EditorCardProvider }
|
|
336
|
+
|
|
337
|
+
export { editorCardProvider }
|
|
338
|
+
|
|
339
|
+
// @public
|
|
340
|
+
export type ElementItem = {
|
|
341
|
+
overrideCss?: SerializedStyles;
|
|
342
|
+
size?: SmartLinkSize;
|
|
343
|
+
testId?: string;
|
|
344
|
+
} & ElementItemProps;
|
|
345
|
+
|
|
346
|
+
// @public
|
|
347
|
+
type ElementItemProps = AttachmentCount | AuthorGroup | ChecklistProgress | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | Location_2 | ModifiedBy | ModifiedOn | OwnedBy | Preview | Priority | ProgrammingLanguage | Provider_2 | ReactCount | Snippet | SourceBranch | State_2 | SubscriberCount | TargetBranch | Title | ViewCount | VoteCount;
|
|
348
|
+
|
|
349
|
+
// @public
|
|
350
|
+
export enum ElementName {
|
|
351
|
+
// (undocumented)
|
|
352
|
+
AttachmentCount = "AttachmentCount",
|
|
353
|
+
// (undocumented)
|
|
354
|
+
AuthorGroup = "AuthorGroup",
|
|
355
|
+
// (undocumented)
|
|
356
|
+
ChecklistProgress = "ChecklistProgress",
|
|
357
|
+
// (undocumented)
|
|
358
|
+
CollaboratorGroup = "CollaboratorGroup",
|
|
359
|
+
// (undocumented)
|
|
360
|
+
CommentCount = "CommentCount",
|
|
361
|
+
// (undocumented)
|
|
362
|
+
CreatedBy = "CreatedBy",
|
|
363
|
+
// (undocumented)
|
|
364
|
+
CreatedOn = "CreatedOn",
|
|
365
|
+
// (undocumented)
|
|
366
|
+
DueOn = "DueOn",
|
|
367
|
+
// (undocumented)
|
|
368
|
+
LatestCommit = "LatestCommit",
|
|
369
|
+
// (undocumented)
|
|
370
|
+
LinkIcon = "LinkIcon",
|
|
371
|
+
// (undocumented)
|
|
372
|
+
Location = "Location",
|
|
373
|
+
// (undocumented)
|
|
374
|
+
ModifiedBy = "ModifiedBy",
|
|
375
|
+
// (undocumented)
|
|
376
|
+
ModifiedOn = "ModifiedOn",
|
|
377
|
+
// (undocumented)
|
|
378
|
+
OwnedBy = "OwnedBy",
|
|
379
|
+
// (undocumented)
|
|
380
|
+
Preview = "Preview",
|
|
381
|
+
// (undocumented)
|
|
382
|
+
Priority = "Priority",
|
|
383
|
+
// (undocumented)
|
|
384
|
+
ProgrammingLanguage = "ProgrammingLanguage",
|
|
385
|
+
// (undocumented)
|
|
386
|
+
Provider = "Provider",
|
|
387
|
+
// (undocumented)
|
|
388
|
+
ReactCount = "ReactCount",
|
|
389
|
+
// (undocumented)
|
|
390
|
+
Snippet = "Snippet",
|
|
391
|
+
// (undocumented)
|
|
392
|
+
SourceBranch = "SourceBranch",
|
|
393
|
+
// (undocumented)
|
|
394
|
+
State = "State",
|
|
395
|
+
// (undocumented)
|
|
396
|
+
SubscriberCount = "SubscriberCount",
|
|
397
|
+
// (undocumented)
|
|
398
|
+
TargetBranch = "TargetBranch",
|
|
399
|
+
// (undocumented)
|
|
400
|
+
Title = "Title",
|
|
401
|
+
// (undocumented)
|
|
402
|
+
ViewCount = "ViewCount",
|
|
403
|
+
// (undocumented)
|
|
404
|
+
VoteCount = "VoteCount"
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export { EmbedCardAdf }
|
|
408
|
+
|
|
409
|
+
// @public (undocumented)
|
|
410
|
+
export const embedHeaderHeight = 32;
|
|
411
|
+
|
|
412
|
+
// @public (undocumented)
|
|
413
|
+
type EmbedIframeUrlType = 'href' | 'interactiveHref';
|
|
414
|
+
|
|
415
|
+
// @public (undocumented)
|
|
416
|
+
export class EmbedResizeMessageListener extends React_2.Component<Props, State> {
|
|
417
|
+
// (undocumented)
|
|
418
|
+
componentDidMount(): void;
|
|
419
|
+
// (undocumented)
|
|
420
|
+
componentWillUnmount(): void;
|
|
421
|
+
// (undocumented)
|
|
422
|
+
render(): React_2.ReactNode;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// @public (undocumented)
|
|
426
|
+
type ErrorCardType = 'errored' | 'fallback' | 'forbidden' | 'not_found' | 'unauthorized';
|
|
427
|
+
|
|
428
|
+
// @public (undocumented)
|
|
429
|
+
type FlexibleUiOptions = {
|
|
430
|
+
clickableContainer?: boolean;
|
|
431
|
+
hideElevation?: boolean;
|
|
432
|
+
hideHoverCardPreviewButton?: boolean;
|
|
433
|
+
hidePadding?: boolean;
|
|
434
|
+
hideBackground?: boolean;
|
|
435
|
+
size?: SmartLinkSize;
|
|
436
|
+
theme?: SmartLinkTheme;
|
|
437
|
+
zIndex?: number;
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
// @public
|
|
441
|
+
export const FooterBlock: React_2.FC<FooterBlockProps>;
|
|
442
|
+
|
|
443
|
+
// @public (undocumented)
|
|
444
|
+
type FooterBlockProps = {
|
|
445
|
+
actions?: ActionItem[];
|
|
446
|
+
onActionMenuOpenChange?: (options: OnActionMenuOpenChangeOptions) => void;
|
|
447
|
+
} & BlockProps;
|
|
448
|
+
|
|
449
|
+
// @public (undocumented)
|
|
450
|
+
type FrameStyle = 'hide' | 'show' | 'showOnHover';
|
|
451
|
+
|
|
452
|
+
export { InlineCardAdf }
|
|
453
|
+
|
|
454
|
+
// @public (undocumented)
|
|
455
|
+
type InlinePreloaderStyle = 'on-left-with-skeleton' | 'on-right-without-skeleton';
|
|
456
|
+
|
|
457
|
+
// @public (undocumented)
|
|
458
|
+
type InstrumentEventProps = CommonEventProps & {
|
|
459
|
+
error?: APIError;
|
|
460
|
+
status: CardType;
|
|
461
|
+
id: string;
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
// @public (undocumented)
|
|
465
|
+
type InvokeFailedEventProps = CommonEventProps & {
|
|
466
|
+
id: string;
|
|
467
|
+
actionType: string;
|
|
468
|
+
display: CardInnerAppearance;
|
|
469
|
+
reason: string;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
// @public (undocumented)
|
|
473
|
+
type InvokeSucceededEventProps = CommonEventProps & {
|
|
474
|
+
id: string;
|
|
475
|
+
actionType: string;
|
|
476
|
+
display: CardInnerAppearance;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
// @public (undocumented)
|
|
480
|
+
type InvokeType = 'client' | 'server';
|
|
481
|
+
|
|
482
|
+
// @public
|
|
483
|
+
type LatestCommit = {
|
|
484
|
+
name: ElementName.LatestCommit;
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
// @public
|
|
488
|
+
type LinkIcon = {
|
|
489
|
+
name: ElementName.LinkIcon;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
// @public (undocumented)
|
|
493
|
+
export const loadingPlaceholderClassName = "smart-link-loading-placeholder";
|
|
494
|
+
|
|
495
|
+
// @public
|
|
496
|
+
type Location_2 = {
|
|
497
|
+
name: ElementName.Location;
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
// @public (undocumented)
|
|
501
|
+
export enum MediaPlacement {
|
|
502
|
+
// (undocumented)
|
|
503
|
+
Left = "left",
|
|
504
|
+
// (undocumented)
|
|
505
|
+
Right = "right"
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// @public
|
|
509
|
+
export const MetadataBlock: React_2.FC<MetadataBlockProps>;
|
|
510
|
+
|
|
511
|
+
// @public (undocumented)
|
|
512
|
+
type MetadataBlockProps = {
|
|
513
|
+
maxLines?: number;
|
|
514
|
+
primary?: ElementItem[];
|
|
515
|
+
secondary?: ElementItem[];
|
|
516
|
+
} & BlockProps;
|
|
517
|
+
|
|
518
|
+
// @public (undocumented)
|
|
519
|
+
export const metadataListClassName = "smart-link-metadata-list";
|
|
520
|
+
|
|
521
|
+
// @public
|
|
522
|
+
type ModifiedBy = {
|
|
523
|
+
name: ElementName.ModifiedBy;
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
// @public
|
|
527
|
+
type ModifiedOn = {
|
|
528
|
+
name: ElementName.ModifiedOn;
|
|
529
|
+
text?: string;
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
// @public
|
|
533
|
+
type NamedActionItem = BaseActionItem & {
|
|
534
|
+
name: ActionName.DeleteAction | ActionName.EditAction;
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
// @public
|
|
538
|
+
type NamedDataActionItem = BaseDataActionItem & {
|
|
539
|
+
name: ActionName.DownloadAction | ActionName.PreviewAction | ActionName.ViewAction;
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
// @public (undocumented)
|
|
543
|
+
export type OnActionMenuOpenChangeOptions = {
|
|
544
|
+
isOpen: boolean;
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
// @public (undocumented)
|
|
548
|
+
type OnErrorCallback = (data: {
|
|
549
|
+
status: Extract<CardType, ErrorCardType>;
|
|
550
|
+
url: string;
|
|
551
|
+
err?: Error;
|
|
552
|
+
}) => void;
|
|
553
|
+
|
|
554
|
+
// @public (undocumented)
|
|
555
|
+
type OnResolveCallback = (data: {
|
|
556
|
+
url?: string;
|
|
557
|
+
title?: string;
|
|
558
|
+
aspectRatio?: number;
|
|
559
|
+
}) => void;
|
|
560
|
+
|
|
561
|
+
// @public
|
|
562
|
+
type OwnedBy = {
|
|
563
|
+
name: ElementName.OwnedBy;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
// @public
|
|
567
|
+
type Preview = {
|
|
568
|
+
name: ElementName.Preview;
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
// @public
|
|
572
|
+
export const PreviewBlock: React_2.FC<PreviewBlockProps>;
|
|
573
|
+
|
|
574
|
+
// @public (undocumented)
|
|
575
|
+
type PreviewBlockProps = {
|
|
576
|
+
ignoreContainerPadding?: boolean;
|
|
577
|
+
onError?: () => void;
|
|
578
|
+
placement?: MediaPlacement;
|
|
579
|
+
} & BlockProps;
|
|
580
|
+
|
|
581
|
+
// @public (undocumented)
|
|
582
|
+
type PreviewDisplay = 'card' | 'embed';
|
|
583
|
+
|
|
584
|
+
// @public (undocumented)
|
|
585
|
+
type PreviewInvokeMethod = 'keyboard' | 'mouse_click' | 'mouse_hover';
|
|
586
|
+
|
|
587
|
+
// @public
|
|
588
|
+
type Priority = {
|
|
589
|
+
name: ElementName.Priority;
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
// @public
|
|
593
|
+
type ProgrammingLanguage = {
|
|
594
|
+
name: ElementName.ProgrammingLanguage;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
// @public (undocumented)
|
|
598
|
+
interface Props {
|
|
599
|
+
// (undocumented)
|
|
600
|
+
embedIframeRef: React_2.RefObject<HTMLIFrameElement>;
|
|
601
|
+
// (undocumented)
|
|
602
|
+
onHeightUpdate: (height: number) => void;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export { Provider }
|
|
606
|
+
|
|
607
|
+
// @public
|
|
608
|
+
type Provider_2 = {
|
|
609
|
+
name: ElementName.Provider;
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
export { ProviderProps }
|
|
613
|
+
|
|
614
|
+
// @public
|
|
615
|
+
type ReactCount = {
|
|
616
|
+
name: ElementName.ReactCount;
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
// @public (undocumented)
|
|
620
|
+
export type ResolveResponse = JsonLd.Response;
|
|
621
|
+
|
|
622
|
+
// @public
|
|
623
|
+
type RetryOptions = {
|
|
624
|
+
descriptor?: MessageDescriptor;
|
|
625
|
+
onClick?: ((e: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
626
|
+
values?: Record<string, string>;
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
// @public (undocumented)
|
|
630
|
+
type ScreenAuthPopupEventProps = CommonEventProps;
|
|
631
|
+
|
|
632
|
+
export { SmartCardContext as Context }
|
|
633
|
+
export { SmartCardContext }
|
|
634
|
+
|
|
635
|
+
// @public
|
|
636
|
+
export enum SmartLinkDirection {
|
|
637
|
+
// (undocumented)
|
|
638
|
+
Horizontal = "horizontal",
|
|
639
|
+
// (undocumented)
|
|
640
|
+
Vertical = "vertical"
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// @public (undocumented)
|
|
644
|
+
export class SmartLinkEvents {
|
|
645
|
+
// (undocumented)
|
|
646
|
+
insertSmartLink(url: string, type: CardInnerAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// @public
|
|
650
|
+
export enum SmartLinkPosition {
|
|
651
|
+
// (undocumented)
|
|
652
|
+
Center = "center",
|
|
653
|
+
// (undocumented)
|
|
654
|
+
Top = "top"
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
// @public
|
|
658
|
+
export enum SmartLinkSize {
|
|
659
|
+
// (undocumented)
|
|
660
|
+
Large = "large",
|
|
661
|
+
// (undocumented)
|
|
662
|
+
Medium = "medium",
|
|
663
|
+
// (undocumented)
|
|
664
|
+
Small = "small",
|
|
665
|
+
// (undocumented)
|
|
666
|
+
XLarge = "xlarge"
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
// @public
|
|
670
|
+
enum SmartLinkStatus {
|
|
671
|
+
// (undocumented)
|
|
672
|
+
Errored = "errored",
|
|
673
|
+
// (undocumented)
|
|
674
|
+
Fallback = "fallback",
|
|
675
|
+
// (undocumented)
|
|
676
|
+
Forbidden = "forbidden",
|
|
677
|
+
// (undocumented)
|
|
678
|
+
NotFound = "not_found",
|
|
679
|
+
// (undocumented)
|
|
680
|
+
Pending = "pending",
|
|
681
|
+
// (undocumented)
|
|
682
|
+
Resolved = "resolved",
|
|
683
|
+
// (undocumented)
|
|
684
|
+
Resolving = "resolving",
|
|
685
|
+
// (undocumented)
|
|
686
|
+
Unauthorized = "unauthorized"
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// @public
|
|
690
|
+
export enum SmartLinkTheme {
|
|
691
|
+
// (undocumented)
|
|
692
|
+
Black = "black",
|
|
693
|
+
// (undocumented)
|
|
694
|
+
Link = "link"
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// @public
|
|
698
|
+
type Snippet = {
|
|
699
|
+
name: ElementName.Snippet;
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
// @public
|
|
703
|
+
export const SnippetBlock: React_2.FC<SnippetBlockProps>;
|
|
704
|
+
|
|
705
|
+
// @public (undocumented)
|
|
706
|
+
type SnippetBlockProps = {
|
|
707
|
+
maxLines?: number;
|
|
708
|
+
} & BlockProps;
|
|
709
|
+
|
|
710
|
+
// @public
|
|
711
|
+
type SourceBranch = {
|
|
712
|
+
name: ElementName.SourceBranch;
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
// @public (undocumented)
|
|
716
|
+
interface State {
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
// @public
|
|
720
|
+
type State_2 = {
|
|
721
|
+
name: ElementName.State;
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
// @public
|
|
725
|
+
type SubscriberCount = {
|
|
726
|
+
name: ElementName.SubscriberCount;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
// @public
|
|
730
|
+
type TargetBranch = {
|
|
731
|
+
name: ElementName.TargetBranch;
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
// @public
|
|
735
|
+
type Title = {
|
|
736
|
+
name: ElementName.Title;
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
// @public
|
|
740
|
+
export const TitleBlock: React_2.FC<TitleBlockProps>;
|
|
741
|
+
|
|
742
|
+
// @public (undocumented)
|
|
743
|
+
type TitleBlockProps = {
|
|
744
|
+
actions?: ActionItem[];
|
|
745
|
+
anchorTarget?: AnchorTarget;
|
|
746
|
+
hideTitleTooltip?: boolean;
|
|
747
|
+
maxLines?: number;
|
|
748
|
+
metadata?: ElementItem[];
|
|
749
|
+
onActionMenuOpenChange?: (options: OnActionMenuOpenChangeOptions) => void;
|
|
750
|
+
position?: SmartLinkPosition;
|
|
751
|
+
onClick?: React_2.EventHandler<React_2.KeyboardEvent | React_2.MouseEvent>;
|
|
752
|
+
retry?: RetryOptions;
|
|
753
|
+
hideRetry?: boolean;
|
|
754
|
+
showActionOnHover?: boolean;
|
|
755
|
+
subtitle?: ElementItem[];
|
|
756
|
+
text?: string;
|
|
757
|
+
theme?: SmartLinkTheme;
|
|
758
|
+
metadataPosition?: SmartLinkPosition;
|
|
759
|
+
} & BlockProps;
|
|
760
|
+
|
|
761
|
+
// @public (undocumented)
|
|
762
|
+
type TrackAppAccountConnectedProps = CommonEventProps;
|
|
763
|
+
|
|
764
|
+
// @public (undocumented)
|
|
765
|
+
enum TrackQuickActionFailureReason {
|
|
766
|
+
// (undocumented)
|
|
767
|
+
PermissionError = "PermissionError",
|
|
768
|
+
// (undocumented)
|
|
769
|
+
UnknownError = "UnknownError",
|
|
770
|
+
// (undocumented)
|
|
771
|
+
ValidationError = "ValidationError"
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// @public (undocumented)
|
|
775
|
+
enum TrackQuickActionType {
|
|
776
|
+
// (undocumented)
|
|
777
|
+
StatusUpdate = "StatusUpdate"
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// @public (undocumented)
|
|
781
|
+
type UiActionClickedEventProps = CommonEventProps & {
|
|
782
|
+
id: string;
|
|
783
|
+
display: CardInnerAppearance;
|
|
784
|
+
actionType: string;
|
|
785
|
+
invokeType?: InvokeType;
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
// @public (undocumented)
|
|
789
|
+
type UiAuthAlternateAccountEventProps = CommonEventProps & {
|
|
790
|
+
display: CardInnerAppearance;
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
// @public (undocumented)
|
|
794
|
+
type UiAuthEventProps = CommonEventProps & {
|
|
795
|
+
display: CardInnerAppearance;
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
// @public (undocumented)
|
|
799
|
+
type UiCardClickedEventProps = CommonEventProps & {
|
|
800
|
+
id: string;
|
|
801
|
+
display: CardInnerAppearance;
|
|
802
|
+
status: CardType;
|
|
803
|
+
isModifierKeyPressed?: boolean;
|
|
804
|
+
actionSubjectId?: string;
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
// @public (undocumented)
|
|
808
|
+
type UiClosedAuthEventProps = CommonEventProps & {
|
|
809
|
+
display: CardInnerAppearance;
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
// @public (undocumented)
|
|
813
|
+
type UiHoverCardDismissedEventProps = CommonEventProps & {
|
|
814
|
+
previewDisplay: PreviewDisplay;
|
|
815
|
+
hoverTime: number;
|
|
816
|
+
previewInvokeMethod?: PreviewInvokeMethod;
|
|
817
|
+
status: CardType;
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
// @public (undocumented)
|
|
821
|
+
type UiHoverCardOpenLinkClickedEventProps = CommonEventProps & {
|
|
822
|
+
previewDisplay: PreviewDisplay;
|
|
823
|
+
previewInvokeMethod?: PreviewInvokeMethod;
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
// @public (undocumented)
|
|
827
|
+
type UiHoverCardViewedEventProps = CommonEventProps & {
|
|
828
|
+
previewDisplay: PreviewDisplay;
|
|
829
|
+
previewInvokeMethod?: PreviewInvokeMethod;
|
|
830
|
+
status: CardType;
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
// @public (undocumented)
|
|
834
|
+
type UiIframeDwelledEventProps = CommonEventProps & {
|
|
835
|
+
id: string;
|
|
836
|
+
display: CardInnerAppearance;
|
|
837
|
+
status: CardType;
|
|
838
|
+
dwellTime: number;
|
|
839
|
+
dwellPercentVisible: number;
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
// @public (undocumented)
|
|
843
|
+
type UiIframeFocusedEventProps = CommonEventProps & {
|
|
844
|
+
id: string;
|
|
845
|
+
display: CardInnerAppearance;
|
|
846
|
+
status: CardType;
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
// @public (undocumented)
|
|
850
|
+
type UiRenderFailedEventProps = CommonEventProps & {
|
|
851
|
+
display: CardInnerAppearance;
|
|
852
|
+
error: Error;
|
|
853
|
+
errorInfo: ErrorInfo;
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
// @public (undocumented)
|
|
857
|
+
type UiRenderSuccessEventProps = CommonEventProps & {
|
|
858
|
+
display: CardInnerAppearance;
|
|
859
|
+
status: CardType;
|
|
860
|
+
};
|
|
861
|
+
|
|
862
|
+
// @public @deprecated
|
|
863
|
+
export const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: AnalyticsHandler, id?: string, defaultLocation?: string) => {
|
|
864
|
+
ui: {
|
|
865
|
+
authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiAuthEventProps) => void;
|
|
866
|
+
authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiAuthAlternateAccountEventProps) => void;
|
|
867
|
+
buttonClickedEvent: (data: Partial<AnalyticsPayload> & {
|
|
868
|
+
actionSubjectId: Required<string>;
|
|
869
|
+
}) => void;
|
|
870
|
+
cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: UiCardClickedEventProps) => void;
|
|
871
|
+
iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: UiIframeDwelledEventProps) => void;
|
|
872
|
+
iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: UiIframeFocusedEventProps) => void;
|
|
873
|
+
actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => void;
|
|
874
|
+
hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardOpenLinkClickedEventProps) => void;
|
|
875
|
+
closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiClosedAuthEventProps) => void;
|
|
876
|
+
modalClosedEvent: (data: Partial<AnalyticsPayload> & {
|
|
877
|
+
actionSubjectId: Required<string>;
|
|
878
|
+
}) => void;
|
|
879
|
+
renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiRenderSuccessEventProps) => void;
|
|
880
|
+
renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => void;
|
|
881
|
+
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: UiHoverCardViewedEventProps) => void;
|
|
882
|
+
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: UiHoverCardDismissedEventProps) => void;
|
|
883
|
+
learnMoreClickedEvent: () => void;
|
|
884
|
+
smartLinkLozengeActionClickedEvent: () => void;
|
|
885
|
+
smartLinkLozengeActionListItemClickedEvent: () => void;
|
|
886
|
+
smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
|
|
887
|
+
};
|
|
888
|
+
operational: {
|
|
889
|
+
invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => void;
|
|
890
|
+
invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => void;
|
|
891
|
+
connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => void;
|
|
892
|
+
connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ConnectFailedEventProps) => void;
|
|
893
|
+
instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: InstrumentEventProps) => void;
|
|
894
|
+
chunkloadFailedEvent: ({ display, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => void;
|
|
895
|
+
};
|
|
896
|
+
track: {
|
|
897
|
+
appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => void;
|
|
898
|
+
appAccountAuthStarted: ({ extensionKey, location, }: TrackAppAccountConnectedProps) => void;
|
|
899
|
+
linkUpdated: (props: CommonEventProps & {
|
|
900
|
+
[key: string]: any;
|
|
901
|
+
}) => void;
|
|
902
|
+
smartLinkQuickActionStarted: (props: {
|
|
903
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
904
|
+
}) => void;
|
|
905
|
+
smartLinkQuickActionSuccess: (props: {
|
|
906
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
907
|
+
}) => void;
|
|
908
|
+
smartLinkQuickActionFailed: (props: {
|
|
909
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
910
|
+
reason?: TrackQuickActionFailureReason;
|
|
911
|
+
step?: string;
|
|
912
|
+
}) => void;
|
|
913
|
+
};
|
|
914
|
+
screen: {
|
|
915
|
+
authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ScreenAuthPopupEventProps) => void;
|
|
916
|
+
modalViewedEvent: (data: Partial<AnalyticsPayload> & {
|
|
917
|
+
name: Extract<AnalyticsName, 'embedPreviewModal'>;
|
|
918
|
+
}) => void;
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
// @public (undocumented)
|
|
923
|
+
export function useSmartLinkEvents(): SmartLinkEvents;
|
|
924
|
+
|
|
925
|
+
// @public
|
|
926
|
+
type ViewCount = {
|
|
927
|
+
name: ElementName.ViewCount;
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
// @public
|
|
931
|
+
type VoteCount = {
|
|
932
|
+
name: ElementName.VoteCount;
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
// (No @packageDocumentation comment for this package)
|
|
936
|
+
|
|
937
|
+
```
|