-
Notifications
You must be signed in to change notification settings - Fork 116
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
[REF] html_builder: split website dependencies from the builder #4236
Open
abd-msyukyu-odoo
wants to merge
113
commits into
master-mysterious-egg
Choose a base branch
from
master-mysterious-egg-abd
base: master-mysterious-egg
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[REF] html_builder: split website dependencies from the builder #4236
abd-msyukyu-odoo
wants to merge
113
commits into
master-mysterious-egg
from
master-mysterious-egg-abd
Conversation
This file contains 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
Rewrite `AddElementOption` and `SpacingOption` to be compatible with masonry snipet Implement `AddElementOption` button functionalities
Before when applying undo/redo the container restored the current target which is not always the target from the previous steps. Now we restore the container correctly when applying undo/redo. To do so, we store the container target on each step.
Before this commit, a collapsed selection inside a contenteditable=false element would open the floating toolbar. This is not the expected behavior, as the toolbar should not be displayed for collapsed selections. This would be particularly impactful for the website builder (which will soon use this editor), as selecting snippets often results in the scenario described above (collapsed selection in a non-editable zone). This happened due to a normalization step done by the selection plugin when about to store the internal representation of the selection in the editor's editable document (editableSelection). This normalization expanded the selection around the non-editable root element, effectively uncollapsing it. As a result, the toolbar plugin, which relies on the editableSelection to determine whether to display or not, would display the toolbar. This commit removes the referred normalization step when about to register a selection change by the user*, and instead applies it for the particular cases where it is needed, namely when about to apply format (or color) to a selection, and when an icon is selected. (*) A selection set programmatically (via setSelection) is still subject to this normalization, as many plugins seem to rely on this behavior. task-4242213
This commit updates the callback for selection preservation around moved nodes. Such callback is a helper for using Cursors.update to cursors' positions when moving nodes in the DOM. The new behaviour has more strict and symmetrical heuristics when defining whether the cursor should be moved along with the moved node. It is worth noting that this callback is optional and any other behaviour for selection preservation can be implemented by the caller of Cursors.update. The new behaviour is a pre-requisite for the next commit, which relies on proper selection preservation after delete operations. task-4242213
Content in an uneditable zone should not be deleted (per definition). On the other hand, a contenteditable=false element (and its children) can be removed if it is fully included by the selection. Before this commit, executing one of the delete_* commands with a selection inside a uneditable zone would lead to the removal of the whole uneditable subtree. This happened because the DeletePlugin was performing a normalization step (via setSelection) that fully included an originally partially selected contenteditable=false element, making it impossible to differentiate between a selection inside a non-editable zone and one that fully includes it (selection on the outer boundaries of the contenteditable=false element). This commit, by avoiding the call to setSelection and normalizing it with the suitable transformations achieves two goals: - it fixes the issue above (no deletion of non editable content), - it avoids unnecessarily setting the selection before doing the actual deletion, which was previously done with the sole purpose of normalizing it differently from the one returned by getEditableSelection. task-4242213
This commit finishes the work started in a previous commit, that removed normalization of the editorSelection around non-editables when the selection was set by the user (or browser). The referred normalization consists of expanding a selection originally inside an contenteditable=false element to its outer boundaries, effectively selecting it fully. This commit removes such normalization also when the selection is set programmatically, that is, via setSelection. This gives the programmer more control over the selection to be set.
Interactions weren't stopped when exiting the builder (save / discard). This is now done when the edit interaction plugin is destroyed => which happens when the editor is destroyed => which happens when the Builder is destroyed
This PR targets the un-managed branch odoo-dev/odoo:master-mysterious-egg, it needs to be retargeted before it can be merged. |
4f4d51e
to
2f89a67
Compare
- Introduce a hook to construct an Editor using snippets - Make the builder agnostic of the Editor - Introduce the concept of `BuilderConfigurator` which will hold scope-specific information/state and the editor.
2f89a67
to
6457c6c
Compare
f468b7f
to
80b3d5d
Compare
27a1402
to
8c6b756
Compare
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.
BuilderConfigurator
which will holds scope-specific information/state and the editor.