react-native-css 3.0.0-nightly.fa5e95b → 3.0.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +323 -176
- 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 +63 -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 -18
- 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 +29 -4
- 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 -25
- 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 +11 -9
- 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 +18 -0
- 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 +29 -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 +314 -172
- 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 +61 -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 +23 -18
- 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 +23 -4
- 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 -24
- 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 +12 -9
- 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 +18 -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 +25 -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 +26 -17
- 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 +16 -2
- 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 -11
- 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/units.d.ts.map +1 -1
- 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 +9 -3
- 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 +26 -17
- 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 +16 -2
- 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 -11
- 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/units.d.ts.map +1 -1
- 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 +9 -3
- 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 +30 -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 +518 -215
- 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 +93 -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 +26 -17
- 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 → api.tsx} +34 -5
- 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 -33
- 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 +14 -9
- 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 → api.tsx} +29 -3
- package/src/style-collection/index.ts +142 -0
- package/src/style-collection/root.ts +37 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
// cSpell:ignore rcap,vmin,svmin,lvmin,dvmin,cqmin,vmax,svmax,lvmax,dvmax,cqmax,currentcolor,oklab,oklch,prophoto
|
|
3
|
+
// cSpell:ignore rcap,vmin,svmin,lvmin,dvmin,cqmin,vmax,svmax,lvmax,dvmax,cqmax,currentcolor,oklab,oklch,prophoto,squircle,oldstyle,nums
|
|
4
4
|
|
|
5
5
|
import Color from "colorjs.io";
|
|
6
6
|
import { parseEasingFunction, parseIterationCount } from "./keyframes.js";
|
|
@@ -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,
|
|
@@ -24,42 +26,51 @@ const parsers = {
|
|
|
24
26
|
"animation-play-state": addAnimationValue,
|
|
25
27
|
"animation-timing-function": addAnimationValue,
|
|
26
28
|
"aspect-ratio": parseAspectRatio,
|
|
29
|
+
"backface-visibility": parseBackfaceVisibility,
|
|
27
30
|
"background-color": parseColorDeclaration,
|
|
28
31
|
"background-image": parseBackgroundImage,
|
|
29
32
|
"block-size": parseSizeDeclaration,
|
|
30
33
|
"border": parseBorder,
|
|
31
34
|
"border-block": parseBorderBlock,
|
|
32
|
-
"border-block-color":
|
|
35
|
+
"border-block-color": parseBorderColor,
|
|
33
36
|
"border-block-end": parseBorderBlockEnd,
|
|
34
37
|
"border-block-end-color": parseColorDeclaration,
|
|
35
38
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
36
39
|
"border-block-start": parseBorderBlockStart,
|
|
37
40
|
"border-block-start-color": parseColorDeclaration,
|
|
41
|
+
"border-block-start-style": parseBorderStyleDeclaration,
|
|
38
42
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
43
|
+
"border-block-style": parseBorderBlockStyle,
|
|
39
44
|
"border-block-width": parseBorderBlockWidth,
|
|
40
45
|
"border-bottom": parseBorderSide,
|
|
41
46
|
"border-bottom-color": parseColorDeclaration,
|
|
42
47
|
"border-bottom-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
43
48
|
"border-bottom-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
49
|
+
"border-bottom-style": parseBorderStyleDeclaration,
|
|
44
50
|
"border-bottom-width": parseBorderSideWidthDeclaration,
|
|
45
51
|
"border-color": parseBorderColor,
|
|
46
52
|
"border-end-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
47
53
|
"border-end-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
48
54
|
"border-inline": parseBorderInline,
|
|
49
|
-
"border-inline-color":
|
|
55
|
+
"border-inline-color": parseBorderColor,
|
|
50
56
|
"border-inline-end": parseBorderInlineEnd,
|
|
51
57
|
"border-inline-end-color": parseColorDeclaration,
|
|
58
|
+
"border-inline-end-style": parseBorderInlineStyle,
|
|
52
59
|
"border-inline-end-width": parseBorderSideWidthDeclaration,
|
|
53
60
|
"border-inline-start": parseBorderInlineStart,
|
|
54
61
|
"border-inline-start-color": parseColorDeclaration,
|
|
62
|
+
"border-inline-start-style": parseBorderInlineStyle,
|
|
55
63
|
"border-inline-start-width": parseBorderSideWidthDeclaration,
|
|
64
|
+
"border-inline-style": parseBorderInlineStyle,
|
|
56
65
|
"border-inline-width": parseBorderInlineWidth,
|
|
57
66
|
"border-left": parseBorderSide,
|
|
58
67
|
"border-left-color": parseColorDeclaration,
|
|
68
|
+
"border-left-style": parseBorderStyleDeclaration,
|
|
59
69
|
"border-left-width": parseBorderSideWidthDeclaration,
|
|
60
70
|
"border-radius": parseBorderRadius,
|
|
61
71
|
"border-right": parseBorderSide,
|
|
62
72
|
"border-right-color": parseColorDeclaration,
|
|
73
|
+
"border-right-style": parseBorderStyleDeclaration,
|
|
63
74
|
"border-right-width": parseBorderSideWidthDeclaration,
|
|
64
75
|
"border-start-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
65
76
|
"border-start-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
@@ -68,21 +79,24 @@ const parsers = {
|
|
|
68
79
|
"border-top-color": parseColorDeclaration,
|
|
69
80
|
"border-top-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
70
81
|
"border-top-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
82
|
+
"border-top-style": parseBorderStyleDeclaration,
|
|
71
83
|
"border-top-width": parseBorderSideWidthDeclaration,
|
|
72
84
|
"border-width": parseBorderWidth,
|
|
73
|
-
"bottom":
|
|
85
|
+
"bottom": parseSizeWithAutoDeclaration,
|
|
74
86
|
"box-shadow": parseBoxShadow,
|
|
75
|
-
"
|
|
87
|
+
"box-sizing": parseBoxSizing,
|
|
88
|
+
"caret-color": parseColorOrAutoDeclaration,
|
|
76
89
|
"color": parseFontColorDeclaration,
|
|
77
90
|
"column-gap": parseGap,
|
|
78
91
|
"container": parseContainer,
|
|
79
92
|
"container-name": parseContainerName,
|
|
80
93
|
"container-type": parseContainerType,
|
|
81
94
|
"display": parseDisplay,
|
|
95
|
+
"direction": parseDirection,
|
|
82
96
|
"fill": parseSVGPaint,
|
|
83
97
|
"filter": parseFilter,
|
|
84
98
|
"flex": parseFlex,
|
|
85
|
-
"flex-basis":
|
|
99
|
+
"flex-basis": parseLengthPercentageDeclaration,
|
|
86
100
|
"flex-direction": ({
|
|
87
101
|
value
|
|
88
102
|
}) => value,
|
|
@@ -107,26 +121,26 @@ const parsers = {
|
|
|
107
121
|
"inline-size": parseSizeDeclaration,
|
|
108
122
|
"inset": parseInset,
|
|
109
123
|
"inset-block": parseInsetBlock,
|
|
110
|
-
"inset-block-end":
|
|
111
|
-
"inset-block-start":
|
|
124
|
+
"inset-block-end": parseLengthPercentageDeclaration,
|
|
125
|
+
"inset-block-start": parseLengthPercentageDeclaration,
|
|
112
126
|
"inset-inline": parseInsetInline,
|
|
113
|
-
"inset-inline-end":
|
|
114
|
-
"inset-inline-start":
|
|
127
|
+
"inset-inline-end": parseLengthPercentageDeclaration,
|
|
128
|
+
"inset-inline-start": parseLengthPercentageDeclaration,
|
|
115
129
|
"justify-content": parseJustifyContent,
|
|
116
|
-
"left":
|
|
130
|
+
"left": parseSizeWithAutoDeclaration,
|
|
117
131
|
"letter-spacing": parseLetterSpacing,
|
|
118
132
|
"line-height": parseLineHeightDeclaration,
|
|
119
133
|
"margin": parseMargin,
|
|
120
134
|
"margin-block": parseMarginBlock,
|
|
121
135
|
"margin-block-end": parseLengthPercentageOrAutoDeclaration,
|
|
122
136
|
"margin-block-start": parseLengthPercentageOrAutoDeclaration,
|
|
123
|
-
"margin-bottom":
|
|
137
|
+
"margin-bottom": parseSizeWithAutoDeclaration,
|
|
124
138
|
"margin-inline": parseMarginInline,
|
|
125
139
|
"margin-inline-end": parseLengthPercentageOrAutoDeclaration,
|
|
126
140
|
"margin-inline-start": parseLengthPercentageOrAutoDeclaration,
|
|
127
|
-
"margin-left":
|
|
128
|
-
"margin-right":
|
|
129
|
-
"margin-top":
|
|
141
|
+
"margin-left": parseSizeWithAutoDeclaration,
|
|
142
|
+
"margin-right": parseSizeWithAutoDeclaration,
|
|
143
|
+
"margin-top": parseSizeWithAutoDeclaration,
|
|
130
144
|
"max-block-size": parseSizeDeclaration,
|
|
131
145
|
"max-height": parseSizeDeclaration,
|
|
132
146
|
"max-inline-size": parseSizeDeclaration,
|
|
@@ -137,21 +151,24 @@ const parsers = {
|
|
|
137
151
|
"min-width": parseSizeDeclaration,
|
|
138
152
|
"opacity": ({
|
|
139
153
|
value
|
|
140
|
-
}) => value,
|
|
154
|
+
}) => round(value),
|
|
155
|
+
"outline-color": parseColorDeclaration,
|
|
156
|
+
"outline-style": parseOutlineStyle,
|
|
157
|
+
"outline-width": parseBorderSideWidthDeclaration,
|
|
141
158
|
"overflow": parseOverflow,
|
|
142
159
|
"padding": parsePadding,
|
|
143
160
|
"padding-block": parsePaddingBlock,
|
|
144
|
-
"padding-block-end":
|
|
145
|
-
"padding-block-start":
|
|
161
|
+
"padding-block-end": parseLengthPercentageDeclaration,
|
|
162
|
+
"padding-block-start": parseLengthPercentageDeclaration,
|
|
146
163
|
"padding-bottom": parseSizeDeclaration,
|
|
147
164
|
"padding-inline": parsePaddingInline,
|
|
148
|
-
"padding-inline-end":
|
|
149
|
-
"padding-inline-start":
|
|
165
|
+
"padding-inline-end": parseLengthPercentageDeclaration,
|
|
166
|
+
"padding-inline-start": parseLengthPercentageDeclaration,
|
|
150
167
|
"padding-left": parseSizeDeclaration,
|
|
151
168
|
"padding-right": parseSizeDeclaration,
|
|
152
169
|
"padding-top": parseSizeDeclaration,
|
|
153
170
|
"position": parsePosition,
|
|
154
|
-
"right":
|
|
171
|
+
"right": parseSizeWithAutoDeclaration,
|
|
155
172
|
"rotate": parseRotate,
|
|
156
173
|
"row-gap": parseGap,
|
|
157
174
|
"scale": parseScale,
|
|
@@ -166,7 +183,7 @@ const parsers = {
|
|
|
166
183
|
"text-transform": ({
|
|
167
184
|
value
|
|
168
185
|
}) => value.case,
|
|
169
|
-
"top":
|
|
186
|
+
"top": parseSizeWithAutoDeclaration,
|
|
170
187
|
"transform": parseTransform,
|
|
171
188
|
"transition": addTransitionValue,
|
|
172
189
|
"transition-delay": addTransitionValue,
|
|
@@ -176,6 +193,7 @@ const parsers = {
|
|
|
176
193
|
"translate": parseTranslate,
|
|
177
194
|
"user-select": parseUserSelect,
|
|
178
195
|
"vertical-align": parseVerticalAlign,
|
|
196
|
+
"visibility": parseVisibility,
|
|
179
197
|
"width": parseSizeDeclaration,
|
|
180
198
|
"z-index": parseZIndex
|
|
181
199
|
};
|
|
@@ -191,9 +209,9 @@ export function parseDeclaration(declaration, builder) {
|
|
|
191
209
|
return;
|
|
192
210
|
}
|
|
193
211
|
if (declaration.property === "unparsed") {
|
|
194
|
-
|
|
212
|
+
parseUnparsedDeclaration(declaration, builder);
|
|
195
213
|
} else if (declaration.property === "custom") {
|
|
196
|
-
|
|
214
|
+
parseCustomDeclaration(declaration, builder);
|
|
197
215
|
} else {
|
|
198
216
|
parseWithParser(declaration, builder);
|
|
199
217
|
}
|
|
@@ -247,15 +265,25 @@ function parseBorderRadius({
|
|
|
247
265
|
"border-top-right-radius": parseSize2DDimensionPercentage(value.topRight, builder)
|
|
248
266
|
});
|
|
249
267
|
}
|
|
250
|
-
function parseBorderColor({
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
268
|
+
function parseBorderColor(declaration, builder) {
|
|
269
|
+
switch (declaration.property) {
|
|
270
|
+
case "border-color":
|
|
271
|
+
builder.addShorthand("border-color", {
|
|
272
|
+
"border-top-color": parseColor(declaration.value.top, builder),
|
|
273
|
+
"border-bottom-color": parseColor(declaration.value.bottom, builder),
|
|
274
|
+
"border-left-color": parseColor(declaration.value.left, builder),
|
|
275
|
+
"border-right-color": parseColor(declaration.value.right, builder)
|
|
276
|
+
});
|
|
277
|
+
break;
|
|
278
|
+
case "border-block-color":
|
|
279
|
+
builder.addDescriptor("border-top-color", parseColor(declaration.value.start, builder));
|
|
280
|
+
builder.addDescriptor("border-bottom-color", parseColor(declaration.value.end, builder));
|
|
281
|
+
break;
|
|
282
|
+
case "border-inline-color":
|
|
283
|
+
builder.addDescriptor("border-left-color", parseColor(declaration.value.start, builder));
|
|
284
|
+
builder.addDescriptor("border-right-color", parseColor(declaration.value.end, builder));
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
259
287
|
}
|
|
260
288
|
function parseBorderWidth({
|
|
261
289
|
value
|
|
@@ -286,46 +314,55 @@ function parseBorderSide({
|
|
|
286
314
|
function parseBorderBlock({
|
|
287
315
|
value
|
|
288
316
|
}, builder) {
|
|
289
|
-
builder.addDescriptor("border-
|
|
290
|
-
builder.addDescriptor("border-
|
|
291
|
-
builder.addDescriptor("border-
|
|
292
|
-
builder.addDescriptor("border-bottom-width", parseBorderSideWidth(value.width, builder));
|
|
317
|
+
builder.addDescriptor("border-block-color", parseColor(value.color, builder));
|
|
318
|
+
builder.addDescriptor("border-block-width", parseBorderSideWidth(value.width, builder));
|
|
319
|
+
builder.addDescriptor("border-block-style", parseBorderStyle(value.style, builder));
|
|
293
320
|
}
|
|
294
321
|
function parseBorderBlockStart({
|
|
295
322
|
value
|
|
296
323
|
}, builder) {
|
|
297
|
-
builder.addDescriptor("border-
|
|
298
|
-
builder.addDescriptor("border-
|
|
324
|
+
builder.addDescriptor("border-block-start-color", parseColor(value.color, builder));
|
|
325
|
+
builder.addDescriptor("border-block-start-width", parseBorderSideWidth(value.width, builder));
|
|
299
326
|
}
|
|
300
327
|
function parseBorderBlockEnd({
|
|
301
328
|
value
|
|
302
329
|
}, builder) {
|
|
303
|
-
builder.addDescriptor("border-
|
|
304
|
-
builder.addDescriptor("border-
|
|
330
|
+
builder.addDescriptor("border-block-end-color", parseColor(value.color, builder));
|
|
331
|
+
builder.addDescriptor("border-block-end-width", parseBorderSideWidth(value.width, builder));
|
|
305
332
|
}
|
|
306
333
|
function parseBorderInline({
|
|
307
334
|
value
|
|
308
335
|
}, builder) {
|
|
309
|
-
builder.addDescriptor("border-
|
|
310
|
-
builder.addDescriptor("border-
|
|
311
|
-
builder.addDescriptor("border-
|
|
312
|
-
builder.addDescriptor("border-right-width", parseBorderSideWidth(value.width, builder));
|
|
336
|
+
builder.addDescriptor("border-inline-color", parseColor(value.color, builder));
|
|
337
|
+
builder.addDescriptor("border-inline-width", parseBorderSideWidth(value.width, builder));
|
|
338
|
+
builder.addDescriptor("border-inline-style", parseBorderStyle(value.style, builder));
|
|
313
339
|
}
|
|
314
340
|
function parseBorderInlineStart({
|
|
315
341
|
value
|
|
316
342
|
}, builder) {
|
|
317
|
-
builder.addDescriptor("border-
|
|
318
|
-
builder.addDescriptor("border-
|
|
343
|
+
builder.addDescriptor("border-inline-start-color", parseColor(value.color, builder));
|
|
344
|
+
builder.addDescriptor("border-inline-start-width", parseBorderSideWidth(value.width, builder));
|
|
345
|
+
builder.addDescriptor("border-inline-start-style", parseBorderStyle(value.style, builder));
|
|
319
346
|
}
|
|
320
347
|
function parseBorderInlineEnd({
|
|
321
348
|
value
|
|
322
349
|
}, builder) {
|
|
323
|
-
builder.addDescriptor("border-
|
|
324
|
-
builder.addDescriptor("border-
|
|
350
|
+
builder.addDescriptor("border-inline-end-color", parseColor(value.color, builder));
|
|
351
|
+
builder.addDescriptor("border-inline-end-width", parseBorderSideWidth(value.width, builder));
|
|
352
|
+
builder.addDescriptor("border-inline-end-style", parseBorderStyle(value.style, builder));
|
|
325
353
|
}
|
|
326
354
|
export function parseBorderInlineWidth(declaration, builder) {
|
|
327
|
-
builder.addDescriptor("border-
|
|
328
|
-
|
|
355
|
+
builder.addDescriptor("border-inline-width", parseBorderSideWidth(declaration.value.start, builder));
|
|
356
|
+
}
|
|
357
|
+
export function parseBorderInlineStyle(declaration, builder) {
|
|
358
|
+
if (typeof declaration.value === "string") {
|
|
359
|
+
builder.addDescriptor(declaration.property, parseBorderStyle(declaration.value, builder));
|
|
360
|
+
} else if (declaration.value.start === declaration.value.end) {
|
|
361
|
+
builder.addDescriptor(declaration.property, parseBorderStyle(declaration.value.start, builder));
|
|
362
|
+
} else {
|
|
363
|
+
builder.addDescriptor("border-inline-start-style", parseBorderStyle(declaration.value.start, builder));
|
|
364
|
+
builder.addDescriptor("border-inline-end-style", parseBorderStyle(declaration.value.end, builder));
|
|
365
|
+
}
|
|
329
366
|
}
|
|
330
367
|
function parseFlexFlow({
|
|
331
368
|
value
|
|
@@ -362,16 +399,24 @@ function parseMarginBlock({
|
|
|
362
399
|
value
|
|
363
400
|
}, builder) {
|
|
364
401
|
builder.addShorthand("margin-block", {
|
|
365
|
-
"margin-block-start": parseLengthPercentageOrAuto(value.blockStart, builder
|
|
366
|
-
|
|
402
|
+
"margin-block-start": parseLengthPercentageOrAuto(value.blockStart, builder, {
|
|
403
|
+
allowAuto: true
|
|
404
|
+
}),
|
|
405
|
+
"margin-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder, {
|
|
406
|
+
allowAuto: true
|
|
407
|
+
})
|
|
367
408
|
});
|
|
368
409
|
}
|
|
369
410
|
function parseMarginInline({
|
|
370
411
|
value
|
|
371
412
|
}, builder) {
|
|
372
413
|
builder.addShorthand("margin-inline", {
|
|
373
|
-
"margin-inline-start": parseLengthPercentageOrAuto(value.inlineStart, builder
|
|
374
|
-
|
|
414
|
+
"margin-inline-start": parseLengthPercentageOrAuto(value.inlineStart, builder, {
|
|
415
|
+
allowAuto: true
|
|
416
|
+
}),
|
|
417
|
+
"margin-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder, {
|
|
418
|
+
allowAuto: true
|
|
419
|
+
})
|
|
375
420
|
});
|
|
376
421
|
}
|
|
377
422
|
function parsePadding({
|
|
@@ -413,26 +458,26 @@ function parseFont({
|
|
|
413
458
|
function parseTransform({
|
|
414
459
|
value
|
|
415
460
|
}, builder) {
|
|
416
|
-
builder.addDescriptor("transform", [{}, "
|
|
461
|
+
builder.addDescriptor("transform", [{}, "transform", value.flatMap(t => {
|
|
417
462
|
switch (t.type) {
|
|
418
463
|
case "perspective":
|
|
419
|
-
return [[{}, "
|
|
464
|
+
return [[{}, "perspective", parseLength(t.value, builder)]];
|
|
420
465
|
case "translate":
|
|
421
|
-
return [[{}, "
|
|
466
|
+
return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value[0], builder)], [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value[1], builder)]]];
|
|
422
467
|
case "translateX":
|
|
423
|
-
return [[{}, "
|
|
468
|
+
return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
|
|
424
469
|
case "translateY":
|
|
425
|
-
return [[{}, "
|
|
470
|
+
return [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
|
|
426
471
|
case "rotate":
|
|
427
|
-
return [[{}, "
|
|
472
|
+
return [[{}, "rotate", parseAngle(t.value, builder)]];
|
|
428
473
|
case "rotateX":
|
|
429
|
-
return [[{}, "
|
|
474
|
+
return [[{}, "rotateX", parseAngle(t.value, builder)]];
|
|
430
475
|
case "rotateY":
|
|
431
|
-
return [[{}, "
|
|
476
|
+
return [[{}, "rotateY", parseAngle(t.value, builder)]];
|
|
432
477
|
case "rotateZ":
|
|
433
|
-
return [[{}, "
|
|
478
|
+
return [[{}, "rotateZ", parseAngle(t.value, builder)]];
|
|
434
479
|
case "scale":
|
|
435
|
-
return [[{}, "
|
|
480
|
+
return [[{}, "scaleX", parseLength(t.value[0], builder)], [{}, "scaleY", parseLength(t.value[1], builder)]];
|
|
436
481
|
case "scaleX":
|
|
437
482
|
return [[{}, "scaleX", parseLength(t.value, builder)]];
|
|
438
483
|
case "scaleY":
|
|
@@ -464,9 +509,15 @@ function parseTranslate({
|
|
|
464
509
|
function parseRotate({
|
|
465
510
|
value
|
|
466
511
|
}, builder) {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
512
|
+
if (value.x) {
|
|
513
|
+
builder.addDescriptor("rotateX", [{}, "rotateX", parseAngle(value.angle, builder)]);
|
|
514
|
+
}
|
|
515
|
+
if (value.y) {
|
|
516
|
+
builder.addDescriptor("rotateY", [{}, "rotateY", parseAngle(value.angle, builder)]);
|
|
517
|
+
}
|
|
518
|
+
if (value.z) {
|
|
519
|
+
builder.addDescriptor("rotateZ", [{}, "rotateZ", parseAngle(value.angle, builder)]);
|
|
520
|
+
}
|
|
470
521
|
}
|
|
471
522
|
function parseScale({
|
|
472
523
|
value
|
|
@@ -508,7 +559,8 @@ function parseZIndex({
|
|
|
508
559
|
return;
|
|
509
560
|
}
|
|
510
561
|
}
|
|
511
|
-
function parseContainerType(
|
|
562
|
+
function parseContainerType(_declaration, builder) {
|
|
563
|
+
builder.addContainer(["___default___"]);
|
|
512
564
|
return;
|
|
513
565
|
}
|
|
514
566
|
function parseContainerName({
|
|
@@ -523,7 +575,7 @@ function parseContainer({
|
|
|
523
575
|
builder.addContainer(value.name.type === "none" ? false : value.name.value);
|
|
524
576
|
return;
|
|
525
577
|
}
|
|
526
|
-
export function
|
|
578
|
+
export function parseUnparsedDeclaration(declaration, builder) {
|
|
527
579
|
let property = declaration.value.propertyId.property;
|
|
528
580
|
if (!(property in parsers)) {
|
|
529
581
|
builder.addWarning("property", property);
|
|
@@ -544,14 +596,14 @@ export function parseDeclarationUnparsed(declaration, builder) {
|
|
|
544
596
|
*/
|
|
545
597
|
builder.descriptorProperty = property;
|
|
546
598
|
if (unparsedRuntimeParsing.has(property)) {
|
|
547
|
-
const args = parseUnparsed(declaration.value.value, builder);
|
|
599
|
+
const args = parseUnparsed(declaration.value.value, builder, property);
|
|
548
600
|
if (property === "animation") {
|
|
549
|
-
builder.addDescriptor("animation", [{},
|
|
601
|
+
builder.addDescriptor("animation", [{}, property, args]);
|
|
550
602
|
} else {
|
|
551
|
-
builder.addDescriptor(property, [{},
|
|
603
|
+
builder.addDescriptor(property, [{}, toRNProperty(property), args, 1]);
|
|
552
604
|
}
|
|
553
605
|
} else {
|
|
554
|
-
const value = parseUnparsed(declaration.value.value, builder);
|
|
606
|
+
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
555
607
|
builder.addDescriptor(property, value);
|
|
556
608
|
if (property === "font-size") {
|
|
557
609
|
builder.addDescriptor("--__rn-css-em", value);
|
|
@@ -561,22 +613,31 @@ export function parseDeclarationUnparsed(declaration, builder) {
|
|
|
561
613
|
}
|
|
562
614
|
}
|
|
563
615
|
}
|
|
564
|
-
export function
|
|
616
|
+
export function parseCustomDeclaration(declaration, builder) {
|
|
565
617
|
const property = declaration.value.name;
|
|
566
|
-
if (
|
|
567
|
-
builder.
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
618
|
+
if (property === "-webkit-line-clamp") {
|
|
619
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
620
|
+
} else if (property === "-rn-ripple-style") {
|
|
621
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property) === "borderless");
|
|
622
|
+
} else if (property === "object-fit") {
|
|
623
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1046
|
|
624
|
+
parseObjectFit(declaration.value, builder);
|
|
625
|
+
} else if (property === "object-position") {
|
|
626
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1047
|
|
627
|
+
parseObjectPosition(declaration.value, builder);
|
|
628
|
+
} else if (property === "outline-offset") {
|
|
629
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1048
|
|
630
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
631
|
+
} else if (property === "corner-shape") {
|
|
632
|
+
parseCornerShape(declaration.value, builder);
|
|
633
|
+
} else if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
|
|
634
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
574
635
|
} else {
|
|
575
636
|
builder.addWarning("property", declaration.value.name);
|
|
576
637
|
}
|
|
577
638
|
}
|
|
578
|
-
export function reduceParseUnparsed(tokenOrValues, builder) {
|
|
579
|
-
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder)).filter(v => v !== undefined);
|
|
639
|
+
export function reduceParseUnparsed(tokenOrValues, builder, property, allowAuto) {
|
|
640
|
+
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder, property, allowAuto)).filter(v => v !== undefined);
|
|
580
641
|
if (result.length === 0) {
|
|
581
642
|
return undefined;
|
|
582
643
|
}
|
|
@@ -590,6 +651,9 @@ export function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
590
651
|
currentGroup.push(value);
|
|
591
652
|
}
|
|
592
653
|
}
|
|
654
|
+
|
|
655
|
+
// Groups are the tokens grouped together by comma location
|
|
656
|
+
// If a group only has 1 item, it shouldn't be an array
|
|
593
657
|
groups = groups.flatMap(group => {
|
|
594
658
|
if (!Array.isArray(group)) {
|
|
595
659
|
return [];
|
|
@@ -603,21 +667,26 @@ export function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
603
667
|
} else {
|
|
604
668
|
return [first];
|
|
605
669
|
}
|
|
670
|
+
} else if (
|
|
671
|
+
// This is a special case for <ratio> values
|
|
672
|
+
group.includes("/") && group.every(item => typeof item === "string" && item === "/" ? item : typeof item === "number")) {
|
|
673
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
674
|
+
return [group.join(" ")];
|
|
606
675
|
} else {
|
|
607
676
|
return [group];
|
|
608
677
|
}
|
|
609
678
|
});
|
|
610
679
|
return groups.length === 1 ? groups[0] : groups;
|
|
611
680
|
}
|
|
612
|
-
export function unparsedFunction(token, builder) {
|
|
613
|
-
return [{}, token.value.name, reduceParseUnparsed(token.value.arguments, builder)];
|
|
681
|
+
export function unparsedFunction(token, builder, property, allowAuto) {
|
|
682
|
+
return [{}, toRNProperty(token.value.name), reduceParseUnparsed(token.value.arguments, builder, property, allowAuto)];
|
|
614
683
|
}
|
|
615
684
|
|
|
616
685
|
/**
|
|
617
686
|
* When the CSS cannot be parsed (often due to a runtime condition like a CSS variable)
|
|
618
687
|
* This export function best efforts parsing it into a export function that we can evaluate at runtime
|
|
619
688
|
*/
|
|
620
|
-
export function parseUnparsed(tokenOrValue, builder, allowAuto =
|
|
689
|
+
export function parseUnparsed(tokenOrValue, builder, property, allowAuto = allowAutoProperties.has(property)) {
|
|
621
690
|
if (tokenOrValue === undefined || tokenOrValue === null) {
|
|
622
691
|
return;
|
|
623
692
|
}
|
|
@@ -636,7 +705,7 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
636
705
|
return round(tokenOrValue);
|
|
637
706
|
}
|
|
638
707
|
if (Array.isArray(tokenOrValue)) {
|
|
639
|
-
const args = reduceParseUnparsed(tokenOrValue, builder);
|
|
708
|
+
const args = reduceParseUnparsed(tokenOrValue, builder, property, allowAuto);
|
|
640
709
|
if (!args) return;
|
|
641
710
|
if (Array.isArray(args) && args.length === 1) return args[0];
|
|
642
711
|
return args;
|
|
@@ -644,12 +713,12 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
644
713
|
switch (tokenOrValue.type) {
|
|
645
714
|
case "unresolved-color":
|
|
646
715
|
{
|
|
647
|
-
return parseUnresolvedColor(tokenOrValue.value, builder);
|
|
716
|
+
return parseUnresolvedColor(tokenOrValue.value, builder, property, allowAuto);
|
|
648
717
|
}
|
|
649
718
|
case "var":
|
|
650
719
|
{
|
|
651
720
|
let args = tokenOrValue.value.name.ident.slice(2);
|
|
652
|
-
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder);
|
|
721
|
+
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder, property, allowAuto);
|
|
653
722
|
if (fallback !== undefined) {
|
|
654
723
|
args = [args, fallback];
|
|
655
724
|
}
|
|
@@ -658,50 +727,51 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
658
727
|
case "function":
|
|
659
728
|
{
|
|
660
729
|
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);
|
|
730
|
+
case "blur":
|
|
674
731
|
case "brightness":
|
|
675
732
|
case "contrast":
|
|
676
733
|
case "cubic-bezier":
|
|
677
734
|
case "drop-shadow":
|
|
678
735
|
case "fontScale":
|
|
736
|
+
case "getPixelSizeForLayoutSize":
|
|
679
737
|
case "grayscale":
|
|
680
738
|
case "hsl":
|
|
681
739
|
case "hsla":
|
|
682
740
|
case "hue-rotate":
|
|
683
741
|
case "invert":
|
|
684
|
-
case "linear-gradient":
|
|
685
742
|
case "opacity":
|
|
686
743
|
case "pixelScale":
|
|
687
|
-
case "pixelSizeForLayoutSize":
|
|
688
744
|
case "platformColor":
|
|
689
|
-
case "radial-gradient":
|
|
690
745
|
case "rgb":
|
|
691
746
|
case "rgba":
|
|
747
|
+
case "rotate":
|
|
748
|
+
case "rotateX":
|
|
749
|
+
case "rotateY":
|
|
692
750
|
case "roundToNearestPixel":
|
|
693
751
|
case "saturate":
|
|
752
|
+
case "scale":
|
|
753
|
+
case "scaleX":
|
|
754
|
+
case "scaleY":
|
|
694
755
|
case "sepia":
|
|
695
756
|
case "shadow":
|
|
757
|
+
case "skewX":
|
|
758
|
+
case "skewY":
|
|
696
759
|
case "steps":
|
|
697
|
-
|
|
760
|
+
case "translate":
|
|
761
|
+
case "translateX":
|
|
762
|
+
case "translateY":
|
|
763
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
764
|
+
case "linear-gradient":
|
|
765
|
+
case "radial-gradient":
|
|
766
|
+
// These are special as React Native requires the '-' in their name
|
|
767
|
+
return [{}, tokenOrValue.value.name, reduceParseUnparsed(tokenOrValue.value.arguments, builder, property, allowAuto)];
|
|
698
768
|
case "hairlineWidth":
|
|
699
769
|
return [{}, tokenOrValue.value.name, []];
|
|
700
770
|
case "calc":
|
|
701
771
|
case "max":
|
|
702
772
|
case "min":
|
|
703
773
|
case "clamp":
|
|
704
|
-
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder);
|
|
774
|
+
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder, property);
|
|
705
775
|
default:
|
|
706
776
|
{
|
|
707
777
|
builder.addWarning("value", `${tokenOrValue.value.name}()`);
|
|
@@ -723,7 +793,7 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
723
793
|
builder.addWarning("value", value);
|
|
724
794
|
return;
|
|
725
795
|
}
|
|
726
|
-
if (value === "inherit") {
|
|
796
|
+
if (value === "inherit" || value === "initial") {
|
|
727
797
|
builder.addWarning("value", value);
|
|
728
798
|
return;
|
|
729
799
|
} else if (value === "currentcolor") {
|
|
@@ -733,6 +803,8 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
733
803
|
return true;
|
|
734
804
|
} else if (value === "false") {
|
|
735
805
|
return false;
|
|
806
|
+
} else if (value === "infinity") {
|
|
807
|
+
return Number.MAX_SAFE_INTEGER;
|
|
736
808
|
} else {
|
|
737
809
|
return value;
|
|
738
810
|
}
|
|
@@ -750,11 +822,17 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
750
822
|
return parseDimension(tokenOrValue.value, builder);
|
|
751
823
|
case "comma":
|
|
752
824
|
return CommaSeparator;
|
|
825
|
+
case "delim":
|
|
826
|
+
{
|
|
827
|
+
if (tokenOrValue.value.value === "/") {
|
|
828
|
+
return tokenOrValue.value.value;
|
|
829
|
+
}
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
753
832
|
case "at-keyword":
|
|
754
833
|
case "hash":
|
|
755
834
|
case "id-hash":
|
|
756
835
|
case "unquoted-url":
|
|
757
|
-
case "delim":
|
|
758
836
|
case "white-space":
|
|
759
837
|
case "comment":
|
|
760
838
|
case "colon":
|
|
@@ -818,7 +896,9 @@ export function parseLength(length, builder) {
|
|
|
818
896
|
} else if (length.value === -Infinity) {
|
|
819
897
|
return -9999;
|
|
820
898
|
} else {
|
|
821
|
-
|
|
899
|
+
// Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
|
|
900
|
+
const value = Math.max(Math.min(length.value, Number.MAX_SAFE_INTEGER), Number.MIN_SAFE_INTEGER);
|
|
901
|
+
return round(value);
|
|
822
902
|
}
|
|
823
903
|
}
|
|
824
904
|
case "rem":
|
|
@@ -922,6 +1002,11 @@ export function parseAngle(angle, builder) {
|
|
|
922
1002
|
export function parseSizeDeclaration(declaration, builder) {
|
|
923
1003
|
return parseSize(declaration.value, builder);
|
|
924
1004
|
}
|
|
1005
|
+
export function parseSizeWithAutoDeclaration(declaration, builder) {
|
|
1006
|
+
return parseSize(declaration.value, builder, {
|
|
1007
|
+
allowAuto: true
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
925
1010
|
export function parsePointerEvents({
|
|
926
1011
|
value
|
|
927
1012
|
}, builder) {
|
|
@@ -973,7 +1058,7 @@ export function parseSize(size, builder, options, {
|
|
|
973
1058
|
}
|
|
974
1059
|
return;
|
|
975
1060
|
}
|
|
976
|
-
export function
|
|
1061
|
+
export function parseColorOrAutoDeclaration({
|
|
977
1062
|
value
|
|
978
1063
|
}, builder) {
|
|
979
1064
|
if (value.type === "auto") {
|
|
@@ -1137,9 +1222,14 @@ export function parseColor(cssColor, builder) {
|
|
|
1137
1222
|
});
|
|
1138
1223
|
}
|
|
1139
1224
|
}
|
|
1140
|
-
export function
|
|
1225
|
+
export function parseLengthPercentageDeclaration(value, builder) {
|
|
1141
1226
|
return parseLengthPercentageOrAuto(value.value, builder);
|
|
1142
1227
|
}
|
|
1228
|
+
export function parseLengthPercentageOrAutoDeclaration(value, builder) {
|
|
1229
|
+
return parseLengthPercentageOrAuto(value.value, builder, {
|
|
1230
|
+
allowAuto: true
|
|
1231
|
+
});
|
|
1232
|
+
}
|
|
1143
1233
|
export function parseLengthPercentageOrAuto(lengthPercentageOrAuto, builder, {
|
|
1144
1234
|
allowAuto = false
|
|
1145
1235
|
} = {}) {
|
|
@@ -1363,19 +1453,28 @@ export function parseBorderStyle(value, builder) {
|
|
|
1363
1453
|
builder.addWarning("value", value.top);
|
|
1364
1454
|
return undefined;
|
|
1365
1455
|
}
|
|
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
1456
|
export function parseBorderBlockWidth(declaration, builder) {
|
|
1374
|
-
|
|
1375
|
-
|
|
1457
|
+
const start = parseBorderSideWidth(declaration.value.start, builder);
|
|
1458
|
+
const end = parseBorderSideWidth(declaration.value.end, builder);
|
|
1459
|
+
if (start === end) {
|
|
1460
|
+
builder.addDescriptor("border-block-width", start);
|
|
1461
|
+
} else {
|
|
1462
|
+
builder.addDescriptor("border-block-start-width", start);
|
|
1463
|
+
builder.addDescriptor("border-block-end-width", end);
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
function parseBorderBlockStyle(declaration, builder) {
|
|
1467
|
+
const start = parseBorderStyle(declaration.value.start, builder);
|
|
1468
|
+
const end = parseBorderStyle(declaration.value.end, builder);
|
|
1469
|
+
if (start == end) {
|
|
1470
|
+
builder.addDescriptor("border-block-style", start);
|
|
1471
|
+
} else {
|
|
1472
|
+
builder.addDescriptor("border-block-start-style", start);
|
|
1473
|
+
builder.addDescriptor("border-block-end-style", end);
|
|
1474
|
+
}
|
|
1376
1475
|
}
|
|
1377
1476
|
export function parseBorderSideWidthDeclaration(declaration, builder) {
|
|
1378
|
-
|
|
1477
|
+
builder.addDescriptor(declaration.property, parseBorderSideWidth(declaration.value, builder));
|
|
1379
1478
|
}
|
|
1380
1479
|
export function parseBorderSideWidth(value, builder) {
|
|
1381
1480
|
if (value.type === "length") {
|
|
@@ -1530,6 +1629,13 @@ export function parseBoxShadow({
|
|
|
1530
1629
|
builder.addDescriptor(`boxShadow.[${index}].inset`, shadow.inset ? true : undefined);
|
|
1531
1630
|
}
|
|
1532
1631
|
}
|
|
1632
|
+
export function parseBoxSizing(declaration, builder) {
|
|
1633
|
+
if (["border-box", "content-box"].includes(declaration.value)) {
|
|
1634
|
+
return declaration.value;
|
|
1635
|
+
}
|
|
1636
|
+
builder.addWarning("value", declaration.value);
|
|
1637
|
+
return undefined;
|
|
1638
|
+
}
|
|
1533
1639
|
export function parseDisplay({
|
|
1534
1640
|
value
|
|
1535
1641
|
}, builder) {
|
|
@@ -1585,6 +1691,14 @@ export function parseDisplay({
|
|
|
1585
1691
|
}
|
|
1586
1692
|
}
|
|
1587
1693
|
}
|
|
1694
|
+
export function parseDirection(declaration, builder) {
|
|
1695
|
+
if (["ltr", "rtl"].includes(declaration.value)) {
|
|
1696
|
+
builder.addDescriptor("direction", declaration.value);
|
|
1697
|
+
builder.addDescriptor("--__rn-css-direction", declaration.value);
|
|
1698
|
+
}
|
|
1699
|
+
builder.addWarning("value", declaration.value);
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1588
1702
|
export function parseAspectRatio({
|
|
1589
1703
|
value
|
|
1590
1704
|
}) {
|
|
@@ -1601,6 +1715,16 @@ export function parseAspectRatio({
|
|
|
1601
1715
|
}
|
|
1602
1716
|
}
|
|
1603
1717
|
}
|
|
1718
|
+
export function parseBackfaceVisibility({
|
|
1719
|
+
value
|
|
1720
|
+
}, builder) {
|
|
1721
|
+
if (["visible", "hidden"].includes(value)) {
|
|
1722
|
+
return value;
|
|
1723
|
+
} else {
|
|
1724
|
+
builder.addWarning("value", value);
|
|
1725
|
+
return;
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1604
1728
|
export function parseDimension({
|
|
1605
1729
|
unit,
|
|
1606
1730
|
value
|
|
@@ -1636,14 +1760,18 @@ export function parseUserSelect({
|
|
|
1636
1760
|
}
|
|
1637
1761
|
}
|
|
1638
1762
|
export function parseSVGPaint({
|
|
1639
|
-
value
|
|
1763
|
+
value,
|
|
1764
|
+
property
|
|
1640
1765
|
}, builder) {
|
|
1766
|
+
let parsedValue;
|
|
1641
1767
|
if (value.type === "none") {
|
|
1642
|
-
|
|
1768
|
+
parsedValue = "transparent";
|
|
1643
1769
|
} else if (value.type === "color") {
|
|
1644
|
-
|
|
1770
|
+
parsedValue = parseColor(value.value, builder);
|
|
1771
|
+
} else {
|
|
1772
|
+
return;
|
|
1645
1773
|
}
|
|
1646
|
-
|
|
1774
|
+
builder.addDescriptor(property, parsedValue);
|
|
1647
1775
|
}
|
|
1648
1776
|
export function round(number) {
|
|
1649
1777
|
return Math.round((number + Number.EPSILON) * 10000) / 10000;
|
|
@@ -1657,7 +1785,7 @@ export function parseDimensionPercentageFor_LengthValue(value, builder) {
|
|
|
1657
1785
|
return parseLength(value.value, builder);
|
|
1658
1786
|
}
|
|
1659
1787
|
}
|
|
1660
|
-
const
|
|
1788
|
+
const allowAutoProperties = new Set(["pointer-events"]);
|
|
1661
1789
|
export function parseEnv(value, builder) {
|
|
1662
1790
|
switch (value.name.type) {
|
|
1663
1791
|
case "ua":
|
|
@@ -1666,7 +1794,7 @@ export function parseEnv(value, builder) {
|
|
|
1666
1794
|
case "safe-area-inset-right":
|
|
1667
1795
|
case "safe-area-inset-bottom":
|
|
1668
1796
|
case "safe-area-inset-left":
|
|
1669
|
-
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder)], 1];
|
|
1797
|
+
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder, value.name.value)], 1];
|
|
1670
1798
|
case "viewport-segment-width":
|
|
1671
1799
|
case "viewport-segment-height":
|
|
1672
1800
|
case "viewport-segment-top":
|
|
@@ -1680,17 +1808,16 @@ export function parseEnv(value, builder) {
|
|
|
1680
1808
|
}
|
|
1681
1809
|
return;
|
|
1682
1810
|
}
|
|
1683
|
-
export function parseCalcFn(name, tokens, builder) {
|
|
1684
|
-
const args = parseCalcArguments(tokens, builder);
|
|
1811
|
+
export function parseCalcFn(name, tokens, builder, property) {
|
|
1812
|
+
const args = parseCalcArguments(tokens, builder, property);
|
|
1685
1813
|
if (args) {
|
|
1686
1814
|
return [{}, name, args];
|
|
1687
1815
|
}
|
|
1688
1816
|
return;
|
|
1689
1817
|
}
|
|
1690
|
-
export function parseCalcArguments([...args], builder) {
|
|
1818
|
+
export function parseCalcArguments([...args], builder, property) {
|
|
1691
1819
|
const parsed = [];
|
|
1692
|
-
|
|
1693
|
-
for (const [currentIndex, arg] of args.entries()) {
|
|
1820
|
+
for (const arg of args) {
|
|
1694
1821
|
switch (arg.type) {
|
|
1695
1822
|
case "env":
|
|
1696
1823
|
{
|
|
@@ -1701,7 +1828,7 @@ export function parseCalcArguments([...args], builder) {
|
|
|
1701
1828
|
case "function":
|
|
1702
1829
|
case "unresolved-color":
|
|
1703
1830
|
{
|
|
1704
|
-
const value = parseUnparsed(arg, builder);
|
|
1831
|
+
const value = parseUnparsed(arg, builder, property);
|
|
1705
1832
|
if (value === undefined) {
|
|
1706
1833
|
return undefined;
|
|
1707
1834
|
}
|
|
@@ -1736,44 +1863,21 @@ export function parseCalcArguments([...args], builder) {
|
|
|
1736
1863
|
}
|
|
1737
1864
|
break;
|
|
1738
1865
|
case "percentage":
|
|
1739
|
-
|
|
1740
|
-
if (mode !== "percentage") return;
|
|
1741
|
-
parsed.push(`${arg.value.value * 100}%`);
|
|
1866
|
+
parsed.push(`${round(arg.value.value * 100)}%`);
|
|
1742
1867
|
break;
|
|
1743
1868
|
case "number":
|
|
1744
1869
|
{
|
|
1745
|
-
|
|
1746
|
-
if (mode !== "number") return;
|
|
1747
|
-
parsed.push(arg.value.value);
|
|
1870
|
+
parsed.push(round(arg.value.value));
|
|
1748
1871
|
break;
|
|
1749
1872
|
}
|
|
1750
1873
|
case "parenthesis-block":
|
|
1751
1874
|
{
|
|
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));
|
|
1875
|
+
parsed.push("(");
|
|
1774
1876
|
break;
|
|
1775
1877
|
}
|
|
1776
1878
|
case "close-parenthesis":
|
|
1879
|
+
parsed.push(")");
|
|
1880
|
+
break;
|
|
1777
1881
|
case "string":
|
|
1778
1882
|
case "function":
|
|
1779
1883
|
case "ident":
|
|
@@ -1811,20 +1915,20 @@ export function parseTranslateProp(value, prop, builder) {
|
|
|
1811
1915
|
}
|
|
1812
1916
|
return parseLength(value[prop], builder);
|
|
1813
1917
|
}
|
|
1814
|
-
export function parseUnresolvedColor(color, builder) {
|
|
1918
|
+
export function parseUnresolvedColor(color, builder, property, allowAuto) {
|
|
1815
1919
|
switch (color.type) {
|
|
1816
1920
|
case "rgb":
|
|
1817
|
-
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder)]];
|
|
1921
|
+
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder, property)]];
|
|
1818
1922
|
case "hsl":
|
|
1819
|
-
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder)]];
|
|
1923
|
+
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder, property)]];
|
|
1820
1924
|
case "light-dark":
|
|
1821
1925
|
{
|
|
1822
1926
|
const extraRule = builder.extendRule({
|
|
1823
1927
|
m: [["=", "prefers-color-scheme", "dark"]]
|
|
1824
1928
|
});
|
|
1825
|
-
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder), false, extraRule);
|
|
1929
|
+
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder, property, allowAuto), false, extraRule);
|
|
1826
1930
|
builder.addExtraRule(extraRule);
|
|
1827
|
-
return reduceParseUnparsed(color.light, builder);
|
|
1931
|
+
return reduceParseUnparsed(color.light, builder, property, allowAuto);
|
|
1828
1932
|
}
|
|
1829
1933
|
default:
|
|
1830
1934
|
color;
|
|
@@ -1886,7 +1990,7 @@ export function addTransitionValue(declaration, builder) {
|
|
|
1886
1990
|
}
|
|
1887
1991
|
case "transition-property":
|
|
1888
1992
|
{
|
|
1889
|
-
builder.addDescriptor(declaration.property, declaration.value.map(v => v.property).filter(v => v in parsers || v === "all" || v === "none").map(v => toRNProperty(v)));
|
|
1993
|
+
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
1994
|
return;
|
|
1891
1995
|
}
|
|
1892
1996
|
case "transition-duration":
|
|
@@ -1983,7 +2087,7 @@ function parseGradient(gradient, builder) {
|
|
|
1983
2087
|
switch (gradient.type) {
|
|
1984
2088
|
case "linear":
|
|
1985
2089
|
{
|
|
1986
|
-
return [{}, "
|
|
2090
|
+
return [{}, "linear-gradient", [parseLineDirection(gradient.direction, builder), ...gradient.items.map(item => parseGradientItem(item, builder))]];
|
|
1987
2091
|
}
|
|
1988
2092
|
}
|
|
1989
2093
|
return;
|
|
@@ -2018,6 +2122,43 @@ function parseGradientItem(item, builder) {
|
|
|
2018
2122
|
return parseLength(item.value, builder);
|
|
2019
2123
|
}
|
|
2020
2124
|
}
|
|
2125
|
+
function parseObjectFit(declaration, builder) {
|
|
2126
|
+
builder.addMapping({
|
|
2127
|
+
"object-fit": "contentFit"
|
|
2128
|
+
});
|
|
2129
|
+
builder.addDescriptor("object-fit", parseUnparsed(declaration.value, builder, "object-fit"));
|
|
2130
|
+
}
|
|
2131
|
+
function parseObjectPosition(declaration, builder) {
|
|
2132
|
+
builder.addMapping({
|
|
2133
|
+
"object-position": "contentPosition"
|
|
2134
|
+
});
|
|
2135
|
+
builder.addDescriptor("object-position", [{}, "join", [parseUnparsed(declaration.value, builder, "object-position"), " "]]);
|
|
2136
|
+
}
|
|
2137
|
+
function parseCornerShape(declaration, builder) {
|
|
2138
|
+
const shape = parseUnparsed(declaration.value, builder, "corner-shape");
|
|
2139
|
+
if (shape === "round") {
|
|
2140
|
+
builder.addDescriptor("borderCurve", "circular");
|
|
2141
|
+
} else if (shape === "squircle") {
|
|
2142
|
+
builder.addDescriptor("borderCurve", "continuous");
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
function parseVisibility(declaration, builder) {
|
|
2146
|
+
if (declaration.value === "visible") {
|
|
2147
|
+
builder.addDescriptor("opacity", 1);
|
|
2148
|
+
} else if (declaration.value === "hidden") {
|
|
2149
|
+
builder.addDescriptor("opacity", 0);
|
|
2150
|
+
} else {
|
|
2151
|
+
builder.addWarning("value", declaration.value);
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
function parseOutlineStyle(declaration, builder) {
|
|
2155
|
+
const allowed = ["solid", "dotted", "dashed"];
|
|
2156
|
+
if (declaration.value.type !== "auto" && allowed.includes(declaration.value.value)) {
|
|
2157
|
+
builder.addDescriptor("outlineStyle", declaration.value.value);
|
|
2158
|
+
} else {
|
|
2159
|
+
builder.addWarning("value", declaration.value.type === "auto" ? "auto" : declaration.value.value);
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2021
2162
|
function parseFilter(declaration, builder) {
|
|
2022
2163
|
if (declaration.value.type === "none") {
|
|
2023
2164
|
return "unset";
|
|
@@ -2040,6 +2181,7 @@ function parseFilter(declaration, builder) {
|
|
|
2040
2181
|
[value.type]: parseAngle(value.value, builder)
|
|
2041
2182
|
};
|
|
2042
2183
|
case "drop-shadow":
|
|
2184
|
+
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
2185
|
case "url":
|
|
2044
2186
|
return;
|
|
2045
2187
|
}
|