react-native-css 3.0.0-nightly.8dd703d → 3.0.0-nightly.9c84741
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/compiler.js +12 -5
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +89 -82
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inheritance.test.js +10 -10
- package/dist/commonjs/compiler/inheritance.test.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 +124 -80
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +18 -6
- 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 +5 -5
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +6 -3
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/injection-code.js +5 -10
- package/dist/commonjs/metro/injection-code.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +18 -8
- package/dist/commonjs/metro/metro-transformer.js.map +1 -1
- package/dist/commonjs/metro/resolver.js +3 -0
- package/dist/commonjs/metro/resolver.js.map +1 -1
- package/dist/commonjs/poison.pill.js +10 -10
- package/dist/commonjs/runtime/native/api.js +8 -2
- package/dist/commonjs/runtime/native/api.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/index.js +4 -2
- package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +14 -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/reactivity.js +11 -0
- package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/calculate-props.js +25 -8
- package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/functions/calc.js +97 -57
- package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/functions/index.js +22 -0
- package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -1
- 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/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 +91 -53
- package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/animation.js +2 -2
- package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js +14 -4
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/transform.js +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/variables.js +3 -3
- package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
- package/dist/commonjs/runtime/utils/objects.js +6 -18
- package/dist/commonjs/runtime/utils/objects.js.map +1 -1
- package/dist/commonjs/runtime/web/api.js.map +1 -1
- package/dist/commonjs/style-collection/index.js +110 -0
- package/dist/commonjs/style-collection/index.js.map +1 -0
- package/dist/commonjs/{runtime/native → style-collection}/root.js +2 -2
- package/dist/commonjs/style-collection/root.js.map +1 -0
- package/dist/module/compiler/compiler.js +12 -5
- 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 +89 -82
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inheritance.test.js +10 -10
- package/dist/module/compiler/inheritance.test.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 +124 -80
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +18 -6
- 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 +2 -2
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +6 -3
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/injection-code.js +5 -10
- package/dist/module/metro/injection-code.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +18 -8
- package/dist/module/metro/metro-transformer.js.map +1 -1
- package/dist/module/metro/resolver.js +3 -0
- package/dist/module/metro/resolver.js.map +1 -1
- package/dist/module/poison.pill.js +10 -10
- package/dist/module/runtime/native/api.js +2 -1
- package/dist/module/runtime/native/api.js.map +1 -1
- package/dist/module/runtime/native/conditions/index.js +4 -2
- package/dist/module/runtime/native/conditions/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +15 -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/reactivity.js +11 -0
- package/dist/module/runtime/native/reactivity.js.map +1 -1
- package/dist/module/runtime/native/styles/calculate-props.js +25 -8
- package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/module/runtime/native/styles/functions/calc.js +97 -56
- package/dist/module/runtime/native/styles/functions/calc.js.map +1 -1
- package/dist/module/runtime/native/styles/functions/index.js +2 -0
- package/dist/module/runtime/native/styles/functions/index.js.map +1 -1
- 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/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 +91 -53
- package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/runtime/native/styles/shorthands/animation.js +1 -1
- package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js +14 -4
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/module/runtime/native/styles/shorthands/transform.js +1 -1
- package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -1
- package/dist/module/runtime/native/styles/variables.js +1 -1
- package/dist/module/runtime/native/styles/variables.js.map +1 -1
- package/dist/module/runtime/utils/objects.js +6 -18
- package/dist/module/runtime/utils/objects.js.map +1 -1
- package/dist/module/runtime/web/api.js.map +1 -1
- package/dist/module/style-collection/index.js +95 -0
- package/dist/module/style-collection/index.js.map +1 -0
- package/dist/module/{runtime/native → style-collection}/root.js +2 -2
- package/dist/module/style-collection/root.js.map +1 -0
- 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 +4 -2
- 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 +1 -0
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +2 -2
- 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 +3 -3
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/injection-code.d.ts +4 -7
- package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +4 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts +3 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/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/reactivity.d.ts.map +1 -1
- 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/functions/calc.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -1
- 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/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.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.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/web/api.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/style-collection/index.d.ts +14 -0
- package/dist/typescript/commonjs/src/style-collection/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/{runtime/native → style-collection}/root.d.ts +1 -1
- package/dist/typescript/commonjs/src/style-collection/root.d.ts.map +1 -0
- 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 +4 -2
- 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 +1 -0
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +2 -2
- 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 +3 -3
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/injection-code.d.ts +4 -7
- package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +4 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts +3 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/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/reactivity.d.ts.map +1 -1
- 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/functions/calc.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -1
- 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/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.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.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/web/api.d.ts +1 -1
- package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/style-collection/index.d.ts +14 -0
- package/dist/typescript/module/src/style-collection/index.d.ts.map +1 -0
- package/dist/typescript/module/src/{runtime/native → style-collection}/root.d.ts +1 -1
- package/dist/typescript/module/src/style-collection/root.d.ts.map +1 -0
- package/package.json +30 -14
- package/src/compiler/compiler.ts +11 -3
- package/src/compiler/compiler.types.ts +11 -14
- package/src/compiler/declarations.ts +157 -121
- package/src/compiler/inheritance.test.ts +9 -9
- package/src/compiler/pseudo-elements.ts +54 -0
- package/src/compiler/selector-builder.ts +136 -81
- package/src/compiler/stylesheet.ts +26 -11
- 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 +3 -2
- package/src/metro/index.ts +8 -6
- package/src/metro/injection-code.ts +6 -10
- package/src/metro/metro-transformer.ts +27 -10
- package/src/metro/resolver.ts +8 -0
- package/src/poison.pill.ts +10 -10
- package/src/runtime/native/api.ts +3 -1
- package/src/runtime/native/conditions/index.ts +4 -2
- package/src/runtime/native/conditions/media-query.ts +16 -12
- package/src/runtime/native/react/rules.ts +27 -17
- package/src/runtime/native/reactivity.ts +12 -0
- package/src/runtime/native/styles/calculate-props.ts +27 -6
- package/src/runtime/native/styles/functions/calc.ts +94 -70
- package/src/runtime/native/styles/functions/index.ts +2 -0
- package/src/runtime/native/styles/functions/numeric-functions.ts +38 -0
- package/src/runtime/native/styles/functions/string-functions.ts +22 -0
- package/src/runtime/native/styles/functions/transform-functions.ts +68 -35
- package/src/runtime/native/styles/shorthands/animation.ts +2 -1
- package/src/runtime/native/styles/shorthands/box-shadow.ts +34 -14
- package/src/runtime/native/styles/shorthands/transform.ts +3 -1
- package/src/runtime/native/styles/variables.ts +5 -1
- package/src/runtime/utils/objects.ts +10 -19
- package/src/runtime/web/api.ts +1 -1
- package/src/style-collection/index.ts +142 -0
- package/src/{runtime/native → style-collection}/root.ts +6 -2
- 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 -99
- package/dist/commonjs/runtime/native/injection.js.map +0 -1
- package/dist/commonjs/runtime/native/root.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 -94
- package/dist/module/runtime/native/injection.js.map +0 -1
- package/dist/module/runtime/native/root.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/root.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/root.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
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
BorderStyle,
|
|
8
8
|
ColorOrAuto,
|
|
9
9
|
CssColor,
|
|
10
|
+
CustomProperty,
|
|
10
11
|
Declaration,
|
|
11
12
|
DimensionPercentageFor_LengthValue,
|
|
12
13
|
EnvironmentVariable,
|
|
@@ -101,6 +102,7 @@ const parsers: {
|
|
|
101
102
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
102
103
|
"border-block-start": parseBorderBlockStart,
|
|
103
104
|
"border-block-start-color": parseColorDeclaration,
|
|
105
|
+
"border-block-start-style": parseBorderStyleDeclaration,
|
|
104
106
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
105
107
|
"border-block-style": parseBorderBlockStyle,
|
|
106
108
|
"border-block-width": parseBorderBlockWidth,
|
|
@@ -238,6 +240,7 @@ const parsers: {
|
|
|
238
240
|
"translate": parseTranslate,
|
|
239
241
|
"user-select": parseUserSelect,
|
|
240
242
|
"vertical-align": parseVerticalAlign,
|
|
243
|
+
"visibility": parseVisibility,
|
|
241
244
|
"width": parseSizeDeclaration,
|
|
242
245
|
"z-index": parseZIndex,
|
|
243
246
|
};
|
|
@@ -435,18 +438,14 @@ function parseBorderBlock(
|
|
|
435
438
|
{ value }: DeclarationType<"border-block">,
|
|
436
439
|
builder: StylesheetBuilder,
|
|
437
440
|
) {
|
|
438
|
-
builder.addDescriptor("border-
|
|
441
|
+
builder.addDescriptor("border-block-color", parseColor(value.color, builder));
|
|
439
442
|
builder.addDescriptor(
|
|
440
|
-
"border-
|
|
441
|
-
parseColor(value.color, builder),
|
|
442
|
-
);
|
|
443
|
-
builder.addDescriptor(
|
|
444
|
-
"border-top-width",
|
|
443
|
+
"border-block-width",
|
|
445
444
|
parseBorderSideWidth(value.width, builder),
|
|
446
445
|
);
|
|
447
446
|
builder.addDescriptor(
|
|
448
|
-
"border-
|
|
449
|
-
|
|
447
|
+
"border-block-style",
|
|
448
|
+
parseBorderStyle(value.style, builder),
|
|
450
449
|
);
|
|
451
450
|
}
|
|
452
451
|
|
|
@@ -454,9 +453,12 @@ function parseBorderBlockStart(
|
|
|
454
453
|
{ value }: DeclarationType<"border-block-start">,
|
|
455
454
|
builder: StylesheetBuilder,
|
|
456
455
|
) {
|
|
457
|
-
builder.addDescriptor("border-top-color", parseColor(value.color, builder));
|
|
458
456
|
builder.addDescriptor(
|
|
459
|
-
"border-
|
|
457
|
+
"border-block-start-color",
|
|
458
|
+
parseColor(value.color, builder),
|
|
459
|
+
);
|
|
460
|
+
builder.addDescriptor(
|
|
461
|
+
"border-block-start-width",
|
|
460
462
|
parseBorderSideWidth(value.width, builder),
|
|
461
463
|
);
|
|
462
464
|
}
|
|
@@ -466,11 +468,11 @@ function parseBorderBlockEnd(
|
|
|
466
468
|
builder: StylesheetBuilder,
|
|
467
469
|
) {
|
|
468
470
|
builder.addDescriptor(
|
|
469
|
-
"border-
|
|
471
|
+
"border-block-end-color",
|
|
470
472
|
parseColor(value.color, builder),
|
|
471
473
|
);
|
|
472
474
|
builder.addDescriptor(
|
|
473
|
-
"border-
|
|
475
|
+
"border-block-end-width",
|
|
474
476
|
parseBorderSideWidth(value.width, builder),
|
|
475
477
|
);
|
|
476
478
|
}
|
|
@@ -479,38 +481,54 @@ function parseBorderInline(
|
|
|
479
481
|
{ value }: DeclarationType<"border-inline">,
|
|
480
482
|
builder: StylesheetBuilder,
|
|
481
483
|
) {
|
|
482
|
-
builder.addDescriptor("border-left-color", parseColor(value.color, builder));
|
|
483
|
-
builder.addDescriptor("border-right-color", parseColor(value.color, builder));
|
|
484
484
|
builder.addDescriptor(
|
|
485
|
-
"border-
|
|
486
|
-
|
|
485
|
+
"border-inline-color",
|
|
486
|
+
parseColor(value.color, builder),
|
|
487
487
|
);
|
|
488
488
|
builder.addDescriptor(
|
|
489
|
-
"border-
|
|
489
|
+
"border-inline-width",
|
|
490
490
|
parseBorderSideWidth(value.width, builder),
|
|
491
491
|
);
|
|
492
|
+
builder.addDescriptor(
|
|
493
|
+
"border-inline-style",
|
|
494
|
+
parseBorderStyle(value.style, builder),
|
|
495
|
+
);
|
|
492
496
|
}
|
|
493
497
|
|
|
494
498
|
function parseBorderInlineStart(
|
|
495
499
|
{ value }: DeclarationType<"border-inline-start">,
|
|
496
500
|
builder: StylesheetBuilder,
|
|
497
501
|
) {
|
|
498
|
-
builder.addDescriptor("border-left-color", parseColor(value.color, builder));
|
|
499
502
|
builder.addDescriptor(
|
|
500
|
-
"border-
|
|
503
|
+
"border-inline-start-color",
|
|
504
|
+
parseColor(value.color, builder),
|
|
505
|
+
);
|
|
506
|
+
builder.addDescriptor(
|
|
507
|
+
"border-inline-start-width",
|
|
501
508
|
parseBorderSideWidth(value.width, builder),
|
|
502
509
|
);
|
|
510
|
+
builder.addDescriptor(
|
|
511
|
+
"border-inline-start-style",
|
|
512
|
+
parseBorderStyle(value.style, builder),
|
|
513
|
+
);
|
|
503
514
|
}
|
|
504
515
|
|
|
505
516
|
function parseBorderInlineEnd(
|
|
506
517
|
{ value }: DeclarationType<"border-inline-end">,
|
|
507
518
|
builder: StylesheetBuilder,
|
|
508
519
|
) {
|
|
509
|
-
builder.addDescriptor("border-right-color", parseColor(value.color, builder));
|
|
510
520
|
builder.addDescriptor(
|
|
511
|
-
"border-
|
|
521
|
+
"border-inline-end-color",
|
|
522
|
+
parseColor(value.color, builder),
|
|
523
|
+
);
|
|
524
|
+
builder.addDescriptor(
|
|
525
|
+
"border-inline-end-width",
|
|
512
526
|
parseBorderSideWidth(value.width, builder),
|
|
513
527
|
);
|
|
528
|
+
builder.addDescriptor(
|
|
529
|
+
"border-inline-end-style",
|
|
530
|
+
parseBorderStyle(value.style, builder),
|
|
531
|
+
);
|
|
514
532
|
}
|
|
515
533
|
|
|
516
534
|
export function parseBorderInlineWidth(
|
|
@@ -518,13 +536,9 @@ export function parseBorderInlineWidth(
|
|
|
518
536
|
builder: StylesheetBuilder,
|
|
519
537
|
) {
|
|
520
538
|
builder.addDescriptor(
|
|
521
|
-
"border-
|
|
539
|
+
"border-inline-width",
|
|
522
540
|
parseBorderSideWidth(declaration.value.start, builder),
|
|
523
541
|
);
|
|
524
|
-
builder.addDescriptor(
|
|
525
|
-
"border-right-width",
|
|
526
|
-
parseBorderSideWidth(declaration.value.end, builder),
|
|
527
|
-
);
|
|
528
542
|
}
|
|
529
543
|
|
|
530
544
|
export function parseBorderInlineStyle(
|
|
@@ -537,16 +551,23 @@ export function parseBorderInlineStyle(
|
|
|
537
551
|
) {
|
|
538
552
|
if (typeof declaration.value === "string") {
|
|
539
553
|
builder.addDescriptor(
|
|
540
|
-
|
|
554
|
+
declaration.property,
|
|
541
555
|
parseBorderStyle(declaration.value, builder),
|
|
542
556
|
);
|
|
543
557
|
} else if (declaration.value.start === declaration.value.end) {
|
|
544
558
|
builder.addDescriptor(
|
|
545
|
-
|
|
559
|
+
declaration.property,
|
|
546
560
|
parseBorderStyle(declaration.value.start, builder),
|
|
547
561
|
);
|
|
548
562
|
} else {
|
|
549
|
-
builder.
|
|
563
|
+
builder.addDescriptor(
|
|
564
|
+
"border-inline-start-style",
|
|
565
|
+
parseBorderStyle(declaration.value.start, builder),
|
|
566
|
+
);
|
|
567
|
+
builder.addDescriptor(
|
|
568
|
+
"border-inline-end-style",
|
|
569
|
+
parseBorderStyle(declaration.value.end, builder),
|
|
570
|
+
);
|
|
550
571
|
}
|
|
551
572
|
}
|
|
552
573
|
|
|
@@ -955,6 +976,12 @@ export function parseCustomDeclaration(
|
|
|
955
976
|
parseUnparsed(declaration.value.value, builder, property) ===
|
|
956
977
|
"borderless",
|
|
957
978
|
);
|
|
979
|
+
} else if (property === "object-fit") {
|
|
980
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1046
|
|
981
|
+
parseObjectFit(declaration.value, builder);
|
|
982
|
+
} else if (property === "object-position") {
|
|
983
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1047
|
|
984
|
+
parseObjectPosition(declaration.value, builder);
|
|
958
985
|
} else if (
|
|
959
986
|
validProperties.has(property) ||
|
|
960
987
|
property.startsWith("--") ||
|
|
@@ -1119,43 +1146,53 @@ export function parseUnparsed(
|
|
|
1119
1146
|
}
|
|
1120
1147
|
case "function": {
|
|
1121
1148
|
switch (tokenOrValue.value.name) {
|
|
1122
|
-
case "translate":
|
|
1123
|
-
case "rotate":
|
|
1124
|
-
case "rotateX":
|
|
1125
|
-
case "rotateY":
|
|
1126
|
-
case "skewX":
|
|
1127
|
-
case "skewY":
|
|
1128
|
-
case "scale":
|
|
1129
|
-
case "scaleX":
|
|
1130
|
-
case "scaleY":
|
|
1131
|
-
case "translateX":
|
|
1132
|
-
case "translateY":
|
|
1133
|
-
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
1134
1149
|
case "blur":
|
|
1135
1150
|
case "brightness":
|
|
1136
1151
|
case "contrast":
|
|
1137
1152
|
case "cubic-bezier":
|
|
1138
1153
|
case "drop-shadow":
|
|
1139
1154
|
case "fontScale":
|
|
1155
|
+
case "getPixelSizeForLayoutSize":
|
|
1140
1156
|
case "grayscale":
|
|
1141
1157
|
case "hsl":
|
|
1142
1158
|
case "hsla":
|
|
1143
1159
|
case "hue-rotate":
|
|
1144
1160
|
case "invert":
|
|
1145
|
-
case "linear-gradient":
|
|
1146
1161
|
case "opacity":
|
|
1147
1162
|
case "pixelScale":
|
|
1148
|
-
case "getPixelSizeForLayoutSize":
|
|
1149
1163
|
case "platformColor":
|
|
1150
|
-
case "radial-gradient":
|
|
1151
1164
|
case "rgb":
|
|
1152
1165
|
case "rgba":
|
|
1166
|
+
case "rotate":
|
|
1167
|
+
case "rotateX":
|
|
1168
|
+
case "rotateY":
|
|
1153
1169
|
case "roundToNearestPixel":
|
|
1154
1170
|
case "saturate":
|
|
1171
|
+
case "scale":
|
|
1172
|
+
case "scaleX":
|
|
1173
|
+
case "scaleY":
|
|
1155
1174
|
case "sepia":
|
|
1156
1175
|
case "shadow":
|
|
1176
|
+
case "skewX":
|
|
1177
|
+
case "skewY":
|
|
1157
1178
|
case "steps":
|
|
1179
|
+
case "translate":
|
|
1180
|
+
case "translateX":
|
|
1181
|
+
case "translateY":
|
|
1158
1182
|
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
1183
|
+
case "linear-gradient":
|
|
1184
|
+
case "radial-gradient":
|
|
1185
|
+
// These are special as React Native requires the '-' in their name
|
|
1186
|
+
return [
|
|
1187
|
+
{},
|
|
1188
|
+
tokenOrValue.value.name,
|
|
1189
|
+
reduceParseUnparsed(
|
|
1190
|
+
tokenOrValue.value.arguments,
|
|
1191
|
+
builder,
|
|
1192
|
+
property,
|
|
1193
|
+
allowAuto,
|
|
1194
|
+
),
|
|
1195
|
+
];
|
|
1159
1196
|
case "hairlineWidth":
|
|
1160
1197
|
return [{}, tokenOrValue.value.name, []];
|
|
1161
1198
|
case "calc":
|
|
@@ -1188,7 +1225,7 @@ export function parseUnparsed(
|
|
|
1188
1225
|
return;
|
|
1189
1226
|
}
|
|
1190
1227
|
|
|
1191
|
-
if (value === "inherit") {
|
|
1228
|
+
if (value === "inherit" || value === "initial") {
|
|
1192
1229
|
builder.addWarning("value", value);
|
|
1193
1230
|
return;
|
|
1194
1231
|
} else if (value === "currentcolor") {
|
|
@@ -1993,12 +2030,9 @@ export function parseOverflow(
|
|
|
1993
2030
|
}
|
|
1994
2031
|
|
|
1995
2032
|
export function parseBorderStyleDeclaration(
|
|
1996
|
-
declaration:
|
|
1997
|
-
|
|
1998
|
-
|
|
|
1999
|
-
| "border-right-style"
|
|
2000
|
-
| "border-top-style"
|
|
2001
|
-
| "border-bottom-style"
|
|
2033
|
+
declaration: Extract<
|
|
2034
|
+
DeclarationType<Declaration["property"]>,
|
|
2035
|
+
{ value: LineStyle | BorderStyle }
|
|
2002
2036
|
>,
|
|
2003
2037
|
builder: StylesheetBuilder,
|
|
2004
2038
|
) {
|
|
@@ -2036,27 +2070,29 @@ export function parseBorderBlockWidth(
|
|
|
2036
2070
|
declaration: DeclarationType<"border-block-width">,
|
|
2037
2071
|
builder: StylesheetBuilder,
|
|
2038
2072
|
) {
|
|
2039
|
-
builder
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
)
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2073
|
+
const start = parseBorderSideWidth(declaration.value.start, builder);
|
|
2074
|
+
const end = parseBorderSideWidth(declaration.value.end, builder);
|
|
2075
|
+
|
|
2076
|
+
if (start === end) {
|
|
2077
|
+
builder.addDescriptor("border-block-width", start);
|
|
2078
|
+
} else {
|
|
2079
|
+
builder.addDescriptor("border-block-start-width", start);
|
|
2080
|
+
builder.addDescriptor("border-block-end-width", end);
|
|
2081
|
+
}
|
|
2047
2082
|
}
|
|
2048
2083
|
|
|
2049
2084
|
function parseBorderBlockStyle(
|
|
2050
2085
|
declaration: DeclarationType<"border-block-style">,
|
|
2051
2086
|
builder: StylesheetBuilder,
|
|
2052
2087
|
) {
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
);
|
|
2088
|
+
const start = parseBorderStyle(declaration.value.start, builder);
|
|
2089
|
+
const end = parseBorderStyle(declaration.value.end, builder);
|
|
2090
|
+
|
|
2091
|
+
if (start == end) {
|
|
2092
|
+
builder.addDescriptor("border-block-style", start);
|
|
2058
2093
|
} else {
|
|
2059
|
-
builder.
|
|
2094
|
+
builder.addDescriptor("border-block-start-style", start);
|
|
2095
|
+
builder.addDescriptor("border-block-end-style", end);
|
|
2060
2096
|
}
|
|
2061
2097
|
}
|
|
2062
2098
|
|
|
@@ -2073,21 +2109,10 @@ export function parseBorderSideWidthDeclaration(
|
|
|
2073
2109
|
>,
|
|
2074
2110
|
builder: StylesheetBuilder,
|
|
2075
2111
|
) {
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
);
|
|
2081
|
-
return;
|
|
2082
|
-
} else if (declaration.property.includes("inline")) {
|
|
2083
|
-
builder.addDescriptor(
|
|
2084
|
-
`border-${declaration.property.includes("start") ? "left" : "right"}-width`,
|
|
2085
|
-
parseBorderSideWidth(declaration.value, builder),
|
|
2086
|
-
);
|
|
2087
|
-
return;
|
|
2088
|
-
} else {
|
|
2089
|
-
return parseBorderSideWidth(declaration.value, builder);
|
|
2090
|
-
}
|
|
2112
|
+
builder.addDescriptor(
|
|
2113
|
+
declaration.property,
|
|
2114
|
+
parseBorderSideWidth(declaration.value, builder),
|
|
2115
|
+
);
|
|
2091
2116
|
}
|
|
2092
2117
|
|
|
2093
2118
|
export function parseBorderSideWidth(
|
|
@@ -2536,9 +2561,7 @@ export function parseCalcArguments(
|
|
|
2536
2561
|
) {
|
|
2537
2562
|
const parsed: StyleDescriptor[] = [];
|
|
2538
2563
|
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
for (const [currentIndex, arg] of args.entries()) {
|
|
2564
|
+
for (const arg of args) {
|
|
2542
2565
|
switch (arg.type) {
|
|
2543
2566
|
case "env": {
|
|
2544
2567
|
parsed.push(parseEnv(arg.value, builder));
|
|
@@ -2558,11 +2581,9 @@ export function parseCalcArguments(
|
|
|
2558
2581
|
}
|
|
2559
2582
|
case "length": {
|
|
2560
2583
|
const value = parseLength(arg.value, builder);
|
|
2561
|
-
|
|
2562
2584
|
if (value !== undefined) {
|
|
2563
2585
|
parsed.push(value);
|
|
2564
2586
|
}
|
|
2565
|
-
|
|
2566
2587
|
break;
|
|
2567
2588
|
}
|
|
2568
2589
|
case "color":
|
|
@@ -2585,49 +2606,19 @@ export function parseCalcArguments(
|
|
|
2585
2606
|
}
|
|
2586
2607
|
break;
|
|
2587
2608
|
case "percentage":
|
|
2588
|
-
|
|
2589
|
-
if (mode !== "percentage") return;
|
|
2590
|
-
parsed.push(`${arg.value.value * 100}%`);
|
|
2609
|
+
parsed.push(`${round(arg.value.value * 100)}%`);
|
|
2591
2610
|
break;
|
|
2592
2611
|
case "number": {
|
|
2593
|
-
|
|
2594
|
-
if (mode !== "number") return;
|
|
2595
|
-
parsed.push(arg.value.value);
|
|
2612
|
+
parsed.push(round(arg.value.value));
|
|
2596
2613
|
break;
|
|
2597
2614
|
}
|
|
2598
2615
|
case "parenthesis-block": {
|
|
2599
|
-
|
|
2600
|
-
* If we have a parenthesis block, we just treat it as a nested calc function
|
|
2601
|
-
* Because there could be multiple parenthesis blocks, this is recursive
|
|
2602
|
-
*/
|
|
2603
|
-
let closeParenthesisIndex = -1;
|
|
2604
|
-
for (let index = args.length - 1; index > 0; index--) {
|
|
2605
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2606
|
-
const value = args[index]!;
|
|
2607
|
-
if (
|
|
2608
|
-
value.type === "token" &&
|
|
2609
|
-
value.value.type === "close-parenthesis"
|
|
2610
|
-
) {
|
|
2611
|
-
closeParenthesisIndex = index;
|
|
2612
|
-
break;
|
|
2613
|
-
}
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
|
-
if (closeParenthesisIndex === -1) {
|
|
2617
|
-
return;
|
|
2618
|
-
}
|
|
2619
|
-
|
|
2620
|
-
const innerCalcArgs = args
|
|
2621
|
-
// Extract the inner calcArgs including the parenthesis. This mutates args
|
|
2622
|
-
.splice(currentIndex, closeParenthesisIndex - currentIndex + 1)
|
|
2623
|
-
// Then drop the surrounding parenthesis
|
|
2624
|
-
.slice(1, -1);
|
|
2625
|
-
|
|
2626
|
-
parsed.push(parseCalcFn("calc", innerCalcArgs, builder, property));
|
|
2627
|
-
|
|
2616
|
+
parsed.push("(");
|
|
2628
2617
|
break;
|
|
2629
2618
|
}
|
|
2630
2619
|
case "close-parenthesis":
|
|
2620
|
+
parsed.push(")");
|
|
2621
|
+
break;
|
|
2631
2622
|
case "string":
|
|
2632
2623
|
case "function":
|
|
2633
2624
|
case "ident":
|
|
@@ -2809,7 +2800,12 @@ export function addTransitionValue(
|
|
|
2809
2800
|
declaration.property,
|
|
2810
2801
|
declaration.value
|
|
2811
2802
|
.map((v) => v.property)
|
|
2812
|
-
.filter(
|
|
2803
|
+
.filter(
|
|
2804
|
+
(v) =>
|
|
2805
|
+
(v in parsers && !["visibility"].includes(v)) ||
|
|
2806
|
+
v === "all" ||
|
|
2807
|
+
v === "none",
|
|
2808
|
+
)
|
|
2813
2809
|
.map((v) => toRNProperty(v)),
|
|
2814
2810
|
);
|
|
2815
2811
|
return;
|
|
@@ -3008,6 +3004,46 @@ function parseGradientItem(
|
|
|
3008
3004
|
}
|
|
3009
3005
|
}
|
|
3010
3006
|
|
|
3007
|
+
function parseObjectFit(
|
|
3008
|
+
declaration: CustomProperty,
|
|
3009
|
+
builder: StylesheetBuilder,
|
|
3010
|
+
) {
|
|
3011
|
+
builder.addMapping({
|
|
3012
|
+
"object-fit": "contentFit",
|
|
3013
|
+
});
|
|
3014
|
+
builder.addDescriptor(
|
|
3015
|
+
"object-fit",
|
|
3016
|
+
parseUnparsed(declaration.value, builder, "object-fit"),
|
|
3017
|
+
);
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
function parseObjectPosition(
|
|
3021
|
+
declaration: CustomProperty,
|
|
3022
|
+
builder: StylesheetBuilder,
|
|
3023
|
+
) {
|
|
3024
|
+
builder.addMapping({
|
|
3025
|
+
"object-position": "contentPosition",
|
|
3026
|
+
});
|
|
3027
|
+
builder.addDescriptor("object-position", [
|
|
3028
|
+
{},
|
|
3029
|
+
"join",
|
|
3030
|
+
[parseUnparsed(declaration.value, builder, "object-position"), " "],
|
|
3031
|
+
]);
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
function parseVisibility(
|
|
3035
|
+
declaration: DeclarationType<"visibility">,
|
|
3036
|
+
builder: StylesheetBuilder,
|
|
3037
|
+
) {
|
|
3038
|
+
if (declaration.value === "visible") {
|
|
3039
|
+
builder.addDescriptor("opacity", 1);
|
|
3040
|
+
} else if (declaration.value === "hidden") {
|
|
3041
|
+
builder.addDescriptor("opacity", 0);
|
|
3042
|
+
} else {
|
|
3043
|
+
builder.addWarning("value", declaration.value);
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3011
3047
|
function parseFilter(
|
|
3012
3048
|
declaration: DeclarationType<"filter">,
|
|
3013
3049
|
builder: StylesheetBuilder,
|
|
@@ -12,7 +12,7 @@ test("nested classes", () => {
|
|
|
12
12
|
"my-class",
|
|
13
13
|
[
|
|
14
14
|
{
|
|
15
|
-
c: ["my-class"],
|
|
15
|
+
c: ["g:my-class"],
|
|
16
16
|
s: [0],
|
|
17
17
|
},
|
|
18
18
|
],
|
|
@@ -21,7 +21,7 @@ test("nested classes", () => {
|
|
|
21
21
|
"test",
|
|
22
22
|
[
|
|
23
23
|
{
|
|
24
|
-
cq: [{ n: "my-class" }],
|
|
24
|
+
cq: [{ n: "g:my-class" }],
|
|
25
25
|
d: [{ color: "#f00" }],
|
|
26
26
|
v: [["__rn-css-color", "#f00"]],
|
|
27
27
|
s: [1, 2],
|
|
@@ -44,7 +44,7 @@ test("multiple tiers classes", () => {
|
|
|
44
44
|
"one",
|
|
45
45
|
[
|
|
46
46
|
{
|
|
47
|
-
c: ["one"],
|
|
47
|
+
c: ["g:one"],
|
|
48
48
|
s: [0],
|
|
49
49
|
},
|
|
50
50
|
],
|
|
@@ -53,7 +53,7 @@ test("multiple tiers classes", () => {
|
|
|
53
53
|
"two",
|
|
54
54
|
[
|
|
55
55
|
{
|
|
56
|
-
c: ["two"],
|
|
56
|
+
c: ["g:two"],
|
|
57
57
|
s: [0],
|
|
58
58
|
},
|
|
59
59
|
],
|
|
@@ -62,7 +62,7 @@ test("multiple tiers classes", () => {
|
|
|
62
62
|
"test",
|
|
63
63
|
[
|
|
64
64
|
{
|
|
65
|
-
cq: [{ n: "one" }, { n: "two" }],
|
|
65
|
+
cq: [{ n: "g:one" }, { n: "g:two" }],
|
|
66
66
|
d: [{ color: "#f00" }],
|
|
67
67
|
v: [["__rn-css-color", "#f00"]],
|
|
68
68
|
s: [1, 3],
|
|
@@ -85,7 +85,7 @@ test("tiers with multiple classes", () => {
|
|
|
85
85
|
"one",
|
|
86
86
|
[
|
|
87
87
|
{
|
|
88
|
-
c: ["one"],
|
|
88
|
+
c: ["g:one"],
|
|
89
89
|
s: [0],
|
|
90
90
|
},
|
|
91
91
|
],
|
|
@@ -94,7 +94,7 @@ test("tiers with multiple classes", () => {
|
|
|
94
94
|
"three",
|
|
95
95
|
[
|
|
96
96
|
{
|
|
97
|
-
c: ["three.two"],
|
|
97
|
+
c: ["g:three.two"],
|
|
98
98
|
s: [0],
|
|
99
99
|
aq: [["a", "className", "*=", "two"]],
|
|
100
100
|
},
|
|
@@ -105,9 +105,9 @@ test("tiers with multiple classes", () => {
|
|
|
105
105
|
[
|
|
106
106
|
{
|
|
107
107
|
cq: [
|
|
108
|
-
{ n: "one" },
|
|
108
|
+
{ n: "g:one" },
|
|
109
109
|
{
|
|
110
|
-
n: "three.two",
|
|
110
|
+
n: "g:three.two",
|
|
111
111
|
},
|
|
112
112
|
],
|
|
113
113
|
d: [{ color: "#f00" }],
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { isStyleFunction } from "../runtime/utils";
|
|
2
|
+
import type { StyleDeclaration, StyleRule } from "./compiler.types";
|
|
3
|
+
|
|
4
|
+
export function modifyRuleForSelection(rule: StyleRule): StyleRule | undefined {
|
|
5
|
+
if (!rule.d) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
rule.d = rule.d.flatMap((declaration): StyleDeclaration[] => {
|
|
10
|
+
return modifyStyleDeclaration(declaration, "color", "selectionColor");
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
return rule;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function modifyRuleForPlaceholder(
|
|
17
|
+
rule: StyleRule,
|
|
18
|
+
): StyleRule | undefined {
|
|
19
|
+
if (!rule.d) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
rule.d = rule.d.flatMap((declaration): StyleDeclaration[] => {
|
|
24
|
+
return modifyStyleDeclaration(declaration, "color", "placeholderTextColor");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return rule;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function modifyStyleDeclaration(
|
|
31
|
+
declaration: StyleDeclaration,
|
|
32
|
+
from: string,
|
|
33
|
+
to: string,
|
|
34
|
+
): StyleDeclaration[] {
|
|
35
|
+
if (Array.isArray(declaration)) {
|
|
36
|
+
if (isStyleFunction(declaration) && declaration[2] === from) {
|
|
37
|
+
declaration = [...declaration] as StyleDeclaration;
|
|
38
|
+
declaration[2] = [to];
|
|
39
|
+
return [declaration];
|
|
40
|
+
} else if (declaration[1] === from) {
|
|
41
|
+
declaration = [...declaration] as StyleDeclaration;
|
|
42
|
+
declaration[1] = [to];
|
|
43
|
+
return [declaration];
|
|
44
|
+
}
|
|
45
|
+
} else if (typeof declaration === "object") {
|
|
46
|
+
const { color: selectionColor, ...rest } = declaration;
|
|
47
|
+
|
|
48
|
+
if (selectionColor) {
|
|
49
|
+
return [rest, [selectionColor, [to]]] as StyleDeclaration[];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return [declaration];
|
|
54
|
+
}
|