@atlaskit/task-decision 19.2.24 → 19.3.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,22 @@
1
1
  # @atlaskit/task-decision
2
2
 
3
+ ## 19.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 19.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`d78ff724d3bce`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d78ff724d3bce) -
14
+ i18n aria labels for the Decision and if a decision is undefined provide an appropriate label
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 19.2.24
4
21
 
5
22
  ### Patch Changes
@@ -35,6 +35,9 @@
35
35
  {
36
36
  "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
37
37
  },
38
+ {
39
+ "path": "../../../editor/tmp-editor-statsig/afm-cc/tsconfig.json"
40
+ },
38
41
  {
39
42
  "path": "../../../design-system/tokens/afm-cc/tsconfig.json"
40
43
  },
@@ -35,6 +35,9 @@
35
35
  {
36
36
  "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
37
37
  },
38
+ {
39
+ "path": "../../../editor/tmp-editor-statsig/afm-jira/tsconfig.json"
40
+ },
38
41
  {
39
42
  "path": "../../../design-system/tokens/afm-jira/tsconfig.json"
40
43
  },
@@ -35,6 +35,9 @@
35
35
  {
36
36
  "path": "../../../platform/feature-flags/afm-products/tsconfig.json"
37
37
  },
38
+ {
39
+ "path": "../../../editor/tmp-editor-statsig/afm-products/tsconfig.json"
40
+ },
38
41
  {
39
42
  "path": "../../../design-system/tokens/afm-products/tsconfig.json"
40
43
  },
@@ -10,8 +10,11 @@ exports.default = void 0;
10
10
  require("./DecisionItem.compiled.css");
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _runtime = require("@compiled/react/runtime");
13
+ var _reactIntlNext = require("react-intl-next");
13
14
  var _decision = _interopRequireDefault(require("@atlaskit/icon/core/decision"));
15
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
16
  var _Item = _interopRequireDefault(require("./Item"));
17
+ var _i18n = require("./i18n");
15
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); }
16
19
  var iconStyles = null;
17
20
  var iconStylesWithPlaceholder = null;
@@ -22,11 +25,13 @@ var DecisionItem = function DecisionItem(_ref) {
22
25
  placeholder = _ref.placeholder,
23
26
  showPlaceholder = _ref.showPlaceholder,
24
27
  dataAttributes = _ref.dataAttributes;
28
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
29
+ formatMessage = _useIntl.formatMessage;
25
30
  var icon = /*#__PURE__*/React.createElement("span", {
26
31
  contentEditable: false,
27
32
  className: (0, _runtime.ax)(["_16jlidpf _1o9zidpf _i0dlexct _4t3i7vkz _1bsb7vkz _19pk1b66 _2hwxutpp _otyridpf _18u0idpf _syaz4pcx _1e0c1txw _4cvr1h6o _1bah1h6o", showPlaceholder && "_syazdgkc"])
28
33
  }, /*#__PURE__*/React.createElement(_decision.default, {
29
- label: "Decision",
34
+ label: (0, _expValEquals.expValEquals)('editor_a11y_decision_aria_label', 'isEnabled', true) ? showPlaceholder && children === undefined ? formatMessage(_i18n.messages.undefinedDecisionAriaLabel) : formatMessage(_i18n.messages.decisionAriaLabel) : 'Decision',
30
35
  spacing: "spacious",
31
36
  color: "currentColor"
32
37
  }));
@@ -20,5 +20,15 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
20
20
  id: 'platform.taskDecision.markTaskAsNotCompleted',
21
21
  defaultMessage: 'Mark task as not completed',
22
22
  description: 'Button to mark a task as not complete in the editor'
23
+ },
24
+ decisionAriaLabel: {
25
+ id: 'platform.taskDecision.decisionAriaLabel',
26
+ defaultMessage: 'Decision',
27
+ description: 'Descriptive text for a decision element'
28
+ },
29
+ undefinedDecisionAriaLabel: {
30
+ id: 'platform.taskDecision.undefinedDecisionAriaLabel',
31
+ defaultMessage: 'Undefined decision',
32
+ description: 'Descriptive text for an undefined decision element'
23
33
  }
24
34
  });
@@ -2,8 +2,11 @@
2
2
  import "./DecisionItem.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
+ import { useIntl } from 'react-intl-next';
5
6
  import DecisionIcon from '@atlaskit/icon/core/decision';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
8
  import Item from './Item';
9
+ import { messages } from './i18n';
7
10
  const iconStyles = null;
8
11
  const iconStylesWithPlaceholder = null;
9
12
  const DecisionItem = ({
@@ -14,11 +17,14 @@ const DecisionItem = ({
14
17
  showPlaceholder,
15
18
  dataAttributes
16
19
  }) => {
20
+ const {
21
+ formatMessage
22
+ } = useIntl();
17
23
  const icon = /*#__PURE__*/React.createElement("span", {
18
24
  contentEditable: false,
19
25
  className: ax(["_16jlidpf _1o9zidpf _i0dlexct _4t3i7vkz _1bsb7vkz _19pk1b66 _2hwxutpp _otyridpf _18u0idpf _syaz4pcx _1e0c1txw _4cvr1h6o _1bah1h6o", showPlaceholder && "_syazdgkc"])
20
26
  }, /*#__PURE__*/React.createElement(DecisionIcon, {
21
- label: "Decision",
27
+ label: expValEquals('editor_a11y_decision_aria_label', 'isEnabled', true) ? showPlaceholder && children === undefined ? formatMessage(messages.undefinedDecisionAriaLabel) : formatMessage(messages.decisionAriaLabel) : 'Decision',
22
28
  spacing: "spacious",
23
29
  color: "currentColor"
24
30
  }));
@@ -14,5 +14,15 @@ export const messages = defineMessages({
14
14
  id: 'platform.taskDecision.markTaskAsNotCompleted',
15
15
  defaultMessage: 'Mark task as not completed',
16
16
  description: 'Button to mark a task as not complete in the editor'
17
+ },
18
+ decisionAriaLabel: {
19
+ id: 'platform.taskDecision.decisionAriaLabel',
20
+ defaultMessage: 'Decision',
21
+ description: 'Descriptive text for a decision element'
22
+ },
23
+ undefinedDecisionAriaLabel: {
24
+ id: 'platform.taskDecision.undefinedDecisionAriaLabel',
25
+ defaultMessage: 'Undefined decision',
26
+ description: 'Descriptive text for an undefined decision element'
17
27
  }
18
28
  });
@@ -2,8 +2,11 @@
2
2
  import "./DecisionItem.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
+ import { useIntl } from 'react-intl-next';
5
6
  import DecisionIcon from '@atlaskit/icon/core/decision';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
8
  import Item from './Item';
9
+ import { messages } from './i18n';
7
10
  var iconStyles = null;
8
11
  var iconStylesWithPlaceholder = null;
9
12
  var DecisionItem = function DecisionItem(_ref) {
@@ -13,11 +16,13 @@ var DecisionItem = function DecisionItem(_ref) {
13
16
  placeholder = _ref.placeholder,
14
17
  showPlaceholder = _ref.showPlaceholder,
15
18
  dataAttributes = _ref.dataAttributes;
19
+ var _useIntl = useIntl(),
20
+ formatMessage = _useIntl.formatMessage;
16
21
  var icon = /*#__PURE__*/React.createElement("span", {
17
22
  contentEditable: false,
18
23
  className: ax(["_16jlidpf _1o9zidpf _i0dlexct _4t3i7vkz _1bsb7vkz _19pk1b66 _2hwxutpp _otyridpf _18u0idpf _syaz4pcx _1e0c1txw _4cvr1h6o _1bah1h6o", showPlaceholder && "_syazdgkc"])
19
24
  }, /*#__PURE__*/React.createElement(DecisionIcon, {
20
- label: "Decision",
25
+ label: expValEquals('editor_a11y_decision_aria_label', 'isEnabled', true) ? showPlaceholder && children === undefined ? formatMessage(messages.undefinedDecisionAriaLabel) : formatMessage(messages.decisionAriaLabel) : 'Decision',
21
26
  spacing: "spacious",
22
27
  color: "currentColor"
23
28
  }));
@@ -14,5 +14,15 @@ export var messages = defineMessages({
14
14
  id: 'platform.taskDecision.markTaskAsNotCompleted',
15
15
  defaultMessage: 'Mark task as not completed',
16
16
  description: 'Button to mark a task as not complete in the editor'
17
+ },
18
+ decisionAriaLabel: {
19
+ id: 'platform.taskDecision.decisionAriaLabel',
20
+ defaultMessage: 'Decision',
21
+ description: 'Descriptive text for a decision element'
22
+ },
23
+ undefinedDecisionAriaLabel: {
24
+ id: 'platform.taskDecision.undefinedDecisionAriaLabel',
25
+ defaultMessage: 'Undefined decision',
26
+ description: 'Descriptive text for an undefined decision element'
17
27
  }
18
28
  });
@@ -14,4 +14,14 @@ export declare const messages: {
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
+ decisionAriaLabel: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ undefinedDecisionAriaLabel: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
17
27
  };
@@ -14,4 +14,14 @@ export declare const messages: {
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
+ decisionAriaLabel: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ undefinedDecisionAriaLabel: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
17
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/task-decision",
3
- "version": "19.2.24",
3
+ "version": "19.3.1",
4
4
  "description": "Tasks and decisions react components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,10 +39,11 @@
39
39
  "@atlaskit/analytics-next": "^11.1.0",
40
40
  "@atlaskit/icon": "^32.0.0",
41
41
  "@atlaskit/platform-feature-flags": "^1.1.0",
42
+ "@atlaskit/tmp-editor-statsig": "^33.0.0",
42
43
  "@atlaskit/tokens": "^11.0.0",
43
44
  "@atlaskit/util-service-support": "^6.3.0",
44
45
  "@babel/runtime": "^7.0.0",
45
- "@compiled/react": "^0.18.6",
46
+ "@compiled/react": "^0.20.0",
46
47
  "react-intl-next": "npm:react-intl@^5.18.1",
47
48
  "use-callback-ref": "^1.2.3",
48
49
  "uuid": "^3.1.0"
@@ -58,7 +59,7 @@
58
59
  "@atlaskit/elements-test-helpers": "workspace:^",
59
60
  "@atlaskit/ssr": "workspace:^",
60
61
  "@atlaskit/util-data-test": "^18.5.0",
61
- "@atlassian/a11y-jest-testing": "^0.10.0",
62
+ "@atlassian/a11y-jest-testing": "^0.11.0",
62
63
  "@testing-library/react": "^16.3.0",
63
64
  "@testing-library/user-event": "^14.4.3",
64
65
  "@types/url-search-params": "^0.10.0",