@atlaskit/smart-card 26.2.1 → 26.2.2
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 +8 -0
- package/dist/cjs/extractors/block/index.js +5 -4
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +4 -2
- package/dist/cjs/messages.js +6 -0
- package/dist/cjs/state/actions/index.js +27 -11
- package/dist/cjs/state/hooks/use-resolve/index.js +28 -12
- package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +47 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/actions/PreviewAction.js +4 -2
- package/dist/cjs/view/BlockCard/index.js +3 -1
- package/dist/cjs/view/CardWithUrl/component.js +13 -3
- package/dist/cjs/view/FlexibleCard/components/actions/action/preview-action/index.js +7 -1
- package/dist/cjs/view/FlexibleCard/components/actions/utils.js +1 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +21 -2
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +26 -3
- package/dist/es2019/extractors/block/index.js +5 -4
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +4 -2
- package/dist/es2019/messages.js +6 -0
- package/dist/es2019/state/actions/index.js +32 -12
- package/dist/es2019/state/hooks/use-resolve/index.js +28 -12
- package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +35 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/actions/PreviewAction.js +17 -13
- package/dist/es2019/view/BlockCard/index.js +3 -1
- package/dist/es2019/view/CardWithUrl/component.js +9 -2
- package/dist/es2019/view/FlexibleCard/components/actions/action/preview-action/index.js +7 -1
- package/dist/es2019/view/FlexibleCard/components/actions/utils.js +1 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +21 -2
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +36 -11
- package/dist/esm/extractors/block/index.js +5 -4
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +4 -2
- package/dist/esm/messages.js +6 -0
- package/dist/esm/state/actions/index.js +27 -11
- package/dist/esm/state/hooks/use-resolve/index.js +28 -12
- package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +36 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/PreviewAction.js +4 -2
- package/dist/esm/view/BlockCard/index.js +3 -1
- package/dist/esm/view/CardWithUrl/component.js +11 -2
- package/dist/esm/view/FlexibleCard/components/actions/action/preview-action/index.js +7 -1
- package/dist/esm/view/FlexibleCard/components/actions/utils.js +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +21 -2
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +26 -3
- package/dist/types/extractors/block/index.d.ts +2 -2
- package/dist/types/extractors/block/types.d.ts +1 -0
- package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/utils/analytics/SmartLinkAnalyticsContext.d.ts +9 -0
- package/dist/types/view/BlockCard/actions/PreviewAction.d.ts +2 -1
- package/dist/types/view/BlockCard/views/ResolvedView.d.ts +2 -0
- package/dist/types/view/CardWithUrl/component.d.ts +1 -1
- package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/block/index.d.ts +2 -2
- package/dist/types-ts4.5/extractors/block/types.d.ts +1 -0
- package/dist/types-ts4.5/extractors/common/actions/extractPreviewAction.d.ts +1 -1
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/utils/analytics/SmartLinkAnalyticsContext.d.ts +9 -0
- package/dist/types-ts4.5/view/BlockCard/actions/PreviewAction.d.ts +2 -1
- package/dist/types-ts4.5/view/BlockCard/views/ResolvedView.d.ts +2 -0
- package/dist/types-ts4.5/view/CardWithUrl/component.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/package.json +11 -3
- package/tmp/api-report-tmp.d.ts +0 -909
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
|
+
import { unstable_batchedUpdates } from 'react-dom';
|
|
4
5
|
import { addMetadataToExperience } from '../../analytics';
|
|
5
6
|
import { getStatus } from '../../helpers';
|
|
6
7
|
import { ACTION_ERROR, ACTION_ERROR_FALLBACK, ACTION_RELOADING, ACTION_RESOLVED, ACTION_UPDATE_METADATA_STATUS, APIError, cardAction } from '@atlaskit/linking-common';
|
|
8
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
9
|
import { ERROR_MESSAGE_FATAL, ERROR_MESSAGE_METADATA, ERROR_MESSAGE_OAUTH } from '../../actions/constants';
|
|
8
10
|
import { getUnauthorizedJsonLd } from '../../../utils/jsonld';
|
|
9
11
|
import { SmartLinkStatus } from '../../../constants';
|
|
@@ -73,6 +75,20 @@ var useResolve = function useResolve() {
|
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
}, [getState, setMetadataStatus, dispatch]);
|
|
78
|
+
var handleResolvedLinkSuccess = useCallback(function (resourceUrl, response, isReloading, isMetadataRequest) {
|
|
79
|
+
//if a link resolves normally, metadata will also always be resolved
|
|
80
|
+
setMetadataStatus(resourceUrl, 'resolved');
|
|
81
|
+
// Dispatch Analytics and resolved card action - including unauthorized states.
|
|
82
|
+
if (isReloading) {
|
|
83
|
+
dispatch(cardAction(ACTION_RELOADING, {
|
|
84
|
+
url: resourceUrl
|
|
85
|
+
}, response));
|
|
86
|
+
} else {
|
|
87
|
+
dispatch(cardAction(ACTION_RESOLVED, {
|
|
88
|
+
url: resourceUrl
|
|
89
|
+
}, response, undefined, undefined, isMetadataRequest));
|
|
90
|
+
}
|
|
91
|
+
}, [setMetadataStatus, dispatch]);
|
|
76
92
|
var handleResolvedLinkResponse = useCallback(function (resourceUrl, response) {
|
|
77
93
|
var isReloading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
78
94
|
var isMetadataRequest = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -97,20 +113,20 @@ var useResolve = function useResolve() {
|
|
|
97
113
|
handleResolvedLinkError(resourceUrl, new APIError('error', hostname, ERROR_MESSAGE_METADATA), response, isMetadataRequest);
|
|
98
114
|
return;
|
|
99
115
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
116
|
+
if (getBooleanFF('platform.linking-platform.smart-card.enable-analytics-context')) {
|
|
117
|
+
/**
|
|
118
|
+
* Using unstable_batchedUpdates because this store update happens async and trigers a rerender
|
|
119
|
+
* more info:
|
|
120
|
+
* https://github.com/facebook/react/blob/v18.2.0/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L113
|
|
121
|
+
* https://react-redux.js.org/api/batch
|
|
122
|
+
*/
|
|
123
|
+
unstable_batchedUpdates(function () {
|
|
124
|
+
handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
|
|
125
|
+
});
|
|
108
126
|
} else {
|
|
109
|
-
|
|
110
|
-
url: resourceUrl
|
|
111
|
-
}, response, undefined, undefined, isMetadataRequest));
|
|
127
|
+
handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
|
|
112
128
|
}
|
|
113
|
-
}, [
|
|
129
|
+
}, [handleResolvedLinkError, handleResolvedLinkSuccess, hasAuthFlowSupported]);
|
|
114
130
|
return useCallback( /*#__PURE__*/function () {
|
|
115
131
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url) {
|
|
116
132
|
var isReloading,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
import React, { useMemo } from 'react';
|
|
5
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
6
|
+
import { getResolvedAttributes, getUrlAttributes } from '@atlaskit/link-analytics/resolved-attributes';
|
|
7
|
+
import { isFlexibleUiCard } from '../flexible';
|
|
8
|
+
import { CardDisplay } from '../../constants';
|
|
9
|
+
import { useSmartCardState as useSmartLinkState } from '../../state/store';
|
|
10
|
+
export var SmartLinkAnalyticsContext = function SmartLinkAnalyticsContext(_ref) {
|
|
11
|
+
var children = _ref.children,
|
|
12
|
+
url = _ref.url,
|
|
13
|
+
appearance = _ref.appearance,
|
|
14
|
+
id = _ref.id;
|
|
15
|
+
var _useSmartLinkState = useSmartLinkState(url),
|
|
16
|
+
details = _useSmartLinkState.details,
|
|
17
|
+
status = _useSmartLinkState.status;
|
|
18
|
+
var resolvedAttributes = getResolvedAttributes({
|
|
19
|
+
url: url
|
|
20
|
+
}, details, status);
|
|
21
|
+
var _getUrlAttributes = getUrlAttributes(url),
|
|
22
|
+
urlHash = _getUrlAttributes.urlHash;
|
|
23
|
+
var isFlexibleUi = useMemo(function () {
|
|
24
|
+
return isFlexibleUiCard(children);
|
|
25
|
+
}, [children]);
|
|
26
|
+
var display = isFlexibleUi ? CardDisplay.Flexible : appearance;
|
|
27
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
28
|
+
data: {
|
|
29
|
+
attributes: _objectSpread(_objectSpread({}, resolvedAttributes), {}, {
|
|
30
|
+
urlHash: urlHash,
|
|
31
|
+
display: display,
|
|
32
|
+
id: id
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
}, children);
|
|
36
|
+
};
|
package/dist/esm/version.json
CHANGED
|
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
5
|
var _excluded = ["popupMountPointId", "onClose"],
|
|
6
|
-
_excluded2 = ["details"];
|
|
6
|
+
_excluded2 = ["details", "enableImprovedPreviewAction"];
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -70,10 +70,12 @@ function _previewFunction() {
|
|
|
70
70
|
}
|
|
71
71
|
export default (function (_ref2) {
|
|
72
72
|
var details = _ref2.details,
|
|
73
|
+
enableImprovedPreviewAction = _ref2.enableImprovedPreviewAction,
|
|
73
74
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
75
|
+
var previewText = enableImprovedPreviewAction ? messages.preview_improved : messages.preview;
|
|
74
76
|
return {
|
|
75
77
|
id: 'preview-content',
|
|
76
|
-
text: /*#__PURE__*/React.createElement(FormattedMessage,
|
|
78
|
+
text: /*#__PURE__*/React.createElement(FormattedMessage, previewText),
|
|
77
79
|
promise: function promise(props) {
|
|
78
80
|
return previewFunction(_objectSpread(_objectSpread({
|
|
79
81
|
popupMountPointId: 'twp-editor-preview-iframe',
|
|
@@ -24,6 +24,7 @@ import FlexibleForbiddenView from './views/flexible/FlexibleForbiddenView';
|
|
|
24
24
|
import { tokens } from '../../utils/token';
|
|
25
25
|
import { css, jsx } from '@emotion/react';
|
|
26
26
|
import { handleClickCommon } from './utils/handlers';
|
|
27
|
+
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
27
28
|
export { default as PreviewAction } from './actions/PreviewAction';
|
|
28
29
|
export { ForbiddenAction, AuthorizeAction, BlockCardResolvedView, BlockCardResolvingView, BlockCardUnauthorisedView, BlockCardForbiddenView, BlockCardErroredView, BlockCardNotFoundView };
|
|
29
30
|
var flexibleBlockCardElevationStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: 1.5px;\n box-shadow: ", ";\n margin: 2px;\n"])), tokens.elevation);
|
|
@@ -58,6 +59,7 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
58
59
|
handleInvoke: handleInvoke,
|
|
59
60
|
extensionKey: extensionKey
|
|
60
61
|
};
|
|
62
|
+
var enableImprovedPreviewAction = Boolean(useFeatureFlag('enableImprovedPreviewAction'));
|
|
61
63
|
if (enableFlexibleBlockCard) {
|
|
62
64
|
var ui = {
|
|
63
65
|
hideElevation: true
|
|
@@ -140,7 +142,7 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
140
142
|
isSelected: isSelected
|
|
141
143
|
});
|
|
142
144
|
case 'resolved':
|
|
143
|
-
var resolvedViewProps = extractBlockProps(data, meta, extractorOpts, renderers, platform);
|
|
145
|
+
var resolvedViewProps = extractBlockProps(data, meta, extractorOpts, renderers, platform, enableImprovedPreviewAction);
|
|
144
146
|
if (onResolve) {
|
|
145
147
|
onResolve({
|
|
146
148
|
title: resolvedViewProps.title,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useCallback, useMemo } from 'react';
|
|
2
2
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
3
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { isSpecialEvent } from '../../utils';
|
|
5
6
|
import * as measure from '../../utils/performance';
|
|
6
7
|
import { getDefinitionId, getServices, isFinalState, getClickUrl, getResourceType, getExtensionKey, getSubproduct, getProduct } from '../../state/helpers';
|
|
@@ -12,7 +13,8 @@ import { isFlexibleUiCard } from '../../utils/flexible';
|
|
|
12
13
|
import FlexibleCard from '../FlexibleCard';
|
|
13
14
|
import { CardDisplay } from '../../constants';
|
|
14
15
|
import { fireLinkClickedEvent } from '../../utils/analytics/click';
|
|
15
|
-
|
|
16
|
+
import { SmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
|
|
17
|
+
function Component(_ref) {
|
|
16
18
|
var id = _ref.id,
|
|
17
19
|
url = _ref.url,
|
|
18
20
|
isSelected = _ref.isSelected,
|
|
@@ -258,4 +260,11 @@ export function CardWithUrlContent(_ref) {
|
|
|
258
260
|
onIframeFocus: onIframeFocus
|
|
259
261
|
});
|
|
260
262
|
}
|
|
261
|
-
}
|
|
263
|
+
}
|
|
264
|
+
export var CardWithUrlContent = function CardWithUrlContent(props) {
|
|
265
|
+
return getBooleanFF('platform.linking-platform.smart-card.enable-analytics-context') ? /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
|
|
266
|
+
url: props.url,
|
|
267
|
+
appearance: props.appearance,
|
|
268
|
+
id: props.id
|
|
269
|
+
}, /*#__PURE__*/React.createElement(Component, props)) : /*#__PURE__*/React.createElement(Component, props);
|
|
270
|
+
};
|
|
@@ -7,6 +7,9 @@ import Action from '../index';
|
|
|
7
7
|
import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
|
|
8
8
|
import { useSmartLinkAnalytics } from '../../../../../../state';
|
|
9
9
|
import { openPreviewModal } from '../../../../../EmbedModal/utils';
|
|
10
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
11
|
+
import { messages } from '../../../../../../messages';
|
|
12
|
+
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
10
13
|
var PreviewAction = function PreviewAction(props) {
|
|
11
14
|
var appearance = props.appearance,
|
|
12
15
|
asDropDownItem = props.asDropDownItem,
|
|
@@ -21,6 +24,8 @@ var PreviewAction = function PreviewAction(props) {
|
|
|
21
24
|
isSupportTheming = props.isSupportTheming;
|
|
22
25
|
var defaultAnalytics = useSmartLinkAnalytics(url, function () {});
|
|
23
26
|
var analytics = useFlexibleUiAnalyticsContext() || defaultAnalytics;
|
|
27
|
+
var enableImprovedPreviewAction = Boolean(useFeatureFlag('enableImprovedPreviewAction'));
|
|
28
|
+
var previewText = enableImprovedPreviewAction ? messages.preview_improved : messages.preview;
|
|
24
29
|
if (src && url) {
|
|
25
30
|
var embedModal = function embedModal() {
|
|
26
31
|
return openPreviewModal({
|
|
@@ -39,7 +44,8 @@ var PreviewAction = function PreviewAction(props) {
|
|
|
39
44
|
if (_onClick) {
|
|
40
45
|
_onClick();
|
|
41
46
|
}
|
|
42
|
-
}
|
|
47
|
+
},
|
|
48
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, previewText)
|
|
43
49
|
});
|
|
44
50
|
return /*#__PURE__*/React.createElement(Action, _extends({}, action, {
|
|
45
51
|
appearance: appearance,
|
|
@@ -47,7 +47,7 @@ var actionMappings = (_actionMappings = {}, _defineProperty(_actionMappings, Act
|
|
|
47
47
|
testId: 'smart-action-preview-action',
|
|
48
48
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview),
|
|
49
49
|
icon: /*#__PURE__*/React.createElement(VidFullScreenOnIcon, {
|
|
50
|
-
label: "
|
|
50
|
+
label: "Open preview"
|
|
51
51
|
}),
|
|
52
52
|
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview)
|
|
53
53
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import Popup from '@atlaskit/popup';
|
|
5
6
|
import { jsx } from '@emotion/react';
|
|
6
7
|
import React, { useCallback, useMemo, useRef } from 'react';
|
|
@@ -10,9 +11,11 @@ import { useSmartCardState as useLinkState } from '../../../state/store';
|
|
|
10
11
|
import HoverCardContent from '../components/HoverCardContent';
|
|
11
12
|
import { CARD_GAP_PX, HOVER_CARD_Z_INDEX } from '../styled';
|
|
12
13
|
import { CardDisplay } from '../../../constants';
|
|
14
|
+
import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
|
|
13
15
|
export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
14
16
|
var children = _ref.children,
|
|
15
17
|
url = _ref.url,
|
|
18
|
+
id = _ref.id,
|
|
16
19
|
analyticsHandler = _ref.analyticsHandler,
|
|
17
20
|
analytics = _ref.analytics,
|
|
18
21
|
_ref$canOpen = _ref.canOpen,
|
|
@@ -122,7 +125,23 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
122
125
|
}, [closeOnChildClick, hideCard]);
|
|
123
126
|
var content = useCallback(function (_ref2) {
|
|
124
127
|
var update = _ref2.update;
|
|
125
|
-
return jsx(
|
|
128
|
+
return getBooleanFF('platform.linking-platform.smart-card.enable-analytics-context') ? jsx(SmartLinkAnalyticsContext, {
|
|
129
|
+
url: url,
|
|
130
|
+
appearance: CardDisplay.HoverCardPreview,
|
|
131
|
+
id: id
|
|
132
|
+
}, jsx(HoverCardContent, {
|
|
133
|
+
onMouseEnter: initShowCard,
|
|
134
|
+
onMouseLeave: initHideCard,
|
|
135
|
+
analytics: analytics,
|
|
136
|
+
cardActions: filteredActions,
|
|
137
|
+
cardState: linkState,
|
|
138
|
+
onActionClick: onActionClick,
|
|
139
|
+
onResolve: update,
|
|
140
|
+
renderers: renderers,
|
|
141
|
+
showServerActions: showServerActions,
|
|
142
|
+
url: url,
|
|
143
|
+
id: id
|
|
144
|
+
})) : jsx(HoverCardContent, {
|
|
126
145
|
onMouseEnter: initShowCard,
|
|
127
146
|
onMouseLeave: initHideCard,
|
|
128
147
|
analytics: analytics,
|
|
@@ -134,7 +153,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
134
153
|
showServerActions: showServerActions,
|
|
135
154
|
url: url
|
|
136
155
|
});
|
|
137
|
-
}, [analytics, initHideCard, initShowCard, filteredActions, linkState, onActionClick, renderers, showServerActions, url]);
|
|
156
|
+
}, [analytics, initHideCard, initShowCard, filteredActions, linkState, onActionClick, renderers, showServerActions, url, id]);
|
|
138
157
|
var trigger = useCallback(function (triggerProps) {
|
|
139
158
|
return jsx("span", {
|
|
140
159
|
ref: parentSpan
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1
4
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
5
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
3
6
|
import { extractType } from '@atlaskit/linking-common/extractors';
|
|
@@ -8,8 +11,27 @@ import FlexibleCard from '../../../../FlexibleCard';
|
|
|
8
11
|
import { getSimulatedMetadata, toActionableMetadata } from '../../../utils';
|
|
9
12
|
import SnippetOrPreview from '../../SnippetOrPreview';
|
|
10
13
|
import { extractMetadata } from '../../../../../extractors/hover/extractMetadata';
|
|
11
|
-
|
|
14
|
+
import { messages } from '../../../../../messages';
|
|
15
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
16
|
+
export var toFooterActions = function toFooterActions(cardActions, onActionClick, enableImprovedPreviewAction) {
|
|
17
|
+
var appearance = enableImprovedPreviewAction ? {
|
|
18
|
+
appearance: 'primary'
|
|
19
|
+
} : undefined;
|
|
20
|
+
var previewText = enableImprovedPreviewAction ? messages.preview_improved : messages.preview;
|
|
12
21
|
return cardActions.map(function (action) {
|
|
22
|
+
if (action.id === 'preview-content') {
|
|
23
|
+
return _objectSpread({
|
|
24
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, previewText),
|
|
25
|
+
name: ActionName.CustomAction,
|
|
26
|
+
onClick: function onClick() {
|
|
27
|
+
if (onActionClick) {
|
|
28
|
+
onActionClick(action.id);
|
|
29
|
+
}
|
|
30
|
+
return action.invoke();
|
|
31
|
+
},
|
|
32
|
+
testId: action.id
|
|
33
|
+
}, appearance);
|
|
34
|
+
}
|
|
13
35
|
return {
|
|
14
36
|
content: action.text,
|
|
15
37
|
name: ActionName.CustomAction,
|
|
@@ -37,6 +59,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
37
59
|
onActionClick = _ref.onActionClick,
|
|
38
60
|
extensionKey = _ref.extensionKey;
|
|
39
61
|
var showActionableElement = useFeatureFlag('enableActionableElement');
|
|
62
|
+
var enableImprovedPreviewAction = useFeatureFlag('enableImprovedPreviewAction');
|
|
40
63
|
useEffect(function () {
|
|
41
64
|
// Since this hover view is only rendered on resolved status,
|
|
42
65
|
// there is no need to check for statuses.
|
|
@@ -46,8 +69,8 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
46
69
|
});
|
|
47
70
|
}, [analytics.ui, cardState.status]);
|
|
48
71
|
var footerActions = useMemo(function () {
|
|
49
|
-
return toFooterActions(cardActions, onActionClick);
|
|
50
|
-
}, [cardActions, onActionClick]);
|
|
72
|
+
return toFooterActions(cardActions, onActionClick, Boolean(enableImprovedPreviewAction));
|
|
73
|
+
}, [cardActions, onActionClick, enableImprovedPreviewAction]);
|
|
51
74
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
52
75
|
var _useMemo = useMemo(function () {
|
|
53
76
|
var types = data ? extractType(data) : undefined;
|
|
@@ -5,6 +5,6 @@ import { ExtractBlockOpts } from './types';
|
|
|
5
5
|
import { CardPlatform } from '../../view/Card';
|
|
6
6
|
import { BlockCardResolvedViewProps } from '../../view/BlockCard';
|
|
7
7
|
import { ActionProps } from '../../view/BlockCard/components/Action';
|
|
8
|
-
export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts, platform?: CardPlatform, meta?: JsonLd.Meta.BaseMeta) => ActionProps[];
|
|
8
|
+
export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts, platform?: CardPlatform, meta?: JsonLd.Meta.BaseMeta, enableImprovedPreviewAction?: boolean) => ActionProps[];
|
|
9
9
|
export declare const extractBlockUsers: (jsonLd: JsonLd.Data.BaseData) => LinkPerson[] | undefined;
|
|
10
|
-
export declare const extractBlockProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta, opts?: ExtractBlockOpts, renderers?: CardProviderRenderers, platform?: CardPlatform) => BlockCardResolvedViewProps;
|
|
10
|
+
export declare const extractBlockProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta, opts?: ExtractBlockOpts, renderers?: CardProviderRenderers, platform?: CardPlatform, enableImprovedPreviewAction?: boolean) => BlockCardResolvedViewProps;
|
|
@@ -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, enableImprovedPreviewAction, }: ExtractBlockOpts & {
|
|
6
6
|
viewProps: BlockCardResolvedViewProps;
|
|
7
7
|
jsonLd: JsonLd.Data.BaseData;
|
|
8
8
|
platform?: JsonLd.Primitives.Platforms | undefined;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
|
|
3
|
-
export type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
3
|
+
export type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CardInnerAppearance } from '../../view/Card/types';
|
|
3
|
+
type SmartLinkAnalyticsContextProps = {
|
|
4
|
+
url: string;
|
|
5
|
+
appearance: CardInnerAppearance;
|
|
6
|
+
id: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const SmartLinkAnalyticsContext: FC<SmartLinkAnalyticsContextProps>;
|
|
9
|
+
export {};
|
|
@@ -26,6 +26,7 @@ type PreviewInfo = {
|
|
|
26
26
|
analytics: AnalyticsFacade;
|
|
27
27
|
origin?: AnalyticsOrigin;
|
|
28
28
|
isSupportTheming?: boolean;
|
|
29
|
+
enableImprovedPreviewAction?: boolean;
|
|
29
30
|
};
|
|
30
|
-
declare const _default: ({ details, ...rest }: PreviewInfo) => ActionProps;
|
|
31
|
+
declare const _default: ({ details, enableImprovedPreviewAction, ...rest }: PreviewInfo) => ActionProps;
|
|
31
32
|
export default _default;
|
|
@@ -30,6 +30,8 @@ export interface ResolvedViewProps {
|
|
|
30
30
|
isTrusted?: boolean;
|
|
31
31
|
/** It determines whether a link source supports different design theme modes */
|
|
32
32
|
isSupportTheming?: boolean;
|
|
33
|
+
/** Determines whether a preview action's text should display 'Open preview' or 'Full screen view' */
|
|
34
|
+
enableImprovedPreviewAction?: boolean;
|
|
33
35
|
}
|
|
34
36
|
export declare const blockCardResolvedViewClassName = "block-card-resolved-view";
|
|
35
37
|
export declare const blockCardResolvedViewByClassName = "block-card-resolved-view-by";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardWithUrlContentProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const CardWithUrlContent: (props: CardWithUrlContentProps) => JSX.Element;
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { ActionItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
3
3
|
import { LinkAction } from '../../../../../state/hooks-external/useSmartLinkActions';
|
|
4
4
|
import { HoverCardResolvedProps } from './types';
|
|
5
|
-
export declare const toFooterActions: (cardActions: LinkAction[], onActionClick?: ((actionId: string) => void) | undefined) => ActionItem[];
|
|
5
|
+
export declare const toFooterActions: (cardActions: LinkAction[], onActionClick?: ((actionId: string) => void) | undefined, enableImprovedPreviewAction?: boolean) => ActionItem[];
|
|
6
6
|
declare const HoverCardResolvedView: React.FC<HoverCardResolvedProps>;
|
|
7
7
|
export default HoverCardResolvedView;
|
|
@@ -5,6 +5,6 @@ import { ExtractBlockOpts } from './types';
|
|
|
5
5
|
import { CardPlatform } from '../../view/Card';
|
|
6
6
|
import { BlockCardResolvedViewProps } from '../../view/BlockCard';
|
|
7
7
|
import { ActionProps } from '../../view/BlockCard/components/Action';
|
|
8
|
-
export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts, platform?: CardPlatform, meta?: JsonLd.Meta.BaseMeta) => ActionProps[];
|
|
8
|
+
export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts, platform?: CardPlatform, meta?: JsonLd.Meta.BaseMeta, enableImprovedPreviewAction?: boolean) => ActionProps[];
|
|
9
9
|
export declare const extractBlockUsers: (jsonLd: JsonLd.Data.BaseData) => LinkPerson[] | undefined;
|
|
10
|
-
export declare const extractBlockProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta, opts?: ExtractBlockOpts, renderers?: CardProviderRenderers, platform?: CardPlatform) => BlockCardResolvedViewProps;
|
|
10
|
+
export declare const extractBlockProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta, opts?: ExtractBlockOpts, renderers?: CardProviderRenderers, platform?: CardPlatform, enableImprovedPreviewAction?: boolean) => BlockCardResolvedViewProps;
|
|
@@ -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, enableImprovedPreviewAction, }: ExtractBlockOpts & {
|
|
6
6
|
viewProps: BlockCardResolvedViewProps;
|
|
7
7
|
jsonLd: JsonLd.Data.BaseData;
|
|
8
8
|
platform?: JsonLd.Primitives.Platforms | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
|
|
3
|
-
export type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
3
|
+
export type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CardInnerAppearance } from '../../view/Card/types';
|
|
3
|
+
type SmartLinkAnalyticsContextProps = {
|
|
4
|
+
url: string;
|
|
5
|
+
appearance: CardInnerAppearance;
|
|
6
|
+
id: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const SmartLinkAnalyticsContext: FC<SmartLinkAnalyticsContextProps>;
|
|
9
|
+
export {};
|
|
@@ -26,6 +26,7 @@ type PreviewInfo = {
|
|
|
26
26
|
analytics: AnalyticsFacade;
|
|
27
27
|
origin?: AnalyticsOrigin;
|
|
28
28
|
isSupportTheming?: boolean;
|
|
29
|
+
enableImprovedPreviewAction?: boolean;
|
|
29
30
|
};
|
|
30
|
-
declare const _default: ({ details, ...rest }: PreviewInfo) => ActionProps;
|
|
31
|
+
declare const _default: ({ details, enableImprovedPreviewAction, ...rest }: PreviewInfo) => ActionProps;
|
|
31
32
|
export default _default;
|
|
@@ -30,6 +30,8 @@ export interface ResolvedViewProps {
|
|
|
30
30
|
isTrusted?: boolean;
|
|
31
31
|
/** It determines whether a link source supports different design theme modes */
|
|
32
32
|
isSupportTheming?: boolean;
|
|
33
|
+
/** Determines whether a preview action's text should display 'Open preview' or 'Full screen view' */
|
|
34
|
+
enableImprovedPreviewAction?: boolean;
|
|
33
35
|
}
|
|
34
36
|
export declare const blockCardResolvedViewClassName = "block-card-resolved-view";
|
|
35
37
|
export declare const blockCardResolvedViewByClassName = "block-card-resolved-view-by";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardWithUrlContentProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const CardWithUrlContent: (props: CardWithUrlContentProps) => JSX.Element;
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { ActionItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
3
3
|
import { LinkAction } from '../../../../../state/hooks-external/useSmartLinkActions';
|
|
4
4
|
import { HoverCardResolvedProps } from './types';
|
|
5
|
-
export declare const toFooterActions: (cardActions: LinkAction[], onActionClick?: ((actionId: string) => void) | undefined) => ActionItem[];
|
|
5
|
+
export declare const toFooterActions: (cardActions: LinkAction[], onActionClick?: ((actionId: string) => void) | undefined, enableImprovedPreviewAction?: boolean) => ActionItem[];
|
|
6
6
|
declare const HoverCardResolvedView: React.FC<HoverCardResolvedProps>;
|
|
7
7
|
export default HoverCardResolvedView;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.2",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -41,14 +41,16 @@
|
|
|
41
41
|
"@atlaskit/icon-object": "^6.3.0",
|
|
42
42
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
43
43
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
44
|
+
"@atlaskit/link-analytics": "^8.0.2",
|
|
44
45
|
"@atlaskit/link-client-extension": "^1.1.0",
|
|
45
|
-
"@atlaskit/linking-common": "^2.
|
|
46
|
+
"@atlaskit/linking-common": "^2.12.0",
|
|
46
47
|
"@atlaskit/linking-types": "^1.6.0",
|
|
47
48
|
"@atlaskit/logo": "^13.14.0",
|
|
48
49
|
"@atlaskit/lozenge": "^11.4.0",
|
|
49
50
|
"@atlaskit/media-common": "^4.1.0",
|
|
50
51
|
"@atlaskit/modal-dialog": "^12.5.0",
|
|
51
52
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
53
|
+
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
52
54
|
"@atlaskit/popup": "^1.6.0",
|
|
53
55
|
"@atlaskit/spinner": "^15.5.0",
|
|
54
56
|
"@atlaskit/theme": "^12.5.0",
|
|
@@ -83,7 +85,7 @@
|
|
|
83
85
|
"@atlaskit/field-base": "^15.2.0",
|
|
84
86
|
"@atlaskit/form": "^8.11.0",
|
|
85
87
|
"@atlaskit/inline-message": "^11.5.0",
|
|
86
|
-
"@atlaskit/link-test-helpers": "^2.
|
|
88
|
+
"@atlaskit/link-test-helpers": "^2.4.0",
|
|
87
89
|
"@atlaskit/lozenge": "^11.4.0",
|
|
88
90
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
89
91
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
@@ -99,6 +101,7 @@
|
|
|
99
101
|
"@atlaskit/toggle": "^12.6.0",
|
|
100
102
|
"@atlaskit/visual-regression": "*",
|
|
101
103
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
104
|
+
"@atlassian/feature-flags-test-utils": "^0.1.1",
|
|
102
105
|
"@testing-library/dom": "^8.17.1",
|
|
103
106
|
"@testing-library/jest-dom": "^5.16.5",
|
|
104
107
|
"@testing-library/react": "^12.1.5",
|
|
@@ -135,6 +138,11 @@
|
|
|
135
138
|
"./link-url": "./src/linkUrl.ts",
|
|
136
139
|
".": "./src/index.ts"
|
|
137
140
|
},
|
|
141
|
+
"platform-feature-flags": {
|
|
142
|
+
"platform.linking-platform.smart-card.enable-analytics-context": {
|
|
143
|
+
"type": "boolean"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
138
146
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
139
147
|
"techstack": {
|
|
140
148
|
"@repo/internal": {
|