-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
component: eventsinternalExternal contributions not acceptedExternal contributions not acceptedissue: feature requestDescribes a new feature and why it should be addedDescribes a new feature and why it should be added
Milestone
Description
Is your feature request related to a problem? Please describe.
Similar to #4203
The BlockChange event type covers lots of different kinds of changes, when ideally it would be split up into more even types. Encapsulating them in a single type causes problems with:
- Undo and redo. Currently this has to be handled using a switch statement.
- Adding new types of change events. See Change event element registry #3793
- Firing new events. For example, because the new and old values must be explicitly passed to the event, anywhere firing an event must duplicate logic to access those values, or create a helper function. See fix: insertion markers and change events to work with JSO hooks #5378
Describe the solution you'd like
Split the BlockChange event into different events.
Current setup:
| element | old value | new value | field |
|---|---|---|---|
| field | any | any | string |
| comment | string | string | null |
| collapsed | boolean | boolean | null |
| disabled | boolean | boolean | null |
| inline | boolean | boolean | null |
| mutation | string | string | null |
Suggested classes:
| class | properties |
|---|---|
| BlockFieldChange | oldValue, newValue, fieldName |
| BlockCommentChange | oldComment, newComment |
| BlockCollapsedChange | isCollapsed |
| BlockDisabledChange | isDisabled |
| BlockInlinedChange | isInline |
| BlockMutationChange | oldMutation, newMutation, isXml |
Metadata
Metadata
Assignees
Labels
component: eventsinternalExternal contributions not acceptedExternal contributions not acceptedissue: feature requestDescribes a new feature and why it should be addedDescribes a new feature and why it should be added