@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,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TabFocusPlugin = void 0;
|
|
11
|
+
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
12
|
+
const lexical_1 = require("lexical");
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const COMMAND_PRIORITY_LOW = 1;
|
|
15
|
+
const TAB_TO_FOCUS_INTERVAL = 100;
|
|
16
|
+
let lastTabKeyDownTimestamp = 0;
|
|
17
|
+
let hasRegisteredKeyDownListener = false;
|
|
18
|
+
function registerKeyTimeStampTracker() {
|
|
19
|
+
window.addEventListener("keydown", (event) => {
|
|
20
|
+
// Tab
|
|
21
|
+
if (event.key === "Tab") {
|
|
22
|
+
lastTabKeyDownTimestamp = event.timeStamp;
|
|
23
|
+
}
|
|
24
|
+
}, true);
|
|
25
|
+
}
|
|
26
|
+
const TabFocusPlugin = () => {
|
|
27
|
+
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
28
|
+
(0, react_1.useEffect)(() => {
|
|
29
|
+
if (!hasRegisteredKeyDownListener) {
|
|
30
|
+
registerKeyTimeStampTracker();
|
|
31
|
+
hasRegisteredKeyDownListener = true;
|
|
32
|
+
}
|
|
33
|
+
return editor.registerCommand(lexical_1.FOCUS_COMMAND, (event) => {
|
|
34
|
+
const selection = (0, lexical_1.$getSelection)();
|
|
35
|
+
if ((0, lexical_1.$isRangeSelection)(selection)) {
|
|
36
|
+
if (lastTabKeyDownTimestamp + TAB_TO_FOCUS_INTERVAL > event.timeStamp) {
|
|
37
|
+
(0, lexical_1.$setSelection)(selection.clone());
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}, COMMAND_PRIORITY_LOW);
|
|
42
|
+
}, [editor]);
|
|
43
|
+
return null;
|
|
44
|
+
};
|
|
45
|
+
exports.TabFocusPlugin = TabFocusPlugin;
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/plugins/TabFocusPlugin/index.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,kFAAkF;AAClF,qCAAyF;AACzF,iCAAkC;AAElC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,IAAI,uBAAuB,GAAG,CAAC,CAAC;AAChC,IAAI,4BAA4B,GAAG,KAAK,CAAC;AAEzC,SAAS,2BAA2B;IAClC,MAAM,CAAC,gBAAgB,CACrB,SAAS,EACT,CAAC,KAAoB,EAAE,EAAE;QACvB,MAAM;QACN,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,EAAE,CAAC;YACxB,uBAAuB,GAAG,KAAK,CAAC,SAAS,CAAC;QAC5C,CAAC;IACH,CAAC,EACD,IAAI,CACL,CAAC;AACJ,CAAC;AAEM,MAAM,cAAc,GAAG,GAAS,EAAE;IACvC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,kDAAyB,GAAE,CAAC;IAE7C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,4BAA4B,EAAE,CAAC;YAClC,2BAA2B,EAAE,CAAC;YAC9B,4BAA4B,GAAG,IAAI,CAAC;QACtC,CAAC;QAED,OAAO,MAAM,CAAC,eAAe,CAC3B,uBAAa,EACb,CAAC,KAAiB,EAAE,EAAE;YACpB,MAAM,SAAS,GAAG,IAAA,uBAAa,GAAE,CAAC;YAClC,IAAI,IAAA,2BAAiB,EAAC,SAAS,CAAC,EAAE,CAAC;gBACjC,IAAI,uBAAuB,GAAG,qBAAqB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;oBACtE,IAAA,uBAAa,EAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC,EACD,oBAAoB,CACrB,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAzBW,QAAA,cAAc,kBAyBzB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { ReactPortal } from "react";
|
|
9
|
+
export declare const TableActionMenuPlugin: ({ anchorElem, cellMerge, }: {
|
|
10
|
+
anchorElem?: HTMLElement;
|
|
11
|
+
cellMerge?: boolean;
|
|
12
|
+
}) => null | ReactPortal;
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TableActionMenuPlugin = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/**
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
const lexical_1 = require("lexical");
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
15
|
+
const useLexicalEditable_1 = require("@lexical/react/useLexicalEditable");
|
|
16
|
+
const table_1 = require("@lexical/table");
|
|
17
|
+
const utils_1 = require("@lexical/utils");
|
|
18
|
+
const react_dom_1 = require("react-dom");
|
|
19
|
+
const DropDown_1 = require("../../ui/DropDown");
|
|
20
|
+
const icons_1 = require("../../images/icons");
|
|
21
|
+
function TableActionMenu({ onClose, tableCellNode: _tableCellNode, setIsMenuOpen, contextRef, }) {
|
|
22
|
+
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
23
|
+
const dropDownRef = (0, react_1.useRef)(null);
|
|
24
|
+
const [tableCellNode, updateTableCellNode] = (0, react_1.useState)(_tableCellNode);
|
|
25
|
+
const [selectionCounts, _updateSelectionCounts] = (0, react_1.useState)({
|
|
26
|
+
columns: 1,
|
|
27
|
+
rows: 1,
|
|
28
|
+
});
|
|
29
|
+
(0, react_1.useEffect)(() => {
|
|
30
|
+
const menuButtonElement = contextRef.current;
|
|
31
|
+
const dropDownElement = dropDownRef.current;
|
|
32
|
+
const rootElement = editor.getRootElement();
|
|
33
|
+
if (menuButtonElement != null && dropDownElement != null && rootElement != null) {
|
|
34
|
+
const rootEleRect = rootElement.getBoundingClientRect();
|
|
35
|
+
const menuButtonRect = menuButtonElement.getBoundingClientRect();
|
|
36
|
+
dropDownElement.style.opacity = "1";
|
|
37
|
+
const dropDownElementRect = dropDownElement.getBoundingClientRect();
|
|
38
|
+
const margin = 5;
|
|
39
|
+
let leftPosition = menuButtonRect.right + margin;
|
|
40
|
+
if (leftPosition + dropDownElementRect.width > window.innerWidth ||
|
|
41
|
+
leftPosition + dropDownElementRect.width > rootEleRect.right) {
|
|
42
|
+
const position = menuButtonRect.left - dropDownElementRect.width - margin;
|
|
43
|
+
leftPosition = (position < 0 ? margin : position) + window.pageXOffset;
|
|
44
|
+
}
|
|
45
|
+
dropDownElement.style.left = `${leftPosition + window.pageXOffset}px`;
|
|
46
|
+
let topPosition = menuButtonRect.top;
|
|
47
|
+
if (topPosition + dropDownElementRect.height > window.innerHeight) {
|
|
48
|
+
const position = menuButtonRect.bottom - dropDownElementRect.height;
|
|
49
|
+
topPosition = position < 0 ? margin : position;
|
|
50
|
+
}
|
|
51
|
+
dropDownElement.style.top = `${topPosition}px`;
|
|
52
|
+
}
|
|
53
|
+
}, [contextRef, dropDownRef, editor]);
|
|
54
|
+
(0, react_1.useEffect)(() => {
|
|
55
|
+
function handleClickOutside(event) {
|
|
56
|
+
if (dropDownRef.current != null &&
|
|
57
|
+
contextRef.current != null &&
|
|
58
|
+
(0, lexical_1.isDOMNode)(event.target) &&
|
|
59
|
+
!dropDownRef.current.contains(event.target) &&
|
|
60
|
+
!contextRef.current.contains(event.target)) {
|
|
61
|
+
setIsMenuOpen(false);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
window.addEventListener("click", handleClickOutside);
|
|
65
|
+
return () => window.removeEventListener("click", handleClickOutside);
|
|
66
|
+
}, [setIsMenuOpen, contextRef]);
|
|
67
|
+
const clearTableSelection = (0, react_1.useCallback)(() => {
|
|
68
|
+
editor.update(() => {
|
|
69
|
+
if (tableCellNode.isAttached()) {
|
|
70
|
+
const tableNode = (0, table_1.$getTableNodeFromLexicalNodeOrThrow)(tableCellNode);
|
|
71
|
+
const tableElement = (0, table_1.getTableElement)(tableNode, editor.getElementByKey(tableNode.getKey()));
|
|
72
|
+
if (tableElement === null) {
|
|
73
|
+
throw new Error("TableActionMenu: Expected to find tableElement in DOM");
|
|
74
|
+
}
|
|
75
|
+
const tableObserver = (0, table_1.getTableObserverFromTableElement)(tableElement);
|
|
76
|
+
if (tableObserver !== null) {
|
|
77
|
+
tableObserver.$clearHighlight();
|
|
78
|
+
}
|
|
79
|
+
tableNode.markDirty();
|
|
80
|
+
updateTableCellNode(tableCellNode.getLatest());
|
|
81
|
+
}
|
|
82
|
+
(0, lexical_1.$setSelection)(null);
|
|
83
|
+
});
|
|
84
|
+
}, [editor, tableCellNode]);
|
|
85
|
+
const insertTableRowAtSelection = (0, react_1.useCallback)((shouldInsertAfter) => {
|
|
86
|
+
editor.update(() => {
|
|
87
|
+
for (let i = 0; i < selectionCounts.rows; i++) {
|
|
88
|
+
(0, table_1.$insertTableRowAtSelection)(shouldInsertAfter);
|
|
89
|
+
}
|
|
90
|
+
onClose();
|
|
91
|
+
});
|
|
92
|
+
}, [editor, onClose, selectionCounts.rows]);
|
|
93
|
+
const insertTableColumnAtSelection = (0, react_1.useCallback)((shouldInsertAfter) => {
|
|
94
|
+
editor.update(() => {
|
|
95
|
+
for (let i = 0; i < selectionCounts.columns; i++) {
|
|
96
|
+
(0, table_1.$insertTableColumnAtSelection)(shouldInsertAfter);
|
|
97
|
+
}
|
|
98
|
+
onClose();
|
|
99
|
+
});
|
|
100
|
+
}, [editor, onClose, selectionCounts.columns]);
|
|
101
|
+
const deleteTableRowAtSelection = (0, react_1.useCallback)(() => {
|
|
102
|
+
editor.update(() => {
|
|
103
|
+
(0, table_1.$deleteTableRowAtSelection)();
|
|
104
|
+
onClose();
|
|
105
|
+
});
|
|
106
|
+
}, [editor, onClose]);
|
|
107
|
+
const deleteTableAtSelection = (0, react_1.useCallback)(() => {
|
|
108
|
+
editor.update(() => {
|
|
109
|
+
const tableNode = (0, table_1.$getTableNodeFromLexicalNodeOrThrow)(tableCellNode);
|
|
110
|
+
tableNode.remove();
|
|
111
|
+
clearTableSelection();
|
|
112
|
+
onClose();
|
|
113
|
+
});
|
|
114
|
+
}, [editor, tableCellNode, clearTableSelection, onClose]);
|
|
115
|
+
const deleteTableColumnAtSelection = (0, react_1.useCallback)(() => {
|
|
116
|
+
editor.update(() => {
|
|
117
|
+
(0, table_1.$deleteTableColumnAtSelection)();
|
|
118
|
+
onClose();
|
|
119
|
+
});
|
|
120
|
+
}, [editor, onClose]);
|
|
121
|
+
const toggleTableRowIsHeader = (0, react_1.useCallback)(() => {
|
|
122
|
+
editor.update(() => {
|
|
123
|
+
const tableNode = (0, table_1.$getTableNodeFromLexicalNodeOrThrow)(tableCellNode);
|
|
124
|
+
const tableRowIndex = (0, table_1.$getTableRowIndexFromTableCellNode)(tableCellNode);
|
|
125
|
+
const [gridMap] = (0, table_1.$computeTableMapSkipCellCheck)(tableNode, null, null);
|
|
126
|
+
const rowCells = new Set();
|
|
127
|
+
const newStyle = tableCellNode.getHeaderStyles() ^ table_1.TableCellHeaderStates.ROW;
|
|
128
|
+
for (let col = 0; col < gridMap[tableRowIndex].length; col++) {
|
|
129
|
+
const mapCell = gridMap[tableRowIndex][col];
|
|
130
|
+
if (!(mapCell === null || mapCell === void 0 ? void 0 : mapCell.cell)) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (!rowCells.has(mapCell.cell)) {
|
|
134
|
+
rowCells.add(mapCell.cell);
|
|
135
|
+
mapCell.cell.setHeaderStyles(newStyle, table_1.TableCellHeaderStates.ROW);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
clearTableSelection();
|
|
139
|
+
onClose();
|
|
140
|
+
});
|
|
141
|
+
}, [editor, tableCellNode, clearTableSelection, onClose]);
|
|
142
|
+
const toggleTableColumnIsHeader = (0, react_1.useCallback)(() => {
|
|
143
|
+
editor.update(() => {
|
|
144
|
+
const tableNode = (0, table_1.$getTableNodeFromLexicalNodeOrThrow)(tableCellNode);
|
|
145
|
+
const tableColumnIndex = (0, table_1.$getTableColumnIndexFromTableCellNode)(tableCellNode);
|
|
146
|
+
const [gridMap] = (0, table_1.$computeTableMapSkipCellCheck)(tableNode, null, null);
|
|
147
|
+
const columnCells = new Set();
|
|
148
|
+
const newStyle = tableCellNode.getHeaderStyles() ^ table_1.TableCellHeaderStates.COLUMN;
|
|
149
|
+
for (const item of gridMap) {
|
|
150
|
+
const mapCell = item[tableColumnIndex];
|
|
151
|
+
if (!(mapCell === null || mapCell === void 0 ? void 0 : mapCell.cell)) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (!columnCells.has(mapCell.cell)) {
|
|
155
|
+
columnCells.add(mapCell.cell);
|
|
156
|
+
mapCell.cell.setHeaderStyles(newStyle, table_1.TableCellHeaderStates.COLUMN);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
clearTableSelection();
|
|
160
|
+
onClose();
|
|
161
|
+
});
|
|
162
|
+
}, [editor, tableCellNode, clearTableSelection, onClose]);
|
|
163
|
+
const toggleRowStriping = (0, react_1.useCallback)(() => {
|
|
164
|
+
editor.update(() => {
|
|
165
|
+
if (tableCellNode.isAttached()) {
|
|
166
|
+
const tableNode = (0, table_1.$getTableNodeFromLexicalNodeOrThrow)(tableCellNode);
|
|
167
|
+
if (tableNode) {
|
|
168
|
+
tableNode.setRowStriping(!tableNode.getRowStriping());
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
clearTableSelection();
|
|
172
|
+
onClose();
|
|
173
|
+
});
|
|
174
|
+
}, [editor, tableCellNode, clearTableSelection, onClose]);
|
|
175
|
+
const toggleFirstRowFreeze = (0, react_1.useCallback)(() => {
|
|
176
|
+
editor.update(() => {
|
|
177
|
+
if (tableCellNode.isAttached()) {
|
|
178
|
+
const tableNode = (0, table_1.$getTableNodeFromLexicalNodeOrThrow)(tableCellNode);
|
|
179
|
+
if (tableNode) {
|
|
180
|
+
tableNode.setFrozenRows(tableNode.getFrozenRows() === 0 ? 1 : 0);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
clearTableSelection();
|
|
184
|
+
onClose();
|
|
185
|
+
});
|
|
186
|
+
}, [editor, tableCellNode, clearTableSelection, onClose]);
|
|
187
|
+
const toggleFirstColumnFreeze = (0, react_1.useCallback)(() => {
|
|
188
|
+
editor.update(() => {
|
|
189
|
+
if (tableCellNode.isAttached()) {
|
|
190
|
+
const tableNode = (0, table_1.$getTableNodeFromLexicalNodeOrThrow)(tableCellNode);
|
|
191
|
+
if (tableNode) {
|
|
192
|
+
tableNode.setFrozenColumns(tableNode.getFrozenColumns() === 0 ? 1 : 0);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
clearTableSelection();
|
|
196
|
+
onClose();
|
|
197
|
+
});
|
|
198
|
+
}, [editor, tableCellNode, clearTableSelection, onClose]);
|
|
199
|
+
const formatVerticalAlign = (value) => {
|
|
200
|
+
editor.update(() => {
|
|
201
|
+
const selection = (0, lexical_1.$getSelection)();
|
|
202
|
+
if ((0, lexical_1.$isRangeSelection)(selection) || (0, table_1.$isTableSelection)(selection)) {
|
|
203
|
+
const [cell] = (0, table_1.$getNodeTriplet)(selection.anchor);
|
|
204
|
+
if ((0, table_1.$isTableCellNode)(cell)) {
|
|
205
|
+
cell.setVerticalAlign(value);
|
|
206
|
+
}
|
|
207
|
+
if ((0, table_1.$isTableSelection)(selection)) {
|
|
208
|
+
const nodes = selection.getNodes();
|
|
209
|
+
for (const node of nodes) {
|
|
210
|
+
if ((0, table_1.$isTableCellNode)(node)) {
|
|
211
|
+
node.setVerticalAlign(value);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
const mergeCellButton = null;
|
|
219
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", { className: "dropdown", ref: dropDownRef, onClick: e => {
|
|
220
|
+
e.stopPropagation();
|
|
221
|
+
}, children: [mergeCellButton, (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => toggleRowStriping(), "data-test-id": "table-row-striping", children: (0, jsx_runtime_1.jsx)("span", { className: "text", children: "Toggle Row Striping" }) }), (0, jsx_runtime_1.jsxs)(DropDown_1.DropDown, { buttonLabel: "Vertical Align", buttonClassName: "item", buttonAriaLabel: "Formatting options for vertical alignment", children: [(0, jsx_runtime_1.jsx)(DropDown_1.DropDownItem, { onClick: () => {
|
|
222
|
+
formatVerticalAlign("top");
|
|
223
|
+
}, className: "item wide", children: (0, jsx_runtime_1.jsxs)("div", { className: "icon-text-container", children: [(0, jsx_runtime_1.jsx)(icons_1.VerticalTopIcon, {}), (0, jsx_runtime_1.jsx)("span", { className: "text", children: "Top Align" })] }) }), (0, jsx_runtime_1.jsx)(DropDown_1.DropDownItem, { onClick: () => {
|
|
224
|
+
formatVerticalAlign("middle");
|
|
225
|
+
}, className: "item wide", children: (0, jsx_runtime_1.jsxs)("div", { className: "icon-text-container", children: [(0, jsx_runtime_1.jsx)(icons_1.VerticalMiddleIcon, {}), (0, jsx_runtime_1.jsx)("span", { className: "text", children: "Middle Align" })] }) }), (0, jsx_runtime_1.jsx)(DropDown_1.DropDownItem, { onClick: () => {
|
|
226
|
+
formatVerticalAlign("bottom");
|
|
227
|
+
}, className: "item wide", children: (0, jsx_runtime_1.jsxs)("div", { className: "icon-text-container", children: [(0, jsx_runtime_1.jsx)(icons_1.VerticalBottomIcon, {}), (0, jsx_runtime_1.jsx)("span", { className: "text", children: "Bottom Align" })] }) })] }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => toggleFirstRowFreeze(), "data-test-id": "table-freeze-first-row", children: (0, jsx_runtime_1.jsx)("span", { className: "text", children: "Toggle First Row Freeze" }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => toggleFirstColumnFreeze(), "data-test-id": "table-freeze-first-column", children: (0, jsx_runtime_1.jsx)("span", { className: "text", children: "Toggle First Column Freeze" }) }), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => insertTableRowAtSelection(false), "data-test-id": "table-insert-row-above", children: (0, jsx_runtime_1.jsxs)("span", { className: "text", children: ["Insert ", selectionCounts.rows === 1 ? "row" : `${selectionCounts.rows} rows`, " above"] }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => insertTableRowAtSelection(true), "data-test-id": "table-insert-row-below", children: (0, jsx_runtime_1.jsxs)("span", { className: "text", children: ["Insert ", selectionCounts.rows === 1 ? "row" : `${selectionCounts.rows} rows`, " below"] }) }), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => insertTableColumnAtSelection(false), "data-test-id": "table-insert-column-before", children: (0, jsx_runtime_1.jsxs)("span", { className: "text", children: ["Insert ", selectionCounts.columns === 1 ? "column" : `${selectionCounts.columns} columns`, " left"] }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => insertTableColumnAtSelection(true), "data-test-id": "table-insert-column-after", children: (0, jsx_runtime_1.jsxs)("span", { className: "text", children: ["Insert ", selectionCounts.columns === 1 ? "column" : `${selectionCounts.columns} columns`, " right"] }) }), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => deleteTableColumnAtSelection(), "data-test-id": "table-delete-columns", children: (0, jsx_runtime_1.jsx)("span", { className: "text", children: "Delete column" }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => deleteTableRowAtSelection(), "data-test-id": "table-delete-rows", children: (0, jsx_runtime_1.jsx)("span", { className: "text", children: "Delete row" }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => deleteTableAtSelection(), "data-test-id": "table-delete", children: (0, jsx_runtime_1.jsx)("span", { className: "text", children: "Delete table" }) }), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => toggleTableRowIsHeader(), "data-test-id": "table-row-header", children: (0, jsx_runtime_1.jsxs)("span", { className: "text", children: [(tableCellNode.__headerState & table_1.TableCellHeaderStates.ROW) === table_1.TableCellHeaderStates.ROW ? "Remove" : "Add", " ", "row header"] }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "item", onClick: () => toggleTableColumnIsHeader(), "data-test-id": "table-column-header", children: (0, jsx_runtime_1.jsxs)("span", { className: "text", children: [(tableCellNode.__headerState & table_1.TableCellHeaderStates.COLUMN) === table_1.TableCellHeaderStates.COLUMN
|
|
228
|
+
? "Remove"
|
|
229
|
+
: "Add", " ", "column header"] }) })] }), document.body);
|
|
230
|
+
}
|
|
231
|
+
function TableCellActionMenuContainer({ anchorElem }) {
|
|
232
|
+
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
233
|
+
const menuButtonRef = (0, react_1.useRef)(null);
|
|
234
|
+
const menuRootRef = (0, react_1.useRef)(null);
|
|
235
|
+
const [isMenuOpen, setIsMenuOpen] = (0, react_1.useState)(false);
|
|
236
|
+
const [tableCellNode, setTableMenuCellNode] = (0, react_1.useState)(null);
|
|
237
|
+
const checkTableCellOverflow = (0, react_1.useCallback)((tableCellParentNodeDOM) => {
|
|
238
|
+
const scrollableContainer = tableCellParentNodeDOM.closest(".PlaygroundEditorTheme__tableScrollableWrapper");
|
|
239
|
+
if (scrollableContainer) {
|
|
240
|
+
const containerRect = scrollableContainer.getBoundingClientRect();
|
|
241
|
+
const cellRect = tableCellParentNodeDOM.getBoundingClientRect();
|
|
242
|
+
// Calculate where the action button would be positioned (5px from right edge of cell)
|
|
243
|
+
// Also account for the button width and table cell padding (8px)
|
|
244
|
+
const actionButtonRight = cellRect.right - 5;
|
|
245
|
+
const actionButtonLeft = actionButtonRight - 28; // 20px width + 8px padding
|
|
246
|
+
// Only hide if the action button would overflow the container
|
|
247
|
+
if (actionButtonRight > containerRect.right || actionButtonLeft < containerRect.left) {
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return false;
|
|
252
|
+
}, []);
|
|
253
|
+
const $moveMenu = (0, react_1.useCallback)(() => {
|
|
254
|
+
const menu = menuButtonRef.current;
|
|
255
|
+
const selection = (0, lexical_1.$getSelection)();
|
|
256
|
+
const nativeSelection = (0, lexical_1.getDOMSelection)(editor._window);
|
|
257
|
+
const activeElement = document.activeElement;
|
|
258
|
+
function disable() {
|
|
259
|
+
if (menu) {
|
|
260
|
+
menu.classList.remove("table-cell-action-button-container--active");
|
|
261
|
+
menu.classList.add("table-cell-action-button-container--inactive");
|
|
262
|
+
}
|
|
263
|
+
setTableMenuCellNode(null);
|
|
264
|
+
}
|
|
265
|
+
if (selection == null || menu == null) {
|
|
266
|
+
return disable();
|
|
267
|
+
}
|
|
268
|
+
const rootElement = editor.getRootElement();
|
|
269
|
+
let tableObserver = null;
|
|
270
|
+
let tableCellParentNodeDOM = null;
|
|
271
|
+
if ((0, lexical_1.$isRangeSelection)(selection) &&
|
|
272
|
+
rootElement !== null &&
|
|
273
|
+
nativeSelection !== null &&
|
|
274
|
+
rootElement.contains(nativeSelection.anchorNode)) {
|
|
275
|
+
const tableCellNodeFromSelection = (0, table_1.$getTableCellNodeFromLexicalNode)(selection.anchor.getNode());
|
|
276
|
+
if (tableCellNodeFromSelection == null) {
|
|
277
|
+
return disable();
|
|
278
|
+
}
|
|
279
|
+
tableCellParentNodeDOM = editor.getElementByKey(tableCellNodeFromSelection.getKey());
|
|
280
|
+
if (tableCellParentNodeDOM == null || !tableCellNodeFromSelection.isAttached()) {
|
|
281
|
+
return disable();
|
|
282
|
+
}
|
|
283
|
+
if (checkTableCellOverflow(tableCellParentNodeDOM)) {
|
|
284
|
+
return disable();
|
|
285
|
+
}
|
|
286
|
+
const tableNode = (0, table_1.$getTableNodeFromLexicalNodeOrThrow)(tableCellNodeFromSelection);
|
|
287
|
+
const tableElement = (0, table_1.getTableElement)(tableNode, editor.getElementByKey(tableNode.getKey()));
|
|
288
|
+
if (tableElement === null) {
|
|
289
|
+
throw new Error("TableActionMenu: Expected to find tableElement in DOM");
|
|
290
|
+
}
|
|
291
|
+
tableObserver = (0, table_1.getTableObserverFromTableElement)(tableElement);
|
|
292
|
+
setTableMenuCellNode(tableCellNodeFromSelection);
|
|
293
|
+
}
|
|
294
|
+
else if ((0, table_1.$isTableSelection)(selection)) {
|
|
295
|
+
const anchorNode = (0, table_1.$getTableCellNodeFromLexicalNode)(selection.anchor.getNode());
|
|
296
|
+
if (!(0, table_1.$isTableCellNode)(anchorNode)) {
|
|
297
|
+
throw new Error("TableSelection anchorNode must be a TableCellNode");
|
|
298
|
+
}
|
|
299
|
+
const tableNode = (0, table_1.$getTableNodeFromLexicalNodeOrThrow)(anchorNode);
|
|
300
|
+
const tableElement = (0, table_1.getTableElement)(tableNode, editor.getElementByKey(tableNode.getKey()));
|
|
301
|
+
if (tableElement === null) {
|
|
302
|
+
throw new Error("TableActionMenu: Expected to find tableElement in DOM");
|
|
303
|
+
}
|
|
304
|
+
tableObserver = (0, table_1.getTableObserverFromTableElement)(tableElement);
|
|
305
|
+
tableCellParentNodeDOM = editor.getElementByKey(anchorNode.getKey());
|
|
306
|
+
if (tableCellParentNodeDOM === null) {
|
|
307
|
+
return disable();
|
|
308
|
+
}
|
|
309
|
+
if (checkTableCellOverflow(tableCellParentNodeDOM)) {
|
|
310
|
+
return disable();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
else if (!activeElement) {
|
|
314
|
+
return disable();
|
|
315
|
+
}
|
|
316
|
+
if (tableObserver === null || tableCellParentNodeDOM === null) {
|
|
317
|
+
return disable();
|
|
318
|
+
}
|
|
319
|
+
const enabled = !(tableObserver === null || tableObserver === void 0 ? void 0 : tableObserver.isSelecting);
|
|
320
|
+
menu.classList.toggle("table-cell-action-button-container--active", enabled);
|
|
321
|
+
menu.classList.toggle("table-cell-action-button-container--inactive", !enabled);
|
|
322
|
+
if (enabled) {
|
|
323
|
+
const tableCellRect = tableCellParentNodeDOM.getBoundingClientRect();
|
|
324
|
+
const anchorRect = anchorElem.getBoundingClientRect();
|
|
325
|
+
const top = tableCellRect.top - anchorRect.top;
|
|
326
|
+
const left = tableCellRect.right - anchorRect.left;
|
|
327
|
+
menu.style.transform = `translate(${left}px, ${top}px)`;
|
|
328
|
+
}
|
|
329
|
+
}, [editor, anchorElem, checkTableCellOverflow]);
|
|
330
|
+
(0, react_1.useEffect)(() => {
|
|
331
|
+
// We call the $moveMenu callback every time the selection changes,
|
|
332
|
+
// once up front, and once after each pointerUp
|
|
333
|
+
let timeoutId = undefined;
|
|
334
|
+
const callback = () => {
|
|
335
|
+
timeoutId = undefined;
|
|
336
|
+
editor.getEditorState().read($moveMenu);
|
|
337
|
+
};
|
|
338
|
+
const delayedCallback = () => {
|
|
339
|
+
if (timeoutId === undefined) {
|
|
340
|
+
timeoutId = setTimeout(callback, 0);
|
|
341
|
+
}
|
|
342
|
+
return false;
|
|
343
|
+
};
|
|
344
|
+
return (0, utils_1.mergeRegister)(editor.registerUpdateListener(delayedCallback), editor.registerCommand(lexical_1.SELECTION_CHANGE_COMMAND, delayedCallback, lexical_1.COMMAND_PRIORITY_CRITICAL), editor.registerRootListener((rootElement, prevRootElement) => {
|
|
345
|
+
if (prevRootElement) {
|
|
346
|
+
prevRootElement.removeEventListener("pointerup", delayedCallback);
|
|
347
|
+
}
|
|
348
|
+
if (rootElement) {
|
|
349
|
+
rootElement.addEventListener("pointerup", delayedCallback);
|
|
350
|
+
delayedCallback();
|
|
351
|
+
}
|
|
352
|
+
}), () => clearTimeout(timeoutId));
|
|
353
|
+
});
|
|
354
|
+
const prevTableCellDOM = (0, react_1.useRef)(tableCellNode);
|
|
355
|
+
(0, react_1.useEffect)(() => {
|
|
356
|
+
if (prevTableCellDOM.current !== tableCellNode) {
|
|
357
|
+
setIsMenuOpen(false);
|
|
358
|
+
}
|
|
359
|
+
prevTableCellDOM.current = tableCellNode;
|
|
360
|
+
}, [prevTableCellDOM, tableCellNode]);
|
|
361
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "table-cell-action-button-container", ref: menuButtonRef, children: tableCellNode != null && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: "table-cell-action-button chevron-down", onClick: e => {
|
|
362
|
+
e.stopPropagation();
|
|
363
|
+
setIsMenuOpen(!isMenuOpen);
|
|
364
|
+
}, ref: menuRootRef, children: (0, jsx_runtime_1.jsx)("i", { className: "chevron-down" }) }), isMenuOpen && ((0, jsx_runtime_1.jsx)(TableActionMenu, { contextRef: menuRootRef, setIsMenuOpen: setIsMenuOpen, onClose: () => setIsMenuOpen(false), tableCellNode: tableCellNode }))] })) }));
|
|
365
|
+
}
|
|
366
|
+
const TableActionMenuPlugin = ({ anchorElem = document.body, cellMerge = false, }) => {
|
|
367
|
+
const isEditable = (0, useLexicalEditable_1.useLexicalEditable)();
|
|
368
|
+
return (0, react_dom_1.createPortal)(isEditable ? (0, jsx_runtime_1.jsx)(TableCellActionMenuContainer, { anchorElem: anchorElem, cellMerge: cellMerge }) : null, anchorElem);
|
|
369
|
+
};
|
|
370
|
+
exports.TableActionMenuPlugin = TableActionMenuPlugin;
|
|
371
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/plugins/TableActionMenuPlugin/index.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;GAMG;AAEH,qCAQiB;AAEjB,iCAA8E;AAC9E,kFAAkF;AAClF,0EAAuE;AACvE,0CAkBwB;AACxB,0CAA+C;AAC/C,yCAAyC;AAEzC,gDAA2D;AAC3D,8CAA6F;AAS7F,SAAS,eAAe,CAAC,EACvB,OAAO,EACP,aAAa,EAAE,cAAc,EAC7B,aAAa,EACb,UAAU,GACe;IACzB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,kDAAyB,GAAE,CAAC;IAC7C,MAAM,WAAW,GAAG,IAAA,cAAM,EAAwB,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EAAC,cAAc,CAAC,CAAC;IACtE,MAAM,CAAC,eAAe,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,EAAC;QACzD,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