react-native-css 0.0.0-nightly.99fdf44 → 0.0.0-nightly.a37903f
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/README.md +29 -5
- package/dist/commonjs/babel/helpers.js +7 -0
- package/dist/commonjs/babel/helpers.js.map +1 -1
- package/dist/commonjs/babel/import-plugin.js +20 -8
- package/dist/commonjs/babel/import-plugin.js.map +1 -1
- package/dist/commonjs/babel/react-native-web.js +17 -4
- package/dist/commonjs/babel/react-native-web.js.map +1 -1
- package/dist/commonjs/babel/react-native.js +9 -4
- package/dist/commonjs/babel/react-native.js.map +1 -1
- package/dist/commonjs/compiler/atRules.js +52 -17
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +107 -32
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/container-query.js +6 -1
- package/dist/commonjs/compiler/container-query.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +159 -67
- package/dist/commonjs/compiler/declarations.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/lightningcss-loader.js +15 -2
- package/dist/commonjs/compiler/lightningcss-loader.js.map +1 -1
- package/dist/commonjs/compiler/media-query.js +16 -6
- package/dist/commonjs/compiler/media-query.js.map +1 -1
- package/dist/commonjs/compiler/selector-builder.js +15 -4
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +18 -8
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/compiler/supports.js +2 -2
- package/dist/commonjs/compiler/supports.js.map +1 -1
- package/dist/commonjs/components/ActivityIndicator.js +6 -6
- package/dist/commonjs/components/ActivityIndicator.js.map +1 -1
- package/dist/commonjs/components/Button.js +6 -6
- package/dist/commonjs/components/Button.js.map +1 -1
- package/dist/commonjs/components/FlatList.js +7 -6
- package/dist/commonjs/components/FlatList.js.map +1 -1
- package/dist/commonjs/components/Image.js +6 -6
- package/dist/commonjs/components/Image.js.map +1 -1
- package/dist/commonjs/components/ImageBackground.js +8 -12
- package/dist/commonjs/components/ImageBackground.js.map +1 -1
- package/dist/commonjs/components/KeyboardAvoidingView.js +8 -9
- package/dist/commonjs/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/commonjs/components/Pressable.js +6 -6
- package/dist/commonjs/components/Pressable.js.map +1 -1
- package/dist/commonjs/components/SafeAreaProvider.js +13 -0
- package/dist/commonjs/components/SafeAreaProvider.js.map +1 -0
- package/dist/commonjs/components/ScrollView.js +6 -6
- package/dist/commonjs/components/ScrollView.js.map +1 -1
- package/dist/commonjs/components/Switch.js +6 -6
- package/dist/commonjs/components/Switch.js.map +1 -1
- package/dist/commonjs/components/Text.js +6 -6
- package/dist/commonjs/components/Text.js.map +1 -1
- package/dist/commonjs/components/TextInput.js +6 -6
- package/dist/commonjs/components/TextInput.js.map +1 -1
- package/dist/commonjs/components/TouchableHighlight.js +6 -6
- package/dist/commonjs/components/TouchableHighlight.js.map +1 -1
- package/dist/commonjs/components/TouchableOpacity.js +6 -6
- package/dist/commonjs/components/TouchableOpacity.js.map +1 -1
- package/dist/commonjs/components/TouchableWithoutFeedback.js +6 -6
- package/dist/commonjs/components/TouchableWithoutFeedback.js.map +1 -1
- package/dist/commonjs/components/View.js +6 -6
- package/dist/commonjs/components/View.js.map +1 -1
- package/dist/commonjs/components/VirtualizedList.js +6 -6
- package/dist/commonjs/components/VirtualizedList.js.map +1 -1
- package/dist/commonjs/components/copyComponentProperties.js +19 -0
- package/dist/commonjs/components/copyComponentProperties.js.map +1 -0
- package/dist/commonjs/components/index.cjs +310 -0
- package/dist/commonjs/components/index.cjs.map +1 -0
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/jest/index.js +2 -2
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/cache-version.js +43 -0
- package/dist/commonjs/metro/cache-version.js.map +1 -0
- package/dist/commonjs/metro/index.js +10 -118
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +24 -4
- package/dist/commonjs/metro/metro-transformer.js.map +1 -1
- package/dist/commonjs/{native/metro.js → metro/override.js} +1 -1
- package/dist/commonjs/{native/metro.js.map → metro/override.js.map} +1 -1
- package/dist/commonjs/metro/resolver.js +15 -22
- package/dist/commonjs/metro/resolver.js.map +1 -1
- package/dist/commonjs/metro/typescript.js +26 -6
- package/dist/commonjs/metro/typescript.js.map +1 -1
- package/dist/commonjs/metro/warnings.js +135 -0
- package/dist/commonjs/metro/warnings.js.map +1 -0
- package/dist/commonjs/native/api.js +18 -10
- package/dist/commonjs/native/api.js.map +1 -1
- package/dist/commonjs/native/conditions/attributes.js +16 -9
- package/dist/commonjs/native/conditions/attributes.js.map +1 -1
- package/dist/commonjs/native/conditions/container-query.js +11 -11
- package/dist/commonjs/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/native/conditions/media-query.js +1 -1
- package/dist/commonjs/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/native/index.js +8 -8
- package/dist/commonjs/native/index.js.map +1 -1
- package/dist/commonjs/native/react/interaction.js +10 -5
- package/dist/commonjs/native/react/interaction.js.map +1 -1
- package/dist/commonjs/native/react/rules.js +12 -5
- package/dist/commonjs/native/react/rules.js.map +1 -1
- package/dist/commonjs/native/react/useNativeCss.js +70 -15
- package/dist/commonjs/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/native/react/usePassthrough.js +5 -2
- package/dist/commonjs/native/react/usePassthrough.js.map +1 -1
- package/dist/commonjs/{poison.pill.js → native/react-native-css-metro-override.js} +1 -1
- package/dist/commonjs/native/react-native-css-metro-override.js.map +1 -0
- package/dist/commonjs/native/reactivity.js +61 -24
- package/dist/commonjs/native/reactivity.js.map +1 -1
- package/dist/commonjs/native/reanimated.js +15 -3
- package/dist/commonjs/native/reanimated.js.map +1 -1
- package/dist/commonjs/native/styles/calculate-props.js +1 -1
- package/dist/commonjs/native/styles/functions/color-mix.js +64 -0
- package/dist/commonjs/native/styles/functions/color-mix.js.map +1 -0
- package/dist/commonjs/native/styles/functions/filters.js +18 -5
- package/dist/commonjs/native/styles/functions/filters.js.map +1 -1
- package/dist/commonjs/native/styles/functions/index.js +11 -0
- package/dist/commonjs/native/styles/functions/index.js.map +1 -1
- package/dist/commonjs/native/styles/functions/numeric-functions.js +4 -3
- package/dist/commonjs/native/styles/functions/numeric-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/string-functions.js +16 -1
- package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/transform-functions.js +5 -4
- package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/index.js +382 -28
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/native/styles/resolve.js +10 -7
- package/dist/commonjs/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/native/styles/scale-factor.js +13 -0
- package/dist/commonjs/native/styles/scale-factor.js.map +1 -0
- package/dist/commonjs/native/styles/shorthands/_handler.js +10 -0
- package/dist/commonjs/native/styles/shorthands/_handler.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/animation.js +11 -4
- package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/box-shadow.js +45 -12
- package/dist/commonjs/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/index.js +11 -0
- package/dist/commonjs/native/styles/shorthands/index.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js +22 -0
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/commonjs/native/styles/variables.js +55 -43
- package/dist/commonjs/native/styles/variables.js.map +1 -1
- package/dist/commonjs/native-internal/root.js +18 -7
- package/dist/commonjs/native-internal/root.js.map +1 -1
- package/dist/commonjs/native-internal/style-collection.js +1 -1
- package/dist/commonjs/native-internal/style-collection.js.map +1 -1
- package/dist/commonjs/native-internal/variables.js +1 -1
- package/dist/commonjs/native-internal/variables.js.map +1 -1
- package/dist/commonjs/utilities/dot-notation.types.js +4 -0
- package/dist/commonjs/utilities/style-descriptor.js +4 -9
- package/dist/commonjs/utilities/style-descriptor.js.map +1 -1
- package/dist/commonjs/web/api.js +7 -4
- package/dist/commonjs/web/api.js.map +1 -1
- package/dist/commonjs/web/assign-style.js +4 -1
- package/dist/commonjs/web/assign-style.js.map +1 -1
- package/dist/module/babel/helpers.js +6 -0
- package/dist/module/babel/helpers.js.map +1 -1
- package/dist/module/babel/import-plugin.js +22 -10
- package/dist/module/babel/import-plugin.js.map +1 -1
- package/dist/module/babel/react-native-web.js +16 -4
- package/dist/module/babel/react-native-web.js.map +1 -1
- package/dist/module/babel/react-native.js +9 -4
- package/dist/module/babel/react-native.js.map +1 -1
- package/dist/module/compiler/atRules.js +50 -17
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +109 -34
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js +2 -0
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/container-query.js +6 -1
- package/dist/module/compiler/container-query.js.map +1 -1
- package/dist/module/compiler/declarations.js +158 -67
- package/dist/module/compiler/declarations.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/lightningcss-loader.js +14 -2
- package/dist/module/compiler/lightningcss-loader.js.map +1 -1
- package/dist/module/compiler/media-query.js +16 -6
- package/dist/module/compiler/media-query.js.map +1 -1
- package/dist/module/compiler/selector-builder.js +15 -4
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +18 -8
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/compiler/supports.js +2 -2
- package/dist/module/compiler/supports.js.map +1 -1
- package/dist/module/components/ActivityIndicator.js +4 -3
- package/dist/module/components/ActivityIndicator.js.map +1 -1
- package/dist/module/components/Button.js +4 -3
- package/dist/module/components/Button.js.map +1 -1
- package/dist/module/components/FlatList.js +5 -3
- package/dist/module/components/FlatList.js.map +1 -1
- package/dist/module/components/Image.js +4 -3
- package/dist/module/components/Image.js.map +1 -1
- package/dist/module/components/ImageBackground.js +6 -9
- package/dist/module/components/ImageBackground.js.map +1 -1
- package/dist/module/components/KeyboardAvoidingView.js +6 -6
- package/dist/module/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/module/components/Pressable.js +4 -3
- package/dist/module/components/Pressable.js.map +1 -1
- package/dist/module/components/SafeAreaProvider.js +4 -0
- package/dist/module/components/SafeAreaProvider.js.map +1 -0
- package/dist/module/components/ScrollView.js +4 -3
- package/dist/module/components/ScrollView.js.map +1 -1
- package/dist/module/components/Switch.js +4 -3
- package/dist/module/components/Switch.js.map +1 -1
- package/dist/module/components/Text.js +4 -3
- package/dist/module/components/Text.js.map +1 -1
- package/dist/module/components/TextInput.js +4 -3
- package/dist/module/components/TextInput.js.map +1 -1
- package/dist/module/components/TouchableHighlight.js +4 -3
- package/dist/module/components/TouchableHighlight.js.map +1 -1
- package/dist/module/components/TouchableOpacity.js +4 -3
- package/dist/module/components/TouchableOpacity.js.map +1 -1
- package/dist/module/components/TouchableWithoutFeedback.js +4 -3
- package/dist/module/components/TouchableWithoutFeedback.js.map +1 -1
- package/dist/module/components/View.js +4 -3
- package/dist/module/components/View.js.map +1 -1
- package/dist/module/components/VirtualizedList.js +4 -3
- package/dist/module/components/VirtualizedList.js.map +1 -1
- package/dist/module/components/copyComponentProperties.js +15 -0
- package/dist/module/components/copyComponentProperties.js.map +1 -0
- package/dist/module/components/index.cjs +310 -0
- package/dist/module/components/index.cjs.map +1 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/jest/index.js +2 -2
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/cache-version.js +39 -0
- package/dist/module/metro/cache-version.js.map +1 -0
- package/dist/module/metro/index.js +10 -117
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +24 -4
- package/dist/module/metro/metro-transformer.js.map +1 -1
- package/dist/module/metro/override.js +4 -0
- package/dist/module/{native/metro.js.map → metro/override.js.map} +1 -1
- package/dist/module/metro/resolver.js +15 -22
- package/dist/module/metro/resolver.js.map +1 -1
- package/dist/module/metro/typescript.js +26 -6
- package/dist/module/metro/typescript.js.map +1 -1
- package/dist/module/metro/warnings.js +131 -0
- package/dist/module/metro/warnings.js.map +1 -0
- package/dist/module/native/api.js +19 -12
- package/dist/module/native/api.js.map +1 -1
- package/dist/module/native/conditions/attributes.js +16 -9
- package/dist/module/native/conditions/attributes.js.map +1 -1
- package/dist/module/native/conditions/container-query.js +11 -11
- package/dist/module/native/conditions/container-query.js.map +1 -1
- package/dist/module/native/conditions/media-query.js +1 -1
- package/dist/module/native/conditions/media-query.js.map +1 -1
- package/dist/module/native/index.js +1 -1
- package/dist/module/native/index.js.map +1 -1
- package/dist/module/native/react/interaction.js +10 -5
- package/dist/module/native/react/interaction.js.map +1 -1
- package/dist/module/native/react/rules.js +13 -6
- package/dist/module/native/react/rules.js.map +1 -1
- package/dist/module/native/react/useNativeCss.js +73 -18
- package/dist/module/native/react/useNativeCss.js.map +1 -1
- package/dist/module/native/react/usePassthrough.js +5 -2
- package/dist/module/native/react/usePassthrough.js.map +1 -1
- package/dist/module/{poison.pill.js → native/react-native-css-metro-override.js} +1 -1
- package/dist/module/native/react-native-css-metro-override.js.map +1 -0
- package/dist/module/native/reactivity.js +55 -22
- package/dist/module/native/reactivity.js.map +1 -1
- package/dist/module/native/reanimated.js +15 -3
- package/dist/module/native/reanimated.js.map +1 -1
- package/dist/module/native/styles/calculate-props.js +1 -1
- package/dist/module/native/styles/functions/color-mix.js +59 -0
- package/dist/module/native/styles/functions/color-mix.js.map +1 -0
- package/dist/module/native/styles/functions/filters.js +16 -4
- package/dist/module/native/styles/functions/filters.js.map +1 -1
- package/dist/module/native/styles/functions/index.js +1 -0
- package/dist/module/native/styles/functions/index.js.map +1 -1
- package/dist/module/native/styles/functions/numeric-functions.js +4 -3
- package/dist/module/native/styles/functions/numeric-functions.js.map +1 -1
- package/dist/module/native/styles/functions/string-functions.js +13 -0
- package/dist/module/native/styles/functions/string-functions.js.map +1 -1
- package/dist/module/native/styles/functions/transform-functions.js +5 -4
- package/dist/module/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/native/styles/index.js +383 -28
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/native/styles/resolve.js +10 -7
- package/dist/module/native/styles/resolve.js.map +1 -1
- package/dist/module/native/styles/scale-factor.js +9 -0
- package/dist/module/native/styles/scale-factor.js.map +1 -0
- package/dist/module/native/styles/shorthands/_handler.js +11 -1
- package/dist/module/native/styles/shorthands/_handler.js.map +1 -1
- package/dist/module/native/styles/shorthands/animation.js +9 -3
- package/dist/module/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/native/styles/shorthands/box-shadow.js +46 -12
- package/dist/module/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/module/native/styles/shorthands/index.js +1 -0
- package/dist/module/native/styles/shorthands/index.js.map +1 -1
- package/dist/module/native/styles/shorthands/logical-border-width.js +18 -0
- package/dist/module/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/module/native/styles/variables.js +55 -43
- package/dist/module/native/styles/variables.js.map +1 -1
- package/dist/module/native-internal/root.js +18 -7
- package/dist/module/native-internal/root.js.map +1 -1
- package/dist/module/native-internal/style-collection.js +1 -1
- package/dist/module/native-internal/style-collection.js.map +1 -1
- package/dist/module/native-internal/variables.js +2 -2
- package/dist/module/native-internal/variables.js.map +1 -1
- package/dist/module/utilities/dot-notation.types.js +2 -0
- package/dist/module/utilities/style-descriptor.js +4 -9
- package/dist/module/utilities/style-descriptor.js.map +1 -1
- package/dist/module/web/api.js +7 -4
- package/dist/module/web/api.js.map +1 -1
- package/dist/module/web/assign-style.js +4 -1
- package/dist/module/web/assign-style.js.map +1 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts +4 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -5
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +6 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +2 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/keyframes.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/keyframes.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +7 -8
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Button.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/FlatList.d.ts +3 -3
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Image.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Pressable.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/Pressable.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/ScrollView.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/ScrollView.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Switch.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Text.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/Text.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TextInput.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TouchableHighlight.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TouchableHighlight.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TouchableOpacity.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TouchableOpacity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TouchableWithoutFeedback.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TouchableWithoutFeedback.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/View.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/View.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/VirtualizedList.d.ts +3 -3
- package/dist/typescript/commonjs/src/components/VirtualizedList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/copyComponentProperties.d.ts +5 -0
- package/dist/typescript/commonjs/src/components/copyComponentProperties.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.cts +2 -0
- package/dist/typescript/commonjs/src/components/index.d.cts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +1 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +2 -10
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/cache-version.d.ts +8 -0
- package/dist/typescript/commonjs/src/metro/cache-version.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts +4 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +9 -4
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/override.d.ts +2 -0
- package/dist/typescript/commonjs/src/metro/override.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/typescript.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/warnings.d.ts +13 -0
- package/dist/typescript/commonjs/src/metro/warnings.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/api.d.ts +5 -9
- package/dist/typescript/commonjs/src/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/index.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/interaction.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/usePassthrough.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react-native-css-metro-override.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/react-native-css-metro-override.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/reactivity.d.ts +14 -3
- package/dist/typescript/commonjs/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/reanimated.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts +3 -0
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/index.d.ts +2 -2
- package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/_handler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/root.d.ts +12 -0
- package/dist/typescript/commonjs/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/variables.d.ts +1 -1
- package/dist/typescript/commonjs/src/native-internal/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime.types.d.ts +11 -6
- package/dist/typescript/commonjs/src/runtime.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts +3 -2
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts +1 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/api.d.ts +5 -5
- package/dist/typescript/commonjs/src/web/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/assign-style.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/helpers.d.ts +2 -1
- package/dist/typescript/module/src/babel/helpers.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/import-plugin.d.ts +1 -1
- package/dist/typescript/module/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/react-native-web.d.ts +2 -1
- package/dist/typescript/module/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/atRules.d.ts +6 -3
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts +3 -7
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +7 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/container-query.d.ts +2 -2
- package/dist/typescript/module/src/compiler/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +4 -3
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/index.d.ts +2 -2
- package/dist/typescript/module/src/compiler/index.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/inline-variables.d.ts +1 -1
- package/dist/typescript/module/src/compiler/inline-variables.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/keyframes.d.ts +3 -3
- package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/media-query.d.ts +3 -3
- package/dist/typescript/module/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +1 -1
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selectors.d.ts +2 -2
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +7 -8
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts +2 -4
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Button.d.ts +2 -4
- package/dist/typescript/module/src/components/Button.d.ts.map +1 -1
- package/dist/typescript/module/src/components/FlatList.d.ts +3 -3
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Image.d.ts +2 -4
- package/dist/typescript/module/src/components/Image.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ImageBackground.d.ts +2 -4
- package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts +2 -4
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Pressable.d.ts +2 -4
- package/dist/typescript/module/src/components/Pressable.d.ts.map +1 -1
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/module/src/components/ScrollView.d.ts +2 -4
- package/dist/typescript/module/src/components/ScrollView.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Switch.d.ts +2 -6
- package/dist/typescript/module/src/components/Switch.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Text.d.ts +2 -6
- package/dist/typescript/module/src/components/Text.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TextInput.d.ts +2 -4
- package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TouchableHighlight.d.ts +2 -4
- package/dist/typescript/module/src/components/TouchableHighlight.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TouchableOpacity.d.ts +2 -4
- package/dist/typescript/module/src/components/TouchableOpacity.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TouchableWithoutFeedback.d.ts +2 -4
- package/dist/typescript/module/src/components/TouchableWithoutFeedback.d.ts.map +1 -1
- package/dist/typescript/module/src/components/View.d.ts +2 -6
- package/dist/typescript/module/src/components/View.d.ts.map +1 -1
- package/dist/typescript/module/src/components/VirtualizedList.d.ts +3 -3
- package/dist/typescript/module/src/components/VirtualizedList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/copyComponentProperties.d.ts +5 -0
- package/dist/typescript/module/src/components/copyComponentProperties.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.cts +2 -0
- package/dist/typescript/module/src/components/index.d.cts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +16 -16
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +2 -10
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/cache-version.d.ts +8 -0
- package/dist/typescript/module/src/metro/cache-version.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/index.d.ts +5 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +10 -5
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/override.d.ts +2 -0
- package/dist/typescript/module/src/metro/override.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/typescript.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/warnings.d.ts +13 -0
- package/dist/typescript/module/src/metro/warnings.d.ts.map +1 -0
- package/dist/typescript/module/src/native/api.d.ts +6 -10
- package/dist/typescript/module/src/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/attributes.d.ts +1 -1
- package/dist/typescript/module/src/native/conditions/attributes.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/container-query.d.ts +2 -2
- package/dist/typescript/module/src/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/module/src/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/index.d.ts +3 -3
- package/dist/typescript/module/src/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/media-query.d.ts +1 -1
- package/dist/typescript/module/src/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/native/index.d.ts +3 -3
- package/dist/typescript/module/src/native/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/interaction.d.ts +2 -2
- package/dist/typescript/module/src/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/rules.d.ts +2 -2
- package/dist/typescript/module/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts +5 -5
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/usePassthrough.d.ts +1 -1
- package/dist/typescript/module/src/native/react/usePassthrough.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react-native-css-metro-override.d.ts +2 -0
- package/dist/typescript/module/src/native/react-native-css-metro-override.d.ts.map +1 -0
- package/dist/typescript/module/src/native/reactivity.d.ts +14 -3
- package/dist/typescript/module/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/native/reanimated.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts +2 -2
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts +3 -0
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/functions/filters.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/filters.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/index.d.ts +8 -7
- package/dist/typescript/module/src/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/index.d.ts +7 -7
- package/dist/typescript/module/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/line-height.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/line-height.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/resolve.d.ts +4 -3
- package/dist/typescript/module/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/module/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts +3 -2
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/border.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/border.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/index.d.ts +6 -5
- package/dist/typescript/module/src/native/styles/shorthands/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
- package/dist/typescript/module/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/units.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/variables.d.ts +2 -2
- package/dist/typescript/module/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/index.d.ts +3 -3
- package/dist/typescript/module/src/native-internal/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/root.d.ts +13 -1
- package/dist/typescript/module/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/style-collection.d.ts +2 -2
- package/dist/typescript/module/src/native-internal/style-collection.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/variables.d.ts +2 -2
- package/dist/typescript/module/src/native-internal/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.d.ts +1 -1
- package/dist/typescript/module/src/runtime.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.native.d.ts +1 -1
- package/dist/typescript/module/src/runtime.native.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.types.d.ts +11 -6
- package/dist/typescript/module/src/runtime.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts +3 -2
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/index.d.ts +3 -3
- package/dist/typescript/module/src/utilities/index.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/specificity.d.ts +2 -2
- package/dist/typescript/module/src/utilities/specificity.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/style-descriptor.d.ts +1 -1
- package/dist/typescript/module/src/utilities/style-descriptor.d.ts.map +1 -1
- package/dist/typescript/module/src/web/api.d.ts +5 -5
- package/dist/typescript/module/src/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/web/assign-style.d.ts.map +1 -1
- package/dist/typescript/module/src/web/index.d.ts +3 -3
- package/dist/typescript/module/src/web/index.d.ts.map +1 -1
- package/node/babel.mjs +4 -0
- package/node/compiler.mjs +2 -0
- package/node/metro.mjs +2 -0
- package/package.json +87 -39
- package/src/babel/helpers.ts +8 -1
- package/src/babel/import-plugin.ts +31 -16
- package/src/babel/react-native-web.ts +32 -4
- package/src/babel/react-native.ts +9 -4
- package/src/compiler/atRules.ts +63 -18
- package/src/compiler/compiler.ts +159 -43
- package/src/compiler/compiler.types.ts +9 -0
- package/src/compiler/container-query.ts +8 -3
- package/src/compiler/declarations.ts +290 -105
- package/src/compiler/keyframes.ts +2 -2
- package/src/compiler/lightningcss-loader.ts +21 -1
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +31 -4
- package/src/compiler/stylesheet.ts +26 -15
- package/src/compiler/supports.ts +2 -2
- package/src/components/ActivityIndicator.tsx +9 -6
- package/src/components/Button.tsx +9 -4
- package/src/components/FlatList.tsx +15 -5
- package/src/components/Image.tsx +9 -4
- package/src/components/ImageBackground.tsx +11 -12
- package/src/components/KeyboardAvoidingView.tsx +11 -9
- package/src/components/Pressable.tsx +9 -4
- package/src/components/SafeAreaProvider.tsx +1 -0
- package/src/components/ScrollView.tsx +9 -6
- package/src/components/Switch.tsx +9 -4
- package/src/components/Text.tsx +9 -4
- package/src/components/TextInput.tsx +9 -4
- package/src/components/TouchableHighlight.tsx +9 -6
- package/src/components/TouchableOpacity.tsx +9 -6
- package/src/components/TouchableWithoutFeedback.tsx +9 -6
- package/src/components/View.tsx +9 -4
- package/src/components/VirtualizedList.tsx +18 -6
- package/src/components/copyComponentProperties.ts +21 -0
- package/src/components/index.cts +308 -0
- package/src/components/{index.tsx → index.ts} +0 -1
- package/src/jest/index.ts +3 -2
- package/src/metro/cache-version.ts +48 -0
- package/src/metro/index.ts +15 -166
- package/src/metro/metro-transformer.ts +41 -9
- package/src/metro/override.ts +1 -0
- package/src/metro/resolver.ts +29 -28
- package/src/metro/typescript.ts +53 -6
- package/src/metro/warnings.ts +187 -0
- package/src/native/api.tsx +26 -17
- package/src/native/conditions/attributes.ts +26 -9
- package/src/native/conditions/container-query.ts +11 -9
- package/src/native/conditions/media-query.ts +1 -1
- package/src/native/index.ts +1 -2
- package/src/native/react/interaction.ts +11 -6
- package/src/native/react/rules.ts +13 -5
- package/src/native/react/useNativeCss.ts +79 -17
- package/src/native/react/usePassthrough.ts +3 -2
- package/src/native/reactivity.ts +76 -24
- package/src/native/reanimated.ts +24 -5
- package/src/native/styles/calculate-props.ts +1 -1
- package/src/native/styles/functions/color-mix.ts +74 -0
- package/src/native/styles/functions/filters.ts +20 -6
- package/src/native/styles/functions/index.ts +1 -0
- package/src/native/styles/functions/numeric-functions.ts +7 -6
- package/src/native/styles/functions/string-functions.ts +18 -0
- package/src/native/styles/functions/transform-functions.ts +5 -4
- package/src/native/styles/index.ts +443 -36
- package/src/native/styles/resolve.ts +15 -12
- package/src/native/styles/scale-factor.ts +6 -0
- package/src/native/styles/shorthands/_handler.ts +14 -1
- package/src/native/styles/shorthands/animation.ts +17 -3
- package/src/native/styles/shorthands/box-shadow.ts +50 -15
- package/src/native/styles/shorthands/index.ts +1 -0
- package/src/native/styles/shorthands/logical-border-width.ts +32 -0
- package/src/native/styles/variables.ts +48 -38
- package/src/native-internal/root.ts +40 -13
- package/src/native-internal/style-collection.ts +1 -1
- package/src/native-internal/variables.tsx +6 -4
- package/src/runtime.types.ts +17 -15
- package/src/utilities/dot-notation.types.ts +12 -4
- package/src/utilities/style-descriptor.ts +11 -16
- package/src/web/api.tsx +13 -13
- package/src/web/assign-style.ts +2 -1
- package/types.d.ts +3 -20
- package/dist/commonjs/compiler/inheritance.test.js +0 -78
- package/dist/commonjs/compiler/inheritance.test.js.map +0 -1
- package/dist/commonjs/poison.pill.js.map +0 -1
- package/dist/commonjs/runtime/native/injection.js +0 -2
- package/dist/commonjs/runtime/native/injection.js.map +0 -1
- package/dist/module/compiler/inheritance.test.js +0 -78
- package/dist/module/compiler/inheritance.test.js.map +0 -1
- package/dist/module/native/metro.js +0 -5
- package/dist/module/poison.pill.js.map +0 -1
- package/dist/module/runtime/native/injection.js +0 -2
- package/dist/module/runtime/native/injection.js.map +0 -1
- package/dist/typescript/commonjs/example/app.config.d.ts +0 -4
- package/dist/typescript/commonjs/example/app.config.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/src/App.d.ts +0 -2
- package/dist/typescript/commonjs/example/src/App.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts +0 -2
- package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/native/metro.d.ts +0 -2
- package/dist/typescript/commonjs/src/native/metro.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/poison.pill.d.ts +0 -2
- package/dist/typescript/commonjs/src/poison.pill.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +0 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +0 -1
- package/dist/typescript/module/example/app.config.d.ts +0 -4
- package/dist/typescript/module/example/app.config.d.ts.map +0 -1
- package/dist/typescript/module/example/src/App.d.ts +0 -2
- package/dist/typescript/module/example/src/App.d.ts.map +0 -1
- package/dist/typescript/module/src/compiler/inheritance.test.d.ts +0 -2
- package/dist/typescript/module/src/compiler/inheritance.test.d.ts.map +0 -1
- package/dist/typescript/module/src/native/metro.d.ts +0 -2
- package/dist/typescript/module/src/native/metro.d.ts.map +0 -1
- package/dist/typescript/module/src/poison.pill.d.ts +0 -2
- package/dist/typescript/module/src/poison.pill.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts +0 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts.map +0 -1
- package/src/compiler/inheritance.test.ts +0 -121
- package/src/native/metro.ts +0 -2
- package/src/runtime/native/injection.ts +0 -0
- /package/src/{poison.pill.ts → native/react-native-css-metro-override.ts} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
import { dirname, relative, sep } from "node:path";
|
|
5
4
|
import { versions } from "node:process";
|
|
6
|
-
import
|
|
7
|
-
import { compile } from "../compiler/index.js";
|
|
8
|
-
import { getNativeInjectionCode, getWebInjectionCode } from "./injection-code.js";
|
|
5
|
+
import { getCacheVersion } from "./cache-version.js";
|
|
9
6
|
import { nativeResolver, webResolver } from "./resolver.js";
|
|
10
7
|
import { setupTypeScript } from "./typescript.js";
|
|
11
|
-
const
|
|
8
|
+
const metroOverrideResolution = {
|
|
9
|
+
type: "sourceFile",
|
|
10
|
+
filePath: require.resolve("./override")
|
|
11
|
+
};
|
|
12
12
|
export function withReactNativeCSS(config, options) {
|
|
13
13
|
if (typeof config === "function") {
|
|
14
14
|
return async () => {
|
|
@@ -21,16 +21,15 @@ export function withReactNativeCSS(config, options) {
|
|
|
21
21
|
const {
|
|
22
22
|
disableTypeScriptGeneration,
|
|
23
23
|
typescriptEnvPath,
|
|
24
|
-
globalClassNamePolyfill = false
|
|
25
|
-
logger = defaultLogger
|
|
24
|
+
globalClassNamePolyfill = false
|
|
26
25
|
} = options || {};
|
|
27
|
-
const loggerEnabled = "enabled" in logger ? logger.enabled : true;
|
|
28
26
|
if (disableTypeScriptGeneration !== true) {
|
|
29
27
|
setupTypeScript(typescriptEnvPath);
|
|
30
28
|
}
|
|
31
29
|
return {
|
|
32
30
|
...config,
|
|
33
|
-
|
|
31
|
+
cacheVersion: getCacheVersion(config.cacheVersion, options),
|
|
32
|
+
transformerPath: require.resolve("./metro-transformer"),
|
|
34
33
|
transformer: {
|
|
35
34
|
...config.transformer,
|
|
36
35
|
reactNativeCSS: options
|
|
@@ -39,10 +38,8 @@ export function withReactNativeCSS(config, options) {
|
|
|
39
38
|
...config.resolver,
|
|
40
39
|
sourceExts: [...(config?.resolver?.sourceExts || []), "css"],
|
|
41
40
|
resolveRequest: (context, moduleName, platform) => {
|
|
42
|
-
if (moduleName.includes("
|
|
43
|
-
return
|
|
44
|
-
type: "empty"
|
|
45
|
-
};
|
|
41
|
+
if (moduleName.includes("react-native-css-metro-override")) {
|
|
42
|
+
return metroOverrideResolution;
|
|
46
43
|
}
|
|
47
44
|
const parentResolver = config.resolver?.resolveRequest ?? context.resolveRequest;
|
|
48
45
|
|
|
@@ -54,110 +51,6 @@ export function withReactNativeCSS(config, options) {
|
|
|
54
51
|
const resolved = resolver(parentResolver, context, moduleName, platform);
|
|
55
52
|
return resolved;
|
|
56
53
|
}
|
|
57
|
-
},
|
|
58
|
-
server: {
|
|
59
|
-
...config.server,
|
|
60
|
-
enhanceMiddleware(metroMiddleware, metroServer) {
|
|
61
|
-
const bundler = metroServer.getBundler().getBundler();
|
|
62
|
-
if (!bundler.__react_native_css__patched) {
|
|
63
|
-
bundler.__react_native_css__patched = true;
|
|
64
|
-
const nativeCSSFiles = new Map();
|
|
65
|
-
const webCSSFiles = new Set();
|
|
66
|
-
const nativeInjectionPath = require.resolve("../native/metro");
|
|
67
|
-
const nativeInjectionFilepaths = [
|
|
68
|
-
// CommonJS
|
|
69
|
-
nativeInjectionPath,
|
|
70
|
-
// ES Module
|
|
71
|
-
nativeInjectionPath.replace(`dist${sep}commonjs`, `dist${sep}module`),
|
|
72
|
-
// TypeScript
|
|
73
|
-
nativeInjectionPath.replace(`dist${sep}commonjs`, `src`).replace(".js", ".ts")];
|
|
74
|
-
const webInjectionPath = require.resolve("../web/metro");
|
|
75
|
-
const webInjectionFilepaths = [
|
|
76
|
-
// CommonJS
|
|
77
|
-
webInjectionPath,
|
|
78
|
-
// ES Module
|
|
79
|
-
webInjectionPath.replace(`dist${sep}commonjs`, `dist${sep}module`),
|
|
80
|
-
// TypeScript
|
|
81
|
-
webInjectionPath.replace(`dist${sep}commonjs`, `src`).replace(".js", ".ts")];
|
|
82
|
-
|
|
83
|
-
// Keep the original
|
|
84
|
-
const transformFile = bundler.transformFile.bind(bundler);
|
|
85
|
-
const watcher = bundler.getWatcher();
|
|
86
|
-
|
|
87
|
-
// Patch with our functionality
|
|
88
|
-
bundler.transformFile = async function (filePath, transformOptions, fileBuffer) {
|
|
89
|
-
const isCss = /\.(s?css|sass)$/.test(filePath);
|
|
90
|
-
if (transformOptions.platform === "web") {
|
|
91
|
-
if (isCss) {
|
|
92
|
-
webCSSFiles.add(filePath);
|
|
93
|
-
} else if (webInjectionFilepaths.includes(filePath)) {
|
|
94
|
-
fileBuffer = getWebInjectionCode(Array.from(webCSSFiles));
|
|
95
|
-
}
|
|
96
|
-
return transformFile(filePath, transformOptions, fileBuffer);
|
|
97
|
-
} else {
|
|
98
|
-
// Handle CSS files on native platforms
|
|
99
|
-
if (isCss) {
|
|
100
|
-
const webTransform = await transformFile(filePath, {
|
|
101
|
-
...transformOptions,
|
|
102
|
-
// Force the platform to web for CSS files
|
|
103
|
-
platform: "web",
|
|
104
|
-
// Let the transformer know that we will handle compilation
|
|
105
|
-
customTransformOptions: {
|
|
106
|
-
...transformOptions.customTransformOptions,
|
|
107
|
-
reactNativeCSS: options
|
|
108
|
-
}
|
|
109
|
-
}, fileBuffer);
|
|
110
|
-
const lastTransform = nativeCSSFiles.get(filePath);
|
|
111
|
-
const last = lastTransform?.[0];
|
|
112
|
-
const next = webTransform.output[0].data.css.code.toString();
|
|
113
|
-
|
|
114
|
-
// The CSS file has changed, we need to recompile the injection file
|
|
115
|
-
if (next !== last) {
|
|
116
|
-
nativeCSSFiles.set(filePath, [next, compile(next, {
|
|
117
|
-
hexColors: options?.hexColors
|
|
118
|
-
}).stylesheet()]);
|
|
119
|
-
watcher.emit("change", {
|
|
120
|
-
eventsQueue: nativeInjectionFilepaths.map(filePath => ({
|
|
121
|
-
filePath,
|
|
122
|
-
metadata: {
|
|
123
|
-
modifiedTime: Date.now(),
|
|
124
|
-
size: 1,
|
|
125
|
-
// Can be anything
|
|
126
|
-
type: "virtual" // Can be anything
|
|
127
|
-
},
|
|
128
|
-
type: "change"
|
|
129
|
-
}))
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
const nativeTransform = await transformFile(filePath, transformOptions, fileBuffer);
|
|
133
|
-
|
|
134
|
-
// Tell Expo to skip caching this file
|
|
135
|
-
nativeTransform.output[0].data.css = {
|
|
136
|
-
skipCache: true,
|
|
137
|
-
// Expo requires a `code` property
|
|
138
|
-
code: ""
|
|
139
|
-
};
|
|
140
|
-
return nativeTransform;
|
|
141
|
-
} else if (nativeInjectionFilepaths.includes(filePath)) {
|
|
142
|
-
// If this is the injection file, we to swap its content with the
|
|
143
|
-
// compiled CSS files
|
|
144
|
-
fileBuffer = getNativeInjectionCode(Array.from(nativeCSSFiles.keys()).map(key => relative(dirname(filePath), key)), Array.from(nativeCSSFiles.values()).map(([, value]) => value));
|
|
145
|
-
if (loggerEnabled && fileBuffer) {
|
|
146
|
-
logger(`Transformed ${filePath}`);
|
|
147
|
-
logger(fileBuffer?.toString());
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return transformFile(filePath, transformOptions, fileBuffer);
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* We don't modify the middleware, we just use this function to get the metroServer
|
|
157
|
-
* So simply return the existing middleware
|
|
158
|
-
*/
|
|
159
|
-
return config.server?.enhanceMiddleware?.(metroMiddleware, metroServer) ?? metroMiddleware;
|
|
160
|
-
}
|
|
161
54
|
}
|
|
162
55
|
};
|
|
163
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["versions","getCacheVersion","nativeResolver","webResolver","setupTypeScript","metroOverrideResolution","type","filePath","require","resolve","withReactNativeCSS","config","options","Number","node","split","Error","disableTypeScriptGeneration","typescriptEnvPath","globalClassNamePolyfill","cacheVersion","transformerPath","transformer","reactNativeCSS","resolver","sourceExts","resolveRequest","context","moduleName","platform","includes","parentResolver","resolved"],"sourceRoot":"../../../src","sources":["metro/index.ts"],"mappings":";;AAAA;AACA,SAASA,QAAQ,QAAQ,cAAc;AAKvC,SAASC,eAAe,QAAQ,oBAAiB;AACjD,SAASC,cAAc,EAAEC,WAAW,QAAQ,eAAY;AACxD,SAASC,eAAe,QAAQ,iBAAc;AAiB9C,MAAMC,uBAAuB,GAAG;EAC9BC,IAAI,EAAE,YAAY;EAClBC,QAAQ,EAAEC,OAAO,CAACC,OAAO,CAAC,YAAY;AACxC,CAAC;AAED,OAAO,SAASC,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;EAC5B,CAAC,GAAGP,OAAO,IAAI,CAAC,CAAC;EAEjB,IAAIK,2BAA2B,KAAK,IAAI,EAAE;IACxCb,eAAe,CAACc,iBAAiB,CAAC;EACpC;EAEA,OAAO;IACL,GAAGP,MAAM;IACTS,YAAY,EAAEnB,eAAe,CAACU,MAAM,CAACS,YAAY,EAAER,OAAO,CAAC;IAC3DS,eAAe,EAAEb,OAAO,CAACC,OAAO,CAAC,qBAAqB,CAAC;IACvDa,WAAW,EAAE;MACX,GAAGX,MAAM,CAACW,WAAW;MACrBC,cAAc,EAAEX;IAClB,CAAC;IACDY,QAAQ,EAAE;MACR,GAAGb,MAAM,CAACa,QAAQ;MAClBC,UAAU,EAAE,CAAC,IAAId,MAAM,EAAEa,QAAQ,EAAEC,UAAU,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC;MAC5DC,cAAc,EAAEA,CAACC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,KAAK;QACjD,IAAID,UAAU,CAACE,QAAQ,CAAC,iCAAiC,CAAC,EAAE;UAC1D,OAAOzB,uBAAuB;QAChC;QAEA,MAAM0B,cAAc,GAClBpB,MAAM,CAACa,QAAQ,EAAEE,cAAc,IAAIC,OAAO,CAACD,cAAc;;QAE3D;QACA,IAAI,CAACP,uBAAuB,EAAE;UAC5B,OAAOY,cAAc,CAACJ,OAAO,EAAEC,UAAU,EAAEC,QAAQ,CAAC;QACtD;QAEA,MAAML,QAAQ,GAAGK,QAAQ,KAAK,KAAK,GAAG1B,WAAW,GAAGD,cAAc;QAClE,MAAM8B,QAAQ,GAAGR,QAAQ,CACvBO,cAAc,EACdJ,OAAO,EACPC,UAAU,EACVC,QACF,CAAC;QAED,OAAOG,QAAQ;MACjB;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { unstable_transformerPath } from "@expo/metro-config";
|
|
4
4
|
import { compile } from "../compiler/index.js";
|
|
5
5
|
import { getNativeInjectionCode } from "./injection-code.js";
|
|
6
|
+
import { reportCompilerWarnings } from "./warnings.js";
|
|
6
7
|
const worker =
|
|
7
8
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
8
9
|
require(unstable_transformerPath);
|
|
@@ -16,12 +17,31 @@ export async function transform(config, projectRoot, filePath, data, options) {
|
|
|
16
17
|
platform: "web"
|
|
17
18
|
});
|
|
18
19
|
const css = cssFile.output[0].data.css.code.toString();
|
|
19
|
-
const
|
|
20
|
-
|
|
20
|
+
const {
|
|
21
|
+
warnings: warningLevel,
|
|
22
|
+
...compilerOptions
|
|
23
|
+
} = config.reactNativeCSS ?? {};
|
|
24
|
+
const compiled = compile(css, {
|
|
25
|
+
...compilerOptions,
|
|
21
26
|
filename: filePath,
|
|
22
27
|
projectRoot: projectRoot
|
|
23
|
-
})
|
|
28
|
+
});
|
|
29
|
+
const productionJS = compiled.stylesheet();
|
|
30
|
+
|
|
31
|
+
// Nothing downstream of the transformer sees the compile result, so this is the one place a build can report it
|
|
32
|
+
reportCompilerWarnings(compiled.warnings(), {
|
|
33
|
+
filename: filePath,
|
|
34
|
+
projectRoot,
|
|
35
|
+
level: warningLevel
|
|
36
|
+
});
|
|
24
37
|
data = Buffer.from(getNativeInjectionCode([], [productionJS]));
|
|
25
|
-
|
|
38
|
+
const transform = await worker.transform(config, projectRoot, `${filePath}.js`, data, options);
|
|
39
|
+
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
41
|
+
transform.output[0].data.css = {
|
|
42
|
+
skipCache: true,
|
|
43
|
+
code: ""
|
|
44
|
+
};
|
|
45
|
+
return transform;
|
|
26
46
|
}
|
|
27
47
|
//# sourceMappingURL=metro-transformer.js.map
|
|
@@ -1 +1 @@
|
|
|
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","
|
|
1
|
+
{"version":3,"names":["unstable_transformerPath","compile","getNativeInjectionCode","reportCompilerWarnings","worker","require","transform","config","projectRoot","filePath","data","options","isCss","type","test","platform","cssFile","css","output","code","toString","warnings","warningLevel","compilerOptions","reactNativeCSS","compiled","filename","productionJS","stylesheet","level","Buffer","from","skipCache"],"sourceRoot":"../../../src","sources":["metro/metro-transformer.ts"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,oBAAoB;AAM7D,SAASC,OAAO,QAA8B,sBAAa;AAC3D,SAASC,sBAAsB,QAAQ,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AC,CAAC;EAEFZ,IAAI,GAAGoB,MAAM,CAACC,IAAI,CAAC7B,sBAAsB,CAAC,EAAE,EAAE,CAACyB,YAAY,CAAC,CAAC,CAAC;EAE9D,MAAMrB,SAAS,GAAG,MAAMF,MAAM,CAACE,SAAS,CACtCC,MAAM,EACNC,WAAW,EACX,GAAGC,QAAQ,KAAK,EAChBC,IAAI,EACJC,OACF,CAAC;;EAED;EACCL,SAAS,CAASY,MAAM,CAAC,CAAC,CAAC,CAACR,IAAI,CAACO,GAAG,GAAG;IACtCe,SAAS,EAAE,IAAI;IACfb,IAAI,EAAE;EACR,CAAC;EAED,OAAOb,SAAS;AAClB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["metro/override.ts"],"mappings":";;AAAA","ignoreList":[]}
|
|
@@ -9,32 +9,23 @@ function isFromThisModule(filename) {
|
|
|
9
9
|
}
|
|
10
10
|
export function nativeResolver(resolver, context, moduleName, platform) {
|
|
11
11
|
const resolution = resolver(context, moduleName, platform);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// Only operate on source files
|
|
16
|
-
resolution.type !== "sourceFile" ||
|
|
17
|
-
// Skip the React Native barrel file to prevent infinite recursion
|
|
18
|
-
context.originModulePath.endsWith("react-native/index.js") ||
|
|
19
|
-
// Skip anything that isn't importing a React Native component
|
|
20
|
-
!(moduleName.startsWith("react-native") || moduleName.startsWith("react-native/"))) {
|
|
12
|
+
const isInternal = isFromThisModule(context.originModulePath);
|
|
13
|
+
const isReactNativeIndex = context.originModulePath.endsWith(`${sep}react-native${sep}index.js`);
|
|
14
|
+
if (isInternal || resolution.type !== "sourceFile" || isReactNativeIndex) {
|
|
21
15
|
return resolution;
|
|
22
16
|
}
|
|
23
17
|
if (moduleName === "react-native") {
|
|
24
18
|
return resolver(context, `react-native-css/components`, platform);
|
|
25
|
-
}
|
|
26
|
-
if (moduleName === "react-native-safe-area-context") {
|
|
19
|
+
} else if (moduleName === "react-native-safe-area-context") {
|
|
27
20
|
return resolver(context, `react-native-css/components/react-native-safe-area-context`, platform);
|
|
21
|
+
} else if (resolution.filePath.includes(`${sep}react-native${sep}Libraries${sep}`)) {
|
|
22
|
+
const filename = basename(resolution.filePath.split(sep).at(-1) ?? "");
|
|
23
|
+
const module = filename.split(".").at(0);
|
|
24
|
+
if (module && allowedModules.has(module)) {
|
|
25
|
+
return resolver(context, `react-native-css/components/${module}`, platform);
|
|
26
|
+
}
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
// We only care about `react-native/Library/Components/<module>.js` components
|
|
31
|
-
const segments = resolution.filePath.split(sep);
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
33
|
-
const module = basename(segments.at(-1)).split(".")[0];
|
|
34
|
-
if (!module || !allowedModules.has(module)) {
|
|
35
|
-
return resolution;
|
|
36
|
-
}
|
|
37
|
-
return resolver(context, `react-native-css/components/${module}`, platform);
|
|
28
|
+
return resolution;
|
|
38
29
|
}
|
|
39
30
|
export function webResolver(resolver, context, moduleName, platform) {
|
|
40
31
|
const resolution = resolver(context, moduleName, platform);
|
|
@@ -44,7 +35,9 @@ export function webResolver(resolver, context, moduleName, platform) {
|
|
|
44
35
|
// Only operate on source files
|
|
45
36
|
resolution.type !== "sourceFile" ||
|
|
46
37
|
// Skip anything that isn't importing from `react-native-web`
|
|
47
|
-
!resolution.filePath.includes(`${sep}react-native-web${sep}`)
|
|
38
|
+
!resolution.filePath.includes(`${sep}react-native-web${sep}`) ||
|
|
39
|
+
// Skip internal react-native-web files
|
|
40
|
+
resolution.filePath.includes(`${sep}react-native-web${sep}dist${sep}vendor`)) {
|
|
48
41
|
return resolution;
|
|
49
42
|
}
|
|
50
43
|
|
|
@@ -52,7 +45,7 @@ export function webResolver(resolver, context, moduleName, platform) {
|
|
|
52
45
|
const segments = resolution.filePath.split(sep);
|
|
53
46
|
const isIndex = segments.at(-1)?.startsWith("index.");
|
|
54
47
|
const module = segments.at(-2);
|
|
55
|
-
if (!isIndex || !module || !allowedModules.has(module)) {
|
|
48
|
+
if (!isIndex || !module || !allowedModules.has(module) || module === "VirtualizedList") {
|
|
56
49
|
return resolution;
|
|
57
50
|
}
|
|
58
51
|
return resolver(context, `react-native-css/components/${module}`, platform);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["basename","resolve","sep","allowedModules","thisModuleDist","__dirname","thisModuleSrc","isFromThisModule","filename","startsWith","nativeResolver","resolver","context","moduleName","platform","resolution","originModulePath","
|
|
1
|
+
{"version":3,"names":["basename","resolve","sep","allowedModules","thisModuleDist","__dirname","thisModuleSrc","isFromThisModule","filename","startsWith","nativeResolver","resolver","context","moduleName","platform","resolution","isInternal","originModulePath","isReactNativeIndex","endsWith","type","filePath","includes","split","at","module","has","webResolver","segments","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;EAC1D,MAAME,UAAU,GAAGT,gBAAgB,CAACK,OAAO,CAACK,gBAAgB,CAAC;EAC7D,M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AK,YAAY;EAChC;EACA,CAACL,UAAU,CAACM,QAAQ,CAACC,QAAQ,CAAC,GAAGpB,GAAG,mBAAmBA,GAAG,EAAE,CAAC;EAC7D;EACAa,UAAU,CAACM,QAAQ,CAACC,QAAQ,CAAC,GAAGpB,GAAG,mBAAmBA,GAAG,OAAOA,GAAG,QAAQ,CAAC,EAC5E;IACA,OAAOa,UAAU;EACnB;;EAEA;EACA,MAAMa,QAAQ,GAAGb,UAAU,CAACM,QAAQ,CAACE,KAAK,CAACrB,GAAG,CAAC;EAC/C,MAAM2B,OAAO,GAAGD,QAAQ,CAACJ,EAAE,CAAC,CAAC,CAAC,CAAC,EAAEf,UAAU,CAAC,QAAQ,CAAC;EACrD,MAAMgB,MAAM,GAAGG,QAAQ,CAACJ,EAAE,CAAC,CAAC,CAAC,CAAC;EAE9B,IACE,CAACK,OAAO,IACR,CAACJ,MAAM,IACP,CAACtB,cAAc,CAACuB,GAAG,CAACD,MAAM,CAAC,IAC3BA,MAAM,KAAK,iBAAiB,EAC5B;IACA,OAAOV,UAAU;EACnB;EAEA,OAAOJ,QAAQ,CAACC,OAAO,EAAE,+BAA+Ba,MAAM,EAAE,EAAEX,QAAQ,CAAC;AAC7E","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
5
|
+
import { dirname, relative, resolve } from "node:path";
|
|
5
6
|
import { CommentArray, parse, stringify } from "comment-json";
|
|
6
7
|
import { bold, cyan } from "./picocolors.js";
|
|
7
8
|
export function setupTypeScript(envPath = "react-native-css-env.d.ts", name = "react-native-css") {
|
|
@@ -10,11 +11,15 @@ export function setupTypeScript(envPath = "react-native-css-env.d.ts", name = "r
|
|
|
10
11
|
if (!ts) {
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
|
-
const configFileName = ts.findConfigFile("
|
|
14
|
+
const configFileName = ts.findConfigFile(resolve("."), ts.sys.fileExists, "tsconfig.json");
|
|
15
|
+
if (!configFileName) return;
|
|
16
|
+
const configDirectory = dirname(resolve(configFileName));
|
|
17
|
+
const environmentFile = resolve(envPath);
|
|
18
|
+
const relativeEnvironmentFile = relative(configDirectory, environmentFile);
|
|
14
19
|
const userConfig = parse(readFileSync(configFileName, {
|
|
15
20
|
encoding: "utf-8"
|
|
16
21
|
}));
|
|
17
|
-
if (typeof userConfig !== "object" || !userConfig || Array.isArray(userConfig)) {
|
|
22
|
+
if (typeof userConfig !== "object" || !userConfig || Array.isArray(userConfig) || Object.prototype.toString.call(userConfig) !== "[object Object]") {
|
|
18
23
|
return;
|
|
19
24
|
}
|
|
20
25
|
const output = [];
|
|
@@ -25,17 +30,32 @@ export function setupTypeScript(envPath = "react-native-css-env.d.ts", name = "r
|
|
|
25
30
|
// NOTE: This file should not be edited and should be committed with your source code. It is generated by ${name}. If you need to move or disable this file, please see the documentation.`);
|
|
26
31
|
output.push(`Created ${cyan(envPath)}`);
|
|
27
32
|
}
|
|
28
|
-
userConfig.include
|
|
29
|
-
|
|
30
|
-
userConfig.include.push(envPath);
|
|
33
|
+
if (Array.isArray(userConfig.include) && !(Array.isArray(userConfig.files) && userConfig.files.includes(relativeEnvironmentFile)) && !userConfig.include.includes(relativeEnvironmentFile)) {
|
|
34
|
+
userConfig.include.push(relativeEnvironmentFile);
|
|
31
35
|
updatedConfig = true;
|
|
32
36
|
output.push(`Updated ${configFileName} to include the ${cyan(envPath)} file`);
|
|
33
37
|
}
|
|
38
|
+
|
|
39
|
+
// Resolve inheritance on a copy so comments and the user's own settings survive.
|
|
40
|
+
const effectiveConfig = ts.parseJsonConfigFileContent(JSON.parse(JSON.stringify(userConfig)), ts.sys, configDirectory, {}, resolve(configFileName));
|
|
41
|
+
if (!effectiveConfig.fileNames.some(file => resolve(file) === environmentFile)) {
|
|
42
|
+
// A files entry can include the declaration even when inherited include or
|
|
43
|
+
// exclude settings omit it. Preserve the original implicit include as well.
|
|
44
|
+
if (effectiveConfig.raw.include === undefined && effectiveConfig.raw.files === undefined) {
|
|
45
|
+
userConfig.include = new CommentArray("**/*");
|
|
46
|
+
}
|
|
47
|
+
userConfig.files ??= new CommentArray(...(effectiveConfig.raw.files || []));
|
|
48
|
+
if (Array.isArray(userConfig.files) && !userConfig.files.includes(relativeEnvironmentFile)) {
|
|
49
|
+
userConfig.files.push(relativeEnvironmentFile);
|
|
50
|
+
updatedConfig = true;
|
|
51
|
+
output.push(`Updated ${configFileName} to include the ${cyan(envPath)} file`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
34
54
|
if (updatedConfig) {
|
|
35
55
|
writeFileSync(configFileName, stringify(userConfig, null, 2));
|
|
36
56
|
}
|
|
37
57
|
if (output.length) {
|
|
38
|
-
console.log(`${cyan(bold("
|
|
58
|
+
console.log(`${cyan(bold("Nativewind"))} made the following changes to your project to support TypeScript:\n - ${output.join("\n - ")}`);
|
|
39
59
|
}
|
|
40
60
|
} catch {}
|
|
41
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["existsSync","readFileSync","writeFileSync","CommentArray","parse","stringify","bold","cyan","setupTypeScript","envPath","name","ts","require","configFileName","findConfigFile","sys","fileExists","userConfig","encoding","Array","isArray","output","updatedConfig","push","include","includes","length","console","log","join"],"sourceRoot":"../../../src","sources":["metro/typescript.ts"],"mappings":";;AAAA;AACA,SAASA,UAAU,EAAEC,YAAY,EAAEC,aAAa,QAAQ,IAAI;
|
|
1
|
+
{"version":3,"names":["existsSync","readFileSync","writeFileSync","dirname","relative","resolve","CommentArray","parse","stringify","bold","cyan","setupTypeScript","envPath","name","ts","require","configFileName","findConfigFile","sys","fileExists","configDirectory","environmentFile","relativeEnvironmentFile","userConfig","encoding","Array","isArray","Object","prototype","toString","call","output","updatedConfig","push","include","files","includes","effectiveConfig","parseJsonConfigFileContent","JSON","fileNames","some","file","raw","undefined","length","console","log","join"],"sourceRoot":"../../../src","sources":["metro/typescript.ts"],"mappings":";;AAAA;A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,KAAK,CAAC,IAC/B,CAACZ,UAAU,CAACY,KAAK,CAACC,QAAQ,CAACd,uBAAuB,CAAC,EACnD;QACAC,UAAU,CAACY,KAAK,CAACF,IAAI,CAACX,uBAAuB,CAAC;QAC9CU,aAAa,GAAG,IAAI;QACpBD,MAAM,CAACE,IAAI,CACT,WAAWjB,cAAc,mBAAmBN,IAAI,CAACE,OAAO,CAAC,OAC3D,CAAC;MACH;IACF;IAEA,IAAIoB,aAAa,EAAE;MACjB9B,aAAa,CAACc,cAAc,EAAER,SAAS,CAACe,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/D;IAEA,IAAIQ,MAAM,CAACc,MAAM,EAAE;MACjBC,OAAO,CAACC,GAAG,CACT,GAAGrC,IAAI,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC,2EAA2EsB,MAAM,CAACiB,IAAI,CAAC,QAAQ,CAAC,EAC7H,CAAC;IACH;EACF,CAAC,CAAC,MAAM,CAAC;AACX","ignoreList":[]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { relative } from "path";
|
|
4
|
+
|
|
5
|
+
/** "summary" prints one capped block per CSS file, "verbose" lists every entry, "none" prints nothing */
|
|
6
|
+
|
|
7
|
+
const SUMMARY_ENTRY_LIMIT = 10;
|
|
8
|
+
const SUMMARY_VALUE_LIMIT = 5;
|
|
9
|
+
const SUMMARY_VALUE_LENGTH_LIMIT = 60;
|
|
10
|
+
const PREFIX = "react-native-css";
|
|
11
|
+
|
|
12
|
+
// Metro re-transforms a CSS file on every rebuild, so a file's block prints again only when its warnings change
|
|
13
|
+
const lastReportedByFile = new Map();
|
|
14
|
+
|
|
15
|
+
// Metro forwards each transform worker's stderr to the bundler's terminal, and a warning never fails the build
|
|
16
|
+
export function reportCompilerWarnings(warnings, options) {
|
|
17
|
+
const {
|
|
18
|
+
filename,
|
|
19
|
+
projectRoot,
|
|
20
|
+
level = "summary"
|
|
21
|
+
} = options;
|
|
22
|
+
if (level === "none") {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const message = formatCompilerWarnings(warnings, {
|
|
26
|
+
displayPath: toDisplayPath(filename, projectRoot),
|
|
27
|
+
verbose: level === "verbose"
|
|
28
|
+
});
|
|
29
|
+
if (message === undefined) {
|
|
30
|
+
lastReportedByFile.delete(filename);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (lastReportedByFile.get(filename) === message) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
lastReportedByFile.set(filename, message);
|
|
37
|
+
console.warn(message);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Plain text: Metro's transform workers write to a pipe, where colour would never render
|
|
41
|
+
export function formatCompilerWarnings(warnings, options) {
|
|
42
|
+
const {
|
|
43
|
+
displayPath,
|
|
44
|
+
verbose = false
|
|
45
|
+
} = options;
|
|
46
|
+
const droppedCount = (warnings.properties?.length ?? 0) + (warnings.functions?.length ?? 0) + Object.values(warnings.values ?? {}).reduce((total, entries) => total + entries.length, 0);
|
|
47
|
+
|
|
48
|
+
// A syntax warning sends the reader to their stylesheet rather than to what React Native lacks, so it is counted apart
|
|
49
|
+
const syntaxCount = warnings.syntax?.length ?? 0;
|
|
50
|
+
if (droppedCount === 0 && syntaxCount === 0) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
const properties = limit(unique(warnings.properties), verbose);
|
|
54
|
+
const functions = limit(unique(warnings.functions), verbose);
|
|
55
|
+
const rendered = renderValues(warnings.values, verbose);
|
|
56
|
+
const values = limit(rendered.entries, verbose);
|
|
57
|
+
const syntax = limit(unique(warnings.syntax), verbose);
|
|
58
|
+
const claims = [];
|
|
59
|
+
if (droppedCount > 0) {
|
|
60
|
+
claims.push(`${droppedCount} ${pluralize(droppedCount, "declaration")} dropped, no React Native equivalent`);
|
|
61
|
+
}
|
|
62
|
+
if (syntaxCount > 0) {
|
|
63
|
+
claims.push(`${syntaxCount} syntax ${pluralize(syntaxCount, "warning")}`);
|
|
64
|
+
}
|
|
65
|
+
const lines = [`${PREFIX}: ${displayPath} - ${claims.join("; ")}`];
|
|
66
|
+
if (syntax.shown.length > 0) {
|
|
67
|
+
lines.push(` syntax: ${syntax.shown.join("; ")}${suffix(syntax.hidden)}`);
|
|
68
|
+
}
|
|
69
|
+
if (properties.shown.length > 0) {
|
|
70
|
+
lines.push(` properties: ${properties.shown.join(", ")}${suffix(properties.hidden)}`);
|
|
71
|
+
}
|
|
72
|
+
if (values.shown.length > 0) {
|
|
73
|
+
lines.push(` values: ${values.shown.join("; ")}${suffix(values.hidden)}`);
|
|
74
|
+
}
|
|
75
|
+
if (functions.shown.length > 0) {
|
|
76
|
+
lines.push(` functions: ${functions.shown.join(", ")}${suffix(functions.hidden)}`);
|
|
77
|
+
}
|
|
78
|
+
if (properties.hidden + values.hidden + functions.hidden + rendered.hidden + syntax.hidden > 0) {
|
|
79
|
+
lines.push(` Set reactNativeCSS.warnings to "verbose" for the full list, or "none" to silence this.`);
|
|
80
|
+
}
|
|
81
|
+
return lines.join("\n");
|
|
82
|
+
}
|
|
83
|
+
function toDisplayPath(filename, projectRoot) {
|
|
84
|
+
const relativePath = relative(projectRoot, filename);
|
|
85
|
+
return relativePath === "" || relativePath.startsWith("..") ? filename : relativePath;
|
|
86
|
+
}
|
|
87
|
+
function renderValues(values, verbose) {
|
|
88
|
+
let hidden = 0;
|
|
89
|
+
const entries = [];
|
|
90
|
+
const recordedByProperty = values ?? {};
|
|
91
|
+
for (const property of Object.keys(recordedByProperty).sort()) {
|
|
92
|
+
const distinct = unique(recordedByProperty[property]);
|
|
93
|
+
const shown = verbose ? distinct : distinct.slice(0, SUMMARY_VALUE_LIMIT);
|
|
94
|
+
hidden += distinct.length - shown.length;
|
|
95
|
+
const rendered = shown.map(value => truncate(value, verbose));
|
|
96
|
+
entries.push(`${property}: ${rendered.join(", ")}${suffix(distinct.length - shown.length)}`);
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
entries,
|
|
100
|
+
hidden
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function limit(entries, verbose) {
|
|
104
|
+
if (verbose || entries.length <= SUMMARY_ENTRY_LIMIT) {
|
|
105
|
+
return {
|
|
106
|
+
shown: entries,
|
|
107
|
+
hidden: 0
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
shown: entries.slice(0, SUMMARY_ENTRY_LIMIT),
|
|
112
|
+
hidden: entries.length - SUMMARY_ENTRY_LIMIT
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function suffix(hidden) {
|
|
116
|
+
return hidden > 0 ? ` (+${hidden} more)` : "";
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Code-unit order rather than localeCompare, whose collation varies with the ICU build
|
|
120
|
+
function unique(entries) {
|
|
121
|
+
return entries ? [...new Set(entries)].sort() : [];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// An unresolved calc() is recorded as its whole lightningcss node, hundreds of characters long
|
|
125
|
+
function truncate(value, verbose) {
|
|
126
|
+
return verbose || value.length <= SUMMARY_VALUE_LENGTH_LIMIT ? value : `${value.slice(0, SUMMARY_VALUE_LENGTH_LIMIT)}...`;
|
|
127
|
+
}
|
|
128
|
+
function pluralize(count, noun) {
|
|
129
|
+
return count === 1 ? noun : `${noun}s`;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=warnings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["relative","SUMMARY_ENTRY_LIMIT","SUMMARY_VALUE_LIMIT","SUMMARY_VALUE_LENGTH_LIMIT","PREFIX","lastReportedByFile","Map","reportCompilerWarnings","warnings","options","filename","projectRoot","level","message","formatCompilerWarnings","displayPath","toDisplayPath","verbose","undefined","delete","get","set","console","warn","droppedCount","properties","length","functions","Object","values","reduce","total","entries","syntaxCount","syntax","limit","unique","rendered","renderValues","claims","push","pluralize","lines","join","shown","suffix","hidden","relativePath","startsWith","recordedByProperty","property","keys","sort","distinct","slice","map","value","truncate","Set","count","noun"],"sourceRoot":"../../../src","sources":["metro/warnings.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,MAAM;;AAI/B;;AAGA,MAAMC,mBAAmB,GAAG,EAAE;AAC9B,MAAMC,mBAAmB,GAAG,CAAC;AAC7B,MAAMC,0BAA0B,GAAG,EAAE;AAErC,MAAMC,MAAM,GAAG,kBAAkB;;AAEjC;AACA,MAAMC,kBAAkB,GAAG,IAAIC,GAAG,CAAiB,CAAC;;AAEpD;AACA,OAAO,SAASC,sBAAsBA,CACpCC,QAA0B,EAC1BC,OAIC,EACK;EACN,MAAM;IAAEC,QAAQ;IAAEC,WAAW;IAAEC,KAAK,GAAG;EAAU,CAAC,GAAGH,OAAO;EAE5D,IAAIG,KAAK,KAAK,MAAM,EAAE;IACpB;EACF;EAEA,MAAMC,OAAO,GAAGC,sBAAsB,CAACN,QAAQ,EAAE;IAC/CO,WAAW,EAAEC,aAAa,CAACN,QAAQ,EAAEC,WAAW,CAAC;IACjDM,OAAO,EAAEL,KAAK,KAAK;EACrB,CAAC,CAAC;EAEF,IAAIC,OAAO,KAAKK,SAAS,EAAE;IACzBb,kBAAkB,CAACc,MAAM,CAACT,QAAQ,CAAC;IACnC;EACF;EAEA,IAAIL,kBAAkB,CAACe,GAAG,CAACV,QAAQ,CAAC,KAAKG,OAAO,EAAE;IAChD;EACF;EAEAR,kBAAkB,CAACgB,GAAG,CAACX,QAAQ,EAAEG,OAAO,CAAC;EAEzCS,OAAO,CAACC,IAAI,CAACV,OAAO,CAAC;AACvB;;AAEA;AACA,OAAO,SAASC,sBAAsBA,CACpCN,QAA0B,EAC1BC,OAA+D,EAC3C;EACpB,MAAM;IAAEM,WAAW;IAAEE,OAAO,GAAG;EAAM,CAAC,GAAGR,OAAO;EAEhD,MAAMe,YAAY,GAChB,CAAChB,QAAQ,CAACiB,UAAU,EAAEC,MAAM,IAAI,C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