@atlaskit/task-decision 19.2.3 → 19.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/task-decision
2
2
 
3
+ ## 19.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#170985](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/170985)
8
+ [`0428298a2a0bb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0428298a2a0bb) -
9
+ Remove feature gate for task item ref bug fix
10
+ - Updated dependencies
11
+
3
12
  ## 19.2.3
4
13
 
5
14
  ### Patch Changes
@@ -4,7 +4,7 @@
4
4
  "declaration": true,
5
5
  "target": "es5",
6
6
  "composite": true,
7
- "outDir": "../dist",
7
+ "outDir": "../../../../../confluence/tsDist/@atlaskit__task-decision",
8
8
  "rootDir": "../"
9
9
  },
10
10
  "include": [
@@ -29,9 +29,6 @@
29
29
  {
30
30
  "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
31
31
  },
32
- {
33
- "path": "../../../platform/feature-flags-react/afm-cc/tsconfig.json"
34
- },
35
32
  {
36
33
  "path": "../../../design-system/tokens/afm-cc/tsconfig.json"
37
34
  },
@@ -29,9 +29,6 @@
29
29
  {
30
30
  "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
31
31
  },
32
- {
33
- "path": "../../../platform/feature-flags-react/afm-jira/tsconfig.json"
34
- },
35
32
  {
36
33
  "path": "../../../design-system/tokens/afm-jira/tsconfig.json"
37
34
  },
@@ -29,9 +29,6 @@
29
29
  {
30
30
  "path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
31
31
  },
32
- {
33
- "path": "../../../platform/feature-flags-react/afm-post-office/tsconfig.json"
34
- },
35
32
  {
36
33
  "path": "../../../design-system/tokens/afm-post-office/tsconfig.json"
37
34
  },
@@ -16,7 +16,6 @@ var _checkboxChecked = _interopRequireDefault(require("@atlaskit/icon/core/check
16
16
  var _Item = _interopRequireDefault(require("./Item"));
17
17
  var _analyticsNext = require("@atlaskit/analytics-next");
18
18
  var _analytics = require("../analytics");
19
- var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
20
19
  var _useCallbackRef = require("use-callback-ref");
21
20
  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); }
22
21
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
@@ -38,7 +37,7 @@ var taskCount = 0;
38
37
  var getCheckBoxId = function getCheckBoxId(localId) {
39
38
  return "".concat(localId, "-").concat(taskCount++);
40
39
  };
41
- var TaskItemWithoutRefFix = function TaskItemWithoutRefFix(props) {
40
+ var TaskItem = function TaskItem(props) {
42
41
  var appearance = props.appearance,
43
42
  isDone = props.isDone,
44
43
  isFocused = props.isFocused,
@@ -51,8 +50,8 @@ var TaskItemWithoutRefFix = function TaskItemWithoutRefFix(props) {
51
50
  taskId = props.taskId,
52
51
  onChange = props.onChange,
53
52
  onClick = props.onClick,
54
- createAnalyticsEvent = props.createAnalyticsEvent;
55
- var inputRefFromProps = props.inputRef;
53
+ createAnalyticsEvent = props.createAnalyticsEvent,
54
+ inputRefFromProps = props.inputRef;
56
55
  var checkBoxId = (0, _react.useMemo)(function () {
57
56
  return getCheckBoxId(taskId);
58
57
  }, [taskId]);
@@ -82,8 +81,8 @@ var TaskItemWithoutRefFix = function TaskItemWithoutRefFix(props) {
82
81
  }
83
82
  };
84
83
  }, [handleOnChange]);
85
- var defaultInputRef = (0, _react.useRef)(null);
86
- var inputRef = inputRefFromProps !== null && inputRefFromProps !== void 0 ? inputRefFromProps : defaultInputRef;
84
+ var localInputRef = (0, _react.useRef)(null);
85
+ var inputRef = (0, _useCallbackRef.useMergeRefs)(inputRefFromProps === undefined ? [localInputRef] : [inputRefFromProps, localInputRef]);
87
86
  var icon = /*#__PURE__*/_react.default.createElement("span", {
88
87
  contentEditable: false,
89
88
  className: (0, _runtime.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"]),
@@ -129,98 +128,4 @@ var TaskItemWithoutRefFix = function TaskItemWithoutRefFix(props) {
129
128
  checkBoxId: checkBoxId
130
129
  }, children);
131
130
  };
132
- var TaskItemWithRefFix = function TaskItemWithRefFix(props) {
133
- var appearance = props.appearance,
134
- isDone = props.isDone,
135
- isFocused = props.isFocused,
136
- contentRef = props.contentRef,
137
- children = props.children,
138
- placeholder = props.placeholder,
139
- showPlaceholder = props.showPlaceholder,
140
- disabled = props.disabled,
141
- dataAttributes = props.dataAttributes,
142
- taskId = props.taskId,
143
- onChange = props.onChange,
144
- onClick = props.onClick,
145
- createAnalyticsEvent = props.createAnalyticsEvent,
146
- inputRefFromProps = props.inputRef;
147
- var checkBoxId = (0, _react.useMemo)(function () {
148
- return getCheckBoxId(taskId);
149
- }, [taskId]);
150
- var handleOnChange = (0, _react.useMemo)(function () {
151
- return function (_evt) {
152
- var newIsDone = !isDone;
153
- if (onChange) {
154
- onChange(taskId, newIsDone);
155
- }
156
- var action = newIsDone ? 'checked' : 'unchecked';
157
- if (createAnalyticsEvent) {
158
- (0, _analytics.createAndFireEventInElementsChannel)({
159
- action: action,
160
- actionSubject: 'action',
161
- eventType: 'ui',
162
- attributes: {
163
- localId: taskId
164
- }
165
- })(createAnalyticsEvent);
166
- }
167
- };
168
- }, [onChange, taskId, isDone, createAnalyticsEvent]);
169
- var handleOnKeyPress = (0, _react.useMemo)(function () {
170
- return function (event) {
171
- if (event.key === 'Enter') {
172
- handleOnChange(event);
173
- }
174
- };
175
- }, [handleOnChange]);
176
- var localInputRef = (0, _react.useRef)(null);
177
- var inputRef = (0, _useCallbackRef.useMergeRefs)(inputRefFromProps === undefined ? [localInputRef] : [inputRefFromProps, localInputRef]);
178
- var icon = /*#__PURE__*/_react.default.createElement("span", {
179
- contentEditable: false,
180
- className: (0, _runtime.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"]),
181
- style: {
182
- "--_toyvsf": (0, _runtime.ix)("2px solid ".concat("var(--ds-border-focused, #388BFF)"))
183
- }
184
- }, /*#__PURE__*/_react.default.createElement("input", {
185
- id: checkBoxId,
186
- "aria-labelledby": "".concat(checkBoxId, "-wrapper"),
187
- name: checkBoxId,
188
- type: "checkbox",
189
- onChange: handleOnChange,
190
- onClick: onClick,
191
- checked: !!isDone,
192
- disabled: !!disabled,
193
- suppressHydrationWarning: true,
194
- onKeyPress: handleOnKeyPress,
195
- ref: inputRef
196
- }), isDone ? /*#__PURE__*/_react.default.createElement(_checkboxChecked.default, {
197
- label: ""
198
- }) : /*#__PURE__*/_react.default.createElement(CheckboxUncheckedIcon, {
199
- label: ""
200
- }));
201
- _react.default.useEffect(function () {
202
- if (isFocused && inputRef.current) {
203
- var _inputRef$current4, _inputRef$current5;
204
- (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 || _inputRef$current4.focus();
205
- (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 || _inputRef$current5.blur();
206
- setTimeout(function () {
207
- var _inputRef$current6;
208
- (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 || _inputRef$current6.focus();
209
- }, 100);
210
- }
211
- }, [isFocused, inputRef]);
212
- return /*#__PURE__*/_react.default.createElement(_Item.default, {
213
- appearance: appearance,
214
- contentRef: contentRef,
215
- icon: icon,
216
- placeholder: placeholder,
217
- showPlaceholder: showPlaceholder,
218
- itemType: "TASK",
219
- dataAttributes: dataAttributes,
220
- checkBoxId: checkBoxId
221
- }, children);
222
- };
223
-
224
- // This is to ensure that the "type" is exported, as it gets lost and not exported along with TaskItem after
225
- // going through the high order component.
226
- var _default = exports.default = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_task_item_ref_fix', (0, _analyticsNext.withAnalyticsEvents)()(TaskItemWithRefFix), (0, _analyticsNext.withAnalyticsEvents)()(TaskItemWithoutRefFix));
131
+ var _default = exports.default = (0, _analyticsNext.withAnalyticsEvents)()(TaskItem);
@@ -11,7 +11,6 @@ import CheckboxCheckedIcon from '@atlaskit/icon/core/checkbox-checked';
11
11
  import Item from './Item';
12
12
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
13
13
  import { createAndFireEventInElementsChannel } from '../analytics';
14
- import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
15
14
  import { useMergeRefs } from 'use-callback-ref';
16
15
  const CheckboxUncheckedIcon = props => /*#__PURE__*/React.createElement(Icon, _extends({
17
16
  dangerouslySetGlyph: `<rect width="12.5" height="12.5" x="1.75" y="1.75" stroke="currentcolor" stroke-width="1.5" rx="1.25"/>`,
@@ -26,7 +25,7 @@ const CheckboxUncheckedIcon = props => /*#__PURE__*/React.createElement(Icon, _e
26
25
  const checkboxStyles = null;
27
26
  let taskCount = 0;
28
27
  const getCheckBoxId = localId => `${localId}-${taskCount++}`;
29
- const TaskItemWithoutRefFix = props => {
28
+ const TaskItem = props => {
30
29
  const {
31
30
  appearance,
32
31
  isDone,
@@ -40,9 +39,9 @@ const TaskItemWithoutRefFix = props => {
40
39
  taskId,
41
40
  onChange,
42
41
  onClick,
43
- createAnalyticsEvent
42
+ createAnalyticsEvent,
43
+ inputRef: inputRefFromProps
44
44
  } = props;
45
- const inputRefFromProps = props.inputRef;
46
45
  const checkBoxId = useMemo(() => getCheckBoxId(taskId), [taskId]);
47
46
  const handleOnChange = useMemo(() => {
48
47
  return _evt => {
@@ -68,8 +67,8 @@ const TaskItemWithoutRefFix = props => {
68
67
  handleOnChange(event);
69
68
  }
70
69
  }, [handleOnChange]);
71
- const defaultInputRef = useRef(null);
72
- const inputRef = inputRefFromProps !== null && inputRefFromProps !== void 0 ? inputRefFromProps : defaultInputRef;
70
+ const localInputRef = useRef(null);
71
+ const inputRef = useMergeRefs(inputRefFromProps === undefined ? [localInputRef] : [inputRefFromProps, localInputRef]);
73
72
  const icon = /*#__PURE__*/React.createElement("span", {
74
73
  contentEditable: false,
75
74
  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 _den5ugt7 _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"])
@@ -112,94 +111,4 @@ const TaskItemWithoutRefFix = props => {
112
111
  checkBoxId: checkBoxId
113
112
  }, children);
114
113
  };
115
- const TaskItemWithRefFix = props => {
116
- const {
117
- appearance,
118
- isDone,
119
- isFocused,
120
- contentRef,
121
- children,
122
- placeholder,
123
- showPlaceholder,
124
- disabled,
125
- dataAttributes,
126
- taskId,
127
- onChange,
128
- onClick,
129
- createAnalyticsEvent,
130
- inputRef: inputRefFromProps
131
- } = props;
132
- const checkBoxId = useMemo(() => getCheckBoxId(taskId), [taskId]);
133
- const handleOnChange = useMemo(() => {
134
- return _evt => {
135
- const newIsDone = !isDone;
136
- if (onChange) {
137
- onChange(taskId, newIsDone);
138
- }
139
- const action = newIsDone ? 'checked' : 'unchecked';
140
- if (createAnalyticsEvent) {
141
- createAndFireEventInElementsChannel({
142
- action,
143
- actionSubject: 'action',
144
- eventType: 'ui',
145
- attributes: {
146
- localId: taskId
147
- }
148
- })(createAnalyticsEvent);
149
- }
150
- };
151
- }, [onChange, taskId, isDone, createAnalyticsEvent]);
152
- const handleOnKeyPress = useMemo(() => event => {
153
- if (event.key === 'Enter') {
154
- handleOnChange(event);
155
- }
156
- }, [handleOnChange]);
157
- const localInputRef = useRef(null);
158
- const inputRef = useMergeRefs(inputRefFromProps === undefined ? [localInputRef] : [inputRefFromProps, localInputRef]);
159
- const icon = /*#__PURE__*/React.createElement("span", {
160
- contentEditable: false,
161
- 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 _den5ugt7 _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"])
162
- }, /*#__PURE__*/React.createElement("input", {
163
- id: checkBoxId,
164
- "aria-labelledby": `${checkBoxId}-wrapper`,
165
- name: checkBoxId,
166
- type: "checkbox",
167
- onChange: handleOnChange,
168
- onClick: onClick,
169
- checked: !!isDone,
170
- disabled: !!disabled,
171
- suppressHydrationWarning: true,
172
- onKeyPress: handleOnKeyPress,
173
- ref: inputRef
174
- }), isDone ? /*#__PURE__*/React.createElement(CheckboxCheckedIcon, {
175
- label: ""
176
- }) : /*#__PURE__*/React.createElement(CheckboxUncheckedIcon, {
177
- label: ""
178
- }));
179
- React.useEffect(() => {
180
- if (isFocused && inputRef.current) {
181
- var _inputRef$current4, _inputRef$current5;
182
- (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.focus();
183
- (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.blur();
184
- setTimeout(() => {
185
- var _inputRef$current6;
186
- (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : _inputRef$current6.focus();
187
- }, 100);
188
- }
189
- }, [isFocused, inputRef]);
190
- return /*#__PURE__*/React.createElement(Item, {
191
- appearance: appearance,
192
- contentRef: contentRef,
193
- icon: icon,
194
- placeholder: placeholder,
195
- showPlaceholder: showPlaceholder,
196
- itemType: "TASK",
197
- dataAttributes: dataAttributes,
198
- checkBoxId: checkBoxId
199
- }, children);
200
- };
201
-
202
- // This is to ensure that the "type" is exported, as it gets lost and not exported along with TaskItem after
203
- // going through the high order component.
204
-
205
- export default componentWithFG('platform_editor_task_item_ref_fix', withAnalyticsEvents()(TaskItemWithRefFix), withAnalyticsEvents()(TaskItemWithoutRefFix));
114
+ export default withAnalyticsEvents()(TaskItem);
@@ -11,7 +11,6 @@ import CheckboxCheckedIcon from '@atlaskit/icon/core/checkbox-checked';
11
11
  import Item from './Item';
12
12
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
13
13
  import { createAndFireEventInElementsChannel } from '../analytics';
14
- import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
15
14
  import { useMergeRefs } from 'use-callback-ref';
16
15
  var CheckboxUncheckedIcon = function CheckboxUncheckedIcon(props) {
17
16
  return /*#__PURE__*/React.createElement(Icon, _extends({
@@ -30,7 +29,7 @@ var taskCount = 0;
30
29
  var getCheckBoxId = function getCheckBoxId(localId) {
31
30
  return "".concat(localId, "-").concat(taskCount++);
32
31
  };
33
- var TaskItemWithoutRefFix = function TaskItemWithoutRefFix(props) {
32
+ var TaskItem = function TaskItem(props) {
34
33
  var appearance = props.appearance,
35
34
  isDone = props.isDone,
36
35
  isFocused = props.isFocused,
@@ -43,8 +42,8 @@ var TaskItemWithoutRefFix = function TaskItemWithoutRefFix(props) {
43
42
  taskId = props.taskId,
44
43
  onChange = props.onChange,
45
44
  onClick = props.onClick,
46
- createAnalyticsEvent = props.createAnalyticsEvent;
47
- var inputRefFromProps = props.inputRef;
45
+ createAnalyticsEvent = props.createAnalyticsEvent,
46
+ inputRefFromProps = props.inputRef;
48
47
  var checkBoxId = useMemo(function () {
49
48
  return getCheckBoxId(taskId);
50
49
  }, [taskId]);
@@ -74,8 +73,8 @@ var TaskItemWithoutRefFix = function TaskItemWithoutRefFix(props) {
74
73
  }
75
74
  };
76
75
  }, [handleOnChange]);
77
- var defaultInputRef = useRef(null);
78
- var inputRef = inputRefFromProps !== null && inputRefFromProps !== void 0 ? inputRefFromProps : defaultInputRef;
76
+ var localInputRef = useRef(null);
77
+ var inputRef = useMergeRefs(inputRefFromProps === undefined ? [localInputRef] : [inputRefFromProps, localInputRef]);
79
78
  var icon = /*#__PURE__*/React.createElement("span", {
80
79
  contentEditable: false,
81
80
  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"]),
@@ -121,99 +120,4 @@ var TaskItemWithoutRefFix = function TaskItemWithoutRefFix(props) {
121
120
  checkBoxId: checkBoxId
122
121
  }, children);
123
122
  };
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, {
205
- appearance: appearance,
206
- contentRef: contentRef,
207
- icon: icon,
208
- placeholder: placeholder,
209
- showPlaceholder: showPlaceholder,
210
- itemType: "TASK",
211
- dataAttributes: dataAttributes,
212
- checkBoxId: checkBoxId
213
- }, children);
214
- };
215
-
216
- // This is to ensure that the "type" is exported, as it gets lost and not exported along with TaskItem after
217
- // going through the high order component.
218
-
219
- export default componentWithFG('platform_editor_task_item_ref_fix', withAnalyticsEvents()(TaskItemWithRefFix), withAnalyticsEvents()(TaskItemWithoutRefFix));
123
+ export default withAnalyticsEvents()(TaskItem);
@@ -23,5 +23,5 @@ export interface Props {
23
23
  };
24
24
  inputRef?: Ref<HTMLInputElement>;
25
25
  }
26
- declare const _default: React.FC<Omit<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>, "ref"> & React.RefAttributes<any>>;
26
+ declare const _default: React.ForwardRefExoticComponent<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
27
27
  export default _default;
@@ -23,5 +23,5 @@ export interface Props {
23
23
  };
24
24
  inputRef?: Ref<HTMLInputElement>;
25
25
  }
26
- declare const _default: React.FC<Omit<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>, "ref"> & React.RefAttributes<any>>;
26
+ declare const _default: React.ForwardRefExoticComponent<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
27
27
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/task-decision",
3
- "version": "19.2.3",
3
+ "version": "19.2.4",
4
4
  "description": "Tasks and decisions react components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,10 +43,9 @@
43
43
  "dependencies": {
44
44
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
45
45
  "@atlaskit/analytics-next": "^11.1.0",
46
- "@atlaskit/icon": "^26.4.0",
46
+ "@atlaskit/icon": "^27.0.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
- "@atlaskit/platform-feature-flags-react": "^0.2.0",
49
- "@atlaskit/tokens": "^5.0.0",
48
+ "@atlaskit/tokens": "^5.2.0",
50
49
  "@atlaskit/util-service-support": "^6.3.0",
51
50
  "@babel/runtime": "^7.0.0",
52
51
  "@compiled/react": "^0.18.3",