@atlaskit/smart-card 43.20.0 → 43.20.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 +17 -0
- package/dist/cjs/extractors/common/icon/extractIcon.js +0 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ErroredView.js +0 -1
- package/dist/cjs/view/EmbedCard/views/ErroredView.js +0 -1
- package/dist/cjs/view/EmbedCard/views/ResolvedView.js +0 -2
- package/dist/cjs/view/EmbedCard/views/unresolved-view/index.compiled.css +2 -3
- package/dist/cjs/view/EmbedCard/views/unresolved-view/index.js +4 -5
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +6 -2
- package/dist/cjs/view/EmbedModal/components/link-info/link-info-button/index.js +8 -3
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +0 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +0 -1
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +0 -2
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +11 -1
- package/dist/cjs/view/InlineCard/ErroredView/index.js +0 -1
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +0 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/Icon.js +0 -1
- package/dist/es2019/extractors/common/icon/extractIcon.js +0 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ErroredView.js +0 -1
- package/dist/es2019/view/EmbedCard/views/ErroredView.js +0 -1
- package/dist/es2019/view/EmbedCard/views/ResolvedView.js +0 -2
- package/dist/es2019/view/EmbedCard/views/unresolved-view/index.compiled.css +2 -3
- package/dist/es2019/view/EmbedCard/views/unresolved-view/index.js +4 -5
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +6 -2
- package/dist/es2019/view/EmbedModal/components/link-info/link-info-button/index.js +8 -3
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +0 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +0 -1
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +12 -1
- package/dist/es2019/view/InlineCard/ErroredView/index.js +0 -1
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +0 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/Icon.js +0 -1
- package/dist/esm/extractors/common/icon/extractIcon.js +0 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ErroredView.js +0 -1
- package/dist/esm/view/EmbedCard/views/ErroredView.js +0 -1
- package/dist/esm/view/EmbedCard/views/ResolvedView.js +0 -2
- package/dist/esm/view/EmbedCard/views/unresolved-view/index.compiled.css +2 -3
- package/dist/esm/view/EmbedCard/views/unresolved-view/index.js +4 -5
- package/dist/esm/view/EmbedModal/components/link-info/index.js +6 -2
- package/dist/esm/view/EmbedModal/components/link-info/link-info-button/index.js +8 -3
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +0 -1
- package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +0 -1
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +0 -2
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +11 -1
- package/dist/esm/view/InlineCard/ErroredView/index.js +0 -1
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +0 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/Icon.js +0 -1
- package/dist/types/view/EmbedModal/components/link-info/link-info-button/index.d.ts +2 -1
- package/dist/types-ts4.5/view/EmbedModal/components/link-info/link-info-button/index.d.ts +2 -1
- package/package.json +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 43.20.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`370c2ca23ca71`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/370c2ca23ca71) -
|
|
8
|
+
NAVX-2811 adding alt text to embed modal icon
|
|
9
|
+
- [`bdcd4b4374105`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bdcd4b4374105) -
|
|
10
|
+
Minor improvements to how styles are applied.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 43.20.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`aac6485a45d73`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aac6485a45d73) -
|
|
18
|
+
NAVX-2815 adding correct role for icon button in preview modal
|
|
19
|
+
|
|
3
20
|
## 43.20.0
|
|
4
21
|
|
|
5
22
|
### Minor 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: "43.20.
|
|
14
|
+
packageVersion: "43.20.1"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -36,7 +36,6 @@ var ErroredView = function ErroredView(_ref) {
|
|
|
36
36
|
}), /*#__PURE__*/_react.default.createElement(_statusWarning.default, {
|
|
37
37
|
label: "errored-warning-icon",
|
|
38
38
|
color: "var(--ds-icon-warning, #E06C00)",
|
|
39
|
-
LEGACY_size: "small",
|
|
40
39
|
testId: "".concat(testId, "-warning-icon")
|
|
41
40
|
}), /*#__PURE__*/_react.default.createElement(_baseTextElement.default, {
|
|
42
41
|
maxLines: 3,
|
|
@@ -34,7 +34,6 @@ var EmbedCardErroredView = exports.EmbedCardErroredView = function EmbedCardErro
|
|
|
34
34
|
isSelected: isSelected,
|
|
35
35
|
testId: testId
|
|
36
36
|
}, /*#__PURE__*/React.createElement(_statusError.default, {
|
|
37
|
-
LEGACY_size: "small",
|
|
38
37
|
color: "var(--ds-icon-danger, ".concat(_colors.R300, ")"),
|
|
39
38
|
label: "error-icon"
|
|
40
39
|
}), /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
@@ -41,7 +41,6 @@ var EmbedCardResolvedViewOld = /*#__PURE__*/_react.default.forwardRef(function (
|
|
|
41
41
|
var linkGlyph = _react.default.useMemo(function () {
|
|
42
42
|
return /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
43
43
|
label: "icon",
|
|
44
|
-
LEGACY_size: "small",
|
|
45
44
|
testId: "embed-card-fallback-icon",
|
|
46
45
|
color: "currentColor"
|
|
47
46
|
});
|
|
@@ -115,7 +114,6 @@ var EmbedCardResolvedViewUpdated = /*#__PURE__*/_react.default.forwardRef(functi
|
|
|
115
114
|
var linkGlyph = _react.default.useMemo(function () {
|
|
116
115
|
return /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
117
116
|
label: "icon",
|
|
118
|
-
LEGACY_size: "small",
|
|
119
117
|
testId: "embed-card-fallback-icon",
|
|
120
118
|
color: "currentColor"
|
|
121
119
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
._zulpv47k{gap:var(--ds-space-250,20px)}
|
|
3
|
-
._18u01wug{margin-left:auto}
|
|
1
|
+
|
|
2
|
+
._zulpv47k{gap:var(--ds-space-250,20px)}._18u01wug{margin-left:auto}
|
|
4
3
|
._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
|
|
5
4
|
._19pk1wug{margin-top:auto}
|
|
6
5
|
._1bah1h6o{justify-content:center}
|
|
@@ -12,12 +12,12 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
14
14
|
var _link = _interopRequireDefault(require("@atlaskit/icon/core/link"));
|
|
15
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
16
|
var _ExpandedFrame = require("../../components/ExpandedFrame");
|
|
16
17
|
var _ImageIcon = require("../../components/ImageIcon");
|
|
17
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
19
|
var containerStyles = null;
|
|
19
20
|
var contentStyles = null;
|
|
20
|
-
var descriptionStyles = null;
|
|
21
21
|
var imageStyles = null;
|
|
22
22
|
var UnresolvedView = function UnresolvedView(_ref) {
|
|
23
23
|
var button = _ref.button,
|
|
@@ -40,7 +40,6 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
40
40
|
src: typeof iconUrlOrElement === 'string' ? iconUrlOrElement : undefined,
|
|
41
41
|
default: /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
42
42
|
label: "icon",
|
|
43
|
-
LEGACY_size: "small",
|
|
44
43
|
testId: "embed-card-fallback-icon",
|
|
45
44
|
color: "currentColor"
|
|
46
45
|
})
|
|
@@ -92,9 +91,9 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
92
91
|
}, image, /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
93
92
|
size: "large",
|
|
94
93
|
testId: "".concat(testId, "-unresolved-title")
|
|
95
|
-
}, title), /*#__PURE__*/_react.default.createElement(
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
}, title), /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
95
|
+
align: "center",
|
|
96
|
+
testId: "".concat(testId, "-unresolved-description")
|
|
98
97
|
}, description), button)));
|
|
99
98
|
};
|
|
100
99
|
var _default = exports.default = UnresolvedView;
|
|
@@ -81,7 +81,9 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
81
81
|
},
|
|
82
82
|
label: _messages.messages.viewOriginal,
|
|
83
83
|
onClick: onViewButtonClick,
|
|
84
|
-
testId: "".concat(testId, "-url")
|
|
84
|
+
testId: "".concat(testId, "-url"),
|
|
85
|
+
role: (0, _platformFeatureFlags.fg)('navx-2185-smart-link-preview-modal-icon-role') ? 'link' : '',
|
|
86
|
+
"aria-label": (0, _platformFeatureFlags.fg)('navx-2185-smart-link-preview-modal-icon-role') ? _messages.messages.viewOriginal : ''
|
|
85
87
|
});
|
|
86
88
|
}
|
|
87
89
|
}, [onViewButtonClick, providerName, testId]);
|
|
@@ -188,7 +190,9 @@ var LinkInfoNew = function LinkInfoNew(_ref2) {
|
|
|
188
190
|
},
|
|
189
191
|
label: _messages.messages.viewOriginal,
|
|
190
192
|
onClick: onViewButtonClick,
|
|
191
|
-
testId: "".concat(testId, "-url")
|
|
193
|
+
testId: "".concat(testId, "-url"),
|
|
194
|
+
role: (0, _platformFeatureFlags.fg)('navx-2185-smart-link-preview-modal-icon-role') ? 'link' : '',
|
|
195
|
+
"aria-label": (0, _platformFeatureFlags.fg)('navx-2185-smart-link-preview-modal-icon-role') ? _messages.messages.viewOriginal : ''
|
|
192
196
|
});
|
|
193
197
|
}
|
|
194
198
|
}, [onViewButtonClick, providerName, testId]);
|
|
@@ -5,9 +5,11 @@ 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"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _reactIntlNext = require("react-intl-next");
|
|
10
11
|
var _new = require("@atlaskit/button/new");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
13
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
12
14
|
var _useLinkClicked = require("../../../../../state/analytics/useLinkClicked");
|
|
13
15
|
var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
@@ -15,7 +17,8 @@ var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
|
15
17
|
icon = _ref.icon,
|
|
16
18
|
label = _ref.label,
|
|
17
19
|
onClick = _ref.onClick,
|
|
18
|
-
testId = _ref.testId
|
|
20
|
+
testId = _ref.testId,
|
|
21
|
+
role = _ref.role;
|
|
19
22
|
var onMouseDown = (0, _useLinkClicked.useMouseDownEvent)();
|
|
20
23
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
21
24
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -24,13 +27,15 @@ var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
|
24
27
|
hideTooltipOnClick: true,
|
|
25
28
|
tag: "span",
|
|
26
29
|
testId: "".concat(testId, "-tooltip")
|
|
27
|
-
}, /*#__PURE__*/_react.default.createElement(_new.IconButton, {
|
|
30
|
+
}, /*#__PURE__*/_react.default.createElement(_new.IconButton, (0, _extends2.default)({
|
|
28
31
|
appearance: "subtle",
|
|
29
32
|
icon: icon,
|
|
30
33
|
label: formatMessage(label),
|
|
31
34
|
onClick: onClick,
|
|
32
35
|
onMouseDown: onMouseDown,
|
|
33
36
|
testId: "".concat(testId, "-button")
|
|
34
|
-
}))
|
|
37
|
+
}, (0, _platformFeatureFlags.fg)('navx-2185-smart-link-preview-modal-icon-role') ? {
|
|
38
|
+
role: role
|
|
39
|
+
} : {})));
|
|
35
40
|
};
|
|
36
41
|
var _default = exports.default = LinkInfoButton;
|
package/dist/cjs/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js
CHANGED
|
@@ -33,7 +33,6 @@ var AIFooterMetadata = exports.AIFooterMetadata = function AIFooterMetadata(_ref
|
|
|
33
33
|
}, function (tooltipProps) {
|
|
34
34
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, tooltipProps, /*#__PURE__*/_react.default.createElement(_info.InfoIcon, {
|
|
35
35
|
label: "Information",
|
|
36
|
-
LEGACY_size: "small",
|
|
37
36
|
color: "var(--ds-icon-subtle, #505258)"
|
|
38
37
|
}));
|
|
39
38
|
}), /*#__PURE__*/_react.default.createElement(_atlassianIntelligence.default, {
|
|
@@ -88,14 +88,12 @@ var AtlaskitIcon = function AtlaskitIcon(_ref) {
|
|
|
88
88
|
return /*#__PURE__*/_react.default.createElement(ImportedIcon, {
|
|
89
89
|
label: label,
|
|
90
90
|
testId: testId,
|
|
91
|
-
LEGACY_size: size === _constants.SmartLinkSize.Large || size === _constants.SmartLinkSize.XLarge ? 'medium' : 'small',
|
|
92
91
|
color: "var(--ds-icon-danger, #C9372C)"
|
|
93
92
|
});
|
|
94
93
|
default:
|
|
95
94
|
return /*#__PURE__*/_react.default.createElement(ImportedIcon, {
|
|
96
95
|
label: label,
|
|
97
96
|
testId: testId,
|
|
98
|
-
LEGACY_size: size === _constants.SmartLinkSize.Large || size === _constants.SmartLinkSize.XLarge ? 'medium' : 'small',
|
|
99
97
|
size: size
|
|
100
98
|
});
|
|
101
99
|
}
|
|
@@ -12,12 +12,20 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
+
var _reactIntlNext = require("react-intl-next");
|
|
15
16
|
var _reactRenderImage = _interopRequireDefault(require("react-render-image"));
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
18
|
var _loadingSkeleton = require("../loading-skeleton");
|
|
17
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
20
|
var styles = {
|
|
19
21
|
roundImg: "_2rko1rr0"
|
|
20
22
|
};
|
|
23
|
+
var messages = (0, _reactIntlNext.defineMessages)({
|
|
24
|
+
imageAltText: {
|
|
25
|
+
id: 'smart-link.image-icon.altText',
|
|
26
|
+
defaultMessage: 'Link Icon'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
21
29
|
var ImageIcon = function ImageIcon(_ref) {
|
|
22
30
|
var defaultIcon = _ref.defaultIcon,
|
|
23
31
|
testId = _ref.testId,
|
|
@@ -34,6 +42,8 @@ var ImageIcon = function ImageIcon(_ref) {
|
|
|
34
42
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
43
|
hasImageErrored = _useState2[0],
|
|
36
44
|
setHasImageErrored = _useState2[1];
|
|
45
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
46
|
+
formatMessage = _useIntl.formatMessage;
|
|
37
47
|
|
|
38
48
|
// If url changes, reset state
|
|
39
49
|
(0, _react.useEffect)(function () {
|
|
@@ -67,7 +77,7 @@ var ImageIcon = function ImageIcon(_ref) {
|
|
|
67
77
|
loaded: /*#__PURE__*/React.createElement("img", {
|
|
68
78
|
src: url,
|
|
69
79
|
"data-testid": "".concat(testId, "-image"),
|
|
70
|
-
alt: "",
|
|
80
|
+
alt: (0, _platformFeatureFlags.fg)('navx-2811-smart-link-a11y-image-alt') ? formatMessage(messages.imageAltText) : "",
|
|
71
81
|
style: {
|
|
72
82
|
width: width,
|
|
73
83
|
height: height
|
|
@@ -111,7 +111,6 @@ var IconAndTitleLayout = exports.IconAndTitleLayout = function IconAndTitleLayou
|
|
|
111
111
|
var renderIconPlaceholder = _react.default.useCallback(function (testId) {
|
|
112
112
|
return defaultIcon || /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
113
113
|
label: "link",
|
|
114
|
-
LEGACY_size: "small",
|
|
115
114
|
testId: "".concat(testId, "-default"),
|
|
116
115
|
color: "currentColor"
|
|
117
116
|
});
|
|
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
22
22
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
23
23
|
var PACKAGE_DATA = {
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "43.20.
|
|
25
|
+
packageVersion: "43.20.1",
|
|
26
26
|
componentName: 'linkUrl'
|
|
27
27
|
};
|
|
28
28
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -30,7 +30,6 @@ var Icon = exports.Icon = function Icon(_ref) {
|
|
|
30
30
|
isFlexibleUi = _ref$isFlexibleUi === void 0 ? false : _ref$isFlexibleUi;
|
|
31
31
|
var placeholder = defaultIcon || /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
32
32
|
label: "link",
|
|
33
|
-
LEGACY_size: "small",
|
|
34
33
|
testId: "".concat(testId, "-default"),
|
|
35
34
|
color: "currentColor"
|
|
36
35
|
});
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "43.20.
|
|
5
|
+
packageVersion: "43.20.1"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -24,7 +24,6 @@ const ErroredView = ({
|
|
|
24
24
|
}), /*#__PURE__*/React.createElement(WarningIcon, {
|
|
25
25
|
label: "errored-warning-icon",
|
|
26
26
|
color: "var(--ds-icon-warning, #E06C00)",
|
|
27
|
-
LEGACY_size: "small",
|
|
28
27
|
testId: `${testId}-warning-icon`
|
|
29
28
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
30
29
|
maxLines: 3,
|
|
@@ -23,7 +23,6 @@ export const EmbedCardErroredView = ({
|
|
|
23
23
|
isSelected: isSelected,
|
|
24
24
|
testId: testId
|
|
25
25
|
}, /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
26
|
-
LEGACY_size: "small",
|
|
27
26
|
color: `var(--ds-icon-danger, ${R300})`,
|
|
28
27
|
label: "error-icon"
|
|
29
28
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
@@ -32,7 +32,6 @@ const EmbedCardResolvedViewOld = /*#__PURE__*/React.forwardRef(({
|
|
|
32
32
|
const text = title || (context === null || context === void 0 ? void 0 : context.text);
|
|
33
33
|
const linkGlyph = React.useMemo(() => /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
34
34
|
label: "icon",
|
|
35
|
-
LEGACY_size: "small",
|
|
36
35
|
testId: "embed-card-fallback-icon",
|
|
37
36
|
color: "currentColor"
|
|
38
37
|
}), []);
|
|
@@ -104,7 +103,6 @@ const EmbedCardResolvedViewUpdated = /*#__PURE__*/React.forwardRef(({
|
|
|
104
103
|
const text = title || (context === null || context === void 0 ? void 0 : context.text);
|
|
105
104
|
const linkGlyph = React.useMemo(() => /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
106
105
|
label: "icon",
|
|
107
|
-
LEGACY_size: "small",
|
|
108
106
|
testId: "embed-card-fallback-icon",
|
|
109
107
|
color: "currentColor"
|
|
110
108
|
}), []);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
._zulpv47k{gap:var(--ds-space-250,20px)}
|
|
3
|
-
._18u01wug{margin-left:auto}
|
|
1
|
+
|
|
2
|
+
._zulpv47k{gap:var(--ds-space-250,20px)}._18u01wug{margin-left:auto}
|
|
4
3
|
._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
|
|
5
4
|
._19pk1wug{margin-top:auto}
|
|
6
5
|
._1bah1h6o{justify-content:center}
|
|
@@ -4,11 +4,11 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import Heading from '@atlaskit/heading';
|
|
6
6
|
import LinkGlyph from '@atlaskit/icon/core/link';
|
|
7
|
+
import { Text } from '@atlaskit/primitives/compiled';
|
|
7
8
|
import { ExpandedFrame } from '../../components/ExpandedFrame';
|
|
8
9
|
import { ImageIcon } from '../../components/ImageIcon';
|
|
9
10
|
const containerStyles = null;
|
|
10
11
|
const contentStyles = null;
|
|
11
|
-
const descriptionStyles = null;
|
|
12
12
|
const imageStyles = null;
|
|
13
13
|
const UnresolvedView = ({
|
|
14
14
|
button,
|
|
@@ -32,7 +32,6 @@ const UnresolvedView = ({
|
|
|
32
32
|
src: typeof iconUrlOrElement === 'string' ? iconUrlOrElement : undefined,
|
|
33
33
|
default: /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
34
34
|
label: "icon",
|
|
35
|
-
LEGACY_size: "small",
|
|
36
35
|
testId: "embed-card-fallback-icon",
|
|
37
36
|
color: "currentColor"
|
|
38
37
|
})
|
|
@@ -84,9 +83,9 @@ const UnresolvedView = ({
|
|
|
84
83
|
}, image, /*#__PURE__*/React.createElement(Heading, {
|
|
85
84
|
size: "large",
|
|
86
85
|
testId: `${testId}-unresolved-title`
|
|
87
|
-
}, title), /*#__PURE__*/React.createElement(
|
|
88
|
-
"
|
|
89
|
-
|
|
86
|
+
}, title), /*#__PURE__*/React.createElement(Text, {
|
|
87
|
+
align: "center",
|
|
88
|
+
testId: `${testId}-unresolved-description`
|
|
90
89
|
}, description), button)));
|
|
91
90
|
};
|
|
92
91
|
export default UnresolvedView;
|
|
@@ -71,7 +71,9 @@ const LinkInfo = ({
|
|
|
71
71
|
}),
|
|
72
72
|
label: messages.viewOriginal,
|
|
73
73
|
onClick: onViewButtonClick,
|
|
74
|
-
testId: `${testId}-url
|
|
74
|
+
testId: `${testId}-url`,
|
|
75
|
+
role: fg('navx-2185-smart-link-preview-modal-icon-role') ? 'link' : '',
|
|
76
|
+
"aria-label": fg('navx-2185-smart-link-preview-modal-icon-role') ? messages.viewOriginal : ''
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
79
|
}, [onViewButtonClick, providerName, testId]);
|
|
@@ -173,7 +175,9 @@ const LinkInfoNew = ({
|
|
|
173
175
|
}),
|
|
174
176
|
label: messages.viewOriginal,
|
|
175
177
|
onClick: onViewButtonClick,
|
|
176
|
-
testId: `${testId}-url
|
|
178
|
+
testId: `${testId}-url`,
|
|
179
|
+
role: fg('navx-2185-smart-link-preview-modal-icon-role') ? 'link' : '',
|
|
180
|
+
"aria-label": fg('navx-2185-smart-link-preview-modal-icon-role') ? messages.viewOriginal : ''
|
|
177
181
|
});
|
|
178
182
|
}
|
|
179
183
|
}, [onViewButtonClick, providerName, testId]);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { useIntl } from 'react-intl-next';
|
|
3
4
|
import { IconButton } from '@atlaskit/button/new';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
5
7
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
6
8
|
const LinkInfoButton = ({
|
|
@@ -8,7 +10,8 @@ const LinkInfoButton = ({
|
|
|
8
10
|
icon,
|
|
9
11
|
label,
|
|
10
12
|
onClick,
|
|
11
|
-
testId
|
|
13
|
+
testId,
|
|
14
|
+
role
|
|
12
15
|
}) => {
|
|
13
16
|
const onMouseDown = useMouseDownEvent();
|
|
14
17
|
const {
|
|
@@ -19,13 +22,15 @@ const LinkInfoButton = ({
|
|
|
19
22
|
hideTooltipOnClick: true,
|
|
20
23
|
tag: "span",
|
|
21
24
|
testId: `${testId}-tooltip`
|
|
22
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
25
|
+
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
23
26
|
appearance: "subtle",
|
|
24
27
|
icon: icon,
|
|
25
28
|
label: formatMessage(label),
|
|
26
29
|
onClick: onClick,
|
|
27
30
|
onMouseDown: onMouseDown,
|
|
28
31
|
testId: `${testId}-button`
|
|
29
|
-
})
|
|
32
|
+
}, fg('navx-2185-smart-link-preview-modal-icon-role') ? {
|
|
33
|
+
role
|
|
34
|
+
} : {})));
|
|
30
35
|
};
|
|
31
36
|
export default LinkInfoButton;
|
|
@@ -29,7 +29,6 @@ export const AIFooterMetadata = ({
|
|
|
29
29
|
position: "bottom"
|
|
30
30
|
}, tooltipProps => /*#__PURE__*/React.createElement(Box, tooltipProps, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
31
31
|
label: "Information",
|
|
32
|
-
LEGACY_size: "small",
|
|
33
32
|
color: "var(--ds-icon-subtle, #505258)"
|
|
34
33
|
}))), /*#__PURE__*/React.createElement(AIIcon, {
|
|
35
34
|
label: "AI",
|
|
@@ -75,14 +75,12 @@ const AtlaskitIcon = ({
|
|
|
75
75
|
return /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
76
76
|
label: label,
|
|
77
77
|
testId: testId,
|
|
78
|
-
LEGACY_size: size === SmartLinkSize.Large || size === SmartLinkSize.XLarge ? 'medium' : 'small',
|
|
79
78
|
color: "var(--ds-icon-danger, #C9372C)"
|
|
80
79
|
});
|
|
81
80
|
default:
|
|
82
81
|
return /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
83
82
|
label: label,
|
|
84
83
|
testId: testId,
|
|
85
|
-
LEGACY_size: size === SmartLinkSize.Large || size === SmartLinkSize.XLarge ? 'medium' : 'small',
|
|
86
84
|
size: size
|
|
87
85
|
});
|
|
88
86
|
}
|
|
@@ -3,11 +3,19 @@ import "./index.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
|
+
import { defineMessages, useIntl } from 'react-intl-next';
|
|
6
7
|
import ImageLoader from 'react-render-image';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
9
|
import { LoadingSkeleton } from '../loading-skeleton';
|
|
8
10
|
const styles = {
|
|
9
11
|
roundImg: "_2rko1rr0"
|
|
10
12
|
};
|
|
13
|
+
const messages = defineMessages({
|
|
14
|
+
imageAltText: {
|
|
15
|
+
id: 'smart-link.image-icon.altText',
|
|
16
|
+
defaultMessage: 'Link Icon'
|
|
17
|
+
}
|
|
18
|
+
});
|
|
11
19
|
const ImageIcon = ({
|
|
12
20
|
defaultIcon,
|
|
13
21
|
testId,
|
|
@@ -20,6 +28,9 @@ const ImageIcon = ({
|
|
|
20
28
|
hideLoadingSkeleton = false
|
|
21
29
|
}) => {
|
|
22
30
|
const [hasImageErrored, setHasImageErrored] = useState(false);
|
|
31
|
+
const {
|
|
32
|
+
formatMessage
|
|
33
|
+
} = useIntl();
|
|
23
34
|
|
|
24
35
|
// If url changes, reset state
|
|
25
36
|
useEffect(() => {
|
|
@@ -51,7 +62,7 @@ const ImageIcon = ({
|
|
|
51
62
|
loaded: /*#__PURE__*/React.createElement("img", {
|
|
52
63
|
src: url,
|
|
53
64
|
"data-testid": `${testId}-image`,
|
|
54
|
-
alt: "",
|
|
65
|
+
alt: fg('navx-2811-smart-link-a11y-image-alt') ? formatMessage(messages.imageAltText) : "",
|
|
55
66
|
style: {
|
|
56
67
|
width,
|
|
57
68
|
height
|
|
@@ -95,7 +95,6 @@ export const IconAndTitleLayout = ({
|
|
|
95
95
|
const renderIconPlaceholder = React.useCallback(testId => {
|
|
96
96
|
return defaultIcon || /*#__PURE__*/React.createElement(LinkIcon, {
|
|
97
97
|
label: "link",
|
|
98
|
-
LEGACY_size: "small",
|
|
99
98
|
testId: `${testId}-default`,
|
|
100
99
|
color: "currentColor"
|
|
101
100
|
});
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "43.20.
|
|
15
|
+
packageVersion: "43.20.1",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "43.20.
|
|
7
|
+
packageVersion: "43.20.1"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -28,7 +28,6 @@ var ErroredView = function ErroredView(_ref) {
|
|
|
28
28
|
}), /*#__PURE__*/React.createElement(WarningIcon, {
|
|
29
29
|
label: "errored-warning-icon",
|
|
30
30
|
color: "var(--ds-icon-warning, #E06C00)",
|
|
31
|
-
LEGACY_size: "small",
|
|
32
31
|
testId: "".concat(testId, "-warning-icon")
|
|
33
32
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
34
33
|
maxLines: 3,
|
|
@@ -25,7 +25,6 @@ export var EmbedCardErroredView = function EmbedCardErroredView(_ref) {
|
|
|
25
25
|
isSelected: isSelected,
|
|
26
26
|
testId: testId
|
|
27
27
|
}, /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
28
|
-
LEGACY_size: "small",
|
|
29
28
|
color: "var(--ds-icon-danger, ".concat(R300, ")"),
|
|
30
29
|
label: "error-icon"
|
|
31
30
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
@@ -34,7 +34,6 @@ var EmbedCardResolvedViewOld = /*#__PURE__*/React.forwardRef(function (_ref, emb
|
|
|
34
34
|
var linkGlyph = React.useMemo(function () {
|
|
35
35
|
return /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
36
36
|
label: "icon",
|
|
37
|
-
LEGACY_size: "small",
|
|
38
37
|
testId: "embed-card-fallback-icon",
|
|
39
38
|
color: "currentColor"
|
|
40
39
|
});
|
|
@@ -108,7 +107,6 @@ var EmbedCardResolvedViewUpdated = /*#__PURE__*/React.forwardRef(function (_ref2
|
|
|
108
107
|
var linkGlyph = React.useMemo(function () {
|
|
109
108
|
return /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
110
109
|
label: "icon",
|
|
111
|
-
LEGACY_size: "small",
|
|
112
110
|
testId: "embed-card-fallback-icon",
|
|
113
111
|
color: "currentColor"
|
|
114
112
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
._zulpv47k{gap:var(--ds-space-250,20px)}
|
|
3
|
-
._18u01wug{margin-left:auto}
|
|
1
|
+
|
|
2
|
+
._zulpv47k{gap:var(--ds-space-250,20px)}._18u01wug{margin-left:auto}
|
|
4
3
|
._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
|
|
5
4
|
._19pk1wug{margin-top:auto}
|
|
6
5
|
._1bah1h6o{justify-content:center}
|
|
@@ -4,11 +4,11 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import Heading from '@atlaskit/heading';
|
|
6
6
|
import LinkGlyph from '@atlaskit/icon/core/link';
|
|
7
|
+
import { Text } from '@atlaskit/primitives/compiled';
|
|
7
8
|
import { ExpandedFrame } from '../../components/ExpandedFrame';
|
|
8
9
|
import { ImageIcon } from '../../components/ImageIcon';
|
|
9
10
|
var containerStyles = null;
|
|
10
11
|
var contentStyles = null;
|
|
11
|
-
var descriptionStyles = null;
|
|
12
12
|
var imageStyles = null;
|
|
13
13
|
var UnresolvedView = function UnresolvedView(_ref) {
|
|
14
14
|
var button = _ref.button,
|
|
@@ -31,7 +31,6 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
31
31
|
src: typeof iconUrlOrElement === 'string' ? iconUrlOrElement : undefined,
|
|
32
32
|
default: /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
33
33
|
label: "icon",
|
|
34
|
-
LEGACY_size: "small",
|
|
35
34
|
testId: "embed-card-fallback-icon",
|
|
36
35
|
color: "currentColor"
|
|
37
36
|
})
|
|
@@ -83,9 +82,9 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
83
82
|
}, image, /*#__PURE__*/React.createElement(Heading, {
|
|
84
83
|
size: "large",
|
|
85
84
|
testId: "".concat(testId, "-unresolved-title")
|
|
86
|
-
}, title), /*#__PURE__*/React.createElement(
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
}, title), /*#__PURE__*/React.createElement(Text, {
|
|
86
|
+
align: "center",
|
|
87
|
+
testId: "".concat(testId, "-unresolved-description")
|
|
89
88
|
}, description), button)));
|
|
90
89
|
};
|
|
91
90
|
export default UnresolvedView;
|
|
@@ -72,7 +72,9 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
72
72
|
},
|
|
73
73
|
label: messages.viewOriginal,
|
|
74
74
|
onClick: onViewButtonClick,
|
|
75
|
-
testId: "".concat(testId, "-url")
|
|
75
|
+
testId: "".concat(testId, "-url"),
|
|
76
|
+
role: fg('navx-2185-smart-link-preview-modal-icon-role') ? 'link' : '',
|
|
77
|
+
"aria-label": fg('navx-2185-smart-link-preview-modal-icon-role') ? messages.viewOriginal : ''
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
80
|
}, [onViewButtonClick, providerName, testId]);
|
|
@@ -179,7 +181,9 @@ var LinkInfoNew = function LinkInfoNew(_ref2) {
|
|
|
179
181
|
},
|
|
180
182
|
label: messages.viewOriginal,
|
|
181
183
|
onClick: onViewButtonClick,
|
|
182
|
-
testId: "".concat(testId, "-url")
|
|
184
|
+
testId: "".concat(testId, "-url"),
|
|
185
|
+
role: fg('navx-2185-smart-link-preview-modal-icon-role') ? 'link' : '',
|
|
186
|
+
"aria-label": fg('navx-2185-smart-link-preview-modal-icon-role') ? messages.viewOriginal : ''
|
|
183
187
|
});
|
|
184
188
|
}
|
|
185
189
|
}, [onViewButtonClick, providerName, testId]);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { useIntl } from 'react-intl-next';
|
|
3
4
|
import { IconButton } from '@atlaskit/button/new';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
5
7
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
6
8
|
var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
@@ -8,7 +10,8 @@ var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
|
8
10
|
icon = _ref.icon,
|
|
9
11
|
label = _ref.label,
|
|
10
12
|
onClick = _ref.onClick,
|
|
11
|
-
testId = _ref.testId
|
|
13
|
+
testId = _ref.testId,
|
|
14
|
+
role = _ref.role;
|
|
12
15
|
var onMouseDown = useMouseDownEvent();
|
|
13
16
|
var _useIntl = useIntl(),
|
|
14
17
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -17,13 +20,15 @@ var LinkInfoButton = function LinkInfoButton(_ref) {
|
|
|
17
20
|
hideTooltipOnClick: true,
|
|
18
21
|
tag: "span",
|
|
19
22
|
testId: "".concat(testId, "-tooltip")
|
|
20
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
23
|
+
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
21
24
|
appearance: "subtle",
|
|
22
25
|
icon: icon,
|
|
23
26
|
label: formatMessage(label),
|
|
24
27
|
onClick: onClick,
|
|
25
28
|
onMouseDown: onMouseDown,
|
|
26
29
|
testId: "".concat(testId, "-button")
|
|
27
|
-
})
|
|
30
|
+
}, fg('navx-2185-smart-link-preview-modal-icon-role') ? {
|
|
31
|
+
role: role
|
|
32
|
+
} : {})));
|
|
28
33
|
};
|
|
29
34
|
export default LinkInfoButton;
|
package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js
CHANGED
|
@@ -26,7 +26,6 @@ export var AIFooterMetadata = function AIFooterMetadata(_ref) {
|
|
|
26
26
|
}, function (tooltipProps) {
|
|
27
27
|
return /*#__PURE__*/React.createElement(Box, tooltipProps, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
28
28
|
label: "Information",
|
|
29
|
-
LEGACY_size: "small",
|
|
30
29
|
color: "var(--ds-icon-subtle, #505258)"
|
|
31
30
|
}));
|
|
32
31
|
}), /*#__PURE__*/React.createElement(AIIcon, {
|
|
@@ -81,14 +81,12 @@ var AtlaskitIcon = function AtlaskitIcon(_ref) {
|
|
|
81
81
|
return /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
82
82
|
label: label,
|
|
83
83
|
testId: testId,
|
|
84
|
-
LEGACY_size: size === SmartLinkSize.Large || size === SmartLinkSize.XLarge ? 'medium' : 'small',
|
|
85
84
|
color: "var(--ds-icon-danger, #C9372C)"
|
|
86
85
|
});
|
|
87
86
|
default:
|
|
88
87
|
return /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
89
88
|
label: label,
|
|
90
89
|
testId: testId,
|
|
91
|
-
LEGACY_size: size === SmartLinkSize.Large || size === SmartLinkSize.XLarge ? 'medium' : 'small',
|
|
92
90
|
size: size
|
|
93
91
|
});
|
|
94
92
|
}
|
|
@@ -4,11 +4,19 @@ import "./index.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useEffect, useState } from 'react';
|
|
7
|
+
import { defineMessages, useIntl } from 'react-intl-next';
|
|
7
8
|
import ImageLoader from 'react-render-image';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
10
|
import { LoadingSkeleton } from '../loading-skeleton';
|
|
9
11
|
var styles = {
|
|
10
12
|
roundImg: "_2rko1rr0"
|
|
11
13
|
};
|
|
14
|
+
var messages = defineMessages({
|
|
15
|
+
imageAltText: {
|
|
16
|
+
id: 'smart-link.image-icon.altText',
|
|
17
|
+
defaultMessage: 'Link Icon'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
12
20
|
var ImageIcon = function ImageIcon(_ref) {
|
|
13
21
|
var defaultIcon = _ref.defaultIcon,
|
|
14
22
|
testId = _ref.testId,
|
|
@@ -25,6 +33,8 @@ var ImageIcon = function ImageIcon(_ref) {
|
|
|
25
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
34
|
hasImageErrored = _useState2[0],
|
|
27
35
|
setHasImageErrored = _useState2[1];
|
|
36
|
+
var _useIntl = useIntl(),
|
|
37
|
+
formatMessage = _useIntl.formatMessage;
|
|
28
38
|
|
|
29
39
|
// If url changes, reset state
|
|
30
40
|
useEffect(function () {
|
|
@@ -58,7 +68,7 @@ var ImageIcon = function ImageIcon(_ref) {
|
|
|
58
68
|
loaded: /*#__PURE__*/React.createElement("img", {
|
|
59
69
|
src: url,
|
|
60
70
|
"data-testid": "".concat(testId, "-image"),
|
|
61
|
-
alt: "",
|
|
71
|
+
alt: fg('navx-2811-smart-link-a11y-image-alt') ? formatMessage(messages.imageAltText) : "",
|
|
62
72
|
style: {
|
|
63
73
|
width: width,
|
|
64
74
|
height: height
|
|
@@ -103,7 +103,6 @@ export var IconAndTitleLayout = function IconAndTitleLayout(_ref2) {
|
|
|
103
103
|
var renderIconPlaceholder = React.useCallback(function (testId) {
|
|
104
104
|
return defaultIcon || /*#__PURE__*/React.createElement(LinkIcon, {
|
|
105
105
|
label: "link",
|
|
106
|
-
LEGACY_size: "small",
|
|
107
106
|
testId: "".concat(testId, "-default"),
|
|
108
107
|
color: "currentColor"
|
|
109
108
|
});
|
|
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "43.20.
|
|
18
|
+
packageVersion: "43.20.1",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -23,7 +23,6 @@ export var Icon = function Icon(_ref) {
|
|
|
23
23
|
isFlexibleUi = _ref$isFlexibleUi === void 0 ? false : _ref$isFlexibleUi;
|
|
24
24
|
var placeholder = defaultIcon || /*#__PURE__*/React.createElement(LinkIcon, {
|
|
25
25
|
label: "link",
|
|
26
|
-
LEGACY_size: "small",
|
|
27
26
|
testId: "".concat(testId, "-default"),
|
|
28
27
|
color: "currentColor"
|
|
29
28
|
});
|
|
@@ -6,7 +6,8 @@ export type LinkInfoButtonProps = {
|
|
|
6
6
|
icon: IconProp;
|
|
7
7
|
label: MessageDescriptor;
|
|
8
8
|
onClick?: () => void;
|
|
9
|
+
role?: string;
|
|
9
10
|
testId?: string;
|
|
10
11
|
};
|
|
11
|
-
declare const LinkInfoButton: ({ content, icon, label, onClick, testId, }: LinkInfoButtonProps) => React.JSX.Element;
|
|
12
|
+
declare const LinkInfoButton: ({ content, icon, label, onClick, testId, role, }: LinkInfoButtonProps) => React.JSX.Element;
|
|
12
13
|
export default LinkInfoButton;
|
|
@@ -6,7 +6,8 @@ export type LinkInfoButtonProps = {
|
|
|
6
6
|
icon: IconProp;
|
|
7
7
|
label: MessageDescriptor;
|
|
8
8
|
onClick?: () => void;
|
|
9
|
+
role?: string;
|
|
9
10
|
testId?: string;
|
|
10
11
|
};
|
|
11
|
-
declare const LinkInfoButton: ({ content, icon, label, onClick, testId, }: LinkInfoButtonProps) => React.JSX.Element;
|
|
12
|
+
declare const LinkInfoButton: ({ content, icon, label, onClick, testId, role, }: LinkInfoButtonProps) => React.JSX.Element;
|
|
12
13
|
export default LinkInfoButton;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "43.20.
|
|
3
|
+
"version": "43.20.2",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@atlaskit/textfield": "^8.2.0",
|
|
72
72
|
"@atlaskit/theme": "^21.0.0",
|
|
73
73
|
"@atlaskit/tile": "^1.0.0",
|
|
74
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
74
|
+
"@atlaskit/tmp-editor-statsig": "^16.12.0",
|
|
75
75
|
"@atlaskit/tokens": "^9.1.0",
|
|
76
76
|
"@atlaskit/tooltip": "^20.12.0",
|
|
77
77
|
"@atlaskit/ufo": "^0.4.0",
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"@atlaskit/media-test-helpers": "^39.0.0",
|
|
104
104
|
"@atlaskit/react-ufo": "^4.16.0",
|
|
105
105
|
"@atlaskit/ssr": "workspace:^",
|
|
106
|
+
"@atlassian/a11y-jest-testing": "^0.6.0",
|
|
106
107
|
"@atlassian/analytics-tooling": "workspace:^",
|
|
107
108
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
108
109
|
"@atlassian/gemini": "^1.28.0",
|
|
@@ -238,6 +239,12 @@
|
|
|
238
239
|
},
|
|
239
240
|
"navx-2816-a11y-fix-smart-links-headings": {
|
|
240
241
|
"type": "boolean"
|
|
242
|
+
},
|
|
243
|
+
"navx-2811-smart-link-a11y-image-alt": {
|
|
244
|
+
"type": "boolean"
|
|
245
|
+
},
|
|
246
|
+
"navx-2185-smart-link-preview-modal-icon-role": {
|
|
247
|
+
"type": "boolean"
|
|
241
248
|
}
|
|
242
249
|
},
|
|
243
250
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"
|