-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add editable preview mode to Markdown editor #669
base: master
Are you sure you want to change the base?
Conversation
Related to uiwjs#664 Add editable preview mode to the Markdown editor. * **New Command**: Add `editablePreview` command in `core/src/commands/preview.tsx` to allow editing in preview mode. * **TextArea Component**: Update `core/src/components/TextArea/index.tsx` to support rendering an editable preview mode. * **Editor State Management**: Update `core/src/Editor.tsx` to manage the state and rendering of the editable preview mode. * **Context Management**: Update `core/src/Context.tsx` to include support for editable preview mode in the context and state management.
@vishwamartur is attempting to deploy a commit to the kenny wong's projects Team on Vercel. A member of the Team first needs to authorize it. |
@@ -91,3 +91,32 @@ export const codeLive: ICommand = { | |||
} | |||
}, | |||
}; | |||
|
|||
export const editablePreview: ICommand = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
react-md-editor/core/src/index.tsx
Lines 6 to 9 in 2520e88
export * from './commands'; | |
export * from './commands/group'; | |
export * from './utils/markdownUtils'; | |
export * from './utils/InsertTextAtPosition'; |
export { editablePreview } from './commands/preview';
@vishwamartur It is necessary to export editablePreview in the entry point.
icon: ( | ||
<svg width="12" height="12" viewBox="0 0 520 520"> | ||
<polygon fill="currentColor" points="0 71.293 0 122 179 122 179 397 0 397 0 449.707 232 449.413 232 71.293" /> | ||
<polygon | ||
fill="currentColor" | ||
points="289 71.293 520 71.293 520 122 341 123 341 396 520 396 520 449.707 289 449.413" | ||
/> | ||
</svg> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vishwamartur Do you need me to make a default icon for you?
<Textarea prefixCls={prefixCls} {...otherProps} style={textStyle} /> | ||
) : ( | ||
<Textarea prefixCls={prefixCls} {...otherProps} style={textStyle} readOnly /> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vishwamartur Can this code be optimized to the following example?
<Textarea prefixCls={prefixCls} {...otherProps} style={textStyle} readOnly={preview != 'editablePreview'} />
Related to #664
Add editable preview mode to the Markdown editor.
editablePreview
command incore/src/commands/preview.tsx
to allow editing in preview mode.core/src/components/TextArea/index.tsx
to support rendering an editable preview mode.core/src/Editor.tsx
to manage the state and rendering of the editable preview mode.core/src/Context.tsx
to include support for editable preview mode in the context and state management.