@atlaskit/task-decision 17.4.5 → 17.5.0
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 +10 -0
- package/dist/cjs/components/DecisionItem.js +58 -71
- package/dist/cjs/components/DecisionList.js +6 -3
- package/dist/cjs/components/Item.js +73 -20
- package/dist/cjs/components/TaskItem.js +89 -96
- package/dist/cjs/components/TaskList.js +7 -4
- package/dist/cjs/components/listStyle.js +21 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/DecisionItem.js +51 -34
- package/dist/es2019/components/DecisionList.js +6 -3
- package/dist/es2019/components/Item.js +70 -16
- package/dist/es2019/components/TaskItem.js +154 -72
- package/dist/es2019/components/TaskList.js +7 -4
- package/dist/es2019/components/listStyle.js +12 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/DecisionItem.js +54 -62
- package/dist/esm/components/DecisionList.js +6 -3
- package/dist/esm/components/Item.js +72 -16
- package/dist/esm/components/TaskItem.js +86 -92
- package/dist/esm/components/TaskList.js +7 -4
- package/dist/esm/components/listStyle.js +12 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/DecisionItem.d.ts +4 -5
- package/dist/types/components/DecisionList.d.ts +3 -1
- package/dist/types/components/Item.d.ts +6 -2
- package/dist/types/components/TaskItem.d.ts +2 -11
- package/dist/types/components/TaskList.d.ts +2 -1
- package/dist/types/components/listStyle.d.ts +2 -0
- package/package.json +6 -4
- package/dist/cjs/styled/DecisionItem.js +0 -31
- package/dist/cjs/styled/Item.js +0 -41
- package/dist/cjs/styled/ListWrapper.js +0 -24
- package/dist/cjs/styled/Placeholder.js +0 -24
- package/dist/cjs/styled/TaskItem.js +0 -46
- package/dist/es2019/styled/DecisionItem.js +0 -21
- package/dist/es2019/styled/Item.js +0 -39
- package/dist/es2019/styled/ListWrapper.js +0 -20
- package/dist/es2019/styled/Placeholder.js +0 -15
- package/dist/es2019/styled/TaskItem.js +0 -94
- package/dist/esm/styled/DecisionItem.js +0 -17
- package/dist/esm/styled/Item.js +0 -18
- package/dist/esm/styled/ListWrapper.js +0 -11
- package/dist/esm/styled/Placeholder.js +0 -12
- package/dist/esm/styled/TaskItem.js +0 -26
- package/dist/types/styled/DecisionItem.d.ts +0 -5
- package/dist/types/styled/Item.d.ts +0 -7
- package/dist/types/styled/ListWrapper.d.ts +0 -4
- package/dist/types/styled/Placeholder.d.ts +0 -5
- package/dist/types/styled/TaskItem.d.ts +0 -6
|
@@ -8,9 +8,11 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
8
8
|
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
|
|
11
|
+
/** @jsx jsx */
|
|
11
12
|
import React from 'react';
|
|
12
13
|
import { PureComponent } from 'react';
|
|
13
|
-
import {
|
|
14
|
+
import { jsx } from '@emotion/react';
|
|
15
|
+
import decisionListStyles from './listStyle';
|
|
14
16
|
|
|
15
17
|
var DecisionList = /*#__PURE__*/function (_PureComponent) {
|
|
16
18
|
_inherits(DecisionList, _PureComponent);
|
|
@@ -38,13 +40,14 @@ var DecisionList = /*#__PURE__*/function (_PureComponent) {
|
|
|
38
40
|
// a new uuid generated by the editor for the cloned content.
|
|
39
41
|
|
|
40
42
|
|
|
41
|
-
return
|
|
43
|
+
return jsx("ol", {
|
|
44
|
+
css: decisionListStyles,
|
|
42
45
|
"data-decision-list-local-id": "",
|
|
43
46
|
"data-node-type": "decisionList"
|
|
44
47
|
}, React.Children.map(children, function (child, idx) {
|
|
45
48
|
var _ref = child.props,
|
|
46
49
|
localId = _ref.localId;
|
|
47
|
-
return
|
|
50
|
+
return jsx("li", {
|
|
48
51
|
key: idx,
|
|
49
52
|
"data-decision-local-id": localId || '',
|
|
50
53
|
"data-decision-state": "DECIDED"
|
|
@@ -10,11 +10,59 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/** @jsx jsx */
|
|
14
14
|
import { PureComponent } from 'react';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
15
|
+
import { css, jsx } from '@emotion/react';
|
|
16
|
+
import { themed } from '@atlaskit/theme/components';
|
|
17
|
+
import { token } from '@atlaskit/tokens';
|
|
18
|
+
import { DN50, N100, N20A } from '@atlaskit/theme/colors';
|
|
19
|
+
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
20
|
+
var contentStyle = css({
|
|
21
|
+
margin: 0,
|
|
22
|
+
wordWrap: 'break-word',
|
|
23
|
+
minWidth: 0,
|
|
24
|
+
flex: '1 1 auto'
|
|
25
|
+
});
|
|
26
|
+
var taskStyles = css({
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
padding: '6px 3px',
|
|
30
|
+
position: 'relative'
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var decisionStyles = function decisionStyles(theme) {
|
|
34
|
+
return css({
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'row',
|
|
37
|
+
margin: "".concat(gridSize(), "px 0 0 0"),
|
|
38
|
+
padding: "".concat(gridSize(), "px"),
|
|
39
|
+
paddingLeft: "".concat(gridSize() * 1.5, "px"),
|
|
40
|
+
borderRadius: "".concat(borderRadius(), "px"),
|
|
41
|
+
backgroundColor: themed({
|
|
42
|
+
light: token('color.background.neutral', N20A),
|
|
43
|
+
dark: token('color.background.neutral', DN50)
|
|
44
|
+
})({
|
|
45
|
+
theme: theme
|
|
46
|
+
}),
|
|
47
|
+
position: 'relative',
|
|
48
|
+
'.decision-item': {
|
|
49
|
+
cursor: 'initial'
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var placeHolderStyles = function placeHolderStyles(offset) {
|
|
55
|
+
return css({
|
|
56
|
+
margin: "0 0 0 ".concat(offset, "px"),
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
color: token('color.text.subtlest', N100),
|
|
59
|
+
pointerEvents: 'none',
|
|
60
|
+
textOverflow: 'ellipsis',
|
|
61
|
+
overflow: 'hidden',
|
|
62
|
+
whiteSpace: 'nowrap',
|
|
63
|
+
maxWidth: 'calc(100% - 50px)'
|
|
64
|
+
});
|
|
65
|
+
};
|
|
18
66
|
|
|
19
67
|
var Item = /*#__PURE__*/function (_PureComponent) {
|
|
20
68
|
_inherits(Item, _PureComponent);
|
|
@@ -41,9 +89,10 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
41
89
|
}
|
|
42
90
|
|
|
43
91
|
var offset = gridSize() * (itemType === 'TASK' ? 3 : 3.5);
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
92
|
+
return jsx("span", {
|
|
93
|
+
"data-component": "placeholder",
|
|
94
|
+
css: placeHolderStyles(offset),
|
|
95
|
+
contentEditable: false
|
|
47
96
|
}, placeholder);
|
|
48
97
|
}
|
|
49
98
|
}, {
|
|
@@ -54,21 +103,28 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
54
103
|
children = _this$props2.children,
|
|
55
104
|
icon = _this$props2.icon,
|
|
56
105
|
itemType = _this$props2.itemType,
|
|
106
|
+
checkBoxId = _this$props2.checkBoxId,
|
|
57
107
|
dataAttributes = _this$props2.dataAttributes,
|
|
58
|
-
|
|
108
|
+
theme = _this$props2.theme;
|
|
59
109
|
|
|
60
110
|
if (itemType === 'TASK') {
|
|
61
|
-
return
|
|
111
|
+
return jsx("div", {
|
|
112
|
+
css: taskStyles,
|
|
62
113
|
id: "".concat(checkBoxId, "-wrapper")
|
|
63
|
-
}, icon, this.renderPlaceholder(),
|
|
64
|
-
|
|
65
|
-
|
|
114
|
+
}, icon, this.renderPlaceholder(), jsx("div", _extends({
|
|
115
|
+
"data-component": "content",
|
|
116
|
+
css: contentStyle,
|
|
117
|
+
ref: contentRef
|
|
118
|
+
}, dataAttributes), children));
|
|
66
119
|
} else if (itemType === 'DECISION') {
|
|
67
|
-
return
|
|
120
|
+
return jsx("div", {
|
|
121
|
+
css: decisionStyles(theme),
|
|
68
122
|
"data-decision-wrapper": "true"
|
|
69
|
-
}, icon, this.renderPlaceholder(),
|
|
70
|
-
|
|
71
|
-
|
|
123
|
+
}, icon, this.renderPlaceholder(), jsx("div", _extends({
|
|
124
|
+
"data-component": "content",
|
|
125
|
+
css: contentStyle,
|
|
126
|
+
ref: contentRef
|
|
127
|
+
}, dataAttributes), children));
|
|
72
128
|
}
|
|
73
129
|
|
|
74
130
|
return null;
|
|
@@ -1,45 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
8
2
|
|
|
9
|
-
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
import { PureComponent } from 'react';
|
|
15
|
-
import { CheckBoxWrapper } from '../styled/TaskItem';
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
16
8
|
import Item from './Item';
|
|
17
9
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
18
10
|
import { createAndFireEventInElementsChannel } from '../analytics';
|
|
11
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
12
|
+
import { themed, useGlobalTheme } from '@atlaskit/theme/components';
|
|
13
|
+
import { token } from '@atlaskit/tokens';
|
|
14
|
+
import { B300, B75, DN100, DN200, N0, N30, N90 } from '@atlaskit/theme/colors';
|
|
19
15
|
var taskCount = 0;
|
|
20
16
|
|
|
21
17
|
var getCheckBoxId = function getCheckBoxId(localId) {
|
|
22
18
|
return "".concat(localId, "-").concat(taskCount++);
|
|
23
19
|
};
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
var checkboxStyles = function checkboxStyles(isRenderer) {
|
|
22
|
+
return function (theme) {
|
|
23
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 0 0 16px;\n width: 16px;\n height: 16px;\n position: relative;\n align-self: start;\n margin: 4px ", "px 0 0;\n\n & > input[type='checkbox'] {\n width: 16px;\n height: 16px;\n z-index: 1;\n cursor: pointer;\n position: absolute;\n outline: none;\n margin: 0;\n opacity: 0;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n\n + div {\n box-sizing: border-box;\n display: inline;\n width: 100%;\n cursor: pointer;\n\n &::after {\n background: ", ";\n background-size: 16px;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n border-color: ", ";\n box-sizing: border-box;\n content: '';\n height: 16px;\n left: 50%;\n position: absolute;\n transition: border-color 0.2s ease-in-out;\n top: 8px;\n width: 16px;\n transform: translate(-50%, -50%);\n }\n }\n ", "\n\n &:not([disabled]):hover + div::after {\n background: ", ";\n transition: border 0.2s ease-in-out;\n }\n &[disabled] + div {\n opacity: 0.5;\n cursor: default;\n }\n &:checked {\n + div::after {\n background: url(data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+DQo8c3ZnIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICA8cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIyIiBmaWxsPSIjMDA1MkNDIj48L3JlY3Q+DQogIDxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik05LjM3NCA0LjkxNEw1LjQ1NiA4LjgzMmEuNzY5Ljc2OSAwIDAgMS0xLjA4OCAwTDIuNjI2IDcuMDkxYS43NjkuNzY5IDAgMSAxIDEuMDg4LTEuMDg5TDQuOTEyIDcuMmwzLjM3NC0zLjM3NGEuNzY5Ljc2OSAwIDEgMSAxLjA4OCAxLjA4OCI+PC9wYXRoPg0KPC9zdmc+)\n no-repeat 0 0;\n background-size: 16px;\n border: 0;\n border-color: transparent;\n }\n &:not([disabled]):hover + div::after {\n background: url(data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+DQo8c3ZnIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICA8cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIyIiBmaWxsPSIjMDc0N0E2Ij48L3JlY3Q+DQogIDxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik05LjM3NCA0LjkxNEw1LjQ1NiA4LjgzMmEuNzY5Ljc2OSAwIDAgMS0xLjA4OCAwTDIuNjI2IDcuMDkxYS43NjkuNzY5IDAgMSAxIDEuMDg4LTEuMDg5TDQuOTEyIDcuMmwzLjM3NC0zLjM3NGEuNzY5Ljc2OSAwIDEgMSAxLjA4OCAxLjA4OCI+PC9wYXRoPg0KPC9zdmc+)\n no-repeat 0 0;\n background-size: 16px;\n }\n }\n }\n "])), gridSize(), themed({
|
|
24
|
+
light: token('color.background.input', N0),
|
|
25
|
+
dark: token('color.background.input', DN100)
|
|
26
|
+
})({
|
|
27
|
+
theme: theme
|
|
28
|
+
}), themed({
|
|
29
|
+
light: token('color.border', N90),
|
|
30
|
+
dark: token('color.border', DN200)
|
|
31
|
+
})({
|
|
32
|
+
theme: theme
|
|
33
|
+
}), isRenderer ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &:focus-visible + div:after {\n outline: 2px solid\n ", ";\n }\n "])), themed({
|
|
34
|
+
light: token('color.border.focused', B300),
|
|
35
|
+
dark: token('color.border.focused', B75)
|
|
36
|
+
})({
|
|
37
|
+
theme: theme
|
|
38
|
+
})) : '', themed({
|
|
39
|
+
light: token('color.background.input', N30),
|
|
40
|
+
dark: token('color.background.input', B75)
|
|
41
|
+
})({
|
|
42
|
+
theme: theme
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
};
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
var TaskItem = function TaskItem(props) {
|
|
48
|
+
var appearance = props.appearance,
|
|
49
|
+
isDone = props.isDone,
|
|
50
|
+
isRenderer = props.isRenderer,
|
|
51
|
+
contentRef = props.contentRef,
|
|
52
|
+
children = props.children,
|
|
53
|
+
placeholder = props.placeholder,
|
|
54
|
+
showPlaceholder = props.showPlaceholder,
|
|
55
|
+
disabled = props.disabled,
|
|
56
|
+
dataAttributes = props.dataAttributes,
|
|
57
|
+
taskId = props.taskId,
|
|
58
|
+
onChange = props.onChange,
|
|
59
|
+
createAnalyticsEvent = props.createAnalyticsEvent;
|
|
60
|
+
var theme = useGlobalTheme();
|
|
61
|
+
var checkBoxId = useMemo(function () {
|
|
62
|
+
return getCheckBoxId(taskId);
|
|
63
|
+
}, [taskId]);
|
|
64
|
+
var handleOnChange = useMemo(function () {
|
|
65
|
+
return function (_evt) {
|
|
43
66
|
var newIsDone = !isDone;
|
|
44
67
|
|
|
45
68
|
if (onChange) {
|
|
@@ -58,71 +81,42 @@ export var TaskItem = /*#__PURE__*/function (_PureComponent) {
|
|
|
58
81
|
}
|
|
59
82
|
})(createAnalyticsEvent);
|
|
60
83
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
84
|
+
};
|
|
85
|
+
}, [onChange, taskId, isDone, createAnalyticsEvent]);
|
|
86
|
+
var handleOnKeyPress = useMemo(function () {
|
|
87
|
+
return function (event) {
|
|
64
88
|
if (event.key === 'Enter') {
|
|
65
|
-
|
|
89
|
+
handleOnChange(event);
|
|
66
90
|
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
isRenderer: isRenderer
|
|
96
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
97
|
-
id: this.checkBoxId,
|
|
98
|
-
"aria-labelledby": "".concat(this.checkBoxId, "-wrapper"),
|
|
99
|
-
name: this.checkBoxId,
|
|
100
|
-
type: "checkbox",
|
|
101
|
-
onChange: this.handleOnChange,
|
|
102
|
-
checked: !!isDone,
|
|
103
|
-
disabled: !!disabled,
|
|
104
|
-
suppressHydrationWarning: true,
|
|
105
|
-
onKeyPress: this.handleOnKeyPress
|
|
106
|
-
}), /*#__PURE__*/React.createElement("div", null));
|
|
107
|
-
return /*#__PURE__*/React.createElement(Item, {
|
|
108
|
-
appearance: appearance,
|
|
109
|
-
contentRef: contentRef,
|
|
110
|
-
icon: icon,
|
|
111
|
-
placeholder: placeholder,
|
|
112
|
-
showPlaceholder: showPlaceholder,
|
|
113
|
-
itemType: "TASK",
|
|
114
|
-
dataAttributes: dataAttributes,
|
|
115
|
-
checkBoxId: this.checkBoxId
|
|
116
|
-
}, children);
|
|
117
|
-
}
|
|
118
|
-
}]);
|
|
119
|
-
|
|
120
|
-
return TaskItem;
|
|
121
|
-
}(PureComponent); // This is to ensure that the "type" is exported, as it gets lost and not exported along with TaskItem after
|
|
91
|
+
};
|
|
92
|
+
}, [handleOnChange]);
|
|
93
|
+
var icon = jsx("span", {
|
|
94
|
+
css: checkboxStyles(isRenderer)(theme),
|
|
95
|
+
contentEditable: false
|
|
96
|
+
}, jsx("input", {
|
|
97
|
+
id: checkBoxId,
|
|
98
|
+
"aria-labelledby": "".concat(checkBoxId, "-wrapper"),
|
|
99
|
+
name: checkBoxId,
|
|
100
|
+
type: "checkbox",
|
|
101
|
+
onChange: handleOnChange,
|
|
102
|
+
checked: !!isDone,
|
|
103
|
+
disabled: !!disabled,
|
|
104
|
+
suppressHydrationWarning: true,
|
|
105
|
+
onKeyPress: handleOnKeyPress
|
|
106
|
+
}), jsx("div", null));
|
|
107
|
+
return jsx(Item, {
|
|
108
|
+
appearance: appearance,
|
|
109
|
+
contentRef: contentRef,
|
|
110
|
+
icon: icon,
|
|
111
|
+
placeholder: placeholder,
|
|
112
|
+
showPlaceholder: showPlaceholder,
|
|
113
|
+
itemType: "TASK",
|
|
114
|
+
dataAttributes: dataAttributes,
|
|
115
|
+
checkBoxId: checkBoxId,
|
|
116
|
+
theme: theme
|
|
117
|
+
}, children);
|
|
118
|
+
}; // This is to ensure that the "type" is exported, as it gets lost and not exported along with TaskItem after
|
|
122
119
|
// going through the high order component.
|
|
123
120
|
|
|
124
|
-
_defineProperty(TaskItem, "defaultProps", {
|
|
125
|
-
appearance: 'inline'
|
|
126
|
-
});
|
|
127
121
|
|
|
128
122
|
export default withAnalyticsEvents()(TaskItem);
|
|
@@ -8,10 +8,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
8
8
|
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
|
|
11
|
+
/** @jsx jsx */
|
|
11
12
|
import React from 'react';
|
|
12
13
|
import { PureComponent } from 'react';
|
|
13
|
-
import {
|
|
14
|
+
import { jsx } from '@emotion/react';
|
|
14
15
|
import { FabricElementsAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
16
|
+
import taskListStyles from './listStyle';
|
|
15
17
|
|
|
16
18
|
var TaskList = /*#__PURE__*/function (_PureComponent) {
|
|
17
19
|
_inherits(TaskList, _PureComponent);
|
|
@@ -42,18 +44,19 @@ var TaskList = /*#__PURE__*/function (_PureComponent) {
|
|
|
42
44
|
// a new uuid generated by the editor for the cloned content.
|
|
43
45
|
|
|
44
46
|
|
|
45
|
-
return
|
|
47
|
+
return jsx("div", {
|
|
48
|
+
css: taskListStyles,
|
|
46
49
|
"data-task-list-local-id": ""
|
|
47
50
|
}, React.Children.map(children, function (child, idx) {
|
|
48
51
|
var _ref = child.props,
|
|
49
52
|
localId = _ref.localId;
|
|
50
|
-
return
|
|
53
|
+
return jsx(FabricElementsAnalyticsContext, {
|
|
51
54
|
data: {
|
|
52
55
|
listLocalId: listId,
|
|
53
56
|
listSize: listSize,
|
|
54
57
|
position: idx
|
|
55
58
|
}
|
|
56
|
-
},
|
|
59
|
+
}, jsx("div", {
|
|
57
60
|
key: idx,
|
|
58
61
|
"data-task-local-id": localId || ''
|
|
59
62
|
}, child));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
var listStyle = css({
|
|
3
|
+
/*
|
|
4
|
+
Increasing specificity with double ampersand to ensure these rules take
|
|
5
|
+
priority over the global styles applied to 'ol' elements.
|
|
6
|
+
*/
|
|
7
|
+
'&&': {
|
|
8
|
+
listStyleType: 'none',
|
|
9
|
+
paddingLeft: 0
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export default listStyle;
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
2
3
|
import { Appearance, ContentRef } from '../types';
|
|
3
4
|
export interface Props {
|
|
4
5
|
children?: any;
|
|
@@ -10,7 +11,5 @@ export interface Props {
|
|
|
10
11
|
[key: string]: string | number;
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
render(): JSX.Element;
|
|
16
|
-
}
|
|
14
|
+
declare const DecisionItem: ({ appearance, children, contentRef, placeholder, showPlaceholder, dataAttributes, }: Props) => jsx.JSX.Element;
|
|
15
|
+
export default DecisionItem;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import { PureComponent, ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
export interface Props {
|
|
3
5
|
children?: ReactNode;
|
|
4
6
|
}
|
|
5
7
|
export default class DecisionList extends PureComponent<Props, {}> {
|
|
6
|
-
render(): JSX.Element | null;
|
|
8
|
+
render(): jsx.JSX.Element | null;
|
|
7
9
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import { PureComponent } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { Appearance, ContentRef, TaskType, DecisionType } from '../types';
|
|
5
|
+
import type { Theme } from '@atlaskit/theme/types';
|
|
3
6
|
export interface Props {
|
|
4
7
|
icon: JSX.Element;
|
|
5
8
|
itemType: TaskType | DecisionType;
|
|
@@ -12,10 +15,11 @@ export interface Props {
|
|
|
12
15
|
[key: string]: string | number;
|
|
13
16
|
};
|
|
14
17
|
checkBoxId?: string;
|
|
18
|
+
theme: Theme;
|
|
15
19
|
}
|
|
16
20
|
export default class Item extends PureComponent<Props, {}> {
|
|
17
21
|
static defaultProps: Partial<Props>;
|
|
18
22
|
private renderPlaceholder;
|
|
19
|
-
renderMessageAppearance(): JSX.Element | null;
|
|
20
|
-
render(): JSX.Element | null;
|
|
23
|
+
renderMessageAppearance(): jsx.JSX.Element | null;
|
|
24
|
+
render(): jsx.JSX.Element | null;
|
|
21
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
3
|
import { Appearance, ContentRef } from '../types';
|
|
4
4
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
5
|
export interface Props {
|
|
@@ -17,14 +17,5 @@ export interface Props {
|
|
|
17
17
|
[key: string]: string | number;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
static defaultProps: Partial<Props>;
|
|
22
|
-
private checkBoxId;
|
|
23
|
-
constructor(props: Props & WithAnalyticsEventsProps);
|
|
24
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
25
|
-
handleOnChange: (_evt: React.SyntheticEvent<HTMLInputElement>) => void;
|
|
26
|
-
handleOnKeyPress: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
27
|
-
render(): JSX.Element;
|
|
28
|
-
}
|
|
29
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps>, keyof Props>> & Partial<Pick<Partial<Props>, never>> & React.RefAttributes<any>>;
|
|
20
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
30
21
|
export default _default;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { PureComponent, ReactNode } from 'react';
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
2
3
|
export interface Props {
|
|
3
4
|
listId?: string;
|
|
4
5
|
children?: ReactNode;
|
|
5
6
|
}
|
|
6
7
|
export default class TaskList extends PureComponent<Props, {}> {
|
|
7
|
-
render(): JSX.Element | null;
|
|
8
|
+
render(): jsx.JSX.Element | null;
|
|
8
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/task-decision",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.5.0",
|
|
4
4
|
"description": "Tasks and decisions react components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,10 +29,11 @@
|
|
|
29
29
|
"@atlaskit/analytics-namespaced-context": "^6.5.0",
|
|
30
30
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
31
31
|
"@atlaskit/icon": "^21.10.0",
|
|
32
|
-
"@atlaskit/theme": "^12.
|
|
32
|
+
"@atlaskit/theme": "^12.2.0",
|
|
33
33
|
"@atlaskit/tokens": "^0.10.0",
|
|
34
34
|
"@atlaskit/util-service-support": "^6.1.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0",
|
|
36
|
+
"@emotion/react": "^11.7.1",
|
|
36
37
|
"uuid": "^3.1.0"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
@@ -45,11 +46,12 @@
|
|
|
45
46
|
"@atlaskit/analytics-listeners": "^8.3.0",
|
|
46
47
|
"@atlaskit/avatar": "^21.0.0",
|
|
47
48
|
"@atlaskit/docs": "*",
|
|
48
|
-
"@atlaskit/editor-common": "^69.
|
|
49
|
+
"@atlaskit/editor-common": "^69.2.0",
|
|
49
50
|
"@atlaskit/elements-test-helpers": "^0.7.0",
|
|
50
|
-
"@atlaskit/renderer": "^101.
|
|
51
|
+
"@atlaskit/renderer": "^101.1.0",
|
|
51
52
|
"@atlaskit/util-data-test": "^17.5.0",
|
|
52
53
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
54
|
+
"@emotion/jest": "^11.8.0",
|
|
53
55
|
"@types/url-search-params": "^0.10.0",
|
|
54
56
|
"date-fns": "^2.17.0",
|
|
55
57
|
"enzyme": "^3.10.0",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.EditorIconWrapper = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _components = require("@atlaskit/theme/components");
|
|
15
|
-
|
|
16
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
17
|
-
|
|
18
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
19
|
-
|
|
20
|
-
var _tokens = require("@atlaskit/tokens");
|
|
21
|
-
|
|
22
|
-
var _templateObject;
|
|
23
|
-
|
|
24
|
-
var EditorIconWrapper = _styledComponents.default.span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n flex: 0 0 16px;\n height: 16px;\n width: 16px;\n color: ", ";\n margin: 4px ", "px 0 0;\n\n > span {\n margin: -8px;\n }\n"])), function (props) {
|
|
25
|
-
return props.showPlaceholder ? (0, _tokens.token)('color.icon.subtle', _colors.N100) : (0, _components.themed)({
|
|
26
|
-
light: (0, _tokens.token)('color.icon.success', _colors.G400),
|
|
27
|
-
dark: (0, _tokens.token)('color.icon.success', _colors.G200)
|
|
28
|
-
});
|
|
29
|
-
}, (0, _constants.gridSize)() * 1.5);
|
|
30
|
-
|
|
31
|
-
exports.EditorIconWrapper = EditorIconWrapper;
|
package/dist/cjs/styled/Item.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.TaskWrapper = exports.ParticipantWrapper = exports.DecisionWrapper = exports.ContentWrapper = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _components = require("@atlaskit/theme/components");
|
|
15
|
-
|
|
16
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
17
|
-
|
|
18
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
19
|
-
|
|
20
|
-
var _tokens = require("@atlaskit/tokens");
|
|
21
|
-
|
|
22
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
23
|
-
|
|
24
|
-
var ContentWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin: 0;\n word-wrap: break-word;\n min-width: 0;\n flex: 1 1 auto;\n"])));
|
|
25
|
-
|
|
26
|
-
exports.ContentWrapper = ContentWrapper;
|
|
27
|
-
|
|
28
|
-
var TaskWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n padding: 6px 3px;\n position: relative;\n"])));
|
|
29
|
-
|
|
30
|
-
exports.TaskWrapper = TaskWrapper;
|
|
31
|
-
|
|
32
|
-
var DecisionWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n margin: ", "px 0 0 0;\n padding: ", "px;\n padding-left: ", "px;\n border-radius: ", "px;\n background-color: ", ";\n position: relative;\n\n .decision-item {\n cursor: initial;\n }\n"])), (0, _constants.gridSize)(), (0, _constants.gridSize)(), (0, _constants.gridSize)() * 1.5, (0, _constants.borderRadius)(), (0, _components.themed)({
|
|
33
|
-
light: (0, _tokens.token)('color.background.neutral', _colors.N20A),
|
|
34
|
-
dark: (0, _tokens.token)('color.background.neutral', _colors.DN50)
|
|
35
|
-
}));
|
|
36
|
-
|
|
37
|
-
exports.DecisionWrapper = DecisionWrapper;
|
|
38
|
-
|
|
39
|
-
var ParticipantWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n margin: -2px 8px;\n"])));
|
|
40
|
-
|
|
41
|
-
exports.ParticipantWrapper = ParticipantWrapper;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.TaskListWrapper = exports.DecisionListWrapper = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _templateObject, _templateObject2;
|
|
15
|
-
|
|
16
|
-
var WrapperStyles = "\n /*\n Increasing specificity with double ampersand to ensure these rules take\n priority over the global styles applied to 'ol' elements.\n */\n && {\n list-style-type: none;\n padding-left: 0;\n }\n";
|
|
17
|
-
|
|
18
|
-
var TaskListWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), WrapperStyles);
|
|
19
|
-
|
|
20
|
-
exports.TaskListWrapper = TaskListWrapper;
|
|
21
|
-
|
|
22
|
-
var DecisionListWrapper = _styledComponents.default.ol(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), WrapperStyles);
|
|
23
|
-
|
|
24
|
-
exports.DecisionListWrapper = DecisionListWrapper;
|