@atlaskit/editor-plugin-code-block-advanced 1.1.2 → 2.1.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,35 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block-advanced
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#120472](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120472)
|
|
8
|
+
[`73c800ab5f2fc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73c800ab5f2fc) -
|
|
9
|
+
ED-26766 update adf-schema from 47.2.1 to 47.6.0 and adf-schema-json from 1.27.0 to 1.31.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 2.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)
|
|
20
|
+
[`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -
|
|
21
|
+
This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the
|
|
22
|
+
status of only supporting React 18 going forward. No explicit breaking change to React support has
|
|
23
|
+
been made in this release, but this is to signify going forward, breaking changes for React 16 or
|
|
24
|
+
React 17 may come via non-major semver releases.
|
|
25
|
+
|
|
26
|
+
Please refer this community post for more details:
|
|
27
|
+
https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
|
|
3
33
|
## 1.1.2
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -78,6 +78,23 @@ var codeBlockKeymap = function codeBlockKeymap(_ref2) {
|
|
|
78
78
|
onMaybeNodeSelection: onMaybeNodeSelection
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
+
}, {
|
|
82
|
+
key: 'Ctrl-a',
|
|
83
|
+
mac: 'Cmd-a',
|
|
84
|
+
run: function run(cm) {
|
|
85
|
+
var isFullBlockSelection = cm.state.selection.main.from === 0 && cm.state.selection.main.to === getNode().content.size;
|
|
86
|
+
|
|
87
|
+
// Allow codemirror to handle
|
|
88
|
+
if (!isFullBlockSelection) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Move the selection and focus into prosemirror
|
|
93
|
+
onMaybeNodeSelection();
|
|
94
|
+
view.focus();
|
|
95
|
+
(0, _commands2.selectAll)(view.state, view.dispatch);
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
81
98
|
}, {
|
|
82
99
|
key: 'ArrowRight',
|
|
83
100
|
run: function run(cm) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultKeymap, indentWithTab } from '@codemirror/commands';
|
|
2
2
|
import { keymap as cmKeymap } from '@codemirror/view';
|
|
3
3
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
4
|
-
import { exitCode } from '@atlaskit/editor-prosemirror/commands';
|
|
4
|
+
import { exitCode, selectAll } from '@atlaskit/editor-prosemirror/commands';
|
|
5
5
|
import { undo, redo } from '@atlaskit/editor-prosemirror/history';
|
|
6
6
|
import { backspaceKeymap } from './backspace';
|
|
7
7
|
import { maybeEscapeKeymap } from './maybeEscape';
|
|
@@ -66,6 +66,23 @@ const codeBlockKeymap = ({
|
|
|
66
66
|
selectCodeBlockNode,
|
|
67
67
|
onMaybeNodeSelection
|
|
68
68
|
})
|
|
69
|
+
}, {
|
|
70
|
+
key: 'Ctrl-a',
|
|
71
|
+
mac: 'Cmd-a',
|
|
72
|
+
run: cm => {
|
|
73
|
+
const isFullBlockSelection = cm.state.selection.main.from === 0 && cm.state.selection.main.to === getNode().content.size;
|
|
74
|
+
|
|
75
|
+
// Allow codemirror to handle
|
|
76
|
+
if (!isFullBlockSelection) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Move the selection and focus into prosemirror
|
|
81
|
+
onMaybeNodeSelection();
|
|
82
|
+
view.focus();
|
|
83
|
+
selectAll(view.state, view.dispatch);
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
69
86
|
}, {
|
|
70
87
|
key: 'ArrowRight',
|
|
71
88
|
run: cm => maybeEscapeKeymap({
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
2
2
|
import { defaultKeymap, indentWithTab } from '@codemirror/commands';
|
|
3
3
|
import { keymap as cmKeymap } from '@codemirror/view';
|
|
4
4
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
5
|
-
import { exitCode } from '@atlaskit/editor-prosemirror/commands';
|
|
5
|
+
import { exitCode, selectAll } from '@atlaskit/editor-prosemirror/commands';
|
|
6
6
|
import { undo, redo } from '@atlaskit/editor-prosemirror/history';
|
|
7
7
|
import { backspaceKeymap } from './backspace';
|
|
8
8
|
import { maybeEscapeKeymap } from './maybeEscape';
|
|
@@ -71,6 +71,23 @@ var codeBlockKeymap = function codeBlockKeymap(_ref2) {
|
|
|
71
71
|
onMaybeNodeSelection: onMaybeNodeSelection
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
+
}, {
|
|
75
|
+
key: 'Ctrl-a',
|
|
76
|
+
mac: 'Cmd-a',
|
|
77
|
+
run: function run(cm) {
|
|
78
|
+
var isFullBlockSelection = cm.state.selection.main.from === 0 && cm.state.selection.main.to === getNode().content.size;
|
|
79
|
+
|
|
80
|
+
// Allow codemirror to handle
|
|
81
|
+
if (!isFullBlockSelection) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Move the selection and focus into prosemirror
|
|
86
|
+
onMaybeNodeSelection();
|
|
87
|
+
view.focus();
|
|
88
|
+
selectAll(view.state, view.dispatch);
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
74
91
|
}, {
|
|
75
92
|
key: 'ArrowRight',
|
|
76
93
|
run: function run(cm) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-block-advanced",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "CodeBlockAdvanced plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^47.
|
|
36
|
-
"@atlaskit/editor-common": "^
|
|
37
|
-
"@atlaskit/editor-plugin-code-block": "^
|
|
38
|
-
"@atlaskit/editor-plugin-editor-disabled": "^
|
|
39
|
-
"@atlaskit/editor-plugin-find-replace": "^
|
|
40
|
-
"@atlaskit/editor-plugin-selection": "^
|
|
41
|
-
"@atlaskit/editor-plugin-selection-marker": "^
|
|
35
|
+
"@atlaskit/adf-schema": "^47.6.0",
|
|
36
|
+
"@atlaskit/editor-common": "^100.5.0",
|
|
37
|
+
"@atlaskit/editor-plugin-code-block": "^4.1.0",
|
|
38
|
+
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
39
|
+
"@atlaskit/editor-plugin-find-replace": "^2.0.0",
|
|
40
|
+
"@atlaskit/editor-plugin-selection": "^2.0.0",
|
|
41
|
+
"@atlaskit/editor-plugin-selection-marker": "^2.0.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
43
|
-
"@atlaskit/tokens": "^
|
|
43
|
+
"@atlaskit/tokens": "^4.3.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@codemirror/autocomplete": "6.18.4",
|
|
46
46
|
"@codemirror/commands": "6.7.1",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"codemirror-lang-elixir": "4.0.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"react": "^
|
|
56
|
+
"react": "^18.2.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@atlaskit/code": "^
|
|
59
|
+
"@atlaskit/code": "^16.0.0",
|
|
60
60
|
"typescript": "~5.4.2"
|
|
61
61
|
},
|
|
62
62
|
"techstack": {
|
|
@@ -5,7 +5,7 @@ import { KeyBinding, keymap as cmKeymap } from '@codemirror/view';
|
|
|
5
5
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
6
6
|
import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
7
7
|
import type { getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
8
|
-
import { exitCode } from '@atlaskit/editor-prosemirror/commands';
|
|
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
11
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -93,6 +93,26 @@ const codeBlockKeymap = ({
|
|
|
93
93
|
onMaybeNodeSelection,
|
|
94
94
|
}),
|
|
95
95
|
},
|
|
96
|
+
{
|
|
97
|
+
key: 'Ctrl-a',
|
|
98
|
+
mac: 'Cmd-a',
|
|
99
|
+
run: (cm) => {
|
|
100
|
+
const isFullBlockSelection =
|
|
101
|
+
cm.state.selection.main.from === 0 &&
|
|
102
|
+
cm.state.selection.main.to === getNode().content.size;
|
|
103
|
+
|
|
104
|
+
// Allow codemirror to handle
|
|
105
|
+
if (!isFullBlockSelection) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Move the selection and focus into prosemirror
|
|
110
|
+
onMaybeNodeSelection();
|
|
111
|
+
view.focus();
|
|
112
|
+
selectAll(view.state, view.dispatch);
|
|
113
|
+
return true;
|
|
114
|
+
},
|
|
115
|
+
},
|
|
96
116
|
{
|
|
97
117
|
key: 'ArrowRight',
|
|
98
118
|
run: (cm) =>
|