react-native-css 2.1.2 → 3.0.0-nightly.4723140
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/{LICENSE.md → LICENSE} +6 -8
- package/README.md +10 -86
- package/dist/commonjs/babel/helpers.js +129 -0
- package/dist/commonjs/babel/helpers.js.map +1 -0
- package/dist/commonjs/babel/import-plugin.js +97 -0
- package/dist/commonjs/babel/import-plugin.js.map +1 -0
- package/dist/commonjs/babel/index.js +9 -0
- package/dist/commonjs/babel/index.js.map +1 -0
- package/dist/commonjs/compiler/add.js +175 -0
- package/dist/commonjs/compiler/add.js.map +1 -0
- package/dist/commonjs/compiler/compiler.js +466 -0
- package/dist/commonjs/compiler/compiler.js.map +1 -0
- package/dist/commonjs/compiler/compiler.types.js +4 -0
- package/dist/commonjs/compiler/compiler.types.js.map +1 -0
- package/dist/commonjs/compiler/container-query.js +63 -0
- package/dist/commonjs/compiler/container-query.js.map +1 -0
- package/dist/commonjs/compiler/declarations.js +1843 -0
- package/dist/commonjs/compiler/declarations.js.map +1 -0
- package/dist/commonjs/compiler/functions-web.js +44 -0
- package/dist/commonjs/compiler/functions-web.js.map +1 -0
- package/dist/commonjs/compiler/functions.js +59 -0
- package/dist/commonjs/compiler/functions.js.map +1 -0
- package/dist/commonjs/compiler/index.js +17 -0
- package/dist/commonjs/compiler/index.js.map +1 -0
- package/dist/commonjs/compiler/keyframes.js +69 -0
- package/dist/commonjs/compiler/keyframes.js.map +1 -0
- package/dist/commonjs/compiler/media-query.js +172 -0
- package/dist/commonjs/compiler/media-query.js.map +1 -0
- package/dist/commonjs/compiler/selectors.js +330 -0
- package/dist/commonjs/compiler/selectors.js.map +1 -0
- package/dist/commonjs/components/ActivityIndicator.js +20 -0
- package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
- package/dist/commonjs/components/SafeAreaProvider/index.js +41 -0
- package/dist/commonjs/components/SafeAreaProvider/index.js.map +1 -0
- package/dist/commonjs/components/SafeAreaProvider/index.web.js +13 -0
- package/dist/commonjs/components/SafeAreaProvider/index.web.js.map +1 -0
- package/dist/commonjs/components/Text.js +15 -0
- package/dist/commonjs/components/Text.js.map +1 -0
- package/dist/commonjs/components/TextInput.js +20 -0
- package/dist/commonjs/components/TextInput.js.map +1 -0
- package/dist/commonjs/components/View.js +15 -0
- package/dist/commonjs/components/View.js.map +1 -0
- package/dist/commonjs/components/index.js +36 -0
- package/dist/commonjs/components/index.js.map +1 -0
- package/dist/commonjs/doctor/index.js +6 -0
- package/dist/commonjs/doctor/index.js.map +1 -0
- package/dist/commonjs/index.js +17 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/jest/expect.d.js +2 -0
- package/dist/commonjs/jest/expect.d.js.map +1 -0
- package/dist/commonjs/jest/index.js +49 -0
- package/dist/commonjs/jest/index.js.map +1 -0
- package/dist/commonjs/jest/setup.js +3 -0
- package/dist/commonjs/jest/setup.js.map +1 -0
- package/dist/commonjs/jest/setupAfterEnv.js +15 -0
- package/dist/commonjs/jest/setupAfterEnv.js.map +1 -0
- package/dist/commonjs/metro/index.js +106 -0
- package/dist/commonjs/metro/index.js.map +1 -0
- package/dist/commonjs/metro/injection-code.js +12 -0
- package/dist/commonjs/metro/injection-code.js.map +1 -0
- package/dist/commonjs/metro/metro-transformer.js +21 -0
- package/dist/commonjs/metro/metro-transformer.js.map +1 -0
- package/dist/commonjs/metro/picocolors.js +71 -0
- package/dist/commonjs/metro/picocolors.js.map +1 -0
- package/dist/commonjs/metro/stringify.js +59 -0
- package/dist/commonjs/metro/stringify.js.map +1 -0
- package/dist/commonjs/metro/typescript.js +47 -0
- package/dist/commonjs/metro/typescript.js.map +1 -0
- package/dist/commonjs/package.json +1 -0
- package/dist/commonjs/runtime/index.js +17 -0
- package/dist/commonjs/runtime/index.js.map +1 -0
- package/dist/commonjs/runtime/native/api.js +90 -0
- package/dist/commonjs/runtime/native/api.js.map +1 -0
- package/dist/commonjs/runtime/native/conditions/container-query.js +116 -0
- package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -0
- package/dist/commonjs/runtime/native/conditions/guards.js +27 -0
- package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -0
- package/dist/commonjs/runtime/native/conditions/index.js +74 -0
- package/dist/commonjs/runtime/native/conditions/index.js.map +1 -0
- package/dist/commonjs/runtime/native/conditions/media-query.js +91 -0
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -0
- package/dist/commonjs/runtime/native/index.js +18 -0
- package/dist/commonjs/runtime/native/index.js.map +1 -0
- package/dist/commonjs/runtime/native/injection.js +80 -0
- package/dist/commonjs/runtime/native/injection.js.map +1 -0
- package/dist/commonjs/runtime/native/metro.js +6 -0
- package/dist/commonjs/runtime/native/metro.js.map +1 -0
- package/dist/commonjs/runtime/native/react/interaction.js +63 -0
- package/dist/commonjs/runtime/native/react/interaction.js.map +1 -0
- package/dist/commonjs/runtime/native/react/rules.js +257 -0
- package/dist/commonjs/runtime/native/react/rules.js.map +1 -0
- package/dist/commonjs/runtime/native/react/useNativeCss.js +158 -0
- package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -0
- package/dist/commonjs/runtime/native/react/usePassthrough.js +50 -0
- package/dist/commonjs/runtime/native/react/usePassthrough.js.map +1 -0
- package/dist/commonjs/runtime/native/reactivity.js +193 -0
- package/dist/commonjs/runtime/native/reactivity.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/animation.js +90 -0
- package/dist/commonjs/runtime/native/styles/animation.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/calc.js +113 -0
- package/dist/commonjs/runtime/native/styles/calc.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/constants.js +8 -0
- package/dist/commonjs/runtime/native/styles/constants.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/defaults.js +69 -0
- package/dist/commonjs/runtime/native/styles/defaults.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/index.js +223 -0
- package/dist/commonjs/runtime/native/styles/index.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/resolve.js +96 -0
- package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/shorthand.js +62 -0
- package/dist/commonjs/runtime/native/styles/shorthand.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/text-shadow.js +13 -0
- package/dist/commonjs/runtime/native/styles/text-shadow.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/transform.js +17 -0
- package/dist/commonjs/runtime/native/styles/transform.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/units.js +46 -0
- package/dist/commonjs/runtime/native/styles/units.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/variables.js +57 -0
- package/dist/commonjs/runtime/native/styles/variables.js.map +1 -0
- package/dist/commonjs/runtime/runtime.js +17 -0
- package/dist/commonjs/runtime/runtime.js.map +1 -0
- package/dist/commonjs/runtime/runtime.native.js +17 -0
- package/dist/commonjs/runtime/runtime.native.js.map +1 -0
- package/dist/commonjs/runtime/runtime.types.js +6 -0
- package/dist/commonjs/runtime/runtime.types.js.map +1 -0
- package/dist/commonjs/runtime/utils/components.js +18 -0
- package/dist/commonjs/runtime/utils/components.js.map +1 -0
- package/dist/commonjs/runtime/utils/dot-notation.types.js +2 -0
- package/dist/commonjs/runtime/utils/dot-notation.types.js.map +1 -0
- package/dist/commonjs/runtime/utils/index.js +61 -0
- package/dist/commonjs/runtime/utils/index.js.map +1 -0
- package/dist/commonjs/runtime/utils/objects.js +71 -0
- package/dist/commonjs/runtime/utils/objects.js.map +1 -0
- package/dist/commonjs/runtime/utils/specificity.js +43 -0
- package/dist/commonjs/runtime/utils/specificity.js.map +1 -0
- package/dist/commonjs/runtime/utils/style-value.js +14 -0
- package/dist/commonjs/runtime/utils/style-value.js.map +1 -0
- package/dist/commonjs/runtime/utils/utils.types.js +6 -0
- package/dist/commonjs/runtime/utils/utils.types.js.map +1 -0
- package/dist/commonjs/runtime/web/api.js +68 -0
- package/dist/commonjs/runtime/web/api.js.map +1 -0
- package/dist/commonjs/runtime/web/assign-style.js +27 -0
- package/dist/commonjs/runtime/web/assign-style.js.map +1 -0
- package/dist/commonjs/runtime/web/index.js +17 -0
- package/dist/commonjs/runtime/web/index.js.map +1 -0
- package/dist/module/babel/helpers.js +120 -0
- package/dist/module/babel/helpers.js.map +1 -0
- package/dist/module/babel/import-plugin.js +93 -0
- package/dist/module/babel/import-plugin.js.map +1 -0
- package/dist/module/babel/index.js +9 -0
- package/dist/module/babel/index.js.map +1 -0
- package/dist/module/compiler/add.js +168 -0
- package/dist/module/compiler/add.js.map +1 -0
- package/dist/module/compiler/compiler.js +461 -0
- package/dist/module/compiler/compiler.js.map +1 -0
- package/dist/module/compiler/compiler.types.js +72 -0
- package/dist/module/compiler/compiler.types.js.map +1 -0
- package/dist/module/compiler/container-query.js +59 -0
- package/dist/module/compiler/container-query.js.map +1 -0
- package/dist/module/compiler/declarations.js +1834 -0
- package/dist/module/compiler/declarations.js.map +1 -0
- package/dist/module/compiler/functions-web.js +32 -0
- package/dist/module/compiler/functions-web.js.map +1 -0
- package/dist/module/compiler/functions.js +47 -0
- package/dist/module/compiler/functions.js.map +1 -0
- package/dist/module/compiler/index.js +9 -0
- package/dist/module/compiler/index.js.map +1 -0
- package/dist/module/compiler/keyframes.js +63 -0
- package/dist/module/compiler/keyframes.js.map +1 -0
- package/dist/module/compiler/media-query.js +166 -0
- package/dist/module/compiler/media-query.js.map +1 -0
- package/dist/module/compiler/selectors.js +325 -0
- package/dist/module/compiler/selectors.js.map +1 -0
- package/dist/module/components/ActivityIndicator.js +16 -0
- package/dist/module/components/ActivityIndicator.js.map +1 -0
- package/dist/module/components/SafeAreaProvider/index.js +36 -0
- package/dist/module/components/SafeAreaProvider/index.js.map +1 -0
- package/dist/module/components/SafeAreaProvider/index.web.js +4 -0
- package/dist/module/components/SafeAreaProvider/index.web.js.map +1 -0
- package/dist/module/components/Text.js +11 -0
- package/dist/module/components/Text.js.map +1 -0
- package/dist/module/components/TextInput.js +16 -0
- package/dist/module/components/TextInput.js.map +1 -0
- package/dist/module/components/View.js +11 -0
- package/dist/module/components/View.js.map +1 -0
- package/dist/module/components/index.js +6 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/doctor/index.js +4 -0
- package/dist/module/doctor/index.js.map +1 -0
- package/dist/module/index.js +4 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/jest/expect.d.js +2 -0
- package/dist/module/jest/expect.d.js.map +1 -0
- package/dist/module/jest/index.js +28 -0
- package/dist/module/jest/index.js.map +1 -0
- package/dist/module/jest/setup.js +3 -0
- package/dist/module/jest/setup.js.map +1 -0
- package/dist/module/jest/setupAfterEnv.js +15 -0
- package/dist/module/jest/setupAfterEnv.js.map +1 -0
- package/dist/module/metro/index.js +100 -0
- package/dist/module/metro/index.js.map +1 -0
- package/dist/module/metro/injection-code.js +8 -0
- package/dist/module/metro/injection-code.js.map +1 -0
- package/dist/module/metro/metro-transformer.js +17 -0
- package/dist/module/metro/metro-transformer.js.map +1 -0
- package/dist/module/metro/picocolors.js +67 -0
- package/dist/module/metro/picocolors.js.map +1 -0
- package/dist/module/metro/stringify.js +55 -0
- package/dist/module/metro/stringify.js.map +1 -0
- package/dist/module/metro/typescript.js +42 -0
- package/dist/module/metro/typescript.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/runtime/index.js +9 -0
- package/dist/module/runtime/index.js.map +1 -0
- package/dist/module/runtime/native/api.js +75 -0
- package/dist/module/runtime/native/api.js.map +1 -0
- package/dist/module/runtime/native/conditions/container-query.js +110 -0
- package/dist/module/runtime/native/conditions/container-query.js.map +1 -0
- package/dist/module/runtime/native/conditions/guards.js +23 -0
- package/dist/module/runtime/native/conditions/guards.js.map +1 -0
- package/dist/module/runtime/native/conditions/index.js +70 -0
- package/dist/module/runtime/native/conditions/index.js.map +1 -0
- package/dist/module/runtime/native/conditions/media-query.js +86 -0
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -0
- package/dist/module/runtime/native/index.js +6 -0
- package/dist/module/runtime/native/index.js.map +1 -0
- package/dist/module/runtime/native/injection.js +75 -0
- package/dist/module/runtime/native/injection.js.map +1 -0
- package/dist/module/runtime/native/metro.js +5 -0
- package/dist/module/runtime/native/metro.js.map +1 -0
- package/dist/module/runtime/native/react/interaction.js +59 -0
- package/dist/module/runtime/native/react/interaction.js.map +1 -0
- package/dist/module/runtime/native/react/rules.js +251 -0
- package/dist/module/runtime/native/react/rules.js.map +1 -0
- package/dist/module/runtime/native/react/useNativeCss.js +152 -0
- package/dist/module/runtime/native/react/useNativeCss.js.map +1 -0
- package/dist/module/runtime/native/react/usePassthrough.js +45 -0
- package/dist/module/runtime/native/react/usePassthrough.js.map +1 -0
- package/dist/module/runtime/native/reactivity.js +181 -0
- package/dist/module/runtime/native/reactivity.js.map +1 -0
- package/dist/module/runtime/native/styles/animation.js +85 -0
- package/dist/module/runtime/native/styles/animation.js.map +1 -0
- package/dist/module/runtime/native/styles/calc.js +108 -0
- package/dist/module/runtime/native/styles/calc.js.map +1 -0
- package/dist/module/runtime/native/styles/constants.js +4 -0
- package/dist/module/runtime/native/styles/constants.js.map +1 -0
- package/dist/module/runtime/native/styles/defaults.js +65 -0
- package/dist/module/runtime/native/styles/defaults.js.map +1 -0
- package/dist/module/runtime/native/styles/index.js +218 -0
- package/dist/module/runtime/native/styles/index.js.map +1 -0
- package/dist/module/runtime/native/styles/resolve.js +92 -0
- package/dist/module/runtime/native/styles/resolve.js.map +1 -0
- package/dist/module/runtime/native/styles/shorthand.js +57 -0
- package/dist/module/runtime/native/styles/shorthand.js.map +1 -0
- package/dist/module/runtime/native/styles/text-shadow.js +9 -0
- package/dist/module/runtime/native/styles/text-shadow.js.map +1 -0
- package/dist/module/runtime/native/styles/transform.js +12 -0
- package/dist/module/runtime/native/styles/transform.js.map +1 -0
- package/dist/module/runtime/native/styles/units.js +37 -0
- package/dist/module/runtime/native/styles/units.js.map +1 -0
- package/dist/module/runtime/native/styles/variables.js +53 -0
- package/dist/module/runtime/native/styles/variables.js.map +1 -0
- package/dist/module/runtime/runtime.js +4 -0
- package/dist/module/runtime/runtime.js.map +1 -0
- package/dist/module/runtime/runtime.native.js +4 -0
- package/dist/module/runtime/runtime.native.js.map +1 -0
- package/dist/module/runtime/runtime.types.js +4 -0
- package/dist/module/runtime/runtime.types.js.map +1 -0
- package/dist/module/runtime/utils/components.js +14 -0
- package/dist/module/runtime/utils/components.js.map +1 -0
- package/dist/module/runtime/utils/dot-notation.types.js +2 -0
- package/dist/module/runtime/utils/dot-notation.types.js.map +1 -0
- package/dist/module/runtime/utils/index.js +8 -0
- package/dist/module/runtime/utils/index.js.map +1 -0
- package/dist/module/runtime/utils/objects.js +64 -0
- package/dist/module/runtime/utils/objects.js.map +1 -0
- package/dist/module/runtime/utils/specificity.js +38 -0
- package/dist/module/runtime/utils/specificity.js.map +1 -0
- package/dist/module/runtime/utils/style-value.js +10 -0
- package/dist/module/runtime/utils/style-value.js.map +1 -0
- package/dist/module/runtime/utils/utils.types.js +4 -0
- package/dist/module/runtime/utils/utils.types.js.map +1 -0
- package/dist/module/runtime/web/api.js +59 -0
- package/dist/module/runtime/web/api.js.map +1 -0
- package/dist/module/runtime/web/assign-style.js +23 -0
- package/dist/module/runtime/web/assign-style.js.map +1 -0
- package/dist/module/runtime/web/index.js +4 -0
- package/dist/module/runtime/web/index.js.map +1 -0
- package/dist/typescript/commonjs/example/src/App.d.ts +3 -0
- package/dist/typescript/commonjs/example/src/App.d.ts.map +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/commonjs/src/babel/helpers.d.ts +18 -0
- package/dist/typescript/commonjs/src/babel/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/babel/import-plugin.d.ts +6 -0
- package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/babel/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/babel/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/add.d.ts +10 -0
- package/dist/typescript/commonjs/src/compiler/add.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +10 -0
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +279 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/container-query.d.ts +5 -0
- package/dist/typescript/commonjs/src/compiler/container-query.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +28 -0
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/functions-web.d.ts +11 -0
- package/dist/typescript/commonjs/src/compiler/functions-web.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/functions.d.ts +11 -0
- package/dist/typescript/commonjs/src/compiler/functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/index.d.ts +7 -0
- package/dist/typescript/commonjs/src/compiler/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/keyframes.d.ts +6 -0
- package/dist/typescript/commonjs/src/compiler/keyframes.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts +7 -0
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts +18 -0
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +3 -0
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.web.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.web.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Text.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/Text.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/TextInput.d.ts +13 -0
- package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/View.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/View.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/doctor/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/doctor/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/jest/index.d.ts +14 -0
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/jest/setup.d.ts +1 -0
- package/dist/typescript/commonjs/src/jest/setup.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/jest/setupAfterEnv.d.ts +1 -0
- package/dist/typescript/commonjs/src/jest/setupAfterEnv.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts +10 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/injection-code.d.ts +2 -0
- package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +3 -0
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/picocolors.d.ts +27 -0
- package/dist/typescript/commonjs/src/metro/picocolors.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/stringify.d.ts +7 -0
- package/dist/typescript/commonjs/src/metro/stringify.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/typescript.d.ts +2 -0
- package/dist/typescript/commonjs/src/metro/typescript.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/index.d.ts +7 -0
- package/dist/typescript/commonjs/src/runtime/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts +17 -0
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts +7 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts +6 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts +4 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/index.d.ts +4 -0
- package/dist/typescript/commonjs/src/runtime/native/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +16 -0
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/metro.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/metro.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts +6 -0
- package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +6 -0
- package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts +37 -0
- package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/react/usePassthrough.d.ts +4 -0
- package/dist/typescript/commonjs/src/runtime/native/react/usePassthrough.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +63 -0
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +8 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/constants.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/index.d.ts +20 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts +14 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts +12 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts +7 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts +6 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/runtime.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/runtime.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/runtime.native.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/runtime.native.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/runtime.types.d.ts +62 -0
- package/dist/typescript/commonjs/src/runtime/runtime.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/components.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/utils/components.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/dot-notation.types.d.ts +23 -0
- package/dist/typescript/commonjs/src/runtime/utils/dot-notation.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/index.d.ts +6 -0
- package/dist/typescript/commonjs/src/runtime/utils/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts +4 -0
- package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts +12 -0
- package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/style-value.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/utils/style-value.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/utils.types.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/utils/utils.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts +10 -0
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/web/assign-style.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/web/assign-style.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/web/index.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/web/index.d.ts.map +1 -0
- package/dist/typescript/module/example/src/App.d.ts +3 -0
- package/dist/typescript/module/example/src/App.d.ts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/dist/typescript/module/src/babel/helpers.d.ts +18 -0
- package/dist/typescript/module/src/babel/helpers.d.ts.map +1 -0
- package/dist/typescript/module/src/babel/import-plugin.d.ts +6 -0
- package/dist/typescript/module/src/babel/import-plugin.d.ts.map +1 -0
- package/dist/typescript/module/src/babel/index.d.ts +1 -0
- package/dist/typescript/module/src/babel/index.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/add.d.ts +10 -0
- package/dist/typescript/module/src/compiler/add.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/compiler.d.ts +10 -0
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +279 -0
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/container-query.d.ts +5 -0
- package/dist/typescript/module/src/compiler/container-query.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/declarations.d.ts +28 -0
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/functions-web.d.ts +11 -0
- package/dist/typescript/module/src/compiler/functions-web.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/functions.d.ts +11 -0
- package/dist/typescript/module/src/compiler/functions.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/index.d.ts +7 -0
- package/dist/typescript/module/src/compiler/index.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/keyframes.d.ts +6 -0
- package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/media-query.d.ts +7 -0
- package/dist/typescript/module/src/compiler/media-query.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/selectors.d.ts +18 -0
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -0
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts +3 -0
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/typescript/module/src/components/SafeAreaProvider/index.d.ts +4 -0
- package/dist/typescript/module/src/components/SafeAreaProvider/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/SafeAreaProvider/index.web.d.ts +2 -0
- package/dist/typescript/module/src/components/SafeAreaProvider/index.web.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Text.d.ts +8 -0
- package/dist/typescript/module/src/components/Text.d.ts.map +1 -0
- package/dist/typescript/module/src/components/TextInput.d.ts +13 -0
- package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
- package/dist/typescript/module/src/components/View.d.ts +8 -0
- package/dist/typescript/module/src/components/View.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +4 -0
- package/dist/typescript/module/src/components/index.d.ts.map +1 -0
- package/dist/typescript/module/src/doctor/index.d.ts +2 -0
- package/dist/typescript/module/src/doctor/index.d.ts.map +1 -0
- package/dist/typescript/module/src/index.d.ts +2 -0
- package/dist/typescript/module/src/index.d.ts.map +1 -0
- package/dist/typescript/module/src/jest/index.d.ts +14 -0
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -0
- package/dist/typescript/module/src/jest/setup.d.ts +1 -0
- package/dist/typescript/module/src/jest/setup.d.ts.map +1 -0
- package/dist/typescript/module/src/jest/setupAfterEnv.d.ts +1 -0
- package/dist/typescript/module/src/jest/setupAfterEnv.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/index.d.ts +10 -0
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/injection-code.d.ts +2 -0
- package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +3 -0
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/picocolors.d.ts +27 -0
- package/dist/typescript/module/src/metro/picocolors.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/stringify.d.ts +7 -0
- package/dist/typescript/module/src/metro/stringify.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/typescript.d.ts +2 -0
- package/dist/typescript/module/src/metro/typescript.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/index.d.ts +7 -0
- package/dist/typescript/module/src/runtime/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/api.d.ts +17 -0
- package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts +7 -0
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts +6 -0
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts +4 -0
- package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/index.d.ts +4 -0
- package/dist/typescript/module/src/runtime/native/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/injection.d.ts +16 -0
- package/dist/typescript/module/src/runtime/native/injection.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/metro.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/metro.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/react/interaction.d.ts +6 -0
- package/dist/typescript/module/src/runtime/native/react/interaction.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/react/rules.d.ts +6 -0
- package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts +37 -0
- package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/react/usePassthrough.d.ts +4 -0
- package/dist/typescript/module/src/runtime/native/react/usePassthrough.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts +63 -0
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +8 -0
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/constants.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/constants.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/index.d.ts +20 -0
- package/dist/typescript/module/src/runtime/native/styles/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts +14 -0
- package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts +12 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/transform.d.ts +7 -0
- package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/units.d.ts +6 -0
- package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/variables.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/runtime.d.ts +2 -0
- package/dist/typescript/module/src/runtime/runtime.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/runtime.native.d.ts +2 -0
- package/dist/typescript/module/src/runtime/runtime.native.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/runtime.types.d.ts +62 -0
- package/dist/typescript/module/src/runtime/runtime.types.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/utils/components.d.ts +2 -0
- package/dist/typescript/module/src/runtime/utils/components.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/utils/dot-notation.types.d.ts +23 -0
- package/dist/typescript/module/src/runtime/utils/dot-notation.types.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/utils/index.d.ts +6 -0
- package/dist/typescript/module/src/runtime/utils/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/utils/objects.d.ts +4 -0
- package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/utils/specificity.d.ts +12 -0
- package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/utils/style-value.d.ts +3 -0
- package/dist/typescript/module/src/runtime/utils/style-value.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/utils/utils.types.d.ts +5 -0
- package/dist/typescript/module/src/runtime/utils/utils.types.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/web/api.d.ts +10 -0
- package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/web/assign-style.d.ts +2 -0
- package/dist/typescript/module/src/runtime/web/assign-style.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/web/index.d.ts +3 -0
- package/dist/typescript/module/src/runtime/web/index.d.ts.map +1 -0
- package/package.json +191 -47
- package/src/babel/helpers.ts +182 -0
- package/src/babel/import-plugin.ts +183 -0
- package/src/babel/index.ts +9 -0
- package/src/compiler/add.ts +257 -0
- package/src/compiler/compiler.ts +627 -0
- package/src/compiler/compiler.types.ts +372 -0
- package/src/compiler/container-query.ts +97 -0
- package/src/compiler/declarations.ts +3146 -0
- package/src/compiler/functions-web.ts +44 -0
- package/src/compiler/functions.ts +64 -0
- package/src/compiler/index.ts +7 -0
- package/src/compiler/keyframes.ts +100 -0
- package/src/compiler/media-query.ts +250 -0
- package/src/compiler/selectors.ts +473 -0
- package/src/components/ActivityIndicator.tsx +19 -0
- package/src/components/SafeAreaProvider/index.tsx +50 -0
- package/src/components/SafeAreaProvider/index.web.tsx +1 -0
- package/src/components/Text.tsx +15 -0
- package/src/components/TextInput.tsx +20 -0
- package/src/components/View.tsx +15 -0
- package/src/components/index.tsx +4 -0
- package/src/doctor/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/jest/expect.d.ts +1 -0
- package/src/jest/index.ts +40 -0
- package/src/jest/setup.ts +1 -0
- package/src/jest/setupAfterEnv.ts +13 -0
- package/src/metro/index.ts +137 -0
- package/src/metro/injection-code.ts +8 -0
- package/src/metro/metro-transformer.ts +31 -0
- package/src/metro/picocolors.ts +77 -0
- package/src/metro/stringify.ts +59 -0
- package/src/metro/typescript.ts +73 -0
- package/src/runtime/index.ts +7 -0
- package/src/runtime/native/api.ts +106 -0
- package/src/runtime/native/conditions/container-query.ts +157 -0
- package/src/runtime/native/conditions/guards.ts +37 -0
- package/src/runtime/native/conditions/index.ts +106 -0
- package/src/runtime/native/conditions/media-query.ts +92 -0
- package/src/runtime/native/index.ts +5 -0
- package/src/runtime/native/injection.ts +101 -0
- package/src/runtime/native/metro.ts +2 -0
- package/src/runtime/native/react/interaction.ts +90 -0
- package/src/runtime/native/react/rules.ts +333 -0
- package/src/runtime/native/react/useNativeCss.ts +200 -0
- package/src/runtime/native/react/usePassthrough.ts +51 -0
- package/src/runtime/native/reactivity.ts +266 -0
- package/src/runtime/native/styles/animation.ts +142 -0
- package/src/runtime/native/styles/calc.ts +120 -0
- package/src/runtime/native/styles/constants.ts +1 -0
- package/src/runtime/native/styles/defaults.ts +78 -0
- package/src/runtime/native/styles/index.ts +333 -0
- package/src/runtime/native/styles/resolve.ts +131 -0
- package/src/runtime/native/styles/shorthand.ts +101 -0
- package/src/runtime/native/styles/text-shadow.ts +17 -0
- package/src/runtime/native/styles/transform.ts +15 -0
- package/src/runtime/native/styles/units.ts +48 -0
- package/src/runtime/native/styles/variables.ts +72 -0
- package/src/runtime/runtime.native.ts +1 -0
- package/src/runtime/runtime.ts +1 -0
- package/src/runtime/runtime.types.ts +155 -0
- package/src/runtime/utils/components.ts +15 -0
- package/src/runtime/utils/dot-notation.types.ts +118 -0
- package/src/runtime/utils/index.ts +5 -0
- package/src/runtime/utils/objects.ts +82 -0
- package/src/runtime/utils/specificity.ts +44 -0
- package/src/runtime/utils/style-value.ts +12 -0
- package/src/runtime/utils/utils.types.ts +19 -0
- package/src/runtime/web/api.ts +88 -0
- package/src/runtime/web/assign-style.ts +26 -0
- package/src/runtime/web/index.ts +2 -0
- package/.babelrc +0 -17
- package/.editorconfig +0 -17
- package/.eslintignore +0 -3
- package/.eslintrc +0 -39
- package/.npmignore +0 -7
- package/build/index.js +0 -299
- package/build/utils.js +0 -61
- package/circle.yml +0 -31
- package/jsconfig.json +0 -9
- package/login.sh +0 -11
- package/src/index.js +0 -184
- package/src/utils.js +0 -32
- package/test/rnc.test.js +0 -258
- package/yarn.lock +0 -3333
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { InlineVariable, StyleRule } from "../../../compiler";
|
|
3
|
+
import {
|
|
4
|
+
applyValue,
|
|
5
|
+
Specificity as S,
|
|
6
|
+
specificityCompareFn,
|
|
7
|
+
} from "../../utils";
|
|
8
|
+
import type { RenderGuard } from "../conditions/guards";
|
|
9
|
+
import { getInteractionHandler } from "../react/interaction";
|
|
10
|
+
import type { ComponentState, Config } from "../react/useNativeCss";
|
|
11
|
+
import {
|
|
12
|
+
activeFamily,
|
|
13
|
+
containerLayoutFamily,
|
|
14
|
+
family,
|
|
15
|
+
focusFamily,
|
|
16
|
+
hoverFamily,
|
|
17
|
+
observable,
|
|
18
|
+
VAR_SYMBOL,
|
|
19
|
+
type Effect,
|
|
20
|
+
type Getter,
|
|
21
|
+
type VariableContextValue,
|
|
22
|
+
} from "../reactivity";
|
|
23
|
+
import { resolveValue } from "./resolve";
|
|
24
|
+
|
|
25
|
+
export const stylesFamily = family(
|
|
26
|
+
(
|
|
27
|
+
hash: string,
|
|
28
|
+
rules: Set<StyleRule | InlineVariable | VariableContextValue>,
|
|
29
|
+
) => {
|
|
30
|
+
const sortedRules = Array.from(rules).sort(specificityCompareFn);
|
|
31
|
+
|
|
32
|
+
const obs = observable((read) => calculateProps(read, sortedRules));
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A family is a map, so we need to cleanup the observers when the the hash is no longer used
|
|
36
|
+
*/
|
|
37
|
+
return Object.assign(obs, {
|
|
38
|
+
cleanup: (effect: Effect) => {
|
|
39
|
+
obs.observers.delete(effect);
|
|
40
|
+
if (obs.observers.size === 0) {
|
|
41
|
+
stylesFamily.delete(hash);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
function calculateProps(
|
|
49
|
+
get: Getter,
|
|
50
|
+
rules: Array<StyleRule | InlineVariable | VariableContextValue>,
|
|
51
|
+
) {
|
|
52
|
+
let normal: Record<string, any> | undefined;
|
|
53
|
+
let important: Record<string, any> | undefined;
|
|
54
|
+
|
|
55
|
+
const delayedStyles: (() => void)[] = [];
|
|
56
|
+
|
|
57
|
+
const guards: RenderGuard[] = [];
|
|
58
|
+
|
|
59
|
+
const inheritedVariables: VariableContextValue = {
|
|
60
|
+
[VAR_SYMBOL]: true,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const inlineVariables: InlineVariable = {
|
|
64
|
+
[VAR_SYMBOL]: "inline",
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
for (const rule of rules) {
|
|
68
|
+
if (VAR_SYMBOL in rule) {
|
|
69
|
+
if (typeof rule[VAR_SYMBOL] === "string") {
|
|
70
|
+
Object.assign(inlineVariables, rule);
|
|
71
|
+
} else {
|
|
72
|
+
Object.assign(inheritedVariables, rule);
|
|
73
|
+
}
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (rule.v) {
|
|
78
|
+
for (const variable of rule.v) {
|
|
79
|
+
inlineVariables[variable[0]] = variable[1];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (rule.d) {
|
|
84
|
+
let topLevelTarget = rule.s?.[S.Important]
|
|
85
|
+
? (important ??= {})
|
|
86
|
+
: (normal ??= {});
|
|
87
|
+
let target = topLevelTarget;
|
|
88
|
+
|
|
89
|
+
const ruleTarget = rule.target || "style";
|
|
90
|
+
|
|
91
|
+
if (typeof ruleTarget === "string") {
|
|
92
|
+
target = target[ruleTarget] ??= {};
|
|
93
|
+
} else if (ruleTarget) {
|
|
94
|
+
for (const path of ruleTarget) {
|
|
95
|
+
target = target[path] ??= {};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
for (const declaration of rule.d) {
|
|
100
|
+
if (!Array.isArray(declaration)) {
|
|
101
|
+
// Static styles
|
|
102
|
+
Object.assign(target, declaration);
|
|
103
|
+
} else {
|
|
104
|
+
// Dynamic styles
|
|
105
|
+
let value: any = declaration[0];
|
|
106
|
+
let propPath = declaration[1];
|
|
107
|
+
let prop = "";
|
|
108
|
+
|
|
109
|
+
if (typeof propPath === "string") {
|
|
110
|
+
if (propPath.startsWith("^")) {
|
|
111
|
+
propPath = propPath.slice(1);
|
|
112
|
+
target = topLevelTarget[propPath] ??= {};
|
|
113
|
+
}
|
|
114
|
+
prop = propPath;
|
|
115
|
+
} else {
|
|
116
|
+
for (prop of propPath) {
|
|
117
|
+
if (prop.startsWith("^")) {
|
|
118
|
+
prop = prop.slice(1);
|
|
119
|
+
target = topLevelTarget[prop] ??= {};
|
|
120
|
+
} else {
|
|
121
|
+
target = target[prop] ??= {};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (Array.isArray(value)) {
|
|
127
|
+
const shouldDelay = declaration[2];
|
|
128
|
+
|
|
129
|
+
if (shouldDelay) {
|
|
130
|
+
/**
|
|
131
|
+
* We need to delay the resolution of this value until after all
|
|
132
|
+
* styles have been calculated. But another style might override
|
|
133
|
+
* this value. So we set a placeholder value and only override
|
|
134
|
+
* if the placeholder is preserved
|
|
135
|
+
*
|
|
136
|
+
* This also ensures the props exist, so setValue will properly
|
|
137
|
+
* mutate the props object and not create a new one
|
|
138
|
+
*/
|
|
139
|
+
const originalValue = value;
|
|
140
|
+
value = {};
|
|
141
|
+
delayedStyles.push(() => {
|
|
142
|
+
if (target[prop] === value) {
|
|
143
|
+
delete target[prop];
|
|
144
|
+
value = resolveValue(originalValue, get, {
|
|
145
|
+
inlineVariables,
|
|
146
|
+
inheritedVariables,
|
|
147
|
+
renderGuards: guards,
|
|
148
|
+
});
|
|
149
|
+
applyValue(target, prop, value);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
} else {
|
|
153
|
+
value = resolveValue(value, get, {
|
|
154
|
+
inlineVariables,
|
|
155
|
+
inheritedVariables,
|
|
156
|
+
renderGuards: guards,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
applyValue(target, prop, value);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
for (const delayedStyle of delayedStyles) {
|
|
168
|
+
delayedStyle();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return {
|
|
172
|
+
normal,
|
|
173
|
+
guards,
|
|
174
|
+
important,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function getStyledProps(
|
|
179
|
+
state: ComponentState,
|
|
180
|
+
inline: Record<string, any> | undefined | null,
|
|
181
|
+
) {
|
|
182
|
+
let result: Record<string, any> | undefined;
|
|
183
|
+
|
|
184
|
+
const styledProps = state.stylesObs?.get(state.styleEffect);
|
|
185
|
+
|
|
186
|
+
for (const config of state.configs) {
|
|
187
|
+
result = deepMergeConfig(config, styledProps?.normal, inline, true);
|
|
188
|
+
|
|
189
|
+
if (styledProps?.important) {
|
|
190
|
+
result = deepMergeConfig(config, result, styledProps.important);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Apply the handlers
|
|
194
|
+
if (hoverFamily.has(state.ruleEffect)) {
|
|
195
|
+
result ??= {};
|
|
196
|
+
result.onHoverIn = getInteractionHandler(
|
|
197
|
+
state.ruleEffect,
|
|
198
|
+
"onHoverIn",
|
|
199
|
+
inline?.onHoverIn,
|
|
200
|
+
);
|
|
201
|
+
result.onHoverOut = getInteractionHandler(
|
|
202
|
+
state.ruleEffect,
|
|
203
|
+
"onHoverOut",
|
|
204
|
+
inline?.onHoverOut,
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (activeFamily.has(state.ruleEffect)) {
|
|
209
|
+
result ??= {};
|
|
210
|
+
result.onPress = getInteractionHandler(
|
|
211
|
+
state.ruleEffect,
|
|
212
|
+
"onPress",
|
|
213
|
+
inline?.onPress,
|
|
214
|
+
);
|
|
215
|
+
result.onPressIn = getInteractionHandler(
|
|
216
|
+
state.ruleEffect,
|
|
217
|
+
"onPressIn",
|
|
218
|
+
inline?.onPressIn,
|
|
219
|
+
);
|
|
220
|
+
result.onPressOut = getInteractionHandler(
|
|
221
|
+
state.ruleEffect,
|
|
222
|
+
"onPressOut",
|
|
223
|
+
inline?.onPressOut,
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (focusFamily.has(state.ruleEffect)) {
|
|
228
|
+
result ??= {};
|
|
229
|
+
result.onBlur = getInteractionHandler(
|
|
230
|
+
state.ruleEffect,
|
|
231
|
+
"onBlur",
|
|
232
|
+
inline?.onBlur,
|
|
233
|
+
);
|
|
234
|
+
result.onFocus = getInteractionHandler(
|
|
235
|
+
state.ruleEffect,
|
|
236
|
+
"onFocus",
|
|
237
|
+
inline?.onFocus,
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (containerLayoutFamily.has(state.ruleEffect)) {
|
|
242
|
+
result ??= {};
|
|
243
|
+
result.onLayout = getInteractionHandler(
|
|
244
|
+
state.ruleEffect,
|
|
245
|
+
"onLayout",
|
|
246
|
+
inline?.onLayout,
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return result;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function deepMergeConfig(
|
|
255
|
+
config: Config,
|
|
256
|
+
left: Record<string, any> | undefined,
|
|
257
|
+
right: Record<string, any> | undefined | null,
|
|
258
|
+
rightIsInline = false,
|
|
259
|
+
) {
|
|
260
|
+
if (!config.target || !right) {
|
|
261
|
+
return { ...left };
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
let result = Object.assign({}, left, right);
|
|
265
|
+
|
|
266
|
+
if (
|
|
267
|
+
right &&
|
|
268
|
+
rightIsInline &&
|
|
269
|
+
config.source in right &&
|
|
270
|
+
config.target !== config.source
|
|
271
|
+
) {
|
|
272
|
+
delete result[config.source];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* If target is a path, deep merge until we get to the last key
|
|
277
|
+
*/
|
|
278
|
+
if (Array.isArray(config.target) && config.target.length > 1) {
|
|
279
|
+
for (let i = 0; i < config.target.length - 1; i++) {
|
|
280
|
+
const key = config.target[i];
|
|
281
|
+
|
|
282
|
+
if (key === undefined) {
|
|
283
|
+
return result;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
result[key] = deepMergeConfig(
|
|
287
|
+
{ source: config.source, target: config.target.slice(i + 1) },
|
|
288
|
+
left?.[key],
|
|
289
|
+
right?.[key],
|
|
290
|
+
rightIsInline,
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
return result;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const target = Array.isArray(config.target)
|
|
298
|
+
? config.target[0]
|
|
299
|
+
: config.target;
|
|
300
|
+
|
|
301
|
+
if (target === undefined) {
|
|
302
|
+
return result;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
let rightValue = right?.[target];
|
|
306
|
+
|
|
307
|
+
// Strip any inline variables from the target
|
|
308
|
+
if (rightIsInline && rightValue) {
|
|
309
|
+
if (Array.isArray(rightValue)) {
|
|
310
|
+
rightValue = rightValue.filter((v) => {
|
|
311
|
+
return typeof v !== "object" || !(v && VAR_SYMBOL in v);
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
if (rightValue.length === 0) {
|
|
315
|
+
rightValue = undefined;
|
|
316
|
+
}
|
|
317
|
+
} else if (
|
|
318
|
+
typeof rightValue === "object" &&
|
|
319
|
+
rightValue &&
|
|
320
|
+
VAR_SYMBOL in rightValue
|
|
321
|
+
) {
|
|
322
|
+
rightValue = undefined;
|
|
323
|
+
delete result[target][VAR_SYMBOL];
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (rightValue !== undefined) {
|
|
328
|
+
result[target] =
|
|
329
|
+
left && target in left ? [left[target], rightValue] : rightValue;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
return result;
|
|
333
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type {
|
|
3
|
+
InlineVariable,
|
|
4
|
+
StyleDescriptor,
|
|
5
|
+
StyleFunction,
|
|
6
|
+
} from "../../../compiler";
|
|
7
|
+
import type { RenderGuard } from "../conditions/guards";
|
|
8
|
+
import { type Getter, type VariableContextValue } from "../reactivity";
|
|
9
|
+
import { animation } from "./animation";
|
|
10
|
+
import { calc } from "./calc";
|
|
11
|
+
import { transformKeys } from "./defaults";
|
|
12
|
+
import { textShadow } from "./text-shadow";
|
|
13
|
+
import { transform } from "./transform";
|
|
14
|
+
import { em, rem, vh, vw } from "./units";
|
|
15
|
+
import { varResolver } from "./variables";
|
|
16
|
+
|
|
17
|
+
export type SimpleResolveValue = (
|
|
18
|
+
value: StyleDescriptor,
|
|
19
|
+
castToArray?: boolean,
|
|
20
|
+
) => any;
|
|
21
|
+
|
|
22
|
+
export type StyleFunctionResolver = (
|
|
23
|
+
resolveValue: SimpleResolveValue,
|
|
24
|
+
value: StyleFunction,
|
|
25
|
+
get: Getter,
|
|
26
|
+
options: ResolveValueOptions,
|
|
27
|
+
) => any;
|
|
28
|
+
|
|
29
|
+
const functions: Record<string, StyleFunctionResolver> = {
|
|
30
|
+
calc,
|
|
31
|
+
em,
|
|
32
|
+
vw,
|
|
33
|
+
vh,
|
|
34
|
+
rem,
|
|
35
|
+
"@textShadow": textShadow,
|
|
36
|
+
"@transform": transform,
|
|
37
|
+
animationName: animation,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type ResolveValueOptions = {
|
|
41
|
+
castToArray?: boolean;
|
|
42
|
+
inheritedVariables?: VariableContextValue;
|
|
43
|
+
inlineVariables?: InlineVariable | undefined;
|
|
44
|
+
renderGuards?: RenderGuard[];
|
|
45
|
+
variableHistory?: Set<string>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export function resolveValue(
|
|
49
|
+
value: StyleDescriptor,
|
|
50
|
+
get: Getter,
|
|
51
|
+
options: ResolveValueOptions,
|
|
52
|
+
): any {
|
|
53
|
+
const { castToArray } = options;
|
|
54
|
+
|
|
55
|
+
switch (typeof value) {
|
|
56
|
+
case "bigint":
|
|
57
|
+
case "symbol":
|
|
58
|
+
case "undefined":
|
|
59
|
+
case "function":
|
|
60
|
+
// These types are not supported
|
|
61
|
+
return;
|
|
62
|
+
case "number":
|
|
63
|
+
case "boolean":
|
|
64
|
+
return value;
|
|
65
|
+
case "string":
|
|
66
|
+
return value.endsWith("px") // Inline vars() might set a value with a px suffix
|
|
67
|
+
? parseInt(value.slice(0, -2), 10)
|
|
68
|
+
: value;
|
|
69
|
+
case "object": {
|
|
70
|
+
if (!Array.isArray(value)) {
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (isDescriptorArray(value)) {
|
|
75
|
+
value = value.flatMap((d) => {
|
|
76
|
+
const value = resolveValue(d, get, options);
|
|
77
|
+
return value === undefined ? [] : value;
|
|
78
|
+
}) as StyleDescriptor[];
|
|
79
|
+
|
|
80
|
+
if (castToArray && !Array.isArray(value)) {
|
|
81
|
+
return [value];
|
|
82
|
+
} else {
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const name = value[1];
|
|
88
|
+
|
|
89
|
+
const simpleResolve: SimpleResolveValue = (value) => {
|
|
90
|
+
return resolveValue(value, get, options);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
if (name === "var") {
|
|
94
|
+
return varResolver(simpleResolve, value, get, options);
|
|
95
|
+
} else if (name in functions) {
|
|
96
|
+
const fn = functions[name];
|
|
97
|
+
|
|
98
|
+
if (typeof fn !== "function") {
|
|
99
|
+
throw new Error(`Unknown function: ${name}`);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
value = fn(simpleResolve, value as StyleFunction, get, options);
|
|
103
|
+
} else if (transformKeys.has(name)) {
|
|
104
|
+
// translate, rotate, scale, etc.
|
|
105
|
+
return simpleResolve(value[2]?.[0], castToArray);
|
|
106
|
+
} else if (transformKeys.has(name.slice(1))) {
|
|
107
|
+
// @translate, @rotate, @scale, etc.
|
|
108
|
+
return { [name.slice(1)]: simpleResolve(value[2], castToArray)[0] };
|
|
109
|
+
} else {
|
|
110
|
+
const args = simpleResolve(value[2], castToArray);
|
|
111
|
+
if (args === undefined) {
|
|
112
|
+
return;
|
|
113
|
+
} else if (Array.isArray(args)) {
|
|
114
|
+
value = `${name}(${args.join(", ")})`;
|
|
115
|
+
} else {
|
|
116
|
+
value = `${name}(${args})`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return castToArray && value && !Array.isArray(value) ? [value] : value;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function isDescriptorArray(
|
|
126
|
+
value: StyleDescriptor | StyleDescriptor[],
|
|
127
|
+
): value is StyleDescriptor[] {
|
|
128
|
+
return Array.isArray(value) && typeof value[0] === "object"
|
|
129
|
+
? Array.isArray(value[0])
|
|
130
|
+
: true;
|
|
131
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { StyleDescriptor } from "../../../compiler";
|
|
3
|
+
import { defaultValues } from "./defaults";
|
|
4
|
+
import type { StyleFunctionResolver } from "./resolve";
|
|
5
|
+
|
|
6
|
+
type ShorthandType =
|
|
7
|
+
| "string"
|
|
8
|
+
| "number"
|
|
9
|
+
| "length"
|
|
10
|
+
| "color"
|
|
11
|
+
| Readonly<string[]>;
|
|
12
|
+
|
|
13
|
+
type ShorthandRequiredValue =
|
|
14
|
+
| readonly [string | readonly string[], ShorthandType]
|
|
15
|
+
| ShorthandDefaultValue;
|
|
16
|
+
|
|
17
|
+
type ShorthandDefaultValue = readonly [
|
|
18
|
+
string | readonly string[],
|
|
19
|
+
ShorthandType,
|
|
20
|
+
any,
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export const ShortHandSymbol = Symbol();
|
|
24
|
+
|
|
25
|
+
export function shorthandHandler(
|
|
26
|
+
mappings: ShorthandRequiredValue[][],
|
|
27
|
+
defaults: ShorthandDefaultValue[],
|
|
28
|
+
) {
|
|
29
|
+
const resolveFn: StyleFunctionResolver = (
|
|
30
|
+
resolveValue,
|
|
31
|
+
func,
|
|
32
|
+
_,
|
|
33
|
+
{ castToArray },
|
|
34
|
+
) => {
|
|
35
|
+
const args = func[2] || [];
|
|
36
|
+
|
|
37
|
+
const resolved = args.flatMap((value) => {
|
|
38
|
+
return resolveValue(value, castToArray);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const match = mappings.find((mapping) => {
|
|
42
|
+
return (
|
|
43
|
+
resolved.length === mapping.length &&
|
|
44
|
+
mapping.every((map, index) => {
|
|
45
|
+
const type = map[1];
|
|
46
|
+
const value = resolved[index];
|
|
47
|
+
|
|
48
|
+
if (Array.isArray(type)) {
|
|
49
|
+
return type.includes(value);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
switch (type) {
|
|
53
|
+
case "string":
|
|
54
|
+
case "number":
|
|
55
|
+
return typeof value === type;
|
|
56
|
+
case "color":
|
|
57
|
+
return typeof value === "string" || typeof value === "object";
|
|
58
|
+
case "length":
|
|
59
|
+
return typeof value === "string"
|
|
60
|
+
? value.endsWith("%")
|
|
61
|
+
: typeof value === "number";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return;
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
if (!match) return;
|
|
70
|
+
|
|
71
|
+
const seenDefaults = new Set(defaults);
|
|
72
|
+
|
|
73
|
+
return Object.assign(
|
|
74
|
+
[
|
|
75
|
+
...match.map((map, index): StyleDescriptor => {
|
|
76
|
+
if (map.length === 3) {
|
|
77
|
+
seenDefaults.delete(map);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let value = resolved[index];
|
|
81
|
+
if (castToArray && value && !Array.isArray(value)) {
|
|
82
|
+
value = [value];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return [value, map[0]];
|
|
86
|
+
}),
|
|
87
|
+
...Array.from(seenDefaults).map((map): StyleDescriptor => {
|
|
88
|
+
let value = defaultValues[map[2]] ?? map[2];
|
|
89
|
+
if (castToArray && value && !Array.isArray(value)) {
|
|
90
|
+
value = [value];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return [value, map[0]];
|
|
94
|
+
}),
|
|
95
|
+
],
|
|
96
|
+
{ [ShortHandSymbol]: true },
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return resolveFn;
|
|
101
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { shorthandHandler } from "./shorthand";
|
|
2
|
+
|
|
3
|
+
const width = [["textShadowOffset", "width"], "number"] as const;
|
|
4
|
+
const height = [["textShadowOffset", "height"], "number"] as const;
|
|
5
|
+
const blur = ["textShadowRadius", "number", "textShadowRadius"] as const;
|
|
6
|
+
const color = ["textShadowColor", "color", "color"] as const;
|
|
7
|
+
|
|
8
|
+
export const textShadow = shorthandHandler(
|
|
9
|
+
[
|
|
10
|
+
[width, height, blur, color],
|
|
11
|
+
[color, width, height, blur],
|
|
12
|
+
[width, height, color],
|
|
13
|
+
[color, width, height],
|
|
14
|
+
[width, height],
|
|
15
|
+
],
|
|
16
|
+
[blur, color],
|
|
17
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { StyleFunctionResolver } from "./resolve";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Handle the unparsable transform property by converting its values into StyleDeclarations
|
|
6
|
+
* Each value should be a StyleDescriptor function of the transform type
|
|
7
|
+
*/
|
|
8
|
+
export const transform: StyleFunctionResolver = (
|
|
9
|
+
resolveValue,
|
|
10
|
+
transformDescriptor,
|
|
11
|
+
) => {
|
|
12
|
+
return (transformDescriptor[2] as any[])
|
|
13
|
+
.map((args) => resolveValue(args))
|
|
14
|
+
.filter(Boolean);
|
|
15
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { rem as remObs, vh as vhObs, vw as vwObs } from "../reactivity";
|
|
3
|
+
import type { StyleFunctionResolver } from "./resolve";
|
|
4
|
+
|
|
5
|
+
export const em: StyleFunctionResolver = (resolve, func) => {
|
|
6
|
+
let value = func[2]?.[0];
|
|
7
|
+
|
|
8
|
+
if (!value) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const emValue = resolve([{}, "var", ["__rn-css-em"]]);
|
|
13
|
+
return round(Number(value) * emValue);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const vw: StyleFunctionResolver = (_, func, get) => {
|
|
17
|
+
const value = func[2]?.[0];
|
|
18
|
+
|
|
19
|
+
if (typeof value !== "number") {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return round(get(vwObs) * (value / 100));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const vh: StyleFunctionResolver = (_, func, get) => {
|
|
27
|
+
const value = func[2]?.[0];
|
|
28
|
+
|
|
29
|
+
if (typeof value !== "number") {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return round((value / 100) * get(vhObs));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const rem: StyleFunctionResolver = (_, func, get) => {
|
|
37
|
+
const value = func[2]?.[0];
|
|
38
|
+
|
|
39
|
+
if (typeof value !== "number") {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return round(value * get(remObs));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
function round(number: number) {
|
|
47
|
+
return Math.round((number + Number.EPSILON) * 100) / 100;
|
|
48
|
+
}
|