react-native-css 3.0.6 → 3.1.0-rc.0
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/CHANGELOG.md +21 -0
- package/dist/commonjs/babel/import-plugin.js +9 -3
- package/dist/commonjs/babel/import-plugin.js.map +1 -1
- package/dist/commonjs/babel/react-native-web.js +16 -3
- package/dist/commonjs/babel/react-native-web.js.map +1 -1
- package/dist/commonjs/babel/react-native.js +7 -2
- 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 +43 -30
- 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 +102 -61
- package/dist/commonjs/compiler/declarations.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 +13 -3
- package/dist/commonjs/compiler/selector-builder.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/index.cjs +46 -1
- package/dist/commonjs/components/index.cjs.map +1 -1
- package/dist/commonjs/jest/index.js +1 -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 +1 -1
- 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/native/api.js +12 -8
- 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/media-query.js +1 -1
- package/dist/commonjs/native/conditions/media-query.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 +12 -5
- package/dist/commonjs/native/react/rules.js.map +1 -1
- package/dist/commonjs/native/react/useNativeCss.js +48 -12
- 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 +32 -22
- 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/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 +18 -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/string-functions.js +16 -1
- package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/transform-functions.js +5 -4
- package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/index.js +140 -14
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/native/styles/resolve.js +10 -6
- package/dist/commonjs/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/native/styles/scale-factor.js +13 -0
- package/dist/commonjs/native/styles/scale-factor.js.map +1 -0
- 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/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/variables.js +55 -43
- package/dist/commonjs/native/styles/variables.js.map +1 -1
- package/dist/commonjs/native-internal/style-collection.js +1 -1
- package/dist/commonjs/native-internal/style-collection.js.map +1 -1
- package/dist/commonjs/utilities/dot-notation.types.js +4 -0
- package/dist/commonjs/utilities/style-descriptor.js +4 -9
- package/dist/commonjs/utilities/style-descriptor.js.map +1 -1
- package/dist/commonjs/web/api.js +1 -1
- 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/import-plugin.js +11 -5
- 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 +7 -2
- 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 +44 -31
- package/dist/module/compiler/compiler.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 +102 -61
- package/dist/module/compiler/declarations.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 +13 -3
- package/dist/module/compiler/selector-builder.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/index.cjs +46 -1
- package/dist/module/components/index.cjs.map +1 -1
- package/dist/module/jest/index.js +1 -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 +1 -1
- 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/native/api.js +14 -10
- 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/media-query.js +1 -1
- package/dist/module/native/conditions/media-query.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 +13 -6
- package/dist/module/native/react/rules.js.map +1 -1
- package/dist/module/native/react/useNativeCss.js +49 -13
- 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 +32 -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/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 +16 -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/string-functions.js +13 -0
- package/dist/module/native/styles/functions/string-functions.js.map +1 -1
- package/dist/module/native/styles/functions/transform-functions.js +5 -4
- package/dist/module/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/native/styles/index.js +140 -14
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/native/styles/resolve.js +10 -6
- package/dist/module/native/styles/resolve.js.map +1 -1
- package/dist/module/native/styles/scale-factor.js +9 -0
- package/dist/module/native/styles/scale-factor.js.map +1 -0
- 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/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/variables.js +55 -43
- package/dist/module/native/styles/variables.js.map +1 -1
- package/dist/module/native-internal/style-collection.js +1 -1
- package/dist/module/native-internal/style-collection.js.map +1 -1
- package/dist/module/utilities/dot-notation.types.js +2 -0
- package/dist/module/utilities/style-descriptor.js +4 -9
- package/dist/module/utilities/style-descriptor.js.map +1 -1
- package/dist/module/web/api.js +1 -1
- 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/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.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +2 -2
- package/dist/typescript/commonjs/src/compiler/declarations.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.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/react-native-safe-area-context.native.d.ts +1 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.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.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +5 -3
- 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/native/api.d.ts +4 -8
- 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/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.map +1 -1
- 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 +7 -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/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/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.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/index.d.ts +2 -2
- package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts +1 -0
- 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/animation.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/variables.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/style-descriptor.d.ts +1 -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/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 +2 -2
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +1 -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 -4
- 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/inline-variables.d.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/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 +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.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 +1 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +6 -4
- 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/native/api.d.ts +5 -9
- 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 +2 -2
- 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/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 +2 -2
- package/dist/typescript/module/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts +4 -4
- 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 +7 -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 +2 -2
- 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 +1 -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 +7 -7
- 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 +4 -3
- 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 +2 -2
- 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 +1 -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 +2 -2
- 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/index.d.ts +3 -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 +1 -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 +61 -27
- package/src/babel/import-plugin.ts +15 -4
- package/src/babel/react-native-web.ts +32 -3
- package/src/babel/react-native.ts +7 -1
- package/src/compiler/atRules.ts +44 -0
- package/src/compiler/compiler.ts +73 -49
- package/src/compiler/container-query.ts +8 -3
- package/src/compiler/declarations.ts +189 -100
- package/src/compiler/lightningcss-loader.ts +16 -15
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +29 -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/index.cts +46 -1
- package/src/jest/index.ts +1 -1
- package/src/metro/cache-version.ts +48 -0
- package/src/metro/index.ts +2 -0
- package/src/metro/metro-transformer.ts +9 -6
- package/src/metro/typescript.ts +53 -6
- package/src/native/api.tsx +20 -14
- package/src/native/conditions/attributes.ts +26 -9
- package/src/native/conditions/container-query.ts +11 -9
- package/src/native/conditions/media-query.ts +1 -1
- package/src/native/react/interaction.ts +11 -6
- package/src/native/react/rules.ts +13 -5
- package/src/native/react/useNativeCss.ts +54 -14
- package/src/native/react/usePassthrough.ts +3 -2
- package/src/native/reactivity.ts +42 -24
- package/src/native/reanimated.ts +24 -5
- package/src/native/styles/functions/color-mix.ts +45 -39
- package/src/native/styles/functions/filters.ts +20 -6
- package/src/native/styles/functions/numeric-functions.ts +7 -6
- package/src/native/styles/functions/string-functions.ts +18 -0
- package/src/native/styles/functions/transform-functions.ts +5 -4
- package/src/native/styles/index.ts +146 -15
- package/src/native/styles/resolve.ts +15 -11
- package/src/native/styles/scale-factor.ts +6 -0
- package/src/native/styles/shorthands/animation.ts +8 -2
- package/src/native/styles/shorthands/index.ts +1 -0
- package/src/native/styles/shorthands/logical-border-width.ts +32 -0
- package/src/native/styles/variables.ts +48 -38
- package/src/native-internal/style-collection.ts +1 -1
- package/src/runtime.types.ts +17 -15
- package/src/utilities/dot-notation.types.ts +4 -3
- package/src/utilities/style-descriptor.ts +11 -16
- package/src/web/api.tsx +6 -11
- 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
|
@@ -4,13 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
import Color from "colorjs.io";
|
|
6
6
|
import { isStyleFunction } from "../utilities/index.js";
|
|
7
|
+
import { isMappingProperty } from "./atRules.js";
|
|
7
8
|
import { parseEasingFunction, parseIterationCount } from "./keyframes.js";
|
|
8
9
|
import { toRNProperty } from "./selectors.js";
|
|
9
10
|
const CommaSeparator = Symbol("CommaSeparator");
|
|
10
11
|
const propertyRename = {
|
|
11
|
-
"background-image": "experimental_backgroundImage"
|
|
12
|
+
"background-image": "experimental_backgroundImage",
|
|
13
|
+
// React Native has no border-inline-* props, but ships the equivalent
|
|
14
|
+
// RTL-aware border-start-* / border-end-* props
|
|
15
|
+
"border-inline-end-color": "border-end-color",
|
|
16
|
+
"border-inline-end-width": "border-end-width",
|
|
17
|
+
"border-inline-start-color": "border-start-color",
|
|
18
|
+
"border-inline-start-width": "border-start-width",
|
|
19
|
+
"border-block-start-width": "border-top-width",
|
|
20
|
+
"border-block-end-width": "border-bottom-width",
|
|
21
|
+
"font-variant-caps": "font-variant"
|
|
12
22
|
};
|
|
13
|
-
|
|
23
|
+
|
|
24
|
+
// React Native only supports a uniform borderStyle, so per-side border
|
|
25
|
+
// styles have no native equivalent and are dropped. "solid" is dropped
|
|
26
|
+
// silently as it matches React Native's default rendering.
|
|
27
|
+
const unsupportedLogicalStyles = new Set(["border-inline-style", "border-inline-start-style", "border-inline-end-style", "border-block-style", "border-block-start-style", "border-block-end-style"]);
|
|
28
|
+
const unparsedRuntimeParsing = new Set(["animation", "animation-name", "border", "border-block-width", "border-inline-width", "box-shadow", "filter", "line-height", "rotate", "scale", "text-shadow", "transform", "translate"]);
|
|
14
29
|
const parsers = {
|
|
15
30
|
"align-content": parseAlignContent,
|
|
16
31
|
"align-items": parseAlignItems,
|
|
@@ -34,10 +49,11 @@ const parsers = {
|
|
|
34
49
|
"border-block-color": parseBorderColor,
|
|
35
50
|
"border-block-end": parseBorderBlockEnd,
|
|
36
51
|
"border-block-end-color": parseColorDeclaration,
|
|
52
|
+
"border-block-end-style": parseBorderInlineStyle,
|
|
37
53
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
38
54
|
"border-block-start": parseBorderBlockStart,
|
|
39
55
|
"border-block-start-color": parseColorDeclaration,
|
|
40
|
-
"border-block-start-style":
|
|
56
|
+
"border-block-start-style": parseBorderInlineStyle,
|
|
41
57
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
42
58
|
"border-block-style": parseBorderBlockStyle,
|
|
43
59
|
"border-block-width": parseBorderBlockWidth,
|
|
@@ -240,8 +256,8 @@ function parseInsetInline({
|
|
|
240
256
|
value
|
|
241
257
|
}, builder) {
|
|
242
258
|
builder.addShorthand("inset-inline", {
|
|
243
|
-
"inset-
|
|
244
|
-
"inset-
|
|
259
|
+
"inset-inline-start": parseLengthPercentageOrAuto(value.inlineStart, builder),
|
|
260
|
+
"inset-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder)
|
|
245
261
|
});
|
|
246
262
|
}
|
|
247
263
|
function parseInset({
|
|
@@ -275,14 +291,14 @@ function parseBorderColor(declaration, builder) {
|
|
|
275
291
|
} else {
|
|
276
292
|
const start = parseColor(declaration.value.start, builder);
|
|
277
293
|
const end = parseColor(declaration.value.end, builder);
|
|
278
|
-
if (
|
|
294
|
+
if (declaration.property === "border-inline-color") {
|
|
295
|
+
builder.addDescriptor("border-start-color", start);
|
|
296
|
+
builder.addDescriptor("border-end-color", end);
|
|
297
|
+
} else if (start === end) {
|
|
279
298
|
builder.addDescriptor(declaration.property, start);
|
|
280
|
-
} else
|
|
299
|
+
} else {
|
|
281
300
|
builder.addDescriptor("border-top-color", start);
|
|
282
301
|
builder.addDescriptor("border-bottom-color", end);
|
|
283
|
-
} else {
|
|
284
|
-
builder.addDescriptor("border-left-color", start);
|
|
285
|
-
builder.addDescriptor("border-right-color", end);
|
|
286
302
|
}
|
|
287
303
|
}
|
|
288
304
|
}
|
|
@@ -316,53 +332,65 @@ function parseBorderBlock({
|
|
|
316
332
|
value
|
|
317
333
|
}, builder) {
|
|
318
334
|
builder.addDescriptor("border-block-color", parseColor(value.color, builder));
|
|
319
|
-
|
|
320
|
-
builder.addDescriptor("border-
|
|
335
|
+
const width = parseBorderSideWidth(value.width, builder);
|
|
336
|
+
builder.addDescriptor("border-top-width", width);
|
|
337
|
+
builder.addDescriptor("border-bottom-width", width);
|
|
338
|
+
dropUnsupportedInlineStyle(parseBorderStyle(value.style, builder), builder, "border-block-style");
|
|
321
339
|
}
|
|
322
340
|
function parseBorderBlockStart({
|
|
323
341
|
value
|
|
324
342
|
}, builder) {
|
|
325
343
|
builder.addDescriptor("border-block-start-color", parseColor(value.color, builder));
|
|
326
|
-
builder.addDescriptor("border-
|
|
344
|
+
builder.addDescriptor("border-top-width", parseBorderSideWidth(value.width, builder));
|
|
345
|
+
dropUnsupportedInlineStyle(parseBorderStyle(value.style, builder), builder, "border-block-start-style");
|
|
327
346
|
}
|
|
328
347
|
function parseBorderBlockEnd({
|
|
329
348
|
value
|
|
330
349
|
}, builder) {
|
|
331
350
|
builder.addDescriptor("border-block-end-color", parseColor(value.color, builder));
|
|
332
|
-
builder.addDescriptor("border-
|
|
351
|
+
builder.addDescriptor("border-bottom-width", parseBorderSideWidth(value.width, builder));
|
|
352
|
+
dropUnsupportedInlineStyle(parseBorderStyle(value.style, builder), builder, "border-block-end-style");
|
|
333
353
|
}
|
|
334
354
|
function parseBorderInline({
|
|
335
355
|
value
|
|
336
356
|
}, builder) {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
builder.addDescriptor("border-
|
|
357
|
+
const color = parseColor(value.color, builder);
|
|
358
|
+
const width = parseBorderSideWidth(value.width, builder);
|
|
359
|
+
builder.addDescriptor("border-start-color", color);
|
|
360
|
+
builder.addDescriptor("border-end-color", color);
|
|
361
|
+
builder.addDescriptor("border-start-width", width);
|
|
362
|
+
builder.addDescriptor("border-end-width", width);
|
|
363
|
+
dropUnsupportedInlineStyle(parseBorderStyle(value.style, builder), builder, "border-inline-style");
|
|
340
364
|
}
|
|
341
365
|
function parseBorderInlineStart({
|
|
342
366
|
value
|
|
343
367
|
}, builder) {
|
|
344
|
-
builder.addDescriptor("border-
|
|
345
|
-
builder.addDescriptor("border-
|
|
346
|
-
builder
|
|
368
|
+
builder.addDescriptor("border-start-color", parseColor(value.color, builder));
|
|
369
|
+
builder.addDescriptor("border-start-width", parseBorderSideWidth(value.width, builder));
|
|
370
|
+
dropUnsupportedInlineStyle(parseBorderStyle(value.style, builder), builder, "border-inline-start-style");
|
|
347
371
|
}
|
|
348
372
|
function parseBorderInlineEnd({
|
|
349
373
|
value
|
|
350
374
|
}, builder) {
|
|
351
|
-
builder.addDescriptor("border-
|
|
352
|
-
builder.addDescriptor("border-
|
|
353
|
-
builder
|
|
375
|
+
builder.addDescriptor("border-end-color", parseColor(value.color, builder));
|
|
376
|
+
builder.addDescriptor("border-end-width", parseBorderSideWidth(value.width, builder));
|
|
377
|
+
dropUnsupportedInlineStyle(parseBorderStyle(value.style, builder), builder, "border-inline-end-style");
|
|
354
378
|
}
|
|
355
379
|
export function parseBorderInlineWidth(declaration, builder) {
|
|
356
|
-
builder.addDescriptor("border-
|
|
380
|
+
builder.addDescriptor("border-start-width", parseBorderSideWidth(declaration.value.start, builder));
|
|
381
|
+
builder.addDescriptor("border-end-width", parseBorderSideWidth(declaration.value.end, builder));
|
|
357
382
|
}
|
|
358
383
|
export function parseBorderInlineStyle(declaration, builder) {
|
|
359
384
|
if (typeof declaration.value === "string") {
|
|
360
|
-
|
|
361
|
-
} else if (declaration.value.start === declaration.value.end) {
|
|
362
|
-
builder.addDescriptor(declaration.property, parseBorderStyle(declaration.value.start, builder));
|
|
385
|
+
dropUnsupportedInlineStyle(parseBorderStyle(declaration.value, builder), builder, declaration.property);
|
|
363
386
|
} else {
|
|
364
|
-
|
|
365
|
-
|
|
387
|
+
dropUnsupportedInlineStyle(parseBorderStyle(declaration.value.start, builder), builder, "border-inline-start-style");
|
|
388
|
+
dropUnsupportedInlineStyle(parseBorderStyle(declaration.value.end, builder), builder, "border-inline-end-style");
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function dropUnsupportedInlineStyle(style, builder, property) {
|
|
392
|
+
if (style !== undefined && style !== "solid") {
|
|
393
|
+
builder.addWarning("style", property, style);
|
|
366
394
|
}
|
|
367
395
|
}
|
|
368
396
|
function parseFlexFlow({
|
|
@@ -528,7 +556,7 @@ function parseScale({
|
|
|
528
556
|
}
|
|
529
557
|
export function parseScaleValue(translate, prop, builder) {
|
|
530
558
|
if (translate === "none") {
|
|
531
|
-
return
|
|
559
|
+
return 1;
|
|
532
560
|
}
|
|
533
561
|
return parseLength(translate[prop], builder);
|
|
534
562
|
}
|
|
@@ -578,6 +606,10 @@ export function parseUnparsedDeclaration(declaration, builder) {
|
|
|
578
606
|
builder.addWarning("property", property);
|
|
579
607
|
return;
|
|
580
608
|
}
|
|
609
|
+
if (unsupportedLogicalStyles.has(property)) {
|
|
610
|
+
builder.addWarning("property", property);
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
581
613
|
builder.setWarningProperty(property);
|
|
582
614
|
|
|
583
615
|
/**
|
|
@@ -614,7 +646,10 @@ export function parseUnparsedDeclaration(declaration, builder) {
|
|
|
614
646
|
}
|
|
615
647
|
export function parseCustomDeclaration(declaration, builder) {
|
|
616
648
|
const property = declaration.value.name;
|
|
617
|
-
if (property
|
|
649
|
+
if (isMappingProperty(property)) {
|
|
650
|
+
// Consumed before declarations so property order cannot affect mapping.
|
|
651
|
+
return;
|
|
652
|
+
} else if (property === "-webkit-line-clamp") {
|
|
618
653
|
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
619
654
|
} else if (property === "-rn-ripple-style") {
|
|
620
655
|
if (parseUnparsed(declaration.value.value, builder, property) === "borderless") {
|
|
@@ -635,6 +670,11 @@ export function parseCustomDeclaration(declaration, builder) {
|
|
|
635
670
|
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
636
671
|
} else if (property === "corner-shape") {
|
|
637
672
|
parseCornerShape(declaration.value, builder);
|
|
673
|
+
} else if (property === "font-variant") {
|
|
674
|
+
const parsedFontVariant = parseFontVariantCaps(parseUnparsed(declaration.value.value, builder, property), builder);
|
|
675
|
+
if (parsedFontVariant !== undefined) {
|
|
676
|
+
builder.addDescriptor(property, parsedFontVariant);
|
|
677
|
+
}
|
|
638
678
|
} else if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
|
|
639
679
|
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
640
680
|
} else {
|
|
@@ -1087,7 +1127,19 @@ export function parseFontColorDeclaration(declaration, builder) {
|
|
|
1087
1127
|
}
|
|
1088
1128
|
}
|
|
1089
1129
|
export function parseColorDeclaration(declaration, builder) {
|
|
1090
|
-
builder.addDescriptor(declaration.property, parseColor(declaration.value, builder));
|
|
1130
|
+
builder.addDescriptor(propertyRename[declaration.property] ?? declaration.property, parseColor(declaration.value, builder));
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Lab/LCH/OKLab/OKLCH channels can be `NaN` when lightningcss resolves a
|
|
1135
|
+
* degenerate `color-mix()` at compile time (e.g. mixing black with
|
|
1136
|
+
* `transparent` in oklab yields `NaN` for the a/b chromaticity channels).
|
|
1137
|
+
* Passing `NaN` to colorjs.io produces an invalid string such as
|
|
1138
|
+
* `#NaNNaNNaN80`, which React Native silently discards. Per CSS Color 4 a
|
|
1139
|
+
* missing component is treated as `0`, so coerce `NaN` to `0`.
|
|
1140
|
+
*/
|
|
1141
|
+
function nanToZero(value) {
|
|
1142
|
+
return Number.isNaN(value) ? 0 : value;
|
|
1091
1143
|
}
|
|
1092
1144
|
export function parseColor(cssColor, builder) {
|
|
1093
1145
|
if (typeof cssColor === "string") {
|
|
@@ -1140,28 +1192,28 @@ export function parseColor(cssColor, builder) {
|
|
|
1140
1192
|
case "lab":
|
|
1141
1193
|
color = new Color({
|
|
1142
1194
|
space: cssColor.type,
|
|
1143
|
-
coords: [cssColor.l, cssColor.a, cssColor.b],
|
|
1195
|
+
coords: [nanToZero(cssColor.l), nanToZero(cssColor.a), nanToZero(cssColor.b)],
|
|
1144
1196
|
alpha: cssColor.alpha
|
|
1145
1197
|
});
|
|
1146
1198
|
break;
|
|
1147
1199
|
case "lch":
|
|
1148
1200
|
color = new Color({
|
|
1149
1201
|
space: cssColor.type,
|
|
1150
|
-
coords: [cssColor.l, cssColor.c, cssColor.h],
|
|
1202
|
+
coords: [nanToZero(cssColor.l), nanToZero(cssColor.c), nanToZero(cssColor.h)],
|
|
1151
1203
|
alpha: cssColor.alpha
|
|
1152
1204
|
});
|
|
1153
1205
|
break;
|
|
1154
1206
|
case "oklab":
|
|
1155
1207
|
color = new Color({
|
|
1156
1208
|
space: cssColor.type,
|
|
1157
|
-
coords: [cssColor.l, cssColor.a, cssColor.b],
|
|
1209
|
+
coords: [nanToZero(cssColor.l), nanToZero(cssColor.a), nanToZero(cssColor.b)],
|
|
1158
1210
|
alpha: cssColor.alpha
|
|
1159
1211
|
});
|
|
1160
1212
|
break;
|
|
1161
1213
|
case "oklch":
|
|
1162
1214
|
color = new Color({
|
|
1163
1215
|
space: cssColor.type,
|
|
1164
|
-
coords: [cssColor.l, cssColor.c, cssColor.h],
|
|
1216
|
+
coords: [nanToZero(cssColor.l), nanToZero(cssColor.c), nanToZero(cssColor.h)],
|
|
1165
1217
|
alpha: cssColor.alpha
|
|
1166
1218
|
});
|
|
1167
1219
|
break;
|
|
@@ -1470,25 +1522,17 @@ export function parseBorderStyle(value, builder) {
|
|
|
1470
1522
|
export function parseBorderBlockWidth(declaration, builder) {
|
|
1471
1523
|
const start = parseBorderSideWidth(declaration.value.start, builder);
|
|
1472
1524
|
const end = parseBorderSideWidth(declaration.value.end, builder);
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
} else {
|
|
1476
|
-
builder.addDescriptor("border-block-start-width", start);
|
|
1477
|
-
builder.addDescriptor("border-block-end-width", end);
|
|
1478
|
-
}
|
|
1525
|
+
builder.addDescriptor("border-top-width", start);
|
|
1526
|
+
builder.addDescriptor("border-bottom-width", end);
|
|
1479
1527
|
}
|
|
1480
1528
|
function parseBorderBlockStyle(declaration, builder) {
|
|
1481
1529
|
const start = parseBorderStyle(declaration.value.start, builder);
|
|
1482
1530
|
const end = parseBorderStyle(declaration.value.end, builder);
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
} else {
|
|
1486
|
-
builder.addDescriptor("border-block-start-style", start);
|
|
1487
|
-
builder.addDescriptor("border-block-end-style", end);
|
|
1488
|
-
}
|
|
1531
|
+
dropUnsupportedInlineStyle(start, builder, "border-block-start-style");
|
|
1532
|
+
dropUnsupportedInlineStyle(end, builder, "border-block-end-style");
|
|
1489
1533
|
}
|
|
1490
1534
|
export function parseBorderSideWidthDeclaration(declaration, builder) {
|
|
1491
|
-
builder.addDescriptor(declaration.property, parseBorderSideWidth(declaration.value, builder));
|
|
1535
|
+
builder.addDescriptor(propertyRename[declaration.property] ?? declaration.property, parseBorderSideWidth(declaration.value, builder));
|
|
1492
1536
|
}
|
|
1493
1537
|
export function parseBorderSideWidth(value, builder) {
|
|
1494
1538
|
if (value.type === "length") {
|
|
@@ -1517,14 +1561,14 @@ function parseFontFamily({
|
|
|
1517
1561
|
return value[0];
|
|
1518
1562
|
}
|
|
1519
1563
|
export function parseLineHeightDeclaration(declaration, builder) {
|
|
1520
|
-
builder.addDescriptor("line-height",
|
|
1564
|
+
builder.addDescriptor("line-height", parseLineHeight(declaration.value, builder));
|
|
1521
1565
|
}
|
|
1522
1566
|
export function parseLineHeight(value, builder) {
|
|
1523
1567
|
switch (value.type) {
|
|
1524
1568
|
case "normal":
|
|
1525
1569
|
return undefined;
|
|
1526
1570
|
case "number":
|
|
1527
|
-
return [{}, "em",
|
|
1571
|
+
return [{}, "em", value.value, 1];
|
|
1528
1572
|
case "length":
|
|
1529
1573
|
{
|
|
1530
1574
|
const length = value.value;
|
|
@@ -1837,7 +1881,8 @@ export function parseCalcFn(name, tokens, builder, property) {
|
|
|
1837
1881
|
return;
|
|
1838
1882
|
}
|
|
1839
1883
|
export function parseColorMix(tokens, builder, property) {
|
|
1840
|
-
const [inToken, whitespace, colorSpace, comma, ...
|
|
1884
|
+
const [inToken, whitespace, colorSpace, comma, ...remaining] = tokens;
|
|
1885
|
+
const rest = remaining.filter(token => token.type !== "token" || !["white-space", "comment"].includes(token.value.type));
|
|
1841
1886
|
if (typeof inToken !== "object" || inToken.type !== "token" || inToken.value.type !== "ident" || inToken.value.value !== "in") {
|
|
1842
1887
|
return;
|
|
1843
1888
|
}
|
|
@@ -1867,10 +1912,6 @@ export function parseColorMix(tokens, builder, property) {
|
|
|
1867
1912
|
}
|
|
1868
1913
|
nextToken = rest.shift();
|
|
1869
1914
|
const rightColorArg = parseUnparsed(nextToken, builder, property);
|
|
1870
|
-
if (rightColorArg === "transparent") {
|
|
1871
|
-
// Ignore the rest, treat as single color with alpha
|
|
1872
|
-
return [{}, "colorMix", [colorSpaceArg, leftColorArg, leftColorPercentage]];
|
|
1873
|
-
}
|
|
1874
1915
|
nextToken = rest.shift();
|
|
1875
1916
|
let rightColorPercentage;
|
|
1876
1917
|
if (nextToken?.type !== "token" || nextToken.value.type !== "comma") {
|
|
@@ -2138,7 +2179,7 @@ export function kebabCase(str) {
|
|
|
2138
2179
|
return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? "-" : "") + $.toLowerCase());
|
|
2139
2180
|
}
|
|
2140
2181
|
function parseBackgroundImage(declaration, builder) {
|
|
2141
|
-
builder.addDescriptor("experimental_backgroundImage", declaration.value.flatMap(image => {
|
|
2182
|
+
builder.addDescriptor("experimental_backgroundImage", [{}, "join", [declaration.value.flatMap(image => {
|
|
2142
2183
|
switch (image.type) {
|
|
2143
2184
|
case "gradient":
|
|
2144
2185
|
{
|
|
@@ -2149,7 +2190,7 @@ function parseBackgroundImage(declaration, builder) {
|
|
|
2149
2190
|
return ["none"];
|
|
2150
2191
|
}
|
|
2151
2192
|
return [];
|
|
2152
|
-
}));
|
|
2193
|
+
}), ", "]]);
|
|
2153
2194
|
return;
|
|
2154
2195
|
}
|
|
2155
2196
|
function parseGradient(gradient, builder) {
|
|
@@ -2185,10 +2226,10 @@ function parseGradientItem(item, builder) {
|
|
|
2185
2226
|
if (item.position) {
|
|
2186
2227
|
args.push(parseLength(item.position, builder));
|
|
2187
2228
|
}
|
|
2188
|
-
return [{}, "
|
|
2229
|
+
return [{}, "colorStop", args, 1];
|
|
2189
2230
|
}
|
|
2190
2231
|
case "hint":
|
|
2191
|
-
return parseLength(item.value, builder);
|
|
2232
|
+
return [{}, "gradientPosition", parseLength(item.value, builder), 1];
|
|
2192
2233
|
}
|
|
2193
2234
|
}
|
|
2194
2235
|
function parseObjectFit(declaration, builder) {
|
|
@@ -2247,7 +2288,7 @@ function parseFilter(declaration, builder) {
|
|
|
2247
2288
|
};
|
|
2248
2289
|
case "hue-rotate":
|
|
2249
2290
|
return {
|
|
2250
|
-
[value.type]: parseAngle(value.value, builder)
|
|
2291
|
+
[toRNProperty(value.type)]: parseAngle(value.value, builder)
|
|
2251
2292
|
};
|
|
2252
2293
|
case "drop-shadow":
|
|
2253
2294
|
return [{}, toRNProperty(value.type), [parseLength(value.value.xOffset, builder), parseLength(value.value.yOffset, builder), parseLength(value.value.blur, builder), parseColor(value.value.color, builder)]];
|