@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.
- package/README.md +8 -87
- package/lib/IAutoMovieViewerCompletedFrame.d.ts +19 -11
- package/lib/IAutoMovieViewerDisplayMetadata.d.ts +0 -5
- package/lib/IAutoMovieViewerHandle.d.ts +3 -25
- package/lib/IMountViewerOptions.d.ts +24 -38
- package/lib/IViewerCameraStateSnapshot.d.ts +0 -5
- package/lib/IViewerFrameTransfer.d.ts +11 -0
- package/lib/IViewerFrameTransfer.js +3 -0
- package/lib/IViewerFrameTransfer.js.map +1 -0
- package/lib/IViewerFrameTransfer.mjs +0 -0
- package/lib/applyCaptureCanvasSize.d.ts +9 -10
- package/lib/applyCaptureCanvasSize.js +7 -13
- package/lib/applyCaptureCanvasSize.js.map +1 -1
- package/lib/applyCaptureCanvasSize.mjs +7 -10
- package/lib/applyCaptureCanvasSize.mjs.map +1 -1
- package/lib/audio/IAutoMovieAudioCue.d.ts +3 -8
- package/lib/audio/planAutoMovieAudioPlayback.d.ts +8 -21
- package/lib/audio/planAutoMovieAudioPlayback.js +8 -14
- package/lib/audio/planAutoMovieAudioPlayback.js.map +1 -1
- package/lib/audio/planAutoMovieAudioPlayback.mjs +8 -14
- package/lib/audio/planAutoMovieAudioPlayback.mjs.map +1 -1
- package/lib/audio/playAutoMovieAudioCues.d.ts +4 -11
- package/lib/audio/playAutoMovieAudioCues.js +4 -11
- package/lib/audio/playAutoMovieAudioCues.js.map +1 -1
- package/lib/audio/playAutoMovieAudioCues.mjs +4 -11
- package/lib/audio/playAutoMovieAudioCues.mjs.map +1 -1
- package/lib/createViewerCameraState.d.ts +3 -11
- package/lib/createViewerCameraState.js +80 -121
- package/lib/createViewerCameraState.js.map +1 -1
- package/lib/createViewerCameraState.mjs +46 -98
- package/lib/createViewerCameraState.mjs.map +1 -1
- package/lib/createViewerDisplayClock.d.ts +2 -10
- package/lib/createViewerDisplayClock.js +4 -12
- package/lib/createViewerDisplayClock.js.map +1 -1
- package/lib/createViewerDisplayClock.mjs +3 -11
- package/lib/createViewerDisplayClock.mjs.map +1 -1
- package/lib/createViewerDisplayPublication.d.ts +7 -15
- package/lib/createViewerDisplayPublication.js +7 -15
- package/lib/createViewerDisplayPublication.js.map +1 -1
- package/lib/createViewerDisplayPublication.mjs +7 -15
- package/lib/createViewerDisplayPublication.mjs.map +1 -1
- package/lib/createViewerDisplaySave.d.ts +8 -16
- package/lib/createViewerDisplaySave.js +8 -16
- package/lib/createViewerDisplaySave.js.map +1 -1
- package/lib/createViewerDisplaySave.mjs +8 -16
- package/lib/createViewerDisplaySave.mjs.map +1 -1
- package/lib/createViewerFrameControl.d.ts +8 -10
- package/lib/createViewerFrameControl.js +3 -15
- package/lib/createViewerFrameControl.js.map +1 -1
- package/lib/createViewerFrameControl.mjs +3 -12
- package/lib/createViewerFrameControl.mjs.map +1 -1
- package/lib/createViewerViewportResize.d.ts +4 -12
- package/lib/createViewerViewportResize.js +7 -20
- package/lib/createViewerViewportResize.js.map +1 -1
- package/lib/createViewerViewportResize.mjs +6 -14
- package/lib/createViewerViewportResize.mjs.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +6 -1
- package/lib/inspector/AutoMovieInspector.d.ts +33 -13
- package/lib/inspector/AutoMovieInspector.js +110 -19
- package/lib/inspector/AutoMovieInspector.js.map +1 -1
- package/lib/inspector/AutoMovieInspector.mjs +121 -18
- package/lib/inspector/AutoMovieInspector.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorBeauty.d.ts +41 -0
- package/lib/inspector/AutoMovieInspectorBeauty.js +56 -0
- package/lib/inspector/AutoMovieInspectorBeauty.js.map +1 -0
- package/lib/inspector/AutoMovieInspectorBeauty.mjs +55 -0
- package/lib/inspector/AutoMovieInspectorBeauty.mjs.map +1 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticLog.d.ts +48 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticLog.js +186 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticLog.js.map +1 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticLog.mjs +171 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticLog.mjs.map +1 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.d.ts +23 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.js +37 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.js.map +1 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.mjs +85 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.mjs.map +1 -0
- package/lib/inspector/AutoMovieInspectorMarksPanel.d.ts +4 -10
- package/lib/inspector/AutoMovieInspectorMarksPanel.js +18 -35
- package/lib/inspector/AutoMovieInspectorMarksPanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorMarksPanel.mjs +32 -38
- package/lib/inspector/AutoMovieInspectorMarksPanel.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorPlayhead.d.ts +35 -96
- package/lib/inspector/AutoMovieInspectorPlayhead.js +41 -101
- package/lib/inspector/AutoMovieInspectorPlayhead.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorPlayhead.mjs +44 -98
- package/lib/inspector/AutoMovieInspectorPlayhead.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorRequestPanel.d.ts +9 -10
- package/lib/inspector/AutoMovieInspectorRequestPanel.js +18 -12
- package/lib/inspector/AutoMovieInspectorRequestPanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorRequestPanel.mjs +32 -14
- package/lib/inspector/AutoMovieInspectorRequestPanel.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorSelectionPanel.d.ts +0 -8
- package/lib/inspector/AutoMovieInspectorSelectionPanel.js +0 -8
- package/lib/inspector/AutoMovieInspectorSelectionPanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorSelectionPanel.mjs +0 -8
- package/lib/inspector/AutoMovieInspectorSelectionPanel.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorShadePanel.d.ts +2 -9
- package/lib/inspector/AutoMovieInspectorShadePanel.js +18 -25
- package/lib/inspector/AutoMovieInspectorShadePanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorShadePanel.mjs +18 -27
- package/lib/inspector/AutoMovieInspectorShadePanel.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorTimePanel.d.ts +0 -8
- package/lib/inspector/AutoMovieInspectorTimePanel.js +0 -8
- package/lib/inspector/AutoMovieInspectorTimePanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorTimePanel.mjs +0 -8
- package/lib/inspector/AutoMovieInspectorTimePanel.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorTimeReadout.d.ts +0 -8
- package/lib/inspector/AutoMovieInspectorTimeReadout.js +4 -10
- package/lib/inspector/AutoMovieInspectorTimeReadout.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorTimeReadout.mjs +3 -12
- package/lib/inspector/AutoMovieInspectorTimeReadout.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorTransition.d.ts +79 -0
- package/lib/inspector/AutoMovieInspectorTransition.js +131 -0
- package/lib/inspector/AutoMovieInspectorTransition.js.map +1 -0
- package/lib/inspector/AutoMovieInspectorTransition.mjs +119 -0
- package/lib/inspector/AutoMovieInspectorTransition.mjs.map +1 -0
- package/lib/inspector/AutoMovieInspectorViewPanel.d.ts +0 -8
- package/lib/inspector/AutoMovieInspectorViewPanel.js +0 -8
- package/lib/inspector/AutoMovieInspectorViewPanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorViewPanel.mjs +0 -8
- package/lib/inspector/AutoMovieInspectorViewPanel.mjs.map +1 -1
- package/lib/inspector/IAutoMovieInspectorAction.d.ts +54 -95
- package/lib/inspector/IAutoMovieInspectorLive.d.ts +43 -0
- package/lib/inspector/IAutoMovieInspectorLive.js +3 -0
- package/lib/inspector/IAutoMovieInspectorLive.js.map +1 -0
- package/lib/inspector/IAutoMovieInspectorLive.mjs +0 -0
- package/lib/inspector/IAutoMovieInspectorPathNode.d.ts +14 -9
- package/lib/inspector/IAutoMovieInspectorProps.d.ts +3 -14
- package/lib/inspector/IAutoMovieInspectorScene.d.ts +96 -100
- package/lib/inspector/IAutoMovieInspectorSceneHost.d.ts +37 -102
- package/lib/inspector/IAutoMovieInspectorState.d.ts +6 -7
- package/lib/inspector/assertAutoMovieInspectorRaster.d.ts +7 -0
- package/lib/inspector/assertAutoMovieInspectorRaster.js +19 -0
- package/lib/inspector/assertAutoMovieInspectorRaster.js.map +1 -0
- package/lib/inspector/assertAutoMovieInspectorRaster.mjs +17 -0
- package/lib/inspector/assertAutoMovieInspectorRaster.mjs.map +1 -0
- package/lib/inspector/buildAutoMovieInspectorPathTree.d.ts +9 -10
- package/lib/inspector/buildAutoMovieInspectorPathTree.js +9 -10
- package/lib/inspector/buildAutoMovieInspectorPathTree.js.map +1 -1
- package/lib/inspector/buildAutoMovieInspectorPathTree.mjs +9 -10
- package/lib/inspector/buildAutoMovieInspectorPathTree.mjs.map +1 -1
- package/lib/inspector/changesAutoMovieObservedScene.d.ts +16 -0
- package/lib/inspector/changesAutoMovieObservedScene.js +28 -0
- package/lib/inspector/changesAutoMovieObservedScene.js.map +1 -0
- package/lib/inspector/changesAutoMovieObservedScene.mjs +21 -0
- package/lib/inspector/changesAutoMovieObservedScene.mjs.map +1 -0
- package/lib/inspector/createAutoMovieInspectorAddressWriter.d.ts +13 -11
- package/lib/inspector/createAutoMovieInspectorAddressWriter.js +13 -11
- package/lib/inspector/createAutoMovieInspectorAddressWriter.js.map +1 -1
- package/lib/inspector/createAutoMovieInspectorAddressWriter.mjs +13 -11
- package/lib/inspector/createAutoMovieInspectorAddressWriter.mjs.map +1 -1
- package/lib/inspector/createAutoMovieInspectorCanvasHost.d.ts +7 -10
- package/lib/inspector/createAutoMovieInspectorCanvasHost.js +14 -11
- package/lib/inspector/createAutoMovieInspectorCanvasHost.js.map +1 -1
- package/lib/inspector/createAutoMovieInspectorCanvasHost.mjs +17 -14
- package/lib/inspector/createAutoMovieInspectorCanvasHost.mjs.map +1 -1
- package/lib/inspector/createAutoMovieInspectorState.d.ts +3 -9
- package/lib/inspector/createAutoMovieInspectorState.js +3 -9
- package/lib/inspector/createAutoMovieInspectorState.js.map +1 -1
- package/lib/inspector/createAutoMovieInspectorState.mjs +3 -9
- package/lib/inspector/createAutoMovieInspectorState.mjs.map +1 -1
- package/lib/inspector/firstAutoMovieInspectorSecond.d.ts +6 -0
- package/lib/inspector/firstAutoMovieInspectorSecond.js +13 -0
- package/lib/inspector/firstAutoMovieInspectorSecond.js.map +1 -0
- package/lib/inspector/firstAutoMovieInspectorSecond.mjs +11 -0
- package/lib/inspector/firstAutoMovieInspectorSecond.mjs.map +1 -0
- package/lib/inspector/followAutoMovieInspectorSize.d.ts +11 -0
- package/lib/inspector/followAutoMovieInspectorSize.js +26 -0
- package/lib/inspector/followAutoMovieInspectorSize.js.map +1 -0
- package/lib/inspector/followAutoMovieInspectorSize.mjs +26 -0
- package/lib/inspector/followAutoMovieInspectorSize.mjs.map +1 -0
- package/lib/inspector/formatAutoMovieInspectorAddress.d.ts +11 -10
- package/lib/inspector/formatAutoMovieInspectorAddress.js +15 -11
- package/lib/inspector/formatAutoMovieInspectorAddress.js.map +1 -1
- package/lib/inspector/formatAutoMovieInspectorAddress.mjs +15 -11
- package/lib/inspector/formatAutoMovieInspectorAddress.mjs.map +1 -1
- package/lib/inspector/formatAutoMovieInspectorCommand.d.ts +20 -14
- package/lib/inspector/formatAutoMovieInspectorCommand.js +33 -14
- package/lib/inspector/formatAutoMovieInspectorCommand.js.map +1 -1
- package/lib/inspector/formatAutoMovieInspectorCommand.mjs +26 -15
- package/lib/inspector/formatAutoMovieInspectorCommand.mjs.map +1 -1
- package/lib/inspector/handleAutoMovieInspectorKey.d.ts +24 -15
- package/lib/inspector/handleAutoMovieInspectorKey.js +27 -16
- package/lib/inspector/handleAutoMovieInspectorKey.js.map +1 -1
- package/lib/inspector/handleAutoMovieInspectorKey.mjs +27 -16
- package/lib/inspector/handleAutoMovieInspectorKey.mjs.map +1 -1
- package/lib/inspector/index.d.ts +5 -0
- package/lib/inspector/index.js +5 -0
- package/lib/inspector/index.js.map +1 -1
- package/lib/inspector/index.mjs +6 -1
- package/lib/inspector/inspectAutoMovieInspectorRequest.d.ts +19 -0
- package/lib/inspector/inspectAutoMovieInspectorRequest.js +20 -0
- package/lib/inspector/inspectAutoMovieInspectorRequest.js.map +1 -0
- package/lib/inspector/inspectAutoMovieInspectorRequest.mjs +20 -0
- package/lib/inspector/inspectAutoMovieInspectorRequest.mjs.map +1 -0
- package/lib/inspector/installAutoMovieInspectorRequest.d.ts +20 -0
- package/lib/inspector/installAutoMovieInspectorRequest.js +36 -0
- package/lib/inspector/installAutoMovieInspectorRequest.js.map +1 -0
- package/lib/inspector/installAutoMovieInspectorRequest.mjs +35 -0
- package/lib/inspector/installAutoMovieInspectorRequest.mjs.map +1 -0
- package/lib/inspector/locateAutoMovieInspectorFinding.d.ts +19 -0
- package/lib/inspector/locateAutoMovieInspectorFinding.js +34 -0
- package/lib/inspector/locateAutoMovieInspectorFinding.js.map +1 -0
- package/lib/inspector/locateAutoMovieInspectorFinding.mjs +37 -0
- package/lib/inspector/locateAutoMovieInspectorFinding.mjs.map +1 -0
- package/lib/inspector/messageOfAutoMovieInspectorError.d.ts +2 -0
- package/lib/inspector/messageOfAutoMovieInspectorError.js +8 -0
- package/lib/inspector/messageOfAutoMovieInspectorError.js.map +1 -0
- package/lib/inspector/messageOfAutoMovieInspectorError.mjs +8 -0
- package/lib/inspector/messageOfAutoMovieInspectorError.mjs.map +1 -0
- package/lib/inspector/mountAutoMovieInspectorPage.d.ts +5 -8
- package/lib/inspector/mountAutoMovieInspectorPage.js +3 -9
- package/lib/inspector/mountAutoMovieInspectorPage.js.map +1 -1
- package/lib/inspector/mountAutoMovieInspectorPage.mjs +4 -9
- package/lib/inspector/mountAutoMovieInspectorPage.mjs.map +1 -1
- package/lib/inspector/mountAutoMovieInspectorScene.d.ts +55 -12
- package/lib/inspector/mountAutoMovieInspectorScene.js +238 -164
- package/lib/inspector/mountAutoMovieInspectorScene.js.map +1 -1
- package/lib/inspector/mountAutoMovieInspectorScene.mjs +223 -149
- package/lib/inspector/mountAutoMovieInspectorScene.mjs.map +1 -1
- package/lib/inspector/placeAutoMovieInspectorLabels.d.ts +29 -0
- package/lib/inspector/placeAutoMovieInspectorLabels.js +33 -0
- package/lib/inspector/placeAutoMovieInspectorLabels.js.map +1 -0
- package/lib/inspector/placeAutoMovieInspectorLabels.mjs +32 -0
- package/lib/inspector/placeAutoMovieInspectorLabels.mjs.map +1 -0
- package/lib/inspector/readAutoMovieInspectorAddress.d.ts +8 -11
- package/lib/inspector/readAutoMovieInspectorAddress.js +8 -11
- package/lib/inspector/readAutoMovieInspectorAddress.js.map +1 -1
- package/lib/inspector/readAutoMovieInspectorAddress.mjs +8 -11
- package/lib/inspector/readAutoMovieInspectorAddress.mjs.map +1 -1
- package/lib/inspector/readAutoMovieInspectorFacts.d.ts +17 -0
- package/lib/inspector/readAutoMovieInspectorFacts.js +34 -0
- package/lib/inspector/readAutoMovieInspectorFacts.js.map +1 -0
- package/lib/inspector/readAutoMovieInspectorFacts.mjs +28 -0
- package/lib/inspector/readAutoMovieInspectorFacts.mjs.map +1 -0
- package/lib/inspector/readsAutoMovieInspectorPlacedScene.d.ts +9 -0
- package/lib/inspector/readsAutoMovieInspectorPlacedScene.js +14 -0
- package/lib/inspector/readsAutoMovieInspectorPlacedScene.js.map +1 -0
- package/lib/inspector/readsAutoMovieInspectorPlacedScene.mjs +14 -0
- package/lib/inspector/readsAutoMovieInspectorPlacedScene.mjs.map +1 -0
- package/lib/inspector/reduceAutoMovieInspectorState.d.ts +10 -10
- package/lib/inspector/reduceAutoMovieInspectorState.js +17 -11
- package/lib/inspector/reduceAutoMovieInspectorState.js.map +1 -1
- package/lib/inspector/reduceAutoMovieInspectorState.mjs +16 -11
- package/lib/inspector/reduceAutoMovieInspectorState.mjs.map +1 -1
- package/lib/inspector/releaseAutoMovieInspectorSteps.d.ts +6 -0
- package/lib/inspector/releaseAutoMovieInspectorSteps.js +23 -0
- package/lib/inspector/releaseAutoMovieInspectorSteps.js.map +1 -0
- package/lib/inspector/releaseAutoMovieInspectorSteps.mjs +19 -0
- package/lib/inspector/releaseAutoMovieInspectorSteps.mjs.map +1 -0
- package/lib/inspector/reportAutoMovieInspectorLabels.d.ts +21 -0
- package/lib/inspector/reportAutoMovieInspectorLabels.js +27 -0
- package/lib/inspector/reportAutoMovieInspectorLabels.js.map +1 -0
- package/lib/inspector/reportAutoMovieInspectorLabels.mjs +30 -0
- package/lib/inspector/reportAutoMovieInspectorLabels.mjs.map +1 -0
- package/lib/inspector/resolveAutoMovieInspectorCamera.d.ts +22 -0
- package/lib/inspector/resolveAutoMovieInspectorCamera.js +34 -0
- package/lib/inspector/resolveAutoMovieInspectorCamera.js.map +1 -0
- package/lib/inspector/resolveAutoMovieInspectorCamera.mjs +34 -0
- package/lib/inspector/resolveAutoMovieInspectorCamera.mjs.map +1 -0
- package/lib/inspector/showAutoMovieInspectorFinding.d.ts +25 -0
- package/lib/inspector/showAutoMovieInspectorFinding.js +26 -0
- package/lib/inspector/showAutoMovieInspectorFinding.js.map +1 -0
- package/lib/inspector/showAutoMovieInspectorFinding.mjs +26 -0
- package/lib/inspector/showAutoMovieInspectorFinding.mjs.map +1 -0
- package/lib/inspector/stopAutoMovieInspectorTime.d.ts +11 -0
- package/lib/inspector/stopAutoMovieInspectorTime.js +17 -0
- package/lib/inspector/stopAutoMovieInspectorTime.js.map +1 -0
- package/lib/inspector/stopAutoMovieInspectorTime.mjs +18 -0
- package/lib/inspector/stopAutoMovieInspectorTime.mjs.map +1 -0
- package/lib/inspector/writeAutoMovieInspectorInspection.d.ts +6 -0
- package/lib/inspector/writeAutoMovieInspectorInspection.js +12 -0
- package/lib/inspector/writeAutoMovieInspectorInspection.js.map +1 -0
- package/lib/inspector/writeAutoMovieInspectorInspection.mjs +12 -0
- package/lib/inspector/writeAutoMovieInspectorInspection.mjs.map +1 -0
- package/lib/internal.d.ts +7 -0
- package/lib/internal.js +25 -0
- package/lib/internal.js.map +1 -0
- package/lib/internal.mjs +8 -0
- package/lib/mountViewer.d.ts +16 -10
- package/lib/mountViewer.js +17 -14
- package/lib/mountViewer.js.map +1 -1
- package/lib/mountViewer.mjs +18 -12
- package/lib/mountViewer.mjs.map +1 -1
- package/lib/publishViewerCompletedFrame.d.ts +12 -10
- package/lib/publishViewerCompletedFrame.js +11 -9
- package/lib/publishViewerCompletedFrame.js.map +1 -1
- package/lib/publishViewerCompletedFrame.mjs +11 -9
- package/lib/publishViewerCompletedFrame.mjs.map +1 -1
- package/lib/redrawViewerCompletedFrame.d.ts +2 -10
- package/lib/redrawViewerCompletedFrame.js +4 -12
- package/lib/redrawViewerCompletedFrame.js.map +1 -1
- package/lib/redrawViewerCompletedFrame.mjs +3 -11
- package/lib/redrawViewerCompletedFrame.mjs.map +1 -1
- package/lib/releaseMountedViewer.d.ts +5 -9
- package/lib/releaseMountedViewer.js +5 -9
- package/lib/releaseMountedViewer.js.map +1 -1
- package/lib/releaseMountedViewer.mjs +5 -9
- package/lib/releaseMountedViewer.mjs.map +1 -1
- package/lib/transport/AutoMovieViewerTransport.d.ts +13 -122
- package/lib/transport/AutoMovieViewerTransport.js +10 -74
- package/lib/transport/AutoMovieViewerTransport.js.map +1 -1
- package/lib/transport/AutoMovieViewerTransport.mjs +10 -65
- package/lib/transport/AutoMovieViewerTransport.mjs.map +1 -1
- package/lib/transport/readAutoMovieReviewInterval.d.ts +3 -10
- package/lib/transport/readAutoMovieReviewInterval.js +11 -16
- package/lib/transport/readAutoMovieReviewInterval.js.map +1 -1
- package/lib/transport/readAutoMovieReviewInterval.mjs +8 -14
- package/lib/transport/readAutoMovieReviewInterval.mjs.map +1 -1
- package/package.json +12 -8
- package/src/IAutoMovieViewerCompletedFrame.ts +21 -11
- package/src/IAutoMovieViewerDisplayMetadata.ts +0 -5
- package/src/IAutoMovieViewerHandle.ts +3 -25
- package/src/IMountViewerOptions.ts +24 -38
- package/src/IViewerCameraStateSnapshot.ts +0 -5
- package/src/IViewerFrameTransfer.ts +13 -0
- package/src/applyCaptureCanvasSize.ts +9 -18
- package/src/audio/IAutoMovieAudioCue.ts +3 -8
- package/src/audio/planAutoMovieAudioPlayback.ts +9 -23
- package/src/audio/playAutoMovieAudioCues.ts +4 -11
- package/src/createViewerCameraState.ts +119 -175
- package/src/createViewerDisplayClock.ts +4 -12
- package/src/createViewerDisplayPublication.ts +7 -15
- package/src/createViewerDisplaySave.ts +8 -16
- package/src/createViewerFrameControl.ts +16 -24
- package/src/createViewerViewportResize.ts +7 -23
- package/src/index.ts +1 -0
- package/src/inspector/AutoMovieInspector.tsx +183 -20
- package/src/inspector/AutoMovieInspectorBeauty.ts +89 -0
- package/src/inspector/AutoMovieInspectorDiagnosticLog.ts +235 -0
- package/src/inspector/AutoMovieInspectorDiagnosticsPanel.tsx +118 -0
- package/src/inspector/AutoMovieInspectorMarksPanel.tsx +26 -34
- package/src/inspector/AutoMovieInspectorPlayhead.ts +53 -110
- package/src/inspector/AutoMovieInspectorRequestPanel.tsx +57 -29
- package/src/inspector/AutoMovieInspectorSelectionPanel.tsx +0 -8
- package/src/inspector/AutoMovieInspectorShadePanel.tsx +24 -29
- package/src/inspector/AutoMovieInspectorTimePanel.tsx +0 -8
- package/src/inspector/AutoMovieInspectorTimeReadout.tsx +4 -10
- package/src/inspector/AutoMovieInspectorTransition.ts +178 -0
- package/src/inspector/AutoMovieInspectorViewPanel.tsx +0 -8
- package/src/inspector/IAutoMovieInspectorAction.ts +57 -94
- package/src/inspector/IAutoMovieInspectorLive.ts +62 -0
- package/src/inspector/IAutoMovieInspectorPathNode.ts +14 -9
- package/src/inspector/IAutoMovieInspectorProps.ts +4 -14
- package/src/inspector/IAutoMovieInspectorScene.ts +104 -99
- package/src/inspector/IAutoMovieInspectorSceneHost.ts +43 -102
- package/src/inspector/IAutoMovieInspectorState.ts +6 -7
- package/src/inspector/assertAutoMovieInspectorRaster.ts +23 -0
- package/src/inspector/buildAutoMovieInspectorPathTree.ts +9 -10
- package/src/inspector/changesAutoMovieObservedScene.ts +30 -0
- package/src/inspector/createAutoMovieInspectorAddressWriter.ts +13 -11
- package/src/inspector/createAutoMovieInspectorCanvasHost.ts +14 -12
- package/src/inspector/createAutoMovieInspectorState.ts +3 -9
- package/src/inspector/firstAutoMovieInspectorSecond.ts +13 -0
- package/src/inspector/followAutoMovieInspectorSize.ts +32 -0
- package/src/inspector/formatAutoMovieInspectorAddress.ts +15 -11
- package/src/inspector/formatAutoMovieInspectorCommand.ts +44 -15
- package/src/inspector/handleAutoMovieInspectorKey.ts +27 -16
- package/src/inspector/index.ts +5 -0
- package/src/inspector/inspectAutoMovieInspectorRequest.ts +37 -0
- package/src/inspector/installAutoMovieInspectorRequest.ts +50 -0
- package/src/inspector/locateAutoMovieInspectorFinding.ts +40 -0
- package/src/inspector/messageOfAutoMovieInspectorError.ts +4 -0
- package/src/inspector/mountAutoMovieInspectorPage.tsx +7 -8
- package/src/inspector/mountAutoMovieInspectorScene.ts +290 -232
- package/src/inspector/placeAutoMovieInspectorLabels.ts +53 -0
- package/src/inspector/readAutoMovieInspectorAddress.ts +8 -11
- package/src/inspector/readAutoMovieInspectorFacts.ts +50 -0
- package/src/inspector/readsAutoMovieInspectorPlacedScene.ts +16 -0
- package/src/inspector/reduceAutoMovieInspectorState.ts +17 -11
- package/src/inspector/releaseAutoMovieInspectorSteps.ts +19 -0
- package/src/inspector/reportAutoMovieInspectorLabels.ts +45 -0
- package/src/inspector/resolveAutoMovieInspectorCamera.ts +50 -0
- package/src/inspector/showAutoMovieInspectorFinding.ts +40 -0
- package/src/inspector/stopAutoMovieInspectorTime.ts +19 -0
- package/src/inspector/writeAutoMovieInspectorInspection.ts +12 -0
- package/src/internal.ts +9 -0
- package/src/mountViewer.ts +17 -14
- package/src/publishViewerCompletedFrame.ts +14 -10
- package/src/redrawViewerCompletedFrame.ts +3 -12
- package/src/releaseMountedViewer.ts +5 -9
- package/src/transport/AutoMovieViewerTransport.ts +17 -144
- package/src/transport/readAutoMovieReviewInterval.ts +15 -16
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { formatAutoMovieInspectorAddress } from "./formatAutoMovieInspectorAddress.mjs";
|
|
2
2
|
import { formatAutoMovieInspectorCommand } from "./formatAutoMovieInspectorCommand.mjs";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
// src/inspector/AutoMovieInspectorRequestPanel.tsx
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Copy or edit the address and, when the host supplies a command, copy its
|
|
8
|
+
* capture command in the selected shell syntax.
|
|
8
9
|
*
|
|
9
|
-
* The query field
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One editable field and one read-only field, each with a copy button.
|
|
14
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The typed text is held only until it is dispatched; the request stays the reducer's; a missing or refused clipboard is reported, never swallowed or thrown.
|
|
15
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Two writes of the request per render, linear in its text.
|
|
16
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A view with handlers.
|
|
17
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Holds only the text being typed and the last copy's note.
|
|
10
|
+
* The query field dispatches edits on blur or Enter. A refused edit keeps the
|
|
11
|
+
* previous request. The command is read-only and initially uses POSIX syntax.
|
|
12
|
+
* Copying reports success in a live status region, or tells the reader to
|
|
13
|
+
* select the text if clipboard access is unavailable.
|
|
18
14
|
*/
|
|
19
15
|
function AutoMovieInspectorRequestPanel(props) {
|
|
20
16
|
const [typed, setTyped] = useState(null);
|
|
17
|
+
const [shell, setShell] = useState("posix");
|
|
21
18
|
const [copied, setCopied] = useState(null);
|
|
22
19
|
const commit = () => {
|
|
23
20
|
if (typed === null) return;
|
|
@@ -42,7 +39,10 @@ function AutoMovieInspectorRequestPanel(props) {
|
|
|
42
39
|
}
|
|
43
40
|
};
|
|
44
41
|
const address = typed ?? formatAutoMovieInspectorAddress(props.request);
|
|
45
|
-
const command = formatAutoMovieInspectorCommand(props.request
|
|
42
|
+
const command = props.captureCommand ? formatAutoMovieInspectorCommand(props.request, {
|
|
43
|
+
command: props.captureCommand,
|
|
44
|
+
shell
|
|
45
|
+
}).text : null;
|
|
46
46
|
const row = {
|
|
47
47
|
display: "flex",
|
|
48
48
|
gap: 4,
|
|
@@ -76,7 +76,25 @@ function AutoMovieInspectorRequestPanel(props) {
|
|
|
76
76
|
})]
|
|
77
77
|
})]
|
|
78
78
|
}),
|
|
79
|
-
/* @__PURE__ */ jsxs("label", {
|
|
79
|
+
command !== null && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("label", {
|
|
80
|
+
style: { display: "block" },
|
|
81
|
+
children: [
|
|
82
|
+
"Shell",
|
|
83
|
+
" ",
|
|
84
|
+
/* @__PURE__ */ jsxs("select", {
|
|
85
|
+
"aria-label": "Command shell",
|
|
86
|
+
value: shell,
|
|
87
|
+
onChange: (event) => setShell(event.target.value === "powershell" ? "powershell" : "posix"),
|
|
88
|
+
children: [/* @__PURE__ */ jsx("option", {
|
|
89
|
+
value: "posix",
|
|
90
|
+
children: "POSIX"
|
|
91
|
+
}), /* @__PURE__ */ jsx("option", {
|
|
92
|
+
value: "powershell",
|
|
93
|
+
children: "PowerShell 7.3+"
|
|
94
|
+
})]
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
}), /* @__PURE__ */ jsxs("label", {
|
|
80
98
|
style: { display: "block" },
|
|
81
99
|
children: ["Capture command", /* @__PURE__ */ jsxs("span", {
|
|
82
100
|
style: row,
|
|
@@ -95,7 +113,7 @@ function AutoMovieInspectorRequestPanel(props) {
|
|
|
95
113
|
children: "Copy command"
|
|
96
114
|
})]
|
|
97
115
|
})]
|
|
98
|
-
}),
|
|
116
|
+
})] }),
|
|
99
117
|
/* @__PURE__ */ jsx("p", {
|
|
100
118
|
role: "status",
|
|
101
119
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMovieInspectorRequestPanel.mjs","names":[],"sources":["../../src/inspector/AutoMovieInspectorRequestPanel.tsx"],"sourcesContent":["import type { IAutoMovieCapturePlanRequest } from \"@automovie/interface\";\
|
|
1
|
+
{"version":3,"file":"AutoMovieInspectorRequestPanel.mjs","names":[],"sources":["../../src/inspector/AutoMovieInspectorRequestPanel.tsx"],"sourcesContent":["import type { IAutoMovieCapturePlanRequest } from \"@automovie/interface\";\nimport {\n type CSSProperties,\n type ChangeEvent,\n type Dispatch,\n type JSX,\n type SetStateAction,\n useState,\n} from \"react\";\n\nimport type { IAutoMovieInspectorAction } from \"./IAutoMovieInspectorAction.js\";\nimport type { IAutoMovieInspectorProps } from \"./IAutoMovieInspectorProps.js\";\nimport { formatAutoMovieInspectorAddress } from \"./formatAutoMovieInspectorAddress.js\";\nimport { formatAutoMovieInspectorCommand } from \"./formatAutoMovieInspectorCommand.js\";\n\n/**\n * Copy or edit the address and, when the host supplies a command, copy its\n * capture command in the selected shell syntax.\n *\n * The query field dispatches edits on blur or Enter. A refused edit keeps the\n * previous request. The command is read-only and initially uses POSIX syntax.\n * Copying reports success in a live status region, or tells the reader to\n * select the text if clipboard access is unavailable.\n */\nexport function AutoMovieInspectorRequestPanel(props: {\n /** The request shown. */\n request: IAutoMovieCapturePlanRequest;\n\n /** Where an edited text goes. */\n dispatch: (action: IAutoMovieInspectorAction) => void;\n\n /** Executable and fixed arguments from the host for the optional command. */\n captureCommand?: IAutoMovieInspectorProps[\"captureCommand\"];\n}): JSX.Element {\n const [typed, setTyped] = useState<string | null>(null);\n const [shell, setShell] = useState<\"posix\" | \"powershell\">(\"posix\");\n const [copied, setCopied]: [\n string | null,\n Dispatch<SetStateAction<string | null>>,\n ] = useState<string | null>(null);\n const commit: () => void = (): void => {\n if (typed === null) return;\n setTyped(null);\n props.dispatch({ type: \"text\", text: typed });\n };\n // A page outside a secure context has no clipboard, and a page may be\n // refused it; either is reported with what to do instead.\n const copy: (name: string, text: string) => Promise<void> = async (\n name: string,\n text: string,\n ): Promise<void> => {\n const refused: string = `Select the ${name} and copy it.`;\n const clipboard: Clipboard | undefined = (\n navigator as Navigator & { clipboard?: Clipboard }\n ).clipboard;\n if (clipboard === undefined) {\n setCopied(refused);\n return;\n }\n try {\n await clipboard.writeText(text);\n setCopied(`The ${name} was copied.`);\n } catch {\n setCopied(refused);\n }\n };\n const address: string =\n typed ?? formatAutoMovieInspectorAddress(props.request);\n const command: string | null = props.captureCommand\n ? formatAutoMovieInspectorCommand(props.request, {\n command: props.captureCommand,\n shell,\n }).text\n : null;\n const row: CSSProperties = {\n display: \"flex\",\n gap: 4,\n alignItems: \"center\",\n };\n return (\n <div>\n <label style={{ display: \"block\", marginBottom: 6 }}>\n Address\n <span style={row}>\n <input\n aria-label=\"Request address\"\n style={{ flex: \"1 1 auto\", minWidth: 0, fontFamily: \"monospace\" }}\n value={address}\n onChange={(event: ChangeEvent<HTMLInputElement>): void =>\n setTyped(event.target.value)\n }\n onBlur={commit}\n onKeyDown={(event: { key: string }): void => {\n if (event.key === \"Enter\") commit();\n }}\n />\n <button\n type=\"button\"\n onClick={(): void => void copy(\"address\", address)}\n >\n Copy address\n </button>\n </span>\n </label>\n {command !== null && (\n <>\n <label style={{ display: \"block\" }}>\n Shell{\" \"}\n <select\n aria-label=\"Command shell\"\n value={shell}\n onChange={(event: ChangeEvent<HTMLSelectElement>): void =>\n setShell(\n event.target.value === \"powershell\" ? \"powershell\" : \"posix\",\n )\n }\n >\n <option value=\"posix\">POSIX</option>\n <option value=\"powershell\">PowerShell 7.3+</option>\n </select>\n </label>\n <label style={{ display: \"block\" }}>\n Capture command\n <span style={row}>\n <input\n aria-label=\"Capture command\"\n readOnly\n style={{\n flex: \"1 1 auto\",\n minWidth: 0,\n fontFamily: \"monospace\",\n }}\n value={command}\n />\n <button\n type=\"button\"\n onClick={(): void => void copy(\"command\", command)}\n >\n Copy command\n </button>\n </span>\n </label>\n </>\n )}\n {/* The live region stays mounted and only its text changes, so each\n copy's note is announced. */}\n <p role=\"status\" style={{ margin: \"4px 0 0\", fontSize: 12 }}>\n {copied ?? \"\"}\n </p>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAwBA,SAAgB,+BAA+B,OAS/B;CACd,MAAM,CAAC,OAAO,YAAY,SAAwB,IAAI;CACtD,MAAM,CAAC,OAAO,YAAY,SAAiC,OAAO;CAClE,MAAM,CAAC,QAAQ,aAGX,SAAwB,IAAI;CAChC,MAAM,eAAiC;EACrC,IAAI,UAAU,MAAM;EACpB,SAAS,IAAI;EACb,MAAM,SAAS;GAAE,MAAM;GAAQ,MAAM;EAAM,CAAC;CAC9C;CAGA,MAAM,OAAsD,OAC1D,MACA,SACkB;EAClB,MAAM,UAAkB,cAAc,KAAK;EAC3C,MAAM,YACJ,UACA;EACF,IAAI,cAAc,KAAA,GAAW;GAC3B,UAAU,OAAO;GACjB;EACF;EACA,IAAI;GACF,MAAM,UAAU,UAAU,IAAI;GAC9B,UAAU,OAAO,KAAK,aAAa;EACrC,QAAQ;GACN,UAAU,OAAO;EACnB;CACF;CACA,MAAM,UACJ,SAAS,gCAAgC,MAAM,OAAO;CACxD,MAAM,UAAyB,MAAM,iBACjC,gCAAgC,MAAM,SAAS;EAC7C,SAAS,MAAM;EACf;CACF,CAAC,CAAC,CAAC,OACH;CACJ,MAAM,MAAqB;EACzB,SAAS;EACT,KAAK;EACL,YAAY;CACd;CACA,OACE,qBAAC,OAAD,EAAA,UAAA;EACE,qBAAC,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Q;IAAW,UAAU;GAAG;GACvD,UAAA,UAAU;EACV,CAAA;CACA,EAAA,CAAA;AAET"}
|
|
@@ -7,14 +7,6 @@ import type { IAutoMovieInspectorAction } from "./IAutoMovieInspectorAction.js";
|
|
|
7
7
|
* A header names the four columns. Each node edits the request by its pattern, the one that selects the node and its subtree: a checkbox puts the pattern in or takes it out of `parts`, `hide` or `label`, and the colour input gives it a `color` pair, which the clear button takes back. A node is checked when its own pattern is in the list, so a pattern typed in the address that matches several nodes checks none of them, and stays in the request. The empty path has no pattern and only a name.
|
|
8
8
|
*
|
|
9
9
|
* A node with children is folded until opened, with the number of paths under it, so a figure's dozens of bones do not fill the panel. Its disclosure button, between the controls and the name, opens and folds it and states whether it is open; it sits beside the controls, never around them, so no control is nested in another. The filter keeps the nodes whose path contains the typed text, with their ancestors, and opens them; while it does, their disclosure buttons are disabled.
|
|
10
|
-
*
|
|
11
|
-
* @evidence contracts/development/common.md#meaningful-documentation States the header, what each control edits, when a node is checked, what happens to typed patterns and the empty path, and how folding and the filter work.
|
|
12
|
-
* @evidence contracts/development/implementation.md#principled-implementation The tree and each node's pattern come from `buildAutoMovieInspectorPathTree`, and every edit is a reducer action through the grammar, so the panel restates no path rule; folding is the disclosure pattern, a button with `aria-expanded` that owns no other control.
|
|
13
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One memoized tree, one filter, and one recursive row per node.
|
|
14
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A checked state is read from the request, never kept in the panel; the filter hides rows and changes no request.
|
|
15
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms The tree is rebuilt only when the path list changes; a render is linear in the nodes times the lists' lengths, and a folded subtree is not rendered.
|
|
16
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work `useMemo` keeps the tree while the path list is the same array, which the mount reports once per instance.
|
|
17
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Holds the memoized tree and the filter text only while mounted.
|
|
18
10
|
*/
|
|
19
11
|
export declare function AutoMovieInspectorSelectionPanel(props: {
|
|
20
12
|
/** The request shown. */
|
|
@@ -14,14 +14,6 @@ const DISCLOSURE = 16;
|
|
|
14
14
|
* A header names the four columns. Each node edits the request by its pattern, the one that selects the node and its subtree: a checkbox puts the pattern in or takes it out of `parts`, `hide` or `label`, and the colour input gives it a `color` pair, which the clear button takes back. A node is checked when its own pattern is in the list, so a pattern typed in the address that matches several nodes checks none of them, and stays in the request. The empty path has no pattern and only a name.
|
|
15
15
|
*
|
|
16
16
|
* A node with children is folded until opened, with the number of paths under it, so a figure's dozens of bones do not fill the panel. Its disclosure button, between the controls and the name, opens and folds it and states whether it is open; it sits beside the controls, never around them, so no control is nested in another. The filter keeps the nodes whose path contains the typed text, with their ancestors, and opens them; while it does, their disclosure buttons are disabled.
|
|
17
|
-
*
|
|
18
|
-
* @evidence contracts/development/common.md#meaningful-documentation States the header, what each control edits, when a node is checked, what happens to typed patterns and the empty path, and how folding and the filter work.
|
|
19
|
-
* @evidence contracts/development/implementation.md#principled-implementation The tree and each node's pattern come from `buildAutoMovieInspectorPathTree`, and every edit is a reducer action through the grammar, so the panel restates no path rule; folding is the disclosure pattern, a button with `aria-expanded` that owns no other control.
|
|
20
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One memoized tree, one filter, and one recursive row per node.
|
|
21
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A checked state is read from the request, never kept in the panel; the filter hides rows and changes no request.
|
|
22
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms The tree is rebuilt only when the path list changes; a render is linear in the nodes times the lists' lengths, and a folded subtree is not rendered.
|
|
23
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work `useMemo` keeps the tree while the path list is the same array, which the mount reports once per instance.
|
|
24
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Holds the memoized tree and the filter text only while mounted.
|
|
25
17
|
*/
|
|
26
18
|
function AutoMovieInspectorSelectionPanel(props) {
|
|
27
19
|
const tree = (0, react_1.useMemo)(() => (0, buildAutoMovieInspectorPathTree_js_1.buildAutoMovieInspectorPathTree)(props.paths), [props.paths]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMovieInspectorSelectionPanel.js","sourceRoot":"","sources":["../../src/inspector/AutoMovieInspectorSelectionPanel.tsx"],"names":[],"mappings":";;;;AAMA,iCAOe;AAIf,6FAAuF;AAGvF,qFAAqF;AACrF,MAAM,MAAM,GAAW,EAAE,CAAC;AAE1B,gEAAgE;AAChE,MAAM,UAAU,GAAW,EAAE,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"AutoMovieInspectorSelectionPanel.js","sourceRoot":"","sources":["../../src/inspector/AutoMovieInspectorSelectionPanel.tsx"],"names":[],"mappings":";;;;AAMA,iCAOe;AAIf,6FAAuF;AAGvF,qFAAqF;AACrF,MAAM,MAAM,GAAW,EAAE,CAAC;AAE1B,gEAAgE;AAChE,MAAM,UAAU,GAAW,EAAE,CAAC;AAE9B;;;;;;GAMG;AACH,0CAAiD,KAShD;IACC,MAAM,IAAI,GAAkC,IAAA,eAAO,EACjD,GAAkC,EAAE,CAClC,IAAA,oEAA+B,EAAC,KAAK,CAAC,KAAK,CAAC,EAC9C,CAAC,KAAK,CAAC,KAAK,CAAC,CACd,CAAC;IACF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GACvB,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IACvB,MAAM,MAAM,GAAW,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACnD,OAAO,CACL,4CACE,kCACE,IAAI,EAAC,QAAQ,gBACF,cAAc,EACzB,WAAW,EAAC,cAAc,EAC1B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,EAAE,EAClE,QAAQ,EAAE,CAAC,KAAoC,EAAQ,EAAE,CACvD,SAA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iCAAM,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,YACxD,KAAK,GACD,EACN,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACb,iDAAkB,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,aAC5D,GAAG,EACH,KAAK,CAAC,IAAI,CAAC,IACP,CACR,IACI,CACR,CAAC;IACF,IAAI,IAAI;QAAE,OAAO,yCAAK,QAAQ,GAAM,CAAC;IACrC,OAAO,CACL,2CACG,QAAQ,EACR,QAAQ,CAAC,CAAC,CAAC,CACV,+BAAI,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,YACzD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAChB,CAAC,KAAkC,EAAsB,EAAE,CACzD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CACrB,uBAAC,GAAG,IAEF,IAAI,EAAE,KAAK,EACX,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,IAJb,KAAK,CAAC,IAAI,CAKf,CACH,CAAC,CAAC,CAAC,IAAI,CACX,GACE,CACN,CAAC,CAAC,CAAC,IAAI,IACL,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -12,14 +12,6 @@ const DISCLOSURE = 16;
|
|
|
12
12
|
* A header names the four columns. Each node edits the request by its pattern, the one that selects the node and its subtree: a checkbox puts the pattern in or takes it out of `parts`, `hide` or `label`, and the colour input gives it a `color` pair, which the clear button takes back. A node is checked when its own pattern is in the list, so a pattern typed in the address that matches several nodes checks none of them, and stays in the request. The empty path has no pattern and only a name.
|
|
13
13
|
*
|
|
14
14
|
* A node with children is folded until opened, with the number of paths under it, so a figure's dozens of bones do not fill the panel. Its disclosure button, between the controls and the name, opens and folds it and states whether it is open; it sits beside the controls, never around them, so no control is nested in another. The filter keeps the nodes whose path contains the typed text, with their ancestors, and opens them; while it does, their disclosure buttons are disabled.
|
|
15
|
-
*
|
|
16
|
-
* @evidence contracts/development/common.md#meaningful-documentation States the header, what each control edits, when a node is checked, what happens to typed patterns and the empty path, and how folding and the filter work.
|
|
17
|
-
* @evidence contracts/development/implementation.md#principled-implementation The tree and each node's pattern come from `buildAutoMovieInspectorPathTree`, and every edit is a reducer action through the grammar, so the panel restates no path rule; folding is the disclosure pattern, a button with `aria-expanded` that owns no other control.
|
|
18
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One memoized tree, one filter, and one recursive row per node.
|
|
19
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A checked state is read from the request, never kept in the panel; the filter hides rows and changes no request.
|
|
20
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms The tree is rebuilt only when the path list changes; a render is linear in the nodes times the lists' lengths, and a folded subtree is not rendered.
|
|
21
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work `useMemo` keeps the tree while the path list is the same array, which the mount reports once per instance.
|
|
22
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Holds the memoized tree and the filter text only while mounted.
|
|
23
15
|
*/
|
|
24
16
|
function AutoMovieInspectorSelectionPanel(props) {
|
|
25
17
|
const tree = useMemo(() => buildAutoMovieInspectorPathTree(props.paths), [props.paths]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMovieInspectorSelectionPanel.mjs","names":[],"sources":["../../src/inspector/AutoMovieInspectorSelectionPanel.tsx"],"sourcesContent":["import type {\n IAutoMovieCapturePlanRequest,\n IAutoMovieInspectionColorAssignment,\n IAutoMovieInspectionRequest,\n} from \"@automovie/interface\";\n\nimport {\n type ChangeEvent,\n type Dispatch,\n type JSX,\n type SetStateAction,\n useMemo,\n useState,\n} from \"react\";\n\nimport type { IAutoMovieInspectorAction } from \"./IAutoMovieInspectorAction.js\";\nimport type { IAutoMovieInspectorPathNode } from \"./IAutoMovieInspectorPathNode.js\";\nimport { buildAutoMovieInspectorPathTree } from \"./buildAutoMovieInspectorPathTree.js\";\n\n\n/** The width of each of the three checkbox columns and the colour column, pixels. */\nconst COLUMN: number = 22;\n\n/** The width of the disclosure button before a name, pixels. */\nconst DISCLOSURE: number = 16;\n\n/**\n * Selection: the subject's identity paths as a tree, with select, hide, label and colour per path.\n *\n * A header names the four columns. Each node edits the request by its pattern, the one that selects the node and its subtree: a checkbox puts the pattern in or takes it out of `parts`, `hide` or `label`, and the colour input gives it a `color` pair, which the clear button takes back. A node is checked when its own pattern is in the list, so a pattern typed in the address that matches several nodes checks none of them, and stays in the request. The empty path has no pattern and only a name.\n *\n * A node with children is folded until opened, with the number of paths under it, so a figure's dozens of bones do not fill the panel. Its disclosure button, between the controls and the name, opens and folds it and states whether it is open; it sits beside the controls, never around them, so no control is nested in another. The filter keeps the nodes whose path contains the typed text, with their ancestors, and opens them; while it does, their disclosure buttons are disabled.\n *\n * @evidence contracts/development/common.md#meaningful-documentation States the header, what each control edits, when a node is checked, what happens to typed patterns and the empty path, and how folding and the filter work.\n * @evidence contracts/development/implementation.md#principled-implementation The tree and each node's pattern come from `buildAutoMovieInspectorPathTree`, and every edit is a reducer action through the grammar, so the panel restates no path rule; folding is the disclosure pattern, a button with `aria-expanded` that owns no other control.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure One memoized tree, one filter, and one recursive row per node.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A checked state is read from the request, never kept in the panel; the filter hides rows and changes no request.\n * @evidence contracts/development/implementation.md#efficient-algorithms The tree is rebuilt only when the path list changes; a render is linear in the nodes times the lists' lengths, and a folded subtree is not rendered.\n * @evidence contracts/development/implementation.md#reuse-equivalent-work `useMemo` keeps the tree while the path list is the same array, which the mount reports once per instance.\n * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Holds the memoized tree and the filter text only while mounted.\n */\nexport function AutoMovieInspectorSelectionPanel(props: {\n /** The request shown. */\n request: IAutoMovieCapturePlanRequest;\n\n /** The subject's identity paths in scene order. */\n paths: readonly string[];\n\n /** Where edits go. */\n dispatch: (action: IAutoMovieInspectorAction) => void;\n}): JSX.Element {\n const tree: IAutoMovieInspectorPathNode[] = useMemo(\n (): IAutoMovieInspectorPathNode[] =>\n buildAutoMovieInspectorPathTree(props.paths),\n [props.paths],\n );\n const [filter, setFilter]: [string, Dispatch<SetStateAction<string>>] =\n useState<string>(\"\");\n const needle: string = filter.trim().toLowerCase();\n return (\n <div>\n <input\n type=\"search\"\n aria-label=\"Filter paths\"\n placeholder=\"Filter paths\"\n value={filter}\n style={{ width: \"100%\", boxSizing: \"border-box\", marginBottom: 6 }}\n onChange={(event: ChangeEvent<HTMLInputElement>): void =>\n setFilter(event.target.value)\n }\n />\n <div\n aria-hidden=\"true\"\n style={{\n display: \"flex\",\n fontSize: 11,\n color: \"#555\",\n borderBottom: \"1px solid #ccc\",\n marginBottom: 2,\n }}\n >\n {[\"Select\", \"Hide\", \"Label\", \"Colour\"].map(\n (name: string): JSX.Element => (\n <span\n key={name}\n title={name}\n style={{\n width: COLUMN,\n overflow: \"hidden\",\n textAlign: \"center\",\n writingMode: \"vertical-rl\",\n transform: \"rotate(180deg)\",\n height: 40,\n }}\n >\n {name}\n </span>\n ),\n )}\n <span style={{ alignSelf: \"flex-end\", paddingLeft: 6 }}>Path</span>\n </div>\n <ul style={{ listStyle: \"none\", paddingLeft: 0, margin: 0 }}>\n {tree.map((node: IAutoMovieInspectorPathNode): JSX.Element | null =>\n shown(node, needle) ? (\n <Row\n key={node.path}\n node={node}\n needle={needle}\n inspection={props.request.inspection}\n dispatch={props.dispatch}\n />\n ) : null,\n )}\n </ul>\n </div>\n );\n}\n\n/** Whether a node or any node under it matches the filter. */\nfunction shown(node: IAutoMovieInspectorPathNode, needle: string): boolean {\n return (\n needle === \"\" ||\n node.path.toLowerCase().includes(needle) ||\n node.children.some((child: IAutoMovieInspectorPathNode): boolean =>\n shown(child, needle),\n )\n );\n}\n\n/** The number of paths under a node. */\nfunction count(node: IAutoMovieInspectorPathNode): number {\n return node.children.reduce(\n (sum: number, child: IAutoMovieInspectorPathNode): number =>\n sum + 1 + count(child),\n 0,\n );\n}\n\n/** One node with its controls and, folded until opened, its children. */\nfunction Row(props: {\n node: IAutoMovieInspectorPathNode;\n needle: string;\n inspection: IAutoMovieInspectionRequest;\n dispatch: (action: IAutoMovieInspectorAction) => void;\n}): JSX.Element {\n const { node, needle, inspection, dispatch }: typeof props = props;\n const [open, setOpen]: [boolean, Dispatch<SetStateAction<boolean>>] =\n useState<boolean>(false);\n const pattern: string | null = node.pattern;\n const color: IAutoMovieInspectionColorAssignment | undefined =\n pattern === null\n ? undefined\n : inspection.color.find(\n (entry: IAutoMovieInspectionColorAssignment): boolean =>\n entry.pattern === pattern,\n );\n const label: string = node.name === \"\" ? \"(unnamed)\" : node.name;\n\n // A filter opens every node it keeps, so the matches are seen.\n const expanded: boolean = open || needle !== \"\";\n const toggle: (\n type: IAutoMovieInspectorAction.IToggle[\"type\"],\n list: readonly string[],\n ) => JSX.Element = (\n type: IAutoMovieInspectorAction.IToggle[\"type\"],\n list: readonly string[],\n ): JSX.Element => (\n <input\n type=\"checkbox\"\n aria-label={`${type} ${label}`}\n disabled={pattern === null}\n checked={pattern !== null && list.includes(pattern)}\n style={{ width: COLUMN - 8, margin: \"0 4px\" }}\n onChange={(event: ChangeEvent<HTMLInputElement>): void => {\n if (pattern !== null)\n dispatch({ type, pattern, on: event.target.checked });\n }}\n />\n );\n // A node with children has a disclosure button between its controls and\n // its name, beside them rather than around them, so no control sits inside\n // another; a leaf keeps the button's width, so the names stay aligned.\n const leaf: boolean = node.children.length === 0;\n const disclosure: JSX.Element = leaf ? (\n <span style={{ display: \"inline-block\", width: DISCLOSURE }} />\n ) : (\n <button\n type=\"button\"\n aria-expanded={expanded}\n aria-label={`${label}, ${count(node)} paths`}\n title={needle === \"\" ? undefined : \"Opened by the filter\"}\n disabled={needle !== \"\"}\n style={{\n width: DISCLOSURE,\n padding: 0,\n border: 0,\n background: \"none\",\n cursor: \"pointer\",\n }}\n onClick={(): void => setOpen(!open)}\n >\n {expanded ? \"▾\" : \"▸\"}\n </button>\n );\n const controls: JSX.Element = (\n <span\n style={{\n whiteSpace: \"nowrap\",\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n {toggle(\"select\", inspection.parts)}\n {toggle(\"hide\", inspection.hide)}\n {toggle(\"label\", inspection.label)}\n <input\n type=\"color\"\n aria-label={`colour ${label}`}\n disabled={pattern === null}\n value={`#${(color?.color ?? 0x808080).toString(16).padStart(6, \"0\")}`}\n style={{ width: COLUMN - 4, height: 16, padding: 0, border: 0 }}\n onChange={(event: ChangeEvent<HTMLInputElement>): void => {\n if (pattern !== null)\n dispatch({\n type: \"color\",\n pattern,\n color: Number.parseInt(event.target.value.slice(1), 16),\n });\n }}\n />\n {color === undefined || pattern === null ? null : (\n <button\n type=\"button\"\n aria-label={`clear the colour of ${label}`}\n onClick={(): void =>\n dispatch({ type: \"color\", pattern, color: null })\n }\n >\n x\n </button>\n )}\n {disclosure}\n <span style={{ fontWeight: node.drawn ? \"normal\" : \"bold\" }}>\n {label}\n </span>\n {leaf ? null : (\n <span aria-hidden=\"true\" style={{ color: \"#666\", fontSize: 11 }}>\n {\" \"}\n {count(node)}\n </span>\n )}\n </span>\n );\n if (leaf) return <li>{controls}</li>;\n return (\n <li>\n {controls}\n {expanded ? (\n <ul style={{ listStyle: \"none\", paddingLeft: 14, margin: 0 }}>\n {node.children.map(\n (child: IAutoMovieInspectorPathNode): JSX.Element | null =>\n shown(child, needle) ? (\n <Row\n key={child.path}\n node={child}\n needle={needle}\n inspection={inspection}\n dispatch={dispatch}\n />\n ) : null,\n )}\n </ul>\n ) : null}\n </li>\n );\n}\n"],"mappings":";;;;;AAqBA,MAAM,SAAiB;;AAGvB,MAAM,aAAq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
1
|
+
{"version":3,"file":"AutoMovieInspectorSelectionPanel.mjs","names":[],"sources":["../../src/inspector/AutoMovieInspectorSelectionPanel.tsx"],"sourcesContent":["import type {\n IAutoMovieCapturePlanRequest,\n IAutoMovieInspectionColorAssignment,\n IAutoMovieInspectionRequest,\n} from \"@automovie/interface\";\n\nimport {\n type ChangeEvent,\n type Dispatch,\n type JSX,\n type SetStateAction,\n useMemo,\n useState,\n} from \"react\";\n\nimport type { IAutoMovieInspectorAction } from \"./IAutoMovieInspectorAction.js\";\nimport type { IAutoMovieInspectorPathNode } from \"./IAutoMovieInspectorPathNode.js\";\nimport { buildAutoMovieInspectorPathTree } from \"./buildAutoMovieInspectorPathTree.js\";\n\n\n/** The width of each of the three checkbox columns and the colour column, pixels. */\nconst COLUMN: number = 22;\n\n/** The width of the disclosure button before a name, pixels. */\nconst DISCLOSURE: number = 16;\n\n/**\n * Selection: the subject's identity paths as a tree, with select, hide, label and colour per path.\n *\n * A header names the four columns. Each node edits the request by its pattern, the one that selects the node and its subtree: a checkbox puts the pattern in or takes it out of `parts`, `hide` or `label`, and the colour input gives it a `color` pair, which the clear button takes back. A node is checked when its own pattern is in the list, so a pattern typed in the address that matches several nodes checks none of them, and stays in the request. The empty path has no pattern and only a name.\n *\n * A node with children is folded until opened, with the number of paths under it, so a figure's dozens of bones do not fill the panel. Its disclosure button, between the controls and the name, opens and folds it and states whether it is open; it sits beside the controls, never around them, so no control is nested in another. The filter keeps the nodes whose path contains the typed text, with their ancestors, and opens them; while it does, their disclosure buttons are disabled.\n */\nexport function AutoMovieInspectorSelectionPanel(props: {\n /** The request shown. */\n request: IAutoMovieCapturePlanRequest;\n\n /** The subject's identity paths in scene order. */\n paths: readonly string[];\n\n /** Where edits go. */\n dispatch: (action: IAutoMovieInspectorAction) => void;\n}): JSX.Element {\n const tree: IAutoMovieInspectorPathNode[] = useMemo(\n (): IAutoMovieInspectorPathNode[] =>\n buildAutoMovieInspectorPathTree(props.paths),\n [props.paths],\n );\n const [filter, setFilter]: [string, Dispatch<SetStateAction<string>>] =\n useState<string>(\"\");\n const needle: string = filter.trim().toLowerCase();\n return (\n <div>\n <input\n type=\"search\"\n aria-label=\"Filter paths\"\n placeholder=\"Filter paths\"\n value={filter}\n style={{ width: \"100%\", boxSizing: \"border-box\", marginBottom: 6 }}\n onChange={(event: ChangeEvent<HTMLInputElement>): void =>\n setFilter(event.target.value)\n }\n />\n <div\n aria-hidden=\"true\"\n style={{\n display: \"flex\",\n fontSize: 11,\n color: \"#555\",\n borderBottom: \"1px solid #ccc\",\n marginBottom: 2,\n }}\n >\n {[\"Select\", \"Hide\", \"Label\", \"Colour\"].map(\n (name: string): JSX.Element => (\n <span\n key={name}\n title={name}\n style={{\n width: COLUMN,\n overflow: \"hidden\",\n textAlign: \"center\",\n writingMode: \"vertical-rl\",\n transform: \"rotate(180deg)\",\n height: 40,\n }}\n >\n {name}\n </span>\n ),\n )}\n <span style={{ alignSelf: \"flex-end\", paddingLeft: 6 }}>Path</span>\n </div>\n <ul style={{ listStyle: \"none\", paddingLeft: 0, margin: 0 }}>\n {tree.map((node: IAutoMovieInspectorPathNode): JSX.Element | null =>\n shown(node, needle) ? (\n <Row\n key={node.path}\n node={node}\n needle={needle}\n inspection={props.request.inspection}\n dispatch={props.dispatch}\n />\n ) : null,\n )}\n </ul>\n </div>\n );\n}\n\n/** Whether a node or any node under it matches the filter. */\nfunction shown(node: IAutoMovieInspectorPathNode, needle: string): boolean {\n return (\n needle === \"\" ||\n node.path.toLowerCase().includes(needle) ||\n node.children.some((child: IAutoMovieInspectorPathNode): boolean =>\n shown(child, needle),\n )\n );\n}\n\n/** The number of paths under a node. */\nfunction count(node: IAutoMovieInspectorPathNode): number {\n return node.children.reduce(\n (sum: number, child: IAutoMovieInspectorPathNode): number =>\n sum + 1 + count(child),\n 0,\n );\n}\n\n/** One node with its controls and, folded until opened, its children. */\nfunction Row(props: {\n node: IAutoMovieInspectorPathNode;\n needle: string;\n inspection: IAutoMovieInspectionRequest;\n dispatch: (action: IAutoMovieInspectorAction) => void;\n}): JSX.Element {\n const { node, needle, inspection, dispatch }: typeof props = props;\n const [open, setOpen]: [boolean, Dispatch<SetStateAction<boolean>>] =\n useState<boolean>(false);\n const pattern: string | null = node.pattern;\n const color: IAutoMovieInspectionColorAssignment | undefined =\n pattern === null\n ? undefined\n : inspection.color.find(\n (entry: IAutoMovieInspectionColorAssignment): boolean =>\n entry.pattern === pattern,\n );\n const label: string = node.name === \"\" ? \"(unnamed)\" : node.name;\n\n // A filter opens every node it keeps, so the matches are seen.\n const expanded: boolean = open || needle !== \"\";\n const toggle: (\n type: IAutoMovieInspectorAction.IToggle[\"type\"],\n list: readonly string[],\n ) => JSX.Element = (\n type: IAutoMovieInspectorAction.IToggle[\"type\"],\n list: readonly string[],\n ): JSX.Element => (\n <input\n type=\"checkbox\"\n aria-label={`${type} ${label}`}\n disabled={pattern === null}\n checked={pattern !== null && list.includes(pattern)}\n style={{ width: COLUMN - 8, margin: \"0 4px\" }}\n onChange={(event: ChangeEvent<HTMLInputElement>): void => {\n if (pattern !== null)\n dispatch({ type, pattern, on: event.target.checked });\n }}\n />\n );\n // A node with children has a disclosure button between its controls and\n // its name, beside them rather than around them, so no control sits inside\n // another; a leaf keeps the button's width, so the names stay aligned.\n const leaf: boolean = node.children.length === 0;\n const disclosure: JSX.Element = leaf ? (\n <span style={{ display: \"inline-block\", width: DISCLOSURE }} />\n ) : (\n <button\n type=\"button\"\n aria-expanded={expanded}\n aria-label={`${label}, ${count(node)} paths`}\n title={needle === \"\" ? undefined : \"Opened by the filter\"}\n disabled={needle !== \"\"}\n style={{\n width: DISCLOSURE,\n padding: 0,\n border: 0,\n background: \"none\",\n cursor: \"pointer\",\n }}\n onClick={(): void => setOpen(!open)}\n >\n {expanded ? \"▾\" : \"▸\"}\n </button>\n );\n const controls: JSX.Element = (\n <span\n style={{\n whiteSpace: \"nowrap\",\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n {toggle(\"select\", inspection.parts)}\n {toggle(\"hide\", inspection.hide)}\n {toggle(\"label\", inspection.label)}\n <input\n type=\"color\"\n aria-label={`colour ${label}`}\n disabled={pattern === null}\n value={`#${(color?.color ?? 0x808080).toString(16).padStart(6, \"0\")}`}\n style={{ width: COLUMN - 4, height: 16, padding: 0, border: 0 }}\n onChange={(event: ChangeEvent<HTMLInputElement>): void => {\n if (pattern !== null)\n dispatch({\n type: \"color\",\n pattern,\n color: Number.parseInt(event.target.value.slice(1), 16),\n });\n }}\n />\n {color === undefined || pattern === null ? null : (\n <button\n type=\"button\"\n aria-label={`clear the colour of ${label}`}\n onClick={(): void =>\n dispatch({ type: \"color\", pattern, color: null })\n }\n >\n x\n </button>\n )}\n {disclosure}\n <span style={{ fontWeight: node.drawn ? \"normal\" : \"bold\" }}>\n {label}\n </span>\n {leaf ? null : (\n <span aria-hidden=\"true\" style={{ color: \"#666\", fontSize: 11 }}>\n {\" \"}\n {count(node)}\n </span>\n )}\n </span>\n );\n if (leaf) return <li>{controls}</li>;\n return (\n <li>\n {controls}\n {expanded ? (\n <ul style={{ listStyle: \"none\", paddingLeft: 14, margin: 0 }}>\n {node.children.map(\n (child: IAutoMovieInspectorPathNode): JSX.Element | null =>\n shown(child, needle) ? (\n <Row\n key={child.path}\n node={child}\n needle={needle}\n inspection={inspection}\n dispatch={dispatch}\n />\n ) : null,\n )}\n </ul>\n ) : null}\n </li>\n );\n}\n"],"mappings":";;;;;AAqBA,MAAM,SAAiB;;AAGvB,MAAM,aAAqB;;;;;;;;AAS3B,SAAgB,iCAAiC,OASjC;CACd,MAAM,OAAsC,cAExC,gCAAgC,MAAM,KAAK,GAC7C,CAAC,MAAM,KAAK,CACd;CACA,MAAM,CAAC,QAAQ,aACb,SAAiB,EAAE;CACrB,MAAM,SAAiB,OAAO,KAAK,CAAC,CAAC,YAAY;CACjD,OACE,qBAAC,OAAD,EAAA,UAAA;EACE,oBAAC,SAAD;GACE,MAAK;GACL,cAAW;GACX,aAAY;GACZ,OAAO;G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IAAE;IAC9D,WAAW,UAA+C;KACxD,IAAI,YAAY,MACd,SAAS;MACP,MAAM;MACN;MACA,OAAO,OAAO,SAAS,MAAM,OAAO,MAAM,MAAM,CAAC,GAAG,EAAE;KACxD,CAAC;IACL;GACD,CAAA;GACA,UAAU,KAAA,KAAa,YAAY,OAAO,OACzC,oBAAC,UAAD;IACE,MAAK;IACL,cAAY,uBAAuB;IACnC,eACE,SAAS;KAAE,MAAM;KAAS;KAAS,OAAO;IAAK,CAAC;IAEnD,UAAA;GAEO,CAAA;GAET;GACD,oBAAC,QAAD;IAAM,OAAO,EAAE,YAAY,KAAK,QAAQ,WAAW,OAAO;IACvD,UAAA;GACG,CAAA;GACL,OAAO,OACN,qBAAC,QAAD;IAAM,eAAY;IAAO,OAAO;KAAE,OAAO;KAAQ,UAAU;IAAG;IAA9D,UAAA,CACG,KACA,MAAM,IAAI,CACP;;EAEJ;;CAER,IAAI,MAAM,OAAO,oBAAC,MAAD,EAAA,UAAK,SAAa,CAAA;CACnC,OACE,qBAAC,MAAD,EAAA,UAAA,CACG,UACA,WACC,oBAAC,MAAD;EAAI,OAAO;GAAE,WAAW;GAAQ,aAAa;GAAI,QAAQ;EAAE;EACxD,UAAA,KAAK,SAAS,KACZ,UACC,MAAM,OAAO,MAAM,IACjB,oBAAC,KAAD;GAEE,MAAM;GACE;GACI;GACF;EACX,GALM,MAAM,IAKZ,IACC,IACR;CACE,CAAA,IACF,IACF,EAAA,CAAA;AAER"}
|
|
@@ -4,15 +4,8 @@ import type { IAutoMovieInspectorAction } from "./IAutoMovieInspectorAction.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Shade and surface: how surfaces are coloured and whether they are drawn.
|
|
6
6
|
*
|
|
7
|
-
* The page draws the request's first pass, so the shade shown is `passes[0]`;
|
|
8
|
-
*
|
|
9
|
-
* @evidence contracts/development/common.md#meaningful-documentation States what the panel edits and how several passes become one.
|
|
10
|
-
* @evidence contracts/development/implementation.md#principled-implementation The shade list is a record keyed by the request's shade union, so a shade render adds fails compilation here until it is offered.
|
|
11
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One select and one checkbox, each dispatching one edit.
|
|
12
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The panel shows the request's values and keeps no copy of them.
|
|
13
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Constant per render.
|
|
14
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A view with handlers.
|
|
15
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Holds nothing.
|
|
7
|
+
* The page draws the request's first pass, so the shade shown is `passes[0]`;
|
|
8
|
+
* choosing one replaces every pass with it.
|
|
16
9
|
*/
|
|
17
10
|
export declare function AutoMovieInspectorShadePanel(props: {
|
|
18
11
|
/** The request shown. */
|
|
@@ -2,29 +2,26 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AutoMovieInspectorShadePanel = AutoMovieInspectorShadePanel;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/** Every shade
|
|
5
|
+
/** Every shade offered. */
|
|
6
6
|
const SHADES = {
|
|
7
|
-
beauty:
|
|
8
|
-
depth:
|
|
9
|
-
mask:
|
|
10
|
-
normal:
|
|
11
|
-
outline:
|
|
12
|
-
pose:
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
beauty: "beauty",
|
|
8
|
+
depth: "depth",
|
|
9
|
+
mask: "mask",
|
|
10
|
+
normal: "normal",
|
|
11
|
+
outline: "outline",
|
|
12
|
+
pose: "pose",
|
|
13
|
+
albedo: "albedo",
|
|
14
|
+
graphics: "graphics",
|
|
15
|
+
clay: "clay",
|
|
16
|
+
faces: "faces",
|
|
15
17
|
};
|
|
18
|
+
/** The shades in option order. */
|
|
19
|
+
const OPTIONS = Object.values(SHADES);
|
|
16
20
|
/**
|
|
17
21
|
* Shade and surface: how surfaces are coloured and whether they are drawn.
|
|
18
22
|
*
|
|
19
|
-
* The page draws the request's first pass, so the shade shown is `passes[0]`;
|
|
20
|
-
*
|
|
21
|
-
* @evidence contracts/development/common.md#meaningful-documentation States what the panel edits and how several passes become one.
|
|
22
|
-
* @evidence contracts/development/implementation.md#principled-implementation The shade list is a record keyed by the request's shade union, so a shade render adds fails compilation here until it is offered.
|
|
23
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One select and one checkbox, each dispatching one edit.
|
|
24
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The panel shows the request's values and keeps no copy of them.
|
|
25
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Constant per render.
|
|
26
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A view with handlers.
|
|
27
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Holds nothing.
|
|
23
|
+
* The page draws the request's first pass, so the shade shown is `passes[0]`;
|
|
24
|
+
* choosing one replaces every pass with it.
|
|
28
25
|
*/
|
|
29
26
|
function AutoMovieInspectorShadePanel(props) {
|
|
30
27
|
return ((0, jsx_runtime_1.jsxs)("fieldset", { style: { border: 0, padding: 0, margin: 0, minWidth: 0 }, children: [(0, jsx_runtime_1.jsx)("legend", { style: {
|
|
@@ -35,17 +32,13 @@ function AutoMovieInspectorShadePanel(props) {
|
|
|
35
32
|
clipPath: "inset(50%)",
|
|
36
33
|
whiteSpace: "nowrap",
|
|
37
34
|
}, children: "Shade" }), (0, jsx_runtime_1.jsx)("select", { "aria-label": "Shade", value: props.request.passes[0], onChange: (event) => {
|
|
38
|
-
const shade = event.target.
|
|
39
|
-
if (
|
|
35
|
+
const shade = OPTIONS[event.target.selectedIndex];
|
|
36
|
+
if (shade !== undefined)
|
|
40
37
|
props.dispatch({ type: "shade", shade });
|
|
41
|
-
}, children:
|
|
38
|
+
}, children: OPTIONS.map((shade) => ((0, jsx_runtime_1.jsx)("option", { value: shade, children: shade }, shade))) }), " ", (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: props.request.inspection.surface, onChange: (event) => props.dispatch({
|
|
42
39
|
type: "switch",
|
|
43
40
|
key: "surface",
|
|
44
41
|
on: event.target.checked,
|
|
45
42
|
}) }), " ", "surface"] })] }));
|
|
46
43
|
}
|
|
47
|
-
/** Whether a text is one of the shades offered. */
|
|
48
|
-
function isShade(text) {
|
|
49
|
-
return Object.hasOwn(SHADES, text);
|
|
50
|
-
}
|
|
51
44
|
//# sourceMappingURL=AutoMovieInspectorShadePanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMovieInspectorShadePanel.js","sourceRoot":"","sources":["../../src/inspector/AutoMovieInspectorShadePanel.tsx"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"AutoMovieInspectorShadePanel.js","sourceRoot":"","sources":["../../src/inspector/AutoMovieInspectorShadePanel.tsx"],"names":[],"mappings":";;;;AAWA,2BAA2B;AAC3B,MAAM,MAAM,GAAgB;IAC1B,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,kCAAkC;AAClC,MAAM,OAAO,GAA+B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAElE;;;;;GAKG;AACH,sCAA6C,KAM5C;IACC,OAAO,CACL,sCAAU,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,aAChE,mCACE,KAAK,EAAE;oBACL,QAAQ,EAAE,UAAU;oBACpB,KAAK,EAAE,CAAC;oBACR,MAAM,EAAE,CAAC;oBACT,QAAQ,EAAE,QAAQ;oBAClB,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,QAAQ;iBACrB,sBAGM,EACT,iDACa,OAAO,EAClB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAC9B,QAAQ,EAAE,CAAC,KAAqC,EAAQ,EAAE;oBACxD,MAAM,KAAK,GACT,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;oBACtC,IAAI,KAAK,KAAK,SAAS;wBAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;gBACpE,CAAC,YAEA,OAAO,CAAC,GAAG,CACV,CAAC,KAA+B,EAAe,EAAE,CAAC,CAChD,mCAAoB,KAAK,EAAE,KAAK,YAC7B,KAAK,IADK,KAAK,CAET,CACV,CACF,GACM,EAAC,GAAG,EACb,8CACE,kCACE,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EACzC,QAAQ,EAAE,CAAC,KAAoC,EAAQ,EAAE,CACvD,KAAK,CAAC,QAAQ,CAAC;4BACb,IAAI,EAAE,QAAQ;4BACd,GAAG,EAAE,SAAS;4BACd,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;yBACzB,CAAC,GAEJ,EAAC,GAAG,eAEA,IACC,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
// src/inspector/AutoMovieInspectorShadePanel.tsx
|
|
3
|
-
/**
|
|
4
|
-
const
|
|
5
|
-
beauty:
|
|
6
|
-
depth:
|
|
7
|
-
mask:
|
|
8
|
-
normal:
|
|
9
|
-
outline:
|
|
10
|
-
pose:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
/** The shades in option order. */
|
|
4
|
+
const OPTIONS = Object.values({
|
|
5
|
+
beauty: "beauty",
|
|
6
|
+
depth: "depth",
|
|
7
|
+
mask: "mask",
|
|
8
|
+
normal: "normal",
|
|
9
|
+
outline: "outline",
|
|
10
|
+
pose: "pose",
|
|
11
|
+
albedo: "albedo",
|
|
12
|
+
graphics: "graphics",
|
|
13
|
+
clay: "clay",
|
|
14
|
+
faces: "faces"
|
|
15
|
+
});
|
|
14
16
|
/**
|
|
15
17
|
* Shade and surface: how surfaces are coloured and whether they are drawn.
|
|
16
18
|
*
|
|
17
|
-
* The page draws the request's first pass, so the shade shown is `passes[0]`;
|
|
18
|
-
*
|
|
19
|
-
* @evidence contracts/development/common.md#meaningful-documentation States what the panel edits and how several passes become one.
|
|
20
|
-
* @evidence contracts/development/implementation.md#principled-implementation The shade list is a record keyed by the request's shade union, so a shade render adds fails compilation here until it is offered.
|
|
21
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One select and one checkbox, each dispatching one edit.
|
|
22
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The panel shows the request's values and keeps no copy of them.
|
|
23
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Constant per render.
|
|
24
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A view with handlers.
|
|
25
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Holds nothing.
|
|
19
|
+
* The page draws the request's first pass, so the shade shown is `passes[0]`;
|
|
20
|
+
* choosing one replaces every pass with it.
|
|
26
21
|
*/
|
|
27
22
|
function AutoMovieInspectorShadePanel(props) {
|
|
28
23
|
return /* @__PURE__ */ jsxs("fieldset", {
|
|
@@ -48,13 +43,13 @@ function AutoMovieInspectorShadePanel(props) {
|
|
|
48
43
|
"aria-label": "Shade",
|
|
49
44
|
value: props.request.passes[0],
|
|
50
45
|
onChange: (event) => {
|
|
51
|
-
const shade = event.target.
|
|
52
|
-
if (
|
|
46
|
+
const shade = OPTIONS[event.target.selectedIndex];
|
|
47
|
+
if (shade !== void 0) props.dispatch({
|
|
53
48
|
type: "shade",
|
|
54
49
|
shade
|
|
55
50
|
});
|
|
56
51
|
},
|
|
57
|
-
children:
|
|
52
|
+
children: OPTIONS.map((shade) => /* @__PURE__ */ jsx("option", {
|
|
58
53
|
value: shade,
|
|
59
54
|
children: shade
|
|
60
55
|
}, shade))
|
|
@@ -76,10 +71,6 @@ function AutoMovieInspectorShadePanel(props) {
|
|
|
76
71
|
]
|
|
77
72
|
});
|
|
78
73
|
}
|
|
79
|
-
/** Whether a text is one of the shades offered. */
|
|
80
|
-
function isShade(text) {
|
|
81
|
-
return Object.hasOwn(SHADES, text);
|
|
82
|
-
}
|
|
83
74
|
export { AutoMovieInspectorShadePanel };
|
|
84
75
|
|
|
85
76
|
//# sourceMappingURL=AutoMovieInspectorShadePanel.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMovieInspectorShadePanel.mjs","names":[],"sources":["../../src/inspector/AutoMovieInspectorShadePanel.tsx"],"sourcesContent":["import type {\n AutoMovieInspectionShade,\n IAutoMovieCapturePlanRequest,\n} from \"@automovie/interface\";\
|
|
1
|
+
{"version":3,"file":"AutoMovieInspectorShadePanel.mjs","names":[],"sources":["../../src/inspector/AutoMovieInspectorShadePanel.tsx"],"sourcesContent":["import type {\n AutoMovieInspectionShade,\n IAutoMovieCapturePlanRequest,\n} from \"@automovie/interface\";\nimport type { ChangeEvent, JSX } from \"react\";\n\nimport type { IAutoMovieInspectorAction } from \"./IAutoMovieInspectorAction.js\";\n\n/** Each shade keyed by itself, so the compiler refuses a list that misses one. */\ntype IShadeIndex = { [Shade in AutoMovieInspectionShade]: Shade };\n\n/** Every shade offered. */\nconst SHADES: IShadeIndex = {\n beauty: \"beauty\",\n depth: \"depth\",\n mask: \"mask\",\n normal: \"normal\",\n outline: \"outline\",\n pose: \"pose\",\n albedo: \"albedo\",\n graphics: \"graphics\",\n clay: \"clay\",\n faces: \"faces\",\n};\n\n/** The shades in option order. */\nconst OPTIONS: AutoMovieInspectionShade[] = Object.values(SHADES);\n\n/**\n * Shade and surface: how surfaces are coloured and whether they are drawn.\n *\n * The page draws the request's first pass, so the shade shown is `passes[0]`;\n * choosing one replaces every pass with it.\n */\nexport function AutoMovieInspectorShadePanel(props: {\n /** The request shown. */\n request: IAutoMovieCapturePlanRequest;\n\n /** Where edits go. */\n dispatch: (action: IAutoMovieInspectorAction) => void;\n}): JSX.Element {\n return (\n <fieldset style={{ border: 0, padding: 0, margin: 0, minWidth: 0 }}>\n <legend\n style={{\n position: \"absolute\",\n width: 1,\n height: 1,\n overflow: \"hidden\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n }}\n >\n Shade\n </legend>\n <select\n aria-label=\"Shade\"\n value={props.request.passes[0]}\n onChange={(event: ChangeEvent<HTMLSelectElement>): void => {\n const shade: AutoMovieInspectionShade | undefined =\n OPTIONS[event.target.selectedIndex];\n if (shade !== undefined) props.dispatch({ type: \"shade\", shade });\n }}\n >\n {OPTIONS.map(\n (shade: AutoMovieInspectionShade): JSX.Element => (\n <option key={shade} value={shade}>\n {shade}\n </option>\n ),\n )}\n </select>{\" \"}\n <label>\n <input\n type=\"checkbox\"\n checked={props.request.inspection.surface}\n onChange={(event: ChangeEvent<HTMLInputElement>): void =>\n props.dispatch({\n type: \"switch\",\n key: \"surface\",\n on: event.target.checked,\n })\n }\n />{\" \"}\n surface\n </label>\n </fieldset>\n );\n}\n"],"mappings":";;;AA0BA,MAAM,UAAsC,OAAO,OAAO;CAbxD,QAAQ;CACR,OAAO;CACP,MAAM;CACN,QAAQ;CACR,SAAS;CACT,MAAM;CACN,QAAQ;CACR,UAAU;CACV,MAAM;CACN,OAAO;AAIsD,CAAC;;;;;;;AAQhE,SAAgB,6BAA6B,OAM7B;CACd,OACE,qBAAC,YAAD;EAAU,OAAO;GAAE,QAAQ;GAAG,SAAS;GAAG,QAAQ;GAAG,UAAU;EAAE;EAAjE,UAAA;GACE,oBAAC,UAAD;IACE,OAAO;KACL,UAAU;KACV,OAAO;KACP,QAAQ;KACR,UAAU;KACV,UAAU;KACV,YAAY;IACd;IACD,UAAA;GAEO,CAAA;GACR,oBAAC,UAAD;IACE,cAAW;IACX,OAAO,MAAM,QAAQ,OAAO;IAC5B,WAAW,UAAgD;KACzD,MAAM,QACJ,QAAQ,MAAM,OAAO;KACvB,IAAI,UAAU,KAAA,GAAW,MAAM,SAAS;MAAE,MAAM;MAAS;KAAM,CAAC;IAClE;IAEC,UAAA,QAAQ,KACN,UACC,oBAAC,UAAD;KAAoB,OAAO;KACxB,UAAA;IACK,GAFK,KAEL,CAEZ;GACM,CAAA;GAAE;GACV,qBAAC,SAAD,EAAA,UAAA;IACE,oBAAC,SAAD;KACE,MAAK;KACL,SAAS,MAAM,QAAQ,WAAW;KAClC,WAAW,UACT,MAAM,SAAS;MACb,MAAM;MACN,KAAK;MACL,IAAI,MAAM,OAAO;KACnB,CAAC;IAEJ,CAAA;IAAE;IAAI;GAEF,EAAA,CAAA;EACC;;AAEd"}
|
|
@@ -5,14 +5,6 @@ import type { IAutoMovieInspectorAction } from "./IAutoMovieInspectorAction.js";
|
|
|
5
5
|
* The transport under the canvas: one play or pause button, the scrubber and clock, and the preview speed.
|
|
6
6
|
*
|
|
7
7
|
* Play, pause and the speed move only the playhead; the readout turns a stop or a seek into a `time` edit, so the request names the picture left on screen. The button reads only whether the playhead plays, so playing frames do not re-render it; its label says what pressing it does, Play or Pause, and it carries no pressed state, since a toggle's label must not change with its state.
|
|
8
|
-
*
|
|
9
|
-
* @evidence contracts/development/common.md#meaningful-documentation States what each control changes, which of them edit the request, what the button reads and how it is labelled.
|
|
10
|
-
* @evidence contracts/development/implementation.md#principled-implementation The speed changes no picture, so it stays with the playhead; a stop or seek fixes a picture, so the readout makes it the request's second.
|
|
11
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One toggle, the readout and a select.
|
|
12
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The button subscribes to the playing flag alone, a boolean React compares by value, so moving seconds never re-render the panel.
|
|
13
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Constant per render, one render per start or stop.
|
|
14
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A view with handlers.
|
|
15
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources React holds one playhead subscription while the panel is mounted and removes it on unmount; the readout holds its own.
|
|
16
8
|
*/
|
|
17
9
|
export declare function AutoMovieInspectorTimePanel(props: {
|
|
18
10
|
/** The playhead driven. */
|
|
@@ -10,14 +10,6 @@ const RATES = [0.1, 0.25, 0.5, 1, 2];
|
|
|
10
10
|
* The transport under the canvas: one play or pause button, the scrubber and clock, and the preview speed.
|
|
11
11
|
*
|
|
12
12
|
* Play, pause and the speed move only the playhead; the readout turns a stop or a seek into a `time` edit, so the request names the picture left on screen. The button reads only whether the playhead plays, so playing frames do not re-render it; its label says what pressing it does, Play or Pause, and it carries no pressed state, since a toggle's label must not change with its state.
|
|
13
|
-
*
|
|
14
|
-
* @evidence contracts/development/common.md#meaningful-documentation States what each control changes, which of them edit the request, what the button reads and how it is labelled.
|
|
15
|
-
* @evidence contracts/development/implementation.md#principled-implementation The speed changes no picture, so it stays with the playhead; a stop or seek fixes a picture, so the readout makes it the request's second.
|
|
16
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One toggle, the readout and a select.
|
|
17
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The button subscribes to the playing flag alone, a boolean React compares by value, so moving seconds never re-render the panel.
|
|
18
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Constant per render, one render per start or stop.
|
|
19
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A view with handlers.
|
|
20
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources React holds one playhead subscription while the panel is mounted and removes it on unmount; the readout holds its own.
|
|
21
13
|
*/
|
|
22
14
|
function AutoMovieInspectorTimePanel(props) {
|
|
23
15
|
const playing = (0, react_1.useSyncExternalStore)(props.playhead.subscribe, () => props.playhead.getSnapshot().playing);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMovieInspectorTimePanel.js","sourceRoot":"","sources":["../../src/inspector/AutoMovieInspectorTimePanel.tsx"],"names":[],"mappings":";;;;AAAA,iCAAyE;AAGzE,yFAAmF;AAGnF,yDAAyD;AACzD,MAAM,KAAK,GAAsB,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"AutoMovieInspectorTimePanel.js","sourceRoot":"","sources":["../../src/inspector/AutoMovieInspectorTimePanel.tsx"],"names":[],"mappings":";;;;AAAA,iCAAyE;AAGzE,yFAAmF;AAGnF,yDAAyD;AACzD,MAAM,KAAK,GAAsB,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAExD;;;;GAIG;AACH,qCAA4C,KAS3C;IACC,MAAM,OAAO,GAAY,IAAA,4BAAoB,EAC3C,KAAK,CAAC,QAAQ,CAAC,SAAS,EACxB,GAAY,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,CACpD,CAAC;IACF,OAAO,CACL,iCACE,IAAI,EAAC,OAAO,gBACD,UAAU,EACrB,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAEzE,mCACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EACvB,OAAO,EAAE,GAAS,EAAE,CAClB,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,YAGzD,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GACpB,EACT,uBAAC,gEAA6B,IAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,QAAQ,EAAE,KAAK,CAAC,QAAQ,GACxB,EACF,iDACa,OAAO,EAClB,YAAY,EAAC,GAAG,EAChB,QAAQ,EAAE,CAAC,KAAqC,EAAQ,EAAE,CACxD,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,YAGnD,KAAK,CAAC,GAAG,CACR,CAAC,IAAY,EAAe,EAAE,CAAC,CAC7B,oCAAmB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,aACnC,IAAI,UADM,IAAI,CAER,CACV,CACF,GACM,IACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -14,14 +14,6 @@ const RATES = [
|
|
|
14
14
|
* The transport under the canvas: one play or pause button, the scrubber and clock, and the preview speed.
|
|
15
15
|
*
|
|
16
16
|
* Play, pause and the speed move only the playhead; the readout turns a stop or a seek into a `time` edit, so the request names the picture left on screen. The button reads only whether the playhead plays, so playing frames do not re-render it; its label says what pressing it does, Play or Pause, and it carries no pressed state, since a toggle's label must not change with its state.
|
|
17
|
-
*
|
|
18
|
-
* @evidence contracts/development/common.md#meaningful-documentation States what each control changes, which of them edit the request, what the button reads and how it is labelled.
|
|
19
|
-
* @evidence contracts/development/implementation.md#principled-implementation The speed changes no picture, so it stays with the playhead; a stop or seek fixes a picture, so the readout makes it the request's second.
|
|
20
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One toggle, the readout and a select.
|
|
21
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The button subscribes to the playing flag alone, a boolean React compares by value, so moving seconds never re-render the panel.
|
|
22
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Constant per render, one render per start or stop.
|
|
23
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A view with handlers.
|
|
24
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources React holds one playhead subscription while the panel is mounted and removes it on unmount; the readout holds its own.
|
|
25
17
|
*/
|
|
26
18
|
function AutoMovieInspectorTimePanel(props) {
|
|
27
19
|
const playing = useSyncExternalStore(props.playhead.subscribe, () => props.playhead.getSnapshot().playing);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMovieInspectorTimePanel.mjs","names":[],"sources":["../../src/inspector/AutoMovieInspectorTimePanel.tsx"],"sourcesContent":["import { type ChangeEvent, type JSX, useSyncExternalStore } from \"react\";\n\nimport type { AutoMovieInspectorPlayhead } from \"./AutoMovieInspectorPlayhead.js\";\nimport { AutoMovieInspectorTimeReadout } from \"./AutoMovieInspectorTimeReadout.js\";\nimport type { IAutoMovieInspectorAction } from \"./IAutoMovieInspectorAction.js\";\n\n/** Preview speeds offered, as multiples of real time. */\nconst RATES: readonly number[] = [0.1, 0.25, 0.5, 1, 2];\n\n/**\n * The transport under the canvas: one play or pause button, the scrubber and clock, and the preview speed.\n *\n * Play, pause and the speed move only the playhead; the readout turns a stop or a seek into a `time` edit, so the request names the picture left on screen. The button reads only whether the playhead plays, so playing frames do not re-render it; its label says what pressing it does, Play or Pause, and it carries no pressed state, since a toggle's label must not change with its state.\n
|
|
1
|
+
{"version":3,"file":"AutoMovieInspectorTimePanel.mjs","names":[],"sources":["../../src/inspector/AutoMovieInspectorTimePanel.tsx"],"sourcesContent":["import { type ChangeEvent, type JSX, useSyncExternalStore } from \"react\";\n\nimport type { AutoMovieInspectorPlayhead } from \"./AutoMovieInspectorPlayhead.js\";\nimport { AutoMovieInspectorTimeReadout } from \"./AutoMovieInspectorTimeReadout.js\";\nimport type { IAutoMovieInspectorAction } from \"./IAutoMovieInspectorAction.js\";\n\n/** Preview speeds offered, as multiples of real time. */\nconst RATES: readonly number[] = [0.1, 0.25, 0.5, 1, 2];\n\n/**\n * The transport under the canvas: one play or pause button, the scrubber and clock, and the preview speed.\n *\n * Play, pause and the speed move only the playhead; the readout turns a stop or a seek into a `time` edit, so the request names the picture left on screen. The button reads only whether the playhead plays, so playing frames do not re-render it; its label says what pressing it does, Play or Pause, and it carries no pressed state, since a toggle's label must not change with its state.\n */\nexport function AutoMovieInspectorTimePanel(props: {\n /** The playhead driven. */\n playhead: AutoMovieInspectorPlayhead;\n\n /** The subject's frames per second, the slider's step, or null before a subject is ready. */\n fps: number | null;\n\n /** Where a paused or sought second goes. */\n dispatch: (action: IAutoMovieInspectorAction) => void;\n}): JSX.Element {\n const playing: boolean = useSyncExternalStore(\n props.playhead.subscribe,\n (): boolean => props.playhead.getSnapshot().playing,\n );\n return (\n <div\n role=\"group\"\n aria-label=\"Playback\"\n style={{ display: \"flex\", gap: 8, alignItems: \"center\", margin: \"6px 0\" }}\n >\n <button\n type=\"button\"\n style={{ minWidth: 64 }}\n onClick={(): void =>\n playing ? props.playhead.pause() : props.playhead.play()\n }\n >\n {playing ? \"Pause\" : \"Play\"}\n </button>\n <AutoMovieInspectorTimeReadout\n playhead={props.playhead}\n fps={props.fps}\n dispatch={props.dispatch}\n />\n <select\n aria-label=\"Speed\"\n defaultValue=\"1\"\n onChange={(event: ChangeEvent<HTMLSelectElement>): void =>\n props.playhead.setRate(Number(event.target.value))\n }\n >\n {RATES.map(\n (rate: number): JSX.Element => (\n <option key={rate} value={String(rate)}>\n {rate}x\n </option>\n ),\n )}\n </select>\n </div>\n );\n}\n"],"mappings":";;;;;AAOA,MAAM,QAA2B;CAAC;CAAK;CAAM;CAAK;CAAG;AAAC;;;;;;AAOtD,SAAgB,4BAA4B,OAS5B;CACd,MAAM,UAAmB,qBACvB,MAAM,SAAS,iBACA,MAAM,SAAS,YAAY,CAAC,CAAC,OAC9C;CACA,OACE,qBAAC,OAAD;EACE,MAAK;EACL,cAAW;EACX,OAAO;GAAE,SAAS;GAAQ,KAAK;GAAG,YAAY;GAAU,QAAQ;EAAQ;EAH1E,UAAA;GAKE,oBAAC,UAAD;IACE,MAAK;IACL,OAAO,EAAE,UAAU,GAAG;IACtB,eACE,UAAU,MAAM,SAAS,MAAM,IAAI,MAAM,SAAS,KAAK;IAGxD,UAAA,UAAU,UAAU;GACf,CAAA;GACR,oBAAC,+BAAD;IACE,UAAU,MAAM;IAChB,KAAK,MAAM;IACX,UAAU,MAAM;GACjB,CAAA;GACD,oBAAC,UAAD;IACE,cAAW;IACX,cAAa;IACb,WAAW,UACT,MAAM,SAAS,QAAQ,OAAO,MAAM,OAAO,KAAK,CAAC;IAGlD,UAAA,MAAM,KACJ,SACC,qBAAC,UAAD;KAAmB,OAAO,OAAO,IAAI;KAArC,UAAA,CACG,MAAK,GACA;IAFK,GAAA,IAEL,CAEZ;GACM,CAAA;EACL;;AAET"}
|
|
@@ -5,14 +5,6 @@ import type { IAutoMovieInspectorAction } from "./IAutoMovieInspectorAction.js";
|
|
|
5
5
|
* The playhead's slider and clock, the one component that reads the playhead's second and so the only one a playing frame re-renders; the time panel reads only whether it plays.
|
|
6
6
|
*
|
|
7
7
|
* Moving the slider seeks to a regular frame or the exact end and dispatches the second as a `time` edit. Without a frame rate, the slider seeks directly in seconds. A pause or playback reaching the end also dispatches its second, so the request names the picture left on screen. The slider announces its second and, when available, its frame number.
|
|
8
|
-
*
|
|
9
|
-
* @evidence contracts/development/common.md#meaningful-documentation States what it shows, why it alone reads the playhead's second, when it edits the request and what it announces.
|
|
10
|
-
* @evidence contracts/development/implementation.md#principled-implementation `useSyncExternalStore` reads the cached playhead snapshot without tearing. Native range inputs enforce their step grid, so integer positions give every frame and the exact end a valid slider value.
|
|
11
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One store read, one slider that converts its position to seconds on seek, and one clock output.
|
|
12
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Playback frames dispatch nothing; only a seek and the change from playing to stopped edit the request, and the first render, which stops nothing, edits nothing.
|
|
13
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Constant work per render, one render per moved snapshot.
|
|
14
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work Uses the shared presentation grid and computes its last frame number once per render.
|
|
15
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources React holds one playhead subscription while the readout is mounted and removes it on unmount.
|
|
16
8
|
*/
|
|
17
9
|
export declare function AutoMovieInspectorTimeReadout(props: {
|
|
18
10
|
/** The playhead shown and sought. */
|