@atlaskit/smart-card 38.1.1 → 38.1.2
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 +8 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedModal/components/embed-content/index.js +6 -2
- package/dist/cjs/view/EmbedModal/index.js +7 -3
- package/dist/cjs/view/FlexibleCard/components/common/ai-summary/ai-learn-more-anchor.js +7 -1
- package/dist/cjs/view/LinkUrl/LinkWarningModal/index.js +7 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RelatedLinksModal/components/EmptyState.js +2 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedModal/components/embed-content/index.js +6 -2
- package/dist/es2019/view/EmbedModal/index.js +7 -3
- package/dist/es2019/view/FlexibleCard/components/common/ai-summary/ai-learn-more-anchor.js +7 -1
- package/dist/es2019/view/LinkUrl/LinkWarningModal/index.js +7 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RelatedLinksModal/components/EmptyState.js +2 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/EmbedModal/components/embed-content/index.js +6 -2
- package/dist/esm/view/EmbedModal/index.js +7 -3
- package/dist/esm/view/FlexibleCard/components/common/ai-summary/ai-learn-more-anchor.js +7 -1
- package/dist/esm/view/LinkUrl/LinkWarningModal/index.js +7 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/components/EmptyState.js +2 -1
- package/dist/types/view/EmbedModal/components/embed-content/index.d.ts +1 -1
- package/dist/types/view/EmbedModal/components/embed-content/types.d.ts +1 -0
- package/dist/types-ts4.5/view/EmbedModal/components/embed-content/index.d.ts +1 -1
- package/dist/types-ts4.5/view/EmbedModal/components/embed-content/types.d.ts +1 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 38.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#155167](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/155167)
|
|
8
|
+
[`8ccab6d9c7f91`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8ccab6d9c7f91) -
|
|
9
|
+
[ux] EDM-12327 fixing all a11y violations for links and titles in smart-card
|
|
10
|
+
|
|
3
11
|
## 38.1.1
|
|
4
12
|
|
|
5
13
|
### 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: "38.1.
|
|
14
|
+
packageVersion: "38.1.2"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -12,6 +12,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
14
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _utils = require("../../../../utils");
|
|
16
17
|
var _IFrame = require("../../../EmbedCard/components/IFrame");
|
|
17
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -21,7 +22,8 @@ var EmbedContent = function EmbedContent(_ref) {
|
|
|
21
22
|
var isTrusted = _ref.isTrusted,
|
|
22
23
|
name = _ref.name,
|
|
23
24
|
src = _ref.src,
|
|
24
|
-
testId = _ref.testId
|
|
25
|
+
testId = _ref.testId,
|
|
26
|
+
ariaLabel = _ref.ariaLabel;
|
|
25
27
|
var sandbox = (0, _utils.getIframeSandboxAttribute)(isTrusted);
|
|
26
28
|
var props = {
|
|
27
29
|
frameBorder: 0,
|
|
@@ -30,7 +32,9 @@ var EmbedContent = function EmbedContent(_ref) {
|
|
|
30
32
|
src: src,
|
|
31
33
|
'data-testid': "".concat(testId, "-embed")
|
|
32
34
|
};
|
|
33
|
-
return /*#__PURE__*/React.createElement(_IFrame.IFrame, (0, _extends2.default)({},
|
|
35
|
+
return /*#__PURE__*/React.createElement(_IFrame.IFrame, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform-linking-fix-a11y-in-smart-card') ? {
|
|
36
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "".concat(testId, "-embed")
|
|
37
|
+
} : {}, props, {
|
|
34
38
|
className: (0, _runtime.ax)(["_1bsb1osq _4t3i815d"])
|
|
35
39
|
}));
|
|
36
40
|
};
|
|
@@ -10,6 +10,7 @@ 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");
|
|
13
14
|
var _tokens = require("@atlaskit/tokens");
|
|
14
15
|
var _constants = require("../../constants");
|
|
15
16
|
var _useInvokeClientAction = _interopRequireDefault(require("../../state/hooks/use-invoke-client-action"));
|
|
@@ -102,14 +103,16 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
102
103
|
if (previewUrl && isSupportTheming) {
|
|
103
104
|
previewUrl = (0, _utils.getPreviewUrlWithTheme)(previewUrl, themeState);
|
|
104
105
|
}
|
|
105
|
-
return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, isOpen && /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, isOpen && /*#__PURE__*/_react.default.createElement(_modalDialog.default, (0, _extends2.default)({
|
|
106
107
|
height: "100%",
|
|
107
108
|
onClose: handleOnClose,
|
|
108
109
|
onCloseComplete: handleOnCloseComplete,
|
|
109
110
|
onOpenComplete: handleOnOpenComplete,
|
|
110
111
|
testId: testId,
|
|
111
112
|
width: width
|
|
112
|
-
},
|
|
113
|
+
}, (0, _platformFeatureFlags.fg)('platform-linking-fix-a11y-in-smart-card') ? {
|
|
114
|
+
label: title
|
|
115
|
+
} : {}), /*#__PURE__*/_react.default.createElement(_linkInfo.default, {
|
|
113
116
|
icon: linkIcon && {
|
|
114
117
|
icon: /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({}, linkIcon, {
|
|
115
118
|
size: _constants.SmartLinkSize.Large
|
|
@@ -127,7 +130,8 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
127
130
|
isTrusted: isTrusted,
|
|
128
131
|
name: iframeName,
|
|
129
132
|
src: previewUrl,
|
|
130
|
-
testId: testId
|
|
133
|
+
testId: testId,
|
|
134
|
+
ariaLabel: title
|
|
131
135
|
}))));
|
|
132
136
|
};
|
|
133
137
|
var _default = exports.default = (0, _analytics.default)((0, _errorBoundary.default)(EmbedModal));
|
|
@@ -8,12 +8,18 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _link = _interopRequireDefault(require("@atlaskit/link"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
13
|
var _constants = require("../../../../../constants");
|
|
12
14
|
var _excluded = ["children"];
|
|
13
15
|
var AILearnMoreAnchor = function AILearnMoreAnchor(_ref) {
|
|
14
16
|
var children = _ref.children,
|
|
15
17
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
16
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
18
|
+
return (0, _platformFeatureFlags.fg)('platform-linking-fix-a11y-in-smart-card') ? /*#__PURE__*/_react.default.createElement(_link.default, (0, _extends2.default)({
|
|
19
|
+
href: _constants.CONTENT_URL_AI,
|
|
20
|
+
target: "_blank",
|
|
21
|
+
rel: "noopener noreferrer"
|
|
22
|
+
}, props), children) : /*#__PURE__*/_react.default.createElement("a", (0, _extends2.default)({
|
|
17
23
|
href: _constants.CONTENT_URL_AI,
|
|
18
24
|
target: "_blank",
|
|
19
25
|
rel: "noopener noreferrer"
|
|
@@ -13,7 +13,9 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
13
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
14
|
var _reactIntlNext = require("react-intl-next");
|
|
15
15
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
16
|
+
var _link = _interopRequireDefault(require("@atlaskit/link"));
|
|
16
17
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
19
|
var _messages = require("../../../messages");
|
|
18
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -36,7 +38,11 @@ var WarningModal = function WarningModal(props) {
|
|
|
36
38
|
values: {
|
|
37
39
|
unsafeLinkText: unsafeLinkText,
|
|
38
40
|
a: function a() {
|
|
39
|
-
return /*#__PURE__*/React.createElement(
|
|
41
|
+
return (0, _platformFeatureFlags.fg)('platform-linking-fix-a11y-in-smart-card') ? /*#__PURE__*/React.createElement(_link.default, {
|
|
42
|
+
href: url,
|
|
43
|
+
target: "_blank",
|
|
44
|
+
rel: "noopener noreferrer"
|
|
45
|
+
}, url) : /*#__PURE__*/React.createElement("a", {
|
|
40
46
|
href: url,
|
|
41
47
|
target: "_blank",
|
|
42
48
|
rel: "noopener noreferrer"
|
|
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
20
20
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
21
21
|
var PACKAGE_DATA = {
|
|
22
22
|
packageName: "@atlaskit/smart-card",
|
|
23
|
-
packageVersion: "38.1.
|
|
23
|
+
packageVersion: "38.1.2",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -27,7 +27,8 @@ var EmptyState = exports.EmptyState = function EmptyState(_ref) {
|
|
|
27
27
|
xcss: styles.emptyState,
|
|
28
28
|
testId: testId
|
|
29
29
|
}, renderImage === null || renderImage === void 0 ? void 0 : renderImage(), /*#__PURE__*/React.createElement(_heading.default, {
|
|
30
|
-
size: "small"
|
|
30
|
+
size: "small",
|
|
31
|
+
as: "h2"
|
|
31
32
|
}, header), description && /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
32
33
|
as: "p",
|
|
33
34
|
xcss: styles.description
|
|
@@ -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: "38.1.
|
|
5
|
+
packageVersion: "38.1.2"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -4,6 +4,7 @@ import "./index.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { di } from 'react-magnetic-di';
|
|
7
|
+
import { fg } from "@atlaskit/platform-feature-flags";
|
|
7
8
|
import { getIframeSandboxAttribute } from '../../../../utils';
|
|
8
9
|
import { IFrame } from '../../../EmbedCard/components/IFrame';
|
|
9
10
|
const iframeCss = null;
|
|
@@ -11,7 +12,8 @@ const EmbedContent = ({
|
|
|
11
12
|
isTrusted,
|
|
12
13
|
name,
|
|
13
14
|
src,
|
|
14
|
-
testId
|
|
15
|
+
testId,
|
|
16
|
+
ariaLabel
|
|
15
17
|
}) => {
|
|
16
18
|
const sandbox = getIframeSandboxAttribute(isTrusted);
|
|
17
19
|
const props = {
|
|
@@ -21,7 +23,9 @@ const EmbedContent = ({
|
|
|
21
23
|
src,
|
|
22
24
|
'data-testid': `${testId}-embed`
|
|
23
25
|
};
|
|
24
|
-
return /*#__PURE__*/React.createElement(IFrame, _extends({},
|
|
26
|
+
return /*#__PURE__*/React.createElement(IFrame, _extends({}, fg('platform-linking-fix-a11y-in-smart-card') ? {
|
|
27
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : `${testId}-embed`
|
|
28
|
+
} : {}, props, {
|
|
25
29
|
className: ax(["_1bsb1osq _4t3i815d"])
|
|
26
30
|
}));
|
|
27
31
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useRef, useState } from 'react';
|
|
3
3
|
import ModalDialog, { ModalBody, ModalTransition } from '@atlaskit/modal-dialog';
|
|
4
|
+
import { fg } from "@atlaskit/platform-feature-flags";
|
|
4
5
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
5
6
|
import { SmartLinkSize } from '../../constants';
|
|
6
7
|
import useInvokeClientAction from '../../state/hooks/use-invoke-client-action';
|
|
@@ -77,14 +78,16 @@ const EmbedModal = ({
|
|
|
77
78
|
if (previewUrl && isSupportTheming) {
|
|
78
79
|
previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
|
|
79
80
|
}
|
|
80
|
-
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
|
|
81
|
+
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, _extends({
|
|
81
82
|
height: "100%",
|
|
82
83
|
onClose: handleOnClose,
|
|
83
84
|
onCloseComplete: handleOnCloseComplete,
|
|
84
85
|
onOpenComplete: handleOnOpenComplete,
|
|
85
86
|
testId: testId,
|
|
86
87
|
width: width
|
|
87
|
-
},
|
|
88
|
+
}, fg('platform-linking-fix-a11y-in-smart-card') ? {
|
|
89
|
+
label: title
|
|
90
|
+
} : {}), /*#__PURE__*/React.createElement(LinkInfo, {
|
|
88
91
|
icon: linkIcon && {
|
|
89
92
|
icon: /*#__PURE__*/React.createElement(Icon, _extends({}, linkIcon, {
|
|
90
93
|
size: SmartLinkSize.Large
|
|
@@ -102,7 +105,8 @@ const EmbedModal = ({
|
|
|
102
105
|
isTrusted: isTrusted,
|
|
103
106
|
name: iframeName,
|
|
104
107
|
src: previewUrl,
|
|
105
|
-
testId: testId
|
|
108
|
+
testId: testId,
|
|
109
|
+
ariaLabel: title
|
|
106
110
|
}))));
|
|
107
111
|
};
|
|
108
112
|
export default withAnalytics(withErrorBoundary(EmbedModal));
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import Link from '@atlaskit/link';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
5
|
import { CONTENT_URL_AI } from '../../../../../constants';
|
|
4
6
|
const AILearnMoreAnchor = ({
|
|
5
7
|
children,
|
|
6
8
|
...props
|
|
7
|
-
}) => /*#__PURE__*/React.createElement(
|
|
9
|
+
}) => fg('platform-linking-fix-a11y-in-smart-card') ? /*#__PURE__*/React.createElement(Link, _extends({
|
|
10
|
+
href: CONTENT_URL_AI,
|
|
11
|
+
target: "_blank",
|
|
12
|
+
rel: "noopener noreferrer"
|
|
13
|
+
}, props), children) : /*#__PURE__*/React.createElement("a", _extends({
|
|
8
14
|
href: CONTENT_URL_AI,
|
|
9
15
|
target: "_blank",
|
|
10
16
|
rel: "noopener noreferrer"
|
|
@@ -5,7 +5,9 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { FormattedMessage, injectIntl, IntlProvider } from 'react-intl-next';
|
|
7
7
|
import Button from '@atlaskit/button/standard-button';
|
|
8
|
+
import Link from '@atlaskit/link';
|
|
8
9
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
11
|
import { messages } from '../../../messages';
|
|
10
12
|
const breakWordsCss = null;
|
|
11
13
|
const WarningModal = props => {
|
|
@@ -27,7 +29,11 @@ const WarningModal = props => {
|
|
|
27
29
|
}, url && unsafeLinkText && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.link_safety_warning_message, {
|
|
28
30
|
values: {
|
|
29
31
|
unsafeLinkText: unsafeLinkText,
|
|
30
|
-
a: () => /*#__PURE__*/React.createElement(
|
|
32
|
+
a: () => fg('platform-linking-fix-a11y-in-smart-card') ? /*#__PURE__*/React.createElement(Link, {
|
|
33
|
+
href: url,
|
|
34
|
+
target: "_blank",
|
|
35
|
+
rel: "noopener noreferrer"
|
|
36
|
+
}, url) : /*#__PURE__*/React.createElement("a", {
|
|
31
37
|
href: url,
|
|
32
38
|
target: "_blank",
|
|
33
39
|
rel: "noopener noreferrer"
|
|
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
10
10
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
11
11
|
const PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "38.1.
|
|
13
|
+
packageVersion: "38.1.2",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -18,7 +18,8 @@ export const EmptyState = ({
|
|
|
18
18
|
xcss: styles.emptyState,
|
|
19
19
|
testId: testId
|
|
20
20
|
}, renderImage === null || renderImage === void 0 ? void 0 : renderImage(), /*#__PURE__*/React.createElement(Heading, {
|
|
21
|
-
size: "small"
|
|
21
|
+
size: "small",
|
|
22
|
+
as: "h2"
|
|
22
23
|
}, header), description && /*#__PURE__*/React.createElement(Box, {
|
|
23
24
|
as: "p",
|
|
24
25
|
xcss: styles.description
|
|
@@ -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: "38.1.
|
|
7
|
+
packageVersion: "38.1.2"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -4,6 +4,7 @@ import "./index.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { di } from 'react-magnetic-di';
|
|
7
|
+
import { fg } from "@atlaskit/platform-feature-flags";
|
|
7
8
|
import { getIframeSandboxAttribute } from '../../../../utils';
|
|
8
9
|
import { IFrame } from '../../../EmbedCard/components/IFrame';
|
|
9
10
|
var iframeCss = null;
|
|
@@ -11,7 +12,8 @@ var EmbedContent = function EmbedContent(_ref) {
|
|
|
11
12
|
var isTrusted = _ref.isTrusted,
|
|
12
13
|
name = _ref.name,
|
|
13
14
|
src = _ref.src,
|
|
14
|
-
testId = _ref.testId
|
|
15
|
+
testId = _ref.testId,
|
|
16
|
+
ariaLabel = _ref.ariaLabel;
|
|
15
17
|
var sandbox = getIframeSandboxAttribute(isTrusted);
|
|
16
18
|
var props = {
|
|
17
19
|
frameBorder: 0,
|
|
@@ -20,7 +22,9 @@ var EmbedContent = function EmbedContent(_ref) {
|
|
|
20
22
|
src: src,
|
|
21
23
|
'data-testid': "".concat(testId, "-embed")
|
|
22
24
|
};
|
|
23
|
-
return /*#__PURE__*/React.createElement(IFrame, _extends({},
|
|
25
|
+
return /*#__PURE__*/React.createElement(IFrame, _extends({}, fg('platform-linking-fix-a11y-in-smart-card') ? {
|
|
26
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "".concat(testId, "-embed")
|
|
27
|
+
} : {}, props, {
|
|
24
28
|
className: ax(["_1bsb1osq _4t3i815d"])
|
|
25
29
|
}));
|
|
26
30
|
};
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import React, { useCallback, 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';
|
|
@@ -92,14 +93,16 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
92
93
|
if (previewUrl && isSupportTheming) {
|
|
93
94
|
previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
|
|
94
95
|
}
|
|
95
|
-
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
|
|
96
|
+
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, _extends({
|
|
96
97
|
height: "100%",
|
|
97
98
|
onClose: handleOnClose,
|
|
98
99
|
onCloseComplete: handleOnCloseComplete,
|
|
99
100
|
onOpenComplete: handleOnOpenComplete,
|
|
100
101
|
testId: testId,
|
|
101
102
|
width: width
|
|
102
|
-
},
|
|
103
|
+
}, fg('platform-linking-fix-a11y-in-smart-card') ? {
|
|
104
|
+
label: title
|
|
105
|
+
} : {}), /*#__PURE__*/React.createElement(LinkInfo, {
|
|
103
106
|
icon: linkIcon && {
|
|
104
107
|
icon: /*#__PURE__*/React.createElement(Icon, _extends({}, linkIcon, {
|
|
105
108
|
size: SmartLinkSize.Large
|
|
@@ -117,7 +120,8 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
117
120
|
isTrusted: isTrusted,
|
|
118
121
|
name: iframeName,
|
|
119
122
|
src: previewUrl,
|
|
120
|
-
testId: testId
|
|
123
|
+
testId: testId,
|
|
124
|
+
ariaLabel: title
|
|
121
125
|
}))));
|
|
122
126
|
};
|
|
123
127
|
export default withAnalytics(withErrorBoundary(EmbedModal));
|
|
@@ -2,11 +2,17 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["children"];
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import Link from '@atlaskit/link';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
7
|
import { CONTENT_URL_AI } from '../../../../../constants';
|
|
6
8
|
var AILearnMoreAnchor = function AILearnMoreAnchor(_ref) {
|
|
7
9
|
var children = _ref.children,
|
|
8
10
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
-
return /*#__PURE__*/React.createElement(
|
|
11
|
+
return fg('platform-linking-fix-a11y-in-smart-card') ? /*#__PURE__*/React.createElement(Link, _extends({
|
|
12
|
+
href: CONTENT_URL_AI,
|
|
13
|
+
target: "_blank",
|
|
14
|
+
rel: "noopener noreferrer"
|
|
15
|
+
}, props), children) : /*#__PURE__*/React.createElement("a", _extends({
|
|
10
16
|
href: CONTENT_URL_AI,
|
|
11
17
|
target: "_blank",
|
|
12
18
|
rel: "noopener noreferrer"
|
|
@@ -5,7 +5,9 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { FormattedMessage, injectIntl, IntlProvider } from 'react-intl-next';
|
|
7
7
|
import Button from '@atlaskit/button/standard-button';
|
|
8
|
+
import Link from '@atlaskit/link';
|
|
8
9
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
11
|
import { messages } from '../../../messages';
|
|
10
12
|
var breakWordsCss = null;
|
|
11
13
|
var WarningModal = function WarningModal(props) {
|
|
@@ -26,7 +28,11 @@ var WarningModal = function WarningModal(props) {
|
|
|
26
28
|
values: {
|
|
27
29
|
unsafeLinkText: unsafeLinkText,
|
|
28
30
|
a: function a() {
|
|
29
|
-
return /*#__PURE__*/React.createElement(
|
|
31
|
+
return fg('platform-linking-fix-a11y-in-smart-card') ? /*#__PURE__*/React.createElement(Link, {
|
|
32
|
+
href: url,
|
|
33
|
+
target: "_blank",
|
|
34
|
+
rel: "noopener noreferrer"
|
|
35
|
+
}, url) : /*#__PURE__*/React.createElement("a", {
|
|
30
36
|
href: url,
|
|
31
37
|
target: "_blank",
|
|
32
38
|
rel: "noopener noreferrer"
|
|
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
13
13
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
14
14
|
var PACKAGE_DATA = {
|
|
15
15
|
packageName: "@atlaskit/smart-card",
|
|
16
|
-
packageVersion: "38.1.
|
|
16
|
+
packageVersion: "38.1.2",
|
|
17
17
|
componentName: 'linkUrl'
|
|
18
18
|
};
|
|
19
19
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -17,7 +17,8 @@ export var EmptyState = function EmptyState(_ref) {
|
|
|
17
17
|
xcss: styles.emptyState,
|
|
18
18
|
testId: testId
|
|
19
19
|
}, renderImage === null || renderImage === void 0 ? void 0 : renderImage(), /*#__PURE__*/React.createElement(Heading, {
|
|
20
|
-
size: "small"
|
|
20
|
+
size: "small",
|
|
21
|
+
as: "h2"
|
|
21
22
|
}, header), description && /*#__PURE__*/React.createElement(Box, {
|
|
22
23
|
as: "p",
|
|
23
24
|
xcss: styles.description
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type EmbedProps } from './types';
|
|
3
|
-
declare const EmbedContent: ({ isTrusted, name, src, testId }: EmbedProps) => JSX.Element;
|
|
3
|
+
declare const EmbedContent: ({ isTrusted, name, src, testId, ariaLabel }: EmbedProps) => JSX.Element;
|
|
4
4
|
export default EmbedContent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type EmbedProps } from './types';
|
|
3
|
-
declare const EmbedContent: ({ isTrusted, name, src, testId }: EmbedProps) => JSX.Element;
|
|
3
|
+
declare const EmbedContent: ({ isTrusted, name, src, testId, ariaLabel }: EmbedProps) => JSX.Element;
|
|
4
4
|
export default EmbedContent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "38.1.
|
|
3
|
+
"version": "38.1.2",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@atlaskit/css-reset": "^7.2.0",
|
|
98
98
|
"@atlaskit/link-test-helpers": "^8.0.0",
|
|
99
99
|
"@atlaskit/media-test-helpers": "^36.0.0",
|
|
100
|
-
"@atlaskit/react-ufo": "^3.
|
|
100
|
+
"@atlaskit/react-ufo": "^3.12.0",
|
|
101
101
|
"@atlaskit/ssr": "workspace:^",
|
|
102
102
|
"@atlaskit/visual-regression": "workspace:^",
|
|
103
103
|
"@atlassian/analytics-tooling": "^0.5.0",
|
|
@@ -239,6 +239,9 @@
|
|
|
239
239
|
},
|
|
240
240
|
"platform-linking-additional-flexible-element-props": {
|
|
241
241
|
"type": "boolean"
|
|
242
|
+
},
|
|
243
|
+
"platform-linking-fix-a11y-in-smart-card": {
|
|
244
|
+
"type": "boolean"
|
|
242
245
|
}
|
|
243
246
|
}
|
|
244
247
|
}
|