feat(rich-text): store Quill Delta alongside HTML#2295
Closed
Raymond0212 wants to merge 1 commit into
Closed
Conversation
Collaborator
|
We are not going this way because this will cause problems when engine changes. Please check on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull request type
New feature (non-breaking change which adds functionality)
Test related change (New E2E test, test automation, etc.)
Description
This PR adds optional Quill Delta JSON persistence to the Rich Text web widget.
We have seen serious discrepancies when persisted HTML is rendered back into editable Rich Text content, especially for content that contains tabs or formatting that does not round-trip cleanly through semantic HTML. Customers also have strong requirements for reliable diff views and side-by-side content comparison.
To support those use cases, this change keeps the existing HTML persistence unchanged and adds an optional secondary storage path for the native Quill document model:
JSON.stringify(quill.getContents())in a separate string attribute. (please refer to the attached screenshot).onChangestill runs once per logical editor update.onLeavechange detection uses Delta snapshots when Delta persistence is enabled, so formatting-only changes can be detected.The stored Delta JSON is intended to support future rendering paths using Quill Delta directly, and allow users to write custom JavaScript-based diff and side-by-side comparison features.
What should be covered while testing?
opsarray.onChangeType = onDataChangestill triggers once per debounced editor update.onChangeType = onLeavedetects formatting-only changes when Delta persistence is enabled.Validation performed:
pnpm lintinpackages/pluggableWidgets/rich-text-webpnpm testinpackages/pluggableWidgets/rich-text-webpnpm buildinpackages/pluggableWidgets/rich-text-webE2E test perform on local app with correct parsable Quill delta json persisted in DB.