@0610studio/zs-ui 0.12.8 → 0.13.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/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/results.bin +1 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kr/co/studio0610/zsui/BuildConfig.dex +0 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kr/co/studio0610/zsui/DimensionsHelper.dex +0 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kr/co/studio0610/zsui/FoldingStateResult.dex +0 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kr/co/studio0610/zsui/ZsUiModule$definition$1$2$1.dex +0 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kr/co/studio0610/zsui/ZsUiModule$definition$lambda$2$$inlined$AsyncFunctionWithoutArgs$1.dex +0 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kr/co/studio0610/zsui/ZsUiModule$definition$lambda$2$$inlined$View$1.dex +0 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kr/co/studio0610/zsui/ZsUiModule$definition$lambda$2$lambda$1$$inlined$Prop$1.dex +0 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kr/co/studio0610/zsui/ZsUiModule$getCurrentFoldingState$layoutInfo$1.dex +0 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kr/co/studio0610/zsui/ZsUiModule.dex +0 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kr/co/studio0610/zsui/ZsUiView.dex +0 -0
- package/android/build/.transforms/b53d840c85b6b6e60163f15142cc0fcc/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/e1825519fa1f1f05ec16f1348dbe962e/results.bin +1 -0
- package/android/build/.transforms/e1825519fa1f1f05ec16f1348dbe962e/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/0610studio-zs-ui_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/0610studio-zs-ui_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kr/co/studio0610/zsui/DimensionsHelper.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kr/co/studio0610/zsui/FoldingStateResult.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kr/co/studio0610/zsui/ZsUiModule$definition$1$2$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kr/co/studio0610/zsui/ZsUiModule$definition$lambda$2$$inlined$AsyncFunctionWithoutArgs$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kr/co/studio0610/zsui/ZsUiModule$definition$lambda$2$$inlined$View$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kr/co/studio0610/zsui/ZsUiModule$definition$lambda$2$lambda$1$$inlined$Prop$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kr/co/studio0610/zsui/ZsUiModule$getCurrentFoldingState$layoutInfo$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kr/co/studio0610/zsui/ZsUiModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kr/co/studio0610/zsui/ZsUiView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/0610studio-zs-ui_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/studio0610/zsui/DimensionsHelper.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/studio0610/zsui/FoldingStateResult.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/studio0610/zsui/ZsUiModule$definition$1$2$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/studio0610/zsui/ZsUiModule$definition$lambda$2$$inlined$AsyncFunctionWithoutArgs$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/studio0610/zsui/ZsUiModule$definition$lambda$2$$inlined$View$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/studio0610/zsui/ZsUiModule$definition$lambda$2$lambda$1$$inlined$Prop$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/studio0610/zsui/ZsUiModule$getCurrentFoldingState$layoutInfo$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/studio0610/zsui/ZsUiModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/studio0610/zsui/ZsUiView.class +0 -0
- package/build/context/OverlayContext.d.ts +0 -1
- package/build/context/OverlayContext.d.ts.map +1 -1
- package/build/model/useOverlay.d.ts +0 -1
- package/build/model/useOverlay.d.ts.map +1 -1
- package/build/overlay/PopOver/PopOverMenu.d.ts +0 -1
- package/build/overlay/PopOver/PopOverMenu.d.ts.map +1 -1
- package/build/ui/ZSAboveKeyboard/index.d.ts +0 -1
- package/build/ui/ZSAboveKeyboard/index.d.ts.map +1 -1
- package/build/ui/ZSBottomCta/index.d.ts +0 -1
- package/build/ui/ZSBottomCta/index.d.ts.map +1 -1
- package/build/ui/ZSContainer/index.js +1 -1
- package/build/ui/ZSContainer/index.js.map +1 -1
- package/build/ui/ZSText/index.d.ts +3 -3
- package/build/ui/ZSText/index.d.ts.map +1 -1
- package/build/ui/ZSText/index.js +1 -0
- package/build/ui/ZSText/index.js.map +1 -1
- package/build/ui/ZSTextField/ui/ButtonClose.d.ts +0 -1
- package/build/ui/ZSTextField/ui/ButtonClose.d.ts.map +1 -1
- package/build/ui/ZSTextField/ui/ErrorComponent.d.ts +0 -1
- package/build/ui/ZSTextField/ui/ErrorComponent.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
o/bundleLibRuntimeToDirDebug
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
o/classes
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Thu Nov 20 17:24:12 KST 2025
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i
CHANGED
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream
CHANGED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream
CHANGED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len
CHANGED
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin
CHANGED
|
Binary file
|
|
Binary file
|
package/android/build/tmp/kotlin-classes/debug/META-INF/0610studio-zs-ui_debug.kotlin_module
CHANGED
|
Binary file
|
|
Binary file
|
package/android/build/tmp/kotlin-classes/debug/kr/co/studio0610/zsui/FoldingStateResult.class
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { OverlayProviderProps } from '../model/types';
|
|
3
2
|
export declare function OverlayProvider({ customSnackbar, maxSnackbarCount, loaderComponent, children }: OverlayProviderProps): import("react").JSX.Element;
|
|
4
3
|
//# sourceMappingURL=OverlayContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayContext.d.ts","sourceRoot":"","sources":["../../src/context/OverlayContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OverlayContext.d.ts","sourceRoot":"","sources":["../../src/context/OverlayContext.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA+D,oBAAoB,EAAwF,MAAM,gBAAgB,CAAC;AAUzM,wBAAgB,eAAe,CAAC,EAC9B,cAAc,EACd,gBAAoB,EACpB,eAAe,EACf,QAAQ,EACT,EAAE,oBAAoB,+BA6StB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { AlertContextProps, SnackbarContextProps, BottomSheetContextProps, PopOverContextProps, ModalityContextProps, LoaderContextProps, OverlayContextProps } from './types';
|
|
3
2
|
export declare const OverlayContext: import("react").Context<OverlayContextProps | null>;
|
|
4
3
|
export declare const AlertContext: import("react").Context<AlertContextProps | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOverlay.d.ts","sourceRoot":"","sources":["../../src/model/useOverlay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useOverlay.d.ts","sourceRoot":"","sources":["../../src/model/useOverlay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE/K,eAAO,MAAM,cAAc,qDAAkD,CAAC;AAC9E,eAAO,MAAM,YAAY,mDAAgD,CAAC;AAC1E,eAAO,MAAM,eAAe,sDAAmD,CAAC;AAChF,eAAO,MAAM,kBAAkB,yDAAsD,CAAC;AACtF,eAAO,MAAM,cAAc,qDAAkD,CAAC;AAC9E,eAAO,MAAM,eAAe,sDAAmD,CAAC;AAChF,eAAO,MAAM,aAAa,oDAAiD,CAAC;AAE5E,eAAO,MAAM,UAAU,2BAMtB,CAAC;AAEF,eAAO,MAAM,QAAQ,yBAMpB,CAAC;AAEF,eAAO,MAAM,WAAW,4BAMvB,CAAC;AAEF,eAAO,MAAM,cAAc,+BAM1B,CAAC;AAEF,eAAO,MAAM,UAAU,2BAMtB,CAAC;AAEF,eAAO,MAAM,WAAW,4BAMvB,CAAC;AAEF,eAAO,MAAM,SAAS,0BAMrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopOverMenu.d.ts","sourceRoot":"","sources":["../../../src/overlay/PopOver/PopOverMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PopOverMenu.d.ts","sourceRoot":"","sources":["../../../src/overlay/PopOver/PopOverMenu.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOrD,iBAAS,WAAW,CAAC,EACnB,EAAE,EACF,EAAE,EACF,SAAS,EACV,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAuFvC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSAboveKeyboard/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSAboveKeyboard/index.tsx"],"names":[],"mappings":"AAaA,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,iBAAS,eAAe,CAAC,EACvB,kBAAsB,EACtB,kBAAsB,EACtB,QAAQ,EACR,kBAAkB,EAClB,uBAA+B,EAC/B,eAAe,GAChB,EAAE,KAAK,+BAwBP;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSBottomCta/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSBottomCta/index.tsx"],"names":[],"mappings":"AAMA,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,iBAAS,WAAW,CAAC,EACnB,MAAM,EACN,MAAU,GACX,EAAE,KAAK,+BAQP;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -14,7 +14,7 @@ const SCROLL_VIEW_OPTIONS = {
|
|
|
14
14
|
keyboardShouldPersistTaps: "handled",
|
|
15
15
|
automaticallyAdjustKeyboardInsets: false
|
|
16
16
|
};
|
|
17
|
-
const ZSContainer = forwardRef(function ZSContainer({ backgroundColor, statusBarColor, barStyle, edges = ['
|
|
17
|
+
const ZSContainer = forwardRef(function ZSContainer({ backgroundColor, statusBarColor, barStyle, edges = ['bottom'], scrollViewDisabled = false, topComponent, bottomComponent, showsVerticalScrollIndicator = true, keyboardScrollExtraOffset = 30, translucent, scrollEventThrottle = 16, scrollToFocusedInput = true,
|
|
18
18
|
// foldable device
|
|
19
19
|
foldableSingleScreen, dividerLineComponent, rightComponent,
|
|
20
20
|
// ---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7H,OAAO,EAAa,SAAS,EAAE,UAAU,EAAE,UAAU,EAA2C,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvI,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;AACrD,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACpC,MAAM,mBAAmB,GAAG;IAC1B,OAAO,EAAE,KAAK;IACd,cAAc,EAAE,OAAgB;IAChC,yBAAyB,EAAE,SAAkB;IAC7C,iCAAiC,EAAE,KAAK;CACzC,CAAA;AAuBD,MAAM,WAAW,GAAG,UAAU,CAAmC,SAAS,WAAW,CACnF,EACE,eAAe,EACf,cAAc,EACd,QAAQ,EACR,KAAK,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,EACzB,kBAAkB,GAAG,KAAK,EAC1B,YAAY,EACZ,eAAe,EACf,4BAA4B,GAAG,IAAI,EACnC,yBAAyB,GAAG,EAAE,EAC9B,WAAW,EACX,mBAAmB,G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ACH,CACH;IAAA,EAAE,YAAY,CAAC,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;IAClB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE;IAChC,oBAAoB,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE;CAC3E,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC","sourcesContent":["import React, { ReactNode, useEffect, useImperativeHandle, forwardRef, useRef, useState, useCallback, useMemo } from 'react';\r\nimport { ViewProps, StatusBar, StyleSheet, ScrollView, NativeSyntheticEvent, NativeScrollEvent, View, Dimensions } from 'react-native';\r\nimport { SafeAreaView } from 'react-native-safe-area-context';\r\nimport { useTheme } from '../../context/ThemeContext';\r\nimport useKeyboard from '../../model/useKeyboard';\r\nimport useFoldingState from '../../model/useFoldingState';\r\nimport { FoldingState } from '../../model/types';\r\nimport { MAX_FOLDABLE_SINGLE_WIDTH } from '../../model/utils';\r\n\r\nconst windowHeight = Dimensions.get('window').height;\r\nconst KEYBOARD_ANIMATION_DELAY = 50;\r\nconst SCROLL_VIEW_OPTIONS = {\r\n bounces: false,\r\n overScrollMode: \"never\" as const,\r\n keyboardShouldPersistTaps: \"handled\" as const,\r\n automaticallyAdjustKeyboardInsets: false\r\n}\r\n\r\nexport type ZSContainerProps = ViewProps & {\r\n backgroundColor?: string;\r\n statusBarColor?: string;\r\n barStyle?: 'light-content' | 'dark-content';\r\n edges?: Array<'top' | 'right' | 'bottom' | 'left'>;\r\n scrollViewDisabled?: boolean;\r\n topComponent?: ReactNode;\r\n bottomComponent?: ReactNode;\r\n rightComponent?: ReactNode;\r\n showsVerticalScrollIndicator?: boolean;\r\n keyboardScrollExtraOffset?: number;\r\n translucent?: boolean;\r\n onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;\r\n scrollEventThrottle?: number;\r\n scrollToFocusedInput?: boolean;\r\n foldableSingleScreen?: boolean;\r\n dividerLineComponent?: ReactNode;\r\n};\r\n\r\nexport type ZSContainerRef = ScrollView;\r\n\r\nconst ZSContainer = forwardRef<ZSContainerRef, ZSContainerProps>(function ZSContainer(\r\n {\r\n backgroundColor,\r\n statusBarColor,\r\n barStyle,\r\n edges = ['top', 'bottom'],\r\n scrollViewDisabled = false,\r\n topComponent,\r\n bottomComponent,\r\n showsVerticalScrollIndicator = true,\r\n keyboardScrollExtraOffset = 30,\r\n translucent,\r\n scrollEventThrottle = 16,\r\n scrollToFocusedInput = true,\r\n // foldable device\r\n foldableSingleScreen,\r\n dividerLineComponent,\r\n rightComponent,\r\n // ---\r\n ...props\r\n },\r\n forwardedRef\r\n) {\r\n const { palette } = useTheme();\r\n const { foldingState, width } = useFoldingState();\r\n const positionRef = useRef<number | null>(0);\r\n const position2Ref = useRef<number | null>(0);\r\n const scrollViewRef = useRef<ScrollView>(null);\r\n const scrollView2Ref = useRef<ScrollView>(null);\r\n const touchPositionRef = useRef<number | null>(0);\r\n const lastTouchY = useRef<number | null>(0);\r\n const [keyboardHeight, setKeyboardHeight] = useState<number | null>(0);\r\n const scrollTimeoutRef = useRef<number | null>(null);\r\n\r\n useImperativeHandle(forwardedRef, () => scrollViewRef.current as ScrollView, [scrollViewDisabled]);\r\n\r\n const handleKeyboardShow = (e: any) => {\r\n setKeyboardHeight(e.endCoordinates.height);\r\n\r\n if ((scrollViewRef.current || scrollView2Ref.current) && scrollToFocusedInput) {\r\n const keyboardHeight = e.endCoordinates.height;\r\n const safeAreaBottom = 0;\r\n const availableScreenHeight = windowHeight - keyboardHeight - safeAreaBottom;\r\n\r\n // 현재 스크롤 위치 참조\r\n const currentScrollPosition = touchPositionRef.current === 1\r\n ? positionRef.current || 0\r\n : position2Ref.current || 0;\r\n\r\n const touchPosition = lastTouchY.current || 0;\r\n\r\n // 현재 터치 위치와 스크롤 위치를 기반으로 새로운 스크롤 위치 계산\r\n const scrollOffset = touchPosition - availableScreenHeight + keyboardScrollExtraOffset;\r\n\r\n if (scrollTimeoutRef.current) clearTimeout(scrollTimeoutRef.current);\r\n scrollTimeoutRef.current = setTimeout(() => {\r\n if (touchPositionRef.current === 1) {\r\n scrollViewRef.current?.scrollTo({\r\n y: currentScrollPosition + scrollOffset,\r\n animated: true,\r\n });\r\n } else {\r\n scrollView2Ref.current?.scrollTo({\r\n y: currentScrollPosition + scrollOffset,\r\n animated: true,\r\n });\r\n }\r\n scrollTimeoutRef.current = null;\r\n }, KEYBOARD_ANIMATION_DELAY);\r\n }\r\n };\r\n\r\n const handleKeyboardHide = () => {\r\n setKeyboardHeight(0);\r\n };\r\n\r\n useKeyboard({\r\n handleKeyboardShow,\r\n handleKeyboardHide,\r\n });\r\n\r\n // 클린업\r\n useEffect(() => {\r\n return () => {\r\n positionRef.current = null;\r\n lastTouchY.current = null;\r\n if (scrollTimeoutRef.current) {\r\n clearTimeout(scrollTimeoutRef.current);\r\n scrollTimeoutRef.current = null;\r\n }\r\n };\r\n }, []);\r\n \r\n // 에러 로그 출력\r\n useEffect(() => {\r\n if (foldableSingleScreen && (rightComponent || dividerLineComponent)) {\r\n console.error('[ZSContainer] foldableSingleScreen일 때는 rightComponent/dividerLineComponent를 사용할 수 없습니다.');\r\n }\r\n }, [foldableSingleScreen, rightComponent, dividerLineComponent]);\r\n\r\n const handleScroll = useCallback((event: NativeSyntheticEvent<NativeScrollEvent>, position: 1 | 2) => {\r\n if (props.onScroll) props.onScroll(event);\r\n\r\n if (position === 1) {\r\n positionRef.current = event.nativeEvent.contentOffset.y;\r\n } else {\r\n position2Ref.current = event.nativeEvent.contentOffset.y;\r\n }\r\n }, [props.onScroll]);\r\n\r\n const handleTouch = useCallback((evt: any, position: 1 | 2) => {\r\n lastTouchY.current = evt.nativeEvent.pageY;\r\n touchPositionRef.current = position;\r\n }, []);\r\n\r\n const safeAreaStyle = useMemo(() => [\r\n { backgroundColor: backgroundColor || palette.background.base },\r\n styles.w100\r\n ], [backgroundColor, palette.background.base]);\r\n\r\n const scrollContentStyle = useMemo(() => [\r\n styles.scrollContainerStyle,\r\n {\r\n paddingBottom: keyboardHeight ? keyboardHeight : 0\r\n }\r\n ], [keyboardHeight]);\r\n\r\n const containerStyle = useMemo(() => [\r\n styles.w100,\r\n props.style\r\n ], [props.style]);\r\n\r\n const shouldShowStatusBar = useMemo(() =>\r\n Boolean(barStyle || statusBarColor || translucent),\r\n [barStyle, statusBarColor, translucent]\r\n );\r\n\r\n return (\r\n <SafeAreaView\r\n style={safeAreaStyle}\r\n edges={edges}\r\n >\r\n <View style={[styles.w100, { backgroundColor: \"#00000009\" }]}>\r\n <View style={[styles.w100, { maxWidth: foldableSingleScreen ? Math.min(width, MAX_FOLDABLE_SINGLE_WIDTH) : '100%', alignSelf: 'center', backgroundColor: palette.background.base }]}>\r\n {topComponent}\r\n <View style={[styles.w100, { flexDirection: 'row' }]}>\r\n <View style={styles.flex1}>\r\n {scrollViewDisabled ? (\r\n <View style={[styles.flex1, containerStyle]}>\r\n {props.children}\r\n </View>\r\n ) : (\r\n <ScrollView\r\n ref={scrollViewRef}\r\n style={styles.w100}\r\n showsVerticalScrollIndicator={showsVerticalScrollIndicator}\r\n contentContainerStyle={scrollContentStyle}\r\n scrollEventThrottle={scrollEventThrottle}\r\n onScroll={(event) => { handleScroll(event, 1); }}\r\n onTouchStart={(evt) => handleTouch(evt, 1)}\r\n // ---\r\n {...SCROLL_VIEW_OPTIONS}\r\n >\r\n <View style={[styles.flex1, containerStyle]}>\r\n {props.children}\r\n </View>\r\n </ScrollView>\r\n )}\r\n </View>\r\n {foldingState === FoldingState.UNFOLDED && !foldableSingleScreen && rightComponent && dividerLineComponent && dividerLineComponent}\r\n {\r\n foldingState === FoldingState.UNFOLDED && !foldableSingleScreen && rightComponent && (\r\n <View style={styles.flex1}>\r\n {scrollViewDisabled ? (\r\n <View style={[styles.flex1, containerStyle]}>\r\n {rightComponent}\r\n </View>\r\n ) : (\r\n <ScrollView\r\n ref={scrollView2Ref}\r\n style={styles.w100}\r\n showsVerticalScrollIndicator={showsVerticalScrollIndicator}\r\n contentContainerStyle={scrollContentStyle}\r\n scrollEventThrottle={scrollEventThrottle}\r\n onScroll={(event) => { handleScroll(event, 2); }}\r\n onTouchStart={(evt) => handleTouch(evt, 2)}\r\n // ---\r\n {...SCROLL_VIEW_OPTIONS}\r\n >\r\n <View style={[styles.flex1, containerStyle]}>\r\n {rightComponent}\r\n </View>\r\n </ScrollView>\r\n )}\r\n </View>\r\n )\r\n }\r\n </View >\r\n {bottomComponent}\r\n </View>\r\n </View>\r\n\r\n {shouldShowStatusBar && (\r\n <StatusBar\r\n barStyle={barStyle}\r\n backgroundColor={statusBarColor || palette.background.base}\r\n translucent={translucent}\r\n />\r\n )}\r\n </SafeAreaView>\r\n );\r\n});\r\n\r\nexport const styles = StyleSheet.create({\r\n flex1: { flex: 1 },\r\n w100: { flex: 1, width: '100%' },\r\n scrollContainerStyle: { alignItems: 'center', width: '100%', flexGrow: 1 },\r\n});\r\n\r\nexport default ZSContainer;\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7H,OAAO,EAAa,SAAS,EAAE,UAAU,EAAE,UAAU,EAA2C,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvI,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,eAAe,MAAM,6BAA6B,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,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAC3C,MAAM;YACN,IAAI,mBAAmB,CAAC,CAExB;sBAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAC1C;wBAAA,CAAC,cAAc,CACjB;sBAAA,EAAE,IAAI,CACR;oBAAA,EAAE,UAAU,CAAC,CACd,CACH;gBAAA,EAAE,IAAI,CAAC,CACR,CAEL;UAAA,EAAE,IAAI,CACN;UAAA,CAAC,eAAe,CAClB;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,IAAI,CAEN;;MAAA,CAAC,mBAAmB,IAAI,CACtB,CAAC,SAAS,CACR,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,eAAe,CAAC,CAAC,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAC3D,WAAW,CAAC,CAAC,WAAW,CAAC,EACzB,CACH,CACH;IAAA,EAAE,YAAY,CAAC,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;IAClB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE;IAChC,oBAAoB,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE;CAC3E,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC","sourcesContent":["import React, { ReactNode, useEffect, useImperativeHandle, forwardRef, useRef, useState, useCallback, useMemo } from 'react';\r\nimport { ViewProps, StatusBar, StyleSheet, ScrollView, NativeSyntheticEvent, NativeScrollEvent, View, Dimensions } from 'react-native';\r\nimport { SafeAreaView } from 'react-native-safe-area-context';\r\nimport { useTheme } from '../../context/ThemeContext';\r\nimport useKeyboard from '../../model/useKeyboard';\r\nimport useFoldingState from '../../model/useFoldingState';\r\nimport { FoldingState } from '../../model/types';\r\nimport { MAX_FOLDABLE_SINGLE_WIDTH } from '../../model/utils';\r\n\r\nconst windowHeight = Dimensions.get('window').height;\r\nconst KEYBOARD_ANIMATION_DELAY = 50;\r\nconst SCROLL_VIEW_OPTIONS = {\r\n bounces: false,\r\n overScrollMode: \"never\" as const,\r\n keyboardShouldPersistTaps: \"handled\" as const,\r\n automaticallyAdjustKeyboardInsets: false\r\n}\r\n\r\nexport type ZSContainerProps = ViewProps & {\r\n backgroundColor?: string;\r\n statusBarColor?: string;\r\n barStyle?: 'light-content' | 'dark-content';\r\n edges?: Array<'top' | 'right' | 'bottom' | 'left'>;\r\n scrollViewDisabled?: boolean;\r\n topComponent?: ReactNode;\r\n bottomComponent?: ReactNode;\r\n rightComponent?: ReactNode;\r\n showsVerticalScrollIndicator?: boolean;\r\n keyboardScrollExtraOffset?: number;\r\n translucent?: boolean;\r\n onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;\r\n scrollEventThrottle?: number;\r\n scrollToFocusedInput?: boolean;\r\n foldableSingleScreen?: boolean;\r\n dividerLineComponent?: ReactNode;\r\n};\r\n\r\nexport type ZSContainerRef = ScrollView;\r\n\r\nconst ZSContainer = forwardRef<ZSContainerRef, ZSContainerProps>(function ZSContainer(\r\n {\r\n backgroundColor,\r\n statusBarColor,\r\n barStyle,\r\n edges = ['bottom'],\r\n scrollViewDisabled = false,\r\n topComponent,\r\n bottomComponent,\r\n showsVerticalScrollIndicator = true,\r\n keyboardScrollExtraOffset = 30,\r\n translucent,\r\n scrollEventThrottle = 16,\r\n scrollToFocusedInput = true,\r\n // foldable device\r\n foldableSingleScreen,\r\n dividerLineComponent,\r\n rightComponent,\r\n // ---\r\n ...props\r\n },\r\n forwardedRef\r\n) {\r\n const { palette } = useTheme();\r\n const { foldingState, width } = useFoldingState();\r\n const positionRef = useRef<number | null>(0);\r\n const position2Ref = useRef<number | null>(0);\r\n const scrollViewRef = useRef<ScrollView>(null);\r\n const scrollView2Ref = useRef<ScrollView>(null);\r\n const touchPositionRef = useRef<number | null>(0);\r\n const lastTouchY = useRef<number | null>(0);\r\n const [keyboardHeight, setKeyboardHeight] = useState<number | null>(0);\r\n const scrollTimeoutRef = useRef<number | null>(null);\r\n\r\n useImperativeHandle(forwardedRef, () => scrollViewRef.current as ScrollView, [scrollViewDisabled]);\r\n\r\n const handleKeyboardShow = (e: any) => {\r\n setKeyboardHeight(e.endCoordinates.height);\r\n\r\n if ((scrollViewRef.current || scrollView2Ref.current) && scrollToFocusedInput) {\r\n const keyboardHeight = e.endCoordinates.height;\r\n const safeAreaBottom = 0;\r\n const availableScreenHeight = windowHeight - keyboardHeight - safeAreaBottom;\r\n\r\n // 현재 스크롤 위치 참조\r\n const currentScrollPosition = touchPositionRef.current === 1\r\n ? positionRef.current || 0\r\n : position2Ref.current || 0;\r\n\r\n const touchPosition = lastTouchY.current || 0;\r\n\r\n // 현재 터치 위치와 스크롤 위치를 기반으로 새로운 스크롤 위치 계산\r\n const scrollOffset = touchPosition - availableScreenHeight + keyboardScrollExtraOffset;\r\n\r\n if (scrollTimeoutRef.current) clearTimeout(scrollTimeoutRef.current);\r\n scrollTimeoutRef.current = setTimeout(() => {\r\n if (touchPositionRef.current === 1) {\r\n scrollViewRef.current?.scrollTo({\r\n y: currentScrollPosition + scrollOffset,\r\n animated: true,\r\n });\r\n } else {\r\n scrollView2Ref.current?.scrollTo({\r\n y: currentScrollPosition + scrollOffset,\r\n animated: true,\r\n });\r\n }\r\n scrollTimeoutRef.current = null;\r\n }, KEYBOARD_ANIMATION_DELAY);\r\n }\r\n };\r\n\r\n const handleKeyboardHide = () => {\r\n setKeyboardHeight(0);\r\n };\r\n\r\n useKeyboard({\r\n handleKeyboardShow,\r\n handleKeyboardHide,\r\n });\r\n\r\n // 클린업\r\n useEffect(() => {\r\n return () => {\r\n positionRef.current = null;\r\n lastTouchY.current = null;\r\n if (scrollTimeoutRef.current) {\r\n clearTimeout(scrollTimeoutRef.current);\r\n scrollTimeoutRef.current = null;\r\n }\r\n };\r\n }, []);\r\n \r\n // 에러 로그 출력\r\n useEffect(() => {\r\n if (foldableSingleScreen && (rightComponent || dividerLineComponent)) {\r\n console.error('[ZSContainer] foldableSingleScreen일 때는 rightComponent/dividerLineComponent를 사용할 수 없습니다.');\r\n }\r\n }, [foldableSingleScreen, rightComponent, dividerLineComponent]);\r\n\r\n const handleScroll = useCallback((event: NativeSyntheticEvent<NativeScrollEvent>, position: 1 | 2) => {\r\n if (props.onScroll) props.onScroll(event);\r\n\r\n if (position === 1) {\r\n positionRef.current = event.nativeEvent.contentOffset.y;\r\n } else {\r\n position2Ref.current = event.nativeEvent.contentOffset.y;\r\n }\r\n }, [props.onScroll]);\r\n\r\n const handleTouch = useCallback((evt: any, position: 1 | 2) => {\r\n lastTouchY.current = evt.nativeEvent.pageY;\r\n touchPositionRef.current = position;\r\n }, []);\r\n\r\n const safeAreaStyle = useMemo(() => [\r\n { backgroundColor: backgroundColor || palette.background.base },\r\n styles.w100\r\n ], [backgroundColor, palette.background.base]);\r\n\r\n const scrollContentStyle = useMemo(() => [\r\n styles.scrollContainerStyle,\r\n {\r\n paddingBottom: keyboardHeight ? keyboardHeight : 0\r\n }\r\n ], [keyboardHeight]);\r\n\r\n const containerStyle = useMemo(() => [\r\n styles.w100,\r\n props.style\r\n ], [props.style]);\r\n\r\n const shouldShowStatusBar = useMemo(() =>\r\n Boolean(barStyle || statusBarColor || translucent),\r\n [barStyle, statusBarColor, translucent]\r\n );\r\n\r\n return (\r\n <SafeAreaView\r\n style={safeAreaStyle}\r\n edges={edges}\r\n >\r\n <View style={[styles.w100, { backgroundColor: \"#00000009\" }]}>\r\n <View style={[styles.w100, { maxWidth: foldableSingleScreen ? Math.min(width, MAX_FOLDABLE_SINGLE_WIDTH) : '100%', alignSelf: 'center', backgroundColor: palette.background.base }]}>\r\n {topComponent}\r\n <View style={[styles.w100, { flexDirection: 'row' }]}>\r\n <View style={styles.flex1}>\r\n {scrollViewDisabled ? (\r\n <View style={[styles.flex1, containerStyle]}>\r\n {props.children}\r\n </View>\r\n ) : (\r\n <ScrollView\r\n ref={scrollViewRef}\r\n style={styles.w100}\r\n showsVerticalScrollIndicator={showsVerticalScrollIndicator}\r\n contentContainerStyle={scrollContentStyle}\r\n scrollEventThrottle={scrollEventThrottle}\r\n onScroll={(event) => { handleScroll(event, 1); }}\r\n onTouchStart={(evt) => handleTouch(evt, 1)}\r\n // ---\r\n {...SCROLL_VIEW_OPTIONS}\r\n >\r\n <View style={[styles.flex1, containerStyle]}>\r\n {props.children}\r\n </View>\r\n </ScrollView>\r\n )}\r\n </View>\r\n {foldingState === FoldingState.UNFOLDED && !foldableSingleScreen && rightComponent && dividerLineComponent && dividerLineComponent}\r\n {\r\n foldingState === FoldingState.UNFOLDED && !foldableSingleScreen && rightComponent && (\r\n <View style={styles.flex1}>\r\n {scrollViewDisabled ? (\r\n <View style={[styles.flex1, containerStyle]}>\r\n {rightComponent}\r\n </View>\r\n ) : (\r\n <ScrollView\r\n ref={scrollView2Ref}\r\n style={styles.w100}\r\n showsVerticalScrollIndicator={showsVerticalScrollIndicator}\r\n contentContainerStyle={scrollContentStyle}\r\n scrollEventThrottle={scrollEventThrottle}\r\n onScroll={(event) => { handleScroll(event, 2); }}\r\n onTouchStart={(evt) => handleTouch(evt, 2)}\r\n // ---\r\n {...SCROLL_VIEW_OPTIONS}\r\n >\r\n <View style={[styles.flex1, containerStyle]}>\r\n {rightComponent}\r\n </View>\r\n </ScrollView>\r\n )}\r\n </View>\r\n )\r\n }\r\n </View>\r\n {bottomComponent}\r\n </View>\r\n </View>\r\n\r\n {shouldShowStatusBar && (\r\n <StatusBar\r\n barStyle={barStyle}\r\n backgroundColor={statusBarColor || palette.background.base}\r\n translucent={translucent}\r\n />\r\n )}\r\n </SafeAreaView>\r\n );\r\n});\r\n\r\nexport const styles = StyleSheet.create({\r\n flex1: { flex: 1 },\r\n w100: { flex: 1, width: '100%' },\r\n scrollContainerStyle: { alignItems: 'center', width: '100%', flexGrow: 1 },\r\n});\r\n\r\nexport default ZSContainer;\r\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { TextProps } from "react-native
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextProps } from "react-native";
|
|
3
3
|
import { TypoOptions, TypoColorOptions } from "../../theme/types";
|
|
4
4
|
export interface ZSTextProps extends TextProps {
|
|
5
5
|
typo?: TypoOptions;
|
|
6
6
|
color?: TypoColorOptions;
|
|
7
7
|
}
|
|
8
|
-
declare function ZSText({ typo, color, ...props }: ZSTextProps):
|
|
8
|
+
declare function ZSText({ typo, color, ...props }: ZSTextProps): React.JSX.Element;
|
|
9
9
|
export default ZSText;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAa,gBAAgB,EAA4C,MAAM,mBAAmB,CAAC;AAGvH,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC1C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED,iBAAS,MAAM,CAAC,EACd,IAAe,EACf,KAAc,EACd,GAAG,KAAK,EACT,EAAE,WAAW,qBAKb;AAED,eAAe,MAAM,CAAC"}
|
package/build/ui/ZSText/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AAOxC,SAAS,MAAM,CAAC,EACd,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,MAAM,EACd,GAAG,KAAK,EACI;IACV,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC3C,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA8B,CAAC;IAChE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAiC,CAAC;IACpE,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAA;AAC/J,CAAC;AAED,eAAe,MAAM,CAAC","sourcesContent":["import React from \"react\";\nimport { TextProps } from \"react-native\";\nimport { useTheme } from \"../../context/ThemeContext\";\nimport { TypoOptions, TypoStyle, TypoColorOptions, TypoSubStyle, TypoColor, SubColorOptions } from \"../../theme/types\";\nimport TextAtom from \"../atoms/TextAtom\"\n\nexport interface ZSTextProps extends TextProps {\n typo?: TypoOptions;\n color?: TypoColorOptions;\n}\n\nfunction ZSText({\n typo = 'body.2',\n color = 'base',\n ...props\n}: ZSTextProps) {\n const { palette, typography } = useTheme();\n const [s01, s02] = typo.split('.') as [TypoStyle, TypoSubStyle];\n const [c01, c02] = color.split('.') as [TypoColor, SubColorOptions];\n return <TextAtom {...props} style={[typography[s01][s02], { color: c02 ? palette[c01][c02] : palette.text[c01] }, props.style]}>{props.children}</TextAtom>\n}\n\nexport default ZSText;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonClose.d.ts","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ButtonClose.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ButtonClose.d.ts","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ButtonClose.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,WAAW;2BAIS,MAAM,KAAK,IAAI;;iCAUxC,CAAA;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorComponent.d.ts","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ErrorComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorComponent.d.ts","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ErrorComponent.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,cAAc;kBAIJ,MAAM;gBACR,MAAM;iCAcnB,CAAA;AAED,eAAe,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0610studio/zs-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "EXPO ZS-UI",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "18.3.1",
|
|
56
56
|
"react-native": ">=0.76.9",
|
|
57
57
|
"react-native-reanimated": ">=3.17.4",
|
|
58
|
-
"react-native-safe-area-context": "5.
|
|
58
|
+
"react-native-safe-area-context": "5.6.2",
|
|
59
59
|
"react-native-svg": "15.8.0",
|
|
60
60
|
"react-test-renderer": "18.3.1",
|
|
61
61
|
"ts-jest": "^29.2.5",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@react-native-async-storage/async-storage": "*",
|
|
66
|
-
"expo": ">=
|
|
66
|
+
"expo": ">=53.0.0",
|
|
67
67
|
"expo-navigation-bar": ">=4.0.7",
|
|
68
68
|
"expo-router": "*",
|
|
69
69
|
"react": "*",
|