@atlaskit/smart-card 43.20.1 → 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 CHANGED
@@ -1,5 +1,15 @@
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
+
3
13
  ## 43.20.1
4
14
 
5
15
  ### 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: "43.20.0"
14
+ packageVersion: "43.20.1"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,6 +1,5 @@
1
- ._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
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,
@@ -91,9 +91,9 @@ var UnresolvedView = function UnresolvedView(_ref) {
91
91
  }, image, /*#__PURE__*/_react.default.createElement(_heading.default, {
92
92
  size: "large",
93
93
  testId: "".concat(testId, "-unresolved-title")
94
- }, title), /*#__PURE__*/_react.default.createElement("span", {
95
- "data-testid": "".concat(testId, "-unresolved-description"),
96
- className: (0, _runtime.ax)(["_11c82smr _y3gn1h6o"])
94
+ }, title), /*#__PURE__*/_react.default.createElement(_compiled.Text, {
95
+ align: "center",
96
+ testId: "".concat(testId, "-unresolved-description")
97
97
  }, description), button)));
98
98
  };
99
99
  var _default = exports.default = UnresolvedView;
@@ -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
@@ -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.0",
25
+ packageVersion: "43.20.1",
26
26
  componentName: 'linkUrl'
27
27
  };
28
28
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -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.0"
5
+ packageVersion: "43.20.1"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,6 +1,5 @@
1
- ._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
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,
@@ -83,9 +83,9 @@ const UnresolvedView = ({
83
83
  }, image, /*#__PURE__*/React.createElement(Heading, {
84
84
  size: "large",
85
85
  testId: `${testId}-unresolved-title`
86
- }, title), /*#__PURE__*/React.createElement("span", {
87
- "data-testid": `${testId}-unresolved-description`,
88
- className: ax(["_11c82smr _y3gn1h6o"])
86
+ }, title), /*#__PURE__*/React.createElement(Text, {
87
+ align: "center",
88
+ testId: `${testId}-unresolved-description`
89
89
  }, description), button)));
90
90
  };
91
91
  export default UnresolvedView;
@@ -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
@@ -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.0",
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.0"
7
+ packageVersion: "43.20.1"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,6 +1,5 @@
1
- ._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
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,
@@ -82,9 +82,9 @@ var UnresolvedView = function UnresolvedView(_ref) {
82
82
  }, image, /*#__PURE__*/React.createElement(Heading, {
83
83
  size: "large",
84
84
  testId: "".concat(testId, "-unresolved-title")
85
- }, title), /*#__PURE__*/React.createElement("span", {
86
- "data-testid": "".concat(testId, "-unresolved-description"),
87
- className: ax(["_11c82smr _y3gn1h6o"])
85
+ }, title), /*#__PURE__*/React.createElement(Text, {
86
+ align: "center",
87
+ testId: "".concat(testId, "-unresolved-description")
88
88
  }, description), button)));
89
89
  };
90
90
  export default UnresolvedView;
@@ -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
@@ -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.0",
18
+ packageVersion: "43.20.1",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
  var Anchor = withLinkClickedEvent('a');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "43.20.1",
3
+ "version": "43.20.2",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -240,6 +240,9 @@
240
240
  "navx-2816-a11y-fix-smart-links-headings": {
241
241
  "type": "boolean"
242
242
  },
243
+ "navx-2811-smart-link-a11y-image-alt": {
244
+ "type": "boolean"
245
+ },
243
246
  "navx-2185-smart-link-preview-modal-icon-role": {
244
247
  "type": "boolean"
245
248
  }