@atlaskit/editor-plugin-code-block-advanced 2.2.13 → 2.3.1
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 +15 -0
- package/afm-cc/tsconfig.json +7 -1
- package/afm-jira/tsconfig.json +6 -0
- package/afm-post-office/tsconfig.json +6 -0
- package/dist/cjs/nodeviews/extensions/keymap/index.js +36 -0
- package/dist/es2019/nodeviews/extensions/keymap/index.js +36 -0
- package/dist/esm/nodeviews/extensions/keymap/index.js +36 -0
- package/package.json +11 -4
- package/src/nodeviews/extensions/keymap/index.ts +48 -0
- package/tsconfig.app.json +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block-advanced
|
|
2
2
|
|
|
3
|
+
## 2.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#166502](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/166502)
|
|
14
|
+
[`ea1ed63fc9615`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ea1ed63fc9615) -
|
|
15
|
+
ED-28032 add keyboard shortcuts for new resizing experience behind
|
|
16
|
+
platform_editor_breakout_resizing
|
|
17
|
+
|
|
3
18
|
## 2.2.13
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"target": "es5",
|
|
5
5
|
"composite": true,
|
|
6
|
-
"outDir": "
|
|
6
|
+
"outDir": "../../../../../confluence/tsDist/@atlaskit__editor-plugin-code-block-advanced",
|
|
7
7
|
"rootDir": "../"
|
|
8
8
|
},
|
|
9
9
|
"include": [
|
|
@@ -35,6 +35,12 @@
|
|
|
35
35
|
{
|
|
36
36
|
"path": "../../editor-plugin-selection-marker/afm-cc/tsconfig.json"
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "../../tmp-editor-statsig/afm-cc/tsconfig.json"
|
|
43
|
+
},
|
|
38
44
|
{
|
|
39
45
|
"path": "../../../design-system/tokens/afm-cc/tsconfig.json"
|
|
40
46
|
}
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -35,6 +35,12 @@
|
|
|
35
35
|
{
|
|
36
36
|
"path": "../../editor-plugin-selection-marker/afm-jira/tsconfig.json"
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "../../tmp-editor-statsig/afm-jira/tsconfig.json"
|
|
43
|
+
},
|
|
38
44
|
{
|
|
39
45
|
"path": "../../../design-system/tokens/afm-jira/tsconfig.json"
|
|
40
46
|
}
|
|
@@ -35,6 +35,12 @@
|
|
|
35
35
|
{
|
|
36
36
|
"path": "../../editor-plugin-selection-marker/afm-post-office/tsconfig.json"
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "../../tmp-editor-statsig/afm-post-office/tsconfig.json"
|
|
43
|
+
},
|
|
38
44
|
{
|
|
39
45
|
"path": "../../../design-system/tokens/afm-post-office/tsconfig.json"
|
|
40
46
|
}
|
|
@@ -11,6 +11,8 @@ var _view = require("@codemirror/view");
|
|
|
11
11
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
12
12
|
var _commands2 = require("@atlaskit/editor-prosemirror/commands");
|
|
13
13
|
var _history = require("@atlaskit/editor-prosemirror/history");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
16
|
var _backspace = require("./backspace");
|
|
15
17
|
var _maybeEscape = require("./maybeEscape");
|
|
16
18
|
var keymapExtension = exports.keymapExtension = function keymapExtension(_ref) {
|
|
@@ -162,5 +164,39 @@ var codeBlockKeymap = function codeBlockKeymap(_ref2) {
|
|
|
162
164
|
getPos: getPos
|
|
163
165
|
});
|
|
164
166
|
}
|
|
167
|
+
}, {
|
|
168
|
+
key: 'Ctrl-Alt-]',
|
|
169
|
+
mac: 'Cmd-Alt-]',
|
|
170
|
+
run: function run() {
|
|
171
|
+
// Pass synthetic event to prosemirror
|
|
172
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_breakout_resizing_hello_release')) {
|
|
173
|
+
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
174
|
+
key: ']',
|
|
175
|
+
code: 'BracketRight',
|
|
176
|
+
metaKey: _browser.browser.mac ? true : false,
|
|
177
|
+
ctrlKey: _browser.browser.mac ? false : true,
|
|
178
|
+
altKey: true
|
|
179
|
+
}));
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}, {
|
|
185
|
+
key: 'Ctrl-Alt-[',
|
|
186
|
+
mac: 'Cmd-Alt-[',
|
|
187
|
+
run: function run() {
|
|
188
|
+
// Pass synthetic event to prosemirror
|
|
189
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_breakout_resizing', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_breakout_resizing_hello_release')) {
|
|
190
|
+
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
191
|
+
key: ']',
|
|
192
|
+
code: 'BracketLeft',
|
|
193
|
+
metaKey: _browser.browser.mac ? true : false,
|
|
194
|
+
ctrlKey: _browser.browser.mac ? false : true,
|
|
195
|
+
altKey: true
|
|
196
|
+
}));
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
165
201
|
}].concat((0, _toConsumableArray2.default)(_commands.defaultKeymap.concat(_commands.indentWithTab)));
|
|
166
202
|
};
|
|
@@ -3,6 +3,8 @@ import { keymap as cmKeymap } from '@codemirror/view';
|
|
|
3
3
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
4
4
|
import { exitCode, selectAll } from '@atlaskit/editor-prosemirror/commands';
|
|
5
5
|
import { undo, redo } from '@atlaskit/editor-prosemirror/history';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
8
|
import { backspaceKeymap } from './backspace';
|
|
7
9
|
import { maybeEscapeKeymap } from './maybeEscape';
|
|
8
10
|
export const keymapExtension = ({
|
|
@@ -140,5 +142,39 @@ const codeBlockKeymap = ({
|
|
|
140
142
|
getNode,
|
|
141
143
|
getPos
|
|
142
144
|
})
|
|
145
|
+
}, {
|
|
146
|
+
key: 'Ctrl-Alt-]',
|
|
147
|
+
mac: 'Cmd-Alt-]',
|
|
148
|
+
run: () => {
|
|
149
|
+
// Pass synthetic event to prosemirror
|
|
150
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
|
|
151
|
+
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
152
|
+
key: ']',
|
|
153
|
+
code: 'BracketRight',
|
|
154
|
+
metaKey: browser.mac ? true : false,
|
|
155
|
+
ctrlKey: browser.mac ? false : true,
|
|
156
|
+
altKey: true
|
|
157
|
+
}));
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
}, {
|
|
163
|
+
key: 'Ctrl-Alt-[',
|
|
164
|
+
mac: 'Cmd-Alt-[',
|
|
165
|
+
run: () => {
|
|
166
|
+
// Pass synthetic event to prosemirror
|
|
167
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
|
|
168
|
+
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
169
|
+
key: ']',
|
|
170
|
+
code: 'BracketLeft',
|
|
171
|
+
metaKey: browser.mac ? true : false,
|
|
172
|
+
ctrlKey: browser.mac ? false : true,
|
|
173
|
+
altKey: true
|
|
174
|
+
}));
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
143
179
|
}, ...defaultKeymap.concat(indentWithTab)];
|
|
144
180
|
};
|
|
@@ -4,6 +4,8 @@ import { keymap as cmKeymap } from '@codemirror/view';
|
|
|
4
4
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
5
5
|
import { exitCode, selectAll } from '@atlaskit/editor-prosemirror/commands';
|
|
6
6
|
import { undo, redo } from '@atlaskit/editor-prosemirror/history';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
9
|
import { backspaceKeymap } from './backspace';
|
|
8
10
|
import { maybeEscapeKeymap } from './maybeEscape';
|
|
9
11
|
export var keymapExtension = function keymapExtension(_ref) {
|
|
@@ -155,5 +157,39 @@ var codeBlockKeymap = function codeBlockKeymap(_ref2) {
|
|
|
155
157
|
getPos: getPos
|
|
156
158
|
});
|
|
157
159
|
}
|
|
160
|
+
}, {
|
|
161
|
+
key: 'Ctrl-Alt-]',
|
|
162
|
+
mac: 'Cmd-Alt-]',
|
|
163
|
+
run: function run() {
|
|
164
|
+
// Pass synthetic event to prosemirror
|
|
165
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
|
|
166
|
+
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
167
|
+
key: ']',
|
|
168
|
+
code: 'BracketRight',
|
|
169
|
+
metaKey: browser.mac ? true : false,
|
|
170
|
+
ctrlKey: browser.mac ? false : true,
|
|
171
|
+
altKey: true
|
|
172
|
+
}));
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
key: 'Ctrl-Alt-[',
|
|
179
|
+
mac: 'Cmd-Alt-[',
|
|
180
|
+
run: function run() {
|
|
181
|
+
// Pass synthetic event to prosemirror
|
|
182
|
+
if (expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_hello_release')) {
|
|
183
|
+
view.dispatchEvent(new KeyboardEvent('keydown', {
|
|
184
|
+
key: ']',
|
|
185
|
+
code: 'BracketLeft',
|
|
186
|
+
metaKey: browser.mac ? true : false,
|
|
187
|
+
ctrlKey: browser.mac ? false : true,
|
|
188
|
+
altKey: true
|
|
189
|
+
}));
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
158
194
|
}].concat(_toConsumableArray(defaultKeymap.concat(indentWithTab)));
|
|
159
195
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-block-advanced",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "CodeBlockAdvanced plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,14 +33,16 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
36
|
-
"@atlaskit/editor-common": "^106.
|
|
36
|
+
"@atlaskit/editor-common": "^106.5.0",
|
|
37
37
|
"@atlaskit/editor-plugin-code-block": "^4.4.0",
|
|
38
38
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
39
|
-
"@atlaskit/editor-plugin-find-replace": "^2.
|
|
39
|
+
"@atlaskit/editor-plugin-find-replace": "^2.3.0",
|
|
40
40
|
"@atlaskit/editor-plugin-selection": "^2.2.0",
|
|
41
41
|
"@atlaskit/editor-plugin-selection-marker": "^2.4.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
43
|
-
"@atlaskit/
|
|
43
|
+
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^6.0.0",
|
|
45
|
+
"@atlaskit/tokens": "^5.1.0",
|
|
44
46
|
"@babel/runtime": "^7.0.0",
|
|
45
47
|
"@codemirror/autocomplete": "6.18.4",
|
|
46
48
|
"@codemirror/commands": "6.7.1",
|
|
@@ -95,5 +97,10 @@
|
|
|
95
97
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
96
98
|
]
|
|
97
99
|
}
|
|
100
|
+
},
|
|
101
|
+
"platform-feature-flags": {
|
|
102
|
+
"platform_editor_breakout_resizing_hello_release": {
|
|
103
|
+
"type": "boolean"
|
|
104
|
+
}
|
|
98
105
|
}
|
|
99
106
|
}
|
|
@@ -9,6 +9,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';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
14
|
|
|
13
15
|
import { backspaceKeymap } from './backspace';
|
|
14
16
|
import { maybeEscapeKeymap } from './maybeEscape';
|
|
@@ -163,6 +165,52 @@ const codeBlockKeymap = ({
|
|
|
163
165
|
key: 'Backspace',
|
|
164
166
|
run: (cm) => backspaceKeymap({ cm, view, getNode, getPos }),
|
|
165
167
|
},
|
|
168
|
+
{
|
|
169
|
+
key: 'Ctrl-Alt-]',
|
|
170
|
+
mac: 'Cmd-Alt-]',
|
|
171
|
+
run: () => {
|
|
172
|
+
// Pass synthetic event to prosemirror
|
|
173
|
+
if (
|
|
174
|
+
expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) &&
|
|
175
|
+
fg('platform_editor_breakout_resizing_hello_release')
|
|
176
|
+
) {
|
|
177
|
+
view.dispatchEvent(
|
|
178
|
+
new KeyboardEvent('keydown', {
|
|
179
|
+
key: ']',
|
|
180
|
+
code: 'BracketRight',
|
|
181
|
+
metaKey: browser.mac ? true : false,
|
|
182
|
+
ctrlKey: browser.mac ? false : true,
|
|
183
|
+
altKey: true,
|
|
184
|
+
}),
|
|
185
|
+
);
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
return false;
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
key: 'Ctrl-Alt-[',
|
|
193
|
+
mac: 'Cmd-Alt-[',
|
|
194
|
+
run: () => {
|
|
195
|
+
// Pass synthetic event to prosemirror
|
|
196
|
+
if (
|
|
197
|
+
expValEquals('platform_editor_breakout_resizing', 'isEnabled', true) &&
|
|
198
|
+
fg('platform_editor_breakout_resizing_hello_release')
|
|
199
|
+
) {
|
|
200
|
+
view.dispatchEvent(
|
|
201
|
+
new KeyboardEvent('keydown', {
|
|
202
|
+
key: ']',
|
|
203
|
+
code: 'BracketLeft',
|
|
204
|
+
metaKey: browser.mac ? true : false,
|
|
205
|
+
ctrlKey: browser.mac ? false : true,
|
|
206
|
+
altKey: true,
|
|
207
|
+
}),
|
|
208
|
+
);
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
return false;
|
|
212
|
+
},
|
|
213
|
+
},
|
|
166
214
|
...defaultKeymap.concat(indentWithTab),
|
|
167
215
|
];
|
|
168
216
|
};
|
package/tsconfig.app.json
CHANGED
|
@@ -52,6 +52,12 @@
|
|
|
52
52
|
{
|
|
53
53
|
"path": "../editor-plugin-selection-marker/tsconfig.app.json"
|
|
54
54
|
},
|
|
55
|
+
{
|
|
56
|
+
"path": "../../platform/feature-flags/tsconfig.app.json"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"path": "../tmp-editor-statsig/tsconfig.app.json"
|
|
60
|
+
},
|
|
55
61
|
{
|
|
56
62
|
"path": "../../design-system/tokens/tsconfig.app.json"
|
|
57
63
|
}
|