@atlaskit/editor-core 187.23.0 → 187.23.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 +7 -0
- package/dist/cjs/plugins/date/pm-plugins/keymap.js +4 -8
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +7 -10
- package/dist/cjs/plugins/extension/pm-plugins/keymap.js +2 -5
- package/dist/cjs/plugins/help-dialog/ui/index.js +29 -29
- package/dist/cjs/plugins/indentation/pm-plugins/keymap.js +5 -8
- package/dist/cjs/plugins/list/pm-plugins/keymap.js +9 -12
- package/dist/cjs/plugins/media/pm-plugins/keymap-media-single.js +2 -5
- package/dist/cjs/plugins/media/toolbar/index.js +7 -2
- package/dist/cjs/plugins/rule/pm-plugins/keymap.js +4 -7
- package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-keymap.js +8 -11
- package/dist/cjs/plugins/undo-redo/pm-plugins/keymaps.js +4 -8
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/date/pm-plugins/keymap.js +3 -4
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +7 -7
- package/dist/es2019/plugins/extension/pm-plugins/keymap.js +2 -2
- package/dist/es2019/plugins/help-dialog/ui/index.js +29 -29
- package/dist/es2019/plugins/indentation/pm-plugins/keymap.js +5 -5
- package/dist/es2019/plugins/list/pm-plugins/keymap.js +10 -11
- package/dist/es2019/plugins/media/pm-plugins/keymap-media-single.js +2 -2
- package/dist/es2019/plugins/media/toolbar/index.js +7 -2
- package/dist/es2019/plugins/rule/pm-plugins/keymap.js +4 -4
- package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-keymap.js +8 -8
- package/dist/es2019/plugins/undo-redo/pm-plugins/keymaps.js +3 -4
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/date/pm-plugins/keymap.js +3 -4
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +7 -7
- package/dist/esm/plugins/extension/pm-plugins/keymap.js +2 -2
- package/dist/esm/plugins/help-dialog/ui/index.js +29 -29
- package/dist/esm/plugins/indentation/pm-plugins/keymap.js +5 -5
- package/dist/esm/plugins/list/pm-plugins/keymap.js +10 -11
- package/dist/esm/plugins/media/pm-plugins/keymap-media-single.js +2 -2
- package/dist/esm/plugins/media/toolbar/index.js +7 -2
- package/dist/esm/plugins/rule/pm-plugins/keymap.js +4 -4
- package/dist/esm/plugins/selection/pm-plugins/gap-cursor-keymap.js +8 -8
- package/dist/esm/plugins/undo-redo/pm-plugins/keymaps.js +3 -4
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/help-dialog/ui/index.d.ts +2 -2
- package/dist/types/plugins/list/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/help-dialog/ui/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/list/pm-plugins/keymap.d.ts +1 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ import { browser } from '@atlaskit/editor-common/utils';
|
|
|
17
17
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
18
18
|
import AkModalDialog, { ModalTransition, useModal } from '@atlaskit/modal-dialog';
|
|
19
19
|
import { header, footer, contentWrapper, line, content, row, codeSm, codeMd, codeLg, title, column, dialogHeader } from './styles';
|
|
20
|
-
import
|
|
20
|
+
import { navToFloatingToolbar, navToEditorToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, insertRule, addLink, setNormalText, alignLeft, clearFormatting, undo, redo, pastePlainText, addInlineComment, toggleCode, openHelp, toggleBulletList, toggleBlockQuote } from '@atlaskit/editor-common/keymaps';
|
|
21
21
|
import ToolbarButton from '../../../ui/ToolbarButton';
|
|
22
22
|
import { toolbarMessages, listMessages } from '@atlaskit/editor-common/messages';
|
|
23
23
|
import { messages as insertBlockMessages } from '../../insert-block/ui/ToolbarInsertBlock/messages';
|
|
@@ -75,13 +75,13 @@ var navigationKeymaps = function navigationKeymaps(_ref) {
|
|
|
75
75
|
name: formatMessage(toolbarMessages.navigateToEditorToolbar),
|
|
76
76
|
type: 'navigation',
|
|
77
77
|
keymap: function keymap() {
|
|
78
|
-
return
|
|
78
|
+
return navToEditorToolbar;
|
|
79
79
|
}
|
|
80
80
|
}, {
|
|
81
81
|
name: formatMessage(toolbarMessages.navigateToFloatingToolbar),
|
|
82
82
|
type: 'navigation',
|
|
83
83
|
keymap: function keymap() {
|
|
84
|
-
return
|
|
84
|
+
return navToFloatingToolbar;
|
|
85
85
|
}
|
|
86
86
|
}];
|
|
87
87
|
};
|
|
@@ -91,7 +91,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
91
91
|
name: formatMessage(toolbarMessages.bold),
|
|
92
92
|
type: 'strong',
|
|
93
93
|
keymap: function keymap() {
|
|
94
|
-
return
|
|
94
|
+
return toggleBold;
|
|
95
95
|
},
|
|
96
96
|
autoFormatting: function autoFormatting() {
|
|
97
97
|
return jsx("span", null, jsx("span", {
|
|
@@ -102,7 +102,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
102
102
|
name: formatMessage(toolbarMessages.italic),
|
|
103
103
|
type: 'em',
|
|
104
104
|
keymap: function keymap() {
|
|
105
|
-
return
|
|
105
|
+
return toggleItalic;
|
|
106
106
|
},
|
|
107
107
|
autoFormatting: function autoFormatting() {
|
|
108
108
|
return jsx("span", null, jsx("span", {
|
|
@@ -113,13 +113,13 @@ export var formatting = function formatting(_ref2) {
|
|
|
113
113
|
name: formatMessage(toolbarMessages.underline),
|
|
114
114
|
type: 'underline',
|
|
115
115
|
keymap: function keymap() {
|
|
116
|
-
return
|
|
116
|
+
return toggleUnderline;
|
|
117
117
|
}
|
|
118
118
|
}, {
|
|
119
119
|
name: formatMessage(toolbarMessages.strike),
|
|
120
120
|
type: 'strike',
|
|
121
121
|
keymap: function keymap() {
|
|
122
|
-
return
|
|
122
|
+
return toggleStrikethrough;
|
|
123
123
|
},
|
|
124
124
|
autoFormatting: function autoFormatting() {
|
|
125
125
|
return jsx("span", null, jsx("span", {
|
|
@@ -130,19 +130,19 @@ export var formatting = function formatting(_ref2) {
|
|
|
130
130
|
name: formatMessage(toolbarMessages.subscript),
|
|
131
131
|
type: 'subsup',
|
|
132
132
|
keymap: function keymap() {
|
|
133
|
-
return
|
|
133
|
+
return toggleSubscript;
|
|
134
134
|
}
|
|
135
135
|
}, {
|
|
136
136
|
name: formatMessage(toolbarMessages.superscript),
|
|
137
137
|
type: 'subsup',
|
|
138
138
|
keymap: function keymap() {
|
|
139
|
-
return
|
|
139
|
+
return toggleSuperscript;
|
|
140
140
|
}
|
|
141
141
|
}, {
|
|
142
142
|
name: formatMessage(blockTypeMessages.heading1),
|
|
143
143
|
type: 'heading',
|
|
144
144
|
keymap: function keymap() {
|
|
145
|
-
return
|
|
145
|
+
return toggleHeading1;
|
|
146
146
|
},
|
|
147
147
|
autoFormatting: function autoFormatting() {
|
|
148
148
|
return jsx("span", null, jsx("span", {
|
|
@@ -155,7 +155,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
155
155
|
name: formatMessage(blockTypeMessages.heading2),
|
|
156
156
|
type: 'heading',
|
|
157
157
|
keymap: function keymap() {
|
|
158
|
-
return
|
|
158
|
+
return toggleHeading2;
|
|
159
159
|
},
|
|
160
160
|
autoFormatting: function autoFormatting() {
|
|
161
161
|
return jsx("span", null, jsx("span", {
|
|
@@ -168,7 +168,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
168
168
|
name: formatMessage(blockTypeMessages.heading3),
|
|
169
169
|
type: 'heading',
|
|
170
170
|
keymap: function keymap() {
|
|
171
|
-
return
|
|
171
|
+
return toggleHeading3;
|
|
172
172
|
},
|
|
173
173
|
autoFormatting: function autoFormatting() {
|
|
174
174
|
return jsx("span", null, jsx("span", {
|
|
@@ -181,7 +181,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
181
181
|
name: formatMessage(blockTypeMessages.heading4),
|
|
182
182
|
type: 'heading',
|
|
183
183
|
keymap: function keymap() {
|
|
184
|
-
return
|
|
184
|
+
return toggleHeading4;
|
|
185
185
|
},
|
|
186
186
|
autoFormatting: function autoFormatting() {
|
|
187
187
|
return jsx("span", null, jsx("span", {
|
|
@@ -194,7 +194,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
194
194
|
name: formatMessage(blockTypeMessages.heading5),
|
|
195
195
|
type: 'heading',
|
|
196
196
|
keymap: function keymap() {
|
|
197
|
-
return
|
|
197
|
+
return toggleHeading5;
|
|
198
198
|
},
|
|
199
199
|
autoFormatting: function autoFormatting() {
|
|
200
200
|
return jsx("span", null, jsx("span", {
|
|
@@ -207,7 +207,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
207
207
|
name: formatMessage(blockTypeMessages.heading6),
|
|
208
208
|
type: 'heading',
|
|
209
209
|
keymap: function keymap() {
|
|
210
|
-
return
|
|
210
|
+
return toggleHeading6;
|
|
211
211
|
},
|
|
212
212
|
autoFormatting: function autoFormatting() {
|
|
213
213
|
return jsx("span", null, jsx("span", {
|
|
@@ -220,13 +220,13 @@ export var formatting = function formatting(_ref2) {
|
|
|
220
220
|
name: formatMessage(blockTypeMessages.normal),
|
|
221
221
|
type: 'paragraph',
|
|
222
222
|
keymap: function keymap() {
|
|
223
|
-
return
|
|
223
|
+
return setNormalText;
|
|
224
224
|
}
|
|
225
225
|
}, {
|
|
226
226
|
name: formatMessage(listMessages.orderedList),
|
|
227
227
|
type: 'orderedList',
|
|
228
228
|
keymap: function keymap() {
|
|
229
|
-
return
|
|
229
|
+
return toggleOrderedList;
|
|
230
230
|
},
|
|
231
231
|
autoFormatting: function autoFormatting() {
|
|
232
232
|
return jsx("span", null, jsx("span", {
|
|
@@ -239,7 +239,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
239
239
|
name: formatMessage(listMessages.unorderedList),
|
|
240
240
|
type: 'bulletList',
|
|
241
241
|
keymap: function keymap() {
|
|
242
|
-
return
|
|
242
|
+
return toggleBulletList;
|
|
243
243
|
},
|
|
244
244
|
autoFormatting: function autoFormatting() {
|
|
245
245
|
return jsx("span", null, jsx("span", {
|
|
@@ -252,7 +252,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
252
252
|
name: formatMessage(blockTypeMessages.blockquote),
|
|
253
253
|
type: 'blockquote',
|
|
254
254
|
keymap: function keymap() {
|
|
255
|
-
return
|
|
255
|
+
return toggleBlockQuote;
|
|
256
256
|
},
|
|
257
257
|
autoFormatting: function autoFormatting() {
|
|
258
258
|
return jsx("span", null, jsx("span", {
|
|
@@ -273,7 +273,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
273
273
|
name: formatMessage(insertBlockMessages.horizontalRule),
|
|
274
274
|
type: 'rule',
|
|
275
275
|
keymap: function keymap() {
|
|
276
|
-
return
|
|
276
|
+
return insertRule;
|
|
277
277
|
},
|
|
278
278
|
autoFormatting: function autoFormatting() {
|
|
279
279
|
return jsx("span", null, jsx("span", {
|
|
@@ -284,7 +284,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
284
284
|
name: formatMessage(insertBlockMessages.link),
|
|
285
285
|
type: 'link',
|
|
286
286
|
keymap: function keymap() {
|
|
287
|
-
return
|
|
287
|
+
return addLink;
|
|
288
288
|
},
|
|
289
289
|
autoFormatting: function autoFormatting() {
|
|
290
290
|
return jsx("span", null, jsx("span", {
|
|
@@ -295,7 +295,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
295
295
|
name: formatMessage(toolbarMessages.code),
|
|
296
296
|
type: 'code',
|
|
297
297
|
keymap: function keymap() {
|
|
298
|
-
return
|
|
298
|
+
return toggleCode;
|
|
299
299
|
},
|
|
300
300
|
autoFormatting: function autoFormatting() {
|
|
301
301
|
return jsx("span", null, jsx("span", {
|
|
@@ -342,7 +342,7 @@ export var formatting = function formatting(_ref2) {
|
|
|
342
342
|
name: formatMessage(alignmentMessages.alignLeft),
|
|
343
343
|
type: 'alignment',
|
|
344
344
|
keymap: function keymap() {
|
|
345
|
-
return
|
|
345
|
+
return alignLeft;
|
|
346
346
|
}
|
|
347
347
|
}, {
|
|
348
348
|
name: formatMessage(alignmentMessages.alignRight),
|
|
@@ -356,31 +356,31 @@ var otherFormatting = function otherFormatting(_ref3) {
|
|
|
356
356
|
name: formatMessage(toolbarMessages.clearFormatting),
|
|
357
357
|
type: 'clearFormatting',
|
|
358
358
|
keymap: function keymap() {
|
|
359
|
-
return
|
|
359
|
+
return clearFormatting;
|
|
360
360
|
}
|
|
361
361
|
}, {
|
|
362
362
|
name: formatMessage(undoRedoMessages.undo),
|
|
363
363
|
type: 'undo',
|
|
364
364
|
keymap: function keymap() {
|
|
365
|
-
return
|
|
365
|
+
return undo;
|
|
366
366
|
}
|
|
367
367
|
}, {
|
|
368
368
|
name: formatMessage(undoRedoMessages.redo),
|
|
369
369
|
type: 'redo',
|
|
370
370
|
keymap: function keymap() {
|
|
371
|
-
return
|
|
371
|
+
return redo;
|
|
372
372
|
}
|
|
373
373
|
}, {
|
|
374
374
|
name: formatMessage(messages.pastePlainText),
|
|
375
375
|
type: 'paste',
|
|
376
376
|
keymap: function keymap() {
|
|
377
|
-
return
|
|
377
|
+
return pastePlainText;
|
|
378
378
|
}
|
|
379
379
|
}, {
|
|
380
380
|
name: formatMessage(annotationMessages.createComment),
|
|
381
381
|
type: 'annotation',
|
|
382
382
|
keymap: function keymap() {
|
|
383
|
-
return
|
|
383
|
+
return addInlineComment;
|
|
384
384
|
}
|
|
385
385
|
}];
|
|
386
386
|
};
|
|
@@ -472,7 +472,7 @@ var ModalFooter = function ModalFooter() {
|
|
|
472
472
|
css: footer
|
|
473
473
|
}, jsx(FormattedMessage, _extends({}, messages.helpDialogTips, {
|
|
474
474
|
values: {
|
|
475
|
-
keyMap: getComponentFromKeymap(
|
|
475
|
+
keyMap: getComponentFromKeymap(openHelp)
|
|
476
476
|
}
|
|
477
477
|
})));
|
|
478
478
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
|
-
import
|
|
2
|
+
import { bindKeymapWithCommand, findShortcutByKeymap, outdent, indent, backspace } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { isTextSelection } from '../../../utils';
|
|
4
4
|
import { getIndentCommand, getOutdentCommand } from '../commands';
|
|
5
|
-
import { INPUT_METHOD } from '
|
|
5
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
export function keymapPlugin() {
|
|
7
7
|
var list = {};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
bindKeymapWithCommand(findShortcutByKeymap(indent), getIndentCommand(INPUT_METHOD.KEYBOARD), list);
|
|
9
|
+
bindKeymapWithCommand(findShortcutByKeymap(outdent), getOutdentCommand(INPUT_METHOD.KEYBOARD), list);
|
|
10
|
+
bindKeymapWithCommand(findShortcutByKeymap(backspace), function (state, dispatch) {
|
|
11
11
|
var selection = state.selection;
|
|
12
12
|
if (isTextSelection(selection) && selection.$cursor && selection.$cursor.parentOffset === 0) {
|
|
13
13
|
return dispatch ? getOutdentCommand(INPUT_METHOD.KEYBOARD)(state, dispatch) : false;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
|
-
import
|
|
3
|
-
import { indentList, enterKeyCommand, toggleList, backspaceKeyCommand, deleteKeyCommand } from '../commands';
|
|
4
|
-
import { outdentList } from '../commands';
|
|
2
|
+
import { bindKeymapWithCommand, findShortcutByKeymap, toggleOrderedList, toggleBulletList, indentList, outdentList, enter, backspace, deleteKey, findKeyMapForBrowser, forwardDelete } from '@atlaskit/editor-common/keymaps';
|
|
3
|
+
import { indentList as indentListCommand, outdentList as outdentListCommand, enterKeyCommand, toggleList, backspaceKeyCommand, deleteKeyCommand } from '../commands';
|
|
5
4
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
5
|
export function keymapPlugin(featureFlags, editorAnalyticsAPI) {
|
|
7
6
|
var list = {};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
bindKeymapWithCommand(findShortcutByKeymap(toggleOrderedList), toggleList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, 'orderedList'), list);
|
|
8
|
+
bindKeymapWithCommand(findShortcutByKeymap(toggleBulletList), toggleList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, 'bulletList'), list);
|
|
9
|
+
bindKeymapWithCommand(indentList.common, indentListCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
|
|
10
|
+
bindKeymapWithCommand(outdentList.common, outdentListCommand(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, featureFlags), list);
|
|
11
|
+
bindKeymapWithCommand(enter.common, enterKeyCommand(editorAnalyticsAPI)(featureFlags), list);
|
|
12
|
+
bindKeymapWithCommand(backspace.common, backspaceKeyCommand(editorAnalyticsAPI)(featureFlags), list);
|
|
13
|
+
bindKeymapWithCommand(deleteKey.common, deleteKeyCommand(editorAnalyticsAPI), list);
|
|
15
14
|
|
|
16
15
|
// This shortcut is Mac only
|
|
17
|
-
|
|
16
|
+
bindKeymapWithCommand(findKeyMapForBrowser(forwardDelete), deleteKeyCommand(editorAnalyticsAPI), list);
|
|
18
17
|
return keymap(list);
|
|
19
18
|
}
|
|
20
19
|
export default keymapPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
|
-
import
|
|
2
|
+
import { bindKeymapWithCommand, backspace } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { isEmptyNode, isSelectionInsideLastNodeInDocument } from '../../../utils';
|
|
4
4
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { selectNodeBackward } from '@atlaskit/editor-prosemirror/commands';
|
|
@@ -153,6 +153,6 @@ var maybeRemoveMediaSingleNode = function maybeRemoveMediaSingleNode(schema) {
|
|
|
153
153
|
export default function keymapPlugin(schema) {
|
|
154
154
|
var list = {};
|
|
155
155
|
var removeMediaSingleCommand = maybeRemoveMediaSingleNode(schema);
|
|
156
|
-
|
|
156
|
+
bindKeymapWithCommand(backspace.common, removeMediaSingleCommand, list);
|
|
157
157
|
return keymap(list);
|
|
158
158
|
}
|
|
@@ -254,7 +254,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
254
254
|
|
|
255
255
|
// Pixel Entry Toolbar Support
|
|
256
256
|
if (getBooleanFF('platform.editor.media.extended-resize-experience') && allowResizing) {
|
|
257
|
-
|
|
257
|
+
var sizeInput = {
|
|
258
258
|
type: 'custom',
|
|
259
259
|
fallback: [],
|
|
260
260
|
render: function render(editorView) {
|
|
@@ -311,7 +311,12 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
311
311
|
}
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
}
|
|
314
|
+
};
|
|
315
|
+
if (pluginState.isResizing) {
|
|
316
|
+
// If the image is resizing then only return `sizeInput` as the only toolbar item
|
|
317
|
+
return [sizeInput];
|
|
318
|
+
}
|
|
319
|
+
toolbarButtons.push(sizeInput);
|
|
315
320
|
toolbarButtons.push({
|
|
316
321
|
type: 'separator'
|
|
317
322
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
|
-
import
|
|
3
|
-
import { INPUT_METHOD } from '
|
|
2
|
+
import { bindKeymapWithCommand, insertRule, escape } from '@atlaskit/editor-common/keymaps';
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { insertHorizontalRule } from '../commands';
|
|
5
5
|
export function keymapPlugin(featureFlags) {
|
|
6
6
|
var list = {};
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
bindKeymapWithCommand(insertRule.common, insertHorizontalRule(INPUT_METHOD.SHORTCUT, featureFlags), list);
|
|
8
|
+
bindKeymapWithCommand(escape.common, function () {
|
|
9
9
|
return true;
|
|
10
10
|
}, list);
|
|
11
11
|
return keymap(list);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
|
-
import
|
|
2
|
+
import { bindKeymapWithCommand, insertNewLine, moveLeft, moveRight, moveUp, moveDown, backspace, deleteKey } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { arrow, deleteNode } from '../gap-cursor/actions';
|
|
4
4
|
import { Direction } from '../gap-cursor/direction';
|
|
5
5
|
import { GapCursorSelection } from '../gap-cursor/selection';
|
|
6
6
|
import { createParagraphNear } from '@atlaskit/editor-prosemirror/commands';
|
|
7
7
|
export default function keymapPlugin() {
|
|
8
8
|
var map = {};
|
|
9
|
-
|
|
9
|
+
bindKeymapWithCommand(insertNewLine.common, function (state, dispatch, view) {
|
|
10
10
|
var isInGapCursor = state.selection instanceof GapCursorSelection;
|
|
11
11
|
// Only operate in gap cursor
|
|
12
12
|
if (!isInGapCursor) {
|
|
@@ -14,27 +14,27 @@ export default function keymapPlugin() {
|
|
|
14
14
|
}
|
|
15
15
|
return createParagraphNear(state, dispatch);
|
|
16
16
|
}, map);
|
|
17
|
-
|
|
17
|
+
bindKeymapWithCommand(moveLeft.common, function (state, dispatch, view) {
|
|
18
18
|
var endOfTextblock = view ? view.endOfTextblock.bind(view) : undefined;
|
|
19
19
|
return arrow(Direction.LEFT, endOfTextblock)(state, dispatch, view);
|
|
20
20
|
}, map);
|
|
21
|
-
|
|
21
|
+
bindKeymapWithCommand(moveRight.common, function (state, dispatch, view) {
|
|
22
22
|
var endOfTextblock = view ? view.endOfTextblock.bind(view) : undefined;
|
|
23
23
|
return arrow(Direction.RIGHT, endOfTextblock)(state, dispatch);
|
|
24
24
|
}, map);
|
|
25
|
-
|
|
25
|
+
bindKeymapWithCommand(moveUp.common, function (state, dispatch, view) {
|
|
26
26
|
var endOfTextblock = view ? view.endOfTextblock.bind(view) : undefined;
|
|
27
27
|
return arrow(Direction.UP, endOfTextblock)(state, dispatch);
|
|
28
28
|
}, map);
|
|
29
|
-
|
|
29
|
+
bindKeymapWithCommand(moveDown.common, function (state, dispatch, view) {
|
|
30
30
|
var endOfTextblock = view ? view.endOfTextblock.bind(view) : undefined;
|
|
31
31
|
return arrow(Direction.DOWN, endOfTextblock)(state, dispatch);
|
|
32
32
|
}, map);
|
|
33
33
|
|
|
34
34
|
// default PM's Backspace doesn't handle removing block nodes when cursor is after it
|
|
35
|
-
|
|
35
|
+
bindKeymapWithCommand(backspace.common, deleteNode(Direction.BACKWARD), map);
|
|
36
36
|
|
|
37
37
|
// handle Delete key (remove node after the cursor)
|
|
38
|
-
|
|
38
|
+
bindKeymapWithCommand(deleteKey.common, deleteNode(Direction.FORWARD), map);
|
|
39
39
|
return keymap(map);
|
|
40
40
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { keymap } from '@atlaskit/editor-common/keymaps';
|
|
1
|
+
import { undo, redo, keymap, bindKeymapWithCommand, findKeyMapForBrowser } from '@atlaskit/editor-common/keymaps';
|
|
3
2
|
import { redoFromKeyboard, undoFromKeyboard } from '../commands';
|
|
4
3
|
export function keymapPlugin() {
|
|
5
4
|
var list = {};
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
bindKeymapWithCommand(findKeyMapForBrowser(redo), redoFromKeyboard, list);
|
|
6
|
+
bindKeymapWithCommand(undo.common, undoFromKeyboard, list);
|
|
8
7
|
return keymap(list);
|
|
9
8
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -4,7 +4,7 @@ import { jsx } from '@emotion/react';
|
|
|
4
4
|
import type { IntlShape, WrappedComponentProps } from 'react-intl-next';
|
|
5
5
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import
|
|
7
|
+
import type { Keymap } from '@atlaskit/editor-common/keymaps';
|
|
8
8
|
export interface Format {
|
|
9
9
|
name: string;
|
|
10
10
|
type: string;
|
|
@@ -14,7 +14,7 @@ export interface Format {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const formatting: (intl: IntlShape) => Format[];
|
|
16
16
|
export declare const getSupportedFormatting: (schema: Schema, intl: IntlShape, imageEnabled?: boolean, quickInsertEnabled?: boolean) => Format[];
|
|
17
|
-
export declare const getComponentFromKeymap: (keymap:
|
|
17
|
+
export declare const getComponentFromKeymap: (keymap: Keymap) => jsx.JSX.Element;
|
|
18
18
|
export interface Props {
|
|
19
19
|
editorView: EditorView;
|
|
20
20
|
isVisible: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
export declare function keymapPlugin(featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
|
|
5
5
|
export default keymapPlugin;
|
|
@@ -4,7 +4,7 @@ import { jsx } from '@emotion/react';
|
|
|
4
4
|
import type { IntlShape, WrappedComponentProps } from 'react-intl-next';
|
|
5
5
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import
|
|
7
|
+
import type { Keymap } from '@atlaskit/editor-common/keymaps';
|
|
8
8
|
export interface Format {
|
|
9
9
|
name: string;
|
|
10
10
|
type: string;
|
|
@@ -14,7 +14,7 @@ export interface Format {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const formatting: (intl: IntlShape) => Format[];
|
|
16
16
|
export declare const getSupportedFormatting: (schema: Schema, intl: IntlShape, imageEnabled?: boolean, quickInsertEnabled?: boolean) => Format[];
|
|
17
|
-
export declare const getComponentFromKeymap: (keymap:
|
|
17
|
+
export declare const getComponentFromKeymap: (keymap: Keymap) => jsx.JSX.Element;
|
|
18
18
|
export interface Props {
|
|
19
19
|
editorView: EditorView;
|
|
20
20
|
isVisible: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
export declare function keymapPlugin(featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
|
|
5
5
|
export default keymapPlugin;
|