react-native-css 0.0.0-nightly.2c68396 → 0.0.0-nightly.2e152c9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -5
- package/dist/commonjs/babel/helpers.js +7 -0
- package/dist/commonjs/babel/helpers.js.map +1 -1
- package/dist/commonjs/babel/import-plugin.js +20 -8
- package/dist/commonjs/babel/import-plugin.js.map +1 -1
- package/dist/commonjs/babel/react-native-web.js +17 -4
- package/dist/commonjs/babel/react-native-web.js.map +1 -1
- package/dist/commonjs/babel/react-native.js +9 -4
- package/dist/commonjs/babel/react-native.js.map +1 -1
- package/dist/commonjs/compiler/atRules.js +35 -0
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +198 -39
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/container-query.js +6 -1
- package/dist/commonjs/compiler/container-query.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +190 -101
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/individual-transforms.js +129 -0
- package/dist/commonjs/compiler/individual-transforms.js.map +1 -0
- package/dist/commonjs/compiler/inline-variables.js +47 -1
- package/dist/commonjs/compiler/inline-variables.js.map +1 -1
- package/dist/commonjs/compiler/lightningcss-loader.js +11 -8
- package/dist/commonjs/compiler/lightningcss-loader.js.map +1 -1
- package/dist/commonjs/compiler/media-query.js +16 -6
- package/dist/commonjs/compiler/media-query.js.map +1 -1
- package/dist/commonjs/compiler/selector-builder.js +16 -4
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +33 -9
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/compiler/supports.js +1 -3
- package/dist/commonjs/compiler/supports.js.map +1 -1
- package/dist/commonjs/components/FlatList.js +1 -0
- package/dist/commonjs/components/FlatList.js.map +1 -1
- package/dist/commonjs/components/ImageBackground.js +2 -6
- package/dist/commonjs/components/ImageBackground.js.map +1 -1
- package/dist/commonjs/components/KeyboardAvoidingView.js +2 -3
- package/dist/commonjs/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/commonjs/components/SafeAreaProvider.js +13 -0
- package/dist/commonjs/components/SafeAreaProvider.js.map +1 -0
- package/dist/commonjs/components/index.cjs +49 -1
- package/dist/commonjs/components/index.cjs.map +1 -1
- package/dist/commonjs/components/react-native-safe-area-context.native.js +10 -0
- package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -1
- package/dist/commonjs/jest/index.js +3 -1
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/cache-version.js +43 -0
- package/dist/commonjs/metro/cache-version.js.map +1 -0
- package/dist/commonjs/metro/index.js +2 -0
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +16 -3
- package/dist/commonjs/metro/metro-transformer.js.map +1 -1
- package/dist/commonjs/metro/typescript.js +26 -6
- package/dist/commonjs/metro/typescript.js.map +1 -1
- package/dist/commonjs/metro/warnings.js +135 -0
- package/dist/commonjs/metro/warnings.js.map +1 -0
- package/dist/commonjs/native/api.js +16 -11
- package/dist/commonjs/native/api.js.map +1 -1
- package/dist/commonjs/native/conditions/attributes.js +16 -9
- package/dist/commonjs/native/conditions/attributes.js.map +1 -1
- package/dist/commonjs/native/conditions/container-query.js +11 -11
- package/dist/commonjs/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/native/conditions/guards.js +7 -0
- package/dist/commonjs/native/conditions/guards.js.map +1 -1
- package/dist/commonjs/native/conditions/media-query.js +1 -1
- package/dist/commonjs/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/native/objects.js +11 -18
- package/dist/commonjs/native/objects.js.map +1 -1
- package/dist/commonjs/native/react/interaction.js +10 -5
- package/dist/commonjs/native/react/interaction.js.map +1 -1
- package/dist/commonjs/native/react/rules.js +45 -38
- package/dist/commonjs/native/react/rules.js.map +1 -1
- package/dist/commonjs/native/react/useNativeCss.js +70 -15
- package/dist/commonjs/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/native/react/usePassthrough.js +5 -2
- package/dist/commonjs/native/react/usePassthrough.js.map +1 -1
- package/dist/commonjs/native/reactivity.js +64 -24
- package/dist/commonjs/native/reactivity.js.map +1 -1
- package/dist/commonjs/native/reanimated.js +15 -3
- package/dist/commonjs/native/reanimated.js.map +1 -1
- package/dist/commonjs/native/styles/calculate-props.js +139 -26
- package/dist/commonjs/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/native/styles/functions/animation-timing.js +2 -1
- package/dist/commonjs/native/styles/functions/animation-timing.js.map +1 -1
- package/dist/commonjs/native/styles/functions/color-mix.js +43 -29
- package/dist/commonjs/native/styles/functions/color-mix.js.map +1 -1
- package/dist/commonjs/native/styles/functions/filters.js +19 -5
- package/dist/commonjs/native/styles/functions/filters.js.map +1 -1
- package/dist/commonjs/native/styles/functions/numeric-functions.js +4 -3
- package/dist/commonjs/native/styles/functions/numeric-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/platform-functions.js +2 -1
- package/dist/commonjs/native/styles/functions/platform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/string-functions.js +22 -6
- package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/transform-functions.js +95 -105
- package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/index.js +303 -49
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/native/styles/resolve.js +136 -19
- package/dist/commonjs/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/native/styles/scale-factor.js +12 -0
- package/dist/commonjs/native/styles/scale-factor.js.map +1 -0
- package/dist/commonjs/native/styles/shorthands/_handler.js +10 -0
- package/dist/commonjs/native/styles/shorthands/_handler.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/animation.js +6 -3
- package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/box-shadow.js +41 -20
- package/dist/commonjs/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/index.js +11 -0
- package/dist/commonjs/native/styles/shorthands/index.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js +22 -0
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/commonjs/native/styles/shorthands/transform.js +31 -8
- package/dist/commonjs/native/styles/shorthands/transform.js.map +1 -1
- package/dist/commonjs/native/styles/variables.js +165 -48
- package/dist/commonjs/native/styles/variables.js.map +1 -1
- package/dist/commonjs/native-internal/root.js +46 -7
- package/dist/commonjs/native-internal/root.js.map +1 -1
- package/dist/commonjs/native-internal/style-collection.js +22 -37
- package/dist/commonjs/native-internal/style-collection.js.map +1 -1
- package/dist/commonjs/native-internal/variables.js +1 -1
- package/dist/commonjs/native-internal/variables.js.map +1 -1
- package/dist/commonjs/utilities/dot-notation.types.js +4 -0
- package/dist/commonjs/utilities/equality.js +41 -0
- package/dist/commonjs/utilities/equality.js.map +1 -0
- package/dist/commonjs/utilities/index.js +11 -0
- package/dist/commonjs/utilities/index.js.map +1 -1
- package/dist/commonjs/utilities/style-descriptor.js +32 -8
- package/dist/commonjs/utilities/style-descriptor.js.map +1 -1
- package/dist/commonjs/web/api.js +2 -2
- package/dist/commonjs/web/api.js.map +1 -1
- package/dist/commonjs/web/assign-style.js +4 -1
- package/dist/commonjs/web/assign-style.js.map +1 -1
- package/dist/module/babel/helpers.js +6 -0
- package/dist/module/babel/helpers.js.map +1 -1
- package/dist/module/babel/import-plugin.js +22 -10
- package/dist/module/babel/import-plugin.js.map +1 -1
- package/dist/module/babel/react-native-web.js +16 -4
- package/dist/module/babel/react-native-web.js.map +1 -1
- package/dist/module/babel/react-native.js +9 -4
- package/dist/module/babel/react-native.js.map +1 -1
- package/dist/module/compiler/atRules.js +33 -0
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +200 -41
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js +2 -0
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/container-query.js +6 -1
- package/dist/module/compiler/container-query.js.map +1 -1
- package/dist/module/compiler/declarations.js +190 -100
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/individual-transforms.js +125 -0
- package/dist/module/compiler/individual-transforms.js.map +1 -0
- package/dist/module/compiler/inline-variables.js +47 -1
- package/dist/module/compiler/inline-variables.js.map +1 -1
- package/dist/module/compiler/lightningcss-loader.js +10 -8
- package/dist/module/compiler/lightningcss-loader.js.map +1 -1
- package/dist/module/compiler/media-query.js +16 -6
- package/dist/module/compiler/media-query.js.map +1 -1
- package/dist/module/compiler/selector-builder.js +16 -5
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +33 -9
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/compiler/supports.js +1 -3
- package/dist/module/compiler/supports.js.map +1 -1
- package/dist/module/components/FlatList.js +1 -0
- package/dist/module/components/FlatList.js.map +1 -1
- package/dist/module/components/ImageBackground.js +2 -6
- package/dist/module/components/ImageBackground.js.map +1 -1
- package/dist/module/components/KeyboardAvoidingView.js +2 -3
- package/dist/module/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/module/components/SafeAreaProvider.js +4 -0
- package/dist/module/components/SafeAreaProvider.js.map +1 -0
- package/dist/module/components/index.cjs +49 -1
- package/dist/module/components/index.cjs.map +1 -1
- package/dist/module/components/react-native-safe-area-context.native.js +9 -1
- package/dist/module/components/react-native-safe-area-context.native.js.map +1 -1
- package/dist/module/jest/index.js +3 -1
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/cache-version.js +39 -0
- package/dist/module/metro/cache-version.js.map +1 -0
- package/dist/module/metro/index.js +2 -0
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +16 -3
- package/dist/module/metro/metro-transformer.js.map +1 -1
- package/dist/module/metro/typescript.js +26 -6
- package/dist/module/metro/typescript.js.map +1 -1
- package/dist/module/metro/warnings.js +131 -0
- package/dist/module/metro/warnings.js.map +1 -0
- package/dist/module/native/api.js +18 -13
- package/dist/module/native/api.js.map +1 -1
- package/dist/module/native/conditions/attributes.js +16 -9
- package/dist/module/native/conditions/attributes.js.map +1 -1
- package/dist/module/native/conditions/container-query.js +11 -11
- package/dist/module/native/conditions/container-query.js.map +1 -1
- package/dist/module/native/conditions/guards.js +7 -0
- package/dist/module/native/conditions/guards.js.map +1 -1
- package/dist/module/native/conditions/media-query.js +1 -1
- package/dist/module/native/conditions/media-query.js.map +1 -1
- package/dist/module/native/objects.js +11 -18
- package/dist/module/native/objects.js.map +1 -1
- package/dist/module/native/react/interaction.js +10 -5
- package/dist/module/native/react/interaction.js.map +1 -1
- package/dist/module/native/react/rules.js +46 -39
- package/dist/module/native/react/rules.js.map +1 -1
- package/dist/module/native/react/useNativeCss.js +73 -18
- package/dist/module/native/react/useNativeCss.js.map +1 -1
- package/dist/module/native/react/usePassthrough.js +5 -2
- package/dist/module/native/react/usePassthrough.js.map +1 -1
- package/dist/module/native/reactivity.js +58 -22
- package/dist/module/native/reactivity.js.map +1 -1
- package/dist/module/native/reanimated.js +15 -3
- package/dist/module/native/reanimated.js.map +1 -1
- package/dist/module/native/styles/calculate-props.js +139 -26
- package/dist/module/native/styles/calculate-props.js.map +1 -1
- package/dist/module/native/styles/functions/animation-timing.js +2 -1
- package/dist/module/native/styles/functions/animation-timing.js.map +1 -1
- package/dist/module/native/styles/functions/color-mix.js +43 -29
- package/dist/module/native/styles/functions/color-mix.js.map +1 -1
- package/dist/module/native/styles/functions/filters.js +17 -4
- package/dist/module/native/styles/functions/filters.js.map +1 -1
- package/dist/module/native/styles/functions/numeric-functions.js +4 -3
- package/dist/module/native/styles/functions/numeric-functions.js.map +1 -1
- package/dist/module/native/styles/functions/platform-functions.js +2 -1
- package/dist/module/native/styles/functions/platform-functions.js.map +1 -1
- package/dist/module/native/styles/functions/string-functions.js +19 -5
- package/dist/module/native/styles/functions/string-functions.js.map +1 -1
- package/dist/module/native/styles/functions/transform-functions.js +93 -104
- package/dist/module/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/native/styles/index.js +304 -49
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/native/styles/resolve.js +136 -19
- package/dist/module/native/styles/resolve.js.map +1 -1
- package/dist/module/native/styles/scale-factor.js +8 -0
- package/dist/module/native/styles/scale-factor.js.map +1 -0
- package/dist/module/native/styles/shorthands/_handler.js +11 -1
- package/dist/module/native/styles/shorthands/_handler.js.map +1 -1
- package/dist/module/native/styles/shorthands/animation.js +6 -3
- package/dist/module/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/native/styles/shorthands/box-shadow.js +43 -21
- package/dist/module/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/module/native/styles/shorthands/index.js +1 -0
- package/dist/module/native/styles/shorthands/index.js.map +1 -1
- package/dist/module/native/styles/shorthands/logical-border-width.js +18 -0
- package/dist/module/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/module/native/styles/shorthands/transform.js +31 -8
- package/dist/module/native/styles/shorthands/transform.js.map +1 -1
- package/dist/module/native/styles/variables.js +166 -50
- package/dist/module/native/styles/variables.js.map +1 -1
- package/dist/module/native-internal/root.js +44 -7
- package/dist/module/native-internal/root.js.map +1 -1
- package/dist/module/native-internal/style-collection.js +10 -37
- package/dist/module/native-internal/style-collection.js.map +1 -1
- package/dist/module/native-internal/variables.js +2 -2
- package/dist/module/native-internal/variables.js.map +1 -1
- package/dist/module/utilities/dot-notation.types.js +2 -0
- package/dist/module/utilities/equality.js +37 -0
- package/dist/module/utilities/equality.js.map +1 -0
- package/dist/module/utilities/index.js +1 -0
- package/dist/module/utilities/index.js.map +1 -1
- package/dist/module/utilities/style-descriptor.js +30 -8
- package/dist/module/utilities/style-descriptor.js.map +1 -1
- package/dist/module/web/api.js +2 -2
- package/dist/module/web/api.js.map +1 -1
- package/dist/module/web/assign-style.js +4 -1
- package/dist/module/web/assign-style.js.map +1 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts +4 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -5
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +13 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +2 -3
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/individual-transforms.d.ts +10 -0
- package/dist/typescript/commonjs/src/compiler/individual-transforms.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/inline-variables.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/inline-variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +2 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +10 -10
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +2 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +2 -10
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/cache-version.d.ts +8 -0
- package/dist/typescript/commonjs/src/metro/cache-version.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts +4 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +9 -4
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/typescript.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/warnings.d.ts +13 -0
- package/dist/typescript/commonjs/src/metro/warnings.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/api.d.ts +5 -9
- package/dist/typescript/commonjs/src/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/conditions/guards.d.ts +2 -1
- package/dist/typescript/commonjs/src/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/objects.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/interaction.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/rules.d.ts +7 -2
- package/dist/typescript/commonjs/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts +0 -3
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/usePassthrough.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/reactivity.d.ts +15 -3
- package/dist/typescript/commonjs/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/reanimated.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/calculate-props.d.ts +11 -2
- package/dist/typescript/commonjs/src/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/animation-timing.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/platform-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/index.d.ts +5 -4
- package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts +4 -1
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/_handler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/transform.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts +3 -2
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/root.d.ts +38 -0
- package/dist/typescript/commonjs/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/style-collection.d.ts +2 -2
- package/dist/typescript/commonjs/src/native-internal/style-collection.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/variables.d.ts +1 -1
- package/dist/typescript/commonjs/src/native-internal/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime.types.d.ts +11 -6
- package/dist/typescript/commonjs/src/runtime.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts +2 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/equality.d.ts +2 -0
- package/dist/typescript/commonjs/src/utilities/equality.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utilities/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/utilities/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts +14 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/api.d.ts +5 -5
- package/dist/typescript/commonjs/src/web/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/assign-style.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/helpers.d.ts +2 -1
- package/dist/typescript/module/src/babel/helpers.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/import-plugin.d.ts +1 -1
- package/dist/typescript/module/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/react-native-web.d.ts +2 -1
- package/dist/typescript/module/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/atRules.d.ts +6 -3
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts +3 -7
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +14 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/container-query.d.ts +2 -2
- package/dist/typescript/module/src/compiler/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +4 -5
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/index.d.ts +2 -2
- package/dist/typescript/module/src/compiler/index.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/individual-transforms.d.ts +10 -0
- package/dist/typescript/module/src/compiler/individual-transforms.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/inline-variables.d.ts +2 -2
- package/dist/typescript/module/src/compiler/inline-variables.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/keyframes.d.ts +2 -2
- package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/media-query.d.ts +3 -3
- package/dist/typescript/module/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +1 -1
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts +3 -2
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selectors.d.ts +2 -2
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +10 -10
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +16 -16
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +2 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +2 -10
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/cache-version.d.ts +8 -0
- package/dist/typescript/module/src/metro/cache-version.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/index.d.ts +5 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +10 -5
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/typescript.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/warnings.d.ts +13 -0
- package/dist/typescript/module/src/metro/warnings.d.ts.map +1 -0
- package/dist/typescript/module/src/native/api.d.ts +6 -10
- package/dist/typescript/module/src/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/attributes.d.ts +1 -1
- package/dist/typescript/module/src/native/conditions/attributes.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/container-query.d.ts +2 -2
- package/dist/typescript/module/src/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/guards.d.ts +4 -3
- package/dist/typescript/module/src/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/index.d.ts +3 -3
- package/dist/typescript/module/src/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/media-query.d.ts +1 -1
- package/dist/typescript/module/src/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/native/index.d.ts +3 -3
- package/dist/typescript/module/src/native/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/objects.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/interaction.d.ts +2 -2
- package/dist/typescript/module/src/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/rules.d.ts +9 -4
- package/dist/typescript/module/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts +4 -7
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/usePassthrough.d.ts +1 -1
- package/dist/typescript/module/src/native/react/usePassthrough.d.ts.map +1 -1
- package/dist/typescript/module/src/native/reactivity.d.ts +15 -3
- package/dist/typescript/module/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/native/reanimated.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts +13 -4
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/filters.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/filters.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/index.d.ts +8 -8
- package/dist/typescript/module/src/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/index.d.ts +9 -8
- package/dist/typescript/module/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/line-height.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/line-height.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/resolve.d.ts +7 -4
- package/dist/typescript/module/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/module/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts +2 -2
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/border.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/border.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/index.d.ts +6 -5
- package/dist/typescript/module/src/native/styles/shorthands/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
- package/dist/typescript/module/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/units.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/variables.d.ts +4 -3
- package/dist/typescript/module/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/index.d.ts +3 -3
- package/dist/typescript/module/src/native-internal/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/root.d.ts +39 -1
- package/dist/typescript/module/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/style-collection.d.ts +3 -3
- package/dist/typescript/module/src/native-internal/style-collection.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/variables.d.ts +2 -2
- package/dist/typescript/module/src/native-internal/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.d.ts +1 -1
- package/dist/typescript/module/src/runtime.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.native.d.ts +1 -1
- package/dist/typescript/module/src/runtime.native.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.types.d.ts +11 -6
- package/dist/typescript/module/src/runtime.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts +2 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/equality.d.ts +2 -0
- package/dist/typescript/module/src/utilities/equality.d.ts.map +1 -0
- package/dist/typescript/module/src/utilities/index.d.ts +4 -3
- package/dist/typescript/module/src/utilities/index.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/specificity.d.ts +2 -2
- package/dist/typescript/module/src/utilities/specificity.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/style-descriptor.d.ts +14 -1
- package/dist/typescript/module/src/utilities/style-descriptor.d.ts.map +1 -1
- package/dist/typescript/module/src/web/api.d.ts +5 -5
- package/dist/typescript/module/src/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/web/assign-style.d.ts.map +1 -1
- package/dist/typescript/module/src/web/index.d.ts +3 -3
- package/dist/typescript/module/src/web/index.d.ts.map +1 -1
- package/node/babel.mjs +4 -0
- package/node/compiler.mjs +2 -0
- package/node/metro.mjs +2 -0
- package/package.json +78 -31
- package/src/babel/helpers.ts +8 -1
- package/src/babel/import-plugin.ts +31 -16
- package/src/babel/react-native-web.ts +32 -4
- package/src/babel/react-native.ts +9 -4
- package/src/compiler/atRules.ts +44 -0
- package/src/compiler/compiler.ts +282 -50
- package/src/compiler/compiler.types.ts +17 -0
- package/src/compiler/container-query.ts +8 -3
- package/src/compiler/declarations.ts +385 -247
- package/src/compiler/individual-transforms.ts +129 -0
- package/src/compiler/inline-variables.ts +67 -0
- package/src/compiler/lightningcss-loader.ts +16 -15
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +32 -5
- package/src/compiler/stylesheet.ts +51 -15
- package/src/compiler/supports.ts +1 -3
- package/src/components/FlatList.tsx +1 -0
- package/src/components/ImageBackground.tsx +2 -6
- package/src/components/KeyboardAvoidingView.tsx +2 -3
- package/src/components/SafeAreaProvider.tsx +1 -0
- package/src/components/index.cts +49 -1
- package/src/components/react-native-safe-area-context.native.tsx +20 -0
- package/src/jest/index.ts +3 -1
- package/src/metro/cache-version.ts +48 -0
- package/src/metro/index.ts +7 -0
- package/src/metro/metro-transformer.ts +26 -8
- package/src/metro/typescript.ts +53 -6
- package/src/metro/warnings.ts +187 -0
- package/src/native/api.tsx +26 -18
- package/src/native/conditions/attributes.ts +26 -9
- package/src/native/conditions/container-query.ts +11 -9
- package/src/native/conditions/guards.ts +13 -1
- package/src/native/conditions/media-query.ts +1 -1
- package/src/native/objects.ts +12 -22
- package/src/native/react/interaction.ts +11 -6
- package/src/native/react/rules.ts +58 -45
- package/src/native/react/useNativeCss.ts +85 -18
- package/src/native/react/usePassthrough.ts +3 -2
- package/src/native/reactivity.ts +79 -24
- package/src/native/reanimated.ts +24 -5
- package/src/native/styles/calculate-props.ts +179 -28
- package/src/native/styles/functions/animation-timing.ts +3 -1
- package/src/native/styles/functions/color-mix.ts +45 -39
- package/src/native/styles/functions/filters.ts +21 -6
- package/src/native/styles/functions/numeric-functions.ts +7 -6
- package/src/native/styles/functions/platform-functions.ts +3 -1
- package/src/native/styles/functions/string-functions.ts +25 -5
- package/src/native/styles/functions/transform-functions.ts +111 -64
- package/src/native/styles/index.ts +340 -53
- package/src/native/styles/resolve.ts +188 -29
- package/src/native/styles/scale-factor.ts +9 -0
- package/src/native/styles/shorthands/_handler.ts +14 -1
- package/src/native/styles/shorthands/animation.ts +8 -2
- package/src/native/styles/shorthands/box-shadow.ts +46 -25
- package/src/native/styles/shorthands/index.ts +1 -0
- package/src/native/styles/shorthands/logical-border-width.ts +32 -0
- package/src/native/styles/shorthands/transform.ts +36 -11
- package/src/native/styles/variables.ts +242 -45
- package/src/native-internal/root.ts +83 -13
- package/src/native-internal/style-collection.ts +21 -46
- package/src/native-internal/variables.tsx +6 -4
- package/src/runtime.types.ts +17 -15
- package/src/utilities/dot-notation.types.ts +4 -3
- package/src/utilities/equality.ts +41 -0
- package/src/utilities/index.ts +1 -0
- package/src/utilities/style-descriptor.ts +36 -14
- package/src/web/api.tsx +7 -12
- package/src/web/assign-style.ts +2 -1
- package/types.d.ts +0 -20
- package/dist/commonjs/compiler/inheritance.test.js +0 -78
- package/dist/commonjs/compiler/inheritance.test.js.map +0 -1
- package/dist/module/compiler/inheritance.test.js +0 -78
- package/dist/module/compiler/inheritance.test.js.map +0 -1
- package/dist/typescript/commonjs/.config/eslint.config.d.mts +0 -3
- package/dist/typescript/commonjs/.config/eslint.config.d.mts.map +0 -1
- package/dist/typescript/commonjs/eslint.config.d.mts +0 -2
- package/dist/typescript/commonjs/eslint.config.d.mts.map +0 -1
- package/dist/typescript/commonjs/example/app.config.d.ts +0 -4
- package/dist/typescript/commonjs/example/app.config.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/index.d.ts +0 -2
- package/dist/typescript/commonjs/example/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/metro.config.d.ts +0 -3
- package/dist/typescript/commonjs/example/metro.config.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/postcss.config.d.mts +0 -7
- package/dist/typescript/commonjs/example/postcss.config.d.mts.map +0 -1
- package/dist/typescript/commonjs/example/src/App.d.ts +0 -3
- package/dist/typescript/commonjs/example/src/App.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts +0 -2
- package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts.map +0 -1
- package/dist/typescript/module/.config/eslint.config.d.mts +0 -3
- package/dist/typescript/module/.config/eslint.config.d.mts.map +0 -1
- package/dist/typescript/module/eslint.config.d.mts +0 -2
- package/dist/typescript/module/eslint.config.d.mts.map +0 -1
- package/dist/typescript/module/example/app.config.d.ts +0 -4
- package/dist/typescript/module/example/app.config.d.ts.map +0 -1
- package/dist/typescript/module/example/index.d.ts +0 -2
- package/dist/typescript/module/example/index.d.ts.map +0 -1
- package/dist/typescript/module/example/metro.config.d.ts +0 -3
- package/dist/typescript/module/example/metro.config.d.ts.map +0 -1
- package/dist/typescript/module/example/postcss.config.d.mts +0 -7
- package/dist/typescript/module/example/postcss.config.d.mts.map +0 -1
- package/dist/typescript/module/example/src/App.d.ts +0 -3
- package/dist/typescript/module/example/src/App.d.ts.map +0 -1
- package/dist/typescript/module/src/compiler/inheritance.test.d.ts +0 -2
- package/dist/typescript/module/src/compiler/inheritance.test.d.ts.map +0 -1
- package/src/compiler/inheritance.test.ts +0 -121
|
@@ -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,54 @@ 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",
|
|
75
|
+
// React Native maps paddingBlock/paddingInline to the same Yoga edges as
|
|
76
|
+
// paddingVertical/paddingHorizontal, but Android's TextInput only sees the
|
|
77
|
+
// latter and otherwise keeps its theme padding
|
|
78
|
+
"padding-block": "padding-vertical",
|
|
79
|
+
"padding-inline": "padding-horizontal",
|
|
65
80
|
};
|
|
66
81
|
|
|
82
|
+
// React Native only supports a uniform borderStyle, so per-side border
|
|
83
|
+
// styles have no native equivalent and are dropped. "solid" is dropped
|
|
84
|
+
// silently as it matches React Native's default rendering.
|
|
85
|
+
const unsupportedLogicalStyles = new Set([
|
|
86
|
+
"border-inline-style",
|
|
87
|
+
"border-inline-start-style",
|
|
88
|
+
"border-inline-end-style",
|
|
89
|
+
"border-block-style",
|
|
90
|
+
"border-block-start-style",
|
|
91
|
+
"border-block-end-style",
|
|
92
|
+
]);
|
|
93
|
+
|
|
94
|
+
// One key set per property, so a later declaration replaces an earlier one; Android and iOS rank borderBlockColor against borderTopColor oppositely
|
|
95
|
+
const blockColorEdges = [
|
|
96
|
+
"border-top-color",
|
|
97
|
+
"border-bottom-color",
|
|
98
|
+
] as const satisfies readonly [string, string];
|
|
99
|
+
|
|
100
|
+
// React Native has no borderInlineColor, so the RTL-aware pair is the inline axis's only target
|
|
101
|
+
const inlineColorEdges = [
|
|
102
|
+
"border-start-color",
|
|
103
|
+
"border-end-color",
|
|
104
|
+
] as const satisfies readonly [string, string];
|
|
105
|
+
|
|
67
106
|
const unparsedRuntimeParsing = new Set([
|
|
68
107
|
"animation",
|
|
108
|
+
"animation-name",
|
|
69
109
|
"border",
|
|
110
|
+
"border-block-width",
|
|
111
|
+
"border-inline-width",
|
|
70
112
|
"box-shadow",
|
|
113
|
+
"filter",
|
|
71
114
|
"line-height",
|
|
72
115
|
"rotate",
|
|
73
116
|
"scale",
|
|
@@ -76,6 +119,12 @@ const unparsedRuntimeParsing = new Set([
|
|
|
76
119
|
"translate",
|
|
77
120
|
]);
|
|
78
121
|
|
|
122
|
+
// css-transforms-2 §3: the translate and scale properties take an optional z, which the functions of the same name do not
|
|
123
|
+
const INDIVIDUAL_TRANSFORM_RESOLVERS: ReadonlyMap<string, string> = new Map([
|
|
124
|
+
["scale", "individualScale"],
|
|
125
|
+
["translate", "individualTranslate"],
|
|
126
|
+
]);
|
|
127
|
+
|
|
79
128
|
const parsers: {
|
|
80
129
|
[K in Declaration["property"]]?: Parser<K>;
|
|
81
130
|
} = {
|
|
@@ -101,10 +150,11 @@ const parsers: {
|
|
|
101
150
|
"border-block-color": parseBorderColor,
|
|
102
151
|
"border-block-end": parseBorderBlockEnd,
|
|
103
152
|
"border-block-end-color": parseColorDeclaration,
|
|
153
|
+
"border-block-end-style": parseBorderInlineStyle,
|
|
104
154
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
105
155
|
"border-block-start": parseBorderBlockStart,
|
|
106
156
|
"border-block-start-color": parseColorDeclaration,
|
|
107
|
-
"border-block-start-style":
|
|
157
|
+
"border-block-start-style": parseBorderInlineStyle,
|
|
108
158
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
109
159
|
"border-block-style": parseBorderBlockStyle,
|
|
110
160
|
"border-block-width": parseBorderBlockWidth,
|
|
@@ -289,7 +339,7 @@ function parseWithParser(declaration: Declaration, builder: StylesheetBuilder) {
|
|
|
289
339
|
if (declaration.property in parsers) {
|
|
290
340
|
const parser = parsers[declaration.property] as Parser;
|
|
291
341
|
|
|
292
|
-
builder.
|
|
342
|
+
builder.descriptorProperties = [declaration.property];
|
|
293
343
|
|
|
294
344
|
builder.setWarningProperty(declaration.property);
|
|
295
345
|
const value = parser(declaration, builder, declaration.property);
|
|
@@ -320,11 +370,11 @@ function parseInsetInline(
|
|
|
320
370
|
builder: StylesheetBuilder,
|
|
321
371
|
) {
|
|
322
372
|
builder.addShorthand("inset-inline", {
|
|
323
|
-
"inset-
|
|
373
|
+
"inset-inline-start": parseLengthPercentageOrAuto(
|
|
324
374
|
value.inlineStart,
|
|
325
375
|
builder,
|
|
326
376
|
),
|
|
327
|
-
"inset-
|
|
377
|
+
"inset-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder),
|
|
328
378
|
});
|
|
329
379
|
}
|
|
330
380
|
|
|
@@ -364,6 +414,16 @@ function parseBorderRadius(
|
|
|
364
414
|
});
|
|
365
415
|
}
|
|
366
416
|
|
|
417
|
+
// light-dark() addresses its dark half to descriptorProperties, so a parser that expands onto other properties names them
|
|
418
|
+
function parseColorFor(
|
|
419
|
+
targets: readonly string[],
|
|
420
|
+
cssColor: CssColor,
|
|
421
|
+
builder: StylesheetBuilder,
|
|
422
|
+
) {
|
|
423
|
+
builder.descriptorProperties = targets;
|
|
424
|
+
return parseColor(cssColor, builder);
|
|
425
|
+
}
|
|
426
|
+
|
|
367
427
|
function parseBorderColor(
|
|
368
428
|
declaration: DeclarationType<
|
|
369
429
|
"border-color" | "border-block-color" | "border-inline-color"
|
|
@@ -378,18 +438,20 @@ function parseBorderColor(
|
|
|
378
438
|
"border-right-color": parseColor(declaration.value.right, builder),
|
|
379
439
|
});
|
|
380
440
|
} else {
|
|
381
|
-
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
441
|
+
// Each edge parses its own colour, so a light-dark() component opens its dark rule over the edge it feeds
|
|
442
|
+
const [startProperty, endProperty] =
|
|
443
|
+
declaration.property === "border-inline-color"
|
|
444
|
+
? inlineColorEdges
|
|
445
|
+
: blockColorEdges;
|
|
446
|
+
|
|
447
|
+
builder.addDescriptor(
|
|
448
|
+
startProperty,
|
|
449
|
+
parseColorFor([startProperty], declaration.value.start, builder),
|
|
450
|
+
);
|
|
451
|
+
builder.addDescriptor(
|
|
452
|
+
endProperty,
|
|
453
|
+
parseColorFor([endProperty], declaration.value.end, builder),
|
|
454
|
+
);
|
|
393
455
|
}
|
|
394
456
|
}
|
|
395
457
|
|
|
@@ -436,14 +498,17 @@ function parseBorderBlock(
|
|
|
436
498
|
{ value }: DeclarationType<"border-block">,
|
|
437
499
|
builder: StylesheetBuilder,
|
|
438
500
|
) {
|
|
439
|
-
|
|
440
|
-
builder
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
);
|
|
444
|
-
builder.addDescriptor(
|
|
445
|
-
|
|
501
|
+
const color = parseColorFor(blockColorEdges, value.color, builder);
|
|
502
|
+
const width = parseBorderSideWidth(value.width, builder);
|
|
503
|
+
|
|
504
|
+
builder.addDescriptor(blockColorEdges[0], color);
|
|
505
|
+
builder.addDescriptor(blockColorEdges[1], color);
|
|
506
|
+
builder.addDescriptor("border-top-width", width);
|
|
507
|
+
builder.addDescriptor("border-bottom-width", width);
|
|
508
|
+
dropUnsupportedInlineStyle(
|
|
446
509
|
parseBorderStyle(value.style, builder),
|
|
510
|
+
builder,
|
|
511
|
+
"border-block-style",
|
|
447
512
|
);
|
|
448
513
|
}
|
|
449
514
|
|
|
@@ -456,9 +521,14 @@ function parseBorderBlockStart(
|
|
|
456
521
|
parseColor(value.color, builder),
|
|
457
522
|
);
|
|
458
523
|
builder.addDescriptor(
|
|
459
|
-
"border-
|
|
524
|
+
"border-top-width",
|
|
460
525
|
parseBorderSideWidth(value.width, builder),
|
|
461
526
|
);
|
|
527
|
+
dropUnsupportedInlineStyle(
|
|
528
|
+
parseBorderStyle(value.style, builder),
|
|
529
|
+
builder,
|
|
530
|
+
"border-block-start-style",
|
|
531
|
+
);
|
|
462
532
|
}
|
|
463
533
|
|
|
464
534
|
function parseBorderBlockEnd(
|
|
@@ -470,26 +540,31 @@ function parseBorderBlockEnd(
|
|
|
470
540
|
parseColor(value.color, builder),
|
|
471
541
|
);
|
|
472
542
|
builder.addDescriptor(
|
|
473
|
-
"border-
|
|
543
|
+
"border-bottom-width",
|
|
474
544
|
parseBorderSideWidth(value.width, builder),
|
|
475
545
|
);
|
|
546
|
+
dropUnsupportedInlineStyle(
|
|
547
|
+
parseBorderStyle(value.style, builder),
|
|
548
|
+
builder,
|
|
549
|
+
"border-block-end-style",
|
|
550
|
+
);
|
|
476
551
|
}
|
|
477
552
|
|
|
478
553
|
function parseBorderInline(
|
|
479
554
|
{ value }: DeclarationType<"border-inline">,
|
|
480
555
|
builder: StylesheetBuilder,
|
|
481
556
|
) {
|
|
482
|
-
builder
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
);
|
|
486
|
-
builder.addDescriptor(
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
builder.addDescriptor(
|
|
491
|
-
"border-inline-style",
|
|
557
|
+
const color = parseColor(value.color, builder);
|
|
558
|
+
const width = parseBorderSideWidth(value.width, builder);
|
|
559
|
+
|
|
560
|
+
builder.addDescriptor("border-start-color", color);
|
|
561
|
+
builder.addDescriptor("border-end-color", color);
|
|
562
|
+
builder.addDescriptor("border-start-width", width);
|
|
563
|
+
builder.addDescriptor("border-end-width", width);
|
|
564
|
+
dropUnsupportedInlineStyle(
|
|
492
565
|
parseBorderStyle(value.style, builder),
|
|
566
|
+
builder,
|
|
567
|
+
"border-inline-style",
|
|
493
568
|
);
|
|
494
569
|
}
|
|
495
570
|
|
|
@@ -497,17 +572,15 @@ function parseBorderInlineStart(
|
|
|
497
572
|
{ value }: DeclarationType<"border-inline-start">,
|
|
498
573
|
builder: StylesheetBuilder,
|
|
499
574
|
) {
|
|
575
|
+
builder.addDescriptor("border-start-color", parseColor(value.color, builder));
|
|
500
576
|
builder.addDescriptor(
|
|
501
|
-
"border-
|
|
502
|
-
parseColor(value.color, builder),
|
|
503
|
-
);
|
|
504
|
-
builder.addDescriptor(
|
|
505
|
-
"border-inline-start-width",
|
|
577
|
+
"border-start-width",
|
|
506
578
|
parseBorderSideWidth(value.width, builder),
|
|
507
579
|
);
|
|
508
|
-
|
|
509
|
-
"border-inline-start-style",
|
|
580
|
+
dropUnsupportedInlineStyle(
|
|
510
581
|
parseBorderStyle(value.style, builder),
|
|
582
|
+
builder,
|
|
583
|
+
"border-inline-start-style",
|
|
511
584
|
);
|
|
512
585
|
}
|
|
513
586
|
|
|
@@ -515,17 +588,15 @@ function parseBorderInlineEnd(
|
|
|
515
588
|
{ value }: DeclarationType<"border-inline-end">,
|
|
516
589
|
builder: StylesheetBuilder,
|
|
517
590
|
) {
|
|
591
|
+
builder.addDescriptor("border-end-color", parseColor(value.color, builder));
|
|
518
592
|
builder.addDescriptor(
|
|
519
|
-
"border-
|
|
520
|
-
parseColor(value.color, builder),
|
|
521
|
-
);
|
|
522
|
-
builder.addDescriptor(
|
|
523
|
-
"border-inline-end-width",
|
|
593
|
+
"border-end-width",
|
|
524
594
|
parseBorderSideWidth(value.width, builder),
|
|
525
595
|
);
|
|
526
|
-
|
|
527
|
-
"border-inline-end-style",
|
|
596
|
+
dropUnsupportedInlineStyle(
|
|
528
597
|
parseBorderStyle(value.style, builder),
|
|
598
|
+
builder,
|
|
599
|
+
"border-inline-end-style",
|
|
529
600
|
);
|
|
530
601
|
}
|
|
531
602
|
|
|
@@ -534,9 +605,13 @@ export function parseBorderInlineWidth(
|
|
|
534
605
|
builder: StylesheetBuilder,
|
|
535
606
|
) {
|
|
536
607
|
builder.addDescriptor(
|
|
537
|
-
"border-
|
|
608
|
+
"border-start-width",
|
|
538
609
|
parseBorderSideWidth(declaration.value.start, builder),
|
|
539
610
|
);
|
|
611
|
+
builder.addDescriptor(
|
|
612
|
+
"border-end-width",
|
|
613
|
+
parseBorderSideWidth(declaration.value.end, builder),
|
|
614
|
+
);
|
|
540
615
|
}
|
|
541
616
|
|
|
542
617
|
export function parseBorderInlineStyle(
|
|
@@ -544,31 +619,41 @@ export function parseBorderInlineStyle(
|
|
|
544
619
|
| "border-inline-style"
|
|
545
620
|
| "border-inline-start-style"
|
|
546
621
|
| "border-inline-end-style"
|
|
622
|
+
| "border-block-start-style"
|
|
623
|
+
| "border-block-end-style"
|
|
547
624
|
>,
|
|
548
625
|
builder: StylesheetBuilder,
|
|
549
626
|
) {
|
|
550
627
|
if (typeof declaration.value === "string") {
|
|
551
|
-
|
|
552
|
-
declaration.property,
|
|
628
|
+
dropUnsupportedInlineStyle(
|
|
553
629
|
parseBorderStyle(declaration.value, builder),
|
|
554
|
-
|
|
555
|
-
} else if (declaration.value.start === declaration.value.end) {
|
|
556
|
-
builder.addDescriptor(
|
|
630
|
+
builder,
|
|
557
631
|
declaration.property,
|
|
558
|
-
parseBorderStyle(declaration.value.start, builder),
|
|
559
632
|
);
|
|
560
633
|
} else {
|
|
561
|
-
|
|
562
|
-
"border-inline-start-style",
|
|
634
|
+
dropUnsupportedInlineStyle(
|
|
563
635
|
parseBorderStyle(declaration.value.start, builder),
|
|
636
|
+
builder,
|
|
637
|
+
"border-inline-start-style",
|
|
564
638
|
);
|
|
565
|
-
|
|
566
|
-
"border-inline-end-style",
|
|
639
|
+
dropUnsupportedInlineStyle(
|
|
567
640
|
parseBorderStyle(declaration.value.end, builder),
|
|
641
|
+
builder,
|
|
642
|
+
"border-inline-end-style",
|
|
568
643
|
);
|
|
569
644
|
}
|
|
570
645
|
}
|
|
571
646
|
|
|
647
|
+
function dropUnsupportedInlineStyle(
|
|
648
|
+
style: string | undefined,
|
|
649
|
+
builder: StylesheetBuilder,
|
|
650
|
+
property: string,
|
|
651
|
+
) {
|
|
652
|
+
if (style !== undefined && style !== "solid") {
|
|
653
|
+
builder.addWarning("style", property, style);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
572
657
|
function parseFlexFlow(
|
|
573
658
|
{ value }: DeclarationType<"flex-flow">,
|
|
574
659
|
builder: StylesheetBuilder,
|
|
@@ -649,7 +734,7 @@ function parsePaddingBlock(
|
|
|
649
734
|
{ value }: DeclarationType<"padding-block">,
|
|
650
735
|
builder: StylesheetBuilder,
|
|
651
736
|
) {
|
|
652
|
-
builder.addShorthand("padding-
|
|
737
|
+
builder.addShorthand("padding-vertical", {
|
|
653
738
|
"padding-block-start": parseLengthPercentageOrAuto(
|
|
654
739
|
value.blockStart,
|
|
655
740
|
builder,
|
|
@@ -662,7 +747,7 @@ function parsePaddingInline(
|
|
|
662
747
|
{ value }: DeclarationType<"padding-inline">,
|
|
663
748
|
builder: StylesheetBuilder,
|
|
664
749
|
) {
|
|
665
|
-
builder.addShorthand("padding-
|
|
750
|
+
builder.addShorthand("padding-horizontal", {
|
|
666
751
|
"padding-inline-start": parseLengthPercentageOrAuto(
|
|
667
752
|
value.inlineStart,
|
|
668
753
|
builder,
|
|
@@ -689,146 +774,131 @@ function parseFont(
|
|
|
689
774
|
builder.addDescriptor("font-weight", parseFontWeight(value.weight, builder));
|
|
690
775
|
}
|
|
691
776
|
|
|
777
|
+
type TransformFunction = Extract<
|
|
778
|
+
StyleFunction,
|
|
779
|
+
[Record<never, never>, string, StyleDescriptor]
|
|
780
|
+
>;
|
|
781
|
+
|
|
782
|
+
// An argument React Native has no equivalent for leaves the declaration invalid there, and an invalid declaration is ignored (CSS 2.2 §4.2)
|
|
783
|
+
function hasUnconvertibleArgument(
|
|
784
|
+
functions: readonly TransformFunction[],
|
|
785
|
+
): boolean {
|
|
786
|
+
return functions.some(([, , argument]) => argument === undefined);
|
|
787
|
+
}
|
|
788
|
+
|
|
692
789
|
function parseTransform(
|
|
693
790
|
{ value }: DeclarationType<"transform">,
|
|
694
791
|
builder: StylesheetBuilder,
|
|
695
792
|
) {
|
|
696
|
-
|
|
697
|
-
{
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
case "skew":
|
|
752
|
-
return [
|
|
753
|
-
[{}, "skewX", parseAngle(t.value[0], builder)],
|
|
754
|
-
[{}, "skewY", parseAngle(t.value[1], builder)],
|
|
755
|
-
];
|
|
756
|
-
case "skewX":
|
|
757
|
-
return [[{}, "skewX", parseAngle(t.value, builder)]];
|
|
758
|
-
case "skewY":
|
|
759
|
-
return [[{}, "skewY", parseAngle(t.value, builder)]];
|
|
760
|
-
case "translateZ":
|
|
761
|
-
case "translate3d":
|
|
762
|
-
case "scaleZ":
|
|
763
|
-
case "scale3d":
|
|
764
|
-
case "rotate3d":
|
|
765
|
-
case "matrix":
|
|
766
|
-
case "matrix3d":
|
|
767
|
-
return [[]];
|
|
768
|
-
}
|
|
769
|
-
}),
|
|
770
|
-
]);
|
|
771
|
-
return;
|
|
793
|
+
const functions = value.flatMap((t): TransformFunction[] => {
|
|
794
|
+
switch (t.type) {
|
|
795
|
+
case "perspective":
|
|
796
|
+
return [[{}, "perspective", parseLength(t.value, builder)]];
|
|
797
|
+
case "translate":
|
|
798
|
+
return [
|
|
799
|
+
[{}, "translateX", parseLength(t.value[0], builder)],
|
|
800
|
+
[{}, "translateY", parseLength(t.value[1], builder)],
|
|
801
|
+
];
|
|
802
|
+
case "translateX":
|
|
803
|
+
return [[{}, "translateX", parseLength(t.value, builder)]];
|
|
804
|
+
case "translateY":
|
|
805
|
+
return [[{}, "translateY", parseLength(t.value, builder)]];
|
|
806
|
+
case "rotate":
|
|
807
|
+
return [[{}, "rotate", parseAngle(t.value, builder)]];
|
|
808
|
+
case "rotateX":
|
|
809
|
+
return [[{}, "rotateX", parseAngle(t.value, builder)]];
|
|
810
|
+
case "rotateY":
|
|
811
|
+
return [[{}, "rotateY", parseAngle(t.value, builder)]];
|
|
812
|
+
case "rotateZ":
|
|
813
|
+
return [[{}, "rotateZ", parseAngle(t.value, builder)]];
|
|
814
|
+
case "scale":
|
|
815
|
+
return [
|
|
816
|
+
[{}, "scaleX", parseLength(t.value[0], builder)],
|
|
817
|
+
[{}, "scaleY", parseLength(t.value[1], builder)],
|
|
818
|
+
];
|
|
819
|
+
case "scaleX":
|
|
820
|
+
return [[{}, "scaleX", parseLength(t.value, builder)]];
|
|
821
|
+
case "scaleY":
|
|
822
|
+
return [[{}, "scaleY", parseLength(t.value, builder)]];
|
|
823
|
+
case "skew":
|
|
824
|
+
return [
|
|
825
|
+
[{}, "skewX", parseAngle(t.value[0], builder)],
|
|
826
|
+
[{}, "skewY", parseAngle(t.value[1], builder)],
|
|
827
|
+
];
|
|
828
|
+
case "skewX":
|
|
829
|
+
return [[{}, "skewX", parseAngle(t.value, builder)]];
|
|
830
|
+
case "skewY":
|
|
831
|
+
return [[{}, "skewY", parseAngle(t.value, builder)]];
|
|
832
|
+
case "translateZ":
|
|
833
|
+
case "translate3d":
|
|
834
|
+
case "scaleZ":
|
|
835
|
+
case "scale3d":
|
|
836
|
+
case "rotate3d":
|
|
837
|
+
case "matrix":
|
|
838
|
+
case "matrix3d":
|
|
839
|
+
return [];
|
|
840
|
+
}
|
|
841
|
+
});
|
|
842
|
+
|
|
843
|
+
if (hasUnconvertibleArgument(functions)) {
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
builder.addDescriptor("transform", [{}, "transform", functions]);
|
|
772
848
|
}
|
|
773
849
|
|
|
774
850
|
function parseTranslate(
|
|
775
851
|
{ value }: DeclarationType<"translate">,
|
|
776
852
|
builder: StylesheetBuilder,
|
|
777
853
|
) {
|
|
778
|
-
|
|
779
|
-
{},
|
|
780
|
-
"
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
854
|
+
const translations: TransformFunction[] = [
|
|
855
|
+
[{}, "translateX", parseTranslateProp(value, "x", builder)],
|
|
856
|
+
[{}, "translateY", parseTranslateProp(value, "y", builder)],
|
|
857
|
+
];
|
|
858
|
+
|
|
859
|
+
if (hasUnconvertibleArgument(translations)) {
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
builder.addDescriptor("translate", translations);
|
|
788
864
|
}
|
|
789
865
|
|
|
790
866
|
function parseRotate(
|
|
791
867
|
{ value }: DeclarationType<"rotate">,
|
|
792
868
|
builder: StylesheetBuilder,
|
|
793
869
|
) {
|
|
870
|
+
const angle = parseAngle(value.angle, builder);
|
|
871
|
+
const rotations: TransformFunction[] = [];
|
|
872
|
+
|
|
794
873
|
if (value.x) {
|
|
795
|
-
|
|
796
|
-
{},
|
|
797
|
-
"rotateX",
|
|
798
|
-
parseAngle(value.angle, builder),
|
|
799
|
-
]);
|
|
874
|
+
rotations.push([{}, "rotateX", angle]);
|
|
800
875
|
}
|
|
801
876
|
|
|
802
877
|
if (value.y) {
|
|
803
|
-
|
|
804
|
-
{},
|
|
805
|
-
"rotateY",
|
|
806
|
-
parseAngle(value.angle, builder),
|
|
807
|
-
]);
|
|
878
|
+
rotations.push([{}, "rotateY", angle]);
|
|
808
879
|
}
|
|
809
880
|
|
|
810
881
|
if (value.z) {
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
882
|
+
rotations.push([{}, "rotateZ", angle]);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
if (hasUnconvertibleArgument(rotations)) {
|
|
886
|
+
return;
|
|
816
887
|
}
|
|
888
|
+
|
|
889
|
+
builder.addDescriptor(
|
|
890
|
+
"rotate",
|
|
891
|
+
rotations.length === 1 ? rotations[0] : rotations,
|
|
892
|
+
);
|
|
817
893
|
}
|
|
818
894
|
|
|
819
895
|
function parseScale(
|
|
820
896
|
{ value }: DeclarationType<"scale">,
|
|
821
897
|
builder: StylesheetBuilder,
|
|
822
898
|
) {
|
|
823
|
-
builder.addDescriptor("
|
|
824
|
-
{},
|
|
825
|
-
"
|
|
826
|
-
parseScaleValue(value, "x", builder),
|
|
827
|
-
]);
|
|
828
|
-
builder.addDescriptor("scaleY", [
|
|
829
|
-
{},
|
|
830
|
-
"scaleY",
|
|
831
|
-
parseScaleValue(value, "y", builder),
|
|
899
|
+
builder.addDescriptor("scale", [
|
|
900
|
+
[{}, "scaleX", parseScaleValue(value, "x", builder)],
|
|
901
|
+
[{}, "scaleY", parseScaleValue(value, "y", builder)],
|
|
832
902
|
]);
|
|
833
903
|
}
|
|
834
904
|
|
|
@@ -838,7 +908,7 @@ export function parseScaleValue(
|
|
|
838
908
|
builder: StylesheetBuilder,
|
|
839
909
|
): StyleDescriptor {
|
|
840
910
|
if (translate === "none") {
|
|
841
|
-
return
|
|
911
|
+
return 1;
|
|
842
912
|
}
|
|
843
913
|
|
|
844
914
|
return parseLength(translate[prop], builder);
|
|
@@ -916,6 +986,11 @@ export function parseUnparsedDeclaration(
|
|
|
916
986
|
return;
|
|
917
987
|
}
|
|
918
988
|
|
|
989
|
+
if (unsupportedLogicalStyles.has(property)) {
|
|
990
|
+
builder.addWarning("property", property);
|
|
991
|
+
return;
|
|
992
|
+
}
|
|
993
|
+
|
|
919
994
|
builder.setWarningProperty(property);
|
|
920
995
|
|
|
921
996
|
/**
|
|
@@ -926,10 +1001,28 @@ export function parseUnparsedDeclaration(
|
|
|
926
1001
|
property = rename;
|
|
927
1002
|
}
|
|
928
1003
|
|
|
1004
|
+
// A var() axis colour lands on its edge pair as two declarations, so a later edge colour replaces it in cascade order
|
|
1005
|
+
const edges =
|
|
1006
|
+
property === "border-inline-color"
|
|
1007
|
+
? inlineColorEdges
|
|
1008
|
+
: property === "border-block-color"
|
|
1009
|
+
? blockColorEdges
|
|
1010
|
+
: undefined;
|
|
1011
|
+
|
|
1012
|
+
if (edges) {
|
|
1013
|
+
builder.descriptorProperties = edges;
|
|
1014
|
+
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
1015
|
+
const pair =
|
|
1016
|
+
Array.isArray(value) && !isStyleFunction(value) && value.length === 2;
|
|
1017
|
+
builder.addDescriptor(edges[0], pair ? value[0] : value);
|
|
1018
|
+
builder.addDescriptor(edges[1], pair ? value[1] : value);
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
929
1022
|
/**
|
|
930
1023
|
* Unparsed shorthand properties need to be parsed at runtime
|
|
931
1024
|
*/
|
|
932
|
-
builder.
|
|
1025
|
+
builder.descriptorProperties = [property];
|
|
933
1026
|
|
|
934
1027
|
if (unparsedRuntimeParsing.has(property)) {
|
|
935
1028
|
const args = parseUnparsed(declaration.value.value, builder, property);
|
|
@@ -937,7 +1030,12 @@ export function parseUnparsedDeclaration(
|
|
|
937
1030
|
if (property === "animation") {
|
|
938
1031
|
builder.addDescriptor("animation", [{}, property, args]);
|
|
939
1032
|
} else {
|
|
940
|
-
builder.addDescriptor(property, [
|
|
1033
|
+
builder.addDescriptor(property, [
|
|
1034
|
+
{},
|
|
1035
|
+
INDIVIDUAL_TRANSFORM_RESOLVERS.get(property) ?? toRNProperty(property),
|
|
1036
|
+
args,
|
|
1037
|
+
1,
|
|
1038
|
+
]);
|
|
941
1039
|
}
|
|
942
1040
|
} else {
|
|
943
1041
|
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
@@ -966,7 +1064,10 @@ export function parseCustomDeclaration(
|
|
|
966
1064
|
) {
|
|
967
1065
|
const property = declaration.value.name;
|
|
968
1066
|
|
|
969
|
-
if (property
|
|
1067
|
+
if (isMappingProperty(property)) {
|
|
1068
|
+
// Consumed before declarations so property order cannot affect mapping.
|
|
1069
|
+
return;
|
|
1070
|
+
} else if (property === "-webkit-line-clamp") {
|
|
970
1071
|
builder.addDescriptor(
|
|
971
1072
|
property,
|
|
972
1073
|
parseUnparsed(declaration.value.value, builder, property),
|
|
@@ -997,6 +1098,18 @@ export function parseCustomDeclaration(
|
|
|
997
1098
|
);
|
|
998
1099
|
} else if (property === "corner-shape") {
|
|
999
1100
|
parseCornerShape(declaration.value, builder);
|
|
1101
|
+
} else if (property === "font-variant") {
|
|
1102
|
+
const parsedFontVariant = parseFontVariantCaps(
|
|
1103
|
+
parseUnparsed(
|
|
1104
|
+
declaration.value.value,
|
|
1105
|
+
builder,
|
|
1106
|
+
property,
|
|
1107
|
+
) as FontVariantCaps,
|
|
1108
|
+
builder,
|
|
1109
|
+
);
|
|
1110
|
+
if (parsedFontVariant !== undefined) {
|
|
1111
|
+
builder.addDescriptor(property, parsedFontVariant);
|
|
1112
|
+
}
|
|
1000
1113
|
} else if (
|
|
1001
1114
|
validProperties.has(property) ||
|
|
1002
1115
|
property.startsWith("--") ||
|
|
@@ -1039,8 +1152,9 @@ export function reduceParseUnparsed(
|
|
|
1039
1152
|
}
|
|
1040
1153
|
}
|
|
1041
1154
|
|
|
1042
|
-
// Groups are the tokens grouped together by comma location
|
|
1043
|
-
//
|
|
1155
|
+
// Groups are the tokens grouped together by comma location. Each stays an
|
|
1156
|
+
// array, so a one-token item of a comma-separated list stays distinct from
|
|
1157
|
+
// a token of a space-separated one (css-variables-1 §2.1)
|
|
1044
1158
|
groups = groups.flatMap((group): StyleDescriptor[] => {
|
|
1045
1159
|
if (!Array.isArray(group)) {
|
|
1046
1160
|
return [];
|
|
@@ -1054,7 +1168,7 @@ export function reduceParseUnparsed(
|
|
|
1054
1168
|
if (first === undefined) {
|
|
1055
1169
|
return [];
|
|
1056
1170
|
} else {
|
|
1057
|
-
return [first];
|
|
1171
|
+
return [[first]];
|
|
1058
1172
|
}
|
|
1059
1173
|
} else if (
|
|
1060
1174
|
// This is a special case for <ratio> values
|
|
@@ -1066,13 +1180,19 @@ export function reduceParseUnparsed(
|
|
|
1066
1180
|
)
|
|
1067
1181
|
) {
|
|
1068
1182
|
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
1069
|
-
return [group.join(" ")];
|
|
1183
|
+
return [[group.join(" ")]];
|
|
1070
1184
|
} else {
|
|
1071
1185
|
return [group];
|
|
1072
1186
|
}
|
|
1073
1187
|
});
|
|
1074
1188
|
|
|
1075
|
-
|
|
1189
|
+
if (groups.length !== 1) {
|
|
1190
|
+
return groups;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
// A lone group is the value, and a lone token the group
|
|
1194
|
+
const group = groups[0] as StyleDescriptor[];
|
|
1195
|
+
return group.length === 1 ? group[0] : group;
|
|
1076
1196
|
}
|
|
1077
1197
|
|
|
1078
1198
|
export function unparsedFunction(
|
|
@@ -1442,6 +1562,7 @@ export function parseLength(
|
|
|
1442
1562
|
switch (length.type) {
|
|
1443
1563
|
case "calc": {
|
|
1444
1564
|
// TODO: Add the calc polyfill
|
|
1565
|
+
builder.addWarning("value", "calc()");
|
|
1445
1566
|
return undefined;
|
|
1446
1567
|
}
|
|
1447
1568
|
case "number": {
|
|
@@ -1594,11 +1715,23 @@ export function parseColorDeclaration(
|
|
|
1594
1715
|
builder: StylesheetBuilder,
|
|
1595
1716
|
) {
|
|
1596
1717
|
builder.addDescriptor(
|
|
1597
|
-
declaration.property,
|
|
1718
|
+
propertyRename[declaration.property] ?? declaration.property,
|
|
1598
1719
|
parseColor(declaration.value, builder),
|
|
1599
1720
|
);
|
|
1600
1721
|
}
|
|
1601
1722
|
|
|
1723
|
+
/**
|
|
1724
|
+
* Lab/LCH/OKLab/OKLCH channels can be `NaN` when lightningcss resolves a
|
|
1725
|
+
* degenerate `color-mix()` at compile time (e.g. mixing black with
|
|
1726
|
+
* `transparent` in oklab yields `NaN` for the a/b chromaticity channels).
|
|
1727
|
+
* Passing `NaN` to colorjs.io produces an invalid string such as
|
|
1728
|
+
* `#NaNNaNNaN80`, which React Native silently discards. Per CSS Color 4 a
|
|
1729
|
+
* missing component is treated as `0`, so coerce `NaN` to `0`.
|
|
1730
|
+
*/
|
|
1731
|
+
function nanToZero(value: number): number {
|
|
1732
|
+
return Number.isNaN(value) ? 0 : value;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1602
1735
|
export function parseColor(cssColor: CssColor, builder: StylesheetBuilder) {
|
|
1603
1736
|
if (typeof cssColor === "string") {
|
|
1604
1737
|
if (namedColors.has(cssColor)) {
|
|
@@ -1653,28 +1786,44 @@ export function parseColor(cssColor: CssColor, builder: StylesheetBuilder) {
|
|
|
1653
1786
|
case "lab":
|
|
1654
1787
|
color = new Color({
|
|
1655
1788
|
space: cssColor.type,
|
|
1656
|
-
coords: [
|
|
1789
|
+
coords: [
|
|
1790
|
+
nanToZero(cssColor.l),
|
|
1791
|
+
nanToZero(cssColor.a),
|
|
1792
|
+
nanToZero(cssColor.b),
|
|
1793
|
+
],
|
|
1657
1794
|
alpha: cssColor.alpha,
|
|
1658
1795
|
});
|
|
1659
1796
|
break;
|
|
1660
1797
|
case "lch":
|
|
1661
1798
|
color = new Color({
|
|
1662
1799
|
space: cssColor.type,
|
|
1663
|
-
coords: [
|
|
1800
|
+
coords: [
|
|
1801
|
+
nanToZero(cssColor.l),
|
|
1802
|
+
nanToZero(cssColor.c),
|
|
1803
|
+
nanToZero(cssColor.h),
|
|
1804
|
+
],
|
|
1664
1805
|
alpha: cssColor.alpha,
|
|
1665
1806
|
});
|
|
1666
1807
|
break;
|
|
1667
1808
|
case "oklab":
|
|
1668
1809
|
color = new Color({
|
|
1669
1810
|
space: cssColor.type,
|
|
1670
|
-
coords: [
|
|
1811
|
+
coords: [
|
|
1812
|
+
nanToZero(cssColor.l),
|
|
1813
|
+
nanToZero(cssColor.a),
|
|
1814
|
+
nanToZero(cssColor.b),
|
|
1815
|
+
],
|
|
1671
1816
|
alpha: cssColor.alpha,
|
|
1672
1817
|
});
|
|
1673
1818
|
break;
|
|
1674
1819
|
case "oklch":
|
|
1675
1820
|
color = new Color({
|
|
1676
1821
|
space: cssColor.type,
|
|
1677
|
-
coords: [
|
|
1822
|
+
coords: [
|
|
1823
|
+
nanToZero(cssColor.l),
|
|
1824
|
+
nanToZero(cssColor.c),
|
|
1825
|
+
nanToZero(cssColor.h),
|
|
1826
|
+
],
|
|
1678
1827
|
alpha: cssColor.alpha,
|
|
1679
1828
|
});
|
|
1680
1829
|
break;
|
|
@@ -2122,12 +2271,8 @@ export function parseBorderBlockWidth(
|
|
|
2122
2271
|
const start = parseBorderSideWidth(declaration.value.start, builder);
|
|
2123
2272
|
const end = parseBorderSideWidth(declaration.value.end, builder);
|
|
2124
2273
|
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
} else {
|
|
2128
|
-
builder.addDescriptor("border-block-start-width", start);
|
|
2129
|
-
builder.addDescriptor("border-block-end-width", end);
|
|
2130
|
-
}
|
|
2274
|
+
builder.addDescriptor("border-top-width", start);
|
|
2275
|
+
builder.addDescriptor("border-bottom-width", end);
|
|
2131
2276
|
}
|
|
2132
2277
|
|
|
2133
2278
|
function parseBorderBlockStyle(
|
|
@@ -2137,12 +2282,8 @@ function parseBorderBlockStyle(
|
|
|
2137
2282
|
const start = parseBorderStyle(declaration.value.start, builder);
|
|
2138
2283
|
const end = parseBorderStyle(declaration.value.end, builder);
|
|
2139
2284
|
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
} else {
|
|
2143
|
-
builder.addDescriptor("border-block-start-style", start);
|
|
2144
|
-
builder.addDescriptor("border-block-end-style", end);
|
|
2145
|
-
}
|
|
2285
|
+
dropUnsupportedInlineStyle(start, builder, "border-block-start-style");
|
|
2286
|
+
dropUnsupportedInlineStyle(end, builder, "border-block-end-style");
|
|
2146
2287
|
}
|
|
2147
2288
|
|
|
2148
2289
|
export function parseBorderSideWidthDeclaration(
|
|
@@ -2150,7 +2291,7 @@ export function parseBorderSideWidthDeclaration(
|
|
|
2150
2291
|
builder: StylesheetBuilder,
|
|
2151
2292
|
) {
|
|
2152
2293
|
builder.addDescriptor(
|
|
2153
|
-
declaration.property,
|
|
2294
|
+
propertyRename[declaration.property] ?? declaration.property,
|
|
2154
2295
|
parseBorderSideWidth(declaration.value, builder),
|
|
2155
2296
|
);
|
|
2156
2297
|
}
|
|
@@ -2194,12 +2335,10 @@ export function parseLineHeightDeclaration(
|
|
|
2194
2335
|
declaration: DeclarationType<"line-height">,
|
|
2195
2336
|
builder: StylesheetBuilder,
|
|
2196
2337
|
) {
|
|
2197
|
-
builder.addDescriptor(
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
1,
|
|
2202
|
-
]);
|
|
2338
|
+
builder.addDescriptor(
|
|
2339
|
+
"line-height",
|
|
2340
|
+
parseLineHeight(declaration.value, builder),
|
|
2341
|
+
);
|
|
2203
2342
|
}
|
|
2204
2343
|
|
|
2205
2344
|
export function parseLineHeight(
|
|
@@ -2210,7 +2349,7 @@ export function parseLineHeight(
|
|
|
2210
2349
|
case "normal":
|
|
2211
2350
|
return undefined;
|
|
2212
2351
|
case "number":
|
|
2213
|
-
return [{}, "em",
|
|
2352
|
+
return [{}, "em", value.value, 1];
|
|
2214
2353
|
case "length": {
|
|
2215
2354
|
const length = value.value;
|
|
2216
2355
|
|
|
@@ -2223,7 +2362,7 @@ export function parseLineHeight(
|
|
|
2223
2362
|
"style",
|
|
2224
2363
|
"line-height",
|
|
2225
2364
|
typeof length.value === "number"
|
|
2226
|
-
? length.value
|
|
2365
|
+
? String(length.value)
|
|
2227
2366
|
: JSON.stringify(length.value),
|
|
2228
2367
|
);
|
|
2229
2368
|
return;
|
|
@@ -2316,13 +2455,6 @@ export function parseFontVariantCaps(
|
|
|
2316
2455
|
return undefined;
|
|
2317
2456
|
}
|
|
2318
2457
|
|
|
2319
|
-
export function parseLengthOrCoercePercentageToRuntime(
|
|
2320
|
-
value: Length | DimensionPercentageFor_LengthValue | NumberOrPercentage,
|
|
2321
|
-
builder: StylesheetBuilder,
|
|
2322
|
-
): StyleDescriptor {
|
|
2323
|
-
return parseLength(value, builder);
|
|
2324
|
-
}
|
|
2325
|
-
|
|
2326
2458
|
export function parseGap(
|
|
2327
2459
|
declaration: DeclarationType<"gap" | "column-gap" | "row-gap">,
|
|
2328
2460
|
builder: StylesheetBuilder,
|
|
@@ -2640,7 +2772,12 @@ export function parseColorMix(
|
|
|
2640
2772
|
builder: StylesheetBuilder,
|
|
2641
2773
|
property: string,
|
|
2642
2774
|
): StyleDescriptor {
|
|
2643
|
-
const [inToken, whitespace, colorSpace, comma, ...
|
|
2775
|
+
const [inToken, whitespace, colorSpace, comma, ...remaining] = tokens;
|
|
2776
|
+
const rest = remaining.filter(
|
|
2777
|
+
(token) =>
|
|
2778
|
+
token.type !== "token" ||
|
|
2779
|
+
!["white-space", "comment"].includes(token.value.type),
|
|
2780
|
+
);
|
|
2644
2781
|
if (
|
|
2645
2782
|
typeof inToken !== "object" ||
|
|
2646
2783
|
inToken.type !== "token" ||
|
|
@@ -2699,11 +2836,6 @@ export function parseColorMix(
|
|
|
2699
2836
|
|
|
2700
2837
|
const rightColorArg = parseUnparsed(nextToken, builder, property);
|
|
2701
2838
|
|
|
2702
|
-
if (rightColorArg === "transparent") {
|
|
2703
|
-
// Ignore the rest, treat as single color with alpha
|
|
2704
|
-
return [{}, "colorMix", [colorSpaceArg, leftColorArg, leftColorPercentage]];
|
|
2705
|
-
}
|
|
2706
|
-
|
|
2707
2839
|
nextToken = rest.shift();
|
|
2708
2840
|
let rightColorPercentage: StyleDescriptor | undefined;
|
|
2709
2841
|
if (nextToken?.type !== "token" || nextToken.value.type !== "comma") {
|
|
@@ -2719,13 +2851,15 @@ export function parseColorMix(
|
|
|
2719
2851
|
return [
|
|
2720
2852
|
{},
|
|
2721
2853
|
"colorMix",
|
|
2854
|
+
// Omitted weights must not leave holes: Metro serializes them as null,
|
|
2855
|
+
// which the native resolver rejects.
|
|
2722
2856
|
[
|
|
2723
2857
|
colorSpaceArg,
|
|
2724
2858
|
leftColorArg,
|
|
2725
2859
|
leftColorPercentage,
|
|
2726
2860
|
rightColorArg,
|
|
2727
2861
|
rightColorPercentage,
|
|
2728
|
-
],
|
|
2862
|
+
].filter((arg) => arg !== undefined),
|
|
2729
2863
|
];
|
|
2730
2864
|
}
|
|
2731
2865
|
|
|
@@ -2851,10 +2985,10 @@ export function parseUnresolvedColor(
|
|
|
2851
2985
|
{},
|
|
2852
2986
|
"rgba",
|
|
2853
2987
|
[
|
|
2854
|
-
round(color.r * 255),
|
|
2855
|
-
round(color.g * 255),
|
|
2856
|
-
round(color.b * 255),
|
|
2857
|
-
parseUnparsed(color.alpha, builder, property),
|
|
2988
|
+
[round(color.r * 255)],
|
|
2989
|
+
[round(color.g * 255)],
|
|
2990
|
+
[round(color.b * 255)],
|
|
2991
|
+
[parseUnparsed(color.alpha, builder, property)],
|
|
2858
2992
|
],
|
|
2859
2993
|
];
|
|
2860
2994
|
case "hsl":
|
|
@@ -2862,10 +2996,10 @@ export function parseUnresolvedColor(
|
|
|
2862
2996
|
{},
|
|
2863
2997
|
color.type,
|
|
2864
2998
|
[
|
|
2865
|
-
color.h,
|
|
2866
|
-
color.s,
|
|
2867
|
-
color.l,
|
|
2868
|
-
parseUnparsed(color.alpha, builder, property),
|
|
2999
|
+
[color.h],
|
|
3000
|
+
[color.s],
|
|
3001
|
+
[color.l],
|
|
3002
|
+
[parseUnparsed(color.alpha, builder, property)],
|
|
2869
3003
|
],
|
|
2870
3004
|
];
|
|
2871
3005
|
case "light-dark": {
|
|
@@ -3103,21 +3237,25 @@ function parseBackgroundImage(
|
|
|
3103
3237
|
declaration: DeclarationType<"background-image">,
|
|
3104
3238
|
builder: StylesheetBuilder,
|
|
3105
3239
|
) {
|
|
3106
|
-
builder.addDescriptor(
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3240
|
+
builder.addDescriptor("experimental_backgroundImage", [
|
|
3241
|
+
{},
|
|
3242
|
+
"join",
|
|
3243
|
+
[
|
|
3244
|
+
declaration.value.flatMap((image): StyleDescriptor[] => {
|
|
3245
|
+
switch (image.type) {
|
|
3246
|
+
case "gradient": {
|
|
3247
|
+
const gradient = parseGradient(image.value, builder);
|
|
3248
|
+
return gradient ? [gradient] : [];
|
|
3249
|
+
}
|
|
3250
|
+
case "none":
|
|
3251
|
+
return ["none"];
|
|
3113
3252
|
}
|
|
3114
|
-
case "none":
|
|
3115
|
-
return ["none"];
|
|
3116
|
-
}
|
|
3117
3253
|
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3254
|
+
return [];
|
|
3255
|
+
}),
|
|
3256
|
+
", ",
|
|
3257
|
+
],
|
|
3258
|
+
]);
|
|
3121
3259
|
return;
|
|
3122
3260
|
}
|
|
3123
3261
|
|
|
@@ -3131,8 +3269,8 @@ function parseGradient(
|
|
|
3131
3269
|
{},
|
|
3132
3270
|
"linear-gradient",
|
|
3133
3271
|
[
|
|
3134
|
-
parseLineDirection(gradient.direction, builder),
|
|
3135
|
-
...gradient.items.map((item) => parseGradientItem(item, builder)),
|
|
3272
|
+
[parseLineDirection(gradient.direction, builder)],
|
|
3273
|
+
...gradient.items.map((item) => [parseGradientItem(item, builder)]),
|
|
3136
3274
|
],
|
|
3137
3275
|
];
|
|
3138
3276
|
}
|
|
@@ -3172,10 +3310,10 @@ function parseGradientItem(
|
|
|
3172
3310
|
args.push(parseLength(item.position, builder));
|
|
3173
3311
|
}
|
|
3174
3312
|
|
|
3175
|
-
return [{}, "
|
|
3313
|
+
return [{}, "colorStop", args, 1];
|
|
3176
3314
|
}
|
|
3177
3315
|
case "hint":
|
|
3178
|
-
return parseLength(item.value, builder);
|
|
3316
|
+
return [{}, "gradientPosition", parseLength(item.value, builder), 1];
|
|
3179
3317
|
}
|
|
3180
3318
|
}
|
|
3181
3319
|
|
|
@@ -3275,7 +3413,7 @@ function parseFilter(
|
|
|
3275
3413
|
} as unknown as StyleDescriptor;
|
|
3276
3414
|
case "hue-rotate":
|
|
3277
3415
|
return {
|
|
3278
|
-
[value.type]: parseAngle(value.value, builder),
|
|
3416
|
+
[toRNProperty(value.type)]: parseAngle(value.value, builder),
|
|
3279
3417
|
} as unknown as StyleDescriptor;
|
|
3280
3418
|
case "drop-shadow":
|
|
3281
3419
|
return [
|