Skip to content
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

feat(UVE): Bring back inline editing for block editor fields in Headless #30638

Conversation

rjvelazco
Copy link
Contributor

@rjvelazco rjvelazco commented Nov 12, 2024

This pull request introduces significant changes to the inline editing functionality within the core-web library, primarily focusing on the block editor and WYSIWYG editor integration. The updates include modifications to the event handling, data structures, and messaging between components. Below are the most important changes grouped by theme:

Inline Editing Event Handling:

  • Introduced a new #handleInlineEditingEvent method in EditEmaEditorComponent to handle different types of inline editing events, such as BLOCK_EDITOR and WYSIWYG. This method checks for enterprise licenses and handles the event accordingly.
  • Updated the CLIENT_ACTIONS enum to remove INIT_BLOCK_EDITOR_INLINE_EDITING and added INIT_INLINE_EDITING to streamline the event handling process.

Data Structure Updates:

  • Modified the InlineEventData interface to replace blockEditorContent with a structured content object in dot-block-editor-sidebar.component.ts. This change ensures that the content data is more organized and easier to manage.
  • Updated the BlockEditorData interface to include a JSONContent type for the content field, enhancing the data consistency and type safety.

Messaging and Communication:

  • Refactored the initInlineEditing function to send messages to the editor with the appropriate payload for both BLOCK_EDITOR and WYSIWYG types. This change standardizes the communication between the client and the editor.
  • Added tests for the initInlineEditing function to ensure it sends the correct messages based on the provided type and data.

Component and Service Adjustments:

  • Removed the #getJsonContent method from DotBlockEditorSidebarComponent as it is no longer needed with the updated content handling.
  • Updated the InlineEditService to use the new CLIENT_ACTIONS.INIT_INLINE_EDITING action, ensuring consistent event handling across the application.

Test Updates:

  • Modified existing tests and added new ones to cover the changes in event handling, data structures, and messaging. These updates ensure that the new functionality is thoroughly tested and reliable. [1] [2]

Headless

issue-30607-uve-bring-back-inline-editing-for-block-editor-fields-in-headless.mov

Traditional

issue-30607-uve-bring-back-inline-editing-for-block-editor-fields-in-traditional.mov

WYSIWYG

issue-30607-uve-bring-back-inline-editing-for-block-editor-fields-in-wysiwyg.mov

This PR fixes: #30607

@rjvelazco rjvelazco changed the title chore(SDK React): bring Inline Editing for Block Editor feat(UVE): Bring back inline editing for block editor fields in Headless Nov 12, 2024
@rjvelazco rjvelazco marked this pull request as ready for review November 14, 2024 15:32
@rjvelazco rjvelazco dismissed zJaaal’s stale review November 15, 2024 15:19

Feedback addressed

@rjvelazco rjvelazco added this pull request to the merge queue Nov 18, 2024
Merged via the queue into main with commit 3d77285 Nov 18, 2024
36 checks passed
@rjvelazco rjvelazco deleted the issue-30607-uve-bring-back-inline-editing-for-block-editor-fields-in-headless branch November 18, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UVE: Bring back inline editing for block editor fields in Headless
3 participants