@atlaskit/editor-plugin-paste 8.2.2 → 8.2.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,13 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 8.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a040c03082274`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a040c03082274) -
8
+ [ux] EDITOR-507 Clean up main nested tables experiment `platform_editor_nested_tables`
9
+ - Updated dependencies
10
+
3
11
  ## 8.2.2
4
12
 
5
13
  ### 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 ((0, _experiments.editorExperiment)('nested-tables-in-tables', true, {
785
- exposure: true
786
- })) {
787
- /* TEST COHORT */
788
- // if slice has table - if pasting to deeply nested location place paste after top table
789
- if ((0, _nesting.getParentOfTypeCount)(schema.nodes.table)(selection.$from) > 1) {
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(_tr2);
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 (editorExperiment('nested-tables-in-tables', true, {
770
- exposure: true
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 (editorExperiment('nested-tables-in-tables', true, {
759
- exposure: true
760
- })) {
761
- /* TEST COHORT */
762
- // if slice has table - if pasting to deeply nested location place paste after top table
763
- if (getParentOfTypeCount(schema.nodes.table)(selection.$from) > 1) {
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(_tr2);
764
+ dispatch(tr);
782
765
  return true;
783
766
  }
784
767
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "8.2.2",
3
+ "version": "8.2.3",
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": "^27.1.0",
50
+ "@atlaskit/tmp-editor-statsig": "^28.0.0",
51
51
  "@atlaskit/tokens": "^11.0.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "lodash": "^4.17.21",