@atlaskit/link-datasource 6.4.4 → 6.4.6

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,22 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 6.4.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e0edc05cd52d7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e0edc05cd52d7) -
8
+ Migrates internal 16px Avatar usage from `xsmall` to `xxsmall` as a 1:1 size rename with no visual
9
+ change.
10
+ - [`0972600d28868`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0972600d28868) -
11
+ Add visually-hidden 'opens in a new tab' hint to Jira issue key links in Datasources tables
12
+ - Updated dependencies
13
+
14
+ ## 6.4.5
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 6.4.4
4
21
 
5
22
  ### Patch Changes
@@ -7,9 +7,13 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = exports.LINK_TYPE_TEST_ID = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
+ var _reactIntl = require("react-intl");
11
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
10
12
  var _smartCard = require("@atlaskit/smart-card");
11
13
  var _hoverCard = require("@atlaskit/smart-card/hover-card");
12
14
  var _linkUrl = _interopRequireDefault(require("@atlaskit/smart-card/link-url"));
15
+ var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden/visually-hidden"));
16
+ var _messages = require("./messages");
13
17
  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); }
14
18
  var linkStyles = {
15
19
  key: {
@@ -26,6 +30,8 @@ var LinkRenderType = function LinkRenderType(_ref) {
26
30
  text = _ref.text,
27
31
  _ref$testId = _ref.testId,
28
32
  testId = _ref$testId === void 0 ? LINK_TYPE_TEST_ID : _ref$testId;
33
+ var _useIntl = (0, _reactIntl.useIntl)(),
34
+ formatMessage = _useIntl.formatMessage;
29
35
  var linkStyle = (0, _react.useMemo)(function () {
30
36
  return (style === null || style === void 0 ? void 0 : style.appearance) && linkStyles[style.appearance] || {};
31
37
  }, [style]);
@@ -41,8 +47,12 @@ var LinkRenderType = function LinkRenderType(_ref) {
41
47
  style: linkStyle,
42
48
  "data-testid": testId,
43
49
  target: "_blank"
44
- }, text || url));
45
- }, [linkStyle, url, text, testId]);
50
+ }, text || url, (0, _fg.fg)('navx-5509-sllv-link-new-tab-hint') &&
51
+ /*#__PURE__*/
52
+ // This link always opens in a new tab (`target="_blank"` above), so
53
+ // screen reader users need to be told before activating it (WCAG 2.4.4).
54
+ _react.default.createElement(_visuallyHidden.default, null, " ".concat(formatMessage(_messages.messages.opensInNewTab)))));
55
+ }, [linkStyle, url, text, testId, formatMessage]);
46
56
  var SmartCard = function SmartCard() {
47
57
  var handleClick = function handleClick(e) {
48
58
  e.preventDefault();
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.messages = void 0;
7
+ var _reactIntl = require("react-intl");
8
+ var messages = exports.messages = (0, _reactIntl.defineMessages)({
9
+ opensInNewTab: {
10
+ defaultMessage: '(opens in a new tab)',
11
+ description: 'Visually hidden hint appended to a link that opens in a new browser tab, so screen reader users are informed of this before activating it.',
12
+ id: 'link-datasource.issue-like-table.render-type.link.opensInNewTab'
13
+ }
14
+ });
@@ -1,7 +1,11 @@
1
1
  import React, { useMemo } from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
2
4
  import { Card } from '@atlaskit/smart-card';
3
5
  import { HoverCard } from '@atlaskit/smart-card/hover-card';
4
6
  import LinkUrl from '@atlaskit/smart-card/link-url';
7
+ import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
8
+ import { messages } from './messages';
5
9
  const linkStyles = {
6
10
  key: {
7
11
  fontWeight: "var(--ds-font-weight-semibold, 600)",
@@ -17,6 +21,9 @@ const LinkRenderType = ({
17
21
  text,
18
22
  testId = LINK_TYPE_TEST_ID
19
23
  }) => {
24
+ const {
25
+ formatMessage
26
+ } = useIntl();
20
27
  const linkStyle = useMemo(() => {
21
28
  return (style === null || style === void 0 ? void 0 : style.appearance) && linkStyles[style.appearance] || {};
22
29
  }, [style]);
@@ -31,7 +38,11 @@ const LinkRenderType = ({
31
38
  style: linkStyle,
32
39
  "data-testid": testId,
33
40
  target: "_blank"
34
- }, text || url)), [linkStyle, url, text, testId]);
41
+ }, text || url, fg('navx-5509-sllv-link-new-tab-hint') &&
42
+ /*#__PURE__*/
43
+ // This link always opens in a new tab (`target="_blank"` above), so
44
+ // screen reader users need to be told before activating it (WCAG 2.4.4).
45
+ React.createElement(VisuallyHidden, null, ` ${formatMessage(messages.opensInNewTab)}`))), [linkStyle, url, text, testId, formatMessage]);
35
46
  const SmartCard = () => {
36
47
  const handleClick = e => {
37
48
  e.preventDefault();
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl';
2
+ export const messages = defineMessages({
3
+ opensInNewTab: {
4
+ defaultMessage: '(opens in a new tab)',
5
+ description: 'Visually hidden hint appended to a link that opens in a new browser tab, so screen reader users are informed of this before activating it.',
6
+ id: 'link-datasource.issue-like-table.render-type.link.opensInNewTab'
7
+ }
8
+ });
@@ -1,7 +1,11 @@
1
1
  import React, { useMemo } from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
2
4
  import { Card } from '@atlaskit/smart-card';
3
5
  import { HoverCard } from '@atlaskit/smart-card/hover-card';
4
6
  import LinkUrl from '@atlaskit/smart-card/link-url';
7
+ import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
8
+ import { messages } from './messages';
5
9
  var linkStyles = {
6
10
  key: {
7
11
  fontWeight: "var(--ds-font-weight-semibold, 600)",
@@ -17,6 +21,8 @@ var LinkRenderType = function LinkRenderType(_ref) {
17
21
  text = _ref.text,
18
22
  _ref$testId = _ref.testId,
19
23
  testId = _ref$testId === void 0 ? LINK_TYPE_TEST_ID : _ref$testId;
24
+ var _useIntl = useIntl(),
25
+ formatMessage = _useIntl.formatMessage;
20
26
  var linkStyle = useMemo(function () {
21
27
  return (style === null || style === void 0 ? void 0 : style.appearance) && linkStyles[style.appearance] || {};
22
28
  }, [style]);
@@ -32,8 +38,12 @@ var LinkRenderType = function LinkRenderType(_ref) {
32
38
  style: linkStyle,
33
39
  "data-testid": testId,
34
40
  target: "_blank"
35
- }, text || url));
36
- }, [linkStyle, url, text, testId]);
41
+ }, text || url, fg('navx-5509-sllv-link-new-tab-hint') &&
42
+ /*#__PURE__*/
43
+ // This link always opens in a new tab (`target="_blank"` above), so
44
+ // screen reader users need to be told before activating it (WCAG 2.4.4).
45
+ React.createElement(VisuallyHidden, null, " ".concat(formatMessage(messages.opensInNewTab)))));
46
+ }, [linkStyle, url, text, testId, formatMessage]);
37
47
  var SmartCard = function SmartCard() {
38
48
  var handleClick = function handleClick(e) {
39
49
  e.preventDefault();
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl';
2
+ export var messages = defineMessages({
3
+ opensInNewTab: {
4
+ defaultMessage: '(opens in a new tab)',
5
+ description: 'Visually hidden hint appended to a link that opens in a new browser tab, so screen reader users are informed of this before activating it.',
6
+ id: 'link-datasource.issue-like-table.render-type.link.opensInNewTab'
7
+ }
8
+ });
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ opensInNewTab: {
3
+ defaultMessage: string;
4
+ description: string;
5
+ id: string;
6
+ };
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "6.4.4",
3
+ "version": "6.4.6",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -44,8 +44,8 @@
44
44
  "@atlaskit/badge": "^21.0.0",
45
45
  "@atlaskit/button": "^25.0.0",
46
46
  "@atlaskit/css": "^1.0.0",
47
- "@atlaskit/datetime-picker": "^18.2.0",
48
- "@atlaskit/dropdown-menu": "^17.2.0",
47
+ "@atlaskit/datetime-picker": "^18.3.0",
48
+ "@atlaskit/dropdown-menu": "^18.0.0",
49
49
  "@atlaskit/editor-prosemirror": "^8.0.0",
50
50
  "@atlaskit/empty-state": "^12.0.0",
51
51
  "@atlaskit/feature-gate-js-client": "^6.0.0",
@@ -81,16 +81,16 @@
81
81
  "@atlaskit/react-select": "^4.7.0",
82
82
  "@atlaskit/select": "^22.6.0",
83
83
  "@atlaskit/smart-card": "^45.17.0",
84
- "@atlaskit/smart-user-picker": "^11.3.0",
84
+ "@atlaskit/smart-user-picker": "^11.4.0",
85
85
  "@atlaskit/spinner": "^20.1.0",
86
86
  "@atlaskit/tag": "^15.4.0",
87
87
  "@atlaskit/textfield": "^10.0.0",
88
88
  "@atlaskit/theme": "^27.0.0",
89
- "@atlaskit/tokens": "^16.3.0",
89
+ "@atlaskit/tokens": "^16.4.0",
90
90
  "@atlaskit/tooltip": "^24.0.0",
91
91
  "@atlaskit/ufo": "^1.0.0",
92
92
  "@atlaskit/visually-hidden": "^4.2.0",
93
- "@atlaskit/width-detector": "^6.2.0",
93
+ "@atlaskit/width-detector": "^7.0.0",
94
94
  "@babel/runtime": "^7.0.0",
95
95
  "@compiled/react": "^1.0.0",
96
96
  "@types/dompurify": "^2.2.3",
@@ -114,7 +114,7 @@
114
114
  "@atlaskit/json-ld-types": "^2.0.0",
115
115
  "@atlaskit/link-test-helpers": "^11.0.0",
116
116
  "@atlaskit/ssr": "workspace:^",
117
- "@atlassian/a11y-jest-testing": "^0.14.0",
117
+ "@atlassian/a11y-jest-testing": "^0.15.0",
118
118
  "@atlassian/a11y-playwright-testing": "^0.10.0",
119
119
  "@atlassian/feature-flags-test-utils": "^1.2.0",
120
120
  "@atlassian/structured-docs-types": "workspace:^",
@@ -191,6 +191,9 @@
191
191
  "navx-5290-sllv-modal-a11y-updates": {
192
192
  "type": "boolean"
193
193
  },
194
+ "navx-5509-sllv-link-new-tab-hint": {
195
+ "type": "boolean"
196
+ },
194
197
  "astral_units_workspace_host_resolver": {
195
198
  "type": "boolean"
196
199
  }