Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add file navigation, sass compilation and exporting (#6)
* feat: add sass compilation and virtual file management Introduces the SassWorkspaceCompiler to allow SASS compilation and workspace management. This utility facilitates the compilation of SASS files using a virtual file system, it allows the inclusion of static resources. The VirtualSassImporter, implementing the Importer interface, efficiently resolves import directives within this virtual file system. ***Example*** ```javascript // Define your workspace const workspace = [ { name: 'main.scss', content: '@import "variables"; .body { color: $primaryColor; }', type: 'scss' }, { name: 'variables.scss', content: '$primaryColor: blue;', type: 'scss' } ]; // Instantiate the compiler with the workspace const compiler = new SassWorkspaceCompiler(testWorkspace, {}, 'main.scss'); // Compile the SCSS const compiledCss = compiler.compile(); ``` Additionally, a prebuild script has been introduced to automate the generation of the virtual workspace structure directly from the `@srgssr/pillarbox-web` dependency's SCSS files. * feat: add toggle pane button for theme editor file navigation Introduces a new `TogglePaneButton` component, aimed at displaying a virtual file system in order to edit the multiple `scss` files found in the pillarbox default theme. When a file in the tree view is selected, its content is loaded into the theme editor for modification and previewing. ***Example*** ```html <toggle-pane-button label="Display a message"> <span>Hello World!</span> </toggle-pane-button> ``` * feat: add export button Introduces a new `ZipWorkspace` service to allow the exporting of the current workspace as a zip. ***Example*** ```javascript // Define your workspace const workspace = [ { name: 'main.scss', content: '@import "variables"; .body { color: $primaryColor; }', type: 'scss' }, { name: 'variables.scss', content: '$primaryColor: blue;', type: 'scss' } ]; // Instantiate the zip workspace and trigger the download await new ZipWorkspace(testWorkspace).download('testWorkspace.zip'); ``` * fix: remove prebuild from build step npm offers `pre` and `post` scripts that will run automatically before or after a script. Co-authored-by: André M. <[email protected]> --------- Co-authored-by: André M. <[email protected]>
- Loading branch information