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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Appearance, Dimensions } from "react-native";
|
|
4
|
-
import
|
|
5
|
-
import { compile } from "
|
|
6
|
-
import { StyleCollection } from "
|
|
4
|
+
import { inspect } from "node:util";
|
|
5
|
+
import { compile } from "react-native-css/compiler";
|
|
6
|
+
import { StyleCollection } from "react-native-css/style-collection";
|
|
7
7
|
import { colorScheme, dimensions, rem } from "../runtime/native/reactivity.js";
|
|
8
8
|
export const testID = "react-native-css";
|
|
9
9
|
beforeEach(() => {
|
|
@@ -14,19 +14,37 @@ beforeEach(() => {
|
|
|
14
14
|
colorScheme.set(null);
|
|
15
15
|
});
|
|
16
16
|
const debugDefault = Boolean(process.env.REACT_NATIVE_CSS_TEST_DEBUG && process.env.NODE_OPTIONS?.includes("--inspect"));
|
|
17
|
-
export function registerCSS(css, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} =
|
|
21
|
-
const compiled =
|
|
17
|
+
export function registerCSS(css, options = {}) {
|
|
18
|
+
const {
|
|
19
|
+
debug = debugDefault
|
|
20
|
+
} = options;
|
|
21
|
+
const compiled = compileWithAutoDebug(css, options);
|
|
22
22
|
if (debug) {
|
|
23
|
-
console.log(`Compiled:\n---\n${
|
|
23
|
+
console.log(`Compiled:\n---\n${inspect({
|
|
24
|
+
stylesheet: compiled.stylesheet(),
|
|
25
|
+
warnings: compiled.warnings()
|
|
26
|
+
}, {
|
|
24
27
|
depth: null,
|
|
25
28
|
colors: true,
|
|
26
29
|
compact: false
|
|
27
30
|
})}`);
|
|
28
31
|
}
|
|
29
|
-
StyleCollection.inject(compiled);
|
|
32
|
+
StyleCollection.inject(compiled.stylesheet());
|
|
30
33
|
return compiled;
|
|
31
34
|
}
|
|
35
|
+
export function compileWithAutoDebug(css, {
|
|
36
|
+
debug = debugDefault,
|
|
37
|
+
...options
|
|
38
|
+
} = {}) {
|
|
39
|
+
const logger = debug ? text => {
|
|
40
|
+
// Just log the rules
|
|
41
|
+
if (text.startsWith("[")) {
|
|
42
|
+
console.log(`Rules:\n---\n${text}`);
|
|
43
|
+
}
|
|
44
|
+
} : undefined;
|
|
45
|
+
return compile(css, {
|
|
46
|
+
...options,
|
|
47
|
+
logger
|
|
48
|
+
});
|
|
49
|
+
}
|
|
32
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Appearance","Dimensions","
|
|
1
|
+
{"version":3,"names":["Appearance","Dimensions","inspect","compile","StyleCollection","colorScheme","dimensions","rem","testID","beforeEach","styles","clear","set","get","setColorScheme","debugDefault","Boolean","process","env","REACT_NATIVE_CSS_TEST_DEBUG","NODE_OPTIONS","includes","registerCSS","css","options","debug","compiled","compileWithAutoDebug","console","log","stylesheet","warnings","depth","colors","compact","inject","logger","text","startsWith","undefined"],"sourceRoot":"../../../src","sources":["jest/index.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAErD,SAASC,OAAO,QAAQ,WAAW;AAEnC,SAASC,OAAO,QAA8B,2BAA2B;AACzE,SAASC,eAAe,QAAQ,mCAAmC;AAEnE,SAASC,WAAW,EAAEC,UAAU,EAAEC,GAAG,QAAQ,iCAA8B;AAW3E,OAAO,MAAMC,MAAM,GAAG,kBAAkB;AAExCC,UAAU,CAAC,MAAM;EACfL,eAAe,CAACM,MAAM,CAACC,KAAK,CAAC,CAAC;EAC9BL,UAAU,CAACM,GAAG,CAACX,UAAU,CAACY,GAAG,CAAC,QAAQ,CAAC,CAAC;EACxCN,GAAG,CAACK,GAAG,CAAC,EAAE,CAAC;EACXZ,UAAU,CAACc,cAAc,CAAC,IAAI,CAAC;EAC/BT,WAAW,CAACO,GAAG,CAAC,IAAI,CAAC;AACvB,CAAC,CAAC;AAEF,MAAMG,YAAY,GAAGC,OAAO,CAC1BC,OAAO,CAACC,GAAG,CAACC,2BAA2B,IACrCF,OAAO,CAACC,GAAG,CAACE,YAAY,EAAEC,QAAQ,CAAC,WAAW,CAClD,CAAC;AAED,OAAO,SAASC,WAAWA,CACzBC,GAAW,EACXC,OAA8C,GAAG,CAAC,CAAC,EACnD;EACA,MAAM;IAAEC,KAAK,GAAGV;EAAa,CAAC,GAAGS,OAAO;EACxC,MAAME,QAAQ,GAAGC,oBAAoB,CAACJ,GAAG,EAAEC,OAAO,CAAC;EAEnD,IAAIC,KAAK,EAAE;IACTG,OAAO,CAACC,GAAG,CACT,mBAAmB3B,OAAO,CACxB;MACE4B,UAAU,EAAEJ,QAAQ,CAACI,UAAU,CAAC,CAAC;MACjCC,QAAQ,EAAEL,QAAQ,CAACK,QAAQ,CAAC;IAC9B,CAAC,EACD;MAAEC,KAAK,EAAE,IAAI;MAAEC,MAAM,EAAE,IAAI;MAAEC,OAAO,EAAE;IAAM,CAC9C,CAAC,EACH,CAAC;EACH;EAEA9B,eAAe,CAAC+B,MAAM,CAACT,QAAQ,CAACI,UAAU,CAAC,CAAC,CAAC;EAE7C,OAAOJ,QAAQ;AACjB;AAEA,OAAO,SAASC,oBAAoBA,CAClCJ,GAAW,EACX;EACEE,KAAK,GAAGV,YAAY;EACpB,GAAGS;AACkC,CAAC,GAAG,CAAC,CAAC,EAC7C;EACA,MAAMY,MAAM,GAAGX,KAAK,GACfY,IAAY,IAAK;IAChB;IACA,IAAIA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,EAAE;MACxBV,OAAO,CAACC,GAAG,CAAC,gBAAgBQ,IAAI,EAAE,CAAC;IACrC;EACF,CAAC,GACDE,SAAS;EAEb,OAAOpC,OAAO,CAACoB,GAAG,EAAE;IAAE,GAAGC,OAAO;IAAEY;EAAO,CAAC,CAAC;AAC7C","ignoreList":[]}
|
|
@@ -31,15 +31,18 @@ export function withReactNativeCSS(config, options) {
|
|
|
31
31
|
}
|
|
32
32
|
const originalMiddleware = config.server?.enhanceMiddleware;
|
|
33
33
|
const originalResolver = config.resolver?.resolveRequest;
|
|
34
|
-
const poisonPillPath = "./poison.pill";
|
|
35
34
|
return {
|
|
36
35
|
...config,
|
|
37
36
|
transformerPath: require.resolve("./metro-transformer"),
|
|
37
|
+
transformer: {
|
|
38
|
+
...config.transformer,
|
|
39
|
+
reactNativeCSS: options
|
|
40
|
+
},
|
|
38
41
|
resolver: {
|
|
39
42
|
...config.resolver,
|
|
40
43
|
sourceExts: [...(config?.resolver?.sourceExts || []), "css"],
|
|
41
44
|
resolveRequest: (context, moduleName, platform) => {
|
|
42
|
-
if (moduleName
|
|
45
|
+
if (moduleName.includes("poison.pill")) {
|
|
43
46
|
return {
|
|
44
47
|
type: "empty"
|
|
45
48
|
};
|
|
@@ -106,7 +109,7 @@ export function withReactNativeCSS(config, options) {
|
|
|
106
109
|
// Let the transformer know that we will handle compilation
|
|
107
110
|
customTransformOptions: {
|
|
108
111
|
...transformOptions.customTransformOptions,
|
|
109
|
-
|
|
112
|
+
reactNativeCSS: options
|
|
110
113
|
}
|
|
111
114
|
}, fileBuffer);
|
|
112
115
|
const lastTransform = nativeCSSFiles.get(filePath);
|
|
@@ -117,7 +120,7 @@ export function withReactNativeCSS(config, options) {
|
|
|
117
120
|
if (next !== last) {
|
|
118
121
|
nativeCSSFiles.set(filePath, [next, compile(next, {
|
|
119
122
|
hexColors: options?.hexColors
|
|
120
|
-
})]);
|
|
123
|
+
}).stylesheet()]);
|
|
121
124
|
watcher.emit("change", {
|
|
122
125
|
eventsQueue: nativeInjectionFilepaths.map(filePath => ({
|
|
123
126
|
filePath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dirname","relative","sep","versions","connect","debug","compile","getNativeInjectionCode","getWebInjectionCode","nativeResolver","webResolver","setupTypeScript","defaultLogger","withReactNativeCSS","config","options","Number","node","split","Error","disableTypeScriptGeneration","typescriptEnvPath","globalClassNamePolyfill","logger","loggerEnabled","enabled","originalMiddleware","server","enhanceMiddleware","originalResolver","resolver","resolveRequest","
|
|
1
|
+
{"version":3,"names":["dirname","relative","sep","versions","connect","debug","compile","getNativeInjectionCode","getWebInjectionCode","nativeResolver","webResolver","setupTypeScript","defaultLogger","withReactNativeCSS","config","options","Number","node","split","Error","disableTypeScriptGeneration","typescriptEnvPath","globalClassNamePolyfill","logger","loggerEnabled","enabled","originalMiddleware","server","enhanceMiddleware","originalResolver","resolver","resolveRequest","transformerPath","require","resolve","transformer","reactNativeCSS","sourceExts","context","moduleName","platform","includes","type","parentResolver","resolved","middleware","metroServer","bundler","getBundler","__react_native_css__patched","nativeCSSFiles","Map","webCSSFiles","Set","nativeInjectionPath","nativeInjectionFilepaths","replace","webInjectionPath","webInjectionFilepaths","transformFile","bind","watcher","getWatcher","filePath","transformOptions","fileBuffer","isCss","test","add","Array","from","webTransform","customTransformOptions","lastTransform","get","last","next","output","data","css","code","toString","set","hexColors","stylesheet","emit","eventsQueue","map","metadata","modifiedTime","Date","now","size","nativeTransform","skipCache","keys","key","values","value","use"],"sourceRoot":"../../../src","sources":["metro/index.ts"],"mappings":";;AAAA;AACA,SAASA,OAAO,EAAEC,QAAQ,EAAEC,GAAG,QAAQ,WAAW;AAClD,SAASC,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,OAAO,MAAM,SAAS;AAC7B,OAAOC,KAAK,MAAM,OAAO;AAIzB,SAASC,OAAO,QAAQ,yBAAsB;AAC9C,SAASC,sBAAsB,EAAEC,mBAAmB,QAAQ,qBAAkB;AAC9E,SAASC,cAAc,EAAEC,WAAW,QAAQ,eAAY;AACxD,SAASC,eAAe,QAAQ,iBAAc;AAY9C,MAAMC,aAAa,GAAGP,KAAK,CAAC,wBAAwB,CAAC;AAErD,OAAO,SAASQ,kBAAkBA,CAEhCC,MAAS,EAAEC,OAAmC,EAAK;EACnD,IAAI,OAAOD,MAAM,KAAK,UAAU,EAAE;IAChC,OAAQ,YAAY;MAClB,OAAOD,kBAAkB,CAAC,MAAMC,MAAM,CAAC,CAAC,EAAEC,OAAO,CAAC;IACpD,CAAC;EACH;EAEA,IAAIC,MAAM,CAACb,QAAQ,CAACc,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE;IAC5C,MAAM,IAAIC,KAAK,CAAC,2CAA2C,CAAC;EAC9D;EAEA,MAAM;IACJC,2BAA2B;IAC3BC,iBAAiB;IACjBC,uBAAuB,GAAG,KAAK;IAC/BC,MAAM,GAAGX;EACX,CAAC,GAAGG,OAAO,IAAI,CAAC,CAAC;EAEjB,MAAMS,aAAa,GAAG,SAAS,IA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CAACI,QAAQ,EAAEC,gBAAgB,EAAEC,UAAU,CAAC;YAC9D;UACF,CAAC;QACH;QAEA,OAAOvC,kBAAkB,GACrBC,MAAM,CAACwE,GAAG,CAACzE,kBAAkB,CAACmB,UAAU,EAAEC,WAAW,CAAC,CAAC,GACvDnB,MAAM,CAACwE,GAAG,CAACtD,UAAU,CAAC;MAC5B;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* This is a hack around
|
|
4
|
+
* This is a hack around Metro's handling of bundles.
|
|
5
5
|
* When a component is inside a lazy() barrier, it is inside a different JS bundle.
|
|
6
6
|
* So when it updates, it only updates its local bundle, not the global one which contains the CSS files.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* This means that the CSS file will not be re-evaluated when a component in a different bundle updates,
|
|
9
|
+
* breaking tools like Tailwind CSS
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* which is included inside react-native-css's runtime.
|
|
13
|
-
*
|
|
14
|
-
* This is why both of these function add imports for the CSS files.
|
|
11
|
+
* To fix this, we force our code to always import the CSS files, so now the CSS files are in every bundle.
|
|
15
12
|
*/
|
|
16
|
-
|
|
17
13
|
export function getWebInjectionCode(filePaths) {
|
|
18
14
|
const importStatements = filePaths.map(filePath => `import "${filePath}";`).join("\n");
|
|
19
15
|
return Buffer.from(importStatements);
|
|
20
16
|
}
|
|
21
17
|
export function getNativeInjectionCode(cssFilePaths, values) {
|
|
22
18
|
const importStatements = cssFilePaths.map(filePath => `import "${filePath}";`).join("\n");
|
|
23
|
-
const importPath = `import { StyleCollection } from "./api";`;
|
|
24
19
|
const contents = values.map(value => `StyleCollection.inject(${JSON.stringify(value)});`).join("\n");
|
|
25
|
-
return Buffer.from(
|
|
20
|
+
return Buffer.from(`import { StyleCollection } from "react-native-css/style-collection";\n${importStatements}\n${contents};export {};`);
|
|
26
21
|
}
|
|
27
22
|
//# sourceMappingURL=injection-code.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getWebInjectionCode","filePaths","importStatements","map","filePath","join","Buffer","from","getNativeInjectionCode","cssFilePaths","values","
|
|
1
|
+
{"version":3,"names":["getWebInjectionCode","filePaths","importStatements","map","filePath","join","Buffer","from","getNativeInjectionCode","cssFilePaths","values","contents","value","JSON","stringify"],"sourceRoot":"../../../src","sources":["metro/injection-code.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAmBA,CAACC,SAAmB,EAAE;EACvD,MAAMC,gBAAgB,GAAGD,SAAS,CAC/BE,GAAG,CAAEC,QAAQ,IAAK,WAAWA,QAAQ,IAAI,CAAC,CAC1CC,IAAI,CAAC,IAAI,CAAC;EAEb,OAAOC,MAAM,CAACC,IAAI,CAACL,gBAAgB,CAAC;AACtC;AAEA,OAAO,SAASM,sBAAsBA,CACpCC,YAAsB,EACtBC,MAAiB,EACjB;EACA,MAAMR,gBAAgB,GAAGO,YAAY,CAClCN,GAAG,CAAEC,QAAQ,IAAK,WAAWA,QAAQ,IAAI,CAAC,CAC1CC,IAAI,CAAC,IAAI,CAAC;EAEb,MAAMM,QAAQ,GAAGD,MAAM,CACpBP,GAAG,CAAES,KAAK,IAAK,0BAA0BC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC,IAAI,CAAC,CACnEP,IAAI,CAAC,IAAI,CAAC;EAEb,OAAOC,MAAM,CAACC,IAAI,CAChB,yEAAyEL,gBAAgB,KAAKS,QAAQ,aACxG,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { unstable_transformerPath } from "@expo/metro-config";
|
|
4
|
+
import { compile } from "../compiler/index.js";
|
|
5
|
+
import { getNativeInjectionCode } from "./injection-code.js";
|
|
3
6
|
const worker =
|
|
4
7
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
5
|
-
require(
|
|
6
|
-
export function transform(config, projectRoot, filePath, data, options) {
|
|
8
|
+
require(unstable_transformerPath);
|
|
9
|
+
export async function transform(config, projectRoot, filePath, data, options) {
|
|
7
10
|
const isCss = options.type !== "asset" && /\.(s?css|sass)$/.test(filePath);
|
|
8
|
-
|
|
9
|
-
if (!isCss || skipCompile) {
|
|
11
|
+
if (options.platform === "web" || !isCss) {
|
|
10
12
|
return worker.transform(config, projectRoot, filePath, data, options);
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const cssFile = await worker.transform(config, projectRoot, filePath, data, {
|
|
15
|
+
...options,
|
|
16
|
+
platform: "web"
|
|
17
|
+
});
|
|
18
|
+
const css = cssFile.output[0].data.css.code.toString();
|
|
19
|
+
const productionJS = compile(css, {
|
|
20
|
+
...options.reactNativeCSS,
|
|
21
|
+
filename: filePath,
|
|
22
|
+
projectRoot: projectRoot
|
|
23
|
+
}).stylesheet();
|
|
24
|
+
data = Buffer.from(getNativeInjectionCode([], [productionJS]));
|
|
25
|
+
return worker.transform(config, projectRoot, `${filePath}.js`, data, options);
|
|
16
26
|
}
|
|
17
27
|
//# sourceMappingURL=metro-transformer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["worker","require","transform","config","projectRoot","filePath","data","options","isCss","type","test","
|
|
1
|
+
{"version":3,"names":["unstable_transformerPath","compile","getNativeInjectionCode","worker","require","transform","config","projectRoot","filePath","data","options","isCss","type","test","platform","cssFile","css","output","code","toString","productionJS","reactNativeCSS","filename","stylesheet","Buffer","from"],"sourceRoot":"../../../src","sources":["metro/metro-transformer.ts"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,oBAAoB;AAO7D,SAASC,OAAO,QAA8B,sBAAa;AAC3D,SAASC,sBAAsB,QAAQ,qBAAkB;AAEzD,MAAMC,MAAM;AACV;AACAC,OAAO,CAACJ,wBAAwB,CAA4C;AAE9E,OAAO,eAAeK,SAASA,CAC7BC,MAA2B,EAC3BC,WAAmB,EACnBC,QAAgB,EAChBC,IAAY,EACZC,OAEC,EAC2B;EAC5B,MAAMC,KAAK,GAAGD,OAAO,CAACE,IAAI,KAAK,OAAO,IAAI,iBAAiB,CAACC,IAAI,CAACL,QAAQ,CAAC;EAE1E,IAAIE,OAAO,CAACI,QAAQ,KAAK,KAAK,IAAI,CAACH,KAAK,EAAE;IACxC,OAAOR,MAAM,CAACE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,CAAC;EACvE;EAEA,MAAMK,OAAO,GAAI,MAAMZ,MAAM,CAACE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,EAAE;IAC3E,GAAGC,OAAO;IACVI,QAAQ,EAAE;EACZ,CAAC,CAEA;EAED,MAAME,GAAG,GAAGD,OAAO,CAACE,MAAM,CAAC,CAAC,CAAC,CAACR,IAAI,CAACO,GAAG,CAACE,IAAI,CAACC,QAAQ,CAAC,CAAC;EAEtD,MAAMC,YAAY,GAAGnB,OAAO,CAACe,GAAG,EAAE;IAChC,GAAGN,OAAO,CAACW,cAAc;IACzBC,QAAQ,EAAEd,QAAQ;IAClBD,WAAW,EAAEA;EACf,CAAC,CAAC,CAACgB,UAAU,CAAC,CAAC;EAEfd,IAAI,GAAGe,MAAM,CAACC,IAAI,CAACvB,sBAAsB,CAAC,EAAE,EAAE,CAACkB,YAAY,CAAC,CAAC,CAAC;EAE9D,OAAOjB,MAAM,CAACE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAE,GAAGC,QAAQ,KAAK,EAAEC,IAAI,EAAEC,OAAO,CAAC;AAC/E","ignoreList":[]}
|
|
@@ -23,6 +23,9 @@ export function nativeResolver(resolver, context, moduleName, platform) {
|
|
|
23
23
|
if (moduleName === "react-native") {
|
|
24
24
|
return resolver(context, `react-native-css/components`, platform);
|
|
25
25
|
}
|
|
26
|
+
if (moduleName === "react-native-safe-area-context") {
|
|
27
|
+
return resolver(context, `react-native-css/components/react-native-safe-area-context`, platform);
|
|
28
|
+
}
|
|
26
29
|
|
|
27
30
|
// We only care about `react-native/Library/Components/<module>.js` components
|
|
28
31
|
const segments = resolution.filePath.split(sep);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["basename","resolve","sep","allowedModules","thisModuleDist","__dirname","thisModuleSrc","isFromThisModule","filename","startsWith","nativeResolver","resolver","context","moduleName","platform","resolution","originModulePath","type","endsWith","segments","filePath","split","module","at","has","webResolver","includes","isIndex"],"sourceRoot":"../../../src","sources":["metro/resolver.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,GAAG,QAAQ,WAAW;AAQlD,SAASC,cAAc,QAAQ,4BAAyB;AAExD,MAAMC,cAAc,GAAGH,OAAO,CAACI,SAAS,EAAE,eAAe,CAAC;AAC1D,MAAMC,aAAa,GAAGL,OAAO,CAACI,SAAS,EAAE,cAAc,CAAC;AAExD,SAASE,gBAAgBA,CAACC,QAAgB,EAAW;EACnD,OACEA,QAAQ,CAACC,UAAU,CAACL,cAAc,CAAC,IAAII,QAAQ,CAACC,UAAU,CAACH,aAAa,CAAC;AAE7E;AAEA,OAAO,SAASI,cAAcA,CAC5BC,QAAwB,EACxBC,OAAgC,EAChCC,UAAkB,EAClBC,QAAuB,EACX;EACZ,MAAMC,UAAU,GAAGJ,QAAQ,CAACC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,CAAC;EAE1D;EACE;EACAP,gBAAgB,CAACK,OAAO,CAACI,gBAAgB,CAAC;EAC1C;EACAD,UAAU,CAACE,IAAI,KAAK,YAAY;EAChC;EACAL,OAAO,CAACI,gBAAgB,CAACE,QAAQ,CAAC,uBAAuB,CAAC;EAC1D;EACA,EACEL,UAAU,CAACJ,UAAU,CAAC,cAAc,CAAC,IACrCI,UAAU,CAACJ,UAAU,C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CAAC,CAAC,CAAC;EAE9B,IAAI,CAACI,OAAO,IAAI,CAACL,MAAM,IAAI,CAACnB,cAAc,CAACqB,GAAG,CAACF,MAAM,CAAC,EAAE;IACtD,OAAOP,UAAU;EACnB;EAEA,OAAOJ,QAAQ,CAACC,OAAO,EAAE,+BAA+BU,MAAM,EAAE,EAAER,QAAQ,CAAC;AAC7E","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["basename","resolve","sep","allowedModules","thisModuleDist","__dirname","thisModuleSrc","isFromThisModule","filename","startsWith","nativeResolver","resolver","context","moduleName","platform","resolution","originModulePath","type","endsWith","segments","filePath","split","module","at","has","webResolver","includes","isIndex"],"sourceRoot":"../../../src","sources":["metro/resolver.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,GAAG,QAAQ,WAAW;AAQlD,SAASC,cAAc,QAAQ,4BAAyB;AAExD,MAAMC,cAAc,GAAGH,OAAO,CAACI,SAAS,EAAE,eAAe,CAAC;AAC1D,MAAMC,aAAa,GAAGL,OAAO,CAACI,SAAS,EAAE,cAAc,CAAC;AAExD,SAASE,gBAAgBA,CAACC,QAAgB,EAAW;EACnD,OACEA,QAAQ,CAACC,UAAU,CAACL,cAAc,CAAC,IAAII,QAAQ,CAACC,UAAU,CAACH,aAAa,CAAC;AAE7E;AAEA,OAAO,SAASI,cAAcA,CAC5BC,QAAwB,EACxBC,OAAgC,EAChCC,UAAkB,EAClBC,QAAuB,EACX;EACZ,MAAMC,UAAU,GAAGJ,QAAQ,CAACC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,CAAC;EAE1D;EACE;EACAP,gBAAgB,CAACK,OAAO,CAACI,gBAAgB,CAAC;EAC1C;EACAD,UAAU,CAACE,IAAI,KAAK,YAAY;EAChC;EACAL,OAAO,CAACI,gBAAgB,CAACE,QAAQ,CAAC,uBAAuB,CAAC;EAC1D;EACA,EACEL,UAAU,CAACJ,UAAU,CAAC,cAAc,CAAC,IACrCI,UAAU,CAACJ,U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EAAE,CAAC,CAAC,CAAC,CAAC,EAAEd,UAAU,CAAC,QAAQ,CAAC;EACrD,MAAMa,MAAM,GAAGH,QAAQ,CAACI,EAAE,CAAC,CAAC,CAAC,CAAC;EAE9B,IAAI,CAACI,OAAO,IAAI,CAACL,MAAM,IAAI,CAACnB,cAAc,CAACqB,GAAG,CAACF,MAAM,CAAC,EAAE;IACtD,OAAOP,UAAU;EACnB;EAEA,OAAOJ,QAAQ,CAACC,OAAO,EAAE,+BAA+BU,MAAM,EAAE,EAAER,QAAQ,CAAC;AAC7E","ignoreList":[]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const canWarn = process.env.NODE_ENV !== "test";
|
|
4
|
+
if (canWarn) {
|
|
5
|
+
throw new Error(`react-native-css has encountered a setup error.
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
┌───────┐
|
|
8
|
+
│ Metro │
|
|
9
|
+
└───────┘
|
|
8
10
|
|
|
9
11
|
Either your metro.config.js is missing the 'withReactNativeCSS' wrapper OR
|
|
10
12
|
the resolver.resolveRequest function of your config is being overridden, and not calling the parent resolver.
|
|
@@ -18,17 +20,18 @@ module.exports = with3rdPartyPlugin(
|
|
|
18
20
|
)
|
|
19
21
|
\`\`\`
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
┌────────────┐
|
|
24
|
+
│ NativeWind │
|
|
25
|
+
└────────────┘
|
|
24
26
|
|
|
25
|
-
If you are using NativeWind
|
|
27
|
+
If you are using NativeWind follow the Metro instructions above but use 'withNativeWind' instead of 'withReactNativeCSS'.
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
┌────────────────┐
|
|
30
|
+
│ Other bundlers │
|
|
31
|
+
└────────────────┘
|
|
30
32
|
|
|
31
33
|
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.
|
|
32
34
|
`);
|
|
35
|
+
}
|
|
33
36
|
export {};
|
|
34
37
|
//# sourceMappingURL=poison.pill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Error"],"sourceRoot":"../../src","sources":["poison.pill.ts"],"mappings":";;AAAA,MAAM,
|
|
1
|
+
{"version":3,"names":["canWarn","process","env","NODE_ENV","Error"],"sourceRoot":"../../src","sources":["poison.pill.ts"],"mappings":";;AAAA,MAAMA,OAAO,GAAGC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,MAAM;AAE/C,IAAIH,OAAO,EAAE;EACX,MAAM,IAAII,KAAK,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF;AAEA","ignoreList":[]}
|
|
@@ -7,7 +7,8 @@ import { mappingToConfig, useNativeCss } from "./react/useNativeCss.js";
|
|
|
7
7
|
import { usePassthrough } from "./react/usePassthrough.js";
|
|
8
8
|
import { colorScheme as colorSchemeObs, VAR_SYMBOL, VariableContext } from "./reactivity.js";
|
|
9
9
|
import { resolveValue } from "./styles/resolve.js";
|
|
10
|
-
export { StyleCollection } from "
|
|
10
|
+
export { StyleCollection } from "react-native-css/style-collection";
|
|
11
|
+
export { useNativeCss };
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Generates a new Higher-Order component the wraps the base component and applies the styles.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","useState","Appearance","mappingToConfig","useNativeCss","usePassthrough","colorScheme","colorSchemeObs","VAR_SYMBOL","VariableContext","resolveValue","StyleCollection","styled","baseComponent","mapping","options","component","configs","passThrough","props","name","displayName","get","getColorScheme","set","value","useUnstableNativeVariable","useNativeVariable","useCssElement","incomingProps","config","startsWith","slice","inheritedVariables","effect","setState","observers","Set","run","state","observable","vars","variables"],"sourceRoot":"../../../../src","sources":["runtime/native/api.ts"],"mappings":";;AAAA;AACA,SAASA,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AAC5C,SAASC,UAAU,QAAQ,cAAc;AAUzC,SAASC,eAAe,EAAEC,YAAY,QAAQ,yBAAsB;AACpE,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SACEC,WAAW,IAAIC,cAAc,EAC7BC,UAAU,EACVC,eAAe,QAGV,iBAAc;AACrB,SAASC,YAAY,QAAQ,qBAAkB;AAE/C,SAASC,eAAe,QAAQ,
|
|
1
|
+
{"version":3,"names":["useContext","useState","Appearance","mappingToConfig","useNativeCss","usePassthrough","colorScheme","colorSchemeObs","VAR_SYMBOL","VariableContext","resolveValue","StyleCollection","styled","baseComponent","mapping","options","component","configs","passThrough","props","name","displayName","get","getColorScheme","set","value","useUnstableNativeVariable","useNativeVariable","useCssElement","incomingProps","config","startsWith","slice","inheritedVariables","effect","setState","observers","Set","run","state","observable","vars","variables"],"sourceRoot":"../../../../src","sources":["runtime/native/api.ts"],"mappings":";;AAAA;AACA,SAASA,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AAC5C,SAASC,UAAU,QAAQ,cAAc;AAUzC,SAASC,eAAe,EAAEC,YAAY,QAAQ,yBAAsB;AACpE,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SACEC,WAAW,IAAIC,cAAc,EAC7BC,UAAU,EACVC,eAAe,QAGV,iBAAc;AACrB,SAASC,YAAY,QAAQ,qBAAkB;AAE/C,SAASC,eAAe,QAAQ,mCAAmC;AAEnE,SAASP,YAAY;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMQ,MAAM,GAAGA,CAIpBC,aAAgB,EAChBC,OAAU,EACVC,OAAuB,KACpB;EACH,IAAIC,SAAc;EAClB;;EAEA,MAAMC,OAAO,GAAGd,eAAe,CAACW,OAAO,CAAC;EAExC,IAAIC,OA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EC,QAAQ,CAAC,GAAGlC,QAAQ,CAAC,MAAM;IACxC,MAAMiC,MAAc,GAAG;MACrBE,SAAS,EAAE,IAAIC,GAAG,CAAC,CAAC;MACpBC,GAAG,EAAEA,CAAA,KAAMH,QAAQ,CAAEI,KAAK,KAAM;QAAE,GAAGA;MAAM,CAAC,CAAC;IAC/C,CAAC;IAED,MAAMjB,GAAW,GAAIkB,UAAU,IAAKA,UAAU,CAAClB,GAAG,CAACY,MAAM,CAAC;IAE1D,OAAO;MAAE,GAAGA,MAAM;MAAEZ;IAAI,CAAC;EAC3B,CAAC,CAAC;EAEF,OAAOZ,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAACU,IAAI,CAAC,CAAC,EAAEc,MAAM,CAACZ,GAAG,EAAE;IAAEW;EAAmB,CAAC,CAAC;AAC9E;AAEA,OAAO,SAASQ,IAAIA,CAACC,SAA0C,EAAE;EAC9DA,SAAS,CAAoBlC,UAAU,CAAC,GAAG,QAAQ;EACpD,OAAOkC,SAAS;AAClB","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function testAttributes(queries, props, guards) {
|
|
4
|
+
return queries.every(query => testAttribute(query, props, guards));
|
|
5
|
+
}
|
|
6
|
+
function testAttribute([type, prop, operator, testValue], props, guards) {
|
|
7
|
+
let value;
|
|
8
|
+
if (type === "a") {
|
|
9
|
+
value = props?.[prop];
|
|
10
|
+
} else {
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
12
|
+
value = props?.dataSet?.[prop];
|
|
13
|
+
}
|
|
14
|
+
guards.push([type, prop, value]);
|
|
15
|
+
if (!operator) {
|
|
16
|
+
return value !== undefined && value !== null && value !== false;
|
|
17
|
+
}
|
|
18
|
+
switch (operator) {
|
|
19
|
+
case "!":
|
|
20
|
+
return !value;
|
|
21
|
+
case "=":
|
|
22
|
+
return value == testValue;
|
|
23
|
+
case "~=":
|
|
24
|
+
return testValue && value?.toString().split(" ").includes(testValue);
|
|
25
|
+
case "|=":
|
|
26
|
+
return testValue && value?.toString().startsWith(testValue + "-");
|
|
27
|
+
case "^=":
|
|
28
|
+
return testValue && value?.toString().startsWith(testValue);
|
|
29
|
+
case "$=":
|
|
30
|
+
return testValue && value?.toString().endsWith(testValue);
|
|
31
|
+
case "*=":
|
|
32
|
+
return testValue && value?.toString().includes(testValue);
|
|
33
|
+
default:
|
|
34
|
+
operator;
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["testAttributes","queries","props","guards","every","query","testAttribute","type","prop","operator","testValue","value","dataSet","push","undefined","toString","split","includes","startsWith","endsWith"],"sourceRoot":"../../../../../src","sources":["runtime/native/conditions/attributes.ts"],"mappings":";;AAIA,OAAO,SAASA,cAAcA,CAC5BC,OAAyB,EACzBC,KAAY,EACZC,MAAqB,EACrB;EACA,OAAOF,OAAO,CAACG,KAAK,CAAEC,KAAK,IAAKC,aAAa,CAACD,KAAK,EAAEH,KAAK,EAAEC,MAAM,CAAC,CAAC;AACtE;AAEA,SAASG,aAAaA,CACpB,CAACC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,SAAS,CAAiB,EACjDR,KAAY,EACZC,MAAqB,EACrB;EACA,IAAIQ,KAAc;EAElB,IAAIJ,IAAI,KAAK,GAAG,EAAE;IAChBI,KAAK,GAAGT,KAAK,GAAGM,IAAI,CAAC;EACvB,CAAC,MAAM;IACL;IACAG,KAAK,GAAGT,KAAK,EAAEU,OAAO,GAAGJ,IAAI,CAAC;EAChC;EAEAL,MAAM,CAACU,IAAI,CAAC,CAACN,IAAI,EAAEC,IAAI,EAAEG,KAAK,CAAC,CAAC;EAEhC,IAAI,CAACF,QAAQ,EAAE;IACb,OAAOE,KAAK,KAAKG,SAAS,IAAIH,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK;EACjE;EAEA,QAAQF,QAAQ;IACd,KAAK,GAAG;MACN,OAAO,CAACE,KAAK;IACf,KAAK,GAAG;MACN,OAAOA,KAAK,IAAID,SAAS;IAC3B,KAAK,IAAI;MACP,OAAOA,SAAS,IAAIC,KAAK,EAAEI,QAAQ,CAAC,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC,CAACC,QAAQ,CAACP,SAAS,CAAC;IACtE,KAAK,IAAI;MACP,OAAOA,SAAS,IAAIC,KAAK,EAAEI,QAAQ,CAAC,CAAC,CAACG,UAAU,CAACR,SAAS,GAAG,GAAG,CAAC;IACnE,KAAK,IAAI;MACP,OAAOA,SAAS,IAAIC,KAAK,EAAEI,QAAQ,CAAC,CAAC,CAACG,UAAU,CAACR,SAAS,CAAC;IAC7D,KAAK,IAAI;MACP,OAAOA,SAAS,IAAIC,KAAK,EAAEI,QAAQ,CAAC,CAAC,CAACI,QAAQ,CAACT,SAAS,CAAC;IAC3D,KAAK,IAAI;MACP,OAAOA,SAAS,IAAIC,KAAK,EAAEI,QAAQ,CAAC,CAAC,CAACE,QAAQ,CAACP,SAAS,CAAC;IAC3D;MACED,QAAQ;MACR,OAAO,KAAK;EAChB;AACF","ignoreList":[]}
|
|
@@ -3,50 +3,57 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
|
|
5
5
|
import { activeFamily, containerHeightFamily, containerWidthFamily, focusFamily, hoverFamily } from "../reactivity.js";
|
|
6
|
+
// import { testAttributes } from "./attributes";
|
|
7
|
+
|
|
6
8
|
export const DEFAULT_CONTAINER_NAME = "c:___default___";
|
|
7
|
-
export function testContainerQueries(queries, inheritedContainers, guards,
|
|
9
|
+
export function testContainerQueries(queries, inheritedContainers, guards, get) {
|
|
8
10
|
return queries.every(query => {
|
|
9
|
-
return testContainerQuery(query, inheritedContainers, guards,
|
|
11
|
+
return testContainerQuery(query, inheritedContainers, guards, get);
|
|
10
12
|
});
|
|
11
13
|
}
|
|
12
|
-
export function testContainerQuery(query, inheritedContainers, guards,
|
|
14
|
+
export function testContainerQuery(query, inheritedContainers, guards, get) {
|
|
13
15
|
const name = query.n ?? DEFAULT_CONTAINER_NAME;
|
|
14
16
|
const container = inheritedContainers[name];
|
|
15
17
|
guards.push(["c", name, container]);
|
|
16
18
|
if (!container) {
|
|
17
19
|
return false;
|
|
18
20
|
}
|
|
19
|
-
|
|
21
|
+
|
|
22
|
+
// if (query.a && !testAttributes(query.a, container.props, guards)) {
|
|
23
|
+
// return false;
|
|
24
|
+
// }
|
|
25
|
+
|
|
26
|
+
if (query.m && !testContainerMediaCondition(query.m, container, get)) {
|
|
20
27
|
return false;
|
|
21
28
|
}
|
|
22
|
-
if (query.p && !testContainerPseudoCondition(query.p, container,
|
|
29
|
+
if (query.p && !testContainerPseudoCondition(query.p, container, get)) {
|
|
23
30
|
return false;
|
|
24
31
|
}
|
|
25
32
|
return true;
|
|
26
33
|
}
|
|
27
|
-
function testContainerPseudoCondition(query, containerKey,
|
|
28
|
-
if (query.h && !hoverFamily(containerKey)
|
|
34
|
+
function testContainerPseudoCondition(query, containerKey, get) {
|
|
35
|
+
if (query.h && !get(hoverFamily(containerKey))) {
|
|
29
36
|
return false;
|
|
30
37
|
}
|
|
31
|
-
if (query.a && !activeFamily(containerKey)
|
|
38
|
+
if (query.a && !get(activeFamily(containerKey))) {
|
|
32
39
|
return false;
|
|
33
40
|
}
|
|
34
|
-
if (query.f && !focusFamily(containerKey)
|
|
41
|
+
if (query.f && !get(focusFamily(containerKey))) {
|
|
35
42
|
return false;
|
|
36
43
|
}
|
|
37
44
|
return true;
|
|
38
45
|
}
|
|
39
|
-
function testContainerMediaCondition(condition, containerKey,
|
|
46
|
+
function testContainerMediaCondition(condition, containerKey, get) {
|
|
40
47
|
switch (condition[0]) {
|
|
41
48
|
case "!":
|
|
42
|
-
return !testContainerMediaCondition(condition[1], containerKey,
|
|
49
|
+
return !testContainerMediaCondition(condition[1], containerKey, get);
|
|
43
50
|
case "&":
|
|
44
51
|
return condition[1].every(query => {
|
|
45
|
-
return testContainerMediaCondition(query, containerKey,
|
|
52
|
+
return testContainerMediaCondition(query, containerKey, get);
|
|
46
53
|
});
|
|
47
54
|
case "|":
|
|
48
55
|
return condition[1].some(query => {
|
|
49
|
-
return testContainerMediaCondition(query, containerKey,
|
|
56
|
+
return testContainerMediaCondition(query, containerKey, get);
|
|
50
57
|
});
|
|
51
58
|
case "!!":
|
|
52
59
|
return false;
|
|
@@ -58,7 +65,7 @@ function testContainerMediaCondition(condition, containerKey, effect) {
|
|
|
58
65
|
case "<=":
|
|
59
66
|
case "=":
|
|
60
67
|
{
|
|
61
|
-
const left = getContainerFeatureValue(condition[1], containerKey,
|
|
68
|
+
const left = getContainerFeatureValue(condition[1], containerKey, get);
|
|
62
69
|
const right = condition[2];
|
|
63
70
|
if (condition[0] === "=") {
|
|
64
71
|
return left === right;
|
|
@@ -85,21 +92,21 @@ function testContainerMediaCondition(condition, containerKey, effect) {
|
|
|
85
92
|
return false;
|
|
86
93
|
}
|
|
87
94
|
}
|
|
88
|
-
function getContainerFeatureValue(name, containerKey,
|
|
95
|
+
function getContainerFeatureValue(name, containerKey, get) {
|
|
89
96
|
switch (name) {
|
|
90
97
|
case "width":
|
|
91
|
-
return containerWidthFamily(containerKey)
|
|
98
|
+
return get(containerWidthFamily(containerKey));
|
|
92
99
|
case "height":
|
|
93
|
-
return containerHeightFamily(containerKey)
|
|
100
|
+
return get(containerHeightFamily(containerKey));
|
|
94
101
|
case "aspect-ratio":
|
|
95
102
|
{
|
|
96
|
-
const width = containerWidthFamily(containerKey)
|
|
97
|
-
const height =
|
|
103
|
+
const width = get(containerWidthFamily(containerKey));
|
|
104
|
+
const height = get(containerHeightFamily(containerKey));
|
|
98
105
|
return width / height;
|
|
99
106
|
}
|
|
100
107
|
case "orientation":
|
|
101
|
-
const width = containerWidthFamily(containerKey)
|
|
102
|
-
const height =
|
|
108
|
+
const width = get(containerWidthFamily(containerKey));
|
|
109
|
+
const height = get(containerHeightFamily(containerKey));
|
|
103
110
|
return width > height ? "landscape" : "portrait";
|
|
104
111
|
case "inline-size":
|
|
105
112
|
case "block-size":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["activeFamily","containerHeightFamily","containerWidthFamily","focusFamily","hoverFamily","DEFAULT_CONTAINER_NAME","testContainerQueries","queries","inheritedContainers","guards","
|
|
1
|
+
{"version":3,"names":["activeFamily","containerHeightFamily","containerWidthFamily","focusFamily","hoverFamily","DEFAULT_CONTAINER_NAME","testContainerQueries","queries","inheritedContainers","guards","get","every","query","testContainerQuery","name","n","container","push","m","testContainerMediaCondition","p","testContainerPseudoCondition","containerKey","h","a","f","condition","some","left","getContainerFeatureValue","right","width","height"],"sourceRoot":"../../../../../src","sources":["runtime/native/conditions/container-query.ts"],"mappings":";;AAAA;;AASA,SACEA,YAAY,EACZC,qBAAqB,EACrBC,oBAAoB,EACpBC,WAAW,EACXC,WAAW,QAGN,kBAAe;AACtB;;AAGA,OAAO,MAAMC,sBAAsB,GAAG,iBAAiB;AAEvD,OAAO,SAASC,oBAAoBA,CAClCC,OAAyB,EACzBC,mBAA0C,EAC1CC,MAAqB,EACrBC,GAAW,EACX;EACA,OAAOH,OAAO,CAACI,KAAK,CAAEC,KAAK,IAAK;IAC9B,OAAOC,kBAAkB,CAACD,KAAK,EAAEJ,mBAAmB,EAAEC,MAAM,EAAEC,GAAG,CAAC;EACpE,CAAC,CAAC;AACJ;AAEA,OAAO,SAASG,kBAAkBA,CAChCD,KAAqB,EACrBJ,mBAA0C,EAC1CC,MAAqB,EACrBC,GAAW,EACF;EACT,MAAMI,IAAI,GAAGF,KAAK,CAACG,CAAC,IAAIV,sBAAsB;EAC9C,MAAMW,SAAS,GAAGR,mBAAmB,CAACM,IAAI,CAAE;EAE5CL,MAAM,CAACQ,IAAI,CAAC,CAAC,GAAG,EAAEH,IAAI,EAAEE,SAAS,CAAC,CAAC;EAEnC,IAAI,CAACA,SAAS,EAAE;IAC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QACnB,MAAMS,KAAK,GAAGrB,GAAG,CAACR,oBAAoB,CAACoB,YAAY,CAAC,CAAC;QACrD,MAAMU,MAAM,GAAGtB,GAAG,CAACT,qBAAqB,CAACqB,YAAY,CAAC,CAAC;QACvD,OAAOS,KAAK,GAAGC,MAAM;MACvB;IACA,KAAK,aAAa;MAChB,MAAMD,KAAK,GAAGrB,GAAG,CAACR,oBAAoB,CAACoB,YAAY,CAAC,CAAC;MACrD,MAAMU,MAAM,GAAGtB,GAAG,CAACT,qBAAqB,CAACqB,YAAY,CAAC,CAAC;MACvD,OAAOS,KAAK,GAAGC,MAAM,GAAG,WAAW,GAAG,UAAU;IAClD,KAAK,aAAa;IAClB,KAAK,YAAY;IACjB;MACE;EACJ;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["testGuards","state","currentProps","inheritedVariables","inheritedContainers","guards","some","guard","result","dataSet"],"sourceRoot":"../../../../../src","sources":["runtime/native/conditions/guards.ts"],"mappings":";;AAAA;;
|
|
1
|
+
{"version":3,"names":["testGuards","state","currentProps","inheritedVariables","inheritedContainers","guards","some","guard","result","dataSet"],"sourceRoot":"../../../../../src","sources":["runtime/native/conditions/guards.ts"],"mappings":";;AAAA;;AAaA,OAAO,SAASA,UAAUA,CACxBC,KAAqB,EACrBC,YAAiB,EACjBC,kBAAwC,EACxCC,mBAA0C,EAC1C;EACA,OAAOH,KAAK,CAACI,MAAM,EAAEC,IAAI,CAAEC,KAAK,IAAK;IACnC,IAAIC,MAAM,GAAG,KAAK;IAElB,QAAQD,KAAK,CAAC,CAAC,CAAC;MACd,KAAK,GAAG;QACN;QACAC,MAAM,GAAGN,YAAY,GAAGK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAKA,KAAK,CAAC,CAAC,CAAC;QAC9C;MACF,KAAK,GAAG;QACN;QACAC,MAAM,GAAGN,YAAY,EAAEO,OAAO,GAAGF,KAAK,CAAC,CAAC,CAAC,CAAC,KAAKA,KAAK,CAAC,CAAC,CAAC;QACvD;MACF,KAAK,GAAG;QACN;QACAC,MAAM,GAAGL,kBAAkB,CAACI,KAAK,CAAC,CAAC,CAAC,CAAC,KAAKA,KAAK,CAAC,CAAC,CAAC;QAClD;MACF,KAAK,GAAG;QACN;QACAC,MAAM,GAAGJ,mBAAmB,CAACG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAKA,KAAK,CAAC,CAAC,CAAC;QACnD;IACJ;IAEA,OAAOC,MAAM;EACf,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1,70 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
|
|
5
3
|
import { activeFamily, focusFamily, hoverFamily } from "../reactivity.js";
|
|
4
|
+
import { testAttributes } from "./attributes.js";
|
|
6
5
|
import { testContainerQueries } from "./container-query.js";
|
|
7
6
|
import { testMediaQuery } from "./media-query.js";
|
|
8
|
-
export function testRule(rule,
|
|
9
|
-
if (rule.p && !pseudoClasses(rule.p,
|
|
7
|
+
export function testRule(rule, get, props, guards, containerContext) {
|
|
8
|
+
if (rule.p && !pseudoClasses(rule.p, get)) {
|
|
10
9
|
return false;
|
|
11
10
|
}
|
|
12
|
-
if (rule.m && !testMediaQuery(rule.m,
|
|
11
|
+
if (rule.m && !testMediaQuery(rule.m, get)) {
|
|
13
12
|
return false;
|
|
14
13
|
}
|
|
15
|
-
if (rule.aq && !
|
|
14
|
+
if (rule.aq && !testAttributes(rule.aq, props, guards)) {
|
|
16
15
|
return false;
|
|
17
16
|
}
|
|
18
|
-
if (rule.cq && !testContainerQueries(rule.cq, containerContext, guards,
|
|
17
|
+
if (rule.cq && !testContainerQueries(rule.cq, containerContext, guards, get)) {
|
|
19
18
|
return false;
|
|
20
19
|
}
|
|
21
20
|
return true;
|
|
22
21
|
}
|
|
23
|
-
function pseudoClasses(query,
|
|
24
|
-
|
|
22
|
+
function pseudoClasses(query, get) {
|
|
23
|
+
// IMPORTANT: active needs: to be first. Modifies a global value
|
|
24
|
+
// that we use to determine if the component should be a pressable
|
|
25
|
+
if (query.a && !get(activeFamily(get))) {
|
|
25
26
|
return false;
|
|
26
27
|
}
|
|
27
|
-
if (query.
|
|
28
|
+
if (query.h && !get(hoverFamily(get))) {
|
|
28
29
|
return false;
|
|
29
30
|
}
|
|
30
|
-
if (query.f && !focusFamily(
|
|
31
|
+
if (query.f && !get(focusFamily(get))) {
|
|
31
32
|
return false;
|
|
32
33
|
}
|
|
33
34
|
return true;
|
|
34
35
|
}
|
|
35
|
-
function attributes(queries, props, guards) {
|
|
36
|
-
return queries.every(query => testAttribute(query, props, guards));
|
|
37
|
-
}
|
|
38
|
-
function testAttribute(query, props, guards) {
|
|
39
|
-
let value;
|
|
40
|
-
if (query[0] === "a") {
|
|
41
|
-
value = props?.[query[1]];
|
|
42
|
-
} else {
|
|
43
|
-
value = props?.dataSet?.[query[1]];
|
|
44
|
-
}
|
|
45
|
-
guards.push([query[0], query[1], value]);
|
|
46
|
-
const operator = query[2];
|
|
47
|
-
if (!operator) {
|
|
48
|
-
return value !== undefined && value !== null && value !== false;
|
|
49
|
-
}
|
|
50
|
-
switch (operator) {
|
|
51
|
-
case "!":
|
|
52
|
-
return !value;
|
|
53
|
-
case "=":
|
|
54
|
-
return value == query[3];
|
|
55
|
-
case "~=":
|
|
56
|
-
return value?.toString().split(" ").includes(query[3]);
|
|
57
|
-
case "|=":
|
|
58
|
-
return value?.toString().startsWith(query[3] + "-");
|
|
59
|
-
case "^=":
|
|
60
|
-
return value?.toString().startsWith(query[3]);
|
|
61
|
-
case "$=":
|
|
62
|
-
return value?.toString().endsWith(query[3]);
|
|
63
|
-
case "*=":
|
|
64
|
-
return value?.toString().includes(query[3]);
|
|
65
|
-
default:
|
|
66
|
-
operator;
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
36
|
//# sourceMappingURL=index.js.map
|