@atlaskit/editor-plugin-code-block-advanced 2.1.0 → 2.1.2

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-code-block-advanced
2
2
 
3
+ ## 2.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#122467](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122467)
8
+ [`c8953846d7bc3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c8953846d7bc3) -
9
+ Fix copying the code block on safari.
10
+
11
+ ## 2.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 2.1.0
4
18
 
5
19
  ### Minor Changes
@@ -226,7 +226,7 @@ var CodeBlockAdvancedNodeView = /*#__PURE__*/function () {
226
226
  }, 20);
227
227
  }
228
228
  // If we have selected the node we should not stop these events
229
- if (e instanceof KeyboardEvent && this.view.state.selection instanceof _state2.NodeSelection && this.view.state.selection.from === ((_this$getPos5 = this.getPos) === null || _this$getPos5 === void 0 ? void 0 : _this$getPos5.call(this))) {
229
+ if ((e instanceof KeyboardEvent || e instanceof ClipboardEvent) && this.view.state.selection instanceof _state2.NodeSelection && this.view.state.selection.from === ((_this$getPos5 = this.getPos) === null || _this$getPos5 === void 0 ? void 0 : _this$getPos5.call(this))) {
230
230
  return false;
231
231
  }
232
232
  return true;
@@ -182,7 +182,7 @@ class CodeBlockAdvancedNodeView {
182
182
  }, 20);
183
183
  }
184
184
  // If we have selected the node we should not stop these events
185
- if (e instanceof KeyboardEvent && this.view.state.selection instanceof NodeSelection && this.view.state.selection.from === ((_this$getPos5 = this.getPos) === null || _this$getPos5 === void 0 ? void 0 : _this$getPos5.call(this))) {
185
+ if ((e instanceof KeyboardEvent || e instanceof ClipboardEvent) && this.view.state.selection instanceof NodeSelection && this.view.state.selection.from === ((_this$getPos5 = this.getPos) === null || _this$getPos5 === void 0 ? void 0 : _this$getPos5.call(this))) {
186
186
  return false;
187
187
  }
188
188
  return true;
@@ -219,7 +219,7 @@ var CodeBlockAdvancedNodeView = /*#__PURE__*/function () {
219
219
  }, 20);
220
220
  }
221
221
  // If we have selected the node we should not stop these events
222
- if (e instanceof KeyboardEvent && this.view.state.selection instanceof NodeSelection && this.view.state.selection.from === ((_this$getPos5 = this.getPos) === null || _this$getPos5 === void 0 ? void 0 : _this$getPos5.call(this))) {
222
+ if ((e instanceof KeyboardEvent || e instanceof ClipboardEvent) && this.view.state.selection instanceof NodeSelection && this.view.state.selection.from === ((_this$getPos5 = this.getPos) === null || _this$getPos5 === void 0 ? void 0 : _this$getPos5.call(this))) {
223
223
  return false;
224
224
  }
225
225
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block-advanced",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "CodeBlockAdvanced plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^47.6.0",
36
- "@atlaskit/editor-common": "^100.5.0",
36
+ "@atlaskit/editor-common": "^101.1.0",
37
37
  "@atlaskit/editor-plugin-code-block": "^4.1.0",
38
38
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
39
39
  "@atlaskit/editor-plugin-find-replace": "^2.0.0",
@@ -235,7 +235,7 @@ class CodeBlockAdvancedNodeView implements NodeView {
235
235
  }
236
236
  // If we have selected the node we should not stop these events
237
237
  if (
238
- e instanceof KeyboardEvent &&
238
+ (e instanceof KeyboardEvent || e instanceof ClipboardEvent) &&
239
239
  this.view.state.selection instanceof NodeSelection &&
240
240
  this.view.state.selection.from === this.getPos?.()
241
241
  ) {