react-native-css 3.0.0-nightly.fa5e95b → 3.0.0-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/compiler/atRules.js +15 -2
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +13 -8
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +224 -152
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inheritance.test.js +12 -12
- package/dist/commonjs/compiler/inheritance.test.js.map +1 -1
- package/dist/commonjs/compiler/keyframes.js +1 -1
- package/dist/commonjs/compiler/keyframes.js.map +1 -1
- package/dist/commonjs/compiler/pseudo-elements.js +49 -0
- package/dist/commonjs/compiler/pseudo-elements.js.map +1 -0
- package/dist/commonjs/compiler/selector-builder.js +501 -0
- package/dist/commonjs/compiler/selector-builder.js.map +1 -0
- package/dist/commonjs/compiler/selectors.js +10 -6
- package/dist/commonjs/compiler/selectors.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +58 -25
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/compiler/supports.js +27 -0
- package/dist/commonjs/compiler/supports.js.map +1 -0
- package/dist/commonjs/components/ActivityIndicator.js +22 -0
- package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
- package/dist/commonjs/components/Button.js +22 -0
- package/dist/commonjs/components/Button.js.map +1 -0
- package/dist/commonjs/components/FlatList.js +19 -0
- package/dist/commonjs/components/FlatList.js.map +1 -0
- package/dist/commonjs/components/Image.js +17 -0
- package/dist/commonjs/components/Image.js.map +1 -0
- package/dist/commonjs/components/Switch.js +17 -0
- package/dist/commonjs/components/Switch.js.map +1 -0
- package/dist/commonjs/components/TextInput.js +17 -0
- package/dist/commonjs/components/TextInput.js.map +1 -0
- package/dist/commonjs/components/index.js +48 -0
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/components/react-native-safe-area-context.js +17 -0
- package/dist/commonjs/components/react-native-safe-area-context.js.map +1 -0
- package/dist/commonjs/components/react-native-safe-area-context.native.js +53 -0
- package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -0
- package/dist/commonjs/jest/index.js +24 -17
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +7 -4
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/injection-code.js +5 -10
- package/dist/commonjs/metro/injection-code.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +18 -8
- package/dist/commonjs/metro/metro-transformer.js.map +1 -1
- package/dist/commonjs/metro/resolver.js +3 -0
- package/dist/commonjs/metro/resolver.js.map +1 -1
- package/dist/commonjs/poison.pill.js +10 -10
- package/dist/commonjs/runtime/native/api.js +8 -2
- package/dist/commonjs/runtime/native/api.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
- package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
- package/dist/commonjs/runtime/native/conditions/container-query.js +7 -0
- package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/index.js +6 -40
- package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +16 -11
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/runtime/native/react/rules.js +26 -20
- package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
- package/dist/commonjs/runtime/native/react/useNativeCss.js +2 -2
- package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/runtime/native/reactivity.js +12 -21
- package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
- package/dist/commonjs/runtime/native/reanimated.js +17 -0
- package/dist/commonjs/runtime/native/reanimated.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/calculate-props.js +29 -9
- package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/defaults.js +1 -1
- package/dist/commonjs/runtime/native/styles/defaults.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/functions/animation-timing.js +34 -0
- package/dist/commonjs/runtime/native/styles/functions/animation-timing.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/calc.js +125 -0
- package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{filters.js → functions/filters.js} +3 -3
- package/dist/commonjs/runtime/native/styles/functions/filters.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/index.js +83 -0
- package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/numeric-functions.js +32 -0
- package/dist/commonjs/runtime/native/styles/functions/numeric-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +3 -3
- package/dist/commonjs/runtime/native/styles/functions/platform-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/string-functions.js +23 -0
- package/dist/commonjs/runtime/native/styles/functions/string-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +121 -0
- package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/resolve.js +21 -44
- package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
- package/dist/commonjs/runtime/native/styles/shorthands/_handler.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{animation.js → shorthands/animation.js} +6 -37
- package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{border.js → shorthands/border.js} +2 -2
- package/dist/commonjs/runtime/native/styles/shorthands/border.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js +50 -0
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/shorthands/index.js +61 -0
- package/dist/commonjs/runtime/native/styles/shorthands/index.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +2 -2
- package/dist/commonjs/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{transform.js → shorthands/transform.js} +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/units.js +1 -1
- package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/variables.js +3 -2
- package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
- package/dist/commonjs/runtime/utils/objects.js +14 -6
- package/dist/commonjs/runtime/utils/objects.js.map +1 -1
- package/dist/commonjs/runtime/utils/specificity.js +2 -1
- package/dist/commonjs/runtime/utils/specificity.js.map +1 -1
- package/dist/commonjs/runtime/web/api.js.map +1 -1
- package/dist/commonjs/style-collection/index.js +110 -0
- package/dist/commonjs/style-collection/index.js.map +1 -0
- package/dist/commonjs/style-collection/root.js +28 -0
- package/dist/commonjs/style-collection/root.js.map +1 -0
- package/dist/module/compiler/atRules.js +15 -2
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +13 -8
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js +1 -1
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/declarations.js +220 -148
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inheritance.test.js +12 -12
- package/dist/module/compiler/inheritance.test.js.map +1 -1
- package/dist/module/compiler/keyframes.js +1 -1
- package/dist/module/compiler/keyframes.js.map +1 -1
- package/dist/module/compiler/pseudo-elements.js +44 -0
- package/dist/module/compiler/pseudo-elements.js.map +1 -0
- package/dist/module/compiler/selector-builder.js +496 -0
- package/dist/module/compiler/selector-builder.js.map +1 -0
- package/dist/module/compiler/selectors.js +10 -6
- package/dist/module/compiler/selectors.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +56 -23
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/compiler/supports.js +23 -0
- package/dist/module/compiler/supports.js.map +1 -0
- package/dist/module/components/ActivityIndicator.js +17 -0
- package/dist/module/components/ActivityIndicator.js.map +1 -0
- package/dist/module/components/Button.js +17 -0
- package/dist/module/components/Button.js.map +1 -0
- package/dist/module/components/FlatList.js +14 -0
- package/dist/module/components/FlatList.js.map +1 -0
- package/dist/module/components/Image.js +12 -0
- package/dist/module/components/Image.js.map +1 -0
- package/dist/module/components/Switch.js +12 -0
- package/dist/module/components/Switch.js.map +1 -0
- package/dist/module/components/TextInput.js +12 -0
- package/dist/module/components/TextInput.js.map +1 -0
- package/dist/module/components/index.js +6 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/react-native-safe-area-context.js +4 -0
- package/dist/module/components/react-native-safe-area-context.js.map +1 -0
- package/dist/module/components/react-native-safe-area-context.native.js +36 -0
- package/dist/module/components/react-native-safe-area-context.native.js.map +1 -0
- package/dist/module/jest/index.js +22 -16
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +7 -4
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/injection-code.js +5 -10
- package/dist/module/metro/injection-code.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +18 -8
- package/dist/module/metro/metro-transformer.js.map +1 -1
- package/dist/module/metro/resolver.js +3 -0
- package/dist/module/metro/resolver.js.map +1 -1
- package/dist/module/poison.pill.js +10 -10
- package/dist/module/runtime/native/api.js +2 -1
- package/dist/module/runtime/native/api.js.map +1 -1
- package/dist/module/runtime/native/conditions/attributes.js +38 -0
- package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
- package/dist/module/runtime/native/conditions/container-query.js +7 -0
- package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/module/runtime/native/conditions/index.js +6 -40
- package/dist/module/runtime/native/conditions/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +17 -12
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/module/runtime/native/react/rules.js +24 -19
- package/dist/module/runtime/native/react/rules.js.map +1 -1
- package/dist/module/runtime/native/react/useNativeCss.js +1 -1
- package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/module/runtime/native/reactivity.js +11 -20
- package/dist/module/runtime/native/reactivity.js.map +1 -1
- package/dist/module/runtime/native/reanimated.js +13 -0
- package/dist/module/runtime/native/reanimated.js.map +1 -0
- package/dist/module/runtime/native/styles/calculate-props.js +30 -10
- package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/module/runtime/native/styles/defaults.js +1 -1
- package/dist/module/runtime/native/styles/defaults.js.map +1 -1
- package/dist/module/runtime/native/styles/functions/animation-timing.js +30 -0
- package/dist/module/runtime/native/styles/functions/animation-timing.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/calc.js +120 -0
- package/dist/module/runtime/native/styles/functions/calc.js.map +1 -0
- package/dist/module/runtime/native/styles/{filters.js → functions/filters.js} +2 -2
- package/dist/module/runtime/native/styles/functions/filters.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/index.js +10 -0
- package/dist/module/runtime/native/styles/functions/index.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/numeric-functions.js +25 -0
- package/dist/module/runtime/native/styles/functions/numeric-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +1 -1
- package/dist/module/runtime/native/styles/functions/platform-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/string-functions.js +18 -0
- package/dist/module/runtime/native/styles/functions/string-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/transform-functions.js +114 -0
- package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/resolve.js +20 -44
- package/dist/module/runtime/native/styles/resolve.js.map +1 -1
- package/dist/module/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
- package/dist/module/runtime/native/styles/shorthands/_handler.js.map +1 -0
- package/dist/module/runtime/native/styles/{animation.js → shorthands/animation.js} +3 -34
- package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -0
- package/dist/module/runtime/native/styles/{border.js → shorthands/border.js} +1 -1
- package/dist/module/runtime/native/styles/shorthands/border.js.map +1 -0
- package/dist/module/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +16 -6
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
- package/dist/module/runtime/native/styles/shorthands/index.js +8 -0
- package/dist/module/runtime/native/styles/shorthands/index.js.map +1 -0
- package/dist/module/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +1 -1
- package/dist/module/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
- package/dist/module/runtime/native/styles/{transform.js → shorthands/transform.js} +1 -1
- package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -0
- package/dist/module/runtime/native/styles/units.js +1 -1
- package/dist/module/runtime/native/styles/units.js.map +1 -1
- package/dist/module/runtime/native/styles/variables.js +2 -1
- package/dist/module/runtime/native/styles/variables.js.map +1 -1
- package/dist/module/runtime/utils/objects.js +14 -6
- package/dist/module/runtime/utils/objects.js.map +1 -1
- package/dist/module/runtime/utils/specificity.js +2 -1
- package/dist/module/runtime/utils/specificity.js.map +1 -1
- package/dist/module/runtime/web/api.js.map +1 -1
- package/dist/module/style-collection/index.js +95 -0
- package/dist/module/style-collection/index.js.map +1 -0
- package/dist/module/style-collection/root.js +24 -0
- package/dist/module/style-collection/root.js.map +1 -0
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +11 -13
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +16 -18
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts +4 -0
- package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +24 -0
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts +3 -2
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +7 -7
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/supports.d.ts +3 -0
- package/dist/typescript/commonjs/src/compiler/supports.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +13 -0
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Button.d.ts +13 -0
- package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/FlatList.d.ts +10 -0
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Image.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Switch.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/TextInput.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.ts +6 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/jest/index.d.ts +13 -3
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/injection-code.d.ts +4 -7
- package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +4 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts +3 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +1 -9
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +8 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/numeric-functions.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/numeric-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/string-functions.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/string-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts +6 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/style-collection/index.d.ts +14 -0
- package/dist/typescript/commonjs/src/style-collection/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/style-collection/root.d.ts +11 -0
- package/dist/typescript/commonjs/src/style-collection/root.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +11 -13
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +16 -18
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +4 -0
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/selector-builder.d.ts +24 -0
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/selectors.d.ts +3 -2
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +7 -7
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/supports.d.ts +3 -0
- package/dist/typescript/module/src/compiler/supports.d.ts.map +1 -0
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts +13 -0
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Button.d.ts +13 -0
- package/dist/typescript/module/src/components/Button.d.ts.map +1 -0
- package/dist/typescript/module/src/components/FlatList.d.ts +10 -0
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Image.d.ts +8 -0
- package/dist/typescript/module/src/components/Image.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Switch.d.ts +8 -0
- package/dist/typescript/module/src/components/Switch.d.ts.map +1 -0
- package/dist/typescript/module/src/components/TextInput.d.ts +8 -0
- package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +6 -0
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts +2 -0
- package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts.map +1 -0
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +4 -0
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
- package/dist/typescript/module/src/jest/index.d.ts +13 -3
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/injection-code.d.ts +4 -7
- package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +4 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts +3 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/rules.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts +1 -9
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/reanimated.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/reanimated.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts +1 -1
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
- package/dist/typescript/module/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +8 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/numeric-functions.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/numeric-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
- package/dist/typescript/module/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/string-functions.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/string-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
- package/dist/typescript/module/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts +6 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/utils/specificity.d.ts +1 -0
- package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/web/api.d.ts +1 -1
- package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/style-collection/index.d.ts +14 -0
- package/dist/typescript/module/src/style-collection/index.d.ts.map +1 -0
- package/dist/typescript/module/src/style-collection/root.d.ts +11 -0
- package/dist/typescript/module/src/style-collection/root.d.ts.map +1 -0
- package/package.json +31 -15
- package/src/compiler/atRules.ts +16 -2
- package/src/compiler/compiler.ts +12 -10
- package/src/compiler/compiler.types.ts +11 -14
- package/src/compiler/declarations.ts +402 -193
- package/src/compiler/inheritance.test.ts +10 -10
- package/src/compiler/keyframes.ts +1 -1
- package/src/compiler/pseudo-elements.ts +54 -0
- package/src/compiler/selector-builder.ts +586 -0
- package/src/compiler/selectors.ts +20 -6
- package/src/compiler/stylesheet.ts +87 -33
- package/src/compiler/supports.ts +26 -0
- package/src/components/ActivityIndicator.tsx +27 -0
- package/src/components/Button.tsx +22 -0
- package/src/components/FlatList.tsx +21 -0
- package/src/components/Image.tsx +17 -0
- package/src/components/Switch.tsx +17 -0
- package/src/components/TextInput.tsx +17 -0
- package/src/components/index.tsx +6 -0
- package/src/components/react-native-safe-area-context.native.tsx +40 -0
- package/src/components/react-native-safe-area-context.tsx +1 -0
- package/src/jest/index.ts +25 -15
- package/src/metro/index.ts +12 -7
- package/src/metro/injection-code.ts +6 -10
- package/src/metro/metro-transformer.ts +27 -10
- package/src/metro/resolver.ts +8 -0
- package/src/poison.pill.ts +10 -10
- package/src/runtime/native/api.ts +3 -1
- package/src/runtime/native/conditions/attributes.ts +52 -0
- package/src/runtime/native/conditions/container-query.ts +5 -0
- package/src/runtime/native/conditions/index.ts +7 -59
- package/src/runtime/native/conditions/media-query.ts +18 -12
- package/src/runtime/native/react/rules.ts +27 -17
- package/src/runtime/native/react/useNativeCss.ts +1 -1
- package/src/runtime/native/reactivity.ts +13 -29
- package/src/runtime/native/reanimated.ts +22 -0
- package/src/runtime/native/styles/calculate-props.ts +30 -8
- package/src/runtime/native/styles/defaults.ts +1 -0
- package/src/runtime/native/styles/functions/animation-timing.ts +44 -0
- package/src/runtime/native/styles/functions/calc.ts +121 -0
- package/src/runtime/native/styles/{filters.ts → functions/filters.ts} +3 -3
- package/src/runtime/native/styles/functions/index.ts +7 -0
- package/src/runtime/native/styles/functions/numeric-functions.ts +38 -0
- package/src/runtime/native/styles/{platform-functions.ts → functions/platform-functions.ts} +2 -2
- package/src/runtime/native/styles/functions/string-functions.ts +22 -0
- package/src/runtime/native/styles/functions/transform-functions.ts +84 -0
- package/src/runtime/native/styles/resolve.ts +20 -63
- package/src/runtime/native/styles/{shorthand.ts → shorthands/_handler.ts} +5 -5
- package/src/runtime/native/styles/{animation.ts → shorthands/animation.ts} +4 -62
- package/src/runtime/native/styles/{border.ts → shorthands/border.ts} +1 -1
- package/src/runtime/native/styles/shorthands/box-shadow.ts +74 -0
- package/src/runtime/native/styles/shorthands/index.ts +5 -0
- package/src/runtime/native/styles/{text-shadow.ts → shorthands/text-shadow.ts} +1 -1
- package/src/runtime/native/styles/{transform.ts → shorthands/transform.ts} +4 -2
- package/src/runtime/native/styles/units.ts +1 -1
- package/src/runtime/native/styles/variables.ts +5 -5
- package/src/runtime/utils/objects.ts +16 -4
- package/src/runtime/utils/specificity.ts +1 -0
- package/src/runtime/web/api.ts +1 -1
- package/src/style-collection/index.ts +142 -0
- package/src/style-collection/root.ts +35 -0
- package/dist/commonjs/compiler/attributes.test.js +0 -20
- package/dist/commonjs/compiler/attributes.test.js.map +0 -1
- package/dist/commonjs/doctor/index.js +0 -6
- package/dist/commonjs/doctor/index.js.map +0 -1
- package/dist/commonjs/runtime/native/injection.js +0 -98
- package/dist/commonjs/runtime/native/injection.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/animation.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/border.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/box-shadow.js +0 -40
- package/dist/commonjs/runtime/native/styles/box-shadow.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/calc.js +0 -85
- package/dist/commonjs/runtime/native/styles/calc.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/filters.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/platform-functions.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/shorthand.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/text-shadow.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/transform.js.map +0 -1
- package/dist/module/compiler/attributes.test.js +0 -20
- package/dist/module/compiler/attributes.test.js.map +0 -1
- package/dist/module/doctor/index.js +0 -4
- package/dist/module/doctor/index.js.map +0 -1
- package/dist/module/runtime/native/injection.js +0 -93
- package/dist/module/runtime/native/injection.js.map +0 -1
- package/dist/module/runtime/native/styles/animation.js.map +0 -1
- package/dist/module/runtime/native/styles/border.js.map +0 -1
- package/dist/module/runtime/native/styles/box-shadow.js.map +0 -1
- package/dist/module/runtime/native/styles/calc.js +0 -79
- package/dist/module/runtime/native/styles/calc.js.map +0 -1
- package/dist/module/runtime/native/styles/filters.js.map +0 -1
- package/dist/module/runtime/native/styles/platform-functions.js.map +0 -1
- package/dist/module/runtime/native/styles/shorthand.js.map +0 -1
- package/dist/module/runtime/native/styles/text-shadow.js.map +0 -1
- package/dist/module/runtime/native/styles/transform.js.map +0 -1
- package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts +0 -2
- package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/doctor/index.d.ts +0 -2
- package/dist/typescript/commonjs/src/doctor/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +0 -16
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +0 -9
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts +0 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts +0 -3
- package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts +0 -3
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +0 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +0 -1
- package/dist/typescript/module/src/compiler/attributes.test.d.ts +0 -2
- package/dist/typescript/module/src/compiler/attributes.test.d.ts.map +0 -1
- package/dist/typescript/module/src/doctor/index.d.ts +0 -2
- package/dist/typescript/module/src/doctor/index.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts +0 -16
- package/dist/typescript/module/src/runtime/native/injection.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +0 -9
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/border.d.ts +0 -2
- package/dist/typescript/module/src/runtime/native/styles/border.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts +0 -3
- package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts +0 -3
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/filters.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +0 -2
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +0 -1
- package/src/compiler/attributes.test.ts +0 -28
- package/src/doctor/index.ts +0 -1
- package/src/runtime/native/injection.ts +0 -131
- package/src/runtime/native/styles/box-shadow.ts +0 -54
- package/src/runtime/native/styles/calc.ts +0 -97
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import Color from "colorjs.io";
|
|
4
4
|
import type {
|
|
5
5
|
Angle,
|
|
6
|
-
BorderBlockColor,
|
|
7
6
|
BorderSideWidth,
|
|
8
7
|
BorderStyle,
|
|
9
8
|
ColorOrAuto,
|
|
10
9
|
CssColor,
|
|
10
|
+
CustomProperty,
|
|
11
11
|
Declaration,
|
|
12
12
|
DimensionPercentageFor_LengthValue,
|
|
13
13
|
EnvironmentVariable,
|
|
@@ -63,12 +63,16 @@ const propertyRename: Record<string, string> = {
|
|
|
63
63
|
"background-image": "experimental_backgroundImage",
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
+
// TODO: We need a better way to handle this
|
|
66
67
|
const unparsedRuntimeParsing = new Set([
|
|
67
68
|
"animation",
|
|
69
|
+
"border",
|
|
70
|
+
"box-shadow",
|
|
68
71
|
"text-shadow",
|
|
69
72
|
"transform",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
73
|
+
"scale",
|
|
74
|
+
"rotate",
|
|
75
|
+
"translate",
|
|
72
76
|
]);
|
|
73
77
|
|
|
74
78
|
const parsers: {
|
|
@@ -92,37 +96,45 @@ const parsers: {
|
|
|
92
96
|
"block-size": parseSizeDeclaration,
|
|
93
97
|
"border": parseBorder,
|
|
94
98
|
"border-block": parseBorderBlock,
|
|
95
|
-
"border-block-color":
|
|
99
|
+
"border-block-color": parseBorderColor,
|
|
96
100
|
"border-block-end": parseBorderBlockEnd,
|
|
97
101
|
"border-block-end-color": parseColorDeclaration,
|
|
98
102
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
99
103
|
"border-block-start": parseBorderBlockStart,
|
|
100
104
|
"border-block-start-color": parseColorDeclaration,
|
|
105
|
+
"border-block-start-style": parseBorderStyleDeclaration,
|
|
101
106
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
107
|
+
"border-block-style": parseBorderBlockStyle,
|
|
102
108
|
"border-block-width": parseBorderBlockWidth,
|
|
103
109
|
"border-bottom": parseBorderSide,
|
|
104
110
|
"border-bottom-color": parseColorDeclaration,
|
|
105
111
|
"border-bottom-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
106
112
|
"border-bottom-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
113
|
+
"border-bottom-style": parseBorderStyleDeclaration,
|
|
107
114
|
"border-bottom-width": parseBorderSideWidthDeclaration,
|
|
108
115
|
"border-color": parseBorderColor,
|
|
109
116
|
"border-end-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
110
117
|
"border-end-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
111
118
|
"border-inline": parseBorderInline,
|
|
112
|
-
"border-inline-color":
|
|
119
|
+
"border-inline-color": parseBorderColor,
|
|
113
120
|
"border-inline-end": parseBorderInlineEnd,
|
|
114
121
|
"border-inline-end-color": parseColorDeclaration,
|
|
122
|
+
"border-inline-end-style": parseBorderInlineStyle,
|
|
115
123
|
"border-inline-end-width": parseBorderSideWidthDeclaration,
|
|
116
124
|
"border-inline-start": parseBorderInlineStart,
|
|
117
125
|
"border-inline-start-color": parseColorDeclaration,
|
|
126
|
+
"border-inline-start-style": parseBorderInlineStyle,
|
|
118
127
|
"border-inline-start-width": parseBorderSideWidthDeclaration,
|
|
128
|
+
"border-inline-style": parseBorderInlineStyle,
|
|
119
129
|
"border-inline-width": parseBorderInlineWidth,
|
|
120
130
|
"border-left": parseBorderSide,
|
|
121
131
|
"border-left-color": parseColorDeclaration,
|
|
132
|
+
"border-left-style": parseBorderStyleDeclaration,
|
|
122
133
|
"border-left-width": parseBorderSideWidthDeclaration,
|
|
123
134
|
"border-radius": parseBorderRadius,
|
|
124
135
|
"border-right": parseBorderSide,
|
|
125
136
|
"border-right-color": parseColorDeclaration,
|
|
137
|
+
"border-right-style": parseBorderStyleDeclaration,
|
|
126
138
|
"border-right-width": parseBorderSideWidthDeclaration,
|
|
127
139
|
"border-start-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
128
140
|
"border-start-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
@@ -131,11 +143,12 @@ const parsers: {
|
|
|
131
143
|
"border-top-color": parseColorDeclaration,
|
|
132
144
|
"border-top-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
133
145
|
"border-top-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
146
|
+
"border-top-style": parseBorderStyleDeclaration,
|
|
134
147
|
"border-top-width": parseBorderSideWidthDeclaration,
|
|
135
148
|
"border-width": parseBorderWidth,
|
|
136
149
|
"bottom": parseSizeDeclaration,
|
|
137
150
|
"box-shadow": parseBoxShadow,
|
|
138
|
-
"caret-color":
|
|
151
|
+
"caret-color": parseColorOrAutoDeclaration,
|
|
139
152
|
"color": parseFontColorDeclaration,
|
|
140
153
|
"column-gap": parseGap,
|
|
141
154
|
"container": parseContainer,
|
|
@@ -227,6 +240,7 @@ const parsers: {
|
|
|
227
240
|
"translate": parseTranslate,
|
|
228
241
|
"user-select": parseUserSelect,
|
|
229
242
|
"vertical-align": parseVerticalAlign,
|
|
243
|
+
"visibility": parseVisibility,
|
|
230
244
|
"width": parseSizeDeclaration,
|
|
231
245
|
"z-index": parseZIndex,
|
|
232
246
|
};
|
|
@@ -256,9 +270,9 @@ export function parseDeclaration(
|
|
|
256
270
|
}
|
|
257
271
|
|
|
258
272
|
if (declaration.property === "unparsed") {
|
|
259
|
-
|
|
273
|
+
parseUnparsedDeclaration(declaration, builder);
|
|
260
274
|
} else if (declaration.property === "custom") {
|
|
261
|
-
|
|
275
|
+
parseCustomDeclaration(declaration, builder);
|
|
262
276
|
} else {
|
|
263
277
|
parseWithParser(declaration, builder);
|
|
264
278
|
}
|
|
@@ -344,15 +358,41 @@ function parseBorderRadius(
|
|
|
344
358
|
}
|
|
345
359
|
|
|
346
360
|
function parseBorderColor(
|
|
347
|
-
|
|
361
|
+
declaration: DeclarationType<
|
|
362
|
+
"border-color" | "border-block-color" | "border-inline-color"
|
|
363
|
+
>,
|
|
348
364
|
builder: StylesheetBuilder,
|
|
349
365
|
) {
|
|
350
|
-
|
|
351
|
-
"border-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
366
|
+
switch (declaration.property) {
|
|
367
|
+
case "border-color":
|
|
368
|
+
builder.addShorthand("border-color", {
|
|
369
|
+
"border-top-color": parseColor(declaration.value.top, builder),
|
|
370
|
+
"border-bottom-color": parseColor(declaration.value.bottom, builder),
|
|
371
|
+
"border-left-color": parseColor(declaration.value.left, builder),
|
|
372
|
+
"border-right-color": parseColor(declaration.value.right, builder),
|
|
373
|
+
});
|
|
374
|
+
break;
|
|
375
|
+
case "border-block-color":
|
|
376
|
+
builder.addDescriptor(
|
|
377
|
+
"border-top-color",
|
|
378
|
+
parseColor(declaration.value.start, builder),
|
|
379
|
+
);
|
|
380
|
+
builder.addDescriptor(
|
|
381
|
+
"border-bottom-color",
|
|
382
|
+
parseColor(declaration.value.end, builder),
|
|
383
|
+
);
|
|
384
|
+
break;
|
|
385
|
+
case "border-inline-color":
|
|
386
|
+
builder.addDescriptor(
|
|
387
|
+
"border-left-color",
|
|
388
|
+
parseColor(declaration.value.start, builder),
|
|
389
|
+
);
|
|
390
|
+
builder.addDescriptor(
|
|
391
|
+
"border-right-color",
|
|
392
|
+
parseColor(declaration.value.end, builder),
|
|
393
|
+
);
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
356
396
|
}
|
|
357
397
|
|
|
358
398
|
function parseBorderWidth(
|
|
@@ -398,18 +438,14 @@ function parseBorderBlock(
|
|
|
398
438
|
{ value }: DeclarationType<"border-block">,
|
|
399
439
|
builder: StylesheetBuilder,
|
|
400
440
|
) {
|
|
401
|
-
builder.addDescriptor("border-
|
|
402
|
-
builder.addDescriptor(
|
|
403
|
-
"border-bottom-color",
|
|
404
|
-
parseColor(value.color, builder),
|
|
405
|
-
);
|
|
441
|
+
builder.addDescriptor("border-block-color", parseColor(value.color, builder));
|
|
406
442
|
builder.addDescriptor(
|
|
407
|
-
"border-
|
|
443
|
+
"border-block-width",
|
|
408
444
|
parseBorderSideWidth(value.width, builder),
|
|
409
445
|
);
|
|
410
446
|
builder.addDescriptor(
|
|
411
|
-
"border-
|
|
412
|
-
|
|
447
|
+
"border-block-style",
|
|
448
|
+
parseBorderStyle(value.style, builder),
|
|
413
449
|
);
|
|
414
450
|
}
|
|
415
451
|
|
|
@@ -417,9 +453,12 @@ function parseBorderBlockStart(
|
|
|
417
453
|
{ value }: DeclarationType<"border-block-start">,
|
|
418
454
|
builder: StylesheetBuilder,
|
|
419
455
|
) {
|
|
420
|
-
builder.addDescriptor("border-top-color", parseColor(value.color, builder));
|
|
421
456
|
builder.addDescriptor(
|
|
422
|
-
"border-
|
|
457
|
+
"border-block-start-color",
|
|
458
|
+
parseColor(value.color, builder),
|
|
459
|
+
);
|
|
460
|
+
builder.addDescriptor(
|
|
461
|
+
"border-block-start-width",
|
|
423
462
|
parseBorderSideWidth(value.width, builder),
|
|
424
463
|
);
|
|
425
464
|
}
|
|
@@ -429,11 +468,11 @@ function parseBorderBlockEnd(
|
|
|
429
468
|
builder: StylesheetBuilder,
|
|
430
469
|
) {
|
|
431
470
|
builder.addDescriptor(
|
|
432
|
-
"border-
|
|
471
|
+
"border-block-end-color",
|
|
433
472
|
parseColor(value.color, builder),
|
|
434
473
|
);
|
|
435
474
|
builder.addDescriptor(
|
|
436
|
-
"border-
|
|
475
|
+
"border-block-end-width",
|
|
437
476
|
parseBorderSideWidth(value.width, builder),
|
|
438
477
|
);
|
|
439
478
|
}
|
|
@@ -442,38 +481,54 @@ function parseBorderInline(
|
|
|
442
481
|
{ value }: DeclarationType<"border-inline">,
|
|
443
482
|
builder: StylesheetBuilder,
|
|
444
483
|
) {
|
|
445
|
-
builder.addDescriptor("border-left-color", parseColor(value.color, builder));
|
|
446
|
-
builder.addDescriptor("border-right-color", parseColor(value.color, builder));
|
|
447
484
|
builder.addDescriptor(
|
|
448
|
-
"border-
|
|
449
|
-
|
|
485
|
+
"border-inline-color",
|
|
486
|
+
parseColor(value.color, builder),
|
|
450
487
|
);
|
|
451
488
|
builder.addDescriptor(
|
|
452
|
-
"border-
|
|
489
|
+
"border-inline-width",
|
|
453
490
|
parseBorderSideWidth(value.width, builder),
|
|
454
491
|
);
|
|
492
|
+
builder.addDescriptor(
|
|
493
|
+
"border-inline-style",
|
|
494
|
+
parseBorderStyle(value.style, builder),
|
|
495
|
+
);
|
|
455
496
|
}
|
|
456
497
|
|
|
457
498
|
function parseBorderInlineStart(
|
|
458
499
|
{ value }: DeclarationType<"border-inline-start">,
|
|
459
500
|
builder: StylesheetBuilder,
|
|
460
501
|
) {
|
|
461
|
-
builder.addDescriptor("border-left-color", parseColor(value.color, builder));
|
|
462
502
|
builder.addDescriptor(
|
|
463
|
-
"border-
|
|
503
|
+
"border-inline-start-color",
|
|
504
|
+
parseColor(value.color, builder),
|
|
505
|
+
);
|
|
506
|
+
builder.addDescriptor(
|
|
507
|
+
"border-inline-start-width",
|
|
464
508
|
parseBorderSideWidth(value.width, builder),
|
|
465
509
|
);
|
|
510
|
+
builder.addDescriptor(
|
|
511
|
+
"border-inline-start-style",
|
|
512
|
+
parseBorderStyle(value.style, builder),
|
|
513
|
+
);
|
|
466
514
|
}
|
|
467
515
|
|
|
468
516
|
function parseBorderInlineEnd(
|
|
469
517
|
{ value }: DeclarationType<"border-inline-end">,
|
|
470
518
|
builder: StylesheetBuilder,
|
|
471
519
|
) {
|
|
472
|
-
builder.addDescriptor("border-right-color", parseColor(value.color, builder));
|
|
473
520
|
builder.addDescriptor(
|
|
474
|
-
"border-
|
|
521
|
+
"border-inline-end-color",
|
|
522
|
+
parseColor(value.color, builder),
|
|
523
|
+
);
|
|
524
|
+
builder.addDescriptor(
|
|
525
|
+
"border-inline-end-width",
|
|
475
526
|
parseBorderSideWidth(value.width, builder),
|
|
476
527
|
);
|
|
528
|
+
builder.addDescriptor(
|
|
529
|
+
"border-inline-end-style",
|
|
530
|
+
parseBorderStyle(value.style, builder),
|
|
531
|
+
);
|
|
477
532
|
}
|
|
478
533
|
|
|
479
534
|
export function parseBorderInlineWidth(
|
|
@@ -481,13 +536,39 @@ export function parseBorderInlineWidth(
|
|
|
481
536
|
builder: StylesheetBuilder,
|
|
482
537
|
) {
|
|
483
538
|
builder.addDescriptor(
|
|
484
|
-
"border-
|
|
539
|
+
"border-inline-width",
|
|
485
540
|
parseBorderSideWidth(declaration.value.start, builder),
|
|
486
541
|
);
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export function parseBorderInlineStyle(
|
|
545
|
+
declaration: DeclarationType<
|
|
546
|
+
| "border-inline-style"
|
|
547
|
+
| "border-inline-start-style"
|
|
548
|
+
| "border-inline-end-style"
|
|
549
|
+
>,
|
|
550
|
+
builder: StylesheetBuilder,
|
|
551
|
+
) {
|
|
552
|
+
if (typeof declaration.value === "string") {
|
|
553
|
+
builder.addDescriptor(
|
|
554
|
+
declaration.property,
|
|
555
|
+
parseBorderStyle(declaration.value, builder),
|
|
556
|
+
);
|
|
557
|
+
} else if (declaration.value.start === declaration.value.end) {
|
|
558
|
+
builder.addDescriptor(
|
|
559
|
+
declaration.property,
|
|
560
|
+
parseBorderStyle(declaration.value.start, builder),
|
|
561
|
+
);
|
|
562
|
+
} else {
|
|
563
|
+
builder.addDescriptor(
|
|
564
|
+
"border-inline-start-style",
|
|
565
|
+
parseBorderStyle(declaration.value.start, builder),
|
|
566
|
+
);
|
|
567
|
+
builder.addDescriptor(
|
|
568
|
+
"border-inline-end-style",
|
|
569
|
+
parseBorderStyle(declaration.value.end, builder),
|
|
570
|
+
);
|
|
571
|
+
}
|
|
491
572
|
}
|
|
492
573
|
|
|
493
574
|
function parseFlexFlow(
|
|
@@ -610,22 +691,22 @@ function parseTransform(
|
|
|
610
691
|
) {
|
|
611
692
|
builder.addDescriptor("transform", [
|
|
612
693
|
{},
|
|
613
|
-
"
|
|
694
|
+
"transform",
|
|
614
695
|
value.flatMap((t): StyleDescriptor[] => {
|
|
615
696
|
switch (t.type) {
|
|
616
697
|
case "perspective":
|
|
617
|
-
return [[{}, "
|
|
698
|
+
return [[{}, "perspective", parseLength(t.value, builder)]];
|
|
618
699
|
case "translate":
|
|
619
700
|
return [
|
|
620
701
|
[
|
|
621
702
|
{},
|
|
622
|
-
"
|
|
703
|
+
"translateX",
|
|
623
704
|
parseLengthOrCoercePercentageToRuntime(t.value[0], builder),
|
|
624
705
|
],
|
|
625
706
|
[
|
|
626
707
|
[
|
|
627
708
|
{},
|
|
628
|
-
"
|
|
709
|
+
"translateY",
|
|
629
710
|
parseLengthOrCoercePercentageToRuntime(t.value[1], builder),
|
|
630
711
|
],
|
|
631
712
|
],
|
|
@@ -634,7 +715,7 @@ function parseTransform(
|
|
|
634
715
|
return [
|
|
635
716
|
[
|
|
636
717
|
{},
|
|
637
|
-
"
|
|
718
|
+
"translateX",
|
|
638
719
|
parseLengthOrCoercePercentageToRuntime(t.value, builder),
|
|
639
720
|
],
|
|
640
721
|
];
|
|
@@ -642,22 +723,22 @@ function parseTransform(
|
|
|
642
723
|
return [
|
|
643
724
|
[
|
|
644
725
|
{},
|
|
645
|
-
"
|
|
726
|
+
"translateY",
|
|
646
727
|
parseLengthOrCoercePercentageToRuntime(t.value, builder),
|
|
647
728
|
],
|
|
648
729
|
];
|
|
649
730
|
case "rotate":
|
|
650
|
-
return [[{}, "
|
|
731
|
+
return [[{}, "rotate", parseAngle(t.value, builder)]];
|
|
651
732
|
case "rotateX":
|
|
652
|
-
return [[{}, "
|
|
733
|
+
return [[{}, "rotateX", parseAngle(t.value, builder)]];
|
|
653
734
|
case "rotateY":
|
|
654
|
-
return [[{}, "
|
|
735
|
+
return [[{}, "rotateY", parseAngle(t.value, builder)]];
|
|
655
736
|
case "rotateZ":
|
|
656
|
-
return [[{}, "
|
|
737
|
+
return [[{}, "rotateZ", parseAngle(t.value, builder)]];
|
|
657
738
|
case "scale":
|
|
658
739
|
return [
|
|
659
|
-
[{}, "
|
|
660
|
-
[{}, "
|
|
740
|
+
[{}, "scaleX", parseLength(t.value[0], builder)],
|
|
741
|
+
[{}, "scaleY", parseLength(t.value[1], builder)],
|
|
661
742
|
];
|
|
662
743
|
case "scaleX":
|
|
663
744
|
return [[{}, "scaleX", parseLength(t.value, builder)]];
|
|
@@ -706,21 +787,29 @@ function parseRotate(
|
|
|
706
787
|
{ value }: DeclarationType<"rotate">,
|
|
707
788
|
builder: StylesheetBuilder,
|
|
708
789
|
) {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
790
|
+
if (value.x) {
|
|
791
|
+
builder.addDescriptor("rotateX", [
|
|
792
|
+
{},
|
|
793
|
+
"rotateX",
|
|
794
|
+
parseAngle(value.angle, builder),
|
|
795
|
+
]);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
if (value.y) {
|
|
799
|
+
builder.addDescriptor("rotateY", [
|
|
800
|
+
{},
|
|
801
|
+
"rotateY",
|
|
802
|
+
parseAngle(value.angle, builder),
|
|
803
|
+
]);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
if (value.z) {
|
|
807
|
+
builder.addDescriptor("rotateZ", [
|
|
808
|
+
{},
|
|
809
|
+
"rotateZ",
|
|
810
|
+
parseAngle(value.angle, builder),
|
|
811
|
+
]);
|
|
812
|
+
}
|
|
724
813
|
}
|
|
725
814
|
|
|
726
815
|
function parseScale(
|
|
@@ -797,7 +886,11 @@ function parseZIndex(
|
|
|
797
886
|
}
|
|
798
887
|
}
|
|
799
888
|
|
|
800
|
-
function parseContainerType(
|
|
889
|
+
function parseContainerType(
|
|
890
|
+
_declaration: DeclarationType<"container-type">,
|
|
891
|
+
builder: StylesheetBuilder,
|
|
892
|
+
) {
|
|
893
|
+
builder.addContainer(["___default___"]);
|
|
801
894
|
return;
|
|
802
895
|
}
|
|
803
896
|
|
|
@@ -817,7 +910,7 @@ function parseContainer(
|
|
|
817
910
|
return;
|
|
818
911
|
}
|
|
819
912
|
|
|
820
|
-
export function
|
|
913
|
+
export function parseUnparsedDeclaration(
|
|
821
914
|
declaration: Extract<Declaration, { property: "unparsed" }>,
|
|
822
915
|
builder: StylesheetBuilder,
|
|
823
916
|
) {
|
|
@@ -844,24 +937,15 @@ export function parseDeclarationUnparsed(
|
|
|
844
937
|
builder.descriptorProperty = property;
|
|
845
938
|
|
|
846
939
|
if (unparsedRuntimeParsing.has(property)) {
|
|
847
|
-
const args = parseUnparsed(declaration.value.value, builder);
|
|
940
|
+
const args = parseUnparsed(declaration.value.value, builder, property);
|
|
848
941
|
|
|
849
942
|
if (property === "animation") {
|
|
850
|
-
builder.addDescriptor("animation", [
|
|
851
|
-
{},
|
|
852
|
-
`@${toRNProperty(property)}`,
|
|
853
|
-
args,
|
|
854
|
-
]);
|
|
943
|
+
builder.addDescriptor("animation", [{}, property, args]);
|
|
855
944
|
} else {
|
|
856
|
-
builder.addDescriptor(property, [
|
|
857
|
-
{},
|
|
858
|
-
`@${toRNProperty(property)}`,
|
|
859
|
-
args,
|
|
860
|
-
1,
|
|
861
|
-
]);
|
|
945
|
+
builder.addDescriptor(property, [{}, toRNProperty(property), args, 1]);
|
|
862
946
|
}
|
|
863
947
|
} else {
|
|
864
|
-
const value = parseUnparsed(declaration.value.value, builder);
|
|
948
|
+
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
865
949
|
|
|
866
950
|
builder.addDescriptor(property, value);
|
|
867
951
|
|
|
@@ -875,26 +959,37 @@ export function parseDeclarationUnparsed(
|
|
|
875
959
|
}
|
|
876
960
|
}
|
|
877
961
|
|
|
878
|
-
export function
|
|
962
|
+
export function parseCustomDeclaration(
|
|
879
963
|
declaration: Extract<Declaration, { property: "custom" }>,
|
|
880
964
|
builder: StylesheetBuilder,
|
|
881
965
|
) {
|
|
882
966
|
const property = declaration.value.name;
|
|
883
|
-
|
|
967
|
+
|
|
968
|
+
if (property === "-webkit-line-clamp") {
|
|
969
|
+
builder.addDescriptor(
|
|
970
|
+
property,
|
|
971
|
+
parseUnparsed(declaration.value.value, builder, property),
|
|
972
|
+
);
|
|
973
|
+
} else if (property === "-rn-ripple-style") {
|
|
974
|
+
builder.addDescriptor(
|
|
975
|
+
property,
|
|
976
|
+
parseUnparsed(declaration.value.value, builder, property) ===
|
|
977
|
+
"borderless",
|
|
978
|
+
);
|
|
979
|
+
} else if (property === "object-fit") {
|
|
980
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1046
|
|
981
|
+
parseObjectFit(declaration.value, builder);
|
|
982
|
+
} else if (property === "object-position") {
|
|
983
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1047
|
|
984
|
+
parseObjectPosition(declaration.value, builder);
|
|
985
|
+
} else if (
|
|
884
986
|
validProperties.has(property) ||
|
|
885
987
|
property.startsWith("--") ||
|
|
886
988
|
property.startsWith("-rn-")
|
|
887
989
|
) {
|
|
888
|
-
builder.setWarningProperty(property);
|
|
889
|
-
builder.addDescriptor(
|
|
890
|
-
property,
|
|
891
|
-
parseUnparsed(declaration.value.value, builder, allowAuto.has(property)),
|
|
892
|
-
);
|
|
893
|
-
} else if (property === "-webkit-line-clamp") {
|
|
894
|
-
builder.addMapping({ [property]: ["numberOfLines"] });
|
|
895
990
|
builder.addDescriptor(
|
|
896
991
|
property,
|
|
897
|
-
parseUnparsed(declaration.value.value, builder,
|
|
992
|
+
parseUnparsed(declaration.value.value, builder, property),
|
|
898
993
|
);
|
|
899
994
|
} else {
|
|
900
995
|
builder.addWarning("property", declaration.value.name);
|
|
@@ -904,9 +999,13 @@ export function parseDeclarationCustom(
|
|
|
904
999
|
export function reduceParseUnparsed(
|
|
905
1000
|
tokenOrValues: TokenOrValue[],
|
|
906
1001
|
builder: StylesheetBuilder,
|
|
1002
|
+
property: string,
|
|
1003
|
+
allowAuto: boolean,
|
|
907
1004
|
): StyleDescriptor {
|
|
908
1005
|
const result = tokenOrValues
|
|
909
|
-
.map((tokenOrValue) =>
|
|
1006
|
+
.map((tokenOrValue) =>
|
|
1007
|
+
parseUnparsed(tokenOrValue, builder, property, allowAuto),
|
|
1008
|
+
)
|
|
910
1009
|
.filter((v) => v !== undefined);
|
|
911
1010
|
|
|
912
1011
|
if (result.length === 0) {
|
|
@@ -925,6 +1024,8 @@ export function reduceParseUnparsed(
|
|
|
925
1024
|
}
|
|
926
1025
|
}
|
|
927
1026
|
|
|
1027
|
+
// Groups are the tokens grouped together by comma location
|
|
1028
|
+
// If a group only has 1 item, it shouldn't be an array
|
|
928
1029
|
groups = groups.flatMap((group): StyleDescriptor[] => {
|
|
929
1030
|
if (!Array.isArray(group)) {
|
|
930
1031
|
return [];
|
|
@@ -940,6 +1041,17 @@ export function reduceParseUnparsed(
|
|
|
940
1041
|
} else {
|
|
941
1042
|
return [first];
|
|
942
1043
|
}
|
|
1044
|
+
} else if (
|
|
1045
|
+
// This is a special case for <ratio> values
|
|
1046
|
+
group.includes("/") &&
|
|
1047
|
+
group.every((item) =>
|
|
1048
|
+
typeof item === "string" && item === "/"
|
|
1049
|
+
? item
|
|
1050
|
+
: typeof item === "number",
|
|
1051
|
+
)
|
|
1052
|
+
) {
|
|
1053
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
1054
|
+
return [group.join(" ")];
|
|
943
1055
|
} else {
|
|
944
1056
|
return [group];
|
|
945
1057
|
}
|
|
@@ -951,11 +1063,13 @@ export function reduceParseUnparsed(
|
|
|
951
1063
|
export function unparsedFunction(
|
|
952
1064
|
token: Extract<TokenOrValue, { type: "function" }>,
|
|
953
1065
|
builder: StylesheetBuilder,
|
|
1066
|
+
property: string,
|
|
1067
|
+
allowAuto: boolean,
|
|
954
1068
|
): StyleFunction {
|
|
955
1069
|
return [
|
|
956
1070
|
{},
|
|
957
|
-
token.value.name,
|
|
958
|
-
reduceParseUnparsed(token.value.arguments, builder),
|
|
1071
|
+
toRNProperty(token.value.name),
|
|
1072
|
+
reduceParseUnparsed(token.value.arguments, builder, property, allowAuto),
|
|
959
1073
|
];
|
|
960
1074
|
}
|
|
961
1075
|
|
|
@@ -972,7 +1086,8 @@ export function parseUnparsed(
|
|
|
972
1086
|
| undefined
|
|
973
1087
|
| null,
|
|
974
1088
|
builder: StylesheetBuilder,
|
|
975
|
-
|
|
1089
|
+
property: string,
|
|
1090
|
+
allowAuto = allowAutoProperties.has(property),
|
|
976
1091
|
): StyleDescriptor {
|
|
977
1092
|
if (tokenOrValue === undefined || tokenOrValue === null) {
|
|
978
1093
|
return;
|
|
@@ -995,7 +1110,12 @@ export function parseUnparsed(
|
|
|
995
1110
|
}
|
|
996
1111
|
|
|
997
1112
|
if (Array.isArray(tokenOrValue)) {
|
|
998
|
-
const args = reduceParseUnparsed(
|
|
1113
|
+
const args = reduceParseUnparsed(
|
|
1114
|
+
tokenOrValue,
|
|
1115
|
+
builder,
|
|
1116
|
+
property,
|
|
1117
|
+
allowAuto,
|
|
1118
|
+
);
|
|
999
1119
|
if (!args) return;
|
|
1000
1120
|
if (Array.isArray(args) && args.length === 1) return args[0];
|
|
1001
1121
|
return args;
|
|
@@ -1003,11 +1123,21 @@ export function parseUnparsed(
|
|
|
1003
1123
|
|
|
1004
1124
|
switch (tokenOrValue.type) {
|
|
1005
1125
|
case "unresolved-color": {
|
|
1006
|
-
return parseUnresolvedColor(
|
|
1126
|
+
return parseUnresolvedColor(
|
|
1127
|
+
tokenOrValue.value,
|
|
1128
|
+
builder,
|
|
1129
|
+
property,
|
|
1130
|
+
allowAuto,
|
|
1131
|
+
);
|
|
1007
1132
|
}
|
|
1008
1133
|
case "var": {
|
|
1009
1134
|
let args: StyleDescriptor = tokenOrValue.value.name.ident.slice(2);
|
|
1010
|
-
const fallback = parseUnparsed(
|
|
1135
|
+
const fallback = parseUnparsed(
|
|
1136
|
+
tokenOrValue.value.fallback,
|
|
1137
|
+
builder,
|
|
1138
|
+
property,
|
|
1139
|
+
allowAuto,
|
|
1140
|
+
);
|
|
1011
1141
|
if (fallback !== undefined) {
|
|
1012
1142
|
args = [args, fallback];
|
|
1013
1143
|
}
|
|
@@ -1016,43 +1146,53 @@ export function parseUnparsed(
|
|
|
1016
1146
|
}
|
|
1017
1147
|
case "function": {
|
|
1018
1148
|
switch (tokenOrValue.value.name) {
|
|
1019
|
-
case "
|
|
1020
|
-
case "rotate":
|
|
1021
|
-
case "rotateX":
|
|
1022
|
-
case "rotateY":
|
|
1023
|
-
case "skewX":
|
|
1024
|
-
case "skewY":
|
|
1025
|
-
case "scale":
|
|
1026
|
-
case "scaleX":
|
|
1027
|
-
case "scaleY":
|
|
1028
|
-
case "translateX":
|
|
1029
|
-
case "translateY":
|
|
1030
|
-
tokenOrValue.value.name = `@${tokenOrValue.value.name}`;
|
|
1031
|
-
return unparsedFunction(tokenOrValue, builder);
|
|
1149
|
+
case "blur":
|
|
1032
1150
|
case "brightness":
|
|
1033
1151
|
case "contrast":
|
|
1034
1152
|
case "cubic-bezier":
|
|
1035
1153
|
case "drop-shadow":
|
|
1036
1154
|
case "fontScale":
|
|
1155
|
+
case "getPixelSizeForLayoutSize":
|
|
1037
1156
|
case "grayscale":
|
|
1038
1157
|
case "hsl":
|
|
1039
1158
|
case "hsla":
|
|
1040
1159
|
case "hue-rotate":
|
|
1041
1160
|
case "invert":
|
|
1042
|
-
case "linear-gradient":
|
|
1043
1161
|
case "opacity":
|
|
1044
1162
|
case "pixelScale":
|
|
1045
|
-
case "pixelSizeForLayoutSize":
|
|
1046
1163
|
case "platformColor":
|
|
1047
|
-
case "radial-gradient":
|
|
1048
1164
|
case "rgb":
|
|
1049
1165
|
case "rgba":
|
|
1166
|
+
case "rotate":
|
|
1167
|
+
case "rotateX":
|
|
1168
|
+
case "rotateY":
|
|
1050
1169
|
case "roundToNearestPixel":
|
|
1051
1170
|
case "saturate":
|
|
1171
|
+
case "scale":
|
|
1172
|
+
case "scaleX":
|
|
1173
|
+
case "scaleY":
|
|
1052
1174
|
case "sepia":
|
|
1053
1175
|
case "shadow":
|
|
1176
|
+
case "skewX":
|
|
1177
|
+
case "skewY":
|
|
1054
1178
|
case "steps":
|
|
1055
|
-
|
|
1179
|
+
case "translate":
|
|
1180
|
+
case "translateX":
|
|
1181
|
+
case "translateY":
|
|
1182
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
1183
|
+
case "linear-gradient":
|
|
1184
|
+
case "radial-gradient":
|
|
1185
|
+
// These are special as React Native requires the '-' in their name
|
|
1186
|
+
return [
|
|
1187
|
+
{},
|
|
1188
|
+
tokenOrValue.value.name,
|
|
1189
|
+
reduceParseUnparsed(
|
|
1190
|
+
tokenOrValue.value.arguments,
|
|
1191
|
+
builder,
|
|
1192
|
+
property,
|
|
1193
|
+
allowAuto,
|
|
1194
|
+
),
|
|
1195
|
+
];
|
|
1056
1196
|
case "hairlineWidth":
|
|
1057
1197
|
return [{}, tokenOrValue.value.name, []];
|
|
1058
1198
|
case "calc":
|
|
@@ -1063,6 +1203,7 @@ export function parseUnparsed(
|
|
|
1063
1203
|
tokenOrValue.value.name,
|
|
1064
1204
|
tokenOrValue.value.arguments,
|
|
1065
1205
|
builder,
|
|
1206
|
+
property,
|
|
1066
1207
|
);
|
|
1067
1208
|
default: {
|
|
1068
1209
|
builder.addWarning("value", `${tokenOrValue.value.name}()`);
|
|
@@ -1084,7 +1225,7 @@ export function parseUnparsed(
|
|
|
1084
1225
|
return;
|
|
1085
1226
|
}
|
|
1086
1227
|
|
|
1087
|
-
if (value === "inherit") {
|
|
1228
|
+
if (value === "inherit" || value === "initial") {
|
|
1088
1229
|
builder.addWarning("value", value);
|
|
1089
1230
|
return;
|
|
1090
1231
|
} else if (value === "currentcolor") {
|
|
@@ -1095,6 +1236,8 @@ export function parseUnparsed(
|
|
|
1095
1236
|
return true;
|
|
1096
1237
|
} else if (value === "false") {
|
|
1097
1238
|
return false;
|
|
1239
|
+
} else if (value === "infinity") {
|
|
1240
|
+
return Number.MAX_SAFE_INTEGER;
|
|
1098
1241
|
} else {
|
|
1099
1242
|
return value;
|
|
1100
1243
|
}
|
|
@@ -1111,11 +1254,16 @@ export function parseUnparsed(
|
|
|
1111
1254
|
return parseDimension(tokenOrValue.value, builder);
|
|
1112
1255
|
case "comma":
|
|
1113
1256
|
return CommaSeparator as unknown as StyleDescriptor;
|
|
1257
|
+
case "delim": {
|
|
1258
|
+
if (tokenOrValue.value.value === "/") {
|
|
1259
|
+
return tokenOrValue.value.value;
|
|
1260
|
+
}
|
|
1261
|
+
return;
|
|
1262
|
+
}
|
|
1114
1263
|
case "at-keyword":
|
|
1115
1264
|
case "hash":
|
|
1116
1265
|
case "id-hash":
|
|
1117
1266
|
case "unquoted-url":
|
|
1118
|
-
case "delim":
|
|
1119
1267
|
case "white-space":
|
|
1120
1268
|
case "comment":
|
|
1121
1269
|
case "colon":
|
|
@@ -1197,7 +1345,12 @@ export function parseLength(
|
|
|
1197
1345
|
} else if (length.value === -Infinity) {
|
|
1198
1346
|
return -9999;
|
|
1199
1347
|
} else {
|
|
1200
|
-
|
|
1348
|
+
// Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
|
|
1349
|
+
const value = Math.max(
|
|
1350
|
+
Math.min(length.value, Number.MAX_SAFE_INTEGER),
|
|
1351
|
+
Number.MIN_SAFE_INTEGER,
|
|
1352
|
+
);
|
|
1353
|
+
return round(value);
|
|
1201
1354
|
}
|
|
1202
1355
|
}
|
|
1203
1356
|
case "rem":
|
|
@@ -1375,7 +1528,7 @@ export function parseSize(
|
|
|
1375
1528
|
return;
|
|
1376
1529
|
}
|
|
1377
1530
|
|
|
1378
|
-
export function
|
|
1531
|
+
export function parseColorOrAutoDeclaration(
|
|
1379
1532
|
{ value }: { value: ColorOrAuto },
|
|
1380
1533
|
builder: StylesheetBuilder,
|
|
1381
1534
|
) {
|
|
@@ -1877,7 +2030,10 @@ export function parseOverflow(
|
|
|
1877
2030
|
}
|
|
1878
2031
|
|
|
1879
2032
|
export function parseBorderStyleDeclaration(
|
|
1880
|
-
declaration:
|
|
2033
|
+
declaration: Extract<
|
|
2034
|
+
DeclarationType<Declaration["property"]>,
|
|
2035
|
+
{ value: LineStyle | BorderStyle }
|
|
2036
|
+
>,
|
|
1881
2037
|
builder: StylesheetBuilder,
|
|
1882
2038
|
) {
|
|
1883
2039
|
return parseBorderStyle(declaration.value, builder);
|
|
@@ -1910,34 +2066,53 @@ export function parseBorderStyle(
|
|
|
1910
2066
|
return undefined;
|
|
1911
2067
|
}
|
|
1912
2068
|
|
|
1913
|
-
export function
|
|
1914
|
-
|
|
2069
|
+
export function parseBorderBlockWidth(
|
|
2070
|
+
declaration: DeclarationType<"border-block-width">,
|
|
1915
2071
|
builder: StylesheetBuilder,
|
|
1916
2072
|
) {
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
2073
|
+
const start = parseBorderSideWidth(declaration.value.start, builder);
|
|
2074
|
+
const end = parseBorderSideWidth(declaration.value.end, builder);
|
|
2075
|
+
|
|
2076
|
+
if (start === end) {
|
|
2077
|
+
builder.addDescriptor("border-block-width", start);
|
|
2078
|
+
} else {
|
|
2079
|
+
builder.addDescriptor("border-block-start-width", start);
|
|
2080
|
+
builder.addDescriptor("border-block-end-width", end);
|
|
2081
|
+
}
|
|
1920
2082
|
}
|
|
1921
2083
|
|
|
1922
|
-
|
|
1923
|
-
declaration: DeclarationType<"border-block-
|
|
2084
|
+
function parseBorderBlockStyle(
|
|
2085
|
+
declaration: DeclarationType<"border-block-style">,
|
|
1924
2086
|
builder: StylesheetBuilder,
|
|
1925
2087
|
) {
|
|
1926
|
-
builder
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
)
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
2088
|
+
const start = parseBorderStyle(declaration.value.start, builder);
|
|
2089
|
+
const end = parseBorderStyle(declaration.value.end, builder);
|
|
2090
|
+
|
|
2091
|
+
if (start == end) {
|
|
2092
|
+
builder.addDescriptor("border-block-style", start);
|
|
2093
|
+
} else {
|
|
2094
|
+
builder.addDescriptor("border-block-start-style", start);
|
|
2095
|
+
builder.addDescriptor("border-block-end-style", end);
|
|
2096
|
+
}
|
|
1934
2097
|
}
|
|
1935
2098
|
|
|
1936
2099
|
export function parseBorderSideWidthDeclaration(
|
|
1937
|
-
declaration:
|
|
2100
|
+
declaration: DeclarationType<
|
|
2101
|
+
| "border-block-end-width"
|
|
2102
|
+
| "border-block-start-width"
|
|
2103
|
+
| "border-bottom-width"
|
|
2104
|
+
| "border-inline-end-width"
|
|
2105
|
+
| "border-inline-start-width"
|
|
2106
|
+
| "border-left-width"
|
|
2107
|
+
| "border-right-width"
|
|
2108
|
+
| "border-top-width"
|
|
2109
|
+
>,
|
|
1938
2110
|
builder: StylesheetBuilder,
|
|
1939
2111
|
) {
|
|
1940
|
-
|
|
2112
|
+
builder.addDescriptor(
|
|
2113
|
+
declaration.property,
|
|
2114
|
+
parseBorderSideWidth(declaration.value, builder),
|
|
2115
|
+
);
|
|
1941
2116
|
}
|
|
1942
2117
|
|
|
1943
2118
|
export function parseBorderSideWidth(
|
|
@@ -2295,16 +2470,20 @@ export function parseUserSelect(
|
|
|
2295
2470
|
}
|
|
2296
2471
|
|
|
2297
2472
|
export function parseSVGPaint(
|
|
2298
|
-
{ value }: DeclarationType<"fill" | "stroke">,
|
|
2473
|
+
{ value, property }: DeclarationType<"fill" | "stroke">,
|
|
2299
2474
|
builder: StylesheetBuilder,
|
|
2300
2475
|
) {
|
|
2476
|
+
let parsedValue: StyleDescriptor | undefined;
|
|
2477
|
+
|
|
2301
2478
|
if (value.type === "none") {
|
|
2302
|
-
|
|
2479
|
+
parsedValue = "transparent";
|
|
2303
2480
|
} else if (value.type === "color") {
|
|
2304
|
-
|
|
2481
|
+
parsedValue = parseColor(value.value, builder);
|
|
2482
|
+
} else {
|
|
2483
|
+
return;
|
|
2305
2484
|
}
|
|
2306
2485
|
|
|
2307
|
-
|
|
2486
|
+
builder.addDescriptor(property, parsedValue);
|
|
2308
2487
|
}
|
|
2309
2488
|
|
|
2310
2489
|
export function round(number: number) {
|
|
@@ -2324,7 +2503,7 @@ export function parseDimensionPercentageFor_LengthValue(
|
|
|
2324
2503
|
}
|
|
2325
2504
|
}
|
|
2326
2505
|
|
|
2327
|
-
const
|
|
2506
|
+
const allowAutoProperties = new Set(["pointer-events"]);
|
|
2328
2507
|
|
|
2329
2508
|
export function parseEnv(
|
|
2330
2509
|
value: EnvironmentVariable,
|
|
@@ -2342,7 +2521,7 @@ export function parseEnv(
|
|
|
2342
2521
|
"var",
|
|
2343
2522
|
[
|
|
2344
2523
|
`--react-native-css-${value.name.value}`,
|
|
2345
|
-
parseUnparsed(value.fallback, builder),
|
|
2524
|
+
parseUnparsed(value.fallback, builder, value.name.value),
|
|
2346
2525
|
],
|
|
2347
2526
|
1,
|
|
2348
2527
|
];
|
|
@@ -2365,8 +2544,9 @@ export function parseCalcFn(
|
|
|
2365
2544
|
name: string,
|
|
2366
2545
|
tokens: TokenOrValue[],
|
|
2367
2546
|
builder: StylesheetBuilder,
|
|
2547
|
+
property: string,
|
|
2368
2548
|
): StyleDescriptor {
|
|
2369
|
-
const args = parseCalcArguments(tokens, builder);
|
|
2549
|
+
const args = parseCalcArguments(tokens, builder, property);
|
|
2370
2550
|
if (args) {
|
|
2371
2551
|
return [{}, name, args];
|
|
2372
2552
|
}
|
|
@@ -2377,12 +2557,11 @@ export function parseCalcFn(
|
|
|
2377
2557
|
export function parseCalcArguments(
|
|
2378
2558
|
[...args]: TokenOrValue[],
|
|
2379
2559
|
builder: StylesheetBuilder,
|
|
2560
|
+
property: string,
|
|
2380
2561
|
) {
|
|
2381
2562
|
const parsed: StyleDescriptor[] = [];
|
|
2382
2563
|
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
for (const [currentIndex, arg] of args.entries()) {
|
|
2564
|
+
for (const arg of args) {
|
|
2386
2565
|
switch (arg.type) {
|
|
2387
2566
|
case "env": {
|
|
2388
2567
|
parsed.push(parseEnv(arg.value, builder));
|
|
@@ -2391,7 +2570,7 @@ export function parseCalcArguments(
|
|
|
2391
2570
|
case "var":
|
|
2392
2571
|
case "function":
|
|
2393
2572
|
case "unresolved-color": {
|
|
2394
|
-
const value = parseUnparsed(arg, builder);
|
|
2573
|
+
const value = parseUnparsed(arg, builder, property);
|
|
2395
2574
|
|
|
2396
2575
|
if (value === undefined) {
|
|
2397
2576
|
return undefined;
|
|
@@ -2402,11 +2581,9 @@ export function parseCalcArguments(
|
|
|
2402
2581
|
}
|
|
2403
2582
|
case "length": {
|
|
2404
2583
|
const value = parseLength(arg.value, builder);
|
|
2405
|
-
|
|
2406
2584
|
if (value !== undefined) {
|
|
2407
2585
|
parsed.push(value);
|
|
2408
2586
|
}
|
|
2409
|
-
|
|
2410
2587
|
break;
|
|
2411
2588
|
}
|
|
2412
2589
|
case "color":
|
|
@@ -2429,49 +2606,19 @@ export function parseCalcArguments(
|
|
|
2429
2606
|
}
|
|
2430
2607
|
break;
|
|
2431
2608
|
case "percentage":
|
|
2432
|
-
|
|
2433
|
-
if (mode !== "percentage") return;
|
|
2434
|
-
parsed.push(`${arg.value.value * 100}%`);
|
|
2609
|
+
parsed.push(`${round(arg.value.value * 100)}%`);
|
|
2435
2610
|
break;
|
|
2436
2611
|
case "number": {
|
|
2437
|
-
|
|
2438
|
-
if (mode !== "number") return;
|
|
2439
|
-
parsed.push(arg.value.value);
|
|
2612
|
+
parsed.push(round(arg.value.value));
|
|
2440
2613
|
break;
|
|
2441
2614
|
}
|
|
2442
2615
|
case "parenthesis-block": {
|
|
2443
|
-
|
|
2444
|
-
* If we have a parenthesis block, we just treat it as a nested calc function
|
|
2445
|
-
* Because there could be multiple parenthesis blocks, this is recursive
|
|
2446
|
-
*/
|
|
2447
|
-
let closeParenthesisIndex = -1;
|
|
2448
|
-
for (let index = args.length - 1; index > 0; index--) {
|
|
2449
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2450
|
-
const value = args[index]!;
|
|
2451
|
-
if (
|
|
2452
|
-
value.type === "token" &&
|
|
2453
|
-
value.value.type === "close-parenthesis"
|
|
2454
|
-
) {
|
|
2455
|
-
closeParenthesisIndex = index;
|
|
2456
|
-
break;
|
|
2457
|
-
}
|
|
2458
|
-
}
|
|
2459
|
-
|
|
2460
|
-
if (closeParenthesisIndex === -1) {
|
|
2461
|
-
return;
|
|
2462
|
-
}
|
|
2463
|
-
|
|
2464
|
-
const innerCalcArgs = args
|
|
2465
|
-
// Extract the inner calcArgs including the parenthesis. This mutates args
|
|
2466
|
-
.splice(currentIndex, closeParenthesisIndex - currentIndex + 1)
|
|
2467
|
-
// Then drop the surrounding parenthesis
|
|
2468
|
-
.slice(1, -1);
|
|
2469
|
-
|
|
2470
|
-
parsed.push(parseCalcFn("calc", innerCalcArgs, builder));
|
|
2471
|
-
|
|
2616
|
+
parsed.push("(");
|
|
2472
2617
|
break;
|
|
2473
2618
|
}
|
|
2474
2619
|
case "close-parenthesis":
|
|
2620
|
+
parsed.push(")");
|
|
2621
|
+
break;
|
|
2475
2622
|
case "string":
|
|
2476
2623
|
case "function":
|
|
2477
2624
|
case "ident":
|
|
@@ -2520,6 +2667,8 @@ export function parseTranslateProp(
|
|
|
2520
2667
|
export function parseUnresolvedColor(
|
|
2521
2668
|
color: UnresolvedColor,
|
|
2522
2669
|
builder: StylesheetBuilder,
|
|
2670
|
+
property: string,
|
|
2671
|
+
allowAuto: boolean,
|
|
2523
2672
|
): StyleDescriptor {
|
|
2524
2673
|
switch (color.type) {
|
|
2525
2674
|
case "rgb":
|
|
@@ -2530,26 +2679,31 @@ export function parseUnresolvedColor(
|
|
|
2530
2679
|
round(color.r * 255),
|
|
2531
2680
|
round(color.g * 255),
|
|
2532
2681
|
round(color.b * 255),
|
|
2533
|
-
parseUnparsed(color.alpha, builder),
|
|
2682
|
+
parseUnparsed(color.alpha, builder, property),
|
|
2534
2683
|
],
|
|
2535
2684
|
];
|
|
2536
2685
|
case "hsl":
|
|
2537
2686
|
return [
|
|
2538
2687
|
{},
|
|
2539
2688
|
color.type,
|
|
2540
|
-
[
|
|
2689
|
+
[
|
|
2690
|
+
color.h,
|
|
2691
|
+
color.s,
|
|
2692
|
+
color.l,
|
|
2693
|
+
parseUnparsed(color.alpha, builder, property),
|
|
2694
|
+
],
|
|
2541
2695
|
];
|
|
2542
2696
|
case "light-dark": {
|
|
2543
2697
|
const extraRule = builder.extendRule({
|
|
2544
2698
|
m: [["=", "prefers-color-scheme", "dark"]],
|
|
2545
2699
|
});
|
|
2546
2700
|
builder.addUnnamedDescriptor(
|
|
2547
|
-
reduceParseUnparsed(color.dark, builder),
|
|
2701
|
+
reduceParseUnparsed(color.dark, builder, property, allowAuto),
|
|
2548
2702
|
false,
|
|
2549
2703
|
extraRule,
|
|
2550
2704
|
);
|
|
2551
2705
|
builder.addExtraRule(extraRule);
|
|
2552
|
-
return reduceParseUnparsed(color.light, builder);
|
|
2706
|
+
return reduceParseUnparsed(color.light, builder, property, allowAuto);
|
|
2553
2707
|
}
|
|
2554
2708
|
default:
|
|
2555
2709
|
color satisfies never;
|
|
@@ -2646,7 +2800,12 @@ export function addTransitionValue(
|
|
|
2646
2800
|
declaration.property,
|
|
2647
2801
|
declaration.value
|
|
2648
2802
|
.map((v) => v.property)
|
|
2649
|
-
.filter(
|
|
2803
|
+
.filter(
|
|
2804
|
+
(v) =>
|
|
2805
|
+
(v in parsers && !["visibility"].includes(v)) ||
|
|
2806
|
+
v === "all" ||
|
|
2807
|
+
v === "none",
|
|
2808
|
+
)
|
|
2650
2809
|
.map((v) => toRNProperty(v)),
|
|
2651
2810
|
);
|
|
2652
2811
|
return;
|
|
@@ -2795,7 +2954,7 @@ function parseGradient(
|
|
|
2795
2954
|
case "linear": {
|
|
2796
2955
|
return [
|
|
2797
2956
|
{},
|
|
2798
|
-
"
|
|
2957
|
+
"linear-gradient",
|
|
2799
2958
|
[
|
|
2800
2959
|
parseLineDirection(gradient.direction, builder),
|
|
2801
2960
|
...gradient.items.map((item) => parseGradientItem(item, builder)),
|
|
@@ -2845,6 +3004,46 @@ function parseGradientItem(
|
|
|
2845
3004
|
}
|
|
2846
3005
|
}
|
|
2847
3006
|
|
|
3007
|
+
function parseObjectFit(
|
|
3008
|
+
declaration: CustomProperty,
|
|
3009
|
+
builder: StylesheetBuilder,
|
|
3010
|
+
) {
|
|
3011
|
+
builder.addMapping({
|
|
3012
|
+
"object-fit": "contentFit",
|
|
3013
|
+
});
|
|
3014
|
+
builder.addDescriptor(
|
|
3015
|
+
"object-fit",
|
|
3016
|
+
parseUnparsed(declaration.value, builder, "object-fit"),
|
|
3017
|
+
);
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
function parseObjectPosition(
|
|
3021
|
+
declaration: CustomProperty,
|
|
3022
|
+
builder: StylesheetBuilder,
|
|
3023
|
+
) {
|
|
3024
|
+
builder.addMapping({
|
|
3025
|
+
"object-position": "contentPosition",
|
|
3026
|
+
});
|
|
3027
|
+
builder.addDescriptor("object-position", [
|
|
3028
|
+
{},
|
|
3029
|
+
"join",
|
|
3030
|
+
[parseUnparsed(declaration.value, builder, "object-position"), " "],
|
|
3031
|
+
]);
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
function parseVisibility(
|
|
3035
|
+
declaration: DeclarationType<"visibility">,
|
|
3036
|
+
builder: StylesheetBuilder,
|
|
3037
|
+
) {
|
|
3038
|
+
if (declaration.value === "visible") {
|
|
3039
|
+
builder.addDescriptor("opacity", 1);
|
|
3040
|
+
} else if (declaration.value === "hidden") {
|
|
3041
|
+
builder.addDescriptor("opacity", 0);
|
|
3042
|
+
} else {
|
|
3043
|
+
builder.addWarning("value", declaration.value);
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
|
|
2848
3047
|
function parseFilter(
|
|
2849
3048
|
declaration: DeclarationType<"filter">,
|
|
2850
3049
|
builder: StylesheetBuilder,
|
|
@@ -2872,6 +3071,16 @@ function parseFilter(
|
|
|
2872
3071
|
[value.type]: parseAngle(value.value, builder),
|
|
2873
3072
|
} as unknown as StyleDescriptor;
|
|
2874
3073
|
case "drop-shadow":
|
|
3074
|
+
return [
|
|
3075
|
+
{},
|
|
3076
|
+
toRNProperty(value.type),
|
|
3077
|
+
[
|
|
3078
|
+
parseLength(value.value.xOffset, builder),
|
|
3079
|
+
parseLength(value.value.yOffset, builder),
|
|
3080
|
+
parseLength(value.value.blur, builder),
|
|
3081
|
+
parseColor(value.value.color, builder),
|
|
3082
|
+
],
|
|
3083
|
+
] as unknown as StyleDescriptor;
|
|
2875
3084
|
case "url":
|
|
2876
3085
|
return;
|
|
2877
3086
|
}
|