react-native-css 0.0.0-nightly.da5ce0f → 0.0.0-nightly.df32ce3
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 +24 -0
- 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 +35 -0
- 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 +103 -62
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/lightningcss-loader.js +11 -8
- 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 +16 -3
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/compiler/supports.js +1 -3
- package/dist/commonjs/compiler/supports.js.map +1 -1
- package/dist/commonjs/components/FlatList.js +1 -0
- package/dist/commonjs/components/FlatList.js.map +1 -1
- package/dist/commonjs/components/ImageBackground.js +2 -6
- package/dist/commonjs/components/ImageBackground.js.map +1 -1
- package/dist/commonjs/components/KeyboardAvoidingView.js +2 -3
- package/dist/commonjs/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/commonjs/components/index.cjs +46 -1
- package/dist/commonjs/components/index.cjs.map +1 -1
- package/dist/commonjs/jest/index.js +1 -1
- 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 +2 -0
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +16 -3
- package/dist/commonjs/metro/metro-transformer.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 +13 -9
- 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/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 +60 -11
- 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/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/functions/color-mix.js +43 -29
- package/dist/commonjs/native/styles/functions/color-mix.js.map +1 -1
- 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/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 +140 -14
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/native/styles/resolve.js +10 -6
- 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 +6 -3
- 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 +1 -1
- 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 +33 -0
- 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 +103 -62
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/lightningcss-loader.js +10 -8
- 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 +16 -3
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/compiler/supports.js +1 -3
- package/dist/module/compiler/supports.js.map +1 -1
- package/dist/module/components/FlatList.js +1 -0
- package/dist/module/components/FlatList.js.map +1 -1
- package/dist/module/components/ImageBackground.js +2 -6
- package/dist/module/components/ImageBackground.js.map +1 -1
- package/dist/module/components/KeyboardAvoidingView.js +2 -3
- package/dist/module/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/module/components/index.cjs +46 -1
- package/dist/module/components/index.cjs.map +1 -1
- package/dist/module/jest/index.js +1 -1
- 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 +2 -0
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +16 -3
- package/dist/module/metro/metro-transformer.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 +15 -11
- 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/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 +63 -14
- 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/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/functions/color-mix.js +43 -29
- package/dist/module/native/styles/functions/color-mix.js.map +1 -1
- 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/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 +140 -14
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/native/styles/resolve.js +10 -6
- 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 +6 -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 +1 -1
- 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 -2
- package/dist/typescript/commonjs/src/compiler/declarations.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/FlatList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.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/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 +4 -8
- 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/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.map +1 -1
- package/dist/typescript/commonjs/src/native/react/usePassthrough.d.ts.map +1 -1
- 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.map +1 -1
- 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/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.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 +2 -1
- 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 -4
- 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 +2 -2
- 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/FlatList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- 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/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 +5 -9
- 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 +4 -4
- 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/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 +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts.map +1 -1
- 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 -8
- 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 +2 -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 +2 -1
- 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 +65 -29
- 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 +44 -0
- 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 +190 -101
- package/src/compiler/lightningcss-loader.ts +16 -15
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +31 -4
- package/src/compiler/stylesheet.ts +23 -10
- package/src/compiler/supports.ts +1 -3
- package/src/components/FlatList.tsx +1 -0
- package/src/components/ImageBackground.tsx +2 -6
- package/src/components/KeyboardAvoidingView.tsx +2 -3
- package/src/components/index.cts +46 -1
- package/src/jest/index.ts +1 -1
- package/src/metro/cache-version.ts +48 -0
- package/src/metro/index.ts +7 -0
- package/src/metro/metro-transformer.ts +26 -8
- package/src/metro/typescript.ts +53 -6
- package/src/metro/warnings.ts +187 -0
- package/src/native/api.tsx +22 -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/react/interaction.ts +11 -6
- package/src/native/react/rules.ts +13 -5
- package/src/native/react/useNativeCss.ts +69 -14
- 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/functions/color-mix.ts +45 -39
- package/src/native/styles/functions/filters.ts +20 -6
- 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 +146 -15
- package/src/native/styles/resolve.ts +15 -11
- 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 +8 -2
- 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 +4 -3
- package/src/utilities/style-descriptor.ts +11 -16
- package/src/web/api.tsx +6 -11
- package/src/web/assign-style.ts +2 -1
- package/types.d.ts +0 -20
- package/dist/commonjs/compiler/inheritance.test.js +0 -78
- package/dist/commonjs/compiler/inheritance.test.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/typescript/commonjs/.config/eslint.config.d.mts +0 -3
- package/dist/typescript/commonjs/.config/eslint.config.d.mts.map +0 -1
- package/dist/typescript/commonjs/eslint.config.d.mts +0 -2
- package/dist/typescript/commonjs/eslint.config.d.mts.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/index.d.ts +0 -2
- package/dist/typescript/commonjs/example/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/metro.config.d.ts +0 -3
- package/dist/typescript/commonjs/example/metro.config.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/postcss.config.d.mts +0 -7
- package/dist/typescript/commonjs/example/postcss.config.d.mts.map +0 -1
- package/dist/typescript/commonjs/example/src/App.d.ts +0 -3
- 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/module/.config/eslint.config.d.mts +0 -3
- package/dist/typescript/module/.config/eslint.config.d.mts.map +0 -1
- package/dist/typescript/module/eslint.config.d.mts +0 -2
- package/dist/typescript/module/eslint.config.d.mts.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/index.d.ts +0 -2
- package/dist/typescript/module/example/index.d.ts.map +0 -1
- package/dist/typescript/module/example/metro.config.d.ts +0 -3
- package/dist/typescript/module/example/metro.config.d.ts.map +0 -1
- package/dist/typescript/module/example/postcss.config.d.mts +0 -7
- package/dist/typescript/module/example/postcss.config.d.mts.map +0 -1
- package/dist/typescript/module/example/src/App.d.ts +0 -3
- 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/src/compiler/inheritance.test.ts +0 -121
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAe,CAAC;AAC9B,cAAc,uBAAoB,CAAC;AACnC,cAAc,yBAAsB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SpecificityArray, StyleRule } from "../compiler";
|
|
2
|
-
import type { InlineStyleRecord } from "../runtime.types";
|
|
1
|
+
import type { SpecificityArray, StyleRule } from "../compiler/index.js";
|
|
2
|
+
import type { InlineStyleRecord } from "../runtime.types.js";
|
|
3
3
|
export declare const Specificity: {
|
|
4
4
|
Order: number;
|
|
5
5
|
ClassName: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specificity.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/specificity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"specificity.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/specificity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,sBAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAkB,CAAC;AAE1D,eAAO,MAAM,WAAW;;;;;;;CASvB,CAAC;AAQF,eAAO,MAAM,iBAAiB,EAAE,gBAAqB,CAAC;AAGtD,eAAO,MAAM,oBAAoB,GAC/B,GAAG,SAAS,GAAG,iBAAiB,EAChC,GAAG,SAAS,GAAG,iBAAiB,WAkBjC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { StyleDescriptor, StyleFunction } from "react-native-css/compiler";
|
|
2
2
|
export declare function isStyleDescriptorArray(value: unknown): value is StyleDescriptor[];
|
|
3
|
-
export declare function isStyleFunction(value:
|
|
3
|
+
export declare function isStyleFunction(value: unknown): value is StyleFunction;
|
|
4
4
|
//# sourceMappingURL=style-descriptor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-descriptor.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/style-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEhF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"style-descriptor.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/style-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEhF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,eAAe,EAAE,CAE5B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAUtE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { ColorScheme, Props, StyledConfiguration
|
|
3
|
-
import type { ReactComponent } from "../runtime.types";
|
|
4
|
-
export declare const styled:
|
|
1
|
+
import { type PropsWithChildren } from "react";
|
|
2
|
+
import type { ColorScheme, Props, StyledConfiguration } from "react-native-css";
|
|
3
|
+
import type { ReactComponent, Styled } from "../runtime.types.js";
|
|
4
|
+
export declare const styled: Styled;
|
|
5
5
|
export declare const useCssElement: <C extends ReactComponent>(component: C, incomingProps: Props, mapping: StyledConfiguration<C>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
6
6
|
export declare const colorScheme: ColorScheme;
|
|
7
7
|
/**
|
|
@@ -10,7 +10,7 @@ export declare const colorScheme: ColorScheme;
|
|
|
10
10
|
export declare function vars(variables: Record<string, string | number>): Record<string, string>;
|
|
11
11
|
export declare function VariableContextProvider(props: PropsWithChildren<{
|
|
12
12
|
value: Record<`--${string}`, string | number>;
|
|
13
|
-
}>): import("react
|
|
13
|
+
}>): import("react").JSX.Element;
|
|
14
14
|
export declare const useNativeVariable: () => never;
|
|
15
15
|
export declare const useUnstableNativeVariable: () => never;
|
|
16
16
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/web/api.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/web/api.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACV,WAAW,EACX,KAAK,EACL,mBAAmB,EAEpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,qBAAkB,CAAC;AAO/D,eAAO,MAAM,MAAM,EAAE,MAQpB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,cAAc,EACpD,WAAW,CAAC,EACZ,eAAe,KAAK,EACpB,SAAS,mBAAmB,CAAC,CAAC,CAAC,2FA4BhC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAOzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,0BAW9D;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,iBAAiB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;CAAE,CAAC,+BAe5E;AAED,eAAO,MAAM,iBAAiB,aAE7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,aAErC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assign-style.d.ts","sourceRoot":"","sources":["../../../../../src/web/assign-style.ts"],"names":[],"mappings":"AACA,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"assign-style.d.ts","sourceRoot":"","sources":["../../../../../src/web/assign-style.ts"],"names":[],"mappings":"AACA,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,uBAsB3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./metro";
|
|
2
|
-
export type * from "../runtime.types";
|
|
3
|
-
export * from "./api";
|
|
1
|
+
import "./metro.js";
|
|
2
|
+
export type * from "../runtime.types.js";
|
|
3
|
+
export * from "./api.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/web/index.ts"],"names":[],"mappings":"AACA,OAAO,YAAS,CAAC;AAEjB,mBAAmB,qBAAkB,CAAC;AACtC,cAAc,UAAO,CAAC"}
|
package/node/babel.mjs
ADDED
package/node/metro.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-css",
|
|
3
|
-
"version": "0.0.0-nightly.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.0-nightly.df32ce3",
|
|
4
|
+
"description": "Use CSS stylesheets in React Native",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"source": "./src/index.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"source": "./src/compiler/index.ts",
|
|
19
19
|
"import": {
|
|
20
20
|
"types": "./dist/typescript/module/src/compiler/index.d.ts",
|
|
21
|
-
"default": "./
|
|
21
|
+
"default": "./node/compiler.mjs"
|
|
22
22
|
},
|
|
23
23
|
"require": {
|
|
24
24
|
"types": "./dist/typescript/commonjs/src/compiler/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"source": "./src/babel/index.ts",
|
|
30
30
|
"import": {
|
|
31
31
|
"types": "./dist/typescript/module/src/babel/index.d.ts",
|
|
32
|
-
"default": "./
|
|
32
|
+
"default": "./node/babel.mjs"
|
|
33
33
|
},
|
|
34
34
|
"require": {
|
|
35
35
|
"types": "./dist/typescript/commonjs/src/babel/index.d.ts",
|
|
@@ -59,6 +59,30 @@
|
|
|
59
59
|
"default": "./dist/commonjs/components/react-native-safe-area-context.js"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
+
"./components/copyComponentProperties": {
|
|
63
|
+
"source": "./src/components/copyComponentProperties.ts",
|
|
64
|
+
"react-native": "./src/components/copyComponentProperties.ts",
|
|
65
|
+
"import": {
|
|
66
|
+
"types": "./dist/typescript/module/src/components/copyComponentProperties.d.ts",
|
|
67
|
+
"default": "./dist/module/components/copyComponentProperties.js"
|
|
68
|
+
},
|
|
69
|
+
"require": {
|
|
70
|
+
"types": "./dist/typescript/commonjs/src/components/copyComponentProperties.d.ts",
|
|
71
|
+
"default": "./dist/commonjs/components/copyComponentProperties.js"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"./components/index": {
|
|
75
|
+
"source": "./src/components/index.cts",
|
|
76
|
+
"import": {
|
|
77
|
+
"default": "./dist/module/components/index.cjs",
|
|
78
|
+
"types": "./dist/typescript/module/src/components/index.d.ts"
|
|
79
|
+
},
|
|
80
|
+
"require": {
|
|
81
|
+
"default": "./dist/commonjs/components/index.cjs",
|
|
82
|
+
"types": "./dist/typescript/commonjs/src/components/index.d.ts"
|
|
83
|
+
},
|
|
84
|
+
"react-native": "./src/components/index.cts"
|
|
85
|
+
},
|
|
62
86
|
"./components/*": {
|
|
63
87
|
"source": "./src/components/*.tsx",
|
|
64
88
|
"react-native": "./src/components/*.tsx",
|
|
@@ -87,7 +111,7 @@
|
|
|
87
111
|
"source": "./src/metro/index.ts",
|
|
88
112
|
"import": {
|
|
89
113
|
"types": "./dist/typescript/module/src/metro/index.d.ts",
|
|
90
|
-
"default": "./
|
|
114
|
+
"default": "./node/metro.mjs"
|
|
91
115
|
},
|
|
92
116
|
"require": {
|
|
93
117
|
"types": "./dist/typescript/commonjs/src/metro/index.d.ts",
|
|
@@ -159,12 +183,13 @@
|
|
|
159
183
|
"example": "yarn workspace react-native-css-example",
|
|
160
184
|
"lint": "eslint",
|
|
161
185
|
"prepare": "bob build",
|
|
186
|
+
"prepack": "bob build",
|
|
162
187
|
"prepublishOnly": "bob build",
|
|
163
188
|
"release": "release-it --config ./.config/release-it.config.ts",
|
|
164
189
|
"start": "yarn example start",
|
|
165
190
|
"start:build": "yarn build && yarn example build",
|
|
166
191
|
"start:debug": "yarn build && yarn example debug",
|
|
167
|
-
"test": "
|
|
192
|
+
"test": "jest",
|
|
168
193
|
"typecheck": "tsc --noEmit"
|
|
169
194
|
},
|
|
170
195
|
"keywords": [
|
|
@@ -191,14 +216,18 @@
|
|
|
191
216
|
"files": [
|
|
192
217
|
"src",
|
|
193
218
|
"dist",
|
|
219
|
+
"node",
|
|
194
220
|
"types.d.ts",
|
|
195
221
|
"!**/__tests__",
|
|
196
222
|
"!**/__fixtures__",
|
|
197
|
-
"!**/__mocks__"
|
|
223
|
+
"!**/__mocks__",
|
|
224
|
+
"!**/*.test.*",
|
|
225
|
+
"!**/*.spec.*"
|
|
198
226
|
],
|
|
199
227
|
"dependencies": {
|
|
228
|
+
"@types/debug": "^4.1.12",
|
|
200
229
|
"babel-plugin-react-compiler": "^19.1.0-rc.2",
|
|
201
|
-
"colorjs.io": "0.
|
|
230
|
+
"colorjs.io": "0.7.0",
|
|
202
231
|
"comment-json": "^4.2.5",
|
|
203
232
|
"debug": "^4.4.1"
|
|
204
233
|
},
|
|
@@ -209,46 +238,48 @@
|
|
|
209
238
|
"react-native": ">=0.81"
|
|
210
239
|
},
|
|
211
240
|
"devDependencies": {
|
|
212
|
-
"@babel/core": "^7.
|
|
213
|
-
"@commitlint/config-conventional": "^
|
|
214
|
-
"@eslint/js": "^
|
|
215
|
-
"@expo/metro-config": "
|
|
241
|
+
"@babel/core": "^7.29.0",
|
|
242
|
+
"@commitlint/config-conventional": "^20.5.0",
|
|
243
|
+
"@eslint/js": "^10.0.1",
|
|
244
|
+
"@expo/metro-config": "57.0.12",
|
|
216
245
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.2",
|
|
246
|
+
"@react-native/jest-preset": "0.86.3",
|
|
247
|
+
"@react-native/metro-config": "0.86.3",
|
|
248
|
+
"@release-it/conventional-changelog": "10.0.1",
|
|
217
249
|
"@tailwindcss/postcss": "^4.1.12",
|
|
218
250
|
"@testing-library/react-native": "^13.3.3",
|
|
219
251
|
"@tsconfig/react-native": "^3.0.6",
|
|
220
252
|
"@types/babel__core": "^7",
|
|
221
|
-
"@types/debug": "^4.1.12",
|
|
222
253
|
"@types/jest": "^30.0.0",
|
|
223
|
-
"@types/react": "
|
|
254
|
+
"@types/react": "~19.2.0",
|
|
224
255
|
"@types/react-test-renderer": "^19",
|
|
225
256
|
"babel-plugin-tester": "^12.0.0",
|
|
226
|
-
"babel-preset-expo": "
|
|
257
|
+
"babel-preset-expo": "57.0.11",
|
|
227
258
|
"commitlint": "^20.0.0",
|
|
228
259
|
"eas-build-cache-provider": "^16.4.2",
|
|
229
260
|
"eslint": "^9.30.1",
|
|
230
261
|
"eslint-config-prettier": "^10.1.5",
|
|
231
262
|
"eslint-plugin-prettier": "^5.5.1",
|
|
232
|
-
"expo": "
|
|
263
|
+
"expo": "57.0.22",
|
|
233
264
|
"jest": "^29.7.0",
|
|
234
|
-
"jest-expo": "
|
|
235
|
-
"lefthook": "^1.
|
|
265
|
+
"jest-expo": "57.0.5",
|
|
266
|
+
"lefthook": "^2.1.5",
|
|
236
267
|
"lightningcss": "^1.30.1",
|
|
237
|
-
"metro-runtime": "^0.
|
|
268
|
+
"metro-runtime": "^0.84.2",
|
|
238
269
|
"postcss": "^8.5.6",
|
|
239
270
|
"prettier": "^3.6.2",
|
|
240
|
-
"react": "19.
|
|
241
|
-
"react-native": "0.
|
|
242
|
-
"react-native-builder-bob": "^0.
|
|
243
|
-
"react-native-reanimated": "
|
|
244
|
-
"react-native-safe-area-context": "5.
|
|
245
|
-
"react-native-worklets": "
|
|
271
|
+
"react": "19.2.3",
|
|
272
|
+
"react-native": "0.86.3",
|
|
273
|
+
"react-native-builder-bob": "^0.43.0",
|
|
274
|
+
"react-native-reanimated": "4.5.1",
|
|
275
|
+
"react-native-safe-area-context": "~5.7.0",
|
|
276
|
+
"react-native-worklets": "0.10.1",
|
|
246
277
|
"react-refresh": "^0.17.0",
|
|
247
|
-
"react-test-renderer": "19.
|
|
248
|
-
"release-it": "^
|
|
278
|
+
"react-test-renderer": "19.2.3",
|
|
279
|
+
"release-it": "^20.2.1",
|
|
249
280
|
"tailwindcss": "^4.1.12",
|
|
250
281
|
"tailwindcss-safe-area": "^1.1.0",
|
|
251
|
-
"typescript": "
|
|
282
|
+
"typescript": "~6.0.3",
|
|
252
283
|
"typescript-eslint": "^8.40.0"
|
|
253
284
|
},
|
|
254
285
|
"react-native-builder-bob": {
|
|
@@ -267,7 +298,12 @@
|
|
|
267
298
|
"esm": true
|
|
268
299
|
}
|
|
269
300
|
],
|
|
270
|
-
|
|
301
|
+
[
|
|
302
|
+
"typescript",
|
|
303
|
+
{
|
|
304
|
+
"project": "tsconfig.build.json"
|
|
305
|
+
}
|
|
306
|
+
]
|
|
271
307
|
]
|
|
272
308
|
},
|
|
273
309
|
"packageManager": "yarn@4.9.2",
|
package/src/babel/helpers.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { dirname, resolve, sep } from "path";
|
|
2
|
+
|
|
1
3
|
import tBabelTypes, { type CallExpression } from "@babel/types";
|
|
2
4
|
|
|
3
5
|
export type BabelTypes = typeof tBabelTypes;
|
|
@@ -10,7 +12,7 @@ export interface PluginOpts {
|
|
|
10
12
|
|
|
11
13
|
export interface PluginState {
|
|
12
14
|
opts?: PluginOpts;
|
|
13
|
-
filename: string;
|
|
15
|
+
filename: string | undefined;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export function getInteropRequireDefaultSource(
|
|
@@ -38,3 +40,8 @@ export function getInteropRequireDefaultSource(
|
|
|
38
40
|
|
|
39
41
|
return requireArg.value;
|
|
40
42
|
}
|
|
43
|
+
|
|
44
|
+
// The handlers match "/"-separated package paths, and path.resolve separates with "\" on Windows
|
|
45
|
+
export function resolveImportSource(filename: string, source: string): string {
|
|
46
|
+
return resolve(dirname(filename), source).split(sep).join("/");
|
|
47
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
1
|
+
import { basename, dirname, resolve, sep } from "path";
|
|
2
2
|
|
|
3
3
|
import { type PluginObj } from "@babel/core";
|
|
4
4
|
import type { Statement } from "@babel/types";
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
handleReactNativeWebIdentifierRequire,
|
|
18
18
|
handleReactNativeWebImport,
|
|
19
|
+
handleReactNativeWebInteropRequireDefault,
|
|
19
20
|
handleReactNativeWebObjectPatternRequire,
|
|
20
21
|
} from "./react-native-web";
|
|
21
22
|
|
|
@@ -24,10 +25,14 @@ export default function ({
|
|
|
24
25
|
}: {
|
|
25
26
|
types: BabelTypes;
|
|
26
27
|
}): PluginObj<PluginState> {
|
|
27
|
-
const processed = new WeakSet();
|
|
28
|
+
const processed = new WeakSet<Statement>();
|
|
28
29
|
|
|
29
|
-
const
|
|
30
|
-
|
|
30
|
+
const packageRoot = resolve(
|
|
31
|
+
__dirname,
|
|
32
|
+
basename(dirname(__dirname)) === "src" ? "../.." : "../../..",
|
|
33
|
+
);
|
|
34
|
+
const thisModuleDist = resolve(packageRoot, "dist") + sep;
|
|
35
|
+
const thisModuleSrc = resolve(packageRoot, "src") + sep;
|
|
31
36
|
|
|
32
37
|
function isFromThisModule(filename: string): boolean {
|
|
33
38
|
return (
|
|
@@ -39,17 +44,19 @@ export default function ({
|
|
|
39
44
|
name: "Rewrite react-native to react-native-css",
|
|
40
45
|
visitor: {
|
|
41
46
|
ImportDeclaration(path, state): void {
|
|
47
|
+
const { filename } = state;
|
|
48
|
+
|
|
42
49
|
if (
|
|
43
|
-
|
|
50
|
+
filename === undefined ||
|
|
44
51
|
processed.has(path.node) ||
|
|
45
|
-
isFromThisModule(
|
|
52
|
+
isFromThisModule(filename)
|
|
46
53
|
) {
|
|
47
54
|
return;
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
const statements =
|
|
51
|
-
handleReactNativeImport(path.node, t,
|
|
52
|
-
handleReactNativeWebImport(path.node, t,
|
|
58
|
+
handleReactNativeImport(path.node, t, filename) ??
|
|
59
|
+
handleReactNativeWebImport(path.node, t, filename);
|
|
53
60
|
|
|
54
61
|
if (!statements) {
|
|
55
62
|
return;
|
|
@@ -62,10 +69,12 @@ export default function ({
|
|
|
62
69
|
path.replaceWithMultiple(statements);
|
|
63
70
|
},
|
|
64
71
|
VariableDeclaration(path, state): void {
|
|
72
|
+
const { filename } = state;
|
|
73
|
+
|
|
65
74
|
if (
|
|
66
|
-
|
|
75
|
+
filename === undefined ||
|
|
67
76
|
processed.has(path.node) ||
|
|
68
|
-
isFromThisModule(
|
|
77
|
+
isFromThisModule(filename)
|
|
69
78
|
) {
|
|
70
79
|
return;
|
|
71
80
|
}
|
|
@@ -94,6 +103,11 @@ export default function ({
|
|
|
94
103
|
return;
|
|
95
104
|
}
|
|
96
105
|
|
|
106
|
+
// A local function called require is not the module loader.
|
|
107
|
+
if (path.scope.getBinding("require")) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
97
111
|
const initArg = init.arguments.at(0);
|
|
98
112
|
|
|
99
113
|
if (!initArg) {
|
|
@@ -114,14 +128,14 @@ export default function ({
|
|
|
114
128
|
t,
|
|
115
129
|
id.name,
|
|
116
130
|
initArg.value,
|
|
117
|
-
|
|
131
|
+
filename,
|
|
118
132
|
) ??
|
|
119
133
|
handleReactNativeWebIdentifierRequire(
|
|
120
134
|
path,
|
|
121
135
|
t,
|
|
122
136
|
id.name,
|
|
123
137
|
initArg.value,
|
|
124
|
-
|
|
138
|
+
filename,
|
|
125
139
|
);
|
|
126
140
|
} else if (
|
|
127
141
|
t.isObjectPattern(id) &&
|
|
@@ -134,14 +148,14 @@ export default function ({
|
|
|
134
148
|
t,
|
|
135
149
|
id,
|
|
136
150
|
initArg.value,
|
|
137
|
-
|
|
151
|
+
filename,
|
|
138
152
|
) ??
|
|
139
153
|
handleReactNativeWebObjectPatternRequire(
|
|
140
154
|
path,
|
|
141
155
|
t,
|
|
142
156
|
id,
|
|
143
157
|
initArg.value,
|
|
144
|
-
|
|
158
|
+
filename,
|
|
145
159
|
);
|
|
146
160
|
} else if (
|
|
147
161
|
t.isIdentifier(id) &&
|
|
@@ -152,12 +166,13 @@ export default function ({
|
|
|
152
166
|
if (!source) {
|
|
153
167
|
return;
|
|
154
168
|
}
|
|
155
|
-
statements =
|
|
169
|
+
statements = handleReactNativeWebInteropRequireDefault(
|
|
156
170
|
path,
|
|
157
171
|
t,
|
|
158
172
|
id.name,
|
|
173
|
+
init,
|
|
159
174
|
source,
|
|
160
|
-
|
|
175
|
+
filename,
|
|
161
176
|
);
|
|
162
177
|
}
|
|
163
178
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
2
|
-
|
|
3
1
|
import { type NodePath } from "@babel/traverse";
|
|
4
2
|
import tBabelTypes, {
|
|
3
|
+
type CallExpression,
|
|
5
4
|
type ImportDeclaration,
|
|
6
5
|
type ObjectPattern,
|
|
7
6
|
type Statement,
|
|
@@ -9,12 +8,13 @@ import tBabelTypes, {
|
|
|
9
8
|
} from "@babel/types";
|
|
10
9
|
|
|
11
10
|
import { allowedModules } from "./allowedModules";
|
|
11
|
+
import { resolveImportSource } from "./helpers";
|
|
12
12
|
|
|
13
13
|
type BabelTypes = typeof tBabelTypes;
|
|
14
14
|
|
|
15
15
|
function parseReactNativeWebSource(source: string, filename: string) {
|
|
16
16
|
if (source.startsWith(".")) {
|
|
17
|
-
source =
|
|
17
|
+
source = resolveImportSource(filename, source);
|
|
18
18
|
|
|
19
19
|
const internalPath = source.split("react-native-web/dist")[1];
|
|
20
20
|
if (!internalPath) {
|
|
@@ -48,6 +48,7 @@ export function handleReactNativeWebImport(
|
|
|
48
48
|
filename: string,
|
|
49
49
|
): Statement[] | undefined {
|
|
50
50
|
const { specifiers, source } = declaration;
|
|
51
|
+
if (declaration.importKind && declaration.importKind !== "value") return;
|
|
51
52
|
|
|
52
53
|
const rnwSource = parseReactNativeWebSource(source.value, filename);
|
|
53
54
|
if (!rnwSource) {
|
|
@@ -76,7 +77,7 @@ export function handleReactNativeWebImport(
|
|
|
76
77
|
} else {
|
|
77
78
|
statements.push(
|
|
78
79
|
t.importDeclaration(
|
|
79
|
-
[t.importSpecifier(specifier.local,
|
|
80
|
+
[t.importSpecifier(specifier.local, t.identifier(name))],
|
|
80
81
|
t.stringLiteral(`react-native-css/components/${name}`),
|
|
81
82
|
),
|
|
82
83
|
);
|
|
@@ -89,6 +90,10 @@ export function handleReactNativeWebImport(
|
|
|
89
90
|
),
|
|
90
91
|
);
|
|
91
92
|
} else {
|
|
93
|
+
if (specifier.importKind && specifier.importKind !== "value") {
|
|
94
|
+
statements.push(t.importDeclaration([specifier], source));
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
92
97
|
const localName = t.isStringLiteral(specifier.imported)
|
|
93
98
|
? specifier.imported.value
|
|
94
99
|
: specifier.imported.name;
|
|
@@ -158,6 +163,28 @@ export function handleReactNativeWebIdentifierRequire(
|
|
|
158
163
|
}
|
|
159
164
|
}
|
|
160
165
|
|
|
166
|
+
export function handleReactNativeWebInteropRequireDefault(
|
|
167
|
+
path: NodePath<VariableDeclaration>,
|
|
168
|
+
t: BabelTypes,
|
|
169
|
+
id: string,
|
|
170
|
+
init: CallExpression,
|
|
171
|
+
source: string,
|
|
172
|
+
filename: string,
|
|
173
|
+
) {
|
|
174
|
+
const parsed = parseReactNativeWebSource(source, filename);
|
|
175
|
+
if (!parsed) return;
|
|
176
|
+
|
|
177
|
+
const wrapped = t.cloneNode(init);
|
|
178
|
+
wrapped.arguments = [
|
|
179
|
+
t.callExpression(t.identifier("require"), [t.stringLiteral(parsed.source)]),
|
|
180
|
+
];
|
|
181
|
+
return [
|
|
182
|
+
t.variableDeclaration(path.node.kind, [
|
|
183
|
+
t.variableDeclarator(t.identifier(id), wrapped),
|
|
184
|
+
]),
|
|
185
|
+
];
|
|
186
|
+
}
|
|
187
|
+
|
|
161
188
|
export function handleReactNativeWebObjectPatternRequire(
|
|
162
189
|
path: NodePath<VariableDeclaration>,
|
|
163
190
|
t: BabelTypes,
|
|
@@ -180,6 +207,7 @@ export function handleReactNativeWebObjectPatternRequire(
|
|
|
180
207
|
// We need to exit as we do not handle `const { Text, ...rest } = require('react-native-web');`
|
|
181
208
|
return;
|
|
182
209
|
} else if (
|
|
210
|
+
identifier.computed ||
|
|
183
211
|
!(t.isIdentifier(identifier.value) && t.isIdentifier(identifier.key))
|
|
184
212
|
) {
|
|
185
213
|
// Bail out on anything that isn't `const { <key>: <identifier> } = require('react-native-web');`
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { dirname, resolve } from "path";
|
|
2
|
-
|
|
3
1
|
import { type NodePath } from "@babel/traverse";
|
|
4
2
|
import tBabelTypes, {
|
|
5
3
|
type ImportDeclaration,
|
|
@@ -9,12 +7,13 @@ import tBabelTypes, {
|
|
|
9
7
|
} from "@babel/types";
|
|
10
8
|
|
|
11
9
|
import { allowedModules } from "./allowedModules";
|
|
10
|
+
import { resolveImportSource } from "./helpers";
|
|
12
11
|
|
|
13
12
|
type BabelTypes = typeof tBabelTypes;
|
|
14
13
|
|
|
15
14
|
function parseReactNativeSource(source: string, filename: string) {
|
|
16
15
|
if (source.startsWith(".")) {
|
|
17
|
-
source =
|
|
16
|
+
source = resolveImportSource(filename, source);
|
|
18
17
|
|
|
19
18
|
const internalPath = source.split("react-native/Libraries/Components/")[1];
|
|
20
19
|
if (!internalPath) {
|
|
@@ -48,6 +47,7 @@ export function handleReactNativeImport(
|
|
|
48
47
|
filename: string,
|
|
49
48
|
): Statement[] | undefined {
|
|
50
49
|
const { specifiers, source } = declaration;
|
|
50
|
+
if (declaration.importKind && declaration.importKind !== "value") return;
|
|
51
51
|
|
|
52
52
|
const rnwSource = parseReactNativeSource(source.value, filename);
|
|
53
53
|
if (!rnwSource) {
|
|
@@ -76,7 +76,7 @@ export function handleReactNativeImport(
|
|
|
76
76
|
} else {
|
|
77
77
|
statements.push(
|
|
78
78
|
t.importDeclaration(
|
|
79
|
-
[t.importSpecifier(specifier.local,
|
|
79
|
+
[t.importSpecifier(specifier.local, t.identifier(name))],
|
|
80
80
|
t.stringLiteral(`react-native-css/components/${name}`),
|
|
81
81
|
),
|
|
82
82
|
);
|
|
@@ -89,6 +89,10 @@ export function handleReactNativeImport(
|
|
|
89
89
|
),
|
|
90
90
|
);
|
|
91
91
|
} else {
|
|
92
|
+
if (specifier.importKind && specifier.importKind !== "value") {
|
|
93
|
+
statements.push(t.importDeclaration([specifier], source));
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
92
96
|
const localName = t.isStringLiteral(specifier.imported)
|
|
93
97
|
? specifier.imported.value
|
|
94
98
|
: specifier.imported.name;
|
|
@@ -180,6 +184,7 @@ export function handleReactNativeObjectPatternRequire(
|
|
|
180
184
|
// We need to exit as we do not handle `const { Text, ...rest } = require('react-native');`
|
|
181
185
|
return;
|
|
182
186
|
} else if (
|
|
187
|
+
identifier.computed ||
|
|
183
188
|
!(t.isIdentifier(identifier.value) && t.isIdentifier(identifier.key))
|
|
184
189
|
) {
|
|
185
190
|
// Bail out on anything that isn't `const { <key>: <identifier> } = require('react-native');`
|
package/src/compiler/atRules.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
Declaration,
|
|
2
3
|
DeclarationBlock,
|
|
3
4
|
ParsedComponent,
|
|
4
5
|
Rule,
|
|
@@ -99,6 +100,49 @@ export function parsePropAtRule(rules?: (Rule | PropAtRule)[]) {
|
|
|
99
100
|
return mapping;
|
|
100
101
|
}
|
|
101
102
|
|
|
103
|
+
const mappingProperty = "-rn-native-mapping";
|
|
104
|
+
|
|
105
|
+
export function isMappingProperty(name: string) {
|
|
106
|
+
return name === mappingProperty || name.startsWith(`${mappingProperty}-`);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Declaration metadata survives the optimizer flattening nested at rules. */
|
|
110
|
+
export function parsePropDeclarations(declarations: Declaration[] = []) {
|
|
111
|
+
const mapping: StyleRuleMapping = {};
|
|
112
|
+
for (const declaration of declarations) {
|
|
113
|
+
if (
|
|
114
|
+
declaration.property !== "custom" ||
|
|
115
|
+
!isMappingProperty(declaration.value.name)
|
|
116
|
+
) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const { name, value } = declaration.value;
|
|
120
|
+
const target = value.filter(
|
|
121
|
+
(item): item is Extract<TokenOrValue, { type: "token" }> =>
|
|
122
|
+
item.type === "token" && item.value.type !== "white-space",
|
|
123
|
+
);
|
|
124
|
+
if (target.length === 0) continue;
|
|
125
|
+
nativeMappingAtRuleBlock(
|
|
126
|
+
[
|
|
127
|
+
{
|
|
128
|
+
type: "token",
|
|
129
|
+
value: {
|
|
130
|
+
type: "ident",
|
|
131
|
+
value:
|
|
132
|
+
name === mappingProperty
|
|
133
|
+
? "*"
|
|
134
|
+
: name.slice(mappingProperty.length + 1),
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{ type: "token", value: { type: "colon" } },
|
|
138
|
+
...target,
|
|
139
|
+
],
|
|
140
|
+
mapping,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
return mapping;
|
|
144
|
+
}
|
|
145
|
+
|
|
102
146
|
function nativeMappingAtRuleBlock(
|
|
103
147
|
token: Extract<TokenOrValue, { type: "token" }>[],
|
|
104
148
|
mapping: StyleRuleMapping = {},
|