@satinhq/kit 0.0.0-stage → 0.1.0-beta.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/NOTICE +96 -0
- package/README.md +454 -2
- package/THIRD_PARTY_NOTICES.md +65 -0
- package/bin/satin.mjs +13 -0
- package/dist/acknowledgements/Acknowledgements.d.ts +4 -0
- package/dist/acknowledgements/Acknowledgements.js +42 -0
- package/dist/acknowledgements/bundledNotices.d.ts +4 -0
- package/dist/acknowledgements/bundledNotices.js +58 -0
- package/dist/acknowledgements/inventory.d.ts +17 -0
- package/dist/acknowledgements/inventory.js +10 -0
- package/dist/acknowledgements/inventory.json +39 -0
- package/dist/actions/ActionMenu.d.ts +30 -0
- package/dist/actions/ActionMenu.js +103 -0
- package/dist/actions/RowActions.d.ts +42 -0
- package/dist/actions/RowActions.js +820 -0
- package/dist/actions/contextMotion.d.ts +78 -0
- package/dist/actions/contextMotion.js +329 -0
- package/dist/actions/motion.d.ts +19 -0
- package/dist/actions/motion.js +74 -0
- package/dist/actions/nativeContextAppearance.json +86 -0
- package/dist/actions/nativeContextMotion.json +734 -0
- package/dist/actions/nativeMotion.json +388 -0
- package/dist/actions/preview.d.ts +27 -0
- package/dist/actions/preview.js +217 -0
- package/dist/actions/recognizers.d.ts +24 -0
- package/dist/actions/recognizers.js +87 -0
- package/dist/actions/rowScrub.d.ts +59 -0
- package/dist/actions/rowScrub.js +400 -0
- package/dist/actions/swipeSpring.d.ts +14 -0
- package/dist/actions/swipeSpring.js +35 -0
- package/dist/actions/types.d.ts +71 -0
- package/dist/actions/types.js +28 -0
- package/dist/app/InstallComponents.d.ts +16 -0
- package/dist/app/InstallComponents.js +104 -0
- package/dist/app/InstallationDiagnostics.d.ts +7 -0
- package/dist/app/InstallationDiagnostics.js +23 -0
- package/dist/app/OrientationGuard.d.ts +8 -0
- package/dist/app/OrientationGuard.js +9 -0
- package/dist/app/appearance.d.ts +18 -0
- package/dist/app/appearance.js +15 -0
- package/dist/app/appearanceStore.d.ts +30 -0
- package/dist/app/appearanceStore.js +228 -0
- package/dist/app/backgroundUpdate.d.ts +20 -0
- package/dist/app/backgroundUpdate.js +151 -0
- package/dist/app/buildInfo.d.ts +11 -0
- package/dist/app/buildInfo.js +12 -0
- package/dist/app/buildInfoBuild.d.ts +3 -0
- package/dist/app/buildInfoBuild.js +12 -0
- package/dist/app/checkCli.d.ts +1 -0
- package/dist/app/checkCli.js +73 -0
- package/dist/app/coldLaunchUpdate.d.ts +14 -0
- package/dist/app/coldLaunchUpdate.js +384 -0
- package/dist/app/definition.d.ts +85 -0
- package/dist/app/definition.js +347 -0
- package/dist/app/deployment.d.ts +28 -0
- package/dist/app/deployment.js +352 -0
- package/dist/app/deploymentBuild.d.ts +3 -0
- package/dist/app/deploymentBuild.js +55 -0
- package/dist/app/earlyWorker.d.ts +3 -0
- package/dist/app/earlyWorker.js +77 -0
- package/dist/app/head.d.ts +10 -0
- package/dist/app/head.js +120 -0
- package/dist/app/icons.d.ts +4 -0
- package/dist/app/icons.js +35 -0
- package/dist/app/install.d.ts +18 -0
- package/dist/app/install.js +82 -0
- package/dist/app/installCheck.d.ts +2 -0
- package/dist/app/installCheck.js +148 -0
- package/dist/app/installContext.d.ts +35 -0
- package/dist/app/installContext.js +45 -0
- package/dist/app/installCustom.d.ts +25 -0
- package/dist/app/installCustom.js +55 -0
- package/dist/app/installExperience.d.ts +22 -0
- package/dist/app/installExperience.js +389 -0
- package/dist/app/installExperienceDevice.d.ts +29 -0
- package/dist/app/installExperienceDevice.js +160 -0
- package/dist/app/installExperienceHome.d.ts +16 -0
- package/dist/app/installExperienceHome.js +304 -0
- package/dist/app/installExperienceRuntime.d.ts +37 -0
- package/dist/app/installExperienceRuntime.js +285 -0
- package/dist/app/installPolicy.d.ts +28 -0
- package/dist/app/installPolicy.js +90 -0
- package/dist/app/installQr.d.ts +10 -0
- package/dist/app/installQr.js +139 -0
- package/dist/app/installStrings.d.ts +52 -0
- package/dist/app/installStrings.js +75 -0
- package/dist/app/installTipPath.d.ts +12 -0
- package/dist/app/installTipPath.js +9 -0
- package/dist/app/installationFailure.d.ts +14 -0
- package/dist/app/installationFailure.js +38 -0
- package/dist/app/launch.d.ts +7 -0
- package/dist/app/launch.js +241 -0
- package/dist/app/launchReadiness.d.ts +9 -0
- package/dist/app/launchReadiness.js +72 -0
- package/dist/app/launchScreen.d.ts +16 -0
- package/dist/app/launchScreen.js +14 -0
- package/dist/app/launchScreenRuntime.d.ts +19 -0
- package/dist/app/launchScreenRuntime.js +313 -0
- package/dist/app/launchWatchdog.d.ts +1 -0
- package/dist/app/launchWatchdog.js +202 -0
- package/dist/app/manifests.d.ts +19 -0
- package/dist/app/manifests.js +20 -0
- package/dist/app/mdm.d.ts +3 -0
- package/dist/app/mdm.js +20 -0
- package/dist/app/mediaCheck.d.ts +9 -0
- package/dist/app/mediaCheck.js +122 -0
- package/dist/app/mediaTypes.d.ts +2 -0
- package/dist/app/mediaTypes.js +13 -0
- package/dist/app/platformPolicy.d.ts +3 -0
- package/dist/app/platformPolicy.js +10 -0
- package/dist/app/platformScripts.d.ts +6 -0
- package/dist/app/platformScripts.js +65 -0
- package/dist/app/releaseUpdates.d.ts +7 -0
- package/dist/app/releaseUpdates.js +53 -0
- package/dist/app/runtime.d.ts +9 -0
- package/dist/app/runtime.js +38 -0
- package/dist/app/startup.d.ts +30 -0
- package/dist/app/startup.js +24 -0
- package/dist/app/statusBand.d.ts +11 -0
- package/dist/app/statusBand.js +257 -0
- package/dist/app/viewport.d.ts +3 -0
- package/dist/app/viewport.js +42 -0
- package/dist/app/viewportValue.d.ts +5 -0
- package/dist/app/viewportValue.js +14 -0
- package/dist/app/vite.d.ts +27 -0
- package/dist/app/vite.js +440 -0
- package/dist/app/warmImage.d.ts +3 -0
- package/dist/app/warmImage.js +59 -0
- package/dist/content/content.d.ts +153 -0
- package/dist/content/content.js +315 -0
- package/dist/content/layout.d.ts +26 -0
- package/dist/content/layout.js +114 -0
- package/dist/content/scaledMetric.d.ts +3 -0
- package/dist/content/scaledMetric.js +68 -0
- package/dist/content/typography.d.ts +83 -0
- package/dist/content/typography.js +32 -0
- package/dist/controls/ActivityIndicatorSegments.d.ts +4 -0
- package/dist/controls/ActivityIndicatorSegments.js +5 -0
- package/dist/controls/ColorPicker.d.ts +20 -0
- package/dist/controls/ColorPicker.js +70 -0
- package/dist/controls/ControlRow.d.ts +5 -0
- package/dist/controls/ControlRow.js +10 -0
- package/dist/controls/DatePicker.d.ts +41 -0
- package/dist/controls/DatePicker.js +148 -0
- package/dist/controls/ProgressView.d.ts +17 -0
- package/dist/controls/ProgressView.js +24 -0
- package/dist/controls/civilDate.d.ts +49 -0
- package/dist/controls/civilDate.js +112 -0
- package/dist/data/database.d.ts +154 -0
- package/dist/data/database.js +710 -0
- package/dist/data/value-equal.d.ts +2 -0
- package/dist/data/value-equal.js +36 -0
- package/dist/data/write-store.d.ts +38 -0
- package/dist/data/write-store.js +192 -0
- package/dist/dev-menu/DevMenu.d.ts +1 -0
- package/dist/dev-menu/DevMenu.js +121 -0
- package/dist/dev-menu/actions.d.ts +12 -0
- package/dist/dev-menu/actions.js +99 -0
- package/dist/dev-menu/build.d.ts +5 -0
- package/dist/dev-menu/build.js +40 -0
- package/dist/dev-menu/gesture.d.ts +18 -0
- package/dist/dev-menu/gesture.js +109 -0
- package/dist/dev-menu/shake.d.ts +2 -0
- package/dist/dev-menu/shake.js +36 -0
- package/dist/dev-menu/types.d.ts +8 -0
- package/dist/dev-menu/types.js +1 -0
- package/dist/diagnostics.d.ts +3 -0
- package/dist/diagnostics.js +4 -0
- package/dist/docs/app-recipes.md +411 -0
- package/dist/docs/components/file-importer.md +54 -0
- package/dist/docs/components/paste-button.md +48 -0
- package/dist/docs/components/photos-picker.md +53 -0
- package/dist/docs/components/share-link.md +58 -0
- package/dist/docs/content.md +159 -0
- package/dist/docs/controls.md +151 -0
- package/dist/docs/data.md +332 -0
- package/dist/docs/limitations.md +40 -0
- package/dist/docs/messaging-scroll.md +234 -0
- package/dist/docs/networking.md +190 -0
- package/dist/docs/push.md +215 -0
- package/dist/docs/swiftui-reference.md +1895 -0
- package/dist/docs/symbols.md +293 -0
- package/dist/docs/tokens.md +60 -0
- package/dist/fidelity/devAssertions.d.ts +21 -0
- package/dist/fidelity/devAssertions.js +199 -0
- package/dist/focus/focusIntentMachine.d.ts +106 -0
- package/dist/focus/focusIntentMachine.js +359 -0
- package/dist/focus/navigationFocus.d.ts +42 -0
- package/dist/focus/navigationFocus.js +241 -0
- package/dist/focus/programmaticFocus.d.ts +15 -0
- package/dist/focus/programmaticFocus.js +152 -0
- package/dist/gestures/GestureView.d.ts +12 -0
- package/dist/gestures/GestureView.js +321 -0
- package/dist/gestures/arena.d.ts +138 -0
- package/dist/gestures/arena.js +417 -0
- package/dist/gestures/existingCompetitors.d.ts +79 -0
- package/dist/gestures/existingCompetitors.js +82 -0
- package/dist/gestures/gesture.d.ts +62 -0
- package/dist/gestures/gesture.js +107 -0
- package/dist/glass/ControlLens.d.ts +46 -0
- package/dist/glass/ControlLens.js +88 -0
- package/dist/glass/GlassBar.d.ts +9 -0
- package/dist/glass/GlassBar.js +22 -0
- package/dist/glass/GlassConfusionReview.d.ts +3 -0
- package/dist/glass/GlassConfusionReview.js +185 -0
- package/dist/glass/GlassEffect.d.ts +69 -0
- package/dist/glass/GlassEffect.js +550 -0
- package/dist/glass/GlassMaterialRoot.d.ts +7 -0
- package/dist/glass/GlassMaterialRoot.js +39 -0
- package/dist/glass/GlassPresentation.d.ts +28 -0
- package/dist/glass/GlassPresentation.js +1038 -0
- package/dist/glass/GlassProbeIcons.d.ts +8 -0
- package/dist/glass/GlassProbeIcons.js +12 -0
- package/dist/glass/GlassProbeOverlay.d.ts +52 -0
- package/dist/glass/GlassProbeOverlay.js +45 -0
- package/dist/glass/GlassTextField.d.ts +22 -0
- package/dist/glass/GlassTextField.js +12 -0
- package/dist/glass/MaterialEffectRoot.d.ts +9 -0
- package/dist/glass/MaterialEffectRoot.js +189 -0
- package/dist/glass/Menu.d.ts +3 -0
- package/dist/glass/Menu.js +35 -0
- package/dist/glass/MenuStack.d.ts +23 -0
- package/dist/glass/MenuStack.js +371 -0
- package/dist/glass/MenuSymbol.d.ts +7 -0
- package/dist/glass/MenuSymbol.js +16 -0
- package/dist/glass/MorphEllipsisArtwork.d.ts +2 -0
- package/dist/glass/MorphEllipsisArtwork.js +6 -0
- package/dist/glass/TabBar.d.ts +29 -0
- package/dist/glass/TabBar.js +169 -0
- package/dist/glass/capability.d.ts +25 -0
- package/dist/glass/capability.js +63 -0
- package/dist/glass/captureWindow.d.ts +60 -0
- package/dist/glass/captureWindow.js +119 -0
- package/dist/glass/confusionSession.d.ts +41 -0
- package/dist/glass/confusionSession.js +44 -0
- package/dist/glass/contactPhysics.d.ts +130 -0
- package/dist/glass/contactPhysics.js +214 -0
- package/dist/glass/context.d.ts +37 -0
- package/dist/glass/context.js +11 -0
- package/dist/glass/errorAlert.d.ts +6 -0
- package/dist/glass/errorAlert.js +57 -0
- package/dist/glass/errors.d.ts +22 -0
- package/dist/glass/errors.js +78 -0
- package/dist/glass/failurePolicy.d.ts +4 -0
- package/dist/glass/failurePolicy.js +20 -0
- package/dist/glass/fallback/material.d.ts +16 -0
- package/dist/glass/fallback/material.js +87 -0
- package/dist/glass/fallback/regions.d.ts +16 -0
- package/dist/glass/fallback/regions.js +249 -0
- package/dist/glass/fallback/runtime.d.ts +72 -0
- package/dist/glass/fallback/runtime.js +278 -0
- package/dist/glass/fallback/selection.d.ts +2 -0
- package/dist/glass/fallback/selection.js +9 -0
- package/dist/glass/fieldGeometry.d.ts +28 -0
- package/dist/glass/fieldGeometry.js +64 -0
- package/dist/glass/fieldMotion.d.ts +42 -0
- package/dist/glass/fieldMotion.js +47 -0
- package/dist/glass/glassContact.d.ts +76 -0
- package/dist/glass/glassContact.js +153 -0
- package/dist/glass/glassProbeSettings.d.ts +18 -0
- package/dist/glass/glassProbeSettings.js +133 -0
- package/dist/glass/lens/Scene.d.ts +108 -0
- package/dist/glass/lens/Scene.js +553 -0
- package/dist/glass/lens/backgrounds.json +103 -0
- package/dist/glass/lens/bitmapBackdrop.d.ts +14 -0
- package/dist/glass/lens/bitmapBackdrop.js +35 -0
- package/dist/glass/lens/controlLift.d.ts +94 -0
- package/dist/glass/lens/controlLift.js +78 -0
- package/dist/glass/lens/data.d.ts +19 -0
- package/dist/glass/lens/data.js +161 -0
- package/dist/glass/lens/drawableTop.d.ts +16 -0
- package/dist/glass/lens/drawableTop.js +15 -0
- package/dist/glass/lens/icons.d.ts +9 -0
- package/dist/glass/lens/icons.js +34 -0
- package/dist/glass/lens/interactiveContact.d.ts +33 -0
- package/dist/glass/lens/interactiveContact.js +158 -0
- package/dist/glass/lens/interactivePress.d.ts +95 -0
- package/dist/glass/lens/interactivePress.js +169 -0
- package/dist/glass/lens/ios27GlyphFit.json +126 -0
- package/dist/glass/lens/lensLightingSamples.json +1 -0
- package/dist/glass/lens/lensPress.d.ts +22 -0
- package/dist/glass/lens/lensPress.js +68 -0
- package/dist/glass/lens/lensPressSamples.json +1 -0
- package/dist/glass/lens/liquidMotion.d.ts +50 -0
- package/dist/glass/lens/liquidMotion.js +239 -0
- package/dist/glass/lens/materialGlassRecipes.json +776 -0
- package/dist/glass/lens/materialUniforms.d.ts +22 -0
- package/dist/glass/lens/materialUniforms.js +117 -0
- package/dist/glass/lens/menu-closing-close-fit.json +380 -0
- package/dist/glass/lens/menu-opening-native-fits.json +911 -0
- package/dist/glass/lens/menuContextFit.json +88 -0
- package/dist/glass/lens/menuContextOpacity.json +98 -0
- package/dist/glass/lens/menuContextPresentation.d.ts +15 -0
- package/dist/glass/lens/menuContextPresentation.js +65 -0
- package/dist/glass/lens/menuCornerFit.json +252 -0
- package/dist/glass/lens/menuCornerMotion.d.ts +9 -0
- package/dist/glass/lens/menuCornerMotion.js +5 -0
- package/dist/glass/lens/menuDropFit.json +64 -0
- package/dist/glass/lens/menuField.d.ts +178 -0
- package/dist/glass/lens/menuField.js +564 -0
- package/dist/glass/lens/menuGesturePresentation.d.ts +12 -0
- package/dist/glass/lens/menuGesturePresentation.js +42 -0
- package/dist/glass/lens/menuGlyphDropFit.json +38 -0
- package/dist/glass/lens/menuMorphFit.json +564 -0
- package/dist/glass/lens/menuMorphMotion.d.ts +70 -0
- package/dist/glass/lens/menuMorphMotion.js +219 -0
- package/dist/glass/lens/menuMorphPhoneFit.json +85 -0
- package/dist/glass/lens/menuMotion.d.ts +81 -0
- package/dist/glass/lens/menuMotion.js +323 -0
- package/dist/glass/lens/menuPlacement.d.ts +5 -0
- package/dist/glass/lens/menuPlacement.js +29 -0
- package/dist/glass/lens/menuSpring.d.ts +18 -0
- package/dist/glass/lens/menuSpring.js +29 -0
- package/dist/glass/lens/menuTouchLight.d.ts +13 -0
- package/dist/glass/lens/menuTouchLight.js +147 -0
- package/dist/glass/lens/mirrorConstants.d.ts +1 -0
- package/dist/glass/lens/mirrorConstants.js +2 -0
- package/dist/glass/lens/mirrorExtents.d.ts +52 -0
- package/dist/glass/lens/mirrorExtents.js +264 -0
- package/dist/glass/lens/mirrorInvalidation.d.ts +6 -0
- package/dist/glass/lens/mirrorInvalidation.js +10 -0
- package/dist/glass/lens/mirrorReuse.d.ts +20 -0
- package/dist/glass/lens/mirrorReuse.js +166 -0
- package/dist/glass/lens/motion.d.ts +62 -0
- package/dist/glass/lens/motion.js +93 -0
- package/dist/glass/lens/recordedMotion.d.ts +6 -0
- package/dist/glass/lens/recordedMotion.js +44 -0
- package/dist/glass/lens/referenceBackground.d.ts +9 -0
- package/dist/glass/lens/referenceBackground.js +151 -0
- package/dist/glass/lens/referenceProfiles.d.ts +21 -0
- package/dist/glass/lens/referenceProfiles.js +33 -0
- package/dist/glass/lens/referenceRegularTint.d.ts +12 -0
- package/dist/glass/lens/referenceRegularTint.js +41 -0
- package/dist/glass/lens/scopeSegments.d.ts +12 -0
- package/dist/glass/lens/scopeSegments.js +18 -0
- package/dist/glass/lens/scrollAnchoring.d.ts +15 -0
- package/dist/glass/lens/scrollAnchoring.js +17 -0
- package/dist/glass/lens/selectionParameters.json +94 -0
- package/dist/glass/lens/shapeParameters.json +198 -0
- package/dist/glass/lens/tab-motion-native-fits.json +778 -0
- package/dist/glass/lens/tabAccessoryMotion.d.ts +52 -0
- package/dist/glass/lens/tabAccessoryMotion.js +52 -0
- package/dist/glass/lens/tabChromaRimModel.d.ts +43 -0
- package/dist/glass/lens/tabChromaRimModel.js +93 -0
- package/dist/glass/lens/tabCollapseInkSamples.json +49 -0
- package/dist/glass/lens/tabCompactGesture.d.ts +15 -0
- package/dist/glass/lens/tabCompactGesture.js +50 -0
- package/dist/glass/lens/tabGeometryAttack.json +70 -0
- package/dist/glass/lens/tabGlyphColours.d.ts +17 -0
- package/dist/glass/lens/tabGlyphColours.js +37 -0
- package/dist/glass/lens/tabInterruptedDecaySamples.json +245 -0
- package/dist/glass/lens/tabInterruptedRestoreSamples.json +290 -0
- package/dist/glass/lens/tabMaterialModel.d.ts +10 -0
- package/dist/glass/lens/tabMaterialModel.js +108 -0
- package/dist/glass/lens/tabMinimizeInk.d.ts +15 -0
- package/dist/glass/lens/tabMinimizeInk.js +14 -0
- package/dist/glass/lens/tabMinimizeMotion.d.ts +36 -0
- package/dist/glass/lens/tabMinimizeMotion.js +107 -0
- package/dist/glass/lens/tabMinimizeSamples.json +411 -0
- package/dist/glass/lens/tabMotion.d.ts +91 -0
- package/dist/glass/lens/tabMotion.js +478 -0
- package/dist/glass/lens/tabMotionFit.d.ts +76 -0
- package/dist/glass/lens/tabMotionFit.js +61 -0
- package/dist/glass/lens/tabNativeSymbols.d.ts +1 -0
- package/dist/glass/lens/tabNativeSymbols.js +7 -0
- package/dist/glass/lens/tabPresentation.d.ts +21 -0
- package/dist/glass/lens/tabPresentation.js +20 -0
- package/dist/glass/lens/tabRelease.d.ts +5 -0
- package/dist/glass/lens/tabRelease.js +14 -0
- package/dist/glass/lens/tabRestoreMotion.d.ts +19 -0
- package/dist/glass/lens/tabRestoreMotion.js +65 -0
- package/dist/glass/lens/tabRestoreSamples.json +1272 -0
- package/dist/glass/lens/tabSearchMember.d.ts +38 -0
- package/dist/glass/lens/tabSearchMember.js +74 -0
- package/dist/glass/lens/tabSelectionMaterial.d.ts +20 -0
- package/dist/glass/lens/tabSelectionMaterial.js +23 -0
- package/dist/glass/lens/tabSelectionMeasurements.test-fixture.d.ts +9 -0
- package/dist/glass/lens/tabSelectionMeasurements.test-fixture.js +74 -0
- package/dist/glass/lens/tabSettingsSymbol.d.ts +1 -0
- package/dist/glass/lens/tabSettingsSymbol.js +2 -0
- package/dist/glass/lens/tabShapeResponse.d.ts +7 -0
- package/dist/glass/lens/tabShapeResponse.js +30 -0
- package/dist/glass/lens/theme.d.ts +18 -0
- package/dist/glass/lens/theme.js +40 -0
- package/dist/glass/lens/trace.d.ts +2 -0
- package/dist/glass/lens/trace.js +27 -0
- package/dist/glass/liquidContext.d.ts +31 -0
- package/dist/glass/liquidContext.js +2 -0
- package/dist/glass/menuPanelPlacement.d.ts +51 -0
- package/dist/glass/menuPanelPlacement.js +128 -0
- package/dist/glass/menuPresenter.d.ts +34 -0
- package/dist/glass/menuPresenter.js +983 -0
- package/dist/glass/menuSymbolMasks.d.ts +1 -0
- package/dist/glass/menuSymbolMasks.js +1 -0
- package/dist/glass/menuSymbolTokens.d.ts +22 -0
- package/dist/glass/menuSymbolTokens.js +12 -0
- package/dist/glass/menuTriggerGeometry.d.ts +99 -0
- package/dist/glass/menuTriggerGeometry.js +126 -0
- package/dist/glass/menuTriggerSnapshot.d.ts +77 -0
- package/dist/glass/menuTriggerSnapshot.js +69 -0
- package/dist/glass/menuTypes.d.ts +22 -0
- package/dist/glass/menuTypes.js +1 -0
- package/dist/glass/morphField.d.ts +18 -0
- package/dist/glass/morphField.js +139 -0
- package/dist/glass/presentationFrame.d.ts +43 -0
- package/dist/glass/presentationFrame.js +82 -0
- package/dist/glass/pressHighlight.d.ts +9 -0
- package/dist/glass/pressHighlight.js +158 -0
- package/dist/glass/regionRegistry.d.ts +93 -0
- package/dist/glass/regionRegistry.js +313 -0
- package/dist/glass/regions.d.ts +262 -0
- package/dist/glass/regions.js +147 -0
- package/dist/glass/regularMaterialContext.d.ts +45 -0
- package/dist/glass/regularMaterialContext.js +118 -0
- package/dist/glass/regularTriggerMaterial.d.ts +19 -0
- package/dist/glass/regularTriggerMaterial.js +111 -0
- package/dist/glass/regularTriggerRim.d.ts +163 -0
- package/dist/glass/regularTriggerRim.js +436 -0
- package/dist/glass/renderSpecs.d.ts +454 -0
- package/dist/glass/renderSpecs.js +231 -0
- package/dist/glass/rendererContract.d.ts +205 -0
- package/dist/glass/rendererContract.js +18 -0
- package/dist/glass/shapeTrack.d.ts +53 -0
- package/dist/glass/shapeTrack.js +74 -0
- package/dist/glass/shapeTrackRegistry.d.ts +40 -0
- package/dist/glass/shapeTrackRegistry.js +49 -0
- package/dist/glass/sourceDamage.d.ts +6 -0
- package/dist/glass/sourceDamage.js +8 -0
- package/dist/glass/submenuMotion.d.ts +205 -0
- package/dist/glass/submenuMotion.js +306 -0
- package/dist/glass/tabBarModel.d.ts +12 -0
- package/dist/glass/tabBarModel.js +32 -0
- package/dist/glass/testing.d.ts +14 -0
- package/dist/glass/testing.js +14 -0
- package/dist/glass/tokens.d.ts +79 -0
- package/dist/glass/tokens.js +86 -0
- package/dist/glass/toolbarMaterialContext.d.ts +28 -0
- package/dist/glass/toolbarMaterialContext.js +66 -0
- package/dist/glass/topLayer.d.ts +5 -0
- package/dist/glass/topLayer.js +10 -0
- package/dist/glass/unionOutline.d.ts +11 -0
- package/dist/glass/unionOutline.js +98 -0
- package/dist/glass/visibleDeadline.d.ts +21 -0
- package/dist/glass/visibleDeadline.js +61 -0
- package/dist/glass/webgpu/accessoryMorph.d.ts +99 -0
- package/dist/glass/webgpu/accessoryMorph.js +473 -0
- package/dist/glass/webgpu/accessoryTrack.d.ts +47 -0
- package/dist/glass/webgpu/accessoryTrack.js +59 -0
- package/dist/glass/webgpu/areaMips.d.ts +50 -0
- package/dist/glass/webgpu/areaMips.js +166 -0
- package/dist/glass/webgpu/backdrop.d.ts +86 -0
- package/dist/glass/webgpu/backdrop.js +243 -0
- package/dist/glass/webgpu/backdropLayers.d.ts +29 -0
- package/dist/glass/webgpu/backdropLayers.js +182 -0
- package/dist/glass/webgpu/backgroundLayers.d.ts +71 -0
- package/dist/glass/webgpu/backgroundLayers.js +385 -0
- package/dist/glass/webgpu/cadence.d.ts +18 -0
- package/dist/glass/webgpu/cadence.js +35 -0
- package/dist/glass/webgpu/canvasSubmission.d.ts +6 -0
- package/dist/glass/webgpu/canvasSubmission.js +22 -0
- package/dist/glass/webgpu/capture.d.ts +77 -0
- package/dist/glass/webgpu/capture.js +534 -0
- package/dist/glass/webgpu/captureBands.d.ts +39 -0
- package/dist/glass/webgpu/captureBands.js +53 -0
- package/dist/glass/webgpu/captureContext.d.ts +1 -0
- package/dist/glass/webgpu/captureContext.js +6 -0
- package/dist/glass/webgpu/captureDemand.d.ts +44 -0
- package/dist/glass/webgpu/captureDemand.js +81 -0
- package/dist/glass/webgpu/captureRelease.d.ts +18 -0
- package/dist/glass/webgpu/captureRelease.js +39 -0
- package/dist/glass/webgpu/client.d.ts +49 -0
- package/dist/glass/webgpu/client.js +336 -0
- package/dist/glass/webgpu/contextBackdrop.d.ts +6 -0
- package/dist/glass/webgpu/contextBackdrop.js +13 -0
- package/dist/glass/webgpu/contextComposite.d.ts +64 -0
- package/dist/glass/webgpu/contextComposite.js +66 -0
- package/dist/glass/webgpu/decodedImage.d.ts +1 -0
- package/dist/glass/webgpu/decodedImage.js +2 -0
- package/dist/glass/webgpu/deviceLimits.d.ts +5 -0
- package/dist/glass/webgpu/deviceLimits.js +8 -0
- package/dist/glass/webgpu/edgePass.d.ts +9 -0
- package/dist/glass/webgpu/edgePass.js +170 -0
- package/dist/glass/webgpu/entry.worker.d.ts +1 -0
- package/dist/glass/webgpu/entry.worker.js +28 -0
- package/dist/glass/webgpu/errorCode.d.ts +3 -0
- package/dist/glass/webgpu/errorCode.js +27 -0
- package/dist/glass/webgpu/errors.d.ts +8 -0
- package/dist/glass/webgpu/errors.js +55 -0
- package/dist/glass/webgpu/fieldInk.d.ts +9 -0
- package/dist/glass/webgpu/fieldInk.js +62 -0
- package/dist/glass/webgpu/foreground.d.ts +29 -0
- package/dist/glass/webgpu/foreground.js +313 -0
- package/dist/glass/webgpu/frameClock.d.ts +34 -0
- package/dist/glass/webgpu/frameClock.js +60 -0
- package/dist/glass/webgpu/frameGraph.d.ts +57 -0
- package/dist/glass/webgpu/frameGraph.js +287 -0
- package/dist/glass/webgpu/frameProbe.d.ts +58 -0
- package/dist/glass/webgpu/frameProbe.js +181 -0
- package/dist/glass/webgpu/interactionProfiles.d.ts +10 -0
- package/dist/glass/webgpu/interactionProfiles.js +25 -0
- package/dist/glass/webgpu/keptGlyphs.d.ts +68 -0
- package/dist/glass/webgpu/keptGlyphs.js +85 -0
- package/dist/glass/webgpu/keyboardBackdrop.d.ts +12 -0
- package/dist/glass/webgpu/keyboardBackdrop.js +51 -0
- package/dist/glass/webgpu/lagTrace.d.ts +31 -0
- package/dist/glass/webgpu/lagTrace.js +22 -0
- package/dist/glass/webgpu/layers.d.ts +100 -0
- package/dist/glass/webgpu/layers.js +301 -0
- package/dist/glass/webgpu/lensDebug.d.ts +4 -0
- package/dist/glass/webgpu/lensDebug.js +28 -0
- package/dist/glass/webgpu/lensDiffusion.d.ts +2 -0
- package/dist/glass/webgpu/lensDiffusion.js +20 -0
- package/dist/glass/webgpu/lensLightingFit.json +222 -0
- package/dist/glass/webgpu/menuLiftInput.d.ts +30 -0
- package/dist/glass/webgpu/menuLiftInput.js +39 -0
- package/dist/glass/webgpu/menuSurfaceGuard.d.ts +17 -0
- package/dist/glass/webgpu/menuSurfaceGuard.js +26 -0
- package/dist/glass/webgpu/minimize.d.ts +184 -0
- package/dist/glass/webgpu/minimize.js +470 -0
- package/dist/glass/webgpu/navigationAtlasCopy.d.ts +12 -0
- package/dist/glass/webgpu/navigationAtlasCopy.js +121 -0
- package/dist/glass/webgpu/navigationTracks.d.ts +3 -0
- package/dist/glass/webgpu/navigationTracks.js +84 -0
- package/dist/glass/webgpu/passes.d.ts +204 -0
- package/dist/glass/webgpu/passes.js +394 -0
- package/dist/glass/webgpu/pendingSurfaceInput.d.ts +29 -0
- package/dist/glass/webgpu/pendingSurfaceInput.js +51 -0
- package/dist/glass/webgpu/preparedSourcePixels.d.ts +21 -0
- package/dist/glass/webgpu/preparedSourcePixels.js +43 -0
- package/dist/glass/webgpu/presentationBackdrop.d.ts +3 -0
- package/dist/glass/webgpu/presentationBackdrop.js +33 -0
- package/dist/glass/webgpu/presentationDiffusion.d.ts +48 -0
- package/dist/glass/webgpu/presentationDiffusion.js +57 -0
- package/dist/glass/webgpu/presentationMaterial.d.ts +9 -0
- package/dist/glass/webgpu/presentationMaterial.js +156 -0
- package/dist/glass/webgpu/presenterViewport.d.ts +11 -0
- package/dist/glass/webgpu/presenterViewport.js +193 -0
- package/dist/glass/webgpu/production.d.ts +552 -0
- package/dist/glass/webgpu/production.js +1929 -0
- package/dist/glass/webgpu/productionInstalls.d.ts +53 -0
- package/dist/glass/webgpu/productionInstalls.js +225 -0
- package/dist/glass/webgpu/productionNavigation.d.ts +5 -0
- package/dist/glass/webgpu/productionNavigation.js +360 -0
- package/dist/glass/webgpu/productionPinnedTop.d.ts +80 -0
- package/dist/glass/webgpu/productionPinnedTop.js +77 -0
- package/dist/glass/webgpu/productionPinnedTopPrepare.d.ts +21 -0
- package/dist/glass/webgpu/productionPinnedTopPrepare.js +132 -0
- package/dist/glass/webgpu/productionPlanes.d.ts +135 -0
- package/dist/glass/webgpu/productionPlanes.js +412 -0
- package/dist/glass/webgpu/productionPrepare.d.ts +18 -0
- package/dist/glass/webgpu/productionPrepare.js +832 -0
- package/dist/glass/webgpu/productionTracks.d.ts +73 -0
- package/dist/glass/webgpu/productionTracks.js +22 -0
- package/dist/glass/webgpu/productionViewport.d.ts +20 -0
- package/dist/glass/webgpu/productionViewport.js +52 -0
- package/dist/glass/webgpu/profile.d.ts +37 -0
- package/dist/glass/webgpu/profile.js +101 -0
- package/dist/glass/webgpu/raster.d.ts +337 -0
- package/dist/glass/webgpu/raster.js +1360 -0
- package/dist/glass/webgpu/rasterMaterial.d.ts +19 -0
- package/dist/glass/webgpu/rasterMaterial.js +197 -0
- package/dist/glass/webgpu/rasterShaders.d.ts +7 -0
- package/dist/glass/webgpu/rasterShaders.js +105 -0
- package/dist/glass/webgpu/rasterUniforms.d.ts +304 -0
- package/dist/glass/webgpu/rasterUniforms.js +415 -0
- package/dist/glass/webgpu/regionBackdrop.d.ts +8 -0
- package/dist/glass/webgpu/regionBackdrop.js +12 -0
- package/dist/glass/webgpu/regionBridge.d.ts +145 -0
- package/dist/glass/webgpu/regionBridge.js +1691 -0
- package/dist/glass/webgpu/regionScene.d.ts +294 -0
- package/dist/glass/webgpu/regionScene.js +2144 -0
- package/dist/glass/webgpu/renderer.d.ts +8 -0
- package/dist/glass/webgpu/renderer.js +1478 -0
- package/dist/glass/webgpu/residentPlanes.d.ts +69 -0
- package/dist/glass/webgpu/residentPlanes.js +104 -0
- package/dist/glass/webgpu/restMaterial.d.ts +6 -0
- package/dist/glass/webgpu/restMaterial.js +65 -0
- package/dist/glass/webgpu/resumeOverlay.d.ts +44 -0
- package/dist/glass/webgpu/resumeOverlay.js +82 -0
- package/dist/glass/webgpu/sampleTrace.d.ts +11 -0
- package/dist/glass/webgpu/sampleTrace.js +50 -0
- package/dist/glass/webgpu/scrollEdgeBackdrop.d.ts +89 -0
- package/dist/glass/webgpu/scrollEdgeBackdrop.js +177 -0
- package/dist/glass/webgpu/scrollEdgePose.d.ts +4 -0
- package/dist/glass/webgpu/scrollEdgePose.js +49 -0
- package/dist/glass/webgpu/selectionThumb.d.ts +81 -0
- package/dist/glass/webgpu/selectionThumb.js +209 -0
- package/dist/glass/webgpu/shaders.d.ts +67 -0
- package/dist/glass/webgpu/shaders.js +595 -0
- package/dist/glass/webgpu/sharedLift.d.ts +7 -0
- package/dist/glass/webgpu/sharedLift.js +223 -0
- package/dist/glass/webgpu/sourcePixels.d.ts +42 -0
- package/dist/glass/webgpu/sourcePixels.js +140 -0
- package/dist/glass/webgpu/sourcePixels.worker.d.ts +1 -0
- package/dist/glass/webgpu/sourcePixels.worker.js +62 -0
- package/dist/glass/webgpu/tabGlyphInk.d.ts +14 -0
- package/dist/glass/webgpu/tabGlyphInk.js +72 -0
- package/dist/glass/webgpu/touchLight.d.ts +4 -0
- package/dist/glass/webgpu/touchLight.js +15 -0
- package/dist/glass/worker/client.d.ts +21 -0
- package/dist/glass/worker/client.js +152 -0
- package/dist/glass/worker/experiment.d.ts +13 -0
- package/dist/glass/worker/experiment.js +221 -0
- package/dist/glass/worker/fixture.d.ts +21 -0
- package/dist/glass/worker/fixture.js +152 -0
- package/dist/glass/worker/protocol.d.ts +439 -0
- package/dist/glass/worker/protocol.js +5 -0
- package/dist/graphicsProbe.d.ts +19 -0
- package/dist/graphicsProbe.js +111 -0
- package/dist/haptics/SensoryButton.d.ts +21 -0
- package/dist/haptics/SensoryButton.js +80 -0
- package/dist/image/ContentAdmission.d.ts +19 -0
- package/dist/image/ContentAdmission.js +70 -0
- package/dist/image/Image.d.ts +30 -0
- package/dist/image/Image.js +341 -0
- package/dist/image/asset.d.ts +9 -0
- package/dist/image/asset.js +1 -0
- package/dist/image/contentReadiness.d.ts +7 -0
- package/dist/image/contentReadiness.js +54 -0
- package/dist/image/imports.d.ts +4 -0
- package/dist/image/resource.d.ts +53 -0
- package/dist/image/resource.js +286 -0
- package/dist/image/vite.d.ts +3 -0
- package/dist/image/vite.js +63 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +102 -0
- package/dist/install.d.ts +8 -0
- package/dist/install.js +8 -0
- package/dist/internal.d.ts +96 -0
- package/dist/internal.js +80 -0
- package/dist/keyboard/adapter.d.ts +82 -0
- package/dist/keyboard/adapter.js +727 -0
- package/dist/keyboard/avoidance.d.ts +24 -0
- package/dist/keyboard/avoidance.js +283 -0
- package/dist/keyboard/caretMirror.d.ts +13 -0
- package/dist/keyboard/caretMirror.js +122 -0
- package/dist/keyboard/expectedKeyboard.d.ts +10 -0
- package/dist/keyboard/expectedKeyboard.js +60 -0
- package/dist/keyboard/geometry.d.ts +10 -0
- package/dist/keyboard/geometry.js +21 -0
- package/dist/keyboard/modalTapFocus.d.ts +41 -0
- package/dist/keyboard/modalTapFocus.js +224 -0
- package/dist/keyboard/motion.d.ts +54 -0
- package/dist/keyboard/motion.js +80 -0
- package/dist/keyboard/translation.d.ts +12 -0
- package/dist/keyboard/translation.js +19 -0
- package/dist/layout/adaptiveTabsContext.d.ts +5 -0
- package/dist/layout/adaptiveTabsContext.js +2 -0
- package/dist/layout/deviceIdiom.d.ts +4 -0
- package/dist/layout/deviceIdiom.js +12 -0
- package/dist/layout/layoutClass.d.ts +44 -0
- package/dist/layout/layoutClass.js +102 -0
- package/dist/layout/navigationLayoutContext.d.ts +8 -0
- package/dist/layout/navigationLayoutContext.js +5 -0
- package/dist/list-form/ListForm.d.ts +158 -0
- package/dist/list-form/ListForm.js +427 -0
- package/dist/list-form/ListItem.d.ts +30 -0
- package/dist/list-form/ListItem.js +251 -0
- package/dist/list-form/RowLabel.d.ts +14 -0
- package/dist/list-form/RowLabel.js +11 -0
- package/dist/list-form/Slider.d.ts +18 -0
- package/dist/list-form/Slider.js +235 -0
- package/dist/list-form/StepperButton.d.ts +9 -0
- package/dist/list-form/StepperButton.js +60 -0
- package/dist/list-form/Toggle.d.ts +16 -0
- package/dist/list-form/Toggle.js +204 -0
- package/dist/list-form/editMotion.d.ts +15 -0
- package/dist/list-form/editMotion.js +25 -0
- package/dist/list-form/editing.d.ts +102 -0
- package/dist/list-form/editing.js +51 -0
- package/dist/list-form/listContext.d.ts +4 -0
- package/dist/list-form/listContext.js +5 -0
- package/dist/list-form/offsets.d.ts +26 -0
- package/dist/list-form/offsets.js +34 -0
- package/dist/list-form/reorder.d.ts +20 -0
- package/dist/list-form/reorder.js +193 -0
- package/dist/list-form/rowMotion.d.ts +11 -0
- package/dist/list-form/rowMotion.js +236 -0
- package/dist/list-form/rowMotionScope.d.ts +14 -0
- package/dist/list-form/rowMotionScope.js +61 -0
- package/dist/list-form/separatorInsets.d.ts +4 -0
- package/dist/list-form/separatorInsets.js +87 -0
- package/dist/list-form/sliderContact.d.ts +40 -0
- package/dist/list-form/sliderContact.js +98 -0
- package/dist/list-form/state.d.ts +5 -0
- package/dist/list-form/state.js +8 -0
- package/dist/list-form/toggleContact.d.ts +55 -0
- package/dist/list-form/toggleContact.js +164 -0
- package/dist/media/controller.d.ts +7 -0
- package/dist/media/controller.js +612 -0
- package/dist/media/react.d.ts +9 -0
- package/dist/media/react.js +38 -0
- package/dist/media/systemMedia.d.ts +6 -0
- package/dist/media/systemMedia.js +200 -0
- package/dist/media/types.d.ts +83 -0
- package/dist/media/types.js +1 -0
- package/dist/menu/menuContact.d.ts +20 -0
- package/dist/menu/menuContact.js +286 -0
- package/dist/menu/menuGesture.d.ts +84 -0
- package/dist/menu/menuGesture.js +502 -0
- package/dist/menu/menuInteraction.d.ts +17 -0
- package/dist/menu/menuInteraction.js +34 -0
- package/dist/menu/menuOutside.d.ts +9 -0
- package/dist/menu/menuOutside.js +58 -0
- package/dist/menu/menuPanelContact.d.ts +11 -0
- package/dist/menu/menuPanelContact.js +77 -0
- package/dist/menu/menuTriggerHold.d.ts +3 -0
- package/dist/menu/menuTriggerHold.js +52 -0
- package/dist/menu/sampledMotion.d.ts +37 -0
- package/dist/menu/sampledMotion.js +86 -0
- package/dist/modal/lifecycle.d.ts +10 -0
- package/dist/modal/lifecycle.js +189 -0
- package/dist/motion/TransitionView.d.ts +12 -0
- package/dist/motion/TransitionView.js +118 -0
- package/dist/motion/animate.d.ts +20 -0
- package/dist/motion/animate.js +79 -0
- package/dist/motion/animationValue.d.ts +25 -0
- package/dist/motion/animationValue.js +42 -0
- package/dist/motion/composerMotion.d.ts +3 -0
- package/dist/motion/composerMotion.js +15 -0
- package/dist/motion/layoutTransaction.d.ts +7 -0
- package/dist/motion/layoutTransaction.js +28 -0
- package/dist/motion/matchedGeometry.d.ts +55 -0
- package/dist/motion/matchedGeometry.js +412 -0
- package/dist/motion/springPath.d.ts +27 -0
- package/dist/motion/springPath.js +46 -0
- package/dist/motion/springTrack.d.ts +33 -0
- package/dist/motion/springTrack.js +69 -0
- package/dist/motion/transition.d.ts +48 -0
- package/dist/motion/transition.js +56 -0
- package/dist/motion/transitionImages.d.ts +7 -0
- package/dist/motion/transitionImages.js +49 -0
- package/dist/motionProbe.d.ts +227 -0
- package/dist/motionProbe.js +697 -0
- package/dist/motionProbeControls.d.ts +2 -0
- package/dist/motionProbeControls.js +118 -0
- package/dist/motionProbeDelivery.d.ts +15 -0
- package/dist/motionProbeDelivery.js +84 -0
- package/dist/navigation/DetailList.d.ts +9 -0
- package/dist/navigation/DetailList.js +7 -0
- package/dist/navigation/NavigationChrome.d.ts +18 -0
- package/dist/navigation/NavigationChrome.js +195 -0
- package/dist/navigation/NavigationSearchRow.d.ts +9 -0
- package/dist/navigation/NavigationSearchRow.js +101 -0
- package/dist/navigation/NavigationTitleSlots.d.ts +18 -0
- package/dist/navigation/NavigationTitleSlots.js +64 -0
- package/dist/navigation/NavigatorHost.d.ts +17 -0
- package/dist/navigation/NavigatorHost.js +534 -0
- package/dist/navigation/ScreenContainer.d.ts +31 -0
- package/dist/navigation/ScreenContainer.js +219 -0
- package/dist/navigation/ScrubSourceFrames.d.ts +18 -0
- package/dist/navigation/ScrubSourceFrames.js +67 -0
- package/dist/navigation/Sidebar.d.ts +16 -0
- package/dist/navigation/Sidebar.js +20 -0
- package/dist/navigation/SidebarSymbol.d.ts +4 -0
- package/dist/navigation/SidebarSymbol.js +6 -0
- package/dist/navigation/ToolbarGlass.d.ts +2 -0
- package/dist/navigation/ToolbarGlass.js +429 -0
- package/dist/navigation/TransitionEdge.d.ts +4 -0
- package/dist/navigation/TransitionEdge.js +33 -0
- package/dist/navigation/bottomToolbarGeometry.d.ts +6 -0
- package/dist/navigation/bottomToolbarGeometry.js +14 -0
- package/dist/navigation/chromeCurves.d.ts +48 -0
- package/dist/navigation/chromeCurves.js +255 -0
- package/dist/navigation/glassTransition.d.ts +32 -0
- package/dist/navigation/glassTransition.js +55 -0
- package/dist/navigation/horizontalDrag.d.ts +6 -0
- package/dist/navigation/horizontalDrag.js +15 -0
- package/dist/navigation/interactivePop.d.ts +45 -0
- package/dist/navigation/interactivePop.js +86 -0
- package/dist/navigation/interactivePopTypes.d.ts +85 -0
- package/dist/navigation/interactivePopTypes.js +36 -0
- package/dist/navigation/keyboard.d.ts +9 -0
- package/dist/navigation/keyboard.js +55 -0
- package/dist/navigation/motion.d.ts +19 -0
- package/dist/navigation/motion.js +645 -0
- package/dist/navigation/motionTokens.d.ts +43 -0
- package/dist/navigation/motionTokens.js +75 -0
- package/dist/navigation/nativeScrubExperiment.d.ts +5 -0
- package/dist/navigation/nativeScrubExperiment.js +153 -0
- package/dist/navigation/nativeScrubSource.d.ts +15 -0
- package/dist/navigation/nativeScrubSource.js +88 -0
- package/dist/navigation/navigationChromeModel.d.ts +8 -0
- package/dist/navigation/navigationChromeModel.js +30 -0
- package/dist/navigation/navigationContext.d.ts +22 -0
- package/dist/navigation/navigationContext.js +65 -0
- package/dist/navigation/navigationEdge.d.ts +4 -0
- package/dist/navigation/navigationEdge.js +101 -0
- package/dist/navigation/pointerPop.d.ts +32 -0
- package/dist/navigation/pointerPop.js +206 -0
- package/dist/navigation/probeLayers.d.ts +7 -0
- package/dist/navigation/probeLayers.js +8 -0
- package/dist/navigation/registry.d.ts +14 -0
- package/dist/navigation/registry.js +31 -0
- package/dist/navigation/releaseDecision.d.ts +21 -0
- package/dist/navigation/releaseDecision.js +94 -0
- package/dist/navigation/releaseTrajectory.d.ts +20 -0
- package/dist/navigation/releaseTrajectory.js +95 -0
- package/dist/navigation/releaseVelocity.d.ts +9 -0
- package/dist/navigation/releaseVelocity.js +38 -0
- package/dist/navigation/routeCodec.d.ts +33 -0
- package/dist/navigation/routeCodec.js +123 -0
- package/dist/navigation/scrollEdge.d.ts +18 -0
- package/dist/navigation/scrollEdge.js +66 -0
- package/dist/navigation/scrubFrameLoop.d.ts +44 -0
- package/dist/navigation/scrubFrameLoop.js +129 -0
- package/dist/navigation/sidebarSelection.d.ts +5 -0
- package/dist/navigation/sidebarSelection.js +8 -0
- package/dist/navigation/splitContext.d.ts +17 -0
- package/dist/navigation/splitContext.js +9 -0
- package/dist/navigation/splitState.d.ts +46 -0
- package/dist/navigation/splitState.js +130 -0
- package/dist/navigation/stack.d.ts +25 -0
- package/dist/navigation/stack.js +136 -0
- package/dist/navigation/store.d.ts +80 -0
- package/dist/navigation/store.js +464 -0
- package/dist/navigation/toolbarGlassMotion.d.ts +40 -0
- package/dist/navigation/toolbarGlassMotion.js +202 -0
- package/dist/navigation/toolbarMinimization.d.ts +9 -0
- package/dist/navigation/toolbarMinimization.js +76 -0
- package/dist/navigation/toolbarMotionOwner.d.ts +6 -0
- package/dist/navigation/toolbarMotionOwner.js +30 -0
- package/dist/navigation/touchArbitration.d.ts +34 -0
- package/dist/navigation/touchArbitration.js +550 -0
- package/dist/navigation/tracking.d.ts +7 -0
- package/dist/navigation/tracking.js +19 -0
- package/dist/navigation/transitionBindings.d.ts +31 -0
- package/dist/navigation/transitionBindings.js +106 -0
- package/dist/navigation/transitionChrome.d.ts +31 -0
- package/dist/navigation/transitionChrome.js +380 -0
- package/dist/navigation/transitionPose.d.ts +52 -0
- package/dist/navigation/transitionPose.js +295 -0
- package/dist/navigation/types.d.ts +133 -0
- package/dist/navigation/types.js +1 -0
- package/dist/navigation/zoomDrag.d.ts +3 -0
- package/dist/navigation/zoomDrag.js +125 -0
- package/dist/navigation/zoomGeometry.d.ts +48 -0
- package/dist/navigation/zoomGeometry.js +94 -0
- package/dist/navigation/zoomGlass.d.ts +27 -0
- package/dist/navigation/zoomGlass.js +64 -0
- package/dist/navigation/zoomMotion.d.ts +73 -0
- package/dist/navigation/zoomMotion.js +104 -0
- package/dist/navigation/zoomTransition.d.ts +82 -0
- package/dist/navigation/zoomTransition.js +975 -0
- package/dist/presentation/Presentation.d.ts +61 -0
- package/dist/presentation/Presentation.js +92 -0
- package/dist/presentation/PresentationSurface.d.ts +29 -0
- package/dist/presentation/PresentationSurface.js +586 -0
- package/dist/presentation/PresentedSheet.d.ts +2 -0
- package/dist/presentation/PresentedSheet.js +571 -0
- package/dist/presentation/activity.d.ts +3 -0
- package/dist/presentation/activity.js +24 -0
- package/dist/presentation/coldLaunch.d.ts +2 -0
- package/dist/presentation/coldLaunch.js +19 -0
- package/dist/presentation/dismiss.d.ts +26 -0
- package/dist/presentation/dismiss.js +30 -0
- package/dist/presentation/glassMotion.d.ts +39 -0
- package/dist/presentation/glassMotion.js +259 -0
- package/dist/presentation/glassReady.d.ts +11 -0
- package/dist/presentation/glassReady.js +246 -0
- package/dist/presentation/model.d.ts +108 -0
- package/dist/presentation/model.js +183 -0
- package/dist/presentation/motion.d.ts +56 -0
- package/dist/presentation/motion.js +263 -0
- package/dist/presentation/presentationMotion.d.ts +10 -0
- package/dist/presentation/presentationMotion.js +74 -0
- package/dist/presentation/presentationSource.d.ts +2 -0
- package/dist/presentation/presentationSource.js +28 -0
- package/dist/presentation/sheetChromeContext.d.ts +2 -0
- package/dist/presentation/sheetChromeContext.js +3 -0
- package/dist/presentation/sheetMaterialTransition.d.ts +14 -0
- package/dist/presentation/sheetMaterialTransition.js +33 -0
- package/dist/presentation/sheetReleaseMotion.d.ts +18 -0
- package/dist/presentation/sheetReleaseMotion.js +123 -0
- package/dist/presentation/useAlertKeyboardMotion.d.ts +8 -0
- package/dist/presentation/useAlertKeyboardMotion.js +104 -0
- package/dist/press/Pressable.d.ts +19 -0
- package/dist/press/Pressable.js +16 -0
- package/dist/press/activation.d.ts +20 -0
- package/dist/press/activation.js +28 -0
- package/dist/press/contactReceipt.d.ts +23 -0
- package/dist/press/contactReceipt.js +177 -0
- package/dist/press/gestureArbitration.d.ts +13 -0
- package/dist/press/gestureArbitration.js +38 -0
- package/dist/press/stateMachine.d.ts +29 -0
- package/dist/press/stateMachine.js +39 -0
- package/dist/press/tokens.d.ts +18 -0
- package/dist/press/tokens.js +19 -0
- package/dist/press/usePressInteraction.d.ts +30 -0
- package/dist/press/usePressInteraction.js +247 -0
- package/dist/public/Label.d.ts +16 -0
- package/dist/public/Label.js +40 -0
- package/dist/public/NativeFilePicker.d.ts +19 -0
- package/dist/public/NativeFilePicker.js +75 -0
- package/dist/public/Screen.d.ts +42 -0
- package/dist/public/Screen.js +87 -0
- package/dist/public/actions.d.ts +16 -0
- package/dist/public/actions.js +15 -0
- package/dist/public/buttonBorderShape.d.ts +7 -0
- package/dist/public/buttonBorderShape.js +9 -0
- package/dist/public/chrome.d.ts +3 -0
- package/dist/public/chrome.js +5 -0
- package/dist/public/colors.d.ts +29 -0
- package/dist/public/colors.js +28 -0
- package/dist/public/context.d.ts +19 -0
- package/dist/public/context.js +8 -0
- package/dist/public/controlStyle.d.ts +93 -0
- package/dist/public/controlStyle.js +52 -0
- package/dist/public/controls.d.ts +360 -0
- package/dist/public/controls.js +301 -0
- package/dist/public/definition.d.ts +65 -0
- package/dist/public/definition.js +58 -0
- package/dist/public/deviceActions.d.ts +23 -0
- package/dist/public/deviceActions.js +87 -0
- package/dist/public/environment.d.ts +77 -0
- package/dist/public/environment.js +171 -0
- package/dist/public/fieldContext.d.ts +2 -0
- package/dist/public/fieldContext.js +3 -0
- package/dist/public/filePickers.d.ts +25 -0
- package/dist/public/filePickers.js +11 -0
- package/dist/public/glass.d.ts +31 -0
- package/dist/public/glass.js +29 -0
- package/dist/public/glassValue.d.ts +19 -0
- package/dist/public/glassValue.js +32 -0
- package/dist/public/keyboard.d.ts +4 -0
- package/dist/public/keyboard.js +6 -0
- package/dist/public/navigationTransition.d.ts +48 -0
- package/dist/public/navigationTransition.js +49 -0
- package/dist/public/pickerNavigation.d.ts +7 -0
- package/dist/public/pickerNavigation.js +64 -0
- package/dist/public/presentation.d.ts +40 -0
- package/dist/public/presentation.js +21 -0
- package/dist/public/presentationContext.d.ts +2 -0
- package/dist/public/presentationContext.js +3 -0
- package/dist/public/routeRegistry.d.ts +3 -0
- package/dist/public/routeRegistry.js +10 -0
- package/dist/public/routes.d.ts +74 -0
- package/dist/public/routes.js +105 -0
- package/dist/public/runtime.d.ts +134 -0
- package/dist/public/runtime.js +292 -0
- package/dist/public/screenChrome.d.ts +91 -0
- package/dist/public/screenChrome.js +187 -0
- package/dist/public/scroll.d.ts +38 -0
- package/dist/public/scroll.js +7 -0
- package/dist/public/storage.d.ts +9 -0
- package/dist/public/storage.js +9 -0
- package/dist/public/structure.d.ts +65 -0
- package/dist/public/structure.js +40 -0
- package/dist/public/toolbar.d.ts +37 -0
- package/dist/public/toolbar.js +76 -0
- package/dist/push/PushPermissionExplainer.d.ts +14 -0
- package/dist/push/PushPermissionExplainer.js +30 -0
- package/dist/push/notifications.d.ts +54 -0
- package/dist/push/notifications.js +276 -0
- package/dist/push/routes.d.ts +20 -0
- package/dist/push/routes.js +63 -0
- package/dist/push/schema.d.ts +42 -0
- package/dist/push/schema.js +41 -0
- package/dist/push/urlProjection.d.ts +24 -0
- package/dist/push/urlProjection.js +207 -0
- package/dist/reachability/controller.d.ts +21 -0
- package/dist/reachability/controller.js +202 -0
- package/dist/reachability/model.d.ts +94 -0
- package/dist/reachability/model.js +131 -0
- package/dist/reachability/react.d.ts +29 -0
- package/dist/reachability/react.js +69 -0
- package/dist/restoration/navigation.d.ts +9 -0
- package/dist/restoration/navigation.js +55 -0
- package/dist/restoration/react.d.ts +6 -0
- package/dist/restoration/react.js +21 -0
- package/dist/restoration/routes.d.ts +22 -0
- package/dist/restoration/routes.js +166 -0
- package/dist/restoration/scene.d.ts +44 -0
- package/dist/restoration/scene.js +284 -0
- package/dist/root/SatinRoot.d.ts +25 -0
- package/dist/root/SatinRoot.js +512 -0
- package/dist/root/mountSatin.d.ts +12 -0
- package/dist/root/mountSatin.js +60 -0
- package/dist/root/runtimeContext.d.ts +26 -0
- package/dist/root/runtimeContext.js +30 -0
- package/dist/safe-area/Overlay.d.ts +9 -0
- package/dist/safe-area/Overlay.js +26 -0
- package/dist/safe-area/SafeAreaInset.d.ts +25 -0
- package/dist/safe-area/SafeAreaInset.js +138 -0
- package/dist/safe-area/bottomInsetGeometry.d.ts +12 -0
- package/dist/safe-area/bottomInsetGeometry.js +73 -0
- package/dist/safe-area/context.d.ts +15 -0
- package/dist/safe-area/context.js +8 -0
- package/dist/safe-area/displayCorners.d.ts +21 -0
- package/dist/safe-area/displayCorners.js +70 -0
- package/dist/safe-area/keyboardCarrier.d.ts +26 -0
- package/dist/safe-area/keyboardCarrier.js +394 -0
- package/dist/safe-area/keyboardCarrierGeometry.d.ts +37 -0
- package/dist/safe-area/keyboardCarrierGeometry.js +49 -0
- package/dist/safe-area/modifiers.d.ts +52 -0
- package/dist/safe-area/modifiers.js +86 -0
- package/dist/safe-area/useSafeAreaMetrics.d.ts +83 -0
- package/dist/safe-area/useSafeAreaMetrics.js +367 -0
- package/dist/safe-area/windowChrome.d.ts +7 -0
- package/dist/safe-area/windowChrome.js +14 -0
- package/dist/scroll/RefreshControl.d.ts +8 -0
- package/dist/scroll/RefreshControl.js +135 -0
- package/dist/scroll/ScrollSurface.d.ts +62 -0
- package/dist/scroll/ScrollSurface.js +278 -0
- package/dist/scroll/ScrollTarget.d.ts +6 -0
- package/dist/scroll/ScrollTarget.js +11 -0
- package/dist/scroll/edgePolicy.d.ts +21 -0
- package/dist/scroll/edgePolicy.js +17 -0
- package/dist/scroll/insertionMotion.d.ts +15 -0
- package/dist/scroll/insertionMotion.js +128 -0
- package/dist/scroll/nativeScroll.d.ts +14 -0
- package/dist/scroll/nativeScroll.js +71 -0
- package/dist/scroll/position.d.ts +31 -0
- package/dist/scroll/position.js +273 -0
- package/dist/scroll/pressOwnership.d.ts +4 -0
- package/dist/scroll/pressOwnership.js +65 -0
- package/dist/scroll/refreshMotion.d.ts +9 -0
- package/dist/scroll/refreshMotion.js +15 -0
- package/dist/scroll/refreshable.d.ts +6 -0
- package/dist/scroll/refreshable.js +50 -0
- package/dist/scroll/registry.d.ts +38 -0
- package/dist/scroll/registry.js +261 -0
- package/dist/scroll/screenGeometry.d.ts +8 -0
- package/dist/scroll/screenGeometry.js +50 -0
- package/dist/scroll/scrollIndicator.d.ts +7 -0
- package/dist/scroll/scrollIndicator.js +114 -0
- package/dist/scroll/scrollJump.d.ts +7 -0
- package/dist/scroll/scrollJump.js +16 -0
- package/dist/scroll/types.d.ts +12 -0
- package/dist/scroll/types.js +1 -0
- package/dist/search/SearchDrawer.d.ts +16 -0
- package/dist/search/SearchDrawer.js +421 -0
- package/dist/search/SearchScopesBar.d.ts +6 -0
- package/dist/search/SearchScopesBar.js +12 -0
- package/dist/search/SearchToolbarField.d.ts +8 -0
- package/dist/search/SearchToolbarField.js +115 -0
- package/dist/search/searchBackdrop.d.ts +12 -0
- package/dist/search/searchBackdrop.js +45 -0
- package/dist/search/searchChrome.d.ts +13 -0
- package/dist/search/searchChrome.js +31 -0
- package/dist/search/searchMotion.d.ts +30 -0
- package/dist/search/searchMotion.js +46 -0
- package/dist/search/searchPlacement.d.ts +11 -0
- package/dist/search/searchPlacement.js +15 -0
- package/dist/search/searchable.d.ts +46 -0
- package/dist/search/searchable.js +5 -0
- package/dist/search/useSearchPresentation.d.ts +15 -0
- package/dist/search/useSearchPresentation.js +61 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.js +144 -0
- package/dist/settings/DisclosureIndicator.d.ts +4 -0
- package/dist/settings/DisclosureIndicator.js +6 -0
- package/dist/settings/tokens.d.ts +129 -0
- package/dist/settings/tokens.js +143 -0
- package/dist/shapes/corners.d.ts +14 -0
- package/dist/shapes/corners.js +80 -0
- package/dist/styles.css +9078 -0
- package/dist/styles.css.d.ts +3 -0
- package/dist/sw/activationState.d.ts +20 -0
- package/dist/sw/activationState.js +39 -0
- package/dist/sw/generator.d.ts +14 -0
- package/dist/sw/generator.js +26 -0
- package/dist/sw/manifest.d.ts +32 -0
- package/dist/sw/manifest.js +137 -0
- package/dist/sw/protocol.d.ts +7 -0
- package/dist/sw/protocol.js +7 -0
- package/dist/sw/pushRuntime.d.ts +2 -0
- package/dist/sw/pushRuntime.js +161 -0
- package/dist/sw/registerAppShell.d.ts +25 -0
- package/dist/sw/registerAppShell.js +259 -0
- package/dist/sw/renderServiceWorker.d.ts +10 -0
- package/dist/sw/renderServiceWorker.js +370 -0
- package/dist/sw/requestRouting.d.ts +13 -0
- package/dist/sw/requestRouting.js +26 -0
- package/dist/sw/updateCheck.d.ts +2 -0
- package/dist/sw/updateCheck.js +25 -0
- package/dist/sw/vite.d.ts +20 -0
- package/dist/sw/vite.js +71 -0
- package/dist/symbols/Symbol.d.ts +33 -0
- package/dist/symbols/Symbol.js +59 -0
- package/dist/symbols/catalogue.d.ts +4 -0
- package/dist/symbols/catalogue.js +4139 -0
- package/dist/symbols/exclusions.d.ts +2 -0
- package/dist/symbols/exclusions.js +4 -0
- package/dist/symbols/inheritedWeight.d.ts +3 -0
- package/dist/symbols/inheritedWeight.js +104 -0
- package/dist/symbols/metrics.d.ts +38 -0
- package/dist/symbols/metrics.js +53 -0
- package/dist/symbols/svg.d.ts +3 -0
- package/dist/symbols/svg.js +16 -0
- package/dist/symbols/types.d.ts +30 -0
- package/dist/symbols/types.js +1 -0
- package/dist/tabs/TabSection.d.ts +12 -0
- package/dist/tabs/TabSection.js +4 -0
- package/dist/tabs/TabSidebarSurface.d.ts +7 -0
- package/dist/tabs/TabSidebarSurface.js +29 -0
- package/dist/tabs/TabView.d.ts +28 -0
- package/dist/tabs/TabView.js +258 -0
- package/dist/tabs/accessoryContact.d.ts +2 -0
- package/dist/tabs/accessoryContact.js +42 -0
- package/dist/tabs/compactBar.d.ts +4 -0
- package/dist/tabs/compactBar.js +28 -0
- package/dist/tabs/context.d.ts +8 -0
- package/dist/tabs/context.js +6 -0
- package/dist/tabs/keyboard.d.ts +3 -0
- package/dist/tabs/keyboard.js +23 -0
- package/dist/tabs/model.d.ts +6 -0
- package/dist/tabs/model.js +16 -0
- package/dist/tabs/presentation.d.ts +7 -0
- package/dist/tabs/presentation.js +14 -0
- package/dist/tabs/sourceRevision.d.ts +3 -0
- package/dist/tabs/sourceRevision.js +36 -0
- package/dist/tabs/tabSidebarGlyph.d.ts +2 -0
- package/dist/tabs/tabSidebarGlyph.js +11 -0
- package/dist/tasks/useTask.d.ts +16 -0
- package/dist/tasks/useTask.js +67 -0
- package/dist/testing.d.ts +9 -0
- package/dist/testing.js +11 -0
- package/dist/text-input/TextEditor.d.ts +25 -0
- package/dist/text-input/TextEditor.js +74 -0
- package/dist/text-input/TextField.d.ts +32 -0
- package/dist/text-input/TextField.js +29 -0
- package/dist/text-input/editorGeometry.d.ts +2 -0
- package/dist/text-input/editorGeometry.js +6 -0
- package/dist/text-input/editorTextLayout.d.ts +2 -0
- package/dist/text-input/editorTextLayout.js +31 -0
- package/dist/text-input/focusChain.d.ts +27 -0
- package/dist/text-input/focusChain.js +62 -0
- package/dist/text-input/kinds.d.ts +8 -0
- package/dist/text-input/kinds.js +34 -0
- package/dist/text-input/measureEditor.d.ts +2 -0
- package/dist/text-input/measureEditor.js +50 -0
- package/dist/text-input/submit.d.ts +9 -0
- package/dist/text-input/submit.js +7 -0
- package/dist/unstable.d.ts +16 -0
- package/dist/unstable.js +16 -0
- package/dist/vite.d.ts +3 -0
- package/dist/vite.js +3 -0
- package/dist/web/WebView.d.ts +42 -0
- package/dist/web/WebView.js +115 -0
- package/dist/web/authentication.d.ts +75 -0
- package/dist/web/authentication.js +488 -0
- package/dist/web/openURL.d.ts +37 -0
- package/dist/web/openURL.js +89 -0
- package/dist/web/urlPolicy.d.ts +3 -0
- package/dist/web/urlPolicy.js +19 -0
- package/dist/web/useWebAuthentication.d.ts +3 -0
- package/dist/web/useWebAuthentication.js +6 -0
- package/dist/zoom/Zoomable.d.ts +10 -0
- package/dist/zoom/Zoomable.js +116 -0
- package/dist/zoom/geometry.d.ts +11 -0
- package/dist/zoom/geometry.js +16 -0
- package/package.json +115 -3
|
@@ -0,0 +1,983 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { toolbarMaterialOwner, toolbarMenuTrigger, ToolbarMaterialPortal, } from './toolbarMaterialContext.js';
|
|
3
|
+
import { NavigatorContext, ScreenContext } from '../navigation/navigationContext.js';
|
|
4
|
+
import { TabActivityContext } from '../tabs/context.js';
|
|
5
|
+
import { glassAperture } from './shapeTrackRegistry.js';
|
|
6
|
+
import { snapshotMenuTrigger } from './menuTriggerSnapshot.js';
|
|
7
|
+
import { contextContentScale, contextLiftBox, menuOpensUpward, menuPanelPlacement, } from './menuPanelPlacement.js';
|
|
8
|
+
import { menuTriggerGeometry, menuTriggerReturnGeometry, menuTriggerSource, menuTriggerContents, menuTriggerHasGlass, menuLabelTrigger, plainMenuSourceKind, contextMenuSeed, contextMenuReturnSeed, } from './menuTriggerGeometry.js';
|
|
9
|
+
import { createMenuContact } from '../menu/menuContact.js';
|
|
10
|
+
import { animateContentLift, animateContextBackdrop, animateContextDismissal, animateContextLift, animateContextPreview, animateContextPreviewDismissal, CONTEXT_CURVE_MS, contextHoldScale, } from '../actions/contextMotion.js';
|
|
11
|
+
import { decodePreviewImages, PREVIEW_DECODE_LIMIT_MS, promoteContextSource, } from '../actions/preview.js';
|
|
12
|
+
import { topModal } from '../modal/lifecycle.js';
|
|
13
|
+
import { MenuSymbol } from './MenuSymbol.js';
|
|
14
|
+
import { holdPresentationForGlass } from '../presentation/glassReady.js';
|
|
15
|
+
import { MenuStack } from './MenuStack.js';
|
|
16
|
+
import { VisibleDeadline } from './visibleDeadline.js';
|
|
17
|
+
import { menuMorphDuration, menuMotionProfile } from './lens/menuMorphMotion.js';
|
|
18
|
+
import { useObservedKeyboardMetrics } from '../keyboard/adapter.js';
|
|
19
|
+
import { useCallback, useContext, useEffect, useId, useLayoutEffect, useRef, useState, useSyncExternalStore, } from 'react';
|
|
20
|
+
import { createPortal } from 'react-dom';
|
|
21
|
+
import {} from '../press/Pressable.js';
|
|
22
|
+
import { observePointerPressCancellation } from '../press/gestureArbitration.js';
|
|
23
|
+
import { refreshSafeAreaMetrics, useObservedSafeAreaMetrics, } from '../safe-area/useSafeAreaMetrics.js';
|
|
24
|
+
import { bindMenuOutside } from '../menu/menuOutside.js';
|
|
25
|
+
import { focusFromFramework } from '../focus/programmaticFocus.js';
|
|
26
|
+
import { GlassEffect, GlassLayer } from './GlassEffect.js';
|
|
27
|
+
import { MaterialEffectContext } from './liquidContext.js';
|
|
28
|
+
import { GLASS_MENU_MORPH } from './lens/interactivePress.js';
|
|
29
|
+
import { glassPressScale } from './pressHighlight.js';
|
|
30
|
+
import { reportGlassError } from './errors.js';
|
|
31
|
+
import { glassFailureCode } from './webgpu/errorCode.js';
|
|
32
|
+
import { traceStage, traceStageStart } from './webgpu/profile.js';
|
|
33
|
+
import { isPlainMenuSource } from './regions.js';
|
|
34
|
+
/** Viewport margins of a placed menu (points): the nearest a panel may come to the screen's
|
|
35
|
+
* edges. A phone panel is placed from its trigger (menuPanelPlacement.ts): a stock toolbar Menu's
|
|
36
|
+
* panel ends at its trigger's trailing edge, 20 pt from the screen edge, and starts at the
|
|
37
|
+
* trigger's top (the safe-area top). Lifted context content, a custom preview and their menus
|
|
38
|
+
* stop 20 pt from the screen edge on both idioms (CONTEXT_MARGIN). Other iPad menus keep 8 pt. */
|
|
39
|
+
const MENU_PHONE_MARGIN = { side: 20, top: 0, bottom: 8 };
|
|
40
|
+
const MENU_PAD_MARGIN = { side: 8, top: 8, bottom: 8 };
|
|
41
|
+
/** Lifted content and its menu stay 20 pt inside the safe area on every side (native menu measurements
|
|
42
|
+
* tall-bubble stills: content and menu stop at 82 and 902 pt on a 440 x 956 pt iPhone with
|
|
43
|
+
* 62 / 34 pt insets). iPad (native iPad recordings, 834 pt wide): a tall bubble settles at x 20
|
|
44
|
+
* and a short one ends at 814, while its toolbar menu keeps 8 pt. The iPad top and bottom
|
|
45
|
+
* values are unmeasured and follow iPhone. */
|
|
46
|
+
const CONTEXT_MARGIN = { side: 20, top: 20, bottom: 20 };
|
|
47
|
+
/** Resting corner radius: the phone panel's corner fits a 32 pt circle within 0.8 pt from
|
|
48
|
+
* 1 pt deep (same recording). Paired iPad context, toolbar and Picker contours fit
|
|
49
|
+
* 26.5 pt within the 2 pt raster-fit uncertainty (87 pt and 146 pt menu heights). */
|
|
50
|
+
const MENU_CORNER_RADIUS = { phone: 32, pad: 26.5 };
|
|
51
|
+
/** Longest wait for the renderer's open-settled ink hand-off before the live rows show anyway
|
|
52
|
+
* (the phone open settles at 460 ms, the iPad open at 550 ms). */
|
|
53
|
+
const subscribeWithoutNavigator = () => () => { };
|
|
54
|
+
const navigationSettled = () => false;
|
|
55
|
+
const MENU_INK_FALLBACK_MS = 1500;
|
|
56
|
+
/** How long a closing plain glyph's return fade runs, from the close (styles.css). */
|
|
57
|
+
const MENU_GLYPH_RETURN_MS = 400;
|
|
58
|
+
/** Safety margin past the close morph for the renderer's settle acknowledgement. */
|
|
59
|
+
const MENU_SETTLE_TIMEOUT_MS = 700;
|
|
60
|
+
/** The order of a menu that opens upward: the first action nearest the trigger, so the list and
|
|
61
|
+
* each section in it read bottom to top (stock SwiftUI Menu, iPhone, a trigger near the bottom of
|
|
62
|
+
* the screen). A submenu's own rows open separately and keep their order. */
|
|
63
|
+
function nearestFirst(actions) {
|
|
64
|
+
return [...actions]
|
|
65
|
+
.reverse()
|
|
66
|
+
.map(action => 'section' in action ? { ...action, section: nearestFirst(action.section) } : action);
|
|
67
|
+
}
|
|
68
|
+
/** An entry as ActionMenu draws it, at every depth: a glass symbol takes the leading aperture
|
|
69
|
+
* and `destructive` becomes the destructive role, inside sections and submenus as at the top. */
|
|
70
|
+
function menuAction(entry) {
|
|
71
|
+
if ('section' in entry)
|
|
72
|
+
return { ...entry, section: entry.section.map(menuAction) };
|
|
73
|
+
if ('submenu' in entry) {
|
|
74
|
+
// A submenu row's symbol takes the same leading aperture as a leaf's (native: the More
|
|
75
|
+
// options label starts 64 pt in, like its leaf siblings).
|
|
76
|
+
// Leaves reach MenuSymbol through the same GlassAction view of their symbol (below).
|
|
77
|
+
const symbol = 'symbol' in entry ? entry.symbol : undefined;
|
|
78
|
+
return {
|
|
79
|
+
id: entry.id,
|
|
80
|
+
label: entry.label,
|
|
81
|
+
disabled: entry.disabled,
|
|
82
|
+
icon: symbol ? _jsx(MenuSymbol, { name: symbol }) : entry.icon,
|
|
83
|
+
submenu: entry.submenu.map(menuAction),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const { symbol, destructive, ...action } = entry;
|
|
87
|
+
return {
|
|
88
|
+
...action,
|
|
89
|
+
role: action.role ?? (destructive ? 'destructive' : undefined),
|
|
90
|
+
icon: symbol ? (_jsx(MenuSymbol, { name: symbol, followsCheckmark: action.checked !== undefined })) : (action.icon),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/** Measure the final CSS box without registering glass or painting transient content. */
|
|
94
|
+
function MenuMeasurement({ children, style, id, role, ...props }) {
|
|
95
|
+
return (_jsx("div", { id: id, role: role, "data-satin-general-menu": "true", "data-satin-menu-idiom": props['data-satin-menu-idiom'], style: style, children: children }));
|
|
96
|
+
}
|
|
97
|
+
/** Box mapping, for a transform on `box`, that lands it on `onto`. */
|
|
98
|
+
function boxOnto(box, onto) {
|
|
99
|
+
return {
|
|
100
|
+
dx: onto.x + onto.width / 2 - (box.x + box.width / 2),
|
|
101
|
+
dy: onto.y + onto.height / 2 - (box.y + box.height / 2),
|
|
102
|
+
scaleX: onto.width / box.width,
|
|
103
|
+
scaleY: onto.height / box.height,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export function useMenuPresenter({ label, actions, disabled = false, preview, }) {
|
|
107
|
+
const id = useId(), anchor = useRef(null), panel = useRef(null), topLayer = useRef(null), dimLayer = useRef(null);
|
|
108
|
+
const source = useRef(null);
|
|
109
|
+
/** Ends a plain glyph's running return fade (see the close effects below). */
|
|
110
|
+
const glyphReturn = useRef(undefined);
|
|
111
|
+
const contact = useRef(createMenuContact());
|
|
112
|
+
useLayoutEffect(() => {
|
|
113
|
+
const controller = contact.current;
|
|
114
|
+
return () => controller.cancel();
|
|
115
|
+
}, []);
|
|
116
|
+
const context = source.current?.kind === 'context';
|
|
117
|
+
const [preparing, setPreparing] = useState(false);
|
|
118
|
+
const [portalHost, setPortalHost] = useState();
|
|
119
|
+
const preparingContact = useRef(false);
|
|
120
|
+
const preparingPointerId = useRef(undefined);
|
|
121
|
+
const [open, setOpen] = useState(false), [position, setPosition] = useState({ left: 0, top: 0, maxHeight: 440, maxWidth: 320 });
|
|
122
|
+
// On WebGPU the panel's glass emerges from the trigger's glass and returns into it on close
|
|
123
|
+
// (GLASS_MENU_MORPH): the trigger hides while its glass is the menu, and the panel stays
|
|
124
|
+
// mounted, inert, until the return morph ends.
|
|
125
|
+
const liquid = useContext(MaterialEffectContext);
|
|
126
|
+
const morphs = Boolean(liquid?.backend);
|
|
127
|
+
const tabActive = useContext(TabActivityContext);
|
|
128
|
+
const screen = useContext(ScreenContext);
|
|
129
|
+
const navigatorStore = useContext(NavigatorContext);
|
|
130
|
+
const [closing, setClosing] = useState(false);
|
|
131
|
+
const presenting = open || closing || preparing;
|
|
132
|
+
const navigationBlocked = useSyncExternalStore(presenting && navigatorStore ? navigatorStore.subscribe : subscribeWithoutNavigator, navigatorStore
|
|
133
|
+
? () => navigatorStore.getState().entries.some(entry => entry.transition.phase !== 'settled')
|
|
134
|
+
: navigationSettled, navigationSettled);
|
|
135
|
+
const ownerInactive = disabled ||
|
|
136
|
+
!tabActive ||
|
|
137
|
+
!!screen?.lifecycle.isCovered ||
|
|
138
|
+
(!!screen && screen.lifecycle.phase !== 'settled');
|
|
139
|
+
const ownerUnavailable = ownerInactive || navigationBlocked;
|
|
140
|
+
const [emergeFrom, setEmergeFrom] = useState();
|
|
141
|
+
const [sourceKind, setSourceKind] = useState();
|
|
142
|
+
// Zero of the fitted opening curves; a hold sets it from the touch clock (CONTEXT_CURVE_MS).
|
|
143
|
+
const recognitionEpoch = useRef(undefined);
|
|
144
|
+
const held = useRef(false);
|
|
145
|
+
// A custom preview's images decode during the hold, so the lift moves real pixels.
|
|
146
|
+
const previewDecode = useRef(undefined);
|
|
147
|
+
const decodePreview = (root) => {
|
|
148
|
+
const pending = decodePreviewImages(root);
|
|
149
|
+
const decode = { root, done: !pending, promise: pending ?? Promise.resolve() };
|
|
150
|
+
void decode.promise.then(() => (decode.done = true));
|
|
151
|
+
previewDecode.current = decode;
|
|
152
|
+
return decode;
|
|
153
|
+
};
|
|
154
|
+
const promoted = useRef(undefined);
|
|
155
|
+
/** Native lifts every press the same way, however soon after the last dismissal. A press that
|
|
156
|
+
* starts while the previous lift is still returning lands that lift at once, so the new hold
|
|
157
|
+
* measures and grows its source from the resting place. */
|
|
158
|
+
const landContextLift = () => {
|
|
159
|
+
const lifted = promoted.current;
|
|
160
|
+
if (!lifted)
|
|
161
|
+
return;
|
|
162
|
+
for (const animation of lifted.element.getAnimations()) {
|
|
163
|
+
// Only the lift's own motion; the app's CSS animations and transitions are left alone.
|
|
164
|
+
if (!('animationName' in animation) && !('transitionProperty' in animation))
|
|
165
|
+
animation.cancel();
|
|
166
|
+
}
|
|
167
|
+
lifted.restore();
|
|
168
|
+
};
|
|
169
|
+
const contextRestRect = useRef(undefined);
|
|
170
|
+
// Where lifted content or a custom preview settles; the menu is placed from it. Rows keep
|
|
171
|
+
// their resting bounds.
|
|
172
|
+
const liftBox = useRef(undefined);
|
|
173
|
+
const previewBox = useRef(null);
|
|
174
|
+
const [fading, setFading] = useState(false);
|
|
175
|
+
const closingRef = useRef(false);
|
|
176
|
+
const sourceFocus = useRef(null);
|
|
177
|
+
const editingSource = useRef(null);
|
|
178
|
+
// One number per open/close transition: the renderer's settle report names it, so a late report
|
|
179
|
+
// from an earlier close cannot end this one.
|
|
180
|
+
const [transition, setTransition] = useState(0);
|
|
181
|
+
// The trigger hides only once the panel's glass presents (at the trigger's rectangle), so no
|
|
182
|
+
// frame shows neither.
|
|
183
|
+
const [placed, setPlaced] = useState(false);
|
|
184
|
+
const Surface = placed ? GlassEffect : MenuMeasurement;
|
|
185
|
+
const [prepared, setPrepared] = useState(false);
|
|
186
|
+
const [presented, setPresented] = useState(false);
|
|
187
|
+
// While the glass morphs, it draws the rows as ink inside the material (lensed by its rim);
|
|
188
|
+
// the live rows take over when the renderer reports the open settled, and hand back when it
|
|
189
|
+
// reports the close started.
|
|
190
|
+
const [inkDom, setInkDom] = useState(false);
|
|
191
|
+
const shown = !ownerUnavailable && (open || closing || preparing);
|
|
192
|
+
const metrics = useObservedSafeAreaMetrics(shown);
|
|
193
|
+
const keyboard = useObservedKeyboardMetrics(shown);
|
|
194
|
+
const phone = typeof navigator !== 'undefined' && /iPhone|iPod/i.test(navigator.userAgent);
|
|
195
|
+
const contentMenu = context && anchor.current?.matches('[data-satin-row]') === false;
|
|
196
|
+
const closeMorphMs = menuMorphDuration('close', menuMotionProfile({ sourceKind, content: contentMenu, idiom: phone ? 'phone' : 'pad' }));
|
|
197
|
+
const [returnTo, setReturnTo] = useState();
|
|
198
|
+
const [sourceRegionId, setSourceRegionId] = useState();
|
|
199
|
+
const [sourceSnapshot, setSourceSnapshot] = useState();
|
|
200
|
+
useLayoutEffect(() => {
|
|
201
|
+
const document = anchor.current?.ownerDocument;
|
|
202
|
+
if (!preparing || !document)
|
|
203
|
+
return;
|
|
204
|
+
let retirement;
|
|
205
|
+
const retire = () => {
|
|
206
|
+
if (!preparingContact.current)
|
|
207
|
+
return;
|
|
208
|
+
preparingContact.current = false;
|
|
209
|
+
setPreparing(false);
|
|
210
|
+
setEmergeFrom(undefined);
|
|
211
|
+
};
|
|
212
|
+
const stopObserving = context
|
|
213
|
+
? () => { }
|
|
214
|
+
: observePointerPressCancellation(preparingPointerId.current, retire);
|
|
215
|
+
const end = (event) => {
|
|
216
|
+
if (event.pointerId !== preparingPointerId.current)
|
|
217
|
+
return;
|
|
218
|
+
clearTimeout(retirement);
|
|
219
|
+
// WebKit can release implicit capture away from the trigger. Wait a task,
|
|
220
|
+
// not a capture-phase microtask, so accepted activation finishes first.
|
|
221
|
+
retirement = setTimeout(() => {
|
|
222
|
+
if (!preparingContact.current || event.pointerId !== preparingPointerId.current)
|
|
223
|
+
return;
|
|
224
|
+
retire();
|
|
225
|
+
}, 0);
|
|
226
|
+
};
|
|
227
|
+
for (const type of ['pointerup', 'pointercancel', 'lostpointercapture']) {
|
|
228
|
+
document.addEventListener(type, end, true);
|
|
229
|
+
}
|
|
230
|
+
return () => {
|
|
231
|
+
stopObserving();
|
|
232
|
+
clearTimeout(retirement);
|
|
233
|
+
for (const type of ['pointerup', 'pointercancel', 'lostpointercapture']) {
|
|
234
|
+
document.removeEventListener(type, end, true);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
}, [preparing]);
|
|
238
|
+
// A z-index cannot rise above a modal sheet. A popover enters the browser top layer,
|
|
239
|
+
// and staying inside the source dialog preserves its modal focus/input ownership.
|
|
240
|
+
useLayoutEffect(() => {
|
|
241
|
+
const host = topLayer.current;
|
|
242
|
+
if (!shown || !host)
|
|
243
|
+
return;
|
|
244
|
+
const started = traceStageStart();
|
|
245
|
+
// The dim enters first: a lifted context source enters between the dim and the menu.
|
|
246
|
+
const dim = dimLayer.current;
|
|
247
|
+
dim?.showPopover?.();
|
|
248
|
+
host.showPopover?.();
|
|
249
|
+
traceStage('menu-top-layer', started);
|
|
250
|
+
return () => {
|
|
251
|
+
host.hidePopover?.();
|
|
252
|
+
if (dim?.isConnected)
|
|
253
|
+
dim.hidePopover?.();
|
|
254
|
+
};
|
|
255
|
+
}, [shown]);
|
|
256
|
+
const readAvailable = (content = false) => {
|
|
257
|
+
const viewport = window.visualViewport;
|
|
258
|
+
const left = viewport?.offsetLeft ?? 0, top = viewport?.offsetTop ?? 0;
|
|
259
|
+
const width = viewport?.width ?? document.documentElement.clientWidth;
|
|
260
|
+
const height = keyboard.visible ? keyboard.viewportHeight : metrics.layoutViewport.height;
|
|
261
|
+
const margin = content ? CONTEXT_MARGIN : phone ? MENU_PHONE_MARGIN : MENU_PAD_MARGIN;
|
|
262
|
+
return {
|
|
263
|
+
x: left + metrics.insets.left + margin.side,
|
|
264
|
+
y: top + metrics.insets.top + margin.top,
|
|
265
|
+
width: Math.max(44, width - metrics.insets.left - metrics.insets.right - 2 * margin.side),
|
|
266
|
+
height: Math.max(44, height - metrics.insets.top - metrics.insets.bottom - margin.top - margin.bottom),
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
useLayoutEffect(() => {
|
|
270
|
+
const element = anchor.current;
|
|
271
|
+
const epoch = recognitionEpoch.current;
|
|
272
|
+
if (!context || !shown || !element || epoch === undefined)
|
|
273
|
+
return;
|
|
274
|
+
const started = traceStageStart();
|
|
275
|
+
if (preparing) {
|
|
276
|
+
held.current = true;
|
|
277
|
+
if (previewBox.current)
|
|
278
|
+
decodePreview(previewBox.current);
|
|
279
|
+
const animation = animateContextLift(element, epoch, true);
|
|
280
|
+
traceStage('menu-context-lift', started);
|
|
281
|
+
return () => animation?.cancel();
|
|
282
|
+
}
|
|
283
|
+
// The preview leaves the scale the hold is showing, not a fixed start.
|
|
284
|
+
const contactElapsed = performance.timeOrigin + performance.now() - epoch + CONTEXT_CURVE_MS;
|
|
285
|
+
const from = held.current ? contextHoldScale(contactElapsed) : 1;
|
|
286
|
+
held.current = false;
|
|
287
|
+
const rest = contextRestRect.current ?? element.getBoundingClientRect();
|
|
288
|
+
const menuHeight = panel.current?.getBoundingClientRect().height ?? 0;
|
|
289
|
+
const custom = previewBox.current;
|
|
290
|
+
const settle = (box) => {
|
|
291
|
+
liftBox.current = box;
|
|
292
|
+
if (morphs)
|
|
293
|
+
setEmergeFrom(contextMenuSeed(DOMRect.fromRect(box)));
|
|
294
|
+
};
|
|
295
|
+
if (custom) {
|
|
296
|
+
// A custom preview replaces the source: it grows out of the source's box into its own
|
|
297
|
+
// size, centred on the source, while the source fades under it.
|
|
298
|
+
// iPad's menu sits beside the preview, so the preview needs no room above or below.
|
|
299
|
+
const box = contextLiftBox(rest, custom.getBoundingClientRect(), phone ? menuHeight : 0, readAvailable(true));
|
|
300
|
+
settle(box);
|
|
301
|
+
let animations = [];
|
|
302
|
+
let cancelled = false;
|
|
303
|
+
// Decoded by recognition (the usual case), the preview lifts on the recognition clock
|
|
304
|
+
// with the glass. Otherwise it waits, bounded, and lifts from when its pixels exist.
|
|
305
|
+
const lift = (recognitionEpoch) => {
|
|
306
|
+
Object.assign(custom.style, {
|
|
307
|
+
left: `${box.x}px`,
|
|
308
|
+
top: `${box.y}px`,
|
|
309
|
+
width: `${box.width}px`,
|
|
310
|
+
height: `${box.height}px`,
|
|
311
|
+
visibility: 'visible',
|
|
312
|
+
});
|
|
313
|
+
animations = animateContextPreview(custom, element, boxOnto(box, rest), {
|
|
314
|
+
holdScale: from,
|
|
315
|
+
recognitionEpoch,
|
|
316
|
+
});
|
|
317
|
+
};
|
|
318
|
+
const decode = previewDecode.current?.root === custom ? previewDecode.current : decodePreview(custom);
|
|
319
|
+
if (decode.done)
|
|
320
|
+
lift(epoch);
|
|
321
|
+
else {
|
|
322
|
+
const limit = new Promise(resolve => setTimeout(resolve, PREVIEW_DECODE_LIMIT_MS));
|
|
323
|
+
void Promise.race([decode.promise, limit]).then(() => {
|
|
324
|
+
if (!cancelled)
|
|
325
|
+
lift();
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
traceStage('menu-context-lift', started);
|
|
329
|
+
return () => {
|
|
330
|
+
cancelled = true;
|
|
331
|
+
previewDecode.current = undefined;
|
|
332
|
+
for (const animation of animations)
|
|
333
|
+
animation.cancel();
|
|
334
|
+
element.style.removeProperty('opacity');
|
|
335
|
+
for (const property of ['left', 'top', 'width', 'height', 'visibility'])
|
|
336
|
+
custom.style.removeProperty(property);
|
|
337
|
+
liftBox.current = undefined;
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
const content = !element.matches('[data-satin-row]');
|
|
341
|
+
const source = promoteContextSource(element);
|
|
342
|
+
promoted.current = source;
|
|
343
|
+
// Native draws the menu over its lifted content when they overlap (a bubble taller than the
|
|
344
|
+
// space beside it, iPhone 17 Pro Max native reference). The source just entered the top layer above
|
|
345
|
+
// the menu's plane, so the plane re-enters above it; the dim keeps its own plane below.
|
|
346
|
+
topLayer.current?.hidePopover?.();
|
|
347
|
+
topLayer.current?.showPopover?.();
|
|
348
|
+
let animation;
|
|
349
|
+
if (content) {
|
|
350
|
+
const available = readAvailable(true);
|
|
351
|
+
// Content already as wide as the screen allows does not grow past it; content taller
|
|
352
|
+
// than the screen shrinks until all of it shows (native: a 1340 pt bubble settles 820 pt
|
|
353
|
+
// tall, the whole available height).
|
|
354
|
+
const scale = Math.min(Math.max(1, Math.min(contextContentScale(rest.width, rest.height), available.width / rest.width)), available.height / rest.height);
|
|
355
|
+
const size = { width: rest.width * scale, height: rest.height * scale };
|
|
356
|
+
const box = contextLiftBox(rest, size, menuHeight, available);
|
|
357
|
+
settle(box);
|
|
358
|
+
const { dx, dy } = boxOnto(rest, box);
|
|
359
|
+
animation = animateContentLift(element, { scale, dx, dy }, from, source.shadow, epoch);
|
|
360
|
+
}
|
|
361
|
+
else
|
|
362
|
+
animation = animateContextLift(element, epoch, false, from, source.shadow);
|
|
363
|
+
traceStage('menu-context-lift', started);
|
|
364
|
+
return () => {
|
|
365
|
+
animation?.cancel();
|
|
366
|
+
source.restore();
|
|
367
|
+
liftBox.current = undefined;
|
|
368
|
+
if (promoted.current === source)
|
|
369
|
+
promoted.current = undefined;
|
|
370
|
+
};
|
|
371
|
+
}, [context, shown, preparing]);
|
|
372
|
+
// Dismissal, for any reason: the dim fades and the preview settles onto its source. The
|
|
373
|
+
// preview never floats over moving content: once its source scrolls, it rejoins the layout.
|
|
374
|
+
useLayoutEffect(() => {
|
|
375
|
+
const epoch = recognitionEpoch.current;
|
|
376
|
+
if (!context || !closing || epoch === undefined)
|
|
377
|
+
return;
|
|
378
|
+
const backdrop = dimLayer.current?.querySelector('[data-satin-context-backdrop]');
|
|
379
|
+
const custom = previewBox.current;
|
|
380
|
+
const box = liftBox.current;
|
|
381
|
+
if (custom && box && anchor.current) {
|
|
382
|
+
const dismissal = [
|
|
383
|
+
...animateContextDismissal(backdrop, null, epoch),
|
|
384
|
+
...animateContextPreviewDismissal(custom, anchor.current, boxOnto(box, anchor.current.getBoundingClientRect())),
|
|
385
|
+
];
|
|
386
|
+
return () => {
|
|
387
|
+
for (const animation of dismissal)
|
|
388
|
+
animation.cancel();
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
const animations = animateContextDismissal(backdrop, promoted.current ? anchor.current : null, epoch, promoted.current?.shadow);
|
|
392
|
+
const land = () => {
|
|
393
|
+
if (promoted.current?.moved())
|
|
394
|
+
promoted.current.restore();
|
|
395
|
+
};
|
|
396
|
+
land();
|
|
397
|
+
document.addEventListener('scroll', land, true);
|
|
398
|
+
return () => {
|
|
399
|
+
document.removeEventListener('scroll', land, true);
|
|
400
|
+
for (const animation of animations)
|
|
401
|
+
animation.cancel();
|
|
402
|
+
};
|
|
403
|
+
}, [context, closing]);
|
|
404
|
+
useLayoutEffect(() => {
|
|
405
|
+
const backdrop = dimLayer.current?.querySelector('[data-satin-context-backdrop]');
|
|
406
|
+
if (!backdrop || recognitionEpoch.current === undefined)
|
|
407
|
+
return;
|
|
408
|
+
const animation = animateContextBackdrop(backdrop, recognitionEpoch.current);
|
|
409
|
+
return () => animation?.cancel();
|
|
410
|
+
}, [context, preparing, presented]);
|
|
411
|
+
useLayoutEffect(() => {
|
|
412
|
+
if (!panel.current || !placed)
|
|
413
|
+
return;
|
|
414
|
+
return contact.current.attach(panel.current, input => liquid?.regions?.interact(input));
|
|
415
|
+
}, [shown, placed, liquid?.regions]);
|
|
416
|
+
// The pressed member locates the seed inside the complete shared capsule.
|
|
417
|
+
const [memberCenter, setMemberCenter] = useState();
|
|
418
|
+
// A phone menu that opens upward lists its rows from the trigger outward (native: the first
|
|
419
|
+
// action sits nearest the trigger, at the bottom).
|
|
420
|
+
const [upward, setUpward] = useState(false);
|
|
421
|
+
// Focus returns after the source glass becomes visible and leaves its inert interval.
|
|
422
|
+
const refocus = useRef(false), morphing = useRef(false);
|
|
423
|
+
useLayoutEffect(() => {
|
|
424
|
+
morphing.current = morphs && !!emergeFrom && presented;
|
|
425
|
+
}, [morphs, emergeFrom, presented]);
|
|
426
|
+
const focusFirstRow = () => {
|
|
427
|
+
if (editingSource.current === document.activeElement)
|
|
428
|
+
return;
|
|
429
|
+
const first = panel.current?.querySelector(':is([role="menuitem"], [role="menuitemradio"]):not(:disabled):not([aria-disabled="true"])');
|
|
430
|
+
if (first && !first.closest('[inert]') && getComputedStyle(first).visibility !== 'hidden')
|
|
431
|
+
focusFromFramework(first, { preventScroll: true });
|
|
432
|
+
};
|
|
433
|
+
const readReturnTarget = useCallback((capture = false) => {
|
|
434
|
+
const viewport = window.visualViewport;
|
|
435
|
+
if (source.current?.kind === 'context') {
|
|
436
|
+
const element = source.current.element;
|
|
437
|
+
if (!element.isConnected)
|
|
438
|
+
return undefined;
|
|
439
|
+
const rect = element.getBoundingClientRect();
|
|
440
|
+
if (!rect.width || !rect.height || rect.bottom < 0 || rect.top > window.innerHeight)
|
|
441
|
+
return undefined;
|
|
442
|
+
return {
|
|
443
|
+
geometry: contextMenuReturnSeed(rect, panel.current?.getBoundingClientRect()),
|
|
444
|
+
memberCenter: undefined,
|
|
445
|
+
sourceSnapshot: undefined,
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
const triggerSource = menuTriggerSource(anchor.current);
|
|
449
|
+
const glass = toolbarMenuTrigger(triggerSource.glass);
|
|
450
|
+
const snapshot = capture && glass ? snapshotMenuTrigger(glass) : undefined;
|
|
451
|
+
const geometry = menuTriggerReturnGeometry(anchor.current, {
|
|
452
|
+
x: viewport?.offsetLeft ?? 0,
|
|
453
|
+
y: viewport?.offsetTop ?? 0,
|
|
454
|
+
width: viewport?.width ?? (document.documentElement.clientWidth || window.innerWidth),
|
|
455
|
+
height: viewport?.height ?? (document.documentElement.clientHeight || window.innerHeight),
|
|
456
|
+
}, snapshot?.at);
|
|
457
|
+
if (!geometry)
|
|
458
|
+
return undefined;
|
|
459
|
+
const member = triggerSource.member;
|
|
460
|
+
const memberRect = member &&
|
|
461
|
+
(snapshot?.members
|
|
462
|
+
.flatMap(item => [...item.geometry.rects])
|
|
463
|
+
.find(([element]) => element === member)?.[1] ??
|
|
464
|
+
member.getBoundingClientRect());
|
|
465
|
+
return {
|
|
466
|
+
geometry,
|
|
467
|
+
sourceSnapshot: snapshot?.id,
|
|
468
|
+
memberCenter: memberRect?.width
|
|
469
|
+
? { x: memberRect.x + memberRect.width / 2, y: memberRect.y + memberRect.height / 2 }
|
|
470
|
+
: undefined,
|
|
471
|
+
};
|
|
472
|
+
}, []);
|
|
473
|
+
const focusTrigger = () => {
|
|
474
|
+
if (editingSource.current === document.activeElement) {
|
|
475
|
+
editingSource.current = null;
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
editingSource.current = null;
|
|
479
|
+
const target = sourceFocus.current ?? anchor.current?.querySelector('button');
|
|
480
|
+
sourceFocus.current = null;
|
|
481
|
+
if (target?.isConnected && !target.closest('[inert]') && readReturnTarget()) {
|
|
482
|
+
focusFromFramework(target, { preventScroll: true });
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
const close = useCallback(() => {
|
|
486
|
+
if (closingRef.current)
|
|
487
|
+
return;
|
|
488
|
+
setOpen(false);
|
|
489
|
+
if (morphing.current) {
|
|
490
|
+
const target = readReturnTarget(true);
|
|
491
|
+
if (target) {
|
|
492
|
+
setReturnTo(target.geometry);
|
|
493
|
+
setMemberCenter(target.memberCenter);
|
|
494
|
+
setSourceSnapshot(target.sourceSnapshot);
|
|
495
|
+
}
|
|
496
|
+
setFading(!target);
|
|
497
|
+
closingRef.current = true;
|
|
498
|
+
setClosing(true);
|
|
499
|
+
setTransition(value => value + 1);
|
|
500
|
+
refocus.current = true;
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
setEmergeFrom(undefined);
|
|
504
|
+
focusTrigger();
|
|
505
|
+
}
|
|
506
|
+
}, [readReturnTarget]);
|
|
507
|
+
// The panel is torn down when the renderer reports its return morph finished; the timeout only
|
|
508
|
+
// tears it down if that acknowledgement never comes (the morph itself still ran or was not shown).
|
|
509
|
+
const finishClose = useCallback(() => {
|
|
510
|
+
preparingContact.current = false;
|
|
511
|
+
setPreparing(false);
|
|
512
|
+
closingRef.current = false;
|
|
513
|
+
setFading(false);
|
|
514
|
+
setClosing(false);
|
|
515
|
+
setEmergeFrom(undefined);
|
|
516
|
+
}, []);
|
|
517
|
+
// Portals do not inherit their tab/screen visibility. Navigation removes the menu now;
|
|
518
|
+
// a return morph would otherwise chase a trigger in a hidden or departing screen.
|
|
519
|
+
useLayoutEffect(() => {
|
|
520
|
+
if (!ownerUnavailable)
|
|
521
|
+
return;
|
|
522
|
+
refocus.current = false;
|
|
523
|
+
sourceFocus.current = null;
|
|
524
|
+
setOpen(false);
|
|
525
|
+
finishClose();
|
|
526
|
+
}, [ownerUnavailable, finishClose]);
|
|
527
|
+
useLayoutEffect(() => {
|
|
528
|
+
if ((!open && !preparing) || !placed || !panel.current || !liquid?.regions || presented)
|
|
529
|
+
return;
|
|
530
|
+
if (prepared && (isPlainMenuSource(sourceKind) || context)) {
|
|
531
|
+
if (open)
|
|
532
|
+
setPresented(true);
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
setPresented(false);
|
|
536
|
+
return holdPresentationForGlass(context ? topLayer.current : panel.current, null, [], () => liquid.regions.invalidate(), () => {
|
|
537
|
+
// The held plain-value source is transparent. Reveal that prepared canvas before
|
|
538
|
+
// releasing its timeline; a second hidden readiness pass would consume the drop's
|
|
539
|
+
// early frames. A toolbar still waits for its own first visible morph frame.
|
|
540
|
+
if (!prepared && emergeFrom) {
|
|
541
|
+
setPrepared(true);
|
|
542
|
+
if (!isPlainMenuSource(sourceKind) && !context)
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
if (open)
|
|
546
|
+
setPresented(true);
|
|
547
|
+
// A morphing menu's rows are glass ink until the renderer hands them back: focus moves
|
|
548
|
+
// into the live rows then (below), never onto an invisible control.
|
|
549
|
+
if (!emergeFrom)
|
|
550
|
+
focusFirstRow();
|
|
551
|
+
}, () => !closingRef.current, {
|
|
552
|
+
onFailure: () => {
|
|
553
|
+
setOpen(false);
|
|
554
|
+
finishClose();
|
|
555
|
+
focusTrigger();
|
|
556
|
+
},
|
|
557
|
+
});
|
|
558
|
+
}, [open, preparing, placed, prepared, liquid?.regions]);
|
|
559
|
+
const rowsInGlass = !!emergeFrom && !inkDom;
|
|
560
|
+
useLayoutEffect(() => {
|
|
561
|
+
if (open && !closing && emergeFrom && inkDom)
|
|
562
|
+
focusFirstRow();
|
|
563
|
+
}, [open, closing, emergeFrom, inkDom]);
|
|
564
|
+
// No failure may leave the rows invisible: if the renderer never reports the open settled (a
|
|
565
|
+
// lost device, an ink capture error), the live rows appear anyway.
|
|
566
|
+
useEffect(() => {
|
|
567
|
+
if (!open || closing || !presented || !rowsInGlass)
|
|
568
|
+
return;
|
|
569
|
+
const timer = setTimeout(() => setInkDom(true), MENU_INK_FALLBACK_MS);
|
|
570
|
+
return () => clearTimeout(timer);
|
|
571
|
+
}, [open, closing, presented, rowsInGlass]);
|
|
572
|
+
useEffect(() => {
|
|
573
|
+
if (!closing)
|
|
574
|
+
return;
|
|
575
|
+
if (fading) {
|
|
576
|
+
const timer = setTimeout(finishClose, GLASS_MENU_MORPH.close.ms);
|
|
577
|
+
return () => clearTimeout(timer);
|
|
578
|
+
}
|
|
579
|
+
// Bounded teardown: a close the renderer never reports is a glass failure, and says so.
|
|
580
|
+
const deadline = new VisibleDeadline(closeMorphMs + MENU_SETTLE_TIMEOUT_MS, () => {
|
|
581
|
+
const error = Error(`The renderer did not report the menu's close morph within ${closeMorphMs + MENU_SETTLE_TIMEOUT_MS} ms`);
|
|
582
|
+
reportGlassError(glassFailureCode('menu close', error), error, 'menu close');
|
|
583
|
+
finishClose();
|
|
584
|
+
});
|
|
585
|
+
deadline.start();
|
|
586
|
+
return () => deadline.cancel();
|
|
587
|
+
}, [closing, fading, finishClose, closeMorphMs]);
|
|
588
|
+
useLayoutEffect(() => {
|
|
589
|
+
if ((!open && !preparing) || !anchor.current || !panel.current)
|
|
590
|
+
return;
|
|
591
|
+
const updatePlacement = () => {
|
|
592
|
+
if (!anchor.current || !panel.current)
|
|
593
|
+
return;
|
|
594
|
+
const started = traceStageStart();
|
|
595
|
+
// A toolbar group's panel is placed from the group's glass, whichever member opened it.
|
|
596
|
+
const anchorRect = (context ? (liftBox.current ?? contextRestRect.current) : undefined) ??
|
|
597
|
+
((context ? anchor.current : menuTriggerSource(anchor.current).glass) ?? anchor.current).getBoundingClientRect(), panelRect = panel.current.getBoundingClientRect();
|
|
598
|
+
const available = readAvailable(context && liftBox.current !== undefined);
|
|
599
|
+
const firstRow = panel.current
|
|
600
|
+
.querySelector(':is([role="menuitem"], [role="menuitemradio"])')
|
|
601
|
+
?.getBoundingClientRect();
|
|
602
|
+
const next = {
|
|
603
|
+
maxHeight: available.height,
|
|
604
|
+
maxWidth: available.width,
|
|
605
|
+
...menuPanelPlacement(anchorRect, panelRect, firstRow, available, phone, !context
|
|
606
|
+
? 'trigger'
|
|
607
|
+
: !liftBox.current
|
|
608
|
+
? 'context'
|
|
609
|
+
: previewBox.current
|
|
610
|
+
? 'context-preview'
|
|
611
|
+
: 'context-content'),
|
|
612
|
+
};
|
|
613
|
+
setPlaced(true);
|
|
614
|
+
setUpward(!context && phone && menuOpensUpward(anchorRect, panelRect, available));
|
|
615
|
+
setPosition(previous => previous.left === next.left &&
|
|
616
|
+
previous.top === next.top &&
|
|
617
|
+
previous.maxWidth === next.maxWidth &&
|
|
618
|
+
previous.maxHeight === next.maxHeight
|
|
619
|
+
? previous
|
|
620
|
+
: next);
|
|
621
|
+
traceStage('menu-placement', started, () => (context ? 'context' : 'trigger'));
|
|
622
|
+
};
|
|
623
|
+
updatePlacement();
|
|
624
|
+
const observer = new ResizeObserver(updatePlacement);
|
|
625
|
+
observer.observe(panel.current);
|
|
626
|
+
const ink = panel.current.querySelector('[data-satin-menu-ink]');
|
|
627
|
+
if (ink)
|
|
628
|
+
observer.observe(ink);
|
|
629
|
+
if (open && !preparing && placed && !liquid?.regions)
|
|
630
|
+
focusFirstRow();
|
|
631
|
+
return () => observer.disconnect();
|
|
632
|
+
}, [
|
|
633
|
+
actions,
|
|
634
|
+
liquid?.regions,
|
|
635
|
+
phone,
|
|
636
|
+
open,
|
|
637
|
+
preparing,
|
|
638
|
+
placed,
|
|
639
|
+
metrics.insets,
|
|
640
|
+
metrics.layoutViewport.height,
|
|
641
|
+
keyboard.visible,
|
|
642
|
+
keyboard.viewportHeight,
|
|
643
|
+
]);
|
|
644
|
+
// Keep the contact owner alive across React's pointer-up dismissal. WebKit sends its
|
|
645
|
+
// compatibility click afterward; removing this listener on close would activate the tab
|
|
646
|
+
// underneath the menu. A fresh contact still goes through once the menu is closed.
|
|
647
|
+
const openRef = useRef(open);
|
|
648
|
+
openRef.current = open;
|
|
649
|
+
/** Leaves the top submenu, if one is open (Escape closes one level at a time). */
|
|
650
|
+
const submenuBack = useRef(undefined);
|
|
651
|
+
useEffect(() => bindMenuOutside({
|
|
652
|
+
contains: node => node instanceof Node &&
|
|
653
|
+
Boolean(anchor.current?.contains(node) || panel.current?.contains(node)),
|
|
654
|
+
isOpen: () => openRef.current,
|
|
655
|
+
dismiss: close,
|
|
656
|
+
back: () => submenuBack.current?.() ?? false,
|
|
657
|
+
}), [close]);
|
|
658
|
+
useEffect(() => {
|
|
659
|
+
if (!open)
|
|
660
|
+
return;
|
|
661
|
+
const viewport = window.visualViewport;
|
|
662
|
+
const scroll = (event) => {
|
|
663
|
+
if (contact.current.active)
|
|
664
|
+
return;
|
|
665
|
+
// The navigator's native track projects its in-memory stack through scroll offsets.
|
|
666
|
+
// Touch focus can settle that track after opening a menu without scrolling its content.
|
|
667
|
+
// Navigation departure is handled by ownerUnavailable; List pans still dismiss below.
|
|
668
|
+
if (event.target instanceof Element &&
|
|
669
|
+
event.target.matches('[data-satin-native-scrub="true"]'))
|
|
670
|
+
return;
|
|
671
|
+
if (event.target === document ||
|
|
672
|
+
(event.target instanceof Element && anchor.current && event.target.contains(anchor.current)))
|
|
673
|
+
close();
|
|
674
|
+
};
|
|
675
|
+
const initialWidth = viewport?.width ?? window.innerWidth;
|
|
676
|
+
const resized = () => {
|
|
677
|
+
if (Math.abs((viewport?.width ?? window.innerWidth) - initialWidth) > 1)
|
|
678
|
+
close();
|
|
679
|
+
};
|
|
680
|
+
// Keyboard dismissal changes height and offset while the menu opens. Placement follows
|
|
681
|
+
// keyboard geometry; only a width change (rotation/window resize) invalidates this menu.
|
|
682
|
+
viewport?.addEventListener('resize', resized);
|
|
683
|
+
window.addEventListener('resize', resized);
|
|
684
|
+
document.addEventListener('scroll', scroll, true);
|
|
685
|
+
return () => {
|
|
686
|
+
viewport?.removeEventListener('resize', resized);
|
|
687
|
+
window.removeEventListener('resize', resized);
|
|
688
|
+
document.removeEventListener('scroll', scroll, true);
|
|
689
|
+
};
|
|
690
|
+
}, [open, close]);
|
|
691
|
+
const toggle = (next) => {
|
|
692
|
+
if (next) {
|
|
693
|
+
source.current = next;
|
|
694
|
+
anchor.current = next.element;
|
|
695
|
+
}
|
|
696
|
+
if (ownerInactive ||
|
|
697
|
+
navigatorStore?.getState().entries.some(entry => entry.transition.phase !== 'settled'))
|
|
698
|
+
return;
|
|
699
|
+
if (open) {
|
|
700
|
+
close();
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
// Reversal keeps the source pair of the live aperture. A context menu is a new hold, not a
|
|
704
|
+
// reversal: it lifts again (prepareOpening lands the previous lift).
|
|
705
|
+
if (closing && emergeFrom && source.current?.kind !== 'context') {
|
|
706
|
+
setFading(false);
|
|
707
|
+
closingRef.current = false;
|
|
708
|
+
setClosing(false);
|
|
709
|
+
setTransition(value => value + 1);
|
|
710
|
+
setOpen(true);
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
if (!preparingContact.current) {
|
|
714
|
+
prepareOpening();
|
|
715
|
+
held.current = false;
|
|
716
|
+
if (source.current?.kind === 'context')
|
|
717
|
+
recognitionEpoch.current = performance.timeOrigin + performance.now();
|
|
718
|
+
}
|
|
719
|
+
if (source.current?.kind === 'context' && anchor.current) {
|
|
720
|
+
// Keep the measured emergence body attached to the resting row bounds.
|
|
721
|
+
// The animated opaque preview never becomes a glass member.
|
|
722
|
+
setEmergeFrom(contextMenuSeed(contextRestRect.current ?? anchor.current.getBoundingClientRect()));
|
|
723
|
+
}
|
|
724
|
+
preparingContact.current = false;
|
|
725
|
+
setPreparing(false);
|
|
726
|
+
setOpen(true);
|
|
727
|
+
if (source.current?.contact)
|
|
728
|
+
contact.current.transfer(source.current.contact, source.current.element);
|
|
729
|
+
};
|
|
730
|
+
const prepareOpening = (next) => {
|
|
731
|
+
landContextLift();
|
|
732
|
+
refreshSafeAreaMetrics();
|
|
733
|
+
const started = traceStageStart();
|
|
734
|
+
const active = document.activeElement;
|
|
735
|
+
editingSource.current =
|
|
736
|
+
active instanceof HTMLElement && active.matches('input, textarea, [contenteditable="true"]')
|
|
737
|
+
? active
|
|
738
|
+
: null;
|
|
739
|
+
if (next) {
|
|
740
|
+
source.current = next;
|
|
741
|
+
anchor.current = next.element;
|
|
742
|
+
}
|
|
743
|
+
// Selection may present another modal before the close morph finishes. Moving the
|
|
744
|
+
// portal then remounts its glass and loses the renderer's outstanding close identity.
|
|
745
|
+
setPortalHost(anchor.current?.closest('dialog') ?? topModal(document) ?? document.body);
|
|
746
|
+
const isContext = source.current?.kind === 'context';
|
|
747
|
+
const { glass: sourceGlass, member } = isContext
|
|
748
|
+
? { glass: anchor.current ?? undefined, member: anchor.current ?? undefined }
|
|
749
|
+
: menuTriggerSource(anchor.current);
|
|
750
|
+
const glass = isContext ? sourceGlass : (toolbarMenuTrigger(sourceGlass) ?? undefined);
|
|
751
|
+
const snapshot = glass && !isContext ? snapshotMenuTrigger(glass) : undefined;
|
|
752
|
+
setSourceSnapshot(snapshot?.id);
|
|
753
|
+
const aperture = snapshot?.aperture ?? (glass && !isContext ? glassAperture(glass) : undefined);
|
|
754
|
+
const rect = aperture ? DOMRect.fromRect(aperture) : glass?.getBoundingClientRect();
|
|
755
|
+
contextRestRect.current = isContext ? rect : undefined;
|
|
756
|
+
const grown = glass ? glassPressScale(glass) : 1;
|
|
757
|
+
const radius = aperture?.radius ?? (glass ? parseFloat(getComputedStyle(glass).borderTopLeftRadius) || 0 : 0);
|
|
758
|
+
const from = rect &&
|
|
759
|
+
(isContext
|
|
760
|
+
? contextMenuSeed(rect)
|
|
761
|
+
: menuTriggerHasGlass(glass)
|
|
762
|
+
? menuTriggerGeometry(rect, radius, grown)
|
|
763
|
+
: menuLabelTrigger(rect));
|
|
764
|
+
const memberRect = member &&
|
|
765
|
+
(snapshot?.members
|
|
766
|
+
.flatMap(item => [...item.geometry.rects])
|
|
767
|
+
.find(([element]) => element === member)?.[1] ??
|
|
768
|
+
member.getBoundingClientRect());
|
|
769
|
+
setSourceKind(isContext
|
|
770
|
+
? 'context'
|
|
771
|
+
: menuTriggerHasGlass(glass) || !rect
|
|
772
|
+
? undefined
|
|
773
|
+
: plainMenuSourceKind(rect));
|
|
774
|
+
setSourceRegionId(isContext ? undefined : (toolbarMaterialOwner(glass) ?? glass)?.dataset.satinGlassRegionId);
|
|
775
|
+
setEmergeFrom(morphs && from?.width ? from : undefined);
|
|
776
|
+
setReturnTo(morphs && rect?.width
|
|
777
|
+
? isContext
|
|
778
|
+
? contextMenuSeed(rect)
|
|
779
|
+
: menuTriggerHasGlass(glass)
|
|
780
|
+
? menuTriggerGeometry(rect, radius)
|
|
781
|
+
: menuLabelTrigger(rect)
|
|
782
|
+
: undefined);
|
|
783
|
+
setMemberCenter(memberRect?.width
|
|
784
|
+
? { x: memberRect.x + memberRect.width / 2, y: memberRect.y + memberRect.height / 2 }
|
|
785
|
+
: undefined);
|
|
786
|
+
setPlaced(false);
|
|
787
|
+
setPrepared(false);
|
|
788
|
+
setPresented(false);
|
|
789
|
+
setInkDom(false);
|
|
790
|
+
closingRef.current = false;
|
|
791
|
+
setFading(false);
|
|
792
|
+
setClosing(false);
|
|
793
|
+
setTransition(value => value + 1);
|
|
794
|
+
traceStage('menu-preparation', started, () => (isContext ? 'context' : 'trigger'));
|
|
795
|
+
};
|
|
796
|
+
const emerged = (!!emergeFrom || fading) && shown && presented;
|
|
797
|
+
// A toolbar group's one glass platter is the menu while it is open: the whole group hides
|
|
798
|
+
// (its glass and every member's symbol), not only this menu's button.
|
|
799
|
+
useLayoutEffect(() => {
|
|
800
|
+
const source = menuTriggerSource(anchor.current);
|
|
801
|
+
const glass = toolbarMenuTrigger(source.glass) ?? undefined;
|
|
802
|
+
const member = source.member;
|
|
803
|
+
if (context || !emerged || !glass)
|
|
804
|
+
return;
|
|
805
|
+
const restore = menuTriggerContents(anchor.current).map(glass => {
|
|
806
|
+
const previousInert = glass.getAttribute('inert');
|
|
807
|
+
const previousEmerged = glass.getAttribute('data-satin-menu-emerged');
|
|
808
|
+
const active = document.activeElement;
|
|
809
|
+
if (active instanceof HTMLElement && glass.contains(active)) {
|
|
810
|
+
sourceFocus.current = active;
|
|
811
|
+
active.blur();
|
|
812
|
+
}
|
|
813
|
+
const trigger = member && glass.contains(member) ? member : glass;
|
|
814
|
+
const previousReturning = trigger.getAttribute('data-satin-menu-returning');
|
|
815
|
+
const siblings = new Map();
|
|
816
|
+
if (!closing || (member && !glass.contains(member)))
|
|
817
|
+
glass.setAttribute('inert', '');
|
|
818
|
+
else {
|
|
819
|
+
// Inert cannot be overridden by a descendant. Lock each branch beside the
|
|
820
|
+
// trigger, up to its platter, so only the trigger can reverse the close.
|
|
821
|
+
for (let branch = trigger; branch !== glass && branch.parentElement; branch = branch.parentElement) {
|
|
822
|
+
for (const sibling of branch.parentElement.children) {
|
|
823
|
+
if (sibling === branch)
|
|
824
|
+
continue;
|
|
825
|
+
siblings.set(sibling, sibling.getAttribute('inert'));
|
|
826
|
+
sibling.setAttribute('inert', '');
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
trigger.dataset.satinMenuReturning = 'true';
|
|
830
|
+
}
|
|
831
|
+
glass.dataset.satinMenuEmerged = 'true';
|
|
832
|
+
return () => {
|
|
833
|
+
for (const [sibling, previous] of siblings) {
|
|
834
|
+
if (previous === null)
|
|
835
|
+
sibling.removeAttribute('inert');
|
|
836
|
+
else
|
|
837
|
+
sibling.setAttribute('inert', previous);
|
|
838
|
+
}
|
|
839
|
+
if (previousReturning === null)
|
|
840
|
+
delete trigger.dataset.satinMenuReturning;
|
|
841
|
+
else
|
|
842
|
+
trigger.setAttribute('data-satin-menu-returning', previousReturning);
|
|
843
|
+
if (previousInert === null)
|
|
844
|
+
glass.removeAttribute('inert');
|
|
845
|
+
else
|
|
846
|
+
glass.setAttribute('inert', previousInert);
|
|
847
|
+
if (previousEmerged === null)
|
|
848
|
+
delete glass.dataset.satinMenuEmerged;
|
|
849
|
+
else
|
|
850
|
+
glass.setAttribute('data-satin-menu-emerged', previousEmerged);
|
|
851
|
+
};
|
|
852
|
+
});
|
|
853
|
+
return () => {
|
|
854
|
+
for (const restoreContent of restore)
|
|
855
|
+
restoreContent();
|
|
856
|
+
};
|
|
857
|
+
}, [emerged, closing]);
|
|
858
|
+
// A plain glyph comes back while its drop dissolves into it, on native's clock from the close
|
|
859
|
+
// rather than on the renderer's settle report: it fades in from +240 ms and is whole by
|
|
860
|
+
// +400 ms (styles.css satin-menu-glyph-return). The fade outlives the close, so it is
|
|
861
|
+
// cleared on its own timer, or at once when the menu reopens.
|
|
862
|
+
useLayoutEffect(() => {
|
|
863
|
+
if (!closing || fading || sourceKind !== 'glyph')
|
|
864
|
+
return;
|
|
865
|
+
const contents = menuTriggerContents(anchor.current);
|
|
866
|
+
const clear = () => {
|
|
867
|
+
for (const element of contents)
|
|
868
|
+
delete element.dataset.satinMenuGlyphReturn;
|
|
869
|
+
};
|
|
870
|
+
for (const element of contents)
|
|
871
|
+
element.dataset.satinMenuGlyphReturn = 'true';
|
|
872
|
+
const timer = setTimeout(clear, MENU_GLYPH_RETURN_MS);
|
|
873
|
+
glyphReturn.current = () => {
|
|
874
|
+
clearTimeout(timer);
|
|
875
|
+
clear();
|
|
876
|
+
};
|
|
877
|
+
}, [closing, fading, sourceKind]);
|
|
878
|
+
useLayoutEffect(() => {
|
|
879
|
+
if (open)
|
|
880
|
+
glyphReturn.current?.();
|
|
881
|
+
}, [open]);
|
|
882
|
+
useEffect(() => () => glyphReturn.current?.(), []);
|
|
883
|
+
useLayoutEffect(() => {
|
|
884
|
+
if (open || closing || !refocus.current)
|
|
885
|
+
return;
|
|
886
|
+
refocus.current = false;
|
|
887
|
+
focusTrigger();
|
|
888
|
+
}, [open, closing]);
|
|
889
|
+
useLayoutEffect(() => {
|
|
890
|
+
if (!closing || fading)
|
|
891
|
+
return;
|
|
892
|
+
let frame = 0;
|
|
893
|
+
const trackTarget = () => {
|
|
894
|
+
const target = readReturnTarget();
|
|
895
|
+
if (!target) {
|
|
896
|
+
setFading(true);
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
const geometry = target.geometry;
|
|
900
|
+
setMemberCenter(previous => previous?.x === target.memberCenter?.x && previous?.y === target.memberCenter?.y
|
|
901
|
+
? previous
|
|
902
|
+
: target.memberCenter);
|
|
903
|
+
setReturnTo(previous => previous &&
|
|
904
|
+
previous.x === geometry.x &&
|
|
905
|
+
previous.y === geometry.y &&
|
|
906
|
+
previous.width === geometry.width &&
|
|
907
|
+
previous.height === geometry.height &&
|
|
908
|
+
previous.radius === geometry.radius
|
|
909
|
+
? previous
|
|
910
|
+
: geometry);
|
|
911
|
+
frame = requestAnimationFrame(trackTarget);
|
|
912
|
+
};
|
|
913
|
+
frame = requestAnimationFrame(trackTarget);
|
|
914
|
+
return () => cancelAnimationFrame(frame);
|
|
915
|
+
}, [closing, fading, readReturnTarget]);
|
|
916
|
+
const presentation = shown
|
|
917
|
+
? createPortal(_jsxs(ToolbarMaterialPortal, { children: [context && (_jsx("div", { ref: dimLayer, popover: "manual", "data-satin-menu-top-layer": "true", children: !preparing && presented && _jsx("div", { "data-satin-context-backdrop": "true" }) })), _jsxs("div", { ref: topLayer, popover: "manual", "data-satin-menu-top-layer": "true", "data-satin-context-backdrop-active": context || undefined, children: [context && preview !== undefined && (_jsx("div", { ref: previewBox, "data-satin-context-preview": "true", "aria-hidden": "true", style: { borderRadius: MENU_CORNER_RADIUS[phone ? 'phone' : 'pad'] }, children: preview })), _jsx(GlassLayer, { attachment: "fixed", depth: 1000, style: {
|
|
918
|
+
left: position.left,
|
|
919
|
+
top: position.top,
|
|
920
|
+
pointerEvents: closing || preparing || !placed ? 'none' : 'auto',
|
|
921
|
+
visibility: placed && !preparing && (!morphs || presented) ? undefined : 'hidden',
|
|
922
|
+
}, children: _jsx("div", { ref: panel, inert: closing || preparing || undefined, "data-satin-menu-panel": "true", "data-satin-menu-fading": fading || undefined, style: fading ? { animationDuration: `${GLASS_MENU_MORPH.close.ms}ms` } : undefined, "data-satin-menu-phase": emergeFrom ? (closing ? 'closing' : presented ? 'open' : 'pending') : undefined, "data-satin-menu-rows": emergeFrom
|
|
923
|
+
? inkDom || liquid?.backend === 'fallback'
|
|
924
|
+
? 'dom'
|
|
925
|
+
: 'glass'
|
|
926
|
+
: undefined, onKeyDown: event => {
|
|
927
|
+
if (event.key === 'Tab')
|
|
928
|
+
close();
|
|
929
|
+
}, children: _jsx(MenuStack, { actions: (upward ? nearestFirst(actions) : actions).map(menuAction), select: action => {
|
|
930
|
+
close();
|
|
931
|
+
action.onPress?.();
|
|
932
|
+
}, idiom: phone ? 'phone' : 'pad', closing: closing, cornerRadius: MENU_CORNER_RADIUS[phone ? 'phone' : 'pad'], readBounds: () => readAvailable(), backRef: submenuBack, children: rootRows => (_jsx(Surface, { touchLight: true, role: "menu", id: id, "aria-label": typeof label === 'string' ? label : 'Actions', shape: {
|
|
933
|
+
kind: 'roundedRectangle',
|
|
934
|
+
cornerRadius: MENU_CORNER_RADIUS[phone ? 'phone' : 'pad'],
|
|
935
|
+
}, emerge: emergeFrom && {
|
|
936
|
+
from: emergeFrom,
|
|
937
|
+
returnTo,
|
|
938
|
+
sourceRegionId,
|
|
939
|
+
sourceSnapshot,
|
|
940
|
+
sourceKind,
|
|
941
|
+
recognitionEpoch: context ? recognitionEpoch.current : undefined,
|
|
942
|
+
content: contentMenu || undefined,
|
|
943
|
+
anchor: memberCenter,
|
|
944
|
+
closing,
|
|
945
|
+
fading,
|
|
946
|
+
generation: transition,
|
|
947
|
+
ready: (prepared && open) || closing,
|
|
948
|
+
inkDom,
|
|
949
|
+
idiom: phone ? 'phone' : 'pad',
|
|
950
|
+
}, onEmergeSettled: finishClose, onEmergeInk: phase => setInkDom(phase === 'open-settled'), "data-satin-general-menu": "true", "data-satin-keep-keyboard": "true", "data-satin-menu-idiom": phone ? 'phone' : 'pad', style: { maxWidth: position.maxWidth }, children: _jsx("div", { "data-satin-menu-scroll": "true", style: { maxHeight: position.maxHeight - (phone ? 20 : 14) }, children: _jsx("div", { "data-satin-menu-ink": "true", inert: rowsInGlass || undefined, children: rootRows }) }) })) }) }) })] })] }), portalHost ?? document.body)
|
|
951
|
+
: null;
|
|
952
|
+
return {
|
|
953
|
+
id,
|
|
954
|
+
open,
|
|
955
|
+
presentation,
|
|
956
|
+
close,
|
|
957
|
+
ownsContact: () => contact.current.active,
|
|
958
|
+
prepare(next, pointerId, contactEpoch = performance.timeOrigin + performance.now()) {
|
|
959
|
+
if (ownerInactive ||
|
|
960
|
+
open ||
|
|
961
|
+
// A held trigger waits out its close morph; a context hold during a dismissal is a new lift.
|
|
962
|
+
(closing && next.kind !== 'context') ||
|
|
963
|
+
navigatorStore?.getState().entries.some(entry => entry.transition.phase !== 'settled'))
|
|
964
|
+
return;
|
|
965
|
+
prepareOpening(next);
|
|
966
|
+
recognitionEpoch.current =
|
|
967
|
+
next.kind === 'context' ? contactEpoch + CONTEXT_CURVE_MS : undefined;
|
|
968
|
+
preparingContact.current = true;
|
|
969
|
+
preparingPointerId.current = pointerId;
|
|
970
|
+
setPreparing(true);
|
|
971
|
+
},
|
|
972
|
+
show: toggle,
|
|
973
|
+
cancelPreparation(pointerId) {
|
|
974
|
+
if (pointerId !== undefined && pointerId !== preparingPointerId.current)
|
|
975
|
+
return;
|
|
976
|
+
if (!preparingContact.current)
|
|
977
|
+
return;
|
|
978
|
+
preparingContact.current = false;
|
|
979
|
+
setPreparing(false);
|
|
980
|
+
setEmergeFrom(undefined);
|
|
981
|
+
},
|
|
982
|
+
};
|
|
983
|
+
}
|