diff --git a/CHANGELOG.md b/CHANGELOG.md index cf6af9a..cdb12f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -## [v1.0.8](https://github.com/konfer-be/cliam/compare/v1.0.7...v1.0.8) +## [v1.0.9](https://github.com/konfer-be/cliam/compare/v1.0.8...v1.0.9) + +### Commits + +- Fix default colors [`44f5ce3`](https://github.com/konfer-be/cliam/commit/44f5ce397aa8f8909cdefbebd45eb7cd2539da5c) + +## [v1.0.8](https://github.com/konfer-be/cliam/compare/v1.0.7...v1.0.8) - 2021-04-18 + +### Commits + +- Update changelog [`a6d6bca`](https://github.com/konfer-be/cliam/commit/a6d6bca13dcb3b7e0fee6c68e00ba30933d8d445) ## [v1.0.7](https://github.com/konfer-be/cliam/compare/v1.0.6...v1.0.7) - 2021-04-16 diff --git a/lib/services/compiler.service.js b/lib/services/compiler.service.js index e5186aa..d454912 100644 --- a/lib/services/compiler.service.js +++ b/lib/services/compiler.service.js @@ -11,6 +11,10 @@ const container_service_1 = require("./../services/container.service"); */ class Compiler { constructor() { + /** + * @description + */ + this.THEME = container_service_1.Container.configuration.consumer?.theme; /** * @description */ @@ -60,18 +64,18 @@ class Compiler { * @description */ this.COLORS = [ - { key: '111111', value: container_service_1.Container.configuration.consumer?.theme?.primaryColor }, - { key: '222222', value: container_service_1.Container.configuration.consumer?.theme?.secondaryColor }, - { key: '333333', value: container_service_1.Container.configuration.consumer?.theme?.tertiaryColor }, - { key: '444444', value: container_service_1.Container.configuration.consumer?.theme?.quaternaryColor }, - { key: 'fffff1', value: Color(`#${container_service_1.Container.configuration.consumer?.theme?.primaryColor}`).lighten(0.50).hex().substring(1) }, - { key: 'fffff2', value: Color(`#${container_service_1.Container.configuration.consumer?.theme?.secondaryColor}`).lighten(0.50).hex().substring(1) }, - { key: 'fffff3', value: Color(`#${container_service_1.Container.configuration.consumer?.theme?.tertiaryColor}`).lighten(0.50).hex().substring(1) }, - { key: 'fffff4', value: Color(`#${container_service_1.Container.configuration.consumer?.theme?.quaternaryColor}`).lighten(0.50).hex().substring(1) }, - { key: '000001', value: Color(`#${container_service_1.Container.configuration.consumer?.theme?.primaryColor}`).darken(0.50).hex().substring(1) }, - { key: '000002', value: Color(`#${container_service_1.Container.configuration.consumer?.theme?.secondaryColor}`).darken(0.50).hex().substring(1) }, - { key: '000003', value: Color(`#${container_service_1.Container.configuration.consumer?.theme?.tertiaryColor}`).darken(0.50).hex().substring(1) }, - { key: '000004', value: Color(`#${container_service_1.Container.configuration.consumer?.theme?.quaternaryColor}`).darken(0.50).hex().substring(1) } + { key: '111111', value: this.THEME?.primaryColor || null }, + { key: '222222', value: this.THEME?.secondaryColor || null }, + { key: '333333', value: this.THEME?.tertiaryColor || null }, + { key: '444444', value: this.THEME?.quaternaryColor || null }, + { key: 'fffff1', value: this.THEME?.primaryColor ? Color(`#${this.THEME.primaryColor}`).lighten(0.50).hex().substring(1) : null }, + { key: 'fffff2', value: this.THEME?.secondaryColor ? Color(`#${this.THEME.secondaryColor}`).lighten(0.50).hex().substring(1) : null }, + { key: 'fffff3', value: this.THEME?.tertiaryColor ? Color(`#${this.THEME.tertiaryColor}`).lighten(0.50).hex().substring(1) : null }, + { key: 'fffff4', value: this.THEME?.quaternaryColor ? Color(`#${this.THEME.quaternaryColor}`).lighten(0.50).hex().substring(1) : null }, + { key: '000001', value: this.THEME?.primaryColor ? Color(`#${this.THEME.primaryColor}`).darken(0.50).hex().substring(1) : null }, + { key: '000002', value: this.THEME?.secondaryColor ? Color(`#${this.THEME.secondaryColor}`).darken(0.50).hex().substring(1) : null }, + { key: '000003', value: this.THEME?.tertiaryColor ? Color(`#${this.THEME.tertiaryColor}`).darken(0.50).hex().substring(1) : null }, + { key: '000004', value: this.THEME?.quaternaryColor ? Color(`#${this.THEME.quaternaryColor}`).darken(0.50).hex().substring(1) : null } ]; Hbs.handlebars.registerHelper('year', () => { return new Date().getFullYear(); diff --git a/package.json b/package.json index fb10805..0008b94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cliam", - "version": "1.0.8", + "version": "1.0.9", "engines": { "node": ">=14.16" }, diff --git a/src/services/compiler.service.ts b/src/services/compiler.service.ts index fa59e06..2f0c060 100644 --- a/src/services/compiler.service.ts +++ b/src/services/compiler.service.ts @@ -17,6 +17,11 @@ class Compiler { */ private static instance: Compiler = null; + /** + * @description + */ + private readonly THEME = Container.configuration.consumer?.theme; + /** * @description */ @@ -71,18 +76,18 @@ class Compiler { * @description */ private readonly COLORS: Array<{key: string, value: string}> = [ - { key: '111111', value: Container.configuration.consumer?.theme?.primaryColor }, - { key: '222222', value: Container.configuration.consumer?.theme?.secondaryColor }, - { key: '333333', value: Container.configuration.consumer?.theme?.tertiaryColor }, - { key: '444444', value: Container.configuration.consumer?.theme?.quaternaryColor }, - { key: 'fffff1', value: Color(`#${Container.configuration.consumer?.theme?.primaryColor}`).lighten(0.50).hex().substring(1) }, - { key: 'fffff2', value: Color(`#${Container.configuration.consumer?.theme?.secondaryColor}`).lighten(0.50).hex().substring(1) }, - { key: 'fffff3', value: Color(`#${Container.configuration.consumer?.theme?.tertiaryColor}`).lighten(0.50).hex().substring(1) }, - { key: 'fffff4', value: Color(`#${Container.configuration.consumer?.theme?.quaternaryColor}`).lighten(0.50).hex().substring(1) }, - { key: '000001', value: Color(`#${Container.configuration.consumer?.theme?.primaryColor}`).darken(0.50).hex().substring(1) }, - { key: '000002', value: Color(`#${Container.configuration.consumer?.theme?.secondaryColor}`).darken(0.50).hex().substring(1) }, - { key: '000003', value: Color(`#${Container.configuration.consumer?.theme?.tertiaryColor}`).darken(0.50).hex().substring(1) }, - { key: '000004', value: Color(`#${Container.configuration.consumer?.theme?.quaternaryColor}`).darken(0.50).hex().substring(1) } + { key: '111111', value: this.THEME?.primaryColor || null }, + { key: '222222', value: this.THEME?.secondaryColor || null }, + { key: '333333', value: this.THEME?.tertiaryColor || null }, + { key: '444444', value: this.THEME?.quaternaryColor || null }, + { key: 'fffff1', value: this.THEME?.primaryColor ? Color(`#${this.THEME.primaryColor}`).lighten(0.50).hex().substring(1) : null }, + { key: 'fffff2', value: this.THEME?.secondaryColor ? Color(`#${this.THEME.secondaryColor}`).lighten(0.50).hex().substring(1) : null }, + { key: 'fffff3', value: this.THEME?.tertiaryColor ? Color(`#${this.THEME.tertiaryColor}`).lighten(0.50).hex().substring(1) : null }, + { key: 'fffff4', value: this.THEME?.quaternaryColor ? Color(`#${this.THEME.quaternaryColor}`).lighten(0.50).hex().substring(1) : null }, + { key: '000001', value: this.THEME?.primaryColor ? Color(`#${this.THEME.primaryColor}`).darken(0.50).hex().substring(1) : null }, + { key: '000002', value: this.THEME?.secondaryColor ? Color(`#${this.THEME.secondaryColor}`).darken(0.50).hex().substring(1) : null }, + { key: '000003', value: this.THEME?.tertiaryColor ? Color(`#${this.THEME.tertiaryColor}`).darken(0.50).hex().substring(1) : null }, + { key: '000004', value: this.THEME?.quaternaryColor ? Color(`#${this.THEME.quaternaryColor}`).darken(0.50).hex().substring(1) : null } ]; constructor() {