@atlaskit/smart-card 45.22.5 → 45.23.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 +21 -0
- package/dist/cjs/entry-points/hover.js +21 -0
- package/dist/cjs/hoverCard.js +2 -2
- package/dist/cjs/state/hooks/use-resolve/index.js +7 -5
- package/dist/cjs/state/hooks/use-response/index.js +17 -5
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +1 -1
- package/dist/cjs/view/HoverCard/index.js +58 -14
- package/dist/cjs/view/InlineCard/ErroredView/index.js +1 -1
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +1 -1
- package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +1 -1
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +1 -1
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/entry-points/hover.js +9 -0
- package/dist/es2019/hoverCard.js +1 -3
- package/dist/es2019/state/hooks/use-resolve/index.js +7 -4
- package/dist/es2019/state/hooks/use-response/index.js +17 -5
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/index.js +1 -1
- package/dist/es2019/view/HoverCard/index.js +52 -7
- package/dist/es2019/view/InlineCard/ErroredView/index.js +1 -1
- package/dist/es2019/view/InlineCard/ForbiddenView/index.js +1 -1
- package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +1 -1
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +1 -1
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/entry-points/hover.js +13 -0
- package/dist/esm/hoverCard.js +1 -3
- package/dist/esm/state/hooks/use-resolve/index.js +7 -5
- package/dist/esm/state/hooks/use-response/index.js +17 -5
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +1 -1
- package/dist/esm/view/FlexibleCard/components/container/hover-card-control/index.js +1 -1
- package/dist/esm/view/HoverCard/index.js +51 -7
- package/dist/esm/view/InlineCard/ErroredView/index.js +1 -1
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +1 -1
- package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +1 -1
- package/dist/esm/view/InlineCard/ResolvedView/index.js +1 -1
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/entry-points/hover.d.ts +7 -0
- package/dist/types/hoverCard.d.ts +1 -3
- package/dist/types/view/HoverCard/components/ContentContainer.d.ts +10 -1
- package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +8 -1
- package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +22 -2
- package/dist/types/view/HoverCard/components/ImagePreview.d.ts +5 -1
- package/dist/types/view/HoverCard/index.d.ts +8 -6
- package/dist/types/view/HoverCard/types.d.ts +22 -6
- package/hover/package.json +4 -4
- package/package.json +8 -8
- package/dist/cjs/view/HoverCard/HoverCard.js +0 -63
- package/dist/cjs/view/HoverCard/StandaloneHoverCard.js +0 -15
- package/dist/es2019/view/HoverCard/HoverCard.js +0 -55
- package/dist/es2019/view/HoverCard/StandaloneHoverCard.js +0 -6
- package/dist/esm/view/HoverCard/HoverCard.js +0 -54
- package/dist/esm/view/HoverCard/StandaloneHoverCard.js +0 -8
- package/dist/types/view/HoverCard/HoverCard.d.ts +0 -10
- package/dist/types/view/HoverCard/StandaloneHoverCard.d.ts +0 -6
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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
|
-
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
|
-
import React, { useCallback } from 'react';
|
|
5
|
-
import { ErrorBoundary } from 'react-error-boundary';
|
|
6
|
-
import { di } from 'react-magnetic-di';
|
|
7
|
-
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
8
|
-
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
9
|
-
import { CardDisplay } from '../../constants';
|
|
10
|
-
import { failUfoExperience } from '../../state/analytics/failUfoExperience';
|
|
11
|
-
import { startUfoExperience } from '../../state/analytics/startUfoExperience';
|
|
12
|
-
import { SmartLinkModalProvider } from '../../state/modal/SmartLinkModalProvider';
|
|
13
|
-
import { useSmartLinkAnalyticsContext } from '../../utils/analytics/useSmartLinkAnalyticsContext';
|
|
14
|
-
import { HOVER_CARD_SOURCE, HoverCardComponent } from './components/HoverCardComponent';
|
|
15
|
-
var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
16
|
-
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
17
|
-
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
18
|
-
var url = props.url,
|
|
19
|
-
id = props.id,
|
|
20
|
-
children = props.children;
|
|
21
|
-
var analyticsContext = useSmartLinkAnalyticsContext({
|
|
22
|
-
display: CardDisplay.HoverCardPreview,
|
|
23
|
-
id: id,
|
|
24
|
-
source: HOVER_CARD_SOURCE,
|
|
25
|
-
url: url
|
|
26
|
-
});
|
|
27
|
-
var onError = useCallback(function (error, info) {
|
|
28
|
-
startUfoExperience('smart-link-rendered', id || 'NULL');
|
|
29
|
-
failUfoExperience('smart-link-rendered', id || 'NULL');
|
|
30
|
-
failUfoExperience('smart-link-authenticated', id || 'NULL');
|
|
31
|
-
fireEvent('ui.smartLink.renderFailed', _objectSpread(_objectSpread({}, analyticsContext === null || analyticsContext === void 0 ? void 0 : analyticsContext.attributes), {}, {
|
|
32
|
-
display: CardDisplay.HoverCardPreview,
|
|
33
|
-
id: id !== null && id !== void 0 ? id : null,
|
|
34
|
-
error: error,
|
|
35
|
-
errorInfo: info
|
|
36
|
-
}));
|
|
37
|
-
}, [analyticsContext, id, fireEvent]);
|
|
38
|
-
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
39
|
-
fallback: children,
|
|
40
|
-
onError: onError
|
|
41
|
-
}, /*#__PURE__*/React.createElement(SmartLinkModalProvider, null, /*#__PURE__*/React.createElement(HoverCardComponent, props, children)));
|
|
42
|
-
};
|
|
43
|
-
var HoverCardWithoutAnalyticsContext = withAnalyticsEvents()(HoverCardWithErrorBoundary);
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* A hover preview component using within smart links,
|
|
47
|
-
* e.g. inline card's hover preview and auth tooltip, flexible card's hover preview.
|
|
48
|
-
*
|
|
49
|
-
* This component contains additional props that smart-card internal components
|
|
50
|
-
* use to configure hover preview behaviour.
|
|
51
|
-
*/
|
|
52
|
-
export var HoverCard = function HoverCard(props) {
|
|
53
|
-
return /*#__PURE__*/React.createElement(HoverCardWithoutAnalyticsContext, props);
|
|
54
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type HoverCardInternalProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* A hover preview component using within smart links,
|
|
5
|
-
* e.g. inline card's hover preview and auth tooltip, flexible card's hover preview.
|
|
6
|
-
*
|
|
7
|
-
* This component contains additional props that smart-card internal components
|
|
8
|
-
* use to configure hover preview behaviour.
|
|
9
|
-
*/
|
|
10
|
-
export declare const HoverCard: (props: HoverCardInternalProps) => React.JSX.Element;
|