@iyulab/components 0.1.1 → 0.1.2
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/CHANGELOG.md +3 -0
- package/dist/index.js +1 -1
- package/dist/utilities/theme.d.ts +4 -5
- package/dist/utilities/theme.js +8 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2 (2025-11-13)
|
|
4
|
+
- fixed a type issue in `theme` utility.
|
|
5
|
+
|
|
3
6
|
## 0.1.1 (2025-11-13)
|
|
4
7
|
- added `BrowserStorage` which supports `localStorage` and `cookie` with async methods for getting, setting, and removing items.
|
|
5
8
|
- changed theme `persist` option to `store` option, and fixed some issues.
|
package/dist/index.js
CHANGED
|
@@ -15,4 +15,4 @@ export { Tooltip } from './components/tooltip/Tooltip.js';
|
|
|
15
15
|
export { BrowserStorage } from './utilities/BrowserStorage.js';
|
|
16
16
|
export { getPropertyMeta, propertyMeta, setPropertyMeta } from './utilities/decorators.js';
|
|
17
17
|
export { notifier } from './utilities/notifier.js';
|
|
18
|
-
export { theme } from './utilities/theme.js';
|
|
18
|
+
export { Theme, theme } from './utilities/theme.js';
|
|
@@ -27,18 +27,18 @@ export interface ThemeInitOptions {
|
|
|
27
27
|
/**
|
|
28
28
|
* Theme 클래스 — 싱글톤 패턴으로 사용합니다.
|
|
29
29
|
*/
|
|
30
|
-
declare class Theme {
|
|
30
|
+
export declare class Theme {
|
|
31
31
|
private static _instance;
|
|
32
32
|
private readonly STORAGE_KEY_DEFAULT;
|
|
33
33
|
private storage;
|
|
34
|
-
private
|
|
35
|
-
private
|
|
34
|
+
private _isInitialized;
|
|
35
|
+
private _isDebugMode;
|
|
36
36
|
/** private 생성자 — 외부에서 new Theme()를 할 수 없게 함 */
|
|
37
37
|
private constructor();
|
|
38
38
|
/** 싱글톤 인스턴스 접근자 */
|
|
39
39
|
static get instance(): Theme;
|
|
40
40
|
/** 외부에서 현재 초기화 상태를 확인할 수 있게 getter 제공 */
|
|
41
|
-
get
|
|
41
|
+
get isInitialized(): boolean;
|
|
42
42
|
/**
|
|
43
43
|
* 테마 유틸리티 초기화
|
|
44
44
|
*/
|
|
@@ -64,4 +64,3 @@ declare class Theme {
|
|
|
64
64
|
* 테마 유틸리티 싱글톤 인스턴스입니다.
|
|
65
65
|
*/
|
|
66
66
|
export declare const theme: Theme;
|
|
67
|
-
export {};
|
package/dist/utilities/theme.js
CHANGED
|
@@ -7,8 +7,8 @@ class Theme {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.STORAGE_KEY_DEFAULT = "theme";
|
|
9
9
|
this.storage = null;
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
10
|
+
this._isInitialized = false;
|
|
11
|
+
this._isDebugMode = false;
|
|
12
12
|
/**
|
|
13
13
|
* 시스템 테마 변경을 처리하는 메서드
|
|
14
14
|
*/
|
|
@@ -27,14 +27,14 @@ class Theme {
|
|
|
27
27
|
return this._instance;
|
|
28
28
|
}
|
|
29
29
|
/** 외부에서 현재 초기화 상태를 확인할 수 있게 getter 제공 */
|
|
30
|
-
get
|
|
31
|
-
return this.
|
|
30
|
+
get isInitialized() {
|
|
31
|
+
return this._isInitialized;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* 테마 유틸리티 초기화
|
|
35
35
|
*/
|
|
36
36
|
async init(options) {
|
|
37
|
-
this.
|
|
37
|
+
this._isDebugMode = options?.debug || false;
|
|
38
38
|
this.log("init called", { options });
|
|
39
39
|
if (options?.store) {
|
|
40
40
|
this.log("store option provided, initializing BrowserStorage");
|
|
@@ -70,7 +70,7 @@ class Theme {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
this.set(theme2);
|
|
73
|
-
this.
|
|
73
|
+
this._isInitialized = true;
|
|
74
74
|
this.log("theme initialized");
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
@@ -125,9 +125,9 @@ class Theme {
|
|
|
125
125
|
* 디버그 모드시 로그 출력 함수 (인스턴스 스코프)
|
|
126
126
|
*/
|
|
127
127
|
log(...args) {
|
|
128
|
-
if (this.
|
|
128
|
+
if (this._isDebugMode) console.log("[theme]", ...args);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
const theme = Theme.instance;
|
|
132
132
|
|
|
133
|
-
export { theme };
|
|
133
|
+
export { Theme, theme };
|