@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,79 @@
|
|
|
1
|
+
/** WAAPI has no animationstart event. Announce framework-owned motion so glass inside
|
|
2
|
+
* the animated element can follow its compositor geometry without an idle frame loop. */
|
|
3
|
+
const listeners = new WeakMap();
|
|
4
|
+
const layoutAnimations = new WeakMap();
|
|
5
|
+
export function hasLayoutAnimation(scope) {
|
|
6
|
+
const animations = layoutAnimations.get(scope);
|
|
7
|
+
if (!animations)
|
|
8
|
+
return false;
|
|
9
|
+
for (const animation of animations) {
|
|
10
|
+
if (animation.playState === 'running')
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
export function observeAnimations(element, listener) {
|
|
16
|
+
let callbacks = listeners.get(element);
|
|
17
|
+
if (!callbacks) {
|
|
18
|
+
callbacks = new Set();
|
|
19
|
+
listeners.set(element, callbacks);
|
|
20
|
+
}
|
|
21
|
+
callbacks.add(listener);
|
|
22
|
+
return () => {
|
|
23
|
+
if (!callbacks.delete(listener))
|
|
24
|
+
return;
|
|
25
|
+
if (!callbacks.size)
|
|
26
|
+
listeners.delete(element);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function announceAnimation(element) {
|
|
30
|
+
for (const listener of listeners.get(element) ?? [])
|
|
31
|
+
listener();
|
|
32
|
+
}
|
|
33
|
+
export function animateElement(element, frames, options) {
|
|
34
|
+
const animation = element.animate(frames, options);
|
|
35
|
+
announceAnimation(element);
|
|
36
|
+
return animation;
|
|
37
|
+
}
|
|
38
|
+
/** Height/width motion can move siblings, so notify the containing layout scope. */
|
|
39
|
+
export function animateLayout(element, frames, options) {
|
|
40
|
+
const scope = element.parentElement ?? element;
|
|
41
|
+
const animation = element.animate(frames, options);
|
|
42
|
+
let animations = layoutAnimations.get(scope);
|
|
43
|
+
if (!animations) {
|
|
44
|
+
animations = new Set();
|
|
45
|
+
layoutAnimations.set(scope, animations);
|
|
46
|
+
}
|
|
47
|
+
animations.add(animation);
|
|
48
|
+
const complete = () => {
|
|
49
|
+
animations.delete(animation);
|
|
50
|
+
if (!animations.size)
|
|
51
|
+
layoutAnimations.delete(scope);
|
|
52
|
+
announceAnimation(scope);
|
|
53
|
+
};
|
|
54
|
+
animation.finished?.then(complete, complete);
|
|
55
|
+
announceAnimation(scope);
|
|
56
|
+
return animation;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The document timeline's time minus the performance clock's, in milliseconds. Both start at
|
|
60
|
+
* the document's time origin; the timeline holds the current frame's time, so the two normally
|
|
61
|
+
* differ by less than a frame.
|
|
62
|
+
*/
|
|
63
|
+
export function timelineOffset() {
|
|
64
|
+
const timeline = Number(document.timeline?.currentTime ?? Number.NaN);
|
|
65
|
+
return Number.isFinite(timeline) ? timeline - performance.now() : 0;
|
|
66
|
+
}
|
|
67
|
+
/** More than any frame can explain: the timeline is not on the performance clock. */
|
|
68
|
+
const TIMELINE_DRIFT_MS = 1000;
|
|
69
|
+
/**
|
|
70
|
+
* `at` (performance clock) as a start time on the document timeline, for animations whose
|
|
71
|
+
* renderer track uses the same `at`. It is `at` itself unless the clocks have come apart by more
|
|
72
|
+
* than a frame. A timeline held back across a suspension would otherwise keep every later run
|
|
73
|
+
* in its before phase (`fill: 'both'` shows the first keyframe), so the run would never finish.
|
|
74
|
+
* That drift has not been measured on a device. The resume readout reports `timelineOffset`.
|
|
75
|
+
*/
|
|
76
|
+
export function timelineStart(at) {
|
|
77
|
+
const offset = timelineOffset();
|
|
78
|
+
return Math.abs(offset) > TIMELINE_DRIFT_MS ? at + offset : at;
|
|
79
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MenuSpring } from '../glass/lens/menuSpring.js';
|
|
2
|
+
declare const brand: unique symbol;
|
|
3
|
+
/** An opaque spring timing value for `withAnimation`. Use a named value or `Animation.spring`. */
|
|
4
|
+
export type Animation = Readonly<{
|
|
5
|
+
[brand]: true;
|
|
6
|
+
}>;
|
|
7
|
+
/** Duration and bounce options for `Animation.spring`. */
|
|
8
|
+
export type SpringOptions = Readonly<{
|
|
9
|
+
/** The perceptual duration in milliseconds. Defaults to 500. */
|
|
10
|
+
durationMs?: number;
|
|
11
|
+
/** 0 settles without overshoot. Values are clamped to 0 through 0.99. Defaults to 0. */
|
|
12
|
+
bounce?: number;
|
|
13
|
+
}>;
|
|
14
|
+
/** SwiftUI's named springs. `default` is the curve `withAnimation` uses with no argument. */
|
|
15
|
+
export declare const Animation: Readonly<{
|
|
16
|
+
spring: (options?: SpringOptions) => Animation;
|
|
17
|
+
smooth: Animation;
|
|
18
|
+
snappy: Animation;
|
|
19
|
+
bouncy: Animation;
|
|
20
|
+
default: Animation;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const DEFAULT_ANIMATION_DURATION_MS = 500;
|
|
23
|
+
/** The spring with a unit displacement and the given initial velocity (units per second). */
|
|
24
|
+
export declare function unitSpring(animation: Animation, velocity: number): MenuSpring;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const brand = Symbol('satin.animation');
|
|
2
|
+
/**
|
|
3
|
+
* SwiftUI's `spring(duration:bounce:)` mapping, as Apple documents it: the duration is the
|
|
4
|
+
* period of the undamped spring (omega = 2π / duration), and bounce is 1 − damping ratio for
|
|
5
|
+
* bounce ≥ 0. SwiftUI's negative (over-damped) bounces are not offered: the shared spring
|
|
6
|
+
* solver (glass/lens/menuSpring.ts) models damping ratios up to 1.
|
|
7
|
+
*/
|
|
8
|
+
function spring({ durationMs = 500, bounce = 0 } = {}) {
|
|
9
|
+
if (!Number.isFinite(durationMs) || !Number.isFinite(bounce)) {
|
|
10
|
+
throw new RangeError('Animation.spring requires finite durationMs and bounce values.');
|
|
11
|
+
}
|
|
12
|
+
const seconds = Math.max(durationMs, 1) / 1000;
|
|
13
|
+
const omega = (2 * Math.PI) / seconds;
|
|
14
|
+
const zeta = 1 - Math.min(Math.max(bounce, 0), 0.99);
|
|
15
|
+
const animation = Object.freeze({ [brand]: true, omega, zeta });
|
|
16
|
+
return animation;
|
|
17
|
+
}
|
|
18
|
+
/** SwiftUI's named springs. `default` is the curve `withAnimation` uses with no argument. */
|
|
19
|
+
export const Animation = Object.freeze({
|
|
20
|
+
spring,
|
|
21
|
+
/** SwiftUI `.smooth`: duration 0.5 s, bounce 0. */
|
|
22
|
+
smooth: spring({ durationMs: 500, bounce: 0 }),
|
|
23
|
+
/** SwiftUI `.snappy`: duration 0.5 s, bounce 0.15. */
|
|
24
|
+
snappy: spring({ durationMs: 500, bounce: 0.15 }),
|
|
25
|
+
/** SwiftUI `.bouncy`: duration 0.5 s, bounce 0.3. */
|
|
26
|
+
bouncy: spring({ durationMs: 500, bounce: 0.3 }),
|
|
27
|
+
/** SwiftUI `.default`. The value is the measured fit recorded in the measured reference
|
|
28
|
+
* (matchedGeometryEffect, October 11); see DEFAULT_ANIMATION_DURATION_MS. */
|
|
29
|
+
get default() {
|
|
30
|
+
return defaultAnimation;
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
/* The perceptual duration of SwiftUI's `.default` animation on iOS 27, which is a critically
|
|
34
|
+
* damped spring. Source: the stock SwiftUI matchedGeometryEffect fixture recorded by the
|
|
35
|
+
* matched-geometry implementation (the measured reference, October 11). */
|
|
36
|
+
export const DEFAULT_ANIMATION_DURATION_MS = 500;
|
|
37
|
+
const defaultAnimation = spring({ durationMs: DEFAULT_ANIMATION_DURATION_MS, bounce: 0 });
|
|
38
|
+
/** The spring with a unit displacement and the given initial velocity (units per second). */
|
|
39
|
+
export function unitSpring(animation, velocity) {
|
|
40
|
+
const { omega, zeta } = animation;
|
|
41
|
+
return { delay: 0, omega, zeta, velocity };
|
|
42
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { menuSpring, menuSpringSettle } from '../glass/lens/menuSpring.js';
|
|
2
|
+
export function allowsComposerMotion(element) {
|
|
3
|
+
return (typeof element.animate === 'function' &&
|
|
4
|
+
!element.ownerDocument.defaultView?.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
5
|
+
}
|
|
6
|
+
// iOS 27 Messages three-line send, native older-text frames 24..70, Oct 15.
|
|
7
|
+
// The thread rises 46 pt without the outgoing bubble's shape spring. Critically
|
|
8
|
+
// damped fit: omega 21.2; RMS .357 pt, maximum .915 pt across 47 original samples.
|
|
9
|
+
// Native VFR footage remains diagnostic calibration, not cadence qualification.
|
|
10
|
+
const insertionSpring = { delay: 0, omega: 21.2, zeta: 1, velocity: 0 };
|
|
11
|
+
export const INSERTION_DURATION_MS = menuSpringSettle(insertionSpring);
|
|
12
|
+
const insertionSteps = Math.ceil(INSERTION_DURATION_MS / (1000 / 60));
|
|
13
|
+
export const insertionProgress = Array.from({ length: insertionSteps + 1 }, (_, index) => index === insertionSteps
|
|
14
|
+
? 1
|
|
15
|
+
: 1 - menuSpring(insertionSpring, (index / insertionSteps) * INSERTION_DURATION_MS).value);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Animation } from './animationValue.js';
|
|
2
|
+
/** Layout owners capture before React commits and animate after every owner has committed. */
|
|
3
|
+
type Capture = () => (animation: Animation | null) => void;
|
|
4
|
+
export declare function registerLayoutAnimation(capture: Capture): () => void;
|
|
5
|
+
export declare function isLayoutTransaction(): boolean;
|
|
6
|
+
export declare function commitAnimatedLayout(animation: Animation, update: () => void): void;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const captures = new Set();
|
|
2
|
+
let depth = 0;
|
|
3
|
+
export function registerLayoutAnimation(capture) {
|
|
4
|
+
captures.add(capture);
|
|
5
|
+
return () => {
|
|
6
|
+
captures.delete(capture);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export function isLayoutTransaction() {
|
|
10
|
+
return depth > 0;
|
|
11
|
+
}
|
|
12
|
+
export function commitAnimatedLayout(animation, update) {
|
|
13
|
+
// An inner withAnimation joins the outer synchronous commit.
|
|
14
|
+
if (depth)
|
|
15
|
+
return update();
|
|
16
|
+
const completions = [...captures].map(capture => capture());
|
|
17
|
+
depth++;
|
|
18
|
+
let committed = false;
|
|
19
|
+
try {
|
|
20
|
+
update();
|
|
21
|
+
committed = true;
|
|
22
|
+
}
|
|
23
|
+
finally {
|
|
24
|
+
depth--;
|
|
25
|
+
for (const complete of completions)
|
|
26
|
+
complete(committed ? animation : null);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { Animation } from './animationValue.js';
|
|
3
|
+
declare const namespaceBrand: unique symbol;
|
|
4
|
+
/** `Namespace.ID`: the scope `MatchedGeometryEffect` ids are matched within. */
|
|
5
|
+
export type NamespaceID = Readonly<{
|
|
6
|
+
[namespaceBrand]: true;
|
|
7
|
+
}>;
|
|
8
|
+
/** `@Namespace`: a stable id scope for `MatchedGeometryEffect`, one per component. */
|
|
9
|
+
export declare function useNamespace(): NamespaceID;
|
|
10
|
+
/**
|
|
11
|
+
* A namespace declared once at module scope, for views that share no parent component: a
|
|
12
|
+
* `MatchedTransitionSource` in one route and the screen it zooms into in another. Inside one
|
|
13
|
+
* component, use `useNamespace()`.
|
|
14
|
+
* @example
|
|
15
|
+
* export const albumZoom = defineNamespace()
|
|
16
|
+
* @experimental Shared by the zoom navigation transition.
|
|
17
|
+
*/
|
|
18
|
+
export declare function defineNamespace(): NamespaceID;
|
|
19
|
+
/** Props of `MatchedGeometryEffect`. */
|
|
20
|
+
export type MatchedGeometryEffectProps = Readonly<{
|
|
21
|
+
/** Views with the same id in the same namespace are one view in two places. */
|
|
22
|
+
id: string;
|
|
23
|
+
in: NamespaceID;
|
|
24
|
+
/** Whether this view provides the frame its partners start from. Defaults to true. */
|
|
25
|
+
isSource?: boolean;
|
|
26
|
+
/** One element. Its first element is the view that moves. */
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* SwiftUI `matchedGeometryEffect(id:in:isSource:)`: when a `withAnimation` change removes this
|
|
31
|
+
* view and inserts another with the same id, the new one moves from the old one's frame to its
|
|
32
|
+
* own while the two cross-fade. A view that only moves or resizes
|
|
33
|
+
* animates from where it was. A matched view with no partner fades in or out.
|
|
34
|
+
*
|
|
35
|
+
* Wrap one element that has no transform of its own. Changes made outside `withAnimation`
|
|
36
|
+
* apply at once, as in SwiftUI.
|
|
37
|
+
* @example
|
|
38
|
+
* const art = useNamespace()
|
|
39
|
+
* <MatchedGeometryEffect id="artwork" in={art}><Image src={cover} alt="" /></MatchedGeometryEffect>
|
|
40
|
+
* @experimental Frame matching only (SwiftUI's default `properties: .frame`, `anchor: .center`).
|
|
41
|
+
* A non-source view does not follow its source outside an animation.
|
|
42
|
+
*/
|
|
43
|
+
export declare function MatchedGeometryEffect({ id, in: namespace, isSource, children, }: MatchedGeometryEffectProps): import("react").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* `withAnimation` applies the state changes in `update`, then animates the
|
|
46
|
+
* `MatchedGeometryEffect` views they move, insert or remove. Call it from an event handler.
|
|
47
|
+
* Keyed List rows also move to their new positions. Other views take their new layout at once.
|
|
48
|
+
* Returns the callback result and propagates errors. Only synchronous updates participate.
|
|
49
|
+
* Nested calls share the outer List transaction; per-update nested timing is not supported.
|
|
50
|
+
* @example
|
|
51
|
+
* <Button onPress={() => withAnimation(() => setShowQueue(!showQueue))}>Playing Next</Button>
|
|
52
|
+
*/
|
|
53
|
+
export declare function withAnimation<Result>(update: () => Result): Result;
|
|
54
|
+
export declare function withAnimation<Result>(animation: Animation, update: () => Result): Result;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
+
import { flushSync } from 'react-dom';
|
|
4
|
+
import { animateElement } from './animate.js';
|
|
5
|
+
import { Animation } from './animationValue.js';
|
|
6
|
+
import { commitAnimatedLayout } from './layoutTransaction.js';
|
|
7
|
+
import { fadeSettleMs, runFrameTimes, sampleChannel, sampleProgress, } from './springPath.js';
|
|
8
|
+
/*
|
|
9
|
+
* matchedGeometryEffect and withAnimation, the FLIP way:
|
|
10
|
+
*
|
|
11
|
+
* 1. Before the state change, read each matched view's presented frame (running motion
|
|
12
|
+
* included) and, for a view already moving, its velocity from the run's own spring.
|
|
13
|
+
* 2. Commit the change synchronously (flushSync), so layout is final in the same task.
|
|
14
|
+
* 3. Cancel the old runs, read each view's new layout frame once, and start one WAAPI run per
|
|
15
|
+
* element: transform and opacity only, sampled at 60 Hz from the spring, so WebKit's
|
|
16
|
+
* compositor plays it with no per-frame work in the document.
|
|
17
|
+
*
|
|
18
|
+
* A view whose id leaves and enters in the same change keeps its identity: the new view starts
|
|
19
|
+
* from the old one's frame and fades in, and the old view stays on screen as a "ghost" (its own
|
|
20
|
+
* detached DOM node, already decoded) that travels with it and fades out. That cross-fade is
|
|
21
|
+
* SwiftUI's: a stock iOS 27 fixture shows both views on one frame, with opacities that sum to 1
|
|
22
|
+
* on the animation's own spring (the measured reference, October 11).
|
|
23
|
+
*/
|
|
24
|
+
const namespaceBrand = Symbol('satin.namespace');
|
|
25
|
+
const entries = new Set();
|
|
26
|
+
/** `@Namespace`: a stable id scope for `MatchedGeometryEffect`, one per component. */
|
|
27
|
+
export function useNamespace() {
|
|
28
|
+
const [namespace] = useState(defineNamespace);
|
|
29
|
+
return namespace;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A namespace declared once at module scope, for views that share no parent component: a
|
|
33
|
+
* `MatchedTransitionSource` in one route and the screen it zooms into in another. Inside one
|
|
34
|
+
* component, use `useNamespace()`.
|
|
35
|
+
* @example
|
|
36
|
+
* export const albumZoom = defineNamespace()
|
|
37
|
+
* @experimental Shared by the zoom navigation transition.
|
|
38
|
+
*/
|
|
39
|
+
export function defineNamespace() {
|
|
40
|
+
return Object.freeze({ [namespaceBrand]: true });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* SwiftUI `matchedGeometryEffect(id:in:isSource:)`: when a `withAnimation` change removes this
|
|
44
|
+
* view and inserts another with the same id, the new one moves from the old one's frame to its
|
|
45
|
+
* own while the two cross-fade. A view that only moves or resizes
|
|
46
|
+
* animates from where it was. A matched view with no partner fades in or out.
|
|
47
|
+
*
|
|
48
|
+
* Wrap one element that has no transform of its own. Changes made outside `withAnimation`
|
|
49
|
+
* apply at once, as in SwiftUI.
|
|
50
|
+
* @example
|
|
51
|
+
* const art = useNamespace()
|
|
52
|
+
* <MatchedGeometryEffect id="artwork" in={art}><Image src={cover} alt="" /></MatchedGeometryEffect>
|
|
53
|
+
* @experimental Frame matching only (SwiftUI's default `properties: .frame`, `anchor: .center`).
|
|
54
|
+
* A non-source view does not follow its source outside an animation.
|
|
55
|
+
*/
|
|
56
|
+
export function MatchedGeometryEffect({ id, in: namespace, isSource = true, children, }) {
|
|
57
|
+
const wrapper = useRef(null);
|
|
58
|
+
useLayoutEffect(() => {
|
|
59
|
+
const entry = { namespace, id, isSource, wrapper: wrapper.current };
|
|
60
|
+
entries.add(entry);
|
|
61
|
+
return () => {
|
|
62
|
+
entries.delete(entry);
|
|
63
|
+
};
|
|
64
|
+
}, [namespace, id, isSource]);
|
|
65
|
+
// display: contents keeps the wrapped element in its parent's flex or grid layout.
|
|
66
|
+
return (_jsx("div", { ref: wrapper, "data-satin-matched-geometry": id, style: { display: 'contents' }, children: children }));
|
|
67
|
+
}
|
|
68
|
+
export function withAnimation(first, second) {
|
|
69
|
+
const animation = typeof first === 'function' ? Animation.default : first;
|
|
70
|
+
const update = typeof first === 'function' ? first : second;
|
|
71
|
+
const before = snapshotMatchedViews();
|
|
72
|
+
let result;
|
|
73
|
+
commitAnimatedLayout(animation, () => {
|
|
74
|
+
result = flushSync(update);
|
|
75
|
+
animateTransaction(animation, before);
|
|
76
|
+
});
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
const RECT_KEYS = ['x', 'y', 'width', 'height'];
|
|
80
|
+
const runs = new Map();
|
|
81
|
+
function runKey(namespace, id) {
|
|
82
|
+
return `${namespaceKeys.get(namespace) ?? registerNamespace(namespace)}\u0000${id}`;
|
|
83
|
+
}
|
|
84
|
+
const namespaceKeys = new WeakMap();
|
|
85
|
+
let nextNamespace = 0;
|
|
86
|
+
function registerNamespace(namespace) {
|
|
87
|
+
nextNamespace++;
|
|
88
|
+
namespaceKeys.set(namespace, nextNamespace);
|
|
89
|
+
return nextNamespace;
|
|
90
|
+
}
|
|
91
|
+
function viewOf(entry) {
|
|
92
|
+
const element = entry.wrapper.firstElementChild;
|
|
93
|
+
return element instanceof HTMLElement ? element : undefined;
|
|
94
|
+
}
|
|
95
|
+
function snapshotMatchedViews() {
|
|
96
|
+
const presented = [];
|
|
97
|
+
for (const entry of entries) {
|
|
98
|
+
const element = viewOf(entry);
|
|
99
|
+
if (!element)
|
|
100
|
+
continue;
|
|
101
|
+
presented.push(present(element, runKey(entry.namespace, entry.id), entry.isSource));
|
|
102
|
+
}
|
|
103
|
+
// Ghosts still travelling from an earlier change are retargeted like any other view.
|
|
104
|
+
// A ghost whose screen has since been removed has nothing left to animate.
|
|
105
|
+
for (const run of runs.values()) {
|
|
106
|
+
if (run.ghost && run.element.isConnected)
|
|
107
|
+
presented.push(present(run.element, run.key, false));
|
|
108
|
+
}
|
|
109
|
+
return presented;
|
|
110
|
+
}
|
|
111
|
+
function present(element, key, isSource) {
|
|
112
|
+
const bounds = element.getBoundingClientRect();
|
|
113
|
+
const style = getComputedStyle(element);
|
|
114
|
+
return {
|
|
115
|
+
key,
|
|
116
|
+
element,
|
|
117
|
+
isSource,
|
|
118
|
+
rect: { x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height },
|
|
119
|
+
velocity: runVelocity(element),
|
|
120
|
+
opacity: opacityOf(style),
|
|
121
|
+
ancestors: ancestorsOf(element),
|
|
122
|
+
// What a ghost needs to look the same once it leaves the rules that styled it in place.
|
|
123
|
+
look: {
|
|
124
|
+
borderRadius: style.borderRadius,
|
|
125
|
+
objectFit: style.objectFit,
|
|
126
|
+
objectPosition: style.objectPosition,
|
|
127
|
+
backgroundColor: style.backgroundColor,
|
|
128
|
+
boxShadow: style.boxShadow,
|
|
129
|
+
overflow: style.overflow,
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function opacityOf(style) {
|
|
134
|
+
const opacity = Number.parseFloat(style.opacity);
|
|
135
|
+
return Number.isFinite(opacity) ? opacity : 1;
|
|
136
|
+
}
|
|
137
|
+
function ancestorsOf(element) {
|
|
138
|
+
const ancestors = [];
|
|
139
|
+
for (let node = element.parentElement; node; node = node.parentElement)
|
|
140
|
+
ancestors.push(node);
|
|
141
|
+
return ancestors;
|
|
142
|
+
}
|
|
143
|
+
/** The frame velocity (points per second) of a running run, from its own spring. */
|
|
144
|
+
function runVelocity(element) {
|
|
145
|
+
const run = runs.get(element);
|
|
146
|
+
if (!run)
|
|
147
|
+
return { x: 0, y: 0, width: 0, height: 0 };
|
|
148
|
+
const elapsed = Number(run.motion.currentTime ?? 0);
|
|
149
|
+
const velocity = (key) => sampleChannel(run.animation, run.channels[key], elapsed).velocity;
|
|
150
|
+
return {
|
|
151
|
+
x: velocity('x'),
|
|
152
|
+
y: velocity('y'),
|
|
153
|
+
width: velocity('width'),
|
|
154
|
+
height: velocity('height'),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/* ------------------------------------------------------------------ the transaction */
|
|
158
|
+
function animateTransaction(animation, before) {
|
|
159
|
+
// Stop the old runs first: the new layout frames must be read without their transforms.
|
|
160
|
+
const oldGhosts = stopAllRuns();
|
|
161
|
+
const after = new Map();
|
|
162
|
+
const sourceAfter = new Map();
|
|
163
|
+
for (const entry of entries) {
|
|
164
|
+
const element = viewOf(entry);
|
|
165
|
+
if (!element)
|
|
166
|
+
continue;
|
|
167
|
+
const key = runKey(entry.namespace, entry.id);
|
|
168
|
+
after.set(key, [...(after.get(key) ?? []), element]);
|
|
169
|
+
if (entry.isSource || !sourceAfter.has(key))
|
|
170
|
+
sourceAfter.set(key, element);
|
|
171
|
+
}
|
|
172
|
+
const sourceBefore = new Map();
|
|
173
|
+
for (const view of before) {
|
|
174
|
+
if (view.isSource || !sourceBefore.has(view.key))
|
|
175
|
+
sourceBefore.set(view.key, view);
|
|
176
|
+
}
|
|
177
|
+
const layout = new Map();
|
|
178
|
+
for (const elements of after.values()) {
|
|
179
|
+
for (const element of elements)
|
|
180
|
+
layout.set(element, layoutRect(element));
|
|
181
|
+
}
|
|
182
|
+
for (const [key, elements] of after) {
|
|
183
|
+
for (const element of elements) {
|
|
184
|
+
const previous = before.find(view => view.element === element);
|
|
185
|
+
const partner = previous ?? sourceBefore.get(key);
|
|
186
|
+
const box = layout.get(element);
|
|
187
|
+
if (partner)
|
|
188
|
+
moveView(element, key, partner, box, animation);
|
|
189
|
+
else
|
|
190
|
+
fadeView(element, key, box, animation, { from: 0, to: 1 });
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
for (const view of before) {
|
|
194
|
+
if (view.element.isConnected && !oldGhosts.has(view.element))
|
|
195
|
+
continue;
|
|
196
|
+
const target = sourceAfter.get(view.key);
|
|
197
|
+
const targetRect = target ? layout.get(target) : view.rect;
|
|
198
|
+
leaveView(view, targetRect, animation, oldGhosts.has(view.element));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function stopAllRuns() {
|
|
202
|
+
const ghosts = new Set();
|
|
203
|
+
for (const run of runs.values()) {
|
|
204
|
+
run.motion.cancel();
|
|
205
|
+
if (run.ghost && run.element.isConnected)
|
|
206
|
+
ghosts.add(run.element);
|
|
207
|
+
else if (run.ghost)
|
|
208
|
+
run.element.remove();
|
|
209
|
+
}
|
|
210
|
+
runs.clear();
|
|
211
|
+
return ghosts;
|
|
212
|
+
}
|
|
213
|
+
function layoutRect(element) {
|
|
214
|
+
const bounds = element.getBoundingClientRect();
|
|
215
|
+
return { x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height };
|
|
216
|
+
}
|
|
217
|
+
/** A view that stays, or the partner of one that left, moves from where it was shown. */
|
|
218
|
+
function moveView(element, key, from, box, animation) {
|
|
219
|
+
const stayed = from.element === element;
|
|
220
|
+
startRun({
|
|
221
|
+
element,
|
|
222
|
+
key,
|
|
223
|
+
box,
|
|
224
|
+
...ownTransformOf(element, box),
|
|
225
|
+
start: from.rect,
|
|
226
|
+
target: box,
|
|
227
|
+
velocity: from.velocity,
|
|
228
|
+
animation,
|
|
229
|
+
// A new partner fades in (SwiftUI's default .opacity insertion); a view that stays carries
|
|
230
|
+
// on from the opacity it is showing.
|
|
231
|
+
opacity: { from: stayed ? from.opacity : 0, to: 1 },
|
|
232
|
+
ghost: false,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
/** SwiftUI's default `.opacity` transition for a matched view with no partner. */
|
|
236
|
+
function fadeView(element, key, box, animation, opacity) {
|
|
237
|
+
startRun({
|
|
238
|
+
element,
|
|
239
|
+
key,
|
|
240
|
+
box,
|
|
241
|
+
...ownTransformOf(element, box),
|
|
242
|
+
start: box,
|
|
243
|
+
target: box,
|
|
244
|
+
velocity: { x: 0, y: 0, width: 0, height: 0 },
|
|
245
|
+
animation,
|
|
246
|
+
opacity,
|
|
247
|
+
ghost: false,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
/** A removed view stays on screen as a ghost, travels to its partner's frame and fades out. */
|
|
251
|
+
function leaveView(view, target, animation, wasGhost) {
|
|
252
|
+
const ghost = view.element;
|
|
253
|
+
const box = wasGhost ? layoutRect(ghost) : placeGhost(view);
|
|
254
|
+
if (!box)
|
|
255
|
+
return;
|
|
256
|
+
startRun({
|
|
257
|
+
element: ghost,
|
|
258
|
+
key: view.key,
|
|
259
|
+
box,
|
|
260
|
+
// placeGhost sets the ghost's origin to its top left and clears its own transform.
|
|
261
|
+
pivot: { x: box.x, y: box.y },
|
|
262
|
+
ownTransform: '',
|
|
263
|
+
start: view.rect,
|
|
264
|
+
target,
|
|
265
|
+
velocity: view.velocity,
|
|
266
|
+
animation,
|
|
267
|
+
opacity: { from: view.opacity, to: 0 },
|
|
268
|
+
ghost: true,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
/** Ghosts are placed `position: fixed` at their old frame; their transform does the rest. */
|
|
272
|
+
function placeGhost(view) {
|
|
273
|
+
const host = view.ancestors.find(ancestor => ancestor.isConnected);
|
|
274
|
+
if (!host)
|
|
275
|
+
return undefined;
|
|
276
|
+
const ghost = view.element;
|
|
277
|
+
ghost.setAttribute('aria-hidden', 'true');
|
|
278
|
+
ghost.inert = true;
|
|
279
|
+
Object.assign(ghost.style, view.look, {
|
|
280
|
+
position: 'fixed',
|
|
281
|
+
left: '0px',
|
|
282
|
+
top: '0px',
|
|
283
|
+
margin: '0px',
|
|
284
|
+
boxSizing: 'border-box',
|
|
285
|
+
width: `${view.rect.width}px`,
|
|
286
|
+
height: `${view.rect.height}px`,
|
|
287
|
+
pointerEvents: 'none',
|
|
288
|
+
transform: 'none',
|
|
289
|
+
transformOrigin: '0 0',
|
|
290
|
+
});
|
|
291
|
+
host.append(ghost);
|
|
292
|
+
// A transformed or contained ancestor becomes the fixed containing block: correct for it.
|
|
293
|
+
const placed = ghost.getBoundingClientRect();
|
|
294
|
+
ghost.style.left = `${view.rect.x - placed.x}px`;
|
|
295
|
+
ghost.style.top = `${view.rect.y - placed.y}px`;
|
|
296
|
+
return view.rect;
|
|
297
|
+
}
|
|
298
|
+
function startRun(request) {
|
|
299
|
+
const { element, box, target, animation, opacity } = request;
|
|
300
|
+
if (!(box.width > 0 && box.height > 0)) {
|
|
301
|
+
if (request.ghost)
|
|
302
|
+
element.remove();
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const channels = {
|
|
306
|
+
x: { displacement: request.start.x - target.x, velocity: request.velocity.x },
|
|
307
|
+
y: { displacement: request.start.y - target.y, velocity: request.velocity.y },
|
|
308
|
+
width: { displacement: request.start.width - target.width, velocity: request.velocity.width },
|
|
309
|
+
height: {
|
|
310
|
+
displacement: request.start.height - target.height,
|
|
311
|
+
velocity: request.velocity.height,
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
const fades = opacity.from !== opacity.to;
|
|
315
|
+
const times = runFrameTimes(animation, Object.values(channels), fades ? fadeSettleMs(animation) : 0);
|
|
316
|
+
const moves = Object.values(channels).some(channel => channel.displacement !== 0 || channel.velocity !== 0);
|
|
317
|
+
if (!moves && !fades) {
|
|
318
|
+
if (request.ghost)
|
|
319
|
+
element.remove();
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
const lastTime = times[times.length - 1];
|
|
323
|
+
const keyframes = times.map((ms, index) => {
|
|
324
|
+
const frame = { offset: index / (times.length - 1) };
|
|
325
|
+
const done = index === times.length - 1;
|
|
326
|
+
if (moves)
|
|
327
|
+
frame.transform = transformAt(request, channels, done ? undefined : ms);
|
|
328
|
+
if (fades) {
|
|
329
|
+
const progress = done ? 1 : Math.min(Math.max(sampleProgress(animation, ms), 0), 1);
|
|
330
|
+
frame.opacity = opacity.from + (opacity.to - opacity.from) * progress;
|
|
331
|
+
}
|
|
332
|
+
return frame;
|
|
333
|
+
});
|
|
334
|
+
const motion = animateElement(element, keyframes, {
|
|
335
|
+
duration: lastTime,
|
|
336
|
+
easing: 'linear',
|
|
337
|
+
fill: request.ghost ? 'forwards' : 'none',
|
|
338
|
+
});
|
|
339
|
+
const run = {
|
|
340
|
+
element,
|
|
341
|
+
key: request.key,
|
|
342
|
+
box,
|
|
343
|
+
target,
|
|
344
|
+
channels,
|
|
345
|
+
animation,
|
|
346
|
+
opacity,
|
|
347
|
+
motion,
|
|
348
|
+
ghost: request.ghost,
|
|
349
|
+
};
|
|
350
|
+
runs.set(element, run);
|
|
351
|
+
motion.finished.then(() => finishRun(run), () => { });
|
|
352
|
+
}
|
|
353
|
+
function finishRun(run) {
|
|
354
|
+
if (runs.get(run.element) !== run)
|
|
355
|
+
return;
|
|
356
|
+
runs.delete(run.element);
|
|
357
|
+
if (run.ghost)
|
|
358
|
+
run.element.remove();
|
|
359
|
+
}
|
|
360
|
+
/** The transform at `ms` into the run, or at rest when `ms` is undefined. */
|
|
361
|
+
function transformAt(request, channels, ms) {
|
|
362
|
+
const value = (key) => request.target[key] +
|
|
363
|
+
(ms === undefined ? 0 : sampleChannel(request.animation, channels[key], ms).offset);
|
|
364
|
+
const frame = {
|
|
365
|
+
x: value('x'),
|
|
366
|
+
y: value('y'),
|
|
367
|
+
width: Math.max(value('width'), 0),
|
|
368
|
+
height: Math.max(value('height'), 0),
|
|
369
|
+
};
|
|
370
|
+
return frameTransform(request.box, frame, request.pivot, request.ownTransform);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* The transform that draws an element resting at `box` at `frame` instead. It goes in front of
|
|
374
|
+
* the element's own transform and scales about the element's own origin (`pivot`), so an app's
|
|
375
|
+
* transform (Apple Music's paused artwork is scaled down) keeps working during and after the run.
|
|
376
|
+
*/
|
|
377
|
+
function frameTransform(box, frame, pivot, ownTransform) {
|
|
378
|
+
const scaleX = frame.width / box.width;
|
|
379
|
+
const scaleY = frame.height / box.height;
|
|
380
|
+
const translateX = frame.x - pivot.x - scaleX * (box.x - pivot.x);
|
|
381
|
+
const translateY = frame.y - pivot.y - scaleY * (box.y - pivot.y);
|
|
382
|
+
const own = ownTransform ? ` ${ownTransform}` : '';
|
|
383
|
+
return `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})${own}`;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Where the element's transform origin sits in the viewport, and its own transform. Own
|
|
387
|
+
* transforms are expected to be translations and scales, as rotation has no frame to match.
|
|
388
|
+
*/
|
|
389
|
+
function ownTransformOf(element, rendered) {
|
|
390
|
+
const style = getComputedStyle(element);
|
|
391
|
+
const own = style.transform && style.transform !== 'none' ? style.transform : '';
|
|
392
|
+
const matrix = own ? new DOMMatrix(own) : new DOMMatrix();
|
|
393
|
+
const [originX, originY] = originOf(style.transformOrigin, element);
|
|
394
|
+
// rendered.x = layoutX + originX + a·(0 − originX) + e, so the origin sits at:
|
|
395
|
+
const pivot = {
|
|
396
|
+
x: rendered.x + matrix.a * originX - matrix.e,
|
|
397
|
+
y: rendered.y + matrix.d * originY - matrix.f,
|
|
398
|
+
};
|
|
399
|
+
return { pivot, ownTransform: own };
|
|
400
|
+
}
|
|
401
|
+
/** The computed transform-origin in points from the element's top left. */
|
|
402
|
+
function originOf(value, element) {
|
|
403
|
+
const [x, y] = value.split(' ');
|
|
404
|
+
const length = (part, size) => {
|
|
405
|
+
if (part?.endsWith('px'))
|
|
406
|
+
return Number.parseFloat(part);
|
|
407
|
+
if (part?.endsWith('%'))
|
|
408
|
+
return (Number.parseFloat(part) / 100) * size;
|
|
409
|
+
return size / 2;
|
|
410
|
+
};
|
|
411
|
+
return [length(x, element.offsetWidth), length(y, element.offsetHeight)];
|
|
412
|
+
}
|