@ehfuse/forma 1.7.0 → 1.7.1
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/README.md +2 -0
- package/dist/esm/hooks/useBreakpoint.d.ts +51 -0
- package/dist/esm/hooks/useBreakpoint.d.ts.map +1 -0
- package/dist/esm/hooks/useBreakpoint.js +113 -0
- package/dist/esm/hooks/useBreakpoint.js.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/breakpoint.d.ts +62 -0
- package/dist/esm/types/breakpoint.d.ts.map +1 -0
- package/dist/esm/types/breakpoint.js +25 -0
- package/dist/esm/types/breakpoint.js.map +1 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/hooks/useBreakpoint.d.ts +51 -0
- package/dist/hooks/useBreakpoint.d.ts.map +1 -0
- package/dist/hooks/useBreakpoint.js +117 -0
- package/dist/hooks/useBreakpoint.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/types/breakpoint.d.ts +62 -0
- package/dist/types/breakpoint.d.ts.map +1 -0
- package/dist/types/breakpoint.js +26 -0
- package/dist/types/breakpoint.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Forma는 React 애플리케이션에서 폼과 상태를 **간편하면서도
|
|
|
18
18
|
- 🌟 **Global State Subscription**: Subscribe to entire state with `useValue("*")` pattern for optimal performance
|
|
19
19
|
- ✅ **General State Management**: Efficient management of non-form states with `useFormaState`
|
|
20
20
|
- 🎭 **Modal Stack Management**: Mobile-friendly modal handling with back button support via `useModal`
|
|
21
|
+
- 📱 **Responsive Breakpoint Management**: Screen size detection and adaptive UI with `useBreakpoint`
|
|
21
22
|
- ✅ **Dot Notation Optimization**: Access nested objects like `user.profile.name`
|
|
22
23
|
- ✅ **Full MUI Compatibility**: Perfect integration with Material-UI components
|
|
23
24
|
- ✅ **Global Form State**: Share form state across multiple components
|
|
@@ -32,6 +33,7 @@ Forma는 React 애플리케이션에서 폼과 상태를 **간편하면서도
|
|
|
32
33
|
- 🌟 **전체 상태 구독**: `useValue("*")` 패턴으로 전체 상태를 한 번에 구독하여 최적 성능 제공
|
|
33
34
|
- ✅ **범용 상태 관리**: `useFormaState`로 폼 외 일반 상태도 효율적 관리
|
|
34
35
|
- 🎭 **모달 스택 관리**: `useModal`로 뒤로가기 지원하는 모바일 친화적 모달 처리
|
|
36
|
+
- 📱 **반응형 브레이크포인트 관리**: `useBreakpoint`로 화면 크기 감지 및 적응형 UI 구현
|
|
35
37
|
- ✅ **Dot Notation 최적화**: `user.profile.name` 형태의 중첩 객체 접근
|
|
36
38
|
- ✅ **MUI 완전 호환**: Material-UI 컴포넌트와 완벽한 통합
|
|
37
39
|
- ✅ **글로벌 폼 상태**: 여러 컴포넌트 간 폼 상태 공유
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import type { UseBreakpointReturn } from "../types/breakpoint";
|
|
25
|
+
/**
|
|
26
|
+
* useBreakpoint Hook
|
|
27
|
+
*
|
|
28
|
+
* Manages responsive breakpoint state for screen size detection.
|
|
29
|
+
* Provides both "down" (below threshold) and "up" (above threshold) states.
|
|
30
|
+
*
|
|
31
|
+
* 화면 크기 감지를 위한 반응형 브레이크포인트 상태를 관리합니다.
|
|
32
|
+
* "down" (임계값 이하) 및 "up" (임계값 이상) 상태를 모두 제공합니다.
|
|
33
|
+
*
|
|
34
|
+
* @returns {UseBreakpointReturn} Breakpoint state object
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* function ResponsiveComponent() {
|
|
39
|
+
* const breakpoint = useBreakpoint();
|
|
40
|
+
*
|
|
41
|
+
* return (
|
|
42
|
+
* <div>
|
|
43
|
+
* {breakpoint.smUp ? <DesktopView /> : <MobileView />}
|
|
44
|
+
* {breakpoint.mdUp && <SidebarNav />}
|
|
45
|
+
* </div>
|
|
46
|
+
* );
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare const useBreakpoint: () => UseBreakpointReturn;
|
|
51
|
+
//# sourceMappingURL=useBreakpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../../hooks/useBreakpoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAY/D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,aAAa,QAAO,mBA4DhC,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import { useState, useEffect } from "react";
|
|
25
|
+
// 브레이크포인트 정의 (픽셀 단위)
|
|
26
|
+
const breakpoints = {
|
|
27
|
+
xs: 0,
|
|
28
|
+
sm: 600,
|
|
29
|
+
md: 900,
|
|
30
|
+
lg: 1200,
|
|
31
|
+
xl: 1536,
|
|
32
|
+
xxl: 1920,
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* useBreakpoint Hook
|
|
36
|
+
*
|
|
37
|
+
* Manages responsive breakpoint state for screen size detection.
|
|
38
|
+
* Provides both "down" (below threshold) and "up" (above threshold) states.
|
|
39
|
+
*
|
|
40
|
+
* 화면 크기 감지를 위한 반응형 브레이크포인트 상태를 관리합니다.
|
|
41
|
+
* "down" (임계값 이하) 및 "up" (임계값 이상) 상태를 모두 제공합니다.
|
|
42
|
+
*
|
|
43
|
+
* @returns {UseBreakpointReturn} Breakpoint state object
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* function ResponsiveComponent() {
|
|
48
|
+
* const breakpoint = useBreakpoint();
|
|
49
|
+
*
|
|
50
|
+
* return (
|
|
51
|
+
* <div>
|
|
52
|
+
* {breakpoint.smUp ? <DesktopView /> : <MobileView />}
|
|
53
|
+
* {breakpoint.mdUp && <SidebarNav />}
|
|
54
|
+
* </div>
|
|
55
|
+
* );
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export const useBreakpoint = () => {
|
|
60
|
+
const [windowWidth, setWindowWidth] = useState(typeof window !== "undefined" ? window.innerWidth : 0);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (typeof window === "undefined")
|
|
63
|
+
return;
|
|
64
|
+
const handleResize = () => {
|
|
65
|
+
setWindowWidth(window.innerWidth);
|
|
66
|
+
};
|
|
67
|
+
window.addEventListener("resize", handleResize);
|
|
68
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
69
|
+
}, []);
|
|
70
|
+
// 각 브레이크포인트별 미디어쿼리 결과 (해당 브레이크포인트 이하인지)
|
|
71
|
+
const xs = windowWidth < breakpoints.sm;
|
|
72
|
+
const sm = windowWidth < breakpoints.md;
|
|
73
|
+
const md = windowWidth < breakpoints.lg;
|
|
74
|
+
const lg = windowWidth < breakpoints.xl;
|
|
75
|
+
const xl = windowWidth < breakpoints.xxl;
|
|
76
|
+
const xxl = windowWidth >= breakpoints.xxl;
|
|
77
|
+
const xsUp = windowWidth >= breakpoints.xs;
|
|
78
|
+
const smUp = windowWidth >= breakpoints.sm;
|
|
79
|
+
const mdUp = windowWidth >= breakpoints.md;
|
|
80
|
+
const lgUp = windowWidth >= breakpoints.lg;
|
|
81
|
+
const xlUp = windowWidth >= breakpoints.xl;
|
|
82
|
+
const xxlUp = windowWidth >= breakpoints.xxl;
|
|
83
|
+
// 객체 형태로 반환하여 breakpoint.sm 식으로 접근 가능
|
|
84
|
+
return {
|
|
85
|
+
xs,
|
|
86
|
+
sm,
|
|
87
|
+
md,
|
|
88
|
+
lg,
|
|
89
|
+
xl,
|
|
90
|
+
xxl,
|
|
91
|
+
xsUp,
|
|
92
|
+
smUp,
|
|
93
|
+
mdUp,
|
|
94
|
+
lgUp,
|
|
95
|
+
xlUp,
|
|
96
|
+
xxlUp,
|
|
97
|
+
breakpoint: {
|
|
98
|
+
xs,
|
|
99
|
+
sm,
|
|
100
|
+
md,
|
|
101
|
+
lg,
|
|
102
|
+
xl,
|
|
103
|
+
xxl,
|
|
104
|
+
xsUp,
|
|
105
|
+
smUp,
|
|
106
|
+
mdUp,
|
|
107
|
+
lgUp,
|
|
108
|
+
xlUp,
|
|
109
|
+
xxlUp,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=useBreakpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.js","source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WAAW,GAAG,WAAW,CAAC,GAAG,CAAC;IACzC,MAAM,GAAG,GAAG,WAAW,IAAI,WAAW,CAAC,GAAG,CAAC;IAE3C,MAAM,IAAI,GAAG,WAAW,IAAI,WAAW,CAAC,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,WAAW,IAAI,WAAW,CAAC,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,WAAW,IAAI,WAAW,CAAC,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,WAAW,IAAI,WAAW,CAAC,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,WAAW,IAAI,WAAW,CAAC,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,WAAW,IAAI,WAAW,CAAC,GAAG,CAAC;IAE7C,sCAAsC;IACtC,OAAO;QACH,EAAE;QACF,EAAE;QACF,EAAE;QACF,EAAE;QACF,EAAE;QACF,GAAG;QACH,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,UAAU,EAAE;YACR,EAAE;YACF,EAAE;YACF,EAAE;YACF,EAAE;YACF,EAAE;YACF,GAAG;YACH,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,KAAK;SACR;KACJ,CAAC;AACN,CAAC,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export { useGlobalFormaState } from "./hooks/useGlobalFormaState";
|
|
|
35
35
|
export { useRegisterGlobalFormaState } from "./hooks/useRegisterGlobalFormaState";
|
|
36
36
|
export { useUnregisterGlobalFormaState } from "./hooks/useUnregisterGlobalFormaState";
|
|
37
37
|
export { useModal } from "./hooks/useModal";
|
|
38
|
+
export { useBreakpoint } from "./hooks/useBreakpoint";
|
|
38
39
|
export { GlobalFormaContext, GlobalFormaProvider, } from "./contexts/GlobalFormaContext";
|
|
39
40
|
export { FieldStore } from "./core/FieldStore";
|
|
40
41
|
export { getNestedValue, setNestedValue } from "./utils/dotNotation";
|
|
@@ -42,6 +43,7 @@ export { isDevelopment, devWarn, devError, devLog } from "./utils/environment";
|
|
|
42
43
|
export type { UseFormProps, UseFormReturn, FormValidationResult, FormChangeEvent, } from "./types/form";
|
|
43
44
|
export type { UseFormaStateOptions, UseFormaStateReturn, } from "./hooks/useFormaState";
|
|
44
45
|
export type { UseGlobalFormProps, UseGlobalFormReturn, UseGlobalFormaStateProps, UseGlobalFormaStateReturn, UseRegisterGlobalFormProps, UseRegisterGlobalFormReturn, UseRegisterGlobalFormaStateProps, UseRegisterGlobalFormaStateReturn, UseUnregisterGlobalFormReturn, UseUnregisterGlobalFormaStateReturn, GlobalFormaProviderProps, GlobalFormaContextType, GlobalFormStoreMap, GlobalFormMetadata, GlobalFormEvent, GlobalFormEventListener, GlobalFormConfig, GlobalFormMiddleware, ExtendedGlobalFormaProviderProps, } from "./types/globalForm";
|
|
46
|
+
export type { BreakpointState, UseBreakpointReturn } from "./types/breakpoint";
|
|
45
47
|
/**
|
|
46
48
|
* Forma library version
|
|
47
49
|
*/
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE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0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,iCAAiC,EACjC,6BAA6B,EAC7B,mCAAmC,EACnC,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,gCAAgC,GACnC,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,aAAa,UAAU,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;CAejB,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -36,6 +36,7 @@ export { useGlobalFormaState } from "./hooks/useGlobalFormaState";
|
|
|
36
36
|
export { useRegisterGlobalFormaState } from "./hooks/useRegisterGlobalFormaState";
|
|
37
37
|
export { useUnregisterGlobalFormaState } from "./hooks/useUnregisterGlobalFormaState";
|
|
38
38
|
export { useModal } from "./hooks/useModal";
|
|
39
|
+
export { useBreakpoint } from "./hooks/useBreakpoint";
|
|
39
40
|
// ===== Context & Providers =====
|
|
40
41
|
export { GlobalFormaContext, GlobalFormaProvider, } from "./contexts/GlobalFormaContext";
|
|
41
42
|
// ===== Core Classes =====
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,yBAAyB;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAA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AM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,8CAA8C;IAC3D,MAAM,EAAE,+BAA+B;IACvC,KAAK,EAAE,kBAAkB;IACzB,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE;QACN,4DAA4D;QAC5D,kDAAkD;QAClD,wCAAwC;QACxC,8BAA8B;QAC9B,6BAA6B;QAC7B,qCAAqC;KACxC;CACK,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Breakpoint state object
|
|
26
|
+
* 브레이크포인트 상태 객체
|
|
27
|
+
*/
|
|
28
|
+
export interface BreakpointState {
|
|
29
|
+
/** Extra small: < 600px */
|
|
30
|
+
xs: boolean;
|
|
31
|
+
/** Small: < 900px */
|
|
32
|
+
sm: boolean;
|
|
33
|
+
/** Medium: < 1200px */
|
|
34
|
+
md: boolean;
|
|
35
|
+
/** Large: < 1536px */
|
|
36
|
+
lg: boolean;
|
|
37
|
+
/** Extra large: < 1920px */
|
|
38
|
+
xl: boolean;
|
|
39
|
+
/** Extra extra large: >= 1920px */
|
|
40
|
+
xxl: boolean;
|
|
41
|
+
/** >= 0px */
|
|
42
|
+
xsUp: boolean;
|
|
43
|
+
/** >= 600px */
|
|
44
|
+
smUp: boolean;
|
|
45
|
+
/** >= 900px */
|
|
46
|
+
mdUp: boolean;
|
|
47
|
+
/** >= 1200px */
|
|
48
|
+
lgUp: boolean;
|
|
49
|
+
/** >= 1536px */
|
|
50
|
+
xlUp: boolean;
|
|
51
|
+
/** >= 1920px */
|
|
52
|
+
xxlUp: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Return type of useBreakpoint hook
|
|
56
|
+
* useBreakpoint 훅의 반환 타입
|
|
57
|
+
*/
|
|
58
|
+
export interface UseBreakpointReturn extends BreakpointState {
|
|
59
|
+
/** Breakpoint state object (same as root level) */
|
|
60
|
+
breakpoint: BreakpointState;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=breakpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakpoint.d.ts","sourceRoot":"","sources":["../../../types/breakpoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,2BAA2B;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,qBAAqB;IACrB,EAAE,EAAE,OAAO,CAAC;IACZ,uBAAuB;IACvB,EAAE,EAAE,OAAO,CAAC;IACZ,sBAAsB;IACtB,EAAE,EAAE,OAAO,CAAC;IACZ,4BAA4B;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,mCAAmC;IACnC,GAAG,EAAE,OAAO,CAAC;IACb,aAAa;IACb,IAAI,EAAE,OAAO,CAAC;IACd,eAAe;IACf,IAAI,EAAE,OAAO,CAAC;IACd,eAAe;IACf,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB;IAChB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IACxD,mDAAmD;IACnD,UAAU,EAAE,eAAe,CAAC;CAC/B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=breakpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakpoint.js","sourceRoot":"","sources":["../../../types/breakpoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}
|
|
@@ -29,4 +29,5 @@ export type { FormChangeEvent, DatePickerChangeHandler, UseFormProps, UseFormRet
|
|
|
29
29
|
export type { GlobalFormaProviderProps, UseGlobalFormProps, UseRegisterGlobalFormProps, UseRegisterGlobalFormReturn, UseRegisterGlobalFormaStateProps, UseRegisterGlobalFormaStateReturn, UseUnregisterGlobalFormReturn, UseUnregisterGlobalFormaStateReturn, GlobalFormStoreMap, GlobalFormMetadata, GlobalFormLifecycleEvent, GlobalFormLifecycleHandler, GlobalFormConfig, GlobalFormStats, GlobalFormExtensions, GlobalFormIdentifier, FormType, FormUsageTracker, GlobalFormWarning, GlobalFormDebugInfo, GlobalFormSnapshot, GlobalFormDevTools, GlobalFormEvent, GlobalFormEventListener, GlobalFormMiddleware, ExtendedGlobalFormaProviderProps, } from "./globalForm";
|
|
30
30
|
export { GlobalFormError } from "./globalForm";
|
|
31
31
|
export type { UseModalProps, UseModalReturn } from "./modal";
|
|
32
|
+
export type { BreakpointState, UseBreakpointReturn } from "./breakpoint";
|
|
32
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EACR,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,oBAAoB,GACvB,MAAM,QAAQ,CAAC;AAGhB,YAAY,EACR,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,iCAAiC,EACjC,6BAA6B,EAC7B,mCAAmC,EACnC,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,gCAAgC,GACnC,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EACR,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,oBAAoB,GACvB,MAAM,QAAQ,CAAC;AAGhB,YAAY,EACR,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,iCAAiC,EACjC,6BAA6B,EAC7B,mCAAmC,EACnC,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,gCAAgC,GACnC,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG7D,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import type { UseBreakpointReturn } from "../types/breakpoint";
|
|
25
|
+
/**
|
|
26
|
+
* useBreakpoint Hook
|
|
27
|
+
*
|
|
28
|
+
* Manages responsive breakpoint state for screen size detection.
|
|
29
|
+
* Provides both "down" (below threshold) and "up" (above threshold) states.
|
|
30
|
+
*
|
|
31
|
+
* 화면 크기 감지를 위한 반응형 브레이크포인트 상태를 관리합니다.
|
|
32
|
+
* "down" (임계값 이하) 및 "up" (임계값 이상) 상태를 모두 제공합니다.
|
|
33
|
+
*
|
|
34
|
+
* @returns {UseBreakpointReturn} Breakpoint state object
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* function ResponsiveComponent() {
|
|
39
|
+
* const breakpoint = useBreakpoint();
|
|
40
|
+
*
|
|
41
|
+
* return (
|
|
42
|
+
* <div>
|
|
43
|
+
* {breakpoint.smUp ? <DesktopView /> : <MobileView />}
|
|
44
|
+
* {breakpoint.mdUp && <SidebarNav />}
|
|
45
|
+
* </div>
|
|
46
|
+
* );
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare const useBreakpoint: () => UseBreakpointReturn;
|
|
51
|
+
//# sourceMappingURL=useBreakpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../hooks/useBreakpoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAY/D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,aAAa,QAAO,mBA4DhC,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useBreakpoint = void 0;
|
|
27
|
+
const react_1 = require("react");
|
|
28
|
+
// 브레이크포인트 정의 (픽셀 단위)
|
|
29
|
+
const breakpoints = {
|
|
30
|
+
xs: 0,
|
|
31
|
+
sm: 600,
|
|
32
|
+
md: 900,
|
|
33
|
+
lg: 1200,
|
|
34
|
+
xl: 1536,
|
|
35
|
+
xxl: 1920,
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* useBreakpoint Hook
|
|
39
|
+
*
|
|
40
|
+
* Manages responsive breakpoint state for screen size detection.
|
|
41
|
+
* Provides both "down" (below threshold) and "up" (above threshold) states.
|
|
42
|
+
*
|
|
43
|
+
* 화면 크기 감지를 위한 반응형 브레이크포인트 상태를 관리합니다.
|
|
44
|
+
* "down" (임계값 이하) 및 "up" (임계값 이상) 상태를 모두 제공합니다.
|
|
45
|
+
*
|
|
46
|
+
* @returns {UseBreakpointReturn} Breakpoint state object
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* function ResponsiveComponent() {
|
|
51
|
+
* const breakpoint = useBreakpoint();
|
|
52
|
+
*
|
|
53
|
+
* return (
|
|
54
|
+
* <div>
|
|
55
|
+
* {breakpoint.smUp ? <DesktopView /> : <MobileView />}
|
|
56
|
+
* {breakpoint.mdUp && <SidebarNav />}
|
|
57
|
+
* </div>
|
|
58
|
+
* );
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
const useBreakpoint = () => {
|
|
63
|
+
const [windowWidth, setWindowWidth] = (0, react_1.useState)(typeof window !== "undefined" ? window.innerWidth : 0);
|
|
64
|
+
(0, react_1.useEffect)(() => {
|
|
65
|
+
if (typeof window === "undefined")
|
|
66
|
+
return;
|
|
67
|
+
const handleResize = () => {
|
|
68
|
+
setWindowWidth(window.innerWidth);
|
|
69
|
+
};
|
|
70
|
+
window.addEventListener("resize", handleResize);
|
|
71
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
72
|
+
}, []);
|
|
73
|
+
// 각 브레이크포인트별 미디어쿼리 결과 (해당 브레이크포인트 이하인지)
|
|
74
|
+
const xs = windowWidth < breakpoints.sm;
|
|
75
|
+
const sm = windowWidth < breakpoints.md;
|
|
76
|
+
const md = windowWidth < breakpoints.lg;
|
|
77
|
+
const lg = windowWidth < breakpoints.xl;
|
|
78
|
+
const xl = windowWidth < breakpoints.xxl;
|
|
79
|
+
const xxl = windowWidth >= breakpoints.xxl;
|
|
80
|
+
const xsUp = windowWidth >= breakpoints.xs;
|
|
81
|
+
const smUp = windowWidth >= breakpoints.sm;
|
|
82
|
+
const mdUp = windowWidth >= breakpoints.md;
|
|
83
|
+
const lgUp = windowWidth >= breakpoints.lg;
|
|
84
|
+
const xlUp = windowWidth >= breakpoints.xl;
|
|
85
|
+
const xxlUp = windowWidth >= breakpoints.xxl;
|
|
86
|
+
// 객체 형태로 반환하여 breakpoint.sm 식으로 접근 가능
|
|
87
|
+
return {
|
|
88
|
+
xs,
|
|
89
|
+
sm,
|
|
90
|
+
md,
|
|
91
|
+
lg,
|
|
92
|
+
xl,
|
|
93
|
+
xxl,
|
|
94
|
+
xsUp,
|
|
95
|
+
smUp,
|
|
96
|
+
mdUp,
|
|
97
|
+
lgUp,
|
|
98
|
+
xlUp,
|
|
99
|
+
xxlUp,
|
|
100
|
+
breakpoint: {
|
|
101
|
+
xs,
|
|
102
|
+
sm,
|
|
103
|
+
md,
|
|
104
|
+
lg,
|
|
105
|
+
xl,
|
|
106
|
+
xxl,
|
|
107
|
+
xsUp,
|
|
108
|
+
smUp,
|
|
109
|
+
mdUp,
|
|
110
|
+
lgUp,
|
|
111
|
+
xlUp,
|
|
112
|
+
xxlUp,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
exports.useBreakpoint = useBreakpoint;
|
|
117
|
+
//# sourceMappingURL=useBreakpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.js","sourceRoot":"","sources":["../../hooks/useBreakpoint.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAEH,iCAA4C;AAG5C,qBAAqB;AACrB,MAAM,WAAW,GAAG;IAChB,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,G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IAAI,WAAW,CAAC,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,WAAW,IAAI,WAAW,CAAC,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,WAAW,IAAI,WAAW,CAAC,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,WAAW,IAAI,WAAW,CAAC,GAAG,CAAC;IAE7C,sCAAsC;IACtC,OAAO;QACH,EAAE;QACF,EAAE;QACF,EAAE;QACF,EAAE;QACF,EAAE;QACF,GAAG;QACH,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,UAAU,EAAE;YACR,EAAE;YACF,EAAE;YACF,EAAE;YACF,EAAE;YACF,EAAE;YACF,GAAG;YACH,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,KAAK;SACR;KACJ,CAAC;AACN,CAAC,CAAC;AA5DW,QAAA,aAAa,iBA4DxB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export { useGlobalFormaState } from "./hooks/useGlobalFormaState";
|
|
|
35
35
|
export { useRegisterGlobalFormaState } from "./hooks/useRegisterGlobalFormaState";
|
|
36
36
|
export { useUnregisterGlobalFormaState } from "./hooks/useUnregisterGlobalFormaState";
|
|
37
37
|
export { useModal } from "./hooks/useModal";
|
|
38
|
+
export { useBreakpoint } from "./hooks/useBreakpoint";
|
|
38
39
|
export { GlobalFormaContext, GlobalFormaProvider, } from "./contexts/GlobalFormaContext";
|
|
39
40
|
export { FieldStore } from "./core/FieldStore";
|
|
40
41
|
export { getNestedValue, setNestedValue } from "./utils/dotNotation";
|
|
@@ -42,6 +43,7 @@ export { isDevelopment, devWarn, devError, devLog } from "./utils/environment";
|
|
|
42
43
|
export type { UseFormProps, UseFormReturn, FormValidationResult, FormChangeEvent, } from "./types/form";
|
|
43
44
|
export type { UseFormaStateOptions, UseFormaStateReturn, } from "./hooks/useFormaState";
|
|
44
45
|
export type { UseGlobalFormProps, UseGlobalFormReturn, UseGlobalFormaStateProps, UseGlobalFormaStateReturn, UseRegisterGlobalFormProps, UseRegisterGlobalFormReturn, UseRegisterGlobalFormaStateProps, UseRegisterGlobalFormaStateReturn, UseUnregisterGlobalFormReturn, UseUnregisterGlobalFormaStateReturn, GlobalFormaProviderProps, GlobalFormaContextType, GlobalFormStoreMap, GlobalFormMetadata, GlobalFormEvent, GlobalFormEventListener, GlobalFormConfig, GlobalFormMiddleware, ExtendedGlobalFormaProviderProps, } from "./types/globalForm";
|
|
46
|
+
export type { BreakpointState, UseBreakpointReturn } from "./types/breakpoint";
|
|
45
47
|
/**
|
|
46
48
|
* Forma library version
|
|
47
49
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAA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;AAG5B,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,aAAa,UAAU,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;CAejB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* SOFTWARE.
|
|
29
29
|
*/
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.FORMA_METADATA = exports.FORMA_VERSION = exports.devLog = exports.devError = exports.devWarn = exports.isDevelopment = exports.setNestedValue = exports.getNestedValue = exports.FieldStore = exports.GlobalFormaProvider = exports.GlobalFormaContext = exports.useModal = exports.useUnregisterGlobalFormaState = exports.useRegisterGlobalFormaState = exports.useGlobalFormaState = exports.useFieldSubscription = exports.useFormaState = exports.useUnregisterGlobalForm = exports.useRegisterGlobalForm = exports.useGlobalForm = exports.useForm = void 0;
|
|
31
|
+
exports.FORMA_METADATA = exports.FORMA_VERSION = exports.devLog = exports.devError = exports.devWarn = exports.isDevelopment = exports.setNestedValue = exports.getNestedValue = exports.FieldStore = exports.GlobalFormaProvider = exports.GlobalFormaContext = exports.useBreakpoint = exports.useModal = exports.useUnregisterGlobalFormaState = exports.useRegisterGlobalFormaState = exports.useGlobalFormaState = exports.useFieldSubscription = exports.useFormaState = exports.useUnregisterGlobalForm = exports.useRegisterGlobalForm = exports.useGlobalForm = exports.useForm = void 0;
|
|
32
32
|
// ===== Core Hooks =====
|
|
33
33
|
var useForm_1 = require("./hooks/useForm");
|
|
34
34
|
Object.defineProperty(exports, "useForm", { enumerable: true, get: function () { return useForm_1.useForm; } });
|
|
@@ -49,6 +49,8 @@ var useUnregisterGlobalFormaState_1 = require("./hooks/useUnregisterGlobalFormaS
|
|
|
49
49
|
Object.defineProperty(exports, "useUnregisterGlobalFormaState", { enumerable: true, get: function () { return useUnregisterGlobalFormaState_1.useUnregisterGlobalFormaState; } });
|
|
50
50
|
var useModal_1 = require("./hooks/useModal");
|
|
51
51
|
Object.defineProperty(exports, "useModal", { enumerable: true, get: function () { return useModal_1.useModal; } });
|
|
52
|
+
var useBreakpoint_1 = require("./hooks/useBreakpoint");
|
|
53
|
+
Object.defineProperty(exports, "useBreakpoint", { enumerable: true, get: function () { return useBreakpoint_1.useBreakpoint; } });
|
|
52
54
|
// ===== Context & Providers =====
|
|
53
55
|
var GlobalFormaContext_1 = require("./contexts/GlobalFormaContext");
|
|
54
56
|
Object.defineProperty(exports, "GlobalFormaContext", { enumerable: true, get: function () { return GlobalFormaContext_1.GlobalFormaContext; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;AAEH,yBAAyB;AACzB,2CAA0C;AAAjC,kGAAA,OAAO,OAAA;AAChB,uDAAsD;AAA7C,8GAAA,aAAa,OAAA;AACtB,uEAAsE;AAA7D,8HAAA,qBAAqB,OAAA;AAC9B,2EAA0E;AAAjE,kIAAA,uBAAuB,OAAA;AAChC,uDAA4E;AAAnE,8GAAA,aAAa,OAAA;AAAE,qHAAA,oBAAoB,OAAA;AAC5C,mEAAkE;AAAzD,0HAAA,mBAAmB,OAAA;AAC5B,mFAAkF;AAAzE,0IAAA,2BAA2B,OAAA;AACpC,uFAAsF;AAA7E,8IAAA,6BAA6B,OAAA;AACtC,6CAA4C;AAAnC,oGAAA,QAAQ,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;AAEH,yBAAyB;AACzB,2CAA0C;AAAjC,kGAAA,OAAO,OAAA;AAChB,uDAAsD;AAA7C,8GAAA,aAAa,OAAA;AACtB,uEAAsE;AAA7D,8HAAA,qBAAqB,OAAA;AAC9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
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Breakpoint state object
|
|
26
|
+
* 브레이크포인트 상태 객체
|
|
27
|
+
*/
|
|
28
|
+
export interface BreakpointState {
|
|
29
|
+
/** Extra small: < 600px */
|
|
30
|
+
xs: boolean;
|
|
31
|
+
/** Small: < 900px */
|
|
32
|
+
sm: boolean;
|
|
33
|
+
/** Medium: < 1200px */
|
|
34
|
+
md: boolean;
|
|
35
|
+
/** Large: < 1536px */
|
|
36
|
+
lg: boolean;
|
|
37
|
+
/** Extra large: < 1920px */
|
|
38
|
+
xl: boolean;
|
|
39
|
+
/** Extra extra large: >= 1920px */
|
|
40
|
+
xxl: boolean;
|
|
41
|
+
/** >= 0px */
|
|
42
|
+
xsUp: boolean;
|
|
43
|
+
/** >= 600px */
|
|
44
|
+
smUp: boolean;
|
|
45
|
+
/** >= 900px */
|
|
46
|
+
mdUp: boolean;
|
|
47
|
+
/** >= 1200px */
|
|
48
|
+
lgUp: boolean;
|
|
49
|
+
/** >= 1536px */
|
|
50
|
+
xlUp: boolean;
|
|
51
|
+
/** >= 1920px */
|
|
52
|
+
xxlUp: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Return type of useBreakpoint hook
|
|
56
|
+
* useBreakpoint 훅의 반환 타입
|
|
57
|
+
*/
|
|
58
|
+
export interface UseBreakpointReturn extends BreakpointState {
|
|
59
|
+
/** Breakpoint state object (same as root level) */
|
|
60
|
+
breakpoint: BreakpointState;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=breakpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakpoint.d.ts","sourceRoot":"","sources":["../../types/breakpoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,2BAA2B;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,qBAAqB;IACrB,EAAE,EAAE,OAAO,CAAC;IACZ,uBAAuB;IACvB,EAAE,EAAE,OAAO,CAAC;IACZ,sBAAsB;IACtB,EAAE,EAAE,OAAO,CAAC;IACZ,4BAA4B;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,mCAAmC;IACnC,GAAG,EAAE,OAAO,CAAC;IACb,aAAa;IACb,IAAI,EAAE,OAAO,CAAC;IACd,eAAe;IACf,IAAI,EAAE,OAAO,CAAC;IACd,eAAe;IACf,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB;IAChB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IACxD,mDAAmD;IACnD,UAAU,EAAE,eAAe,CAAC;CAC/B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
//# sourceMappingURL=breakpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakpoint.js","sourceRoot":"","sources":["../../types/breakpoint.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -29,4 +29,5 @@ export type { FormChangeEvent, DatePickerChangeHandler, UseFormProps, UseFormRet
|
|
|
29
29
|
export type { GlobalFormaProviderProps, UseGlobalFormProps, UseRegisterGlobalFormProps, UseRegisterGlobalFormReturn, UseRegisterGlobalFormaStateProps, UseRegisterGlobalFormaStateReturn, UseUnregisterGlobalFormReturn, UseUnregisterGlobalFormaStateReturn, GlobalFormStoreMap, GlobalFormMetadata, GlobalFormLifecycleEvent, GlobalFormLifecycleHandler, GlobalFormConfig, GlobalFormStats, GlobalFormExtensions, GlobalFormIdentifier, FormType, FormUsageTracker, GlobalFormWarning, GlobalFormDebugInfo, GlobalFormSnapshot, GlobalFormDevTools, GlobalFormEvent, GlobalFormEventListener, GlobalFormMiddleware, ExtendedGlobalFormaProviderProps, } from "./globalForm";
|
|
30
30
|
export { GlobalFormError } from "./globalForm";
|
|
31
31
|
export type { UseModalProps, UseModalReturn } from "./modal";
|
|
32
|
+
export type { BreakpointState, UseBreakpointReturn } from "./breakpoint";
|
|
32
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EACR,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,oBAAoB,GACvB,MAAM,QAAQ,CAAC;AAGhB,YAAY,EACR,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,iCAAiC,EACjC,6BAA6B,EAC7B,mCAAmC,EACnC,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,gCAAgC,GACnC,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EACR,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,oBAAoB,GACvB,MAAM,QAAQ,CAAC;AAGhB,YAAY,EACR,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,iCAAiC,EACjC,6BAA6B,EAC7B,mCAAmC,EACnC,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,gCAAgC,GACnC,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG7D,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ehfuse/forma",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Advanced React state management library with individual field subscriptions - supports both forms and general state management with useFormaState",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|