feat: support codemirror for comment and fix emoji insert pos and support upload image from clipboard #557
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Innei tukon479@gmail.com### WHAT
🤖 Generated by Copilot at f289568
This pull request enhances and refactors the CodeMirror editor component and its related components, hooks, and functions. It improves the performance, usability, and customization of the editor, and extracts some helper functions and types to a separate file. It also updates the imports and exports of the editor module and its dependencies.
🤖 Generated by Copilot at f289568
WHY
HOW
🤖 Generated by Copilot at f289568
cmStyle
prop toCodeMirrorEditor
component to allow passing a custom style object to the editor (link,link,link,link,link)LoadingComponent
prop toCodeMirrorEditor
component to allow passing a custom component to render while the editor is loading (link,link,link)value
,maxLength
,placeholder
, andclassName
props toCodeMirrorEditor
component to customize and control the editor value, length, text, and layout (link,link,link,link)Input
component withCodeMirrorEditor
component inCommentInput
component to use the editor as the input field for the comment (link)onCreateEditor
andhandleDropFile
props toCodeMirrorEditor
component to handle the creation and access of the editor view instance and the file drops on the editor (link,link)CommentInput
component fromsrc/components/common
tosrc/app/dashboard/[subdomain]/editor
and update the imports accordingly (link,link)onEmojiSelect
prop of theEmojiPicker
component to use the editor view instance to insert the emoji into the editor (link)wrapExecute
function andIWrapExecute
type fromsrc/editor/index.tsx
tosrc/editor/helper.ts
and re-export them from thesrc/editor
module (link,link,link,link)editorUpload
function insrc/editor/Multimedia.tsx
to reflect the changes in thesrc/editor
module (link)LazyCodeMirrorEditor
anduseCodemirrorTheme
components (link,link,link,link)onUpdate
prop fromCodeMirrorEditor
component (link)CLAIM REWARDS
For first-time contributors, please leave your xLog address and Discord ID below to claim your rewards.