@atlaskit/editor-plugin-tasks-and-decisions 21.0.4 → 21.0.6
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 +16 -0
- package/dist/cjs/pm-plugins/commands.js +1 -2
- package/dist/cjs/pm-plugins/keymaps.js +0 -3
- package/dist/cjs/pm-plugins/utils/paste.js +2 -20
- package/dist/es2019/pm-plugins/commands.js +1 -2
- package/dist/es2019/pm-plugins/keymaps.js +0 -3
- package/dist/es2019/pm-plugins/utils/paste.js +0 -20
- package/dist/esm/pm-plugins/commands.js +1 -2
- package/dist/esm/pm-plugins/keymaps.js +0 -3
- package/dist/esm/pm-plugins/utils/paste.js +2 -21
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 21.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9e6211ceb4ceb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9e6211ceb4ceb) -
|
|
8
|
+
Clean up the fully rolled-out `platform_editor_small_font_size` experiment and make its permanent
|
|
9
|
+
`true` behavior unconditional across editor formatting, task and list handling, paste behavior,
|
|
10
|
+
controls, and rendering.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 21.0.5
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 21.0.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -8,7 +8,6 @@ var _commands = require("@atlaskit/editor-common/commands");
|
|
|
8
8
|
var _lists = require("@atlaskit/editor-common/lists");
|
|
9
9
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
10
10
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
11
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
12
11
|
var _helpers = require("./helpers");
|
|
13
12
|
var _utils = require("./utils");
|
|
14
13
|
var _paste = require("./utils/paste");
|
|
@@ -148,7 +147,7 @@ var joinAtCut = exports.joinAtCut = function joinAtCut($pos) {
|
|
|
148
147
|
// see https://prosemirror.net/docs/ref/#transform.ReplaceStep.constructor
|
|
149
148
|
// see https://prosemirror.net/docs/ref/#transform.ReplaceAroundStep.constructor
|
|
150
149
|
var tr = state.tr.step(new _transform.ReplaceAroundStep(from, to, gapFrom, gapTo, slice, insert, true));
|
|
151
|
-
if (fontSize
|
|
150
|
+
if (fontSize) {
|
|
152
151
|
var targetTaskListSmallTextAttrs = (0, _lists.getFirstParagraphBlockMarkAttrs)($cut.nodeBefore, fontSize);
|
|
153
152
|
var followingListPos = $cut.pos + $cut.nodeAfter.nodeSize;
|
|
154
153
|
var followingListNode = state.doc.resolve(followingListPos).nodeAfter;
|
|
@@ -499,9 +499,6 @@ var creatParentListItemFragement = function creatParentListItemFragement(state)
|
|
|
499
499
|
return state.schema.nodes.listItem.create({}, state.schema.nodes.paragraph.create());
|
|
500
500
|
};
|
|
501
501
|
var getCurrentBlockTaskFontSizeAttrs = function getCurrentBlockTaskFontSizeAttrs(state, $from) {
|
|
502
|
-
if (!(0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true)) {
|
|
503
|
-
return false;
|
|
504
|
-
}
|
|
505
502
|
var fontSize = state.schema.marks.fontSize;
|
|
506
503
|
if (!fontSize) {
|
|
507
504
|
return false;
|
|
@@ -10,7 +10,6 @@ var _uuid = require("@atlaskit/adf-schema/uuid");
|
|
|
10
10
|
var _lists = require("@atlaskit/editor-common/lists");
|
|
11
11
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
12
12
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
13
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
13
|
/**
|
|
15
14
|
* Transforms a paste slice to handle blockTaskItem nodes when pasting into task items.
|
|
16
15
|
*
|
|
@@ -135,24 +134,11 @@ var transformSliceContent = function transformSliceContent(slice, transformNode)
|
|
|
135
134
|
}
|
|
136
135
|
return slice;
|
|
137
136
|
};
|
|
138
|
-
var
|
|
139
|
-
var schema = view.state.schema;
|
|
137
|
+
var _normalizeNodeForTaskTextSize = exports.normalizeNodeForTaskTextSize = function normalizeNodeForTaskTextSize(node, schema, smallTextAttrs) {
|
|
140
138
|
var _schema$nodes3 = schema.nodes,
|
|
139
|
+
taskList = _schema$nodes3.taskList,
|
|
141
140
|
taskItem = _schema$nodes3.taskItem,
|
|
142
141
|
blockTaskItem = _schema$nodes3.blockTaskItem;
|
|
143
|
-
var isInTaskItem = view.state.selection.$from.node().type === taskItem;
|
|
144
|
-
if (!isInTaskItem || !blockTaskItem) {
|
|
145
|
-
return slice;
|
|
146
|
-
}
|
|
147
|
-
return transformSliceContent(slice, function (node) {
|
|
148
|
-
return normalizeBlockTaskItemToTaskItems(node, schema);
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
var _normalizeNodeForTaskTextSize = exports.normalizeNodeForTaskTextSize = function normalizeNodeForTaskTextSize(node, schema, smallTextAttrs) {
|
|
152
|
-
var _schema$nodes4 = schema.nodes,
|
|
153
|
-
taskList = _schema$nodes4.taskList,
|
|
154
|
-
taskItem = _schema$nodes4.taskItem,
|
|
155
|
-
blockTaskItem = _schema$nodes4.blockTaskItem;
|
|
156
142
|
var fontSize = schema.marks.fontSize;
|
|
157
143
|
if (!smallTextAttrs) {
|
|
158
144
|
return [node];
|
|
@@ -181,10 +167,6 @@ var normalizeNodeForTaskPaste = function normalizeNodeForTaskPaste(node, schema,
|
|
|
181
167
|
return normalizeBlockTaskItemToTaskItems(node, schema);
|
|
182
168
|
};
|
|
183
169
|
var tempTransformSliceToRemoveBlockTaskItem = exports.tempTransformSliceToRemoveBlockTaskItem = function tempTransformSliceToRemoveBlockTaskItem(slice, view) {
|
|
184
|
-
var fontSizeExperimentEnabled = (0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true);
|
|
185
|
-
if (!fontSizeExperimentEnabled) {
|
|
186
|
-
return transformSliceToRemoveBlockTaskItemLegacy(slice, view);
|
|
187
|
-
}
|
|
188
170
|
var blockTaskItem = view.state.schema.nodes.blockTaskItem;
|
|
189
171
|
var _getTaskPasteContext = getTaskPasteContext(view),
|
|
190
172
|
isInTaskContext = _getTaskPasteContext.isInTaskContext,
|
|
@@ -2,7 +2,6 @@ import { findCutBefore } from '@atlaskit/editor-common/commands';
|
|
|
2
2
|
import { getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists';
|
|
3
3
|
import { isTaskList } from '@atlaskit/editor-common/transforms';
|
|
4
4
|
import { findWrapping, ReplaceAroundStep } from '@atlaskit/editor-prosemirror/transform';
|
|
5
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
5
|
import { getBlockRange, isActionOrDecisionItem, isActionOrDecisionList, liftBlock, subtreeHeight } from './helpers';
|
|
7
6
|
import { findBlockTaskItem, normalizeTaskItemsSelection } from './utils';
|
|
8
7
|
import { normalizeNodeForTaskTextSize } from './utils/paste';
|
|
@@ -153,7 +152,7 @@ export const joinAtCut = $pos => (state, dispatch) => {
|
|
|
153
152
|
// see https://prosemirror.net/docs/ref/#transform.ReplaceStep.constructor
|
|
154
153
|
// see https://prosemirror.net/docs/ref/#transform.ReplaceAroundStep.constructor
|
|
155
154
|
let tr = state.tr.step(new ReplaceAroundStep(from, to, gapFrom, gapTo, slice, insert, true));
|
|
156
|
-
if (fontSize
|
|
155
|
+
if (fontSize) {
|
|
157
156
|
const targetTaskListSmallTextAttrs = getFirstParagraphBlockMarkAttrs($cut.nodeBefore, fontSize);
|
|
158
157
|
const followingListPos = $cut.pos + $cut.nodeAfter.nodeSize;
|
|
159
158
|
const followingListNode = state.doc.resolve(followingListPos).nodeAfter;
|
|
@@ -479,9 +479,6 @@ const creatParentListItemFragement = state => {
|
|
|
479
479
|
return state.schema.nodes.listItem.create({}, state.schema.nodes.paragraph.create());
|
|
480
480
|
};
|
|
481
481
|
const getCurrentBlockTaskFontSizeAttrs = (state, $from) => {
|
|
482
|
-
if (!expValEquals('platform_editor_small_font_size', 'isEnabled', true)) {
|
|
483
|
-
return false;
|
|
484
|
-
}
|
|
485
482
|
const {
|
|
486
483
|
fontSize
|
|
487
484
|
} = state.schema.marks;
|
|
@@ -2,8 +2,6 @@ import { uuid } from '@atlaskit/adf-schema/uuid';
|
|
|
2
2
|
import { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists';
|
|
3
3
|
import { createBlockTaskItem, isTaskList } from '@atlaskit/editor-common/transforms';
|
|
4
4
|
import { Slice, Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
|
-
|
|
7
5
|
/**
|
|
8
6
|
* Transforms a paste slice to handle blockTaskItem nodes when pasting into task items.
|
|
9
7
|
*
|
|
@@ -135,20 +133,6 @@ const transformSliceContent = (slice, transformNode) => {
|
|
|
135
133
|
}
|
|
136
134
|
return slice;
|
|
137
135
|
};
|
|
138
|
-
const transformSliceToRemoveBlockTaskItemLegacy = (slice, view) => {
|
|
139
|
-
const {
|
|
140
|
-
schema
|
|
141
|
-
} = view.state;
|
|
142
|
-
const {
|
|
143
|
-
taskItem,
|
|
144
|
-
blockTaskItem
|
|
145
|
-
} = schema.nodes;
|
|
146
|
-
const isInTaskItem = view.state.selection.$from.node().type === taskItem;
|
|
147
|
-
if (!isInTaskItem || !blockTaskItem) {
|
|
148
|
-
return slice;
|
|
149
|
-
}
|
|
150
|
-
return transformSliceContent(slice, node => normalizeBlockTaskItemToTaskItems(node, schema));
|
|
151
|
-
};
|
|
152
136
|
export const normalizeNodeForTaskTextSize = (node, schema, smallTextAttrs) => {
|
|
153
137
|
const {
|
|
154
138
|
taskList,
|
|
@@ -185,10 +169,6 @@ const normalizeNodeForTaskPaste = (node, schema, smallTextAttrs) => {
|
|
|
185
169
|
return normalizeBlockTaskItemToTaskItems(node, schema);
|
|
186
170
|
};
|
|
187
171
|
export const tempTransformSliceToRemoveBlockTaskItem = (slice, view) => {
|
|
188
|
-
const fontSizeExperimentEnabled = expValEquals('platform_editor_small_font_size', 'isEnabled', true);
|
|
189
|
-
if (!fontSizeExperimentEnabled) {
|
|
190
|
-
return transformSliceToRemoveBlockTaskItemLegacy(slice, view);
|
|
191
|
-
}
|
|
192
172
|
const {
|
|
193
173
|
blockTaskItem
|
|
194
174
|
} = view.state.schema.nodes;
|
|
@@ -2,7 +2,6 @@ import { findCutBefore } from '@atlaskit/editor-common/commands';
|
|
|
2
2
|
import { getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists';
|
|
3
3
|
import { isTaskList } from '@atlaskit/editor-common/transforms';
|
|
4
4
|
import { findWrapping, ReplaceAroundStep } from '@atlaskit/editor-prosemirror/transform';
|
|
5
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
5
|
import { getBlockRange, isActionOrDecisionItem, isActionOrDecisionList, liftBlock, subtreeHeight } from './helpers';
|
|
7
6
|
import { findBlockTaskItem, normalizeTaskItemsSelection } from './utils';
|
|
8
7
|
import { normalizeNodeForTaskTextSize } from './utils/paste';
|
|
@@ -142,7 +141,7 @@ export var joinAtCut = function joinAtCut($pos) {
|
|
|
142
141
|
// see https://prosemirror.net/docs/ref/#transform.ReplaceStep.constructor
|
|
143
142
|
// see https://prosemirror.net/docs/ref/#transform.ReplaceAroundStep.constructor
|
|
144
143
|
var tr = state.tr.step(new ReplaceAroundStep(from, to, gapFrom, gapTo, slice, insert, true));
|
|
145
|
-
if (fontSize
|
|
144
|
+
if (fontSize) {
|
|
146
145
|
var targetTaskListSmallTextAttrs = getFirstParagraphBlockMarkAttrs($cut.nodeBefore, fontSize);
|
|
147
146
|
var followingListPos = $cut.pos + $cut.nodeAfter.nodeSize;
|
|
148
147
|
var followingListNode = state.doc.resolve(followingListPos).nodeAfter;
|
|
@@ -491,9 +491,6 @@ var creatParentListItemFragement = function creatParentListItemFragement(state)
|
|
|
491
491
|
return state.schema.nodes.listItem.create({}, state.schema.nodes.paragraph.create());
|
|
492
492
|
};
|
|
493
493
|
var getCurrentBlockTaskFontSizeAttrs = function getCurrentBlockTaskFontSizeAttrs(state, $from) {
|
|
494
|
-
if (!expValEquals('platform_editor_small_font_size', 'isEnabled', true)) {
|
|
495
|
-
return false;
|
|
496
|
-
}
|
|
497
494
|
var fontSize = state.schema.marks.fontSize;
|
|
498
495
|
if (!fontSize) {
|
|
499
496
|
return false;
|
|
@@ -3,8 +3,6 @@ import { uuid } from '@atlaskit/adf-schema/uuid';
|
|
|
3
3
|
import { getBlockMarkAttrs, getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists';
|
|
4
4
|
import { createBlockTaskItem, isTaskList } from '@atlaskit/editor-common/transforms';
|
|
5
5
|
import { Slice, Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* Transforms a paste slice to handle blockTaskItem nodes when pasting into task items.
|
|
10
8
|
*
|
|
@@ -129,24 +127,11 @@ var transformSliceContent = function transformSliceContent(slice, transformNode)
|
|
|
129
127
|
}
|
|
130
128
|
return slice;
|
|
131
129
|
};
|
|
132
|
-
var
|
|
133
|
-
var schema = view.state.schema;
|
|
130
|
+
var _normalizeNodeForTaskTextSize = function normalizeNodeForTaskTextSize(node, schema, smallTextAttrs) {
|
|
134
131
|
var _schema$nodes3 = schema.nodes,
|
|
132
|
+
taskList = _schema$nodes3.taskList,
|
|
135
133
|
taskItem = _schema$nodes3.taskItem,
|
|
136
134
|
blockTaskItem = _schema$nodes3.blockTaskItem;
|
|
137
|
-
var isInTaskItem = view.state.selection.$from.node().type === taskItem;
|
|
138
|
-
if (!isInTaskItem || !blockTaskItem) {
|
|
139
|
-
return slice;
|
|
140
|
-
}
|
|
141
|
-
return transformSliceContent(slice, function (node) {
|
|
142
|
-
return normalizeBlockTaskItemToTaskItems(node, schema);
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
var _normalizeNodeForTaskTextSize = function normalizeNodeForTaskTextSize(node, schema, smallTextAttrs) {
|
|
146
|
-
var _schema$nodes4 = schema.nodes,
|
|
147
|
-
taskList = _schema$nodes4.taskList,
|
|
148
|
-
taskItem = _schema$nodes4.taskItem,
|
|
149
|
-
blockTaskItem = _schema$nodes4.blockTaskItem;
|
|
150
135
|
var fontSize = schema.marks.fontSize;
|
|
151
136
|
if (!smallTextAttrs) {
|
|
152
137
|
return [node];
|
|
@@ -176,10 +161,6 @@ var normalizeNodeForTaskPaste = function normalizeNodeForTaskPaste(node, schema,
|
|
|
176
161
|
return normalizeBlockTaskItemToTaskItems(node, schema);
|
|
177
162
|
};
|
|
178
163
|
export var tempTransformSliceToRemoveBlockTaskItem = function tempTransformSliceToRemoveBlockTaskItem(slice, view) {
|
|
179
|
-
var fontSizeExperimentEnabled = expValEquals('platform_editor_small_font_size', 'isEnabled', true);
|
|
180
|
-
if (!fontSizeExperimentEnabled) {
|
|
181
|
-
return transformSliceToRemoveBlockTaskItemLegacy(slice, view);
|
|
182
|
-
}
|
|
183
164
|
var blockTaskItem = view.state.schema.nodes.blockTaskItem;
|
|
184
165
|
var _getTaskPasteContext = getTaskPasteContext(view),
|
|
185
166
|
isInTaskContext = _getTaskPasteContext.isInTaskContext,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.6",
|
|
4
4
|
"description": "Tasks and decisions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"@atlaskit/editor-toolbar": "^2.6.0",
|
|
37
37
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
38
38
|
"@atlaskit/heading": "^7.2.0",
|
|
39
|
-
"@atlaskit/icon": "^37.
|
|
39
|
+
"@atlaskit/icon": "^37.7.0",
|
|
40
40
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
42
42
|
"@atlaskit/primitives": "^22.5.0",
|
|
43
43
|
"@atlaskit/prosemirror-input-rules": "^4.1.0",
|
|
44
44
|
"@atlaskit/task-decision": "^21.10.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^194.0.0",
|
|
46
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": "^122.
|
|
52
|
+
"@atlaskit/editor-common": "^122.6.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"
|