@atlaskit/smart-card 27.4.4 → 27.5.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 (38) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/analytics.spec.yaml +6 -0
  3. package/dist/cjs/common/analytics/generated/use-analytics-events.js +1 -1
  4. package/dist/cjs/extractors/flexible/actions/extract-automation-action.js +1 -1
  5. package/dist/cjs/utils/analytics/analytics.js +1 -1
  6. package/dist/cjs/utils/index.js +3 -11
  7. package/dist/cjs/view/EmbedCard/views/ResolvedView.js +1 -2
  8. package/dist/cjs/view/EmbedModal/index.js +1 -2
  9. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +5 -1
  10. package/dist/cjs/view/LinkUrl/index.js +1 -1
  11. package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +13 -6
  12. package/dist/es2019/common/analytics/generated/use-analytics-events.js +1 -1
  13. package/dist/es2019/extractors/flexible/actions/extract-automation-action.js +1 -1
  14. package/dist/es2019/utils/analytics/analytics.js +1 -1
  15. package/dist/es2019/utils/index.js +3 -11
  16. package/dist/es2019/view/EmbedCard/views/ResolvedView.js +1 -2
  17. package/dist/es2019/view/EmbedModal/index.js +1 -2
  18. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +6 -1
  19. package/dist/es2019/view/LinkUrl/index.js +1 -1
  20. package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +8 -1
  21. package/dist/esm/common/analytics/generated/use-analytics-events.js +1 -1
  22. package/dist/esm/extractors/flexible/actions/extract-automation-action.js +1 -1
  23. package/dist/esm/utils/analytics/analytics.js +1 -1
  24. package/dist/esm/utils/index.js +3 -11
  25. package/dist/esm/view/EmbedCard/views/ResolvedView.js +1 -2
  26. package/dist/esm/view/EmbedModal/index.js +1 -2
  27. package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +5 -1
  28. package/dist/esm/view/LinkUrl/index.js +1 -1
  29. package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +8 -1
  30. package/dist/types/common/analytics/generated/analytics.types.d.ts +5 -4
  31. package/dist/types/common/analytics/generated/create-event-payload.d.ts +1 -1
  32. package/dist/types/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +1 -1
  33. package/dist/types/view/RelatedLinksModal/components/types.d.ts +1 -1
  34. package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +5 -4
  35. package/dist/types-ts4.5/common/analytics/generated/create-event-payload.d.ts +1 -1
  36. package/dist/types-ts4.5/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +1 -1
  37. package/dist/types-ts4.5/view/RelatedLinksModal/components/types.d.ts +1 -1
  38. package/package.json +2 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 27.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#105138](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105138)
8
+ [`ecf1728ade7d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ecf1728ade7d) -
9
+ Update focus state on related modal
10
+ - [#107029](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107029)
11
+ [`e837166391e1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e837166391e1) -
12
+ Automation action analytics
13
+
14
+ ## 27.5.0
15
+
16
+ ### Minor Changes
17
+
18
+ - [#106790](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106790)
19
+ [`fe0b21796ab6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fe0b21796ab6) -
20
+ EDM-9715: remove platform.linking-platform.smart-card.enable-theme-state-url FF
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies
25
+
3
26
  ## 27.4.4
4
27
 
5
28
  ### Patch Changes
@@ -139,3 +139,9 @@ events:
139
139
  description: fired when an explicit request is made to use an AI-powered feature
140
140
  attributes:
141
141
  <<: [*PackageMetaDataContext, *aiInteractionAttributes]
142
+
143
+ - button clicked (automationAction):
144
+ type: ui
145
+ description: fired when the automation action button is clicked
146
+ attributes:
147
+ <<: [*PackageMetaDataContext, *ResolvedAttributes]
@@ -14,7 +14,7 @@ var _createEventPayload = _interopRequireDefault(require("./create-event-payload
14
14
  *
15
15
  * Generates Typescript types for analytics events from analytics.spec.yaml
16
16
  *
17
- * @codegen <<SignedSource::5fbe35afe0479810b090b1746dd1ae71>>
17
+ * @codegen <<SignedSource::3fdfbbdbdb062babb9a2ab4e53454d79>>
18
18
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
19
19
  */
20
20
 
@@ -30,6 +30,6 @@ var extractAutomationAction = exports.extractAutomationAction = function extract
30
30
  // TODO: The admin experience will be a follow up
31
31
  canManageAutomation: false,
32
32
  baseAutomationUrl: '',
33
- analyticsSource: 'smartCard'
33
+ analyticsSource: 'smartCardAutomationAction'
34
34
  };
35
35
  };
@@ -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: "27.4.4"
25
+ packageVersion: "27.5.1"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -477,20 +477,12 @@ var getPreviewUrlWithTheme = exports.getPreviewUrlWithTheme = function getPrevie
477
477
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.fix-embed-preview-url-query-params')) {
478
478
  try {
479
479
  var url = new URL(previewUrl);
480
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-theme-state-url')) {
481
- url.searchParams.append('themeState', (0, _tokens.themeObjectToString)(themeState));
482
- } else {
483
- var _themeState$colorMode;
484
- url.searchParams.append('themeMode', (_themeState$colorMode = themeState.colorMode) !== null && _themeState$colorMode !== void 0 ? _themeState$colorMode : '');
485
- }
480
+ url.searchParams.append('themeState', (0, _tokens.themeObjectToString)(themeState));
486
481
  return url.href;
487
482
  } catch (_unused) {
488
483
  return previewUrl;
489
484
  }
490
485
  }
491
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-theme-state-url')) {
492
- var themeStateQueryString = encodeURIComponent((0, _tokens.themeObjectToString)(themeState));
493
- return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeState=").concat(themeStateQueryString);
494
- }
495
- return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeMode=").concat(themeState.colorMode);
486
+ var themeStateQueryString = encodeURIComponent((0, _tokens.themeObjectToString)(themeState));
487
+ return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeState=").concat(themeStateQueryString);
496
488
  };
@@ -50,9 +50,8 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react2
50
50
  });
51
51
  }, [src, linkGlyph, iconFromContext]);
52
52
  var themeState = (0, _tokens.useThemeObserver)();
53
- var colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
54
53
  var previewUrl = preview === null || preview === void 0 ? void 0 : preview.src;
55
- if (previewUrl && isSupportTheming && colorMode) {
54
+ if (previewUrl && isSupportTheming) {
56
55
  previewUrl = (0, _utils.getPreviewUrlWithTheme)(previewUrl, themeState);
57
56
  }
58
57
  return (0, _react.jsx)(_ExpandedFrame.ExpandedFrame, {
@@ -93,7 +93,6 @@ var EmbedModal = function EmbedModal(_ref) {
93
93
  }
94
94
  }, [onResize, width]);
95
95
  var themeState = (0, _tokens.useThemeObserver)();
96
- var colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
97
96
  var previewUrl = src;
98
97
  var handleOnViewActionClick = (0, _react.useCallback)(function () {
99
98
  invoke({
@@ -143,7 +142,7 @@ var EmbedModal = function EmbedModal(_ref) {
143
142
  extensionKey: extensionKey
144
143
  });
145
144
  }, [download, extensionKey, invoke]);
146
- if (previewUrl && isSupportTheming && colorMode) {
145
+ if (previewUrl && isSupportTheming) {
147
146
  previewUrl = (0, _utils.getPreviewUrlWithTheme)(previewUrl, themeState);
148
147
  }
149
148
  return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, isOpen && /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
@@ -13,6 +13,7 @@ var _manaulTriggersIcon = _interopRequireDefault(require("./manaul-triggers-icon
13
13
  var _action = _interopRequireDefault(require("../action"));
14
14
  var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
15
15
  var _modal = require("../../../../../state/modal");
16
+ var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
16
17
  var _constants = require("../../../../../constants");
17
18
  var _messages = require("../../../../../messages");
18
19
  var _utils = require("./utils");
@@ -30,6 +31,8 @@ var AutomationAction = function AutomationAction(props) {
30
31
  var modal = (0, _modal.useSmartLinkModal)();
31
32
  var onClickCallback = props.onClick;
32
33
  var context = (0, _flexibleUiContext.useFlexibleUiContext)();
34
+ var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
35
+ fireEvent = _useAnalyticsEvents.fireEvent;
33
36
  var automationActionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.ActionName.AutomationAction];
34
37
  var automationActionOnClick = (0, _react.useCallback)(function (automationActionData) {
35
38
  var product = automationActionData.product,
@@ -40,6 +43,7 @@ var AutomationAction = function AutomationAction(props) {
40
43
  canManageAutomation = automationActionData.canManageAutomation,
41
44
  analyticsSource = automationActionData.analyticsSource,
42
45
  objectName = automationActionData.objectName;
46
+ fireEvent('ui.button.clicked.automationAction', {});
43
47
  var _ref = (0, _utils.getModalContent)(product, resourceType) || {},
44
48
  modalTitle = _ref.modalTitle,
45
49
  modalDescription = _ref.modalDescription;
@@ -66,7 +70,7 @@ var AutomationAction = function AutomationAction(props) {
66
70
  }
67
71
  }));
68
72
  onClickCallback === null || onClickCallback === void 0 || onClickCallback();
69
- }, [modal, onClickCallback]);
73
+ }, [modal, onClickCallback, fireEvent]);
70
74
  if (!automationActionData) {
71
75
  return null;
72
76
  }
@@ -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: "27.4.4",
20
+ packageVersion: "27.5.1",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _react = require("@emotion/react");
9
+ var _react = require("react");
10
+ var _react2 = require("@emotion/react");
10
11
  var _reactIntlNext = require("react-intl-next");
11
12
  var _new = _interopRequireDefault(require("@atlaskit/button/new"));
12
13
  var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
@@ -25,14 +26,20 @@ var RelatedLinksBaseModal = function RelatedLinksBaseModal(_ref) {
25
26
  var onClose = _ref.onClose,
26
27
  showModal = _ref.showModal,
27
28
  children = _ref.children;
28
- return (0, _react.jsx)(_modalDialog.ModalTransition, null, showModal && (0, _react.jsx)(_modalDialog.default, {
29
+ var openCompleteHandler = (0, _react.useCallback)(function (el) {
30
+ el.focus();
31
+ }, []);
32
+ return (0, _react2.jsx)(_modalDialog.ModalTransition, null, showModal && (0, _react2.jsx)(_modalDialog.default, {
33
+ testId: "related-links-modal",
29
34
  onClose: onClose,
30
- width: fixedWidth
31
- }, (0, _react.jsx)(_modalDialog.ModalHeader, null, (0, _react.jsx)(_modalDialog.ModalTitle, null, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.related_links_modal_title))), (0, _react.jsx)(_modalDialog.ModalBody, null, (0, _react.jsx)(_primitives.Box, {
35
+ width: fixedWidth,
36
+ autoFocus: false,
37
+ onOpenComplete: openCompleteHandler
38
+ }, (0, _react2.jsx)(_modalDialog.ModalHeader, null, (0, _react2.jsx)(_modalDialog.ModalTitle, null, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.related_links_modal_title))), (0, _react2.jsx)(_modalDialog.ModalBody, null, (0, _react2.jsx)(_primitives.Box, {
32
39
  xcss: boxStyles
33
- }, children)), (0, _react.jsx)(_modalDialog.ModalFooter, null, (0, _react.jsx)(_new.default, {
40
+ }, children)), (0, _react2.jsx)(_modalDialog.ModalFooter, null, (0, _react2.jsx)(_new.default, {
34
41
  appearance: "primary",
35
42
  onClick: onClose
36
- }, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.close)))));
43
+ }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.close)))));
37
44
  };
38
45
  var _default = exports.default = RelatedLinksBaseModal;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::5fbe35afe0479810b090b1746dd1ae71>>
6
+ * @codegen <<SignedSource::3fdfbbdbdb062babb9a2ab4e53454d79>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  import { useCallback } from 'react';
@@ -28,6 +28,6 @@ export const extractAutomationAction = response => {
28
28
  // TODO: The admin experience will be a follow up
29
29
  canManageAutomation: false,
30
30
  baseAutomationUrl: '',
31
- analyticsSource: 'smartCard'
31
+ analyticsSource: 'smartCardAutomationAction'
32
32
  };
33
33
  };
@@ -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: "27.4.4"
7
+ packageVersion: "27.5.1"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -180,20 +180,12 @@ export const getPreviewUrlWithTheme = (previewUrl, themeState) => {
180
180
  if (getBooleanFF('platform.linking-platform.smart-card.fix-embed-preview-url-query-params')) {
181
181
  try {
182
182
  const url = new URL(previewUrl);
183
- if (getBooleanFF('platform.linking-platform.smart-card.enable-theme-state-url')) {
184
- url.searchParams.append('themeState', themeObjectToString(themeState));
185
- } else {
186
- var _themeState$colorMode;
187
- url.searchParams.append('themeMode', (_themeState$colorMode = themeState.colorMode) !== null && _themeState$colorMode !== void 0 ? _themeState$colorMode : '');
188
- }
183
+ url.searchParams.append('themeState', themeObjectToString(themeState));
189
184
  return url.href;
190
185
  } catch {
191
186
  return previewUrl;
192
187
  }
193
188
  }
194
- if (getBooleanFF('platform.linking-platform.smart-card.enable-theme-state-url')) {
195
- const themeStateQueryString = encodeURIComponent(themeObjectToString(themeState));
196
- return `${previewUrl}${previewUrl.includes('?') ? '&' : '?'}themeState=${themeStateQueryString}`;
197
- }
198
- return `${previewUrl}${previewUrl.includes('?') ? '&' : '?'}themeMode=${themeState.colorMode}`;
189
+ const themeStateQueryString = encodeURIComponent(themeObjectToString(themeState));
190
+ return `${previewUrl}${previewUrl.includes('?') ? '&' : '?'}themeState=${themeStateQueryString}`;
199
191
  };
@@ -40,9 +40,8 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
40
40
  });
41
41
  }, [src, linkGlyph, iconFromContext]);
42
42
  const themeState = useThemeObserver();
43
- const colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
44
43
  let previewUrl = preview === null || preview === void 0 ? void 0 : preview.src;
45
- if (previewUrl && isSupportTheming && colorMode) {
44
+ if (previewUrl && isSupportTheming) {
46
45
  previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
47
46
  }
48
47
  return jsx(ExpandedFrame, {
@@ -66,7 +66,6 @@ const EmbedModal = ({
66
66
  }
67
67
  }, [onResize, width]);
68
68
  const themeState = useThemeObserver();
69
- const colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
70
69
  let previewUrl = src;
71
70
  const handleOnViewActionClick = useCallback(() => {
72
71
  invoke({
@@ -84,7 +83,7 @@ const EmbedModal = ({
84
83
  extensionKey
85
84
  });
86
85
  }, [download, extensionKey, invoke]);
87
- if (previewUrl && isSupportTheming && colorMode) {
86
+ if (previewUrl && isSupportTheming) {
88
87
  previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
89
88
  }
90
89
  return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
@@ -5,6 +5,7 @@ import AutomationManualTriggersGlyph from './manaul-triggers-icon';
5
5
  import Action from '../action';
6
6
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
7
7
  import { useSmartLinkModal } from '../../../../../state/modal';
8
+ import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
8
9
  import { ActionName } from '../../../../../constants';
9
10
  import { messages } from '../../../../../messages';
10
11
  import { getModalContent } from './utils';
@@ -19,6 +20,9 @@ const AutomationAction = props => {
19
20
  onClick: onClickCallback
20
21
  } = props;
21
22
  const context = useFlexibleUiContext();
23
+ const {
24
+ fireEvent
25
+ } = useAnalyticsEvents();
22
26
  const automationActionData = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.AutomationAction];
23
27
  const automationActionOnClick = useCallback(automationActionData => {
24
28
  const {
@@ -31,6 +35,7 @@ const AutomationAction = props => {
31
35
  analyticsSource,
32
36
  objectName
33
37
  } = automationActionData;
38
+ fireEvent('ui.button.clicked.automationAction', {});
34
39
  const {
35
40
  modalTitle,
36
41
  modalDescription
@@ -54,7 +59,7 @@ const AutomationAction = props => {
54
59
  onClose: () => modal.close()
55
60
  }));
56
61
  onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback();
57
- }, [modal, onClickCallback]);
62
+ }, [modal, onClickCallback, fireEvent]);
58
63
  if (!automationActionData) {
59
64
  return null;
60
65
  }
@@ -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: "27.4.4",
10
+ packageVersion: "27.5.1",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
 
3
+ import { useCallback } from 'react';
3
4
  import { jsx } from '@emotion/react';
4
5
  import { FormattedMessage } from 'react-intl-next';
5
6
  import Button from '@atlaskit/button/new';
@@ -16,9 +17,15 @@ const RelatedLinksBaseModal = ({
16
17
  showModal,
17
18
  children
18
19
  }) => {
20
+ const openCompleteHandler = useCallback(el => {
21
+ el.focus();
22
+ }, []);
19
23
  return jsx(ModalTransition, null, showModal && jsx(Modal, {
24
+ testId: "related-links-modal",
20
25
  onClose: onClose,
21
- width: fixedWidth
26
+ width: fixedWidth,
27
+ autoFocus: false,
28
+ onOpenComplete: openCompleteHandler
22
29
  }, jsx(ModalHeader, null, jsx(ModalTitle, null, jsx(FormattedMessage, messages.related_links_modal_title))), jsx(ModalBody, null, jsx(Box, {
23
30
  xcss: boxStyles
24
31
  }, children)), jsx(ModalFooter, null, jsx(Button, {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::5fbe35afe0479810b090b1746dd1ae71>>
6
+ * @codegen <<SignedSource::3fdfbbdbdb062babb9a2ab4e53454d79>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  import { useCallback } from 'react';
@@ -24,6 +24,6 @@ export var extractAutomationAction = function extractAutomationAction(response)
24
24
  // TODO: The admin experience will be a follow up
25
25
  canManageAutomation: false,
26
26
  baseAutomationUrl: '',
27
- analyticsSource: 'smartCard'
27
+ analyticsSource: 'smartCardAutomationAction'
28
28
  };
29
29
  };
@@ -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: "27.4.4"
18
+ packageVersion: "27.5.1"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -367,20 +367,12 @@ export var getPreviewUrlWithTheme = function getPreviewUrlWithTheme(previewUrl,
367
367
  if (getBooleanFF('platform.linking-platform.smart-card.fix-embed-preview-url-query-params')) {
368
368
  try {
369
369
  var url = new URL(previewUrl);
370
- if (getBooleanFF('platform.linking-platform.smart-card.enable-theme-state-url')) {
371
- url.searchParams.append('themeState', themeObjectToString(themeState));
372
- } else {
373
- var _themeState$colorMode;
374
- url.searchParams.append('themeMode', (_themeState$colorMode = themeState.colorMode) !== null && _themeState$colorMode !== void 0 ? _themeState$colorMode : '');
375
- }
370
+ url.searchParams.append('themeState', themeObjectToString(themeState));
376
371
  return url.href;
377
372
  } catch (_unused) {
378
373
  return previewUrl;
379
374
  }
380
375
  }
381
- if (getBooleanFF('platform.linking-platform.smart-card.enable-theme-state-url')) {
382
- var themeStateQueryString = encodeURIComponent(themeObjectToString(themeState));
383
- return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeState=").concat(themeStateQueryString);
384
- }
385
- return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeMode=").concat(themeState.colorMode);
376
+ var themeStateQueryString = encodeURIComponent(themeObjectToString(themeState));
377
+ return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeState=").concat(themeStateQueryString);
386
378
  };
@@ -42,9 +42,8 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
42
42
  });
43
43
  }, [src, linkGlyph, iconFromContext]);
44
44
  var themeState = useThemeObserver();
45
- var colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
46
45
  var previewUrl = preview === null || preview === void 0 ? void 0 : preview.src;
47
- if (previewUrl && isSupportTheming && colorMode) {
46
+ if (previewUrl && isSupportTheming) {
48
47
  previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
49
48
  }
50
49
  return jsx(ExpandedFrame, {
@@ -83,7 +83,6 @@ var EmbedModal = function EmbedModal(_ref) {
83
83
  }
84
84
  }, [onResize, width]);
85
85
  var themeState = useThemeObserver();
86
- var colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
87
86
  var previewUrl = src;
88
87
  var handleOnViewActionClick = useCallback(function () {
89
88
  invoke({
@@ -133,7 +132,7 @@ var EmbedModal = function EmbedModal(_ref) {
133
132
  extensionKey: extensionKey
134
133
  });
135
134
  }, [download, extensionKey, invoke]);
136
- if (previewUrl && isSupportTheming && colorMode) {
135
+ if (previewUrl && isSupportTheming) {
137
136
  previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
138
137
  }
139
138
  return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
@@ -5,6 +5,7 @@ import AutomationManualTriggersGlyph from './manaul-triggers-icon';
5
5
  import Action from '../action';
6
6
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
7
7
  import { useSmartLinkModal } from '../../../../../state/modal';
8
+ import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
8
9
  import { ActionName } from '../../../../../constants';
9
10
  import { messages } from '../../../../../messages';
10
11
  import { getModalContent } from './utils';
@@ -18,6 +19,8 @@ var AutomationAction = function AutomationAction(props) {
18
19
  var modal = useSmartLinkModal();
19
20
  var onClickCallback = props.onClick;
20
21
  var context = useFlexibleUiContext();
22
+ var _useAnalyticsEvents = useAnalyticsEvents(),
23
+ fireEvent = _useAnalyticsEvents.fireEvent;
21
24
  var automationActionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.AutomationAction];
22
25
  var automationActionOnClick = useCallback(function (automationActionData) {
23
26
  var product = automationActionData.product,
@@ -28,6 +31,7 @@ var AutomationAction = function AutomationAction(props) {
28
31
  canManageAutomation = automationActionData.canManageAutomation,
29
32
  analyticsSource = automationActionData.analyticsSource,
30
33
  objectName = automationActionData.objectName;
34
+ fireEvent('ui.button.clicked.automationAction', {});
31
35
  var _ref = getModalContent(product, resourceType) || {},
32
36
  modalTitle = _ref.modalTitle,
33
37
  modalDescription = _ref.modalDescription;
@@ -54,7 +58,7 @@ var AutomationAction = function AutomationAction(props) {
54
58
  }
55
59
  }));
56
60
  onClickCallback === null || onClickCallback === void 0 || onClickCallback();
57
- }, [modal, onClickCallback]);
61
+ }, [modal, onClickCallback, fireEvent]);
58
62
  if (!automationActionData) {
59
63
  return null;
60
64
  }
@@ -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: "27.4.4",
13
+ packageVersion: "27.5.1",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
 
3
+ import { useCallback } from 'react';
3
4
  import { jsx } from '@emotion/react';
4
5
  import { FormattedMessage } from 'react-intl-next';
5
6
  import Button from '@atlaskit/button/new';
@@ -15,9 +16,15 @@ var RelatedLinksBaseModal = function RelatedLinksBaseModal(_ref) {
15
16
  var onClose = _ref.onClose,
16
17
  showModal = _ref.showModal,
17
18
  children = _ref.children;
19
+ var openCompleteHandler = useCallback(function (el) {
20
+ el.focus();
21
+ }, []);
18
22
  return jsx(ModalTransition, null, showModal && jsx(Modal, {
23
+ testId: "related-links-modal",
19
24
  onClose: onClose,
20
- width: fixedWidth
25
+ width: fixedWidth,
26
+ autoFocus: false,
27
+ onOpenComplete: openCompleteHandler
21
28
  }, jsx(ModalHeader, null, jsx(ModalTitle, null, jsx(FormattedMessage, messages.related_links_modal_title))), jsx(ModalBody, null, jsx(Box, {
22
29
  xcss: boxStyles
23
30
  }, children)), jsx(ModalFooter, null, jsx(Button, {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::334c6c6965226785c649b8d6b292227c>>
6
+ * @codegen <<SignedSource::c3c6503e4183ef772d7576a979b729b7>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -33,9 +33,6 @@ export type ErrorViewedAiSummaryAttributesType = {};
33
33
  export type SummarySuccessAttributesType = {};
34
34
  export type SummaryFailedAttributesType = {
35
35
  reason: string | null;
36
- /**
37
- * True if the error should be counted towards the SLO.
38
- */
39
36
  isSloError: boolean;
40
37
  };
41
38
  export type AiInteractionInitiatedAttributesType = {
@@ -43,6 +40,7 @@ export type AiInteractionInitiatedAttributesType = {
43
40
  proactiveAIGenerated: number;
44
41
  userGeneratedAI: number;
45
42
  };
43
+ export type ButtonClickedAutomationActionAttributesType = {};
46
44
  export type AnalyticsEventAttributes = {
47
45
  /**
48
46
  * fired when an ai summary is clicked */
@@ -65,5 +63,8 @@ export type AnalyticsEventAttributes = {
65
63
  /**
66
64
  * fired when an explicit request is made to use an AI-powered feature */
67
65
  'track.aiInteraction.initiated': AiInteractionInitiatedAttributesType;
66
+ /**
67
+ * fired when the automation action button is clicked */
68
+ 'ui.button.clicked.automationAction': ButtonClickedAutomationActionAttributesType;
68
69
  };
69
70
  export type EventKey = keyof AnalyticsEventAttributes;
@@ -6,7 +6,7 @@
6
6
  * @codegen <<SignedSource::0d08fdca953a1eb1130683499e509165>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
- import { type AnalyticsEventAttributes, type EventKey } from './analytics.types';
9
+ import type { AnalyticsEventAttributes, EventKey } from './analytics.types';
10
10
  type OptionalIfUndefined<T> = undefined extends T ? [param?: T] : [param: T];
11
11
  export type EventPayloadAttributes<K extends EventKey> = OptionalIfUndefined<AnalyticsEventAttributes[K]>;
12
12
  type EventTypes = 'ui' | 'track' | 'operational' | 'screen';
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  import { type RelatedLinksBaseModalProps } from './types';
4
- declare const RelatedLinksBaseModal: ({ onClose, showModal, children, }: RelatedLinksBaseModalProps) => jsx.JSX.Element;
4
+ declare const RelatedLinksBaseModal: ({ onClose, showModal, children }: RelatedLinksBaseModalProps) => jsx.JSX.Element;
5
5
  export default RelatedLinksBaseModal;
@@ -1,5 +1,5 @@
1
1
  import { type MessageDescriptor } from 'react-intl-next';
2
- import type React from "react";
2
+ import type React from 'react';
3
3
  export type RelatedLinkItemProp = {
4
4
  url: string;
5
5
  testId?: string;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::334c6c6965226785c649b8d6b292227c>>
6
+ * @codegen <<SignedSource::c3c6503e4183ef772d7576a979b729b7>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -33,9 +33,6 @@ export type ErrorViewedAiSummaryAttributesType = {};
33
33
  export type SummarySuccessAttributesType = {};
34
34
  export type SummaryFailedAttributesType = {
35
35
  reason: string | null;
36
- /**
37
- * True if the error should be counted towards the SLO.
38
- */
39
36
  isSloError: boolean;
40
37
  };
41
38
  export type AiInteractionInitiatedAttributesType = {
@@ -43,6 +40,7 @@ export type AiInteractionInitiatedAttributesType = {
43
40
  proactiveAIGenerated: number;
44
41
  userGeneratedAI: number;
45
42
  };
43
+ export type ButtonClickedAutomationActionAttributesType = {};
46
44
  export type AnalyticsEventAttributes = {
47
45
  /**
48
46
  * fired when an ai summary is clicked */
@@ -65,5 +63,8 @@ export type AnalyticsEventAttributes = {
65
63
  /**
66
64
  * fired when an explicit request is made to use an AI-powered feature */
67
65
  'track.aiInteraction.initiated': AiInteractionInitiatedAttributesType;
66
+ /**
67
+ * fired when the automation action button is clicked */
68
+ 'ui.button.clicked.automationAction': ButtonClickedAutomationActionAttributesType;
68
69
  };
69
70
  export type EventKey = keyof AnalyticsEventAttributes;
@@ -6,7 +6,7 @@
6
6
  * @codegen <<SignedSource::0d08fdca953a1eb1130683499e509165>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
- import { type AnalyticsEventAttributes, type EventKey } from './analytics.types';
9
+ import type { AnalyticsEventAttributes, EventKey } from './analytics.types';
10
10
  type OptionalIfUndefined<T> = undefined extends T ? [
11
11
  param?: T
12
12
  ] : [
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  import { type RelatedLinksBaseModalProps } from './types';
4
- declare const RelatedLinksBaseModal: ({ onClose, showModal, children, }: RelatedLinksBaseModalProps) => jsx.JSX.Element;
4
+ declare const RelatedLinksBaseModal: ({ onClose, showModal, children }: RelatedLinksBaseModalProps) => jsx.JSX.Element;
5
5
  export default RelatedLinksBaseModal;
@@ -1,5 +1,5 @@
1
1
  import { type MessageDescriptor } from 'react-intl-next';
2
- import type React from "react";
2
+ import type React from 'react';
3
3
  export type RelatedLinkItemProp = {
4
4
  url: string;
5
5
  testId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "27.4.4",
3
+ "version": "27.5.1",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -55,7 +55,7 @@
55
55
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
56
56
  "@atlaskit/platform-feature-flags": "^0.2.1",
57
57
  "@atlaskit/popup": "^1.17.0",
58
- "@atlaskit/primitives": "^6.4.0",
58
+ "@atlaskit/primitives": "^6.5.0",
59
59
  "@atlaskit/section-message": "^6.5.0",
60
60
  "@atlaskit/select": "^17.10.0",
61
61
  "@atlaskit/spinner": "^16.1.0",
@@ -170,9 +170,6 @@
170
170
  "platform.linking-platform.smart-card.hover-card-action-redesign": {
171
171
  "type": "boolean"
172
172
  },
173
- "platform.linking-platform.smart-card.enable-theme-state-url": {
174
- "type": "boolean"
175
- },
176
173
  "platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour": {
177
174
  "type": "boolean"
178
175
  },