@modusoperandi/licit 0.1.4 → 0.1.8

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 (692) hide show
  1. package/.babelrc +54 -54
  2. package/.dockerignore +4 -4
  3. package/.eslintignore +3 -3
  4. package/.eslintrc.js +80 -80
  5. package/.flowconfig +37 -37
  6. package/.github/workflows/build.yml +35 -29
  7. package/.github/workflows/lint.yml +30 -30
  8. package/.prettierignore +5 -5
  9. package/.prettierrc +4 -4
  10. package/.stylelintignore +1 -1
  11. package/.stylelintrc.json +13 -13
  12. package/.travis.yml +18 -18
  13. package/CODEOWNERS +40 -40
  14. package/LICENSE +22 -22
  15. package/README.md +286 -284
  16. package/build_collab_server.py +7 -7
  17. package/build_customstyle_server.py +7 -7
  18. package/build_image_server.py +7 -7
  19. package/dist/BlockquoteInsertNewLineCommand.js.flow +55 -55
  20. package/dist/BlockquoteNodeSpec.js.flow +30 -30
  21. package/dist/BlockquoteToggleCommand.js.flow +34 -34
  22. package/dist/BookmarkNodeSpec.js.flow +39 -39
  23. package/dist/BulletListNodeSpec.js.flow +61 -61
  24. package/dist/CZIProseMirror.js.flow +90 -90
  25. package/dist/CodeBlockCommand.js.flow +43 -43
  26. package/dist/CodeBlockNodeSpec.js.flow +24 -24
  27. package/dist/CodeMarkSpec.js.flow +14 -14
  28. package/dist/ContentPlaceholderPlugin.js.flow +187 -187
  29. package/dist/CursorPlaceholderPlugin.js.flow +115 -115
  30. package/dist/DocLayoutCommand.js.flow +94 -94
  31. package/dist/DocNodeSpec.js.flow +64 -64
  32. package/dist/EMMarkSpec.js.flow +14 -14
  33. package/dist/EditorCommands.js.flow +128 -128
  34. package/dist/EditorKeyMap.js.flow +187 -187
  35. package/dist/EditorMarks.js.flow +71 -71
  36. package/dist/EditorNodes.js.flow +60 -60
  37. package/dist/EditorPageLayoutPlugin.js.flow +67 -67
  38. package/dist/EditorPlugins.js.flow +8 -8
  39. package/dist/EditorSchema.js.flow +12 -12
  40. package/dist/EditorState.js.flow +7 -7
  41. package/dist/FontSizeCommand.js +0 -8
  42. package/dist/FontSizeCommand.js.flow +57 -73
  43. package/dist/FontSizeMarkSpec.js.flow +49 -49
  44. package/dist/FontTypeCommand.js +0 -8
  45. package/dist/FontTypeCommand.js.flow +100 -116
  46. package/dist/FontTypeMarkSpec.js.flow +80 -80
  47. package/dist/HTMLMutator.js.flow +59 -59
  48. package/dist/HardBreakNodeSpec.js.flow +15 -15
  49. package/dist/HeadingCommand.js.flow +51 -51
  50. package/dist/HeadingNodeSpec.js.flow +54 -54
  51. package/dist/HistoryRedoCommand.js.flow +20 -20
  52. package/dist/HistoryUndoCommand.js.flow +20 -20
  53. package/dist/HorizontalRuleCommand.js.flow +49 -49
  54. package/dist/HorizontalRuleNodeSpec.js.flow +39 -39
  55. package/dist/ImageFromURLCommand.js.flow +14 -14
  56. package/dist/ImageNodeSpec.js.flow +90 -90
  57. package/dist/ImageSourceCommand.js.flow +117 -117
  58. package/dist/ImageUploadCommand.js.flow +36 -36
  59. package/dist/ImageUploadPlaceholderPlugin.js.flow +192 -192
  60. package/dist/IndentCommand.js +0 -9
  61. package/dist/IndentCommand.js.flow +41 -54
  62. package/dist/LinkMarkSpec.js.flow +32 -32
  63. package/dist/LinkSetURLCommand.js.flow +103 -103
  64. package/dist/LinkTooltipPlugin.js.flow +203 -203
  65. package/dist/ListItemInsertNewLineCommand.js.flow +55 -55
  66. package/dist/ListItemMergeCommand.js.flow +177 -177
  67. package/dist/ListItemNodeSpec.js.flow +51 -51
  68. package/dist/ListSplitCommand.js.flow +32 -32
  69. package/dist/ListToggleCommand.js +3 -45
  70. package/dist/ListToggleCommand.js.flow +77 -117
  71. package/dist/MarkNames.js +2 -4
  72. package/dist/MarkNames.js.flow +18 -19
  73. package/dist/MarkToggleCommand.js +3 -114
  74. package/dist/MarkToggleCommand.js.flow +66 -168
  75. package/dist/MarksClearCommand.js +1 -18
  76. package/dist/MarksClearCommand.js.flow +42 -55
  77. package/dist/MathEditCommand.js.flow +110 -110
  78. package/dist/MathNodeSpec.js.flow +46 -46
  79. package/dist/NodeNames.js.flow +23 -23
  80. package/dist/OrderedListNodeSpec.js.flow +132 -132
  81. package/dist/ParagraphNodeSpec.js +6 -115
  82. package/dist/ParagraphNodeSpec.js.flow +160 -250
  83. package/dist/ParagraphSpacingCommand.js.flow +121 -121
  84. package/dist/PrintCommand.js.flow +31 -31
  85. package/dist/SelectionPlaceholderPlugin.js.flow +131 -131
  86. package/dist/SpacerMarkSpec.js.flow +47 -47
  87. package/dist/StrikeMarkSpec.js.flow +21 -21
  88. package/dist/StrongMarkSpec.js.flow +25 -25
  89. package/dist/StyleView.js.flow +19 -19
  90. package/dist/TableBackgroundColorCommand.js.flow +75 -75
  91. package/dist/TableBorderColorCommand.js.flow +75 -75
  92. package/dist/TableCellColorCommand.js.flow +71 -71
  93. package/dist/TableCellMenuPlugin.js.flow +125 -125
  94. package/dist/TableInsertCommand.js.flow +112 -112
  95. package/dist/TableMergeCellsCommand.js.flow +90 -90
  96. package/dist/TableNodesSpecs.js.flow +78 -78
  97. package/dist/TablePlugins.js.flow +14 -14
  98. package/dist/TableResizePlugin.js.flow +631 -631
  99. package/dist/TextAlignCommand.js +0 -8
  100. package/dist/TextAlignCommand.js.flow +122 -138
  101. package/dist/TextColorCommand.js +0 -16
  102. package/dist/TextColorCommand.js.flow +87 -112
  103. package/dist/TextColorMarkSpec.js.flow +35 -35
  104. package/dist/TextHighlightCommand.js +0 -12
  105. package/dist/TextHighlightCommand.js.flow +91 -110
  106. package/dist/TextHighlightMarkSpec.js.flow +38 -38
  107. package/dist/TextInsertTabSpaceCommand.js +2 -5
  108. package/dist/TextInsertTabSpaceCommand.js.flow +83 -85
  109. package/dist/TextLineSpacingCommand.js.flow +157 -157
  110. package/dist/TextNoWrapMarkSpec.js.flow +14 -14
  111. package/dist/TextNodeSpec.js.flow +7 -7
  112. package/dist/TextSelectionMarkSpec.js.flow +24 -24
  113. package/dist/TextSubMarkSpec.js.flow +20 -20
  114. package/dist/TextSuperMarkSpec.js.flow +20 -20
  115. package/dist/TextUnderlineMarkSpec.js.flow +27 -27
  116. package/dist/Types.js +2 -121
  117. package/dist/Types.js.flow +75 -155
  118. package/dist/WebFontLoader.js.flow +22 -22
  119. package/dist/applyMark.js +3 -4
  120. package/dist/applyMark.js.flow +61 -64
  121. package/dist/blockQuoteInputRule.js.flow +36 -36
  122. package/dist/bom.xml +89 -89
  123. package/dist/browser.js.flow +7 -7
  124. package/dist/buildEditorPlugins.js +1 -3
  125. package/dist/buildEditorPlugins.js.flow +51 -53
  126. package/dist/buildInputRules.js.flow +81 -81
  127. package/dist/clearMarks.js +2 -5
  128. package/dist/clearMarks.js.flow +128 -132
  129. package/dist/client/CollabConnector.js +7 -7
  130. package/dist/client/CollabConnector.js.flow +71 -75
  131. package/dist/client/EditorConnection.js.flow +307 -307
  132. package/dist/client/Licit.js +197 -117
  133. package/dist/client/Licit.js.flow +562 -495
  134. package/dist/client/Licit.test.js +3 -57
  135. package/dist/client/Licit.test.js.flow +65 -120
  136. package/dist/client/Reporter.js.flow +37 -37
  137. package/dist/client/SimpleConnector.js.flow +53 -53
  138. package/dist/client/http.js.flow +66 -66
  139. package/dist/client/licit.css +12 -12
  140. package/dist/client/throttle.js.flow +27 -27
  141. package/dist/compareNumber.js.flow +11 -11
  142. package/dist/consolidateListNodes.js +27 -27
  143. package/dist/consolidateListNodes.js.flow +281 -281
  144. package/dist/convertFromDOMElement.js.flow +36 -36
  145. package/dist/convertFromHTML.js.flow +19 -19
  146. package/dist/convertFromJSON.js.flow +78 -78
  147. package/dist/convertToCSSPTValue.js.flow +22 -22
  148. package/dist/convertToJSON.js.flow +7 -7
  149. package/dist/createCommand.js.flow +40 -40
  150. package/dist/createEditorKeyMap.js.flow +94 -94
  151. package/dist/createEmptyEditorState.js.flow +41 -41
  152. package/dist/createTableResizingPlugin.js.flow +86 -86
  153. package/dist/findActionableCell.js.flow +74 -74
  154. package/dist/findActiveMark.js.flow +32 -32
  155. package/dist/findNodesWithSameMark.js.flow +89 -89
  156. package/dist/hyphenize.js.flow +17 -17
  157. package/dist/index.js +0 -14
  158. package/dist/index.js.flow +10 -11
  159. package/dist/insertTable.js.flow +56 -56
  160. package/dist/isBulletListNode.js.flow +9 -9
  161. package/dist/isEditorStateEmpty.js.flow +32 -32
  162. package/dist/isInsideListItem.js.flow +13 -13
  163. package/dist/isListNode.js.flow +13 -13
  164. package/dist/isNodeSelectionForNodeType.js.flow +15 -15
  165. package/dist/isOrderedListNode.js.flow +9 -9
  166. package/dist/isTableNode.js.flow +15 -15
  167. package/dist/isTextStyleMarkCommandEnabled.js.flow +49 -49
  168. package/dist/joinDown.js.flow +27 -27
  169. package/dist/joinListNode.js.flow +55 -55
  170. package/dist/joinUp.js.flow +39 -39
  171. package/dist/keymaps.js.flow +185 -185
  172. package/dist/lookUpElement.js.flow +14 -14
  173. package/dist/nodeAt.js.flow +12 -12
  174. package/dist/noop.js.flow +5 -5
  175. package/dist/normalizeHTML.js.flow +78 -78
  176. package/dist/patchAnchorElements.js.flow +38 -38
  177. package/dist/patchBreakElements.js.flow +22 -22
  178. package/dist/patchElementInlineStyles.js.flow +92 -92
  179. package/dist/patchListElements.js.flow +276 -276
  180. package/dist/patchMathElements.js.flow +60 -60
  181. package/dist/patchParagraphElements.js.flow +20 -20
  182. package/dist/patchStyleElements.js.flow +194 -194
  183. package/dist/patchTableElements.js.flow +89 -89
  184. package/dist/rebaseDocWithSteps.js.flow +42 -42
  185. package/dist/sanitizeURL.js.flow +13 -13
  186. package/dist/splitListItem.js.flow +191 -191
  187. package/dist/styles.css +19 -21
  188. package/dist/styles0.css +29 -30
  189. package/dist/toClosestFontPtSize.js.flow +22 -22
  190. package/dist/toSafeHTMLDocument.js.flow +9 -9
  191. package/dist/toggleBlockquote.js.flow +91 -91
  192. package/dist/toggleCodeBlock.js.flow +102 -102
  193. package/dist/toggleHeading.js.flow +113 -113
  194. package/dist/toggleList.js.flow +450 -450
  195. package/dist/transformAndPreserveTextSelection.js.flow +151 -151
  196. package/dist/ui/AlertInfo.js +1 -1
  197. package/dist/ui/AlertInfo.js.flow +64 -64
  198. package/dist/ui/BookmarkNodeView.js.flow +66 -66
  199. package/dist/ui/ColorEditor.js.flow +101 -101
  200. package/dist/ui/CommandButton.js.flow +68 -68
  201. package/dist/ui/CommandMenu.js.flow +75 -75
  202. package/dist/ui/CommandMenuButton.js.flow +131 -131
  203. package/dist/ui/CustomButton.js.flow +33 -33
  204. package/dist/ui/CustomEditorView.js.flow +28 -28
  205. package/dist/ui/CustomMenu.js.flow +17 -17
  206. package/dist/ui/CustomMenuItem.js.flow +36 -36
  207. package/dist/ui/CustomNodeView.js +6 -1
  208. package/dist/ui/CustomNodeView.js.flow +200 -196
  209. package/dist/ui/CustomRadioButton.js.flow +65 -65
  210. package/dist/ui/DocLayoutEditor.js.flow +146 -146
  211. package/dist/ui/Editor.js.flow +291 -291
  212. package/dist/ui/EditorFrameset.js.flow +81 -81
  213. package/dist/ui/EditorToolbar.js.flow +211 -211
  214. package/dist/ui/EditorToolbarConfig.js +0 -6
  215. package/dist/ui/EditorToolbarConfig.js.flow +172 -178
  216. package/dist/ui/FontSizeCommandMenuButton.js.flow +66 -66
  217. package/dist/ui/FontTypeCommandMenuButton.js.flow +49 -49
  218. package/dist/ui/Frag.js.flow +13 -13
  219. package/dist/ui/Icon.js.flow +89 -89
  220. package/dist/ui/ImageAlignEditor.js.flow +60 -60
  221. package/dist/ui/ImageInlineEditor.js.flow +67 -67
  222. package/dist/ui/ImageNodeView.js +1 -10
  223. package/dist/ui/ImageNodeView.js.flow +404 -414
  224. package/dist/ui/ImageResizeBox.js.flow +219 -219
  225. package/dist/ui/ImageURLEditor.js.flow +119 -119
  226. package/dist/ui/ImageUploadEditor.js.flow +117 -117
  227. package/dist/ui/KeyCodes.js.flow +12 -12
  228. package/dist/ui/LinkTooltip.js.flow +85 -85
  229. package/dist/ui/LinkURLEditor.js.flow +111 -111
  230. package/dist/ui/ListItemNodeView.js.flow +98 -98
  231. package/dist/ui/ListTypeButton.js.flow +131 -131
  232. package/dist/ui/ListTypeCommandButton.js +1 -1
  233. package/dist/ui/ListTypeCommandButton.js.flow +85 -86
  234. package/dist/ui/ListTypeMenu.js.flow +70 -70
  235. package/dist/ui/LoadingIndicator.js.flow +20 -20
  236. package/dist/ui/MathEditor.js.flow +78 -78
  237. package/dist/ui/MathInlineEditor.js.flow +102 -102
  238. package/dist/ui/MathNodeView.js.flow +175 -175
  239. package/dist/ui/PasteMenu.js.flow +57 -57
  240. package/dist/ui/PointerSurface.js.flow +141 -141
  241. package/dist/ui/PopUp.js.flow +77 -77
  242. package/dist/ui/PopUpManager.js.flow +213 -213
  243. package/dist/ui/PopUpPosition.js +0 -0
  244. package/dist/ui/PopUpPosition.js.flow +104 -104
  245. package/dist/ui/ResizeObserver.js.flow +106 -106
  246. package/dist/ui/RichTextEditor.js.flow +133 -133
  247. package/dist/ui/SelectionObserver.js.flow +134 -134
  248. package/dist/ui/TableCellMenu.js.flow +38 -38
  249. package/dist/ui/TableGridSizeEditor.js.flow +184 -184
  250. package/dist/ui/TableNodeView.js.flow +22 -22
  251. package/dist/ui/TooltipSurface.js.flow +76 -76
  252. package/dist/ui/bindScrollHandler.js.flow +46 -46
  253. package/dist/ui/canUseCSSFont.js.flow +43 -43
  254. package/dist/ui/clamp.js.flow +11 -11
  255. package/dist/ui/createPopUp.js.flow +205 -205
  256. package/dist/ui/czi-animations.css +15 -15
  257. package/dist/ui/czi-body-layout-editor.css +16 -16
  258. package/dist/ui/czi-bookmark-view.css +10 -10
  259. package/dist/ui/czi-color-editor.css +56 -56
  260. package/dist/ui/czi-cursor-placeholder.css +36 -36
  261. package/dist/ui/czi-custom-button.css +93 -93
  262. package/dist/ui/czi-custom-menu-button.css +18 -18
  263. package/dist/ui/czi-custom-menu-item.css +30 -30
  264. package/dist/ui/czi-custom-menu.css +8 -8
  265. package/dist/ui/czi-custom-radio-button.css +80 -80
  266. package/dist/ui/czi-custom-scrollbar.css +21 -21
  267. package/dist/ui/czi-editor-frameset.css +81 -81
  268. package/dist/ui/czi-editor-toolbar.css +122 -122
  269. package/dist/ui/czi-editor.css +220 -221
  270. package/dist/ui/czi-form.css +104 -104
  271. package/dist/ui/czi-frag.css +3 -3
  272. package/dist/ui/czi-heading.css +40 -40
  273. package/dist/ui/czi-icon.css +72 -72
  274. package/dist/ui/czi-image-resize-box.css +165 -165
  275. package/dist/ui/czi-image-upload-editor.css +57 -57
  276. package/dist/ui/czi-image-upload-placeholder.css +50 -50
  277. package/dist/ui/czi-image-url-editor.css +38 -38
  278. package/dist/ui/czi-image-view.css +125 -125
  279. package/dist/ui/czi-indent.css +137 -137
  280. package/dist/ui/czi-inline-editor.css +20 -20
  281. package/dist/ui/czi-link-tooltip.css +71 -71
  282. package/dist/ui/czi-list.css +410 -410
  283. package/dist/ui/czi-loading-indicator.css +111 -111
  284. package/dist/ui/czi-math-view.css +62 -62
  285. package/dist/ui/czi-pop-up.css +32 -32
  286. package/dist/ui/czi-selection-placeholder.css +24 -24
  287. package/dist/ui/czi-table-cell-menu.css +14 -14
  288. package/dist/ui/czi-table-grid-size-editor.css +37 -37
  289. package/dist/ui/czi-table.css +86 -86
  290. package/dist/ui/czi-tooltip-surface.css +45 -45
  291. package/dist/ui/czi-vars.css +46 -46
  292. package/dist/ui/findActiveFontSize.js.flow +58 -58
  293. package/dist/ui/findActiveFontType.js.flow +38 -38
  294. package/dist/ui/fonts.css +471 -471
  295. package/dist/ui/handleEditorDrop.js.flow +28 -28
  296. package/dist/ui/handleEditorKeyDown.js.flow +39 -39
  297. package/dist/ui/handleEditorPaste.js.flow +33 -33
  298. package/dist/ui/htmlElementToRect.js.flow +18 -18
  299. package/dist/ui/icon-font.css +10 -10
  300. package/dist/ui/injectStyleSheet.js.flow +42 -42
  301. package/dist/ui/isElementFullyVisible.js.flow +23 -23
  302. package/dist/ui/isOffline.js.flow +8 -8
  303. package/dist/ui/isReactClass.js.flow +12 -12
  304. package/dist/ui/listType.css +21 -21
  305. package/dist/ui/mathquill-editor/MathQuillEditor.js.flow +159 -159
  306. package/dist/ui/mathquill-editor/MathQuillEditorSymbols.js.flow +483 -483
  307. package/dist/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js.flow +48 -48
  308. package/dist/ui/mathquill-editor/czi-mathquill-editor-symbols-panel.css +39 -39
  309. package/dist/ui/mathquill-editor/czi-mathquill-editor.css +50 -50
  310. package/dist/ui/mathquill-editor/mathquill-import-kludge.js.flow +24 -24
  311. package/dist/ui/preventEventDefault.js.flow +5 -5
  312. package/dist/ui/rects.js.flow +47 -47
  313. package/dist/ui/renderLaTeXAsHTML.js.flow +46 -46
  314. package/dist/ui/resolveImage.js.flow +123 -123
  315. package/dist/ui/toCSSColor.js.flow +51 -51
  316. package/dist/ui/toCSSLineSpacing.js.flow +82 -82
  317. package/dist/ui/toHexColor.js.flow +26 -26
  318. package/dist/ui/uuid.js.flow +9 -9
  319. package/dist/updateIndentLevel.js +1 -47
  320. package/dist/updateIndentLevel.js.flow +211 -260
  321. package/dist/uuid.js.flow +9 -9
  322. package/flow-typed/@modusoperandilicit-customstyles.js +5 -0
  323. package/flow-typed/@modusoperandilicit-doc-attrs-step.js +5 -5
  324. package/flow-typed/@molicit-citation.js +5 -5
  325. package/flow-typed/create-emotion.js +5 -5
  326. package/flow-typed/docs-editor.js +3 -3
  327. package/flow-typed/draft-convert.js +3 -3
  328. package/flow-typed/draft-js.js +3 -3
  329. package/flow-typed/flatted.js +5 -5
  330. package/flow-typed/jquery.js +5 -5
  331. package/flow-typed/katex.js +6 -6
  332. package/flow-typed/mathquill.js +5 -5
  333. package/flow-typed/prosemirror-collab.js +5 -5
  334. package/flow-typed/prosemirror-commands.js +5 -5
  335. package/flow-typed/prosemirror-dev-tools.js +5 -5
  336. package/flow-typed/prosemirror-dropcursor.js +5 -5
  337. package/flow-typed/prosemirror-gapcursor.js +5 -5
  338. package/flow-typed/prosemirror-history.js +5 -5
  339. package/flow-typed/prosemirror-inputrules.js +5 -5
  340. package/flow-typed/prosemirror-keymap.js +5 -5
  341. package/flow-typed/prosemirror-model.js +5 -5
  342. package/flow-typed/prosemirror-state.js +5 -5
  343. package/flow-typed/prosemirror-tables.js +5 -5
  344. package/flow-typed/prosemirror-transform.js +5 -5
  345. package/flow-typed/prosemirror-utils.js +5 -5
  346. package/flow-typed/prosemirror-view.js +5 -5
  347. package/flow-typed/resize-observer-polyfill.js +5 -5
  348. package/flow-typed/uuid.js +5 -5
  349. package/jest.setup.js +5 -5
  350. package/licit/client/CustomLicitRuntime.js +95 -200
  351. package/licit/client/CustomStyleRuntime.js +136 -0
  352. package/licit/client/index.js +366 -365
  353. package/licit/index.html +11 -11
  354. package/licit/server/collab/instance.js +221 -221
  355. package/licit/server/collab/route.js +69 -69
  356. package/licit/server/collab/server.js +297 -296
  357. package/licit/server/collab/start.js +13 -13
  358. package/licit/server/customstyles/start.js +184 -184
  359. package/licit/server/image/start.js +58 -58
  360. package/lint.sh +4 -4
  361. package/package.json +165 -165
  362. package/run_collab_server.py +21 -21
  363. package/run_customstyle_server.py +20 -20
  364. package/run_image_server.py +20 -20
  365. package/run_web_server.py +25 -25
  366. package/scripts/build_bin.js +10 -10
  367. package/scripts/build_bin.py +103 -103
  368. package/scripts/ci_check_dist.sh +13 -13
  369. package/scripts/env.js +6 -6
  370. package/scripts/webserver.js +35 -35
  371. package/sonar-project.properties +11 -11
  372. package/src/BlockquoteInsertNewLineCommand.js +55 -55
  373. package/src/BlockquoteNodeSpec.js +30 -30
  374. package/src/BlockquoteToggleCommand.js +34 -34
  375. package/src/BookmarkNodeSpec.js +39 -39
  376. package/src/BulletListNodeSpec.js +61 -61
  377. package/src/CZIProseMirror.js +90 -90
  378. package/src/CodeBlockCommand.js +43 -43
  379. package/src/CodeBlockNodeSpec.js +24 -24
  380. package/src/CodeMarkSpec.js +14 -14
  381. package/src/ContentPlaceholderPlugin.js +187 -187
  382. package/src/CursorPlaceholderPlugin.js +115 -115
  383. package/src/DocLayoutCommand.js +94 -94
  384. package/src/DocNodeSpec.js +64 -64
  385. package/src/EMMarkSpec.js +14 -14
  386. package/src/EditorCommands.js +128 -128
  387. package/src/EditorKeyMap.js +187 -187
  388. package/src/EditorMarks.js +71 -71
  389. package/src/EditorNodes.js +60 -60
  390. package/src/EditorPageLayoutPlugin.js +67 -67
  391. package/src/EditorPlugins.js +8 -8
  392. package/src/EditorSchema.js +12 -12
  393. package/src/EditorState.js +7 -7
  394. package/src/FontSizeCommand.js +57 -73
  395. package/src/FontSizeMarkSpec.js +49 -49
  396. package/src/FontTypeCommand.js +100 -116
  397. package/src/FontTypeMarkSpec.js +80 -80
  398. package/src/HTMLMutator.js +59 -59
  399. package/src/HardBreakNodeSpec.js +15 -15
  400. package/src/HeadingCommand.js +51 -51
  401. package/src/HeadingNodeSpec.js +54 -54
  402. package/src/HistoryRedoCommand.js +20 -20
  403. package/src/HistoryUndoCommand.js +20 -20
  404. package/src/HorizontalRuleCommand.js +49 -49
  405. package/src/HorizontalRuleNodeSpec.js +39 -39
  406. package/src/ImageFromURLCommand.js +14 -14
  407. package/src/ImageNodeSpec.js +90 -90
  408. package/src/ImageSourceCommand.js +117 -117
  409. package/src/ImageUploadCommand.js +36 -36
  410. package/src/ImageUploadPlaceholderPlugin.js +192 -192
  411. package/src/IndentCommand.js +41 -54
  412. package/src/LinkMarkSpec.js +32 -32
  413. package/src/LinkSetURLCommand.js +103 -103
  414. package/src/LinkTooltipPlugin.js +203 -203
  415. package/src/ListItemInsertNewLineCommand.js +55 -55
  416. package/src/ListItemMergeCommand.js +177 -177
  417. package/src/ListItemNodeSpec.js +51 -51
  418. package/src/ListSplitCommand.js +32 -32
  419. package/src/ListToggleCommand.js +77 -117
  420. package/src/MarkNames.js +18 -19
  421. package/src/MarkToggleCommand.js +66 -168
  422. package/src/MarksClearCommand.js +42 -55
  423. package/src/MathEditCommand.js +110 -110
  424. package/src/MathNodeSpec.js +46 -46
  425. package/src/NodeNames.js +23 -23
  426. package/src/OrderedListNodeSpec.js +132 -132
  427. package/src/ParagraphNodeSpec.js +160 -250
  428. package/src/ParagraphSpacingCommand.js +121 -121
  429. package/src/PrintCommand.js +31 -31
  430. package/src/SelectionPlaceholderPlugin.js +131 -131
  431. package/src/SpacerMarkSpec.js +47 -47
  432. package/src/StrikeMarkSpec.js +21 -21
  433. package/src/StrongMarkSpec.js +25 -25
  434. package/src/StyleView.js +19 -19
  435. package/src/TableBackgroundColorCommand.js +75 -75
  436. package/src/TableBorderColorCommand.js +75 -75
  437. package/src/TableCellColorCommand.js +71 -71
  438. package/src/TableCellMenuPlugin.js +125 -125
  439. package/src/TableInsertCommand.js +112 -112
  440. package/src/TableMergeCellsCommand.js +90 -90
  441. package/src/TableNodesSpecs.js +78 -78
  442. package/src/TablePlugins.js +14 -14
  443. package/src/TableResizePlugin.js +631 -631
  444. package/src/TextAlignCommand.js +122 -138
  445. package/src/TextColorCommand.js +87 -112
  446. package/src/TextColorMarkSpec.js +35 -35
  447. package/src/TextHighlightCommand.js +91 -110
  448. package/src/TextHighlightMarkSpec.js +38 -38
  449. package/src/TextInsertTabSpaceCommand.js +83 -85
  450. package/src/TextLineSpacingCommand.js +157 -157
  451. package/src/TextNoWrapMarkSpec.js +14 -14
  452. package/src/TextNodeSpec.js +7 -7
  453. package/src/TextSelectionMarkSpec.js +24 -24
  454. package/src/TextSubMarkSpec.js +20 -20
  455. package/src/TextSuperMarkSpec.js +20 -20
  456. package/src/TextUnderlineMarkSpec.js +27 -27
  457. package/src/Types.js +75 -155
  458. package/src/WebFontLoader.js +22 -22
  459. package/src/applyMark.js +61 -64
  460. package/src/blockQuoteInputRule.js +36 -36
  461. package/src/browser.js +7 -7
  462. package/src/buildEditorPlugins.js +51 -53
  463. package/src/buildInputRules.js +81 -81
  464. package/src/clearMarks.js +128 -132
  465. package/src/client/CollabConnector.js +71 -75
  466. package/src/client/EditorConnection.js +307 -307
  467. package/src/client/Licit.js +562 -495
  468. package/src/client/Licit.test.js +65 -120
  469. package/src/client/Reporter.js +37 -37
  470. package/src/client/SimpleConnector.js +53 -53
  471. package/src/client/http.js +66 -66
  472. package/src/client/licit.css +12 -12
  473. package/src/client/throttle.js +27 -27
  474. package/src/compareNumber.js +11 -11
  475. package/src/consolidateListNodes.js +281 -281
  476. package/src/convertFromDOMElement.js +36 -36
  477. package/src/convertFromHTML.js +19 -19
  478. package/src/convertFromJSON.js +78 -78
  479. package/src/convertToCSSPTValue.js +22 -22
  480. package/src/convertToJSON.js +7 -7
  481. package/src/createCommand.js +40 -40
  482. package/src/createEditorKeyMap.js +94 -94
  483. package/src/createEmptyEditorState.js +41 -41
  484. package/src/createTableResizingPlugin.js +86 -86
  485. package/src/findActionableCell.js +74 -74
  486. package/src/findActiveMark.js +32 -32
  487. package/src/findNodesWithSameMark.js +89 -89
  488. package/src/hyphenize.js +17 -17
  489. package/src/index.js +10 -11
  490. package/src/insertTable.js +56 -56
  491. package/src/isBulletListNode.js +9 -9
  492. package/src/isEditorStateEmpty.js +32 -32
  493. package/src/isInsideListItem.js +13 -13
  494. package/src/isListNode.js +13 -13
  495. package/src/isNodeSelectionForNodeType.js +15 -15
  496. package/src/isOrderedListNode.js +9 -9
  497. package/src/isTableNode.js +15 -15
  498. package/src/isTextStyleMarkCommandEnabled.js +49 -49
  499. package/src/joinDown.js +27 -27
  500. package/src/joinListNode.js +55 -55
  501. package/src/joinUp.js +39 -39
  502. package/src/keymaps.js +185 -185
  503. package/src/lookUpElement.js +14 -14
  504. package/src/nodeAt.js +12 -12
  505. package/src/noop.js +5 -5
  506. package/src/normalizeHTML.js +78 -78
  507. package/src/patchAnchorElements.js +38 -38
  508. package/src/patchBreakElements.js +22 -22
  509. package/src/patchElementInlineStyles.js +92 -92
  510. package/src/patchListElements.js +276 -276
  511. package/src/patchMathElements.js +60 -60
  512. package/src/patchParagraphElements.js +20 -20
  513. package/src/patchStyleElements.js +194 -194
  514. package/src/patchTableElements.js +89 -89
  515. package/src/rebaseDocWithSteps.js +42 -42
  516. package/src/sanitizeURL.js +13 -13
  517. package/src/splitListItem.js +191 -191
  518. package/src/styles.css +19 -21
  519. package/src/styles0.css +29 -30
  520. package/src/toClosestFontPtSize.js +22 -22
  521. package/src/toSafeHTMLDocument.js +9 -9
  522. package/src/toggleBlockquote.js +91 -91
  523. package/src/toggleCodeBlock.js +102 -102
  524. package/src/toggleHeading.js +113 -113
  525. package/src/toggleList.js +450 -450
  526. package/src/transformAndPreserveTextSelection.js +151 -151
  527. package/src/ui/AlertInfo.js +64 -64
  528. package/src/ui/BookmarkNodeView.js +66 -66
  529. package/src/ui/ColorEditor.js +101 -101
  530. package/src/ui/CommandButton.js +68 -68
  531. package/src/ui/CommandMenu.js +75 -75
  532. package/src/ui/CommandMenuButton.js +131 -131
  533. package/src/ui/CustomButton.js +33 -33
  534. package/src/ui/CustomEditorView.js +28 -28
  535. package/src/ui/CustomMenu.js +17 -17
  536. package/src/ui/CustomMenuItem.js +36 -36
  537. package/src/ui/CustomNodeView.js +200 -196
  538. package/src/ui/CustomRadioButton.js +65 -65
  539. package/src/ui/DocLayoutEditor.js +146 -146
  540. package/src/ui/Editor.js +291 -291
  541. package/src/ui/EditorFrameset.js +81 -81
  542. package/src/ui/EditorToolbar.js +211 -211
  543. package/src/ui/EditorToolbarConfig.js +172 -178
  544. package/src/ui/FontSizeCommandMenuButton.js +66 -66
  545. package/src/ui/FontTypeCommandMenuButton.js +49 -49
  546. package/src/ui/Frag.js +13 -13
  547. package/src/ui/Icon.js +89 -89
  548. package/src/ui/ImageAlignEditor.js +60 -60
  549. package/src/ui/ImageInlineEditor.js +67 -67
  550. package/src/ui/ImageNodeView.js +404 -414
  551. package/src/ui/ImageResizeBox.js +219 -219
  552. package/src/ui/ImageURLEditor.js +119 -119
  553. package/src/ui/ImageUploadEditor.js +117 -117
  554. package/src/ui/KeyCodes.js +12 -12
  555. package/src/ui/LinkTooltip.js +85 -85
  556. package/src/ui/LinkURLEditor.js +111 -111
  557. package/src/ui/ListItemNodeView.js +98 -98
  558. package/src/ui/ListTypeButton.js +131 -131
  559. package/src/ui/ListTypeCommandButton.js +85 -86
  560. package/src/ui/ListTypeMenu.js +70 -70
  561. package/src/ui/LoadingIndicator.js +20 -20
  562. package/src/ui/MathEditor.js +78 -78
  563. package/src/ui/MathInlineEditor.js +102 -102
  564. package/src/ui/MathNodeView.js +175 -175
  565. package/src/ui/PasteMenu.js +57 -57
  566. package/src/ui/PointerSurface.js +141 -141
  567. package/src/ui/PopUp.js +77 -77
  568. package/src/ui/PopUpManager.js +213 -213
  569. package/src/ui/PopUpPosition.js +104 -104
  570. package/src/ui/ResizeObserver.js +106 -106
  571. package/src/ui/RichTextEditor.js +133 -133
  572. package/src/ui/SelectionObserver.js +134 -134
  573. package/src/ui/TableCellMenu.js +38 -38
  574. package/src/ui/TableGridSizeEditor.js +184 -184
  575. package/src/ui/TableNodeView.js +22 -22
  576. package/src/ui/TooltipSurface.js +76 -76
  577. package/src/ui/bindScrollHandler.js +46 -46
  578. package/src/ui/canUseCSSFont.js +43 -43
  579. package/src/ui/clamp.js +11 -11
  580. package/src/ui/createPopUp.js +205 -205
  581. package/src/ui/czi-animations.css +15 -15
  582. package/src/ui/czi-body-layout-editor.css +16 -16
  583. package/src/ui/czi-bookmark-view.css +10 -10
  584. package/src/ui/czi-color-editor.css +56 -56
  585. package/src/ui/czi-cursor-placeholder.css +36 -36
  586. package/src/ui/czi-custom-button.css +93 -93
  587. package/src/ui/czi-custom-menu-button.css +18 -18
  588. package/src/ui/czi-custom-menu-item.css +30 -30
  589. package/src/ui/czi-custom-menu.css +8 -8
  590. package/src/ui/czi-custom-radio-button.css +80 -80
  591. package/src/ui/czi-custom-scrollbar.css +21 -21
  592. package/src/ui/czi-editor-frameset.css +81 -81
  593. package/src/ui/czi-editor-toolbar.css +122 -122
  594. package/src/ui/czi-editor.css +220 -221
  595. package/src/ui/czi-form.css +104 -104
  596. package/src/ui/czi-frag.css +3 -3
  597. package/src/ui/czi-heading.css +40 -40
  598. package/src/ui/czi-icon.css +72 -72
  599. package/src/ui/czi-image-resize-box.css +165 -165
  600. package/src/ui/czi-image-upload-editor.css +57 -57
  601. package/src/ui/czi-image-upload-placeholder.css +50 -50
  602. package/src/ui/czi-image-url-editor.css +38 -38
  603. package/src/ui/czi-image-view.css +125 -125
  604. package/src/ui/czi-indent.css +137 -137
  605. package/src/ui/czi-inline-editor.css +20 -20
  606. package/src/ui/czi-link-tooltip.css +71 -71
  607. package/src/ui/czi-list.css +410 -410
  608. package/src/ui/czi-loading-indicator.css +111 -111
  609. package/src/ui/czi-math-view.css +62 -62
  610. package/src/ui/czi-pop-up.css +32 -32
  611. package/src/ui/czi-selection-placeholder.css +24 -24
  612. package/src/ui/czi-table-cell-menu.css +14 -14
  613. package/src/ui/czi-table-grid-size-editor.css +37 -37
  614. package/src/ui/czi-table.css +86 -86
  615. package/src/ui/czi-tooltip-surface.css +45 -45
  616. package/src/ui/czi-vars.css +46 -46
  617. package/src/ui/findActiveFontSize.js +58 -58
  618. package/src/ui/findActiveFontType.js +38 -38
  619. package/src/ui/fonts.css +471 -471
  620. package/src/ui/handleEditorDrop.js +28 -28
  621. package/src/ui/handleEditorKeyDown.js +39 -39
  622. package/src/ui/handleEditorPaste.js +33 -33
  623. package/src/ui/htmlElementToRect.js +18 -18
  624. package/src/ui/icon-font.css +10 -10
  625. package/src/ui/injectStyleSheet.js +42 -42
  626. package/src/ui/isElementFullyVisible.js +23 -23
  627. package/src/ui/isOffline.js +8 -8
  628. package/src/ui/isReactClass.js +12 -12
  629. package/src/ui/listType.css +21 -21
  630. package/src/ui/mathquill-editor/MathQuillEditor.js +159 -159
  631. package/src/ui/mathquill-editor/MathQuillEditorSymbols.js +483 -483
  632. package/src/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +48 -48
  633. package/src/ui/mathquill-editor/czi-mathquill-editor-symbols-panel.css +39 -39
  634. package/src/ui/mathquill-editor/czi-mathquill-editor.css +50 -50
  635. package/src/ui/mathquill-editor/mathquill-import-kludge.js +24 -24
  636. package/src/ui/preventEventDefault.js +5 -5
  637. package/src/ui/rects.js +47 -47
  638. package/src/ui/renderLaTeXAsHTML.js +46 -46
  639. package/src/ui/resolveImage.js +123 -123
  640. package/src/ui/toCSSColor.js +51 -51
  641. package/src/ui/toCSSLineSpacing.js +82 -82
  642. package/src/ui/toHexColor.js +26 -26
  643. package/src/ui/uuid.js +9 -9
  644. package/src/updateIndentLevel.js +211 -260
  645. package/src/uuid.js +9 -9
  646. package/style-service.Dockerfile +26 -26
  647. package/utils/build_bin.js +9 -9
  648. package/utils/build_customstyle_server.js +71 -71
  649. package/utils/build_image_server.js +71 -71
  650. package/utils/build_licit_collab_server.js +75 -75
  651. package/utils/build_web_server.js +40 -40
  652. package/utils/env.js +6 -6
  653. package/webpack.config.js +126 -126
  654. package/dist/CustomStyleCommand.js +0 -1534
  655. package/dist/CustomStyleCommand.js.flow +0 -1690
  656. package/dist/StylePlugin.js +0 -533
  657. package/dist/StylePlugin.js.flow +0 -548
  658. package/dist/clearCustomStyleMarks.js +0 -43
  659. package/dist/clearCustomStyleMarks.js.flow +0 -34
  660. package/dist/customStyle.js +0 -185
  661. package/dist/customStyle.js.flow +0 -171
  662. package/dist/ui/CustomMenuButton.js +0 -155
  663. package/dist/ui/CustomMenuButton.js.flow +0 -129
  664. package/dist/ui/CustomMenuUI.js +0 -479
  665. package/dist/ui/CustomMenuUI.js.flow +0 -464
  666. package/dist/ui/CustomStyleEditor.js +0 -1216
  667. package/dist/ui/CustomStyleEditor.js.flow +0 -1325
  668. package/dist/ui/CustomStyleItem.js +0 -164
  669. package/dist/ui/CustomStyleItem.js.flow +0 -152
  670. package/dist/ui/CustomStyleSubMenu.js +0 -62
  671. package/dist/ui/CustomStyleSubMenu.js.flow +0 -54
  672. package/dist/ui/HeadingCommandMenuButton.js +0 -157
  673. package/dist/ui/HeadingCommandMenuButton.js.flow +0 -147
  674. package/dist/ui/custom-dropdown.css +0 -90
  675. package/dist/ui/custom-style-edit.css +0 -430
  676. package/dist/ui/czi-cust-style-numbered.css +0 -137
  677. package/dist/ui/findActiveCustomStyle.js +0 -53
  678. package/dist/ui/findActiveCustomStyle.js.flow +0 -38
  679. package/src/CustomStyleCommand.js +0 -1690
  680. package/src/StylePlugin.js +0 -548
  681. package/src/clearCustomStyleMarks.js +0 -34
  682. package/src/customStyle.js +0 -171
  683. package/src/ui/CustomMenuButton.js +0 -129
  684. package/src/ui/CustomMenuUI.js +0 -464
  685. package/src/ui/CustomStyleEditor.js +0 -1325
  686. package/src/ui/CustomStyleItem.js +0 -152
  687. package/src/ui/CustomStyleSubMenu.js +0 -54
  688. package/src/ui/HeadingCommandMenuButton.js +0 -147
  689. package/src/ui/custom-dropdown.css +0 -90
  690. package/src/ui/custom-style-edit.css +0 -430
  691. package/src/ui/czi-cust-style-numbered.css +0 -137
  692. package/src/ui/findActiveCustomStyle.js +0 -38
@@ -1,1216 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var React = _interopRequireWildcard(require("react"));
9
-
10
- require("./custom-style-edit.css");
11
-
12
- var _ColorEditor = _interopRequireDefault(require("./ColorEditor"));
13
-
14
- var _createPopUp = _interopRequireDefault(require("./createPopUp"));
15
-
16
- var _FontSizeCommandMenuButton = require("./FontSizeCommandMenuButton");
17
-
18
- var _FontTypeMarkSpec = require("../FontTypeMarkSpec");
19
-
20
- var _toCSSLineSpacing = require("./toCSSLineSpacing");
21
-
22
- var _customStyle = require("../customStyle");
23
-
24
- var _ParagraphNodeSpec = require("../ParagraphNodeSpec");
25
-
26
- var _prosemirrorState = require("prosemirror-state");
27
-
28
- var _Types = require("../Types");
29
-
30
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
-
32
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
-
34
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
-
36
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
37
-
38
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
39
-
40
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41
-
42
- let customStyles = [];
43
- const otherStyleSelected = false;
44
- const editedStyles = []; // Values to show in Linespacing drop-down
45
-
46
- const LINE_SPACE = ['Single', '1.15', '1.5', 'Double']; // Values to show in numbering/indent drop-down
47
-
48
- const LEVEL_VALUES = ['None', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'];
49
- const SAMPLE_TEXT = `Sample Text Sample Text Sample Text Sample Text Sample Text Sample Text Sample Text Sample.
50
- Sample Text Sample Text Sample Text Sample Text Sample Text`;
51
-
52
- class CustomStyleEditor extends React.PureComponent {
53
- constructor(props) {
54
- super(props);
55
-
56
- _defineProperty(this, "_unmounted", false);
57
-
58
- _defineProperty(this, "_popUp", null);
59
-
60
- _defineProperty(this, "_cancel", () => {
61
- // [FS] IRAD-1231 2021-03-02
62
- // FIX: edited custom styles not applied to the document
63
- if (3 === this.state.mode) {
64
- delete this.state.customStyles;
65
- this.props.close(editedStyles);
66
- } else {
67
- this.props.close();
68
- }
69
- });
70
-
71
- _defineProperty(this, "_save", () => {
72
- delete this.state.otherStyleSelected; // [FS] IRAD-1137 2021-01-15
73
- // FIX: able to save a custom style name with already exist style name
74
-
75
- if (0 === this.state.mode && (0, _customStyle.isCustomStyleExists)(this.state.styleName)) {
76
- const errMsg = document.getElementById('errormsg');
77
-
78
- if (errMsg && errMsg.style) {
79
- errMsg.style.display = '';
80
- } // [FS] IRAD-1176 2021-02-08
81
- // save the custom styles from Edit all option.
82
-
83
- } else if (3 === this.state.mode) {
84
- this.modifyCustomStyle(this.state);
85
- editedStyles.push(this.state.styleName);
86
- } else {
87
- if ('' != this.state.styleName) {
88
- delete this.state.customStyles;
89
- this.props.close(this.state);
90
- }
91
- }
92
- });
93
-
94
- _defineProperty(this, "handleKeyDown", e => {
95
- const txtName = document.getElementById('txtName');
96
-
97
- if (txtName) {
98
- txtName.focus();
99
- }
100
- });
101
-
102
- this.state = _objectSpread(_objectSpread({}, props), {}, {
103
- otherStyleSelected,
104
- customStyles
105
- }); // set default values for text alignment and boldNumbering checkbox.
106
-
107
- if (!this.state.styles.align) {
108
- this.state.styles.align = 'left';
109
- }
110
-
111
- if (0 === this.state.mode) {
112
- this.state.styles.boldNumbering = true;
113
- this.state.styles.boldSentence = true;
114
- this.state.styles.nextLineStyleName = _ParagraphNodeSpec.RESERVED_STYLE_NONE;
115
- }
116
-
117
- if (!this.state.styles.fontName) {
118
- this.state.styles.fontName = 'Arial';
119
- }
120
-
121
- if (!this.state.styles.fontSize) {
122
- this.state.styles.fontSize = 11;
123
- }
124
-
125
- this.getCustomStyles(props.editorView.runtime);
126
- }
127
-
128
- componentWillUnmount() {
129
- this._unmounted = true;
130
- } // To set the selected style values
131
-
132
-
133
- onStyleClick(style, event) {
134
- let state = null;
135
-
136
- switch (style) {
137
- // simple toggles where style matches the key to change.
138
- case 'strong':
139
- case 'em':
140
- case 'strike':
141
- case 'super':
142
- case 'underline':
143
- // copy the current style values, and flip the matching value
144
- state = {
145
- styles: _objectSpread({}, this.state.styles)
146
- };
147
- state.styles[style] = !state.styles[style];
148
- break;
149
-
150
- case 'name':
151
- if (event) {
152
- const oldName = this.state.styleName;
153
- const newName = event.target.value;
154
- state = {
155
- styleName: newName,
156
- styles: null
157
- };
158
- state.styles = _objectSpread({}, this.state.styles);
159
-
160
- if (this.state.styles.nextLineStyleName === oldName) {
161
- // Update next line style as well.
162
- state.styles.nextLineStyleName = newName;
163
- }
164
- }
165
-
166
- break;
167
-
168
- case 'description':
169
- if (event) {
170
- state = {
171
- description: event.target.value
172
- };
173
- }
174
-
175
- break;
176
- // [FS] IRAD-1497 2021-06-30
177
- // Not able to set paragraph spacing before and after.
178
-
179
- case 'before':
180
- if (event) {
181
- state = {
182
- styles: _objectSpread({}, this.state.styles)
183
- };
184
- state.styles['paragraphSpacingBefore'] = event.target.value;
185
- }
186
-
187
- break;
188
-
189
- case 'after':
190
- if (event) {
191
- state = {
192
- styles: _objectSpread({}, this.state.styles)
193
- };
194
- state.styles['paragraphSpacingAfter'] = event.target.value;
195
- }
196
-
197
- break;
198
-
199
- default:
200
- break;
201
- } // save changes and update
202
-
203
-
204
- if (state) {
205
- this.setState(state, () => this.buildStyle());
206
- }
207
- } // Build styles to display the example piece
208
-
209
-
210
- buildStyle() {
211
- const style = {};
212
-
213
- if (this.state.styles.fontName) {
214
- style.fontFamily = this.state.styles.fontName;
215
- }
216
-
217
- if (this.state.styles.fontSize) {
218
- style.fontSize = `${this.state.styles.fontSize}px`;
219
- }
220
-
221
- if (this.state.styles.strong) {
222
- style.fontWeight = 'bold';
223
- }
224
-
225
- if (this.state.styles.color) {
226
- style.color = this.state.styles.color;
227
- }
228
-
229
- if (this.state.styles.underline) {
230
- style.textDecoration = undefined !== style.textDecoration ? `${style.textDecoration}${' underline'}` : 'underline';
231
- }
232
-
233
- if (this.state.styles.strike) {
234
- style.textDecoration = undefined !== style.textDecoration ? `${style.textDecoration}${' line-through'}` : 'line-through';
235
- }
236
-
237
- if (this.state.styles.em) {
238
- style.fontStyle = 'italic';
239
- }
240
-
241
- if (this.state.styles.textHighlight) {
242
- style.backgroundColor = this.state.styles.textHighlight;
243
- }
244
-
245
- if (this.state.styles.align) {
246
- style.textAlign = this.state.styles.align;
247
- }
248
-
249
- if (this.state.styles.lineHeight) {
250
- // [FS] IRAD-1104 2020-11-13
251
- // Issue fix : Linespacing Double and Single not applied in the sample text paragraph
252
- style.lineHeight = (0, _toCSSLineSpacing.getLineSpacingValue)(this.state.styles.lineHeight);
253
- } // [FS] IRAD-1111 2020-12-10
254
- // Issue fix : Paragraph space before is not applied in the sample text.
255
-
256
-
257
- if (this.state.styles.paragraphSpacingBefore) {
258
- style.marginTop = `${this.state.styles.paragraphSpacingBefore}px`;
259
- } // [FS] IRAD-1111 2020-12-10
260
- // Issue fix : Paragraph space after is not applied in the sample text.
261
-
262
-
263
- if (this.state.styles.paragraphSpacingAfter) {
264
- style.marginBottom = `${this.state.styles.paragraphSpacingAfter}px`;
265
- } // [FS] IRAD-1111 2020-12-10
266
- // Issue fix : Indent is not applied in the sample text.
267
-
268
-
269
- if (!this.state.styles.isLevelbased) {
270
- if (this.state.styles.indent) {
271
- style.marginLeft = `${this.state.styles.indent * 2}px`;
272
- }
273
- } else {
274
- const levelValue = document && document.getElementById('levelValue');
275
-
276
- if ( // this covers null & undefined
277
- levelValue instanceof window.HTMLSelectElement && levelValue.value) {
278
- style.marginLeft = `${parseInt(levelValue.value) * 2}px`;
279
- }
280
- }
281
-
282
- const sampleDiv = document.getElementById('sampletextdiv');
283
-
284
- if (sampleDiv) {
285
- // [FS] IRAD-1394 2021-06-02
286
- // Issue: numbering sample not working when select Bold first sentence
287
- let textSample = SAMPLE_TEXT;
288
-
289
- if (this.state.styles.boldPartial) {
290
- if (this.state.styles.boldSentence) {
291
- const content = SAMPLE_TEXT.split('.');
292
- sampleDiv.innerHTML = `<strong>${content[0]}</strong> ${content[1]}`;
293
- } else {
294
- const content = SAMPLE_TEXT.split(' ');
295
- sampleDiv.innerHTML = `<strong>${content[0]}</strong> ${SAMPLE_TEXT}`;
296
- }
297
-
298
- textSample = sampleDiv.innerHTML; // [FS] IRAD-1473 2021-06-30
299
- // Style Example not showing properly when select Bold and Bold First Sentence
300
-
301
- style.fontWeight = 'normal';
302
- }
303
-
304
- if (this.state.styles.styleLevel && this.state.styles.hasNumbering) {
305
- // [FS] IRAD-1137 2021-01-11
306
- // Issue fix : The Preview text is not showing the numbering in bold after Bold Numbering is enabled.
307
- const sampleDiv = document.getElementById('sampletextdiv');
308
-
309
- if (sampleDiv) {
310
- if (this.state.styles.boldNumbering) {
311
- sampleDiv.innerHTML = `<strong>${this.getNumberingLevel(this.state.styles.styleLevel)}</strong>${textSample}`;
312
- } else {
313
- sampleDiv.innerText = `${this.getNumberingLevel(this.state.styles.styleLevel)}${textSample}`;
314
- }
315
- }
316
- } else {
317
- sampleDiv.innerText = `${SAMPLE_TEXT}`;
318
- sampleDiv.innerHTML = textSample;
319
- }
320
- }
321
-
322
- return style;
323
- } // [FS] IRAD-1111 2020-12-10
324
- // get the numbering corresponding to the level
325
-
326
-
327
- getNumberingLevel(level) {
328
- let levelStyle = '';
329
-
330
- for (let i = 0; i < parseInt(level); i++) {
331
- levelStyle = levelStyle + '1.';
332
- }
333
-
334
- return levelStyle + ' ';
335
- } // handles font name change
336
-
337
-
338
- onFontNameChange(e) {
339
- this.setState({
340
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
341
- fontName: e.target.value
342
- })
343
- });
344
- } // handles indent radio button event
345
-
346
-
347
- onIndentRadioChanged(e) {
348
- if ('0' == e.target.value) {
349
- this.setState({
350
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
351
- isLevelbased: true
352
- })
353
- });
354
- } else {
355
- this.setState({
356
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
357
- isLevelbased: false
358
- })
359
- });
360
- }
361
- } // handles scentece bold event
362
-
363
-
364
- onScentenceRadioChanged(e) {
365
- if ('0' == e.target.value) {
366
- this.setState({
367
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
368
- boldSentence: true
369
- })
370
- });
371
- } else {
372
- this.setState({
373
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
374
- boldSentence: false
375
- })
376
- });
377
- }
378
- } // handles font size change
379
-
380
-
381
- onFontSizeChange(e) {
382
- this.setState({
383
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
384
- fontSize: e.target.value
385
- })
386
- });
387
- } // handles line space change
388
-
389
-
390
- onLineSpaceChange(e) {
391
- this.setState({
392
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
393
- lineHeight: e.target.value
394
- })
395
- });
396
- } // handles Level drop down change
397
-
398
-
399
- onLevelChange(e) {
400
- const val = _ParagraphNodeSpec.RESERVED_STYLE_NONE === e.target.value ? null : e.target.value;
401
- this.setState({
402
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
403
- styleLevel: val
404
- })
405
- });
406
- } // handles indent dropdown change
407
-
408
-
409
- onIndentChange(e) {
410
- this.setState({
411
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
412
- indent: 'None' === e.target.value ? 0 : e.target.value
413
- })
414
- });
415
- } // [FS] IRAD-1201 2021-02-18
416
- // set the nextLineStyle to JSON on style selection changed
417
-
418
-
419
- onOtherStyleSelectionChanged(e) {
420
- if (this.state.otherStyleSelected) {
421
- this.setState({
422
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
423
- nextLineStyleName: e.target.value
424
- })
425
- });
426
- }
427
- } // [FS] IRAD-1201 2021-02-18
428
- // set the nextLineStyle to JSON according to the selected option
429
-
430
-
431
- onNextLineStyleSelected(selectedOption) {
432
- const hiddenDiv = document.getElementById('nextStyle');
433
-
434
- if (hiddenDiv) {
435
- hiddenDiv.style.display = 'none';
436
- }
437
-
438
- if (0 === selectedOption) {
439
- this.setState({
440
- otherStyleSelected: false
441
- });
442
- this.setState({
443
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
444
- nextLineStyleName: 'None'
445
- })
446
- });
447
- } else if (1 === selectedOption) {
448
- this.setState({
449
- otherStyleSelected: false
450
- });
451
- this.setState({
452
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
453
- nextLineStyleName: this.state.styleName
454
- })
455
- });
456
- } else {
457
- if (hiddenDiv) {
458
- hiddenDiv.style.display = 'block';
459
- }
460
-
461
- const selectedStyle = document.getElementById('nextStyleValue');
462
-
463
- if (selectedStyle instanceof window.HTMLSelectElement) {
464
- this.setState({
465
- otherStyleSelected: true,
466
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
467
- nextLineStyleName: selectedStyle.options[selectedStyle.selectedIndex].text
468
- })
469
- });
470
- }
471
- }
472
- } // [FS] IRAD-1127 2020-12-31
473
- // to populate the selected custom styles.
474
-
475
-
476
- onSelectCustomStyle(e) {
477
- if (null !== customStyles) {
478
- const value = this.state.customStyles.find(u => u.styleName === e.target.value); // FIX: not able to modify and save the populated style
479
-
480
- value.mode = 3;
481
- this.state = _objectSpread({}, value);
482
- this.setState(this.state);
483
- this.setNextLineStyle(this.state.styles.nextLineStyleName);
484
- }
485
- } // shows color dialog based on input text-color/text-heighlight
486
-
487
-
488
- showColorDialog(isTextColor, event) {
489
- const anchor = event ? event.currentTarget : null;
490
- const hex = null;
491
- this._popUp = (0, _createPopUp.default)(_ColorEditor.default, {
492
- hex
493
- }, {
494
- anchor,
495
- autoDismiss: true,
496
- IsChildDialog: true,
497
- onClose: val => {
498
- if (this._popUp) {
499
- this._popUp = null;
500
-
501
- if (undefined !== val) {
502
- if (isTextColor) {
503
- this.setState({
504
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
505
- color: val
506
- })
507
- });
508
- } else {
509
- this.setState({
510
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
511
- textHighlight: val
512
- })
513
- });
514
- }
515
- }
516
- }
517
- }
518
- });
519
- } //handles the option button click, close the popup with selected values
520
-
521
-
522
- onAlignButtonClick(val) {
523
- this.setState({
524
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
525
- align: val
526
- })
527
- });
528
- }
529
-
530
- handleNumbering(val) {
531
- // if user select numbering, then always set nextLineStyle as continues this style.
532
- // [FS] IRAD-1221 2021-03-01
533
- // Issue fix: The next line style not switch back to 'None' when disable the numbering.
534
- this.setState({
535
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
536
- hasNumbering: val.target.checked,
537
- nextLineStyleName: val.target.checked ? this.state.styleName : _ParagraphNodeSpec.RESERVED_STYLE_NONE
538
- })
539
- });
540
- } // handles the boldNumbering checkbox actions
541
-
542
-
543
- handleBoldNumbering(val) {
544
- this.setState({
545
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
546
- boldNumbering: val.target.checked
547
- })
548
- });
549
- } // handles the boldNumbering checkbox actions
550
-
551
-
552
- handleBoldPartial(val) {
553
- this.setState({
554
- styles: _objectSpread(_objectSpread({}, this.state.styles), {}, {
555
- boldPartial: val.target.checked
556
- })
557
- }); // this.setState({ styles: { ...this.state.styles, boldSentence: val.target.checked ? true : false } });
558
- } // [FS] IRAD-1201 2021-02-17
559
- // to check if the "select style" option selected by user
560
-
561
-
562
- selectStyleCheckboxState() {
563
- let chceked = false;
564
-
565
- if (this.state.styles.nextLineStyleName) {
566
- chceked = this.state.styles.nextLineStyleName !== 'None' && this.state.styles.nextLineStyleName !== this.state.styleName;
567
- }
568
-
569
- return chceked;
570
- }
571
-
572
- componentDidMount() {
573
- const acc = document.getElementsByClassName('licit-accordion');
574
- let i;
575
-
576
- for (i = 0; i < acc.length; i++) {
577
- acc[i].addEventListener('click', function () {
578
- this.classList.toggle('accactive');
579
- const panel = this.nextElementSibling;
580
-
581
- if (panel.style.maxHeight) {
582
- panel.style.maxHeight = null;
583
- } else {
584
- panel.style.maxHeight = panel.scrollHeight + 'px';
585
- }
586
- });
587
- }
588
-
589
- const mp = document.getElementsByClassName('panel')[0];
590
- mp.style.maxHeight = mp.scrollHeight + 'px';
591
- const mp1 = document.getElementsByClassName('panel1')[0];
592
- mp1.style.maxHeight = mp1.scrollHeight + 'px';
593
- const mp2 = document.getElementsByClassName('panel2')[0];
594
- mp2.style.maxHeight = mp2.scrollHeight + 'px';
595
- const mp3 = document.getElementsByClassName('panel3')[0];
596
- mp3.style.maxHeight = mp3.scrollHeight + 'px';
597
- this.setNextLineStyle(this.state.styles.nextLineStyleName); // [FS] IRAD-1153 2021-02-25
598
- // Numbering level not showing in Preview text when modify style
599
-
600
- if (1 == this.props.mode && this.state.styles.styleLevel && this.state.styles.hasNumbering) {
601
- this.buildStyle();
602
- }
603
- }
604
-
605
- render() {
606
- return /*#__PURE__*/React.createElement("div", {
607
- className: "customedit-div"
608
- }, /*#__PURE__*/React.createElement("div", {
609
- className: "customedit-head"
610
- }, /*#__PURE__*/React.createElement("span", null, this.state.mode == 0 ? 'Create Style' : 'Edit Style')), /*#__PURE__*/React.createElement("div", {
611
- className: "customedit-body"
612
- }, /*#__PURE__*/React.createElement("div", {
613
- className: "sectiondiv"
614
- }, /*#__PURE__*/React.createElement("div", {
615
- style: 3 > this.props.mode ? {
616
- display: 'none'
617
- } : {
618
- display: 'block'
619
- }
620
- }, /*#__PURE__*/React.createElement("p", {
621
- className: "formp"
622
- }, "Styles:"), /*#__PURE__*/React.createElement("select", {
623
- className: "stylenameinput fontstyle",
624
- defaultValue: 'DEFAULT',
625
- onChange: this.onSelectCustomStyle.bind(this),
626
- style: {
627
- height: '24px'
628
- }
629
- }, /*#__PURE__*/React.createElement("option", {
630
- disabled: true,
631
- value: "DEFAULT"
632
- }, ' ', "-- select a style --", ' '), this.state.customStyles.map(style => /*#__PURE__*/React.createElement("option", {
633
- key: style.styleName,
634
- value: style.styleName
635
- }, style.styleName)))), /*#__PURE__*/React.createElement("p", {
636
- className: "formp"
637
- }, "Style Name:", ' ', /*#__PURE__*/React.createElement("span", {
638
- id: "errormsg",
639
- style: {
640
- display: 'none',
641
- color: 'red'
642
- }
643
- }, (0, _customStyle.isCustomStyleExists)(this.state.styleName) ? 'Style name already exists' : '')), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("input", {
644
- autoFocus: true,
645
- className: "stylenameinput fontstyle",
646
- disabled: this.state.mode == 1 || this.state.mode == 3 ? true : false,
647
- id: "txtName",
648
- key: "name",
649
- onChange: this.onStyleClick.bind(this, 'name'),
650
- type: "text",
651
- value: this.state.styleName || ''
652
- })), /*#__PURE__*/React.createElement("p", {
653
- className: "formp"
654
- }, "Description:"), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("input", {
655
- className: "stylenameinput fontstyle",
656
- key: "description",
657
- onChange: this.onStyleClick.bind(this, 'description'),
658
- type: "text",
659
- value: this.state.description || ''
660
- })), /*#__PURE__*/React.createElement("p", {
661
- className: "formp"
662
- }, "Preview:"), /*#__PURE__*/React.createElement("div", {
663
- className: "textareadiv",
664
- name: "body",
665
- style: 3 == this.props.mode ? {
666
- height: '164px'
667
- } : {
668
- height: '215px'
669
- }
670
- }, /*#__PURE__*/React.createElement("div", {
671
- className: "sampletext"
672
- }, "Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph"), /*#__PURE__*/React.createElement("div", {
673
- className: this.state.styles.super ? 'hide-sampletext' : 'visible-sampletext',
674
- id: "sampletextdiv",
675
- style: this.buildStyle()
676
- }, SAMPLE_TEXT), /*#__PURE__*/React.createElement("sup", {
677
- className: this.state.styles.super ? 'visible-sampletext' : 'hide-sampletext',
678
- id: "mo-sup",
679
- style: this.buildStyle()
680
- }, SAMPLE_TEXT), /*#__PURE__*/React.createElement("div", {
681
- className: "sampletext"
682
- }, "Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph"))), /*#__PURE__*/React.createElement("div", {
683
- className: "sectiondiv editorsection",
684
- style: this.disableRename()
685
- }, /*#__PURE__*/React.createElement("p", {
686
- className: "formp"
687
- }, "Style Attributes:"), /*#__PURE__*/React.createElement("div", {
688
- style: {
689
- height: '329px',
690
- overflow: 'hidden auto',
691
- overflowX: 'hidden',
692
- border: '1px solid'
693
- }
694
- }, /*#__PURE__*/React.createElement("button", {
695
- className: "licit-accordion accactive",
696
- id: "accordion1"
697
- }, /*#__PURE__*/React.createElement("div", {
698
- className: "indentdiv"
699
- }, /*#__PURE__*/React.createElement("span", {
700
- className: "iconspan czi-icon text_format",
701
- style: {
702
- marginTop: '1px'
703
- }
704
- }, "text_format"), /*#__PURE__*/React.createElement("label", {
705
- style: {
706
- marginLeft: '-10px',
707
- marginTop: '2px',
708
- color: '#444'
709
- }
710
- }, "Font"))), /*#__PURE__*/React.createElement("div", {
711
- className: "panel"
712
- }, /*#__PURE__*/React.createElement("div", {
713
- className: "sectiondiv"
714
- }, /*#__PURE__*/React.createElement("select", {
715
- className: "fonttype fontstyle",
716
- onChange: this.onFontNameChange.bind(this),
717
- value: this.state.styles.fontName || 'Arial'
718
- }, _FontTypeMarkSpec.FONT_TYPE_NAMES.map(value => /*#__PURE__*/React.createElement("option", {
719
- key: value,
720
- value: value
721
- }, value))), /*#__PURE__*/React.createElement("select", {
722
- className: "fontsize fontstyle",
723
- onChange: this.onFontSizeChange.bind(this),
724
- value: this.state.styles.fontSize || 11
725
- }, _FontSizeCommandMenuButton.FONT_PT_SIZES.map(value => /*#__PURE__*/React.createElement("option", {
726
- key: value,
727
- value: value
728
- }, value)))), /*#__PURE__*/React.createElement("div", {
729
- className: "font-buttons"
730
- }, /*#__PURE__*/React.createElement("span", {
731
- "aria-label": " Bold",
732
- className: "czi-tooltip-surface markbutton-container",
733
- "data-tooltip": " Bold",
734
- id: "86ba3aa0-ff11-11ea-930a-95c69ca4f97f",
735
- onClick: this.onStyleClick.bind(this, 'strong'),
736
- role: "tooltip",
737
- style: {
738
- marginLeft: '5px',
739
- marginRight: '5px'
740
- }
741
- }, /*#__PURE__*/React.createElement("span", {
742
- "aria-disabled": "false",
743
- "aria-pressed": "false",
744
- className: this.state.styles.strong ? 'czi-custom-button use-icon active markbuttons' : 'czi-custom-button use-icon markbuttons',
745
- role: "button"
746
- }, /*#__PURE__*/React.createElement("span", {
747
- className: "iconspan czi-icon format_bold editor-markbuttons"
748
- }, "format_bold"))), /*#__PURE__*/React.createElement("span", {
749
- "aria-label": " Italic",
750
- className: "czi-tooltip-surface fontstyle markbutton-container",
751
- "data-tooltip": " Italic",
752
- id: "86ba61b0-ff11-11ea-930a-95c69ca4f97f",
753
- onClick: this.onStyleClick.bind(this, 'em'),
754
- role: "tooltip"
755
- }, /*#__PURE__*/React.createElement("span", {
756
- "aria-disabled": "false",
757
- "aria-pressed": "false",
758
- className: this.state.styles.em ? 'czi-custom-button use-icon active markbuttons' : 'czi-custom-button use-icon markbuttons',
759
- role: "button"
760
- }, /*#__PURE__*/React.createElement("span", {
761
- className: "iconspan czi-icon format_italic editor-markbuttons"
762
- }, "format_italic"), /*#__PURE__*/React.createElement("span", null, " "))), /*#__PURE__*/React.createElement("span", {
763
- "aria-label": " Underline",
764
- className: "czi-tooltip-surface fontstyle markbutton-container",
765
- "data-tooltip": " Underline",
766
- id: "86ba88c0-ff11-11ea-930a-95c69ca4f97f",
767
- onClick: this.onStyleClick.bind(this, 'underline'),
768
- role: "tooltip"
769
- }, /*#__PURE__*/React.createElement("span", {
770
- "aria-disabled": "false",
771
- "aria-pressed": "false",
772
- className: this.state.styles.underline ? 'czi-custom-button use-icon active markbuttons' : 'czi-custom-button use-icon markbuttons',
773
- role: "button"
774
- }, /*#__PURE__*/React.createElement("span", {
775
- className: "iconspan czi-icon format_underline editor-markbuttons"
776
- }, "format_underline"), /*#__PURE__*/React.createElement("span", null, " "))), /*#__PURE__*/React.createElement("span", {
777
- "aria-label": " Text color",
778
- className: "czi-tooltip-surface fontstyle markbutton-container",
779
- "data-tooltip": " Text color",
780
- id: "86bad6e1-ff11-11ea-930a-95c69ca4f97f",
781
- onClick: this.showColorDialog.bind(this, true),
782
- role: "tooltip"
783
- }, /*#__PURE__*/React.createElement("span", {
784
- "aria-disabled": "false",
785
- "aria-pressed": "false",
786
- className: "czi-custom-button use-icon markbuttons",
787
- role: "button"
788
- }, /*#__PURE__*/React.createElement("span", {
789
- className: "iconspan czi-icon format_color_text editor-markbuttons",
790
- style: {
791
- color: this.state.styles.color !== 'rgba(0,0,0,0)' ? this.state.styles.color : '#666'
792
- }
793
- }, "format_color_text"), /*#__PURE__*/React.createElement("span", null, " "))), /*#__PURE__*/React.createElement("span", {
794
- "aria-label": " Highlight color",
795
- className: "czi-tooltip-surface fontstyle markbutton-container",
796
- "data-tooltip": " Highlight color",
797
- id: "86bafdf0-ff11-11ea-930a-95c69ca4f97f",
798
- onClick: this.showColorDialog.bind(this, false),
799
- role: "tooltip"
800
- }, /*#__PURE__*/React.createElement("span", {
801
- "aria-disabled": "false",
802
- "aria-pressed": "false",
803
- className: "czi-custom-button use-icon markbuttons",
804
- role: "button"
805
- }, /*#__PURE__*/React.createElement("span", {
806
- className: " iconspan czi-icon border_color editor-markbuttons",
807
- style: {
808
- color: this.state.styles.textHighlight !== 'rgba(0,0,0,0)' ? this.state.styles.textHighlight : '#666'
809
- }
810
- }, "border_color"), /*#__PURE__*/React.createElement("span", null, " ")))), /*#__PURE__*/React.createElement("div", {
811
- className: "formp hierarchydiv"
812
- }, /*#__PURE__*/React.createElement("span", {
813
- style: {
814
- float: 'left'
815
- }
816
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
817
- checked: this.state.styles.boldPartial,
818
- onChange: this.handleBoldPartial.bind(this),
819
- type: "checkbox"
820
- }), "Bold the")), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("input", {
821
- checked: this.state.styles.boldSentence,
822
- disabled: this.state.styles.boldPartial ? false : true,
823
- name: "boldscentence",
824
- onChange: this.onScentenceRadioChanged.bind(this),
825
- style: {
826
- marginLeft: '20px'
827
- },
828
- type: "radio",
829
- value: "0"
830
- }), /*#__PURE__*/React.createElement("label", {
831
- style: {
832
- marginLeft: '4px',
833
- marginTop: '3px',
834
- marginBottom: '0'
835
- }
836
- }, "First Sentence"), /*#__PURE__*/React.createElement("input", {
837
- checked: !this.state.styles.boldSentence,
838
- disabled: this.state.styles.boldPartial ? false : true,
839
- name: "boldscentence",
840
- onChange: this.onScentenceRadioChanged.bind(this),
841
- style: {
842
- marginLeft: '20px'
843
- },
844
- type: "radio",
845
- value: "1"
846
- }), /*#__PURE__*/React.createElement("label", {
847
- style: {
848
- marginLeft: '4px',
849
- marginTop: '3px',
850
- marginBottom: '0'
851
- }
852
- }, "First Word")))), /*#__PURE__*/React.createElement("button", {
853
- className: "licit-accordion accactive"
854
- }, /*#__PURE__*/React.createElement("div", {
855
- className: "indentdiv"
856
- }, /*#__PURE__*/React.createElement("span", {
857
- className: "iconspan czi-icon format_textdirection_l_to_r",
858
- style: {
859
- marginTop: '1px'
860
- }
861
- }, "format_textdirection_l_to_r"), /*#__PURE__*/React.createElement("label", {
862
- style: {
863
- marginLeft: '-10px',
864
- marginTop: '2px',
865
- color: '#444'
866
- }
867
- }, "Paragraph"))), /*#__PURE__*/React.createElement("div", {
868
- className: "panel1"
869
- }, /*#__PURE__*/React.createElement("p", {
870
- className: "formp"
871
- }, "Alignment:"), /*#__PURE__*/React.createElement("div", {
872
- className: "czi-custom-buttons"
873
- }, /*#__PURE__*/React.createElement("span", {
874
- "aria-label": " Align Left",
875
- className: "czi-tooltip-surface",
876
- "data-tooltip": " Align Left",
877
- id: "86ba3aa0-ff11-11ea-930a-95c69ca4f97f",
878
- role: "tooltip"
879
- }, /*#__PURE__*/React.createElement("span", {
880
- "aria-disabled": "false",
881
- "aria-pressed": "false",
882
- className: this.state.styles.align == 'left' ? 'czi-custom-button use-icon activealignbuttons' : 'czi-custom-button alignbuttons',
883
- onClick: this.onAlignButtonClick.bind(this, 'left'),
884
- role: "button"
885
- }, /*#__PURE__*/React.createElement("span", {
886
- className: "iconspan czi-icon format_align_left"
887
- }, "format_align_left"))), /*#__PURE__*/React.createElement("span", {
888
- "aria-label": " Align Center",
889
- className: "czi-tooltip-surface alignbuttons",
890
- "data-tooltip": " Align Center",
891
- id: "86ba61b0-ff11-11ea-930a-95c69ca4f97f",
892
- role: "tooltip"
893
- }, /*#__PURE__*/React.createElement("span", {
894
- "aria-disabled": "false",
895
- "aria-pressed": "false",
896
- className: this.state.styles.align == 'center' ? 'czi-custom-button use-icon activealignbuttons' : 'czi-custom-button alignbuttons',
897
- onClick: this.onAlignButtonClick.bind(this, 'center'),
898
- role: "button"
899
- }, /*#__PURE__*/React.createElement("span", {
900
- className: "iconspan czi-icon format_align_center"
901
- }, "format_align_center"))), /*#__PURE__*/React.createElement("span", {
902
- "aria-label": " Align Right",
903
- className: "czi-tooltip-surface alignbuttons",
904
- "data-tooltip": " Align Right",
905
- id: "86ba88c0-ff11-11ea-930a-95c69ca4f97f",
906
- role: "tooltip"
907
- }, /*#__PURE__*/React.createElement("span", {
908
- "aria-disabled": "false",
909
- "aria-pressed": "false",
910
- className: this.state.styles.align == 'right' ? 'czi-custom-button use-icon activealignbuttons' : 'czi-custom-button alignbuttons',
911
- onClick: this.onAlignButtonClick.bind(this, 'right'),
912
- role: "button"
913
- }, /*#__PURE__*/React.createElement("span", {
914
- className: "iconspan czi-icon format_align_right"
915
- }, "format_align_right"))), /*#__PURE__*/React.createElement("span", {
916
- "aria-label": " Justify",
917
- className: "czi-tooltip-surface alignbuttons",
918
- "data-tooltip": " Justify",
919
- id: "86baafd0-ff11-11ea-930a-95c69ca4f97f",
920
- role: "tooltip"
921
- }, /*#__PURE__*/React.createElement("span", {
922
- "aria-disabled": "false",
923
- "aria-pressed": "false",
924
- className: this.state.styles.align == 'justify' ? 'czi-custom-button use-icon activealignbuttons' : 'czi-custom-button alignbuttons',
925
- onClick: this.onAlignButtonClick.bind(this, 'justify'),
926
- role: "button"
927
- }, /*#__PURE__*/React.createElement("span", {
928
- className: "iconspan czi-icon format_align_justify"
929
- }, "format_align_justify")))), /*#__PURE__*/React.createElement("p", {
930
- className: "formp"
931
- }, "Line Spacing:"), /*#__PURE__*/React.createElement("select", {
932
- className: "linespacing fontstyle",
933
- onChange: this.onLineSpaceChange.bind(this),
934
- value: this.state.styles.lineHeight || ''
935
- }, LINE_SPACE.map(value => /*#__PURE__*/React.createElement("option", {
936
- key: value,
937
- value: value
938
- }, value))), /*#__PURE__*/React.createElement("p", {
939
- className: "formp"
940
- }, "Paragraph Spacing:"), /*#__PURE__*/React.createElement("div", {
941
- className: "spacingdiv"
942
- }, /*#__PURE__*/React.createElement("label", null, "Before: "), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("input", {
943
- className: "spacinginput fontstyle",
944
- key: "before",
945
- onChange: this.onStyleClick.bind(this, 'before'),
946
- type: "text",
947
- value: this.state.styles.paragraphSpacingBefore || ''
948
- })), /*#__PURE__*/React.createElement("label", {
949
- style: {
950
- marginLeft: '3px'
951
- }
952
- }, " pts"), /*#__PURE__*/React.createElement("label", {
953
- style: {
954
- marginLeft: '23px'
955
- }
956
- }, "After: "), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("input", {
957
- className: "spacinginput fontstyle",
958
- key: "after",
959
- onChange: this.onStyleClick.bind(this, 'after'),
960
- type: "text",
961
- value: this.state.styles.paragraphSpacingAfter || ''
962
- })), /*#__PURE__*/React.createElement("label", {
963
- style: {
964
- marginLeft: '3px'
965
- }
966
- }, "pts"))), /*#__PURE__*/React.createElement("button", {
967
- className: "licit-accordion accactive"
968
- }, /*#__PURE__*/React.createElement("div", {
969
- className: "indentdiv"
970
- }, /*#__PURE__*/React.createElement("span", {
971
- className: "iconspan czi-icon account_tree"
972
- }, "account_tree"), /*#__PURE__*/React.createElement("label", {
973
- style: {
974
- marginLeft: '-7px',
975
- marginTop: '2px',
976
- color: '#444'
977
- }
978
- }, "Hierarchy"))), /*#__PURE__*/React.createElement("div", {
979
- className: "panel2 formp"
980
- }, /*#__PURE__*/React.createElement("p", {
981
- className: "formp"
982
- }, "Level:"), /*#__PURE__*/React.createElement("div", {
983
- className: "hierarchydiv"
984
- }, /*#__PURE__*/React.createElement("span", {
985
- style: {
986
- float: 'left',
987
- marginTop: '8px'
988
- }
989
- }, /*#__PURE__*/React.createElement("select", {
990
- className: "leveltype fontstyle",
991
- id: "levelValue",
992
- onChange: this.onLevelChange.bind(this),
993
- value: this.state.styles.styleLevel || ''
994
- }, LEVEL_VALUES.map(value => /*#__PURE__*/React.createElement("option", {
995
- key: value,
996
- value: value
997
- }, value)))), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
998
- checked: this.state.styles.hasNumbering,
999
- className: "chknumbering",
1000
- disabled: this.state.styles.styleLevel ? false : true,
1001
- onChange: this.handleNumbering.bind(this),
1002
- type: "checkbox"
1003
- }), "Numbering(1.1)"), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
1004
- checked: this.state.styles.boldNumbering,
1005
- className: "chkboldnumbering",
1006
- disabled: this.state.styles.hasNumbering ? false : true,
1007
- onChange: this.handleBoldNumbering.bind(this),
1008
- type: "checkbox"
1009
- }), "Bold numbering"))), /*#__PURE__*/React.createElement("p", {
1010
- className: "formp"
1011
- }, "Indenting:"), /*#__PURE__*/React.createElement("div", {
1012
- className: "hierarchydiv"
1013
- }, /*#__PURE__*/React.createElement("div", {
1014
- className: "indentdiv"
1015
- }, /*#__PURE__*/React.createElement("input", {
1016
- checked: this.state.styles.isLevelbased,
1017
- name: "indenting",
1018
- onChange: this.onIndentRadioChanged.bind(this),
1019
- type: "radio",
1020
- value: "0"
1021
- }), /*#__PURE__*/React.createElement("label", {
1022
- style: {
1023
- marginLeft: '4px',
1024
- marginTop: '3px',
1025
- marginBottom: '0'
1026
- }
1027
- }, "Based On Level")), /*#__PURE__*/React.createElement("div", {
1028
- className: "indentdiv"
1029
- }, /*#__PURE__*/React.createElement("input", {
1030
- checked: !this.state.styles.isLevelbased,
1031
- name: "indenting",
1032
- onChange: this.onIndentRadioChanged.bind(this),
1033
- type: "radio",
1034
- value: "1"
1035
- }), /*#__PURE__*/React.createElement("label", {
1036
- style: {
1037
- marginLeft: '4px',
1038
- marginTop: '3px',
1039
- marginBottom: '0'
1040
- }
1041
- }, "Specified"), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("select", {
1042
- className: "leveltype specifiedindent fontstyle",
1043
- onChange: this.onIndentChange.bind(this),
1044
- style: {
1045
- width: '99px !important'
1046
- },
1047
- value: this.state.styles.indent || ''
1048
- }, LEVEL_VALUES.map(value => /*#__PURE__*/React.createElement("option", {
1049
- key: value,
1050
- value: value
1051
- }, value))))))), /*#__PURE__*/React.createElement("button", {
1052
- className: "licit-accordion accactive"
1053
- }, /*#__PURE__*/React.createElement("div", {
1054
- className: "indentdiv"
1055
- }, /*#__PURE__*/React.createElement("label", {
1056
- style: {
1057
- marginLeft: '-7px',
1058
- marginTop: '2px',
1059
- color: '#444'
1060
- }
1061
- }, "Style Settings"))), /*#__PURE__*/React.createElement("div", {
1062
- className: "panel3 formp"
1063
- }, /*#__PURE__*/React.createElement("p", {
1064
- className: "formp"
1065
- }, "Select style for next line:"), /*#__PURE__*/React.createElement("div", {
1066
- className: "hierarchydiv"
1067
- }, /*#__PURE__*/React.createElement("div", {
1068
- className: "settingsdiv"
1069
- }, /*#__PURE__*/React.createElement("input", {
1070
- checked: this.state.styles.nextLineStyleName === this.state.styleName && !this.state.otherStyleSelected,
1071
- name: "nextlinestyle",
1072
- onChange: this.onNextLineStyleSelected.bind(this, 1),
1073
- type: "radio",
1074
- value: "1"
1075
- }), /*#__PURE__*/React.createElement("label", {
1076
- style: {
1077
- marginLeft: '4px',
1078
- marginTop: '3px',
1079
- marginBottom: '0'
1080
- }
1081
- }, "Continue this style")), /*#__PURE__*/React.createElement("div", {
1082
- className: "settingsdiv"
1083
- }, /*#__PURE__*/React.createElement("input", {
1084
- checked: this.state.styles.nextLineStyleName === 'None',
1085
- name: "nextlinestyle",
1086
- onChange: this.onNextLineStyleSelected.bind(this, 0),
1087
- style: {
1088
- marginLeft: '20px'
1089
- },
1090
- type: "radio",
1091
- value: "2"
1092
- }), /*#__PURE__*/React.createElement("label", {
1093
- style: {
1094
- marginLeft: '4px',
1095
- marginTop: '3px',
1096
- marginBottom: '0'
1097
- }
1098
- }, "None")), /*#__PURE__*/React.createElement("div", {
1099
- className: "indentdiv"
1100
- }, /*#__PURE__*/React.createElement("input", {
1101
- checked: this.state.otherStyleSelected,
1102
- name: "nextlinestyle",
1103
- onChange: this.onNextLineStyleSelected.bind(this, 2),
1104
- type: "radio",
1105
- value: "0"
1106
- }), /*#__PURE__*/React.createElement("label", {
1107
- style: {
1108
- marginLeft: '4px',
1109
- marginTop: '3px',
1110
- marginBottom: '0',
1111
- width: '62px'
1112
- }
1113
- }, "Select style"), /*#__PURE__*/React.createElement("span", {
1114
- id: "nextStyle",
1115
- style: {
1116
- display: 'none'
1117
- }
1118
- }, /*#__PURE__*/React.createElement("select", {
1119
- className: "fontstyle stylenameinput" // defaultValue={'DEFAULT'}
1120
- ,
1121
- id: "nextStyleValue",
1122
- onChange: this.onOtherStyleSelectionChanged.bind(this),
1123
- style: {
1124
- height: '20px',
1125
- marginLeft: '7px',
1126
- width: '97px'
1127
- },
1128
- value: this.state.styles.nextLineStyleName
1129
- }, customStyles.map(style => /*#__PURE__*/React.createElement("option", {
1130
- key: style.styleName
1131
- }, style.styleName)))))))))), /*#__PURE__*/React.createElement("div", {
1132
- className: "btns"
1133
- }, /*#__PURE__*/React.createElement("button", {
1134
- className: "buttonstyle",
1135
- onClick: this._cancel
1136
- }, this.state.mode == 3 ? 'Close' : 'Cancel'), /*#__PURE__*/React.createElement("button", {
1137
- className: "btnsave buttonstyle",
1138
- onClick: this._save.bind(this),
1139
- onKeyDown: this.handleKeyDown
1140
- }, "Save")));
1141
- }
1142
-
1143
- // [FS] IRAD-1176 2021-02-08
1144
- // save the custom styles from Edit all option.
1145
- modifyCustomStyle(val) {
1146
- const {
1147
- runtime
1148
- } = this.props.editorView;
1149
-
1150
- if (runtime && typeof runtime.saveStyle === 'function') {
1151
- delete val.editorView;
1152
- runtime.saveStyle(val).then(result => {});
1153
- }
1154
- } // To fetch the custom styles from server and set to the state.
1155
-
1156
-
1157
- getCustomStyles(runtime) {
1158
- if (runtime && typeof runtime.getStylesAsync === 'function') {
1159
- runtime.getStylesAsync().then(result => {
1160
- customStyles = result; // [FS] IRAD-1222 2021-03-01
1161
- // Issue fix: In edit all, the style list not showing the first time.
1162
-
1163
- this.setState({
1164
- customStyles: result
1165
- });
1166
- });
1167
- }
1168
- } // [FS] IRAD-1231 2021-03-03
1169
- // Issue fix: Selected style for next line not retaining when modify.
1170
-
1171
-
1172
- setNextLineStyle(nextLineStyleName) {
1173
- // [FS] IRAD-1241 2021-03-05
1174
- // The selcted Style in the Next line setting not retaing in Edit All and modify
1175
- let display = '';
1176
-
1177
- if (0 < this.props.mode && nextLineStyleName && _ParagraphNodeSpec.RESERVED_STYLE_NONE !== nextLineStyleName && nextLineStyleName !== this.state.styleName) {
1178
- this.setState({
1179
- otherStyleSelected: true
1180
- });
1181
- display = 'block';
1182
- const selectedStyle = document.getElementById('nextStyleValue');
1183
-
1184
- if (selectedStyle instanceof window.HTMLSelectElement) {
1185
- selectedStyle.value = nextLineStyleName;
1186
- }
1187
- } else {
1188
- this.setState({
1189
- otherStyleSelected: false
1190
- });
1191
- display = 'none';
1192
- }
1193
-
1194
- const hiddenDiv = document.getElementById('nextStyle');
1195
-
1196
- if (hiddenDiv && hiddenDiv.style) {
1197
- hiddenDiv.style.display = display;
1198
- }
1199
- } // Disable the style attribute div on Rename
1200
-
1201
-
1202
- disableRename() {
1203
- const style = {};
1204
-
1205
- if (2 === this.state.mode) {
1206
- style.opacity = 0.4;
1207
- style.pointerEvents = 'none';
1208
- }
1209
-
1210
- return style;
1211
- }
1212
-
1213
- }
1214
-
1215
- var _default = CustomStyleEditor;
1216
- exports.default = _default;