@atlaskit/smart-card 45.17.17 → 45.17.19
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 +14 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/mocks.js +4 -5
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +6 -10
- package/dist/cjs/view/EmbedModal/components/link-info/link-info-button/index.js +3 -6
- package/dist/cjs/view/EmbedModal/index.js +4 -6
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +1 -3
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/mocks.js +0 -4
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +7 -11
- package/dist/es2019/view/EmbedModal/components/link-info/link-info-button/index.js +3 -6
- package/dist/es2019/view/EmbedModal/index.js +5 -7
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/mocks.js +4 -5
- package/dist/esm/view/EmbedModal/components/link-info/index.js +6 -10
- package/dist/esm/view/EmbedModal/components/link-info/link-info-button/index.js +3 -6
- package/dist/esm/view/EmbedModal/index.js +4 -6
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/package.json +6 -9
- package/smart-card.docs.tsx +0 -353
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 45.17.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 45.17.18
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`cdf5c70f1c4ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cdf5c70f1c4ca) -
|
|
14
|
+
NAVX-5345 Cleaning up navx-4719-a11y-embed-modal-focus-states
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 45.17.17
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card" || '',
|
|
14
|
-
packageVersion: "45.17.
|
|
14
|
+
packageVersion: "45.17.18" || ''
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/cjs/utils/mocks.js
CHANGED
|
@@ -256,8 +256,7 @@ var fakeFactory = exports.fakeFactory = function fakeFactory(implementation, imp
|
|
|
256
256
|
(0, _inherits2.default)(CustomClient, _CardClient);
|
|
257
257
|
return (0, _createClass2.default)(CustomClient, [{
|
|
258
258
|
key: "fetchData",
|
|
259
|
-
value:
|
|
260
|
-
function () {
|
|
259
|
+
value: function () {
|
|
261
260
|
var _fetchData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url) {
|
|
262
261
|
return _regenerator.default.wrap(function (_context) {
|
|
263
262
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -276,7 +275,7 @@ var fakeFactory = exports.fakeFactory = function fakeFactory(implementation, imp
|
|
|
276
275
|
return _fetchData.apply(this, arguments);
|
|
277
276
|
}
|
|
278
277
|
return fetchData;
|
|
279
|
-
}()
|
|
278
|
+
}()
|
|
280
279
|
}, {
|
|
281
280
|
key: "postData",
|
|
282
281
|
value: function () {
|
|
@@ -298,7 +297,7 @@ var fakeFactory = exports.fakeFactory = function fakeFactory(implementation, imp
|
|
|
298
297
|
return _postData.apply(this, arguments);
|
|
299
298
|
}
|
|
300
299
|
return postData;
|
|
301
|
-
}()
|
|
300
|
+
}()
|
|
302
301
|
}, {
|
|
303
302
|
key: "prefetchData",
|
|
304
303
|
value: function () {
|
|
@@ -320,7 +319,7 @@ var fakeFactory = exports.fakeFactory = function fakeFactory(implementation, imp
|
|
|
320
319
|
return _prefetchData.apply(this, arguments);
|
|
321
320
|
}
|
|
322
321
|
return prefetchData;
|
|
323
|
-
}()
|
|
322
|
+
}()
|
|
324
323
|
}, {
|
|
325
324
|
key: "fetchDataAris",
|
|
326
325
|
value: function () {
|
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
require("./index.compiled.css");
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
13
|
var _reactIntl = require("react-intl");
|
|
15
14
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
@@ -18,7 +17,6 @@ var _fullscreenEnter = _interopRequireDefault(require("@atlaskit/icon/core/fulls
|
|
|
18
17
|
var _fullscreenExit = _interopRequireDefault(require("@atlaskit/icon/core/fullscreen-exit"));
|
|
19
18
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
20
19
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
21
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
20
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
23
21
|
var _messages = require("../../../../messages");
|
|
24
22
|
var _Icon = require("../../../common/Icon");
|
|
@@ -51,7 +49,7 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
51
49
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
52
50
|
formatMessage = _useIntl.formatMessage;
|
|
53
51
|
var downloadButton = (0, _react.useMemo)(function () {
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default,
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default, {
|
|
55
53
|
content: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.download),
|
|
56
54
|
icon: function icon() {
|
|
57
55
|
return /*#__PURE__*/_react.default.createElement(_download.default, {
|
|
@@ -62,10 +60,9 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
62
60
|
},
|
|
63
61
|
label: formatMessage(_messages.messages.download),
|
|
64
62
|
onClick: onDownloadButtonClick,
|
|
65
|
-
testId: "".concat(testId, "-download")
|
|
66
|
-
}, (0, _platformFeatureFlags.fg)('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
63
|
+
testId: "".concat(testId, "-download"),
|
|
67
64
|
focusRef: focusRef
|
|
68
|
-
}
|
|
65
|
+
});
|
|
69
66
|
}, [onDownloadButtonClick, testId, formatMessage, focusRef]);
|
|
70
67
|
var urlButton = (0, _react.useMemo)(function () {
|
|
71
68
|
if (onViewButtonClick) {
|
|
@@ -73,7 +70,7 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
73
70
|
providerName: providerName
|
|
74
71
|
}) : formatMessage(_messages.messages.viewOriginal);
|
|
75
72
|
var content = providerName ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.viewIn), " ", providerName) : /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.viewOriginal);
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default,
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default, {
|
|
77
74
|
content: content,
|
|
78
75
|
icon: function icon() {
|
|
79
76
|
return /*#__PURE__*/_react.default.createElement(_linkExternal.default, {
|
|
@@ -85,10 +82,9 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
85
82
|
label: label,
|
|
86
83
|
onClick: onViewButtonClick,
|
|
87
84
|
testId: "".concat(testId, "-url"),
|
|
88
|
-
role: 'link'
|
|
89
|
-
}, (0, _platformFeatureFlags.fg)('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
85
|
+
role: 'link',
|
|
90
86
|
focusRef: !onDownloadButtonClick ? focusRef : undefined
|
|
91
|
-
}
|
|
87
|
+
});
|
|
92
88
|
}
|
|
93
89
|
}, [onViewButtonClick, providerName, testId, formatMessage, onDownloadButtonClick, focusRef]);
|
|
94
90
|
var sizeButton = (0, _react.useMemo)(function () {
|
|
@@ -5,10 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _new = require("@atlaskit/button/new");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
10
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
13
11
|
var _useLinkClicked = require("../../../../../state/analytics/useLinkClicked");
|
|
14
12
|
var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
@@ -25,16 +23,15 @@ var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
|
25
23
|
hideTooltipOnClick: true,
|
|
26
24
|
tag: "span",
|
|
27
25
|
testId: "".concat(testId, "-tooltip")
|
|
28
|
-
}, /*#__PURE__*/_react.default.createElement(_new.IconButton,
|
|
26
|
+
}, /*#__PURE__*/_react.default.createElement(_new.IconButton, {
|
|
29
27
|
appearance: "subtle",
|
|
30
28
|
icon: icon,
|
|
31
29
|
label: label,
|
|
32
30
|
onClick: onClick,
|
|
33
31
|
onMouseDown: onMouseDown,
|
|
34
32
|
testId: "".concat(testId, "-button"),
|
|
35
|
-
role: role
|
|
36
|
-
}, (0, _platformFeatureFlags.fg)('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
33
|
+
role: role,
|
|
37
34
|
ref: focusRef
|
|
38
|
-
}
|
|
35
|
+
}));
|
|
39
36
|
};
|
|
40
37
|
var _default = exports.default = LinkInfoButton;
|
|
@@ -10,7 +10,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _useThemeObserver = require("@atlaskit/tokens/use-theme-observer");
|
|
15
14
|
var _constants = require("../../constants");
|
|
16
15
|
var _useInvokeClientAction = _interopRequireDefault(require("../../state/hooks/use-invoke-client-action"));
|
|
@@ -129,7 +128,7 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
129
128
|
var focusRef = (0, _react.useRef)(null);
|
|
130
129
|
var hasRestoredFocus = (0, _react.useRef)(false);
|
|
131
130
|
(0, _react.useEffect)(function () {
|
|
132
|
-
if (!isOpen
|
|
131
|
+
if (!isOpen) {
|
|
133
132
|
hasRestoredFocus.current = false;
|
|
134
133
|
return;
|
|
135
134
|
}
|
|
@@ -162,7 +161,7 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
162
161
|
width: width,
|
|
163
162
|
label: title,
|
|
164
163
|
isBlanketHidden: isBlanketHidden
|
|
165
|
-
}, /*#__PURE__*/_react.default.createElement(_linkInfo.default,
|
|
164
|
+
}, /*#__PURE__*/_react.default.createElement(_linkInfo.default, {
|
|
166
165
|
icon: linkIcon && {
|
|
167
166
|
icon: /*#__PURE__*/_react.default.createElement(_common.BaseIconElement, (0, _extends2.default)({}, linkIcon, {
|
|
168
167
|
size: _constants.SmartLinkSize.Large
|
|
@@ -175,10 +174,9 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
175
174
|
onResizeButtonClick: handleOnResizeClick,
|
|
176
175
|
size: width,
|
|
177
176
|
title: title,
|
|
178
|
-
testId: testId
|
|
179
|
-
}, (0, _platformFeatureFlags.fg)('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
177
|
+
testId: testId,
|
|
180
178
|
focusRef: focusRef
|
|
181
|
-
}
|
|
179
|
+
}), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_embedContent.default, {
|
|
182
180
|
isTrusted: isTrusted,
|
|
183
181
|
name: iframeName,
|
|
184
182
|
src: previewUrl,
|
|
@@ -279,9 +279,7 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
279
279
|
role: role,
|
|
280
280
|
titleId: titleId,
|
|
281
281
|
label: label,
|
|
282
|
-
shouldRenderToParent: shouldRenderToParent
|
|
283
|
-
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
284
|
-
,
|
|
282
|
+
shouldRenderToParent: shouldRenderToParent,
|
|
285
283
|
popupComponent: popupComponent
|
|
286
284
|
});
|
|
287
285
|
};
|
|
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
19
19
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
20
20
|
var PACKAGE_DATA = {
|
|
21
21
|
packageName: "@atlaskit/smart-card",
|
|
22
|
-
packageVersion: "45.17.
|
|
22
|
+
packageVersion: "45.17.18",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -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: "45.17.
|
|
5
|
+
packageVersion: "45.17.18" || ''
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -234,19 +234,15 @@ export const mocks = {
|
|
|
234
234
|
};
|
|
235
235
|
export const fakeResponse = () => Promise.resolve(mocks.success);
|
|
236
236
|
export const fakeFactory = (implementation, implementationPost, implementationPrefetch, implementationAri) => class CustomClient extends CardClient {
|
|
237
|
-
// @ts-ignore
|
|
238
237
|
async fetchData(url) {
|
|
239
238
|
return await implementation(url);
|
|
240
239
|
}
|
|
241
|
-
// @ts-ignore
|
|
242
240
|
async postData() {
|
|
243
241
|
return await implementationPost();
|
|
244
242
|
}
|
|
245
|
-
// @ts-ignore
|
|
246
243
|
async prefetchData() {
|
|
247
244
|
return await implementationPrefetch();
|
|
248
245
|
}
|
|
249
|
-
// @ts-ignore
|
|
250
246
|
async fetchDataAris(aris) {
|
|
251
247
|
return await implementationAri(aris);
|
|
252
248
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v2.0.0 */
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import "./index.compiled.css";
|
|
4
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
4
|
import React, { useMemo } from 'react';
|
|
@@ -10,7 +9,6 @@ import VidFullScreenOnIcon from '@atlaskit/icon/core/fullscreen-enter';
|
|
|
10
9
|
import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
|
|
11
10
|
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
12
11
|
import { CloseButton, useModal } from '@atlaskit/modal-dialog';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
13
|
import { messages } from '../../../../messages';
|
|
16
14
|
import { Icon } from '../../../common/Icon';
|
|
@@ -44,7 +42,7 @@ const LinkInfo = ({
|
|
|
44
42
|
const {
|
|
45
43
|
formatMessage
|
|
46
44
|
} = useIntl();
|
|
47
|
-
const downloadButton = useMemo(() => /*#__PURE__*/React.createElement(LinkInfoButton,
|
|
45
|
+
const downloadButton = useMemo(() => /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
48
46
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
|
|
49
47
|
icon: () => /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
50
48
|
label: "",
|
|
@@ -53,17 +51,16 @@ const LinkInfo = ({
|
|
|
53
51
|
}),
|
|
54
52
|
label: formatMessage(messages.download),
|
|
55
53
|
onClick: onDownloadButtonClick,
|
|
56
|
-
testId: `${testId}-download
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} : {})), [onDownloadButtonClick, testId, formatMessage, focusRef]);
|
|
54
|
+
testId: `${testId}-download`,
|
|
55
|
+
focusRef: focusRef
|
|
56
|
+
}), [onDownloadButtonClick, testId, formatMessage, focusRef]);
|
|
60
57
|
const urlButton = useMemo(() => {
|
|
61
58
|
if (onViewButtonClick) {
|
|
62
59
|
const label = providerName ? formatMessage(messages.viewInProvider, {
|
|
63
60
|
providerName
|
|
64
61
|
}) : formatMessage(messages.viewOriginal);
|
|
65
62
|
const content = providerName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.viewIn), " ", providerName) : /*#__PURE__*/React.createElement(FormattedMessage, messages.viewOriginal);
|
|
66
|
-
return /*#__PURE__*/React.createElement(LinkInfoButton,
|
|
63
|
+
return /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
67
64
|
content: content,
|
|
68
65
|
icon: () => /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
69
66
|
label: "",
|
|
@@ -73,10 +70,9 @@ const LinkInfo = ({
|
|
|
73
70
|
label: label,
|
|
74
71
|
onClick: onViewButtonClick,
|
|
75
72
|
testId: `${testId}-url`,
|
|
76
|
-
role: 'link'
|
|
77
|
-
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
73
|
+
role: 'link',
|
|
78
74
|
focusRef: !onDownloadButtonClick ? focusRef : undefined
|
|
79
|
-
}
|
|
75
|
+
});
|
|
80
76
|
}
|
|
81
77
|
}, [onViewButtonClick, providerName, testId, formatMessage, onDownloadButtonClick, focusRef]);
|
|
82
78
|
const sizeButton = useMemo(() => {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { IconButton } from '@atlaskit/button/new';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
4
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
7
5
|
const LinkInfoButton = ({
|
|
@@ -19,16 +17,15 @@ const LinkInfoButton = ({
|
|
|
19
17
|
hideTooltipOnClick: true,
|
|
20
18
|
tag: "span",
|
|
21
19
|
testId: `${testId}-tooltip`
|
|
22
|
-
}, /*#__PURE__*/React.createElement(IconButton,
|
|
20
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
23
21
|
appearance: "subtle",
|
|
24
22
|
icon: icon,
|
|
25
23
|
label: label,
|
|
26
24
|
onClick: onClick,
|
|
27
25
|
onMouseDown: onMouseDown,
|
|
28
26
|
testId: `${testId}-button`,
|
|
29
|
-
role: role
|
|
30
|
-
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
27
|
+
role: role,
|
|
31
28
|
ref: focusRef
|
|
32
|
-
}
|
|
29
|
+
}));
|
|
33
30
|
};
|
|
34
31
|
export default LinkInfoButton;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import ModalDialog, { ModalBody, ModalTransition } from '@atlaskit/modal-dialog';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { useThemeObserver } from '@atlaskit/tokens/use-theme-observer';
|
|
6
5
|
import { SmartLinkSize } from '../../constants';
|
|
7
6
|
import useInvokeClientAction from '../../state/hooks/use-invoke-client-action';
|
|
@@ -105,7 +104,7 @@ const EmbedModal = ({
|
|
|
105
104
|
const focusRef = useRef(null);
|
|
106
105
|
const hasRestoredFocus = useRef(false);
|
|
107
106
|
useEffect(() => {
|
|
108
|
-
if (!isOpen
|
|
107
|
+
if (!isOpen) {
|
|
109
108
|
hasRestoredFocus.current = false;
|
|
110
109
|
return;
|
|
111
110
|
}
|
|
@@ -138,7 +137,7 @@ const EmbedModal = ({
|
|
|
138
137
|
width: width,
|
|
139
138
|
label: title,
|
|
140
139
|
isBlanketHidden: isBlanketHidden
|
|
141
|
-
}, /*#__PURE__*/React.createElement(LinkInfo,
|
|
140
|
+
}, /*#__PURE__*/React.createElement(LinkInfo, {
|
|
142
141
|
icon: linkIcon && {
|
|
143
142
|
icon: /*#__PURE__*/React.createElement(BaseIconElement, _extends({}, linkIcon, {
|
|
144
143
|
size: SmartLinkSize.Large
|
|
@@ -151,10 +150,9 @@ const EmbedModal = ({
|
|
|
151
150
|
onResizeButtonClick: handleOnResizeClick,
|
|
152
151
|
size: width,
|
|
153
152
|
title: title,
|
|
154
|
-
testId: testId
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
} : {})), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(EmbedContent, {
|
|
153
|
+
testId: testId,
|
|
154
|
+
focusRef: focusRef
|
|
155
|
+
}), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(EmbedContent, {
|
|
158
156
|
isTrusted: isTrusted,
|
|
159
157
|
name: iframeName,
|
|
160
158
|
src: previewUrl,
|
|
@@ -255,9 +255,7 @@ export const HoverCardComponent = ({
|
|
|
255
255
|
role: role,
|
|
256
256
|
titleId: titleId,
|
|
257
257
|
label: label,
|
|
258
|
-
shouldRenderToParent: shouldRenderToParent
|
|
259
|
-
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
260
|
-
,
|
|
258
|
+
shouldRenderToParent: shouldRenderToParent,
|
|
261
259
|
popupComponent: popupComponent
|
|
262
260
|
});
|
|
263
261
|
};
|
|
@@ -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.17.
|
|
12
|
+
packageVersion: "45.17.18",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -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.17.
|
|
7
|
+
packageVersion: "45.17.18" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/utils/mocks.js
CHANGED
|
@@ -249,8 +249,7 @@ export var fakeFactory = function fakeFactory(implementation, implementationPost
|
|
|
249
249
|
_inherits(CustomClient, _CardClient);
|
|
250
250
|
return _createClass(CustomClient, [{
|
|
251
251
|
key: "fetchData",
|
|
252
|
-
value:
|
|
253
|
-
function () {
|
|
252
|
+
value: function () {
|
|
254
253
|
var _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url) {
|
|
255
254
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
256
255
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -269,7 +268,7 @@ export var fakeFactory = function fakeFactory(implementation, implementationPost
|
|
|
269
268
|
return _fetchData.apply(this, arguments);
|
|
270
269
|
}
|
|
271
270
|
return fetchData;
|
|
272
|
-
}()
|
|
271
|
+
}()
|
|
273
272
|
}, {
|
|
274
273
|
key: "postData",
|
|
275
274
|
value: function () {
|
|
@@ -291,7 +290,7 @@ export var fakeFactory = function fakeFactory(implementation, implementationPost
|
|
|
291
290
|
return _postData.apply(this, arguments);
|
|
292
291
|
}
|
|
293
292
|
return postData;
|
|
294
|
-
}()
|
|
293
|
+
}()
|
|
295
294
|
}, {
|
|
296
295
|
key: "prefetchData",
|
|
297
296
|
value: function () {
|
|
@@ -313,7 +312,7 @@ export var fakeFactory = function fakeFactory(implementation, implementationPost
|
|
|
313
312
|
return _prefetchData.apply(this, arguments);
|
|
314
313
|
}
|
|
315
314
|
return prefetchData;
|
|
316
|
-
}()
|
|
315
|
+
}()
|
|
317
316
|
}, {
|
|
318
317
|
key: "fetchDataAris",
|
|
319
318
|
value: function () {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v2.0.0 */
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import "./index.compiled.css";
|
|
4
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
4
|
import React, { useMemo } from 'react';
|
|
@@ -10,7 +9,6 @@ import VidFullScreenOnIcon from '@atlaskit/icon/core/fullscreen-enter';
|
|
|
10
9
|
import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
|
|
11
10
|
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
12
11
|
import { CloseButton, useModal } from '@atlaskit/modal-dialog';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
13
|
import { messages } from '../../../../messages';
|
|
16
14
|
import { Icon } from '../../../common/Icon';
|
|
@@ -42,7 +40,7 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
42
40
|
var _useIntl = useIntl(),
|
|
43
41
|
formatMessage = _useIntl.formatMessage;
|
|
44
42
|
var downloadButton = useMemo(function () {
|
|
45
|
-
return /*#__PURE__*/React.createElement(LinkInfoButton,
|
|
43
|
+
return /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
46
44
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
|
|
47
45
|
icon: function icon() {
|
|
48
46
|
return /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
@@ -53,10 +51,9 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
53
51
|
},
|
|
54
52
|
label: formatMessage(messages.download),
|
|
55
53
|
onClick: onDownloadButtonClick,
|
|
56
|
-
testId: "".concat(testId, "-download")
|
|
57
|
-
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
54
|
+
testId: "".concat(testId, "-download"),
|
|
58
55
|
focusRef: focusRef
|
|
59
|
-
}
|
|
56
|
+
});
|
|
60
57
|
}, [onDownloadButtonClick, testId, formatMessage, focusRef]);
|
|
61
58
|
var urlButton = useMemo(function () {
|
|
62
59
|
if (onViewButtonClick) {
|
|
@@ -64,7 +61,7 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
64
61
|
providerName: providerName
|
|
65
62
|
}) : formatMessage(messages.viewOriginal);
|
|
66
63
|
var content = providerName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.viewIn), " ", providerName) : /*#__PURE__*/React.createElement(FormattedMessage, messages.viewOriginal);
|
|
67
|
-
return /*#__PURE__*/React.createElement(LinkInfoButton,
|
|
64
|
+
return /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
68
65
|
content: content,
|
|
69
66
|
icon: function icon() {
|
|
70
67
|
return /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
@@ -76,10 +73,9 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
76
73
|
label: label,
|
|
77
74
|
onClick: onViewButtonClick,
|
|
78
75
|
testId: "".concat(testId, "-url"),
|
|
79
|
-
role: 'link'
|
|
80
|
-
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
76
|
+
role: 'link',
|
|
81
77
|
focusRef: !onDownloadButtonClick ? focusRef : undefined
|
|
82
|
-
}
|
|
78
|
+
});
|
|
83
79
|
}
|
|
84
80
|
}, [onViewButtonClick, providerName, testId, formatMessage, onDownloadButtonClick, focusRef]);
|
|
85
81
|
var sizeButton = useMemo(function () {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { IconButton } from '@atlaskit/button/new';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
4
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
7
5
|
var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
@@ -18,16 +16,15 @@ var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
|
18
16
|
hideTooltipOnClick: true,
|
|
19
17
|
tag: "span",
|
|
20
18
|
testId: "".concat(testId, "-tooltip")
|
|
21
|
-
}, /*#__PURE__*/React.createElement(IconButton,
|
|
19
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
22
20
|
appearance: "subtle",
|
|
23
21
|
icon: icon,
|
|
24
22
|
label: label,
|
|
25
23
|
onClick: onClick,
|
|
26
24
|
onMouseDown: onMouseDown,
|
|
27
25
|
testId: "".concat(testId, "-button"),
|
|
28
|
-
role: role
|
|
29
|
-
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
26
|
+
role: role,
|
|
30
27
|
ref: focusRef
|
|
31
|
-
}
|
|
28
|
+
}));
|
|
32
29
|
};
|
|
33
30
|
export default LinkInfoButton;
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
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';
|
|
6
5
|
import { useThemeObserver } from '@atlaskit/tokens/use-theme-observer';
|
|
7
6
|
import { SmartLinkSize } from '../../constants';
|
|
8
7
|
import useInvokeClientAction from '../../state/hooks/use-invoke-client-action';
|
|
@@ -120,7 +119,7 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
120
119
|
var focusRef = useRef(null);
|
|
121
120
|
var hasRestoredFocus = useRef(false);
|
|
122
121
|
useEffect(function () {
|
|
123
|
-
if (!isOpen
|
|
122
|
+
if (!isOpen) {
|
|
124
123
|
hasRestoredFocus.current = false;
|
|
125
124
|
return;
|
|
126
125
|
}
|
|
@@ -153,7 +152,7 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
153
152
|
width: width,
|
|
154
153
|
label: title,
|
|
155
154
|
isBlanketHidden: isBlanketHidden
|
|
156
|
-
}, /*#__PURE__*/React.createElement(LinkInfo,
|
|
155
|
+
}, /*#__PURE__*/React.createElement(LinkInfo, {
|
|
157
156
|
icon: linkIcon && {
|
|
158
157
|
icon: /*#__PURE__*/React.createElement(BaseIconElement, _extends({}, linkIcon, {
|
|
159
158
|
size: SmartLinkSize.Large
|
|
@@ -166,10 +165,9 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
166
165
|
onResizeButtonClick: handleOnResizeClick,
|
|
167
166
|
size: width,
|
|
168
167
|
title: title,
|
|
169
|
-
testId: testId
|
|
170
|
-
}, fg('navx-4719-a11y-embed-modal-focus-states') ? {
|
|
168
|
+
testId: testId,
|
|
171
169
|
focusRef: focusRef
|
|
172
|
-
}
|
|
170
|
+
}), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(EmbedContent, {
|
|
173
171
|
isTrusted: isTrusted,
|
|
174
172
|
name: iframeName,
|
|
175
173
|
src: previewUrl,
|
|
@@ -270,9 +270,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
270
270
|
role: role,
|
|
271
271
|
titleId: titleId,
|
|
272
272
|
label: label,
|
|
273
|
-
shouldRenderToParent: shouldRenderToParent
|
|
274
|
-
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
275
|
-
,
|
|
273
|
+
shouldRenderToParent: shouldRenderToParent,
|
|
276
274
|
popupComponent: popupComponent
|
|
277
275
|
});
|
|
278
276
|
};
|
|
@@ -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.17.
|
|
15
|
+
packageVersion: "45.17.18",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "45.17.
|
|
3
|
+
"version": "45.17.19",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"ak-postbuild": "ls -d dist/* | xargs -n 1 copyfiles -u 1 -V src/**/*.{svg,png}"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@atlaskit/adf-utils": "^20.
|
|
38
|
+
"@atlaskit/adf-utils": "^20.6.0",
|
|
39
39
|
"@atlaskit/afm-i18n-platform-linking-platform-smart-card": "2.201.0",
|
|
40
40
|
"@atlaskit/analytics-cross-product": "^2.1.0",
|
|
41
41
|
"@atlaskit/analytics-gas-types": "^6.0.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@atlaskit/linking-common": "^11.1.0",
|
|
68
68
|
"@atlaskit/linking-types": "^15.0.0",
|
|
69
69
|
"@atlaskit/logo": "^21.4.0",
|
|
70
|
-
"@atlaskit/lozenge": "^15.
|
|
70
|
+
"@atlaskit/lozenge": "^15.1.0",
|
|
71
71
|
"@atlaskit/menu": "^10.0.0",
|
|
72
72
|
"@atlaskit/modal-dialog": "^16.3.0",
|
|
73
73
|
"@atlaskit/motion": "^8.0.0",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"@atlaskit/popup": "^6.0.0",
|
|
79
79
|
"@atlaskit/primitives": "^22.2.0",
|
|
80
80
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
81
|
-
"@atlaskit/react-ufo": "^7.
|
|
82
|
-
"@atlaskit/rovo-triggers": "^10.
|
|
81
|
+
"@atlaskit/react-ufo": "^7.6.0",
|
|
82
|
+
"@atlaskit/rovo-triggers": "^10.13.0",
|
|
83
83
|
"@atlaskit/section-message": "^10.0.0",
|
|
84
84
|
"@atlaskit/select": "^22.6.0",
|
|
85
85
|
"@atlaskit/spinner": "^20.1.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@atlaskit/textfield": "^10.0.0",
|
|
89
89
|
"@atlaskit/theme": "^28.0.0",
|
|
90
90
|
"@atlaskit/tile": "^4.0.0",
|
|
91
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
91
|
+
"@atlaskit/tmp-editor-statsig": "^148.0.0",
|
|
92
92
|
"@atlaskit/tokens": "^16.7.0",
|
|
93
93
|
"@atlaskit/tooltip": "^24.0.0",
|
|
94
94
|
"@atlaskit/ufo": "^1.0.0",
|
|
@@ -279,9 +279,6 @@
|
|
|
279
279
|
"dfo_issue_view_remote_data_srr_group": {
|
|
280
280
|
"type": "boolean"
|
|
281
281
|
},
|
|
282
|
-
"navx-4719-a11y-embed-modal-focus-states": {
|
|
283
|
-
"type": "boolean"
|
|
284
|
-
},
|
|
285
282
|
"navx-5343-sl-action-block-styling-fixes": {
|
|
286
283
|
"type": "boolean"
|
|
287
284
|
},
|
package/smart-card.docs.tsx
DELETED
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Testing structured MCP docs for review — ignore this file.
|
|
3
|
-
* Contact #dst-structured-content in Slack with questions.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import path from 'path';
|
|
7
|
-
|
|
8
|
-
import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
|
|
9
|
-
|
|
10
|
-
import packageJson from './package.json';
|
|
11
|
-
|
|
12
|
-
const packagePath = path.resolve(__dirname);
|
|
13
|
-
|
|
14
|
-
const documentation: StructuredContentSource = {
|
|
15
|
-
components: [
|
|
16
|
-
{
|
|
17
|
-
name: 'Card',
|
|
18
|
-
description:
|
|
19
|
-
'Smart Links enhance URLs into interactive previews, offering a contextualized experience within Atlassian products. They come in inline, block, and embed formats, respecting content permissions and compliance settings.',
|
|
20
|
-
status: 'general-availability',
|
|
21
|
-
import: {
|
|
22
|
-
name: 'Card',
|
|
23
|
-
package: '@atlaskit/smart-card',
|
|
24
|
-
type: 'named',
|
|
25
|
-
packagePath,
|
|
26
|
-
packageJson,
|
|
27
|
-
},
|
|
28
|
-
usageGuidelines: [
|
|
29
|
-
'Use inline for links in body text; block when you need extra context or a card-style preview; embed when users should engage with the linked content in place.',
|
|
30
|
-
],
|
|
31
|
-
contentGuidelines: [],
|
|
32
|
-
accessibilityGuidelines: [
|
|
33
|
-
'Use descriptive link text for inline appearance; avoid generic "click here" or the raw URL when possible.',
|
|
34
|
-
'Ensure the card container is keyboard focusable and has a clear accessible name indicating it is a link or preview.',
|
|
35
|
-
'Ensure loading and error states are announced to screen readers (e.g. aria-live or status text).',
|
|
36
|
-
],
|
|
37
|
-
keywords: ['smart-card', 'card', 'smart link', 'inline', 'block', 'embed', 'link', 'preview'],
|
|
38
|
-
categories: ['linking', 'data-display'],
|
|
39
|
-
examples: [
|
|
40
|
-
{
|
|
41
|
-
name: 'Card (basic)',
|
|
42
|
-
description:
|
|
43
|
-
'Inline, block, and embed appearances shown side by side. Requires staging login to resolve links.',
|
|
44
|
-
source: path.resolve(packagePath, './examples/content/card.tsx'),
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: 'Card (appearance: block)',
|
|
48
|
-
description:
|
|
49
|
-
'Block appearance — card-style preview with detailed view of the linked material. In the editor this is referred to as the "Card".',
|
|
50
|
-
source: path.resolve(packagePath, './examples/content/block-card.tsx'),
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'Card (appearance: inline)',
|
|
54
|
-
description:
|
|
55
|
-
'Inline appearance — link in text like a hyperlink. Use showHoverPreview for hover preview on inline Smart Links.',
|
|
56
|
-
source: path.resolve(packagePath, './examples/content/inline-card.tsx'),
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: 'Card (appearance: embed)',
|
|
60
|
-
description:
|
|
61
|
-
'Embed appearance — linked content rendered in place. Requires a resolvable embed URL; not all links support embed.',
|
|
62
|
-
source: path.resolve(packagePath, './examples/content/embed-card.tsx'),
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'HoverCard',
|
|
68
|
-
description:
|
|
69
|
-
'Hover cards can be used as a standalone component to wrap any React component and display information about a supplied URL when the user hovers over the child. Different actions are shown depending on the resource type.',
|
|
70
|
-
status: 'general-availability',
|
|
71
|
-
import: {
|
|
72
|
-
name: 'HoverCard',
|
|
73
|
-
package: '@atlaskit/smart-card/hover-card',
|
|
74
|
-
type: 'named',
|
|
75
|
-
packagePath,
|
|
76
|
-
packageJson,
|
|
77
|
-
},
|
|
78
|
-
usageGuidelines: [
|
|
79
|
-
'Use when you need a Smart Link preview on hover over a custom trigger (e.g. text, icon). For hover preview on inline Smart Links in body text, use Card with showHoverPreview instead.',
|
|
80
|
-
],
|
|
81
|
-
contentGuidelines: [],
|
|
82
|
-
accessibilityGuidelines: [
|
|
83
|
-
'Provide a keyboard-accessible way to open the preview (e.g. focus or explicit trigger); do not rely on hover alone.',
|
|
84
|
-
'Ensure the trigger element has an accessible name and role (e.g. link or button).',
|
|
85
|
-
'Ensure the hover card content is announced when shown (e.g. aria-describedby or live region) and can be dismissed via keyboard.',
|
|
86
|
-
],
|
|
87
|
-
keywords: ['smart-card', 'hover card', 'hover', 'preview', 'smart link'],
|
|
88
|
-
categories: ['linking', 'data-display', 'interaction'],
|
|
89
|
-
examples: [
|
|
90
|
-
{
|
|
91
|
-
name: 'Hover card',
|
|
92
|
-
description:
|
|
93
|
-
'HoverCard wrapping a trigger element; shows Smart Link preview on hover. Requires staging login to resolve.',
|
|
94
|
-
source: path.resolve(packagePath, './examples/content/hover-card.tsx'),
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
name: 'LinkUrl',
|
|
100
|
-
description:
|
|
101
|
-
'LinkUrl is a plain hyperlink (<a>) with a built-in safety check. Use it when you want to warn users if the link description looks like one URL but the actual destination is different.',
|
|
102
|
-
status: 'general-availability',
|
|
103
|
-
import: {
|
|
104
|
-
name: 'LinkUrl',
|
|
105
|
-
package: '@atlaskit/smart-card/link-url',
|
|
106
|
-
type: 'default',
|
|
107
|
-
packagePath,
|
|
108
|
-
packageJson,
|
|
109
|
-
},
|
|
110
|
-
usageGuidelines: [
|
|
111
|
-
'Use when the link text might look like one URL but point elsewhere—e.g. user-generated or external links—so users get a warning before navigating.',
|
|
112
|
-
],
|
|
113
|
-
contentGuidelines: [],
|
|
114
|
-
accessibilityGuidelines: [
|
|
115
|
-
'Use descriptive link text that indicates the destination or action; avoid exposing only the URL when possible.',
|
|
116
|
-
'Ensure the safety-check warning (when link text and destination differ) is announced to screen readers.',
|
|
117
|
-
],
|
|
118
|
-
keywords: ['smart-card', 'link', 'url', 'safety', 'hyperlink'],
|
|
119
|
-
categories: ['linking', 'interaction'],
|
|
120
|
-
examples: [
|
|
121
|
-
{
|
|
122
|
-
name: 'Link URL',
|
|
123
|
-
description:
|
|
124
|
-
'Link safety: when link text looks like a URL but destination differs (warning) vs when text matches or is plain (no warning).',
|
|
125
|
-
source: path.resolve(packagePath, './examples/content/link-url.tsx'),
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
name: 'FlexibleCard',
|
|
131
|
-
description:
|
|
132
|
-
'Flexible Smart Links (FlexibleCard / Flexible UI) is a composable system of data elements inside UI blocks for building custom Smart Link views. It does not affect inline, block, or embed appearance.',
|
|
133
|
-
status: 'general-availability',
|
|
134
|
-
import: {
|
|
135
|
-
name: 'TitleBlock',
|
|
136
|
-
package: '@atlaskit/smart-card',
|
|
137
|
-
type: 'named',
|
|
138
|
-
packagePath,
|
|
139
|
-
packageJson,
|
|
140
|
-
},
|
|
141
|
-
usageGuidelines: [
|
|
142
|
-
'Use when you need a custom block-style Smart Link layout. Define the layout with blocks first (title, metadata, preview, footer), then add elements inside blocks for granular content.',
|
|
143
|
-
],
|
|
144
|
-
contentGuidelines: [],
|
|
145
|
-
accessibilityGuidelines: [
|
|
146
|
-
'Use a logical structure (e.g. heading hierarchy) so the card is navigable by assistive tech.',
|
|
147
|
-
'Ensure all interactive elements inside blocks (links, buttons, actions) are focusable and have accessible names.',
|
|
148
|
-
],
|
|
149
|
-
keywords: [
|
|
150
|
-
'smart-card',
|
|
151
|
-
'flexible',
|
|
152
|
-
'flexible card',
|
|
153
|
-
'flexible ui',
|
|
154
|
-
'blocks',
|
|
155
|
-
'elements',
|
|
156
|
-
'composable',
|
|
157
|
-
],
|
|
158
|
-
categories: ['linking', 'data-display'],
|
|
159
|
-
examples: [
|
|
160
|
-
{
|
|
161
|
-
name: 'Flexible UI card',
|
|
162
|
-
description:
|
|
163
|
-
'Custom block layout with TitleBlock, PreviewBlock, MetadataBlock, SnippetBlock, and FooterBlock composed inside Card.',
|
|
164
|
-
source: path.resolve(packagePath, './examples/content/flexible-ui-card.tsx'),
|
|
165
|
-
},
|
|
166
|
-
],
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
name: 'TitleBlock',
|
|
170
|
-
description:
|
|
171
|
-
'A block component for the Smart Link title row. Used inside FlexibleCard to show title, icon, and optional metadata and actions.',
|
|
172
|
-
status: 'general-availability',
|
|
173
|
-
import: {
|
|
174
|
-
name: 'TitleBlock',
|
|
175
|
-
package: '@atlaskit/smart-card',
|
|
176
|
-
type: 'named',
|
|
177
|
-
packagePath,
|
|
178
|
-
packageJson,
|
|
179
|
-
},
|
|
180
|
-
usageGuidelines: [
|
|
181
|
-
'Use for the main title row of a block Smart Link when you need title, icon, optional subtitle, metadata, or actions in one row.',
|
|
182
|
-
],
|
|
183
|
-
contentGuidelines: [],
|
|
184
|
-
accessibilityGuidelines: [
|
|
185
|
-
'Ensure the title is exposed as a heading or has an accessible name so it is announced as the primary label for the card.',
|
|
186
|
-
'If the title row icon conveys meaning, give it an accessible name (e.g. aria-label); otherwise mark as decorative.',
|
|
187
|
-
],
|
|
188
|
-
keywords: ['smart-card', 'title block', 'flexible', 'block'],
|
|
189
|
-
categories: ['linking', 'data-display'],
|
|
190
|
-
examples: [
|
|
191
|
-
{
|
|
192
|
-
name: 'Title block default',
|
|
193
|
-
description:
|
|
194
|
-
'TitleBlock with default props; title and icon come from the resolved link data.',
|
|
195
|
-
source: path.resolve(packagePath, './examples/content/title-block-default.tsx'),
|
|
196
|
-
},
|
|
197
|
-
],
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
name: 'MetadataBlock',
|
|
201
|
-
description:
|
|
202
|
-
'A block component that displays a row of metadata elements (e.g. created by, due date, state) in a Smart Link.',
|
|
203
|
-
status: 'general-availability',
|
|
204
|
-
import: {
|
|
205
|
-
name: 'MetadataBlock',
|
|
206
|
-
package: '@atlaskit/smart-card',
|
|
207
|
-
type: 'named',
|
|
208
|
-
packagePath,
|
|
209
|
-
packageJson,
|
|
210
|
-
},
|
|
211
|
-
usageGuidelines: [
|
|
212
|
-
'Use when you need a single row of metadata (e.g. created by, due date, state) in a block Smart Link.',
|
|
213
|
-
],
|
|
214
|
-
contentGuidelines: [],
|
|
215
|
-
accessibilityGuidelines: [
|
|
216
|
-
'Ensure metadata is available to screen readers (e.g. not conveyed only by color or icon).',
|
|
217
|
-
'Use a list or group with an accessible name if the metadata row has a specific purpose (e.g. "Contributors", "Dates").',
|
|
218
|
-
],
|
|
219
|
-
keywords: ['smart-card', 'metadata block', 'flexible', 'block', 'metadata'],
|
|
220
|
-
categories: ['linking', 'data-display'],
|
|
221
|
-
examples: [
|
|
222
|
-
{
|
|
223
|
-
name: 'Metadata block primary',
|
|
224
|
-
description:
|
|
225
|
-
'MetadataBlock with a primary row showing CollaboratorGroup and ModifiedOn elements.',
|
|
226
|
-
source: path.resolve(packagePath, './examples/content/metadata-block-primary.tsx'),
|
|
227
|
-
},
|
|
228
|
-
],
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
name: 'PreviewBlock',
|
|
232
|
-
description: 'A block component that displays a preview image or media for the Smart Link.',
|
|
233
|
-
status: 'general-availability',
|
|
234
|
-
import: {
|
|
235
|
-
name: 'PreviewBlock',
|
|
236
|
-
package: '@atlaskit/smart-card',
|
|
237
|
-
type: 'named',
|
|
238
|
-
packagePath,
|
|
239
|
-
packageJson,
|
|
240
|
-
},
|
|
241
|
-
usageGuidelines: [
|
|
242
|
-
'Use when the linked resource has a preview image or media and you want to surface it in the block card.',
|
|
243
|
-
],
|
|
244
|
-
contentGuidelines: [],
|
|
245
|
-
accessibilityGuidelines: [
|
|
246
|
-
'If the preview image conveys information, provide meaningful alt text; if purely decorative, use alt="" or aria-hidden.',
|
|
247
|
-
'Ensure no critical information is shown only in the preview; duplicate in text or metadata when needed.',
|
|
248
|
-
],
|
|
249
|
-
keywords: ['smart-card', 'preview block', 'flexible', 'block', 'preview', 'image'],
|
|
250
|
-
categories: ['linking', 'data-display'],
|
|
251
|
-
examples: [
|
|
252
|
-
{
|
|
253
|
-
name: 'Preview block default',
|
|
254
|
-
description: "PreviewBlock showing the resolved link's preview image when available.",
|
|
255
|
-
source: path.resolve(packagePath, './examples/content/preview-block-default.tsx'),
|
|
256
|
-
},
|
|
257
|
-
],
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
name: 'FooterBlock',
|
|
261
|
-
description:
|
|
262
|
-
'A block component for the Smart Link footer, typically showing actions (e.g. copy, open, follow).',
|
|
263
|
-
status: 'general-availability',
|
|
264
|
-
import: {
|
|
265
|
-
name: 'FooterBlock',
|
|
266
|
-
package: '@atlaskit/smart-card',
|
|
267
|
-
type: 'named',
|
|
268
|
-
packagePath,
|
|
269
|
-
packageJson,
|
|
270
|
-
},
|
|
271
|
-
usageGuidelines: [
|
|
272
|
-
'Use at the bottom of a FlexibleCard when you need actions such as copy link, open, or follow.',
|
|
273
|
-
],
|
|
274
|
-
contentGuidelines: [],
|
|
275
|
-
accessibilityGuidelines: [
|
|
276
|
-
'Give each action button or control an accessible name (e.g. "Copy link", "Open in new tab") so purpose is clear to screen readers.',
|
|
277
|
-
'Ensure actions are keyboard operable and appear in a logical tab order.',
|
|
278
|
-
],
|
|
279
|
-
keywords: ['smart-card', 'footer block', 'flexible', 'block', 'actions'],
|
|
280
|
-
categories: ['linking', 'data-display', 'interaction'],
|
|
281
|
-
examples: [
|
|
282
|
-
{
|
|
283
|
-
name: 'Footer block default',
|
|
284
|
-
description:
|
|
285
|
-
'FooterBlock with default actions (e.g. copy, open, follow) at the bottom of the card.',
|
|
286
|
-
source: path.resolve(packagePath, './examples/content/footer-block-default.tsx'),
|
|
287
|
-
},
|
|
288
|
-
],
|
|
289
|
-
},
|
|
290
|
-
],
|
|
291
|
-
hooks: [
|
|
292
|
-
{
|
|
293
|
-
name: 'useSmartLinkEvents',
|
|
294
|
-
description:
|
|
295
|
-
'Hook that returns a SmartLinkEvents object for dispatching analytics events for a given URL. Currently supports insertSmartLink.',
|
|
296
|
-
status: 'general-availability',
|
|
297
|
-
import: {
|
|
298
|
-
name: 'useSmartLinkEvents',
|
|
299
|
-
package: '@atlaskit/smart-card',
|
|
300
|
-
type: 'named',
|
|
301
|
-
packagePath,
|
|
302
|
-
packageJson,
|
|
303
|
-
},
|
|
304
|
-
usageGuidelines: [
|
|
305
|
-
'Use when you need to fire Smart Link analytics (e.g. insert events) from custom UI that is not the default Card.',
|
|
306
|
-
],
|
|
307
|
-
accessibilityGuidelines: [
|
|
308
|
-
'Use analytics events to understand usage; ensure event wiring does not change focus, interrupt screen readers, or alter semantics.',
|
|
309
|
-
],
|
|
310
|
-
keywords: ['smart-card', 'hooks', 'analytics', 'useSmartLinkEvents', 'events'],
|
|
311
|
-
categories: ['linking', 'analytics'],
|
|
312
|
-
examples: [
|
|
313
|
-
{
|
|
314
|
-
name: 'Analytics',
|
|
315
|
-
description:
|
|
316
|
-
'Card with AnalyticsListener capturing and displaying Smart Link analytics events (e.g. on click).',
|
|
317
|
-
source: path.resolve(packagePath, './examples/content/analytics.tsx'),
|
|
318
|
-
},
|
|
319
|
-
],
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
name: 'useSmartLinkActions',
|
|
323
|
-
description:
|
|
324
|
-
'Hook that extracts and returns actions for a given URL. Relies on Smart Link context; usages must be wrapped in SmartCardProvider or equivalent.',
|
|
325
|
-
status: 'general-availability',
|
|
326
|
-
import: {
|
|
327
|
-
name: 'useSmartLinkActions',
|
|
328
|
-
package: '@atlaskit/smart-card/hooks',
|
|
329
|
-
type: 'named',
|
|
330
|
-
packagePath,
|
|
331
|
-
packageJson,
|
|
332
|
-
},
|
|
333
|
-
usageGuidelines: [
|
|
334
|
-
'Use when building custom action UI (buttons, menus) that should expose Smart Link actions (e.g. Preview, Open) for a given URL.',
|
|
335
|
-
],
|
|
336
|
-
accessibilityGuidelines: [
|
|
337
|
-
'When rendering actions from this hook (e.g. buttons or menus), provide accessible labels (e.g. from action.text) and ensure keyboard support.',
|
|
338
|
-
],
|
|
339
|
-
keywords: ['smart-card', 'hooks', 'useSmartLinkActions', 'actions'],
|
|
340
|
-
categories: ['linking', 'interaction'],
|
|
341
|
-
examples: [
|
|
342
|
-
{
|
|
343
|
-
name: 'useSmartLinkActions',
|
|
344
|
-
description:
|
|
345
|
-
'useSmartLinkActions used to get actions for a URL and invoke one (e.g. Preview) from a custom button.',
|
|
346
|
-
source: path.resolve(packagePath, './examples/content/useSmartLinkActions.tsx'),
|
|
347
|
-
},
|
|
348
|
-
],
|
|
349
|
-
},
|
|
350
|
-
],
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
export default documentation;
|