@atlaskit/smart-card 28.4.0 → 29.0.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 (75) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/index.js +0 -6
  3. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +2 -12
  4. package/dist/cjs/state/hooks/useSmartLink.js +2 -7
  5. package/dist/cjs/state/hooks-external/useSmartLinkActions.js +1 -2
  6. package/dist/cjs/state/hooks-external/useSmartLinkReload.js +2 -3
  7. package/dist/cjs/utils/analytics/analytics.js +1 -1
  8. package/dist/cjs/utils/index.js +1 -14
  9. package/dist/cjs/view/CardWithUrl/component.js +2 -5
  10. package/dist/cjs/view/CardWithUrl/loader.js +1 -5
  11. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +14 -4
  12. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +1 -5
  13. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +1 -1
  14. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -1
  15. package/dist/cjs/view/HoverCard/index.js +1 -1
  16. package/dist/cjs/view/LinkUrl/index.js +1 -1
  17. package/dist/es2019/client/index.js +4 -0
  18. package/dist/es2019/index.js +20 -1
  19. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +2 -12
  20. package/dist/es2019/state/hooks/useSmartLink.js +2 -7
  21. package/dist/es2019/state/hooks-external/useSmartLinkActions.js +1 -2
  22. package/dist/es2019/state/hooks-external/useSmartLinkReload.js +2 -3
  23. package/dist/es2019/utils/analytics/analytics.js +1 -1
  24. package/dist/es2019/utils/index.js +0 -13
  25. package/dist/es2019/view/CardWithUrl/component.js +3 -6
  26. package/dist/es2019/view/CardWithUrl/loader.js +1 -5
  27. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +14 -4
  28. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +1 -5
  29. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -1
  30. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -1
  31. package/dist/es2019/view/HoverCard/index.js +1 -1
  32. package/dist/es2019/view/LinkUrl/index.js +1 -1
  33. package/dist/esm/client/index.js +4 -0
  34. package/dist/esm/index.js +20 -1
  35. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +2 -12
  36. package/dist/esm/state/hooks/useSmartLink.js +2 -7
  37. package/dist/esm/state/hooks-external/useSmartLinkActions.js +1 -2
  38. package/dist/esm/state/hooks-external/useSmartLinkReload.js +2 -3
  39. package/dist/esm/utils/analytics/analytics.js +1 -1
  40. package/dist/esm/utils/index.js +0 -13
  41. package/dist/esm/view/CardWithUrl/component.js +3 -6
  42. package/dist/esm/view/CardWithUrl/loader.js +1 -5
  43. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +14 -4
  44. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +1 -5
  45. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -1
  46. package/dist/esm/view/HoverCard/components/HoverCardContent.js +1 -1
  47. package/dist/esm/view/HoverCard/index.js +1 -1
  48. package/dist/esm/view/LinkUrl/index.js +1 -1
  49. package/dist/types/client/index.d.ts +4 -0
  50. package/dist/types/index.d.ts +9 -1
  51. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +2 -12
  52. package/dist/types/state/hooks/useSmartLink.d.ts +4 -11
  53. package/dist/types/state/hooks-external/useSmartLinkActions.d.ts +2 -10
  54. package/dist/types/state/hooks-external/useSmartLinkReload.d.ts +1 -10
  55. package/dist/types/utils/index.d.ts +0 -6
  56. package/dist/types/utils/mocks.d.ts +0 -1
  57. package/dist/types/view/Card/index.d.ts +1 -1
  58. package/dist/types/view/Card/types.d.ts +0 -25
  59. package/dist/types/view/CardWithData/types.d.ts +0 -6
  60. package/dist/types/view/CardWithUrl/types.d.ts +0 -19
  61. package/dist/types/view/HoverCard/types.d.ts +1 -7
  62. package/dist/types-ts4.5/client/index.d.ts +4 -0
  63. package/dist/types-ts4.5/index.d.ts +9 -1
  64. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +2 -12
  65. package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +4 -11
  66. package/dist/types-ts4.5/state/hooks-external/useSmartLinkActions.d.ts +2 -10
  67. package/dist/types-ts4.5/state/hooks-external/useSmartLinkReload.d.ts +1 -10
  68. package/dist/types-ts4.5/utils/index.d.ts +0 -6
  69. package/dist/types-ts4.5/utils/mocks.d.ts +0 -1
  70. package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
  71. package/dist/types-ts4.5/view/Card/types.d.ts +0 -25
  72. package/dist/types-ts4.5/view/CardWithData/types.d.ts +0 -6
  73. package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +0 -19
  74. package/dist/types-ts4.5/view/HoverCard/types.d.ts +1 -7
  75. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 29.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#147220](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/147220)
8
+ [`07a9416026f88`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/07a9416026f88) -
9
+ Remove isFrameVisible from smart card public export
10
+ - [#147220](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/147220)
11
+ [`07a9416026f88`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/07a9416026f88) -
12
+ Remove showActions and showServerActions from smart-card
13
+ - [#147220](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/147220)
14
+ [`07a9416026f88`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/07a9416026f88) -
15
+ Remove useSmartLinkAnalytics from publicly exported API and remove analyticsEvents from Card
16
+
17
+ ### Minor Changes
18
+
19
+ - [#147259](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/147259)
20
+ [`33c2291672ccf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/33c2291672ccf) -
21
+ Enable new icons behind a feature flag.
22
+
3
23
  ## 28.4.0
4
24
 
5
25
  ### Minor Changes
package/dist/cjs/index.js CHANGED
@@ -243,12 +243,6 @@ Object.defineProperty(exports, "metadataListClassName", {
243
243
  return _classNames.metadataListClassName;
244
244
  }
245
245
  });
246
- Object.defineProperty(exports, "useSmartLinkAnalytics", {
247
- enumerable: true,
248
- get: function get() {
249
- return _state.useSmartLinkAnalytics;
250
- }
251
- });
252
246
  Object.defineProperty(exports, "useSmartLinkEvents", {
253
247
  enumerable: true,
254
248
  get: function get() {
@@ -35,18 +35,14 @@ var applyCommonAttributes = function applyCommonAttributes(event, commonAttribut
35
35
  * This hook provides usage of Smart Link analytics outside of the Card component.
36
36
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
37
37
  *
38
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
39
- * This hook's external use is deprecated and may no longer be exported from this package in future releases.
40
- * Please avoid using it in conjunction with the `analyticsEvents` prop.
41
- *
42
38
  * @param url URL of the link
43
39
  * @param dispatchAnalytics dispatchAnalytics function
44
40
  * @param id fallback id of the events sent if no id is available
45
41
  * @param defaultLocation location attribute to be used
46
42
  * @returns
47
43
  */
48
- var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLinkAnalytics(url, _dispatchAnalytics, id, defaultLocation) {
49
- var _useDispatchAnalytics = (0, _useDispatchAnalytics2.useDispatchAnalytics)(_dispatchAnalytics),
44
+ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defaultLocation) {
45
+ var _useDispatchAnalytics = (0, _useDispatchAnalytics2.useDispatchAnalytics)(),
50
46
  dispatchAnalytics = _useDispatchAnalytics.dispatchAnalytics;
51
47
  var defaultId = id || 'NULL';
52
48
  // We don't want to trigger a re-render by using useSmartCardState
@@ -254,7 +250,6 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
254
250
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
255
251
  * @param actionType The type of the action that was clicked, e.g. PreviewAction
256
252
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
257
- * @param invokeType @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
258
253
  * @returns
259
254
  */
260
255
  actionClickedEvent: function actionClickedEvent(_ref6) {
@@ -753,11 +748,6 @@ var useSmartLinkAnalytics = exports.useSmartLinkAnalytics = function useSmartLin
753
748
  location: location
754
749
  })), commonAttributes));
755
750
  },
756
- /**
757
- * Removed in EDM-5153: This is an even from an experiment.
758
- * @deprecated
759
- */
760
- linkUpdated: function linkUpdated() {},
761
751
  /**
762
752
  * This fires a tracking event before an action invoke api call is made
763
753
  */
@@ -13,16 +13,11 @@ var _config = require("../config");
13
13
  var _analytics = require("../analytics");
14
14
  var _renderers = require("../renderers");
15
15
  var _linkProvider = require("@atlaskit/link-provider");
16
- function useSmartLink(id, url,
17
- /**
18
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
19
- * Avoid prop drilling analytics handlers. Continue passing a handler for now if there's already one in place.
20
- */
21
- dispatchAnalytics) {
16
+ function useSmartLink(id, url) {
22
17
  var state = (0, _store.useSmartCardState)(url);
23
18
  var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
24
19
  store = _useSmartLinkContext.store;
25
- var analytics = (0, _analytics.useSmartLinkAnalytics)(url, dispatchAnalytics, id);
20
+ var analytics = (0, _analytics.useSmartLinkAnalytics)(url, id);
26
21
  var actions = (0, _actions.useSmartCardActions)(id, url, analytics);
27
22
  var config = (0, _config.useSmartLinkConfig)();
28
23
  var renderers = (0, _renderers.useSmartLinkRenderers)();
@@ -15,7 +15,6 @@ var _helpers = require("../helpers");
15
15
  function useSmartLinkActions(_ref) {
16
16
  var url = _ref.url,
17
17
  appearance = _ref.appearance,
18
- analyticsHandler = _ref.analyticsHandler,
19
18
  _ref$platform = _ref.platform,
20
19
  platform = _ref$platform === void 0 ? 'web' : _ref$platform,
21
20
  origin = _ref.origin,
@@ -24,7 +23,7 @@ function useSmartLinkActions(_ref) {
24
23
  return (0, _uuid.default)();
25
24
  }, []);
26
25
  var linkState = (0, _store.useSmartCardState)(url);
27
- var linkAnalytics = (0, _analytics.useSmartLinkAnalytics)(url, analyticsHandler, id);
26
+ var linkAnalytics = (0, _analytics.useSmartLinkAnalytics)(url, id);
28
27
  var linkActions = (0, _actions.useSmartCardActions)(id, url, linkAnalytics);
29
28
  if (linkState.details && !(actionOptions !== null && actionOptions !== void 0 && actionOptions.hide)) {
30
29
  var cardProperties = (0, _block.extractBlockProps)(linkState.details.data, linkState.details.meta, {
@@ -15,12 +15,11 @@ var _analytics = require("../analytics");
15
15
  * @returns
16
16
  */
17
17
  function useSmartLinkReload(_ref) {
18
- var url = _ref.url,
19
- analyticsHandler = _ref.analyticsHandler;
18
+ var url = _ref.url;
20
19
  var id = (0, _react.useMemo)(function () {
21
20
  return (0, _uuid.default)();
22
21
  }, []);
23
- var linkAnalytics = (0, _analytics.useSmartLinkAnalytics)(url, analyticsHandler, id);
22
+ var linkAnalytics = (0, _analytics.useSmartLinkAnalytics)(url, id);
24
23
  var linkActions = (0, _actions.useSmartCardActions)(id, url, linkAnalytics);
25
24
  return linkActions.reload;
26
25
  }
@@ -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: "28.4.0"
25
+ packageVersion: "29.0.0"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.sleep = exports.openUrl = exports.isSpecialKey = exports.isSpecialEvent = exports.isSpecialClick = exports.isIntersectionObserverSupported = exports.isIframe = exports.isCardWithData = exports.importWithRetry = exports.handleOnClick = exports.getPreviewUrlWithTheme = exports.getLabelForFileType = exports.getIframeSandboxAttribute = exports.getIconForFileType = exports.downloadUrl = exports.combineFrameStyle = void 0;
8
+ exports.sleep = exports.openUrl = exports.isSpecialKey = exports.isSpecialEvent = exports.isSpecialClick = exports.isIntersectionObserverSupported = exports.isIframe = exports.isCardWithData = exports.importWithRetry = exports.handleOnClick = exports.getPreviewUrlWithTheme = exports.getLabelForFileType = exports.getIframeSandboxAttribute = exports.getIconForFileType = exports.downloadUrl = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -454,19 +454,6 @@ var openUrl = exports.openUrl = /*#__PURE__*/function () {
454
454
  };
455
455
  }();
456
456
 
457
- /**
458
- * Migrate internal usages of the deprecated isFrameVisible to frameStyle
459
- * This function is to be removed on deprecation of isFrameVisible.
460
- */
461
- var combineFrameStyle = exports.combineFrameStyle = function combineFrameStyle(frameStyle, isFrameVisible) {
462
- if (frameStyle !== undefined) {
463
- return frameStyle;
464
- }
465
- if (isFrameVisible) {
466
- return 'show';
467
- }
468
- };
469
-
470
457
  /**
471
458
  * Append a theme to the URL if it exists
472
459
  * @param previewUrl
@@ -29,12 +29,10 @@ function Component(_ref) {
29
29
  url = _ref.url,
30
30
  isSelected = _ref.isSelected,
31
31
  isHovered = _ref.isHovered,
32
- isFrameVisible = _ref.isFrameVisible,
33
- frameStyleProp = _ref.frameStyle,
32
+ frameStyle = _ref.frameStyle,
34
33
  platform = _ref.platform,
35
34
  onClick = _ref.onClick,
36
35
  appearance = _ref.appearance,
37
- dispatchAnalytics = _ref.dispatchAnalytics,
38
36
  onResolve = _ref.onResolve,
39
37
  onError = _ref.onError,
40
38
  testId = _ref.testId,
@@ -57,7 +55,7 @@ function Component(_ref) {
57
55
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
58
56
 
59
57
  // Get state, actions for this card.
60
- var _useSmartLink = (0, _state.useSmartLink)(id, url, dispatchAnalytics),
58
+ var _useSmartLink = (0, _state.useSmartLink)(id, url),
61
59
  state = _useSmartLink.state,
62
60
  actions = _useSmartLink.actions,
63
61
  defaultAnalytics = _useSmartLink.analytics,
@@ -79,7 +77,6 @@ function Component(_ref) {
79
77
  actionOptions: actionOptionsProp,
80
78
  platform: platform
81
79
  });
82
- var frameStyle = (0, _utils.combineFrameStyle)(frameStyleProp, isFrameVisible);
83
80
 
84
81
  // Setup UI handlers.
85
82
  var handleClickWrapper = (0, _react.useCallback)(function (event) {
@@ -43,7 +43,6 @@ function CardWithURLRenderer(props) {
43
43
  appearance = props.appearance,
44
44
  isSelected = props.isSelected,
45
45
  isHovered = props.isHovered,
46
- isFrameVisible = props.isFrameVisible,
47
46
  frameStyle = props.frameStyle,
48
47
  onClick = props.onClick,
49
48
  container = props.container,
@@ -61,14 +60,13 @@ function CardWithURLRenderer(props) {
61
60
  showHoverPreview = props.showHoverPreview,
62
61
  hoverPreviewOptions = props.hoverPreviewOptions,
63
62
  showAuthTooltip = props.showAuthTooltip,
64
- analyticsEvents = props.analyticsEvents,
65
63
  placeholder = props.placeholder,
66
64
  fallbackComponent = props.fallbackComponent,
67
65
  useLegacyBlockCard = props.useLegacyBlockCard,
68
66
  removeTextHighlightingFromTitle = props.removeTextHighlightingFromTitle,
69
67
  resolvingPlaceholder = props.resolvingPlaceholder,
70
68
  truncateInline = props.truncateInline;
71
- var analytics = (0, _analytics.useSmartLinkAnalytics)(url !== null && url !== void 0 ? url : '', undefined, id);
69
+ var analytics = (0, _analytics.useSmartLinkAnalytics)(url !== null && url !== void 0 ? url : '', id);
72
70
  var isFlexibleUi = (0, _flexible.isFlexibleUiCard)(children);
73
71
  var errorHandler = (0, _react.useCallback)(function (error, info) {
74
72
  var componentStack = info.componentStack;
@@ -117,7 +115,6 @@ function CardWithURLRenderer(props) {
117
115
  onClick: onClick,
118
116
  isSelected: isSelected,
119
117
  isHovered: isHovered,
120
- isFrameVisible: isFrameVisible,
121
118
  frameStyle: frameStyle,
122
119
  container: container,
123
120
  onResolve: onResolve,
@@ -133,7 +130,6 @@ function CardWithURLRenderer(props) {
133
130
  showHoverPreview: showHoverPreview,
134
131
  hoverPreviewOptions: hoverPreviewOptions,
135
132
  showAuthTooltip: showAuthTooltip,
136
- analyticsEvents: analyticsEvents,
137
133
  placeholder: placeholder,
138
134
  useLegacyBlockCard: useLegacyBlockCard,
139
135
  removeTextHighlightingFromTitle: removeTextHighlightingFromTitle,
@@ -11,14 +11,19 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
11
11
  var _react = require("@emotion/react");
12
12
  var _react2 = require("react");
13
13
  var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
14
- var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
14
+ var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
15
15
  var _styled = require("../styled");
16
+ var _primitives = require("@atlaskit/primitives");
16
17
  var _excluded = ["appearance", "isOpen", "testId", "text", "triggerRef"];
17
18
  /**
18
19
  * @jsxRuntime classic
19
20
  * @jsx jsx
20
21
  */
21
22
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
23
+ var chevronDownStyles = (0, _primitives.xcss)({
24
+ marginLeft: 'space.075',
25
+ display: 'flex'
26
+ });
22
27
  var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
23
28
  var appearance = _ref.appearance,
24
29
  isOpen = _ref.isOpen,
@@ -42,10 +47,15 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
42
47
  isBold: isBold
43
48
  }, (0, _react.jsx)("span", {
44
49
  css: _styled.triggerLozengeStyles
45
- }, (0, _react.jsx)("span", null, text), (0, _react.jsx)(_chevronDown.default, {
50
+ }, (0, _react.jsx)("span", null, text), (0, _react.jsx)(_primitives.Box, {
51
+ as: "span",
52
+ xcss: chevronDownStyles
53
+ }, (0, _react.jsx)(_chevronDown.default, {
54
+ color: "currentColor",
46
55
  label: "options",
47
- size: "medium"
48
- })));
56
+ LEGACY_size: "medium",
57
+ LEGACY_margin: "-4px -8px -4px -7px"
58
+ }))));
49
59
  }, [appearance, isBold, text]);
50
60
  return (0, _react.jsx)("button", (0, _extends2.default)({
51
61
  type: "button"
@@ -34,11 +34,7 @@ var triggerButtonStyles = exports.triggerButtonStyles = (0, _react.css)({
34
34
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
35
35
  var triggerLozengeStyles = exports.triggerLozengeStyles = (0, _react.css)({
36
36
  alignItems: 'center',
37
- display: 'flex',
38
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
39
- "span[role='img']": {
40
- margin: "var(--ds-space-negative-050, -4px)".concat(" ", "var(--ds-space-negative-100, -8px)", " ", "var(--ds-space-negative-050, -4px)", " -1px")
41
- }
37
+ display: 'flex'
42
38
  });
43
39
 
44
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
@@ -68,7 +68,7 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
68
68
  var parentSpan = (0, _react2.useRef)(null);
69
69
  var renderers = (0, _renderers.useSmartLinkRenderers)();
70
70
  var linkState = (0, _store.useSmartCardState)(url);
71
- var analytics = (0, _analytics.useSmartLinkAnalytics)(url, undefined, id);
71
+ var analytics = (0, _analytics.useSmartLinkAnalytics)(url, id);
72
72
  var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url, analytics),
73
73
  loadMetadata = _useSmartCardActions.loadMetadata;
74
74
  var actionOptions = (0, _combineActionOptions.combineActionOptions)({
@@ -48,7 +48,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
48
48
  actionOptions = _ref.actionOptions;
49
49
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
50
50
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
51
- var defaultAnalytics = (0, _analytics2.useSmartLinkAnalytics)(url, undefined, id);
51
+ var defaultAnalytics = (0, _analytics2.useSmartLinkAnalytics)(url, id);
52
52
  var analytics = _analytics !== null && _analytics !== void 0 ? _analytics : defaultAnalytics;
53
53
  var extensionKey = (0, _react2.useMemo)(function () {
54
54
  return (0, _helpers.getExtensionKey)(cardState.details);
@@ -24,7 +24,7 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
24
24
  var url = props.url,
25
25
  id = props.id,
26
26
  children = props.children;
27
- var analytics = (0, _analytics.useSmartLinkAnalytics)(url, undefined, id);
27
+ var analytics = (0, _analytics.useSmartLinkAnalytics)(url, id);
28
28
  var onError = (0, _react2.useCallback)(function (error, info) {
29
29
  analytics.ui.renderFailedEvent({
30
30
  display: _constants.CardDisplay.HoverCardPreview,
@@ -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: "28.4.0",
20
+ packageVersion: "29.0.0",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -1 +1,5 @@
1
+ /**
2
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)}
3
+ * Remove access from entrypoint /client and use `@atlaskit/link-provider`
4
+ **/
1
5
  export { CardClient as default } from '@atlaskit/link-provider';
@@ -1,14 +1,33 @@
1
- export { SmartCardProvider as Provider, SmartCardContext, useSmartLinkAnalytics } from './state';
1
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
2
+
3
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
4
+ export { SmartCardProvider as Provider, SmartCardContext } from './state';
5
+
6
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
7
+
8
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
9
+
10
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
2
11
  export { APIError } from '@atlaskit/linking-common';
12
+
13
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
3
14
  export { CardClient as Client } from '@atlaskit/link-provider';
4
15
  export { Card } from './view/Card';
5
16
  export { CardAction } from './view/Card/types';
17
+
18
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
6
19
  export { SmartCardContext as Context } from '@atlaskit/link-provider';
20
+
21
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
22
+
7
23
  export { EmbedResizeMessageListener } from './view/EmbedCard/EmbedResizeMessageListener';
8
24
  export { ExpandedFrame } from './view/EmbedCard/components/ExpandedFrame';
9
25
  export { embedHeaderHeight } from './view/EmbedCard/components/styled';
10
26
  export { SmartLinkEvents } from './utils/analytics/analytics';
27
+
28
+ // This hook should be migrated to /hooks entrypoint
11
29
  export { useSmartLinkEvents } from './view/SmartLinkEvents/useSmartLinkEvents';
30
+
12
31
  // Classnames for integrators
13
32
  export { contentFooterClassName, metadataListClassName, blockCardResolvingViewClassName, blockCardResolvedViewClassName, blockCardForbiddenViewClassName, blockCardIconImageClassName, blockCardResolvedViewByClassName, blockCardForbiddenViewLinkClassName, blockCardContentClassName, blockCardContentHeaderClassName, blockCardContentHeaderNameClassName, blockCardNotFoundViewClassName, blockCardErroredViewClassName } from './classNames';
14
33
  export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/LazyFallback';
@@ -21,20 +21,16 @@ const applyCommonAttributes = (event, commonAttributes) => {
21
21
  * This hook provides usage of Smart Link analytics outside of the Card component.
22
22
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
23
23
  *
24
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
25
- * This hook's external use is deprecated and may no longer be exported from this package in future releases.
26
- * Please avoid using it in conjunction with the `analyticsEvents` prop.
27
- *
28
24
  * @param url URL of the link
29
25
  * @param dispatchAnalytics dispatchAnalytics function
30
26
  * @param id fallback id of the events sent if no id is available
31
27
  * @param defaultLocation location attribute to be used
32
28
  * @returns
33
29
  */
34
- export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocation) => {
30
+ export const useSmartLinkAnalytics = (url, id, defaultLocation) => {
35
31
  const {
36
32
  dispatchAnalytics
37
- } = useDispatchAnalytics(_dispatchAnalytics);
33
+ } = useDispatchAnalytics();
38
34
  const defaultId = id || 'NULL';
39
35
  // We don't want to trigger a re-render by using useSmartCardState
40
36
  const {
@@ -235,7 +231,6 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
235
231
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
236
232
  * @param actionType The type of the action that was clicked, e.g. PreviewAction
237
233
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
238
- * @param invokeType @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
239
234
  * @returns
240
235
  */
241
236
  actionClickedEvent: ({
@@ -730,11 +725,6 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
730
725
  extensionKey,
731
726
  location
732
727
  }), commonAttributes)),
733
- /**
734
- * Removed in EDM-5153: This is an even from an experiment.
735
- * @deprecated
736
- */
737
- linkUpdated: () => {},
738
728
  /**
739
729
  * This fires a tracking event before an action invoke api call is made
740
730
  */
@@ -5,17 +5,12 @@ import { useSmartLinkConfig } from '../config';
5
5
  import { useSmartLinkAnalytics } from '../analytics';
6
6
  import { useSmartLinkRenderers } from '../renderers';
7
7
  import { useSmartLinkContext } from '@atlaskit/link-provider';
8
- export function useSmartLink(id, url,
9
- /**
10
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
11
- * Avoid prop drilling analytics handlers. Continue passing a handler for now if there's already one in place.
12
- */
13
- dispatchAnalytics) {
8
+ export function useSmartLink(id, url) {
14
9
  const state = useSmartLinkState(url);
15
10
  const {
16
11
  store
17
12
  } = useSmartLinkContext();
18
- const analytics = useSmartLinkAnalytics(url, dispatchAnalytics, id);
13
+ const analytics = useSmartLinkAnalytics(url, id);
19
14
  const actions = useSmartLinkActions(id, url, analytics);
20
15
  const config = useSmartLinkConfig();
21
16
  const renderers = useSmartLinkRenderers();
@@ -8,14 +8,13 @@ import { getExtensionKey } from '../helpers';
8
8
  export function useSmartLinkActions({
9
9
  url,
10
10
  appearance,
11
- analyticsHandler,
12
11
  platform = 'web',
13
12
  origin,
14
13
  actionOptions
15
14
  }) {
16
15
  const id = useMemo(() => uuid(), []);
17
16
  const linkState = useLinkState(url);
18
- const linkAnalytics = useLinkAnalytics(url, analyticsHandler, id);
17
+ const linkAnalytics = useLinkAnalytics(url, id);
19
18
  const linkActions = useLinkActions(id, url, linkAnalytics);
20
19
  if (linkState.details && !(actionOptions !== null && actionOptions !== void 0 && actionOptions.hide)) {
21
20
  const cardProperties = extractCardProps(linkState.details.data, linkState.details.meta, {
@@ -8,11 +8,10 @@ import { useSmartLinkAnalytics as useLinkAnalytics } from '../analytics';
8
8
  * @returns
9
9
  */
10
10
  export function useSmartLinkReload({
11
- url,
12
- analyticsHandler
11
+ url
13
12
  }) {
14
13
  const id = useMemo(() => uuid(), []);
15
- const linkAnalytics = useLinkAnalytics(url, analyticsHandler, id);
14
+ const linkAnalytics = useLinkAnalytics(url, id);
16
15
  const linkActions = useLinkActions(id, url, linkAnalytics);
17
16
  return linkActions.reload;
18
17
  }
@@ -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: "28.4.0"
7
+ packageVersion: "29.0.0"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -157,19 +157,6 @@ export const openUrl = async url => {
157
157
  window.open(url, '_blank', 'noopener=yes');
158
158
  };
159
159
 
160
- /**
161
- * Migrate internal usages of the deprecated isFrameVisible to frameStyle
162
- * This function is to be removed on deprecation of isFrameVisible.
163
- */
164
- export const combineFrameStyle = (frameStyle, isFrameVisible) => {
165
- if (frameStyle !== undefined) {
166
- return frameStyle;
167
- }
168
- if (isFrameVisible) {
169
- return 'show';
170
- }
171
- };
172
-
173
160
  /**
174
161
  * Append a theme to the URL if it exists
175
162
  * @param previewUrl
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useCallback, useMemo } from 'react';
2
2
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
3
  import { SmartLinkModalProvider } from '../../state/modal';
4
- import { combineFrameStyle, isSpecialEvent } from '../../utils';
4
+ import { isSpecialEvent } from '../../utils';
5
5
  import * as measure from '../../utils/performance';
6
6
  import { getDefinitionId, getServices, isFinalState, getClickUrl, getResourceType, getExtensionKey, getSubproduct, getProduct, getCanBeDatasource } from '../../state/helpers';
7
7
  import { useSmartLink } from '../../state';
@@ -19,12 +19,10 @@ function Component({
19
19
  url,
20
20
  isSelected,
21
21
  isHovered,
22
- isFrameVisible,
23
- frameStyle: frameStyleProp,
22
+ frameStyle,
24
23
  platform,
25
24
  onClick,
26
25
  appearance,
27
- dispatchAnalytics,
28
26
  onResolve,
29
27
  onError,
30
28
  testId,
@@ -56,7 +54,7 @@ function Component({
56
54
  config,
57
55
  renderers,
58
56
  error
59
- } = useSmartLink(id, url, dispatchAnalytics);
57
+ } = useSmartLink(id, url);
60
58
  const analytics = analyticsEvents || defaultAnalytics;
61
59
  const definitionId = getDefinitionId(state.details);
62
60
  const extensionKey = getExtensionKey(state.details);
@@ -70,7 +68,6 @@ function Component({
70
68
  actionOptions: actionOptionsProp,
71
69
  platform
72
70
  });
73
- const frameStyle = combineFrameStyle(frameStyleProp, isFrameVisible);
74
71
 
75
72
  // Setup UI handlers.
76
73
  const handleClickWrapper = useCallback(event => {
@@ -22,7 +22,6 @@ export function CardWithURLRenderer(props) {
22
22
  appearance,
23
23
  isSelected,
24
24
  isHovered,
25
- isFrameVisible,
26
25
  frameStyle,
27
26
  onClick,
28
27
  container,
@@ -40,7 +39,6 @@ export function CardWithURLRenderer(props) {
40
39
  showHoverPreview,
41
40
  hoverPreviewOptions,
42
41
  showAuthTooltip,
43
- analyticsEvents,
44
42
  placeholder,
45
43
  fallbackComponent,
46
44
  useLegacyBlockCard,
@@ -48,7 +46,7 @@ export function CardWithURLRenderer(props) {
48
46
  resolvingPlaceholder,
49
47
  truncateInline
50
48
  } = props;
51
- const analytics = useSmartLinkAnalytics(url !== null && url !== void 0 ? url : '', undefined, id);
49
+ const analytics = useSmartLinkAnalytics(url !== null && url !== void 0 ? url : '', id);
52
50
  const isFlexibleUi = isFlexibleUiCard(children);
53
51
  const errorHandler = useCallback((error, info) => {
54
52
  const {
@@ -95,7 +93,6 @@ export function CardWithURLRenderer(props) {
95
93
  onClick,
96
94
  isSelected,
97
95
  isHovered,
98
- isFrameVisible,
99
96
  frameStyle,
100
97
  container,
101
98
  onResolve,
@@ -111,7 +108,6 @@ export function CardWithURLRenderer(props) {
111
108
  showHoverPreview,
112
109
  hoverPreviewOptions,
113
110
  showAuthTooltip,
114
- analyticsEvents,
115
111
  placeholder,
116
112
  useLegacyBlockCard,
117
113
  removeTextHighlightingFromTitle,
@@ -7,8 +7,13 @@ import _extends from "@babel/runtime/helpers/extends";
7
7
  import { jsx } from '@emotion/react';
8
8
  import { useCallback, useMemo, useState } from 'react';
9
9
  import Lozenge from '@atlaskit/lozenge';
10
- import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
10
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
11
11
  import { triggerButtonStyles, triggerLozengeStyles } from '../styled';
12
+ import { Box, xcss } from '@atlaskit/primitives';
13
+ const chevronDownStyles = xcss({
14
+ marginLeft: 'space.075',
15
+ display: 'flex'
16
+ });
12
17
  const LozengeActionTrigger = ({
13
18
  appearance,
14
19
  isOpen,
@@ -25,10 +30,15 @@ const LozengeActionTrigger = ({
25
30
  isBold: isBold
26
31
  }, jsx("span", {
27
32
  css: triggerLozengeStyles
28
- }, jsx("span", null, text), jsx(ChevronDownIcon, {
33
+ }, jsx("span", null, text), jsx(Box, {
34
+ as: "span",
35
+ xcss: chevronDownStyles
36
+ }, jsx(ChevronDownIcon, {
37
+ color: "currentColor",
29
38
  label: "options",
30
- size: "medium"
31
- }))), [appearance, isBold, text]);
39
+ LEGACY_size: "medium",
40
+ LEGACY_margin: "-4px -8px -4px -7px"
41
+ })))), [appearance, isBold, text]);
32
42
  return jsx("button", _extends({
33
43
  type: "button"
34
44
  }, props, {
@@ -27,11 +27,7 @@ export const triggerButtonStyles = css({
27
27
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
28
28
  export const triggerLozengeStyles = css({
29
29
  alignItems: 'center',
30
- display: 'flex',
31
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
32
- "span[role='img']": {
33
- margin: `${"var(--ds-space-negative-050, -4px)"} ${"var(--ds-space-negative-100, -8px)"} ${"var(--ds-space-negative-050, -4px)"} -1px`
34
- }
30
+ display: 'flex'
35
31
  });
36
32
 
37
33
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766