sykpcomposer 0.0.384 → 0.0.385
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/{dist/index.html → index.html} +13 -14
- package/index.ts +1 -0
- package/package.json +60 -76
- package/postcss.config.cjs +6 -0
- package/{dist → public}/assets/icons/3-columns.svg +3 -3
- package/{dist → public}/assets/icons/LICENSE.md +5 -5
- package/{dist → public}/assets/icons/add-sign.svg +3 -3
- package/{dist → public}/assets/icons/file-earmark-text.svg +3 -3
- package/{dist → public}/assets/icons/minus-sign.svg +3 -3
- package/{dist → public}/assets/icons/scissors.svg +2 -2
- package/public/index.html +43 -0
- package/{dist → public}/manifest.json +25 -25
- package/{dist → public}/robots.txt +3 -3
- package/src/index.tsx +8 -0
- package/src/lexical/App.tsx +139 -0
- package/src/lexical/Editor.tsx +496 -0
- package/src/lexical/appSettings.ts +34 -0
- package/src/lexical/codoxCollab.js +11 -0
- package/src/lexical/commenting/index.ts +451 -0
- package/src/lexical/context/SettingsContext.tsx +81 -0
- package/src/lexical/context/SharedAutocompleteContext.tsx +71 -0
- package/src/lexical/context/SharedHistoryContext.tsx +35 -0
- package/src/lexical/hooks/useModal.tsx +60 -0
- package/src/lexical/hooks/useReport.ts +64 -0
- package/src/lexical/http.ts +67 -0
- package/src/lexical/images/cat-typing.gif +0 -0
- package/src/lexical/images/emoji/1F600.png +0 -0
- package/src/lexical/images/emoji/1F641.png +0 -0
- package/src/lexical/images/emoji/1F642.png +0 -0
- package/src/lexical/images/emoji/2764.png +0 -0
- package/src/lexical/images/emoji/LICENSE.md +5 -0
- package/src/lexical/images/icons/3-columns.svg +3 -0
- package/src/lexical/images/icons/LICENSE.md +5 -0
- package/src/lexical/images/icons/add-sign.svg +3 -0
- package/src/lexical/images/icons/arrow-clockwise.svg +1 -0
- package/src/lexical/images/icons/arrow-counterclockwise.svg +1 -0
- package/src/lexical/images/icons/bg-color.svg +1 -0
- package/src/lexical/images/icons/camera.svg +1 -0
- package/src/lexical/images/icons/card-checklist.svg +1 -0
- package/src/lexical/images/icons/caret-right-fill.svg +1 -0
- package/src/lexical/images/icons/chat-left-text.svg +1 -0
- package/src/lexical/images/icons/chat-right-dots.svg +1 -0
- package/src/lexical/images/icons/chat-right-text.svg +1 -0
- package/src/lexical/images/icons/chat-right.svg +1 -0
- package/src/lexical/images/icons/chat-square-quote.svg +1 -0
- package/src/lexical/images/icons/chevron-down.svg +1 -0
- package/src/lexical/images/icons/clipboard.svg +1 -0
- package/src/lexical/images/icons/close.svg +1 -0
- package/src/lexical/images/icons/code.svg +1 -0
- package/src/lexical/images/icons/comments.svg +1 -0
- package/src/lexical/images/icons/copy.svg +1 -0
- package/src/lexical/images/icons/diagram-2.svg +1 -0
- package/src/lexical/images/icons/download.svg +1 -0
- package/src/lexical/images/icons/draggable-block-menu.svg +1 -0
- package/src/lexical/images/icons/dropdown-more.svg +1 -0
- package/src/lexical/images/icons/figma.svg +1 -0
- package/src/lexical/images/icons/file-earmark-text.svg +4 -0
- package/src/lexical/images/icons/file-image.svg +1 -0
- package/src/lexical/images/icons/filetype-gif.svg +1 -0
- package/src/lexical/images/icons/font-color.svg +1 -0
- package/src/lexical/images/icons/font-family.svg +1 -0
- package/src/lexical/images/icons/gear.svg +1 -0
- package/src/lexical/images/icons/horizontal-rule.svg +1 -0
- package/src/lexical/images/icons/indent.svg +1 -0
- package/src/lexical/images/icons/journal-code.svg +1 -0
- package/src/lexical/images/icons/journal-text.svg +1 -0
- package/src/lexical/images/icons/justify.svg +1 -0
- package/src/lexical/images/icons/link.svg +1 -0
- package/src/lexical/images/icons/list-ol.svg +1 -0
- package/src/lexical/images/icons/list-ul.svg +1 -0
- package/src/lexical/images/icons/lock-fill.svg +1 -0
- package/src/lexical/images/icons/lock.svg +1 -0
- package/src/lexical/images/icons/markdown.svg +1 -0
- package/src/lexical/images/icons/mic.svg +1 -0
- package/src/lexical/images/icons/minus-sign.svg +3 -0
- package/src/lexical/images/icons/outdent.svg +1 -0
- package/src/lexical/images/icons/paint-bucket.svg +1 -0
- package/src/lexical/images/icons/palette.svg +1 -0
- package/src/lexical/images/icons/pencil-fill.svg +1 -0
- package/src/lexical/images/icons/plug-fill.svg +1 -0
- package/src/lexical/images/icons/plug.svg +1 -0
- package/src/lexical/images/icons/plus-slash-minus.svg +1 -0
- package/src/lexical/images/icons/plus.svg +1 -0
- package/src/lexical/images/icons/prettier-error.svg +1 -0
- package/src/lexical/images/icons/prettier.svg +1 -0
- package/src/lexical/images/icons/scissors.svg +3 -0
- package/src/lexical/images/icons/send.svg +1 -0
- package/src/lexical/images/icons/square-check.svg +1 -0
- package/src/lexical/images/icons/sticky.svg +1 -0
- package/src/lexical/images/icons/success-alt.svg +1 -0
- package/src/lexical/images/icons/success.svg +1 -0
- package/src/lexical/images/icons/table.svg +1 -0
- package/src/lexical/images/icons/text-center.svg +1 -0
- package/src/lexical/images/icons/text-left.svg +1 -0
- package/src/lexical/images/icons/text-paragraph.svg +1 -0
- package/src/lexical/images/icons/text-right.svg +1 -0
- package/src/lexical/images/icons/trash.svg +1 -0
- package/src/lexical/images/icons/trash3.svg +1 -0
- package/src/lexical/images/icons/tweet.svg +1 -0
- package/src/lexical/images/icons/type-bold.svg +1 -0
- package/src/lexical/images/icons/type-h1.svg +1 -0
- package/src/lexical/images/icons/type-h2.svg +1 -0
- package/src/lexical/images/icons/type-h3.svg +1 -0
- package/src/lexical/images/icons/type-h4.svg +1 -0
- package/src/lexical/images/icons/type-h5.svg +1 -0
- package/src/lexical/images/icons/type-h6.svg +1 -0
- package/src/lexical/images/icons/type-italic.svg +1 -0
- package/src/lexical/images/icons/type-strikethrough.svg +1 -0
- package/src/lexical/images/icons/type-subscript.svg +1 -0
- package/src/lexical/images/icons/type-superscript.svg +1 -0
- package/src/lexical/images/icons/type-underline.svg +1 -0
- package/src/lexical/images/icons/upload.svg +1 -0
- package/src/lexical/images/icons/user.svg +1 -0
- package/src/lexical/images/icons/youtube.svg +1 -0
- package/src/lexical/images/image/LICENSE.md +5 -0
- package/src/lexical/images/landscape.jpg +0 -0
- package/src/lexical/images/logo.svg +1 -0
- package/src/lexical/images/yellow-flower-small.jpg +0 -0
- package/src/lexical/images/yellow-flower.jpg +0 -0
- package/src/lexical/index.css +1787 -0
- package/src/lexical/nodes/AutocompleteNode.tsx +107 -0
- package/src/lexical/nodes/EmojiNode.tsx +102 -0
- package/src/lexical/nodes/EquationComponent.tsx +132 -0
- package/src/lexical/nodes/FigmaNode.tsx +135 -0
- package/src/lexical/nodes/ImageComponent.tsx +427 -0
- package/src/lexical/nodes/ImageNode.css +43 -0
- package/src/lexical/nodes/ImageNode.tsx +253 -0
- package/src/lexical/nodes/InlineImageComponent.tsx +409 -0
- package/src/lexical/nodes/InlineImageNode.css +94 -0
- package/src/lexical/nodes/InlineImageNode.tsx +294 -0
- package/src/lexical/nodes/KeywordNode.ts +67 -0
- package/src/lexical/nodes/LayoutContainerNode.ts +137 -0
- package/src/lexical/nodes/LayoutItemNode.ts +71 -0
- package/src/lexical/nodes/MentionNode.ts +131 -0
- package/src/lexical/nodes/PageBreakNode/index.css +56 -0
- package/src/lexical/nodes/PageBreakNode/index.tsx +168 -0
- package/src/lexical/nodes/PlaygroundNodes.ts +72 -0
- package/src/lexical/nodes/PollComponent.tsx +248 -0
- package/src/lexical/nodes/PollNode.css +164 -0
- package/src/lexical/nodes/PollNode.tsx +209 -0
- package/src/lexical/nodes/StickyNode.css +37 -0
- package/src/lexical/nodes/TableNode.tsx +93 -0
- package/src/lexical/nodes/TweetNode.tsx +223 -0
- package/src/lexical/nodes/YouTubeNode.tsx +184 -0
- package/src/lexical/plugins/ActionsPlugin/index.tsx +0 -0
- package/src/lexical/plugins/AutoEmbedPlugin/index.tsx +354 -0
- package/src/lexical/plugins/AutoLinkPlugin/index.tsx +32 -0
- package/src/lexical/plugins/AutocompletePlugin/index.tsx +2529 -0
- package/src/lexical/plugins/CodeHighlightPlugin/index.ts +21 -0
- package/src/lexical/plugins/CollapsiblePlugin/Collapsible.css +57 -0
- package/src/lexical/plugins/CollapsiblePlugin/CollapsibleContainerNode.ts +136 -0
- package/src/lexical/plugins/CollapsiblePlugin/CollapsibleContentNode.ts +96 -0
- package/src/lexical/plugins/CollapsiblePlugin/CollapsibleTitleNode.ts +132 -0
- package/src/lexical/plugins/CollapsiblePlugin/index.ts +297 -0
- package/src/lexical/plugins/CommentPlugin/index.css +443 -0
- package/src/lexical/plugins/CommentPlugin/index.tsx +981 -0
- package/src/lexical/plugins/ContextMenuPlugin/index.tsx +244 -0
- package/src/lexical/plugins/DocsPlugin/index.tsx +20 -0
- package/src/lexical/plugins/DragDropPastePlugin/index.ts +51 -0
- package/src/lexical/plugins/DraggableBlockPlugin/index.css +36 -0
- package/src/lexical/plugins/DraggableBlockPlugin/index.tsx +431 -0
- package/src/lexical/plugins/EmojiPickerPlugin/index.tsx +199 -0
- package/src/lexical/plugins/EmojisPlugin/index.ts +79 -0
- package/src/lexical/plugins/FigmaPlugin/index.tsx +40 -0
- package/src/lexical/plugins/FloatingLinkEditorPlugin/index.css +41 -0
- package/src/lexical/plugins/FloatingLinkEditorPlugin/index.tsx +391 -0
- package/src/lexical/plugins/FloatingTextFormatToolbarPlugin/index.css +133 -0
- package/src/lexical/plugins/FloatingTextFormatToolbarPlugin/index.tsx +392 -0
- package/src/lexical/plugins/ImagesPlugin/index.tsx +354 -0
- package/src/lexical/plugins/InlineImagePlugin/index.tsx +343 -0
- package/src/lexical/plugins/KeywordsPlugin/index.ts +56 -0
- package/src/lexical/plugins/LayoutPlugin/InsertLayoutDialog.tsx +56 -0
- package/src/lexical/plugins/LayoutPlugin/LayoutPlugin.tsx +219 -0
- package/src/lexical/plugins/LinkPlugin/index.tsx +16 -0
- package/src/lexical/plugins/ListMaxIndentLevelPlugin/index.ts +86 -0
- package/src/lexical/plugins/MaxLengthPlugin/index.tsx +53 -0
- package/src/lexical/plugins/MentionsPlugin/index.tsx +696 -0
- package/src/lexical/plugins/PageBreakPlugin/index.tsx +57 -0
- package/src/lexical/plugins/PasteLogPlugin/index.tsx +54 -0
- package/src/lexical/plugins/PollPlugin/index.tsx +87 -0
- package/src/lexical/plugins/SpeechToTextPlugin/index.ts +125 -0
- package/src/lexical/plugins/StickyPlugin/index.ts +22 -0
- package/src/lexical/plugins/TabFocusPlugin/index.tsx +65 -0
- package/src/lexical/plugins/TableActionMenuPlugin/index.tsx +791 -0
- package/src/lexical/plugins/TableCellResizer/index.css +12 -0
- package/src/lexical/plugins/TableCellResizer/index.tsx +419 -0
- package/src/lexical/plugins/TableOfContentsPlugin/index.css +87 -0
- package/src/lexical/plugins/TableOfContentsPlugin/index.tsx +197 -0
- package/src/lexical/plugins/TablePlugin.tsx +182 -0
- package/src/lexical/plugins/TestRecorderPlugin/index.tsx +464 -0
- package/src/lexical/plugins/ToolbarPlugin/fontSize.css +44 -0
- package/src/lexical/plugins/ToolbarPlugin/fontSize.tsx +212 -0
- package/src/lexical/plugins/ToolbarPlugin/index.tsx +1001 -0
- package/src/lexical/plugins/TreeViewPlugin/index.tsx +26 -0
- package/src/lexical/plugins/TwitterPlugin/index.ts +41 -0
- package/src/lexical/plugins/TypingPerfPlugin/index.ts +117 -0
- package/src/lexical/plugins/YouTubePlugin/index.ts +41 -0
- package/src/lexical/server/validation.ts +132 -0
- package/src/lexical/themes/CommentEditorTheme.css +13 -0
- package/src/lexical/themes/CommentEditorTheme.ts +20 -0
- package/src/lexical/themes/PlaygroundEditorTheme.css +441 -0
- package/src/lexical/themes/PlaygroundEditorTheme.ts +119 -0
- package/src/lexical/themes/StickyEditorTheme.css +13 -0
- package/src/lexical/themes/StickyEditorTheme.ts +20 -0
- package/src/lexical/ui/Button.css +36 -0
- package/src/lexical/ui/Button.tsx +49 -0
- package/src/lexical/ui/ColorPicker.css +88 -0
- package/src/lexical/ui/ColorPicker.tsx +363 -0
- package/src/lexical/ui/ContentEditable.css +23 -0
- package/src/lexical/ui/ContentEditable.tsx +20 -0
- package/src/lexical/ui/Dialog.css +17 -0
- package/src/lexical/ui/Dialog.tsx +32 -0
- package/src/lexical/ui/DropDown.tsx +259 -0
- package/src/lexical/ui/DropdownColorPicker.tsx +41 -0
- package/src/lexical/ui/EquationEditor.css +38 -0
- package/src/lexical/ui/EquationEditor.tsx +56 -0
- package/src/lexical/ui/FileInput.tsx +38 -0
- package/src/lexical/ui/ImageResizer.tsx +313 -0
- package/src/lexical/ui/Input.css +32 -0
- package/src/lexical/ui/KatexEquationAlterer.css +41 -0
- package/src/lexical/ui/KatexEquationAlterer.tsx +81 -0
- package/src/lexical/ui/KatexRenderer.tsx +54 -0
- package/src/lexical/ui/Modal.css +62 -0
- package/src/lexical/ui/Modal.tsx +106 -0
- package/src/lexical/ui/Placeholder.css +28 -0
- package/src/lexical/ui/Placeholder.tsx +22 -0
- package/src/lexical/ui/Select.css +34 -0
- package/src/lexical/ui/Select.tsx +34 -0
- package/src/lexical/ui/Switch.tsx +36 -0
- package/src/lexical/ui/TextInput.tsx +46 -0
- package/src/lexical/utils/canUseDOM.ts +12 -0
- package/src/lexical/utils/emoji-list.ts +16615 -0
- package/src/lexical/utils/environment.ts +57 -0
- package/src/lexical/utils/getDOMRangeRect.ts +27 -0
- package/src/lexical/utils/getSelectedNode.ts +27 -0
- package/src/lexical/utils/guard.ts +10 -0
- package/src/lexical/utils/invariant.ts +26 -0
- package/src/lexical/utils/isMobileWidth.ts +7 -0
- package/src/lexical/utils/joinClasses.ts +13 -0
- package/src/lexical/utils/point.ts +55 -0
- package/src/lexical/utils/rect.ts +158 -0
- package/src/lexical/utils/setFloatingElemPosition.ts +51 -0
- package/src/lexical/utils/setFloatingElemPositionForLinkEditor.ts +46 -0
- package/src/lexical/utils/swipe.ts +127 -0
- package/src/lexical/utils/url.ts +38 -0
- package/src/lexical/utils/useLayoutEffect.ts +16 -0
- package/sykpcomposer-0.0.273.tgz +0 -0
- package/tailwind.config.cjs +8 -0
- package/tsconfig.json +23 -0
- package/tsconfig.node.json +9 -0
- package/vite.config.ts +26 -0
- package/yjs-wss-db/000015.ldb +0 -0
- package/yjs-wss-db/000018.ldb +0 -0
- package/yjs-wss-db/000019.log +0 -0
- package/yjs-wss-db/CURRENT +1 -0
- package/yjs-wss-db/LOCK +0 -0
- package/yjs-wss-db/LOG +5 -0
- package/yjs-wss-db/LOG.old +5 -0
- package/yjs-wss-db/MANIFEST-000017 +0 -0
- package/dist/assets/ImageComponent-DncIDz48.js +0 -23
- package/dist/assets/ImageComponent-NSP6xs1B.css +0 -1
- package/dist/assets/InlineImageComponent-BefYBd1k.js +0 -1
- package/dist/assets/InlineImageComponent-BnmVdNhp.css +0 -1
- package/dist/assets/LexicalNestedComposer.prod-BGbK0rVf.js +0 -1
- package/dist/assets/PollComponent-Brv_H-Vr.js +0 -1
- package/dist/assets/PollComponent-CymKlNoB.css +0 -1
- package/dist/assets/emoji-list-D_N31RbD.js +0 -1
- package/dist/assets/index-BR8wqG2P.js +0 -1441
- package/dist/assets/index-CDE-KF5Y.css +0 -1
- /package/{dist → public}/assets/icons/arrow-clockwise.svg +0 -0
- /package/{dist → public}/assets/icons/arrow-counterclockwise.svg +0 -0
- /package/{dist → public}/assets/icons/bg-color.svg +0 -0
- /package/{dist → public}/assets/icons/camera.svg +0 -0
- /package/{dist → public}/assets/icons/card-checklist.svg +0 -0
- /package/{dist → public}/assets/icons/caret-right-fill.svg +0 -0
- /package/{dist → public}/assets/icons/chat-left-text.svg +0 -0
- /package/{dist → public}/assets/icons/chat-right-dots.svg +0 -0
- /package/{dist → public}/assets/icons/chat-right-text.svg +0 -0
- /package/{dist → public}/assets/icons/chat-right.svg +0 -0
- /package/{dist → public}/assets/icons/chat-square-quote.svg +0 -0
- /package/{dist → public}/assets/icons/chevron-down.svg +0 -0
- /package/{dist → public}/assets/icons/clipboard.svg +0 -0
- /package/{dist → public}/assets/icons/close.svg +0 -0
- /package/{dist → public}/assets/icons/code.svg +0 -0
- /package/{dist → public}/assets/icons/comments.svg +0 -0
- /package/{dist → public}/assets/icons/copy.svg +0 -0
- /package/{dist → public}/assets/icons/diagram-2.svg +0 -0
- /package/{dist → public}/assets/icons/download.svg +0 -0
- /package/{dist → public}/assets/icons/draggable-block-menu.svg +0 -0
- /package/{dist → public}/assets/icons/dropdown-more.svg +0 -0
- /package/{dist → public}/assets/icons/figma.svg +0 -0
- /package/{dist → public}/assets/icons/file-image.svg +0 -0
- /package/{dist → public}/assets/icons/filetype-gif.svg +0 -0
- /package/{dist → public}/assets/icons/font-color.svg +0 -0
- /package/{dist → public}/assets/icons/font-family.svg +0 -0
- /package/{dist → public}/assets/icons/gear.svg +0 -0
- /package/{dist → public}/assets/icons/horizontal-rule.svg +0 -0
- /package/{dist → public}/assets/icons/indent.svg +0 -0
- /package/{dist → public}/assets/icons/journal-code.svg +0 -0
- /package/{dist → public}/assets/icons/journal-text.svg +0 -0
- /package/{dist → public}/assets/icons/justify.svg +0 -0
- /package/{dist → public}/assets/icons/link.svg +0 -0
- /package/{dist → public}/assets/icons/list-ol.svg +0 -0
- /package/{dist → public}/assets/icons/list-ul.svg +0 -0
- /package/{dist → public}/assets/icons/lock-fill.svg +0 -0
- /package/{dist → public}/assets/icons/lock.svg +0 -0
- /package/{dist → public}/assets/icons/markdown.svg +0 -0
- /package/{dist → public}/assets/icons/mic.svg +0 -0
- /package/{dist → public}/assets/icons/outdent.svg +0 -0
- /package/{dist → public}/assets/icons/paint-bucket.svg +0 -0
- /package/{dist → public}/assets/icons/palette.svg +0 -0
- /package/{dist → public}/assets/icons/pdf-svgrepo-com.svg +0 -0
- /package/{dist → public}/assets/icons/pencil-fill.svg +0 -0
- /package/{dist → public}/assets/icons/plug-fill.svg +0 -0
- /package/{dist → public}/assets/icons/plug.svg +0 -0
- /package/{dist → public}/assets/icons/plus-slash-minus.svg +0 -0
- /package/{dist → public}/assets/icons/plus.svg +0 -0
- /package/{dist → public}/assets/icons/prettier-error.svg +0 -0
- /package/{dist → public}/assets/icons/prettier.svg +0 -0
- /package/{dist → public}/assets/icons/send.svg +0 -0
- /package/{dist → public}/assets/icons/square-check.svg +0 -0
- /package/{dist → public}/assets/icons/sticky.svg +0 -0
- /package/{dist → public}/assets/icons/success-alt.svg +0 -0
- /package/{dist → public}/assets/icons/success.svg +0 -0
- /package/{dist → public}/assets/icons/table.svg +0 -0
- /package/{dist → public}/assets/icons/text-center.svg +0 -0
- /package/{dist → public}/assets/icons/text-left.svg +0 -0
- /package/{dist → public}/assets/icons/text-paragraph.svg +0 -0
- /package/{dist → public}/assets/icons/text-right.svg +0 -0
- /package/{dist → public}/assets/icons/trash.svg +0 -0
- /package/{dist → public}/assets/icons/trash3.svg +0 -0
- /package/{dist → public}/assets/icons/tweet.svg +0 -0
- /package/{dist → public}/assets/icons/type-bold.svg +0 -0
- /package/{dist → public}/assets/icons/type-h1.svg +0 -0
- /package/{dist → public}/assets/icons/type-h2.svg +0 -0
- /package/{dist → public}/assets/icons/type-h3.svg +0 -0
- /package/{dist → public}/assets/icons/type-h4.svg +0 -0
- /package/{dist → public}/assets/icons/type-h5.svg +0 -0
- /package/{dist → public}/assets/icons/type-h6.svg +0 -0
- /package/{dist → public}/assets/icons/type-italic.svg +0 -0
- /package/{dist → public}/assets/icons/type-strikethrough.svg +0 -0
- /package/{dist → public}/assets/icons/type-subscript.svg +0 -0
- /package/{dist → public}/assets/icons/type-superscript.svg +0 -0
- /package/{dist → public}/assets/icons/type-underline.svg +0 -0
- /package/{dist → public}/assets/icons/upload.svg +0 -0
- /package/{dist → public}/assets/icons/user.svg +0 -0
- /package/{dist → public}/assets/icons/youtube.svg +0 -0
- /package/{dist → public}/favicon.ico +0 -0
- /package/{dist → public}/logo192.png +0 -0
- /package/{dist → public}/logo512.png +0 -0
- /package/{dist → public}/vite.svg +0 -0
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
//@ts-nocheck
|
|
9
|
+
import React, { useState, useEffect, useRef, useMemo } from "react";
|
|
10
|
+
import { LexicalComposer } from "@lexical/react/LexicalComposer";
|
|
11
|
+
import { PlaygroundHeader } from "./ui/PlaygroundHeader";
|
|
12
|
+
|
|
13
|
+
import { SharedHistoryContext } from "./context/SharedHistoryContext";
|
|
14
|
+
import PlaygroundNodes from "./nodes/PlaygroundNodes";
|
|
15
|
+
import { TableContext } from "./plugins/TablePlugin";
|
|
16
|
+
import PlaygroundEditorTheme from "./themes/PlaygroundEditorTheme";
|
|
17
|
+
import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
18
|
+
import { CheckListPlugin } from "@lexical/react/LexicalCheckListPlugin";
|
|
19
|
+
import { ClearEditorPlugin } from "@lexical/react/LexicalClearEditorPlugin";
|
|
20
|
+
import { ClickableLinkPlugin } from "@lexical/react/LexicalClickableLinkPlugin";
|
|
21
|
+
import { HashtagPlugin } from "@lexical/react/LexicalHashtagPlugin";
|
|
22
|
+
import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
|
|
23
|
+
import { HorizontalRulePlugin } from "@lexical/react/LexicalHorizontalRulePlugin";
|
|
24
|
+
import { ListPlugin } from "@lexical/react/LexicalListPlugin";
|
|
25
|
+
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
|
|
26
|
+
import { TabIndentationPlugin } from "@lexical/react/LexicalTabIndentationPlugin";
|
|
27
|
+
import { TablePlugin } from "@lexical/react/LexicalTablePlugin";
|
|
28
|
+
|
|
29
|
+
import { useSharedHistoryContext } from "./context/SharedHistoryContext";
|
|
30
|
+
import AutoEmbedPlugin from "./plugins/AutoEmbedPlugin";
|
|
31
|
+
import AutoLinkPlugin from "./plugins/AutoLinkPlugin";
|
|
32
|
+
import CollapsiblePlugin from "./plugins/CollapsiblePlugin";
|
|
33
|
+
import DragDropPaste from "./plugins/DragDropPastePlugin";
|
|
34
|
+
import DraggableBlockPlugin from "./plugins/DraggableBlockPlugin";
|
|
35
|
+
import EmojiPickerPlugin from "./plugins/EmojiPickerPlugin";
|
|
36
|
+
import EmojisPlugin from "./plugins/EmojisPlugin";
|
|
37
|
+
import EquationsPlugin from "./plugins/EquationsPlugin";
|
|
38
|
+
import ExcalidrawPlugin from "./plugins/ExcalidrawPlugin";
|
|
39
|
+
import FigmaPlugin from "./plugins/FigmaPlugin";
|
|
40
|
+
import FloatingLinkEditorPlugin from "./plugins/FloatingLinkEditorPlugin";
|
|
41
|
+
import FloatingTextFormatToolbarPlugin from "./plugins/FloatingTextFormatToolbarPlugin";
|
|
42
|
+
import ImagesPlugin from "./plugins/ImagesPlugin";
|
|
43
|
+
import InlineImagePlugin from "./plugins/InlineImagePlugin";
|
|
44
|
+
import KeywordsPlugin from "./plugins/KeywordsPlugin";
|
|
45
|
+
import { LayoutPlugin } from "./plugins/LayoutPlugin/LayoutPlugin";
|
|
46
|
+
import LinkPlugin from "./plugins/LinkPlugin";
|
|
47
|
+
import ListMaxIndentLevelPlugin from "./plugins/ListMaxIndentLevelPlugin";
|
|
48
|
+
import MarkdownShortcutPlugin from "./plugins/MarkdownShortcutPlugin";
|
|
49
|
+
import MentionsPlugin from "./plugins/MentionsPlugin";
|
|
50
|
+
import PageBreakPlugin from "./plugins/PageBreakPlugin";
|
|
51
|
+
import PollPlugin from "./plugins/PollPlugin";
|
|
52
|
+
import TabFocusPlugin from "./plugins/TabFocusPlugin";
|
|
53
|
+
import TableCellActionMenuPlugin from "./plugins/TableActionMenuPlugin";
|
|
54
|
+
import TableCellResizer from "./plugins/TableCellResizer";
|
|
55
|
+
import ToolbarPlugin from "./plugins/ToolbarPlugin";
|
|
56
|
+
// import TreeViewPlugin from "./plugins/TreeViewPlugin";
|
|
57
|
+
import TwitterPlugin from "./plugins/TwitterPlugin";
|
|
58
|
+
import YouTubePlugin from "./plugins/YouTubePlugin";
|
|
59
|
+
import ContentEditable from "./ui/ContentEditable";
|
|
60
|
+
import Placeholder from "./ui/Placeholder";
|
|
61
|
+
|
|
62
|
+
import {
|
|
63
|
+
fetchAllDocIds,
|
|
64
|
+
fetchDocInitStateByDocId,
|
|
65
|
+
fetchStateWithTimestamp,
|
|
66
|
+
updateServerState,
|
|
67
|
+
} from "./http";
|
|
68
|
+
|
|
69
|
+
import {
|
|
70
|
+
CodoxCollabPlugin,
|
|
71
|
+
registerNodesWithCodox,
|
|
72
|
+
CodoxCommentPlugin,
|
|
73
|
+
validateStateStructure,
|
|
74
|
+
} from "./codoxCollab";
|
|
75
|
+
import "./index.css";
|
|
76
|
+
|
|
77
|
+
import useModal from "./hooks/useModal";
|
|
78
|
+
|
|
79
|
+
import Button from "./ui/Button";
|
|
80
|
+
import { CAN_USE_DOM } from "./utils/canUseDOM";
|
|
81
|
+
|
|
82
|
+
const LEXICAL_NODES_TO_REGISTER = registerNodesWithCodox([...PlaygroundNodes]);
|
|
83
|
+
|
|
84
|
+
let demoUserName = `EX-TARUN_${Math.floor(Math.random() * 1000)}`; // as example, just a random user name
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Main App Component
|
|
88
|
+
* For demonstation contains Lexical Provider and all plugins here.
|
|
89
|
+
* External plugins are borrowed from offical lexical playground
|
|
90
|
+
*/
|
|
91
|
+
export function Editor({
|
|
92
|
+
initialEditorState,
|
|
93
|
+
userObj,
|
|
94
|
+
CollabApiKey,
|
|
95
|
+
docId,
|
|
96
|
+
mentionItems,
|
|
97
|
+
sendEditorDataToParent,
|
|
98
|
+
}: any) {
|
|
99
|
+
const { historyState }: any = useSharedHistoryContext();
|
|
100
|
+
const [userOnline, setuserOnline] = useState([]);
|
|
101
|
+
|
|
102
|
+
const [currentDocId, setCurrentDocId] = useState("skyp_1");
|
|
103
|
+
const [onlUser, setonlUser] = useState([]);
|
|
104
|
+
|
|
105
|
+
// flag for codox start
|
|
106
|
+
const [codoxStarted, setCodoxStarted] = useState(false);
|
|
107
|
+
const [modal, showModal] = useModal();
|
|
108
|
+
const [initLexicalState, setInitLexicalState] = useState(null);
|
|
109
|
+
|
|
110
|
+
const codoxProviderRef = useRef(null);
|
|
111
|
+
|
|
112
|
+
const fetchDocOnNetworkReconnect = async () => {
|
|
113
|
+
// Use real api call to BE
|
|
114
|
+
const state = { root: [] }; //await fetchDocInitStateByDocId(currentDocId);
|
|
115
|
+
return { state, timestamp: Date.now() };
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// triggered by Codox
|
|
119
|
+
let onBlacklistedInsert = () => {
|
|
120
|
+
console.log(
|
|
121
|
+
"[Lexical Demo][onBlacklistedInsert] blacklisted combination found"
|
|
122
|
+
);
|
|
123
|
+
// NOTE: this is example of how to show in ui message when blacklisted combination found
|
|
124
|
+
showModal("Insert is forbidden", (onClose) => {});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const { userName, userId, userEmail } = userObj || {
|
|
128
|
+
userName: "aa",
|
|
129
|
+
userId: "aa",
|
|
130
|
+
userEmail: "aa@sample.com",
|
|
131
|
+
};
|
|
132
|
+
const userDetail = {
|
|
133
|
+
name: userName,
|
|
134
|
+
id: userId,
|
|
135
|
+
email: userEmail,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const codoxConfig = {
|
|
139
|
+
docId: docId,
|
|
140
|
+
apiKey: CollabApiKey, // demo api key provided by codox. Must use your own
|
|
141
|
+
user: userDetail, // client user name - use real username here instead of demo name
|
|
142
|
+
hooks: {
|
|
143
|
+
fetchDocOnNetworkReconnect,
|
|
144
|
+
contentChanged: (data) => {
|
|
145
|
+
sendEditorDataToParent(data);
|
|
146
|
+
console.log(
|
|
147
|
+
"[Lexical Demo][contentChanged hook] hook invoked by Codox: ",
|
|
148
|
+
data
|
|
149
|
+
);
|
|
150
|
+
contentChangedHookHandler(data);
|
|
151
|
+
},
|
|
152
|
+
usersUpdate: (data) => {
|
|
153
|
+
setuserOnline(data);
|
|
154
|
+
renderOnlineUsers(data);
|
|
155
|
+
console.log(
|
|
156
|
+
"[Lexical Demo][usersUpdate hook] hook invoked by Codox: ",
|
|
157
|
+
data
|
|
158
|
+
);
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
let userOnlineArr = [];
|
|
165
|
+
let isPresent = [];
|
|
166
|
+
if (userOnline && userOnline.length > 0) {
|
|
167
|
+
userOnline.map((item, index) => {
|
|
168
|
+
if (!isPresent.includes(item.name)) {
|
|
169
|
+
isPresent.push(item.name);
|
|
170
|
+
userOnlineArr.push(
|
|
171
|
+
<div
|
|
172
|
+
key={index}
|
|
173
|
+
title={item.name}
|
|
174
|
+
className={`avatarStyle avatar-color-${index + 1}`}
|
|
175
|
+
>
|
|
176
|
+
{" "}
|
|
177
|
+
{item.name && item.name[0]}
|
|
178
|
+
{item.name && item.name[4]}
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
setonlUser(userOnlineArr);
|
|
185
|
+
}, [userOnline]);
|
|
186
|
+
|
|
187
|
+
const startCodoxSync = () => {
|
|
188
|
+
if (codoxProviderRef.current) {
|
|
189
|
+
codoxProviderRef.current.initComments(initLexicalState.comments);
|
|
190
|
+
const events = ["content_changed", "error", "users_update"];
|
|
191
|
+
events.forEach((event) => {
|
|
192
|
+
console.log("[Lexical Demo][[Subscribe to Codox Event]: ", event);
|
|
193
|
+
codoxProviderRef.current.on(event, (data) => {
|
|
194
|
+
console.log("[Lexical Demo][Codox Event Emitted]: ", { event, data });
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
codoxProviderRef.current
|
|
198
|
+
.start(codoxConfig)
|
|
199
|
+
.then(() => {
|
|
200
|
+
console.log("[Lexical Demo][codox.start] success");
|
|
201
|
+
|
|
202
|
+
setCodoxStarted(true);
|
|
203
|
+
})
|
|
204
|
+
.catch((err) => console.log("[Lexical Demo][codox.start] error", err));
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const stopCodoxSync = () => {
|
|
208
|
+
if (codoxProviderRef.current) {
|
|
209
|
+
codoxProviderRef.current.stop();
|
|
210
|
+
}
|
|
211
|
+
setCodoxStarted(false);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
useEffect(() => {
|
|
215
|
+
(async () => {
|
|
216
|
+
if (!currentDocId) return;
|
|
217
|
+
/**
|
|
218
|
+
* Stop already running codox sync, when docId is changed
|
|
219
|
+
*/
|
|
220
|
+
if (codoxStarted) {
|
|
221
|
+
stopCodoxSync();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Make a real api call for init state
|
|
225
|
+
// let initState = await fetchDocInitStateByDocId(currentDocId);
|
|
226
|
+
let initState = {
|
|
227
|
+
root: {
|
|
228
|
+
children: [
|
|
229
|
+
{
|
|
230
|
+
children: [
|
|
231
|
+
{
|
|
232
|
+
detail: 0,
|
|
233
|
+
format: "",
|
|
234
|
+
mode: "normal",
|
|
235
|
+
style: "ASA",
|
|
236
|
+
text: "codox state",
|
|
237
|
+
type: "text",
|
|
238
|
+
version: 1,
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
direction: "ltr",
|
|
242
|
+
format: "",
|
|
243
|
+
indent: 0,
|
|
244
|
+
type: "paragraph",
|
|
245
|
+
version: 1,
|
|
246
|
+
textFormat: 0,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
direction: "ltr",
|
|
250
|
+
format: "",
|
|
251
|
+
indent: 0,
|
|
252
|
+
type: "root",
|
|
253
|
+
version: 1,
|
|
254
|
+
},
|
|
255
|
+
comments: [],
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// console.log({ initState });
|
|
259
|
+
|
|
260
|
+
if (initState) {
|
|
261
|
+
try {
|
|
262
|
+
validateStateStructure(initState, LEXICAL_NODES_TO_REGISTER); // if invalid - will throw
|
|
263
|
+
|
|
264
|
+
setInitLexicalState(initState);
|
|
265
|
+
} catch (err) {
|
|
266
|
+
console.error("[APP] error: ", err);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
})();
|
|
270
|
+
}, [currentDocId]);
|
|
271
|
+
|
|
272
|
+
console.log("CollabApiKey", CollabApiKey);
|
|
273
|
+
|
|
274
|
+
useEffect(() => {
|
|
275
|
+
if (initLexicalState && docId && !codoxStarted && CollabApiKey) {
|
|
276
|
+
setTimeout(() => {
|
|
277
|
+
startCodoxSync();
|
|
278
|
+
}, 2000);
|
|
279
|
+
}
|
|
280
|
+
}, [initLexicalState, docId, codoxStarted, CollabApiKey]);
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Initial config for Lexical Composer - init it only once
|
|
284
|
+
*/
|
|
285
|
+
const initLexicalConfig = useMemo(() => {
|
|
286
|
+
if (!initLexicalState) return;
|
|
287
|
+
return {
|
|
288
|
+
editorState:
|
|
289
|
+
initialEditorState &&
|
|
290
|
+
initialEditorState.root &&
|
|
291
|
+
initialEditorState.root.hasOwnProperty("children")
|
|
292
|
+
? JSON.stringify({ root: initialEditorState.root })
|
|
293
|
+
: JSON.stringify({ root: initLexicalState.root }), // use null as init state, when init state is fetched, it will be applied by codox
|
|
294
|
+
namespace: `Playground`, // can use own namespace name, "Playground" is for example here
|
|
295
|
+
nodes: LEXICAL_NODES_TO_REGISTER, // should wrap nodes into codox register fn
|
|
296
|
+
onError: (error) => {
|
|
297
|
+
// custom error handler, can do smth custom here
|
|
298
|
+
console.error("[Lexical Demo][Editor Error Captured]: ", error);
|
|
299
|
+
// throw error;
|
|
300
|
+
},
|
|
301
|
+
theme: PlaygroundEditorTheme, // css theme, as example, official playground theme is used
|
|
302
|
+
};
|
|
303
|
+
}, [initLexicalState]);
|
|
304
|
+
|
|
305
|
+
// const onEditorStateChange = ({ docId, state, isRemoteChange = false } = {}) => {
|
|
306
|
+
// console.log('[Lexical Demo][onEditorStateChange]: ', { docId, state, isRemoteChange });
|
|
307
|
+
// /**
|
|
308
|
+
// * Should save to database ONLY on local changes, e.g. when isRemoteChange is false
|
|
309
|
+
// */
|
|
310
|
+
// if (isRemoteChange) return;
|
|
311
|
+
// /**
|
|
312
|
+
// * IMPORTANT: THIS API CALL IS FOR DEV MODE ONLY, for testing purposes ONLY
|
|
313
|
+
// */
|
|
314
|
+
// (async () => await updateServerState(docId, state))();
|
|
315
|
+
// };
|
|
316
|
+
|
|
317
|
+
const editorStateRef = useRef(initialEditorState); // Store initial editor state in a ref
|
|
318
|
+
useEffect(() => {
|
|
319
|
+
if (!editorStateRef.current) {
|
|
320
|
+
editorStateRef.current = initialEditorState;
|
|
321
|
+
}
|
|
322
|
+
}, [initialEditorState]);
|
|
323
|
+
|
|
324
|
+
const contentChangedHookHandler = ({ source, content }) => {
|
|
325
|
+
console.log("[Lexical Demo][contentChangedHookHandler]: ", {
|
|
326
|
+
source,
|
|
327
|
+
content,
|
|
328
|
+
});
|
|
329
|
+
/**
|
|
330
|
+
* source can be one of "local", "remote"
|
|
331
|
+
* content is full lexical json state: root with comments
|
|
332
|
+
* Trigger save to db only for "local" changes
|
|
333
|
+
*/
|
|
334
|
+
// if (source === "local") {
|
|
335
|
+
// (async () => await updateServerState(currentDocId, content))();
|
|
336
|
+
// }
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
// disabled - richtext enabled by default
|
|
340
|
+
// const placeholder = <Placeholder>{isRichText ? 'Enter some rich text...' : 'Enter some plain text...'}</Placeholder>;
|
|
341
|
+
const placeholder = <Placeholder>{"Enter some plain text..."}</Placeholder>;
|
|
342
|
+
|
|
343
|
+
const [floatingAnchorElem, setFloatingAnchorElem] = useState(null);
|
|
344
|
+
const [isSmallWidthViewport, setIsSmallWidthViewport] = useState(false);
|
|
345
|
+
const [isLinkEditMode, setIsLinkEditMode] = useState(false);
|
|
346
|
+
|
|
347
|
+
const onRef = (_floatingAnchorElem) => {
|
|
348
|
+
if (_floatingAnchorElem !== null) {
|
|
349
|
+
setFloatingAnchorElem(_floatingAnchorElem);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
useEffect(() => {
|
|
354
|
+
const updateViewPortWidth = () => {
|
|
355
|
+
const isNextSmallWidthViewport =
|
|
356
|
+
CAN_USE_DOM && window.matchMedia("(max-width: 1025px)").matches;
|
|
357
|
+
|
|
358
|
+
if (isNextSmallWidthViewport !== isSmallWidthViewport) {
|
|
359
|
+
setIsSmallWidthViewport(isNextSmallWidthViewport);
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
updateViewPortWidth();
|
|
363
|
+
window.addEventListener("resize", updateViewPortWidth);
|
|
364
|
+
|
|
365
|
+
return () => {
|
|
366
|
+
window.removeEventListener("resize", updateViewPortWidth);
|
|
367
|
+
};
|
|
368
|
+
}, [isSmallWidthViewport]);
|
|
369
|
+
|
|
370
|
+
const hideRemoteCursors = () => {
|
|
371
|
+
codoxProviderRef.current.cursor.hide();
|
|
372
|
+
};
|
|
373
|
+
const showRemoteCursors = () => {
|
|
374
|
+
codoxProviderRef.current.cursor.show();
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
return (
|
|
378
|
+
<>
|
|
379
|
+
{/* <PlaygroundHeader /> */}
|
|
380
|
+
{initLexicalState && initLexicalState.root && (
|
|
381
|
+
<LexicalComposer initialConfig={initLexicalConfig} key={currentDocId}>
|
|
382
|
+
<SharedHistoryContext>
|
|
383
|
+
<TableContext>
|
|
384
|
+
<div className="editor-shell">
|
|
385
|
+
{/* <Button
|
|
386
|
+
onClick={hideRemoteCursors}
|
|
387
|
+
className={"toolbar-item.spaced"}
|
|
388
|
+
small={true}
|
|
389
|
+
>
|
|
390
|
+
Hide remote cursors
|
|
391
|
+
</Button>
|
|
392
|
+
<Button
|
|
393
|
+
onClick={showRemoteCursors}
|
|
394
|
+
className={"toolbar-item.spaced"}
|
|
395
|
+
small={true}
|
|
396
|
+
>
|
|
397
|
+
Show remote cursors
|
|
398
|
+
</Button> */}
|
|
399
|
+
<>
|
|
400
|
+
<ToolbarPlugin
|
|
401
|
+
setIsLinkEditMode={setIsLinkEditMode}
|
|
402
|
+
onlUser={onlUser}
|
|
403
|
+
/>
|
|
404
|
+
<div className={`editor-container tree-view`}>
|
|
405
|
+
<DragDropPaste />
|
|
406
|
+
<AutoFocusPlugin />
|
|
407
|
+
{/* <ClearEditorPlugin /> */}
|
|
408
|
+
<EmojiPickerPlugin />
|
|
409
|
+
<AutoEmbedPlugin />
|
|
410
|
+
|
|
411
|
+
<MentionsPlugin mentionItems={mentionItems} />
|
|
412
|
+
<EmojisPlugin />
|
|
413
|
+
<HashtagPlugin />
|
|
414
|
+
<KeywordsPlugin />
|
|
415
|
+
<AutoLinkPlugin />
|
|
416
|
+
|
|
417
|
+
<HistoryPlugin externalHistoryState={historyState} />
|
|
418
|
+
|
|
419
|
+
<RichTextPlugin
|
|
420
|
+
contentEditable={
|
|
421
|
+
<div className="editor-scroller">
|
|
422
|
+
<div className="editor" ref={onRef}>
|
|
423
|
+
<ContentEditable />
|
|
424
|
+
</div>
|
|
425
|
+
</div>
|
|
426
|
+
}
|
|
427
|
+
placeholder={placeholder}
|
|
428
|
+
ErrorBoundary={() => {}}
|
|
429
|
+
/>
|
|
430
|
+
{/* <MarkdownShortcutPlugin /> */}
|
|
431
|
+
<ListPlugin />
|
|
432
|
+
{/* <CheckListPlugin /> */}
|
|
433
|
+
<ListMaxIndentLevelPlugin maxDepth={7} />
|
|
434
|
+
<TablePlugin
|
|
435
|
+
hasCellMerge={true}
|
|
436
|
+
hasCellBackgroundColor={true}
|
|
437
|
+
/>
|
|
438
|
+
{/* <TableCellResizer /> */}
|
|
439
|
+
<ImagesPlugin />
|
|
440
|
+
{/* <InlineImagePlugin /> */}
|
|
441
|
+
<LinkPlugin />
|
|
442
|
+
{/* <PollPlugin /> */}
|
|
443
|
+
{/* <TwitterPlugin />
|
|
444
|
+
<YouTubePlugin />
|
|
445
|
+
<FigmaPlugin /> */}
|
|
446
|
+
{/* <ClickableLinkPlugin /> */}
|
|
447
|
+
{/* <HorizontalRulePlugin /> */}
|
|
448
|
+
{/* <EquationsPlugin /> */}
|
|
449
|
+
{/* <ExcalidrawPlugin /> */}
|
|
450
|
+
<TabFocusPlugin />
|
|
451
|
+
{/* <TabIndentationPlugin /> */}
|
|
452
|
+
{/* <CollapsiblePlugin /> */}
|
|
453
|
+
{/* <PageBreakPlugin /> */}
|
|
454
|
+
{/* <LayoutPlugin /> */}
|
|
455
|
+
{floatingAnchorElem && !isSmallWidthViewport && (
|
|
456
|
+
<>
|
|
457
|
+
{/* <DraggableBlockPlugin anchorElem={floatingAnchorElem} /> */}
|
|
458
|
+
{/* <FloatingLinkEditorPlugin
|
|
459
|
+
anchorElem={floatingAnchorElem}
|
|
460
|
+
isLinkEditMode={isLinkEditMode}
|
|
461
|
+
setIsLinkEditMode={setIsLinkEditMode}
|
|
462
|
+
/> */}
|
|
463
|
+
<TableCellActionMenuPlugin
|
|
464
|
+
anchorElem={floatingAnchorElem}
|
|
465
|
+
cellMerge={true}
|
|
466
|
+
/>
|
|
467
|
+
{/* <FloatingTextFormatToolbarPlugin
|
|
468
|
+
anchorElem={floatingAnchorElem}
|
|
469
|
+
/> */}
|
|
470
|
+
</>
|
|
471
|
+
)}
|
|
472
|
+
|
|
473
|
+
</div>
|
|
474
|
+
{/* <TreeViewPlugin /> */}
|
|
475
|
+
</>
|
|
476
|
+
|
|
477
|
+
<CodoxCollabPlugin
|
|
478
|
+
// CodoxCollabPlugin can be inited here or inside EditorPlugins with other plugins
|
|
479
|
+
// Important to put it inside LexicalComposer component as other plugins
|
|
480
|
+
|
|
481
|
+
ref={codoxProviderRef}
|
|
482
|
+
onBlacklistedInsert={onBlacklistedInsert} // callback to trigger when attempt to insert/paste blacklisted content combination
|
|
483
|
+
/>
|
|
484
|
+
|
|
485
|
+
<CodoxCommentPlugin />
|
|
486
|
+
{/*<CodoxExternalTestPlugin />*/}
|
|
487
|
+
|
|
488
|
+
{modal}
|
|
489
|
+
</div>
|
|
490
|
+
</TableContext>
|
|
491
|
+
</SharedHistoryContext>
|
|
492
|
+
</LexicalComposer>
|
|
493
|
+
)}
|
|
494
|
+
</>
|
|
495
|
+
);
|
|
496
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const hostName = window.location.hostname;
|
|
10
|
+
export const isDevPlayground: boolean =
|
|
11
|
+
hostName !== 'playground.lexical.dev' &&
|
|
12
|
+
hostName !== 'lexical-playground.vercel.app';
|
|
13
|
+
|
|
14
|
+
export const DEFAULT_SETTINGS = {
|
|
15
|
+
disableBeforeInput: false,
|
|
16
|
+
emptyEditor: isDevPlayground,
|
|
17
|
+
isAutocomplete: false,
|
|
18
|
+
isCharLimit: false,
|
|
19
|
+
isCharLimitUtf8: false,
|
|
20
|
+
isCollab: false,
|
|
21
|
+
isMaxLength: false,
|
|
22
|
+
isRichText: true,
|
|
23
|
+
measureTypingPerf: false,
|
|
24
|
+
shouldUseLexicalContextMenu: false,
|
|
25
|
+
showNestedEditorTreeView: false,
|
|
26
|
+
showTableOfContents: false,
|
|
27
|
+
showTreeView: true,
|
|
28
|
+
tableCellBackgroundColor: true,
|
|
29
|
+
tableCellMerge: true,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type SettingName = keyof typeof DEFAULT_SETTINGS;
|
|
33
|
+
|
|
34
|
+
export type Settings = typeof DEFAULT_SETTINGS;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// single import point of codox collab components
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
registerNodesWithCodox,
|
|
5
|
+
CodoxCollabPlugin,
|
|
6
|
+
CodoxCommentPlugin,
|
|
7
|
+
CodoxFillBGColorPlugin,
|
|
8
|
+
CodoxFontColorPlugin,
|
|
9
|
+
validateStateStructure,
|
|
10
|
+
INSERT_COMMENT,
|
|
11
|
+
} from "@codoxhq/lexical-provider";
|