react-native-css 3.0.0-nightly.26b272f → 3.0.0-nightly.46bc0ab
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/declarations.js +103 -80
- package/dist/commonjs/compiler/declarations.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/stylesheet.js +14 -8
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- 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/TextInput.js +17 -0
- package/dist/commonjs/components/TextInput.js.map +1 -0
- package/dist/commonjs/components/index.js +40 -0
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/jest/index.js +21 -14
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +2 -0
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/runtime/native/injection.js +19 -18
- package/dist/commonjs/runtime/native/injection.js.map +1 -1
- package/dist/commonjs/runtime/native/react/rules.js +13 -8
- 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/reanimated.js +17 -0
- package/dist/commonjs/runtime/native/reanimated.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/calculate-props.js +5 -2
- 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/{calc.js → functions/calc.js} +1 -1
- 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 +61 -0
- package/dist/commonjs/runtime/native/styles/functions/index.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/transform-functions.js +83 -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} +5 -36
- 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/{box-shadow.js → shorthands/box-shadow.js} +3 -3
- 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/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/utils/objects.js +14 -6
- package/dist/commonjs/runtime/utils/objects.js.map +1 -1
- package/dist/module/compiler/atRules.js +15 -2
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/declarations.js +100 -77
- package/dist/module/compiler/declarations.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/stylesheet.js +14 -8
- package/dist/module/compiler/stylesheet.js.map +1 -1
- 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/TextInput.js +12 -0
- package/dist/module/components/TextInput.js.map +1 -0
- package/dist/module/components/index.js +5 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/jest/index.js +20 -14
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +2 -0
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/module/runtime/native/injection.js +19 -18
- package/dist/module/runtime/native/injection.js.map +1 -1
- package/dist/module/runtime/native/react/rules.js +13 -8
- 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/reanimated.js +13 -0
- package/dist/module/runtime/native/reanimated.js.map +1 -0
- package/dist/module/runtime/native/styles/calculate-props.js +6 -3
- 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/{calc.js → functions/calc.js} +1 -1
- 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 +8 -0
- package/dist/module/runtime/native/styles/functions/index.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/transform-functions.js +76 -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} +2 -2
- 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/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/utils/objects.js +14 -6
- package/dist/module/runtime/utils/objects.js.map +1 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +1 -3
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +9 -9
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- 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/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 +5 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +11 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.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/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.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 +6 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.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/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/utils/objects.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +1 -3
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +9 -9
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- 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/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 +5 -0
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +11 -1
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/injection.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/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.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 +6 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/index.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/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/utils/objects.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/compiler/atRules.ts +16 -2
- package/src/compiler/compiler.types.ts +1 -3
- package/src/compiler/declarations.ts +182 -95
- package/src/compiler/keyframes.ts +1 -1
- package/src/compiler/stylesheet.ts +17 -7
- 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/TextInput.tsx +17 -0
- package/src/components/index.tsx +5 -0
- package/src/jest/index.ts +22 -13
- package/src/runtime/native/conditions/media-query.ts +2 -0
- package/src/runtime/native/injection.ts +31 -30
- package/src/runtime/native/react/rules.ts +14 -5
- package/src/runtime/native/react/useNativeCss.ts +1 -1
- package/src/runtime/native/reanimated.ts +22 -0
- package/src/runtime/native/styles/calculate-props.ts +4 -3
- 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/{calc.ts → functions/calc.ts} +2 -2
- package/src/runtime/native/styles/{filters.ts → functions/filters.ts} +3 -3
- package/src/runtime/native/styles/functions/index.ts +5 -0
- package/src/runtime/native/styles/{platform-functions.ts → functions/platform-functions.ts} +2 -2
- package/src/runtime/native/styles/functions/transform-functions.ts +51 -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 -63
- package/src/runtime/native/styles/{border.ts → shorthands/border.ts} +1 -1
- package/src/runtime/native/styles/{box-shadow.ts → shorthands/box-shadow.ts} +3 -3
- 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} +1 -1
- package/src/runtime/native/styles/units.ts +1 -1
- package/src/runtime/utils/objects.ts +14 -4
- 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.map +0 -1
- 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/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.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/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/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/dist/commonjs/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
- /package/dist/module/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
|
@@ -49,7 +49,16 @@ function isPropAtRule(rule) {
|
|
|
49
49
|
return rule.type === "unknown" && rule.value.name === "prop";
|
|
50
50
|
}
|
|
51
51
|
function parsePropAtRule(rules) {
|
|
52
|
-
|
|
52
|
+
// Include any default mapping here
|
|
53
|
+
const mapping = {
|
|
54
|
+
"caret-color": ["cursorColor"],
|
|
55
|
+
"fill": ["fill"],
|
|
56
|
+
"stroke": ["stroke"],
|
|
57
|
+
"stroke-width": ["strokeWidth"],
|
|
58
|
+
"-webkit-line-clamp": ["numberOfLines"],
|
|
59
|
+
"-rn-ripple-color": ["android_ripple", "color"],
|
|
60
|
+
"-rn-ripple-style": ["android_ripple", "borderless"]
|
|
61
|
+
};
|
|
53
62
|
if (!rules) return mapping;
|
|
54
63
|
for (const rule of rules) {
|
|
55
64
|
if (!isPropAtRule(rule)) continue;
|
|
@@ -79,13 +88,17 @@ function propAtRuleBlock(token, mapping = {}) {
|
|
|
79
88
|
const [from, to] = (0, _splitByDelimiter.splitByDelimiter)(token, item => {
|
|
80
89
|
return item.value.type === "colon";
|
|
81
90
|
});
|
|
82
|
-
if (!from || from.length !== 1
|
|
91
|
+
if (!from || from.length !== 1) {
|
|
83
92
|
return mapping;
|
|
84
93
|
}
|
|
85
94
|
const fromToken = from[0];
|
|
86
95
|
if (!fromToken || fromToken.value.type !== "ident") {
|
|
87
96
|
return mapping;
|
|
88
97
|
}
|
|
98
|
+
if (!to) {
|
|
99
|
+
mapping["*"] = (0, _selectors.toRNProperty)(fromToken.value.value);
|
|
100
|
+
return mapping;
|
|
101
|
+
}
|
|
89
102
|
mapping[(0, _selectors.toRNProperty)(fromToken.value.value)] = to.flatMap((item, index) => {
|
|
90
103
|
switch (item.value.type) {
|
|
91
104
|
case "delim":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_selectors","require","_splitByDelimiter","maybeMutateReactNativeOptions","rule","builder","type","value","name","declarations","body","declaration","property","forEach","token","setOptions","isPropAtRule","parsePropAtRule","rules","mapping","prelude","length","filter","item","propAtRuleBlock","block","blocks","blockRules","splitByDelimiter","from","to","fromToken","toRNProperty","flatMap","index"],"sourceRoot":"../../../src","sources":["compiler/atRules.ts"],"mappings":";;;;;;;AAQA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAYA;AACA;AACA;;AAcO,SAASE,6BAA6BA,CAC3CC,IAA8B,EAC9BC,OAA0B,EAC1B;EACA,IAAID,IAAI,CAACE,IAAI,KAAK,QAAQ,IAAIF,IAAI,CAACG,KAAK,EAAEC,IAAI,KAAK,cAAc,EAAE;IACjE;EACF;EAEA,MAAM;IAAEC;EAAa,CAAC,GAAGL,IAAI,CAACG,KAAK,CAACG,IAAI,CAACH,KAAK;EAC9C,IAAI,CAACE,YAAY,EAAE;EAEnB,KAAK,MAAME,WAAW,IAAIF,YAAY,EAAE;IACtC,IAAIE,WAAW,CAACC,QAAQ,KAAK,QAAQ,EAAE;IAEvC,QAAQD,WAAW,CAACJ,KAAK,CAACC,IAAI;MAC5B,KAAK,oBAAoB;QAAE;UACzBG,WAAW,CAACJ,KAAK,CAACA,KAAK,CAACM,OAAO,CAAEC,KAAK,IAAK;YACzC,IAAIA,KAAK,CAACR,IAAI,KAAK,cAAc,EAAE;cACjC;YACF;YAEA,IAAIQ,KAAK,CAACP,KAAK,KAAK,MAAM,IAAIO,KAAK,CAACP,KAAK,KAAK,OAAO,EAAE;cACrD;YACF;YAEAF,OAAO,CAACU,UAAU,CAAC,mBAAmB,EAAED,KAAK,CAACP,KAAK,KAAK,MAAM,CAAC;UACjE,CAAC,CAAC;UACF;QACF;MACA;QACE;IACJ;EACF;AACF;;AAEA;AACA;AACA;;AAEA,SAASS,YAAYA,CAACZ,IAAuB,EAAsB;EACjE,OAAOA,IAAI,CAACE,IAAI,KAAK,SAAS,IAAIF,IAAI,CAACG,KAAK,CAACC,IAAI,KAAK,MAAM;AAC9D;AAEO,SAASS,eAAeA,CAACC,KAA6B,EAAE;EAC7D,MAAMC,OAAyB,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["_selectors","require","_splitByDelimiter","maybeMutateReactNativeOptions","rule","builder","type","value","name","declarations","body","declaration","property","forEach","token","setOptions","isPropAtRule","parsePropAtRule","rules","mapping","prelude","length","filter","item","propAtRuleBlock","block","blocks","blockRules","splitByDelimiter","from","to","fromToken","toRNProperty","flatMap","index"],"sourceRoot":"../../../src","sources":["compiler/atRules.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -25,10 +25,9 @@ exports.parseCalcArguments = parseCalcArguments;
|
|
|
25
25
|
exports.parseCalcFn = parseCalcFn;
|
|
26
26
|
exports.parseColor = parseColor;
|
|
27
27
|
exports.parseColorDeclaration = parseColorDeclaration;
|
|
28
|
-
exports.
|
|
28
|
+
exports.parseColorOrAutoDeclaration = parseColorOrAutoDeclaration;
|
|
29
|
+
exports.parseCustomDeclaration = parseCustomDeclaration;
|
|
29
30
|
exports.parseDeclaration = parseDeclaration;
|
|
30
|
-
exports.parseDeclarationCustom = parseDeclarationCustom;
|
|
31
|
-
exports.parseDeclarationUnparsed = parseDeclarationUnparsed;
|
|
32
31
|
exports.parseDimension = parseDimension;
|
|
33
32
|
exports.parseDimensionPercentageFor_LengthValue = parseDimensionPercentageFor_LengthValue;
|
|
34
33
|
exports.parseDisplay = parseDisplay;
|
|
@@ -68,6 +67,7 @@ exports.parseTextShadow = parseTextShadow;
|
|
|
68
67
|
exports.parseTime = parseTime;
|
|
69
68
|
exports.parseTranslateProp = parseTranslateProp;
|
|
70
69
|
exports.parseUnparsed = parseUnparsed;
|
|
70
|
+
exports.parseUnparsedDeclaration = parseUnparsedDeclaration;
|
|
71
71
|
exports.parseUnresolvedColor = parseUnresolvedColor;
|
|
72
72
|
exports.parseUserSelect = parseUserSelect;
|
|
73
73
|
exports.parseVerticalAlign = parseVerticalAlign;
|
|
@@ -84,7 +84,9 @@ const CommaSeparator = Symbol("CommaSeparator");
|
|
|
84
84
|
const propertyRename = {
|
|
85
85
|
"background-image": "experimental_backgroundImage"
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
|
|
88
|
+
// TODO: We need a better way to handle this
|
|
89
|
+
const unparsedRuntimeParsing = new Set(["animation", "border", "box-shadow", "text-shadow", "transform", "scale", "rotate", "translate"]);
|
|
88
90
|
const parsers = {
|
|
89
91
|
"align-content": parseAlignContent,
|
|
90
92
|
"align-items": parseAlignItems,
|
|
@@ -155,7 +157,7 @@ const parsers = {
|
|
|
155
157
|
"border-width": parseBorderWidth,
|
|
156
158
|
"bottom": parseSizeDeclaration,
|
|
157
159
|
"box-shadow": parseBoxShadow,
|
|
158
|
-
"caret-color":
|
|
160
|
+
"caret-color": parseColorOrAutoDeclaration,
|
|
159
161
|
"color": parseFontColorDeclaration,
|
|
160
162
|
"column-gap": parseGap,
|
|
161
163
|
"container": parseContainer,
|
|
@@ -274,9 +276,9 @@ function parseDeclaration(declaration, builder) {
|
|
|
274
276
|
return;
|
|
275
277
|
}
|
|
276
278
|
if (declaration.property === "unparsed") {
|
|
277
|
-
|
|
279
|
+
parseUnparsedDeclaration(declaration, builder);
|
|
278
280
|
} else if (declaration.property === "custom") {
|
|
279
|
-
|
|
281
|
+
parseCustomDeclaration(declaration, builder);
|
|
280
282
|
} else {
|
|
281
283
|
parseWithParser(declaration, builder);
|
|
282
284
|
}
|
|
@@ -515,26 +517,26 @@ function parseFont({
|
|
|
515
517
|
function parseTransform({
|
|
516
518
|
value
|
|
517
519
|
}, builder) {
|
|
518
|
-
builder.addDescriptor("transform", [{}, "
|
|
520
|
+
builder.addDescriptor("transform", [{}, "transform", value.flatMap(t => {
|
|
519
521
|
switch (t.type) {
|
|
520
522
|
case "perspective":
|
|
521
|
-
return [[{}, "
|
|
523
|
+
return [[{}, "perspective", parseLength(t.value, builder)]];
|
|
522
524
|
case "translate":
|
|
523
|
-
return [[{}, "
|
|
525
|
+
return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value[0], builder)], [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value[1], builder)]]];
|
|
524
526
|
case "translateX":
|
|
525
|
-
return [[{}, "
|
|
527
|
+
return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
|
|
526
528
|
case "translateY":
|
|
527
|
-
return [[{}, "
|
|
529
|
+
return [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
|
|
528
530
|
case "rotate":
|
|
529
|
-
return [[{}, "
|
|
531
|
+
return [[{}, "rotate", parseAngle(t.value, builder)]];
|
|
530
532
|
case "rotateX":
|
|
531
|
-
return [[{}, "
|
|
533
|
+
return [[{}, "rotateX", parseAngle(t.value, builder)]];
|
|
532
534
|
case "rotateY":
|
|
533
|
-
return [[{}, "
|
|
535
|
+
return [[{}, "rotateY", parseAngle(t.value, builder)]];
|
|
534
536
|
case "rotateZ":
|
|
535
|
-
return [[{}, "
|
|
537
|
+
return [[{}, "rotateZ", parseAngle(t.value, builder)]];
|
|
536
538
|
case "scale":
|
|
537
|
-
return [[{}, "
|
|
539
|
+
return [[{}, "scaleX", parseLength(t.value[0], builder)], [{}, "scaleY", parseLength(t.value[1], builder)]];
|
|
538
540
|
case "scaleX":
|
|
539
541
|
return [[{}, "scaleX", parseLength(t.value, builder)]];
|
|
540
542
|
case "scaleY":
|
|
@@ -566,9 +568,15 @@ function parseTranslate({
|
|
|
566
568
|
function parseRotate({
|
|
567
569
|
value
|
|
568
570
|
}, builder) {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
571
|
+
if (value.x) {
|
|
572
|
+
builder.addDescriptor("rotateX", [{}, "rotateX", parseAngle(value.angle, builder)]);
|
|
573
|
+
}
|
|
574
|
+
if (value.y) {
|
|
575
|
+
builder.addDescriptor("rotateY", [{}, "rotateY", parseAngle(value.angle, builder)]);
|
|
576
|
+
}
|
|
577
|
+
if (value.z) {
|
|
578
|
+
builder.addDescriptor("rotateZ", [{}, "rotateZ", parseAngle(value.angle, builder)]);
|
|
579
|
+
}
|
|
572
580
|
}
|
|
573
581
|
function parseScale({
|
|
574
582
|
value
|
|
@@ -610,7 +618,8 @@ function parseZIndex({
|
|
|
610
618
|
return;
|
|
611
619
|
}
|
|
612
620
|
}
|
|
613
|
-
function parseContainerType(
|
|
621
|
+
function parseContainerType(_declaration, builder) {
|
|
622
|
+
builder.addContainer(["___default___"]);
|
|
614
623
|
return;
|
|
615
624
|
}
|
|
616
625
|
function parseContainerName({
|
|
@@ -625,7 +634,7 @@ function parseContainer({
|
|
|
625
634
|
builder.addContainer(value.name.type === "none" ? false : value.name.value);
|
|
626
635
|
return;
|
|
627
636
|
}
|
|
628
|
-
function
|
|
637
|
+
function parseUnparsedDeclaration(declaration, builder) {
|
|
629
638
|
let property = declaration.value.propertyId.property;
|
|
630
639
|
if (!(property in parsers)) {
|
|
631
640
|
builder.addWarning("property", property);
|
|
@@ -646,14 +655,14 @@ function parseDeclarationUnparsed(declaration, builder) {
|
|
|
646
655
|
*/
|
|
647
656
|
builder.descriptorProperty = property;
|
|
648
657
|
if (unparsedRuntimeParsing.has(property)) {
|
|
649
|
-
const args = parseUnparsed(declaration.value.value, builder);
|
|
658
|
+
const args = parseUnparsed(declaration.value.value, builder, property);
|
|
650
659
|
if (property === "animation") {
|
|
651
|
-
builder.addDescriptor("animation", [{},
|
|
660
|
+
builder.addDescriptor("animation", [{}, property, args]);
|
|
652
661
|
} else {
|
|
653
|
-
builder.addDescriptor(property, [{},
|
|
662
|
+
builder.addDescriptor(property, [{}, (0, _selectors.toRNProperty)(property), args, 1]);
|
|
654
663
|
}
|
|
655
664
|
} else {
|
|
656
|
-
const value = parseUnparsed(declaration.value.value, builder);
|
|
665
|
+
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
657
666
|
builder.addDescriptor(property, value);
|
|
658
667
|
if (property === "font-size") {
|
|
659
668
|
builder.addDescriptor("--__rn-css-em", value);
|
|
@@ -663,22 +672,20 @@ function parseDeclarationUnparsed(declaration, builder) {
|
|
|
663
672
|
}
|
|
664
673
|
}
|
|
665
674
|
}
|
|
666
|
-
function
|
|
675
|
+
function parseCustomDeclaration(declaration, builder) {
|
|
667
676
|
const property = declaration.value.name;
|
|
668
|
-
if (
|
|
669
|
-
builder.
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
});
|
|
675
|
-
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, allowAuto.has(property)));
|
|
677
|
+
if (property === "-webkit-line-clamp") {
|
|
678
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
679
|
+
} else if (property === "-rn-ripple-style") {
|
|
680
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property) === "borderless");
|
|
681
|
+
} else if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
|
|
682
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
676
683
|
} else {
|
|
677
684
|
builder.addWarning("property", declaration.value.name);
|
|
678
685
|
}
|
|
679
686
|
}
|
|
680
|
-
function reduceParseUnparsed(tokenOrValues, builder) {
|
|
681
|
-
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder)).filter(v => v !== undefined);
|
|
687
|
+
function reduceParseUnparsed(tokenOrValues, builder, property, allowAuto) {
|
|
688
|
+
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder, property, allowAuto)).filter(v => v !== undefined);
|
|
682
689
|
if (result.length === 0) {
|
|
683
690
|
return undefined;
|
|
684
691
|
}
|
|
@@ -692,6 +699,9 @@ function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
692
699
|
currentGroup.push(value);
|
|
693
700
|
}
|
|
694
701
|
}
|
|
702
|
+
|
|
703
|
+
// Groups are the tokens grouped together by comma location
|
|
704
|
+
// If a group only has 1 item, it shouldn't be an array
|
|
695
705
|
groups = groups.flatMap(group => {
|
|
696
706
|
if (!Array.isArray(group)) {
|
|
697
707
|
return [];
|
|
@@ -705,21 +715,26 @@ function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
705
715
|
} else {
|
|
706
716
|
return [first];
|
|
707
717
|
}
|
|
718
|
+
} else if (
|
|
719
|
+
// This is a special case for <ratio> values
|
|
720
|
+
group.includes("/") && group.every(item => typeof item === "string" && item === "/" ? item : typeof item === "number")) {
|
|
721
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
722
|
+
return [group.join(" ")];
|
|
708
723
|
} else {
|
|
709
724
|
return [group];
|
|
710
725
|
}
|
|
711
726
|
});
|
|
712
727
|
return groups.length === 1 ? groups[0] : groups;
|
|
713
728
|
}
|
|
714
|
-
function unparsedFunction(token, builder) {
|
|
715
|
-
return [{}, token.value.name, reduceParseUnparsed(token.value.arguments, builder)];
|
|
729
|
+
function unparsedFunction(token, builder, property, allowAuto) {
|
|
730
|
+
return [{}, (0, _selectors.toRNProperty)(token.value.name), reduceParseUnparsed(token.value.arguments, builder, property, allowAuto)];
|
|
716
731
|
}
|
|
717
732
|
|
|
718
733
|
/**
|
|
719
734
|
* When the CSS cannot be parsed (often due to a runtime condition like a CSS variable)
|
|
720
735
|
* This export function best efforts parsing it into a export function that we can evaluate at runtime
|
|
721
736
|
*/
|
|
722
|
-
function parseUnparsed(tokenOrValue, builder, allowAuto =
|
|
737
|
+
function parseUnparsed(tokenOrValue, builder, property, allowAuto = allowAutoProperties.has(property)) {
|
|
723
738
|
if (tokenOrValue === undefined || tokenOrValue === null) {
|
|
724
739
|
return;
|
|
725
740
|
}
|
|
@@ -738,7 +753,7 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
738
753
|
return round(tokenOrValue);
|
|
739
754
|
}
|
|
740
755
|
if (Array.isArray(tokenOrValue)) {
|
|
741
|
-
const args = reduceParseUnparsed(tokenOrValue, builder);
|
|
756
|
+
const args = reduceParseUnparsed(tokenOrValue, builder, property, allowAuto);
|
|
742
757
|
if (!args) return;
|
|
743
758
|
if (Array.isArray(args) && args.length === 1) return args[0];
|
|
744
759
|
return args;
|
|
@@ -746,12 +761,12 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
746
761
|
switch (tokenOrValue.type) {
|
|
747
762
|
case "unresolved-color":
|
|
748
763
|
{
|
|
749
|
-
return parseUnresolvedColor(tokenOrValue.value, builder);
|
|
764
|
+
return parseUnresolvedColor(tokenOrValue.value, builder, property, allowAuto);
|
|
750
765
|
}
|
|
751
766
|
case "var":
|
|
752
767
|
{
|
|
753
768
|
let args = tokenOrValue.value.name.ident.slice(2);
|
|
754
|
-
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder);
|
|
769
|
+
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder, property, allowAuto);
|
|
755
770
|
if (fallback !== undefined) {
|
|
756
771
|
args = [args, fallback];
|
|
757
772
|
}
|
|
@@ -760,51 +775,51 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
760
775
|
case "function":
|
|
761
776
|
{
|
|
762
777
|
switch (tokenOrValue.value.name) {
|
|
763
|
-
case "translate":
|
|
764
|
-
case "rotate":
|
|
765
|
-
case "rotateX":
|
|
766
|
-
case "rotateY":
|
|
767
|
-
case "skewX":
|
|
768
|
-
case "skewY":
|
|
769
|
-
case "scale":
|
|
770
|
-
case "scaleX":
|
|
771
|
-
case "scaleY":
|
|
772
|
-
case "translateX":
|
|
773
|
-
case "translateY":
|
|
774
|
-
tokenOrValue.value.name = `@${tokenOrValue.value.name}`;
|
|
775
|
-
return unparsedFunction(tokenOrValue, builder);
|
|
776
778
|
case "blur":
|
|
777
779
|
case "brightness":
|
|
778
780
|
case "contrast":
|
|
779
781
|
case "cubic-bezier":
|
|
780
782
|
case "drop-shadow":
|
|
781
783
|
case "fontScale":
|
|
784
|
+
case "getPixelSizeForLayoutSize":
|
|
782
785
|
case "grayscale":
|
|
783
786
|
case "hsl":
|
|
784
787
|
case "hsla":
|
|
785
788
|
case "hue-rotate":
|
|
786
789
|
case "invert":
|
|
787
|
-
case "linear-gradient":
|
|
788
790
|
case "opacity":
|
|
789
791
|
case "pixelScale":
|
|
790
|
-
case "pixelSizeForLayoutSize":
|
|
791
792
|
case "platformColor":
|
|
792
|
-
case "radial-gradient":
|
|
793
793
|
case "rgb":
|
|
794
794
|
case "rgba":
|
|
795
|
+
case "rotate":
|
|
796
|
+
case "rotateX":
|
|
797
|
+
case "rotateY":
|
|
795
798
|
case "roundToNearestPixel":
|
|
796
799
|
case "saturate":
|
|
800
|
+
case "scale":
|
|
801
|
+
case "scaleX":
|
|
802
|
+
case "scaleY":
|
|
797
803
|
case "sepia":
|
|
798
804
|
case "shadow":
|
|
805
|
+
case "skewX":
|
|
806
|
+
case "skewY":
|
|
799
807
|
case "steps":
|
|
800
|
-
|
|
808
|
+
case "translate":
|
|
809
|
+
case "translateX":
|
|
810
|
+
case "translateY":
|
|
811
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
812
|
+
case "linear-gradient":
|
|
813
|
+
case "radial-gradient":
|
|
814
|
+
// These are special as React Native requires the '-' in their name
|
|
815
|
+
return [{}, tokenOrValue.value.name, reduceParseUnparsed(tokenOrValue.value.arguments, builder, property, allowAuto)];
|
|
801
816
|
case "hairlineWidth":
|
|
802
817
|
return [{}, tokenOrValue.value.name, []];
|
|
803
818
|
case "calc":
|
|
804
819
|
case "max":
|
|
805
820
|
case "min":
|
|
806
821
|
case "clamp":
|
|
807
|
-
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder);
|
|
822
|
+
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder, property);
|
|
808
823
|
default:
|
|
809
824
|
{
|
|
810
825
|
builder.addWarning("value", `${tokenOrValue.value.name}()`);
|
|
@@ -836,6 +851,8 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
836
851
|
return true;
|
|
837
852
|
} else if (value === "false") {
|
|
838
853
|
return false;
|
|
854
|
+
} else if (value === "infinity") {
|
|
855
|
+
return Number.MAX_SAFE_INTEGER;
|
|
839
856
|
} else {
|
|
840
857
|
return value;
|
|
841
858
|
}
|
|
@@ -853,11 +870,17 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
853
870
|
return parseDimension(tokenOrValue.value, builder);
|
|
854
871
|
case "comma":
|
|
855
872
|
return CommaSeparator;
|
|
873
|
+
case "delim":
|
|
874
|
+
{
|
|
875
|
+
if (tokenOrValue.value.value === "/") {
|
|
876
|
+
return tokenOrValue.value.value;
|
|
877
|
+
}
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
856
880
|
case "at-keyword":
|
|
857
881
|
case "hash":
|
|
858
882
|
case "id-hash":
|
|
859
883
|
case "unquoted-url":
|
|
860
|
-
case "delim":
|
|
861
884
|
case "white-space":
|
|
862
885
|
case "comment":
|
|
863
886
|
case "colon":
|
|
@@ -921,7 +944,9 @@ function parseLength(length, builder) {
|
|
|
921
944
|
} else if (length.value === -Infinity) {
|
|
922
945
|
return -9999;
|
|
923
946
|
} else {
|
|
924
|
-
|
|
947
|
+
// Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
|
|
948
|
+
const value = Math.max(Math.min(length.value, Number.MAX_SAFE_INTEGER), Number.MIN_SAFE_INTEGER);
|
|
949
|
+
return round(value);
|
|
925
950
|
}
|
|
926
951
|
}
|
|
927
952
|
case "rem":
|
|
@@ -1076,7 +1101,7 @@ function parseSize(size, builder, options, {
|
|
|
1076
1101
|
}
|
|
1077
1102
|
return;
|
|
1078
1103
|
}
|
|
1079
|
-
function
|
|
1104
|
+
function parseColorOrAutoDeclaration({
|
|
1080
1105
|
value
|
|
1081
1106
|
}, builder) {
|
|
1082
1107
|
if (value.type === "auto") {
|
|
@@ -1758,9 +1783,6 @@ function parseSVGPaint({
|
|
|
1758
1783
|
} else {
|
|
1759
1784
|
return;
|
|
1760
1785
|
}
|
|
1761
|
-
builder.addMapping({
|
|
1762
|
-
[property]: [property]
|
|
1763
|
-
});
|
|
1764
1786
|
builder.addDescriptor(property, parsedValue);
|
|
1765
1787
|
}
|
|
1766
1788
|
function round(number) {
|
|
@@ -1775,7 +1797,7 @@ function parseDimensionPercentageFor_LengthValue(value, builder) {
|
|
|
1775
1797
|
return parseLength(value.value, builder);
|
|
1776
1798
|
}
|
|
1777
1799
|
}
|
|
1778
|
-
const
|
|
1800
|
+
const allowAutoProperties = new Set(["pointer-events"]);
|
|
1779
1801
|
function parseEnv(value, builder) {
|
|
1780
1802
|
switch (value.name.type) {
|
|
1781
1803
|
case "ua":
|
|
@@ -1784,7 +1806,7 @@ function parseEnv(value, builder) {
|
|
|
1784
1806
|
case "safe-area-inset-right":
|
|
1785
1807
|
case "safe-area-inset-bottom":
|
|
1786
1808
|
case "safe-area-inset-left":
|
|
1787
|
-
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder)], 1];
|
|
1809
|
+
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder, value.name.value)], 1];
|
|
1788
1810
|
case "viewport-segment-width":
|
|
1789
1811
|
case "viewport-segment-height":
|
|
1790
1812
|
case "viewport-segment-top":
|
|
@@ -1798,14 +1820,14 @@ function parseEnv(value, builder) {
|
|
|
1798
1820
|
}
|
|
1799
1821
|
return;
|
|
1800
1822
|
}
|
|
1801
|
-
function parseCalcFn(name, tokens, builder) {
|
|
1802
|
-
const args = parseCalcArguments(tokens, builder);
|
|
1823
|
+
function parseCalcFn(name, tokens, builder, property) {
|
|
1824
|
+
const args = parseCalcArguments(tokens, builder, property);
|
|
1803
1825
|
if (args) {
|
|
1804
1826
|
return [{}, name, args];
|
|
1805
1827
|
}
|
|
1806
1828
|
return;
|
|
1807
1829
|
}
|
|
1808
|
-
function parseCalcArguments([...args], builder) {
|
|
1830
|
+
function parseCalcArguments([...args], builder, property) {
|
|
1809
1831
|
const parsed = [];
|
|
1810
1832
|
let mode;
|
|
1811
1833
|
for (const [currentIndex, arg] of args.entries()) {
|
|
@@ -1819,7 +1841,7 @@ function parseCalcArguments([...args], builder) {
|
|
|
1819
1841
|
case "function":
|
|
1820
1842
|
case "unresolved-color":
|
|
1821
1843
|
{
|
|
1822
|
-
const value = parseUnparsed(arg, builder);
|
|
1844
|
+
const value = parseUnparsed(arg, builder, property);
|
|
1823
1845
|
if (value === undefined) {
|
|
1824
1846
|
return undefined;
|
|
1825
1847
|
}
|
|
@@ -1888,7 +1910,7 @@ function parseCalcArguments([...args], builder) {
|
|
|
1888
1910
|
.splice(currentIndex, closeParenthesisIndex - currentIndex + 1)
|
|
1889
1911
|
// Then drop the surrounding parenthesis
|
|
1890
1912
|
.slice(1, -1);
|
|
1891
|
-
parsed.push(parseCalcFn("calc", innerCalcArgs, builder));
|
|
1913
|
+
parsed.push(parseCalcFn("calc", innerCalcArgs, builder, property));
|
|
1892
1914
|
break;
|
|
1893
1915
|
}
|
|
1894
1916
|
case "close-parenthesis":
|
|
@@ -1929,20 +1951,20 @@ function parseTranslateProp(value, prop, builder) {
|
|
|
1929
1951
|
}
|
|
1930
1952
|
return parseLength(value[prop], builder);
|
|
1931
1953
|
}
|
|
1932
|
-
function parseUnresolvedColor(color, builder) {
|
|
1954
|
+
function parseUnresolvedColor(color, builder, property, allowAuto) {
|
|
1933
1955
|
switch (color.type) {
|
|
1934
1956
|
case "rgb":
|
|
1935
|
-
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder)]];
|
|
1957
|
+
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder, property)]];
|
|
1936
1958
|
case "hsl":
|
|
1937
|
-
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder)]];
|
|
1959
|
+
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder, property)]];
|
|
1938
1960
|
case "light-dark":
|
|
1939
1961
|
{
|
|
1940
1962
|
const extraRule = builder.extendRule({
|
|
1941
1963
|
m: [["=", "prefers-color-scheme", "dark"]]
|
|
1942
1964
|
});
|
|
1943
|
-
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder), false, extraRule);
|
|
1965
|
+
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder, property, allowAuto), false, extraRule);
|
|
1944
1966
|
builder.addExtraRule(extraRule);
|
|
1945
|
-
return reduceParseUnparsed(color.light, builder);
|
|
1967
|
+
return reduceParseUnparsed(color.light, builder, property, allowAuto);
|
|
1946
1968
|
}
|
|
1947
1969
|
default:
|
|
1948
1970
|
color;
|
|
@@ -2101,7 +2123,7 @@ function parseGradient(gradient, builder) {
|
|
|
2101
2123
|
switch (gradient.type) {
|
|
2102
2124
|
case "linear":
|
|
2103
2125
|
{
|
|
2104
|
-
return [{}, "
|
|
2126
|
+
return [{}, "linear-gradient", [parseLineDirection(gradient.direction, builder), ...gradient.items.map(item => parseGradientItem(item, builder))]];
|
|
2105
2127
|
}
|
|
2106
2128
|
}
|
|
2107
2129
|
return;
|
|
@@ -2158,6 +2180,7 @@ function parseFilter(declaration, builder) {
|
|
|
2158
2180
|
[value.type]: parseAngle(value.value, builder)
|
|
2159
2181
|
};
|
|
2160
2182
|
case "drop-shadow":
|
|
2183
|
+
return [{}, (0, _selectors.toRNProperty)(value.type), [parseLength(value.value.xOffset, builder), parseLength(value.value.yOffset, builder), parseLength(value.value.blur, builder), parseColor(value.value.color, builder)]];
|
|
2161
2184
|
case "url":
|
|
2162
2185
|
return;
|
|
2163
2186
|
}
|