@modusoperandi/licit 1.3.4 → 1.3.6

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.
@@ -15,10 +15,9 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
15
15
  import { Fragment, Schema } from 'prosemirror-model';
16
16
  import { EditorState, TextSelection } from 'prosemirror-state';
17
17
  import { Transform } from 'prosemirror-transform';
18
- import { findParentNodeOfType } from 'prosemirror-utils';
19
18
  import { EditorView } from 'prosemirror-view';
20
19
  import * as React from 'react';
21
- import { BLOCKQUOTE, HARD_BREAK } from './NodeNames';
20
+ import { HARD_BREAK } from './NodeNames';
22
21
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
23
22
 
24
23
  // This handles the case when user press SHIFT + ENTER key to insert a new line
@@ -38,11 +37,6 @@ function insertNewLine(tr, schema) {
38
37
  if (!br) {
39
38
  return tr;
40
39
  }
41
- var blockquote = schema.nodes[BLOCKQUOTE];
42
- var result = findParentNodeOfType(blockquote)(selection);
43
- if (!result) {
44
- return tr;
45
- }
46
40
  tr = tr.insert(from, Fragment.from(br.create()));
47
41
  tr = tr.setSelection(TextSelection.create(tr.doc, from + 1, from + 1));
48
42
  return tr;
@@ -3,10 +3,9 @@
3
3
  import { Fragment, Schema } from 'prosemirror-model';
4
4
  import { EditorState, TextSelection } from 'prosemirror-state';
5
5
  import { Transform } from 'prosemirror-transform';
6
- import { findParentNodeOfType } from 'prosemirror-utils';
7
6
  import { EditorView } from 'prosemirror-view';
8
7
  import * as React from 'react';
9
- import { BLOCKQUOTE, HARD_BREAK } from './NodeNames';
8
+ import { HARD_BREAK } from './NodeNames';
10
9
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
11
10
 
12
11
  // This handles the case when user press SHIFT + ENTER key to insert a new line
@@ -24,11 +23,6 @@ function insertNewLine(tr: Transform, schema: Schema): Transform {
24
23
  if (!br) {
25
24
  return tr;
26
25
  }
27
- const blockquote = schema.nodes[BLOCKQUOTE];
28
- const result = findParentNodeOfType(blockquote)(selection);
29
- if (!result) {
30
- return tr;
31
- }
32
26
  tr = tr.insert(from, Fragment.from(br.create()));
33
27
  tr = tr.setSelection(TextSelection.create(tr.doc, from + 1, from + 1));
34
28
  return tr;
package/EditorCommands.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as ProsemirrorTables from 'prosemirror-tables';
2
2
  // [FS][07-MAY-2020][IRAD-956]
3
- // import BlockquoteInsertNewLineCommand from './BlockquoteInsertNewLineCommand';
4
- // import BlockquoteToggleCommand from './BlockquoteToggleCommand';
3
+ import BlockquoteInsertNewLineCommand from './BlockquoteInsertNewLineCommand.js';
4
+ import BlockquoteToggleCommand from './BlockquoteToggleCommand.js';
5
5
  import DocLayoutCommand from './DocLayoutCommand.js';
6
6
  import HistoryRedoCommand from './HistoryRedoCommand.js';
7
7
  import HistoryUndoCommand from './HistoryUndoCommand.js';
@@ -47,8 +47,8 @@ var MARK_STRONG = MarkNames.MARK_STRONG,
47
47
  document.execCommand('enableObjectResizing', false, 'false');
48
48
  document.execCommand('enableInlineTableEditing', false, 'false');
49
49
  // [FS][07-MAY-2020][IRAD-956]
50
- // export const BLOCKQUOTE_TOGGLE = new BlockquoteToggleCommand();
51
- // export const BLOCKQUOTE_INSERT_NEW_LINE = new BlockquoteInsertNewLineCommand();
50
+ export var BLOCKQUOTE_TOGGLE = new BlockquoteToggleCommand();
51
+ export var BLOCKQUOTE_INSERT_NEW_LINE = new BlockquoteInsertNewLineCommand();
52
52
  export var CLEAR_FORMAT = new MarksClearCommand();
53
53
  export var DOC_LAYOUT = new DocLayoutCommand();
54
54
  export var EM = new MarkToggleCommand(MARK_EM);
@@ -2,8 +2,8 @@
2
2
 
3
3
  import * as ProsemirrorTables from 'prosemirror-tables';
4
4
  // [FS][07-MAY-2020][IRAD-956]
5
- // import BlockquoteInsertNewLineCommand from './BlockquoteInsertNewLineCommand';
6
- // import BlockquoteToggleCommand from './BlockquoteToggleCommand';
5
+ import BlockquoteInsertNewLineCommand from './BlockquoteInsertNewLineCommand.js';
6
+ import BlockquoteToggleCommand from './BlockquoteToggleCommand.js';
7
7
  import DocLayoutCommand from './DocLayoutCommand.js';
8
8
  import HistoryRedoCommand from './HistoryRedoCommand.js';
9
9
  import HistoryUndoCommand from './HistoryUndoCommand.js';
@@ -69,8 +69,8 @@ const {
69
69
  document.execCommand('enableObjectResizing', false, 'false');
70
70
  document.execCommand('enableInlineTableEditing', false, 'false');
71
71
  // [FS][07-MAY-2020][IRAD-956]
72
- // export const BLOCKQUOTE_TOGGLE = new BlockquoteToggleCommand();
73
- // export const BLOCKQUOTE_INSERT_NEW_LINE = new BlockquoteInsertNewLineCommand();
72
+ export const BLOCKQUOTE_TOGGLE = new BlockquoteToggleCommand();
73
+ export const BLOCKQUOTE_INSERT_NEW_LINE = new BlockquoteInsertNewLineCommand();
74
74
  export const CLEAR_FORMAT = new MarksClearCommand();
75
75
  export const DOC_LAYOUT = new DocLayoutCommand();
76
76
  export const EM = new MarkToggleCommand(MARK_EM);
package/EditorKeyMap.js CHANGED
@@ -24,13 +24,7 @@ export function findShortcutByKeymap(keymap) {
24
24
  export var KEY_BACK_DELETE = makeKeyMapWithCommon('', 'Backspace');
25
25
  export var KEY_FORWARD_DELETE = makeKeyMapWithCommon('', 'Delete');
26
26
  export var KEY_INSERT_HORIZONTAL_RULE = makeKeyMapWithCommon('Insert horizontal rule', 'Mod-Shift--');
27
- export var KEY_INSERT_NEW_LINE = makeKeyMapWithCommon('Insert new line', 'Shift-Enter');
28
- // [FS][07-MAY-2020][IRAD-956]
29
- // export const KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = makeKeyMapWithCommon(
30
- // 'Insert new line in blockquote',
31
- // 'Shift-Enter'
32
- // );
33
- export var KEY_INSERT_NEW_LINE_IN_LIST_ITEM = makeKeyMapWithCommon('Insert new line in list item', 'Shift-Enter');
27
+ export var KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = makeKeyMapWithCommon('Insert new line in blockquote', 'Shift-Enter');
34
28
  export var KEY_REDO = makeKeyMapWithCommon('Redo', 'Mod-Shift-z');
35
29
  export var KEY_SET_NORMAL_TEXT = makeKeyMap('Normal text', 'Ctrl-0', 'Cmd-Alt-0');
36
30
  export var KEY_SHIFT_BACKSPACE = makeKeyMapWithCommon('Shift Backspace', 'Shift-Backspace');
@@ -54,10 +48,7 @@ export var KEY_TOGGLE_ORDERED_LIST = makeKeyMapWithCommon('Toggle ordered list',
54
48
  export var KEY_TOGGLE_STRIKETHROUGH = makeKeyMapWithCommon('Toggle strikethrough', 'Mod-Shift-s');
55
49
  export var KEY_TOGGLE_UNDERLINE = makeKeyMapWithCommon('Toggle underline', 'Mod-u');
56
50
  export var KEY_UNDO = makeKeyMapWithCommon('Undo', 'Mod-z');
57
- export var ALL_KEYS = [KEY_BACK_DELETE, KEY_FORWARD_DELETE, KEY_INSERT_HORIZONTAL_RULE, KEY_INSERT_NEW_LINE,
58
- // [FS][07-MAY-2020][IRAD-956]
59
- // KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
60
- KEY_INSERT_NEW_LINE_IN_LIST_ITEM, KEY_SET_NORMAL_TEXT, KEY_SHIFT_BACKSPACE, KEY_SPLIT_LIST_ITEM, KEY_TAB_SHIFT, KEY_TAB, KEY_TOGGLE_BLOCK_QUOTE, KEY_TOGGLE_BOLD, KEY_TOGGLE_BULLET_LIST, KEY_TOGGLE_BULLET_LIST, KEY_TOGGLE_CODE_BLOCK, KEY_TOGGLE_HEADING_1, KEY_TOGGLE_HEADING_2, KEY_TOGGLE_HEADING_3, KEY_TOGGLE_HEADING_4, KEY_TOGGLE_HEADING_5, KEY_TOGGLE_HEADING_6, KEY_TOGGLE_ITALIC, KEY_TOGGLE_MONOSPACE, KEY_TOGGLE_ORDERED_LIST, KEY_TOGGLE_STRIKETHROUGH, KEY_TOGGLE_UNDERLINE, KEY_UNDO];
51
+ export var ALL_KEYS = [KEY_BACK_DELETE, KEY_FORWARD_DELETE, KEY_INSERT_HORIZONTAL_RULE, KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE, KEY_SET_NORMAL_TEXT, KEY_SHIFT_BACKSPACE, KEY_SPLIT_LIST_ITEM, KEY_TAB_SHIFT, KEY_TAB, KEY_TOGGLE_BLOCK_QUOTE, KEY_TOGGLE_BOLD, KEY_TOGGLE_BULLET_LIST, KEY_TOGGLE_BULLET_LIST, KEY_TOGGLE_CODE_BLOCK, KEY_TOGGLE_HEADING_1, KEY_TOGGLE_HEADING_2, KEY_TOGGLE_HEADING_3, KEY_TOGGLE_HEADING_4, KEY_TOGGLE_HEADING_5, KEY_TOGGLE_HEADING_6, KEY_TOGGLE_ITALIC, KEY_TOGGLE_MONOSPACE, KEY_TOGGLE_ORDERED_LIST, KEY_TOGGLE_STRIKETHROUGH, KEY_TOGGLE_UNDERLINE, KEY_UNDO];
61
52
  export function findKeymapByDescription(description) {
62
53
  var matches = ALL_KEYS.filter(function (keymap) {
63
54
  return keymap.description.toUpperCase() === description.toUpperCase();
@@ -40,17 +40,8 @@ export const KEY_INSERT_HORIZONTAL_RULE = makeKeyMapWithCommon(
40
40
  'Insert horizontal rule',
41
41
  'Mod-Shift--'
42
42
  );
43
- export const KEY_INSERT_NEW_LINE = makeKeyMapWithCommon(
44
- 'Insert new line',
45
- 'Shift-Enter'
46
- );
47
- // [FS][07-MAY-2020][IRAD-956]
48
- // export const KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = makeKeyMapWithCommon(
49
- // 'Insert new line in blockquote',
50
- // 'Shift-Enter'
51
- // );
52
- export const KEY_INSERT_NEW_LINE_IN_LIST_ITEM = makeKeyMapWithCommon(
53
- 'Insert new line in list item',
43
+ export const KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = makeKeyMapWithCommon(
44
+ 'Insert new line in blockquote',
54
45
  'Shift-Enter'
55
46
  );
56
47
  export const KEY_REDO = makeKeyMapWithCommon('Redo', 'Mod-Shift-z');
@@ -141,10 +132,7 @@ export const ALL_KEYS = [
141
132
  KEY_BACK_DELETE,
142
133
  KEY_FORWARD_DELETE,
143
134
  KEY_INSERT_HORIZONTAL_RULE,
144
- KEY_INSERT_NEW_LINE,
145
- // [FS][07-MAY-2020][IRAD-956]
146
- // KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
147
- KEY_INSERT_NEW_LINE_IN_LIST_ITEM,
135
+ KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
148
136
  KEY_SET_NORMAL_TEXT,
149
137
  KEY_SHIFT_BACKSPACE,
150
138
  KEY_SPLIT_LIST_ITEM,