@atlaskit/smart-card 26.56.0 → 26.56.1

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 (23) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -3
  4. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +1 -1
  5. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +2 -1
  6. package/dist/cjs/view/LinkUrl/index.js +1 -1
  7. package/dist/es2019/utils/analytics/analytics.js +1 -1
  8. package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -3
  9. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +2 -2
  10. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +2 -1
  11. package/dist/es2019/view/LinkUrl/index.js +1 -1
  12. package/dist/esm/utils/analytics/analytics.js +1 -1
  13. package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -3
  14. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +2 -2
  15. package/dist/esm/view/HoverCard/components/views/resolved/index.js +2 -1
  16. package/dist/esm/view/LinkUrl/index.js +1 -1
  17. package/dist/types/view/FlexibleCard/components/blocks/action-block/types.d.ts +1 -1
  18. package/dist/types/view/HoverCard/components/views/resolved/types.d.ts +2 -1
  19. package/dist/types/view/HoverCard/types.d.ts +2 -1
  20. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/types.d.ts +1 -1
  21. package/dist/types-ts4.5/view/HoverCard/components/views/resolved/types.d.ts +2 -1
  22. package/dist/types-ts4.5/view/HoverCard/types.d.ts +2 -1
  23. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.56.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#91413](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91413) [`4aac6aa61313`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4aac6aa61313) - Hide HoverCard when clicking on PreviewAction from ActionBlock
8
+ - Updated dependencies
9
+
3
10
  ## 26.56.0
4
11
 
5
12
  ### Minor 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: "26.56.0"
25
+ packageVersion: "26.56.1"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -82,12 +82,12 @@ var ActionStackItem = function ActionStackItem(_ref) {
82
82
  as: "button",
83
83
  xcss: [buttonStyles, xcss]
84
84
  }, tooltipProps, {
85
- onClick: onClick
85
+ onClick: onClick,
86
+ testId: testId
86
87
  }), /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
87
88
  alignBlock: "center",
88
89
  grow: "fill",
89
- space: space,
90
- testId: testId
90
+ space: space
91
91
  }, icon, /*#__PURE__*/_react.default.createElement(_primitives.Box, {
92
92
  xcss: contentStyles
93
93
  }, content)));
@@ -176,7 +176,7 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
176
176
  }) : linkActions;
177
177
  }, [hidePreviewButton, linkActions]);
178
178
  var onActionClick = (0, _react2.useCallback)(function (actionId) {
179
- if (actionId === 'preview-content') {
179
+ if (actionId === 'preview-content' || actionId === _constants.ActionName.PreviewAction) {
180
180
  hideCard();
181
181
  }
182
182
  }, [hideCard]);
@@ -195,7 +195,8 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref2) {
195
195
  size: _constants.SmartLinkSize.Large,
196
196
  overrideCss: _styled.footerBlockCss
197
197
  }), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-action-redesign') && /*#__PURE__*/_react.default.createElement(_blocks.ActionBlock, {
198
- spaceInline: "space.150"
198
+ spaceInline: "space.150",
199
+ onClick: onActionClick
199
200
  }));
200
201
  };
201
202
  var _default = exports.default = HoverCardResolvedView;
@@ -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: "26.56.0",
20
+ packageVersion: "26.56.1",
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: "26.56.0"
7
+ packageVersion: "26.56.1"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -72,12 +72,12 @@ const ActionStackItem = ({
72
72
  as: "button",
73
73
  xcss: [buttonStyles, xcss]
74
74
  }, tooltipProps, {
75
- onClick: onClick
75
+ onClick: onClick,
76
+ testId: testId
76
77
  }), /*#__PURE__*/React.createElement(Inline, {
77
78
  alignBlock: "center",
78
79
  grow: "fill",
79
- space: space,
80
- testId: testId
80
+ space: space
81
81
  }, icon, /*#__PURE__*/React.createElement(Box, {
82
82
  xcss: contentStyles
83
83
  }, content))));
@@ -9,7 +9,7 @@ import { useSmartCardState as useLinkState } from '../../../state/store';
9
9
  import HoverCardContent from '../components/HoverCardContent';
10
10
  import CustomPopupContainer from '../components/CustomPopupContainer';
11
11
  import { CARD_GAP_PX, HOVER_CARD_Z_INDEX } from '../styled';
12
- import { CardDisplay } from '../../../constants';
12
+ import { ActionName, CardDisplay } from '../../../constants';
13
13
  import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
14
14
  import { combineActionOptions } from '../../../utils/actions/combine-action-options';
15
15
  import { useSmartCardActions } from '../../../state/actions';
@@ -153,7 +153,7 @@ export const HoverCardComponent = ({
153
153
  return hidePreviewButton ? linkActions.filter(action => action.id !== 'preview-content') : linkActions;
154
154
  }, [hidePreviewButton, linkActions]);
155
155
  const onActionClick = useCallback(actionId => {
156
- if (actionId === 'preview-content') {
156
+ if (actionId === 'preview-content' || actionId === ActionName.PreviewAction) {
157
157
  hideCard();
158
158
  }
159
159
  }, [hideCard]);
@@ -188,7 +188,8 @@ const HoverCardResolvedView = ({
188
188
  size: SmartLinkSize.Large,
189
189
  overrideCss: footerBlockCss
190
190
  }), getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') && /*#__PURE__*/React.createElement(ActionBlock, {
191
- spaceInline: "space.150"
191
+ spaceInline: "space.150",
192
+ onClick: onActionClick
192
193
  }));
193
194
  };
194
195
  export default HoverCardResolvedView;
@@ -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: "26.56.0",
10
+ packageVersion: "26.56.1",
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: "26.56.0"
18
+ packageVersion: "26.56.1"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -72,12 +72,12 @@ var ActionStackItem = function ActionStackItem(_ref) {
72
72
  as: "button",
73
73
  xcss: [buttonStyles, xcss]
74
74
  }, tooltipProps, {
75
- onClick: onClick
75
+ onClick: onClick,
76
+ testId: testId
76
77
  }), /*#__PURE__*/React.createElement(Inline, {
77
78
  alignBlock: "center",
78
79
  grow: "fill",
79
- space: space,
80
- testId: testId
80
+ space: space
81
81
  }, icon, /*#__PURE__*/React.createElement(Box, {
82
82
  xcss: contentStyles
83
83
  }, content)));
@@ -10,7 +10,7 @@ import { useSmartCardState as useLinkState } from '../../../state/store';
10
10
  import HoverCardContent from '../components/HoverCardContent';
11
11
  import CustomPopupContainer from '../components/CustomPopupContainer';
12
12
  import { CARD_GAP_PX, HOVER_CARD_Z_INDEX } from '../styled';
13
- import { CardDisplay } from '../../../constants';
13
+ import { ActionName, CardDisplay } from '../../../constants';
14
14
  import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
15
15
  import { combineActionOptions } from '../../../utils/actions/combine-action-options';
16
16
  import { useSmartCardActions } from '../../../state/actions';
@@ -165,7 +165,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
165
165
  }) : linkActions;
166
166
  }, [hidePreviewButton, linkActions]);
167
167
  var onActionClick = useCallback(function (actionId) {
168
- if (actionId === 'preview-content') {
168
+ if (actionId === 'preview-content' || actionId === ActionName.PreviewAction) {
169
169
  hideCard();
170
170
  }
171
171
  }, [hideCard]);
@@ -186,7 +186,8 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref2) {
186
186
  size: SmartLinkSize.Large,
187
187
  overrideCss: footerBlockCss
188
188
  }), getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') && /*#__PURE__*/React.createElement(ActionBlock, {
189
- spaceInline: "space.150"
189
+ spaceInline: "space.150",
190
+ onClick: onActionClick
190
191
  }));
191
192
  };
192
193
  export default HoverCardResolvedView;
@@ -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: "26.56.0",
13
+ packageVersion: "26.56.1",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -5,7 +5,7 @@ export type ActionBlockProps = {
5
5
  /**
6
6
  * Callback once action is executed.
7
7
  */
8
- onClick?: (name: ActionName) => {};
8
+ onClick?: (name: ActionName) => void;
9
9
  /**
10
10
  * Array.Sort function to order the actions
11
11
  */
@@ -2,6 +2,7 @@ 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 type { ActionName } from '../../../../../constants';
5
6
  export type HoverCardResolvedProps = {
6
7
  extensionKey?: string;
7
8
  id?: string;
@@ -10,5 +11,5 @@ export type HoverCardResolvedProps = {
10
11
  cardActions?: LinkAction[];
11
12
  cardState: CardState;
12
13
  isAISummaryEnabled?: boolean;
13
- onActionClick: (actionId: string) => void;
14
+ onActionClick: (actionId: string | ActionName) => void;
14
15
  } & HoverCardLoadingViewProps;
@@ -8,6 +8,7 @@ import { CardProviderRenderers } from '@atlaskit/link-provider';
8
8
  import { MouseEventHandler, ReactElement } from 'react';
9
9
  import { JsonLd } from 'json-ld-types';
10
10
  import type { CardActionOptions } from '../Card/types';
11
+ import type { ActionName } from '../../constants';
11
12
  export interface HoverCardProps extends WithAnalyticsEventsProps {
12
13
  /**
13
14
  * Unique ID for a hover card. Used for analytics.
@@ -92,7 +93,7 @@ export type HoverCardContentProps = {
92
93
  cardActions?: LinkAction[];
93
94
  cardState: CardState;
94
95
  renderers?: CardProviderRenderers;
95
- onActionClick: (actionId: string) => void;
96
+ onActionClick: (actionId: string | ActionName) => void;
96
97
  onResolve: () => void;
97
98
  url: string;
98
99
  onMouseEnter?: MouseEventHandler;
@@ -5,7 +5,7 @@ export type ActionBlockProps = {
5
5
  /**
6
6
  * Callback once action is executed.
7
7
  */
8
- onClick?: (name: ActionName) => {};
8
+ onClick?: (name: ActionName) => void;
9
9
  /**
10
10
  * Array.Sort function to order the actions
11
11
  */
@@ -2,6 +2,7 @@ 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 type { ActionName } from '../../../../../constants';
5
6
  export type HoverCardResolvedProps = {
6
7
  extensionKey?: string;
7
8
  id?: string;
@@ -10,5 +11,5 @@ export type HoverCardResolvedProps = {
10
11
  cardActions?: LinkAction[];
11
12
  cardState: CardState;
12
13
  isAISummaryEnabled?: boolean;
13
- onActionClick: (actionId: string) => void;
14
+ onActionClick: (actionId: string | ActionName) => void;
14
15
  } & HoverCardLoadingViewProps;
@@ -8,6 +8,7 @@ import { CardProviderRenderers } from '@atlaskit/link-provider';
8
8
  import { MouseEventHandler, ReactElement } from 'react';
9
9
  import { JsonLd } from 'json-ld-types';
10
10
  import type { CardActionOptions } from '../Card/types';
11
+ import type { ActionName } from '../../constants';
11
12
  export interface HoverCardProps extends WithAnalyticsEventsProps {
12
13
  /**
13
14
  * Unique ID for a hover card. Used for analytics.
@@ -92,7 +93,7 @@ export type HoverCardContentProps = {
92
93
  cardActions?: LinkAction[];
93
94
  cardState: CardState;
94
95
  renderers?: CardProviderRenderers;
95
- onActionClick: (actionId: string) => void;
96
+ onActionClick: (actionId: string | ActionName) => void;
96
97
  onResolve: () => void;
97
98
  url: string;
98
99
  onMouseEnter?: MouseEventHandler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.56.0",
3
+ "version": "26.56.1",
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": "^16.0.0",
36
36
  "@atlaskit/button": "^17.12.0",
37
- "@atlaskit/dropdown-menu": "^12.8.0",
37
+ "@atlaskit/dropdown-menu": "^12.9.0",
38
38
  "@atlaskit/frontend-utilities": "^2.7.0",
39
39
  "@atlaskit/icon": "^22.1.0",
40
40
  "@atlaskit/icon-file-type": "^6.4.0",