@atlaskit/editor-plugin-tasks-and-decisions 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 2.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#141679](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/141679)
|
|
8
|
+
[`b005c6bc8be60`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b005c6bc8be60) -
|
|
9
|
+
improve decision item on SSR
|
|
10
|
+
|
|
3
11
|
## 2.5.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -8,12 +8,13 @@ exports.decisionItemSpecWithFixedToDOM = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
10
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
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; }
|
|
13
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; }
|
|
14
15
|
// @nodeSpecException:toDOM patch
|
|
15
16
|
var decisionItemSpecWithFixedToDOM = exports.decisionItemSpecWithFixedToDOM = function decisionItemSpecWithFixedToDOM() {
|
|
16
|
-
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false)) {
|
|
17
|
+
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) && !(0, _platformFeatureFlags.fg)('platform_editor_action_decisions_ssr_fix')) {
|
|
17
18
|
return _adfSchema.decisionItem;
|
|
18
19
|
}
|
|
19
20
|
return _objectSpread(_objectSpread({}, _adfSchema.decisionItem), {}, {
|
|
@@ -24,26 +25,53 @@ var decisionItemSpecWithFixedToDOM = exports.decisionItemSpecWithFixedToDOM = fu
|
|
|
24
25
|
var attrs = {
|
|
25
26
|
'data-decision-local-id': localId || 'local-decision',
|
|
26
27
|
'data-decision-state': state,
|
|
27
|
-
class: 'decisionItemView-content-wrap'
|
|
28
|
+
class: 'decisionItemView-content-wrap'
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// TODO: can copy raw SVG from DST later
|
|
32
|
+
var decisionItemIcon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
33
|
+
decisionItemIcon.setAttribute('width', '24');
|
|
34
|
+
decisionItemIcon.setAttribute('height', '24');
|
|
35
|
+
decisionItemIcon.setAttribute('viewBox', '0 0 24 24');
|
|
36
|
+
decisionItemIcon.setAttribute('role', 'presentation');
|
|
37
|
+
var decisionItemSvgPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
38
|
+
decisionItemSvgPath.setAttribute('fill', 'currentColor');
|
|
39
|
+
decisionItemSvgPath.setAttribute('fill-rule', 'evenodd');
|
|
40
|
+
decisionItemSvgPath.setAttribute('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');
|
|
41
|
+
decisionItemIcon.setAttribute('style', (0, _lazyNodeView.convertToInlineCss)({
|
|
42
|
+
width: '32px',
|
|
43
|
+
height: '32px'
|
|
44
|
+
}));
|
|
45
|
+
decisionItemIcon.appendChild(decisionItemSvgPath);
|
|
46
|
+
var showPlaceholder = node.content.size === 0;
|
|
47
|
+
return ['li', attrs, ['div', {
|
|
48
|
+
'data-decision-wrapper': true,
|
|
49
|
+
'data-testid': 'elements-decision-item',
|
|
28
50
|
// Styles to match `packages/elements/task-decision/src/components/styles.ts`
|
|
29
51
|
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
30
|
-
background: "var(--ds-background-neutral,
|
|
52
|
+
background: "var(--ds-background-neutral, #091E420F)",
|
|
31
53
|
padding: "var(--ds-space-100, 8px)",
|
|
54
|
+
paddingLeft: "var(--ds-space-150, 12px)",
|
|
32
55
|
margin: "var(--ds-space-100, 8px)".concat(" 0 0 0"),
|
|
33
56
|
display: 'flex',
|
|
34
|
-
borderRadius: "var(--ds-border-radius,
|
|
57
|
+
borderRadius: "var(--ds-border-radius-100, 3px)"
|
|
35
58
|
})
|
|
36
|
-
}
|
|
37
|
-
return ['li', attrs, ['span', {
|
|
59
|
+
}, ['span', {
|
|
38
60
|
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
39
61
|
width: '16px',
|
|
40
62
|
height: '16px',
|
|
41
|
-
margin: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-
|
|
63
|
+
margin: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-150, 12px)", " 0 0"),
|
|
64
|
+
color: showPlaceholder ? "var(--ds-icon-subtle, #626F86)" : "var(--ds-icon-success, #22A06B)"
|
|
65
|
+
}),
|
|
66
|
+
contentEditable: 'false'
|
|
67
|
+
}, ['span', {
|
|
68
|
+
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
69
|
+
margin: "var(--ds-space-negative-100, -8px)",
|
|
70
|
+
display: 'inline-block',
|
|
71
|
+
width: '32px',
|
|
72
|
+
height: '32px'
|
|
42
73
|
})
|
|
43
|
-
}], ['div', {
|
|
44
|
-
'data-decision-wrapper': true,
|
|
45
|
-
'data-testid': 'elements-decision-item'
|
|
46
|
-
}, ['div', {
|
|
74
|
+
}, decisionItemIcon]], ['div', {
|
|
47
75
|
'data-component': 'content'
|
|
48
76
|
}, ['div', {
|
|
49
77
|
class: 'decision-item'
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { decisionItem } from '@atlaskit/adf-schema';
|
|
2
2
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
5
|
// @nodeSpecException:toDOM patch
|
|
5
6
|
export const decisionItemSpecWithFixedToDOM = () => {
|
|
6
|
-
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
7
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false) && !fg('platform_editor_action_decisions_ssr_fix')) {
|
|
7
8
|
return decisionItem;
|
|
8
9
|
}
|
|
9
10
|
return {
|
|
@@ -16,26 +17,53 @@ export const decisionItemSpecWithFixedToDOM = () => {
|
|
|
16
17
|
const attrs = {
|
|
17
18
|
'data-decision-local-id': localId || 'local-decision',
|
|
18
19
|
'data-decision-state': state,
|
|
19
|
-
class: 'decisionItemView-content-wrap'
|
|
20
|
+
class: 'decisionItemView-content-wrap'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// TODO: can copy raw SVG from DST later
|
|
24
|
+
const decisionItemIcon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
25
|
+
decisionItemIcon.setAttribute('width', '24');
|
|
26
|
+
decisionItemIcon.setAttribute('height', '24');
|
|
27
|
+
decisionItemIcon.setAttribute('viewBox', '0 0 24 24');
|
|
28
|
+
decisionItemIcon.setAttribute('role', 'presentation');
|
|
29
|
+
const decisionItemSvgPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
30
|
+
decisionItemSvgPath.setAttribute('fill', 'currentColor');
|
|
31
|
+
decisionItemSvgPath.setAttribute('fill-rule', 'evenodd');
|
|
32
|
+
decisionItemSvgPath.setAttribute('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');
|
|
33
|
+
decisionItemIcon.setAttribute('style', convertToInlineCss({
|
|
34
|
+
width: '32px',
|
|
35
|
+
height: '32px'
|
|
36
|
+
}));
|
|
37
|
+
decisionItemIcon.appendChild(decisionItemSvgPath);
|
|
38
|
+
const showPlaceholder = node.content.size === 0;
|
|
39
|
+
return ['li', attrs, ['div', {
|
|
40
|
+
'data-decision-wrapper': true,
|
|
41
|
+
'data-testid': 'elements-decision-item',
|
|
20
42
|
// Styles to match `packages/elements/task-decision/src/components/styles.ts`
|
|
21
43
|
style: convertToInlineCss({
|
|
22
|
-
background: "var(--ds-background-neutral,
|
|
44
|
+
background: "var(--ds-background-neutral, #091E420F)",
|
|
23
45
|
padding: "var(--ds-space-100, 8px)",
|
|
46
|
+
paddingLeft: "var(--ds-space-150, 12px)",
|
|
24
47
|
margin: `${"var(--ds-space-100, 8px)"} 0 0 0`,
|
|
25
48
|
display: 'flex',
|
|
26
|
-
borderRadius: "var(--ds-border-radius,
|
|
49
|
+
borderRadius: "var(--ds-border-radius-100, 3px)"
|
|
27
50
|
})
|
|
28
|
-
}
|
|
29
|
-
return ['li', attrs, ['span', {
|
|
51
|
+
}, ['span', {
|
|
30
52
|
style: convertToInlineCss({
|
|
31
53
|
width: '16px',
|
|
32
54
|
height: '16px',
|
|
33
|
-
margin: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-
|
|
55
|
+
margin: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-150, 12px)"} 0 0`,
|
|
56
|
+
color: showPlaceholder ? "var(--ds-icon-subtle, #626F86)" : "var(--ds-icon-success, #22A06B)"
|
|
57
|
+
}),
|
|
58
|
+
contentEditable: 'false'
|
|
59
|
+
}, ['span', {
|
|
60
|
+
style: convertToInlineCss({
|
|
61
|
+
margin: "var(--ds-space-negative-100, -8px)",
|
|
62
|
+
display: 'inline-block',
|
|
63
|
+
width: '32px',
|
|
64
|
+
height: '32px'
|
|
34
65
|
})
|
|
35
|
-
}], ['div', {
|
|
36
|
-
'data-decision-wrapper': true,
|
|
37
|
-
'data-testid': 'elements-decision-item'
|
|
38
|
-
}, ['div', {
|
|
66
|
+
}, decisionItemIcon]], ['div', {
|
|
39
67
|
'data-component': 'content'
|
|
40
68
|
}, ['div', {
|
|
41
69
|
class: 'decision-item'
|
|
@@ -3,10 +3,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
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
4
|
import { decisionItem } from '@atlaskit/adf-schema';
|
|
5
5
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
// @nodeSpecException:toDOM patch
|
|
8
9
|
export var decisionItemSpecWithFixedToDOM = function decisionItemSpecWithFixedToDOM() {
|
|
9
|
-
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
10
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false) && !fg('platform_editor_action_decisions_ssr_fix')) {
|
|
10
11
|
return decisionItem;
|
|
11
12
|
}
|
|
12
13
|
return _objectSpread(_objectSpread({}, decisionItem), {}, {
|
|
@@ -17,26 +18,53 @@ export var decisionItemSpecWithFixedToDOM = function decisionItemSpecWithFixedTo
|
|
|
17
18
|
var attrs = {
|
|
18
19
|
'data-decision-local-id': localId || 'local-decision',
|
|
19
20
|
'data-decision-state': state,
|
|
20
|
-
class: 'decisionItemView-content-wrap'
|
|
21
|
+
class: 'decisionItemView-content-wrap'
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// TODO: can copy raw SVG from DST later
|
|
25
|
+
var decisionItemIcon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
26
|
+
decisionItemIcon.setAttribute('width', '24');
|
|
27
|
+
decisionItemIcon.setAttribute('height', '24');
|
|
28
|
+
decisionItemIcon.setAttribute('viewBox', '0 0 24 24');
|
|
29
|
+
decisionItemIcon.setAttribute('role', 'presentation');
|
|
30
|
+
var decisionItemSvgPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
31
|
+
decisionItemSvgPath.setAttribute('fill', 'currentColor');
|
|
32
|
+
decisionItemSvgPath.setAttribute('fill-rule', 'evenodd');
|
|
33
|
+
decisionItemSvgPath.setAttribute('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');
|
|
34
|
+
decisionItemIcon.setAttribute('style', convertToInlineCss({
|
|
35
|
+
width: '32px',
|
|
36
|
+
height: '32px'
|
|
37
|
+
}));
|
|
38
|
+
decisionItemIcon.appendChild(decisionItemSvgPath);
|
|
39
|
+
var showPlaceholder = node.content.size === 0;
|
|
40
|
+
return ['li', attrs, ['div', {
|
|
41
|
+
'data-decision-wrapper': true,
|
|
42
|
+
'data-testid': 'elements-decision-item',
|
|
21
43
|
// Styles to match `packages/elements/task-decision/src/components/styles.ts`
|
|
22
44
|
style: convertToInlineCss({
|
|
23
|
-
background: "var(--ds-background-neutral,
|
|
45
|
+
background: "var(--ds-background-neutral, #091E420F)",
|
|
24
46
|
padding: "var(--ds-space-100, 8px)",
|
|
47
|
+
paddingLeft: "var(--ds-space-150, 12px)",
|
|
25
48
|
margin: "var(--ds-space-100, 8px)".concat(" 0 0 0"),
|
|
26
49
|
display: 'flex',
|
|
27
|
-
borderRadius: "var(--ds-border-radius,
|
|
50
|
+
borderRadius: "var(--ds-border-radius-100, 3px)"
|
|
28
51
|
})
|
|
29
|
-
}
|
|
30
|
-
return ['li', attrs, ['span', {
|
|
52
|
+
}, ['span', {
|
|
31
53
|
style: convertToInlineCss({
|
|
32
54
|
width: '16px',
|
|
33
55
|
height: '16px',
|
|
34
|
-
margin: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-
|
|
56
|
+
margin: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-150, 12px)", " 0 0"),
|
|
57
|
+
color: showPlaceholder ? "var(--ds-icon-subtle, #626F86)" : "var(--ds-icon-success, #22A06B)"
|
|
58
|
+
}),
|
|
59
|
+
contentEditable: 'false'
|
|
60
|
+
}, ['span', {
|
|
61
|
+
style: convertToInlineCss({
|
|
62
|
+
margin: "var(--ds-space-negative-100, -8px)",
|
|
63
|
+
display: 'inline-block',
|
|
64
|
+
width: '32px',
|
|
65
|
+
height: '32px'
|
|
35
66
|
})
|
|
36
|
-
}], ['div', {
|
|
37
|
-
'data-decision-wrapper': true,
|
|
38
|
-
'data-testid': 'elements-decision-item'
|
|
39
|
-
}, ['div', {
|
|
67
|
+
}, decisionItemIcon]], ['div', {
|
|
40
68
|
'data-component': 'content'
|
|
41
69
|
}, ['div', {
|
|
42
70
|
class: 'decision-item'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Tasks and decisions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
35
35
|
"@atlaskit/analytics-namespaced-context": "^6.12.0",
|
|
36
36
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
37
|
-
"@atlaskit/editor-common": "^89.
|
|
37
|
+
"@atlaskit/editor-common": "^89.3.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
39
39
|
"@atlaskit/editor-plugin-context-identifier": "^1.3.0",
|
|
40
40
|
"@atlaskit/editor-plugin-type-ahead": "^1.8.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
42
42
|
"@atlaskit/icon": "^22.18.0",
|
|
43
|
-
"@atlaskit/platform-feature-flags": "0.3.0",
|
|
43
|
+
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
44
44
|
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
|
45
45
|
"@atlaskit/task-decision": "^17.10.0",
|
|
46
46
|
"@atlaskit/tmp-editor-statsig": "^2.1.8",
|
|
47
|
-
"@atlaskit/tokens": "^1.
|
|
47
|
+
"@atlaskit/tokens": "^1.60.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"@emotion/react": "^11.7.1"
|
|
50
50
|
},
|
|
@@ -99,6 +99,9 @@
|
|
|
99
99
|
"platform-feature-flags": {
|
|
100
100
|
"editor_request_to_edit_task": {
|
|
101
101
|
"type": "boolean"
|
|
102
|
+
},
|
|
103
|
+
"platform_editor_action_decisions_ssr_fix": {
|
|
104
|
+
"type": "boolean"
|
|
102
105
|
}
|
|
103
106
|
}
|
|
104
107
|
}
|