@atlaskit/editor-plugin-code-block-advanced 2.3.5 → 3.0.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 +52 -0
- package/afm-cc/tsconfig.json +3 -3
- package/afm-jira/tsconfig.json +3 -3
- package/afm-post-office/tsconfig.json +3 -3
- package/dist/cjs/nodeviews/codeBlockAdvanced.js +4 -0
- package/dist/es2019/nodeviews/codeBlockAdvanced.js +4 -0
- package/dist/esm/nodeviews/codeBlockAdvanced.js +4 -0
- package/dist/types/nodeviews/codeBlockAdvanced.d.ts +2 -2
- package/dist/types/nodeviews/codemirrorSync/syncCMWithPM.d.ts +2 -2
- package/dist/types/nodeviews/extensions/keymap/backspace.d.ts +2 -2
- package/dist/types/nodeviews/extensions/keymap/index.d.ts +2 -2
- package/dist/types/nodeviews/extensions/keymap/maybeEscape.d.ts +2 -2
- package/dist/types/nodeviews/extensions/prosemirrorDecorations.d.ts +2 -2
- package/dist/types/nodeviews/languages/loader.d.ts +1 -1
- package/dist/types/ui/syntaxHighlightingTheme.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/codeBlockAdvanced.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/codemirrorSync/syncCMWithPM.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/extensions/keymap/backspace.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/extensions/keymap/index.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/extensions/keymap/maybeEscape.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/extensions/prosemirrorDecorations.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/languages/loader.d.ts +1 -1
- package/dist/types-ts4.5/ui/syntaxHighlightingTheme.d.ts +1 -1
- package/package.json +10 -11
- package/src/nodeviews/codeBlockAdvanced.ts +14 -4
- package/src/nodeviews/codemirrorSync/syncCMWithPM.ts +2 -2
- package/src/nodeviews/extensions/keymap/backspace.ts +2 -2
- package/src/nodeviews/extensions/keymap/index.ts +2 -2
- package/src/nodeviews/extensions/keymap/maybeEscape.ts +2 -2
- package/src/nodeviews/extensions/prosemirrorDecorations.ts +3 -3
- package/src/nodeviews/languages/loader.ts +1 -1
- package/src/ui/syntaxHighlightingTheme.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block-advanced
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#181024](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181024)
|
|
8
|
+
[`8e80c487ca307`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e80c487ca307) - ##
|
|
9
|
+
Make `@atlaskit/editor-common` a peer dependency
|
|
10
|
+
|
|
11
|
+
**WHAT:** `@atlaskit/editor-common` has been moved from `dependencies` to `peerDependencies` in
|
|
12
|
+
all editor plugin packages.
|
|
13
|
+
|
|
14
|
+
**WHY:** This change ensures that only a single version of `@atlaskit/editor-common` is used in
|
|
15
|
+
consuming applications, preventing issues caused by multiple versions of singleton libraries (such
|
|
16
|
+
as context mismatches or duplicated state). This is especially important for packages that rely on
|
|
17
|
+
shared context or singletons.
|
|
18
|
+
|
|
19
|
+
**HOW TO ADJUST:**
|
|
20
|
+
|
|
21
|
+
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
22
|
+
any of these editor plugins.
|
|
23
|
+
- Ensure the version you install matches the version required by the plugins.
|
|
24
|
+
- You can use the
|
|
25
|
+
[`check-peer-dependencies`](https://www.npmjs.com/package/check-peer-dependencies) package to
|
|
26
|
+
verify that all required peer dependencies are installed and compatible.
|
|
27
|
+
- Example install command:
|
|
28
|
+
```
|
|
29
|
+
npm install @atlaskit/editor-common
|
|
30
|
+
```
|
|
31
|
+
or
|
|
32
|
+
```
|
|
33
|
+
yarn add @atlaskit/editor-common
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Note:** This is a breaking change. If `@atlaskit/editor-common` is not installed at the
|
|
37
|
+
application level, you may see errors or unexpected behavior.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
|
|
43
|
+
## 2.4.0
|
|
44
|
+
|
|
45
|
+
### Minor Changes
|
|
46
|
+
|
|
47
|
+
- [#175595](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/175595)
|
|
48
|
+
[`b041b53e6615d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b041b53e6615d) -
|
|
49
|
+
ED-28347 bubble dragenter event from adv code block
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies
|
|
54
|
+
|
|
3
55
|
## 2.3.5
|
|
4
56
|
|
|
5
57
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -17,9 +17,6 @@
|
|
|
17
17
|
"../src/**/examples.*"
|
|
18
18
|
],
|
|
19
19
|
"references": [
|
|
20
|
-
{
|
|
21
|
-
"path": "../../editor-common/afm-cc/tsconfig.json"
|
|
22
|
-
},
|
|
23
20
|
{
|
|
24
21
|
"path": "../../editor-plugin-code-block/afm-cc/tsconfig.json"
|
|
25
22
|
},
|
|
@@ -43,6 +40,9 @@
|
|
|
43
40
|
},
|
|
44
41
|
{
|
|
45
42
|
"path": "../../../design-system/tokens/afm-cc/tsconfig.json"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"path": "../../editor-common/afm-cc/tsconfig.json"
|
|
46
46
|
}
|
|
47
47
|
]
|
|
48
48
|
}
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -17,9 +17,6 @@
|
|
|
17
17
|
"../src/**/examples.*"
|
|
18
18
|
],
|
|
19
19
|
"references": [
|
|
20
|
-
{
|
|
21
|
-
"path": "../../editor-common/afm-jira/tsconfig.json"
|
|
22
|
-
},
|
|
23
20
|
{
|
|
24
21
|
"path": "../../editor-plugin-code-block/afm-jira/tsconfig.json"
|
|
25
22
|
},
|
|
@@ -43,6 +40,9 @@
|
|
|
43
40
|
},
|
|
44
41
|
{
|
|
45
42
|
"path": "../../../design-system/tokens/afm-jira/tsconfig.json"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"path": "../../editor-common/afm-jira/tsconfig.json"
|
|
46
46
|
}
|
|
47
47
|
]
|
|
48
48
|
}
|
|
@@ -17,9 +17,6 @@
|
|
|
17
17
|
"../src/**/examples.*"
|
|
18
18
|
],
|
|
19
19
|
"references": [
|
|
20
|
-
{
|
|
21
|
-
"path": "../../editor-common/afm-post-office/tsconfig.json"
|
|
22
|
-
},
|
|
23
20
|
{
|
|
24
21
|
"path": "../../editor-plugin-code-block/afm-post-office/tsconfig.json"
|
|
25
22
|
},
|
|
@@ -43,6 +40,9 @@
|
|
|
43
40
|
},
|
|
44
41
|
{
|
|
45
42
|
"path": "../../../design-system/tokens/afm-post-office/tsconfig.json"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"path": "../../editor-common/afm-post-office/tsconfig.json"
|
|
46
46
|
}
|
|
47
47
|
]
|
|
48
48
|
}
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
|
-
import { ViewUpdate } from '@codemirror/view';
|
|
2
|
+
import { type ViewUpdate } from '@codemirror/view';
|
|
3
3
|
import type { getPosHandler, getPosHandlerNode, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { CodeBlockAdvancedPlugin } from '../codeBlockAdvancedPluginType';
|
|
7
7
|
interface ConfigProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ViewUpdate } from '@codemirror/view';
|
|
2
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
1
|
+
import { type ViewUpdate } from '@codemirror/view';
|
|
2
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
interface Props {
|
|
4
4
|
view: EditorView;
|
|
5
5
|
update: ViewUpdate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EditorView as CodeMirror } from '@codemirror/view';
|
|
1
|
+
import { type EditorView as CodeMirror } from '@codemirror/view';
|
|
2
2
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
interface BackspaceProps {
|
|
6
6
|
view: EditorView;
|
|
7
7
|
cm: CodeMirror;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
|
-
import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
2
|
+
import { type RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
interface KeymapProps {
|
|
7
7
|
view: EditorView;
|
|
8
8
|
getNode: () => PMNode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EditorView as CodeMirror } from '@codemirror/view';
|
|
1
|
+
import { type EditorView as CodeMirror } from '@codemirror/view';
|
|
2
2
|
import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
interface MaybeEscapeProps {
|
|
7
7
|
unit: 'line' | 'char';
|
|
8
8
|
dir: -1 | 1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Facet } from '@codemirror/state';
|
|
2
|
-
import { ViewPlugin, EditorView as CodeMirror, type DecorationSet, ViewUpdate } from '@codemirror/view';
|
|
1
|
+
import { type Facet } from '@codemirror/state';
|
|
2
|
+
import { ViewPlugin, type EditorView as CodeMirror, type DecorationSet, type ViewUpdate } from '@codemirror/view';
|
|
3
3
|
import type { EditorView, DecorationSource } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
/**
|
|
5
5
|
* Creates CodeMirror versions of the decorations provided by ProseMirror.
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
|
-
import { ViewUpdate } from '@codemirror/view';
|
|
2
|
+
import { type ViewUpdate } from '@codemirror/view';
|
|
3
3
|
import type { getPosHandler, getPosHandlerNode, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { Decoration, DecorationSource, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { CodeBlockAdvancedPlugin } from '../codeBlockAdvancedPluginType';
|
|
7
7
|
interface ConfigProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ViewUpdate } from '@codemirror/view';
|
|
2
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
1
|
+
import { type ViewUpdate } from '@codemirror/view';
|
|
2
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
interface Props {
|
|
4
4
|
view: EditorView;
|
|
5
5
|
update: ViewUpdate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EditorView as CodeMirror } from '@codemirror/view';
|
|
1
|
+
import { type EditorView as CodeMirror } from '@codemirror/view';
|
|
2
2
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
interface BackspaceProps {
|
|
6
6
|
view: EditorView;
|
|
7
7
|
cm: CodeMirror;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
|
-
import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
2
|
+
import { type RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
interface KeymapProps {
|
|
7
7
|
view: EditorView;
|
|
8
8
|
getNode: () => PMNode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EditorView as CodeMirror } from '@codemirror/view';
|
|
1
|
+
import { type EditorView as CodeMirror } from '@codemirror/view';
|
|
2
2
|
import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
interface MaybeEscapeProps {
|
|
7
7
|
unit: 'line' | 'char';
|
|
8
8
|
dir: -1 | 1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Facet } from '@codemirror/state';
|
|
2
|
-
import { ViewPlugin, EditorView as CodeMirror, type DecorationSet, ViewUpdate } from '@codemirror/view';
|
|
1
|
+
import { type Facet } from '@codemirror/state';
|
|
2
|
+
import { ViewPlugin, type EditorView as CodeMirror, type DecorationSet, type ViewUpdate } from '@codemirror/view';
|
|
3
3
|
import type { EditorView, DecorationSource } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
/**
|
|
5
5
|
* Creates CodeMirror versions of the decorations provided by ProseMirror.
|
|
@@ -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": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "CodeBlockAdvanced plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
"atlassian": {
|
|
11
11
|
"team": "Editor: Lego",
|
|
12
12
|
"releaseModel": "continuous",
|
|
13
|
-
"singleton": true
|
|
14
|
-
"runReact18": true
|
|
13
|
+
"singleton": true
|
|
15
14
|
},
|
|
16
15
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
17
16
|
"main": "dist/cjs/index.js",
|
|
@@ -33,16 +32,15 @@
|
|
|
33
32
|
},
|
|
34
33
|
"dependencies": {
|
|
35
34
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
36
|
-
"@atlaskit/editor-
|
|
37
|
-
"@atlaskit/editor-plugin-
|
|
38
|
-
"@atlaskit/editor-plugin-
|
|
39
|
-
"@atlaskit/editor-plugin-
|
|
40
|
-
"@atlaskit/editor-plugin-selection": "^
|
|
41
|
-
"@atlaskit/editor-plugin-selection-marker": "^2.5.0",
|
|
35
|
+
"@atlaskit/editor-plugin-code-block": "^5.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-editor-disabled": "^3.0.0",
|
|
37
|
+
"@atlaskit/editor-plugin-find-replace": "^3.0.0",
|
|
38
|
+
"@atlaskit/editor-plugin-selection": "^3.0.0",
|
|
39
|
+
"@atlaskit/editor-plugin-selection-marker": "^3.0.0",
|
|
42
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
43
41
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^8.
|
|
45
|
-
"@atlaskit/tokens": "^5.
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^8.7.0",
|
|
43
|
+
"@atlaskit/tokens": "^5.4.0",
|
|
46
44
|
"@babel/runtime": "^7.0.0",
|
|
47
45
|
"@codemirror/autocomplete": "6.18.4",
|
|
48
46
|
"@codemirror/commands": "6.7.1",
|
|
@@ -56,6 +54,7 @@
|
|
|
56
54
|
"codemirror-lang-elixir": "4.0.0"
|
|
57
55
|
},
|
|
58
56
|
"peerDependencies": {
|
|
57
|
+
"@atlaskit/editor-common": "^107.6.0",
|
|
59
58
|
"react": "^18.2.0"
|
|
60
59
|
},
|
|
61
60
|
"devDependencies": {
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
EditorSelection,
|
|
7
7
|
Facet,
|
|
8
8
|
EditorState as CodeMirrorState,
|
|
9
|
-
StateEffect,
|
|
9
|
+
type StateEffect,
|
|
10
10
|
} from '@codemirror/state';
|
|
11
|
-
import { EditorView as CodeMirror, lineNumbers, ViewUpdate, gutters } from '@codemirror/view';
|
|
11
|
+
import { EditorView as CodeMirror, lineNumbers, type ViewUpdate, gutters } from '@codemirror/view';
|
|
12
12
|
|
|
13
13
|
import { isCodeBlockWordWrapEnabled } from '@atlaskit/editor-common/code-block';
|
|
14
|
-
import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
14
|
+
import { type RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
15
15
|
import type {
|
|
16
16
|
getPosHandler,
|
|
17
17
|
getPosHandlerNode,
|
|
@@ -19,7 +19,7 @@ import type {
|
|
|
19
19
|
} from '@atlaskit/editor-common/types';
|
|
20
20
|
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
21
21
|
import { type EditorSelectionAPI } from '@atlaskit/editor-plugin-selection';
|
|
22
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
22
|
+
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
23
23
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
24
24
|
import type {
|
|
25
25
|
Decoration,
|
|
@@ -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,7 +1,7 @@
|
|
|
1
|
-
import { ViewUpdate } from '@codemirror/view';
|
|
1
|
+
import { type ViewUpdate } from '@codemirror/view';
|
|
2
2
|
|
|
3
3
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
view: EditorView;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EditorView as CodeMirror } from '@codemirror/view';
|
|
1
|
+
import { type EditorView as CodeMirror } from '@codemirror/view';
|
|
2
2
|
|
|
3
3
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
|
|
8
8
|
interface BackspaceProps {
|
|
9
9
|
view: EditorView;
|
|
@@ -3,12 +3,12 @@ import { type Extension } from '@codemirror/state';
|
|
|
3
3
|
import { type KeyBinding, keymap as cmKeymap } from '@codemirror/view';
|
|
4
4
|
|
|
5
5
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
6
|
-
import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
6
|
+
import { type RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
7
7
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
8
8
|
import { exitCode, selectAll } from '@atlaskit/editor-prosemirror/commands';
|
|
9
9
|
import { undo, redo } from '@atlaskit/editor-prosemirror/history';
|
|
10
10
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
11
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
14
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { EditorView as CodeMirror } from '@codemirror/view';
|
|
1
|
+
import { type EditorView as CodeMirror } from '@codemirror/view';
|
|
2
2
|
|
|
3
3
|
import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
4
4
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
|
|
9
9
|
interface MaybeEscapeProps {
|
|
10
10
|
unit: 'line' | 'char';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Facet } from '@codemirror/state';
|
|
1
|
+
import { type Facet } from '@codemirror/state';
|
|
2
2
|
import {
|
|
3
3
|
ViewPlugin,
|
|
4
4
|
WidgetType,
|
|
5
5
|
Decoration as CodeMirrorDecoration,
|
|
6
|
-
EditorView as CodeMirror,
|
|
6
|
+
type EditorView as CodeMirror,
|
|
7
7
|
type DecorationSet,
|
|
8
|
-
ViewUpdate,
|
|
8
|
+
type ViewUpdate,
|
|
9
9
|
} from '@codemirror/view';
|
|
10
10
|
|
|
11
11
|
import type { EditorView, Decoration, DecorationSource } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -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';
|