react-native-css 0.0.0-nightly.2c68396 → 0.0.0-nightly.2e152c9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -5
- package/dist/commonjs/babel/helpers.js +7 -0
- package/dist/commonjs/babel/helpers.js.map +1 -1
- package/dist/commonjs/babel/import-plugin.js +20 -8
- package/dist/commonjs/babel/import-plugin.js.map +1 -1
- package/dist/commonjs/babel/react-native-web.js +17 -4
- package/dist/commonjs/babel/react-native-web.js.map +1 -1
- package/dist/commonjs/babel/react-native.js +9 -4
- package/dist/commonjs/babel/react-native.js.map +1 -1
- package/dist/commonjs/compiler/atRules.js +35 -0
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +198 -39
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/container-query.js +6 -1
- package/dist/commonjs/compiler/container-query.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +190 -101
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/individual-transforms.js +129 -0
- package/dist/commonjs/compiler/individual-transforms.js.map +1 -0
- package/dist/commonjs/compiler/inline-variables.js +47 -1
- package/dist/commonjs/compiler/inline-variables.js.map +1 -1
- package/dist/commonjs/compiler/lightningcss-loader.js +11 -8
- package/dist/commonjs/compiler/lightningcss-loader.js.map +1 -1
- package/dist/commonjs/compiler/media-query.js +16 -6
- package/dist/commonjs/compiler/media-query.js.map +1 -1
- package/dist/commonjs/compiler/selector-builder.js +16 -4
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +33 -9
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/compiler/supports.js +1 -3
- package/dist/commonjs/compiler/supports.js.map +1 -1
- package/dist/commonjs/components/FlatList.js +1 -0
- package/dist/commonjs/components/FlatList.js.map +1 -1
- package/dist/commonjs/components/ImageBackground.js +2 -6
- package/dist/commonjs/components/ImageBackground.js.map +1 -1
- package/dist/commonjs/components/KeyboardAvoidingView.js +2 -3
- package/dist/commonjs/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/commonjs/components/SafeAreaProvider.js +13 -0
- package/dist/commonjs/components/SafeAreaProvider.js.map +1 -0
- package/dist/commonjs/components/index.cjs +49 -1
- package/dist/commonjs/components/index.cjs.map +1 -1
- package/dist/commonjs/components/react-native-safe-area-context.native.js +10 -0
- package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -1
- package/dist/commonjs/jest/index.js +3 -1
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/cache-version.js +43 -0
- package/dist/commonjs/metro/cache-version.js.map +1 -0
- package/dist/commonjs/metro/index.js +2 -0
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +16 -3
- package/dist/commonjs/metro/metro-transformer.js.map +1 -1
- package/dist/commonjs/metro/typescript.js +26 -6
- package/dist/commonjs/metro/typescript.js.map +1 -1
- package/dist/commonjs/metro/warnings.js +135 -0
- package/dist/commonjs/metro/warnings.js.map +1 -0
- package/dist/commonjs/native/api.js +16 -11
- package/dist/commonjs/native/api.js.map +1 -1
- package/dist/commonjs/native/conditions/attributes.js +16 -9
- package/dist/commonjs/native/conditions/attributes.js.map +1 -1
- package/dist/commonjs/native/conditions/container-query.js +11 -11
- package/dist/commonjs/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/native/conditions/guards.js +7 -0
- package/dist/commonjs/native/conditions/guards.js.map +1 -1
- package/dist/commonjs/native/conditions/media-query.js +1 -1
- package/dist/commonjs/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/native/objects.js +11 -18
- package/dist/commonjs/native/objects.js.map +1 -1
- package/dist/commonjs/native/react/interaction.js +10 -5
- package/dist/commonjs/native/react/interaction.js.map +1 -1
- package/dist/commonjs/native/react/rules.js +45 -38
- package/dist/commonjs/native/react/rules.js.map +1 -1
- package/dist/commonjs/native/react/useNativeCss.js +70 -15
- package/dist/commonjs/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/native/react/usePassthrough.js +5 -2
- package/dist/commonjs/native/react/usePassthrough.js.map +1 -1
- package/dist/commonjs/native/reactivity.js +64 -24
- package/dist/commonjs/native/reactivity.js.map +1 -1
- package/dist/commonjs/native/reanimated.js +15 -3
- package/dist/commonjs/native/reanimated.js.map +1 -1
- package/dist/commonjs/native/styles/calculate-props.js +139 -26
- package/dist/commonjs/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/native/styles/functions/animation-timing.js +2 -1
- package/dist/commonjs/native/styles/functions/animation-timing.js.map +1 -1
- package/dist/commonjs/native/styles/functions/color-mix.js +43 -29
- package/dist/commonjs/native/styles/functions/color-mix.js.map +1 -1
- package/dist/commonjs/native/styles/functions/filters.js +19 -5
- package/dist/commonjs/native/styles/functions/filters.js.map +1 -1
- package/dist/commonjs/native/styles/functions/numeric-functions.js +4 -3
- package/dist/commonjs/native/styles/functions/numeric-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/platform-functions.js +2 -1
- package/dist/commonjs/native/styles/functions/platform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/string-functions.js +22 -6
- package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/transform-functions.js +95 -105
- package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/index.js +303 -49
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/native/styles/resolve.js +136 -19
- package/dist/commonjs/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/native/styles/scale-factor.js +12 -0
- package/dist/commonjs/native/styles/scale-factor.js.map +1 -0
- package/dist/commonjs/native/styles/shorthands/_handler.js +10 -0
- package/dist/commonjs/native/styles/shorthands/_handler.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/animation.js +6 -3
- package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/box-shadow.js +41 -20
- package/dist/commonjs/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/index.js +11 -0
- package/dist/commonjs/native/styles/shorthands/index.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js +22 -0
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/commonjs/native/styles/shorthands/transform.js +31 -8
- package/dist/commonjs/native/styles/shorthands/transform.js.map +1 -1
- package/dist/commonjs/native/styles/variables.js +165 -48
- package/dist/commonjs/native/styles/variables.js.map +1 -1
- package/dist/commonjs/native-internal/root.js +46 -7
- package/dist/commonjs/native-internal/root.js.map +1 -1
- package/dist/commonjs/native-internal/style-collection.js +22 -37
- package/dist/commonjs/native-internal/style-collection.js.map +1 -1
- package/dist/commonjs/native-internal/variables.js +1 -1
- package/dist/commonjs/native-internal/variables.js.map +1 -1
- package/dist/commonjs/utilities/dot-notation.types.js +4 -0
- package/dist/commonjs/utilities/equality.js +41 -0
- package/dist/commonjs/utilities/equality.js.map +1 -0
- package/dist/commonjs/utilities/index.js +11 -0
- package/dist/commonjs/utilities/index.js.map +1 -1
- package/dist/commonjs/utilities/style-descriptor.js +32 -8
- package/dist/commonjs/utilities/style-descriptor.js.map +1 -1
- package/dist/commonjs/web/api.js +2 -2
- package/dist/commonjs/web/api.js.map +1 -1
- package/dist/commonjs/web/assign-style.js +4 -1
- package/dist/commonjs/web/assign-style.js.map +1 -1
- package/dist/module/babel/helpers.js +6 -0
- package/dist/module/babel/helpers.js.map +1 -1
- package/dist/module/babel/import-plugin.js +22 -10
- package/dist/module/babel/import-plugin.js.map +1 -1
- package/dist/module/babel/react-native-web.js +16 -4
- package/dist/module/babel/react-native-web.js.map +1 -1
- package/dist/module/babel/react-native.js +9 -4
- package/dist/module/babel/react-native.js.map +1 -1
- package/dist/module/compiler/atRules.js +33 -0
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +200 -41
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js +2 -0
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/container-query.js +6 -1
- package/dist/module/compiler/container-query.js.map +1 -1
- package/dist/module/compiler/declarations.js +190 -100
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/individual-transforms.js +125 -0
- package/dist/module/compiler/individual-transforms.js.map +1 -0
- package/dist/module/compiler/inline-variables.js +47 -1
- package/dist/module/compiler/inline-variables.js.map +1 -1
- package/dist/module/compiler/lightningcss-loader.js +10 -8
- package/dist/module/compiler/lightningcss-loader.js.map +1 -1
- package/dist/module/compiler/media-query.js +16 -6
- package/dist/module/compiler/media-query.js.map +1 -1
- package/dist/module/compiler/selector-builder.js +16 -5
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +33 -9
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/compiler/supports.js +1 -3
- package/dist/module/compiler/supports.js.map +1 -1
- package/dist/module/components/FlatList.js +1 -0
- package/dist/module/components/FlatList.js.map +1 -1
- package/dist/module/components/ImageBackground.js +2 -6
- package/dist/module/components/ImageBackground.js.map +1 -1
- package/dist/module/components/KeyboardAvoidingView.js +2 -3
- package/dist/module/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/module/components/SafeAreaProvider.js +4 -0
- package/dist/module/components/SafeAreaProvider.js.map +1 -0
- package/dist/module/components/index.cjs +49 -1
- package/dist/module/components/index.cjs.map +1 -1
- package/dist/module/components/react-native-safe-area-context.native.js +9 -1
- package/dist/module/components/react-native-safe-area-context.native.js.map +1 -1
- package/dist/module/jest/index.js +3 -1
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/cache-version.js +39 -0
- package/dist/module/metro/cache-version.js.map +1 -0
- package/dist/module/metro/index.js +2 -0
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +16 -3
- package/dist/module/metro/metro-transformer.js.map +1 -1
- package/dist/module/metro/typescript.js +26 -6
- package/dist/module/metro/typescript.js.map +1 -1
- package/dist/module/metro/warnings.js +131 -0
- package/dist/module/metro/warnings.js.map +1 -0
- package/dist/module/native/api.js +18 -13
- package/dist/module/native/api.js.map +1 -1
- package/dist/module/native/conditions/attributes.js +16 -9
- package/dist/module/native/conditions/attributes.js.map +1 -1
- package/dist/module/native/conditions/container-query.js +11 -11
- package/dist/module/native/conditions/container-query.js.map +1 -1
- package/dist/module/native/conditions/guards.js +7 -0
- package/dist/module/native/conditions/guards.js.map +1 -1
- package/dist/module/native/conditions/media-query.js +1 -1
- package/dist/module/native/conditions/media-query.js.map +1 -1
- package/dist/module/native/objects.js +11 -18
- package/dist/module/native/objects.js.map +1 -1
- package/dist/module/native/react/interaction.js +10 -5
- package/dist/module/native/react/interaction.js.map +1 -1
- package/dist/module/native/react/rules.js +46 -39
- package/dist/module/native/react/rules.js.map +1 -1
- package/dist/module/native/react/useNativeCss.js +73 -18
- package/dist/module/native/react/useNativeCss.js.map +1 -1
- package/dist/module/native/react/usePassthrough.js +5 -2
- package/dist/module/native/react/usePassthrough.js.map +1 -1
- package/dist/module/native/reactivity.js +58 -22
- package/dist/module/native/reactivity.js.map +1 -1
- package/dist/module/native/reanimated.js +15 -3
- package/dist/module/native/reanimated.js.map +1 -1
- package/dist/module/native/styles/calculate-props.js +139 -26
- package/dist/module/native/styles/calculate-props.js.map +1 -1
- package/dist/module/native/styles/functions/animation-timing.js +2 -1
- package/dist/module/native/styles/functions/animation-timing.js.map +1 -1
- package/dist/module/native/styles/functions/color-mix.js +43 -29
- package/dist/module/native/styles/functions/color-mix.js.map +1 -1
- package/dist/module/native/styles/functions/filters.js +17 -4
- package/dist/module/native/styles/functions/filters.js.map +1 -1
- package/dist/module/native/styles/functions/numeric-functions.js +4 -3
- package/dist/module/native/styles/functions/numeric-functions.js.map +1 -1
- package/dist/module/native/styles/functions/platform-functions.js +2 -1
- package/dist/module/native/styles/functions/platform-functions.js.map +1 -1
- package/dist/module/native/styles/functions/string-functions.js +19 -5
- package/dist/module/native/styles/functions/string-functions.js.map +1 -1
- package/dist/module/native/styles/functions/transform-functions.js +93 -104
- package/dist/module/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/native/styles/index.js +304 -49
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/native/styles/resolve.js +136 -19
- package/dist/module/native/styles/resolve.js.map +1 -1
- package/dist/module/native/styles/scale-factor.js +8 -0
- package/dist/module/native/styles/scale-factor.js.map +1 -0
- package/dist/module/native/styles/shorthands/_handler.js +11 -1
- package/dist/module/native/styles/shorthands/_handler.js.map +1 -1
- package/dist/module/native/styles/shorthands/animation.js +6 -3
- package/dist/module/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/native/styles/shorthands/box-shadow.js +43 -21
- package/dist/module/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/module/native/styles/shorthands/index.js +1 -0
- package/dist/module/native/styles/shorthands/index.js.map +1 -1
- package/dist/module/native/styles/shorthands/logical-border-width.js +18 -0
- package/dist/module/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/module/native/styles/shorthands/transform.js +31 -8
- package/dist/module/native/styles/shorthands/transform.js.map +1 -1
- package/dist/module/native/styles/variables.js +166 -50
- package/dist/module/native/styles/variables.js.map +1 -1
- package/dist/module/native-internal/root.js +44 -7
- package/dist/module/native-internal/root.js.map +1 -1
- package/dist/module/native-internal/style-collection.js +10 -37
- package/dist/module/native-internal/style-collection.js.map +1 -1
- package/dist/module/native-internal/variables.js +2 -2
- package/dist/module/native-internal/variables.js.map +1 -1
- package/dist/module/utilities/dot-notation.types.js +2 -0
- package/dist/module/utilities/equality.js +37 -0
- package/dist/module/utilities/equality.js.map +1 -0
- package/dist/module/utilities/index.js +1 -0
- package/dist/module/utilities/index.js.map +1 -1
- package/dist/module/utilities/style-descriptor.js +30 -8
- package/dist/module/utilities/style-descriptor.js.map +1 -1
- package/dist/module/web/api.js +2 -2
- package/dist/module/web/api.js.map +1 -1
- package/dist/module/web/assign-style.js +4 -1
- package/dist/module/web/assign-style.js.map +1 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts +4 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -5
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +13 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +2 -3
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/individual-transforms.d.ts +10 -0
- package/dist/typescript/commonjs/src/compiler/individual-transforms.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/inline-variables.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/inline-variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +2 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +10 -10
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +2 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +2 -10
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/cache-version.d.ts +8 -0
- package/dist/typescript/commonjs/src/metro/cache-version.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts +4 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +9 -4
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/typescript.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/warnings.d.ts +13 -0
- package/dist/typescript/commonjs/src/metro/warnings.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/api.d.ts +5 -9
- package/dist/typescript/commonjs/src/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/conditions/guards.d.ts +2 -1
- package/dist/typescript/commonjs/src/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/objects.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/interaction.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/rules.d.ts +7 -2
- package/dist/typescript/commonjs/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts +0 -3
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/usePassthrough.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/reactivity.d.ts +15 -3
- package/dist/typescript/commonjs/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/reanimated.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/calculate-props.d.ts +11 -2
- package/dist/typescript/commonjs/src/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/animation-timing.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/platform-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/index.d.ts +5 -4
- package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts +4 -1
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/_handler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/transform.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts +3 -2
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/root.d.ts +38 -0
- package/dist/typescript/commonjs/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/style-collection.d.ts +2 -2
- package/dist/typescript/commonjs/src/native-internal/style-collection.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/variables.d.ts +1 -1
- package/dist/typescript/commonjs/src/native-internal/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime.types.d.ts +11 -6
- package/dist/typescript/commonjs/src/runtime.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts +2 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/equality.d.ts +2 -0
- package/dist/typescript/commonjs/src/utilities/equality.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utilities/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/utilities/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts +14 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/api.d.ts +5 -5
- package/dist/typescript/commonjs/src/web/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/assign-style.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/helpers.d.ts +2 -1
- package/dist/typescript/module/src/babel/helpers.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/import-plugin.d.ts +1 -1
- package/dist/typescript/module/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/react-native-web.d.ts +2 -1
- package/dist/typescript/module/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/atRules.d.ts +6 -3
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts +3 -7
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +14 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/container-query.d.ts +2 -2
- package/dist/typescript/module/src/compiler/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +4 -5
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/index.d.ts +2 -2
- package/dist/typescript/module/src/compiler/index.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/individual-transforms.d.ts +10 -0
- package/dist/typescript/module/src/compiler/individual-transforms.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/inline-variables.d.ts +2 -2
- package/dist/typescript/module/src/compiler/inline-variables.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/keyframes.d.ts +2 -2
- package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/media-query.d.ts +3 -3
- package/dist/typescript/module/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +1 -1
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts +3 -2
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selectors.d.ts +2 -2
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +10 -10
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +16 -16
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +2 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +2 -10
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/cache-version.d.ts +8 -0
- package/dist/typescript/module/src/metro/cache-version.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/index.d.ts +5 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +10 -5
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/typescript.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/warnings.d.ts +13 -0
- package/dist/typescript/module/src/metro/warnings.d.ts.map +1 -0
- package/dist/typescript/module/src/native/api.d.ts +6 -10
- package/dist/typescript/module/src/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/attributes.d.ts +1 -1
- package/dist/typescript/module/src/native/conditions/attributes.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/container-query.d.ts +2 -2
- package/dist/typescript/module/src/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/guards.d.ts +4 -3
- package/dist/typescript/module/src/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/index.d.ts +3 -3
- package/dist/typescript/module/src/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/media-query.d.ts +1 -1
- package/dist/typescript/module/src/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/native/index.d.ts +3 -3
- package/dist/typescript/module/src/native/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/objects.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/interaction.d.ts +2 -2
- package/dist/typescript/module/src/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/rules.d.ts +9 -4
- package/dist/typescript/module/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts +4 -7
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/usePassthrough.d.ts +1 -1
- package/dist/typescript/module/src/native/react/usePassthrough.d.ts.map +1 -1
- package/dist/typescript/module/src/native/reactivity.d.ts +15 -3
- package/dist/typescript/module/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/native/reanimated.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts +13 -4
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/filters.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/filters.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/index.d.ts +8 -8
- package/dist/typescript/module/src/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/index.d.ts +9 -8
- package/dist/typescript/module/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/line-height.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/line-height.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/resolve.d.ts +7 -4
- package/dist/typescript/module/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/module/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts +2 -2
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/border.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/border.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/index.d.ts +6 -5
- package/dist/typescript/module/src/native/styles/shorthands/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
- package/dist/typescript/module/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/units.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/variables.d.ts +4 -3
- package/dist/typescript/module/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/index.d.ts +3 -3
- package/dist/typescript/module/src/native-internal/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/root.d.ts +39 -1
- package/dist/typescript/module/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/style-collection.d.ts +3 -3
- package/dist/typescript/module/src/native-internal/style-collection.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/variables.d.ts +2 -2
- package/dist/typescript/module/src/native-internal/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.d.ts +1 -1
- package/dist/typescript/module/src/runtime.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.native.d.ts +1 -1
- package/dist/typescript/module/src/runtime.native.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.types.d.ts +11 -6
- package/dist/typescript/module/src/runtime.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts +2 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/equality.d.ts +2 -0
- package/dist/typescript/module/src/utilities/equality.d.ts.map +1 -0
- package/dist/typescript/module/src/utilities/index.d.ts +4 -3
- package/dist/typescript/module/src/utilities/index.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/specificity.d.ts +2 -2
- package/dist/typescript/module/src/utilities/specificity.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/style-descriptor.d.ts +14 -1
- package/dist/typescript/module/src/utilities/style-descriptor.d.ts.map +1 -1
- package/dist/typescript/module/src/web/api.d.ts +5 -5
- package/dist/typescript/module/src/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/web/assign-style.d.ts.map +1 -1
- package/dist/typescript/module/src/web/index.d.ts +3 -3
- package/dist/typescript/module/src/web/index.d.ts.map +1 -1
- package/node/babel.mjs +4 -0
- package/node/compiler.mjs +2 -0
- package/node/metro.mjs +2 -0
- package/package.json +78 -31
- package/src/babel/helpers.ts +8 -1
- package/src/babel/import-plugin.ts +31 -16
- package/src/babel/react-native-web.ts +32 -4
- package/src/babel/react-native.ts +9 -4
- package/src/compiler/atRules.ts +44 -0
- package/src/compiler/compiler.ts +282 -50
- package/src/compiler/compiler.types.ts +17 -0
- package/src/compiler/container-query.ts +8 -3
- package/src/compiler/declarations.ts +385 -247
- package/src/compiler/individual-transforms.ts +129 -0
- package/src/compiler/inline-variables.ts +67 -0
- package/src/compiler/lightningcss-loader.ts +16 -15
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +32 -5
- package/src/compiler/stylesheet.ts +51 -15
- package/src/compiler/supports.ts +1 -3
- package/src/components/FlatList.tsx +1 -0
- package/src/components/ImageBackground.tsx +2 -6
- package/src/components/KeyboardAvoidingView.tsx +2 -3
- package/src/components/SafeAreaProvider.tsx +1 -0
- package/src/components/index.cts +49 -1
- package/src/components/react-native-safe-area-context.native.tsx +20 -0
- package/src/jest/index.ts +3 -1
- package/src/metro/cache-version.ts +48 -0
- package/src/metro/index.ts +7 -0
- package/src/metro/metro-transformer.ts +26 -8
- package/src/metro/typescript.ts +53 -6
- package/src/metro/warnings.ts +187 -0
- package/src/native/api.tsx +26 -18
- package/src/native/conditions/attributes.ts +26 -9
- package/src/native/conditions/container-query.ts +11 -9
- package/src/native/conditions/guards.ts +13 -1
- package/src/native/conditions/media-query.ts +1 -1
- package/src/native/objects.ts +12 -22
- package/src/native/react/interaction.ts +11 -6
- package/src/native/react/rules.ts +58 -45
- package/src/native/react/useNativeCss.ts +85 -18
- package/src/native/react/usePassthrough.ts +3 -2
- package/src/native/reactivity.ts +79 -24
- package/src/native/reanimated.ts +24 -5
- package/src/native/styles/calculate-props.ts +179 -28
- package/src/native/styles/functions/animation-timing.ts +3 -1
- package/src/native/styles/functions/color-mix.ts +45 -39
- package/src/native/styles/functions/filters.ts +21 -6
- package/src/native/styles/functions/numeric-functions.ts +7 -6
- package/src/native/styles/functions/platform-functions.ts +3 -1
- package/src/native/styles/functions/string-functions.ts +25 -5
- package/src/native/styles/functions/transform-functions.ts +111 -64
- package/src/native/styles/index.ts +340 -53
- package/src/native/styles/resolve.ts +188 -29
- package/src/native/styles/scale-factor.ts +9 -0
- package/src/native/styles/shorthands/_handler.ts +14 -1
- package/src/native/styles/shorthands/animation.ts +8 -2
- package/src/native/styles/shorthands/box-shadow.ts +46 -25
- package/src/native/styles/shorthands/index.ts +1 -0
- package/src/native/styles/shorthands/logical-border-width.ts +32 -0
- package/src/native/styles/shorthands/transform.ts +36 -11
- package/src/native/styles/variables.ts +242 -45
- package/src/native-internal/root.ts +83 -13
- package/src/native-internal/style-collection.ts +21 -46
- package/src/native-internal/variables.tsx +6 -4
- package/src/runtime.types.ts +17 -15
- package/src/utilities/dot-notation.types.ts +4 -3
- package/src/utilities/equality.ts +41 -0
- package/src/utilities/index.ts +1 -0
- package/src/utilities/style-descriptor.ts +36 -14
- package/src/web/api.tsx +7 -12
- package/src/web/assign-style.ts +2 -1
- package/types.d.ts +0 -20
- package/dist/commonjs/compiler/inheritance.test.js +0 -78
- package/dist/commonjs/compiler/inheritance.test.js.map +0 -1
- package/dist/module/compiler/inheritance.test.js +0 -78
- package/dist/module/compiler/inheritance.test.js.map +0 -1
- package/dist/typescript/commonjs/.config/eslint.config.d.mts +0 -3
- package/dist/typescript/commonjs/.config/eslint.config.d.mts.map +0 -1
- package/dist/typescript/commonjs/eslint.config.d.mts +0 -2
- package/dist/typescript/commonjs/eslint.config.d.mts.map +0 -1
- package/dist/typescript/commonjs/example/app.config.d.ts +0 -4
- package/dist/typescript/commonjs/example/app.config.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/index.d.ts +0 -2
- package/dist/typescript/commonjs/example/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/metro.config.d.ts +0 -3
- package/dist/typescript/commonjs/example/metro.config.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/postcss.config.d.mts +0 -7
- package/dist/typescript/commonjs/example/postcss.config.d.mts.map +0 -1
- package/dist/typescript/commonjs/example/src/App.d.ts +0 -3
- package/dist/typescript/commonjs/example/src/App.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts +0 -2
- package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts.map +0 -1
- package/dist/typescript/module/.config/eslint.config.d.mts +0 -3
- package/dist/typescript/module/.config/eslint.config.d.mts.map +0 -1
- package/dist/typescript/module/eslint.config.d.mts +0 -2
- package/dist/typescript/module/eslint.config.d.mts.map +0 -1
- package/dist/typescript/module/example/app.config.d.ts +0 -4
- package/dist/typescript/module/example/app.config.d.ts.map +0 -1
- package/dist/typescript/module/example/index.d.ts +0 -2
- package/dist/typescript/module/example/index.d.ts.map +0 -1
- package/dist/typescript/module/example/metro.config.d.ts +0 -3
- package/dist/typescript/module/example/metro.config.d.ts.map +0 -1
- package/dist/typescript/module/example/postcss.config.d.mts +0 -7
- package/dist/typescript/module/example/postcss.config.d.mts.map +0 -1
- package/dist/typescript/module/example/src/App.d.ts +0 -3
- package/dist/typescript/module/example/src/App.d.ts.map +0 -1
- package/dist/typescript/module/src/compiler/inheritance.test.d.ts +0 -2
- package/dist/typescript/module/src/compiler/inheritance.test.d.ts.map +0 -1
- package/src/compiler/inheritance.test.ts +0 -121
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import { Specificity as S } from "react-native-css/utilities";
|
|
6
6
|
import { applyValue, getDeepPath } from "../objects.js";
|
|
7
7
|
import { VAR_SYMBOL } from "../reactivity.js";
|
|
8
|
-
import { transformKeys } from "./defaults.js";
|
|
9
8
|
import { resolveValue } from "./resolve.js";
|
|
10
9
|
export function calculateProps(get, rules, guards = [], inheritedVariables = {
|
|
11
10
|
[VAR_SYMBOL]: true
|
|
@@ -15,7 +14,7 @@ export function calculateProps(get, rules, guards = [], inheritedVariables = {
|
|
|
15
14
|
let normal;
|
|
16
15
|
let important;
|
|
17
16
|
const delayedStyles = [];
|
|
18
|
-
const
|
|
17
|
+
const transforms = [];
|
|
19
18
|
for (const rule of rules) {
|
|
20
19
|
if (VAR_SYMBOL in rule) {
|
|
21
20
|
if (typeof rule[VAR_SYMBOL] === "string") {
|
|
@@ -31,7 +30,8 @@ export function calculateProps(get, rules, guards = [], inheritedVariables = {
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
if (rule.d) {
|
|
34
|
-
|
|
33
|
+
const isImportant = Boolean(rule.s?.[S.Important]);
|
|
34
|
+
let topLevelTarget = isImportant ? important ??= {} : normal ??= {};
|
|
35
35
|
let target = topLevelTarget;
|
|
36
36
|
const ruleTarget = rule.target || "style";
|
|
37
37
|
if (typeof ruleTarget === "string") {
|
|
@@ -41,14 +41,19 @@ export function calculateProps(get, rules, guards = [], inheritedVariables = {
|
|
|
41
41
|
target = target[path] ??= {};
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
applyDeclarations(get, rule.d, inlineVariables, inheritedVariables, delayedStyles,
|
|
44
|
+
applyDeclarations(get, rule.d, inlineVariables, inheritedVariables, delayedStyles, transforms, guards, target, topLevelTarget, ruleTarget, isImportant);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
for (const delayedStyle of delayedStyles) {
|
|
48
48
|
delayedStyle();
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
if (transforms.length > 0) {
|
|
51
|
+
composeTransforms(transforms, value => resolveValue(value, get, {
|
|
52
|
+
inlineVariables,
|
|
53
|
+
inheritedVariables,
|
|
54
|
+
renderGuards: guards,
|
|
55
|
+
calculateProps
|
|
56
|
+
}));
|
|
52
57
|
}
|
|
53
58
|
return {
|
|
54
59
|
normal,
|
|
@@ -56,7 +61,117 @@ export function calculateProps(get, rules, guards = [], inheritedVariables = {
|
|
|
56
61
|
important
|
|
57
62
|
};
|
|
58
63
|
}
|
|
59
|
-
|
|
64
|
+
|
|
65
|
+
// css-transforms-2 §6: an element's transform is its `translate`, then its `rotate`, then its `scale`, then its `transform` list
|
|
66
|
+
const TRANSFORM_SLOTS = 4;
|
|
67
|
+
|
|
68
|
+
// A transform property's cascade slot in composition order, or -1. This runs for every dynamic declaration
|
|
69
|
+
function transformSlot(prop) {
|
|
70
|
+
switch (prop) {
|
|
71
|
+
case "translate":
|
|
72
|
+
return 0;
|
|
73
|
+
case "rotate":
|
|
74
|
+
return 1;
|
|
75
|
+
case "scale":
|
|
76
|
+
return 2;
|
|
77
|
+
case "transform":
|
|
78
|
+
return 3;
|
|
79
|
+
default:
|
|
80
|
+
return -1;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** A transform property's declaration, kept until every rule has been walked */
|
|
85
|
+
|
|
86
|
+
/** One style target's slots: the normal ones, then the !important ones */
|
|
87
|
+
|
|
88
|
+
function samePath(a, b) {
|
|
89
|
+
if (a === b) return true;
|
|
90
|
+
if (typeof a === "string" || typeof b === "string") return false;
|
|
91
|
+
if (a.length !== b.length) return false;
|
|
92
|
+
for (let i = 0; i < a.length; i++) {
|
|
93
|
+
if (a[i] !== b[i]) return false;
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Each transform property of each style target is a cascade slot of its own,
|
|
100
|
+
* and the slots compose into one `transform`. Records arrive in cascade
|
|
101
|
+
* order, so a later one replaces an earlier one, and an !important slot
|
|
102
|
+
* replaces a normal one for the same path.
|
|
103
|
+
*/
|
|
104
|
+
function composeTransforms(records, resolve) {
|
|
105
|
+
// One declaration, the usual case, has nothing to compose with
|
|
106
|
+
if (records.length === 1) {
|
|
107
|
+
const record = records[0];
|
|
108
|
+
const resolved = resolve(record.value);
|
|
109
|
+
if (resolved !== undefined && resolved !== null) {
|
|
110
|
+
const composed = [];
|
|
111
|
+
pushEntries(composed, resolved);
|
|
112
|
+
record.target.transform = composed;
|
|
113
|
+
}
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Almost always one group, so a scan beats keying a Map by path
|
|
118
|
+
const groups = [];
|
|
119
|
+
for (let r = 0; r < records.length; r++) {
|
|
120
|
+
const record = records[r];
|
|
121
|
+
let group;
|
|
122
|
+
for (let g = 0; g < groups.length; g++) {
|
|
123
|
+
if (samePath(groups[g].path, record.path)) {
|
|
124
|
+
group = groups[g];
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (group === undefined) {
|
|
129
|
+
group = {
|
|
130
|
+
path: record.path,
|
|
131
|
+
target: record.target,
|
|
132
|
+
slots: [undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined]
|
|
133
|
+
};
|
|
134
|
+
groups.push(group);
|
|
135
|
+
}
|
|
136
|
+
if (record.important) {
|
|
137
|
+
// The important target is merged over the normal one, so it takes the composed list
|
|
138
|
+
group.target = record.target;
|
|
139
|
+
group.slots[record.slot + TRANSFORM_SLOTS] = record.value;
|
|
140
|
+
} else {
|
|
141
|
+
group.slots[record.slot] = record.value;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
for (let g = 0; g < groups.length; g++) {
|
|
145
|
+
const group = groups[g];
|
|
146
|
+
let composed;
|
|
147
|
+
for (let slot = 0; slot < TRANSFORM_SLOTS; slot++) {
|
|
148
|
+
const important = group.slots[slot + TRANSFORM_SLOTS];
|
|
149
|
+
const value = important !== undefined ? important : group.slots[slot];
|
|
150
|
+
if (value === undefined) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
const resolved = resolve(value);
|
|
154
|
+
|
|
155
|
+
// A property that resolves to no value is `none` (css-variables-1 §3.1)
|
|
156
|
+
if (resolved !== undefined && resolved !== null) {
|
|
157
|
+
pushEntries(composed ??= [], resolved);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (composed !== undefined) {
|
|
161
|
+
group.target.transform = composed;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// A resolver returns a group for a two-axis function, so entries are spread into the list
|
|
167
|
+
function pushEntries(entries, value) {
|
|
168
|
+
if (Array.isArray(value)) {
|
|
169
|
+
for (let i = 0; i < value.length; i++) pushEntries(entries, value[i]);
|
|
170
|
+
} else {
|
|
171
|
+
entries.push(value);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
export function applyDeclarations(get, declarations, inlineVariables, inheritedVariables, delayedStyles = [], transforms = [], guards = [], target = {}, topLevelTarget = target, path = "style", important = false) {
|
|
60
175
|
const originalTarget = target;
|
|
61
176
|
for (const declaration of declarations) {
|
|
62
177
|
target = originalTarget;
|
|
@@ -102,8 +217,19 @@ export function applyDeclarations(get, declarations, inlineVariables, inheritedV
|
|
|
102
217
|
} else {
|
|
103
218
|
prop = propPath;
|
|
104
219
|
}
|
|
220
|
+
const slot = target === originalTarget ? transformSlot(prop) : -1;
|
|
221
|
+
if (slot !== -1) {
|
|
222
|
+
transforms.push({
|
|
223
|
+
target,
|
|
224
|
+
path,
|
|
225
|
+
important,
|
|
226
|
+
slot,
|
|
227
|
+
value
|
|
228
|
+
});
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
105
231
|
const shouldDelay = declaration[2];
|
|
106
|
-
if (shouldDelay
|
|
232
|
+
if (shouldDelay) {
|
|
107
233
|
/**
|
|
108
234
|
* We need to delay the resolution of this value until after all
|
|
109
235
|
* styles have been calculated. But another style might override
|
|
@@ -114,12 +240,12 @@ export function applyDeclarations(get, declarations, inlineVariables, inheritedV
|
|
|
114
240
|
* mutate the props object and not create a new one
|
|
115
241
|
*/
|
|
116
242
|
const originalValue = value;
|
|
117
|
-
// This needs to be a object with the [prop] so we can discover in transform arrays
|
|
118
243
|
value = {
|
|
119
244
|
[prop]: true
|
|
120
245
|
};
|
|
121
|
-
|
|
122
|
-
|
|
246
|
+
delayedStyles.push(() => {
|
|
247
|
+
if (getDeepPath(target, prop) === value) {
|
|
248
|
+
delete target[prop];
|
|
123
249
|
value = resolveValue(originalValue, get, {
|
|
124
250
|
inlineVariables,
|
|
125
251
|
inheritedVariables,
|
|
@@ -127,21 +253,8 @@ export function applyDeclarations(get, declarations, inlineVariables, inheritedV
|
|
|
127
253
|
calculateProps
|
|
128
254
|
});
|
|
129
255
|
applyValue(target, prop, value);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
delayedStyles.push(() => {
|
|
133
|
-
if (getDeepPath(target, prop) === value) {
|
|
134
|
-
delete target[prop];
|
|
135
|
-
value = resolveValue(originalValue, get, {
|
|
136
|
-
inlineVariables,
|
|
137
|
-
inheritedVariables,
|
|
138
|
-
renderGuards: guards,
|
|
139
|
-
calculateProps
|
|
140
|
-
});
|
|
141
|
-
applyValue(target, prop, value);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}
|
|
256
|
+
}
|
|
257
|
+
});
|
|
145
258
|
} else {
|
|
146
259
|
value = resolveValue(value, get, {
|
|
147
260
|
inlineVariables,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Specificity","S","applyValue","getDeepPath","VAR_SYMBOL","
|
|
1
|
+
{"version":3,"names":["Specificity","S","applyValue","getDeepPath","VAR_SYMBOL","resolveValue","calculateProps","get","rules","guards","inheritedVariables","inlineVariables","normal","important","delayedStyles","transforms","rule","Object","assign","v","variable","d","isImportant","Boolean","s","Important","topLevelTarget","target","ruleTarget","path","applyDeclarations","delayedStyle","length","composeTransforms","value","renderGuards","TRANSFORM_SLOTS","transformSlot","prop","samePath","a","b","i","records","resolve","record","resolved","undefined","composed","pushEntries","transform","groups","r","group","g","slots","push","slot","entries","Array","isArray","declarations","originalTarget","declaration","propPath","first","rest","final","pop","previousProp","previousTarget","startsWith","endsWith","Number","slice","shouldDelay","originalValue"],"sourceRoot":"../../../../src","sources":["native/styles/calculate-props.ts"],"mappings":";;AAAA;;AAOA,SAASA,WAAW,IAAIC,CAAC,QAAQ,4BAA4B;AAG7D,SAASC,UAAU,EAAEC,WAAW,QAAQ,eAAY;AACpD,SACEC,UAAU,QAGL,kBAAe;AACtB,SAASC,YAAY,QAAQ,cAAW;AAExC,OAAO,SAASC,cAAcA,CAC5BC,GAAW,EACXC,KAA4D,EAC5DC,MAAqB,GAAG,EAAE,EAC1BC,kBAAwC,GAAG;EACzC,CAACN,UAAU,GAAG;AAChB,CAAC,EACDO,eAA+B,GAAG;EAChC,CAACP,UAAU,GAAG;AAChB,CAAC,EACD;EACA,IAAIQ,MAAuC;EAC3C,IAAIC,SAA0C;EAE9C,MAAMC,aAA6B,GAAG,EAAE;EACxC,MAAMC,UAA6B,GAAG,EAAE;EAExC,KAAK,MAAMC,IAAI,IAAIR,KAAK,EAAE;IACxB,IAAIJ,UAAU,IAAIY,IAAI,EAAE;MACtB,IAAI,OAAOA,IAAI,CAACZ,UAAU,CAAC,KAAK,QAAQ,EAAE;QACxCa,MAAM,CAACC,MAAM,CAACP,eAAe,EAAEK,IAAI,CAAC;MACtC,CAAC,MAAM;QACLC,MAAM,CAACC,MAAM,CAACR,kBAAkB,EAAEM,IAAI,CAAC;MACzC;MACA;IACF;IAEA,IAAIA,IAAI,CAACG,CAAC,EAAE;MACV,KAAK,MAAMC,QAAQ,IAAIJ,IAAI,CAACG,CAAC,EAAE;QAC7BR,eAAe,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yB,MAAM,EAAEW,IAAI,EAAEJ,KAAK,CAAC;UACjC;QACF,CAAC,CAAC;MACJ,CAAC,MAAM;QACLA,KAAK,GAAG7B,YAAY,CAAC6B,KAAK,EAAE3B,GAAG,EAAE;UAC/BI,eAAe;UACfD,kBAAkB;UAClByB,YAAY,EAAE1B,MAAM;UACpBH;QACF,CAAC,CAAC;MACJ;MAEAJ,UAAU,CAACyB,MAAM,EAAEW,IAAI,EAAEJ,KAAK,CAAC;IACjC;EACF;AACF","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { commaListItems } from "react-native-css/utilities";
|
|
3
4
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
4
5
|
const advancedTimingFunctions = {
|
|
5
6
|
cubicBezier: () => {
|
|
@@ -15,7 +16,7 @@ const timingFunctionResolver = (resolveValue, value) => {
|
|
|
15
16
|
if (!resolver) {
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
18
|
-
const args = resolveValue(value[2]);
|
|
19
|
+
const args = commaListItems(resolveValue(value[2]));
|
|
19
20
|
if (!Array.isArray(args)) {
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["advancedTimingFunctions","cubicBezier","require","steps","timingFunctionResolver","resolveValue","value","name","resolver","args","Array","isArray","fn","result"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/animation-timing.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["commaListItems","advancedTimingFunctions","cubicBezier","require","steps","timingFunctionResolver","resolveValue","value","name","resolver","args","Array","isArray","fn","result"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/animation-timing.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,4BAA4B;AAI3D;AACA,MAAMC,uBAIL,GAAG;EACFC,WAAW,EAAEA,CAAA,KAAM;IACjB,OACEC,OAAO,CAAC,yBAAyB,CAAC,CAClCD,WAAW;EACf,CAAC;EACDE,KAAK,EAAEA,CAAA,KAAM;IACX,OACED,OAAO,CAAC,yBAAyB,CAAC,CAClCC,KAAK;EACT;AACF,CAAC;AAED,MAAMC,sBAA6C,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EAC7E,MAAMC,IAAI,GAAGD,KAAK,CAAC,CAAC,CAAC;EACrB,MAAME,QAAQ,GAAGR,uBAAuB,CAACO,IAAI,CAAC;EAE9C,IAAI,CAACC,QAAQ,EAAE;IACb;EACF;EAEA,MAAMC,IAAI,GAAGV,cAAc,CAACM,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;EAEnD,IAAI,CAACI,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,EAAE;IACxB;EACF;EAEA,MAAMG,EAAE,GAAGJ,QAAQ,CAAC,CAAC;;EAErB;EACA,MAAMK,MAAM,GAAGD,EAAE,CAAC,GAAGH,IAAI,CAAC;EAE1B,OAAOI,MAAM;AACf,CAAC;AAED,OAAO,MAAMZ,WAAW,GAAGG,sBAAsB;AACjD,OAAO,MAAMD,KAAK,GAAGC,sBAAsB","ignoreList":[]}
|
|
@@ -1,42 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
4
|
-
|
|
5
3
|
import { ColorSpace, to as convert, mix, OKLab, P3, parse, sRGB } from "colorjs.io/fn";
|
|
6
4
|
ColorSpace.register(sRGB);
|
|
7
5
|
ColorSpace.register(P3);
|
|
8
6
|
ColorSpace.register(OKLab);
|
|
9
7
|
export const colorMix = (resolveValue, value) => {
|
|
10
|
-
const
|
|
11
|
-
if (!Array.isArray(
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const resolved = resolveValue(value[2]);
|
|
9
|
+
if (!Array.isArray(resolved)) return;
|
|
10
|
+
|
|
11
|
+
// Resolved descriptors may be cached and shared by another styled component.
|
|
12
|
+
const args = [...resolved];
|
|
14
13
|
try {
|
|
15
14
|
const space = args.shift();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (typeof
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
const leftValue = args.shift();
|
|
16
|
+
if (typeof space !== "string" || typeof leftValue !== "string") return;
|
|
17
|
+
ColorSpace.get(space);
|
|
18
|
+
const left = parse(leftValue);
|
|
19
|
+
const percentage = () => {
|
|
20
|
+
const next = args[0];
|
|
21
|
+
if (typeof next !== "string" || !next.endsWith("%")) return undefined;
|
|
22
|
+
args.shift();
|
|
23
|
+
return Number(next.slice(0, -1)) / 100;
|
|
24
|
+
};
|
|
25
|
+
let leftWeight = percentage();
|
|
26
|
+
const rightValue = args.shift();
|
|
27
|
+
if (typeof rightValue !== "string") return;
|
|
28
|
+
const right = parse(rightValue);
|
|
29
|
+
let rightWeight = percentage();
|
|
30
|
+
if (args.length) return;
|
|
31
|
+
|
|
32
|
+
// CSS Color 5: omitted weights are complementary, then both are normalized.
|
|
33
|
+
leftWeight ??= rightWeight === undefined ? 0.5 : 1 - rightWeight;
|
|
34
|
+
rightWeight ??= 1 - leftWeight;
|
|
35
|
+
if (![leftWeight, rightWeight].every(weight => Number.isFinite(weight) && weight >= 0 && weight <= 1)) return;
|
|
36
|
+
const sum = leftWeight + rightWeight;
|
|
37
|
+
if (sum === 0) return;
|
|
38
|
+
const alphaMultiplier = Math.min(sum, 1);
|
|
39
|
+
let result;
|
|
40
|
+
if (right.alpha === 0 || left.alpha === 0) {
|
|
41
|
+
// A transparent endpoint contributes no premultiplied channels.
|
|
42
|
+
const source = right.alpha === 0 ? left : right;
|
|
43
|
+
const weight = right.alpha === 0 ? leftWeight : rightWeight;
|
|
44
|
+
result = convert(source, "srgb");
|
|
45
|
+
result.alpha = (source.alpha ?? 1) * weight / sum;
|
|
46
|
+
} else {
|
|
47
|
+
result = mix(left, right, rightWeight / sum, {
|
|
48
|
+
space,
|
|
49
|
+
outputSpace: "srgb",
|
|
50
|
+
premultiplied: true
|
|
51
|
+
});
|
|
35
52
|
}
|
|
36
|
-
|
|
37
|
-
space,
|
|
38
|
-
outputSpace: "srgb"
|
|
39
|
-
});
|
|
53
|
+
result.alpha = (result.alpha ?? 1) * alphaMultiplier;
|
|
40
54
|
return `rgba(${(result.coords[0] ?? 0) * 255}, ${(result.coords[1] ?? 0) * 255}, ${(result.coords[2] ?? 0) * 255}, ${result.alpha})`;
|
|
41
55
|
} catch {
|
|
42
56
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ColorSpace","to","convert","mix","OKLab","P3","parse","sRGB","register","colorMix","resolveValue","value","
|
|
1
|
+
{"version":3,"names":["ColorSpace","to","convert","mix","OKLab","P3","parse","sRGB","register","colorMix","resolveValue","value","resolved","Array","isArray","args","space","shift","leftValue","get","left","percentage","next","endsWith","undefined","Number","slice","leftWeight","rightValue","right","rightWeight","length","every","weight","isFinite","sum","alphaMultiplier","Math","min","result","alpha","source","outputSpace","premultiplied","coords"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/color-mix.ts"],"mappings":";;AAAA,SACEA,UAAU,EACVC,EAAE,IAAIC,OAAO,EACbC,GAAG,EACHC,KAAK,EACLC,EAAE,EACFC,KAAK,EACLC,IAAI,QACC,eAAe;AAItBP,UAAU,CAACQ,QAAQ,CAACD,IAAI,CAAC;AACzBP,UAAU,CAACQ,QAAQ,CAACH,EAAE,CAAC;AACvBL,UAAU,CAACQ,QAAQ,CAACJ,KAAK,CAAC;AAE1B,OAAO,MAAMK,QAA+B,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EACtE,MAAMC,QAAQ,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACvC,IAAI,CAACE,KAAK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AC,MAAM;IACN;EACF;AACF,CAAC","ignoreList":[]}
|
|
@@ -53,18 +53,31 @@ export const saturate = (resolveValue, value) => {
|
|
|
53
53
|
export const opacity = (resolveValue, value) => {
|
|
54
54
|
const args = resolveValue(value[2]);
|
|
55
55
|
return {
|
|
56
|
-
|
|
56
|
+
opacity: Array.isArray(args) ? args[0] : args
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
-
const color = ["color", "
|
|
59
|
+
const color = ["color", "color"];
|
|
60
60
|
const offsetX = ["offsetX", "number"];
|
|
61
61
|
const offsetY = ["offsetY", "number"];
|
|
62
|
-
const
|
|
63
|
-
const handler = shorthandHandler([[offsetX, offsetY,
|
|
62
|
+
const standardDeviation = ["standardDeviation", "number"];
|
|
63
|
+
const handler = shorthandHandler([[offsetX, offsetY, standardDeviation, color], [color, offsetX, offsetY], [color, offsetX, offsetY, standardDeviation], [offsetX, offsetY, color], [offsetX, offsetY, standardDeviation, color]], [], "object");
|
|
64
64
|
export const dropShadow = (resolveValue, func, get, options) => {
|
|
65
65
|
const args = resolveValue(func[2]);
|
|
66
66
|
return isStyleDescriptorArray(args) ? {
|
|
67
67
|
dropShadow: handler(resolveValue, args, get, options)
|
|
68
68
|
} : undefined;
|
|
69
69
|
};
|
|
70
|
+
|
|
71
|
+
/** CSS variables may expand to multiple filters; native filter arrays must be flat. */
|
|
72
|
+
export const filter = (resolveValue, descriptor) => {
|
|
73
|
+
const value = resolveValue(descriptor[2]);
|
|
74
|
+
if (Array.isArray(value)) {
|
|
75
|
+
// resolveValue splices a var() in, so only a comma-separated list nests
|
|
76
|
+
const filters = Array.isArray(value[0]) ? value.flat() : value;
|
|
77
|
+
return filters.filter(entry => entry !== undefined && entry !== "initial");
|
|
78
|
+
}
|
|
79
|
+
if (value === undefined || value === "initial") return;
|
|
80
|
+
if (value === "none") return null;
|
|
81
|
+
return typeof value === "string" ? value : [value];
|
|
82
|
+
};
|
|
70
83
|
//# sourceMappingURL=filters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isStyleDescriptorArray","shorthandHandler","blur","resolveValue","value","args","Array","isArray","brightness","contrast","grayscale","hueRotate","invert","sepia","saturate","opacity","color","offsetX","offsetY","
|
|
1
|
+
{"version":3,"names":["isStyleDescriptorArray","shorthandHandler","blur","resolveValue","value","args","Array","isArray","brightness","contrast","grayscale","hueRotate","invert","sepia","saturate","opacity","color","offsetX","offsetY","standardDeviation","handler","dropShadow","func","get","options","undefined","filter","descriptor","filters","flat","entry"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/filters.ts"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,4BAA4B;AAGnE,SAASC,gBAAgB,QAAQ,2BAAwB;AAEzD,OAAO,MAAMC,IAA2B,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EAClE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,OAAO;IACLF,IAAI,EAAGI,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,GAAGA,IAAI,CAAC,CAAC,CAAC,GAAGA;EACzC,CAAC;AACH,CAAC;AAED,OAAO,MAAMG,UAAiC,GAAGA,CAACL,YAAY,EAAEC,KAAK,KAAK;EACxE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,OAAO;IACLI,UAAU,EAAGF,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,GAAGA,IAAI,CAAC,CAAC,CAAC,GAAGA;EAC/C,CAAC;AACH,CAAC;AAED,OAAO,MAAMI,QAA+B,GAAGA,CAACN,YAAY,EAAEC,KAAK,KAAK;EACtE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,OAAO;IACLK,QAAQ,EAAGH,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,GAAGA,IAAI,CAAC,CAAC,CAAC,GAAGA;EAC7C,CAAC;AACH,CAAC;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,EAAEC,OAAO;EACtD,CAAC,GACDC,SAAS;AACf,CAAC;;AAED;AACA,OAAO,MAAMC,MAA6B,GAAGA,CAACvB,YAAY,EAAEwB,UAAU,KAAK;EACzE,MAAMvB,KAAc,GAAGD,YAAY,CAACwB,UAAU,CAAC,CAAC,CAAC,CAAC;EAClD,IAAIrB,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;IACxB;IACA,MAAMwB,OAAkB,GAAGtB,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,CAAC,CAAC,CAAC,GAAGA,KAAK,CAACyB,IAAI,CAAC,CAAC,GAAGzB,KAAK;IACzE,OAAOwB,OAAO,CAACF,MAAM,CAClBI,KAAK,IAAKA,KAAK,KAAKL,SAAS,IAAIK,KAAK,KAAK,SAC9C,CAAC;EACH;EACA,IAAI1B,KAAK,KAAKqB,SAAS,IAAIrB,KAAK,KAAK,SAAS,EAAE;EAChD,IAAIA,KAAK,KAAK,MAAM,EAAE,OAAO,IAAI;EACjC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAG,CAACA,KAAK,CAAC;AACpD,CAAC","ignoreList":[]}
|
|
@@ -16,10 +16,11 @@ export const min = (resolveValue, value) => {
|
|
|
16
16
|
};
|
|
17
17
|
export const clamp = (resolveValue, value) => {
|
|
18
18
|
const args = resolveValue(value[2]);
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
if (!Array.isArray(args)) return;
|
|
20
|
+
const [minimum, preferred, maximum] = args;
|
|
21
|
+
if (typeof minimum !== "number" || typeof preferred !== "number" || typeof maximum !== "number") {
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
|
-
return Math.
|
|
24
|
+
return Math.max(minimum, Math.min(preferred, maximum));
|
|
24
25
|
};
|
|
25
26
|
//# sourceMappingURL=numeric-functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["max","resolveValue","value","args","Array","isArray","some","arg","Math","min","clamp","
|
|
1
|
+
{"version":3,"names":["max","resolveValue","value","args","Array","isArray","some","arg","Math","min","clamp","minimum","preferred","maximum"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/numeric-functions.ts"],"mappings":";;AAEA,OAAO,MAAMA,GAA0B,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EACjE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EAEnC,IAAI,CAACE,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,IAAIA,IAAI,CAACG,IAAI,CAAEC,GAAG,IAAK,OAAOA,GAAG,KAAK,QAAQ,CAAC,EAAE;IACvE;EACF;EAEA,OAAOC,IAAI,CAACR,GAAG,CAAC,GAAIG,IAAiB,CAAC;AACxC,CAAC;AAED,OAAO,MAAMM,GAA0B,GAAGA,CAACR,YAAY,EAAEC,KAAK,KAAK;EACjE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EAEnC,IAAI,CAACE,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,IAAIA,IAAI,CAACG,IAAI,CAAEC,GAAG,IAAK,OAAOA,GAAG,KAAK,QAAQ,CAAC,EAAE;IACvE;EACF;EAEA,OAAOC,IAAI,CAACC,GAAG,CAAC,GAAIN,IAAiB,CAAC;AACxC,CAAC;AAED,OAAO,MAAMO,KAA4B,GAAGA,CAACT,YAAY,EAAEC,KAAK,KAAK;EACnE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EAEnC,IAAI,CAACE,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,EAAE;EAE1B,MAAM,CAACQ,OAAO,EAAEC,SAAS,EAAEC,OAAO,CAAC,GAAGV,IAAiB;EAEvD,IACE,OAAOQ,OAAO,KAAK,QAAQ,IAC3B,OAAOC,SAAS,KAAK,QAAQ,IAC7B,OAAOC,OAAO,KAAK,QAAQ,EAC3B;IACA;EACF;EAEA,OAAOL,IAAI,CAACR,GAAG,CAACW,OAAO,EAAEH,IAAI,CAACC,GAAG,CAACG,SAAS,EAAEC,OAAO,CAAC,CAAC;AACxD,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { PixelRatio, PlatformColor, StyleSheet } from "react-native";
|
|
4
|
+
import { commaListItems } from "react-native-css/utilities";
|
|
4
5
|
export const platformColor = (resolveValue, value) => {
|
|
5
|
-
const color = resolveValue(value[2]);
|
|
6
|
+
const color = commaListItems(resolveValue(value[2]));
|
|
6
7
|
if (Array.isArray(color)) {
|
|
7
8
|
return PlatformColor(...color);
|
|
8
9
|
} else if (typeof color === "string") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PixelRatio","PlatformColor","StyleSheet","platformColor","resolveValue","value","color","Array","isArray","hairlineWidth","pixelRatio","get","fontScale","getFontScale","getPixelSizeForLayoutSize","size","roundToNearestPixel"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/platform-functions.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,aAAa,EAAEC,UAAU,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["PixelRatio","PlatformColor","StyleSheet","commaListItems","platformColor","resolveValue","value","color","Array","isArray","hairlineWidth","pixelRatio","get","fontScale","getFontScale","getPixelSizeForLayoutSize","size","roundToNearestPixel"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/platform-functions.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,aAAa,EAAEC,UAAU,QAAQ,cAAc;AAEpE,SAASC,cAAc,QAAQ,4BAA4B;AAI3D,OAAO,MAAMC,aAAoC,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EAC3E,MAAMC,KAAc,GAAGJ,cAAc,CAACE,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;EAC7D,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;IACxB,OAAON,aAAa,CAAC,GAAIM,KAAkB,CAAC;EAC9C,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACpC,OAAON,aAAa,CAACM,KAAK,CAAC;EAC7B;EAEA;AACF,CAAC;AAED,OAAO,MAAMG,aAAoC,GAAGA,CAAA,KAAM;EACxD,OAAOR,UAAU,CAACQ,aAAa;AACjC,CAAC;AAED,OAAO,MAAMC,UAAiC,GAAGA,CAAA,KAAM;EACrD,OAAOX,UAAU,CAACY,GAAG,CAAC,CAAC;AACzB,CAAC;AAED,OAAO,MAAMC,SAAgC,GAAGA,CAAA,KAAM;EACpD,OAAOb,UAAU,CAACc,YAAY,CAAC,CAAC;AAClC,CAAC;AAED,OAAO,MAAMC,yBAAgD,GAAGA,CAC9DV,YAAY,EACZC,KAAK,KACF;EACH,MAAMU,IAAa,GAAGX,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EAC5C,IAAI,OAAOU,IAAI,KAAK,QAAQ,EAAE;IAC5B,OAAOhB,UAAU,CAACe,yBAAyB,CAACC,IAAI,CAAC;EACnD;EAEA;AACF,CAAC;AAED,OAAO,MAAMC,mBAA0C,GAAGA,CACxDZ,YAAY,EACZC,KAAK,KACF;EACH,MAAMU,IAAa,GAAGX,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EAC5C,IAAI,OAAOU,IAAI,KAAK,QAAQ,EAAE;IAC5B,OAAOhB,UAAU,CAACiB,mBAAmB,CAACD,IAAI,CAAC;EAC7C;EAEA;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { isStyleDescriptorArray } from "react-native-css/utilities";
|
|
4
|
+
export const gradientPosition = (resolveValue, value) => {
|
|
5
|
+
const position = resolveValue(value[2]);
|
|
6
|
+
return typeof position === "number" ? `${position}px` : position;
|
|
7
|
+
};
|
|
8
|
+
export const colorStop = (resolveValue, value) => {
|
|
4
9
|
const args = resolveValue(value[2]);
|
|
5
|
-
if (!Array.isArray(args))
|
|
6
|
-
|
|
10
|
+
if (!Array.isArray(args)) return args;
|
|
11
|
+
const [color, position] = args;
|
|
12
|
+
if (typeof color !== "string") return;
|
|
13
|
+
if (position === undefined) return color;
|
|
14
|
+
if (typeof position !== "number" && typeof position !== "string") return;
|
|
15
|
+
return `${color} ${typeof position === "number" ? `${position}px` : position}`;
|
|
16
|
+
};
|
|
17
|
+
export const join = (resolveValue, value) => {
|
|
18
|
+
const args = value[2];
|
|
19
|
+
if (!isStyleDescriptorArray(args)) {
|
|
20
|
+
return resolveValue(args);
|
|
7
21
|
}
|
|
8
|
-
const array = args[0];
|
|
9
|
-
const separator = args[1] ?? ",";
|
|
22
|
+
const array = resolveValue(args[0]);
|
|
23
|
+
const separator = resolveValue(args[1]) ?? ",";
|
|
10
24
|
if (!Array.isArray(array)) {
|
|
11
25
|
return array;
|
|
12
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["isStyleDescriptorArray","gradientPosition","resolveValue","value","position","colorStop","args","Array","isArray","color","undefined","join","array","separator"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/string-functions.ts"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,4BAA4B;AAInE,OAAO,MAAMC,gBAAuC,GAAGA,CACrDC,YAAY,EACZC,KAAK,KACF;EACH,MAAMC,QAAQ,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACvC,OAAO,OAAOC,QAAQ,KAAK,QAAQ,GAAG,GAAGA,QAAQ,IAAI,GAAGA,QAAQ;AAClE,CAAC;AAED,OAAO,MAAMC,SAAgC,GAAGA,CAACH,YAAY,EAAEC,KAAK,KAAK;EACvE,MAAMG,IAAI,GAAGJ,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,IAAI,CAACI,KAAK,CAACC,OAAO,CAACF,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