gps-plus-slam-app-framework 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -4
- package/README.md +310 -115
- package/dist/accuracy-circles-DEKr0Hoh.d.ts +43 -0
- package/dist/{app-selectors-CHt7DLuq.d.ts → app-selectors-CR9OWodf.d.ts} +8 -10
- package/dist/ar/camera-blit-capture.d.ts +1 -1
- package/dist/ar/capability-checker.d.ts +2 -0
- package/dist/ar/capability-checker.js +25 -0
- package/dist/ar/capture-failure-tracker.d.ts +1 -1
- package/dist/ar/chromium-camera-access-workaround.d.ts +2 -2
- package/dist/ar/chromium-camera-access-workaround.js +197 -8
- package/dist/ar/depth-sampler.d.ts +2 -2
- package/dist/ar/enable-gps-ar.d.ts +2 -0
- package/dist/ar/enable-gps-ar.js +137 -0
- package/dist/ar/frame-loop.d.ts +2 -0
- package/dist/ar/frame-loop.js +63 -0
- package/dist/ar/image-capture.d.ts +1 -1
- package/dist/ar/image-capture.js +1 -1
- package/dist/ar/index.d.ts +16 -12
- package/dist/ar/index.js +8 -4
- package/dist/ar/replay-scene.d.ts +1 -1
- package/dist/ar/scene-node-names.d.ts +1 -1
- package/dist/ar/webxr-session.d.ts +4 -4
- package/dist/ar/webxr-session.js +173 -93
- package/dist/ar/xr-camera-texture.d.ts +1 -1
- package/dist/ar/xr-error-handler.d.ts +1 -1
- package/dist/ar/xr-frame-loop.d.ts +2 -0
- package/dist/ar/xr-frame-loop.js +69 -0
- package/dist/ar-world-group-alignment-Dn4rQk_c.d.ts +43 -0
- package/dist/capability-checker-BTCmZRL4.d.ts +43 -0
- package/dist/chromium-camera-access-workaround-MifIwK9x.d.ts +137 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +2 -2
- package/dist/create-slam-app-store-B76AGaI0.d.ts +371 -0
- package/dist/{depth-sampler-BNCtnEoP.d.ts → depth-sampler-CqrkRr2N.d.ts} +1 -1
- package/dist/enable-gps-ar-DNbO0zbg.d.ts +95 -0
- package/dist/{file-system-DD5TczSO.d.ts → file-system-TIsDfamK.d.ts} +32 -2
- package/dist/frame-conversions-D2EYjeNa.d.ts +54 -0
- package/dist/frame-loop-BTeRpDm4.d.ts +47 -0
- package/dist/frustum-visibility-DGnJqls0.d.ts +58 -0
- package/dist/{fused-path-DtqCSqJh.d.ts → fused-path-BdVHmDW9.d.ts} +1 -1
- package/dist/geo/h3-proximity.d.ts +1 -1
- package/dist/geo/index.d.ts +1 -1
- package/dist/{geo-types-Xx-LVcnw.d.ts → geo-types-clgzl8b5.d.ts} +16 -1
- package/dist/{gps-GKc6_Cly.d.ts → gps-B7AlMPz5.d.ts} +1 -1
- package/dist/gps-anchor-CISLPQIb.d.ts +59 -0
- package/dist/{gps-ar-pose-sampler-D_Zso40V.d.ts → gps-ar-pose-sampler-BypXZUqC.d.ts} +1 -1
- package/dist/{gps-event-coordinator-fwvmVfku.d.ts → gps-event-coordinator-BKVZbS1M.d.ts} +3 -3
- package/dist/gps-event-markers-BlHq3jYV.d.ts +103 -0
- package/dist/hit-test-reticle-BGXOxrUh.d.ts +45 -0
- package/dist/{image-capture-2pKjYUS6.d.ts → image-capture-BXZUmj7j.d.ts} +1 -1
- package/dist/index--ldLph4V.d.ts +2 -0
- package/dist/index-22v8MXJX.d.ts +23 -0
- package/dist/index-BB2KEWbN2.d.ts +37 -0
- package/dist/index.d.ts +64 -52
- package/dist/index.js +21 -8
- package/dist/{leaflet-map-overlay-CQZcnxbc.d.ts → leaflet-map-overlay-jNt-kcUr.d.ts} +22 -11
- package/dist/{logger-B81iwxx0.d.ts → logger-BZ44Dhd3.d.ts} +7 -1
- package/dist/map-data-BGIBM5rv.d.ts +49 -0
- package/dist/map-overlay-draw-DcGs9UV3.d.ts +42 -0
- package/dist/{null-storage-backend-C0TiwwzQ.d.ts → null-storage-backend-BPQJSaMw.d.ts} +2 -2
- package/dist/{opfs-storage-backend-Gt3rd76D.d.ts → opfs-storage-backend-u4QKvgvP.d.ts} +2 -2
- package/dist/{permission-checker-Cu3nbH1S.d.ts → permission-checker-CfV7INCa.d.ts} +41 -1
- package/dist/persistence-middleware-xB5sTllJ.d.ts +55 -0
- package/dist/{recording-options-BYUFX8iU.d.ts → recording-options-BSFpBSZH.d.ts} +10 -4
- package/dist/{recording-replayer-BFhFs7Mc.d.ts → recording-replayer-CTL2cUE0.d.ts} +2 -2
- package/dist/{recording-slice-BiktUIWF.d.ts → recording-slice-Cb888P6d.d.ts} +2 -2
- package/dist/{replay-engine-B88Va62x.d.ts → replay-engine-B-5GIZtc.d.ts} +1 -1
- package/dist/{replay-scene-DtUm6bsr.d.ts → replay-scene-DkNfldPh.d.ts} +3 -3
- package/dist/sensors/gps-error-handler.d.ts +1 -1
- package/dist/sensors/gps.d.ts +1 -1
- package/dist/sensors/gps.js +2 -2
- package/dist/sensors/index.d.ts +3 -3
- package/dist/sensors/index.js +1 -1
- package/dist/sensors/permission-checker.d.ts +2 -2
- package/dist/sensors/permission-checker.js +79 -1
- package/dist/session-disposers-M-oashRH.js +57 -0
- package/dist/state/app-selectors.d.ts +2 -2
- package/dist/state/app-selectors.js +33 -3
- package/dist/state/combined-root-state.d.ts +2 -0
- package/dist/state/combined-root-state.js +1 -0
- package/dist/state/create-slam-app-store.d.ts +1 -1
- package/dist/state/create-slam-app-store.js +27 -13
- package/dist/state/gps-ar-pose-sampler.d.ts +3 -3
- package/dist/state/gps-event-coordinator.d.ts +1 -1
- package/dist/state/index.d.ts +17 -16
- package/dist/state/index.js +6 -4
- package/dist/state/persistence-middleware.d.ts +2 -2
- package/dist/state/persistence-middleware.js +43 -9
- package/dist/state/recording-options.d.ts +1 -1
- package/dist/state/recording-replayer.d.ts +2 -2
- package/dist/state/recording-slice.d.ts +1 -1
- package/dist/state/replay-engine.d.ts +1 -1
- package/dist/state/store-subscribers.d.ts +2 -2
- package/dist/state/store-subscribers.js +38 -12
- package/dist/state/subscribe-to-selector.d.ts +1 -1
- package/dist/state/tracking-quality.d.ts +2 -0
- package/dist/state/tracking-quality.js +723 -0
- package/dist/state/tracking-slice.d.ts +2 -0
- package/dist/state/tracking-slice.js +147 -0
- package/dist/state-BkIfpiyA.js +87 -0
- package/dist/storage/file-system-utils.d.ts +1 -1
- package/dist/storage/file-system.d.ts +2 -2
- package/dist/storage/file-system.js +52 -1
- package/dist/storage/index.d.ts +8 -8
- package/dist/storage/null-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage.d.ts +1 -1
- package/dist/storage/storage-backend.d.ts +1 -1
- package/dist/storage/zip-export.d.ts +1 -1
- package/dist/storage/zip-reader.d.ts +1 -1
- package/dist/storage/zip-reader.js +8 -4
- package/dist/{storage-backend-yVnuWGTr.d.ts → storage-backend-yDSKafAQ.d.ts} +1 -1
- package/dist/{store-subscribers-DKKHld49.d.ts → store-subscribers-swlbtg_z.d.ts} +31 -6
- package/dist/{subscribe-to-selector-ghDKYtap.d.ts → subscribe-to-selector--KQpgLXG.d.ts} +1 -1
- package/dist/test-utils/browser-mocks.d.ts +1 -1
- package/dist/test-utils/zip-round-trip-helpers.d.ts +7 -1
- package/dist/test-utils/zip-round-trip-helpers.js +2 -1
- package/dist/tracking-slice-CDREeoZ_.d.ts +86 -0
- package/dist/types/ar-types.d.ts +1 -1
- package/dist/types/geo-types.d.ts +2 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/utils/concurrency.d.ts +1 -1
- package/dist/utils/failure-tracker.d.ts +1 -1
- package/dist/utils/format-file-size.d.ts +1 -1
- package/dist/utils/fused-path.d.ts +1 -1
- package/dist/utils/index.d.ts +6 -6
- package/dist/utils/list-formatter.d.ts +1 -1
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils/logger.js +68 -8
- package/dist/visualization/accuracy-circles.d.ts +2 -0
- package/dist/visualization/accuracy-circles.js +57 -0
- package/dist/visualization/alignment-lerper.d.ts +1 -1
- package/dist/visualization/ar-world-group-alignment.d.ts +2 -0
- package/dist/visualization/ar-world-group-alignment.js +51 -0
- package/dist/visualization/camera-follower.d.ts +1 -1
- package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
- package/dist/visualization/frame-conversions.d.ts +2 -0
- package/dist/visualization/frame-conversions.js +88 -0
- package/dist/visualization/frustum-visibility.d.ts +2 -0
- package/dist/visualization/frustum-visibility.js +139 -0
- package/dist/visualization/gps-anchor.d.ts +2 -0
- package/dist/visualization/gps-anchor.js +217 -0
- package/dist/visualization/gps-compass-cubes.d.ts +1 -1
- package/dist/visualization/gps-event-markers.d.ts +2 -2
- package/dist/visualization/gps-event-markers.js +69 -2
- package/dist/visualization/hit-test-reticle.d.ts +2 -0
- package/dist/visualization/hit-test-reticle.js +81 -0
- package/dist/visualization/index.d.ts +19 -12
- package/dist/visualization/index.js +9 -2
- package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
- package/dist/visualization/leaflet-map-overlay.js +33 -79
- package/dist/visualization/lerp-utils.d.ts +1 -1
- package/dist/visualization/map-data.d.ts +2 -0
- package/dist/visualization/map-data.js +33 -0
- package/dist/visualization/map-overlay-draw.d.ts +2 -0
- package/dist/visualization/map-overlay-draw.js +107 -0
- package/dist/visualization/map-overlay.d.ts +1 -1
- package/dist/visualization/three-dispose.d.ts +1 -1
- package/dist/visualization/vis-colors.d.ts +1 -1
- package/dist/webxr-nue-basis-BbdqhqY6.js +54 -0
- package/dist/{webxr-session-COlSrXdL.d.ts → webxr-session-BnArFCew.d.ts} +76 -14
- package/dist/xr-frame-loop-BKckC7xC.d.ts +70 -0
- package/dist/{zip-reader-KgJEXbca.d.ts → zip-reader-B2lzN8F5.d.ts} +5 -0
- package/package.json +16 -16
- package/dist/ar/tracking-state.d.ts +0 -2
- package/dist/ar/tracking-state.js +0 -164
- package/dist/chromium-camera-access-workaround-CU5zSKNr.d.ts +0 -61
- package/dist/combined-root-state-B3SvPNjU.d.ts +0 -6
- package/dist/create-slam-app-store-DBm7g2Zd.d.ts +0 -85
- package/dist/gps-anchored-mesh-manager-CovAFK4g.d.ts +0 -56
- package/dist/gps-event-markers-sVyO9utS.d.ts +0 -67
- package/dist/persistence-middleware-z-75iisb.d.ts +0 -31
- package/dist/tracking-state-B9QfuZCg.d.ts +0 -101
- package/dist/visualization/gps-anchored-mesh-manager.d.ts +0 -2
- package/dist/visualization/gps-anchored-mesh-manager.js +0 -128
- /package/dist/{alignment-lerper-D9BeDwZX.d.ts → alignment-lerper-CCZJf-Xb.d.ts} +0 -0
- /package/dist/{ar-types-B-ORgk6Z.d.ts → ar-types-isPsQptb.d.ts} +0 -0
- /package/dist/{camera-blit-capture-DHuyrrxr.d.ts → camera-blit-capture-75WWa9Xb.d.ts} +0 -0
- /package/dist/{camera-follower-BMqPddxx.d.ts → camera-follower-B-nS1sr6.d.ts} +0 -0
- /package/dist/{capture-failure-tracker-2Q6oI2uQ.d.ts → capture-failure-tracker-D4HYJNOj.d.ts} +0 -0
- /package/dist/{concurrency-p6gB30fT.d.ts → concurrency-Bsmv53qw.d.ts} +0 -0
- /package/dist/{css3d-renderer-manager-rgLMVAvd.d.ts → css3d-renderer-manager-EDED3nvg.d.ts} +0 -0
- /package/dist/{failure-tracker-1sQ_Cgyw.d.ts → failure-tracker-D7ELffm0.d.ts} +0 -0
- /package/dist/{file-system-utils-BH8FdyIu.d.ts → file-system-utils-BH6uIs2i.d.ts} +0 -0
- /package/dist/{format-file-size-onGq0k1Q.d.ts → format-file-size-B7gJb3Md.d.ts} +0 -0
- /package/dist/{gps-compass-cubes-jRIJMOuh.d.ts → gps-compass-cubes-Ys6Hf1nc.d.ts} +0 -0
- /package/dist/{gps-error-handler-CH1S528z.d.ts → gps-error-handler-BLDhUlw5.d.ts} +0 -0
- /package/dist/{h3-proximity-GwesPTFT.d.ts → h3-proximity-DJnghtir.d.ts} +0 -0
- /package/dist/{lerp-utils-CZgQlrmu.d.ts → lerp-utils-DNcSmKVX.d.ts} +0 -0
- /package/dist/{list-formatter-DKQQVLcl.d.ts → list-formatter-CsqcU4v5.d.ts} +0 -0
- /package/dist/{map-overlay-C9ifl_4-.d.ts → map-overlay-yrFsUtGv.d.ts} +0 -0
- /package/dist/{opfs-storage-Dlq1I_Gb.d.ts → opfs-storage-LsLY6VZV.d.ts} +0 -0
- /package/dist/{scene-node-names-DPsaE2z3.d.ts → scene-node-names-IHW7HR4S.d.ts} +0 -0
- /package/dist/{three-dispose-qt_r5wR1.d.ts → three-dispose-WTBAfaWU.d.ts} +0 -0
- /package/dist/{vis-colors-BKkdTIKb.d.ts → vis-colors-Djnyg_UH.d.ts} +0 -0
- /package/dist/{xr-camera-texture-BbukNE79.d.ts → xr-camera-texture-BU5YvKAM.d.ts} +0 -0
- /package/dist/{xr-error-handler-DTHfmvrl.d.ts → xr-error-handler-DcUFshNF.d.ts} +0 -0
- /package/dist/{zip-export-BjrQPv0X.d.ts → zip-export-C0_ErAqT.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as DepthSample } from "./ar-types-
|
|
2
|
-
import { s as RecordingOptions } from "./recording-options-
|
|
1
|
+
import { i as DepthSample } from "./ar-types-isPsQptb.js";
|
|
2
|
+
import { s as RecordingOptions } from "./recording-options-BSFpBSZH.js";
|
|
3
3
|
import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
|
|
4
4
|
|
|
5
5
|
//#region ../src/state/recording-slice.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
1
|
+
import { t as Css3dRendererManager } from "./css3d-renderer-manager-EDED3nvg.js";
|
|
2
|
+
import { t as CameraFollower } from "./camera-follower-B-nS1sr6.js";
|
|
3
|
+
import { t as AlignmentLerper } from "./alignment-lerper-CCZJf-Xb.js";
|
|
4
4
|
import * as THREE from "three";
|
|
5
5
|
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
|
6
6
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getGpsErrorMessage, i as createGpsErrorHandler, n as GPS_ERROR_MESSAGES, r as GPS_ERROR_MESSAGE_UNKNOWN, t as GPS_ERROR_CODES } from "../gps-error-handler-
|
|
1
|
+
import { a as getGpsErrorMessage, i as createGpsErrorHandler, n as GPS_ERROR_MESSAGES, r as GPS_ERROR_MESSAGE_UNKNOWN, t as GPS_ERROR_CODES } from "../gps-error-handler-BLDhUlw5.js";
|
|
2
2
|
export { GPS_ERROR_CODES, GPS_ERROR_MESSAGES, GPS_ERROR_MESSAGE_UNKNOWN, createGpsErrorHandler, getGpsErrorMessage };
|
package/dist/sensors/gps.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as startOrientationWatch, i as startGpsWatch, n as RawDeviceOrientation, o as stopGpsWatch, r as requestOrientationPermission, s as stopOrientationWatch, t as GpsPosition } from "../gps-
|
|
1
|
+
import { a as startOrientationWatch, i as startGpsWatch, n as RawDeviceOrientation, o as stopGpsWatch, r as requestOrientationPermission, s as stopOrientationWatch, t as GpsPosition } from "../gps-B7AlMPz5.js";
|
|
2
2
|
export { GpsPosition, RawDeviceOrientation, requestOrientationPermission, startGpsWatch, startOrientationWatch, stopGpsWatch, stopOrientationWatch };
|
package/dist/sensors/gps.js
CHANGED
package/dist/sensors/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as startOrientationWatch, i as startGpsWatch, n as RawDeviceOrientation, o as stopGpsWatch, r as requestOrientationPermission, s as stopOrientationWatch, t as GpsPosition } from "../gps-
|
|
2
|
-
import { a as
|
|
3
|
-
import { a as
|
|
1
|
+
import { a as startOrientationWatch, i as startGpsWatch, n as RawDeviceOrientation, o as stopGpsWatch, r as requestOrientationPermission, s as stopOrientationWatch, t as GpsPosition } from "../gps-B7AlMPz5.js";
|
|
2
|
+
import { a as checkCameraPermission, c as checkOrientationPermission, d as requestCameraPermission, f as requestGeolocationPermission, g as setFileSystemState, h as resetFileSystemState, i as checkAllPermissions, l as checkWebXRSupport, m as requestWebXRWithDepthPermission, n as PermissionStatus, o as checkFileSystemPermission, p as requestOrientationPermission$1, s as checkGeolocationPermission, t as PermissionCheckResult, u as requestAllPermissions } from "../permission-checker-CfV7INCa.js";
|
|
3
|
+
import { a as getGpsErrorMessage, i as createGpsErrorHandler, n as GPS_ERROR_MESSAGES, r as GPS_ERROR_MESSAGE_UNKNOWN, t as GPS_ERROR_CODES } from "../gps-error-handler-BLDhUlw5.js";
|
|
4
4
|
export { GPS_ERROR_CODES, GPS_ERROR_MESSAGES, GPS_ERROR_MESSAGE_UNKNOWN, type GpsPosition, type PermissionCheckResult, type PermissionStatus, type RawDeviceOrientation, checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, createGpsErrorHandler, getGpsErrorMessage, requestAllPermissions, requestCameraPermission, requestOrientationPermission as requestDeviceOrientationPermission, requestGeolocationPermission, requestOrientationPermission$1 as requestOrientationPermission, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState, startGpsWatch, startOrientationWatch, stopGpsWatch, stopOrientationWatch };
|
package/dist/sensors/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, requestAllPermissions, requestCameraPermission, requestGeolocationPermission, requestOrientationPermission as requestOrientationPermission$1, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState } from "./permission-checker.js";
|
|
1
2
|
import { requestOrientationPermission, startGpsWatch, startOrientationWatch, stopGpsWatch, stopOrientationWatch } from "./gps.js";
|
|
2
3
|
import { GPS_ERROR_CODES, GPS_ERROR_MESSAGES, GPS_ERROR_MESSAGE_UNKNOWN, createGpsErrorHandler, getGpsErrorMessage } from "./gps-error-handler.js";
|
|
3
|
-
import { checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, requestAllPermissions, requestCameraPermission, requestGeolocationPermission, requestOrientationPermission as requestOrientationPermission$1, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState } from "./permission-checker.js";
|
|
4
4
|
export { GPS_ERROR_CODES, GPS_ERROR_MESSAGES, GPS_ERROR_MESSAGE_UNKNOWN, checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, createGpsErrorHandler, getGpsErrorMessage, requestAllPermissions, requestCameraPermission, requestOrientationPermission as requestDeviceOrientationPermission, requestGeolocationPermission, requestOrientationPermission$1 as requestOrientationPermission, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState, startGpsWatch, startOrientationWatch, stopGpsWatch, stopOrientationWatch };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { PermissionCheckResult, PermissionStatus, checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, requestAllPermissions, requestCameraPermission, requestGeolocationPermission, requestOrientationPermission, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState };
|
|
1
|
+
import { _ as subscribePermissionChanges, a as checkCameraPermission, c as checkOrientationPermission, d as requestCameraPermission, f as requestGeolocationPermission, g as setFileSystemState, h as resetFileSystemState, i as checkAllPermissions, l as checkWebXRSupport, m as requestWebXRWithDepthPermission, n as PermissionStatus, o as checkFileSystemPermission, p as requestOrientationPermission, r as PermissionSubscription, s as checkGeolocationPermission, t as PermissionCheckResult, u as requestAllPermissions } from "../permission-checker-CfV7INCa.js";
|
|
2
|
+
export { PermissionCheckResult, PermissionStatus, PermissionSubscription, checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, requestAllPermissions, requestCameraPermission, requestGeolocationPermission, requestOrientationPermission, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState, subscribePermissionChanges };
|
|
@@ -321,6 +321,84 @@ async function checkAllPermissions() {
|
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
323
|
/**
|
|
324
|
+
* Subscribe to out-of-band permission changes.
|
|
325
|
+
*
|
|
326
|
+
* Today the recorder app only re-runs `checkAllPermissions()` at startup
|
|
327
|
+
* and after the user clicks "Grant Permissions" — so a permission flipped
|
|
328
|
+
* via browser settings (e.g. user denies location, then enables it under
|
|
329
|
+
* "site settings") is only detected after a full page reload.
|
|
330
|
+
*
|
|
331
|
+
* This subscription wires three signals:
|
|
332
|
+
* 1. `navigator.permissions.query(...)` returns a live `PermissionStatus`
|
|
333
|
+
* for `'geolocation'` and `'camera'`; we keep those references and
|
|
334
|
+
* attach a `'change'` listener via `addEventListener` so we react
|
|
335
|
+
* immediately when the browser updates the underlying state.
|
|
336
|
+
* 2. `document.visibilitychange` (only when `visibilityState === 'visible'`)
|
|
337
|
+
* covers the "user tabbed out to settings, toggled, tabbed back" case
|
|
338
|
+
* on browsers where the `'change'` event does not fire reliably.
|
|
339
|
+
* 3. `window.focus` covers the same scenario for browsers/standalone
|
|
340
|
+
* windows where `visibilitychange` is not dispatched on focus return.
|
|
341
|
+
*
|
|
342
|
+
* Each signal triggers a fresh {@link checkAllPermissions} call; the
|
|
343
|
+
* resulting {@link PermissionCheckResult} is passed to `callback`.
|
|
344
|
+
*
|
|
345
|
+
* No periodic polling is performed — the trio above is the complete
|
|
346
|
+
* fallback chain. If a browser supports none of these signals for a given
|
|
347
|
+
* permission, the user can still re-check by clicking the (now permanently
|
|
348
|
+
* visible) "Grant Permissions" button.
|
|
349
|
+
*
|
|
350
|
+
* @param callback - Invoked with the latest {@link PermissionCheckResult}
|
|
351
|
+
* each time one of the signals fires. The initial state is **not**
|
|
352
|
+
* delivered; callers are expected to have already rendered it.
|
|
353
|
+
* @returns A handle whose `unsubscribe()` removes every wired listener.
|
|
354
|
+
*/
|
|
355
|
+
function subscribePermissionChanges(callback) {
|
|
356
|
+
let disposed = false;
|
|
357
|
+
const cleanups = [];
|
|
358
|
+
const notify = () => {
|
|
359
|
+
if (disposed) return;
|
|
360
|
+
checkAllPermissions().then((result) => {
|
|
361
|
+
if (!disposed) callback(result);
|
|
362
|
+
}).catch((err) => {
|
|
363
|
+
log.warn("subscribePermissionChanges: re-check failed", err);
|
|
364
|
+
});
|
|
365
|
+
};
|
|
366
|
+
if (typeof navigator !== "undefined" && navigator.permissions && typeof navigator.permissions.query === "function") {
|
|
367
|
+
const wireStatus = (name) => {
|
|
368
|
+
try {
|
|
369
|
+
navigator.permissions.query({ name }).then((status) => {
|
|
370
|
+
if (disposed) return;
|
|
371
|
+
const handler = () => notify();
|
|
372
|
+
status.addEventListener("change", handler);
|
|
373
|
+
cleanups.push(() => status.removeEventListener("change", handler));
|
|
374
|
+
}, () => {});
|
|
375
|
+
} catch {}
|
|
376
|
+
};
|
|
377
|
+
wireStatus("geolocation");
|
|
378
|
+
wireStatus("camera");
|
|
379
|
+
}
|
|
380
|
+
if (typeof document !== "undefined") {
|
|
381
|
+
const onVisibility = () => {
|
|
382
|
+
if (document.visibilityState === "visible") notify();
|
|
383
|
+
};
|
|
384
|
+
document.addEventListener("visibilitychange", onVisibility);
|
|
385
|
+
cleanups.push(() => document.removeEventListener("visibilitychange", onVisibility));
|
|
386
|
+
}
|
|
387
|
+
if (typeof window !== "undefined") {
|
|
388
|
+
const onFocus = () => notify();
|
|
389
|
+
window.addEventListener("focus", onFocus);
|
|
390
|
+
cleanups.push(() => window.removeEventListener("focus", onFocus));
|
|
391
|
+
}
|
|
392
|
+
return { unsubscribe() {
|
|
393
|
+
disposed = true;
|
|
394
|
+
for (const c of cleanups.splice(0)) try {
|
|
395
|
+
c();
|
|
396
|
+
} catch (err) {
|
|
397
|
+
log.warn("subscribePermissionChanges: cleanup failed", err);
|
|
398
|
+
}
|
|
399
|
+
} };
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
324
402
|
* Request all mandatory permissions that haven't been granted yet.
|
|
325
403
|
* Shows browser prompts for each permission that needs requesting.
|
|
326
404
|
*
|
|
@@ -394,4 +472,4 @@ async function requestWebXRWithDepthPermission() {
|
|
|
394
472
|
}
|
|
395
473
|
}
|
|
396
474
|
//#endregion
|
|
397
|
-
export { checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, requestAllPermissions, requestCameraPermission, requestGeolocationPermission, requestOrientationPermission, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState };
|
|
475
|
+
export { checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, requestAllPermissions, requestCameraPermission, requestGeolocationPermission, requestOrientationPermission, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState, subscribePermissionChanges };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createLogger } from "./utils/logger.js";
|
|
2
|
+
//#region ../src/ar/session-disposers.ts
|
|
3
|
+
/**
|
|
4
|
+
* Session-scoped disposer registry. Components that allocate a resource tied to
|
|
5
|
+
* a single AR session — a store subscription, an event listener, a lerper —
|
|
6
|
+
* register a teardown function here; the WebXR session's `resetWebXRState()`
|
|
7
|
+
* flushes them on teardown so the resource never outlives the session it
|
|
8
|
+
* belonged to.
|
|
9
|
+
*
|
|
10
|
+
* This is a sibling of `frame-loop.ts` (also a `Set`-based registry) but serves
|
|
11
|
+
* a different need: `frame-loop` holds *per-frame ticks* invoked every frame and
|
|
12
|
+
* wiped by `clearFrameUpdates()`; this registry holds *one-shot teardown* run
|
|
13
|
+
* exactly once on session end. The split keeps each registry's contract crisp.
|
|
14
|
+
*
|
|
15
|
+
* Why it exists: `resetWebXRState()` already clears the frame-update registry,
|
|
16
|
+
* but resources like the store subscription opened by
|
|
17
|
+
* `enableArWorldGroupAlignment` are not per-frame ticks and had no teardown hook
|
|
18
|
+
* — so they leaked across sessions (a dangling subscriber pinning the old
|
|
19
|
+
* `arWorldGroup`). Because `initAR()` throws if a prior session is still live,
|
|
20
|
+
* every restart must pass through `resetWebXRState()`, making it the single
|
|
21
|
+
* chokepoint where flushing these disposers is guaranteed. See
|
|
22
|
+
* gps-plus-slam/GpsPlusSlamJs_Docs/docs/2026-06-08-arworldgroup-alignment-session-scoped-disposal.md.
|
|
23
|
+
*/
|
|
24
|
+
const log = createLogger("SessionDisposers");
|
|
25
|
+
const disposers = /* @__PURE__ */ new Set();
|
|
26
|
+
/**
|
|
27
|
+
* Register a session-scoped teardown function. Returns a deregister function
|
|
28
|
+
* (call it when the resource is disposed early, so a later flush won't re-run
|
|
29
|
+
* the teardown).
|
|
30
|
+
*/
|
|
31
|
+
function registerSessionDisposer(dispose) {
|
|
32
|
+
disposers.add(dispose);
|
|
33
|
+
return () => {
|
|
34
|
+
disposers.delete(dispose);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Run and drop every registered disposer. Called from `resetWebXRState()` on
|
|
39
|
+
* session teardown.
|
|
40
|
+
*
|
|
41
|
+
* The set is snapshotted and **cleared before** running, so (a) a second flush
|
|
42
|
+
* is a no-op rather than re-tearing-down an already-released resource, and (b) a
|
|
43
|
+
* disposer that re-registers during teardown cannot loop. Each disposer runs in
|
|
44
|
+
* its own `try/catch` so one throwing teardown cannot abort the rest — mirroring
|
|
45
|
+
* `runFrameUpdates`.
|
|
46
|
+
*/
|
|
47
|
+
function runSessionDisposers() {
|
|
48
|
+
const snapshot = Array.from(disposers);
|
|
49
|
+
disposers.clear();
|
|
50
|
+
for (const dispose of snapshot) try {
|
|
51
|
+
dispose();
|
|
52
|
+
} catch (error) {
|
|
53
|
+
log.error("A session disposer threw; continuing teardown", error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { runSessionDisposers as n, registerSessionDisposer as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { selectAlignmentMatrix, selectGpsPositions, selectOdometryPositions, selectOdometryRotations,
|
|
1
|
+
import { a as selectOdometryRotations, i as selectOdometryPositions, n as selectFrameTilesInWebXR, o as selectZeroReference, r as selectGpsPositions, t as selectAlignmentMatrix } from "../app-selectors-CR9OWodf.js";
|
|
2
|
+
export { selectAlignmentMatrix, selectFrameTilesInWebXR, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectZeroReference };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { nueQuaternionToWebXR, nueToWebXR } from "gps-plus-slam-js";
|
|
1
2
|
import { createSelector } from "@reduxjs/toolkit";
|
|
2
3
|
//#region ../src/state/app-selectors.ts
|
|
3
4
|
/**
|
|
@@ -17,7 +18,7 @@ import { createSelector } from "@reduxjs/toolkit";
|
|
|
17
18
|
const EMPTY_GPS_POSITIONS = [];
|
|
18
19
|
const EMPTY_ODOM_POSITIONS = [];
|
|
19
20
|
const EMPTY_ODOM_ROTATIONS = [];
|
|
20
|
-
const
|
|
21
|
+
const EMPTY_FRAME_TILES = [];
|
|
21
22
|
const selectGpsData = (state) => state.gpsData;
|
|
22
23
|
/** Alignment matrix (4×4), or null if not yet computed. */
|
|
23
24
|
const selectAlignmentMatrix = createSelector([selectGpsData], (gpsData) => gpsData?.gpsEvents?.alignmentMatrix ?? null);
|
|
@@ -30,6 +31,35 @@ const selectOdometryRotations = createSelector([selectGpsData], (gpsData) => gps
|
|
|
30
31
|
/** GPS zero reference (origin for coordinate conversion), or null. */
|
|
31
32
|
const selectZeroReference = createSelector([selectGpsData], (gpsData) => gpsData?.zero ?? null);
|
|
32
33
|
/** User-defined reference points for ground truth validation. */
|
|
33
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Captured AR image frames in WebXR coordinate space.
|
|
36
|
+
*
|
|
37
|
+
* Reads `state.gpsData.odometryPath.points` (which the library reducer
|
|
38
|
+
* stores in NUE convention — see `gpsDataSlice.ts` `add2dImage`) and
|
|
39
|
+
* converts each entry back to WebXR so the live AR scene visualizer can
|
|
40
|
+
* apply the pose directly. This is the source of truth for the
|
|
41
|
+
* frame-tile visualizer; the legacy `framesInScene` slice is a dead
|
|
42
|
+
* mirror scheduled for removal (Step 5 of the 2026-05-27
|
|
43
|
+
* slice-collapse plan).
|
|
44
|
+
*
|
|
45
|
+
* Memoized via createSelector keyed on `odometryPath.points` (NOT the whole
|
|
46
|
+
* `gpsData`). The library reducer uses Immer, so unrelated updates (GPS
|
|
47
|
+
* observations, VIO offsets) produce a new `gpsData` reference while
|
|
48
|
+
* `odometryPath.points` keeps its reference via structural sharing. Keying on
|
|
49
|
+
* the points array therefore preserves referential stability of the output
|
|
50
|
+
* across those dispatches — subscribers like `wireFrameTileSubscribers` only
|
|
51
|
+
* re-run when frames actually change.
|
|
52
|
+
*/
|
|
53
|
+
const selectOdometryPathPoints = (state) => state.gpsData?.odometryPath?.points;
|
|
54
|
+
const selectFrameTilesInWebXR = createSelector([selectOdometryPathPoints], (points) => {
|
|
55
|
+
if (!points || points.length === 0) return EMPTY_FRAME_TILES;
|
|
56
|
+
return points.map((p) => ({
|
|
57
|
+
imageFile: p.imageFile,
|
|
58
|
+
position: nueToWebXR(p.position),
|
|
59
|
+
rotation: nueQuaternionToWebXR(p.rotation),
|
|
60
|
+
screenRotation: p.screenRotation,
|
|
61
|
+
capturedAt: p.capturedAt
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
34
64
|
//#endregion
|
|
35
|
-
export { selectAlignmentMatrix, selectGpsPositions, selectOdometryPositions, selectOdometryRotations,
|
|
65
|
+
export { selectAlignmentMatrix, selectFrameTilesInWebXR, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectZeroReference };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SlamAppStoreOptions, i as SlamAppStore, n as SlamAppMiddleware, o as createSlamAppStore, r as SlamAppRootState, t as SlamAppCombinedState } from "../create-slam-app-store-
|
|
1
|
+
import { a as SlamAppStoreOptions, i as SlamAppStore, n as SlamAppMiddleware, o as createSlamAppStore, r as SlamAppRootState, t as SlamAppCombinedState } from "../create-slam-app-store-B76AGaI0.js";
|
|
2
2
|
export { SlamAppCombinedState, SlamAppMiddleware, SlamAppRootState, SlamAppStore, SlamAppStoreOptions, createSlamAppStore };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { trackingReducer } from "./tracking-slice.js";
|
|
2
|
+
import { recordWriteFailure, recordingReducer } from "./recording-slice.js";
|
|
3
|
+
import { createTrackingQualityListenerMiddleware, trackingQualityReducer } from "./tracking-quality.js";
|
|
4
|
+
import { createPersistenceMiddleware, slicePrefixOf } from "./persistence-middleware.js";
|
|
5
|
+
import { arElementsReducer, gpsDataReducer, gpsElementsReducer, sanitizeForDevTools, setZeroPos, validateLicenseKey } from "gps-plus-slam-js";
|
|
4
6
|
import { configureStore } from "@reduxjs/toolkit";
|
|
5
7
|
import { COMMUNITY_LICENSE_KEY } from "gps-plus-slam-js/community-license-key";
|
|
6
8
|
//#region ../src/state/create-slam-app-store.ts
|
|
@@ -22,27 +24,39 @@ import { COMMUNITY_LICENSE_KEY } from "gps-plus-slam-js/community-license-key";
|
|
|
22
24
|
* @see docs/2026-05-03-appframework-vs-recorderapp-boundary-analysis.md — Iter 1
|
|
23
25
|
*/
|
|
24
26
|
/**
|
|
27
|
+
* Slice prefixes the framework always persists, derived from the actual
|
|
28
|
+
* library / framework action creators (never hand-typed). A rename of the
|
|
29
|
+
* `gpsData` or `recording` slice therefore propagates here automatically
|
|
30
|
+
* instead of silently dropping that slice's actions from recordings.
|
|
31
|
+
*/
|
|
32
|
+
const BUILTIN_PERSISTED_PREFIXES = [slicePrefixOf(setZeroPos.type), slicePrefixOf(recordWriteFailure.type)];
|
|
33
|
+
/**
|
|
25
34
|
* Build a Redux store wired with library + recording slices, persistence
|
|
26
35
|
* middleware, and any caller-supplied extras. See module docstring for the
|
|
27
36
|
* design rationale.
|
|
28
37
|
*/
|
|
29
38
|
function createSlamAppStore(options) {
|
|
30
|
-
const { storageBackend, extraReducers, extraMiddleware, onWriteFailure, enableDevChecks = true, licenseKey = COMMUNITY_LICENSE_KEY } = options;
|
|
39
|
+
const { storageBackend, extraReducers, extraMiddleware, persistedExtraPrefixes, onWriteFailure, enableDevChecks = true, licenseKey = COMMUNITY_LICENSE_KEY, trackingQualityOptions } = options;
|
|
31
40
|
validateLicenseKey(licenseKey);
|
|
41
|
+
const reducer = {
|
|
42
|
+
gpsData: gpsDataReducer,
|
|
43
|
+
gpsElements: gpsElementsReducer,
|
|
44
|
+
arElements: arElementsReducer,
|
|
45
|
+
recording: recordingReducer,
|
|
46
|
+
tracking: trackingReducer,
|
|
47
|
+
trackingQuality: trackingQualityReducer,
|
|
48
|
+
...extraReducers ?? {}
|
|
49
|
+
};
|
|
50
|
+
const trackingQualityMiddleware = createTrackingQualityListenerMiddleware(trackingQualityOptions);
|
|
32
51
|
const store = configureStore({
|
|
33
|
-
reducer
|
|
34
|
-
gpsData: gpsDataReducer,
|
|
35
|
-
gpsElements: gpsElementsReducer,
|
|
36
|
-
arElements: arElementsReducer,
|
|
37
|
-
recording: recordingReducer,
|
|
38
|
-
...extraReducers ?? {}
|
|
39
|
-
},
|
|
52
|
+
reducer,
|
|
40
53
|
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
41
54
|
serializableCheck: enableDevChecks,
|
|
42
55
|
immutableCheck: enableDevChecks
|
|
43
|
-
}).concat(createPersistenceMiddleware({
|
|
56
|
+
}).prepend(trackingQualityMiddleware).concat(createPersistenceMiddleware({
|
|
44
57
|
storageBackend,
|
|
45
|
-
onWriteFailure
|
|
58
|
+
onWriteFailure,
|
|
59
|
+
persistedPrefixes: [...BUILTIN_PERSISTED_PREFIXES, ...persistedExtraPrefixes ?? []]
|
|
46
60
|
}), ...extraMiddleware ?? []),
|
|
47
61
|
devTools: {
|
|
48
62
|
actionSanitizer: sanitizeForDevTools,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ARPose } from "../ar-types-
|
|
2
|
-
import { o as extractOdomPosition, s as extractOdomRotation } from "../gps-event-coordinator-
|
|
3
|
-
import { i as captureGpsAnchorSample, n as GpsAnchorSample, r as GpsAnchorSampleGpsPoint, t as CaptureGpsAnchorSampleOptions } from "../gps-ar-pose-sampler-
|
|
1
|
+
import { t as ARPose } from "../ar-types-isPsQptb.js";
|
|
2
|
+
import { o as extractOdomPosition, s as extractOdomRotation } from "../gps-event-coordinator-BKVZbS1M.js";
|
|
3
|
+
import { i as captureGpsAnchorSample, n as GpsAnchorSample, r as GpsAnchorSampleGpsPoint, t as CaptureGpsAnchorSampleOptions } from "../gps-ar-pose-sampler-BypXZUqC.js";
|
|
4
4
|
export { ARPose, CaptureGpsAnchorSampleOptions, GpsAnchorSample, GpsAnchorSampleGpsPoint, captureGpsAnchorSample, extractOdomPosition, extractOdomRotation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as eulerToQuaternion, c as getLastDeviceOrientation, i as createGpsPositionHandler, l as resetCoordinatorState, n as buildRawGpsPoint, o as extractOdomPosition, r as buildRecordGpsEventPayload, s as extractOdomRotation, t as RecordingCoordinatorConfig, u as updateDeviceOrientation } from "../gps-event-coordinator-
|
|
1
|
+
import { a as eulerToQuaternion, c as getLastDeviceOrientation, i as createGpsPositionHandler, l as resetCoordinatorState, n as buildRawGpsPoint, o as extractOdomPosition, r as buildRecordGpsEventPayload, s as extractOdomRotation, t as RecordingCoordinatorConfig, u as updateDeviceOrientation } from "../gps-event-coordinator-BKVZbS1M.js";
|
|
2
2
|
export { RecordingCoordinatorConfig, buildRawGpsPoint, buildRecordGpsEventPayload, createGpsPositionHandler, eulerToQuaternion, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, resetCoordinatorState, updateDeviceOrientation };
|
package/dist/state/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { i as DepthSample, r as DepthPoint } from "../ar-types-
|
|
2
|
-
import { _ as validateRecordingOptions, a as IMAGE_CONSTRAINTS, c as RecordingOptionsInput, d as loadRecordingOptions, f as resetRecordingOptions, g as validateImageOptions, h as validateDepthOptions, i as DepthCaptureOptions, l as STORAGE_KEY, n as DEFAULT_RECORDING_OPTIONS, o as ImageCaptureOptions, p as saveRecordingOptions, r as DEPTH_CONSTRAINTS, u as cloneRecordingOptions } from "../recording-options-
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as SessionMetadata } from "../
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import { a as
|
|
8
|
-
import { i as
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
11
|
-
import {
|
|
12
|
-
import { n as
|
|
13
|
-
import { n as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
1
|
+
import { i as DepthSample, r as DepthPoint } from "../ar-types-isPsQptb.js";
|
|
2
|
+
import { _ as validateRecordingOptions, a as IMAGE_CONSTRAINTS, c as RecordingOptionsInput, d as loadRecordingOptions, f as resetRecordingOptions, g as validateImageOptions, h as validateDepthOptions, i as DepthCaptureOptions, l as STORAGE_KEY, n as DEFAULT_RECORDING_OPTIONS, o as ImageCaptureOptions, p as saveRecordingOptions, r as DEPTH_CONSTRAINTS, u as cloneRecordingOptions } from "../recording-options-BSFpBSZH.js";
|
|
3
|
+
import { a as TrackingSliceState, c as poseLost, d as selectLastRestartedPayload, f as selectLastSensorOrientation, g as trackingReducer, h as selectTrackingPhase, i as TrackingPhase, l as poseReceived, m as selectLostFrameCount, n as PoseReceivedPayload, o as clearLastRestartedPayload, p as selectLastValidPose, r as ResetTransformData, s as originReset, t as DeviceOrientation, u as resetTracking } from "../tracking-slice-CDREeoZ_.js";
|
|
4
|
+
import { a as recordWriteFailure, i as recordDepthSample, n as SessionMetadata$1, o as recordingReducer, r as endSession, s as startSession, t as RecordingState } from "../recording-slice-Cb888P6d.js";
|
|
5
|
+
import { n as SessionMetadata } from "../opfs-storage-LsLY6VZV.js";
|
|
6
|
+
import { n as StorageBackend } from "../storage-backend-yDSKafAQ.js";
|
|
7
|
+
import { A as resetTrackingQuality, C as computeResidualConsensus, D as firstAgreementReached, E as degradedCountUpdated, F as snapshotsTrimmed, I as trackingQualityReducer, M as selectRecentAlignments, N as selectTrackingQuality, O as matrixDelta, P as snapshotPushed, S as computeGpsVsFusedDivergence, T as createTrackingQualityListenerMiddleware, _ as TrackingQualityState, a as SlamAppStoreOptions, b as computeCoverage, d as DEFAULT_TRACKING_QUALITY_OPTIONS, g as TrackingQualitySliceState, h as TrackingQualityReport, i as SlamAppStore, j as selectFirstAgreementObservationIndex, k as reportUpdated, m as TrackingQualityOptions, n as SlamAppMiddleware, o as createSlamAppStore, r as SlamAppRootState, s as AlignmentSnapshot, t as SlamAppCombinedState, v as computeCompassAgreement, w as computeTrackingQualityReport, x as computeGpsAccuracy, y as computeConvergence } from "../create-slam-app-store-B76AGaI0.js";
|
|
8
|
+
import { a as eulerToQuaternion, c as getLastDeviceOrientation, i as createGpsPositionHandler, l as resetCoordinatorState, n as buildRawGpsPoint, o as extractOdomPosition, r as buildRecordGpsEventPayload, s as extractOdomRotation, t as RecordingCoordinatorConfig, u as updateDeviceOrientation } from "../gps-event-coordinator-BKVZbS1M.js";
|
|
9
|
+
import { i as captureGpsAnchorSample, n as GpsAnchorSample, r as GpsAnchorSampleGpsPoint, t as CaptureGpsAnchorSampleOptions } from "../gps-ar-pose-sampler-BypXZUqC.js";
|
|
10
|
+
import { n as replayRecording, t as ReplayRecordingOptions } from "../recording-replayer-CTL2cUE0.js";
|
|
11
|
+
import { n as createPersistenceMiddleware, r as slicePrefixOf, t as PersistenceMiddlewareOptions } from "../persistence-middleware-xB5sTllJ.js";
|
|
12
|
+
import { a as ReplayAction, c as computeInterActionDelay, i as ProgressCallback, l as extractActionTimestamp, n as DEFAULT_MAX_DELAY_MS, o as ReplayEngine, r as ErrorCallback, s as ReplayState, t as CompleteCallback } from "../replay-engine-B-5GIZtc.js";
|
|
13
|
+
import { n as subscribeToSelector, t as SubscribableStore } from "../subscribe-to-selector--KQpgLXG.js";
|
|
14
|
+
import { n as wireStoreSubscribers, t as StoreSubscriberDeps } from "../store-subscribers-swlbtg_z.js";
|
|
15
|
+
import { a as selectOdometryRotations, i as selectOdometryPositions, n as selectFrameTilesInWebXR, o as selectZeroReference, r as selectGpsPositions, t as selectAlignmentMatrix } from "../app-selectors-CR9OWodf.js";
|
|
16
|
+
import { a as RawGpsPoint, c as calcRelativeCoordsInMeters, d as OnboardingGuidance, f as OnboardingPhase, i as RawDeviceOrientation, l as recordGpsEvent, m as selectOnboardingGuidance, n as GpsPoint, o as RecordGpsEventPayload, p as computeOnboardingGuidance, r as LatLong, s as add2dImage, t as Add2dImagePayload, u as setZeroPos } from "../index-BB2KEWbN2.js";
|
|
17
|
+
export { Add2dImagePayload, AlignmentSnapshot, CaptureGpsAnchorSampleOptions, CompleteCallback, DEFAULT_MAX_DELAY_MS, DEFAULT_RECORDING_OPTIONS, DEFAULT_TRACKING_QUALITY_OPTIONS, DEPTH_CONSTRAINTS, DepthCaptureOptions, DepthPoint, DepthSample, DeviceOrientation, ErrorCallback, GpsAnchorSample, GpsAnchorSampleGpsPoint, GpsPoint, IMAGE_CONSTRAINTS, ImageCaptureOptions, LatLong, OnboardingGuidance, OnboardingPhase, SessionMetadata as OpfsSessionMetadata, PersistenceMiddlewareOptions, PoseReceivedPayload, ProgressCallback, RawDeviceOrientation, RawGpsPoint, RecordGpsEventPayload, RecordingCoordinatorConfig, RecordingOptionsInput, RecordingState, ReplayAction, ReplayEngine, ReplayRecordingOptions, ReplayState, ResetTransformData, STORAGE_KEY, SessionMetadata$1 as SessionMetadata, SlamAppCombinedState, SlamAppMiddleware, SlamAppRootState, SlamAppStore, SlamAppStoreOptions, StorageBackend, StoreSubscriberDeps, SubscribableStore, TrackingPhase, TrackingQualityOptions, TrackingQualityReport, TrackingQualitySliceState, TrackingQualityState, TrackingSliceState, add2dImage, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, captureGpsAnchorSample, clearLastRestartedPayload, cloneRecordingOptions, computeCompassAgreement, computeConvergence, computeCoverage, computeGpsAccuracy, computeGpsVsFusedDivergence, computeInterActionDelay, computeOnboardingGuidance, computeResidualConsensus, computeTrackingQualityReport, createGpsPositionHandler, createPersistenceMiddleware, createSlamAppStore, createTrackingQualityListenerMiddleware, degradedCountUpdated, endSession, eulerToQuaternion, extractActionTimestamp, extractOdomPosition, extractOdomRotation, firstAgreementReached, getLastDeviceOrientation, loadRecordingOptions, matrixDelta, originReset, poseLost, poseReceived, recordDepthSample, recordGpsEvent, recordWriteFailure, recordingReducer, replayRecording, reportUpdated, resetCoordinatorState, resetRecordingOptions, resetTracking, resetTrackingQuality, saveRecordingOptions, selectAlignmentMatrix, selectFirstAgreementObservationIndex, selectFrameTilesInWebXR, selectGpsPositions, selectLastRestartedPayload, selectLastSensorOrientation, selectLastValidPose, selectLostFrameCount, selectOdometryPositions, selectOdometryRotations, selectOnboardingGuidance, selectRecentAlignments, selectTrackingPhase, selectTrackingQuality, selectZeroReference, setZeroPos, slicePrefixOf, snapshotPushed, snapshotsTrimmed, startSession, subscribeToSelector, trackingQualityReducer, trackingReducer, updateDeviceOrientation, validateDepthOptions, validateImageOptions, validateRecordingOptions, wireStoreSubscribers };
|
package/dist/state/index.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { buildRawGpsPoint, buildRecordGpsEventPayload, createGpsPositionHandler, eulerToQuaternion, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, resetCoordinatorState, updateDeviceOrientation } from "./gps-event-coordinator.js";
|
|
2
|
+
import { clearLastRestartedPayload, originReset, poseLost, poseReceived, resetTracking, selectLastRestartedPayload, selectLastSensorOrientation, selectLastValidPose, selectLostFrameCount, selectTrackingPhase, trackingReducer } from "./tracking-slice.js";
|
|
2
3
|
import { DEFAULT_RECORDING_OPTIONS, DEPTH_CONSTRAINTS, IMAGE_CONSTRAINTS, STORAGE_KEY, cloneRecordingOptions, loadRecordingOptions, resetRecordingOptions, saveRecordingOptions, validateDepthOptions, validateImageOptions, validateRecordingOptions } from "./recording-options.js";
|
|
3
4
|
import { endSession, recordDepthSample, recordWriteFailure, recordingReducer, startSession } from "./recording-slice.js";
|
|
4
5
|
import { captureGpsAnchorSample } from "./gps-ar-pose-sampler.js";
|
|
5
|
-
import {
|
|
6
|
+
import { selectAlignmentMatrix, selectFrameTilesInWebXR, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectZeroReference } from "./app-selectors.js";
|
|
7
|
+
import { DEFAULT_TRACKING_QUALITY_OPTIONS, computeCompassAgreement, computeConvergence, computeCoverage, computeGpsAccuracy, computeGpsVsFusedDivergence, computeResidualConsensus, computeTrackingQualityReport, createTrackingQualityListenerMiddleware, degradedCountUpdated, firstAgreementReached, matrixDelta, reportUpdated, resetTrackingQuality, selectFirstAgreementObservationIndex, selectRecentAlignments, selectTrackingQuality, snapshotPushed, snapshotsTrimmed, trackingQualityReducer } from "./tracking-quality.js";
|
|
8
|
+
import { createPersistenceMiddleware, slicePrefixOf } from "./persistence-middleware.js";
|
|
6
9
|
import { createSlamAppStore } from "./create-slam-app-store.js";
|
|
7
10
|
import { replayRecording } from "./recording-replayer.js";
|
|
8
11
|
import { DEFAULT_MAX_DELAY_MS, ReplayEngine, computeInterActionDelay, extractActionTimestamp } from "./replay-engine.js";
|
|
9
12
|
import { subscribeToSelector } from "./subscribe-to-selector.js";
|
|
10
|
-
import { selectAlignmentMatrix, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectReferencePoints, selectZeroReference } from "./app-selectors.js";
|
|
11
13
|
import { wireStoreSubscribers } from "./store-subscribers.js";
|
|
12
|
-
import {
|
|
13
|
-
export { DEFAULT_MAX_DELAY_MS, DEFAULT_RECORDING_OPTIONS, DEPTH_CONSTRAINTS, IMAGE_CONSTRAINTS, ReplayEngine, STORAGE_KEY, add2dImage, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, captureGpsAnchorSample, cloneRecordingOptions, computeInterActionDelay, createGpsPositionHandler, createPersistenceMiddleware, createSlamAppStore, endSession, eulerToQuaternion, extractActionTimestamp, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, loadRecordingOptions,
|
|
14
|
+
import { a as computeOnboardingGuidance, i as setZeroPos, n as calcRelativeCoordsInMeters, o as selectOnboardingGuidance, r as recordGpsEvent, t as add2dImage } from "../state-BkIfpiyA.js";
|
|
15
|
+
export { DEFAULT_MAX_DELAY_MS, DEFAULT_RECORDING_OPTIONS, DEFAULT_TRACKING_QUALITY_OPTIONS, DEPTH_CONSTRAINTS, IMAGE_CONSTRAINTS, ReplayEngine, STORAGE_KEY, add2dImage, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, captureGpsAnchorSample, clearLastRestartedPayload, cloneRecordingOptions, computeCompassAgreement, computeConvergence, computeCoverage, computeGpsAccuracy, computeGpsVsFusedDivergence, computeInterActionDelay, computeOnboardingGuidance, computeResidualConsensus, computeTrackingQualityReport, createGpsPositionHandler, createPersistenceMiddleware, createSlamAppStore, createTrackingQualityListenerMiddleware, degradedCountUpdated, endSession, eulerToQuaternion, extractActionTimestamp, extractOdomPosition, extractOdomRotation, firstAgreementReached, getLastDeviceOrientation, loadRecordingOptions, matrixDelta, originReset, poseLost, poseReceived, recordDepthSample, recordGpsEvent, recordWriteFailure, recordingReducer, replayRecording, reportUpdated, resetCoordinatorState, resetRecordingOptions, resetTracking, resetTrackingQuality, saveRecordingOptions, selectAlignmentMatrix, selectFirstAgreementObservationIndex, selectFrameTilesInWebXR, selectGpsPositions, selectLastRestartedPayload, selectLastSensorOrientation, selectLastValidPose, selectLostFrameCount, selectOdometryPositions, selectOdometryRotations, selectOnboardingGuidance, selectRecentAlignments, selectTrackingPhase, selectTrackingQuality, selectZeroReference, setZeroPos, slicePrefixOf, snapshotPushed, snapshotsTrimmed, startSession, subscribeToSelector, trackingQualityReducer, trackingReducer, updateDeviceOrientation, validateDepthOptions, validateImageOptions, validateRecordingOptions, wireStoreSubscribers };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createPersistenceMiddleware, t as PersistenceMiddlewareOptions } from "../persistence-middleware-
|
|
2
|
-
export { PersistenceMiddlewareOptions, createPersistenceMiddleware };
|
|
1
|
+
import { n as createPersistenceMiddleware, r as slicePrefixOf, t as PersistenceMiddlewareOptions } from "../persistence-middleware-xB5sTllJ.js";
|
|
2
|
+
export { PersistenceMiddlewareOptions, createPersistenceMiddleware, slicePrefixOf };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger.js";
|
|
2
|
-
import { recordWriteFailure } from "./recording-slice.js";
|
|
2
|
+
import { endSession, recordWriteFailure, startSession } from "./recording-slice.js";
|
|
3
3
|
//#region ../src/state/persistence-middleware.ts
|
|
4
4
|
const log = createLogger("PersistenceMiddleware");
|
|
5
5
|
/** Maximum number of concurrent OPFS write operations. */
|
|
@@ -27,31 +27,65 @@ var WriteQueue = class {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
|
+
* Extract the slice prefix from a namespaced Redux action type.
|
|
31
|
+
*
|
|
32
|
+
* `'gpsData/setZeroPos'` → `'gpsData'`. Returns the whole string when there
|
|
33
|
+
* is no slash (e.g. `'@@INIT'`). This is the single point that turns a
|
|
34
|
+
* slice-owned action type into the value the persistence whitelist matches
|
|
35
|
+
* on, so call sites can derive prefixes from real action creators instead of
|
|
36
|
+
* re-typing literals.
|
|
37
|
+
*/
|
|
38
|
+
function slicePrefixOf(actionType) {
|
|
39
|
+
const slashIndex = actionType.indexOf("/");
|
|
40
|
+
return slashIndex === -1 ? actionType : actionType.slice(0, slashIndex);
|
|
41
|
+
}
|
|
42
|
+
/** Read `state.recording.isRecording`, defaulting to false for any shape. */
|
|
43
|
+
function readIsRecording(state) {
|
|
44
|
+
return state?.recording?.isRecording ?? false;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Decide whether the just-reduced action belongs to a session whose actions
|
|
48
|
+
* must be persisted. True while recording, and also for the `endSession`
|
|
49
|
+
* action that just flipped `isRecording` to false (Issue 5) so the session's
|
|
50
|
+
* final action is still captured.
|
|
51
|
+
*
|
|
52
|
+
* The endSession type is derived from the imported action creator
|
|
53
|
+
* (`endSession.type`) rather than a hand-typed literal, so a rename of the
|
|
54
|
+
* recording slice or its actions propagates here automatically instead of
|
|
55
|
+
* silently breaking final-action persistence.
|
|
56
|
+
*/
|
|
57
|
+
function isInPersistableSession(wasRecording, isRecording, actionType) {
|
|
58
|
+
const isEndSession = actionType === endSession.type;
|
|
59
|
+
return isRecording || wasRecording && isEndSession;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
30
62
|
* Create a Redux middleware that persists qualifying actions to storage
|
|
31
63
|
* during active recording sessions.
|
|
32
64
|
*
|
|
33
65
|
* Persistence rules:
|
|
34
66
|
* - Only persists when `state.recording.isRecording` is true (checked AFTER
|
|
35
67
|
* the action is reduced, so `startSession` itself is included).
|
|
36
|
-
* - Persists
|
|
68
|
+
* - Persists actions whose slice prefix is listed in `persistedPrefixes`.
|
|
37
69
|
* - Excludes `recording/recordWriteFailure` to prevent recursive persistence.
|
|
38
|
-
* - Excludes `routing
|
|
70
|
+
* - Excludes `routing/*` and any other non-whitelisted actions.
|
|
39
71
|
* - Uses 1-based indexing for action files (000001.json, 000002.json, …).
|
|
40
72
|
* - Each middleware instance maintains its own action index (Bug 10 fix).
|
|
41
73
|
*/
|
|
42
74
|
function createPersistenceMiddleware(options) {
|
|
43
|
-
const { storageBackend, onWriteFailure } = options;
|
|
75
|
+
const { storageBackend, onWriteFailure, persistedPrefixes } = options;
|
|
76
|
+
const normalizedPrefixes = persistedPrefixes.map((prefix) => prefix.endsWith("/") ? prefix : `${prefix}/`);
|
|
77
|
+
const excludedActionType = recordWriteFailure.type;
|
|
44
78
|
let actionIndex = 0;
|
|
45
79
|
const writeQueue = new WriteQueue();
|
|
46
80
|
const middleware = (store) => (next) => (action) => {
|
|
47
81
|
const typedAction = action;
|
|
48
82
|
const actionType = typeof typedAction.type === "string" ? typedAction.type : null;
|
|
49
|
-
const wasRecording = store.getState()
|
|
83
|
+
const wasRecording = readIsRecording(store.getState());
|
|
50
84
|
const result = next(action);
|
|
51
85
|
if (!actionType) return result;
|
|
52
|
-
if (actionType ===
|
|
53
|
-
if (!((store.getState()
|
|
54
|
-
if (!(actionType.
|
|
86
|
+
if (actionType === startSession.type) actionIndex = 0;
|
|
87
|
+
if (!isInPersistableSession(wasRecording, readIsRecording(store.getState()), actionType)) return result;
|
|
88
|
+
if (!(actionType !== excludedActionType && normalizedPrefixes.some((prefix) => actionType.startsWith(prefix)))) return result;
|
|
55
89
|
const index = ++actionIndex;
|
|
56
90
|
writeQueue.enqueue(async () => {
|
|
57
91
|
try {
|
|
@@ -68,4 +102,4 @@ function createPersistenceMiddleware(options) {
|
|
|
68
102
|
return middleware;
|
|
69
103
|
}
|
|
70
104
|
//#endregion
|
|
71
|
-
export { createPersistenceMiddleware };
|
|
105
|
+
export { createPersistenceMiddleware, slicePrefixOf };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as validateRecordingOptions, a as IMAGE_CONSTRAINTS, c as RecordingOptionsInput, d as loadRecordingOptions, f as resetRecordingOptions, g as validateImageOptions, h as validateDepthOptions, i as DepthCaptureOptions, l as STORAGE_KEY, m as validateArCrashIsolationOptions, n as DEFAULT_RECORDING_OPTIONS, o as ImageCaptureOptions, p as saveRecordingOptions, r as DEPTH_CONSTRAINTS, s as RecordingOptions, t as ArCrashIsolationOptions, u as cloneRecordingOptions } from "../recording-options-
|
|
1
|
+
import { _ as validateRecordingOptions, a as IMAGE_CONSTRAINTS, c as RecordingOptionsInput, d as loadRecordingOptions, f as resetRecordingOptions, g as validateImageOptions, h as validateDepthOptions, i as DepthCaptureOptions, l as STORAGE_KEY, m as validateArCrashIsolationOptions, n as DEFAULT_RECORDING_OPTIONS, o as ImageCaptureOptions, p as saveRecordingOptions, r as DEPTH_CONSTRAINTS, s as RecordingOptions, t as ArCrashIsolationOptions, u as cloneRecordingOptions } from "../recording-options-BSFpBSZH.js";
|
|
2
2
|
export { ArCrashIsolationOptions, DEFAULT_RECORDING_OPTIONS, DEPTH_CONSTRAINTS, DepthCaptureOptions, IMAGE_CONSTRAINTS, ImageCaptureOptions, RecordingOptions, RecordingOptionsInput, STORAGE_KEY, cloneRecordingOptions, loadRecordingOptions, resetRecordingOptions, saveRecordingOptions, validateArCrashIsolationOptions, validateDepthOptions, validateImageOptions, validateRecordingOptions };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as replayRecording, t as ReplayRecordingOptions } from "../recording-replayer-
|
|
1
|
+
import { L as CombinedRootState } from "../create-slam-app-store-B76AGaI0.js";
|
|
2
|
+
import { n as replayRecording, t as ReplayRecordingOptions } from "../recording-replayer-CTL2cUE0.js";
|
|
3
3
|
export { CombinedRootState, ReplayRecordingOptions, replayRecording };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as recordWriteFailure, i as recordDepthSample, n as SessionMetadata, o as recordingReducer, r as endSession, s as startSession, t as RecordingState } from "../recording-slice-
|
|
1
|
+
import { a as recordWriteFailure, i as recordDepthSample, n as SessionMetadata, o as recordingReducer, r as endSession, s as startSession, t as RecordingState } from "../recording-slice-Cb888P6d.js";
|
|
2
2
|
export { RecordingState, SessionMetadata, endSession, recordDepthSample, recordWriteFailure, recordingReducer, startSession };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ReplayAction, c as computeInterActionDelay, i as ProgressCallback, l as extractActionTimestamp, n as DEFAULT_MAX_DELAY_MS, o as ReplayEngine, r as ErrorCallback, s as ReplayState, t as CompleteCallback } from "../replay-engine-
|
|
1
|
+
import { a as ReplayAction, c as computeInterActionDelay, i as ProgressCallback, l as extractActionTimestamp, n as DEFAULT_MAX_DELAY_MS, o as ReplayEngine, r as ErrorCallback, s as ReplayState, t as CompleteCallback } from "../replay-engine-B-5GIZtc.js";
|
|
2
2
|
export { CompleteCallback, DEFAULT_MAX_DELAY_MS, ErrorCallback, ProgressCallback, ReplayAction, ReplayEngine, ReplayState, computeInterActionDelay, extractActionTimestamp };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as SubscribableStore } from "../subscribe-to-selector
|
|
2
|
-
import { n as wireStoreSubscribers, t as StoreSubscriberDeps } from "../store-subscribers-
|
|
1
|
+
import { t as SubscribableStore } from "../subscribe-to-selector--KQpgLXG.js";
|
|
2
|
+
import { n as wireStoreSubscribers, t as StoreSubscriberDeps } from "../store-subscribers-swlbtg_z.js";
|
|
3
3
|
export { StoreSubscriberDeps, SubscribableStore, wireStoreSubscribers };
|