@atlaskit/editor-plugin-paste 14.0.0 → 14.0.2

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,19 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 14.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`cd807b8c872ee`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd807b8c872ee) -
8
+ [ux] Fix pasting headings from panel context into an existing panel.
9
+ - Updated dependencies
10
+
11
+ ## 14.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 14.0.0
4
18
 
5
19
  ### Patch Changes
@@ -47,6 +47,7 @@ var _model = require("@atlaskit/editor-prosemirror/model");
47
47
  var _state = require("@atlaskit/editor-prosemirror/state");
48
48
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
49
49
  var _utils3 = require("@atlaskit/editor-tables/utils");
50
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
50
51
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
51
52
  var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
52
53
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
@@ -155,7 +156,7 @@ function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChangedTr) {
155
156
  var sliceIsInvalid = false;
156
157
  var sliceHasTask = false;
157
158
  slice.content.nodesBetween(0, slice.content.size, function (node) {
158
- if (node.type === bulletList || node.type === orderedList || node.type === expand || node.type === heading || node.type === listItem) {
159
+ if (node.type === bulletList || node.type === orderedList || node.type === expand || node.type === heading && !(selectionIsPanel && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_fix_header_paste_in_panel')) || node.type === listItem) {
159
160
  sliceIsInvalid = true;
160
161
  }
161
162
  if (selectionIsPanel && node.type === taskList) {
@@ -14,6 +14,7 @@ import { Fragment, Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/mo
14
14
  import { AllSelection, NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
15
15
  import { canInsert, contains, findParentNodeOfType, findParentNodeOfTypeClosestToPos, hasParentNode, hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
16
16
  import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
17
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
17
18
  import { fg } from '@atlaskit/platform-feature-flags';
18
19
  import { closeHistory } from '@atlaskit/prosemirror-history';
19
20
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -124,7 +125,7 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChange
124
125
  let sliceIsInvalid = false;
125
126
  let sliceHasTask = false;
126
127
  slice.content.nodesBetween(0, slice.content.size, node => {
127
- if (node.type === bulletList || node.type === orderedList || node.type === expand || node.type === heading || node.type === listItem) {
128
+ if (node.type === bulletList || node.type === orderedList || node.type === expand || node.type === heading && !(selectionIsPanel && isExperimentEnabled('platform_editor_fix_header_paste_in_panel')) || node.type === listItem) {
128
129
  sliceIsInvalid = true;
129
130
  }
130
131
  if (selectionIsPanel && node.type === taskList) {
@@ -22,6 +22,7 @@ import { Fragment, Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/mo
22
22
  import { AllSelection, NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
23
23
  import { canInsert, contains, findParentNodeOfType, findParentNodeOfTypeClosestToPos, hasParentNode, hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
24
24
  import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
25
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
25
26
  import { fg } from '@atlaskit/platform-feature-flags';
26
27
  import { closeHistory } from '@atlaskit/prosemirror-history';
27
28
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -126,7 +127,7 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChange
126
127
  var sliceIsInvalid = false;
127
128
  var sliceHasTask = false;
128
129
  slice.content.nodesBetween(0, slice.content.size, function (node) {
129
- if (node.type === bulletList || node.type === orderedList || node.type === expand || node.type === heading || node.type === listItem) {
130
+ if (node.type === bulletList || node.type === orderedList || node.type === expand || node.type === heading && !(selectionIsPanel && isExperimentEnabled('platform_editor_fix_header_paste_in_panel')) || node.type === listItem) {
130
131
  sliceIsInvalid = true;
131
132
  }
132
133
  if (selectionIsPanel && node.type === taskList) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "14.0.0",
3
+ "version": "14.0.2",
4
4
  "description": "Paste plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,20 +35,21 @@
35
35
  "@atlaskit/editor-prosemirror": "^8.0.0",
36
36
  "@atlaskit/editor-tables": "^3.0.0",
37
37
  "@atlaskit/flag": "^18.2.0",
38
- "@atlaskit/icon": "^37.2.0",
38
+ "@atlaskit/icon": "^37.3.0",
39
39
  "@atlaskit/insm": "^1.2.0",
40
40
  "@atlaskit/media-client": "^37.2.0",
41
41
  "@atlaskit/media-common": "^14.3.0",
42
+ "@atlaskit/platform-feature-experiments": "^0.3.0",
42
43
  "@atlaskit/platform-feature-flags": "^2.1.0",
43
44
  "@atlaskit/prosemirror-history": "^1.1.0",
44
- "@atlaskit/tmp-editor-statsig": "^138.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^139.0.0",
45
46
  "@atlaskit/tokens": "^16.3.0",
46
47
  "@babel/runtime": "^7.0.0",
47
48
  "lodash": "^4.17.21",
48
49
  "uuid": "^3.1.0"
49
50
  },
50
51
  "peerDependencies": {
51
- "@atlaskit/editor-common": "^117.0.0",
52
+ "@atlaskit/editor-common": "^117.2.0",
52
53
  "react": "^18.2.0 || ^19.2.0",
53
54
  "react-dom": "^18.2.0 || ^19.2.0",
54
55
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"