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
|
@@ -9,7 +9,9 @@ const CommaSeparator = Symbol("CommaSeparator");
|
|
|
9
9
|
const propertyRename = {
|
|
10
10
|
"background-image": "experimental_backgroundImage"
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
// TODO: We need a better way to handle this
|
|
14
|
+
const unparsedRuntimeParsing = new Set(["animation", "border", "box-shadow", "text-shadow", "transform", "scale", "rotate", "translate"]);
|
|
13
15
|
const parsers = {
|
|
14
16
|
"align-content": parseAlignContent,
|
|
15
17
|
"align-items": parseAlignItems,
|
|
@@ -29,37 +31,45 @@ const parsers = {
|
|
|
29
31
|
"block-size": parseSizeDeclaration,
|
|
30
32
|
"border": parseBorder,
|
|
31
33
|
"border-block": parseBorderBlock,
|
|
32
|
-
"border-block-color":
|
|
34
|
+
"border-block-color": parseBorderColor,
|
|
33
35
|
"border-block-end": parseBorderBlockEnd,
|
|
34
36
|
"border-block-end-color": parseColorDeclaration,
|
|
35
37
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
36
38
|
"border-block-start": parseBorderBlockStart,
|
|
37
39
|
"border-block-start-color": parseColorDeclaration,
|
|
40
|
+
"border-block-start-style": parseBorderStyleDeclaration,
|
|
38
41
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
42
|
+
"border-block-style": parseBorderBlockStyle,
|
|
39
43
|
"border-block-width": parseBorderBlockWidth,
|
|
40
44
|
"border-bottom": parseBorderSide,
|
|
41
45
|
"border-bottom-color": parseColorDeclaration,
|
|
42
46
|
"border-bottom-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
43
47
|
"border-bottom-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
48
|
+
"border-bottom-style": parseBorderStyleDeclaration,
|
|
44
49
|
"border-bottom-width": parseBorderSideWidthDeclaration,
|
|
45
50
|
"border-color": parseBorderColor,
|
|
46
51
|
"border-end-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
47
52
|
"border-end-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
48
53
|
"border-inline": parseBorderInline,
|
|
49
|
-
"border-inline-color":
|
|
54
|
+
"border-inline-color": parseBorderColor,
|
|
50
55
|
"border-inline-end": parseBorderInlineEnd,
|
|
51
56
|
"border-inline-end-color": parseColorDeclaration,
|
|
57
|
+
"border-inline-end-style": parseBorderInlineStyle,
|
|
52
58
|
"border-inline-end-width": parseBorderSideWidthDeclaration,
|
|
53
59
|
"border-inline-start": parseBorderInlineStart,
|
|
54
60
|
"border-inline-start-color": parseColorDeclaration,
|
|
61
|
+
"border-inline-start-style": parseBorderInlineStyle,
|
|
55
62
|
"border-inline-start-width": parseBorderSideWidthDeclaration,
|
|
63
|
+
"border-inline-style": parseBorderInlineStyle,
|
|
56
64
|
"border-inline-width": parseBorderInlineWidth,
|
|
57
65
|
"border-left": parseBorderSide,
|
|
58
66
|
"border-left-color": parseColorDeclaration,
|
|
67
|
+
"border-left-style": parseBorderStyleDeclaration,
|
|
59
68
|
"border-left-width": parseBorderSideWidthDeclaration,
|
|
60
69
|
"border-radius": parseBorderRadius,
|
|
61
70
|
"border-right": parseBorderSide,
|
|
62
71
|
"border-right-color": parseColorDeclaration,
|
|
72
|
+
"border-right-style": parseBorderStyleDeclaration,
|
|
63
73
|
"border-right-width": parseBorderSideWidthDeclaration,
|
|
64
74
|
"border-start-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
65
75
|
"border-start-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
@@ -68,11 +78,12 @@ const parsers = {
|
|
|
68
78
|
"border-top-color": parseColorDeclaration,
|
|
69
79
|
"border-top-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
70
80
|
"border-top-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
81
|
+
"border-top-style": parseBorderStyleDeclaration,
|
|
71
82
|
"border-top-width": parseBorderSideWidthDeclaration,
|
|
72
83
|
"border-width": parseBorderWidth,
|
|
73
84
|
"bottom": parseSizeDeclaration,
|
|
74
85
|
"box-shadow": parseBoxShadow,
|
|
75
|
-
"caret-color":
|
|
86
|
+
"caret-color": parseColorOrAutoDeclaration,
|
|
76
87
|
"color": parseFontColorDeclaration,
|
|
77
88
|
"column-gap": parseGap,
|
|
78
89
|
"container": parseContainer,
|
|
@@ -176,6 +187,7 @@ const parsers = {
|
|
|
176
187
|
"translate": parseTranslate,
|
|
177
188
|
"user-select": parseUserSelect,
|
|
178
189
|
"vertical-align": parseVerticalAlign,
|
|
190
|
+
"visibility": parseVisibility,
|
|
179
191
|
"width": parseSizeDeclaration,
|
|
180
192
|
"z-index": parseZIndex
|
|
181
193
|
};
|
|
@@ -191,9 +203,9 @@ export function parseDeclaration(declaration, builder) {
|
|
|
191
203
|
return;
|
|
192
204
|
}
|
|
193
205
|
if (declaration.property === "unparsed") {
|
|
194
|
-
|
|
206
|
+
parseUnparsedDeclaration(declaration, builder);
|
|
195
207
|
} else if (declaration.property === "custom") {
|
|
196
|
-
|
|
208
|
+
parseCustomDeclaration(declaration, builder);
|
|
197
209
|
} else {
|
|
198
210
|
parseWithParser(declaration, builder);
|
|
199
211
|
}
|
|
@@ -247,15 +259,25 @@ function parseBorderRadius({
|
|
|
247
259
|
"border-top-right-radius": parseSize2DDimensionPercentage(value.topRight, builder)
|
|
248
260
|
});
|
|
249
261
|
}
|
|
250
|
-
function parseBorderColor({
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
262
|
+
function parseBorderColor(declaration, builder) {
|
|
263
|
+
switch (declaration.property) {
|
|
264
|
+
case "border-color":
|
|
265
|
+
builder.addShorthand("border-color", {
|
|
266
|
+
"border-top-color": parseColor(declaration.value.top, builder),
|
|
267
|
+
"border-bottom-color": parseColor(declaration.value.bottom, builder),
|
|
268
|
+
"border-left-color": parseColor(declaration.value.left, builder),
|
|
269
|
+
"border-right-color": parseColor(declaration.value.right, builder)
|
|
270
|
+
});
|
|
271
|
+
break;
|
|
272
|
+
case "border-block-color":
|
|
273
|
+
builder.addDescriptor("border-top-color", parseColor(declaration.value.start, builder));
|
|
274
|
+
builder.addDescriptor("border-bottom-color", parseColor(declaration.value.end, builder));
|
|
275
|
+
break;
|
|
276
|
+
case "border-inline-color":
|
|
277
|
+
builder.addDescriptor("border-left-color", parseColor(declaration.value.start, builder));
|
|
278
|
+
builder.addDescriptor("border-right-color", parseColor(declaration.value.end, builder));
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
259
281
|
}
|
|
260
282
|
function parseBorderWidth({
|
|
261
283
|
value
|
|
@@ -286,46 +308,55 @@ function parseBorderSide({
|
|
|
286
308
|
function parseBorderBlock({
|
|
287
309
|
value
|
|
288
310
|
}, builder) {
|
|
289
|
-
builder.addDescriptor("border-
|
|
290
|
-
builder.addDescriptor("border-
|
|
291
|
-
builder.addDescriptor("border-
|
|
292
|
-
builder.addDescriptor("border-bottom-width", parseBorderSideWidth(value.width, builder));
|
|
311
|
+
builder.addDescriptor("border-block-color", parseColor(value.color, builder));
|
|
312
|
+
builder.addDescriptor("border-block-width", parseBorderSideWidth(value.width, builder));
|
|
313
|
+
builder.addDescriptor("border-block-style", parseBorderStyle(value.style, builder));
|
|
293
314
|
}
|
|
294
315
|
function parseBorderBlockStart({
|
|
295
316
|
value
|
|
296
317
|
}, builder) {
|
|
297
|
-
builder.addDescriptor("border-
|
|
298
|
-
builder.addDescriptor("border-
|
|
318
|
+
builder.addDescriptor("border-block-start-color", parseColor(value.color, builder));
|
|
319
|
+
builder.addDescriptor("border-block-start-width", parseBorderSideWidth(value.width, builder));
|
|
299
320
|
}
|
|
300
321
|
function parseBorderBlockEnd({
|
|
301
322
|
value
|
|
302
323
|
}, builder) {
|
|
303
|
-
builder.addDescriptor("border-
|
|
304
|
-
builder.addDescriptor("border-
|
|
324
|
+
builder.addDescriptor("border-block-end-color", parseColor(value.color, builder));
|
|
325
|
+
builder.addDescriptor("border-block-end-width", parseBorderSideWidth(value.width, builder));
|
|
305
326
|
}
|
|
306
327
|
function parseBorderInline({
|
|
307
328
|
value
|
|
308
329
|
}, builder) {
|
|
309
|
-
builder.addDescriptor("border-
|
|
310
|
-
builder.addDescriptor("border-
|
|
311
|
-
builder.addDescriptor("border-
|
|
312
|
-
builder.addDescriptor("border-right-width", parseBorderSideWidth(value.width, builder));
|
|
330
|
+
builder.addDescriptor("border-inline-color", parseColor(value.color, builder));
|
|
331
|
+
builder.addDescriptor("border-inline-width", parseBorderSideWidth(value.width, builder));
|
|
332
|
+
builder.addDescriptor("border-inline-style", parseBorderStyle(value.style, builder));
|
|
313
333
|
}
|
|
314
334
|
function parseBorderInlineStart({
|
|
315
335
|
value
|
|
316
336
|
}, builder) {
|
|
317
|
-
builder.addDescriptor("border-
|
|
318
|
-
builder.addDescriptor("border-
|
|
337
|
+
builder.addDescriptor("border-inline-start-color", parseColor(value.color, builder));
|
|
338
|
+
builder.addDescriptor("border-inline-start-width", parseBorderSideWidth(value.width, builder));
|
|
339
|
+
builder.addDescriptor("border-inline-start-style", parseBorderStyle(value.style, builder));
|
|
319
340
|
}
|
|
320
341
|
function parseBorderInlineEnd({
|
|
321
342
|
value
|
|
322
343
|
}, builder) {
|
|
323
|
-
builder.addDescriptor("border-
|
|
324
|
-
builder.addDescriptor("border-
|
|
344
|
+
builder.addDescriptor("border-inline-end-color", parseColor(value.color, builder));
|
|
345
|
+
builder.addDescriptor("border-inline-end-width", parseBorderSideWidth(value.width, builder));
|
|
346
|
+
builder.addDescriptor("border-inline-end-style", parseBorderStyle(value.style, builder));
|
|
325
347
|
}
|
|
326
348
|
export function parseBorderInlineWidth(declaration, builder) {
|
|
327
|
-
builder.addDescriptor("border-
|
|
328
|
-
|
|
349
|
+
builder.addDescriptor("border-inline-width", parseBorderSideWidth(declaration.value.start, builder));
|
|
350
|
+
}
|
|
351
|
+
export function parseBorderInlineStyle(declaration, builder) {
|
|
352
|
+
if (typeof declaration.value === "string") {
|
|
353
|
+
builder.addDescriptor(declaration.property, parseBorderStyle(declaration.value, builder));
|
|
354
|
+
} else if (declaration.value.start === declaration.value.end) {
|
|
355
|
+
builder.addDescriptor(declaration.property, parseBorderStyle(declaration.value.start, builder));
|
|
356
|
+
} else {
|
|
357
|
+
builder.addDescriptor("border-inline-start-style", parseBorderStyle(declaration.value.start, builder));
|
|
358
|
+
builder.addDescriptor("border-inline-end-style", parseBorderStyle(declaration.value.end, builder));
|
|
359
|
+
}
|
|
329
360
|
}
|
|
330
361
|
function parseFlexFlow({
|
|
331
362
|
value
|
|
@@ -413,26 +444,26 @@ function parseFont({
|
|
|
413
444
|
function parseTransform({
|
|
414
445
|
value
|
|
415
446
|
}, builder) {
|
|
416
|
-
builder.addDescriptor("transform", [{}, "
|
|
447
|
+
builder.addDescriptor("transform", [{}, "transform", value.flatMap(t => {
|
|
417
448
|
switch (t.type) {
|
|
418
449
|
case "perspective":
|
|
419
|
-
return [[{}, "
|
|
450
|
+
return [[{}, "perspective", parseLength(t.value, builder)]];
|
|
420
451
|
case "translate":
|
|
421
|
-
return [[{}, "
|
|
452
|
+
return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value[0], builder)], [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value[1], builder)]]];
|
|
422
453
|
case "translateX":
|
|
423
|
-
return [[{}, "
|
|
454
|
+
return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
|
|
424
455
|
case "translateY":
|
|
425
|
-
return [[{}, "
|
|
456
|
+
return [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
|
|
426
457
|
case "rotate":
|
|
427
|
-
return [[{}, "
|
|
458
|
+
return [[{}, "rotate", parseAngle(t.value, builder)]];
|
|
428
459
|
case "rotateX":
|
|
429
|
-
return [[{}, "
|
|
460
|
+
return [[{}, "rotateX", parseAngle(t.value, builder)]];
|
|
430
461
|
case "rotateY":
|
|
431
|
-
return [[{}, "
|
|
462
|
+
return [[{}, "rotateY", parseAngle(t.value, builder)]];
|
|
432
463
|
case "rotateZ":
|
|
433
|
-
return [[{}, "
|
|
464
|
+
return [[{}, "rotateZ", parseAngle(t.value, builder)]];
|
|
434
465
|
case "scale":
|
|
435
|
-
return [[{}, "
|
|
466
|
+
return [[{}, "scaleX", parseLength(t.value[0], builder)], [{}, "scaleY", parseLength(t.value[1], builder)]];
|
|
436
467
|
case "scaleX":
|
|
437
468
|
return [[{}, "scaleX", parseLength(t.value, builder)]];
|
|
438
469
|
case "scaleY":
|
|
@@ -464,9 +495,15 @@ function parseTranslate({
|
|
|
464
495
|
function parseRotate({
|
|
465
496
|
value
|
|
466
497
|
}, builder) {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
498
|
+
if (value.x) {
|
|
499
|
+
builder.addDescriptor("rotateX", [{}, "rotateX", parseAngle(value.angle, builder)]);
|
|
500
|
+
}
|
|
501
|
+
if (value.y) {
|
|
502
|
+
builder.addDescriptor("rotateY", [{}, "rotateY", parseAngle(value.angle, builder)]);
|
|
503
|
+
}
|
|
504
|
+
if (value.z) {
|
|
505
|
+
builder.addDescriptor("rotateZ", [{}, "rotateZ", parseAngle(value.angle, builder)]);
|
|
506
|
+
}
|
|
470
507
|
}
|
|
471
508
|
function parseScale({
|
|
472
509
|
value
|
|
@@ -508,7 +545,8 @@ function parseZIndex({
|
|
|
508
545
|
return;
|
|
509
546
|
}
|
|
510
547
|
}
|
|
511
|
-
function parseContainerType(
|
|
548
|
+
function parseContainerType(_declaration, builder) {
|
|
549
|
+
builder.addContainer(["___default___"]);
|
|
512
550
|
return;
|
|
513
551
|
}
|
|
514
552
|
function parseContainerName({
|
|
@@ -523,7 +561,7 @@ function parseContainer({
|
|
|
523
561
|
builder.addContainer(value.name.type === "none" ? false : value.name.value);
|
|
524
562
|
return;
|
|
525
563
|
}
|
|
526
|
-
export function
|
|
564
|
+
export function parseUnparsedDeclaration(declaration, builder) {
|
|
527
565
|
let property = declaration.value.propertyId.property;
|
|
528
566
|
if (!(property in parsers)) {
|
|
529
567
|
builder.addWarning("property", property);
|
|
@@ -544,14 +582,14 @@ export function parseDeclarationUnparsed(declaration, builder) {
|
|
|
544
582
|
*/
|
|
545
583
|
builder.descriptorProperty = property;
|
|
546
584
|
if (unparsedRuntimeParsing.has(property)) {
|
|
547
|
-
const args = parseUnparsed(declaration.value.value, builder);
|
|
585
|
+
const args = parseUnparsed(declaration.value.value, builder, property);
|
|
548
586
|
if (property === "animation") {
|
|
549
|
-
builder.addDescriptor("animation", [{},
|
|
587
|
+
builder.addDescriptor("animation", [{}, property, args]);
|
|
550
588
|
} else {
|
|
551
|
-
builder.addDescriptor(property, [{},
|
|
589
|
+
builder.addDescriptor(property, [{}, toRNProperty(property), args, 1]);
|
|
552
590
|
}
|
|
553
591
|
} else {
|
|
554
|
-
const value = parseUnparsed(declaration.value.value, builder);
|
|
592
|
+
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
555
593
|
builder.addDescriptor(property, value);
|
|
556
594
|
if (property === "font-size") {
|
|
557
595
|
builder.addDescriptor("--__rn-css-em", value);
|
|
@@ -561,22 +599,26 @@ export function parseDeclarationUnparsed(declaration, builder) {
|
|
|
561
599
|
}
|
|
562
600
|
}
|
|
563
601
|
}
|
|
564
|
-
export function
|
|
602
|
+
export function parseCustomDeclaration(declaration, builder) {
|
|
565
603
|
const property = declaration.value.name;
|
|
566
|
-
if (
|
|
567
|
-
builder.
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
604
|
+
if (property === "-webkit-line-clamp") {
|
|
605
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
606
|
+
} else if (property === "-rn-ripple-style") {
|
|
607
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property) === "borderless");
|
|
608
|
+
} else if (property === "object-fit") {
|
|
609
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1046
|
|
610
|
+
parseObjectFit(declaration.value, builder);
|
|
611
|
+
} else if (property === "object-position") {
|
|
612
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1047
|
|
613
|
+
parseObjectPosition(declaration.value, builder);
|
|
614
|
+
} else if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
|
|
615
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
574
616
|
} else {
|
|
575
617
|
builder.addWarning("property", declaration.value.name);
|
|
576
618
|
}
|
|
577
619
|
}
|
|
578
|
-
export function reduceParseUnparsed(tokenOrValues, builder) {
|
|
579
|
-
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder)).filter(v => v !== undefined);
|
|
620
|
+
export function reduceParseUnparsed(tokenOrValues, builder, property, allowAuto) {
|
|
621
|
+
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder, property, allowAuto)).filter(v => v !== undefined);
|
|
580
622
|
if (result.length === 0) {
|
|
581
623
|
return undefined;
|
|
582
624
|
}
|
|
@@ -590,6 +632,9 @@ export function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
590
632
|
currentGroup.push(value);
|
|
591
633
|
}
|
|
592
634
|
}
|
|
635
|
+
|
|
636
|
+
// Groups are the tokens grouped together by comma location
|
|
637
|
+
// If a group only has 1 item, it shouldn't be an array
|
|
593
638
|
groups = groups.flatMap(group => {
|
|
594
639
|
if (!Array.isArray(group)) {
|
|
595
640
|
return [];
|
|
@@ -603,21 +648,26 @@ export function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
603
648
|
} else {
|
|
604
649
|
return [first];
|
|
605
650
|
}
|
|
651
|
+
} else if (
|
|
652
|
+
// This is a special case for <ratio> values
|
|
653
|
+
group.includes("/") && group.every(item => typeof item === "string" && item === "/" ? item : typeof item === "number")) {
|
|
654
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
655
|
+
return [group.join(" ")];
|
|
606
656
|
} else {
|
|
607
657
|
return [group];
|
|
608
658
|
}
|
|
609
659
|
});
|
|
610
660
|
return groups.length === 1 ? groups[0] : groups;
|
|
611
661
|
}
|
|
612
|
-
export function unparsedFunction(token, builder) {
|
|
613
|
-
return [{}, token.value.name, reduceParseUnparsed(token.value.arguments, builder)];
|
|
662
|
+
export function unparsedFunction(token, builder, property, allowAuto) {
|
|
663
|
+
return [{}, toRNProperty(token.value.name), reduceParseUnparsed(token.value.arguments, builder, property, allowAuto)];
|
|
614
664
|
}
|
|
615
665
|
|
|
616
666
|
/**
|
|
617
667
|
* When the CSS cannot be parsed (often due to a runtime condition like a CSS variable)
|
|
618
668
|
* This export function best efforts parsing it into a export function that we can evaluate at runtime
|
|
619
669
|
*/
|
|
620
|
-
export function parseUnparsed(tokenOrValue, builder, allowAuto =
|
|
670
|
+
export function parseUnparsed(tokenOrValue, builder, property, allowAuto = allowAutoProperties.has(property)) {
|
|
621
671
|
if (tokenOrValue === undefined || tokenOrValue === null) {
|
|
622
672
|
return;
|
|
623
673
|
}
|
|
@@ -636,7 +686,7 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
636
686
|
return round(tokenOrValue);
|
|
637
687
|
}
|
|
638
688
|
if (Array.isArray(tokenOrValue)) {
|
|
639
|
-
const args = reduceParseUnparsed(tokenOrValue, builder);
|
|
689
|
+
const args = reduceParseUnparsed(tokenOrValue, builder, property, allowAuto);
|
|
640
690
|
if (!args) return;
|
|
641
691
|
if (Array.isArray(args) && args.length === 1) return args[0];
|
|
642
692
|
return args;
|
|
@@ -644,12 +694,12 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
644
694
|
switch (tokenOrValue.type) {
|
|
645
695
|
case "unresolved-color":
|
|
646
696
|
{
|
|
647
|
-
return parseUnresolvedColor(tokenOrValue.value, builder);
|
|
697
|
+
return parseUnresolvedColor(tokenOrValue.value, builder, property, allowAuto);
|
|
648
698
|
}
|
|
649
699
|
case "var":
|
|
650
700
|
{
|
|
651
701
|
let args = tokenOrValue.value.name.ident.slice(2);
|
|
652
|
-
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder);
|
|
702
|
+
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder, property, allowAuto);
|
|
653
703
|
if (fallback !== undefined) {
|
|
654
704
|
args = [args, fallback];
|
|
655
705
|
}
|
|
@@ -658,50 +708,51 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
658
708
|
case "function":
|
|
659
709
|
{
|
|
660
710
|
switch (tokenOrValue.value.name) {
|
|
661
|
-
case "
|
|
662
|
-
case "rotate":
|
|
663
|
-
case "rotateX":
|
|
664
|
-
case "rotateY":
|
|
665
|
-
case "skewX":
|
|
666
|
-
case "skewY":
|
|
667
|
-
case "scale":
|
|
668
|
-
case "scaleX":
|
|
669
|
-
case "scaleY":
|
|
670
|
-
case "translateX":
|
|
671
|
-
case "translateY":
|
|
672
|
-
tokenOrValue.value.name = `@${tokenOrValue.value.name}`;
|
|
673
|
-
return unparsedFunction(tokenOrValue, builder);
|
|
711
|
+
case "blur":
|
|
674
712
|
case "brightness":
|
|
675
713
|
case "contrast":
|
|
676
714
|
case "cubic-bezier":
|
|
677
715
|
case "drop-shadow":
|
|
678
716
|
case "fontScale":
|
|
717
|
+
case "getPixelSizeForLayoutSize":
|
|
679
718
|
case "grayscale":
|
|
680
719
|
case "hsl":
|
|
681
720
|
case "hsla":
|
|
682
721
|
case "hue-rotate":
|
|
683
722
|
case "invert":
|
|
684
|
-
case "linear-gradient":
|
|
685
723
|
case "opacity":
|
|
686
724
|
case "pixelScale":
|
|
687
|
-
case "pixelSizeForLayoutSize":
|
|
688
725
|
case "platformColor":
|
|
689
|
-
case "radial-gradient":
|
|
690
726
|
case "rgb":
|
|
691
727
|
case "rgba":
|
|
728
|
+
case "rotate":
|
|
729
|
+
case "rotateX":
|
|
730
|
+
case "rotateY":
|
|
692
731
|
case "roundToNearestPixel":
|
|
693
732
|
case "saturate":
|
|
733
|
+
case "scale":
|
|
734
|
+
case "scaleX":
|
|
735
|
+
case "scaleY":
|
|
694
736
|
case "sepia":
|
|
695
737
|
case "shadow":
|
|
738
|
+
case "skewX":
|
|
739
|
+
case "skewY":
|
|
696
740
|
case "steps":
|
|
697
|
-
|
|
741
|
+
case "translate":
|
|
742
|
+
case "translateX":
|
|
743
|
+
case "translateY":
|
|
744
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
745
|
+
case "linear-gradient":
|
|
746
|
+
case "radial-gradient":
|
|
747
|
+
// These are special as React Native requires the '-' in their name
|
|
748
|
+
return [{}, tokenOrValue.value.name, reduceParseUnparsed(tokenOrValue.value.arguments, builder, property, allowAuto)];
|
|
698
749
|
case "hairlineWidth":
|
|
699
750
|
return [{}, tokenOrValue.value.name, []];
|
|
700
751
|
case "calc":
|
|
701
752
|
case "max":
|
|
702
753
|
case "min":
|
|
703
754
|
case "clamp":
|
|
704
|
-
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder);
|
|
755
|
+
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder, property);
|
|
705
756
|
default:
|
|
706
757
|
{
|
|
707
758
|
builder.addWarning("value", `${tokenOrValue.value.name}()`);
|
|
@@ -723,7 +774,7 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
723
774
|
builder.addWarning("value", value);
|
|
724
775
|
return;
|
|
725
776
|
}
|
|
726
|
-
if (value === "inherit") {
|
|
777
|
+
if (value === "inherit" || value === "initial") {
|
|
727
778
|
builder.addWarning("value", value);
|
|
728
779
|
return;
|
|
729
780
|
} else if (value === "currentcolor") {
|
|
@@ -733,6 +784,8 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
733
784
|
return true;
|
|
734
785
|
} else if (value === "false") {
|
|
735
786
|
return false;
|
|
787
|
+
} else if (value === "infinity") {
|
|
788
|
+
return Number.MAX_SAFE_INTEGER;
|
|
736
789
|
} else {
|
|
737
790
|
return value;
|
|
738
791
|
}
|
|
@@ -750,11 +803,17 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
750
803
|
return parseDimension(tokenOrValue.value, builder);
|
|
751
804
|
case "comma":
|
|
752
805
|
return CommaSeparator;
|
|
806
|
+
case "delim":
|
|
807
|
+
{
|
|
808
|
+
if (tokenOrValue.value.value === "/") {
|
|
809
|
+
return tokenOrValue.value.value;
|
|
810
|
+
}
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
753
813
|
case "at-keyword":
|
|
754
814
|
case "hash":
|
|
755
815
|
case "id-hash":
|
|
756
816
|
case "unquoted-url":
|
|
757
|
-
case "delim":
|
|
758
817
|
case "white-space":
|
|
759
818
|
case "comment":
|
|
760
819
|
case "colon":
|
|
@@ -818,7 +877,9 @@ export function parseLength(length, builder) {
|
|
|
818
877
|
} else if (length.value === -Infinity) {
|
|
819
878
|
return -9999;
|
|
820
879
|
} else {
|
|
821
|
-
|
|
880
|
+
// Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
|
|
881
|
+
const value = Math.max(Math.min(length.value, Number.MAX_SAFE_INTEGER), Number.MIN_SAFE_INTEGER);
|
|
882
|
+
return round(value);
|
|
822
883
|
}
|
|
823
884
|
}
|
|
824
885
|
case "rem":
|
|
@@ -973,7 +1034,7 @@ export function parseSize(size, builder, options, {
|
|
|
973
1034
|
}
|
|
974
1035
|
return;
|
|
975
1036
|
}
|
|
976
|
-
export function
|
|
1037
|
+
export function parseColorOrAutoDeclaration({
|
|
977
1038
|
value
|
|
978
1039
|
}, builder) {
|
|
979
1040
|
if (value.type === "auto") {
|
|
@@ -1363,19 +1424,28 @@ export function parseBorderStyle(value, builder) {
|
|
|
1363
1424
|
builder.addWarning("value", value.top);
|
|
1364
1425
|
return undefined;
|
|
1365
1426
|
}
|
|
1366
|
-
export function parseBorderBlockColor({
|
|
1367
|
-
value
|
|
1368
|
-
}, builder) {
|
|
1369
|
-
builder.addDescriptor("border-top-color", parseColor(value.start, builder));
|
|
1370
|
-
builder.addDescriptor("border-bottom-color", parseColor(value.end, builder));
|
|
1371
|
-
return;
|
|
1372
|
-
}
|
|
1373
1427
|
export function parseBorderBlockWidth(declaration, builder) {
|
|
1374
|
-
|
|
1375
|
-
|
|
1428
|
+
const start = parseBorderSideWidth(declaration.value.start, builder);
|
|
1429
|
+
const end = parseBorderSideWidth(declaration.value.end, builder);
|
|
1430
|
+
if (start === end) {
|
|
1431
|
+
builder.addDescriptor("border-block-width", start);
|
|
1432
|
+
} else {
|
|
1433
|
+
builder.addDescriptor("border-block-start-width", start);
|
|
1434
|
+
builder.addDescriptor("border-block-end-width", end);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
function parseBorderBlockStyle(declaration, builder) {
|
|
1438
|
+
const start = parseBorderStyle(declaration.value.start, builder);
|
|
1439
|
+
const end = parseBorderStyle(declaration.value.end, builder);
|
|
1440
|
+
if (start == end) {
|
|
1441
|
+
builder.addDescriptor("border-block-style", start);
|
|
1442
|
+
} else {
|
|
1443
|
+
builder.addDescriptor("border-block-start-style", start);
|
|
1444
|
+
builder.addDescriptor("border-block-end-style", end);
|
|
1445
|
+
}
|
|
1376
1446
|
}
|
|
1377
1447
|
export function parseBorderSideWidthDeclaration(declaration, builder) {
|
|
1378
|
-
|
|
1448
|
+
builder.addDescriptor(declaration.property, parseBorderSideWidth(declaration.value, builder));
|
|
1379
1449
|
}
|
|
1380
1450
|
export function parseBorderSideWidth(value, builder) {
|
|
1381
1451
|
if (value.type === "length") {
|
|
@@ -1636,14 +1706,18 @@ export function parseUserSelect({
|
|
|
1636
1706
|
}
|
|
1637
1707
|
}
|
|
1638
1708
|
export function parseSVGPaint({
|
|
1639
|
-
value
|
|
1709
|
+
value,
|
|
1710
|
+
property
|
|
1640
1711
|
}, builder) {
|
|
1712
|
+
let parsedValue;
|
|
1641
1713
|
if (value.type === "none") {
|
|
1642
|
-
|
|
1714
|
+
parsedValue = "transparent";
|
|
1643
1715
|
} else if (value.type === "color") {
|
|
1644
|
-
|
|
1716
|
+
parsedValue = parseColor(value.value, builder);
|
|
1717
|
+
} else {
|
|
1718
|
+
return;
|
|
1645
1719
|
}
|
|
1646
|
-
|
|
1720
|
+
builder.addDescriptor(property, parsedValue);
|
|
1647
1721
|
}
|
|
1648
1722
|
export function round(number) {
|
|
1649
1723
|
return Math.round((number + Number.EPSILON) * 10000) / 10000;
|
|
@@ -1657,7 +1731,7 @@ export function parseDimensionPercentageFor_LengthValue(value, builder) {
|
|
|
1657
1731
|
return parseLength(value.value, builder);
|
|
1658
1732
|
}
|
|
1659
1733
|
}
|
|
1660
|
-
const
|
|
1734
|
+
const allowAutoProperties = new Set(["pointer-events"]);
|
|
1661
1735
|
export function parseEnv(value, builder) {
|
|
1662
1736
|
switch (value.name.type) {
|
|
1663
1737
|
case "ua":
|
|
@@ -1666,7 +1740,7 @@ export function parseEnv(value, builder) {
|
|
|
1666
1740
|
case "safe-area-inset-right":
|
|
1667
1741
|
case "safe-area-inset-bottom":
|
|
1668
1742
|
case "safe-area-inset-left":
|
|
1669
|
-
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder)], 1];
|
|
1743
|
+
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder, value.name.value)], 1];
|
|
1670
1744
|
case "viewport-segment-width":
|
|
1671
1745
|
case "viewport-segment-height":
|
|
1672
1746
|
case "viewport-segment-top":
|
|
@@ -1680,17 +1754,16 @@ export function parseEnv(value, builder) {
|
|
|
1680
1754
|
}
|
|
1681
1755
|
return;
|
|
1682
1756
|
}
|
|
1683
|
-
export function parseCalcFn(name, tokens, builder) {
|
|
1684
|
-
const args = parseCalcArguments(tokens, builder);
|
|
1757
|
+
export function parseCalcFn(name, tokens, builder, property) {
|
|
1758
|
+
const args = parseCalcArguments(tokens, builder, property);
|
|
1685
1759
|
if (args) {
|
|
1686
1760
|
return [{}, name, args];
|
|
1687
1761
|
}
|
|
1688
1762
|
return;
|
|
1689
1763
|
}
|
|
1690
|
-
export function parseCalcArguments([...args], builder) {
|
|
1764
|
+
export function parseCalcArguments([...args], builder, property) {
|
|
1691
1765
|
const parsed = [];
|
|
1692
|
-
|
|
1693
|
-
for (const [currentIndex, arg] of args.entries()) {
|
|
1766
|
+
for (const arg of args) {
|
|
1694
1767
|
switch (arg.type) {
|
|
1695
1768
|
case "env":
|
|
1696
1769
|
{
|
|
@@ -1701,7 +1774,7 @@ export function parseCalcArguments([...args], builder) {
|
|
|
1701
1774
|
case "function":
|
|
1702
1775
|
case "unresolved-color":
|
|
1703
1776
|
{
|
|
1704
|
-
const value = parseUnparsed(arg, builder);
|
|
1777
|
+
const value = parseUnparsed(arg, builder, property);
|
|
1705
1778
|
if (value === undefined) {
|
|
1706
1779
|
return undefined;
|
|
1707
1780
|
}
|
|
@@ -1736,44 +1809,21 @@ export function parseCalcArguments([...args], builder) {
|
|
|
1736
1809
|
}
|
|
1737
1810
|
break;
|
|
1738
1811
|
case "percentage":
|
|
1739
|
-
|
|
1740
|
-
if (mode !== "percentage") return;
|
|
1741
|
-
parsed.push(`${arg.value.value * 100}%`);
|
|
1812
|
+
parsed.push(`${round(arg.value.value * 100)}%`);
|
|
1742
1813
|
break;
|
|
1743
1814
|
case "number":
|
|
1744
1815
|
{
|
|
1745
|
-
|
|
1746
|
-
if (mode !== "number") return;
|
|
1747
|
-
parsed.push(arg.value.value);
|
|
1816
|
+
parsed.push(round(arg.value.value));
|
|
1748
1817
|
break;
|
|
1749
1818
|
}
|
|
1750
1819
|
case "parenthesis-block":
|
|
1751
1820
|
{
|
|
1752
|
-
|
|
1753
|
-
* If we have a parenthesis block, we just treat it as a nested calc function
|
|
1754
|
-
* Because there could be multiple parenthesis blocks, this is recursive
|
|
1755
|
-
*/
|
|
1756
|
-
let closeParenthesisIndex = -1;
|
|
1757
|
-
for (let index = args.length - 1; index > 0; index--) {
|
|
1758
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1759
|
-
const value = args[index];
|
|
1760
|
-
if (value.type === "token" && value.value.type === "close-parenthesis") {
|
|
1761
|
-
closeParenthesisIndex = index;
|
|
1762
|
-
break;
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
if (closeParenthesisIndex === -1) {
|
|
1766
|
-
return;
|
|
1767
|
-
}
|
|
1768
|
-
const innerCalcArgs = args
|
|
1769
|
-
// Extract the inner calcArgs including the parenthesis. This mutates args
|
|
1770
|
-
.splice(currentIndex, closeParenthesisIndex - currentIndex + 1)
|
|
1771
|
-
// Then drop the surrounding parenthesis
|
|
1772
|
-
.slice(1, -1);
|
|
1773
|
-
parsed.push(parseCalcFn("calc", innerCalcArgs, builder));
|
|
1821
|
+
parsed.push("(");
|
|
1774
1822
|
break;
|
|
1775
1823
|
}
|
|
1776
1824
|
case "close-parenthesis":
|
|
1825
|
+
parsed.push(")");
|
|
1826
|
+
break;
|
|
1777
1827
|
case "string":
|
|
1778
1828
|
case "function":
|
|
1779
1829
|
case "ident":
|
|
@@ -1811,20 +1861,20 @@ export function parseTranslateProp(value, prop, builder) {
|
|
|
1811
1861
|
}
|
|
1812
1862
|
return parseLength(value[prop], builder);
|
|
1813
1863
|
}
|
|
1814
|
-
export function parseUnresolvedColor(color, builder) {
|
|
1864
|
+
export function parseUnresolvedColor(color, builder, property, allowAuto) {
|
|
1815
1865
|
switch (color.type) {
|
|
1816
1866
|
case "rgb":
|
|
1817
|
-
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder)]];
|
|
1867
|
+
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder, property)]];
|
|
1818
1868
|
case "hsl":
|
|
1819
|
-
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder)]];
|
|
1869
|
+
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder, property)]];
|
|
1820
1870
|
case "light-dark":
|
|
1821
1871
|
{
|
|
1822
1872
|
const extraRule = builder.extendRule({
|
|
1823
1873
|
m: [["=", "prefers-color-scheme", "dark"]]
|
|
1824
1874
|
});
|
|
1825
|
-
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder), false, extraRule);
|
|
1875
|
+
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder, property, allowAuto), false, extraRule);
|
|
1826
1876
|
builder.addExtraRule(extraRule);
|
|
1827
|
-
return reduceParseUnparsed(color.light, builder);
|
|
1877
|
+
return reduceParseUnparsed(color.light, builder, property, allowAuto);
|
|
1828
1878
|
}
|
|
1829
1879
|
default:
|
|
1830
1880
|
color;
|
|
@@ -1886,7 +1936,7 @@ export function addTransitionValue(declaration, builder) {
|
|
|
1886
1936
|
}
|
|
1887
1937
|
case "transition-property":
|
|
1888
1938
|
{
|
|
1889
|
-
builder.addDescriptor(declaration.property, declaration.value.map(v => v.property).filter(v => v in parsers || v === "all" || v === "none").map(v => toRNProperty(v)));
|
|
1939
|
+
builder.addDescriptor(declaration.property, declaration.value.map(v => v.property).filter(v => v in parsers && !["visibility"].includes(v) || v === "all" || v === "none").map(v => toRNProperty(v)));
|
|
1890
1940
|
return;
|
|
1891
1941
|
}
|
|
1892
1942
|
case "transition-duration":
|
|
@@ -1983,7 +2033,7 @@ function parseGradient(gradient, builder) {
|
|
|
1983
2033
|
switch (gradient.type) {
|
|
1984
2034
|
case "linear":
|
|
1985
2035
|
{
|
|
1986
|
-
return [{}, "
|
|
2036
|
+
return [{}, "linear-gradient", [parseLineDirection(gradient.direction, builder), ...gradient.items.map(item => parseGradientItem(item, builder))]];
|
|
1987
2037
|
}
|
|
1988
2038
|
}
|
|
1989
2039
|
return;
|
|
@@ -2018,6 +2068,27 @@ function parseGradientItem(item, builder) {
|
|
|
2018
2068
|
return parseLength(item.value, builder);
|
|
2019
2069
|
}
|
|
2020
2070
|
}
|
|
2071
|
+
function parseObjectFit(declaration, builder) {
|
|
2072
|
+
builder.addMapping({
|
|
2073
|
+
"object-fit": "contentFit"
|
|
2074
|
+
});
|
|
2075
|
+
builder.addDescriptor("object-fit", parseUnparsed(declaration.value, builder, "object-fit"));
|
|
2076
|
+
}
|
|
2077
|
+
function parseObjectPosition(declaration, builder) {
|
|
2078
|
+
builder.addMapping({
|
|
2079
|
+
"object-position": "contentPosition"
|
|
2080
|
+
});
|
|
2081
|
+
builder.addDescriptor("object-position", [{}, "join", [parseUnparsed(declaration.value, builder, "object-position"), " "]]);
|
|
2082
|
+
}
|
|
2083
|
+
function parseVisibility(declaration, builder) {
|
|
2084
|
+
if (declaration.value === "visible") {
|
|
2085
|
+
builder.addDescriptor("opacity", 1);
|
|
2086
|
+
} else if (declaration.value === "hidden") {
|
|
2087
|
+
builder.addDescriptor("opacity", 0);
|
|
2088
|
+
} else {
|
|
2089
|
+
builder.addWarning("value", declaration.value);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2021
2092
|
function parseFilter(declaration, builder) {
|
|
2022
2093
|
if (declaration.value.type === "none") {
|
|
2023
2094
|
return "unset";
|
|
@@ -2040,6 +2111,7 @@ function parseFilter(declaration, builder) {
|
|
|
2040
2111
|
[value.type]: parseAngle(value.value, builder)
|
|
2041
2112
|
};
|
|
2042
2113
|
case "drop-shadow":
|
|
2114
|
+
return [{}, toRNProperty(value.type), [parseLength(value.value.xOffset, builder), parseLength(value.value.yOffset, builder), parseLength(value.value.blur, builder), parseColor(value.value.color, builder)]];
|
|
2043
2115
|
case "url":
|
|
2044
2116
|
return;
|
|
2045
2117
|
}
|