@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
@@ -46,7 +46,7 @@ export const HoverCardComponent = ({
46
46
  const parentSpan = useRef(null);
47
47
  const renderers = useSmartLinkRenderers();
48
48
  const linkState = useLinkState(url);
49
- const analytics = useSmartLinkAnalytics(url, undefined, id);
49
+ const analytics = useSmartLinkAnalytics(url, id);
50
50
  const {
51
51
  loadMetadata
52
52
  } = useSmartCardActions(id, url, analytics);
@@ -38,7 +38,7 @@ const HoverCardContent = ({
38
38
  const {
39
39
  createAnalyticsEvent
40
40
  } = useAnalyticsEvents();
41
- const defaultAnalytics = useSmartLinkAnalytics(url, undefined, id);
41
+ const defaultAnalytics = useSmartLinkAnalytics(url, id);
42
42
  const analytics = _analytics !== null && _analytics !== void 0 ? _analytics : defaultAnalytics;
43
43
  const extensionKey = useMemo(() => getExtensionKey(cardState.details), [cardState.details]);
44
44
  const linkState = useSmartCardState(url);
@@ -18,7 +18,7 @@ const HoverCardWithErrorBoundary = props => {
18
18
  id,
19
19
  children
20
20
  } = props;
21
- const analytics = useSmartLinkAnalytics(url, undefined, id);
21
+ const analytics = useSmartLinkAnalytics(url, id);
22
22
  const onError = useCallback((error, info) => {
23
23
  analytics.ui.renderFailedEvent({
24
24
  display: CardDisplay.HoverCardPreview,
@@ -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: "28.4.0",
10
+ packageVersion: "29.0.0",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = 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';
package/dist/esm/index.js CHANGED
@@ -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';
@@ -28,18 +28,14 @@ var applyCommonAttributes = function applyCommonAttributes(event, commonAttribut
28
28
  * This hook provides usage of Smart Link analytics outside of the Card component.
29
29
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
30
30
  *
31
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
32
- * This hook's external use is deprecated and may no longer be exported from this package in future releases.
33
- * Please avoid using it in conjunction with the `analyticsEvents` prop.
34
- *
35
31
  * @param url URL of the link
36
32
  * @param dispatchAnalytics dispatchAnalytics function
37
33
  * @param id fallback id of the events sent if no id is available
38
34
  * @param defaultLocation location attribute to be used
39
35
  * @returns
40
36
  */
41
- export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, _dispatchAnalytics, id, defaultLocation) {
42
- var _useDispatchAnalytics = useDispatchAnalytics(_dispatchAnalytics),
37
+ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defaultLocation) {
38
+ var _useDispatchAnalytics = useDispatchAnalytics(),
43
39
  dispatchAnalytics = _useDispatchAnalytics.dispatchAnalytics;
44
40
  var defaultId = id || 'NULL';
45
41
  // We don't want to trigger a re-render by using useSmartCardState
@@ -247,7 +243,6 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, _dispatch
247
243
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
248
244
  * @param actionType The type of the action that was clicked, e.g. PreviewAction
249
245
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
250
- * @param invokeType @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
251
246
  * @returns
252
247
  */
253
248
  actionClickedEvent: function actionClickedEvent(_ref6) {
@@ -746,11 +741,6 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, _dispatch
746
741
  location: location
747
742
  })), commonAttributes));
748
743
  },
749
- /**
750
- * Removed in EDM-5153: This is an even from an experiment.
751
- * @deprecated
752
- */
753
- linkUpdated: function linkUpdated() {},
754
744
  /**
755
745
  * This fires a tracking event before an action invoke api call is made
756
746
  */
@@ -6,16 +6,11 @@ import { useSmartLinkConfig } from '../config';
6
6
  import { useSmartLinkAnalytics } from '../analytics';
7
7
  import { useSmartLinkRenderers } from '../renderers';
8
8
  import { useSmartLinkContext } from '@atlaskit/link-provider';
9
- export function useSmartLink(id, url,
10
- /**
11
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
12
- * Avoid prop drilling analytics handlers. Continue passing a handler for now if there's already one in place.
13
- */
14
- dispatchAnalytics) {
9
+ export function useSmartLink(id, url) {
15
10
  var state = useSmartLinkState(url);
16
11
  var _useSmartLinkContext = useSmartLinkContext(),
17
12
  store = _useSmartLinkContext.store;
18
- var analytics = useSmartLinkAnalytics(url, dispatchAnalytics, id);
13
+ var analytics = useSmartLinkAnalytics(url, id);
19
14
  var actions = useSmartLinkActions(id, url, analytics);
20
15
  var config = useSmartLinkConfig();
21
16
  var renderers = useSmartLinkRenderers();
@@ -8,7 +8,6 @@ import { getExtensionKey } from '../helpers';
8
8
  export function useSmartLinkActions(_ref) {
9
9
  var url = _ref.url,
10
10
  appearance = _ref.appearance,
11
- analyticsHandler = _ref.analyticsHandler,
12
11
  _ref$platform = _ref.platform,
13
12
  platform = _ref$platform === void 0 ? 'web' : _ref$platform,
14
13
  origin = _ref.origin,
@@ -17,7 +16,7 @@ export function useSmartLinkActions(_ref) {
17
16
  return uuid();
18
17
  }, []);
19
18
  var linkState = useLinkState(url);
20
- var linkAnalytics = useLinkAnalytics(url, analyticsHandler, id);
19
+ var linkAnalytics = useLinkAnalytics(url, id);
21
20
  var linkActions = useLinkActions(id, url, linkAnalytics);
22
21
  if (linkState.details && !(actionOptions !== null && actionOptions !== void 0 && actionOptions.hide)) {
23
22
  var cardProperties = extractCardProps(linkState.details.data, linkState.details.meta, {
@@ -8,12 +8,11 @@ import { useSmartLinkAnalytics as useLinkAnalytics } from '../analytics';
8
8
  * @returns
9
9
  */
10
10
  export function useSmartLinkReload(_ref) {
11
- var url = _ref.url,
12
- analyticsHandler = _ref.analyticsHandler;
11
+ var url = _ref.url;
13
12
  var id = useMemo(function () {
14
13
  return uuid();
15
14
  }, []);
16
- var linkAnalytics = useLinkAnalytics(url, analyticsHandler, id);
15
+ var linkAnalytics = useLinkAnalytics(url, id);
17
16
  var linkActions = useLinkActions(id, url, linkAnalytics);
18
17
  return linkActions.reload;
19
18
  }
@@ -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: "28.4.0"
18
+ packageVersion: "29.0.0"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -344,19 +344,6 @@ export var openUrl = /*#__PURE__*/function () {
344
344
  };
345
345
  }();
346
346
 
347
- /**
348
- * Migrate internal usages of the deprecated isFrameVisible to frameStyle
349
- * This function is to be removed on deprecation of isFrameVisible.
350
- */
351
- export var combineFrameStyle = function combineFrameStyle(frameStyle, isFrameVisible) {
352
- if (frameStyle !== undefined) {
353
- return frameStyle;
354
- }
355
- if (isFrameVisible) {
356
- return 'show';
357
- }
358
- };
359
-
360
347
  /**
361
348
  * Append a theme to the URL if it exists
362
349
  * @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(_ref) {
19
19
  url = _ref.url,
20
20
  isSelected = _ref.isSelected,
21
21
  isHovered = _ref.isHovered,
22
- isFrameVisible = _ref.isFrameVisible,
23
- frameStyleProp = _ref.frameStyle,
22
+ frameStyle = _ref.frameStyle,
24
23
  platform = _ref.platform,
25
24
  onClick = _ref.onClick,
26
25
  appearance = _ref.appearance,
27
- dispatchAnalytics = _ref.dispatchAnalytics,
28
26
  onResolve = _ref.onResolve,
29
27
  onError = _ref.onError,
30
28
  testId = _ref.testId,
@@ -47,7 +45,7 @@ function Component(_ref) {
47
45
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
48
46
 
49
47
  // Get state, actions for this card.
50
- var _useSmartLink = useSmartLink(id, url, dispatchAnalytics),
48
+ var _useSmartLink = useSmartLink(id, url),
51
49
  state = _useSmartLink.state,
52
50
  actions = _useSmartLink.actions,
53
51
  defaultAnalytics = _useSmartLink.analytics,
@@ -69,7 +67,6 @@ function Component(_ref) {
69
67
  actionOptions: actionOptionsProp,
70
68
  platform: platform
71
69
  });
72
- var frameStyle = combineFrameStyle(frameStyleProp, isFrameVisible);
73
70
 
74
71
  // Setup UI handlers.
75
72
  var handleClickWrapper = useCallback(function (event) {
@@ -30,7 +30,6 @@ export function CardWithURLRenderer(props) {
30
30
  appearance = props.appearance,
31
31
  isSelected = props.isSelected,
32
32
  isHovered = props.isHovered,
33
- isFrameVisible = props.isFrameVisible,
34
33
  frameStyle = props.frameStyle,
35
34
  onClick = props.onClick,
36
35
  container = props.container,
@@ -48,14 +47,13 @@ export function CardWithURLRenderer(props) {
48
47
  showHoverPreview = props.showHoverPreview,
49
48
  hoverPreviewOptions = props.hoverPreviewOptions,
50
49
  showAuthTooltip = props.showAuthTooltip,
51
- analyticsEvents = props.analyticsEvents,
52
50
  placeholder = props.placeholder,
53
51
  fallbackComponent = props.fallbackComponent,
54
52
  useLegacyBlockCard = props.useLegacyBlockCard,
55
53
  removeTextHighlightingFromTitle = props.removeTextHighlightingFromTitle,
56
54
  resolvingPlaceholder = props.resolvingPlaceholder,
57
55
  truncateInline = props.truncateInline;
58
- var analytics = useSmartLinkAnalytics(url !== null && url !== void 0 ? url : '', undefined, id);
56
+ var analytics = useSmartLinkAnalytics(url !== null && url !== void 0 ? url : '', id);
59
57
  var isFlexibleUi = isFlexibleUiCard(children);
60
58
  var errorHandler = useCallback(function (error, info) {
61
59
  var componentStack = info.componentStack;
@@ -104,7 +102,6 @@ export function CardWithURLRenderer(props) {
104
102
  onClick: onClick,
105
103
  isSelected: isSelected,
106
104
  isHovered: isHovered,
107
- isFrameVisible: isFrameVisible,
108
105
  frameStyle: frameStyle,
109
106
  container: container,
110
107
  onResolve: onResolve,
@@ -120,7 +117,6 @@ export function CardWithURLRenderer(props) {
120
117
  showHoverPreview: showHoverPreview,
121
118
  hoverPreviewOptions: hoverPreviewOptions,
122
119
  showAuthTooltip: showAuthTooltip,
123
- analyticsEvents: analyticsEvents,
124
120
  placeholder: placeholder,
125
121
  useLegacyBlockCard: useLegacyBlockCard,
126
122
  removeTextHighlightingFromTitle: removeTextHighlightingFromTitle,
@@ -10,8 +10,13 @@ var _excluded = ["appearance", "isOpen", "testId", "text", "triggerRef"];
10
10
  import { jsx } from '@emotion/react';
11
11
  import { useCallback, useMemo, useState } from 'react';
12
12
  import Lozenge from '@atlaskit/lozenge';
13
- import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
13
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
14
14
  import { triggerButtonStyles, triggerLozengeStyles } from '../styled';
15
+ import { Box, xcss } from '@atlaskit/primitives';
16
+ var chevronDownStyles = xcss({
17
+ marginLeft: 'space.075',
18
+ display: 'flex'
19
+ });
15
20
  var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
16
21
  var appearance = _ref.appearance,
17
22
  isOpen = _ref.isOpen,
@@ -35,10 +40,15 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
35
40
  isBold: isBold
36
41
  }, jsx("span", {
37
42
  css: triggerLozengeStyles
38
- }, jsx("span", null, text), jsx(ChevronDownIcon, {
43
+ }, jsx("span", null, text), jsx(Box, {
44
+ as: "span",
45
+ xcss: chevronDownStyles
46
+ }, jsx(ChevronDownIcon, {
47
+ color: "currentColor",
39
48
  label: "options",
40
- size: "medium"
41
- })));
49
+ LEGACY_size: "medium",
50
+ LEGACY_margin: "-4px -8px -4px -7px"
51
+ }))));
42
52
  }, [appearance, isBold, text]);
43
53
  return jsx("button", _extends({
44
54
  type: "button"
@@ -27,11 +27,7 @@ export var 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 var 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)".concat(" ", "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
@@ -56,7 +56,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
56
56
  var parentSpan = useRef(null);
57
57
  var renderers = useSmartLinkRenderers();
58
58
  var linkState = useLinkState(url);
59
- var analytics = useSmartLinkAnalytics(url, undefined, id);
59
+ var analytics = useSmartLinkAnalytics(url, id);
60
60
  var _useSmartCardActions = useSmartCardActions(id, url, analytics),
61
61
  loadMetadata = _useSmartCardActions.loadMetadata;
62
62
  var actionOptions = combineActionOptions({
@@ -37,7 +37,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
37
37
  actionOptions = _ref.actionOptions;
38
38
  var _useAnalyticsEvents = useAnalyticsEvents(),
39
39
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
40
- var defaultAnalytics = useSmartLinkAnalytics(url, undefined, id);
40
+ var defaultAnalytics = useSmartLinkAnalytics(url, id);
41
41
  var analytics = _analytics !== null && _analytics !== void 0 ? _analytics : defaultAnalytics;
42
42
  var extensionKey = useMemo(function () {
43
43
  return getExtensionKey(cardState.details);
@@ -16,7 +16,7 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
16
16
  var url = props.url,
17
17
  id = props.id,
18
18
  children = props.children;
19
- var analytics = useSmartLinkAnalytics(url, undefined, id);
19
+ var analytics = useSmartLinkAnalytics(url, id);
20
20
  var onError = useCallback(function (error, info) {
21
21
  analytics.ui.renderFailedEvent({
22
22
  display: CardDisplay.HoverCardPreview,
@@ -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: "28.4.0",
13
+ packageVersion: "29.0.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = 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,22 @@
1
1
  import { type JsonLd } from 'json-ld-types';
2
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
2
3
  export type ResolveResponse = JsonLd.Response;
3
- export { SmartCardProvider as Provider, SmartCardContext, useSmartLinkAnalytics } from './state';
4
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
5
+ export { SmartCardProvider as Provider, SmartCardContext } from './state';
6
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
4
7
  export type { ProviderProps, CardType } from './state';
8
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
5
9
  export type { CardAdf, InlineCardAdf, BlockCardAdf, EmbedCardAdf, DatasourceAdf, DatasourceAdfView, } from '@atlaskit/linking-common';
10
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
6
11
  export { APIError } from '@atlaskit/linking-common';
12
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
7
13
  export { CardClient as Client } from '@atlaskit/link-provider';
8
14
  export { Card } from './view/Card';
9
15
  export type { CardProps, CardAppearance, CardPlatform } from './view/Card';
10
16
  export { CardAction } from './view/Card/types';
17
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
11
18
  export { SmartCardContext as Context } from '@atlaskit/link-provider';
19
+ /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
12
20
  export type { CardContext } from '@atlaskit/link-provider';
13
21
  export { EmbedResizeMessageListener } from './view/EmbedCard/EmbedResizeMessageListener';
14
22
  export { ExpandedFrame } from './view/EmbedCard/components/ExpandedFrame';
@@ -1,4 +1,4 @@
1
- import { type AnalyticsHandler, type AnalyticsName, type AnalyticsPayload } from '../../utils/types';
1
+ import { type AnalyticsName, type AnalyticsPayload } from '../../utils/types';
2
2
  import { type ConnectFailedEventProps, type ConnectSucceededEventProps, type InstrumentEventProps, type InvokeFailedEventProps, type InvokeSucceededEventProps, type ScreenAuthPopupEventProps, type TrackAppAccountConnectedProps, type UiActionClickedEventProps, type UiAuthAlternateAccountEventProps, type UiAuthEventProps, type UiCardClickedEventProps, type UiClosedAuthEventProps, type UiHoverCardDismissedEventProps, type UiHoverCardOpenLinkClickedEventProps, type UiHoverCardViewedEventProps, type UiIframeDwelledEventProps, type UiIframeFocusedEventProps, type UiRenderFailedEventProps, type UiRenderSuccessEventProps, type UiServerActionClickedEventProps } from '../../utils/analytics/types';
3
3
  import { type TrackQuickActionFailureReason, type TrackQuickActionType } from '../../utils/analytics/analytics';
4
4
  import { type SmartLinkActionType } from '@atlaskit/linking-types';
@@ -6,17 +6,13 @@ import { type SmartLinkActionType } from '@atlaskit/linking-types';
6
6
  * This hook provides usage of Smart Link analytics outside of the Card component.
7
7
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
8
8
  *
9
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
10
- * This hook's external use is deprecated and may no longer be exported from this package in future releases.
11
- * Please avoid using it in conjunction with the `analyticsEvents` prop.
12
- *
13
9
  * @param url URL of the link
14
10
  * @param dispatchAnalytics dispatchAnalytics function
15
11
  * @param id fallback id of the events sent if no id is available
16
12
  * @param defaultLocation location attribute to be used
17
13
  * @returns
18
14
  */
19
- export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: AnalyticsHandler, id?: string, defaultLocation?: string) => {
15
+ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLocation?: string) => {
20
16
  ui: {
21
17
  /**
22
18
  * This fires an event that represents when a user clicks on the authentication
@@ -90,7 +86,6 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
90
86
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
91
87
  * @param actionType The type of the action that was clicked, e.g. PreviewAction
92
88
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
93
- * @param invokeType @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
94
89
  * @returns
95
90
  */
96
91
  actionClickedEvent: ({ id, actionType, display, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => void;
@@ -242,11 +237,6 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
242
237
  * @returns
243
238
  */
244
239
  appAccountAuthStarted: ({ extensionKey, location }: TrackAppAccountConnectedProps) => void;
245
- /**
246
- * Removed in EDM-5153: This is an even from an experiment.
247
- * @deprecated
248
- */
249
- linkUpdated: () => void;
250
240
  /**
251
241
  * This fires a tracking event before an action invoke api call is made
252
242
  */
@@ -1,10 +1,4 @@
1
- import { type AnalyticsHandler } from '../../utils/types';
2
- export declare function useSmartLink(id: string, url: string,
3
- /**
4
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
5
- * Avoid prop drilling analytics handlers. Continue passing a handler for now if there's already one in place.
6
- */
7
- dispatchAnalytics?: AnalyticsHandler): {
1
+ export declare function useSmartLink(id: string, url: string): {
8
2
  state: import("@atlaskit/linking-common").CardState;
9
3
  actions: {
10
4
  register: () => Promise<void>;
@@ -18,7 +12,7 @@ dispatchAnalytics?: AnalyticsHandler): {
18
12
  ui: {
19
13
  authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiAuthEventProps) => void;
20
14
  authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiAuthAlternateAccountEventProps) => void;
21
- buttonClickedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
15
+ buttonClickedEvent: (data: Partial<import("../..").AnalyticsPayload> & {
22
16
  actionSubjectId: string;
23
17
  }) => void;
24
18
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../utils/analytics/types").UiCardClickedEventProps) => void;
@@ -27,7 +21,7 @@ dispatchAnalytics?: AnalyticsHandler): {
27
21
  actionClickedEvent: ({ id, actionType, display, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
28
22
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
29
23
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiClosedAuthEventProps) => void;
30
- modalClosedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
24
+ modalClosedEvent: (data: Partial<import("../..").AnalyticsPayload> & {
31
25
  actionSubjectId: string;
32
26
  }) => void;
33
27
  renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, canBeDatasource, }: import("../../utils/analytics/types").UiRenderSuccessEventProps) => void;
@@ -51,7 +45,6 @@ dispatchAnalytics?: AnalyticsHandler): {
51
45
  track: {
52
46
  appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
53
47
  appAccountAuthStarted: ({ extensionKey, location }: import("../../utils/analytics/types").CommonEventProps) => void;
54
- linkUpdated: () => void;
55
48
  smartLinkQuickActionStarted: (props: {
56
49
  smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
57
50
  }) => void;
@@ -67,7 +60,7 @@ dispatchAnalytics?: AnalyticsHandler): {
67
60
  };
68
61
  screen: {
69
62
  authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
70
- modalViewedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
63
+ modalViewedEvent: (data: Partial<import("../..").AnalyticsPayload> & {
71
64
  name: "embedPreviewModal";
72
65
  }) => void;
73
66
  };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type JsonLd } from 'json-ld-types';
3
- import type { AnalyticsHandler, AnalyticsOrigin } from '../../utils/types';
3
+ import type { AnalyticsOrigin } from '../../utils/types';
4
4
  import type { CardActionOptions, CardInnerAppearance } from '../../view/Card/types';
5
5
  export interface LinkAction {
6
6
  /**
@@ -31,14 +31,6 @@ export interface UseSmartLinkActionsOpts {
31
31
  * @example `block` for card views.
32
32
  */
33
33
  appearance: CardInnerAppearance;
34
- /**
35
- * Callback for sending analytics events.
36
- * @description Accepts an analytics payload and fires it to a system.
37
- *
38
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
39
- * Overriding the analytics dispatch method is deprecated. Please omit this property.
40
- */
41
- analyticsHandler?: AnalyticsHandler;
42
34
  /**
43
35
  * Platform on which actions are being invoked.
44
36
  * @default 'web'
@@ -53,7 +45,7 @@ export interface UseSmartLinkActionsOpts {
53
45
  */
54
46
  actionOptions?: CardActionOptions;
55
47
  }
56
- export declare function useSmartLinkActions({ url, appearance, analyticsHandler, platform, origin, actionOptions, }: UseSmartLinkActionsOpts): {
48
+ export declare function useSmartLinkActions({ url, appearance, platform, origin, actionOptions, }: UseSmartLinkActionsOpts): {
57
49
  id: string;
58
50
  text: import("react").ReactNode;
59
51
  invoke: () => Promise<any>;
@@ -1,22 +1,13 @@
1
- import type { AnalyticsHandler } from '../../utils/types';
2
1
  export interface UseSmartLinkReloadOpts {
3
2
  /**
4
3
  * Smart Link URL for which the reload will be invoked.
5
4
  * @example https://start.atlassian.com
6
5
  */
7
6
  url: string;
8
- /**
9
- * Callback for sending analytics events.
10
- * @description Accepts an analytics payload and fires it to a system.
11
- *
12
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
13
- * Overriding the analytics dispatch method is deprecated. Please omit this property.
14
- */
15
- analyticsHandler?: AnalyticsHandler;
16
7
  }
17
8
  /**
18
9
  * Exposes a programmatic way to reload the data being used to render a Smart Link.
19
10
  * @param
20
11
  * @returns
21
12
  */
22
- export declare function useSmartLinkReload({ url, analyticsHandler }: UseSmartLinkReloadOpts): () => void;
13
+ export declare function useSmartLinkReload({ url }: UseSmartLinkReloadOpts): () => void;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { CardProps } from '../view/Card';
3
- import { type FrameStyle } from '../view/EmbedCard/types';
4
3
  import { type ActiveThemeState } from '@atlaskit/tokens';
5
4
  export declare const isCardWithData: (props: CardProps) => boolean;
6
5
  export declare const isSpecialEvent: (evt: React.MouseEvent | React.KeyboardEvent) => boolean;
@@ -25,11 +24,6 @@ export declare const sleep: (ms: number) => Promise<void>;
25
24
  export declare const importWithRetry: <T>(importFn: () => Promise<T>, retries?: number, interval?: number) => Promise<T>;
26
25
  export declare const downloadUrl: (url?: string) => Promise<void>;
27
26
  export declare const openUrl: (url?: string) => Promise<void>;
28
- /**
29
- * Migrate internal usages of the deprecated isFrameVisible to frameStyle
30
- * This function is to be removed on deprecation of isFrameVisible.
31
- */
32
- export declare const combineFrameStyle: (frameStyle?: CardProps['frameStyle'], isFrameVisible?: CardProps['isFrameVisible']) => FrameStyle | undefined;
33
27
  /**
34
28
  * Append a theme to the URL if it exists
35
29
  * @param previewUrl
@@ -126,7 +126,6 @@ export declare const mockAnalytics: {
126
126
  track: {
127
127
  appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").CommonEventProps) => void;
128
128
  appAccountAuthStarted: ({ extensionKey, location }: import("./analytics/types").CommonEventProps) => void;
129
- linkUpdated: () => void;
130
129
  smartLinkQuickActionStarted: (props: {
131
130
  smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
132
131
  }) => void;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { type CardAppearance, type CardPlatform, type CardProps } from './types';
3
3
  import { type WrappedComponentProps } from 'react-intl-next';
4
- export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "removeTextHighlightingFromTitle" | "resolvingPlaceholder" | "truncateInline" | "forwardedRef"> & React.RefAttributes<any>>;
4
+ export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "frameStyle" | "importer" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "useLegacyBlockCard" | "removeTextHighlightingFromTitle" | "resolvingPlaceholder" | "truncateInline" | "forwardedRef"> & React.RefAttributes<any>>;
5
5
  export type { CardAppearance, CardProps, CardPlatform };