@modusoperandi/licit 0.1.9 → 0.13.2

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 (340) hide show
  1. package/.github/workflows/build.yml +1 -7
  2. package/.github/workflows/lint.yml +1 -1
  3. package/README.md +1 -1
  4. package/babel.config.json +54 -0
  5. package/dist/BlockquoteNodeSpec.js +2 -2
  6. package/dist/CZIProseMirror.js +4 -4
  7. package/dist/CodeBlockCommand.js +2 -2
  8. package/dist/CodeBlockCommand.js.flow +1 -1
  9. package/dist/CursorPlaceholderPlugin.js +2 -2
  10. package/dist/DocLayoutCommand.js +2 -4
  11. package/dist/DocLayoutCommand.js.flow +1 -1
  12. package/dist/DocNodeSpec.js +1 -1
  13. package/dist/EditorCommands.js +23 -35
  14. package/dist/EditorCommands.js.flow +7 -7
  15. package/dist/EditorKeyMap.js +3 -3
  16. package/dist/FontTypeMarkSpec.js +1 -1
  17. package/dist/HeadingNodeSpec.js +2 -2
  18. package/dist/ImageSourceCommand.js +2 -4
  19. package/dist/ImageSourceCommand.js.flow +1 -1
  20. package/dist/ImageUploadPlaceholderPlugin.js +1 -1
  21. package/dist/LinkSetURLCommand.js +4 -8
  22. package/dist/LinkSetURLCommand.js.flow +3 -3
  23. package/dist/LinkTooltipPlugin.js +9 -15
  24. package/dist/LinkTooltipPlugin.js.flow +5 -5
  25. package/dist/ListToggleCommand.js +5 -11
  26. package/dist/ListToggleCommand.js.flow +3 -3
  27. package/dist/MarkNames.js +1 -1
  28. package/dist/MarksClearCommand.js +3 -3
  29. package/dist/MarksClearCommand.js.flow +1 -1
  30. package/dist/MathEditCommand.js +2 -2
  31. package/dist/MathEditCommand.js.flow +1 -1
  32. package/dist/ParagraphNodeSpec.js +3 -4
  33. package/dist/ParagraphNodeSpec.js.flow +2 -6
  34. package/dist/ParagraphSpacingCommand.js +3 -3
  35. package/dist/SelectionPlaceholderPlugin.js +2 -2
  36. package/dist/SpacerMarkSpec.js +1 -1
  37. package/dist/TableBackgroundColorCommand.js +3 -7
  38. package/dist/TableBackgroundColorCommand.js.flow +3 -3
  39. package/dist/TableBorderColorCommand.js +3 -7
  40. package/dist/TableBorderColorCommand.js.flow +3 -3
  41. package/dist/TableCellColorCommand.js +3 -7
  42. package/dist/TableCellColorCommand.js.flow +3 -3
  43. package/dist/TableCellMenuPlugin.js +4 -6
  44. package/dist/TableCellMenuPlugin.js.flow +3 -3
  45. package/dist/TableInsertCommand.js +3 -5
  46. package/dist/TableInsertCommand.js.flow +2 -2
  47. package/dist/TableResizePlugin.js +2 -2
  48. package/dist/TextInsertTabSpaceCommand.js +2 -4
  49. package/dist/TextInsertTabSpaceCommand.js.flow +1 -1
  50. package/dist/Types.js +1 -1
  51. package/dist/bom.xml +4970 -4167
  52. package/dist/client/CollabConnector.js +17 -2
  53. package/dist/client/CollabConnector.js.flow +17 -2
  54. package/dist/client/EditorConnection.js +15 -4
  55. package/dist/client/EditorConnection.js.flow +14 -3
  56. package/dist/client/Licit.js +73 -58
  57. package/dist/client/Licit.js.flow +101 -85
  58. package/dist/client/Licit.test.js +18 -17
  59. package/dist/client/Licit.test.js.flow +13 -11
  60. package/dist/client/SimpleConnector.js +4 -2
  61. package/dist/client/SimpleConnector.js.flow +3 -1
  62. package/dist/client/http.js +3 -3
  63. package/dist/convertToCSSPTValue.js +1 -1
  64. package/dist/createEmptyEditorState.js +1 -1
  65. package/dist/index.js +16 -16
  66. package/dist/joinListNode.js +2 -2
  67. package/dist/joinListNode.js.flow +1 -1
  68. package/dist/keymaps.js +2 -2
  69. package/dist/patchStyleElements.js +3 -3
  70. package/dist/patchStyleElements.js.flow +1 -1
  71. package/dist/splitListItem.js +2 -2
  72. package/dist/styles.css +2 -2
  73. package/dist/styles0.css +3 -3
  74. package/dist/toggleBlockquote.js +6 -14
  75. package/dist/toggleBlockquote.js.flow +4 -4
  76. package/dist/toggleCodeBlock.js +4 -10
  77. package/dist/toggleCodeBlock.js.flow +3 -3
  78. package/dist/ui/AlertInfo.js +2 -2
  79. package/dist/ui/CommandButton.js +2 -4
  80. package/dist/ui/CommandButton.js.flow +1 -1
  81. package/dist/ui/CommandMenuButton.js +5 -7
  82. package/dist/ui/CommandMenuButton.js.flow +2 -2
  83. package/dist/ui/CustomMenuItem.js +3 -5
  84. package/dist/ui/CustomMenuItem.js.flow +1 -1
  85. package/dist/ui/CustomNodeView.js +3 -3
  86. package/dist/ui/CustomRadioButton.js +8 -6
  87. package/dist/ui/CustomRadioButton.js.flow +3 -3
  88. package/dist/ui/DocLayoutEditor.js +5 -7
  89. package/dist/ui/DocLayoutEditor.js.flow +2 -2
  90. package/dist/ui/Editor.js +1 -2
  91. package/dist/ui/Editor.js.flow +1 -2
  92. package/dist/ui/EditorFrameset.js +1 -1
  93. package/dist/ui/EditorToolbar.js +4 -4
  94. package/dist/ui/EditorToolbar.js.flow +1 -1
  95. package/dist/ui/EditorToolbarConfig.js +1 -1
  96. package/dist/ui/FontSizeCommandMenuButton.js +3 -3
  97. package/dist/ui/FontSizeCommandMenuButton.js.flow +1 -1
  98. package/dist/ui/FontTypeCommandMenuButton.js +3 -3
  99. package/dist/ui/FontTypeCommandMenuButton.js.flow +1 -1
  100. package/dist/ui/ImageAlignEditor.js +5 -5
  101. package/dist/ui/ImageAlignEditor.js.flow +1 -1
  102. package/dist/ui/ImageInlineEditor.js +5 -5
  103. package/dist/ui/ImageInlineEditor.js.flow +1 -1
  104. package/dist/ui/ImageNodeView.js +5 -7
  105. package/dist/ui/ImageNodeView.js.flow +2 -2
  106. package/dist/ui/ImageResizeBox.js +4 -4
  107. package/dist/ui/ImageResizeBox.js.flow +1 -1
  108. package/dist/ui/ImageURLEditor.js +6 -8
  109. package/dist/ui/ImageURLEditor.js.flow +2 -2
  110. package/dist/ui/ImageUploadEditor.js +3 -5
  111. package/dist/ui/ImageUploadEditor.js.flow +2 -2
  112. package/dist/ui/LinkTooltip.js +4 -4
  113. package/dist/ui/LinkTooltip.js.flow +1 -1
  114. package/dist/ui/LinkURLEditor.js +4 -6
  115. package/dist/ui/LinkURLEditor.js.flow +2 -2
  116. package/dist/ui/ListTypeButton.js +5 -7
  117. package/dist/ui/ListTypeButton.js.flow +2 -2
  118. package/dist/ui/MathEditor.js +4 -6
  119. package/dist/ui/MathEditor.js.flow +2 -2
  120. package/dist/ui/MathInlineEditor.js +7 -9
  121. package/dist/ui/MathInlineEditor.js.flow +2 -2
  122. package/dist/ui/MathNodeView.js +5 -7
  123. package/dist/ui/MathNodeView.js.flow +2 -2
  124. package/dist/ui/ResizeObserver.js +1 -1
  125. package/dist/ui/TableGridSizeEditor.js +7 -9
  126. package/dist/ui/TableGridSizeEditor.js.flow +2 -2
  127. package/dist/ui/czi-link-tooltip.css +1 -1
  128. package/dist/ui/czi-vars.css +1 -45
  129. package/dist/ui/findActiveFontType.js +1 -1
  130. package/dist/ui/htmlElementToRect.js +1 -1
  131. package/dist/ui/isElementFullyVisible.js +2 -2
  132. package/dist/ui/isElementFullyVisible.js.flow +1 -1
  133. package/dist/ui/mathquill-editor/MathQuillEditorSymbols.js +1 -1
  134. package/dist/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +2 -2
  135. package/dist/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js.flow +1 -1
  136. package/dist/ui/resolveImage.js +3 -3
  137. package/dist/ui/toCSSColor.js +1 -1
  138. package/dist/ui/toCSSLineSpacing.js +1 -36
  139. package/dist/ui/toCSSLineSpacing.js.flow +0 -27
  140. package/flow-typed/@modusoperandilicit-ui-commands.js +5 -0
  141. package/jest.config.js +207 -0
  142. package/lint.sh +0 -0
  143. package/node_modules/prosemirror-utils/LICENSE +13 -0
  144. package/{dist/ui/PopUpTypes.js.flow → node_modules/prosemirror-utils/README.md} +0 -0
  145. package/node_modules/prosemirror-utils/dist/helpers.js +119 -0
  146. package/node_modules/prosemirror-utils/dist/index.js +17 -0
  147. package/node_modules/prosemirror-utils/dist/index.js.map +1 -0
  148. package/node_modules/prosemirror-utils/dist/node.js +106 -0
  149. package/node_modules/prosemirror-utils/dist/selection.js +168 -0
  150. package/node_modules/prosemirror-utils/dist/transforms.js +257 -0
  151. package/node_modules/prosemirror-utils/package.json +81 -0
  152. package/node_modules/prosemirror-utils/typings.d.ts +79 -0
  153. package/package.json +14 -8
  154. package/scripts/build_bin.py +0 -0
  155. package/scripts/ci_check_dist.sh +0 -0
  156. package/src/CodeBlockCommand.js +1 -1
  157. package/src/DocLayoutCommand.js +1 -1
  158. package/src/EditorCommands.js +7 -7
  159. package/src/ImageSourceCommand.js +1 -1
  160. package/src/LinkSetURLCommand.js +3 -3
  161. package/src/LinkTooltipPlugin.js +5 -5
  162. package/src/ListToggleCommand.js +3 -3
  163. package/src/MarksClearCommand.js +1 -1
  164. package/src/MathEditCommand.js +1 -1
  165. package/src/ParagraphNodeSpec.js +2 -6
  166. package/src/TableBackgroundColorCommand.js +3 -3
  167. package/src/TableBorderColorCommand.js +3 -3
  168. package/src/TableCellColorCommand.js +3 -3
  169. package/src/TableCellMenuPlugin.js +3 -3
  170. package/src/TableInsertCommand.js +2 -2
  171. package/src/TextInsertTabSpaceCommand.js +1 -1
  172. package/src/client/CollabConnector.js +17 -2
  173. package/src/client/EditorConnection.js +14 -3
  174. package/src/client/Licit.js +101 -85
  175. package/src/client/Licit.test.js +13 -11
  176. package/src/client/SimpleConnector.js +3 -1
  177. package/src/joinListNode.js +1 -1
  178. package/src/patchStyleElements.js +1 -1
  179. package/src/styles.css +2 -2
  180. package/src/styles0.css +3 -3
  181. package/src/toggleBlockquote.js +4 -4
  182. package/src/toggleCodeBlock.js +3 -3
  183. package/src/ui/CommandButton.js +1 -1
  184. package/src/ui/CommandMenuButton.js +2 -2
  185. package/src/ui/CustomMenuItem.js +1 -1
  186. package/src/ui/CustomRadioButton.js +3 -3
  187. package/src/ui/DocLayoutEditor.js +2 -2
  188. package/src/ui/Editor.js +1 -2
  189. package/src/ui/EditorToolbar.js +1 -1
  190. package/src/ui/FontSizeCommandMenuButton.js +1 -1
  191. package/src/ui/FontTypeCommandMenuButton.js +1 -1
  192. package/src/ui/ImageAlignEditor.js +1 -1
  193. package/src/ui/ImageInlineEditor.js +1 -1
  194. package/src/ui/ImageNodeView.js +2 -2
  195. package/src/ui/ImageResizeBox.js +1 -1
  196. package/src/ui/ImageURLEditor.js +2 -2
  197. package/src/ui/ImageUploadEditor.js +2 -2
  198. package/src/ui/LinkTooltip.js +1 -1
  199. package/src/ui/LinkURLEditor.js +2 -2
  200. package/src/ui/ListTypeButton.js +2 -2
  201. package/src/ui/MathEditor.js +2 -2
  202. package/src/ui/MathInlineEditor.js +2 -2
  203. package/src/ui/MathNodeView.js +2 -2
  204. package/src/ui/TableGridSizeEditor.js +2 -2
  205. package/src/ui/czi-link-tooltip.css +1 -1
  206. package/src/ui/czi-vars.css +1 -45
  207. package/src/ui/isElementFullyVisible.js +1 -1
  208. package/src/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +1 -1
  209. package/src/ui/toCSSLineSpacing.js +0 -27
  210. package/build_customstyle_server.py +0 -7
  211. package/dist/FontSizeCommand.js +0 -80
  212. package/dist/FontSizeCommand.js.flow +0 -57
  213. package/dist/FontTypeCommand.js +0 -137
  214. package/dist/FontTypeCommand.js.flow +0 -100
  215. package/dist/HeadingCommand.js +0 -65
  216. package/dist/HeadingCommand.js.flow +0 -51
  217. package/dist/IndentCommand.js +0 -57
  218. package/dist/IndentCommand.js.flow +0 -41
  219. package/dist/MarkToggleCommand.js +0 -90
  220. package/dist/MarkToggleCommand.js.flow +0 -66
  221. package/dist/TextAlignCommand.js +0 -151
  222. package/dist/TextAlignCommand.js.flow +0 -122
  223. package/dist/TextColorCommand.js +0 -114
  224. package/dist/TextColorCommand.js.flow +0 -87
  225. package/dist/TextHighlightCommand.js +0 -118
  226. package/dist/TextHighlightCommand.js.flow +0 -91
  227. package/dist/TextLineSpacingCommand.js +0 -177
  228. package/dist/TextLineSpacingCommand.js.flow +0 -157
  229. package/dist/applyMark.js +0 -84
  230. package/dist/applyMark.js.flow +0 -61
  231. package/dist/clearMarks.js +0 -160
  232. package/dist/clearMarks.js.flow +0 -128
  233. package/dist/compareNumber.js +0 -18
  234. package/dist/compareNumber.js.flow +0 -11
  235. package/dist/consolidateListNodes.js +0 -291
  236. package/dist/consolidateListNodes.js.flow +0 -281
  237. package/dist/coverage/lcov-report/block-navigation.js +0 -77
  238. package/dist/coverage/lcov-report/block-navigation.js.flow +0 -79
  239. package/dist/coverage/lcov-report/prettify.js +0 -994
  240. package/dist/coverage/lcov-report/prettify.js.flow +0 -2
  241. package/dist/coverage/lcov-report/sorter.js +0 -187
  242. package/dist/coverage/lcov-report/sorter.js.flow +0 -170
  243. package/dist/findNodesWithSameMark.js +0 -89
  244. package/dist/findNodesWithSameMark.js.flow +0 -89
  245. package/dist/isBulletListNode.js +0 -14
  246. package/dist/isBulletListNode.js.flow +0 -9
  247. package/dist/isInsideListItem.js +0 -19
  248. package/dist/isInsideListItem.js.flow +0 -13
  249. package/dist/isListNode.js +0 -22
  250. package/dist/isListNode.js.flow +0 -13
  251. package/dist/isNodeSelectionForNodeType.js +0 -19
  252. package/dist/isNodeSelectionForNodeType.js.flow +0 -15
  253. package/dist/isOrderedListNode.js +0 -14
  254. package/dist/isOrderedListNode.js.flow +0 -9
  255. package/dist/isTextStyleMarkCommandEnabled.js +0 -59
  256. package/dist/isTextStyleMarkCommandEnabled.js.flow +0 -49
  257. package/dist/noop.js +0 -11
  258. package/dist/noop.js.flow +0 -5
  259. package/dist/toggleHeading.js +0 -135
  260. package/dist/toggleHeading.js.flow +0 -113
  261. package/dist/toggleList.js +0 -431
  262. package/dist/toggleList.js.flow +0 -450
  263. package/dist/transformAndPreserveTextSelection.js +0 -173
  264. package/dist/transformAndPreserveTextSelection.js.flow +0 -151
  265. package/dist/ui/ColorEditor.js +0 -118
  266. package/dist/ui/ColorEditor.js.flow +0 -101
  267. package/dist/ui/CustomButton.js +0 -62
  268. package/dist/ui/CustomButton.js.flow +0 -33
  269. package/dist/ui/PointerSurface.js +0 -173
  270. package/dist/ui/PointerSurface.js.flow +0 -141
  271. package/dist/ui/PopUp.js +0 -129
  272. package/dist/ui/PopUp.js.flow +0 -77
  273. package/dist/ui/PopUpManager.js +0 -266
  274. package/dist/ui/PopUpManager.js.flow +0 -213
  275. package/dist/ui/PopUpPosition.js +0 -156
  276. package/dist/ui/PopUpPosition.js.flow +0 -104
  277. package/dist/ui/PopUpTypes.js +0 -1
  278. package/dist/ui/TooltipSurface.js +0 -99
  279. package/dist/ui/TooltipSurface.js.flow +0 -76
  280. package/dist/ui/clamp.js +0 -18
  281. package/dist/ui/clamp.js.flow +0 -11
  282. package/dist/ui/createPopUp.js +0 -199
  283. package/dist/ui/createPopUp.js.flow +0 -205
  284. package/dist/ui/czi-animations.css +0 -15
  285. package/dist/ui/czi-color-editor.css +0 -56
  286. package/dist/ui/czi-custom-button.css +0 -93
  287. package/dist/ui/czi-pop-up.css +0 -32
  288. package/dist/ui/czi-tooltip-surface.css +0 -45
  289. package/dist/ui/preventEventDefault.js +0 -10
  290. package/dist/ui/preventEventDefault.js.flow +0 -5
  291. package/dist/ui/rects.js +0 -58
  292. package/dist/ui/rects.js.flow +0 -47
  293. package/dist/updateIndentLevel.js +0 -232
  294. package/dist/updateIndentLevel.js.flow +0 -211
  295. package/flow-typed/@molicit-citation.js +0 -5
  296. package/licit/server/customstyles/start.js +0 -184
  297. package/run_customstyle_server.py +0 -20
  298. package/src/FontSizeCommand.js +0 -57
  299. package/src/FontTypeCommand.js +0 -100
  300. package/src/HeadingCommand.js +0 -51
  301. package/src/IndentCommand.js +0 -41
  302. package/src/MarkToggleCommand.js +0 -66
  303. package/src/TextAlignCommand.js +0 -122
  304. package/src/TextColorCommand.js +0 -87
  305. package/src/TextHighlightCommand.js +0 -91
  306. package/src/TextLineSpacingCommand.js +0 -157
  307. package/src/applyMark.js +0 -61
  308. package/src/clearMarks.js +0 -128
  309. package/src/compareNumber.js +0 -11
  310. package/src/consolidateListNodes.js +0 -281
  311. package/src/findNodesWithSameMark.js +0 -89
  312. package/src/isBulletListNode.js +0 -9
  313. package/src/isInsideListItem.js +0 -13
  314. package/src/isListNode.js +0 -13
  315. package/src/isNodeSelectionForNodeType.js +0 -15
  316. package/src/isOrderedListNode.js +0 -9
  317. package/src/isTextStyleMarkCommandEnabled.js +0 -49
  318. package/src/noop.js +0 -5
  319. package/src/toggleHeading.js +0 -113
  320. package/src/toggleList.js +0 -450
  321. package/src/transformAndPreserveTextSelection.js +0 -151
  322. package/src/ui/ColorEditor.js +0 -101
  323. package/src/ui/CustomButton.js +0 -33
  324. package/src/ui/PointerSurface.js +0 -141
  325. package/src/ui/PopUp.js +0 -77
  326. package/src/ui/PopUpManager.js +0 -213
  327. package/src/ui/PopUpPosition.js +0 -104
  328. package/src/ui/PopUpTypes.js +0 -0
  329. package/src/ui/TooltipSurface.js +0 -76
  330. package/src/ui/clamp.js +0 -11
  331. package/src/ui/createPopUp.js +0 -205
  332. package/src/ui/czi-animations.css +0 -15
  333. package/src/ui/czi-color-editor.css +0 -56
  334. package/src/ui/czi-custom-button.css +0 -93
  335. package/src/ui/czi-pop-up.css +0 -32
  336. package/src/ui/czi-tooltip-surface.css +0 -45
  337. package/src/ui/preventEventDefault.js +0 -5
  338. package/src/ui/rects.js +0 -47
  339. package/src/updateIndentLevel.js +0 -211
  340. package/utils/build_customstyle_server.js +0 -72
@@ -5,20 +5,20 @@ import * as ProsemirrorTables from 'prosemirror-tables';
5
5
  // import BlockquoteInsertNewLineCommand from './BlockquoteInsertNewLineCommand';
6
6
  // import BlockquoteToggleCommand from './BlockquoteToggleCommand';
7
7
  import DocLayoutCommand from './DocLayoutCommand';
8
- import HeadingCommand from './HeadingCommand';
8
+ import { HeadingCommand } from '@modusoperandi/licit-ui-commands';
9
9
  import HistoryRedoCommand from './HistoryRedoCommand';
10
10
  import HistoryUndoCommand from './HistoryUndoCommand';
11
11
  import HorizontalRuleCommand from './HorizontalRuleCommand';
12
12
  import ImageFromURLCommand from './ImageFromURLCommand';
13
13
  import ImageUploadCommand from './ImageUploadCommand';
14
- import IndentCommand from './IndentCommand';
14
+ import { IndentCommand } from '@modusoperandi/licit-ui-commands';
15
15
  import LinkSetURLCommand from './LinkSetURLCommand';
16
16
  import ListItemInsertNewLineCommand from './ListItemInsertNewLineCommand';
17
17
  import ListItemMergeCommand from './ListItemMergeCommand';
18
18
  import ListSplitCommand from './ListSplitCommand';
19
19
  import { ListToggleCommand } from './ListToggleCommand';
20
20
  import * as MarkNames from './MarkNames';
21
- import MarkToggleCommand from './MarkToggleCommand';
21
+ import { MarkToggleCommand } from '@modusoperandi/licit-ui-commands';
22
22
  import MarksClearCommand from './MarksClearCommand';
23
23
  import MathEditCommand from './MathEditCommand';
24
24
  import PrintCommand from './PrintCommand';
@@ -26,11 +26,11 @@ import TableBackgroundColorCommand from './TableBackgroundColorCommand';
26
26
  import TableBorderColorCommand from './TableBorderColorCommand';
27
27
  import TableInsertCommand from './TableInsertCommand';
28
28
  import TableMergeCellsCommand from './TableMergeCellsCommand';
29
- import TextAlignCommand from './TextAlignCommand';
30
- import TextColorCommand from './TextColorCommand';
31
- import TextHighlightCommand from './TextHighlightCommand';
29
+ import { TextAlignCommand } from '@modusoperandi/licit-ui-commands';
30
+ import { TextColorCommand } from '@modusoperandi/licit-ui-commands';
31
+ import { TextHighlightCommand } from '@modusoperandi/licit-ui-commands';
32
32
  import TextInsertTabSpaceCommand from './TextInsertTabSpaceCommand';
33
- import TextLineSpacingCommand from './TextLineSpacingCommand';
33
+ import { TextLineSpacingCommand } from '@modusoperandi/licit-ui-commands';
34
34
  import createCommand from './createCommand';
35
35
 
36
36
  const {
@@ -12,7 +12,7 @@ import {
12
12
  } from './CursorPlaceholderPlugin';
13
13
  import { IMAGE } from './NodeNames';
14
14
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
15
- import createPopUp from './ui/createPopUp';
15
+ import { createPopUp } from '@modusoperandi/licit-ui-commands';
16
16
 
17
17
  import type { ImageLike } from './Types';
18
18
 
@@ -10,11 +10,11 @@ import {
10
10
  hideSelectionPlaceholder,
11
11
  showSelectionPlaceholder,
12
12
  } from './SelectionPlaceholderPlugin';
13
- import applyMark from './applyMark';
14
- import findNodesWithSameMark from './findNodesWithSameMark';
13
+ import { applyMark } from '@modusoperandi/licit-ui-commands';
14
+ import { findNodesWithSameMark } from '@modusoperandi/licit-ui-commands';
15
15
  import LinkURLEditor from './ui/LinkURLEditor';
16
16
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
17
- import createPopUp from './ui/createPopUp';
17
+ import { createPopUp } from '@modusoperandi/licit-ui-commands';
18
18
 
19
19
  class LinkSetURLCommand extends UICommand {
20
20
  _popUp = null;
@@ -9,15 +9,15 @@ import {
9
9
  hideSelectionPlaceholder,
10
10
  showSelectionPlaceholder,
11
11
  } from './SelectionPlaceholderPlugin';
12
- import applyMark from './applyMark';
13
- import findNodesWithSameMark from './findNodesWithSameMark';
12
+ import { applyMark } from '@modusoperandi/licit-ui-commands';
13
+ import { findNodesWithSameMark } from '@modusoperandi/licit-ui-commands';
14
14
  import lookUpElement from './lookUpElement';
15
15
  import LinkTooltip from './ui/LinkTooltip';
16
16
  import LinkURLEditor from './ui/LinkURLEditor';
17
- import { atAnchorTopCenter } from './ui/PopUpPosition';
18
- import createPopUp from './ui/createPopUp';
17
+ import { atAnchorTopCenter } from '@modusoperandi/licit-ui-commands';
18
+ import { createPopUp } from '@modusoperandi/licit-ui-commands';
19
19
 
20
- import './ui/czi-pop-up.css';
20
+ import '@modusoperandi/licit-ui-commands/dist/ui/czi-pop-up.css';
21
21
 
22
22
  // https://prosemirror.net/examples/tooltip/
23
23
  const SPEC = {
@@ -6,10 +6,10 @@ import { findParentNodeOfType } from 'prosemirror-utils';
6
6
  import { EditorView } from 'prosemirror-view';
7
7
 
8
8
  import { BULLET_LIST, ORDERED_LIST, IMAGE } from './NodeNames';
9
- import noop from './noop';
10
- import toggleList from './toggleList';
9
+ import { noop } from '@modusoperandi/licit-ui-commands';
10
+ import { toggleList } from '@modusoperandi/licit-ui-commands';
11
11
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
12
- import isNodeSelectionForNodeType from './isNodeSelectionForNodeType';
12
+ import { isNodeSelectionForNodeType } from '@modusoperandi/licit-ui-commands';
13
13
 
14
14
  export class ListToggleCommand extends UICommand {
15
15
  _ordered: boolean;
@@ -4,7 +4,7 @@ import { EditorState, AllSelection, TextSelection } from 'prosemirror-state';
4
4
  import { Transform } from 'prosemirror-transform';
5
5
  import { EditorView } from 'prosemirror-view';
6
6
 
7
- import { clearMarks, clearHeading } from './clearMarks';
7
+ import { clearMarks, clearHeading } from '@modusoperandi/licit-ui-commands';
8
8
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
9
9
 
10
10
  class MarksClearCommand extends UICommand {
@@ -15,7 +15,7 @@ import {
15
15
  import { MATH } from './NodeNames';
16
16
  import MathEditor from './ui/MathEditor';
17
17
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
18
- import createPopUp from './ui/createPopUp';
18
+ import { createPopUp } from '@modusoperandi/licit-ui-commands';
19
19
 
20
20
  function insertMath(tr: Transform, schema: Schema, latex: ?string): Transform {
21
21
  const { selection } = tr;
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import clamp from './ui/clamp';
2
+
3
3
  import convertToCSSPTValue from './convertToCSSPTValue';
4
4
  import toCSSLineSpacing from './ui/toCSSLineSpacing';
5
5
  import { Node } from 'prosemirror-model';
@@ -150,11 +150,7 @@ export const getParagraphStyle = getStyle;
150
150
 
151
151
  export function convertMarginLeftToIndentValue(marginLeft: string): number {
152
152
  const ptValue = convertToCSSPTValue(marginLeft);
153
- return clamp(
154
- MIN_INDENT_LEVEL,
155
- Math.floor(ptValue / INDENT_MARGIN_PT_SIZE),
156
- MAX_INDENT_LEVEL
157
- );
153
+ return Math.min(Math.max(Math.floor(ptValue / INDENT_MARGIN_PT_SIZE), MIN_INDENT_LEVEL), MAX_INDENT_LEVEL);
158
154
  }
159
155
 
160
156
  export default ParagraphNodeSpec;
@@ -6,10 +6,10 @@ import { setCellAttr } from 'prosemirror-tables';
6
6
  import { Transform } from 'prosemirror-transform';
7
7
  import { EditorView } from 'prosemirror-view';
8
8
 
9
- import ColorEditor from './ui/ColorEditor';
10
- import { atAnchorRight } from './ui/PopUpPosition';
9
+ import { ColorEditor } from '@modusoperandi/licit-ui-commands';
10
+ import { atAnchorRight } from '@modusoperandi/licit-ui-commands';
11
11
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
12
- import createPopUp from './ui/createPopUp';
12
+ import { createPopUp } from '@modusoperandi/licit-ui-commands';
13
13
 
14
14
  const setCellBackgroundBlack = setCellAttr('background', '#000000');
15
15
 
@@ -6,10 +6,10 @@ import { setCellAttr } from 'prosemirror-tables';
6
6
  import { Transform } from 'prosemirror-transform';
7
7
  import { EditorView } from 'prosemirror-view';
8
8
 
9
- import ColorEditor from './ui/ColorEditor';
10
- import { atAnchorRight } from './ui/PopUpPosition';
9
+ import { ColorEditor } from '@modusoperandi/licit-ui-commands';
10
+ import { atAnchorRight } from '@modusoperandi/licit-ui-commands';
11
11
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
12
- import createPopUp from './ui/createPopUp';
12
+ import { createPopUp } from '@modusoperandi/licit-ui-commands';
13
13
 
14
14
  const setCellBorderBlack = setCellAttr('borderColor', '#000000');
15
15
 
@@ -6,10 +6,10 @@ import { setCellAttr } from 'prosemirror-tables';
6
6
  import { Transform } from 'prosemirror-transform';
7
7
  import { EditorView } from 'prosemirror-view';
8
8
 
9
- import ColorEditor from './ui/ColorEditor';
10
- import { atAnchorRight } from './ui/PopUpPosition';
9
+ import { ColorEditor } from '@modusoperandi/licit-ui-commands';
10
+ import { atAnchorRight } from '@modusoperandi/licit-ui-commands';
11
11
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
12
- import createPopUp from './ui/createPopUp';
12
+ import { createPopUp } from '@modusoperandi/licit-ui-commands';
13
13
 
14
14
  const setCellBackgroundBlack = setCellAttr('background', '#000000');
15
15
 
@@ -6,13 +6,13 @@ import { EditorView } from 'prosemirror-view';
6
6
  import * as React from 'react';
7
7
 
8
8
  import findActionableCell from './findActionableCell';
9
- import { atAnchorTopRight } from './ui/PopUpPosition';
9
+ import { atAnchorTopRight } from '@modusoperandi/licit-ui-commands';
10
10
  import TableCellMenu from './ui/TableCellMenu';
11
11
  import bindScrollHandler from './ui/bindScrollHandler';
12
- import createPopUp from './ui/createPopUp';
12
+ import { createPopUp } from '@modusoperandi/licit-ui-commands';
13
13
  import isElementFullyVisible from './ui/isElementFullyVisible';
14
14
 
15
- import './ui/czi-pop-up.css';
15
+ import '@modusoperandi/licit-ui-commands/dist/ui/czi-pop-up.css';
16
16
 
17
17
  class TableCellTooltipView {
18
18
  _cellElement: null;
@@ -7,10 +7,10 @@ import { Transform } from 'prosemirror-transform';
7
7
  import { EditorView } from 'prosemirror-view';
8
8
  import { Fragment } from 'prosemirror-model';
9
9
  import insertTable from './insertTable';
10
- import { atAnchorRight } from './ui/PopUpPosition';
10
+ import { atAnchorRight } from '@modusoperandi/licit-ui-commands';
11
11
  import TableGridSizeEditor from './ui/TableGridSizeEditor';
12
12
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
13
- import createPopUp from './ui/createPopUp';
13
+ import { createPopUp } from '@modusoperandi/licit-ui-commands';
14
14
  import { PARAGRAPH } from './NodeNames';
15
15
  import type { TableGridSizeEditorValue } from './ui/TableGridSizeEditor';
16
16
 
@@ -8,7 +8,7 @@ import { EditorView } from 'prosemirror-view';
8
8
  import { MARK_SPACER } from './MarkNames';
9
9
  import { HEADING, LIST_ITEM, PARAGRAPH } from './NodeNames';
10
10
  import { HAIR_SPACE_CHAR, SPACER_SIZE_TAB } from './SpacerMarkSpec';
11
- import applyMark from './applyMark';
11
+ import { applyMark } from '@modusoperandi/licit-ui-commands';
12
12
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
13
13
 
14
14
  function insertTabSpace(
@@ -51,6 +51,21 @@ class CollabConnector extends SimpleConnector {
51
51
  };
52
52
  }
53
53
 
54
+ cleanUp = () => {
55
+ // remove collab plugin
56
+ if (this._connection) {
57
+ const cpIdx = this._editorState.plugins.findIndex((plugin) => {
58
+ return 'collab$' === plugin.spec.key.key;
59
+ });
60
+
61
+ if (-1 != cpIdx) {
62
+ this._editorState.plugins.splice(cpIdx, 1);
63
+ }
64
+
65
+ this._connection.close();
66
+ }
67
+ };
68
+
54
69
  onEdit = (transaction: Transform): void => {
55
70
  if (!this._connection.ready) {
56
71
  console.warn('not ready');
@@ -63,8 +78,8 @@ class CollabConnector extends SimpleConnector {
63
78
 
64
79
  // FS IRAD-1040 2020-09-02
65
80
  // Send the modified schema to server
66
- updateSchema = (schema: Schema) => {
67
- this._connection.updateSchema(schema);
81
+ updateSchema = (schema: Schema, data: any) => {
82
+ this._connection.updateSchema(schema, data);
68
83
  };
69
84
  }
70
85
 
@@ -106,7 +106,7 @@ class EditorConnection {
106
106
 
107
107
  if (newEditState) {
108
108
  let sendable;
109
- if (newEditState.doc.content.size > 40000) {
109
+ if (newEditState.doc.content.size > 4000000000000) {
110
110
  if (this.state.comm !== 'detached') {
111
111
  this.report.failure('Document too big. Detached.');
112
112
  }
@@ -132,6 +132,17 @@ class EditorConnection {
132
132
  }
133
133
  };
134
134
 
135
+ dispatchData(data: any) {
136
+ this.report.success();
137
+ this.backOff = 0;
138
+ this.dispatch({
139
+ type: 'loaded',
140
+ doc: this.getEffectiveSchema().nodeFromJSON(data),
141
+ version: data.version,
142
+ users: data.users,
143
+ });
144
+ }
145
+
135
146
  // Load the document from the server and start up
136
147
  start(): void {
137
148
  this.run(GET(this.url)).then(
@@ -242,7 +253,7 @@ class EditorConnection {
242
253
 
243
254
  // [FS] IRAD-1040 2020-09-02
244
255
  // Send the modified schema to server
245
- updateSchema(schema: Schema) {
256
+ updateSchema(schema: Schema, input: any) {
246
257
  // to avoid cyclic reference error, use flatted string.
247
258
  const schemaFlatted = stringify(schema);
248
259
  this.run(POST(this.url + '/schema/', schemaFlatted, 'text/plain')).then(
@@ -250,7 +261,7 @@ class EditorConnection {
250
261
  console.log("collab server's schema updated");
251
262
  // [FS] IRAD-1040 2020-09-08
252
263
  this.schema = schema;
253
- this.start();
264
+ this.start(input);
254
265
  },
255
266
  (err) => {
256
267
  this.report.failure(err);
@@ -14,8 +14,8 @@ import SimpleConnector from './SimpleConnector';
14
14
  import CollabConnector from './CollabConnector';
15
15
  import { EMPTY_DOC_JSON } from '../createEmptyEditorState';
16
16
  import type { EditorRuntime } from '../Types';
17
- import createPopUp from '../ui/createPopUp';
18
- import { atViewportCenter } from '../ui/PopUpPosition';
17
+ import { createPopUp } from '@modusoperandi/licit-ui-commands';
18
+ import { atViewportCenter } from '@modusoperandi/licit-ui-commands';
19
19
  import AlertInfo from '../ui/AlertInfo';
20
20
  import { SetDocAttrStep } from '@modusoperandi/licit-doc-attrs-step';
21
21
  import './licit.css';
@@ -73,7 +73,7 @@ class Licit extends React.Component<any, any> {
73
73
  this._editorView = null;
74
74
  this._skipSCU = true;
75
75
 
76
- const noop = function () { };
76
+ const noop = function () {};
77
77
 
78
78
  // [FS] IRAD-981 2020-06-10
79
79
  // Component's configurations.
@@ -132,17 +132,17 @@ class Licit extends React.Component<any, any> {
132
132
  const setState = this.setState.bind(this);
133
133
  this._connector = collaborative
134
134
  ? new CollabConnector(
135
- editorState,
136
- setState,
137
- {
138
- docID,
139
- collabServiceURL,
140
- },
141
- this._defaultEditorSchema,
142
- this._defaultEditorPlugins,
143
- // [FS] IRAD-1578 2021-09-27
144
- this.onReady.bind(this)
145
- )
135
+ editorState,
136
+ setState,
137
+ {
138
+ docID,
139
+ collabServiceURL,
140
+ },
141
+ this._defaultEditorSchema,
142
+ this._defaultEditorPlugins,
143
+ // [FS] IRAD-1578 2021-09-27
144
+ this.onReady.bind(this)
145
+ )
146
146
  : new SimpleConnector(editorState, setState);
147
147
 
148
148
  // FS IRAD-989 2020-18-06
@@ -168,7 +168,7 @@ class Licit extends React.Component<any, any> {
168
168
  // Get the modified schema from editorstate and send it to collab server
169
169
  if (this._connector.updateSchema) {
170
170
  // Use known editorState to update schema.
171
- this._connector.updateSchema(editorState.schema);
171
+ this._connector.updateSchema(editorState.schema, data);
172
172
  }
173
173
  }
174
174
 
@@ -265,12 +265,16 @@ class Licit extends React.Component<any, any> {
265
265
 
266
266
  setContent = (content: any = {}): void => {
267
267
  // [FS] IRAD-1571 2021-09-27
268
- // dispatch a transaction that MUST start from the views current state;
268
+ // dispatch a transaction that MUST start from the view’s current state;
269
269
  const editorState = this._editorView.state;
270
270
  const { doc, schema } = editorState;
271
271
  let { tr } = editorState;
272
272
  const document = schema.nodeFromJSON(content ? content : EMPTY_DOC_JSON);
273
273
 
274
+ // [FS] IRAD-1593 2021-10-12
275
+ // Reset lastKeyCode since the content is set dynamically and so lastKeyCode is invalid now.
276
+ this._editorView.lastKeyCode = null;
277
+
274
278
  const selection = TextSelection.create(doc, 0, doc.content.size);
275
279
 
276
280
  tr = tr.setSelection(selection).replaceSelectionWith(document, false);
@@ -278,8 +282,8 @@ class Licit extends React.Component<any, any> {
278
282
  // set the value for object metadata and objectId
279
283
  tr = this.isNodeHasAttribute(document, ATTR_OBJMETADATA)
280
284
  ? tr.step(
281
- new SetDocAttrStep(ATTR_OBJMETADATA, document.attrs.objectMetaData)
282
- )
285
+ new SetDocAttrStep(ATTR_OBJMETADATA, document.attrs.objectMetaData)
286
+ )
283
287
  : tr;
284
288
  tr = this.isNodeHasAttribute(document, ATTR_OBJID)
285
289
  ? tr.step(new SetDocAttrStep(ATTR_OBJID, document.attrs.objectId))
@@ -289,58 +293,84 @@ class Licit extends React.Component<any, any> {
289
293
  this._editorView.dispatch(tr);
290
294
  };
291
295
 
296
+ hasDataChanged(nextData: any) {
297
+ let dataChanged = false;
298
+
299
+ // [FS] IRAD-1571 2021-09-27
300
+ // dispatch a transaction that MUST start from the view’s current state;
301
+ // [FS] IRAD-1589 2021-10-04
302
+ // Do a proper circular JSON comparison.
303
+ if (stringify(this.state.data) !== stringify(nextData)) {
304
+ const editorState = this._editorView.state;
305
+ const nextDoc = editorState.schema.nodeFromJSON(
306
+ nextData ? nextData : EMPTY_DOC_JSON
307
+ );
308
+ dataChanged = !nextDoc.eq(editorState.doc);
309
+ }
310
+
311
+ return dataChanged;
312
+ }
313
+
314
+ changeContent(data: any) {
315
+ if (this.hasDataChanged(data)) {
316
+ // FS IRAD-1592 2021-11-10
317
+ // Release here quickly, so that update doesn't care about at this point.
318
+ // data changed, so update document content
319
+ setTimeout(this.setContent.bind(this, data), 1);
320
+ }
321
+ }
322
+
292
323
  shouldComponentUpdate(nextProps: any, nextState: any) {
293
324
  // Only interested if properties are set from outside.
294
325
  if (!this._skipSCU) {
295
326
  this._skipSCU = false;
296
- let dataChanged = false;
297
-
298
- // [FS] IRAD-1571 2021-09-27
299
- // dispatch a transaction that MUST start from the view�s current state;
300
- // [FS] IRAD-1589 2021-10-04
301
- // Do a proper circular JSON comparison.
302
- if (stringify(this.state.data) !== stringify(nextState.data)) {
303
- const editorState = this._editorView.state;
304
- const nextDoc = editorState.schema.nodeFromJSON(
305
- nextState.data ? nextState.data : EMPTY_DOC_JSON
306
- );
307
- dataChanged = !nextDoc.eq(editorState.doc);
308
- }
309
327
 
310
- if (dataChanged) {
311
- // data changed, so update document content
312
- this.setContent(nextState.data);
313
- }
328
+ this.changeContent(nextState.data);
314
329
 
315
330
  if (this.state.docID !== nextState.docID) {
316
- // Collaborative mode changed
317
- const collabEditing = nextState.docID !== '';
318
- const editorState = this._editorView.state;
319
- const setState = this.setState.bind(this);
320
- const docID = nextState.docID || '';
321
- const collabServiceURL =
322
- nextState.collabServiceURL || '/collaboration-service';
323
- // create new connector
324
- this._connector = collabEditing
325
- ? new CollabConnector(
326
- editorState,
327
- setState,
328
- {
329
- docID,
330
- collabServiceURL,
331
- },
332
- this._defaultEditorSchema,
333
- this._defaultEditorPlugins,
334
- // [FS] IRAD-1578 2021-09-27
335
- this.onReady.bind(this)
336
- )
337
- : new SimpleConnector(editorState, setState);
331
+ setTimeout(this.setDocID.bind(this, nextState), 1);
338
332
  }
339
333
  }
340
334
 
341
335
  return true;
342
336
  }
343
337
 
338
+ setDocID(nextState: any) {
339
+ // Collaborative mode changed
340
+ const collabEditing = nextState.docID !== '';
341
+ const editorState = this._editorView.state;
342
+ const setState = this.setState.bind(this);
343
+ const docID = nextState.docID || '';
344
+ const collabServiceURL =
345
+ nextState.collabServiceURL || '/collaboration-service';
346
+
347
+ if (this._connector) {
348
+ this._connector.cleanUp();
349
+ }
350
+ // create new connector
351
+ this._connector = collabEditing
352
+ ? new CollabConnector(
353
+ editorState,
354
+ setState,
355
+ {
356
+ docID,
357
+ collabServiceURL,
358
+ },
359
+ this._defaultEditorSchema,
360
+ this._defaultEditorPlugins,
361
+ // [FS] IRAD-1578 2021-09-27
362
+ this.onReady.bind(this)
363
+ )
364
+ : new SimpleConnector(editorState, setState);
365
+
366
+ // FS IRAD-1592 2021-11-10
367
+ // Notify collab server
368
+ if (this._connector.updateSchema) {
369
+ // Use known editorState to update schema.
370
+ this._connector.updateSchema(editorState.schema);
371
+ }
372
+ }
373
+
344
374
  render(): React.Element<any> {
345
375
  const {
346
376
  editorState,
@@ -401,7 +431,18 @@ class Licit extends React.Component<any, any> {
401
431
 
402
432
  if (transaction.docChanged) {
403
433
  const docJson = transaction.doc.toJSON();
404
- const isEmpty = this.isDocEmpty(docJson);
434
+ let isEmpty = false;
435
+
436
+ if (docJson.content && docJson.content.length === 1) {
437
+ if (
438
+ !docJson.content[0].content ||
439
+ (docJson.content[0].content &&
440
+ docJson.content[0].content[0].text &&
441
+ '' === docJson.content[0].content[0].text.trim())
442
+ ) {
443
+ isEmpty = true;
444
+ }
445
+ }
405
446
 
406
447
  // setCFlags is/was always the opposite of isEmpty.
407
448
  if (isEmpty) {
@@ -419,27 +460,6 @@ class Licit extends React.Component<any, any> {
419
460
  }
420
461
  }
421
462
  };
422
-
423
- isDocEmpty(docJson: Object) {
424
- let isEmpty = false;
425
-
426
- if (docJson.content && docJson.content.length === 1) {
427
- if (
428
- !docJson.content[0].content ||
429
- (docJson.content[0].content &&
430
- // [FS] IRAD-1710 2022-03-04
431
- // Empty if no content OR when the one & only text content is empty.
432
- 1 === docJson.content[0].content.length &&
433
- 'text' === docJson.content[0].content[0].type &&
434
- docJson.content[0].content[0].text &&
435
- '' === docJson.content[0].content[0].text)
436
- ) {
437
- isEmpty = true;
438
- }
439
- }
440
- return isEmpty;
441
- }
442
-
443
463
  // [FS] IRAD-1173 2021-02-25
444
464
  // Bug fix: Transaction mismatch error when a dialog is opened and keep typing.
445
465
  closeOpenedPopupModels() {
@@ -456,12 +476,8 @@ class Licit extends React.Component<any, any> {
456
476
  this._editorView = editorView;
457
477
  const tr = state.tr;
458
478
  const doc = state.doc;
459
-
460
- // [FS] IRAD-1710 2022-03-04
461
- if (!this.isDocEmpty(doc.toJSON())) {
462
- const trx = tr.setSelection(TextSelection.create(doc, 0, doc.content.size));
463
- dispatch(trx.scrollIntoView());
464
- }
479
+ const trx = tr.setSelection(TextSelection.create(doc, 0, doc.content.size));
480
+ dispatch(trx.scrollIntoView());
465
481
 
466
482
  // [FS] IRAD-1578 2021-09-27
467
483
  // In collab mode, fire onRead only after getting the response from collab server.
@@ -3,7 +3,7 @@ import { configure, shallow } from 'enzyme';
3
3
  import Adapter from 'enzyme-adapter-react-16';
4
4
  import Licit from './Licit';
5
5
  import RichTextEditor from '../ui/RichTextEditor';
6
- import noop from '../noop';
6
+ import { noop } from '@modusoperandi/licit-ui-commands';
7
7
 
8
8
  /**
9
9
  * Configure Jest to use react / enzyme
@@ -16,6 +16,17 @@ describe('<Licit />', () => {
16
16
  let wrapper;
17
17
  let licit;
18
18
 
19
+ // provide an empty document just to shut up that warning
20
+ const data = {
21
+ type: 'doc',
22
+ content: [
23
+ {
24
+ type: 'paragraph',
25
+ content: [{ type: 'text', text: ' ' }],
26
+ },
27
+ ],
28
+ };
29
+
19
30
  // Mocking the functions used in _onReady
20
31
  const fakeEditorView = {
21
32
  focus: noop,
@@ -24,6 +35,7 @@ describe('<Licit />', () => {
24
35
  doc: {
25
36
  content: { size: 10 },
26
37
  resolve: () => ({ min: () => 0, max: () => 10 }),
38
+ toJSON: () => data,
27
39
  },
28
40
  tr: {
29
41
  setSelection: () => fakeEditorView.state.tr,
@@ -33,16 +45,6 @@ describe('<Licit />', () => {
33
45
  };
34
46
 
35
47
  beforeEach(() => {
36
- // provide an empty document just to shut up that warning
37
- const data = {
38
- type: 'doc',
39
- content: [
40
- {
41
- type: 'paragraph',
42
- content: [{ type: 'text', text: ' ' }],
43
- },
44
- ],
45
- };
46
48
  wrapper = shallow(<Licit data={data} />);
47
49
  licit = wrapper.instance();
48
50
  });
@@ -47,7 +47,9 @@ class SimpleConnector {
47
47
 
48
48
  // FS IRAD-1040 2020-09-02
49
49
  // Send the modified schema to server
50
- updateSchema = (schema: Schema) => {};
50
+ updateSchema = (schema: Schema, data: any) => {};
51
+
52
+ cleanUp = () => {};
51
53
  }
52
54
 
53
55
  export default SimpleConnector;
@@ -4,7 +4,7 @@ import { Schema } from 'prosemirror-model';
4
4
  import { TextSelection } from 'prosemirror-state';
5
5
  import { Transform } from 'prosemirror-transform';
6
6
 
7
- import isListNode from './isListNode';
7
+ import { isListNode } from '@modusoperandi/licit-ui-commands';
8
8
  import joinDown from './joinDown';
9
9
  import joinUp from './joinUp';
10
10