@atlaskit/editor-plugin-paste 2.1.3 → 2.2.0

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-paste
2
2
 
3
+ ## 2.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#105322](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105322)
8
+ [`8876083532adc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8876083532adc) -
9
+ Bumped editor-prosemirror version to 7.0.0
10
+ - [#111139](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111139)
11
+ [`1e01e9f84d512`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1e01e9f84d512) -
12
+ [ED-26430] Strip legacy content macro from pasted content
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 2.1.3
4
19
 
5
20
  ### Patch Changes
@@ -506,6 +506,13 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
506
506
  if ((0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_2')) {
507
507
  slice = (0, _transforms.transformSingleColumnLayout)(slice, schema);
508
508
  }
509
+
510
+ // Strip Legacy Content Macro (LCM) extensions on paste
511
+ if (
512
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
513
+ (0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro') && !(0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro_insert')) {
514
+ slice = (0, _transforms.transformSliceToRemoveLegacyContentMacro)(slice, schema);
515
+ }
509
516
  return slice;
510
517
  },
511
518
  transformPastedHTML: function transformPastedHTML(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';
@@ -480,6 +480,13 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
480
480
  if (fg('platform_editor_advanced_layouts_post_fix_patch_2')) {
481
481
  slice = transformSingleColumnLayout(slice, schema);
482
482
  }
483
+
484
+ // Strip Legacy Content Macro (LCM) extensions on paste
485
+ if (
486
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
487
+ fg('platform_editor_legacy_content_macro') && !fg('platform_editor_legacy_content_macro_insert')) {
488
+ slice = transformSliceToRemoveLegacyContentMacro(slice, schema);
489
+ }
483
490
  return slice;
484
491
  },
485
492
  transformPastedHTML(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';
@@ -498,6 +498,13 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
498
498
  if (fg('platform_editor_advanced_layouts_post_fix_patch_2')) {
499
499
  slice = transformSingleColumnLayout(slice, schema);
500
500
  }
501
+
502
+ // Strip Legacy Content Macro (LCM) extensions on paste
503
+ if (
504
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
505
+ fg('platform_editor_legacy_content_macro') && !fg('platform_editor_legacy_content_macro_insert')) {
506
+ slice = transformSliceToRemoveLegacyContentMacro(slice, schema);
507
+ }
501
508
  return slice;
502
509
  },
503
510
  transformPastedHTML: function transformPastedHTML(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.0",
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.10.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.43.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
  }