react-native-unistyles 2.10.0 → 3.0.0-alpha.10
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/{react-native-unistyles.podspec → Unistyles.podspec} +13 -5
- package/android/CMakeLists.txt +35 -17
- package/android/build.gradle +4 -2
- package/android/src/main/cxx/cpp-adapter.cpp +82 -65
- package/android/src/main/java/com/unistyles/UnistylesPackage.kt +19 -9
- package/cxx/common/Breakpoints.h +43 -0
- package/cxx/common/Constants.h +11 -0
- package/cxx/common/Helpers.h +185 -0
- package/cxx/core/HostStyle.cpp +63 -0
- package/cxx/core/HostStyle.h +28 -0
- package/cxx/core/MediaQueries.cpp +87 -0
- package/cxx/core/MediaQueries.h +47 -0
- package/cxx/core/StyleSheet.h +31 -0
- package/cxx/core/StyleSheetRegistry.cpp +42 -0
- package/cxx/core/StyleSheetRegistry.h +26 -0
- package/cxx/core/Unistyle.h +75 -0
- package/cxx/core/UnistyleData.h +23 -0
- package/cxx/core/UnistyleWrapper.cpp +5 -0
- package/cxx/core/UnistyleWrapper.h +50 -0
- package/cxx/core/UnistylesCommitHook.cpp +54 -0
- package/cxx/core/UnistylesCommitHook.h +32 -0
- package/cxx/core/UnistylesCommitShadowNode.h +39 -0
- package/cxx/core/UnistylesMountHook.cpp +40 -0
- package/cxx/core/UnistylesMountHook.h +30 -0
- package/cxx/core/UnistylesRegistry.cpp +162 -0
- package/cxx/core/UnistylesRegistry.h +61 -0
- package/cxx/core/UnistylesState.cpp +95 -0
- package/cxx/core/UnistylesState.h +50 -0
- package/cxx/hybridObjects/HybridNavigationBar.cpp +17 -0
- package/cxx/hybridObjects/HybridNavigationBar.h +19 -0
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +33 -0
- package/cxx/hybridObjects/HybridShadowRegistry.h +33 -0
- package/cxx/hybridObjects/HybridStatusBar.cpp +17 -0
- package/cxx/hybridObjects/HybridStatusBar.h +19 -0
- package/cxx/hybridObjects/HybridStyleSheet.cpp +241 -0
- package/cxx/hybridObjects/HybridStyleSheet.h +64 -0
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +218 -0
- package/cxx/hybridObjects/HybridUnistylesRuntime.h +72 -0
- package/cxx/parser/Parser.cpp +642 -0
- package/cxx/parser/Parser.h +49 -0
- package/cxx/shadowTree/ShadowLeafUpdate.h +13 -0
- package/cxx/shadowTree/ShadowTreeManager.cpp +124 -0
- package/cxx/shadowTree/ShadowTreeManager.h +23 -0
- package/ios/Equatable.swift +64 -0
- package/ios/Extensions.swift +11 -0
- package/ios/NativePlatform+ios.swift +291 -0
- package/ios/NativePlatform.swift +17 -0
- package/ios/NativePlatformListener+ios.swift +41 -0
- package/ios/Unistyles.h +3 -0
- package/ios/UnistylesModuleOnLoad.h +13 -0
- package/ios/UnistylesModuleOnLoad.mm +58 -0
- package/lib/commonjs/common.js +1 -58
- package/lib/commonjs/common.js.map +1 -1
- package/lib/commonjs/index.js +27 -66
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/{utils/mq.js → mq.js} +12 -2
- package/lib/commonjs/mq.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js +25 -0
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -0
- package/lib/commonjs/specs/NativePlatform/index.js +13 -0
- package/lib/commonjs/specs/NativePlatform/index.js.map +1 -0
- package/lib/commonjs/specs/NavigtionBar/UnistylesNavigationBar.nitro.js +6 -0
- package/lib/commonjs/specs/NavigtionBar/UnistylesNavigationBar.nitro.js.map +1 -0
- package/lib/commonjs/specs/NavigtionBar/index.js +17 -0
- package/lib/commonjs/specs/NavigtionBar/index.js.map +1 -0
- package/lib/commonjs/{types/plugin.js → specs/ShadowRegistry/ShadowRegistry.nitro.js} +1 -1
- package/lib/commonjs/specs/ShadowRegistry/ShadowRegistry.nitro.js.map +1 -0
- package/lib/commonjs/specs/ShadowRegistry/index.js +30 -0
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -0
- package/lib/commonjs/specs/ShadowRegistry/types.js +2 -0
- package/lib/commonjs/specs/ShadowRegistry/types.js.map +1 -0
- package/lib/commonjs/{types/normalizer.js → specs/StatusBar/UnistylesStatusBar.nitro.js} +1 -1
- package/lib/commonjs/specs/StatusBar/UnistylesStatusBar.nitro.js.map +1 -0
- package/lib/commonjs/specs/StatusBar/index.js +33 -0
- package/lib/commonjs/specs/StatusBar/index.js.map +1 -0
- package/lib/commonjs/specs/StyleSheet/UnistylesStyleSheet.nitro.js +6 -0
- package/lib/commonjs/specs/StyleSheet/UnistylesStyleSheet.nitro.js.map +1 -0
- package/lib/commonjs/specs/StyleSheet/index.js +18 -0
- package/lib/commonjs/specs/StyleSheet/index.js.map +1 -0
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js +8 -0
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js.map +1 -0
- package/lib/commonjs/specs/TurboUnistyles/index.js +4 -0
- package/lib/commonjs/specs/TurboUnistyles/index.js.map +1 -0
- package/lib/commonjs/{types/unistyles.js → specs/UnistylesRuntime/UnistylesRuntime.nitro.js} +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/UnistylesRuntime.nitro.js.map +1 -0
- package/lib/commonjs/specs/UnistylesRuntime/index.js +26 -0
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -0
- package/lib/commonjs/specs/index.js +47 -0
- package/lib/commonjs/specs/index.js.map +1 -0
- package/lib/commonjs/specs/index.web.js +24 -0
- package/lib/commonjs/specs/index.web.js.map +1 -0
- package/lib/commonjs/specs/types.js +24 -0
- package/lib/commonjs/specs/types.js.map +1 -0
- package/lib/commonjs/types/accessibility.js +37 -0
- package/lib/commonjs/types/accessibility.js.map +1 -0
- package/lib/commonjs/types/index.js +16 -30
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/stylesheet.js +3 -0
- package/lib/commonjs/types/stylesheet.js.map +1 -1
- package/lib/commonjs/types/variants.js +4 -0
- package/lib/commonjs/web/convert/boxShadow.js +77 -0
- package/lib/commonjs/web/convert/boxShadow.js.map +1 -0
- package/lib/commonjs/web/convert/breakpoint.js +25 -0
- package/lib/commonjs/web/convert/breakpoint.js.map +1 -0
- package/lib/commonjs/web/convert/index.js +76 -0
- package/lib/commonjs/web/convert/index.js.map +1 -0
- package/lib/commonjs/web/convert/module.d.js.map +1 -0
- package/lib/commonjs/web/convert/shadow.js +68 -0
- package/lib/commonjs/web/convert/shadow.js.map +1 -0
- package/lib/commonjs/web/convert/style.js +89 -0
- package/lib/commonjs/web/convert/style.js.map +1 -0
- package/lib/commonjs/web/convert/textShadow.js +73 -0
- package/lib/commonjs/web/convert/textShadow.js.map +1 -0
- package/lib/commonjs/web/convert/transform.js +72 -0
- package/lib/commonjs/web/convert/transform.js.map +1 -0
- package/lib/commonjs/web/convert/types.js +9 -0
- package/lib/commonjs/web/convert/types.js.map +1 -0
- package/lib/commonjs/web/convert/utils.js +55 -0
- package/lib/commonjs/web/convert/utils.js.map +1 -0
- package/lib/commonjs/web/create.js +89 -0
- package/lib/commonjs/web/create.js.map +1 -0
- package/lib/commonjs/web/index.js +51 -0
- package/lib/commonjs/web/index.js.map +1 -0
- package/lib/commonjs/web/listener/index.js +13 -0
- package/lib/commonjs/web/listener/index.js.map +1 -0
- package/lib/commonjs/web/listener/listener.js +36 -0
- package/lib/commonjs/web/listener/listener.js.map +1 -0
- package/lib/commonjs/web/mock.js +37 -0
- package/lib/commonjs/web/mock.js.map +1 -0
- package/lib/commonjs/web/mq.js +23 -0
- package/lib/commonjs/web/mq.js.map +1 -0
- package/lib/commonjs/web/pseudo.js +11 -0
- package/lib/commonjs/web/pseudo.js.map +1 -0
- package/lib/commonjs/web/registry.js +37 -0
- package/lib/commonjs/web/registry.js.map +1 -0
- package/lib/commonjs/web/runtime.js +164 -0
- package/lib/commonjs/web/runtime.js.map +1 -0
- package/lib/commonjs/web/state.js +121 -0
- package/lib/commonjs/web/state.js.map +1 -0
- package/lib/commonjs/web/utils.js +78 -0
- package/lib/commonjs/web/utils.js.map +1 -0
- package/lib/commonjs/web/variants/getVariants.js +39 -0
- package/lib/commonjs/web/variants/getVariants.js.map +1 -0
- package/lib/commonjs/web/variants/index.js +28 -0
- package/lib/commonjs/web/variants/index.js.map +1 -0
- package/lib/commonjs/web/variants/useVariants.js +75 -0
- package/lib/commonjs/web/variants/useVariants.js.map +1 -0
- package/lib/module/common.js +2 -56
- package/lib/module/common.js.map +1 -1
- package/lib/module/global.js +1 -1
- package/lib/module/index.js +12 -29
- package/lib/module/index.js.map +1 -1
- package/lib/module/{utils/mq.js → mq.js} +14 -2
- package/lib/module/mq.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js +23 -0
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +1 -0
- package/lib/module/specs/NativePlatform/index.js +4 -0
- package/lib/module/specs/NativePlatform/index.js.map +1 -0
- package/lib/module/specs/NavigtionBar/UnistylesNavigationBar.nitro.js +4 -0
- package/lib/module/specs/NavigtionBar/UnistylesNavigationBar.nitro.js.map +1 -0
- package/lib/module/specs/NavigtionBar/index.js +12 -0
- package/lib/module/specs/NavigtionBar/index.js.map +1 -0
- package/lib/module/specs/ShadowRegistry/ShadowRegistry.nitro.js +4 -0
- package/lib/module/specs/ShadowRegistry/ShadowRegistry.nitro.js.map +1 -0
- package/lib/module/specs/ShadowRegistry/index.js +26 -0
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -0
- package/lib/module/specs/ShadowRegistry/types.js +2 -0
- package/lib/module/specs/ShadowRegistry/types.js.map +1 -0
- package/lib/module/specs/StatusBar/UnistylesStatusBar.nitro.js +4 -0
- package/lib/module/specs/StatusBar/UnistylesStatusBar.nitro.js.map +1 -0
- package/lib/module/specs/StatusBar/index.js +28 -0
- package/lib/module/specs/StatusBar/index.js.map +1 -0
- package/lib/module/specs/StyleSheet/UnistylesStyleSheet.nitro.js +4 -0
- package/lib/module/specs/StyleSheet/UnistylesStyleSheet.nitro.js.map +1 -0
- package/lib/module/specs/StyleSheet/index.js +14 -0
- package/lib/module/specs/StyleSheet/index.js.map +1 -0
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js +9 -0
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js.map +1 -0
- package/lib/module/specs/TurboUnistyles/index.js +4 -0
- package/lib/module/specs/TurboUnistyles/index.js.map +1 -0
- package/lib/module/specs/UnistylesRuntime/UnistylesRuntime.nitro.js +4 -0
- package/lib/module/specs/UnistylesRuntime/UnistylesRuntime.nitro.js.map +1 -0
- package/lib/module/specs/UnistylesRuntime/index.js +22 -0
- package/lib/module/specs/UnistylesRuntime/index.js.map +1 -0
- package/lib/module/specs/index.js +10 -0
- package/lib/module/specs/index.js.map +1 -0
- package/lib/module/specs/index.web.js +5 -0
- package/lib/module/specs/index.web.js.map +1 -0
- package/lib/module/specs/types.js +20 -0
- package/lib/module/specs/types.js.map +1 -0
- package/lib/module/types/accessibility.js +33 -0
- package/lib/module/types/accessibility.js.map +1 -0
- package/lib/module/types/breakpoints.js +2 -0
- package/lib/module/types/common.js +1 -1
- package/lib/module/types/core.js +2 -0
- package/lib/module/types/index.js +3 -3
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/stylesheet.js +5 -0
- package/lib/module/types/stylesheet.js.map +1 -1
- package/lib/module/types/variants.js +2 -0
- package/lib/module/web/convert/boxShadow.js +72 -0
- package/lib/module/web/convert/boxShadow.js.map +1 -0
- package/lib/module/web/convert/breakpoint.js +20 -0
- package/lib/module/web/convert/breakpoint.js.map +1 -0
- package/lib/module/web/convert/index.js +71 -0
- package/lib/module/web/convert/index.js.map +1 -0
- package/lib/module/web/convert/module.d.js +2 -0
- package/lib/module/web/convert/module.d.js.map +1 -0
- package/lib/module/web/convert/shadow.js +63 -0
- package/lib/module/web/convert/shadow.js.map +1 -0
- package/lib/module/web/convert/style.js +84 -0
- package/lib/module/web/convert/style.js.map +1 -0
- package/lib/module/web/convert/textShadow.js +68 -0
- package/lib/module/web/convert/textShadow.js.map +1 -0
- package/lib/module/web/convert/transform.js +67 -0
- package/lib/module/web/convert/transform.js.map +1 -0
- package/lib/module/web/convert/types.js +5 -0
- package/lib/module/web/convert/types.js.map +1 -0
- package/lib/module/web/convert/utils.js +43 -0
- package/lib/module/web/convert/utils.js.map +1 -0
- package/lib/module/web/create.js +84 -0
- package/lib/module/web/create.js.map +1 -0
- package/lib/module/web/index.js +24 -0
- package/lib/module/web/index.js.map +1 -0
- package/lib/module/web/listener/index.js +4 -0
- package/lib/module/web/listener/index.js.map +1 -0
- package/lib/module/web/listener/listener.js +31 -0
- package/lib/module/web/listener/listener.js.map +1 -0
- package/lib/module/web/mock.js +33 -0
- package/lib/module/web/mock.js.map +1 -0
- package/lib/module/web/mq.js +17 -0
- package/lib/module/web/mq.js.map +1 -0
- package/lib/module/web/pseudo.js +6 -0
- package/lib/module/web/pseudo.js.map +1 -0
- package/lib/module/web/registry.js +33 -0
- package/lib/module/web/registry.js.map +1 -0
- package/lib/module/web/runtime.js +160 -0
- package/lib/module/web/runtime.js.map +1 -0
- package/lib/module/web/state.js +117 -0
- package/lib/module/web/state.js.map +1 -0
- package/lib/module/web/utils.js +65 -0
- package/lib/module/web/utils.js.map +1 -0
- package/lib/module/web/variants/getVariants.js +34 -0
- package/lib/module/web/variants/getVariants.js.map +1 -0
- package/lib/module/web/variants/index.js +5 -0
- package/lib/module/web/variants/index.js.map +1 -0
- package/lib/module/web/variants/useVariants.js +70 -0
- package/lib/module/web/variants/useVariants.js.map +1 -0
- package/lib/typescript/example/App.d.ts +4 -0
- package/lib/typescript/example/App.d.ts.map +1 -0
- package/lib/typescript/example/Typography.d.ts +12 -0
- package/lib/typescript/example/Typography.d.ts.map +1 -0
- package/lib/typescript/example/unistyles.d.ts +63 -0
- package/lib/typescript/example/unistyles.d.ts.map +1 -0
- package/lib/typescript/expo-example/App.d.ts +4 -0
- package/lib/typescript/expo-example/App.d.ts.map +1 -0
- package/lib/typescript/expo-example/unistyles.d.ts +63 -0
- package/lib/typescript/expo-example/unistyles.d.ts.map +1 -0
- package/lib/typescript/src/common.d.ts +0 -50
- package/lib/typescript/src/common.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -76
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/{utils/mq.d.ts → mq.d.ts} +2 -2
- package/lib/typescript/src/mq.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +57 -0
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativePlatform/index.d.ts +3 -0
- package/lib/typescript/src/specs/NativePlatform/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts +11 -0
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts +11 -0
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/ShadowRegistry/ShadowRegistry.nitro.d.ts +7 -0
- package/lib/typescript/src/specs/ShadowRegistry/ShadowRegistry.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +12 -0
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +27 -0
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -0
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts +11 -0
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/StatusBar/index.d.ts +15 -0
- package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +9 -0
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/StyleSheet/index.d.ts +29 -0
- package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/TurboUnistyles/NativeTurboUnistyles.d.ts +2 -0
- package/lib/typescript/src/specs/TurboUnistyles/NativeTurboUnistyles.d.ts.map +1 -0
- package/lib/typescript/src/specs/TurboUnistyles/index.d.ts +2 -0
- package/lib/typescript/src/specs/TurboUnistyles/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts +41 -0
- package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +25 -0
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/index.d.ts +10 -0
- package/lib/typescript/src/specs/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/index.web.d.ts +4 -0
- package/lib/typescript/src/specs/index.web.d.ts.map +1 -0
- package/lib/typescript/src/specs/types.d.ts +32 -0
- package/lib/typescript/src/specs/types.d.ts.map +1 -0
- package/lib/typescript/src/types/accessibility.d.ts +28 -0
- package/lib/typescript/src/types/accessibility.d.ts.map +1 -0
- package/lib/typescript/src/types/breakpoints.d.ts +12 -5
- package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/types/common.d.ts +1 -0
- package/lib/typescript/src/types/common.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +2 -5
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +31 -9
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/types/variants.d.ts +5 -8
- package/lib/typescript/src/types/variants.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/boxShadow.d.ts +3 -0
- package/lib/typescript/src/web/convert/boxShadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/breakpoint.d.ts +3 -0
- package/lib/typescript/src/web/convert/breakpoint.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/index.d.ts +4 -0
- package/lib/typescript/src/web/convert/index.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/shadow.d.ts +2 -0
- package/lib/typescript/src/web/convert/shadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/style.d.ts +3 -0
- package/lib/typescript/src/web/convert/style.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/textShadow.d.ts +3 -0
- package/lib/typescript/src/web/convert/textShadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/transform.d.ts +5 -0
- package/lib/typescript/src/web/convert/transform.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/types.d.ts +13 -0
- package/lib/typescript/src/web/convert/types.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/utils.d.ts +8 -0
- package/lib/typescript/src/web/convert/utils.d.ts.map +1 -0
- package/lib/typescript/src/web/create.d.ts +2449 -0
- package/lib/typescript/src/web/create.d.ts.map +1 -0
- package/lib/typescript/src/web/index.d.ts +2464 -0
- package/lib/typescript/src/web/index.d.ts.map +1 -0
- package/lib/typescript/src/web/listener/index.d.ts +2 -0
- package/lib/typescript/src/web/listener/index.d.ts.map +1 -0
- package/lib/typescript/src/web/listener/listener.d.ts +10 -0
- package/lib/typescript/src/web/listener/listener.d.ts.map +1 -0
- package/lib/typescript/src/web/mock.d.ts +14 -0
- package/lib/typescript/src/web/mock.d.ts.map +1 -0
- package/lib/typescript/src/web/mq.d.ts +4 -0
- package/lib/typescript/src/web/mq.d.ts.map +1 -0
- package/lib/typescript/src/web/pseudo.d.ts +4 -0
- package/lib/typescript/src/web/pseudo.d.ts.map +1 -0
- package/lib/typescript/src/web/registry.d.ts +12 -0
- package/lib/typescript/src/web/registry.d.ts.map +1 -0
- package/lib/typescript/src/web/runtime.d.ts +42 -0
- package/lib/typescript/src/web/runtime.d.ts.map +1 -0
- package/lib/typescript/src/web/state.d.ts +24 -0
- package/lib/typescript/src/web/state.d.ts.map +1 -0
- package/lib/typescript/src/web/utils.d.ts +20 -0
- package/lib/typescript/src/web/utils.d.ts.map +1 -0
- package/lib/typescript/src/web/variants/getVariants.d.ts +3 -0
- package/lib/typescript/src/web/variants/getVariants.d.ts.map +1 -0
- package/lib/typescript/src/web/variants/index.d.ts +3 -0
- package/lib/typescript/src/web/variants/index.d.ts.map +1 -0
- package/lib/typescript/src/web/variants/useVariants.d.ts +3 -0
- package/lib/typescript/src/web/variants/useVariants.d.ts.map +1 -0
- package/nitrogen/generated/android/UnistylesOnLoad.cpp +34 -0
- package/nitrogen/generated/android/UnistylesOnLoad.hpp +25 -0
- package/nitrogen/generated/android/UnistylesOnLoad.kt +1 -0
- package/nitrogen/generated/android/c++/JColorScheme.hpp +61 -0
- package/nitrogen/generated/android/c++/JDimensions.hpp +56 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +60 -0
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +145 -0
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +70 -0
- package/nitrogen/generated/android/c++/JInsets.hpp +68 -0
- package/nitrogen/generated/android/c++/JOrientation.hpp +58 -0
- package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +94 -0
- package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/ColorScheme.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Dimensions.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency_.kt +45 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +134 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Insets.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Orientation.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +33 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +29 -0
- package/nitrogen/generated/android/unistyles+autolinking.cmake +52 -0
- package/nitrogen/generated/android/unistyles+autolinking.gradle +25 -0
- package/nitrogen/generated/ios/Unistyles+autolinking.rb +56 -0
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +86 -0
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +88 -0
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +151 -0
- package/nitrogen/generated/ios/swift/ColorScheme.swift +44 -0
- package/nitrogen/generated/ios/swift/Dimensions.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +65 -0
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +273 -0
- package/nitrogen/generated/ios/swift/Insets.swift +79 -0
- package/nitrogen/generated/ios/swift/Orientation.swift +40 -0
- package/nitrogen/generated/ios/swift/UnistyleDependency.swift +88 -0
- package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +134 -0
- package/nitrogen/generated/shared/c++/ColorScheme.hpp +82 -0
- package/nitrogen/generated/shared/c++/Dimensions.hpp +72 -0
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +38 -0
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +95 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +61 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.cpp +36 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +88 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +59 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +61 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +60 -0
- package/nitrogen/generated/shared/c++/Insets.hpp +84 -0
- package/nitrogen/generated/shared/c++/Orientation.hpp +78 -0
- package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +76 -0
- package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +128 -0
- package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +115 -0
- package/package.json +34 -59
- package/plugin/__tests__/dependencies.spec.js +438 -0
- package/plugin/__tests__/ref.spec.js +1170 -0
- package/plugin/__tests__/stylesheet.spec.js +489 -0
- package/plugin/common.js +119 -0
- package/plugin/import.js +8 -0
- package/plugin/index.js +132 -0
- package/plugin/ref.js +211 -0
- package/plugin/style.js +47 -0
- package/plugin/stylesheet.js +190 -0
- package/plugin/variants.js +33 -0
- package/src/common.ts +0 -58
- package/src/index.ts +11 -52
- package/src/{utils/mq.ts → mq.ts} +13 -4
- package/src/specs/NativePlatform/NativePlatform.nitro.ts +61 -0
- package/src/specs/NativePlatform/index.ts +2 -0
- package/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.ts +10 -0
- package/src/specs/NavigtionBar/index.ts +25 -0
- package/src/specs/ShadowRegistry/ShadowRegistry.nitro.ts +3 -0
- package/src/specs/ShadowRegistry/index.ts +51 -0
- package/src/specs/ShadowRegistry/types.ts +29 -0
- package/src/specs/StatusBar/UnistylesStatusBar.nitro.ts +10 -0
- package/src/specs/StatusBar/index.ts +48 -0
- package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +6 -0
- package/src/specs/StyleSheet/index.ts +46 -0
- package/src/specs/TurboUnistyles/NativeTurboUnistyles.ts +8 -0
- package/src/specs/TurboUnistyles/index.ts +1 -0
- package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +47 -0
- package/src/specs/UnistylesRuntime/index.ts +64 -0
- package/src/specs/index.ts +23 -0
- package/src/specs/index.web.ts +5 -0
- package/src/specs/types.ts +38 -0
- package/src/types/accessibility.ts +29 -0
- package/src/types/breakpoints.ts +21 -14
- package/src/types/common.ts +1 -0
- package/src/types/index.ts +2 -5
- package/src/types/stylesheet.ts +41 -9
- package/src/types/variants.ts +7 -11
- package/src/web/convert/boxShadow.ts +72 -0
- package/src/web/convert/breakpoint.ts +21 -0
- package/src/web/convert/index.ts +78 -0
- package/src/web/convert/shadow.ts +68 -0
- package/src/web/convert/style.ts +94 -0
- package/src/web/convert/textShadow.ts +69 -0
- package/src/web/convert/transform.ts +89 -0
- package/src/web/convert/types.ts +16 -0
- package/src/web/convert/utils.ts +54 -0
- package/src/web/create.ts +105 -0
- package/src/web/index.ts +24 -0
- package/src/web/listener/index.ts +1 -0
- package/src/web/listener/listener.ts +33 -0
- package/src/web/mock.ts +35 -0
- package/src/web/mq.ts +19 -0
- package/src/web/pseudo.ts +11 -0
- package/src/web/registry.ts +41 -0
- package/src/web/runtime.ts +198 -0
- package/src/web/state.ts +148 -0
- package/src/web/utils.ts +95 -0
- package/src/web/variants/getVariants.ts +42 -0
- package/src/web/variants/index.ts +2 -0
- package/src/web/variants/useVariants.ts +79 -0
- package/android/src/main/java/com/unistyles/Models.kt +0 -27
- package/android/src/main/java/com/unistyles/Platform.kt +0 -324
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +0 -217
- package/cxx/Macros.h +0 -11
- package/cxx/UnistylesImpl.cpp +0 -310
- package/cxx/UnistylesModel.cpp +0 -230
- package/cxx/UnistylesModel.h +0 -143
- package/cxx/UnistylesRuntime.cpp +0 -36
- package/cxx/UnistylesRuntime.h +0 -81
- package/ios/UnistylesModule.h +0 -28
- package/ios/UnistylesModule.mm +0 -77
- package/ios/platform/Platform_Shared.h +0 -8
- package/ios/platform/Platform_Shared.mm +0 -160
- package/ios/platform/Platform_iOS.h +0 -20
- package/ios/platform/Platform_iOS.mm +0 -193
- package/ios/platform/Platform_macOS.h +0 -19
- package/ios/platform/Platform_macOS.mm +0 -117
- package/ios/platform/Platform_tvOS.h +0 -16
- package/ios/platform/Platform_tvOS.mm +0 -92
- package/ios/platform/Platform_visionOS.h +0 -19
- package/ios/platform/Platform_visionOS.mm +0 -116
- package/lib/commonjs/core/UnistyleRegistry.js +0 -110
- package/lib/commonjs/core/UnistyleRegistry.js.map +0 -1
- package/lib/commonjs/core/Unistyles.js +0 -39
- package/lib/commonjs/core/Unistyles.js.map +0 -1
- package/lib/commonjs/core/UnistylesModule.js +0 -268
- package/lib/commonjs/core/UnistylesModule.js.map +0 -1
- package/lib/commonjs/core/UnistylesModule.native.js +0 -9
- package/lib/commonjs/core/UnistylesModule.native.js.map +0 -1
- package/lib/commonjs/core/UnistylesModule.windows.js +0 -11
- package/lib/commonjs/core/UnistylesModule.windows.js.map +0 -1
- package/lib/commonjs/core/UnistylesRuntime.js +0 -284
- package/lib/commonjs/core/UnistylesRuntime.js.map +0 -1
- package/lib/commonjs/core/index.js +0 -13
- package/lib/commonjs/core/index.js.map +0 -1
- package/lib/commonjs/core/mocks/UnistylesMockedBridge.js +0 -36
- package/lib/commonjs/core/mocks/UnistylesMockedBridge.js.map +0 -1
- package/lib/commonjs/core/mocks/UnistylesMockedRegistry.js +0 -46
- package/lib/commonjs/core/mocks/UnistylesMockedRegistry.js.map +0 -1
- package/lib/commonjs/core/mocks/UnistylesMockedRuntime.js +0 -122
- package/lib/commonjs/core/mocks/UnistylesMockedRuntime.js.map +0 -1
- package/lib/commonjs/core/mocks/index.js +0 -27
- package/lib/commonjs/core/mocks/index.js.map +0 -1
- package/lib/commonjs/createStyleSheet.js +0 -14
- package/lib/commonjs/createStyleSheet.js.map +0 -1
- package/lib/commonjs/hooks/index.js +0 -34
- package/lib/commonjs/hooks/index.js.map +0 -1
- package/lib/commonjs/hooks/useCSS.js +0 -44
- package/lib/commonjs/hooks/useCSS.js.map +0 -1
- package/lib/commonjs/hooks/useCSS.native.js +0 -9
- package/lib/commonjs/hooks/useCSS.native.js.map +0 -1
- package/lib/commonjs/hooks/useInitialTheme.js +0 -17
- package/lib/commonjs/hooks/useInitialTheme.js.map +0 -1
- package/lib/commonjs/hooks/useUnistyles.js +0 -74
- package/lib/commonjs/hooks/useUnistyles.js.map +0 -1
- package/lib/commonjs/hooks/useVariants.js +0 -14
- package/lib/commonjs/hooks/useVariants.js.map +0 -1
- package/lib/commonjs/normalizer/index.js +0 -32
- package/lib/commonjs/normalizer/index.js.map +0 -1
- package/lib/commonjs/normalizer/module.d.js.map +0 -1
- package/lib/commonjs/normalizer/normalizeStyle.js +0 -59
- package/lib/commonjs/normalizer/normalizeStyle.js.map +0 -1
- package/lib/commonjs/normalizer/normalizer.js +0 -88
- package/lib/commonjs/normalizer/normalizer.js.map +0 -1
- package/lib/commonjs/normalizer/normalizer.macos.js +0 -3
- package/lib/commonjs/normalizer/normalizer.macos.js.map +0 -1
- package/lib/commonjs/plugins/cssMediaQueriesPlugin.js +0 -14
- package/lib/commonjs/plugins/cssMediaQueriesPlugin.js.map +0 -1
- package/lib/commonjs/plugins/index.js +0 -20
- package/lib/commonjs/plugins/index.js.map +0 -1
- package/lib/commonjs/plugins/normalizeWebStylesPlugin.js +0 -12
- package/lib/commonjs/plugins/normalizeWebStylesPlugin.js.map +0 -1
- package/lib/commonjs/types/color.js +0 -2
- package/lib/commonjs/types/color.js.map +0 -1
- package/lib/commonjs/types/normalizer.js.map +0 -1
- package/lib/commonjs/types/plugin.js.map +0 -1
- package/lib/commonjs/types/unistyles.js.map +0 -1
- package/lib/commonjs/useStyles.js +0 -47
- package/lib/commonjs/useStyles.js.map +0 -1
- package/lib/commonjs/utils/breakpoints.js +0 -33
- package/lib/commonjs/utils/breakpoints.js.map +0 -1
- package/lib/commonjs/utils/cssMediaQuery.js +0 -244
- package/lib/commonjs/utils/cssMediaQuery.js.map +0 -1
- package/lib/commonjs/utils/generateId.js +0 -15
- package/lib/commonjs/utils/generateId.js.map +0 -1
- package/lib/commonjs/utils/hash32.js +0 -43
- package/lib/commonjs/utils/hash32.js.map +0 -1
- package/lib/commonjs/utils/index.js +0 -91
- package/lib/commonjs/utils/index.js.map +0 -1
- package/lib/commonjs/utils/mq.js.map +0 -1
- package/lib/commonjs/utils/mqParser.js +0 -89
- package/lib/commonjs/utils/mqParser.js.map +0 -1
- package/lib/commonjs/utils/parseColor.js +0 -35
- package/lib/commonjs/utils/parseColor.js.map +0 -1
- package/lib/commonjs/utils/styles.js +0 -73
- package/lib/commonjs/utils/styles.js.map +0 -1
- package/lib/commonjs/utils/withPlugins.js +0 -15
- package/lib/commonjs/utils/withPlugins.js.map +0 -1
- package/lib/module/core/UnistyleRegistry.js +0 -103
- package/lib/module/core/UnistyleRegistry.js.map +0 -1
- package/lib/module/core/Unistyles.js +0 -33
- package/lib/module/core/Unistyles.js.map +0 -1
- package/lib/module/core/UnistylesModule.js +0 -261
- package/lib/module/core/UnistylesModule.js.map +0 -1
- package/lib/module/core/UnistylesModule.native.js +0 -3
- package/lib/module/core/UnistylesModule.native.js.map +0 -1
- package/lib/module/core/UnistylesModule.windows.js +0 -5
- package/lib/module/core/UnistylesModule.windows.js.map +0 -1
- package/lib/module/core/UnistylesRuntime.js +0 -278
- package/lib/module/core/UnistylesRuntime.js.map +0 -1
- package/lib/module/core/index.js +0 -3
- package/lib/module/core/index.js.map +0 -1
- package/lib/module/core/mocks/UnistylesMockedBridge.js +0 -29
- package/lib/module/core/mocks/UnistylesMockedBridge.js.map +0 -1
- package/lib/module/core/mocks/UnistylesMockedRegistry.js +0 -39
- package/lib/module/core/mocks/UnistylesMockedRegistry.js.map +0 -1
- package/lib/module/core/mocks/UnistylesMockedRuntime.js +0 -114
- package/lib/module/core/mocks/UnistylesMockedRuntime.js.map +0 -1
- package/lib/module/core/mocks/index.js +0 -4
- package/lib/module/core/mocks/index.js.map +0 -1
- package/lib/module/createStyleSheet.js +0 -7
- package/lib/module/createStyleSheet.js.map +0 -1
- package/lib/module/hooks/index.js +0 -5
- package/lib/module/hooks/index.js.map +0 -1
- package/lib/module/hooks/useCSS.js +0 -37
- package/lib/module/hooks/useCSS.js.map +0 -1
- package/lib/module/hooks/useCSS.native.js +0 -2
- package/lib/module/hooks/useCSS.native.js.map +0 -1
- package/lib/module/hooks/useInitialTheme.js +0 -10
- package/lib/module/hooks/useInitialTheme.js.map +0 -1
- package/lib/module/hooks/useUnistyles.js +0 -67
- package/lib/module/hooks/useUnistyles.js.map +0 -1
- package/lib/module/hooks/useVariants.js +0 -7
- package/lib/module/hooks/useVariants.js.map +0 -1
- package/lib/module/normalizer/index.js +0 -3
- package/lib/module/normalizer/index.js.map +0 -1
- package/lib/module/normalizer/module.d.js +0 -2
- package/lib/module/normalizer/module.d.js.map +0 -1
- package/lib/module/normalizer/normalizeStyle.js +0 -52
- package/lib/module/normalizer/normalizeStyle.js.map +0 -1
- package/lib/module/normalizer/normalizer.js +0 -78
- package/lib/module/normalizer/normalizer.js.map +0 -1
- package/lib/module/normalizer/normalizer.macos.js +0 -2
- package/lib/module/normalizer/normalizer.macos.js.map +0 -1
- package/lib/module/plugins/cssMediaQueriesPlugin.js +0 -7
- package/lib/module/plugins/cssMediaQueriesPlugin.js.map +0 -1
- package/lib/module/plugins/index.js +0 -3
- package/lib/module/plugins/index.js.map +0 -1
- package/lib/module/plugins/normalizeWebStylesPlugin.js +0 -6
- package/lib/module/plugins/normalizeWebStylesPlugin.js.map +0 -1
- package/lib/module/types/color.js +0 -2
- package/lib/module/types/color.js.map +0 -1
- package/lib/module/types/normalizer.js +0 -2
- package/lib/module/types/normalizer.js.map +0 -1
- package/lib/module/types/plugin.js +0 -2
- package/lib/module/types/plugin.js.map +0 -1
- package/lib/module/types/unistyles.js +0 -2
- package/lib/module/types/unistyles.js.map +0 -1
- package/lib/module/useStyles.js +0 -40
- package/lib/module/useStyles.js.map +0 -1
- package/lib/module/utils/breakpoints.js +0 -26
- package/lib/module/utils/breakpoints.js.map +0 -1
- package/lib/module/utils/cssMediaQuery.js +0 -237
- package/lib/module/utils/cssMediaQuery.js.map +0 -1
- package/lib/module/utils/generateId.js +0 -7
- package/lib/module/utils/generateId.js.map +0 -1
- package/lib/module/utils/hash32.js +0 -36
- package/lib/module/utils/hash32.js.map +0 -1
- package/lib/module/utils/index.js +0 -8
- package/lib/module/utils/index.js.map +0 -1
- package/lib/module/utils/mq.js.map +0 -1
- package/lib/module/utils/mqParser.js +0 -78
- package/lib/module/utils/mqParser.js.map +0 -1
- package/lib/module/utils/parseColor.js +0 -28
- package/lib/module/utils/parseColor.js.map +0 -1
- package/lib/module/utils/styles.js +0 -64
- package/lib/module/utils/styles.js.map +0 -1
- package/lib/module/utils/withPlugins.js +0 -8
- package/lib/module/utils/withPlugins.js.map +0 -1
- package/lib/typescript/src/core/UnistyleRegistry.d.ts +0 -57
- package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +0 -1
- package/lib/typescript/src/core/Unistyles.d.ts +0 -13
- package/lib/typescript/src/core/Unistyles.d.ts.map +0 -1
- package/lib/typescript/src/core/UnistylesModule.d.ts +0 -21
- package/lib/typescript/src/core/UnistylesModule.d.ts.map +0 -1
- package/lib/typescript/src/core/UnistylesModule.native.d.ts +0 -6
- package/lib/typescript/src/core/UnistylesModule.native.d.ts.map +0 -1
- package/lib/typescript/src/core/UnistylesModule.windows.d.ts +0 -6
- package/lib/typescript/src/core/UnistylesModule.windows.d.ts.map +0 -1
- package/lib/typescript/src/core/UnistylesRuntime.d.ts +0 -179
- package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +0 -1
- package/lib/typescript/src/core/index.d.ts +0 -5
- package/lib/typescript/src/core/index.d.ts.map +0 -1
- package/lib/typescript/src/core/mocks/UnistylesMockedBridge.d.ts +0 -28
- package/lib/typescript/src/core/mocks/UnistylesMockedBridge.d.ts.map +0 -1
- package/lib/typescript/src/core/mocks/UnistylesMockedRegistry.d.ts +0 -21
- package/lib/typescript/src/core/mocks/UnistylesMockedRegistry.d.ts.map +0 -1
- package/lib/typescript/src/core/mocks/UnistylesMockedRuntime.d.ts +0 -79
- package/lib/typescript/src/core/mocks/UnistylesMockedRuntime.d.ts.map +0 -1
- package/lib/typescript/src/core/mocks/index.d.ts +0 -4
- package/lib/typescript/src/core/mocks/index.d.ts.map +0 -1
- package/lib/typescript/src/createStyleSheet.d.ts +0 -8
- package/lib/typescript/src/createStyleSheet.d.ts.map +0 -1
- package/lib/typescript/src/hooks/index.d.ts +0 -5
- package/lib/typescript/src/hooks/index.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useCSS.d.ts +0 -3
- package/lib/typescript/src/hooks/useCSS.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useCSS.native.d.ts +0 -3
- package/lib/typescript/src/hooks/useCSS.native.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useInitialTheme.d.ts +0 -3
- package/lib/typescript/src/hooks/useInitialTheme.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useUnistyles.d.ts +0 -27
- package/lib/typescript/src/hooks/useUnistyles.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useVariants.d.ts +0 -3
- package/lib/typescript/src/hooks/useVariants.d.ts.map +0 -1
- package/lib/typescript/src/normalizer/index.d.ts +0 -3
- package/lib/typescript/src/normalizer/index.d.ts.map +0 -1
- package/lib/typescript/src/normalizer/normalizeStyle.d.ts +0 -3
- package/lib/typescript/src/normalizer/normalizeStyle.d.ts.map +0 -1
- package/lib/typescript/src/normalizer/normalizer.d.ts +0 -11
- package/lib/typescript/src/normalizer/normalizer.d.ts.map +0 -1
- package/lib/typescript/src/normalizer/normalizer.macos.d.ts +0 -1
- package/lib/typescript/src/normalizer/normalizer.macos.d.ts.map +0 -1
- package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts +0 -3
- package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts.map +0 -1
- package/lib/typescript/src/plugins/index.d.ts +0 -3
- package/lib/typescript/src/plugins/index.d.ts.map +0 -1
- package/lib/typescript/src/plugins/normalizeWebStylesPlugin.d.ts +0 -3
- package/lib/typescript/src/plugins/normalizeWebStylesPlugin.d.ts.map +0 -1
- package/lib/typescript/src/types/color.d.ts +0 -4
- package/lib/typescript/src/types/color.d.ts.map +0 -1
- package/lib/typescript/src/types/normalizer.d.ts +0 -20
- package/lib/typescript/src/types/normalizer.d.ts.map +0 -1
- package/lib/typescript/src/types/plugin.d.ts +0 -7
- package/lib/typescript/src/types/plugin.d.ts.map +0 -1
- package/lib/typescript/src/types/unistyles.d.ts +0 -81
- package/lib/typescript/src/types/unistyles.d.ts.map +0 -1
- package/lib/typescript/src/useStyles.d.ts +0 -16
- package/lib/typescript/src/useStyles.d.ts.map +0 -1
- package/lib/typescript/src/utils/breakpoints.d.ts +0 -3
- package/lib/typescript/src/utils/breakpoints.d.ts.map +0 -1
- package/lib/typescript/src/utils/cssMediaQuery.d.ts +0 -4
- package/lib/typescript/src/utils/cssMediaQuery.d.ts.map +0 -1
- package/lib/typescript/src/utils/generateId.d.ts +0 -2
- package/lib/typescript/src/utils/generateId.d.ts.map +0 -1
- package/lib/typescript/src/utils/hash32.d.ts +0 -2
- package/lib/typescript/src/utils/hash32.d.ts.map +0 -1
- package/lib/typescript/src/utils/index.d.ts +0 -9
- package/lib/typescript/src/utils/index.d.ts.map +0 -1
- package/lib/typescript/src/utils/mq.d.ts.map +0 -1
- package/lib/typescript/src/utils/mqParser.d.ts +0 -16
- package/lib/typescript/src/utils/mqParser.d.ts.map +0 -1
- package/lib/typescript/src/utils/parseColor.d.ts +0 -3
- package/lib/typescript/src/utils/parseColor.d.ts.map +0 -1
- package/lib/typescript/src/utils/styles.d.ts +0 -5
- package/lib/typescript/src/utils/styles.d.ts.map +0 -1
- package/lib/typescript/src/utils/withPlugins.d.ts +0 -3
- package/lib/typescript/src/utils/withPlugins.d.ts.map +0 -1
- package/react-native.config.js +0 -11
- package/src/__tests__/mocks.ts +0 -24
- package/src/core/UnistyleRegistry.ts +0 -130
- package/src/core/Unistyles.ts +0 -44
- package/src/core/UnistylesModule.native.ts +0 -7
- package/src/core/UnistylesModule.ts +0 -305
- package/src/core/UnistylesModule.windows.ts +0 -9
- package/src/core/UnistylesRuntime.ts +0 -284
- package/src/core/index.ts +0 -8
- package/src/core/mocks/UnistylesMockedBridge.ts +0 -30
- package/src/core/mocks/UnistylesMockedRegistry.ts +0 -47
- package/src/core/mocks/UnistylesMockedRuntime.ts +0 -144
- package/src/core/mocks/index.ts +0 -3
- package/src/createStyleSheet.ts +0 -8
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useCSS.native.ts +0 -3
- package/src/hooks/useCSS.ts +0 -51
- package/src/hooks/useInitialTheme.ts +0 -11
- package/src/hooks/useUnistyles.ts +0 -74
- package/src/hooks/useVariants.ts +0 -10
- package/src/normalizer/index.ts +0 -2
- package/src/normalizer/normalizeStyle.ts +0 -82
- package/src/normalizer/normalizer.macos.ts +0 -1
- package/src/normalizer/normalizer.ts +0 -100
- package/src/plugins/cssMediaQueriesPlugin.ts +0 -8
- package/src/plugins/index.ts +0 -2
- package/src/plugins/normalizeWebStylesPlugin.ts +0 -7
- package/src/types/color.ts +0 -26
- package/src/types/normalizer.ts +0 -29
- package/src/types/plugin.ts +0 -7
- package/src/types/unistyles.ts +0 -98
- package/src/useStyles.ts +0 -60
- package/src/utils/breakpoints.ts +0 -44
- package/src/utils/cssMediaQuery.ts +0 -268
- package/src/utils/generateId.ts +0 -10
- package/src/utils/hash32.ts +0 -53
- package/src/utils/index.ts +0 -8
- package/src/utils/mqParser.ts +0 -99
- package/src/utils/parseColor.ts +0 -33
- package/src/utils/styles.ts +0 -90
- package/src/utils/withPlugins.ts +0 -13
- package/windows/ExperimentalFeatures.props +0 -40
- package/windows/NuGet.Config +0 -13
- package/windows/ReactNativeUnistyles/PropertySheet.props +0 -16
- package/windows/ReactNativeUnistyles/ReactNativeUnistyles.def +0 -3
- package/windows/ReactNativeUnistyles/ReactNativeUnistyles.h +0 -149
- package/windows/ReactNativeUnistyles/ReactNativeUnistyles.vcxproj +0 -162
- package/windows/ReactNativeUnistyles/ReactNativeUnistyles.vcxproj.filters +0 -25
- package/windows/ReactNativeUnistyles/ReactPackageProvider.cpp +0 -19
- package/windows/ReactNativeUnistyles/ReactPackageProvider.h +0 -21
- package/windows/ReactNativeUnistyles/ReactPackageProvider.idl +0 -9
- package/windows/ReactNativeUnistyles/packages.lock.json +0 -133
- package/windows/ReactNativeUnistyles/pch.cpp +0 -1
- package/windows/ReactNativeUnistyles/pch.h +0 -21
- package/windows/ReactNativeUnistyles.sln +0 -156
- /package/lib/commonjs/{normalizer → web/convert}/module.d.js +0 -0
- /package/src/{normalizer → web/convert}/module.d.ts +0 -0
@@ -0,0 +1,164 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.UnistylesRuntime = void 0;
|
7
|
+
var _NativePlatform = require("../specs/NativePlatform");
|
8
|
+
var _types = require("../specs/types");
|
9
|
+
var _types2 = require("../types");
|
10
|
+
var _listener = require("./listener");
|
11
|
+
var _mock = require("./mock");
|
12
|
+
var _state = require("./state");
|
13
|
+
var _utils = require("./utils");
|
14
|
+
class UnistylesRuntimeBuilder {
|
15
|
+
lightMedia = this.getLightMedia();
|
16
|
+
darkMedia = this.getDarkMedia();
|
17
|
+
getLightMedia() {
|
18
|
+
if ((0, _utils.isServer)()) {
|
19
|
+
return null;
|
20
|
+
}
|
21
|
+
if (!this.lightMedia) {
|
22
|
+
this.lightMedia = window.matchMedia('(prefers-color-scheme: light)');
|
23
|
+
}
|
24
|
+
return this.lightMedia;
|
25
|
+
}
|
26
|
+
getDarkMedia() {
|
27
|
+
if ((0, _utils.isServer)()) {
|
28
|
+
return null;
|
29
|
+
}
|
30
|
+
if (!this.darkMedia) {
|
31
|
+
this.darkMedia = window.matchMedia('(prefers-color-scheme: dark)');
|
32
|
+
}
|
33
|
+
return this.darkMedia;
|
34
|
+
}
|
35
|
+
get colorScheme() {
|
36
|
+
switch (true) {
|
37
|
+
case this.getLightMedia()?.matches:
|
38
|
+
return _types.ColorScheme.Light;
|
39
|
+
case this.getDarkMedia()?.matches:
|
40
|
+
return _types.ColorScheme.Dark;
|
41
|
+
default:
|
42
|
+
return _types.ColorScheme.Unspecified;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
get themeName() {
|
46
|
+
return _state.UnistylesState.themeName;
|
47
|
+
}
|
48
|
+
get contentSizeCategory() {
|
49
|
+
return _types2.WebContentSizeCategory.Unspecified;
|
50
|
+
}
|
51
|
+
get breakpoint() {
|
52
|
+
return _state.UnistylesState.breakpoint;
|
53
|
+
}
|
54
|
+
get orientation() {
|
55
|
+
if ((0, _utils.isServer)()) {
|
56
|
+
return _types.Orientation.Portrait;
|
57
|
+
}
|
58
|
+
return screen.orientation.type.includes('portrait') ? _types.Orientation.Portrait : _types.Orientation.Landscape;
|
59
|
+
}
|
60
|
+
get theme() {
|
61
|
+
if (!this.themeName) {
|
62
|
+
throw new Error('🦄 No theme selected!');
|
63
|
+
}
|
64
|
+
const theme = _state.UnistylesState.themes.get(this.themeName);
|
65
|
+
if (!theme) {
|
66
|
+
throw new Error(`🦄 Theme "${this.themeName}" is not registered!`);
|
67
|
+
}
|
68
|
+
return theme;
|
69
|
+
}
|
70
|
+
get pixelRatio() {
|
71
|
+
return (0, _utils.isServer)() ? 1 : window.devicePixelRatio;
|
72
|
+
}
|
73
|
+
get screen() {
|
74
|
+
if ((0, _utils.isServer)()) {
|
75
|
+
return {
|
76
|
+
width: 0,
|
77
|
+
height: 0
|
78
|
+
};
|
79
|
+
}
|
80
|
+
return {
|
81
|
+
width: window.innerWidth,
|
82
|
+
height: window.innerHeight
|
83
|
+
};
|
84
|
+
}
|
85
|
+
get fontScale() {
|
86
|
+
return 1;
|
87
|
+
}
|
88
|
+
get insets() {
|
89
|
+
return {
|
90
|
+
top: 0,
|
91
|
+
bottom: 0,
|
92
|
+
left: 0,
|
93
|
+
right: 0,
|
94
|
+
ime: 0
|
95
|
+
};
|
96
|
+
}
|
97
|
+
get statusBar() {
|
98
|
+
return _mock.StatusBar;
|
99
|
+
}
|
100
|
+
get rtl() {
|
101
|
+
return (0, _utils.isServer)() ? true : document.documentElement.dir === 'rtl';
|
102
|
+
}
|
103
|
+
get hasAdaptiveThemes() {
|
104
|
+
return _state.UnistylesState.hasAdaptiveThemes;
|
105
|
+
}
|
106
|
+
get navigationBar() {
|
107
|
+
return _mock.NavigationBar;
|
108
|
+
}
|
109
|
+
get miniRuntime() {
|
110
|
+
return {
|
111
|
+
colorScheme: this.colorScheme,
|
112
|
+
themeName: this.themeName,
|
113
|
+
contentSizeCategory: this.contentSizeCategory,
|
114
|
+
breakpoint: this.breakpoint,
|
115
|
+
orientation: this.orientation,
|
116
|
+
pixelRatio: this.pixelRatio,
|
117
|
+
screen: this.screen,
|
118
|
+
fontScale: this.fontScale,
|
119
|
+
insets: this.insets,
|
120
|
+
statusBar: {
|
121
|
+
width: this.statusBar.width,
|
122
|
+
height: this.statusBar.height
|
123
|
+
},
|
124
|
+
navigationBar: {
|
125
|
+
width: this.navigationBar.width,
|
126
|
+
height: this.navigationBar.height
|
127
|
+
},
|
128
|
+
rtl: this.rtl,
|
129
|
+
hasAdaptiveThemes: this.hasAdaptiveThemes
|
130
|
+
};
|
131
|
+
}
|
132
|
+
setTheme = themeName => {
|
133
|
+
if (themeName === UnistylesRuntime.themeName) {
|
134
|
+
return;
|
135
|
+
}
|
136
|
+
_state.UnistylesState.themeName = themeName;
|
137
|
+
_listener.UnistylesListener.emitChange(_NativePlatform.UnistyleDependency.Theme);
|
138
|
+
_listener.UnistylesListener.emitChange(_NativePlatform.UnistyleDependency.ThemeName);
|
139
|
+
};
|
140
|
+
setAdaptiveThemes = isEnabled => {
|
141
|
+
_state.UnistylesState.hasAdaptiveThemes = isEnabled;
|
142
|
+
if (!isEnabled) {
|
143
|
+
return;
|
144
|
+
}
|
145
|
+
this.setTheme((0, _utils.schemeToTheme)(UnistylesRuntime.colorScheme));
|
146
|
+
};
|
147
|
+
setRootViewBackgroundColor = (hex, alpha) => {
|
148
|
+
if ((0, _utils.isServer)()) {
|
149
|
+
return;
|
150
|
+
}
|
151
|
+
document.documentElement.style.backgroundColor = alpha ? (0, _utils.hexToRGBA)(hex, alpha) : hex;
|
152
|
+
};
|
153
|
+
setImmersiveMode = () => {};
|
154
|
+
updateTheme = (themeName, updater) => {
|
155
|
+
const oldTheme = _state.UnistylesState.themes.get(themeName);
|
156
|
+
if (!oldTheme) {
|
157
|
+
throw new Error(`🦄 Theme "${themeName}" is not registered!`);
|
158
|
+
}
|
159
|
+
_state.UnistylesState.themes.set(themeName, updater(oldTheme));
|
160
|
+
};
|
161
|
+
getSSRUnistyles = () => _state.UnistylesState.tags;
|
162
|
+
}
|
163
|
+
const UnistylesRuntime = exports.UnistylesRuntime = new UnistylesRuntimeBuilder();
|
164
|
+
//# sourceMappingURL=runtime.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_NativePlatform","require","_types","_types2","_listener","_mock","_state","_utils","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","isServer","window","matchMedia","colorScheme","matches","ColorScheme","Light","Dark","Unspecified","themeName","UnistylesState","contentSizeCategory","WebContentSizeCategory","breakpoint","orientation","Orientation","Portrait","screen","type","includes","Landscape","theme","Error","themes","get","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","StatusBar","rtl","document","documentElement","dir","hasAdaptiveThemes","navigationBar","NavigationBar","miniRuntime","setTheme","UnistylesRuntime","UnistylesListener","emitChange","UnistyleDependency","Theme","ThemeName","setAdaptiveThemes","isEnabled","schemeToTheme","setRootViewBackgroundColor","hex","alpha","style","backgroundColor","hexToRGBA","setImmersiveMode","updateTheme","updater","oldTheme","set","getSSRUnistyles","tags","exports"],"sourceRoot":"../../../src","sources":["web/runtime.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAEA,MAAMO,uBAAuB,CAAC;EAC1BC,UAAU,GAAG,IAAI,CAACC,aAAa,CAAC,CAAC;EACjCC,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;EAEvBF,aAAaA,CAAA,EAA0B;IAC3C,IAAI,IAAAG,eAAQ,EAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACJ,UAAU,EAAE;MAClB,IAAI,CAACA,UAAU,GAAGK,MAAM,CAACC,UAAU,CAAC,+BAA+B,CAAC;IACxE;IAEA,OAAO,IAAI,CAACN,UAAU;EAC1B;EAEQG,YAAYA,CAAA,EAA0B;IAC1C,IAAI,IAAAC,eAAQ,EAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACF,SAAS,EAAE;MACjB,IAAI,CAACA,SAAS,GAAGG,MAAM,CAACC,UAAU,CAAC,8BAA8B,CAAC;IACtE;IAEA,OAAO,IAAI,CAACJ,SAAS;EACzB;EAEA,IAAIK,WAAWA,CAAA,EAAG;IACd,QAAQ,IAAI;MACR,KAAK,IAAI,CAACN,aAAa,CAAC,CAAC,EAAEO,OAAO;QAC9B,OAAOC,kBAAW,CAACC,KAAK;MAC5B,KAAK,IAAI,CAACP,YAAY,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AEyD,OAAO,CAACC,QAAQ,CAAC,CAAC;EAC3D,CAAC;EAEDE,eAAe,GAAGA,CAAA,KAAM3D,qBAAc,CAAC4D,IAAI;AAC/C;AAEO,MAAMrB,gBAAgB,GAAAsB,OAAA,CAAAtB,gBAAA,GAAG,IAAItD,uBAAuB,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.UnistylesState = void 0;
|
7
|
+
var _react = require("react");
|
8
|
+
var _runtime = require("./runtime");
|
9
|
+
var _utils = require("./utils");
|
10
|
+
var _listener = require("./listener");
|
11
|
+
var _NativePlatform = require("../specs/NativePlatform");
|
12
|
+
class UnistylesStateBuilder {
|
13
|
+
isSSR = (0, _utils.isServer)();
|
14
|
+
tags = [];
|
15
|
+
themes = new Map();
|
16
|
+
hasAdaptiveThemes = false;
|
17
|
+
init = config => {
|
18
|
+
this.initThemes(config.themes);
|
19
|
+
this.initBreakpoints(config.breakpoints);
|
20
|
+
this.initSettings(config.settings);
|
21
|
+
if (this.isSSR) {
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
_listener.UnistylesListener.initListeners();
|
25
|
+
};
|
26
|
+
initThemes = (themes = {}) => {
|
27
|
+
Object.entries(themes).forEach(([themeName, theme]) => {
|
28
|
+
this.themes.set(themeName, theme);
|
29
|
+
});
|
30
|
+
};
|
31
|
+
initSettings = settings => {
|
32
|
+
this.hasAdaptiveThemes = settings?.adaptiveThemes ?? false;
|
33
|
+
const themeNames = Array.from(this.themes.keys());
|
34
|
+
|
35
|
+
// Single theme + no settings
|
36
|
+
if (!settings?.adaptiveThemes && !settings?.initialTheme && themeNames.length === 1) {
|
37
|
+
this.themeName = themeNames[0];
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
|
41
|
+
// No settings
|
42
|
+
if (!settings?.adaptiveThemes && !settings?.initialTheme) {
|
43
|
+
throw new Error('🦄 You need to specify either "initialTheme" or "adaptiveThemes" in your config');
|
44
|
+
}
|
45
|
+
|
46
|
+
// Adaptive themes
|
47
|
+
if (settings.adaptiveThemes) {
|
48
|
+
this.themeName = (0, _utils.schemeToTheme)(_runtime.UnistylesRuntime.colorScheme);
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
|
52
|
+
// Initial theme
|
53
|
+
this.themeName = typeof settings.initialTheme === 'function' ? settings.initialTheme() : settings.initialTheme;
|
54
|
+
};
|
55
|
+
initBreakpoints = (breakpoints = {}) => {
|
56
|
+
const breakpointsMap = new Map();
|
57
|
+
this.breakpoints = breakpoints;
|
58
|
+
Object.entries(breakpoints).sort(([, a], [, b]) => a - b).forEach(([breakpoint, value]) => {
|
59
|
+
if ((0, _utils.isServer)()) {
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
const mediaQuery = window.matchMedia(`(min-width: ${value}px)`);
|
63
|
+
breakpointsMap.set(breakpoint, mediaQuery);
|
64
|
+
if (mediaQuery.matches) {
|
65
|
+
this.breakpoint = breakpoint;
|
66
|
+
}
|
67
|
+
mediaQuery.addEventListener('change', event => {
|
68
|
+
if (!event.matches) {
|
69
|
+
const [currentBreakpoint] = Array.from(breakpointsMap).find(([, mq]) => mq.matches) ?? [];
|
70
|
+
if (currentBreakpoint) {
|
71
|
+
this.breakpoint = currentBreakpoint;
|
72
|
+
_listener.UnistylesListener.emitChange(_NativePlatform.UnistyleDependency.Breakpoints);
|
73
|
+
}
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
this.breakpoint = breakpoint;
|
77
|
+
_listener.UnistylesListener.emitChange(_NativePlatform.UnistyleDependency.Breakpoints);
|
78
|
+
});
|
79
|
+
});
|
80
|
+
};
|
81
|
+
createTag() {
|
82
|
+
if (!this.isSSR) {
|
83
|
+
const tag = document.createElement('style');
|
84
|
+
document.head.appendChild(tag);
|
85
|
+
return tag;
|
86
|
+
}
|
87
|
+
const tagRef = new Proxy(/*#__PURE__*/(0, _react.createRef)(), {
|
88
|
+
set: (target, prop, value) => {
|
89
|
+
// When ref is assigned
|
90
|
+
if ('textContent' in value) {
|
91
|
+
value.textContent = tag.textContent;
|
92
|
+
}
|
93
|
+
return Reflect.set(target, prop, value);
|
94
|
+
}
|
95
|
+
});
|
96
|
+
const tagElement = /*#__PURE__*/(0, _react.createElement)('style', {
|
97
|
+
ref: tagRef,
|
98
|
+
key: this.tags.length
|
99
|
+
}, '');
|
100
|
+
const tag = new Proxy({
|
101
|
+
textContent: ''
|
102
|
+
}, {
|
103
|
+
set: (target, prop, value) => {
|
104
|
+
if (prop !== 'textContent') {
|
105
|
+
return false;
|
106
|
+
}
|
107
|
+
|
108
|
+
// When css is updated
|
109
|
+
target.textContent = value;
|
110
|
+
if (tagRef.current) {
|
111
|
+
tagRef.current.textContent = value;
|
112
|
+
}
|
113
|
+
return true;
|
114
|
+
}
|
115
|
+
});
|
116
|
+
this.tags.push(tagElement);
|
117
|
+
return tag;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
const UnistylesState = exports.UnistylesState = new UnistylesStateBuilder();
|
121
|
+
//# sourceMappingURL=state.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_react","require","_runtime","_utils","_listener","_NativePlatform","UnistylesStateBuilder","isSSR","isServer","tags","themes","Map","hasAdaptiveThemes","init","config","initThemes","initBreakpoints","breakpoints","initSettings","settings","UnistylesListener","initListeners","Object","entries","forEach","themeName","theme","set","adaptiveThemes","themeNames","Array","from","keys","initialTheme","length","Error","schemeToTheme","UnistylesRuntime","colorScheme","breakpointsMap","sort","a","b","breakpoint","value","mediaQuery","window","matchMedia","matches","addEventListener","event","currentBreakpoint","find","mq","emitChange","UnistyleDependency","Breakpoints","createTag","tag","document","createElement","head","appendChild","tagRef","Proxy","createRef","target","prop","textContent","Reflect","tagElement","ref","key","current","push","UnistylesState","exports"],"sourceRoot":"../../../src","sources":["web/state.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,O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AAE;MACvCzC,GAAG,EAAEA,CAACuC,MAAM,EAAEC,IAAI,EAAEvB,KAAK,KAAK;QAC1B,IAAIuB,IAAI,KAAK,aAAa,EAAE;UACxB,OAAO,KAAK;QAChB;;QAEA;QACAD,MAAM,CAACE,WAAW,GAAGxB,KAAK;QAE1B,IAAImB,MAAM,CAACU,OAAO,EAAE;UAChBV,MAAM,CAACU,OAAO,CAACL,WAAW,GAAGxB,KAAK;QACtC;QAEA,OAAO,IAAI;MACf;IACJ,CAAC,CAAC;IAEF,IAAI,CAACnC,IAAI,CAACiE,IAAI,CAACJ,UAAU,CAAC;IAE1B,OAAOZ,GAAG;EACd;AACJ;AAEO,MAAMiB,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAIrE,qBAAqB,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.warn = exports.toReactNativeClassName = exports.schemeToTheme = exports.reduceObject = exports.keyInObject = exports.isServer = exports.hexToRGBA = exports.equal = exports.deepMergeObjects = void 0;
|
7
|
+
var _types = require("../specs/types");
|
8
|
+
const reduceObject = (obj, reducer) => Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, reducer(value, key)]));
|
9
|
+
exports.reduceObject = reduceObject;
|
10
|
+
const toReactNativeClassName = (className, values) => {
|
11
|
+
const returnValue = className ? {
|
12
|
+
$$css: true,
|
13
|
+
[className]: className
|
14
|
+
} : {};
|
15
|
+
Object.defineProperties(returnValue, reduceObject(values, value => ({
|
16
|
+
value,
|
17
|
+
enumerable: false,
|
18
|
+
configurable: true
|
19
|
+
})));
|
20
|
+
return returnValue;
|
21
|
+
};
|
22
|
+
exports.toReactNativeClassName = toReactNativeClassName;
|
23
|
+
const keyInObject = (obj, key) => key in obj;
|
24
|
+
exports.keyInObject = keyInObject;
|
25
|
+
const schemeToTheme = scheme => {
|
26
|
+
switch (scheme) {
|
27
|
+
case _types.ColorScheme.Dark:
|
28
|
+
return 'dark';
|
29
|
+
case _types.ColorScheme.Light:
|
30
|
+
default:
|
31
|
+
return 'light';
|
32
|
+
}
|
33
|
+
};
|
34
|
+
exports.schemeToTheme = schemeToTheme;
|
35
|
+
const hexToRGBA = (hex, opacity) => hex.replace('#', '').split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num)).reduce((acc, color) => `${acc}${color},`, 'rgba(').concat(`${opacity})`);
|
36
|
+
exports.hexToRGBA = hexToRGBA;
|
37
|
+
const isServer = () => typeof window === 'undefined';
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Deeply merges properties of passed object
|
41
|
+
*/
|
42
|
+
exports.isServer = isServer;
|
43
|
+
const deepMergeObjects = (...sources) => {
|
44
|
+
const target = {};
|
45
|
+
sources.forEach(source => {
|
46
|
+
Object.keys(source).forEach(key => {
|
47
|
+
const sourceValue = source[key];
|
48
|
+
const targetValue = target[key];
|
49
|
+
if (Object(sourceValue) == sourceValue && Object(targetValue) === targetValue) {
|
50
|
+
// @ts-expect-error - can't assign to generic
|
51
|
+
target[key] = deepMergeObjects(targetValue, sourceValue);
|
52
|
+
return;
|
53
|
+
}
|
54
|
+
|
55
|
+
// @ts-expect-error - can't assign to generic
|
56
|
+
target[key] = sourceValue;
|
57
|
+
});
|
58
|
+
});
|
59
|
+
return target;
|
60
|
+
};
|
61
|
+
exports.deepMergeObjects = deepMergeObjects;
|
62
|
+
const warn = message => console.warn(`🦄 [react-native-unistyles] ${message}`);
|
63
|
+
exports.warn = warn;
|
64
|
+
const equal = (a, b) => {
|
65
|
+
if (Object.is(a, b)) {
|
66
|
+
return true;
|
67
|
+
}
|
68
|
+
if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) {
|
69
|
+
return false;
|
70
|
+
}
|
71
|
+
const keysA = Object.keys(a);
|
72
|
+
if (keysA.length !== Object.keys(b).length) {
|
73
|
+
return false;
|
74
|
+
}
|
75
|
+
return keysA.every(key => Object.is(a[key], b[key]) && Object.prototype.hasOwnProperty.call(b, key));
|
76
|
+
};
|
77
|
+
exports.equal = equal;
|
78
|
+
//# sourceMappingURL=utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_types","require","reduceObject","obj","reducer","Object","fromEntries","entries","map","key","value","exports","toReactNativeClassName","className","values","returnValue","$$css","defineProperties","enumerable","configurable","keyInObject","schemeToTheme","scheme","ColorScheme","Dark","Light","hexToRGBA","hex","opacity","replace","split","x","parseInt","filter","num","isNaN","reduce","acc","color","concat","isServer","window","deepMergeObjects","sources","target","forEach","source","keys","sourceValue","targetValue","warn","message","console","equal","a","b","is","keysA","length","every","prototype","hasOwnProperty","call"],"sourceRoot":"../../../src","sources":["web/utils.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGO,MAAMC,YAAY,GAAGA,CACxBC,GAAS,EACTC,OAA+D,KAC9DC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACJ,GAAG,CAAC,CAACK,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK,CAACD,GAAG,EAAEL,OAAO,CAACM,KAAK,EAAsBD,GAAG,CAAC,CAAC,CAAC,CAAoC;AAAAE,OAAA,CAAAT,YAAA,GAAAA,YAAA;AAE9I,MAAMU,sBAAsB,GAAGA,CAACC,SAAwB,EAAEC,MAAuB,KAAK;EACzF,MAAMC,WAAW,GAAGF,SAAS,GAAG;IAC5BG,KAAK,EAAE,IAAI;IACX,CAACH,SAAS,GAAGA;EACjB,CAAC,GAAG,CAAC,CAAC;EAENR,MAAM,CAACY,gBAAgB,CAACF,WAAW,EAAEb,YAAY,CAACY,MAAM,EAAEJ,KAAK,KAAK;IAChEA,KAAK;IACLQ,UAAU,EAAE,KAAK;IACjBC,YAAY,EAAE;EAClB,CAAC,CAAC,CAAC,CAAC;EAEJ,OAAOJ,WAAW;AACtB,C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,IAAIJ,MAAM,CAACuD,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAE9C,GAAG,CAAC,CAAC;AACxG,CAAC;AAAAE,OAAA,CAAA0C,KAAA,GAAAA,KAAA","ignoreList":[]}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.getVariants = void 0;
|
7
|
+
var _utils = require("../utils");
|
8
|
+
const hasVariants = value => 'variants' in value[1];
|
9
|
+
const getVariants = (styles, selectedVariants) => {
|
10
|
+
return Object.entries(styles).filter(hasVariants).filter(([_key, {
|
11
|
+
variants
|
12
|
+
}]) => Object.keys(variants).some(variant => variant in variants)).map(([key, {
|
13
|
+
variants,
|
14
|
+
compoundVariants = []
|
15
|
+
}]) => {
|
16
|
+
const variantStyles = Object.entries(variants).flatMap(([variant, styles]) => {
|
17
|
+
const selectedVariant = selectedVariants[variant];
|
18
|
+
const selectedVariantStyles = styles[selectedVariant] ?? styles['default'];
|
19
|
+
if (!selectedVariantStyles) {
|
20
|
+
return [];
|
21
|
+
}
|
22
|
+
return selectedVariantStyles;
|
23
|
+
});
|
24
|
+
const compoundVariantStyles = compoundVariants.flatMap(compoundVariant => {
|
25
|
+
const {
|
26
|
+
styles,
|
27
|
+
...conditions
|
28
|
+
} = compoundVariant;
|
29
|
+
if (Object.entries(conditions).some(([variant, value]) => String(selectedVariants[variant]) !== String(value))) {
|
30
|
+
return [];
|
31
|
+
}
|
32
|
+
return styles;
|
33
|
+
});
|
34
|
+
const mergedVariantStyles = (0, _utils.deepMergeObjects)(...variantStyles, ...compoundVariantStyles);
|
35
|
+
return [key, mergedVariantStyles];
|
36
|
+
});
|
37
|
+
};
|
38
|
+
exports.getVariants = getVariants;
|
39
|
+
//# sourceMappingURL=getVariants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_utils","require","hasVariants","value","getVariants","styles","selectedVariants","Object","entries","filter","_key","variants","keys","some","variant","map","key","compoundVariants","variantStyles","flatMap","selectedVariant","selectedVariantStyles","compoundVariantStyles","compoundVariant","conditions","String","mergedVariantStyles","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/variants/getVariants.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAQA,MAAMC,WAAW,GAAsBC,KAAkB,IAAgD,UAAU,IAAIA,KAAK,CAAC,CAAC,CAAC;AAExH,MAAMC,WAAW,GAAGA,CAACC,MAAyC,EAAEC,gBAAqC,KAAK;EAC7G,OAAOC,MAAM,CAACC,OAAO,CAACH,MAAM,CAAC,CACxBI,MAAM,CAACP,WAAW,CAAC,CACnBO,MAAM,CAAC,CAAC,CAACC,IAAI,EAAE;IAAEC;EAAS,CAAC,CAAC,KAAKJ,MAAM,CAACK,IAAI,CAACD,QAAQ,CAAC,CAACE,IAAI,CAACC,OAAO,IAAIA,OAAO,IAAIH,QAAQ,CAAC,CAAC,CAC5FI,GAAG,CAAC,CAAC,CAACC,GAAG,EAAE;IAAEL,QAAQ;IAAEM,gBAAgB,GAAG;EAAG,CAAC,CAAC,KAAK;IACjD,MAAMC,aAAa,GAAGX,MAAM,CAACC,OAAO,CAACG,QAAQ,CAAC,CAACQ,OAAO,CAAC,CAAC,CAACL,OAAO,EAAET,MAAM,CAAC,KAAK;MAC1E,MAAMe,eAAe,GAAGd,gBAAgB,CAACQ,OAAO,CAAC;MACjD,MAAMO,qBAAqB,GAAGhB,MAAM,CAACe,eAAe,CAAC,IAAIf,MAAM,CAAC,SAAS,CAAC;MAE1E,IAAI,CAACgB,qBAAqB,EAAE;QACxB,OAAO,EAAE;MACb;MAEA,OAAOA,qBAAqB;IAChC,CAAC,CAAC;IAEF,MAAMC,qBAAqB,GAAGL,gBAAgB,CAACE,OAAO,CAACI,eAAe,IAAI;MACtE,MAAM;QAAElB,MAAM;QAAE,GAAGmB;MAAW,CAAC,GAAGD,eAAe;MAEjD,IAAIhB,MAAM,CAACC,OAAO,CAACgB,UAAU,CAAC,CAACX,IAAI,CAAC,CAAC,CAACC,OAAO,EAAEX,KAAK,CAAC,KAAKsB,MAAM,CAACnB,gBAAgB,CAACQ,OAAO,CAAC,CAAC,KAAKW,MAAM,CAACtB,KAAK,CAAC,CAAC,EAAE;QAC5G,OAAO,EAAE;MACb;MAEA,OAAOE,MAAM;IACjB,CAAC,CAAC;IAEF,MAAMqB,mBAAmB,GAAG,IAAAC,uBAAgB,EAAC,GAAGT,aAAa,EAAE,GAAGI,qBAAqB,CAAC;IAExF,OAAO,CAACN,GAAG,EAAEU,mBAAmB,CAAC;EACrC,CAAC,CAAC;AACV,CAAC;AAAAE,OAAA,CAAAxB,WAAA,GAAAA,WAAA","ignoreList":[]}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
var _useVariants = require("./useVariants");
|
7
|
+
Object.keys(_useVariants).forEach(function (key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (key in exports && exports[key] === _useVariants[key]) return;
|
10
|
+
Object.defineProperty(exports, key, {
|
11
|
+
enumerable: true,
|
12
|
+
get: function () {
|
13
|
+
return _useVariants[key];
|
14
|
+
}
|
15
|
+
});
|
16
|
+
});
|
17
|
+
var _getVariants = require("./getVariants");
|
18
|
+
Object.keys(_getVariants).forEach(function (key) {
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
20
|
+
if (key in exports && exports[key] === _getVariants[key]) return;
|
21
|
+
Object.defineProperty(exports, key, {
|
22
|
+
enumerable: true,
|
23
|
+
get: function () {
|
24
|
+
return _getVariants[key];
|
25
|
+
}
|
26
|
+
});
|
27
|
+
});
|
28
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_useVariants","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_getVariants"],"sourceRoot":"../../../../src","sources":["web/variants/index.ts"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,YAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,YAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,YAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,YAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,YAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createUseVariants = void 0;
|
7
|
+
var _react = require("react");
|
8
|
+
var _utils = require("../utils");
|
9
|
+
var _registry = require("../registry");
|
10
|
+
var _getVariants = require("./getVariants");
|
11
|
+
const createUseVariants = (styles, setSelectedVariants) => {
|
12
|
+
const useVariants = selectedVariants => {
|
13
|
+
const [unistylesMap] = (0, _react.useState)(() => new Map());
|
14
|
+
const [classNameMap] = (0, _react.useState)(() => new Map());
|
15
|
+
const [selectedVariantStylesMap] = (0, _react.useState)(() => new Map());
|
16
|
+
const lastSelectedVariantsRef = (0, _react.useRef)();
|
17
|
+
// Variable that determines if variants have changed and we need to recalculate styles
|
18
|
+
const variantsChanged = !(0, _utils.equal)(lastSelectedVariantsRef.current, selectedVariants);
|
19
|
+
if (variantsChanged) {
|
20
|
+
lastSelectedVariantsRef.current = selectedVariants;
|
21
|
+
setSelectedVariants(selectedVariants);
|
22
|
+
}
|
23
|
+
const combinedVariantStyles = (0, _react.useMemo)(() => {
|
24
|
+
const result = (0, _getVariants.getVariants)(styles, selectedVariants);
|
25
|
+
result.forEach(([key, value]) => {
|
26
|
+
selectedVariantStylesMap.set(key, value);
|
27
|
+
});
|
28
|
+
return result;
|
29
|
+
}, [lastSelectedVariantsRef.current]);
|
30
|
+
if (unistylesMap.size === 0 && combinedVariantStyles.length > 0) {
|
31
|
+
combinedVariantStyles.forEach(([key, value]) => {
|
32
|
+
const {
|
33
|
+
className,
|
34
|
+
unistyles
|
35
|
+
} = _registry.UnistylesRegistry.createStyles(value, `variant-${key}`);
|
36
|
+
unistylesMap.set(key, unistyles);
|
37
|
+
classNameMap.set(key, className);
|
38
|
+
});
|
39
|
+
}
|
40
|
+
combinedVariantStyles.forEach(([key, value]) => {
|
41
|
+
const styleEntry = styles[key];
|
42
|
+
const unistyles = unistylesMap.get(key);
|
43
|
+
const className = classNameMap.get(key);
|
44
|
+
const selectedVariantStyles = selectedVariantStylesMap.get(key);
|
45
|
+
if (!unistyles || !className) {
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
if (variantsChanged) {
|
49
|
+
_registry.UnistylesRegistry.updateStyles(unistyles, value, className);
|
50
|
+
}
|
51
|
+
Object.defineProperties(styleEntry, (0, _utils.reduceObject)(selectedVariantStyles ?? {}, value => ({
|
52
|
+
value,
|
53
|
+
enumerable: false,
|
54
|
+
configurable: true
|
55
|
+
})));
|
56
|
+
if (styleEntry) {
|
57
|
+
Object.keys(styleEntry ?? {}).forEach(key => {
|
58
|
+
if (!key.startsWith('variant-')) {
|
59
|
+
return;
|
60
|
+
}
|
61
|
+
|
62
|
+
// @ts-expect-error - remove old variants
|
63
|
+
delete styleEntry[key];
|
64
|
+
});
|
65
|
+
// @ts-expect-error - apply variant className
|
66
|
+
styleEntry[className] = className;
|
67
|
+
}
|
68
|
+
});
|
69
|
+
};
|
70
|
+
Object.defineProperty(styles, 'useVariants', {
|
71
|
+
value: useVariants
|
72
|
+
});
|
73
|
+
};
|
74
|
+
exports.createUseVariants = createUseVariants;
|
75
|
+
//# sourceMappingURL=useVariants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_react","require","_utils","_registry","_getVariants","createUseVariants","styles","setSelectedVariants","useVariants","selectedVariants","unistylesMap","useState","Map","classNameMap","selectedVariantStylesMap","lastSelectedVariantsRef","useRef","variantsChanged","equal","current","combinedVariantStyles","useMemo","result","getVariants","forEach","key","value","set","size","length","className","unistyles","UnistylesRegistry","createStyles","styleEntry","get","selectedVariantStyles","updateStyles","Object","defineProperties","reduceObject","enumerable","configurable","keys","startsWith","defineProperty","exports"],"sourceRoot":"../../../../src","sources":["web/variants/useVariants.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAEO,MAAMI,iBAAiB,GAAGA,CAACC,MAAyC,EAAEC,mBAA4D,KAAK;EAC1I,MAAMC,WAAW,GAAIC,gBAAqC,IAAK;IAC3D,MAAM,CAACC,YAAY,CAAC,GAAG,IAAAC,eAAQ,EAAC,MAAM,IAAIC,GAAG,CAAoB,CAAC,CAAC;IACnE,MAAM,CAACC,YAAY,CAAC,GAAG,IAAAF,eAAQ,EAAC,MAAM,IAAIC,GAAG,CAAiB,CAAC,CAAC;IAChE,MAAM,CAACE,wBAAwB,CAAC,GAAG,IAAAH,eAAQ,EAAC,MAAM,IAAIC,GAAG,CAA8B,CAAC,CAAC;IACzF,MAAMG,uBAAuB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,MAAMK,SAAS,GAAGjB,YAAY,CAACsB,GAAG,CAACV,GAAG,CAAC;MACvC,MAAMW,qBAAqB,GAAGtB,wBAAwB,CAACqB,GAAG,CAACV,GAAG,CAAC;MAE/D,IAAI,CAACM,SAAS,IAAI,CAACD,SAAS,EAAE;QAC1B;MACJ;MAEA,IAAIb,eAAe,EAAE;QACjBe,2BAAiB,CAACK,YAAY,CAACN,SAAS,EAAEL,KAAK,EAAEI,SAAS,CAAC;MAC/D;MAEAQ,MAAM,CAACC,gBAAgB,CAACL,UAAU,EAAE,IAAAM,mBAAY,EAACJ,qBAAqB,IAAI,CAAC,CAAC,EAAEV,KAAK,KAAK;QACpFA,KAAK;QACLe,UAAU,EAAE,KAAK;QACjBC,YAAY,EAAE;MAClB,CAAC,CAAC,CAAC,CAAC;MAEJ,IAAIR,UAAU,EAAE;QACZI,MAAM,CAACK,IAAI,CAACT,UAAU,IAAI,CAAC,CAAC,CAAC,CAACV,OAAO,CAACC,GAAG,IAAI;UACzC,IAAI,CAACA,GAAG,CAACmB,UAAU,CAAC,UAAU,CAAC,EAAE;YAC7B;UACJ;;UAEA;UACA,OAAOV,UAAU,CAACT,GAAG,CAAC;QAC1B,CAAC,CAAC;QACF;QACAS,UAAU,CAACJ,SAAS,CAAC,GAAGA,SAAS;MACrC;IACJ,CAAC,CAAC;EACN,CAAC;EAEDQ,MAAM,CAACO,cAAc,CAACvC,MAAM,EAAE,aAAa,EAAE;IACzCoB,KAAK,EAAElB;EACX,CAAC,CAAC;AACN,CAAC;AAAAsC,OAAA,CAAAzC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
package/lib/module/common.js
CHANGED
@@ -1,61 +1,7 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
1
3
|
import { Platform } from 'react-native';
|
2
|
-
export const warn = message => {
|
3
|
-
console.warn(`🦄 [react-native-unistyles]: ${message}`);
|
4
|
-
};
|
5
4
|
export const isWeb = Platform.OS === 'web';
|
6
5
|
export const isIOS = Platform.OS === 'ios';
|
7
6
|
export const isAndroid = Platform.OS === 'android';
|
8
|
-
export const isMobile = isIOS || isAndroid;
|
9
|
-
export const isServer = typeof window === 'undefined';
|
10
|
-
export const isDev = process.env.NODE_ENV !== 'production';
|
11
|
-
export const isTest = process.env.NODE_ENV === 'test' || process.env.JEST_WORKER_ID !== undefined || typeof jest !== 'undefined';
|
12
|
-
export const ScreenOrientation = {
|
13
|
-
Landscape: 'landscape',
|
14
|
-
Portrait: 'portrait'
|
15
|
-
};
|
16
|
-
export let IOSContentSizeCategory = /*#__PURE__*/function (IOSContentSizeCategory) {
|
17
|
-
IOSContentSizeCategory["AccessibilityExtraExtraExtraLarge"] = "accessibilityExtraExtraExtraLarge";
|
18
|
-
IOSContentSizeCategory["AccessibilityExtraExtraLarge"] = "accessibilityExtraExtraLarge";
|
19
|
-
IOSContentSizeCategory["AccessibilityExtraLarge"] = "accessibilityExtraLarge";
|
20
|
-
IOSContentSizeCategory["AccessibilityLarge"] = "accessibilityLarge";
|
21
|
-
IOSContentSizeCategory["AccessibilityMedium"] = "accessibilityMedium";
|
22
|
-
IOSContentSizeCategory["ExtraExtraExtraLarge"] = "xxxLarge";
|
23
|
-
IOSContentSizeCategory["ExtraExtraLarge"] = "xxLarge";
|
24
|
-
IOSContentSizeCategory["ExtraLarge"] = "xLarge";
|
25
|
-
IOSContentSizeCategory["Large"] = "Large";
|
26
|
-
IOSContentSizeCategory["Medium"] = "Medium";
|
27
|
-
IOSContentSizeCategory["Small"] = "Small";
|
28
|
-
IOSContentSizeCategory["ExtraSmall"] = "xSmall";
|
29
|
-
IOSContentSizeCategory["Unspecified"] = "unspecified";
|
30
|
-
return IOSContentSizeCategory;
|
31
|
-
}({});
|
32
|
-
export let AndroidContentSizeCategory = /*#__PURE__*/function (AndroidContentSizeCategory) {
|
33
|
-
AndroidContentSizeCategory["Small"] = "Small";
|
34
|
-
AndroidContentSizeCategory["Default"] = "Default";
|
35
|
-
AndroidContentSizeCategory["Large"] = "Large";
|
36
|
-
AndroidContentSizeCategory["ExtraLarge"] = "ExtraLarge";
|
37
|
-
AndroidContentSizeCategory["Huge"] = "Huge";
|
38
|
-
AndroidContentSizeCategory["ExtraHuge"] = "ExtraHuge";
|
39
|
-
AndroidContentSizeCategory["ExtraExtraHuge"] = "ExtraExtraHuge";
|
40
|
-
return AndroidContentSizeCategory;
|
41
|
-
}({});
|
42
|
-
export let UnistylesEventType = /*#__PURE__*/function (UnistylesEventType) {
|
43
|
-
UnistylesEventType["Theme"] = "theme";
|
44
|
-
UnistylesEventType["Layout"] = "layout";
|
45
|
-
UnistylesEventType["Plugin"] = "plugin";
|
46
|
-
return UnistylesEventType;
|
47
|
-
}({});
|
48
|
-
export let UnistylesError = /*#__PURE__*/function (UnistylesError) {
|
49
|
-
UnistylesError["RuntimeUnavailable"] = "Unistyles runtime is not available. Make sure you followed the installation instructions";
|
50
|
-
UnistylesError["ThemeNotFound"] = "You are trying to get a theme that is not registered with UnistylesRegistry";
|
51
|
-
UnistylesError["ThemeNotRegistered"] = "You are trying to set a theme that was not registered with UnistylesRegistry";
|
52
|
-
UnistylesError["ThemeNotSelected"] = "Your themes are registered, but you didn't select the initial theme";
|
53
|
-
UnistylesError["ThemesCannotBeEmpty"] = "You are trying to register empty themes object";
|
54
|
-
UnistylesError["BreakpointsCannotBeEmpty"] = "You are trying to register empty breakpoints object";
|
55
|
-
UnistylesError["BreakpointsMustStartFromZero"] = "You are trying to register breakpoints that don't start from 0";
|
56
|
-
UnistylesError["InvalidPluginName"] = "Plugin name can't start from reserved prefix __unistyles";
|
57
|
-
UnistylesError["DuplicatePluginName"] = "You are trying to register a plugin with a name that is already registered";
|
58
|
-
UnistylesError["CantRemoveInternalPlugin"] = "You are trying to remove an internal unistyles plugin";
|
59
|
-
return UnistylesError;
|
60
|
-
}({});
|
61
7
|
//# sourceMappingURL=common.js.map
|
package/lib/module/common.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Platform","
|
1
|
+
{"version":3,"names":["Platform","isWeb","OS","isIOS","isAndroid"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,KAAK,GAAGD,QAAQ,CAACE,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAMC,KAAK,GAAGH,QAAQ,CAACE,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAME,SAAS,GAAGJ,QAAQ,CAACE,EAAE,KAAK,SAAS","ignoreList":[]}
|
package/lib/module/global.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
//# sourceMappingURL=global.js.map
|