chore(style-editor): Created API to define style editor form structure on dotcms/uve#34038
Merged
KevinDavilaDotCMS merged 15 commits intomainfrom Dec 11, 2025
Conversation
…ng input handling - Added export for in to define valid input types. - Updated function in to ensure type safety for and . - Introduced comprehensive unit tests in to validate the behavior of various field types, including input, dropdown, and radio fields. - Enhanced documentation in to clarify usage and experimental status of style editor functions.
8 tasks
- Renamed to and to for better context. - Updated type references in and to use the new type names, enhancing type safety in the style editor functionality.
…ctionality - Introduced the hook to register style editor forms with the UVE editor. - Added comprehensive unit tests for the hook to validate its behavior with various form schemas. - Updated the public API to include a new action for registering style schemas in the editor. - Enhanced the style editor's public interface to support the new functionality.
- Updated the normalization process for field and section definitions to ensure all type-specific properties are encapsulated within a object, promoting consistency in the schema format sent to UVE. - Enhanced type safety for input fields by introducing a new type, ensuring that types align with . - Improved documentation to clarify the normalization process and the structure of the resulting schemas. - Adjusted the public API to reflect these changes, ensuring a seamless integration for developers using the style editor.
…t options - Added handling for radio-specific properties in the normalization process, allowing for dynamic column configurations. - Updated the structure of normalized fields to simplify the schema format. - Improved test cases for style editor forms to reflect changes in field definitions and layout options. - Enhanced documentation to clarify the usage of columns in radio fields and their impact on layout.
- Updated the function to for improved clarity and consistency in naming. - Adjusted all references in tests and documentation to reflect the new function name. - Ensured that the public API remains consistent with the updated naming convention, enhancing developer experience.
…oy pipeline. Same version as main
zJaaal
requested changes
Dec 10, 2025
adrianjm-dotCMS
approved these changes
Dec 10, 2025
- Introduced new interfaces for option objects, including and , to standardize option structures across dropdowns, radio buttons, and checkboxes. - Updated existing field interfaces to utilize these new types, enhancing type safety and clarity in option handling. - Added a new interface to encapsulate field-specific properties, streamlining the configuration process for various field types. - Improved documentation to clarify the usage and structure of the new option types and field schema configuration.
…port - Introduced a new type, StyleEditorCheckboxDefaultValue, to standardize the default value structure for checkbox groups. - Updated existing interfaces to utilize the new type, improving type safety and clarity in checkbox handling. - Enhanced documentation to provide examples and clarify the usage of the new checkbox default value type.
- Added tests to ensure the useStyleEditorSchemas hook does not cause infinite loops when inline objects are passed on each render. - Demonstrated the importance of stable references to prevent unnecessary re-registrations during re-renders. - Updated existing test cases to validate the expected behavior of the hook under various rendering scenarios.
…form-structure-on-dotcmsuve
- Updated the style schema interface to use StyleEditorFormSchema for improved type safety. - Modified the handling of style schemas in the EditEmaEditorComponent to align with the new structure. - Enhanced the display of style schemas in the dot-uve-palette component for better usability. - Adjusted related tests to reflect changes in schema structure and ensure correct functionality.
dario-daza
approved these changes
Dec 11, 2025
zJaaal
approved these changes
Dec 11, 2025
rjvelazco
approved these changes
Dec 11, 2025
6 tasks
8 tasks
dsolistorres
pushed a commit
that referenced
this pull request
Feb 20, 2026
…e on dotcms/uve (#34038) https://github.com/user-attachments/assets/67c0f657-49e9-4e5f-9071-2bc830cbea2a ### Usage ``` // First define the form with the API. const blogForm = defineStyleEditorSchema({ contentType: 'Content', sections: [ { title: 'Typography', fields: [ styleEditorField.checkboxGroup({ label: 'New CheckboxGroup', options: [ { label: 'Option 1', value: 'option1' }, { label: 'Option 2', value: 'option2' } ], defaultValue: { option1: false, option2: false }, }), styleEditorField.radio({ label: 'Layout', columns: 2, options: [ { label: 'Option 1', value: 'option1', imageURL: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSphn5CRr3MrQUjWWH7ByHWW-lROnVQl4XxYQ&s', width: 119 }, { label: 'Option 2', value: 'option2', imageURL: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSphn5CRr3MrQUjWWH7ByHWW-lROnVQl4XxYQ&s' }, { label: 'New Option', value: '' }, { label: 'New Option', value: 'new-option' } ], }) ] } ] }) // Then use the helper hook. useStyleEditorSchemas([blogForm]) // This hook internally use a exposed function called registerStyleEditorSchemas() // In Angular, we can use this function directly. We can create a service for this too, but maybe is a lot of code only for that, but we can recheck this later ``` --------- Co-authored-by: Kevin <kfariid@gmail.com>
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.
2025-12-10.13-02-36.mov
Usage
This PR fixes: #33809