chore: rich-text组件配置更新时,对应富文本编辑器也更新配置 #8608
Merged
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.
What
🤖 Generated by Copilot at 1da043e
This pull request enhances the functionality and performance of the
RichText
andTinymce
components inamis-ui
andamis-core
by improving their prop reactivity, editor initialization, and lifecycle management. It also adds some debugging and utility code.🤖 Generated by Copilot at 1da043e
Why
How
🤖 Generated by Copilot at 1da043e
anyChanged
function fromamis-core
to compare props incomponentDidUpdate
methods ofFroalaEditorComponent
andRichTextControl
(link, link, link)componentDidMount
method ofTinymceEditorComponent
to extract editor initialization logic intoinitTiny
method and useautobind
decorator (link)componentDidUpdate
andcomponentWillUnmount
methods toTinymceEditorComponent
to handle dynamic changes inconfig
prop and editor removal (link)FormBaseControl
import fromInputRichText.tsx
(link)getConfig
method ofRichTextControl
and store config in state (link, link, link)componentDidUpdate
method toRichTextControl
to update state config when props change (link)FroalaEditorComponent
orTinymceEditorComponent
instead of instance property (link)detectProps
option toFormItem
decorator ofRichTextControlRenderer
to trigger re-render when props change (link)componentDidUpdate
method ofFroalaEditorComponent
to destroy and recreate editor instance whenconfig
prop changes (link)FroalaEditorComponent
(link)