@yh-ui/theme 1.0.51 → 1.0.52

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/theme.cjs CHANGED
@@ -576,7 +576,8 @@ class ThemeManager {
576
576
  this.persistKey = options?.persistKey || "yh-ui-theme";
577
577
  this.restoreFromStorage();
578
578
  }
579
- this.apply({
579
+ this.targetEl = getTargetElement(options?.scope);
580
+ this.applyFullConfig({
580
581
  preset: "default",
581
582
  ...options
582
583
  });
package/dist/theme.d.ts CHANGED
@@ -164,9 +164,9 @@ export declare class ThemeManager {
164
164
  algorithm: ColorAlgorithm;
165
165
  componentThemeVersion: number;
166
166
  };
167
- constructor(options?: ThemeOptions);
167
+ constructor(options?: FullThemeConfig);
168
168
  /** 初始化主题 */
169
- initTheme(options?: ThemeOptions): void;
169
+ initTheme(options?: FullThemeConfig): void;
170
170
  /** 应用主题 */
171
171
  apply(options: ThemeOptions): void;
172
172
  /** 设置预设主题 */
@@ -278,7 +278,7 @@ export declare function useTheme(): ThemeManager;
278
278
  export declare function setThemeColor(color: string): void;
279
279
  export declare function toggleDarkMode(): boolean;
280
280
  export declare function setThemePreset(preset: PresetTheme): void;
281
- export declare function initTheme(options?: ThemeOptions): ThemeManager;
281
+ export declare function initTheme(options?: FullThemeConfig): ThemeManager;
282
282
  /** Vue Composition API Hook - 获取主题变量 */
283
283
  export declare function useThemeVars(): {
284
284
  getCssVar: (name: string) => string;
@@ -310,7 +310,7 @@ export declare function checkContrast(foreground: string, background: string, le
310
310
  export declare function getTextColorForBackground(background: string): string;
311
311
  export declare const THEME_INJECTION_KEY: InjectionKey<ThemeManager>;
312
312
  export declare const ThemePlugin: {
313
- install(app: App, options?: ThemeOptions): void;
313
+ install(app: App, options?: FullThemeConfig): void;
314
314
  };
315
315
  export default ThemePlugin;
316
316
  export { hexToRgb, rgbToHex, rgbToHsl, hslToRgb, mixColor, adjustSaturation, adjustLightness, getContrastRatio, ensureContrast, getRelativeLuminance, getComplementaryColor, getAnalogousColors, getTriadicColors, generatePaletteFromPrimary };
package/dist/theme.mjs CHANGED
@@ -517,7 +517,8 @@ export class ThemeManager {
517
517
  this.persistKey = options?.persistKey || "yh-ui-theme";
518
518
  this.restoreFromStorage();
519
519
  }
520
- this.apply({
520
+ this.targetEl = getTargetElement(options?.scope);
521
+ this.applyFullConfig({
521
522
  preset: "default",
522
523
  ...options
523
524
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yh-ui/theme",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "description": "YH-UI theme and design tokens",
5
5
  "type": "module",
6
6
  "sideEffects": [