@atlaskit/task-decision 19.1.2 → 19.1.3

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 (86) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/afm-cc/tsconfig.json +0 -9
  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 +21 -22
  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 +18 -18
  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 +21 -18
  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/TaskList.d.ts +1 -2
  30. package/dist/types/index.d.ts +4 -5
  31. package/dist/types-ts4.5/components/DecisionItem.d.ts +2 -6
  32. package/dist/types-ts4.5/components/DecisionList.d.ts +1 -2
  33. package/dist/types-ts4.5/components/Item.d.ts +2 -3
  34. package/dist/types-ts4.5/components/TaskList.d.ts +1 -2
  35. package/dist/types-ts4.5/index.d.ts +4 -5
  36. package/package.json +2 -13
  37. package/dist/cjs/components/compiled/DecisionItem.js +0 -45
  38. package/dist/cjs/components/compiled/DecisionList.js +0 -62
  39. package/dist/cjs/components/compiled/Item.js +0 -101
  40. package/dist/cjs/components/compiled/TaskItem.js +0 -134
  41. package/dist/cjs/components/compiled/TaskList.js +0 -68
  42. package/dist/cjs/components/styles.js +0 -234
  43. package/dist/cjs/components/theme.js +0 -67
  44. package/dist/es2019/components/compiled/DecisionItem.js +0 -36
  45. package/dist/es2019/components/compiled/DecisionList.js +0 -40
  46. package/dist/es2019/components/compiled/Item.js +0 -70
  47. package/dist/es2019/components/compiled/TaskItem.js +0 -117
  48. package/dist/es2019/components/compiled/TaskList.js +0 -46
  49. package/dist/es2019/components/styles.js +0 -221
  50. package/dist/es2019/components/theme.js +0 -61
  51. package/dist/esm/components/compiled/DecisionItem.js +0 -35
  52. package/dist/esm/components/compiled/DecisionList.js +0 -53
  53. package/dist/esm/components/compiled/Item.js +0 -92
  54. package/dist/esm/components/compiled/TaskItem.js +0 -126
  55. package/dist/esm/components/compiled/TaskList.js +0 -60
  56. package/dist/esm/components/styles.js +0 -227
  57. package/dist/esm/components/theme.js +0 -61
  58. package/dist/types/components/compiled/DecisionItem.d.ts +0 -14
  59. package/dist/types/components/compiled/DecisionList.d.ts +0 -11
  60. package/dist/types/components/compiled/Item.d.ts +0 -25
  61. package/dist/types/components/compiled/TaskItem.d.ts +0 -27
  62. package/dist/types/components/compiled/TaskList.d.ts +0 -8
  63. package/dist/types/components/styles.d.ts +0 -12
  64. package/dist/types/components/theme.d.ts +0 -61
  65. package/dist/types-ts4.5/components/compiled/DecisionItem.d.ts +0 -14
  66. package/dist/types-ts4.5/components/compiled/DecisionList.d.ts +0 -11
  67. package/dist/types-ts4.5/components/compiled/Item.d.ts +0 -25
  68. package/dist/types-ts4.5/components/compiled/TaskItem.d.ts +0 -27
  69. package/dist/types-ts4.5/components/compiled/TaskList.d.ts +0 -8
  70. package/dist/types-ts4.5/components/styles.d.ts +0 -12
  71. package/dist/types-ts4.5/components/theme.d.ts +0 -61
  72. /package/dist/cjs/components/{compiled/DecisionItem.compiled.css → DecisionItem.compiled.css} +0 -0
  73. /package/dist/cjs/components/{compiled/DecisionList.compiled.css → DecisionList.compiled.css} +0 -0
  74. /package/dist/cjs/components/{compiled/Item.compiled.css → Item.compiled.css} +0 -0
  75. /package/dist/cjs/components/{compiled/TaskItem.compiled.css → TaskItem.compiled.css} +0 -0
  76. /package/dist/cjs/components/{compiled/TaskList.compiled.css → TaskList.compiled.css} +0 -0
  77. /package/dist/es2019/components/{compiled/DecisionItem.compiled.css → DecisionItem.compiled.css} +0 -0
  78. /package/dist/es2019/components/{compiled/DecisionList.compiled.css → DecisionList.compiled.css} +0 -0
  79. /package/dist/es2019/components/{compiled/Item.compiled.css → Item.compiled.css} +0 -0
  80. /package/dist/es2019/components/{compiled/TaskItem.compiled.css → TaskItem.compiled.css} +0 -0
  81. /package/dist/es2019/components/{compiled/TaskList.compiled.css → TaskList.compiled.css} +0 -0
  82. /package/dist/esm/components/{compiled/DecisionItem.compiled.css → DecisionItem.compiled.css} +0 -0
  83. /package/dist/esm/components/{compiled/DecisionList.compiled.css → DecisionList.compiled.css} +0 -0
  84. /package/dist/esm/components/{compiled/Item.compiled.css → Item.compiled.css} +0 -0
  85. /package/dist/esm/components/{compiled/TaskItem.compiled.css → TaskItem.compiled.css} +0 -0
  86. /package/dist/esm/components/{compiled/TaskList.compiled.css → TaskList.compiled.css} +0 -0
@@ -1,35 +0,0 @@
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";
5
- import DecisionIcon from '@atlaskit/icon/core/migration/decision--editor-decision';
6
- import Item from './Item';
7
- var iconStyles = null;
8
- var iconStylesWithPlaceholder = null;
9
- var DecisionItem = function DecisionItem(_ref) {
10
- var appearance = _ref.appearance,
11
- children = _ref.children,
12
- contentRef = _ref.contentRef,
13
- placeholder = _ref.placeholder,
14
- showPlaceholder = _ref.showPlaceholder,
15
- dataAttributes = _ref.dataAttributes;
16
- var icon = /*#__PURE__*/React.createElement("span", {
17
- contentEditable: false,
18
- className: ax(["_16jlidpf _1o9zidpf _i0dlexct _4t3i7vkz _1bsb7vkz _19pk1b66 _2hwxutpp _otyridpf _18u0idpf _syaz1yjp _1e0c1txw _4cvr1h6o _1bah1h6o", showPlaceholder && "_syaz1oju"])
19
- }, /*#__PURE__*/React.createElement(DecisionIcon, {
20
- label: "Decision",
21
- spacing: "spacious",
22
- color: "currentColor",
23
- LEGACY_size: "large"
24
- }));
25
- return /*#__PURE__*/React.createElement(Item, {
26
- appearance: appearance,
27
- contentRef: contentRef,
28
- icon: icon,
29
- placeholder: placeholder,
30
- showPlaceholder: showPlaceholder,
31
- itemType: "DECISION",
32
- dataAttributes: dataAttributes
33
- }, children);
34
- };
35
- export default DecisionItem;
@@ -1,53 +0,0 @@
1
- /* DecisionList.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
- import "./DecisionList.compiled.css";
8
- import { ax, ix } from "@compiled/react/runtime";
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
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
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;
17
- var DecisionList = /*#__PURE__*/function (_PureComponent) {
18
- function DecisionList() {
19
- _classCallCheck(this, DecisionList);
20
- return _callSuper(this, DecisionList, arguments);
21
- }
22
- _inherits(DecisionList, _PureComponent);
23
- return _createClass(DecisionList, [{
24
- key: "render",
25
- value: function render() {
26
- var children = this.props.children;
27
- if (!children) {
28
- return null;
29
- }
30
-
31
- // Data attributes are required for copy and paste from rendered content
32
- // to the editor to preserve the decision.
33
- // This allows the editor to differentiate between numbered and ordered lists,
34
- // and action items, which all share the common `<li>` element.
35
- // The value of `data-decision-local-id` should be discarded upon paste, with a
36
- // a new uuid generated by the editor for the cloned content.
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
- }));
50
- }
51
- }]);
52
- }(PureComponent);
53
- export { DecisionList as default };
@@ -1,92 +0,0 @@
1
- /* Item.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _inherits from "@babel/runtime/helpers/inherits";
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";
12
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
13
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
14
- import { PureComponent } from 'react';
15
- var placeholderStyles = null;
16
- var placeholderTaskStyles = null;
17
- var decisionStyles = null;
18
- var contentStyles = null;
19
- var taskStyles = null;
20
- var Item = /*#__PURE__*/function (_PureComponent) {
21
- function Item() {
22
- _classCallCheck(this, Item);
23
- return _callSuper(this, Item, arguments);
24
- }
25
- _inherits(Item, _PureComponent);
26
- return _createClass(Item, [{
27
- key: "renderPlaceholder",
28
- value: function renderPlaceholder() {
29
- var _this$props = this.props,
30
- children = _this$props.children,
31
- placeholder = _this$props.placeholder,
32
- showPlaceholder = _this$props.showPlaceholder,
33
- itemType = _this$props.itemType;
34
- if (!showPlaceholder || !placeholder || children) {
35
- return null;
36
- }
37
- return /*#__PURE__*/React.createElement("span", {
38
- "data-testid": "task-decision-item-placeholder",
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
- }
46
- }, placeholder);
47
- }
48
- }, {
49
- key: "renderMessageAppearance",
50
- value: function renderMessageAppearance() {
51
- var _this$props2 = this.props,
52
- contentRef = _this$props2.contentRef,
53
- children = _this$props2.children,
54
- icon = _this$props2.icon,
55
- itemType = _this$props2.itemType,
56
- checkBoxId = _this$props2.checkBoxId,
57
- dataAttributes = _this$props2.dataAttributes;
58
- if (itemType === 'TASK') {
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));
68
- } else if (itemType === 'DECISION') {
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({
74
- "data-component": "content",
75
- ref: contentRef
76
- }, dataAttributes, {
77
- className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _16jlkb7n _1o9zkb7n _i0dl1wug _slp31hna _1ul9idpf"])
78
- }), children));
79
- }
80
- return null;
81
- }
82
- }, {
83
- key: "render",
84
- value: function render() {
85
- return this.renderMessageAppearance();
86
- }
87
- }]);
88
- }(PureComponent);
89
- _defineProperty(Item, "defaultProps", {
90
- appearance: 'inline'
91
- });
92
- export { Item as default };
@@ -1,126 +0,0 @@
1
- /* TaskItem.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import "./TaskItem.compiled.css";
4
- import { ax, ix } from "@compiled/react/runtime";
5
- import React, { useMemo, useRef } from 'react';
6
- // eslint-disable-next-line @atlassian/tangerine/import/entry-points
7
- import { Icon } from '@atlaskit/icon/base-new';
8
- // eslint-disable-next-line @atlassian/tangerine/import/entry-points
9
-
10
- import CheckboxCheckedIcon from '@atlaskit/icon/core/checkbox-checked';
11
- import Item from './Item';
12
- import { withAnalyticsEvents } from '@atlaskit/analytics-next';
13
- import { createAndFireEventInElementsChannel } from '../../analytics';
14
- var CheckboxUncheckedIcon = function CheckboxUncheckedIcon(props) {
15
- return /*#__PURE__*/React.createElement(Icon, _extends({
16
- dangerouslySetGlyph: "<rect width=\"12.5\" height=\"12.5\" x=\"1.75\" y=\"1.75\" stroke=\"currentcolor\" stroke-width=\"1.5\" rx=\"1.25\"/>",
17
- type: 'core'
18
- }, props));
19
- };
20
-
21
- /**
22
- * References packages/design-system/checkbox/src/checkbox.tsx
23
- * To be used until mobile editor does not require legacy themed() API anymore,
24
- * which will allow migration to use @atlaskit/checkbox instead
25
- */
26
- var checkboxStyles = null;
27
- var taskCount = 0;
28
- var getCheckBoxId = function getCheckBoxId(localId) {
29
- return "".concat(localId, "-").concat(taskCount++);
30
- };
31
- var TaskItem = function TaskItem(props) {
32
- var appearance = props.appearance,
33
- isDone = props.isDone,
34
- isFocused = props.isFocused,
35
- contentRef = props.contentRef,
36
- children = props.children,
37
- placeholder = props.placeholder,
38
- showPlaceholder = props.showPlaceholder,
39
- disabled = props.disabled,
40
- dataAttributes = props.dataAttributes,
41
- taskId = props.taskId,
42
- onChange = props.onChange,
43
- onClick = props.onClick,
44
- createAnalyticsEvent = props.createAnalyticsEvent,
45
- inputRefFromProps = props.inputRef;
46
- var checkBoxId = useMemo(function () {
47
- return getCheckBoxId(taskId);
48
- }, [taskId]);
49
- var handleOnChange = useMemo(function () {
50
- return function (_evt) {
51
- var newIsDone = !isDone;
52
- if (onChange) {
53
- onChange(taskId, newIsDone);
54
- }
55
- var action = newIsDone ? 'checked' : 'unchecked';
56
- if (createAnalyticsEvent) {
57
- createAndFireEventInElementsChannel({
58
- action: action,
59
- actionSubject: 'action',
60
- eventType: 'ui',
61
- attributes: {
62
- localId: taskId
63
- }
64
- })(createAnalyticsEvent);
65
- }
66
- };
67
- }, [onChange, taskId, isDone, createAnalyticsEvent]);
68
- var handleOnKeyPress = useMemo(function () {
69
- return function (event) {
70
- if (event.key === 'Enter') {
71
- handleOnChange(event);
72
- }
73
- };
74
- }, [handleOnChange]);
75
- var defaultInputRef = useRef(null);
76
- var inputRef = inputRefFromProps !== null && inputRefFromProps !== void 0 ? inputRefFromProps : defaultInputRef;
77
- var icon = /*#__PURE__*/React.createElement("span", {
78
- contentEditable: false,
79
- 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"]),
80
- style: {
81
- "--_toyvsf": ix("2px solid ".concat("var(--ds-border-focused, #388BFF)"))
82
- }
83
- }, /*#__PURE__*/React.createElement("input", {
84
- id: checkBoxId,
85
- "aria-labelledby": "".concat(checkBoxId, "-wrapper"),
86
- name: checkBoxId,
87
- type: "checkbox",
88
- onChange: handleOnChange,
89
- onClick: onClick,
90
- checked: !!isDone,
91
- disabled: !!disabled,
92
- suppressHydrationWarning: true,
93
- onKeyPress: handleOnKeyPress,
94
- ref: inputRef
95
- }), isDone ? /*#__PURE__*/React.createElement(CheckboxCheckedIcon, {
96
- label: ""
97
- }) : /*#__PURE__*/React.createElement(CheckboxUncheckedIcon, {
98
- label: ""
99
- }));
100
- React.useEffect(function () {
101
- if (isFocused && inputRef.current) {
102
- var _inputRef$current, _inputRef$current2;
103
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
104
- (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.blur();
105
- setTimeout(function () {
106
- var _inputRef$current3;
107
- (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 || _inputRef$current3.focus();
108
- }, 100);
109
- }
110
- }, [isFocused, inputRef]);
111
- return /*#__PURE__*/React.createElement(Item, {
112
- appearance: appearance,
113
- contentRef: contentRef,
114
- icon: icon,
115
- placeholder: placeholder,
116
- showPlaceholder: showPlaceholder,
117
- itemType: "TASK",
118
- dataAttributes: dataAttributes,
119
- checkBoxId: checkBoxId
120
- }, children);
121
- };
122
-
123
- // This is to ensure that the "type" is exported, as it gets lost and not exported along with TaskItem after
124
- // going through the high order component.
125
-
126
- export default withAnalyticsEvents()(TaskItem);
@@ -1,60 +0,0 @@
1
- /* TaskList.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
- import "./TaskList.compiled.css";
8
- import { ax, ix } from "@compiled/react/runtime";
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
- 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';
13
- import { FabricElementsAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
14
- var listStyles = null;
15
- var taskListStyles = null;
16
- var TaskList = /*#__PURE__*/function (_PureComponent) {
17
- function TaskList() {
18
- _classCallCheck(this, TaskList);
19
- return _callSuper(this, TaskList, arguments);
20
- }
21
- _inherits(TaskList, _PureComponent);
22
- return _createClass(TaskList, [{
23
- key: "render",
24
- value: function render() {
25
- var _this$props = this.props,
26
- listId = _this$props.listId,
27
- children = _this$props.children;
28
- var listSize = React.Children.count(children);
29
- if (!children) {
30
- return null;
31
- }
32
-
33
- // Data attributes are required for copy and paste from rendered content
34
- // to the editor to preserve the task.
35
- // This allows the editor to differentiate between numbered and ordered lists,
36
- // and action items, which all share the common `<li>` element.
37
- // The value of `data-task-local-id` should be discarded upon paste, with a
38
- // a new uuid generated by the editor for the cloned content.
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
- }));
57
- }
58
- }]);
59
- }(PureComponent);
60
- export { TaskList as default };
@@ -1,227 +0,0 @@
1
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
- import { css } from '@emotion/react';
3
- import checkboxTheme from './theme';
4
-
5
- /*
6
- Increasing specificity with double ampersand to ensure these rules take
7
- priority over the global styles applied to 'ol' elements.
8
- */
9
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
10
- export var listStyles = css({
11
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
12
- '&&': {
13
- listStyleType: 'none',
14
- paddingLeft: 0
15
- }
16
- });
17
-
18
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
19
- export var taskListStyles = css({
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
21
- 'div + div': {
22
- marginTop: "var(--ds-space-050, 4px)"
23
- }
24
- });
25
-
26
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
27
- export var contentStyles = css({
28
- margin: 0,
29
- wordWrap: 'break-word',
30
- minWidth: 0,
31
- flex: '1 1 auto'
32
- });
33
-
34
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
35
- export var taskStyles = css({
36
- display: 'flex',
37
- flexDirection: 'row',
38
- position: 'relative'
39
- });
40
- export var decisionStyles = function decisionStyles() {
41
- return css({
42
- display: 'flex',
43
- flexDirection: 'row',
44
- margin: "var(--ds-space-100, 8px)".concat(" 0 0 0"),
45
- padding: "var(--ds-space-100, 8px)",
46
- paddingLeft: "var(--ds-space-150, 12px)",
47
- borderRadius: "var(--ds-border-radius-100, 3px)",
48
- backgroundColor: "var(--ds-background-neutral, #091E420F)",
49
- position: 'relative',
50
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
51
- '.decision-item': {
52
- cursor: 'initial'
53
- }
54
- });
55
- };
56
- export var placeholderStyles = function placeholderStyles(offset) {
57
- return css({
58
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
59
- margin: "0 0 0 ".concat(offset, "px"),
60
- position: 'absolute',
61
- color: "var(--ds-text-subtlest, #626F86)",
62
- pointerEvents: 'none',
63
- textOverflow: 'ellipsis',
64
- overflow: 'hidden',
65
- whiteSpace: 'nowrap',
66
- maxWidth: 'calc(100% - 50px)'
67
- });
68
- };
69
-
70
- /**
71
- * References packages/design-system/checkbox/src/checkbox.tsx
72
- * To be used until mobile editor does not require legacy themed() API anymore,
73
- * which will allow migration to use @atlaskit/checkbox instead
74
- */
75
- export var checkboxStyles = function checkboxStyles(isRenderer) {
76
- return css({
77
- flex: '0 0 24px',
78
- width: '24px',
79
- height: '24px',
80
- position: 'relative',
81
- alignSelf: 'start',
82
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
83
- "& > input[type='checkbox']": {
84
- width: '16px',
85
- height: '16px',
86
- zIndex: 1,
87
- cursor: 'pointer',
88
- outline: 'none',
89
- margin: 0,
90
- opacity: 0,
91
- position: 'absolute',
92
- top: '50%',
93
- left: '50%',
94
- transform: 'translate(-50%, -50%)',
95
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
96
- '&[disabled]': {
97
- cursor: 'default'
98
- },
99
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
100
- '+ span': {
101
- width: '24px',
102
- height: '24px',
103
- position: 'absolute',
104
- top: '50%',
105
- left: '50%',
106
- transform: 'translate(-50%, -50%)'
107
- },
108
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
109
- '+ span > svg': {
110
- boxSizing: 'border-box',
111
- display: 'inline',
112
- top: '50%',
113
- left: '50%',
114
- transform: 'translate(-50%, -50%)',
115
- maxWidth: 'unset',
116
- maxHeight: 'unset',
117
- position: 'absolute',
118
- overflow: 'hidden',
119
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
120
- color: checkboxTheme.light.boxColor.rest,
121
- transition: 'color 0.2s ease-in-out, fill 0.2s ease-in-out',
122
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
123
- 'path:first-of-type': {
124
- visibility: 'hidden'
125
- },
126
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
127
- 'rect:first-of-type': {
128
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
129
- stroke: checkboxTheme.light.borderColor.rest,
130
- strokeWidth: 1,
131
- transition: 'stroke 0.2s ease-in-out'
132
- }
133
- },
134
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
135
- '&:hover + span > svg': {
136
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
137
- color: checkboxTheme.light.boxColor.hovered,
138
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
139
- 'rect:first-of-type': {
140
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
141
- stroke: checkboxTheme.light.borderColor.hovered
142
- }
143
- },
144
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
145
- '&:checked:hover + span > svg': {
146
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
147
- color: checkboxTheme.light.boxColor.hoveredAndChecked,
148
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
149
- fill: checkboxTheme.light.tickColor.checked,
150
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
151
- 'rect:first-of-type': {
152
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
153
- stroke: checkboxTheme.light.borderColor.hoveredAndChecked
154
- }
155
- },
156
- '&:checked': {
157
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
158
- '+ span > svg': {
159
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
160
- 'path:first-of-type': {
161
- visibility: 'visible'
162
- },
163
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
164
- color: checkboxTheme.light.boxColor.checked,
165
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
166
- fill: checkboxTheme.light.tickColor.checked,
167
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
168
- 'rect:first-of-type': {
169
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
170
- stroke: checkboxTheme.light.borderColor.checked
171
- }
172
- }
173
- },
174
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
175
- '&:active + span > svg': {
176
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
177
- color: checkboxTheme.light.boxColor.active,
178
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
179
- 'rect:first-of-type': {
180
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
181
- stroke: checkboxTheme.light.borderColor.active
182
- }
183
- },
184
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
185
- '&:checked:active + span > svg': {
186
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
187
- color: checkboxTheme.light.boxColor.active,
188
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
189
- fill: checkboxTheme.light.tickColor.activeAndChecked,
190
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
191
- 'rect:first-of-type': {
192
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
193
- stroke: checkboxTheme.light.borderColor.active
194
- }
195
- },
196
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
197
- '&:disabled + span > svg, &:disabled:hover + span > svg, &:disabled:focus + span > svg, &:disabled:active + span > svg': {
198
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
199
- color: checkboxTheme.light.boxColor.disabled,
200
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
201
- 'rect:first-of-type': {
202
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
203
- stroke: checkboxTheme.light.borderColor.disabled
204
- }
205
- },
206
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
207
- '&:disabled:checked + span > svg': {
208
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
209
- fill: checkboxTheme.light.tickColor.disabledAndChecked
210
- },
211
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
212
- '&:focus + span::after': {
213
- position: 'absolute',
214
- width: "var(--ds-space-200, 16px)",
215
- height: "var(--ds-space-200, 16px)",
216
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
217
- border: "2px solid ".concat(checkboxTheme.light.borderColor.focused),
218
- borderRadius: "var(--ds-space-050, 4px)",
219
- content: "''",
220
- display: 'block',
221
- top: '50%',
222
- left: '50%',
223
- transform: 'translate(-50%, -50%)'
224
- }
225
- }
226
- });
227
- };
@@ -1,61 +0,0 @@
1
- /**
2
- * Styles taken from packages/design-system/checkbox/src/internal/theme.tsx
3
- * To be used until mobile editor does not require legacy themed() API anymore
4
- */
5
- var checkboxTheme = {
6
- light: {
7
- borderColor: {
8
- rest: "var(--ds-border-input, #8590A2)",
9
- hovered: "var(--ds-border-input, #8590A2)",
10
- disabled: "var(--ds-background-disabled, #091E4208)",
11
- checked: "var(--ds-background-selected-bold, #0C66E4)",
12
- active: "var(--ds-border, #091E4224)",
13
- focused: "var(--ds-border-focused, #388BFF)",
14
- hoveredAndChecked: "var(--ds-background-selected-bold-hovered, #0055CC)"
15
- },
16
- boxColor: {
17
- rest: "var(--ds-background-input, #FFFFFF)",
18
- hovered: "var(--ds-background-input-hovered, #F7F8F9)",
19
- disabled: "var(--ds-background-disabled, #091E4208)",
20
- active: "var(--ds-background-input-pressed, #FFFFFF)",
21
- hoveredAndChecked: "var(--ds-background-selected-bold-hovered, #0055CC)",
22
- checked: "var(--ds-background-selected-bold, #0C66E4)"
23
- },
24
- tickColor: {
25
- disabledAndChecked: "var(--ds-icon-disabled, #091E424F)",
26
- activeAndChecked: "var(--ds-icon-inverse, #FFFFFF)",
27
- checked: "var(--ds-icon-inverse, #FFFFFF)"
28
- }
29
- },
30
- /**
31
- * Fallback colours for dark mode taken from
32
- * packages/design-system/tokens/src/artifacts/themes/atlassian-dark.tsx
33
- * To be used to keep mobile / web checkbox dark mode consistent
34
- * until mobile editor does not require legacy themed() API anymore
35
- */
36
- dark: {
37
- borderColor: {
38
- rest: "var(--ds-border-input, #8590A2)",
39
- hovered: "var(--ds-border-input, #8590A2)",
40
- disabled: "var(--ds-background-disabled, #BCD6F00A)",
41
- checked: "var(--ds-background-selected-bold, #579DFF)",
42
- active: "var(--ds-border, #A6C5E229)",
43
- focused: "var(--ds-border-focused, #85B8FF)",
44
- hoveredAndChecked: "var(--ds-background-selected-bold-hovered, #85B8FF)"
45
- },
46
- boxColor: {
47
- rest: "var(--ds-background-input, #22272B)",
48
- hovered: "var(--ds-background-input-hovered, #282E33)",
49
- disabled: "var(--ds-background-disabled, #BCD6F00A)",
50
- active: "var(--ds-background-input-pressed, #22272B)",
51
- hoveredAndChecked: "var(--ds-background-selected-bold-hovered, #85B8FF)",
52
- checked: "var(--ds-background-selected-bold, #579DFF)"
53
- },
54
- tickColor: {
55
- disabledAndChecked: "var(--ds-icon-disabled, #BFDBF847)",
56
- activeAndChecked: "var(--ds-icon-inverse, #1D2125)",
57
- checked: "var(--ds-icon-inverse, #1D2125)"
58
- }
59
- }
60
- };
61
- export default checkboxTheme;