@atlaskit/smart-card 26.49.0 → 26.49.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +39 -27
  3. package/dist/cjs/state/hooks/use-ai-summary/index.js +16 -38
  4. package/dist/cjs/utils/analytics/analytics.js +1 -1
  5. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +37 -29
  6. package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +1 -4
  7. package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +8 -9
  8. package/dist/cjs/view/HoverCard/components/ContentContainer.js +39 -13
  9. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -10
  10. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +63 -16
  11. package/dist/cjs/view/LinkUrl/index.js +1 -1
  12. package/dist/cjs/view/common/ai-prism/index.js +0 -1
  13. package/dist/cjs/view/common/ai-summary/index.js +9 -3
  14. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +14 -5
  15. package/dist/es2019/state/hooks/use-ai-summary/index.js +17 -35
  16. package/dist/es2019/utils/analytics/analytics.js +1 -1
  17. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +33 -26
  18. package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +1 -1
  19. package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +0 -1
  20. package/dist/es2019/view/HoverCard/components/ContentContainer.js +35 -10
  21. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +2 -7
  22. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +56 -7
  23. package/dist/es2019/view/LinkUrl/index.js +1 -1
  24. package/dist/es2019/view/common/ai-prism/index.js +0 -1
  25. package/dist/es2019/view/common/ai-summary/index.js +7 -3
  26. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +39 -27
  27. package/dist/esm/state/hooks/use-ai-summary/index.js +17 -39
  28. package/dist/esm/utils/analytics/analytics.js +1 -1
  29. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +38 -30
  30. package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +1 -1
  31. package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +0 -1
  32. package/dist/esm/view/HoverCard/components/ContentContainer.js +39 -13
  33. package/dist/esm/view/HoverCard/components/HoverCardContent.js +2 -11
  34. package/dist/esm/view/HoverCard/components/views/resolved/index.js +66 -18
  35. package/dist/esm/view/LinkUrl/index.js +1 -1
  36. package/dist/esm/view/common/ai-prism/index.js +0 -1
  37. package/dist/esm/view/common/ai-summary/index.js +9 -3
  38. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +3 -1
  39. package/dist/types/state/hooks/use-ai-summary/index.d.ts +0 -1
  40. package/dist/types/view/BlockCard/views/flexible/unresolved-view/index.d.ts +2 -2
  41. package/dist/types/view/BlockCard/views/flexible/unresolved-view/types.d.ts +3 -2
  42. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-error-viewed/index.d.ts +1 -2
  43. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.d.ts +2 -2
  44. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +2 -3
  45. package/dist/types/view/FlexibleCard/components/blocks/block/index.d.ts +2 -3
  46. package/dist/types/view/FlexibleCard/components/blocks/element-group/index.d.ts +2 -3
  47. package/dist/types/view/FlexibleCard/components/blocks/element-group/types.d.ts +3 -2
  48. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +3 -3
  49. package/dist/types/view/FlexibleCard/components/container/hover-card-control/index.d.ts +2 -2
  50. package/dist/types/view/FlexibleCard/components/container/hover-card-control/types.d.ts +3 -2
  51. package/dist/types/view/FlexibleCard/components/container/index.d.ts +2 -4
  52. package/dist/types/view/FlexibleCard/components/container/types.d.ts +3 -2
  53. package/dist/types/view/HoverCard/components/ContentContainer.d.ts +3 -2
  54. package/dist/types/view/HoverCard/components/views/resolved/types.d.ts +0 -2
  55. package/dist/types/view/HoverCard/types.d.ts +1 -1
  56. package/dist/types/view/common/ai-prism/index.d.ts +3 -2
  57. package/dist/types/view/common/ai-prism/types.d.ts +3 -2
  58. package/dist/types/view/common/ai-summary/index.d.ts +4 -0
  59. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +3 -1
  60. package/dist/types-ts4.5/state/hooks/use-ai-summary/index.d.ts +0 -1
  61. package/dist/types-ts4.5/view/BlockCard/views/flexible/unresolved-view/index.d.ts +2 -2
  62. package/dist/types-ts4.5/view/BlockCard/views/flexible/unresolved-view/types.d.ts +3 -2
  63. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-error-viewed/index.d.ts +1 -2
  64. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.d.ts +2 -2
  65. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +2 -3
  66. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/block/index.d.ts +2 -3
  67. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/element-group/index.d.ts +2 -3
  68. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/element-group/types.d.ts +3 -2
  69. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +3 -3
  70. package/dist/types-ts4.5/view/FlexibleCard/components/container/hover-card-control/index.d.ts +2 -2
  71. package/dist/types-ts4.5/view/FlexibleCard/components/container/hover-card-control/types.d.ts +3 -2
  72. package/dist/types-ts4.5/view/FlexibleCard/components/container/index.d.ts +2 -4
  73. package/dist/types-ts4.5/view/FlexibleCard/components/container/types.d.ts +3 -2
  74. package/dist/types-ts4.5/view/HoverCard/components/ContentContainer.d.ts +3 -2
  75. package/dist/types-ts4.5/view/HoverCard/components/views/resolved/types.d.ts +0 -2
  76. package/dist/types-ts4.5/view/HoverCard/types.d.ts +1 -1
  77. package/dist/types-ts4.5/view/common/ai-prism/index.d.ts +3 -2
  78. package/dist/types-ts4.5/view/common/ai-prism/types.d.ts +3 -2
  79. package/dist/types-ts4.5/view/common/ai-summary/index.d.ts +4 -0
  80. package/package.json +5 -5
@@ -1,6 +1,4 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { SerializedStyles } from '@emotion/react';
1
+ import { jsx, SerializedStyles } from '@emotion/react';
4
2
  import { SmartLinkSize } from '../../../../constants';
5
3
  import { ChildrenOptions, ContainerProps } from './types';
6
4
  export declare const getContainerStyles: (size: SmartLinkSize, hideBackground: boolean, hideElevation: boolean, hidePadding: boolean, clickableContainer: boolean, childrenOptions: ChildrenOptions) => SerializedStyles;
@@ -12,5 +10,5 @@ export declare const getContainerStyles: (size: SmartLinkSize, hideBackground: b
12
10
  * @internal
13
11
  * @see Block
14
12
  */
15
- declare const Container: React.FC<ContainerProps>;
13
+ declare const Container: ({ children, clickableContainer, hideBackground, hideElevation, hideHoverCardPreviewButton, hidePadding, onClick, retry, showAuthTooltip, showHoverPreview, actionOptions, size, status, testId, theme, }: ContainerProps) => jsx.JSX.Element;
16
14
  export default Container;
@@ -1,6 +1,7 @@
1
+ import { PropsWithChildren } from 'react';
1
2
  import { SmartLinkStatus } from '../../../../constants';
2
3
  import { FlexibleCardProps, FlexibleUiOptions, RetryOptions } from '../../types';
3
- export type ContainerProps = Pick<FlexibleCardProps, 'onClick' | 'showHoverPreview' | 'actionOptions' | 'showAuthTooltip'> & FlexibleUiOptions & {
4
+ export type ContainerProps = PropsWithChildren<Pick<FlexibleCardProps, 'onClick' | 'showHoverPreview' | 'actionOptions' | 'showAuthTooltip'> & FlexibleUiOptions & {
4
5
  /**
5
6
  * The options that determine the retry behaviour when a Smart Link errors.
6
7
  */
@@ -16,7 +17,7 @@ export type ContainerProps = Pick<FlexibleCardProps, 'onClick' | 'showHoverPrevi
16
17
  * serving as a hook for automated tests
17
18
  */
18
19
  testId?: string;
19
- };
20
+ }>;
20
21
  export type ChildrenOptions = {
21
22
  previewOnLeft?: boolean;
22
23
  previewOnRight?: boolean;
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
2
3
  import type { ContentContainerProps } from '../types';
3
- declare const ContentContainer: React.FC<ContentContainerProps>;
4
+ declare const ContentContainer: ({ children, isAIEnabled, testId, url, ...props }: ContentContainerProps) => jsx.JSX.Element;
4
5
  export default ContentContainer;
@@ -2,7 +2,6 @@ import { AnalyticsFacade } from '../../../../../state/analytics';
2
2
  import { LinkAction } from '../../../../../state/hooks-external/useSmartLinkActions';
3
3
  import { CardState } from '@atlaskit/linking-common';
4
4
  import { HoverCardLoadingViewProps } from '../resolving/types';
5
- import { AISummaryBlockProps } from '../../../../FlexibleCard/components/blocks/ai-summary-block/types';
6
5
  export type HoverCardResolvedProps = {
7
6
  extensionKey?: string;
8
7
  id?: string;
@@ -12,5 +11,4 @@ export type HoverCardResolvedProps = {
12
11
  cardState: CardState;
13
12
  isAISummaryEnabled?: boolean;
14
13
  onActionClick: (actionId: string) => void;
15
- onAIActionChange?: AISummaryBlockProps['onAIActionChange'];
16
14
  } & HoverCardLoadingViewProps;
@@ -101,8 +101,8 @@ export type HoverCardContentProps = {
101
101
  };
102
102
  export type ContentContainerProps = React.HTMLAttributes<HTMLDivElement> & {
103
103
  isAIEnabled?: boolean;
104
- showPrism?: boolean;
105
104
  testId?: string;
105
+ url: string;
106
106
  };
107
107
  export type ImagePreviewProps = {
108
108
  data: JsonLd.Data.BaseData;
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
2
3
  import type { AIPrismProps } from './types';
3
- declare const AIPrism: React.FC<AIPrismProps>;
4
+ declare const AIPrism: ({ children, isGlowing, isMoving, isVisible, testId, }: AIPrismProps) => jsx.JSX.Element;
4
5
  export default AIPrism;
@@ -1,7 +1,8 @@
1
+ import { type PropsWithChildren } from 'react';
1
2
  import { AIGlowingBorderProps } from './ai-glowing-border/types';
2
- export type AIPrismProps = Pick<AIGlowingBorderProps, 'isMoving' | 'isGlowing' | 'testId'> & {
3
+ export type AIPrismProps = PropsWithChildren<Pick<AIGlowingBorderProps, 'isMoving' | 'isGlowing' | 'testId'> & {
3
4
  isVisible?: boolean;
4
- };
5
+ }>;
5
6
  export type AIBorderPalette = {
6
7
  blue: string;
7
8
  yellow: string;
@@ -12,6 +12,10 @@ type AISummaryProps = {
12
12
  * serving as a hook for automated tests
13
13
  */
14
14
  testId?: string;
15
+ /**
16
+ * Minimum height requirement for the AISummary component to prevent fluctuations in a card size on the summary action.
17
+ */
18
+ minHeight?: number;
15
19
  };
16
20
  /**
17
21
  * A component to render a response from AI in markdown text.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.49.0",
3
+ "version": "26.49.2",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/avatar-group": "^9.5.0",
35
35
  "@atlaskit/badge": "^15.2.0",
36
36
  "@atlaskit/button": "^17.7.0",
37
- "@atlaskit/dropdown-menu": "^12.7.0",
37
+ "@atlaskit/dropdown-menu": "^12.8.0",
38
38
  "@atlaskit/icon": "^22.1.0",
39
39
  "@atlaskit/icon-file-type": "^6.4.0",
40
40
  "@atlaskit/icon-object": "^6.3.0",
@@ -51,10 +51,10 @@
51
51
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
52
52
  "@atlaskit/platform-feature-flags": "^0.2.1",
53
53
  "@atlaskit/popup": "^1.13.0",
54
- "@atlaskit/primitives": "^4.0.0",
54
+ "@atlaskit/primitives": "^4.1.0",
55
55
  "@atlaskit/spinner": "^16.0.0",
56
56
  "@atlaskit/theme": "^12.6.0",
57
- "@atlaskit/tokens": "^1.39.0",
57
+ "@atlaskit/tokens": "^1.41.0",
58
58
  "@atlaskit/tooltip": "^18.1.0",
59
59
  "@atlaskit/ufo": "^0.2.0",
60
60
  "@babel/runtime": "^7.0.0",
@@ -83,7 +83,7 @@
83
83
  "@af/integration-testing": "*",
84
84
  "@af/visual-regression": "*",
85
85
  "@atlaskit/analytics-listeners": "^8.9.0",
86
- "@atlaskit/css-reset": "^6.6.0",
86
+ "@atlaskit/css-reset": "^6.7.0",
87
87
  "@atlaskit/link-test-helpers": "^6.2.0",
88
88
  "@atlaskit/media-test-helpers": "^33.0.0",
89
89
  "@atlaskit/ssr": "*",