@atlaskit/editor-plugin-paste 11.1.4 → 11.1.6

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
+ ## 11.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 11.1.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`54c0e17fe643b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/54c0e17fe643b) -
14
+ Add fabric-renderer as a recognised PasteSource value for the document pasted analytics event
15
+ - Updated dependencies
16
+
3
17
  ## 11.1.4
4
18
 
5
19
  ### Patch Changes
@@ -28,6 +28,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
28
28
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
29
29
  var _utils3 = require("@atlaskit/editor-tables/utils");
30
30
  var _mediaClient = require("@atlaskit/media-client");
31
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
31
32
  function isPastedFromWord(html) {
32
33
  return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
33
34
  }
@@ -55,6 +56,9 @@ function isPastedFromPages(html) {
55
56
  function isPastedFromFabricEditor(html) {
56
57
  return !!html && html.indexOf('data-pm-slice="') >= 0;
57
58
  }
59
+ function isPastedFromFabricRenderer(html) {
60
+ return !!html && html.indexOf('data-renderer-start-pos="') >= 0 && (0, _platformFeatureFlags.fg)('platform_editor_paste_renderer_analytics');
61
+ }
58
62
  var isSingleLine = exports.isSingleLine = function isSingleLine(text) {
59
63
  return !!text && text.trim().split('\n').length === 1;
60
64
  };
@@ -81,6 +85,8 @@ function getPasteSource(event) {
81
85
  return 'apple-pages';
82
86
  } else if (isPastedFromFabricEditor(html)) {
83
87
  return 'fabric-editor';
88
+ } else if (isPastedFromFabricRenderer(html)) {
89
+ return 'fabric-renderer';
84
90
  }
85
91
  return 'uncategorized';
86
92
  }
@@ -6,6 +6,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
6
6
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
7
7
  import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
8
8
  import { isMediaBlobUrl } from '@atlaskit/media-client';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  export function isPastedFromWord(html) {
10
11
  return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
11
12
  }
@@ -33,6 +34,9 @@ function isPastedFromPages(html) {
33
34
  function isPastedFromFabricEditor(html) {
34
35
  return !!html && html.indexOf('data-pm-slice="') >= 0;
35
36
  }
37
+ function isPastedFromFabricRenderer(html) {
38
+ return !!html && html.indexOf('data-renderer-start-pos="') >= 0 && fg('platform_editor_paste_renderer_analytics');
39
+ }
36
40
  export const isSingleLine = text => {
37
41
  return !!text && text.trim().split('\n').length === 1;
38
42
  };
@@ -59,6 +63,8 @@ export function getPasteSource(event) {
59
63
  return 'apple-pages';
60
64
  } else if (isPastedFromFabricEditor(html)) {
61
65
  return 'fabric-editor';
66
+ } else if (isPastedFromFabricRenderer(html)) {
67
+ return 'fabric-renderer';
62
68
  }
63
69
  return 'uncategorized';
64
70
  }
@@ -7,6 +7,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
7
7
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
8
8
  import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
9
9
  import { isMediaBlobUrl } from '@atlaskit/media-client';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
10
11
  export function isPastedFromWord(html) {
11
12
  return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
12
13
  }
@@ -34,6 +35,9 @@ function isPastedFromPages(html) {
34
35
  function isPastedFromFabricEditor(html) {
35
36
  return !!html && html.indexOf('data-pm-slice="') >= 0;
36
37
  }
38
+ function isPastedFromFabricRenderer(html) {
39
+ return !!html && html.indexOf('data-renderer-start-pos="') >= 0 && fg('platform_editor_paste_renderer_analytics');
40
+ }
37
41
  export var isSingleLine = function isSingleLine(text) {
38
42
  return !!text && text.trim().split('\n').length === 1;
39
43
  };
@@ -60,6 +64,8 @@ export function getPasteSource(event) {
60
64
  return 'apple-pages';
61
65
  } else if (isPastedFromFabricEditor(html)) {
62
66
  return 'fabric-editor';
67
+ } else if (isPastedFromFabricRenderer(html)) {
68
+ return 'fabric-renderer';
63
69
  }
64
70
  return 'uncategorized';
65
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "11.1.4",
3
+ "version": "11.1.6",
4
4
  "description": "Paste plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,20 +42,20 @@
42
42
  "@atlaskit/editor-prosemirror": "^7.3.0",
43
43
  "@atlaskit/editor-tables": "^2.9.0",
44
44
  "@atlaskit/flag": "^17.11.0",
45
- "@atlaskit/icon": "^34.3.0",
45
+ "@atlaskit/icon": "^34.4.0",
46
46
  "@atlaskit/insm": "^0.4.0",
47
47
  "@atlaskit/media-client": "^36.1.0",
48
48
  "@atlaskit/media-common": "^13.2.0",
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
50
  "@atlaskit/prosemirror-history": "^0.2.0",
51
- "@atlaskit/tmp-editor-statsig": "^75.0.0",
51
+ "@atlaskit/tmp-editor-statsig": "^77.0.0",
52
52
  "@atlaskit/tokens": "^13.0.0",
53
53
  "@babel/runtime": "^7.0.0",
54
54
  "lodash": "^4.17.21",
55
55
  "uuid": "^3.1.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "@atlaskit/editor-common": "^114.19.0",
58
+ "@atlaskit/editor-common": "^114.20.0",
59
59
  "react": "^18.2.0",
60
60
  "react-dom": "^18.2.0",
61
61
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -125,6 +125,9 @@
125
125
  },
126
126
  "platform_synced_block_unsupported_products": {
127
127
  "type": "boolean"
128
+ },
129
+ "platform_editor_paste_renderer_analytics": {
130
+ "type": "boolean"
128
131
  }
129
132
  }
130
133
  }