@atlaskit/smart-card 26.44.2 → 26.45.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 +6 -0
- package/dist/cjs/extractors/block/index.js +3 -2
- package/dist/cjs/extractors/common/actions/extractActions.js +15 -2
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +8 -1
- package/dist/cjs/extractors/flexible/actions/extract-download-action.js +7 -2
- package/dist/cjs/extractors/flexible/actions/extract-follow-action.js +4 -2
- package/dist/cjs/extractors/flexible/actions/extract-preview-action.js +6 -1
- package/dist/cjs/extractors/flexible/actions/extract-view-action.js +6 -1
- package/dist/cjs/extractors/flexible/extract-state.js +5 -2
- package/dist/cjs/extractors/flexible/index.js +6 -6
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/state/hooks-external/useSmartLinkActions.js +16 -23
- package/dist/cjs/utils/actions/can-show-action.js +16 -0
- package/dist/cjs/utils/actions/combine-action-options.js +35 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/index.js +6 -7
- package/dist/cjs/view/BlockCard/views/ForbiddenView.js +3 -4
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +2 -4
- package/dist/cjs/view/BlockCard/views/UnauthorizedView.js +2 -3
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +2 -2
- package/dist/cjs/view/Card/types.js +10 -1
- package/dist/cjs/view/CardWithData/component.js +2 -4
- package/dist/cjs/view/CardWithData/loader.js +1 -3
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -6
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +1 -5
- package/dist/cjs/view/CardWithUrl/component.js +10 -9
- package/dist/cjs/view/CardWithUrl/loader.js +2 -0
- package/dist/cjs/view/EmbedCard/index.js +4 -4
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/container/index.js +2 -3
- package/dist/cjs/view/FlexibleCard/index.js +4 -4
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +8 -5
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +2 -2
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +3 -4
- package/dist/cjs/view/InlineCard/index.js +2 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/block/index.js +3 -2
- package/dist/es2019/extractors/common/actions/extractActions.js +13 -2
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +8 -1
- package/dist/es2019/extractors/flexible/actions/extract-download-action.js +7 -2
- package/dist/es2019/extractors/flexible/actions/extract-follow-action.js +4 -2
- package/dist/es2019/extractors/flexible/actions/extract-preview-action.js +6 -1
- package/dist/es2019/extractors/flexible/actions/extract-view-action.js +6 -1
- package/dist/es2019/extractors/flexible/extract-state.js +5 -2
- package/dist/es2019/extractors/flexible/index.js +6 -6
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/state/hooks-external/useSmartLinkActions.js +15 -18
- package/dist/es2019/utils/actions/can-show-action.js +10 -0
- package/dist/es2019/utils/actions/combine-action-options.js +27 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/index.js +6 -7
- package/dist/es2019/view/BlockCard/views/ForbiddenView.js +3 -3
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +2 -3
- package/dist/es2019/view/BlockCard/views/UnauthorizedView.js +2 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +2 -2
- package/dist/es2019/view/Card/types.js +8 -1
- package/dist/es2019/view/CardWithData/component.js +2 -4
- package/dist/es2019/view/CardWithData/loader.js +1 -3
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +1 -5
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +1 -5
- package/dist/es2019/view/CardWithUrl/component.js +10 -9
- package/dist/es2019/view/CardWithUrl/loader.js +2 -0
- package/dist/es2019/view/EmbedCard/index.js +4 -4
- package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/container/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/index.js +4 -4
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +8 -4
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +2 -2
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +3 -3
- package/dist/es2019/view/InlineCard/index.js +2 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/block/index.js +3 -2
- package/dist/esm/extractors/common/actions/extractActions.js +15 -2
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +8 -1
- package/dist/esm/extractors/flexible/actions/extract-download-action.js +7 -2
- package/dist/esm/extractors/flexible/actions/extract-follow-action.js +4 -2
- package/dist/esm/extractors/flexible/actions/extract-preview-action.js +6 -1
- package/dist/esm/extractors/flexible/actions/extract-view-action.js +6 -1
- package/dist/esm/extractors/flexible/extract-state.js +5 -2
- package/dist/esm/extractors/flexible/index.js +6 -6
- package/dist/esm/index.js +1 -0
- package/dist/esm/state/hooks-external/useSmartLinkActions.js +17 -24
- package/dist/esm/utils/actions/can-show-action.js +10 -0
- package/dist/esm/utils/actions/combine-action-options.js +28 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/index.js +6 -7
- package/dist/esm/view/BlockCard/views/ForbiddenView.js +3 -4
- package/dist/esm/view/BlockCard/views/ResolvedView.js +2 -4
- package/dist/esm/view/BlockCard/views/UnauthorizedView.js +2 -3
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +2 -2
- package/dist/esm/view/Card/types.js +8 -1
- package/dist/esm/view/CardWithData/component.js +2 -4
- package/dist/esm/view/CardWithData/loader.js +1 -3
- package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -6
- package/dist/esm/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +1 -5
- package/dist/esm/view/CardWithUrl/component.js +10 -9
- package/dist/esm/view/CardWithUrl/loader.js +2 -0
- package/dist/esm/view/EmbedCard/index.js +4 -4
- package/dist/esm/view/FlexibleCard/components/container/hover-card-control/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/container/index.js +2 -3
- package/dist/esm/view/FlexibleCard/index.js +4 -4
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +8 -5
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +2 -2
- package/dist/esm/view/InlineCard/ResolvedView/index.js +3 -4
- package/dist/esm/view/InlineCard/index.js +2 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/block/types.d.ts +2 -1
- package/dist/types/extractors/common/__mocks__/jsonld.d.ts +1 -0
- package/dist/types/extractors/common/actions/extractActions.d.ts +2 -1
- package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +1 -1
- package/dist/types/extractors/flexible/actions/extract-download-action.d.ts +2 -1
- package/dist/types/extractors/flexible/actions/extract-follow-action.d.ts +2 -1
- package/dist/types/extractors/flexible/actions/extract-preview-action.d.ts +2 -1
- package/dist/types/extractors/flexible/actions/extract-view-action.d.ts +2 -1
- package/dist/types/extractors/flexible/extract-state.d.ts +2 -1
- package/dist/types/extractors/flexible/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/state/hooks-external/useSmartLinkActions.d.ts +10 -2
- package/dist/types/utils/actions/can-show-action.d.ts +2 -0
- package/dist/types/utils/actions/combine-action-options.d.ts +2 -0
- package/dist/types/view/BlockCard/types.d.ts +2 -3
- package/dist/types/view/BlockCard/views/ForbiddenView.d.ts +3 -2
- package/dist/types/view/BlockCard/views/ResolvedView.d.ts +1 -2
- package/dist/types/view/BlockCard/views/UnauthorizedView.d.ts +3 -2
- package/dist/types/view/BlockCard/views/flexible/types.d.ts +1 -1
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +20 -2
- package/dist/types/view/CardWithData/types.d.ts +7 -1
- package/dist/types/view/CardWithUrl/types.d.ts +12 -1
- package/dist/types/view/EmbedCard/types.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/container/hover-card-control/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/container/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/types.d.ts +4 -4
- package/dist/types/view/HoverCard/types.d.ts +9 -2
- package/dist/types/view/InlineCard/ResolvedView/index.d.ts +3 -2
- package/dist/types/view/InlineCard/types.d.ts +2 -1
- package/dist/types-ts4.5/extractors/block/types.d.ts +2 -1
- package/dist/types-ts4.5/extractors/common/__mocks__/jsonld.d.ts +1 -0
- package/dist/types-ts4.5/extractors/common/actions/extractActions.d.ts +2 -1
- package/dist/types-ts4.5/extractors/common/actions/extractPreviewAction.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/actions/extract-download-action.d.ts +2 -1
- package/dist/types-ts4.5/extractors/flexible/actions/extract-follow-action.d.ts +2 -1
- package/dist/types-ts4.5/extractors/flexible/actions/extract-preview-action.d.ts +2 -1
- package/dist/types-ts4.5/extractors/flexible/actions/extract-view-action.d.ts +2 -1
- package/dist/types-ts4.5/extractors/flexible/extract-state.d.ts +2 -1
- package/dist/types-ts4.5/extractors/flexible/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/state/hooks-external/useSmartLinkActions.d.ts +10 -2
- package/dist/types-ts4.5/utils/actions/can-show-action.d.ts +2 -0
- package/dist/types-ts4.5/utils/actions/combine-action-options.d.ts +2 -0
- package/dist/types-ts4.5/view/BlockCard/types.d.ts +2 -3
- package/dist/types-ts4.5/view/BlockCard/views/ForbiddenView.d.ts +3 -2
- package/dist/types-ts4.5/view/BlockCard/views/ResolvedView.d.ts +1 -2
- package/dist/types-ts4.5/view/BlockCard/views/UnauthorizedView.d.ts +3 -2
- package/dist/types-ts4.5/view/BlockCard/views/flexible/types.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +20 -2
- package/dist/types-ts4.5/view/CardWithData/types.d.ts +7 -1
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +12 -1
- package/dist/types-ts4.5/view/EmbedCard/types.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/container/hover-card-control/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/container/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +4 -4
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +9 -2
- package/dist/types-ts4.5/view/InlineCard/ResolvedView/index.d.ts +3 -2
- package/dist/types-ts4.5/view/InlineCard/types.d.ts +2 -1
- package/package.json +7 -4
|
@@ -29,7 +29,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
29
29
|
renderers = _ref.renderers,
|
|
30
30
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
31
31
|
showHoverPreview = _ref.showHoverPreview,
|
|
32
|
-
|
|
32
|
+
actionOptions = _ref.actionOptions,
|
|
33
33
|
testId = _ref.testId,
|
|
34
34
|
ui = _ref.ui,
|
|
35
35
|
url = _ref.url;
|
|
@@ -41,11 +41,11 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
41
41
|
response: details,
|
|
42
42
|
id: id,
|
|
43
43
|
renderers: renderers,
|
|
44
|
-
|
|
44
|
+
actionOptions: actionOptions,
|
|
45
45
|
status: status,
|
|
46
46
|
url: url
|
|
47
47
|
});
|
|
48
|
-
}, [details, id, renderers,
|
|
48
|
+
}, [details, id, renderers, actionOptions, status, url]);
|
|
49
49
|
var retry = getRetryOptions(url, status, details, onAuthorize);
|
|
50
50
|
var _ref2 = context || {},
|
|
51
51
|
title = _ref2.title;
|
|
@@ -92,7 +92,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
92
92
|
onClick: onClick,
|
|
93
93
|
retry: retry,
|
|
94
94
|
showHoverPreview: showHoverPreview,
|
|
95
|
-
|
|
95
|
+
actionOptions: actionOptions,
|
|
96
96
|
showAuthTooltip: showAuthTooltip,
|
|
97
97
|
status: status
|
|
98
98
|
}), children))));
|
|
@@ -12,6 +12,7 @@ import CustomPopupContainer from '../components/CustomPopupContainer';
|
|
|
12
12
|
import { CARD_GAP_PX, HOVER_CARD_Z_INDEX } from '../styled';
|
|
13
13
|
import { CardDisplay } from '../../../constants';
|
|
14
14
|
import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
|
|
15
|
+
import { combineActionOptions } from '../../../utils/actions/combine-action-options';
|
|
15
16
|
import { useSmartCardActions } from '../../../state/actions';
|
|
16
17
|
import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
17
18
|
var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
|
|
@@ -30,8 +31,8 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
30
31
|
closeOnChildClick = _ref$closeOnChildClic === void 0 ? false : _ref$closeOnChildClic,
|
|
31
32
|
_ref$hidePreviewButto = _ref.hidePreviewButton,
|
|
32
33
|
hidePreviewButton = _ref$hidePreviewButto === void 0 ? false : _ref$hidePreviewButto,
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
showServerActions = _ref.showServerActions,
|
|
35
|
+
actionOptionsProp = _ref.actionOptions,
|
|
35
36
|
_ref$allowEventPropag = _ref.allowEventPropagation,
|
|
36
37
|
allowEventPropagation = _ref$allowEventPropag === void 0 ? false : _ref$allowEventPropag,
|
|
37
38
|
_ref$zIndex = _ref.zIndex,
|
|
@@ -53,6 +54,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
53
54
|
var analytics = useSmartLinkAnalytics(url, undefined, id);
|
|
54
55
|
var _useSmartCardActions = useSmartCardActions(id, url, analytics),
|
|
55
56
|
loadMetadata = _useSmartCardActions.loadMetadata;
|
|
57
|
+
var actionOptions = combineActionOptions(actionOptionsProp, showServerActions);
|
|
56
58
|
var setMousePosition = useCallback(function (event) {
|
|
57
59
|
if (isOpen && canOpen) {
|
|
58
60
|
return;
|
|
@@ -154,7 +156,8 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
154
156
|
url: url,
|
|
155
157
|
appearance: CardDisplay.HoverCardPreview,
|
|
156
158
|
analyticsHandler: analyticsHandler,
|
|
157
|
-
origin: HOVER_CARD_SOURCE
|
|
159
|
+
origin: HOVER_CARD_SOURCE,
|
|
160
|
+
actionOptions: actionOptions
|
|
158
161
|
});
|
|
159
162
|
var filteredActions = useMemo(function () {
|
|
160
163
|
return hidePreviewButton ? linkActions.filter(function (action) {
|
|
@@ -192,7 +195,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
192
195
|
onActionClick: onActionClick,
|
|
193
196
|
onResolve: update,
|
|
194
197
|
renderers: renderers,
|
|
195
|
-
|
|
198
|
+
actionOptions: actionOptions,
|
|
196
199
|
url: url,
|
|
197
200
|
id: id
|
|
198
201
|
};
|
|
@@ -202,7 +205,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
202
205
|
id: id,
|
|
203
206
|
source: HOVER_CARD_SOURCE
|
|
204
207
|
}, jsx(HoverCardContent, hoverCardContentProps));
|
|
205
|
-
}, [initShowCard, initHideCard, filteredActions, linkState, onActionClick, renderers,
|
|
208
|
+
}, [initShowCard, initHideCard, filteredActions, linkState, onActionClick, renderers, actionOptions, url, id]);
|
|
206
209
|
var trigger = useCallback(function (triggerProps) {
|
|
207
210
|
return jsx("span", {
|
|
208
211
|
ref: parentSpan
|
|
@@ -67,7 +67,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
67
67
|
url = _ref.url,
|
|
68
68
|
onMouseEnter = _ref.onMouseEnter,
|
|
69
69
|
onMouseLeave = _ref.onMouseLeave,
|
|
70
|
-
|
|
70
|
+
actionOptions = _ref.actionOptions;
|
|
71
71
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
72
72
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
73
73
|
var defaultAnalytics = useSmartLinkAnalytics(url, undefined, id);
|
|
@@ -143,7 +143,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
143
143
|
onClick: onClick,
|
|
144
144
|
onResolve: onResolve,
|
|
145
145
|
renderers: renderers,
|
|
146
|
-
|
|
146
|
+
actionOptions: actionOptions,
|
|
147
147
|
ui: flexibleUiOptions,
|
|
148
148
|
url: url,
|
|
149
149
|
children: {},
|
|
@@ -49,8 +49,7 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
49
49
|
titlePrefix = _this$props.titlePrefix,
|
|
50
50
|
_this$props$showHover = _this$props.showHoverPreview,
|
|
51
51
|
showHoverPreview = _this$props$showHover === void 0 ? false : _this$props$showHover,
|
|
52
|
-
|
|
53
|
-
showServerActions = _this$props$showServe === void 0 ? false : _this$props$showServe;
|
|
52
|
+
actionOptions = _this$props.actionOptions;
|
|
54
53
|
var inlineCardResolvedView = /*#__PURE__*/React.createElement(Frame, {
|
|
55
54
|
testId: testId,
|
|
56
55
|
link: link,
|
|
@@ -66,8 +65,8 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
66
65
|
if (showHoverPreview && link) {
|
|
67
66
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
68
67
|
id: id,
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
url: link,
|
|
69
|
+
actionOptions: actionOptions
|
|
71
70
|
}, inlineCardResolvedView);
|
|
72
71
|
}
|
|
73
72
|
return inlineCardResolvedView;
|
|
@@ -32,7 +32,7 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
32
32
|
inlinePreloaderStyle = _ref.inlinePreloaderStyle,
|
|
33
33
|
showHoverPreview = _ref.showHoverPreview,
|
|
34
34
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
35
|
-
|
|
35
|
+
actionOptions = _ref.actionOptions;
|
|
36
36
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
37
37
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
38
38
|
var status = cardState.status,
|
|
@@ -81,7 +81,7 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
81
81
|
return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedProps, {
|
|
82
82
|
id: id,
|
|
83
83
|
showHoverPreview: showHoverPreview,
|
|
84
|
-
|
|
84
|
+
actionOptions: actionOptions,
|
|
85
85
|
link: url,
|
|
86
86
|
isSelected: isSelected,
|
|
87
87
|
isHovered: isHovered,
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.
|
|
13
|
+
packageVersion: "26.45.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InvokeHandler } from '../../model/invoke-handler';
|
|
2
2
|
import { AnalyticsFacade } from '../../state/analytics';
|
|
3
|
-
import { CardInnerAppearance } from '../../view/Card/types';
|
|
3
|
+
import { CardActionOptions, CardInnerAppearance } from '../../view/Card/types';
|
|
4
4
|
import { AnalyticsOrigin } from '../../utils/types';
|
|
5
5
|
export interface ExtractBlockOpts {
|
|
6
6
|
handleInvoke: InvokeHandler;
|
|
@@ -9,4 +9,5 @@ export interface ExtractBlockOpts {
|
|
|
9
9
|
extensionKey?: string;
|
|
10
10
|
source?: CardInnerAppearance;
|
|
11
11
|
testId?: string;
|
|
12
|
+
actionOptions?: CardActionOptions;
|
|
12
13
|
}
|
|
@@ -34,6 +34,7 @@ export declare const TEST_STATUS_UPDATE_ACTION: JsonLd.Primitives.UpdateAction;
|
|
|
34
34
|
export declare const TEST_DOCUMENT_WITH_ACTIONS: JsonLd.Data.BaseData;
|
|
35
35
|
export declare const TEST_DOCUMENT_WITH_DOWNLOAD_ACTION: JsonLd.Data.BaseData;
|
|
36
36
|
export declare const TEST_DOCUMENT_WITH_VIEW_ACTION: JsonLd.Data.BaseData;
|
|
37
|
+
export declare const TEST_DOCUMENT_WITH_MULTIPLE_ACTIONS: JsonLd.Data.BaseData;
|
|
37
38
|
export declare const PREVIEW: JsonLd.Data.BaseData['preview'];
|
|
38
39
|
export declare const TEST_DOCUMENT_WITH_PREVIEW: JsonLd.Data.BaseData;
|
|
39
40
|
export declare const TEST_DATA_WITH_LATEST_COMMIT_OBJ: JsonLd.Data.SourceCodeRepository;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { InvokeHandler } from '../../../model/invoke-handler';
|
|
3
3
|
import { ActionProps } from '../../../view/BlockCard/components/Action';
|
|
4
|
+
import { type CardActionOptions } from '../../../view/Card/types';
|
|
4
5
|
export declare const getActionsFromJsonLd: (jsonLd: JsonLd.Data.BaseData) => JsonLd.Primitives.Action[];
|
|
5
|
-
export declare function extractClientActions(jsonLd: JsonLd.Data.BaseData, handler: InvokeHandler): ActionProps[];
|
|
6
|
+
export declare function extractClientActions(jsonLd: JsonLd.Data.BaseData, handler: InvokeHandler, actionOptions?: CardActionOptions): ActionProps[];
|
|
@@ -2,7 +2,7 @@ import { JsonLd } from 'json-ld-types';
|
|
|
2
2
|
import { CardPlatform } from '../../../view/Card/types';
|
|
3
3
|
import { BlockCardResolvedViewProps } from '../../../view/BlockCard';
|
|
4
4
|
import { ExtractBlockOpts } from '../../block/types';
|
|
5
|
-
export declare const extractPreviewAction: ({ extensionKey, viewProps, jsonLd, handleInvoke, testId, platform, origin, source, analytics, meta, }: ExtractBlockOpts & {
|
|
5
|
+
export declare const extractPreviewAction: ({ extensionKey, viewProps, jsonLd, handleInvoke, testId, platform, origin, source, analytics, meta, actionOptions, }: ExtractBlockOpts & {
|
|
6
6
|
viewProps: BlockCardResolvedViewProps;
|
|
7
7
|
jsonLd: JsonLd.Data.BaseData;
|
|
8
8
|
platform?: JsonLd.Primitives.Platforms | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
+
import { type CardActionOptions } from '../../../view/Card/types';
|
|
2
3
|
import { DownloadActionData } from '../../../state/flexible-ui-context/types';
|
|
3
|
-
export declare const extractDownloadAction: (data: JsonLd.Data.BaseData) => DownloadActionData | undefined;
|
|
4
|
+
export declare const extractDownloadAction: (data: JsonLd.Data.BaseData, actionOptions?: CardActionOptions) => DownloadActionData | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { ServerActionProp } from '../../../state/flexible-ui-context/types';
|
|
3
|
-
|
|
3
|
+
import { type CardActionOptions } from '../../../view/Card/types';
|
|
4
|
+
declare const extractFollowAction: (response?: JsonLd.Response, actionOptions?: CardActionOptions, id?: string) => ServerActionProp<boolean> | undefined;
|
|
4
5
|
export default extractFollowAction;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { PreviewActionData } from '../../../state/flexible-ui-context/types';
|
|
3
|
-
|
|
3
|
+
import { type CardActionOptions } from '../../../view/Card/types';
|
|
4
|
+
export declare const extractPreviewAction: (response: JsonLd.Response, actionOptions?: CardActionOptions) => PreviewActionData | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { ViewActionData } from '../../../state/flexible-ui-context/types';
|
|
3
|
-
|
|
3
|
+
import { type CardActionOptions } from '../../../view/Card/types';
|
|
4
|
+
export declare const extractViewAction: (data: JsonLd.Data.BaseData, actionOptions?: CardActionOptions) => ViewActionData | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { LinkLozenge } from '../common/lozenge/types';
|
|
3
|
-
|
|
3
|
+
import { type CardActionOptions } from '../../view/Card/types';
|
|
4
|
+
declare const extractState: (response?: JsonLd.Response, actionOptions?: CardActionOptions, id?: string) => LinkLozenge | undefined;
|
|
4
5
|
export default extractState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FlexibleUiDataContext } from '../../state/flexible-ui-context/types';
|
|
2
2
|
import { ExtractFlexibleUiDataContextParams } from '../../view/FlexibleCard/types';
|
|
3
|
-
declare const extractFlexibleUiContext: ({ id, renderers,
|
|
3
|
+
declare const extractFlexibleUiContext: ({ id, renderers, actionOptions, response, }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
4
4
|
export default extractFlexibleUiContext;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { APIError } from '@atlaskit/linking-common';
|
|
|
7
7
|
export { CardClient as Client } from '@atlaskit/link-provider';
|
|
8
8
|
export { Card } from './view/Card';
|
|
9
9
|
export type { CardProps, CardAppearance, CardPlatform } from './view/Card';
|
|
10
|
+
export { CardAction } from './view/Card/types';
|
|
10
11
|
export { SmartCardContext as Context } from '@atlaskit/link-provider';
|
|
11
12
|
export type { CardContext } from '@atlaskit/link-provider';
|
|
12
13
|
export { EmbedResizeMessageListener } from './view/EmbedCard/EmbedResizeMessageListener';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { JsonLd } from 'json-ld-types';
|
|
3
3
|
import type { AnalyticsHandler, AnalyticsOrigin } from '../../utils/types';
|
|
4
|
-
import type { CardInnerAppearance } from '../../view/Card/types';
|
|
4
|
+
import type { CardActionOptions, CardInnerAppearance } from '../../view/Card/types';
|
|
5
5
|
export interface LinkAction {
|
|
6
6
|
/**
|
|
7
7
|
* Unique ID for the action.
|
|
@@ -48,5 +48,13 @@ export interface UseSmartLinkActionsOpts {
|
|
|
48
48
|
* Smart link origin that the action being invoked from.
|
|
49
49
|
*/
|
|
50
50
|
origin?: AnalyticsOrigin;
|
|
51
|
+
/**
|
|
52
|
+
* Configure the visiblity of actions
|
|
53
|
+
*/
|
|
54
|
+
actionOptions?: CardActionOptions;
|
|
51
55
|
}
|
|
52
|
-
export declare function useSmartLinkActions({ url, appearance, analyticsHandler, platform, origin, }: UseSmartLinkActionsOpts):
|
|
56
|
+
export declare function useSmartLinkActions({ url, appearance, analyticsHandler, platform, origin, actionOptions, }: UseSmartLinkActionsOpts): {
|
|
57
|
+
id: string;
|
|
58
|
+
text: import("react").ReactNode;
|
|
59
|
+
invoke: () => Promise<any>;
|
|
60
|
+
}[];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { CardAuthFlowOpts, CardProviderRenderers } from '@atlaskit/link-provider';
|
|
3
3
|
import { CardState } from '../../state/types';
|
|
4
4
|
import { InvokeHandler } from '../../model/invoke-handler';
|
|
5
|
-
import { CardPlatform, OnResolveCallback } from '../Card/types';
|
|
5
|
+
import type { CardPlatform, OnResolveCallback, CardActionOptions } from '../Card/types';
|
|
6
6
|
import { OnErrorCallback } from '../types';
|
|
7
7
|
import { AnalyticsFacade } from '../../state/analytics';
|
|
8
8
|
export type BlockCardProps = {
|
|
@@ -18,8 +18,7 @@ export type BlockCardProps = {
|
|
|
18
18
|
onResolve?: OnResolveCallback;
|
|
19
19
|
onError?: OnErrorCallback;
|
|
20
20
|
testId?: string;
|
|
21
|
-
|
|
22
|
-
showServerActions?: boolean;
|
|
21
|
+
actionOptions?: CardActionOptions;
|
|
23
22
|
renderers?: CardProviderRenderers;
|
|
24
23
|
platform?: CardPlatform;
|
|
25
24
|
analytics: AnalyticsFacade;
|
|
@@ -4,6 +4,7 @@ import { jsx } from '@emotion/react';
|
|
|
4
4
|
import { ActionProps } from '../components/Action';
|
|
5
5
|
import { IconProps } from '../../common/Icon';
|
|
6
6
|
import { RequestAccessContextProps } from '../../types';
|
|
7
|
+
import type { CardActionOptions } from '../../Card/types';
|
|
7
8
|
export interface PermissionDeniedProps {
|
|
8
9
|
actions?: Array<ActionProps>;
|
|
9
10
|
context?: {
|
|
@@ -15,9 +16,9 @@ export interface PermissionDeniedProps {
|
|
|
15
16
|
onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
|
|
16
17
|
isSelected?: boolean;
|
|
17
18
|
testId?: string;
|
|
18
|
-
|
|
19
|
+
actionOptions?: CardActionOptions;
|
|
19
20
|
requestAccessContext?: RequestAccessContextProps;
|
|
20
21
|
}
|
|
21
22
|
export declare const blockCardForbiddenViewClassName = "block-card-forbidden-view";
|
|
22
23
|
export declare const blockCardForbiddenViewLinkClassName = "block-card-forbidden-view-link";
|
|
23
|
-
export declare const ForbiddenView: ({ context, isSelected, actions, testId,
|
|
24
|
+
export declare const ForbiddenView: ({ context, isSelected, actions, testId, link, onClick, requestAccessContext, actionOptions, }: PermissionDeniedProps) => jsx.JSX.Element;
|
|
@@ -25,7 +25,6 @@ export interface ResolvedViewProps {
|
|
|
25
25
|
onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
|
|
26
26
|
isSelected?: boolean;
|
|
27
27
|
testId?: string;
|
|
28
|
-
showActions?: boolean;
|
|
29
28
|
titlePrefix?: React.ReactNode;
|
|
30
29
|
isTrusted?: boolean;
|
|
31
30
|
/** It determines whether a link source supports different design theme modes */
|
|
@@ -33,4 +32,4 @@ export interface ResolvedViewProps {
|
|
|
33
32
|
}
|
|
34
33
|
export declare const blockCardResolvedViewClassName = "block-card-resolved-view";
|
|
35
34
|
export declare const blockCardResolvedViewByClassName = "block-card-resolved-view-by";
|
|
36
|
-
export declare const ResolvedView: ({ icon, actions, thumbnail, context, title, titleTextColor, titlePrefix, isSelected, users, handleAvatarClick, handleMoreAvatarsClick, onClick, link, byline, lozenge, details, testId,
|
|
35
|
+
export declare const ResolvedView: ({ icon, actions, thumbnail, context, title, titleTextColor, titlePrefix, isSelected, users, handleAvatarClick, handleMoreAvatarsClick, onClick, link, byline, lozenge, details, testId, }: ResolvedViewProps) => jsx.JSX.Element;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { ActionProps } from '../components/Action';
|
|
5
5
|
import { IconProps } from '../../common/Icon';
|
|
6
|
+
import type { CardActionOptions } from '../../Card/types';
|
|
6
7
|
export interface UnauthorizedViewProps {
|
|
7
8
|
actions: ActionProps[];
|
|
8
9
|
context?: {
|
|
@@ -11,9 +12,9 @@ export interface UnauthorizedViewProps {
|
|
|
11
12
|
};
|
|
12
13
|
isSelected?: boolean;
|
|
13
14
|
testId?: string;
|
|
14
|
-
|
|
15
|
+
actionOptions?: CardActionOptions;
|
|
15
16
|
icon: IconProps;
|
|
16
17
|
link?: string;
|
|
17
18
|
onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
|
|
18
19
|
}
|
|
19
|
-
export declare const UnauthorizedView: ({ context, isSelected, actions, testId,
|
|
20
|
+
export declare const UnauthorizedView: ({ context, isSelected, actions, testId, actionOptions, link, onClick, }: UnauthorizedViewProps) => jsx.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FlexibleCardProps } from '../../../FlexibleCard/types';
|
|
2
|
-
export type FlexibleBlockCardProps = Pick<FlexibleCardProps, 'analytics' | 'cardState' | 'id' | 'onAuthorize' | 'onClick' | 'onError' | 'onResolve' | 'renderers' | '
|
|
2
|
+
export type FlexibleBlockCardProps = Pick<FlexibleCardProps, 'analytics' | 'cardState' | 'id' | 'onAuthorize' | 'onClick' | 'onError' | 'onResolve' | 'renderers' | 'actionOptions' | 'testId' | 'url'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CardAppearance, CardPlatform, CardProps } from './types';
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "container" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "container" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -14,6 +14,19 @@ export type OnResolveCallback = (data: {
|
|
|
14
14
|
title?: string;
|
|
15
15
|
aspectRatio?: number;
|
|
16
16
|
}) => void;
|
|
17
|
+
export declare enum CardAction {
|
|
18
|
+
DownloadAction = "DownloadAction",
|
|
19
|
+
PreviewAction = "PreviewAction",
|
|
20
|
+
ViewAction = "ViewAction",
|
|
21
|
+
ChangeStatusAction = "ChangeStatusAction",
|
|
22
|
+
FollowAction = "FollowAction"
|
|
23
|
+
}
|
|
24
|
+
export type CardActionOptions = {
|
|
25
|
+
hide: true;
|
|
26
|
+
} | {
|
|
27
|
+
hide: false;
|
|
28
|
+
exclude?: Array<CardAction>;
|
|
29
|
+
};
|
|
17
30
|
export interface CardProps extends WithAnalyticsEventsProps {
|
|
18
31
|
appearance: CardAppearance;
|
|
19
32
|
id?: string;
|
|
@@ -40,14 +53,19 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
40
53
|
url?: string;
|
|
41
54
|
testId?: string;
|
|
42
55
|
/**
|
|
43
|
-
*
|
|
56
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6348 Internal documentation for deprecation (no external access)}
|
|
57
|
+
*
|
|
58
|
+
* Prefer `actionOptions` prop. Show client actions, e.g. preview, download, etc.
|
|
44
59
|
* These actions do not change the link resource.
|
|
45
60
|
*/
|
|
46
61
|
showActions?: boolean;
|
|
47
62
|
/**
|
|
48
|
-
*
|
|
63
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6348 Internal documentation for deprecation (no external access)}
|
|
64
|
+
*
|
|
65
|
+
* Prefer `actionOptions` prop. Show server actions that change the link resource, e.g. update status.
|
|
49
66
|
*/
|
|
50
67
|
showServerActions?: boolean;
|
|
68
|
+
actionOptions?: CardActionOptions;
|
|
51
69
|
onResolve?: OnResolveCallback;
|
|
52
70
|
/**
|
|
53
71
|
* A callback function currently invoked in two cases
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventHandler, MouseEvent, KeyboardEvent } from 'react';
|
|
2
|
-
import { CardAppearance, OnResolveCallback } from '../Card/types';
|
|
2
|
+
import type { CardAppearance, OnResolveCallback, CardActionOptions } from '../Card/types';
|
|
3
3
|
import { JsonLd } from 'json-ld-types';
|
|
4
4
|
import { InlinePreloaderStyle } from '../types';
|
|
5
5
|
export interface CardWithDataContentProps {
|
|
@@ -10,6 +10,12 @@ export interface CardWithDataContentProps {
|
|
|
10
10
|
isSelected?: boolean;
|
|
11
11
|
testId?: string;
|
|
12
12
|
onResolve?: OnResolveCallback;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6348 Internal documentation for deprecation (no external access)}
|
|
15
|
+
*
|
|
16
|
+
* Prefer 'actionOptions' prop. Determines whether to show available server actions.
|
|
17
|
+
*/
|
|
13
18
|
showActions?: boolean;
|
|
19
|
+
actionOptions?: CardActionOptions;
|
|
14
20
|
inlinePreloaderStyle?: InlinePreloaderStyle;
|
|
15
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventHandler, MouseEvent, KeyboardEvent } from 'react';
|
|
2
|
-
import { CardAppearance, CardPlatform, EmbedIframeUrlType, OnResolveCallback } from '../Card/types';
|
|
2
|
+
import type { CardAppearance, CardPlatform, EmbedIframeUrlType, OnResolveCallback, CardActionOptions } from '../Card/types';
|
|
3
3
|
import { AnalyticsHandler } from '../../utils/types';
|
|
4
4
|
import { FlexibleUiOptions } from '../FlexibleCard/types';
|
|
5
5
|
import { InlinePreloaderStyle, OnErrorCallback } from '../types';
|
|
@@ -24,8 +24,19 @@ export type CardWithUrlContentProps = {
|
|
|
24
24
|
testId?: string;
|
|
25
25
|
onResolve?: OnResolveCallback;
|
|
26
26
|
onError?: OnErrorCallback;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6348 Internal documentation for deprecation (no external access)}
|
|
29
|
+
*
|
|
30
|
+
* Prefer 'actionOptions' prop.
|
|
31
|
+
*/
|
|
27
32
|
showActions?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6348 Internal documentation for deprecation (no external access)}
|
|
35
|
+
*
|
|
36
|
+
* Prefer 'actionOptions' prop.
|
|
37
|
+
*/
|
|
28
38
|
showServerActions?: boolean;
|
|
39
|
+
actionOptions?: CardActionOptions;
|
|
29
40
|
inheritDimensions?: boolean;
|
|
30
41
|
embedIframeRef?: React.Ref<HTMLIFrameElement>;
|
|
31
42
|
embedIframeUrlType?: EmbedIframeUrlType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CardState } from '../../state/types';
|
|
2
2
|
import { InvokeHandler } from '../../model/invoke-handler';
|
|
3
|
-
import { CardPlatform, EmbedIframeUrlType, OnResolveCallback } from '../Card/types';
|
|
3
|
+
import type { CardPlatform, EmbedIframeUrlType, OnResolveCallback, CardActionOptions } from '../Card/types';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { ActionProps } from '../BlockCard/components/Action';
|
|
6
6
|
import { RequestAccessMessageKey } from '../../messages';
|
|
@@ -23,7 +23,7 @@ export type EmbedCardProps = {
|
|
|
23
23
|
onError?: OnErrorCallback;
|
|
24
24
|
testId?: string;
|
|
25
25
|
inheritDimensions?: boolean;
|
|
26
|
-
|
|
26
|
+
actionOptions?: CardActionOptions;
|
|
27
27
|
onIframeDwell?: (dwellTime: number, dwellPercentVisible: number) => void;
|
|
28
28
|
onIframeFocus?: () => void;
|
|
29
29
|
iframeUrlType?: EmbedIframeUrlType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContainerProps } from '../types';
|
|
2
|
-
export type HoverCardDelayProps = Pick<ContainerProps, 'hideHoverCardPreviewButton' | '
|
|
2
|
+
export type HoverCardDelayProps = Pick<ContainerProps, 'hideHoverCardPreviewButton' | 'actionOptions'> & {
|
|
3
3
|
isHoverPreview?: boolean;
|
|
4
4
|
isAuthTooltip?: boolean;
|
|
5
5
|
testId?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SmartLinkStatus } from '../../../../constants';
|
|
2
2
|
import { FlexibleCardProps, FlexibleUiOptions, RetryOptions } from '../../types';
|
|
3
|
-
export type ContainerProps = Pick<FlexibleCardProps, 'onClick' | 'showHoverPreview' | '
|
|
3
|
+
export type ContainerProps = Pick<FlexibleCardProps, 'onClick' | 'showHoverPreview' | 'actionOptions' | 'showAuthTooltip'> & FlexibleUiOptions & {
|
|
4
4
|
/**
|
|
5
5
|
* The options that determine the retry behaviour when a Smart Link errors.
|
|
6
6
|
*/
|
|
@@ -4,7 +4,7 @@ import type { JsonLd } from 'json-ld-types';
|
|
|
4
4
|
import { CardState, LinkingPlatformFeatureFlags } from '@atlaskit/linking-common';
|
|
5
5
|
import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
6
6
|
import { SmartLinkSize, SmartLinkStatus, SmartLinkTheme } from '../../constants';
|
|
7
|
-
import { CardInnerAppearance, OnResolveCallback } from '../Card/types';
|
|
7
|
+
import type { CardInnerAppearance, OnResolveCallback, CardActionOptions } from '../Card/types';
|
|
8
8
|
import { OnErrorCallback } from '../types';
|
|
9
9
|
import { AnalyticsFacade } from '../../state/analytics';
|
|
10
10
|
export type FlexibleCardProps = {
|
|
@@ -57,9 +57,9 @@ export type FlexibleCardProps = {
|
|
|
57
57
|
*/
|
|
58
58
|
renderers?: CardProviderRenderers;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* Configure visibility of server and client actions
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
actionOptions?: CardActionOptions;
|
|
63
63
|
/**
|
|
64
64
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
65
65
|
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -141,7 +141,7 @@ export type RetryOptions = {
|
|
|
141
141
|
*/
|
|
142
142
|
values?: Record<string, string>;
|
|
143
143
|
};
|
|
144
|
-
export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'id' | '
|
|
144
|
+
export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'id' | 'actionOptions' | 'renderers' | 'url'> & {
|
|
145
145
|
status?: SmartLinkStatus;
|
|
146
146
|
response?: JsonLd.Response;
|
|
147
147
|
featureFlags?: Partial<LinkingPlatformFeatureFlags>;
|
|
@@ -7,6 +7,7 @@ import { AnalyticsHandler } from '../../utils/types';
|
|
|
7
7
|
import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
8
8
|
import { MouseEventHandler, ReactElement } from 'react';
|
|
9
9
|
import { JsonLd } from 'json-ld-types';
|
|
10
|
+
import type { CardActionOptions } from '../Card/types';
|
|
10
11
|
export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
11
12
|
/**
|
|
12
13
|
* Unique ID for a hover card. Used for analytics.
|
|
@@ -40,9 +41,15 @@ export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
|
40
41
|
*/
|
|
41
42
|
hidePreviewButton?: boolean;
|
|
42
43
|
/**
|
|
43
|
-
*
|
|
44
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6348 Internal documentation for deprecation (no external access)}
|
|
45
|
+
*
|
|
46
|
+
* Prefer 'actionOptions' prop. Determines whether to show available server actions.
|
|
44
47
|
*/
|
|
45
48
|
showServerActions?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Configure visibility of server and client actions
|
|
51
|
+
*/
|
|
52
|
+
actionOptions?: CardActionOptions;
|
|
46
53
|
/**
|
|
47
54
|
* Z-index that the hover card should be displayed in.
|
|
48
55
|
* This is passed to the portal component.
|
|
@@ -90,7 +97,7 @@ export type HoverCardContentProps = {
|
|
|
90
97
|
url: string;
|
|
91
98
|
onMouseEnter?: MouseEventHandler;
|
|
92
99
|
onMouseLeave?: MouseEventHandler;
|
|
93
|
-
|
|
100
|
+
actionOptions?: CardActionOptions;
|
|
94
101
|
};
|
|
95
102
|
export type ImagePreviewProps = {
|
|
96
103
|
data: JsonLd.Data.BaseData;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LozengeProps } from '../../../types';
|
|
3
|
+
import type { CardActionOptions } from '../../Card/types';
|
|
3
4
|
export interface InlineCardResolvedViewProps {
|
|
4
5
|
/** A unique ID for a Smart Link. */
|
|
5
6
|
id?: string;
|
|
@@ -25,8 +26,8 @@ export interface InlineCardResolvedViewProps {
|
|
|
25
26
|
titlePrefix?: React.ReactNode;
|
|
26
27
|
/** Enables showing a custom preview on hover of link */
|
|
27
28
|
showHoverPreview?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
|
|
29
|
+
/** Configure visibility of server and client actions */
|
|
30
|
+
actionOptions?: CardActionOptions;
|
|
30
31
|
}
|
|
31
32
|
export declare class InlineCardResolvedView extends React.Component<InlineCardResolvedViewProps> {
|
|
32
33
|
renderLozenge(): JSX.Element | null;
|
|
@@ -3,6 +3,7 @@ import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
|
3
3
|
import { CardState } from '../../state/types';
|
|
4
4
|
import { InlinePreloaderStyle, OnErrorCallback } from '../types';
|
|
5
5
|
import { AnalyticsFacade } from '../../state/analytics';
|
|
6
|
+
import type { CardActionOptions } from '../Card/types';
|
|
6
7
|
export type InlineCardProps = {
|
|
7
8
|
id: string;
|
|
8
9
|
url: string;
|
|
@@ -21,6 +22,6 @@ export type InlineCardProps = {
|
|
|
21
22
|
renderers?: CardProviderRenderers;
|
|
22
23
|
showHoverPreview?: boolean;
|
|
23
24
|
showAuthTooltip?: boolean;
|
|
24
|
-
|
|
25
|
+
actionOptions?: CardActionOptions;
|
|
25
26
|
analytics: AnalyticsFacade;
|
|
26
27
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InvokeHandler } from '../../model/invoke-handler';
|
|
2
2
|
import { AnalyticsFacade } from '../../state/analytics';
|
|
3
|
-
import { CardInnerAppearance } from '../../view/Card/types';
|
|
3
|
+
import { CardActionOptions, CardInnerAppearance } from '../../view/Card/types';
|
|
4
4
|
import { AnalyticsOrigin } from '../../utils/types';
|
|
5
5
|
export interface ExtractBlockOpts {
|
|
6
6
|
handleInvoke: InvokeHandler;
|
|
@@ -9,4 +9,5 @@ export interface ExtractBlockOpts {
|
|
|
9
9
|
extensionKey?: string;
|
|
10
10
|
source?: CardInnerAppearance;
|
|
11
11
|
testId?: string;
|
|
12
|
+
actionOptions?: CardActionOptions;
|
|
12
13
|
}
|