@atlaskit/editor-plugin-paste 8.1.13 → 8.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,17 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 8.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c90ccf0c600ee`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c90ccf0c600ee) -
8
+ Enable cross product/cross client copy and paste of Media files by including clientId during Copy
9
+ operations.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 8.1.13
4
16
 
5
17
  ### Patch Changes
@@ -26,6 +26,7 @@ var _model = require("@atlaskit/editor-prosemirror/model");
26
26
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
27
27
  var _utils3 = require("@atlaskit/editor-tables/utils");
28
28
  var _insm = require("@atlaskit/insm");
29
+ var _mediaCommon = require("@atlaskit/media-common");
29
30
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
30
31
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
31
32
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
@@ -151,6 +152,12 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
151
152
  var text = event.clipboardData.getData('text/plain');
152
153
  var html = event.clipboardData.getData('text/html');
153
154
  var uriList = event.clipboardData.getData('text/uri-list');
155
+
156
+ // Extract clientId values from pasted HTML for media cross-product copy/paste
157
+ // This must be done before ProseMirror parses the HTML, as clientId is not stored in ADF
158
+ if ((0, _platformFeatureFlags.fg)('platform_media_cross_client_copy_with_auth')) {
159
+ (0, _mediaCommon.extractClientIdsFromHtml)(html);
160
+ }
154
161
  // Links copied from iOS Safari share button only have the text/uri-list data type
155
162
  // ProseMirror don't do anything with this type so we want to make our own open slice
156
163
  // with url as text content so link is pasted inline
@@ -16,6 +16,7 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
16
16
  import { contains, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
17
17
  import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
18
18
  import { insm } from '@atlaskit/insm';
19
+ import { extractClientIdsFromHtml } from '@atlaskit/media-common';
19
20
  import { fg } from '@atlaskit/platform-feature-flags';
20
21
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
21
22
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -117,6 +118,12 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
117
118
  let text = event.clipboardData.getData('text/plain');
118
119
  const html = event.clipboardData.getData('text/html');
119
120
  const uriList = event.clipboardData.getData('text/uri-list');
121
+
122
+ // Extract clientId values from pasted HTML for media cross-product copy/paste
123
+ // This must be done before ProseMirror parses the HTML, as clientId is not stored in ADF
124
+ if (fg('platform_media_cross_client_copy_with_auth')) {
125
+ extractClientIdsFromHtml(html);
126
+ }
120
127
  // Links copied from iOS Safari share button only have the text/uri-list data type
121
128
  // ProseMirror don't do anything with this type so we want to make our own open slice
122
129
  // with url as text content so link is pasted inline
@@ -21,6 +21,7 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
21
21
  import { contains, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
22
22
  import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
23
23
  import { insm } from '@atlaskit/insm';
24
+ import { extractClientIdsFromHtml } from '@atlaskit/media-common';
24
25
  import { fg } from '@atlaskit/platform-feature-flags';
25
26
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
26
27
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -143,6 +144,12 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
143
144
  var text = event.clipboardData.getData('text/plain');
144
145
  var html = event.clipboardData.getData('text/html');
145
146
  var uriList = event.clipboardData.getData('text/uri-list');
147
+
148
+ // Extract clientId values from pasted HTML for media cross-product copy/paste
149
+ // This must be done before ProseMirror parses the HTML, as clientId is not stored in ADF
150
+ if (fg('platform_media_cross_client_copy_with_auth')) {
151
+ extractClientIdsFromHtml(html);
152
+ }
146
153
  // Links copied from iOS Safari share button only have the text/uri-list data type
147
154
  // ProseMirror don't do anything with this type so we want to make our own open slice
148
155
  // with url as text content so link is pasted inline
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "8.1.13",
3
+ "version": "8.2.0",
4
4
  "description": "Paste plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,18 +36,18 @@
36
36
  "@atlaskit/editor-plugin-card": "^12.3.0",
37
37
  "@atlaskit/editor-plugin-feature-flags": "^6.0.0",
38
38
  "@atlaskit/editor-plugin-list": "^9.0.0",
39
- "@atlaskit/editor-plugin-media": "^9.4.0",
39
+ "@atlaskit/editor-plugin-media": "^9.5.0",
40
40
  "@atlaskit/editor-plugin-mentions": "^9.2.0",
41
41
  "@atlaskit/editor-prosemirror": "^7.3.0",
42
42
  "@atlaskit/editor-tables": "^2.9.0",
43
43
  "@atlaskit/flag": "^17.8.0",
44
44
  "@atlaskit/icon": "^31.0.0",
45
45
  "@atlaskit/insm": "^0.3.0",
46
- "@atlaskit/media-client": "^35.7.0",
47
- "@atlaskit/media-common": "^12.3.0",
46
+ "@atlaskit/media-client": "^35.8.0",
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": "^25.0.0",
50
+ "@atlaskit/tmp-editor-statsig": "^25.4.0",
51
51
  "@atlaskit/tokens": "^11.0.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "lodash": "^4.17.21",
@@ -55,7 +55,7 @@
55
55
  "uuid": "^3.1.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "@atlaskit/editor-common": "^111.12.0",
58
+ "@atlaskit/editor-common": "^111.14.0",
59
59
  "react": "^18.2.0",
60
60
  "react-dom": "^18.2.0"
61
61
  },
@@ -120,6 +120,9 @@
120
120
  },
121
121
  "platform_editor_date_to_text": {
122
122
  "type": "boolean"
123
+ },
124
+ "platform_media_cross_client_copy_with_auth": {
125
+ "type": "boolean"
123
126
  }
124
127
  }
125
128
  }