@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,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DropDown = exports.DropDownItem = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const lexical_1 = require("lexical");
|
|
7
|
+
const react_dom_1 = require("react-dom");
|
|
8
|
+
const DropDownContext = (0, react_1.createContext)(null);
|
|
9
|
+
const dropDownPadding = 4;
|
|
10
|
+
const DropDownItem = ({ children, className, onClick, title, }) => {
|
|
11
|
+
const ref = (0, react_1.useRef)(null);
|
|
12
|
+
const dropDownContext = (0, react_1.useContext)(DropDownContext);
|
|
13
|
+
if (dropDownContext === null) {
|
|
14
|
+
throw new Error("DropDownItem must be used within a DropDown");
|
|
15
|
+
}
|
|
16
|
+
const { registerItem } = dropDownContext;
|
|
17
|
+
(0, react_1.useEffect)(() => {
|
|
18
|
+
if (ref) {
|
|
19
|
+
registerItem(ref);
|
|
20
|
+
}
|
|
21
|
+
return;
|
|
22
|
+
}, [ref, registerItem]);
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)("button", { className: className, onClick: onClick, ref: ref, title: title, type: "button", children: children }));
|
|
24
|
+
};
|
|
25
|
+
exports.DropDownItem = DropDownItem;
|
|
26
|
+
const DropDownItems = ({ children, dropDownRef, onClose, }) => {
|
|
27
|
+
const [items, setItems] = (0, react_1.useState)();
|
|
28
|
+
const [highlightedItem, setHighlightedItem] = (0, react_1.useState)();
|
|
29
|
+
const registerItem = (0, react_1.useCallback)((itemRef) => {
|
|
30
|
+
setItems(prev => (prev ? [...prev, itemRef] : [itemRef]));
|
|
31
|
+
}, [setItems]);
|
|
32
|
+
const handleKeyDown = (event) => {
|
|
33
|
+
if (!items) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const key = event.key;
|
|
37
|
+
if (["Escape", "ArrowUp", "ArrowDown", "Tab"].includes(key)) {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
}
|
|
40
|
+
if (key === "Escape" || key === "Tab") {
|
|
41
|
+
onClose();
|
|
42
|
+
}
|
|
43
|
+
else if (key === "ArrowUp") {
|
|
44
|
+
setHighlightedItem(prev => {
|
|
45
|
+
if (!prev) {
|
|
46
|
+
return items[0];
|
|
47
|
+
}
|
|
48
|
+
const index = items.indexOf(prev) - 1;
|
|
49
|
+
return items[index === -1 ? items.length - 1 : index];
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else if (key === "ArrowDown") {
|
|
53
|
+
setHighlightedItem(prev => {
|
|
54
|
+
if (!prev) {
|
|
55
|
+
return items[0];
|
|
56
|
+
}
|
|
57
|
+
return items[items.indexOf(prev) + 1];
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const contextValue = (0, react_1.useMemo)(() => ({
|
|
62
|
+
registerItem,
|
|
63
|
+
}), [registerItem]);
|
|
64
|
+
(0, react_1.useEffect)(() => {
|
|
65
|
+
if (items && !highlightedItem) {
|
|
66
|
+
setHighlightedItem(items[0]);
|
|
67
|
+
}
|
|
68
|
+
if (highlightedItem === null || highlightedItem === void 0 ? void 0 : highlightedItem.current) {
|
|
69
|
+
highlightedItem.current.focus();
|
|
70
|
+
}
|
|
71
|
+
}, [items, highlightedItem]);
|
|
72
|
+
return ((0, jsx_runtime_1.jsx)(DropDownContext.Provider, { value: contextValue, children: (0, jsx_runtime_1.jsx)("div", { className: "dropdown", ref: dropDownRef, onKeyDown: handleKeyDown, children: children }) }));
|
|
73
|
+
};
|
|
74
|
+
const DropDown = ({ disabled = false, buttonLabel, buttonAriaLabel, buttonClassName, icon, children, stopCloseOnClickSelf, }) => {
|
|
75
|
+
const dropDownRef = (0, react_1.useRef)(null);
|
|
76
|
+
const buttonRef = (0, react_1.useRef)(null);
|
|
77
|
+
const [showDropDown, setShowDropDown] = (0, react_1.useState)(false);
|
|
78
|
+
const handleClose = () => {
|
|
79
|
+
setShowDropDown(false);
|
|
80
|
+
if (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) {
|
|
81
|
+
buttonRef.current.focus();
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
(0, react_1.useEffect)(() => {
|
|
85
|
+
const button = buttonRef.current;
|
|
86
|
+
const dropDown = dropDownRef.current;
|
|
87
|
+
if (showDropDown && button !== null && dropDown !== null) {
|
|
88
|
+
const { top, left } = button.getBoundingClientRect();
|
|
89
|
+
dropDown.style.top = `${top + button.offsetHeight + dropDownPadding}px`;
|
|
90
|
+
dropDown.style.left = `${Math.min(left, window.innerWidth - dropDown.offsetWidth - 20)}px`;
|
|
91
|
+
}
|
|
92
|
+
}, [dropDownRef, buttonRef, showDropDown]);
|
|
93
|
+
(0, react_1.useEffect)(() => {
|
|
94
|
+
const button = buttonRef.current;
|
|
95
|
+
if (button !== null && showDropDown) {
|
|
96
|
+
const handle = (event) => {
|
|
97
|
+
var _a;
|
|
98
|
+
const target = event.target;
|
|
99
|
+
if (!(0, lexical_1.isDOMNode)(target)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (stopCloseOnClickSelf) {
|
|
103
|
+
if ((_a = dropDownRef.current) === null || _a === void 0 ? void 0 : _a.contains(target)) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (!button.contains(target)) {
|
|
108
|
+
setShowDropDown(false);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
document.addEventListener("click", handle);
|
|
112
|
+
return () => {
|
|
113
|
+
document.removeEventListener("click", handle);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return;
|
|
117
|
+
}, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf]);
|
|
118
|
+
(0, react_1.useEffect)(() => {
|
|
119
|
+
const handleButtonPositionUpdate = () => {
|
|
120
|
+
if (showDropDown) {
|
|
121
|
+
const button = buttonRef.current;
|
|
122
|
+
const dropDown = dropDownRef.current;
|
|
123
|
+
if (button !== null && dropDown !== null) {
|
|
124
|
+
const { top } = button.getBoundingClientRect();
|
|
125
|
+
const newPosition = top + button.offsetHeight + dropDownPadding;
|
|
126
|
+
if (newPosition !== dropDown.getBoundingClientRect().top) {
|
|
127
|
+
dropDown.style.top = `${newPosition}px`;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
document.addEventListener("scroll", handleButtonPositionUpdate);
|
|
133
|
+
return () => {
|
|
134
|
+
document.removeEventListener("scroll", handleButtonPositionUpdate);
|
|
135
|
+
};
|
|
136
|
+
}, [buttonRef, dropDownRef, showDropDown]);
|
|
137
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", disabled: disabled, "aria-label": buttonAriaLabel || buttonLabel, className: buttonClassName, onClick: () => setShowDropDown(!showDropDown), ref: buttonRef, children: [icon, buttonLabel && (0, jsx_runtime_1.jsx)("span", { className: "text dropdown-button-text", children: buttonLabel }), (0, jsx_runtime_1.jsx)("i", { className: "chevron-down" })] }), showDropDown &&
|
|
138
|
+
(0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(DropDownItems, { dropDownRef: dropDownRef, onClose: handleClose, children: children }), document.body)] }));
|
|
139
|
+
};
|
|
140
|
+
exports.DropDown = DropDown;
|
|
141
|
+
//# sourceMappingURL=DropDown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropDown.js","sourceRoot":"","sources":["../../../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,0BAA0B,CAAC,CAAC;QACrE,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;IAE3C,OAAO,CACL,6DACE,oCACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,QAAQ,gBACN,eAAe,IAAI,WAAW,EAC1C,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,EAC7C,GAAG,EAAE,SAAS,aAEb,IAAI,EACJ,WAAW,IAAI,iCAAM,SAAS,EAAC,2BAA2B,YAAE,WAAW,GAAQ,EAChF,8BAAG,SAAS,EAAC,cAAc,GAAG,IACvB,EAER,YAAY;gBACX,IAAA,wBAAY,EACV,uBAAC,aAAa,IAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,YAC1D,QAAQ,GACK,EAChB,QAAQ,CAAC,IAAI,CACd,IACF,CACJ,CAAC;AACJ,CAAC,CAAC;AAhHW,QAAA,QAAQ,YAgHnB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode, type JSX } from "react";
|
|
2
|
+
export interface IFlashMessageProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare const FlashMessage: ({ children }: IFlashMessageProps) => JSX.Element;
|
|
6
|
+
export declare const lexicalFlashMessageStyles: import("@emotion/utils").SerializedStyles;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lexicalFlashMessageStyles = exports.FlashMessage = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_dom_1 = require("react-dom");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const FlashMessage = ({ children }) => {
|
|
8
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)("div", { className: "FlashMessage__overlay", role: "dialog", children: (0, jsx_runtime_1.jsx)("p", { className: "FlashMessage__alert", role: "alert", children: children }) }), document.body);
|
|
9
|
+
};
|
|
10
|
+
exports.FlashMessage = FlashMessage;
|
|
11
|
+
exports.lexicalFlashMessageStyles = (0, material_1.css) `
|
|
12
|
+
.FlashMessage__overlay {
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
position: fixed;
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
top: 0px;
|
|
19
|
+
bottom: 0px;
|
|
20
|
+
left: 0px;
|
|
21
|
+
right: 0px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.FlashMessage__alert {
|
|
25
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
26
|
+
color: white;
|
|
27
|
+
font-size: 1.5rem;
|
|
28
|
+
border-radius: 1em;
|
|
29
|
+
padding: 0.5em 1.5em;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
//# sourceMappingURL=FlashMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlashMessage.js","sourceRoot":"","sources":["../../../src/editor/ui/FlashMessage.tsx"],"names":[],"mappings":";;;;AACA,yCAAyC;AACzC,4CAAoC;AAM7B,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAsB,EAAe,EAAE;IAC5E,OAAO,IAAA,wBAAY,EACjB,gCAAK,SAAS,EAAC,uBAAuB,EAAC,IAAI,EAAC,QAAQ,YAClD,8BAAG,SAAS,EAAC,qBAAqB,EAAC,IAAI,EAAC,OAAO,YAC5C,QAAQ,GACP,GACA,EACN,QAAQ,CAAC,IAAI,CACd,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,YAAY,gBASvB;AAEW,QAAA,yBAAyB,GAAG,IAAA,cAAG,EAAA;;;;;;;;;;;;;;;;;;;;CAoB3C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HorizontalRuleButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const LexicalHorizontalRuleNode_1 = require("@lexical/react/LexicalHorizontalRuleNode");
|
|
6
|
+
const icons_1 = require("../../images/icons");
|
|
7
|
+
const HorizontalRuleButton = ({ activeEditor }) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
9
|
+
activeEditor.dispatchCommand(LexicalHorizontalRuleNode_1.INSERT_HORIZONTAL_RULE_COMMAND, undefined);
|
|
10
|
+
}, className: "toolbar-item spaced", title: "Horizontal Rule", type: "button", "aria-label": "Horizontal Rule", children: (0, jsx_runtime_1.jsx)(icons_1.HorizontalRuleIcon, {}) }));
|
|
11
|
+
};
|
|
12
|
+
exports.HorizontalRuleButton = HorizontalRuleButton;
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/ui/HorizontalRuleButton/index.tsx"],"names":[],"mappings":";;;;AACA,wFAA0F;AAG1F,8CAAwD;AAEjD,MAAM,oBAAoB,GAA+B,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;IACnF,OAAO,CACL,mCACE,OAAO,EAAE,GAAG,EAAE;YACZ,YAAY,CAAC,eAAe,CAAC,0DAA8B,EAAE,SAAS,CAAC,CAAC;QAC1E,CAAC,EACD,SAAS,EAAE,qBAAqB,EAChC,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAC,QAAQ,gBACF,iBAAiB,YAE5B,uBAAC,0BAAkB,KAAG,GACf,CACV,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,oBAAoB,wBAc/B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { IToolbarComponentProps } from "../../../common";
|
|
3
|
+
import { useModal } from "../../hooks";
|
|
4
|
+
interface IImageButtonProps extends Omit<IToolbarComponentProps, "disabled"> {
|
|
5
|
+
showModal: ReturnType<typeof useModal>[1];
|
|
6
|
+
}
|
|
7
|
+
export declare const ImageButton: FC<IImageButtonProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const plugins_1 = require("../../plugins");
|
|
6
|
+
const icons_1 = require("../../images/icons");
|
|
7
|
+
const ImageButton = ({ activeEditor, showModal }) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
9
|
+
showModal("Insert Image", onClose => (0, jsx_runtime_1.jsx)(plugins_1.InsertImageDialog, { activeEditor: activeEditor, onClose: onClose }));
|
|
10
|
+
}, className: "toolbar-item spaced", title: "Image", type: "button", "aria-label": "Image", children: (0, jsx_runtime_1.jsx)(icons_1.FileImageIcon, {}) }));
|
|
11
|
+
};
|
|
12
|
+
exports.ImageButton = ImageButton;
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/ui/ImageButton/index.tsx"],"names":[],"mappings":";;;;AAGA,2CAAkD;AAElD,8CAAmD;AAM5C,MAAM,WAAW,GAA0B,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE;IAChF,OAAO,CACL,mCACE,OAAO,EAAE,GAAG,EAAE;YACZ,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,CAAC,uBAAC,2BAAiB,IAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC,CAAC;QAC5G,CAAC,EACD,SAAS,EAAE,qBAAqB,EAChC,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,QAAQ,gBACF,OAAO,YAElB,uBAAC,qBAAa,KAAG,GACV,CACV,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,WAAW,eActB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { LexicalEditor } from "lexical";
|
|
3
|
+
export declare const ImageResizer: ({ onResizeStart, onResizeEnd, buttonRef, imageRef, maxWidth, editor, showCaption, setShowCaption, captionsEnabled, }: {
|
|
4
|
+
editor: LexicalEditor;
|
|
5
|
+
buttonRef: {
|
|
6
|
+
current: null | HTMLButtonElement;
|
|
7
|
+
};
|
|
8
|
+
imageRef: {
|
|
9
|
+
current: null | HTMLElement;
|
|
10
|
+
};
|
|
11
|
+
maxWidth?: number;
|
|
12
|
+
onResizeEnd: (width: "inherit" | number, height: "inherit" | number) => void;
|
|
13
|
+
onResizeStart: () => void;
|
|
14
|
+
setShowCaption: (show: boolean) => void;
|
|
15
|
+
showCaption: boolean;
|
|
16
|
+
captionsEnabled: boolean;
|
|
17
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageResizer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const utils_1 = require("@lexical/utils");
|
|
7
|
+
function clamp(value, min, max) {
|
|
8
|
+
return Math.min(Math.max(value, min), max);
|
|
9
|
+
}
|
|
10
|
+
const Direction = {
|
|
11
|
+
east: 1 << 0,
|
|
12
|
+
north: 1 << 3,
|
|
13
|
+
south: 1 << 1,
|
|
14
|
+
west: 1 << 2,
|
|
15
|
+
};
|
|
16
|
+
const ImageResizer = ({ onResizeStart, onResizeEnd, buttonRef, imageRef, maxWidth, editor, showCaption, setShowCaption, captionsEnabled, }) => {
|
|
17
|
+
const controlWrapperRef = (0, react_1.useRef)(null);
|
|
18
|
+
const userSelect = (0, react_1.useRef)({
|
|
19
|
+
priority: "",
|
|
20
|
+
value: "default",
|
|
21
|
+
});
|
|
22
|
+
const positioningRef = (0, react_1.useRef)({
|
|
23
|
+
currentHeight: 0,
|
|
24
|
+
currentWidth: 0,
|
|
25
|
+
direction: 0,
|
|
26
|
+
isResizing: false,
|
|
27
|
+
ratio: 0,
|
|
28
|
+
startHeight: 0,
|
|
29
|
+
startWidth: 0,
|
|
30
|
+
startX: 0,
|
|
31
|
+
startY: 0,
|
|
32
|
+
});
|
|
33
|
+
const editorRootElement = editor.getRootElement();
|
|
34
|
+
// Find max width, accounting for editor padding.
|
|
35
|
+
const maxWidthContainer = maxWidth
|
|
36
|
+
? maxWidth
|
|
37
|
+
: editorRootElement !== null
|
|
38
|
+
? editorRootElement.getBoundingClientRect().width - 20
|
|
39
|
+
: 100;
|
|
40
|
+
const maxHeightContainer = editorRootElement !== null ? editorRootElement.getBoundingClientRect().height - 20 : 100;
|
|
41
|
+
const minWidth = 100;
|
|
42
|
+
const minHeight = 100;
|
|
43
|
+
const setStartCursor = (direction) => {
|
|
44
|
+
const ew = direction === Direction.east || direction === Direction.west;
|
|
45
|
+
const ns = direction === Direction.north || direction === Direction.south;
|
|
46
|
+
const nwse = (direction & Direction.north && direction & Direction.west) ||
|
|
47
|
+
(direction & Direction.south && direction & Direction.east);
|
|
48
|
+
const cursorDir = ew ? "ew" : ns ? "ns" : nwse ? "nwse" : "nesw";
|
|
49
|
+
if (editorRootElement !== null) {
|
|
50
|
+
editorRootElement.style.setProperty("cursor", `${cursorDir}-resize`, "important");
|
|
51
|
+
}
|
|
52
|
+
if (document.body !== null) {
|
|
53
|
+
document.body.style.setProperty("cursor", `${cursorDir}-resize`, "important");
|
|
54
|
+
userSelect.current.value = document.body.style.getPropertyValue("-webkit-user-select");
|
|
55
|
+
userSelect.current.priority = document.body.style.getPropertyPriority("-webkit-user-select");
|
|
56
|
+
document.body.style.setProperty("-webkit-user-select", `none`, "important");
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const setEndCursor = () => {
|
|
60
|
+
if (editorRootElement !== null) {
|
|
61
|
+
editorRootElement.style.setProperty("cursor", "text");
|
|
62
|
+
}
|
|
63
|
+
if (document.body !== null) {
|
|
64
|
+
document.body.style.setProperty("cursor", "default");
|
|
65
|
+
document.body.style.setProperty("-webkit-user-select", userSelect.current.value, userSelect.current.priority);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const handlePointerDown = (event, direction) => {
|
|
69
|
+
if (!editor.isEditable()) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const image = imageRef.current;
|
|
73
|
+
const controlWrapper = controlWrapperRef.current;
|
|
74
|
+
if (image !== null && controlWrapper !== null) {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
const { width, height } = image.getBoundingClientRect();
|
|
77
|
+
const zoom = (0, utils_1.calculateZoomLevel)(image);
|
|
78
|
+
const positioning = positioningRef.current;
|
|
79
|
+
positioning.startWidth = width;
|
|
80
|
+
positioning.startHeight = height;
|
|
81
|
+
positioning.ratio = width / height;
|
|
82
|
+
positioning.currentWidth = width;
|
|
83
|
+
positioning.currentHeight = height;
|
|
84
|
+
positioning.startX = event.clientX / zoom;
|
|
85
|
+
positioning.startY = event.clientY / zoom;
|
|
86
|
+
positioning.isResizing = true;
|
|
87
|
+
positioning.direction = direction;
|
|
88
|
+
setStartCursor(direction);
|
|
89
|
+
onResizeStart();
|
|
90
|
+
controlWrapper.classList.add("image-control-wrapper--resizing");
|
|
91
|
+
image.style.height = `${height}px`;
|
|
92
|
+
image.style.width = `${width}px`;
|
|
93
|
+
document.addEventListener("pointermove", handlePointerMove);
|
|
94
|
+
document.addEventListener("pointerup", handlePointerUp);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const handlePointerMove = (event) => {
|
|
98
|
+
const image = imageRef.current;
|
|
99
|
+
const positioning = positioningRef.current;
|
|
100
|
+
const isHorizontal = positioning.direction & (Direction.east | Direction.west);
|
|
101
|
+
const isVertical = positioning.direction & (Direction.south | Direction.north);
|
|
102
|
+
if (image !== null && positioning.isResizing) {
|
|
103
|
+
const zoom = (0, utils_1.calculateZoomLevel)(image);
|
|
104
|
+
// Corner cursor
|
|
105
|
+
if (isHorizontal && isVertical) {
|
|
106
|
+
let diff = Math.floor(positioning.startX - event.clientX / zoom);
|
|
107
|
+
diff = positioning.direction & Direction.east ? -diff : diff;
|
|
108
|
+
const width = clamp(positioning.startWidth + diff, minWidth, maxWidthContainer);
|
|
109
|
+
const height = width / positioning.ratio;
|
|
110
|
+
image.style.width = `${width}px`;
|
|
111
|
+
image.style.height = `${height}px`;
|
|
112
|
+
positioning.currentHeight = height;
|
|
113
|
+
positioning.currentWidth = width;
|
|
114
|
+
}
|
|
115
|
+
else if (isVertical) {
|
|
116
|
+
let diff = Math.floor(positioning.startY - event.clientY / zoom);
|
|
117
|
+
diff = positioning.direction & Direction.south ? -diff : diff;
|
|
118
|
+
const height = clamp(positioning.startHeight + diff, minHeight, maxHeightContainer);
|
|
119
|
+
image.style.height = `${height}px`;
|
|
120
|
+
positioning.currentHeight = height;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
let diff = Math.floor(positioning.startX - event.clientX / zoom);
|
|
124
|
+
diff = positioning.direction & Direction.east ? -diff : diff;
|
|
125
|
+
const width = clamp(positioning.startWidth + diff, minWidth, maxWidthContainer);
|
|
126
|
+
image.style.width = `${width}px`;
|
|
127
|
+
positioning.currentWidth = width;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
const handlePointerUp = () => {
|
|
132
|
+
const image = imageRef.current;
|
|
133
|
+
const positioning = positioningRef.current;
|
|
134
|
+
const controlWrapper = controlWrapperRef.current;
|
|
135
|
+
if (image !== null && controlWrapper !== null && positioning.isResizing) {
|
|
136
|
+
const width = positioning.currentWidth;
|
|
137
|
+
const height = positioning.currentHeight;
|
|
138
|
+
positioning.startWidth = 0;
|
|
139
|
+
positioning.startHeight = 0;
|
|
140
|
+
positioning.ratio = 0;
|
|
141
|
+
positioning.startX = 0;
|
|
142
|
+
positioning.startY = 0;
|
|
143
|
+
positioning.currentWidth = 0;
|
|
144
|
+
positioning.currentHeight = 0;
|
|
145
|
+
positioning.isResizing = false;
|
|
146
|
+
controlWrapper.classList.remove("image-control-wrapper--resizing");
|
|
147
|
+
setEndCursor();
|
|
148
|
+
onResizeEnd(width, height);
|
|
149
|
+
document.removeEventListener("pointermove", handlePointerMove);
|
|
150
|
+
document.removeEventListener("pointerup", handlePointerUp);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: controlWrapperRef, children: [!showCaption && captionsEnabled && ((0, jsx_runtime_1.jsx)("button", { className: "image-caption-button", ref: buttonRef, onClick: () => {
|
|
154
|
+
setShowCaption(!showCaption);
|
|
155
|
+
}, children: "Add Caption" })), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-n", onPointerDown: event => {
|
|
156
|
+
handlePointerDown(event, Direction.north);
|
|
157
|
+
} }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-ne", onPointerDown: event => {
|
|
158
|
+
handlePointerDown(event, Direction.north | Direction.east);
|
|
159
|
+
} }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-e", onPointerDown: event => {
|
|
160
|
+
handlePointerDown(event, Direction.east);
|
|
161
|
+
} }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-se", onPointerDown: event => {
|
|
162
|
+
handlePointerDown(event, Direction.south | Direction.east);
|
|
163
|
+
} }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-s", onPointerDown: event => {
|
|
164
|
+
handlePointerDown(event, Direction.south);
|
|
165
|
+
} }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-sw", onPointerDown: event => {
|
|
166
|
+
handlePointerDown(event, Direction.south | Direction.west);
|
|
167
|
+
} }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-w", onPointerDown: event => {
|
|
168
|
+
handlePointerDown(event, Direction.west);
|
|
169
|
+
} }), (0, jsx_runtime_1.jsx)("div", { className: "image-resizer image-resizer-nw", onPointerDown: event => {
|
|
170
|
+
handlePointerDown(event, Direction.north | Direction.west);
|
|
171
|
+
} })] }));
|
|
172
|
+
};
|
|
173
|
+
exports.ImageResizer = ImageResizer;
|
|
174
|
+
//# sourceMappingURL=ImageResizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageResizer.js","sourceRoot":"","sources":["../../../src/editor/ui/ImageResizer.tsx"],"names":[],"mappings":";;;;AACA,iCAA+B;AAE/B,0CAAoD;AAEpD,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,CAAC,IAAI,CAAC;IACZ,KAAK,EAAE,CAAC,IAAI,CAAC;IACb,KAAK,EAAE,CAAC,IAAI,CAAC;IACb,IAAI,EAAE,CAAC,IAAI,CAAC;CACb,CAAC;AAEK,MAAM,YAAY,GAAG,CAAC,EAC3B,aAAa,EACb,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,WAAW,EACX,cAAc,EACd,eAAe,GAWhB,EAAe,EAAE;IAChB,MAAM,iBAAiB,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC;QACxB,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,IAAA,cAAM,EAU1B;QACD,aAAa,EAAE,CAAC;QAChB,YAA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AC7D,CAAC,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AA3PW,QAAA,YAAY,gBA2PvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ItalicButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const lexical_1 = require("lexical");
|
|
6
|
+
const shortcuts_1 = require("../../plugins/ShortcutsPlugin/shortcuts");
|
|
7
|
+
const icons_1 = require("../../images/icons");
|
|
8
|
+
const ItalicButton = ({ activeEditor, isItalic, disabled }) => {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)("button", { disabled: disabled, onClick: () => {
|
|
10
|
+
activeEditor.dispatchCommand(lexical_1.FORMAT_TEXT_COMMAND, "italic");
|
|
11
|
+
}, className: "toolbar-item spaced " + (isItalic ? "active" : ""), title: `Italic (${shortcuts_1.SHORTCUTS.ITALIC})`, type: "button", "aria-label": `Format text as italics. Shortcut: ${shortcuts_1.SHORTCUTS.ITALIC}`, children: (0, jsx_runtime_1.jsx)(icons_1.TypeItalicIcon, {}) }));
|
|
12
|
+
};
|
|
13
|
+
exports.ItalicButton = ItalicButton;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/ui/ItalicButton/index.tsx"],"names":[],"mappings":";;;;AACA,qCAA8C;AAE9C,uEAAoE;AAEpE,8CAAoD;AAM7C,MAAM,YAAY,GAA2B,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3F,OAAO,CACL,mCACE,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE;YACZ,YAAY,CAAC,eAAe,CAAC,6BAAmB,EAAE,QAAQ,CAAC,CAAC;QAC9D,CAAC,EACD,SAAS,EAAE,sBAAsB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAC9D,KAAK,EAAE,WAAW,qBAAS,CAAC,MAAM,GAAG,EACrC,IAAI,EAAC,QAAQ,gBACD,qCAAqC,qBAAS,CAAC,MAAM,EAAE,YAEnE,uBAAC,sBAAc,KAAG,GACX,CACV,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,YAAY,gBAevB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LeftAlignButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const lexical_1 = require("lexical");
|
|
6
|
+
const shortcuts_1 = require("../../plugins/ShortcutsPlugin/shortcuts");
|
|
7
|
+
const icons_1 = require("../../images/icons");
|
|
8
|
+
const LeftAlignButton = ({ activeEditor, isLeftAlign, disabled }) => {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)("button", { disabled: disabled, onClick: () => {
|
|
10
|
+
activeEditor.dispatchCommand(lexical_1.FORMAT_ELEMENT_COMMAND, "left");
|
|
11
|
+
}, className: "toolbar-item spaced " + (isLeftAlign ? "active" : ""), title: `Left Align (${shortcuts_1.SHORTCUTS.LEFT_ALIGN})`, type: "button", "aria-label": `Format text as left align. Shortcut: ${shortcuts_1.SHORTCUTS.LEFT_ALIGN}`, children: (0, jsx_runtime_1.jsx)(icons_1.TextLeftIcon, {}) }));
|
|
12
|
+
};
|
|
13
|
+
exports.LeftAlignButton = LeftAlignButton;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/ui/LeftAlignButton/index.tsx"],"names":[],"mappings":";;;;AACA,qCAAiD;AAEjD,uEAAoE;AAEpE,8CAAkD;AAM3C,MAAM,eAAe,GAA8B,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpG,OAAO,CACL,mCACE,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE;YACZ,YAAY,CAAC,eAAe,CAAC,gCAAsB,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC,EACD,SAAS,EAAE,sBAAsB,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EACjE,KAAK,EAAE,eAAe,qBAAS,CAAC,UAAU,GAAG,EAC7C,IAAI,EAAC,QAAQ,gBACD,wCAAwC,qBAAS,CAAC,UAAU,EAAE,YAE1E,uBAAC,oBAAY,KAAG,GACT,CACV,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,eAAe,mBAe1B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { IToolbarComponentProps } from "../../../common";
|
|
3
|
+
interface ILinkButtonProps extends Omit<IToolbarComponentProps, "activeEditor"> {
|
|
4
|
+
isLink: boolean;
|
|
5
|
+
insertLink: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const LinkButton: FC<ILinkButtonProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinkButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const shortcuts_1 = require("../../plugins/ShortcutsPlugin/shortcuts");
|
|
6
|
+
const icons_1 = require("../../images/icons");
|
|
7
|
+
const LinkButton = ({ insertLink, isLink, disabled }) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("button", { disabled: disabled, onClick: insertLink, className: "toolbar-item spaced " + (isLink ? "active" : ""), "aria-label": "Insert link", title: `Insert link (${shortcuts_1.SHORTCUTS.INSERT_LINK})`, type: "button", children: (0, jsx_runtime_1.jsx)(icons_1.LinkIcon, {}) }));
|
|
9
|
+
};
|
|
10
|
+
exports.LinkButton = LinkButton;
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/ui/LinkButton/index.tsx"],"names":[],"mappings":";;;;AAEA,uEAAoE;AAEpE,8CAA8C;AAOvC,MAAM,UAAU,GAAyB,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnF,OAAO,CACL,mCACE,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,sBAAsB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,gBACjD,aAAa,EACxB,KAAK,EAAE,gBAAgB,qBAAS,CAAC,WAAW,GAAG,EAC/C,IAAI,EAAC,QAAQ,YAEb,uBAAC,gBAAQ,KAAG,GACL,CACV,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,UAAU,cAarB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export declare const Modal: ({ onClose, children, title, closeOnClickOutside, }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
closeOnClickOutside?: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
title: string;
|
|
8
|
+
}) => JSX.Element;
|
|
9
|
+
export declare const lexicalModalStyles: import("@emotion/utils").SerializedStyles;
|