@atlaskit/smart-card 21.0.2 → 21.1.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 (55) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/version.json +1 -1
  3. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +87 -0
  4. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/types.js +5 -0
  5. package/dist/cjs/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +31 -0
  6. package/dist/cjs/view/FlexibleCard/components/actions/action/action-dropdown-item/types.js +5 -0
  7. package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +52 -0
  8. package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/types.js +5 -0
  9. package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +42 -104
  10. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +44 -15
  11. package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +1 -1
  12. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +13 -4
  13. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +16 -3
  14. package/dist/cjs/view/FlexibleCard/components/utils.js +7 -2
  15. package/dist/es2019/version.json +1 -1
  16. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +88 -0
  17. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/types.js +1 -0
  18. package/dist/es2019/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +18 -0
  19. package/dist/es2019/view/FlexibleCard/components/actions/action/action-dropdown-item/types.js +1 -0
  20. package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +35 -0
  21. package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/types.js +1 -0
  22. package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +26 -110
  23. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +31 -12
  24. package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +2 -1
  25. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +12 -2
  26. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +23 -2
  27. package/dist/es2019/view/FlexibleCard/components/utils.js +6 -0
  28. package/dist/esm/version.json +1 -1
  29. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +67 -0
  30. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/types.js +1 -0
  31. package/dist/esm/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +19 -0
  32. package/dist/esm/view/FlexibleCard/components/actions/action/action-dropdown-item/types.js +1 -0
  33. package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +39 -0
  34. package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/types.js +1 -0
  35. package/dist/esm/view/FlexibleCard/components/actions/action/index.js +41 -99
  36. package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +44 -16
  37. package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +2 -2
  38. package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +13 -5
  39. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +14 -2
  40. package/dist/esm/view/FlexibleCard/components/utils.js +3 -1
  41. package/dist/types/index.d.ts +1 -1
  42. package/dist/types/view/FlexibleCard/components/actions/action/action-button/index.d.ts +5 -0
  43. package/dist/types/view/FlexibleCard/components/actions/action/action-button/types.d.ts +8 -0
  44. package/dist/types/view/FlexibleCard/components/actions/action/action-dropdown-item/index.d.ts +4 -0
  45. package/dist/types/view/FlexibleCard/components/actions/action/action-dropdown-item/types.d.ts +8 -0
  46. package/dist/types/view/FlexibleCard/components/actions/action/action-icon/index.d.ts +5 -0
  47. package/dist/types/view/FlexibleCard/components/actions/action/action-icon/types.d.ts +7 -0
  48. package/dist/types/view/FlexibleCard/components/actions/action/index.d.ts +0 -3
  49. package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +0 -16
  50. package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +6 -1
  51. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +3 -0
  52. package/dist/types/view/FlexibleCard/components/blocks/utils.d.ts +2 -1
  53. package/dist/types/view/FlexibleCard/components/utils.d.ts +2 -0
  54. package/package.json +8 -5
  55. package/report.api.md +41 -2
package/report.api.md CHANGED
@@ -1,6 +1,8 @@
1
- ## API Report File for "@atlaskit/smart-card"
1
+ ## API Report File for "@atlaskit/smart-card".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ```ts
6
8
  /// <reference types="react" />
@@ -18,6 +20,7 @@ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
18
20
  import { EditorCardProvider } from '@atlaskit/link-provider';
19
21
  import { editorCardProvider } from '@atlaskit/link-provider';
20
22
  import { EmbedCardAdf } from '@atlaskit/linking-common';
23
+ import { ErrorInfo } from 'react';
21
24
  import { GasPayload } from '@atlaskit/analytics-gas-types';
22
25
  import { InlineCardAdf } from '@atlaskit/linking-common';
23
26
  import { JsonLd } from 'json-ld-types';
@@ -254,6 +257,7 @@ export declare const Card: React_2.ForwardRefExoticComponent<
254
257
  | 'inheritDimensions'
255
258
  | 'id'
256
259
  | 'placeholder'
260
+ | 'onError'
257
261
  | 'onClick'
258
262
  | 'analyticsContext'
259
263
  | 'key'
@@ -298,6 +302,7 @@ export declare interface CardProps extends WithAnalyticsEventsProps {
298
302
  testId?: string;
299
303
  showActions?: boolean;
300
304
  onResolve?: OnResolveCallback;
305
+ onError?: OnErrorCallback;
301
306
  inheritDimensions?: boolean;
302
307
  embedIframeRef?: React.Ref<HTMLIFrameElement>;
303
308
  inlinePreloaderStyle?: InlinePreloaderStyle;
@@ -488,6 +493,13 @@ export declare class EmbedResizeMessageListener extends React_2.Component<
488
493
  render(): React_2.ReactNode;
489
494
  }
490
495
 
496
+ declare type ErrorCardType =
497
+ | 'errored'
498
+ | 'fallback'
499
+ | 'forbidden'
500
+ | 'not_found'
501
+ | 'unauthorized';
502
+
491
503
  declare type FlexibleUiOptions = {
492
504
  /**
493
505
  * Determines whether the entire Smart Link container should be clickable.
@@ -629,6 +641,15 @@ declare type NamedActionItem = BaseActionItem & {
629
641
  name: Exclude<ActionName, ActionName.CustomAction>;
630
642
  };
631
643
 
644
+ export declare type OnActionMenuOpenChangeOptions = {
645
+ isOpen: boolean;
646
+ };
647
+
648
+ declare type OnErrorCallback = (data: {
649
+ status: Extract<CardType, ErrorCardType>;
650
+ url: string;
651
+ }) => void;
652
+
632
653
  declare type OnResolveCallback = (data: {
633
654
  url?: string;
634
655
  title?: string;
@@ -894,6 +915,11 @@ declare type TitleBlockProps = {
894
915
  * @see ElementItem
895
916
  */
896
917
  metadata?: ElementItem[];
918
+ /**
919
+ * Called when the action dropdown menu (if present) is open/closed.
920
+ * Receives an object with `isOpen` state.
921
+ */
922
+ onActionMenuOpenChange?: (options: OnActionMenuOpenChangeOptions) => void;
897
923
  /**
898
924
  * Determines the position of the link icon in relative to the vertical
899
925
  * height of the TitleBlock. It can either be centred or placed on “top”.
@@ -1060,6 +1086,19 @@ export declare const useSmartLinkAnalytics: (
1060
1086
  definitionId?: string | undefined,
1061
1087
  extensionKey?: string | undefined,
1062
1088
  ) => void;
1089
+ /**
1090
+ * This fires an event that represents when a Smart Link renders unsuccessfuly.
1091
+ * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
1092
+ * @param id The unique ID for this Smart Link.
1093
+ * @param error: An error representing why the Smart Link render failed.
1094
+ * @param errorInfo: Additional details about the error including the stack trace.
1095
+ */
1096
+ renderFailedEvent: (
1097
+ display: CardInnerAppearance,
1098
+ id: string | undefined,
1099
+ error: Error,
1100
+ errorInfo: ErrorInfo,
1101
+ ) => void;
1063
1102
  /**
1064
1103
  * This fires an event that represents a hover preview being opened.
1065
1104
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.