@atlaskit/smart-card 25.6.1 → 25.7.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/state/flexible-ui-context/index.js +13 -2
  3. package/dist/cjs/version.json +1 -1
  4. package/dist/cjs/view/CardWithUrl/component.js +2 -1
  5. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +4 -2
  6. package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/index.js +4 -2
  7. package/dist/cjs/view/FlexibleCard/components/container/index.js +7 -3
  8. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +4 -1
  9. package/dist/cjs/view/FlexibleCard/index.js +5 -2
  10. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +6 -3
  11. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +3 -1
  12. package/dist/cjs/view/HoverCard/styled.js +6 -2
  13. package/dist/cjs/view/InlineCard/ResolvedView/index.js +4 -1
  14. package/dist/cjs/view/InlineCard/index.js +3 -1
  15. package/dist/es2019/state/flexible-ui-context/index.js +8 -1
  16. package/dist/es2019/version.json +1 -1
  17. package/dist/es2019/view/CardWithUrl/component.js +2 -1
  18. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +5 -3
  19. package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/index.js +4 -2
  20. package/dist/es2019/view/FlexibleCard/components/container/index.js +5 -2
  21. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +4 -1
  22. package/dist/es2019/view/FlexibleCard/index.js +6 -3
  23. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +6 -4
  24. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +3 -1
  25. package/dist/es2019/view/HoverCard/styled.js +4 -1
  26. package/dist/es2019/view/InlineCard/ResolvedView/index.js +3 -1
  27. package/dist/es2019/view/InlineCard/index.js +3 -1
  28. package/dist/esm/state/flexible-ui-context/index.js +9 -0
  29. package/dist/esm/version.json +1 -1
  30. package/dist/esm/view/CardWithUrl/component.js +2 -1
  31. package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +5 -3
  32. package/dist/esm/view/FlexibleCard/components/common/lozenge-action/index.js +4 -2
  33. package/dist/esm/view/FlexibleCard/components/container/index.js +7 -3
  34. package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +4 -1
  35. package/dist/esm/view/FlexibleCard/index.js +6 -3
  36. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +7 -4
  37. package/dist/esm/view/HoverCard/components/HoverCardContent.js +3 -1
  38. package/dist/esm/view/HoverCard/styled.js +4 -1
  39. package/dist/esm/view/InlineCard/ResolvedView/index.js +4 -1
  40. package/dist/esm/view/InlineCard/index.js +3 -1
  41. package/dist/types/__fixtures__/bitbucket-pull-request.d.ts +73 -0
  42. package/dist/types/__fixtures__/confluence-blog.d.ts +49 -0
  43. package/dist/types/__fixtures__/confluence-page.d.ts +49 -0
  44. package/dist/types/__fixtures__/confluence-space.d.ts +36 -0
  45. package/dist/types/__fixtures__/confluence-template.d.ts +31 -0
  46. package/dist/types/__fixtures__/figma.d.ts +43 -0
  47. package/dist/types/__fixtures__/jira-roadmap.d.ts +35 -0
  48. package/dist/types/__fixtures__/jira-task.d.ts +78 -0
  49. package/dist/types/__fixtures__/youtube-video.d.ts +44 -0
  50. package/dist/types/state/flexible-ui-context/index.d.ts +7 -0
  51. package/dist/types/view/Card/index.d.ts +1 -1
  52. package/dist/types/view/FlexibleCard/components/common/lozenge-action/types.d.ts +1 -0
  53. package/dist/types/view/FlexibleCard/components/container/types.d.ts +2 -13
  54. package/dist/types/view/FlexibleCard/types.d.ts +8 -3
  55. package/dist/types/view/HoverCard/index.d.ts +1 -1
  56. package/dist/types/view/HoverCard/styled.d.ts +1 -0
  57. package/dist/types/view/HoverCard/types.d.ts +5 -0
  58. package/dist/types/view/InlineCard/ResolvedView/index.d.ts +2 -0
  59. package/dist/types/view/InlineCard/types.d.ts +1 -0
  60. package/package.json +1 -1
  61. package/report.api.md +2 -1
  62. package/tmp/api-report-tmp.d.ts +2 -1
@@ -0,0 +1,44 @@
1
+ declare const _default: {
2
+ meta: {
3
+ access: string;
4
+ visibility: string;
5
+ auth: never[];
6
+ definitionId: string;
7
+ key: string;
8
+ resourceType: string;
9
+ };
10
+ data: {
11
+ '@type': string;
12
+ '@context': {
13
+ '@vocab': string;
14
+ atlassian: string;
15
+ schema: string;
16
+ };
17
+ url: string;
18
+ name: string;
19
+ updated: string;
20
+ summary: string;
21
+ generator: {
22
+ '@type': string;
23
+ name: string;
24
+ icon: {
25
+ '@type': string;
26
+ url: string;
27
+ };
28
+ };
29
+ icon: {
30
+ '@type': string;
31
+ url: string;
32
+ };
33
+ image: {
34
+ '@type': string;
35
+ url: string;
36
+ };
37
+ preview: {
38
+ '@type': string;
39
+ href: string;
40
+ 'atlassian:aspectRatio': number;
41
+ };
42
+ };
43
+ };
44
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FlexibleUiDataContext } from './types';
3
+ import { FlexibleUiOptions } from '../../view/FlexibleCard/types';
3
4
  /**
4
5
  * This provides the data that will be used by Smart Links Flexible UI to populate it's
5
6
  * underlying elements.
@@ -98,3 +99,9 @@ export declare const useFlexibleUiAnalyticsContext: () => {
98
99
  }) => void;
99
100
  };
100
101
  } | undefined;
102
+ /**
103
+ * This provides the ui options that will be used by Smart Links Flexible UI
104
+ * to render its underlying elements.
105
+ */
106
+ export declare const FlexibleUiOptionContext: import("react").Context<FlexibleUiOptions | undefined>;
107
+ export declare const useFlexibleUiOptionContext: () => FlexibleUiOptions | undefined;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { CardAppearance, CardPlatform, CardProps } from './types';
3
3
  import { WrappedComponentProps } from 'react-intl-next';
4
- export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "ui" | "showActions" | "showHoverPreview" | "showServerActions" | "showAuthTooltip" | "onResolve" | "platform" | "frameStyle" | "embedIframeRef" | "inlinePreloaderStyle" | "isFrameVisible" | "importer" | "container" | "embedIframeUrlType" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
4
+ export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "ui" | "showActions" | "showHoverPreview" | "showServerActions" | "onResolve" | "showAuthTooltip" | "platform" | "frameStyle" | "embedIframeRef" | "inlinePreloaderStyle" | "isFrameVisible" | "importer" | "container" | "embedIframeUrlType" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
5
5
  export type { CardAppearance, CardProps, CardPlatform };
@@ -11,4 +11,5 @@ export declare type LozengeActionProps = {
11
11
  appearance?: ThemeAppearance;
12
12
  testId?: string;
13
13
  text: string | React.ReactNode;
14
+ zIndex?: number;
14
15
  };
@@ -1,12 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { SmartLinkStatus } from '../../../../constants';
3
- import { FlexibleUiOptions, RetryOptions } from '../../types';
4
- export declare type ContainerProps = FlexibleUiOptions & {
5
- /**
6
- * Determines the onClick behaviour of Flexible UI. This will proxy to the
7
- * TitleBlock if supplied.
8
- */
9
- onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
2
+ import { FlexibleCardProps, FlexibleUiOptions, RetryOptions } from '../../types';
3
+ export declare type ContainerProps = Pick<FlexibleCardProps, 'onClick' | 'showHoverPreview' | 'showServerActions'> & FlexibleUiOptions & {
10
4
  /**
11
5
  * The options that determine the retry behaviour when a Smart Link errors.
12
6
  */
@@ -22,11 +16,6 @@ export declare type ContainerProps = FlexibleUiOptions & {
22
16
  * serving as a hook for automated tests
23
17
  */
24
18
  testId?: string;
25
- /**
26
- * Determine whether or not a preview card should show up when a user hovers
27
- * over the smartlink.
28
- */
29
- showHoverPreview?: Boolean;
30
19
  };
31
20
  export declare type ChildrenOptions = {
32
21
  previewOnLeft?: boolean;
@@ -91,6 +91,11 @@ export declare type FlexibleUiOptions = {
91
91
  * Determines whether to hide elevation styling.
92
92
  */
93
93
  hideElevation?: boolean;
94
+ /**
95
+ * Determines whether to hide hover preview's full screen view.
96
+ * Only applies if showHoverPreview from FlexibleCardProps is true
97
+ */
98
+ hideHoverCardPreviewButton?: boolean;
94
99
  /**
95
100
  * Determines whether to hide css padding styling.
96
101
  */
@@ -110,10 +115,10 @@ export declare type FlexibleUiOptions = {
110
115
  */
111
116
  theme?: SmartLinkTheme;
112
117
  /**
113
- * Determines whether to hide hover preview's full screen view.
114
- * Only applies if showHoverPreview from FlexibleCardProps is true
118
+ * Z-index that Atlaskit portal component should be displayed in.
119
+ * This is passed to the portal component.
115
120
  */
116
- hideHoverCardPreviewButton?: boolean;
121
+ zIndex?: number;
117
122
  };
118
123
  /**
119
124
  * Retry options used if Smart Link resolves to an errored state.
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { HoverCardProps } from './types';
3
- export declare const HoverCard: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").PropsWithChildren<HoverCardProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "key" | "id" | "analyticsContext" | "onAuthorize" | "canOpen" | "closeOnChildClick" | "hidePreviewButton"> & import("react").RefAttributes<any>>;
3
+ export declare const HoverCard: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").PropsWithChildren<HoverCardProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "key" | "id" | "analyticsContext" | "showServerActions" | "onAuthorize" | "canOpen" | "closeOnChildClick" | "hidePreviewButton"> & import("react").RefAttributes<any>>;
@@ -1,4 +1,5 @@
1
1
  import { FlexibleUiOptions } from '../FlexibleCard/types';
2
+ export declare const HOVER_CARD_Z_INDEX = 511;
2
3
  export declare const flexibleUiOptions: FlexibleUiOptions;
3
4
  export declare const CARD_WIDTH_REM = 24;
4
5
  export declare const CARD_GAP_PX = 10;
@@ -38,6 +38,10 @@ export interface HoverCardProps extends WithAnalyticsEventsProps {
38
38
  * Determines if the hover card should display the "Full Screen View" button.
39
39
  */
40
40
  hidePreviewButton?: boolean;
41
+ /**
42
+ * Determines whether to show available server actions.
43
+ */
44
+ showServerActions?: boolean;
41
45
  }
42
46
  export interface HoverCardComponentProps extends HoverCardProps {
43
47
  analyticsHandler: AnalyticsHandler;
@@ -63,6 +67,7 @@ export declare type HoverCardContentProps = {
63
67
  url: string;
64
68
  onMouseEnter?: MouseEventHandler;
65
69
  onMouseLeave?: MouseEventHandler;
70
+ showServerActions?: boolean;
66
71
  };
67
72
  export declare type SnippetOrPreviewProps = {
68
73
  data: JsonLd.Data.BaseData;
@@ -23,6 +23,8 @@ export interface InlineCardResolvedViewProps {
23
23
  titlePrefix?: React.ReactNode;
24
24
  /** Enables showing a custom preview on hover of link */
25
25
  showHoverPreview?: boolean;
26
+ /** Show server actions that change the link resource, e.g. update status. */
27
+ showServerActions?: boolean;
26
28
  }
27
29
  export declare class InlineCardResolvedView extends React.Component<InlineCardResolvedViewProps> {
28
30
  renderLozenge(): JSX.Element | null;
@@ -20,5 +20,6 @@ export declare type InlineCardProps = {
20
20
  renderers?: CardProviderRenderers;
21
21
  showHoverPreview?: boolean;
22
22
  showAuthTooltip?: boolean;
23
+ showServerActions?: boolean;
23
24
  analytics: AnalyticsFacade;
24
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "25.6.1",
3
+ "version": "25.7.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/report.api.md CHANGED
@@ -546,11 +546,12 @@ type ErrorCardType =
546
546
  type FlexibleUiOptions = {
547
547
  clickableContainer?: boolean;
548
548
  hideElevation?: boolean;
549
+ hideHoverCardPreviewButton?: boolean;
549
550
  hidePadding?: boolean;
550
551
  hideBackground?: boolean;
551
552
  size?: SmartLinkSize;
552
553
  theme?: SmartLinkTheme;
553
- hideHoverCardPreviewButton?: boolean;
554
+ zIndex?: number;
554
555
  };
555
556
 
556
557
  // @public
@@ -416,11 +416,12 @@ type ErrorCardType = 'errored' | 'fallback' | 'forbidden' | 'not_found' | 'unaut
416
416
  type FlexibleUiOptions = {
417
417
  clickableContainer?: boolean;
418
418
  hideElevation?: boolean;
419
+ hideHoverCardPreviewButton?: boolean;
419
420
  hidePadding?: boolean;
420
421
  hideBackground?: boolean;
421
422
  size?: SmartLinkSize;
422
423
  theme?: SmartLinkTheme;
423
- hideHoverCardPreviewButton?: boolean;
424
+ zIndex?: number;
424
425
  };
425
426
 
426
427
  // @public