@atlaskit/smart-card 44.3.0 → 44.3.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 +17 -0
- package/analytics.spec.yaml +9 -0
- package/dist/cjs/ssr.js +28 -1
- package/dist/cjs/state/hooks/use-incoming-outgoing-links/index.js +8 -14
- package/dist/cjs/state/hooks/use-intersection-observer/index.js +49 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/card-error-boundary/index.js +28 -0
- package/dist/cjs/view/CardWithUrl/card-intersection-observer/index.js +46 -0
- package/dist/cjs/view/CardWithUrl/card-loader-wrapper/index.js +23 -0
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +43 -3
- package/dist/cjs/view/CardWithUrl/component.js +34 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/ssr.js +28 -2
- package/dist/es2019/state/hooks/use-incoming-outgoing-links/index.js +8 -12
- package/dist/es2019/state/hooks/use-intersection-observer/index.js +41 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/card-error-boundary/index.js +20 -0
- package/dist/es2019/view/CardWithUrl/card-intersection-observer/index.js +25 -0
- package/dist/es2019/view/CardWithUrl/card-loader-wrapper/index.js +16 -0
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +39 -2
- package/dist/es2019/view/CardWithUrl/component.js +34 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/ssr.js +29 -2
- package/dist/esm/state/hooks/use-incoming-outgoing-links/index.js +8 -14
- package/dist/esm/state/hooks/use-intersection-observer/index.js +44 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/card-error-boundary/index.js +21 -0
- package/dist/esm/view/CardWithUrl/card-intersection-observer/index.js +37 -0
- package/dist/esm/view/CardWithUrl/card-loader-wrapper/index.js +15 -0
- package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +42 -2
- package/dist/esm/view/CardWithUrl/component.js +34 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +7 -1
- package/dist/types/state/hooks/use-intersection-observer/index.d.ts +6 -0
- package/dist/types/view/CardWithUrl/card-error-boundary/index.d.ts +5 -0
- package/dist/types/view/CardWithUrl/card-intersection-observer/index.d.ts +7 -0
- package/dist/types/view/CardWithUrl/card-loader-wrapper/index.d.ts +7 -0
- package/dist/types/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.d.ts +1 -1
- package/dist/types/view/CardWithUrl/component.d.ts +1 -0
- package/dist/types/view/CardWithUrl/types.d.ts +1 -0
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +7 -1
- package/dist/types-ts4.5/state/hooks/use-intersection-observer/index.d.ts +6 -0
- package/dist/types-ts4.5/view/CardWithUrl/card-error-boundary/index.d.ts +5 -0
- package/dist/types-ts4.5/view/CardWithUrl/card-intersection-observer/index.d.ts +7 -0
- package/dist/types-ts4.5/view/CardWithUrl/card-loader-wrapper/index.d.ts +7 -0
- package/dist/types-ts4.5/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.d.ts +1 -1
- package/dist/types-ts4.5/view/CardWithUrl/component.d.ts +1 -0
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CardProps } from '../../Card';
|
|
3
|
+
type WithCardIntersectionObserverProps = {
|
|
4
|
+
appearance: CardProps['appearance'];
|
|
5
|
+
};
|
|
6
|
+
declare const _default: <T extends WithCardIntersectionObserverProps>(Component: React.ComponentType<T>) => (props: T) => React.JSX.Element;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CardProps } from '../../Card';
|
|
3
|
+
type CardLoaderWrapperProps = Pick<CardProps, 'appearance'>;
|
|
4
|
+
declare const CardLoaderWrapper: React.ForwardRefExoticComponent<CardLoaderWrapperProps & {
|
|
5
|
+
children?: React.ReactNode | undefined;
|
|
6
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export default CardLoaderWrapper;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardWithUrlContentProps } from '../types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const LazyIntersectionObserverCard: React.FC<CardWithUrlContentProps>;
|
|
@@ -24,6 +24,7 @@ export type CardWithUrlContentProps = {
|
|
|
24
24
|
inheritDimensions?: boolean;
|
|
25
25
|
inlinePreloaderStyle?: InlinePreloaderStyle;
|
|
26
26
|
isHovered?: boolean;
|
|
27
|
+
isIntersected?: boolean;
|
|
27
28
|
isSelected?: boolean;
|
|
28
29
|
onClick?: EventHandler<MouseEvent | KeyboardEvent>;
|
|
29
30
|
onError?: OnErrorCallback;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::4d978bf4946aee0ad737d8305df7a6a0>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataContextType = {
|
|
@@ -263,6 +263,9 @@ export type SmartLinkRenderFailedAttributesType = {
|
|
|
263
263
|
id: string | null;
|
|
264
264
|
};
|
|
265
265
|
export type ButtonClickedDismissAttributesType = {};
|
|
266
|
+
export type SmartLinkSeenAttributesType = {
|
|
267
|
+
display: 'inline' | 'block' | 'embed' | 'flexible';
|
|
268
|
+
};
|
|
266
269
|
export type SmartLinkClickedSmartlinkClickAnalyticsWorkflowsAttributesType = {
|
|
267
270
|
thirdPartyARI: string;
|
|
268
271
|
eventName: string;
|
|
@@ -439,6 +442,9 @@ export type AnalyticsEventAttributes = {
|
|
|
439
442
|
/**
|
|
440
443
|
* fires an event that represents when a Smart Link renders unsuccessfully. */
|
|
441
444
|
'ui.smartLink.renderFailed': SmartLinkRenderFailedAttributesType;
|
|
445
|
+
/**
|
|
446
|
+
* fires an event that represents when a rendered Smart Link is visible in the viewport for the first time */
|
|
447
|
+
'ui.smartLink.seen': SmartLinkSeenAttributesType;
|
|
442
448
|
/**
|
|
443
449
|
* fires an event that represents when a user clicks on a Smart Link to track analytics for the 3P Workflows team */
|
|
444
450
|
'ui.smartLink.clicked.smartlinkClickAnalyticsWorkflows': SmartLinkClickedSmartlinkClickAnalyticsWorkflowsAttributesType;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type UseIntersectionObserverProps = {
|
|
2
|
+
onIntersecting?: () => void;
|
|
3
|
+
onIntersection?: (isIntersecting: boolean) => void;
|
|
4
|
+
};
|
|
5
|
+
declare const useIntersectionObserver: ({ onIntersecting: onIntersectingCallback, onIntersection: onIntersectionCallback, }: UseIntersectionObserverProps) => import("react").MutableRefObject<HTMLDivElement | null>;
|
|
6
|
+
export default useIntersectionObserver;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CardProps } from '../../Card';
|
|
3
|
+
type CardErrorBoundaryProps = CardProps & Required<Pick<CardProps, 'id' | 'url'>>;
|
|
4
|
+
declare const CardErrorBoundary: ({ children, ...props }: React.PropsWithChildren<CardErrorBoundaryProps>) => React.JSX.Element;
|
|
5
|
+
export default CardErrorBoundary;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CardProps } from '../../Card';
|
|
3
|
+
type WithCardIntersectionObserverProps = {
|
|
4
|
+
appearance: CardProps['appearance'];
|
|
5
|
+
};
|
|
6
|
+
declare const _default: <T extends WithCardIntersectionObserverProps>(Component: React.ComponentType<T>) => (props: T) => React.JSX.Element;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CardProps } from '../../Card';
|
|
3
|
+
type CardLoaderWrapperProps = Pick<CardProps, 'appearance'>;
|
|
4
|
+
declare const CardLoaderWrapper: React.ForwardRefExoticComponent<CardLoaderWrapperProps & {
|
|
5
|
+
children?: React.ReactNode | undefined;
|
|
6
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export default CardLoaderWrapper;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardWithUrlContentProps } from '../types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const LazyIntersectionObserverCard: React.FC<CardWithUrlContentProps>;
|
|
@@ -24,6 +24,7 @@ export type CardWithUrlContentProps = {
|
|
|
24
24
|
inheritDimensions?: boolean;
|
|
25
25
|
inlinePreloaderStyle?: InlinePreloaderStyle;
|
|
26
26
|
isHovered?: boolean;
|
|
27
|
+
isIntersected?: boolean;
|
|
27
28
|
isSelected?: boolean;
|
|
28
29
|
onClick?: EventHandler<MouseEvent | KeyboardEvent>;
|
|
29
30
|
onError?: OnErrorCallback;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "44.3.
|
|
3
|
+
"version": "44.3.2",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/link-analytics": "^11.0.0",
|
|
63
63
|
"@atlaskit/link-client-extension": "^6.0.0",
|
|
64
64
|
"@atlaskit/link-extractors": "^2.4.0",
|
|
65
|
-
"@atlaskit/link-test-helpers": "^10.
|
|
65
|
+
"@atlaskit/link-test-helpers": "^10.2.0",
|
|
66
66
|
"@atlaskit/linking-common": "^9.11.0",
|
|
67
67
|
"@atlaskit/linking-types": "^14.2.0",
|
|
68
68
|
"@atlaskit/logo": "^20.0.0",
|
|
@@ -217,10 +217,10 @@
|
|
|
217
217
|
"platform_navx_flex_card_status_dropdown_a11y_fix": {
|
|
218
218
|
"type": "boolean"
|
|
219
219
|
},
|
|
220
|
-
"
|
|
220
|
+
"platform_sl_3p_auth_rovo_action_kill_switch": {
|
|
221
221
|
"type": "boolean"
|
|
222
222
|
},
|
|
223
|
-
"
|
|
223
|
+
"platform_sl_event_ui_seen": {
|
|
224
224
|
"type": "boolean"
|
|
225
225
|
},
|
|
226
226
|
"jpx-1074-smart-links-iframe": {
|