@atlaskit/editor-plugin-code-block-advanced 2.3.5 → 2.4.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-code-block-advanced
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#175595](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/175595)
8
+ [`b041b53e6615d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b041b53e6615d) -
9
+ ED-28347 bubble dragenter event from adv code block
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 2.3.5
4
16
 
5
17
  ### Patch Changes
@@ -17,6 +17,7 @@ var _codeBlock = require("@atlaskit/editor-common/code-block");
17
17
  var _whitespace = require("@atlaskit/editor-common/whitespace");
18
18
  var _state2 = require("@atlaskit/editor-prosemirror/state");
19
19
  var _view2 = require("@atlaskit/editor-prosemirror/view");
20
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
20
21
  var _syntaxHighlightingTheme = require("../ui/syntaxHighlightingTheme");
21
22
  var _theme = require("../ui/theme");
22
23
  var _syncCMWithPM = require("./codemirrorSync/syncCMWithPM");
@@ -264,6 +265,9 @@ var CodeBlockAdvancedNodeView = /*#__PURE__*/function () {
264
265
  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))) {
265
266
  return false;
266
267
  }
268
+ if (e instanceof DragEvent && e.type === 'dragenter' && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_controls_perf_optimization', 'isEnabled', true)) {
269
+ return false; // Allow dragenter to propagate so that the editor can handle it
270
+ }
267
271
  return true;
268
272
  }
269
273
  }]);
@@ -7,6 +7,7 @@ import { isCodeBlockWordWrapEnabled } from '@atlaskit/editor-common/code-block';
7
7
  import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
8
8
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
9
9
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
10
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
10
11
  import { highlightStyle } from '../ui/syntaxHighlightingTheme';
11
12
  import { cmTheme } from '../ui/theme';
12
13
  import { syncCMWithPM } from './codemirrorSync/syncCMWithPM';
@@ -213,6 +214,9 @@ class CodeBlockAdvancedNodeView {
213
214
  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))) {
214
215
  return false;
215
216
  }
217
+ if (e instanceof DragEvent && e.type === 'dragenter' && expValEqualsNoExposure('platform_editor_block_controls_perf_optimization', 'isEnabled', true)) {
218
+ return false; // Allow dragenter to propagate so that the editor can handle it
219
+ }
216
220
  return true;
217
221
  }
218
222
  }
@@ -10,6 +10,7 @@ import { isCodeBlockWordWrapEnabled } from '@atlaskit/editor-common/code-block';
10
10
  import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
11
11
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
12
12
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
13
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
13
14
  import { highlightStyle } from '../ui/syntaxHighlightingTheme';
14
15
  import { cmTheme } from '../ui/theme';
15
16
  import { syncCMWithPM } from './codemirrorSync/syncCMWithPM';
@@ -257,6 +258,9 @@ var CodeBlockAdvancedNodeView = /*#__PURE__*/function () {
257
258
  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))) {
258
259
  return false;
259
260
  }
261
+ if (e instanceof DragEvent && e.type === 'dragenter' && expValEqualsNoExposure('platform_editor_block_controls_perf_optimization', 'isEnabled', true)) {
262
+ return false; // Allow dragenter to propagate so that the editor can handle it
263
+ }
260
264
  return true;
261
265
  }
262
266
  }]);
@@ -1,4 +1,4 @@
1
- import { LanguageSupport } from '@codemirror/language';
1
+ import { type LanguageSupport } from '@codemirror/language';
2
2
  import type { Extension } from '@codemirror/state';
3
3
  /**
4
4
  * Manages loading the languages (for syntax highlighting, etc.)
@@ -1,4 +1,4 @@
1
- import { HighlightStyle, Language } from '@codemirror/language';
1
+ import { HighlightStyle, type Language } from '@codemirror/language';
2
2
  export declare const highlightStyle: HighlightStyle;
3
3
  /**
4
4
  * Prismjs (renderer) and codemirror (editor) tokenise slightly differently,
@@ -1,4 +1,4 @@
1
- import { LanguageSupport } from '@codemirror/language';
1
+ import { type LanguageSupport } from '@codemirror/language';
2
2
  import type { Extension } from '@codemirror/state';
3
3
  /**
4
4
  * Manages loading the languages (for syntax highlighting, etc.)
@@ -1,4 +1,4 @@
1
- import { HighlightStyle, Language } from '@codemirror/language';
1
+ import { HighlightStyle, type Language } from '@codemirror/language';
2
2
  export declare const highlightStyle: HighlightStyle;
3
3
  /**
4
4
  * Prismjs (renderer) and codemirror (editor) tokenise slightly differently,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block-advanced",
3
- "version": "2.3.5",
3
+ "version": "2.4.0",
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": "^107.0.0",
36
+ "@atlaskit/editor-common": "^107.2.0",
37
37
  "@atlaskit/editor-plugin-code-block": "^4.4.0",
38
38
  "@atlaskit/editor-plugin-editor-disabled": "^2.1.0",
39
39
  "@atlaskit/editor-plugin-find-replace": "^2.7.0",
@@ -41,8 +41,8 @@
41
41
  "@atlaskit/editor-plugin-selection-marker": "^2.5.0",
42
42
  "@atlaskit/editor-prosemirror": "7.0.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
- "@atlaskit/tmp-editor-statsig": "^8.0.0",
45
- "@atlaskit/tokens": "^5.3.0",
44
+ "@atlaskit/tmp-editor-statsig": "^8.1.0",
45
+ "@atlaskit/tokens": "^5.4.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "@codemirror/autocomplete": "6.18.4",
48
48
  "@codemirror/commands": "6.7.1",
@@ -28,6 +28,7 @@ import type {
28
28
  NodeView,
29
29
  } from '@atlaskit/editor-prosemirror/view';
30
30
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
31
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
31
32
 
32
33
  import type { CodeBlockAdvancedPlugin } from '../codeBlockAdvancedPluginType';
33
34
  import { highlightStyle } from '../ui/syntaxHighlightingTheme';
@@ -289,6 +290,15 @@ class CodeBlockAdvancedNodeView implements NodeView {
289
290
  ) {
290
291
  return false;
291
292
  }
293
+
294
+ if (
295
+ e instanceof DragEvent &&
296
+ e.type === 'dragenter' &&
297
+ expValEqualsNoExposure('platform_editor_block_controls_perf_optimization', 'isEnabled', true)
298
+ ) {
299
+ return false; // Allow dragenter to propagate so that the editor can handle it
300
+ }
301
+
292
302
  return true;
293
303
  }
294
304
  }
@@ -1,4 +1,4 @@
1
- import { LanguageSupport, syntaxHighlighting } from '@codemirror/language';
1
+ import { type LanguageSupport, syntaxHighlighting } from '@codemirror/language';
2
2
  import type { Extension } from '@codemirror/state';
3
3
 
4
4
  import { languageStyling } from '../../ui/syntaxHighlightingTheme';
@@ -1,4 +1,4 @@
1
- import { HighlightStyle, Language } from '@codemirror/language';
1
+ import { HighlightStyle, type Language } from '@codemirror/language';
2
2
  import { tags } from '@lezer/highlight';
3
3
 
4
4
  import { token } from '@atlaskit/tokens';