@atlaskit/smart-card 46.2.0 → 46.3.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 (26) hide show
  1. package/CHANGELOG.md +20 -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 +4 -2
  4. package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +2 -0
  5. package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +2 -1
  6. package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -1
  7. package/dist/cjs/view/HoverCard/styled.js +2 -0
  8. package/dist/cjs/view/LinkUrl/index.js +1 -1
  9. package/dist/es2019/utils/analytics/analytics.js +1 -1
  10. package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -1
  11. package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +2 -0
  12. package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +2 -1
  13. package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -1
  14. package/dist/es2019/view/HoverCard/styled.js +1 -0
  15. package/dist/es2019/view/LinkUrl/index.js +1 -1
  16. package/dist/esm/utils/analytics/analytics.js +1 -1
  17. package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +4 -2
  18. package/dist/esm/view/FlexibleCard/components/actions/action/index.js +2 -0
  19. package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +2 -1
  20. package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -1
  21. package/dist/esm/view/HoverCard/styled.js +1 -0
  22. package/dist/esm/view/LinkUrl/index.js +1 -1
  23. package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/index.d.ts +1 -1
  24. package/dist/types/view/FlexibleCard/components/actions/action/index.d.ts +1 -1
  25. package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +5 -0
  26. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 46.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`457c77d8f6992`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/457c77d8f6992) -
8
+ Behind `platform-dst-top-layer-tooltip`: tooltips whose content changes on press (for example
9
+ "Copy" to "Copied!") stay open to show the new content. `@atlaskit/editor-common` floating toolbar
10
+ buttons and `@atlaskit/smart-card` stack-item actions add an optional
11
+ `hasNewContentOnTriggerClick` prop.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 46.2.1
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 46.2.0
4
24
 
5
25
  ### Minor Changes
@@ -25,7 +25,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
25
25
  var context = exports.context = {
26
26
  componentName: 'smart-cards',
27
27
  packageName: "@atlaskit/smart-card" || '',
28
- packageVersion: "46.1.14" || ''
28
+ packageVersion: "46.2.1" || ''
29
29
  };
30
30
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
31
31
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -10,12 +10,13 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _Tooltip = _interopRequireDefault(require("@atlaskit/tooltip/Tooltip"));
12
12
  var _actionButton = _interopRequireDefault(require("./action-button"));
13
- var _excluded = ["content", "tooltipMessage", "tooltipOnHide", "hideTooltipOnMouseDown", "hideTooltip"];
13
+ var _excluded = ["content", "tooltipMessage", "tooltipOnHide", "hideTooltipOnMouseDown", "hasNewContentOnTriggerClick", "hideTooltip"];
14
14
  var ActionStackItem = function ActionStackItem(_ref) {
15
15
  var content = _ref.content,
16
16
  tooltipMessage = _ref.tooltipMessage,
17
17
  tooltipOnHide = _ref.tooltipOnHide,
18
18
  hideTooltipOnMouseDown = _ref.hideTooltipOnMouseDown,
19
+ hasNewContentOnTriggerClick = _ref.hasNewContentOnTriggerClick,
19
20
  hideTooltip = _ref.hideTooltip,
20
21
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
21
22
  return hideTooltip ? /*#__PURE__*/_react.default.createElement(_actionButton.default, (0, _extends2.default)({}, props, {
@@ -23,7 +24,8 @@ var ActionStackItem = function ActionStackItem(_ref) {
23
24
  })) : /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
24
25
  content: tooltipMessage || content,
25
26
  onHide: tooltipOnHide,
26
- hideTooltipOnMouseDown: hideTooltipOnMouseDown
27
+ hideTooltipOnMouseDown: hideTooltipOnMouseDown,
28
+ hasNewContentOnTriggerClick: hasNewContentOnTriggerClick
27
29
  }, function (tooltipProps) {
28
30
  return /*#__PURE__*/_react.default.createElement(_actionButton.default, (0, _extends2.default)({}, props, {
29
31
  content: content,
@@ -36,6 +36,7 @@ var Action = function Action(_ref) {
36
36
  tooltipOnHide = _ref.tooltipOnHide,
37
37
  hideTooltip = _ref.hideTooltip,
38
38
  hideTooltipOnMouseDown = _ref.hideTooltipOnMouseDown,
39
+ hasNewContentOnTriggerClick = _ref.hasNewContentOnTriggerClick,
39
40
  style = _ref.style,
40
41
  asDropDownItem = _ref.asDropDownItem,
41
42
  className = _ref.className,
@@ -70,6 +71,7 @@ var Action = function Action(_ref) {
70
71
  style: style,
71
72
  tooltipOnHide: tooltipOnHide,
72
73
  hideTooltipOnMouseDown: hideTooltipOnMouseDown,
74
+ hasNewContentOnTriggerClick: hasNewContentOnTriggerClick,
73
75
  hideTooltip: hideTooltip,
74
76
  ariaLabel: ariaLabel
75
77
  });
@@ -61,6 +61,7 @@ function CopySummaryAction(_ref) {
61
61
  tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, tooltipMessage),
62
62
  tooltipOnHide: function tooltipOnHide() {
63
63
  return setTooltipMessage(_messages.messages.copy_summary_action_description);
64
- }
64
+ },
65
+ hasNewContentOnTriggerClick: true
65
66
  }, props));
66
67
  }
@@ -78,7 +78,8 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
78
78
  tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, tooltipMessage),
79
79
  tooltipOnHide: function tooltipOnHide() {
80
80
  return setTooltipMessage(_messages.messages.copy_url_to_clipboard);
81
- }
81
+ },
82
+ hasNewContentOnTriggerClick: true
82
83
  }, data, props)) : null;
83
84
  };
84
85
  var _default = exports.default = CopyLinkAction;
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.flexibleUiOptions = exports.HOVER_CARD_Z_INDEX = exports.CARD_WIDTH_REM = exports.CARD_GAP_PX = void 0;
7
7
  var _constants = require("@atlaskit/theme/constants");
8
8
  var _constants2 = require("../../constants");
9
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-atlaskit-theme
10
+
9
11
  // Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
10
12
  var HOVER_CARD_Z_INDEX = exports.HOVER_CARD_Z_INDEX = _constants.layers.modal();
11
13
  var flexibleUiOptions = exports.flexibleUiOptions = {
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
19
19
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
20
20
  var PACKAGE_DATA = {
21
21
  packageName: "@atlaskit/smart-card",
22
- packageVersion: "46.1.14",
22
+ packageVersion: "46.2.1",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -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: "46.1.14" || ''
7
+ packageVersion: "46.2.1" || ''
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -7,6 +7,7 @@ const ActionStackItem = ({
7
7
  tooltipMessage,
8
8
  tooltipOnHide,
9
9
  hideTooltipOnMouseDown,
10
+ hasNewContentOnTriggerClick,
10
11
  hideTooltip,
11
12
  ...props
12
13
  }) => {
@@ -15,7 +16,8 @@ const ActionStackItem = ({
15
16
  })) : /*#__PURE__*/React.createElement(Tooltip, {
16
17
  content: tooltipMessage || content,
17
18
  onHide: tooltipOnHide,
18
- hideTooltipOnMouseDown: hideTooltipOnMouseDown
19
+ hideTooltipOnMouseDown: hideTooltipOnMouseDown,
20
+ hasNewContentOnTriggerClick: hasNewContentOnTriggerClick
19
21
  }, tooltipProps => /*#__PURE__*/React.createElement(ActionButton, _extends({}, props, {
20
22
  content: content,
21
23
  tooltipProps: tooltipProps
@@ -24,6 +24,7 @@ const Action = ({
24
24
  tooltipOnHide,
25
25
  hideTooltip,
26
26
  hideTooltipOnMouseDown,
27
+ hasNewContentOnTriggerClick,
27
28
  style,
28
29
  asDropDownItem,
29
30
  className,
@@ -59,6 +60,7 @@ const Action = ({
59
60
  style: style,
60
61
  tooltipOnHide: tooltipOnHide,
61
62
  hideTooltipOnMouseDown: hideTooltipOnMouseDown,
63
+ hasNewContentOnTriggerClick: hasNewContentOnTriggerClick,
62
64
  hideTooltip: hideTooltip,
63
65
  ariaLabel: ariaLabel
64
66
  });
@@ -33,6 +33,7 @@ export function CopySummaryAction({
33
33
  onClick: handleCopySummaryClick,
34
34
  testId: `${testId}-copy-summary-action`,
35
35
  tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
36
- tooltipOnHide: () => setTooltipMessage(messages.copy_summary_action_description)
36
+ tooltipOnHide: () => setTooltipMessage(messages.copy_summary_action_description),
37
+ hasNewContentOnTriggerClick: true
37
38
  }, props));
38
39
  }
@@ -42,7 +42,8 @@ const CopyLinkAction = ({
42
42
  onClick: onClick,
43
43
  testId: "smart-action-copy-link-action",
44
44
  tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
45
- tooltipOnHide: () => setTooltipMessage(messages.copy_url_to_clipboard)
45
+ tooltipOnHide: () => setTooltipMessage(messages.copy_url_to_clipboard),
46
+ hasNewContentOnTriggerClick: true
46
47
  }, data, props)) : null;
47
48
  };
48
49
  export default CopyLinkAction;
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-atlaskit-theme
1
2
  import { layers } from '@atlaskit/theme/constants';
2
3
  import { SmartLinkSize } from '../../constants';
3
4
  // Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "46.1.14",
12
+ packageVersion: "46.2.1",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card" || '',
7
- packageVersion: "46.1.14" || ''
7
+ packageVersion: "46.2.1" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["content", "tooltipMessage", "tooltipOnHide", "hideTooltipOnMouseDown", "hideTooltip"];
3
+ var _excluded = ["content", "tooltipMessage", "tooltipOnHide", "hideTooltipOnMouseDown", "hasNewContentOnTriggerClick", "hideTooltip"];
4
4
  import React from 'react';
5
5
  import Tooltip from '@atlaskit/tooltip/Tooltip';
6
6
  import ActionButton from './action-button';
@@ -9,6 +9,7 @@ var ActionStackItem = function ActionStackItem(_ref) {
9
9
  tooltipMessage = _ref.tooltipMessage,
10
10
  tooltipOnHide = _ref.tooltipOnHide,
11
11
  hideTooltipOnMouseDown = _ref.hideTooltipOnMouseDown,
12
+ hasNewContentOnTriggerClick = _ref.hasNewContentOnTriggerClick,
12
13
  hideTooltip = _ref.hideTooltip,
13
14
  props = _objectWithoutProperties(_ref, _excluded);
14
15
  return hideTooltip ? /*#__PURE__*/React.createElement(ActionButton, _extends({}, props, {
@@ -16,7 +17,8 @@ var ActionStackItem = function ActionStackItem(_ref) {
16
17
  })) : /*#__PURE__*/React.createElement(Tooltip, {
17
18
  content: tooltipMessage || content,
18
19
  onHide: tooltipOnHide,
19
- hideTooltipOnMouseDown: hideTooltipOnMouseDown
20
+ hideTooltipOnMouseDown: hideTooltipOnMouseDown,
21
+ hasNewContentOnTriggerClick: hasNewContentOnTriggerClick
20
22
  }, function (tooltipProps) {
21
23
  return /*#__PURE__*/React.createElement(ActionButton, _extends({}, props, {
22
24
  content: content,
@@ -29,6 +29,7 @@ var Action = function Action(_ref) {
29
29
  tooltipOnHide = _ref.tooltipOnHide,
30
30
  hideTooltip = _ref.hideTooltip,
31
31
  hideTooltipOnMouseDown = _ref.hideTooltipOnMouseDown,
32
+ hasNewContentOnTriggerClick = _ref.hasNewContentOnTriggerClick,
32
33
  style = _ref.style,
33
34
  asDropDownItem = _ref.asDropDownItem,
34
35
  className = _ref.className,
@@ -63,6 +64,7 @@ var Action = function Action(_ref) {
63
64
  style: style,
64
65
  tooltipOnHide: tooltipOnHide,
65
66
  hideTooltipOnMouseDown: hideTooltipOnMouseDown,
67
+ hasNewContentOnTriggerClick: hasNewContentOnTriggerClick,
66
68
  hideTooltip: hideTooltip,
67
69
  ariaLabel: ariaLabel
68
70
  });
@@ -52,6 +52,7 @@ export function CopySummaryAction(_ref) {
52
52
  tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
53
53
  tooltipOnHide: function tooltipOnHide() {
54
54
  return setTooltipMessage(messages.copy_summary_action_description);
55
- }
55
+ },
56
+ hasNewContentOnTriggerClick: true
56
57
  }, props));
57
58
  }
@@ -69,7 +69,8 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
69
69
  tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
70
70
  tooltipOnHide: function tooltipOnHide() {
71
71
  return setTooltipMessage(messages.copy_url_to_clipboard);
72
- }
72
+ },
73
+ hasNewContentOnTriggerClick: true
73
74
  }, data, props)) : null;
74
75
  };
75
76
  export default CopyLinkAction;
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-atlaskit-theme
1
2
  import { layers } from '@atlaskit/theme/constants';
2
3
  import { SmartLinkSize } from '../../constants';
3
4
  // Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  var PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "46.1.14",
15
+ packageVersion: "46.2.1",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { ActionStackItemProps } from './types';
3
- declare const ActionStackItem: ({ content, tooltipMessage, tooltipOnHide, hideTooltipOnMouseDown, hideTooltip, ...props }: ActionStackItemProps) => React.JSX.Element;
3
+ declare const ActionStackItem: ({ content, tooltipMessage, tooltipOnHide, hideTooltipOnMouseDown, hasNewContentOnTriggerClick, hideTooltip, ...props }: ActionStackItemProps) => React.JSX.Element;
4
4
  export default ActionStackItem;
@@ -5,5 +5,5 @@ import { type ActionProps } from './types';
5
5
  * @internal
6
6
  * @param {ActionProps} ActionProps - The props necessary for the Action.
7
7
  */
8
- declare const Action: ({ as, appearance, content, isLoading, onClick, size, testId, icon, iconPosition, spaceInline, tooltipMessage, tooltipOnHide, hideTooltip, hideTooltipOnMouseDown, style, asDropDownItem, className, isDisabled, href, ariaLabel, wrapper: Wrapper, }: ActionProps) => React.JSX.Element | null;
8
+ declare const Action: ({ as, appearance, content, isLoading, onClick, size, testId, icon, iconPosition, spaceInline, tooltipMessage, tooltipOnHide, hideTooltip, hideTooltipOnMouseDown, hasNewContentOnTriggerClick, style, asDropDownItem, className, isDisabled, href, ariaLabel, wrapper: Wrapper, }: ActionProps) => React.JSX.Element | null;
9
9
  export default Action;
@@ -81,6 +81,11 @@ export type ActionProps = {
81
81
  */
82
82
  onError?: (error: ActionMessage) => void;
83
83
  onLoadingChange?: (isLoading: boolean) => void;
84
+ /**
85
+ * Keeps the tooltip open when the action is pressed. Set it when a press changes
86
+ * `tooltipMessage`. Only used when `as` is `stack-item`.
87
+ */
88
+ hasNewContentOnTriggerClick?: boolean;
84
89
  /**
85
90
  * Determines the size of the Action. Corresponds to an Action appearance.
86
91
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "46.2.0",
3
+ "version": "46.3.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/button": "^25.4.0",
51
51
  "@atlaskit/checkbox": "^19.2.0",
52
52
  "@atlaskit/css": "^1.1.0",
53
- "@atlaskit/dropdown-menu": "^20.0.0",
53
+ "@atlaskit/dropdown-menu": "^21.0.0",
54
54
  "@atlaskit/embedded-confluence": "^6.4.0",
55
55
  "@atlaskit/feature-gate-js-client": "^7.0.0",
56
56
  "@atlaskit/flag": "^19.0.0",
@@ -79,11 +79,11 @@
79
79
  "@atlaskit/platform-feature-experiments": "^0.3.0",
80
80
  "@atlaskit/platform-feature-flags": "^2.2.0",
81
81
  "@atlaskit/platform-feature-flags-react": "^1.2.0",
82
- "@atlaskit/popup": "^8.1.0",
82
+ "@atlaskit/popup": "^9.0.0",
83
83
  "@atlaskit/primitives": "^22.5.0",
84
84
  "@atlaskit/react-compiler-gating": "^0.2.0",
85
85
  "@atlaskit/react-ufo": "^8.0.0",
86
- "@atlaskit/rovo-triggers": "^11.7.0",
86
+ "@atlaskit/rovo-triggers": "^11.8.0",
87
87
  "@atlaskit/section-message": "^10.2.0",
88
88
  "@atlaskit/select": "^23.1.0",
89
89
  "@atlaskit/spinner": "^20.4.0",
@@ -93,9 +93,9 @@
93
93
  "@atlaskit/textfield": "^10.2.0",
94
94
  "@atlaskit/theme": "^28.2.0",
95
95
  "@atlaskit/tile": "^5.0.0",
96
- "@atlaskit/tmp-editor-statsig": "^218.0.0",
96
+ "@atlaskit/tmp-editor-statsig": "^219.0.0",
97
97
  "@atlaskit/tokens": "^20.1.0",
98
- "@atlaskit/tooltip": "^24.3.0",
98
+ "@atlaskit/tooltip": "^24.4.0",
99
99
  "@atlaskit/ufo": "^2.0.0",
100
100
  "@atlaskit/width-detector": "^7.2.0",
101
101
  "@babel/runtime": "^7.0.0",