@atlaskit/editor-plugin-block-menu 3.2.8 → 3.2.9

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-block-menu
2
2
 
3
+ ## 3.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3a405e30c22dc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a405e30c22dc) -
8
+ ED-29384: Fixed copy texts in extension, pasted the extension
9
+ - Updated dependencies
10
+
3
11
  ## 3.2.8
4
12
 
5
13
  ### Patch Changes
@@ -66,12 +66,12 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
66
66
  fragment = (layoutContent === null || layoutContent === void 0 ? void 0 : layoutContent.content) || _model.Fragment.empty;
67
67
  }
68
68
 
69
- // if text is inside of an expand, the selection contains an expand for some reason
70
- // the expandNode always and only have one child, no matter how much contents are inside the expand,
69
+ // if text is inside of an expand or extension, the selection contains an expand or extension for some reason
70
+ // the expandNode or extensionNode always and only have one child, no matter how much contents are inside the expand or extension,
71
71
  // and the one child is the line that is being selected, so we can use the .firstChild again
72
- if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && fragment.firstChild.type.name === 'expand') {
73
- var expandNode = fragment.firstChild;
74
- var actualNodeToCopy = expandNode.firstChild;
72
+ if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && (fragment.firstChild.type.name === 'expand' || fragment.firstChild.type.name === 'bodiedExtension' && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_patch_2'))) {
73
+ var expandOrExtensionNode = fragment.firstChild;
74
+ var actualNodeToCopy = expandOrExtensionNode.firstChild;
75
75
  fragment = _model.Fragment.from(actualNodeToCopy) || _model.Fragment.empty;
76
76
  }
77
77
  var domNode = toDOMFromFragment(fragment, schema);
@@ -59,12 +59,12 @@ const CopyBlockMenuItem = ({
59
59
  fragment = (layoutContent === null || layoutContent === void 0 ? void 0 : layoutContent.content) || Fragment.empty;
60
60
  }
61
61
 
62
- // if text is inside of an expand, the selection contains an expand for some reason
63
- // the expandNode always and only have one child, no matter how much contents are inside the expand,
62
+ // if text is inside of an expand or extension, the selection contains an expand or extension for some reason
63
+ // the expandNode or extensionNode always and only have one child, no matter how much contents are inside the expand or extension,
64
64
  // and the one child is the line that is being selected, so we can use the .firstChild again
65
- if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && fragment.firstChild.type.name === 'expand') {
66
- const expandNode = fragment.firstChild;
67
- const actualNodeToCopy = expandNode.firstChild;
65
+ if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && (fragment.firstChild.type.name === 'expand' || fragment.firstChild.type.name === 'bodiedExtension' && fg('platform_editor_block_menu_patch_2'))) {
66
+ const expandOrExtensionNode = fragment.firstChild;
67
+ const actualNodeToCopy = expandOrExtensionNode.firstChild;
68
68
  fragment = Fragment.from(actualNodeToCopy) || Fragment.empty;
69
69
  }
70
70
  const domNode = toDOMFromFragment(fragment, schema);
@@ -59,12 +59,12 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
59
59
  fragment = (layoutContent === null || layoutContent === void 0 ? void 0 : layoutContent.content) || Fragment.empty;
60
60
  }
61
61
 
62
- // if text is inside of an expand, the selection contains an expand for some reason
63
- // the expandNode always and only have one child, no matter how much contents are inside the expand,
62
+ // if text is inside of an expand or extension, the selection contains an expand or extension for some reason
63
+ // the expandNode or extensionNode always and only have one child, no matter how much contents are inside the expand or extension,
64
64
  // and the one child is the line that is being selected, so we can use the .firstChild again
65
- if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && fragment.firstChild.type.name === 'expand') {
66
- var expandNode = fragment.firstChild;
67
- var actualNodeToCopy = expandNode.firstChild;
65
+ if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && (fragment.firstChild.type.name === 'expand' || fragment.firstChild.type.name === 'bodiedExtension' && fg('platform_editor_block_menu_patch_2'))) {
66
+ var expandOrExtensionNode = fragment.firstChild;
67
+ var actualNodeToCopy = expandOrExtensionNode.firstChild;
68
68
  fragment = Fragment.from(actualNodeToCopy) || Fragment.empty;
69
69
  }
70
70
  var domNode = toDOMFromFragment(fragment, schema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "3.2.8",
3
+ "version": "3.2.9",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/icon-lab": "^5.7.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/primitives": "^14.15.0",
45
- "@atlaskit/tmp-editor-statsig": "^12.30.0",
45
+ "@atlaskit/tmp-editor-statsig": "^12.31.0",
46
46
  "@atlaskit/tokens": "^6.3.0",
47
47
  "@babel/runtime": "^7.0.0"
48
48
  },
@@ -102,6 +102,9 @@
102
102
  },
103
103
  "platform_editor_block_menu_for_disabled_nodes": {
104
104
  "type": "boolean"
105
+ },
106
+ "platform_editor_block_menu_patch_2": {
107
+ "type": "boolean"
105
108
  }
106
109
  }
107
110
  }