@modusoperandi/licit 0.14.18 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BlockquoteInsertNewLineCommand.js +87 -0
- package/BlockquoteInsertNewLineCommand.js.flow +77 -0
- package/BlockquoteNodeSpec.js +30 -0
- package/BlockquoteNodeSpec.js.flow +30 -0
- package/BlockquoteToggleCommand.js +63 -0
- package/BlockquoteToggleCommand.js.flow +56 -0
- package/BookmarkNodeSpec.js +40 -0
- package/BookmarkNodeSpec.js.flow +39 -0
- package/BulletListNodeSpec.js +51 -0
- package/BulletListNodeSpec.js.flow +61 -0
- package/CZIProseMirror.js +78 -0
- package/CZIProseMirror.js.flow +90 -0
- package/CodeBlockCommand.js +73 -0
- package/CodeBlockCommand.js.flow +65 -0
- package/CodeBlockNodeSpec.js +26 -0
- package/CodeMarkSpec.js +11 -0
- package/CodeMarkSpec.js.flow +14 -0
- package/ContentPlaceholderPlugin.js +186 -0
- package/ContentPlaceholderPlugin.js.flow +187 -0
- package/CursorPlaceholderPlugin.js +119 -0
- package/DocLayoutCommand.js +97 -0
- package/DocLayoutCommand.js.flow +99 -0
- package/DocNodeSpec.js +67 -0
- package/DocNodeSpec.js.flow +64 -0
- package/EMMarkSpec.js +15 -0
- package/EMMarkSpec.js.flow +14 -0
- package/EditorCommands.js +111 -0
- package/EditorCommands.js.flow +143 -0
- package/EditorKeyMap.js +74 -0
- package/EditorKeyMap.js.flow +187 -0
- package/EditorMarks.js +51 -0
- package/EditorMarks.js.flow +71 -0
- package/EditorNodes.js +47 -0
- package/EditorNodes.js.flow +59 -0
- package/EditorPageLayoutPlugin.js +78 -0
- package/EditorPageLayoutPlugin.js.flow +67 -0
- package/EditorPlugins.js +6 -0
- package/EditorPlugins.js.flow +8 -0
- package/EditorSchema.js +8 -0
- package/EditorSchema.js.flow +12 -0
- package/EditorState.js +3 -0
- package/FontSizeMarkSpec.js +38 -0
- package/FontSizeMarkSpec.js.flow +49 -0
- package/FontTypeMarkSpec.js +63 -0
- package/FontTypeMarkSpec.js.flow +80 -0
- package/HTMLMutator.js +67 -0
- package/HTMLMutator.js.flow +59 -0
- package/HardBreakNodeSpec.js +13 -0
- package/HeadingNodeSpec.js +57 -0
- package/HistoryRedoCommand.js +49 -0
- package/HistoryRedoCommand.js.flow +41 -0
- package/HistoryUndoCommand.js +49 -0
- package/HistoryUndoCommand.js.flow +41 -0
- package/HorizontalRuleCommand.js +78 -0
- package/HorizontalRuleCommand.js.flow +71 -0
- package/HorizontalRuleNodeSpec.js +31 -0
- package/ImageUploadPlaceholderPlugin.js +181 -0
- package/ImageUploadPlaceholderPlugin.js.flow +192 -0
- package/LinkMarkSpec.js +34 -0
- package/LinkMarkSpec.js.flow +32 -0
- package/LinkSetURLCommand.js +111 -0
- package/LinkSetURLCommand.js.flow +117 -0
- package/LinkTooltipPlugin.js +185 -0
- package/LinkTooltipPlugin.js.flow +190 -0
- package/ListItemInsertNewLineCommand.js +87 -0
- package/ListItemInsertNewLineCommand.js.flow +77 -0
- package/ListItemMergeCommand.js +191 -0
- package/ListItemMergeCommand.js.flow +199 -0
- package/ListItemNodeSpec.js +45 -0
- package/ListItemNodeSpec.js.flow +52 -0
- package/ListSplitCommand.js +55 -0
- package/ListSplitCommand.js.flow +54 -0
- package/ListToggleCommand.js +96 -0
- package/ListToggleCommand.js.flow +99 -0
- package/MarkNames.js +16 -0
- package/MarksClearCommand.js +65 -0
- package/MarksClearCommand.js.flow +65 -0
- package/MathEditCommand.js +116 -0
- package/MathEditCommand.js.flow +120 -0
- package/MathNodeSpec.js +49 -0
- package/MathNodeSpec.js.flow +46 -0
- package/NodeNames.js +21 -0
- package/OrderedListNodeSpec.js +117 -0
- package/OrderedListNodeSpec.js.flow +132 -0
- package/ParagraphNodeSpec.js +126 -0
- package/ParagraphNodeSpec.js.flow +156 -0
- package/ParagraphSpacingCommand.js +119 -0
- package/ParagraphSpacingCommand.js.flow +144 -0
- package/PrintCommand.js +58 -0
- package/PrintCommand.js.flow +53 -0
- package/SelectionPlaceholderPlugin.js +120 -0
- package/SpacerMarkSpec.js +39 -0
- package/SpacerMarkSpec.js.flow +47 -0
- package/StrikeMarkSpec.js +17 -0
- package/StrikeMarkSpec.js.flow +21 -0
- package/StrongMarkSpec.js +26 -0
- package/StrongMarkSpec.js.flow +25 -0
- package/StyleView.js +29 -0
- package/TableBackgroundColorCommand.js +81 -0
- package/TableBorderColorCommand.js +81 -0
- package/TableCellColorCommand.js +81 -0
- package/TableCellColorCommand.js.flow +75 -0
- package/TableCellMenuPlugin.js +137 -0
- package/TableCellMenuPlugin.js.flow +132 -0
- package/TableInsertCommand.js +124 -0
- package/TableInsertCommand.js.flow +120 -0
- package/TableMergeCellsCommand.js +116 -0
- package/TableMergeCellsCommand.js.flow +112 -0
- package/TableNodesSpecs.js +78 -0
- package/TableNodesSpecs.js.flow +78 -0
- package/TablePlugins.js +7 -0
- package/TablePlugins.js.flow +14 -0
- package/TableResizePlugin.js +542 -0
- package/TableResizePlugin.js.flow +632 -0
- package/TextColorMarkSpec.js +29 -0
- package/TextColorMarkSpec.js.flow +35 -0
- package/TextHighlightMarkSpec.js +31 -0
- package/TextHighlightMarkSpec.js.flow +38 -0
- package/TextInsertTabSpaceCommand.js +98 -0
- package/TextInsertTabSpaceCommand.js.flow +106 -0
- package/TextNoWrapMarkSpec.js +11 -0
- package/TextNoWrapMarkSpec.js.flow +14 -0
- package/TextNodeSpec.js +4 -0
- package/TextSelectionMarkSpec.js +18 -0
- package/TextSelectionMarkSpec.js.flow +24 -0
- package/TextSubMarkSpec.js +15 -0
- package/TextSubMarkSpec.js.flow +20 -0
- package/TextSuperMarkSpec.js +15 -0
- package/TextSuperMarkSpec.js.flow +20 -0
- package/TextUnderlineMarkSpec.js +21 -0
- package/TextUnderlineMarkSpec.js.flow +27 -0
- package/Types.js +72 -0
- package/WebFontLoader.js +32 -0
- package/blockQuoteInputRule.js +25 -0
- package/blockQuoteInputRule.js.flow +36 -0
- package/bom.xml +66662 -0
- package/browser.js +6 -0
- package/buildEditorPlugins.js +49 -0
- package/buildEditorPlugins.js.flow +49 -0
- package/buildInputRules.js +73 -0
- package/buildInputRules.js.flow +81 -0
- package/client/CollabConnector.js +85 -0
- package/client/CollabConnector.js.flow +90 -0
- package/client/EditorConnection.js +321 -0
- package/client/EditorConnection.js.flow +323 -0
- package/client/Licit.js +613 -0
- package/client/Licit.js.flow +643 -0
- package/client/Licit.test.js +104 -0
- package/client/Licit.test.js.flow +98 -0
- package/client/Reporter.js +50 -0
- package/client/SimpleConnector.js +55 -0
- package/client/http.js +90 -0
- package/client/throttle.js +20 -0
- package/convertFromDOMElement.js +26 -0
- package/convertFromDOMElement.js.flow +36 -0
- package/convertFromHTML.js +9 -0
- package/convertFromHTML.js.flow +17 -0
- package/convertFromJSON.js +40 -0
- package/convertFromJSON.js.flow +56 -0
- package/convertToCSSPTValue.js +18 -0
- package/convertToJSON.js +4 -0
- package/createCommand.js +59 -0
- package/createCommand.js.flow +62 -0
- package/createEditorKeyMap.js +54 -0
- package/createEditorKeyMap.js.flow +94 -0
- package/createEmptyEditorState.js +16 -0
- package/createEmptyEditorState.js.flow +31 -0
- package/createTableResizingPlugin.js +68 -0
- package/findActionableCell.js +53 -0
- package/findActionableCell.js.flow +74 -0
- package/findActiveMark.js +25 -0
- package/hyphenize.js +14 -0
- package/index.d.ts +6 -0
- package/index.js +8 -0
- package/insertTable.js +43 -0
- package/insertTable.js.flow +56 -0
- package/isEditorStateEmpty.js +28 -0
- package/isTableNode.js +6 -0
- package/joinDown.js +25 -0
- package/joinListNode.js +31 -0
- package/joinUp.js +30 -0
- package/keymaps.js +67 -0
- package/lookUpElement.js +9 -0
- package/nodeAt.js +9 -0
- package/normalizeHTML.js +63 -0
- package/normalizeHTML.js.flow +78 -0
- package/package.json +42 -33
- package/patchAnchorElements.js +29 -0
- package/patchAnchorElements.js.flow +38 -0
- package/patchBreakElements.js +20 -0
- package/patchElementInlineStyles.js +65 -0
- package/patchElementInlineStyles.js.flow +92 -0
- package/patchListElements.js +228 -0
- package/patchListElements.js.flow +276 -0
- package/patchMathElements.js +59 -0
- package/patchParagraphElements.js +13 -0
- package/patchParagraphElements.js.flow +20 -0
- package/patchStyleElements.js +152 -0
- package/patchStyleElements.js.flow +196 -0
- package/patchTableElements.js +86 -0
- package/patchTableElements.js.flow +89 -0
- package/rebaseDocWithSteps.js +25 -0
- package/sanitizeURL.js +10 -0
- package/splitListItem.js +170 -0
- package/splitListItem.js.flow +191 -0
- package/styles.css +19 -0
- package/styles0.css +29 -0
- package/toClosestFontPtSize.js +17 -0
- package/toClosestFontPtSize.js.flow +22 -0
- package/toSafeHTMLDocument.js +7 -0
- package/toggleBlockquote.js +75 -0
- package/toggleBlockquote.js.flow +108 -0
- package/toggleCodeBlock.js +75 -0
- package/ui/AlertInfo.js +69 -0
- package/ui/BookmarkNodeView.js +104 -0
- package/ui/BookmarkNodeView.js.flow +66 -0
- package/ui/CommandButton.js +76 -0
- package/ui/CommandMenu.js +94 -0
- package/ui/CommandMenu.js.flow +75 -0
- package/ui/CommandMenuButton.js +132 -0
- package/ui/CommandMenuButton.js.flow +131 -0
- package/ui/CustomEditorView.js +47 -0
- package/ui/CustomEditorView.js.flow +28 -0
- package/ui/CustomMenu.js +34 -0
- package/ui/CustomMenuItem.js +65 -0
- package/ui/CustomNodeView.js +237 -0
- package/ui/CustomNodeView.js.flow +200 -0
- package/ui/CustomRadioButton.js +78 -0
- package/ui/CustomRadioButton.js.flow +65 -0
- package/ui/DocLayoutEditor.js +147 -0
- package/ui/DocLayoutEditor.js.flow +146 -0
- package/ui/Editor.js +291 -0
- package/ui/Editor.js.flow +288 -0
- package/ui/EditorFrameset.js +96 -0
- package/ui/EditorToolbar.js +214 -0
- package/ui/EditorToolbar.js.flow +218 -0
- package/ui/EditorToolbarConfig.js +141 -0
- package/ui/EditorToolbarConfig.js.flow +164 -0
- package/ui/FontSizeCommandMenuButton.js +67 -0
- package/ui/FontSizeCommandMenuButton.js.flow +66 -0
- package/ui/FontTypeCommandMenuButton.js +65 -0
- package/ui/FontTypeCommandMenuButton.js.flow +61 -0
- package/ui/Frag.js +32 -0
- package/ui/Icon.js +145 -0
- package/ui/Icon.js.flow +89 -0
- package/ui/ImageInlineEditor.js +87 -0
- package/ui/KeyCodes.js +9 -0
- package/ui/LinkTooltip.js +113 -0
- package/ui/LinkTooltip.js.flow +85 -0
- package/ui/LinkURLEditor.js +114 -0
- package/ui/LinkURLEditor.js.flow +117 -0
- package/ui/ListItemNodeView.js +92 -0
- package/ui/ListItemNodeView.js.flow +98 -0
- package/ui/ListTypeButton.js +136 -0
- package/ui/ListTypeButton.js.flow +131 -0
- package/ui/ListTypeCommandButton.js +91 -0
- package/ui/ListTypeCommandButton.js.flow +85 -0
- package/ui/ListTypeMenu.js +85 -0
- package/ui/ListTypeMenu.js.flow +70 -0
- package/ui/LoadingIndicator.js +42 -0
- package/ui/MathEditor.js +92 -0
- package/ui/MathEditor.js.flow +78 -0
- package/ui/MathInlineEditor.js +123 -0
- package/ui/MathInlineEditor.js.flow +102 -0
- package/ui/MathNodeView.js +217 -0
- package/ui/MathNodeView.js.flow +186 -0
- package/ui/PasteMenu.js +74 -0
- package/ui/ResizeObserver.js +89 -0
- package/ui/RichTextEditor.js +125 -0
- package/ui/RichTextEditor.js.flow +133 -0
- package/ui/SelectionObserver.js +121 -0
- package/ui/TableCellMenu.js +64 -0
- package/ui/TableCellMenu.js.flow +51 -0
- package/ui/TableGridSizeEditor.js +212 -0
- package/ui/TableGridSizeEditor.js.flow +184 -0
- package/ui/TableNodeView.js +51 -0
- package/ui/bindScrollHandler.js +33 -0
- package/ui/canUseCSSFont.js +33 -0
- package/ui/czi-link-tooltip.css +71 -0
- package/ui/czi-table.css +87 -0
- package/ui/czi-vars.css +2 -0
- package/ui/findActiveFontSize.js +53 -0
- package/ui/findActiveFontSize.js.flow +58 -0
- package/ui/findActiveFontType.js +32 -0
- package/ui/findActiveFontType.js.flow +38 -0
- package/ui/handleEditorDrop.js +24 -0
- package/ui/handleEditorDrop.js.flow +28 -0
- package/ui/handleEditorKeyDown.js +20 -0
- package/ui/handleEditorKeyDown.js.flow +39 -0
- package/ui/handleEditorPaste.js +22 -0
- package/ui/handleEditorPaste.js.flow +33 -0
- package/ui/htmlElementToRect.js +17 -0
- package/ui/injectStyleSheet.js +37 -0
- package/ui/isElementFullyVisible.js +22 -0
- package/ui/isOffline.js +6 -0
- package/ui/isReactClass.js +10 -0
- package/ui/mathquill-editor/MathQuillEditor.js +187 -0
- package/ui/mathquill-editor/MathQuillEditor.js.flow +159 -0
- package/ui/mathquill-editor/MathQuillEditorSymbols.js +416 -0
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +69 -0
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js.flow +50 -0
- package/ui/mathquill-editor/mathquill-import-kludge.js +21 -0
- package/ui/mathquill-editor/mathquill-import-kludge.js.flow +24 -0
- package/ui/renderLaTeXAsHTML.js +55 -0
- package/ui/renderLaTeXAsHTML.js.flow +46 -0
- package/ui/resolveImage.js +115 -0
- package/ui/toCSSColor.js +42 -0
- package/ui/toCSSLineSpacing.js +48 -0
- package/ui/toHexColor.js +22 -0
- package/ui/uuid.js +6 -0
- package/uuid.js +6 -0
- package/.babelrc +0 -50
- package/.dockerignore +0 -4
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -87
- package/.flowconfig +0 -37
- package/.gitattribute +0 -1
- package/.github/dependabot.yml +0 -17
- package/.github/workflows/build.yml +0 -29
- package/.github/workflows/lint.yml +0 -30
- package/.prettierignore +0 -6
- package/.prettierrc +0 -5
- package/.stylelintignore +0 -2
- package/.stylelintrc.json +0 -14
- package/.travis.yml +0 -18
- package/CODEOWNERS +0 -40
- package/LICENSE +0 -22
- package/README.md +0 -304
- package/_config.yml +0 -1
- package/babel.config.json +0 -50
- package/build_collab_server.py +0 -7
- package/build_image_server.py +0 -7
- package/dist/BlockquoteInsertNewLineCommand.js +0 -65
- package/dist/BlockquoteInsertNewLineCommand.js.flow +0 -55
- package/dist/BlockquoteNodeSpec.js +0 -37
- package/dist/BlockquoteNodeSpec.js.flow +0 -30
- package/dist/BlockquoteToggleCommand.js +0 -41
- package/dist/BlockquoteToggleCommand.js.flow +0 -34
- package/dist/BookmarkNodeSpec.js +0 -50
- package/dist/BookmarkNodeSpec.js.flow +0 -39
- package/dist/BulletListNodeSpec.js +0 -59
- package/dist/BulletListNodeSpec.js.flow +0 -61
- package/dist/CZIProseMirror.js +0 -91
- package/dist/CZIProseMirror.js.flow +0 -90
- package/dist/CodeBlockCommand.js +0 -51
- package/dist/CodeBlockCommand.js.flow +0 -43
- package/dist/CodeBlockNodeSpec.js +0 -33
- package/dist/CodeMarkSpec.js +0 -18
- package/dist/CodeMarkSpec.js.flow +0 -14
- package/dist/ContentPlaceholderPlugin.js +0 -164
- package/dist/ContentPlaceholderPlugin.js.flow +0 -187
- package/dist/CursorPlaceholderPlugin.js +0 -114
- package/dist/DocLayoutCommand.js +0 -88
- package/dist/DocLayoutCommand.js.flow +0 -94
- package/dist/DocNodeSpec.js +0 -79
- package/dist/DocNodeSpec.js.flow +0 -64
- package/dist/EMMarkSpec.js +0 -22
- package/dist/EMMarkSpec.js.flow +0 -14
- package/dist/EditorCommands.js +0 -175
- package/dist/EditorCommands.js.flow +0 -124
- package/dist/EditorKeyMap.js +0 -112
- package/dist/EditorKeyMap.js.flow +0 -187
- package/dist/EditorMarks.js +0 -80
- package/dist/EditorMarks.js.flow +0 -71
- package/dist/EditorNodes.js +0 -68
- package/dist/EditorNodes.js.flow +0 -59
- package/dist/EditorPageLayoutPlugin.js +0 -72
- package/dist/EditorPageLayoutPlugin.js.flow +0 -67
- package/dist/EditorPlugins.js +0 -13
- package/dist/EditorPlugins.js.flow +0 -8
- package/dist/EditorSchema.js +0 -16
- package/dist/EditorSchema.js.flow +0 -12
- package/dist/EditorState.js +0 -10
- package/dist/FontSizeMarkSpec.js +0 -47
- package/dist/FontSizeMarkSpec.js.flow +0 -49
- package/dist/FontTypeMarkSpec.js +0 -74
- package/dist/FontTypeMarkSpec.js.flow +0 -80
- package/dist/HTMLMutator.js +0 -58
- package/dist/HTMLMutator.js.flow +0 -59
- package/dist/HardBreakNodeSpec.js +0 -20
- package/dist/HeadingNodeSpec.js +0 -64
- package/dist/HistoryRedoCommand.js +0 -24
- package/dist/HistoryRedoCommand.js.flow +0 -20
- package/dist/HistoryUndoCommand.js +0 -24
- package/dist/HistoryUndoCommand.js.flow +0 -20
- package/dist/HorizontalRuleCommand.js +0 -58
- package/dist/HorizontalRuleCommand.js.flow +0 -49
- package/dist/HorizontalRuleNodeSpec.js +0 -38
- package/dist/ImageUploadPlaceholderPlugin.js +0 -176
- package/dist/ImageUploadPlaceholderPlugin.js.flow +0 -192
- package/dist/LinkMarkSpec.js +0 -41
- package/dist/LinkMarkSpec.js.flow +0 -32
- package/dist/LinkSetURLCommand.js +0 -100
- package/dist/LinkSetURLCommand.js.flow +0 -103
- package/dist/LinkTooltipPlugin.js +0 -180
- package/dist/LinkTooltipPlugin.js.flow +0 -192
- package/dist/ListItemInsertNewLineCommand.js +0 -65
- package/dist/ListItemInsertNewLineCommand.js.flow +0 -55
- package/dist/ListItemMergeCommand.js +0 -183
- package/dist/ListItemMergeCommand.js.flow +0 -177
- package/dist/ListItemNodeSpec.js +0 -57
- package/dist/ListItemNodeSpec.js.flow +0 -52
- package/dist/ListSplitCommand.js +0 -36
- package/dist/ListSplitCommand.js.flow +0 -32
- package/dist/ListToggleCommand.js +0 -81
- package/dist/ListToggleCommand.js.flow +0 -77
- package/dist/MarkNames.js +0 -37
- package/dist/MarksClearCommand.js +0 -42
- package/dist/MarksClearCommand.js.flow +0 -42
- package/dist/MathEditCommand.js +0 -108
- package/dist/MathEditCommand.js.flow +0 -110
- package/dist/MathNodeSpec.js +0 -57
- package/dist/MathNodeSpec.js.flow +0 -46
- package/dist/NodeNames.js +0 -47
- package/dist/OrderedListNodeSpec.js +0 -125
- package/dist/OrderedListNodeSpec.js.flow +0 -132
- package/dist/ParagraphNodeSpec.js +0 -151
- package/dist/ParagraphNodeSpec.js.flow +0 -156
- package/dist/ParagraphSpacingCommand.js +0 -106
- package/dist/ParagraphSpacingCommand.js.flow +0 -121
- package/dist/PrintCommand.js +0 -33
- package/dist/PrintCommand.js.flow +0 -31
- package/dist/SelectionPlaceholderPlugin.js +0 -111
- package/dist/SpacerMarkSpec.js +0 -50
- package/dist/SpacerMarkSpec.js.flow +0 -47
- package/dist/StrikeMarkSpec.js +0 -24
- package/dist/StrikeMarkSpec.js.flow +0 -21
- package/dist/StrongMarkSpec.js +0 -29
- package/dist/StrongMarkSpec.js.flow +0 -25
- package/dist/StyleView.js +0 -23
- package/dist/TableBackgroundColorCommand.js +0 -65
- package/dist/TableBorderColorCommand.js +0 -65
- package/dist/TableCellColorCommand.js +0 -62
- package/dist/TableCellColorCommand.js.flow +0 -71
- package/dist/TableCellMenuPlugin.js +0 -129
- package/dist/TableCellMenuPlugin.js.flow +0 -132
- package/dist/TableInsertCommand.js +0 -117
- package/dist/TableInsertCommand.js.flow +0 -112
- package/dist/TableMergeCellsCommand.js +0 -97
- package/dist/TableMergeCellsCommand.js.flow +0 -90
- package/dist/TableNodesSpecs.js +0 -91
- package/dist/TableNodesSpecs.js.flow +0 -78
- package/dist/TablePlugins.js +0 -14
- package/dist/TablePlugins.js.flow +0 -14
- package/dist/TableResizePlugin.js +0 -543
- package/dist/TableResizePlugin.js.flow +0 -632
- package/dist/TextColorMarkSpec.js +0 -39
- package/dist/TextColorMarkSpec.js.flow +0 -35
- package/dist/TextHighlightMarkSpec.js +0 -42
- package/dist/TextHighlightMarkSpec.js.flow +0 -38
- package/dist/TextInsertTabSpaceCommand.js +0 -78
- package/dist/TextInsertTabSpaceCommand.js.flow +0 -83
- package/dist/TextNoWrapMarkSpec.js +0 -18
- package/dist/TextNoWrapMarkSpec.js.flow +0 -14
- package/dist/TextNodeSpec.js +0 -11
- package/dist/TextSelectionMarkSpec.js +0 -25
- package/dist/TextSelectionMarkSpec.js.flow +0 -24
- package/dist/TextSubMarkSpec.js +0 -22
- package/dist/TextSubMarkSpec.js.flow +0 -20
- package/dist/TextSuperMarkSpec.js +0 -22
- package/dist/TextSuperMarkSpec.js.flow +0 -20
- package/dist/TextUnderlineMarkSpec.js +0 -28
- package/dist/TextUnderlineMarkSpec.js.flow +0 -27
- package/dist/Types.js +0 -81
- package/dist/WebFontLoader.js +0 -28
- package/dist/blockQuoteInputRule.js +0 -35
- package/dist/blockQuoteInputRule.js.flow +0 -36
- package/dist/bom.xml +0 -68332
- package/dist/browser.js +0 -11
- package/dist/buildEditorPlugins.js +0 -44
- package/dist/buildEditorPlugins.js.flow +0 -49
- package/dist/buildInputRules.js +0 -72
- package/dist/buildInputRules.js.flow +0 -81
- package/dist/client/CollabConnector.js +0 -80
- package/dist/client/CollabConnector.js.flow +0 -90
- package/dist/client/EditorConnection.js +0 -290
- package/dist/client/EditorConnection.js.flow +0 -323
- package/dist/client/Licit.js +0 -621
- package/dist/client/Licit.js.flow +0 -708
- package/dist/client/Licit.test.js +0 -98
- package/dist/client/Licit.test.js.flow +0 -98
- package/dist/client/Reporter.js +0 -36
- package/dist/client/SimpleConnector.js +0 -59
- package/dist/client/http.js +0 -101
- package/dist/client/throttle.js +0 -26
- package/dist/convertFromDOMElement.js +0 -31
- package/dist/convertFromDOMElement.js.flow +0 -36
- package/dist/convertFromHTML.js +0 -15
- package/dist/convertFromHTML.js.flow +0 -17
- package/dist/convertFromJSON.js +0 -45
- package/dist/convertFromJSON.js.flow +0 -56
- package/dist/convertToCSSPTValue.js +0 -27
- package/dist/convertToJSON.js +0 -10
- package/dist/createCommand.js +0 -33
- package/dist/createCommand.js.flow +0 -40
- package/dist/createEditorKeyMap.js +0 -80
- package/dist/createEditorKeyMap.js.flow +0 -94
- package/dist/createEmptyEditorState.js +0 -24
- package/dist/createEmptyEditorState.js.flow +0 -31
- package/dist/createTableResizingPlugin.js +0 -79
- package/dist/findActionableCell.js +0 -65
- package/dist/findActionableCell.js.flow +0 -74
- package/dist/findActiveMark.js +0 -29
- package/dist/fonts/aclonica/Aclonica.woff2 +0 -0
- package/dist/fonts/acme/Acme.woff2 +0 -0
- package/dist/fonts/alegreya/Alegreya-Regular-C.woff2 +0 -0
- package/dist/fonts/alegreya/Alegreya-Regular-CE.woff2 +0 -0
- package/dist/fonts/alegreya/Alegreya-Regular-G.woff2 +0 -0
- package/dist/fonts/alegreya/Alegreya-Regular-GE.woff2 +0 -0
- package/dist/fonts/alegreya/Alegreya-Regular-L.woff2 +0 -0
- package/dist/fonts/alegreya/Alegreya-Regular-LE.woff2 +0 -0
- package/dist/fonts/alegreya/Alegreya-Regular-V.woff2 +0 -0
- package/dist/fonts/arial-black/ArialBlack-G.woff2 +0 -0
- package/dist/fonts/arial-black/ArialBlack-L.woff2 +0 -0
- package/dist/fonts/arial-black/ArialBlack-LE.woff2 +0 -0
- package/dist/fonts/courier-new/CourierNew-L.woff2 +0 -0
- package/dist/fonts/georgia/Georgia-C.woff2 +0 -0
- package/dist/fonts/georgia/Georgia-CE.woff2 +0 -0
- package/dist/fonts/georgia/Georgia-G.woff2 +0 -0
- package/dist/fonts/georgia/Georgia-GE.woff2 +0 -0
- package/dist/fonts/georgia/Georgia-L.woff2 +0 -0
- package/dist/fonts/georgia/Georgia-LE.woff2 +0 -0
- package/dist/fonts/material-icons/MaterialIcons-Regular.ttf +0 -0
- package/dist/fonts/tahoma/Tahoma-C.woff2 +0 -0
- package/dist/fonts/tahoma/Tahoma-CE.woff2 +0 -0
- package/dist/fonts/tahoma/Tahoma-G.woff2 +0 -0
- package/dist/fonts/tahoma/Tahoma-GE.woff2 +0 -0
- package/dist/fonts/tahoma/Tahoma-L.woff2 +0 -0
- package/dist/fonts/tahoma/Tahoma-LE.woff2 +0 -0
- package/dist/fonts/times/Times-L.woff2 +0 -0
- package/dist/fonts/times/Times-LE.woff2 +0 -0
- package/dist/fonts/times-new-roman/TimesNewRoman-C.woff2 +0 -0
- package/dist/fonts/times-new-roman/TimesNewRoman-CE.woff2 +0 -0
- package/dist/fonts/times-new-roman/TimesNewRoman-G.woff2 +0 -0
- package/dist/fonts/times-new-roman/TimesNewRoman-GE.woff2 +0 -0
- package/dist/fonts/times-new-roman/TimesNewRoman-L.woff2 +0 -0
- package/dist/fonts/times-new-roman/TimesNewRoman-LE.woff2 +0 -0
- package/dist/fonts/times-new-roman/TimesNewRoman-V.woff2 +0 -0
- package/dist/fonts/verdana/Verdana-C.woff2 +0 -0
- package/dist/fonts/verdana/Verdana-CE.woff2 +0 -0
- package/dist/fonts/verdana/Verdana-G.woff2 +0 -0
- package/dist/fonts/verdana/Verdana-GE.woff2 +0 -0
- package/dist/fonts/verdana/Verdana-L.woff2 +0 -0
- package/dist/fonts/verdana/Verdana-LE.woff2 +0 -0
- package/dist/fonts/verdana/Verdana-V.woff2 +0 -0
- package/dist/hyphenize.js +0 -20
- package/dist/index.js +0 -80
- package/dist/insertTable.js +0 -50
- package/dist/insertTable.js.flow +0 -56
- package/dist/isEditorStateEmpty.js +0 -38
- package/dist/isTableNode.js +0 -12
- package/dist/joinDown.js +0 -28
- package/dist/joinListNode.js +0 -38
- package/dist/joinUp.js +0 -33
- package/dist/keymaps.js +0 -106
- package/dist/lookUpElement.js +0 -15
- package/dist/nodeAt.js +0 -15
- package/dist/normalizeHTML.js +0 -70
- package/dist/normalizeHTML.js.flow +0 -78
- package/dist/patchAnchorElements.js +0 -37
- package/dist/patchAnchorElements.js.flow +0 -38
- package/dist/patchBreakElements.js +0 -28
- package/dist/patchElementInlineStyles.js +0 -70
- package/dist/patchElementInlineStyles.js.flow +0 -92
- package/dist/patchListElements.js +0 -248
- package/dist/patchListElements.js.flow +0 -276
- package/dist/patchMathElements.js +0 -69
- package/dist/patchParagraphElements.js +0 -21
- package/dist/patchParagraphElements.js.flow +0 -20
- package/dist/patchStyleElements.js +0 -162
- package/dist/patchStyleElements.js.flow +0 -194
- package/dist/patchTableElements.js +0 -98
- package/dist/patchTableElements.js.flow +0 -89
- package/dist/rebaseDocWithSteps.js +0 -32
- package/dist/sanitizeURL.js +0 -16
- package/dist/splitListItem.js +0 -180
- package/dist/splitListItem.js.flow +0 -191
- package/dist/styles.css +0 -19
- package/dist/styles0.css +0 -29
- package/dist/toClosestFontPtSize.js +0 -25
- package/dist/toClosestFontPtSize.js.flow +0 -22
- package/dist/toSafeHTMLDocument.js +0 -13
- package/dist/toggleBlockquote.js +0 -86
- package/dist/toggleBlockquote.js.flow +0 -91
- package/dist/toggleCodeBlock.js +0 -89
- package/dist/ui/AlertInfo.js +0 -59
- package/dist/ui/BookmarkNodeView.js +0 -77
- package/dist/ui/BookmarkNodeView.js.flow +0 -66
- package/dist/ui/CommandButton.js +0 -65
- package/dist/ui/CommandMenu.js +0 -83
- package/dist/ui/CommandMenu.js.flow +0 -75
- package/dist/ui/CommandMenuButton.js +0 -120
- package/dist/ui/CommandMenuButton.js.flow +0 -131
- package/dist/ui/CustomEditorView.js +0 -34
- package/dist/ui/CustomEditorView.js.flow +0 -28
- package/dist/ui/CustomMenu.js +0 -23
- package/dist/ui/CustomMenuItem.js +0 -43
- package/dist/ui/CustomNodeView.js +0 -193
- package/dist/ui/CustomNodeView.js.flow +0 -200
- package/dist/ui/CustomRadioButton.js +0 -67
- package/dist/ui/CustomRadioButton.js.flow +0 -65
- package/dist/ui/DocLayoutEditor.js +0 -142
- package/dist/ui/DocLayoutEditor.js.flow +0 -146
- package/dist/ui/Editor.js +0 -289
- package/dist/ui/Editor.js.flow +0 -288
- package/dist/ui/EditorFrameset.js +0 -86
- package/dist/ui/EditorToolbar.js +0 -206
- package/dist/ui/EditorToolbar.js.flow +0 -211
- package/dist/ui/EditorToolbarConfig.js +0 -148
- package/dist/ui/EditorToolbarConfig.js.flow +0 -164
- package/dist/ui/FontSizeCommandMenuButton.js +0 -57
- package/dist/ui/FontSizeCommandMenuButton.js.flow +0 -66
- package/dist/ui/FontTypeCommandMenuButton.js +0 -55
- package/dist/ui/FontTypeCommandMenuButton.js.flow +0 -49
- package/dist/ui/Frag.js +0 -19
- package/dist/ui/Icon.js +0 -104
- package/dist/ui/Icon.js.flow +0 -89
- package/dist/ui/ImageInlineEditor.js +0 -76
- package/dist/ui/KeyCodes.js +0 -23
- package/dist/ui/LinkTooltip.js +0 -92
- package/dist/ui/LinkTooltip.js.flow +0 -85
- package/dist/ui/LinkURLEditor.js +0 -107
- package/dist/ui/LinkURLEditor.js.flow +0 -111
- package/dist/ui/ListItemNodeView.js +0 -91
- package/dist/ui/ListItemNodeView.js.flow +0 -98
- package/dist/ui/ListTypeButton.js +0 -123
- package/dist/ui/ListTypeButton.js.flow +0 -131
- package/dist/ui/ListTypeCommandButton.js +0 -81
- package/dist/ui/ListTypeCommandButton.js.flow +0 -85
- package/dist/ui/ListTypeMenu.js +0 -72
- package/dist/ui/ListTypeMenu.js.flow +0 -70
- package/dist/ui/LoadingIndicator.js +0 -28
- package/dist/ui/MathEditor.js +0 -80
- package/dist/ui/MathEditor.js.flow +0 -78
- package/dist/ui/MathInlineEditor.js +0 -111
- package/dist/ui/MathInlineEditor.js.flow +0 -102
- package/dist/ui/MathNodeView.js +0 -190
- package/dist/ui/MathNodeView.js.flow +0 -175
- package/dist/ui/PasteMenu.js +0 -56
- package/dist/ui/ResizeObserver.js +0 -94
- package/dist/ui/RichTextEditor.js +0 -121
- package/dist/ui/RichTextEditor.js.flow +0 -133
- package/dist/ui/SelectionObserver.js +0 -116
- package/dist/ui/TableCellMenu.js +0 -53
- package/dist/ui/TableCellMenu.js.flow +0 -51
- package/dist/ui/TableGridSizeEditor.js +0 -191
- package/dist/ui/TableGridSizeEditor.js.flow +0 -184
- package/dist/ui/TableNodeView.js +0 -31
- package/dist/ui/bindScrollHandler.js +0 -39
- package/dist/ui/canUseCSSFont.js +0 -37
- package/dist/ui/czi-link-tooltip.css +0 -71
- package/dist/ui/czi-table.css +0 -86
- package/dist/ui/czi-vars.css +0 -2
- package/dist/ui/findActiveFontSize.js +0 -61
- package/dist/ui/findActiveFontSize.js.flow +0 -58
- package/dist/ui/findActiveFontType.js +0 -42
- package/dist/ui/findActiveFontType.js.flow +0 -38
- package/dist/ui/handleEditorDrop.js +0 -33
- package/dist/ui/handleEditorDrop.js.flow +0 -28
- package/dist/ui/handleEditorKeyDown.js +0 -29
- package/dist/ui/handleEditorKeyDown.js.flow +0 -39
- package/dist/ui/handleEditorPaste.js +0 -30
- package/dist/ui/handleEditorPaste.js.flow +0 -33
- package/dist/ui/htmlElementToRect.js +0 -25
- package/dist/ui/injectStyleSheet.js +0 -46
- package/dist/ui/isElementFullyVisible.js +0 -29
- package/dist/ui/isOffline.js +0 -12
- package/dist/ui/isReactClass.js +0 -16
- package/dist/ui/mathquill-editor/MathQuillEditor.js +0 -148
- package/dist/ui/mathquill-editor/MathQuillEditor.js.flow +0 -159
- package/dist/ui/mathquill-editor/MathQuillEditorSymbols.js +0 -488
- package/dist/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +0 -60
- package/dist/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js.flow +0 -48
- package/dist/ui/mathquill-editor/mathquill-import-kludge.js +0 -30
- package/dist/ui/mathquill-editor/mathquill-import-kludge.js.flow +0 -24
- package/dist/ui/renderLaTeXAsHTML.js +0 -45
- package/dist/ui/renderLaTeXAsHTML.js.flow +0 -46
- package/dist/ui/resolveImage.js +0 -125
- package/dist/ui/toCSSColor.js +0 -52
- package/dist/ui/toCSSLineSpacing.js +0 -59
- package/dist/ui/toHexColor.js +0 -29
- package/dist/ui/uuid.js +0 -12
- package/dist/uuid.js +0 -12
- package/flow-typed/@modusoperandilicit-customstyles.js +0 -5
- package/flow-typed/@modusoperandilicit-doc-attrs-step.js +0 -5
- package/flow-typed/@modusoperandilicit-ui-commands.js +0 -5
- package/flow-typed/create-emotion.js +0 -5
- package/flow-typed/docs-editor.js +0 -3
- package/flow-typed/draft-convert.js +0 -3
- package/flow-typed/draft-js.js +0 -3
- package/flow-typed/flatted.js +0 -5
- package/flow-typed/jquery.js +0 -5
- package/flow-typed/katex.js +0 -7
- package/flow-typed/mathquill.js +0 -5
- package/flow-typed/prosemirror-collab.js +0 -5
- package/flow-typed/prosemirror-commands.js +0 -5
- package/flow-typed/prosemirror-dev-tools.js +0 -5
- package/flow-typed/prosemirror-dropcursor.js +0 -5
- package/flow-typed/prosemirror-gapcursor.js +0 -5
- package/flow-typed/prosemirror-history.js +0 -5
- package/flow-typed/prosemirror-inputrules.js +0 -5
- package/flow-typed/prosemirror-keymap.js +0 -5
- package/flow-typed/prosemirror-model.js +0 -5
- package/flow-typed/prosemirror-state.js +0 -5
- package/flow-typed/prosemirror-tables.js +0 -5
- package/flow-typed/prosemirror-transform.js +0 -5
- package/flow-typed/prosemirror-utils.js +0 -5
- package/flow-typed/prosemirror-view.js +0 -5
- package/flow-typed/resize-observer-polyfill.js +0 -5
- package/flow-typed/uuid.js +0 -5
- package/jest.config.js +0 -207
- package/jest.setup.js +0 -5
- package/licit/client/CustomLicitRuntime.js +0 -298
- package/licit/client/CustomStyleRuntime.js +0 -136
- package/licit/client/index.js +0 -367
- package/licit/index.html +0 -11
- package/licit/server/collab/instance.js +0 -236
- package/licit/server/collab/route.js +0 -69
- package/licit/server/collab/server.js +0 -317
- package/licit/server/collab/start.js +0 -13
- package/licit/server/image/start.js +0 -58
- package/lint.sh +0 -4
- package/run_collab_server.py +0 -21
- package/run_image_server.py +0 -20
- package/run_web_server.py +0 -25
- package/scripts/build_bin.js +0 -10
- package/scripts/build_bin.py +0 -103
- package/scripts/ci_check_dist.sh +0 -14
- package/scripts/env.js +0 -6
- package/scripts/webserver.js +0 -35
- package/sonar-project.properties +0 -12
- package/src/BlockquoteInsertNewLineCommand.js +0 -55
- package/src/BlockquoteNodeSpec.js +0 -30
- package/src/BlockquoteToggleCommand.js +0 -34
- package/src/BookmarkNodeSpec.js +0 -39
- package/src/BulletListNodeSpec.js +0 -61
- package/src/CZIProseMirror.js +0 -90
- package/src/CodeBlockCommand.js +0 -43
- package/src/CodeBlockNodeSpec.js +0 -24
- package/src/CodeMarkSpec.js +0 -14
- package/src/ContentPlaceholderPlugin.js +0 -187
- package/src/CursorPlaceholderPlugin.js +0 -115
- package/src/DocLayoutCommand.js +0 -94
- package/src/DocNodeSpec.js +0 -64
- package/src/EMMarkSpec.js +0 -14
- package/src/EditorCommands.js +0 -124
- package/src/EditorKeyMap.js +0 -187
- package/src/EditorMarks.js +0 -71
- package/src/EditorNodes.js +0 -59
- package/src/EditorPageLayoutPlugin.js +0 -67
- package/src/EditorPlugins.js +0 -8
- package/src/EditorSchema.js +0 -12
- package/src/EditorState.js +0 -7
- package/src/FontSizeMarkSpec.js +0 -49
- package/src/FontTypeMarkSpec.js +0 -80
- package/src/HTMLMutator.js +0 -59
- package/src/HardBreakNodeSpec.js +0 -15
- package/src/HeadingNodeSpec.js +0 -52
- package/src/HistoryRedoCommand.js +0 -20
- package/src/HistoryUndoCommand.js +0 -20
- package/src/HorizontalRuleCommand.js +0 -49
- package/src/HorizontalRuleNodeSpec.js +0 -39
- package/src/ImageUploadPlaceholderPlugin.js +0 -192
- package/src/LinkMarkSpec.js +0 -32
- package/src/LinkSetURLCommand.js +0 -103
- package/src/LinkTooltipPlugin.js +0 -192
- package/src/ListItemInsertNewLineCommand.js +0 -55
- package/src/ListItemMergeCommand.js +0 -177
- package/src/ListItemNodeSpec.js +0 -52
- package/src/ListSplitCommand.js +0 -32
- package/src/ListToggleCommand.js +0 -77
- package/src/MarkNames.js +0 -18
- package/src/MarksClearCommand.js +0 -42
- package/src/MathEditCommand.js +0 -110
- package/src/MathNodeSpec.js +0 -46
- package/src/NodeNames.js +0 -23
- package/src/OrderedListNodeSpec.js +0 -132
- package/src/ParagraphNodeSpec.js +0 -156
- package/src/ParagraphSpacingCommand.js +0 -121
- package/src/PrintCommand.js +0 -31
- package/src/SelectionPlaceholderPlugin.js +0 -131
- package/src/SpacerMarkSpec.js +0 -47
- package/src/StrikeMarkSpec.js +0 -21
- package/src/StrongMarkSpec.js +0 -25
- package/src/StyleView.js +0 -19
- package/src/TableBackgroundColorCommand.js +0 -75
- package/src/TableBorderColorCommand.js +0 -75
- package/src/TableCellColorCommand.js +0 -71
- package/src/TableCellMenuPlugin.js +0 -132
- package/src/TableInsertCommand.js +0 -112
- package/src/TableMergeCellsCommand.js +0 -90
- package/src/TableNodesSpecs.js +0 -78
- package/src/TablePlugins.js +0 -14
- package/src/TableResizePlugin.js +0 -632
- package/src/TextColorMarkSpec.js +0 -35
- package/src/TextHighlightMarkSpec.js +0 -38
- package/src/TextInsertTabSpaceCommand.js +0 -83
- package/src/TextNoWrapMarkSpec.js +0 -14
- package/src/TextNodeSpec.js +0 -7
- package/src/TextSelectionMarkSpec.js +0 -24
- package/src/TextSubMarkSpec.js +0 -20
- package/src/TextSuperMarkSpec.js +0 -20
- package/src/TextUnderlineMarkSpec.js +0 -27
- package/src/Types.js +0 -75
- package/src/WebFontLoader.js +0 -22
- package/src/blockQuoteInputRule.js +0 -36
- package/src/browser.js +0 -7
- package/src/buildEditorPlugins.js +0 -49
- package/src/buildInputRules.js +0 -81
- package/src/client/CollabConnector.js +0 -90
- package/src/client/EditorConnection.js +0 -323
- package/src/client/Licit.js +0 -708
- package/src/client/Licit.test.js +0 -98
- package/src/client/Reporter.js +0 -37
- package/src/client/SimpleConnector.js +0 -61
- package/src/client/http.js +0 -70
- package/src/client/licit.css +0 -12
- package/src/client/throttle.js +0 -27
- package/src/convertFromDOMElement.js +0 -36
- package/src/convertFromHTML.js +0 -17
- package/src/convertFromJSON.js +0 -56
- package/src/convertToCSSPTValue.js +0 -22
- package/src/convertToJSON.js +0 -7
- package/src/createCommand.js +0 -40
- package/src/createEditorKeyMap.js +0 -94
- package/src/createEmptyEditorState.js +0 -31
- package/src/createTableResizingPlugin.js +0 -86
- package/src/findActionableCell.js +0 -74
- package/src/findActiveMark.js +0 -32
- package/src/hyphenize.js +0 -17
- package/src/index.js +0 -10
- package/src/insertTable.js +0 -56
- package/src/isEditorStateEmpty.js +0 -32
- package/src/isTableNode.js +0 -15
- package/src/joinDown.js +0 -27
- package/src/joinListNode.js +0 -55
- package/src/joinUp.js +0 -39
- package/src/keymaps.js +0 -185
- package/src/lookUpElement.js +0 -14
- package/src/nodeAt.js +0 -12
- package/src/normalizeHTML.js +0 -78
- package/src/patchAnchorElements.js +0 -38
- package/src/patchBreakElements.js +0 -22
- package/src/patchElementInlineStyles.js +0 -92
- package/src/patchListElements.js +0 -276
- package/src/patchMathElements.js +0 -60
- package/src/patchParagraphElements.js +0 -20
- package/src/patchStyleElements.js +0 -194
- package/src/patchTableElements.js +0 -89
- package/src/rebaseDocWithSteps.js +0 -42
- package/src/sanitizeURL.js +0 -13
- package/src/splitListItem.js +0 -191
- package/src/styles.css +0 -19
- package/src/styles0.css +0 -29
- package/src/toClosestFontPtSize.js +0 -22
- package/src/toSafeHTMLDocument.js +0 -9
- package/src/toggleBlockquote.js +0 -91
- package/src/toggleCodeBlock.js +0 -102
- package/src/ui/AlertInfo.js +0 -64
- package/src/ui/BookmarkNodeView.js +0 -66
- package/src/ui/CommandButton.js +0 -68
- package/src/ui/CommandMenu.js +0 -75
- package/src/ui/CommandMenuButton.js +0 -131
- package/src/ui/CustomEditorView.js +0 -28
- package/src/ui/CustomMenu.js +0 -17
- package/src/ui/CustomMenuItem.js +0 -36
- package/src/ui/CustomNodeView.js +0 -200
- package/src/ui/CustomRadioButton.js +0 -65
- package/src/ui/DocLayoutEditor.js +0 -146
- package/src/ui/Editor.js +0 -288
- package/src/ui/EditorFrameset.js +0 -81
- package/src/ui/EditorToolbar.js +0 -211
- package/src/ui/EditorToolbarConfig.js +0 -164
- package/src/ui/FontSizeCommandMenuButton.js +0 -66
- package/src/ui/FontTypeCommandMenuButton.js +0 -49
- package/src/ui/Frag.js +0 -13
- package/src/ui/Icon.js +0 -89
- package/src/ui/ImageInlineEditor.js +0 -67
- package/src/ui/KeyCodes.js +0 -12
- package/src/ui/LinkTooltip.js +0 -85
- package/src/ui/LinkURLEditor.js +0 -111
- package/src/ui/ListItemNodeView.js +0 -98
- package/src/ui/ListTypeButton.js +0 -131
- package/src/ui/ListTypeCommandButton.js +0 -85
- package/src/ui/ListTypeMenu.js +0 -70
- package/src/ui/LoadingIndicator.js +0 -20
- package/src/ui/MathEditor.js +0 -78
- package/src/ui/MathInlineEditor.js +0 -102
- package/src/ui/MathNodeView.js +0 -175
- package/src/ui/PasteMenu.js +0 -57
- package/src/ui/ResizeObserver.js +0 -106
- package/src/ui/RichTextEditor.js +0 -133
- package/src/ui/SelectionObserver.js +0 -134
- package/src/ui/TableCellMenu.js +0 -51
- package/src/ui/TableGridSizeEditor.js +0 -184
- package/src/ui/TableNodeView.js +0 -25
- package/src/ui/bindScrollHandler.js +0 -46
- package/src/ui/canUseCSSFont.js +0 -43
- package/src/ui/czi-body-layout-editor.css +0 -16
- package/src/ui/czi-bookmark-view.css +0 -10
- package/src/ui/czi-cursor-placeholder.css +0 -36
- package/src/ui/czi-custom-menu-button.css +0 -18
- package/src/ui/czi-custom-menu-item.css +0 -30
- package/src/ui/czi-custom-menu.css +0 -8
- package/src/ui/czi-custom-radio-button.css +0 -80
- package/src/ui/czi-custom-scrollbar.css +0 -21
- package/src/ui/czi-editor-frameset.css +0 -81
- package/src/ui/czi-editor-toolbar.css +0 -122
- package/src/ui/czi-editor.css +0 -220
- package/src/ui/czi-form.css +0 -107
- package/src/ui/czi-frag.css +0 -3
- package/src/ui/czi-heading.css +0 -40
- package/src/ui/czi-icon.css +0 -72
- package/src/ui/czi-image-resize-box.css +0 -165
- package/src/ui/czi-image-upload-editor.css +0 -57
- package/src/ui/czi-image-upload-placeholder.css +0 -50
- package/src/ui/czi-image-url-editor.css +0 -38
- package/src/ui/czi-image-view.css +0 -125
- package/src/ui/czi-indent.css +0 -137
- package/src/ui/czi-inline-editor.css +0 -20
- package/src/ui/czi-link-tooltip.css +0 -71
- package/src/ui/czi-list.css +0 -410
- package/src/ui/czi-loading-indicator.css +0 -111
- package/src/ui/czi-math-view.css +0 -62
- package/src/ui/czi-selection-placeholder.css +0 -24
- package/src/ui/czi-table-cell-menu.css +0 -14
- package/src/ui/czi-table-grid-size-editor.css +0 -37
- package/src/ui/czi-table.css +0 -86
- package/src/ui/czi-vars.css +0 -2
- package/src/ui/findActiveFontSize.js +0 -58
- package/src/ui/findActiveFontType.js +0 -38
- package/src/ui/fonts.css +0 -471
- package/src/ui/handleEditorDrop.js +0 -28
- package/src/ui/handleEditorKeyDown.js +0 -39
- package/src/ui/handleEditorPaste.js +0 -33
- package/src/ui/htmlElementToRect.js +0 -18
- package/src/ui/icon-font.css +0 -10
- package/src/ui/injectStyleSheet.js +0 -42
- package/src/ui/isElementFullyVisible.js +0 -26
- package/src/ui/isOffline.js +0 -8
- package/src/ui/isReactClass.js +0 -12
- package/src/ui/listType.css +0 -21
- package/src/ui/mathquill-editor/MathQuillEditor.js +0 -159
- package/src/ui/mathquill-editor/MathQuillEditorSymbols.js +0 -483
- package/src/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +0 -48
- package/src/ui/mathquill-editor/czi-mathquill-editor-symbols-panel.css +0 -39
- package/src/ui/mathquill-editor/czi-mathquill-editor.css +0 -50
- package/src/ui/mathquill-editor/mathquill-import-kludge.js +0 -24
- package/src/ui/renderLaTeXAsHTML.js +0 -46
- package/src/ui/resolveImage.js +0 -123
- package/src/ui/toCSSColor.js +0 -51
- package/src/ui/toCSSLineSpacing.js +0 -55
- package/src/ui/toHexColor.js +0 -26
- package/src/ui/uuid.js +0 -9
- package/src/uuid.js +0 -9
- package/style-service.Dockerfile +0 -26
- package/utils/build_bin.js +0 -9
- package/utils/build_image_server.js +0 -72
- package/utils/build_licit_collab_server.js +0 -76
- package/utils/build_web_server.js +0 -37
- package/utils/env.js +0 -6
- package/webpack.config.js +0 -128
- /package/{dist/CodeBlockNodeSpec.js.flow → CodeBlockNodeSpec.js.flow} +0 -0
- /package/{dist/CursorPlaceholderPlugin.js.flow → CursorPlaceholderPlugin.js.flow} +0 -0
- /package/{dist/EditorState.js.flow → EditorState.js.flow} +0 -0
- /package/{dist/HardBreakNodeSpec.js.flow → HardBreakNodeSpec.js.flow} +0 -0
- /package/{dist/HeadingNodeSpec.js.flow → HeadingNodeSpec.js.flow} +0 -0
- /package/{dist/HorizontalRuleNodeSpec.js.flow → HorizontalRuleNodeSpec.js.flow} +0 -0
- /package/{dist/MarkNames.js.flow → MarkNames.js.flow} +0 -0
- /package/{dist/NodeNames.js.flow → NodeNames.js.flow} +0 -0
- /package/{dist/SelectionPlaceholderPlugin.js.flow → SelectionPlaceholderPlugin.js.flow} +0 -0
- /package/{dist/StyleView.js.flow → StyleView.js.flow} +0 -0
- /package/{dist/TableBackgroundColorCommand.js.flow → TableBackgroundColorCommand.js.flow} +0 -0
- /package/{dist/TableBorderColorCommand.js.flow → TableBorderColorCommand.js.flow} +0 -0
- /package/{dist/TextNodeSpec.js.flow → TextNodeSpec.js.flow} +0 -0
- /package/{dist/Types.js.flow → Types.js.flow} +0 -0
- /package/{dist/WebFontLoader.js.flow → WebFontLoader.js.flow} +0 -0
- /package/{dist/browser.js.flow → browser.js.flow} +0 -0
- /package/{dist/client → client}/Reporter.js.flow +0 -0
- /package/{dist/client → client}/SimpleConnector.js.flow +0 -0
- /package/{dist/client → client}/http.js.flow +0 -0
- /package/{dist/client → client}/licit.css +0 -0
- /package/{dist/client → client}/throttle.js.flow +0 -0
- /package/{dist/convertToCSSPTValue.js.flow → convertToCSSPTValue.js.flow} +0 -0
- /package/{dist/convertToJSON.js.flow → convertToJSON.js.flow} +0 -0
- /package/{dist/createTableResizingPlugin.js.flow → createTableResizingPlugin.js.flow} +0 -0
- /package/{dist/findActiveMark.js.flow → findActiveMark.js.flow} +0 -0
- /package/{dist/hyphenize.js.flow → hyphenize.js.flow} +0 -0
- /package/{dist/index.js.flow → index.js.flow} +0 -0
- /package/{dist/isEditorStateEmpty.js.flow → isEditorStateEmpty.js.flow} +0 -0
- /package/{dist/isTableNode.js.flow → isTableNode.js.flow} +0 -0
- /package/{dist/joinDown.js.flow → joinDown.js.flow} +0 -0
- /package/{dist/joinListNode.js.flow → joinListNode.js.flow} +0 -0
- /package/{dist/joinUp.js.flow → joinUp.js.flow} +0 -0
- /package/{dist/keymaps.js.flow → keymaps.js.flow} +0 -0
- /package/{dist/lookUpElement.js.flow → lookUpElement.js.flow} +0 -0
- /package/{dist/nodeAt.js.flow → nodeAt.js.flow} +0 -0
- /package/{dist/patchBreakElements.js.flow → patchBreakElements.js.flow} +0 -0
- /package/{dist/patchMathElements.js.flow → patchMathElements.js.flow} +0 -0
- /package/{dist/rebaseDocWithSteps.js.flow → rebaseDocWithSteps.js.flow} +0 -0
- /package/{dist/sanitizeURL.js.flow → sanitizeURL.js.flow} +0 -0
- /package/{dist/toSafeHTMLDocument.js.flow → toSafeHTMLDocument.js.flow} +0 -0
- /package/{dist/toggleCodeBlock.js.flow → toggleCodeBlock.js.flow} +0 -0
- /package/{dist/ui → ui}/AlertInfo.js.flow +0 -0
- /package/{dist/ui → ui}/CommandButton.js.flow +0 -0
- /package/{dist/ui → ui}/CustomMenu.js.flow +0 -0
- /package/{dist/ui → ui}/CustomMenuItem.js.flow +0 -0
- /package/{dist/ui → ui}/EditorFrameset.js.flow +0 -0
- /package/{dist/ui → ui}/Frag.js.flow +0 -0
- /package/{dist/ui → ui}/ImageInlineEditor.js.flow +0 -0
- /package/{dist/ui → ui}/KeyCodes.js.flow +0 -0
- /package/{dist/ui → ui}/LoadingIndicator.js.flow +0 -0
- /package/{dist/ui → ui}/PasteMenu.js.flow +0 -0
- /package/{dist/ui → ui}/ResizeObserver.js.flow +0 -0
- /package/{dist/ui → ui}/SelectionObserver.js.flow +0 -0
- /package/{dist/ui → ui}/TableNodeView.js.flow +0 -0
- /package/{dist/ui → ui}/bindScrollHandler.js.flow +0 -0
- /package/{dist/ui → ui}/canUseCSSFont.js.flow +0 -0
- /package/{dist/ui → ui}/czi-body-layout-editor.css +0 -0
- /package/{dist/ui → ui}/czi-bookmark-view.css +0 -0
- /package/{dist/ui → ui}/czi-cursor-placeholder.css +0 -0
- /package/{dist/ui → ui}/czi-custom-menu-button.css +0 -0
- /package/{dist/ui → ui}/czi-custom-menu-item.css +0 -0
- /package/{dist/ui → ui}/czi-custom-menu.css +0 -0
- /package/{dist/ui → ui}/czi-custom-radio-button.css +0 -0
- /package/{dist/ui → ui}/czi-custom-scrollbar.css +0 -0
- /package/{dist/ui → ui}/czi-editor-frameset.css +0 -0
- /package/{dist/ui → ui}/czi-editor-toolbar.css +0 -0
- /package/{dist/ui → ui}/czi-editor.css +0 -0
- /package/{dist/ui → ui}/czi-form.css +0 -0
- /package/{dist/ui → ui}/czi-frag.css +0 -0
- /package/{dist/ui → ui}/czi-heading.css +0 -0
- /package/{dist/ui → ui}/czi-icon.css +0 -0
- /package/{dist/ui → ui}/czi-image-resize-box.css +0 -0
- /package/{dist/ui → ui}/czi-image-upload-editor.css +0 -0
- /package/{dist/ui → ui}/czi-image-upload-placeholder.css +0 -0
- /package/{dist/ui → ui}/czi-image-url-editor.css +0 -0
- /package/{dist/ui → ui}/czi-image-view.css +0 -0
- /package/{dist/ui → ui}/czi-indent.css +0 -0
- /package/{dist/ui → ui}/czi-inline-editor.css +0 -0
- /package/{dist/ui → ui}/czi-list.css +0 -0
- /package/{dist/ui → ui}/czi-loading-indicator.css +0 -0
- /package/{dist/ui → ui}/czi-math-view.css +0 -0
- /package/{dist/ui → ui}/czi-selection-placeholder.css +0 -0
- /package/{dist/ui → ui}/czi-table-cell-menu.css +0 -0
- /package/{dist/ui → ui}/czi-table-grid-size-editor.css +0 -0
- /package/{dist/ui → ui}/fonts.css +0 -0
- /package/{dist/ui → ui}/htmlElementToRect.js.flow +0 -0
- /package/{dist/ui → ui}/icon-font.css +0 -0
- /package/{dist/ui → ui}/injectStyleSheet.js.flow +0 -0
- /package/{dist/ui → ui}/isElementFullyVisible.js.flow +0 -0
- /package/{dist/ui → ui}/isOffline.js.flow +0 -0
- /package/{dist/ui → ui}/isReactClass.js.flow +0 -0
- /package/{dist/ui → ui}/listType.css +0 -0
- /package/{dist/ui → ui}/mathquill-editor/MathQuillEditorSymbols.js.flow +0 -0
- /package/{dist/ui → ui}/mathquill-editor/czi-mathquill-editor-symbols-panel.css +0 -0
- /package/{dist/ui → ui}/mathquill-editor/czi-mathquill-editor.css +0 -0
- /package/{dist/ui → ui}/resolveImage.js.flow +0 -0
- /package/{dist/ui → ui}/toCSSColor.js.flow +0 -0
- /package/{dist/ui → ui}/toCSSLineSpacing.js.flow +0 -0
- /package/{dist/ui → ui}/toHexColor.js.flow +0 -0
- /package/{dist/ui → ui}/uuid.js.flow +0 -0
- /package/{dist/uuid.js.flow → uuid.js.flow} +0 -0
package/client/Licit.js
ADDED
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
6
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
7
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
13
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
15
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
17
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
20
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
|
+
import { EditorState, TextSelection, Plugin } from 'prosemirror-state';
|
|
22
|
+
import { Node, Schema } from 'prosemirror-model';
|
|
23
|
+
import { Transform } from 'prosemirror-transform';
|
|
24
|
+
import { EditorView } from 'prosemirror-view';
|
|
25
|
+
import * as React from 'react';
|
|
26
|
+
import { stringify } from 'flatted';
|
|
27
|
+
import convertFromJSON from '../convertFromJSON.js';
|
|
28
|
+
import RichTextEditor from '../ui/RichTextEditor.js';
|
|
29
|
+
import uuid from '../uuid.js';
|
|
30
|
+
import SimpleConnector from './SimpleConnector.js';
|
|
31
|
+
import CollabConnector from './CollabConnector.js';
|
|
32
|
+
import { EMPTY_DOC_JSON } from '../createEmptyEditorState.js';
|
|
33
|
+
import { createPopUp, atViewportCenter } from '@modusoperandi/licit-ui-commands';
|
|
34
|
+
import AlertInfo from '../ui/AlertInfo.js';
|
|
35
|
+
import { SetDocAttrStep } from '@modusoperandi/licit-doc-attrs-step';
|
|
36
|
+
import './licit.css';
|
|
37
|
+
import DefaultEditorPlugins from '../buildEditorPlugins.js';
|
|
38
|
+
import EditorMarks from '../EditorMarks.js';
|
|
39
|
+
import EditorNodes from '../EditorNodes.js';
|
|
40
|
+
import convertFromHTML from '../convertFromHTML.js';
|
|
41
|
+
export var DataType = Object.freeze({
|
|
42
|
+
JSON: Symbol('json'),
|
|
43
|
+
HTML: Symbol('html')
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* LICIT properties:
|
|
48
|
+
* docID {string} [] Collaborative Doument ID
|
|
49
|
+
* collabServiceURL {string} [/collaboration-service] Collaboration Service URL
|
|
50
|
+
* debug {boolean} [false] To enable/disable ProseMirror Debug Tools, available only in development.
|
|
51
|
+
* width {string} [100%] Width of the editor.
|
|
52
|
+
* height {string} [100%] Height of the editor.
|
|
53
|
+
* readOnly {boolean} [false] To enable/disable editing mode.
|
|
54
|
+
* onChange {@callback} [null] Fires after each significant change.
|
|
55
|
+
* @param data {JSON} Modified document data.
|
|
56
|
+
* onReady {@callback} [null] Fires when the editor is fully ready.
|
|
57
|
+
* @param ref {LICIT} Rerefence of the editor.
|
|
58
|
+
* data {JSON|HTML} [null] Document data to be loaded into the editor.
|
|
59
|
+
* dataType {JSON|HTML} [JSON] Document data to be loaded into the editor.
|
|
60
|
+
* disabled {boolean} [false] Disable the editor.
|
|
61
|
+
* embedded {boolean} [false] Disable/Enable inline behaviour.
|
|
62
|
+
* plugins [plugins] External Plugins into the editor.
|
|
63
|
+
*/
|
|
64
|
+
var Licit = /*#__PURE__*/function (_React$Component) {
|
|
65
|
+
_inherits(Licit, _React$Component);
|
|
66
|
+
function Licit(_props, context) {
|
|
67
|
+
var _this;
|
|
68
|
+
_classCallCheck(this, Licit);
|
|
69
|
+
_this = _callSuper(this, Licit, [_props, context]);
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "_runtime", void 0);
|
|
71
|
+
_defineProperty(_assertThisInitialized(_this), "_connector", void 0);
|
|
72
|
+
_defineProperty(_assertThisInitialized(_this), "_clientID", void 0);
|
|
73
|
+
_defineProperty(_assertThisInitialized(_this), "_editorView", void 0);
|
|
74
|
+
// This will be handy in updating document's content.
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "_skipSCU", void 0);
|
|
76
|
+
// Flag to decide whether to skip shouldComponentUpdate
|
|
77
|
+
_defineProperty(_assertThisInitialized(_this), "_defaultEditorSchema", void 0);
|
|
78
|
+
_defineProperty(_assertThisInitialized(_this), "_defaultEditorPlugins", void 0);
|
|
79
|
+
_defineProperty(_assertThisInitialized(_this), "_pasteJSONPlugin", void 0);
|
|
80
|
+
_defineProperty(_assertThisInitialized(_this), "_popUp", null);
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "insertJSON", function (json) {
|
|
82
|
+
if (_this._pasteJSONPlugin && _this._pasteJSONPlugin.insert) {
|
|
83
|
+
_this._pasteJSONPlugin.insert(json, _this._editorView);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
_defineProperty(_assertThisInitialized(_this), "setContent", function () {
|
|
87
|
+
var content = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
88
|
+
var dataType = arguments.length > 1 ? arguments[1] : undefined;
|
|
89
|
+
_this.skipDataTypeCheck = false;
|
|
90
|
+
// [FS] IRAD-1571 2021-09-27
|
|
91
|
+
// dispatch a transaction that MUST start from the views current state;
|
|
92
|
+
var editorState = _this._editorView.state;
|
|
93
|
+
var doc = editorState.doc;
|
|
94
|
+
var tr = editorState.tr;
|
|
95
|
+
var document = _this.getDocument(content, editorState, dataType);
|
|
96
|
+
_this.skipDataTypeCheck = true;
|
|
97
|
+
|
|
98
|
+
// [FS] IRAD-1593 2021-10-12
|
|
99
|
+
// Reset lastKeyCode since the content is set dynamically and so lastKeyCode is invalid now.
|
|
100
|
+
_this._editorView.lastKeyCode = null;
|
|
101
|
+
var selection = TextSelection.create(doc, 0, doc.content.size);
|
|
102
|
+
tr = tr.setSelection(selection).replaceSelectionWith(document, false);
|
|
103
|
+
// [FS] IRAD-1092 2020-12-03
|
|
104
|
+
// set the value for object metadata and objectId
|
|
105
|
+
// Should update all document attributes.
|
|
106
|
+
Object.keys(document.attrs).forEach(function (attr) {
|
|
107
|
+
tr = tr.step(new SetDocAttrStep(attr, document.attrs[attr]));
|
|
108
|
+
});
|
|
109
|
+
_this._skipSCU = true;
|
|
110
|
+
_this._editorView.dispatch(tr);
|
|
111
|
+
});
|
|
112
|
+
_defineProperty(_assertThisInitialized(_this), "_onChange", function (data) {
|
|
113
|
+
var transaction = data.transaction;
|
|
114
|
+
|
|
115
|
+
/*
|
|
116
|
+
** ProseMirror Debug Tool's Snapshot creates a new state and sets that to editor view's state.
|
|
117
|
+
** This results in the connector's state as an orphan and thus transaction mismatch error.
|
|
118
|
+
** To resolve check and update the connector's state to keep in sync.
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
if (_this._editorView) {
|
|
122
|
+
var isSameState = _this._connector._editorState == _this._editorView.state;
|
|
123
|
+
var invokeOnEdit = false;
|
|
124
|
+
if (!isSameState) {
|
|
125
|
+
_this._connector._editorState = _this._editorView.state;
|
|
126
|
+
invokeOnEdit = true;
|
|
127
|
+
} else {
|
|
128
|
+
// [FS] IRAD-1264 2021-03-19
|
|
129
|
+
// check if in non-collab mode.
|
|
130
|
+
if (!(_this._connector instanceof CollabConnector)) {
|
|
131
|
+
invokeOnEdit = true;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (invokeOnEdit) {
|
|
135
|
+
// [FS] IRAD-1236 2020-03-05
|
|
136
|
+
// Only need to call if there is any difference in collab mode OR always in non-collab mode.
|
|
137
|
+
_this._connector.onEdit(transaction, _this._editorView);
|
|
138
|
+
}
|
|
139
|
+
if (transaction.docChanged) {
|
|
140
|
+
var docJson = transaction.doc.toJSON();
|
|
141
|
+
var isEmpty = false;
|
|
142
|
+
if (docJson.content && docJson.content.length === 1) {
|
|
143
|
+
if (!docJson.content[0].content || docJson.content[0].content && docJson.content[0].content[0].text && '' === docJson.content[0].content[0].text.trim()) {
|
|
144
|
+
isEmpty = true;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// setCFlags is/was always the opposite of isEmpty.
|
|
149
|
+
if (isEmpty) {
|
|
150
|
+
_this.resetCounters(transaction);
|
|
151
|
+
} else {
|
|
152
|
+
_this.setCounterFlags(transaction, false);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Changing 2nd parameter from boolean to object was not in any way
|
|
156
|
+
// backwards compatible. Any conditional logic placed on isEmpty was
|
|
157
|
+
// broken. Reverting that change, then adding view as a 3rd parameter.
|
|
158
|
+
_this.state.onChangeCB(docJson, isEmpty, _this._editorView);
|
|
159
|
+
_this.closeOpenedPopupModels();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
_defineProperty(_assertThisInitialized(_this), "_onReady", function (editorView) {
|
|
164
|
+
// [FS][06-APR-2020][IRAD-922]
|
|
165
|
+
// Showing focus in the editor.
|
|
166
|
+
var state = editorView.state,
|
|
167
|
+
dispatch = editorView.dispatch;
|
|
168
|
+
_this._editorView = editorView;
|
|
169
|
+
var tr = state.tr;
|
|
170
|
+
dispatch(tr.scrollIntoView());
|
|
171
|
+
|
|
172
|
+
// [FS] IRAD-1578 2021-09-27
|
|
173
|
+
// In collab mode, fire onRead only after getting the response from collab server.
|
|
174
|
+
if (_this.state.onReadyCB && _this.state.docID === '') {
|
|
175
|
+
editorView.focus();
|
|
176
|
+
_this.state.onReadyCB(_assertThisInitialized(_this));
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
/**
|
|
180
|
+
* LICIT properties:
|
|
181
|
+
* docID {number} [0] Collaborative Doument ID
|
|
182
|
+
* debug {boolean} [false] To enable/disable ProseMirror Debug Tools, available only in development.
|
|
183
|
+
* width {string} [100%] Width of the editor.
|
|
184
|
+
* height {height} [100%] Height of the editor.
|
|
185
|
+
* readOnly {boolean} [false] To enable/disable editing mode.
|
|
186
|
+
* onChange {@callback} [null] Fires after each significant change.
|
|
187
|
+
* @param data {JSON} Modified document data.
|
|
188
|
+
* onReady {@callback} [null] Fires when the editor is fully ready.
|
|
189
|
+
* @param ref {LICIT} Rerefence of the editor.
|
|
190
|
+
* data {JSON} [null] Document data to be loaded into the editor.
|
|
191
|
+
* disabled {boolean} [false] Disable the editor.
|
|
192
|
+
* embedded {boolean} [false] Disable/Enable inline behaviour.
|
|
193
|
+
*/
|
|
194
|
+
_defineProperty(_assertThisInitialized(_this), "setProps", function (props) {
|
|
195
|
+
if (_this.state.readOnly) {
|
|
196
|
+
// It should be possible to load content into the editor in readonly as well.
|
|
197
|
+
// It should not be necessary to make the component writable any time during the process
|
|
198
|
+
var propsCopy = {};
|
|
199
|
+
_this._skipSCU = true;
|
|
200
|
+
Object.assign(propsCopy, props);
|
|
201
|
+
// make writable without content change
|
|
202
|
+
propsCopy.readOnly = false;
|
|
203
|
+
delete propsCopy.data;
|
|
204
|
+
_this.setState(propsCopy);
|
|
205
|
+
}
|
|
206
|
+
_this.skipDataTypeCheck = false;
|
|
207
|
+
// Need to go through shouldComponentUpdate lifecycle here, when updated from outside,
|
|
208
|
+
// so that content is modified gracefully using transaction so that undo/redo works too.
|
|
209
|
+
_this._skipSCU = false;
|
|
210
|
+
_this.setState(props);
|
|
211
|
+
});
|
|
212
|
+
_defineProperty(_assertThisInitialized(_this), "exportPDF", function () {
|
|
213
|
+
new Promise( /*#__PURE__*/function () {
|
|
214
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
215
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
216
|
+
while (1) switch (_context.prev = _context.next) {
|
|
217
|
+
case 0:
|
|
218
|
+
try {
|
|
219
|
+
//
|
|
220
|
+
if (Array.isArray(_this.props.plugins)) {
|
|
221
|
+
_this.props.plugins.forEach(function (plugin) {
|
|
222
|
+
if (plugin['key'].startsWith('exportPDF$')) {
|
|
223
|
+
// got the exportPDF instance.
|
|
224
|
+
resolve(plugin);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
} catch (error) {
|
|
229
|
+
reject();
|
|
230
|
+
}
|
|
231
|
+
case 1:
|
|
232
|
+
case "end":
|
|
233
|
+
return _context.stop();
|
|
234
|
+
}
|
|
235
|
+
}, _callee);
|
|
236
|
+
}));
|
|
237
|
+
return function (_x, _x2) {
|
|
238
|
+
return _ref.apply(this, arguments);
|
|
239
|
+
};
|
|
240
|
+
}()).then(function (exportPDF) {
|
|
241
|
+
if (exportPDF.perform) {
|
|
242
|
+
exportPDF.perform(_this._editorView);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
_defineProperty(_assertThisInitialized(_this), "goToEnd", function () {
|
|
247
|
+
// Return focus to the editor with cursor at end of document.
|
|
248
|
+
var view = _this.editorView;
|
|
249
|
+
var tr = view.state.tr;
|
|
250
|
+
view.dispatch(tr.setSelection(TextSelection.atEnd(view.state.doc)).scrollIntoView());
|
|
251
|
+
view.focus();
|
|
252
|
+
});
|
|
253
|
+
_this.initialize(_props);
|
|
254
|
+
return _this;
|
|
255
|
+
}
|
|
256
|
+
_createClass(Licit, [{
|
|
257
|
+
key: "editorView",
|
|
258
|
+
get:
|
|
259
|
+
/**
|
|
260
|
+
* Provides access to prosemirror view.
|
|
261
|
+
*/
|
|
262
|
+
function get() {
|
|
263
|
+
return this._editorView;
|
|
264
|
+
}
|
|
265
|
+
}, {
|
|
266
|
+
key: "initialize",
|
|
267
|
+
value: function initialize(props) {
|
|
268
|
+
this._clientID = uuid();
|
|
269
|
+
this._editorView = null;
|
|
270
|
+
this._skipSCU = true;
|
|
271
|
+
var noop = function noop() {};
|
|
272
|
+
|
|
273
|
+
// [FS] IRAD-981 2020-06-10
|
|
274
|
+
// Component's configurations.
|
|
275
|
+
// [FS] IRAD-1552 2021-08-26
|
|
276
|
+
// Collaboration server / client should allow string values for document identifiers.
|
|
277
|
+
var docID = props.docID || ''; // Empty means collaborative.
|
|
278
|
+
var collaborative = docID !== '';
|
|
279
|
+
// [FS] IRAD-1553 2021-08-26
|
|
280
|
+
// Configurable Collaboration Service URL.
|
|
281
|
+
var collabServiceURL = props.collabServiceURL || '/collaboration-service';
|
|
282
|
+
var debug = props.debug || false;
|
|
283
|
+
// Default width and height to undefined
|
|
284
|
+
var width = props.width || undefined;
|
|
285
|
+
var height = props.height || undefined;
|
|
286
|
+
var onChangeCB = typeof props.onChange === 'function' ? props.onChange : noop;
|
|
287
|
+
var onReadyCB = typeof props.onReady === 'function' ? props.onReady : noop;
|
|
288
|
+
var readOnly = props.readOnly || false;
|
|
289
|
+
var data = props.data || null;
|
|
290
|
+
var dataType = props.dataType || DataType.JSON;
|
|
291
|
+
var disabled = props.disabled || false;
|
|
292
|
+
var embedded = props.embedded || false; // [FS] IRAD-996 2020-06-30
|
|
293
|
+
// [FS] 2020-07-03
|
|
294
|
+
// Handle Image Upload from Angular App
|
|
295
|
+
var runtime = props.runtime || null;
|
|
296
|
+
var plugins = props.plugins || null;
|
|
297
|
+
// This flag decides whether DataType.HTML check is needed when
|
|
298
|
+
// changing document. If it forcefully done, it is not needed, otherwise needed.
|
|
299
|
+
this.skipDataTypeCheck = false;
|
|
300
|
+
this._defaultEditorSchema = new Schema({
|
|
301
|
+
nodes: EditorNodes,
|
|
302
|
+
marks: EditorMarks
|
|
303
|
+
});
|
|
304
|
+
this._defaultEditorPlugins = new DefaultEditorPlugins(this._defaultEditorSchema).get();
|
|
305
|
+
this._pasteJSONPlugin = null;
|
|
306
|
+
var editorState = this.initEditorState(plugins, dataType, data);
|
|
307
|
+
data = editorState.doc;
|
|
308
|
+
var setState = this.setState.bind(this);
|
|
309
|
+
this._connector = collaborative ? new CollabConnector(editorState, setState, {
|
|
310
|
+
docID: docID,
|
|
311
|
+
collabServiceURL: collabServiceURL
|
|
312
|
+
}, this._defaultEditorSchema, this._defaultEditorPlugins,
|
|
313
|
+
// [FS] IRAD-1578 2021-09-27
|
|
314
|
+
this.onReady.bind(this)) : new SimpleConnector(editorState, setState);
|
|
315
|
+
this._connector._dataDefined = !!props.data;
|
|
316
|
+
|
|
317
|
+
// FS IRAD-989 2020-18-06
|
|
318
|
+
// updating properties should automatically render the changes
|
|
319
|
+
|
|
320
|
+
this.state = {
|
|
321
|
+
docID: docID,
|
|
322
|
+
collabServiceURL: collabServiceURL,
|
|
323
|
+
data: data,
|
|
324
|
+
editorState: editorState,
|
|
325
|
+
width: width,
|
|
326
|
+
height: height,
|
|
327
|
+
readOnly: readOnly,
|
|
328
|
+
onChangeCB: onChangeCB,
|
|
329
|
+
onReadyCB: onReadyCB,
|
|
330
|
+
debug: debug,
|
|
331
|
+
disabled: disabled,
|
|
332
|
+
embedded: embedded,
|
|
333
|
+
runtime: runtime,
|
|
334
|
+
dataType: dataType
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
// FS IRAD-1040 2020-26-08
|
|
338
|
+
// Get the modified schema from editorstate and send it to collab server
|
|
339
|
+
if (this._connector.updateSchema) {
|
|
340
|
+
// Use known editorState to update schema.
|
|
341
|
+
this._connector.updateSchema(editorState.schema, data);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}, {
|
|
345
|
+
key: "initEditorState",
|
|
346
|
+
value: function initEditorState(plugins, dataType, data) {
|
|
347
|
+
var editorState = null;
|
|
348
|
+
var effectivePlugins = this.getEffectivePlugins(this._defaultEditorSchema, this._defaultEditorPlugins, plugins);
|
|
349
|
+
this._pasteJSONPlugin = effectivePlugins.pasteJSONPlugin;
|
|
350
|
+
if (DataType.JSON === dataType) {
|
|
351
|
+
editorState = convertFromJSON(data, null, effectivePlugins.schema, effectivePlugins.plugins);
|
|
352
|
+
// [FS] IRAD-1067 2020-09-19
|
|
353
|
+
// The editorState will return null if the doc Json is mal-formed
|
|
354
|
+
if (null === editorState) {
|
|
355
|
+
editorState = convertFromJSON(EMPTY_DOC_JSON, null, effectivePlugins.schema, effectivePlugins.plugins);
|
|
356
|
+
this.showAlert();
|
|
357
|
+
}
|
|
358
|
+
} else {
|
|
359
|
+
editorState = convertFromHTML(data, effectivePlugins.schema, effectivePlugins.plugins);
|
|
360
|
+
}
|
|
361
|
+
return editorState;
|
|
362
|
+
}
|
|
363
|
+
}, {
|
|
364
|
+
key: "getEffectivePlugins",
|
|
365
|
+
value: function getEffectivePlugins(schema, defaultPlugins, plugins) {
|
|
366
|
+
var effectivePlugins = defaultPlugins;
|
|
367
|
+
var pasteJSONPlugin = null;
|
|
368
|
+
if (plugins) {
|
|
369
|
+
var _iterator = _createForOfIteratorHelper(plugins),
|
|
370
|
+
_step;
|
|
371
|
+
try {
|
|
372
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
373
|
+
var p = _step.value;
|
|
374
|
+
if (!effectivePlugins.includes(p)) {
|
|
375
|
+
effectivePlugins.push(p);
|
|
376
|
+
if (p.getEffectiveSchema) {
|
|
377
|
+
schema = p.getEffectiveSchema(schema);
|
|
378
|
+
}
|
|
379
|
+
if (p.initKeyCommands) {
|
|
380
|
+
effectivePlugins.push(p.initKeyCommands());
|
|
381
|
+
}
|
|
382
|
+
if (p.insert) {
|
|
383
|
+
pasteJSONPlugin = p;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
} catch (err) {
|
|
388
|
+
_iterator.e(err);
|
|
389
|
+
} finally {
|
|
390
|
+
_iterator.f();
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return {
|
|
394
|
+
plugins: effectivePlugins,
|
|
395
|
+
schema: schema,
|
|
396
|
+
pasteJSONPlugin: pasteJSONPlugin
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// [FS] IRAD-1578 2021-09-27
|
|
401
|
+
}, {
|
|
402
|
+
key: "onReady",
|
|
403
|
+
value: function onReady(state) {
|
|
404
|
+
var collabEditing = this.state.docID !== '';
|
|
405
|
+
if (collabEditing) {
|
|
406
|
+
this._editorView && this._editorView.focus();
|
|
407
|
+
if (this.state.onReadyCB) {
|
|
408
|
+
this.state.onReadyCB(this);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// [FS] IRAD-1067 2020-09-19
|
|
414
|
+
// Alert funtion to show document is corrupted
|
|
415
|
+
}, {
|
|
416
|
+
key: "showAlert",
|
|
417
|
+
value: function showAlert() {
|
|
418
|
+
var _this2 = this;
|
|
419
|
+
var anchor = null;
|
|
420
|
+
this._popUp = createPopUp(AlertInfo, null, {
|
|
421
|
+
anchor: anchor,
|
|
422
|
+
position: atViewportCenter,
|
|
423
|
+
onClose: function onClose(val) {
|
|
424
|
+
if (_this2._popUp) {
|
|
425
|
+
_this2._popUp = null;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}, {
|
|
431
|
+
key: "resetCounters",
|
|
432
|
+
value: function resetCounters(transaction) {
|
|
433
|
+
for (var index = 1; index <= 10; index++) {
|
|
434
|
+
var counterVar = 'set-cust-style-counter-' + index;
|
|
435
|
+
var setCounterVal = window[counterVar];
|
|
436
|
+
if (setCounterVal) {
|
|
437
|
+
delete window[counterVar];
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
this.setCounterFlags(transaction, true);
|
|
441
|
+
}
|
|
442
|
+
}, {
|
|
443
|
+
key: "setCounterFlags",
|
|
444
|
+
value: function setCounterFlags(transaction, reset) {
|
|
445
|
+
var modified = false;
|
|
446
|
+
var counterFlags = null;
|
|
447
|
+
var existingCFlags = transaction.doc.attrs.counterFlags;
|
|
448
|
+
if (reset && !existingCFlags) {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
for (var index = 1; index <= 10; index++) {
|
|
452
|
+
var counterVar = 'set-cust-style-counter-' + index;
|
|
453
|
+
var setCounterVal = window[counterVar];
|
|
454
|
+
if (setCounterVal) {
|
|
455
|
+
if (!counterFlags) {
|
|
456
|
+
counterFlags = {};
|
|
457
|
+
}
|
|
458
|
+
counterFlags[counterVar] = true;
|
|
459
|
+
if (!existingCFlags) {
|
|
460
|
+
modified = true;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
if (!modified) {
|
|
464
|
+
if (existingCFlags) {
|
|
465
|
+
if (setCounterVal) {
|
|
466
|
+
modified = undefined == existingCFlags[counterVar];
|
|
467
|
+
} else {
|
|
468
|
+
modified = undefined != existingCFlags[counterVar];
|
|
469
|
+
}
|
|
470
|
+
} else {
|
|
471
|
+
modified = setCounterVal;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
if (modified) {
|
|
476
|
+
var tr = this._editorView.state.tr.step(new SetDocAttrStep('counterFlags', counterFlags));
|
|
477
|
+
this._editorView.dispatch(tr);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}, {
|
|
481
|
+
key: "getDeletedArtifactIds",
|
|
482
|
+
value: function getDeletedArtifactIds() {
|
|
483
|
+
if (this._connector.getDeletedArtifactIds) {
|
|
484
|
+
this._connector.getDeletedArtifactIds(this.state.editorState.schema);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}, {
|
|
488
|
+
key: "isNodeHasAttribute",
|
|
489
|
+
value: function isNodeHasAttribute(node, attrName) {
|
|
490
|
+
return node.attrs && node.attrs[attrName];
|
|
491
|
+
}
|
|
492
|
+
}, {
|
|
493
|
+
key: "getDocument",
|
|
494
|
+
value: function getDocument(content, editorState, dataType) {
|
|
495
|
+
var document = null;
|
|
496
|
+
var schema = editorState.schema;
|
|
497
|
+
if (DataType.JSON === dataType || this.skipDataTypeCheck) {
|
|
498
|
+
document = schema.nodeFromJSON(content ? content : EMPTY_DOC_JSON);
|
|
499
|
+
} else {
|
|
500
|
+
var tempEState = convertFromHTML(content ? content : '', schema, editorState.plugins);
|
|
501
|
+
document = tempEState.doc;
|
|
502
|
+
}
|
|
503
|
+
return document;
|
|
504
|
+
}
|
|
505
|
+
}, {
|
|
506
|
+
key: "hasDataChanged",
|
|
507
|
+
value: function hasDataChanged(nextData, nextDataType) {
|
|
508
|
+
var dataChanged = false;
|
|
509
|
+
|
|
510
|
+
// [FS] IRAD-1571 2021-09-27
|
|
511
|
+
// dispatch a transaction that MUST start from the views current state;
|
|
512
|
+
// [FS] IRAD-1589 2021-10-04
|
|
513
|
+
// Do a proper circular JSON comparison.
|
|
514
|
+
if (stringify(this.state.data) !== stringify(nextData)) {
|
|
515
|
+
var editorState = this._editorView.state;
|
|
516
|
+
var nextDoc = this.getDocument(nextData, editorState, nextDataType);
|
|
517
|
+
dataChanged = !nextDoc.eq(editorState.doc);
|
|
518
|
+
}
|
|
519
|
+
return dataChanged;
|
|
520
|
+
}
|
|
521
|
+
}, {
|
|
522
|
+
key: "changeContent",
|
|
523
|
+
value: function changeContent(data, dataType) {
|
|
524
|
+
if (this.hasDataChanged(data, dataType)) {
|
|
525
|
+
// FS IRAD-1592 2021-11-10
|
|
526
|
+
// Release here quickly, so that update doesn't care about at this point.
|
|
527
|
+
// data changed, so update document content
|
|
528
|
+
setTimeout(this.setContent.bind(this, data, dataType), 1);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}, {
|
|
532
|
+
key: "shouldComponentUpdate",
|
|
533
|
+
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
534
|
+
// Only interested if properties are set from outside.
|
|
535
|
+
if (!this._skipSCU) {
|
|
536
|
+
this._skipSCU = false;
|
|
537
|
+
this.changeContent(nextState.data, nextState.dataType);
|
|
538
|
+
if (this.state.docID !== nextState.docID) {
|
|
539
|
+
setTimeout(this.setDocID.bind(this, nextState), 1);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
this.skipDataTypeCheck = true;
|
|
543
|
+
return true;
|
|
544
|
+
}
|
|
545
|
+
}, {
|
|
546
|
+
key: "setDocID",
|
|
547
|
+
value: function setDocID(nextState) {
|
|
548
|
+
// Collaborative mode changed
|
|
549
|
+
var collabEditing = nextState.docID !== '';
|
|
550
|
+
var editorState = this._editorView.state;
|
|
551
|
+
var setState = this.setState.bind(this);
|
|
552
|
+
var docID = nextState.docID || '';
|
|
553
|
+
var collabServiceURL = nextState.collabServiceURL || '/collaboration-service';
|
|
554
|
+
if (this._connector) {
|
|
555
|
+
this._connector.cleanUp();
|
|
556
|
+
}
|
|
557
|
+
// create new connector
|
|
558
|
+
this._connector = collabEditing ? new CollabConnector(editorState, setState, {
|
|
559
|
+
docID: docID,
|
|
560
|
+
collabServiceURL: collabServiceURL
|
|
561
|
+
}, this._defaultEditorSchema, this._defaultEditorPlugins,
|
|
562
|
+
// [FS] IRAD-1578 2021-09-27
|
|
563
|
+
this.onReady.bind(this)) : new SimpleConnector(editorState, setState);
|
|
564
|
+
|
|
565
|
+
// FS IRAD-1592 2021-11-10
|
|
566
|
+
// Notify collab server
|
|
567
|
+
if (this._connector.updateSchema) {
|
|
568
|
+
// Use known editorState to update schema.
|
|
569
|
+
this._connector.updateSchema(editorState.schema);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}, {
|
|
573
|
+
key: "render",
|
|
574
|
+
value: function render() {
|
|
575
|
+
var _this$state = this.state,
|
|
576
|
+
editorState = _this$state.editorState,
|
|
577
|
+
width = _this$state.width,
|
|
578
|
+
height = _this$state.height,
|
|
579
|
+
readOnly = _this$state.readOnly,
|
|
580
|
+
disabled = _this$state.disabled,
|
|
581
|
+
embedded = _this$state.embedded,
|
|
582
|
+
runtime = _this$state.runtime;
|
|
583
|
+
// [FS] IRAD-978 2020-06-05
|
|
584
|
+
// Using 100vw & 100vh (100% viewport) is not ideal for a component which is expected to be a part of a page,
|
|
585
|
+
// so changing it to 100% width & height which will occupy the area relative to its parent.
|
|
586
|
+
return /*#__PURE__*/React.createElement(RichTextEditor, {
|
|
587
|
+
disabled: disabled,
|
|
588
|
+
editorState: editorState,
|
|
589
|
+
embedded: embedded,
|
|
590
|
+
height: height,
|
|
591
|
+
onChange: this._onChange,
|
|
592
|
+
onReady: this._onReady,
|
|
593
|
+
readOnly: readOnly,
|
|
594
|
+
runtime: runtime,
|
|
595
|
+
width: width
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
}, {
|
|
599
|
+
key: "closeOpenedPopupModels",
|
|
600
|
+
value:
|
|
601
|
+
// [FS] IRAD-1173 2021-02-25
|
|
602
|
+
// Bug fix: Transaction mismatch error when a dialog is opened and keep typing.
|
|
603
|
+
function closeOpenedPopupModels() {
|
|
604
|
+
var element = document.getElementsByClassName('czi-pop-up-element')[0];
|
|
605
|
+
if (element && element.parentElement) {
|
|
606
|
+
element.parentElement.removeChild(element);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}]);
|
|
610
|
+
return Licit;
|
|
611
|
+
}(React.Component);
|
|
612
|
+
export default Licit;
|
|
613
|
+
import { bpfrpt_proptype_EditorRuntime } from "../Types.js";
|