@atlaskit/editor-plugin-list 4.1.1 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-list
|
|
2
2
|
|
|
3
|
+
## 4.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#124104](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/124104)
|
|
8
|
+
[`a48ac34f66f25`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a48ac34f66f25) -
|
|
9
|
+
[ux] ED-26942 Modified editor-plugin-list backspace keymap handler to prevent it from deleting
|
|
10
|
+
extensions
|
|
11
|
+
|
|
12
|
+
## 4.1.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 4.1.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -16,6 +16,7 @@ var _commands2 = require("@atlaskit/editor-prosemirror/commands");
|
|
|
16
16
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
17
17
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
18
18
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
19
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
20
|
var _conversions = require("../actions/conversions");
|
|
20
21
|
var _wrapAndJoinLists = require("../actions/wrap-and-join-lists");
|
|
21
22
|
var _transforms = require("../transforms");
|
|
@@ -254,10 +255,12 @@ var deletePreviousEmptyListItem = function deletePreviousEmptyListItem(state, di
|
|
|
254
255
|
if (!$cut || !$cut.nodeBefore || !($cut.nodeBefore.type === listItem)) {
|
|
255
256
|
return false;
|
|
256
257
|
}
|
|
258
|
+
var nodeBeforeIsExtension =
|
|
259
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
260
|
+
(0, _platformFeatureFlags.fg)('platform_editor_nbm_backspace_fixes') && $cut.nodeBefore.firstChild && $cut.nodeBefore.firstChild.type.name === 'extension';
|
|
257
261
|
var previousListItemEmpty =
|
|
258
262
|
// Ignored via go/ees005
|
|
259
|
-
|
|
260
|
-
$cut.nodeBefore.childCount === 1 && $cut.nodeBefore.firstChild.nodeSize <= 2;
|
|
263
|
+
$cut.nodeBefore.childCount === 1 && $cut.nodeBefore.firstChild && $cut.nodeBefore.firstChild.nodeSize <= 2 && !nodeBeforeIsExtension;
|
|
261
264
|
if (previousListItemEmpty) {
|
|
262
265
|
var tr = state.tr;
|
|
263
266
|
if (dispatch) {
|
|
@@ -8,6 +8,7 @@ import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
|
8
8
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
9
9
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { findPositionOfNodeBefore, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { convertListType } from '../actions/conversions';
|
|
12
13
|
import { wrapInListAndJoin } from '../actions/wrap-and-join-lists';
|
|
13
14
|
import { liftFollowingList, liftNodeSelectionList, liftTextSelectionList } from '../transforms';
|
|
@@ -241,10 +242,12 @@ const deletePreviousEmptyListItem = (state, dispatch) => {
|
|
|
241
242
|
if (!$cut || !$cut.nodeBefore || !($cut.nodeBefore.type === listItem)) {
|
|
242
243
|
return false;
|
|
243
244
|
}
|
|
245
|
+
const nodeBeforeIsExtension =
|
|
246
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
247
|
+
fg('platform_editor_nbm_backspace_fixes') && $cut.nodeBefore.firstChild && $cut.nodeBefore.firstChild.type.name === 'extension';
|
|
244
248
|
const previousListItemEmpty =
|
|
245
249
|
// Ignored via go/ees005
|
|
246
|
-
|
|
247
|
-
$cut.nodeBefore.childCount === 1 && $cut.nodeBefore.firstChild.nodeSize <= 2;
|
|
250
|
+
$cut.nodeBefore.childCount === 1 && $cut.nodeBefore.firstChild && $cut.nodeBefore.firstChild.nodeSize <= 2 && !nodeBeforeIsExtension;
|
|
248
251
|
if (previousListItemEmpty) {
|
|
249
252
|
const {
|
|
250
253
|
tr
|
|
@@ -11,6 +11,7 @@ import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
|
11
11
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
12
12
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
13
13
|
import { findPositionOfNodeBefore, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { convertListType } from '../actions/conversions';
|
|
15
16
|
import { wrapInListAndJoin } from '../actions/wrap-and-join-lists';
|
|
16
17
|
import { liftFollowingList, liftNodeSelectionList, liftTextSelectionList } from '../transforms';
|
|
@@ -247,10 +248,12 @@ var deletePreviousEmptyListItem = function deletePreviousEmptyListItem(state, di
|
|
|
247
248
|
if (!$cut || !$cut.nodeBefore || !($cut.nodeBefore.type === listItem)) {
|
|
248
249
|
return false;
|
|
249
250
|
}
|
|
251
|
+
var nodeBeforeIsExtension =
|
|
252
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
253
|
+
fg('platform_editor_nbm_backspace_fixes') && $cut.nodeBefore.firstChild && $cut.nodeBefore.firstChild.type.name === 'extension';
|
|
250
254
|
var previousListItemEmpty =
|
|
251
255
|
// Ignored via go/ees005
|
|
252
|
-
|
|
253
|
-
$cut.nodeBefore.childCount === 1 && $cut.nodeBefore.firstChild.nodeSize <= 2;
|
|
256
|
+
$cut.nodeBefore.childCount === 1 && $cut.nodeBefore.firstChild && $cut.nodeBefore.firstChild.nodeSize <= 2 && !nodeBeforeIsExtension;
|
|
254
257
|
if (previousListItemEmpty) {
|
|
255
258
|
var tr = state.tr;
|
|
256
259
|
if (dispatch) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-list",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"description": "List plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,10 +32,11 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
35
|
-
"@atlaskit/editor-common": "^
|
|
35
|
+
"@atlaskit/editor-common": "^102.1.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^2.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-feature-flags": "^1.3.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
|
+
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
39
40
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
|
40
41
|
"@atlaskit/tmp-editor-statsig": "^3.4.0",
|
|
41
42
|
"@babel/runtime": "^7.0.0"
|
|
@@ -82,6 +83,11 @@
|
|
|
82
83
|
]
|
|
83
84
|
}
|
|
84
85
|
},
|
|
86
|
+
"platform-feature-flags": {
|
|
87
|
+
"platform_editor_nbm_backspace_fixes": {
|
|
88
|
+
"type": "boolean"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
85
91
|
"stricter": {
|
|
86
92
|
"no-unused-dependencies": {
|
|
87
93
|
"checkDevDependencies": true
|