@atlaskit/editor-plugin-paste 8.0.1 → 8.0.3

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,22 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 8.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2154ee4210e97`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2154ee4210e97) -
8
+ Fix pasting emoji from HTML turning into media single
9
+ - Updated dependencies
10
+
11
+ ## 8.0.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [`c4a774ad462fb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c4a774ad462fb) -
16
+ EDITOR-2477 Clean up remaining usages of `platform_editor_use_nested_table_pm_nodes` which are no
17
+ longer needed now that `isNestedTablesSupported` is fully rolled out.
18
+ - Updated dependencies
19
+
3
20
  ## 8.0.1
4
21
 
5
22
  ### Patch Changes
@@ -421,7 +421,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
421
421
  }
422
422
 
423
423
  // handle paste of nested tables to ensure nesting limits are respected
424
- if ((0, _analytics2.handleNestedTablePasteWithAnalytics)(editorAnalyticsAPI, (0, _nesting.isNestedTablesSupported)(state.schema) && (0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes'))(view, event, slice)(state, dispatch)) {
424
+ if ((0, _analytics2.handleNestedTablePasteWithAnalytics)(editorAnalyticsAPI, (0, _nesting.isNestedTablesSupported)(state.schema))(view, event, slice)(state, dispatch)) {
425
425
  return true;
426
426
  }
427
427
  if ((0, _analytics2.handlePasteIntoTaskAndDecisionWithAnalytics)(view, event, slice, isPlainText ? _analytics.PasteTypes.plain : _analytics.PasteTypes.richText, pluginInjectionApi)(state, dispatch)) {
@@ -12,6 +12,7 @@ var _mediaSingle = require("@atlaskit/editor-common/media-single");
12
12
  var _utils = require("@atlaskit/editor-common/utils");
13
13
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
14
14
  var _mediaCommon = require("@atlaskit/media-common");
15
+ var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
15
16
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
17
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
18
  /**
@@ -172,6 +173,11 @@ var unwrapNestedMediaElements = exports.unwrapNestedMediaElements = function unw
172
173
  return;
173
174
  }
174
175
 
176
+ // Bypass emoji
177
+ if (imageTag.className.includes('emoji-common-emoji-image') && (0, _expVal.expVal)('platform_editor_fix_emoji_paste_html', 'isEnabled', false)) {
178
+ return;
179
+ }
180
+
175
181
  // If either the parent or the image itself contains styles that would make
176
182
  // them invisible on copy, dont paste them.
177
183
  if (isElementInvisible(mediaParent) || isElementInvisible(imageTag)) {
@@ -383,7 +383,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
383
383
  }
384
384
 
385
385
  // handle paste of nested tables to ensure nesting limits are respected
386
- if (handleNestedTablePasteWithAnalytics(editorAnalyticsAPI, isNestedTablesSupported(state.schema) && fg('platform_editor_use_nested_table_pm_nodes'))(view, event, slice)(state, dispatch)) {
386
+ if (handleNestedTablePasteWithAnalytics(editorAnalyticsAPI, isNestedTablesSupported(state.schema))(view, event, slice)(state, dispatch)) {
387
387
  return true;
388
388
  }
389
389
  if (handlePasteIntoTaskAndDecisionWithAnalytics(view, event, slice, isPlainText ? PasteTypes.plain : PasteTypes.richText, pluginInjectionApi)(state, dispatch)) {
@@ -2,6 +2,7 @@ import { DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
2
2
  import { mapSlice, removeNestedEmptyEls, unwrap, walkUpTreeUntil } from '@atlaskit/editor-common/utils';
3
3
  import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
4
  import { getRandomHex } from '@atlaskit/media-common';
5
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
5
6
  /**
6
7
  * Ensure correct layout in nested mode
7
8
  *
@@ -168,6 +169,11 @@ export const unwrapNestedMediaElements = html => {
168
169
  return;
169
170
  }
170
171
 
172
+ // Bypass emoji
173
+ if (imageTag.className.includes('emoji-common-emoji-image') && expVal('platform_editor_fix_emoji_paste_html', 'isEnabled', false)) {
174
+ return;
175
+ }
176
+
171
177
  // If either the parent or the image itself contains styles that would make
172
178
  // them invisible on copy, dont paste them.
173
179
  if (isElementInvisible(mediaParent) || isElementInvisible(imageTag)) {
@@ -413,7 +413,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
413
413
  }
414
414
 
415
415
  // handle paste of nested tables to ensure nesting limits are respected
416
- if (handleNestedTablePasteWithAnalytics(editorAnalyticsAPI, isNestedTablesSupported(state.schema) && fg('platform_editor_use_nested_table_pm_nodes'))(view, event, slice)(state, dispatch)) {
416
+ if (handleNestedTablePasteWithAnalytics(editorAnalyticsAPI, isNestedTablesSupported(state.schema))(view, event, slice)(state, dispatch)) {
417
417
  return true;
418
418
  }
419
419
  if (handlePasteIntoTaskAndDecisionWithAnalytics(view, event, slice, isPlainText ? PasteTypes.plain : PasteTypes.richText, pluginInjectionApi)(state, dispatch)) {
@@ -5,6 +5,7 @@ import { DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
5
5
  import { mapSlice, removeNestedEmptyEls, unwrap, walkUpTreeUntil } from '@atlaskit/editor-common/utils';
6
6
  import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
7
7
  import { getRandomHex } from '@atlaskit/media-common';
8
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
8
9
  /**
9
10
  * Ensure correct layout in nested mode
10
11
  *
@@ -163,6 +164,11 @@ export var unwrapNestedMediaElements = function unwrapNestedMediaElements(html)
163
164
  return;
164
165
  }
165
166
 
167
+ // Bypass emoji
168
+ if (imageTag.className.includes('emoji-common-emoji-image') && expVal('platform_editor_fix_emoji_paste_html', 'isEnabled', false)) {
169
+ return;
170
+ }
171
+
166
172
  // If either the parent or the image itself contains styles that would make
167
173
  // them invisible on copy, dont paste them.
168
174
  if (isElementInvisible(mediaParent) || isElementInvisible(imageTag)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "8.0.1",
3
+ "version": "8.0.3",
4
4
  "description": "Paste plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,10 +33,10 @@
33
33
  "@atlaskit/editor-plugin-analytics": "^7.0.0",
34
34
  "@atlaskit/editor-plugin-annotation": "^7.0.0",
35
35
  "@atlaskit/editor-plugin-better-type-history": "^7.0.0",
36
- "@atlaskit/editor-plugin-card": "^12.0.0",
36
+ "@atlaskit/editor-plugin-card": "^12.1.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.0.0",
39
+ "@atlaskit/editor-plugin-media": "^9.3.0",
40
40
  "@atlaskit/editor-plugin-mentions": "^9.0.0",
41
41
  "@atlaskit/editor-prosemirror": "^7.2.0",
42
42
  "@atlaskit/editor-tables": "^2.9.0",
@@ -45,14 +45,14 @@
45
45
  "@atlaskit/media-common": "^12.3.0",
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
47
  "@atlaskit/prosemirror-history": "^0.2.0",
48
- "@atlaskit/tmp-editor-statsig": "^16.3.0",
48
+ "@atlaskit/tmp-editor-statsig": "^16.13.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "lodash": "^4.17.21",
51
51
  "react-intl-next": "npm:react-intl@^5.18.1",
52
52
  "uuid": "^3.1.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^111.0.0",
55
+ "@atlaskit/editor-common": "^111.7.0",
56
56
  "react": "^18.2.0",
57
57
  "react-dom": "^18.2.0"
58
58
  },
@@ -97,9 +97,6 @@
97
97
  }
98
98
  },
99
99
  "platform-feature-flags": {
100
- "platform_editor_use_nested_table_pm_nodes": {
101
- "type": "boolean"
102
- },
103
100
  "platform_editor_fix_captions_on_copy": {
104
101
  "type": "boolean"
105
102
  },