@udixio/theme 1.0.0-beta.21 → 1.0.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/config.interface.d.ts +2 -2
- package/dist/config/config.service.d.ts +1 -1
- package/dist/main.d.ts +5 -1
- package/dist/theme.cjs.development.js +20 -20
- package/dist/theme.cjs.development.js.map +1 -1
- package/dist/theme.cjs.production.min.js +1 -1
- package/dist/theme.cjs.production.min.js.map +1 -1
- package/dist/theme.esm.js +20 -20
- package/dist/theme.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/config/config.interface.ts +2 -2
- package/src/config/config.service.ts +2 -2
- package/src/main.ts +7 -4
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { VariantEntity } from '../theme';
|
|
2
2
|
import { AddColorsOptions } from '../color';
|
|
3
|
-
import { PluginConstructor } from '../plugin
|
|
3
|
+
import { PluginConstructor } from '../plugin';
|
|
4
4
|
|
|
5
5
|
export interface ConfigInterface {
|
|
6
6
|
sourceColor: string;
|
|
7
|
-
contrastLevel?:
|
|
7
|
+
contrastLevel?: number;
|
|
8
8
|
isDark?: boolean;
|
|
9
9
|
variant?: VariantEntity;
|
|
10
10
|
colors?: AddColorsOptions | AddColorsOptions[];
|
|
@@ -25,7 +25,7 @@ export class ConfigService {
|
|
|
25
25
|
this.appService = appService;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
public loadConfig(): void {
|
|
28
|
+
public loadConfig(config?: ConfigInterface): void {
|
|
29
29
|
const { themeService, colorService, pluginService } = this.appService;
|
|
30
30
|
const {
|
|
31
31
|
sourceColor,
|
|
@@ -36,7 +36,7 @@ export class ConfigService {
|
|
|
36
36
|
colors,
|
|
37
37
|
useDefaultColors = true,
|
|
38
38
|
plugins,
|
|
39
|
-
} = this.getConfig();
|
|
39
|
+
} = config ?? this.getConfig();
|
|
40
40
|
themeService.create({
|
|
41
41
|
contrastLevel: contrastLevel,
|
|
42
42
|
isDark: isDark,
|
package/src/main.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import AppContainer from './app.container';
|
|
2
2
|
import { AppService } from './app.service';
|
|
3
|
-
import { ConfigService } from './config';
|
|
3
|
+
import { ConfigInterface, ConfigService } from './config';
|
|
4
4
|
|
|
5
5
|
export function bootstrap(): AppService {
|
|
6
6
|
return AppContainer.resolve<AppService>('appService');
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export function bootstrapFromConfig(
|
|
9
|
+
export function bootstrapFromConfig(args?: {
|
|
10
|
+
path?: string;
|
|
11
|
+
config?: ConfigInterface;
|
|
12
|
+
}): AppService {
|
|
10
13
|
const configService = AppContainer.resolve<ConfigService>('configService');
|
|
11
|
-
if (path) configService.configPath = path;
|
|
12
|
-
configService.loadConfig();
|
|
14
|
+
if (args?.path) configService.configPath = args.path;
|
|
15
|
+
configService.loadConfig(args?.config);
|
|
13
16
|
return AppContainer.resolve<AppService>('appService');
|
|
14
17
|
}
|