@atlaskit/task-decision 19.1.2 → 19.1.4

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/afm-cc/tsconfig.json +0 -6
  3. package/afm-jira/tsconfig.json +0 -9
  4. package/afm-post-office/tsconfig.json +0 -9
  5. package/dist/cjs/components/DecisionItem.js +13 -27
  6. package/dist/cjs/components/DecisionList.js +22 -22
  7. package/dist/cjs/components/Item.js +39 -39
  8. package/dist/cjs/components/ResourcedTaskItem.js +0 -23
  9. package/dist/cjs/components/TaskItem.js +118 -26
  10. package/dist/cjs/components/TaskList.js +24 -26
  11. package/dist/cjs/index.js +25 -12
  12. package/dist/es2019/components/DecisionItem.js +10 -26
  13. package/dist/es2019/components/DecisionList.js +23 -27
  14. package/dist/es2019/components/Item.js +30 -40
  15. package/dist/es2019/components/ResourcedTaskItem.js +2 -25
  16. package/dist/es2019/components/TaskItem.js +110 -22
  17. package/dist/es2019/components/TaskList.js +24 -28
  18. package/dist/es2019/index.js +4 -13
  19. package/dist/esm/components/DecisionItem.js +10 -26
  20. package/dist/esm/components/DecisionList.js +22 -26
  21. package/dist/esm/components/Item.js +34 -40
  22. package/dist/esm/components/ResourcedTaskItem.js +2 -25
  23. package/dist/esm/components/TaskItem.js +118 -22
  24. package/dist/esm/components/TaskList.js +23 -27
  25. package/dist/esm/index.js +4 -13
  26. package/dist/types/components/DecisionItem.d.ts +2 -6
  27. package/dist/types/components/DecisionList.d.ts +1 -2
  28. package/dist/types/components/Item.d.ts +2 -3
  29. package/dist/types/components/ResourcedTaskItem.d.ts +2 -2
  30. package/dist/types/components/TaskItem.d.ts +3 -3
  31. package/dist/types/components/TaskList.d.ts +1 -2
  32. package/dist/types/index.d.ts +4 -5
  33. package/dist/types-ts4.5/components/DecisionItem.d.ts +2 -6
  34. package/dist/types-ts4.5/components/DecisionList.d.ts +1 -2
  35. package/dist/types-ts4.5/components/Item.d.ts +2 -3
  36. package/dist/types-ts4.5/components/ResourcedTaskItem.d.ts +2 -2
  37. package/dist/types-ts4.5/components/TaskItem.d.ts +3 -3
  38. package/dist/types-ts4.5/components/TaskList.d.ts +1 -2
  39. package/dist/types-ts4.5/index.d.ts +4 -5
  40. package/package.json +4 -13
  41. package/dist/cjs/components/compiled/DecisionItem.js +0 -45
  42. package/dist/cjs/components/compiled/DecisionList.js +0 -62
  43. package/dist/cjs/components/compiled/Item.js +0 -101
  44. package/dist/cjs/components/compiled/TaskItem.js +0 -134
  45. package/dist/cjs/components/compiled/TaskList.js +0 -68
  46. package/dist/cjs/components/styles.js +0 -234
  47. package/dist/cjs/components/theme.js +0 -67
  48. package/dist/es2019/components/compiled/DecisionItem.js +0 -36
  49. package/dist/es2019/components/compiled/DecisionList.js +0 -40
  50. package/dist/es2019/components/compiled/Item.js +0 -70
  51. package/dist/es2019/components/compiled/TaskItem.js +0 -117
  52. package/dist/es2019/components/compiled/TaskList.js +0 -46
  53. package/dist/es2019/components/styles.js +0 -221
  54. package/dist/es2019/components/theme.js +0 -61
  55. package/dist/esm/components/compiled/DecisionItem.js +0 -35
  56. package/dist/esm/components/compiled/DecisionList.js +0 -53
  57. package/dist/esm/components/compiled/Item.js +0 -92
  58. package/dist/esm/components/compiled/TaskItem.js +0 -126
  59. package/dist/esm/components/compiled/TaskList.js +0 -60
  60. package/dist/esm/components/styles.js +0 -227
  61. package/dist/esm/components/theme.js +0 -61
  62. package/dist/types/components/compiled/DecisionItem.d.ts +0 -14
  63. package/dist/types/components/compiled/DecisionList.d.ts +0 -11
  64. package/dist/types/components/compiled/Item.d.ts +0 -25
  65. package/dist/types/components/compiled/TaskItem.d.ts +0 -27
  66. package/dist/types/components/compiled/TaskList.d.ts +0 -8
  67. package/dist/types/components/styles.d.ts +0 -12
  68. package/dist/types/components/theme.d.ts +0 -61
  69. package/dist/types-ts4.5/components/compiled/DecisionItem.d.ts +0 -14
  70. package/dist/types-ts4.5/components/compiled/DecisionList.d.ts +0 -11
  71. package/dist/types-ts4.5/components/compiled/Item.d.ts +0 -25
  72. package/dist/types-ts4.5/components/compiled/TaskItem.d.ts +0 -27
  73. package/dist/types-ts4.5/components/compiled/TaskList.d.ts +0 -8
  74. package/dist/types-ts4.5/components/styles.d.ts +0 -12
  75. package/dist/types-ts4.5/components/theme.d.ts +0 -61
  76. /package/dist/cjs/components/{compiled/DecisionItem.compiled.css → DecisionItem.compiled.css} +0 -0
  77. /package/dist/cjs/components/{compiled/DecisionList.compiled.css → DecisionList.compiled.css} +0 -0
  78. /package/dist/cjs/components/{compiled/Item.compiled.css → Item.compiled.css} +0 -0
  79. /package/dist/cjs/components/{compiled/TaskItem.compiled.css → TaskItem.compiled.css} +0 -0
  80. /package/dist/cjs/components/{compiled/TaskList.compiled.css → TaskList.compiled.css} +0 -0
  81. /package/dist/es2019/components/{compiled/DecisionItem.compiled.css → DecisionItem.compiled.css} +0 -0
  82. /package/dist/es2019/components/{compiled/DecisionList.compiled.css → DecisionList.compiled.css} +0 -0
  83. /package/dist/es2019/components/{compiled/Item.compiled.css → Item.compiled.css} +0 -0
  84. /package/dist/es2019/components/{compiled/TaskItem.compiled.css → TaskItem.compiled.css} +0 -0
  85. /package/dist/es2019/components/{compiled/TaskList.compiled.css → TaskList.compiled.css} +0 -0
  86. /package/dist/esm/components/{compiled/DecisionItem.compiled.css → DecisionItem.compiled.css} +0 -0
  87. /package/dist/esm/components/{compiled/DecisionList.compiled.css → DecisionList.compiled.css} +0 -0
  88. /package/dist/esm/components/{compiled/Item.compiled.css → Item.compiled.css} +0 -0
  89. /package/dist/esm/components/{compiled/TaskItem.compiled.css → TaskItem.compiled.css} +0 -0
  90. /package/dist/esm/components/{compiled/TaskList.compiled.css → TaskList.compiled.css} +0 -0
@@ -1,17 +1,8 @@
1
- import EmotionDecisionItem from './components/DecisionItem';
2
- import CompiledDecisionItem from './components/compiled/DecisionItem';
3
- import EmotionDecisionList from './components/DecisionList';
4
- import CompiledDecisionList from './components/compiled/DecisionList';
1
+ import DecisionItem from './components/DecisionItem';
2
+ import DecisionList from './components/DecisionList';
5
3
  import ResourcedTaskItem from './components/ResourcedTaskItem';
6
4
  import TaskDecisionResource from './api/TaskDecisionResource';
7
- import EmotionTaskItem from './components/TaskItem';
8
- import CompiledTaskItem from './components/compiled/TaskItem';
9
- import EmotionTaskList from './components/TaskList';
10
- import CompiledTaskList from './components/compiled/TaskList';
11
- import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
12
- const DecisionItem = componentWithFG('platform_editor_css_migrate_stage_1', CompiledDecisionItem, EmotionDecisionItem);
13
- const DecisionList = componentWithFG('platform_editor_css_migrate_stage_1', CompiledDecisionList, EmotionDecisionList);
14
- const TaskItem = componentWithFG('platform_editor_css_migrate_stage_1', CompiledTaskItem, EmotionTaskItem);
15
- const TaskList = componentWithFG('platform_editor_css_migrate_stage_1', CompiledTaskList, EmotionTaskList);
5
+ import TaskItem from './components/TaskItem';
6
+ import TaskList from './components/TaskList';
16
7
  export { PubSubSpecialEventType } from './types';
17
8
  export { DecisionItem, DecisionList, ResourcedTaskItem, TaskDecisionResource, TaskItem, TaskList };
@@ -1,25 +1,11 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
-
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { css, jsx } from '@emotion/react';
1
+ /* DecisionItem.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./DecisionItem.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
8
5
  import DecisionIcon from '@atlaskit/icon/core/migration/decision--editor-decision';
9
6
  import Item from './Item';
10
- var iconStyles = function iconStyles(showPlaceholder) {
11
- return css({
12
- flex: '0 0 16px',
13
- height: '16px',
14
- width: '16px',
15
- margin: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-150, 12px)", " 0 0"),
16
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
17
- color: showPlaceholder ? "var(--ds-icon-subtle, #626F86)" : "var(--ds-icon-success, #22A06B)",
18
- display: 'flex',
19
- alignItems: 'center',
20
- justifyContent: 'center'
21
- });
22
- };
7
+ var iconStyles = null;
8
+ var iconStylesWithPlaceholder = null;
23
9
  var DecisionItem = function DecisionItem(_ref) {
24
10
  var appearance = _ref.appearance,
25
11
  children = _ref.children,
@@ -27,18 +13,16 @@ var DecisionItem = function DecisionItem(_ref) {
27
13
  placeholder = _ref.placeholder,
28
14
  showPlaceholder = _ref.showPlaceholder,
29
15
  dataAttributes = _ref.dataAttributes;
30
- var icon =
31
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
32
- jsx("span", {
16
+ var icon = /*#__PURE__*/React.createElement("span", {
33
17
  contentEditable: false,
34
- css: iconStyles(showPlaceholder)
35
- }, jsx(DecisionIcon, {
18
+ className: ax(["_16jlidpf _1o9zidpf _i0dlexct _4t3i7vkz _1bsb7vkz _19pk1b66 _2hwxutpp _otyridpf _18u0idpf _syaz1yjp _1e0c1txw _4cvr1h6o _1bah1h6o", showPlaceholder && "_syaz1oju"])
19
+ }, /*#__PURE__*/React.createElement(DecisionIcon, {
36
20
  label: "Decision",
37
21
  spacing: "spacious",
38
22
  color: "currentColor",
39
23
  LEGACY_size: "large"
40
24
  }));
41
- return jsx(Item, {
25
+ return /*#__PURE__*/React.createElement(Item, {
42
26
  appearance: appearance,
43
27
  contentRef: contentRef,
44
28
  icon: icon,
@@ -1,20 +1,19 @@
1
+ /* DecisionList.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
3
  import _createClass from "@babel/runtime/helpers/createClass";
3
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
6
  import _inherits from "@babel/runtime/helpers/inherits";
7
+ import "./DecisionList.compiled.css";
8
+ import { ax, ix } from "@compiled/react/runtime";
6
9
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
- /**
9
- * @jsxRuntime classic
10
- * @jsx jsx
11
- */
12
-
13
- import React from 'react';
14
- import { PureComponent } from 'react';
15
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
16
- import { jsx } from '@emotion/react';
17
- import { listStyles } from './styles';
11
+ import React, { PureComponent } from 'react';
12
+ /*
13
+ Increasing specificity with double ampersand to ensure these rules take
14
+ priority over the global styles applied to 'ol' elements.
15
+ */
16
+ var listStyles = null;
18
17
  var DecisionList = /*#__PURE__*/function (_PureComponent) {
19
18
  function DecisionList() {
20
19
  _classCallCheck(this, DecisionList);
@@ -35,22 +34,19 @@ var DecisionList = /*#__PURE__*/function (_PureComponent) {
35
34
  // and action items, which all share the common `<li>` element.
36
35
  // The value of `data-decision-local-id` should be discarded upon paste, with a
37
36
  // a new uuid generated by the editor for the cloned content.
38
- return (
39
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
40
- jsx("ol", {
41
- css: listStyles,
42
- "data-decision-list-local-id": "",
43
- "data-node-type": "decisionList"
44
- }, React.Children.map(children, function (child, idx) {
45
- var _ref = child.props,
46
- localId = _ref.localId;
47
- return jsx("li", {
48
- key: idx,
49
- "data-decision-local-id": localId || '',
50
- "data-decision-state": "DECIDED"
51
- }, child);
52
- }))
53
- );
37
+ return /*#__PURE__*/React.createElement("ol", {
38
+ "data-decision-list-local-id": "",
39
+ "data-node-type": "decisionList",
40
+ className: ax(["_1braglyw _1yxxidpf"])
41
+ }, React.Children.map(children, function (child, idx) {
42
+ var _ref = child.props,
43
+ localId = _ref.localId;
44
+ return /*#__PURE__*/React.createElement("li", {
45
+ key: idx,
46
+ "data-decision-local-id": localId || '',
47
+ "data-decision-state": "DECIDED"
48
+ }, child);
49
+ }));
54
50
  }
55
51
  }]);
56
52
  }(PureComponent);
@@ -1,3 +1,4 @@
1
+ /* Item.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
4
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -5,19 +6,17 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
5
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
7
  import _inherits from "@babel/runtime/helpers/inherits";
7
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
+ import "./Item.compiled.css";
10
+ import * as React from 'react';
11
+ import { ax, ix } from "@compiled/react/runtime";
8
12
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
13
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
- /**
11
- * @jsxRuntime classic
12
- * @jsx jsx
13
- */
14
-
15
14
  import { PureComponent } from 'react';
16
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
- import { jsx } from '@emotion/react';
18
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
19
- import { gridSize } from '@atlaskit/theme/constants';
20
- import { contentStyles, taskStyles, decisionStyles, placeholderStyles } from './styles';
15
+ var placeholderStyles = null;
16
+ var placeholderTaskStyles = null;
17
+ var decisionStyles = null;
18
+ var contentStyles = null;
19
+ var taskStyles = null;
21
20
  var Item = /*#__PURE__*/function (_PureComponent) {
22
21
  function Item() {
23
22
  _classCallCheck(this, Item);
@@ -35,17 +34,15 @@ var Item = /*#__PURE__*/function (_PureComponent) {
35
34
  if (!showPlaceholder || !placeholder || children) {
36
35
  return null;
37
36
  }
38
-
39
- // TODO: Migrate away from gridSize
40
- // Recommendation: Replace gridSize with 8
41
- var offset = gridSize() * (itemType === 'TASK' ? 3 : 3.5);
42
- return jsx("span", {
37
+ return /*#__PURE__*/React.createElement("span", {
43
38
  "data-testid": "task-decision-item-placeholder",
44
- "data-component": "placeholder"
45
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
46
- ,
47
- css: placeholderStyles(offset),
48
- contentEditable: false
39
+ "data-component": "placeholder",
40
+ contentEditable: false,
41
+ className: ax(["_18s81hzh _1reo15vq _18m915vq _kqswstnw _syaz131l _lcxvglyw _1bto1l2s _o5721q9c _p12f1dza", itemType === 'TASK' && "_18s815t0"]),
42
+ style: {
43
+ "--_tptct2": ix("0 0 0 calc(".concat("var(--ds-space-100, 8px)", " * 3.5)")),
44
+ "--_1yfnyhr": ix("0 0 0 calc(".concat("var(--ds-space-100, 8px)", " * 3)"))
45
+ }
49
46
  }, placeholder);
50
47
  }
51
48
  }, {
@@ -59,29 +56,26 @@ var Item = /*#__PURE__*/function (_PureComponent) {
59
56
  checkBoxId = _this$props2.checkBoxId,
60
57
  dataAttributes = _this$props2.dataAttributes;
61
58
  if (itemType === 'TASK') {
62
- return (
63
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
64
- jsx("div", {
65
- css: taskStyles,
66
- id: "".concat(checkBoxId, "-wrapper")
67
- }, icon, this.renderPlaceholder(), jsx("div", _extends({
68
- "data-component": "content",
69
- css: contentStyles,
70
- ref: contentRef
71
- }, dataAttributes), children))
72
- );
59
+ return /*#__PURE__*/React.createElement("div", {
60
+ id: "".concat(checkBoxId, "-wrapper"),
61
+ className: ax(["_1e0c1txw _2lx2vrvc _kqswh2mm"])
62
+ }, icon, this.renderPlaceholder(), /*#__PURE__*/React.createElement("div", _extends({
63
+ "data-component": "content",
64
+ ref: contentRef
65
+ }, dataAttributes, {
66
+ className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _16jlkb7n _1o9zkb7n _i0dl1wug _slp31hna _1ul9idpf"])
67
+ }), children));
73
68
  } else if (itemType === 'DECISION') {
74
- return jsx("div", {
75
- "data-testid": "elements-decision-item"
76
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
77
- ,
78
- css: decisionStyles(),
79
- "data-decision-wrapper": "true"
80
- }, icon, this.renderPlaceholder(), jsx("div", _extends({
69
+ return /*#__PURE__*/React.createElement("div", {
70
+ "data-testid": "elements-decision-item",
71
+ "data-decision-wrapper": "true",
72
+ className: ax(["_2rkosqtm _1e0c1txw _2lx2vrvc _19pku2gc _2hwxidpf _otyridpf _18u0idpf _ca0qu2gc _u5f3u2gc _n3tdu2gc _19bvutpp _bfhkm7j4 _kqswh2mm _14hd1wug"])
73
+ }, icon, this.renderPlaceholder(), /*#__PURE__*/React.createElement("div", _extends({
81
74
  "data-component": "content",
82
- css: contentStyles,
83
75
  ref: contentRef
84
- }, dataAttributes), children));
76
+ }, dataAttributes, {
77
+ className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _16jlkb7n _1o9zkb7n _i0dl1wug _slp31hna _1ul9idpf"])
78
+ }), children));
85
79
  }
86
80
  return null;
87
81
  }
@@ -10,10 +10,8 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
10
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
11
  import React from 'react';
12
12
  import { PureComponent } from 'react';
13
- import EmotionTaskItem from './TaskItem';
14
- import CompiledTaskItem from './compiled/TaskItem';
13
+ import TaskItem from './TaskItem';
15
14
  import { FabricElementsAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
16
- import { fg } from '@atlaskit/platform-feature-flags';
17
15
  var ResourcedTaskItem = /*#__PURE__*/function (_PureComponent) {
18
16
  function ResourcedTaskItem(props) {
19
17
  var _this;
@@ -161,32 +159,11 @@ var ResourcedTaskItem = /*#__PURE__*/function (_PureComponent) {
161
159
  isRenderer = _this$props3.isRenderer,
162
160
  isFocused = _this$props3.isFocused,
163
161
  inputRef = _this$props3.inputRef;
164
- if (fg('platform_editor_css_migrate_stage_1')) {
165
- return /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext, {
166
- data: {
167
- objectAri: objectAri
168
- }
169
- }, /*#__PURE__*/React.createElement(CompiledTaskItem, {
170
- isDone: isDone,
171
- isRenderer: isRenderer,
172
- isFocused: isFocused,
173
- taskId: taskId,
174
- onChange: this.handleOnChange,
175
- onClick: this.handleOnClick,
176
- appearance: appearance,
177
- contentRef: contentRef,
178
- showPlaceholder: showPlaceholder,
179
- placeholder: placeholder,
180
- disabled: disabled,
181
- dataAttributes: dataAttributes,
182
- inputRef: inputRef
183
- }, children));
184
- }
185
162
  return /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext, {
186
163
  data: {
187
164
  objectAri: objectAri
188
165
  }
189
- }, /*#__PURE__*/React.createElement(EmotionTaskItem, {
166
+ }, /*#__PURE__*/React.createElement(TaskItem, {
190
167
  isDone: isDone,
191
168
  isRenderer: isRenderer,
192
169
  isFocused: isFocused,
@@ -1,11 +1,8 @@
1
+ /* TaskItem.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
3
+ import "./TaskItem.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
6
5
  import React, { useMemo, useRef } from 'react';
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { jsx } from '@emotion/react';
9
6
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
10
7
  import { Icon } from '@atlaskit/icon/base-new';
11
8
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
@@ -14,22 +11,29 @@ import CheckboxCheckedIcon from '@atlaskit/icon/core/checkbox-checked';
14
11
  import Item from './Item';
15
12
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
16
13
  import { createAndFireEventInElementsChannel } from '../analytics';
17
- import { checkboxStyles } from './styles';
14
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
15
+ import { useMergeRefs } from 'use-callback-ref';
18
16
  var CheckboxUncheckedIcon = function CheckboxUncheckedIcon(props) {
19
- return jsx(Icon, _extends({
17
+ return /*#__PURE__*/React.createElement(Icon, _extends({
20
18
  dangerouslySetGlyph: "<rect width=\"12.5\" height=\"12.5\" x=\"1.75\" y=\"1.75\" stroke=\"currentcolor\" stroke-width=\"1.5\" rx=\"1.25\"/>",
21
19
  type: 'core'
22
20
  }, props));
23
21
  };
22
+
23
+ /**
24
+ * References packages/design-system/checkbox/src/checkbox.tsx
25
+ * To be used until mobile editor does not require legacy themed() API anymore,
26
+ * which will allow migration to use @atlaskit/checkbox instead
27
+ */
28
+ var checkboxStyles = null;
24
29
  var taskCount = 0;
25
30
  var getCheckBoxId = function getCheckBoxId(localId) {
26
31
  return "".concat(localId, "-").concat(taskCount++);
27
32
  };
28
- var TaskItem = function TaskItem(props) {
33
+ var TaskItemWithoutRefFix = function TaskItemWithoutRefFix(props) {
29
34
  var appearance = props.appearance,
30
35
  isDone = props.isDone,
31
36
  isFocused = props.isFocused,
32
- isRenderer = props.isRenderer,
33
37
  contentRef = props.contentRef,
34
38
  children = props.children,
35
39
  placeholder = props.placeholder,
@@ -39,8 +43,8 @@ var TaskItem = function TaskItem(props) {
39
43
  taskId = props.taskId,
40
44
  onChange = props.onChange,
41
45
  onClick = props.onClick,
42
- createAnalyticsEvent = props.createAnalyticsEvent,
43
- inputRefFromProps = props.inputRef;
46
+ createAnalyticsEvent = props.createAnalyticsEvent;
47
+ var inputRefFromProps = props.inputRef;
44
48
  var checkBoxId = useMemo(function () {
45
49
  return getCheckBoxId(taskId);
46
50
  }, [taskId]);
@@ -72,12 +76,13 @@ var TaskItem = function TaskItem(props) {
72
76
  }, [handleOnChange]);
73
77
  var defaultInputRef = useRef(null);
74
78
  var inputRef = inputRefFromProps !== null && inputRefFromProps !== void 0 ? inputRefFromProps : defaultInputRef;
75
- var icon =
76
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
77
- jsx("span", {
78
- css: checkboxStyles(isRenderer),
79
- contentEditable: false
80
- }, jsx("input", {
79
+ var icon = /*#__PURE__*/React.createElement("span", {
80
+ contentEditable: false,
81
+ className: ax(["_16jlidpf _1o9zidpf _i0dl1tcg _1bsb1tcg _4t3i1tcg _kqswh2mm _1wpzv2br _1snx1r31 _1746glyw _dx3f1o36 _1h5xidpf _sqizidpf _fs2cidpf _1smcidpf _oezm15vq _1l0615vq _1abj1mn3 _18a711so _16np1elr _a27kkb7n _q3p7usvi _qhqx1nu9 _10cr1ssb _zfav1ssb _m7eu1ooe _l9o0n7od _1efjn7od _1u2istnw _32ro1j9a _1wn015vq _den512j9 _zh8l1b66 _g5w3stnw _whhepxbi _1stbpxbi _18tob3bt _1awt1ule _haf81ssb _ra781ssb _cr751ooe _1q8r7vkz _9l2s7vkz _1mh7kb7n _s3uktlke _1davidpf _8bo8stnw _psnc1ssb _4k421ssb _1rvv1ooe _13vl73ad _1t711tcg _1nuz1tcg _cs4qstnw _9j2j1ssb _1mwj1ssb _19l51ooe _12yy1d5g _1miy1elr _1umo18hz _tpz25w2r _k6dg18hz _1qduewfl _q8ft1fvw _1y9t5w2r _ut031fvw _gi9hr01l _1qp6muej _wxkgr01l _wo245w2r _c8dpmuej _d2dcsyzs _1eulsyzs _1bc7syzs _16fmsyzs _bhkusyzs _czfesyzs _1gxgsyzs _19w0syzs _1x1y1lg7"]),
82
+ style: {
83
+ "--_toyvsf": ix("2px solid ".concat("var(--ds-border-focused, #388BFF)"))
84
+ }
85
+ }, /*#__PURE__*/React.createElement("input", {
81
86
  id: checkBoxId,
82
87
  "aria-labelledby": "".concat(checkBoxId, "-wrapper"),
83
88
  name: checkBoxId,
@@ -89,9 +94,9 @@ var TaskItem = function TaskItem(props) {
89
94
  suppressHydrationWarning: true,
90
95
  onKeyPress: handleOnKeyPress,
91
96
  ref: inputRef
92
- }), isDone ? jsx(CheckboxCheckedIcon, {
97
+ }), isDone ? /*#__PURE__*/React.createElement(CheckboxCheckedIcon, {
93
98
  label: ""
94
- }) : jsx(CheckboxUncheckedIcon, {
99
+ }) : /*#__PURE__*/React.createElement(CheckboxUncheckedIcon, {
95
100
  label: ""
96
101
  }));
97
102
  React.useEffect(function () {
@@ -105,7 +110,98 @@ var TaskItem = function TaskItem(props) {
105
110
  }, 100);
106
111
  }
107
112
  }, [isFocused, inputRef]);
108
- return jsx(Item, {
113
+ return /*#__PURE__*/React.createElement(Item, {
114
+ appearance: appearance,
115
+ contentRef: contentRef,
116
+ icon: icon,
117
+ placeholder: placeholder,
118
+ showPlaceholder: showPlaceholder,
119
+ itemType: "TASK",
120
+ dataAttributes: dataAttributes,
121
+ checkBoxId: checkBoxId
122
+ }, children);
123
+ };
124
+ var TaskItemWithRefFix = function TaskItemWithRefFix(props) {
125
+ var appearance = props.appearance,
126
+ isDone = props.isDone,
127
+ isFocused = props.isFocused,
128
+ contentRef = props.contentRef,
129
+ children = props.children,
130
+ placeholder = props.placeholder,
131
+ showPlaceholder = props.showPlaceholder,
132
+ disabled = props.disabled,
133
+ dataAttributes = props.dataAttributes,
134
+ taskId = props.taskId,
135
+ onChange = props.onChange,
136
+ onClick = props.onClick,
137
+ createAnalyticsEvent = props.createAnalyticsEvent,
138
+ inputRefFromProps = props.inputRef;
139
+ var checkBoxId = useMemo(function () {
140
+ return getCheckBoxId(taskId);
141
+ }, [taskId]);
142
+ var handleOnChange = useMemo(function () {
143
+ return function (_evt) {
144
+ var newIsDone = !isDone;
145
+ if (onChange) {
146
+ onChange(taskId, newIsDone);
147
+ }
148
+ var action = newIsDone ? 'checked' : 'unchecked';
149
+ if (createAnalyticsEvent) {
150
+ createAndFireEventInElementsChannel({
151
+ action: action,
152
+ actionSubject: 'action',
153
+ eventType: 'ui',
154
+ attributes: {
155
+ localId: taskId
156
+ }
157
+ })(createAnalyticsEvent);
158
+ }
159
+ };
160
+ }, [onChange, taskId, isDone, createAnalyticsEvent]);
161
+ var handleOnKeyPress = useMemo(function () {
162
+ return function (event) {
163
+ if (event.key === 'Enter') {
164
+ handleOnChange(event);
165
+ }
166
+ };
167
+ }, [handleOnChange]);
168
+ var localInputRef = useRef(null);
169
+ var inputRef = useMergeRefs(inputRefFromProps === undefined ? [localInputRef] : [inputRefFromProps, localInputRef]);
170
+ var icon = /*#__PURE__*/React.createElement("span", {
171
+ contentEditable: false,
172
+ className: ax(["_16jlidpf _1o9zidpf _i0dl1tcg _1bsb1tcg _4t3i1tcg _kqswh2mm _1wpzv2br _1snx1r31 _1746glyw _dx3f1o36 _1h5xidpf _sqizidpf _fs2cidpf _1smcidpf _oezm15vq _1l0615vq _1abj1mn3 _18a711so _16np1elr _a27kkb7n _q3p7usvi _qhqx1nu9 _10cr1ssb _zfav1ssb _m7eu1ooe _l9o0n7od _1efjn7od _1u2istnw _32ro1j9a _1wn015vq _den512j9 _zh8l1b66 _g5w3stnw _whhepxbi _1stbpxbi _18tob3bt _1awt1ule _haf81ssb _ra781ssb _cr751ooe _1q8r7vkz _9l2s7vkz _1mh7kb7n _s3uktlke _1davidpf _8bo8stnw _psnc1ssb _4k421ssb _1rvv1ooe _13vl73ad _1t711tcg _1nuz1tcg _cs4qstnw _9j2j1ssb _1mwj1ssb _19l51ooe _12yy1d5g _1miy1elr _1umo18hz _tpz25w2r _k6dg18hz _1qduewfl _q8ft1fvw _1y9t5w2r _ut031fvw _gi9hr01l _1qp6muej _wxkgr01l _wo245w2r _c8dpmuej _d2dcsyzs _1eulsyzs _1bc7syzs _16fmsyzs _bhkusyzs _czfesyzs _1gxgsyzs _19w0syzs _1x1y1lg7"]),
173
+ style: {
174
+ "--_toyvsf": ix("2px solid ".concat("var(--ds-border-focused, #388BFF)"))
175
+ }
176
+ }, /*#__PURE__*/React.createElement("input", {
177
+ id: checkBoxId,
178
+ "aria-labelledby": "".concat(checkBoxId, "-wrapper"),
179
+ name: checkBoxId,
180
+ type: "checkbox",
181
+ onChange: handleOnChange,
182
+ onClick: onClick,
183
+ checked: !!isDone,
184
+ disabled: !!disabled,
185
+ suppressHydrationWarning: true,
186
+ onKeyPress: handleOnKeyPress,
187
+ ref: inputRef
188
+ }), isDone ? /*#__PURE__*/React.createElement(CheckboxCheckedIcon, {
189
+ label: ""
190
+ }) : /*#__PURE__*/React.createElement(CheckboxUncheckedIcon, {
191
+ label: ""
192
+ }));
193
+ React.useEffect(function () {
194
+ if (isFocused && inputRef.current) {
195
+ var _inputRef$current4, _inputRef$current5;
196
+ (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 || _inputRef$current4.focus();
197
+ (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 || _inputRef$current5.blur();
198
+ setTimeout(function () {
199
+ var _inputRef$current6;
200
+ (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 || _inputRef$current6.focus();
201
+ }, 100);
202
+ }
203
+ }, [isFocused, inputRef]);
204
+ return /*#__PURE__*/React.createElement(Item, {
109
205
  appearance: appearance,
110
206
  contentRef: contentRef,
111
207
  icon: icon,
@@ -120,4 +216,4 @@ var TaskItem = function TaskItem(props) {
120
216
  // This is to ensure that the "type" is exported, as it gets lost and not exported along with TaskItem after
121
217
  // going through the high order component.
122
218
 
123
- export default withAnalyticsEvents()(TaskItem);
219
+ export default componentWithFG('platform_editor_task_item_ref_fix', withAnalyticsEvents()(TaskItemWithRefFix), withAnalyticsEvents()(TaskItemWithoutRefFix));
@@ -1,20 +1,18 @@
1
+ /* TaskList.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
3
  import _createClass from "@babel/runtime/helpers/createClass";
3
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
6
  import _inherits from "@babel/runtime/helpers/inherits";
7
+ import "./TaskList.compiled.css";
8
+ import { ax, ix } from "@compiled/react/runtime";
6
9
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
- /**
9
- * @jsxRuntime classic
10
- * @jsx jsx
11
- */
12
11
  import React from 'react';
13
12
  import { PureComponent } from 'react';
14
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
- import { jsx } from '@emotion/react';
16
13
  import { FabricElementsAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
17
- import { listStyles, taskListStyles } from './styles';
14
+ var listStyles = null;
15
+ var taskListStyles = null;
18
16
  var TaskList = /*#__PURE__*/function (_PureComponent) {
19
17
  function TaskList() {
20
18
  _classCallCheck(this, TaskList);
@@ -38,26 +36,24 @@ var TaskList = /*#__PURE__*/function (_PureComponent) {
38
36
  // and action items, which all share the common `<li>` element.
39
37
  // The value of `data-task-local-id` should be discarded upon paste, with a
40
38
  // a new uuid generated by the editor for the cloned content.
41
- return (
42
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
43
- jsx("div", {
44
- css: [listStyles, taskListStyles],
45
- "data-task-list-local-id": ""
46
- }, React.Children.map(children, function (child, idx) {
47
- var _ref = child.props,
48
- localId = _ref.localId;
49
- return jsx(FabricElementsAnalyticsContext, {
50
- data: {
51
- listLocalId: listId,
52
- listSize: listSize,
53
- position: idx
54
- }
55
- }, jsx("div", {
56
- key: idx,
57
- "data-task-local-id": localId || ''
58
- }, child));
59
- }))
60
- );
39
+ return /*#__PURE__*/React.createElement("div", {
40
+ "data-task-list-local-id": "",
41
+ className: ax(["_2mzuglyw _19bvidpf"])
42
+ }, React.Children.map(children, function (child, idx) {
43
+ var _ref = child.props,
44
+ localId = _ref.localId;
45
+ return /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext, {
46
+ data: {
47
+ listLocalId: listId,
48
+ listSize: listSize,
49
+ position: idx
50
+ }
51
+ }, /*#__PURE__*/React.createElement("div", {
52
+ key: idx,
53
+ "data-task-local-id": localId || '',
54
+ className: ax(["_19pk1b66"])
55
+ }, child));
56
+ }));
61
57
  }
62
58
  }]);
63
59
  }(PureComponent);
package/dist/esm/index.js CHANGED
@@ -1,17 +1,8 @@
1
- import EmotionDecisionItem from './components/DecisionItem';
2
- import CompiledDecisionItem from './components/compiled/DecisionItem';
3
- import EmotionDecisionList from './components/DecisionList';
4
- import CompiledDecisionList from './components/compiled/DecisionList';
1
+ import DecisionItem from './components/DecisionItem';
2
+ import DecisionList from './components/DecisionList';
5
3
  import ResourcedTaskItem from './components/ResourcedTaskItem';
6
4
  import TaskDecisionResource from './api/TaskDecisionResource';
7
- import EmotionTaskItem from './components/TaskItem';
8
- import CompiledTaskItem from './components/compiled/TaskItem';
9
- import EmotionTaskList from './components/TaskList';
10
- import CompiledTaskList from './components/compiled/TaskList';
11
- import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
12
- var DecisionItem = componentWithFG('platform_editor_css_migrate_stage_1', CompiledDecisionItem, EmotionDecisionItem);
13
- var DecisionList = componentWithFG('platform_editor_css_migrate_stage_1', CompiledDecisionList, EmotionDecisionList);
14
- var TaskItem = componentWithFG('platform_editor_css_migrate_stage_1', CompiledTaskItem, EmotionTaskItem);
15
- var TaskList = componentWithFG('platform_editor_css_migrate_stage_1', CompiledTaskList, EmotionTaskList);
5
+ import TaskItem from './components/TaskItem';
6
+ import TaskList from './components/TaskList';
16
7
  export { PubSubSpecialEventType } from './types';
17
8
  export { DecisionItem, DecisionList, ResourcedTaskItem, TaskDecisionResource, TaskItem, TaskList };
@@ -1,8 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { jsx } from '@emotion/react';
1
+ /// <reference types="react" />
6
2
  import { type Appearance, type ContentRef } from '../types';
7
3
  export interface Props {
8
4
  children?: any;
@@ -14,5 +10,5 @@ export interface Props {
14
10
  [key: string]: string | number;
15
11
  };
16
12
  }
17
- declare const DecisionItem: ({ appearance, children, contentRef, placeholder, showPlaceholder, dataAttributes, }: Props) => jsx.JSX.Element;
13
+ declare const DecisionItem: ({ appearance, children, contentRef, placeholder, showPlaceholder, dataAttributes, }: Props) => JSX.Element;
18
14
  export default DecisionItem;
@@ -3,10 +3,9 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { PureComponent, type ReactNode } from 'react';
6
- import { jsx } from '@emotion/react';
7
6
  export interface Props {
8
7
  children?: ReactNode;
9
8
  }
10
9
  export default class DecisionList extends PureComponent<Props, {}> {
11
- render(): jsx.JSX.Element | null;
10
+ render(): JSX.Element | null;
12
11
  }
@@ -3,7 +3,6 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { PureComponent } from 'react';
6
- import { jsx } from '@emotion/react';
7
6
  import { type Appearance, type ContentRef, type TaskType, type DecisionType } from '../types';
8
7
  export interface Props {
9
8
  icon: JSX.Element;
@@ -21,6 +20,6 @@ export interface Props {
21
20
  export default class Item extends PureComponent<Props, {}> {
22
21
  static defaultProps: Partial<Props>;
23
22
  private renderPlaceholder;
24
- renderMessageAppearance(): jsx.JSX.Element | null;
25
- render(): jsx.JSX.Element | null;
23
+ renderMessageAppearance(): JSX.Element | null;
24
+ render(): JSX.Element | null;
26
25
  }