react-native-css 3.0.7 → 3.1.0-rc.1
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/CHANGELOG.md +21 -0
- 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 +44 -28
- 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 +11 -3
- package/dist/commonjs/compiler/stylesheet.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 +14 -1
- 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 +95 -12
- 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/animation.js +6 -3
- package/dist/commonjs/native/styles/shorthands/animation.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 +45 -29
- 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 +11 -3
- package/dist/module/compiler/stylesheet.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 +12 -0
- 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 +95 -12
- 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/animation.js +6 -3
- package/dist/module/native/styles/shorthands/animation.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 +6 -8
- package/dist/typescript/commonjs/src/compiler/stylesheet.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/animation.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 +6 -8
- package/dist/typescript/module/src/compiler/stylesheet.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 +63 -28
- 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 +78 -47
- 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 +17 -10
- 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 +14 -0
- package/src/native/styles/functions/numeric-functions.ts +7 -6
- package/src/native/styles/functions/string-functions.ts +18 -0
- package/src/native/styles/functions/transform-functions.ts +5 -4
- package/src/native/styles/index.ts +100 -13
- package/src/native/styles/resolve.ts +15 -11
- package/src/native/styles/scale-factor.ts +6 -0
- package/src/native/styles/shorthands/animation.ts +8 -2
- 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
|
@@ -14,7 +14,8 @@ function varResolver(resolve, fn, get, options) {
|
|
|
14
14
|
[_reactivity.VAR_SYMBOL]: true
|
|
15
15
|
},
|
|
16
16
|
inlineVariables,
|
|
17
|
-
variableHistory = new Set()
|
|
17
|
+
variableHistory = options.variableHistory ??= new Set(),
|
|
18
|
+
variableCycles = options.variableCycles ??= new Set()
|
|
18
19
|
} = options;
|
|
19
20
|
const args = fn[2];
|
|
20
21
|
let name;
|
|
@@ -22,58 +23,69 @@ function varResolver(resolve, fn, get, options) {
|
|
|
22
23
|
if (typeof args === "string") {
|
|
23
24
|
name = args;
|
|
24
25
|
} else {
|
|
25
|
-
|
|
26
|
-
if ((0, _utilities.isStyleDescriptorArray)(
|
|
27
|
-
name =
|
|
28
|
-
fallback =
|
|
26
|
+
// Fallbacks are substituted only when needed, after reading the variable.
|
|
27
|
+
if ((0, _utilities.isStyleDescriptorArray)(args)) {
|
|
28
|
+
name = args[0];
|
|
29
|
+
fallback = args[1];
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
if (typeof name !== "string") {
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
35
|
+
if (variableCycles.has(name)) return resolve(fallback);
|
|
34
36
|
|
|
35
|
-
//
|
|
37
|
+
// Share the active resolution path with recursive calls. Mark only the
|
|
38
|
+
// actual cycle, so a dependent variable can still use its own fallback.
|
|
36
39
|
if (variableHistory.has(name)) {
|
|
40
|
+
let inCycle = false;
|
|
41
|
+
for (const dependency of variableHistory) {
|
|
42
|
+
if (dependency === name) inCycle = true;
|
|
43
|
+
if (inCycle) variableCycles.add(dependency);
|
|
44
|
+
}
|
|
37
45
|
return;
|
|
38
46
|
}
|
|
39
|
-
if (name in variables) {
|
|
40
|
-
renderGuards?.push(["v", name, variables[name]]);
|
|
41
|
-
return resolve(variables[name]);
|
|
42
|
-
}
|
|
43
47
|
variableHistory.add(name);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
48
|
+
try {
|
|
49
|
+
let value = resolve(inlineVariables?.[name]);
|
|
50
|
+
if (variableCycles.has(name)) return resolve(fallback);
|
|
51
|
+
if (value !== undefined) {
|
|
52
|
+
options.inlineVariables ??= {
|
|
53
|
+
[_reactivity.VAR_SYMBOL]: "inline"
|
|
54
|
+
};
|
|
55
|
+
options.inlineVariables[name] = value;
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// A universal selector declares the variable on this element. It has lower
|
|
60
|
+
// specificity than the element's class declarations, but beats inheritance.
|
|
61
|
+
value = resolve(get((0, _nativeInternal.universalVariables)(name)));
|
|
62
|
+
if (variableCycles.has(name)) return resolve(fallback);
|
|
63
|
+
if (value !== undefined) {
|
|
64
|
+
options.inlineVariables ??= {
|
|
65
|
+
[_reactivity.VAR_SYMBOL]: "inline"
|
|
66
|
+
};
|
|
67
|
+
options.inlineVariables[name] = value;
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Guards retain the ancestor's raw descriptor, matching the context value.
|
|
72
|
+
if (name in variables) {
|
|
73
|
+
renderGuards?.push(["v", name, variables[name]]);
|
|
74
|
+
value = resolve(variables[name]);
|
|
75
|
+
return variableCycles.has(name) ? resolve(fallback) : value;
|
|
76
|
+
}
|
|
77
|
+
value = resolve(get((0, _nativeInternal.rootVariables)(name)));
|
|
78
|
+
if (variableCycles.has(name)) return resolve(fallback);
|
|
79
|
+
if (value !== undefined) {
|
|
80
|
+
options.inlineVariables ??= {
|
|
81
|
+
[_reactivity.VAR_SYMBOL]: "inline"
|
|
82
|
+
};
|
|
83
|
+
options.inlineVariables[name] = value;
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
return resolve(fallback);
|
|
87
|
+
} finally {
|
|
88
|
+
variableHistory.delete(name);
|
|
76
89
|
}
|
|
77
|
-
return resolve(fallback);
|
|
78
90
|
}
|
|
79
91
|
//# sourceMappingURL=variables.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_nativeInternal","require","_utilities","_reactivity","varResolver","resolve","fn","get","options","renderGuards","inheritedVariables","variables","VAR_SYMBOL","inlineVariables","variableHistory","Set","args","name","fallback","
|
|
1
|
+
{"version":3,"names":["_nativeInternal","require","_utilities","_reactivity","varResolver","resolve","fn","get","options","renderGuards","inheritedVariables","variables","VAR_SYMBOL","inlineVariables","variableHistory","Set","variableCycles","args","name","fallback","isStyleDescriptorArray","has","inCycle","dependency","add","value","undefined","universalVariables","push","rootVariables","delete"],"sourceRoot":"../../../../src","sources":["native/styles/variables.ts"],"mappings":";;;;;;AACA,IAAAA,eAAA,GAAAC,OAAA;AAIA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAGO,SAASG,WAAWA,CACzBC,OAA2B,EAC3BC,EAAiB,EACjBC,GAAW,EACXC,OAA4B,EAC5B;EACA,MAAM;IACJC,YAAY;IACZC,kBAAkB,EAAEC,SAAS,GAAG;MAAE,CAACC,sBAAU,GAAG;IAAK,CAAC;IACtDC,eAAe;IACfC,eAAe,GAAIN,OAAO,CAACM,eAAe,KAAK,IAAIC,GAAG,CAAC,CAAE;IACzDC,cAAc,GAAIR,OAAO,CAACQ,cAAc,KAAK,IAAID,GAAG,CAAC;EACvD,CAAC,GAAGP,OAAO;EAEX,MAAMS,IAAI,GAAGX,EAAE,CAAC,CAAC,CAAC;EAElB,IAAIY,IAAwB;EAC5B,IAAIC,QAAqC;EAEzC,IAAI,OAAOF,IAAI,KAAK,QAAQ,EAAE;IAC5BC,IAAI,GAAGD,IAAI;EACb,CAAC,MAAM;IACL;IACA,IAAI,IAAAG,iCAAsB,EAACH,IAAI,CAAC,EAAE;MAChCC,IAAI,GAAGD,IAAI,CAAC,CAAC,CAAW;MACxBE,QAAQ,GAAGF,IAAI,CAAC,CAAC,CAAC;IACpB;EACF;EAEA,IAAI,OAAOC,IAAI,KAAK,QAAQ,EAAE;IAC5B;EACF;EAEA,IAAIF,cAAc,CAACK,GAAG,CAACH,IAAI,CAAC,EAAE,OAAOb,OAAO,CAACc,QAAQ,CAAC;;EAEtD;EACA;EACA,IAAIL,eAAe,CAACO,GAAG,CAACH,IAAI,CAAC,EAAE;IAC7B,IAAII,OAAO,GAAG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I,CAAC,GAAGb,OAAO,CAACc,QAAQ,CAAC,GAAGM,KAAK;IAC7D;IAEAA,KAAK,GAAGpB,OAAO,CAACE,GAAG,CAAC,IAAAsB,6BAAa,EAACX,IAAI,CAAC,CAAC,CAAC;IACzC,IAAIF,cAAc,CAACK,GAAG,CAACH,IAAI,CAAC,EAAE,OAAOb,OAAO,CAACc,QAAQ,CAAC;IACtD,IAAIM,KAAK,KAAKC,SAAS,EAAE;MACvBlB,OAAO,CAACK,eAAe,KAAK;QAAE,CAACD,sBAAU,GAAG;MAAS,CAAC;MACtDJ,OAAO,CAACK,eAAe,CAACK,IAAI,CAAC,GAAGO,KAAK;MACrC,OAAOA,KAAK;IACd;IAEA,OAAOpB,OAAO,CAACc,QAAQ,CAAC;EAC1B,CAAC,SAAS;IACRL,eAAe,CAACgB,MAAM,CAACZ,IAAI,CAAC;EAC9B;AACF","ignoreList":[]}
|
|
@@ -24,11 +24,22 @@ const rootVariableFamily = () => {
|
|
|
24
24
|
return obs;
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]);
|
|
27
|
+
// Seeded with the registries, so a copy that loads after the stylesheet inject keeps the project's rem
|
|
28
|
+
function createRootVariableRegistries() {
|
|
29
|
+
const registries = {
|
|
30
|
+
root: rootVariableFamily(),
|
|
31
|
+
universal: rootVariableFamily()
|
|
32
|
+
};
|
|
33
|
+
registries.root("__rn-css-rem").set([[14]]);
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
35
|
+
registries.root("__rn-css-color").set([[_reactNative.Platform.OS === "ios" ? (0, _reactNative.PlatformColor)("label", "labelColor") : (0, _reactNative.PlatformColor)("?attr/textColorPrimary", "SystemBaseHighColor")]
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
]);
|
|
38
|
+
return registries;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// The exports map gives import and require different builds, and Metro resolves each per requesting module
|
|
42
|
+
globalThis.__react_native_css_root_variable_registries ??= createRootVariableRegistries();
|
|
43
|
+
const rootVariables = exports.rootVariables = globalThis.__react_native_css_root_variable_registries.root;
|
|
44
|
+
const universalVariables = exports.universalVariables = globalThis.__react_native_css_root_variable_registries.universal;
|
|
34
45
|
//# sourceMappingURL=root.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_mediaQuery","_reactivity","rootVariableFamily","family","obs","observable","read","variableValue","undefined","value","mediaQuery","testMediaQuery","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_mediaQuery","_reactivity","rootVariableFamily","family","obs","observable","read","variableValue","undefined","value","mediaQuery","testMediaQuery","createRootVariableRegistries","registries","root","universal","set","Platform","OS","PlatformColor","globalThis","__react_native_css_root_variable_registries","rootVariables","exports","universalVariables"],"sourceRoot":"../../../src","sources":["native-internal/root.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,MAAMG,kBAAkB,GAAGA,CAAA,KAAM;EAC/B,OAAO,IAAAC,kBAAM,EAAuD,MAAM;IACxE,MAAMC,GAAG,GAAG,IAAAC,sBAAU,EACpB,CAACC,IAAI,EAAEC,aAAa,KAAK;MACvB,IAAI,CAACA,aAAa,EAAE,OAAOC,SAAS;MAEpC,KAAK,MAAM,CAACC,KAAK,EAAEC,UAAU,CAAC,IAAIH,aAAa,EAAE;QAC/C,IAAI,CAACG,UAAU,EAAE;UACf,OAAOD,KAAK;QACd;QAEA,IAAI,IAAAE,0BAAc,EAACD,UAAU,EAAEJ,IAAI,CAAC,EAAE;UACpC,OAAOG,KAAK;QACd;MACF;MAEA,OAAOD,SAAS;IAClB,CACF,CAAC;IAED,OAAOJ,GAAG;EACZ,CAAC,CAAC;AACJ,CAAC;AAaD;AACA,SAASQ,4BAA4BA,CAAA,EAA2B;EAC9D,MAAMC,UAAkC,GAAG;IACzCC,IAAI,EAAEZ,kBAAkB,CAAC,CAAC;IAC1Ba,SAAS,EAAEb,kBAAkB,CAAC;EAChC,CAAC;EAEDW,UAAU,CAACC,IAAI,CAAC,cAAc,CAAC,CAACE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAC3C;EACAH,UAAU,CAACC,IAAI,CAAC,gBAAgB,CAAC,CAACE,GAAG,CAAC,CACpC,CACEC,qBAAQ,CAACC,EAAE,KAAK,KAAK,GACjB,IAAAC,0BAAa,EAAC,OAAO,EAAE,YAAY,CAAC,GACpC,IAAAA,0BAAa,EAAC,wBAAwB,EAAE,qBAAqB,CAAC;EAEpE;EAAA,CACM,CAAC;EAET,OAAON,UAAU;AACnB;;AAEA;AACAO,UAAU,CAACC,2CAA2C,KACpDT,4BAA4B,CAAC,CAAC;AAEzB,MAAMU,aAAa,GAAAC,OAAA,CAAAD,aAAA,GACxBF,UAAU,CAACC,2CAA2C,CAACP,IAAI;AACtD,MAAMU,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAC7BJ,UAAU,CAACC,2CAA2C,CAACN,SAAS","ignoreList":[]}
|
|
@@ -63,7 +63,7 @@ globalThis.__react_native_css_style_collection ??= {
|
|
|
63
63
|
}
|
|
64
64
|
if (options.vu) {
|
|
65
65
|
for (const entry of options.vu) {
|
|
66
|
-
(0, _root.
|
|
66
|
+
(0, _root.universalVariables)(entry[0]).set(entry[1]);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
for (const effect of _reactivity.observableBatch.current) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_containerQuery","require","_reactivity","_root","globalThis","__react_native_css_style_collection","styles","family","observable","isDeepEqual","keyframes","inject","options","observableBatch","current","Set","StyleCollection","set","s","v","c","DEFAULT_CONTAINER_NAME","a","p","h","style","k","vr","entry","rootVariables","vu","effect","run","undefined","exports","b","aArray","Array","isArray","bArray","requiresKeyComparison","length","key"],"sourceRoot":"../../../src","sources":["native-internal/style-collection.ts"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AAiBAG,UAAU,CAACC,mCAAmC,KAAK;EACjDC,MAAM,EAAE,IAAAC,kBAAM,EAAmC,MAAM;IACrD,OAAO,IAAAC,sBAAU,EAAC,EAAE,EAAEC,WAAW,CAAC;EACpC,CAAC,CAAC;EACFC,SAAS,EAAE,IAAAH,kBAAM,EAAmC,MAAM;IACxD,OAAO,IAAAC,sBAAU,EAAC,EAAE,EAAEC,WAAW,CAAC;EACpC,CAAC,CAAC;EACFE,MAAM,EAAE,SAAAA,CAAUC,OAAiC,EAAE;IACnDC,2BAAe,CAACC,OAAO,GAAG,IAAIC,GAAG,CAAC,CAAC;IAEnCC,eAAe,CAACV,MAAM,CAAC,sBAAsB,CAAC,CAACW,GAAG,CAAC,CACjD;MACEC,CAAC,EAAE,CAAC,CAAC,CAAC;MACNC,CAAC,EAAE;IACL,CAAC,CACF,CAAC;IAEFH,eAAe,CAACV,MAAM,CAAC,uBAAuB,CAAC,CAACW,GAAG,CAAC,CAClD;MACEC,CAAC,EAAE,CAAC,CAAC,CAAC;MACNE,CAAC,EAAE,CAACC,sCAAsB;IAC5B,CAAC,CACF,CAAC;IAEFL,eAAe,CAACV,MAAM,CAAC,uBAAuB,CAAC,CAACW,GAAG,CAAC,CAClD;MACEC,CAAC,EAAE,CAAC,CAAC,CAAC;MACNI,CAAC,EAAE;IACL,CAAC,CACF,CAAC;IAEFN,eAAe,CAACV,MAAM,CAAC,uBAAuB,CAAC,CAACW,GAAG,CAAC,CAClD;MACEC,CAAC,EAAE,CAAC,CAAC,CAAC;MACNK,CAAC,EAAE;QACDC,CAAC,EAAE;MACL;IACF,CAAC,CACF,CAAC;IAEF,IAAIZ,OAAO,CAACM,CAAC,EAAE;MACb,KAAK,MAAMO,KAAK,IAAIb,OAAO,CAACM,CAAC,EAAE;QAC7BF,eAAe,CAACV,MAAM,CAACmB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACR,GAAG,CAACQ,KAAK,CAAC,CAAC,CAAC,CAAC;MAChD;IACF;IAEA,IAAIb,OAAO,CAACc,CAAC,EAAE;MACb,KAAK,MAAMhB,SAAS,IAAIE,OAAO,CAACc,CAAC,EAAE;QACjCV,eAAe,CAACN,SAAS,CAACA,SAAS,CAAC,CAAC,CAAC,CAAC,CAACO,GAAG,CAACP,SAAS,CAAC,CAAC,CAAC,CAAC;MAC3D;IACF;IAEA,IAAIE,OAAO,CAACe,EAAE,EAAE;MACd,KAAK,MAAMC,KAAK,IAAIhB,OAAO,CAACe,EAAE,EAAE;QAC9B,IAAAE,mBAAa,EAACD,KAAK,CAAC,CAAC,CAAC,CAAC,CAACX,GAAG,CAACW,KAAK,CAAC,CAAC,CAAC,CAAC;MACvC;IACF;IAEA,IAAIhB,OAAO,CAACkB,EAAE,EAAE;MACd,KAAK,MAAMF,KAAK,IAAIhB,OAAO,CAACkB,EAAE,EAAE;QAC9B,
|
|
1
|
+
{"version":3,"names":["_containerQuery","require","_reactivity","_root","globalThis","__react_native_css_style_collection","styles","family","observable","isDeepEqual","keyframes","inject","options","observableBatch","current","Set","StyleCollection","set","s","v","c","DEFAULT_CONTAINER_NAME","a","p","h","style","k","vr","entry","rootVariables","vu","universalVariables","effect","run","undefined","exports","b","aArray","Array","isArray","bArray","requiresKeyComparison","length","key"],"sourceRoot":"../../../src","sources":["native-internal/style-collection.ts"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AAiBAG,UAAU,CAACC,mCAAmC,KAAK;EACjDC,MAAM,EAAE,IAAAC,kBAAM,EAAmC,MAAM;IACrD,OAAO,IAAAC,s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EAEA;EACA,IAAIC,MAAM,IAAIG,MAAM,IAAIlB,CAAC,CAACoB,MAAM,KAAKN,CAAC,CAACM,MAAM,EAAE;IAC7C,OAAO,KAAK;EACd;;EAEA;EACA,KAAK,MAAMC,GAAG,IAAIrB,CAAC,EAAE;IACnB,IACE,CAACb,WAAW,CACTa,CAAC,CAA6BqB,GAAG,CAAC,EAClCP,CAAC,CAA6BO,GAAG,CACpC,CAAC,EACD;MACA,OAAO,KAAK;IACd;EACF;;EAEA;EACA,KAAK,MAAMA,GAAG,IAAIP,CAAC,EAAE;IACnB,IAAI,EAAEO,GAAG,IAAIrB,CAAC,CAAC,EAAE;MACf,OAAO,KAAK;IACd;EACF;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
|
|
@@ -16,7 +16,7 @@ function VariableContextProvider(props) {
|
|
|
16
16
|
const inheritedVariables = (0, _react.useContext)(VariableContext);
|
|
17
17
|
const value = (0, _react.useMemo)(() => ({
|
|
18
18
|
...inheritedVariables,
|
|
19
|
-
...
|
|
19
|
+
...(0, _reactivity.toVariableRecord)(props.value),
|
|
20
20
|
[_reactivity.VAR_SYMBOL]: true
|
|
21
21
|
}), [inheritedVariables, props.value]);
|
|
22
22
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(VariableContext, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactivity","_jsxRuntime","globalThis","__react_native_css_variable_context","createContext","VAR_SYMBOL","VariableContext","exports","VariableContextProvider","props","inheritedVariables","useContext","value","useMemo","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactivity","_jsxRuntime","globalThis","__react_native_css_variable_context","createContext","VAR_SYMBOL","VariableContext","exports","VariableContextProvider","props","inheritedVariables","useContext","value","useMemo","toVariableRecord","jsx","children"],"sourceRoot":"../../../src","sources":["native-internal/variables.tsx"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AASA,IAAAC,WAAA,GAAAD,OAAA;AAI8B,IAAAE,WAAA,GAAAF,OAAA;AAE9BG,UAAU,CAACC,mCAAmC,kBAC5C,IAAAC,oBAAa,EAAuB;EAClC,CAACC,sBAAU,GAAG;AAChB,CAAC,CAAC;AAEG,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGJ,UAAU,CAACC,mCAAmC;AAEtE,SAASK,uBAAuBA,CACrCC,KAA2E,EAC3E;EACA,MAAMC,kBAAkB,GAAG,IAAAC,iBAAU,EAACL,eAAe,CAAC;EAEtD,MAAMM,KAA2B,GAAG,IAAAC,cAAO,EACzC,OAAO;IACL,GAAGH,kBAAkB;IACrB,GAAG,IAAAI,4BAAgB,EAACL,KAAK,CAACG,KAAK,CAAC;IAChC,CAACP,sBAAU,GAAG;EAChB,CAAC,CAAC,EACF,CAACK,kBAAkB,EAAED,KAAK,CAACG,KAAK,CAClC,CAAC;EAED,oBAAO,IAAAX,WAAA,CAAAc,GAAA,EAACT,eAAe;IAACM,KAAK,EAAEA,KAAM;IAAAI,QAAA,EAAEP,KAAK,CAACO;EAAQ,CAAkB,CAAC;AAC1E","ignoreList":[]}
|
|
@@ -6,16 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.isStyleDescriptorArray = isStyleDescriptorArray;
|
|
7
7
|
exports.isStyleFunction = isStyleFunction;
|
|
8
8
|
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;
|
|
9
|
+
return Array.isArray(value) && !isStyleFunction(value);
|
|
14
10
|
}
|
|
15
11
|
function isStyleFunction(value) {
|
|
16
|
-
if (Array.isArray(value))
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return false;
|
|
12
|
+
if (!Array.isArray(value)) return false;
|
|
13
|
+
const marker = value[0];
|
|
14
|
+
return marker !== null && typeof marker === "object" && !Array.isArray(marker) && Object.keys(marker).length === 0 && typeof value[1] === "string";
|
|
20
15
|
}
|
|
21
16
|
//# 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":";;;;;;;AAEO,SAASA,sBAAsBA,CACpCC,KAAc,EACc;EAC5B,
|
|
1
|
+
{"version":3,"names":["isStyleDescriptorArray","value","Array","isArray","isStyleFunction","marker","Object","keys","length"],"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","ignoreList":[]}
|
package/dist/commonjs/web/api.js
CHANGED
|
@@ -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,IA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MAAM;IAC1B,OAAO;MACLC,OAAO,EAAE,UAAU;MACnB,GAAGvB,MAAM,CAACwB,WAAW,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;I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AE,EACFM,OAAO,CAACI,KAAK,EACb9B,QACF,CAAC,IACDV,wCAAwC,CACtCe,IAAI,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,C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