@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
|
@@ -2,8 +2,13 @@ import { extractDownloadUrl } from '../../common/detail';
|
|
|
2
2
|
import { extractPreview as extractPreviewData, extractLink, extractProvider, extractTitle } from '@atlaskit/link-extractors';
|
|
3
3
|
import { extractLinkIcon } from '../icon';
|
|
4
4
|
import { extractIsSupportTheming } from '../../common/meta/extractIsSupportTheming';
|
|
5
|
-
|
|
5
|
+
import { CardAction } from '../../../view/Card/types';
|
|
6
|
+
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
7
|
+
export var extractPreviewAction = function extractPreviewAction(response, actionOptions) {
|
|
6
8
|
var _extractPreviewData;
|
|
9
|
+
if (!canShowAction(CardAction.PreviewAction, actionOptions)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
7
12
|
var data = response.data;
|
|
8
13
|
var meta = response.meta;
|
|
9
14
|
var src = (_extractPreviewData = extractPreviewData(data, 'web')) === null || _extractPreviewData === void 0 ? void 0 : _extractPreviewData.src;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { extractLink } from '@atlaskit/link-extractors';
|
|
2
2
|
import { getActionsFromJsonLd } from '../../common/actions/extractActions';
|
|
3
|
-
|
|
3
|
+
import { CardAction } from '../../../view/Card/types';
|
|
4
|
+
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
5
|
+
export var extractViewAction = function extractViewAction(data, actionOptions) {
|
|
6
|
+
if (!canShowAction(CardAction.ViewAction, actionOptions)) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
4
9
|
var viewActionExists = getActionsFromJsonLd(data).find(function (action) {
|
|
5
10
|
return action['@type'] === 'ViewAction';
|
|
6
11
|
});
|
|
@@ -2,10 +2,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { extractLozenge } from '../common/lozenge';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { getExtensionKey } from '../../state/helpers';
|
|
6
7
|
import extractServerAction from './extract-server-action';
|
|
7
8
|
import { extractLink } from '@atlaskit/link-extractors';
|
|
8
9
|
import { extractPreviewAction } from './actions/extract-preview-action';
|
|
10
|
+
import { CardAction } from '../../view/Card/types';
|
|
11
|
+
import { canShowAction } from '../../utils/actions/can-show-action';
|
|
9
12
|
var toInvokeRequest = function toInvokeRequest(extensionKey, resourceIdentifiers, actionType, details) {
|
|
10
13
|
if (!actionType) {
|
|
11
14
|
return;
|
|
@@ -47,7 +50,7 @@ var extractAction = function extractAction(response, id) {
|
|
|
47
50
|
update: update
|
|
48
51
|
} : undefined;
|
|
49
52
|
};
|
|
50
|
-
var extractState = function extractState(response,
|
|
53
|
+
var extractState = function extractState(response, actionOptions, id) {
|
|
51
54
|
if (!response || !response.data) {
|
|
52
55
|
return;
|
|
53
56
|
}
|
|
@@ -55,7 +58,7 @@ var extractState = function extractState(response, showServerActions, id) {
|
|
|
55
58
|
if (!lozenge) {
|
|
56
59
|
return;
|
|
57
60
|
}
|
|
58
|
-
if (!
|
|
61
|
+
if (!canShowAction(CardAction.ChangeStatusAction, actionOptions) || getBooleanFF('platform.linking-platform.smart-card.disable-jira-status-action')) {
|
|
59
62
|
return lozenge;
|
|
60
63
|
}
|
|
61
64
|
var action = extractAction(response, id);
|
|
@@ -17,7 +17,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
17
17
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
18
18
|
id = _ref.id,
|
|
19
19
|
renderers = _ref.renderers,
|
|
20
|
-
|
|
20
|
+
actionOptions = _ref.actionOptions,
|
|
21
21
|
response = _ref.response;
|
|
22
22
|
if (!response) {
|
|
23
23
|
return undefined;
|
|
@@ -40,10 +40,10 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
40
40
|
assignedTo: extractAssignedTo(data),
|
|
41
41
|
createdOn: extractDateCreated(data),
|
|
42
42
|
dueOn: extractDueOn(data),
|
|
43
|
-
followAction: getBooleanFF('platform.linking-platform.smart-card.follow-button') ? extractFollowAction(response,
|
|
44
|
-
previewAction: extractPreviewAction(response),
|
|
45
|
-
viewAction: extractViewAction(data),
|
|
46
|
-
downloadAction: extractDownloadAction(data),
|
|
43
|
+
followAction: getBooleanFF('platform.linking-platform.smart-card.follow-button') ? extractFollowAction(response, actionOptions, id) : undefined,
|
|
44
|
+
previewAction: extractPreviewAction(response, actionOptions),
|
|
45
|
+
viewAction: extractViewAction(data, actionOptions),
|
|
46
|
+
downloadAction: extractDownloadAction(data, actionOptions),
|
|
47
47
|
latestCommit: extractLatestCommit(data),
|
|
48
48
|
linkIcon: extractLinkIcon(response, renderers),
|
|
49
49
|
location: extractLocation(data),
|
|
@@ -58,7 +58,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
58
58
|
snippet: extractSummary(data) || undefined,
|
|
59
59
|
// Explicitly set here to remove an empty string
|
|
60
60
|
sourceBranch: extractSourceBranch(data),
|
|
61
|
-
state: extractState(response,
|
|
61
|
+
state: extractState(response, actionOptions, id),
|
|
62
62
|
subscriberCount: extractSubscriberCount(data),
|
|
63
63
|
subTasksProgress: extractSubTasksProgress(data),
|
|
64
64
|
storyPoints: extractStoryPoints(data),
|
package/dist/esm/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { SmartCardProvider as Provider, SmartCardContext, useSmartLinkAnalytics
|
|
|
2
2
|
export { APIError } from '@atlaskit/linking-common';
|
|
3
3
|
export { CardClient as Client } from '@atlaskit/link-provider';
|
|
4
4
|
export { Card } from './view/Card';
|
|
5
|
+
export { CardAction } from './view/Card/types';
|
|
5
6
|
export { SmartCardContext as Context } from '@atlaskit/link-provider';
|
|
6
7
|
export { EmbedResizeMessageListener } from './view/EmbedCard/EmbedResizeMessageListener';
|
|
7
8
|
export { embedHeaderHeight } from './view/EmbedCard/components/styled';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
1
|
+
import { useMemo } from 'react';
|
|
3
2
|
import uuid from 'uuid';
|
|
4
3
|
import { extractBlockProps as extractCardProps } from '../../extractors/block';
|
|
5
4
|
import { useSmartCardActions as useLinkActions } from '../actions';
|
|
@@ -12,21 +11,15 @@ export function useSmartLinkActions(_ref) {
|
|
|
12
11
|
analyticsHandler = _ref.analyticsHandler,
|
|
13
12
|
_ref$platform = _ref.platform,
|
|
14
13
|
platform = _ref$platform === void 0 ? 'web' : _ref$platform,
|
|
15
|
-
origin = _ref.origin
|
|
14
|
+
origin = _ref.origin,
|
|
15
|
+
actionOptions = _ref.actionOptions;
|
|
16
16
|
var id = useMemo(function () {
|
|
17
17
|
return uuid();
|
|
18
18
|
}, []);
|
|
19
|
-
var _useState = useState([]),
|
|
20
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
-
actions = _useState2[0],
|
|
22
|
-
setActions = _useState2[1];
|
|
23
19
|
var linkState = useLinkState(url);
|
|
24
20
|
var linkAnalytics = useLinkAnalytics(url, analyticsHandler, id);
|
|
25
21
|
var linkActions = useLinkActions(id, url, linkAnalytics);
|
|
26
|
-
|
|
27
|
-
if (!linkState.details) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
22
|
+
if (linkState.details && !(actionOptions !== null && actionOptions !== void 0 && actionOptions.hide)) {
|
|
30
23
|
var cardProperties = extractCardProps(linkState.details.data, linkState.details.meta, {
|
|
31
24
|
handleInvoke: function handleInvoke(opts) {
|
|
32
25
|
return linkActions.invoke(opts, appearance);
|
|
@@ -34,19 +27,19 @@ export function useSmartLinkActions(_ref) {
|
|
|
34
27
|
analytics: linkAnalytics,
|
|
35
28
|
origin: origin,
|
|
36
29
|
extensionKey: getExtensionKey(linkState.details),
|
|
37
|
-
source: appearance
|
|
30
|
+
source: appearance,
|
|
31
|
+
actionOptions: actionOptions
|
|
38
32
|
}, undefined, platform);
|
|
39
|
-
if (
|
|
40
|
-
|
|
33
|
+
if (cardProperties.actions && cardProperties.actions.length > 0) {
|
|
34
|
+
var cardActions = cardProperties.actions.map(function (action) {
|
|
35
|
+
return {
|
|
36
|
+
id: action.id,
|
|
37
|
+
text: action.text,
|
|
38
|
+
invoke: action.promise
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
return cardActions;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
id: action.id,
|
|
45
|
-
text: action.text,
|
|
46
|
-
invoke: action.promise
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
setActions(cardActions);
|
|
50
|
-
}, [linkState, linkActions, linkAnalytics, appearance, platform, origin]);
|
|
51
|
-
return actions;
|
|
43
|
+
}
|
|
44
|
+
return [];
|
|
52
45
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var canShowAction = function canShowAction(action, actionOptions) {
|
|
2
|
+
var _actionOptions$exclud;
|
|
3
|
+
if (typeof actionOptions === 'undefined') {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
if (actionOptions.hide || (_actionOptions$exclud = actionOptions.exclude) !== null && _actionOptions$exclud !== void 0 && _actionOptions$exclud.includes(action)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return true;
|
|
10
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { CardAction } from '../../view/Card/types';
|
|
3
|
+
export var combineActionOptions = function combineActionOptions(actionOptions, showServerActions, showActions) {
|
|
4
|
+
if (typeof actionOptions !== 'undefined') {
|
|
5
|
+
return actionOptions;
|
|
6
|
+
}
|
|
7
|
+
if (showServerActions === false && showActions === false) {
|
|
8
|
+
return {
|
|
9
|
+
hide: true
|
|
10
|
+
};
|
|
11
|
+
} else if (showServerActions && showActions) {
|
|
12
|
+
return {
|
|
13
|
+
hide: false
|
|
14
|
+
};
|
|
15
|
+
} else {
|
|
16
|
+
var exclude = [];
|
|
17
|
+
if (showServerActions === false) {
|
|
18
|
+
exclude = [].concat(_toConsumableArray(exclude), [CardAction.FollowAction, CardAction.ChangeStatusAction]);
|
|
19
|
+
}
|
|
20
|
+
if (showActions === false) {
|
|
21
|
+
exclude = [].concat(_toConsumableArray(exclude), [CardAction.DownloadAction, CardAction.PreviewAction, CardAction.ViewAction]);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
hide: false,
|
|
25
|
+
exclude: exclude
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.
|
|
18
|
+
packageVersion: "26.45.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -38,11 +38,10 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
38
38
|
onResolve = _ref.onResolve,
|
|
39
39
|
onError = _ref.onError,
|
|
40
40
|
testId = _ref.testId,
|
|
41
|
-
showActions = _ref.showActions,
|
|
42
41
|
platform = _ref.platform,
|
|
43
42
|
analytics = _ref.analytics,
|
|
44
43
|
enableFlexibleBlockCard = _ref.enableFlexibleBlockCard,
|
|
45
|
-
|
|
44
|
+
actionOptions = _ref.actionOptions;
|
|
46
45
|
var status = cardState.status,
|
|
47
46
|
details = cardState.details;
|
|
48
47
|
var data = details && details.data || getEmptyJsonLd();
|
|
@@ -52,7 +51,8 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
52
51
|
analytics: analytics,
|
|
53
52
|
origin: 'smartLinkCard',
|
|
54
53
|
handleInvoke: handleInvoke,
|
|
55
|
-
extensionKey: extensionKey
|
|
54
|
+
extensionKey: extensionKey,
|
|
55
|
+
actionOptions: actionOptions
|
|
56
56
|
};
|
|
57
57
|
if (enableFlexibleBlockCard) {
|
|
58
58
|
var flexibleBlockCardProps = {
|
|
@@ -66,7 +66,7 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
66
66
|
onError: onError,
|
|
67
67
|
onResolve: onResolve,
|
|
68
68
|
renderers: renderers,
|
|
69
|
-
|
|
69
|
+
actionOptions: actionOptions,
|
|
70
70
|
analytics: analytics
|
|
71
71
|
};
|
|
72
72
|
switch (status) {
|
|
@@ -129,7 +129,6 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
129
129
|
return jsx(BlockCardResolvedView, _extends({}, resolvedViewProps, {
|
|
130
130
|
isSelected: isSelected,
|
|
131
131
|
testId: testId,
|
|
132
|
-
showActions: showActions,
|
|
133
132
|
onClick: handleFrameClick
|
|
134
133
|
}));
|
|
135
134
|
case 'unauthorized':
|
|
@@ -143,8 +142,8 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
143
142
|
return jsx(BlockCardUnauthorisedView, _extends({}, unauthorizedViewProps, {
|
|
144
143
|
isSelected: isSelected,
|
|
145
144
|
testId: testId,
|
|
146
|
-
showActions: showActions,
|
|
147
145
|
actions: handleAuthorize ? [AuthorizeAction(handleAuthorize)] : [],
|
|
146
|
+
actionOptions: actionOptions,
|
|
148
147
|
onClick: handleFrameClick
|
|
149
148
|
}));
|
|
150
149
|
case 'forbidden':
|
|
@@ -163,8 +162,8 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
163
162
|
});
|
|
164
163
|
return jsx(BlockCardForbiddenView, _extends({}, forbiddenViewProps, {
|
|
165
164
|
isSelected: isSelected,
|
|
166
|
-
showActions: showActions,
|
|
167
165
|
actions: handleAuthorize ? [ForbiddenAction(handleAuthorize)] : [],
|
|
166
|
+
actionOptions: actionOptions,
|
|
168
167
|
onClick: handleFrameClick,
|
|
169
168
|
requestAccessContext: requestAccessContext
|
|
170
169
|
}));
|
|
@@ -29,14 +29,13 @@ export var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
29
29
|
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
|
30
30
|
_ref$testId = _ref.testId,
|
|
31
31
|
testId = _ref$testId === void 0 ? 'block-card-forbidden-view' : _ref$testId,
|
|
32
|
-
_ref$showActions = _ref.showActions,
|
|
33
|
-
showActions = _ref$showActions === void 0 ? true : _ref$showActions,
|
|
34
32
|
_ref$link = _ref.link,
|
|
35
33
|
link = _ref$link === void 0 ? '' : _ref$link,
|
|
36
34
|
_ref$onClick = _ref.onClick,
|
|
37
35
|
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
38
36
|
_ref$requestAccessCon = _ref.requestAccessContext,
|
|
39
|
-
requestAccessContext = _ref$requestAccessCon === void 0 ? {} : _ref$requestAccessCon
|
|
37
|
+
requestAccessContext = _ref$requestAccessCon === void 0 ? {} : _ref$requestAccessCon,
|
|
38
|
+
actionOptions = _ref.actionOptions;
|
|
40
39
|
var handleClick = function handleClick(event) {
|
|
41
40
|
return handleClickCommon(event, onClick);
|
|
42
41
|
};
|
|
@@ -73,7 +72,7 @@ export var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
73
72
|
}))), jsx(ContentFooter, null, jsx(Provider, {
|
|
74
73
|
name: context.text,
|
|
75
74
|
icon: context.icon
|
|
76
|
-
}),
|
|
75
|
+
}), !(actionOptions !== null && actionOptions !== void 0 && actionOptions.hide) && jsx(ActionList, {
|
|
77
76
|
items: items
|
|
78
77
|
}))));
|
|
79
78
|
};
|
|
@@ -51,9 +51,7 @@ export var ResolvedView = function ResolvedView(_ref) {
|
|
|
51
51
|
_ref$details = _ref.details,
|
|
52
52
|
details = _ref$details === void 0 ? [] : _ref$details,
|
|
53
53
|
_ref$testId = _ref.testId,
|
|
54
|
-
testId = _ref$testId === void 0 ? 'block-card-resolved-view' : _ref$testId
|
|
55
|
-
_ref$showActions = _ref.showActions,
|
|
56
|
-
showActions = _ref$showActions === void 0 ? true : _ref$showActions;
|
|
54
|
+
testId = _ref$testId === void 0 ? 'block-card-resolved-view' : _ref$testId;
|
|
57
55
|
var resolvedMetadata = details.length > 0 ? jsx(MetadataList, {
|
|
58
56
|
testId: testId ? "".concat(testId, "-meta") : undefined,
|
|
59
57
|
items: details
|
|
@@ -65,7 +63,7 @@ export var ResolvedView = function ResolvedView(_ref) {
|
|
|
65
63
|
var handleClick = function handleClick(event) {
|
|
66
64
|
return handleClickCommon(event, onClick);
|
|
67
65
|
};
|
|
68
|
-
var hasActions =
|
|
66
|
+
var hasActions = actions.length > 0;
|
|
69
67
|
return jsx(Frame, {
|
|
70
68
|
isSelected: isSelected,
|
|
71
69
|
testId: testId,
|
|
@@ -27,8 +27,7 @@ export var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
|
27
27
|
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
|
28
28
|
_ref$testId = _ref.testId,
|
|
29
29
|
testId = _ref$testId === void 0 ? 'block-card-unauthorized-view' : _ref$testId,
|
|
30
|
-
|
|
31
|
-
showActions = _ref$showActions === void 0 ? true : _ref$showActions,
|
|
30
|
+
actionOptions = _ref.actionOptions,
|
|
32
31
|
_ref$link = _ref.link,
|
|
33
32
|
link = _ref$link === void 0 ? '' : _ref$link,
|
|
34
33
|
_ref$onClick = _ref.onClick,
|
|
@@ -58,7 +57,7 @@ export var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
|
58
57
|
})), jsx(ContentFooter, null, jsx(Provider, {
|
|
59
58
|
name: context.text,
|
|
60
59
|
icon: context.icon
|
|
61
|
-
}),
|
|
60
|
+
}), !(actionOptions !== null && actionOptions !== void 0 && actionOptions.hide) && jsx(ActionList, {
|
|
62
61
|
items: actions
|
|
63
62
|
}))));
|
|
64
63
|
};
|
|
@@ -17,7 +17,7 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
17
17
|
onClick = _ref.onClick,
|
|
18
18
|
onError = _ref.onError,
|
|
19
19
|
onResolve = _ref.onResolve,
|
|
20
|
-
|
|
20
|
+
actionOptions = _ref.actionOptions,
|
|
21
21
|
_ref$testId = _ref.testId,
|
|
22
22
|
testId = _ref$testId === void 0 ? 'smart-block-resolved-view' : _ref$testId,
|
|
23
23
|
url = _ref.url,
|
|
@@ -55,7 +55,7 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
55
55
|
onClick: onClick,
|
|
56
56
|
onError: onError,
|
|
57
57
|
onResolve: onResolve,
|
|
58
|
-
|
|
58
|
+
actionOptions: actionOptions,
|
|
59
59
|
testId: testId,
|
|
60
60
|
ui: FlexibleCardUiOptions,
|
|
61
61
|
url: url
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export var CardAction = /*#__PURE__*/function (CardAction) {
|
|
2
|
+
CardAction["DownloadAction"] = "DownloadAction";
|
|
3
|
+
CardAction["PreviewAction"] = "PreviewAction";
|
|
4
|
+
CardAction["ViewAction"] = "ViewAction";
|
|
5
|
+
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
6
|
+
CardAction["FollowAction"] = "FollowAction";
|
|
7
|
+
return CardAction;
|
|
8
|
+
}({});
|
|
@@ -28,8 +28,7 @@ export var CardWithDataContent = /*#__PURE__*/function (_React$Component) {
|
|
|
28
28
|
appearance = _this$props.appearance,
|
|
29
29
|
onClick = _this$props.onClick,
|
|
30
30
|
onResolve = _this$props.onResolve,
|
|
31
|
-
testId = _this$props.testId
|
|
32
|
-
showActions = _this$props.showActions;
|
|
31
|
+
testId = _this$props.testId;
|
|
33
32
|
if (appearance === 'inline') {
|
|
34
33
|
var props = extractInlineProps(details || getEmptyJsonLd());
|
|
35
34
|
if (onResolve) {
|
|
@@ -51,8 +50,7 @@ export var CardWithDataContent = /*#__PURE__*/function (_React$Component) {
|
|
|
51
50
|
}
|
|
52
51
|
return /*#__PURE__*/React.createElement(BlockCardResolvedView, _extends({}, _props, {
|
|
53
52
|
isSelected: isSelected,
|
|
54
|
-
onClick: onClick
|
|
55
|
-
showActions: showActions
|
|
53
|
+
onClick: onClick
|
|
56
54
|
}));
|
|
57
55
|
}
|
|
58
56
|
}
|
|
@@ -32,7 +32,6 @@ export var CardWithDataRenderer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
32
32
|
onClick = _this$props.onClick,
|
|
33
33
|
onResolve = _this$props.onResolve,
|
|
34
34
|
testId = _this$props.testId,
|
|
35
|
-
showActions = _this$props.showActions,
|
|
36
35
|
inlinePreloaderStyle = _this$props.inlinePreloaderStyle;
|
|
37
36
|
if (!data) {
|
|
38
37
|
throw new Error('@atlaskit/smart-cards: you are trying to render a card with data, but does not provide any');
|
|
@@ -46,8 +45,7 @@ export var CardWithDataRenderer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
46
45
|
isSelected: isSelected,
|
|
47
46
|
onClick: onClick,
|
|
48
47
|
onResolve: onResolve,
|
|
49
|
-
testId: testId
|
|
50
|
-
showActions: showActions
|
|
48
|
+
testId: testId
|
|
51
49
|
});
|
|
52
50
|
}
|
|
53
51
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
2
|
import React, { useCallback, useState } from 'react';
|
|
4
3
|
import { usePrefetch } from '../../../state';
|
|
@@ -16,8 +15,7 @@ export function LazyIntersectionObserverCard(props) {
|
|
|
16
15
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17
16
|
isIntersecting = _useState2[0],
|
|
18
17
|
setIsIntersecting = _useState2[1];
|
|
19
|
-
var
|
|
20
|
-
appearance = props.appearance,
|
|
18
|
+
var appearance = props.appearance,
|
|
21
19
|
url = props.url,
|
|
22
20
|
id = props.id;
|
|
23
21
|
var prefetch = usePrefetch(url);
|
|
@@ -47,9 +45,7 @@ export function LazyIntersectionObserverCard(props) {
|
|
|
47
45
|
return intersectionObserver.disconnect();
|
|
48
46
|
};
|
|
49
47
|
}, [onIntersection]);
|
|
50
|
-
var content = isIntersecting ? /*#__PURE__*/React.createElement(CardWithUrlContent,
|
|
51
|
-
showActions: showActions
|
|
52
|
-
})) : /*#__PURE__*/React.createElement(ComponentObserver, {
|
|
48
|
+
var content = isIntersecting ? /*#__PURE__*/React.createElement(CardWithUrlContent, props) : /*#__PURE__*/React.createElement(ComponentObserver, {
|
|
53
49
|
ref: onRef
|
|
54
50
|
}, /*#__PURE__*/React.createElement(LoadingCardLink, props));
|
|
55
51
|
return /*#__PURE__*/React.createElement(Component, {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React, { useState } from 'react';
|
|
3
2
|
import LazilyRender from 'react-lazily-render';
|
|
4
3
|
import { CardWithUrlContent } from '../component';
|
|
@@ -7,7 +6,6 @@ import { startUfoExperience } from '../../../state/analytics/ufoExperiences';
|
|
|
7
6
|
export function LazyLazilyRenderCard(props) {
|
|
8
7
|
var appearance = props.appearance,
|
|
9
8
|
container = props.container,
|
|
10
|
-
showActions = props.showActions,
|
|
11
9
|
id = props.id;
|
|
12
10
|
var offset = Math.ceil(window.innerHeight / 4);
|
|
13
11
|
useState(function () {
|
|
@@ -20,8 +18,6 @@ export function LazyLazilyRenderCard(props) {
|
|
|
20
18
|
className: "loader-wrapper",
|
|
21
19
|
placeholder: /*#__PURE__*/React.createElement(LoadingCardLink, props),
|
|
22
20
|
scrollContainer: container,
|
|
23
|
-
content: /*#__PURE__*/React.createElement(CardWithUrlContent,
|
|
24
|
-
showActions: showActions
|
|
25
|
-
}))
|
|
21
|
+
content: /*#__PURE__*/React.createElement(CardWithUrlContent, props)
|
|
26
22
|
});
|
|
27
23
|
}
|
|
@@ -12,6 +12,7 @@ import { isFlexibleUiCard } from '../../utils/flexible';
|
|
|
12
12
|
import FlexibleCard from '../FlexibleCard';
|
|
13
13
|
import { CardDisplay } from '../../constants';
|
|
14
14
|
import { fireLinkClickedEvent } from '../../utils/analytics/click';
|
|
15
|
+
import { combineActionOptions } from '../../utils/actions/combine-action-options';
|
|
15
16
|
import { SmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
|
|
16
17
|
function Component(_ref) {
|
|
17
18
|
var id = _ref.id,
|
|
@@ -29,6 +30,7 @@ function Component(_ref) {
|
|
|
29
30
|
testId = _ref.testId,
|
|
30
31
|
showActions = _ref.showActions,
|
|
31
32
|
showServerActionsProp = _ref.showServerActions,
|
|
33
|
+
actionOptionsProp = _ref.actionOptions,
|
|
32
34
|
inheritDimensions = _ref.inheritDimensions,
|
|
33
35
|
embedIframeRef = _ref.embedIframeRef,
|
|
34
36
|
embedIframeUrlType = _ref.embedIframeUrlType,
|
|
@@ -61,7 +63,8 @@ function Component(_ref) {
|
|
|
61
63
|
return isFlexibleUiCard(children);
|
|
62
64
|
}, [children]);
|
|
63
65
|
var enableFlexibleBlockCardFlag = Boolean(useFeatureFlag('enableFlexibleBlockCard'));
|
|
64
|
-
var
|
|
66
|
+
var hideServerActions = showServerActionsProp === false || platform === 'mobile';
|
|
67
|
+
var actionOptions = combineActionOptions(actionOptionsProp, !hideServerActions, showActions);
|
|
65
68
|
|
|
66
69
|
// Setup UI handlers.
|
|
67
70
|
var handleClickWrapper = useCallback(function (event) {
|
|
@@ -183,7 +186,7 @@ function Component(_ref) {
|
|
|
183
186
|
ui: ui,
|
|
184
187
|
showHoverPreview: showHoverPreview,
|
|
185
188
|
showAuthTooltip: showAuthTooltip,
|
|
186
|
-
|
|
189
|
+
actionOptions: actionOptions,
|
|
187
190
|
url: url,
|
|
188
191
|
testId: testId,
|
|
189
192
|
onResolve: onResolve,
|
|
@@ -198,7 +201,7 @@ function Component(_ref) {
|
|
|
198
201
|
}
|
|
199
202
|
switch (appearance) {
|
|
200
203
|
case 'inline':
|
|
201
|
-
|
|
204
|
+
return /*#__PURE__*/React.createElement(InlineCard, {
|
|
202
205
|
analytics: analytics,
|
|
203
206
|
id: id,
|
|
204
207
|
url: url,
|
|
@@ -214,9 +217,8 @@ function Component(_ref) {
|
|
|
214
217
|
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
215
218
|
showHoverPreview: showHoverPreview,
|
|
216
219
|
showAuthTooltip: showAuthTooltip,
|
|
217
|
-
|
|
218
|
-
};
|
|
219
|
-
return /*#__PURE__*/React.createElement(InlineCard, inlineProps);
|
|
220
|
+
actionOptions: actionOptions
|
|
221
|
+
});
|
|
220
222
|
case 'block':
|
|
221
223
|
return /*#__PURE__*/React.createElement(BlockCard, {
|
|
222
224
|
id: id,
|
|
@@ -233,8 +235,7 @@ function Component(_ref) {
|
|
|
233
235
|
onResolve: onResolve,
|
|
234
236
|
onError: onError,
|
|
235
237
|
testId: testId,
|
|
236
|
-
|
|
237
|
-
showServerActions: showServerActions,
|
|
238
|
+
actionOptions: actionOptions,
|
|
238
239
|
platform: platform,
|
|
239
240
|
enableFlexibleBlockCard: enableFlexibleBlockCardFlag
|
|
240
241
|
});
|
|
@@ -257,7 +258,7 @@ function Component(_ref) {
|
|
|
257
258
|
onError: onError,
|
|
258
259
|
testId: testId,
|
|
259
260
|
inheritDimensions: inheritDimensions,
|
|
260
|
-
|
|
261
|
+
actionOptions: actionOptions,
|
|
261
262
|
ref: embedIframeRef,
|
|
262
263
|
onIframeDwell: onIframeDwell,
|
|
263
264
|
onIframeFocus: onIframeFocus
|
|
@@ -38,6 +38,7 @@ export function CardWithURLRenderer(props) {
|
|
|
38
38
|
testId = props.testId,
|
|
39
39
|
showActions = props.showActions,
|
|
40
40
|
showServerActions = props.showServerActions,
|
|
41
|
+
actionOptions = props.actionOptions,
|
|
41
42
|
inheritDimensions = props.inheritDimensions,
|
|
42
43
|
platform = props.platform,
|
|
43
44
|
embedIframeRef = props.embedIframeRef,
|
|
@@ -107,6 +108,7 @@ export function CardWithURLRenderer(props) {
|
|
|
107
108
|
testId: testId,
|
|
108
109
|
showActions: showActions,
|
|
109
110
|
showServerActions: showServerActions,
|
|
111
|
+
actionOptions: actionOptions,
|
|
110
112
|
inheritDimensions: inheritDimensions,
|
|
111
113
|
platform: platform,
|
|
112
114
|
embedIframeRef: embedIframeRef,
|
|
@@ -25,7 +25,6 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
25
25
|
handleFrameClick = _ref.handleFrameClick,
|
|
26
26
|
analytics = _ref.analytics,
|
|
27
27
|
handleInvoke = _ref.handleInvoke,
|
|
28
|
-
showActions = _ref.showActions,
|
|
29
28
|
isSelected = _ref.isSelected,
|
|
30
29
|
isFrameVisible = _ref.isFrameVisible,
|
|
31
30
|
frameStyle = _ref.frameStyle,
|
|
@@ -36,7 +35,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
36
35
|
inheritDimensions = _ref.inheritDimensions,
|
|
37
36
|
onIframeDwell = _ref.onIframeDwell,
|
|
38
37
|
onIframeFocus = _ref.onIframeFocus,
|
|
39
|
-
iframeUrlType = _ref.iframeUrlType
|
|
38
|
+
iframeUrlType = _ref.iframeUrlType,
|
|
39
|
+
actionOptions = _ref.actionOptions;
|
|
40
40
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
41
41
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
42
42
|
var data = details && details.data || getEmptyJsonLd();
|
|
@@ -86,12 +86,12 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
86
86
|
analytics: analytics,
|
|
87
87
|
origin: 'smartLinkEmbed',
|
|
88
88
|
handleInvoke: handleInvoke,
|
|
89
|
-
extensionKey: extensionKey
|
|
89
|
+
extensionKey: extensionKey,
|
|
90
|
+
actionOptions: actionOptions
|
|
90
91
|
});
|
|
91
92
|
return /*#__PURE__*/React.createElement(BlockCardResolvedView, _extends({}, resolvedBlockViewProps, {
|
|
92
93
|
isSelected: isSelected,
|
|
93
94
|
testId: testId,
|
|
94
|
-
showActions: showActions,
|
|
95
95
|
onClick: handleFrameClick
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
@@ -8,7 +8,7 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
8
8
|
hideHoverCardPreviewButton = _ref.hideHoverCardPreviewButton,
|
|
9
9
|
isHoverPreview = _ref.isHoverPreview,
|
|
10
10
|
isAuthTooltip = _ref.isAuthTooltip,
|
|
11
|
-
|
|
11
|
+
actionOptions = _ref.actionOptions,
|
|
12
12
|
testId = _ref.testId,
|
|
13
13
|
url = _ref.url,
|
|
14
14
|
_ref$delay = _ref.delay,
|
|
@@ -58,7 +58,7 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
58
58
|
canOpen: canOpen,
|
|
59
59
|
closeOnChildClick: true,
|
|
60
60
|
hidePreviewButton: hideHoverCardPreviewButton,
|
|
61
|
-
|
|
61
|
+
actionOptions: actionOptions,
|
|
62
62
|
url: url
|
|
63
63
|
}, /*#__PURE__*/React.createElement("span", {
|
|
64
64
|
onMouseLeave: onMouseLeave,
|
|
@@ -145,8 +145,7 @@ var Container = function Container(_ref3) {
|
|
|
145
145
|
showAuthTooltip = _ref3$showAuthTooltip === void 0 ? false : _ref3$showAuthTooltip,
|
|
146
146
|
_ref3$showHoverPrevie = _ref3.showHoverPreview,
|
|
147
147
|
showHoverPreview = _ref3$showHoverPrevie === void 0 ? false : _ref3$showHoverPrevie,
|
|
148
|
-
|
|
149
|
-
showServerActions = _ref3$showServerActio === void 0 ? false : _ref3$showServerActio,
|
|
148
|
+
actionOptions = _ref3.actionOptions,
|
|
150
149
|
_ref3$size = _ref3.size,
|
|
151
150
|
size = _ref3$size === void 0 ? SmartLinkSize.Medium : _ref3$size,
|
|
152
151
|
status = _ref3.status,
|
|
@@ -170,7 +169,7 @@ var Container = function Container(_ref3) {
|
|
|
170
169
|
hideHoverCardPreviewButton: hideHoverCardPreviewButton,
|
|
171
170
|
isHoverPreview: canShowHoverPreview,
|
|
172
171
|
isAuthTooltip: canShowAuthTooltip,
|
|
173
|
-
|
|
172
|
+
actionOptions: actionOptions,
|
|
174
173
|
testId: testId,
|
|
175
174
|
url: context.url
|
|
176
175
|
}, container);
|