@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,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getThemeSelector = getThemeSelector;
|
|
4
|
+
function getThemeSelector(getTheme, name) {
|
|
5
|
+
var _a;
|
|
6
|
+
const className = (_a = getTheme()) === null || _a === void 0 ? void 0 : _a[name];
|
|
7
|
+
if (typeof className !== "string") {
|
|
8
|
+
throw new Error(`getThemeClass: required theme property ${name} not defined`);
|
|
9
|
+
}
|
|
10
|
+
return className
|
|
11
|
+
.split(/\s+/g)
|
|
12
|
+
.map(cls => `.${cls}`)
|
|
13
|
+
.join();
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=getThemeSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getThemeSelector.js","sourceRoot":"","sources":["../../../src/editor/utils/getThemeSelector.ts"],"names":[],"mappings":";;AAEA,4CAYC;AAZD,SAAgB,gBAAgB,CAC9B,QAAqD,EACrD,IAA8B;;IAE9B,MAAM,SAAS,GAAG,MAAA,QAAQ,EAAE,0CAAG,IAAI,CAAC,CAAC;IACrC,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,0CAA0C,IAAI,cAAc,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,SAAS;SACb,KAAK,CAAC,MAAM,CAAC;SACb,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC;SACrB,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./dropDownActiveClass";
|
|
2
|
+
export * from "./getDOMRangeRect";
|
|
3
|
+
export * from "./getSelectedNode";
|
|
4
|
+
export * from "./getThemeSelector";
|
|
5
|
+
export * from "./joinClasses";
|
|
6
|
+
export * from "./parseVideoUrl";
|
|
7
|
+
export * from "./setFloatingElemPosition";
|
|
8
|
+
export * from "./setFloatingElemPositionForLinkEditor";
|
|
9
|
+
export * from "./url";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./dropDownActiveClass"), exports);
|
|
18
|
+
__exportStar(require("./getDOMRangeRect"), exports);
|
|
19
|
+
__exportStar(require("./getSelectedNode"), exports);
|
|
20
|
+
__exportStar(require("./getThemeSelector"), exports);
|
|
21
|
+
__exportStar(require("./joinClasses"), exports);
|
|
22
|
+
__exportStar(require("./parseVideoUrl"), exports);
|
|
23
|
+
__exportStar(require("./setFloatingElemPosition"), exports);
|
|
24
|
+
__exportStar(require("./setFloatingElemPositionForLinkEditor"), exports);
|
|
25
|
+
__exportStar(require("./url"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/editor/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,oDAAkC;AAClC,oDAAkC;AAClC,qDAAmC;AACnC,gDAA8B;AAC9B,kDAAgC;AAChC,4DAA0C;AAC1C,yEAAuD;AACvD,wCAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const joinClasses: (...args: Array<string | boolean | null | undefined>) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.joinClasses = void 0;
|
|
4
|
+
const joinClasses = (...args) => {
|
|
5
|
+
return args.filter(Boolean).join(" ");
|
|
6
|
+
};
|
|
7
|
+
exports.joinClasses = joinClasses;
|
|
8
|
+
//# sourceMappingURL=joinClasses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joinClasses.js","sourceRoot":"","sources":["../../../src/editor/utils/joinClasses.ts"],"names":[],"mappings":";;;AAAO,MAAM,WAAW,GAAG,CAAC,GAAG,IAAgD,EAAE,EAAE;IACjF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxC,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type VideoProvider = "youtube" | "vimeo";
|
|
2
|
+
export type ParsedVideo = {
|
|
3
|
+
provider: "youtube";
|
|
4
|
+
id: string;
|
|
5
|
+
embedUrl: string;
|
|
6
|
+
originalUrl: string;
|
|
7
|
+
startAt?: number;
|
|
8
|
+
} | {
|
|
9
|
+
provider: "vimeo";
|
|
10
|
+
id: string;
|
|
11
|
+
embedUrl: string;
|
|
12
|
+
originalUrl: string;
|
|
13
|
+
startAt?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function parseVideoUrl(raw: string): ParsedVideo | null;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseVideoUrl = parseVideoUrl;
|
|
4
|
+
const TIME_RE = /(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?/i;
|
|
5
|
+
function parseTimeToSeconds(raw) {
|
|
6
|
+
if (!raw) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
if (/^\d+$/.test(raw)) {
|
|
10
|
+
return Number(raw);
|
|
11
|
+
}
|
|
12
|
+
if (raw.includes(":")) {
|
|
13
|
+
const parts = raw.split(":").map((p) => Number(p));
|
|
14
|
+
if (parts.some(Number.isNaN)) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
let seconds = 0;
|
|
18
|
+
for (let i = 0; i < parts.length; i++) {
|
|
19
|
+
const power = parts.length - i - 1;
|
|
20
|
+
seconds += parts[i] * Math.pow(60, power);
|
|
21
|
+
}
|
|
22
|
+
return seconds;
|
|
23
|
+
}
|
|
24
|
+
const m = TIME_RE.exec(raw);
|
|
25
|
+
if (m) {
|
|
26
|
+
const h = m[1] ? Number(m[1]) : 0;
|
|
27
|
+
const min = m[2] ? Number(m[2]) : 0;
|
|
28
|
+
const s = m[3] ? Number(m[3]) : 0;
|
|
29
|
+
return h * 3600 + min * 60 + s;
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
function parseYoutube(url) {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
const host = url.hostname.toLowerCase();
|
|
36
|
+
let id;
|
|
37
|
+
if (host === "youtu.be") {
|
|
38
|
+
const splitPathname = url.pathname.split("/").filter(Boolean);
|
|
39
|
+
id = (_a = splitPathname[0]) !== null && _a !== void 0 ? _a : null;
|
|
40
|
+
}
|
|
41
|
+
else if (host.endsWith("youtube.com") ||
|
|
42
|
+
host.endsWith("youtube-nocookie.com")) {
|
|
43
|
+
const path = url.pathname.replace(/^\/+/, "");
|
|
44
|
+
const params = url.searchParams;
|
|
45
|
+
if (path === "watch") {
|
|
46
|
+
id = params.get("v");
|
|
47
|
+
}
|
|
48
|
+
else if (path.startsWith("shorts/")) {
|
|
49
|
+
id = (_b = path.split("/")[1]) !== null && _b !== void 0 ? _b : null;
|
|
50
|
+
}
|
|
51
|
+
else if (path.startsWith("embed/")) {
|
|
52
|
+
id = (_c = path.split("/")[1]) !== null && _c !== void 0 ? _c : null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (!id)
|
|
56
|
+
return null;
|
|
57
|
+
const start = parseTimeToSeconds(url.searchParams.get("t") || url.searchParams.get("start")) ||
|
|
58
|
+
(url.hash.startsWith("#t=")
|
|
59
|
+
? parseTimeToSeconds(url.hash.slice(3))
|
|
60
|
+
: undefined);
|
|
61
|
+
const embedUrl = `https://www.youtube-nocookie.com/embed/${encodeURIComponent(id)}${start ? `?start=${start}` : ""}`;
|
|
62
|
+
return {
|
|
63
|
+
provider: "youtube",
|
|
64
|
+
id,
|
|
65
|
+
startAt: start,
|
|
66
|
+
embedUrl,
|
|
67
|
+
originalUrl: url.toString(),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function parseVimeo(url) {
|
|
71
|
+
const host = url.hostname.toLowerCase();
|
|
72
|
+
let id = null;
|
|
73
|
+
if (host === "vimeo.com") {
|
|
74
|
+
const seg = url.pathname.split("/").filter(Boolean);
|
|
75
|
+
if (seg.length >= 1 && /^\d+$/.test(seg[0]))
|
|
76
|
+
id = seg[0];
|
|
77
|
+
}
|
|
78
|
+
else if (host === "player.vimeo.com") {
|
|
79
|
+
const seg = url.pathname.split("/").filter(Boolean);
|
|
80
|
+
if (seg[0] === "video" && /^\d+$/.test(seg[1]))
|
|
81
|
+
id = seg[1];
|
|
82
|
+
}
|
|
83
|
+
if (!id)
|
|
84
|
+
return null;
|
|
85
|
+
const start = parseTimeToSeconds(url.searchParams.get("t")) ||
|
|
86
|
+
(url.hash.startsWith("#t=")
|
|
87
|
+
? parseTimeToSeconds(url.hash.slice(3))
|
|
88
|
+
: undefined);
|
|
89
|
+
const anchor = start ? `#t=${start}s` : "";
|
|
90
|
+
const embedUrl = `https://player.vimeo.com/video/${encodeURIComponent(id)}${anchor}`;
|
|
91
|
+
return {
|
|
92
|
+
provider: "vimeo",
|
|
93
|
+
id,
|
|
94
|
+
startAt: start,
|
|
95
|
+
embedUrl,
|
|
96
|
+
originalUrl: url.toString(),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function parseVideoUrl(raw) {
|
|
100
|
+
let url;
|
|
101
|
+
try {
|
|
102
|
+
url = new URL(raw.trim());
|
|
103
|
+
}
|
|
104
|
+
catch (_a) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
const y = parseYoutube(url);
|
|
108
|
+
if (y)
|
|
109
|
+
return y;
|
|
110
|
+
const v = parseVimeo(url);
|
|
111
|
+
if (v)
|
|
112
|
+
return v;
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=parseVideoUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseVideoUrl.js","sourceRoot":"","sources":["../../../src/editor/utils/parseVideoUrl.ts"],"names":[],"mappings":";;AAgIA,sCAYC;AA1HD,MAAM,OAAO,GAAG,oCAAoC,CAAC;AAErD,SAAS,kBAAkB,CAAC,GAAkB;IAC5C,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,IAAI,GAAG,CAA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+
export declare function setFloatingElemPosition(targetRect: DOMRect | null, floatingElem: HTMLElement, anchorElem: HTMLElement, isLink?: boolean, verticalGap?: number, horizontalOffset?: number): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setFloatingElemPosition = setFloatingElemPosition;
|
|
4
|
+
const VERTICAL_GAP = 10;
|
|
5
|
+
const HORIZONTAL_OFFSET = 5;
|
|
6
|
+
function setFloatingElemPosition(targetRect, floatingElem, anchorElem, isLink = false, verticalGap = VERTICAL_GAP, horizontalOffset = HORIZONTAL_OFFSET) {
|
|
7
|
+
const scrollerElem = anchorElem.parentElement;
|
|
8
|
+
if (targetRect === null || !scrollerElem) {
|
|
9
|
+
floatingElem.style.opacity = "0";
|
|
10
|
+
floatingElem.style.transform = "translate(-10000px, -10000px)";
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const floatingElemRect = floatingElem.getBoundingClientRect();
|
|
14
|
+
const anchorElementRect = anchorElem.getBoundingClientRect();
|
|
15
|
+
const editorScrollerRect = scrollerElem.getBoundingClientRect();
|
|
16
|
+
let top = targetRect.top - floatingElemRect.height - verticalGap;
|
|
17
|
+
let left = targetRect.left - horizontalOffset;
|
|
18
|
+
// Check if text is end-aligned
|
|
19
|
+
const selection = window.getSelection();
|
|
20
|
+
if (selection && selection.rangeCount > 0) {
|
|
21
|
+
const range = selection.getRangeAt(0);
|
|
22
|
+
const textNode = range.startContainer;
|
|
23
|
+
if (textNode.nodeType === Node.ELEMENT_NODE || textNode.parentElement) {
|
|
24
|
+
const textElement = textNode.nodeType === Node.ELEMENT_NODE ? textNode : textNode.parentElement;
|
|
25
|
+
const textAlign = window.getComputedStyle(textElement).textAlign;
|
|
26
|
+
if (textAlign === "right" || textAlign === "end") {
|
|
27
|
+
// For end-aligned text, position the toolbar relative to the text end
|
|
28
|
+
left = targetRect.right - floatingElemRect.width + horizontalOffset;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (top < editorScrollerRect.top) {
|
|
33
|
+
// adjusted height for link element if the element is at top
|
|
34
|
+
top += floatingElemRect.height + targetRect.height + verticalGap * (isLink ? 9 : 2);
|
|
35
|
+
}
|
|
36
|
+
if (left + floatingElemRect.width > editorScrollerRect.right) {
|
|
37
|
+
left = editorScrollerRect.right - floatingElemRect.width - horizontalOffset;
|
|
38
|
+
}
|
|
39
|
+
if (left < editorScrollerRect.left) {
|
|
40
|
+
left = editorScrollerRect.left + horizontalOffset;
|
|
41
|
+
}
|
|
42
|
+
top -= anchorElementRect.top;
|
|
43
|
+
left -= anchorElementRect.left;
|
|
44
|
+
floatingElem.style.opacity = "1";
|
|
45
|
+
floatingElem.style.transform = `translate(${left}px, ${top}px)`;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=setFloatingElemPosition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setFloatingElemPosition.js","sourceRoot":"","sources":["../../../src/editor/utils/setFloatingElemPosition.ts"],"names":[],"mappings":";;AAGA,0DA0DC;AA7DD,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,SAAgB,uBAAuB,CACrC,UAA0B,EAC1B,YAAyB,EACzB,UAAuB,EACvB,MAAM,GAAG,KAAK,EACd,cAAsB,YAAY,EAClC,mBAA2B,iBAAiB;IAE5C,MAAM,YAAY,GAAG,UAAU,CAAC,aAAa,CAAC;IAE9C,IAAI,UAAU,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACzC,YAAY,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;QACjC,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,+BAA+B,CAAC;QAC/D,OAAO;IACT,CAAC;IAED,MAAM,gBAAgB,GAAG,YAAY,CAAC,qBAAqB,EAAE,CAAC;IAC9D,MAAM,iBAAiB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C,CAAC;IACtF,CAAC;IAED,IAAI,IAAI,GAAG,gBAAgB,CAAC,KAAK,GAAG,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAC7D,IAAI,GAAG,kBAAkB,CAAC,KAAK,GAAG,gBAAgB,CAAC,KAAK,GAAG,gBAAgB,CAAC;IAC9E,CAAC;IAED,IAAI,IAAI,GAAG,kBAAkB,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,GAAG,kBAAkB,CAAC,IAAI,GAAG,gBAAgB,CAAC;IACpD,CAAC;IAED,GAAG,IAAI,iBAAiB,CAAC,GAAG,CAAC;IAC7B,IAAI,IAAI,iBAAiB,CAAC,IAAI,CAAC;IAE/B,YAAY,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;IACjC,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,aAAa,IAAI,OAAO,GAAG,KAAK,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setFloatingElemPositionForLinkEditor(targetRect: DOMRect | null, floatingElem: HTMLElement, anchorElem: HTMLElement, verticalGap?: number, horizontalOffset?: number): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setFloatingElemPositionForLinkEditor = setFloatingElemPositionForLinkEditor;
|
|
4
|
+
const VERTICAL_GAP = 10;
|
|
5
|
+
const HORIZONTAL_OFFSET = 5;
|
|
6
|
+
function setFloatingElemPositionForLinkEditor(targetRect, floatingElem, anchorElem, verticalGap = VERTICAL_GAP, horizontalOffset = HORIZONTAL_OFFSET) {
|
|
7
|
+
const scrollerElem = anchorElem.parentElement;
|
|
8
|
+
if (targetRect === null || !scrollerElem) {
|
|
9
|
+
floatingElem.style.opacity = "0";
|
|
10
|
+
floatingElem.style.transform = "translate(-10000px, -10000px)";
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const floatingElemRect = floatingElem.getBoundingClientRect();
|
|
14
|
+
const anchorElementRect = anchorElem.getBoundingClientRect();
|
|
15
|
+
const editorScrollerRect = scrollerElem.getBoundingClientRect();
|
|
16
|
+
let top = targetRect.top - verticalGap;
|
|
17
|
+
let left = targetRect.left - horizontalOffset;
|
|
18
|
+
if (top < editorScrollerRect.top) {
|
|
19
|
+
top += floatingElemRect.height + targetRect.height + verticalGap * 2;
|
|
20
|
+
}
|
|
21
|
+
if (left + floatingElemRect.width > editorScrollerRect.right) {
|
|
22
|
+
left = editorScrollerRect.right - floatingElemRect.width - horizontalOffset;
|
|
23
|
+
}
|
|
24
|
+
top -= anchorElementRect.top;
|
|
25
|
+
left -= anchorElementRect.left;
|
|
26
|
+
floatingElem.style.opacity = "1";
|
|
27
|
+
floatingElem.style.transform = `translate(${left}px, ${top}px)`;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=setFloatingElemPositionForLinkEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setFloatingElemPositionForLinkEditor.js","sourceRoot":"","sources":["../../../src/editor/utils/setFloatingElemPositionForLinkEditor.ts"],"names":[],"mappings":";;AAGA,oFAmCC;AAtCD,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,SAAgB,oCAAoC,CAClD,UAA0B,EAC1B,YAAyB,EACzB,UAAuB,EACvB,cAAsB,YAAY,EAClC,mBAA2B,iBAAiB;IAE5C,MAAM,YAAY,GAAG,UAAU,CAAC,aAAa,CAAC;IAE9C,IAAI,UAAU,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACzC,YAAY,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;QACjC,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,+BAA+B,CAAC;QAC/D,OAAO;IACT,CAAC;IAED,MAAM,gBAAgB,GAAG,YAAY,CAAC,qBAAqB,EAAE,CAAC;IAC9D,MAAM,iBAAiB,GAAG,UAAU,CAAC,qBAAqB,EAAE,CAAC;IAC7D,MAAM,kBAAkB,GAAG,YAAY,CAAC,qBAAqB,EAAE,CAAC;IAEhE,IAAI,GAAG,GAAG,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC;IACvC,IAAI,IAAI,GAAG,UAAU,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAE9C,IAAI,GAAG,GAAG,kBAAkB,CAAC,GAAG,EAAE,CAAC;QACjC,GAAG,IAAI,gBAAgB,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,GAAG,WAAW,GAAG,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,IAAI,GAAG,gBAAgB,CAAC,KAAK,GAAG,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAC7D,IAAI,GAAG,kBAAkB,CAAC,KAAK,GAAG,gBAAgB,CAAC,KAAK,GAAG,gBAAgB,CAAC;IAC9E,CAAC;IAED,GAAG,IAAI,iBAAiB,CAAC,GAAG,CAAC;IAC7B,IAAI,IAAI,iBAAiB,CAAC,IAAI,CAAC;IAE/B,YAAY,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;IACjC,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,aAAa,IAAI,OAAO,GAAG,KAAK,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sanitizeUrl = sanitizeUrl;
|
|
4
|
+
exports.validateUrl = validateUrl;
|
|
5
|
+
const SUPPORTED_URL_PROTOCOLS = new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
|
|
6
|
+
function sanitizeUrl(url) {
|
|
7
|
+
try {
|
|
8
|
+
const parsedUrl = new URL(url);
|
|
9
|
+
if (!SUPPORTED_URL_PROTOCOLS.has(parsedUrl.protocol)) {
|
|
10
|
+
return "about:blank";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
catch (_a) {
|
|
14
|
+
return url;
|
|
15
|
+
}
|
|
16
|
+
return url;
|
|
17
|
+
}
|
|
18
|
+
// Source: https://stackoverflow.com/a/8234912/2013580
|
|
19
|
+
const urlRegExp = new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);
|
|
20
|
+
function validateUrl(url) {
|
|
21
|
+
// TODO Fix UI for link insertion; it should never default to an invalid URL such as https://.
|
|
22
|
+
// Maybe show a dialog where they user can type the URL before inserting it.
|
|
23
|
+
return url === "https://" || urlRegExp.test(url);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../../src/editor/utils/url.ts"],"names":[],"mappings":";;AAEA,kCAWC;AAOD,kCAIC;AAxBD,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAExF,SAAgB,WAAW,CAAC,GAAW;IACrC,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAE/B,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrD,OAAO,aAAa,CAAC;QACvB,CAAC;IACH,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,sDAAsD;AACtD,MAAM,SAAS,GAAG,IAAI,MAAM,CAC1B,4JAA4J,CAC7J,CAAC;AAEF,SAAgB,WAAW,CAAC,GAAW;IACrC,8FAA8F;IAC9F,4EAA4E;IAC5E,OAAO,GAAG,KAAK,UAAU,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.muiLexicalStyles = void 0;
|
|
18
|
+
const plugins_1 = require("./editor/plugins");
|
|
19
|
+
const themes_1 = require("./editor/themes");
|
|
20
|
+
const editorStyles_1 = require("./editor/editorStyles");
|
|
21
|
+
const ui_1 = require("./editor/ui");
|
|
22
|
+
const nodes_1 = require("./editor/nodes");
|
|
23
|
+
__exportStar(require("./editor"), exports);
|
|
24
|
+
__exportStar(require("./display"), exports);
|
|
25
|
+
exports.muiLexicalStyles = [
|
|
26
|
+
...ui_1.componentsStyles,
|
|
27
|
+
editorStyles_1.editorStyles,
|
|
28
|
+
nodes_1.imageNodeStyles,
|
|
29
|
+
nodes_1.inlineImageNodeStyles,
|
|
30
|
+
plugins_1.codeActionMenuPluginStyles,
|
|
31
|
+
plugins_1.floatLinkEditorPluginStyles,
|
|
32
|
+
plugins_1.floatTextFormatToolbarPluginStyles,
|
|
33
|
+
plugins_1.tableCellResizerPluginStyles,
|
|
34
|
+
themes_1.playgroundEditorThemeStyles,
|
|
35
|
+
nodes_1.videoNodeStyles,
|
|
36
|
+
];
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAK0B;AAC1B,4CAA8D;AAC9D,wDAAqD;AACrD,oCAA+C;AAC/C,0CAAyF;AAEzF,2CAAyB;AACzB,4CAA0B;AACb,QAAA,gBAAgB,GAAG;IAC9B,GAAG,qBAAgB;IACnB,2BAAY;IACZ,uBAAe;IACf,6BAAqB;IACrB,oCAA0B;IAC1B,qCAA2B;IAC3B,4CAAkC;IAClC,sCAA4B;IAC5B,oCAA2B;IAC3B,uBAAe;CAChB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import typescriptRules from "@ethberry/eslint-config/presets/tsx.mjs";
|
|
2
|
+
import jestRules from "@ethberry/eslint-config/tests/jest.mjs";
|
|
3
|
+
|
|
4
|
+
// DON'T ADD ANY RULES!
|
|
5
|
+
// FIX YOUR SHIT!!!
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{
|
|
9
|
+
ignores: [
|
|
10
|
+
"**/dist",
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
languageOptions: {
|
|
16
|
+
parserOptions: {
|
|
17
|
+
project: [
|
|
18
|
+
"./tsconfig.eslint.json",
|
|
19
|
+
],
|
|
20
|
+
tsconfigRootDir: import.meta.dirname
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
...typescriptRules,
|
|
26
|
+
...jestRules,
|
|
27
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": {
|
|
3
|
+
"email": "trejgun@gmail.com",
|
|
4
|
+
"name": "TrejGun",
|
|
5
|
+
"url": "https://ethberry.io/"
|
|
6
|
+
},
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/TrejGun/mui-lexical/issues"
|
|
9
|
+
},
|
|
10
|
+
"contributors": [
|
|
11
|
+
{
|
|
12
|
+
"email": "pro200hummer@gmail.com",
|
|
13
|
+
"name": "Pavel Nikalaichyk",
|
|
14
|
+
"url": "https://github.com/pro200hummer"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@emotion/cache": "11.14.0",
|
|
19
|
+
"@emotion/react": "11.14.0",
|
|
20
|
+
"@emotion/server": "11.11.0",
|
|
21
|
+
"@emotion/styled": "11.14.1",
|
|
22
|
+
"@lexical/code": "0.38.2",
|
|
23
|
+
"@lexical/link": "0.38.2",
|
|
24
|
+
"@lexical/list": "0.38.2",
|
|
25
|
+
"@lexical/markdown": "0.38.2",
|
|
26
|
+
"@lexical/overflow": "0.38.2",
|
|
27
|
+
"@lexical/react": "0.38.2",
|
|
28
|
+
"@lexical/rich-text": "0.38.2",
|
|
29
|
+
"@lexical/selection": "0.38.2",
|
|
30
|
+
"@lexical/table": "0.38.2",
|
|
31
|
+
"@lexical/utils": "0.38.2",
|
|
32
|
+
"@mui/icons-material": "^7.0.0",
|
|
33
|
+
"@mui/material": "^7.0.0",
|
|
34
|
+
"lexical": "0.38.2",
|
|
35
|
+
"lodash-es": "4.17.21",
|
|
36
|
+
"mdi-material-ui": "7.9.4"
|
|
37
|
+
},
|
|
38
|
+
"description": "Material-UI Lexical Editor and Viewer",
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@babel/preset-env": "7.28.5",
|
|
41
|
+
"@babel/preset-react": "7.28.5",
|
|
42
|
+
"@babel/preset-typescript": "7.28.5",
|
|
43
|
+
"@ethberry/eslint-config": "5.0.9",
|
|
44
|
+
"@storybook/addon-essentials": "8.4.5",
|
|
45
|
+
"@storybook/addon-interactions": "8.4.5",
|
|
46
|
+
"@storybook/addon-links": "8.4.5",
|
|
47
|
+
"@storybook/addon-webpack5-compiler-babel": "4.0.0",
|
|
48
|
+
"@storybook/blocks": "8.4.5",
|
|
49
|
+
"@storybook/manager-api": "8.6.14",
|
|
50
|
+
"@storybook/react": "8.4.5",
|
|
51
|
+
"@storybook/react-webpack5": "8.4.5",
|
|
52
|
+
"@storybook/test": "8.4.5",
|
|
53
|
+
"@svgr/webpack": "8.1.0",
|
|
54
|
+
"@types/lodash-es": "4.17.12",
|
|
55
|
+
"@types/node": "22.19.0",
|
|
56
|
+
"@types/react": "19.2.2",
|
|
57
|
+
"@types/react-dom": "19.2.2",
|
|
58
|
+
"husky": "9.1.7",
|
|
59
|
+
"lint-staged": "16.2.6",
|
|
60
|
+
"prettier": "3.6.2",
|
|
61
|
+
"react": "19.2.0",
|
|
62
|
+
"react-dom": "19.2.0",
|
|
63
|
+
"rimraf": "6.0.1",
|
|
64
|
+
"storybook": "8.4.5",
|
|
65
|
+
"typescript": "5.9.3",
|
|
66
|
+
"webpack": "5.97.1"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=20"
|
|
70
|
+
},
|
|
71
|
+
"homepage": "https://github.com/TrejGun/mui-lexical#readme",
|
|
72
|
+
"keywords": [
|
|
73
|
+
"material-ui",
|
|
74
|
+
"mui",
|
|
75
|
+
"lexical editor",
|
|
76
|
+
"rte",
|
|
77
|
+
"react",
|
|
78
|
+
"text editor",
|
|
79
|
+
"lexical"
|
|
80
|
+
],
|
|
81
|
+
"license": "MIT",
|
|
82
|
+
"main": "./dist/index.js",
|
|
83
|
+
"name": "@ethberry/mui-lexical",
|
|
84
|
+
"peerDependencies": {
|
|
85
|
+
"@mui/icons-material": "^7.0.0",
|
|
86
|
+
"@mui/material": "^7.0.0",
|
|
87
|
+
"@mui/system": "^7.0.0",
|
|
88
|
+
"react": "^19.0.0",
|
|
89
|
+
"react-dom": "^19.0.0"
|
|
90
|
+
},
|
|
91
|
+
"private": false,
|
|
92
|
+
"publishConfig": {
|
|
93
|
+
"registry": "https://registry.npmjs.org/"
|
|
94
|
+
},
|
|
95
|
+
"repository": {
|
|
96
|
+
"type": "git",
|
|
97
|
+
"url": "git+https://github.com/TrejGun/mui-lexical.git"
|
|
98
|
+
},
|
|
99
|
+
"scripts": {
|
|
100
|
+
"build": "tsc",
|
|
101
|
+
"lint": "eslint . --fix",
|
|
102
|
+
"prebuild": "rimraf dist/",
|
|
103
|
+
"prepare": "husky",
|
|
104
|
+
"storybook": "storybook dev -p 6006 --debug-webpack",
|
|
105
|
+
"build-storybook": "storybook build",
|
|
106
|
+
"test": "jest"
|
|
107
|
+
},
|
|
108
|
+
"types": "./dist/index.d.ts",
|
|
109
|
+
"version": "1.0.7"
|
|
110
|
+
}
|