@atlaskit/smart-card 45.6.10 → 45.6.11
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.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +1 -3
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +14 -7
- package/dist/cjs/view/EmbedModal/components/link-info/link-info-button/index.js +8 -3
- package/dist/cjs/view/EmbedModal/index.js +29 -2
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +8 -6
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +3 -1
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +4 -9
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/ai-summary/index.compiled.css +0 -1
- package/dist/cjs/view/common/ai-summary/index.js +2 -8
- package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +1 -3
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +13 -6
- package/dist/es2019/view/EmbedModal/components/link-info/link-info-button/index.js +8 -3
- package/dist/es2019/view/EmbedModal/index.js +30 -3
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +8 -6
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +3 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +4 -9
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/ai-summary/index.compiled.css +0 -1
- package/dist/es2019/view/common/ai-summary/index.js +2 -8
- package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +1 -3
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/EmbedModal/components/link-info/index.js +14 -7
- package/dist/esm/view/EmbedModal/components/link-info/link-info-button/index.js +8 -3
- package/dist/esm/view/EmbedModal/index.js +30 -3
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +8 -6
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +3 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +4 -9
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/ai-summary/index.compiled.css +0 -1
- package/dist/esm/view/common/ai-summary/index.js +2 -8
- package/dist/types/view/EmbedModal/components/link-info/index.d.ts +1 -1
- package/dist/types/view/EmbedModal/components/link-info/link-info-button/index.d.ts +3 -2
- package/dist/types/view/EmbedModal/components/link-info/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +1 -2
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +0 -4
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +1 -2
- package/package.json +5 -2
|
@@ -69,7 +69,7 @@ const FollowAction = props => {
|
|
|
69
69
|
};
|
|
70
70
|
return /*#__PURE__*/React.createElement(ServerAction, _extends({
|
|
71
71
|
content: /*#__PURE__*/React.createElement(FormattedMessage, label)
|
|
72
|
-
}, fg('
|
|
72
|
+
}, fg('platform_sl_action_refactoring') ? {
|
|
73
73
|
ariaLabel: intl.formatMessage(label)
|
|
74
74
|
} : {}, {
|
|
75
75
|
icon: followIcon,
|
|
@@ -34,10 +34,10 @@ const ViewRelatedLinksAction = ({
|
|
|
34
34
|
}, [actionData === null || actionData === void 0 ? void 0 : actionData.ari, fireEvent, modal, onClickCallback]);
|
|
35
35
|
return actionData ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
36
36
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links)
|
|
37
|
-
}, fg('
|
|
37
|
+
}, fg('platform_sl_action_refactoring') ? {
|
|
38
38
|
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links)
|
|
39
39
|
} : {}, {
|
|
40
|
-
icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, fg('
|
|
40
|
+
icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, fg('platform_sl_action_refactoring') ? {
|
|
41
41
|
iconSize: props.iconSize
|
|
42
42
|
} : {}),
|
|
43
43
|
onClick: onClick,
|
|
@@ -12,7 +12,6 @@ import { Provider } from '../../elements';
|
|
|
12
12
|
import Block from '../block';
|
|
13
13
|
/**
|
|
14
14
|
* Allowed footer actions for HoverCard, in display order. Fetched from context.
|
|
15
|
-
* @featureGate platform_sl_3p_auth_rovo_action_kill_switch
|
|
16
15
|
*/
|
|
17
16
|
const HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [ActionName.RovoChatAction];
|
|
18
17
|
const ignoreContainerMarginStyles = null;
|
|
@@ -44,6 +43,9 @@ const ResolvedHoverCardFooterBlock = ({
|
|
|
44
43
|
arr = arr.filter(name => !HIDDEN_HOVER_CARD_FOOTER_ACTIONS.includes(name));
|
|
45
44
|
return arr.map(name => {
|
|
46
45
|
const Action = name in Actions ? Actions[name] : undefined;
|
|
46
|
+
|
|
47
|
+
// Note: For the spinner to render properly, e.g. AI summary action,
|
|
48
|
+
// the spinner need to be updated. See FIX-ME comment on ActionButton
|
|
47
49
|
return Action ? /*#__PURE__*/React.createElement(Action, {
|
|
48
50
|
key: name,
|
|
49
51
|
as: "stack-item",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
2
|
import { AnalyticsContext, useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
|
|
4
3
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
@@ -258,16 +257,14 @@ const HoverCardContent = ({
|
|
|
258
257
|
});
|
|
259
258
|
}
|
|
260
259
|
if (isResolved) {
|
|
261
|
-
return /*#__PURE__*/React.createElement(HoverCardResolvedView,
|
|
262
|
-
actionOptions
|
|
263
|
-
} : undefined, {
|
|
260
|
+
return /*#__PURE__*/React.createElement(HoverCardResolvedView, {
|
|
264
261
|
cardState: cardState,
|
|
265
262
|
extensionKey: extensionKey,
|
|
266
263
|
flexibleCardProps: flexibleCardProps,
|
|
267
264
|
isAISummaryEnabled: isAISummaryEnabled,
|
|
268
265
|
onActionClick: onActionClick,
|
|
269
266
|
titleBlockProps: titleBlockProps
|
|
270
|
-
})
|
|
267
|
+
});
|
|
271
268
|
}
|
|
272
269
|
return null;
|
|
273
270
|
})();
|
|
@@ -309,16 +306,14 @@ const HoverCardContent = ({
|
|
|
309
306
|
});
|
|
310
307
|
}
|
|
311
308
|
if (cardState.status === 'resolved') {
|
|
312
|
-
return /*#__PURE__*/React.createElement(HoverCardResolvedView,
|
|
313
|
-
actionOptions
|
|
314
|
-
} : undefined, {
|
|
309
|
+
return /*#__PURE__*/React.createElement(HoverCardResolvedView, {
|
|
315
310
|
cardState: cardState,
|
|
316
311
|
extensionKey: extensionKey,
|
|
317
312
|
flexibleCardProps: flexibleCardProps,
|
|
318
313
|
isAISummaryEnabled: isAISummaryEnabled,
|
|
319
314
|
onActionClick: onActionClick,
|
|
320
315
|
titleBlockProps: titleBlockProps
|
|
321
|
-
})
|
|
316
|
+
});
|
|
322
317
|
}
|
|
323
318
|
return null;
|
|
324
319
|
};
|
|
@@ -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.6.
|
|
12
|
+
packageVersion: "45.6.10",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -5,6 +5,5 @@
|
|
|
5
5
|
._o5724jg8{white-space:normal}
|
|
6
6
|
._slp31hna{word-wrap:break-word}
|
|
7
7
|
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
8
|
-
._syazi7uo{color:var(--ds-text,#292a2e)}
|
|
9
8
|
._te171kdv{-ms-user-select:text}
|
|
10
9
|
._uizt1kdv{-webkit-user-select:text;-ms-user-select:text;user-select:text}
|
|
@@ -3,12 +3,9 @@ import "./index.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import Markdown from 'markdown-to-jsx';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
8
6
|
import UList from './ulist';
|
|
9
7
|
const baseStyle = null;
|
|
10
|
-
const
|
|
11
|
-
const textStyleOld = null;
|
|
8
|
+
const textStyle = null;
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* A component to render a response from AI in markdown text.
|
|
@@ -24,14 +21,11 @@ const AISummary = ({
|
|
|
24
21
|
if (!content && minHeight === 0) {
|
|
25
22
|
return null;
|
|
26
23
|
}
|
|
27
|
-
const is3pExperimentEnabled =
|
|
28
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
29
|
-
fg('platform_sl_3p_auth_rovo_action_kill_switch') && expValEqualsNoExposure('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
30
24
|
return /*#__PURE__*/React.createElement(Markdown, {
|
|
31
25
|
"data-testid": testId
|
|
32
26
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
33
27
|
,
|
|
34
|
-
className: ax(["_11c8wadc _slp31hna _1nmz1hna _o5724jg8 _181u1kdv _1rkw1kdv _te171kdv _uizt1kdv",
|
|
28
|
+
className: ax(["_11c8wadc _slp31hna _1nmz1hna _o5724jg8 _181u1kdv _1rkw1kdv _te171kdv _uizt1kdv", "_syazazsu", className]),
|
|
35
29
|
children: content,
|
|
36
30
|
options: {
|
|
37
31
|
forceWrapper: true,
|
|
@@ -24,12 +24,10 @@ var extractRovoChatAction = function extractRovoChatAction(_ref) {
|
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
var extensionKey = getExtensionKey(response);
|
|
27
|
-
var isGoogleProvider = extensionKey === 'google-object-provider';
|
|
28
27
|
var isInlineExperimentEnabled = fg('platform_sl_3p_auth_inline_tailored_cta_killswitch') && expValEqualsNoExposure('platform_sl_3p_auth_inline_tailored_cta', 'isEnabled', true);
|
|
29
|
-
var is3PAuthRovoActionEnabled = isGoogleProvider && fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
30
28
|
var is3PBlockPostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && (rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product) === 'CONFLUENCE';
|
|
31
29
|
var is3PEmbedPostAuthActionsEnabled = isEmbedRovoActionsFooterExperimentEnabled === true;
|
|
32
|
-
var isSupportedFeature =
|
|
30
|
+
var isSupportedFeature = is3PBlockPostAuthActionsEnabled || isInlineExperimentEnabled || is3PEmbedPostAuthActionsEnabled;
|
|
33
31
|
var isOptIn = (actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
34
32
|
var url = extractSmartLinkUrl(response);
|
|
35
33
|
return isSupportedFeature && isOptIn ? {
|
|
@@ -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: "45.6.
|
|
7
|
+
packageVersion: "45.6.10" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import "./index.compiled.css";
|
|
3
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
5
|
import React, { useMemo } from 'react';
|
|
@@ -9,6 +10,7 @@ import VidFullScreenOnIcon from '@atlaskit/icon/core/fullscreen-enter';
|
|
|
9
10
|
import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
|
|
10
11
|
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
11
12
|
import { CloseButton, useModal } from '@atlaskit/modal-dialog';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
15
|
import { messages } from '../../../../messages';
|
|
14
16
|
import { Icon } from '../../../common/Icon';
|
|
@@ -33,13 +35,14 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
33
35
|
onViewButtonClick = _ref.onViewButtonClick,
|
|
34
36
|
size = _ref.size,
|
|
35
37
|
testId = _ref.testId,
|
|
36
|
-
title = _ref.title
|
|
38
|
+
title = _ref.title,
|
|
39
|
+
focusRef = _ref.focusRef;
|
|
37
40
|
var _useModal = useModal(),
|
|
38
41
|
onClose = _useModal.onClose;
|
|
39
42
|
var _useIntl = useIntl(),
|
|
40
43
|
formatMessage = _useIntl.formatMessage;
|
|
41
44
|
var downloadButton = useMemo(function () {
|
|
42
|
-
return /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
45
|
+
return /*#__PURE__*/React.createElement(LinkInfoButton, _extends({
|
|
43
46
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
|
|
44
47
|
icon: function icon() {
|
|
45
48
|
return /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
@@ -51,15 +54,17 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
51
54
|
label: formatMessage(messages.download),
|
|
52
55
|
onClick: onDownloadButtonClick,
|
|
53
56
|
testId: "".concat(testId, "-download")
|
|
54
|
-
})
|
|
55
|
-
|
|
57
|
+
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
58
|
+
focusRef: focusRef
|
|
59
|
+
} : {}));
|
|
60
|
+
}, [onDownloadButtonClick, testId, formatMessage, focusRef]);
|
|
56
61
|
var urlButton = useMemo(function () {
|
|
57
62
|
if (onViewButtonClick) {
|
|
58
63
|
var label = providerName ? formatMessage(messages.viewInProvider, {
|
|
59
64
|
providerName: providerName
|
|
60
65
|
}) : formatMessage(messages.viewOriginal);
|
|
61
66
|
var content = providerName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.viewIn), " ", providerName) : /*#__PURE__*/React.createElement(FormattedMessage, messages.viewOriginal);
|
|
62
|
-
return /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
67
|
+
return /*#__PURE__*/React.createElement(LinkInfoButton, _extends({
|
|
63
68
|
content: content,
|
|
64
69
|
icon: function icon() {
|
|
65
70
|
return /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
@@ -72,9 +77,11 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
72
77
|
onClick: onViewButtonClick,
|
|
73
78
|
testId: "".concat(testId, "-url"),
|
|
74
79
|
role: 'link'
|
|
75
|
-
})
|
|
80
|
+
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
81
|
+
focusRef: !onDownloadButtonClick ? focusRef : undefined
|
|
82
|
+
} : {}));
|
|
76
83
|
}
|
|
77
|
-
}, [onViewButtonClick, providerName, testId, formatMessage]);
|
|
84
|
+
}, [onViewButtonClick, providerName, testId, formatMessage, onDownloadButtonClick, focusRef]);
|
|
78
85
|
var sizeButton = useMemo(function () {
|
|
79
86
|
var isFullScreen = size === MAX_MODAL_SIZE;
|
|
80
87
|
var message = isFullScreen ? messages.preview_min_size : messages.preview_max_size;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { IconButton } from '@atlaskit/button/new';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
6
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
5
7
|
var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
@@ -8,14 +10,15 @@ var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
|
8
10
|
label = _ref.label,
|
|
9
11
|
onClick = _ref.onClick,
|
|
10
12
|
testId = _ref.testId,
|
|
11
|
-
role = _ref.role
|
|
13
|
+
role = _ref.role,
|
|
14
|
+
focusRef = _ref.focusRef;
|
|
12
15
|
var onMouseDown = useMouseDownEvent();
|
|
13
16
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
14
17
|
content: content,
|
|
15
18
|
hideTooltipOnClick: true,
|
|
16
19
|
tag: "span",
|
|
17
20
|
testId: "".concat(testId, "-tooltip")
|
|
18
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
21
|
+
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
19
22
|
appearance: "subtle",
|
|
20
23
|
icon: icon,
|
|
21
24
|
label: label,
|
|
@@ -23,6 +26,8 @@ var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
|
23
26
|
onMouseDown: onMouseDown,
|
|
24
27
|
testId: "".concat(testId, "-button"),
|
|
25
28
|
role: role
|
|
26
|
-
})
|
|
29
|
+
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
30
|
+
ref: focusRef
|
|
31
|
+
} : {})));
|
|
27
32
|
};
|
|
28
33
|
export default LinkInfoButton;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import React, { useCallback, useRef, useState } from 'react';
|
|
3
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import ModalDialog, { ModalBody, ModalTransition } from '@atlaskit/modal-dialog';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
6
7
|
import { SmartLinkSize } from '../../constants';
|
|
7
8
|
import useInvokeClientAction from '../../state/hooks/use-invoke-client-action';
|
|
@@ -116,6 +117,30 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
116
117
|
if (previewUrl && isSupportTheming) {
|
|
117
118
|
previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
|
|
118
119
|
}
|
|
120
|
+
var focusRef = useRef(null);
|
|
121
|
+
var hasRestoredFocus = useRef(false);
|
|
122
|
+
useEffect(function () {
|
|
123
|
+
if (!isOpen || !fg('navx-4719-a11y-embed-modal-focus-states')) {
|
|
124
|
+
hasRestoredFocus.current = false;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
var handleWindowBlur = function handleWindowBlur() {
|
|
128
|
+
if (hasRestoredFocus.current) return;
|
|
129
|
+
setTimeout(function () {
|
|
130
|
+
var _focusRef$current;
|
|
131
|
+
// document.hasFocus() returns true when focus moved to an
|
|
132
|
+
// iframe on the same page, false when the window itself
|
|
133
|
+
// lost focus (e.g. user switched browser tabs)
|
|
134
|
+
if (!document.hasFocus()) return;
|
|
135
|
+
hasRestoredFocus.current = true;
|
|
136
|
+
(_focusRef$current = focusRef.current) === null || _focusRef$current === void 0 || _focusRef$current.focus();
|
|
137
|
+
}, 0);
|
|
138
|
+
};
|
|
139
|
+
window.addEventListener('blur', handleWindowBlur);
|
|
140
|
+
return function () {
|
|
141
|
+
window.removeEventListener('blur', handleWindowBlur);
|
|
142
|
+
};
|
|
143
|
+
}, [isOpen]);
|
|
119
144
|
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
|
|
120
145
|
height: "100%",
|
|
121
146
|
onClose: handleOnClose,
|
|
@@ -125,7 +150,7 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
125
150
|
width: width,
|
|
126
151
|
label: title,
|
|
127
152
|
isBlanketHidden: isBlanketHidden
|
|
128
|
-
}, /*#__PURE__*/React.createElement(LinkInfo, {
|
|
153
|
+
}, /*#__PURE__*/React.createElement(LinkInfo, _extends({
|
|
129
154
|
icon: linkIcon && {
|
|
130
155
|
icon: /*#__PURE__*/React.createElement(BaseIconElement, _extends({}, linkIcon, {
|
|
131
156
|
size: SmartLinkSize.Large
|
|
@@ -139,7 +164,9 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
139
164
|
size: width,
|
|
140
165
|
title: title,
|
|
141
166
|
testId: testId
|
|
142
|
-
}
|
|
167
|
+
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
168
|
+
focusRef: focusRef
|
|
169
|
+
} : {})), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(EmbedContent, {
|
|
143
170
|
isTrusted: isTrusted,
|
|
144
171
|
name: iframeName,
|
|
145
172
|
src: previewUrl,
|
package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js
CHANGED
|
@@ -8,7 +8,6 @@ import { cx } from '@atlaskit/css';
|
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { Box, Inline, Pressable } from '@atlaskit/primitives/compiled';
|
|
10
10
|
import Spinner from '@atlaskit/spinner';
|
|
11
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
11
|
import { getPrimitivesInlineSpaceBySize } from '../../../utils';
|
|
13
12
|
import ActionIcon from '../action-icon';
|
|
14
13
|
var styles = {
|
|
@@ -34,11 +33,14 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
34
33
|
onClickCallback();
|
|
35
34
|
}
|
|
36
35
|
}, [isDisabled, isLoading, onClickCallback]);
|
|
37
|
-
|
|
38
|
-
//
|
|
39
|
-
|
|
36
|
+
|
|
37
|
+
// FIX-ME: This is required for ResolvedHoverCardFooterBlock action to show proper size
|
|
38
|
+
// ResolvedHoverCardFooterBlock is currently not used but keeping inside the code base for
|
|
39
|
+
// upcoming experiment to refresh HoverCard design
|
|
40
|
+
// If ResolvedHoverCardFooterBlock is cleaned up, this code can be removed.
|
|
41
|
+
var showSpinnerSize24 = false;
|
|
40
42
|
var icon = iconOption && isLoading ? /*#__PURE__*/React.createElement(ActionIcon, {
|
|
41
|
-
icon:
|
|
43
|
+
icon: showSpinnerSize24 ? /*#__PURE__*/React.createElement(Box, {
|
|
42
44
|
xcss: styles.spinner
|
|
43
45
|
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
44
46
|
size: 16,
|
|
@@ -55,7 +57,7 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
55
57
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
56
58
|
,
|
|
57
59
|
style: style
|
|
58
|
-
}, fg('
|
|
60
|
+
}, fg('platform_sl_action_refactoring') ? {
|
|
59
61
|
'aria-label': ariaLabel
|
|
60
62
|
} : {}), /*#__PURE__*/React.createElement(Inline, {
|
|
61
63
|
alignBlock: "center",
|
|
@@ -18,7 +18,7 @@ export var AISummaryActionComponent = function AISummaryActionComponent(props) {
|
|
|
18
18
|
useEffect(function () {
|
|
19
19
|
onLoadingChange === null || onLoadingChange === void 0 || onLoadingChange(status === 'loading');
|
|
20
20
|
}, [onLoadingChange, status]);
|
|
21
|
-
return status === 'done' ? fg('
|
|
21
|
+
return status === 'done' ? fg('platform_sl_action_refactoring') ? /*#__PURE__*/React.createElement(CopySummaryActionNew, _extends({}, props, {
|
|
22
22
|
summary: content,
|
|
23
23
|
testId: testId
|
|
24
24
|
})) : /*#__PURE__*/React.createElement(CopySummaryAction, _extends({}, props, {
|
|
@@ -73,7 +73,7 @@ var FollowAction = function FollowAction(props) {
|
|
|
73
73
|
};
|
|
74
74
|
return /*#__PURE__*/React.createElement(ServerAction, _extends({
|
|
75
75
|
content: /*#__PURE__*/React.createElement(FormattedMessage, label)
|
|
76
|
-
}, fg('
|
|
76
|
+
}, fg('platform_sl_action_refactoring') ? {
|
|
77
77
|
ariaLabel: intl.formatMessage(label)
|
|
78
78
|
} : {}, {
|
|
79
79
|
icon: followIcon,
|
|
@@ -38,10 +38,10 @@ var ViewRelatedLinksAction = function ViewRelatedLinksAction(_ref) {
|
|
|
38
38
|
}, [actionData === null || actionData === void 0 ? void 0 : actionData.ari, fireEvent, modal, onClickCallback]);
|
|
39
39
|
return actionData ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
40
40
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links)
|
|
41
|
-
}, fg('
|
|
41
|
+
}, fg('platform_sl_action_refactoring') ? {
|
|
42
42
|
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links)
|
|
43
43
|
} : {}, {
|
|
44
|
-
icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, fg('
|
|
44
|
+
icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, fg('platform_sl_action_refactoring') ? {
|
|
45
45
|
iconSize: props.iconSize
|
|
46
46
|
} : {}),
|
|
47
47
|
onClick: onClick,
|
|
@@ -14,7 +14,6 @@ import { Provider } from '../../elements';
|
|
|
14
14
|
import Block from '../block';
|
|
15
15
|
/**
|
|
16
16
|
* Allowed footer actions for HoverCard, in display order. Fetched from context.
|
|
17
|
-
* @featureGate platform_sl_3p_auth_rovo_action_kill_switch
|
|
18
17
|
*/
|
|
19
18
|
var HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [ActionName.RovoChatAction];
|
|
20
19
|
var ignoreContainerMarginStyles = null;
|
|
@@ -48,6 +47,9 @@ var ResolvedHoverCardFooterBlock = function ResolvedHoverCardFooterBlock(_ref) {
|
|
|
48
47
|
});
|
|
49
48
|
return arr.map(function (name) {
|
|
50
49
|
var Action = name in Actions ? Actions[name] : undefined;
|
|
50
|
+
|
|
51
|
+
// Note: For the spinner to render properly, e.g. AI summary action,
|
|
52
|
+
// the spinner need to be updated. See FIX-ME comment on ActionButton
|
|
51
53
|
return Action ? /*#__PURE__*/React.createElement(Action, {
|
|
52
54
|
key: name,
|
|
53
55
|
as: "stack-item",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
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; }
|
|
4
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; }
|
|
@@ -270,16 +269,14 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
270
269
|
});
|
|
271
270
|
}
|
|
272
271
|
if (isResolved) {
|
|
273
|
-
return /*#__PURE__*/React.createElement(HoverCardResolvedView,
|
|
274
|
-
actionOptions: actionOptions
|
|
275
|
-
} : undefined, {
|
|
272
|
+
return /*#__PURE__*/React.createElement(HoverCardResolvedView, {
|
|
276
273
|
cardState: cardState,
|
|
277
274
|
extensionKey: extensionKey,
|
|
278
275
|
flexibleCardProps: flexibleCardProps,
|
|
279
276
|
isAISummaryEnabled: isAISummaryEnabled,
|
|
280
277
|
onActionClick: onActionClick,
|
|
281
278
|
titleBlockProps: titleBlockProps
|
|
282
|
-
})
|
|
279
|
+
});
|
|
283
280
|
}
|
|
284
281
|
return null;
|
|
285
282
|
}();
|
|
@@ -321,16 +318,14 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
321
318
|
});
|
|
322
319
|
}
|
|
323
320
|
if (cardState.status === 'resolved') {
|
|
324
|
-
return /*#__PURE__*/React.createElement(HoverCardResolvedView,
|
|
325
|
-
actionOptions: actionOptions
|
|
326
|
-
} : undefined, {
|
|
321
|
+
return /*#__PURE__*/React.createElement(HoverCardResolvedView, {
|
|
327
322
|
cardState: cardState,
|
|
328
323
|
extensionKey: extensionKey,
|
|
329
324
|
flexibleCardProps: flexibleCardProps,
|
|
330
325
|
isAISummaryEnabled: isAISummaryEnabled,
|
|
331
326
|
onActionClick: onActionClick,
|
|
332
327
|
titleBlockProps: titleBlockProps
|
|
333
|
-
})
|
|
328
|
+
});
|
|
334
329
|
}
|
|
335
330
|
return null;
|
|
336
331
|
};
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
var PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "45.6.
|
|
15
|
+
packageVersion: "45.6.10",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -5,6 +5,5 @@
|
|
|
5
5
|
._o5724jg8{white-space:normal}
|
|
6
6
|
._slp31hna{word-wrap:break-word}
|
|
7
7
|
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
8
|
-
._syazi7uo{color:var(--ds-text,#292a2e)}
|
|
9
8
|
._te171kdv{-ms-user-select:text}
|
|
10
9
|
._uizt1kdv{-webkit-user-select:text;-ms-user-select:text;user-select:text}
|
|
@@ -3,12 +3,9 @@ import "./index.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import Markdown from 'markdown-to-jsx';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
8
6
|
import UList from './ulist';
|
|
9
7
|
var baseStyle = null;
|
|
10
|
-
var
|
|
11
|
-
var textStyleOld = null;
|
|
8
|
+
var textStyle = null;
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* A component to render a response from AI in markdown text.
|
|
@@ -26,14 +23,11 @@ var AISummary = function AISummary(_ref) {
|
|
|
26
23
|
if (!content && minHeight === 0) {
|
|
27
24
|
return null;
|
|
28
25
|
}
|
|
29
|
-
var is3pExperimentEnabled =
|
|
30
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
31
|
-
fg('platform_sl_3p_auth_rovo_action_kill_switch') && expValEqualsNoExposure('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
32
26
|
return /*#__PURE__*/React.createElement(Markdown, {
|
|
33
27
|
"data-testid": testId
|
|
34
28
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
35
29
|
,
|
|
36
|
-
className: ax(["_11c8wadc _slp31hna _1nmz1hna _o5724jg8 _181u1kdv _1rkw1kdv _te171kdv _uizt1kdv",
|
|
30
|
+
className: ax(["_11c8wadc _slp31hna _1nmz1hna _o5724jg8 _181u1kdv _1rkw1kdv _te171kdv _uizt1kdv", "_syazazsu", className]),
|
|
37
31
|
children: content,
|
|
38
32
|
options: {
|
|
39
33
|
forceWrapper: true,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type LinkInfoProps } from './types';
|
|
2
|
-
declare const LinkInfo: ({ icon, providerName, onDownloadButtonClick, onResizeButtonClick, onViewButtonClick, size, testId, title, }: LinkInfoProps) => JSX.Element;
|
|
2
|
+
declare const LinkInfo: ({ icon, providerName, onDownloadButtonClick, onResizeButtonClick, onViewButtonClick, size, testId, title, focusRef, }: LinkInfoProps) => JSX.Element;
|
|
3
3
|
export default LinkInfo;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type RefObject } from 'react';
|
|
2
2
|
import { type IconProp } from '@atlaskit/button/new';
|
|
3
3
|
export type LinkInfoButtonProps = {
|
|
4
4
|
content: React.ReactNode;
|
|
5
|
+
focusRef?: RefObject<HTMLButtonElement>;
|
|
5
6
|
icon: IconProp;
|
|
6
7
|
label: string;
|
|
7
8
|
onClick?: () => void;
|
|
8
9
|
role?: string;
|
|
9
10
|
testId?: string;
|
|
10
11
|
};
|
|
11
|
-
declare const LinkInfoButton: ({ content, icon, label, onClick, testId, role, }: LinkInfoButtonProps) => React.JSX.Element;
|
|
12
|
+
declare const LinkInfoButton: ({ content, icon, label, onClick, testId, role, focusRef, }: LinkInfoButtonProps) => React.JSX.Element;
|
|
12
13
|
export default LinkInfoButton;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
2
|
import { type IconProps } from '../../../common/Icon';
|
|
3
3
|
export type LinkInfoProps = {
|
|
4
|
-
focusRef?: RefObject<
|
|
4
|
+
focusRef?: RefObject<HTMLButtonElement>;
|
|
5
5
|
icon?: IconProps;
|
|
6
6
|
onDownloadButtonClick?: () => void;
|
|
7
7
|
onResizeButtonClick?: () => void;
|
|
@@ -28,8 +28,7 @@ export type ActionProps = {
|
|
|
28
28
|
*/
|
|
29
29
|
asDropDownItem?: boolean;
|
|
30
30
|
/**
|
|
31
|
-
* Used
|
|
32
|
-
* Should be removed on clean up of platform_sl_3p_auth_rovo_block_card_kill_switch after finalizing which icons to use long term
|
|
31
|
+
* Used to show different icons for Rovo actions
|
|
33
32
|
*/
|
|
34
33
|
cardAppearance?: CardDisplay;
|
|
35
34
|
/**
|
|
@@ -5,10 +5,6 @@ export type AISummaryBlockProps = {
|
|
|
5
5
|
* Minimum height requirement for the AISummary component to prevent fluctuations in a card size on the summary action.
|
|
6
6
|
*/
|
|
7
7
|
aiSummaryMinHeight?: number;
|
|
8
|
-
/**
|
|
9
|
-
* Whether the platform_sl_3p_auth_rovo_action experiment value is ON for current runtime
|
|
10
|
-
*/
|
|
11
|
-
isAny3pRovoActionsExperimentOn?: boolean;
|
|
12
8
|
/**
|
|
13
9
|
* Placeholder to show when summary is not available
|
|
14
10
|
*/
|
|
@@ -126,8 +126,7 @@ export type BaseActionItem = {
|
|
|
126
126
|
*/
|
|
127
127
|
export type BaseDataActionItem = {
|
|
128
128
|
/**
|
|
129
|
-
* Used
|
|
130
|
-
* Should be removed on clean up of platform_sl_3p_auth_rovo_block_card_kill_switch after finalizing which icons to use long term
|
|
129
|
+
* Used to show different icons for Rovo actions
|
|
131
130
|
*/
|
|
132
131
|
cardAppearance?: CardDisplay;
|
|
133
132
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "45.6.
|
|
3
|
+
"version": "45.6.11",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
"jfp-magma-platform-lozenge-jump-fix": {
|
|
207
207
|
"type": "boolean"
|
|
208
208
|
},
|
|
209
|
-
"
|
|
209
|
+
"platform_sl_action_refactoring": {
|
|
210
210
|
"type": "boolean"
|
|
211
211
|
},
|
|
212
212
|
"platform-dst-shape-theme-default": {
|
|
@@ -270,6 +270,9 @@
|
|
|
270
270
|
},
|
|
271
271
|
"dfo_issue_view_remote_data_srr_group": {
|
|
272
272
|
"type": "boolean"
|
|
273
|
+
},
|
|
274
|
+
"navx-4719-a11y-embed-modal-focus-states": {
|
|
275
|
+
"type": "boolean"
|
|
273
276
|
}
|
|
274
277
|
},
|
|
275
278
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"
|