react-native-css 3.0.7 → 3.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +24 -0
- 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 +44 -28
- 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 +103 -62
- 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 +15 -4
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +11 -3
- package/dist/commonjs/compiler/stylesheet.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 +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 +13 -9
- 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 +60 -11
- 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 +61 -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/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 +14 -1
- 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 +95 -12
- 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/root.js +18 -7
- package/dist/commonjs/native-internal/root.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/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/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/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 +45 -29
- 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 +103 -62
- 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 +15 -4
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +11 -3
- package/dist/module/compiler/stylesheet.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 +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 +15 -11
- 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 +63 -14
- 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 +55 -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 +12 -0
- 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 +95 -12
- 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/root.js +18 -7
- package/dist/module/native-internal/root.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/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/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/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 +6 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.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/compiler/stylesheet.d.ts +6 -8
- package/dist/typescript/commonjs/src/compiler/stylesheet.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/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 +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 +14 -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/root.d.ts +12 -0
- package/dist/typescript/commonjs/src/native-internal/root.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/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 +7 -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 +6 -8
- package/dist/typescript/module/src/compiler/stylesheet.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/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 +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 +14 -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 +13 -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 +63 -28
- 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 +78 -47
- package/src/compiler/compiler.types.ts +9 -0
- package/src/compiler/container-query.ts +8 -3
- package/src/compiler/declarations.ts +190 -101
- package/src/compiler/lightningcss-loader.ts +16 -15
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +31 -4
- package/src/compiler/stylesheet.ts +17 -10
- 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 +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 +22 -17
- 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 +69 -14
- package/src/native/react/usePassthrough.ts +3 -2
- package/src/native/reactivity.ts +76 -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 +14 -0
- 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 +100 -13
- 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/root.ts +40 -13
- package/src/native-internal/style-collection.ts +1 -1
- 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/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
|
@@ -37,6 +37,7 @@ import type {
|
|
|
37
37
|
} from "lightningcss";
|
|
38
38
|
|
|
39
39
|
import { isStyleFunction } from "../utilities";
|
|
40
|
+
import { isMappingProperty } from "./atRules";
|
|
40
41
|
import type {
|
|
41
42
|
StyleDescriptor,
|
|
42
43
|
StyleFunction,
|
|
@@ -62,12 +63,37 @@ type Parser<T extends Declaration["property"] = Declaration["property"]> = (
|
|
|
62
63
|
|
|
63
64
|
const propertyRename: Record<string, string> = {
|
|
64
65
|
"background-image": "experimental_backgroundImage",
|
|
66
|
+
// React Native has no border-inline-* props, but ships the equivalent
|
|
67
|
+
// RTL-aware border-start-* / border-end-* props
|
|
68
|
+
"border-inline-end-color": "border-end-color",
|
|
69
|
+
"border-inline-end-width": "border-end-width",
|
|
70
|
+
"border-inline-start-color": "border-start-color",
|
|
71
|
+
"border-inline-start-width": "border-start-width",
|
|
72
|
+
"border-block-start-width": "border-top-width",
|
|
73
|
+
"border-block-end-width": "border-bottom-width",
|
|
74
|
+
"font-variant-caps": "font-variant",
|
|
65
75
|
};
|
|
66
76
|
|
|
77
|
+
// React Native only supports a uniform borderStyle, so per-side border
|
|
78
|
+
// styles have no native equivalent and are dropped. "solid" is dropped
|
|
79
|
+
// silently as it matches React Native's default rendering.
|
|
80
|
+
const unsupportedLogicalStyles = new Set([
|
|
81
|
+
"border-inline-style",
|
|
82
|
+
"border-inline-start-style",
|
|
83
|
+
"border-inline-end-style",
|
|
84
|
+
"border-block-style",
|
|
85
|
+
"border-block-start-style",
|
|
86
|
+
"border-block-end-style",
|
|
87
|
+
]);
|
|
88
|
+
|
|
67
89
|
const unparsedRuntimeParsing = new Set([
|
|
68
90
|
"animation",
|
|
91
|
+
"animation-name",
|
|
69
92
|
"border",
|
|
93
|
+
"border-block-width",
|
|
94
|
+
"border-inline-width",
|
|
70
95
|
"box-shadow",
|
|
96
|
+
"filter",
|
|
71
97
|
"line-height",
|
|
72
98
|
"rotate",
|
|
73
99
|
"scale",
|
|
@@ -101,10 +127,11 @@ const parsers: {
|
|
|
101
127
|
"border-block-color": parseBorderColor,
|
|
102
128
|
"border-block-end": parseBorderBlockEnd,
|
|
103
129
|
"border-block-end-color": parseColorDeclaration,
|
|
130
|
+
"border-block-end-style": parseBorderInlineStyle,
|
|
104
131
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
105
132
|
"border-block-start": parseBorderBlockStart,
|
|
106
133
|
"border-block-start-color": parseColorDeclaration,
|
|
107
|
-
"border-block-start-style":
|
|
134
|
+
"border-block-start-style": parseBorderInlineStyle,
|
|
108
135
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
109
136
|
"border-block-style": parseBorderBlockStyle,
|
|
110
137
|
"border-block-width": parseBorderBlockWidth,
|
|
@@ -320,11 +347,11 @@ function parseInsetInline(
|
|
|
320
347
|
builder: StylesheetBuilder,
|
|
321
348
|
) {
|
|
322
349
|
builder.addShorthand("inset-inline", {
|
|
323
|
-
"inset-
|
|
350
|
+
"inset-inline-start": parseLengthPercentageOrAuto(
|
|
324
351
|
value.inlineStart,
|
|
325
352
|
builder,
|
|
326
353
|
),
|
|
327
|
-
"inset-
|
|
354
|
+
"inset-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder),
|
|
328
355
|
});
|
|
329
356
|
}
|
|
330
357
|
|
|
@@ -381,14 +408,14 @@ function parseBorderColor(
|
|
|
381
408
|
const start = parseColor(declaration.value.start, builder);
|
|
382
409
|
const end = parseColor(declaration.value.end, builder);
|
|
383
410
|
|
|
384
|
-
if (
|
|
411
|
+
if (declaration.property === "border-inline-color") {
|
|
412
|
+
builder.addDescriptor("border-start-color", start);
|
|
413
|
+
builder.addDescriptor("border-end-color", end);
|
|
414
|
+
} else if (start === end) {
|
|
385
415
|
builder.addDescriptor(declaration.property, start);
|
|
386
|
-
} else
|
|
416
|
+
} else {
|
|
387
417
|
builder.addDescriptor("border-top-color", start);
|
|
388
418
|
builder.addDescriptor("border-bottom-color", end);
|
|
389
|
-
} else {
|
|
390
|
-
builder.addDescriptor("border-left-color", start);
|
|
391
|
-
builder.addDescriptor("border-right-color", end);
|
|
392
419
|
}
|
|
393
420
|
}
|
|
394
421
|
}
|
|
@@ -437,13 +464,13 @@ function parseBorderBlock(
|
|
|
437
464
|
builder: StylesheetBuilder,
|
|
438
465
|
) {
|
|
439
466
|
builder.addDescriptor("border-block-color", parseColor(value.color, builder));
|
|
440
|
-
builder
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
builder.addDescriptor(
|
|
445
|
-
"border-block-style",
|
|
467
|
+
const width = parseBorderSideWidth(value.width, builder);
|
|
468
|
+
builder.addDescriptor("border-top-width", width);
|
|
469
|
+
builder.addDescriptor("border-bottom-width", width);
|
|
470
|
+
dropUnsupportedInlineStyle(
|
|
446
471
|
parseBorderStyle(value.style, builder),
|
|
472
|
+
builder,
|
|
473
|
+
"border-block-style",
|
|
447
474
|
);
|
|
448
475
|
}
|
|
449
476
|
|
|
@@ -456,9 +483,14 @@ function parseBorderBlockStart(
|
|
|
456
483
|
parseColor(value.color, builder),
|
|
457
484
|
);
|
|
458
485
|
builder.addDescriptor(
|
|
459
|
-
"border-
|
|
486
|
+
"border-top-width",
|
|
460
487
|
parseBorderSideWidth(value.width, builder),
|
|
461
488
|
);
|
|
489
|
+
dropUnsupportedInlineStyle(
|
|
490
|
+
parseBorderStyle(value.style, builder),
|
|
491
|
+
builder,
|
|
492
|
+
"border-block-start-style",
|
|
493
|
+
);
|
|
462
494
|
}
|
|
463
495
|
|
|
464
496
|
function parseBorderBlockEnd(
|
|
@@ -470,26 +502,31 @@ function parseBorderBlockEnd(
|
|
|
470
502
|
parseColor(value.color, builder),
|
|
471
503
|
);
|
|
472
504
|
builder.addDescriptor(
|
|
473
|
-
"border-
|
|
505
|
+
"border-bottom-width",
|
|
474
506
|
parseBorderSideWidth(value.width, builder),
|
|
475
507
|
);
|
|
508
|
+
dropUnsupportedInlineStyle(
|
|
509
|
+
parseBorderStyle(value.style, builder),
|
|
510
|
+
builder,
|
|
511
|
+
"border-block-end-style",
|
|
512
|
+
);
|
|
476
513
|
}
|
|
477
514
|
|
|
478
515
|
function parseBorderInline(
|
|
479
516
|
{ value }: DeclarationType<"border-inline">,
|
|
480
517
|
builder: StylesheetBuilder,
|
|
481
518
|
) {
|
|
482
|
-
builder
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
);
|
|
486
|
-
builder.addDescriptor(
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
builder.addDescriptor(
|
|
491
|
-
"border-inline-style",
|
|
519
|
+
const color = parseColor(value.color, builder);
|
|
520
|
+
const width = parseBorderSideWidth(value.width, builder);
|
|
521
|
+
|
|
522
|
+
builder.addDescriptor("border-start-color", color);
|
|
523
|
+
builder.addDescriptor("border-end-color", color);
|
|
524
|
+
builder.addDescriptor("border-start-width", width);
|
|
525
|
+
builder.addDescriptor("border-end-width", width);
|
|
526
|
+
dropUnsupportedInlineStyle(
|
|
492
527
|
parseBorderStyle(value.style, builder),
|
|
528
|
+
builder,
|
|
529
|
+
"border-inline-style",
|
|
493
530
|
);
|
|
494
531
|
}
|
|
495
532
|
|
|
@@ -497,17 +534,15 @@ function parseBorderInlineStart(
|
|
|
497
534
|
{ value }: DeclarationType<"border-inline-start">,
|
|
498
535
|
builder: StylesheetBuilder,
|
|
499
536
|
) {
|
|
537
|
+
builder.addDescriptor("border-start-color", parseColor(value.color, builder));
|
|
500
538
|
builder.addDescriptor(
|
|
501
|
-
"border-
|
|
502
|
-
parseColor(value.color, builder),
|
|
503
|
-
);
|
|
504
|
-
builder.addDescriptor(
|
|
505
|
-
"border-inline-start-width",
|
|
539
|
+
"border-start-width",
|
|
506
540
|
parseBorderSideWidth(value.width, builder),
|
|
507
541
|
);
|
|
508
|
-
|
|
509
|
-
"border-inline-start-style",
|
|
542
|
+
dropUnsupportedInlineStyle(
|
|
510
543
|
parseBorderStyle(value.style, builder),
|
|
544
|
+
builder,
|
|
545
|
+
"border-inline-start-style",
|
|
511
546
|
);
|
|
512
547
|
}
|
|
513
548
|
|
|
@@ -515,17 +550,15 @@ function parseBorderInlineEnd(
|
|
|
515
550
|
{ value }: DeclarationType<"border-inline-end">,
|
|
516
551
|
builder: StylesheetBuilder,
|
|
517
552
|
) {
|
|
553
|
+
builder.addDescriptor("border-end-color", parseColor(value.color, builder));
|
|
518
554
|
builder.addDescriptor(
|
|
519
|
-
"border-
|
|
520
|
-
parseColor(value.color, builder),
|
|
521
|
-
);
|
|
522
|
-
builder.addDescriptor(
|
|
523
|
-
"border-inline-end-width",
|
|
555
|
+
"border-end-width",
|
|
524
556
|
parseBorderSideWidth(value.width, builder),
|
|
525
557
|
);
|
|
526
|
-
|
|
527
|
-
"border-inline-end-style",
|
|
558
|
+
dropUnsupportedInlineStyle(
|
|
528
559
|
parseBorderStyle(value.style, builder),
|
|
560
|
+
builder,
|
|
561
|
+
"border-inline-end-style",
|
|
529
562
|
);
|
|
530
563
|
}
|
|
531
564
|
|
|
@@ -534,9 +567,13 @@ export function parseBorderInlineWidth(
|
|
|
534
567
|
builder: StylesheetBuilder,
|
|
535
568
|
) {
|
|
536
569
|
builder.addDescriptor(
|
|
537
|
-
"border-
|
|
570
|
+
"border-start-width",
|
|
538
571
|
parseBorderSideWidth(declaration.value.start, builder),
|
|
539
572
|
);
|
|
573
|
+
builder.addDescriptor(
|
|
574
|
+
"border-end-width",
|
|
575
|
+
parseBorderSideWidth(declaration.value.end, builder),
|
|
576
|
+
);
|
|
540
577
|
}
|
|
541
578
|
|
|
542
579
|
export function parseBorderInlineStyle(
|
|
@@ -544,31 +581,41 @@ export function parseBorderInlineStyle(
|
|
|
544
581
|
| "border-inline-style"
|
|
545
582
|
| "border-inline-start-style"
|
|
546
583
|
| "border-inline-end-style"
|
|
584
|
+
| "border-block-start-style"
|
|
585
|
+
| "border-block-end-style"
|
|
547
586
|
>,
|
|
548
587
|
builder: StylesheetBuilder,
|
|
549
588
|
) {
|
|
550
589
|
if (typeof declaration.value === "string") {
|
|
551
|
-
|
|
552
|
-
declaration.property,
|
|
590
|
+
dropUnsupportedInlineStyle(
|
|
553
591
|
parseBorderStyle(declaration.value, builder),
|
|
554
|
-
|
|
555
|
-
} else if (declaration.value.start === declaration.value.end) {
|
|
556
|
-
builder.addDescriptor(
|
|
592
|
+
builder,
|
|
557
593
|
declaration.property,
|
|
558
|
-
parseBorderStyle(declaration.value.start, builder),
|
|
559
594
|
);
|
|
560
595
|
} else {
|
|
561
|
-
|
|
562
|
-
"border-inline-start-style",
|
|
596
|
+
dropUnsupportedInlineStyle(
|
|
563
597
|
parseBorderStyle(declaration.value.start, builder),
|
|
598
|
+
builder,
|
|
599
|
+
"border-inline-start-style",
|
|
564
600
|
);
|
|
565
|
-
|
|
566
|
-
"border-inline-end-style",
|
|
601
|
+
dropUnsupportedInlineStyle(
|
|
567
602
|
parseBorderStyle(declaration.value.end, builder),
|
|
603
|
+
builder,
|
|
604
|
+
"border-inline-end-style",
|
|
568
605
|
);
|
|
569
606
|
}
|
|
570
607
|
}
|
|
571
608
|
|
|
609
|
+
function dropUnsupportedInlineStyle(
|
|
610
|
+
style: string | undefined,
|
|
611
|
+
builder: StylesheetBuilder,
|
|
612
|
+
property: string,
|
|
613
|
+
) {
|
|
614
|
+
if (style !== undefined && style !== "solid") {
|
|
615
|
+
builder.addWarning("style", property, style);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
572
619
|
function parseFlexFlow(
|
|
573
620
|
{ value }: DeclarationType<"flex-flow">,
|
|
574
621
|
builder: StylesheetBuilder,
|
|
@@ -838,7 +885,7 @@ export function parseScaleValue(
|
|
|
838
885
|
builder: StylesheetBuilder,
|
|
839
886
|
): StyleDescriptor {
|
|
840
887
|
if (translate === "none") {
|
|
841
|
-
return
|
|
888
|
+
return 1;
|
|
842
889
|
}
|
|
843
890
|
|
|
844
891
|
return parseLength(translate[prop], builder);
|
|
@@ -916,6 +963,11 @@ export function parseUnparsedDeclaration(
|
|
|
916
963
|
return;
|
|
917
964
|
}
|
|
918
965
|
|
|
966
|
+
if (unsupportedLogicalStyles.has(property)) {
|
|
967
|
+
builder.addWarning("property", property);
|
|
968
|
+
return;
|
|
969
|
+
}
|
|
970
|
+
|
|
919
971
|
builder.setWarningProperty(property);
|
|
920
972
|
|
|
921
973
|
/**
|
|
@@ -966,7 +1018,10 @@ export function parseCustomDeclaration(
|
|
|
966
1018
|
) {
|
|
967
1019
|
const property = declaration.value.name;
|
|
968
1020
|
|
|
969
|
-
if (property
|
|
1021
|
+
if (isMappingProperty(property)) {
|
|
1022
|
+
// Consumed before declarations so property order cannot affect mapping.
|
|
1023
|
+
return;
|
|
1024
|
+
} else if (property === "-webkit-line-clamp") {
|
|
970
1025
|
builder.addDescriptor(
|
|
971
1026
|
property,
|
|
972
1027
|
parseUnparsed(declaration.value.value, builder, property),
|
|
@@ -997,6 +1052,18 @@ export function parseCustomDeclaration(
|
|
|
997
1052
|
);
|
|
998
1053
|
} else if (property === "corner-shape") {
|
|
999
1054
|
parseCornerShape(declaration.value, builder);
|
|
1055
|
+
} else if (property === "font-variant") {
|
|
1056
|
+
const parsedFontVariant = parseFontVariantCaps(
|
|
1057
|
+
parseUnparsed(
|
|
1058
|
+
declaration.value.value,
|
|
1059
|
+
builder,
|
|
1060
|
+
property,
|
|
1061
|
+
) as FontVariantCaps,
|
|
1062
|
+
builder,
|
|
1063
|
+
);
|
|
1064
|
+
if (parsedFontVariant !== undefined) {
|
|
1065
|
+
builder.addDescriptor(property, parsedFontVariant);
|
|
1066
|
+
}
|
|
1000
1067
|
} else if (
|
|
1001
1068
|
validProperties.has(property) ||
|
|
1002
1069
|
property.startsWith("--") ||
|
|
@@ -1594,11 +1661,23 @@ export function parseColorDeclaration(
|
|
|
1594
1661
|
builder: StylesheetBuilder,
|
|
1595
1662
|
) {
|
|
1596
1663
|
builder.addDescriptor(
|
|
1597
|
-
declaration.property,
|
|
1664
|
+
propertyRename[declaration.property] ?? declaration.property,
|
|
1598
1665
|
parseColor(declaration.value, builder),
|
|
1599
1666
|
);
|
|
1600
1667
|
}
|
|
1601
1668
|
|
|
1669
|
+
/**
|
|
1670
|
+
* Lab/LCH/OKLab/OKLCH channels can be `NaN` when lightningcss resolves a
|
|
1671
|
+
* degenerate `color-mix()` at compile time (e.g. mixing black with
|
|
1672
|
+
* `transparent` in oklab yields `NaN` for the a/b chromaticity channels).
|
|
1673
|
+
* Passing `NaN` to colorjs.io produces an invalid string such as
|
|
1674
|
+
* `#NaNNaNNaN80`, which React Native silently discards. Per CSS Color 4 a
|
|
1675
|
+
* missing component is treated as `0`, so coerce `NaN` to `0`.
|
|
1676
|
+
*/
|
|
1677
|
+
function nanToZero(value: number): number {
|
|
1678
|
+
return Number.isNaN(value) ? 0 : value;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1602
1681
|
export function parseColor(cssColor: CssColor, builder: StylesheetBuilder) {
|
|
1603
1682
|
if (typeof cssColor === "string") {
|
|
1604
1683
|
if (namedColors.has(cssColor)) {
|
|
@@ -1653,28 +1732,44 @@ export function parseColor(cssColor: CssColor, builder: StylesheetBuilder) {
|
|
|
1653
1732
|
case "lab":
|
|
1654
1733
|
color = new Color({
|
|
1655
1734
|
space: cssColor.type,
|
|
1656
|
-
coords: [
|
|
1735
|
+
coords: [
|
|
1736
|
+
nanToZero(cssColor.l),
|
|
1737
|
+
nanToZero(cssColor.a),
|
|
1738
|
+
nanToZero(cssColor.b),
|
|
1739
|
+
],
|
|
1657
1740
|
alpha: cssColor.alpha,
|
|
1658
1741
|
});
|
|
1659
1742
|
break;
|
|
1660
1743
|
case "lch":
|
|
1661
1744
|
color = new Color({
|
|
1662
1745
|
space: cssColor.type,
|
|
1663
|
-
coords: [
|
|
1746
|
+
coords: [
|
|
1747
|
+
nanToZero(cssColor.l),
|
|
1748
|
+
nanToZero(cssColor.c),
|
|
1749
|
+
nanToZero(cssColor.h),
|
|
1750
|
+
],
|
|
1664
1751
|
alpha: cssColor.alpha,
|
|
1665
1752
|
});
|
|
1666
1753
|
break;
|
|
1667
1754
|
case "oklab":
|
|
1668
1755
|
color = new Color({
|
|
1669
1756
|
space: cssColor.type,
|
|
1670
|
-
coords: [
|
|
1757
|
+
coords: [
|
|
1758
|
+
nanToZero(cssColor.l),
|
|
1759
|
+
nanToZero(cssColor.a),
|
|
1760
|
+
nanToZero(cssColor.b),
|
|
1761
|
+
],
|
|
1671
1762
|
alpha: cssColor.alpha,
|
|
1672
1763
|
});
|
|
1673
1764
|
break;
|
|
1674
1765
|
case "oklch":
|
|
1675
1766
|
color = new Color({
|
|
1676
1767
|
space: cssColor.type,
|
|
1677
|
-
coords: [
|
|
1768
|
+
coords: [
|
|
1769
|
+
nanToZero(cssColor.l),
|
|
1770
|
+
nanToZero(cssColor.c),
|
|
1771
|
+
nanToZero(cssColor.h),
|
|
1772
|
+
],
|
|
1678
1773
|
alpha: cssColor.alpha,
|
|
1679
1774
|
});
|
|
1680
1775
|
break;
|
|
@@ -2122,12 +2217,8 @@ export function parseBorderBlockWidth(
|
|
|
2122
2217
|
const start = parseBorderSideWidth(declaration.value.start, builder);
|
|
2123
2218
|
const end = parseBorderSideWidth(declaration.value.end, builder);
|
|
2124
2219
|
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
} else {
|
|
2128
|
-
builder.addDescriptor("border-block-start-width", start);
|
|
2129
|
-
builder.addDescriptor("border-block-end-width", end);
|
|
2130
|
-
}
|
|
2220
|
+
builder.addDescriptor("border-top-width", start);
|
|
2221
|
+
builder.addDescriptor("border-bottom-width", end);
|
|
2131
2222
|
}
|
|
2132
2223
|
|
|
2133
2224
|
function parseBorderBlockStyle(
|
|
@@ -2137,12 +2228,8 @@ function parseBorderBlockStyle(
|
|
|
2137
2228
|
const start = parseBorderStyle(declaration.value.start, builder);
|
|
2138
2229
|
const end = parseBorderStyle(declaration.value.end, builder);
|
|
2139
2230
|
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
} else {
|
|
2143
|
-
builder.addDescriptor("border-block-start-style", start);
|
|
2144
|
-
builder.addDescriptor("border-block-end-style", end);
|
|
2145
|
-
}
|
|
2231
|
+
dropUnsupportedInlineStyle(start, builder, "border-block-start-style");
|
|
2232
|
+
dropUnsupportedInlineStyle(end, builder, "border-block-end-style");
|
|
2146
2233
|
}
|
|
2147
2234
|
|
|
2148
2235
|
export function parseBorderSideWidthDeclaration(
|
|
@@ -2150,7 +2237,7 @@ export function parseBorderSideWidthDeclaration(
|
|
|
2150
2237
|
builder: StylesheetBuilder,
|
|
2151
2238
|
) {
|
|
2152
2239
|
builder.addDescriptor(
|
|
2153
|
-
declaration.property,
|
|
2240
|
+
propertyRename[declaration.property] ?? declaration.property,
|
|
2154
2241
|
parseBorderSideWidth(declaration.value, builder),
|
|
2155
2242
|
);
|
|
2156
2243
|
}
|
|
@@ -2194,12 +2281,10 @@ export function parseLineHeightDeclaration(
|
|
|
2194
2281
|
declaration: DeclarationType<"line-height">,
|
|
2195
2282
|
builder: StylesheetBuilder,
|
|
2196
2283
|
) {
|
|
2197
|
-
builder.addDescriptor(
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
1,
|
|
2202
|
-
]);
|
|
2284
|
+
builder.addDescriptor(
|
|
2285
|
+
"line-height",
|
|
2286
|
+
parseLineHeight(declaration.value, builder),
|
|
2287
|
+
);
|
|
2203
2288
|
}
|
|
2204
2289
|
|
|
2205
2290
|
export function parseLineHeight(
|
|
@@ -2210,7 +2295,7 @@ export function parseLineHeight(
|
|
|
2210
2295
|
case "normal":
|
|
2211
2296
|
return undefined;
|
|
2212
2297
|
case "number":
|
|
2213
|
-
return [{}, "em",
|
|
2298
|
+
return [{}, "em", value.value, 1];
|
|
2214
2299
|
case "length": {
|
|
2215
2300
|
const length = value.value;
|
|
2216
2301
|
|
|
@@ -2223,7 +2308,7 @@ export function parseLineHeight(
|
|
|
2223
2308
|
"style",
|
|
2224
2309
|
"line-height",
|
|
2225
2310
|
typeof length.value === "number"
|
|
2226
|
-
? length.value
|
|
2311
|
+
? String(length.value)
|
|
2227
2312
|
: JSON.stringify(length.value),
|
|
2228
2313
|
);
|
|
2229
2314
|
return;
|
|
@@ -2640,7 +2725,12 @@ export function parseColorMix(
|
|
|
2640
2725
|
builder: StylesheetBuilder,
|
|
2641
2726
|
property: string,
|
|
2642
2727
|
): StyleDescriptor {
|
|
2643
|
-
const [inToken, whitespace, colorSpace, comma, ...
|
|
2728
|
+
const [inToken, whitespace, colorSpace, comma, ...remaining] = tokens;
|
|
2729
|
+
const rest = remaining.filter(
|
|
2730
|
+
(token) =>
|
|
2731
|
+
token.type !== "token" ||
|
|
2732
|
+
!["white-space", "comment"].includes(token.value.type),
|
|
2733
|
+
);
|
|
2644
2734
|
if (
|
|
2645
2735
|
typeof inToken !== "object" ||
|
|
2646
2736
|
inToken.type !== "token" ||
|
|
@@ -2699,11 +2789,6 @@ export function parseColorMix(
|
|
|
2699
2789
|
|
|
2700
2790
|
const rightColorArg = parseUnparsed(nextToken, builder, property);
|
|
2701
2791
|
|
|
2702
|
-
if (rightColorArg === "transparent") {
|
|
2703
|
-
// Ignore the rest, treat as single color with alpha
|
|
2704
|
-
return [{}, "colorMix", [colorSpaceArg, leftColorArg, leftColorPercentage]];
|
|
2705
|
-
}
|
|
2706
|
-
|
|
2707
2792
|
nextToken = rest.shift();
|
|
2708
2793
|
let rightColorPercentage: StyleDescriptor | undefined;
|
|
2709
2794
|
if (nextToken?.type !== "token" || nextToken.value.type !== "comma") {
|
|
@@ -3103,21 +3188,25 @@ function parseBackgroundImage(
|
|
|
3103
3188
|
declaration: DeclarationType<"background-image">,
|
|
3104
3189
|
builder: StylesheetBuilder,
|
|
3105
3190
|
) {
|
|
3106
|
-
builder.addDescriptor(
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3191
|
+
builder.addDescriptor("experimental_backgroundImage", [
|
|
3192
|
+
{},
|
|
3193
|
+
"join",
|
|
3194
|
+
[
|
|
3195
|
+
declaration.value.flatMap((image): StyleDescriptor[] => {
|
|
3196
|
+
switch (image.type) {
|
|
3197
|
+
case "gradient": {
|
|
3198
|
+
const gradient = parseGradient(image.value, builder);
|
|
3199
|
+
return gradient ? [gradient] : [];
|
|
3200
|
+
}
|
|
3201
|
+
case "none":
|
|
3202
|
+
return ["none"];
|
|
3113
3203
|
}
|
|
3114
|
-
case "none":
|
|
3115
|
-
return ["none"];
|
|
3116
|
-
}
|
|
3117
3204
|
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3205
|
+
return [];
|
|
3206
|
+
}),
|
|
3207
|
+
", ",
|
|
3208
|
+
],
|
|
3209
|
+
]);
|
|
3121
3210
|
return;
|
|
3122
3211
|
}
|
|
3123
3212
|
|
|
@@ -3172,10 +3261,10 @@ function parseGradientItem(
|
|
|
3172
3261
|
args.push(parseLength(item.position, builder));
|
|
3173
3262
|
}
|
|
3174
3263
|
|
|
3175
|
-
return [{}, "
|
|
3264
|
+
return [{}, "colorStop", args, 1];
|
|
3176
3265
|
}
|
|
3177
3266
|
case "hint":
|
|
3178
|
-
return parseLength(item.value, builder);
|
|
3267
|
+
return [{}, "gradientPosition", parseLength(item.value, builder), 1];
|
|
3179
3268
|
}
|
|
3180
3269
|
}
|
|
3181
3270
|
|
|
@@ -3275,7 +3364,7 @@ function parseFilter(
|
|
|
3275
3364
|
} as unknown as StyleDescriptor;
|
|
3276
3365
|
case "hue-rotate":
|
|
3277
3366
|
return {
|
|
3278
|
-
[value.type]: parseAngle(value.value, builder),
|
|
3367
|
+
[toRNProperty(value.type)]: parseAngle(value.value, builder),
|
|
3279
3368
|
} as unknown as StyleDescriptor;
|
|
3280
3369
|
case "drop-shadow":
|
|
3281
3370
|
return [
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
|
|
2
4
|
export function lightningcssLoader() {
|
|
3
5
|
let lightningcssPath: string | undefined;
|
|
4
6
|
|
|
@@ -33,23 +35,22 @@ export function lightningcssLoader() {
|
|
|
33
35
|
lightningcssPath,
|
|
34
36
|
) as typeof import("lightningcss");
|
|
35
37
|
|
|
38
|
+
let version: unknown;
|
|
36
39
|
try {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
unknown
|
|
44
|
-
>;
|
|
45
|
-
|
|
46
|
-
if (packageJSON.version === "1.30.2") {
|
|
47
|
-
throw new Error(
|
|
48
|
-
"[react-native-css] lightningcss version 1.30.2 has a critical bug that breaks compilation. Please pin the version of lightningcss to 1.30.1; or try upgrading.",
|
|
49
|
-
);
|
|
50
|
-
}
|
|
40
|
+
// Lightning CSS keeps its entry in node/ and does not export package.json.
|
|
41
|
+
// Resolve relative to the selected copy, not the consumer or this loader.
|
|
42
|
+
const packageJSON = require(
|
|
43
|
+
resolve(dirname(lightningcssPath), "../package.json"),
|
|
44
|
+
) as Record<string, unknown>;
|
|
45
|
+
version = packageJSON.version;
|
|
51
46
|
} catch {
|
|
52
|
-
//
|
|
47
|
+
// Some bundlers do not retain package metadata. Loading remains supported.
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (version === "1.30.2") {
|
|
51
|
+
throw new Error(
|
|
52
|
+
"[react-native-css] lightningcss version 1.30.2 has a critical bug that breaks compilation. Please pin the version of lightningcss to 1.30.1; or try upgrading.",
|
|
53
|
+
);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
return {
|
|
@@ -24,9 +24,10 @@ export function parseMediaQuery(
|
|
|
24
24
|
let condition: MediaCondition | undefined;
|
|
25
25
|
|
|
26
26
|
if (query.mediaType) {
|
|
27
|
-
//
|
|
27
|
+
// Native screens never match print. Negating that media type matches
|
|
28
|
+
// regardless of the remaining feature tests in the same conjunction.
|
|
28
29
|
if (query.mediaType === "print") {
|
|
29
|
-
return;
|
|
30
|
+
return query.qualifier === "not";
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
// These all/screen are not conditions, they always apply
|
|
@@ -40,7 +41,7 @@ export function parseMediaQuery(
|
|
|
40
41
|
|
|
41
42
|
// If any of these are undefined, the media query is invalid
|
|
42
43
|
if (!condition || condition.some((v) => v === undefined)) {
|
|
43
|
-
return;
|
|
44
|
+
return false;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
|
|
@@ -50,7 +51,8 @@ export function parseMediaQuery(
|
|
|
50
51
|
: platformCondition || condition;
|
|
51
52
|
|
|
52
53
|
if (!mediaQuery) {
|
|
53
|
-
|
|
54
|
+
// Unqualified all/screen apply; not all and not screen do not.
|
|
55
|
+
return query.qualifier !== "not";
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
if (query.qualifier === "not") {
|
|
@@ -58,6 +60,7 @@ export function parseMediaQuery(
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
builder.addMediaQuery(mediaQuery);
|
|
63
|
+
return true;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
function parseMediaQueryCondition(
|
|
@@ -65,15 +68,23 @@ function parseMediaQueryCondition(
|
|
|
65
68
|
builder: StylesheetBuilder,
|
|
66
69
|
): MediaCondition | undefined {
|
|
67
70
|
switch (query.type) {
|
|
68
|
-
case "feature":
|
|
69
|
-
|
|
71
|
+
case "feature": {
|
|
72
|
+
const feature = parseFeature(query.value, builder);
|
|
73
|
+
return feature?.some((value) => value === undefined)
|
|
74
|
+
? undefined
|
|
75
|
+
: feature;
|
|
76
|
+
}
|
|
70
77
|
case "not":
|
|
71
78
|
const mediaQuery = parseMediaQueryCondition(query.value, builder);
|
|
72
79
|
return mediaQuery ? ["!", mediaQuery] : undefined;
|
|
73
80
|
case "operation":
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
81
|
+
const parsed = query.conditions.map((c) =>
|
|
82
|
+
parseMediaQueryCondition(c, builder),
|
|
83
|
+
);
|
|
84
|
+
if (query.operator === "and" && parsed.some((c) => !c)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const mediaQueries = parsed.filter((v): v is MediaCondition => !!v);
|
|
77
88
|
|
|
78
89
|
if (mediaQueries.length === 0) {
|
|
79
90
|
return;
|