react-native-unistyles 3.0.0-alpha.4 → 3.0.0-alpha.41
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -0
- package/Unistyles.podspec +1 -1
- package/android/CMakeLists.txt +22 -45
- package/android/build.gradle +16 -5
- package/android/src/main/cxx/NativeUnistylesModule.cpp +71 -0
- package/android/src/main/cxx/NativeUnistylesModule.h +42 -0
- package/android/src/main/cxx/cpp-adapter.cpp +8 -86
- package/android/src/main/java/com/unistyles/Equatable.kt +61 -0
- package/android/src/main/java/com/unistyles/NativePlatform+android.kt +294 -0
- package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +152 -0
- package/android/src/main/java/com/unistyles/NativePlatform+listener.kt +59 -0
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +51 -0
- package/android/src/main/java/com/unistyles/UnistylesPackage.kt +16 -14
- package/cxx/NativePlatform.h +11 -0
- package/cxx/common/Constants.h +4 -0
- package/cxx/common/Helpers.h +140 -5
- package/cxx/core/HostStyle.cpp +10 -6
- package/cxx/core/HostStyle.h +4 -0
- package/cxx/core/StyleSheet.h +0 -2
- package/cxx/core/StyleSheetRegistry.cpp +9 -17
- package/cxx/core/StyleSheetRegistry.h +3 -4
- package/cxx/core/Unistyle.h +8 -11
- package/cxx/core/UnistyleData.h +24 -0
- package/cxx/core/UnistyleWrapper.h +108 -13
- package/cxx/core/UnistylesCommitHook.cpp +14 -15
- package/cxx/core/UnistylesCommitHook.h +6 -11
- package/cxx/core/UnistylesCommitShadowNode.h +13 -0
- package/cxx/core/UnistylesMountHook.cpp +28 -0
- package/cxx/core/UnistylesMountHook.h +27 -0
- package/cxx/core/UnistylesRegistry.cpp +123 -83
- package/cxx/core/UnistylesRegistry.h +16 -14
- package/cxx/core/UnistylesState.cpp +29 -8
- package/cxx/core/UnistylesState.h +5 -2
- package/cxx/hybridObjects/HybridNavigationBar.cpp +0 -4
- package/cxx/hybridObjects/HybridNavigationBar.h +3 -4
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +19 -11
- package/cxx/hybridObjects/HybridStatusBar.cpp +0 -4
- package/cxx/hybridObjects/HybridStatusBar.h +3 -4
- package/cxx/hybridObjects/HybridStyleSheet.cpp +154 -23
- package/cxx/hybridObjects/HybridStyleSheet.h +27 -5
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +96 -14
- package/cxx/hybridObjects/HybridUnistylesRuntime.h +19 -3
- package/cxx/parser/Parser.cpp +249 -177
- package/cxx/parser/Parser.h +12 -15
- package/cxx/shadowTree/ShadowLeafUpdate.h +3 -1
- package/cxx/shadowTree/ShadowTrafficController.h +71 -0
- package/cxx/shadowTree/ShadowTreeManager.cpp +28 -19
- package/cxx/shadowTree/ShadowTreeManager.h +3 -2
- package/ios/Equatable.swift +2 -1
- package/ios/Extensions.swift +3 -1
- package/ios/NativePlatform+ios.swift +34 -9
- package/ios/NativePlatform+keyboard.swift +83 -0
- package/ios/NativePlatformListener+ios.swift +36 -24
- package/ios/Unistyles.h +1 -0
- package/ios/UnistylesModuleOnLoad.h +8 -2
- package/ios/UnistylesModuleOnLoad.mm +9 -1
- package/lib/commonjs/components/Display.js +18 -0
- package/lib/commonjs/components/Display.js.map +1 -0
- package/lib/commonjs/components/Hide.js +18 -0
- package/lib/commonjs/components/Hide.js.map +1 -0
- package/lib/commonjs/components/index.js +20 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/components/useMedia.js +59 -0
- package/lib/commonjs/components/useMedia.js.map +1 -0
- package/lib/commonjs/components/useMedia.web.js +43 -0
- package/lib/commonjs/components/useMedia.web.js.map +1 -0
- package/lib/commonjs/core/createUnistylesComponent.js +79 -0
- package/lib/commonjs/core/createUnistylesComponent.js.map +1 -0
- package/lib/commonjs/core/createUnistylesComponent.native.js +82 -0
- package/lib/commonjs/core/createUnistylesComponent.native.js.map +1 -0
- package/lib/commonjs/core/index.js +13 -0
- package/lib/commonjs/core/index.js.map +1 -0
- package/lib/commonjs/index.js +21 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mq.js +25 -12
- package/lib/commonjs/mq.js.map +1 -1
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js +1 -0
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/commonjs/specs/NavigtionBar/index.js +0 -15
- package/lib/commonjs/specs/NavigtionBar/index.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/index.js +10 -6
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/commonjs/specs/StatusBar/index.js +0 -5
- package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
- package/lib/commonjs/specs/StyleSheet/index.js +1 -0
- package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js +1 -3
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/commonjs/specs/index.js +7 -0
- package/lib/commonjs/specs/index.js.map +1 -1
- package/lib/commonjs/specs/index.web.js +1 -1
- package/lib/commonjs/types/stylesheet.js.map +1 -1
- package/lib/commonjs/utils.js +26 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web/convert/index.js +79 -0
- package/lib/commonjs/web/convert/index.js.map +1 -0
- package/lib/commonjs/web/convert/module.d.js +2 -0
- package/lib/commonjs/web/convert/module.d.js.map +1 -0
- package/lib/commonjs/web/convert/object/boxShadow.js +59 -0
- package/lib/commonjs/web/convert/object/boxShadow.js.map +1 -0
- package/lib/commonjs/web/convert/object/filter.js +42 -0
- package/lib/commonjs/web/convert/object/filter.js.map +1 -0
- package/lib/commonjs/web/convert/object/index.js +39 -0
- package/lib/commonjs/web/convert/object/index.js.map +1 -0
- package/lib/commonjs/web/convert/object/objectStyle.js +56 -0
- package/lib/commonjs/web/convert/object/objectStyle.js.map +1 -0
- package/lib/commonjs/web/convert/object/transform.js +27 -0
- package/lib/commonjs/web/convert/object/transform.js.map +1 -0
- package/lib/commonjs/web/convert/pseudo.js +10 -0
- package/lib/commonjs/web/convert/pseudo.js.map +1 -0
- package/lib/commonjs/web/convert/shadow/boxShadow.js +62 -0
- package/lib/commonjs/web/convert/shadow/boxShadow.js.map +1 -0
- package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js +38 -0
- package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js.map +1 -0
- package/lib/commonjs/web/convert/shadow/index.js +28 -0
- package/lib/commonjs/web/convert/shadow/index.js.map +1 -0
- package/lib/commonjs/web/convert/shadow/textShadow.js +59 -0
- package/lib/commonjs/web/convert/shadow/textShadow.js.map +1 -0
- package/lib/commonjs/web/convert/style.js +93 -0
- package/lib/commonjs/web/convert/style.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 +59 -0
- package/lib/commonjs/web/convert/utils.js.map +1 -0
- package/lib/commonjs/web/create.js +49 -0
- package/lib/commonjs/web/create.js.map +1 -0
- package/lib/commonjs/web/index.js +60 -0
- package/lib/commonjs/web/index.js.map +1 -0
- package/lib/commonjs/web/listener.js +61 -0
- package/lib/commonjs/web/listener.js.map +1 -0
- package/lib/commonjs/web/mock.js +27 -0
- package/lib/commonjs/web/mock.js.map +1 -0
- package/lib/commonjs/web/registry.js +172 -0
- package/lib/commonjs/web/registry.js.map +1 -0
- package/lib/commonjs/web/runtime.js +173 -0
- package/lib/commonjs/web/runtime.js.map +1 -0
- package/lib/commonjs/web/shadowRegistry.js +142 -0
- package/lib/commonjs/web/shadowRegistry.js.map +1 -0
- package/lib/commonjs/web/state.js +73 -0
- package/lib/commonjs/web/state.js.map +1 -0
- package/lib/commonjs/web/utils/common.js +39 -0
- package/lib/commonjs/web/utils/common.js.map +1 -0
- package/lib/commonjs/web/utils/index.js +28 -0
- package/lib/commonjs/web/utils/index.js.map +1 -0
- package/lib/commonjs/web/utils/unistyle.js +85 -0
- package/lib/commonjs/web/utils/unistyle.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 +59 -0
- package/lib/commonjs/web/variants/useVariants.js.map +1 -0
- package/lib/module/components/Display.js +13 -0
- package/lib/module/components/Display.js.map +1 -0
- package/lib/module/components/Hide.js +13 -0
- package/lib/module/components/Hide.js.map +1 -0
- package/lib/module/components/index.js +5 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/components/useMedia.js +54 -0
- package/lib/module/components/useMedia.js.map +1 -0
- package/lib/module/components/useMedia.web.js +38 -0
- package/lib/module/components/useMedia.web.js.map +1 -0
- package/lib/module/core/createUnistylesComponent.js +72 -0
- package/lib/module/core/createUnistylesComponent.js.map +1 -0
- package/lib/module/core/createUnistylesComponent.native.js +75 -0
- package/lib/module/core/createUnistylesComponent.native.js.map +1 -0
- package/lib/module/core/index.js +4 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/index.js +2 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/mq.js +21 -11
- package/lib/module/mq.js.map +1 -1
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js +1 -0
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/module/specs/NavigtionBar/index.js +0 -10
- package/lib/module/specs/NavigtionBar/index.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/index.js +10 -6
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/specs/StatusBar/index.js +1 -6
- package/lib/module/specs/StatusBar/index.js.map +1 -1
- package/lib/module/specs/StyleSheet/index.js +1 -0
- package/lib/module/specs/StyleSheet/index.js.map +1 -1
- package/lib/module/specs/UnistylesRuntime/index.js +1 -3
- package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/module/specs/index.js +2 -1
- package/lib/module/specs/index.js.map +1 -1
- package/lib/module/specs/index.web.js +1 -1
- package/lib/module/specs/index.web.js.map +1 -1
- package/lib/module/types/stylesheet.js.map +1 -1
- package/lib/module/utils.js +21 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/web/convert/index.js +74 -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/object/boxShadow.js +54 -0
- package/lib/module/web/convert/object/boxShadow.js.map +1 -0
- package/lib/module/web/convert/object/filter.js +37 -0
- package/lib/module/web/convert/object/filter.js.map +1 -0
- package/lib/module/web/convert/object/index.js +6 -0
- package/lib/module/web/convert/object/index.js.map +1 -0
- package/lib/module/web/convert/object/objectStyle.js +51 -0
- package/lib/module/web/convert/object/objectStyle.js.map +1 -0
- package/lib/module/web/convert/object/transform.js +22 -0
- package/lib/module/web/convert/object/transform.js.map +1 -0
- package/lib/module/web/convert/pseudo.js +5 -0
- package/lib/module/web/convert/pseudo.js.map +1 -0
- package/lib/module/web/convert/shadow/boxShadow.js +57 -0
- package/lib/module/web/convert/shadow/boxShadow.js.map +1 -0
- package/lib/module/web/convert/shadow/getShadowBreakpoints.js +33 -0
- package/lib/module/web/convert/shadow/getShadowBreakpoints.js.map +1 -0
- package/lib/module/web/convert/shadow/index.js +5 -0
- package/lib/module/web/convert/shadow/index.js.map +1 -0
- package/lib/module/web/convert/shadow/textShadow.js +54 -0
- package/lib/module/web/convert/shadow/textShadow.js.map +1 -0
- package/lib/module/web/convert/style.js +88 -0
- package/lib/module/web/convert/style.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 +45 -0
- package/lib/module/web/convert/utils.js.map +1 -0
- package/lib/module/web/create.js +44 -0
- package/lib/module/web/create.js.map +1 -0
- package/lib/module/web/index.js +26 -0
- package/lib/module/web/index.js.map +1 -0
- package/lib/module/web/listener.js +57 -0
- package/lib/module/web/listener.js.map +1 -0
- package/lib/module/web/mock.js +23 -0
- package/lib/module/web/mock.js.map +1 -0
- package/lib/module/web/registry.js +168 -0
- package/lib/module/web/registry.js.map +1 -0
- package/lib/module/web/runtime.js +169 -0
- package/lib/module/web/runtime.js.map +1 -0
- package/lib/module/web/shadowRegistry.js +138 -0
- package/lib/module/web/shadowRegistry.js.map +1 -0
- package/lib/module/web/state.js +69 -0
- package/lib/module/web/state.js.map +1 -0
- package/lib/module/web/utils/common.js +28 -0
- package/lib/module/web/utils/common.js.map +1 -0
- package/lib/module/web/utils/index.js +5 -0
- package/lib/module/web/utils/index.js.map +1 -0
- package/lib/module/web/utils/unistyle.js +72 -0
- package/lib/module/web/utils/unistyle.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 +54 -0
- package/lib/module/web/variants/useVariants.js.map +1 -0
- package/lib/typescript/src/components/Display.d.ts +7 -0
- package/lib/typescript/src/components/Display.d.ts.map +1 -0
- package/lib/typescript/src/components/Hide.d.ts +7 -0
- package/lib/typescript/src/components/Hide.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +3 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/components/useMedia.d.ts +6 -0
- package/lib/typescript/src/components/useMedia.d.ts.map +1 -0
- package/lib/typescript/src/components/useMedia.web.d.ts +6 -0
- package/lib/typescript/src/components/useMedia.web.d.ts.map +1 -0
- package/lib/typescript/src/core/createUnistylesComponent.d.ts +8 -0
- package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -0
- package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +8 -0
- package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +2 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mq.d.ts +8 -0
- package/lib/typescript/src/mq.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +7 -5
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts +0 -1
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts +1 -10
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +4 -4
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +3 -0
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts +0 -1
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/index.d.ts +2 -4
- package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +3 -1
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/index.d.ts +3 -1
- package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +3 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/index.d.ts +4 -2
- package/lib/typescript/src/specs/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/index.web.d.ts +1 -1
- package/lib/typescript/src/specs/index.web.d.ts.map +1 -1
- package/lib/typescript/src/types/breakpoints.d.ts +11 -11
- 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 +1 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +6 -4
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/types/variants.d.ts +4 -1
- package/lib/typescript/src/types/variants.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +2 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/index.d.ts +3 -0
- package/lib/typescript/src/web/convert/index.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/boxShadow.d.ts +9 -0
- package/lib/typescript/src/web/convert/object/boxShadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/filter.d.ts +3 -0
- package/lib/typescript/src/web/convert/object/filter.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/index.d.ts +4 -0
- package/lib/typescript/src/web/convert/object/index.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/objectStyle.d.ts +5 -0
- package/lib/typescript/src/web/convert/object/objectStyle.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/transform.d.ts +3 -0
- package/lib/typescript/src/web/convert/object/transform.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/pseudo.d.ts +6 -0
- package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/shadow/boxShadow.d.ts +8 -0
- package/lib/typescript/src/web/convert/shadow/boxShadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/shadow/getShadowBreakpoints.d.ts +2 -0
- package/lib/typescript/src/web/convert/shadow/getShadowBreakpoints.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/shadow/index.d.ts +3 -0
- package/lib/typescript/src/web/convert/shadow/index.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/shadow/textShadow.d.ts +8 -0
- package/lib/typescript/src/web/convert/shadow/textShadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/style.d.ts +2 -0
- package/lib/typescript/src/web/convert/style.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/convert/types.d.ts +8 -2
- package/lib/typescript/src/web/convert/types.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/utils.d.ts +12 -0
- package/lib/typescript/src/web/convert/utils.d.ts.map +1 -0
- package/lib/typescript/src/web/create.d.ts +1443 -0
- package/lib/typescript/{web → src/web}/create.d.ts.map +1 -1
- package/lib/typescript/src/web/index.d.ts +1459 -0
- package/lib/typescript/{web → src/web}/index.d.ts.map +1 -1
- package/lib/typescript/{web/listener → src/web}/listener.d.ts +5 -2
- package/lib/typescript/src/web/listener.d.ts.map +1 -0
- package/lib/typescript/src/web/mock.d.ts +5 -0
- package/lib/typescript/src/web/mock.d.ts.map +1 -0
- package/lib/typescript/src/web/registry.d.ts +24 -0
- package/lib/typescript/src/web/registry.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/runtime.d.ts +11 -10
- package/lib/typescript/src/web/runtime.d.ts.map +1 -0
- package/lib/typescript/src/web/shadowRegistry.d.ts +17 -0
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -0
- package/lib/typescript/src/web/state.d.ts +18 -0
- package/lib/typescript/src/web/state.d.ts.map +1 -0
- package/lib/typescript/src/web/utils/common.d.ts +8 -0
- package/lib/typescript/src/web/utils/common.d.ts.map +1 -0
- package/lib/typescript/src/web/utils/index.d.ts +3 -0
- package/lib/typescript/src/web/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/web/utils/unistyle.d.ts +20 -0
- package/lib/typescript/src/web/utils/unistyle.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/c++/JColorScheme.hpp +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_UnistylesNativeMiniRuntime.hpp +57 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp +69 -0
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +35 -34
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +15 -6
- package/nitrogen/generated/android/c++/JOrientation.hpp +1 -1
- package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +4 -1
- package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +9 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Dimensions.kt +1 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/{Func_void_std__vector_UnistyleDependency_.kt → Func_void_UnistylesNativeMiniRuntime.kt} +6 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +25 -13
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Insets.kt +1 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +3 -1
- package/nitrogen/generated/android/unistyles+autolinking.cmake +13 -1
- package/nitrogen/generated/android/unistyles+autolinking.gradle +2 -0
- package/nitrogen/generated/android/{UnistylesOnLoad.cpp → unistylesOnLoad.cpp} +6 -4
- package/nitrogen/generated/android/{UnistylesOnLoad.hpp → unistylesOnLoad.hpp} +1 -1
- package/nitrogen/generated/ios/Unistyles+autolinking.rb +6 -4
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +25 -0
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +73 -38
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +1 -30
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +8 -8
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +4 -16
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +156 -115
- package/nitrogen/generated/ios/swift/UnistyleDependency.swift +4 -0
- package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +16 -5
- package/nitrogen/generated/shared/c++/ColorScheme.hpp +2 -2
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +2 -2
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +6 -3
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +3 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +5 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +3 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +3 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +2 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +10 -4
- package/nitrogen/generated/shared/c++/Orientation.hpp +2 -2
- package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +2 -1
- package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +10 -9
- package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +9 -8
- package/package.json +20 -30
- package/plugin/common.js +31 -3
- package/plugin/index.js +107 -18
- package/plugin/ref.js +140 -14
- package/plugin/style.js +208 -22
- package/plugin/stylesheet.js +53 -3
- package/plugin/variants.js +33 -0
- package/src/components/Display.tsx +12 -0
- package/src/components/Hide.tsx +12 -0
- package/src/components/index.ts +2 -0
- package/src/components/useMedia.ts +64 -0
- package/src/components/useMedia.web.ts +47 -0
- package/src/core/createUnistylesComponent.native.tsx +83 -0
- package/src/core/createUnistylesComponent.tsx +84 -0
- package/src/core/index.ts +1 -0
- package/src/index.ts +3 -12
- package/src/mq.ts +27 -9
- package/src/specs/NativePlatform/NativePlatform.nitro.ts +7 -5
- package/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.ts +0 -1
- package/src/specs/NavigtionBar/index.ts +1 -25
- package/src/specs/ShadowRegistry/index.ts +16 -10
- package/src/specs/ShadowRegistry/types.ts +4 -1
- package/src/specs/StatusBar/UnistylesStatusBar.nitro.ts +0 -1
- package/src/specs/StatusBar/index.ts +2 -12
- package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +4 -1
- package/src/specs/StyleSheet/index.ts +6 -1
- package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +1 -1
- package/src/specs/UnistylesRuntime/index.ts +5 -4
- package/src/specs/index.ts +6 -2
- package/src/specs/index.web.ts +1 -1
- package/src/types/breakpoints.ts +25 -13
- package/src/types/common.ts +1 -0
- package/src/types/index.ts +1 -1
- package/src/types/stylesheet.ts +7 -5
- package/src/types/variants.ts +7 -1
- package/src/utils.ts +22 -0
- package/{web → src/web}/convert/index.ts +25 -25
- package/src/web/convert/object/boxShadow.ts +55 -0
- package/src/web/convert/object/filter.ts +39 -0
- package/src/web/convert/object/index.ts +3 -0
- package/src/web/convert/object/objectStyle.ts +69 -0
- package/src/web/convert/object/transform.ts +24 -0
- package/src/web/convert/pseudo.ts +137 -0
- package/src/web/convert/shadow/boxShadow.ts +50 -0
- package/src/web/convert/shadow/getShadowBreakpoints.ts +34 -0
- package/src/web/convert/shadow/index.ts +2 -0
- package/src/web/convert/shadow/textShadow.ts +48 -0
- package/{web → src/web}/convert/style.ts +61 -10
- package/{web → src/web}/convert/types.ts +9 -2
- package/{web → src/web}/convert/utils.ts +11 -5
- package/src/web/create.ts +48 -0
- package/{web → src/web}/index.ts +4 -3
- package/src/web/listener.ts +63 -0
- package/{web → src/web}/mock.ts +3 -14
- package/src/web/registry.ts +215 -0
- package/{web → src/web}/runtime.ts +32 -21
- package/src/web/shadowRegistry.ts +145 -0
- package/src/web/state.ts +94 -0
- package/src/web/utils/common.ts +45 -0
- package/src/web/utils/index.ts +2 -0
- package/src/web/utils/unistyle.ts +108 -0
- package/src/web/variants/getVariants.ts +42 -0
- package/src/web/variants/index.ts +2 -0
- package/src/web/variants/useVariants.ts +65 -0
- package/android/src/main/cxx/helpers.cpp +0 -105
- package/android/src/main/cxx/helpers.h +0 -16
- package/android/src/main/cxx/platform.cpp +0 -170
- package/android/src/main/cxx/platform.h +0 -20
- package/lib/typescript/example/App.d.ts +0 -4
- package/lib/typescript/example/App.d.ts.map +0 -1
- package/lib/typescript/example/unistyles.d.ts +0 -63
- package/lib/typescript/example/unistyles.d.ts.map +0 -1
- package/lib/typescript/expo-example/App.d.ts +0 -4
- package/lib/typescript/expo-example/App.d.ts.map +0 -1
- package/lib/typescript/expo-example/unistyles.d.ts +0 -63
- package/lib/typescript/expo-example/unistyles.d.ts.map +0 -1
- package/lib/typescript/web/convert/boxShadow.d.ts +0 -3
- package/lib/typescript/web/convert/boxShadow.d.ts.map +0 -1
- package/lib/typescript/web/convert/breakpoint.d.ts +0 -3
- package/lib/typescript/web/convert/breakpoint.d.ts.map +0 -1
- package/lib/typescript/web/convert/index.d.ts +0 -4
- package/lib/typescript/web/convert/index.d.ts.map +0 -1
- package/lib/typescript/web/convert/shadow.d.ts +0 -2
- package/lib/typescript/web/convert/shadow.d.ts.map +0 -1
- package/lib/typescript/web/convert/style.d.ts +0 -3
- package/lib/typescript/web/convert/style.d.ts.map +0 -1
- package/lib/typescript/web/convert/textShadow.d.ts +0 -3
- package/lib/typescript/web/convert/textShadow.d.ts.map +0 -1
- package/lib/typescript/web/convert/transform.d.ts +0 -5
- package/lib/typescript/web/convert/transform.d.ts.map +0 -1
- package/lib/typescript/web/convert/types.d.ts.map +0 -1
- package/lib/typescript/web/convert/utils.d.ts +0 -8
- package/lib/typescript/web/convert/utils.d.ts.map +0 -1
- package/lib/typescript/web/create.d.ts +0 -2449
- package/lib/typescript/web/index.d.ts +0 -2464
- package/lib/typescript/web/listener/index.d.ts +0 -2
- package/lib/typescript/web/listener/index.d.ts.map +0 -1
- package/lib/typescript/web/listener/listener.d.ts.map +0 -1
- package/lib/typescript/web/mock.d.ts +0 -14
- package/lib/typescript/web/mock.d.ts.map +0 -1
- package/lib/typescript/web/mq.d.ts +0 -4
- package/lib/typescript/web/mq.d.ts.map +0 -1
- package/lib/typescript/web/pseudo.d.ts +0 -4
- package/lib/typescript/web/pseudo.d.ts.map +0 -1
- package/lib/typescript/web/registry.d.ts +0 -12
- package/lib/typescript/web/registry.d.ts.map +0 -1
- package/lib/typescript/web/runtime.d.ts.map +0 -1
- package/lib/typescript/web/state.d.ts +0 -24
- package/lib/typescript/web/state.d.ts.map +0 -1
- package/lib/typescript/web/useVariants.d.ts +0 -3
- package/lib/typescript/web/useVariants.d.ts.map +0 -1
- package/lib/typescript/web/utils.d.ts +0 -18
- package/lib/typescript/web/utils.d.ts.map +0 -1
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +0 -60
- package/plugin/__tests__/dependencies.spec.js +0 -360
- package/plugin/__tests__/ref.spec.js +0 -991
- package/plugin/__tests__/stylesheet.spec.js +0 -396
- package/web/convert/boxShadow.ts +0 -72
- package/web/convert/breakpoint.ts +0 -21
- package/web/convert/shadow.ts +0 -68
- package/web/convert/textShadow.ts +0 -69
- package/web/convert/transform.ts +0 -89
- package/web/create.ts +0 -102
- package/web/listener/index.ts +0 -1
- package/web/listener/listener.ts +0 -33
- package/web/mq.ts +0 -19
- package/web/pseudo.ts +0 -11
- package/web/registry.ts +0 -41
- package/web/state.ts +0 -148
- package/web/useVariants.ts +0 -99
- package/web/utils.ts +0 -95
- /package/nitrogen/generated/android/{UnistylesOnLoad.kt → unistylesOnLoad.kt} +0 -0
- /package/{web → src/web}/convert/module.d.ts +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NitroModules","HybridShadowRegistry","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","
|
1
|
+
{"version":3,"names":["NitroModules","HybridShadowRegistry","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","styles","variants","args","uniquePressableId","Array","isArray","filteredStyles","filter","style","initial","updater","Boolean","link","remove","unlink","UnistylesShadowRegistry"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAazD,MAAMC,oBAAoB,GAAGD,YAAY,CAACE,kBAAkB,CAAiB,yBAAyB,CAAC;AAEvG,MAAMC,uBAAuB,GAAIC,MAAkB,IAAK;EACpD,MAAMC,IAAI,GAAGD,MAAM,EAAEE,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACvDD,MAAM,EAAEI,kBAAkB,GAAG,CAAC,EAAEC,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACjGD,MAAM,EAAEK,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI;EAEhF,IAAI,CAACA,IAAI,EAAE;IACP;IACA,MAAM,IAAIK,KAAK,CAAC,uDAAuD,CAAC;EAC5E;EAEA,OAAOL,IAAI;AACf,CAAC;AAEDJ,oBAAoB,CAACU,GAAG,GAAG,CAACP,MAAM,EAAEQ,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,iBAAiB,KAAK;EAC9E;EACA,IAAI,CAACX,MAAM,IAAI,CAACQ,MAAM,IAAI,CAACI,KAAK,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;IAC9C;EACJ;;EAEA;EACA,MAAMM,cAAc,GAAGN,MAAM,CACxBO,MAAM,CAACC,KAAK,IAAI,CAACA,KAAK,EAAEC,OAAO,EAAEC,OAAO,CAAC,CACzCH,MAAM,CAACI,OAAO,CAAC;EAEpBtB,oBAAoB,CAACuB,IAAI,CAACrB,uBAAuB,CAACC,MAAM,CAAC,EAAEc,cAAc,EAAEL,QAAQ,IAAI,CAAC,CAAC,EAAEC,IAAI,IAAI,EAAE,EAAEC,iBAAiB,CAAC;AAC7H,CAAC;AAEDd,oBAAoB,CAACwB,MAAM,GAAGrB,MAAM,IAAI;EACpC,IAAI,CAACA,MAAM,EAAE;IACT;EACJ;EAEAH,oBAAoB,CAACyB,MAAM,CAACvB,uBAAuB,CAACC,MAAM,CAAC,CAAC;AAChE,CAAC;AAQD,OAAO,MAAMuB,uBAAuB,GAAG1B,oBAA4D","ignoreList":[]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { StatusBar as NativeStatusBar } from 'react-native';
|
4
4
|
import { StatusBarStyle } from '../types';
|
5
5
|
export const attachStatusBarJSMethods = hybridObject => {
|
6
6
|
hybridObject.setStyle = (style, animated) => {
|
@@ -19,10 +19,5 @@ export const attachStatusBarJSMethods = hybridObject => {
|
|
19
19
|
NativeStatusBar.setHidden(isHidden, animation);
|
20
20
|
privateHybrid._setHidden(isHidden);
|
21
21
|
};
|
22
|
-
privateHybrid._setBackgroundColor = hybridObject.setBackgroundColor;
|
23
|
-
hybridObject.setBackgroundColor = color => {
|
24
|
-
const parsedColor = processColor(color);
|
25
|
-
privateHybrid._setBackgroundColor(parsedColor);
|
26
|
-
};
|
27
22
|
};
|
28
23
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["StatusBar","NativeStatusBar","StatusBarStyle","attachStatusBarJSMethods","hybridObject","setStyle","style","animated","Light","setBarStyle","Dark","Default","privateHybrid","_setHidden","setHidden","isHidden","animation"],"sourceRoot":"../../../../src","sources":["specs/StatusBar/index.ts"],"mappings":";;AAAA,SAASA,SAAS,IAAIC,eAAe,QAAQ,cAAc;AAE3D,SAASC,cAAc,QAAQ,UAAU;AAUzC,OAAO,MAAMC,wBAAwB,GAAIC,YAAgC,IAAK;EAC1EA,YAAY,CAACC,QAAQ,GAAG,CAACC,KAAqB,EAAEC,QAAkB,KAAK;IACnE,QAAQD,KAAK;MACT,KAAKJ,cAAc,CAACM,KAAK;QACrB,OAAOP,eAAe,CAACQ,WAAW,CAAC,eAAe,EAAEF,QAAQ,CAAC;MACjE,KAAKL,cAAc,CAACQ,IAAI;QACpB,OAAOT,eAAe,CAACQ,WAAW,CAAC,cAAc,EAAEF,QAAQ,CAAC;MAChE,KAAKL,cAAc,CAACS,OAAO;QACvB,OAAOV,eAAe,CAACQ,WAAW,CAAC,SAAS,EAAEF,QAAQ,CAAC;IAC/D;EACJ,CAAC;EAED,MAAMK,aAAa,GAAGR,YAAyC;EAE/DQ,aAAa,CAACC,UAAU,GAAGT,YAAY,CAACU,SAAS;EACjDV,YAAY,CAACU,SAAS,GAAG,CAACC,QAAiB,EAAEC,SAAoC,KAAK;IAClFf,eAAe,CAACa,SAAS,CAACC,QAAQ,EAAEC,SAAS,CAAC;IAC9CJ,aAAa,CAACC,UAAU,CAACE,QAAQ,CAAC;EACtC,CAAC;AACL,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NitroModules","processColor","StyleSheet","NativeStyleSheet","HybridUnistylesStyleSheet","createHybridObject","absoluteFillObject","absoluteFill","flatten","compose","jsMethods"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,YAAY,EAAEC,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;
|
1
|
+
{"version":3,"names":["NitroModules","processColor","StyleSheet","NativeStyleSheet","HybridUnistylesStyleSheet","createHybridObject","absoluteFillObject","absoluteFill","flatten","compose","jsMethods","init"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,YAAY,EAAEC,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;AAgC3E,MAAMC,yBAAyB,GAAGJ,YAAY,CACzCK,kBAAkB,CAAsB,qBAAqB,CAAC;AAEnED,yBAAyB,CAACE,kBAAkB,GAAGH,gBAAgB,CAACG,kBAAkB;AAClFF,yBAAyB,CAACG,YAAY,GAAGJ,gBAAgB,CAACI,YAAY;AACtEH,yBAAyB,CAACI,OAAO,GAAGL,gBAAgB,CAACK,OAAO;AAC5DJ,yBAAyB,CAACK,OAAO,GAAGN,gBAAgB,CAACM,OAAO;AAC5DL,yBAAyB,CAACM,SAAS,GAAG;EAClCT;AACJ,CAAC;AAEDG,yBAAyB,CAACO,IAAI,CAAC,CAAC;AAIhC,OAAO,MAAMT,UAAU,GAAGE,yBAAsE","ignoreList":[]}
|
@@ -3,20 +3,18 @@
|
|
3
3
|
import { processColor } from 'react-native';
|
4
4
|
import { NitroModules } from 'react-native-nitro-modules';
|
5
5
|
import { attachStatusBarJSMethods } from '../StatusBar';
|
6
|
-
import { attachNavigationBarJSMethods } from '../NavigtionBar';
|
7
6
|
import { isIOS } from '../../common';
|
8
7
|
const HybridUnistylesRuntime = NitroModules.createHybridObject('UnistylesRuntime');
|
9
8
|
HybridUnistylesRuntime.statusBar = HybridUnistylesRuntime.createHybridStatusBar();
|
10
9
|
HybridUnistylesRuntime.navigationBar = HybridUnistylesRuntime.createHybridNavigationBar();
|
11
10
|
HybridUnistylesRuntime._setRootViewBackgroundColor = HybridUnistylesRuntime.setRootViewBackgroundColor;
|
12
11
|
HybridUnistylesRuntime.setRootViewBackgroundColor = color => {
|
13
|
-
const parsedColor = processColor(color);
|
12
|
+
const parsedColor = processColor(color) ?? 0;
|
14
13
|
HybridUnistylesRuntime._setRootViewBackgroundColor(parsedColor);
|
15
14
|
};
|
16
15
|
if (isIOS) {
|
17
16
|
HybridUnistylesRuntime.setImmersiveMode = isEnabled => HybridUnistylesRuntime.statusBar.setHidden(isEnabled, 'fade');
|
18
17
|
}
|
19
18
|
attachStatusBarJSMethods(HybridUnistylesRuntime.statusBar);
|
20
|
-
attachNavigationBarJSMethods(HybridUnistylesRuntime.navigationBar);
|
21
19
|
export const Runtime = HybridUnistylesRuntime;
|
22
20
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["processColor","NitroModules","attachStatusBarJSMethods","
|
1
|
+
{"version":3,"names":["processColor","NitroModules","attachStatusBarJSMethods","isIOS","HybridUnistylesRuntime","createHybridObject","statusBar","createHybridStatusBar","navigationBar","createHybridNavigationBar","_setRootViewBackgroundColor","setRootViewBackgroundColor","color","parsedColor","setImmersiveMode","isEnabled","setHidden","Runtime"],"sourceRoot":"../../../../src","sources":["specs/UnistylesRuntime/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,YAAY,QAAQ,4BAA4B;AAGzD,SAASC,wBAAwB,QAAiC,cAAc;AAGhF,SAASC,KAAK,QAAQ,cAAc;AAkCpC,MAAMC,sBAAsB,GAAGH,YAAY,CACtCI,kBAAkB,CAA0B,kBAAkB,CAAC;AAEpED,sBAAsB,CAACE,SAAS,GAAGF,sBAAsB,CAACG,qBAAqB,CAAC,CAAC;AACjFH,sBAAsB,CAACI,aAAa,GAAGJ,sBAAsB,CAACK,yBAAyB,CAAC,CAAC;AACzFL,sBAAsB,CAACM,2BAA2B,GAAGN,sBAAsB,CAACO,0BAA0B;AAEtGP,sBAAsB,CAACO,0BAA0B,GAAIC,KAAc,IAAK;EACpE,MAAMC,WAAW,GAAGb,YAAY,CAACY,KAAK,CAAC,IAAI,CAAC;EAE5CR,sBAAsB,CAACM,2BAA2B,CAACG,WAAqB,CAAC;AAC7E,CAAC;AAED,IAAIV,KAAK,EAAE;EACPC,sBAAsB,CAACU,gBAAgB,GAAIC,SAAkB,IAAKX,sBAAsB,CAACE,SAAS,CAACU,SAAS,CAACD,SAAS,EAAE,MAAM,CAAC;AACnI;AAEAb,wBAAwB,CAACE,sBAAsB,CAACE,SAAS,CAAC;AAE1D,OAAO,MAAMW,OAAO,GAAGb,sBAA0C","ignoreList":[]}
|
@@ -5,6 +5,7 @@ import { Runtime } from './UnistylesRuntime';
|
|
5
5
|
import { StyleSheet } from './StyleSheet';
|
6
6
|
import { UnistylesShadowRegistry } from './ShadowRegistry';
|
7
7
|
import { StatusBarStyle, ColorScheme, Orientation } from './types';
|
8
|
-
|
8
|
+
import { UnistyleDependency } from './NativePlatform';
|
9
|
+
export { StatusBarStyle, ColorScheme, Orientation, UnistyleDependency };
|
9
10
|
export { UnistylesShadowRegistry, Runtime as UnistylesRuntime, StyleSheet };
|
10
11
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Runtime","StyleSheet","UnistylesShadowRegistry","StatusBarStyle","ColorScheme","Orientation","UnistylesRuntime"],"sourceRoot":"../../../src","sources":["specs/index.ts"],"mappings":";;AAAA,OAAO,kBAAkB;AAEzB,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,cAAc;
|
1
|
+
{"version":3,"names":["Runtime","StyleSheet","UnistylesShadowRegistry","StatusBarStyle","ColorScheme","Orientation","UnistyleDependency","UnistylesRuntime"],"sourceRoot":"../../../src","sources":["specs/index.ts"],"mappings":";;AAAA,OAAO,kBAAkB;AAEzB,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,cAAc;AAEzC,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,SAASC,cAAc,EAAEC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AAClE,SAASC,kBAAkB,QAAQ,kBAAkB;AAErD,SACIH,cAAc,EACdC,WAAW,EACXC,WAAW,EACXC,kBAAkB;AAGtB,SACIJ,uBAAuB,EACvBF,OAAO,IAAIO,gBAAgB,EAC3BN,UAAU","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getSSRUnistyles"],"sourceRoot":"../../../src","sources":["specs/index.web.ts"],"mappings":";;AAEA,OAAO,MAAMA,eAAe,GAAGA,CAAA,KAAM,EAAyB;AAE9D,cAAc,
|
1
|
+
{"version":3,"names":["getSSRUnistyles"],"sourceRoot":"../../../src","sources":["specs/index.web.ts"],"mappings":";;AAEA,OAAO,MAAMA,eAAe,GAAGA,CAAA,KAAM,EAAyB;AAE9D,cAAc,QAAQ","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["create","stylesheet"],"sourceRoot":"../../../src","sources":["types/stylesheet.ts"],"mappings":";;AASA;;
|
1
|
+
{"version":3,"names":["create","stylesheet"],"sourceRoot":"../../../src","sources":["types/stylesheet.ts"],"mappings":";;AASA;;AAwEA,MAAMA,MAAM,GAA0BC,UAAwC,IAAoEA,UAA2E;AAAA","ignoreList":[]}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export const deepMergeObjects = (...sources) => {
|
4
|
+
const target = {};
|
5
|
+
sources.forEach(source => {
|
6
|
+
Object.keys(source).forEach(key => {
|
7
|
+
const sourceValue = source[key];
|
8
|
+
const targetValue = target[key];
|
9
|
+
if (Object(sourceValue) == sourceValue && Object(targetValue) === targetValue) {
|
10
|
+
// @ts-expect-error - can't assign to generic
|
11
|
+
target[key] = deepMergeObjects(targetValue, sourceValue);
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
|
15
|
+
// @ts-expect-error - can't assign to generic
|
16
|
+
target[key] = sourceValue;
|
17
|
+
});
|
18
|
+
});
|
19
|
+
return target;
|
20
|
+
};
|
21
|
+
//# sourceMappingURL=utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["deepMergeObjects","sources","target","forEach","source","Object","keys","key","sourceValue","targetValue"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;AAAA,OAAO,MAAMA,gBAAgB,GAAGA,CAAqC,GAAGC,OAAiB,KAAK;EAC1F,MAAMC,MAAM,GAAG,CAAC,CAAM;EAEtBD,OAAO,CAACE,OAAO,CAACC,MAAM,IAAI;IACtBC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACD,OAAO,CAACI,GAAG,IAAI;MAC/B,MAAMC,WAAW,GAAGJ,MAAM,CAACG,GAAG,CAAC;MAC/B,MAAME,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAC;MAE/B,IAAIF,MAAM,CAACG,WAAW,CAAC,IAAIA,WAAW,IAAIH,MAAM,CAACI,WAAW,CAAC,KAAKA,WAAW,EAAE;QAC3E;QACAP,MAAM,CAACK,GAAG,CAAC,GAAGP,gBAAgB,CAACS,WAAW,EAAED,WAAW,CAAC;QAExD;MACJ;;MAEA;MACAN,MAAM,CAACK,GAAG,CAAC,GAAGC,WAAW;IAC7B,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAON,MAAM;AACjB,CAAC","ignoreList":[]}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { isPseudo } from './pseudo';
|
4
|
+
import { getStyle } from './style';
|
5
|
+
import { deepMergeObjects } from '../../utils';
|
6
|
+
import { getTransformStyle, getBoxShadow, getFilterStyle } from './object';
|
7
|
+
import { isShadow, isFilter, isTextShadow, isTransform, isBoxShadow } from './utils';
|
8
|
+
import { getTextShadowStyle, getBoxShadowStyle } from './shadow';
|
9
|
+
export const convertUnistyles = value => {
|
10
|
+
// Flag to mark if textShadow is already created
|
11
|
+
let hasTextShadow = false;
|
12
|
+
// Flag to mark if boxShadow is already created
|
13
|
+
let hasShadow = false;
|
14
|
+
const stylesArray = Object.entries({
|
15
|
+
...value,
|
16
|
+
...value._web
|
17
|
+
}).flatMap(([unistylesKey, unistylesValue]) => {
|
18
|
+
// Keys to omit
|
19
|
+
if (['_classNames', '_web', 'variants', 'compoundVariants', 'uni__dependencies', '__unistyles-secrets__'].includes(unistylesKey) || unistylesKey.startsWith('variant-')) {
|
20
|
+
return [];
|
21
|
+
}
|
22
|
+
|
23
|
+
// Pseudo classes :hover, :before etc.
|
24
|
+
if (isPseudo(unistylesKey)) {
|
25
|
+
const flattenValues = convertUnistyles(unistylesValue);
|
26
|
+
return {
|
27
|
+
[unistylesKey]: flattenValues
|
28
|
+
};
|
29
|
+
}
|
30
|
+
|
31
|
+
// Text shadow
|
32
|
+
if (isTextShadow(unistylesKey)) {
|
33
|
+
if (hasTextShadow) {
|
34
|
+
return [];
|
35
|
+
}
|
36
|
+
hasTextShadow = true;
|
37
|
+
return getTextShadowStyle(value);
|
38
|
+
}
|
39
|
+
|
40
|
+
// RN shadows
|
41
|
+
if (isShadow(unistylesKey)) {
|
42
|
+
if (hasShadow) {
|
43
|
+
return [];
|
44
|
+
}
|
45
|
+
hasShadow = true;
|
46
|
+
return getBoxShadowStyle(value);
|
47
|
+
}
|
48
|
+
if (isFilter(unistylesKey, unistylesValue)) {
|
49
|
+
return getFilterStyle(unistylesValue);
|
50
|
+
}
|
51
|
+
if (isBoxShadow(unistylesKey, unistylesValue)) {
|
52
|
+
return getBoxShadow(unistylesValue);
|
53
|
+
}
|
54
|
+
|
55
|
+
// Transforms
|
56
|
+
if (isTransform(unistylesKey, unistylesValue)) {
|
57
|
+
return getTransformStyle(unistylesValue);
|
58
|
+
}
|
59
|
+
|
60
|
+
// Breakpoints
|
61
|
+
if (typeof unistylesValue === 'object' && unistylesValue !== null) {
|
62
|
+
return Object.entries(unistylesValue).map(([breakpointKey, breakpointValue]) => {
|
63
|
+
return {
|
64
|
+
[breakpointKey]: getStyle(unistylesKey, breakpointValue)
|
65
|
+
};
|
66
|
+
});
|
67
|
+
}
|
68
|
+
|
69
|
+
// Regular styles
|
70
|
+
return getStyle(unistylesKey, unistylesValue);
|
71
|
+
});
|
72
|
+
return deepMergeObjects(...stylesArray);
|
73
|
+
};
|
74
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["isPseudo","getStyle","deepMergeObjects","getTransformStyle","getBoxShadow","getFilterStyle","isShadow","isFilter","isTextShadow","isTransform","isBoxShadow","getTextShadowStyle","getBoxShadowStyle","convertUnistyles","value","hasTextShadow","hasShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","flattenValues","map","breakpointKey","breakpointValue"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;AACA,SAASA,QAAQ,QAAQ,UAAU;AACnC,SAASC,QAAQ,QAAQ,SAAS;AAClC,SAASC,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,iBAAiB,EAAEC,YAAY,EAAEC,cAAc,QAAQ,UAAU;AAC1E,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AACpF,SAASC,kBAAkB,EAAEC,iBAAiB,QAAQ,UAAU;AAEhE,OAAO,MAAMC,gBAAgB,GAAIC,KAAsB,IAAK;EACxD;EACA,IAAIC,aAAa,GAAG,KAAK;EACzB;EACA,IAAIC,SAAS,GAAG,KAAK;EAErB,MAAMC,WAAW,GAAGC,MAAM,CAACC,OAAO,CAAC;IAC/B,GAAGL,KAAK;IACR,GAAGA,KAAK,CAACM;EACb,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,CAACC,YAAY,EAAEC,cAAc,CAAC,KAAK;IAC3C;IACA,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAACC,QAAQ,CAACF,YAAY,CAAC,IAAIA,YAAY,CAACG,UAAU,CAAC,UAAU,CAAC,EAAE;MACrK,OAAO,EAAE;IACb;;IAEA;IACA,IAAIzB,QAAQ,CAACsB,YAAY,CAAC,EAAE;MACxB,MAAMI,aAAa,GAAGb,gBAAgB,CAACU,cAAiC,CAAC;MAEzE,OAAO;QAAE,CAACD,YAAY,GAAGI;MAAc,CAAC;IAC5C;;IAEA;IACA,IAAIlB,YAAY,CAACc,YAAY,CAAC,EAAE;MAC5B,IAAIP,aAAa,EAAE;QACf,OAAO,EAAE;MACb;MAEAA,aAAa,GAAG,IAAI;MAEpB,OAAOJ,kBAAkB,CAACG,KAAK,CAAC;IACpC;;IAEA;IACA,IAAIR,QAAQ,CAACgB,YAAY,CAAC,EAAE;MACxB,IAAIN,SAAS,EAAE;QACX,OAAO,EAAE;MACb;MAEAA,SAAS,GAAG,IAAI;MAEhB,OAAOJ,iBAAiB,CAACE,KAAK,CAAC;IACnC;IAEA,IAAIP,QAAQ,CAACe,YAAY,EAAEC,cAAc,CAAC,EAAE;MACxC,OAAOlB,cAAc,CAACkB,cAAc,CAAC;IACzC;IAEA,IAAIb,WAAW,CAACY,YAAY,EAAEC,cAAc,CAAC,EAAE;MAC3C,OAAOnB,YAAY,CAACmB,cAAc,CAAC;IACvC;;IAEA;IACA,IAAId,WAAW,CAACa,YAAY,EAAEC,cAAc,CAAC,EAAE;MAC3C,OAAOpB,iBAAiB,CAACoB,cAAc,CAAC;IAC5C;;IAEA;IACA,IAAI,OAAOA,cAAc,KAAK,QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO;UAAE,CAACD,aAAa,GAAG3B,QAAQ,CAACqB,YAAY,EAAEO,eAAe;QAAE,CAAC;MACvE,CAAC,CAAC;IACN;;IAEA;IACA,OAAO5B,QAAQ,CAACqB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAOrB,gBAAgB,CAAC,GAAGe,WAAW,CAAC;AAC3C,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["web/convert/module.d.ts"],"mappings":"","ignoreList":[]}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { normalizeNumericValue } from '../utils';
|
4
|
+
import { keyInObject } from '../../utils';
|
5
|
+
import { deepMergeObjects } from '../../../utils';
|
6
|
+
const createBoxShadowValue = style => {
|
7
|
+
const {
|
8
|
+
offsetX,
|
9
|
+
offsetY,
|
10
|
+
blurRadius = 0,
|
11
|
+
spreadDistance = 0,
|
12
|
+
color = '#000',
|
13
|
+
inset
|
14
|
+
} = style;
|
15
|
+
return `${inset ? 'inset ' : ''}${normalizeNumericValue(offsetX)} ${normalizeNumericValue(offsetY)} ${normalizeNumericValue(blurRadius)} ${normalizeNumericValue(spreadDistance)} ${color}`;
|
16
|
+
};
|
17
|
+
export const getBoxShadow = boxShadow => {
|
18
|
+
const breakpoints = new Set();
|
19
|
+
boxShadow.forEach(shadow => {
|
20
|
+
const [key] = Object.keys(shadow);
|
21
|
+
const value = shadow[key];
|
22
|
+
|
23
|
+
// Breakpoints
|
24
|
+
if (typeof value === 'object') {
|
25
|
+
Object.keys(value).forEach(breakpoint => breakpoints.add(breakpoint));
|
26
|
+
}
|
27
|
+
});
|
28
|
+
if (breakpoints.size === 0) {
|
29
|
+
const boxShadowStyle = Object.fromEntries(boxShadow.map(shadow => {
|
30
|
+
const [key] = Object.keys(shadow);
|
31
|
+
return [key, shadow[key]];
|
32
|
+
}));
|
33
|
+
return {
|
34
|
+
boxShadow: createBoxShadowValue(boxShadowStyle)
|
35
|
+
};
|
36
|
+
}
|
37
|
+
const breakpointStyles = Array.from(breakpoints).map(breakpoint => {
|
38
|
+
const styles = Object.fromEntries(boxShadow.map(shadow => {
|
39
|
+
const [key] = Object.keys(shadow);
|
40
|
+
const value = shadow[key];
|
41
|
+
if (typeof value === 'object' && keyInObject(value, breakpoint)) {
|
42
|
+
return [key, value[breakpoint]];
|
43
|
+
}
|
44
|
+
return [key, value];
|
45
|
+
}));
|
46
|
+
return {
|
47
|
+
[breakpoint]: {
|
48
|
+
boxShadow: createBoxShadowValue(styles)
|
49
|
+
}
|
50
|
+
};
|
51
|
+
});
|
52
|
+
return deepMergeObjects(...breakpointStyles);
|
53
|
+
};
|
54
|
+
//# sourceMappingURL=boxShadow.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["normalizeNumericValue","keyInObject","deepMergeObjects","createBoxShadowValue","style","offsetX","offsetY","blurRadius","spreadDistance","color","inset","getBoxShadow","boxShadow","breakpoints","Set","forEach","shadow","key","Object","keys","value","breakpoint","add","size","boxShadowStyle","fromEntries","map","breakpointStyles","Array","from","styles"],"sourceRoot":"../../../../../src","sources":["web/convert/object/boxShadow.ts"],"mappings":";;AACA,SAASA,qBAAqB,QAAQ,UAAU;AAChD,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,gBAAgB,QAAQ,gBAAgB;AAEjD,MAAMC,oBAAoB,GAAIC,KAAqB,IAAK;EACpD,MAAM;IAAEC,OAAO;IAAEC,OAAO;IAAEC,UAAU,GAAG,CAAC;IAAEC,cAAc,GAAG,CAAC;IAAEC,KAAK,GAAG,MAAM;IAAEC;EAAM,CAAC,GAAGN,KAAK;EAE7F,OAAO,GAAGM,KAAK,GAAG,QAAQ,GAAG,EAAE,GAAGV,qBAAqB,CAACK,OAAO,CAAC,IAAIL,qBAAqB,CAACM,OAAO,CAAC,IAAIN,qBAAqB,CAACO,UAAoB,CAAC,IAAIP,qBAAqB,CAACQ,cAAwB,CAAC,IAAIC,KAAK,EAAE;AACnN,CAAC;AAED,OAAO,MAAME,YAAY,GAAIC,SAAgC,IAAK;EAC9D,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAS,CAAC;EACrCF,SAAS,CAACG,OAAO,CAACC,MAAM,IAAI;IACxB,MAAM,CAACC,GAAG,CAAC,GAAGC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC;IACjC,MAAMI,KAAK,GAAGJ,MAAM,CAACC,GAAG,CAAyB;;IAEjD;IACA,IAAI,OAAOG,KAAK,KAAK,QAAQ,EAAE;MAC3BF,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,CAACL,OAAO,CAACM,UAAU,IAAIR,WAAW,CAACS,GAAG,CAACD,UAAU,CAAC,CAAC;IACzE;EACJ,CAAC,CAAC;EAEF,IAAIR,WAAW,CAACU,IAAI,KAAK,CAAC,EAAE;IACxB,MAAMC,cAAc,GAAGN,MAAM,CAACO,WAAW,CAACb,SAAS,CAACc,GAAG,CAACV,MAAM,IAAI;MAC9D,MAAM,CAACC,GAAG,CAAC,GAAGC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC;MACjC,OAAO,CAACC,GAAG,EAAED,MAAM,CAACC,GAAG,CAAyB,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,OAAO;MACHL,SAAS,EAAET,oBAAoB,CAACqB,cAAc;IAClD,CAAC;EACL;EAEA,MAAMG,gBAAgB,GAAGC,KAAK,CAACC,IAAI,CAAChB,WAAW,CAAC,CAACa,GAAG,CAACL,UAAU,IAAI;IAC/D,MAAMS,MAAM,GAAGZ,MAAM,CAACO,WAAW,CAACb,SAAS,CAACc,GAAG,CAACV,MAAM,IAAI;MACtD,MAAM,CAACC,GAAG,CAAC,GAAGC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC;MACjC,MAAMI,KAAK,GAAGJ,MAAM,CAACC,GAAG,CAAyB;MAEjD,IAAI,OAAOG,KAAK,KAAK,QAAQ,IAAInB,WAAW,CAACmB,KAAK,EAAEC,UAAU,CAAC,EAAE;QAC7D,OAAO,CAACJ,GAAG,EAAEG,KAAK,CAACC,UAAU,CAAC,CAAC;MACnC;MAEA,OAAO,CAACJ,GAAG,EAAEG,KAAK,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO;MACH,CAACC,UAAU,GAAG;QACVT,SAAS,EAAET,oBAAoB,CAAC2B,MAAM;MAC1C;IACJ,CAAC;EACL,CAAC,CAAC;EAEF,OAAO5B,gBAAgB,CAAC,GAAGyB,gBAAgB,CAAC;AAChD,CAAC","ignoreList":[]}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { hyphenate } from '../../utils';
|
4
|
+
import { getObjectStyle } from './objectStyle';
|
5
|
+
import { normalizeColor, normalizeNumericValue } from '../utils';
|
6
|
+
import { UnistylesRuntime } from '../../runtime';
|
7
|
+
import { isUnistylesMq } from '../../../mq';
|
8
|
+
const getDropShadowStyle = dropShadow => {
|
9
|
+
const {
|
10
|
+
offsetX = 0,
|
11
|
+
offsetY = 0,
|
12
|
+
standardDeviation = 0,
|
13
|
+
color = '#000'
|
14
|
+
} = dropShadow;
|
15
|
+
return `${normalizeColor(String(color))} ${normalizeNumericValue(offsetX)} ${normalizeNumericValue(offsetY)} ${normalizeNumericValue(standardDeviation)}`;
|
16
|
+
};
|
17
|
+
export const getFilterStyle = filters => {
|
18
|
+
const restFilters = filters.filter(filter => Object.keys(filter)[0] !== 'dropShadow');
|
19
|
+
const dropShadow = (() => {
|
20
|
+
const dropShadowValue = filters.find(filter => Object.keys(filter)[0] === 'dropShadow')?.dropShadow;
|
21
|
+
if (typeof dropShadowValue !== 'object') {
|
22
|
+
return [];
|
23
|
+
}
|
24
|
+
const breakpoints = Object.keys(dropShadowValue).filter(key => Object.keys(UnistylesRuntime.breakpoints).includes(key) || isUnistylesMq(key));
|
25
|
+
const breakpointsDropShadow = Object.fromEntries(breakpoints.map(breakpoint => [breakpoint, getDropShadowStyle(dropShadowValue[breakpoint])]));
|
26
|
+
if (breakpoints.length === 0) {
|
27
|
+
return [{
|
28
|
+
dropShadow: getDropShadowStyle(dropShadowValue)
|
29
|
+
}];
|
30
|
+
}
|
31
|
+
return [{
|
32
|
+
dropShadow: breakpointsDropShadow
|
33
|
+
}];
|
34
|
+
})();
|
35
|
+
return getObjectStyle([...restFilters, ...dropShadow], 'filter', (key, value) => `${hyphenate(key)}(${normalizeNumericValue(value)})`);
|
36
|
+
};
|
37
|
+
//# sourceMappingURL=filter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["hyphenate","getObjectStyle","normalizeColor","normalizeNumericValue","UnistylesRuntime","isUnistylesMq","getDropShadowStyle","dropShadow","offsetX","offsetY","standardDeviation","color","String","getFilterStyle","filters","restFilters","filter","Object","keys","dropShadowValue","find","breakpoints","key","includes","breakpointsDropShadow","fromEntries","map","breakpoint","length","value"],"sourceRoot":"../../../../../src","sources":["web/convert/object/filter.ts"],"mappings":";;AACA,SAASA,SAAS,QAAQ,aAAa;AAEvC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,UAAU;AAChE,SAASC,gBAAgB,QAAQ,eAAe;AAChD,SAASC,aAAa,QAAQ,aAAa;AAE3C,MAAMC,kBAAkB,GAAIC,UAA2B,IAAK;EACxD,MAAM;IAAEC,OAAO,GAAG,CAAC;IAAEC,OAAO,GAAG,CAAC;IAAEC,iBAAiB,GAAG,CAAC;IAAEC,KAAK,GAAG;EAAO,CAAC,GAAGJ,UAAU;EAEtF,OAAO,GAAGL,cAAc,CAACU,MAAM,CAACD,KAAK,CAAC,CAAC,IAAIR,qBAAqB,CAACK,OAAO,CAAC,IAAIL,qBAAqB,CAACM,OAAO,CAAC,IAAIN,qBAAqB,CAACO,iBAAiB,CAAC,EAAE;AAC7J,CAAC;AAED,OAAO,MAAMG,cAAc,GAAIC,OAAuB,IAAK;EACvD,MAAMC,WAAW,GAAGD,OAAO,CAACE,MAAM,CAACA,MAAM,IAAIC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC;EACrF,MAAMT,UAAU,GAAG,CAAC,MAAM;IACtB,MAAMY,eAAe,GAAGL,OAAO,CAACM,IAAI,CAACJ,MAAM,IAAIC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,EAAET,UAAiC;IAE1H,IAAI,OAAOY,eAAe,KAAK,QAAQ,EAAE;MACrC,OAAO,EAAE;IACb;IAEA,MAAME,WAAW,GAAGJ,MAAM,CAACC,IAAI,CAACC,eAAe,CAAC,CAACH,MAAM,CAACM,GAAG,IAAIL,MAAM,CAACC,IAAI,CAACd,gBAAgB,CAACiB,WAAW,CAAC,CAACE,QAAQ,CAACD,GAAG,CAAC,IAAIjB,aAAa,CAACiB,GAAG,CAAC,CAAC;IAC7I,MAAME,qBAAqB,GAAGP,MAAM,CAACQ,WAAW,CAACJ,WAAW,CAACK,GAAG,CAACC,UAAU,IAAI,CAACA,UAAU,EAAErB,kBAAkB,CAACa,eAAe,CAACQ,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9I,IAAIN,WAAW,CAACO,MAAM,KAAK,CAAC,EAAE;MAC1B,OAAO,CAAC;QACJrB,UAAU,EAAED,kBAAkB,CAACa,eAAkC;MACrE,CAAC,CAAC;IACN;IAEA,OAAO,CAAC;MACJZ,UAAU,EAAEiB;IAChB,CAAC,CAAC;EACN,CAAC,EAAE,CAAC;EAEJ,OAAOvB,cAAc,CAAC,CAAC,GAAGc,WAAW,EAAE,GAAGR,UAAU,CAAC,EAAE,QAAQ,EAAE,CAACe,GAAG,EAAEO,KAAK,KAAK,GAAG7B,SAAS,CAACsB,GAAG,CAAC,IAAInB,qBAAqB,CAAC0B,KAAwB,CAAC,GAAG,CAAC;AAC7J,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["web/convert/object/index.ts"],"mappings":";;AAAA,cAAc,aAAa;AAC3B,cAAc,aAAa;AAC3B,cAAc,UAAU","ignoreList":[]}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { deepMergeObjects } from '../../../utils';
|
4
|
+
import { keyInObject } from '../../utils';
|
5
|
+
const createStylesValue = (styles, normalize) => styles.map(style => {
|
6
|
+
const [key] = Object.keys(style);
|
7
|
+
if (!key) {
|
8
|
+
return undefined;
|
9
|
+
}
|
10
|
+
return normalize(key, style[key]);
|
11
|
+
}).filter(Boolean).join(' ');
|
12
|
+
export const getObjectStyle = (styles, styleKey, normalize) => {
|
13
|
+
const breakpoints = new Set();
|
14
|
+
const normalStyles = [];
|
15
|
+
styles.forEach(style => {
|
16
|
+
const [property] = Object.keys(style);
|
17
|
+
if (!property) {
|
18
|
+
return;
|
19
|
+
}
|
20
|
+
const value = style[property];
|
21
|
+
if (typeof value === 'object' && !Array.isArray(value)) {
|
22
|
+
Object.keys(value ?? {}).forEach(breakpoint => breakpoints.add(breakpoint));
|
23
|
+
return;
|
24
|
+
}
|
25
|
+
normalStyles.push(style);
|
26
|
+
});
|
27
|
+
const breakpointStyles = Array.from(breakpoints).flatMap(breakpoint => {
|
28
|
+
const stylesPerBreakpoint = styles.flatMap(style => {
|
29
|
+
const [property] = Object.keys(style);
|
30
|
+
if (!property) {
|
31
|
+
return [];
|
32
|
+
}
|
33
|
+
const value = style[property];
|
34
|
+
if (typeof value === 'object' && !Array.isArray(value)) {
|
35
|
+
return keyInObject(value, breakpoint) ? [{
|
36
|
+
[property]: value[breakpoint]
|
37
|
+
}] : [];
|
38
|
+
}
|
39
|
+
return [];
|
40
|
+
});
|
41
|
+
return [{
|
42
|
+
[breakpoint]: {
|
43
|
+
[styleKey]: createStylesValue(stylesPerBreakpoint, normalize)
|
44
|
+
}
|
45
|
+
}];
|
46
|
+
});
|
47
|
+
return deepMergeObjects({
|
48
|
+
[styleKey]: createStylesValue(normalStyles, normalize)
|
49
|
+
}, ...breakpointStyles);
|
50
|
+
};
|
51
|
+
//# sourceMappingURL=objectStyle.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["deepMergeObjects","keyInObject","createStylesValue","styles","normalize","map","style","key","Object","keys","undefined","filter","Boolean","join","getObjectStyle","styleKey","breakpoints","Set","normalStyles","forEach","property","value","Array","isArray","breakpoint","add","push","breakpointStyles","from","flatMap","stylesPerBreakpoint"],"sourceRoot":"../../../../../src","sources":["web/convert/object/objectStyle.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,WAAW,QAAQ,aAAa;AAKzC,MAAMC,iBAAiB,GAAGA,CAAyBC,MAAsB,EAAEC,SAA6B,KAAKD,MAAM,CAC9GE,GAAG,CAACC,KAAK,IAAI;EACV,MAAM,CAACC,GAAG,CAAC,GAAGC,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC;EAEhC,IAAI,CAACC,GAAG,EAAE;IACN,OAAOG,SAAS;EACpB;EAEA,OAAON,SAAS,CAACG,GAAG,EAAED,KAAK,CAACC,GAAG,CAAC,CAAC;AACrC,CAAC,CAAC,CACDI,MAAM,CAACC,OAAO,CAAC,CACfC,IAAI,CAAC,GAAG,CAAC;AAEd,OAAO,MAAMC,cAAc,GAAGA,CAAyBX,MAAsB,EAAEY,QAAgB,EAAEX,SAA6B,KAAK;EAC/H,MAAMY,WAAW,GAAG,IAAIC,GAAG,CAAS,CAAC;EACrC,MAAMC,YAA4B,GAAG,EAAE;EAEvCf,MAAM,CAACgB,OAAO,CAACb,KAAK,IAAI;IACpB,MAAM,CAACc,QAAQ,CAAC,GAAGZ,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC;IAErC,IAAI,CAACc,QAAQ,EAAE;MACX;IACJ;IAEA,MAAMC,KAAK,GAAGf,KAAK,CAACc,QAAQ,CAAC;IAE7B,IAAI,OAAOC,KAAK,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACpDb,MAAM,CAACC,IAAI,CAACY,KAAK,IAAI,CAAC,CAAC,CAAC,CAACF,OAAO,CAACK,UAAU,IAAIR,WAAW,CAACS,GAAG,CAACD,UAAU,CAAC,CAAC;MAE3E;IACJ;IAEAN,YAAY,CAACQ,IAAI,CAACpB,KAAK,CAAC;EAC5B,CAAC,CAAC;EAEF,MAAMqB,gBAAgB,GAAGL,KAAK,CAACM,IAAI,CAACZ,WAAW,CAAC,CAACa,OAAO,CAACL,UAAU,IAAI;IACnE,MAAMM,mBAAmB,GAAG3B,MAAM,CAAC0B,OAAO,CAACvB,KAAK,IAAI;MAChD,MAAM,CAACc,QAAQ,CAAC,GAAGZ,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC;MAErC,IAAI,CAACc,QAAQ,EAAE;QACX,OAAO,EAAE;MACb;MAEA,MAAMC,KAAK,GAAGf,KAAK,CAACc,QAAQ,CAAC;MAE7B,IAAI,OAAOC,KAAK,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;QACpD,OAAOpB,WAAW,CAACoB,KAAK,EAAEG,UAAU,CAAC,GAAG,CAAC;UAAE,CAACJ,QAAQ,GAAGC,KAAK,CAACG,UAAU;QAAE,CAAC,CAAC,GAAG,EAAE;MACpF;MAEA,OAAO,EAAE;IACb,CAAC,CAAmB;IAEpB,OAAO,CAAC;MACJ,CAACA,UAAU,GAAG;QACV,CAACT,QAAQ,GAAGb,iBAAiB,CAAC4B,mBAAmB,EAAE1B,SAAS;MAChE;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAOJ,gBAAgB,CAAsB;IACzC,CAACe,QAAQ,GAAGb,iBAAiB,CAACgB,YAAY,EAAEd,SAAS;EACzD,CAAC,EAAE,GAAGuB,gBAAgB,CAAC;AAC3B,CAAC","ignoreList":[]}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { getObjectStyle } from './objectStyle';
|
4
|
+
import { normalizeNumericValue } from '../utils';
|
5
|
+
const normalizeTransform = (key, value) => {
|
6
|
+
if (key.includes('scale')) {
|
7
|
+
return value;
|
8
|
+
}
|
9
|
+
if (typeof value === 'number') {
|
10
|
+
return normalizeNumericValue(value);
|
11
|
+
}
|
12
|
+
return value;
|
13
|
+
};
|
14
|
+
export const getTransformStyle = transforms => getObjectStyle(transforms, 'transform', (key, value) => {
|
15
|
+
switch (key) {
|
16
|
+
case 'matrix':
|
17
|
+
return `${key}(${value.join(',')})`;
|
18
|
+
default:
|
19
|
+
return `${key}(${normalizeTransform(key, value)})`;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
//# sourceMappingURL=transform.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["getObjectStyle","normalizeNumericValue","normalizeTransform","key","value","includes","getTransformStyle","transforms","join"],"sourceRoot":"../../../../../src","sources":["web/convert/object/transform.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,eAAe;AAC9C,SAASC,qBAAqB,QAAQ,UAAU;AAGhD,MAAMC,kBAAkB,GAAGA,CAACC,GAAW,EAAEC,KAAU,KAAK;EACpD,IAAID,GAAG,CAACE,QAAQ,CAAC,OAAO,CAAC,EAAE;IACvB,OAAOD,KAAK;EAChB;EAEA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOH,qBAAqB,CAACG,KAAK,CAAC;EACvC;EAEA,OAAOA,KAAK;AAChB,CAAC;AAED,OAAO,MAAME,iBAAiB,GAAIC,UAAkC,IAAKP,cAAc,CAACO,UAAU,EAAE,WAAW,EAAE,CAACJ,GAAG,EAAEC,KAAK,KAAK;EAC7H,QAAOD,GAAG;IACN,KAAK,QAAQ;MACT,OAAO,GAAGA,GAAG,IAAKC,KAAK,CAAmBI,IAAI,CAAC,GAAG,CAAC,GAAG;IAC1D;MACI,OAAO,GAAGL,GAAG,IAAID,kBAAkB,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAG;EAC1D;AACJ,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export const pseudos = ['_-moz-broken', '_-moz-drag-over', '_-moz-first-node', '_-moz-handler-blocked', '_-moz-handler-crashed', '_-moz-handler-disabled', '_-moz-last-node', '_-moz-loading', '_-moz-locale-dir(ltr)', '_-moz-locale-dir(rtl)', '_-moz-only-whitespace', '_-moz-submit-invalid', '_-moz-suppressed', '_-moz-user-disabled', '_-moz-window-inactive', '_active', '_any-link', '_autofill', '_blank', '_buffering', '_checked', '_current', '_default', '_defined', '_dir(', '_disabled', '_empty', '_enabled', '_first', '_first-child', '_first-of-type', '_focus', '_focus-visible', '_focus-within', '_fullscreen', '_future', '_has(', '_host', '_host-context(', '_host(', '_hover', '_in-range', '_indeterminate', '_invalid', '_is(', '_lang(', '_last-child', '_last-of-type', '_left', '_link', '_local-link', '_modal', '_muted', '_not(', '_nth-child(', '_nth-last-child(', '_nth-last-of-type(', '_nth-of-type(', '_only-child', '_only-of-type', '_optional', '_out-of-range', '_past', '_paused', '_picture-in-picture', '_placeholder-shown', '_playing', '_popover-open', '_read-only', '_read-write', '_required', '_right', '_scope', '_seeking', '_stalled', '_state(', '_target', '_target-within', '_user-invalid', '_user-valid', '_valid', '_visited', '_volume-locked', '_where(', '_-moz-color-swatch', '_-moz-focus-inner', '_-moz-list-bullet', '_-moz-list-number', '_-moz-meter-bar', '_-moz-progress-bar', '_-moz-range-progress', '_-moz-range-thumb', '_-moz-range-track', '_-webkit-inner-spin-button', '_-webkit-meter-barDeprecated', '_-webkit-meter-even-less-good-value', '_-webkit-meter-inner-element', '_-webkit-meter-optimum-value', '_-webkit-meter-suboptimum-value', '_-webkit-progress-bar', '_-webkit-progress-inner-element', '_-webkit-progress-value', '_-webkit-scrollbar', '_-webkit-search-cancel-button', '_-webkit-search-results-button', '_-webkit-slider-runnable-track', '_-webkit-slider-thumb', '_after', '_backdrop', '_before', '_cue', '_file-selector-button', '_first-letter', '_first-line', '_grammar-error', '_highlight(', '_marker', '_part(', '_placeholder', '_selection', '_slotted(', '_spelling-error', '_target-text', '_view-transition', '_view-transition-group', '_view-transition-image-pair', '_view-transition-new', '_view-transition-old'];
|
4
|
+
export const isPseudo = selector => pseudos.some(pseudo => selector.startsWith(pseudo));
|
5
|
+
//# sourceMappingURL=pseudo.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["pseudos","isPseudo","selector","some","pseudo","startsWith"],"sourceRoot":"../../../../src","sources":["web/convert/pseudo.ts"],"mappings":";;AAAA,OAAO,MAAMA,OAAO,GAAG,CACnB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,QAAQ,EACR,aAAa,EACb,eAAe,EACf,OAAO,EACP,OAAO,EACP,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,eAAe,EACf,WAAW,EACX,eAAe,EACf,OAAO,EACP,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,8BAA8B,EAC9B,qCAAqC,EACrC,8BAA8B,EAC9B,8BAA8B,EAC9B,iCAAiC,EACjC,uBAAuB,EACvB,iCAAiC,EACjC,yBAAyB,EACzB,oBAAoB,EACpB,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,EAChC,uBAAuB,EACvB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,CAChB;AAEV,OAAO,MAAMC,QAAQ,GAAIC,QAAgB,IAAKF,OAAO,CAACG,IAAI,CAACC,MAAM,IAAIF,QAAQ,CAACG,UAAU,CAACD,MAAM,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { deepMergeObjects } from '../../../utils';
|
4
|
+
import { BOX_SHADOW_STYLES } from '../types';
|
5
|
+
import { extractShadowValue, normalizeColor, normalizeNumericValue } from '../utils';
|
6
|
+
import { getShadowBreakpoints } from './getShadowBreakpoints';
|
7
|
+
const createBoxShadowValue = style => {
|
8
|
+
const {
|
9
|
+
shadowColor,
|
10
|
+
shadowOffset,
|
11
|
+
shadowOpacity,
|
12
|
+
shadowRadius
|
13
|
+
} = style;
|
14
|
+
const offsetX = normalizeNumericValue(shadowOffset?.width ?? 0);
|
15
|
+
const offsetY = normalizeNumericValue(shadowOffset?.height ?? 0);
|
16
|
+
const radius = normalizeNumericValue(shadowRadius ?? 0);
|
17
|
+
const color = normalizeColor(shadowColor ?? '#000000', shadowOpacity ?? 1);
|
18
|
+
return `${offsetX} ${offsetY} ${radius} ${color}`;
|
19
|
+
};
|
20
|
+
export const getBoxShadowStyle = styles => {
|
21
|
+
const breakpoints = getShadowBreakpoints(BOX_SHADOW_STYLES, styles);
|
22
|
+
|
23
|
+
// If no breakpoints were used return styles without media queries
|
24
|
+
if (breakpoints.length === 0) {
|
25
|
+
return {
|
26
|
+
boxShadow: createBoxShadowValue(styles)
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
30
|
+
// Create boxShadow for each breakpoint
|
31
|
+
const breakpointStyles = breakpoints.map(breakpoint => {
|
32
|
+
const color = extractShadowValue('shadowColor', breakpoint, styles);
|
33
|
+
const {
|
34
|
+
width,
|
35
|
+
height
|
36
|
+
} = extractShadowValue('shadowOffset', breakpoint, styles);
|
37
|
+
const radius = extractShadowValue('shadowRadius', breakpoint, styles);
|
38
|
+
const opacity = extractShadowValue('shadowOpacity', breakpoint, styles);
|
39
|
+
return {
|
40
|
+
[breakpoint]: {
|
41
|
+
boxShadow: createBoxShadowValue({
|
42
|
+
shadowColor: color,
|
43
|
+
shadowOffset: {
|
44
|
+
width,
|
45
|
+
height
|
46
|
+
},
|
47
|
+
shadowRadius: radius,
|
48
|
+
shadowOpacity: opacity
|
49
|
+
})
|
50
|
+
}
|
51
|
+
};
|
52
|
+
});
|
53
|
+
|
54
|
+
// Merge all breakpoints styles into one
|
55
|
+
return deepMergeObjects(...breakpointStyles);
|
56
|
+
};
|
57
|
+
//# sourceMappingURL=boxShadow.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["deepMergeObjects","BOX_SHADOW_STYLES","extractShadowValue","normalizeColor","normalizeNumericValue","getShadowBreakpoints","createBoxShadowValue","style","shadowColor","shadowOffset","shadowOpacity","shadowRadius","offsetX","width","offsetY","height","radius","color","getBoxShadowStyle","styles","breakpoints","length","boxShadow","breakpointStyles","map","breakpoint","opacity"],"sourceRoot":"../../../../../src","sources":["web/convert/shadow/boxShadow.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,iBAAiB,QAAwB,UAAU;AAC5D,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,UAAU;AACpF,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,MAAMC,oBAAoB,GAAIC,KAAgB,IAAK;EAC/C,MAAM;IAAEC,WAAW;IAAEC,YAAY;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGJ,KAAK;EACxE,MAAMK,OAAO,GAAGR,qBAAqB,CAACK,YAAY,EAAEI,KAAK,IAAI,CAAC,CAAC;EAC/D,MAAMC,OAAO,GAAGV,qBAAqB,CAACK,YAAY,EAAEM,MAAM,IAAI,CAAC,CAAC;EAChE,MAAMC,MAAM,GAAGZ,qBAAqB,CAACO,YAAY,IAAI,CAAC,CAAC;EACvD,MAAMM,KAAK,GAAGd,cAAc,CAAEK,WAAW,IAAI,SAAS,EAAcE,aAAa,IAAI,CAAY,CAAC;EAElG,OAAO,GAAGE,OAAO,IAAIE,OAAO,IAAIE,MAAM,IAAIC,KAAK,EAAE;AACrD,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAIC,MAA2B,IAAK;EAC9D,MAAMC,WAAW,GAAGf,oBAAoB,CAACJ,iBAAiB,EAAEkB,MAAM,CAAC;;EAEnE;EACA,IAAIC,WAAW,CAACC,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAO;MACHC,SAAS,EAAEhB,oBAAoB,CAACa,MAAmB;IACvD,CAAC;EACL;;EAEA;EACA,MAAMI,gBAAgB,GAAGH,WAAW,CAACI,GAAG,CAACC,UAAU,IAAI;IACnD,MAAMR,KAAK,GAAGf,kBAAkB,CAAC,aAAa,EAAEuB,UAAU,EAAEN,MAAM,CAAC;IACnE,MAAM;MAAEN,KAAK;MAAEE;IAAO,CAAC,GAAGb,kBAAkB,CAAC,cAAc,EAAEuB,UAAU,EAAEN,MAAM,CAAC;IAChF,MAAMH,MAAM,GAAGd,kBAAkB,CAAC,cAAc,EAAEuB,UAAU,EAAEN,MAAM,CAAC;IACrE,MAAMO,OAAO,GAAGxB,kBAAkB,CAAC,eAAe,EAAEuB,UAAU,EAAEN,MAAM,CAAC;IAEvE,OAAO;MACH,CAACM,UAAU,GAAG;QACVH,SAAS,EAAEhB,oBAAoB,CAAC;UAC5BE,WAAW,EAAES,KAAK;UAClBR,YAAY,EAAE;YACVI,KAAK;YACLE;UACJ,CAAC;UACDJ,YAAY,EAAEK,MAAM;UACpBN,aAAa,EAAEgB;QACnB,CAAC;MACL;IACJ,CAAC;EACL,CAAC,CAAC;;EAEF;EACA,OAAO1B,gBAAgB,CAAC,GAAGuB,gBAAgB,CAAC;AAChD,CAAC","ignoreList":[]}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export const getShadowBreakpoints = (shadowProperties, styles) => {
|
4
|
+
const breakpoints = new Set();
|
5
|
+
shadowProperties.forEach(key => {
|
6
|
+
const value = styles[key];
|
7
|
+
if (typeof value !== 'object') {
|
8
|
+
return;
|
9
|
+
}
|
10
|
+
if (key === 'shadowOffset' || key === 'textShadowOffset') {
|
11
|
+
const {
|
12
|
+
width,
|
13
|
+
height
|
14
|
+
} = value;
|
15
|
+
|
16
|
+
// If shadowOffset.width has breakpoints
|
17
|
+
if (typeof width === 'object') {
|
18
|
+
Object.keys(width).forEach(breakpoint => breakpoints.add(breakpoint));
|
19
|
+
}
|
20
|
+
|
21
|
+
// If shadowOffset.height has breakpoints
|
22
|
+
if (typeof height === 'object') {
|
23
|
+
Object.keys(height).forEach(breakpoint => breakpoints.add(breakpoint));
|
24
|
+
}
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
|
28
|
+
// Collect regular breakpoints
|
29
|
+
Object.keys(value).forEach(breakpoint => breakpoints.add(breakpoint));
|
30
|
+
});
|
31
|
+
return Array.from(breakpoints);
|
32
|
+
};
|
33
|
+
//# sourceMappingURL=getShadowBreakpoints.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["getShadowBreakpoints","shadowProperties","styles","breakpoints","Set","forEach","key","value","width","height","Object","keys","breakpoint","add","Array","from"],"sourceRoot":"../../../../../src","sources":["web/convert/shadow/getShadowBreakpoints.ts"],"mappings":";;AAEA,OAAO,MAAMA,oBAAoB,GAAGA,CAACC,gBAAuC,EAAEC,MAA2B,KAAK;EAC1G,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAS,CAAC;EAErCH,gBAAgB,CAACI,OAAO,CAACC,GAAG,IAAI;IAC5B,MAAMC,KAAK,GAAGL,MAAM,CAACI,GAAG,CAAC;IAEzB,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;MAC3B;IACJ;IAEA,IAAID,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAK,kBAAkB,EAAE;MACtD,MAAM;QAAEE,KAAK;QAAEC;MAAO,CAAC,GAAGF,KAAqB;;MAE/C;MACA,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;QAC3BE,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC,CAACH,OAAO,CAACO,UAAU,IAAIT,WAAW,CAACU,GAAG,CAACD,UAAU,CAAC,CAAC;MACzE;;MAEA;MACA,IAAI,OAAOH,MAAM,KAAK,QAAQ,EAAE;QAC5BC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACJ,OAAO,CAACO,UAAU,IAAIT,WAAW,CAACU,GAAG,CAACD,UAAU,CAAC,CAAC;MAC1E;MAEA;IACJ;;IAEA;IACAF,MAAM,CAACC,IAAI,CAACJ,KAAK,CAAC,CAACF,OAAO,CAACO,UAAU,IAAIT,WAAW,CAACU,GAAG,CAACD,UAAU,CAAC,CAAC;EACzE,CAAC,CAAC;EAEF,OAAOE,KAAK,CAACC,IAAI,CAACZ,WAAW,CAAC;AAClC,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["web/convert/shadow/index.ts"],"mappings":";;AAAA,cAAc,aAAa;AAC3B,cAAc,cAAc","ignoreList":[]}
|