@atlaskit/smart-card 43.31.9 → 43.32.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 (72) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-modal/renders-embed-modal-with-confluence-icon--default--navx-1895-new-logo-design-false.png +2 -2
  3. package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-modal/renders-embed-modal-with-confluence-icon--default--navx-1895-new-logo-design-true.png +2 -2
  4. package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-modal/renders-embed-modal-with-flexible-ui-icon--default.png +2 -2
  5. package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-false.png +3 -0
  6. package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-true.png +3 -0
  7. package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-false.png +3 -0
  8. package/dist/cjs/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-true.png +3 -0
  9. package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-button-treatment---default.png +3 -0
  10. package/dist/cjs/state/hooks/use-inline-action-nudge-experiment/index.js +49 -0
  11. package/dist/cjs/utils/analytics/analytics.js +1 -1
  12. package/dist/cjs/utils/index.js +4 -1
  13. package/dist/cjs/view/EmbedModal/components/link-info/index.compiled.css +1 -1
  14. package/dist/cjs/view/EmbedModal/components/link-info/index.js +3 -114
  15. package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +7 -2
  16. package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.js +14 -13
  17. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +6 -1
  18. package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +61 -3
  19. package/dist/cjs/view/InlineCard/common/rovo-actions-button/index.js +9 -100
  20. package/dist/cjs/view/LinkUrl/index.js +1 -1
  21. package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-modal/renders-embed-modal-with-confluence-icon--default--navx-1895-new-logo-design-false.png +2 -2
  22. package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-modal/renders-embed-modal-with-confluence-icon--default--navx-1895-new-logo-design-true.png +2 -2
  23. package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-modal/renders-embed-modal-with-flexible-ui-icon--default.png +2 -2
  24. package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-false.png +3 -0
  25. package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-true.png +3 -0
  26. package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-false.png +3 -0
  27. package/dist/es2019/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-true.png +3 -0
  28. package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-button-treatment---default.png +3 -0
  29. package/dist/es2019/state/hooks/use-inline-action-nudge-experiment/index.js +42 -0
  30. package/dist/es2019/utils/analytics/analytics.js +1 -1
  31. package/dist/es2019/utils/index.js +2 -1
  32. package/dist/es2019/view/EmbedModal/components/link-info/index.compiled.css +1 -1
  33. package/dist/es2019/view/EmbedModal/components/link-info/index.js +1 -109
  34. package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/index.js +7 -2
  35. package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.js +14 -13
  36. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +6 -1
  37. package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +57 -2
  38. package/dist/es2019/view/InlineCard/common/rovo-actions-button/index.js +9 -74
  39. package/dist/es2019/view/LinkUrl/index.js +1 -1
  40. package/dist/esm/__tests__/vr-tests/__snapshots__/embed-modal/renders-embed-modal-with-confluence-icon--default--navx-1895-new-logo-design-false.png +2 -2
  41. package/dist/esm/__tests__/vr-tests/__snapshots__/embed-modal/renders-embed-modal-with-confluence-icon--default--navx-1895-new-logo-design-true.png +2 -2
  42. package/dist/esm/__tests__/vr-tests/__snapshots__/embed-modal/renders-embed-modal-with-flexible-ui-icon--default.png +2 -2
  43. package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-false.png +3 -0
  44. package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-false-platform-sl-3p-preauth-better-hovercard-true.png +3 -0
  45. package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-false.png +3 -0
  46. package/dist/esm/__tests__/vr-tests/__snapshots__/icon-element-variations/icon-element-all-variations-with-experiments--default--platform-sl-3p-preauth-better-hovercard-killswitch-true-platform-sl-3p-preauth-better-hovercard-true.png +3 -0
  47. package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-button-treatment---default.png +3 -0
  48. package/dist/esm/state/hooks/use-inline-action-nudge-experiment/index.js +42 -0
  49. package/dist/esm/utils/analytics/analytics.js +1 -1
  50. package/dist/esm/utils/index.js +3 -0
  51. package/dist/esm/view/EmbedModal/components/link-info/index.compiled.css +1 -1
  52. package/dist/esm/view/EmbedModal/components/link-info/index.js +3 -114
  53. package/dist/esm/view/FlexibleCard/components/container/hover-card-control/index.js +7 -2
  54. package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.js +14 -13
  55. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +6 -1
  56. package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +58 -2
  57. package/dist/esm/view/InlineCard/common/rovo-actions-button/index.js +9 -98
  58. package/dist/esm/view/LinkUrl/index.js +1 -1
  59. package/dist/types/state/hooks/use-inline-action-nudge-experiment/index.d.ts +21 -0
  60. package/dist/types/utils/index.d.ts +1 -0
  61. package/dist/types/view/EmbedModal/components/link-info/index.d.ts +2 -7
  62. package/dist/types/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.d.ts +3 -1
  63. package/dist/types/view/InlineCard/common/rovo-actions-button/index.d.ts +1 -8
  64. package/dist/types-ts4.5/state/hooks/use-inline-action-nudge-experiment/index.d.ts +21 -0
  65. package/dist/types-ts4.5/utils/index.d.ts +1 -0
  66. package/dist/types-ts4.5/view/EmbedModal/components/link-info/index.d.ts +2 -7
  67. package/dist/types-ts4.5/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.d.ts +3 -1
  68. package/dist/types-ts4.5/view/InlineCard/common/rovo-actions-button/index.d.ts +1 -8
  69. package/package.json +12 -9
  70. package/dist/cjs/view/InlineCard/common/rovo-actions-button/index.compiled.css +0 -15
  71. package/dist/es2019/view/InlineCard/common/rovo-actions-button/index.compiled.css +0 -15
  72. package/dist/esm/view/InlineCard/common/rovo-actions-button/index.compiled.css +0 -15
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6dc97ad04addf386b55440c5d25f372bd83c38f4798c7942b304fe293b591b68
3
- size 15496
2
+ oid sha256:5a123b94c0d5bde76fd5950948525b37c656f593b0245fbc92378f64b0864556
3
+ size 17631
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a117559ef83d4ec2bc759d06ad90af7a7ca326aacc551c36f5634750f9bf8bd
3
+ size 223769
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a117559ef83d4ec2bc759d06ad90af7a7ca326aacc551c36f5634750f9bf8bd
3
+ size 223769
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e57281cb358f1e4d45ffc78ba504439918d6e6dd5f02f0610c39baf8ee3e76d
3
+ size 224003
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e57281cb358f1e4d45ffc78ba504439918d6e6dd5f02f0610c39baf8ee3e76d
3
+ size 224003
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f901781bc91abcfbebc9356ffacbb30f381b6be368df26f3ea23b859c300c59f
3
+ size 8391
@@ -0,0 +1,42 @@
1
+ import { useMemo } from 'react';
2
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
+ import { getIsRovoChatEnabled } from '../../../utils/rovo';
4
+ import { getExtensionKey } from '../../helpers';
5
+ import { useSmartCardState } from '../../store';
6
+ import useRovoConfig from '../use-rovo-config';
7
+ const EXCLUDED_EXTENSION_KEYS = new Set(['figma-object-provider', 'google-object-provider']);
8
+ const NOT_ENABLED_RESULT = {
9
+ isEnabled: false
10
+ };
11
+
12
+ /**
13
+ * Returns whether the rovogrowth_640_inline_action_nudge experiment
14
+ * is enabled for the current user and link context.
15
+ *
16
+ * All eligibility criteria are consolidated here:
17
+ * 1. Rovo chat must be enabled for the tenant.
18
+ * 2. The extension key must not be excluded (Figma and Google links are excluded).
19
+ * 3. The experiment value must be true (via tmp-editor-statsig).
20
+ *
21
+ * The extension key is derived from the card store via the resolved URL,
22
+ * so callers don't need to thread it as a prop.
23
+ */
24
+ const useInlineActionNudgeExperiment = url => {
25
+ const rovoConfig = useRovoConfig();
26
+ const isRovoChatEnabled = getIsRovoChatEnabled(rovoConfig);
27
+ const cardState = useSmartCardState(url !== null && url !== void 0 ? url : '');
28
+ const extensionKey = getExtensionKey(cardState.details);
29
+ return useMemo(() => {
30
+ if (!isRovoChatEnabled) {
31
+ return NOT_ENABLED_RESULT;
32
+ }
33
+ if (extensionKey && EXCLUDED_EXTENSION_KEYS.has(extensionKey)) {
34
+ return NOT_ENABLED_RESULT;
35
+ }
36
+ const isEnabled = editorExperiment('rovogrowth_640_inline_action_nudge', true);
37
+ return {
38
+ isEnabled
39
+ };
40
+ }, [isRovoChatEnabled, extensionKey]);
41
+ };
42
+ export default useInlineActionNudgeExperiment;
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card",
5
- packageVersion: "43.31.8"
5
+ packageVersion: "43.32.0"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -378,4 +378,5 @@ export const getPreviewUrlWithTheme = (previewUrl, themeState) => {
378
378
  }
379
379
  };
380
380
  export const isIconSizeLarge = size => size && [SmartLinkSize.Large, SmartLinkSize.XLarge].includes(size);
381
- export const isProfileType = type => !!(type && type.includes('Profile'));
381
+ export const isProfileType = type => !!(type && type.includes('Profile'));
382
+ export const noop = () => undefined;
@@ -69,4 +69,4 @@
69
69
  ._xwbj1tcg svg{min-width:24px}
70
70
  ._yrry1tcg [data-smart-element-icon] span{height:24px}
71
71
  ._z15s1tcg [data-smart-element-icon] svg{min-height:24px}
72
- @media only screen and (max-width:980px){._1dt6glyw{display:none}._3kllglyw .smart-link-resize-button{display:none}}
72
+ @media only screen and (max-width:980px){._1dt6glyw{display:none}}
@@ -9,8 +9,6 @@ import VidFullScreenOnIcon from '@atlaskit/icon/core/fullscreen-enter';
9
9
  import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
10
10
  import ShortcutIcon from '@atlaskit/icon/core/link-external';
11
11
  import { CloseButton, useModal } from '@atlaskit/modal-dialog';
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
- import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
14
12
  import Tooltip from '@atlaskit/tooltip';
15
13
  import { messages } from '../../../../messages';
16
14
  import { Icon } from '../../../common/Icon';
@@ -24,7 +22,6 @@ const iconSize = '24px';
24
22
  // Specify flex ui icon selector to increase specificity weight to 0-2-1.
25
23
  const iconCss = null;
26
24
  const titleCss = null;
27
- const actionCss = null;
28
25
  const buttonGroupCss = null;
29
26
  const listItemCSS = null;
30
27
  const resizeButtonCss = null;
@@ -37,110 +34,6 @@ const LinkInfo = ({
37
34
  size,
38
35
  testId,
39
36
  title
40
- }) => {
41
- const {
42
- onClose
43
- } = useModal();
44
- const {
45
- formatMessage
46
- } = useIntl();
47
- const downloadButton = useMemo(() => {
48
- if (onDownloadButtonClick) {
49
- return /*#__PURE__*/React.createElement(LinkInfoButton, {
50
- content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
51
- icon: () => /*#__PURE__*/React.createElement(DownloadIcon, {
52
- label: fg('platform_navx_flex_card_status_dropdown_a11y_fix') ? '' : messages.download.defaultMessage,
53
- spacing: "spacious",
54
- color: "currentColor"
55
- }),
56
- label: messages.download,
57
- onClick: onDownloadButtonClick,
58
- testId: `${testId}-download`
59
- });
60
- }
61
- }, [onDownloadButtonClick, testId]);
62
- const urlButton = useMemo(() => {
63
- if (onViewButtonClick) {
64
- const content = providerName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.viewIn), " ", providerName) : /*#__PURE__*/React.createElement(FormattedMessage, messages.viewOriginal);
65
- return /*#__PURE__*/React.createElement(LinkInfoButton, {
66
- content: content,
67
- icon: () => /*#__PURE__*/React.createElement(ShortcutIcon, {
68
- label: fg('platform_navx_flex_card_status_dropdown_a11y_fix') ? '' : messages.viewOriginal.defaultMessage,
69
- spacing: "spacious",
70
- color: "currentColor"
71
- }),
72
- label: messages.viewOriginal,
73
- onClick: onViewButtonClick,
74
- testId: `${testId}-url`,
75
- role: 'link',
76
- "aria-label": messages.viewOriginal
77
- });
78
- }
79
- }, [onViewButtonClick, providerName, testId]);
80
- const sizeButton = useMemo(() => {
81
- const isFullScreen = size === MAX_MODAL_SIZE;
82
- const message = isFullScreen ? messages.preview_min_size : messages.preview_max_size;
83
- const icon = isFullScreen ? /*#__PURE__*/React.createElement(FullscreenExitIcon, {
84
- label: fg('platform_navx_flex_card_status_dropdown_a11y_fix') ? '' : message.defaultMessage,
85
- spacing: "spacious",
86
- color: "currentColor"
87
- }) : /*#__PURE__*/React.createElement(VidFullScreenOnIcon, {
88
- label: fg('platform_navx_flex_card_status_dropdown_a11y_fix') ? '' : message.defaultMessage,
89
- spacing: "spacious",
90
- color: "currentColor"
91
- });
92
- return (
93
- /*#__PURE__*/
94
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
95
- React.createElement("span", {
96
- className: "smart-link-resize-button"
97
- }, /*#__PURE__*/React.createElement(LinkInfoButton, {
98
- content: /*#__PURE__*/React.createElement(FormattedMessage, message),
99
- icon: () => icon,
100
- label: message,
101
- onClick: onResizeButtonClick,
102
- testId: `${testId}-resize`
103
- }))
104
- );
105
- }, [onResizeButtonClick, size, testId]);
106
- return /*#__PURE__*/React.createElement("div", {
107
- className: ax(["_zulpu2gc _1e0c1txw _19bv1ejb _u5f31ejb _ca0q1ejb _n3tdpxbi _1wpz1fhb _4t3i1tcg"])
108
- }, icon && /*#__PURE__*/React.createElement("div", {
109
- "data-testid": `${testId}-icon`,
110
- className: ax(["_4t3i1tcg _gire1tcg _yrry1tcg _1bnm1tcg _bna71tcg _1xjx1tcg _17521tcg _1tke1tcg _x9xj1tcg _v5981tcg _z15s1tcg _qci81tcg _15iz1tcg _erub1tcg _c71l1tcg _1q121tcg _2s1x1tcg _1rh41tcg _19l31tcg _1pr21tcg _1u5t1tcg _1bsb1tcg _1xyl1tcg _1h1b1tcg _prfw1tcg _mezj1tcg _e2oo1tcg _w8l51tcg _1ul91tcg _1ekg1tcg _jbhf1tcg _11hh1tcg _1rg21tcg _q7cv1tcg _xwbj1tcg _p12f1tcg _1mj01tcg _1r9c1tcg _1xch1tcg _rtys1tcg _b8nk1tcg _4x201tcg"])
111
- }, /*#__PURE__*/React.createElement(Icon, icon)), /*#__PURE__*/React.createElement("div", {
112
- className: ax(["_16jlkb7n _1o9zidpf _i0dlf1ug _1e0c1txw _2lx21bp4 _1bah1h6o _1wpz1fhb"])
113
- }, /*#__PURE__*/React.createElement(Heading, {
114
- as: "h2",
115
- size: "small",
116
- color: "color.text",
117
- testId: `${testId}-title`
118
- }, title), /*#__PURE__*/React.createElement("span", {
119
- tabIndex: 0,
120
- role: "button",
121
- "aria-hidden": true
122
- })), /*#__PURE__*/React.createElement("div", {
123
- className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _zulp1b66 _1e0c1txw _3kllglyw"])
124
- }, downloadButton, urlButton, sizeButton, /*#__PURE__*/React.createElement(Tooltip, {
125
- content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_close),
126
- hideTooltipOnClick: true,
127
- tag: "span",
128
- testId: `${testId}-close-tooltip`
129
- }, /*#__PURE__*/React.createElement(CloseButton, {
130
- onClick: onClose,
131
- label: formatMessage(messages.preview_close),
132
- testId: testId
133
- }))));
134
- };
135
- const LinkInfoNew = ({
136
- icon,
137
- providerName,
138
- onDownloadButtonClick,
139
- onResizeButtonClick,
140
- onViewButtonClick,
141
- size,
142
- testId,
143
- title
144
37
  }) => {
145
38
  const {
146
39
  onClose
@@ -231,5 +124,4 @@ const LinkInfoNew = ({
231
124
  testId: testId
232
125
  })))));
233
126
  };
234
- const _default_1 = componentWithFG('platform_navx_sl_a11y_embed_modal', LinkInfoNew, LinkInfo);
235
- export default _default_1;
127
+ export default LinkInfo;
@@ -1,5 +1,8 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React, { useCallback, useEffect, useRef, useState } from 'react';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
2
4
  import { ElementName } from '../../../../../constants';
5
+ import { noop } from '../../../../../utils';
3
6
  import { HoverCard } from '../../../../HoverCard';
4
7
  const FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY = 100;
5
8
  const HoverCardControl = ({
@@ -56,12 +59,14 @@ const HoverCardControl = ({
56
59
  actionOptions: actionOptions,
57
60
  url: url,
58
61
  hoverPreviewOptions: hoverPreviewOptions
59
- }, /*#__PURE__*/React.createElement("span", {
62
+ }, /*#__PURE__*/React.createElement("span", _extends({}, fg('platform_sl_a11y_enghealth_46829') ? {
63
+ onBlur: noop
64
+ } : undefined, {
60
65
  // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
61
66
  onMouseLeave: onMouseLeave,
62
67
  onMouseMove: onMouseMove,
63
68
  "data-testid": `${testId}-hover-card-wrapper`,
64
69
  role: 'presentation'
65
- }, children));
70
+ }), children));
66
71
  };
67
72
  export default HoverCardControl;
@@ -1,6 +1,8 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React, { useCallback } from 'react';
2
3
  import { DropdownItem } from '@atlaskit/dropdown-menu';
3
4
  import Lozenge from '@atlaskit/lozenge';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
4
6
  const LozengeActionItem = ({
5
7
  appearance,
6
8
  id,
@@ -20,19 +22,18 @@ const LozengeActionItem = ({
20
22
  var _e$currentTarget, _e$currentTarget$firs;
21
23
  (_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 ? void 0 : (_e$currentTarget$firs = _e$currentTarget.firstElementChild) === null || _e$currentTarget$firs === void 0 ? void 0 : _e$currentTarget$firs.focus();
22
24
  }, []);
23
- return (
24
- /*#__PURE__*/
25
+ return /*#__PURE__*/React.createElement("span", _extends({}, fg('platform_sl_a11y_enghealth_46829') ? {
26
+ onFocus: handleMouseEnter
27
+ } : undefined, {
25
28
  // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
26
- React.createElement("span", {
27
- onMouseEnter: handleMouseEnter,
28
- role: "presentation"
29
- }, /*#__PURE__*/React.createElement(DropdownItem, {
30
- onClick: handleClick,
31
- testId: testId
32
- }, /*#__PURE__*/React.createElement(Lozenge, {
33
- appearance: appearance,
34
- isBold: true
35
- }, text)))
36
- );
29
+ onMouseEnter: handleMouseEnter,
30
+ role: "presentation"
31
+ }), /*#__PURE__*/React.createElement(DropdownItem, {
32
+ onClick: handleClick,
33
+ testId: testId
34
+ }, /*#__PURE__*/React.createElement(Lozenge, {
35
+ appearance: appearance,
36
+ isBold: true
37
+ }, text)));
37
38
  };
38
39
  export default LozengeActionItem;
@@ -7,6 +7,7 @@ import { ActionName, CardDisplay } from '../../../constants';
7
7
  import { useSmartCardActions } from '../../../state/actions';
8
8
  import { useSmartLinkRenderers } from '../../../state/renderers';
9
9
  import { useSmartCardState as useLinkState } from '../../../state/store';
10
+ import { noop } from '../../../utils';
10
11
  import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
11
12
  import { createCustomPopupContainer } from '../components/CustomPopupContainer';
12
13
  import HoverCardContent from '../components/HoverCardContent';
@@ -233,7 +234,11 @@ export const HoverCardComponent = ({
233
234
  "data-testid": HOVER_CARD_TRIGGER_WRAPPER
234
235
  }, editorExperiment('platform_editor_preview_panel_linking_exp', true) ? {
235
236
  className: HOVER_CARD_TRIGGER_WRAPPER
236
- } : {}), children)), [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition, handleKeyDown]);
237
+ } : {}, fg('platform_sl_a11y_enghealth_46829') ? {
238
+ onFocus: noop,
239
+ onBlur: noop,
240
+ role: 'none'
241
+ } : undefined), children)), [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition, handleKeyDown]);
237
242
  const popupComponent = useMemo(
238
243
  // Within the Popup component, if shouldRenderToParent, the zIndex prop is ignored
239
244
  // as it is assumed that the custom popup container has the desired styles
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
3
+ import useInlineActionNudgeExperiment from '../../../state/hooks/use-inline-action-nudge-experiment';
2
4
  import { HoverCard } from '../../HoverCard';
5
+ import { RovoActionsButton } from '../common/rovo-actions-button';
3
6
  import { Frame } from '../Frame';
4
7
  import { IconAndTitleLayout } from '../IconAndTitleLayout';
5
8
  import { renderLozenge } from './renderLozenge';
6
- export function InlineCardResolvedViewFunctional({
9
+ export function InlineCardResolvedViewBase({
7
10
  id,
8
11
  title = '',
9
12
  isSelected,
@@ -46,4 +49,56 @@ export function InlineCardResolvedViewFunctional({
46
49
  actionOptions: actionOptions,
47
50
  hoverPreviewOptions: hoverPreviewOptions
48
51
  }, frame);
49
- }
52
+ }
53
+ export function InlineCardResolvedViewFunctionalWithRovoActionsButton({
54
+ id,
55
+ title = '',
56
+ isSelected,
57
+ isHovered,
58
+ onClick,
59
+ icon,
60
+ link,
61
+ testId = 'inline-card-resolved-view',
62
+ titleTextColor,
63
+ titlePrefix,
64
+ showHoverPreview = false,
65
+ hoverPreviewOptions,
66
+ actionOptions,
67
+ truncateInline,
68
+ type,
69
+ hideIconLoadingSkeleton,
70
+ lozenge
71
+ }) {
72
+ const {
73
+ isEnabled
74
+ } = useInlineActionNudgeExperiment(link);
75
+
76
+ // TODO https://hello.jira.atlassian.cloud/browse/NAVX-4436: fire analytics with cohort
77
+ const frame = /*#__PURE__*/React.createElement(Frame, {
78
+ testId: testId,
79
+ link: link,
80
+ isSelected: isSelected,
81
+ isHovered: isHovered,
82
+ onClick: onClick,
83
+ truncateInline: truncateInline
84
+ }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
85
+ emoji: titlePrefix,
86
+ icon: icon,
87
+ title: title,
88
+ titleTextColor: titleTextColor,
89
+ type: type,
90
+ hideIconLoadingSkeleton: hideIconLoadingSkeleton
91
+ }), renderLozenge(lozenge), isEnabled && link && /*#__PURE__*/React.createElement(RovoActionsButton, {
92
+ testId: `${testId}-rovo-actions-button`
93
+ }));
94
+ if (!showHoverPreview || !link) {
95
+ return frame;
96
+ }
97
+ return /*#__PURE__*/React.createElement(HoverCard, {
98
+ id: id,
99
+ url: link,
100
+ actionOptions: actionOptions,
101
+ hoverPreviewOptions: hoverPreviewOptions
102
+ }, frame);
103
+ }
104
+ export const InlineCardResolvedViewFunctional = componentWithFG('rovogrowth-640-inline-action-nudge-fg', InlineCardResolvedViewFunctionalWithRovoActionsButton, InlineCardResolvedViewBase);
@@ -1,78 +1,13 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.39.1 */
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import "./index.compiled.css";
4
- import { ax, ix } from "@compiled/react/runtime";
5
- import React, { useState } from 'react';
6
- import { useIntl } from 'react-intl-next';
7
- import { cx } from '@atlaskit/css';
1
+ import React from 'react';
8
2
  import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
9
- import Popup from '@atlaskit/popup';
10
- import { Box } from '@atlaskit/primitives/compiled';
11
- import { messages } from '../../../../messages';
12
- import AIPrism from '../../../common/ai-prism';
13
- import { ActionButton } from '../action-button';
14
- import { RovoPostAuthActionsModal } from '../rovo-post-auth-actions-modal';
15
- const styles = {
16
- wrapper: "_kqswh2mm _1e0c1o8l",
17
- expanded: "_kqswstnw _154iidpf _1xi2idpf _1e0c1nu9 _o5721q9c _1pbykb7n",
18
- expandedText: "_1reo15vq _18m915vq _v564hlhx _1e0c1o8l _p12fidpf _s7n4jp4b _o5721q9c",
19
- expandedTextVisible: "_p12fuuw1 _u5f31b66"
20
- };
21
3
  export const RovoActionsButton = ({
22
- onClick,
23
- testId,
24
- title = '',
25
- url = ''
4
+ testId
26
5
  }) => {
27
- const [isHovered, setIsHovered] = useState(false);
28
- const [isPopupOpen, setIsPopupOpen] = useState(false);
29
- const {
30
- formatMessage
31
- } = useIntl();
32
- const handleClick = e => {
33
- e.preventDefault();
34
- e.stopPropagation();
35
- setIsPopupOpen(prev => !prev);
36
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
37
- };
38
- return /*#__PURE__*/React.createElement(Popup, {
39
- isOpen: isPopupOpen,
40
- onClose: () => setIsPopupOpen(false),
41
- placement: "right-start",
42
- content: () => /*#__PURE__*/React.createElement(AIPrism, {
43
- isVisible: true,
44
- isMoving: true,
45
- isGlowing: true
46
- }, /*#__PURE__*/React.createElement(RovoPostAuthActionsModal, {
47
- title: title,
48
- url: url,
49
- testId: testId && `${testId}-popup`
50
- })),
51
- trigger: triggerProps => /*#__PURE__*/React.createElement(Box, {
52
- xcss: styles.wrapper,
53
- onMouseEnter: () => setIsHovered(true),
54
- onMouseLeave: () => setIsHovered(false),
55
- onFocus: () => setIsHovered(true),
56
- onBlur: () => setIsHovered(false)
57
- }, /*#__PURE__*/React.createElement(ActionButton, _extends({
58
- onClick: handleClick,
59
- viewType: "action",
60
- testId: testId
61
- }, triggerProps), /*#__PURE__*/React.createElement(RovoChatIcon, {
62
- label: "Rovo",
63
- color: "var(--ds-icon-inverse, #FFFFFF)",
64
- size: "small"
65
- })), /*#__PURE__*/React.createElement(Box, {
66
- xcss: styles.expanded
67
- }, /*#__PURE__*/React.createElement(ActionButton, _extends({
68
- onClick: handleClick,
69
- viewType: "action"
70
- }, triggerProps), /*#__PURE__*/React.createElement(Box, {
71
- xcss: cx(styles.expandedText, isHovered && styles.expandedTextVisible)
72
- }, formatMessage(messages.rovo_actions_explore)), /*#__PURE__*/React.createElement(RovoChatIcon, {
73
- label: "Rovo",
74
- color: "var(--ds-icon-inverse, #FFFFFF)",
75
- size: "small"
76
- }))))
77
- });
6
+ return /*#__PURE__*/React.createElement("span", {
7
+ "data-testid": testId
8
+ }, /*#__PURE__*/React.createElement(RovoChatIcon, {
9
+ label: "Rovo",
10
+ color: "var(--ds-icon-inverse, #FFFFFF)",
11
+ size: "small"
12
+ }));
78
13
  };
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  const PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "43.31.8",
15
+ packageVersion: "43.32.0",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  const Anchor = withLinkClickedEvent('a');
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6c06f8839cb0945f2cab0ac802b365d5777fb87cbef26f7aee3fde0aeeb3c492
3
- size 15336
2
+ oid sha256:fbb78ea71a5746369b0084cf50849be921509c49eecf27fe1102c7066b83c308
3
+ size 17436
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:db6c75900c0c5e1690a60a1ba68377dcb1abcc0f2f15772323e5b11519f0862c
3
- size 15479
2
+ oid sha256:d9b336037c1135a1eaf5198b69f76a440925ea3373d1bf1b95eabb240890bb52
3
+ size 17591
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6dc97ad04addf386b55440c5d25f372bd83c38f4798c7942b304fe293b591b68
3
- size 15496
2
+ oid sha256:5a123b94c0d5bde76fd5950948525b37c656f593b0245fbc92378f64b0864556
3
+ size 17631
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a117559ef83d4ec2bc759d06ad90af7a7ca326aacc551c36f5634750f9bf8bd
3
+ size 223769
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a117559ef83d4ec2bc759d06ad90af7a7ca326aacc551c36f5634750f9bf8bd
3
+ size 223769
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e57281cb358f1e4d45ffc78ba504439918d6e6dd5f02f0610c39baf8ee3e76d
3
+ size 224003
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e57281cb358f1e4d45ffc78ba504439918d6e6dd5f02f0610c39baf8ee3e76d
3
+ size 224003
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f901781bc91abcfbebc9356ffacbb30f381b6be368df26f3ea23b859c300c59f
3
+ size 8391
@@ -0,0 +1,42 @@
1
+ import { useMemo } from 'react';
2
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
+ import { getIsRovoChatEnabled } from '../../../utils/rovo';
4
+ import { getExtensionKey } from '../../helpers';
5
+ import { useSmartCardState } from '../../store';
6
+ import useRovoConfig from '../use-rovo-config';
7
+ var EXCLUDED_EXTENSION_KEYS = new Set(['figma-object-provider', 'google-object-provider']);
8
+ var NOT_ENABLED_RESULT = {
9
+ isEnabled: false
10
+ };
11
+
12
+ /**
13
+ * Returns whether the rovogrowth_640_inline_action_nudge experiment
14
+ * is enabled for the current user and link context.
15
+ *
16
+ * All eligibility criteria are consolidated here:
17
+ * 1. Rovo chat must be enabled for the tenant.
18
+ * 2. The extension key must not be excluded (Figma and Google links are excluded).
19
+ * 3. The experiment value must be true (via tmp-editor-statsig).
20
+ *
21
+ * The extension key is derived from the card store via the resolved URL,
22
+ * so callers don't need to thread it as a prop.
23
+ */
24
+ var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url) {
25
+ var rovoConfig = useRovoConfig();
26
+ var isRovoChatEnabled = getIsRovoChatEnabled(rovoConfig);
27
+ var cardState = useSmartCardState(url !== null && url !== void 0 ? url : '');
28
+ var extensionKey = getExtensionKey(cardState.details);
29
+ return useMemo(function () {
30
+ if (!isRovoChatEnabled) {
31
+ return NOT_ENABLED_RESULT;
32
+ }
33
+ if (extensionKey && EXCLUDED_EXTENSION_KEYS.has(extensionKey)) {
34
+ return NOT_ENABLED_RESULT;
35
+ }
36
+ var isEnabled = editorExperiment('rovogrowth_640_inline_action_nudge', true);
37
+ return {
38
+ isEnabled: isEnabled
39
+ };
40
+ }, [isRovoChatEnabled, extensionKey]);
41
+ };
42
+ export default useInlineActionNudgeExperiment;
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "43.31.8"
7
+ packageVersion: "43.32.0"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -579,4 +579,7 @@ export var isIconSizeLarge = function isIconSizeLarge(size) {
579
579
  };
580
580
  export var isProfileType = function isProfileType(type) {
581
581
  return !!(type && type.includes('Profile'));
582
+ };
583
+ export var noop = function noop() {
584
+ return undefined;
582
585
  };
@@ -69,4 +69,4 @@
69
69
  ._xwbj1tcg svg{min-width:24px}
70
70
  ._yrry1tcg [data-smart-element-icon] span{height:24px}
71
71
  ._z15s1tcg [data-smart-element-icon] svg{min-height:24px}
72
- @media only screen and (max-width:980px){._1dt6glyw{display:none}._3kllglyw .smart-link-resize-button{display:none}}
72
+ @media only screen and (max-width:980px){._1dt6glyw{display:none}}