react-native-css 0.0.0-nightly.2c68396 → 0.0.0-nightly.2e152c9
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 +35 -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 +35 -0
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +198 -39
- 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 +190 -101
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/individual-transforms.js +129 -0
- package/dist/commonjs/compiler/individual-transforms.js.map +1 -0
- package/dist/commonjs/compiler/inline-variables.js +47 -1
- package/dist/commonjs/compiler/inline-variables.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 +16 -4
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +33 -9
- 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/SafeAreaProvider.js +13 -0
- package/dist/commonjs/components/SafeAreaProvider.js.map +1 -0
- package/dist/commonjs/components/index.cjs +49 -1
- package/dist/commonjs/components/index.cjs.map +1 -1
- package/dist/commonjs/components/react-native-safe-area-context.native.js +10 -0
- package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -1
- package/dist/commonjs/jest/index.js +3 -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 +16 -11
- 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/guards.js +7 -0
- package/dist/commonjs/native/conditions/guards.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/objects.js +11 -18
- package/dist/commonjs/native/objects.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 +45 -38
- 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/native/reactivity.js +64 -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 +139 -26
- package/dist/commonjs/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/native/styles/functions/animation-timing.js +2 -1
- package/dist/commonjs/native/styles/functions/animation-timing.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 +19 -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/platform-functions.js +2 -1
- package/dist/commonjs/native/styles/functions/platform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/string-functions.js +22 -6
- package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/transform-functions.js +95 -105
- package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/index.js +303 -49
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/native/styles/resolve.js +136 -19
- package/dist/commonjs/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/native/styles/scale-factor.js +12 -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 +41 -20
- 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/shorthands/transform.js +31 -8
- package/dist/commonjs/native/styles/shorthands/transform.js.map +1 -1
- package/dist/commonjs/native/styles/variables.js +165 -48
- package/dist/commonjs/native/styles/variables.js.map +1 -1
- package/dist/commonjs/native-internal/root.js +46 -7
- package/dist/commonjs/native-internal/root.js.map +1 -1
- package/dist/commonjs/native-internal/style-collection.js +22 -37
- 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/equality.js +41 -0
- package/dist/commonjs/utilities/equality.js.map +1 -0
- package/dist/commonjs/utilities/index.js +11 -0
- package/dist/commonjs/utilities/index.js.map +1 -1
- package/dist/commonjs/utilities/style-descriptor.js +32 -8
- package/dist/commonjs/utilities/style-descriptor.js.map +1 -1
- package/dist/commonjs/web/api.js +2 -2
- 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 +200 -41
- 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 +190 -100
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/individual-transforms.js +125 -0
- package/dist/module/compiler/individual-transforms.js.map +1 -0
- package/dist/module/compiler/inline-variables.js +47 -1
- package/dist/module/compiler/inline-variables.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 +16 -5
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +33 -9
- 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/SafeAreaProvider.js +4 -0
- package/dist/module/components/SafeAreaProvider.js.map +1 -0
- package/dist/module/components/index.cjs +49 -1
- package/dist/module/components/index.cjs.map +1 -1
- package/dist/module/components/react-native-safe-area-context.native.js +9 -1
- package/dist/module/components/react-native-safe-area-context.native.js.map +1 -1
- package/dist/module/jest/index.js +3 -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 +18 -13
- 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/guards.js +7 -0
- package/dist/module/native/conditions/guards.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/objects.js +11 -18
- package/dist/module/native/objects.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 +46 -39
- 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/native/reactivity.js +58 -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 +139 -26
- package/dist/module/native/styles/calculate-props.js.map +1 -1
- package/dist/module/native/styles/functions/animation-timing.js +2 -1
- package/dist/module/native/styles/functions/animation-timing.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 +17 -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/platform-functions.js +2 -1
- package/dist/module/native/styles/functions/platform-functions.js.map +1 -1
- package/dist/module/native/styles/functions/string-functions.js +19 -5
- package/dist/module/native/styles/functions/string-functions.js.map +1 -1
- package/dist/module/native/styles/functions/transform-functions.js +93 -104
- package/dist/module/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/native/styles/index.js +304 -49
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/native/styles/resolve.js +136 -19
- package/dist/module/native/styles/resolve.js.map +1 -1
- package/dist/module/native/styles/scale-factor.js +8 -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 +43 -21
- 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/shorthands/transform.js +31 -8
- package/dist/module/native/styles/shorthands/transform.js.map +1 -1
- package/dist/module/native/styles/variables.js +166 -50
- package/dist/module/native/styles/variables.js.map +1 -1
- package/dist/module/native-internal/root.js +44 -7
- package/dist/module/native-internal/root.js.map +1 -1
- package/dist/module/native-internal/style-collection.js +10 -37
- 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/equality.js +37 -0
- package/dist/module/utilities/equality.js.map +1 -0
- package/dist/module/utilities/index.js +1 -0
- package/dist/module/utilities/index.js.map +1 -1
- package/dist/module/utilities/style-descriptor.js +30 -8
- package/dist/module/utilities/style-descriptor.js.map +1 -1
- package/dist/module/web/api.js +2 -2
- 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 +13 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +2 -3
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/individual-transforms.d.ts +10 -0
- package/dist/typescript/commonjs/src/compiler/individual-transforms.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/inline-variables.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/inline-variables.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 +2 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +10 -10
- 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/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +2 -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 +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/conditions/guards.d.ts +2 -1
- package/dist/typescript/commonjs/src/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/objects.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 +7 -2
- package/dist/typescript/commonjs/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts +0 -3
- 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 +15 -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/calculate-props.d.ts +11 -2
- package/dist/typescript/commonjs/src/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/animation-timing.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/platform-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 +2 -0
- 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 +5 -4
- package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts +4 -1
- 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/shorthands/transform.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts +3 -2
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/root.d.ts +38 -0
- package/dist/typescript/commonjs/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/style-collection.d.ts +2 -2
- package/dist/typescript/commonjs/src/native-internal/style-collection.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/equality.d.ts +2 -0
- package/dist/typescript/commonjs/src/utilities/equality.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utilities/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/utilities/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts +14 -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 +14 -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 -5
- 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/individual-transforms.d.ts +10 -0
- package/dist/typescript/module/src/compiler/individual-transforms.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/inline-variables.d.ts +2 -2
- 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 +3 -2
- 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 +10 -10
- 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/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts.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 +2 -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 +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 +4 -3
- 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/objects.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 +9 -4
- package/dist/typescript/module/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts +4 -7
- 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 +15 -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 +13 -4
- 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 +3 -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 +9 -8
- 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 +7 -4
- 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 +4 -3
- 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 +39 -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 +3 -3
- 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/equality.d.ts +2 -0
- package/dist/typescript/module/src/utilities/equality.d.ts.map +1 -0
- package/dist/typescript/module/src/utilities/index.d.ts +4 -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 +14 -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 +78 -31
- 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 +282 -50
- package/src/compiler/compiler.types.ts +17 -0
- package/src/compiler/container-query.ts +8 -3
- package/src/compiler/declarations.ts +385 -247
- package/src/compiler/individual-transforms.ts +129 -0
- package/src/compiler/inline-variables.ts +67 -0
- package/src/compiler/lightningcss-loader.ts +16 -15
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +32 -5
- package/src/compiler/stylesheet.ts +51 -15
- 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/SafeAreaProvider.tsx +1 -0
- package/src/components/index.cts +49 -1
- package/src/components/react-native-safe-area-context.native.tsx +20 -0
- package/src/jest/index.ts +3 -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 +26 -18
- package/src/native/conditions/attributes.ts +26 -9
- package/src/native/conditions/container-query.ts +11 -9
- package/src/native/conditions/guards.ts +13 -1
- package/src/native/conditions/media-query.ts +1 -1
- package/src/native/objects.ts +12 -22
- package/src/native/react/interaction.ts +11 -6
- package/src/native/react/rules.ts +58 -45
- package/src/native/react/useNativeCss.ts +85 -18
- package/src/native/react/usePassthrough.ts +3 -2
- package/src/native/reactivity.ts +79 -24
- package/src/native/reanimated.ts +24 -5
- package/src/native/styles/calculate-props.ts +179 -28
- package/src/native/styles/functions/animation-timing.ts +3 -1
- package/src/native/styles/functions/color-mix.ts +45 -39
- package/src/native/styles/functions/filters.ts +21 -6
- package/src/native/styles/functions/numeric-functions.ts +7 -6
- package/src/native/styles/functions/platform-functions.ts +3 -1
- package/src/native/styles/functions/string-functions.ts +25 -5
- package/src/native/styles/functions/transform-functions.ts +111 -64
- package/src/native/styles/index.ts +340 -53
- package/src/native/styles/resolve.ts +188 -29
- package/src/native/styles/scale-factor.ts +9 -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 +46 -25
- package/src/native/styles/shorthands/index.ts +1 -0
- package/src/native/styles/shorthands/logical-border-width.ts +32 -0
- package/src/native/styles/shorthands/transform.ts +36 -11
- package/src/native/styles/variables.ts +242 -45
- package/src/native-internal/root.ts +83 -13
- package/src/native-internal/style-collection.ts +21 -46
- 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/equality.ts +41 -0
- package/src/utilities/index.ts +1 -0
- package/src/utilities/style-descriptor.ts +36 -14
- package/src/web/api.tsx +7 -12
- 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
|
@@ -3,19 +3,43 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.commaListItems = commaListItems;
|
|
7
|
+
exports.isCommaList = isCommaList;
|
|
6
8
|
exports.isStyleDescriptorArray = isStyleDescriptorArray;
|
|
7
9
|
exports.isStyleFunction = isStyleFunction;
|
|
8
10
|
function isStyleDescriptorArray(value) {
|
|
9
|
-
|
|
10
|
-
// If its an array and the first item is an object, the only allowed value is an array
|
|
11
|
-
return typeof value[0] === "object" ? Array.isArray(value[0]) : true;
|
|
12
|
-
}
|
|
13
|
-
return false;
|
|
11
|
+
return Array.isArray(value) && !isStyleFunction(value);
|
|
14
12
|
}
|
|
15
13
|
function isStyleFunction(value) {
|
|
16
|
-
if (Array.isArray(value))
|
|
17
|
-
|
|
14
|
+
if (!Array.isArray(value)) return false;
|
|
15
|
+
const marker = value[0];
|
|
16
|
+
return marker !== null && typeof marker === "object" && !Array.isArray(marker) && Object.keys(marker).length === 0 && typeof value[1] === "string";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Whether a resolved value is a comma-separated list: an array of items, each
|
|
21
|
+
* the array of its tokens. A resolved value holds no style functions, so an
|
|
22
|
+
* array led by an array is one. For a descriptor, which can be led by a
|
|
23
|
+
* function, test its first entry with isStyleDescriptorArray instead.
|
|
24
|
+
*/
|
|
25
|
+
function isCommaList(value) {
|
|
26
|
+
return Array.isArray(value) && Array.isArray(value[0]);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A resolved comma-separated list with each one-token item unwrapped, the
|
|
31
|
+
* form function arguments and React Native's list props take. Anything else
|
|
32
|
+
* is returned as it is.
|
|
33
|
+
*/
|
|
34
|
+
function commaListItems(value) {
|
|
35
|
+
if (!isCommaList(value)) return value;
|
|
36
|
+
|
|
37
|
+
// push, not map() or new Array(n), which Hermes runs slower: React
|
|
38
|
+
// Native's list props pass through here on every render
|
|
39
|
+
const items = [];
|
|
40
|
+
for (const item of value) {
|
|
41
|
+
items.push(item.length === 1 ? item[0] : item);
|
|
18
42
|
}
|
|
19
|
-
return
|
|
43
|
+
return items;
|
|
20
44
|
}
|
|
21
45
|
//# sourceMappingURL=style-descriptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isStyleDescriptorArray","value","Array","isArray","isStyleFunction","Object","keys","length"],"sourceRoot":"../../../src","sources":["utilities/style-descriptor.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["isStyleDescriptorArray","value","Array","isArray","isStyleFunction","marker","Object","keys","length","isCommaList","commaListItems","items","item","push"],"sourceRoot":"../../../src","sources":["utilities/style-descriptor.ts"],"mappings":";;;;;;;;;AAEO,SAASA,sBAAsBA,CACpCC,KAAc,EACc;EAC5B,OAAOC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,IAAI,CAACG,eAAe,CAACH,KAAK,CAAC;AACxD;AAEO,SAASG,eAAeA,CAACH,KAAc,EAA0B;EACtE,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE,OAAO,KAAK;EACvC,MAAMI,MAAe,GAAGJ,KAAK,CAAC,CAAC,CAAC;EAChC,OACEI,MAAM,KAAK,IAAI,IACf,OAAOA,MAAM,KAAK,QAAQ,IAC1B,CAACH,KAAK,CAACC,OAAO,CAACE,MAAM,CAAC,IACtBC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACG,MAAM,KAAK,CAAC,IAChC,OAAOP,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ;AAEhC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,WAAWA,CAACR,KAAc,EAAwB;EAChE,OAAOC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASS,cAAcA,CAACT,KAAc,EAAW;EACtD,IAAI,CAACQ,WAAW,CAACR,KAAK,CAAC,EAAE,OAAOA,KAAK;;EAErC;EACA;EACA,MAAMU,KAAgB,GAAG,EAAE;EAC3B,KAAK,MAAMC,IAAI,IAAIX,KAAK,EAAE;IACxBU,KAAK,CAACE,IAAI,CAACD,IAAI,CAACJ,MAAM,KAAK,CAAC,GAAGI,IAAI,CAAC,CAAC,CAAC,GAAGA,IAAI,CAAC;EAChD;EACA,OAAOD,KAAK;AACd","ignoreList":[]}
|
package/dist/commonjs/web/api.js
CHANGED
|
@@ -15,7 +15,7 @@ const defaultMapping = {
|
|
|
15
15
|
};
|
|
16
16
|
const styled = (baseComponent, mapping = defaultMapping, _options) => {
|
|
17
17
|
return props => {
|
|
18
|
-
return useCssElement(baseComponent,
|
|
18
|
+
return useCssElement(baseComponent, props, mapping);
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
exports.styled = styled;
|
|
@@ -48,7 +48,7 @@ const colorScheme = exports.colorScheme = {
|
|
|
48
48
|
return _reactNative.Appearance.getColorScheme();
|
|
49
49
|
},
|
|
50
50
|
set(name) {
|
|
51
|
-
_reactNative.Appearance.setColorScheme(name);
|
|
51
|
+
_reactNative.Appearance.setColorScheme(name ?? "unspecified");
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_assignStyle","_jsxRuntime","defaultMapping","className","styled","baseComponent","mapping","_options","props","useCssElement","exports","component","incomingProps","key","value","Object","entries","source","target","assignStyle","$$css","split","createElement","colorScheme","get","Appearance","getColorScheme","set","name","setColorScheme","vars","variables","$variables","startsWith","toString","VariableContextProvider","style","useMemo","display","fromEntries","map","jsx","children","useNativeVariable","Error","useUnstableNativeVariable"],"sourceRoot":"../../../src","sources":["web/api.tsx"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_assignStyle","_jsxRuntime","defaultMapping","className","styled","baseComponent","mapping","_options","props","useCssElement","exports","component","incomingProps","key","value","Object","entries","source","target","assignStyle","$$css","split","createElement","colorScheme","get","Appearance","getColorScheme","set","name","setColorScheme","vars","variables","$variables","startsWith","toString","VariableContextProvider","style","useMemo","display","fromEntries","map","jsx","children","useNativeVariable","Error","useUnstableNativeVariable"],"sourceRoot":"../../../src","sources":["web/api.tsx"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,YAAA,GAAAF,OAAA;AAA6C,IAAAG,WAAA,GAAAH,OAAA;AAE7C,MAAMI,cAAsE,GAAG;EAC7EC,SAAS,EAAE;AACb,CAAC;AAEM,MAAMC,MAAc,GAAGA,CAC5BC,aAA6B,EAC7BC,OAA4C,GAAGJ,cAAc,EAC7DK,QAAwB,KACrB;EACH,OAAQC,KAAY,IAAK;IACvB,OAAOC,aAAa,CAACJ,aAAa,EAAEG,KAAK,EAAEF,OAAO,CAAC;EACrD,CAAC;AACH,CAAC;AAACI,OAAA,CAAAN,MAAA,GAAAA,MAAA;AAEK,MAAMK,aAAa,GAAGA,CAC3BE,SAAY,EACZC,aAAoB,EACpBN,OAA+B,KAC5B;EACH,IAAIE,KAAK,GAAG;IAAE,GAAGI;EAAc,CAAC;EAEhC,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACV,OAAO,CAAC,EAAE;IAClD,MAAMW,MAAe,GAAGT,KAAK,CAACK,GAAG,CAAC;IAClC,IAAI,CAACI,MAAM,EAAE;MACX;IACF;;IAEA;IACA,OAAOT,KAAK,CAACK,GAAG,CAAC;IAEjB,IAAIK,MAAwB,GAC1B,OAAOJ,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAACI,MAAM,G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AW,CACnBxB,MAAM,CAACC,OAAO,CAACR,KAAK,CAACM,KAAK,CAAC,CAAC0B,GAAG,CAAC,CAAC,CAAC3B,GAAG,EAAEC,KAAK,CAAC,KAAK,CAChDD,GAAG,CAACoB,UAAU,CAAC,IAAI,CAAC,GAAGpB,GAAG,GAAG,KAAKA,GAAG,EAAE,EACvCC,KAAK,CACN,CACH;IACF,CAAC;EACH,CAAC,EAAE,CAACN,KAAK,CAACM,KAAK,CAAC,CAAC;EAEjB,oBAAO,IAAAb,WAAA,CAAAwC,GAAA;IAAKL,KAAK,EAAEA,KAAM;IAAAM,QAAA,EAAElC,KAAK,CAACkC;EAAQ,CAAM,CAAC;AAClD;AAEO,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACrC,MAAM,IAAIC,KAAK,CAAC,2CAA2C,CAAC;AAC9D,CAAC;AAAClC,OAAA,CAAAiC,iBAAA,GAAAA,iBAAA;AAEK,MAAME,yBAAyB,GAAGA,CAAA,KAAM;EAC7C,MAAM,IAAID,KAAK,CAAC,mDAAmD,CAAC;AACtE,CAAC;AAAClC,OAAA,CAAAmC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -19,7 +19,10 @@ function assignStyle(value, targets, props) {
|
|
|
19
19
|
}
|
|
20
20
|
return props;
|
|
21
21
|
} else {
|
|
22
|
-
props[target]
|
|
22
|
+
const existing = props[target];
|
|
23
|
+
props[target] = Array.isArray(existing) ? [...existing] : {
|
|
24
|
+
...existing
|
|
25
|
+
};
|
|
23
26
|
assignStyle(value, targets, props[target]);
|
|
24
27
|
return props;
|
|
25
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["assignStyle","value","targets","props","target","shift","length","cb","args"],"sourceRoot":"../../../src","sources":["web/assign-style.ts"],"mappings":";;;;;;AAAA;AACO,SAASA,WAAWA,CACzBC,KAA0B,EAC1BC,OAAiB,EACjBC,KAA0B,EAC1B;EACA,MAAMC,MAAM,GAAGF,OAAO,CAACG,KAAK,CAAC,CAAC;EAE9B,IAAI,CAACD,MAAM,EAAE,OAAO,CAAC,CAAC;EAEtB,IAAIF,OAAO,CAACI,MAAM,KAAK,CAAC,EAAE;IACxB,IAAI,OAAOH,KAAK,CAACC,MAAM,CAAC,KAAK,UAAU,EAAE;MACvC,MAAMG,EAAE,GAAGJ,KAAK,CAACC,MAAM,CAAC;MACxBD,KAAK,CAACC,MAAM,CAAC,GAAG,CAAC,GAAGI,IAAW,KAAK;QAClC,OAAO,CAACD,EAAE,CAAC,GAAGC,IAAI,CAAC,EAAEP,KAAK,CAAC;MAC7B,CAAC;IACH,CAAC,MAAM;MACLE,KAAK,CAACC,MAAM,CAAC,GAAG,CAACD,KAAK,CAACC,MAAM,CAAC,EAAEH,KAAK,CAAC;IACxC;IACA,OAAOE,KAAK;EACd,CAAC,MAAM;
|
|
1
|
+
{"version":3,"names":["assignStyle","value","targets","props","target","shift","length","cb","args","existing","Array","isArray"],"sourceRoot":"../../../src","sources":["web/assign-style.ts"],"mappings":";;;;;;AAAA;AACO,SAASA,WAAWA,CACzBC,KAA0B,EAC1BC,OAAiB,EACjBC,KAA0B,EAC1B;EACA,MAAMC,MAAM,GAAGF,OAAO,CAACG,KAAK,CAAC,CAAC;EAE9B,IAAI,CAACD,MAAM,EAAE,OAAO,CAAC,CAAC;EAEtB,IAAIF,OAAO,CAACI,MAAM,KAAK,CAAC,EAAE;IACxB,IAAI,OAAOH,KAAK,CAACC,MAAM,CAAC,KAAK,UAAU,EAAE;MACvC,MAAMG,EAAE,GAAGJ,KAAK,CAACC,MAAM,CAAC;MACxBD,KAAK,CAACC,MAAM,CAAC,GAAG,CAAC,GAAGI,IAAW,KAAK;QAClC,OAAO,CAACD,EAAE,CAAC,GAAGC,IAAI,CAAC,EAAEP,KAAK,CAAC;MAC7B,CAAC;IACH,CAAC,MAAM;MACLE,KAAK,CAACC,MAAM,CAAC,GAAG,CAACD,KAAK,CAACC,MAAM,CAAC,EAAEH,KAAK,CAAC;IACxC;IACA,OAAOE,KAAK;EACd,CAAC,MAAM;IACL,MAAMM,QAAQ,GAAGN,KAAK,CAACC,MAAM,CAAC;IAC9BD,KAAK,CAACC,MAAM,CAAC,GAAGM,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,GAAG,CAAC,GAAGA,QAAQ,CAAC,GAAG;MAAE,GAAGA;IAAS,CAAC;IACzET,WAAW,CAACC,KAAK,EAAEC,OAAO,EAAEC,KAAK,CAACC,MAAM,CAAC,CAAC;IAC1C,OAAOD,KAAK;EACd;AACF","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { dirname, resolve, sep } from "path";
|
|
3
4
|
export function getInteropRequireDefaultSource(init, t) {
|
|
4
5
|
if (!t.isIdentifier(init.callee, {
|
|
5
6
|
name: "_interopRequireDefault"
|
|
@@ -18,4 +19,9 @@ export function getInteropRequireDefaultSource(init, t) {
|
|
|
18
19
|
}
|
|
19
20
|
return requireArg.value;
|
|
20
21
|
}
|
|
22
|
+
|
|
23
|
+
// The handlers match "/"-separated package paths, and path.resolve separates with "\" on Windows
|
|
24
|
+
export function resolveImportSource(filename, source) {
|
|
25
|
+
return resolve(dirname(filename), source).split(sep).join("/");
|
|
26
|
+
}
|
|
21
27
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getInteropRequireDefaultSource","init","t","isIdentifier","callee","name","interopArg","arguments","at","isCallExpression","requireArg","isStringLiteral","value"],"sourceRoot":"../../../src","sources":["babel/helpers.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["dirname","resolve","sep","getInteropRequireDefaultSource","init","t","isIdentifier","callee","name","interopArg","arguments","at","isCallExpression","requireArg","isStringLiteral","value","resolveImportSource","filename","source","split","join"],"sourceRoot":"../../../src","sources":["babel/helpers.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,OAAO,EAAEC,GAAG,QAAQ,MAAM;AAiB5C,OAAO,SAASC,8BAA8BA,CAC5CC,IAAoB,EACpBC,CAAa,EACb;EACA,IAAI,CAACA,CAAC,CAACC,YAAY,CAACF,IAAI,CAACG,MAAM,EAAE;IAAEC,IAAI,EAAE;EAAyB,CAAC,CAAC,EAAE;IACpE;EACF;EAEA,MAAMC,UAAU,GAAGL,IAAI,CAACM,SAAS,CAACC,EAAE,CAAC,CAAC,CAAC;EAEvC,IACE,CAACN,CAAC,CAACO,gBAAgB,CAACH,UAAU,CAAC,IAC/B,CAACJ,CAAC,CAACC,YAAY,CAACG,UAAU,CAACF,MAAM,EAAE;IAAEC,IAAI,EAAE;EAAU,CAAC,CAAC,EACvD;IACA;EACF;EAEA,MAAMK,UAAU,GAAGJ,UAAU,CAACC,SAAS,CAACC,EAAE,CAAC,CAAC,CAAC;EAE7C,IAAI,CAACN,CAAC,CAACS,eAAe,CAACD,UAAU,CAAC,EAAE;IAClC;EACF;EAEA,OAAOA,UAAU,CAACE,KAAK;AACzB;;AAEA;AACA,OAAO,SAASC,mBAAmBA,CAACC,QAAgB,EAAEC,MAAc,EAAU;EAC5E,OAAOjB,OAAO,CAACD,OAAO,CAACiB,QAAQ,CAAC,EAAEC,MAAM,CAAC,CAACC,KAAK,CAACjB,GAAG,CAAC,CAACkB,IAAI,CAAC,GAAG,CAAC;AAChE","ignoreList":[]}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { resolve } from "path";
|
|
3
|
+
import { basename, dirname, resolve, sep } from "path";
|
|
4
4
|
import { getInteropRequireDefaultSource } from "./helpers.js";
|
|
5
5
|
import { handleReactNativeIdentifierRequire, handleReactNativeImport, handleReactNativeObjectPatternRequire } from "./react-native.js";
|
|
6
|
-
import { handleReactNativeWebIdentifierRequire, handleReactNativeWebImport, handleReactNativeWebObjectPatternRequire } from "./react-native-web.js";
|
|
6
|
+
import { handleReactNativeWebIdentifierRequire, handleReactNativeWebImport, handleReactNativeWebInteropRequireDefault, handleReactNativeWebObjectPatternRequire } from "./react-native-web.js";
|
|
7
7
|
export default function ({
|
|
8
8
|
types: t
|
|
9
9
|
}) {
|
|
10
10
|
const processed = new WeakSet();
|
|
11
|
-
const
|
|
12
|
-
const
|
|
11
|
+
const packageRoot = resolve(__dirname, basename(dirname(__dirname)) === "src" ? "../.." : "../../..");
|
|
12
|
+
const thisModuleDist = resolve(packageRoot, "dist") + sep;
|
|
13
|
+
const thisModuleSrc = resolve(packageRoot, "src") + sep;
|
|
13
14
|
function isFromThisModule(filename) {
|
|
14
15
|
return filename.startsWith(thisModuleDist) || filename.startsWith(thisModuleSrc);
|
|
15
16
|
}
|
|
@@ -17,10 +18,13 @@ export default function ({
|
|
|
17
18
|
name: "Rewrite react-native to react-native-css",
|
|
18
19
|
visitor: {
|
|
19
20
|
ImportDeclaration(path, state) {
|
|
20
|
-
|
|
21
|
+
const {
|
|
22
|
+
filename
|
|
23
|
+
} = state;
|
|
24
|
+
if (filename === undefined || processed.has(path.node) || isFromThisModule(filename)) {
|
|
21
25
|
return;
|
|
22
26
|
}
|
|
23
|
-
const statements = handleReactNativeImport(path.node, t,
|
|
27
|
+
const statements = handleReactNativeImport(path.node, t, filename) ?? handleReactNativeWebImport(path.node, t, filename);
|
|
24
28
|
if (!statements) {
|
|
25
29
|
return;
|
|
26
30
|
}
|
|
@@ -30,7 +34,10 @@ export default function ({
|
|
|
30
34
|
path.replaceWithMultiple(statements);
|
|
31
35
|
},
|
|
32
36
|
VariableDeclaration(path, state) {
|
|
33
|
-
|
|
37
|
+
const {
|
|
38
|
+
filename
|
|
39
|
+
} = state;
|
|
40
|
+
if (filename === undefined || processed.has(path.node) || isFromThisModule(filename)) {
|
|
34
41
|
return;
|
|
35
42
|
}
|
|
36
43
|
const firstDeclaration = path.node.declarations.at(0);
|
|
@@ -58,6 +65,11 @@ export default function ({
|
|
|
58
65
|
if (!(t.isIdentifier(id) || t.isObjectPattern(id))) {
|
|
59
66
|
return;
|
|
60
67
|
}
|
|
68
|
+
|
|
69
|
+
// A local function called require is not the module loader.
|
|
70
|
+
if (path.scope.getBinding("require")) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
61
73
|
const initArg = init.arguments.at(0);
|
|
62
74
|
if (!initArg) {
|
|
63
75
|
return;
|
|
@@ -68,11 +80,11 @@ export default function ({
|
|
|
68
80
|
if (t.isIdentifier(id) && t.isIdentifier(init.callee, {
|
|
69
81
|
name: "require"
|
|
70
82
|
}) && t.isStringLiteral(initArg)) {
|
|
71
|
-
statements = handleReactNativeIdentifierRequire(path, t, id.name, initArg.value,
|
|
83
|
+
statements = handleReactNativeIdentifierRequire(path, t, id.name, initArg.value, filename) ?? handleReactNativeWebIdentifierRequire(path, t, id.name, initArg.value, filename);
|
|
72
84
|
} else if (t.isObjectPattern(id) && t.isIdentifier(init.callee, {
|
|
73
85
|
name: "require"
|
|
74
86
|
}) && t.isStringLiteral(initArg)) {
|
|
75
|
-
statements = handleReactNativeObjectPatternRequire(path, t, id, initArg.value,
|
|
87
|
+
statements = handleReactNativeObjectPatternRequire(path, t, id, initArg.value, filename) ?? handleReactNativeWebObjectPatternRequire(path, t, id, initArg.value, filename);
|
|
76
88
|
} else if (t.isIdentifier(id) && t.isIdentifier(init.callee, {
|
|
77
89
|
name: "_interopRequireDefault"
|
|
78
90
|
})) {
|
|
@@ -81,7 +93,7 @@ export default function ({
|
|
|
81
93
|
if (!source) {
|
|
82
94
|
return;
|
|
83
95
|
}
|
|
84
|
-
statements =
|
|
96
|
+
statements = handleReactNativeWebInteropRequireDefault(path, t, id.name, init, source, filename);
|
|
85
97
|
}
|
|
86
98
|
if (!statements) {
|
|
87
99
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["resolve","getInteropRequireDefaultSource","handleReactNativeIdentifierRequire","handleReactNativeImport","handleReactNativeObjectPatternRequire","handleReactNativeWebIdentifierRequire","handleReactNativeWebImport","handleReactNativeWebObjectPatternRequire","types","t","processed","WeakSet","
|
|
1
|
+
{"version":3,"names":["basename","dirname","resolve","sep","getInteropRequireDefaultSource","handleReactNativeIdentifierRequire","handleReactNativeImport","handleReactNativeObjectPatternRequire","handleReactNativeWebIdentifierRequire","handleReactNativeWebImport","handleReactNativeWebInteropRequireDefault","handleReactNativeWebObjectPatternRequire","types","t","processed","WeakSet","packageRoot","__dirname","thisModuleDist","thisModuleSrc","isFromThisModule","filename","startsWith","name","visitor","ImportDeclaration","path","state","undefined","has","node","statements","statement","add","replaceWithMultiple","VariableDeclaration","firstDeclaration","declarations","at","length","init","id","isCallExpression","isIdentifier","isObjectPattern","scope","getBinding","initArg","arguments","callee","isStringLiteral","value","source"],"sourceRoot":"../../../src","sources":["babel/import-plugin.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,GAAG,QAAQ,MAAM;AAKtD,SACEC,8BAA8B,QAGzB,cAAW;AAClB,SACEC,kCAAkC,EAClCC,uBAAuB,EACvBC,qCAAqC,QAChC,mBAAgB;AACvB,SACEC,qCAAqC,EACrCC,0BAA0B,EAC1BC,yCAAyC,EACzCC,wCAAwC,QACnC,uBAAoB;AAE3B,eAAe,UAAU;EACvBC,KAAK,EAAEC;AAGT,CAAC,EAA0B;EACzB,MAAMC,SAAS,GAAG,IAAIC,OAAO,CAAY,CAAC;EAE1C,MAAMC,WAAW,GAAGd,OAAO,CACzBe,SAAS,EACTjB,QAAQ,CAACC,OAAO,CAACgB,SAAS,CAAC,CAAC,KAAK,KAAK,GAAG,OAAO,GAAG,UACrD,CAAC;EACD,MAAMC,cAAc,GAAGhB,OAAO,CAACc,WAAW,EAAE,MAAM,CAAC,GAAGb,GAAG;EACzD,MAAMgB,aAAa,GAAGjB,OAAO,CAACc,WAAW,EAAE,KAAK,CAAC,GAAGb,GAAG;EAEvD,SAASiB,gBAAgBA,CAACC,QAAgB,EAAW;IACnD,OACEA,QAAQ,CAACC,UAAU,CAACJ,cAAc,CAAC,IAAIG,QAAQ,CAACC,UAA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EACJb,CAAC,EACD4B,EAAE,EACFM,OAAO,CAACI,KAAK,EACb9B,QACF,CAAC;QACL,CAAC,MAAM,IACLR,CAAC,CAAC8B,YAAY,CAACF,EAAE,CAAC,IAClB5B,CAAC,CAAC8B,YAAY,CAACH,IAAI,CAACS,MAAM,EAAE;UAAE1B,IAAI,EAAE;QAAyB,CAAC,CAAC,EAC/D;UACA;UACA,MAAM6B,MAAM,GAAGhD,8BAA8B,CAACoC,IAAI,EAAE3B,CAAC,CAAC;UACtD,IAAI,CAACuC,MAAM,EAAE;YACX;UACF;UACArB,UAAU,GAAGrB,yCAAyC,CACpDgB,IAAI,EACJb,CAAC,EACD4B,EAAE,CAAClB,IAAI,EACPiB,IAAI,EACJY,MAAM,EACN/B,QACF,CAAC;QACH;QAEA,IAAI,CAACU,UAAU,EAAE;UACf;QACF;QAEA,KAAK,MAAMC,SAAS,IAAID,UAAU,EAAE;UAClCjB,SAAS,CAACmB,GAAG,CAACD,SAAS,CAAC;QAC1B;QAEAN,IAAI,CAACQ,mBAAmB,CAACH,UAAU,CAAC;MACtC;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { resolve } from "path";
|
|
4
3
|
import { allowedModules } from "./allowedModules.js";
|
|
4
|
+
import { resolveImportSource } from "./helpers.js";
|
|
5
5
|
function parseReactNativeWebSource(source, filename) {
|
|
6
6
|
if (source.startsWith(".")) {
|
|
7
|
-
source =
|
|
7
|
+
source = resolveImportSource(filename, source);
|
|
8
8
|
const internalPath = source.split("react-native-web/dist")[1];
|
|
9
9
|
if (!internalPath) {
|
|
10
10
|
return;
|
|
@@ -34,6 +34,7 @@ export function handleReactNativeWebImport(declaration, t, filename) {
|
|
|
34
34
|
specifiers,
|
|
35
35
|
source
|
|
36
36
|
} = declaration;
|
|
37
|
+
if (declaration.importKind && declaration.importKind !== "value") return;
|
|
37
38
|
const rnwSource = parseReactNativeWebSource(source.value, filename);
|
|
38
39
|
if (!rnwSource) {
|
|
39
40
|
return;
|
|
@@ -51,11 +52,15 @@ export function handleReactNativeWebImport(declaration, t, filename) {
|
|
|
51
52
|
if (!name) {
|
|
52
53
|
statements.push(t.importDeclaration([t.importDefaultSpecifier(specifier.local)], t.stringLiteral(newSource)));
|
|
53
54
|
} else {
|
|
54
|
-
statements.push(t.importDeclaration([t.importSpecifier(specifier.local,
|
|
55
|
+
statements.push(t.importDeclaration([t.importSpecifier(specifier.local, t.identifier(name))], t.stringLiteral(`react-native-css/components/${name}`)));
|
|
55
56
|
}
|
|
56
57
|
} else if (t.isImportNamespaceSpecifier(specifier)) {
|
|
57
58
|
statements.push(t.importDeclaration([specifier], t.stringLiteral("react-native-css/components")));
|
|
58
59
|
} else {
|
|
60
|
+
if (specifier.importKind && specifier.importKind !== "value") {
|
|
61
|
+
statements.push(t.importDeclaration([specifier], source));
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
59
64
|
const localName = t.isStringLiteral(specifier.imported) ? specifier.imported.value : specifier.imported.name;
|
|
60
65
|
if (!allowedModules.has(localName)) {
|
|
61
66
|
statements.push(t.importDeclaration([specifier], source));
|
|
@@ -81,6 +86,13 @@ export function handleReactNativeWebIdentifierRequire(path, t, id, source, filen
|
|
|
81
86
|
return [t.variableDeclaration(path.node.kind, [t.variableDeclarator(t.identifier(id), t.callExpression(t.identifier("require"), [t.stringLiteral(newSource)]))])];
|
|
82
87
|
}
|
|
83
88
|
}
|
|
89
|
+
export function handleReactNativeWebInteropRequireDefault(path, t, id, init, source, filename) {
|
|
90
|
+
const parsed = parseReactNativeWebSource(source, filename);
|
|
91
|
+
if (!parsed) return;
|
|
92
|
+
const wrapped = t.cloneNode(init);
|
|
93
|
+
wrapped.arguments = [t.callExpression(t.identifier("require"), [t.stringLiteral(parsed.source)])];
|
|
94
|
+
return [t.variableDeclaration(path.node.kind, [t.variableDeclarator(t.identifier(id), wrapped)])];
|
|
95
|
+
}
|
|
84
96
|
export function handleReactNativeWebObjectPatternRequire(path, t, id, source, filename) {
|
|
85
97
|
const parsedSource = parseReactNativeWebSource(source, filename);
|
|
86
98
|
|
|
@@ -94,7 +106,7 @@ export function handleReactNativeWebObjectPatternRequire(path, t, id, source, fi
|
|
|
94
106
|
// Bail out on `const { ...rest } = require('react-native-web');`
|
|
95
107
|
// We need to exit as we do not handle `const { Text, ...rest } = require('react-native-web');`
|
|
96
108
|
return;
|
|
97
|
-
} else if (!(t.isIdentifier(identifier.value) && t.isIdentifier(identifier.key))) {
|
|
109
|
+
} else if (identifier.computed || !(t.isIdentifier(identifier.value) && t.isIdentifier(identifier.key))) {
|
|
98
110
|
// Bail out on anything that isn't `const { <key>: <identifier> } = require('react-native-web');`
|
|
99
111
|
return;
|
|
100
112
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["allowedModules","resolveImportSource","parseReactNativeWebSource","source","filename","startsWith","internalPath","split","name","at","has","handleReactNativeWebImport","declaration","t","specifiers","importKind","rnwSource","value","length","importDeclaration","stringLiteral","statements","specifier","isImportDefaultSpecifier","newSource","push","importDefaultSpecifier","local","importSpecifier","identifier","isImportNamespaceSpecifier","localName","isStringLiteral","imported","handleReactNativeWebIdentifierRequire","path","id","parsedSource","variableDeclaration","node","kind","variableDeclarator","objectPattern","objectProperty","callExpression","handleReactNativeWebInteropRequireDefault","init","parsed","wrapped","cloneNode","arguments","handleReactNativeWebObjectPatternRequire","properties","isRestElement","computed","isIdentifier","key","newSourceWithName"],"sourceRoot":"../../../src","sources":["babel/react-native-web.ts"],"mappings":";;AASA,SAASA,cAAc,QAAQ,qBAAkB;AACjD,SAASC,mBAAmB,QAAQ,cAAW;AAI/C,SAASC,yBAAyBA,CAACC,MAAc,EAAEC,QAAgB,EAAE;EACnE,IAAID,MAAM,CAACE,UAAU,CAAC,GAAG,CAAC,EAAE;IAC1BF,MAAM,GAAGF,mBAAmB,CAACG,QAAQ,EAAED,M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AAC,CAACgB,UAAU,CAACA,UAAU,CAACZ,KAAK,CAACT,IAAI,CAAC,EACnC,KAAK,EACL,IACF,CAAC,CACF,CAAC,EACFK,CAAC,CAAC+B,cAAc,CAAC/B,CAAC,CAACgB,UAAU,CAAC,SAAS,CAAC,EAAE,CACxChB,CAAC,CAACO,aAAa,CAACqC,iBAAiB,CAAC,CACnC,CACH,CAAC,CACF,CACH,CAAC;MACH;IACF;EACF;EAEA,OAAOpC,UAAU;AACnB","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { dirname, resolve } from "path";
|
|
4
3
|
import { allowedModules } from "./allowedModules.js";
|
|
4
|
+
import { resolveImportSource } from "./helpers.js";
|
|
5
5
|
function parseReactNativeSource(source, filename) {
|
|
6
6
|
if (source.startsWith(".")) {
|
|
7
|
-
source =
|
|
7
|
+
source = resolveImportSource(filename, source);
|
|
8
8
|
const internalPath = source.split("react-native/Libraries/Components/")[1];
|
|
9
9
|
if (!internalPath) {
|
|
10
10
|
return;
|
|
@@ -34,6 +34,7 @@ export function handleReactNativeImport(declaration, t, filename) {
|
|
|
34
34
|
specifiers,
|
|
35
35
|
source
|
|
36
36
|
} = declaration;
|
|
37
|
+
if (declaration.importKind && declaration.importKind !== "value") return;
|
|
37
38
|
const rnwSource = parseReactNativeSource(source.value, filename);
|
|
38
39
|
if (!rnwSource) {
|
|
39
40
|
return;
|
|
@@ -51,11 +52,15 @@ export function handleReactNativeImport(declaration, t, filename) {
|
|
|
51
52
|
if (!name) {
|
|
52
53
|
statements.push(t.importDeclaration([t.importDefaultSpecifier(specifier.local)], t.stringLiteral(newSource)));
|
|
53
54
|
} else {
|
|
54
|
-
statements.push(t.importDeclaration([t.importSpecifier(specifier.local,
|
|
55
|
+
statements.push(t.importDeclaration([t.importSpecifier(specifier.local, t.identifier(name))], t.stringLiteral(`react-native-css/components/${name}`)));
|
|
55
56
|
}
|
|
56
57
|
} else if (t.isImportNamespaceSpecifier(specifier)) {
|
|
57
58
|
statements.push(t.importDeclaration([specifier], t.stringLiteral("react-native-css/components")));
|
|
58
59
|
} else {
|
|
60
|
+
if (specifier.importKind && specifier.importKind !== "value") {
|
|
61
|
+
statements.push(t.importDeclaration([specifier], source));
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
59
64
|
const localName = t.isStringLiteral(specifier.imported) ? specifier.imported.value : specifier.imported.name;
|
|
60
65
|
if (!allowedModules.has(localName)) {
|
|
61
66
|
statements.push(t.importDeclaration([specifier], source));
|
|
@@ -94,7 +99,7 @@ export function handleReactNativeObjectPatternRequire(path, t, id, source, filen
|
|
|
94
99
|
// Bail out on `const { ...rest } = require('react-native');`
|
|
95
100
|
// We need to exit as we do not handle `const { Text, ...rest } = require('react-native');`
|
|
96
101
|
return;
|
|
97
|
-
} else if (!(t.isIdentifier(identifier.value) && t.isIdentifier(identifier.key))) {
|
|
102
|
+
} else if (identifier.computed || !(t.isIdentifier(identifier.value) && t.isIdentifier(identifier.key))) {
|
|
98
103
|
// Bail out on anything that isn't `const { <key>: <identifier> } = require('react-native');`
|
|
99
104
|
return;
|
|
100
105
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["allowedModules","resolveImportSource","parseReactNativeSource","source","filename","startsWith","internalPath","split","name","at","has","handleReactNativeImport","declaration","t","specifiers","importKind","rnwSource","value","length","importDeclaration","stringLiteral","statements","specifier","isImportDefaultSpecifier","newSource","push","importDefaultSpecifier","local","importSpecifier","identifier","isImportNamespaceSpecifier","localName","isStringLiteral","imported","handleReactNativeIdentifierRequire","path","id","parsedSource","variableDeclaration","node","kind","variableDeclarator","objectPattern","objectProperty","callExpression","handleReactNativeObjectPatternRequire","properties","isRestElement","computed","isIdentifier","key","newSourceWithName"],"sourceRoot":"../../../src","sources":["babel/react-native.ts"],"mappings":";;AAQA,SAASA,cAAc,QAAQ,qBAAkB;AACjD,SAASC,mBAAmB,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AEhC,IAAI,CAACR,cAAc,CAACU,GAAG,CAACF,IAAI,CAAC,EAAE;QAC7Ba,UAAU,CAACI,IAAI,CACbZ,CAAC,CAACyB,mBAAmB,CAACH,IAAI,CAACI,IAAI,CAACC,IAAI,EAAE,CACpC3B,CAAC,CAAC4B,kBAAkB,CAClB5B,CAAC,CAAC6B,aAAa,CAAC,CAACb,UAAU,CAAC,CAAC,EAC7BhB,CAAC,CAAC+B,cAAc,CAAC/B,CAAC,CAACgB,UAAU,CAAC,SAAS,CAAC,EAAE,CACxChB,CAAC,CAACO,aAAa,CAACjB,MAAM,CAAC,CACxB,CACH,CAAC,CACF,CACH,CAAC;MACH,CAAC,MAAM;QACL,MAAMgD,iBAAiB,GAAG,+BAA+B3C,IAAI,EAAE;QAE/Da,UAAU,CAACI,IAAI,CACbZ,CAAC,CAACyB,mBAAmB,CAACH,IAAI,CAACI,IAAI,CAACC,IAAI,EAAE,CACpC3B,CAAC,CAAC4B,kBAAkB,CAClB5B,CAAC,CAAC6B,aAAa,CAAC,CACd7B,CAAC,CAAC8B,cAAc,CACd9B,CAAC,CAACgB,UAAU,CAACrB,IAAI,CAAC,EAClBK,CAAC,CAACgB,UAAU,CAACA,UAAU,CAACZ,KAAK,CAACT,IAAI,CAAC,EACnC,KAAK,EACL,IACF,CAAC,CACF,CAAC,EACFK,CAAC,CAAC+B,cAAc,CAAC/B,CAAC,CAACgB,UAAU,CAAC,SAAS,CAAC,EAAE,CACxChB,CAAC,CAACO,aAAa,CAAC+B,iBAAiB,CAAC,CACnC,CACH,CAAC,CACF,CACH,CAAC;MACH;IACF;EACF;EAEA,OAAO9B,UAAU;AACnB","ignoreList":[]}
|
|
@@ -60,6 +60,39 @@ export function parsePropAtRule(rules) {
|
|
|
60
60
|
}
|
|
61
61
|
return mapping;
|
|
62
62
|
}
|
|
63
|
+
const mappingProperty = "-rn-native-mapping";
|
|
64
|
+
export function isMappingProperty(name) {
|
|
65
|
+
return name === mappingProperty || name.startsWith(`${mappingProperty}-`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Declaration metadata survives the optimizer flattening nested at rules. */
|
|
69
|
+
export function parsePropDeclarations(declarations = []) {
|
|
70
|
+
const mapping = {};
|
|
71
|
+
for (const declaration of declarations) {
|
|
72
|
+
if (declaration.property !== "custom" || !isMappingProperty(declaration.value.name)) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const {
|
|
76
|
+
name,
|
|
77
|
+
value
|
|
78
|
+
} = declaration.value;
|
|
79
|
+
const target = value.filter(item => item.type === "token" && item.value.type !== "white-space");
|
|
80
|
+
if (target.length === 0) continue;
|
|
81
|
+
nativeMappingAtRuleBlock([{
|
|
82
|
+
type: "token",
|
|
83
|
+
value: {
|
|
84
|
+
type: "ident",
|
|
85
|
+
value: name === mappingProperty ? "*" : name.slice(mappingProperty.length + 1)
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
type: "token",
|
|
89
|
+
value: {
|
|
90
|
+
type: "colon"
|
|
91
|
+
}
|
|
92
|
+
}, ...target], mapping);
|
|
93
|
+
}
|
|
94
|
+
return mapping;
|
|
95
|
+
}
|
|
63
96
|
function nativeMappingAtRuleBlock(token, mapping = {}) {
|
|
64
97
|
let [from, to] = splitByDelimiter(token, item => {
|
|
65
98
|
return item.value.type === "colon";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["toRNProperty","splitByDelimiter","maybeMutateReactNativeOptions","rule","_builder","type","value","name","isNativeMappingAtRule","parsePropAtRule","rules","mapping","prelude","length","filter","item","nativeMappingAtRuleBlock","block","blocks","blockRules","token","from","to","fromToken","flatMap","index","split","map","part"],"sourceRoot":"../../../src","sources":["compiler/atRules.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["toRNProperty","splitByDelimiter","maybeMutateReactNativeOptions","rule","_builder","type","value","name","isNativeMappingAtRule","parsePropAtRule","rules","mapping","prelude","length","filter","item","nativeMappingAtRuleBlock","block","blocks","blockRules","mappingProperty","isMappingProperty","startsWith","parsePropDeclarations","declarations","declaration","property","target","slice","token","from","to","fromToken","flatMap","index","split","map","part"],"sourceRoot":"../../../src","sources":["compiler/atRules.ts"],"mappings":";;AASA,SAASA,YAAY,QAAQ,gBAAa;AAC1C,SAASC,gBAAgB,QAAQ,yBAAsB;;AAYvD;AACA;AACA;;AAcA,OAAO,SAASC,6BAA6BA,CAC3CC,IAA8B,EAC9BC,QAA2B,EAC3B;EACA,IAAID,IAAI,CAACE,IAAI,KAAK,QAAQ,IAAIF,IAAI,CAACG,KAAK,EAAEC,IAAI,KAAK,cAAc,EAAE;IACjE;EACF;;EAEA;AACF;;AAEA;AACA;AACA;;AAEA,SAASC,qBAAqBA,CAACL,IAAuB,EAAsB;EAC1E,OAAOA,IAAI,CAACE,IAAI,KAAK,SAAS,IAAIF,IAAI,CAACG,KAAK,CAACC,IAAI,KAAK,eAAe;AACvE;AAEA,OAAO,SAASE,eAAeA,CAACC,KAA6B,EAAE;EAC7D;EACA,MAAMC,OAAyB,GAAG;IAChC,aAAa,EAAE,CAAC,aAAa,CAAC;IAC9B,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpB,cAAc,EAAE,CAAC,aAAa,CAAC;IAC/B,oBAAoB,EAAE,CAAC,eAAe,CAAC;IACvC,kBAAkB,EAAE,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAC/C,kBAAkB,EAAE,CAAC,gBAAgB,EAAE,YAAY,CAAC;IACpD,mBAAmB,EAAE,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IACjD,kBAAkB,EAAE,CAAC,gBAAgB,EAAE,YAAY;EACrD,CAAC;EAED,IAAI,CAACD,KAAK,EAAE,OAAOC,OAAO;EAE1B,KAAK,MAAMR,IAAI,IAAIO,KAAK,EAAE;IACxB,IAAI,CAACF,qBAAqB,CAACL,IAAI,CAAC,EAAE;IAElC,IAAIA,IAAI,CAACG,KAAK,CAACM,OAAO,CAACC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