@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.
Files changed (1154) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +96 -0
  3. package/README.md +454 -2
  4. package/THIRD_PARTY_NOTICES.md +65 -0
  5. package/bin/satin.mjs +13 -0
  6. package/dist/acknowledgements/Acknowledgements.d.ts +4 -0
  7. package/dist/acknowledgements/Acknowledgements.js +42 -0
  8. package/dist/acknowledgements/bundledNotices.d.ts +4 -0
  9. package/dist/acknowledgements/bundledNotices.js +58 -0
  10. package/dist/acknowledgements/inventory.d.ts +17 -0
  11. package/dist/acknowledgements/inventory.js +10 -0
  12. package/dist/acknowledgements/inventory.json +39 -0
  13. package/dist/actions/ActionMenu.d.ts +30 -0
  14. package/dist/actions/ActionMenu.js +103 -0
  15. package/dist/actions/RowActions.d.ts +42 -0
  16. package/dist/actions/RowActions.js +820 -0
  17. package/dist/actions/contextMotion.d.ts +78 -0
  18. package/dist/actions/contextMotion.js +329 -0
  19. package/dist/actions/motion.d.ts +19 -0
  20. package/dist/actions/motion.js +74 -0
  21. package/dist/actions/nativeContextAppearance.json +86 -0
  22. package/dist/actions/nativeContextMotion.json +734 -0
  23. package/dist/actions/nativeMotion.json +388 -0
  24. package/dist/actions/preview.d.ts +27 -0
  25. package/dist/actions/preview.js +217 -0
  26. package/dist/actions/recognizers.d.ts +24 -0
  27. package/dist/actions/recognizers.js +87 -0
  28. package/dist/actions/rowScrub.d.ts +59 -0
  29. package/dist/actions/rowScrub.js +400 -0
  30. package/dist/actions/swipeSpring.d.ts +14 -0
  31. package/dist/actions/swipeSpring.js +35 -0
  32. package/dist/actions/types.d.ts +71 -0
  33. package/dist/actions/types.js +28 -0
  34. package/dist/app/InstallComponents.d.ts +16 -0
  35. package/dist/app/InstallComponents.js +104 -0
  36. package/dist/app/InstallationDiagnostics.d.ts +7 -0
  37. package/dist/app/InstallationDiagnostics.js +23 -0
  38. package/dist/app/OrientationGuard.d.ts +8 -0
  39. package/dist/app/OrientationGuard.js +9 -0
  40. package/dist/app/appearance.d.ts +18 -0
  41. package/dist/app/appearance.js +15 -0
  42. package/dist/app/appearanceStore.d.ts +30 -0
  43. package/dist/app/appearanceStore.js +228 -0
  44. package/dist/app/backgroundUpdate.d.ts +20 -0
  45. package/dist/app/backgroundUpdate.js +151 -0
  46. package/dist/app/buildInfo.d.ts +11 -0
  47. package/dist/app/buildInfo.js +12 -0
  48. package/dist/app/buildInfoBuild.d.ts +3 -0
  49. package/dist/app/buildInfoBuild.js +12 -0
  50. package/dist/app/checkCli.d.ts +1 -0
  51. package/dist/app/checkCli.js +73 -0
  52. package/dist/app/coldLaunchUpdate.d.ts +14 -0
  53. package/dist/app/coldLaunchUpdate.js +384 -0
  54. package/dist/app/definition.d.ts +85 -0
  55. package/dist/app/definition.js +347 -0
  56. package/dist/app/deployment.d.ts +28 -0
  57. package/dist/app/deployment.js +352 -0
  58. package/dist/app/deploymentBuild.d.ts +3 -0
  59. package/dist/app/deploymentBuild.js +55 -0
  60. package/dist/app/earlyWorker.d.ts +3 -0
  61. package/dist/app/earlyWorker.js +77 -0
  62. package/dist/app/head.d.ts +10 -0
  63. package/dist/app/head.js +120 -0
  64. package/dist/app/icons.d.ts +4 -0
  65. package/dist/app/icons.js +35 -0
  66. package/dist/app/install.d.ts +18 -0
  67. package/dist/app/install.js +82 -0
  68. package/dist/app/installCheck.d.ts +2 -0
  69. package/dist/app/installCheck.js +148 -0
  70. package/dist/app/installContext.d.ts +35 -0
  71. package/dist/app/installContext.js +45 -0
  72. package/dist/app/installCustom.d.ts +25 -0
  73. package/dist/app/installCustom.js +55 -0
  74. package/dist/app/installExperience.d.ts +22 -0
  75. package/dist/app/installExperience.js +389 -0
  76. package/dist/app/installExperienceDevice.d.ts +29 -0
  77. package/dist/app/installExperienceDevice.js +160 -0
  78. package/dist/app/installExperienceHome.d.ts +16 -0
  79. package/dist/app/installExperienceHome.js +304 -0
  80. package/dist/app/installExperienceRuntime.d.ts +37 -0
  81. package/dist/app/installExperienceRuntime.js +285 -0
  82. package/dist/app/installPolicy.d.ts +28 -0
  83. package/dist/app/installPolicy.js +90 -0
  84. package/dist/app/installQr.d.ts +10 -0
  85. package/dist/app/installQr.js +139 -0
  86. package/dist/app/installStrings.d.ts +52 -0
  87. package/dist/app/installStrings.js +75 -0
  88. package/dist/app/installTipPath.d.ts +12 -0
  89. package/dist/app/installTipPath.js +9 -0
  90. package/dist/app/installationFailure.d.ts +14 -0
  91. package/dist/app/installationFailure.js +38 -0
  92. package/dist/app/launch.d.ts +7 -0
  93. package/dist/app/launch.js +241 -0
  94. package/dist/app/launchReadiness.d.ts +9 -0
  95. package/dist/app/launchReadiness.js +72 -0
  96. package/dist/app/launchScreen.d.ts +16 -0
  97. package/dist/app/launchScreen.js +14 -0
  98. package/dist/app/launchScreenRuntime.d.ts +19 -0
  99. package/dist/app/launchScreenRuntime.js +313 -0
  100. package/dist/app/launchWatchdog.d.ts +1 -0
  101. package/dist/app/launchWatchdog.js +202 -0
  102. package/dist/app/manifests.d.ts +19 -0
  103. package/dist/app/manifests.js +20 -0
  104. package/dist/app/mdm.d.ts +3 -0
  105. package/dist/app/mdm.js +20 -0
  106. package/dist/app/mediaCheck.d.ts +9 -0
  107. package/dist/app/mediaCheck.js +122 -0
  108. package/dist/app/mediaTypes.d.ts +2 -0
  109. package/dist/app/mediaTypes.js +13 -0
  110. package/dist/app/platformPolicy.d.ts +3 -0
  111. package/dist/app/platformPolicy.js +10 -0
  112. package/dist/app/platformScripts.d.ts +6 -0
  113. package/dist/app/platformScripts.js +65 -0
  114. package/dist/app/releaseUpdates.d.ts +7 -0
  115. package/dist/app/releaseUpdates.js +53 -0
  116. package/dist/app/runtime.d.ts +9 -0
  117. package/dist/app/runtime.js +38 -0
  118. package/dist/app/startup.d.ts +30 -0
  119. package/dist/app/startup.js +24 -0
  120. package/dist/app/statusBand.d.ts +11 -0
  121. package/dist/app/statusBand.js +257 -0
  122. package/dist/app/viewport.d.ts +3 -0
  123. package/dist/app/viewport.js +42 -0
  124. package/dist/app/viewportValue.d.ts +5 -0
  125. package/dist/app/viewportValue.js +14 -0
  126. package/dist/app/vite.d.ts +27 -0
  127. package/dist/app/vite.js +440 -0
  128. package/dist/app/warmImage.d.ts +3 -0
  129. package/dist/app/warmImage.js +59 -0
  130. package/dist/content/content.d.ts +153 -0
  131. package/dist/content/content.js +315 -0
  132. package/dist/content/layout.d.ts +26 -0
  133. package/dist/content/layout.js +114 -0
  134. package/dist/content/scaledMetric.d.ts +3 -0
  135. package/dist/content/scaledMetric.js +68 -0
  136. package/dist/content/typography.d.ts +83 -0
  137. package/dist/content/typography.js +32 -0
  138. package/dist/controls/ActivityIndicatorSegments.d.ts +4 -0
  139. package/dist/controls/ActivityIndicatorSegments.js +5 -0
  140. package/dist/controls/ColorPicker.d.ts +20 -0
  141. package/dist/controls/ColorPicker.js +70 -0
  142. package/dist/controls/ControlRow.d.ts +5 -0
  143. package/dist/controls/ControlRow.js +10 -0
  144. package/dist/controls/DatePicker.d.ts +41 -0
  145. package/dist/controls/DatePicker.js +148 -0
  146. package/dist/controls/ProgressView.d.ts +17 -0
  147. package/dist/controls/ProgressView.js +24 -0
  148. package/dist/controls/civilDate.d.ts +49 -0
  149. package/dist/controls/civilDate.js +112 -0
  150. package/dist/data/database.d.ts +154 -0
  151. package/dist/data/database.js +710 -0
  152. package/dist/data/value-equal.d.ts +2 -0
  153. package/dist/data/value-equal.js +36 -0
  154. package/dist/data/write-store.d.ts +38 -0
  155. package/dist/data/write-store.js +192 -0
  156. package/dist/dev-menu/DevMenu.d.ts +1 -0
  157. package/dist/dev-menu/DevMenu.js +121 -0
  158. package/dist/dev-menu/actions.d.ts +12 -0
  159. package/dist/dev-menu/actions.js +99 -0
  160. package/dist/dev-menu/build.d.ts +5 -0
  161. package/dist/dev-menu/build.js +40 -0
  162. package/dist/dev-menu/gesture.d.ts +18 -0
  163. package/dist/dev-menu/gesture.js +109 -0
  164. package/dist/dev-menu/shake.d.ts +2 -0
  165. package/dist/dev-menu/shake.js +36 -0
  166. package/dist/dev-menu/types.d.ts +8 -0
  167. package/dist/dev-menu/types.js +1 -0
  168. package/dist/diagnostics.d.ts +3 -0
  169. package/dist/diagnostics.js +4 -0
  170. package/dist/docs/app-recipes.md +411 -0
  171. package/dist/docs/components/file-importer.md +54 -0
  172. package/dist/docs/components/paste-button.md +48 -0
  173. package/dist/docs/components/photos-picker.md +53 -0
  174. package/dist/docs/components/share-link.md +58 -0
  175. package/dist/docs/content.md +159 -0
  176. package/dist/docs/controls.md +151 -0
  177. package/dist/docs/data.md +332 -0
  178. package/dist/docs/limitations.md +40 -0
  179. package/dist/docs/messaging-scroll.md +234 -0
  180. package/dist/docs/networking.md +190 -0
  181. package/dist/docs/push.md +215 -0
  182. package/dist/docs/swiftui-reference.md +1895 -0
  183. package/dist/docs/symbols.md +293 -0
  184. package/dist/docs/tokens.md +60 -0
  185. package/dist/fidelity/devAssertions.d.ts +21 -0
  186. package/dist/fidelity/devAssertions.js +199 -0
  187. package/dist/focus/focusIntentMachine.d.ts +106 -0
  188. package/dist/focus/focusIntentMachine.js +359 -0
  189. package/dist/focus/navigationFocus.d.ts +42 -0
  190. package/dist/focus/navigationFocus.js +241 -0
  191. package/dist/focus/programmaticFocus.d.ts +15 -0
  192. package/dist/focus/programmaticFocus.js +152 -0
  193. package/dist/gestures/GestureView.d.ts +12 -0
  194. package/dist/gestures/GestureView.js +321 -0
  195. package/dist/gestures/arena.d.ts +138 -0
  196. package/dist/gestures/arena.js +417 -0
  197. package/dist/gestures/existingCompetitors.d.ts +79 -0
  198. package/dist/gestures/existingCompetitors.js +82 -0
  199. package/dist/gestures/gesture.d.ts +62 -0
  200. package/dist/gestures/gesture.js +107 -0
  201. package/dist/glass/ControlLens.d.ts +46 -0
  202. package/dist/glass/ControlLens.js +88 -0
  203. package/dist/glass/GlassBar.d.ts +9 -0
  204. package/dist/glass/GlassBar.js +22 -0
  205. package/dist/glass/GlassConfusionReview.d.ts +3 -0
  206. package/dist/glass/GlassConfusionReview.js +185 -0
  207. package/dist/glass/GlassEffect.d.ts +69 -0
  208. package/dist/glass/GlassEffect.js +550 -0
  209. package/dist/glass/GlassMaterialRoot.d.ts +7 -0
  210. package/dist/glass/GlassMaterialRoot.js +39 -0
  211. package/dist/glass/GlassPresentation.d.ts +28 -0
  212. package/dist/glass/GlassPresentation.js +1038 -0
  213. package/dist/glass/GlassProbeIcons.d.ts +8 -0
  214. package/dist/glass/GlassProbeIcons.js +12 -0
  215. package/dist/glass/GlassProbeOverlay.d.ts +52 -0
  216. package/dist/glass/GlassProbeOverlay.js +45 -0
  217. package/dist/glass/GlassTextField.d.ts +22 -0
  218. package/dist/glass/GlassTextField.js +12 -0
  219. package/dist/glass/MaterialEffectRoot.d.ts +9 -0
  220. package/dist/glass/MaterialEffectRoot.js +189 -0
  221. package/dist/glass/Menu.d.ts +3 -0
  222. package/dist/glass/Menu.js +35 -0
  223. package/dist/glass/MenuStack.d.ts +23 -0
  224. package/dist/glass/MenuStack.js +371 -0
  225. package/dist/glass/MenuSymbol.d.ts +7 -0
  226. package/dist/glass/MenuSymbol.js +16 -0
  227. package/dist/glass/MorphEllipsisArtwork.d.ts +2 -0
  228. package/dist/glass/MorphEllipsisArtwork.js +6 -0
  229. package/dist/glass/TabBar.d.ts +29 -0
  230. package/dist/glass/TabBar.js +169 -0
  231. package/dist/glass/capability.d.ts +25 -0
  232. package/dist/glass/capability.js +63 -0
  233. package/dist/glass/captureWindow.d.ts +60 -0
  234. package/dist/glass/captureWindow.js +119 -0
  235. package/dist/glass/confusionSession.d.ts +41 -0
  236. package/dist/glass/confusionSession.js +44 -0
  237. package/dist/glass/contactPhysics.d.ts +130 -0
  238. package/dist/glass/contactPhysics.js +214 -0
  239. package/dist/glass/context.d.ts +37 -0
  240. package/dist/glass/context.js +11 -0
  241. package/dist/glass/errorAlert.d.ts +6 -0
  242. package/dist/glass/errorAlert.js +57 -0
  243. package/dist/glass/errors.d.ts +22 -0
  244. package/dist/glass/errors.js +78 -0
  245. package/dist/glass/failurePolicy.d.ts +4 -0
  246. package/dist/glass/failurePolicy.js +20 -0
  247. package/dist/glass/fallback/material.d.ts +16 -0
  248. package/dist/glass/fallback/material.js +87 -0
  249. package/dist/glass/fallback/regions.d.ts +16 -0
  250. package/dist/glass/fallback/regions.js +249 -0
  251. package/dist/glass/fallback/runtime.d.ts +72 -0
  252. package/dist/glass/fallback/runtime.js +278 -0
  253. package/dist/glass/fallback/selection.d.ts +2 -0
  254. package/dist/glass/fallback/selection.js +9 -0
  255. package/dist/glass/fieldGeometry.d.ts +28 -0
  256. package/dist/glass/fieldGeometry.js +64 -0
  257. package/dist/glass/fieldMotion.d.ts +42 -0
  258. package/dist/glass/fieldMotion.js +47 -0
  259. package/dist/glass/glassContact.d.ts +76 -0
  260. package/dist/glass/glassContact.js +153 -0
  261. package/dist/glass/glassProbeSettings.d.ts +18 -0
  262. package/dist/glass/glassProbeSettings.js +133 -0
  263. package/dist/glass/lens/Scene.d.ts +108 -0
  264. package/dist/glass/lens/Scene.js +553 -0
  265. package/dist/glass/lens/backgrounds.json +103 -0
  266. package/dist/glass/lens/bitmapBackdrop.d.ts +14 -0
  267. package/dist/glass/lens/bitmapBackdrop.js +35 -0
  268. package/dist/glass/lens/controlLift.d.ts +94 -0
  269. package/dist/glass/lens/controlLift.js +78 -0
  270. package/dist/glass/lens/data.d.ts +19 -0
  271. package/dist/glass/lens/data.js +161 -0
  272. package/dist/glass/lens/drawableTop.d.ts +16 -0
  273. package/dist/glass/lens/drawableTop.js +15 -0
  274. package/dist/glass/lens/icons.d.ts +9 -0
  275. package/dist/glass/lens/icons.js +34 -0
  276. package/dist/glass/lens/interactiveContact.d.ts +33 -0
  277. package/dist/glass/lens/interactiveContact.js +158 -0
  278. package/dist/glass/lens/interactivePress.d.ts +95 -0
  279. package/dist/glass/lens/interactivePress.js +169 -0
  280. package/dist/glass/lens/ios27GlyphFit.json +126 -0
  281. package/dist/glass/lens/lensLightingSamples.json +1 -0
  282. package/dist/glass/lens/lensPress.d.ts +22 -0
  283. package/dist/glass/lens/lensPress.js +68 -0
  284. package/dist/glass/lens/lensPressSamples.json +1 -0
  285. package/dist/glass/lens/liquidMotion.d.ts +50 -0
  286. package/dist/glass/lens/liquidMotion.js +239 -0
  287. package/dist/glass/lens/materialGlassRecipes.json +776 -0
  288. package/dist/glass/lens/materialUniforms.d.ts +22 -0
  289. package/dist/glass/lens/materialUniforms.js +117 -0
  290. package/dist/glass/lens/menu-closing-close-fit.json +380 -0
  291. package/dist/glass/lens/menu-opening-native-fits.json +911 -0
  292. package/dist/glass/lens/menuContextFit.json +88 -0
  293. package/dist/glass/lens/menuContextOpacity.json +98 -0
  294. package/dist/glass/lens/menuContextPresentation.d.ts +15 -0
  295. package/dist/glass/lens/menuContextPresentation.js +65 -0
  296. package/dist/glass/lens/menuCornerFit.json +252 -0
  297. package/dist/glass/lens/menuCornerMotion.d.ts +9 -0
  298. package/dist/glass/lens/menuCornerMotion.js +5 -0
  299. package/dist/glass/lens/menuDropFit.json +64 -0
  300. package/dist/glass/lens/menuField.d.ts +178 -0
  301. package/dist/glass/lens/menuField.js +564 -0
  302. package/dist/glass/lens/menuGesturePresentation.d.ts +12 -0
  303. package/dist/glass/lens/menuGesturePresentation.js +42 -0
  304. package/dist/glass/lens/menuGlyphDropFit.json +38 -0
  305. package/dist/glass/lens/menuMorphFit.json +564 -0
  306. package/dist/glass/lens/menuMorphMotion.d.ts +70 -0
  307. package/dist/glass/lens/menuMorphMotion.js +219 -0
  308. package/dist/glass/lens/menuMorphPhoneFit.json +85 -0
  309. package/dist/glass/lens/menuMotion.d.ts +81 -0
  310. package/dist/glass/lens/menuMotion.js +323 -0
  311. package/dist/glass/lens/menuPlacement.d.ts +5 -0
  312. package/dist/glass/lens/menuPlacement.js +29 -0
  313. package/dist/glass/lens/menuSpring.d.ts +18 -0
  314. package/dist/glass/lens/menuSpring.js +29 -0
  315. package/dist/glass/lens/menuTouchLight.d.ts +13 -0
  316. package/dist/glass/lens/menuTouchLight.js +147 -0
  317. package/dist/glass/lens/mirrorConstants.d.ts +1 -0
  318. package/dist/glass/lens/mirrorConstants.js +2 -0
  319. package/dist/glass/lens/mirrorExtents.d.ts +52 -0
  320. package/dist/glass/lens/mirrorExtents.js +264 -0
  321. package/dist/glass/lens/mirrorInvalidation.d.ts +6 -0
  322. package/dist/glass/lens/mirrorInvalidation.js +10 -0
  323. package/dist/glass/lens/mirrorReuse.d.ts +20 -0
  324. package/dist/glass/lens/mirrorReuse.js +166 -0
  325. package/dist/glass/lens/motion.d.ts +62 -0
  326. package/dist/glass/lens/motion.js +93 -0
  327. package/dist/glass/lens/recordedMotion.d.ts +6 -0
  328. package/dist/glass/lens/recordedMotion.js +44 -0
  329. package/dist/glass/lens/referenceBackground.d.ts +9 -0
  330. package/dist/glass/lens/referenceBackground.js +151 -0
  331. package/dist/glass/lens/referenceProfiles.d.ts +21 -0
  332. package/dist/glass/lens/referenceProfiles.js +33 -0
  333. package/dist/glass/lens/referenceRegularTint.d.ts +12 -0
  334. package/dist/glass/lens/referenceRegularTint.js +41 -0
  335. package/dist/glass/lens/scopeSegments.d.ts +12 -0
  336. package/dist/glass/lens/scopeSegments.js +18 -0
  337. package/dist/glass/lens/scrollAnchoring.d.ts +15 -0
  338. package/dist/glass/lens/scrollAnchoring.js +17 -0
  339. package/dist/glass/lens/selectionParameters.json +94 -0
  340. package/dist/glass/lens/shapeParameters.json +198 -0
  341. package/dist/glass/lens/tab-motion-native-fits.json +778 -0
  342. package/dist/glass/lens/tabAccessoryMotion.d.ts +52 -0
  343. package/dist/glass/lens/tabAccessoryMotion.js +52 -0
  344. package/dist/glass/lens/tabChromaRimModel.d.ts +43 -0
  345. package/dist/glass/lens/tabChromaRimModel.js +93 -0
  346. package/dist/glass/lens/tabCollapseInkSamples.json +49 -0
  347. package/dist/glass/lens/tabCompactGesture.d.ts +15 -0
  348. package/dist/glass/lens/tabCompactGesture.js +50 -0
  349. package/dist/glass/lens/tabGeometryAttack.json +70 -0
  350. package/dist/glass/lens/tabGlyphColours.d.ts +17 -0
  351. package/dist/glass/lens/tabGlyphColours.js +37 -0
  352. package/dist/glass/lens/tabInterruptedDecaySamples.json +245 -0
  353. package/dist/glass/lens/tabInterruptedRestoreSamples.json +290 -0
  354. package/dist/glass/lens/tabMaterialModel.d.ts +10 -0
  355. package/dist/glass/lens/tabMaterialModel.js +108 -0
  356. package/dist/glass/lens/tabMinimizeInk.d.ts +15 -0
  357. package/dist/glass/lens/tabMinimizeInk.js +14 -0
  358. package/dist/glass/lens/tabMinimizeMotion.d.ts +36 -0
  359. package/dist/glass/lens/tabMinimizeMotion.js +107 -0
  360. package/dist/glass/lens/tabMinimizeSamples.json +411 -0
  361. package/dist/glass/lens/tabMotion.d.ts +91 -0
  362. package/dist/glass/lens/tabMotion.js +478 -0
  363. package/dist/glass/lens/tabMotionFit.d.ts +76 -0
  364. package/dist/glass/lens/tabMotionFit.js +61 -0
  365. package/dist/glass/lens/tabNativeSymbols.d.ts +1 -0
  366. package/dist/glass/lens/tabNativeSymbols.js +7 -0
  367. package/dist/glass/lens/tabPresentation.d.ts +21 -0
  368. package/dist/glass/lens/tabPresentation.js +20 -0
  369. package/dist/glass/lens/tabRelease.d.ts +5 -0
  370. package/dist/glass/lens/tabRelease.js +14 -0
  371. package/dist/glass/lens/tabRestoreMotion.d.ts +19 -0
  372. package/dist/glass/lens/tabRestoreMotion.js +65 -0
  373. package/dist/glass/lens/tabRestoreSamples.json +1272 -0
  374. package/dist/glass/lens/tabSearchMember.d.ts +38 -0
  375. package/dist/glass/lens/tabSearchMember.js +74 -0
  376. package/dist/glass/lens/tabSelectionMaterial.d.ts +20 -0
  377. package/dist/glass/lens/tabSelectionMaterial.js +23 -0
  378. package/dist/glass/lens/tabSelectionMeasurements.test-fixture.d.ts +9 -0
  379. package/dist/glass/lens/tabSelectionMeasurements.test-fixture.js +74 -0
  380. package/dist/glass/lens/tabSettingsSymbol.d.ts +1 -0
  381. package/dist/glass/lens/tabSettingsSymbol.js +2 -0
  382. package/dist/glass/lens/tabShapeResponse.d.ts +7 -0
  383. package/dist/glass/lens/tabShapeResponse.js +30 -0
  384. package/dist/glass/lens/theme.d.ts +18 -0
  385. package/dist/glass/lens/theme.js +40 -0
  386. package/dist/glass/lens/trace.d.ts +2 -0
  387. package/dist/glass/lens/trace.js +27 -0
  388. package/dist/glass/liquidContext.d.ts +31 -0
  389. package/dist/glass/liquidContext.js +2 -0
  390. package/dist/glass/menuPanelPlacement.d.ts +51 -0
  391. package/dist/glass/menuPanelPlacement.js +128 -0
  392. package/dist/glass/menuPresenter.d.ts +34 -0
  393. package/dist/glass/menuPresenter.js +983 -0
  394. package/dist/glass/menuSymbolMasks.d.ts +1 -0
  395. package/dist/glass/menuSymbolMasks.js +1 -0
  396. package/dist/glass/menuSymbolTokens.d.ts +22 -0
  397. package/dist/glass/menuSymbolTokens.js +12 -0
  398. package/dist/glass/menuTriggerGeometry.d.ts +99 -0
  399. package/dist/glass/menuTriggerGeometry.js +126 -0
  400. package/dist/glass/menuTriggerSnapshot.d.ts +77 -0
  401. package/dist/glass/menuTriggerSnapshot.js +69 -0
  402. package/dist/glass/menuTypes.d.ts +22 -0
  403. package/dist/glass/menuTypes.js +1 -0
  404. package/dist/glass/morphField.d.ts +18 -0
  405. package/dist/glass/morphField.js +139 -0
  406. package/dist/glass/presentationFrame.d.ts +43 -0
  407. package/dist/glass/presentationFrame.js +82 -0
  408. package/dist/glass/pressHighlight.d.ts +9 -0
  409. package/dist/glass/pressHighlight.js +158 -0
  410. package/dist/glass/regionRegistry.d.ts +93 -0
  411. package/dist/glass/regionRegistry.js +313 -0
  412. package/dist/glass/regions.d.ts +262 -0
  413. package/dist/glass/regions.js +147 -0
  414. package/dist/glass/regularMaterialContext.d.ts +45 -0
  415. package/dist/glass/regularMaterialContext.js +118 -0
  416. package/dist/glass/regularTriggerMaterial.d.ts +19 -0
  417. package/dist/glass/regularTriggerMaterial.js +111 -0
  418. package/dist/glass/regularTriggerRim.d.ts +163 -0
  419. package/dist/glass/regularTriggerRim.js +436 -0
  420. package/dist/glass/renderSpecs.d.ts +454 -0
  421. package/dist/glass/renderSpecs.js +231 -0
  422. package/dist/glass/rendererContract.d.ts +205 -0
  423. package/dist/glass/rendererContract.js +18 -0
  424. package/dist/glass/shapeTrack.d.ts +53 -0
  425. package/dist/glass/shapeTrack.js +74 -0
  426. package/dist/glass/shapeTrackRegistry.d.ts +40 -0
  427. package/dist/glass/shapeTrackRegistry.js +49 -0
  428. package/dist/glass/sourceDamage.d.ts +6 -0
  429. package/dist/glass/sourceDamage.js +8 -0
  430. package/dist/glass/submenuMotion.d.ts +205 -0
  431. package/dist/glass/submenuMotion.js +306 -0
  432. package/dist/glass/tabBarModel.d.ts +12 -0
  433. package/dist/glass/tabBarModel.js +32 -0
  434. package/dist/glass/testing.d.ts +14 -0
  435. package/dist/glass/testing.js +14 -0
  436. package/dist/glass/tokens.d.ts +79 -0
  437. package/dist/glass/tokens.js +86 -0
  438. package/dist/glass/toolbarMaterialContext.d.ts +28 -0
  439. package/dist/glass/toolbarMaterialContext.js +66 -0
  440. package/dist/glass/topLayer.d.ts +5 -0
  441. package/dist/glass/topLayer.js +10 -0
  442. package/dist/glass/unionOutline.d.ts +11 -0
  443. package/dist/glass/unionOutline.js +98 -0
  444. package/dist/glass/visibleDeadline.d.ts +21 -0
  445. package/dist/glass/visibleDeadline.js +61 -0
  446. package/dist/glass/webgpu/accessoryMorph.d.ts +99 -0
  447. package/dist/glass/webgpu/accessoryMorph.js +473 -0
  448. package/dist/glass/webgpu/accessoryTrack.d.ts +47 -0
  449. package/dist/glass/webgpu/accessoryTrack.js +59 -0
  450. package/dist/glass/webgpu/areaMips.d.ts +50 -0
  451. package/dist/glass/webgpu/areaMips.js +166 -0
  452. package/dist/glass/webgpu/backdrop.d.ts +86 -0
  453. package/dist/glass/webgpu/backdrop.js +243 -0
  454. package/dist/glass/webgpu/backdropLayers.d.ts +29 -0
  455. package/dist/glass/webgpu/backdropLayers.js +182 -0
  456. package/dist/glass/webgpu/backgroundLayers.d.ts +71 -0
  457. package/dist/glass/webgpu/backgroundLayers.js +385 -0
  458. package/dist/glass/webgpu/cadence.d.ts +18 -0
  459. package/dist/glass/webgpu/cadence.js +35 -0
  460. package/dist/glass/webgpu/canvasSubmission.d.ts +6 -0
  461. package/dist/glass/webgpu/canvasSubmission.js +22 -0
  462. package/dist/glass/webgpu/capture.d.ts +77 -0
  463. package/dist/glass/webgpu/capture.js +534 -0
  464. package/dist/glass/webgpu/captureBands.d.ts +39 -0
  465. package/dist/glass/webgpu/captureBands.js +53 -0
  466. package/dist/glass/webgpu/captureContext.d.ts +1 -0
  467. package/dist/glass/webgpu/captureContext.js +6 -0
  468. package/dist/glass/webgpu/captureDemand.d.ts +44 -0
  469. package/dist/glass/webgpu/captureDemand.js +81 -0
  470. package/dist/glass/webgpu/captureRelease.d.ts +18 -0
  471. package/dist/glass/webgpu/captureRelease.js +39 -0
  472. package/dist/glass/webgpu/client.d.ts +49 -0
  473. package/dist/glass/webgpu/client.js +336 -0
  474. package/dist/glass/webgpu/contextBackdrop.d.ts +6 -0
  475. package/dist/glass/webgpu/contextBackdrop.js +13 -0
  476. package/dist/glass/webgpu/contextComposite.d.ts +64 -0
  477. package/dist/glass/webgpu/contextComposite.js +66 -0
  478. package/dist/glass/webgpu/decodedImage.d.ts +1 -0
  479. package/dist/glass/webgpu/decodedImage.js +2 -0
  480. package/dist/glass/webgpu/deviceLimits.d.ts +5 -0
  481. package/dist/glass/webgpu/deviceLimits.js +8 -0
  482. package/dist/glass/webgpu/edgePass.d.ts +9 -0
  483. package/dist/glass/webgpu/edgePass.js +170 -0
  484. package/dist/glass/webgpu/entry.worker.d.ts +1 -0
  485. package/dist/glass/webgpu/entry.worker.js +28 -0
  486. package/dist/glass/webgpu/errorCode.d.ts +3 -0
  487. package/dist/glass/webgpu/errorCode.js +27 -0
  488. package/dist/glass/webgpu/errors.d.ts +8 -0
  489. package/dist/glass/webgpu/errors.js +55 -0
  490. package/dist/glass/webgpu/fieldInk.d.ts +9 -0
  491. package/dist/glass/webgpu/fieldInk.js +62 -0
  492. package/dist/glass/webgpu/foreground.d.ts +29 -0
  493. package/dist/glass/webgpu/foreground.js +313 -0
  494. package/dist/glass/webgpu/frameClock.d.ts +34 -0
  495. package/dist/glass/webgpu/frameClock.js +60 -0
  496. package/dist/glass/webgpu/frameGraph.d.ts +57 -0
  497. package/dist/glass/webgpu/frameGraph.js +287 -0
  498. package/dist/glass/webgpu/frameProbe.d.ts +58 -0
  499. package/dist/glass/webgpu/frameProbe.js +181 -0
  500. package/dist/glass/webgpu/interactionProfiles.d.ts +10 -0
  501. package/dist/glass/webgpu/interactionProfiles.js +25 -0
  502. package/dist/glass/webgpu/keptGlyphs.d.ts +68 -0
  503. package/dist/glass/webgpu/keptGlyphs.js +85 -0
  504. package/dist/glass/webgpu/keyboardBackdrop.d.ts +12 -0
  505. package/dist/glass/webgpu/keyboardBackdrop.js +51 -0
  506. package/dist/glass/webgpu/lagTrace.d.ts +31 -0
  507. package/dist/glass/webgpu/lagTrace.js +22 -0
  508. package/dist/glass/webgpu/layers.d.ts +100 -0
  509. package/dist/glass/webgpu/layers.js +301 -0
  510. package/dist/glass/webgpu/lensDebug.d.ts +4 -0
  511. package/dist/glass/webgpu/lensDebug.js +28 -0
  512. package/dist/glass/webgpu/lensDiffusion.d.ts +2 -0
  513. package/dist/glass/webgpu/lensDiffusion.js +20 -0
  514. package/dist/glass/webgpu/lensLightingFit.json +222 -0
  515. package/dist/glass/webgpu/menuLiftInput.d.ts +30 -0
  516. package/dist/glass/webgpu/menuLiftInput.js +39 -0
  517. package/dist/glass/webgpu/menuSurfaceGuard.d.ts +17 -0
  518. package/dist/glass/webgpu/menuSurfaceGuard.js +26 -0
  519. package/dist/glass/webgpu/minimize.d.ts +184 -0
  520. package/dist/glass/webgpu/minimize.js +470 -0
  521. package/dist/glass/webgpu/navigationAtlasCopy.d.ts +12 -0
  522. package/dist/glass/webgpu/navigationAtlasCopy.js +121 -0
  523. package/dist/glass/webgpu/navigationTracks.d.ts +3 -0
  524. package/dist/glass/webgpu/navigationTracks.js +84 -0
  525. package/dist/glass/webgpu/passes.d.ts +204 -0
  526. package/dist/glass/webgpu/passes.js +394 -0
  527. package/dist/glass/webgpu/pendingSurfaceInput.d.ts +29 -0
  528. package/dist/glass/webgpu/pendingSurfaceInput.js +51 -0
  529. package/dist/glass/webgpu/preparedSourcePixels.d.ts +21 -0
  530. package/dist/glass/webgpu/preparedSourcePixels.js +43 -0
  531. package/dist/glass/webgpu/presentationBackdrop.d.ts +3 -0
  532. package/dist/glass/webgpu/presentationBackdrop.js +33 -0
  533. package/dist/glass/webgpu/presentationDiffusion.d.ts +48 -0
  534. package/dist/glass/webgpu/presentationDiffusion.js +57 -0
  535. package/dist/glass/webgpu/presentationMaterial.d.ts +9 -0
  536. package/dist/glass/webgpu/presentationMaterial.js +156 -0
  537. package/dist/glass/webgpu/presenterViewport.d.ts +11 -0
  538. package/dist/glass/webgpu/presenterViewport.js +193 -0
  539. package/dist/glass/webgpu/production.d.ts +552 -0
  540. package/dist/glass/webgpu/production.js +1929 -0
  541. package/dist/glass/webgpu/productionInstalls.d.ts +53 -0
  542. package/dist/glass/webgpu/productionInstalls.js +225 -0
  543. package/dist/glass/webgpu/productionNavigation.d.ts +5 -0
  544. package/dist/glass/webgpu/productionNavigation.js +360 -0
  545. package/dist/glass/webgpu/productionPinnedTop.d.ts +80 -0
  546. package/dist/glass/webgpu/productionPinnedTop.js +77 -0
  547. package/dist/glass/webgpu/productionPinnedTopPrepare.d.ts +21 -0
  548. package/dist/glass/webgpu/productionPinnedTopPrepare.js +132 -0
  549. package/dist/glass/webgpu/productionPlanes.d.ts +135 -0
  550. package/dist/glass/webgpu/productionPlanes.js +412 -0
  551. package/dist/glass/webgpu/productionPrepare.d.ts +18 -0
  552. package/dist/glass/webgpu/productionPrepare.js +832 -0
  553. package/dist/glass/webgpu/productionTracks.d.ts +73 -0
  554. package/dist/glass/webgpu/productionTracks.js +22 -0
  555. package/dist/glass/webgpu/productionViewport.d.ts +20 -0
  556. package/dist/glass/webgpu/productionViewport.js +52 -0
  557. package/dist/glass/webgpu/profile.d.ts +37 -0
  558. package/dist/glass/webgpu/profile.js +101 -0
  559. package/dist/glass/webgpu/raster.d.ts +337 -0
  560. package/dist/glass/webgpu/raster.js +1360 -0
  561. package/dist/glass/webgpu/rasterMaterial.d.ts +19 -0
  562. package/dist/glass/webgpu/rasterMaterial.js +197 -0
  563. package/dist/glass/webgpu/rasterShaders.d.ts +7 -0
  564. package/dist/glass/webgpu/rasterShaders.js +105 -0
  565. package/dist/glass/webgpu/rasterUniforms.d.ts +304 -0
  566. package/dist/glass/webgpu/rasterUniforms.js +415 -0
  567. package/dist/glass/webgpu/regionBackdrop.d.ts +8 -0
  568. package/dist/glass/webgpu/regionBackdrop.js +12 -0
  569. package/dist/glass/webgpu/regionBridge.d.ts +145 -0
  570. package/dist/glass/webgpu/regionBridge.js +1691 -0
  571. package/dist/glass/webgpu/regionScene.d.ts +294 -0
  572. package/dist/glass/webgpu/regionScene.js +2144 -0
  573. package/dist/glass/webgpu/renderer.d.ts +8 -0
  574. package/dist/glass/webgpu/renderer.js +1478 -0
  575. package/dist/glass/webgpu/residentPlanes.d.ts +69 -0
  576. package/dist/glass/webgpu/residentPlanes.js +104 -0
  577. package/dist/glass/webgpu/restMaterial.d.ts +6 -0
  578. package/dist/glass/webgpu/restMaterial.js +65 -0
  579. package/dist/glass/webgpu/resumeOverlay.d.ts +44 -0
  580. package/dist/glass/webgpu/resumeOverlay.js +82 -0
  581. package/dist/glass/webgpu/sampleTrace.d.ts +11 -0
  582. package/dist/glass/webgpu/sampleTrace.js +50 -0
  583. package/dist/glass/webgpu/scrollEdgeBackdrop.d.ts +89 -0
  584. package/dist/glass/webgpu/scrollEdgeBackdrop.js +177 -0
  585. package/dist/glass/webgpu/scrollEdgePose.d.ts +4 -0
  586. package/dist/glass/webgpu/scrollEdgePose.js +49 -0
  587. package/dist/glass/webgpu/selectionThumb.d.ts +81 -0
  588. package/dist/glass/webgpu/selectionThumb.js +209 -0
  589. package/dist/glass/webgpu/shaders.d.ts +67 -0
  590. package/dist/glass/webgpu/shaders.js +595 -0
  591. package/dist/glass/webgpu/sharedLift.d.ts +7 -0
  592. package/dist/glass/webgpu/sharedLift.js +223 -0
  593. package/dist/glass/webgpu/sourcePixels.d.ts +42 -0
  594. package/dist/glass/webgpu/sourcePixels.js +140 -0
  595. package/dist/glass/webgpu/sourcePixels.worker.d.ts +1 -0
  596. package/dist/glass/webgpu/sourcePixels.worker.js +62 -0
  597. package/dist/glass/webgpu/tabGlyphInk.d.ts +14 -0
  598. package/dist/glass/webgpu/tabGlyphInk.js +72 -0
  599. package/dist/glass/webgpu/touchLight.d.ts +4 -0
  600. package/dist/glass/webgpu/touchLight.js +15 -0
  601. package/dist/glass/worker/client.d.ts +21 -0
  602. package/dist/glass/worker/client.js +152 -0
  603. package/dist/glass/worker/experiment.d.ts +13 -0
  604. package/dist/glass/worker/experiment.js +221 -0
  605. package/dist/glass/worker/fixture.d.ts +21 -0
  606. package/dist/glass/worker/fixture.js +152 -0
  607. package/dist/glass/worker/protocol.d.ts +439 -0
  608. package/dist/glass/worker/protocol.js +5 -0
  609. package/dist/graphicsProbe.d.ts +19 -0
  610. package/dist/graphicsProbe.js +111 -0
  611. package/dist/haptics/SensoryButton.d.ts +21 -0
  612. package/dist/haptics/SensoryButton.js +80 -0
  613. package/dist/image/ContentAdmission.d.ts +19 -0
  614. package/dist/image/ContentAdmission.js +70 -0
  615. package/dist/image/Image.d.ts +30 -0
  616. package/dist/image/Image.js +341 -0
  617. package/dist/image/asset.d.ts +9 -0
  618. package/dist/image/asset.js +1 -0
  619. package/dist/image/contentReadiness.d.ts +7 -0
  620. package/dist/image/contentReadiness.js +54 -0
  621. package/dist/image/imports.d.ts +4 -0
  622. package/dist/image/resource.d.ts +53 -0
  623. package/dist/image/resource.js +286 -0
  624. package/dist/image/vite.d.ts +3 -0
  625. package/dist/image/vite.js +63 -0
  626. package/dist/index.d.ts +87 -0
  627. package/dist/index.js +102 -0
  628. package/dist/install.d.ts +8 -0
  629. package/dist/install.js +8 -0
  630. package/dist/internal.d.ts +96 -0
  631. package/dist/internal.js +80 -0
  632. package/dist/keyboard/adapter.d.ts +82 -0
  633. package/dist/keyboard/adapter.js +727 -0
  634. package/dist/keyboard/avoidance.d.ts +24 -0
  635. package/dist/keyboard/avoidance.js +283 -0
  636. package/dist/keyboard/caretMirror.d.ts +13 -0
  637. package/dist/keyboard/caretMirror.js +122 -0
  638. package/dist/keyboard/expectedKeyboard.d.ts +10 -0
  639. package/dist/keyboard/expectedKeyboard.js +60 -0
  640. package/dist/keyboard/geometry.d.ts +10 -0
  641. package/dist/keyboard/geometry.js +21 -0
  642. package/dist/keyboard/modalTapFocus.d.ts +41 -0
  643. package/dist/keyboard/modalTapFocus.js +224 -0
  644. package/dist/keyboard/motion.d.ts +54 -0
  645. package/dist/keyboard/motion.js +80 -0
  646. package/dist/keyboard/translation.d.ts +12 -0
  647. package/dist/keyboard/translation.js +19 -0
  648. package/dist/layout/adaptiveTabsContext.d.ts +5 -0
  649. package/dist/layout/adaptiveTabsContext.js +2 -0
  650. package/dist/layout/deviceIdiom.d.ts +4 -0
  651. package/dist/layout/deviceIdiom.js +12 -0
  652. package/dist/layout/layoutClass.d.ts +44 -0
  653. package/dist/layout/layoutClass.js +102 -0
  654. package/dist/layout/navigationLayoutContext.d.ts +8 -0
  655. package/dist/layout/navigationLayoutContext.js +5 -0
  656. package/dist/list-form/ListForm.d.ts +158 -0
  657. package/dist/list-form/ListForm.js +427 -0
  658. package/dist/list-form/ListItem.d.ts +30 -0
  659. package/dist/list-form/ListItem.js +251 -0
  660. package/dist/list-form/RowLabel.d.ts +14 -0
  661. package/dist/list-form/RowLabel.js +11 -0
  662. package/dist/list-form/Slider.d.ts +18 -0
  663. package/dist/list-form/Slider.js +235 -0
  664. package/dist/list-form/StepperButton.d.ts +9 -0
  665. package/dist/list-form/StepperButton.js +60 -0
  666. package/dist/list-form/Toggle.d.ts +16 -0
  667. package/dist/list-form/Toggle.js +204 -0
  668. package/dist/list-form/editMotion.d.ts +15 -0
  669. package/dist/list-form/editMotion.js +25 -0
  670. package/dist/list-form/editing.d.ts +102 -0
  671. package/dist/list-form/editing.js +51 -0
  672. package/dist/list-form/listContext.d.ts +4 -0
  673. package/dist/list-form/listContext.js +5 -0
  674. package/dist/list-form/offsets.d.ts +26 -0
  675. package/dist/list-form/offsets.js +34 -0
  676. package/dist/list-form/reorder.d.ts +20 -0
  677. package/dist/list-form/reorder.js +193 -0
  678. package/dist/list-form/rowMotion.d.ts +11 -0
  679. package/dist/list-form/rowMotion.js +236 -0
  680. package/dist/list-form/rowMotionScope.d.ts +14 -0
  681. package/dist/list-form/rowMotionScope.js +61 -0
  682. package/dist/list-form/separatorInsets.d.ts +4 -0
  683. package/dist/list-form/separatorInsets.js +87 -0
  684. package/dist/list-form/sliderContact.d.ts +40 -0
  685. package/dist/list-form/sliderContact.js +98 -0
  686. package/dist/list-form/state.d.ts +5 -0
  687. package/dist/list-form/state.js +8 -0
  688. package/dist/list-form/toggleContact.d.ts +55 -0
  689. package/dist/list-form/toggleContact.js +164 -0
  690. package/dist/media/controller.d.ts +7 -0
  691. package/dist/media/controller.js +612 -0
  692. package/dist/media/react.d.ts +9 -0
  693. package/dist/media/react.js +38 -0
  694. package/dist/media/systemMedia.d.ts +6 -0
  695. package/dist/media/systemMedia.js +200 -0
  696. package/dist/media/types.d.ts +83 -0
  697. package/dist/media/types.js +1 -0
  698. package/dist/menu/menuContact.d.ts +20 -0
  699. package/dist/menu/menuContact.js +286 -0
  700. package/dist/menu/menuGesture.d.ts +84 -0
  701. package/dist/menu/menuGesture.js +502 -0
  702. package/dist/menu/menuInteraction.d.ts +17 -0
  703. package/dist/menu/menuInteraction.js +34 -0
  704. package/dist/menu/menuOutside.d.ts +9 -0
  705. package/dist/menu/menuOutside.js +58 -0
  706. package/dist/menu/menuPanelContact.d.ts +11 -0
  707. package/dist/menu/menuPanelContact.js +77 -0
  708. package/dist/menu/menuTriggerHold.d.ts +3 -0
  709. package/dist/menu/menuTriggerHold.js +52 -0
  710. package/dist/menu/sampledMotion.d.ts +37 -0
  711. package/dist/menu/sampledMotion.js +86 -0
  712. package/dist/modal/lifecycle.d.ts +10 -0
  713. package/dist/modal/lifecycle.js +189 -0
  714. package/dist/motion/TransitionView.d.ts +12 -0
  715. package/dist/motion/TransitionView.js +118 -0
  716. package/dist/motion/animate.d.ts +20 -0
  717. package/dist/motion/animate.js +79 -0
  718. package/dist/motion/animationValue.d.ts +25 -0
  719. package/dist/motion/animationValue.js +42 -0
  720. package/dist/motion/composerMotion.d.ts +3 -0
  721. package/dist/motion/composerMotion.js +15 -0
  722. package/dist/motion/layoutTransaction.d.ts +7 -0
  723. package/dist/motion/layoutTransaction.js +28 -0
  724. package/dist/motion/matchedGeometry.d.ts +55 -0
  725. package/dist/motion/matchedGeometry.js +412 -0
  726. package/dist/motion/springPath.d.ts +27 -0
  727. package/dist/motion/springPath.js +46 -0
  728. package/dist/motion/springTrack.d.ts +33 -0
  729. package/dist/motion/springTrack.js +69 -0
  730. package/dist/motion/transition.d.ts +48 -0
  731. package/dist/motion/transition.js +56 -0
  732. package/dist/motion/transitionImages.d.ts +7 -0
  733. package/dist/motion/transitionImages.js +49 -0
  734. package/dist/motionProbe.d.ts +227 -0
  735. package/dist/motionProbe.js +697 -0
  736. package/dist/motionProbeControls.d.ts +2 -0
  737. package/dist/motionProbeControls.js +118 -0
  738. package/dist/motionProbeDelivery.d.ts +15 -0
  739. package/dist/motionProbeDelivery.js +84 -0
  740. package/dist/navigation/DetailList.d.ts +9 -0
  741. package/dist/navigation/DetailList.js +7 -0
  742. package/dist/navigation/NavigationChrome.d.ts +18 -0
  743. package/dist/navigation/NavigationChrome.js +195 -0
  744. package/dist/navigation/NavigationSearchRow.d.ts +9 -0
  745. package/dist/navigation/NavigationSearchRow.js +101 -0
  746. package/dist/navigation/NavigationTitleSlots.d.ts +18 -0
  747. package/dist/navigation/NavigationTitleSlots.js +64 -0
  748. package/dist/navigation/NavigatorHost.d.ts +17 -0
  749. package/dist/navigation/NavigatorHost.js +534 -0
  750. package/dist/navigation/ScreenContainer.d.ts +31 -0
  751. package/dist/navigation/ScreenContainer.js +219 -0
  752. package/dist/navigation/ScrubSourceFrames.d.ts +18 -0
  753. package/dist/navigation/ScrubSourceFrames.js +67 -0
  754. package/dist/navigation/Sidebar.d.ts +16 -0
  755. package/dist/navigation/Sidebar.js +20 -0
  756. package/dist/navigation/SidebarSymbol.d.ts +4 -0
  757. package/dist/navigation/SidebarSymbol.js +6 -0
  758. package/dist/navigation/ToolbarGlass.d.ts +2 -0
  759. package/dist/navigation/ToolbarGlass.js +429 -0
  760. package/dist/navigation/TransitionEdge.d.ts +4 -0
  761. package/dist/navigation/TransitionEdge.js +33 -0
  762. package/dist/navigation/bottomToolbarGeometry.d.ts +6 -0
  763. package/dist/navigation/bottomToolbarGeometry.js +14 -0
  764. package/dist/navigation/chromeCurves.d.ts +48 -0
  765. package/dist/navigation/chromeCurves.js +255 -0
  766. package/dist/navigation/glassTransition.d.ts +32 -0
  767. package/dist/navigation/glassTransition.js +55 -0
  768. package/dist/navigation/horizontalDrag.d.ts +6 -0
  769. package/dist/navigation/horizontalDrag.js +15 -0
  770. package/dist/navigation/interactivePop.d.ts +45 -0
  771. package/dist/navigation/interactivePop.js +86 -0
  772. package/dist/navigation/interactivePopTypes.d.ts +85 -0
  773. package/dist/navigation/interactivePopTypes.js +36 -0
  774. package/dist/navigation/keyboard.d.ts +9 -0
  775. package/dist/navigation/keyboard.js +55 -0
  776. package/dist/navigation/motion.d.ts +19 -0
  777. package/dist/navigation/motion.js +645 -0
  778. package/dist/navigation/motionTokens.d.ts +43 -0
  779. package/dist/navigation/motionTokens.js +75 -0
  780. package/dist/navigation/nativeScrubExperiment.d.ts +5 -0
  781. package/dist/navigation/nativeScrubExperiment.js +153 -0
  782. package/dist/navigation/nativeScrubSource.d.ts +15 -0
  783. package/dist/navigation/nativeScrubSource.js +88 -0
  784. package/dist/navigation/navigationChromeModel.d.ts +8 -0
  785. package/dist/navigation/navigationChromeModel.js +30 -0
  786. package/dist/navigation/navigationContext.d.ts +22 -0
  787. package/dist/navigation/navigationContext.js +65 -0
  788. package/dist/navigation/navigationEdge.d.ts +4 -0
  789. package/dist/navigation/navigationEdge.js +101 -0
  790. package/dist/navigation/pointerPop.d.ts +32 -0
  791. package/dist/navigation/pointerPop.js +206 -0
  792. package/dist/navigation/probeLayers.d.ts +7 -0
  793. package/dist/navigation/probeLayers.js +8 -0
  794. package/dist/navigation/registry.d.ts +14 -0
  795. package/dist/navigation/registry.js +31 -0
  796. package/dist/navigation/releaseDecision.d.ts +21 -0
  797. package/dist/navigation/releaseDecision.js +94 -0
  798. package/dist/navigation/releaseTrajectory.d.ts +20 -0
  799. package/dist/navigation/releaseTrajectory.js +95 -0
  800. package/dist/navigation/releaseVelocity.d.ts +9 -0
  801. package/dist/navigation/releaseVelocity.js +38 -0
  802. package/dist/navigation/routeCodec.d.ts +33 -0
  803. package/dist/navigation/routeCodec.js +123 -0
  804. package/dist/navigation/scrollEdge.d.ts +18 -0
  805. package/dist/navigation/scrollEdge.js +66 -0
  806. package/dist/navigation/scrubFrameLoop.d.ts +44 -0
  807. package/dist/navigation/scrubFrameLoop.js +129 -0
  808. package/dist/navigation/sidebarSelection.d.ts +5 -0
  809. package/dist/navigation/sidebarSelection.js +8 -0
  810. package/dist/navigation/splitContext.d.ts +17 -0
  811. package/dist/navigation/splitContext.js +9 -0
  812. package/dist/navigation/splitState.d.ts +46 -0
  813. package/dist/navigation/splitState.js +130 -0
  814. package/dist/navigation/stack.d.ts +25 -0
  815. package/dist/navigation/stack.js +136 -0
  816. package/dist/navigation/store.d.ts +80 -0
  817. package/dist/navigation/store.js +464 -0
  818. package/dist/navigation/toolbarGlassMotion.d.ts +40 -0
  819. package/dist/navigation/toolbarGlassMotion.js +202 -0
  820. package/dist/navigation/toolbarMinimization.d.ts +9 -0
  821. package/dist/navigation/toolbarMinimization.js +76 -0
  822. package/dist/navigation/toolbarMotionOwner.d.ts +6 -0
  823. package/dist/navigation/toolbarMotionOwner.js +30 -0
  824. package/dist/navigation/touchArbitration.d.ts +34 -0
  825. package/dist/navigation/touchArbitration.js +550 -0
  826. package/dist/navigation/tracking.d.ts +7 -0
  827. package/dist/navigation/tracking.js +19 -0
  828. package/dist/navigation/transitionBindings.d.ts +31 -0
  829. package/dist/navigation/transitionBindings.js +106 -0
  830. package/dist/navigation/transitionChrome.d.ts +31 -0
  831. package/dist/navigation/transitionChrome.js +380 -0
  832. package/dist/navigation/transitionPose.d.ts +52 -0
  833. package/dist/navigation/transitionPose.js +295 -0
  834. package/dist/navigation/types.d.ts +133 -0
  835. package/dist/navigation/types.js +1 -0
  836. package/dist/navigation/zoomDrag.d.ts +3 -0
  837. package/dist/navigation/zoomDrag.js +125 -0
  838. package/dist/navigation/zoomGeometry.d.ts +48 -0
  839. package/dist/navigation/zoomGeometry.js +94 -0
  840. package/dist/navigation/zoomGlass.d.ts +27 -0
  841. package/dist/navigation/zoomGlass.js +64 -0
  842. package/dist/navigation/zoomMotion.d.ts +73 -0
  843. package/dist/navigation/zoomMotion.js +104 -0
  844. package/dist/navigation/zoomTransition.d.ts +82 -0
  845. package/dist/navigation/zoomTransition.js +975 -0
  846. package/dist/presentation/Presentation.d.ts +61 -0
  847. package/dist/presentation/Presentation.js +92 -0
  848. package/dist/presentation/PresentationSurface.d.ts +29 -0
  849. package/dist/presentation/PresentationSurface.js +586 -0
  850. package/dist/presentation/PresentedSheet.d.ts +2 -0
  851. package/dist/presentation/PresentedSheet.js +571 -0
  852. package/dist/presentation/activity.d.ts +3 -0
  853. package/dist/presentation/activity.js +24 -0
  854. package/dist/presentation/coldLaunch.d.ts +2 -0
  855. package/dist/presentation/coldLaunch.js +19 -0
  856. package/dist/presentation/dismiss.d.ts +26 -0
  857. package/dist/presentation/dismiss.js +30 -0
  858. package/dist/presentation/glassMotion.d.ts +39 -0
  859. package/dist/presentation/glassMotion.js +259 -0
  860. package/dist/presentation/glassReady.d.ts +11 -0
  861. package/dist/presentation/glassReady.js +246 -0
  862. package/dist/presentation/model.d.ts +108 -0
  863. package/dist/presentation/model.js +183 -0
  864. package/dist/presentation/motion.d.ts +56 -0
  865. package/dist/presentation/motion.js +263 -0
  866. package/dist/presentation/presentationMotion.d.ts +10 -0
  867. package/dist/presentation/presentationMotion.js +74 -0
  868. package/dist/presentation/presentationSource.d.ts +2 -0
  869. package/dist/presentation/presentationSource.js +28 -0
  870. package/dist/presentation/sheetChromeContext.d.ts +2 -0
  871. package/dist/presentation/sheetChromeContext.js +3 -0
  872. package/dist/presentation/sheetMaterialTransition.d.ts +14 -0
  873. package/dist/presentation/sheetMaterialTransition.js +33 -0
  874. package/dist/presentation/sheetReleaseMotion.d.ts +18 -0
  875. package/dist/presentation/sheetReleaseMotion.js +123 -0
  876. package/dist/presentation/useAlertKeyboardMotion.d.ts +8 -0
  877. package/dist/presentation/useAlertKeyboardMotion.js +104 -0
  878. package/dist/press/Pressable.d.ts +19 -0
  879. package/dist/press/Pressable.js +16 -0
  880. package/dist/press/activation.d.ts +20 -0
  881. package/dist/press/activation.js +28 -0
  882. package/dist/press/contactReceipt.d.ts +23 -0
  883. package/dist/press/contactReceipt.js +177 -0
  884. package/dist/press/gestureArbitration.d.ts +13 -0
  885. package/dist/press/gestureArbitration.js +38 -0
  886. package/dist/press/stateMachine.d.ts +29 -0
  887. package/dist/press/stateMachine.js +39 -0
  888. package/dist/press/tokens.d.ts +18 -0
  889. package/dist/press/tokens.js +19 -0
  890. package/dist/press/usePressInteraction.d.ts +30 -0
  891. package/dist/press/usePressInteraction.js +247 -0
  892. package/dist/public/Label.d.ts +16 -0
  893. package/dist/public/Label.js +40 -0
  894. package/dist/public/NativeFilePicker.d.ts +19 -0
  895. package/dist/public/NativeFilePicker.js +75 -0
  896. package/dist/public/Screen.d.ts +42 -0
  897. package/dist/public/Screen.js +87 -0
  898. package/dist/public/actions.d.ts +16 -0
  899. package/dist/public/actions.js +15 -0
  900. package/dist/public/buttonBorderShape.d.ts +7 -0
  901. package/dist/public/buttonBorderShape.js +9 -0
  902. package/dist/public/chrome.d.ts +3 -0
  903. package/dist/public/chrome.js +5 -0
  904. package/dist/public/colors.d.ts +29 -0
  905. package/dist/public/colors.js +28 -0
  906. package/dist/public/context.d.ts +19 -0
  907. package/dist/public/context.js +8 -0
  908. package/dist/public/controlStyle.d.ts +93 -0
  909. package/dist/public/controlStyle.js +52 -0
  910. package/dist/public/controls.d.ts +360 -0
  911. package/dist/public/controls.js +301 -0
  912. package/dist/public/definition.d.ts +65 -0
  913. package/dist/public/definition.js +58 -0
  914. package/dist/public/deviceActions.d.ts +23 -0
  915. package/dist/public/deviceActions.js +87 -0
  916. package/dist/public/environment.d.ts +77 -0
  917. package/dist/public/environment.js +171 -0
  918. package/dist/public/fieldContext.d.ts +2 -0
  919. package/dist/public/fieldContext.js +3 -0
  920. package/dist/public/filePickers.d.ts +25 -0
  921. package/dist/public/filePickers.js +11 -0
  922. package/dist/public/glass.d.ts +31 -0
  923. package/dist/public/glass.js +29 -0
  924. package/dist/public/glassValue.d.ts +19 -0
  925. package/dist/public/glassValue.js +32 -0
  926. package/dist/public/keyboard.d.ts +4 -0
  927. package/dist/public/keyboard.js +6 -0
  928. package/dist/public/navigationTransition.d.ts +48 -0
  929. package/dist/public/navigationTransition.js +49 -0
  930. package/dist/public/pickerNavigation.d.ts +7 -0
  931. package/dist/public/pickerNavigation.js +64 -0
  932. package/dist/public/presentation.d.ts +40 -0
  933. package/dist/public/presentation.js +21 -0
  934. package/dist/public/presentationContext.d.ts +2 -0
  935. package/dist/public/presentationContext.js +3 -0
  936. package/dist/public/routeRegistry.d.ts +3 -0
  937. package/dist/public/routeRegistry.js +10 -0
  938. package/dist/public/routes.d.ts +74 -0
  939. package/dist/public/routes.js +105 -0
  940. package/dist/public/runtime.d.ts +134 -0
  941. package/dist/public/runtime.js +292 -0
  942. package/dist/public/screenChrome.d.ts +91 -0
  943. package/dist/public/screenChrome.js +187 -0
  944. package/dist/public/scroll.d.ts +38 -0
  945. package/dist/public/scroll.js +7 -0
  946. package/dist/public/storage.d.ts +9 -0
  947. package/dist/public/storage.js +9 -0
  948. package/dist/public/structure.d.ts +65 -0
  949. package/dist/public/structure.js +40 -0
  950. package/dist/public/toolbar.d.ts +37 -0
  951. package/dist/public/toolbar.js +76 -0
  952. package/dist/push/PushPermissionExplainer.d.ts +14 -0
  953. package/dist/push/PushPermissionExplainer.js +30 -0
  954. package/dist/push/notifications.d.ts +54 -0
  955. package/dist/push/notifications.js +276 -0
  956. package/dist/push/routes.d.ts +20 -0
  957. package/dist/push/routes.js +63 -0
  958. package/dist/push/schema.d.ts +42 -0
  959. package/dist/push/schema.js +41 -0
  960. package/dist/push/urlProjection.d.ts +24 -0
  961. package/dist/push/urlProjection.js +207 -0
  962. package/dist/reachability/controller.d.ts +21 -0
  963. package/dist/reachability/controller.js +202 -0
  964. package/dist/reachability/model.d.ts +94 -0
  965. package/dist/reachability/model.js +131 -0
  966. package/dist/reachability/react.d.ts +29 -0
  967. package/dist/reachability/react.js +69 -0
  968. package/dist/restoration/navigation.d.ts +9 -0
  969. package/dist/restoration/navigation.js +55 -0
  970. package/dist/restoration/react.d.ts +6 -0
  971. package/dist/restoration/react.js +21 -0
  972. package/dist/restoration/routes.d.ts +22 -0
  973. package/dist/restoration/routes.js +166 -0
  974. package/dist/restoration/scene.d.ts +44 -0
  975. package/dist/restoration/scene.js +284 -0
  976. package/dist/root/SatinRoot.d.ts +25 -0
  977. package/dist/root/SatinRoot.js +512 -0
  978. package/dist/root/mountSatin.d.ts +12 -0
  979. package/dist/root/mountSatin.js +60 -0
  980. package/dist/root/runtimeContext.d.ts +26 -0
  981. package/dist/root/runtimeContext.js +30 -0
  982. package/dist/safe-area/Overlay.d.ts +9 -0
  983. package/dist/safe-area/Overlay.js +26 -0
  984. package/dist/safe-area/SafeAreaInset.d.ts +25 -0
  985. package/dist/safe-area/SafeAreaInset.js +138 -0
  986. package/dist/safe-area/bottomInsetGeometry.d.ts +12 -0
  987. package/dist/safe-area/bottomInsetGeometry.js +73 -0
  988. package/dist/safe-area/context.d.ts +15 -0
  989. package/dist/safe-area/context.js +8 -0
  990. package/dist/safe-area/displayCorners.d.ts +21 -0
  991. package/dist/safe-area/displayCorners.js +70 -0
  992. package/dist/safe-area/keyboardCarrier.d.ts +26 -0
  993. package/dist/safe-area/keyboardCarrier.js +394 -0
  994. package/dist/safe-area/keyboardCarrierGeometry.d.ts +37 -0
  995. package/dist/safe-area/keyboardCarrierGeometry.js +49 -0
  996. package/dist/safe-area/modifiers.d.ts +52 -0
  997. package/dist/safe-area/modifiers.js +86 -0
  998. package/dist/safe-area/useSafeAreaMetrics.d.ts +83 -0
  999. package/dist/safe-area/useSafeAreaMetrics.js +367 -0
  1000. package/dist/safe-area/windowChrome.d.ts +7 -0
  1001. package/dist/safe-area/windowChrome.js +14 -0
  1002. package/dist/scroll/RefreshControl.d.ts +8 -0
  1003. package/dist/scroll/RefreshControl.js +135 -0
  1004. package/dist/scroll/ScrollSurface.d.ts +62 -0
  1005. package/dist/scroll/ScrollSurface.js +278 -0
  1006. package/dist/scroll/ScrollTarget.d.ts +6 -0
  1007. package/dist/scroll/ScrollTarget.js +11 -0
  1008. package/dist/scroll/edgePolicy.d.ts +21 -0
  1009. package/dist/scroll/edgePolicy.js +17 -0
  1010. package/dist/scroll/insertionMotion.d.ts +15 -0
  1011. package/dist/scroll/insertionMotion.js +128 -0
  1012. package/dist/scroll/nativeScroll.d.ts +14 -0
  1013. package/dist/scroll/nativeScroll.js +71 -0
  1014. package/dist/scroll/position.d.ts +31 -0
  1015. package/dist/scroll/position.js +273 -0
  1016. package/dist/scroll/pressOwnership.d.ts +4 -0
  1017. package/dist/scroll/pressOwnership.js +65 -0
  1018. package/dist/scroll/refreshMotion.d.ts +9 -0
  1019. package/dist/scroll/refreshMotion.js +15 -0
  1020. package/dist/scroll/refreshable.d.ts +6 -0
  1021. package/dist/scroll/refreshable.js +50 -0
  1022. package/dist/scroll/registry.d.ts +38 -0
  1023. package/dist/scroll/registry.js +261 -0
  1024. package/dist/scroll/screenGeometry.d.ts +8 -0
  1025. package/dist/scroll/screenGeometry.js +50 -0
  1026. package/dist/scroll/scrollIndicator.d.ts +7 -0
  1027. package/dist/scroll/scrollIndicator.js +114 -0
  1028. package/dist/scroll/scrollJump.d.ts +7 -0
  1029. package/dist/scroll/scrollJump.js +16 -0
  1030. package/dist/scroll/types.d.ts +12 -0
  1031. package/dist/scroll/types.js +1 -0
  1032. package/dist/search/SearchDrawer.d.ts +16 -0
  1033. package/dist/search/SearchDrawer.js +421 -0
  1034. package/dist/search/SearchScopesBar.d.ts +6 -0
  1035. package/dist/search/SearchScopesBar.js +12 -0
  1036. package/dist/search/SearchToolbarField.d.ts +8 -0
  1037. package/dist/search/SearchToolbarField.js +115 -0
  1038. package/dist/search/searchBackdrop.d.ts +12 -0
  1039. package/dist/search/searchBackdrop.js +45 -0
  1040. package/dist/search/searchChrome.d.ts +13 -0
  1041. package/dist/search/searchChrome.js +31 -0
  1042. package/dist/search/searchMotion.d.ts +30 -0
  1043. package/dist/search/searchMotion.js +46 -0
  1044. package/dist/search/searchPlacement.d.ts +11 -0
  1045. package/dist/search/searchPlacement.js +15 -0
  1046. package/dist/search/searchable.d.ts +46 -0
  1047. package/dist/search/searchable.js +5 -0
  1048. package/dist/search/useSearchPresentation.d.ts +15 -0
  1049. package/dist/search/useSearchPresentation.js +61 -0
  1050. package/dist/server.d.ts +7 -0
  1051. package/dist/server.js +144 -0
  1052. package/dist/settings/DisclosureIndicator.d.ts +4 -0
  1053. package/dist/settings/DisclosureIndicator.js +6 -0
  1054. package/dist/settings/tokens.d.ts +129 -0
  1055. package/dist/settings/tokens.js +143 -0
  1056. package/dist/shapes/corners.d.ts +14 -0
  1057. package/dist/shapes/corners.js +80 -0
  1058. package/dist/styles.css +9078 -0
  1059. package/dist/styles.css.d.ts +3 -0
  1060. package/dist/sw/activationState.d.ts +20 -0
  1061. package/dist/sw/activationState.js +39 -0
  1062. package/dist/sw/generator.d.ts +14 -0
  1063. package/dist/sw/generator.js +26 -0
  1064. package/dist/sw/manifest.d.ts +32 -0
  1065. package/dist/sw/manifest.js +137 -0
  1066. package/dist/sw/protocol.d.ts +7 -0
  1067. package/dist/sw/protocol.js +7 -0
  1068. package/dist/sw/pushRuntime.d.ts +2 -0
  1069. package/dist/sw/pushRuntime.js +161 -0
  1070. package/dist/sw/registerAppShell.d.ts +25 -0
  1071. package/dist/sw/registerAppShell.js +259 -0
  1072. package/dist/sw/renderServiceWorker.d.ts +10 -0
  1073. package/dist/sw/renderServiceWorker.js +370 -0
  1074. package/dist/sw/requestRouting.d.ts +13 -0
  1075. package/dist/sw/requestRouting.js +26 -0
  1076. package/dist/sw/updateCheck.d.ts +2 -0
  1077. package/dist/sw/updateCheck.js +25 -0
  1078. package/dist/sw/vite.d.ts +20 -0
  1079. package/dist/sw/vite.js +71 -0
  1080. package/dist/symbols/Symbol.d.ts +33 -0
  1081. package/dist/symbols/Symbol.js +59 -0
  1082. package/dist/symbols/catalogue.d.ts +4 -0
  1083. package/dist/symbols/catalogue.js +4139 -0
  1084. package/dist/symbols/exclusions.d.ts +2 -0
  1085. package/dist/symbols/exclusions.js +4 -0
  1086. package/dist/symbols/inheritedWeight.d.ts +3 -0
  1087. package/dist/symbols/inheritedWeight.js +104 -0
  1088. package/dist/symbols/metrics.d.ts +38 -0
  1089. package/dist/symbols/metrics.js +53 -0
  1090. package/dist/symbols/svg.d.ts +3 -0
  1091. package/dist/symbols/svg.js +16 -0
  1092. package/dist/symbols/types.d.ts +30 -0
  1093. package/dist/symbols/types.js +1 -0
  1094. package/dist/tabs/TabSection.d.ts +12 -0
  1095. package/dist/tabs/TabSection.js +4 -0
  1096. package/dist/tabs/TabSidebarSurface.d.ts +7 -0
  1097. package/dist/tabs/TabSidebarSurface.js +29 -0
  1098. package/dist/tabs/TabView.d.ts +28 -0
  1099. package/dist/tabs/TabView.js +258 -0
  1100. package/dist/tabs/accessoryContact.d.ts +2 -0
  1101. package/dist/tabs/accessoryContact.js +42 -0
  1102. package/dist/tabs/compactBar.d.ts +4 -0
  1103. package/dist/tabs/compactBar.js +28 -0
  1104. package/dist/tabs/context.d.ts +8 -0
  1105. package/dist/tabs/context.js +6 -0
  1106. package/dist/tabs/keyboard.d.ts +3 -0
  1107. package/dist/tabs/keyboard.js +23 -0
  1108. package/dist/tabs/model.d.ts +6 -0
  1109. package/dist/tabs/model.js +16 -0
  1110. package/dist/tabs/presentation.d.ts +7 -0
  1111. package/dist/tabs/presentation.js +14 -0
  1112. package/dist/tabs/sourceRevision.d.ts +3 -0
  1113. package/dist/tabs/sourceRevision.js +36 -0
  1114. package/dist/tabs/tabSidebarGlyph.d.ts +2 -0
  1115. package/dist/tabs/tabSidebarGlyph.js +11 -0
  1116. package/dist/tasks/useTask.d.ts +16 -0
  1117. package/dist/tasks/useTask.js +67 -0
  1118. package/dist/testing.d.ts +9 -0
  1119. package/dist/testing.js +11 -0
  1120. package/dist/text-input/TextEditor.d.ts +25 -0
  1121. package/dist/text-input/TextEditor.js +74 -0
  1122. package/dist/text-input/TextField.d.ts +32 -0
  1123. package/dist/text-input/TextField.js +29 -0
  1124. package/dist/text-input/editorGeometry.d.ts +2 -0
  1125. package/dist/text-input/editorGeometry.js +6 -0
  1126. package/dist/text-input/editorTextLayout.d.ts +2 -0
  1127. package/dist/text-input/editorTextLayout.js +31 -0
  1128. package/dist/text-input/focusChain.d.ts +27 -0
  1129. package/dist/text-input/focusChain.js +62 -0
  1130. package/dist/text-input/kinds.d.ts +8 -0
  1131. package/dist/text-input/kinds.js +34 -0
  1132. package/dist/text-input/measureEditor.d.ts +2 -0
  1133. package/dist/text-input/measureEditor.js +50 -0
  1134. package/dist/text-input/submit.d.ts +9 -0
  1135. package/dist/text-input/submit.js +7 -0
  1136. package/dist/unstable.d.ts +16 -0
  1137. package/dist/unstable.js +16 -0
  1138. package/dist/vite.d.ts +3 -0
  1139. package/dist/vite.js +3 -0
  1140. package/dist/web/WebView.d.ts +42 -0
  1141. package/dist/web/WebView.js +115 -0
  1142. package/dist/web/authentication.d.ts +75 -0
  1143. package/dist/web/authentication.js +488 -0
  1144. package/dist/web/openURL.d.ts +37 -0
  1145. package/dist/web/openURL.js +89 -0
  1146. package/dist/web/urlPolicy.d.ts +3 -0
  1147. package/dist/web/urlPolicy.js +19 -0
  1148. package/dist/web/useWebAuthentication.d.ts +3 -0
  1149. package/dist/web/useWebAuthentication.js +6 -0
  1150. package/dist/zoom/Zoomable.d.ts +10 -0
  1151. package/dist/zoom/Zoomable.js +116 -0
  1152. package/dist/zoom/geometry.d.ts +11 -0
  1153. package/dist/zoom/geometry.js +16 -0
  1154. package/package.json +115 -3
@@ -0,0 +1,1691 @@
1
+ import { presentationGlassMotion, presentationGlassContentEpoch, } from '../../presentation/glassMotion.js';
2
+ import { zoomRestRect } from '../../navigation/zoomGlass.js';
3
+ import { navigationGlassState } from '../../navigation/glassTransition.js';
4
+ import { glassFieldKey, glassUnionDiagnostics } from '../morphField.js';
5
+ import { backdropExclusions, backdropOwner } from './backdropLayers.js';
6
+ import { orderedTopLayerDialogs } from '../../modal/lifecycle.js';
7
+ import { contextSampleInset } from './contextComposite.js';
8
+ import { glassNow, glassTimedAsync, glassTiming } from './profile.js';
9
+ import { toolbarMaterialContent, toolbarMenuContents } from '../toolbarMaterialContext.js';
10
+ import { lagMark, lagTraceEnabled } from './lagTrace.js';
11
+ import { CAPTURE_RELEASE_FALLBACK_MS, releaseCaptureCanvases } from './captureRelease.js';
12
+ import { captureRegionForeground, foregroundGeometry } from './foreground.js';
13
+ import { SupersededImage } from '../../image/resource.js';
14
+ import { GLASS_READINESS_BUDGET_MS, VisibleDeadline } from '../visibleDeadline.js';
15
+ import { frameUnion, glassPresenterBounds, } from '../regions.js';
16
+ import { reportGlassError } from '../errors.js';
17
+ import { glassFailureCode } from './errorCode.js';
18
+ import { atRest, presentationTravel } from '../presentationFrame.js';
19
+ import { DEMAND_MARGIN_POINTS, regionSampleRect } from './captureDemand.js';
20
+ import { observePresenterViewport } from './presenterViewport.js';
21
+ import { accessoryGlassMotion, accessoryReach, accessoryWorkerEnabled, accessoryInkReady, accessoryInkWidth, } from './accessoryMorph.js';
22
+ import { PRESENTATION_TRACK_EVENT } from '../../presentation/glassMotion.js';
23
+ import { GLASS_SHAPE_TRACK_EVENT, glassShapeTrack, glassApertureInFrame, } from '../shapeTrackRegistry.js';
24
+ import { shapeTrackClock } from '../shapeTrack.js';
25
+ import { menuTriggerSnapshot, mapTriggerSnapshot } from '../menuTriggerSnapshot.js';
26
+ import { hasLayoutAnimation, observeAnimations } from '../../motion/animate.js';
27
+ /** A tab panel that is not the selected one (TabView keeps it laid out, hidden and inert). */
28
+ const INACTIVE_TAB = '[data-satin-tab-panel][data-satin-tab-active="false"]';
29
+ const TAB_PANEL = '[data-satin-tab-panel]';
30
+ /** Markup that decides a region's captured ink: every descendant's tag and
31
+ * attributes (classes, inline styles, SVG geometry), excluding presenter canvases. */
32
+ function inkSignature(element, ignored = []) {
33
+ let signature = '';
34
+ for (const node of element.querySelectorAll('*')) {
35
+ if (node.tagName === 'CANVAS')
36
+ continue;
37
+ signature += '<' + node.tagName;
38
+ for (const attribute of node.attributes)
39
+ if (!ignored.includes(attribute.name))
40
+ signature += ' ' + attribute.name + '=' + attribute.value;
41
+ }
42
+ return signature;
43
+ }
44
+ /** A shared toolbar capsule carries every member's ink, including separated DOM siblings. */
45
+ async function captureMenuTrigger(elements, bounds, resolution, geometry) {
46
+ if (elements.length === 1 && !geometry) {
47
+ return captureRegionForeground(elements[0], resolution, INK_PADDING, undefined, {
48
+ resting: true,
49
+ });
50
+ }
51
+ const captures = await Promise.all(elements.map(async (element, index) => ({
52
+ rect: geometry?.[index]?.bounds ?? layoutRect(element),
53
+ image: await captureRegionForeground(element, resolution, INK_PADDING, undefined, {
54
+ resting: true,
55
+ geometry: geometry?.[index],
56
+ }),
57
+ })));
58
+ const canvas = document.createElement('canvas');
59
+ canvas.width = Math.ceil((bounds.width + INK_PADDING * 2) * resolution);
60
+ canvas.height = Math.ceil((bounds.height + INK_PADDING * 2) * resolution);
61
+ const context = canvas.getContext('2d');
62
+ for (const { rect, image } of captures) {
63
+ context.drawImage(image, (rect.x - bounds.x) * resolution, (rect.y - bounds.y) * resolution);
64
+ }
65
+ return canvas;
66
+ }
67
+ /** A viewport rectangle in its layer's coordinates (as a region's `frame`). */
68
+ function layerFrame(rect, owner) {
69
+ if (!rect)
70
+ return undefined;
71
+ return {
72
+ ...rect,
73
+ x: rect.x - (owner?.viewportX ?? 0) + (owner?.offsetX ?? 0),
74
+ y: rect.y - (owner?.viewportY ?? 0) + (owner?.offsetY ?? 0),
75
+ };
76
+ }
77
+ /** A trigger's press state changes nothing in its resting glyph. */
78
+ const PRESS_STATE_ATTRIBUTES = ['data-satin-press-state', 'data-satin-press-transition'];
79
+ /** The region's layout box at its current on-screen centre. A transform animation (an alert's
80
+ * scale entrance) moves the element and its presenter canvas together on the compositor; the
81
+ * material keeps its layout size, so the presenter is never re-allocated (or its canvas resized)
82
+ * per animation frame, and the compositor scales the rendered glass with its content. */
83
+ function layoutRect(element) {
84
+ const motion = presentationGlassMotion(element) ?? accessoryGlassMotion(element);
85
+ if (motion)
86
+ return motion.rect;
87
+ const zoom = zoomRestRect(element);
88
+ if (zoom)
89
+ return zoom;
90
+ // Glass nested in a sheet or cover is placed in the presentation's resting frame, with the
91
+ // backdrop of its content (presentationFrame.ts): it travels with them on the compositor.
92
+ const rect = atRest(element.getBoundingClientRect(), presentationTravel(element)), style = getComputedStyle(element), transform = style.transform;
93
+ if (!transform || transform === 'none')
94
+ return rect;
95
+ const m = new DOMMatrixReadOnly(transform), sx = Math.hypot(m.a, m.b), sy = Math.hypot(m.c, m.d);
96
+ if (!(sx > 0 && sy > 0) || (Math.abs(sx - 1) < 1e-6 && Math.abs(sy - 1) < 1e-6))
97
+ return rect;
98
+ const width = rect.width / sx, height = rect.height / sy;
99
+ // A scale about the origin (ox, oy) moves the layout edge by o * (1 - s). A popover grows
100
+ // from its arrow tip, not its centre.
101
+ const [ox, oy] = style.transformOrigin.split(' ').map(Number.parseFloat);
102
+ const originX = Number.isFinite(ox) ? ox : width / 2, originY = Number.isFinite(oy) ? oy : height / 2;
103
+ return {
104
+ x: rect.x - originX * (1 - sx),
105
+ y: rect.y - originY * (1 - sy),
106
+ width,
107
+ height,
108
+ };
109
+ }
110
+ /** One layout eligibility rule for capture demand, scene/group construction and admission.
111
+ * Hidden retained registrations remain owned, but cannot lead a field or require a draw. */
112
+ function sceneRegionRect(entry) {
113
+ if (!entry.element.isConnected || entry.element.closest('[data-satin-covered="true"]'))
114
+ return undefined;
115
+ const rect = layoutRect(entry.element);
116
+ return rect.width > 0 && rect.height > 0 ? rect : undefined;
117
+ }
118
+ /** A presenter's size as its holder's size plus a fixed margin. The box then follows the holder's
119
+ * layout in the frame the holder changes. A size in points is one refresh old: measured on the
120
+ * iPad, a sheet resized under a finger writes its height after this bridge has measured it, so the
121
+ * glass ended a whole frame's travel (up to 45 pt) short of the sheet's bottom edge and the page
122
+ * showed there. */
123
+ function presenterSize(size, holderSize, followsHolder) {
124
+ if (!followsHolder)
125
+ return `${size}px`;
126
+ // Layout units are 1/64 pt; the margin is normally two whole sample insets.
127
+ return `calc(100% + ${Math.round((size - holderSize) * 64) / 64}px)`;
128
+ }
129
+ /** Whether a percentage on an absolutely positioned child means this element's measured box:
130
+ * the element is the child's containing block, a box of its own (not an inline run), and has no
131
+ * borders (percentages exclude them). */
132
+ function sizesChildren(element) {
133
+ const style = getComputedStyle(element);
134
+ if (!style.position || style.position === 'static' || style.display === 'inline')
135
+ return false;
136
+ return ![
137
+ style.borderTopWidth,
138
+ style.borderRightWidth,
139
+ style.borderBottomWidth,
140
+ style.borderLeftWidth,
141
+ ].some(width => parseFloat(width) > 0);
142
+ }
143
+ /** Distinct menu contents whose ink captures are kept for their next open. */
144
+ const INK_CAPTURES_RETAINED = 4;
145
+ /** Transparent margin around each captured ink image (points). */
146
+ const INK_PADDING = 2;
147
+ /** Field presenters grow their retained envelope in these steps (points). */
148
+ const FIELD_ENVELOPE_STEP = 16;
149
+ /** DOM measurements and transport only. No drawing loop or GPU device here. */
150
+ export class RegionBridge {
151
+ unionWarnings = new Set();
152
+ registry;
153
+ source;
154
+ unsubscribe;
155
+ unsubscribeInput;
156
+ unsubscribePresentation;
157
+ presentationQueued = false;
158
+ frame = 0;
159
+ revision = 0;
160
+ /** Scenes posted and not yet answered. A scene is the whole region state, so when the worker
161
+ * falls behind, superseded scenes are merged: only the newest waits for a free slot. */
162
+ scenesInFlight = 0;
163
+ pendingScene;
164
+ sceneValidity = new WeakMap();
165
+ scenePresented = new WeakMap();
166
+ readiness = new Map();
167
+ accessoryAdmissions = new WeakMap();
168
+ presentationAllowed = true;
169
+ readinessQueued = false;
170
+ queueReadiness() {
171
+ if (this.readinessQueued)
172
+ return;
173
+ this.readinessQueued = true;
174
+ queueMicrotask(() => {
175
+ this.readinessQueued = false;
176
+ this.syncReadiness();
177
+ });
178
+ }
179
+ waitForRegion(pending) {
180
+ // Presentation entrances already own a VisibleDeadline in holdPresentationForGlass.
181
+ // Take over only after that show has appeared, or for persistent chrome with no show.
182
+ if (pending.visible && !pending.failed && (pending.show === undefined || pending.presented))
183
+ pending.deadline.start();
184
+ }
185
+ syncReadiness() {
186
+ const entries = this.registry?.values() ?? [];
187
+ const registered = new Map(entries.map(entry => [entry.canvas, entry]));
188
+ for (const [canvas, pending] of this.readiness) {
189
+ if (registered.get(canvas)?.id !== pending.entry.id) {
190
+ pending.deadline.cancel();
191
+ this.readiness.delete(canvas);
192
+ }
193
+ }
194
+ for (const entry of entries) {
195
+ const show = entry.canvas.dataset.satinGlassShow;
196
+ const rect = accessoryGlassMotion(entry.element)
197
+ ? DOMRect.fromRect(accessoryGlassMotion(entry.element).rect)
198
+ : entry.element.getBoundingClientRect();
199
+ const visible = entry.element.isConnected &&
200
+ rect.width > 0 &&
201
+ rect.height > 0 &&
202
+ rect.right > 0 &&
203
+ rect.bottom > 0 &&
204
+ rect.left < innerWidth &&
205
+ rect.top < innerHeight &&
206
+ // A presentation held for its first glass shows nothing yet (presentationFrame.ts).
207
+ !entry.element.closest(`${INACTIVE_TAB}, [data-satin-covered="true"], [data-satin-glass-hold]`) &&
208
+ getComputedStyle(entry.element).visibility !== 'hidden';
209
+ const previous = this.readiness.get(entry.canvas);
210
+ if (previous?.entry.id === entry.id && previous.show === show) {
211
+ // React can replace a descriptor in one commit without replacing its glass owner.
212
+ // Keep both the elapsed budget and the history of an already-revealed show.
213
+ previous.entry = entry;
214
+ previous.visible = visible;
215
+ previous.deadline.setVisible(visible);
216
+ if (entry.canvas.dataset.satinGlassPresented !== 'true')
217
+ this.waitForRegion(previous);
218
+ continue;
219
+ }
220
+ previous?.deadline.cancel();
221
+ const presented = show !== undefined && entry.canvas.dataset.satinGlassPresentedShow === show;
222
+ delete entry.canvas.dataset.satinGlassPresented;
223
+ delete entry.canvas.dataset.satinGlassPresentedShow;
224
+ const pending = {
225
+ entry,
226
+ show,
227
+ presented,
228
+ visible,
229
+ failed: false,
230
+ deadline: new VisibleDeadline(GLASS_READINESS_BUDGET_MS, () => {
231
+ pending.failed = true;
232
+ reportGlassError('readiness-timeout', Error(`Glass region ${entry.id} was not presented within 10 s of visible time`), 'region-presentation');
233
+ }),
234
+ };
235
+ this.readiness.set(entry.canvas, pending);
236
+ pending.deadline.setVisible(visible);
237
+ this.waitForRegion(pending);
238
+ }
239
+ }
240
+ static SCENES_IN_FLIGHT = 2;
241
+ flushPendingScene() {
242
+ if (this.batch || this.scenesInFlight >= RegionBridge.SCENES_IN_FLIGHT)
243
+ return;
244
+ const next = this.pendingScene;
245
+ this.pendingScene = undefined;
246
+ if (next)
247
+ this.postScene(next);
248
+ }
249
+ sceneDone = () => {
250
+ this.scenesInFlight--;
251
+ this.flushPendingScene();
252
+ };
253
+ postScene(scene) {
254
+ if (this.sceneValidity.get(scene)?.() === false)
255
+ return;
256
+ if (this.scenesInFlight >= RegionBridge.SCENES_IN_FLIGHT) {
257
+ if (this.pendingScene)
258
+ glassTiming('region-scene-merged');
259
+ this.pendingScene = scene;
260
+ return;
261
+ }
262
+ this.scenesInFlight++;
263
+ void this.send(scene)
264
+ .then(receipt => this.scenePresented.get(scene)?.(receipt))
265
+ .catch(this.fail)
266
+ .finally(this.sceneDone);
267
+ }
268
+ /** A scene whose reply the caller needs (new presenters): sent now, superseding any queued scene. */
269
+ async sendScene(scene) {
270
+ this.scenesInFlight++;
271
+ try {
272
+ return await this.send(scene);
273
+ }
274
+ finally {
275
+ this.sceneDone();
276
+ }
277
+ }
278
+ /** Foreground source revisions. Unique per capture: a refresh superseded between its
279
+ * foreground send and its scene send must not hand the next capture the same key
280
+ * (the worker's frame graph treats a key as immutable content). */
281
+ foregroundRevision = 0;
282
+ epoch = 0;
283
+ serial = Promise.resolve();
284
+ canvases = new Map();
285
+ nextPresenter = 0;
286
+ foregrounds = new WeakMap();
287
+ dirtyForegrounds = new WeakSet();
288
+ unsubscribeContent;
289
+ deferredForegrounds = new Map();
290
+ foregroundInputs = new Map();
291
+ /** An idle lift is transparent; its labels remain live DOM while layout moves them. Keep
292
+ * the warm ink instead of rasterizing an invisible lens at every intermediate width. */
293
+ deferIdleForeground(entry) {
294
+ const interaction = this.registry?.interactions.get(entry.id);
295
+ if (interaction && interaction.phase !== 'rest')
296
+ return false;
297
+ if (!this.foregrounds.has(entry.element))
298
+ return false;
299
+ let scope = entry.element;
300
+ while (scope && !hasLayoutAnimation(scope))
301
+ scope = scope.parentElement;
302
+ if (!scope)
303
+ return false;
304
+ if (!this.deferredForegrounds.has(entry.id)) {
305
+ const layoutScope = scope;
306
+ const unsubscribe = observeAnimations(layoutScope, () => {
307
+ // Reversals replace the run on the same scope before the old promise settles.
308
+ if (hasLayoutAnimation(layoutScope))
309
+ return;
310
+ unsubscribe();
311
+ this.deferredForegrounds.delete(entry.id);
312
+ this.invalidate();
313
+ });
314
+ this.deferredForegrounds.set(entry.id, unsubscribe);
315
+ }
316
+ return true;
317
+ }
318
+ /** Regions seen in an unselected tab, with the panel they were seen in. One stays held after
319
+ * its tab is selected again, until the worker has installed that tab's source preparation
320
+ * (`sourceInstalled`): only then is its own backdrop installed, and only then may it be
321
+ * redrawn. A region moved into another panel is no longer the held one. */
322
+ heldForTab = new WeakMap();
323
+ /** Capture canvases whose bitmap is in a request that has not been sent yet. */
324
+ consumedCanvases = [];
325
+ /** Release capture canvases once the request that carries their bitmap has resolved. */
326
+ releaseConsumedCanvases() {
327
+ clearTimeout(this.releaseFallback);
328
+ this.releaseFallback = undefined;
329
+ releaseCaptureCanvases(this.consumedCanvases);
330
+ }
331
+ releaseFallback;
332
+ /** A worker that never answers the carrying request must not keep the canvases allocated. */
333
+ armReleaseFallback() {
334
+ this.releaseFallback ??= setTimeout(() => this.releaseConsumedCanvases(), CAPTURE_RELEASE_FALLBACK_MS);
335
+ }
336
+ /** The regions that sit in tabs that are not selected. A source preparation sends them with its
337
+ * batch: the worker holds them on their own backdrop before the new plane set replaces it, and
338
+ * resumes every other region in the same batch. Reading them changes nothing here. */
339
+ inactiveRegionIds() {
340
+ return (this.registry?.values() ?? [])
341
+ .filter(entry => entry.element.isConnected && !!entry.element.closest(INACTIVE_TAB))
342
+ .map(entry => entry.id);
343
+ }
344
+ /** The selected tab's own backdrop is installed in the worker: its regions stop being held. */
345
+ releaseHeldRegions() {
346
+ for (const entry of this.registry?.values() ?? [])
347
+ if (!entry.element.closest(INACTIVE_TAB))
348
+ this.heldForTab.delete(entry.element);
349
+ }
350
+ sourceRevision;
351
+ /** Invalidate in-flight geometry before posting the replacement capture batch. */
352
+ sourceWillChange(revision) {
353
+ this.sourceRevision = revision;
354
+ }
355
+ /** A source preparation posted its batch (`installed` is the worker's reply to it). Only once
356
+ * the worker has acknowledged it are the selected tab's regions released and their scene sent.
357
+ * If the worker rejects the batch, nothing was installed and nothing was resumed there: the
358
+ * holds stay, so those regions keep the frames they have (the rejection reaches the caller). */
359
+ async sourceInstalled(installed, appearance) {
360
+ const epoch = this.epoch;
361
+ await installed;
362
+ if (epoch !== this.epoch)
363
+ return;
364
+ this.releaseHeldRegions();
365
+ await this.sourceChanged(appearance);
366
+ }
367
+ scrolls = new WeakMap();
368
+ nextScroll = 0;
369
+ client;
370
+ constructor(client, appearance) {
371
+ this.client = client;
372
+ this.appearance = appearance;
373
+ }
374
+ batch;
375
+ send = async (request, transfer = []) => {
376
+ // Admission is not publication: a cancelled batch must preserve the parked scene.
377
+ if (this.batch &&
378
+ ['source', 'scene', 'appearance'].includes(request.type) &&
379
+ request.type !== 'transaction') {
380
+ this.batch.requests.push(request);
381
+ this.batch.transfer.push(...transfer);
382
+ return;
383
+ }
384
+ return this.client.request({ type: 'canonical', request }, transfer, () => {
385
+ // The client reports admission separately from acknowledgement: postMessage
386
+ // exceptions become rejected promises and must not retire the parked scene.
387
+ const scenes = request.type === 'transaction' ? request.requests : [request];
388
+ const pending = this.pendingScene;
389
+ if (pending?.type === 'scene' &&
390
+ scenes.some(operation => operation.type === 'scene' && operation.snapshot.revision >= pending.snapshot.revision))
391
+ this.pendingScene = undefined;
392
+ });
393
+ };
394
+ bind(registry, source) {
395
+ this.unbind();
396
+ this.presentationAllowed = true;
397
+ this.foregrounds = new WeakMap();
398
+ this.registry = registry;
399
+ this.source = source;
400
+ this.unsubscribe = registry?.subscribe(this.invalidate);
401
+ this.unsubscribeContent = registry?.subscribeContent(element => {
402
+ this.foregrounds.delete(element);
403
+ this.dirtyForegrounds.add(element);
404
+ });
405
+ this.unsubscribePresentation = registry?.subscribePresentation(this.invalidatePresentation);
406
+ this.unsubscribeInput = registry?.subscribeInput(interaction => {
407
+ const id = interaction.regionId;
408
+ const pending = this.foregroundInputs.get(id);
409
+ const entry = registry?.values().find(entry => entry.id === id);
410
+ const motion = entry && accessoryGlassMotion(entry.element);
411
+ if (motion && entry)
412
+ this.foregrounds.delete(entry.element);
413
+ const dirty = entry && this.dirtyForegrounds.has(entry.element);
414
+ if (!motion && !dirty && !pending && !this.deferredForegrounds.has(id)) {
415
+ void this.send({ type: 'interaction', interaction }).catch(this.fail);
416
+ return;
417
+ }
418
+ // A touch during layout needs ink at the current width before the lens lifts it.
419
+ // Keep a fast press/release pair in order while that one capture is in flight.
420
+ const epoch = this.epoch;
421
+ const next = (pending ?? Promise.resolve()).then(async () => {
422
+ if (epoch !== this.epoch)
423
+ return;
424
+ if (motion || dirty || this.deferredForegrounds.has(id))
425
+ await this.refresh();
426
+ if (epoch === this.epoch)
427
+ await this.send({ type: 'interaction', interaction });
428
+ });
429
+ this.foregroundInputs.set(id, next);
430
+ void next.then(() => {
431
+ if (this.foregroundInputs.get(id) === next)
432
+ this.foregroundInputs.delete(id);
433
+ }, this.fail);
434
+ });
435
+ this.unsubscribeEvents = this.client.onEvent(event => {
436
+ if (event.type === 'presentation-gate') {
437
+ this.presentationAllowed = event.allowed;
438
+ if (event.allowed)
439
+ this.invalidate();
440
+ else {
441
+ this.syncReadiness();
442
+ for (const [canvas, pending] of this.readiness) {
443
+ delete canvas.dataset.satinGlassPresented;
444
+ delete canvas.dataset.satinGlassPresentedShow;
445
+ this.waitForRegion(pending);
446
+ }
447
+ }
448
+ }
449
+ else if (event.type === 'accessory-ink') {
450
+ const entry = registry?.values().find(entry => entry.id === event.regionId);
451
+ const motion = entry && accessoryGlassMotion(entry.element);
452
+ if (motion?.track?.epoch === event.epoch)
453
+ motion.takeInk?.();
454
+ }
455
+ else if (event.type === 'emerge-settled')
456
+ registry?.emergeSettled(event.regionId, event.generation);
457
+ else if (event.type === 'field-motion')
458
+ registry?.fieldMotion(event);
459
+ else
460
+ registry?.emergeInk(event);
461
+ });
462
+ document.addEventListener('scroll', this.scrollInvalidated, true);
463
+ document.addEventListener('touchstart', this.rowContact, { capture: true, passive: true });
464
+ window.addEventListener('resize', this.invalidate);
465
+ window.addEventListener('satin-accessory-motion', this.invalidate);
466
+ window.addEventListener(GLASS_SHAPE_TRACK_EVENT, this.sendShapeTrack);
467
+ window.addEventListener('satin-presentation-motion', this.invalidate);
468
+ window.addEventListener(PRESENTATION_TRACK_EVENT, this.sendPresentationTrack);
469
+ this.invalidate();
470
+ }
471
+ // Cache at contact start, before scrolling. A row's horizontal scroll changes neither
472
+ // distant glass geometry nor its backdrop. Never measure those boxes on each move.
473
+ rowScrollImpact = new WeakMap();
474
+ rowContact = (event) => {
475
+ const source = event.target instanceof Element ? event.target.closest('[data-satin-row-scrub]') : null;
476
+ const row = source?.closest('[data-satin-row-actions]');
477
+ if (!source || !row || !this.registry)
478
+ return;
479
+ const bounds = row.getBoundingClientRect();
480
+ const affectsGlass = this.registry.values().some(entry => {
481
+ if (row.contains(entry.element))
482
+ return true;
483
+ const region = entry.element.getBoundingClientRect();
484
+ const inset = contextSampleInset(entry.descriptor.material.treatment);
485
+ return (bounds.left < region.right + inset &&
486
+ bounds.right > region.left - inset &&
487
+ bounds.top < region.bottom + inset &&
488
+ bounds.bottom > region.top - inset);
489
+ });
490
+ this.rowScrollImpact.set(source, affectsGlass);
491
+ };
492
+ scrollInvalidated = (event) => {
493
+ if (event.target instanceof Element && event.target.matches('[data-satin-row-scrub]')) {
494
+ if (this.rowScrollImpact.get(event.target) === false)
495
+ return;
496
+ }
497
+ else
498
+ this.rowScrollImpact = new WeakMap();
499
+ this.invalidate();
500
+ };
501
+ unsubscribeEvents;
502
+ viewportObservers = new Map();
503
+ viewportPending = new Map();
504
+ /** Keep the worker's old sample covered until it acknowledges its new viewport. A source
505
+ * installation can redraw that old viewport before the queued move reaches the worker. */
506
+ viewportSamples = new Map();
507
+ viewportInFlight = new Map();
508
+ presenterExtents = new Map();
509
+ retainPresenterExtent(id, bounds) {
510
+ const held = this.presenterExtents.get(id);
511
+ this.presenterExtents.set(id, {
512
+ width: Math.max(held?.width ?? 0, bounds.width),
513
+ height: Math.max(held?.height ?? 0, bounds.height),
514
+ });
515
+ }
516
+ viewportSending = new Set();
517
+ async updateViewport(id, viewport, rect, keyboard) {
518
+ this.viewportPending.set(id, { viewport, rect, keyboard });
519
+ if (this.viewportSending.has(id))
520
+ return;
521
+ this.viewportSending.add(id);
522
+ const epoch = this.epoch;
523
+ try {
524
+ while (epoch === this.epoch) {
525
+ const next = this.viewportPending.get(id);
526
+ if (!next)
527
+ break;
528
+ // Compositor-only movement bypasses scene refresh. Demand its actual scaled canvas
529
+ // envelope before this request, which can draw immediately in the renderer.
530
+ const covering = this.coverage?.(() => this.sampleRects());
531
+ if (covering)
532
+ await covering;
533
+ if (epoch !== this.epoch)
534
+ return;
535
+ if (this.viewportPending.get(id) !== next)
536
+ continue;
537
+ // This request can reach the worker even if a tab rebinds before its reply.
538
+ // Its sample belongs to the retained presenter, not the source binding.
539
+ this.viewportInFlight.set(id, next);
540
+ await this.send({
541
+ type: 'presenter-viewport',
542
+ id,
543
+ viewport: next.viewport,
544
+ keyboard: next.keyboard,
545
+ });
546
+ this.viewportSamples.set(id, next);
547
+ this.viewportInFlight.delete(id);
548
+ if (epoch !== this.epoch)
549
+ return;
550
+ if (this.viewportPending.get(id) === next)
551
+ this.viewportPending.delete(id);
552
+ }
553
+ }
554
+ finally {
555
+ this.viewportSending.delete(id);
556
+ const pending = this.viewportPending.get(id);
557
+ if (epoch !== this.epoch && this.registry && pending)
558
+ void this.updateViewport(id, pending.viewport, pending.rect, pending.keyboard).catch(this.fail);
559
+ }
560
+ }
561
+ unbind() {
562
+ this.epoch++;
563
+ this.unsubscribe?.();
564
+ this.unsubscribeContent?.();
565
+ this.unsubscribeContent = undefined;
566
+ this.dirtyForegrounds = new WeakSet();
567
+ this.unsubscribePresentation?.();
568
+ this.unsubscribeInput?.();
569
+ this.unsubscribeEvents?.();
570
+ this.unsubscribeEvents = undefined;
571
+ for (const observer of this.viewportObservers.values())
572
+ observer.dispose();
573
+ for (const unsubscribe of this.deferredForegrounds.values())
574
+ unsubscribe();
575
+ this.deferredForegrounds.clear();
576
+ this.foregroundInputs.clear();
577
+ this.viewportObservers.clear();
578
+ this.viewportPending.clear();
579
+ // The worker's canvases survive source rebinds. Forget their accepted sample
580
+ // only when detach-presenter retires them, or a newer viewport replaces it.
581
+ cancelAnimationFrame(this.frame);
582
+ this.frame = 0;
583
+ document.removeEventListener('scroll', this.scrollInvalidated, true);
584
+ document.removeEventListener('touchstart', this.rowContact, true);
585
+ window.removeEventListener('resize', this.invalidate);
586
+ window.removeEventListener('satin-accessory-motion', this.invalidate);
587
+ window.removeEventListener(GLASS_SHAPE_TRACK_EVENT, this.sendShapeTrack);
588
+ window.removeEventListener('satin-presentation-motion', this.invalidate);
589
+ window.removeEventListener(PRESENTATION_TRACK_EVENT, this.sendPresentationTrack);
590
+ this.registry = undefined;
591
+ this.navigationHold?.release();
592
+ this.navigationHold = undefined;
593
+ for (const pending of this.readiness.values())
594
+ pending.deadline.cancel();
595
+ this.readiness.clear();
596
+ this.rowScrollImpact = new WeakMap();
597
+ }
598
+ invalidateSources() {
599
+ this.epoch++;
600
+ this.foregrounds = new WeakMap();
601
+ cancelAnimationFrame(this.frame);
602
+ this.frame = 0;
603
+ }
604
+ fail = (error) => reportGlassError(glassFailureCode('app glass regions', error), error, 'app glass regions');
605
+ invalidatePresentation = () => {
606
+ this.queueReadiness();
607
+ if (this.presentationQueued || !this.registry || document.hidden)
608
+ return;
609
+ this.presentationQueued = true;
610
+ const epoch = this.epoch;
611
+ // React may unregister/register several descriptors in one commit. Read only the final
612
+ // committed geometry and keep the existing serial capture/upload ordering.
613
+ queueMicrotask(() => {
614
+ this.presentationQueued = false;
615
+ if (epoch !== this.epoch || !this.registry || document.hidden)
616
+ return;
617
+ cancelAnimationFrame(this.frame);
618
+ this.frame = 0;
619
+ void this.refresh().catch(this.fail);
620
+ });
621
+ };
622
+ /** A glass element started or ended a shape track: send it now, then refresh as usual. */
623
+ sendShapeTrack = (event) => {
624
+ const element = event.detail;
625
+ const entry = this.registry?.values().find(candidate => candidate.element === element);
626
+ if (!entry)
627
+ return;
628
+ const track = glassShapeTrack(element);
629
+ void this.send({ type: 'region-shape-track', regionId: entry.id, track }).catch(this.fail);
630
+ this.invalidate();
631
+ };
632
+ sendPresentationTrack = (event) => {
633
+ const element = event.detail;
634
+ const entry = this.registry?.values().find(candidate => candidate.element === element);
635
+ const motion = entry && presentationGlassMotion(element);
636
+ if (!entry || !motion?.admitted)
637
+ return;
638
+ void this.send({
639
+ type: 'region-presentation-track',
640
+ regionId: entry.id,
641
+ contentEpoch: motion.contentEpoch,
642
+ track: motion.track,
643
+ }).catch(this.fail);
644
+ };
645
+ invalidate = () => {
646
+ this.queueReadiness();
647
+ this.rowScrollImpact = new WeakMap();
648
+ if (this.frame || !this.registry || document.hidden)
649
+ return;
650
+ const requested = lagTraceEnabled() ? glassNow() : 0;
651
+ this.frame = requestAnimationFrame(() => {
652
+ this.frame = 0;
653
+ if (lagTraceEnabled())
654
+ lagMark({ stage: 'region-frame-wait', at: requested, ms: glassNow() - requested });
655
+ void this.refresh().catch(this.fail);
656
+ });
657
+ };
658
+ appearance;
659
+ /** The source owner's coverage check (`ProductionGlassRuntime.coverFor`): a promise while a
660
+ * capture of rows these regions newly sample is on its way. */
661
+ coverage;
662
+ /** Sample rectangles of the regions on screen, in viewport points (captureDemand.ts). */
663
+ sampleRects() {
664
+ const registry = this.registry;
665
+ if (!registry)
666
+ return [];
667
+ const frames = new Map();
668
+ const entries = registry.values().filter(entry => {
669
+ const frame = sceneRegionRect(entry);
670
+ if (frame)
671
+ frames.set(entry, frame);
672
+ return !!frame;
673
+ });
674
+ const rects = entries.flatMap(entry => {
675
+ const motion = presentationGlassMotion(entry.element) ?? accessoryGlassMotion(entry.element);
676
+ const inset = contextSampleInset(entry.descriptor.material.treatment);
677
+ const rect = motion
678
+ ? [
679
+ motion.sampleRect.x - inset,
680
+ motion.sampleRect.y - inset,
681
+ motion.sampleRect.width + 2 * inset,
682
+ motion.sampleRect.height + 2 * inset,
683
+ ]
684
+ : regionSampleRect(entry.element, entry.descriptor.material.treatment);
685
+ if (!rect)
686
+ return [];
687
+ // An emerging menu samples its trigger-to-panel envelope from the first frame,
688
+ // before a canvas observer or an acknowledged presenter can contribute demand.
689
+ const from = entry.descriptor.emerge?.from;
690
+ if (!from)
691
+ return [rect];
692
+ const left = Math.min(rect[0], from.x - inset);
693
+ const top = Math.min(rect[1], from.y - inset);
694
+ return [
695
+ [
696
+ left,
697
+ top,
698
+ Math.max(rect[0] + rect[2], from.x + from.width + inset) - left,
699
+ Math.max(rect[1] + rect[3], from.y + from.height + inset) - top,
700
+ ],
701
+ ];
702
+ });
703
+ const groups = new Map();
704
+ for (const entry of entries) {
705
+ if (!entry.descriptor.container || entry.element.dataset.satinMenuEmerged === 'true')
706
+ continue;
707
+ const key = glassFieldKey(entry.descriptor);
708
+ const group = groups.get(key) ?? [];
709
+ group.push(entry);
710
+ groups.set(key, group);
711
+ }
712
+ // The raster samples the retained field presenter, not just its current members. Blend
713
+ // support, envelope rounding and an earlier position can all extend beyond their bounds.
714
+ for (const group of groups.values()) {
715
+ group.sort((a, b) => a.id.localeCompare(b.id));
716
+ const first = group[0];
717
+ const container = registry.containers.get(first.descriptor.container.id);
718
+ if (!container)
719
+ continue;
720
+ const bounds = glassPresenterBounds(this.fieldEnvelope(container.element, group), contextSampleInset(first.descriptor.material.treatment), first.descriptor.emerge);
721
+ rects.push([bounds.x, bounds.y, bounds.width, bounds.height]);
722
+ }
723
+ // A scene and a compositor viewport are separate messages. Either can land first:
724
+ // retain each presenter's largest sample size at every accepted/in-flight origin.
725
+ // Merely unioning the old and new rectangles misses an upward-growing menu drawn
726
+ // with its old origin (and the reverse ordering while it shrinks).
727
+ for (const entry of entries) {
728
+ if (entry.descriptor.container)
729
+ continue;
730
+ const bounds = glassPresenterBounds(frames.get(entry), contextSampleInset(entry.descriptor.material.treatment), entry.descriptor.emerge);
731
+ for (const canvas of [entry.canvas, entry.overlay]) {
732
+ const presenter = canvas && this.canvases.get(canvas);
733
+ if (presenter)
734
+ this.retainPresenterExtent(presenter.id, bounds);
735
+ }
736
+ }
737
+ for (const samples of [this.viewportSamples, this.viewportInFlight, this.viewportPending]) {
738
+ for (const [id, { viewport, rect }] of samples) {
739
+ rects.push(rect);
740
+ const extent = this.presenterExtents.get(id);
741
+ if (extent)
742
+ rects.push([
743
+ viewport.x,
744
+ viewport.y,
745
+ extent.width * viewport.scaleX,
746
+ extent.height * viewport.scaleY,
747
+ ]);
748
+ }
749
+ }
750
+ return rects;
751
+ }
752
+ /** Whether the worker needs the root transmitted backdrop (it arrives with the shared capture). */
753
+ get needsBackdrop() {
754
+ return !!this.registry?.size;
755
+ }
756
+ /** Navigation chrome moves horizontally. Its backdrop only needs these viewport
757
+ * rows, including each material's sampling halo. Other glass keeps full capture. */
758
+ navigationCaptureRows(height) {
759
+ const entries = this.registry
760
+ ?.values()
761
+ .filter(e => e.element.isConnected &&
762
+ !e.element.closest('[data-satin-covered="true"],[data-satin-tab-active="false"]')) ?? [];
763
+ // The adaptive top tab bar is fixed during navigation too. Bottom docks use
764
+ // their own source path; arbitrary content glass must retain the full viewport.
765
+ const fixedChrome = '[data-satin-navigation-chrome],[data-satin-tab-bar][data-satin-tab-placement="top"]';
766
+ if (!entries.length ||
767
+ entries.some(e => !e.element.closest(fixedChrome) || e.descriptor.emerge))
768
+ return { top: 0, height };
769
+ let top = height, bottom = 0;
770
+ // The canvas halo scales with press/viewport motion. Keep the worker's accepted
771
+ // rectangle and the pending rectangle, as well as current control geometry.
772
+ for (const [, y, , sampleHeight] of this.sampleRects()) {
773
+ top = Math.min(top, y - DEMAND_MARGIN_POINTS);
774
+ bottom = Math.max(bottom, y + sampleHeight + DEMAND_MARGIN_POINTS);
775
+ }
776
+ top = Math.max(0, Math.floor(top));
777
+ bottom = Math.min(height, Math.ceil(bottom));
778
+ return bottom > top ? { top, height: bottom - top } : { top: 0, height };
779
+ }
780
+ /** The root capture changed in the worker (shared slot). Scene and foreground
781
+ * updates apply as one transaction; foregrounds are keyed by their own ink and
782
+ * appearance, so only regions whose ink changed are recaptured. */
783
+ setAppearance(appearance) {
784
+ if (appearance !== this.appearance)
785
+ this.invalidateSources();
786
+ this.appearance = appearance;
787
+ // Appearance is urgent: do not wait for a source-capture transaction.
788
+ void this.client
789
+ .request({
790
+ type: 'canonical',
791
+ request: {
792
+ type: 'appearance',
793
+ value: appearance,
794
+ reducedMotion: matchMedia('(prefers-reduced-motion: reduce)').matches,
795
+ },
796
+ })
797
+ .catch(error => reportGlassError(glassFailureCode('appearance', error), error, 'appearance'));
798
+ }
799
+ sourceChanged(appearance) {
800
+ this.appearance = appearance;
801
+ const epoch = this.epoch;
802
+ return this.enqueue(async () => {
803
+ if (epoch !== this.epoch)
804
+ return;
805
+ const registry = this.registry;
806
+ const snapshotVersion = registry?.snapshotVersion;
807
+ const sourceRevision = this.sourceRevision;
808
+ const navigationEpoch = this.navigationEpoch;
809
+ const batch = (this.batch = {
810
+ requests: [],
811
+ transfer: [],
812
+ presented: [],
813
+ });
814
+ let committed = false;
815
+ try {
816
+ // The source preparation that sent this refresh holds the capture queue: waiting for
817
+ // another capture here would wait for itself.
818
+ await this.refreshNow(epoch, false);
819
+ if (epoch !== this.epoch ||
820
+ registry !== this.registry ||
821
+ snapshotVersion !== registry?.snapshotVersion ||
822
+ sourceRevision !== this.sourceRevision ||
823
+ navigationEpoch !== this.navigationEpoch)
824
+ return;
825
+ this.batch = undefined;
826
+ const receipt = batch.requests.length
827
+ ? await this.send({ type: 'transaction', requests: batch.requests }, batch.transfer)
828
+ : undefined;
829
+ committed = true;
830
+ if (epoch === this.epoch)
831
+ for (const acknowledge of batch.presented)
832
+ acknowledge(receipt);
833
+ }
834
+ finally {
835
+ // A cancelled refresh has not transferred its bitmaps; recapture them next time.
836
+ if (!committed) {
837
+ for (const request of batch.requests)
838
+ if (request.type === 'source')
839
+ request.bitmap.close();
840
+ this.foregrounds = new WeakMap();
841
+ this.inkAtlases = new WeakMap();
842
+ }
843
+ this.batch = undefined;
844
+ this.flushPendingScene();
845
+ this.releaseConsumedCanvases();
846
+ }
847
+ });
848
+ }
849
+ enqueue(work) {
850
+ this.serial = this.serial.then(work, work);
851
+ return this.serial;
852
+ }
853
+ navigationEpoch = 0;
854
+ navigationHold;
855
+ holdNavigation() {
856
+ this.navigationEpoch++;
857
+ this.navigationHold?.release();
858
+ let release;
859
+ const hold = {
860
+ promise: new Promise(resolve => {
861
+ release = resolve;
862
+ }),
863
+ release: () => release(),
864
+ };
865
+ this.navigationHold = hold;
866
+ return () => {
867
+ if (this.navigationHold === hold)
868
+ this.navigationHold = undefined;
869
+ hold.release();
870
+ };
871
+ }
872
+ async refresh() {
873
+ const epoch = this.epoch;
874
+ await this.navigationHold?.promise;
875
+ // Waiting inside serial would block sourceChanged behind the very scene asking for
876
+ // new source pixels. Keep the source/scene transaction queue free during capture.
877
+ await this.coverage?.(() => this.sampleRects());
878
+ if (epoch !== this.epoch)
879
+ return;
880
+ return this.enqueue(() => this.refreshNow(epoch, false));
881
+ }
882
+ async admitNavigation(key) {
883
+ const epoch = this.epoch;
884
+ await this.enqueue(async () => {
885
+ if (epoch !== this.epoch)
886
+ throw new DOMException('Navigation source superseded', 'AbortError');
887
+ this.navigationReceipt = key;
888
+ try {
889
+ for (let attempt = 0; attempt < 3; attempt++) {
890
+ // A stale snapshot may return before sending a scene. Only a validated draw
891
+ // receipt below can admit motion; every early return must retry.
892
+ this.navigationRetry = true;
893
+ await this.refreshNow(epoch, false);
894
+ if (!this.navigationRetry)
895
+ return;
896
+ }
897
+ throw Error(`Navigation ${key} region registrations did not stabilize`);
898
+ }
899
+ finally {
900
+ this.navigationReceipt = undefined;
901
+ }
902
+ });
903
+ }
904
+ navigationReceipt;
905
+ navigationRetry = false;
906
+ /** Captured menu ink by content key, most recent last (see INK_CAPTURES_RETAINED). */
907
+ inkCaptures = new Map();
908
+ /** The ink key whose capture failed for an element (not retried until its content changes). */
909
+ inkFailures = new WeakMap();
910
+ inkAtlases = new WeakMap();
911
+ /** An emerging menu's ink: its rows and its trigger's glyph, captured once per content change
912
+ * into one foreground atlas (sent as the region's foreground source) and placed each refresh at
913
+ * their live settled rectangles. The glass draws them until the page's rows take over. */
914
+ async emergeInk(entry, layerId, current) {
915
+ const rowsElement = entry.element.querySelector('[data-satin-menu-ink]');
916
+ const source = entry.descriptor.emerge?.sourceRegionId;
917
+ const triggerMaterial = source
918
+ ? document.querySelector(`[data-satin-glass-region-id="${CSS.escape(source)}"]`)
919
+ : null;
920
+ const triggerElement = triggerMaterial ? toolbarMaterialContent(triggerMaterial) : null;
921
+ const triggerContents = toolbarMenuContents(triggerElement);
922
+ if (!rowsElement && !triggerElement)
923
+ return undefined;
924
+ const apertureTrack = triggerMaterial ? glassShapeTrack(triggerMaterial) : undefined;
925
+ const apertureAt = shapeTrackClock();
926
+ const snapshotId = entry.descriptor.emerge?.sourceSnapshot;
927
+ const snapshot = triggerMaterial ? menuTriggerSnapshot(triggerMaterial, snapshotId) : undefined;
928
+ if (snapshotId !== undefined && !snapshot)
929
+ return undefined;
930
+ const capturedPose = snapshot && triggerMaterial
931
+ ? mapTriggerSnapshot(snapshot, layoutRect(triggerMaterial))
932
+ : undefined;
933
+ const captureContents = snapshot?.members.map(member => member.element) ?? triggerContents;
934
+ const captureCurrent = () => current() &&
935
+ (!triggerMaterial ||
936
+ (triggerMaterial.isConnected &&
937
+ (snapshot
938
+ ? menuTriggerSnapshot(triggerMaterial, snapshotId) === snapshot
939
+ : glassShapeTrack(triggerMaterial) === apertureTrack)));
940
+ const rowsRect = rowsElement ? layoutRect(rowsElement) : undefined, triggerRect = triggerElement
941
+ ? (capturedPose?.aperture ??
942
+ (apertureTrack && triggerMaterial
943
+ ? glassApertureInFrame(triggerMaterial, layoutRect(triggerMaterial), apertureAt)
944
+ : layoutRect(triggerContents.length > 1 ? triggerMaterial : triggerElement)))
945
+ : undefined;
946
+ const triggerGeometry = capturedPose?.members ??
947
+ (apertureTrack
948
+ ? triggerContents.map(element => foregroundGeometry(element, DOMRect.fromRect(layoutRect(element))))
949
+ : undefined);
950
+ const style = getComputedStyle(entry.element);
951
+ const key = JSON.stringify([
952
+ rowsRect && [rowsRect.width, rowsRect.height, inkSignature(rowsElement)],
953
+ rowsElement?.textContent,
954
+ triggerRect && [
955
+ triggerRect.width,
956
+ triggerRect.height,
957
+ captureContents.map((element, index) => {
958
+ const rect = triggerGeometry?.[index]?.bounds ?? layoutRect(element);
959
+ return [
960
+ rect.x - triggerRect.x,
961
+ rect.y - triggerRect.y,
962
+ rect.width,
963
+ rect.height,
964
+ inkSignature(element, PRESS_STATE_ATTRIBUTES),
965
+ ];
966
+ }),
967
+ ],
968
+ style.font,
969
+ style.color,
970
+ this.appearance,
971
+ ]);
972
+ let atlas = this.inkAtlases.get(entry.element);
973
+ if (this.inkFailures.get(entry.element) === key)
974
+ return undefined;
975
+ // Selection can move a radio check in the same commit that starts closing.
976
+ // Closing must capture that content too; the ink root's inert state is not in the key.
977
+ if (!atlas || atlas.key !== key) {
978
+ const resolution = devicePixelRatio;
979
+ // Each open mounts a new panel; unchanged content reuses its capture (13 ms on Catalyst)
980
+ // and only sends it again under the new region.
981
+ let captured = this.inkCaptures.get(key);
982
+ if (!captured) {
983
+ let images;
984
+ try {
985
+ images = await glassTimedAsync('menu-ink-capture', () => Promise.all([
986
+ rowsElement
987
+ ? captureRegionForeground(rowsElement, resolution, INK_PADDING)
988
+ : undefined,
989
+ triggerRect
990
+ ? captureMenuTrigger(captureContents, triggerRect, resolution, triggerGeometry)
991
+ : undefined,
992
+ ]));
993
+ }
994
+ catch (error) {
995
+ if (!captureCurrent())
996
+ return undefined;
997
+ // Content the atlas cannot draw must never blank the menu: the morph runs without ink
998
+ // and the page shows its live rows at once.
999
+ this.inkFailures.set(entry.element, key);
1000
+ console.warn('Glass menu ink capture failed; showing the live rows.', error);
1001
+ const emerge = entry.descriptor.emerge;
1002
+ if (emerge && !emerge.closing)
1003
+ this.registry?.emergeInk({
1004
+ type: 'emerge-ink',
1005
+ regionId: entry.id,
1006
+ generation: emerge.generation,
1007
+ phase: 'open-settled',
1008
+ });
1009
+ return undefined;
1010
+ }
1011
+ if (!captureCurrent())
1012
+ return undefined;
1013
+ const [rows, glyph] = images;
1014
+ const canvas = document.createElement('canvas');
1015
+ canvas.width = Math.max(1, (rows?.width ?? 0) + (glyph?.width ?? 0));
1016
+ canvas.height = Math.max(1, rows?.height ?? 0, glyph?.height ?? 0);
1017
+ const context = canvas.getContext('2d');
1018
+ if (rows)
1019
+ context.drawImage(rows, 0, 0);
1020
+ if (glyph)
1021
+ context.drawImage(glyph, rows?.width ?? 0, 0);
1022
+ captured = {
1023
+ canvas,
1024
+ layout: {
1025
+ key,
1026
+ atlas: { width: canvas.width / resolution, height: canvas.height / resolution },
1027
+ rows: rows && {
1028
+ x: 0,
1029
+ y: 0,
1030
+ width: rows.width / resolution,
1031
+ height: rows.height / resolution,
1032
+ },
1033
+ glyph: glyph && {
1034
+ x: (rows?.width ?? 0) / resolution,
1035
+ y: 0,
1036
+ width: glyph.width / resolution,
1037
+ height: glyph.height / resolution,
1038
+ },
1039
+ },
1040
+ };
1041
+ this.inkCaptures.delete(key);
1042
+ this.inkCaptures.set(key, captured);
1043
+ for (const stale of [...this.inkCaptures.keys()].slice(0, -INK_CAPTURES_RETAINED))
1044
+ this.inkCaptures.delete(stale);
1045
+ }
1046
+ const bitmap = await createImageBitmap(captured.canvas);
1047
+ if (!captureCurrent()) {
1048
+ bitmap.close();
1049
+ return undefined;
1050
+ }
1051
+ await this.send({
1052
+ type: 'source',
1053
+ source: {
1054
+ id: `foreground:${entry.id}`,
1055
+ regionId: entry.id,
1056
+ revision: ++this.foregroundRevision,
1057
+ layerId,
1058
+ role: 'foreground',
1059
+ origin: { x: 0, y: 0 },
1060
+ width: bitmap.width / resolution,
1061
+ height: bitmap.height / resolution,
1062
+ resolution,
1063
+ },
1064
+ bitmap,
1065
+ }, [bitmap]);
1066
+ atlas = captured.layout;
1067
+ if (captureCurrent())
1068
+ this.inkAtlases.set(entry.element, atlas);
1069
+ }
1070
+ if (!captureCurrent())
1071
+ return undefined;
1072
+ const placed = (source, rect) => source && rect
1073
+ ? {
1074
+ source,
1075
+ frame: {
1076
+ x: rect.x - INK_PADDING,
1077
+ y: rect.y - INK_PADDING,
1078
+ width: source.width,
1079
+ height: source.height,
1080
+ },
1081
+ }
1082
+ : undefined;
1083
+ return {
1084
+ atlas: atlas.atlas,
1085
+ rows: placed(atlas.rows, rowsRect),
1086
+ glyph: placed(atlas.glyph, triggerRect),
1087
+ };
1088
+ }
1089
+ fieldEnvelopes = new WeakMap();
1090
+ fieldEnvelope(container, entries, measuredFrames) {
1091
+ const holder = layoutRect(container);
1092
+ const frames = measuredFrames ?? entries.map(entry => layoutRect(entry.element));
1093
+ const support = (Math.max(0, (entries[0]?.descriptor.container?.spacing ?? 0) - 0.5) *
1094
+ Math.max(0, entries.length - 1)) /
1095
+ 4;
1096
+ const left = Math.min(...frames.map(frame => frame.x)) - holder.x - support;
1097
+ const top = Math.min(...frames.map(frame => frame.y)) - holder.y - support;
1098
+ const right = Math.max(...frames.map(frame => frame.x + frame.width)) - holder.x + support;
1099
+ const bottom = Math.max(...frames.map(frame => frame.y + frame.height)) - holder.y + support;
1100
+ const previous = this.fieldEnvelopes.get(container);
1101
+ // Grow in whole steps: members following a live layout transition move every frame, and
1102
+ // each envelope change reallocates the presenter's sampling storage.
1103
+ const step = FIELD_ENVELOPE_STEP;
1104
+ const x = Math.min(Math.floor(left / step) * step, previous?.x ?? Infinity);
1105
+ const y = Math.min(Math.floor(top / step) * step, previous?.y ?? Infinity);
1106
+ const envelope = {
1107
+ x,
1108
+ y,
1109
+ width: Math.max(Math.ceil(right / step) * step, previous ? previous.x + previous.width : -Infinity) - x,
1110
+ height: Math.max(Math.ceil(bottom / step) * step, previous ? previous.y + previous.height : -Infinity) - y,
1111
+ };
1112
+ // Retain the observed sweep, rather than resize an attachment on every spring sample.
1113
+ this.fieldEnvelopes.set(container, envelope);
1114
+ return { ...envelope, x: holder.x + x, y: holder.y + y };
1115
+ }
1116
+ async refreshNow(epoch, waitForCoverage = true) {
1117
+ const started = glassNow();
1118
+ try {
1119
+ await this.refreshScene(epoch, waitForCoverage);
1120
+ }
1121
+ catch (error) {
1122
+ if (!(error instanceof SupersededImage))
1123
+ throw error;
1124
+ // A displayed image retired while foreground ink was being prepared.
1125
+ // Keep the accepted scene and retry the current DOM, just like the backdrop.
1126
+ this.navigationRetry = true;
1127
+ this.invalidate();
1128
+ }
1129
+ finally {
1130
+ glassTiming('region-refresh', started);
1131
+ }
1132
+ }
1133
+ async refreshScene(epoch, waitForCoverage) {
1134
+ const registry = this.registry;
1135
+ if (!registry)
1136
+ return;
1137
+ const navigationEpoch = this.navigationEpoch;
1138
+ const navigationHold = this.navigationHold;
1139
+ const navigationReceipt = this.navigationReceipt;
1140
+ const navigationCurrent = () => this.navigationEpoch === navigationEpoch &&
1141
+ this.navigationHold === navigationHold &&
1142
+ this.navigationReceipt === navigationReceipt;
1143
+ if (navigationHold && !navigationReceipt)
1144
+ return;
1145
+ // Glass that samples rows no capture holds yet waits for one: it is never drawn from a
1146
+ // backdrop that does not cover it.
1147
+ const covering = this.coverage?.(() => this.sampleRects());
1148
+ if (covering && !waitForCoverage) {
1149
+ if (this.navigationReceipt) {
1150
+ void covering.catch(this.fail);
1151
+ throw Error(`Navigation ${this.navigationReceipt} has uncovered source rows`);
1152
+ }
1153
+ // A capture that covers it is scheduled; a refresh of its own waits for that one.
1154
+ void covering.then(this.invalidate, this.fail);
1155
+ return;
1156
+ }
1157
+ if (covering) {
1158
+ await covering;
1159
+ if (epoch !== this.epoch || registry !== this.registry || !navigationCurrent())
1160
+ return;
1161
+ }
1162
+ this.syncReadiness();
1163
+ const snapshotVersion = registry.snapshotVersion;
1164
+ const sourceRevision = this.sourceRevision;
1165
+ const sheetTracks = registry
1166
+ .values()
1167
+ .map(entry => [entry.element, presentationGlassMotion(entry.element)?.track]);
1168
+ const accessoryTracks = registry
1169
+ .values()
1170
+ .map(entry => [entry.element, accessoryGlassMotion(entry.element)?.viewportTrack]);
1171
+ const motionTracksCurrent = () => sheetTracks.every(([element, track]) => presentationGlassMotion(element)?.track === track) &&
1172
+ accessoryTracks.every(([element, track]) => accessoryGlassMotion(element)?.viewportTrack === track);
1173
+ const current = () => epoch === this.epoch &&
1174
+ registry === this.registry &&
1175
+ snapshotVersion === registry.snapshotVersion &&
1176
+ sourceRevision === this.sourceRevision &&
1177
+ navigationCurrent() &&
1178
+ motionTracksCurrent();
1179
+ if (!current())
1180
+ return;
1181
+ // Presenter registration and foreground capture await the worker. This microtask runs only if
1182
+ // the refresh yields to one of them before it submits (see the coverage recheck below).
1183
+ let yielded = false;
1184
+ queueMicrotask(() => {
1185
+ yielded = true;
1186
+ });
1187
+ const registered = new Set([...registry.containers.values()]
1188
+ .map(c => c.canvas)
1189
+ .concat(registry.values().flatMap(e => (e.overlay ? [e.canvas, e.overlay] : [e.canvas]))));
1190
+ // An unselected tab's regions stay in the scene, held (see `held` below): their presenters keep
1191
+ // the pixels of their own tab instead of being cleared and redrawn over another tab's backdrop.
1192
+ const regionRects = new Map();
1193
+ const entries = registry.values().filter(entry => {
1194
+ const rect = sceneRegionRect(entry);
1195
+ if (!rect) {
1196
+ this.foregrounds.delete(entry.element);
1197
+ return false;
1198
+ }
1199
+ regionRects.set(entry, rect);
1200
+ return true;
1201
+ });
1202
+ // A container canvas is outside each member: CSS opacity alone cannot hide an emerged source.
1203
+ // Keep its scene descriptor for trigger ink while the menu owns its material.
1204
+ const drawableEntries = entries.filter(entry => !entry.descriptor.container || entry.element.dataset.satinMenuEmerged !== 'true');
1205
+ const drawableIds = new Set(drawableEntries.map(entry => entry.id));
1206
+ const groups = new Map();
1207
+ for (const entry of drawableEntries) {
1208
+ if (!entry.descriptor.container)
1209
+ continue;
1210
+ const d = entry.descriptor, key = glassFieldKey(d);
1211
+ const group = groups.get(key) ?? [];
1212
+ group.push(entry);
1213
+ groups.set(key, group);
1214
+ }
1215
+ for (const warning of glassUnionDiagnostics(entries.map(entry => entry.descriptor))) {
1216
+ if (!this.unionWarnings.has(warning)) {
1217
+ this.unionWarnings.add(warning);
1218
+ console.warn(warning);
1219
+ }
1220
+ }
1221
+ for (const group of groups.values())
1222
+ group.sort((a, b) => a.id.localeCompare(b.id));
1223
+ const grouped = new Map(drawableEntries
1224
+ .filter(e => e.descriptor.container)
1225
+ .map(entry => [entry.id, [...groups.values()].find(g => g.includes(entry))]));
1226
+ const containerUse = new Set();
1227
+ const groupCanvases = new Map();
1228
+ for (const group of groups.values()) {
1229
+ const token = group[0].descriptor.container.id, container = registry.containers.get(token);
1230
+ const canvas = container && !containerUse.has(token) ? container.canvas : group[0].canvas;
1231
+ containerUse.add(token);
1232
+ groupCanvases.set(group[0].id, canvas);
1233
+ }
1234
+ const active = new Set([
1235
+ ...groupCanvases.values(),
1236
+ ...entries
1237
+ .filter(e => !e.descriptor.container)
1238
+ .flatMap(e => (e.overlay ? [e.canvas, e.overlay] : [e.canvas])),
1239
+ ]), scrolls = new Map(), regions = [];
1240
+ if (this.source) {
1241
+ const bounds = this.source.getBoundingClientRect();
1242
+ scrolls.set('webgpu-source-root', {
1243
+ id: 'webgpu-source-root',
1244
+ offsetX: this.source.scrollLeft,
1245
+ offsetY: this.source.scrollTop,
1246
+ viewportX: bounds.x,
1247
+ viewportY: bounds.y,
1248
+ width: bounds.width,
1249
+ height: bounds.height,
1250
+ });
1251
+ }
1252
+ for (const [canvas, presenter] of this.canvases)
1253
+ if (!registered.has(canvas)) {
1254
+ this.viewportObservers.get(canvas)?.dispose();
1255
+ this.viewportObservers.delete(canvas);
1256
+ this.viewportPending.delete(presenter.id);
1257
+ await this.send({ type: 'detach-presenter', id: presenter.id });
1258
+ this.viewportSamples.delete(presenter.id);
1259
+ this.presenterExtents.delete(presenter.id);
1260
+ this.viewportInFlight.delete(presenter.id);
1261
+ this.canvases.delete(canvas);
1262
+ }
1263
+ const generations = new Map(entries.map(entry => [entry.canvas, entry.canvas.dataset.satinGlassShow]));
1264
+ const registrations = this.navigationReceipt
1265
+ ? new Map(entries.map(entry => [entry, entry.descriptor]))
1266
+ : undefined;
1267
+ const presented = [];
1268
+ let presenting = !!this.navigationReceipt;
1269
+ // One top-layer order for every region in this scene.
1270
+ const topLayerDialogs = orderedTopLayerDialogs(document);
1271
+ for (const entry of entries) {
1272
+ if (!current())
1273
+ return;
1274
+ if (!entry.element.isConnected)
1275
+ continue;
1276
+ const sheetMotion = presentationGlassMotion(entry.element);
1277
+ const sheetTrack = sheetMotion?.track;
1278
+ const accessoryTrack = accessoryGlassMotion(entry.element)?.viewportTrack;
1279
+ if (accessoryTrack && this.accessoryAdmissions.get(entry.canvas) !== accessoryTrack)
1280
+ presenting = true;
1281
+ if (sheetMotion && !sheetMotion.admitted)
1282
+ presenting = true;
1283
+ if (entry.canvas.dataset.satinGlassPresented !== 'true')
1284
+ presenting = true;
1285
+ const inset = contextSampleInset(entry.descriptor.material.treatment);
1286
+ const rect = regionRects.get(entry);
1287
+ const generation = generations.get(entry.canvas);
1288
+ const readiness = this.readiness.get(entry.canvas);
1289
+ if (readiness)
1290
+ this.waitForRegion(readiness);
1291
+ presented.push(receipt => {
1292
+ // A deferred scene leaves the previous coherent pixels in place. It cannot
1293
+ // acknowledge a new show, or revoke the existing show's presentation.
1294
+ if (receipt && typeof receipt === 'object' && 'superseded' in receipt && receipt.superseded)
1295
+ return;
1296
+ if (!current() || this.readiness.get(entry.canvas) !== readiness)
1297
+ return;
1298
+ if (!this.presentationAllowed ||
1299
+ !receipt ||
1300
+ typeof receipt !== 'object' ||
1301
+ !('presented' in receipt) ||
1302
+ !Array.isArray(receipt.presented) ||
1303
+ !receipt.presented.includes(entry.id)) {
1304
+ delete entry.canvas.dataset.satinGlassPresented;
1305
+ delete entry.canvas.dataset.satinGlassPresentedShow;
1306
+ if (readiness)
1307
+ this.waitForRegion(readiness);
1308
+ return;
1309
+ }
1310
+ if (entry.element.isConnected && entry.canvas.dataset.satinGlassShow === generation) {
1311
+ if (readiness) {
1312
+ readiness.presented = true;
1313
+ readiness.deadline.cancel();
1314
+ }
1315
+ entry.canvas.dataset.satinGlassPresented = 'true';
1316
+ if (accessoryTrack)
1317
+ this.accessoryAdmissions.set(entry.canvas, accessoryTrack);
1318
+ else
1319
+ this.accessoryAdmissions.delete(entry.canvas);
1320
+ if (sheetMotion && sheetTrack)
1321
+ sheetMotion.acknowledge(sheetTrack);
1322
+ if (generation !== undefined)
1323
+ entry.canvas.dataset.satinGlassPresentedShow = generation;
1324
+ }
1325
+ });
1326
+ const requested = entry.descriptor.layer, scroll = requested?.attachment.kind === 'fixed'
1327
+ ? null
1328
+ : entry.element.closest('[data-satin-scroll]');
1329
+ let scrollId;
1330
+ if (scroll) {
1331
+ scrollId = this.scrolls.get(scroll);
1332
+ if (!scrollId) {
1333
+ scrollId = `webgpu-scroll-${++this.nextScroll}`;
1334
+ this.scrolls.set(scroll, scrollId);
1335
+ }
1336
+ const bounds = zoomRestRect(scroll) ?? atRest(scroll.getBoundingClientRect(), presentationTravel(scroll));
1337
+ scrolls.set(scrollId, {
1338
+ id: scrollId,
1339
+ offsetX: scroll.scrollLeft,
1340
+ offsetY: scroll.scrollTop,
1341
+ viewportX: bounds.x,
1342
+ viewportY: bounds.y,
1343
+ width: bounds.width,
1344
+ height: bounds.height,
1345
+ });
1346
+ }
1347
+ const layer = {
1348
+ id: requested ? `${requested.id}:${scrollId ?? 'fixed'}` : (scrollId ?? 'glass-fixed'),
1349
+ depth: requested?.depth ?? 0,
1350
+ attachment: scrollId ? { kind: 'scroll', scrollId } : { kind: 'fixed' },
1351
+ };
1352
+ const owner = scrollId ? scrolls.get(scrollId) : undefined;
1353
+ if (entry.descriptor.emerge && scrollId)
1354
+ throw Error('Glass emerge requires a fixed layer');
1355
+ // An inactive tab keeps its layout (visibility: hidden), so its regions still measure. They
1356
+ // are not on screen: the worker keeps their last pixels and does not redraw them. Selected
1357
+ // again, a region stays held until its own tab's backdrop is installed.
1358
+ const inactive = !!entry.element.closest(INACTIVE_TAB);
1359
+ const panel = entry.element.closest(TAB_PANEL);
1360
+ if (inactive && panel)
1361
+ this.heldForTab.set(entry.element, panel);
1362
+ // Moved into another panel (or out of every panel) since it was held: a different place.
1363
+ else if (this.heldForTab.get(entry.element) !== panel)
1364
+ this.heldForTab.delete(entry.element);
1365
+ const held = inactive || this.heldForTab.has(entry.element);
1366
+ // A held region's ink is captured when it resumes.
1367
+ const ink = entry.descriptor.emerge && !held
1368
+ ? await this.emergeInk(entry, layer.id, current)
1369
+ : undefined;
1370
+ if (!current())
1371
+ return;
1372
+ regions.push({
1373
+ ...entry.descriptor,
1374
+ zoomRoute: (() => {
1375
+ const host = entry.element.closest('[data-satin-navigator-host]');
1376
+ const navigation = host ? navigationGlassState(host) : undefined;
1377
+ if (!navigation?.active || !navigation.zoom)
1378
+ return undefined;
1379
+ const index = navigation.routes.findIndex(route => route.motion.contains(entry.element));
1380
+ return index >= 0 ? index : undefined;
1381
+ })(),
1382
+ presentationViewportTrack: sheetTrack,
1383
+ presentationContentEpoch: presentationGlassContentEpoch(entry.element),
1384
+ accessoryViewportTrack: accessoryTrack,
1385
+ accessoryTrack: accessoryGlassMotion(entry.element)?.track,
1386
+ shapeTrack: glassShapeTrack(entry.element),
1387
+ accessoryReach: layerFrame(accessoryReach(entry.element), owner),
1388
+ ...(ink && entry.descriptor.emerge ? { emerge: { ...entry.descriptor.emerge, ink } } : {}),
1389
+ container: entry.descriptor.container
1390
+ ? {
1391
+ ...entry.descriptor.container,
1392
+ continuous: registry.containers.get(entry.descriptor.container.id)?.continuous,
1393
+ }
1394
+ : undefined,
1395
+ sheetOpaqueMix: Number(entry.element.style.getPropertyValue('--satin-sheet-opaque-mix')) || 0,
1396
+ popoverArrow: popoverArrow(entry.element, rect),
1397
+ ...(entry.element.closest('[data-satin-menu-panel]') ? { inMenuPanel: true } : {}),
1398
+ backdropExclusions: backdropExclusions(entry.element, !!entry.descriptor.material.treatment, topLayerDialogs),
1399
+ layer,
1400
+ frame: {
1401
+ x: rect.x - (owner?.viewportX ?? 0) + (owner?.offsetX ?? 0),
1402
+ y: rect.y - (owner?.viewportY ?? 0) + (owner?.offsetY ?? 0),
1403
+ width: rect.width,
1404
+ height: rect.height,
1405
+ },
1406
+ ...(held ? { suspended: true } : {}),
1407
+ });
1408
+ if (!drawableIds.has(entry.id))
1409
+ continue;
1410
+ // A region that emerges from a trigger presents over both rectangles (fixed layer: viewport points).
1411
+ const group = grouped.get(entry.id);
1412
+ if (group && group[0] !== entry)
1413
+ continue;
1414
+ const container = entry.descriptor.container
1415
+ ? registry.containers.get(entry.descriptor.container.id)
1416
+ : undefined;
1417
+ const groupCanvas = groupCanvases.get(entry.id);
1418
+ const holder = container ? layoutRect(container.element) : rect;
1419
+ const canvasHolder = container && groupCanvas === container.canvas ? holder : rect;
1420
+ const fieldHolder = container && group
1421
+ ? this.fieldEnvelope(container.element, group, group.map(member => regionRects.get(member)))
1422
+ : holder;
1423
+ // A held-still accessory canvas covers every place its glass goes (accessoryReach).
1424
+ const reach = accessoryReach(entry.element);
1425
+ const bounds = glassPresenterBounds(reach ? frameUnion(fieldHolder, reach) : fieldHolder, inset, entry.descriptor.emerge);
1426
+ const regionIds = group?.map(e => e.id) ?? [entry.id];
1427
+ for (const [canvas, role] of [
1428
+ [groupCanvas ?? entry.canvas, 'material'],
1429
+ [group ? undefined : entry.overlay, 'lift'],
1430
+ ]) {
1431
+ if (!canvas)
1432
+ continue;
1433
+ let known = this.canvases.get(canvas);
1434
+ if (known && known.layerId !== layer.id)
1435
+ throw Error('Unsupported glass presenter layer reassignment');
1436
+ if (!known) {
1437
+ const id = `app-presenter-${++this.nextPresenter}`, presenter = {
1438
+ id,
1439
+ role,
1440
+ layerId: layer.id,
1441
+ regionIds,
1442
+ origin: { x: bounds.x, y: bounds.y },
1443
+ ...(group && container ? { fieldOrigin: { x: holder.x, y: holder.y } } : {}),
1444
+ width: bounds.width,
1445
+ height: bounds.height,
1446
+ resolution: devicePixelRatio,
1447
+ };
1448
+ const offscreen = this.client.documentOwned ? canvas : canvas.transferControlToOffscreen();
1449
+ known = { id, layerId: layer.id };
1450
+ this.canvases.set(canvas, known);
1451
+ this.viewportSamples.set(id, {
1452
+ viewport: { x: bounds.x, y: bounds.y, scaleX: 1, scaleY: 1 },
1453
+ rect: [bounds.x, bounds.y, bounds.width, bounds.height],
1454
+ });
1455
+ await this.send({ type: 'attach-presenter', presenter, canvas: offscreen }, this.client.documentOwned ? [] : [offscreen]);
1456
+ }
1457
+ else if (group)
1458
+ await this.send({
1459
+ type: 'update-presenter',
1460
+ presenter: {
1461
+ id: known.id,
1462
+ role,
1463
+ layerId: layer.id,
1464
+ regionIds,
1465
+ origin: { x: bounds.x, y: bounds.y },
1466
+ ...(group && container ? { fieldOrigin: { x: holder.x, y: holder.y } } : {}),
1467
+ width: bounds.width,
1468
+ height: bounds.height,
1469
+ resolution: devicePixelRatio,
1470
+ },
1471
+ });
1472
+ this.retainPresenterExtent(known.id, bounds);
1473
+ const holderElement = container && groupCanvas === container.canvas ? container.element : entry.element;
1474
+ const followsHolder = !accessoryGlassMotion(entry.element) &&
1475
+ canvas.parentElement === holderElement &&
1476
+ sizesChildren(holderElement);
1477
+ const left = `${bounds.x - canvasHolder.x}px`, top = `${bounds.y - canvasHolder.y}px`, width = presenterSize(bounds.width, canvasHolder.width, followsHolder), height = presenterSize(bounds.height, canvasHolder.height, followsHolder);
1478
+ // An unchanged box is already the presenter's inline geometry. Rewriting it
1479
+ // restyles the canvas without moving a pixel.
1480
+ if (canvas.style.left !== left ||
1481
+ canvas.style.top !== top ||
1482
+ canvas.style.width !== width ||
1483
+ canvas.style.height !== height)
1484
+ Object.assign(canvas.style, {
1485
+ inset: 'auto',
1486
+ left,
1487
+ top,
1488
+ width,
1489
+ height,
1490
+ borderRadius: '0',
1491
+ });
1492
+ canvas.hidden = false;
1493
+ if (!this.viewportObservers.has(canvas)) {
1494
+ const id = this.canvases.get(canvas).id;
1495
+ this.viewportObservers.set(canvas, observePresenterViewport(canvas, (viewport, sampleRect, keyboard) => {
1496
+ void this.updateViewport(id, viewport, sampleRect, keyboard).catch(this.fail);
1497
+ }));
1498
+ }
1499
+ else
1500
+ this.viewportObservers.get(canvas).sample();
1501
+ }
1502
+ if (group)
1503
+ continue;
1504
+ const contentChanged = this.dirtyForegrounds.has(entry.element);
1505
+ if (accessoryGlassMotion(entry.element) &&
1506
+ !this.foregroundInputs.has(entry.id) &&
1507
+ !contentChanged)
1508
+ continue;
1509
+ // A held region's ink is captured when it resumes (with its scene, in one transaction).
1510
+ if (held)
1511
+ continue;
1512
+ // Glass buttons keep their live DOM label above the glass (it dims with the press highlight);
1513
+ // only interactive surfaces lift a captured foreground. The ink key is read only then.
1514
+ // A segmented selection (the scope bar) draws its labels as this ink, so its lens bends them;
1515
+ // its segments look alike in every state, so a selection change is not new ink.
1516
+ const accessoryWorker = accessoryWorkerEnabled(entry.element);
1517
+ if (accessoryWorker &&
1518
+ !contentChanged &&
1519
+ (accessoryGlassMotion(entry.element) ||
1520
+ (accessoryInkWidth(entry.element) ?? 0) > rect.width + 1))
1521
+ continue;
1522
+ const selection = !!entry.descriptor.selection;
1523
+ if (entry.overlay &&
1524
+ !entry.descriptor.material.press &&
1525
+ !entry.descriptor.material.control &&
1526
+ entry.descriptor.material.treatment !== 'contextPreview' &&
1527
+ !selection &&
1528
+ !accessoryWorker &&
1529
+ this.deferIdleForeground(entry))
1530
+ continue;
1531
+ if ((entry.overlay && !entry.descriptor.material.press && !entry.descriptor.material.control) ||
1532
+ entry.descriptor.material.treatment === 'contextPreview' ||
1533
+ selection ||
1534
+ accessoryWorker) {
1535
+ const font = getComputedStyle(entry.element), foregroundKey = JSON.stringify([
1536
+ rect.width,
1537
+ rect.height,
1538
+ entry.element.textContent,
1539
+ // A remounted selection is a new region: its ink is sent again under its own id.
1540
+ selection ? entry.id : inkSignature(entry.element),
1541
+ font.font,
1542
+ font.color,
1543
+ this.appearance,
1544
+ ]);
1545
+ if (this.foregrounds.get(entry.element) !== foregroundKey) {
1546
+ const foreground = await glassTimedAsync('region-foreground', () => captureRegionForeground(entry.element, devicePixelRatio, inset, undefined, {
1547
+ accessory: accessoryGlassMotion(entry.element)?.track,
1548
+ }));
1549
+ // Released on every exit, and only after the request that carries its bitmap has resolved
1550
+ // (inside a transaction that is when the transaction has been sent).
1551
+ this.consumedCanvases.push(foreground);
1552
+ this.armReleaseFallback();
1553
+ try {
1554
+ if (!current())
1555
+ return;
1556
+ if (!entry.element.isConnected)
1557
+ continue;
1558
+ const bitmap = await createImageBitmap(foreground);
1559
+ if (!current()) {
1560
+ bitmap.close();
1561
+ return;
1562
+ }
1563
+ await this.send({
1564
+ type: 'source',
1565
+ source: {
1566
+ id: `foreground:${entry.id}`,
1567
+ regionId: entry.id,
1568
+ revision: ++this.foregroundRevision,
1569
+ layerId: layer.id,
1570
+ role: 'foreground',
1571
+ origin: { x: rect.x - inset, y: rect.y - inset },
1572
+ width: bitmap.width / devicePixelRatio,
1573
+ height: bitmap.height / devicePixelRatio,
1574
+ resolution: devicePixelRatio,
1575
+ },
1576
+ bitmap,
1577
+ }, [bitmap]);
1578
+ // A superseded refresh must not mark its capture current in the next epoch's map.
1579
+ if (current()) {
1580
+ this.foregrounds.set(entry.element, foregroundKey);
1581
+ this.dirtyForegrounds.delete(entry.element);
1582
+ if (accessoryWorker)
1583
+ accessoryInkReady(entry.element, rect.width);
1584
+ }
1585
+ // The glass now draws the labels: the page's stay live (VoiceOver, selection) but
1586
+ // transparent, like a menu's rows under its glass ink.
1587
+ if (current() && selection)
1588
+ entry.element.dataset.satinGlassInk = 'true';
1589
+ }
1590
+ finally {
1591
+ if (!this.batch)
1592
+ this.releaseConsumedCanvases();
1593
+ }
1594
+ }
1595
+ }
1596
+ }
1597
+ if (!current())
1598
+ return;
1599
+ // While the refresh waited, layout can move glass without changing any epoch (Reminders cold
1600
+ // launch: WebKit settles 1366 -> 1334 pt and the toolbar rises 32 pt past the 24 pt capture
1601
+ // margin). Recheck only that the moved glass is still inside the captured rows; movement
1602
+ // within them, and refreshes that never yielded (scroll-driven scenes), cost nothing here.
1603
+ const uncovered = yielded ? this.coverage?.(() => this.sampleRects()) : undefined;
1604
+ if (uncovered) {
1605
+ void uncovered.then(this.invalidate, this.fail);
1606
+ return;
1607
+ }
1608
+ for (const [canvas] of this.canvases)
1609
+ if (!active.has(canvas))
1610
+ canvas.hidden = true;
1611
+ // A scroll-driven scene (every frame while content scrolls under fixed glass) is posted,
1612
+ // not awaited: waiting for the worker's reply before the next refresh could run held region
1613
+ // glass to ~40 Hz on iPadOS 27. The worker applies scenes in post order either way. A scene
1614
+ // that brings a presenter up for the first time is awaited: the element is marked presented
1615
+ // (and, e.g., a context menu revealed) only once its glass exists.
1616
+ const scene = {
1617
+ type: 'scene',
1618
+ snapshot: {
1619
+ revision: ++this.revision,
1620
+ sourceRevision,
1621
+ backdropOwners: topLayerDialogs.map(dialog => backdropOwner(dialog)),
1622
+ regions,
1623
+ layers: [...new Map(regions.map(r => [r.layer.id, r.layer])).values()],
1624
+ scrolls: [...scrolls.values()],
1625
+ },
1626
+ };
1627
+ let receipt;
1628
+ // A parked scene survives a cancelled source update, but never retired DOM ownership or superseded menu motion.
1629
+ this.sceneValidity.set(scene, () => registry === this.registry &&
1630
+ snapshotVersion === registry.snapshotVersion &&
1631
+ sourceRevision === this.sourceRevision &&
1632
+ navigationCurrent() &&
1633
+ motionTracksCurrent());
1634
+ this.scenePresented.set(scene, receipt => {
1635
+ for (const acknowledge of presented)
1636
+ acknowledge(receipt);
1637
+ });
1638
+ if (!current())
1639
+ return;
1640
+ if (this.batch)
1641
+ await this.send(scene);
1642
+ else if (presenting)
1643
+ receipt = await this.sendScene(scene);
1644
+ else
1645
+ this.postScene(scene);
1646
+ if (!current()) {
1647
+ if (this.navigationReceipt) {
1648
+ if (epoch !== this.epoch || registry !== this.registry)
1649
+ throw new DOMException('Navigation region registration superseded', 'AbortError');
1650
+ this.navigationRetry = true;
1651
+ }
1652
+ return;
1653
+ }
1654
+ if (this.navigationReceipt) {
1655
+ const live = registry.values().filter(entry => sceneRegionRect(entry) !== undefined);
1656
+ if (live.length !== registrations?.size ||
1657
+ live.some(entry => registrations?.get(entry) !== entry.descriptor ||
1658
+ generations.get(entry.canvas) !== entry.canvas.dataset.satinGlassShow)) {
1659
+ this.navigationRetry = true;
1660
+ return;
1661
+ }
1662
+ const admitted = receipt;
1663
+ if (admitted?.navigation !== this.navigationReceipt ||
1664
+ drawableEntries.some(entry => !entry.element.closest(INACTIVE_TAB) && !admitted.presented?.includes(entry.id)))
1665
+ throw Error(`Navigation ${this.navigationReceipt} has no current-source region draw receipt`);
1666
+ this.navigationRetry = false;
1667
+ }
1668
+ // Declarative interaction may predate worker subscription on cold launch.
1669
+ for (const entry of entries) {
1670
+ const input = registry.interactions.get(entry.id);
1671
+ if (input && input.phase !== 'rest' && !this.foregroundInputs.has(entry.id))
1672
+ await this.send({ type: 'interaction', interaction: input });
1673
+ }
1674
+ if (this.batch)
1675
+ this.batch.presented.push(...presented);
1676
+ else if (presenting)
1677
+ for (const acknowledge of presented)
1678
+ acknowledge(receipt);
1679
+ }
1680
+ }
1681
+ /** A confirmation popover names its arrow on its glass element (`--satin-popover-arrow`:
1682
+ * `top|bottom <x px>` in layout points). The measured frame carries the presentation transform,
1683
+ * so the arrow takes the same scale. */
1684
+ function popoverArrow(element, rect) {
1685
+ const [edge, value] = element.style.getPropertyValue('--satin-popover-arrow').trim().split(/\s+/);
1686
+ const x = Number.parseFloat(value ?? '');
1687
+ if ((edge !== 'top' && edge !== 'bottom') || !Number.isFinite(x) || !element.offsetWidth)
1688
+ return undefined;
1689
+ const scale = rect.width / element.offsetWidth;
1690
+ return { edge, x: x * scale, scale };
1691
+ }