@atlaskit/editor-core 187.22.1 → 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.
Files changed (51) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/plugins/date/pm-plugins/keymap.js +4 -8
  3. package/dist/cjs/plugins/expand/pm-plugins/keymap.js +7 -10
  4. package/dist/cjs/plugins/extension/pm-plugins/keymap.js +2 -5
  5. package/dist/cjs/plugins/help-dialog/ui/index.js +29 -29
  6. package/dist/cjs/plugins/indentation/pm-plugins/keymap.js +5 -8
  7. package/dist/cjs/plugins/list/pm-plugins/keymap.js +9 -12
  8. package/dist/cjs/plugins/media/pm-plugins/keymap-media-single.js +2 -5
  9. package/dist/cjs/plugins/media/toolbar/index.js +7 -2
  10. package/dist/cjs/plugins/rule/pm-plugins/keymap.js +4 -7
  11. package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-keymap.js +8 -11
  12. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +12 -1
  13. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +12 -5
  14. package/dist/cjs/plugins/undo-redo/pm-plugins/keymaps.js +4 -8
  15. package/dist/cjs/version-wrapper.js +1 -1
  16. package/dist/cjs/version.json +1 -1
  17. package/dist/es2019/plugins/date/pm-plugins/keymap.js +3 -4
  18. package/dist/es2019/plugins/expand/pm-plugins/keymap.js +7 -7
  19. package/dist/es2019/plugins/extension/pm-plugins/keymap.js +2 -2
  20. package/dist/es2019/plugins/help-dialog/ui/index.js +29 -29
  21. package/dist/es2019/plugins/indentation/pm-plugins/keymap.js +5 -5
  22. package/dist/es2019/plugins/list/pm-plugins/keymap.js +10 -11
  23. package/dist/es2019/plugins/media/pm-plugins/keymap-media-single.js +2 -2
  24. package/dist/es2019/plugins/media/toolbar/index.js +7 -2
  25. package/dist/es2019/plugins/rule/pm-plugins/keymap.js +4 -4
  26. package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-keymap.js +8 -8
  27. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +10 -1
  28. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +15 -9
  29. package/dist/es2019/plugins/undo-redo/pm-plugins/keymaps.js +3 -4
  30. package/dist/es2019/version-wrapper.js +1 -1
  31. package/dist/es2019/version.json +1 -1
  32. package/dist/esm/plugins/date/pm-plugins/keymap.js +3 -4
  33. package/dist/esm/plugins/expand/pm-plugins/keymap.js +7 -7
  34. package/dist/esm/plugins/extension/pm-plugins/keymap.js +2 -2
  35. package/dist/esm/plugins/help-dialog/ui/index.js +29 -29
  36. package/dist/esm/plugins/indentation/pm-plugins/keymap.js +5 -5
  37. package/dist/esm/plugins/list/pm-plugins/keymap.js +10 -11
  38. package/dist/esm/plugins/media/pm-plugins/keymap-media-single.js +2 -2
  39. package/dist/esm/plugins/media/toolbar/index.js +7 -2
  40. package/dist/esm/plugins/rule/pm-plugins/keymap.js +4 -4
  41. package/dist/esm/plugins/selection/pm-plugins/gap-cursor-keymap.js +8 -8
  42. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +12 -1
  43. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +13 -6
  44. package/dist/esm/plugins/undo-redo/pm-plugins/keymaps.js +3 -4
  45. package/dist/esm/version-wrapper.js +1 -1
  46. package/dist/esm/version.json +1 -1
  47. package/dist/types/plugins/help-dialog/ui/index.d.ts +2 -2
  48. package/dist/types/plugins/list/pm-plugins/keymap.d.ts +1 -1
  49. package/dist/types-ts4.5/plugins/help-dialog/ui/index.d.ts +2 -2
  50. package/dist/types-ts4.5/plugins/list/pm-plugins/keymap.d.ts +1 -1
  51. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React, { useCallback, useMemo, useLayoutEffect } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
- import { DN600, N200, N800, N30, B100 } from '@atlaskit/theme/colors';
4
+ import { DN600, N200, N800, N30, B400 } from '@atlaskit/theme/colors';
5
5
  import { themed } from '@atlaskit/theme/components';
6
6
  import { borderRadius } from '@atlaskit/theme/constants';
7
7
  import { ButtonItem } from '@atlaskit/menu';
@@ -57,11 +57,9 @@ const itemAfter = css`
57
57
  `;
58
58
  const customRenderItemDivStyle = css`
59
59
  overflow: hidden;
60
- &:hover {
61
- background-color: ${`var(--ds-background-selected, ${N30})`};
62
- }
63
60
  &:focus {
64
- box-shadow: inset 0px 0px 0px 2px ${`var(--ds-border-focused, ${B100})`};
61
+ box-shadow: inset 2px 0px 0px ${`var(--ds-border-focused, ${B400})`};
62
+ background-color: ${`var(--ds-background-neutral-subtle-hovered, ${N30})`};
65
63
  outline: none;
66
64
  }
67
65
  `;
@@ -73,15 +71,21 @@ const customRenderItemDivStyle = css`
73
71
  */
74
72
  const selectionFrame = {
75
73
  '& > button:focus': {
76
- boxShadow: `inset 0px 0px 0px 2px ${`var(--ds-border-focused, ${B100})`}`,
74
+ boxShadow: `inset 2px 0px 0px ${`var(--ds-border-focused, ${B400})`};`,
75
+ backgroundColor: `${`var(--ds-background-neutral-subtle-hovered, ${N30})`}`,
77
76
  outline: 'none',
78
77
  '&:active': {
79
78
  boxShadow: 'none'
80
79
  }
80
+ },
81
+ '& > button:hover': {
82
+ backgroundColor: 'inherit',
83
+ outline: 'none'
81
84
  }
82
85
  };
83
86
  const selectedStyle = css`
84
- background-color: ${`var(--ds-background-selected, ${N30})`};
87
+ background-color: ${`var(--ds-background-neutral-subtle-hovered, ${N30})`};
88
+ box-shadow: inset 2px 0px 0px ${`var(--ds-border-focused, ${B400})`};
85
89
  `;
86
90
  const FallbackIcon = /*#__PURE__*/React.memo(({
87
91
  label
@@ -173,8 +177,9 @@ export const TypeAheadListItem = ({
173
177
  if (customItem) {
174
178
  return customItem;
175
179
  }
180
+ const listItemClasses = [selectionFrame, isSelected && selectedStyle];
176
181
  return jsx("span", {
177
- css: selectionFrame
182
+ css: listItemClasses
178
183
  }, jsx(ButtonItem, {
179
184
  onClick: insertSelectedItem,
180
185
  iconBefore: elementIcon,
@@ -183,7 +188,8 @@ export const TypeAheadListItem = ({
183
188
  "aria-label": title,
184
189
  "aria-setsize": itemsLength,
185
190
  role: "option",
186
- ref: buttonItemRef
191
+ ref: buttonItemRef,
192
+ css: listItemClasses
187
193
  }, jsx("div", {
188
194
  "aria-hidden": true
189
195
  }, jsx("div", {
@@ -1,9 +1,8 @@
1
- import * as keymaps from '../../../keymaps';
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
  const list = {};
6
- keymaps.bindKeymapWithCommand(keymaps.findKeyMapForBrowser(keymaps.redo), redoFromKeyboard, list);
7
- keymaps.bindKeymapWithCommand(keymaps.undo.common, undoFromKeyboard, list);
5
+ bindKeymapWithCommand(findKeyMapForBrowser(redo), redoFromKeyboard, list);
6
+ bindKeymapWithCommand(undo.common, undoFromKeyboard, list);
8
7
  return keymap(list);
9
8
  }
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "187.22.1";
2
+ export const version = "187.23.1";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.22.1",
3
+ "version": "187.23.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,11 +1,10 @@
1
- import { keymap } from '@atlaskit/editor-prosemirror/keymap';
2
1
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
2
  import { closeDatePicker, openDatePicker, focusDateInput } from '../actions';
4
- import * as keymaps from '../../../keymaps';
3
+ import { keymap, enter, tab, bindKeymapWithCommand } from '@atlaskit/editor-common/keymaps';
5
4
  import { getPluginState } from './main';
6
5
  export function keymapPlugin() {
7
6
  var list = {};
8
- keymaps.bindKeymapWithCommand(keymaps.enter.common, function (state, dispatch) {
7
+ bindKeymapWithCommand(enter.common, function (state, dispatch) {
9
8
  var datePlugin = getPluginState(state);
10
9
  var isDateNode = state.selection instanceof NodeSelection ? state.selection.node.type === state.schema.nodes.date : false;
11
10
  if (!isDateNode) {
@@ -18,7 +17,7 @@ export function keymapPlugin() {
18
17
  closeDatePicker()(state, dispatch);
19
18
  return true;
20
19
  }, list);
21
- keymaps.bindKeymapWithCommand(keymaps.tab.common, function (state, dispatch) {
20
+ bindKeymapWithCommand(tab.common, function (state, dispatch) {
22
21
  var datePlugin = getPluginState(state);
23
22
  var isDateNode = state.selection instanceof NodeSelection ? state.selection.node.type === state.schema.nodes.date : false;
24
23
  if (!isDateNode) {
@@ -1,6 +1,6 @@
1
1
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
2
2
  import { Selection, TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
- import * as keymaps from '../../../keymaps';
3
+ import { bindKeymapWithCommand, moveRight, moveLeft, moveUp, moveDown, tab, backspace } from '@atlaskit/editor-common/keymaps';
4
4
  import { GapCursorSelection, Side } from '../../selection/gap-cursor-selection';
5
5
  import { findExpand } from '../utils';
6
6
  import { isEmptyNode } from '../../../utils';
@@ -17,7 +17,7 @@ var isExpandSelected = function isExpandSelected(selection) {
17
17
  };
18
18
  export function expandKeymap() {
19
19
  var list = {};
20
- keymaps.bindKeymapWithCommand(keymaps.moveRight.common, function (state, dispatch, editorView) {
20
+ bindKeymapWithCommand(moveRight.common, function (state, dispatch, editorView) {
21
21
  if (!editorView) {
22
22
  return false;
23
23
  }
@@ -29,7 +29,7 @@ export function expandKeymap() {
29
29
  }
30
30
  return false;
31
31
  }, list);
32
- keymaps.bindKeymapWithCommand(keymaps.moveLeft.common, function (state, dispatch, editorView) {
32
+ bindKeymapWithCommand(moveLeft.common, function (state, dispatch, editorView) {
33
33
  if (!editorView) {
34
34
  return false;
35
35
  }
@@ -41,7 +41,7 @@ export function expandKeymap() {
41
41
  }
42
42
  return false;
43
43
  }, list);
44
- keymaps.bindKeymapWithCommand(keymaps.tab.common, function (state, dispatch, editorView) {
44
+ bindKeymapWithCommand(tab.common, function (state, dispatch, editorView) {
45
45
  if (state.selection instanceof NodeSelection && state.selection.node.type === state.schema.nodes.expand && editorView && editorView.dom instanceof HTMLElement) {
46
46
  var from = state.selection.from;
47
47
  var expand = editorView.nodeDOM(from);
@@ -63,7 +63,7 @@ export function expandKeymap() {
63
63
  }
64
64
  return false;
65
65
  }, list);
66
- keymaps.bindKeymapWithCommand(keymaps.moveUp.common, function (state, dispatch, editorView) {
66
+ bindKeymapWithCommand(moveUp.common, function (state, dispatch, editorView) {
67
67
  if (!editorView) {
68
68
  return false;
69
69
  }
@@ -106,7 +106,7 @@ export function expandKeymap() {
106
106
  }
107
107
  return false;
108
108
  }, list);
109
- keymaps.bindKeymapWithCommand(keymaps.moveDown.common, function (state, dispatch, editorView) {
109
+ bindKeymapWithCommand(moveDown.common, function (state, dispatch, editorView) {
110
110
  if (!editorView) {
111
111
  return false;
112
112
  }
@@ -131,7 +131,7 @@ export function expandKeymap() {
131
131
  }
132
132
  return false;
133
133
  }, list);
134
- keymaps.bindKeymapWithCommand(keymaps.backspace.common, function (state, dispatch, editorView) {
134
+ bindKeymapWithCommand(backspace.common, function (state, dispatch, editorView) {
135
135
  var selection = state.selection;
136
136
  var $from = selection.$from;
137
137
  if (!editorView || !selection.empty) {
@@ -1,10 +1,10 @@
1
1
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
2
2
  import { getPluginState } from './main';
3
- import * as keymaps from '../../../keymaps';
3
+ import { bindKeymapWithCommand, escape } from '@atlaskit/editor-common/keymaps';
4
4
  import { clearEditingContext } from '../commands';
5
5
  export default function keymapPlugin(applyChange) {
6
6
  var list = {};
7
- keymaps.bindKeymapWithCommand(keymaps.escape.common, function (state, dispatch) {
7
+ bindKeymapWithCommand(escape.common, function (state, dispatch) {
8
8
  var extensionState = getPluginState(state);
9
9
  if (!extensionState.showContextPanel) {
10
10
  return false;
@@ -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 * as keymaps from '../../../keymaps';
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 keymaps.navToEditorToolbar;
78
+ return navToEditorToolbar;
79
79
  }
80
80
  }, {
81
81
  name: formatMessage(toolbarMessages.navigateToFloatingToolbar),
82
82
  type: 'navigation',
83
83
  keymap: function keymap() {
84
- return keymaps.navToFloatingToolbar;
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 keymaps.toggleBold;
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 keymaps.toggleItalic;
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 keymaps.toggleUnderline;
116
+ return toggleUnderline;
117
117
  }
118
118
  }, {
119
119
  name: formatMessage(toolbarMessages.strike),
120
120
  type: 'strike',
121
121
  keymap: function keymap() {
122
- return keymaps.toggleStrikethrough;
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 keymaps.toggleSubscript;
133
+ return toggleSubscript;
134
134
  }
135
135
  }, {
136
136
  name: formatMessage(toolbarMessages.superscript),
137
137
  type: 'subsup',
138
138
  keymap: function keymap() {
139
- return keymaps.toggleSuperscript;
139
+ return toggleSuperscript;
140
140
  }
141
141
  }, {
142
142
  name: formatMessage(blockTypeMessages.heading1),
143
143
  type: 'heading',
144
144
  keymap: function keymap() {
145
- return keymaps.toggleHeading1;
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 keymaps.toggleHeading2;
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 keymaps.toggleHeading3;
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 keymaps.toggleHeading4;
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 keymaps.toggleHeading5;
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 keymaps.toggleHeading6;
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 keymaps.setNormalText;
223
+ return setNormalText;
224
224
  }
225
225
  }, {
226
226
  name: formatMessage(listMessages.orderedList),
227
227
  type: 'orderedList',
228
228
  keymap: function keymap() {
229
- return keymaps.toggleOrderedList;
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 keymaps.toggleBulletList;
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 keymaps.toggleBlockQuote;
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 keymaps.insertRule;
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 keymaps.addLink;
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 keymaps.toggleCode;
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 keymaps.alignLeft;
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 keymaps.clearFormatting;
359
+ return clearFormatting;
360
360
  }
361
361
  }, {
362
362
  name: formatMessage(undoRedoMessages.undo),
363
363
  type: 'undo',
364
364
  keymap: function keymap() {
365
- return keymaps.undo;
365
+ return undo;
366
366
  }
367
367
  }, {
368
368
  name: formatMessage(undoRedoMessages.redo),
369
369
  type: 'redo',
370
370
  keymap: function keymap() {
371
- return keymaps.redo;
371
+ return redo;
372
372
  }
373
373
  }, {
374
374
  name: formatMessage(messages.pastePlainText),
375
375
  type: 'paste',
376
376
  keymap: function keymap() {
377
- return keymaps.pastePlainText;
377
+ return pastePlainText;
378
378
  }
379
379
  }, {
380
380
  name: formatMessage(annotationMessages.createComment),
381
381
  type: 'annotation',
382
382
  keymap: function keymap() {
383
- return keymaps.addInlineComment;
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(keymaps.openHelp)
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 * as keymaps from '../../../keymaps';
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 '../../analytics';
5
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
6
6
  export function keymapPlugin() {
7
7
  var list = {};
8
- keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.indent), getIndentCommand(INPUT_METHOD.KEYBOARD), list);
9
- keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.outdent), getOutdentCommand(INPUT_METHOD.KEYBOARD), list);
10
- keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.backspace), function (state, dispatch) {
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 * as keymaps from '../../../keymaps';
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
- keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.toggleOrderedList), toggleList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, 'orderedList'), list);
9
- keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.toggleBulletList), toggleList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, 'bulletList'), list);
10
- keymaps.bindKeymapWithCommand(keymaps.indentList.common, indentList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), list);
11
- keymaps.bindKeymapWithCommand(keymaps.outdentList.common, outdentList(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD, featureFlags), list);
12
- keymaps.bindKeymapWithCommand(keymaps.enter.common, enterKeyCommand(editorAnalyticsAPI)(featureFlags), list);
13
- keymaps.bindKeymapWithCommand(keymaps.backspace.common, backspaceKeyCommand(editorAnalyticsAPI)(featureFlags), list);
14
- keymaps.bindKeymapWithCommand(keymaps.deleteKey.common, deleteKeyCommand(editorAnalyticsAPI), list);
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
- keymaps.bindKeymapWithCommand(keymaps.findKeyMapForBrowser(keymaps.forwardDelete), deleteKeyCommand(editorAnalyticsAPI), list);
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 * as keymaps from '../../../keymaps';
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
- keymaps.bindKeymapWithCommand(keymaps.backspace.common, removeMediaSingleCommand, list);
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
- toolbarButtons.push({
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 * as keymaps from '../../../keymaps';
3
- import { INPUT_METHOD } from '../../analytics';
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
- keymaps.bindKeymapWithCommand(keymaps.insertRule.common, insertHorizontalRule(INPUT_METHOD.SHORTCUT, featureFlags), list);
8
- keymaps.bindKeymapWithCommand(keymaps.escape.common, function () {
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 * as keymaps from '../../../keymaps';
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
- keymaps.bindKeymapWithCommand(keymaps.insertNewLine.common, function (state, dispatch, view) {
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
- keymaps.bindKeymapWithCommand(keymaps.moveLeft.common, function (state, dispatch, view) {
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
- keymaps.bindKeymapWithCommand(keymaps.moveRight.common, function (state, dispatch, view) {
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
- keymaps.bindKeymapWithCommand(keymaps.moveUp.common, function (state, dispatch, view) {
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
- keymaps.bindKeymapWithCommand(keymaps.moveDown.common, function (state, dispatch, view) {
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
- keymaps.bindKeymapWithCommand(keymaps.backspace.common, deleteNode(Direction.BACKWARD), map);
35
+ bindKeymapWithCommand(backspace.common, deleteNode(Direction.BACKWARD), map);
36
36
 
37
37
  // handle Delete key (remove node after the cursor)
38
- keymaps.bindKeymapWithCommand(keymaps.deleteKey.common, deleteNode(Direction.FORWARD), map);
38
+ bindKeymapWithCommand(deleteKey.common, deleteNode(Direction.FORWARD), map);
39
39
  return keymap(map);
40
40
  }
@@ -122,6 +122,14 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
122
122
  });
123
123
  });
124
124
  }, [selectedIndex, lastVisibleStartIndex, lastVisibleStopIndex]);
125
+ var _onMouseMove = function onMouseMove(event, index) {
126
+ event.preventDefault();
127
+ event.stopPropagation();
128
+ if (selectedIndex === index) {
129
+ return;
130
+ }
131
+ updateSelectedIndex(index)(editorView.state, editorView.dispatch);
132
+ };
125
133
  useLayoutEffect(function () {
126
134
  if (!listRef.current) {
127
135
  return;
@@ -222,7 +230,10 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
222
230
  style: style,
223
231
  "data-index": index
224
232
  }, jsx("div", {
225
- "data-testid": "list-item-height-observed-".concat(index)
233
+ "data-testid": "list-item-height-observed-".concat(index),
234
+ onMouseMove: function onMouseMove(e) {
235
+ return _onMouseMove(e, index);
236
+ }
226
237
  }, jsx(TypeAheadListItem, {
227
238
  key: items[index].title,
228
239
  item: currentItem,