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,13 +1,13 @@
|
|
|
1
|
-
// cSpell:ignore rcap,vmin,svmin,lvmin,dvmin,cqmin,vmax,svmax,lvmax,dvmax,cqmax,currentcolor,oklab,oklch,prophoto
|
|
1
|
+
// cSpell:ignore rcap,vmin,svmin,lvmin,dvmin,cqmin,vmax,svmax,lvmax,dvmax,cqmax,currentcolor,oklab,oklch,prophoto,squircle,oldstyle,nums
|
|
2
2
|
|
|
3
3
|
import Color from "colorjs.io";
|
|
4
4
|
import type {
|
|
5
5
|
Angle,
|
|
6
|
-
BorderBlockColor,
|
|
7
6
|
BorderSideWidth,
|
|
8
7
|
BorderStyle,
|
|
9
8
|
ColorOrAuto,
|
|
10
9
|
CssColor,
|
|
10
|
+
CustomProperty,
|
|
11
11
|
Declaration,
|
|
12
12
|
DimensionPercentageFor_LengthValue,
|
|
13
13
|
EnvironmentVariable,
|
|
@@ -63,12 +63,16 @@ const propertyRename: Record<string, string> = {
|
|
|
63
63
|
"background-image": "experimental_backgroundImage",
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
+
// TODO: We need a better way to handle this
|
|
66
67
|
const unparsedRuntimeParsing = new Set([
|
|
67
68
|
"animation",
|
|
69
|
+
"border",
|
|
70
|
+
"box-shadow",
|
|
68
71
|
"text-shadow",
|
|
69
72
|
"transform",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
73
|
+
"scale",
|
|
74
|
+
"rotate",
|
|
75
|
+
"translate",
|
|
72
76
|
]);
|
|
73
77
|
|
|
74
78
|
const parsers: {
|
|
@@ -87,42 +91,51 @@ const parsers: {
|
|
|
87
91
|
"animation-play-state": addAnimationValue,
|
|
88
92
|
"animation-timing-function": addAnimationValue,
|
|
89
93
|
"aspect-ratio": parseAspectRatio,
|
|
94
|
+
"backface-visibility": parseBackfaceVisibility,
|
|
90
95
|
"background-color": parseColorDeclaration,
|
|
91
96
|
"background-image": parseBackgroundImage,
|
|
92
97
|
"block-size": parseSizeDeclaration,
|
|
93
98
|
"border": parseBorder,
|
|
94
99
|
"border-block": parseBorderBlock,
|
|
95
|
-
"border-block-color":
|
|
100
|
+
"border-block-color": parseBorderColor,
|
|
96
101
|
"border-block-end": parseBorderBlockEnd,
|
|
97
102
|
"border-block-end-color": parseColorDeclaration,
|
|
98
103
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
99
104
|
"border-block-start": parseBorderBlockStart,
|
|
100
105
|
"border-block-start-color": parseColorDeclaration,
|
|
106
|
+
"border-block-start-style": parseBorderStyleDeclaration,
|
|
101
107
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
108
|
+
"border-block-style": parseBorderBlockStyle,
|
|
102
109
|
"border-block-width": parseBorderBlockWidth,
|
|
103
110
|
"border-bottom": parseBorderSide,
|
|
104
111
|
"border-bottom-color": parseColorDeclaration,
|
|
105
112
|
"border-bottom-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
106
113
|
"border-bottom-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
114
|
+
"border-bottom-style": parseBorderStyleDeclaration,
|
|
107
115
|
"border-bottom-width": parseBorderSideWidthDeclaration,
|
|
108
116
|
"border-color": parseBorderColor,
|
|
109
117
|
"border-end-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
110
118
|
"border-end-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
111
119
|
"border-inline": parseBorderInline,
|
|
112
|
-
"border-inline-color":
|
|
120
|
+
"border-inline-color": parseBorderColor,
|
|
113
121
|
"border-inline-end": parseBorderInlineEnd,
|
|
114
122
|
"border-inline-end-color": parseColorDeclaration,
|
|
123
|
+
"border-inline-end-style": parseBorderInlineStyle,
|
|
115
124
|
"border-inline-end-width": parseBorderSideWidthDeclaration,
|
|
116
125
|
"border-inline-start": parseBorderInlineStart,
|
|
117
126
|
"border-inline-start-color": parseColorDeclaration,
|
|
127
|
+
"border-inline-start-style": parseBorderInlineStyle,
|
|
118
128
|
"border-inline-start-width": parseBorderSideWidthDeclaration,
|
|
129
|
+
"border-inline-style": parseBorderInlineStyle,
|
|
119
130
|
"border-inline-width": parseBorderInlineWidth,
|
|
120
131
|
"border-left": parseBorderSide,
|
|
121
132
|
"border-left-color": parseColorDeclaration,
|
|
133
|
+
"border-left-style": parseBorderStyleDeclaration,
|
|
122
134
|
"border-left-width": parseBorderSideWidthDeclaration,
|
|
123
135
|
"border-radius": parseBorderRadius,
|
|
124
136
|
"border-right": parseBorderSide,
|
|
125
137
|
"border-right-color": parseColorDeclaration,
|
|
138
|
+
"border-right-style": parseBorderStyleDeclaration,
|
|
126
139
|
"border-right-width": parseBorderSideWidthDeclaration,
|
|
127
140
|
"border-start-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
128
141
|
"border-start-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
@@ -131,21 +144,24 @@ const parsers: {
|
|
|
131
144
|
"border-top-color": parseColorDeclaration,
|
|
132
145
|
"border-top-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
133
146
|
"border-top-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
147
|
+
"border-top-style": parseBorderStyleDeclaration,
|
|
134
148
|
"border-top-width": parseBorderSideWidthDeclaration,
|
|
135
149
|
"border-width": parseBorderWidth,
|
|
136
|
-
"bottom":
|
|
150
|
+
"bottom": parseSizeWithAutoDeclaration,
|
|
137
151
|
"box-shadow": parseBoxShadow,
|
|
138
|
-
"
|
|
152
|
+
"box-sizing": parseBoxSizing,
|
|
153
|
+
"caret-color": parseColorOrAutoDeclaration,
|
|
139
154
|
"color": parseFontColorDeclaration,
|
|
140
155
|
"column-gap": parseGap,
|
|
141
156
|
"container": parseContainer,
|
|
142
157
|
"container-name": parseContainerName,
|
|
143
158
|
"container-type": parseContainerType,
|
|
144
159
|
"display": parseDisplay,
|
|
160
|
+
"direction": parseDirection,
|
|
145
161
|
"fill": parseSVGPaint,
|
|
146
162
|
"filter": parseFilter,
|
|
147
163
|
"flex": parseFlex,
|
|
148
|
-
"flex-basis":
|
|
164
|
+
"flex-basis": parseLengthPercentageDeclaration,
|
|
149
165
|
"flex-direction": ({ value }) => value,
|
|
150
166
|
"flex-flow": parseFlexFlow,
|
|
151
167
|
"flex-grow": ({ value }) => value,
|
|
@@ -162,26 +178,26 @@ const parsers: {
|
|
|
162
178
|
"inline-size": parseSizeDeclaration,
|
|
163
179
|
"inset": parseInset,
|
|
164
180
|
"inset-block": parseInsetBlock,
|
|
165
|
-
"inset-block-end":
|
|
166
|
-
"inset-block-start":
|
|
181
|
+
"inset-block-end": parseLengthPercentageDeclaration,
|
|
182
|
+
"inset-block-start": parseLengthPercentageDeclaration,
|
|
167
183
|
"inset-inline": parseInsetInline,
|
|
168
|
-
"inset-inline-end":
|
|
169
|
-
"inset-inline-start":
|
|
184
|
+
"inset-inline-end": parseLengthPercentageDeclaration,
|
|
185
|
+
"inset-inline-start": parseLengthPercentageDeclaration,
|
|
170
186
|
"justify-content": parseJustifyContent,
|
|
171
|
-
"left":
|
|
187
|
+
"left": parseSizeWithAutoDeclaration,
|
|
172
188
|
"letter-spacing": parseLetterSpacing,
|
|
173
189
|
"line-height": parseLineHeightDeclaration,
|
|
174
190
|
"margin": parseMargin,
|
|
175
191
|
"margin-block": parseMarginBlock,
|
|
176
192
|
"margin-block-end": parseLengthPercentageOrAutoDeclaration,
|
|
177
193
|
"margin-block-start": parseLengthPercentageOrAutoDeclaration,
|
|
178
|
-
"margin-bottom":
|
|
194
|
+
"margin-bottom": parseSizeWithAutoDeclaration,
|
|
179
195
|
"margin-inline": parseMarginInline,
|
|
180
196
|
"margin-inline-end": parseLengthPercentageOrAutoDeclaration,
|
|
181
197
|
"margin-inline-start": parseLengthPercentageOrAutoDeclaration,
|
|
182
|
-
"margin-left":
|
|
183
|
-
"margin-right":
|
|
184
|
-
"margin-top":
|
|
198
|
+
"margin-left": parseSizeWithAutoDeclaration,
|
|
199
|
+
"margin-right": parseSizeWithAutoDeclaration,
|
|
200
|
+
"margin-top": parseSizeWithAutoDeclaration,
|
|
185
201
|
"max-block-size": parseSizeDeclaration,
|
|
186
202
|
"max-height": parseSizeDeclaration,
|
|
187
203
|
"max-inline-size": parseSizeDeclaration,
|
|
@@ -190,21 +206,24 @@ const parsers: {
|
|
|
190
206
|
"min-height": parseSizeDeclaration,
|
|
191
207
|
"min-inline-size": parseSizeDeclaration,
|
|
192
208
|
"min-width": parseSizeDeclaration,
|
|
193
|
-
"opacity": ({ value }) => value,
|
|
209
|
+
"opacity": ({ value }) => round(value),
|
|
210
|
+
"outline-color": parseColorDeclaration,
|
|
211
|
+
"outline-style": parseOutlineStyle,
|
|
212
|
+
"outline-width": parseBorderSideWidthDeclaration,
|
|
194
213
|
"overflow": parseOverflow,
|
|
195
214
|
"padding": parsePadding,
|
|
196
215
|
"padding-block": parsePaddingBlock,
|
|
197
|
-
"padding-block-end":
|
|
198
|
-
"padding-block-start":
|
|
216
|
+
"padding-block-end": parseLengthPercentageDeclaration,
|
|
217
|
+
"padding-block-start": parseLengthPercentageDeclaration,
|
|
199
218
|
"padding-bottom": parseSizeDeclaration,
|
|
200
219
|
"padding-inline": parsePaddingInline,
|
|
201
|
-
"padding-inline-end":
|
|
202
|
-
"padding-inline-start":
|
|
220
|
+
"padding-inline-end": parseLengthPercentageDeclaration,
|
|
221
|
+
"padding-inline-start": parseLengthPercentageDeclaration,
|
|
203
222
|
"padding-left": parseSizeDeclaration,
|
|
204
223
|
"padding-right": parseSizeDeclaration,
|
|
205
224
|
"padding-top": parseSizeDeclaration,
|
|
206
225
|
"position": parsePosition,
|
|
207
|
-
"right":
|
|
226
|
+
"right": parseSizeWithAutoDeclaration,
|
|
208
227
|
"rotate": parseRotate,
|
|
209
228
|
"row-gap": parseGap,
|
|
210
229
|
"scale": parseScale,
|
|
@@ -217,7 +236,7 @@ const parsers: {
|
|
|
217
236
|
"text-decoration-style": parseTextDecorationStyle,
|
|
218
237
|
"text-shadow": parseTextShadow,
|
|
219
238
|
"text-transform": ({ value }) => value.case,
|
|
220
|
-
"top":
|
|
239
|
+
"top": parseSizeWithAutoDeclaration,
|
|
221
240
|
"transform": parseTransform,
|
|
222
241
|
"transition": addTransitionValue,
|
|
223
242
|
"transition-delay": addTransitionValue,
|
|
@@ -227,6 +246,7 @@ const parsers: {
|
|
|
227
246
|
"translate": parseTranslate,
|
|
228
247
|
"user-select": parseUserSelect,
|
|
229
248
|
"vertical-align": parseVerticalAlign,
|
|
249
|
+
"visibility": parseVisibility,
|
|
230
250
|
"width": parseSizeDeclaration,
|
|
231
251
|
"z-index": parseZIndex,
|
|
232
252
|
};
|
|
@@ -256,9 +276,9 @@ export function parseDeclaration(
|
|
|
256
276
|
}
|
|
257
277
|
|
|
258
278
|
if (declaration.property === "unparsed") {
|
|
259
|
-
|
|
279
|
+
parseUnparsedDeclaration(declaration, builder);
|
|
260
280
|
} else if (declaration.property === "custom") {
|
|
261
|
-
|
|
281
|
+
parseCustomDeclaration(declaration, builder);
|
|
262
282
|
} else {
|
|
263
283
|
parseWithParser(declaration, builder);
|
|
264
284
|
}
|
|
@@ -344,15 +364,41 @@ function parseBorderRadius(
|
|
|
344
364
|
}
|
|
345
365
|
|
|
346
366
|
function parseBorderColor(
|
|
347
|
-
|
|
367
|
+
declaration: DeclarationType<
|
|
368
|
+
"border-color" | "border-block-color" | "border-inline-color"
|
|
369
|
+
>,
|
|
348
370
|
builder: StylesheetBuilder,
|
|
349
371
|
) {
|
|
350
|
-
|
|
351
|
-
"border-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
372
|
+
switch (declaration.property) {
|
|
373
|
+
case "border-color":
|
|
374
|
+
builder.addShorthand("border-color", {
|
|
375
|
+
"border-top-color": parseColor(declaration.value.top, builder),
|
|
376
|
+
"border-bottom-color": parseColor(declaration.value.bottom, builder),
|
|
377
|
+
"border-left-color": parseColor(declaration.value.left, builder),
|
|
378
|
+
"border-right-color": parseColor(declaration.value.right, builder),
|
|
379
|
+
});
|
|
380
|
+
break;
|
|
381
|
+
case "border-block-color":
|
|
382
|
+
builder.addDescriptor(
|
|
383
|
+
"border-top-color",
|
|
384
|
+
parseColor(declaration.value.start, builder),
|
|
385
|
+
);
|
|
386
|
+
builder.addDescriptor(
|
|
387
|
+
"border-bottom-color",
|
|
388
|
+
parseColor(declaration.value.end, builder),
|
|
389
|
+
);
|
|
390
|
+
break;
|
|
391
|
+
case "border-inline-color":
|
|
392
|
+
builder.addDescriptor(
|
|
393
|
+
"border-left-color",
|
|
394
|
+
parseColor(declaration.value.start, builder),
|
|
395
|
+
);
|
|
396
|
+
builder.addDescriptor(
|
|
397
|
+
"border-right-color",
|
|
398
|
+
parseColor(declaration.value.end, builder),
|
|
399
|
+
);
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
356
402
|
}
|
|
357
403
|
|
|
358
404
|
function parseBorderWidth(
|
|
@@ -398,18 +444,14 @@ function parseBorderBlock(
|
|
|
398
444
|
{ value }: DeclarationType<"border-block">,
|
|
399
445
|
builder: StylesheetBuilder,
|
|
400
446
|
) {
|
|
401
|
-
builder.addDescriptor("border-
|
|
447
|
+
builder.addDescriptor("border-block-color", parseColor(value.color, builder));
|
|
402
448
|
builder.addDescriptor(
|
|
403
|
-
"border-
|
|
404
|
-
parseColor(value.color, builder),
|
|
405
|
-
);
|
|
406
|
-
builder.addDescriptor(
|
|
407
|
-
"border-top-width",
|
|
449
|
+
"border-block-width",
|
|
408
450
|
parseBorderSideWidth(value.width, builder),
|
|
409
451
|
);
|
|
410
452
|
builder.addDescriptor(
|
|
411
|
-
"border-
|
|
412
|
-
|
|
453
|
+
"border-block-style",
|
|
454
|
+
parseBorderStyle(value.style, builder),
|
|
413
455
|
);
|
|
414
456
|
}
|
|
415
457
|
|
|
@@ -417,9 +459,12 @@ function parseBorderBlockStart(
|
|
|
417
459
|
{ value }: DeclarationType<"border-block-start">,
|
|
418
460
|
builder: StylesheetBuilder,
|
|
419
461
|
) {
|
|
420
|
-
builder.addDescriptor("border-top-color", parseColor(value.color, builder));
|
|
421
462
|
builder.addDescriptor(
|
|
422
|
-
"border-
|
|
463
|
+
"border-block-start-color",
|
|
464
|
+
parseColor(value.color, builder),
|
|
465
|
+
);
|
|
466
|
+
builder.addDescriptor(
|
|
467
|
+
"border-block-start-width",
|
|
423
468
|
parseBorderSideWidth(value.width, builder),
|
|
424
469
|
);
|
|
425
470
|
}
|
|
@@ -429,11 +474,11 @@ function parseBorderBlockEnd(
|
|
|
429
474
|
builder: StylesheetBuilder,
|
|
430
475
|
) {
|
|
431
476
|
builder.addDescriptor(
|
|
432
|
-
"border-
|
|
477
|
+
"border-block-end-color",
|
|
433
478
|
parseColor(value.color, builder),
|
|
434
479
|
);
|
|
435
480
|
builder.addDescriptor(
|
|
436
|
-
"border-
|
|
481
|
+
"border-block-end-width",
|
|
437
482
|
parseBorderSideWidth(value.width, builder),
|
|
438
483
|
);
|
|
439
484
|
}
|
|
@@ -442,38 +487,54 @@ function parseBorderInline(
|
|
|
442
487
|
{ value }: DeclarationType<"border-inline">,
|
|
443
488
|
builder: StylesheetBuilder,
|
|
444
489
|
) {
|
|
445
|
-
builder.addDescriptor("border-left-color", parseColor(value.color, builder));
|
|
446
|
-
builder.addDescriptor("border-right-color", parseColor(value.color, builder));
|
|
447
490
|
builder.addDescriptor(
|
|
448
|
-
"border-
|
|
449
|
-
|
|
491
|
+
"border-inline-color",
|
|
492
|
+
parseColor(value.color, builder),
|
|
450
493
|
);
|
|
451
494
|
builder.addDescriptor(
|
|
452
|
-
"border-
|
|
495
|
+
"border-inline-width",
|
|
453
496
|
parseBorderSideWidth(value.width, builder),
|
|
454
497
|
);
|
|
498
|
+
builder.addDescriptor(
|
|
499
|
+
"border-inline-style",
|
|
500
|
+
parseBorderStyle(value.style, builder),
|
|
501
|
+
);
|
|
455
502
|
}
|
|
456
503
|
|
|
457
504
|
function parseBorderInlineStart(
|
|
458
505
|
{ value }: DeclarationType<"border-inline-start">,
|
|
459
506
|
builder: StylesheetBuilder,
|
|
460
507
|
) {
|
|
461
|
-
builder.addDescriptor("border-left-color", parseColor(value.color, builder));
|
|
462
508
|
builder.addDescriptor(
|
|
463
|
-
"border-
|
|
509
|
+
"border-inline-start-color",
|
|
510
|
+
parseColor(value.color, builder),
|
|
511
|
+
);
|
|
512
|
+
builder.addDescriptor(
|
|
513
|
+
"border-inline-start-width",
|
|
464
514
|
parseBorderSideWidth(value.width, builder),
|
|
465
515
|
);
|
|
516
|
+
builder.addDescriptor(
|
|
517
|
+
"border-inline-start-style",
|
|
518
|
+
parseBorderStyle(value.style, builder),
|
|
519
|
+
);
|
|
466
520
|
}
|
|
467
521
|
|
|
468
522
|
function parseBorderInlineEnd(
|
|
469
523
|
{ value }: DeclarationType<"border-inline-end">,
|
|
470
524
|
builder: StylesheetBuilder,
|
|
471
525
|
) {
|
|
472
|
-
builder.addDescriptor("border-right-color", parseColor(value.color, builder));
|
|
473
526
|
builder.addDescriptor(
|
|
474
|
-
"border-
|
|
527
|
+
"border-inline-end-color",
|
|
528
|
+
parseColor(value.color, builder),
|
|
529
|
+
);
|
|
530
|
+
builder.addDescriptor(
|
|
531
|
+
"border-inline-end-width",
|
|
475
532
|
parseBorderSideWidth(value.width, builder),
|
|
476
533
|
);
|
|
534
|
+
builder.addDescriptor(
|
|
535
|
+
"border-inline-end-style",
|
|
536
|
+
parseBorderStyle(value.style, builder),
|
|
537
|
+
);
|
|
477
538
|
}
|
|
478
539
|
|
|
479
540
|
export function parseBorderInlineWidth(
|
|
@@ -481,13 +542,39 @@ export function parseBorderInlineWidth(
|
|
|
481
542
|
builder: StylesheetBuilder,
|
|
482
543
|
) {
|
|
483
544
|
builder.addDescriptor(
|
|
484
|
-
"border-
|
|
545
|
+
"border-inline-width",
|
|
485
546
|
parseBorderSideWidth(declaration.value.start, builder),
|
|
486
547
|
);
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export function parseBorderInlineStyle(
|
|
551
|
+
declaration: DeclarationType<
|
|
552
|
+
| "border-inline-style"
|
|
553
|
+
| "border-inline-start-style"
|
|
554
|
+
| "border-inline-end-style"
|
|
555
|
+
>,
|
|
556
|
+
builder: StylesheetBuilder,
|
|
557
|
+
) {
|
|
558
|
+
if (typeof declaration.value === "string") {
|
|
559
|
+
builder.addDescriptor(
|
|
560
|
+
declaration.property,
|
|
561
|
+
parseBorderStyle(declaration.value, builder),
|
|
562
|
+
);
|
|
563
|
+
} else if (declaration.value.start === declaration.value.end) {
|
|
564
|
+
builder.addDescriptor(
|
|
565
|
+
declaration.property,
|
|
566
|
+
parseBorderStyle(declaration.value.start, builder),
|
|
567
|
+
);
|
|
568
|
+
} else {
|
|
569
|
+
builder.addDescriptor(
|
|
570
|
+
"border-inline-start-style",
|
|
571
|
+
parseBorderStyle(declaration.value.start, builder),
|
|
572
|
+
);
|
|
573
|
+
builder.addDescriptor(
|
|
574
|
+
"border-inline-end-style",
|
|
575
|
+
parseBorderStyle(declaration.value.end, builder),
|
|
576
|
+
);
|
|
577
|
+
}
|
|
491
578
|
}
|
|
492
579
|
|
|
493
580
|
function parseFlexFlow(
|
|
@@ -530,8 +617,11 @@ function parseMarginBlock(
|
|
|
530
617
|
"margin-block-start": parseLengthPercentageOrAuto(
|
|
531
618
|
value.blockStart,
|
|
532
619
|
builder,
|
|
620
|
+
{ allowAuto: true },
|
|
533
621
|
),
|
|
534
|
-
"margin-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder
|
|
622
|
+
"margin-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder, {
|
|
623
|
+
allowAuto: true,
|
|
624
|
+
}),
|
|
535
625
|
});
|
|
536
626
|
}
|
|
537
627
|
|
|
@@ -543,8 +633,11 @@ function parseMarginInline(
|
|
|
543
633
|
"margin-inline-start": parseLengthPercentageOrAuto(
|
|
544
634
|
value.inlineStart,
|
|
545
635
|
builder,
|
|
636
|
+
{ allowAuto: true },
|
|
546
637
|
),
|
|
547
|
-
"margin-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder
|
|
638
|
+
"margin-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder, {
|
|
639
|
+
allowAuto: true,
|
|
640
|
+
}),
|
|
548
641
|
});
|
|
549
642
|
}
|
|
550
643
|
|
|
@@ -610,22 +703,22 @@ function parseTransform(
|
|
|
610
703
|
) {
|
|
611
704
|
builder.addDescriptor("transform", [
|
|
612
705
|
{},
|
|
613
|
-
"
|
|
706
|
+
"transform",
|
|
614
707
|
value.flatMap((t): StyleDescriptor[] => {
|
|
615
708
|
switch (t.type) {
|
|
616
709
|
case "perspective":
|
|
617
|
-
return [[{}, "
|
|
710
|
+
return [[{}, "perspective", parseLength(t.value, builder)]];
|
|
618
711
|
case "translate":
|
|
619
712
|
return [
|
|
620
713
|
[
|
|
621
714
|
{},
|
|
622
|
-
"
|
|
715
|
+
"translateX",
|
|
623
716
|
parseLengthOrCoercePercentageToRuntime(t.value[0], builder),
|
|
624
717
|
],
|
|
625
718
|
[
|
|
626
719
|
[
|
|
627
720
|
{},
|
|
628
|
-
"
|
|
721
|
+
"translateY",
|
|
629
722
|
parseLengthOrCoercePercentageToRuntime(t.value[1], builder),
|
|
630
723
|
],
|
|
631
724
|
],
|
|
@@ -634,7 +727,7 @@ function parseTransform(
|
|
|
634
727
|
return [
|
|
635
728
|
[
|
|
636
729
|
{},
|
|
637
|
-
"
|
|
730
|
+
"translateX",
|
|
638
731
|
parseLengthOrCoercePercentageToRuntime(t.value, builder),
|
|
639
732
|
],
|
|
640
733
|
];
|
|
@@ -642,22 +735,22 @@ function parseTransform(
|
|
|
642
735
|
return [
|
|
643
736
|
[
|
|
644
737
|
{},
|
|
645
|
-
"
|
|
738
|
+
"translateY",
|
|
646
739
|
parseLengthOrCoercePercentageToRuntime(t.value, builder),
|
|
647
740
|
],
|
|
648
741
|
];
|
|
649
742
|
case "rotate":
|
|
650
|
-
return [[{}, "
|
|
743
|
+
return [[{}, "rotate", parseAngle(t.value, builder)]];
|
|
651
744
|
case "rotateX":
|
|
652
|
-
return [[{}, "
|
|
745
|
+
return [[{}, "rotateX", parseAngle(t.value, builder)]];
|
|
653
746
|
case "rotateY":
|
|
654
|
-
return [[{}, "
|
|
747
|
+
return [[{}, "rotateY", parseAngle(t.value, builder)]];
|
|
655
748
|
case "rotateZ":
|
|
656
|
-
return [[{}, "
|
|
749
|
+
return [[{}, "rotateZ", parseAngle(t.value, builder)]];
|
|
657
750
|
case "scale":
|
|
658
751
|
return [
|
|
659
|
-
[{}, "
|
|
660
|
-
[{}, "
|
|
752
|
+
[{}, "scaleX", parseLength(t.value[0], builder)],
|
|
753
|
+
[{}, "scaleY", parseLength(t.value[1], builder)],
|
|
661
754
|
];
|
|
662
755
|
case "scaleX":
|
|
663
756
|
return [[{}, "scaleX", parseLength(t.value, builder)]];
|
|
@@ -706,21 +799,29 @@ function parseRotate(
|
|
|
706
799
|
{ value }: DeclarationType<"rotate">,
|
|
707
800
|
builder: StylesheetBuilder,
|
|
708
801
|
) {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
802
|
+
if (value.x) {
|
|
803
|
+
builder.addDescriptor("rotateX", [
|
|
804
|
+
{},
|
|
805
|
+
"rotateX",
|
|
806
|
+
parseAngle(value.angle, builder),
|
|
807
|
+
]);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
if (value.y) {
|
|
811
|
+
builder.addDescriptor("rotateY", [
|
|
812
|
+
{},
|
|
813
|
+
"rotateY",
|
|
814
|
+
parseAngle(value.angle, builder),
|
|
815
|
+
]);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
if (value.z) {
|
|
819
|
+
builder.addDescriptor("rotateZ", [
|
|
820
|
+
{},
|
|
821
|
+
"rotateZ",
|
|
822
|
+
parseAngle(value.angle, builder),
|
|
823
|
+
]);
|
|
824
|
+
}
|
|
724
825
|
}
|
|
725
826
|
|
|
726
827
|
function parseScale(
|
|
@@ -797,7 +898,11 @@ function parseZIndex(
|
|
|
797
898
|
}
|
|
798
899
|
}
|
|
799
900
|
|
|
800
|
-
function parseContainerType(
|
|
901
|
+
function parseContainerType(
|
|
902
|
+
_declaration: DeclarationType<"container-type">,
|
|
903
|
+
builder: StylesheetBuilder,
|
|
904
|
+
) {
|
|
905
|
+
builder.addContainer(["___default___"]);
|
|
801
906
|
return;
|
|
802
907
|
}
|
|
803
908
|
|
|
@@ -817,7 +922,7 @@ function parseContainer(
|
|
|
817
922
|
return;
|
|
818
923
|
}
|
|
819
924
|
|
|
820
|
-
export function
|
|
925
|
+
export function parseUnparsedDeclaration(
|
|
821
926
|
declaration: Extract<Declaration, { property: "unparsed" }>,
|
|
822
927
|
builder: StylesheetBuilder,
|
|
823
928
|
) {
|
|
@@ -844,24 +949,15 @@ export function parseDeclarationUnparsed(
|
|
|
844
949
|
builder.descriptorProperty = property;
|
|
845
950
|
|
|
846
951
|
if (unparsedRuntimeParsing.has(property)) {
|
|
847
|
-
const args = parseUnparsed(declaration.value.value, builder);
|
|
952
|
+
const args = parseUnparsed(declaration.value.value, builder, property);
|
|
848
953
|
|
|
849
954
|
if (property === "animation") {
|
|
850
|
-
builder.addDescriptor("animation", [
|
|
851
|
-
{},
|
|
852
|
-
`@${toRNProperty(property)}`,
|
|
853
|
-
args,
|
|
854
|
-
]);
|
|
955
|
+
builder.addDescriptor("animation", [{}, property, args]);
|
|
855
956
|
} else {
|
|
856
|
-
builder.addDescriptor(property, [
|
|
857
|
-
{},
|
|
858
|
-
`@${toRNProperty(property)}`,
|
|
859
|
-
args,
|
|
860
|
-
1,
|
|
861
|
-
]);
|
|
957
|
+
builder.addDescriptor(property, [{}, toRNProperty(property), args, 1]);
|
|
862
958
|
}
|
|
863
959
|
} else {
|
|
864
|
-
const value = parseUnparsed(declaration.value.value, builder);
|
|
960
|
+
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
865
961
|
|
|
866
962
|
builder.addDescriptor(property, value);
|
|
867
963
|
|
|
@@ -875,26 +971,45 @@ export function parseDeclarationUnparsed(
|
|
|
875
971
|
}
|
|
876
972
|
}
|
|
877
973
|
|
|
878
|
-
export function
|
|
974
|
+
export function parseCustomDeclaration(
|
|
879
975
|
declaration: Extract<Declaration, { property: "custom" }>,
|
|
880
976
|
builder: StylesheetBuilder,
|
|
881
977
|
) {
|
|
882
978
|
const property = declaration.value.name;
|
|
883
|
-
|
|
979
|
+
|
|
980
|
+
if (property === "-webkit-line-clamp") {
|
|
981
|
+
builder.addDescriptor(
|
|
982
|
+
property,
|
|
983
|
+
parseUnparsed(declaration.value.value, builder, property),
|
|
984
|
+
);
|
|
985
|
+
} else if (property === "-rn-ripple-style") {
|
|
986
|
+
builder.addDescriptor(
|
|
987
|
+
property,
|
|
988
|
+
parseUnparsed(declaration.value.value, builder, property) ===
|
|
989
|
+
"borderless",
|
|
990
|
+
);
|
|
991
|
+
} else if (property === "object-fit") {
|
|
992
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1046
|
|
993
|
+
parseObjectFit(declaration.value, builder);
|
|
994
|
+
} else if (property === "object-position") {
|
|
995
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1047
|
|
996
|
+
parseObjectPosition(declaration.value, builder);
|
|
997
|
+
} else if (property === "outline-offset") {
|
|
998
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1048
|
|
999
|
+
builder.addDescriptor(
|
|
1000
|
+
property,
|
|
1001
|
+
parseUnparsed(declaration.value.value, builder, property),
|
|
1002
|
+
);
|
|
1003
|
+
} else if (property === "corner-shape") {
|
|
1004
|
+
parseCornerShape(declaration.value, builder);
|
|
1005
|
+
} else if (
|
|
884
1006
|
validProperties.has(property) ||
|
|
885
1007
|
property.startsWith("--") ||
|
|
886
1008
|
property.startsWith("-rn-")
|
|
887
1009
|
) {
|
|
888
|
-
builder.setWarningProperty(property);
|
|
889
|
-
builder.addDescriptor(
|
|
890
|
-
property,
|
|
891
|
-
parseUnparsed(declaration.value.value, builder, allowAuto.has(property)),
|
|
892
|
-
);
|
|
893
|
-
} else if (property === "-webkit-line-clamp") {
|
|
894
|
-
builder.addMapping({ [property]: ["numberOfLines"] });
|
|
895
1010
|
builder.addDescriptor(
|
|
896
1011
|
property,
|
|
897
|
-
parseUnparsed(declaration.value.value, builder,
|
|
1012
|
+
parseUnparsed(declaration.value.value, builder, property),
|
|
898
1013
|
);
|
|
899
1014
|
} else {
|
|
900
1015
|
builder.addWarning("property", declaration.value.name);
|
|
@@ -904,9 +1019,13 @@ export function parseDeclarationCustom(
|
|
|
904
1019
|
export function reduceParseUnparsed(
|
|
905
1020
|
tokenOrValues: TokenOrValue[],
|
|
906
1021
|
builder: StylesheetBuilder,
|
|
1022
|
+
property: string,
|
|
1023
|
+
allowAuto: boolean,
|
|
907
1024
|
): StyleDescriptor {
|
|
908
1025
|
const result = tokenOrValues
|
|
909
|
-
.map((tokenOrValue) =>
|
|
1026
|
+
.map((tokenOrValue) =>
|
|
1027
|
+
parseUnparsed(tokenOrValue, builder, property, allowAuto),
|
|
1028
|
+
)
|
|
910
1029
|
.filter((v) => v !== undefined);
|
|
911
1030
|
|
|
912
1031
|
if (result.length === 0) {
|
|
@@ -925,6 +1044,8 @@ export function reduceParseUnparsed(
|
|
|
925
1044
|
}
|
|
926
1045
|
}
|
|
927
1046
|
|
|
1047
|
+
// Groups are the tokens grouped together by comma location
|
|
1048
|
+
// If a group only has 1 item, it shouldn't be an array
|
|
928
1049
|
groups = groups.flatMap((group): StyleDescriptor[] => {
|
|
929
1050
|
if (!Array.isArray(group)) {
|
|
930
1051
|
return [];
|
|
@@ -940,6 +1061,17 @@ export function reduceParseUnparsed(
|
|
|
940
1061
|
} else {
|
|
941
1062
|
return [first];
|
|
942
1063
|
}
|
|
1064
|
+
} else if (
|
|
1065
|
+
// This is a special case for <ratio> values
|
|
1066
|
+
group.includes("/") &&
|
|
1067
|
+
group.every((item) =>
|
|
1068
|
+
typeof item === "string" && item === "/"
|
|
1069
|
+
? item
|
|
1070
|
+
: typeof item === "number",
|
|
1071
|
+
)
|
|
1072
|
+
) {
|
|
1073
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
1074
|
+
return [group.join(" ")];
|
|
943
1075
|
} else {
|
|
944
1076
|
return [group];
|
|
945
1077
|
}
|
|
@@ -951,11 +1083,13 @@ export function reduceParseUnparsed(
|
|
|
951
1083
|
export function unparsedFunction(
|
|
952
1084
|
token: Extract<TokenOrValue, { type: "function" }>,
|
|
953
1085
|
builder: StylesheetBuilder,
|
|
1086
|
+
property: string,
|
|
1087
|
+
allowAuto: boolean,
|
|
954
1088
|
): StyleFunction {
|
|
955
1089
|
return [
|
|
956
1090
|
{},
|
|
957
|
-
token.value.name,
|
|
958
|
-
reduceParseUnparsed(token.value.arguments, builder),
|
|
1091
|
+
toRNProperty(token.value.name),
|
|
1092
|
+
reduceParseUnparsed(token.value.arguments, builder, property, allowAuto),
|
|
959
1093
|
];
|
|
960
1094
|
}
|
|
961
1095
|
|
|
@@ -972,7 +1106,8 @@ export function parseUnparsed(
|
|
|
972
1106
|
| undefined
|
|
973
1107
|
| null,
|
|
974
1108
|
builder: StylesheetBuilder,
|
|
975
|
-
|
|
1109
|
+
property: string,
|
|
1110
|
+
allowAuto = allowAutoProperties.has(property),
|
|
976
1111
|
): StyleDescriptor {
|
|
977
1112
|
if (tokenOrValue === undefined || tokenOrValue === null) {
|
|
978
1113
|
return;
|
|
@@ -995,7 +1130,12 @@ export function parseUnparsed(
|
|
|
995
1130
|
}
|
|
996
1131
|
|
|
997
1132
|
if (Array.isArray(tokenOrValue)) {
|
|
998
|
-
const args = reduceParseUnparsed(
|
|
1133
|
+
const args = reduceParseUnparsed(
|
|
1134
|
+
tokenOrValue,
|
|
1135
|
+
builder,
|
|
1136
|
+
property,
|
|
1137
|
+
allowAuto,
|
|
1138
|
+
);
|
|
999
1139
|
if (!args) return;
|
|
1000
1140
|
if (Array.isArray(args) && args.length === 1) return args[0];
|
|
1001
1141
|
return args;
|
|
@@ -1003,11 +1143,21 @@ export function parseUnparsed(
|
|
|
1003
1143
|
|
|
1004
1144
|
switch (tokenOrValue.type) {
|
|
1005
1145
|
case "unresolved-color": {
|
|
1006
|
-
return parseUnresolvedColor(
|
|
1146
|
+
return parseUnresolvedColor(
|
|
1147
|
+
tokenOrValue.value,
|
|
1148
|
+
builder,
|
|
1149
|
+
property,
|
|
1150
|
+
allowAuto,
|
|
1151
|
+
);
|
|
1007
1152
|
}
|
|
1008
1153
|
case "var": {
|
|
1009
1154
|
let args: StyleDescriptor = tokenOrValue.value.name.ident.slice(2);
|
|
1010
|
-
const fallback = parseUnparsed(
|
|
1155
|
+
const fallback = parseUnparsed(
|
|
1156
|
+
tokenOrValue.value.fallback,
|
|
1157
|
+
builder,
|
|
1158
|
+
property,
|
|
1159
|
+
allowAuto,
|
|
1160
|
+
);
|
|
1011
1161
|
if (fallback !== undefined) {
|
|
1012
1162
|
args = [args, fallback];
|
|
1013
1163
|
}
|
|
@@ -1016,43 +1166,53 @@ export function parseUnparsed(
|
|
|
1016
1166
|
}
|
|
1017
1167
|
case "function": {
|
|
1018
1168
|
switch (tokenOrValue.value.name) {
|
|
1019
|
-
case "
|
|
1020
|
-
case "rotate":
|
|
1021
|
-
case "rotateX":
|
|
1022
|
-
case "rotateY":
|
|
1023
|
-
case "skewX":
|
|
1024
|
-
case "skewY":
|
|
1025
|
-
case "scale":
|
|
1026
|
-
case "scaleX":
|
|
1027
|
-
case "scaleY":
|
|
1028
|
-
case "translateX":
|
|
1029
|
-
case "translateY":
|
|
1030
|
-
tokenOrValue.value.name = `@${tokenOrValue.value.name}`;
|
|
1031
|
-
return unparsedFunction(tokenOrValue, builder);
|
|
1169
|
+
case "blur":
|
|
1032
1170
|
case "brightness":
|
|
1033
1171
|
case "contrast":
|
|
1034
1172
|
case "cubic-bezier":
|
|
1035
1173
|
case "drop-shadow":
|
|
1036
1174
|
case "fontScale":
|
|
1175
|
+
case "getPixelSizeForLayoutSize":
|
|
1037
1176
|
case "grayscale":
|
|
1038
1177
|
case "hsl":
|
|
1039
1178
|
case "hsla":
|
|
1040
1179
|
case "hue-rotate":
|
|
1041
1180
|
case "invert":
|
|
1042
|
-
case "linear-gradient":
|
|
1043
1181
|
case "opacity":
|
|
1044
1182
|
case "pixelScale":
|
|
1045
|
-
case "pixelSizeForLayoutSize":
|
|
1046
1183
|
case "platformColor":
|
|
1047
|
-
case "radial-gradient":
|
|
1048
1184
|
case "rgb":
|
|
1049
1185
|
case "rgba":
|
|
1186
|
+
case "rotate":
|
|
1187
|
+
case "rotateX":
|
|
1188
|
+
case "rotateY":
|
|
1050
1189
|
case "roundToNearestPixel":
|
|
1051
1190
|
case "saturate":
|
|
1191
|
+
case "scale":
|
|
1192
|
+
case "scaleX":
|
|
1193
|
+
case "scaleY":
|
|
1052
1194
|
case "sepia":
|
|
1053
1195
|
case "shadow":
|
|
1196
|
+
case "skewX":
|
|
1197
|
+
case "skewY":
|
|
1054
1198
|
case "steps":
|
|
1055
|
-
|
|
1199
|
+
case "translate":
|
|
1200
|
+
case "translateX":
|
|
1201
|
+
case "translateY":
|
|
1202
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
1203
|
+
case "linear-gradient":
|
|
1204
|
+
case "radial-gradient":
|
|
1205
|
+
// These are special as React Native requires the '-' in their name
|
|
1206
|
+
return [
|
|
1207
|
+
{},
|
|
1208
|
+
tokenOrValue.value.name,
|
|
1209
|
+
reduceParseUnparsed(
|
|
1210
|
+
tokenOrValue.value.arguments,
|
|
1211
|
+
builder,
|
|
1212
|
+
property,
|
|
1213
|
+
allowAuto,
|
|
1214
|
+
),
|
|
1215
|
+
];
|
|
1056
1216
|
case "hairlineWidth":
|
|
1057
1217
|
return [{}, tokenOrValue.value.name, []];
|
|
1058
1218
|
case "calc":
|
|
@@ -1063,6 +1223,7 @@ export function parseUnparsed(
|
|
|
1063
1223
|
tokenOrValue.value.name,
|
|
1064
1224
|
tokenOrValue.value.arguments,
|
|
1065
1225
|
builder,
|
|
1226
|
+
property,
|
|
1066
1227
|
);
|
|
1067
1228
|
default: {
|
|
1068
1229
|
builder.addWarning("value", `${tokenOrValue.value.name}()`);
|
|
@@ -1084,7 +1245,7 @@ export function parseUnparsed(
|
|
|
1084
1245
|
return;
|
|
1085
1246
|
}
|
|
1086
1247
|
|
|
1087
|
-
if (value === "inherit") {
|
|
1248
|
+
if (value === "inherit" || value === "initial") {
|
|
1088
1249
|
builder.addWarning("value", value);
|
|
1089
1250
|
return;
|
|
1090
1251
|
} else if (value === "currentcolor") {
|
|
@@ -1095,6 +1256,8 @@ export function parseUnparsed(
|
|
|
1095
1256
|
return true;
|
|
1096
1257
|
} else if (value === "false") {
|
|
1097
1258
|
return false;
|
|
1259
|
+
} else if (value === "infinity") {
|
|
1260
|
+
return Number.MAX_SAFE_INTEGER;
|
|
1098
1261
|
} else {
|
|
1099
1262
|
return value;
|
|
1100
1263
|
}
|
|
@@ -1111,11 +1274,16 @@ export function parseUnparsed(
|
|
|
1111
1274
|
return parseDimension(tokenOrValue.value, builder);
|
|
1112
1275
|
case "comma":
|
|
1113
1276
|
return CommaSeparator as unknown as StyleDescriptor;
|
|
1277
|
+
case "delim": {
|
|
1278
|
+
if (tokenOrValue.value.value === "/") {
|
|
1279
|
+
return tokenOrValue.value.value;
|
|
1280
|
+
}
|
|
1281
|
+
return;
|
|
1282
|
+
}
|
|
1114
1283
|
case "at-keyword":
|
|
1115
1284
|
case "hash":
|
|
1116
1285
|
case "id-hash":
|
|
1117
1286
|
case "unquoted-url":
|
|
1118
|
-
case "delim":
|
|
1119
1287
|
case "white-space":
|
|
1120
1288
|
case "comment":
|
|
1121
1289
|
case "colon":
|
|
@@ -1197,7 +1365,12 @@ export function parseLength(
|
|
|
1197
1365
|
} else if (length.value === -Infinity) {
|
|
1198
1366
|
return -9999;
|
|
1199
1367
|
} else {
|
|
1200
|
-
|
|
1368
|
+
// Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
|
|
1369
|
+
const value = Math.max(
|
|
1370
|
+
Math.min(length.value, Number.MAX_SAFE_INTEGER),
|
|
1371
|
+
Number.MIN_SAFE_INTEGER,
|
|
1372
|
+
);
|
|
1373
|
+
return round(value);
|
|
1201
1374
|
}
|
|
1202
1375
|
}
|
|
1203
1376
|
case "rem":
|
|
@@ -1304,6 +1477,13 @@ export function parseSizeDeclaration(
|
|
|
1304
1477
|
return parseSize(declaration.value, builder);
|
|
1305
1478
|
}
|
|
1306
1479
|
|
|
1480
|
+
export function parseSizeWithAutoDeclaration(
|
|
1481
|
+
declaration: { value: Size | MaxSize },
|
|
1482
|
+
builder: StylesheetBuilder,
|
|
1483
|
+
) {
|
|
1484
|
+
return parseSize(declaration.value, builder, { allowAuto: true });
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1307
1487
|
export function parsePointerEvents(
|
|
1308
1488
|
{ value }: { value: string },
|
|
1309
1489
|
builder: StylesheetBuilder,
|
|
@@ -1375,7 +1555,7 @@ export function parseSize(
|
|
|
1375
1555
|
return;
|
|
1376
1556
|
}
|
|
1377
1557
|
|
|
1378
|
-
export function
|
|
1558
|
+
export function parseColorOrAutoDeclaration(
|
|
1379
1559
|
{ value }: { value: ColorOrAuto },
|
|
1380
1560
|
builder: StylesheetBuilder,
|
|
1381
1561
|
) {
|
|
@@ -1556,13 +1736,20 @@ export function parseColor(cssColor: CssColor, builder: StylesheetBuilder) {
|
|
|
1556
1736
|
}
|
|
1557
1737
|
}
|
|
1558
1738
|
|
|
1559
|
-
export function
|
|
1739
|
+
export function parseLengthPercentageDeclaration(
|
|
1560
1740
|
value: { value: LengthPercentageOrAuto },
|
|
1561
1741
|
builder: StylesheetBuilder,
|
|
1562
1742
|
) {
|
|
1563
1743
|
return parseLengthPercentageOrAuto(value.value, builder);
|
|
1564
1744
|
}
|
|
1565
1745
|
|
|
1746
|
+
export function parseLengthPercentageOrAutoDeclaration(
|
|
1747
|
+
value: { value: LengthPercentageOrAuto },
|
|
1748
|
+
builder: StylesheetBuilder,
|
|
1749
|
+
) {
|
|
1750
|
+
return parseLengthPercentageOrAuto(value.value, builder, { allowAuto: true });
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1566
1753
|
export function parseLengthPercentageOrAuto(
|
|
1567
1754
|
lengthPercentageOrAuto: LengthPercentageOrAuto,
|
|
1568
1755
|
builder: StylesheetBuilder,
|
|
@@ -1877,7 +2064,10 @@ export function parseOverflow(
|
|
|
1877
2064
|
}
|
|
1878
2065
|
|
|
1879
2066
|
export function parseBorderStyleDeclaration(
|
|
1880
|
-
declaration:
|
|
2067
|
+
declaration: Extract<
|
|
2068
|
+
DeclarationType<Declaration["property"]>,
|
|
2069
|
+
{ value: LineStyle | BorderStyle }
|
|
2070
|
+
>,
|
|
1881
2071
|
builder: StylesheetBuilder,
|
|
1882
2072
|
) {
|
|
1883
2073
|
return parseBorderStyle(declaration.value, builder);
|
|
@@ -1910,34 +2100,44 @@ export function parseBorderStyle(
|
|
|
1910
2100
|
return undefined;
|
|
1911
2101
|
}
|
|
1912
2102
|
|
|
1913
|
-
export function
|
|
1914
|
-
|
|
2103
|
+
export function parseBorderBlockWidth(
|
|
2104
|
+
declaration: DeclarationType<"border-block-width">,
|
|
1915
2105
|
builder: StylesheetBuilder,
|
|
1916
2106
|
) {
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
2107
|
+
const start = parseBorderSideWidth(declaration.value.start, builder);
|
|
2108
|
+
const end = parseBorderSideWidth(declaration.value.end, builder);
|
|
2109
|
+
|
|
2110
|
+
if (start === end) {
|
|
2111
|
+
builder.addDescriptor("border-block-width", start);
|
|
2112
|
+
} else {
|
|
2113
|
+
builder.addDescriptor("border-block-start-width", start);
|
|
2114
|
+
builder.addDescriptor("border-block-end-width", end);
|
|
2115
|
+
}
|
|
1920
2116
|
}
|
|
1921
2117
|
|
|
1922
|
-
|
|
1923
|
-
declaration: DeclarationType<"border-block-
|
|
2118
|
+
function parseBorderBlockStyle(
|
|
2119
|
+
declaration: DeclarationType<"border-block-style">,
|
|
1924
2120
|
builder: StylesheetBuilder,
|
|
1925
2121
|
) {
|
|
1926
|
-
builder
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
)
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
2122
|
+
const start = parseBorderStyle(declaration.value.start, builder);
|
|
2123
|
+
const end = parseBorderStyle(declaration.value.end, builder);
|
|
2124
|
+
|
|
2125
|
+
if (start == end) {
|
|
2126
|
+
builder.addDescriptor("border-block-style", start);
|
|
2127
|
+
} else {
|
|
2128
|
+
builder.addDescriptor("border-block-start-style", start);
|
|
2129
|
+
builder.addDescriptor("border-block-end-style", end);
|
|
2130
|
+
}
|
|
1934
2131
|
}
|
|
1935
2132
|
|
|
1936
2133
|
export function parseBorderSideWidthDeclaration(
|
|
1937
|
-
declaration: { value: BorderSideWidth }
|
|
2134
|
+
declaration: Extract<Declaration, { value: BorderSideWidth }>,
|
|
1938
2135
|
builder: StylesheetBuilder,
|
|
1939
2136
|
) {
|
|
1940
|
-
|
|
2137
|
+
builder.addDescriptor(
|
|
2138
|
+
declaration.property,
|
|
2139
|
+
parseBorderSideWidth(declaration.value, builder),
|
|
2140
|
+
);
|
|
1941
2141
|
}
|
|
1942
2142
|
|
|
1943
2143
|
export function parseBorderSideWidth(
|
|
@@ -2184,6 +2384,18 @@ export function parseBoxShadow(
|
|
|
2184
2384
|
}
|
|
2185
2385
|
}
|
|
2186
2386
|
|
|
2387
|
+
export function parseBoxSizing(
|
|
2388
|
+
declaration: DeclarationType<"box-sizing">,
|
|
2389
|
+
builder: StylesheetBuilder,
|
|
2390
|
+
) {
|
|
2391
|
+
if (["border-box", "content-box"].includes(declaration.value)) {
|
|
2392
|
+
return declaration.value;
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
builder.addWarning("value", declaration.value);
|
|
2396
|
+
return undefined;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2187
2399
|
export function parseDisplay(
|
|
2188
2400
|
{ value }: DeclarationType<"display">,
|
|
2189
2401
|
builder: StylesheetBuilder,
|
|
@@ -2241,6 +2453,19 @@ export function parseDisplay(
|
|
|
2241
2453
|
}
|
|
2242
2454
|
}
|
|
2243
2455
|
|
|
2456
|
+
export function parseDirection(
|
|
2457
|
+
declaration: DeclarationType<"direction">,
|
|
2458
|
+
builder: StylesheetBuilder,
|
|
2459
|
+
) {
|
|
2460
|
+
if (["ltr", "rtl"].includes(declaration.value)) {
|
|
2461
|
+
builder.addDescriptor("direction", declaration.value);
|
|
2462
|
+
builder.addDescriptor("--__rn-css-direction", declaration.value);
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
builder.addWarning("value", declaration.value);
|
|
2466
|
+
return;
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2244
2469
|
export function parseAspectRatio({
|
|
2245
2470
|
value,
|
|
2246
2471
|
}: DeclarationType<"aspect-ratio">): StyleDescriptor {
|
|
@@ -2258,6 +2483,18 @@ export function parseAspectRatio({
|
|
|
2258
2483
|
}
|
|
2259
2484
|
}
|
|
2260
2485
|
|
|
2486
|
+
export function parseBackfaceVisibility(
|
|
2487
|
+
{ value }: DeclarationType<"backface-visibility">,
|
|
2488
|
+
builder: StylesheetBuilder,
|
|
2489
|
+
): StyleDescriptor {
|
|
2490
|
+
if (["visible", "hidden"].includes(value)) {
|
|
2491
|
+
return value;
|
|
2492
|
+
} else {
|
|
2493
|
+
builder.addWarning("value", value);
|
|
2494
|
+
return;
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2261
2498
|
export function parseDimension(
|
|
2262
2499
|
{ unit, value }: Extract<Token, { type: "dimension" }>,
|
|
2263
2500
|
builder: StylesheetBuilder,
|
|
@@ -2295,16 +2532,20 @@ export function parseUserSelect(
|
|
|
2295
2532
|
}
|
|
2296
2533
|
|
|
2297
2534
|
export function parseSVGPaint(
|
|
2298
|
-
{ value }: DeclarationType<"fill" | "stroke">,
|
|
2535
|
+
{ value, property }: DeclarationType<"fill" | "stroke">,
|
|
2299
2536
|
builder: StylesheetBuilder,
|
|
2300
2537
|
) {
|
|
2538
|
+
let parsedValue: StyleDescriptor | undefined;
|
|
2539
|
+
|
|
2301
2540
|
if (value.type === "none") {
|
|
2302
|
-
|
|
2541
|
+
parsedValue = "transparent";
|
|
2303
2542
|
} else if (value.type === "color") {
|
|
2304
|
-
|
|
2543
|
+
parsedValue = parseColor(value.value, builder);
|
|
2544
|
+
} else {
|
|
2545
|
+
return;
|
|
2305
2546
|
}
|
|
2306
2547
|
|
|
2307
|
-
|
|
2548
|
+
builder.addDescriptor(property, parsedValue);
|
|
2308
2549
|
}
|
|
2309
2550
|
|
|
2310
2551
|
export function round(number: number) {
|
|
@@ -2324,7 +2565,7 @@ export function parseDimensionPercentageFor_LengthValue(
|
|
|
2324
2565
|
}
|
|
2325
2566
|
}
|
|
2326
2567
|
|
|
2327
|
-
const
|
|
2568
|
+
const allowAutoProperties = new Set(["pointer-events"]);
|
|
2328
2569
|
|
|
2329
2570
|
export function parseEnv(
|
|
2330
2571
|
value: EnvironmentVariable,
|
|
@@ -2342,7 +2583,7 @@ export function parseEnv(
|
|
|
2342
2583
|
"var",
|
|
2343
2584
|
[
|
|
2344
2585
|
`--react-native-css-${value.name.value}`,
|
|
2345
|
-
parseUnparsed(value.fallback, builder),
|
|
2586
|
+
parseUnparsed(value.fallback, builder, value.name.value),
|
|
2346
2587
|
],
|
|
2347
2588
|
1,
|
|
2348
2589
|
];
|
|
@@ -2365,8 +2606,9 @@ export function parseCalcFn(
|
|
|
2365
2606
|
name: string,
|
|
2366
2607
|
tokens: TokenOrValue[],
|
|
2367
2608
|
builder: StylesheetBuilder,
|
|
2609
|
+
property: string,
|
|
2368
2610
|
): StyleDescriptor {
|
|
2369
|
-
const args = parseCalcArguments(tokens, builder);
|
|
2611
|
+
const args = parseCalcArguments(tokens, builder, property);
|
|
2370
2612
|
if (args) {
|
|
2371
2613
|
return [{}, name, args];
|
|
2372
2614
|
}
|
|
@@ -2377,12 +2619,11 @@ export function parseCalcFn(
|
|
|
2377
2619
|
export function parseCalcArguments(
|
|
2378
2620
|
[...args]: TokenOrValue[],
|
|
2379
2621
|
builder: StylesheetBuilder,
|
|
2622
|
+
property: string,
|
|
2380
2623
|
) {
|
|
2381
2624
|
const parsed: StyleDescriptor[] = [];
|
|
2382
2625
|
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
for (const [currentIndex, arg] of args.entries()) {
|
|
2626
|
+
for (const arg of args) {
|
|
2386
2627
|
switch (arg.type) {
|
|
2387
2628
|
case "env": {
|
|
2388
2629
|
parsed.push(parseEnv(arg.value, builder));
|
|
@@ -2391,7 +2632,7 @@ export function parseCalcArguments(
|
|
|
2391
2632
|
case "var":
|
|
2392
2633
|
case "function":
|
|
2393
2634
|
case "unresolved-color": {
|
|
2394
|
-
const value = parseUnparsed(arg, builder);
|
|
2635
|
+
const value = parseUnparsed(arg, builder, property);
|
|
2395
2636
|
|
|
2396
2637
|
if (value === undefined) {
|
|
2397
2638
|
return undefined;
|
|
@@ -2402,11 +2643,9 @@ export function parseCalcArguments(
|
|
|
2402
2643
|
}
|
|
2403
2644
|
case "length": {
|
|
2404
2645
|
const value = parseLength(arg.value, builder);
|
|
2405
|
-
|
|
2406
2646
|
if (value !== undefined) {
|
|
2407
2647
|
parsed.push(value);
|
|
2408
2648
|
}
|
|
2409
|
-
|
|
2410
2649
|
break;
|
|
2411
2650
|
}
|
|
2412
2651
|
case "color":
|
|
@@ -2429,49 +2668,19 @@ export function parseCalcArguments(
|
|
|
2429
2668
|
}
|
|
2430
2669
|
break;
|
|
2431
2670
|
case "percentage":
|
|
2432
|
-
|
|
2433
|
-
if (mode !== "percentage") return;
|
|
2434
|
-
parsed.push(`${arg.value.value * 100}%`);
|
|
2671
|
+
parsed.push(`${round(arg.value.value * 100)}%`);
|
|
2435
2672
|
break;
|
|
2436
2673
|
case "number": {
|
|
2437
|
-
|
|
2438
|
-
if (mode !== "number") return;
|
|
2439
|
-
parsed.push(arg.value.value);
|
|
2674
|
+
parsed.push(round(arg.value.value));
|
|
2440
2675
|
break;
|
|
2441
2676
|
}
|
|
2442
2677
|
case "parenthesis-block": {
|
|
2443
|
-
|
|
2444
|
-
* If we have a parenthesis block, we just treat it as a nested calc function
|
|
2445
|
-
* Because there could be multiple parenthesis blocks, this is recursive
|
|
2446
|
-
*/
|
|
2447
|
-
let closeParenthesisIndex = -1;
|
|
2448
|
-
for (let index = args.length - 1; index > 0; index--) {
|
|
2449
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2450
|
-
const value = args[index]!;
|
|
2451
|
-
if (
|
|
2452
|
-
value.type === "token" &&
|
|
2453
|
-
value.value.type === "close-parenthesis"
|
|
2454
|
-
) {
|
|
2455
|
-
closeParenthesisIndex = index;
|
|
2456
|
-
break;
|
|
2457
|
-
}
|
|
2458
|
-
}
|
|
2459
|
-
|
|
2460
|
-
if (closeParenthesisIndex === -1) {
|
|
2461
|
-
return;
|
|
2462
|
-
}
|
|
2463
|
-
|
|
2464
|
-
const innerCalcArgs = args
|
|
2465
|
-
// Extract the inner calcArgs including the parenthesis. This mutates args
|
|
2466
|
-
.splice(currentIndex, closeParenthesisIndex - currentIndex + 1)
|
|
2467
|
-
// Then drop the surrounding parenthesis
|
|
2468
|
-
.slice(1, -1);
|
|
2469
|
-
|
|
2470
|
-
parsed.push(parseCalcFn("calc", innerCalcArgs, builder));
|
|
2471
|
-
|
|
2678
|
+
parsed.push("(");
|
|
2472
2679
|
break;
|
|
2473
2680
|
}
|
|
2474
2681
|
case "close-parenthesis":
|
|
2682
|
+
parsed.push(")");
|
|
2683
|
+
break;
|
|
2475
2684
|
case "string":
|
|
2476
2685
|
case "function":
|
|
2477
2686
|
case "ident":
|
|
@@ -2520,6 +2729,8 @@ export function parseTranslateProp(
|
|
|
2520
2729
|
export function parseUnresolvedColor(
|
|
2521
2730
|
color: UnresolvedColor,
|
|
2522
2731
|
builder: StylesheetBuilder,
|
|
2732
|
+
property: string,
|
|
2733
|
+
allowAuto: boolean,
|
|
2523
2734
|
): StyleDescriptor {
|
|
2524
2735
|
switch (color.type) {
|
|
2525
2736
|
case "rgb":
|
|
@@ -2530,26 +2741,31 @@ export function parseUnresolvedColor(
|
|
|
2530
2741
|
round(color.r * 255),
|
|
2531
2742
|
round(color.g * 255),
|
|
2532
2743
|
round(color.b * 255),
|
|
2533
|
-
parseUnparsed(color.alpha, builder),
|
|
2744
|
+
parseUnparsed(color.alpha, builder, property),
|
|
2534
2745
|
],
|
|
2535
2746
|
];
|
|
2536
2747
|
case "hsl":
|
|
2537
2748
|
return [
|
|
2538
2749
|
{},
|
|
2539
2750
|
color.type,
|
|
2540
|
-
[
|
|
2751
|
+
[
|
|
2752
|
+
color.h,
|
|
2753
|
+
color.s,
|
|
2754
|
+
color.l,
|
|
2755
|
+
parseUnparsed(color.alpha, builder, property),
|
|
2756
|
+
],
|
|
2541
2757
|
];
|
|
2542
2758
|
case "light-dark": {
|
|
2543
2759
|
const extraRule = builder.extendRule({
|
|
2544
2760
|
m: [["=", "prefers-color-scheme", "dark"]],
|
|
2545
2761
|
});
|
|
2546
2762
|
builder.addUnnamedDescriptor(
|
|
2547
|
-
reduceParseUnparsed(color.dark, builder),
|
|
2763
|
+
reduceParseUnparsed(color.dark, builder, property, allowAuto),
|
|
2548
2764
|
false,
|
|
2549
2765
|
extraRule,
|
|
2550
2766
|
);
|
|
2551
2767
|
builder.addExtraRule(extraRule);
|
|
2552
|
-
return reduceParseUnparsed(color.light, builder);
|
|
2768
|
+
return reduceParseUnparsed(color.light, builder, property, allowAuto);
|
|
2553
2769
|
}
|
|
2554
2770
|
default:
|
|
2555
2771
|
color satisfies never;
|
|
@@ -2646,7 +2862,12 @@ export function addTransitionValue(
|
|
|
2646
2862
|
declaration.property,
|
|
2647
2863
|
declaration.value
|
|
2648
2864
|
.map((v) => v.property)
|
|
2649
|
-
.filter(
|
|
2865
|
+
.filter(
|
|
2866
|
+
(v) =>
|
|
2867
|
+
(v in parsers && !["visibility"].includes(v)) ||
|
|
2868
|
+
v === "all" ||
|
|
2869
|
+
v === "none",
|
|
2870
|
+
)
|
|
2650
2871
|
.map((v) => toRNProperty(v)),
|
|
2651
2872
|
);
|
|
2652
2873
|
return;
|
|
@@ -2795,7 +3016,7 @@ function parseGradient(
|
|
|
2795
3016
|
case "linear": {
|
|
2796
3017
|
return [
|
|
2797
3018
|
{},
|
|
2798
|
-
"
|
|
3019
|
+
"linear-gradient",
|
|
2799
3020
|
[
|
|
2800
3021
|
parseLineDirection(gradient.direction, builder),
|
|
2801
3022
|
...gradient.items.map((item) => parseGradientItem(item, builder)),
|
|
@@ -2845,6 +3066,78 @@ function parseGradientItem(
|
|
|
2845
3066
|
}
|
|
2846
3067
|
}
|
|
2847
3068
|
|
|
3069
|
+
function parseObjectFit(
|
|
3070
|
+
declaration: CustomProperty,
|
|
3071
|
+
builder: StylesheetBuilder,
|
|
3072
|
+
) {
|
|
3073
|
+
builder.addMapping({
|
|
3074
|
+
"object-fit": "contentFit",
|
|
3075
|
+
});
|
|
3076
|
+
builder.addDescriptor(
|
|
3077
|
+
"object-fit",
|
|
3078
|
+
parseUnparsed(declaration.value, builder, "object-fit"),
|
|
3079
|
+
);
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
function parseObjectPosition(
|
|
3083
|
+
declaration: CustomProperty,
|
|
3084
|
+
builder: StylesheetBuilder,
|
|
3085
|
+
) {
|
|
3086
|
+
builder.addMapping({
|
|
3087
|
+
"object-position": "contentPosition",
|
|
3088
|
+
});
|
|
3089
|
+
builder.addDescriptor("object-position", [
|
|
3090
|
+
{},
|
|
3091
|
+
"join",
|
|
3092
|
+
[parseUnparsed(declaration.value, builder, "object-position"), " "],
|
|
3093
|
+
]);
|
|
3094
|
+
}
|
|
3095
|
+
|
|
3096
|
+
function parseCornerShape(
|
|
3097
|
+
declaration: CustomProperty,
|
|
3098
|
+
builder: StylesheetBuilder,
|
|
3099
|
+
) {
|
|
3100
|
+
const shape = parseUnparsed(declaration.value, builder, "corner-shape");
|
|
3101
|
+
|
|
3102
|
+
if (shape === "round") {
|
|
3103
|
+
builder.addDescriptor("borderCurve", "circular");
|
|
3104
|
+
} else if (shape === "squircle") {
|
|
3105
|
+
builder.addDescriptor("borderCurve", "continuous");
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3109
|
+
function parseVisibility(
|
|
3110
|
+
declaration: DeclarationType<"visibility">,
|
|
3111
|
+
builder: StylesheetBuilder,
|
|
3112
|
+
) {
|
|
3113
|
+
if (declaration.value === "visible") {
|
|
3114
|
+
builder.addDescriptor("opacity", 1);
|
|
3115
|
+
} else if (declaration.value === "hidden") {
|
|
3116
|
+
builder.addDescriptor("opacity", 0);
|
|
3117
|
+
} else {
|
|
3118
|
+
builder.addWarning("value", declaration.value);
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
|
|
3122
|
+
function parseOutlineStyle(
|
|
3123
|
+
declaration: DeclarationType<"outline-style">,
|
|
3124
|
+
builder: StylesheetBuilder,
|
|
3125
|
+
) {
|
|
3126
|
+
const allowed = ["solid", "dotted", "dashed"];
|
|
3127
|
+
|
|
3128
|
+
if (
|
|
3129
|
+
declaration.value.type !== "auto" &&
|
|
3130
|
+
allowed.includes(declaration.value.value)
|
|
3131
|
+
) {
|
|
3132
|
+
builder.addDescriptor("outlineStyle", declaration.value.value);
|
|
3133
|
+
} else {
|
|
3134
|
+
builder.addWarning(
|
|
3135
|
+
"value",
|
|
3136
|
+
declaration.value.type === "auto" ? "auto" : declaration.value.value,
|
|
3137
|
+
);
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
|
|
2848
3141
|
function parseFilter(
|
|
2849
3142
|
declaration: DeclarationType<"filter">,
|
|
2850
3143
|
builder: StylesheetBuilder,
|
|
@@ -2872,6 +3165,16 @@ function parseFilter(
|
|
|
2872
3165
|
[value.type]: parseAngle(value.value, builder),
|
|
2873
3166
|
} as unknown as StyleDescriptor;
|
|
2874
3167
|
case "drop-shadow":
|
|
3168
|
+
return [
|
|
3169
|
+
{},
|
|
3170
|
+
toRNProperty(value.type),
|
|
3171
|
+
[
|
|
3172
|
+
parseLength(value.value.xOffset, builder),
|
|
3173
|
+
parseLength(value.value.yOffset, builder),
|
|
3174
|
+
parseLength(value.value.blur, builder),
|
|
3175
|
+
parseColor(value.value.color, builder),
|
|
3176
|
+
],
|
|
3177
|
+
] as unknown as StyleDescriptor;
|
|
2875
3178
|
case "url":
|
|
2876
3179
|
return;
|
|
2877
3180
|
}
|