@atlaskit/editor-plugin-paste 8.2.2 → 8.2.4
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 +14 -0
- package/dist/cjs/pm-plugins/util/handlers.js +7 -24
- package/dist/es2019/pm-plugins/util/handlers.js +2 -21
- package/dist/esm/pm-plugins/util/handlers.js +7 -24
- package/dist/types/pm-plugins/util/edge-cases/index.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/util/edge-cases/index.d.ts +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 8.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 8.2.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`a040c03082274`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a040c03082274) -
|
|
14
|
+
[ux] EDITOR-507 Clean up main nested tables experiment `platform_editor_nested_tables`
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 8.2.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -43,7 +43,6 @@ var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
|
43
43
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
44
44
|
var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
|
|
45
45
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
46
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
47
46
|
var _commands = require("../../editor-commands/commands");
|
|
48
47
|
var _pluginFactory = require("../plugin-factory");
|
|
49
48
|
var _edgeCases = require("./edge-cases");
|
|
@@ -781,30 +780,14 @@ function handleNestedTablePaste(slice, isNestingTablesSupported) {
|
|
|
781
780
|
}
|
|
782
781
|
});
|
|
783
782
|
if (sliceHasTable) {
|
|
784
|
-
if
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
var positionAfterTopTable = (0, _nesting.getPositionAfterTopParentNodeOfType)(schema.nodes.table)(selection.$from);
|
|
791
|
-
var tr = state.tr;
|
|
792
|
-
tr = (0, _utils2.safeInsert)(slice.content, positionAfterTopTable)(tr);
|
|
793
|
-
tr.scrollIntoView();
|
|
794
|
-
if (dispatch) {
|
|
795
|
-
dispatch(tr);
|
|
796
|
-
return true;
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
} else {
|
|
800
|
-
/* CONTROL COHORT */
|
|
801
|
-
// if slice has table - place paste after top table
|
|
802
|
-
var _positionAfterTopTable = (0, _nesting.getPositionAfterTopParentNodeOfType)(schema.nodes.table)(selection.$from);
|
|
803
|
-
var _tr2 = state.tr;
|
|
804
|
-
_tr2 = (0, _utils2.safeInsert)(slice.content, _positionAfterTopTable)(_tr2);
|
|
805
|
-
_tr2.scrollIntoView();
|
|
783
|
+
// if slice has table - if pasting to deeply nested location place paste after top table
|
|
784
|
+
if ((0, _nesting.getParentOfTypeCount)(schema.nodes.table)(selection.$from) > 1) {
|
|
785
|
+
var positionAfterTopTable = (0, _nesting.getPositionAfterTopParentNodeOfType)(schema.nodes.table)(selection.$from);
|
|
786
|
+
var tr = state.tr;
|
|
787
|
+
tr = (0, _utils2.safeInsert)(slice.content, positionAfterTopTable)(tr);
|
|
788
|
+
tr.scrollIntoView();
|
|
806
789
|
if (dispatch) {
|
|
807
|
-
dispatch(
|
|
790
|
+
dispatch(tr);
|
|
808
791
|
return true;
|
|
809
792
|
}
|
|
810
793
|
}
|
|
@@ -13,7 +13,6 @@ import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { closeHistory } from '@atlaskit/prosemirror-history';
|
|
15
15
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
17
16
|
// TODO: ED-20519 - Needs Macro extraction
|
|
18
17
|
|
|
19
18
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from '../../editor-commands/commands';
|
|
@@ -766,26 +765,8 @@ export function handleNestedTablePaste(slice, isNestingTablesSupported) {
|
|
|
766
765
|
}
|
|
767
766
|
});
|
|
768
767
|
if (sliceHasTable) {
|
|
769
|
-
if
|
|
770
|
-
|
|
771
|
-
})) {
|
|
772
|
-
/* TEST COHORT */
|
|
773
|
-
// if slice has table - if pasting to deeply nested location place paste after top table
|
|
774
|
-
if (getParentOfTypeCount(schema.nodes.table)(selection.$from) > 1) {
|
|
775
|
-
const positionAfterTopTable = getPositionAfterTopParentNodeOfType(schema.nodes.table)(selection.$from);
|
|
776
|
-
let {
|
|
777
|
-
tr
|
|
778
|
-
} = state;
|
|
779
|
-
tr = safeInsert(slice.content, positionAfterTopTable)(tr);
|
|
780
|
-
tr.scrollIntoView();
|
|
781
|
-
if (dispatch) {
|
|
782
|
-
dispatch(tr);
|
|
783
|
-
return true;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
} else {
|
|
787
|
-
/* CONTROL COHORT */
|
|
788
|
-
// if slice has table - place paste after top table
|
|
768
|
+
// if slice has table - if pasting to deeply nested location place paste after top table
|
|
769
|
+
if (getParentOfTypeCount(schema.nodes.table)(selection.$from) > 1) {
|
|
789
770
|
const positionAfterTopTable = getPositionAfterTopParentNodeOfType(schema.nodes.table)(selection.$from);
|
|
790
771
|
let {
|
|
791
772
|
tr
|
|
@@ -21,7 +21,6 @@ import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import { closeHistory } from '@atlaskit/prosemirror-history';
|
|
23
23
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
24
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
25
24
|
// TODO: ED-20519 - Needs Macro extraction
|
|
26
25
|
|
|
27
26
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from '../../editor-commands/commands';
|
|
@@ -755,30 +754,14 @@ export function handleNestedTablePaste(slice, isNestingTablesSupported) {
|
|
|
755
754
|
}
|
|
756
755
|
});
|
|
757
756
|
if (sliceHasTable) {
|
|
758
|
-
if
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
var positionAfterTopTable = getPositionAfterTopParentNodeOfType(schema.nodes.table)(selection.$from);
|
|
765
|
-
var tr = state.tr;
|
|
766
|
-
tr = safeInsert(slice.content, positionAfterTopTable)(tr);
|
|
767
|
-
tr.scrollIntoView();
|
|
768
|
-
if (dispatch) {
|
|
769
|
-
dispatch(tr);
|
|
770
|
-
return true;
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
} else {
|
|
774
|
-
/* CONTROL COHORT */
|
|
775
|
-
// if slice has table - place paste after top table
|
|
776
|
-
var _positionAfterTopTable = getPositionAfterTopParentNodeOfType(schema.nodes.table)(selection.$from);
|
|
777
|
-
var _tr2 = state.tr;
|
|
778
|
-
_tr2 = safeInsert(slice.content, _positionAfterTopTable)(_tr2);
|
|
779
|
-
_tr2.scrollIntoView();
|
|
757
|
+
// if slice has table - if pasting to deeply nested location place paste after top table
|
|
758
|
+
if (getParentOfTypeCount(schema.nodes.table)(selection.$from) > 1) {
|
|
759
|
+
var positionAfterTopTable = getPositionAfterTopParentNodeOfType(schema.nodes.table)(selection.$from);
|
|
760
|
+
var tr = state.tr;
|
|
761
|
+
tr = safeInsert(slice.content, positionAfterTopTable)(tr);
|
|
762
|
+
tr.scrollIntoView();
|
|
780
763
|
if (dispatch) {
|
|
781
|
-
dispatch(
|
|
764
|
+
dispatch(tr);
|
|
782
765
|
return true;
|
|
783
766
|
}
|
|
784
767
|
}
|
|
@@ -5,14 +5,14 @@ export declare function insertSliceForLists({ tr, slice, schema, }: {
|
|
|
5
5
|
slice: PMSlice;
|
|
6
6
|
tr: Transaction;
|
|
7
7
|
}): void | Transaction;
|
|
8
|
-
export declare function insertSliceInsideBlockquote({ tr, slice }: {
|
|
8
|
+
export declare function insertSliceInsideBlockquote({ tr, slice, }: {
|
|
9
9
|
slice: PMSlice;
|
|
10
10
|
tr: Transaction;
|
|
11
11
|
}): void;
|
|
12
12
|
export declare function updateSelectionAfterReplace({ tr }: {
|
|
13
13
|
tr: Transaction;
|
|
14
14
|
}): Transaction | undefined;
|
|
15
|
-
export declare function insertSliceForTaskInsideList({ tr, slice }: {
|
|
15
|
+
export declare function insertSliceForTaskInsideList({ tr, slice, }: {
|
|
16
16
|
slice: PMSlice;
|
|
17
17
|
tr: Transaction;
|
|
18
18
|
}): void;
|
|
@@ -5,14 +5,14 @@ export declare function insertSliceForLists({ tr, slice, schema, }: {
|
|
|
5
5
|
slice: PMSlice;
|
|
6
6
|
tr: Transaction;
|
|
7
7
|
}): void | Transaction;
|
|
8
|
-
export declare function insertSliceInsideBlockquote({ tr, slice }: {
|
|
8
|
+
export declare function insertSliceInsideBlockquote({ tr, slice, }: {
|
|
9
9
|
slice: PMSlice;
|
|
10
10
|
tr: Transaction;
|
|
11
11
|
}): void;
|
|
12
12
|
export declare function updateSelectionAfterReplace({ tr }: {
|
|
13
13
|
tr: Transaction;
|
|
14
14
|
}): Transaction | undefined;
|
|
15
|
-
export declare function insertSliceForTaskInsideList({ tr, slice }: {
|
|
15
|
+
export declare function insertSliceForTaskInsideList({ tr, slice, }: {
|
|
16
16
|
slice: PMSlice;
|
|
17
17
|
tr: Transaction;
|
|
18
18
|
}): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.4",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/media-common": "^12.4.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^29.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^11.0.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"lodash": "^4.17.21",
|