react-native-css 3.0.0-nightly.75f8b74 → 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/atRules.js +16 -3
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +37 -21
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +255 -154
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inheritance.test.js +15 -15
- 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 +137 -46
- 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 +30 -12
- 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 +14 -11
- package/dist/commonjs/poison.pill.js.map +1 -1
- package/dist/commonjs/runtime/native/api.js +8 -2
- package/dist/commonjs/runtime/native/api.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
- package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
- package/dist/commonjs/runtime/native/conditions/container-query.js +28 -21
- package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/index.js +12 -46
- package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +26 -21
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/runtime/native/react/interaction.js +10 -10
- package/dist/commonjs/runtime/native/react/interaction.js.map +1 -1
- package/dist/commonjs/runtime/native/react/rules.js +33 -27
- package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
- package/dist/commonjs/runtime/native/react/useNativeCss.js +3 -2
- package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/runtime/native/reactivity.js +12 -12
- 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 +63 -38
- 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/index.js +12 -12
- package/dist/commonjs/runtime/native/styles/index.js.map +1 -1
- 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 +7 -4
- package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/variables.js +3 -2
- package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
- package/dist/commonjs/runtime/utils/objects.js +14 -6
- package/dist/commonjs/runtime/utils/objects.js.map +1 -1
- package/dist/commonjs/runtime/utils/specificity.js +2 -1
- package/dist/commonjs/runtime/utils/specificity.js.map +1 -1
- package/dist/commonjs/runtime/web/api.js.map +1 -1
- package/dist/commonjs/style-collection/index.js +110 -0
- package/dist/commonjs/style-collection/index.js.map +1 -0
- package/dist/commonjs/style-collection/root.js +28 -0
- package/dist/commonjs/style-collection/root.js.map +1 -0
- package/dist/module/compiler/atRules.js +16 -3
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +37 -21
- 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 +250 -150
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inheritance.test.js +15 -15
- 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 +136 -45
- 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 +28 -10
- 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 +14 -11
- package/dist/module/poison.pill.js.map +1 -1
- package/dist/module/runtime/native/api.js +2 -1
- package/dist/module/runtime/native/api.js.map +1 -1
- package/dist/module/runtime/native/conditions/attributes.js +38 -0
- package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
- package/dist/module/runtime/native/conditions/container-query.js +28 -21
- package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/module/runtime/native/conditions/guards.js.map +1 -1
- package/dist/module/runtime/native/conditions/index.js +12 -46
- package/dist/module/runtime/native/conditions/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +27 -22
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/module/runtime/native/react/interaction.js +10 -10
- package/dist/module/runtime/native/react/interaction.js.map +1 -1
- package/dist/module/runtime/native/react/rules.js +31 -26
- package/dist/module/runtime/native/react/rules.js.map +1 -1
- package/dist/module/runtime/native/react/useNativeCss.js +2 -1
- package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/module/runtime/native/reactivity.js +11 -11
- 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 +64 -39
- 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/index.js +12 -12
- package/dist/module/runtime/native/styles/index.js.map +1 -1
- 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 +7 -4
- package/dist/module/runtime/native/styles/units.js.map +1 -1
- package/dist/module/runtime/native/styles/variables.js +2 -1
- package/dist/module/runtime/native/styles/variables.js.map +1 -1
- package/dist/module/runtime/utils/objects.js +14 -6
- package/dist/module/runtime/utils/objects.js.map +1 -1
- package/dist/module/runtime/utils/specificity.js +2 -1
- package/dist/module/runtime/utils/specificity.js.map +1 -1
- package/dist/module/runtime/web/api.js.map +1 -1
- package/dist/module/style-collection/index.js +95 -0
- package/dist/module/style-collection/index.js.map +1 -0
- package/dist/module/style-collection/root.js +24 -0
- package/dist/module/style-collection/root.js.map +1 -0
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +9 -2
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +16 -17
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +18 -19
- 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 +23 -9
- 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 +20 -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/poison.pill.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts +3 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts +3 -3
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/react/interaction.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 +2 -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 +2 -10
- 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 +1 -1
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/style-collection/index.d.ts +14 -0
- package/dist/typescript/commonjs/src/style-collection/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/style-collection/root.d.ts +11 -0
- package/dist/typescript/commonjs/src/style-collection/root.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts +9 -2
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +16 -17
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +18 -19
- 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 +23 -9
- 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 +20 -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/poison.pill.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts +3 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts +3 -3
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/interaction.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/react/interaction.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 +2 -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 +2 -10
- 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 +1 -1
- package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/style-collection/index.d.ts +14 -0
- package/dist/typescript/module/src/style-collection/index.d.ts.map +1 -0
- package/dist/typescript/module/src/style-collection/root.d.ts +11 -0
- package/dist/typescript/module/src/style-collection/root.d.ts.map +1 -0
- package/package.json +32 -16
- package/src/compiler/atRules.ts +17 -3
- package/src/compiler/compiler.ts +40 -33
- package/src/compiler/compiler.types.ts +18 -19
- package/src/compiler/declarations.ts +447 -192
- package/src/compiler/inheritance.test.ts +13 -13
- 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 +188 -53
- 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 +35 -10
- 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 +15 -11
- package/src/runtime/native/api.ts +3 -1
- package/src/runtime/native/conditions/attributes.ts +52 -0
- package/src/runtime/native/conditions/container-query.ts +27 -22
- package/src/runtime/native/conditions/guards.ts +1 -2
- package/src/runtime/native/conditions/index.ts +14 -66
- package/src/runtime/native/conditions/media-query.ts +29 -25
- package/src/runtime/native/react/interaction.ts +12 -12
- package/src/runtime/native/react/rules.ts +34 -24
- package/src/runtime/native/react/useNativeCss.ts +4 -1
- package/src/runtime/native/reactivity.ts +14 -21
- package/src/runtime/native/reanimated.ts +22 -0
- package/src/runtime/native/styles/calculate-props.ts +71 -39
- 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/index.ts +12 -12
- 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 +8 -4
- package/src/runtime/native/styles/variables.ts +5 -5
- package/src/runtime/utils/objects.ts +16 -4
- package/src/runtime/utils/specificity.ts +1 -0
- package/src/runtime/web/api.ts +1 -1
- package/src/style-collection/index.ts +142 -0
- package/src/style-collection/root.ts +35 -0
- package/dist/commonjs/compiler/attributes.test.js +0 -20
- package/dist/commonjs/compiler/attributes.test.js.map +0 -1
- package/dist/commonjs/doctor/index.js +0 -6
- package/dist/commonjs/doctor/index.js.map +0 -1
- package/dist/commonjs/runtime/native/injection.js +0 -98
- package/dist/commonjs/runtime/native/injection.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/animation.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/border.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/box-shadow.js +0 -40
- package/dist/commonjs/runtime/native/styles/box-shadow.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/calc.js +0 -85
- package/dist/commonjs/runtime/native/styles/calc.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/filters.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/platform-functions.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/shorthand.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/text-shadow.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/transform.js.map +0 -1
- package/dist/module/compiler/attributes.test.js +0 -20
- package/dist/module/compiler/attributes.test.js.map +0 -1
- package/dist/module/doctor/index.js +0 -4
- package/dist/module/doctor/index.js.map +0 -1
- package/dist/module/runtime/native/injection.js +0 -93
- package/dist/module/runtime/native/injection.js.map +0 -1
- package/dist/module/runtime/native/styles/animation.js.map +0 -1
- package/dist/module/runtime/native/styles/border.js.map +0 -1
- package/dist/module/runtime/native/styles/box-shadow.js.map +0 -1
- package/dist/module/runtime/native/styles/calc.js +0 -79
- package/dist/module/runtime/native/styles/calc.js.map +0 -1
- package/dist/module/runtime/native/styles/filters.js.map +0 -1
- package/dist/module/runtime/native/styles/platform-functions.js.map +0 -1
- package/dist/module/runtime/native/styles/shorthand.js.map +0 -1
- package/dist/module/runtime/native/styles/text-shadow.js.map +0 -1
- package/dist/module/runtime/native/styles/transform.js.map +0 -1
- package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts +0 -2
- package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/doctor/index.d.ts +0 -2
- package/dist/typescript/commonjs/src/doctor/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +0 -16
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +0 -9
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts +0 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts +0 -3
- package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts +0 -3
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +0 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +0 -1
- package/dist/typescript/module/src/compiler/attributes.test.d.ts +0 -2
- package/dist/typescript/module/src/compiler/attributes.test.d.ts.map +0 -1
- package/dist/typescript/module/src/doctor/index.d.ts +0 -2
- package/dist/typescript/module/src/doctor/index.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts +0 -16
- package/dist/typescript/module/src/runtime/native/injection.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +0 -9
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/border.d.ts +0 -2
- package/dist/typescript/module/src/runtime/native/styles/border.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts +0 -3
- package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts +0 -3
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/filters.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +0 -2
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +0 -1
- package/src/compiler/attributes.test.ts +0 -28
- package/src/doctor/index.ts +0 -1
- package/src/runtime/native/injection.ts +0 -131
- package/src/runtime/native/styles/box-shadow.ts +0 -54
- package/src/runtime/native/styles/calc.ts +0 -97
package/src/metro/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ import connect from "connect";
|
|
|
6
6
|
import debug from "debug";
|
|
7
7
|
import type { MetroConfig } from "metro-config";
|
|
8
8
|
|
|
9
|
-
import type { CompilerOptions } from "../compiler";
|
|
9
|
+
import type { CompilerOptions, ReactNativeCssStyleSheet } from "../compiler";
|
|
10
10
|
import { compile } from "../compiler/compiler";
|
|
11
11
|
import { getNativeInjectionCode, getWebInjectionCode } from "./injection-code";
|
|
12
12
|
import { nativeResolver, webResolver } from "./resolver";
|
|
@@ -53,16 +53,18 @@ export function withReactNativeCSS<
|
|
|
53
53
|
const originalMiddleware = config.server?.enhanceMiddleware;
|
|
54
54
|
const originalResolver = config.resolver?.resolveRequest;
|
|
55
55
|
|
|
56
|
-
const poisonPillPath = "./poison.pill";
|
|
57
|
-
|
|
58
56
|
return {
|
|
59
57
|
...config,
|
|
60
58
|
transformerPath: require.resolve("./metro-transformer"),
|
|
59
|
+
transformer: {
|
|
60
|
+
...config.transformer,
|
|
61
|
+
reactNativeCSS: options,
|
|
62
|
+
},
|
|
61
63
|
resolver: {
|
|
62
64
|
...config.resolver,
|
|
63
65
|
sourceExts: [...(config?.resolver?.sourceExts || []), "css"],
|
|
64
66
|
resolveRequest: (context, moduleName, platform) => {
|
|
65
|
-
if (moduleName
|
|
67
|
+
if (moduleName.includes("poison.pill")) {
|
|
66
68
|
return { type: "empty" };
|
|
67
69
|
}
|
|
68
70
|
|
|
@@ -93,7 +95,10 @@ export function withReactNativeCSS<
|
|
|
93
95
|
if (!bundler.__react_native_css__patched) {
|
|
94
96
|
bundler.__react_native_css__patched = true;
|
|
95
97
|
|
|
96
|
-
const nativeCSSFiles = new Map
|
|
98
|
+
const nativeCSSFiles = new Map<
|
|
99
|
+
string,
|
|
100
|
+
[string, ReactNativeCssStyleSheet]
|
|
101
|
+
>();
|
|
97
102
|
const webCSSFiles = new Set<string>();
|
|
98
103
|
|
|
99
104
|
const nativeInjectionPath = require.resolve(
|
|
@@ -158,7 +163,7 @@ export function withReactNativeCSS<
|
|
|
158
163
|
// Let the transformer know that we will handle compilation
|
|
159
164
|
customTransformOptions: {
|
|
160
165
|
...transformOptions.customTransformOptions,
|
|
161
|
-
|
|
166
|
+
reactNativeCSS: options,
|
|
162
167
|
},
|
|
163
168
|
},
|
|
164
169
|
fileBuffer,
|
|
@@ -174,7 +179,7 @@ export function withReactNativeCSS<
|
|
|
174
179
|
next,
|
|
175
180
|
compile(next, {
|
|
176
181
|
hexColors: options?.hexColors,
|
|
177
|
-
}),
|
|
182
|
+
}).stylesheet(),
|
|
178
183
|
]);
|
|
179
184
|
|
|
180
185
|
watcher.emit("change", {
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This is a hack around
|
|
2
|
+
* This is a hack around Metro's handling of bundles.
|
|
3
3
|
* When a component is inside a lazy() barrier, it is inside a different JS bundle.
|
|
4
4
|
* So when it updates, it only updates its local bundle, not the global one which contains the CSS files.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* This means that the CSS file will not be re-evaluated when a component in a different bundle updates,
|
|
7
|
+
* breaking tools like Tailwind CSS
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* which is included inside react-native-css's runtime.
|
|
11
|
-
*
|
|
12
|
-
* This is why both of these function add imports for the CSS files.
|
|
9
|
+
* To fix this, we force our code to always import the CSS files, so now the CSS files are in every bundle.
|
|
13
10
|
*/
|
|
14
|
-
|
|
15
11
|
export function getWebInjectionCode(filePaths: string[]) {
|
|
16
12
|
const importStatements = filePaths
|
|
17
13
|
.map((filePath) => `import "${filePath}";`)
|
|
@@ -27,12 +23,12 @@ export function getNativeInjectionCode(
|
|
|
27
23
|
const importStatements = cssFilePaths
|
|
28
24
|
.map((filePath) => `import "${filePath}";`)
|
|
29
25
|
.join("\n");
|
|
30
|
-
|
|
26
|
+
|
|
31
27
|
const contents = values
|
|
32
28
|
.map((value) => `StyleCollection.inject(${JSON.stringify(value)});`)
|
|
33
29
|
.join("\n");
|
|
34
30
|
|
|
35
31
|
return Buffer.from(
|
|
36
|
-
|
|
32
|
+
`import { StyleCollection } from "react-native-css/style-collection";\n${importStatements}\n${contents};export {};`,
|
|
37
33
|
);
|
|
38
34
|
}
|
|
@@ -1,31 +1,48 @@
|
|
|
1
|
+
import { unstable_transformerPath } from "@expo/metro-config";
|
|
1
2
|
import type {
|
|
2
3
|
JsTransformerConfig,
|
|
3
4
|
JsTransformOptions,
|
|
4
5
|
TransformResponse,
|
|
5
6
|
} from "metro-transform-worker";
|
|
6
7
|
|
|
8
|
+
import { compile, type CompilerOptions } from "../compiler";
|
|
9
|
+
import { getNativeInjectionCode } from "./injection-code";
|
|
10
|
+
|
|
7
11
|
const worker =
|
|
8
12
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
9
|
-
require(
|
|
13
|
+
require(unstable_transformerPath) as typeof import("metro-transform-worker");
|
|
10
14
|
|
|
11
|
-
export function transform(
|
|
15
|
+
export async function transform(
|
|
12
16
|
config: JsTransformerConfig,
|
|
13
17
|
projectRoot: string,
|
|
14
18
|
filePath: string,
|
|
15
19
|
data: Buffer,
|
|
16
|
-
options: JsTransformOptions
|
|
20
|
+
options: JsTransformOptions & {
|
|
21
|
+
reactNativeCSS?: CompilerOptions | undefined;
|
|
22
|
+
},
|
|
17
23
|
): Promise<TransformResponse> {
|
|
18
24
|
const isCss = options.type !== "asset" && /\.(s?css|sass)$/.test(filePath);
|
|
19
|
-
const skipCompile =
|
|
20
|
-
options.customTransformOptions &&
|
|
21
|
-
"reactNativeCSSCompile" in options.customTransformOptions &&
|
|
22
|
-
options.customTransformOptions.reactNativeCSSCompile === false;
|
|
23
25
|
|
|
24
|
-
if (
|
|
26
|
+
if (options.platform === "web" || !isCss) {
|
|
25
27
|
return worker.transform(config, projectRoot, filePath, data, options);
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
const cssFile = (await worker.transform(config, projectRoot, filePath, data, {
|
|
31
|
+
...options,
|
|
32
|
+
platform: "web",
|
|
33
|
+
})) as TransformResponse & {
|
|
34
|
+
output: [{ data: { css: { code: Buffer } } }];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const css = cssFile.output[0].data.css.code.toString();
|
|
38
|
+
|
|
39
|
+
const productionJS = compile(css, {
|
|
40
|
+
...options.reactNativeCSS,
|
|
41
|
+
filename: filePath,
|
|
42
|
+
projectRoot: projectRoot,
|
|
43
|
+
}).stylesheet();
|
|
44
|
+
|
|
45
|
+
data = Buffer.from(getNativeInjectionCode([], [productionJS]));
|
|
29
46
|
|
|
30
|
-
return worker.transform(config, projectRoot, filePath
|
|
47
|
+
return worker.transform(config, projectRoot, `${filePath}.js`, data, options);
|
|
31
48
|
}
|
package/src/metro/resolver.ts
CHANGED
|
@@ -45,6 +45,14 @@ export function nativeResolver(
|
|
|
45
45
|
return resolver(context, `react-native-css/components`, platform);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
if (moduleName === "react-native-safe-area-context") {
|
|
49
|
+
return resolver(
|
|
50
|
+
context,
|
|
51
|
+
`react-native-css/components/react-native-safe-area-context`,
|
|
52
|
+
platform,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
// We only care about `react-native/Library/Components/<module>.js` components
|
|
49
57
|
const segments = resolution.filePath.split(sep);
|
|
50
58
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
package/src/poison.pill.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
const canWarn = process.env.NODE_ENV !== "test";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
if (canWarn) {
|
|
4
|
+
throw new Error(`react-native-css has encountered a setup error.
|
|
5
|
+
|
|
6
|
+
┌───────┐
|
|
7
|
+
│ Metro │
|
|
8
|
+
└───────┘
|
|
6
9
|
|
|
7
10
|
Either your metro.config.js is missing the 'withReactNativeCSS' wrapper OR
|
|
8
11
|
the resolver.resolveRequest function of your config is being overridden, and not calling the parent resolver.
|
|
@@ -16,17 +19,18 @@ module.exports = with3rdPartyPlugin(
|
|
|
16
19
|
)
|
|
17
20
|
\`\`\`
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
┌────────────┐
|
|
23
|
+
│ NativeWind │
|
|
24
|
+
└────────────┘
|
|
22
25
|
|
|
23
|
-
If you are using NativeWind
|
|
26
|
+
If you are using NativeWind follow the Metro instructions above but use 'withNativeWind' instead of 'withReactNativeCSS'.
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
┌────────────────┐
|
|
29
|
+
│ Other bundlers │
|
|
30
|
+
└────────────────┘
|
|
28
31
|
|
|
29
32
|
If you are using another bundler (Vite, Webpack, etc), or non-Metro framework (Next.js, Remix, etc), please ensure you have included 'react-native-css/babel' as a babel preset.
|
|
30
33
|
`);
|
|
34
|
+
}
|
|
31
35
|
|
|
32
36
|
export {};
|
|
@@ -21,7 +21,9 @@ import {
|
|
|
21
21
|
} from "./reactivity";
|
|
22
22
|
import { resolveValue } from "./styles/resolve";
|
|
23
23
|
|
|
24
|
-
export { StyleCollection } from "
|
|
24
|
+
export { StyleCollection } from "react-native-css/style-collection";
|
|
25
|
+
|
|
26
|
+
export { useNativeCss };
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* Generates a new Higher-Order component the wraps the base component and applies the styles.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { AttributeQuery } from "../../../compiler";
|
|
2
|
+
import type { Props } from "../../runtime.types";
|
|
3
|
+
import type { RenderGuard } from "./guards";
|
|
4
|
+
|
|
5
|
+
export function testAttributes(
|
|
6
|
+
queries: AttributeQuery[],
|
|
7
|
+
props: Props,
|
|
8
|
+
guards: RenderGuard[],
|
|
9
|
+
) {
|
|
10
|
+
return queries.every((query) => testAttribute(query, props, guards));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function testAttribute(
|
|
14
|
+
[type, prop, operator, testValue]: AttributeQuery,
|
|
15
|
+
props: Props,
|
|
16
|
+
guards: RenderGuard[],
|
|
17
|
+
) {
|
|
18
|
+
let value: unknown;
|
|
19
|
+
|
|
20
|
+
if (type === "a") {
|
|
21
|
+
value = props?.[prop];
|
|
22
|
+
} else {
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
24
|
+
value = props?.dataSet?.[prop];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
guards.push([type, prop, value]);
|
|
28
|
+
|
|
29
|
+
if (!operator) {
|
|
30
|
+
return value !== undefined && value !== null && value !== false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
switch (operator) {
|
|
34
|
+
case "!":
|
|
35
|
+
return !value;
|
|
36
|
+
case "=":
|
|
37
|
+
return value == testValue;
|
|
38
|
+
case "~=":
|
|
39
|
+
return testValue && value?.toString().split(" ").includes(testValue);
|
|
40
|
+
case "|=":
|
|
41
|
+
return testValue && value?.toString().startsWith(testValue + "-");
|
|
42
|
+
case "^=":
|
|
43
|
+
return testValue && value?.toString().startsWith(testValue);
|
|
44
|
+
case "$=":
|
|
45
|
+
return testValue && value?.toString().endsWith(testValue);
|
|
46
|
+
case "*=":
|
|
47
|
+
return testValue && value?.toString().includes(testValue);
|
|
48
|
+
default:
|
|
49
|
+
operator satisfies never;
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -14,8 +14,9 @@ import {
|
|
|
14
14
|
focusFamily,
|
|
15
15
|
hoverFamily,
|
|
16
16
|
type ContainerContextValue,
|
|
17
|
-
type
|
|
17
|
+
type Getter,
|
|
18
18
|
} from "../reactivity";
|
|
19
|
+
// import { testAttributes } from "./attributes";
|
|
19
20
|
import type { RenderGuard } from "./guards";
|
|
20
21
|
|
|
21
22
|
export const DEFAULT_CONTAINER_NAME = "c:___default___";
|
|
@@ -24,10 +25,10 @@ export function testContainerQueries(
|
|
|
24
25
|
queries: ContainerQuery[],
|
|
25
26
|
inheritedContainers: ContainerContextValue,
|
|
26
27
|
guards: RenderGuard[],
|
|
27
|
-
|
|
28
|
+
get: Getter,
|
|
28
29
|
) {
|
|
29
30
|
return queries.every((query) => {
|
|
30
|
-
return testContainerQuery(query, inheritedContainers, guards,
|
|
31
|
+
return testContainerQuery(query, inheritedContainers, guards, get);
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -35,7 +36,7 @@ export function testContainerQuery(
|
|
|
35
36
|
query: ContainerQuery,
|
|
36
37
|
inheritedContainers: ContainerContextValue,
|
|
37
38
|
guards: RenderGuard[],
|
|
38
|
-
|
|
39
|
+
get: Getter,
|
|
39
40
|
): boolean {
|
|
40
41
|
const name = query.n ?? DEFAULT_CONTAINER_NAME;
|
|
41
42
|
const container = inheritedContainers[name]!;
|
|
@@ -46,11 +47,15 @@ export function testContainerQuery(
|
|
|
46
47
|
return false;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
if (query.
|
|
50
|
+
// if (query.a && !testAttributes(query.a, container.props, guards)) {
|
|
51
|
+
// return false;
|
|
52
|
+
// }
|
|
53
|
+
|
|
54
|
+
if (query.m && !testContainerMediaCondition(query.m, container, get)) {
|
|
50
55
|
return false;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
if (query.p && !testContainerPseudoCondition(query.p, container,
|
|
58
|
+
if (query.p && !testContainerPseudoCondition(query.p, container, get)) {
|
|
54
59
|
return false;
|
|
55
60
|
}
|
|
56
61
|
|
|
@@ -60,15 +65,15 @@ export function testContainerQuery(
|
|
|
60
65
|
function testContainerPseudoCondition(
|
|
61
66
|
query: PseudoClassesQuery,
|
|
62
67
|
containerKey: WeakKey,
|
|
63
|
-
|
|
68
|
+
get: Getter,
|
|
64
69
|
): boolean {
|
|
65
|
-
if (query.h && !hoverFamily(containerKey)
|
|
70
|
+
if (query.h && !get(hoverFamily(containerKey))) {
|
|
66
71
|
return false;
|
|
67
72
|
}
|
|
68
|
-
if (query.a && !activeFamily(containerKey)
|
|
73
|
+
if (query.a && !get(activeFamily(containerKey))) {
|
|
69
74
|
return false;
|
|
70
75
|
}
|
|
71
|
-
if (query.f && !focusFamily(containerKey)
|
|
76
|
+
if (query.f && !get(focusFamily(containerKey))) {
|
|
72
77
|
return false;
|
|
73
78
|
}
|
|
74
79
|
return true;
|
|
@@ -77,18 +82,18 @@ function testContainerPseudoCondition(
|
|
|
77
82
|
function testContainerMediaCondition(
|
|
78
83
|
condition: MediaCondition,
|
|
79
84
|
containerKey: WeakKey,
|
|
80
|
-
|
|
85
|
+
get: Getter,
|
|
81
86
|
): boolean {
|
|
82
87
|
switch (condition[0]) {
|
|
83
88
|
case "!":
|
|
84
|
-
return !testContainerMediaCondition(condition[1], containerKey,
|
|
89
|
+
return !testContainerMediaCondition(condition[1], containerKey, get);
|
|
85
90
|
case "&":
|
|
86
91
|
return condition[1].every((query) => {
|
|
87
|
-
return testContainerMediaCondition(query, containerKey,
|
|
92
|
+
return testContainerMediaCondition(query, containerKey, get);
|
|
88
93
|
});
|
|
89
94
|
case "|":
|
|
90
95
|
return condition[1].some((query) => {
|
|
91
|
-
return testContainerMediaCondition(query, containerKey,
|
|
96
|
+
return testContainerMediaCondition(query, containerKey, get);
|
|
92
97
|
});
|
|
93
98
|
case "!!":
|
|
94
99
|
return false;
|
|
@@ -99,7 +104,7 @@ function testContainerMediaCondition(
|
|
|
99
104
|
case "<":
|
|
100
105
|
case "<=":
|
|
101
106
|
case "=": {
|
|
102
|
-
const left = getContainerFeatureValue(condition[1], containerKey,
|
|
107
|
+
const left = getContainerFeatureValue(condition[1], containerKey, get);
|
|
103
108
|
const right = condition[2];
|
|
104
109
|
|
|
105
110
|
if (condition[0] === "=") {
|
|
@@ -133,21 +138,21 @@ function testContainerMediaCondition(
|
|
|
133
138
|
function getContainerFeatureValue(
|
|
134
139
|
name: MediaFeatureNameFor_ContainerSizeFeatureId,
|
|
135
140
|
containerKey: WeakKey,
|
|
136
|
-
|
|
141
|
+
get: Getter,
|
|
137
142
|
): StyleDescriptor {
|
|
138
143
|
switch (name) {
|
|
139
144
|
case "width":
|
|
140
|
-
return containerWidthFamily(containerKey)
|
|
145
|
+
return get(containerWidthFamily(containerKey));
|
|
141
146
|
case "height":
|
|
142
|
-
return containerHeightFamily(containerKey)
|
|
147
|
+
return get(containerHeightFamily(containerKey));
|
|
143
148
|
case "aspect-ratio": {
|
|
144
|
-
const width = containerWidthFamily(containerKey)
|
|
145
|
-
const height =
|
|
149
|
+
const width = get(containerWidthFamily(containerKey));
|
|
150
|
+
const height = get(containerHeightFamily(containerKey));
|
|
146
151
|
return width / height;
|
|
147
152
|
}
|
|
148
153
|
case "orientation":
|
|
149
|
-
const width = containerWidthFamily(containerKey)
|
|
150
|
-
const height =
|
|
154
|
+
const width = get(containerWidthFamily(containerKey));
|
|
155
|
+
const height = get(containerHeightFamily(containerKey));
|
|
151
156
|
return width > height ? "landscape" : "portrait";
|
|
152
157
|
case "inline-size":
|
|
153
158
|
case "block-size":
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import type { ComponentState } from "../react/useNativeCss";
|
|
3
3
|
import type {
|
|
4
4
|
ContainerContextValue,
|
|
5
|
-
Effect,
|
|
6
5
|
VariableContextValue,
|
|
7
6
|
} from "../reactivity";
|
|
8
7
|
|
|
@@ -10,7 +9,7 @@ export type RenderGuard =
|
|
|
10
9
|
| ["a", string, any]
|
|
11
10
|
| ["d", string, any]
|
|
12
11
|
| ["v", string, any]
|
|
13
|
-
| ["c", string,
|
|
12
|
+
| ["c", string, WeakKey];
|
|
14
13
|
|
|
15
14
|
export function testGuards(
|
|
16
15
|
state: ComponentState,
|
|
@@ -1,40 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
AttributeQuery,
|
|
4
|
-
PseudoClassesQuery,
|
|
5
|
-
StyleRule,
|
|
6
|
-
} from "../../../compiler";
|
|
1
|
+
import type { PseudoClassesQuery, StyleRule } from "../../../compiler";
|
|
7
2
|
import type { Props } from "../../runtime.types";
|
|
8
3
|
import {
|
|
9
4
|
activeFamily,
|
|
10
5
|
focusFamily,
|
|
11
6
|
hoverFamily,
|
|
12
7
|
type ContainerContextValue,
|
|
13
|
-
type
|
|
8
|
+
type Getter,
|
|
14
9
|
} from "../reactivity";
|
|
10
|
+
import { testAttributes } from "./attributes";
|
|
15
11
|
import { testContainerQueries } from "./container-query";
|
|
16
12
|
import type { RenderGuard } from "./guards";
|
|
17
13
|
import { testMediaQuery } from "./media-query";
|
|
18
14
|
|
|
19
15
|
export function testRule(
|
|
20
16
|
rule: StyleRule,
|
|
21
|
-
|
|
17
|
+
get: Getter,
|
|
22
18
|
props: Props,
|
|
23
19
|
guards: RenderGuard[],
|
|
24
20
|
containerContext: ContainerContextValue,
|
|
25
21
|
) {
|
|
26
|
-
if (rule.p && !pseudoClasses(rule.p,
|
|
22
|
+
if (rule.p && !pseudoClasses(rule.p, get)) {
|
|
27
23
|
return false;
|
|
28
24
|
}
|
|
29
|
-
if (rule.m && !testMediaQuery(rule.m,
|
|
25
|
+
if (rule.m && !testMediaQuery(rule.m, get)) {
|
|
30
26
|
return false;
|
|
31
27
|
}
|
|
32
|
-
if (rule.aq && !
|
|
28
|
+
if (rule.aq && !testAttributes(rule.aq, props, guards)) {
|
|
33
29
|
return false;
|
|
34
30
|
}
|
|
35
31
|
if (
|
|
36
32
|
rule.cq &&
|
|
37
|
-
!testContainerQueries(rule.cq, containerContext, guards,
|
|
33
|
+
!testContainerQueries(rule.cq, containerContext, guards, get)
|
|
38
34
|
) {
|
|
39
35
|
return false;
|
|
40
36
|
}
|
|
@@ -42,65 +38,17 @@ export function testRule(
|
|
|
42
38
|
return true;
|
|
43
39
|
}
|
|
44
40
|
|
|
45
|
-
function pseudoClasses(query: PseudoClassesQuery,
|
|
46
|
-
|
|
41
|
+
function pseudoClasses(query: PseudoClassesQuery, get: Getter) {
|
|
42
|
+
// IMPORTANT: active needs: to be first. Modifies a global value
|
|
43
|
+
// that we use to determine if the component should be a pressable
|
|
44
|
+
if (query.a && !get(activeFamily(get))) {
|
|
47
45
|
return false;
|
|
48
46
|
}
|
|
49
|
-
if (query.
|
|
47
|
+
if (query.h && !get(hoverFamily(get))) {
|
|
50
48
|
return false;
|
|
51
49
|
}
|
|
52
|
-
if (query.f && !focusFamily(
|
|
50
|
+
if (query.f && !get(focusFamily(get))) {
|
|
53
51
|
return false;
|
|
54
52
|
}
|
|
55
53
|
return true;
|
|
56
54
|
}
|
|
57
|
-
|
|
58
|
-
function attributes(
|
|
59
|
-
queries: AttributeQuery[],
|
|
60
|
-
props: Props,
|
|
61
|
-
guards: RenderGuard[],
|
|
62
|
-
) {
|
|
63
|
-
return queries.every((query) => testAttribute(query, props, guards));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function testAttribute(
|
|
67
|
-
query: AttributeQuery,
|
|
68
|
-
props: Props,
|
|
69
|
-
guards: RenderGuard[],
|
|
70
|
-
) {
|
|
71
|
-
let value: any;
|
|
72
|
-
|
|
73
|
-
if (query[0] === "a") {
|
|
74
|
-
value = props?.[query[1]];
|
|
75
|
-
} else {
|
|
76
|
-
value = props?.dataSet?.[query[1]];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
guards.push([query[0], query[1], value]);
|
|
80
|
-
|
|
81
|
-
const operator = query[2];
|
|
82
|
-
|
|
83
|
-
if (!operator) {
|
|
84
|
-
return value !== undefined && value !== null && value !== false;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
switch (operator) {
|
|
88
|
-
case "!":
|
|
89
|
-
return !value;
|
|
90
|
-
case "=":
|
|
91
|
-
return value == query[3];
|
|
92
|
-
case "~=":
|
|
93
|
-
return value?.toString().split(" ").includes(query[3]);
|
|
94
|
-
case "|=":
|
|
95
|
-
return value?.toString().startsWith(query[3] + "-");
|
|
96
|
-
case "^=":
|
|
97
|
-
return value?.toString().startsWith(query[3]);
|
|
98
|
-
case "$=":
|
|
99
|
-
return value?.toString().endsWith(query[3]);
|
|
100
|
-
case "*=":
|
|
101
|
-
return value?.toString().includes(query[3]);
|
|
102
|
-
default:
|
|
103
|
-
operator satisfies never;
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -1,74 +1,78 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import { PixelRatio, Platform } from "react-native";
|
|
2
|
+
import { I18nManager, PixelRatio, Platform } from "react-native";
|
|
3
3
|
|
|
4
4
|
import type { MediaCondition } from "../../../compiler";
|
|
5
|
-
import { colorScheme, vh, vw, type
|
|
5
|
+
import { colorScheme, vh, vw, type Getter } from "../reactivity";
|
|
6
6
|
|
|
7
|
-
export function testMediaQuery(mediaQueries: MediaCondition[],
|
|
8
|
-
return mediaQueries.every((query) => test(query,
|
|
7
|
+
export function testMediaQuery(mediaQueries: MediaCondition[], get: Getter) {
|
|
8
|
+
return mediaQueries.every((query) => test(query, get));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function test(mediaQuery: MediaCondition,
|
|
11
|
+
function test(mediaQuery: MediaCondition, get: Getter): Boolean {
|
|
12
12
|
switch (mediaQuery[0]) {
|
|
13
13
|
case "[]":
|
|
14
14
|
case "!!":
|
|
15
15
|
return false;
|
|
16
16
|
case "!":
|
|
17
|
-
return !test(mediaQuery[1],
|
|
17
|
+
return !test(mediaQuery[1], get);
|
|
18
18
|
case "&":
|
|
19
19
|
return mediaQuery[1].every((query) => {
|
|
20
|
-
return test(query,
|
|
20
|
+
return test(query, get);
|
|
21
21
|
});
|
|
22
22
|
case "|":
|
|
23
23
|
return mediaQuery[1].some((query) => {
|
|
24
|
-
return test(query,
|
|
24
|
+
return test(query, get);
|
|
25
25
|
});
|
|
26
26
|
case ">":
|
|
27
27
|
case ">=":
|
|
28
28
|
case "<":
|
|
29
29
|
case "<=":
|
|
30
30
|
case "=": {
|
|
31
|
-
return testComparison(mediaQuery,
|
|
31
|
+
return testComparison(mediaQuery, get);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
function testComparison(mediaQuery: MediaCondition,
|
|
37
|
-
|
|
38
|
-
const right = mediaQuery[2];
|
|
36
|
+
function testComparison(mediaQuery: MediaCondition, get: Getter): Boolean {
|
|
37
|
+
const value = mediaQuery[2];
|
|
39
38
|
|
|
40
39
|
switch (mediaQuery[1]) {
|
|
40
|
+
case "dir":
|
|
41
|
+
return (I18nManager.isRTL && value === "rtl") || value === "ltr";
|
|
42
|
+
case "hover":
|
|
43
|
+
return true;
|
|
41
44
|
case "platform":
|
|
42
|
-
return
|
|
45
|
+
return value === "native" || value === Platform.OS;
|
|
43
46
|
case "prefers-color-scheme": {
|
|
44
|
-
return
|
|
47
|
+
return value === get(colorScheme);
|
|
45
48
|
}
|
|
46
49
|
case "display-mode":
|
|
47
|
-
return
|
|
50
|
+
return value === "native" || Platform.OS === value;
|
|
48
51
|
case "min-width":
|
|
49
|
-
return typeof
|
|
52
|
+
return typeof value === "number" && get(vw) >= value;
|
|
50
53
|
case "max-width":
|
|
51
|
-
return typeof
|
|
54
|
+
return typeof value === "number" && get(vw) <= value;
|
|
52
55
|
case "min-height":
|
|
53
|
-
return typeof
|
|
56
|
+
return typeof value === "number" && get(vh) >= value;
|
|
54
57
|
case "max-height":
|
|
55
|
-
return typeof
|
|
58
|
+
return typeof value === "number" && get(vh) <= value;
|
|
56
59
|
case "orientation":
|
|
57
|
-
return
|
|
58
|
-
? vh.get(effect) < vw.get(effect)
|
|
59
|
-
: vh.get(effect) >= vw.get(effect);
|
|
60
|
+
return value === "landscape" ? get(vh) < get(vw) : get(vh) >= get(vw);
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
if (typeof
|
|
63
|
+
if (typeof value !== "number") {
|
|
63
64
|
return false;
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
let left: number | undefined;
|
|
68
|
+
const right = value;
|
|
69
|
+
|
|
66
70
|
switch (mediaQuery[1]) {
|
|
67
71
|
case "width":
|
|
68
|
-
left =
|
|
72
|
+
left = get(vw);
|
|
69
73
|
break;
|
|
70
74
|
case "height":
|
|
71
|
-
left =
|
|
75
|
+
left = get(vh);
|
|
72
76
|
break;
|
|
73
77
|
case "resolution":
|
|
74
78
|
left = PixelRatio.get();
|