@luckylca/react-native-liquid-glass 0.0.0-stage → 0.3.0
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 +21 -0
- package/README.md +294 -2
- package/README.zh-CN.md +297 -0
- package/THIRD_PARTY_NOTICES.md +98 -0
- package/android/build.gradle +19 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/expo/modules/liquidglass/EffectiveScrollInputBridge.kt +47 -0
- package/android/src/main/java/expo/modules/liquidglass/GlassCaptureView.kt +1125 -0
- package/android/src/main/java/expo/modules/liquidglass/GlassRegistry.kt +75 -0
- package/android/src/main/java/expo/modules/liquidglass/GlassSurfaceView.kt +571 -0
- package/android/src/main/java/expo/modules/liquidglass/LiquidGlassModule.kt +205 -0
- package/android/src/main/java/expo/modules/liquidglass/LocalMaterialView.kt +138 -0
- package/android/src/main/java/expo/modules/liquidglass/PassSurfaceSuppression.kt +39 -0
- package/android/src/main/java/expo/modules/liquidglass/SharedGlassPassProbeLog.kt +23 -0
- package/android/src/main/java/expo/modules/liquidglass/SharedGlassPassWiring.kt +59 -0
- package/android-core/build.gradle +36 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/BackdropRecorder.kt +930 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/FrozenBackdrop.kt +66 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassBackdropCoordinator.kt +624 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassBackdropSourceHandle.kt +8 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassScrollSource.kt +13 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassViewController.kt +1002 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/LiquidGlassProviderLayout.kt +340 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/LiquidGlassView.kt +103 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/ReferenceSourceWindowPolicy.kt +13 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/StableSceneTexturePolicy.kt +43 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/SurfaceFrameBuilder.kt +278 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/SurfaceInteraction.kt +359 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/GlassFrame.kt +110 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/GlassViewRenderer.kt +728 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/ReferenceParityPasses.kt +705 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/ReferenceTabSampling.kt +15 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/SharedSceneCapture.kt +163 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassCapabilities.kt +21 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassEngine.kt +131 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassMaterial.kt +89 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassMath.kt +131 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassOpticalInsets.kt +8 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassRenderTier.kt +54 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassShapePacker.kt +77 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassSurfaceState.kt +11 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassUniforms.kt +113 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/LiquidGlassShaders.kt +234 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/SharedGlassPass.kt +456 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/geometry/G2RoundedRectangle.kt +207 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/geometry/ReferenceG2MaskTexture.kt +334 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/HeightFieldGlassShader.kt +7 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceBackdropBlurShader.kt +58 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceGaussianDiscBackdropBlur.kt +42 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceGlassUniforms.kt +111 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceParityGlassShader.kt +613 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceParityMultiShapeShader.kt +128 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/SdfScaleLensShader.kt +144 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassHardwareLayerExperiment.kt +29 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassMaterial.kt +14 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassRenderer.kt +126 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassRuntimeShader.kt +50 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassShader.kt +59 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassView.kt +47 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/GlassMotionDriver.kt +824 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/GlassMotionState.kt +359 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/PointerVelocityTracker.kt +109 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/SpringSpec.kt +209 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/G2Corner.kt +194 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassMaterial.kt +250 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassOpticsShader.kt +696 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassParityProbe.kt +342 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassShapeGeometry.kt +317 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassUniformBinder.kt +308 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/PixelDiff.kt +363 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/ReferenceOptics.kt +568 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/rendering/GlassSurfaceHost.kt +317 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/rendering/GlassSurfaceRenderer.kt +847 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/rendering/RetainedBackdropLayer.kt +83 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/scheduler/GlassFrameScheduler.kt +27 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/EffectiveScrollFpsProbe.kt +965 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/GlassTelemetry.kt +16 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/LiquidGlassPerfTelemetry.kt +676 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/LiquidGlassTrace.kt +30 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/LocalGlassTelemetry.kt +55 -0
- package/app.plugin.js +25 -0
- package/docs/architecture.md +61 -0
- package/docs/images/buttons.webp +0 -0
- package/docs/images/controls.webp +0 -0
- package/docs/images/tabs.webp +0 -0
- package/docs/migration-0.3.md +19 -0
- package/docs/publishing.md +106 -0
- package/expo-module.config.json +10 -0
- package/lib/commonjs/GlassSurface.js +404 -0
- package/lib/commonjs/GlassSurface.js.map +1 -0
- package/lib/commonjs/GlassTabBar.js +37 -0
- package/lib/commonjs/GlassTabBar.js.map +1 -0
- package/lib/commonjs/GlassTabLens.js +67 -0
- package/lib/commonjs/GlassTabLens.js.map +1 -0
- package/lib/commonjs/LiquidGlassProvider.js +40 -0
- package/lib/commonjs/LiquidGlassProvider.js.map +1 -0
- package/lib/commonjs/LocalGlassMaterial.js +188 -0
- package/lib/commonjs/LocalGlassMaterial.js.map +1 -0
- package/lib/commonjs/adaptiveLuminance.js +14 -0
- package/lib/commonjs/adaptiveLuminance.js.map +1 -0
- package/lib/commonjs/badgePalette.js +46 -0
- package/lib/commonjs/badgePalette.js.map +1 -0
- package/lib/commonjs/buttonGesturePolicy.js +22 -0
- package/lib/commonjs/buttonGesturePolicy.js.map +1 -0
- package/lib/commonjs/components/AdaptiveLuminance.js +20 -0
- package/lib/commonjs/components/AdaptiveLuminance.js.map +1 -0
- package/lib/commonjs/components/BottomSheet.js +222 -0
- package/lib/commonjs/components/BottomSheet.js.map +1 -0
- package/lib/commonjs/components/Button.js +20 -0
- package/lib/commonjs/components/Button.js.map +1 -0
- package/lib/commonjs/components/Card.js +206 -0
- package/lib/commonjs/components/Card.js.map +1 -0
- package/lib/commonjs/components/Checkbox.js +123 -0
- package/lib/commonjs/components/Checkbox.js.map +1 -0
- package/lib/commonjs/components/ControlPressContext.js +8 -0
- package/lib/commonjs/components/ControlPressContext.js.map +1 -0
- package/lib/commonjs/components/Dialog.js +122 -0
- package/lib/commonjs/components/Dialog.js.map +1 -0
- package/lib/commonjs/components/DialogAction.js +124 -0
- package/lib/commonjs/components/DialogAction.js.map +1 -0
- package/lib/commonjs/components/DialogContent.js +23 -0
- package/lib/commonjs/components/DialogContent.js.map +1 -0
- package/lib/commonjs/components/GlassButton.js +96 -0
- package/lib/commonjs/components/GlassButton.js.map +1 -0
- package/lib/commonjs/components/GlassFab.js +43 -0
- package/lib/commonjs/components/GlassFab.js.map +1 -0
- package/lib/commonjs/components/GlassMagnifier.js +135 -0
- package/lib/commonjs/components/GlassMagnifier.js.map +1 -0
- package/lib/commonjs/components/GlassPlayground.js +158 -0
- package/lib/commonjs/components/GlassPlayground.js.map +1 -0
- package/lib/commonjs/components/GlassSlider.js +364 -0
- package/lib/commonjs/components/GlassSlider.js.map +1 -0
- package/lib/commonjs/components/GlassSwitch.js +334 -0
- package/lib/commonjs/components/GlassSwitch.js.map +1 -0
- package/lib/commonjs/components/GlassTabBar.js +387 -0
- package/lib/commonjs/components/GlassTabBar.js.map +1 -0
- package/lib/commonjs/components/Input.js +180 -0
- package/lib/commonjs/components/Input.js.map +1 -0
- package/lib/commonjs/components/ListRow.js +64 -0
- package/lib/commonjs/components/ListRow.js.map +1 -0
- package/lib/commonjs/components/Menu.js +214 -0
- package/lib/commonjs/components/Menu.js.map +1 -0
- package/lib/commonjs/components/NavigationBar.js +20 -0
- package/lib/commonjs/components/NavigationBar.js.map +1 -0
- package/lib/commonjs/components/NumberWheel.js +273 -0
- package/lib/commonjs/components/NumberWheel.js.map +1 -0
- package/lib/commonjs/components/PageFeedList.js +25 -0
- package/lib/commonjs/components/PageFeedList.js.map +1 -0
- package/lib/commonjs/components/PageScaffold.js +161 -0
- package/lib/commonjs/components/PageScaffold.js.map +1 -0
- package/lib/commonjs/components/PreferenceGroup.js +34 -0
- package/lib/commonjs/components/PreferenceGroup.js.map +1 -0
- package/lib/commonjs/components/ProgressIndicator.js +79 -0
- package/lib/commonjs/components/ProgressIndicator.js.map +1 -0
- package/lib/commonjs/components/ProgressiveBlur.js +29 -0
- package/lib/commonjs/components/ProgressiveBlur.js.map +1 -0
- package/lib/commonjs/components/ReferenceSlider.js +304 -0
- package/lib/commonjs/components/ReferenceSlider.js.map +1 -0
- package/lib/commonjs/components/ReferenceTabBar.js +381 -0
- package/lib/commonjs/components/ReferenceTabBar.js.map +1 -0
- package/lib/commonjs/components/SearchBar.js +200 -0
- package/lib/commonjs/components/SearchBar.js.map +1 -0
- package/lib/commonjs/components/SegmentedControl.js +62 -0
- package/lib/commonjs/components/SegmentedControl.js.map +1 -0
- package/lib/commonjs/components/Slider.js +12 -0
- package/lib/commonjs/components/Slider.js.map +1 -0
- package/lib/commonjs/components/Snackbar.js +11 -0
- package/lib/commonjs/components/Snackbar.js.map +1 -0
- package/lib/commonjs/components/SurfaceEnvironmentContext.js +35 -0
- package/lib/commonjs/components/SurfaceEnvironmentContext.js.map +1 -0
- package/lib/commonjs/components/SurfaceGroup.js +39 -0
- package/lib/commonjs/components/SurfaceGroup.js.map +1 -0
- package/lib/commonjs/components/Switch.js +11 -0
- package/lib/commonjs/components/Switch.js.map +1 -0
- package/lib/commonjs/components/Toast.js +110 -0
- package/lib/commonjs/components/Toast.js.map +1 -0
- package/lib/commonjs/components/TopAppBar.js +107 -0
- package/lib/commonjs/components/TopAppBar.js.map +1 -0
- package/lib/commonjs/components/bottomSheetMotion.js +14 -0
- package/lib/commonjs/components/bottomSheetMotion.js.map +1 -0
- package/lib/commonjs/components/glassControlMaterial.js +22 -0
- package/lib/commonjs/components/glassControlMaterial.js.map +1 -0
- package/lib/commonjs/components/menuPosition.js +42 -0
- package/lib/commonjs/components/menuPosition.js.map +1 -0
- package/lib/commonjs/components/pages/FeedPage.js +15 -0
- package/lib/commonjs/components/pages/FeedPage.js.map +1 -0
- package/lib/commonjs/components/pages/PageBenchmarkContext.js +123 -0
- package/lib/commonjs/components/pages/PageBenchmarkContext.js.map +1 -0
- package/lib/commonjs/components/pages/SettingsPage.js +47 -0
- package/lib/commonjs/components/pages/SettingsPage.js.map +1 -0
- package/lib/commonjs/components/pages/SettingsSection.js +14 -0
- package/lib/commonjs/components/pages/SettingsSection.js.map +1 -0
- package/lib/commonjs/components/pages/StaticSettingsPage.js +16 -0
- package/lib/commonjs/components/pages/StaticSettingsPage.js.map +1 -0
- package/lib/commonjs/fallbackKnobGeometry.js +19 -0
- package/lib/commonjs/fallbackKnobGeometry.js.map +1 -0
- package/lib/commonjs/glassController.js +61 -0
- package/lib/commonjs/glassController.js.map +1 -0
- package/lib/commonjs/glassNativeEngine.js +16 -0
- package/lib/commonjs/glassNativeEngine.js.map +1 -0
- package/lib/commonjs/glassRuntime.js +15 -0
- package/lib/commonjs/glassRuntime.js.map +1 -0
- package/lib/commonjs/index.js +218 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/inputPresentation.js +17 -0
- package/lib/commonjs/inputPresentation.js.map +1 -0
- package/lib/commonjs/localGlassTelemetry.js +104 -0
- package/lib/commonjs/localGlassTelemetry.js.map +1 -0
- package/lib/commonjs/motion/MotionProvider.js +15 -0
- package/lib/commonjs/motion/MotionProvider.js.map +1 -0
- package/lib/commonjs/motion/easings.js +71 -0
- package/lib/commonjs/motion/easings.js.map +1 -0
- package/lib/commonjs/motion/folmeSpring.js +24 -0
- package/lib/commonjs/motion/folmeSpring.js.map +1 -0
- package/lib/commonjs/motion/folmeSpringByResponse.js +22 -0
- package/lib/commonjs/motion/folmeSpringByResponse.js.map +1 -0
- package/lib/commonjs/motion/index.js +57 -0
- package/lib/commonjs/motion/index.js.map +1 -0
- package/lib/commonjs/motion/presets.js +101 -0
- package/lib/commonjs/motion/presets.js.map +1 -0
- package/lib/commonjs/nativeGlassViews.js +30 -0
- package/lib/commonjs/nativeGlassViews.js.map +1 -0
- package/lib/commonjs/performanceTelemetry.js +24 -0
- package/lib/commonjs/performanceTelemetry.js.map +1 -0
- package/lib/commonjs/pointerEventBridge.js +17 -0
- package/lib/commonjs/pointerEventBridge.js.map +1 -0
- package/lib/commonjs/pointerGeometry.js +12 -0
- package/lib/commonjs/pointerGeometry.js.map +1 -0
- package/lib/commonjs/pressVelocity.js +34 -0
- package/lib/commonjs/pressVelocity.js.map +1 -0
- package/lib/commonjs/primitives/Divider.js +32 -0
- package/lib/commonjs/primitives/Divider.js.map +1 -0
- package/lib/commonjs/primitives/Icon.js +22 -0
- package/lib/commonjs/primitives/Icon.js.map +1 -0
- package/lib/commonjs/primitives/PressIndication.js +58 -0
- package/lib/commonjs/primitives/PressIndication.js.map +1 -0
- package/lib/commonjs/primitives/Pressable.js +28 -0
- package/lib/commonjs/primitives/Pressable.js.map +1 -0
- package/lib/commonjs/primitives/PressableScale.js +64 -0
- package/lib/commonjs/primitives/PressableScale.js.map +1 -0
- package/lib/commonjs/primitives/Surface.js +122 -0
- package/lib/commonjs/primitives/Surface.js.map +1 -0
- package/lib/commonjs/primitives/Text.js +43 -0
- package/lib/commonjs/primitives/Text.js.map +1 -0
- package/lib/commonjs/primitives/index.js +18 -0
- package/lib/commonjs/primitives/index.js.map +1 -0
- package/lib/commonjs/renderer.js +58 -0
- package/lib/commonjs/renderer.js.map +1 -0
- package/lib/commonjs/sliderValue.js +28 -0
- package/lib/commonjs/sliderValue.js.map +1 -0
- package/lib/commonjs/surface/InlineSurface.js +134 -0
- package/lib/commonjs/surface/InlineSurface.js.map +1 -0
- package/lib/commonjs/surface/MaterialProvider.js +78 -0
- package/lib/commonjs/surface/MaterialProvider.js.map +1 -0
- package/lib/commonjs/surface/NativeSurface.js +55 -0
- package/lib/commonjs/surface/NativeSurface.js.map +1 -0
- package/lib/commonjs/surface/PortalLayers.js +331 -0
- package/lib/commonjs/surface/PortalLayers.js.map +1 -0
- package/lib/commonjs/surface/contexts.js +108 -0
- package/lib/commonjs/surface/contexts.js.map +1 -0
- package/lib/commonjs/surface/registry.js +113 -0
- package/lib/commonjs/surface/registry.js.map +1 -0
- package/lib/commonjs/surface/styles.js +34 -0
- package/lib/commonjs/surface/styles.js.map +1 -0
- package/lib/commonjs/surface/types.js +3 -0
- package/lib/commonjs/surface/types.js.map +1 -0
- package/lib/commonjs/surfaceRendererPolicy.js +32 -0
- package/lib/commonjs/surfaceRendererPolicy.js.map +1 -0
- package/lib/commonjs/tabs/GlassTabItem.js +66 -0
- package/lib/commonjs/tabs/GlassTabItem.js.map +1 -0
- package/lib/commonjs/tabs/InlineTabBar.js +867 -0
- package/lib/commonjs/tabs/InlineTabBar.js.map +1 -0
- package/lib/commonjs/tabs/tabConstants.js +22 -0
- package/lib/commonjs/tabs/tabConstants.js.map +1 -0
- package/lib/commonjs/tabs/tabDebug.js +50 -0
- package/lib/commonjs/tabs/tabDebug.js.map +1 -0
- package/lib/commonjs/tabs/tabStyles.js +107 -0
- package/lib/commonjs/tabs/tabStyles.js.map +1 -0
- package/lib/commonjs/tabs/useInlineTabGesture.js +227 -0
- package/lib/commonjs/tabs/useInlineTabGesture.js.map +1 -0
- package/lib/commonjs/theme/ThemeProvider.js +37 -0
- package/lib/commonjs/theme/ThemeProvider.js.map +1 -0
- package/lib/commonjs/theme/buildTheme.js +157 -0
- package/lib/commonjs/theme/buildTheme.js.map +1 -0
- package/lib/commonjs/theme/glassColors.js +17 -0
- package/lib/commonjs/theme/glassColors.js.map +1 -0
- package/lib/commonjs/theme/index.js +38 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/liquidGlass.js +24 -0
- package/lib/commonjs/theme/liquidGlass.js.map +1 -0
- package/lib/commonjs/theme/presentation.js +14 -0
- package/lib/commonjs/theme/presentation.js.map +1 -0
- package/lib/commonjs/theme/registry.js +17 -0
- package/lib/commonjs/theme/registry.js.map +1 -0
- package/lib/commonjs/theme/selectVariant.js +13 -0
- package/lib/commonjs/theme/selectVariant.js.map +1 -0
- package/lib/commonjs/theme/tokens.js +266 -0
- package/lib/commonjs/theme/tokens.js.map +1 -0
- package/lib/commonjs/theme/types.js +3 -0
- package/lib/commonjs/theme/types.js.map +1 -0
- package/lib/commonjs/theme/wallpaper.js +91 -0
- package/lib/commonjs/theme/wallpaper.js.map +1 -0
- package/lib/commonjs/types.js +3 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/useButtonGesture.js +135 -0
- package/lib/commonjs/useButtonGesture.js.map +1 -0
- package/lib/commonjs/useGlassKnobMotion.js +115 -0
- package/lib/commonjs/useGlassKnobMotion.js.map +1 -0
- package/lib/commonjs/useGlassPressMotion.js +147 -0
- package/lib/commonjs/useGlassPressMotion.js.map +1 -0
- package/lib/module/GlassSurface.js +354 -0
- package/lib/module/GlassSurface.js.map +1 -0
- package/lib/module/GlassTabBar.js +32 -0
- package/lib/module/GlassTabBar.js.map +1 -0
- package/lib/module/GlassTabLens.js +64 -0
- package/lib/module/GlassTabLens.js.map +1 -0
- package/lib/module/LiquidGlassProvider.js +37 -0
- package/lib/module/LiquidGlassProvider.js.map +1 -0
- package/lib/module/LocalGlassMaterial.js +185 -0
- package/lib/module/LocalGlassMaterial.js.map +1 -0
- package/lib/module/adaptiveLuminance.js +11 -0
- package/lib/module/adaptiveLuminance.js.map +1 -0
- package/lib/module/badgePalette.js +40 -0
- package/lib/module/badgePalette.js.map +1 -0
- package/lib/module/buttonGesturePolicy.js +17 -0
- package/lib/module/buttonGesturePolicy.js.map +1 -0
- package/lib/module/components/AdaptiveLuminance.js +16 -0
- package/lib/module/components/AdaptiveLuminance.js.map +1 -0
- package/lib/module/components/BottomSheet.js +186 -0
- package/lib/module/components/BottomSheet.js.map +1 -0
- package/lib/module/components/Button.js +17 -0
- package/lib/module/components/Button.js.map +1 -0
- package/lib/module/components/Card.js +170 -0
- package/lib/module/components/Card.js.map +1 -0
- package/lib/module/components/Checkbox.js +84 -0
- package/lib/module/components/Checkbox.js.map +1 -0
- package/lib/module/components/ControlPressContext.js +4 -0
- package/lib/module/components/ControlPressContext.js.map +1 -0
- package/lib/module/components/Dialog.js +86 -0
- package/lib/module/components/Dialog.js.map +1 -0
- package/lib/module/components/DialogAction.js +88 -0
- package/lib/module/components/DialogAction.js.map +1 -0
- package/lib/module/components/DialogContent.js +20 -0
- package/lib/module/components/DialogContent.js.map +1 -0
- package/lib/module/components/GlassButton.js +93 -0
- package/lib/module/components/GlassButton.js.map +1 -0
- package/lib/module/components/GlassFab.js +37 -0
- package/lib/module/components/GlassFab.js.map +1 -0
- package/lib/module/components/GlassMagnifier.js +99 -0
- package/lib/module/components/GlassMagnifier.js.map +1 -0
- package/lib/module/components/GlassPlayground.js +122 -0
- package/lib/module/components/GlassPlayground.js.map +1 -0
- package/lib/module/components/GlassSlider.js +328 -0
- package/lib/module/components/GlassSlider.js.map +1 -0
- package/lib/module/components/GlassSwitch.js +298 -0
- package/lib/module/components/GlassSwitch.js.map +1 -0
- package/lib/module/components/GlassTabBar.js +351 -0
- package/lib/module/components/GlassTabBar.js.map +1 -0
- package/lib/module/components/Input.js +144 -0
- package/lib/module/components/Input.js.map +1 -0
- package/lib/module/components/ListRow.js +61 -0
- package/lib/module/components/ListRow.js.map +1 -0
- package/lib/module/components/Menu.js +178 -0
- package/lib/module/components/Menu.js.map +1 -0
- package/lib/module/components/NavigationBar.js +14 -0
- package/lib/module/components/NavigationBar.js.map +1 -0
- package/lib/module/components/NumberWheel.js +238 -0
- package/lib/module/components/NumberWheel.js.map +1 -0
- package/lib/module/components/PageFeedList.js +19 -0
- package/lib/module/components/PageFeedList.js.map +1 -0
- package/lib/module/components/PageScaffold.js +114 -0
- package/lib/module/components/PageScaffold.js.map +1 -0
- package/lib/module/components/PreferenceGroup.js +28 -0
- package/lib/module/components/PreferenceGroup.js.map +1 -0
- package/lib/module/components/ProgressIndicator.js +44 -0
- package/lib/module/components/ProgressIndicator.js.map +1 -0
- package/lib/module/components/ProgressiveBlur.js +26 -0
- package/lib/module/components/ProgressiveBlur.js.map +1 -0
- package/lib/module/components/ReferenceSlider.js +268 -0
- package/lib/module/components/ReferenceSlider.js.map +1 -0
- package/lib/module/components/ReferenceTabBar.js +344 -0
- package/lib/module/components/ReferenceTabBar.js.map +1 -0
- package/lib/module/components/SearchBar.js +164 -0
- package/lib/module/components/SearchBar.js.map +1 -0
- package/lib/module/components/SegmentedControl.js +26 -0
- package/lib/module/components/SegmentedControl.js.map +1 -0
- package/lib/module/components/Slider.js +9 -0
- package/lib/module/components/Slider.js.map +1 -0
- package/lib/module/components/Snackbar.js +8 -0
- package/lib/module/components/Snackbar.js.map +1 -0
- package/lib/module/components/SurfaceEnvironmentContext.js +27 -0
- package/lib/module/components/SurfaceEnvironmentContext.js.map +1 -0
- package/lib/module/components/SurfaceGroup.js +33 -0
- package/lib/module/components/SurfaceGroup.js.map +1 -0
- package/lib/module/components/Switch.js +8 -0
- package/lib/module/components/Switch.js.map +1 -0
- package/lib/module/components/Toast.js +74 -0
- package/lib/module/components/Toast.js.map +1 -0
- package/lib/module/components/TopAppBar.js +68 -0
- package/lib/module/components/TopAppBar.js.map +1 -0
- package/lib/module/components/bottomSheetMotion.js +11 -0
- package/lib/module/components/bottomSheetMotion.js.map +1 -0
- package/lib/module/components/glassControlMaterial.js +19 -0
- package/lib/module/components/glassControlMaterial.js.map +1 -0
- package/lib/module/components/menuPosition.js +37 -0
- package/lib/module/components/menuPosition.js.map +1 -0
- package/lib/module/components/pages/FeedPage.js +12 -0
- package/lib/module/components/pages/FeedPage.js.map +1 -0
- package/lib/module/components/pages/PageBenchmarkContext.js +84 -0
- package/lib/module/components/pages/PageBenchmarkContext.js.map +1 -0
- package/lib/module/components/pages/SettingsPage.js +11 -0
- package/lib/module/components/pages/SettingsPage.js.map +1 -0
- package/lib/module/components/pages/SettingsSection.js +8 -0
- package/lib/module/components/pages/SettingsSection.js.map +1 -0
- package/lib/module/components/pages/StaticSettingsPage.js +10 -0
- package/lib/module/components/pages/StaticSettingsPage.js.map +1 -0
- package/lib/module/fallbackKnobGeometry.js +16 -0
- package/lib/module/fallbackKnobGeometry.js.map +1 -0
- package/lib/module/glassController.js +54 -0
- package/lib/module/glassController.js.map +1 -0
- package/lib/module/glassNativeEngine.js +11 -0
- package/lib/module/glassNativeEngine.js.map +1 -0
- package/lib/module/glassRuntime.js +10 -0
- package/lib/module/glassRuntime.js.map +1 -0
- package/lib/module/index.js +80 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/inputPresentation.js +14 -0
- package/lib/module/inputPresentation.js.map +1 -0
- package/lib/module/localGlassTelemetry.js +94 -0
- package/lib/module/localGlassTelemetry.js.map +1 -0
- package/lib/module/motion/MotionProvider.js +11 -0
- package/lib/module/motion/MotionProvider.js.map +1 -0
- package/lib/module/motion/easings.js +64 -0
- package/lib/module/motion/easings.js.map +1 -0
- package/lib/module/motion/folmeSpring.js +21 -0
- package/lib/module/motion/folmeSpring.js.map +1 -0
- package/lib/module/motion/folmeSpringByResponse.js +19 -0
- package/lib/module/motion/folmeSpringByResponse.js.map +1 -0
- package/lib/module/motion/index.js +6 -0
- package/lib/module/motion/index.js.map +1 -0
- package/lib/module/motion/presets.js +98 -0
- package/lib/module/motion/presets.js.map +1 -0
- package/lib/module/nativeGlassViews.js +24 -0
- package/lib/module/nativeGlassViews.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/performanceTelemetry.js +19 -0
- package/lib/module/performanceTelemetry.js.map +1 -0
- package/lib/module/pointerEventBridge.js +14 -0
- package/lib/module/pointerEventBridge.js.map +1 -0
- package/lib/module/pointerGeometry.js +9 -0
- package/lib/module/pointerGeometry.js.map +1 -0
- package/lib/module/pressVelocity.js +31 -0
- package/lib/module/pressVelocity.js.map +1 -0
- package/lib/module/primitives/Divider.js +29 -0
- package/lib/module/primitives/Divider.js.map +1 -0
- package/lib/module/primitives/Icon.js +19 -0
- package/lib/module/primitives/Icon.js.map +1 -0
- package/lib/module/primitives/PressIndication.js +22 -0
- package/lib/module/primitives/PressIndication.js.map +1 -0
- package/lib/module/primitives/Pressable.js +25 -0
- package/lib/module/primitives/Pressable.js.map +1 -0
- package/lib/module/primitives/PressableScale.js +28 -0
- package/lib/module/primitives/PressableScale.js.map +1 -0
- package/lib/module/primitives/Surface.js +83 -0
- package/lib/module/primitives/Surface.js.map +1 -0
- package/lib/module/primitives/Text.js +40 -0
- package/lib/module/primitives/Text.js.map +1 -0
- package/lib/module/primitives/index.js +8 -0
- package/lib/module/primitives/index.js.map +1 -0
- package/lib/module/renderer.js +22 -0
- package/lib/module/renderer.js.map +1 -0
- package/lib/module/sliderValue.js +25 -0
- package/lib/module/sliderValue.js.map +1 -0
- package/lib/module/surface/InlineSurface.js +97 -0
- package/lib/module/surface/InlineSurface.js.map +1 -0
- package/lib/module/surface/MaterialProvider.js +74 -0
- package/lib/module/surface/MaterialProvider.js.map +1 -0
- package/lib/module/surface/NativeSurface.js +47 -0
- package/lib/module/surface/NativeSurface.js.map +1 -0
- package/lib/module/surface/PortalLayers.js +292 -0
- package/lib/module/surface/PortalLayers.js.map +1 -0
- package/lib/module/surface/contexts.js +96 -0
- package/lib/module/surface/contexts.js.map +1 -0
- package/lib/module/surface/registry.js +103 -0
- package/lib/module/surface/registry.js.map +1 -0
- package/lib/module/surface/styles.js +31 -0
- package/lib/module/surface/styles.js.map +1 -0
- package/lib/module/surface/types.js +2 -0
- package/lib/module/surface/types.js.map +1 -0
- package/lib/module/surfaceRendererPolicy.js +27 -0
- package/lib/module/surfaceRendererPolicy.js.map +1 -0
- package/lib/module/tabs/GlassTabItem.js +30 -0
- package/lib/module/tabs/GlassTabItem.js.map +1 -0
- package/lib/module/tabs/InlineTabBar.js +829 -0
- package/lib/module/tabs/InlineTabBar.js.map +1 -0
- package/lib/module/tabs/tabConstants.js +19 -0
- package/lib/module/tabs/tabConstants.js.map +1 -0
- package/lib/module/tabs/tabDebug.js +13 -0
- package/lib/module/tabs/tabDebug.js.map +1 -0
- package/lib/module/tabs/tabStyles.js +104 -0
- package/lib/module/tabs/tabStyles.js.map +1 -0
- package/lib/module/tabs/useInlineTabGesture.js +221 -0
- package/lib/module/tabs/useInlineTabGesture.js.map +1 -0
- package/lib/module/theme/ThemeProvider.js +32 -0
- package/lib/module/theme/ThemeProvider.js.map +1 -0
- package/lib/module/theme/buildTheme.js +153 -0
- package/lib/module/theme/buildTheme.js.map +1 -0
- package/lib/module/theme/glassColors.js +14 -0
- package/lib/module/theme/glassColors.js.map +1 -0
- package/lib/module/theme/index.js +9 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/liquidGlass.js +21 -0
- package/lib/module/theme/liquidGlass.js.map +1 -0
- package/lib/module/theme/presentation.js +11 -0
- package/lib/module/theme/presentation.js.map +1 -0
- package/lib/module/theme/registry.js +13 -0
- package/lib/module/theme/registry.js.map +1 -0
- package/lib/module/theme/selectVariant.js +10 -0
- package/lib/module/theme/selectVariant.js.map +1 -0
- package/lib/module/theme/tokens.js +262 -0
- package/lib/module/theme/tokens.js.map +1 -0
- package/lib/module/theme/types.js +2 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/theme/wallpaper.js +83 -0
- package/lib/module/theme/wallpaper.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/useButtonGesture.js +132 -0
- package/lib/module/useButtonGesture.js.map +1 -0
- package/lib/module/useGlassKnobMotion.js +112 -0
- package/lib/module/useGlassKnobMotion.js.map +1 -0
- package/lib/module/useGlassPressMotion.js +143 -0
- package/lib/module/useGlassPressMotion.js.map +1 -0
- package/lib/types/GlassSurface.d.ts +147 -0
- package/lib/types/GlassTabBar.d.ts +36 -0
- package/lib/types/GlassTabLens.d.ts +11 -0
- package/lib/types/LiquidGlassProvider.d.ts +47 -0
- package/lib/types/LocalGlassMaterial.d.ts +21 -0
- package/lib/types/adaptiveLuminance.d.ts +2 -0
- package/lib/types/badgePalette.d.ts +9 -0
- package/lib/types/buttonGesturePolicy.d.ts +4 -0
- package/lib/types/components/AdaptiveLuminance.d.ts +23 -0
- package/lib/types/components/BottomSheet.d.ts +33 -0
- package/lib/types/components/Button.d.ts +16 -0
- package/lib/types/components/Card.d.ts +25 -0
- package/lib/types/components/Checkbox.d.ts +11 -0
- package/lib/types/components/ControlPressContext.d.ts +9 -0
- package/lib/types/components/Dialog.d.ts +12 -0
- package/lib/types/components/DialogAction.d.ts +4 -0
- package/lib/types/components/DialogContent.d.ts +12 -0
- package/lib/types/components/GlassButton.d.ts +38 -0
- package/lib/types/components/GlassFab.d.ts +15 -0
- package/lib/types/components/GlassMagnifier.d.ts +41 -0
- package/lib/types/components/GlassPlayground.d.ts +12 -0
- package/lib/types/components/GlassSlider.d.ts +48 -0
- package/lib/types/components/GlassSwitch.d.ts +46 -0
- package/lib/types/components/GlassTabBar.d.ts +44 -0
- package/lib/types/components/Input.d.ts +47 -0
- package/lib/types/components/ListRow.d.ts +17 -0
- package/lib/types/components/Menu.d.ts +41 -0
- package/lib/types/components/NavigationBar.d.ts +14 -0
- package/lib/types/components/NumberWheel.d.ts +11 -0
- package/lib/types/components/PageFeedList.d.ts +6 -0
- package/lib/types/components/PageScaffold.d.ts +64 -0
- package/lib/types/components/PreferenceGroup.d.ts +12 -0
- package/lib/types/components/ProgressIndicator.d.ts +9 -0
- package/lib/types/components/ProgressiveBlur.d.ts +12 -0
- package/lib/types/components/ReferenceSlider.d.ts +31 -0
- package/lib/types/components/ReferenceTabBar.d.ts +61 -0
- package/lib/types/components/SearchBar.d.ts +52 -0
- package/lib/types/components/SegmentedControl.d.ts +10 -0
- package/lib/types/components/Slider.d.ts +19 -0
- package/lib/types/components/Snackbar.d.ts +5 -0
- package/lib/types/components/SurfaceEnvironmentContext.d.ts +17 -0
- package/lib/types/components/SurfaceGroup.d.ts +17 -0
- package/lib/types/components/Switch.d.ts +12 -0
- package/lib/types/components/Toast.d.ts +14 -0
- package/lib/types/components/TopAppBar.d.ts +49 -0
- package/lib/types/components/bottomSheetMotion.d.ts +2 -0
- package/lib/types/components/glassControlMaterial.d.ts +3 -0
- package/lib/types/components/menuPosition.d.ts +22 -0
- package/lib/types/components/pages/FeedPage.d.ts +31 -0
- package/lib/types/components/pages/PageBenchmarkContext.d.ts +30 -0
- package/lib/types/components/pages/SettingsPage.d.ts +20 -0
- package/lib/types/components/pages/SettingsSection.d.ts +9 -0
- package/lib/types/components/pages/StaticSettingsPage.d.ts +18 -0
- package/lib/types/fallbackKnobGeometry.d.ts +7 -0
- package/lib/types/glassController.d.ts +20 -0
- package/lib/types/glassNativeEngine.d.ts +5 -0
- package/lib/types/glassRuntime.d.ts +10 -0
- package/lib/types/index.d.ts +124 -0
- package/lib/types/inputPresentation.d.ts +12 -0
- package/lib/types/localGlassTelemetry.d.ts +28 -0
- package/lib/types/motion/MotionProvider.d.ts +7 -0
- package/lib/types/motion/easings.d.ts +33 -0
- package/lib/types/motion/folmeSpring.d.ts +15 -0
- package/lib/types/motion/folmeSpringByResponse.d.ts +14 -0
- package/lib/types/motion/index.d.ts +7 -0
- package/lib/types/motion/presets.d.ts +103 -0
- package/lib/types/nativeGlassViews.d.ts +112 -0
- package/lib/types/performanceTelemetry.d.ts +65 -0
- package/lib/types/pointerEventBridge.d.ts +17 -0
- package/lib/types/pointerGeometry.d.ts +2 -0
- package/lib/types/pressVelocity.d.ts +11 -0
- package/lib/types/primitives/Divider.d.ts +19 -0
- package/lib/types/primitives/Icon.d.ts +29 -0
- package/lib/types/primitives/PressIndication.d.ts +26 -0
- package/lib/types/primitives/Pressable.d.ts +9 -0
- package/lib/types/primitives/PressableScale.d.ts +19 -0
- package/lib/types/primitives/Surface.d.ts +63 -0
- package/lib/types/primitives/Text.d.ts +35 -0
- package/lib/types/primitives/index.d.ts +14 -0
- package/lib/types/renderer.d.ts +32 -0
- package/lib/types/sliderValue.d.ts +2 -0
- package/lib/types/surface/InlineSurface.d.ts +42 -0
- package/lib/types/surface/MaterialProvider.d.ts +46 -0
- package/lib/types/surface/NativeSurface.d.ts +11 -0
- package/lib/types/surface/PortalLayers.d.ts +33 -0
- package/lib/types/surface/contexts.d.ts +66 -0
- package/lib/types/surface/registry.d.ts +6 -0
- package/lib/types/surface/styles.d.ts +74 -0
- package/lib/types/surface/types.d.ts +118 -0
- package/lib/types/surfaceRendererPolicy.d.ts +14 -0
- package/lib/types/tabs/GlassTabItem.d.ts +20 -0
- package/lib/types/tabs/InlineTabBar.d.ts +5 -0
- package/lib/types/tabs/tabConstants.d.ts +34 -0
- package/lib/types/tabs/tabDebug.d.ts +15 -0
- package/lib/types/tabs/tabStyles.d.ts +119 -0
- package/lib/types/tabs/useInlineTabGesture.d.ts +34 -0
- package/lib/types/theme/ThemeProvider.d.ts +26 -0
- package/lib/types/theme/buildTheme.d.ts +6 -0
- package/lib/types/theme/glassColors.d.ts +13 -0
- package/lib/types/theme/index.d.ts +11 -0
- package/lib/types/theme/liquidGlass.d.ts +5 -0
- package/lib/types/theme/presentation.d.ts +3 -0
- package/lib/types/theme/registry.d.ts +7 -0
- package/lib/types/theme/selectVariant.d.ts +10 -0
- package/lib/types/theme/tokens.d.ts +18 -0
- package/lib/types/theme/types.d.ts +305 -0
- package/lib/types/theme/wallpaper.d.ts +32 -0
- package/lib/types/types.d.ts +127 -0
- package/lib/types/useButtonGesture.d.ts +30 -0
- package/lib/types/useGlassKnobMotion.d.ts +40 -0
- package/lib/types/useGlassPressMotion.d.ts +61 -0
- package/licenses/Apache-2.0-Kyant0-Shapes.txt +191 -0
- package/package.json +131 -4
- package/src/GlassSurface.tsx +676 -0
- package/src/GlassTabBar.tsx +106 -0
- package/src/GlassTabLens.tsx +92 -0
- package/src/LiquidGlassProvider.tsx +135 -0
- package/src/LocalGlassMaterial.tsx +256 -0
- package/src/adaptiveLuminance.ts +15 -0
- package/src/badgePalette.ts +54 -0
- package/src/buttonGesturePolicy.ts +15 -0
- package/src/components/AdaptiveLuminance.tsx +40 -0
- package/src/components/BottomSheet.tsx +291 -0
- package/src/components/Button.tsx +30 -0
- package/src/components/Card.tsx +343 -0
- package/src/components/Checkbox.tsx +141 -0
- package/src/components/ControlPressContext.ts +11 -0
- package/src/components/Dialog.tsx +129 -0
- package/src/components/DialogAction.tsx +109 -0
- package/src/components/DialogContent.tsx +52 -0
- package/src/components/GlassButton.tsx +225 -0
- package/src/components/GlassFab.tsx +98 -0
- package/src/components/GlassMagnifier.tsx +178 -0
- package/src/components/GlassPlayground.tsx +190 -0
- package/src/components/GlassSlider.tsx +448 -0
- package/src/components/GlassSwitch.tsx +391 -0
- package/src/components/GlassTabBar.tsx +522 -0
- package/src/components/Input.tsx +277 -0
- package/src/components/ListRow.tsx +124 -0
- package/src/components/Menu.tsx +322 -0
- package/src/components/NavigationBar.tsx +27 -0
- package/src/components/NumberWheel.tsx +344 -0
- package/src/components/PageFeedList.tsx +37 -0
- package/src/components/PageScaffold.tsx +266 -0
- package/src/components/PreferenceGroup.tsx +65 -0
- package/src/components/ProgressIndicator.tsx +63 -0
- package/src/components/ProgressiveBlur.tsx +56 -0
- package/src/components/ReferenceSlider.tsx +364 -0
- package/src/components/ReferenceTabBar.tsx +564 -0
- package/src/components/SearchBar.tsx +340 -0
- package/src/components/SegmentedControl.tsx +45 -0
- package/src/components/Slider.tsx +25 -0
- package/src/components/Snackbar.tsx +10 -0
- package/src/components/SurfaceEnvironmentContext.tsx +46 -0
- package/src/components/SurfaceGroup.tsx +60 -0
- package/src/components/Switch.tsx +18 -0
- package/src/components/Toast.tsx +110 -0
- package/src/components/TopAppBar.tsx +272 -0
- package/src/components/bottomSheetMotion.ts +10 -0
- package/src/components/glassControlMaterial.ts +20 -0
- package/src/components/menuPosition.ts +58 -0
- package/src/components/pages/FeedPage.tsx +96 -0
- package/src/components/pages/PageBenchmarkContext.tsx +105 -0
- package/src/components/pages/SettingsPage.tsx +55 -0
- package/src/components/pages/SettingsSection.tsx +20 -0
- package/src/components/pages/StaticSettingsPage.tsx +50 -0
- package/src/fallbackKnobGeometry.ts +15 -0
- package/src/glassController.ts +70 -0
- package/src/glassNativeEngine.ts +16 -0
- package/src/glassRuntime.ts +11 -0
- package/src/index.ts +199 -0
- package/src/inputPresentation.ts +32 -0
- package/src/localGlassTelemetry.ts +129 -0
- package/src/motion/MotionProvider.tsx +12 -0
- package/src/motion/easings.ts +71 -0
- package/src/motion/folmeSpring.ts +22 -0
- package/src/motion/folmeSpringByResponse.ts +19 -0
- package/src/motion/index.ts +47 -0
- package/src/motion/presets.ts +128 -0
- package/src/nativeGlassViews.ts +144 -0
- package/src/performanceTelemetry.ts +91 -0
- package/src/pointerEventBridge.ts +27 -0
- package/src/pointerGeometry.ts +8 -0
- package/src/pressVelocity.ts +36 -0
- package/src/primitives/Divider.tsx +42 -0
- package/src/primitives/Icon.tsx +44 -0
- package/src/primitives/PressIndication.tsx +43 -0
- package/src/primitives/Pressable.tsx +75 -0
- package/src/primitives/PressableScale.tsx +50 -0
- package/src/primitives/Surface.tsx +171 -0
- package/src/primitives/Text.tsx +80 -0
- package/src/primitives/index.ts +14 -0
- package/src/renderer.ts +70 -0
- package/src/sliderValue.ts +19 -0
- package/src/surface/InlineSurface.tsx +299 -0
- package/src/surface/MaterialProvider.tsx +235 -0
- package/src/surface/NativeSurface.tsx +115 -0
- package/src/surface/PortalLayers.tsx +574 -0
- package/src/surface/contexts.tsx +188 -0
- package/src/surface/registry.ts +109 -0
- package/src/surface/styles.ts +31 -0
- package/src/surface/types.ts +139 -0
- package/src/surfaceRendererPolicy.ts +32 -0
- package/src/tabs/GlassTabItem.tsx +100 -0
- package/src/tabs/InlineTabBar.tsx +1193 -0
- package/src/tabs/tabConstants.ts +35 -0
- package/src/tabs/tabDebug.ts +29 -0
- package/src/tabs/tabStyles.ts +104 -0
- package/src/tabs/useInlineTabGesture.ts +306 -0
- package/src/theme/ThemeProvider.tsx +52 -0
- package/src/theme/buildTheme.ts +160 -0
- package/src/theme/glassColors.ts +13 -0
- package/src/theme/index.ts +34 -0
- package/src/theme/liquidGlass.ts +25 -0
- package/src/theme/presentation.ts +12 -0
- package/src/theme/registry.ts +16 -0
- package/src/theme/selectVariant.ts +12 -0
- package/src/theme/tokens.ts +309 -0
- package/src/theme/types.ts +345 -0
- package/src/theme/wallpaper.ts +94 -0
- package/src/types.ts +95 -0
- package/src/useButtonGesture.ts +134 -0
- package/src/useGlassKnobMotion.ts +155 -0
- package/src/useGlassPressMotion.ts +209 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.InlineBackdropSurface = void 0;
|
|
37
|
+
exports.LocalGlassSurface = LocalGlassSurface;
|
|
38
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const react_native_1 = require("react-native");
|
|
41
|
+
const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
42
|
+
const LocalGlassMaterial_1 = require("../LocalGlassMaterial");
|
|
43
|
+
const contexts_1 = require("./contexts");
|
|
44
|
+
const NativeSurface_1 = require("./NativeSurface");
|
|
45
|
+
const styles_1 = require("./styles");
|
|
46
|
+
exports.InlineBackdropSurface = react_1.default.memo(function InlineBackdropSurface({ renderingEnabled, providerId, variant, tintColor, interactive, continuous, sharedSource, captureProbe, opticalProgress, pointerEvent, pointerEventValue, pointerEventSink, valueEventSink, valueEvent, opticalToggleFraction, opticalPointX, opticalPointY, opticalVelocityX, opticalVelocityY, opticalMotionX, opticalMotionY, materialOverrides, displacementOnlyDebug, syncContentTransform, intrinsicLayout, contentStyle, placement, children, }) {
|
|
47
|
+
const runtime = (0, react_1.useContext)(contexts_1.GlassRuntimeContext);
|
|
48
|
+
const hasAnimatedOptics = Boolean(opticalPointX ||
|
|
49
|
+
opticalPointY ||
|
|
50
|
+
opticalVelocityX ||
|
|
51
|
+
opticalVelocityY ||
|
|
52
|
+
opticalProgress ||
|
|
53
|
+
opticalToggleFraction ||
|
|
54
|
+
opticalMotionX ||
|
|
55
|
+
opticalMotionY);
|
|
56
|
+
const animatedOptics = (0, react_native_reanimated_1.useAnimatedProps)(() => ({
|
|
57
|
+
interactionVelocityX: opticalVelocityX?.value,
|
|
58
|
+
interactionVelocityY: opticalVelocityY?.value,
|
|
59
|
+
interactionPointX: opticalPointX?.value,
|
|
60
|
+
interactionPointY: opticalPointY?.value,
|
|
61
|
+
interactionProgress: opticalProgress?.value ?? 0,
|
|
62
|
+
toggleFraction: opticalToggleFraction?.value ?? 0,
|
|
63
|
+
motionX: opticalMotionX ? Math.max(-1, Math.min(1, opticalMotionX.value / 1800)) : undefined,
|
|
64
|
+
motionY: opticalMotionY ? Math.max(-1, Math.min(1, opticalMotionY.value / 1800)) : undefined,
|
|
65
|
+
}), [
|
|
66
|
+
opticalPointX,
|
|
67
|
+
opticalPointY,
|
|
68
|
+
opticalVelocityX,
|
|
69
|
+
opticalVelocityY,
|
|
70
|
+
opticalProgress,
|
|
71
|
+
pointerEventValue,
|
|
72
|
+
valueEvent,
|
|
73
|
+
opticalToggleFraction,
|
|
74
|
+
opticalMotionX,
|
|
75
|
+
opticalMotionY,
|
|
76
|
+
]);
|
|
77
|
+
if (!runtime)
|
|
78
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
79
|
+
const { tokens, dark, reducedMotion } = runtime;
|
|
80
|
+
const material = materialOverrides
|
|
81
|
+
? { ...tokens.materials[variant], ...materialOverrides }
|
|
82
|
+
: tokens.materials[variant];
|
|
83
|
+
const qualityScale = material.opticsModel === 'referenceParity'
|
|
84
|
+
? 1
|
|
85
|
+
: tokens.quality === 'high'
|
|
86
|
+
? 1.2
|
|
87
|
+
: tokens.quality === 'fallback'
|
|
88
|
+
? 0.45
|
|
89
|
+
: 1;
|
|
90
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { collapsable: !syncContentTransform, style: intrinsicLayout ? styles_1.styles.inlineBackdropIntrinsicSurface : styles_1.styles.inlineBackdropSurface, children: [(0, jsx_runtime_1.jsx)(NativeSurface_1.NativeBackdropSurface, { renderingEnabled: renderingEnabled, providerId: providerId, opticsModel: material.opticsModel, depthEffect: material.referenceDepthEffect ?? false, highlightStyle: material.referenceHighlightStyle, interactionProfile: material.referenceInteractionProfile, contentScaleX: material.referenceContentScaleX, contentScaleY: material.referenceContentScaleY, sampleOffsetX: material.referenceSampleOffsetX, sampleOffsetY: material.referenceSampleOffsetY, toggleTrackColorOff: material.referenceToggleTrackColorOff, toggleTrackColorOn: material.referenceToggleTrackColorOn, toggleTrackWidth: material.referenceToggleTrackWidth, toggleTrackHeight: material.referenceToggleTrackHeight, toggleSolidBackdropColor: material.referenceToggleSolidBackdropColor, brightness: material.brightness ?? 0, contrast: material.contrast ?? 1, highlightFalloff: material.highlightFalloff ?? 1, sdfContrast: material.sdfScaleLens?.contrast, sdfBrightness: material.sdfScaleLens?.brightness, sdfSaturation: material.sdfScaleLens?.saturation, sdfOuterShadowAlpha: material.sdfScaleLens?.outerShadowAlpha, sdfOuterShadowBlurRadius: material.sdfScaleLens?.outerShadowBlurRadius, sdfOuterShadowOffsetY: material.sdfScaleLens?.outerShadowOffsetY, sdfInnerShadowAlpha: material.sdfScaleLens?.innerShadowAlpha, sdfInnerShadowExtent: material.sdfScaleLens?.innerShadowExtent, cornerRadius: material.radius, blurRadius: material.blurRadius * qualityScale, refractionHeight: material.refractionHeight * qualityScale, refractionAmount: material.refractionAmount * qualityScale, bodyRefractionAmount: (material.refractionBodyAmount ?? 2.5) * qualityScale, interactionProgress: 0, pointerEvent: pointerEventValue, pointerEventSink: pointerEventSink, valueEventSink: valueEventSink, valueEvent: valueEvent, saturation: material.saturation, chromaticAberration: material.opticsModel === 'referenceParity' ||
|
|
91
|
+
tokens.quality === 'high' ||
|
|
92
|
+
variant === 'tabSelectionLens'
|
|
93
|
+
? material.chromaticAberration
|
|
94
|
+
: 0, highlightAlpha: material.highlightAlpha, highlightWidth: material.highlightWidth, lightAngle: material.highlightAngle ?? 45, highlightColor: material.highlightColor
|
|
95
|
+
? dark
|
|
96
|
+
? material.highlightColor.dark
|
|
97
|
+
: material.highlightColor.light
|
|
98
|
+
: undefined, tintAlpha: material.tintAlpha ?? 1, specularStrength: material.specularStrength ?? 1, fresnelStrength: material.fresnelStrength ?? 0.85, innerShadowStrength: material.innerShadowStrength ?? (material.opticsModel === 'referenceParity' ? 0 : 0.18), shadowOpacity: material.shadowOpacity ?? (material.opticsModel === 'referenceParity' ? 0 : 0.1), shadowRadius: material.shadowRadius ?? (material.opticsModel === 'referenceParity' ? 0 : 24), shadowOffsetY: material.shadowOffsetY ?? (material.opticsModel === 'referenceParity' ? 0 : 4), tint: tintColor ?? (dark ? tokens.tint.dark : tokens.tint.light), surfaceColor: material.surfaceColor
|
|
99
|
+
? dark
|
|
100
|
+
? material.surfaceColor.dark
|
|
101
|
+
: material.surfaceColor.light
|
|
102
|
+
: undefined, interactive: interactive && tokens.interaction.enabled && !reducedMotion, continuous: continuous, sharedSource: sharedSource, captureProbe: captureProbe, displacementOnlyDebug: displacementOnlyDebug, syncContentTransform: syncContentTransform, animatedProps: hasAnimatedOptics ? animatedOptics : undefined, pointerEvents: interactive ? undefined : 'none', style: [react_native_1.StyleSheet.absoluteFill, { borderRadius: material.radius }] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [
|
|
103
|
+
intrinsicLayout
|
|
104
|
+
? styles_1.styles.portalContentIntrinsic
|
|
105
|
+
: placement === 'layout'
|
|
106
|
+
? styles_1.styles.portalContentLayout
|
|
107
|
+
: styles_1.styles.portalContentWrap,
|
|
108
|
+
contentStyle,
|
|
109
|
+
], children: children })] }));
|
|
110
|
+
});
|
|
111
|
+
function LocalGlassSurface({ variant, surfaceRole, style, contentStyle, animatedStyle, fallbackAnimatedStyle, pointerEvents, onLayout, children, }) {
|
|
112
|
+
const runtime = (0, react_1.useContext)(contexts_1.GlassRuntimeContext);
|
|
113
|
+
if (!runtime?.tokens.enabled)
|
|
114
|
+
return ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { onLayout: onLayout, style: [style, animatedStyle, fallbackAnimatedStyle], children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: contentStyle, children: children }) }));
|
|
115
|
+
const { tokens, dark } = runtime;
|
|
116
|
+
const material = tokens.materials[variant ?? 'surface'];
|
|
117
|
+
const fallback = tokens.quality === 'fallback';
|
|
118
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_reanimated_1.default.View, { pointerEvents: pointerEvents, onLayout: onLayout, style: [
|
|
119
|
+
styles_1.styles.localSurface,
|
|
120
|
+
{ borderRadius: material.radius, backgroundColor: 'transparent' },
|
|
121
|
+
style,
|
|
122
|
+
animatedStyle,
|
|
123
|
+
fallbackAnimatedStyle,
|
|
124
|
+
], children: [fallback ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "none", style: [
|
|
125
|
+
react_native_1.StyleSheet.absoluteFill,
|
|
126
|
+
{
|
|
127
|
+
backgroundColor: dark ? tokens.fallbackTint.dark : tokens.fallbackTint.light,
|
|
128
|
+
borderColor: dark ? tokens.fallbackBorder.dark : tokens.fallbackBorder.light,
|
|
129
|
+
borderWidth: react_native_1.StyleSheet.hairlineWidth,
|
|
130
|
+
borderRadius: material.radius,
|
|
131
|
+
},
|
|
132
|
+
] })) : ((0, jsx_runtime_1.jsx)(LocalGlassMaterial_1.LocalGlassMaterial, { tokens: tokens, material: material, dark: dark, surfaceRole: surfaceRole })), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles_1.styles.localContent, contentStyle], children: children })] }));
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=InlineSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineSurface.js","sourceRoot":"","sources":["../../../src/surface/InlineSurface.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsOA,8CAoEC;;AA1SD,+CAA0C;AAC1C,+CAAgD;AAEhD,mFAAqE;AAErE,8DAA2D;AAG3D,yCAAiD;AACjD,mDAAwD;AAExD,qCAAkC;AAErB,QAAA,qBAAqB,GAAG,eAAK,CAAC,IAAI,CAAC,SAAS,qBAAqB,CAAC,EAC3E,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,SAAS,EACT,QAAQ,GAmCX;IACG,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,8BAAmB,CAAC,CAAC;IAChD,MAAM,iBAAiB,GAAG,OAAO,CAC7B,aAAa;QACb,aAAa;QACb,gBAAgB;QAChB,gBAAgB;QAChB,eAAe;QACf,qBAAqB;QACrB,cAAc;QACd,cAAc,CACjB,CAAC;IACF,MAAM,cAAc,GAAG,IAAA,0CAAgB,EACnC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K,UAAU,CAAC;IAC/C,OAAO,CACH,wBAAC,iCAAQ,CAAC,IAAI,IACV,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE;YACH,eAAM,CAAC,YAAY;YACnB,EAAE,YAAY,EAAE,QAAQ,CAAC,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE;YACjE,KAAK;YACL,aAAa;YACb,qBAAqB;SACxB,aAEA,QAAQ,CAAC,CAAC,CAAC,CACR,uBAAC,mBAAI,IACD,aAAa,EAAC,MAAM,EACpB,KAAK,EAAE;oBACH,yBAAU,CAAC,YAAY;oBACvB;wBACI,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK;wBAC5E,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK;wBAC5E,WAAW,EAAE,yBAAU,CAAC,aAAa;wBACrC,YAAY,EAAE,QAAQ,CAAC,MAAM;qBAChC;iBACJ,GACH,CACL,CAAC,CAAC,CAAC,CACA,uBAAC,uCAAkB,IACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,GAC1B,CACL,EACD,uBAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,eAAM,CAAC,YAAY,EAAE,YAAY,CAAC,YAAG,QAAQ,GAAQ,IACvD,CACnB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GlassAppearanceProvider = GlassAppearanceProvider;
|
|
4
|
+
exports.GlassMaterialProvider = GlassMaterialProvider;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const contexts_1 = require("./contexts");
|
|
9
|
+
const registry_1 = require("./registry");
|
|
10
|
+
const NativeSurface_1 = require("./NativeSurface");
|
|
11
|
+
const PortalLayers_1 = require("./PortalLayers");
|
|
12
|
+
const styles_1 = require("./styles");
|
|
13
|
+
function GlassAppearanceProvider({ children, tokens, dark, reducedMotion = false, }) {
|
|
14
|
+
const runtime = (0, react_1.useMemo)(() => ({ tokens, dark, reducedMotion }), [tokens, dark, reducedMotion]);
|
|
15
|
+
return (0, jsx_runtime_1.jsx)(contexts_1.GlassRuntimeContext.Provider, { value: runtime, children: children });
|
|
16
|
+
}
|
|
17
|
+
function GlassMaterialProvider({ children, backdrop, themeBackdrop, themeBackdropRevision, inlineBackdropByDefault = false, defaultSamplingSource = 'routeScene', providerId: providerIdProp, style, tokens, dark, reducedMotion = false, active = true, }) {
|
|
18
|
+
const hostRef = (0, react_1.useRef)(null);
|
|
19
|
+
const generatedProviderId = (0, react_1.useId)();
|
|
20
|
+
const providerId = providerIdProp ?? generatedProviderId;
|
|
21
|
+
const routeSceneProviderId = backdrop !== undefined ? providerId : null;
|
|
22
|
+
const generatedThemeBackdropProviderId = (0, react_1.useId)();
|
|
23
|
+
// When a separate stable theme backdrop was not supplied, the provider's
|
|
24
|
+
// base backdrop is the stable scene. Aliasing its id avoids recording that
|
|
25
|
+
// exact scene into a second native source just to support inline lenses.
|
|
26
|
+
const themeBackdropProviderId = themeBackdrop !== undefined ? generatedThemeBackdropProviderId : providerId;
|
|
27
|
+
const surfaceRegistryRef = (0, react_1.useRef)(null);
|
|
28
|
+
const overlayRegistryRef = (0, react_1.useRef)(null);
|
|
29
|
+
if (!surfaceRegistryRef.current)
|
|
30
|
+
surfaceRegistryRef.current = (0, registry_1.createEntryRegistry)();
|
|
31
|
+
if (!overlayRegistryRef.current)
|
|
32
|
+
overlayRegistryRef.current = (0, registry_1.createEntryRegistry)();
|
|
33
|
+
const surfaceRegistry = surfaceRegistryRef.current;
|
|
34
|
+
const overlayRegistry = overlayRegistryRef.current;
|
|
35
|
+
const runtime = (0, react_1.useMemo)(() => ({ tokens, dark, reducedMotion }), [tokens, dark, reducedMotion]);
|
|
36
|
+
const updateSurface = (0, react_1.useCallback)((id, entry) => {
|
|
37
|
+
surfaceRegistry.update(id, entry, registry_1.sameSurface);
|
|
38
|
+
}, [surfaceRegistry]);
|
|
39
|
+
const updateOverlay = (0, react_1.useCallback)((id, entry) => {
|
|
40
|
+
overlayRegistry.update(id, entry, registry_1.sameOverlay);
|
|
41
|
+
}, [overlayRegistry]);
|
|
42
|
+
const removeOverlay = (0, react_1.useCallback)((id) => {
|
|
43
|
+
overlayRegistry.remove(id);
|
|
44
|
+
}, [overlayRegistry]);
|
|
45
|
+
const remove = (0, react_1.useCallback)((id) => {
|
|
46
|
+
surfaceRegistry.remove(id);
|
|
47
|
+
overlayRegistry.remove(id);
|
|
48
|
+
}, [surfaceRegistry, overlayRegistry]);
|
|
49
|
+
const hasSeparateBackdrop = backdrop !== undefined;
|
|
50
|
+
const context = (0, react_1.useMemo)(() => ({
|
|
51
|
+
providerId,
|
|
52
|
+
routeSceneProviderId,
|
|
53
|
+
themeBackdropProviderId,
|
|
54
|
+
inlineBackdropByDefault,
|
|
55
|
+
hasSeparateBackdrop,
|
|
56
|
+
defaultSamplingSource,
|
|
57
|
+
hostRef,
|
|
58
|
+
updateSurface,
|
|
59
|
+
updateOverlay,
|
|
60
|
+
removeOverlay,
|
|
61
|
+
remove,
|
|
62
|
+
}), [
|
|
63
|
+
providerId,
|
|
64
|
+
routeSceneProviderId,
|
|
65
|
+
themeBackdropProviderId,
|
|
66
|
+
inlineBackdropByDefault,
|
|
67
|
+
hasSeparateBackdrop,
|
|
68
|
+
defaultSamplingSource,
|
|
69
|
+
updateSurface,
|
|
70
|
+
updateOverlay,
|
|
71
|
+
removeOverlay,
|
|
72
|
+
remove,
|
|
73
|
+
]);
|
|
74
|
+
const overlayContext = (0, react_1.useMemo)(() => ({ providerId, updateOverlay, remove }), [providerId, updateOverlay, remove]);
|
|
75
|
+
const recording = active && tokens.enabled;
|
|
76
|
+
return ((0, jsx_runtime_1.jsx)(contexts_1.GlassRuntimeContext.Provider, { value: runtime, children: (0, jsx_runtime_1.jsx)(contexts_1.GlassHostContext.Provider, { value: context, children: (0, jsx_runtime_1.jsx)(contexts_1.GlassOverlayHostContext.Provider, { value: overlayContext, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { ref: hostRef, collapsable: false, style: [styles_1.styles.root, style], children: (0, jsx_runtime_1.jsxs)(contexts_1.GlassScopeActiveContext.Provider, { value: recording, children: [recording && themeBackdrop !== undefined ? ((0, jsx_runtime_1.jsx)(NativeSurface_1.GlassCaptureSourceView, { providerId: themeBackdropProviderId, captureMode: "static", sourceRevision: themeBackdropRevision, pointerEvents: "none", style: react_native_1.StyleSheet.absoluteFill, children: themeBackdrop })) : null, hasSeparateBackdrop ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(NativeSurface_1.GlassCaptureSourceView, { providerId: providerId, underlayProviderId: themeBackdrop !== undefined ? themeBackdropProviderId : undefined, captureMode: recording ? 'live' : 'frozen', style: react_native_1.StyleSheet.absoluteFill, children: backdrop }), (0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "box-none", style: react_native_1.StyleSheet.absoluteFill, children: children })] })) : ((0, jsx_runtime_1.jsx)(NativeSurface_1.GlassCaptureSourceView, { providerId: providerId, underlayProviderId: themeBackdrop !== undefined ? themeBackdropProviderId : undefined, captureMode: recording ? 'live' : 'frozen', style: react_native_1.StyleSheet.absoluteFill, children: children })), (0, jsx_runtime_1.jsx)(PortalLayers_1.GlassSurfacePortalLayer, { registry: surfaceRegistry, tokens: tokens }), (0, jsx_runtime_1.jsx)(PortalLayers_1.GlassRouteOverlayLayer, { registry: overlayRegistry, enabled: recording })] }) }) }) }) }));
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=MaterialProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialProvider.js","sourceRoot":"","sources":["../../../src/surface/MaterialProvider.tsx"],"names":[],"mappings":";;AA0DA,0DAQC;AAED,sDAsKC;;AA1OD,iCAAmE;AACnE,+CAAgD;AAGhD,yCAKoB;AAEpB,yCAA2E;AAC3E,mDAAyD;AACzD,iDAAiF;AACjF,qCAAkC;AA4ClC,SAAgB,uBAAuB,CAAC,EACpC,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,aAAa,GAAG,KAAK,GACM;IAC3B,MAAM,OAAO,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;IAChG,OAAO,uBAAC,8BAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,YAAG,QAAQ,GAAgC,CAAC;AACnG,CAAC;AAED,SAAgB,qBAAqB,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,qBAAqB,EACrB,uBAAuB,GAAG,KAAK,EAC/B,qBAAqB,GAAG,YAAY,EACpC,UAAU,EAAE,cAAc,EAC1B,KAAK,EACL,MAAM,EACN,IAAI,EACJ,aAAa,GAAG,KAAK,EACrB,MAAM,GAAG,IAAI,GACY;IACzB,MAAM,OAAO,GAAG,IAAA,cAAM,EAAO,IAAI,CAAC,CAAC;IACnC,MAAM,mBAAmB,GAAG,IAAA,aAAK,GAAE,CAAC;IACpC,MAAM,UAAU,GAAG,cAAc,IAAI,mBAAmB,CAAC;IACzD,MAAM,oBAAoB,GAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,MAAM,gCAAgC,GAAG,IAAA,aAAK,GAAE,CAAC;IACjD,yEAA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ACX,GACD,CAClC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AnimatedNativeGlassSurfaceView = void 0;
|
|
7
|
+
exports.NativeBackdropSurface = NativeBackdropSurface;
|
|
8
|
+
exports.GlassCaptureSourceView = GlassCaptureSourceView;
|
|
9
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const react_native_1 = require("react-native");
|
|
12
|
+
const react_native_reanimated_1 = __importDefault(require("react-native-reanimated"));
|
|
13
|
+
const glassController_1 = require("../glassController");
|
|
14
|
+
const nativeGlassViews_1 = require("../nativeGlassViews");
|
|
15
|
+
exports.AnimatedNativeGlassSurfaceView = nativeGlassViews_1.NativeGlassSurfaceView
|
|
16
|
+
? react_native_reanimated_1.default.createAnimatedComponent(nativeGlassViews_1.NativeGlassSurfaceView)
|
|
17
|
+
: null;
|
|
18
|
+
function NativeBackdropSurface({ opticsModel, sdfDisplacementMapDebug, sdfContrast, sdfBrightness, sdfSaturation, sdfOuterShadowAlpha, sdfOuterShadowBlurRadius, sdfOuterShadowOffsetY, sdfInnerShadowAlpha, sdfInnerShadowExtent, shapeMaskText, shapeMaskFontSize, shapeMaskFontWeight, sharedPassOrder, sharedPassZIndex, pointerEventSink, valueEventSink, syncContentTransform, renderingEnabled = true, ...props }) {
|
|
19
|
+
const nativeViewRef = (0, react_1.useRef)(null);
|
|
20
|
+
(0, react_1.useEffect)(() => {
|
|
21
|
+
const viewTag = nativeViewRef.current ? (0, react_native_1.findNodeHandle)(nativeViewRef.current) : null;
|
|
22
|
+
if (pointerEventSink) {
|
|
23
|
+
pointerEventSink.current =
|
|
24
|
+
viewTag == null ? null : (payload) => (0, glassController_1.forwardPointerToSurface)(viewTag, payload);
|
|
25
|
+
}
|
|
26
|
+
if (valueEventSink) {
|
|
27
|
+
valueEventSink.current =
|
|
28
|
+
viewTag == null ? null : (payload) => (0, glassController_1.forwardValueToSurface)(viewTag, payload);
|
|
29
|
+
}
|
|
30
|
+
return () => {
|
|
31
|
+
if (pointerEventSink)
|
|
32
|
+
pointerEventSink.current = null;
|
|
33
|
+
if (valueEventSink)
|
|
34
|
+
valueEventSink.current = null;
|
|
35
|
+
};
|
|
36
|
+
}, [pointerEventSink, valueEventSink]);
|
|
37
|
+
// Android owns live backdrop optics. Other platforms keep the material fallback.
|
|
38
|
+
{
|
|
39
|
+
if (props.animatedProps == null && nativeGlassViews_1.NativeGlassSurfaceView) {
|
|
40
|
+
const { animatedProps: _unused, ...staticProps } = props;
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(nativeGlassViews_1.NativeGlassSurfaceView, { ref: nativeViewRef, renderingEnabled: renderingEnabled, ...staticProps, sharedPassOrder: sharedPassOrder, sharedPassZIndex: sharedPassZIndex, opticsModel: opticsModel, sdfDisplacementMapDebug: sdfDisplacementMapDebug, sdfContrast: sdfContrast, sdfBrightness: sdfBrightness, sdfSaturation: sdfSaturation, sdfOuterShadowAlpha: sdfOuterShadowAlpha, sdfOuterShadowBlurRadius: sdfOuterShadowBlurRadius, sdfOuterShadowOffsetY: sdfOuterShadowOffsetY, sdfInnerShadowAlpha: sdfInnerShadowAlpha, sdfInnerShadowExtent: sdfInnerShadowExtent, shapeMaskText: shapeMaskText, shapeMaskFontSize: shapeMaskFontSize, shapeMaskFontWeight: shapeMaskFontWeight, syncContentTransform: syncContentTransform }));
|
|
42
|
+
}
|
|
43
|
+
if (exports.AnimatedNativeGlassSurfaceView) {
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(exports.AnimatedNativeGlassSurfaceView, { ref: nativeViewRef, renderingEnabled: renderingEnabled, ...props, sharedPassOrder: sharedPassOrder, sharedPassZIndex: sharedPassZIndex, opticsModel: opticsModel, sdfDisplacementMapDebug: sdfDisplacementMapDebug, sdfContrast: sdfContrast, sdfBrightness: sdfBrightness, sdfSaturation: sdfSaturation, sdfOuterShadowAlpha: sdfOuterShadowAlpha, sdfOuterShadowBlurRadius: sdfOuterShadowBlurRadius, sdfOuterShadowOffsetY: sdfOuterShadowOffsetY, sdfInnerShadowAlpha: sdfInnerShadowAlpha, sdfInnerShadowExtent: sdfInnerShadowExtent, shapeMaskText: shapeMaskText, shapeMaskFontSize: shapeMaskFontSize, shapeMaskFontWeight: shapeMaskFontWeight, syncContentTransform: syncContentTransform }));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return (0, jsx_runtime_1.jsx)(react_native_1.View, { ...props, style: [props.style, !renderingEnabled ? { opacity: 0 } : undefined] });
|
|
48
|
+
}
|
|
49
|
+
function GlassCaptureSourceView({ children, ...props }) {
|
|
50
|
+
if (nativeGlassViews_1.NativeGlassCaptureSource) {
|
|
51
|
+
return (0, jsx_runtime_1.jsx)(nativeGlassViews_1.NativeGlassCaptureSource, { ...props, children: children });
|
|
52
|
+
}
|
|
53
|
+
return (0, jsx_runtime_1.jsx)(react_native_1.View, { ...props, children: children });
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=NativeSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeSurface.js","sourceRoot":"","sources":["../../../src/surface/NativeSurface.tsx"],"names":[],"mappings":";;;;;;AAcA,sDA6FC;AAED,wDAKC;;AAlHD,iCAAiD;AACjD,+CAAoD;AACpD,sFAA+C;AAC/C,wDAAoF;AACpF,0DAAuF;AAI1E,QAAA,8BAA8B,GAAG,yCAAsB;IAChE,CAAC,CAAE,iCAAQ,CAAC,uBAAuB,CAAC,yCAAsB,CAEtD;IACJ,CAAC,CAAC,IAAI,CAAC;AAEX,SAAgB,qBAAqB,CAAC,EAClC,WAAW,EACX,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,aAAa,EAC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,OAAO,uBAAC,mBAAI,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,GAAI,CAAC;AACrG,CAAC;AAED,SAAgB,sBAAsB,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAA2B;IAClF,IAAI,2CAAwB,EAAE,CAAC;QAC3B,OAAO,uBAAC,2CAAwB,OAAK,KAAK,YAAG,QAAQ,GAA4B,CAAC;IACtF,CAAC;IACD,OAAO,uBAAC,mBAAI,OAAK,KAAK,YAAG,QAAQ,GAAQ,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PortalFallbackSurface = exports.PortalGlassSurface = exports.RouteOverlayView = exports.PortalScrollGroupContainer = exports.nextSharedValueGroupId = exports.sharedValueGroupIds = void 0;
|
|
37
|
+
exports.GlassSurfacePortalLayer = GlassSurfacePortalLayer;
|
|
38
|
+
exports.getSharedValueId = getSharedValueId;
|
|
39
|
+
exports.GlassRouteOverlayLayer = GlassRouteOverlayLayer;
|
|
40
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
+
const react_1 = __importStar(require("react"));
|
|
42
|
+
const react_native_1 = require("react-native");
|
|
43
|
+
const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
44
|
+
const contexts_1 = require("./contexts");
|
|
45
|
+
const registry_1 = require("./registry");
|
|
46
|
+
const NativeSurface_1 = require("./NativeSurface");
|
|
47
|
+
const styles_1 = require("./styles");
|
|
48
|
+
function GlassSurfacePortalLayer({ registry, tokens, }) {
|
|
49
|
+
const entries = (0, registry_1.useRegistrySnapshot)(registry);
|
|
50
|
+
const balancedShaderSurfaces = (0, react_1.useMemo)(() => (0, registry_1.selectBalancedShaderSurfaces)(entries), [entries]);
|
|
51
|
+
const groups = (0, react_1.useMemo)(() => {
|
|
52
|
+
const list = [];
|
|
53
|
+
const byKey = new Map();
|
|
54
|
+
for (let i = 0; i < entries.length; i += 1) {
|
|
55
|
+
const pair = entries[i];
|
|
56
|
+
const entry = pair[1];
|
|
57
|
+
const routeId = getSharedValueId(entry.routeTransitionX);
|
|
58
|
+
const key = `${entry.zIndex}::${entry.scrollGroupKey}::${routeId}`;
|
|
59
|
+
let group = byKey.get(key);
|
|
60
|
+
if (!group) {
|
|
61
|
+
group = {
|
|
62
|
+
key,
|
|
63
|
+
zIndex: entry.zIndex,
|
|
64
|
+
offsets: entry.scrollOffsets,
|
|
65
|
+
routeTransitionX: entry.routeTransitionX,
|
|
66
|
+
items: [],
|
|
67
|
+
};
|
|
68
|
+
byKey.set(key, group);
|
|
69
|
+
list.push(group);
|
|
70
|
+
}
|
|
71
|
+
group.items.push(pair);
|
|
72
|
+
}
|
|
73
|
+
return list;
|
|
74
|
+
}, [entries]);
|
|
75
|
+
if (!tokens.enabled)
|
|
76
|
+
return null;
|
|
77
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "box-none", style: react_native_1.StyleSheet.absoluteFill, children: groups.map((group) => {
|
|
78
|
+
const content = group.items.map(([id, entry]) => ((0, jsx_runtime_1.jsx)(exports.PortalGlassSurface, { providerId: entry.samplingProviderId, entry: entry, drawOrder: 0, shaderEnabled: tokens.quality === 'high' ||
|
|
79
|
+
(tokens.quality === 'balanced' && balancedShaderSurfaces.has(id)) }, id)));
|
|
80
|
+
if (group.offsets.length === 0 && !group.routeTransitionX) {
|
|
81
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "box-none", style: [react_native_1.StyleSheet.absoluteFill, { zIndex: group.zIndex }], children: content }, group.key));
|
|
82
|
+
}
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)(exports.PortalScrollGroupContainer, { offsets: group.offsets, routeTransitionX: group.routeTransitionX, zIndex: group.zIndex, children: content }, group.key));
|
|
84
|
+
}) }));
|
|
85
|
+
}
|
|
86
|
+
exports.sharedValueGroupIds = new WeakMap();
|
|
87
|
+
exports.nextSharedValueGroupId = 1;
|
|
88
|
+
function getSharedValueId(value) {
|
|
89
|
+
if (!value)
|
|
90
|
+
return 0;
|
|
91
|
+
let id = exports.sharedValueGroupIds.get(value);
|
|
92
|
+
if (id == null) {
|
|
93
|
+
id = exports.nextSharedValueGroupId++;
|
|
94
|
+
exports.sharedValueGroupIds.set(value, id);
|
|
95
|
+
}
|
|
96
|
+
return id;
|
|
97
|
+
}
|
|
98
|
+
exports.PortalScrollGroupContainer = react_1.default.memo(function PortalScrollGroupContainer({ offsets, routeTransitionX, zIndex, children, }) {
|
|
99
|
+
const groupTransformStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
|
|
100
|
+
let scrollY = 0;
|
|
101
|
+
for (let index = 0; index < offsets.length; index += 1) {
|
|
102
|
+
scrollY += offsets[index].value;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
transform: [{ translateX: routeTransitionX?.value ?? 0 }, { translateY: -scrollY }],
|
|
106
|
+
};
|
|
107
|
+
}, [offsets, routeTransitionX]);
|
|
108
|
+
return ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: "box-none", style: [react_native_1.StyleSheet.absoluteFill, groupTransformStyle, { zIndex }], children: children }));
|
|
109
|
+
});
|
|
110
|
+
function GlassRouteOverlayLayer({ registry, enabled, }) {
|
|
111
|
+
const entries = (0, registry_1.useRegistrySnapshot)(registry);
|
|
112
|
+
if (!enabled)
|
|
113
|
+
return null;
|
|
114
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "box-none", style: react_native_1.StyleSheet.absoluteFill, children: entries.map(([id, entry]) => ((0, jsx_runtime_1.jsx)(exports.RouteOverlayView, { entry: entry }, id))) }));
|
|
115
|
+
}
|
|
116
|
+
exports.RouteOverlayView = react_1.default.memo(function RouteOverlayView({ entry }) {
|
|
117
|
+
const offsets = entry.scrollOffsets;
|
|
118
|
+
const routeTransitionX = entry.routeTransitionX;
|
|
119
|
+
const scrollTransformStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
|
|
120
|
+
let scrollY = 0;
|
|
121
|
+
if (offsets) {
|
|
122
|
+
for (let index = 0; index < offsets.length; index += 1) {
|
|
123
|
+
scrollY += offsets[index].value;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
transform: [{ translateX: routeTransitionX?.value ?? 0 }, { translateY: -scrollY }],
|
|
128
|
+
};
|
|
129
|
+
}, [offsets, routeTransitionX]);
|
|
130
|
+
const hasScrollOrRoute = (offsets != null && offsets.length > 0) || routeTransitionX != null;
|
|
131
|
+
return ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: "box-none", style: [react_native_1.StyleSheet.absoluteFill, entry.style, { zIndex: entry.zIndex }], children: entry.frame ? ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: "box-none", style: [
|
|
132
|
+
{
|
|
133
|
+
position: 'absolute',
|
|
134
|
+
left: entry.frame.x,
|
|
135
|
+
top: entry.frame.y,
|
|
136
|
+
width: entry.frame.width,
|
|
137
|
+
height: entry.frame.height,
|
|
138
|
+
},
|
|
139
|
+
hasScrollOrRoute ? scrollTransformStyle : undefined,
|
|
140
|
+
entry.portalOffsetStyle,
|
|
141
|
+
], children: entry.children })) : (entry.children) }));
|
|
142
|
+
});
|
|
143
|
+
exports.PortalGlassSurface = react_1.default.memo(function PortalGlassSurface({ providerId, entry, drawOrder, shaderEnabled, }) {
|
|
144
|
+
const runtime = (0, react_1.useContext)(contexts_1.GlassRuntimeContext);
|
|
145
|
+
const opticalProgress = entry.opticalProgress;
|
|
146
|
+
const pointerEvent = entry.pointerEvent;
|
|
147
|
+
const pointerEventValue = entry.pointerEventValue;
|
|
148
|
+
const pointerEventSink = entry.pointerEventSink;
|
|
149
|
+
const valueEvent = entry.valueEvent;
|
|
150
|
+
const valueEventSink = entry.valueEventSink;
|
|
151
|
+
const opticalToggleFraction = entry.opticalToggleFraction;
|
|
152
|
+
const opticalProgressValue = entry.opticalProgressValue;
|
|
153
|
+
const opticalPointX = entry.opticalPointX;
|
|
154
|
+
const opticalPointY = entry.opticalPointY;
|
|
155
|
+
const opticalVelocityX = entry.opticalVelocityX;
|
|
156
|
+
const opticalVelocityY = entry.opticalVelocityY;
|
|
157
|
+
const opticalMotionX = entry.opticalMotionX;
|
|
158
|
+
const opticalMotionY = entry.opticalMotionY;
|
|
159
|
+
const hasAnimatedOptics = Boolean(opticalPointX ||
|
|
160
|
+
opticalPointY ||
|
|
161
|
+
opticalVelocityX ||
|
|
162
|
+
opticalVelocityY ||
|
|
163
|
+
opticalProgressValue != null ||
|
|
164
|
+
opticalProgress ||
|
|
165
|
+
opticalToggleFraction ||
|
|
166
|
+
opticalMotionX ||
|
|
167
|
+
opticalMotionY);
|
|
168
|
+
const animatedOptics = (0, react_native_reanimated_1.useAnimatedProps)(() => ({
|
|
169
|
+
interactionVelocityX: opticalVelocityX?.value,
|
|
170
|
+
interactionVelocityY: opticalVelocityY?.value,
|
|
171
|
+
interactionPointX: opticalPointX?.value,
|
|
172
|
+
interactionPointY: opticalPointY?.value,
|
|
173
|
+
interactionProgress: opticalProgressValue ?? opticalProgress?.value ?? 0,
|
|
174
|
+
toggleFraction: opticalToggleFraction?.value ?? 0,
|
|
175
|
+
motionX: opticalMotionX ? Math.max(-1, Math.min(1, opticalMotionX.value / 1800)) : undefined,
|
|
176
|
+
motionY: opticalMotionY ? Math.max(-1, Math.min(1, opticalMotionY.value / 1800)) : undefined,
|
|
177
|
+
}), [
|
|
178
|
+
opticalPointX,
|
|
179
|
+
opticalPointY,
|
|
180
|
+
opticalVelocityX,
|
|
181
|
+
opticalVelocityY,
|
|
182
|
+
opticalProgress,
|
|
183
|
+
pointerEventValue,
|
|
184
|
+
valueEvent,
|
|
185
|
+
opticalToggleFraction,
|
|
186
|
+
opticalProgressValue,
|
|
187
|
+
opticalMotionX,
|
|
188
|
+
opticalMotionY,
|
|
189
|
+
]);
|
|
190
|
+
if (!runtime)
|
|
191
|
+
return null;
|
|
192
|
+
const { tokens, dark, reducedMotion } = runtime;
|
|
193
|
+
// Backdrop glass is drawn in a sibling overlay, above the actual control.
|
|
194
|
+
// Some native render backends still participate in Android hit testing even
|
|
195
|
+
// with pointerEvents="none" on the native view itself, so make the whole
|
|
196
|
+
// portal subtree untargetable for passive lenses. Keep box-none where its
|
|
197
|
+
// React content or an explicitly interactive surface needs to receive input.
|
|
198
|
+
const portalPointerEvents = entry.interactive || entry.portalContent || entry.contentAboveGlass ? 'box-none' : 'none';
|
|
199
|
+
const material = entry.materialOverrides
|
|
200
|
+
? { ...tokens.materials[entry.variant], ...entry.materialOverrides }
|
|
201
|
+
: tokens.materials[entry.variant];
|
|
202
|
+
const qualityScale = material.opticsModel === 'referenceParity'
|
|
203
|
+
? 1
|
|
204
|
+
: tokens.quality === 'high'
|
|
205
|
+
? 1.2
|
|
206
|
+
: tokens.quality === 'fallback'
|
|
207
|
+
? 0.45
|
|
208
|
+
: 1;
|
|
209
|
+
if (!shaderEnabled)
|
|
210
|
+
return (0, jsx_runtime_1.jsx)(exports.PortalFallbackSurface, { entry: entry });
|
|
211
|
+
const nativeSurface = ((0, jsx_runtime_1.jsx)(NativeSurface_1.NativeBackdropSurface, { providerId: providerId, sharedPassZIndex: entry.zIndex, sharedPassOrder: drawOrder, opticsModel: material.opticsModel, shapeMaskText: entry.shapeMaskText, shapeMaskFontSize: entry.shapeMaskFontSize, shapeMaskFontWeight: entry.shapeMaskFontWeight, progressiveBlurIntensity: entry.progressiveBlurIntensity, depthEffect: material.referenceDepthEffect ?? false, highlightStyle: material.referenceHighlightStyle, interactionProfile: material.referenceInteractionProfile, contentScaleX: material.referenceContentScaleX, contentScaleY: material.referenceContentScaleY, sampleOffsetX: material.referenceSampleOffsetX, sampleOffsetY: material.referenceSampleOffsetY, toggleTrackColorOff: material.referenceToggleTrackColorOff, toggleTrackColorOn: material.referenceToggleTrackColorOn, toggleTrackWidth: material.referenceToggleTrackWidth, toggleTrackHeight: material.referenceToggleTrackHeight, toggleSolidBackdropColor: material.referenceToggleSolidBackdropColor, brightness: material.brightness ?? 0, contrast: material.contrast ?? 1, highlightFalloff: material.highlightFalloff ?? 1, sdfContrast: material.sdfScaleLens?.contrast, sdfBrightness: material.sdfScaleLens?.brightness, sdfSaturation: material.sdfScaleLens?.saturation, sdfOuterShadowAlpha: material.sdfScaleLens?.outerShadowAlpha, sdfOuterShadowBlurRadius: material.sdfScaleLens?.outerShadowBlurRadius, sdfOuterShadowOffsetY: material.sdfScaleLens?.outerShadowOffsetY, sdfInnerShadowAlpha: material.sdfScaleLens?.innerShadowAlpha, sdfInnerShadowExtent: material.sdfScaleLens?.innerShadowExtent, cornerRadius: material.radius, blurRadius: material.blurRadius * qualityScale, refractionHeight: material.refractionHeight * qualityScale, refractionAmount: material.refractionAmount * qualityScale, bodyRefractionAmount: (material.refractionBodyAmount ?? 2.5) * qualityScale, interactionProgress: opticalProgressValue ?? 0,
|
|
212
|
+
// The pointer stream must be a real prop, not only an animated one:
|
|
213
|
+
// Reanimated's animatedProps path does not reach an Expo Modules view's
|
|
214
|
+
// prop setter, so a gesture sent only there is silently dropped and the
|
|
215
|
+
// native driver never sees a single event.
|
|
216
|
+
pointerEvent: entry.pointerEventValue, pointerEventSink: pointerEventSink, valueEvent: entry.valueEvent, valueEventSink: valueEventSink, saturation: material.saturation, chromaticAberration: material.opticsModel === 'referenceParity' ||
|
|
217
|
+
tokens.quality === 'high' ||
|
|
218
|
+
entry.variant === 'tabSelectionLens'
|
|
219
|
+
? material.chromaticAberration
|
|
220
|
+
: 0, highlightAlpha: material.highlightAlpha, highlightWidth: material.highlightWidth, lightAngle: material.highlightAngle ?? 45, highlightColor: material.highlightColor
|
|
221
|
+
? dark
|
|
222
|
+
? material.highlightColor.dark
|
|
223
|
+
: material.highlightColor.light
|
|
224
|
+
: undefined, tintAlpha: material.tintAlpha ?? 1, specularStrength: material.specularStrength ?? 1, fresnelStrength: material.fresnelStrength ?? 0.85, innerShadowStrength: material.innerShadowStrength ?? (material.opticsModel === 'referenceParity' ? 0 : 0.18), shadowOpacity: material.shadowOpacity ?? (material.opticsModel === 'referenceParity' ? 0 : 0.1), shadowRadius: material.shadowRadius ?? (material.opticsModel === 'referenceParity' ? 0 : 24), shadowOffsetY: material.shadowOffsetY ?? (material.opticsModel === 'referenceParity' ? 0 : 4), tint: entry.tintColor ?? (dark ? tokens.tint.dark : tokens.tint.light), surfaceColor: material.surfaceColor
|
|
225
|
+
? dark
|
|
226
|
+
? material.surfaceColor.dark
|
|
227
|
+
: material.surfaceColor.light
|
|
228
|
+
: undefined, interactive: entry.interactive && tokens.interaction.enabled && !reducedMotion, pointerEvents: entry.interactive && tokens.interaction.enabled && !reducedMotion ? 'auto' : 'none', continuous: entry.continuous, sharedSource: entry.sharedSource, captureProbe: entry.captureProbe, motionX: undefined, motionY: undefined, displacementOnlyDebug: entry.displacementOnlyDebug, syncContentTransform: entry.syncContentTransform, animatedProps: hasAnimatedOptics ? animatedOptics : undefined, style: [
|
|
229
|
+
styles_1.styles.nativeSurface,
|
|
230
|
+
entry.placement === 'layout'
|
|
231
|
+
? react_native_1.StyleSheet.absoluteFill
|
|
232
|
+
: { width: entry.frame.width > 0 ? entry.frame.width : undefined },
|
|
233
|
+
{ borderRadius: material.radius },
|
|
234
|
+
] }));
|
|
235
|
+
if (entry.placement === 'bottom' || entry.placement === 'center') {
|
|
236
|
+
const hasMotion = entry.animatedStyle != null || entry.portalOffsetStyle != null;
|
|
237
|
+
if (!hasMotion) {
|
|
238
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: portalPointerEvents, style: [
|
|
239
|
+
react_native_1.StyleSheet.absoluteFill,
|
|
240
|
+
entry.placement === 'center' ? styles_1.styles.centerPlacement : styles_1.styles.bottomPlacement,
|
|
241
|
+
entry.placement === 'bottom' && entry.bottomInset != null
|
|
242
|
+
? { paddingBottom: entry.bottomInset }
|
|
243
|
+
: undefined,
|
|
244
|
+
], children: nativeSurface }));
|
|
245
|
+
}
|
|
246
|
+
return ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: portalPointerEvents, style: [
|
|
247
|
+
react_native_1.StyleSheet.absoluteFill,
|
|
248
|
+
entry.placement === 'center' ? styles_1.styles.centerPlacement : styles_1.styles.bottomPlacement,
|
|
249
|
+
entry.placement === 'bottom' && entry.bottomInset != null
|
|
250
|
+
? { paddingBottom: entry.bottomInset }
|
|
251
|
+
: undefined,
|
|
252
|
+
entry.animatedStyle,
|
|
253
|
+
entry.portalOffsetStyle,
|
|
254
|
+
], children: nativeSurface }));
|
|
255
|
+
}
|
|
256
|
+
const portalContent = entry.portalContent && entry.placement === 'layout' ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "box-none", accessible: false, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: [
|
|
257
|
+
react_native_1.StyleSheet.absoluteFill,
|
|
258
|
+
styles_1.styles.portalContentOverlay,
|
|
259
|
+
{ borderRadius: material.radius },
|
|
260
|
+
], children: entry.portalContent })) : null;
|
|
261
|
+
const innerContent = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [nativeSurface, entry.contentAboveGlass && entry.content ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "box-none", style: [
|
|
262
|
+
react_native_1.StyleSheet.absoluteFill,
|
|
263
|
+
{ borderRadius: material.radius },
|
|
264
|
+
styles_1.styles.contentAboveGlass,
|
|
265
|
+
], children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: entry.contentStyle, children: entry.content }) })) : null, portalContent] }));
|
|
266
|
+
const hasMotion = (entry.positioning === 'floating' && entry.animatedStyle != null) || entry.portalOffsetStyle != null;
|
|
267
|
+
if (!hasMotion) {
|
|
268
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: portalPointerEvents, collapsable: !entry.syncContentTransform, style: [
|
|
269
|
+
styles_1.styles.portalSurface,
|
|
270
|
+
{
|
|
271
|
+
left: entry.frame.x,
|
|
272
|
+
top: entry.frame.y,
|
|
273
|
+
width: entry.frame.width,
|
|
274
|
+
height: entry.frame.height,
|
|
275
|
+
},
|
|
276
|
+
], children: innerContent }));
|
|
277
|
+
}
|
|
278
|
+
return ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: portalPointerEvents, collapsable: !entry.syncContentTransform, style: [
|
|
279
|
+
styles_1.styles.portalSurface,
|
|
280
|
+
{
|
|
281
|
+
left: entry.frame.x,
|
|
282
|
+
top: entry.frame.y,
|
|
283
|
+
width: entry.frame.width,
|
|
284
|
+
height: entry.frame.height,
|
|
285
|
+
},
|
|
286
|
+
entry.positioning === 'floating' ? entry.animatedStyle : undefined,
|
|
287
|
+
entry.portalOffsetStyle,
|
|
288
|
+
], children: innerContent }));
|
|
289
|
+
});
|
|
290
|
+
exports.PortalFallbackSurface = react_1.default.memo(function PortalFallbackSurface({ entry, }) {
|
|
291
|
+
const runtime = (0, react_1.useContext)(contexts_1.GlassRuntimeContext);
|
|
292
|
+
if (!runtime)
|
|
293
|
+
return null;
|
|
294
|
+
const { tokens, dark } = runtime;
|
|
295
|
+
const portalPointerEvents = entry.interactive || entry.portalContent || entry.contentAboveGlass ? 'box-none' : 'none';
|
|
296
|
+
const material = tokens.materials[entry.variant];
|
|
297
|
+
const fallbackSurface = ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "none", style: [
|
|
298
|
+
styles_1.styles.fallbackSurface,
|
|
299
|
+
entry.placement === 'layout'
|
|
300
|
+
? react_native_1.StyleSheet.absoluteFill
|
|
301
|
+
: { width: entry.frame.width > 0 ? entry.frame.width : undefined },
|
|
302
|
+
{
|
|
303
|
+
backgroundColor: dark ? tokens.fallbackTint.dark : tokens.fallbackTint.light,
|
|
304
|
+
borderColor: dark ? tokens.fallbackBorder.dark : tokens.fallbackBorder.light,
|
|
305
|
+
borderRadius: material.radius,
|
|
306
|
+
},
|
|
307
|
+
] }));
|
|
308
|
+
if (entry.placement === 'bottom' || entry.placement === 'center') {
|
|
309
|
+
return ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: portalPointerEvents, style: [
|
|
310
|
+
react_native_1.StyleSheet.absoluteFill,
|
|
311
|
+
entry.placement === 'center' ? styles_1.styles.centerPlacement : styles_1.styles.bottomPlacement,
|
|
312
|
+
entry.placement === 'bottom' && entry.bottomInset != null
|
|
313
|
+
? { paddingBottom: entry.bottomInset }
|
|
314
|
+
: undefined,
|
|
315
|
+
entry.animatedStyle,
|
|
316
|
+
entry.portalOffsetStyle,
|
|
317
|
+
], children: fallbackSurface }));
|
|
318
|
+
}
|
|
319
|
+
return ((0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: portalPointerEvents, style: [
|
|
320
|
+
styles_1.styles.portalSurface,
|
|
321
|
+
{
|
|
322
|
+
left: entry.frame.x,
|
|
323
|
+
top: entry.frame.y,
|
|
324
|
+
width: entry.frame.width,
|
|
325
|
+
height: entry.frame.height,
|
|
326
|
+
},
|
|
327
|
+
entry.animatedStyle,
|
|
328
|
+
entry.portalOffsetStyle,
|
|
329
|
+
], children: fallbackSurface }));
|
|
330
|
+
});
|
|
331
|
+
//# sourceMappingURL=PortalLayers.js.map
|