@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.
@@ -1,9 +1,9 @@
1
1
  import { VariantEntity } from '../theme';
2
2
  import { AddColorsOptions } from '../color';
3
- import { PluginConstructor } from '../plugin/plugin.service';
3
+ import { PluginConstructor } from '../plugin';
4
4
  export interface ConfigInterface {
5
5
  sourceColor: string;
6
- contrastLevel?: 0;
6
+ contrastLevel?: number;
7
7
  isDark?: boolean;
8
8
  variant?: VariantEntity;
9
9
  colors?: AddColorsOptions | AddColorsOptions[];
@@ -7,6 +7,6 @@ export declare class ConfigService {
7
7
  constructor({ appService }: {
8
8
  appService: AppService;
9
9
  });
10
- loadConfig(): void;
10
+ loadConfig(config?: ConfigInterface): void;
11
11
  private getConfig;
12
12
  }
package/dist/main.d.ts CHANGED
@@ -1,3 +1,7 @@
1
1
  import { AppService } from './app.service';
2
+ import { ConfigInterface } from './config';
2
3
  export declare function bootstrap(): AppService;
3
- export declare function bootstrapFromConfig(path?: string): AppService;
4
+ export declare function bootstrapFromConfig(args?: {
5
+ path?: string;
6
+ config?: ConfigInterface;
7
+ }): AppService;
@@ -1503,24 +1503,24 @@ var ConfigService = /*#__PURE__*/function () {
1503
1503
  this.appService = appService;
1504
1504
  }
1505
1505
  var _proto = ConfigService.prototype;
1506
- _proto.loadConfig = function loadConfig() {
1506
+ _proto.loadConfig = function loadConfig(config) {
1507
1507
  var _this$appService = this.appService,
1508
1508
  themeService = _this$appService.themeService,
1509
1509
  colorService = _this$appService.colorService,
1510
1510
  pluginService = _this$appService.pluginService;
1511
- var _this$getConfig = this.getConfig(),
1512
- sourceColor = _this$getConfig.sourceColor,
1513
- _this$getConfig$contr = _this$getConfig.contrastLevel,
1514
- contrastLevel = _this$getConfig$contr === void 0 ? 0 : _this$getConfig$contr,
1515
- _this$getConfig$isDar = _this$getConfig.isDark,
1516
- isDark = _this$getConfig$isDar === void 0 ? false : _this$getConfig$isDar,
1517
- _this$getConfig$varia = _this$getConfig.variant,
1518
- variant = _this$getConfig$varia === void 0 ? VariantModel.tonalSpot : _this$getConfig$varia,
1519
- palettes = _this$getConfig.palettes,
1520
- colors = _this$getConfig.colors,
1521
- _this$getConfig$useDe = _this$getConfig.useDefaultColors,
1522
- useDefaultColors = _this$getConfig$useDe === void 0 ? true : _this$getConfig$useDe,
1523
- plugins = _this$getConfig.plugins;
1511
+ var _ref2 = config != null ? config : this.getConfig(),
1512
+ sourceColor = _ref2.sourceColor,
1513
+ _ref2$contrastLevel = _ref2.contrastLevel,
1514
+ contrastLevel = _ref2$contrastLevel === void 0 ? 0 : _ref2$contrastLevel,
1515
+ _ref2$isDark = _ref2.isDark,
1516
+ isDark = _ref2$isDark === void 0 ? false : _ref2$isDark,
1517
+ _ref2$variant = _ref2.variant,
1518
+ variant = _ref2$variant === void 0 ? VariantModel.tonalSpot : _ref2$variant,
1519
+ palettes = _ref2.palettes,
1520
+ colors = _ref2.colors,
1521
+ _ref2$useDefaultColor = _ref2.useDefaultColors,
1522
+ useDefaultColors = _ref2$useDefaultColor === void 0 ? true : _ref2$useDefaultColor,
1523
+ plugins = _ref2.plugins;
1524
1524
  themeService.create({
1525
1525
  contrastLevel: contrastLevel,
1526
1526
  isDark: isDark,
@@ -1528,9 +1528,9 @@ var ConfigService = /*#__PURE__*/function () {
1528
1528
  variant: variant
1529
1529
  });
1530
1530
  if (palettes) {
1531
- Object.entries(palettes).forEach(function (_ref2) {
1532
- var key = _ref2[0],
1533
- value = _ref2[1];
1531
+ Object.entries(palettes).forEach(function (_ref3) {
1532
+ var key = _ref3[0],
1533
+ value = _ref3[1];
1534
1534
  return themeService.addCustomPalette(key, value);
1535
1535
  });
1536
1536
  }
@@ -1640,10 +1640,10 @@ importContainer(AppContainer, [ConfigModule, AppModule, PluginModule, ColorModul
1640
1640
  function bootstrap() {
1641
1641
  return AppContainer.resolve('appService');
1642
1642
  }
1643
- function bootstrapFromConfig(path) {
1643
+ function bootstrapFromConfig(args) {
1644
1644
  var configService = AppContainer.resolve('configService');
1645
- if (path) configService.configPath = path;
1646
- configService.loadConfig();
1645
+ if (args != null && args.path) configService.configPath = args.path;
1646
+ configService.loadConfig(args == null ? void 0 : args.config);
1647
1647
  return AppContainer.resolve('appService');
1648
1648
  }
1649
1649