Improvement
— Breaking Change — Batching added to theonChange
callback. Now the second argument can contain an array of CustomEvents as well as a single one. If several changes will be made in short period of time, they will be batched under the singleonChange
callImprovement
— Pressing "Enter" at the end of a Block won't lead to redundantblock-changed
event triggering. Onlyblock-added
event will be dispatched.Fix
— TheonChange
won't be triggered with Block Tunes opening and closing.Refactoring
—EventDispatcher
types improved. Now we can passEventsMap
via generic to specify a map of event names and their payloads that can be used in a particular EventDispatcher instance.Refactoring
— All events in common editor Event Bus now have own type declarations.Refactoring
— Now Blocks don't have own Mutation Observer. The single observer attached to the editor's blocks wrapper element.ModificationsObserver
listens blocks wrapper changes, then emits an event into the common editor Event Bus. Each Block subscribes to such events and handle those who related to a particular Block.Improvement
— Block's mutation handler now will be called on every block change (including background changes). Previously, it have worked only if a particular Block have been focused.Refactoring
— Debounce have been removed from Block's mutation handler. The batching inModificationObserver
used instead.Improvement
— Number of caret saving method calls optimized for Block Tunes opening/closing.New
— Types for Block mutation events added.Fix
- Several bugs caused by random browser extensions. Now we are not searching for a block's container in the DOM on saving. Instead, we keep it in memory and update it when the tool changes a container element.