@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,867 @@
|
|
|
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.AnimatedNativeGlassSurface = void 0;
|
|
37
|
+
exports.withAlpha = withAlpha;
|
|
38
|
+
exports.InlineGlassTabBar = InlineGlassTabBar;
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const useInlineTabGesture_1 = require("./useInlineTabGesture");
|
|
41
|
+
const tabDebug_1 = require("./tabDebug");
|
|
42
|
+
const react_1 = require("react");
|
|
43
|
+
const react_native_1 = require("react-native");
|
|
44
|
+
const Haptics = __importStar(require("expo-haptics"));
|
|
45
|
+
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
46
|
+
const react_native_reanimated_1 = require("react-native-reanimated");
|
|
47
|
+
const GlassSurface_1 = require("../GlassSurface");
|
|
48
|
+
const nativeGlassViews_1 = require("../nativeGlassViews");
|
|
49
|
+
const tabConstants_1 = require("./tabConstants");
|
|
50
|
+
const tabConstants_2 = require("./tabConstants");
|
|
51
|
+
const tabConstants_3 = require("./tabConstants");
|
|
52
|
+
const tabConstants_4 = require("./tabConstants");
|
|
53
|
+
const tabConstants_5 = require("./tabConstants");
|
|
54
|
+
const tabConstants_6 = require("./tabConstants");
|
|
55
|
+
const tabConstants_7 = require("./tabConstants");
|
|
56
|
+
const tabConstants_8 = require("./tabConstants");
|
|
57
|
+
const tabConstants_9 = require("./tabConstants");
|
|
58
|
+
const tabConstants_10 = require("./tabConstants");
|
|
59
|
+
const tabConstants_11 = require("./tabConstants");
|
|
60
|
+
const tabConstants_12 = require("./tabConstants");
|
|
61
|
+
const tabConstants_13 = require("./tabConstants");
|
|
62
|
+
const tabConstants_14 = require("./tabConstants");
|
|
63
|
+
const GlassTabItem_1 = require("./GlassTabItem");
|
|
64
|
+
const GlassTabItem_2 = require("./GlassTabItem");
|
|
65
|
+
const tabStyles_1 = require("./tabStyles");
|
|
66
|
+
exports.AnimatedNativeGlassSurface = nativeGlassViews_1.NativeGlassSurfaceView
|
|
67
|
+
? (0, react_native_reanimated_1.createAnimatedComponent)(nativeGlassViews_1.NativeGlassSurfaceView)
|
|
68
|
+
: null;
|
|
69
|
+
function withAlpha(color, alpha, fallback) {
|
|
70
|
+
const value = color.trim();
|
|
71
|
+
const rgba = value.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i);
|
|
72
|
+
if (rgba)
|
|
73
|
+
return `rgba(${Math.round(Number(rgba[1]))},${Math.round(Number(rgba[2]))},${Math.round(Number(rgba[3]))},${alpha})`;
|
|
74
|
+
const hex = value.replace(/^#/, '');
|
|
75
|
+
if (/^[\da-f]{3}$/i.test(hex)) {
|
|
76
|
+
return `rgba(${parseInt(hex[0] + hex[0], 16)},${parseInt(hex[1] + hex[1], 16)},${parseInt(hex[2] + hex[2], 16)},${alpha})`;
|
|
77
|
+
}
|
|
78
|
+
if (/^[\da-f]{6}([\da-f]{2})?$/i.test(hex)) {
|
|
79
|
+
return `rgba(${parseInt(hex.slice(0, 2), 16)},${parseInt(hex.slice(2, 4), 16)},${parseInt(hex.slice(4, 6), 16)},${alpha})`;
|
|
80
|
+
}
|
|
81
|
+
return fallback;
|
|
82
|
+
}
|
|
83
|
+
function InlineGlassTabBar({ items, selected, bottomInset = 0, shellBackgroundColor, onSelect, onSelectFromDrag, renderIcon, renderItem, presentation = 'floating', height = tabConstants_1.TAB_BAR_HEIGHT, width: requestedWidth, horizontalPadding = tabConstants_6.TAB_BAR_HORIZONTAL_PADDING, shellRadius, lensMaxWidth = tabConstants_8.SELECTION_LENS_MAX_WIDTH, lensRefractionHeight, accessibilityHint, }) {
|
|
84
|
+
const { width: windowWidth, height: windowHeight } = (0, react_native_1.useWindowDimensions)();
|
|
85
|
+
const appearance = (0, GlassSurface_1.useGlassAppearance)();
|
|
86
|
+
const reducedMotion = (0, GlassSurface_1.useGlassReducedMotion)();
|
|
87
|
+
const tabBarMaterial = appearance?.tokens.materials.tabBarShell ?? appearance?.tokens.materials.tabBar;
|
|
88
|
+
const nativeLiveAvailable = react_native_1.Platform.OS === 'android' && appearance?.tokens.quality !== 'fallback';
|
|
89
|
+
const NativeGlassSurface = exports.AnimatedNativeGlassSurface ?? react_native_1.View;
|
|
90
|
+
const dark = appearance?.dark ?? false;
|
|
91
|
+
const shellSurfaceColor = shellBackgroundColor
|
|
92
|
+
? withAlpha(shellBackgroundColor, 0.4, dark ? 'rgba(18,18,18,0.4)' : 'rgba(250,250,250,0.4)')
|
|
93
|
+
: dark
|
|
94
|
+
? 'rgba(18,18,18,0.4)'
|
|
95
|
+
: 'rgba(250,250,250,0.4)';
|
|
96
|
+
// An inline bar is drawn inside the page's route capture source. Pointing the
|
|
97
|
+
// selection lens at that same source makes the captured RenderNode contain the
|
|
98
|
+
// lens whose RenderEffect consumes it - a cycle that overflowed the stack in
|
|
99
|
+
// RenderNode::prepareTreeImpl on the User page. Inline lenses sample the theme
|
|
100
|
+
// backdrop instead, which is never an ancestor of the lens itself.
|
|
101
|
+
const samplingProviderId = (0, GlassSurface_1.useGlassSamplingProviderId)(presentation === 'inline' ? 'themeBackdrop' : 'routeScene') ?? '';
|
|
102
|
+
const tabScopeId = (0, react_1.useId)();
|
|
103
|
+
const [inlineWidth, setInlineWidth] = (0, react_1.useState)(0);
|
|
104
|
+
const shellBorderColor = appearance?.tokens.fallbackBorder[dark ? 'dark' : 'light'] ?? 'transparent';
|
|
105
|
+
const shellShadowColor = appearance?.tokens.procedural.outerShadow[dark ? 'dark' : 'light'] ?? 'transparent';
|
|
106
|
+
const itemCount = Math.max(items.length, 1);
|
|
107
|
+
const desiredWidth = itemCount * 100 + tabConstants_6.TAB_BAR_HORIZONTAL_PADDING * 2;
|
|
108
|
+
const floatingWidth = Math.min(Math.min(tabConstants_4.TAB_BAR_MAX_WIDTH, Math.max(tabConstants_5.TAB_BAR_MIN_WIDTH, desiredWidth)), Math.max(0, windowWidth - tabConstants_3.TAB_BAR_SIDE_MARGIN * 2));
|
|
109
|
+
const barWidth = presentation === 'inline'
|
|
110
|
+
? typeof requestedWidth === 'number'
|
|
111
|
+
? requestedWidth
|
|
112
|
+
: inlineWidth
|
|
113
|
+
: floatingWidth;
|
|
114
|
+
const itemWidth = Math.max(0, (barWidth - horizontalPadding * 2) / itemCount);
|
|
115
|
+
const lensWidth = Math.max(44, Math.min(lensMaxWidth, itemWidth - 8));
|
|
116
|
+
const lensBaseHeight = Math.min(tabConstants_7.SELECTION_LENS_HEIGHT, height - 8);
|
|
117
|
+
const verticalInset = (height - lensBaseHeight) / 2;
|
|
118
|
+
const selectedCenterX = horizontalPadding + itemWidth * (selected + 0.5);
|
|
119
|
+
const selectedLeft = selectedCenterX - lensWidth / 2;
|
|
120
|
+
const [inlineScreenLeft, setInlineScreenLeft] = (0, react_1.useState)(0);
|
|
121
|
+
const inlineHostRef = (0, react_1.useRef)(null);
|
|
122
|
+
const shellScreenLeft = presentation === 'floating' ? (windowWidth - barWidth) / 2 : inlineScreenLeft;
|
|
123
|
+
// The shell lives inside the floating glass overlay, where measureInWindow
|
|
124
|
+
// returns a rect from the wrong native branch. Publish the geometry the bar
|
|
125
|
+
// is actually laid out at instead of trusting that measurement.
|
|
126
|
+
const shellFrameOverride = presentation === 'floating'
|
|
127
|
+
? {
|
|
128
|
+
x: shellScreenLeft,
|
|
129
|
+
y: windowHeight - bottomInset - tabConstants_2.TAB_BAR_BOTTOM_GAP - height,
|
|
130
|
+
width: barWidth,
|
|
131
|
+
height,
|
|
132
|
+
}
|
|
133
|
+
: undefined;
|
|
134
|
+
const lensLeft = (0, react_native_reanimated_1.useSharedValue)(selectedLeft);
|
|
135
|
+
const lensRight = (0, react_native_reanimated_1.useSharedValue)(selectedLeft + lensWidth);
|
|
136
|
+
const lensHeight = (0, react_native_reanimated_1.useSharedValue)(lensBaseHeight);
|
|
137
|
+
const lensOffsetY = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
138
|
+
const interactionProgress = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
139
|
+
const phase = (0, react_native_reanimated_1.useSharedValue)('idle');
|
|
140
|
+
const grabOffsetX = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
141
|
+
const originSelectedIndex = (0, react_native_reanimated_1.useSharedValue)(selected);
|
|
142
|
+
const hoveredIndex = (0, react_native_reanimated_1.useSharedValue)(selected);
|
|
143
|
+
const pendingIndex = (0, react_native_reanimated_1.useSharedValue)(selected);
|
|
144
|
+
const snapStarted = (0, react_native_reanimated_1.useSharedValue)(false);
|
|
145
|
+
const interactionActive = (0, react_native_reanimated_1.useSharedValue)(false);
|
|
146
|
+
const holdCandidate = (0, react_native_reanimated_1.useSharedValue)(false);
|
|
147
|
+
const holdActivated = (0, react_native_reanimated_1.useSharedValue)(false);
|
|
148
|
+
const panActivated = (0, react_native_reanimated_1.useSharedValue)(false);
|
|
149
|
+
const panActivationRequested = (0, react_native_reanimated_1.useSharedValue)(false);
|
|
150
|
+
const panUpdateLogged = (0, react_native_reanimated_1.useSharedValue)(false);
|
|
151
|
+
const touchSessionActive = (0, react_native_reanimated_1.useSharedValue)(false);
|
|
152
|
+
const touchMovedPastSlop = (0, react_native_reanimated_1.useSharedValue)(false);
|
|
153
|
+
const sessionId = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
154
|
+
const touchedIndex = (0, react_native_reanimated_1.useSharedValue)(selected);
|
|
155
|
+
const holdTimerProgress = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
156
|
+
const touchStartX = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
157
|
+
const touchStartY = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
158
|
+
const lastHapticIndex = (0, react_native_reanimated_1.useSharedValue)(-1);
|
|
159
|
+
const dragVelocityX = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
160
|
+
const dragVelocityY = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
161
|
+
const [liveBackdropEnabled, setLiveBackdropEnabled] = (0, react_1.useState)(false);
|
|
162
|
+
const interactionActiveRef = (0, react_1.useRef)(false);
|
|
163
|
+
const dragCommittedTargetRef = (0, react_1.useRef)(null);
|
|
164
|
+
const previousGeometryRef = (0, react_1.useRef)({ selected, barWidth: 0 });
|
|
165
|
+
const [gestureDebug, setGestureDebug] = (0, react_1.useState)({
|
|
166
|
+
phase: 'idle',
|
|
167
|
+
holdCandidate: false,
|
|
168
|
+
holdActivated: false,
|
|
169
|
+
dragging: false,
|
|
170
|
+
snapStarted: false,
|
|
171
|
+
gestureCount: 0,
|
|
172
|
+
origin: selected,
|
|
173
|
+
hovered: selected,
|
|
174
|
+
pending: selected,
|
|
175
|
+
touchCount: 0,
|
|
176
|
+
});
|
|
177
|
+
const noteTabViewTouch = (0, react_1.useCallback)(() => {
|
|
178
|
+
if (tabConstants_10.GESTURE_DEBUG_ENABLED)
|
|
179
|
+
setGestureDebug((current) => ({ ...current, touchCount: current.touchCount + 1 }));
|
|
180
|
+
}, []);
|
|
181
|
+
const noteGestureDown = (0, react_1.useCallback)(() => {
|
|
182
|
+
if (tabConstants_10.GESTURE_DEBUG_ENABLED)
|
|
183
|
+
setGestureDebug((current) => ({ ...current, gestureCount: current.gestureCount + 1 }));
|
|
184
|
+
}, []);
|
|
185
|
+
const updateGestureDebug = (0, react_1.useCallback)((nextPhase, nextHoldCandidate, nextHoldActivated, nextDragging, nextSnapStarted, origin, hovered, pending) => {
|
|
186
|
+
if (!tabConstants_10.GESTURE_DEBUG_ENABLED)
|
|
187
|
+
return;
|
|
188
|
+
setGestureDebug((current) => ({
|
|
189
|
+
...current,
|
|
190
|
+
phase: nextPhase,
|
|
191
|
+
holdCandidate: nextHoldCandidate,
|
|
192
|
+
holdActivated: nextHoldActivated,
|
|
193
|
+
dragging: nextDragging,
|
|
194
|
+
snapStarted: nextSnapStarted,
|
|
195
|
+
origin,
|
|
196
|
+
hovered,
|
|
197
|
+
pending,
|
|
198
|
+
}));
|
|
199
|
+
}, []);
|
|
200
|
+
(0, react_native_reanimated_1.useAnimatedReaction)(() => ({
|
|
201
|
+
phase: phase.value,
|
|
202
|
+
holdCandidate: holdCandidate.value,
|
|
203
|
+
holdActivated: holdActivated.value,
|
|
204
|
+
dragging: panActivated.value,
|
|
205
|
+
snapStarted: snapStarted.value,
|
|
206
|
+
origin: originSelectedIndex.value,
|
|
207
|
+
hovered: hoveredIndex.value,
|
|
208
|
+
pending: pendingIndex.value,
|
|
209
|
+
}), (current, previous) => {
|
|
210
|
+
if (!tabConstants_10.GESTURE_DEBUG_ENABLED)
|
|
211
|
+
return;
|
|
212
|
+
if (previous == null ||
|
|
213
|
+
current.phase !== previous.phase ||
|
|
214
|
+
current.holdCandidate !== previous.holdCandidate ||
|
|
215
|
+
current.holdActivated !== previous.holdActivated ||
|
|
216
|
+
current.dragging !== previous.dragging ||
|
|
217
|
+
current.snapStarted !== previous.snapStarted ||
|
|
218
|
+
current.origin !== previous.origin ||
|
|
219
|
+
current.hovered !== previous.hovered ||
|
|
220
|
+
current.pending !== previous.pending) {
|
|
221
|
+
(0, react_native_reanimated_1.runOnJS)(updateGestureDebug)(current.phase, current.holdCandidate, current.holdActivated, current.dragging, current.snapStarted, current.origin, current.hovered, current.pending);
|
|
222
|
+
}
|
|
223
|
+
}, [
|
|
224
|
+
holdCandidate,
|
|
225
|
+
holdActivated,
|
|
226
|
+
hoveredIndex,
|
|
227
|
+
originSelectedIndex,
|
|
228
|
+
panActivated,
|
|
229
|
+
pendingIndex,
|
|
230
|
+
phase,
|
|
231
|
+
snapStarted,
|
|
232
|
+
updateGestureDebug,
|
|
233
|
+
]);
|
|
234
|
+
const beginInteraction = (0, react_1.useCallback)(() => {
|
|
235
|
+
interactionActiveRef.current = true;
|
|
236
|
+
dragCommittedTargetRef.current = null;
|
|
237
|
+
if (nativeLiveAvailable)
|
|
238
|
+
setLiveBackdropEnabled(true);
|
|
239
|
+
void Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light).catch(() => undefined);
|
|
240
|
+
}, [nativeLiveAvailable]);
|
|
241
|
+
const activateHoldOnUI = (0, react_1.useCallback)((expectedSessionId, expectedIndex) => {
|
|
242
|
+
'worklet';
|
|
243
|
+
if (!touchSessionActive.value ||
|
|
244
|
+
sessionId.value !== expectedSessionId ||
|
|
245
|
+
!holdCandidate.value ||
|
|
246
|
+
touchMovedPastSlop.value ||
|
|
247
|
+
expectedIndex !== selected)
|
|
248
|
+
return;
|
|
249
|
+
holdCandidate.value = false;
|
|
250
|
+
holdActivated.value = true;
|
|
251
|
+
phase.value = 'inflating';
|
|
252
|
+
interactionActive.value = true;
|
|
253
|
+
originSelectedIndex.value = selected;
|
|
254
|
+
hoveredIndex.value = selected;
|
|
255
|
+
pendingIndex.value = selected;
|
|
256
|
+
const currentCenter = (lensLeft.value + lensRight.value) / 2;
|
|
257
|
+
grabOffsetX.value = touchStartX.value - shellScreenLeft - currentCenter;
|
|
258
|
+
const expandedWidth = lensWidth + (reducedMotion ? 8 : 20);
|
|
259
|
+
const expandedHeight = lensBaseHeight + (reducedMotion ? 4 : 10);
|
|
260
|
+
lensLeft.value = (0, react_native_reanimated_1.withSpring)(currentCenter - expandedWidth / 2, reducedMotion ? tabConstants_11.IDLE_SPRING : { damping: 23, stiffness: 360, mass: 0.7 });
|
|
261
|
+
lensRight.value = (0, react_native_reanimated_1.withSpring)(currentCenter + expandedWidth / 2, reducedMotion ? tabConstants_11.IDLE_SPRING : { damping: 23, stiffness: 360, mass: 0.7 });
|
|
262
|
+
lensHeight.value = (0, react_native_reanimated_1.withSpring)(expandedHeight, reducedMotion ? { damping: 25, stiffness: 390 } : { damping: 23, stiffness: 350, mass: 0.7 });
|
|
263
|
+
interactionProgress.value = (0, react_native_reanimated_1.withTiming)(1, { duration: reducedMotion ? 85 : 135 });
|
|
264
|
+
(0, react_native_reanimated_1.runOnJS)(tabDebug_1.logGlassTabGesture)('HOLD_ACTIVE', `index=${selected}`);
|
|
265
|
+
(0, react_native_reanimated_1.runOnJS)(beginInteraction)();
|
|
266
|
+
if (tabConstants_10.GESTURE_DEBUG_ENABLED) {
|
|
267
|
+
(0, react_native_reanimated_1.runOnJS)(updateGestureDebug)('inflating', false, true, false, false, selected, selected, selected);
|
|
268
|
+
}
|
|
269
|
+
}, [
|
|
270
|
+
beginInteraction,
|
|
271
|
+
grabOffsetX,
|
|
272
|
+
holdActivated,
|
|
273
|
+
holdCandidate,
|
|
274
|
+
hoveredIndex,
|
|
275
|
+
interactionActive,
|
|
276
|
+
interactionProgress,
|
|
277
|
+
lensBaseHeight,
|
|
278
|
+
lensHeight,
|
|
279
|
+
lensLeft,
|
|
280
|
+
lensRight,
|
|
281
|
+
lensWidth,
|
|
282
|
+
originSelectedIndex,
|
|
283
|
+
pendingIndex,
|
|
284
|
+
phase,
|
|
285
|
+
reducedMotion,
|
|
286
|
+
selected,
|
|
287
|
+
sessionId,
|
|
288
|
+
shellScreenLeft,
|
|
289
|
+
touchMovedPastSlop,
|
|
290
|
+
touchSessionActive,
|
|
291
|
+
touchStartX,
|
|
292
|
+
updateGestureDebug,
|
|
293
|
+
]);
|
|
294
|
+
const commitDragSelection = (0, react_1.useCallback)((targetIndex, startIndex) => {
|
|
295
|
+
const safeTarget = Math.max(0, Math.min(itemCount - 1, targetIndex));
|
|
296
|
+
const safeStart = Math.max(0, Math.min(itemCount - 1, startIndex));
|
|
297
|
+
if (safeTarget === safeStart || dragCommittedTargetRef.current !== null)
|
|
298
|
+
return;
|
|
299
|
+
// Mark this as the drag's own page change before notifying navigation.
|
|
300
|
+
// The selection effect must leave the remaining glass settle intact.
|
|
301
|
+
dragCommittedTargetRef.current = safeTarget;
|
|
302
|
+
previousGeometryRef.current = { selected: safeTarget, barWidth };
|
|
303
|
+
(0, tabDebug_1.logGlassTabGesture)('COMMIT', `target=${safeTarget}`);
|
|
304
|
+
(onSelectFromDrag ?? onSelect)(safeTarget);
|
|
305
|
+
}, [barWidth, itemCount, onSelect, onSelectFromDrag]);
|
|
306
|
+
const finishInteraction = (0, react_1.useCallback)((targetIndex) => {
|
|
307
|
+
const safeTarget = Math.max(0, Math.min(itemCount - 1, targetIndex));
|
|
308
|
+
interactionActiveRef.current = false;
|
|
309
|
+
setLiveBackdropEnabled(false);
|
|
310
|
+
previousGeometryRef.current = { selected: safeTarget, barWidth };
|
|
311
|
+
dragCommittedTargetRef.current = null;
|
|
312
|
+
(0, tabDebug_1.logGlassTabGesture)('BACKDROP_OFF');
|
|
313
|
+
(0, tabDebug_1.logGlassTabGesture)('RESET');
|
|
314
|
+
}, [barWidth, itemCount]);
|
|
315
|
+
const resetInteractionOnUI = (0, react_1.useCallback)((targetIndex) => {
|
|
316
|
+
'worklet';
|
|
317
|
+
const safeTarget = Math.max(0, Math.min(itemCount - 1, targetIndex));
|
|
318
|
+
if (phase.value === 'idle' && !interactionActive.value && !snapStarted.value)
|
|
319
|
+
return;
|
|
320
|
+
// Mark idle before cancelling. A cancelled animation callback can
|
|
321
|
+
// re-enter this function, where it will now be a harmless no-op.
|
|
322
|
+
phase.value = 'idle';
|
|
323
|
+
interactionActive.value = false;
|
|
324
|
+
snapStarted.value = false;
|
|
325
|
+
holdCandidate.value = false;
|
|
326
|
+
holdActivated.value = false;
|
|
327
|
+
panActivated.value = false;
|
|
328
|
+
panActivationRequested.value = false;
|
|
329
|
+
panUpdateLogged.value = false;
|
|
330
|
+
touchSessionActive.value = false;
|
|
331
|
+
touchMovedPastSlop.value = false;
|
|
332
|
+
touchStartX.value = 0;
|
|
333
|
+
touchStartY.value = 0;
|
|
334
|
+
touchedIndex.value = safeTarget;
|
|
335
|
+
(0, react_native_reanimated_1.cancelAnimation)(holdTimerProgress);
|
|
336
|
+
holdTimerProgress.value = 0;
|
|
337
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensLeft);
|
|
338
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensRight);
|
|
339
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensHeight);
|
|
340
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensOffsetY);
|
|
341
|
+
(0, react_native_reanimated_1.cancelAnimation)(interactionProgress);
|
|
342
|
+
const center = horizontalPadding + itemWidth * (safeTarget + 0.5);
|
|
343
|
+
const left = center - lensWidth / 2;
|
|
344
|
+
lensLeft.value = left;
|
|
345
|
+
lensRight.value = left + lensWidth;
|
|
346
|
+
lensHeight.value = lensBaseHeight;
|
|
347
|
+
lensOffsetY.value = 0;
|
|
348
|
+
interactionProgress.value = 0;
|
|
349
|
+
dragVelocityX.value = 0;
|
|
350
|
+
dragVelocityY.value = 0;
|
|
351
|
+
originSelectedIndex.value = safeTarget;
|
|
352
|
+
hoveredIndex.value = safeTarget;
|
|
353
|
+
pendingIndex.value = safeTarget;
|
|
354
|
+
lastHapticIndex.value = -1;
|
|
355
|
+
(0, react_native_reanimated_1.runOnJS)(finishInteraction)(safeTarget);
|
|
356
|
+
}, [
|
|
357
|
+
dragVelocityX,
|
|
358
|
+
dragVelocityY,
|
|
359
|
+
finishInteraction,
|
|
360
|
+
holdActivated,
|
|
361
|
+
holdCandidate,
|
|
362
|
+
holdTimerProgress,
|
|
363
|
+
horizontalPadding,
|
|
364
|
+
hoveredIndex,
|
|
365
|
+
interactionActive,
|
|
366
|
+
interactionProgress,
|
|
367
|
+
itemCount,
|
|
368
|
+
itemWidth,
|
|
369
|
+
lastHapticIndex,
|
|
370
|
+
lensBaseHeight,
|
|
371
|
+
lensHeight,
|
|
372
|
+
lensLeft,
|
|
373
|
+
lensOffsetY,
|
|
374
|
+
lensRight,
|
|
375
|
+
lensWidth,
|
|
376
|
+
originSelectedIndex,
|
|
377
|
+
panActivated,
|
|
378
|
+
panActivationRequested,
|
|
379
|
+
panUpdateLogged,
|
|
380
|
+
pendingIndex,
|
|
381
|
+
phase,
|
|
382
|
+
snapStarted,
|
|
383
|
+
touchMovedPastSlop,
|
|
384
|
+
touchSessionActive,
|
|
385
|
+
touchStartX,
|
|
386
|
+
touchStartY,
|
|
387
|
+
touchedIndex,
|
|
388
|
+
]);
|
|
389
|
+
(0, react_1.useEffect)(() => {
|
|
390
|
+
if (barWidth <= 0)
|
|
391
|
+
return;
|
|
392
|
+
const previous = previousGeometryRef.current;
|
|
393
|
+
const initialMeasurement = previous.barWidth <= 0;
|
|
394
|
+
const selectionChanged = previous.selected !== selected;
|
|
395
|
+
const widthChanged = previous.barWidth > 0 && previous.barWidth !== barWidth;
|
|
396
|
+
if (dragCommittedTargetRef.current === selected) {
|
|
397
|
+
// Our drag already placed the lens at this page. Do not cancel its
|
|
398
|
+
// settling animation or run the normal tap-selection spring again.
|
|
399
|
+
previousGeometryRef.current = { selected, barWidth };
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
if (interactionActiveRef.current || interactionActive.value || phase.value !== 'idle') {
|
|
403
|
+
// An external page change during a live gesture takes ownership:
|
|
404
|
+
// cancel its animations and reconcile once the external selection
|
|
405
|
+
// is known. A drag's own commit pre-updates previousGeometryRef.
|
|
406
|
+
if (selectionChanged) {
|
|
407
|
+
phase.value = 'idle';
|
|
408
|
+
interactionActive.value = false;
|
|
409
|
+
snapStarted.value = false;
|
|
410
|
+
holdCandidate.value = false;
|
|
411
|
+
holdActivated.value = false;
|
|
412
|
+
panActivated.value = false;
|
|
413
|
+
panActivationRequested.value = false;
|
|
414
|
+
panUpdateLogged.value = false;
|
|
415
|
+
touchSessionActive.value = false;
|
|
416
|
+
touchMovedPastSlop.value = false;
|
|
417
|
+
touchStartX.value = 0;
|
|
418
|
+
touchStartY.value = 0;
|
|
419
|
+
touchedIndex.value = selected;
|
|
420
|
+
sessionId.value += 1;
|
|
421
|
+
(0, react_native_reanimated_1.cancelAnimation)(holdTimerProgress);
|
|
422
|
+
holdTimerProgress.value = 0;
|
|
423
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensLeft);
|
|
424
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensRight);
|
|
425
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensHeight);
|
|
426
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensOffsetY);
|
|
427
|
+
(0, react_native_reanimated_1.cancelAnimation)(interactionProgress);
|
|
428
|
+
const safeIndex = Math.max(0, Math.min(itemCount - 1, selected));
|
|
429
|
+
const center = horizontalPadding + itemWidth * (safeIndex + 0.5);
|
|
430
|
+
const left = center - lensWidth / 2;
|
|
431
|
+
lensLeft.value = left;
|
|
432
|
+
lensRight.value = left + lensWidth;
|
|
433
|
+
lensHeight.value = lensBaseHeight;
|
|
434
|
+
lensOffsetY.value = 0;
|
|
435
|
+
interactionProgress.value = 0;
|
|
436
|
+
dragVelocityX.value = 0;
|
|
437
|
+
dragVelocityY.value = 0;
|
|
438
|
+
hoveredIndex.value = safeIndex;
|
|
439
|
+
pendingIndex.value = safeIndex;
|
|
440
|
+
originSelectedIndex.value = safeIndex;
|
|
441
|
+
lastHapticIndex.value = -1;
|
|
442
|
+
interactionActiveRef.current = false;
|
|
443
|
+
setLiveBackdropEnabled(false);
|
|
444
|
+
dragCommittedTargetRef.current = null;
|
|
445
|
+
(0, tabDebug_1.logGlassTabGesture)('BACKDROP_OFF');
|
|
446
|
+
(0, tabDebug_1.logGlassTabGesture)('RESET', 'external_selection');
|
|
447
|
+
previousGeometryRef.current = { selected, barWidth };
|
|
448
|
+
}
|
|
449
|
+
// Keep same-selection and layout changes pending while the
|
|
450
|
+
// session owns the lens; reconcile them after it finishes.
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
if (!initialMeasurement && !selectionChanged && !widthChanged)
|
|
454
|
+
return;
|
|
455
|
+
const safeIndex = Math.max(0, Math.min(itemCount - 1, selected));
|
|
456
|
+
const nextCenter = horizontalPadding + itemWidth * (safeIndex + 0.5);
|
|
457
|
+
const nextLeft = nextCenter - lensWidth / 2;
|
|
458
|
+
if (initialMeasurement) {
|
|
459
|
+
lensLeft.value = nextLeft;
|
|
460
|
+
lensRight.value = nextLeft + lensWidth;
|
|
461
|
+
lensHeight.value = lensBaseHeight;
|
|
462
|
+
}
|
|
463
|
+
else if (reducedMotion) {
|
|
464
|
+
lensLeft.value = (0, react_native_reanimated_1.withTiming)(nextLeft, { duration: 115 });
|
|
465
|
+
lensRight.value = (0, react_native_reanimated_1.withTiming)(nextLeft + lensWidth, { duration: 115 });
|
|
466
|
+
lensHeight.value = (0, react_native_reanimated_1.withTiming)(lensBaseHeight, { duration: 95 });
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
lensLeft.value = (0, react_native_reanimated_1.withSpring)(nextLeft, tabConstants_12.TAP_SELECTION_SPRING);
|
|
470
|
+
lensRight.value = (0, react_native_reanimated_1.withSpring)(nextLeft + lensWidth, tabConstants_12.TAP_SELECTION_SPRING);
|
|
471
|
+
lensHeight.value = (0, react_native_reanimated_1.withSpring)(lensBaseHeight, { damping: 28, stiffness: 500, mass: 0.55 });
|
|
472
|
+
}
|
|
473
|
+
lensOffsetY.value = (0, react_native_reanimated_1.withTiming)(0, { duration: 110 });
|
|
474
|
+
previousGeometryRef.current = { selected, barWidth };
|
|
475
|
+
}, [
|
|
476
|
+
barWidth,
|
|
477
|
+
dragVelocityX,
|
|
478
|
+
dragVelocityY,
|
|
479
|
+
holdActivated,
|
|
480
|
+
holdCandidate,
|
|
481
|
+
holdTimerProgress,
|
|
482
|
+
horizontalPadding,
|
|
483
|
+
hoveredIndex,
|
|
484
|
+
interactionActive,
|
|
485
|
+
interactionProgress,
|
|
486
|
+
itemCount,
|
|
487
|
+
itemWidth,
|
|
488
|
+
lastHapticIndex,
|
|
489
|
+
lensBaseHeight,
|
|
490
|
+
lensHeight,
|
|
491
|
+
lensLeft,
|
|
492
|
+
lensOffsetY,
|
|
493
|
+
lensRight,
|
|
494
|
+
lensWidth,
|
|
495
|
+
originSelectedIndex,
|
|
496
|
+
panActivated,
|
|
497
|
+
panActivationRequested,
|
|
498
|
+
panUpdateLogged,
|
|
499
|
+
pendingIndex,
|
|
500
|
+
phase,
|
|
501
|
+
reducedMotion,
|
|
502
|
+
selected,
|
|
503
|
+
sessionId,
|
|
504
|
+
snapStarted,
|
|
505
|
+
touchMovedPastSlop,
|
|
506
|
+
touchSessionActive,
|
|
507
|
+
touchStartX,
|
|
508
|
+
touchStartY,
|
|
509
|
+
touchedIndex,
|
|
510
|
+
]);
|
|
511
|
+
(0, react_1.useEffect)(() => () => {
|
|
512
|
+
(0, react_native_reanimated_1.cancelAnimation)(holdTimerProgress);
|
|
513
|
+
phase.value = 'idle';
|
|
514
|
+
interactionActive.value = false;
|
|
515
|
+
snapStarted.value = false;
|
|
516
|
+
holdCandidate.value = false;
|
|
517
|
+
holdActivated.value = false;
|
|
518
|
+
panActivated.value = false;
|
|
519
|
+
panActivationRequested.value = false;
|
|
520
|
+
panUpdateLogged.value = false;
|
|
521
|
+
touchSessionActive.value = false;
|
|
522
|
+
touchMovedPastSlop.value = false;
|
|
523
|
+
sessionId.value += 1;
|
|
524
|
+
touchedIndex.value = -1;
|
|
525
|
+
touchStartX.value = 0;
|
|
526
|
+
touchStartY.value = 0;
|
|
527
|
+
interactionActiveRef.current = false;
|
|
528
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensLeft);
|
|
529
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensRight);
|
|
530
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensHeight);
|
|
531
|
+
(0, react_native_reanimated_1.cancelAnimation)(lensOffsetY);
|
|
532
|
+
(0, react_native_reanimated_1.cancelAnimation)(interactionProgress);
|
|
533
|
+
}, [
|
|
534
|
+
holdActivated,
|
|
535
|
+
holdCandidate,
|
|
536
|
+
holdTimerProgress,
|
|
537
|
+
interactionActive,
|
|
538
|
+
interactionProgress,
|
|
539
|
+
lensHeight,
|
|
540
|
+
lensLeft,
|
|
541
|
+
lensOffsetY,
|
|
542
|
+
lensRight,
|
|
543
|
+
panActivated,
|
|
544
|
+
panActivationRequested,
|
|
545
|
+
panUpdateLogged,
|
|
546
|
+
phase,
|
|
547
|
+
sessionId,
|
|
548
|
+
snapStarted,
|
|
549
|
+
touchMovedPastSlop,
|
|
550
|
+
touchSessionActive,
|
|
551
|
+
touchStartX,
|
|
552
|
+
touchStartY,
|
|
553
|
+
touchedIndex,
|
|
554
|
+
]);
|
|
555
|
+
const onDragUpdate = (0, react_1.useCallback)((absoluteX, relativeY, velocityX, velocityY, startIndex) => {
|
|
556
|
+
'worklet';
|
|
557
|
+
if (phase.value === 'inflating')
|
|
558
|
+
phase.value = 'dragging';
|
|
559
|
+
const rawCenter = absoluteX - shellScreenLeft - grabOffsetX.value;
|
|
560
|
+
const baseHalf = lensWidth / 2;
|
|
561
|
+
const minCenter = baseHalf;
|
|
562
|
+
const maxCenter = barWidth - baseHalf;
|
|
563
|
+
let center = rawCenter;
|
|
564
|
+
if (center < minCenter)
|
|
565
|
+
center = minCenter + (center - minCenter) * 0.2;
|
|
566
|
+
if (center > maxCenter)
|
|
567
|
+
center = maxCenter + (center - maxCenter) * 0.2;
|
|
568
|
+
center = Math.max(minCenter - 16, Math.min(maxCenter + 16, center));
|
|
569
|
+
let nearestIndex = 0;
|
|
570
|
+
let nearestDistance = Number.MAX_VALUE;
|
|
571
|
+
for (let index = 0; index < itemCount; index += 1) {
|
|
572
|
+
const tabCenter = horizontalPadding + itemWidth * (index + 0.5);
|
|
573
|
+
const distance = Math.abs(center - tabCenter);
|
|
574
|
+
if (distance < nearestDistance) {
|
|
575
|
+
nearestIndex = index;
|
|
576
|
+
nearestDistance = distance;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
hoveredIndex.value = nearestIndex;
|
|
580
|
+
const magneticRange = Math.max(itemWidth * 0.9, 1);
|
|
581
|
+
const magneticStrength = 0.075 * (1 - Math.min(nearestDistance / magneticRange, 1));
|
|
582
|
+
center += (horizontalPadding + itemWidth * (nearestIndex + 0.5) - center) * magneticStrength;
|
|
583
|
+
const speed = Math.min(Math.abs(velocityX) / 1800, 1);
|
|
584
|
+
const stretch = reducedMotion ? 0 : speed * 16;
|
|
585
|
+
const activeWidth = lensWidth + (reducedMotion ? 0 : 20) + stretch;
|
|
586
|
+
const direction = velocityX > 28 ? 1 : velocityX < -28 ? -1 : 0;
|
|
587
|
+
const leadingExtra = stretch * 0.62;
|
|
588
|
+
const trailingExtra = stretch * 0.14;
|
|
589
|
+
const targetLeft = center - activeWidth / 2 - (direction < 0 ? leadingExtra : trailingExtra);
|
|
590
|
+
const targetRight = center + activeWidth / 2 + (direction > 0 ? leadingExtra : trailingExtra);
|
|
591
|
+
const yOffset = reducedMotion ? 0 : Math.max(-8, Math.min(8, relativeY - height / 2));
|
|
592
|
+
dragVelocityX.value = velocityX;
|
|
593
|
+
dragVelocityY.value = velocityY;
|
|
594
|
+
lensOffsetY.value = yOffset;
|
|
595
|
+
lensHeight.value =
|
|
596
|
+
lensBaseHeight + interactionProgress.value * 10 - (reducedMotion ? 0 : speed * 3);
|
|
597
|
+
// Keep the leading edge locked to the finger. Only the trailing edge
|
|
598
|
+
// chases it with a spring, so the lens translates continuously while
|
|
599
|
+
// still stretching like a viscous surface.
|
|
600
|
+
if (direction > 0) {
|
|
601
|
+
lensRight.value = targetRight;
|
|
602
|
+
lensLeft.value = (0, react_native_reanimated_1.withSpring)(targetLeft, tabConstants_14.EDGE_SPRING_SLOW);
|
|
603
|
+
}
|
|
604
|
+
else if (direction < 0) {
|
|
605
|
+
lensLeft.value = targetLeft;
|
|
606
|
+
lensRight.value = (0, react_native_reanimated_1.withSpring)(targetRight, tabConstants_14.EDGE_SPRING_SLOW);
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
lensLeft.value = (0, react_native_reanimated_1.withSpring)(targetLeft, tabConstants_11.IDLE_SPRING);
|
|
610
|
+
lensRight.value = (0, react_native_reanimated_1.withSpring)(targetRight, tabConstants_11.IDLE_SPRING);
|
|
611
|
+
}
|
|
612
|
+
const hapticIndex = nearestDistance < itemWidth * 0.36 && nearestIndex !== startIndex ? nearestIndex : -1;
|
|
613
|
+
if (hapticIndex !== lastHapticIndex.value) {
|
|
614
|
+
lastHapticIndex.value = hapticIndex;
|
|
615
|
+
if (hapticIndex >= 0)
|
|
616
|
+
(0, react_native_reanimated_1.runOnJS)(tabDebug_1.emitTargetHaptic)(hapticIndex);
|
|
617
|
+
}
|
|
618
|
+
}, [
|
|
619
|
+
barWidth,
|
|
620
|
+
dragVelocityX,
|
|
621
|
+
dragVelocityY,
|
|
622
|
+
grabOffsetX,
|
|
623
|
+
height,
|
|
624
|
+
horizontalPadding,
|
|
625
|
+
hoveredIndex,
|
|
626
|
+
interactionProgress,
|
|
627
|
+
itemCount,
|
|
628
|
+
itemWidth,
|
|
629
|
+
lastHapticIndex,
|
|
630
|
+
lensBaseHeight,
|
|
631
|
+
lensHeight,
|
|
632
|
+
lensLeft,
|
|
633
|
+
lensRight,
|
|
634
|
+
lensWidth,
|
|
635
|
+
phase,
|
|
636
|
+
reducedMotion,
|
|
637
|
+
shellScreenLeft,
|
|
638
|
+
lensOffsetY,
|
|
639
|
+
]);
|
|
640
|
+
const onBeginSnap = (0, react_1.useCallback)((velocityX, startIndex, cancelled = false) => {
|
|
641
|
+
'worklet';
|
|
642
|
+
if (snapStarted.value || (phase.value !== 'inflating' && phase.value !== 'dragging'))
|
|
643
|
+
return;
|
|
644
|
+
snapStarted.value = true;
|
|
645
|
+
phase.value = 'snapping';
|
|
646
|
+
const originIndex = cancelled ? startIndex : originSelectedIndex.value;
|
|
647
|
+
const currentCenter = (lensLeft.value + lensRight.value) / 2;
|
|
648
|
+
const projectedCenter = currentCenter + velocityX * 0.075;
|
|
649
|
+
let targetIndex = 0;
|
|
650
|
+
let nearestDistance = Number.MAX_VALUE;
|
|
651
|
+
if (cancelled) {
|
|
652
|
+
targetIndex = originIndex;
|
|
653
|
+
}
|
|
654
|
+
else {
|
|
655
|
+
for (let index = 0; index < itemCount; index += 1) {
|
|
656
|
+
const tabCenter = horizontalPadding + itemWidth * (index + 0.5);
|
|
657
|
+
const distance = Math.abs(projectedCenter - tabCenter);
|
|
658
|
+
if (distance < nearestDistance) {
|
|
659
|
+
nearestDistance = distance;
|
|
660
|
+
targetIndex = index;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
const targetCenter = horizontalPadding + itemWidth * (targetIndex + 0.5);
|
|
665
|
+
const targetLeft = targetCenter - lensWidth / 2;
|
|
666
|
+
pendingIndex.value = targetIndex;
|
|
667
|
+
(0, react_native_reanimated_1.runOnJS)(tabDebug_1.logGlassTabGesture)('SNAP_START', `target=${targetIndex}${cancelled ? ' rollback' : ''}`);
|
|
668
|
+
// Page ownership changes as soon as the finger is released and the
|
|
669
|
+
// destination is known. The glass snap/settle continues independently,
|
|
670
|
+
// so navigation never waits for the trailing spring to finish.
|
|
671
|
+
if (!cancelled && targetIndex !== originIndex) {
|
|
672
|
+
(0, react_native_reanimated_1.runOnJS)(commitDragSelection)(targetIndex, originIndex);
|
|
673
|
+
}
|
|
674
|
+
lensOffsetY.value = (0, react_native_reanimated_1.withSpring)(0, { damping: 24, stiffness: 300 });
|
|
675
|
+
lensHeight.value = reducedMotion
|
|
676
|
+
? (0, react_native_reanimated_1.withTiming)(lensBaseHeight, { duration: 100 })
|
|
677
|
+
: (0, react_native_reanimated_1.withSpring)(lensBaseHeight, { damping: 25, stiffness: 320, mass: 0.7 });
|
|
678
|
+
const finishSnap = (finished) => {
|
|
679
|
+
'worklet';
|
|
680
|
+
if (phase.value !== 'snapping')
|
|
681
|
+
return;
|
|
682
|
+
if (!finished) {
|
|
683
|
+
resetInteractionOnUI(originIndex);
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
phase.value = 'settling';
|
|
687
|
+
(0, react_native_reanimated_1.runOnJS)(tabDebug_1.logGlassTabGesture)('SNAP_END', `target=${targetIndex}`);
|
|
688
|
+
interactionProgress.value = (0, react_native_reanimated_1.withTiming)(0, { duration: reducedMotion ? 95 : 145 }, (settled) => {
|
|
689
|
+
if (settled) {
|
|
690
|
+
(0, react_native_reanimated_1.runOnJS)(tabDebug_1.logGlassTabGesture)('SETTLE_END');
|
|
691
|
+
resetInteractionOnUI(targetIndex);
|
|
692
|
+
}
|
|
693
|
+
else {
|
|
694
|
+
resetInteractionOnUI(originIndex);
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
};
|
|
698
|
+
if (reducedMotion) {
|
|
699
|
+
lensLeft.value = (0, react_native_reanimated_1.withTiming)(targetLeft, { duration: 120 });
|
|
700
|
+
// One trailing edge owns completion. This avoids a two-callback
|
|
701
|
+
// counter getting stranded if either independent animation cancels.
|
|
702
|
+
lensRight.value = (0, react_native_reanimated_1.withTiming)(targetLeft + lensWidth, { duration: 120 }, finishSnap);
|
|
703
|
+
}
|
|
704
|
+
else {
|
|
705
|
+
// The trailing edge is the sole completion signal. It uses the
|
|
706
|
+
// slower spring, while the leading edge reaches the target first.
|
|
707
|
+
const wasMovingRight = velocityX >= 0;
|
|
708
|
+
lensLeft.value = (0, react_native_reanimated_1.withSpring)(targetLeft, wasMovingRight ? tabConstants_14.EDGE_SPRING_SLOW : tabConstants_13.EDGE_SPRING_FAST, wasMovingRight ? finishSnap : undefined);
|
|
709
|
+
lensRight.value = (0, react_native_reanimated_1.withSpring)(targetLeft + lensWidth, wasMovingRight ? tabConstants_13.EDGE_SPRING_FAST : tabConstants_14.EDGE_SPRING_SLOW, wasMovingRight ? undefined : finishSnap);
|
|
710
|
+
}
|
|
711
|
+
}, [
|
|
712
|
+
commitDragSelection,
|
|
713
|
+
horizontalPadding,
|
|
714
|
+
interactionProgress,
|
|
715
|
+
itemCount,
|
|
716
|
+
itemWidth,
|
|
717
|
+
lensBaseHeight,
|
|
718
|
+
lensHeight,
|
|
719
|
+
lensLeft,
|
|
720
|
+
lensOffsetY,
|
|
721
|
+
lensRight,
|
|
722
|
+
lensWidth,
|
|
723
|
+
originSelectedIndex,
|
|
724
|
+
pendingIndex,
|
|
725
|
+
phase,
|
|
726
|
+
reducedMotion,
|
|
727
|
+
resetInteractionOnUI,
|
|
728
|
+
snapStarted,
|
|
729
|
+
]);
|
|
730
|
+
const tabBarGesture = (0, useInlineTabGesture_1.useInlineTabGesture)({
|
|
731
|
+
noteGestureDown,
|
|
732
|
+
touchSessionActive,
|
|
733
|
+
phase,
|
|
734
|
+
shellScreenLeft,
|
|
735
|
+
horizontalPadding,
|
|
736
|
+
itemWidth,
|
|
737
|
+
itemCount,
|
|
738
|
+
sessionId,
|
|
739
|
+
touchMovedPastSlop,
|
|
740
|
+
touchedIndex,
|
|
741
|
+
touchStartX,
|
|
742
|
+
touchStartY,
|
|
743
|
+
originSelectedIndex,
|
|
744
|
+
selected,
|
|
745
|
+
hoveredIndex,
|
|
746
|
+
pendingIndex,
|
|
747
|
+
holdCandidate,
|
|
748
|
+
holdActivated,
|
|
749
|
+
panActivated,
|
|
750
|
+
panActivationRequested,
|
|
751
|
+
panUpdateLogged,
|
|
752
|
+
snapStarted,
|
|
753
|
+
interactionActive,
|
|
754
|
+
lastHapticIndex,
|
|
755
|
+
holdTimerProgress,
|
|
756
|
+
activateHoldOnUI,
|
|
757
|
+
onBeginSnap,
|
|
758
|
+
onSelect,
|
|
759
|
+
onDragUpdate,
|
|
760
|
+
resetInteractionOnUI,
|
|
761
|
+
});
|
|
762
|
+
const localLensStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
|
|
763
|
+
const width = Math.max(lensRight.value - lensLeft.value, 1);
|
|
764
|
+
const center = (lensLeft.value + lensRight.value) / 2;
|
|
765
|
+
return {
|
|
766
|
+
borderRadius: Math.min(lensHeight.value, width) / 2,
|
|
767
|
+
transform: [
|
|
768
|
+
{ translateX: center - selectedCenterX },
|
|
769
|
+
{ translateY: lensOffsetY.value },
|
|
770
|
+
{ scaleX: width / lensWidth },
|
|
771
|
+
{ scaleY: lensHeight.value / lensBaseHeight },
|
|
772
|
+
],
|
|
773
|
+
};
|
|
774
|
+
}, [lensBaseHeight, lensWidth, selectedCenterX]);
|
|
775
|
+
const liveLensStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
|
|
776
|
+
left: lensLeft.value,
|
|
777
|
+
top: (height - lensHeight.value) / 2 + lensOffsetY.value,
|
|
778
|
+
width: Math.max(lensRight.value - lensLeft.value, 1),
|
|
779
|
+
height: lensHeight.value,
|
|
780
|
+
borderRadius: Math.min(lensHeight.value, lensRight.value - lensLeft.value) / 2,
|
|
781
|
+
}), [height]);
|
|
782
|
+
const liveLensAnimatedProps = (0, react_native_reanimated_1.useAnimatedProps)(() => ({
|
|
783
|
+
interactionProgress: interactionProgress.value,
|
|
784
|
+
motionX: Math.max(-1, Math.min(1, dragVelocityX.value / 1800)),
|
|
785
|
+
motionY: Math.max(-1, Math.min(1, dragVelocityY.value / 1800)),
|
|
786
|
+
}));
|
|
787
|
+
const renderVisual = renderItem ?? renderIcon ?? ((item) => item.label);
|
|
788
|
+
const renderTabItems = (sampled = false) => items.map((item, index) => ((0, jsx_runtime_1.jsx)(GlassTabItem_2.GlassTabItem, { item: item, index: index, selected: index === selected, itemWidth: itemWidth, horizontalPadding: horizontalPadding, barHeight: height, renderVisual: renderVisual, customContent: renderItem != null, sampled: sampled, lensLeft: lensLeft, lensRight: lensRight }, `${item.label}-${index}`)));
|
|
789
|
+
const tabItems = renderTabItems();
|
|
790
|
+
const accessibilityTargets = items.map((item, index) => ((0, jsx_runtime_1.jsx)(react_native_1.View, { accessible: true, accessibilityRole: "tab", accessibilityLabel: item.label, accessibilityHint: accessibilityHint ?? '长按并拖动当前选中页签可切换页面', accessibilityState: { selected: index === selected }, accessibilityActions: [{ name: 'activate', label: item.label }], onAccessibilityAction: () => onSelect(index), style: tabStyles_1.styles.interactionTarget }, `tab-accessibility-${item.label}-${index}`)));
|
|
791
|
+
const resolvedShellRadius = shellRadius ?? height / 2;
|
|
792
|
+
const shellMaterial = {
|
|
793
|
+
opticsModel: 'referenceParity',
|
|
794
|
+
referenceDepthEffect: true,
|
|
795
|
+
radius: resolvedShellRadius,
|
|
796
|
+
surfaceColor: { light: shellSurfaceColor, dark: shellSurfaceColor },
|
|
797
|
+
blurRadius: tabBarMaterial?.blurRadius ?? 8,
|
|
798
|
+
refractionHeight: tabBarMaterial?.refractionHeight ?? 24,
|
|
799
|
+
refractionAmount: tabBarMaterial?.refractionAmount ?? -24,
|
|
800
|
+
saturation: tabBarMaterial?.saturation ?? 1.5,
|
|
801
|
+
chromaticAberration: 0,
|
|
802
|
+
highlightAlpha: 0.5,
|
|
803
|
+
highlightWidth: 0.5,
|
|
804
|
+
};
|
|
805
|
+
const shellStyle = {
|
|
806
|
+
width: barWidth,
|
|
807
|
+
height,
|
|
808
|
+
borderRadius: resolvedShellRadius,
|
|
809
|
+
borderColor: shellBorderColor,
|
|
810
|
+
backgroundColor: 'transparent',
|
|
811
|
+
shadowColor: shellShadowColor,
|
|
812
|
+
shadowOpacity: tabBarMaterial?.shadowOpacity ?? 0,
|
|
813
|
+
shadowRadius: tabBarMaterial?.shadowRadius ?? 0,
|
|
814
|
+
shadowOffset: { width: 0, height: tabBarMaterial?.shadowOffsetY ?? 0 },
|
|
815
|
+
elevation: tabBarMaterial?.elevation ?? 0,
|
|
816
|
+
};
|
|
817
|
+
const barContents = ((0, jsx_runtime_1.jsxs)(react_native_1.View, { ref: inlineHostRef, onLayout: presentation === 'inline' && typeof requestedWidth !== 'number'
|
|
818
|
+
? (event) => {
|
|
819
|
+
setInlineWidth(event.nativeEvent.layout.width);
|
|
820
|
+
inlineHostRef.current?.measureInWindow((left) => setInlineScreenLeft(left));
|
|
821
|
+
}
|
|
822
|
+
: undefined, pointerEvents: "box-none", style: presentation === 'floating'
|
|
823
|
+
? [
|
|
824
|
+
tabStyles_1.styles.host,
|
|
825
|
+
{
|
|
826
|
+
left: shellScreenLeft,
|
|
827
|
+
bottom: bottomInset + tabConstants_2.TAB_BAR_BOTTOM_GAP,
|
|
828
|
+
width: barWidth,
|
|
829
|
+
height,
|
|
830
|
+
},
|
|
831
|
+
]
|
|
832
|
+
: [tabStyles_1.styles.inlineHost, { width: requestedWidth ?? '100%', height }], children: [nativeLiveAvailable ? ((0, jsx_runtime_1.jsx)(GlassSurface_1.RouteGlassCaptureScope, { scopeId: tabScopeId, children: (0, jsx_runtime_1.jsx)(GlassTabItem_1.TabLensScene, { children: (tabSceneProviderId) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(GlassSurface_1.RouteGlassCaptureSource, { captureMode: liveBackdropEnabled ? 'livePassThrough' : 'oneShotPassThrough', underlayProviderId: samplingProviderId, sourceRevision: `${dark}:${barWidth}:${height}:${items.map((item) => item.label).join('|')}`, style: react_native_1.StyleSheet.absoluteFill, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { pointerEvents: "none", style: [tabStyles_1.styles.shell, shellStyle], children: [(0, jsx_runtime_1.jsx)(GlassSurface_1.GlassSurface, { variant: "tabBarShell", positioning: "inFlow", sampling: presentation === 'inline' ? 'local' : 'backdrop', providerIdOverride: samplingProviderId, inlineBackdrop: true, pointerEvents: "none", materialOverrides: shellMaterial, style: [
|
|
833
|
+
react_native_1.StyleSheet.absoluteFill,
|
|
834
|
+
{ borderRadius: resolvedShellRadius },
|
|
835
|
+
] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "none", style: [tabStyles_1.styles.row, { paddingHorizontal: horizontalPadding }], children: renderTabItems(true) })] }) }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { pointerEvents: "none", style: [tabStyles_1.styles.shell, shellStyle], children: [(0, jsx_runtime_1.jsx)(GlassSurface_1.GlassSurface, { variant: "tabBarShell", frameOverride: shellFrameOverride, positioning: "inFlow",
|
|
836
|
+
// An inline bar lives inside the page's own route capture
|
|
837
|
+
// source, so sampling that scene makes the capture
|
|
838
|
+
// include the surface being captured. On the User page
|
|
839
|
+
// that cycle drove RenderNode::prepareTreeImpl into a
|
|
840
|
+
// stack overflow. Inline bars sample locally instead.
|
|
841
|
+
sampling: presentation === 'inline' ? 'local' : 'backdrop', samplingSource: "routeScene", providerIdOverride: samplingProviderId, inlineBackdrop: true, pointerEvents: "none", materialOverrides: shellMaterial, style: [
|
|
842
|
+
react_native_1.StyleSheet.absoluteFill,
|
|
843
|
+
{ borderRadius: resolvedShellRadius },
|
|
844
|
+
] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "none", style: [tabStyles_1.styles.row, { paddingHorizontal: horizontalPadding }], children: tabItems })] }), (0, jsx_runtime_1.jsx)(NativeGlassSurface, { pointerEvents: "none", providerId: tabSceneProviderId, opticsModel: appearance?.tokens.materials.tabSelectionLens.opticsModel, highlightStyle: appearance?.tokens.materials.tabSelectionLens.referenceHighlightStyle, interactionProfile: "tab", surfaceColor: appearance?.tokens.materials.tabSelectionLens.surfaceColor?.[dark ? 'dark' : 'light'], cornerRadius: appearance?.tokens.materials.tabSelectionLens.radius ??
|
|
845
|
+
lensBaseHeight / 2, blurRadius: (appearance?.tokens.materials.tabSelectionLens.blurRadius ?? 0.35) *
|
|
846
|
+
(appearance?.tokens.materials.tabSelectionLens.opticsModel ===
|
|
847
|
+
'referenceParity'
|
|
848
|
+
? 1
|
|
849
|
+
: appearance?.tokens.quality === 'high'
|
|
850
|
+
? 1.2
|
|
851
|
+
: 1), refractionHeight: lensRefractionHeight ??
|
|
852
|
+
appearance?.tokens.materials.tabSelectionLens.refractionHeight ??
|
|
853
|
+
12, refractionAmount: appearance?.tokens.materials.tabSelectionLens.refractionAmount ?? 5.5, bodyRefractionAmount: appearance?.tokens.materials.tabSelectionLens.refractionBodyAmount ??
|
|
854
|
+
1.5, saturation: appearance?.tokens.materials.tabSelectionLens.saturation ?? 1.02, chromaticAberration: appearance?.tokens.materials.tabSelectionLens.chromaticAberration ??
|
|
855
|
+
0.3, highlightAlpha: appearance?.tokens.materials.tabSelectionLens.highlightAlpha ?? 0.62, highlightWidth: appearance?.tokens.materials.tabSelectionLens.highlightWidth ?? 1.3, tintAlpha: appearance?.tokens.materials.tabSelectionLens.tintAlpha ?? 0.08, specularStrength: appearance?.tokens.materials.tabSelectionLens.specularStrength ?? 0.95, fresnelStrength: appearance?.tokens.materials.tabSelectionLens.fresnelStrength ?? 0.72, innerShadowStrength: appearance?.tokens.materials.tabSelectionLens.innerShadowStrength ??
|
|
856
|
+
0.2, shadowOpacity: appearance?.tokens.materials.tabSelectionLens.shadowOpacity ?? 0.05, shadowRadius: appearance?.tokens.materials.tabSelectionLens.shadowRadius ?? 4, shadowOffsetY: appearance?.tokens.materials.tabSelectionLens.shadowOffsetY ?? 4 / 6, tint: appearance?.tokens.tint[dark ? 'dark' : 'light'], continuous: liveBackdropEnabled, animatedProps: liveLensAnimatedProps, style: [tabStyles_1.styles.nativeLens, liveLensStyle] })] })) }) })) : ((0, jsx_runtime_1.jsxs)(react_native_1.View, { pointerEvents: "none", style: [tabStyles_1.styles.shell, shellStyle], children: [(0, jsx_runtime_1.jsx)(GlassSurface_1.GlassSurface, { variant: "tabBarShell", frameOverride: shellFrameOverride, positioning: "inFlow", sampling: "backdrop", samplingSource: "routeScene", inlineBackdrop: true, pointerEvents: "none", materialOverrides: shellMaterial, style: [react_native_1.StyleSheet.absoluteFill, { borderRadius: resolvedShellRadius }] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "none", style: [tabStyles_1.styles.row, { paddingHorizontal: horizontalPadding }], children: tabItems }), (0, jsx_runtime_1.jsx)(GlassSurface_1.GlassSurface, { variant: "tabSelectionLens", positioning: "inFlow", sampling: "backdrop", samplingSource: "routeScene", inlineBackdrop: true, pointerEvents: "none", style: {
|
|
857
|
+
position: 'absolute',
|
|
858
|
+
left: selectedLeft,
|
|
859
|
+
top: verticalInset,
|
|
860
|
+
width: lensWidth,
|
|
861
|
+
height: lensBaseHeight,
|
|
862
|
+
borderRadius: lensBaseHeight / 2,
|
|
863
|
+
zIndex: 2,
|
|
864
|
+
}, animatedStyle: localLensStyle })] })), tabConstants_10.GESTURE_DEBUG_ENABLED && ((0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "none", accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: [tabStyles_1.styles.gestureDebugOverlay, { width: Math.max(barWidth, tabConstants_5.TAB_BAR_MIN_WIDTH) }], children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: tabStyles_1.styles.gestureDebugText, children: `view DOWN ${gestureDebug.touchCount} · gesture DOWN ${gestureDebug.gestureCount}\nphase ${gestureDebug.phase} · hold candidate ${gestureDebug.holdCandidate ? 'ON' : 'off'} · hold ${gestureDebug.holdActivated ? 'ON' : 'off'} · drag ${gestureDebug.dragging ? 'ON' : 'off'} · snap ${gestureDebug.snapStarted ? 'ON' : 'off'}\norigin ${gestureDebug.origin} · hovered ${gestureDebug.hovered} · pending ${gestureDebug.pending}` }) })), (0, jsx_runtime_1.jsx)(react_native_gesture_handler_1.GestureDetector, { gesture: tabBarGesture, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { pointerEvents: "auto", onTouchStart: tabConstants_10.GESTURE_DEBUG_ENABLED ? noteTabViewTouch : undefined, collapsable: false, style: [tabStyles_1.styles.interactionLayer, { width: barWidth, height }], children: accessibilityTargets }) })] }));
|
|
865
|
+
return presentation === 'floating' ? ((0, jsx_runtime_1.jsx)(GlassSurface_1.GlassOverlay, { zIndex: tabConstants_9.TAB_BAR_PORTAL_Z_INDEX + 1, children: barContents })) : (barContents);
|
|
866
|
+
}
|
|
867
|
+
//# sourceMappingURL=InlineTabBar.js.map
|