@atlaskit/task-decision 19.1.4 → 19.2.1

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,24 @@
1
1
  # @atlaskit/task-decision
2
2
 
3
+ ## 19.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 19.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#146310](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146310)
14
+ [`fb230587c00e2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fb230587c00e2) -
15
+ [ux] [A11Y-9616] Add internationalisation to tasks and descisions plugin, wrap tasks item lists in
16
+ a fieldset to group them and give them an accessible name
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 19.1.4
4
23
 
5
24
  ### Patch Changes
@@ -26,6 +26,9 @@
26
26
  {
27
27
  "path": "../../../design-system/icon/afm-cc/tsconfig.json"
28
28
  },
29
+ {
30
+ "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
31
+ },
29
32
  {
30
33
  "path": "../../../platform/feature-flags-react/afm-cc/tsconfig.json"
31
34
  },
@@ -26,6 +26,12 @@
26
26
  {
27
27
  "path": "../../../design-system/icon/afm-jira/tsconfig.json"
28
28
  },
29
+ {
30
+ "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
31
+ },
32
+ {
33
+ "path": "../../../platform/feature-flags-react/afm-jira/tsconfig.json"
34
+ },
29
35
  {
30
36
  "path": "../../../design-system/tokens/afm-jira/tsconfig.json"
31
37
  },
@@ -26,6 +26,9 @@
26
26
  {
27
27
  "path": "../../../design-system/icon/afm-post-office/tsconfig.json"
28
28
  },
29
+ {
30
+ "path": "../../../platform/feature-flags-react/afm-post-office/tsconfig.json"
31
+ },
29
32
  {
30
33
  "path": "../../../design-system/tokens/afm-post-office/tsconfig.json"
31
34
  },
@@ -16,19 +16,52 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
16
16
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
17
  var _react = _interopRequireWildcard(require("react"));
18
18
  var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
19
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
+ var _i18n = require("./i18n");
21
+ var _reactIntlNext = require("react-intl-next");
19
22
  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); }
20
23
  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; }
21
24
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
22
25
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
26
  var listStyles = null;
24
27
  var taskListStyles = null;
25
- var TaskList = exports.default = /*#__PURE__*/function (_PureComponent) {
26
- function TaskList() {
27
- (0, _classCallCheck2.default)(this, TaskList);
28
- return _callSuper(this, TaskList, arguments);
28
+ var TaskListNew = function TaskListNew(_ref) {
29
+ var listId = _ref.listId,
30
+ children = _ref.children;
31
+ var listSize = _react.default.Children.count(children);
32
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
33
+ formatMessage = _useIntl.formatMessage;
34
+ if (!children) {
35
+ return null;
29
36
  }
30
- (0, _inherits2.default)(TaskList, _PureComponent);
31
- return (0, _createClass2.default)(TaskList, [{
37
+ return /*#__PURE__*/_react.default.createElement("div", {
38
+ role: "group",
39
+ "data-task-list-local-id": "",
40
+ "aria-label": formatMessage(_i18n.messages.fieldsetLabel),
41
+ className: (0, _runtime.ax)(["_2mzuglyw _19bvidpf"])
42
+ }, _react.default.Children.map(children, function (child, idx) {
43
+ var _ref2 = child.props,
44
+ localId = _ref2.localId;
45
+ return /*#__PURE__*/_react.default.createElement(_analyticsNamespacedContext.FabricElementsAnalyticsContext, {
46
+ data: {
47
+ listLocalId: listId,
48
+ listSize: listSize,
49
+ position: idx
50
+ }
51
+ }, /*#__PURE__*/_react.default.createElement("div", {
52
+ key: idx,
53
+ "data-task-local-id": localId || '',
54
+ className: (0, _runtime.ax)(["_19pk1b66"])
55
+ }, child));
56
+ }));
57
+ };
58
+ var TaskListOld = /*#__PURE__*/function (_PureComponent) {
59
+ function TaskListOld() {
60
+ (0, _classCallCheck2.default)(this, TaskListOld);
61
+ return _callSuper(this, TaskListOld, arguments);
62
+ }
63
+ (0, _inherits2.default)(TaskListOld, _PureComponent);
64
+ return (0, _createClass2.default)(TaskListOld, [{
32
65
  key: "render",
33
66
  value: function render() {
34
67
  var _this$props = this.props,
@@ -49,8 +82,8 @@ var TaskList = exports.default = /*#__PURE__*/function (_PureComponent) {
49
82
  "data-task-list-local-id": "",
50
83
  className: (0, _runtime.ax)(["_2mzuglyw _19bvidpf"])
51
84
  }, _react.default.Children.map(children, function (child, idx) {
52
- var _ref = child.props,
53
- localId = _ref.localId;
85
+ var _ref3 = child.props,
86
+ localId = _ref3.localId;
54
87
  return /*#__PURE__*/_react.default.createElement(_analyticsNamespacedContext.FabricElementsAnalyticsContext, {
55
88
  data: {
56
89
  listLocalId: listId,
@@ -65,4 +98,11 @@ var TaskList = exports.default = /*#__PURE__*/function (_PureComponent) {
65
98
  }));
66
99
  }
67
100
  }]);
68
- }(_react.PureComponent);
101
+ }(_react.PureComponent);
102
+ var TaskListNext = function TaskListNext(props) {
103
+ if ((0, _platformFeatureFlags.fg)('editor_a11y_group_around_action_items')) {
104
+ return /*#__PURE__*/_react.default.createElement(TaskListNew, props);
105
+ }
106
+ return /*#__PURE__*/_react.default.createElement(TaskListOld, props);
107
+ };
108
+ var _default = exports.default = TaskListNext;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.messages = void 0;
7
+ var _reactIntlNext = require("react-intl-next");
8
+ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
9
+ fieldsetLabel: {
10
+ id: 'fabric.editor.fieldsetLabel',
11
+ defaultMessage: 'Action Item List',
12
+ description: 'Label for a list of tasks/ action items'
13
+ }
14
+ });
@@ -1,12 +1,47 @@
1
1
  /* TaskList.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  import "./TaskList.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
- import React from 'react';
5
- import { PureComponent } from 'react';
4
+ import React, { PureComponent } from 'react';
6
5
  import { FabricElementsAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { messages } from './i18n';
8
+ import { useIntl } from 'react-intl-next';
7
9
  const listStyles = null;
8
10
  const taskListStyles = null;
9
- export default class TaskList extends PureComponent {
11
+ const TaskListNew = ({
12
+ listId,
13
+ children
14
+ }) => {
15
+ const listSize = React.Children.count(children);
16
+ const {
17
+ formatMessage
18
+ } = useIntl();
19
+ if (!children) {
20
+ return null;
21
+ }
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ role: "group",
24
+ "data-task-list-local-id": "",
25
+ "aria-label": formatMessage(messages.fieldsetLabel),
26
+ className: ax(["_2mzuglyw _19bvidpf"])
27
+ }, React.Children.map(children, (child, idx) => {
28
+ const {
29
+ localId
30
+ } = child.props;
31
+ return /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext, {
32
+ data: {
33
+ listLocalId: listId,
34
+ listSize,
35
+ position: idx
36
+ }
37
+ }, /*#__PURE__*/React.createElement("div", {
38
+ key: idx,
39
+ "data-task-local-id": localId || '',
40
+ className: ax(["_19pk1b66"])
41
+ }, child));
42
+ }));
43
+ };
44
+ class TaskListOld extends PureComponent {
10
45
  render() {
11
46
  const {
12
47
  listId,
@@ -43,4 +78,11 @@ export default class TaskList extends PureComponent {
43
78
  }, child));
44
79
  }));
45
80
  }
46
- }
81
+ }
82
+ const TaskListNext = props => {
83
+ if (fg('editor_a11y_group_around_action_items')) {
84
+ return /*#__PURE__*/React.createElement(TaskListNew, props);
85
+ }
86
+ return /*#__PURE__*/React.createElement(TaskListOld, props);
87
+ };
88
+ export default TaskListNext;
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export const messages = defineMessages({
3
+ fieldsetLabel: {
4
+ id: 'fabric.editor.fieldsetLabel',
5
+ defaultMessage: 'Action Item List',
6
+ description: 'Label for a list of tasks/ action items'
7
+ }
8
+ });
@@ -8,18 +8,50 @@ import "./TaskList.compiled.css";
8
8
  import { ax, ix } from "@compiled/react/runtime";
9
9
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
- import React from 'react';
12
- import { PureComponent } from 'react';
11
+ import React, { PureComponent } from 'react';
13
12
  import { FabricElementsAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
14
+ import { messages } from './i18n';
15
+ import { useIntl } from 'react-intl-next';
14
16
  var listStyles = null;
15
17
  var taskListStyles = null;
16
- var TaskList = /*#__PURE__*/function (_PureComponent) {
17
- function TaskList() {
18
- _classCallCheck(this, TaskList);
19
- return _callSuper(this, TaskList, arguments);
18
+ var TaskListNew = function TaskListNew(_ref) {
19
+ var listId = _ref.listId,
20
+ children = _ref.children;
21
+ var listSize = React.Children.count(children);
22
+ var _useIntl = useIntl(),
23
+ formatMessage = _useIntl.formatMessage;
24
+ if (!children) {
25
+ return null;
20
26
  }
21
- _inherits(TaskList, _PureComponent);
22
- return _createClass(TaskList, [{
27
+ return /*#__PURE__*/React.createElement("div", {
28
+ role: "group",
29
+ "data-task-list-local-id": "",
30
+ "aria-label": formatMessage(messages.fieldsetLabel),
31
+ className: ax(["_2mzuglyw _19bvidpf"])
32
+ }, React.Children.map(children, function (child, idx) {
33
+ var _ref2 = child.props,
34
+ localId = _ref2.localId;
35
+ return /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext, {
36
+ data: {
37
+ listLocalId: listId,
38
+ listSize: listSize,
39
+ position: idx
40
+ }
41
+ }, /*#__PURE__*/React.createElement("div", {
42
+ key: idx,
43
+ "data-task-local-id": localId || '',
44
+ className: ax(["_19pk1b66"])
45
+ }, child));
46
+ }));
47
+ };
48
+ var TaskListOld = /*#__PURE__*/function (_PureComponent) {
49
+ function TaskListOld() {
50
+ _classCallCheck(this, TaskListOld);
51
+ return _callSuper(this, TaskListOld, arguments);
52
+ }
53
+ _inherits(TaskListOld, _PureComponent);
54
+ return _createClass(TaskListOld, [{
23
55
  key: "render",
24
56
  value: function render() {
25
57
  var _this$props = this.props,
@@ -40,8 +72,8 @@ var TaskList = /*#__PURE__*/function (_PureComponent) {
40
72
  "data-task-list-local-id": "",
41
73
  className: ax(["_2mzuglyw _19bvidpf"])
42
74
  }, React.Children.map(children, function (child, idx) {
43
- var _ref = child.props,
44
- localId = _ref.localId;
75
+ var _ref3 = child.props,
76
+ localId = _ref3.localId;
45
77
  return /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext, {
46
78
  data: {
47
79
  listLocalId: listId,
@@ -57,4 +89,10 @@ var TaskList = /*#__PURE__*/function (_PureComponent) {
57
89
  }
58
90
  }]);
59
91
  }(PureComponent);
60
- export { TaskList as default };
92
+ var TaskListNext = function TaskListNext(props) {
93
+ if (fg('editor_a11y_group_around_action_items')) {
94
+ return /*#__PURE__*/React.createElement(TaskListNew, props);
95
+ }
96
+ return /*#__PURE__*/React.createElement(TaskListOld, props);
97
+ };
98
+ export default TaskListNext;
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export var messages = defineMessages({
3
+ fieldsetLabel: {
4
+ id: 'fabric.editor.fieldsetLabel',
5
+ defaultMessage: 'Action Item List',
6
+ description: 'Label for a list of tasks/ action items'
7
+ }
8
+ });
@@ -1,8 +1,11 @@
1
- import { PureComponent, type ReactNode } from 'react';
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { ReactNode } from 'react';
2
6
  export interface Props {
3
7
  listId?: string;
4
8
  children?: ReactNode;
5
9
  }
6
- export default class TaskList extends PureComponent<Props, {}> {
7
- render(): JSX.Element | null;
8
- }
10
+ declare const TaskListNext: (props: Props) => JSX.Element;
11
+ export default TaskListNext;
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ fieldsetLabel: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
@@ -1,8 +1,11 @@
1
- import { PureComponent, type ReactNode } from 'react';
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { ReactNode } from 'react';
2
6
  export interface Props {
3
7
  listId?: string;
4
8
  children?: ReactNode;
5
9
  }
6
- export default class TaskList extends PureComponent<Props, {}> {
7
- render(): JSX.Element | null;
8
- }
10
+ declare const TaskListNext: (props: Props) => JSX.Element;
11
+ export default TaskListNext;
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ fieldsetLabel: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/task-decision",
3
- "version": "19.1.4",
3
+ "version": "19.2.1",
4
4
  "description": "Tasks and decisions react components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,12 +43,14 @@
43
43
  "dependencies": {
44
44
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
45
45
  "@atlaskit/analytics-next": "^11.0.0",
46
- "@atlaskit/icon": "^25.6.0",
47
- "@atlaskit/platform-feature-flags-react": "^0.1.0",
48
- "@atlaskit/tokens": "^4.7.0",
46
+ "@atlaskit/icon": "^25.7.0",
47
+ "@atlaskit/platform-feature-flags": "^1.1.0",
48
+ "@atlaskit/platform-feature-flags-react": "^0.2.0",
49
+ "@atlaskit/tokens": "^4.8.0",
49
50
  "@atlaskit/util-service-support": "^6.3.0",
50
51
  "@babel/runtime": "^7.0.0",
51
52
  "@compiled/react": "^0.18.3",
53
+ "react-intl-next": "npm:react-intl@^5.18.1",
52
54
  "use-callback-ref": "^1.2.3",
53
55
  "uuid": "^3.1.0"
54
56
  },
@@ -58,10 +60,10 @@
58
60
  "url-search-params": "^0.10.0"
59
61
  },
60
62
  "devDependencies": {
61
- "@af/visual-regression": "^1.3.0",
63
+ "@af/visual-regression": "workspace:^",
62
64
  "@atlaskit/analytics-listeners": "^9.0.0",
63
- "@atlaskit/elements-test-helpers": "^0.9.0",
64
- "@atlaskit/ssr": "^0.4.0",
65
+ "@atlaskit/elements-test-helpers": "workspace:^",
66
+ "@atlaskit/ssr": "workspace:^",
65
67
  "@atlaskit/util-data-test": "^18.0.0",
66
68
  "@testing-library/react": "^13.4.0",
67
69
  "@testing-library/user-event": "^14.4.3",
@@ -86,5 +88,10 @@
86
88
  "compiled"
87
89
  ]
88
90
  }
91
+ },
92
+ "platform-feature-flags": {
93
+ "editor_a11y_group_around_action_items": {
94
+ "type": "boolean"
95
+ }
89
96
  }
90
97
  }