@atlaskit/smart-card 45.23.3 → 45.24.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 (55) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/__tests__/vr-tests/__snapshots__/automation-modal-header/smart-card-automation-modal-header-title--default--platform-dst-modal-dialog-use-modal-title-false.png +3 -0
  3. package/dist/cjs/__tests__/vr-tests/__snapshots__/automation-modal-header/smart-card-automation-modal-header-title--default--platform-dst-modal-dialog-use-modal-title-true.png +3 -0
  4. package/dist/cjs/__tests__/vr-tests/__snapshots__/embedded-card-navigation/embedded-card-navigation-disabled--default.png +3 -0
  5. package/dist/cjs/__tests__/vr-tests/__snapshots__/embedded-card-navigation/embedded-card-navigation-enabled--default.png +3 -0
  6. package/dist/cjs/extractors/action/extract-invoke-preview-action.js +4 -4
  7. package/dist/cjs/linkProvider.js +3 -3
  8. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +2 -2
  9. package/dist/cjs/state/hooks/use-response/index.js +4 -4
  10. package/dist/cjs/utils/analytics/analytics.js +1 -1
  11. package/dist/cjs/view/CardWithUrl/component.js +19 -7
  12. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.js +22 -24
  13. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/TitleBlock.js +3 -2
  14. package/dist/cjs/view/FlexibleCard/components/container/index.js +9 -6
  15. package/dist/cjs/view/FlexibleCard/components/elements/title-element/index.js +8 -4
  16. package/dist/cjs/view/FlexibleCard/index.js +3 -1
  17. package/dist/cjs/view/LinkUrl/index.js +1 -1
  18. package/dist/es2019/__tests__/vr-tests/__snapshots__/automation-modal-header/smart-card-automation-modal-header-title--default--platform-dst-modal-dialog-use-modal-title-false.png +3 -0
  19. package/dist/es2019/__tests__/vr-tests/__snapshots__/automation-modal-header/smart-card-automation-modal-header-title--default--platform-dst-modal-dialog-use-modal-title-true.png +3 -0
  20. package/dist/es2019/__tests__/vr-tests/__snapshots__/embedded-card-navigation/embedded-card-navigation-disabled--default.png +3 -0
  21. package/dist/es2019/__tests__/vr-tests/__snapshots__/embedded-card-navigation/embedded-card-navigation-enabled--default.png +3 -0
  22. package/dist/es2019/extractors/action/extract-invoke-preview-action.js +1 -1
  23. package/dist/es2019/linkProvider.js +1 -1
  24. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +1 -1
  25. package/dist/es2019/state/hooks/use-response/index.js +1 -1
  26. package/dist/es2019/utils/analytics/analytics.js +1 -1
  27. package/dist/es2019/view/CardWithUrl/component.js +18 -7
  28. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.js +22 -24
  29. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/TitleBlock.js +3 -2
  30. package/dist/es2019/view/FlexibleCard/components/container/index.js +9 -6
  31. package/dist/es2019/view/FlexibleCard/components/elements/title-element/index.js +8 -4
  32. package/dist/es2019/view/FlexibleCard/index.js +3 -1
  33. package/dist/es2019/view/LinkUrl/index.js +1 -1
  34. package/dist/esm/__tests__/vr-tests/__snapshots__/automation-modal-header/smart-card-automation-modal-header-title--default--platform-dst-modal-dialog-use-modal-title-false.png +3 -0
  35. package/dist/esm/__tests__/vr-tests/__snapshots__/automation-modal-header/smart-card-automation-modal-header-title--default--platform-dst-modal-dialog-use-modal-title-true.png +3 -0
  36. package/dist/esm/__tests__/vr-tests/__snapshots__/embedded-card-navigation/embedded-card-navigation-disabled--default.png +3 -0
  37. package/dist/esm/__tests__/vr-tests/__snapshots__/embedded-card-navigation/embedded-card-navigation-enabled--default.png +3 -0
  38. package/dist/esm/extractors/action/extract-invoke-preview-action.js +1 -1
  39. package/dist/esm/linkProvider.js +1 -1
  40. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +1 -1
  41. package/dist/esm/state/hooks/use-response/index.js +1 -1
  42. package/dist/esm/utils/analytics/analytics.js +1 -1
  43. package/dist/esm/view/CardWithUrl/component.js +19 -7
  44. package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/header/main.js +22 -24
  45. package/dist/esm/view/FlexibleCard/components/blocks/title-block/TitleBlock.js +3 -2
  46. package/dist/esm/view/FlexibleCard/components/container/index.js +9 -6
  47. package/dist/esm/view/FlexibleCard/components/elements/title-element/index.js +8 -4
  48. package/dist/esm/view/FlexibleCard/index.js +3 -1
  49. package/dist/esm/view/LinkUrl/index.js +1 -1
  50. package/dist/types/linkProvider.d.ts +1 -1
  51. package/dist/types/state/flexible-ui-context/index.d.ts +2 -1
  52. package/dist/types/state/hooks/use-response/index.d.ts +1 -1
  53. package/dist/types/view/FlexibleCard/index.d.ts +1 -1
  54. package/dist/types/view/FlexibleCard/types.d.ts +5 -0
  55. package/package.json +12 -4
@@ -1,4 +1,5 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
2
+ import { useSmartLinkContext } from '@atlaskit/link-provider/context';
2
3
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next/useAnalyticsEvents';
3
4
  import { extractSmartLinkEmbed } from '@atlaskit/link-extractors/extract-smart-link-embed';
4
5
  import { fg } from '@atlaskit/platform-feature-flags/fg';
@@ -92,6 +93,10 @@ function Component({
92
93
  isPreviewPanelAvailable,
93
94
  openPreviewPanel
94
95
  } = useSmartLink(id, url, appearance);
96
+ const {
97
+ linkNavigation
98
+ } = useSmartLinkContext();
99
+ const resolveNavigation = fg('confluence_ep_shim_macro_links_v2') && isFlexibleUi ? linkNavigation : undefined;
95
100
  const ari = getObjectAri(state.details);
96
101
  const name = getObjectName(state.details);
97
102
  const definitionId = getDefinitionId(state.details);
@@ -122,9 +127,11 @@ function Component({
122
127
  const preferredUrl = (_getClickUrl = getClickUrl(url, state.details)) !== null && _getClickUrl !== void 0 ? _getClickUrl : url;
123
128
  return (_appendCrossProductAn = appendCrossProductAnalyticsParams(preferredUrl)) !== null && _appendCrossProductAn !== void 0 ? _appendCrossProductAn : preferredUrl;
124
129
  }, [appendCrossProductAnalyticsParams, state.details, url]);
130
+ const navigation = useMemo(() => resolveNavigation === null || resolveNavigation === void 0 ? void 0 : resolveNavigation(getDestinationUrl()), [getDestinationUrl, resolveNavigation]);
125
131
 
126
132
  // Setup UI handlers.
127
133
  const handleClickWrapper = useCallback(event => {
134
+ var _resolveNavigation$ur;
128
135
  const isModifierKeyPressed = isSpecialKey(event) || isSpecialClick(event);
129
136
  fireEvent('ui.smartLink.clicked', {
130
137
  id,
@@ -169,7 +176,7 @@ function Component({
169
176
  });
170
177
  return;
171
178
  }
172
- const destinationUrl = getDestinationUrl();
179
+ const destinationUrl = (_resolveNavigation$ur = resolveNavigation === null || resolveNavigation === void 0 ? void 0 : resolveNavigation(getDestinationUrl()).url) !== null && _resolveNavigation$ur !== void 0 ? _resolveNavigation$ur : getDestinationUrl();
173
180
  updateAnchorHref(event, destinationUrl);
174
181
 
175
182
  // For FlexibleCard, read target from the clicked anchor element (e.g. _blank for links
@@ -177,7 +184,8 @@ function Component({
177
184
  const {
178
185
  target: anchorTarget
179
186
  } = getAnchorAttributesFromEvent(event);
180
- const target = isSpecialEvent(event) ? '_blank' : isFlexibleUi ? anchorTarget : '_self';
187
+ const openInNewTab = resolveNavigation ? event.metaKey || event.ctrlKey || event.shiftKey || event.button === 1 : isSpecialEvent(event);
188
+ const target = openInNewTab ? '_blank' : isFlexibleUi ? anchorTarget : '_self';
181
189
  onClick === null || onClick === void 0 ? void 0 : onClick(event, {
182
190
  url,
183
191
  destinationUrl
@@ -204,12 +212,13 @@ function Component({
204
212
  clickOutcome: target === '_blank' ? 'clickThroughNewTabOrWindow' : 'clickThrough'
205
213
  }
206
214
  } : undefined);
207
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
215
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, resolveNavigation, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
208
216
 
209
217
  // Middle-click handler to trigger fire3PClickEvent on middle-clicks.
210
218
  // Scope is limited to 3P click analytics.
211
219
  const handleFrameAuxClick = useCallback(event => {
212
- const destinationUrl = getDestinationUrl();
220
+ var _resolveNavigation$ur2;
221
+ const destinationUrl = (_resolveNavigation$ur2 = resolveNavigation === null || resolveNavigation === void 0 ? void 0 : resolveNavigation(getDestinationUrl()).url) !== null && _resolveNavigation$ur2 !== void 0 ? _resolveNavigation$ur2 : getDestinationUrl();
213
222
  updateAnchorHref(event, destinationUrl);
214
223
 
215
224
  // isAuxClick filters Windows right-clicks (button === 2) that also fire onAuxClick.
@@ -218,19 +227,20 @@ function Component({
218
227
  isAuxClick: true
219
228
  });
220
229
  }
221
- }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
230
+ }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent, resolveNavigation]);
222
231
 
223
232
  // Right-click handler to trigger fire3PClickEvent on right-clicks.
224
233
  // Scope is limited to 3P click analytics.
225
234
  const handleFrameContextMenu = useCallback(event => {
226
- const destinationUrl = getDestinationUrl();
235
+ var _resolveNavigation$ur3;
236
+ const destinationUrl = (_resolveNavigation$ur3 = resolveNavigation === null || resolveNavigation === void 0 ? void 0 : resolveNavigation(getDestinationUrl()).url) !== null && _resolveNavigation$ur3 !== void 0 ? _resolveNavigation$ur3 : getDestinationUrl();
227
237
  updateAnchorHref(event, destinationUrl);
228
238
  if (shouldFire3PClickEvent) {
229
239
  fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent({
230
240
  isContextMenu: true
231
241
  });
232
242
  }
233
- }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
243
+ }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent, resolveNavigation]);
234
244
  const {
235
245
  reload
236
246
  } = actions;
@@ -363,6 +373,7 @@ function Component({
363
373
  return /*#__PURE__*/React.createElement(FlexibleCard, {
364
374
  id: id,
365
375
  cardState: cardState,
376
+ navigation: navigation,
366
377
  placeholderData: placeholderData,
367
378
  onAuthorize: services.length && handleAuthorize || undefined,
368
379
  onClick: handleClickWrapper,
@@ -6,7 +6,9 @@ import { defineMessages, useIntl } from 'react-intl';
6
6
  import Heading from '@atlaskit/heading/heading';
7
7
  import AutomationIcon from '@atlaskit/icon/core/automation';
8
8
  import ModalHeader from '@atlaskit/modal-dialog/modal-header';
9
+ import ModalTitle from '@atlaskit/modal-dialog/modal-title';
9
10
  import { useModal } from '@atlaskit/modal-dialog/hooks';
11
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
10
12
  import { Box, Inline, Stack } from '@atlaskit/primitives/compiled';
11
13
  import { useAutomationMenu } from '../../menu-context/useAutomationMenu';
12
14
  const styles = {
@@ -35,28 +37,24 @@ export const AutomationModalHeader = ({
35
37
  titleId
36
38
  } = useModal();
37
39
  const showDescription = initialised && rules.length > 0 && !!modalDescription;
38
- return (
39
- /*#__PURE__*/
40
- // eslint-disable-next-line @atlaskit/design-system/use-modal-title
41
- React.createElement(ModalHeader, {
42
- hasCloseButton: true
43
- }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Inline, {
44
- alignBlock: "center"
45
- }, /*#__PURE__*/React.createElement(Box, {
46
- xcss: styles.iconStyle
47
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
48
- ,
49
- backgroundColor: "color.background.accent.green.subtlest"
50
- }, /*#__PURE__*/React.createElement(AutomationIcon, {
51
- size: "small",
52
- label: formatMessage(i18n.modalHeaderIconLabel),
53
- color: "var(--ds-icon-accent-green, #22A06B)",
54
- spacing: "compact"
55
- })), /*#__PURE__*/React.createElement(Heading, {
56
- size: "medium",
57
- id: titleId
58
- }, modalTitle)), showDescription && /*#__PURE__*/React.createElement(Box, {
59
- xcss: styles.modalDescriptionStyle
60
- }, modalDescription)))
61
- );
40
+ return /*#__PURE__*/React.createElement(ModalHeader, {
41
+ hasCloseButton: true
42
+ }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Inline, {
43
+ alignBlock: "center"
44
+ }, /*#__PURE__*/React.createElement(Box, {
45
+ xcss: styles.iconStyle
46
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
47
+ ,
48
+ backgroundColor: "color.background.accent.green.subtlest"
49
+ }, /*#__PURE__*/React.createElement(AutomationIcon, {
50
+ size: "small",
51
+ label: formatMessage(i18n.modalHeaderIconLabel),
52
+ color: "var(--ds-icon-accent-green, #22A06B)",
53
+ spacing: "compact"
54
+ })), fg('platform_dst_modal-dialog-use-modal-title') ? /*#__PURE__*/React.createElement(ModalTitle, null, modalTitle) : /*#__PURE__*/React.createElement(Heading, {
55
+ size: "medium",
56
+ id: titleId
57
+ }, modalTitle)), showDescription && /*#__PURE__*/React.createElement(Box, {
58
+ xcss: styles.modalDescriptionStyle
59
+ }, modalDescription)));
62
60
  };
@@ -4,6 +4,7 @@ import "./TitleBlock.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { useCallback, useState } from 'react';
7
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
7
8
  import { SmartLinkStatus } from '../../../../../constants';
8
9
  import { useMouseDownEvent } from '../../../../../state/analytics/useMouseDownEvent';
9
10
  import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context/useFlexibleCardContext';
@@ -62,7 +63,7 @@ export const TitleBlock = ({
62
63
  hideIconLoadingSkeleton,
63
64
  ...props
64
65
  }) => {
65
- var _props$size;
66
+ var _cardContext$navigati, _props$size;
66
67
  const cardContext = useFlexibleCardContext();
67
68
  const {
68
69
  status = SmartLinkStatus.Fallback,
@@ -90,7 +91,7 @@ export const TitleBlock = ({
90
91
  hideTooltip: hideTitleTooltip,
91
92
  maxLines: maxLines,
92
93
  onMouseDown: onMouseDown,
93
- target: anchorTarget,
94
+ target: fg('confluence_ep_shim_macro_links_v2') ? anchorTarget !== null && anchorTarget !== void 0 ? anchorTarget : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$navigati = cardContext.navigation) === null || _cardContext$navigati === void 0 ? void 0 : _cardContext$navigati.target : anchorTarget,
94
95
  theme: ui === null || ui === void 0 ? void 0 : ui.theme,
95
96
  anchorRef: anchorRef
96
97
  }, overrideText));
@@ -5,8 +5,9 @@ import "./index.compiled.css";
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import React from 'react';
7
7
  import { di } from 'react-magnetic-di';
8
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
8
9
  import { SmartLinkSize } from '../../../../constants';
9
- import { useFlexibleUiContext } from '../../../../state/flexible-ui-context/useFlexibleUiContext';
10
+ import { useFlexibleCardContext } from '../../../../state/flexible-ui-context/useFlexibleCardContext';
10
11
  import { isFlexibleUiBlock } from '../../../../utils/is-flexible-ui-block';
11
12
  import { getChildrenOptions } from './getChildrenOptions';
12
13
  import { getFlexibleUiBlock } from './getFlexibleUiBlock';
@@ -24,7 +25,8 @@ const getTitleBlockProps = children => {
24
25
  return block.props;
25
26
  }
26
27
  };
27
- const getLayeredLink = (testId, context, children, onClick, onAuxClick, onContextMenu, title) => {
28
+ const getLayeredLink = (testId, context, children, onClick, onAuxClick, onContextMenu, title, navigation) => {
29
+ var _navigation$url;
28
30
  const {
29
31
  linkTitle,
30
32
  url = ''
@@ -40,10 +42,10 @@ const getLayeredLink = (testId, context, children, onClick, onAuxClick, onContex
40
42
  onClick: onClick,
41
43
  onAuxClick: onAuxClick,
42
44
  onContextMenu: onContextMenu,
43
- target: target,
45
+ target: fg('confluence_ep_shim_macro_links_v2') ? target !== null && target !== void 0 ? target : navigation === null || navigation === void 0 ? void 0 : navigation.target : target,
44
46
  testId: testId,
45
47
  text: title || text || (linkTitle === null || linkTitle === void 0 ? void 0 : linkTitle.text),
46
- url: url
48
+ url: fg('confluence_ep_shim_macro_links_v2') ? (_navigation$url = navigation === null || navigation === void 0 ? void 0 : navigation.url) !== null && _navigation$url !== void 0 ? _navigation$url : url : url
47
49
  });
48
50
  };
49
51
  const baseStyleCommon = null;
@@ -130,7 +132,8 @@ const Container = ({
130
132
  }) => {
131
133
  const padding = hidePadding ? '0px' : getPadding(size);
132
134
  const gap = getGap(size);
133
- const context = useFlexibleUiContext();
135
+ const cardContext = useFlexibleCardContext();
136
+ const context = cardContext === null || cardContext === void 0 ? void 0 : cardContext.data;
134
137
  const {
135
138
  previewOnLeft,
136
139
  previewOnRight
@@ -149,7 +152,7 @@ const Container = ({
149
152
  "--_73mooq": ix(previewOnLeft ? gap : padding),
150
153
  "--_12k13bg": ix(previewOnRight ? gap : padding)
151
154
  }
152
- }, clickableContainer ? getLayeredLink(testId, context, children, onClick, onAuxClick, onContextMenu, title) : null, filterChildren(children, removeBlockRestriction));
155
+ }, clickableContainer ? getLayeredLink(testId, context, children, onClick, onAuxClick, onContextMenu, title, cardContext === null || cardContext === void 0 ? void 0 : cardContext.navigation) : null, filterChildren(children, removeBlockRestriction));
153
156
  if (context !== null && context !== void 0 && context.url && canShowHoverCard) {
154
157
  return /*#__PURE__*/React.createElement(HoverCardControl, {
155
158
  isHoverPreview: isResolved || hasHoverCardOverride,
@@ -1,12 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
3
4
  import { ElementName } from '../../../../../constants';
4
- import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context/useFlexibleUiContext';
5
+ import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context/useFlexibleCardContext';
5
6
  import { BaseLinkElement } from '../common';
6
7
  const TitleElement = props => {
7
- const context = useFlexibleUiContext();
8
- const data = context ? context === null || context === void 0 ? void 0 : context.linkTitle : null;
9
- return data ? /*#__PURE__*/React.createElement(BaseLinkElement, _extends({}, data, props, {
8
+ var _context$data, _context$navigation$u, _context$navigation;
9
+ const context = useFlexibleCardContext();
10
+ const data = context === null || context === void 0 ? void 0 : (_context$data = context.data) === null || _context$data === void 0 ? void 0 : _context$data.linkTitle;
11
+ return data ? /*#__PURE__*/React.createElement(BaseLinkElement, _extends({}, data, {
12
+ url: fg('confluence_ep_shim_macro_links_v2') ? (_context$navigation$u = context === null || context === void 0 ? void 0 : (_context$navigation = context.navigation) === null || _context$navigation === void 0 ? void 0 : _context$navigation.url) !== null && _context$navigation$u !== void 0 ? _context$navigation$u : data.url : data.url
13
+ }, props, {
10
14
  name: ElementName.Title
11
15
  })) : null;
12
16
  };
@@ -23,6 +23,7 @@ const PENDING_LINK_STATUSES = [SmartLinkStatus.Pending, SmartLinkStatus.Resolvin
23
23
  */
24
24
  const FlexibleCard = ({
25
25
  appearance = 'flexible',
26
+ navigation,
26
27
  cardState,
27
28
  children,
28
29
  id,
@@ -97,9 +98,10 @@ const FlexibleCard = ({
97
98
  }), [aiSummaryConfig, appearance, actionOptions, details, id, isPreviewPanelAvailable, isPreviewRestricted, onAuthorize, onClick, onAuxClick, onContextMenu, openPreviewPanel, origin, placeholderCardState, placeHolderStatus, product, renderers, resolve, rovoConfig, status, transformUrl, url, fireEvent]);
98
99
  const flexibleCardContext = useMemo(() => ({
99
100
  data: context,
101
+ navigation: context ? navigation : undefined,
100
102
  status: placeHolderStatus !== null && placeHolderStatus !== void 0 ? placeHolderStatus : status,
101
103
  ui
102
- }), [context, placeHolderStatus, status, ui]);
104
+ }), [context, placeHolderStatus, status, ui, navigation]);
103
105
  const {
104
106
  linkTitle
105
107
  } = context || {};
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "45.23.2",
12
+ packageVersion: "45.23.4",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb149dfd34eb19b5ae45ff98125f78740c88f3a36eb6f298ddf8eb7a348ce88d
3
+ size 9626
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb149dfd34eb19b5ae45ff98125f78740c88f3a36eb6f298ddf8eb7a348ce88d
3
+ size 9626
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3bf5137534871b7834625122306426b6411c1b247903cc03e4ed869c2d4cc061
3
+ size 3322
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3bf5137534871b7834625122306426b6411c1b247903cc03e4ed869c2d4cc061
3
+ size 3322
@@ -9,7 +9,7 @@ import { extractSmartLinkEmbed } from '@atlaskit/link-extractors/extract-smart-l
9
9
  import { extractSmartLinkProvider } from '@atlaskit/link-extractors/extract-smart-link-provider';
10
10
  import { extractSmartLinkTitle } from '@atlaskit/link-extractors/extract-smart-link-title';
11
11
  import { extractSmartLinkUrl } from '@atlaskit/link-extractors/extract-smart-link-url';
12
- import { isWithinPreviewPanelIFrame } from '@atlaskit/linking-common/utils';
12
+ import { isWithinPreviewPanelIFrame } from '@atlaskit/linking-common/utils/is-within-preview-panel-iframe';
13
13
  import { fg } from '@atlaskit/platform-feature-flags/fg';
14
14
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
15
  import { ActionName, CardAction } from '../../constants';
@@ -1,2 +1,2 @@
1
1
  /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
2
- export { editorCardProvider, EditorCardProvider } from '@atlaskit/link-provider';
2
+ export { editorCardProvider, EditorCardProvider } from '@atlaskit/link-provider/editor';
@@ -12,7 +12,7 @@ function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symb
12
12
  function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(r) { var n = this.s.return; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, throw: function _throw(r) { var n = this.s.return; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
13
13
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
14
14
  import { v4 as uuid } from 'uuid';
15
- import { getBaseUrl } from '@atlaskit/linking-common';
15
+ import { getBaseUrl } from '@atlaskit/linking-common/get-base-url';
16
16
  import { readStream } from './readStream';
17
17
  import { ChunkProcessingError } from './types';
18
18
  import { addPath } from './addPath';
@@ -3,7 +3,7 @@ import { unstable_batchedUpdates } from 'react-dom';
3
3
  import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
4
4
  import { ACTION_ERROR, ACTION_ERROR_FALLBACK, ACTION_RELOADING, ACTION_RESOLVED, ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common/actions';
5
5
  import { getStatus } from '@atlaskit/linking-common/utils/get-status';
6
- import { APIError } from '@atlaskit/linking-common';
6
+ import { APIError } from '@atlaskit/linking-common/api-error';
7
7
  import { fg } from '@atlaskit/platform-feature-flags/fg';
8
8
  import { SmartLinkStatus } from '../../../constants';
9
9
  import { getUnauthorizedJsonLd } from '../../../utils/get-unauthorized-json-ld';
@@ -3,7 +3,7 @@ export var ANALYTICS_CHANNEL = 'media';
3
3
  export var context = {
4
4
  componentName: 'smart-cards',
5
5
  packageName: "@atlaskit/smart-card" || '',
6
- packageVersion: "45.23.2" || ''
6
+ packageVersion: "45.23.4" || ''
7
7
  };
8
8
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
9
9
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
5
+ import { useSmartLinkContext } from '@atlaskit/link-provider/context';
5
6
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next/useAnalyticsEvents';
6
7
  import { extractSmartLinkEmbed } from '@atlaskit/link-extractors/extract-smart-link-embed';
7
8
  import { fg } from '@atlaskit/platform-feature-flags/fg';
@@ -93,6 +94,9 @@ function Component(_ref) {
93
94
  error = _useSmartLink.error,
94
95
  isPreviewPanelAvailable = _useSmartLink.isPreviewPanelAvailable,
95
96
  openPreviewPanel = _useSmartLink.openPreviewPanel;
97
+ var _useSmartLinkContext = useSmartLinkContext(),
98
+ linkNavigation = _useSmartLinkContext.linkNavigation;
99
+ var resolveNavigation = fg('confluence_ep_shim_macro_links_v2') && isFlexibleUi ? linkNavigation : undefined;
96
100
  var ari = getObjectAri(state.details);
97
101
  var name = getObjectName(state.details);
98
102
  var definitionId = getDefinitionId(state.details);
@@ -123,9 +127,13 @@ function Component(_ref) {
123
127
  var preferredUrl = (_getClickUrl = getClickUrl(url, state.details)) !== null && _getClickUrl !== void 0 ? _getClickUrl : url;
124
128
  return (_appendCrossProductAn = appendCrossProductAnalyticsParams(preferredUrl)) !== null && _appendCrossProductAn !== void 0 ? _appendCrossProductAn : preferredUrl;
125
129
  }, [appendCrossProductAnalyticsParams, state.details, url]);
130
+ var navigation = useMemo(function () {
131
+ return resolveNavigation === null || resolveNavigation === void 0 ? void 0 : resolveNavigation(getDestinationUrl());
132
+ }, [getDestinationUrl, resolveNavigation]);
126
133
 
127
134
  // Setup UI handlers.
128
135
  var handleClickWrapper = useCallback(function (event) {
136
+ var _resolveNavigation$ur;
129
137
  var isModifierKeyPressed = isSpecialKey(event) || isSpecialClick(event);
130
138
  fireEvent('ui.smartLink.clicked', {
131
139
  id: id,
@@ -170,14 +178,15 @@ function Component(_ref) {
170
178
  });
171
179
  return;
172
180
  }
173
- var destinationUrl = getDestinationUrl();
181
+ var destinationUrl = (_resolveNavigation$ur = resolveNavigation === null || resolveNavigation === void 0 ? void 0 : resolveNavigation(getDestinationUrl()).url) !== null && _resolveNavigation$ur !== void 0 ? _resolveNavigation$ur : getDestinationUrl();
174
182
  updateAnchorHref(event, destinationUrl);
175
183
 
176
184
  // For FlexibleCard, read target from the clicked anchor element (e.g. _blank for links
177
185
  // rendered with explicit target). For classic cards, default to _self
178
186
  var _getAnchorAttributesF = getAnchorAttributesFromEvent(event),
179
187
  anchorTarget = _getAnchorAttributesF.target;
180
- var target = isSpecialEvent(event) ? '_blank' : isFlexibleUi ? anchorTarget : '_self';
188
+ var openInNewTab = resolveNavigation ? event.metaKey || event.ctrlKey || event.shiftKey || event.button === 1 : isSpecialEvent(event);
189
+ var target = openInNewTab ? '_blank' : isFlexibleUi ? anchorTarget : '_self';
181
190
  onClick === null || onClick === void 0 || onClick(event, {
182
191
  url: url,
183
192
  destinationUrl: destinationUrl
@@ -204,12 +213,13 @@ function Component(_ref) {
204
213
  clickOutcome: target === '_blank' ? 'clickThroughNewTabOrWindow' : 'clickThrough'
205
214
  }
206
215
  } : undefined);
207
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
216
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, resolveNavigation, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
208
217
 
209
218
  // Middle-click handler to trigger fire3PClickEvent on middle-clicks.
210
219
  // Scope is limited to 3P click analytics.
211
220
  var handleFrameAuxClick = useCallback(function (event) {
212
- var destinationUrl = getDestinationUrl();
221
+ var _resolveNavigation$ur2;
222
+ var destinationUrl = (_resolveNavigation$ur2 = resolveNavigation === null || resolveNavigation === void 0 ? void 0 : resolveNavigation(getDestinationUrl()).url) !== null && _resolveNavigation$ur2 !== void 0 ? _resolveNavigation$ur2 : getDestinationUrl();
213
223
  updateAnchorHref(event, destinationUrl);
214
224
 
215
225
  // isAuxClick filters Windows right-clicks (button === 2) that also fire onAuxClick.
@@ -218,19 +228,20 @@ function Component(_ref) {
218
228
  isAuxClick: true
219
229
  });
220
230
  }
221
- }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
231
+ }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent, resolveNavigation]);
222
232
 
223
233
  // Right-click handler to trigger fire3PClickEvent on right-clicks.
224
234
  // Scope is limited to 3P click analytics.
225
235
  var handleFrameContextMenu = useCallback(function (event) {
226
- var destinationUrl = getDestinationUrl();
236
+ var _resolveNavigation$ur3;
237
+ var destinationUrl = (_resolveNavigation$ur3 = resolveNavigation === null || resolveNavigation === void 0 ? void 0 : resolveNavigation(getDestinationUrl()).url) !== null && _resolveNavigation$ur3 !== void 0 ? _resolveNavigation$ur3 : getDestinationUrl();
227
238
  updateAnchorHref(event, destinationUrl);
228
239
  if (shouldFire3PClickEvent) {
229
240
  fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
230
241
  isContextMenu: true
231
242
  });
232
243
  }
233
- }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
244
+ }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent, resolveNavigation]);
234
245
  var reload = actions.reload;
235
246
  var handleAuthorize = useCallback(function () {
236
247
  return actions.authorize(appearance);
@@ -363,6 +374,7 @@ function Component(_ref) {
363
374
  return /*#__PURE__*/React.createElement(FlexibleCard, {
364
375
  id: id,
365
376
  cardState: cardState,
377
+ navigation: navigation,
366
378
  placeholderData: placeholderData,
367
379
  onAuthorize: services.length && handleAuthorize || undefined,
368
380
  onClick: handleClickWrapper,
@@ -6,7 +6,9 @@ import { defineMessages, useIntl } from 'react-intl';
6
6
  import Heading from '@atlaskit/heading/heading';
7
7
  import AutomationIcon from '@atlaskit/icon/core/automation';
8
8
  import ModalHeader from '@atlaskit/modal-dialog/modal-header';
9
+ import ModalTitle from '@atlaskit/modal-dialog/modal-title';
9
10
  import { useModal } from '@atlaskit/modal-dialog/hooks';
11
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
10
12
  import { Box, Inline, Stack } from '@atlaskit/primitives/compiled';
11
13
  import { useAutomationMenu } from '../../menu-context/useAutomationMenu';
12
14
  var styles = {
@@ -31,28 +33,24 @@ export var AutomationModalHeader = function AutomationModalHeader(_ref) {
31
33
  var _useModal = useModal(),
32
34
  titleId = _useModal.titleId;
33
35
  var showDescription = initialised && rules.length > 0 && !!modalDescription;
34
- return (
35
- /*#__PURE__*/
36
- // eslint-disable-next-line @atlaskit/design-system/use-modal-title
37
- React.createElement(ModalHeader, {
38
- hasCloseButton: true
39
- }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Inline, {
40
- alignBlock: "center"
41
- }, /*#__PURE__*/React.createElement(Box, {
42
- xcss: styles.iconStyle
43
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
44
- ,
45
- backgroundColor: "color.background.accent.green.subtlest"
46
- }, /*#__PURE__*/React.createElement(AutomationIcon, {
47
- size: "small",
48
- label: formatMessage(i18n.modalHeaderIconLabel),
49
- color: "var(--ds-icon-accent-green, #22A06B)",
50
- spacing: "compact"
51
- })), /*#__PURE__*/React.createElement(Heading, {
52
- size: "medium",
53
- id: titleId
54
- }, modalTitle)), showDescription && /*#__PURE__*/React.createElement(Box, {
55
- xcss: styles.modalDescriptionStyle
56
- }, modalDescription)))
57
- );
36
+ return /*#__PURE__*/React.createElement(ModalHeader, {
37
+ hasCloseButton: true
38
+ }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Inline, {
39
+ alignBlock: "center"
40
+ }, /*#__PURE__*/React.createElement(Box, {
41
+ xcss: styles.iconStyle
42
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
43
+ ,
44
+ backgroundColor: "color.background.accent.green.subtlest"
45
+ }, /*#__PURE__*/React.createElement(AutomationIcon, {
46
+ size: "small",
47
+ label: formatMessage(i18n.modalHeaderIconLabel),
48
+ color: "var(--ds-icon-accent-green, #22A06B)",
49
+ spacing: "compact"
50
+ })), fg('platform_dst_modal-dialog-use-modal-title') ? /*#__PURE__*/React.createElement(ModalTitle, null, modalTitle) : /*#__PURE__*/React.createElement(Heading, {
51
+ size: "medium",
52
+ id: titleId
53
+ }, modalTitle)), showDescription && /*#__PURE__*/React.createElement(Box, {
54
+ xcss: styles.modalDescriptionStyle
55
+ }, modalDescription)));
58
56
  };
@@ -7,6 +7,7 @@ import "./TitleBlock.compiled.css";
7
7
  import * as React from 'react';
8
8
  import { ax, ix } from "@compiled/react/runtime";
9
9
  import { useCallback, useState } from 'react';
10
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
10
11
  import { SmartLinkStatus } from '../../../../../constants';
11
12
  import { useMouseDownEvent } from '../../../../../state/analytics/useMouseDownEvent';
12
13
  import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context/useFlexibleCardContext';
@@ -46,7 +47,7 @@ var getTitleBlockViewComponent = function getTitleBlockViewComponent(status) {
46
47
  * @see TitleBlockErroredViewNew
47
48
  */
48
49
  export var TitleBlock = function TitleBlock(_ref) {
49
- var _props$size;
50
+ var _cardContext$navigati, _props$size;
50
51
  var _ref$actions = _ref.actions,
51
52
  actions = _ref$actions === void 0 ? [] : _ref$actions,
52
53
  anchorTarget = _ref.anchorTarget,
@@ -98,7 +99,7 @@ export var TitleBlock = function TitleBlock(_ref) {
98
99
  hideTooltip: hideTitleTooltip,
99
100
  maxLines: maxLines,
100
101
  onMouseDown: onMouseDown,
101
- target: anchorTarget,
102
+ target: fg('confluence_ep_shim_macro_links_v2') ? anchorTarget !== null && anchorTarget !== void 0 ? anchorTarget : cardContext === null || cardContext === void 0 || (_cardContext$navigati = cardContext.navigation) === null || _cardContext$navigati === void 0 ? void 0 : _cardContext$navigati.target : anchorTarget,
102
103
  theme: ui === null || ui === void 0 ? void 0 : ui.theme,
103
104
  anchorRef: anchorRef
104
105
  }, overrideText));
@@ -5,8 +5,9 @@ import "./index.compiled.css";
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import React from 'react';
7
7
  import { di } from 'react-magnetic-di';
8
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
8
9
  import { SmartLinkSize } from '../../../../constants';
9
- import { useFlexibleUiContext } from '../../../../state/flexible-ui-context/useFlexibleUiContext';
10
+ import { useFlexibleCardContext } from '../../../../state/flexible-ui-context/useFlexibleCardContext';
10
11
  import { isFlexibleUiBlock } from '../../../../utils/is-flexible-ui-block';
11
12
  import { getChildrenOptions } from './getChildrenOptions';
12
13
  import { getFlexibleUiBlock } from './getFlexibleUiBlock';
@@ -30,7 +31,8 @@ var getTitleBlockProps = function getTitleBlockProps(children) {
30
31
  return block.props;
31
32
  }
32
33
  };
33
- var getLayeredLink = function getLayeredLink(testId, context, children, onClick, onAuxClick, onContextMenu, title) {
34
+ var getLayeredLink = function getLayeredLink(testId, context, children, onClick, onAuxClick, onContextMenu, title, navigation) {
35
+ var _navigation$url;
34
36
  var _ref = context || {},
35
37
  linkTitle = _ref.linkTitle,
36
38
  _ref$url = _ref.url,
@@ -45,10 +47,10 @@ var getLayeredLink = function getLayeredLink(testId, context, children, onClick,
45
47
  onClick: onClick,
46
48
  onAuxClick: onAuxClick,
47
49
  onContextMenu: onContextMenu,
48
- target: target,
50
+ target: fg('confluence_ep_shim_macro_links_v2') ? target !== null && target !== void 0 ? target : navigation === null || navigation === void 0 ? void 0 : navigation.target : target,
49
51
  testId: testId,
50
52
  text: title || text || (linkTitle === null || linkTitle === void 0 ? void 0 : linkTitle.text),
51
- url: url
53
+ url: fg('confluence_ep_shim_macro_links_v2') ? (_navigation$url = navigation === null || navigation === void 0 ? void 0 : navigation.url) !== null && _navigation$url !== void 0 ? _navigation$url : url : url
52
54
  });
53
55
  };
54
56
  var baseStyleCommon = null;
@@ -142,7 +144,8 @@ var Container = function Container(_ref3) {
142
144
  title = _ref3.title;
143
145
  var padding = hidePadding ? '0px' : getPadding(size);
144
146
  var gap = getGap(size);
145
- var context = useFlexibleUiContext();
147
+ var cardContext = useFlexibleCardContext();
148
+ var context = cardContext === null || cardContext === void 0 ? void 0 : cardContext.data;
146
149
  var _getChildrenOptions = getChildrenOptions(children, context),
147
150
  previewOnLeft = _getChildrenOptions.previewOnLeft,
148
151
  previewOnRight = _getChildrenOptions.previewOnRight;
@@ -160,7 +163,7 @@ var Container = function Container(_ref3) {
160
163
  "--_73mooq": ix(previewOnLeft ? gap : padding),
161
164
  "--_12k13bg": ix(previewOnRight ? gap : padding)
162
165
  }
163
- }, clickableContainer ? getLayeredLink(testId, context, children, onClick, onAuxClick, onContextMenu, title) : null, filterChildren(children, removeBlockRestriction));
166
+ }, clickableContainer ? getLayeredLink(testId, context, children, onClick, onAuxClick, onContextMenu, title, cardContext === null || cardContext === void 0 ? void 0 : cardContext.navigation) : null, filterChildren(children, removeBlockRestriction));
164
167
  if (context !== null && context !== void 0 && context.url && canShowHoverCard) {
165
168
  return /*#__PURE__*/React.createElement(HoverCardControl, {
166
169
  isHoverPreview: isResolved || hasHoverCardOverride,
@@ -1,12 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
3
4
  import { ElementName } from '../../../../../constants';
4
- import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context/useFlexibleUiContext';
5
+ import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context/useFlexibleCardContext';
5
6
  import { BaseLinkElement } from '../common';
6
7
  var TitleElement = function TitleElement(props) {
7
- var context = useFlexibleUiContext();
8
- var data = context ? context === null || context === void 0 ? void 0 : context.linkTitle : null;
9
- return data ? /*#__PURE__*/React.createElement(BaseLinkElement, _extends({}, data, props, {
8
+ var _context$data, _context$navigation$u, _context$navigation;
9
+ var context = useFlexibleCardContext();
10
+ var data = context === null || context === void 0 || (_context$data = context.data) === null || _context$data === void 0 ? void 0 : _context$data.linkTitle;
11
+ return data ? /*#__PURE__*/React.createElement(BaseLinkElement, _extends({}, data, {
12
+ url: fg('confluence_ep_shim_macro_links_v2') ? (_context$navigation$u = context === null || context === void 0 || (_context$navigation = context.navigation) === null || _context$navigation === void 0 ? void 0 : _context$navigation.url) !== null && _context$navigation$u !== void 0 ? _context$navigation$u : data.url : data.url
13
+ }, props, {
10
14
  name: ElementName.Title
11
15
  })) : null;
12
16
  };