@automovie/viewer 0.3.3 → 0.4.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 (387) hide show
  1. package/README.md +8 -87
  2. package/lib/IAutoMovieViewerCompletedFrame.d.ts +19 -11
  3. package/lib/IAutoMovieViewerDisplayMetadata.d.ts +0 -5
  4. package/lib/IAutoMovieViewerHandle.d.ts +3 -25
  5. package/lib/IMountViewerOptions.d.ts +24 -38
  6. package/lib/IViewerCameraStateSnapshot.d.ts +0 -5
  7. package/lib/IViewerFrameTransfer.d.ts +11 -0
  8. package/lib/IViewerFrameTransfer.js +3 -0
  9. package/lib/IViewerFrameTransfer.js.map +1 -0
  10. package/lib/IViewerFrameTransfer.mjs +0 -0
  11. package/lib/applyCaptureCanvasSize.d.ts +9 -10
  12. package/lib/applyCaptureCanvasSize.js +7 -13
  13. package/lib/applyCaptureCanvasSize.js.map +1 -1
  14. package/lib/applyCaptureCanvasSize.mjs +7 -10
  15. package/lib/applyCaptureCanvasSize.mjs.map +1 -1
  16. package/lib/audio/IAutoMovieAudioCue.d.ts +3 -8
  17. package/lib/audio/planAutoMovieAudioPlayback.d.ts +8 -21
  18. package/lib/audio/planAutoMovieAudioPlayback.js +8 -14
  19. package/lib/audio/planAutoMovieAudioPlayback.js.map +1 -1
  20. package/lib/audio/planAutoMovieAudioPlayback.mjs +8 -14
  21. package/lib/audio/planAutoMovieAudioPlayback.mjs.map +1 -1
  22. package/lib/audio/playAutoMovieAudioCues.d.ts +4 -11
  23. package/lib/audio/playAutoMovieAudioCues.js +4 -11
  24. package/lib/audio/playAutoMovieAudioCues.js.map +1 -1
  25. package/lib/audio/playAutoMovieAudioCues.mjs +4 -11
  26. package/lib/audio/playAutoMovieAudioCues.mjs.map +1 -1
  27. package/lib/createViewerCameraState.d.ts +3 -11
  28. package/lib/createViewerCameraState.js +80 -121
  29. package/lib/createViewerCameraState.js.map +1 -1
  30. package/lib/createViewerCameraState.mjs +46 -98
  31. package/lib/createViewerCameraState.mjs.map +1 -1
  32. package/lib/createViewerDisplayClock.d.ts +2 -10
  33. package/lib/createViewerDisplayClock.js +4 -12
  34. package/lib/createViewerDisplayClock.js.map +1 -1
  35. package/lib/createViewerDisplayClock.mjs +3 -11
  36. package/lib/createViewerDisplayClock.mjs.map +1 -1
  37. package/lib/createViewerDisplayPublication.d.ts +7 -15
  38. package/lib/createViewerDisplayPublication.js +7 -15
  39. package/lib/createViewerDisplayPublication.js.map +1 -1
  40. package/lib/createViewerDisplayPublication.mjs +7 -15
  41. package/lib/createViewerDisplayPublication.mjs.map +1 -1
  42. package/lib/createViewerDisplaySave.d.ts +8 -16
  43. package/lib/createViewerDisplaySave.js +8 -16
  44. package/lib/createViewerDisplaySave.js.map +1 -1
  45. package/lib/createViewerDisplaySave.mjs +8 -16
  46. package/lib/createViewerDisplaySave.mjs.map +1 -1
  47. package/lib/createViewerFrameControl.d.ts +8 -10
  48. package/lib/createViewerFrameControl.js +3 -15
  49. package/lib/createViewerFrameControl.js.map +1 -1
  50. package/lib/createViewerFrameControl.mjs +3 -12
  51. package/lib/createViewerFrameControl.mjs.map +1 -1
  52. package/lib/createViewerViewportResize.d.ts +4 -12
  53. package/lib/createViewerViewportResize.js +7 -20
  54. package/lib/createViewerViewportResize.js.map +1 -1
  55. package/lib/createViewerViewportResize.mjs +6 -14
  56. package/lib/createViewerViewportResize.mjs.map +1 -1
  57. package/lib/index.d.ts +1 -0
  58. package/lib/index.js +1 -0
  59. package/lib/index.js.map +1 -1
  60. package/lib/index.mjs +6 -1
  61. package/lib/inspector/AutoMovieInspector.d.ts +33 -13
  62. package/lib/inspector/AutoMovieInspector.js +110 -19
  63. package/lib/inspector/AutoMovieInspector.js.map +1 -1
  64. package/lib/inspector/AutoMovieInspector.mjs +121 -18
  65. package/lib/inspector/AutoMovieInspector.mjs.map +1 -1
  66. package/lib/inspector/AutoMovieInspectorBeauty.d.ts +41 -0
  67. package/lib/inspector/AutoMovieInspectorBeauty.js +56 -0
  68. package/lib/inspector/AutoMovieInspectorBeauty.js.map +1 -0
  69. package/lib/inspector/AutoMovieInspectorBeauty.mjs +55 -0
  70. package/lib/inspector/AutoMovieInspectorBeauty.mjs.map +1 -0
  71. package/lib/inspector/AutoMovieInspectorDiagnosticLog.d.ts +48 -0
  72. package/lib/inspector/AutoMovieInspectorDiagnosticLog.js +186 -0
  73. package/lib/inspector/AutoMovieInspectorDiagnosticLog.js.map +1 -0
  74. package/lib/inspector/AutoMovieInspectorDiagnosticLog.mjs +171 -0
  75. package/lib/inspector/AutoMovieInspectorDiagnosticLog.mjs.map +1 -0
  76. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.d.ts +23 -0
  77. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.js +37 -0
  78. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.js.map +1 -0
  79. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.mjs +85 -0
  80. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.mjs.map +1 -0
  81. package/lib/inspector/AutoMovieInspectorMarksPanel.d.ts +4 -10
  82. package/lib/inspector/AutoMovieInspectorMarksPanel.js +18 -35
  83. package/lib/inspector/AutoMovieInspectorMarksPanel.js.map +1 -1
  84. package/lib/inspector/AutoMovieInspectorMarksPanel.mjs +32 -38
  85. package/lib/inspector/AutoMovieInspectorMarksPanel.mjs.map +1 -1
  86. package/lib/inspector/AutoMovieInspectorPlayhead.d.ts +35 -96
  87. package/lib/inspector/AutoMovieInspectorPlayhead.js +41 -101
  88. package/lib/inspector/AutoMovieInspectorPlayhead.js.map +1 -1
  89. package/lib/inspector/AutoMovieInspectorPlayhead.mjs +44 -98
  90. package/lib/inspector/AutoMovieInspectorPlayhead.mjs.map +1 -1
  91. package/lib/inspector/AutoMovieInspectorRequestPanel.d.ts +9 -10
  92. package/lib/inspector/AutoMovieInspectorRequestPanel.js +18 -12
  93. package/lib/inspector/AutoMovieInspectorRequestPanel.js.map +1 -1
  94. package/lib/inspector/AutoMovieInspectorRequestPanel.mjs +32 -14
  95. package/lib/inspector/AutoMovieInspectorRequestPanel.mjs.map +1 -1
  96. package/lib/inspector/AutoMovieInspectorSelectionPanel.d.ts +0 -8
  97. package/lib/inspector/AutoMovieInspectorSelectionPanel.js +0 -8
  98. package/lib/inspector/AutoMovieInspectorSelectionPanel.js.map +1 -1
  99. package/lib/inspector/AutoMovieInspectorSelectionPanel.mjs +0 -8
  100. package/lib/inspector/AutoMovieInspectorSelectionPanel.mjs.map +1 -1
  101. package/lib/inspector/AutoMovieInspectorShadePanel.d.ts +2 -9
  102. package/lib/inspector/AutoMovieInspectorShadePanel.js +18 -25
  103. package/lib/inspector/AutoMovieInspectorShadePanel.js.map +1 -1
  104. package/lib/inspector/AutoMovieInspectorShadePanel.mjs +18 -27
  105. package/lib/inspector/AutoMovieInspectorShadePanel.mjs.map +1 -1
  106. package/lib/inspector/AutoMovieInspectorTimePanel.d.ts +0 -8
  107. package/lib/inspector/AutoMovieInspectorTimePanel.js +0 -8
  108. package/lib/inspector/AutoMovieInspectorTimePanel.js.map +1 -1
  109. package/lib/inspector/AutoMovieInspectorTimePanel.mjs +0 -8
  110. package/lib/inspector/AutoMovieInspectorTimePanel.mjs.map +1 -1
  111. package/lib/inspector/AutoMovieInspectorTimeReadout.d.ts +0 -8
  112. package/lib/inspector/AutoMovieInspectorTimeReadout.js +4 -10
  113. package/lib/inspector/AutoMovieInspectorTimeReadout.js.map +1 -1
  114. package/lib/inspector/AutoMovieInspectorTimeReadout.mjs +3 -12
  115. package/lib/inspector/AutoMovieInspectorTimeReadout.mjs.map +1 -1
  116. package/lib/inspector/AutoMovieInspectorTransition.d.ts +79 -0
  117. package/lib/inspector/AutoMovieInspectorTransition.js +131 -0
  118. package/lib/inspector/AutoMovieInspectorTransition.js.map +1 -0
  119. package/lib/inspector/AutoMovieInspectorTransition.mjs +119 -0
  120. package/lib/inspector/AutoMovieInspectorTransition.mjs.map +1 -0
  121. package/lib/inspector/AutoMovieInspectorViewPanel.d.ts +0 -8
  122. package/lib/inspector/AutoMovieInspectorViewPanel.js +0 -8
  123. package/lib/inspector/AutoMovieInspectorViewPanel.js.map +1 -1
  124. package/lib/inspector/AutoMovieInspectorViewPanel.mjs +0 -8
  125. package/lib/inspector/AutoMovieInspectorViewPanel.mjs.map +1 -1
  126. package/lib/inspector/IAutoMovieInspectorAction.d.ts +54 -95
  127. package/lib/inspector/IAutoMovieInspectorLive.d.ts +43 -0
  128. package/lib/inspector/IAutoMovieInspectorLive.js +3 -0
  129. package/lib/inspector/IAutoMovieInspectorLive.js.map +1 -0
  130. package/lib/inspector/IAutoMovieInspectorLive.mjs +0 -0
  131. package/lib/inspector/IAutoMovieInspectorPathNode.d.ts +14 -9
  132. package/lib/inspector/IAutoMovieInspectorProps.d.ts +3 -14
  133. package/lib/inspector/IAutoMovieInspectorScene.d.ts +96 -100
  134. package/lib/inspector/IAutoMovieInspectorSceneHost.d.ts +37 -102
  135. package/lib/inspector/IAutoMovieInspectorState.d.ts +6 -7
  136. package/lib/inspector/assertAutoMovieInspectorRaster.d.ts +7 -0
  137. package/lib/inspector/assertAutoMovieInspectorRaster.js +19 -0
  138. package/lib/inspector/assertAutoMovieInspectorRaster.js.map +1 -0
  139. package/lib/inspector/assertAutoMovieInspectorRaster.mjs +17 -0
  140. package/lib/inspector/assertAutoMovieInspectorRaster.mjs.map +1 -0
  141. package/lib/inspector/buildAutoMovieInspectorPathTree.d.ts +9 -10
  142. package/lib/inspector/buildAutoMovieInspectorPathTree.js +9 -10
  143. package/lib/inspector/buildAutoMovieInspectorPathTree.js.map +1 -1
  144. package/lib/inspector/buildAutoMovieInspectorPathTree.mjs +9 -10
  145. package/lib/inspector/buildAutoMovieInspectorPathTree.mjs.map +1 -1
  146. package/lib/inspector/changesAutoMovieObservedScene.d.ts +16 -0
  147. package/lib/inspector/changesAutoMovieObservedScene.js +28 -0
  148. package/lib/inspector/changesAutoMovieObservedScene.js.map +1 -0
  149. package/lib/inspector/changesAutoMovieObservedScene.mjs +21 -0
  150. package/lib/inspector/changesAutoMovieObservedScene.mjs.map +1 -0
  151. package/lib/inspector/createAutoMovieInspectorAddressWriter.d.ts +13 -11
  152. package/lib/inspector/createAutoMovieInspectorAddressWriter.js +13 -11
  153. package/lib/inspector/createAutoMovieInspectorAddressWriter.js.map +1 -1
  154. package/lib/inspector/createAutoMovieInspectorAddressWriter.mjs +13 -11
  155. package/lib/inspector/createAutoMovieInspectorAddressWriter.mjs.map +1 -1
  156. package/lib/inspector/createAutoMovieInspectorCanvasHost.d.ts +7 -10
  157. package/lib/inspector/createAutoMovieInspectorCanvasHost.js +14 -11
  158. package/lib/inspector/createAutoMovieInspectorCanvasHost.js.map +1 -1
  159. package/lib/inspector/createAutoMovieInspectorCanvasHost.mjs +17 -14
  160. package/lib/inspector/createAutoMovieInspectorCanvasHost.mjs.map +1 -1
  161. package/lib/inspector/createAutoMovieInspectorState.d.ts +3 -9
  162. package/lib/inspector/createAutoMovieInspectorState.js +3 -9
  163. package/lib/inspector/createAutoMovieInspectorState.js.map +1 -1
  164. package/lib/inspector/createAutoMovieInspectorState.mjs +3 -9
  165. package/lib/inspector/createAutoMovieInspectorState.mjs.map +1 -1
  166. package/lib/inspector/firstAutoMovieInspectorSecond.d.ts +6 -0
  167. package/lib/inspector/firstAutoMovieInspectorSecond.js +13 -0
  168. package/lib/inspector/firstAutoMovieInspectorSecond.js.map +1 -0
  169. package/lib/inspector/firstAutoMovieInspectorSecond.mjs +11 -0
  170. package/lib/inspector/firstAutoMovieInspectorSecond.mjs.map +1 -0
  171. package/lib/inspector/followAutoMovieInspectorSize.d.ts +11 -0
  172. package/lib/inspector/followAutoMovieInspectorSize.js +26 -0
  173. package/lib/inspector/followAutoMovieInspectorSize.js.map +1 -0
  174. package/lib/inspector/followAutoMovieInspectorSize.mjs +26 -0
  175. package/lib/inspector/followAutoMovieInspectorSize.mjs.map +1 -0
  176. package/lib/inspector/formatAutoMovieInspectorAddress.d.ts +11 -10
  177. package/lib/inspector/formatAutoMovieInspectorAddress.js +15 -11
  178. package/lib/inspector/formatAutoMovieInspectorAddress.js.map +1 -1
  179. package/lib/inspector/formatAutoMovieInspectorAddress.mjs +15 -11
  180. package/lib/inspector/formatAutoMovieInspectorAddress.mjs.map +1 -1
  181. package/lib/inspector/formatAutoMovieInspectorCommand.d.ts +20 -14
  182. package/lib/inspector/formatAutoMovieInspectorCommand.js +33 -14
  183. package/lib/inspector/formatAutoMovieInspectorCommand.js.map +1 -1
  184. package/lib/inspector/formatAutoMovieInspectorCommand.mjs +26 -15
  185. package/lib/inspector/formatAutoMovieInspectorCommand.mjs.map +1 -1
  186. package/lib/inspector/handleAutoMovieInspectorKey.d.ts +24 -15
  187. package/lib/inspector/handleAutoMovieInspectorKey.js +27 -16
  188. package/lib/inspector/handleAutoMovieInspectorKey.js.map +1 -1
  189. package/lib/inspector/handleAutoMovieInspectorKey.mjs +27 -16
  190. package/lib/inspector/handleAutoMovieInspectorKey.mjs.map +1 -1
  191. package/lib/inspector/index.d.ts +5 -0
  192. package/lib/inspector/index.js +5 -0
  193. package/lib/inspector/index.js.map +1 -1
  194. package/lib/inspector/index.mjs +6 -1
  195. package/lib/inspector/inspectAutoMovieInspectorRequest.d.ts +19 -0
  196. package/lib/inspector/inspectAutoMovieInspectorRequest.js +20 -0
  197. package/lib/inspector/inspectAutoMovieInspectorRequest.js.map +1 -0
  198. package/lib/inspector/inspectAutoMovieInspectorRequest.mjs +20 -0
  199. package/lib/inspector/inspectAutoMovieInspectorRequest.mjs.map +1 -0
  200. package/lib/inspector/installAutoMovieInspectorRequest.d.ts +20 -0
  201. package/lib/inspector/installAutoMovieInspectorRequest.js +36 -0
  202. package/lib/inspector/installAutoMovieInspectorRequest.js.map +1 -0
  203. package/lib/inspector/installAutoMovieInspectorRequest.mjs +35 -0
  204. package/lib/inspector/installAutoMovieInspectorRequest.mjs.map +1 -0
  205. package/lib/inspector/locateAutoMovieInspectorFinding.d.ts +19 -0
  206. package/lib/inspector/locateAutoMovieInspectorFinding.js +34 -0
  207. package/lib/inspector/locateAutoMovieInspectorFinding.js.map +1 -0
  208. package/lib/inspector/locateAutoMovieInspectorFinding.mjs +37 -0
  209. package/lib/inspector/locateAutoMovieInspectorFinding.mjs.map +1 -0
  210. package/lib/inspector/messageOfAutoMovieInspectorError.d.ts +2 -0
  211. package/lib/inspector/messageOfAutoMovieInspectorError.js +8 -0
  212. package/lib/inspector/messageOfAutoMovieInspectorError.js.map +1 -0
  213. package/lib/inspector/messageOfAutoMovieInspectorError.mjs +8 -0
  214. package/lib/inspector/messageOfAutoMovieInspectorError.mjs.map +1 -0
  215. package/lib/inspector/mountAutoMovieInspectorPage.d.ts +5 -8
  216. package/lib/inspector/mountAutoMovieInspectorPage.js +3 -9
  217. package/lib/inspector/mountAutoMovieInspectorPage.js.map +1 -1
  218. package/lib/inspector/mountAutoMovieInspectorPage.mjs +4 -9
  219. package/lib/inspector/mountAutoMovieInspectorPage.mjs.map +1 -1
  220. package/lib/inspector/mountAutoMovieInspectorScene.d.ts +55 -12
  221. package/lib/inspector/mountAutoMovieInspectorScene.js +238 -164
  222. package/lib/inspector/mountAutoMovieInspectorScene.js.map +1 -1
  223. package/lib/inspector/mountAutoMovieInspectorScene.mjs +223 -149
  224. package/lib/inspector/mountAutoMovieInspectorScene.mjs.map +1 -1
  225. package/lib/inspector/placeAutoMovieInspectorLabels.d.ts +29 -0
  226. package/lib/inspector/placeAutoMovieInspectorLabels.js +33 -0
  227. package/lib/inspector/placeAutoMovieInspectorLabels.js.map +1 -0
  228. package/lib/inspector/placeAutoMovieInspectorLabels.mjs +32 -0
  229. package/lib/inspector/placeAutoMovieInspectorLabels.mjs.map +1 -0
  230. package/lib/inspector/readAutoMovieInspectorAddress.d.ts +8 -11
  231. package/lib/inspector/readAutoMovieInspectorAddress.js +8 -11
  232. package/lib/inspector/readAutoMovieInspectorAddress.js.map +1 -1
  233. package/lib/inspector/readAutoMovieInspectorAddress.mjs +8 -11
  234. package/lib/inspector/readAutoMovieInspectorAddress.mjs.map +1 -1
  235. package/lib/inspector/readAutoMovieInspectorFacts.d.ts +17 -0
  236. package/lib/inspector/readAutoMovieInspectorFacts.js +34 -0
  237. package/lib/inspector/readAutoMovieInspectorFacts.js.map +1 -0
  238. package/lib/inspector/readAutoMovieInspectorFacts.mjs +28 -0
  239. package/lib/inspector/readAutoMovieInspectorFacts.mjs.map +1 -0
  240. package/lib/inspector/readsAutoMovieInspectorPlacedScene.d.ts +9 -0
  241. package/lib/inspector/readsAutoMovieInspectorPlacedScene.js +14 -0
  242. package/lib/inspector/readsAutoMovieInspectorPlacedScene.js.map +1 -0
  243. package/lib/inspector/readsAutoMovieInspectorPlacedScene.mjs +14 -0
  244. package/lib/inspector/readsAutoMovieInspectorPlacedScene.mjs.map +1 -0
  245. package/lib/inspector/reduceAutoMovieInspectorState.d.ts +10 -10
  246. package/lib/inspector/reduceAutoMovieInspectorState.js +17 -11
  247. package/lib/inspector/reduceAutoMovieInspectorState.js.map +1 -1
  248. package/lib/inspector/reduceAutoMovieInspectorState.mjs +16 -11
  249. package/lib/inspector/reduceAutoMovieInspectorState.mjs.map +1 -1
  250. package/lib/inspector/releaseAutoMovieInspectorSteps.d.ts +6 -0
  251. package/lib/inspector/releaseAutoMovieInspectorSteps.js +23 -0
  252. package/lib/inspector/releaseAutoMovieInspectorSteps.js.map +1 -0
  253. package/lib/inspector/releaseAutoMovieInspectorSteps.mjs +19 -0
  254. package/lib/inspector/releaseAutoMovieInspectorSteps.mjs.map +1 -0
  255. package/lib/inspector/reportAutoMovieInspectorLabels.d.ts +21 -0
  256. package/lib/inspector/reportAutoMovieInspectorLabels.js +27 -0
  257. package/lib/inspector/reportAutoMovieInspectorLabels.js.map +1 -0
  258. package/lib/inspector/reportAutoMovieInspectorLabels.mjs +30 -0
  259. package/lib/inspector/reportAutoMovieInspectorLabels.mjs.map +1 -0
  260. package/lib/inspector/resolveAutoMovieInspectorCamera.d.ts +22 -0
  261. package/lib/inspector/resolveAutoMovieInspectorCamera.js +34 -0
  262. package/lib/inspector/resolveAutoMovieInspectorCamera.js.map +1 -0
  263. package/lib/inspector/resolveAutoMovieInspectorCamera.mjs +34 -0
  264. package/lib/inspector/resolveAutoMovieInspectorCamera.mjs.map +1 -0
  265. package/lib/inspector/showAutoMovieInspectorFinding.d.ts +25 -0
  266. package/lib/inspector/showAutoMovieInspectorFinding.js +26 -0
  267. package/lib/inspector/showAutoMovieInspectorFinding.js.map +1 -0
  268. package/lib/inspector/showAutoMovieInspectorFinding.mjs +26 -0
  269. package/lib/inspector/showAutoMovieInspectorFinding.mjs.map +1 -0
  270. package/lib/inspector/stopAutoMovieInspectorTime.d.ts +11 -0
  271. package/lib/inspector/stopAutoMovieInspectorTime.js +17 -0
  272. package/lib/inspector/stopAutoMovieInspectorTime.js.map +1 -0
  273. package/lib/inspector/stopAutoMovieInspectorTime.mjs +18 -0
  274. package/lib/inspector/stopAutoMovieInspectorTime.mjs.map +1 -0
  275. package/lib/inspector/writeAutoMovieInspectorInspection.d.ts +6 -0
  276. package/lib/inspector/writeAutoMovieInspectorInspection.js +12 -0
  277. package/lib/inspector/writeAutoMovieInspectorInspection.js.map +1 -0
  278. package/lib/inspector/writeAutoMovieInspectorInspection.mjs +12 -0
  279. package/lib/inspector/writeAutoMovieInspectorInspection.mjs.map +1 -0
  280. package/lib/internal.d.ts +7 -0
  281. package/lib/internal.js +25 -0
  282. package/lib/internal.js.map +1 -0
  283. package/lib/internal.mjs +8 -0
  284. package/lib/mountViewer.d.ts +16 -10
  285. package/lib/mountViewer.js +17 -14
  286. package/lib/mountViewer.js.map +1 -1
  287. package/lib/mountViewer.mjs +18 -12
  288. package/lib/mountViewer.mjs.map +1 -1
  289. package/lib/publishViewerCompletedFrame.d.ts +12 -10
  290. package/lib/publishViewerCompletedFrame.js +11 -9
  291. package/lib/publishViewerCompletedFrame.js.map +1 -1
  292. package/lib/publishViewerCompletedFrame.mjs +11 -9
  293. package/lib/publishViewerCompletedFrame.mjs.map +1 -1
  294. package/lib/redrawViewerCompletedFrame.d.ts +2 -10
  295. package/lib/redrawViewerCompletedFrame.js +4 -12
  296. package/lib/redrawViewerCompletedFrame.js.map +1 -1
  297. package/lib/redrawViewerCompletedFrame.mjs +3 -11
  298. package/lib/redrawViewerCompletedFrame.mjs.map +1 -1
  299. package/lib/releaseMountedViewer.d.ts +5 -9
  300. package/lib/releaseMountedViewer.js +5 -9
  301. package/lib/releaseMountedViewer.js.map +1 -1
  302. package/lib/releaseMountedViewer.mjs +5 -9
  303. package/lib/releaseMountedViewer.mjs.map +1 -1
  304. package/lib/transport/AutoMovieViewerTransport.d.ts +13 -122
  305. package/lib/transport/AutoMovieViewerTransport.js +10 -74
  306. package/lib/transport/AutoMovieViewerTransport.js.map +1 -1
  307. package/lib/transport/AutoMovieViewerTransport.mjs +10 -65
  308. package/lib/transport/AutoMovieViewerTransport.mjs.map +1 -1
  309. package/lib/transport/readAutoMovieReviewInterval.d.ts +3 -10
  310. package/lib/transport/readAutoMovieReviewInterval.js +11 -16
  311. package/lib/transport/readAutoMovieReviewInterval.js.map +1 -1
  312. package/lib/transport/readAutoMovieReviewInterval.mjs +8 -14
  313. package/lib/transport/readAutoMovieReviewInterval.mjs.map +1 -1
  314. package/package.json +12 -8
  315. package/src/IAutoMovieViewerCompletedFrame.ts +21 -11
  316. package/src/IAutoMovieViewerDisplayMetadata.ts +0 -5
  317. package/src/IAutoMovieViewerHandle.ts +3 -25
  318. package/src/IMountViewerOptions.ts +24 -38
  319. package/src/IViewerCameraStateSnapshot.ts +0 -5
  320. package/src/IViewerFrameTransfer.ts +13 -0
  321. package/src/applyCaptureCanvasSize.ts +9 -18
  322. package/src/audio/IAutoMovieAudioCue.ts +3 -8
  323. package/src/audio/planAutoMovieAudioPlayback.ts +9 -23
  324. package/src/audio/playAutoMovieAudioCues.ts +4 -11
  325. package/src/createViewerCameraState.ts +119 -175
  326. package/src/createViewerDisplayClock.ts +4 -12
  327. package/src/createViewerDisplayPublication.ts +7 -15
  328. package/src/createViewerDisplaySave.ts +8 -16
  329. package/src/createViewerFrameControl.ts +16 -24
  330. package/src/createViewerViewportResize.ts +7 -23
  331. package/src/index.ts +1 -0
  332. package/src/inspector/AutoMovieInspector.tsx +183 -20
  333. package/src/inspector/AutoMovieInspectorBeauty.ts +89 -0
  334. package/src/inspector/AutoMovieInspectorDiagnosticLog.ts +235 -0
  335. package/src/inspector/AutoMovieInspectorDiagnosticsPanel.tsx +118 -0
  336. package/src/inspector/AutoMovieInspectorMarksPanel.tsx +26 -34
  337. package/src/inspector/AutoMovieInspectorPlayhead.ts +53 -110
  338. package/src/inspector/AutoMovieInspectorRequestPanel.tsx +57 -29
  339. package/src/inspector/AutoMovieInspectorSelectionPanel.tsx +0 -8
  340. package/src/inspector/AutoMovieInspectorShadePanel.tsx +24 -29
  341. package/src/inspector/AutoMovieInspectorTimePanel.tsx +0 -8
  342. package/src/inspector/AutoMovieInspectorTimeReadout.tsx +4 -10
  343. package/src/inspector/AutoMovieInspectorTransition.ts +178 -0
  344. package/src/inspector/AutoMovieInspectorViewPanel.tsx +0 -8
  345. package/src/inspector/IAutoMovieInspectorAction.ts +57 -94
  346. package/src/inspector/IAutoMovieInspectorLive.ts +62 -0
  347. package/src/inspector/IAutoMovieInspectorPathNode.ts +14 -9
  348. package/src/inspector/IAutoMovieInspectorProps.ts +4 -14
  349. package/src/inspector/IAutoMovieInspectorScene.ts +104 -99
  350. package/src/inspector/IAutoMovieInspectorSceneHost.ts +43 -102
  351. package/src/inspector/IAutoMovieInspectorState.ts +6 -7
  352. package/src/inspector/assertAutoMovieInspectorRaster.ts +23 -0
  353. package/src/inspector/buildAutoMovieInspectorPathTree.ts +9 -10
  354. package/src/inspector/changesAutoMovieObservedScene.ts +30 -0
  355. package/src/inspector/createAutoMovieInspectorAddressWriter.ts +13 -11
  356. package/src/inspector/createAutoMovieInspectorCanvasHost.ts +14 -12
  357. package/src/inspector/createAutoMovieInspectorState.ts +3 -9
  358. package/src/inspector/firstAutoMovieInspectorSecond.ts +13 -0
  359. package/src/inspector/followAutoMovieInspectorSize.ts +32 -0
  360. package/src/inspector/formatAutoMovieInspectorAddress.ts +15 -11
  361. package/src/inspector/formatAutoMovieInspectorCommand.ts +44 -15
  362. package/src/inspector/handleAutoMovieInspectorKey.ts +27 -16
  363. package/src/inspector/index.ts +5 -0
  364. package/src/inspector/inspectAutoMovieInspectorRequest.ts +37 -0
  365. package/src/inspector/installAutoMovieInspectorRequest.ts +50 -0
  366. package/src/inspector/locateAutoMovieInspectorFinding.ts +40 -0
  367. package/src/inspector/messageOfAutoMovieInspectorError.ts +4 -0
  368. package/src/inspector/mountAutoMovieInspectorPage.tsx +7 -8
  369. package/src/inspector/mountAutoMovieInspectorScene.ts +290 -232
  370. package/src/inspector/placeAutoMovieInspectorLabels.ts +53 -0
  371. package/src/inspector/readAutoMovieInspectorAddress.ts +8 -11
  372. package/src/inspector/readAutoMovieInspectorFacts.ts +50 -0
  373. package/src/inspector/readsAutoMovieInspectorPlacedScene.ts +16 -0
  374. package/src/inspector/reduceAutoMovieInspectorState.ts +17 -11
  375. package/src/inspector/releaseAutoMovieInspectorSteps.ts +19 -0
  376. package/src/inspector/reportAutoMovieInspectorLabels.ts +45 -0
  377. package/src/inspector/resolveAutoMovieInspectorCamera.ts +50 -0
  378. package/src/inspector/showAutoMovieInspectorFinding.ts +40 -0
  379. package/src/inspector/stopAutoMovieInspectorTime.ts +19 -0
  380. package/src/inspector/writeAutoMovieInspectorInspection.ts +12 -0
  381. package/src/internal.ts +9 -0
  382. package/src/mountViewer.ts +17 -14
  383. package/src/publishViewerCompletedFrame.ts +14 -10
  384. package/src/redrawViewerCompletedFrame.ts +3 -12
  385. package/src/releaseMountedViewer.ts +5 -9
  386. package/src/transport/AutoMovieViewerTransport.ts +17 -144
  387. package/src/transport/readAutoMovieReviewInterval.ts +15 -16
@@ -1,22 +1,14 @@
1
1
  import { createViewerDisplayPublication } from "./createViewerDisplayPublication.mjs";
2
2
  // src/createViewerDisplaySave.ts
3
3
  /**
4
- * Copy a completed display before asynchronously encoding and saving it.
5
- * The caller owns completion, facts and commitment. One encoder/upload and
6
- * one latest pending bitmap bound work; failed snapshots retain the previous
7
- * pending and published frame. Owned superseded surfaces are released.
8
- * Prepare copies a provisional visible frame without starting an upload;
9
- * commit admits the same staged bitmap, or copies a direct active display.
10
- * Commit/change return whether synchronous copying succeeded; asynchronous
11
- * encoding or HTTP failures are reported separately and do not certify IO.
12
- *
13
- * @evidence contracts/development/implementation.md#principled-implementation Structured-clones completed metadata and copies original canvas pixels before PNG encoding, then posts the committed session/generation and monotone local sequence to the actual /display sink; copied facts/pixels must belong to one completed display, and synchronous success does not certify retain/encode/network completion.
14
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Owns browser bitmap/encoding/upload lifetime and delegates preparation/commit authority to createViewerDisplayPublication; optional paint and retain ports preserve existing visible-layer and graphics-recovery owners without a parallel render or solver.
15
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Saves actual copied pixels/metadata rather than a synthetic probe or fixture PNG; refused snapshot preserves the previous pending bitmap, and asynchronous failures are surfaced as AUTOMOVIE display-save warnings instead of a false saved receipt.
16
- * @evidence contracts/development/common.md#meaningful-documentation Distinguishes provisional copy, committed upload, async failure and independent original-pixel retention; one-running/one-pending population and superseded-surface release are explicit.
17
- * @evidence contracts/development/implementation.md#efficient-algorithms Copy/PNG/base64 serialization are O(frame pixels or encoded bytes plus cloned metadata); one encoder/upload runs while only latest pending bitmap survives, preventing a frame-per-draw backlog. Driver/browser serialization and network costs remain real work.
18
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Prepared original copy is reused by commit, successive pending copies replace superseded surfaces, and the running result is retained for graphics recovery; different completed pixels/facts require a new original snapshot rather than a metadata-only equivalence claim.
19
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Owns at most one running surface/blob/data URL and one pending surface/facts, bounded by their raster/encoded sizes. Release discards pending pixels, aborts the owned FileReader and fetch and closes publication authority. Native toBlob cannot be canceled; its callback is awaited without starting later work after disposal.
4
+ * Copy a completed display before asynchronously encoding and saving it. The
5
+ * caller owns completion, facts and commitment. One encoder/upload and one
6
+ * latest pending bitmap bound work; failed snapshots retain the previous
7
+ * pending and published frame. Owned superseded surfaces are released. Prepare
8
+ * copies a provisional visible frame without starting an upload; commit admits
9
+ * the same staged bitmap, or copies a direct active display. Commit/change
10
+ * return whether synchronous copying succeeded; asynchronous encoding or HTTP
11
+ * failures are reported separately and do not certify IO.
20
12
  */
21
13
  function createViewerDisplaySave(props) {
22
14
  let sequence = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"createViewerDisplaySave.mjs","names":[],"sources":["../src/createViewerDisplaySave.ts"],"sourcesContent":["import type { IAutoMovieViewerDisplayMetadata } from \"./IAutoMovieViewerDisplayMetadata.js\";\nimport { createViewerDisplayPublication } from \"./createViewerDisplayPublication.js\";\n\n/**\n * Copy a completed display before asynchronously encoding and saving it.\n * The caller owns completion, facts and commitment. One encoder/upload and\n * one latest pending bitmap bound work; failed snapshots retain the previous\n * pending and published frame. Owned superseded surfaces are released.\n * Prepare copies a provisional visible frame without starting an upload;\n * commit admits the same staged bitmap, or copies a direct active display.\n * Commit/change return whether synchronous copying succeeded; asynchronous\n * encoding or HTTP failures are reported separately and do not certify IO.\n *\n * @evidence contracts/development/implementation.md#principled-implementation Structured-clones completed metadata and copies original canvas pixels before PNG encoding, then posts the committed session/generation and monotone local sequence to the actual /display sink; copied facts/pixels must belong to one completed display, and synchronous success does not certify retain/encode/network completion.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure Owns browser bitmap/encoding/upload lifetime and delegates preparation/commit authority to createViewerDisplayPublication; optional paint and retain ports preserve existing visible-layer and graphics-recovery owners without a parallel render or solver.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Saves actual copied pixels/metadata rather than a synthetic probe or fixture PNG; refused snapshot preserves the previous pending bitmap, and asynchronous failures are surfaced as AUTOMOVIE display-save warnings instead of a false saved receipt.\n * @evidence contracts/development/common.md#meaningful-documentation Distinguishes provisional copy, committed upload, async failure and independent original-pixel retention; one-running/one-pending population and superseded-surface release are explicit.\n * @evidence contracts/development/implementation.md#efficient-algorithms Copy/PNG/base64 serialization are O(frame pixels or encoded bytes plus cloned metadata); one encoder/upload runs while only latest pending bitmap survives, preventing a frame-per-draw backlog. Driver/browser serialization and network costs remain real work.\n * @evidence contracts/development/implementation.md#reuse-equivalent-work Prepared original copy is reused by commit, successive pending copies replace superseded surfaces, and the running result is retained for graphics recovery; different completed pixels/facts require a new original snapshot rather than a metadata-only equivalence claim.\n * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Owns at most one running surface/blob/data URL and one pending surface/facts, bounded by their raster/encoded sizes. Release discards pending pixels, aborts the owned FileReader and fetch and closes publication authority. Native toBlob cannot be canceled; its callback is awaited without starting later work after disposal.\n */\nexport function createViewerDisplaySave(props: {\n canvas: HTMLCanvasElement;\n observe: () => IAutoMovieViewerDisplayMetadata | undefined;\n /** Paint existing visible layers onto this owned surface, when applicable. */\n paint?: (surface: HTMLCanvasElement) => void;\n /** Keep the encoded completed bitmap for this display's graphics recovery. */\n retain?: (blob: Blob) => void;\n}): {\n active: () => boolean;\n prepare: () => boolean;\n commit: (session: string, generation: number) => boolean;\n changed: () => boolean;\n dispose: () => void;\n} {\n let sequence: number = 0;\n let running: boolean = false;\n const cancellation: AbortController = new AbortController();\n let reader: FileReader | undefined;\n const snapshot: () =>\n | {\n surface: HTMLCanvasElement;\n metadata: IAutoMovieViewerDisplayMetadata & {\n session?: string;\n generation?: number;\n width: number;\n height: number;\n displayedAt: string;\n };\n }\n | undefined = ():\n | {\n surface: HTMLCanvasElement;\n metadata: IAutoMovieViewerDisplayMetadata & {\n session?: string;\n generation?: number;\n width: number;\n height: number;\n displayedAt: string;\n };\n }\n | undefined => {\n const observed: IAutoMovieViewerDisplayMetadata | undefined =\n props.observe();\n if (observed === undefined) return undefined;\n const facts: IAutoMovieViewerDisplayMetadata = structuredClone(observed);\n const surface: HTMLCanvasElement = document.createElement(\"canvas\");\n try {\n if (props.paint !== undefined) props.paint(surface);\n else {\n surface.width = props.canvas.width;\n surface.height = props.canvas.height;\n const context: CanvasRenderingContext2D | null =\n surface.getContext(\"2d\");\n if (context === null)\n throw new Error(\n \"A 2D surface is required to retain the completed display.\",\n );\n context.drawImage(props.canvas, 0, 0);\n }\n return {\n surface,\n metadata: {\n ...facts,\n width: surface.width,\n height: surface.height,\n displayedAt: new Date().toISOString(),\n },\n };\n } catch (cause) {\n surface.width = 0;\n surface.height = 0;\n throw cause;\n }\n };\n let pending: ReturnType<typeof snapshot>;\n const flush: () => Promise<void> = async (): Promise<void> => {\n if (pending === undefined || running || !publication.active()) return;\n const {\n surface,\n metadata,\n }: {\n surface: HTMLCanvasElement;\n metadata: IAutoMovieViewerDisplayMetadata & {\n session?: string;\n generation?: number;\n width: number;\n height: number;\n displayedAt: string;\n };\n } = pending;\n pending = undefined;\n running = true;\n const sequenceId: number = ++sequence;\n try {\n const blob: Blob = await new Promise<Blob>(\n (\n resolve: (value: Blob | PromiseLike<Blob>) => void,\n reject: (reason?: unknown) => void,\n ): void => {\n surface.toBlob(\n (value: Blob | null): void =>\n value === null\n ? reject(new Error(\"The displayed frame could not be encoded.\"))\n : resolve(value),\n \"image/png\",\n );\n // The standard copies pixels before asynchronous serialization.\n surface.width = 0;\n surface.height = 0;\n },\n );\n if (!publication.active()) return;\n props.retain?.(blob);\n const data: string = await new Promise<string>(\n (\n resolve: (value: string | PromiseLike<string>) => void,\n reject: (reason?: unknown) => void,\n ): void => {\n const reading: FileReader = new FileReader();\n reader = reading;\n reading.onload = (): void => resolve(String(reading.result));\n reading.onerror = (): void =>\n reject(\n new Error(\"The encoded display could not be read.\", {\n cause: reading.error,\n }),\n );\n reading.onabort = (): void => reject(cancellation.signal.reason);\n reading.readAsDataURL(blob);\n },\n );\n reader = undefined;\n if (!publication.active()) return;\n const response: Response = await fetch(\"/display\", {\n signal: cancellation.signal,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ ...metadata, sequence: sequenceId, png: data }),\n });\n if (!response.ok) throw new Error(await response.text());\n } catch (cause) {\n if (!cancellation.signal.aborted)\n console.warn(\"AUTOMOVIE_DISPLAY_SAVE \" + String(cause));\n } finally {\n reader = undefined;\n surface.width = 0;\n surface.height = 0;\n running = false;\n if (pending !== undefined && publication.active()) void flush();\n }\n };\n const copy: () => boolean = (): boolean => {\n try {\n const completed:\n | {\n surface: HTMLCanvasElement;\n metadata: IAutoMovieViewerDisplayMetadata & {\n session?: string;\n generation?: number;\n width: number;\n height: number;\n displayedAt: string;\n };\n }\n | undefined = snapshot();\n if (completed === undefined) return false;\n if (pending !== undefined) {\n pending.surface.width = 0;\n pending.surface.height = 0;\n }\n pending = completed;\n return true;\n } catch (cause) {\n console.warn(\"AUTOMOVIE_DISPLAY_SAVE \" + String(cause));\n return false;\n }\n };\n const publication: {\n active: () => boolean;\n prepare: () => boolean;\n commit: (session: string, generation: number) => boolean;\n changed: () => boolean;\n dispose: () => void;\n } = createViewerDisplayPublication({\n copy,\n start: (session: string, generation: number): void => {\n // The lifecycle calls start only after a successful original copy.\n pending!.metadata.session = session;\n pending!.metadata.generation = generation;\n void flush();\n },\n release: (): void => {\n cancellation.abort();\n reader?.abort();\n if (pending !== undefined) {\n pending.surface.width = 0;\n pending.surface.height = 0;\n }\n pending = undefined;\n },\n });\n return publication;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,wBAAwB,OAatC;CACA,IAAI,WAAmB;CACvB,IAAI,UAAmB;CACvB,MAAM,eAAgC,IAAI,gBAAgB;CAC1D,IAAI;CACJ,MAAM,iBAsBW;EACf,MAAM,WACJ,MAAM,QAAQ;EAChB,IAAI,aAAa,KAAA,GAAW,OAAO,KAAA;EACnC,MAAM,QAAyC,gBAAgB,QAAQ;EACvE,MAAM,UAA6B,SAAS,cAAc,QAAQ;EAClE,IAAI;GACF,IAAI,MAAM,UAA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YAAY,OAAO,GAAG;GAC3B,MAAM,WAAqB,MAAM,MAAM,YAAY;IACjD,QAAQ,aAAa;IACrB,QAAQ;IACR,SAAS,EAAE,gBAAgB,mBAAmB;IAC9C,MAAM,KAAK,UAAU;KAAE,GAAG;KAAU,UAAU;KAAY,KAAK;IAAK,CAAC;GACvE,CAAC;GACD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,MAAM,SAAS,KAAK,CAAC;EACzD,SAAS,OAAO;GACd,IAAI,CAAC,aAAa,OAAO,SACvB,QAAQ,KAAK,4BAA4B,OAAO,KAAK,CAAC;EAC1D,UAAU;GACR,SAAS,KAAA;GACT,QAAQ,QAAQ;GAChB,QAAQ,SAAS;GACjB,UAAU;GACV,IAAI,YAAY,KAAA,KAAa,YAAY,OAAO,GAAG,MAAW;EAChE;CACF;CACA,MAAM,aAAqC;EACzC,IAAI;GACF,MAAM,YAWU,SAAS;GACzB,IAAI,cAAc,KAAA,GAAW,OAAO;GACpC,IAAI,YAAY,KAAA,GAAW;IACzB,QAAQ,QAAQ,QAAQ;IACxB,QAAQ,QAAQ,SAAS;GAC3B;GACA,UAAU;GACV,OAAO;EACT,SAAS,OAAO;GACd,QAAQ,KAAK,4BAA4B,OAAO,KAAK,CAAC;GACtD,OAAO;EACT;CACF;CACA,MAAM,cAMF,+BAA+B;EACjC;EACA,QAAQ,SAAiB,eAA6B;GAEpD,QAAS,SAAS,UAAU;GAC5B,QAAS,SAAS,aAAa;GAC/B,MAAW;EACb;EACA,eAAqB;GACnB,aAAa,MAAM;GACnB,QAAQ,MAAM;GACd,IAAI,YAAY,KAAA,GAAW;IACzB,QAAQ,QAAQ,QAAQ;IACxB,QAAQ,QAAQ,SAAS;GAC3B;GACA,UAAU,KAAA;EACZ;CACF,CAAC;CACD,OAAO;AACT"}
1
+ {"version":3,"file":"createViewerDisplaySave.mjs","names":[],"sources":["../src/createViewerDisplaySave.ts"],"sourcesContent":["import type { IAutoMovieViewerDisplayMetadata } from \"./IAutoMovieViewerDisplayMetadata.js\";\nimport { createViewerDisplayPublication } from \"./createViewerDisplayPublication.js\";\n\n/**\n * Copy a completed display before asynchronously encoding and saving it. The\n * caller owns completion, facts and commitment. One encoder/upload and one\n * latest pending bitmap bound work; failed snapshots retain the previous\n * pending and published frame. Owned superseded surfaces are released. Prepare\n * copies a provisional visible frame without starting an upload; commit admits\n * the same staged bitmap, or copies a direct active display. Commit/change\n * return whether synchronous copying succeeded; asynchronous encoding or HTTP\n * failures are reported separately and do not certify IO.\n */\nexport function createViewerDisplaySave(props: {\n canvas: HTMLCanvasElement;\n observe: () => IAutoMovieViewerDisplayMetadata | undefined;\n /** Paint existing visible layers onto this owned surface, when applicable. */\n paint?: (surface: HTMLCanvasElement) => void;\n /** Keep the encoded completed bitmap for this display's graphics recovery. */\n retain?: (blob: Blob) => void;\n}): {\n active: () => boolean;\n prepare: () => boolean;\n commit: (session: string, generation: number) => boolean;\n changed: () => boolean;\n dispose: () => void;\n} {\n let sequence: number = 0;\n let running: boolean = false;\n const cancellation: AbortController = new AbortController();\n let reader: FileReader | undefined;\n const snapshot: () =>\n | {\n surface: HTMLCanvasElement;\n metadata: IAutoMovieViewerDisplayMetadata & {\n session?: string;\n generation?: number;\n width: number;\n height: number;\n displayedAt: string;\n };\n }\n | undefined = ():\n | {\n surface: HTMLCanvasElement;\n metadata: IAutoMovieViewerDisplayMetadata & {\n session?: string;\n generation?: number;\n width: number;\n height: number;\n displayedAt: string;\n };\n }\n | undefined => {\n const observed: IAutoMovieViewerDisplayMetadata | undefined =\n props.observe();\n if (observed === undefined) return undefined;\n const facts: IAutoMovieViewerDisplayMetadata = structuredClone(observed);\n const surface: HTMLCanvasElement = document.createElement(\"canvas\");\n try {\n if (props.paint !== undefined) props.paint(surface);\n else {\n surface.width = props.canvas.width;\n surface.height = props.canvas.height;\n const context: CanvasRenderingContext2D | null =\n surface.getContext(\"2d\");\n if (context === null)\n throw new Error(\n \"A 2D surface is required to retain the completed display.\",\n );\n context.drawImage(props.canvas, 0, 0);\n }\n return {\n surface,\n metadata: {\n ...facts,\n width: surface.width,\n height: surface.height,\n displayedAt: new Date().toISOString(),\n },\n };\n } catch (cause) {\n surface.width = 0;\n surface.height = 0;\n throw cause;\n }\n };\n let pending: ReturnType<typeof snapshot>;\n const flush: () => Promise<void> = async (): Promise<void> => {\n if (pending === undefined || running || !publication.active()) return;\n const {\n surface,\n metadata,\n }: {\n surface: HTMLCanvasElement;\n metadata: IAutoMovieViewerDisplayMetadata & {\n session?: string;\n generation?: number;\n width: number;\n height: number;\n displayedAt: string;\n };\n } = pending;\n pending = undefined;\n running = true;\n const sequenceId: number = ++sequence;\n try {\n const blob: Blob = await new Promise<Blob>(\n (\n resolve: (value: Blob | PromiseLike<Blob>) => void,\n reject: (reason?: unknown) => void,\n ): void => {\n surface.toBlob(\n (value: Blob | null): void =>\n value === null\n ? reject(new Error(\"The displayed frame could not be encoded.\"))\n : resolve(value),\n \"image/png\",\n );\n // The standard copies pixels before asynchronous serialization.\n surface.width = 0;\n surface.height = 0;\n },\n );\n if (!publication.active()) return;\n props.retain?.(blob);\n const data: string = await new Promise<string>(\n (\n resolve: (value: string | PromiseLike<string>) => void,\n reject: (reason?: unknown) => void,\n ): void => {\n const reading: FileReader = new FileReader();\n reader = reading;\n reading.onload = (): void => resolve(String(reading.result));\n reading.onerror = (): void =>\n reject(\n new Error(\"The encoded display could not be read.\", {\n cause: reading.error,\n }),\n );\n reading.onabort = (): void => reject(cancellation.signal.reason);\n reading.readAsDataURL(blob);\n },\n );\n reader = undefined;\n if (!publication.active()) return;\n const response: Response = await fetch(\"/display\", {\n signal: cancellation.signal,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ ...metadata, sequence: sequenceId, png: data }),\n });\n if (!response.ok) throw new Error(await response.text());\n } catch (cause) {\n if (!cancellation.signal.aborted)\n console.warn(\"AUTOMOVIE_DISPLAY_SAVE \" + String(cause));\n } finally {\n reader = undefined;\n surface.width = 0;\n surface.height = 0;\n running = false;\n if (pending !== undefined && publication.active()) void flush();\n }\n };\n const copy: () => boolean = (): boolean => {\n try {\n const completed:\n | {\n surface: HTMLCanvasElement;\n metadata: IAutoMovieViewerDisplayMetadata & {\n session?: string;\n generation?: number;\n width: number;\n height: number;\n displayedAt: string;\n };\n }\n | undefined = snapshot();\n if (completed === undefined) return false;\n if (pending !== undefined) {\n pending.surface.width = 0;\n pending.surface.height = 0;\n }\n pending = completed;\n return true;\n } catch (cause) {\n console.warn(\"AUTOMOVIE_DISPLAY_SAVE \" + String(cause));\n return false;\n }\n };\n const publication: {\n active: () => boolean;\n prepare: () => boolean;\n commit: (session: string, generation: number) => boolean;\n changed: () => boolean;\n dispose: () => void;\n } = createViewerDisplayPublication({\n copy,\n start: (session: string, generation: number): void => {\n // The lifecycle calls start only after a successful original copy.\n pending!.metadata.session = session;\n pending!.metadata.generation = generation;\n void flush();\n },\n release: (): void => {\n cancellation.abort();\n reader?.abort();\n if (pending !== undefined) {\n pending.surface.width = 0;\n pending.surface.height = 0;\n }\n pending = undefined;\n },\n });\n return publication;\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,wBAAwB,OAatC;CACA,IAAI,WAAmB;CACvB,IAAI,UAAmB;CACvB,MAAM,eAAgC,IAAI,gBAAgB;CAC1D,IAAI;CACJ,MAAM,iBAsBW;EACf,MAAM,WACJ,MAAM,QAAQ;EAChB,IAAI,aAAa,KAAA,GAAW,OAAO,KAAA;EACnC,MAAM,QAAyC,gBAAgB,QAAQ;EACvE,MAAM,UAA6B,SAAS,cAAc,QAAQ;EAClE,IAAI;GACF,IAAI,MAAM,UAAU,KAAA,GAAW,MAAM,MAAM,OAAO;QAC7C;IACH,QAAQ,QAAQ,MAAM,OAAO;IAC7B,QAAQ,SAAS,MAAM,OAAO;IAC9B,MAAM,UACJ,QAAQ,WAAW,IAAI;IACzB,IAAI,YAAY,MACd,MAAM,IAAI,MACR,2DACF;IACF,QAAQ,UAAU,MAAM,QAAQ,G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AAC,SAAS,IAAI,MAAM,IAAI,MAAM,MAAM,SAAS,KAAK,CAAC;EACzD,SAAS,OAAO;GACd,IAAI,CAAC,aAAa,OAAO,SACvB,QAAQ,KAAK,4BAA4B,OAAO,KAAK,CAAC;EAC1D,UAAU;GACR,SAAS,KAAA;GACT,QAAQ,QAAQ;GAChB,QAAQ,SAAS;GACjB,UAAU;GACV,IAAI,YAAY,KAAA,KAAa,YAAY,OAAO,GAAG,MAAW;EAChE;CACF;CACA,MAAM,aAAqC;EACzC,IAAI;GACF,MAAM,YAWU,SAAS;GACzB,IAAI,cAAc,KAAA,GAAW,OAAO;GACpC,IAAI,YAAY,KAAA,GAAW;IACzB,QAAQ,QAAQ,QAAQ;IACxB,QAAQ,QAAQ,SAAS;GAC3B;GACA,UAAU;GACV,OAAO;EACT,SAAS,OAAO;GACd,QAAQ,KAAK,4BAA4B,OAAO,KAAK,CAAC;GACtD,OAAO;EACT;CACF;CACA,MAAM,cAMF,+BAA+B;EACjC;EACA,QAAQ,SAAiB,eAA6B;GAEpD,QAAS,SAAS,UAAU;GAC5B,QAAS,SAAS,aAAa;GAC/B,MAAW;EACb;EACA,eAAqB;GACnB,aAAa,MAAM;GACnB,QAAQ,MAAM;GACd,IAAI,YAAY,KAAA,GAAW;IACzB,QAAQ,QAAQ,QAAQ;IACxB,QAAQ,QAAQ,SAAS;GAC3B;GACA,UAAU,KAAA;EACZ;CACF,CAAC;CACD,OAAO;AACT"}
@@ -7,17 +7,12 @@ import type { IAutoMovieViewerCompletedFrame } from "./IAutoMovieViewerCompleted
7
7
  * freeze lease. Only the final normal release resumes it; disposal releases it
8
8
  * with resume=false. The borrowed camera is the mount's camera, so switching
9
9
  * active-camera or other application state needs that application's adapter.
10
- *
11
- * @evidence contracts/development/implementation.md#principled-implementation Transfers the existing native camera snapshot and finite nonnegative completed seconds, then rebases and redraws through the original producer. Failed redraw independently restores the previous borrowed camera and mount base, preserving the source refusal before rollback causes; application graph/pixel rollback remains source-owned. Reference-counted freeze leases suppress producer ticks and pair the outermost producer pause with one final release, distinguishing resume from terminal disposal.
12
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Owns the actual controller used by mountViewer without creating a renderer or a second clock. Camera transfer stays with createViewerCameraState, and source clocks/audio remain behind an explicit producer lease.
13
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No timer, foreign method or synthetic completed frame is substituted. Invalid state refuses before camera mutation; a failed release preserves its cause and refuses further playback until terminal cleanup.
14
- * @evidence contracts/development/common.md#meaningful-documentation States nested ownership, explicit-draw behavior, terminal versus resumable release, borrowed camera scope and independent source-state responsibility.
15
- * @evidence contracts/development/implementation.md#efficient-algorithms Tick gating and lease accounting use constant work/storage; camera snapshots use the existing fixed-size native adapter and producer operations retain their own cost.
16
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Nested freezes share one outer producer lease; every returned release and terminal cleanup has one sticky attempt. Distinct redraws remain real producer effects.
17
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Retains one borrowed camera, callbacks, scalar lease count and at most one producer release. Final release or dispose consumes that release once; disposed controllers reject later effects and acquired producer resources remain governed by the producer's release callback.
18
10
  */
19
11
  export declare function createViewerFrameControl(options: {
20
- /** Native camera owned by this mount; other active cameras need their source adapter. */
12
+ /**
13
+ * Native camera owned by this mount; other active cameras need their source
14
+ * adapter.
15
+ */
21
16
  camera: THREE.Camera;
22
17
  /** Actual completed scene time, in seconds. */
23
18
  currentSeconds: () => number;
@@ -27,7 +22,10 @@ export declare function createViewerFrameControl(options: {
27
22
  rebase: (seconds: number) => void;
28
23
  /** Complete an original draw at these authoritative scene seconds. */
29
24
  redraw: (seconds: number) => void;
30
- /** Optional source pause; release(true) resumes, release(false) retires without resuming. */
25
+ /**
26
+ * Optional source pause; release(true) resumes, release(false) retires
27
+ * without resuming.
28
+ */
31
29
  freezeCompleted?: () => (resume: boolean) => void;
32
30
  }): {
33
31
  control: NonNullable<IAutoMovieViewerCompletedFrame["control"]>;
@@ -10,14 +10,6 @@ const createViewerCameraState_js_1 = require("./createViewerCameraState.js");
10
10
  * freeze lease. Only the final normal release resumes it; disposal releases it
11
11
  * with resume=false. The borrowed camera is the mount's camera, so switching
12
12
  * active-camera or other application state needs that application's adapter.
13
- *
14
- * @evidence contracts/development/implementation.md#principled-implementation Transfers the existing native camera snapshot and finite nonnegative completed seconds, then rebases and redraws through the original producer. Failed redraw independently restores the previous borrowed camera and mount base, preserving the source refusal before rollback causes; application graph/pixel rollback remains source-owned. Reference-counted freeze leases suppress producer ticks and pair the outermost producer pause with one final release, distinguishing resume from terminal disposal.
15
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Owns the actual controller used by mountViewer without creating a renderer or a second clock. Camera transfer stays with createViewerCameraState, and source clocks/audio remain behind an explicit producer lease.
16
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No timer, foreign method or synthetic completed frame is substituted. Invalid state refuses before camera mutation; a failed release preserves its cause and refuses further playback until terminal cleanup.
17
- * @evidence contracts/development/common.md#meaningful-documentation States nested ownership, explicit-draw behavior, terminal versus resumable release, borrowed camera scope and independent source-state responsibility.
18
- * @evidence contracts/development/implementation.md#efficient-algorithms Tick gating and lease accounting use constant work/storage; camera snapshots use the existing fixed-size native adapter and producer operations retain their own cost.
19
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Nested freezes share one outer producer lease; every returned release and terminal cleanup has one sticky attempt. Distinct redraws remain real producer effects.
20
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Retains one borrowed camera, callbacks, scalar lease count and at most one producer release. Final release or dispose consumes that release once; disposed controllers reject later effects and acquired producer resources remain governed by the producer's release callback.
21
13
  */
22
14
  function createViewerFrameControl(options) {
23
15
  const cameraState = (0, createViewerCameraState_js_1.createViewerCameraState)(options.camera);
@@ -42,16 +34,12 @@ function createViewerFrameControl(options) {
42
34
  },
43
35
  restore: (state) => {
44
36
  active();
45
- if (state === null || typeof state !== "object")
46
- throw new Error("Viewer transfer is not an object.");
47
- const seconds = Reflect.get(state, "elapsedSeconds");
48
- if (typeof seconds !== "number" ||
49
- !Number.isFinite(seconds) ||
50
- seconds < 0)
37
+ const seconds = state.elapsedSeconds;
38
+ if (seconds < 0)
51
39
  throw new Error("Viewer transfer has no valid time.");
52
40
  const previousCamera = cameraState.capture();
53
41
  const previousSeconds = options.currentSeconds();
54
- cameraState.restore(Reflect.get(state, "camera"));
42
+ cameraState.restore(state.camera);
55
43
  try {
56
44
  options.rebase(seconds);
57
45
  options.redraw(seconds);
@@ -1 +1 @@
1
- {"version":3,"file":"createViewerFrameControl.js","sourceRoot":"","sources":["../src/createViewerFrameControl.ts"],"names":[],"mappings":";;;AAAA,8CAG2B;AAI3B,6EAAuE;AAEvE;;;;;;;;;;;;;;;GAeG;AACH,kCAAyC,OAaxC;IAKC,MAAM,WAAW,GACf,IAAA,oDAAuB,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,MAAM,GAAW,CAAC,CAAC;IACvB,IAAI,eAAwD,CAAC;IAC7D,IAAI,MAAM,GAAY,KAAK,CAAC;IAC5B,IAAI,OAAuC,CAAC;IAC5C,MAAM,MAAM,GAAe,GAAS,EAAE;QACpC,IAAI,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QACtE,IAAI,OAAO,KAAK,SAAS;YAAE,MAAM,OAAO,CAAC,KAAK,CAAC;QAC/C,OAAO,CAAC,YAAY,EAAE,CAAC;IACzB,CAAC,CAAC;IACF,MAAM,OAAO,GAA2D;QACtE,OAAO,EAAE,GAAY,EAAE;YACrB,MAAM,EAAE,CAAC;YACT,OAAO;gBACL,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE;gBAC7B,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE;aACzC,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,CAAC,KAAc,EAAQ,EAAE;YAChC,MAAM,EAAE,CAAC;YACT,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;gB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I,EAAE,MAAM,KAAK,CAAC;oBAAE,OAAO;gBACrC,MAAM,OAAO,GACX,eAAe,CAAC;gBAClB,eAAe,GAAG,SAAS,CAAC;gBAC5B,IAAI,CAAC;oBACH,IAAA,wCAA+B,EAAC;wBAC9B,GAAS,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;wBACpD,GAAS,EAAE;4BACT,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;wBAClB,CAAC;qBACF,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,GAAG,EAAE,KAAK,EAAE,CAAC;oBACpB,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;IACF,OAAO;QACL,OAAO;QACP,KAAK,EAAE,CAAC,OAAmB,EAAQ,EAAE;YACnC,MAAM,EAAE,CAAC;YACT,IAAI,MAAM,KAAK,CAAC;gBAAE,OAAO,EAAE,CAAC;QAC9B,CAAC;QACD,OAAO,EAAE,IAAA,uCAA8B,EAAC,GAAS,EAAE;YACjD,MAAM,GAAG,IAAI,CAAC;YACd,MAAM,GAAG,CAAC,CAAC;YACX,MAAM,OAAO,GAA4C,eAAe,CAAC;YACzE,eAAe,GAAG,SAAS,CAAC;YAC5B,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"createViewerFrameControl.js","sourceRoot":"","sources":["../src/createViewerFrameControl.ts"],"names":[],"mappings":";;;AAAA,8CAG2B;AAM3B,6EAAuE;AAEvE;;;;;;;GAOG;AACH,kCAAyC,OAmBxC;IAKC,MAAM,WAAW,GACf,IAAA,oDAAuB,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,MAAM,GAAW,CAAC,CAAC;IACvB,IAAI,eAAwD,CAAC;IAC7D,IAAI,MAAM,GAAY,KAA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AACJ,CAAC"}
@@ -8,14 +8,6 @@ import { restoreAutoMovieRenderModeOnce, restoreAutoMovieRenderModeState } from
8
8
  * freeze lease. Only the final normal release resumes it; disposal releases it
9
9
  * with resume=false. The borrowed camera is the mount's camera, so switching
10
10
  * active-camera or other application state needs that application's adapter.
11
- *
12
- * @evidence contracts/development/implementation.md#principled-implementation Transfers the existing native camera snapshot and finite nonnegative completed seconds, then rebases and redraws through the original producer. Failed redraw independently restores the previous borrowed camera and mount base, preserving the source refusal before rollback causes; application graph/pixel rollback remains source-owned. Reference-counted freeze leases suppress producer ticks and pair the outermost producer pause with one final release, distinguishing resume from terminal disposal.
13
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Owns the actual controller used by mountViewer without creating a renderer or a second clock. Camera transfer stays with createViewerCameraState, and source clocks/audio remain behind an explicit producer lease.
14
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No timer, foreign method or synthetic completed frame is substituted. Invalid state refuses before camera mutation; a failed release preserves its cause and refuses further playback until terminal cleanup.
15
- * @evidence contracts/development/common.md#meaningful-documentation States nested ownership, explicit-draw behavior, terminal versus resumable release, borrowed camera scope and independent source-state responsibility.
16
- * @evidence contracts/development/implementation.md#efficient-algorithms Tick gating and lease accounting use constant work/storage; camera snapshots use the existing fixed-size native adapter and producer operations retain their own cost.
17
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Nested freezes share one outer producer lease; every returned release and terminal cleanup has one sticky attempt. Distinct redraws remain real producer effects.
18
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Retains one borrowed camera, callbacks, scalar lease count and at most one producer release. Final release or dispose consumes that release once; disposed controllers reject later effects and acquired producer resources remain governed by the producer's release callback.
19
11
  */
20
12
  function createViewerFrameControl(options) {
21
13
  const cameraState = createViewerCameraState(options.camera);
@@ -39,12 +31,11 @@ function createViewerFrameControl(options) {
39
31
  },
40
32
  restore: (state) => {
41
33
  active();
42
- if (state === null || typeof state !== "object") throw new Error("Viewer transfer is not an object.");
43
- const seconds = Reflect.get(state, "elapsedSeconds");
44
- if (typeof seconds !== "number" || !Number.isFinite(seconds) || seconds < 0) throw new Error("Viewer transfer has no valid time.");
34
+ const seconds = state.elapsedSeconds;
35
+ if (seconds < 0) throw new Error("Viewer transfer has no valid time.");
45
36
  const previousCamera = cameraState.capture();
46
37
  const previousSeconds = options.currentSeconds();
47
- cameraState.restore(Reflect.get(state, "camera"));
38
+ cameraState.restore(state.camera);
48
39
  try {
49
40
  options.rebase(seconds);
50
41
  options.redraw(seconds);
@@ -1 +1 @@
1
- {"version":3,"file":"createViewerFrameControl.mjs","names":[],"sources":["../src/createViewerFrameControl.ts"],"sourcesContent":["import {\n restoreAutoMovieRenderModeOnce,\n restoreAutoMovieRenderModeState,\n} from \"@automovie/render\";\nimport type * as THREE from \"three\";\n\nimport type { IAutoMovieViewerCompletedFrame } from \"./IAutoMovieViewerCompletedFrame.js\";\nimport { createViewerCameraState } from \"./createViewerCameraState.js\";\n\n/**\n * Own a mounted frame's camera/time controller and nested playback freezes.\n * Normal ticks run only outside a freeze; explicit redraw and restoration still\n * use the original producer. A producer-owned clock or audio supplies its own\n * freeze lease. Only the final normal release resumes it; disposal releases it\n * with resume=false. The borrowed camera is the mount's camera, so switching\n * active-camera or other application state needs that application's adapter.\n *\n * @evidence contracts/development/implementation.md#principled-implementation Transfers the existing native camera snapshot and finite nonnegative completed seconds, then rebases and redraws through the original producer. Failed redraw independently restores the previous borrowed camera and mount base, preserving the source refusal before rollback causes; application graph/pixel rollback remains source-owned. Reference-counted freeze leases suppress producer ticks and pair the outermost producer pause with one final release, distinguishing resume from terminal disposal.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure Owns the actual controller used by mountViewer without creating a renderer or a second clock. Camera transfer stays with createViewerCameraState, and source clocks/audio remain behind an explicit producer lease.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No timer, foreign method or synthetic completed frame is substituted. Invalid state refuses before camera mutation; a failed release preserves its cause and refuses further playback until terminal cleanup.\n * @evidence contracts/development/common.md#meaningful-documentation States nested ownership, explicit-draw behavior, terminal versus resumable release, borrowed camera scope and independent source-state responsibility.\n * @evidence contracts/development/implementation.md#efficient-algorithms Tick gating and lease accounting use constant work/storage; camera snapshots use the existing fixed-size native adapter and producer operations retain their own cost.\n * @evidence contracts/development/implementation.md#reuse-equivalent-work Nested freezes share one outer producer lease; every returned release and terminal cleanup has one sticky attempt. Distinct redraws remain real producer effects.\n * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Retains one borrowed camera, callbacks, scalar lease count and at most one producer release. Final release or dispose consumes that release once; disposed controllers reject later effects and acquired producer resources remain governed by the producer's release callback.\n */\nexport function createViewerFrameControl(options: {\n /** Native camera owned by this mount; other active cameras need their source adapter. */\n camera: THREE.Camera;\n /** Actual completed scene time, in seconds. */\n currentSeconds: () => number;\n /** Refuse operations after the mounted owner has stopped. */\n assertActive: () => void;\n /** Rebase the mount clock before an explicit restored draw or resumed tick. */\n rebase: (seconds: number) => void;\n /** Complete an original draw at these authoritative scene seconds. */\n redraw: (seconds: number) => void;\n /** Optional source pause; release(true) resumes, release(false) retires without resuming. */\n freezeCompleted?: () => (resume: boolean) => void;\n}): {\n control: NonNullable<IAutoMovieViewerCompletedFrame[\"control\"]>;\n frame: (produce: () => void) => void;\n dispose: () => void;\n} {\n const cameraState: ReturnType<typeof createViewerCameraState> =\n createViewerCameraState(options.camera);\n let leases: number = 0;\n let releaseProducer: ((resume: boolean) => void) | undefined;\n let closed: boolean = false;\n let failure: { error: unknown } | undefined;\n const active: () => void = (): void => {\n if (closed) throw new Error(\"The viewer frame controller is closed.\");\n if (failure !== undefined) throw failure.error;\n options.assertActive();\n };\n const control: NonNullable<IAutoMovieViewerCompletedFrame[\"control\"]> = {\n capture: (): unknown => {\n active();\n return {\n camera: cameraState.capture(),\n elapsedSeconds: options.currentSeconds(),\n };\n },\n restore: (state: unknown): void => {\n active();\n if (state === null || typeof state !== \"object\")\n throw new Error(\"Viewer transfer is not an object.\");\n const seconds: unknown = Reflect.get(state, \"elapsedSeconds\");\n if (\n typeof seconds !== \"number\" ||\n !Number.isFinite(seconds) ||\n seconds < 0\n )\n throw new Error(\"Viewer transfer has no valid time.\");\n const previousCamera: ReturnType<typeof cameraState.capture> =\n cameraState.capture();\n const previousSeconds: number = options.currentSeconds();\n cameraState.restore(Reflect.get(state, \"camera\"));\n try {\n options.rebase(seconds);\n options.redraw(seconds);\n } catch (error) {\n restoreAutoMovieRenderModeState(\n [\n (): void => cameraState.restore(previousCamera),\n (): void => options.rebase(previousSeconds),\n ],\n { error },\n );\n }\n },\n redraw: (): void => {\n active();\n options.redraw(options.currentSeconds());\n },\n freeze: (): (() => void) => {\n active();\n if (leases === 0) releaseProducer = options.freezeCompleted?.();\n ++leases;\n return restoreAutoMovieRenderModeOnce((): void => {\n if (closed || --leases !== 0) return;\n const release: ((resume: boolean) => void) | undefined =\n releaseProducer;\n releaseProducer = undefined;\n try {\n restoreAutoMovieRenderModeState([\n (): void => options.rebase(options.currentSeconds()),\n (): void => {\n release?.(true);\n },\n ]);\n } catch (error) {\n failure = { error };\n throw error;\n }\n });\n },\n };\n return {\n control,\n frame: (produce: () => void): void => {\n active();\n if (leases === 0) produce();\n },\n dispose: restoreAutoMovieRenderModeOnce((): void => {\n closed = true;\n leases = 0;\n const release: ((resume: boolean) => void) | undefined = releaseProducer;\n releaseProducer = undefined;\n release?.(false);\n }),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,yBAAyB,SAiBvC;CACA,MAAM,cACJ,wBAAwB,QAAQ,MAAM;CACxC,IAAI,SAAiB;CACrB,IAAI;CACJ,IAAI,SAAkB;CACtB,IAAI;CACJ,MAAM,eAAiC;EACrC,IAAI,QAAQ,MAAM,IAAI,MAAM,wCAAwC;EACpE,IAAI,YAAY,KAAA,GAAW,MAAM,QAAQ;EACzC,QAAQ,aAAa;CACvB;CAgEA,OAAO;EACL,SAAA;GA/DA,eAAwB;IACtB,OAAO;IACP,OAAO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"version":3,"file":"createViewerFrameControl.mjs","names":[],"sources":["../src/createViewerFrameControl.ts"],"sourcesContent":["import {\n restoreAutoMovieRenderModeOnce,\n restoreAutoMovieRenderModeState,\n} from \"@automovie/render\";\nimport type * as THREE from \"three\";\n\nimport type { IAutoMovieViewerCompletedFrame } from \"./IAutoMovieViewerCompletedFrame.js\";\nimport type { IViewerCameraStateSnapshot } from \"./IViewerCameraStateSnapshot.js\";\nimport type { IViewerFrameTransfer } from \"./IViewerFrameTransfer.js\";\nimport { createViewerCameraState } from \"./createViewerCameraState.js\";\n\n/**\n * Own a mounted frame's camera/time controller and nested playback freezes.\n * Normal ticks run only outside a freeze; explicit redraw and restoration still\n * use the original producer. A producer-owned clock or audio supplies its own\n * freeze lease. Only the final normal release resumes it; disposal releases it\n * with resume=false. The borrowed camera is the mount's camera, so switching\n * active-camera or other application state needs that application's adapter.\n */\nexport function createViewerFrameControl(options: {\n /**\n * Native camera owned by this mount; other active cameras need their source\n * adapter.\n */\n camera: THREE.Camera;\n /** Actual completed scene time, in seconds. */\n currentSeconds: () => number;\n /** Refuse operations after the mounted owner has stopped. */\n assertActive: () => void;\n /** Rebase the mount clock before an explicit restored draw or resumed tick. */\n rebase: (seconds: number) => void;\n /** Complete an original draw at these authoritative scene seconds. */\n redraw: (seconds: number) => void;\n /**\n * Optional source pause; release(true) resumes, release(false) retires\n * without resuming.\n */\n freezeCompleted?: () => (resume: boolean) => void;\n}): {\n control: NonNullable<IAutoMovieViewerCompletedFrame[\"control\"]>;\n frame: (produce: () => void) => void;\n dispose: () => void;\n} {\n const cameraState: ReturnType<typeof createViewerCameraState> =\n createViewerCameraState(options.camera);\n let leases: number = 0;\n let releaseProducer: ((resume: boolean) => void) | undefined;\n let closed: boolean = false;\n let failure: { error: unknown } | undefined;\n const active: () => void = (): void => {\n if (closed) throw new Error(\"The viewer frame controller is closed.\");\n if (failure !== undefined) throw failure.error;\n options.assertActive();\n };\n const control: NonNullable<IAutoMovieViewerCompletedFrame[\"control\"]> = {\n capture: (): IViewerFrameTransfer => {\n active();\n return {\n camera: cameraState.capture(),\n elapsedSeconds: options.currentSeconds(),\n };\n },\n restore: (state: IViewerFrameTransfer): void => {\n active();\n const seconds: number = state.elapsedSeconds;\n if (seconds < 0) throw new Error(\"Viewer transfer has no valid time.\");\n const previousCamera: IViewerCameraStateSnapshot = cameraState.capture();\n const previousSeconds: number = options.currentSeconds();\n cameraState.restore(state.camera);\n try {\n options.rebase(seconds);\n options.redraw(seconds);\n } catch (error) {\n restoreAutoMovieRenderModeState(\n [\n (): void => cameraState.restore(previousCamera),\n (): void => options.rebase(previousSeconds),\n ],\n { error },\n );\n }\n },\n redraw: (): void => {\n active();\n options.redraw(options.currentSeconds());\n },\n freeze: (): (() => void) => {\n active();\n if (leases === 0) releaseProducer = options.freezeCompleted?.();\n ++leases;\n return restoreAutoMovieRenderModeOnce((): void => {\n if (closed || --leases !== 0) return;\n const release: ((resume: boolean) => void) | undefined =\n releaseProducer;\n releaseProducer = undefined;\n try {\n restoreAutoMovieRenderModeState([\n (): void => options.rebase(options.currentSeconds()),\n (): void => {\n release?.(true);\n },\n ]);\n } catch (error) {\n failure = { error };\n throw error;\n }\n });\n },\n };\n return {\n control,\n frame: (produce: () => void): void => {\n active();\n if (leases === 0) produce();\n },\n dispose: restoreAutoMovieRenderModeOnce((): void => {\n closed = true;\n leases = 0;\n const release: ((resume: boolean) => void) | undefined = releaseProducer;\n releaseProducer = undefined;\n release?.(false);\n }),\n };\n}\n"],"mappings":";;;;;;;;;;;AAmBA,SAAgB,yBAAyB,SAuBvC;CACA,MAAM,cACJ,wBAAwB,QAAQ,MAAM;CACxC,IAAI,SAAiB;CACrB,IAAI;CACJ,IAAI,SAAkB;CACtB,IAAI;CACJ,MAAM,eAAiC;EACrC,IAAI,QAAQ,MAAM,IAAI,MAAM,wCAAwC;EACpE,IAAI,YAAY,KAAA,GAAW,MAAM,QAAQ;EACzC,QAAQ,aAAa;CACvB;CAwDA,OAAO;EACL,SAAA;GAvDA,eAAqC;IACnC,OAAO;IACP,OAAO;KACL,QAAQ,YAAY,QAAQ;KAC5B,gBAAgB,QAAQ,eAAe;IACzC;GACF;GACA,UAAU,UAAsC;IAC9C,OAAO;IACP,MAAM,UAAkB,MAAM;IAC9B,IAAI,UAAU,GAAG,MAAM,IAAI,MAAM,oCAAoC;IACrE,MAAM,iBAA6C,YAAY,QAAQ;IACvE,MAAM,kBAA0B,QAAQ,eAAe;IACvD,YAAY,QAAQ,MAAM,MAAM;IAChC,IAAI;KACF,QAAQ,OAAO,OAAO;KACtB,QAAQ,OAAO,OAAO;IACxB,SAAS,OAAO;KACd,gCACE,OACc,YAAY,QAAQ,cAAc,SAClC,QAAQ,OAAO,eAAe,CAC5C,GACA,EAAE,MAAM,CACV;IACF;GACF;GACA,cAAoB;IAClB,OAAO;IACP,QAAQ,OAAO,QAAQ,eAAe,CAAC;GACzC;GACA,cAA4B;IAC1B,OAAO;IACP,IAAI,WAAW,GAAG,kBAAkB,QAAQ,kBAAkB;IAC9D,EAAE;IACF,OAAO,qCAA2C;KAChD,IAAI,UAAU,EAAE,WAAW,GAAG;KAC9B,MAAM,UACJ;KACF,kBAAkB,KAAA;KAClB,IAAI;MACF,gCAAgC,OAClB,QAAQ,OAAO,QAAQ,eAAe,CAAC,SACvC;OACV,UAAU,IAAI;MAChB,CACF,CAAC;KACH,SAAS,OAAO;MACd,UAAU,EAAE,MAAM;MAClB,MAAM;KACR;IACF,CAAC;GACH;EAGM;EACN,QAAQ,YAA8B;GACpC,OAAO;GACP,IAAI,WAAW,GAAG,QAAQ;EAC5B;EACA,SAAS,qCAA2C;GAClD,SAAS;GACT,SAAS;GACT,MAAM,UAAmD;GACzD,kBAAkB,KAAA;GAClB,UAAU,KAAK;EACjB,CAAC;CACH;AACF"}
@@ -1,16 +1,8 @@
1
1
  import * as THREE from "three";
2
2
  /**
3
- * Synchronize a perspective viewport with its CSS size and selected pixel ratio.
4
- * The renderer updates its drawing buffer without changing authored CSS layout.
5
- * The returned function reports a changed raster or projection so the caller can
6
- * redraw its original producer at the current completed time.
7
- *
8
- * @evidence contracts/development/implementation.md#principled-implementation Uses the native renderer's logical-size/pixel-ratio contract and native perspective aspect/projection update. Positive integer CSS dimensions, finite positive pixel ratio and positive canvas unsigned-long physical extents are admitted before mutation; setDrawingBufferSize changes backing storage without assigning CSS dimensions. Device-specific GPU size limits remain with native renderer admission.
9
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One adapter owns raster/projection synchronization and reports invalidation; mountViewer owns layout observation, original drawing and lifetime.
10
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No camera matrix or foreign renderer method is replaced and no capture raster is silently rescaled; the caller selects a fixed ratio or supplies current device ratio.
11
- * @evidence contracts/development/common.md#meaningful-documentation States CSS versus backing dimensions, perspective-only scope, admitted units and original-producer redraw responsibility.
12
- * @evidence contracts/development/implementation.md#efficient-algorithms Each call performs fixed-size comparisons and at most one native drawing-buffer resize plus one projection update; unchanged viewport calls allocate no new vector or renderer resource.
13
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Reuses one Vector2 scratch and reads the renderer's actual logical size/pixel ratio, preserving external size changes instead of relying on an independent stale cache.
14
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Retains only borrowed renderer/camera references and one vector; owns no listener, observer, timer or GPU context. The mounted renderer owns resized native storage and its terminal retirement.
3
+ * Synchronize a perspective viewport with its CSS size and selected pixel
4
+ * ratio. The renderer updates its drawing buffer without changing authored CSS
5
+ * layout. The returned function reports a changed raster or projection so the
6
+ * caller can redraw its original producer at the current completed time.
15
7
  */
16
8
  export declare function createViewerViewportResize(renderer: Pick<THREE.WebGLRenderer, "getSize" | "getPixelRatio" | "setDrawingBufferSize">, camera: THREE.PerspectiveCamera): (width: number, height: number, pixelRatio: number) => boolean;
@@ -36,30 +36,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.createViewerViewportResize = createViewerViewportResize;
37
37
  const THREE = __importStar(require("three"));
38
38
  /**
39
- * Synchronize a perspective viewport with its CSS size and selected pixel ratio.
40
- * The renderer updates its drawing buffer without changing authored CSS layout.
41
- * The returned function reports a changed raster or projection so the caller can
42
- * redraw its original producer at the current completed time.
43
- *
44
- * @evidence contracts/development/implementation.md#principled-implementation Uses the native renderer's logical-size/pixel-ratio contract and native perspective aspect/projection update. Positive integer CSS dimensions, finite positive pixel ratio and positive canvas unsigned-long physical extents are admitted before mutation; setDrawingBufferSize changes backing storage without assigning CSS dimensions. Device-specific GPU size limits remain with native renderer admission.
45
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One adapter owns raster/projection synchronization and reports invalidation; mountViewer owns layout observation, original drawing and lifetime.
46
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No camera matrix or foreign renderer method is replaced and no capture raster is silently rescaled; the caller selects a fixed ratio or supplies current device ratio.
47
- * @evidence contracts/development/common.md#meaningful-documentation States CSS versus backing dimensions, perspective-only scope, admitted units and original-producer redraw responsibility.
48
- * @evidence contracts/development/implementation.md#efficient-algorithms Each call performs fixed-size comparisons and at most one native drawing-buffer resize plus one projection update; unchanged viewport calls allocate no new vector or renderer resource.
49
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Reuses one Vector2 scratch and reads the renderer's actual logical size/pixel ratio, preserving external size changes instead of relying on an independent stale cache.
50
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Retains only borrowed renderer/camera references and one vector; owns no listener, observer, timer or GPU context. The mounted renderer owns resized native storage and its terminal retirement.
39
+ * Synchronize a perspective viewport with its CSS size and selected pixel
40
+ * ratio. The renderer updates its drawing buffer without changing authored CSS
41
+ * layout. The returned function reports a changed raster or projection so the
42
+ * caller can redraw its original producer at the current completed time.
51
43
  */
52
44
  function createViewerViewportResize(renderer, camera) {
53
45
  const size = new THREE.Vector2();
54
46
  return (width, height, pixelRatio) => {
55
- if (!Number.isSafeInteger(width) ||
56
- width <= 0 ||
57
- !Number.isSafeInteger(height) ||
58
- height <= 0 ||
59
- !Number.isFinite(pixelRatio) ||
60
- pixelRatio <= 0)
61
- throw new Error("Viewer viewport requires positive integer CSS dimensions and finite positive pixel ratio.");
62
- if (![Math.floor(width * pixelRatio), Math.floor(height * pixelRatio)].every((extent) => Number.isSafeInteger(extent) && extent > 0 && extent <= 0xffffffff))
47
+ if (width <= 0 || height <= 0 || pixelRatio <= 0)
48
+ throw new Error("Viewer viewport requires positive CSS dimensions and a positive pixel ratio.");
49
+ if (![Math.floor(width * pixelRatio), Math.floor(height * pixelRatio)].every((extent) => extent > 0 && extent <= 0xffffffff))
63
50
  throw new Error("Viewer drawing-buffer dimensions must fit positive canvas unsigned-long extents.");
64
51
  renderer.getSize(size);
65
52
  const rasterChanged = size.x !== width ||
@@ -1 +1 @@
1
- {"version":3,"file":"createViewerViewportResize.js","sourceRoot":"","sources":["../src/createViewerViewportResize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,KAAK,kCAAc;AAE/B;;;;;;;;;;;;;GAaG;AACH,oCACE,QAGC,EACD,MAA+B;IAE/B,MAAM,IAAI,GAAkB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;IAChD,OAAO,CAAC,KAAa,EAAE,MAAc,EAAE,UAAkB,EAAW,EAAE;QACpE,IACE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;YAC5B,KAAK,IAAI,CAAC;YACV,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC;YAC7B,MAAM,IAAI,CAAC;YACX,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;YAC5B,UAAU,IAAI,CAAC;YAEf,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,CAAC;QACJ,IACE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CACtE,CAAC,MAAc,EAAW,EAAE,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AAU,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CACtE,CAAC,MAAc,EAAW,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,UAAU,CAChE;YAED,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;QACJ,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,aAAa,GACjB,IAAI,CAAC,CAAC,KAAK,KAAK;YAChB,IAAI,CAAC,CAAC,KAAK,MAAM;YACjB,QAAQ,CAAC,aAAa,EAAE,KAAK,UAAU,CAAC;QAC1C,MAAM,iBAAiB,GAAY,MAAM,CAAC,MAAM,KAAK,KAAK,GAAG,MAAM,CAAC;QACpE,IAAI,CAAC,aAAa,IAAI,CAAC,iBAAiB;YAAE,OAAO,KAAK,CAAC;QACvD,IAAI,aAAa;YAAE,QAAQ,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC5E,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;QAC/B,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
@@ -1,24 +1,16 @@
1
1
  import * as THREE from "three";
2
2
  // src/createViewerViewportResize.ts
3
3
  /**
4
- * Synchronize a perspective viewport with its CSS size and selected pixel ratio.
5
- * The renderer updates its drawing buffer without changing authored CSS layout.
6
- * The returned function reports a changed raster or projection so the caller can
7
- * redraw its original producer at the current completed time.
8
- *
9
- * @evidence contracts/development/implementation.md#principled-implementation Uses the native renderer's logical-size/pixel-ratio contract and native perspective aspect/projection update. Positive integer CSS dimensions, finite positive pixel ratio and positive canvas unsigned-long physical extents are admitted before mutation; setDrawingBufferSize changes backing storage without assigning CSS dimensions. Device-specific GPU size limits remain with native renderer admission.
10
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One adapter owns raster/projection synchronization and reports invalidation; mountViewer owns layout observation, original drawing and lifetime.
11
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No camera matrix or foreign renderer method is replaced and no capture raster is silently rescaled; the caller selects a fixed ratio or supplies current device ratio.
12
- * @evidence contracts/development/common.md#meaningful-documentation States CSS versus backing dimensions, perspective-only scope, admitted units and original-producer redraw responsibility.
13
- * @evidence contracts/development/implementation.md#efficient-algorithms Each call performs fixed-size comparisons and at most one native drawing-buffer resize plus one projection update; unchanged viewport calls allocate no new vector or renderer resource.
14
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Reuses one Vector2 scratch and reads the renderer's actual logical size/pixel ratio, preserving external size changes instead of relying on an independent stale cache.
15
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Retains only borrowed renderer/camera references and one vector; owns no listener, observer, timer or GPU context. The mounted renderer owns resized native storage and its terminal retirement.
4
+ * Synchronize a perspective viewport with its CSS size and selected pixel
5
+ * ratio. The renderer updates its drawing buffer without changing authored CSS
6
+ * layout. The returned function reports a changed raster or projection so the
7
+ * caller can redraw its original producer at the current completed time.
16
8
  */
17
9
  function createViewerViewportResize(renderer, camera) {
18
10
  const size = new THREE.Vector2();
19
11
  return (width, height, pixelRatio) => {
20
- if (!Number.isSafeInteger(width) || width <= 0 || !Number.isSafeInteger(height) || height <= 0 || !Number.isFinite(pixelRatio) || pixelRatio <= 0) throw new Error("Viewer viewport requires positive integer CSS dimensions and finite positive pixel ratio.");
21
- if (![Math.floor(width * pixelRatio), Math.floor(height * pixelRatio)].every((extent) => Number.isSafeInteger(extent) && extent > 0 && extent <= 4294967295)) throw new Error("Viewer drawing-buffer dimensions must fit positive canvas unsigned-long extents.");
12
+ if (width <= 0 || height <= 0 || pixelRatio <= 0) throw new Error("Viewer viewport requires positive CSS dimensions and a positive pixel ratio.");
13
+ if (![Math.floor(width * pixelRatio), Math.floor(height * pixelRatio)].every((extent) => extent > 0 && extent <= 4294967295)) throw new Error("Viewer drawing-buffer dimensions must fit positive canvas unsigned-long extents.");
22
14
  renderer.getSize(size);
23
15
  const rasterChanged = size.x !== width || size.y !== height || renderer.getPixelRatio() !== pixelRatio;
24
16
  const projectionChanged = camera.aspect !== width / height;
@@ -1 +1 @@
1
- {"version":3,"file":"createViewerViewportResize.mjs","names":[],"sources":["../src/createViewerViewportResize.ts"],"sourcesContent":["import * as THREE from \"three\";\n\n/**\n * Synchronize a perspective viewport with its CSS size and selected pixel ratio.\n * The renderer updates its drawing buffer without changing authored CSS layout.\n * The returned function reports a changed raster or projection so the caller can\n * redraw its original producer at the current completed time.\n *\n * @evidence contracts/development/implementation.md#principled-implementation Uses the native renderer's logical-size/pixel-ratio contract and native perspective aspect/projection update. Positive integer CSS dimensions, finite positive pixel ratio and positive canvas unsigned-long physical extents are admitted before mutation; setDrawingBufferSize changes backing storage without assigning CSS dimensions. Device-specific GPU size limits remain with native renderer admission.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure One adapter owns raster/projection synchronization and reports invalidation; mountViewer owns layout observation, original drawing and lifetime.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No camera matrix or foreign renderer method is replaced and no capture raster is silently rescaled; the caller selects a fixed ratio or supplies current device ratio.\n * @evidence contracts/development/common.md#meaningful-documentation States CSS versus backing dimensions, perspective-only scope, admitted units and original-producer redraw responsibility.\n * @evidence contracts/development/implementation.md#efficient-algorithms Each call performs fixed-size comparisons and at most one native drawing-buffer resize plus one projection update; unchanged viewport calls allocate no new vector or renderer resource.\n * @evidence contracts/development/implementation.md#reuse-equivalent-work Reuses one Vector2 scratch and reads the renderer's actual logical size/pixel ratio, preserving external size changes instead of relying on an independent stale cache.\n * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Retains only borrowed renderer/camera references and one vector; owns no listener, observer, timer or GPU context. The mounted renderer owns resized native storage and its terminal retirement.\n */\nexport function createViewerViewportResize(\n renderer: Pick<\n THREE.WebGLRenderer,\n \"getSize\" | \"getPixelRatio\" | \"setDrawingBufferSize\"\n >,\n camera: THREE.PerspectiveCamera,\n): (width: number, height: number, pixelRatio: number) => boolean {\n const size: THREE.Vector2 = new THREE.Vector2();\n return (width: number, height: number, pixelRatio: number): boolean => {\n if (\n !Number.isSafeInteger(width) ||\n width <= 0 ||\n !Number.isSafeInteger(height) ||\n height <= 0 ||\n !Number.isFinite(pixelRatio) ||\n pixelRatio <= 0\n )\n throw new Error(\n \"Viewer viewport requires positive integer CSS dimensions and finite positive pixel ratio.\",\n );\n if (\n ![Math.floor(width * pixelRatio), Math.floor(height * pixelRatio)].every(\n (extent: number): boolean =>\n Number.isSafeInteger(extent) && extent > 0 && extent <= 0xffffffff,\n )\n )\n throw new Error(\n \"Viewer drawing-buffer dimensions must fit positive canvas unsigned-long extents.\",\n );\n renderer.getSize(size);\n const rasterChanged: boolean =\n size.x !== width ||\n size.y !== height ||\n renderer.getPixelRatio() !== pixelRatio;\n const projectionChanged: boolean = camera.aspect !== width / height;\n if (!rasterChanged && !projectionChanged) return false;\n if (rasterChanged) renderer.setDrawingBufferSize(width, height, pixelRatio);\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n return true;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgB,2BACd,UAIA,QACgE;CAChE,MAAM,OAAsB,IAAI,MAAM,QAAQ;CAC9C,QAAQ,OAAe,QAAgB,eAAgC;EACrE,IACE,CAAC,OAAO,cAAc,KAAK,KAC3B,SAAS,KACT,CAAC,OAAO,cAAc,MAAM,KAC5B,UAAU,KACV,CAAC,OAAO,SAAS,UAAU,KAC3B,cAAc,GAEd,MAAM,IAAI,MACR,2FACF;EACF,IACE,CAAC,CAAC,KAAK,MAAM,QAAQ,UAAU,GAAG,KAAK,MAAM,SAAS,UAAU,CAAC,CAAC,CAAC,OAChE,WACC,OAAO,cAAc,MAAM,KAAK,SAAS,KAAK,UAAU,UAC5D,GAEA,MAAM,IAAI,MACR,kFACF;EACF,SAAS,QAAQ,IAAI;EACrB,MAAM,gBACJ,KAAK,MAAM,SACX,KAAK,MAAM,UACX,SAAS,cAAc,MAAM;EAC/B,MAAM,oBAA6B,OAAO,WAAW,QAAQ;EAC7D,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,OAAO;EACjD,IAAI,eAAe,SAAS,qBAAqB,OAAO,QAAQ,UAAU;EAC1E,OAAO,SAAS,QAAQ;EACxB,OAAO,uBAAuB;EAC9B,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"createViewerViewportResize.mjs","names":[],"sources":["../src/createViewerViewportResize.ts"],"sourcesContent":["import * as THREE from \"three\";\n\n/**\n * Synchronize a perspective viewport with its CSS size and selected pixel\n * ratio. The renderer updates its drawing buffer without changing authored CSS\n * layout. The returned function reports a changed raster or projection so the\n * caller can redraw its original producer at the current completed time.\n */\nexport function createViewerViewportResize(\n renderer: Pick<\n THREE.WebGLRenderer,\n \"getSize\" | \"getPixelRatio\" | \"setDrawingBufferSize\"\n >,\n camera: THREE.PerspectiveCamera,\n): (width: number, height: number, pixelRatio: number) => boolean {\n const size: THREE.Vector2 = new THREE.Vector2();\n return (width: number, height: number, pixelRatio: number): boolean => {\n if (width <= 0 || height <= 0 || pixelRatio <= 0)\n throw new Error(\n \"Viewer viewport requires positive CSS dimensions and a positive pixel ratio.\",\n );\n if (\n ![Math.floor(width * pixelRatio), Math.floor(height * pixelRatio)].every(\n (extent: number): boolean => extent > 0 && extent <= 0xffffffff,\n )\n )\n throw new Error(\n \"Viewer drawing-buffer dimensions must fit positive canvas unsigned-long extents.\",\n );\n renderer.getSize(size);\n const rasterChanged: boolean =\n size.x !== width ||\n size.y !== height ||\n renderer.getPixelRatio() !== pixelRatio;\n const projectionChanged: boolean = camera.aspect !== width / height;\n if (!rasterChanged && !projectionChanged) return false;\n if (rasterChanged) renderer.setDrawingBufferSize(width, height, pixelRatio);\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n return true;\n };\n}\n"],"mappings":";;;;;;;;AAQA,SAAgB,2BACd,UAIA,QACgE;CAChE,MAAM,OAAsB,IAAI,MAAM,QAAQ;CAC9C,QAAQ,OAAe,QAAgB,eAAgC;EACrE,IAAI,SAAS,KAAK,UAAU,KAAK,cAAc,GAC7C,MAAM,IAAI,MACR,8EACF;EACF,IACE,CAAC,CAAC,KAAK,MAAM,QAAQ,UAAU,GAAG,KAAK,MAAM,SAAS,UAAU,CAAC,CAAC,CAAC,OAChE,WAA4B,SAAS,KAAK,UAAU,UACvD,GAEA,MAAM,IAAI,MACR,kFACF;EACF,SAAS,QAAQ,IAAI;EACrB,MAAM,gBACJ,KAAK,MAAM,SACX,KAAK,MAAM,UACX,SAAS,cAAc,MAAM;EAC/B,MAAM,oBAA6B,OAAO,WAAW,QAAQ;EAC7D,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,OAAO;EACjD,IAAI,eAAe,SAAS,qBAAqB,OAAO,QAAQ,UAAU;EAC1E,OAAO,SAAS,QAAQ;EACxB,OAAO,uBAAuB;EAC9B,OAAO;CACT;AACF"}
package/lib/index.d.ts CHANGED
@@ -14,5 +14,6 @@ export * from "./audio/index.js";
14
14
  export * from "./inspector/index.js";
15
15
  export * from "./transport/index.js";
16
16
  export * from "./IViewerCameraStateSnapshot.js";
17
+ export * from "./IViewerFrameTransfer.js";
17
18
  export * from "./createViewerDisplayClock.js";
18
19
  export * from "./createViewerDisplayPublication.js";
package/lib/index.js CHANGED
@@ -30,6 +30,7 @@ __exportStar(require("./audio/index.js"), exports);
30
30
  __exportStar(require("./inspector/index.js"), exports);
31
31
  __exportStar(require("./transport/index.js"), exports);
32
32
  __exportStar(require("./IViewerCameraStateSnapshot.js"), exports);
33
+ __exportStar(require("./IViewerFrameTransfer.js"), exports);
33
34
  __exportStar(require("./createViewerDisplayClock.js"), exports);
34
35
  __exportStar(require("./createViewerDisplayPublication.js"), exports);
35
36
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,8DAA4C;AAC5C,4DAA0C;AAC1C,mDAAiC;AACjC,+DAA6C;AAC7C,uEAAqD;AACrD,sEAAoD;AACpD,mEAAiD;AACjD,+DAA6C;AAC7C,gEAA8C;AAC9C,kEAAgD;AAChD,kEAAgD;AAChD,mDAAiC;AACjC,uDAAqC;AACrC,uDAAqC;AACrC,kEAAgD;AAChD,gEAA8C;AAC9C,sEAAoD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,8DAA4C;AAC5C,4DAA0C;AAC1C,mDAAiC;AACjC,+DAA6C;AAC7C,uEAAqD;AACrD,sEAAoD;AACpD,mEAAiD;AACjD,+DAA6C;AAC7C,gEAA8C;AAC9C,kEAAgD;AAChD,kEAAgD;AAChD,mDAAiC;AACjC,uDAAqC;AACrC,uDAAqC;AACrC,kEAAgD;AAChD,4DAA0C;AAC1C,gEAA8C;AAC9C,sEAAoD"}
package/lib/index.mjs CHANGED
@@ -11,6 +11,9 @@ import { createViewerViewportResize } from "./createViewerViewportResize.mjs";
11
11
  import { redrawViewerCompletedFrame } from "./redrawViewerCompletedFrame.mjs";
12
12
  import "./inspector/index.mjs";
13
13
  import { createViewerDisplayClock } from "./createViewerDisplayClock.mjs";
14
+ import { locateAutoMovieInspectorFinding } from "./inspector/locateAutoMovieInspectorFinding.mjs";
15
+ import { showAutoMovieInspectorFinding } from "./inspector/showAutoMovieInspectorFinding.mjs";
16
+ import { AutoMovieInspectorDiagnosticsPanel } from "./inspector/AutoMovieInspectorDiagnosticsPanel.mjs";
14
17
  import { AutoMovieInspectorMarksPanel } from "./inspector/AutoMovieInspectorMarksPanel.mjs";
15
18
  import { AutoMovieInspectorPlayhead } from "./inspector/AutoMovieInspectorPlayhead.mjs";
16
19
  import { formatAutoMovieInspectorAddress } from "./inspector/formatAutoMovieInspectorAddress.mjs";
@@ -19,6 +22,7 @@ import { AutoMovieInspectorRequestPanel } from "./inspector/AutoMovieInspectorRe
19
22
  import { buildAutoMovieInspectorPathTree } from "./inspector/buildAutoMovieInspectorPathTree.mjs";
20
23
  import { AutoMovieInspectorSelectionPanel } from "./inspector/AutoMovieInspectorSelectionPanel.mjs";
21
24
  import { AutoMovieInspectorShadePanel } from "./inspector/AutoMovieInspectorShadePanel.mjs";
25
+ import { stopAutoMovieInspectorTime } from "./inspector/stopAutoMovieInspectorTime.mjs";
22
26
  import { AutoMovieInspectorTimeReadout } from "./inspector/AutoMovieInspectorTimeReadout.mjs";
23
27
  import { AutoMovieInspectorTimePanel } from "./inspector/AutoMovieInspectorTimePanel.mjs";
24
28
  import { AutoMovieInspectorViewPanel } from "./inspector/AutoMovieInspectorViewPanel.mjs";
@@ -27,6 +31,7 @@ import { readAutoMovieInspectorAddress } from "./inspector/readAutoMovieInspecto
27
31
  import { reduceAutoMovieInspectorState } from "./inspector/reduceAutoMovieInspectorState.mjs";
28
32
  import { createAutoMovieInspectorState } from "./inspector/createAutoMovieInspectorState.mjs";
29
33
  import { handleAutoMovieInspectorKey } from "./inspector/handleAutoMovieInspectorKey.mjs";
34
+ import { AutoMovieInspectorTransition } from "./inspector/AutoMovieInspectorTransition.mjs";
30
35
  import { mountAutoMovieInspectorScene } from "./inspector/mountAutoMovieInspectorScene.mjs";
31
36
  import { AutoMovieInspector } from "./inspector/AutoMovieInspector.mjs";
32
37
  import { createAutoMovieInspectorAddressWriter } from "./inspector/createAutoMovieInspectorAddressWriter.mjs";
@@ -34,4 +39,4 @@ import { mountAutoMovieInspectorPage } from "./inspector/mountAutoMovieInspector
34
39
  import { createViewerDisplayPublication } from "./createViewerDisplayPublication.mjs";
35
40
  import { AutoMovieViewerTransport } from "./transport/AutoMovieViewerTransport.mjs";
36
41
  import { readAutoMovieReviewInterval } from "./transport/readAutoMovieReviewInterval.mjs";
37
- export { AutoMovieInspector, AutoMovieInspectorMarksPanel, AutoMovieInspectorPlayhead, AutoMovieInspectorRequestPanel, AutoMovieInspectorSelectionPanel, AutoMovieInspectorShadePanel, AutoMovieInspectorTimePanel, AutoMovieInspectorTimeReadout, AutoMovieInspectorViewPanel, AutoMovieViewerTransport, applyCaptureCanvasSize, buildAutoMovieInspectorPathTree, createAutoMovieInspectorAddressWriter, createAutoMovieInspectorCanvasHost, createAutoMovieInspectorState, createViewerCameraState, createViewerDisplayClock, createViewerDisplayPublication, createViewerDisplaySave, createViewerFrameControl, createViewerViewportResize, formatAutoMovieInspectorAddress, formatAutoMovieInspectorCommand, handleAutoMovieInspectorKey, mountAutoMovieInspectorPage, mountAutoMovieInspectorScene, mountViewer, planAutoMovieAudioPlayback, playAutoMovieAudioCues, publishViewerCompletedFrame, readAutoMovieInspectorAddress, readAutoMovieReviewInterval, redrawViewerCompletedFrame, reduceAutoMovieInspectorState, releaseMountedViewer };
42
+ export { AutoMovieInspector, AutoMovieInspectorDiagnosticsPanel, AutoMovieInspectorMarksPanel, AutoMovieInspectorPlayhead, AutoMovieInspectorRequestPanel, AutoMovieInspectorSelectionPanel, AutoMovieInspectorShadePanel, AutoMovieInspectorTimePanel, AutoMovieInspectorTimeReadout, AutoMovieInspectorTransition, AutoMovieInspectorViewPanel, AutoMovieViewerTransport, applyCaptureCanvasSize, buildAutoMovieInspectorPathTree, createAutoMovieInspectorAddressWriter, createAutoMovieInspectorCanvasHost, createAutoMovieInspectorState, createViewerCameraState, createViewerDisplayClock, createViewerDisplayPublication, createViewerDisplaySave, createViewerFrameControl, createViewerViewportResize, formatAutoMovieInspectorAddress, formatAutoMovieInspectorCommand, handleAutoMovieInspectorKey, locateAutoMovieInspectorFinding, mountAutoMovieInspectorPage, mountAutoMovieInspectorScene, mountViewer, planAutoMovieAudioPlayback, playAutoMovieAudioCues, publishViewerCompletedFrame, readAutoMovieInspectorAddress, readAutoMovieReviewInterval, redrawViewerCompletedFrame, reduceAutoMovieInspectorState, releaseMountedViewer, showAutoMovieInspectorFinding, stopAutoMovieInspectorTime };
@@ -1,30 +1,50 @@
1
1
  import { type JSX } from "react";
2
2
  import type { IAutoMovieInspectorProps } from "./IAutoMovieInspectorProps.js";
3
3
  /**
4
- * The inspection page as a React component: one canvas showing a subject through one request, and the panels that edit that request.
4
+ * The inspection page as a React component: one canvas showing a subject
5
+ * through one request, and the panels that edit that request.
5
6
  *
6
- * The request is the component's only state that changes the picture. Every panel dispatches an edit to `reduceAutoMovieInspectorState`, the canvas is a plain three.js scene from `@automovie/render` mounted by `mountAutoMovieInspectorScene` in an effect, and every change of the request reaches `onRequestChange` as address text, so the page keeps its address equal to the request. The playhead is an `AutoMovieInspectorPlayhead` outside React that the render loop advances, so a playing frame re-renders only the time readout, and starting or stopping also the play button.
7
+ * The request is the component's only state that changes the picture. Every
8
+ * panel dispatches an edit to `reduceAutoMovieInspectorState`, the canvas is a
9
+ * plain three.js scene from `@automovie/render` mounted by
10
+ * `mountAutoMovieInspectorScene` in an effect, and every change of the request
11
+ * reaches `onRequestChange` as address text, so the page keeps its address
12
+ * equal to the request. The playhead is an `AutoMovieInspectorPlayhead` outside
13
+ * React that the render loop advances, so a playing frame re-renders only the
14
+ * time readout, and starting or stopping also the play button.
7
15
  *
8
- * The canvas has the transport directly under it. Beside it, or under the transport when the inspector is narrower than 900 pixels, a column holds one collapsible section per panel, each heading saying what is active: View and Shade start open, Marks, Selection and Request start closed, so a first look shows the picture and how it is drawn. While focus is inside the inspector, the playback keys of `handleAutoMovieInspectorKey` drive the playhead, except a key held with Ctrl, Meta or Alt and a key that goes to a control answering it itself.
16
+ * The canvas has the transport directly under it. Beside it, or under the
17
+ * transport when the inspector is narrower than 900 pixels, a column holds one
18
+ * collapsible section per panel, each heading saying what is active: View and
19
+ * Shade start open, Marks, Selection and Request start closed, so a first look
20
+ * shows the picture and how it is drawn, and Diagnostics opens once the mount
21
+ * reports a confirmed error. Diagnostics keeps the newest incidents the mount
22
+ * reports, which the console also receives, and moves the picture to a chosen
23
+ * witness through an ordinary request edit; hiding its witnesses hides the
24
+ * cubes and the status line, not the checks. While focus is inside the
25
+ * inspector, the playback keys of `handleAutoMovieInspectorKey` drive the
26
+ * playhead, except a key held with Ctrl, Meta or Alt and a key that goes to a
27
+ * control answering it itself.
9
28
  *
10
- * The mount effect depends on the chosen subject object only, which selectAutoMovieDrawSubject picks by the request's subject key, so each subject must keep its identity across renders; the request reaches a mounted scene through its `apply`, and a request the scene refuses is set back to the one it still draws, with the reason shown. Under StrictMode the mount effect runs, cleans up and runs again on the same canvas, which the mount supports with one renderer alive at the end.
29
+ * The mount effect depends on the chosen subject object only, which
30
+ * selectAutoMovieDrawSubject picks by the request's subject key, so each
31
+ * subject must keep its identity across renders; the request reaches a mounted
32
+ * scene through its `apply`, and a request the scene refuses is set back to the
33
+ * one it still draws, with the reason shown. Under StrictMode the mount effect
34
+ * runs, cleans up and runs again on the same canvas, which the mount supports
35
+ * with one renderer alive at the end.
11
36
  *
12
37
  * ```tsx
13
38
  * createRoot(element).render(
14
39
  * <AutoMovieInspector
15
40
  * subjects={subjects}
16
41
  * initialText={location.search}
17
- * onRequestChange={createAutoMovieInspectorAddressWriter({ location, history })}
42
+ * onRequestChange={createAutoMovieInspectorAddressWriter({
43
+ * location,
44
+ * history,
45
+ * })}
18
46
  * />,
19
47
  * );
20
48
  * ```
21
- *
22
- * @evidence contracts/development/common.md#meaningful-documentation States what the component shows and how it is laid out, where its state lives and changes, how the address follows it, why a playing frame renders only the readout and a start or stop the play button too, the keys, the effect split and the StrictMode behaviour, and shows the mount.
23
- * @evidence contracts/development/implementation.md#principled-implementation React owns layout and dispatch only: `useReducer` holds the request, `useEffect` owns the scene's lifetime per subject and forwards each request, and the canvas is drawn by three.js outside React's render, as the campaign decides against a React scene graph.
24
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One component composes six panels, each a function of the request and a dispatch, five of them in collapsible sections of the platform's `details` element; every state change is the reducer's and every scene change the mount's.
25
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No panel writes the scene, and a scene refusal is answered by restoring the request, never by drawing a picture the address does not name.
26
- * @evidence contracts/development/implementation.md#efficient-algorithms A dispatched edit renders the panels once and re-applies the inspection only when its text changed; a playing frame renders the readout alone, and a start or stop the play button too.
27
- * @evidence contracts/development/implementation.md#reuse-equivalent-work The mount, its renderer and its instance live while the subject stays; a request change reuses them.
28
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The component owns one playhead and at most one mount at a time, disposed by the effect cleanup when the subject changes or the component unmounts.
29
49
  */
30
50
  export declare function AutoMovieInspector(props: IAutoMovieInspectorProps): JSX.Element;