@atlaskit/editor-plugin-tasks-and-decisions 20.0.5 → 20.0.7
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 +15 -0
- package/dist/cjs/nodeviews/taskItemNodeSpec.js +1 -99
- package/dist/cjs/tasksAndDecisionsPlugin.js +6 -6
- package/dist/cjs/ui/Task/RequestToEditPopup.js +1 -1
- package/dist/es2019/nodeviews/taskItemNodeSpec.js +1 -98
- package/dist/es2019/tasksAndDecisionsPlugin.js +6 -6
- package/dist/es2019/ui/Task/RequestToEditPopup.js +1 -1
- package/dist/esm/nodeviews/taskItemNodeSpec.js +1 -98
- package/dist/esm/tasksAndDecisionsPlugin.js +6 -6
- package/dist/esm/ui/Task/RequestToEditPopup.js +1 -1
- package/dist/types/nodeviews/taskItemNodeSpec.d.ts +1 -18
- package/package.json +5 -5
- package/dist/cjs/nodeviews/toDOM-fixes/decisionItem.js +0 -81
- package/dist/es2019/nodeviews/toDOM-fixes/decisionItem.js +0 -73
- package/dist/esm/nodeviews/toDOM-fixes/decisionItem.js +0 -74
- package/dist/types/nodeviews/toDOM-fixes/decisionItem.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 20.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`aca1f7aaf3fd6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aca1f7aaf3fd6) -
|
|
8
|
+
Remove the fully rolled-out `platform_editor_exp_lazy_node_views` experiment and call the block
|
|
9
|
+
card, embed card, extension, table, and task node views directly.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 20.0.6
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 20.0.5
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -4,53 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.taskItemNodeSpec = exports.lazyTaskItemToDom = exports.blockTaskItemNodeSpec = void 0;
|
|
8
7
|
exports.taskItemToDom = taskItemToDom;
|
|
9
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _taskItem = require("@atlaskit/adf-schema/task-item");
|
|
11
|
-
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
12
9
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
14
11
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
|
-
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
16
12
|
var _utils = require("./utils");
|
|
17
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
-
/**
|
|
20
|
-
* Wrapper for ADF taskItem node spec to augment toDOM implementation
|
|
21
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
22
|
-
* @nodeSpecException:toDOM patch
|
|
23
|
-
* @returns
|
|
24
|
-
* @example
|
|
25
|
-
*/
|
|
26
|
-
var taskItemNodeSpec = exports.taskItemNodeSpec = function taskItemNodeSpec() {
|
|
27
|
-
if ((0, _editorExperiment.editorExperiment)('platform_editor_exp_lazy_node_views', false)) {
|
|
28
|
-
return _taskItem.taskItem;
|
|
29
|
-
}
|
|
30
|
-
return _objectSpread(_objectSpread({}, _taskItem.taskItem), {}, {
|
|
31
|
-
toDOM: function toDOM(node) {
|
|
32
|
-
return lazyTaskItemToDom(node);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Wrapper for ADF blockTaskItem node spec to augment toDOM implementation
|
|
39
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
40
|
-
* @nodeSpecException:toDOM patch
|
|
41
|
-
* @returns
|
|
42
|
-
* @example
|
|
43
|
-
*/
|
|
44
|
-
var blockTaskItemNodeSpec = exports.blockTaskItemNodeSpec = function blockTaskItemNodeSpec() {
|
|
45
|
-
if ((0, _editorExperiment.editorExperiment)('platform_editor_exp_lazy_node_views', false)) {
|
|
46
|
-
return _taskItem.blockTaskItem;
|
|
47
|
-
}
|
|
48
|
-
return _objectSpread(_objectSpread({}, _taskItem.blockTaskItem), {}, {
|
|
49
|
-
toDOM: function toDOM(node) {
|
|
50
|
-
return lazyTaskItemToDom(node);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
15
|
var getCheckBoxId = function getCheckBoxId(localId) {
|
|
55
16
|
return "task-checkbox-".concat(localId);
|
|
56
17
|
};
|
|
@@ -138,63 +99,4 @@ function taskItemToDom(node, placeholder, intl) {
|
|
|
138
99
|
}, ['div', _objectSpread({
|
|
139
100
|
class: _styles.TaskDecisionSharedCssClassName.TASK_ITEM
|
|
140
101
|
}, contentDomDataAttrs), 0]]]];
|
|
141
|
-
}
|
|
142
|
-
var lazyTaskItemToDom = exports.lazyTaskItemToDom = function lazyTaskItemToDom(node) {
|
|
143
|
-
var checked = node.attrs.state === 'DONE';
|
|
144
|
-
var inputAttrs = {
|
|
145
|
-
name: node.attrs.localId,
|
|
146
|
-
id: node.attrs.localId,
|
|
147
|
-
type: 'checkbox'
|
|
148
|
-
};
|
|
149
|
-
if (checked) {
|
|
150
|
-
inputAttrs.checked = 'true';
|
|
151
|
-
}
|
|
152
|
-
var dataAttrs = _objectSpread({
|
|
153
|
-
'data-task-local-id': node.attrs.localId,
|
|
154
|
-
'data-task-state': node.attrs.state
|
|
155
|
-
}, node.type.name === 'blockTaskItem' ? {
|
|
156
|
-
'data-task-is-block': 'true'
|
|
157
|
-
} : {});
|
|
158
|
-
return ['div', _objectSpread(_objectSpread({
|
|
159
|
-
class: _styles.TaskDecisionSharedCssClassName.TASK_CONTAINER
|
|
160
|
-
}, dataAttrs), {}, {
|
|
161
|
-
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
162
|
-
listStyleType: 'none',
|
|
163
|
-
lineHeight: '24px',
|
|
164
|
-
minWidth: '48px',
|
|
165
|
-
position: 'relative'
|
|
166
|
-
})
|
|
167
|
-
}), ['div', {
|
|
168
|
-
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
169
|
-
display: 'flex'
|
|
170
|
-
})
|
|
171
|
-
}, ['span', {
|
|
172
|
-
contenteditable: 'false',
|
|
173
|
-
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
174
|
-
width: '24px',
|
|
175
|
-
height: '24px',
|
|
176
|
-
lineHeight: '24px',
|
|
177
|
-
display: 'grid',
|
|
178
|
-
placeContent: 'center center'
|
|
179
|
-
})
|
|
180
|
-
}, ['input', _objectSpread(_objectSpread({}, inputAttrs), {}, {
|
|
181
|
-
'data-input-type': 'lazy-task-item',
|
|
182
|
-
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
183
|
-
width: '13px',
|
|
184
|
-
height: '13px',
|
|
185
|
-
margin: '1px 0 0 0',
|
|
186
|
-
padding: 0,
|
|
187
|
-
accentColor: "var(--ds-background-selected-bold, #1868DB)"
|
|
188
|
-
})
|
|
189
|
-
})]], ['div', {
|
|
190
|
-
'data-component': 'content'
|
|
191
|
-
}, ['div', {
|
|
192
|
-
class: _styles.TaskDecisionSharedCssClassName.TASK_ITEM,
|
|
193
|
-
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
194
|
-
display: 'block',
|
|
195
|
-
fontSize: '16px',
|
|
196
|
-
fontFamily: "var(--ds-font-body, normal 400 14px/20px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
197
|
-
color: "var(--ds-text, #292A2E)"
|
|
198
|
-
})
|
|
199
|
-
}, 0]]]];
|
|
200
|
-
};
|
|
102
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* tasksAndDecisionsPlugin.tsx generated by @compiled/babel-plugin
|
|
1
|
+
/* tasksAndDecisionsPlugin.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -14,7 +14,9 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
16
16
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
|
+
var _decisionItem = require("@atlaskit/adf-schema/decision-item");
|
|
17
18
|
var _decisionList = require("@atlaskit/adf-schema/decision-list");
|
|
19
|
+
var _taskItem = require("@atlaskit/adf-schema/task-item");
|
|
18
20
|
var _taskList = require("@atlaskit/adf-schema/task-list");
|
|
19
21
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
20
22
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
@@ -27,8 +29,6 @@ var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
|
27
29
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
28
30
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
29
31
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
30
|
-
var _taskItemNodeSpec = require("./nodeviews/taskItemNodeSpec");
|
|
31
|
-
var _decisionItem = require("./nodeviews/toDOM-fixes/decisionItem");
|
|
32
32
|
var _helpers = require("./pm-plugins/helpers");
|
|
33
33
|
var _inputRules = _interopRequireDefault(require("./pm-plugins/input-rules"));
|
|
34
34
|
var _insertCommands = require("./pm-plugins/insert-commands");
|
|
@@ -190,16 +190,16 @@ var tasksAndDecisionsPlugin = exports.tasksAndDecisionsPlugin = function tasksAn
|
|
|
190
190
|
node: _decisionList.decisionList
|
|
191
191
|
}, {
|
|
192
192
|
name: 'decisionItem',
|
|
193
|
-
node:
|
|
193
|
+
node: _decisionItem.decisionItem
|
|
194
194
|
}, {
|
|
195
195
|
name: 'taskList',
|
|
196
196
|
node: _taskList.taskList
|
|
197
197
|
}, {
|
|
198
198
|
name: 'taskItem',
|
|
199
|
-
node:
|
|
199
|
+
node: _taskItem.taskItem
|
|
200
200
|
}].concat((0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) && allowBlockTaskItem ? [{
|
|
201
201
|
name: 'blockTaskItem',
|
|
202
|
-
node:
|
|
202
|
+
node: _taskItem.blockTaskItem
|
|
203
203
|
}] : []));
|
|
204
204
|
},
|
|
205
205
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -1,43 +1,7 @@
|
|
|
1
|
-
import { taskItem, blockTaskItem } from '@atlaskit/adf-schema/task-item';
|
|
2
|
-
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
3
1
|
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages';
|
|
4
2
|
import { TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
5
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
7
4
|
import { isContentEmpty } from './utils';
|
|
8
|
-
/**
|
|
9
|
-
* Wrapper for ADF taskItem node spec to augment toDOM implementation
|
|
10
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
11
|
-
* @nodeSpecException:toDOM patch
|
|
12
|
-
* @returns
|
|
13
|
-
* @example
|
|
14
|
-
*/
|
|
15
|
-
export const taskItemNodeSpec = () => {
|
|
16
|
-
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
17
|
-
return taskItem;
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
...taskItem,
|
|
21
|
-
toDOM: node => lazyTaskItemToDom(node)
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Wrapper for ADF blockTaskItem node spec to augment toDOM implementation
|
|
27
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
28
|
-
* @nodeSpecException:toDOM patch
|
|
29
|
-
* @returns
|
|
30
|
-
* @example
|
|
31
|
-
*/
|
|
32
|
-
export const blockTaskItemNodeSpec = () => {
|
|
33
|
-
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
34
|
-
return blockTaskItem;
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
...blockTaskItem,
|
|
38
|
-
toDOM: node => lazyTaskItemToDom(node)
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
5
|
const getCheckBoxId = localId => `task-checkbox-${localId}`;
|
|
42
6
|
|
|
43
7
|
// eslint-disable-next-line jsdoc/require-example
|
|
@@ -126,65 +90,4 @@ export function taskItemToDom(node, placeholder, intl) {
|
|
|
126
90
|
class: TaskDecisionSharedCssClassName.TASK_ITEM,
|
|
127
91
|
...contentDomDataAttrs
|
|
128
92
|
}, 0]]]];
|
|
129
|
-
}
|
|
130
|
-
export const lazyTaskItemToDom = node => {
|
|
131
|
-
const checked = node.attrs.state === 'DONE';
|
|
132
|
-
const inputAttrs = {
|
|
133
|
-
name: node.attrs.localId,
|
|
134
|
-
id: node.attrs.localId,
|
|
135
|
-
type: 'checkbox'
|
|
136
|
-
};
|
|
137
|
-
if (checked) {
|
|
138
|
-
inputAttrs.checked = 'true';
|
|
139
|
-
}
|
|
140
|
-
const dataAttrs = {
|
|
141
|
-
'data-task-local-id': node.attrs.localId,
|
|
142
|
-
'data-task-state': node.attrs.state,
|
|
143
|
-
...(node.type.name === 'blockTaskItem' ? {
|
|
144
|
-
'data-task-is-block': 'true'
|
|
145
|
-
} : {})
|
|
146
|
-
};
|
|
147
|
-
return ['div', {
|
|
148
|
-
class: TaskDecisionSharedCssClassName.TASK_CONTAINER,
|
|
149
|
-
...dataAttrs,
|
|
150
|
-
style: convertToInlineCss({
|
|
151
|
-
listStyleType: 'none',
|
|
152
|
-
lineHeight: '24px',
|
|
153
|
-
minWidth: '48px',
|
|
154
|
-
position: 'relative'
|
|
155
|
-
})
|
|
156
|
-
}, ['div', {
|
|
157
|
-
style: convertToInlineCss({
|
|
158
|
-
display: 'flex'
|
|
159
|
-
})
|
|
160
|
-
}, ['span', {
|
|
161
|
-
contenteditable: 'false',
|
|
162
|
-
style: convertToInlineCss({
|
|
163
|
-
width: '24px',
|
|
164
|
-
height: '24px',
|
|
165
|
-
lineHeight: '24px',
|
|
166
|
-
display: 'grid',
|
|
167
|
-
placeContent: 'center center'
|
|
168
|
-
})
|
|
169
|
-
}, ['input', {
|
|
170
|
-
...inputAttrs,
|
|
171
|
-
'data-input-type': 'lazy-task-item',
|
|
172
|
-
style: convertToInlineCss({
|
|
173
|
-
width: '13px',
|
|
174
|
-
height: '13px',
|
|
175
|
-
margin: '1px 0 0 0',
|
|
176
|
-
padding: 0,
|
|
177
|
-
accentColor: "var(--ds-background-selected-bold, #1868DB)"
|
|
178
|
-
})
|
|
179
|
-
}]], ['div', {
|
|
180
|
-
'data-component': 'content'
|
|
181
|
-
}, ['div', {
|
|
182
|
-
class: TaskDecisionSharedCssClassName.TASK_ITEM,
|
|
183
|
-
style: convertToInlineCss({
|
|
184
|
-
display: 'block',
|
|
185
|
-
fontSize: '16px',
|
|
186
|
-
fontFamily: "var(--ds-font-body, normal 400 14px/20px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
187
|
-
color: "var(--ds-text, #292A2E)"
|
|
188
|
-
})
|
|
189
|
-
}, 0]]]];
|
|
190
|
-
};
|
|
93
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
/* tasksAndDecisionsPlugin.tsx generated by @compiled/babel-plugin
|
|
1
|
+
/* tasksAndDecisionsPlugin.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import "./tasksAndDecisionsPlugin.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { decisionItem } from '@atlaskit/adf-schema/decision-item';
|
|
5
6
|
import { decisionList } from '@atlaskit/adf-schema/decision-list';
|
|
7
|
+
import { blockTaskItem, taskItem } from '@atlaskit/adf-schema/task-item';
|
|
6
8
|
import { taskList } from '@atlaskit/adf-schema/task-list';
|
|
7
9
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
8
10
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -15,8 +17,6 @@ import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
|
15
17
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
18
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
17
19
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
18
|
-
import { taskItemNodeSpec, blockTaskItemNodeSpec } from './nodeviews/taskItemNodeSpec';
|
|
19
|
-
import { decisionItemSpecWithFixedToDOM } from './nodeviews/toDOM-fixes/decisionItem';
|
|
20
20
|
import { closeRequestEditPopupAt, getCurrentIndentLevel, getTaskItemIndex, isInsideTask } from './pm-plugins/helpers';
|
|
21
21
|
// Ignored via go/ees005
|
|
22
22
|
// eslint-disable-next-line import/no-named-as-default
|
|
@@ -176,16 +176,16 @@ export const tasksAndDecisionsPlugin = ({
|
|
|
176
176
|
node: decisionList
|
|
177
177
|
}, {
|
|
178
178
|
name: 'decisionItem',
|
|
179
|
-
node:
|
|
179
|
+
node: decisionItem
|
|
180
180
|
}, {
|
|
181
181
|
name: 'taskList',
|
|
182
182
|
node: taskList
|
|
183
183
|
}, {
|
|
184
184
|
name: 'taskItem',
|
|
185
|
-
node:
|
|
185
|
+
node: taskItem
|
|
186
186
|
}, ...(expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) && allowBlockTaskItem ? [{
|
|
187
187
|
name: 'blockTaskItem',
|
|
188
|
-
node:
|
|
188
|
+
node: blockTaskItem
|
|
189
189
|
}] : [])];
|
|
190
190
|
},
|
|
191
191
|
getSharedState(editorState) {
|
|
@@ -1,48 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { taskItem, blockTaskItem } from '@atlaskit/adf-schema/task-item';
|
|
5
|
-
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
6
4
|
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages';
|
|
7
5
|
import { TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
8
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
10
7
|
import { isContentEmpty } from './utils';
|
|
11
|
-
/**
|
|
12
|
-
* Wrapper for ADF taskItem node spec to augment toDOM implementation
|
|
13
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
14
|
-
* @nodeSpecException:toDOM patch
|
|
15
|
-
* @returns
|
|
16
|
-
* @example
|
|
17
|
-
*/
|
|
18
|
-
export var taskItemNodeSpec = function taskItemNodeSpec() {
|
|
19
|
-
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
20
|
-
return taskItem;
|
|
21
|
-
}
|
|
22
|
-
return _objectSpread(_objectSpread({}, taskItem), {}, {
|
|
23
|
-
toDOM: function toDOM(node) {
|
|
24
|
-
return lazyTaskItemToDom(node);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Wrapper for ADF blockTaskItem node spec to augment toDOM implementation
|
|
31
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
32
|
-
* @nodeSpecException:toDOM patch
|
|
33
|
-
* @returns
|
|
34
|
-
* @example
|
|
35
|
-
*/
|
|
36
|
-
export var blockTaskItemNodeSpec = function blockTaskItemNodeSpec() {
|
|
37
|
-
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
38
|
-
return blockTaskItem;
|
|
39
|
-
}
|
|
40
|
-
return _objectSpread(_objectSpread({}, blockTaskItem), {}, {
|
|
41
|
-
toDOM: function toDOM(node) {
|
|
42
|
-
return lazyTaskItemToDom(node);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
8
|
var getCheckBoxId = function getCheckBoxId(localId) {
|
|
47
9
|
return "task-checkbox-".concat(localId);
|
|
48
10
|
};
|
|
@@ -130,63 +92,4 @@ export function taskItemToDom(node, placeholder, intl) {
|
|
|
130
92
|
}, ['div', _objectSpread({
|
|
131
93
|
class: TaskDecisionSharedCssClassName.TASK_ITEM
|
|
132
94
|
}, contentDomDataAttrs), 0]]]];
|
|
133
|
-
}
|
|
134
|
-
export var lazyTaskItemToDom = function lazyTaskItemToDom(node) {
|
|
135
|
-
var checked = node.attrs.state === 'DONE';
|
|
136
|
-
var inputAttrs = {
|
|
137
|
-
name: node.attrs.localId,
|
|
138
|
-
id: node.attrs.localId,
|
|
139
|
-
type: 'checkbox'
|
|
140
|
-
};
|
|
141
|
-
if (checked) {
|
|
142
|
-
inputAttrs.checked = 'true';
|
|
143
|
-
}
|
|
144
|
-
var dataAttrs = _objectSpread({
|
|
145
|
-
'data-task-local-id': node.attrs.localId,
|
|
146
|
-
'data-task-state': node.attrs.state
|
|
147
|
-
}, node.type.name === 'blockTaskItem' ? {
|
|
148
|
-
'data-task-is-block': 'true'
|
|
149
|
-
} : {});
|
|
150
|
-
return ['div', _objectSpread(_objectSpread({
|
|
151
|
-
class: TaskDecisionSharedCssClassName.TASK_CONTAINER
|
|
152
|
-
}, dataAttrs), {}, {
|
|
153
|
-
style: convertToInlineCss({
|
|
154
|
-
listStyleType: 'none',
|
|
155
|
-
lineHeight: '24px',
|
|
156
|
-
minWidth: '48px',
|
|
157
|
-
position: 'relative'
|
|
158
|
-
})
|
|
159
|
-
}), ['div', {
|
|
160
|
-
style: convertToInlineCss({
|
|
161
|
-
display: 'flex'
|
|
162
|
-
})
|
|
163
|
-
}, ['span', {
|
|
164
|
-
contenteditable: 'false',
|
|
165
|
-
style: convertToInlineCss({
|
|
166
|
-
width: '24px',
|
|
167
|
-
height: '24px',
|
|
168
|
-
lineHeight: '24px',
|
|
169
|
-
display: 'grid',
|
|
170
|
-
placeContent: 'center center'
|
|
171
|
-
})
|
|
172
|
-
}, ['input', _objectSpread(_objectSpread({}, inputAttrs), {}, {
|
|
173
|
-
'data-input-type': 'lazy-task-item',
|
|
174
|
-
style: convertToInlineCss({
|
|
175
|
-
width: '13px',
|
|
176
|
-
height: '13px',
|
|
177
|
-
margin: '1px 0 0 0',
|
|
178
|
-
padding: 0,
|
|
179
|
-
accentColor: "var(--ds-background-selected-bold, #1868DB)"
|
|
180
|
-
})
|
|
181
|
-
})]], ['div', {
|
|
182
|
-
'data-component': 'content'
|
|
183
|
-
}, ['div', {
|
|
184
|
-
class: TaskDecisionSharedCssClassName.TASK_ITEM,
|
|
185
|
-
style: convertToInlineCss({
|
|
186
|
-
display: 'block',
|
|
187
|
-
fontSize: '16px',
|
|
188
|
-
fontFamily: "var(--ds-font-body, normal 400 14px/20px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
189
|
-
color: "var(--ds-text, #292A2E)"
|
|
190
|
-
})
|
|
191
|
-
}, 0]]]];
|
|
192
|
-
};
|
|
95
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* tasksAndDecisionsPlugin.tsx generated by @compiled/babel-plugin
|
|
1
|
+
/* tasksAndDecisionsPlugin.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
@@ -8,7 +8,9 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
8
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
10
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
+
import { decisionItem } from '@atlaskit/adf-schema/decision-item';
|
|
11
12
|
import { decisionList } from '@atlaskit/adf-schema/decision-list';
|
|
13
|
+
import { blockTaskItem, taskItem } from '@atlaskit/adf-schema/task-item';
|
|
12
14
|
import { taskList } from '@atlaskit/adf-schema/task-list';
|
|
13
15
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
14
16
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -21,8 +23,6 @@ import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
|
21
23
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
22
24
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
23
25
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
24
|
-
import { taskItemNodeSpec, blockTaskItemNodeSpec } from './nodeviews/taskItemNodeSpec';
|
|
25
|
-
import { decisionItemSpecWithFixedToDOM } from './nodeviews/toDOM-fixes/decisionItem';
|
|
26
26
|
import { closeRequestEditPopupAt, getCurrentIndentLevel, getTaskItemIndex, isInsideTask } from './pm-plugins/helpers';
|
|
27
27
|
// Ignored via go/ees005
|
|
28
28
|
// eslint-disable-next-line import/no-named-as-default
|
|
@@ -182,16 +182,16 @@ export var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref3) {
|
|
|
182
182
|
node: decisionList
|
|
183
183
|
}, {
|
|
184
184
|
name: 'decisionItem',
|
|
185
|
-
node:
|
|
185
|
+
node: decisionItem
|
|
186
186
|
}, {
|
|
187
187
|
name: 'taskList',
|
|
188
188
|
node: taskList
|
|
189
189
|
}, {
|
|
190
190
|
name: 'taskItem',
|
|
191
|
-
node:
|
|
191
|
+
node: taskItem
|
|
192
192
|
}].concat(_toConsumableArray(expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) && allowBlockTaskItem ? [{
|
|
193
193
|
name: 'blockTaskItem',
|
|
194
|
-
node:
|
|
194
|
+
node: blockTaskItem
|
|
195
195
|
}] : []));
|
|
196
196
|
},
|
|
197
197
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* RequestToEditPopup.tsx generated by @compiled/babel-plugin
|
|
1
|
+
/* RequestToEditPopup.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import "./RequestToEditPopup.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { DOMOutputSpec,
|
|
3
|
-
/**
|
|
4
|
-
* Wrapper for ADF taskItem node spec to augment toDOM implementation
|
|
5
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
6
|
-
* @nodeSpecException:toDOM patch
|
|
7
|
-
* @returns
|
|
8
|
-
* @example
|
|
9
|
-
*/
|
|
10
|
-
export declare const taskItemNodeSpec: () => NodeSpec;
|
|
11
|
-
/**
|
|
12
|
-
* Wrapper for ADF blockTaskItem node spec to augment toDOM implementation
|
|
13
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
14
|
-
* @nodeSpecException:toDOM patch
|
|
15
|
-
* @returns
|
|
16
|
-
* @example
|
|
17
|
-
*/
|
|
18
|
-
export declare const blockTaskItemNodeSpec: () => NodeSpec;
|
|
2
|
+
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
19
3
|
/**
|
|
20
4
|
* Converts a task item node to a DOM output specification.
|
|
21
5
|
* This is used for rendering the task item in the editor.
|
|
@@ -25,4 +9,3 @@ export declare const blockTaskItemNodeSpec: () => NodeSpec;
|
|
|
25
9
|
* @returns A DOMOutputSpec representing the task item.
|
|
26
10
|
*/
|
|
27
11
|
export declare function taskItemToDom(node: PMNode, placeholder: string, intl: IntlShape): DOMOutputSpec;
|
|
28
|
-
export declare const lazyTaskItemToDom: (node: PMNode) => DOMOutputSpec;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.7",
|
|
4
4
|
"description": "Tasks and decisions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@atlaskit/editor-plugin-toolbar": "^14.0.0",
|
|
33
33
|
"@atlaskit/editor-plugin-type-ahead": "^18.0.0",
|
|
34
34
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
35
|
-
"@atlaskit/editor-shared-styles": "^4.
|
|
35
|
+
"@atlaskit/editor-shared-styles": "^4.2.0",
|
|
36
36
|
"@atlaskit/editor-toolbar": "^2.6.0",
|
|
37
37
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
38
38
|
"@atlaskit/heading": "^7.2.0",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"@atlaskit/primitives": "^22.5.0",
|
|
43
43
|
"@atlaskit/prosemirror-input-rules": "^4.1.0",
|
|
44
44
|
"@atlaskit/task-decision": "^21.9.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
46
|
-
"@atlaskit/tokens": "^16.
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^186.0.0",
|
|
46
|
+
"@atlaskit/tokens": "^16.12.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@compiled/react": "^1.0.2",
|
|
49
49
|
"bind-event-listener": "^3.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@atlaskit/editor-common": "^121.
|
|
52
|
+
"@atlaskit/editor-common": "^121.4.0",
|
|
53
53
|
"react": "^18.2.0 || ^19.2.0",
|
|
54
54
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
55
55
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.decisionItemSpecWithFixedToDOM = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _decisionItem = require("@atlaskit/adf-schema/decision-item");
|
|
10
|
-
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
11
|
-
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
12
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
-
// @nodeSpecException:toDOM patch
|
|
15
|
-
var decisionItemSpecWithFixedToDOM = exports.decisionItemSpecWithFixedToDOM = function decisionItemSpecWithFixedToDOM() {
|
|
16
|
-
if ((0, _editorExperiment.editorExperiment)('platform_editor_exp_lazy_node_views', false)) {
|
|
17
|
-
return _decisionItem.decisionItem;
|
|
18
|
-
}
|
|
19
|
-
return _objectSpread(_objectSpread({}, _decisionItem.decisionItem), {}, {
|
|
20
|
-
toDOM: function toDOM(node) {
|
|
21
|
-
var _node$attrs = node.attrs,
|
|
22
|
-
localId = _node$attrs.localId,
|
|
23
|
-
state = _node$attrs.state;
|
|
24
|
-
var attrs = {
|
|
25
|
-
'data-decision-local-id': localId || 'local-decision',
|
|
26
|
-
'data-decision-state': state,
|
|
27
|
-
class: 'decisionItemView-content-wrap'
|
|
28
|
-
};
|
|
29
|
-
var showPlaceholder = node.content.size === 0;
|
|
30
|
-
return ['li', attrs, ['div', {
|
|
31
|
-
'data-decision-wrapper': true,
|
|
32
|
-
'data-testid': 'elements-decision-item',
|
|
33
|
-
// Styles to match `packages/elements/task-decision/src/components/styles.ts`
|
|
34
|
-
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
35
|
-
background: "var(--ds-background-neutral, #0515240F)",
|
|
36
|
-
padding: "var(--ds-space-100, 8px)",
|
|
37
|
-
paddingLeft: "var(--ds-space-150, 12px)",
|
|
38
|
-
margin: "var(--ds-space-100, 8px)".concat(" 0 0 0"),
|
|
39
|
-
display: 'flex',
|
|
40
|
-
borderRadius: "var(--ds-radius-small, 3px)"
|
|
41
|
-
})
|
|
42
|
-
}, ['span', {
|
|
43
|
-
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
44
|
-
width: '16px',
|
|
45
|
-
height: '16px',
|
|
46
|
-
margin: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-150, 12px)", " 0 0"),
|
|
47
|
-
color: showPlaceholder ? "var(--ds-icon-subtle, #505258)" : "var(--ds-icon-success, #6A9A23)",
|
|
48
|
-
display: 'flex',
|
|
49
|
-
alignItems: 'center',
|
|
50
|
-
justifyContent: 'center'
|
|
51
|
-
}),
|
|
52
|
-
contentEditable: 'false',
|
|
53
|
-
'data-component': 'icon'
|
|
54
|
-
}, ['span', {
|
|
55
|
-
role: 'img',
|
|
56
|
-
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
57
|
-
width: '32px',
|
|
58
|
-
height: '32px'
|
|
59
|
-
})
|
|
60
|
-
}, ['http://www.w3.org/2000/svg svg', {
|
|
61
|
-
viewBox: "0 0 24 24",
|
|
62
|
-
role: 'presentation',
|
|
63
|
-
width: '24',
|
|
64
|
-
height: '24',
|
|
65
|
-
'data-icon-source': 'legacy',
|
|
66
|
-
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
67
|
-
width: '32px',
|
|
68
|
-
height: '32px'
|
|
69
|
-
})
|
|
70
|
-
}, ['http://www.w3.org/2000/svg path', {
|
|
71
|
-
fill: 'currentcolor',
|
|
72
|
-
'fill-rule': 'evenodd',
|
|
73
|
-
d: 'm9.414 8 3.293 3.293c.187.187.293.442.293.707v5a1 1 0 0 1-2 0v-4.586l-3-3V10.5a1 1 0 0 1-2 0V7a1 1 0 0 1 1-1h3.5a1 1 0 0 1 0 2zm8.293-1.707a1 1 0 0 1 0 1.414l-2.5 2.5a.997.997 0 0 1-1.414 0 1 1 0 0 1 0-1.414l2.5-2.5a1 1 0 0 1 1.414 0'
|
|
74
|
-
}]]]], ['div', {
|
|
75
|
-
'data-component': 'content'
|
|
76
|
-
}, ['div', {
|
|
77
|
-
class: 'decision-item'
|
|
78
|
-
}, 0]]]];
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { decisionItem } from '@atlaskit/adf-schema/decision-item';
|
|
2
|
-
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
3
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
4
|
-
// @nodeSpecException:toDOM patch
|
|
5
|
-
export const decisionItemSpecWithFixedToDOM = () => {
|
|
6
|
-
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
7
|
-
return decisionItem;
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
...decisionItem,
|
|
11
|
-
toDOM: node => {
|
|
12
|
-
const {
|
|
13
|
-
localId,
|
|
14
|
-
state
|
|
15
|
-
} = node.attrs;
|
|
16
|
-
const attrs = {
|
|
17
|
-
'data-decision-local-id': localId || 'local-decision',
|
|
18
|
-
'data-decision-state': state,
|
|
19
|
-
class: 'decisionItemView-content-wrap'
|
|
20
|
-
};
|
|
21
|
-
const showPlaceholder = node.content.size === 0;
|
|
22
|
-
return ['li', attrs, ['div', {
|
|
23
|
-
'data-decision-wrapper': true,
|
|
24
|
-
'data-testid': 'elements-decision-item',
|
|
25
|
-
// Styles to match `packages/elements/task-decision/src/components/styles.ts`
|
|
26
|
-
style: convertToInlineCss({
|
|
27
|
-
background: "var(--ds-background-neutral, #0515240F)",
|
|
28
|
-
padding: "var(--ds-space-100, 8px)",
|
|
29
|
-
paddingLeft: "var(--ds-space-150, 12px)",
|
|
30
|
-
margin: `${"var(--ds-space-100, 8px)"} 0 0 0`,
|
|
31
|
-
display: 'flex',
|
|
32
|
-
borderRadius: "var(--ds-radius-small, 3px)"
|
|
33
|
-
})
|
|
34
|
-
}, ['span', {
|
|
35
|
-
style: convertToInlineCss({
|
|
36
|
-
width: '16px',
|
|
37
|
-
height: '16px',
|
|
38
|
-
margin: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-150, 12px)"} 0 0`,
|
|
39
|
-
color: showPlaceholder ? "var(--ds-icon-subtle, #505258)" : "var(--ds-icon-success, #6A9A23)",
|
|
40
|
-
display: 'flex',
|
|
41
|
-
alignItems: 'center',
|
|
42
|
-
justifyContent: 'center'
|
|
43
|
-
}),
|
|
44
|
-
contentEditable: 'false',
|
|
45
|
-
'data-component': 'icon'
|
|
46
|
-
}, ['span', {
|
|
47
|
-
role: 'img',
|
|
48
|
-
style: convertToInlineCss({
|
|
49
|
-
width: '32px',
|
|
50
|
-
height: '32px'
|
|
51
|
-
})
|
|
52
|
-
}, ['http://www.w3.org/2000/svg svg', {
|
|
53
|
-
viewBox: `0 0 24 24`,
|
|
54
|
-
role: 'presentation',
|
|
55
|
-
width: '24',
|
|
56
|
-
height: '24',
|
|
57
|
-
'data-icon-source': 'legacy',
|
|
58
|
-
style: convertToInlineCss({
|
|
59
|
-
width: '32px',
|
|
60
|
-
height: '32px'
|
|
61
|
-
})
|
|
62
|
-
}, ['http://www.w3.org/2000/svg path', {
|
|
63
|
-
fill: 'currentcolor',
|
|
64
|
-
'fill-rule': 'evenodd',
|
|
65
|
-
d: 'm9.414 8 3.293 3.293c.187.187.293.442.293.707v5a1 1 0 0 1-2 0v-4.586l-3-3V10.5a1 1 0 0 1-2 0V7a1 1 0 0 1 1-1h3.5a1 1 0 0 1 0 2zm8.293-1.707a1 1 0 0 1 0 1.414l-2.5 2.5a.997.997 0 0 1-1.414 0 1 1 0 0 1 0-1.414l2.5-2.5a1 1 0 0 1 1.414 0'
|
|
66
|
-
}]]]], ['div', {
|
|
67
|
-
'data-component': 'content'
|
|
68
|
-
}, ['div', {
|
|
69
|
-
class: 'decision-item'
|
|
70
|
-
}, 0]]]];
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { decisionItem } from '@atlaskit/adf-schema/decision-item';
|
|
5
|
-
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
6
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
7
|
-
// @nodeSpecException:toDOM patch
|
|
8
|
-
export var decisionItemSpecWithFixedToDOM = function decisionItemSpecWithFixedToDOM() {
|
|
9
|
-
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
10
|
-
return decisionItem;
|
|
11
|
-
}
|
|
12
|
-
return _objectSpread(_objectSpread({}, decisionItem), {}, {
|
|
13
|
-
toDOM: function toDOM(node) {
|
|
14
|
-
var _node$attrs = node.attrs,
|
|
15
|
-
localId = _node$attrs.localId,
|
|
16
|
-
state = _node$attrs.state;
|
|
17
|
-
var attrs = {
|
|
18
|
-
'data-decision-local-id': localId || 'local-decision',
|
|
19
|
-
'data-decision-state': state,
|
|
20
|
-
class: 'decisionItemView-content-wrap'
|
|
21
|
-
};
|
|
22
|
-
var showPlaceholder = node.content.size === 0;
|
|
23
|
-
return ['li', attrs, ['div', {
|
|
24
|
-
'data-decision-wrapper': true,
|
|
25
|
-
'data-testid': 'elements-decision-item',
|
|
26
|
-
// Styles to match `packages/elements/task-decision/src/components/styles.ts`
|
|
27
|
-
style: convertToInlineCss({
|
|
28
|
-
background: "var(--ds-background-neutral, #0515240F)",
|
|
29
|
-
padding: "var(--ds-space-100, 8px)",
|
|
30
|
-
paddingLeft: "var(--ds-space-150, 12px)",
|
|
31
|
-
margin: "var(--ds-space-100, 8px)".concat(" 0 0 0"),
|
|
32
|
-
display: 'flex',
|
|
33
|
-
borderRadius: "var(--ds-radius-small, 3px)"
|
|
34
|
-
})
|
|
35
|
-
}, ['span', {
|
|
36
|
-
style: convertToInlineCss({
|
|
37
|
-
width: '16px',
|
|
38
|
-
height: '16px',
|
|
39
|
-
margin: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-150, 12px)", " 0 0"),
|
|
40
|
-
color: showPlaceholder ? "var(--ds-icon-subtle, #505258)" : "var(--ds-icon-success, #6A9A23)",
|
|
41
|
-
display: 'flex',
|
|
42
|
-
alignItems: 'center',
|
|
43
|
-
justifyContent: 'center'
|
|
44
|
-
}),
|
|
45
|
-
contentEditable: 'false',
|
|
46
|
-
'data-component': 'icon'
|
|
47
|
-
}, ['span', {
|
|
48
|
-
role: 'img',
|
|
49
|
-
style: convertToInlineCss({
|
|
50
|
-
width: '32px',
|
|
51
|
-
height: '32px'
|
|
52
|
-
})
|
|
53
|
-
}, ['http://www.w3.org/2000/svg svg', {
|
|
54
|
-
viewBox: "0 0 24 24",
|
|
55
|
-
role: 'presentation',
|
|
56
|
-
width: '24',
|
|
57
|
-
height: '24',
|
|
58
|
-
'data-icon-source': 'legacy',
|
|
59
|
-
style: convertToInlineCss({
|
|
60
|
-
width: '32px',
|
|
61
|
-
height: '32px'
|
|
62
|
-
})
|
|
63
|
-
}, ['http://www.w3.org/2000/svg path', {
|
|
64
|
-
fill: 'currentcolor',
|
|
65
|
-
'fill-rule': 'evenodd',
|
|
66
|
-
d: 'm9.414 8 3.293 3.293c.187.187.293.442.293.707v5a1 1 0 0 1-2 0v-4.586l-3-3V10.5a1 1 0 0 1-2 0V7a1 1 0 0 1 1-1h3.5a1 1 0 0 1 0 2zm8.293-1.707a1 1 0 0 1 0 1.414l-2.5 2.5a.997.997 0 0 1-1.414 0 1 1 0 0 1 0-1.414l2.5-2.5a1 1 0 0 1 1.414 0'
|
|
67
|
-
}]]]], ['div', {
|
|
68
|
-
'data-component': 'content'
|
|
69
|
-
}, ['div', {
|
|
70
|
-
class: 'decision-item'
|
|
71
|
-
}, 0]]]];
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
};
|