This pull request refactors the existing Layout class and related enums for managing the fit and alignment of Rive animations within an HTML canvas. The refactoring aims to improve code organization, maintainability, and adherence to best practices.
Changes
Move the Layout class to a dedicated file js/src/layout/Layout.ts
Move the Fit and Alignment enums to separate files within js/src/layout/enums/
Create a types directory within js/src/layout/ to house the LayoutParameters interface
Update import statements across the codebase to reflect the new file structure
Export the Layout class and enums from js/src/layout/index.ts
Update js/src/rive.ts to export the Layout class and enums
Benefits
Improved code organization and separation of concerns
Better adherence to the principle of single responsibility
Easier maintenance and extensibility of the Layout class and related types
Consistent import paths for the Layout class and enums across the codebase
Documentation
Existing documentation for the Layout class and enums has been updated to reflect the new file structure and import paths
Layout module refactor
Description
This pull request refactors the existing
Layout
class and related enums for managing the fit and alignment of Rive animations within an HTML canvas. The refactoring aims to improve code organization, maintainability, and adherence to best practices.Changes
Layout
class to a dedicated filejs/src/layout/Layout.ts
Fit
andAlignment
enums to separate files withinjs/src/layout/enums/
types
directory withinjs/src/layout/
to house theLayoutParameters
interfaceLayout
class and enums fromjs/src/layout/index.ts
js/src/rive.ts
to export theLayout
class and enumsBenefits
Layout
class and related typesLayout
class and enums across the codebaseDocumentation
Layout
class and enums has been updated to reflect the new file structure and import pathsRisks
No significant risks have been identified.