@atlaskit/smart-card 29.0.2 → 29.0.3

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 29.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 29.0.2
4
10
 
5
11
  ### Patch Changes
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
22
22
  var context = exports.context = {
23
23
  componentName: 'smart-cards',
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "29.0.2"
25
+ packageVersion: "29.0.3"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
17
17
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
18
18
  var PACKAGE_DATA = {
19
19
  packageName: "@atlaskit/smart-card",
20
- packageVersion: "29.0.2",
20
+ packageVersion: "29.0.3",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "29.0.2"
7
+ packageVersion: "29.0.3"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
7
7
  import LinkWarningModal from './LinkWarningModal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "29.0.2",
10
+ packageVersion: "29.0.3",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
15
15
  export var context = {
16
16
  componentName: 'smart-cards',
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "29.0.2"
18
+ packageVersion: "29.0.3"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
10
10
  import LinkWarningModal from './LinkWarningModal';
11
11
  var PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "29.0.2",
13
+ packageVersion: "29.0.3",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -31,6 +31,12 @@ export type CardActionOptions = {
31
31
  exclude?: Array<CardAction>;
32
32
  };
33
33
  interface ActionProps {
34
+ /**
35
+ * Configure visibility of actions available.
36
+ * By default, smart links show all actions available on the views.
37
+ * Set `hide` to true to disable all actions.
38
+ * Set `hide` to false and set `exclude` to enable only specific actions.
39
+ */
34
40
  actionOptions?: CardActionOptions;
35
41
  }
36
42
  interface HoverPreviewProps extends ActionProps {
@@ -39,18 +45,34 @@ interface HoverPreviewProps extends ActionProps {
39
45
  showAuthTooltip?: boolean;
40
46
  }
41
47
  export interface BaseCardProps {
48
+ /**
49
+ * Define smart card default appearance.
50
+ */
42
51
  appearance: CardAppearance;
52
+ /**
53
+ * The container which `react-lazily-render` listens to for scroll events.
54
+ * This property can be used in a scenario where you want to specify your own scroll container
55
+ * while the Card component is (lazy)loading.
56
+ */
43
57
  container?: HTMLElement;
44
58
  /**
45
- * A component that will be rendered when smart card fails to render
46
- * because of uncaught errors
59
+ * A React component responsible for returning a fallback UI when smart link fails to render because of uncaught errors.
47
60
  */
48
61
  fallbackComponent?: React.ComponentType;
62
+ /**
63
+ * Unique id for smart link used in analytics.
64
+ */
49
65
  id?: string;
66
+ /**
67
+ * Show selected state of smart link.
68
+ */
50
69
  isSelected?: boolean;
70
+ /**
71
+ * A callback function after a link is clicked.
72
+ */
51
73
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
52
74
  /**
53
- * A callback function currently invoked in two cases
75
+ * A callback function currently invoked in two cases:
54
76
  * 1. When the {@link CardState.status} is one of {@link ErrorCardType}. "err" property in argument will be undefined in this case
55
77
  * This does not mean that smart card failed to render.
56
78
  * 2. When there is any unhandled error inside smart card while rendering, resulting in failure to render smart card succesfully.
@@ -60,9 +82,23 @@ export interface BaseCardProps {
60
82
  * If fallbackComponent is not provided, smart card will render null
61
83
  */
62
84
  onError?: OnErrorCallback;
85
+ /**
86
+ * A callback function after the url is resolved into smart card.
87
+ */
63
88
  onResolve?: OnResolveCallback;
89
+ /**
90
+ * String to be displayed while the Card component is (lazy)loading.
91
+ */
64
92
  placeholder?: string;
93
+ /**
94
+ * A `testId` prop is provided for specified elements, which is a unique
95
+ * string that appears as a data attribute `data-testid` in the rendered code,
96
+ * serving as a hook for automated tests.
97
+ */
65
98
  testId?: string;
99
+ /**
100
+ * The url link of the resource to be resolved and shown as Smart Link.
101
+ */
66
102
  url?: string;
67
103
  }
68
104
  export interface InlineProps extends HoverPreviewProps {
@@ -85,22 +121,42 @@ export interface InlineProps extends HoverPreviewProps {
85
121
  }
86
122
  export interface BlockProps extends ActionProps {
87
123
  /**
88
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15021 Internal documentation for deprecation (no external access)}
89
124
  * When enabled the legacy block card is always used, even if the enableFlexibleBlockCard flag is set to true.
90
125
  * Usage is strongly discouraged. This should only be used if there is a specific reason you're
91
126
  * unable to use the new flexible block cards.
127
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15021 Internal documentation for deprecation (no external access)}
92
128
  */
93
129
  useLegacyBlockCard?: boolean;
94
130
  }
95
131
  export interface EmbedProps {
132
+ /**
133
+ * React referenced value on embed iframe.
134
+ */
96
135
  embedIframeRef?: React.Ref<HTMLIFrameElement>;
136
+ /**
137
+ * Type of URL used with embed iframe. By default, the embed use `data.preview.href` from link response.
138
+ * `interactiveHref` is suitable for displaying iframe content that contains "more editable" version of
139
+ * the link, e.g. includes toolbar.
140
+ * It is only available on supported link response with `data.preview.interactiveHref`.
141
+ */
97
142
  embedIframeUrlType?: EmbedIframeUrlType;
98
- /** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
143
+ /**
144
+ * A prop that determines the style of a frame:
145
+ * whether to show it, hide it or only show it when a user hovers over embed.
146
+ */
99
147
  frameStyle?: FrameStyle;
100
- /** This props determines if dimensions of an embed card are to be inherited from the parent.
101
- * The parent container needs to override a style '.loader-wrapper' and set the desirable height there. (for instance, 'height: 100%')
148
+ /**
149
+ * Determines whether width and height of an embed card are to be inherited from the parent.
150
+ * If `true`, embed iframe will remove restrictions on iframe aspect ratio, height and width.
151
+ * The parent container needs to override a style `.loader-wrapper` and set the desirable height there.
152
+ * (For instance, 'height: 100%')
102
153
  */
103
154
  inheritDimensions?: boolean;
155
+ /**
156
+ * Informs Smart Link of the device it is rendered in. Available values are `web` and `mobile`.
157
+ * It is used together with link response `data.preview['atlassian:supportedPlatforms']`.
158
+ * To make embed content available on all supported urls, use `web`.
159
+ */
104
160
  platform?: CardPlatform;
105
161
  }
106
162
  export interface FlexibleProps extends ActionProps, HoverPreviewProps {
@@ -31,6 +31,12 @@ export type CardActionOptions = {
31
31
  exclude?: Array<CardAction>;
32
32
  };
33
33
  interface ActionProps {
34
+ /**
35
+ * Configure visibility of actions available.
36
+ * By default, smart links show all actions available on the views.
37
+ * Set `hide` to true to disable all actions.
38
+ * Set `hide` to false and set `exclude` to enable only specific actions.
39
+ */
34
40
  actionOptions?: CardActionOptions;
35
41
  }
36
42
  interface HoverPreviewProps extends ActionProps {
@@ -39,18 +45,34 @@ interface HoverPreviewProps extends ActionProps {
39
45
  showAuthTooltip?: boolean;
40
46
  }
41
47
  export interface BaseCardProps {
48
+ /**
49
+ * Define smart card default appearance.
50
+ */
42
51
  appearance: CardAppearance;
52
+ /**
53
+ * The container which `react-lazily-render` listens to for scroll events.
54
+ * This property can be used in a scenario where you want to specify your own scroll container
55
+ * while the Card component is (lazy)loading.
56
+ */
43
57
  container?: HTMLElement;
44
58
  /**
45
- * A component that will be rendered when smart card fails to render
46
- * because of uncaught errors
59
+ * A React component responsible for returning a fallback UI when smart link fails to render because of uncaught errors.
47
60
  */
48
61
  fallbackComponent?: React.ComponentType;
62
+ /**
63
+ * Unique id for smart link used in analytics.
64
+ */
49
65
  id?: string;
66
+ /**
67
+ * Show selected state of smart link.
68
+ */
50
69
  isSelected?: boolean;
70
+ /**
71
+ * A callback function after a link is clicked.
72
+ */
51
73
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
52
74
  /**
53
- * A callback function currently invoked in two cases
75
+ * A callback function currently invoked in two cases:
54
76
  * 1. When the {@link CardState.status} is one of {@link ErrorCardType}. "err" property in argument will be undefined in this case
55
77
  * This does not mean that smart card failed to render.
56
78
  * 2. When there is any unhandled error inside smart card while rendering, resulting in failure to render smart card succesfully.
@@ -60,9 +82,23 @@ export interface BaseCardProps {
60
82
  * If fallbackComponent is not provided, smart card will render null
61
83
  */
62
84
  onError?: OnErrorCallback;
85
+ /**
86
+ * A callback function after the url is resolved into smart card.
87
+ */
63
88
  onResolve?: OnResolveCallback;
89
+ /**
90
+ * String to be displayed while the Card component is (lazy)loading.
91
+ */
64
92
  placeholder?: string;
93
+ /**
94
+ * A `testId` prop is provided for specified elements, which is a unique
95
+ * string that appears as a data attribute `data-testid` in the rendered code,
96
+ * serving as a hook for automated tests.
97
+ */
65
98
  testId?: string;
99
+ /**
100
+ * The url link of the resource to be resolved and shown as Smart Link.
101
+ */
66
102
  url?: string;
67
103
  }
68
104
  export interface InlineProps extends HoverPreviewProps {
@@ -85,22 +121,42 @@ export interface InlineProps extends HoverPreviewProps {
85
121
  }
86
122
  export interface BlockProps extends ActionProps {
87
123
  /**
88
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15021 Internal documentation for deprecation (no external access)}
89
124
  * When enabled the legacy block card is always used, even if the enableFlexibleBlockCard flag is set to true.
90
125
  * Usage is strongly discouraged. This should only be used if there is a specific reason you're
91
126
  * unable to use the new flexible block cards.
127
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15021 Internal documentation for deprecation (no external access)}
92
128
  */
93
129
  useLegacyBlockCard?: boolean;
94
130
  }
95
131
  export interface EmbedProps {
132
+ /**
133
+ * React referenced value on embed iframe.
134
+ */
96
135
  embedIframeRef?: React.Ref<HTMLIFrameElement>;
136
+ /**
137
+ * Type of URL used with embed iframe. By default, the embed use `data.preview.href` from link response.
138
+ * `interactiveHref` is suitable for displaying iframe content that contains "more editable" version of
139
+ * the link, e.g. includes toolbar.
140
+ * It is only available on supported link response with `data.preview.interactiveHref`.
141
+ */
97
142
  embedIframeUrlType?: EmbedIframeUrlType;
98
- /** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
143
+ /**
144
+ * A prop that determines the style of a frame:
145
+ * whether to show it, hide it or only show it when a user hovers over embed.
146
+ */
99
147
  frameStyle?: FrameStyle;
100
- /** This props determines if dimensions of an embed card are to be inherited from the parent.
101
- * The parent container needs to override a style '.loader-wrapper' and set the desirable height there. (for instance, 'height: 100%')
148
+ /**
149
+ * Determines whether width and height of an embed card are to be inherited from the parent.
150
+ * If `true`, embed iframe will remove restrictions on iframe aspect ratio, height and width.
151
+ * The parent container needs to override a style `.loader-wrapper` and set the desirable height there.
152
+ * (For instance, 'height: 100%')
102
153
  */
103
154
  inheritDimensions?: boolean;
155
+ /**
156
+ * Informs Smart Link of the device it is rendered in. Available values are `web` and `mobile`.
157
+ * It is used together with link response `data.preview['atlassian:supportedPlatforms']`.
158
+ * To make embed content available on all supported urls, use `web`.
159
+ */
104
160
  platform?: CardPlatform;
105
161
  }
106
162
  export interface FlexibleProps extends ActionProps, HoverPreviewProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "29.0.2",
3
+ "version": "29.0.3",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/popup": "^1.28.0",
55
55
  "@atlaskit/primitives": "^12.2.0",
56
56
  "@atlaskit/section-message": "^6.6.0",
57
- "@atlaskit/select": "^17.19.0",
57
+ "@atlaskit/select": "^18.0.0",
58
58
  "@atlaskit/spinner": "^16.3.0",
59
59
  "@atlaskit/textarea": "^5.6.0",
60
60
  "@atlaskit/textfield": "^6.5.0",
@@ -89,6 +89,7 @@
89
89
  "@af/visual-regression": "*",
90
90
  "@atlaskit/analytics-listeners": "^8.11.0",
91
91
  "@atlaskit/css-reset": "^6.11.0",
92
+ "@atlaskit/link": "^1.2.1",
92
93
  "@atlaskit/link-test-helpers": "^7.5.0",
93
94
  "@atlaskit/media-test-helpers": "^34.4.0",
94
95
  "@atlaskit/ssr": "*",