@ethberry/mui-lexical 1.0.7
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/LICENSE +16 -0
- package/README.md +1 -0
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/index.js +18 -0
- package/dist/common/hooks/index.js.map +1 -0
- package/dist/common/hooks/useModal.d.ts +2 -0
- package/dist/common/hooks/useModal.js +28 -0
- package/dist/common/hooks/useModal.js.map +1 -0
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.js +19 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/types/index.d.ts +5 -0
- package/dist/common/types/index.js +3 -0
- package/dist/common/types/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +18 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/ui/Modal/index.d.ts +6 -0
- package/dist/components/ui/Modal/index.js +18 -0
- package/dist/components/ui/Modal/index.js.map +1 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +18 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/config/lexicalEditorConfig.d.ts +78 -0
- package/dist/config/lexicalEditorConfig.js +33 -0
- package/dist/config/lexicalEditorConfig.js.map +1 -0
- package/dist/config/lexicalEditorTheme.d.ts +68 -0
- package/dist/config/lexicalEditorTheme.js +71 -0
- package/dist/config/lexicalEditorTheme.js.map +1 -0
- package/dist/display/index.d.ts +6 -0
- package/dist/display/index.js +47 -0
- package/dist/display/index.js.map +1 -0
- package/dist/display/styled.d.ts +1 -0
- package/dist/display/styled.js +67 -0
- package/dist/display/styled.js.map +1 -0
- package/dist/editor/Editor.d.ts +16 -0
- package/dist/editor/Editor.js +95 -0
- package/dist/editor/Editor.js.map +1 -0
- package/dist/editor/Editor.stories.d.ts +13 -0
- package/dist/editor/Editor.stories.js +135 -0
- package/dist/editor/Editor.stories.js.map +1 -0
- package/dist/editor/commands/index.d.ts +4 -0
- package/dist/editor/commands/index.js +6 -0
- package/dist/editor/commands/index.js.map +1 -0
- package/dist/editor/constants/index.d.ts +2 -0
- package/dist/editor/constants/index.js +40 -0
- package/dist/editor/constants/index.js.map +1 -0
- package/dist/editor/context/SharedHistoryContext.d.ts +11 -0
- package/dist/editor/context/SharedHistoryContext.js +17 -0
- package/dist/editor/context/SharedHistoryContext.js.map +1 -0
- package/dist/editor/context/ToolbarContext.d.ts +56 -0
- package/dist/editor/context/ToolbarContext.js +67 -0
- package/dist/editor/context/ToolbarContext.js.map +1 -0
- package/dist/editor/context/index.d.ts +2 -0
- package/dist/editor/context/index.js +19 -0
- package/dist/editor/context/index.js.map +1 -0
- package/dist/editor/editorStyles.d.ts +1 -0
- package/dist/editor/editorStyles.js +1273 -0
- package/dist/editor/editorStyles.js.map +1 -0
- package/dist/editor/hooks/index.d.ts +1 -0
- package/dist/editor/hooks/index.js +18 -0
- package/dist/editor/hooks/index.js.map +1 -0
- package/dist/editor/hooks/useModal.d.ts +2 -0
- package/dist/editor/hooks/useModal.js +29 -0
- package/dist/editor/hooks/useModal.js.map +1 -0
- package/dist/editor/images/icons/3-columns.d.ts +1 -0
- package/dist/editor/images/icons/3-columns.js +9 -0
- package/dist/editor/images/icons/3-columns.js.map +1 -0
- package/dist/editor/images/icons/add-sign.d.ts +1 -0
- package/dist/editor/images/icons/add-sign.js +9 -0
- package/dist/editor/images/icons/add-sign.js.map +1 -0
- package/dist/editor/images/icons/arrow-clockwise.d.ts +1 -0
- package/dist/editor/images/icons/arrow-clockwise.js +9 -0
- package/dist/editor/images/icons/arrow-clockwise.js.map +1 -0
- package/dist/editor/images/icons/arrow-counterclockwise.d.ts +1 -0
- package/dist/editor/images/icons/arrow-counterclockwise.js +9 -0
- package/dist/editor/images/icons/arrow-counterclockwise.js.map +1 -0
- package/dist/editor/images/icons/bg-color.d.ts +1 -0
- package/dist/editor/images/icons/bg-color.js +9 -0
- package/dist/editor/images/icons/bg-color.js.map +1 -0
- package/dist/editor/images/icons/camera.d.ts +1 -0
- package/dist/editor/images/icons/camera.js +9 -0
- package/dist/editor/images/icons/camera.js.map +1 -0
- package/dist/editor/images/icons/card-checklist.d.ts +1 -0
- package/dist/editor/images/icons/card-checklist.js +9 -0
- package/dist/editor/images/icons/card-checklist.js.map +1 -0
- package/dist/editor/images/icons/caret-right-fill.d.ts +1 -0
- package/dist/editor/images/icons/caret-right-fill.js +9 -0
- package/dist/editor/images/icons/caret-right-fill.js.map +1 -0
- package/dist/editor/images/icons/chat-left-text.d.ts +1 -0
- package/dist/editor/images/icons/chat-left-text.js +9 -0
- package/dist/editor/images/icons/chat-left-text.js.map +1 -0
- package/dist/editor/images/icons/chat-right-dots.d.ts +1 -0
- package/dist/editor/images/icons/chat-right-dots.js +9 -0
- package/dist/editor/images/icons/chat-right-dots.js.map +1 -0
- package/dist/editor/images/icons/chat-right-text.d.ts +1 -0
- package/dist/editor/images/icons/chat-right-text.js +9 -0
- package/dist/editor/images/icons/chat-right-text.js.map +1 -0
- package/dist/editor/images/icons/chat-right.d.ts +1 -0
- package/dist/editor/images/icons/chat-right.js +9 -0
- package/dist/editor/images/icons/chat-right.js.map +1 -0
- package/dist/editor/images/icons/chat-square-quote.d.ts +1 -0
- package/dist/editor/images/icons/chat-square-quote.js +9 -0
- package/dist/editor/images/icons/chat-square-quote.js.map +1 -0
- package/dist/editor/images/icons/chevron-down.d.ts +1 -0
- package/dist/editor/images/icons/chevron-down.js +9 -0
- package/dist/editor/images/icons/chevron-down.js.map +1 -0
- package/dist/editor/images/icons/clipboard.d.ts +1 -0
- package/dist/editor/images/icons/clipboard.js +9 -0
- package/dist/editor/images/icons/clipboard.js.map +1 -0
- package/dist/editor/images/icons/close.d.ts +1 -0
- package/dist/editor/images/icons/close.js +9 -0
- package/dist/editor/images/icons/close.js.map +1 -0
- package/dist/editor/images/icons/code.d.ts +1 -0
- package/dist/editor/images/icons/code.js +9 -0
- package/dist/editor/images/icons/code.js.map +1 -0
- package/dist/editor/images/icons/comments.d.ts +1 -0
- package/dist/editor/images/icons/comments.js +9 -0
- package/dist/editor/images/icons/comments.js.map +1 -0
- package/dist/editor/images/icons/copy.d.ts +1 -0
- package/dist/editor/images/icons/copy.js +9 -0
- package/dist/editor/images/icons/copy.js.map +1 -0
- package/dist/editor/images/icons/diagram-2.d.ts +1 -0
- package/dist/editor/images/icons/diagram-2.js +9 -0
- package/dist/editor/images/icons/diagram-2.js.map +1 -0
- package/dist/editor/images/icons/download.d.ts +1 -0
- package/dist/editor/images/icons/download.js +9 -0
- package/dist/editor/images/icons/download.js.map +1 -0
- package/dist/editor/images/icons/draggable-block-menu.d.ts +1 -0
- package/dist/editor/images/icons/draggable-block-menu.js +9 -0
- package/dist/editor/images/icons/draggable-block-menu.js.map +1 -0
- package/dist/editor/images/icons/dropdown-more.d.ts +1 -0
- package/dist/editor/images/icons/dropdown-more.js +9 -0
- package/dist/editor/images/icons/dropdown-more.js.map +1 -0
- package/dist/editor/images/icons/figma.d.ts +1 -0
- package/dist/editor/images/icons/figma.js +9 -0
- package/dist/editor/images/icons/figma.js.map +1 -0
- package/dist/editor/images/icons/file-earmark-text.d.ts +1 -0
- package/dist/editor/images/icons/file-earmark-text.js +9 -0
- package/dist/editor/images/icons/file-earmark-text.js.map +1 -0
- package/dist/editor/images/icons/file-image.d.ts +1 -0
- package/dist/editor/images/icons/file-image.js +9 -0
- package/dist/editor/images/icons/file-image.js.map +1 -0
- package/dist/editor/images/icons/filetype-gif.d.ts +1 -0
- package/dist/editor/images/icons/filetype-gif.js +9 -0
- package/dist/editor/images/icons/filetype-gif.js.map +1 -0
- package/dist/editor/images/icons/font-color.d.ts +1 -0
- package/dist/editor/images/icons/font-color.js +9 -0
- package/dist/editor/images/icons/font-color.js.map +1 -0
- package/dist/editor/images/icons/font-family.d.ts +1 -0
- package/dist/editor/images/icons/font-family.js +9 -0
- package/dist/editor/images/icons/font-family.js.map +1 -0
- package/dist/editor/images/icons/format-clear.d.ts +1 -0
- package/dist/editor/images/icons/format-clear.js +9 -0
- package/dist/editor/images/icons/format-clear.js.map +1 -0
- package/dist/editor/images/icons/highlighter.d.ts +1 -0
- package/dist/editor/images/icons/highlighter.js +9 -0
- package/dist/editor/images/icons/highlighter.js.map +1 -0
- package/dist/editor/images/icons/horizontal-rule.d.ts +1 -0
- package/dist/editor/images/icons/horizontal-rule.js +9 -0
- package/dist/editor/images/icons/horizontal-rule.js.map +1 -0
- package/dist/editor/images/icons/indent.d.ts +1 -0
- package/dist/editor/images/icons/indent.js +9 -0
- package/dist/editor/images/icons/indent.js.map +1 -0
- package/dist/editor/images/icons/index.d.ts +88 -0
- package/dist/editor/images/icons/index.js +105 -0
- package/dist/editor/images/icons/index.js.map +1 -0
- package/dist/editor/images/icons/journal-text.d.ts +1 -0
- package/dist/editor/images/icons/journal-text.js +9 -0
- package/dist/editor/images/icons/journal-text.js.map +1 -0
- package/dist/editor/images/icons/justify.d.ts +1 -0
- package/dist/editor/images/icons/justify.js +9 -0
- package/dist/editor/images/icons/justify.js.map +1 -0
- package/dist/editor/images/icons/link.d.ts +1 -0
- package/dist/editor/images/icons/link.js +9 -0
- package/dist/editor/images/icons/link.js.map +1 -0
- package/dist/editor/images/icons/list-ol.d.ts +1 -0
- package/dist/editor/images/icons/list-ol.js +9 -0
- package/dist/editor/images/icons/list-ol.js.map +1 -0
- package/dist/editor/images/icons/list-ul.d.ts +1 -0
- package/dist/editor/images/icons/list-ul.js +9 -0
- package/dist/editor/images/icons/list-ul.js.map +1 -0
- package/dist/editor/images/icons/lock-fill.d.ts +1 -0
- package/dist/editor/images/icons/lock-fill.js +9 -0
- package/dist/editor/images/icons/lock-fill.js.map +1 -0
- package/dist/editor/images/icons/lock.d.ts +1 -0
- package/dist/editor/images/icons/lock.js +9 -0
- package/dist/editor/images/icons/lock.js.map +1 -0
- package/dist/editor/images/icons/markdown.d.ts +1 -0
- package/dist/editor/images/icons/markdown.js +9 -0
- package/dist/editor/images/icons/markdown.js.map +1 -0
- package/dist/editor/images/icons/mic.d.ts +1 -0
- package/dist/editor/images/icons/mic.js +9 -0
- package/dist/editor/images/icons/mic.js.map +1 -0
- package/dist/editor/images/icons/minus-sign.d.ts +1 -0
- package/dist/editor/images/icons/minus-sign.js +9 -0
- package/dist/editor/images/icons/minus-sign.js.map +1 -0
- package/dist/editor/images/icons/outdent.d.ts +1 -0
- package/dist/editor/images/icons/outdent.js +9 -0
- package/dist/editor/images/icons/outdent.js.map +1 -0
- package/dist/editor/images/icons/paint-bucket.d.ts +1 -0
- package/dist/editor/images/icons/paint-bucket.js +9 -0
- package/dist/editor/images/icons/paint-bucket.js.map +1 -0
- package/dist/editor/images/icons/palette.d.ts +1 -0
- package/dist/editor/images/icons/palette.js +9 -0
- package/dist/editor/images/icons/palette.js.map +1 -0
- package/dist/editor/images/icons/pencil-fill.d.ts +1 -0
- package/dist/editor/images/icons/pencil-fill.js +9 -0
- package/dist/editor/images/icons/pencil-fill.js.map +1 -0
- package/dist/editor/images/icons/plug-fill.d.ts +1 -0
- package/dist/editor/images/icons/plug-fill.js +9 -0
- package/dist/editor/images/icons/plug-fill.js.map +1 -0
- package/dist/editor/images/icons/plug.d.ts +1 -0
- package/dist/editor/images/icons/plug.js +9 -0
- package/dist/editor/images/icons/plug.js.map +1 -0
- package/dist/editor/images/icons/plus-slash-minus.d.ts +1 -0
- package/dist/editor/images/icons/plus-slash-minus.js +9 -0
- package/dist/editor/images/icons/plus-slash-minus.js.map +1 -0
- package/dist/editor/images/icons/plus.d.ts +1 -0
- package/dist/editor/images/icons/plus.js +9 -0
- package/dist/editor/images/icons/plus.js.map +1 -0
- package/dist/editor/images/icons/prettier-error.d.ts +1 -0
- package/dist/editor/images/icons/prettier-error.js +9 -0
- package/dist/editor/images/icons/prettier-error.js.map +1 -0
- package/dist/editor/images/icons/prettier.d.ts +1 -0
- package/dist/editor/images/icons/prettier.js +9 -0
- package/dist/editor/images/icons/prettier.js.map +1 -0
- package/dist/editor/images/icons/scissors.d.ts +1 -0
- package/dist/editor/images/icons/scissors.js +9 -0
- package/dist/editor/images/icons/scissors.js.map +1 -0
- package/dist/editor/images/icons/send.d.ts +1 -0
- package/dist/editor/images/icons/send.js +9 -0
- package/dist/editor/images/icons/send.js.map +1 -0
- package/dist/editor/images/icons/square-check.d.ts +1 -0
- package/dist/editor/images/icons/square-check.js +9 -0
- package/dist/editor/images/icons/square-check.js.map +1 -0
- package/dist/editor/images/icons/sticky.d.ts +1 -0
- package/dist/editor/images/icons/sticky.js +9 -0
- package/dist/editor/images/icons/sticky.js.map +1 -0
- package/dist/editor/images/icons/success-alt.d.ts +1 -0
- package/dist/editor/images/icons/success-alt.js +9 -0
- package/dist/editor/images/icons/success-alt.js.map +1 -0
- package/dist/editor/images/icons/success.d.ts +1 -0
- package/dist/editor/images/icons/success.js +9 -0
- package/dist/editor/images/icons/success.js.map +1 -0
- package/dist/editor/images/icons/table.d.ts +1 -0
- package/dist/editor/images/icons/table.js +9 -0
- package/dist/editor/images/icons/table.js.map +1 -0
- package/dist/editor/images/icons/text-center.d.ts +1 -0
- package/dist/editor/images/icons/text-center.js +9 -0
- package/dist/editor/images/icons/text-center.js.map +1 -0
- package/dist/editor/images/icons/text-left.d.ts +1 -0
- package/dist/editor/images/icons/text-left.js +9 -0
- package/dist/editor/images/icons/text-left.js.map +1 -0
- package/dist/editor/images/icons/text-paragraph.d.ts +1 -0
- package/dist/editor/images/icons/text-paragraph.js +9 -0
- package/dist/editor/images/icons/text-paragraph.js.map +1 -0
- package/dist/editor/images/icons/text-right.d.ts +1 -0
- package/dist/editor/images/icons/text-right.js +9 -0
- package/dist/editor/images/icons/text-right.js.map +1 -0
- package/dist/editor/images/icons/trash.d.ts +1 -0
- package/dist/editor/images/icons/trash.js +9 -0
- package/dist/editor/images/icons/trash.js.map +1 -0
- package/dist/editor/images/icons/trash3.d.ts +1 -0
- package/dist/editor/images/icons/trash3.js +9 -0
- package/dist/editor/images/icons/trash3.js.map +1 -0
- package/dist/editor/images/icons/type-bold.d.ts +1 -0
- package/dist/editor/images/icons/type-bold.js +9 -0
- package/dist/editor/images/icons/type-bold.js.map +1 -0
- package/dist/editor/images/icons/type-capitalize.d.ts +1 -0
- package/dist/editor/images/icons/type-capitalize.js +9 -0
- package/dist/editor/images/icons/type-capitalize.js.map +1 -0
- package/dist/editor/images/icons/type-h1.d.ts +1 -0
- package/dist/editor/images/icons/type-h1.js +9 -0
- package/dist/editor/images/icons/type-h1.js.map +1 -0
- package/dist/editor/images/icons/type-h2.d.ts +1 -0
- package/dist/editor/images/icons/type-h2.js +9 -0
- package/dist/editor/images/icons/type-h2.js.map +1 -0
- package/dist/editor/images/icons/type-h3.d.ts +1 -0
- package/dist/editor/images/icons/type-h3.js +9 -0
- package/dist/editor/images/icons/type-h3.js.map +1 -0
- package/dist/editor/images/icons/type-h4.d.ts +1 -0
- package/dist/editor/images/icons/type-h4.js +9 -0
- package/dist/editor/images/icons/type-h4.js.map +1 -0
- package/dist/editor/images/icons/type-h5.d.ts +1 -0
- package/dist/editor/images/icons/type-h5.js +9 -0
- package/dist/editor/images/icons/type-h5.js.map +1 -0
- package/dist/editor/images/icons/type-h6.d.ts +1 -0
- package/dist/editor/images/icons/type-h6.js +9 -0
- package/dist/editor/images/icons/type-h6.js.map +1 -0
- package/dist/editor/images/icons/type-italic.d.ts +1 -0
- package/dist/editor/images/icons/type-italic.js +9 -0
- package/dist/editor/images/icons/type-italic.js.map +1 -0
- package/dist/editor/images/icons/type-lowercase.d.ts +1 -0
- package/dist/editor/images/icons/type-lowercase.js +9 -0
- package/dist/editor/images/icons/type-lowercase.js.map +1 -0
- package/dist/editor/images/icons/type-strikethrough.d.ts +1 -0
- package/dist/editor/images/icons/type-strikethrough.js +9 -0
- package/dist/editor/images/icons/type-strikethrough.js.map +1 -0
- package/dist/editor/images/icons/type-subscript.d.ts +1 -0
- package/dist/editor/images/icons/type-subscript.js +9 -0
- package/dist/editor/images/icons/type-subscript.js.map +1 -0
- package/dist/editor/images/icons/type-superscript.d.ts +1 -0
- package/dist/editor/images/icons/type-superscript.js +9 -0
- package/dist/editor/images/icons/type-superscript.js.map +1 -0
- package/dist/editor/images/icons/type-underline.d.ts +1 -0
- package/dist/editor/images/icons/type-underline.js +9 -0
- package/dist/editor/images/icons/type-underline.js.map +1 -0
- package/dist/editor/images/icons/type-uppercase.d.ts +1 -0
- package/dist/editor/images/icons/type-uppercase.js +9 -0
- package/dist/editor/images/icons/type-uppercase.js.map +1 -0
- package/dist/editor/images/icons/upload.d.ts +1 -0
- package/dist/editor/images/icons/upload.js +9 -0
- package/dist/editor/images/icons/upload.js.map +1 -0
- package/dist/editor/images/icons/user.d.ts +1 -0
- package/dist/editor/images/icons/user.js +9 -0
- package/dist/editor/images/icons/user.js.map +1 -0
- package/dist/editor/images/icons/vertical-bottom.d.ts +1 -0
- package/dist/editor/images/icons/vertical-bottom.js +9 -0
- package/dist/editor/images/icons/vertical-bottom.js.map +1 -0
- package/dist/editor/images/icons/vertical-middle.d.ts +1 -0
- package/dist/editor/images/icons/vertical-middle.js +9 -0
- package/dist/editor/images/icons/vertical-middle.js.map +1 -0
- package/dist/editor/images/icons/vertical-top.d.ts +1 -0
- package/dist/editor/images/icons/vertical-top.js +9 -0
- package/dist/editor/images/icons/vertical-top.js.map +1 -0
- package/dist/editor/images/icons/x.d.ts +1 -0
- package/dist/editor/images/icons/x.js +9 -0
- package/dist/editor/images/icons/x.js.map +1 -0
- package/dist/editor/images/icons/youtube.d.ts +1 -0
- package/dist/editor/images/icons/youtube.js +9 -0
- package/dist/editor/images/icons/youtube.js.map +1 -0
- package/dist/editor/index.d.ts +1 -0
- package/dist/editor/index.js +6 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor/nodes/Image/ImageComponent.d.ts +15 -0
- package/dist/editor/nodes/Image/ImageComponent.js +248 -0
- package/dist/editor/nodes/Image/ImageComponent.js.map +1 -0
- package/dist/editor/nodes/Image/ImageNode.d.ts +50 -0
- package/dist/editor/nodes/Image/ImageNode.js +128 -0
- package/dist/editor/nodes/Image/ImageNode.js.map +1 -0
- package/dist/editor/nodes/Image/imageNodeStyles.d.ts +1 -0
- package/dist/editor/nodes/Image/imageNodeStyles.js +41 -0
- package/dist/editor/nodes/Image/imageNodeStyles.js.map +1 -0
- package/dist/editor/nodes/Image/index.d.ts +3 -0
- package/dist/editor/nodes/Image/index.js +10 -0
- package/dist/editor/nodes/Image/index.js.map +1 -0
- package/dist/editor/nodes/InlineImage/InlineImageComponent.d.ts +18 -0
- package/dist/editor/nodes/InlineImage/InlineImageComponent.js +160 -0
- package/dist/editor/nodes/InlineImage/InlineImageComponent.js.map +1 -0
- package/dist/editor/nodes/InlineImage/InlineImageNode.d.ts +59 -0
- package/dist/editor/nodes/InlineImage/InlineImageNode.js +149 -0
- package/dist/editor/nodes/InlineImage/InlineImageNode.js.map +1 -0
- package/dist/editor/nodes/InlineImage/index.d.ts +3 -0
- package/dist/editor/nodes/InlineImage/index.js +10 -0
- package/dist/editor/nodes/InlineImage/index.js.map +1 -0
- package/dist/editor/nodes/InlineImage/inlineImageNodeStyles.d.ts +1 -0
- package/dist/editor/nodes/InlineImage/inlineImageNodeStyles.js +90 -0
- package/dist/editor/nodes/InlineImage/inlineImageNodeStyles.js.map +1 -0
- package/dist/editor/nodes/PlaygroundNodes.d.ts +2 -0
- package/dist/editor/nodes/PlaygroundNodes.js +32 -0
- package/dist/editor/nodes/PlaygroundNodes.js.map +1 -0
- package/dist/editor/nodes/Video/VideoComponent.d.ts +9 -0
- package/dist/editor/nodes/Video/VideoComponent.js +15 -0
- package/dist/editor/nodes/Video/VideoComponent.js.map +1 -0
- package/dist/editor/nodes/Video/VideoNode.d.ts +34 -0
- package/dist/editor/nodes/Video/VideoNode.js +129 -0
- package/dist/editor/nodes/Video/VideoNode.js.map +1 -0
- package/dist/editor/nodes/Video/index.d.ts +3 -0
- package/dist/editor/nodes/Video/index.js +10 -0
- package/dist/editor/nodes/Video/index.js.map +1 -0
- package/dist/editor/nodes/Video/videoNodeStyles.d.ts +1 -0
- package/dist/editor/nodes/Video/videoNodeStyles.js +44 -0
- package/dist/editor/nodes/Video/videoNodeStyles.js.map +1 -0
- package/dist/editor/nodes/index.d.ts +4 -0
- package/dist/editor/nodes/index.js +21 -0
- package/dist/editor/nodes/index.js.map +1 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/codeActionMenuPluginStyles.d.ts +1 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/codeActionMenuPluginStyles.js +68 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/codeActionMenuPluginStyles.js.map +1 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +7 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +48 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.js.map +1 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +9 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js +136 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js.map +1 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/components/index.d.ts +2 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/components/index.js +19 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/components/index.js.map +1 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/index.d.ts +12 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/index.js +118 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/index.js.map +1 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/utils.d.ts +1 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/utils.js +15 -0
- package/dist/editor/plugins/CodeActionMenuPlugin/utils.js.map +1 -0
- package/dist/editor/plugins/CodeHighlightPlugin/index.d.ts +2 -0
- package/dist/editor/plugins/CodeHighlightPlugin/index.js +15 -0
- package/dist/editor/plugins/CodeHighlightPlugin/index.js.map +1 -0
- package/dist/editor/plugins/ComponentPickerPlugin/index.d.ts +9 -0
- package/dist/editor/plugins/ComponentPickerPlugin/index.js +217 -0
- package/dist/editor/plugins/ComponentPickerPlugin/index.js.map +1 -0
- package/dist/editor/plugins/ContextMenuPlugin/index.d.ts +18 -0
- package/dist/editor/plugins/ContextMenuPlugin/index.js +190 -0
- package/dist/editor/plugins/ContextMenuPlugin/index.js.map +1 -0
- package/dist/editor/plugins/FloatingLinkEditorPlugin/floatLinkEditorPluginStyles.d.ts +1 -0
- package/dist/editor/plugins/FloatingLinkEditorPlugin/floatLinkEditorPluginStyles.js +48 -0
- package/dist/editor/plugins/FloatingLinkEditorPlugin/floatLinkEditorPluginStyles.js.map +1 -0
- package/dist/editor/plugins/FloatingLinkEditorPlugin/index.d.ts +14 -0
- package/dist/editor/plugins/FloatingLinkEditorPlugin/index.js +275 -0
- package/dist/editor/plugins/FloatingLinkEditorPlugin/index.js.map +1 -0
- package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/floatTextFormatToolbarPluginStyles.d.ts +1 -0
- package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/floatTextFormatToolbarPluginStyles.js +141 -0
- package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/floatTextFormatToolbarPluginStyles.js.map +1 -0
- package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +15 -0
- package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/index.js +214 -0
- package/dist/editor/plugins/FloatingTextFormatToolbarPlugin/index.js.map +1 -0
- package/dist/editor/plugins/ImagesPlugin/index.d.ts +28 -0
- package/dist/editor/plugins/ImagesPlugin/index.js +175 -0
- package/dist/editor/plugins/ImagesPlugin/index.js.map +1 -0
- package/dist/editor/plugins/LinkPlugin/index.d.ts +9 -0
- package/dist/editor/plugins/LinkPlugin/index.js +14 -0
- package/dist/editor/plugins/LinkPlugin/index.js.map +1 -0
- package/dist/editor/plugins/MarkdownShortcutPlugin/index.d.ts +9 -0
- package/dist/editor/plugins/MarkdownShortcutPlugin/index.js +11 -0
- package/dist/editor/plugins/MarkdownShortcutPlugin/index.js.map +1 -0
- package/dist/editor/plugins/MarkdownTransformers/index.d.ts +5 -0
- package/dist/editor/plugins/MarkdownTransformers/index.js +181 -0
- package/dist/editor/plugins/MarkdownTransformers/index.js.map +1 -0
- package/dist/editor/plugins/MaxLengthPlugin/index.d.ts +10 -0
- package/dist/editor/plugins/MaxLengthPlugin/index.js +48 -0
- package/dist/editor/plugins/MaxLengthPlugin/index.js.map +1 -0
- package/dist/editor/plugins/ShortcutsPlugin/index.d.ts +13 -0
- package/dist/editor/plugins/ShortcutsPlugin/index.js +102 -0
- package/dist/editor/plugins/ShortcutsPlugin/index.js.map +1 -0
- package/dist/editor/plugins/ShortcutsPlugin/shortcuts.d.ts +56 -0
- package/dist/editor/plugins/ShortcutsPlugin/shortcuts.js +145 -0
- package/dist/editor/plugins/ShortcutsPlugin/shortcuts.js.map +1 -0
- package/dist/editor/plugins/TabFocusPlugin/index.d.ts +8 -0
- package/dist/editor/plugins/TabFocusPlugin/index.js +46 -0
- package/dist/editor/plugins/TabFocusPlugin/index.js.map +1 -0
- package/dist/editor/plugins/TableActionMenuPlugin/index.d.ts +12 -0
- package/dist/editor/plugins/TableActionMenuPlugin/index.js +371 -0
- package/dist/editor/plugins/TableActionMenuPlugin/index.js.map +1 -0
- package/dist/editor/plugins/TableCellResizer/index.d.ts +3 -0
- package/dist/editor/plugins/TableCellResizer/index.js +301 -0
- package/dist/editor/plugins/TableCellResizer/index.js.map +1 -0
- package/dist/editor/plugins/TableCellResizer/tableCellResizerPluginStyles.d.ts +1 -0
- package/dist/editor/plugins/TableCellResizer/tableCellResizerPluginStyles.js +18 -0
- package/dist/editor/plugins/TableCellResizer/tableCellResizerPluginStyles.js.map +1 -0
- package/dist/editor/plugins/TableHoverActionsPlugin/index.d.ts +11 -0
- package/dist/editor/plugins/TableHoverActionsPlugin/index.js +193 -0
- package/dist/editor/plugins/TableHoverActionsPlugin/index.js.map +1 -0
- package/dist/editor/plugins/TablePlugin.d.ts +38 -0
- package/dist/editor/plugins/TablePlugin.js +77 -0
- package/dist/editor/plugins/TablePlugin.js.map +1 -0
- package/dist/editor/plugins/ToolbarPlugin/index.d.ts +19 -0
- package/dist/editor/plugins/ToolbarPlugin/index.js +199 -0
- package/dist/editor/plugins/ToolbarPlugin/index.js.map +1 -0
- package/dist/editor/plugins/ToolbarPlugin/utils.d.ts +22 -0
- package/dist/editor/plugins/ToolbarPlugin/utils.js +224 -0
- package/dist/editor/plugins/ToolbarPlugin/utils.js.map +1 -0
- package/dist/editor/plugins/VideoPlugin/index.d.ts +7 -0
- package/dist/editor/plugins/VideoPlugin/index.js +61 -0
- package/dist/editor/plugins/VideoPlugin/index.js.map +1 -0
- package/dist/editor/plugins/index.d.ts +19 -0
- package/dist/editor/plugins/index.js +36 -0
- package/dist/editor/plugins/index.js.map +1 -0
- package/dist/editor/themes/index.d.ts +1 -0
- package/dist/editor/themes/index.js +6 -0
- package/dist/editor/themes/index.js.map +1 -0
- package/dist/editor/themes/playgroundEditorTheme.d.ts +2 -0
- package/dist/editor/themes/playgroundEditorTheme.js +116 -0
- package/dist/editor/themes/playgroundEditorTheme.js.map +1 -0
- package/dist/editor/themes/playgroundEditorThemeStyles.d.ts +1 -0
- package/dist/editor/themes/playgroundEditorThemeStyles.js +702 -0
- package/dist/editor/themes/playgroundEditorThemeStyles.js.map +1 -0
- package/dist/editor/types/index.d.ts +19 -0
- package/dist/editor/types/index.js +3 -0
- package/dist/editor/types/index.js.map +1 -0
- package/dist/editor/ui/BlockFormatDropdown/index.d.ts +18 -0
- package/dist/editor/ui/BlockFormatDropdown/index.js +73 -0
- package/dist/editor/ui/BlockFormatDropdown/index.js.map +1 -0
- package/dist/editor/ui/BoldButton/index.d.ts +7 -0
- package/dist/editor/ui/BoldButton/index.js +14 -0
- package/dist/editor/ui/BoldButton/index.js.map +1 -0
- package/dist/editor/ui/Button.d.ts +12 -0
- package/dist/editor/ui/Button.js +38 -0
- package/dist/editor/ui/Button.js.map +1 -0
- package/dist/editor/ui/CenterAlignButton/index.d.ts +7 -0
- package/dist/editor/ui/CenterAlignButton/index.js +14 -0
- package/dist/editor/ui/CenterAlignButton/index.js.map +1 -0
- package/dist/editor/ui/ClearEditorButton/index.d.ts +7 -0
- package/dist/editor/ui/ClearEditorButton/index.js +10 -0
- package/dist/editor/ui/ClearEditorButton/index.js.map +1 -0
- package/dist/editor/ui/ClearFormattingButton/index.d.ts +7 -0
- package/dist/editor/ui/ClearFormattingButton/index.js +10 -0
- package/dist/editor/ui/ClearFormattingButton/index.js.map +1 -0
- package/dist/editor/ui/CodeButton/index.d.ts +7 -0
- package/dist/editor/ui/CodeButton/index.js +14 -0
- package/dist/editor/ui/CodeButton/index.js.map +1 -0
- package/dist/editor/ui/CodeLanguageDropdown/index.d.ts +10 -0
- package/dist/editor/ui/CodeLanguageDropdown/index.js +26 -0
- package/dist/editor/ui/CodeLanguageDropdown/index.js.map +1 -0
- package/dist/editor/ui/ContentEditable.d.ts +9 -0
- package/dist/editor/ui/ContentEditable.js +63 -0
- package/dist/editor/ui/ContentEditable.js.map +1 -0
- package/dist/editor/ui/Dialog.d.ts +10 -0
- package/dist/editor/ui/Dialog.js +33 -0
- package/dist/editor/ui/Dialog.js.map +1 -0
- package/dist/editor/ui/Divider/index.d.ts +2 -0
- package/dist/editor/ui/Divider/index.js +9 -0
- package/dist/editor/ui/Divider/index.js.map +1 -0
- package/dist/editor/ui/DropDown.d.ts +16 -0
- package/dist/editor/ui/DropDown.js +141 -0
- package/dist/editor/ui/DropDown.js.map +1 -0
- package/dist/editor/ui/FlashMessage.d.ts +6 -0
- package/dist/editor/ui/FlashMessage.js +32 -0
- package/dist/editor/ui/FlashMessage.js.map +1 -0
- package/dist/editor/ui/HorizontalRuleButton/index.d.ts +3 -0
- package/dist/editor/ui/HorizontalRuleButton/index.js +13 -0
- package/dist/editor/ui/HorizontalRuleButton/index.js.map +1 -0
- package/dist/editor/ui/ImageButton/index.d.ts +8 -0
- package/dist/editor/ui/ImageButton/index.js +13 -0
- package/dist/editor/ui/ImageButton/index.js.map +1 -0
- package/dist/editor/ui/ImageResizer.d.ts +17 -0
- package/dist/editor/ui/ImageResizer.js +174 -0
- package/dist/editor/ui/ImageResizer.js.map +1 -0
- package/dist/editor/ui/ItalicButton/index.d.ts +7 -0
- package/dist/editor/ui/ItalicButton/index.js +14 -0
- package/dist/editor/ui/ItalicButton/index.js.map +1 -0
- package/dist/editor/ui/LeftAlignButton/index.d.ts +7 -0
- package/dist/editor/ui/LeftAlignButton/index.js +14 -0
- package/dist/editor/ui/LeftAlignButton/index.js.map +1 -0
- package/dist/editor/ui/LinkButton/index.d.ts +8 -0
- package/dist/editor/ui/LinkButton/index.js +11 -0
- package/dist/editor/ui/LinkButton/index.js.map +1 -0
- package/dist/editor/ui/Modal.d.ts +9 -0
- package/dist/editor/ui/Modal.js +110 -0
- package/dist/editor/ui/Modal.js.map +1 -0
- package/dist/editor/ui/RedoButton/index.d.ts +3 -0
- package/dist/editor/ui/RedoButton/index.js +14 -0
- package/dist/editor/ui/RedoButton/index.js.map +1 -0
- package/dist/editor/ui/RightAlignButton/index.d.ts +7 -0
- package/dist/editor/ui/RightAlignButton/index.js +14 -0
- package/dist/editor/ui/RightAlignButton/index.js.map +1 -0
- package/dist/editor/ui/Select.d.ts +8 -0
- package/dist/editor/ui/Select.js +52 -0
- package/dist/editor/ui/Select.js.map +1 -0
- package/dist/editor/ui/StrikethroughButton/index.d.ts +7 -0
- package/dist/editor/ui/StrikethroughButton/index.js +14 -0
- package/dist/editor/ui/StrikethroughButton/index.js.map +1 -0
- package/dist/editor/ui/TableButton/index.d.ts +8 -0
- package/dist/editor/ui/TableButton/index.js +13 -0
- package/dist/editor/ui/TableButton/index.js.map +1 -0
- package/dist/editor/ui/TextInput.d.ts +13 -0
- package/dist/editor/ui/TextInput.js +36 -0
- package/dist/editor/ui/TextInput.js.map +1 -0
- package/dist/editor/ui/UnderlineButton/index.d.ts +7 -0
- package/dist/editor/ui/UnderlineButton/index.js +14 -0
- package/dist/editor/ui/UnderlineButton/index.js.map +1 -0
- package/dist/editor/ui/UndoButton/index.d.ts +3 -0
- package/dist/editor/ui/UndoButton/index.js +14 -0
- package/dist/editor/ui/UndoButton/index.js.map +1 -0
- package/dist/editor/ui/VideoButton/index.d.ts +8 -0
- package/dist/editor/ui/VideoButton/index.js +13 -0
- package/dist/editor/ui/VideoButton/index.js.map +1 -0
- package/dist/editor/ui/index.d.ts +30 -0
- package/dist/editor/ui/index.js +74 -0
- package/dist/editor/ui/index.js.map +1 -0
- package/dist/editor/utils/dropDownActiveClass.d.ts +1 -0
- package/dist/editor/utils/dropDownActiveClass.js +12 -0
- package/dist/editor/utils/dropDownActiveClass.js.map +1 -0
- package/dist/editor/utils/getDOMRangeRect.d.ts +1 -0
- package/dist/editor/utils/getDOMRangeRect.js +19 -0
- package/dist/editor/utils/getDOMRangeRect.js.map +1 -0
- package/dist/editor/utils/getSelectedNode.d.ts +2 -0
- package/dist/editor/utils/getSelectedNode.js +21 -0
- package/dist/editor/utils/getSelectedNode.js.map +1 -0
- package/dist/editor/utils/getThemeSelector.d.ts +2 -0
- package/dist/editor/utils/getThemeSelector.js +15 -0
- package/dist/editor/utils/getThemeSelector.js.map +1 -0
- package/dist/editor/utils/index.d.ts +9 -0
- package/dist/editor/utils/index.js +26 -0
- package/dist/editor/utils/index.js.map +1 -0
- package/dist/editor/utils/joinClasses.d.ts +1 -0
- package/dist/editor/utils/joinClasses.js +8 -0
- package/dist/editor/utils/joinClasses.js.map +1 -0
- package/dist/editor/utils/parseVideoUrl.d.ts +15 -0
- package/dist/editor/utils/parseVideoUrl.js +115 -0
- package/dist/editor/utils/parseVideoUrl.js.map +1 -0
- package/dist/editor/utils/setFloatingElemPosition.d.ts +1 -0
- package/dist/editor/utils/setFloatingElemPosition.js +47 -0
- package/dist/editor/utils/setFloatingElemPosition.js.map +1 -0
- package/dist/editor/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
- package/dist/editor/utils/setFloatingElemPositionForLinkEditor.js +29 -0
- package/dist/editor/utils/setFloatingElemPositionForLinkEditor.js.map +1 -0
- package/dist/editor/utils/url.d.ts +2 -0
- package/dist/editor/utils/url.js +25 -0
- package/dist/editor/utils/url.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/eslint.config.mjs +27 -0
- package/package.json +110 -0
- package/tsconfig.eslint.json +10 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TablePlugin = exports.CellContext = void 0;
|
|
4
|
+
exports.TableContext = TableContext;
|
|
5
|
+
exports.InsertTableDialog = InsertTableDialog;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
const react_1 = require("react");
|
|
15
|
+
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
16
|
+
const table_1 = require("@lexical/table");
|
|
17
|
+
const Button_1 = require("../ui/Button");
|
|
18
|
+
const Dialog_1 = require("../ui/Dialog");
|
|
19
|
+
const TextInput_1 = require("../ui/TextInput");
|
|
20
|
+
exports.CellContext = (0, react_1.createContext)({
|
|
21
|
+
cellEditorConfig: null,
|
|
22
|
+
cellEditorPlugins: null,
|
|
23
|
+
set: () => {
|
|
24
|
+
// Empty
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
function TableContext({ children }) {
|
|
28
|
+
const [contextValue, setContextValue] = (0, react_1.useState)({
|
|
29
|
+
cellEditorConfig: null,
|
|
30
|
+
cellEditorPlugins: null,
|
|
31
|
+
});
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(exports.CellContext.Provider, { value: (0, react_1.useMemo)(() => ({
|
|
33
|
+
cellEditorConfig: contextValue.cellEditorConfig,
|
|
34
|
+
cellEditorPlugins: contextValue.cellEditorPlugins,
|
|
35
|
+
set: (cellEditorConfig, cellEditorPlugins) => {
|
|
36
|
+
setContextValue({ cellEditorConfig, cellEditorPlugins });
|
|
37
|
+
},
|
|
38
|
+
}), [contextValue.cellEditorConfig, contextValue.cellEditorPlugins]), children: children }));
|
|
39
|
+
}
|
|
40
|
+
function InsertTableDialog({ activeEditor, onClose, }) {
|
|
41
|
+
const [rows, setRows] = (0, react_1.useState)("5");
|
|
42
|
+
const [columns, setColumns] = (0, react_1.useState)("5");
|
|
43
|
+
const [isDisabled, setIsDisabled] = (0, react_1.useState)(true);
|
|
44
|
+
(0, react_1.useEffect)(() => {
|
|
45
|
+
const row = Number(rows);
|
|
46
|
+
const column = Number(columns);
|
|
47
|
+
if (row && row > 0 && row <= 500 && column && column > 0 && column <= 50) {
|
|
48
|
+
setIsDisabled(false);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
setIsDisabled(true);
|
|
52
|
+
}
|
|
53
|
+
}, [rows, columns]);
|
|
54
|
+
const onClick = () => {
|
|
55
|
+
activeEditor.dispatchCommand(table_1.INSERT_TABLE_COMMAND, {
|
|
56
|
+
columns,
|
|
57
|
+
rows,
|
|
58
|
+
});
|
|
59
|
+
onClose();
|
|
60
|
+
};
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextInput_1.TextInput, { placeholder: "# of rows (1-500)", label: "Rows", onChange: setRows, value: rows, "data-test-id": "table-modal-rows", type: "number" }), (0, jsx_runtime_1.jsx)(TextInput_1.TextInput, { placeholder: "# of columns (1-50)", label: "Columns", onChange: setColumns, value: columns, "data-test-id": "table-modal-columns", type: "number" }), (0, jsx_runtime_1.jsx)(Dialog_1.DialogActions, { "data-test-id": "table-model-confirm-insert", children: (0, jsx_runtime_1.jsx)(Button_1.Button, { disabled: isDisabled, onClick: onClick, children: "Confirm" }) })] }));
|
|
62
|
+
}
|
|
63
|
+
const TablePlugin = ({ cellEditorConfig, children, }) => {
|
|
64
|
+
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
65
|
+
const cellContext = (0, react_1.useContext)(exports.CellContext);
|
|
66
|
+
(0, react_1.useEffect)(() => {
|
|
67
|
+
if (!editor.hasNodes([table_1.TableNode, table_1.TableRowNode, table_1.TableCellNode])) {
|
|
68
|
+
throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");
|
|
69
|
+
}
|
|
70
|
+
}, [editor]);
|
|
71
|
+
(0, react_1.useEffect)(() => {
|
|
72
|
+
cellContext.set(cellEditorConfig, children);
|
|
73
|
+
}, [cellContext, cellEditorConfig, children]);
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
76
|
+
exports.TablePlugin = TablePlugin;
|
|
77
|
+
//# sourceMappingURL=TablePlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TablePlugin.js","sourceRoot":"","sources":["../../../src/editor/plugins/TablePlugin.tsx"],"names":[],"mappings":";;;AA6CA,oCAwBC;AAED,8CAuDC;;AA9HD;;;;;;GAMG;AAEH,iCAAqF;AACrF,kFAAkF;AAClF,0CAA8F;AAG9F,yCAAsC;AACtC,yCAA6C;AAC7C,+CAA4C;AAsB/B,QAAA,WAAW,GAAG,IAAA,qBAAa,EAAoB;IAC1D,gBAAgB,EAAE,IAAI;IACtB,iBAAiB,EAAE,IAAI;IACvB,GAAG,EAAE,GAAG,EAAE;QACR,QAAQ;IACV,CAAC;CACF,CAAC,CAAC;AAEH,SAAgB,YAAY,CAAC,EAAE,QAAQ,EAA6B;IAClE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAG7C;QACD,gBAAgB,EAAE,IAAI;QACtB,iBAAiB,EAAE,IAAI;KACxB,CAAC,CAAC;IACH,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,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAlBW,QAAA,WAAW,eAkBtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
import { FC, Dispatch } from "react";
|
|
9
|
+
import { LexicalEditor } from "lexical";
|
|
10
|
+
import { IToolbarControls } from "../../types";
|
|
11
|
+
interface IToolbarPluginProps {
|
|
12
|
+
editor: LexicalEditor;
|
|
13
|
+
activeEditor: LexicalEditor;
|
|
14
|
+
setActiveEditor: Dispatch<LexicalEditor>;
|
|
15
|
+
setIsLinkEditMode: Dispatch<boolean>;
|
|
16
|
+
controls?: IToolbarControls;
|
|
17
|
+
}
|
|
18
|
+
export declare const ToolbarPlugin: FC<IToolbarPluginProps>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolbarPlugin = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/**
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
const code_1 = require("@lexical/code");
|
|
14
|
+
const link_1 = require("@lexical/link");
|
|
15
|
+
const list_1 = require("@lexical/list");
|
|
16
|
+
const rich_text_1 = require("@lexical/rich-text");
|
|
17
|
+
const selection_1 = require("@lexical/selection");
|
|
18
|
+
const table_1 = require("@lexical/table");
|
|
19
|
+
const utils_1 = require("@lexical/utils");
|
|
20
|
+
const lexical_1 = require("lexical");
|
|
21
|
+
const context_1 = require("../../context");
|
|
22
|
+
const hooks_1 = require("../../hooks");
|
|
23
|
+
const ui_1 = require("../../ui");
|
|
24
|
+
const utils_2 = require("../../utils");
|
|
25
|
+
const constants_1 = require("../../constants");
|
|
26
|
+
const utils_3 = require("./utils");
|
|
27
|
+
const ToolbarPlugin = ({ editor, activeEditor, setActiveEditor, setIsLinkEditMode, controls = constants_1.toolbarDefaultControls, }) => {
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
29
|
+
const [selectedElementKey, setSelectedElementKey] = (0, react_1.useState)(null);
|
|
30
|
+
const [modal, showModal] = (0, hooks_1.useModal)();
|
|
31
|
+
const [isEditable, setIsEditable] = (0, react_1.useState)(() => editor.isEditable());
|
|
32
|
+
const { toolbarState, updateToolbarState } = (0, context_1.useToolbarState)();
|
|
33
|
+
const $updateToolbar = (0, react_1.useCallback)(() => {
|
|
34
|
+
activeEditor.read(() => {
|
|
35
|
+
var _a;
|
|
36
|
+
const selection = (0, lexical_1.$getSelection)();
|
|
37
|
+
if ((0, lexical_1.$isRangeSelection)(selection)) {
|
|
38
|
+
if (activeEditor !== editor && (0, utils_1.$isEditorIsNestedEditor)(activeEditor)) {
|
|
39
|
+
const rootElement = activeEditor.getRootElement();
|
|
40
|
+
updateToolbarState("isImageCaption", !!((_a = rootElement === null || rootElement === void 0 ? void 0 : rootElement.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains("image-caption-container")));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
updateToolbarState("isImageCaption", false);
|
|
44
|
+
}
|
|
45
|
+
const anchorNode = selection.anchor.getNode();
|
|
46
|
+
let element = anchorNode.getKey() === "root"
|
|
47
|
+
? anchorNode
|
|
48
|
+
: (0, utils_1.$findMatchingParent)(anchorNode, e => {
|
|
49
|
+
const parent = e.getParent();
|
|
50
|
+
return parent !== null && (0, lexical_1.$isRootOrShadowRoot)(parent);
|
|
51
|
+
});
|
|
52
|
+
if (element === null) {
|
|
53
|
+
element = anchorNode.getTopLevelElementOrThrow();
|
|
54
|
+
}
|
|
55
|
+
const elementKey = element.getKey();
|
|
56
|
+
const elementDOM = activeEditor.getElementByKey(elementKey);
|
|
57
|
+
updateToolbarState("isRTL", (0, selection_1.$isParentElementRTL)(selection));
|
|
58
|
+
// Update links
|
|
59
|
+
const node = (0, utils_2.getSelectedNode)(selection);
|
|
60
|
+
const parent = node.getParent();
|
|
61
|
+
const isLink = (0, link_1.$isLinkNode)(parent) || (0, link_1.$isLinkNode)(node);
|
|
62
|
+
updateToolbarState("isLink", isLink);
|
|
63
|
+
const tableNode = (0, utils_1.$findMatchingParent)(node, table_1.$isTableNode);
|
|
64
|
+
if ((0, table_1.$isTableNode)(tableNode)) {
|
|
65
|
+
updateToolbarState("rootType", "table");
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
updateToolbarState("rootType", "root");
|
|
69
|
+
}
|
|
70
|
+
if (elementDOM !== null) {
|
|
71
|
+
setSelectedElementKey(elementKey);
|
|
72
|
+
if ((0, list_1.$isListNode)(element)) {
|
|
73
|
+
const parentList = (0, utils_1.$getNearestNodeOfType)(anchorNode, list_1.ListNode);
|
|
74
|
+
const type = parentList ? parentList.getListType() : element.getListType();
|
|
75
|
+
updateToolbarState("blockType", type);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
const type = (0, rich_text_1.$isHeadingNode)(element) ? element.getTag() : element.getType();
|
|
79
|
+
if (type in context_1.blockTypeToBlockName) {
|
|
80
|
+
updateToolbarState("blockType", type);
|
|
81
|
+
}
|
|
82
|
+
if ((0, code_1.$isCodeNode)(element)) {
|
|
83
|
+
const language = element.getLanguage();
|
|
84
|
+
updateToolbarState("codeLanguage", language ? code_1.CODE_LANGUAGE_MAP[language] || language : "");
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
let matchingParent;
|
|
90
|
+
if ((0, link_1.$isLinkNode)(parent)) {
|
|
91
|
+
// If node is a link, we need to fetch the parent paragraph node to set format
|
|
92
|
+
matchingParent = (0, utils_1.$findMatchingParent)(node, parentNode => (0, lexical_1.$isElementNode)(parentNode) && !parentNode.isInline());
|
|
93
|
+
}
|
|
94
|
+
// If matchingParent is a valid node, pass it's format type
|
|
95
|
+
updateToolbarState("elementFormat", (0, lexical_1.$isElementNode)(matchingParent)
|
|
96
|
+
? matchingParent.getFormatType()
|
|
97
|
+
: (0, lexical_1.$isElementNode)(node)
|
|
98
|
+
? node.getFormatType()
|
|
99
|
+
: (parent === null || parent === void 0 ? void 0 : parent.getFormatType()) || "left");
|
|
100
|
+
}
|
|
101
|
+
if ((0, lexical_1.$isRangeSelection)(selection) || (0, table_1.$isTableSelection)(selection)) {
|
|
102
|
+
const anchorNode = selection.anchor.getNode();
|
|
103
|
+
const element = anchorNode.getTopLevelElementOrThrow();
|
|
104
|
+
// Update text format
|
|
105
|
+
updateToolbarState("isBold", selection.hasFormat("bold"));
|
|
106
|
+
updateToolbarState("isItalic", selection.hasFormat("italic"));
|
|
107
|
+
updateToolbarState("isUnderline", selection.hasFormat("underline"));
|
|
108
|
+
updateToolbarState("isStrikethrough", selection.hasFormat("strikethrough"));
|
|
109
|
+
updateToolbarState("isHighlight", selection.hasFormat("highlight"));
|
|
110
|
+
updateToolbarState("isCode", selection.hasFormat("code"));
|
|
111
|
+
if (element) {
|
|
112
|
+
const align = element.getFormatType();
|
|
113
|
+
updateToolbarState("isRightAlign", align === "right");
|
|
114
|
+
updateToolbarState("isLeftAlign", align === "left");
|
|
115
|
+
updateToolbarState("isCenterAlign", align === "center");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}, [activeEditor, editor, updateToolbarState]);
|
|
120
|
+
(0, react_1.useEffect)(() => {
|
|
121
|
+
return editor.registerCommand(lexical_1.SELECTION_CHANGE_COMMAND, (_payload, newEditor) => {
|
|
122
|
+
setActiveEditor(newEditor);
|
|
123
|
+
$updateToolbar();
|
|
124
|
+
return false;
|
|
125
|
+
}, lexical_1.COMMAND_PRIORITY_CRITICAL);
|
|
126
|
+
}, [editor, $updateToolbar, setActiveEditor]);
|
|
127
|
+
(0, react_1.useEffect)(() => {
|
|
128
|
+
activeEditor.getEditorState().read(() => {
|
|
129
|
+
$updateToolbar();
|
|
130
|
+
});
|
|
131
|
+
}, [activeEditor, $updateToolbar]);
|
|
132
|
+
(0, react_1.useEffect)(() => {
|
|
133
|
+
return (0, utils_1.mergeRegister)(editor.registerEditableListener(editable => {
|
|
134
|
+
setIsEditable(editable);
|
|
135
|
+
}), activeEditor.registerUpdateListener(({ editorState }) => {
|
|
136
|
+
editorState.read(() => {
|
|
137
|
+
$updateToolbar();
|
|
138
|
+
});
|
|
139
|
+
}), activeEditor.registerCommand(lexical_1.CAN_UNDO_COMMAND, payload => {
|
|
140
|
+
updateToolbarState("canUndo", payload);
|
|
141
|
+
return false;
|
|
142
|
+
}, lexical_1.COMMAND_PRIORITY_CRITICAL), activeEditor.registerCommand(lexical_1.CAN_REDO_COMMAND, payload => {
|
|
143
|
+
updateToolbarState("canRedo", payload);
|
|
144
|
+
return false;
|
|
145
|
+
}, lexical_1.COMMAND_PRIORITY_CRITICAL));
|
|
146
|
+
}, [$updateToolbar, activeEditor, editor, updateToolbarState]);
|
|
147
|
+
const insertLink = (0, react_1.useCallback)(() => {
|
|
148
|
+
if (!toolbarState.isLink) {
|
|
149
|
+
setIsLinkEditMode(true);
|
|
150
|
+
activeEditor.dispatchCommand(link_1.TOGGLE_LINK_COMMAND, (0, utils_2.sanitizeUrl)("https://"));
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
setIsLinkEditMode(false);
|
|
154
|
+
activeEditor.dispatchCommand(link_1.TOGGLE_LINK_COMMAND, null);
|
|
155
|
+
}
|
|
156
|
+
}, [activeEditor, setIsLinkEditMode, toolbarState.isLink]);
|
|
157
|
+
const onCodeLanguageSelect = (0, react_1.useCallback)((value) => {
|
|
158
|
+
activeEditor.update(() => {
|
|
159
|
+
if (selectedElementKey !== null) {
|
|
160
|
+
const node = (0, lexical_1.$getNodeByKey)(selectedElementKey);
|
|
161
|
+
if ((0, code_1.$isCodeNode)(node)) {
|
|
162
|
+
node.setLanguage(value);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}, [activeEditor, selectedElementKey]);
|
|
167
|
+
const onClearFormatting = (0, react_1.useCallback)(() => {
|
|
168
|
+
(0, utils_3.clearFormatting)(activeEditor);
|
|
169
|
+
}, [activeEditor]);
|
|
170
|
+
const onClearEditor = (0, react_1.useCallback)(() => {
|
|
171
|
+
(0, utils_3.clearEditor)(activeEditor);
|
|
172
|
+
}, [activeEditor]);
|
|
173
|
+
const canViewerSeeInsertDropdown = !toolbarState.isImageCaption;
|
|
174
|
+
const canViewerSeeInsertCodeButton = !toolbarState.isImageCaption;
|
|
175
|
+
const controlsMap = {
|
|
176
|
+
undo: (0, jsx_runtime_1.jsx)(ui_1.UndoButton, { disabled: !toolbarState.canUndo || !isEditable, activeEditor: activeEditor }),
|
|
177
|
+
redo: (0, jsx_runtime_1.jsx)(ui_1.RedoButton, { disabled: !toolbarState.canRedo || !isEditable, activeEditor: activeEditor }),
|
|
178
|
+
blockFormat: ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [toolbarState.blockType in context_1.blockTypeToBlockName && activeEditor === editor && ((0, jsx_runtime_1.jsx)(ui_1.BlockFormatDropDown, { controls: controls.blockFormat, disabled: !isEditable, blockType: toolbarState.blockType, editor: activeEditor })), !!((_a = controls.history) === null || _a === void 0 ? void 0 : _a.length) && (0, jsx_runtime_1.jsx)(ui_1.Divider, {})] })),
|
|
179
|
+
codeLanguages: ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: (0, jsx_runtime_1.jsx)(ui_1.CodeLanguageDropdown, { disabled: !isEditable, toolbarState: toolbarState, onCodeLanguageSelect: onCodeLanguageSelect, controls: controls.codeLanguages }) })),
|
|
180
|
+
bold: (0, jsx_runtime_1.jsx)(ui_1.BoldButton, { disabled: !isEditable, activeEditor: activeEditor, isBold: toolbarState.isBold }),
|
|
181
|
+
italic: (0, jsx_runtime_1.jsx)(ui_1.ItalicButton, { disabled: !isEditable, activeEditor: activeEditor, isItalic: toolbarState.isItalic }),
|
|
182
|
+
underline: ((0, jsx_runtime_1.jsx)(ui_1.UnderlineButton, { disabled: !isEditable, activeEditor: activeEditor, isUnderline: toolbarState.isUnderline })),
|
|
183
|
+
strikethrough: ((0, jsx_runtime_1.jsx)(ui_1.StrikethroughButton, { disabled: !isEditable, activeEditor: activeEditor, isStrikethrough: toolbarState.isStrikethrough })),
|
|
184
|
+
code: ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: canViewerSeeInsertCodeButton && ((0, jsx_runtime_1.jsx)(ui_1.CodeButton, { disabled: !isEditable, activeEditor: activeEditor, isCode: toolbarState.isCode })) })),
|
|
185
|
+
link: (0, jsx_runtime_1.jsx)(ui_1.LinkButton, { disabled: !isEditable, insertLink: insertLink, isLink: toolbarState.isLink }),
|
|
186
|
+
leftAlign: ((0, jsx_runtime_1.jsx)(ui_1.LeftAlignButton, { disabled: !isEditable, activeEditor: activeEditor, isLeftAlign: toolbarState.isLeftAlign })),
|
|
187
|
+
centerAlign: ((0, jsx_runtime_1.jsx)(ui_1.CenterAlignButton, { disabled: !isEditable, activeEditor: activeEditor, isCenterAlign: toolbarState.isCenterAlign })),
|
|
188
|
+
rightAlign: ((0, jsx_runtime_1.jsx)(ui_1.RightAlignButton, { disabled: !isEditable, activeEditor: activeEditor, isRightAlign: toolbarState.isRightAlign })),
|
|
189
|
+
formatting: (0, jsx_runtime_1.jsx)(ui_1.ClearFormattingButton, { disabled: !isEditable, onClick: onClearFormatting }),
|
|
190
|
+
editor: (0, jsx_runtime_1.jsx)(ui_1.ClearEditorButton, { disabled: !isEditable, onClick: onClearEditor }),
|
|
191
|
+
horizontal: (0, jsx_runtime_1.jsx)(ui_1.HorizontalRuleButton, { activeEditor: activeEditor }),
|
|
192
|
+
image: (0, jsx_runtime_1.jsx)(ui_1.ImageButton, { activeEditor: activeEditor, showModal: showModal }),
|
|
193
|
+
video: (0, jsx_runtime_1.jsx)(ui_1.VideoButton, { activeEditor: activeEditor, showModal: showModal }),
|
|
194
|
+
table: (0, jsx_runtime_1.jsx)(ui_1.TableButton, { activeEditor: activeEditor, showModal: showModal }),
|
|
195
|
+
};
|
|
196
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "toolbar", children: [!!((_b = controls.history) === null || _b === void 0 ? void 0 : _b.length) && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [controls.history.map(c => controlsMap[c]), (0, jsx_runtime_1.jsx)(ui_1.Divider, {})] })), !!((_c = controls.blockFormat) === null || _c === void 0 ? void 0 : _c.length) && controlsMap.blockFormat, toolbarState.blockType === "code" ? (controlsMap.codeLanguages) : ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [!!((_d = controls.textFormat) === null || _d === void 0 ? void 0 : _d.length) && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [controls.textFormat.map(c => controlsMap[c]), !!((_e = controls.clear) === null || _e === void 0 ? void 0 : _e.length) && (0, jsx_runtime_1.jsx)(ui_1.Divider, {})] })), !!((_f = controls.clear) === null || _f === void 0 ? void 0 : _f.length) && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [controls.clear.map(c => controlsMap[c]), !!((_g = controls.viewFormat) === null || _g === void 0 ? void 0 : _g.length) && (0, jsx_runtime_1.jsx)(ui_1.Divider, {})] })), canViewerSeeInsertDropdown && !!((_h = controls.viewFormat) === null || _h === void 0 ? void 0 : _h.length) && ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: controls.viewFormat.map(c => controlsMap[c]) }))] })), modal] }));
|
|
197
|
+
};
|
|
198
|
+
exports.ToolbarPlugin = ToolbarPlugin;
|
|
199
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/plugins/ToolbarPlugin/index.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;GAMG;AAEH,iCAAsF;AACtF,wCAA+D;AAC/D,wCAAiE;AACjE,wCAAsD;AACtD,kDAAoD;AACpD,kDAAyD;AACzD,0CAAiE;AACjE,0CAAoH;AACpH,qCAYiB;AAEjB,2CAAsE;AACtE,uCAAuC;AACvC,iCAqBkB;AAClB,uCAA2D;AAE3D,+CAAyD;AACzD,mCAAuD;AAUhD,MAAM,aAAa,GAA4B,CAAC,EACrD,MAAM,EACN,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,QAAQ,GAAG,kCAAsB,GAClC,EAAe,EAAE;;IAChB,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,IAAA,gBAAQ,EAAiB,IAAI,CAAC,CAAC;IACnF,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,GAAE,CAAC;IACtC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IACxE,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,IAAA,yBAAe,GAAE,CAAC;IAE/D,MAAM,cAAc,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACtC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE;;YACrB,MAAM,SAAS,GAAG,IAAA,uBAAa,GAAE,CAAC;YAClC,IAAI,IAAA,2BAAiB,EAAC,SAAS,CAAC,EAAE,CAAC;gBACjC,IAAI,YAAY,KAAK,MAAM,IAAI,IAAA,+BAAuB,EAAC,YAAY,CAAC,EAAE,CAAC;oBACrE,MAAM,WAAW,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC;oBAClD,kBAA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|
|
8
|
+
* Calculates the new font size based on the update type.
|
|
9
|
+
* @param currentFontSize - The current font size
|
|
10
|
+
* @param updateType - The type of change, either increment or decrement
|
|
11
|
+
* @returns the next font size
|
|
12
|
+
*/
|
|
13
|
+
export declare const calculateNextFontSize: (currentFontSize: number, updateType: UpdateFontSizeType | null) => number;
|
|
14
|
+
export declare const formatParagraph: (editor: LexicalEditor) => void;
|
|
15
|
+
export declare const formatHeading: (editor: LexicalEditor, blockType: string, headingSize: HeadingTagType) => void;
|
|
16
|
+
export declare const formatBulletList: (editor: LexicalEditor, blockType: string) => void;
|
|
17
|
+
export declare const formatCheckList: (editor: LexicalEditor, blockType: string) => void;
|
|
18
|
+
export declare const formatNumberedList: (editor: LexicalEditor, blockType: string) => void;
|
|
19
|
+
export declare const formatQuote: (editor: LexicalEditor, blockType: string) => void;
|
|
20
|
+
export declare const formatCode: (editor: LexicalEditor, blockType: string) => void;
|
|
21
|
+
export declare const clearEditor: (editor: LexicalEditor) => void;
|
|
22
|
+
export declare const clearFormatting: (editor: LexicalEditor) => void;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearFormatting = exports.clearEditor = exports.formatCode = exports.formatQuote = exports.formatNumberedList = exports.formatCheckList = exports.formatBulletList = exports.formatHeading = exports.formatParagraph = exports.calculateNextFontSize = exports.UpdateFontSizeType = void 0;
|
|
4
|
+
const code_1 = require("@lexical/code");
|
|
5
|
+
const list_1 = require("@lexical/list");
|
|
6
|
+
const LexicalDecoratorBlockNode_1 = require("@lexical/react/LexicalDecoratorBlockNode");
|
|
7
|
+
const rich_text_1 = require("@lexical/rich-text");
|
|
8
|
+
const selection_1 = require("@lexical/selection");
|
|
9
|
+
const table_1 = require("@lexical/table");
|
|
10
|
+
const utils_1 = require("@lexical/utils");
|
|
11
|
+
const lexical_1 = require("lexical");
|
|
12
|
+
const context_1 = require("../../context");
|
|
13
|
+
var UpdateFontSizeType;
|
|
14
|
+
(function (UpdateFontSizeType) {
|
|
15
|
+
UpdateFontSizeType[UpdateFontSizeType["increment"] = 1] = "increment";
|
|
16
|
+
UpdateFontSizeType[UpdateFontSizeType["decrement"] = 2] = "decrement";
|
|
17
|
+
})(UpdateFontSizeType || (exports.UpdateFontSizeType = UpdateFontSizeType = {}));
|
|
18
|
+
/**
|
|
19
|
+
* Calculates the new font size based on the update type.
|
|
20
|
+
* @param currentFontSize - The current font size
|
|
21
|
+
* @param updateType - The type of change, either increment or decrement
|
|
22
|
+
* @returns the next font size
|
|
23
|
+
*/
|
|
24
|
+
const calculateNextFontSize = (currentFontSize, updateType) => {
|
|
25
|
+
if (!updateType) {
|
|
26
|
+
return currentFontSize;
|
|
27
|
+
}
|
|
28
|
+
let updatedFontSize = currentFontSize;
|
|
29
|
+
switch (updateType) {
|
|
30
|
+
case UpdateFontSizeType.decrement:
|
|
31
|
+
switch (true) {
|
|
32
|
+
case currentFontSize > context_1.MAX_ALLOWED_FONT_SIZE:
|
|
33
|
+
updatedFontSize = context_1.MAX_ALLOWED_FONT_SIZE;
|
|
34
|
+
break;
|
|
35
|
+
case currentFontSize >= 48:
|
|
36
|
+
updatedFontSize -= 12;
|
|
37
|
+
break;
|
|
38
|
+
case currentFontSize >= 24:
|
|
39
|
+
updatedFontSize -= 4;
|
|
40
|
+
break;
|
|
41
|
+
case currentFontSize >= 14:
|
|
42
|
+
updatedFontSize -= 2;
|
|
43
|
+
break;
|
|
44
|
+
case currentFontSize >= 9:
|
|
45
|
+
updatedFontSize -= 1;
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
updatedFontSize = context_1.MIN_ALLOWED_FONT_SIZE;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
case UpdateFontSizeType.increment:
|
|
53
|
+
switch (true) {
|
|
54
|
+
case currentFontSize < context_1.MIN_ALLOWED_FONT_SIZE:
|
|
55
|
+
updatedFontSize = context_1.MIN_ALLOWED_FONT_SIZE;
|
|
56
|
+
break;
|
|
57
|
+
case currentFontSize < 12:
|
|
58
|
+
updatedFontSize += 1;
|
|
59
|
+
break;
|
|
60
|
+
case currentFontSize < 20:
|
|
61
|
+
updatedFontSize += 2;
|
|
62
|
+
break;
|
|
63
|
+
case currentFontSize < 36:
|
|
64
|
+
updatedFontSize += 4;
|
|
65
|
+
break;
|
|
66
|
+
case currentFontSize <= 60:
|
|
67
|
+
updatedFontSize += 12;
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
updatedFontSize = context_1.MAX_ALLOWED_FONT_SIZE;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
return updatedFontSize;
|
|
78
|
+
};
|
|
79
|
+
exports.calculateNextFontSize = calculateNextFontSize;
|
|
80
|
+
const formatParagraph = (editor) => {
|
|
81
|
+
editor.update(() => {
|
|
82
|
+
const selection = (0, lexical_1.$getSelection)();
|
|
83
|
+
(0, selection_1.$setBlocksType)(selection, () => (0, lexical_1.$createParagraphNode)());
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
exports.formatParagraph = formatParagraph;
|
|
87
|
+
const formatHeading = (editor, blockType, headingSize) => {
|
|
88
|
+
if (blockType !== headingSize) {
|
|
89
|
+
editor.update(() => {
|
|
90
|
+
const selection = (0, lexical_1.$getSelection)();
|
|
91
|
+
(0, selection_1.$setBlocksType)(selection, () => (0, rich_text_1.$createHeadingNode)(headingSize));
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.formatHeading = formatHeading;
|
|
96
|
+
const formatBulletList = (editor, blockType) => {
|
|
97
|
+
if (blockType !== "bullet") {
|
|
98
|
+
editor.dispatchCommand(list_1.INSERT_UNORDERED_LIST_COMMAND, undefined);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
(0, exports.formatParagraph)(editor);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
exports.formatBulletList = formatBulletList;
|
|
105
|
+
const formatCheckList = (editor, blockType) => {
|
|
106
|
+
if (blockType !== "check") {
|
|
107
|
+
editor.dispatchCommand(list_1.INSERT_CHECK_LIST_COMMAND, undefined);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
(0, exports.formatParagraph)(editor);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
exports.formatCheckList = formatCheckList;
|
|
114
|
+
const formatNumberedList = (editor, blockType) => {
|
|
115
|
+
if (blockType !== "number") {
|
|
116
|
+
editor.dispatchCommand(list_1.INSERT_ORDERED_LIST_COMMAND, undefined);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
(0, exports.formatParagraph)(editor);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
exports.formatNumberedList = formatNumberedList;
|
|
123
|
+
const formatQuote = (editor, blockType) => {
|
|
124
|
+
if (blockType !== "quote") {
|
|
125
|
+
editor.update(() => {
|
|
126
|
+
const selection = (0, lexical_1.$getSelection)();
|
|
127
|
+
(0, selection_1.$setBlocksType)(selection, () => (0, rich_text_1.$createQuoteNode)());
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
exports.formatQuote = formatQuote;
|
|
132
|
+
const formatCode = (editor, blockType) => {
|
|
133
|
+
if (blockType !== "code") {
|
|
134
|
+
editor.update(() => {
|
|
135
|
+
let selection = (0, lexical_1.$getSelection)();
|
|
136
|
+
if (!selection) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (!(0, lexical_1.$isRangeSelection)(selection) || selection.isCollapsed()) {
|
|
140
|
+
(0, selection_1.$setBlocksType)(selection, () => (0, code_1.$createCodeNode)());
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
const textContent = selection.getTextContent();
|
|
144
|
+
const codeNode = (0, code_1.$createCodeNode)();
|
|
145
|
+
selection.insertNodes([codeNode]);
|
|
146
|
+
selection = (0, lexical_1.$getSelection)();
|
|
147
|
+
if ((0, lexical_1.$isRangeSelection)(selection)) {
|
|
148
|
+
selection.insertRawText(textContent);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
exports.formatCode = formatCode;
|
|
155
|
+
const clearEditor = (editor) => {
|
|
156
|
+
editor.update(() => {
|
|
157
|
+
const root = (0, lexical_1.$getRoot)();
|
|
158
|
+
root.clear();
|
|
159
|
+
root.append((0, lexical_1.$createParagraphNode)());
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
exports.clearEditor = clearEditor;
|
|
163
|
+
const clearFormatting = (editor) => {
|
|
164
|
+
editor.update(() => {
|
|
165
|
+
const selection = (0, lexical_1.$getSelection)();
|
|
166
|
+
if ((0, lexical_1.$isRangeSelection)(selection) || (0, table_1.$isTableSelection)(selection)) {
|
|
167
|
+
const anchor = selection.anchor;
|
|
168
|
+
const focus = selection.focus;
|
|
169
|
+
const nodes = selection.getNodes();
|
|
170
|
+
const extractedNodes = selection.extract();
|
|
171
|
+
if (anchor.key === focus.key && anchor.offset === focus.offset) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
nodes.forEach((node, idx) => {
|
|
175
|
+
// We split the first and last node by the selection
|
|
176
|
+
// So that we don't format unselected text inside those nodes
|
|
177
|
+
if ((0, lexical_1.$isTextNode)(node)) {
|
|
178
|
+
// Use a separate variable to ensure TS does not lose the refinement
|
|
179
|
+
let textNode = node;
|
|
180
|
+
if (idx === 0 && anchor.offset !== 0) {
|
|
181
|
+
textNode = textNode.splitText(anchor.offset)[1] || textNode;
|
|
182
|
+
}
|
|
183
|
+
if (idx === nodes.length - 1) {
|
|
184
|
+
textNode = textNode.splitText(focus.offset)[0] || textNode;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* If the selected text has one format applied
|
|
188
|
+
* selecting a portion of the text, could
|
|
189
|
+
* clear the format to the wrong portion of the text.
|
|
190
|
+
*
|
|
191
|
+
* The cleared text is based on the length of the selected text.
|
|
192
|
+
*/
|
|
193
|
+
// We need this in case the selected text only has one format
|
|
194
|
+
const extractedTextNode = extractedNodes[0];
|
|
195
|
+
if (nodes.length === 1 && (0, lexical_1.$isTextNode)(extractedTextNode)) {
|
|
196
|
+
textNode = extractedTextNode;
|
|
197
|
+
}
|
|
198
|
+
if (textNode.__style !== "") {
|
|
199
|
+
textNode.setStyle("");
|
|
200
|
+
}
|
|
201
|
+
if (textNode.__format !== 0) {
|
|
202
|
+
textNode.setFormat(0);
|
|
203
|
+
}
|
|
204
|
+
const nearestBlockElement = (0, utils_1.$getNearestBlockElementAncestorOrThrow)(textNode);
|
|
205
|
+
if (nearestBlockElement.__format !== 0) {
|
|
206
|
+
nearestBlockElement.setFormat("");
|
|
207
|
+
}
|
|
208
|
+
if (nearestBlockElement.__indent !== 0) {
|
|
209
|
+
nearestBlockElement.setIndent(0);
|
|
210
|
+
}
|
|
211
|
+
node = textNode;
|
|
212
|
+
}
|
|
213
|
+
else if ((0, rich_text_1.$isHeadingNode)(node) || (0, rich_text_1.$isQuoteNode)(node)) {
|
|
214
|
+
node.replace((0, lexical_1.$createParagraphNode)(), true);
|
|
215
|
+
}
|
|
216
|
+
else if ((0, LexicalDecoratorBlockNode_1.$isDecoratorBlockNode)(node)) {
|
|
217
|
+
node.setFormat("");
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
exports.clearFormatting = clearFormatting;
|
|
224
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/editor/plugins/ToolbarPlugin/utils.ts"],"names":[],"mappings":";;;AAAA,wCAAgD;AAChD,wCAAsH;AACtH,wFAAiF;AACjF,kDAAwH;AACxH,kDAAoD;AACpD,0CAAmD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AAE,CAAC,CAAC;oBACxB,CAAC;oBACD,IAAI,QAAQ,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;wBAC5B,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;oBACxB,CAAC;oBACD,MAAM,mBAAmB,GAAG,IAAA,8CAAsC,EAAC,QAAQ,CAAC,CAAC;oBAC7E,IAAI,mBAAmB,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;wBACvC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;oBACpC,CAAC;oBACD,IAAI,mBAAmB,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;wBACvC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;oBACnC,CAAC;oBACD,IAAI,GAAG,QAAQ,CAAC;gBAClB,CAAC;qBAAM,IAAI,IAAA,0BAAc,EAAC,IAAI,CAAC,IAAI,IAAA,wBAAY,EAAC,IAAI,CAAC,EAAE,CAAC;oBACtD,IAAI,CAAC,OAAO,CAAC,IAAA,8BAAoB,GAAE,EAAE,IAAI,CAAC,CAAC;gBAC7C,CAAC;qBAAM,IAAI,IAAA,iDAAqB,EAAC,IAAI,CAAC,EAAE,CAAC;oBACvC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;gBACrB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA5DW,QAAA,eAAe,mBA4D1B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import { LexicalEditor } from "lexical";
|
|
3
|
+
export declare function InsertVideoDialog({ activeEditor, onClose, }: {
|
|
4
|
+
activeEditor: LexicalEditor;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
export declare const VideoPlugin: () => null;
|