@atlaskit/editor-plugin-paste 8.0.2 → 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,13 @@
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
+
3
11
  ## 8.0.2
4
12
 
5
13
  ### Patch Changes
@@ -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)) {
@@ -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)) {
@@ -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.2",
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.1.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.4.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.2.0",
55
+ "@atlaskit/editor-common": "^111.7.0",
56
56
  "react": "^18.2.0",
57
57
  "react-dom": "^18.2.0"
58
58
  },