@atlaskit/editor-plugin-paste 2.1.3 → 2.2.1

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,29 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 2.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#111831](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111831)
8
+ [`66895944dfac9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/66895944dfac9) -
9
+ [ED-26430] Block drag-and-drop of legacy content macro extension
10
+ - Updated dependencies
11
+
12
+ ## 2.2.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#105322](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105322)
17
+ [`8876083532adc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8876083532adc) -
18
+ Bumped editor-prosemirror version to 7.0.0
19
+ - [#111139](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111139)
20
+ [`1e01e9f84d512`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1e01e9f84d512) -
21
+ [ED-26430] Strip legacy content macro from pasted content
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+
3
27
  ## 2.1.3
4
28
 
5
29
  ### Patch Changes
@@ -154,6 +154,13 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
154
154
  // eslint-disable-next-line require-unicode-regexp
155
155
  text = text.replace(/\r/g, '');
156
156
  }
157
+
158
+ // Strip Legacy Content Macro (LCM) extensions on paste
159
+ if (
160
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
161
+ (0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro') && !(0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro_insert')) {
162
+ slice = (0, _transforms.transformSliceToRemoveLegacyContentMacro)(slice, schema);
163
+ }
157
164
  var isPastedFile = (0, _paste.isPastedFile)(event);
158
165
  var isPlainText = text && !html;
159
166
  var isRichText = !!html;
@@ -6,7 +6,7 @@ import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/
6
6
  import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
7
7
  import { measureRender } from '@atlaskit/editor-common/performance/measure-render';
8
8
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
9
- import { transformSingleLineCodeBlockToCodeMark, transformSingleColumnLayout, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks } from '@atlaskit/editor-common/transforms';
9
+ import { transformSingleLineCodeBlockToCodeMark, transformSingleColumnLayout, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks, transformSliceToRemoveLegacyContentMacro } from '@atlaskit/editor-common/transforms';
10
10
  import { containsAnyAnnotations, extractSliceFromStep, linkifyContent, mapChildren } from '@atlaskit/editor-common/utils';
11
11
  import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
12
12
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
@@ -123,6 +123,13 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
123
123
  // eslint-disable-next-line require-unicode-regexp
124
124
  text = text.replace(/\r/g, '');
125
125
  }
126
+
127
+ // Strip Legacy Content Macro (LCM) extensions on paste
128
+ if (
129
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
130
+ fg('platform_editor_legacy_content_macro') && !fg('platform_editor_legacy_content_macro_insert')) {
131
+ slice = transformSliceToRemoveLegacyContentMacro(slice, schema);
132
+ }
126
133
  const isPastedFile = isPastedFileFromEvent(event);
127
134
  const isPlainText = text && !html;
128
135
  const isRichText = !!html;
@@ -8,7 +8,7 @@ import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/
8
8
  import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
9
9
  import { measureRender } from '@atlaskit/editor-common/performance/measure-render';
10
10
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
11
- import { transformSingleLineCodeBlockToCodeMark, transformSingleColumnLayout, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks } from '@atlaskit/editor-common/transforms';
11
+ import { transformSingleLineCodeBlockToCodeMark, transformSingleColumnLayout, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks, transformSliceToRemoveLegacyContentMacro } from '@atlaskit/editor-common/transforms';
12
12
  import { containsAnyAnnotations, extractSliceFromStep, linkifyContent, mapChildren } from '@atlaskit/editor-common/utils';
13
13
  import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
14
14
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
@@ -146,6 +146,13 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
146
146
  // eslint-disable-next-line require-unicode-regexp
147
147
  text = text.replace(/\r/g, '');
148
148
  }
149
+
150
+ // Strip Legacy Content Macro (LCM) extensions on paste
151
+ if (
152
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
153
+ fg('platform_editor_legacy_content_macro') && !fg('platform_editor_legacy_content_macro_insert')) {
154
+ slice = transformSliceToRemoveLegacyContentMacro(slice, schema);
155
+ }
149
156
  var isPastedFile = isPastedFileFromEvent(event);
150
157
  var isPlainText = text && !html;
151
158
  var isRichText = !!html;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "2.1.3",
3
+ "version": "2.2.1",
4
4
  "description": "Paste plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,22 +33,22 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
35
  "@atlaskit/code": "^15.6.9",
36
- "@atlaskit/editor-common": "^99.8.0",
37
- "@atlaskit/editor-markdown-transformer": "^5.14.0",
38
- "@atlaskit/editor-plugin-analytics": "^1.11.0",
39
- "@atlaskit/editor-plugin-annotation": "^1.27.0",
40
- "@atlaskit/editor-plugin-better-type-history": "^1.10.0",
41
- "@atlaskit/editor-plugin-card": "^4.5.0",
42
- "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
43
- "@atlaskit/editor-plugin-list": "^3.9.0",
44
- "@atlaskit/editor-plugin-media": "^1.44.0",
45
- "@atlaskit/editor-plugin-mentions": "^2.14.0",
46
- "@atlaskit/editor-prosemirror": "6.2.1",
47
- "@atlaskit/editor-tables": "^2.8.0",
36
+ "@atlaskit/editor-common": "^99.12.0",
37
+ "@atlaskit/editor-markdown-transformer": "^5.15.0",
38
+ "@atlaskit/editor-plugin-analytics": "^1.12.0",
39
+ "@atlaskit/editor-plugin-annotation": "^1.28.0",
40
+ "@atlaskit/editor-plugin-better-type-history": "^1.11.0",
41
+ "@atlaskit/editor-plugin-card": "^4.6.0",
42
+ "@atlaskit/editor-plugin-feature-flags": "^1.3.0",
43
+ "@atlaskit/editor-plugin-list": "^3.10.0",
44
+ "@atlaskit/editor-plugin-media": "^1.45.0",
45
+ "@atlaskit/editor-plugin-mentions": "^2.15.0",
46
+ "@atlaskit/editor-prosemirror": "7.0.0",
47
+ "@atlaskit/editor-tables": "^2.9.0",
48
48
  "@atlaskit/media-client": "^31.1.0",
49
49
  "@atlaskit/media-common": "^11.8.0",
50
50
  "@atlaskit/platform-feature-flags": "^1.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^2.42.0",
51
+ "@atlaskit/tmp-editor-statsig": "^2.45.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "lodash": "^4.17.21",
54
54
  "uuid": "^3.1.0"
@@ -59,9 +59,9 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@af/visual-regression": "*",
62
- "@atlaskit/editor-plugin-block-type": "^4.2.0",
63
- "@atlaskit/editor-plugin-history": "^1.3.0",
64
- "@atlaskit/editor-plugin-type-ahead": "^1.12.0",
62
+ "@atlaskit/editor-plugin-block-type": "^4.3.0",
63
+ "@atlaskit/editor-plugin-history": "^1.4.0",
64
+ "@atlaskit/editor-plugin-type-ahead": "^1.13.0",
65
65
  "@atlaskit/ssr": "*",
66
66
  "@atlaskit/visual-regression": "*",
67
67
  "@testing-library/react": "^13.4.0",
@@ -128,6 +128,12 @@
128
128
  },
129
129
  "platform_editor_fix_paste_action_item_in_list": {
130
130
  "type": "boolean"
131
+ },
132
+ "platform_editor_legacy_content_macro": {
133
+ "type": "boolean"
134
+ },
135
+ "platform_editor_legacy_content_macro_insert": {
136
+ "type": "boolean"
131
137
  }
132
138
  }
133
139
  }