feat: Add custom branding functionality with CSS and JSON configuration

- Introduced custom branding CSS styles in `custom-branding.css`.
- Created example JSON configuration for custom branding in `custom-branding.example.json`.
- Implemented branding configuration logic in `BrandingConfig.ts` to normalize and validate branding settings.
- Developed CSS loader to manage loading and unloading of custom stylesheets in `BrandingCssLoader.ts`.
- Added DOM rendering capabilities for branding elements in `BrandingDomRenderer.ts`.
- Defined types and interfaces for branding elements and configurations in `BrandingTypes.ts`.
- Included localization support for German in `de-de.js`.
- Added unit tests for branding configuration, CSS loader, and DOM renderer.
- Validated project structure and static assets with new validation scripts.
This commit is contained in:
Torsten Brendgen
2026-07-20 22:55:47 +02:00
parent b99ac31f4d
commit 490e9adbd8
29 changed files with 1809 additions and 588 deletions

View File

@@ -1,23 +1,23 @@
{
"name": "custom-branding",
"version": "1.0.4",
"version": "3.0.0",
"private": true,
"main": "lib/index.js",
"engines": {
"node": ">=0.10.0"
"node": ">=6.9.0 <9.0.0"
},
"scripts": {
"build": "gulp bundle",
"build": "npm run build:classic && gulp bundle",
"build:classic": "powershell -NoProfile -ExecutionPolicy Bypass -File ./build-classic.ps1",
"clean": "gulp clean",
"test": "gulp test",
"package": "gulp clean && gulp bundle --ship && gulp package-solution --ship"
"test": "tsc -p tests/tsconfig.json && node tests/BrandingConfig.test.js && node tests/BrandingDomRenderer.test.js && node tests/BrandingCssLoader.test.js && node tests/validate-static-assets.js && powershell -NoProfile -ExecutionPolicy Bypass -File ./tests/validate-project.ps1",
"package": "npm test && npm run build:classic && gulp clean && gulp bundle --ship && gulp package-solution --ship"
},
"dependencies": {
"@microsoft/sp-core-library": "~1.4.0",
"@microsoft/decorators": "~1.4.0",
"@types/webpack-env": "1.13.1",
"@types/es6-promise": "0.0.33",
"@microsoft/sp-dialog": "~1.4.0",
"@microsoft/sp-application-base": "~1.4.0"
},
"devDependencies": {
@@ -27,6 +27,7 @@
"gulp": "~3.9.1",
"@types/chai": "3.4.34",
"@types/mocha": "2.2.38",
"ajv": "~5.2.2"
"ajv": "~5.2.2",
"jsdom": "9.12.0"
}
}