@glassly/engine 0.1.0-dev.99 → 0.2.8-dev.445
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 +28 -0
- package/build/engine.d.ts +32 -10
- package/build/engine.d.ts.map +1 -1
- package/build/engine.js +24 -16
- package/build/engine.js.map +1 -1
- package/build/facades/dev.d.ts +9 -0
- package/build/facades/dev.d.ts.map +1 -1
- package/build/facades/dev.js +9 -0
- package/build/facades/dev.js.map +1 -1
- package/build/facades/display.d.ts +10 -3
- package/build/facades/display.d.ts.map +1 -1
- package/build/facades/display.js +22 -8
- package/build/facades/display.js.map +1 -1
- package/build/facades/displayMirror.d.ts +11 -0
- package/build/facades/displayMirror.d.ts.map +1 -1
- package/build/facades/displayMirror.js +22 -0
- package/build/facades/displayMirror.js.map +1 -1
- package/build/facades/glasses.d.ts +31 -1
- package/build/facades/glasses.d.ts.map +1 -1
- package/build/facades/glasses.js +51 -0
- package/build/facades/glasses.js.map +1 -1
- package/build/facades/memory.d.ts +0 -6
- package/build/facades/memory.d.ts.map +1 -1
- package/build/facades/memory.js +1 -9
- package/build/facades/memory.js.map +1 -1
- package/build/facades/miniapps.d.ts +3 -1
- package/build/facades/miniapps.d.ts.map +1 -1
- package/build/facades/miniapps.js +3 -1
- package/build/facades/miniapps.js.map +1 -1
- package/build/facades/pairing.d.ts.map +1 -1
- package/build/facades/pairing.js +5 -4
- package/build/facades/pairing.js.map +1 -1
- package/build/facades/permissions.d.ts +2 -0
- package/build/facades/permissions.d.ts.map +1 -1
- package/build/facades/permissions.js +48 -0
- package/build/facades/permissions.js.map +1 -1
- package/build/facades/phoneNotifications.d.ts +20 -9
- package/build/facades/phoneNotifications.d.ts.map +1 -1
- package/build/facades/phoneNotifications.js +33 -26
- package/build/facades/phoneNotifications.js.map +1 -1
- package/build/facades/settings.d.ts.map +1 -1
- package/build/facades/settings.js +1 -2
- package/build/facades/settings.js.map +1 -1
- package/build/generated/releaseMetadata.js +4 -4
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +6 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -4
- package/build/index.js.map +1 -1
- package/build/react/MentraLiveOtaFlow.js +2 -2
- package/build/react/MentraLiveOtaFlow.js.map +1 -1
- package/build/react/useMentraLiveOta.d.ts.map +1 -1
- package/build/react/useMentraLiveOta.js +8 -7
- package/build/react/useMentraLiveOta.js.map +1 -1
- package/build/runtime/config.d.ts +1 -1
- package/build/runtime/config.d.ts.map +1 -1
- package/build/runtime/config.js.map +1 -1
- package/build/services/AppRegistry.d.ts +4 -1
- package/build/services/AppRegistry.d.ts.map +1 -1
- package/build/services/AppRegistry.js +21 -1
- package/build/services/AppRegistry.js.map +1 -1
- package/build/services/BlobStore.d.ts +2 -2
- package/build/services/BlobStore.js +3 -3
- package/build/services/BlobStore.js.map +1 -1
- package/build/services/CloudClientService.d.ts +7 -3
- package/build/services/CloudClientService.d.ts.map +1 -1
- package/build/services/CloudClientService.js +34 -9
- package/build/services/CloudClientService.js.map +1 -1
- package/build/services/DevServerBridge.d.ts +1 -18
- package/build/services/DevServerBridge.d.ts.map +1 -1
- package/build/services/DevServerBridge.js +9 -8
- package/build/services/DevServerBridge.js.map +1 -1
- package/build/services/DeviceEventRouter.d.ts.map +1 -1
- package/build/services/DeviceEventRouter.js +58 -71
- package/build/services/DeviceEventRouter.js.map +1 -1
- package/build/services/DisplayDiagnostics.d.ts +5 -0
- package/build/services/DisplayDiagnostics.d.ts.map +1 -0
- package/build/services/DisplayDiagnostics.js +105 -0
- package/build/services/DisplayDiagnostics.js.map +1 -0
- package/build/services/DisplayProcessor.d.ts +6 -7
- package/build/services/DisplayProcessor.d.ts.map +1 -1
- package/build/services/DisplayProcessor.js +17 -45
- package/build/services/DisplayProcessor.js.map +1 -1
- package/build/services/GestureDotsService.d.ts +10 -4
- package/build/services/GestureDotsService.d.ts.map +1 -1
- package/build/services/GestureDotsService.js +70 -16
- package/build/services/GestureDotsService.js.map +1 -1
- package/build/services/GlassesKeyboardInput.d.ts +77 -0
- package/build/services/GlassesKeyboardInput.d.ts.map +1 -0
- package/build/services/GlassesKeyboardInput.js +261 -0
- package/build/services/GlassesKeyboardInput.js.map +1 -0
- package/build/services/GlassesSensorService.d.ts +47 -0
- package/build/services/GlassesSensorService.d.ts.map +1 -0
- package/build/services/GlassesSensorService.js +242 -0
- package/build/services/GlassesSensorService.js.map +1 -0
- package/build/services/GlassesTouchInput.d.ts +14 -0
- package/build/services/GlassesTouchInput.d.ts.map +1 -0
- package/build/services/GlassesTouchInput.js +107 -0
- package/build/services/GlassesTouchInput.js.map +1 -0
- package/build/services/HeadingService.d.ts +0 -6
- package/build/services/HeadingService.d.ts.map +1 -1
- package/build/services/HeadingService.js +0 -27
- package/build/services/HeadingService.js.map +1 -1
- package/build/services/HotspotShutdown.d.ts.map +1 -1
- package/build/services/HotspotShutdown.js +2 -1
- package/build/services/HotspotShutdown.js.map +1 -1
- package/build/services/JSCrashloopReportService.js +2 -2
- package/build/services/JSCrashloopReportService.js.map +1 -1
- package/build/services/JSRouter.d.ts +6 -4
- package/build/services/JSRouter.d.ts.map +1 -1
- package/build/services/JSRouter.js +15 -13
- package/build/services/JSRouter.js.map +1 -1
- package/build/services/LocalDisplayManager.d.ts +35 -7
- package/build/services/LocalDisplayManager.d.ts.map +1 -1
- package/build/services/LocalDisplayManager.js +105 -27
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/LocalMiniappDataMigration.d.ts +1 -1
- package/build/services/LocalMiniappDataMigration.js +1 -1
- package/build/services/LocalMiniappDataMigration.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +64 -11
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +441 -35
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/LocalSttFallbackCoordinator.d.ts +3 -0
- package/build/services/LocalSttFallbackCoordinator.d.ts.map +1 -1
- package/build/services/LocalSttFallbackCoordinator.js +27 -8
- package/build/services/LocalSttFallbackCoordinator.js.map +1 -1
- package/build/services/MemoryStore.d.ts +8 -33
- package/build/services/MemoryStore.d.ts.map +1 -1
- package/build/services/MemoryStore.js +30 -56
- package/build/services/MemoryStore.js.map +1 -1
- package/build/services/MiniappEngine.d.ts +3 -3
- package/build/services/MiniappEngine.js +7 -7
- package/build/services/MiniappEngine.js.map +1 -1
- package/build/services/MiniappLauncher.d.ts +8 -0
- package/build/services/MiniappLauncher.d.ts.map +1 -1
- package/build/services/MiniappLauncher.js +19 -1
- package/build/services/MiniappLauncher.js.map +1 -1
- package/build/services/MirrorService.d.ts +24 -0
- package/build/services/MirrorService.d.ts.map +1 -0
- package/build/services/MirrorService.js +132 -0
- package/build/services/MirrorService.js.map +1 -0
- package/build/services/NativeNavigationService.d.ts +2 -3
- package/build/services/NativeNavigationService.d.ts.map +1 -1
- package/build/services/NativeNavigationService.js +24 -21
- package/build/services/NativeNavigationService.js.map +1 -1
- package/build/services/NavigationHandlers.d.ts.map +1 -1
- package/build/services/NavigationHandlers.js +10 -5
- package/build/services/NavigationHandlers.js.map +1 -1
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
- package/build/services/OtaInstallCoordinator.js +24 -23
- package/build/services/OtaInstallCoordinator.js.map +1 -1
- package/build/services/PairedGlassesLatch.d.ts +7 -0
- package/build/services/PairedGlassesLatch.d.ts.map +1 -0
- package/build/services/PairedGlassesLatch.js +38 -0
- package/build/services/PairedGlassesLatch.js.map +1 -0
- package/build/services/PhoneActivity.d.ts +23 -0
- package/build/services/PhoneActivity.d.ts.map +1 -0
- package/build/services/PhoneActivity.js +111 -0
- package/build/services/PhoneActivity.js.map +1 -0
- package/build/services/PhoneCameraFovCoordinator.d.ts.map +1 -1
- package/build/services/PhoneCameraFovCoordinator.js +4 -3
- package/build/services/PhoneCameraFovCoordinator.js.map +1 -1
- package/build/services/PhoneNotificationsSync.d.ts +40 -6
- package/build/services/PhoneNotificationsSync.d.ts.map +1 -1
- package/build/services/PhoneNotificationsSync.js +160 -84
- package/build/services/PhoneNotificationsSync.js.map +1 -1
- package/build/services/PhonePhotoCoordinator.d.ts.map +1 -1
- package/build/services/PhonePhotoCoordinator.js +6 -5
- package/build/services/PhonePhotoCoordinator.js.map +1 -1
- package/build/services/PhoneStreamCoordinator.d.ts.map +1 -1
- package/build/services/PhoneStreamCoordinator.js +8 -7
- package/build/services/PhoneStreamCoordinator.js.map +1 -1
- package/build/services/STTModelManager.d.ts +3 -0
- package/build/services/STTModelManager.d.ts.map +1 -1
- package/build/services/STTModelManager.js +15 -1
- package/build/services/STTModelManager.js.map +1 -1
- package/build/services/SceneRenderer.d.ts +43 -2
- package/build/services/SceneRenderer.d.ts.map +1 -1
- package/build/services/SceneRenderer.js +123 -8
- package/build/services/SceneRenderer.js.map +1 -1
- package/build/services/StreamLifecycleController.d.ts.map +1 -1
- package/build/services/StreamLifecycleController.js +6 -14
- package/build/services/StreamLifecycleController.js.map +1 -1
- package/build/services/TTSModelManager.js +1 -1
- package/build/services/TTSModelManager.js.map +1 -1
- package/build/services/UIRouter.d.ts +2 -2
- package/build/services/UIRouter.js +5 -5
- package/build/services/UIRouter.js.map +1 -1
- package/build/services/asg/galleryPathMigration.js +1 -1
- package/build/services/asg/galleryPathMigration.js.map +1 -1
- package/build/services/asg/gallerySyncService.js +2 -2
- package/build/services/asg/gallerySyncService.js.map +1 -1
- package/build/services/asg/localStorageService.d.ts.map +1 -1
- package/build/services/asg/localStorageService.js +3 -3
- package/build/services/asg/localStorageService.js.map +1 -1
- package/build/services/debug/DashboardOpenTrace.d.ts +32 -0
- package/build/services/debug/DashboardOpenTrace.d.ts.map +1 -0
- package/build/services/debug/DashboardOpenTrace.js +128 -0
- package/build/services/debug/DashboardOpenTrace.js.map +1 -0
- package/build/services/debug/dashboardOpenTimeline.d.ts +77 -0
- package/build/services/debug/dashboardOpenTimeline.d.ts.map +1 -0
- package/build/services/debug/dashboardOpenTimeline.js +195 -0
- package/build/services/debug/dashboardOpenTimeline.js.map +1 -0
- package/build/services/effectiveCapabilities.d.ts.map +1 -1
- package/build/services/effectiveCapabilities.js +25 -13
- package/build/services/effectiveCapabilities.js.map +1 -1
- package/build/services/gestureClaims.d.ts +34 -15
- package/build/services/gestureClaims.d.ts.map +1 -1
- package/build/services/gestureClaims.js +42 -21
- package/build/services/gestureClaims.js.map +1 -1
- package/build/services/manifestFields.d.ts +9 -0
- package/build/services/manifestFields.d.ts.map +1 -0
- package/build/services/manifestFields.js +26 -0
- package/build/services/manifestFields.js.map +1 -0
- package/build/services/memoryStoreInstance.d.ts +0 -10
- package/build/services/memoryStoreInstance.d.ts.map +1 -1
- package/build/services/memoryStoreInstance.js +2 -31
- package/build/services/memoryStoreInstance.js.map +1 -1
- package/build/services/mirrorSnapshot.d.ts +16 -0
- package/build/services/mirrorSnapshot.d.ts.map +1 -0
- package/build/services/mirrorSnapshot.js +102 -0
- package/build/services/mirrorSnapshot.js.map +1 -0
- package/build/services/nativeNavigationGate.d.ts +8 -0
- package/build/services/nativeNavigationGate.d.ts.map +1 -0
- package/build/services/nativeNavigationGate.js +12 -0
- package/build/services/nativeNavigationGate.js.map +1 -0
- package/build/services/notificationAppCatalog.d.ts +7 -0
- package/build/services/notificationAppCatalog.d.ts.map +1 -0
- package/build/services/notificationAppCatalog.js +16 -0
- package/build/services/notificationAppCatalog.js.map +1 -0
- package/build/services/notifications/notificationPolicy.d.ts +55 -0
- package/build/services/notifications/notificationPolicy.d.ts.map +1 -0
- package/build/services/notifications/notificationPolicy.js +41 -0
- package/build/services/notifications/notificationPolicy.js.map +1 -0
- package/build/services/pages/OverlayPages.d.ts +26 -0
- package/build/services/pages/OverlayPages.d.ts.map +1 -0
- package/build/services/pages/OverlayPages.js +80 -0
- package/build/services/pages/OverlayPages.js.map +1 -0
- package/build/services/pages/PageHost.d.ts +32 -0
- package/build/services/pages/PageHost.d.ts.map +1 -0
- package/build/services/pages/PageHost.js +99 -0
- package/build/services/pages/PageHost.js.map +1 -0
- package/build/services/pages/overlayApps.d.ts +25 -0
- package/build/services/pages/overlayApps.d.ts.map +1 -0
- package/build/services/pages/overlayApps.js +66 -0
- package/build/services/pages/overlayApps.js.map +1 -0
- package/build/services/pages/pageEligibility.d.ts +9 -0
- package/build/services/pages/pageEligibility.d.ts.map +1 -0
- package/build/services/pages/pageEligibility.js +27 -0
- package/build/services/pages/pageEligibility.js.map +1 -0
- package/build/services/settingsBridge.d.ts +58 -0
- package/build/services/settingsBridge.d.ts.map +1 -0
- package/build/services/settingsBridge.js +90 -0
- package/build/services/settingsBridge.js.map +1 -0
- package/build/services/speakerProfileStoreInstance.js +1 -1
- package/build/services/speakerProfileStoreInstance.js.map +1 -1
- package/build/services/uiShim.d.ts +1 -1
- package/build/services/uiShim.js +4 -4
- package/build/services/uiShim.js.map +1 -1
- package/build/stores/appVisibility.d.ts +28 -0
- package/build/stores/appVisibility.d.ts.map +1 -1
- package/build/stores/appVisibility.js +34 -0
- package/build/stores/appVisibility.js.map +1 -1
- package/build/stores/apps.d.ts +13 -0
- package/build/stores/apps.d.ts.map +1 -1
- package/build/stores/apps.js +66 -12
- package/build/stores/apps.js.map +1 -1
- package/build/stores/bluetoothSettingKeys.js +1 -1
- package/build/stores/bluetoothSettingKeys.js.map +1 -1
- package/build/stores/display.d.ts +3 -3
- package/build/stores/display.d.ts.map +1 -1
- package/build/stores/display.js +16 -4
- package/build/stores/display.js.map +1 -1
- package/build/stores/glasses.d.ts.map +1 -1
- package/build/stores/glasses.js +14 -1
- package/build/stores/glasses.js.map +1 -1
- package/build/stores/settings.d.ts +1 -0
- package/build/stores/settings.d.ts.map +1 -1
- package/build/stores/settings.js +170 -44
- package/build/stores/settings.js.map +1 -1
- package/build/types/applet.d.ts +14 -1
- package/build/types/applet.d.ts.map +1 -1
- package/build/types/applet.js.map +1 -1
- package/build/types/capabilities/even-realities-g2.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g2.js +5 -0
- package/build/types/capabilities/even-realities-g2.js.map +1 -1
- package/build/types/capabilities/simulated-glasses.d.ts +1 -1
- package/build/types/capabilities/simulated-glasses.d.ts.map +1 -1
- package/build/types/capabilities/simulated-glasses.js +7 -4
- package/build/types/capabilities/simulated-glasses.js.map +1 -1
- package/build/types/hardware.d.ts +20 -1
- package/build/types/hardware.d.ts.map +1 -1
- package/build/types/hardware.js +2 -0
- package/build/types/hardware.js.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.js +1 -0
- package/build/types/index.js.map +1 -1
- package/build/utils/debouncedPatch.d.ts +3 -1
- package/build/utils/debouncedPatch.d.ts.map +1 -1
- package/build/utils/debouncedPatch.js +6 -3
- package/build/utils/debouncedPatch.js.map +1 -1
- package/build/utils/devMiniappLaunch.d.ts.map +1 -1
- package/build/utils/devMiniappLaunch.js +4 -3
- package/build/utils/devMiniappLaunch.js.map +1 -1
- package/build/utils/display/measurer/TextMeasurer.d.ts +2 -159
- package/build/utils/display/measurer/TextMeasurer.d.ts.map +1 -1
- package/build/utils/display/measurer/TextMeasurer.js +2 -272
- package/build/utils/display/measurer/TextMeasurer.js.map +1 -1
- package/build/utils/display/measurer/script-detection.d.ts +1 -52
- package/build/utils/display/measurer/script-detection.d.ts.map +1 -1
- package/build/utils/display/measurer/script-detection.js +2 -183
- package/build/utils/display/measurer/script-detection.js.map +1 -1
- package/build/utils/display/pixelArt.d.ts +3 -0
- package/build/utils/display/pixelArt.d.ts.map +1 -0
- package/build/utils/display/pixelArt.js +3 -0
- package/build/utils/display/pixelArt.js.map +1 -0
- package/build/utils/display/profiles/g1.d.ts +1 -32
- package/build/utils/display/profiles/g1.d.ts.map +1 -1
- package/build/utils/display/profiles/g1.js +2 -212
- package/build/utils/display/profiles/g1.js.map +1 -1
- package/build/utils/display/profiles/g2.d.ts +1 -12
- package/build/utils/display/profiles/g2.d.ts.map +1 -1
- package/build/utils/display/profiles/g2.js +2 -33
- package/build/utils/display/profiles/g2.js.map +1 -1
- package/build/utils/display/profiles/nex.d.ts +1 -9
- package/build/utils/display/profiles/nex.d.ts.map +1 -1
- package/build/utils/display/profiles/nex.js +2 -149
- package/build/utils/display/profiles/nex.js.map +1 -1
- package/build/utils/display/profiles/types.d.ts +1 -102
- package/build/utils/display/profiles/types.d.ts.map +1 -1
- package/build/utils/display/profiles/types.js.map +1 -1
- package/build/utils/display/profiles/z100.d.ts +1 -32
- package/build/utils/display/profiles/z100.d.ts.map +1 -1
- package/build/utils/display/profiles/z100.js +2 -181
- package/build/utils/display/profiles/z100.js.map +1 -1
- package/build/utils/display/scene/degrade.d.ts.map +1 -1
- package/build/utils/display/scene/degrade.js +4 -1
- package/build/utils/display/scene/degrade.js.map +1 -1
- package/build/utils/display/scene/differ.d.ts +13 -1
- package/build/utils/display/scene/differ.d.ts.map +1 -1
- package/build/utils/display/scene/differ.js +22 -0
- package/build/utils/display/scene/differ.js.map +1 -1
- package/build/utils/display/scene/index.d.ts +1 -1
- package/build/utils/display/scene/index.d.ts.map +1 -1
- package/build/utils/display/scene/index.js.map +1 -1
- package/build/utils/display/scene/process.d.ts.map +1 -1
- package/build/utils/display/scene/process.js +183 -11
- package/build/utils/display/scene/process.js.map +1 -1
- package/build/utils/display/scene/store.d.ts +1 -1
- package/build/utils/display/scene/store.d.ts.map +1 -1
- package/build/utils/display/scene/store.js +0 -0
- package/build/utils/display/scene/store.js.map +1 -1
- package/build/utils/display/scene/svgPath.d.ts +9 -0
- package/build/utils/display/scene/svgPath.d.ts.map +1 -0
- package/build/utils/display/scene/svgPath.js +167 -0
- package/build/utils/display/scene/svgPath.js.map +1 -0
- package/build/utils/display/scene/types.d.ts +2 -142
- package/build/utils/display/scene/types.d.ts.map +1 -1
- package/build/utils/display/scene/types.js +0 -0
- package/build/utils/display/scene/types.js.map +1 -1
- package/build/utils/display/wrapper/TextWrapper.d.ts +1 -101
- package/build/utils/display/wrapper/TextWrapper.d.ts.map +1 -1
- package/build/utils/display/wrapper/TextWrapper.js +2 -470
- package/build/utils/display/wrapper/TextWrapper.js.map +1 -1
- package/build/utils/display/wrapper/types.d.ts +2 -74
- package/build/utils/display/wrapper/types.d.ts.map +1 -1
- package/build/utils/display/wrapper/types.js +2 -10
- package/build/utils/display/wrapper/types.js.map +1 -1
- package/build/utils/hardware/hardware.js +1 -1
- package/build/utils/hardware/hardware.js.map +1 -1
- package/build/utils/timers/timers.d.ts.map +1 -1
- package/build/utils/timers/timers.js +26 -4
- package/build/utils/timers/timers.js.map +1 -1
- package/package.json +8 -8
- package/src/engine.ts +24 -15
- package/src/facades/dev.ts +10 -0
- package/src/facades/display.ts +21 -8
- package/src/facades/displayMirror.ts +29 -0
- package/src/facades/glasses.ts +61 -1
- package/src/facades/memory.ts +1 -12
- package/src/facades/miniapps.ts +4 -1
- package/src/facades/pairing.ts +8 -6
- package/src/facades/permissions.ts +46 -0
- package/src/facades/phoneNotifications.ts +45 -26
- package/src/facades/settings.ts +1 -2
- package/src/generated/releaseMetadata.ts +4 -4
- package/src/index.ts +6 -9
- package/src/react/MentraLiveOtaFlow.tsx +2 -2
- package/src/react/useMentraLiveOta.ts +14 -8
- package/src/runtime/config.ts +1 -1
- package/src/services/AppRegistry.ts +43 -7
- package/src/services/BlobStore.ts +3 -3
- package/src/services/CloudClientService.ts +37 -10
- package/src/services/DevServerBridge.ts +12 -10
- package/src/services/DeviceEventRouter.ts +73 -74
- package/src/services/DisplayDiagnostics.ts +107 -0
- package/src/services/DisplayProcessor.ts +20 -55
- package/src/services/GestureDotsService.ts +77 -16
- package/src/services/GlassesKeyboardInput.ts +306 -0
- package/src/services/GlassesSensorService.ts +233 -0
- package/src/services/GlassesTouchInput.ts +128 -0
- package/src/services/HeadingService.ts +0 -24
- package/src/services/HotspotShutdown.ts +3 -1
- package/src/services/JSCrashloopReportService.ts +2 -2
- package/src/services/JSRouter.ts +29 -14
- package/src/services/LocalDisplayManager.ts +112 -26
- package/src/services/LocalMiniappDataMigration.ts +1 -1
- package/src/services/LocalMiniappRuntime.ts +500 -43
- package/src/services/LocalSttFallbackCoordinator.ts +28 -7
- package/src/services/MemoryStore.ts +32 -80
- package/src/services/MiniappEngine.ts +7 -7
- package/src/services/MiniappLauncher.ts +25 -1
- package/src/services/MirrorService.ts +139 -0
- package/src/services/NativeNavigationService.ts +29 -25
- package/src/services/NavigationHandlers.ts +10 -5
- package/src/services/OtaInstallCoordinator.ts +36 -34
- package/src/services/PairedGlassesLatch.ts +39 -0
- package/src/services/PhoneActivity.ts +116 -0
- package/src/services/PhoneCameraFovCoordinator.ts +6 -4
- package/src/services/PhoneNotificationsSync.ts +185 -103
- package/src/services/PhonePhotoCoordinator.ts +9 -10
- package/src/services/PhoneStreamCoordinator.ts +13 -11
- package/src/services/STTModelManager.ts +15 -1
- package/src/services/SceneRenderer.ts +148 -10
- package/src/services/StreamLifecycleController.ts +9 -7
- package/src/services/TTSModelManager.ts +1 -1
- package/src/services/UIRouter.ts +5 -5
- package/src/services/asg/galleryPathMigration.ts +1 -1
- package/src/services/asg/gallerySyncService.ts +2 -2
- package/src/services/asg/localStorageService.ts +3 -3
- package/src/services/debug/DashboardOpenTrace.ts +153 -0
- package/src/services/debug/dashboardOpenTimeline.ts +237 -0
- package/src/services/effectiveCapabilities.ts +32 -13
- package/src/services/gestureClaims.ts +72 -23
- package/src/services/manifestFields.ts +23 -0
- package/src/services/memoryStoreInstance.ts +2 -34
- package/src/services/mirrorSnapshot.ts +116 -0
- package/src/services/nativeNavigationGate.ts +14 -0
- package/src/services/notificationAppCatalog.ts +21 -0
- package/src/services/notifications/notificationPolicy.ts +87 -0
- package/src/services/pages/OverlayPages.ts +86 -0
- package/src/services/pages/PageHost.ts +116 -0
- package/src/services/pages/overlayApps.ts +72 -0
- package/src/services/pages/pageEligibility.ts +30 -0
- package/src/services/settingsBridge.ts +111 -0
- package/src/services/speakerProfileStoreInstance.ts +1 -1
- package/src/services/uiShim.ts +4 -4
- package/src/stores/appVisibility.ts +45 -0
- package/src/stores/apps.ts +110 -32
- package/src/stores/bluetoothSettingKeys.ts +1 -1
- package/src/stores/display.ts +18 -7
- package/src/stores/glasses.ts +15 -1
- package/src/stores/settings.ts +175 -51
- package/src/types/applet.ts +14 -1
- package/src/types/capabilities/even-realities-g2.ts +6 -0
- package/src/types/capabilities/simulated-glasses.ts +8 -4
- package/src/types/hardware.ts +34 -1
- package/src/types/index.ts +1 -0
- package/src/utils/debouncedPatch.ts +8 -4
- package/src/utils/devMiniappLaunch.ts +5 -3
- package/src/utils/display/measurer/TextMeasurer.ts +3 -346
- package/src/utils/display/measurer/script-detection.ts +10 -218
- package/src/utils/display/pixelArt.ts +3 -0
- package/src/utils/display/profiles/g1.ts +2 -236
- package/src/utils/display/profiles/g2.ts +2 -39
- package/src/utils/display/profiles/nex.ts +2 -166
- package/src/utils/display/profiles/types.ts +9 -132
- package/src/utils/display/profiles/z100.ts +2 -198
- package/src/utils/display/scene/degrade.ts +4 -1
- package/src/utils/display/scene/differ.ts +25 -1
- package/src/utils/display/scene/index.ts +5 -0
- package/src/utils/display/scene/process.ts +196 -13
- package/src/utils/display/scene/store.ts +0 -0
- package/src/utils/display/scene/svgPath.ts +163 -0
- package/src/utils/display/scene/types.ts +0 -0
- package/src/utils/display/wrapper/TextWrapper.ts +2 -546
- package/src/utils/display/wrapper/types.ts +3 -102
- package/src/utils/hardware/hardware.ts +1 -1
- package/src/utils/timers/timers.ts +32 -4
- package/build/services/CustomDashboardModel.d.ts +0 -48
- package/build/services/CustomDashboardModel.d.ts.map +0 -1
- package/build/services/CustomDashboardModel.js +0 -73
- package/build/services/CustomDashboardModel.js.map +0 -1
- package/build/services/CustomDashboardService.d.ts +0 -63
- package/build/services/CustomDashboardService.d.ts.map +0 -1
- package/build/services/CustomDashboardService.js +0 -576
- package/build/services/CustomDashboardService.js.map +0 -1
- package/build/services/DashboardCoordinator.d.ts +0 -26
- package/build/services/DashboardCoordinator.d.ts.map +0 -1
- package/build/services/DashboardCoordinator.js +0 -125
- package/build/services/DashboardCoordinator.js.map +0 -1
- package/build/services/iosNotificationAppCatalog.d.ts +0 -13
- package/build/services/iosNotificationAppCatalog.d.ts.map +0 -1
- package/build/services/iosNotificationAppCatalog.js +0 -28
- package/build/services/iosNotificationAppCatalog.js.map +0 -1
- package/src/services/CustomDashboardModel.ts +0 -83
- package/src/services/CustomDashboardService.ts +0 -598
- package/src/services/DashboardCoordinator.ts +0 -121
- package/src/services/iosNotificationAppCatalog.ts +0 -39
|
@@ -1,198 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Vuzix Z100 glyph widths - extracted from NotoSans-Regular.ttf at 21px
|
|
5
|
-
*
|
|
6
|
-
* These are pixel widths at the default font size used by the Z100 display.
|
|
7
|
-
* The Z100 uses Noto Sans as its system font.
|
|
8
|
-
*
|
|
9
|
-
* Extracted using: node scripts/extract-font-metrics.js NotoSans-Regular.ttf 21
|
|
10
|
-
*/
|
|
11
|
-
const Z100_GLYPH_WIDTHS: Record<string, number> = {
|
|
12
|
-
// Space and punctuation
|
|
13
|
-
" ": 5,
|
|
14
|
-
"!": 6,
|
|
15
|
-
'"': 9,
|
|
16
|
-
"#": 14,
|
|
17
|
-
"$": 12,
|
|
18
|
-
"%": 17,
|
|
19
|
-
"&": 15,
|
|
20
|
-
"'": 5,
|
|
21
|
-
"(": 6,
|
|
22
|
-
")": 6,
|
|
23
|
-
"*": 12,
|
|
24
|
-
"+": 12,
|
|
25
|
-
",": 6,
|
|
26
|
-
"-": 7, // Hyphen width - important for line breaking
|
|
27
|
-
".": 6,
|
|
28
|
-
"/": 8,
|
|
29
|
-
|
|
30
|
-
// Numbers
|
|
31
|
-
"0": 12,
|
|
32
|
-
"1": 12,
|
|
33
|
-
"2": 12,
|
|
34
|
-
"3": 12,
|
|
35
|
-
"4": 12,
|
|
36
|
-
"5": 12,
|
|
37
|
-
"6": 12,
|
|
38
|
-
"7": 12,
|
|
39
|
-
"8": 12,
|
|
40
|
-
"9": 12,
|
|
41
|
-
|
|
42
|
-
// More punctuation
|
|
43
|
-
":": 6,
|
|
44
|
-
";": 6,
|
|
45
|
-
"<": 12,
|
|
46
|
-
"=": 12,
|
|
47
|
-
">": 12,
|
|
48
|
-
"?": 9,
|
|
49
|
-
"@": 19,
|
|
50
|
-
|
|
51
|
-
// Uppercase
|
|
52
|
-
"A": 13,
|
|
53
|
-
"B": 14,
|
|
54
|
-
"C": 13,
|
|
55
|
-
"D": 15,
|
|
56
|
-
"E": 12,
|
|
57
|
-
"F": 11,
|
|
58
|
-
"G": 15,
|
|
59
|
-
"H": 16,
|
|
60
|
-
"I": 7,
|
|
61
|
-
"J": 6,
|
|
62
|
-
"K": 13,
|
|
63
|
-
"L": 11,
|
|
64
|
-
"M": 19,
|
|
65
|
-
"N": 16,
|
|
66
|
-
"O": 16,
|
|
67
|
-
"P": 13,
|
|
68
|
-
"Q": 16,
|
|
69
|
-
"R": 13,
|
|
70
|
-
"S": 12,
|
|
71
|
-
"T": 12,
|
|
72
|
-
"U": 15,
|
|
73
|
-
"V": 13,
|
|
74
|
-
"W": 20,
|
|
75
|
-
"X": 12,
|
|
76
|
-
"Y": 12,
|
|
77
|
-
"Z": 12,
|
|
78
|
-
|
|
79
|
-
// Brackets & special
|
|
80
|
-
"[": 7,
|
|
81
|
-
"\\": 8,
|
|
82
|
-
"]": 7,
|
|
83
|
-
"^": 12,
|
|
84
|
-
"_": 9,
|
|
85
|
-
"`": 6,
|
|
86
|
-
|
|
87
|
-
// Lowercase
|
|
88
|
-
"a": 12,
|
|
89
|
-
"b": 13,
|
|
90
|
-
"c": 10,
|
|
91
|
-
"d": 13,
|
|
92
|
-
"e": 12,
|
|
93
|
-
"f": 7,
|
|
94
|
-
"g": 13,
|
|
95
|
-
"h": 13,
|
|
96
|
-
"i": 5,
|
|
97
|
-
"j": 5,
|
|
98
|
-
"k": 11,
|
|
99
|
-
"l": 5,
|
|
100
|
-
"m": 20,
|
|
101
|
-
"n": 13,
|
|
102
|
-
"o": 13,
|
|
103
|
-
"p": 13,
|
|
104
|
-
"q": 13,
|
|
105
|
-
"r": 9,
|
|
106
|
-
"s": 10,
|
|
107
|
-
"t": 8,
|
|
108
|
-
"u": 13,
|
|
109
|
-
"v": 11,
|
|
110
|
-
"w": 17,
|
|
111
|
-
"x": 11,
|
|
112
|
-
"y": 11,
|
|
113
|
-
"z": 10,
|
|
114
|
-
|
|
115
|
-
// More special
|
|
116
|
-
"{": 8,
|
|
117
|
-
"|": 12,
|
|
118
|
-
"}": 8,
|
|
119
|
-
"~": 12,
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Vuzix Z100 Smart Glasses Display Profile
|
|
124
|
-
*
|
|
125
|
-
* The Z100 has a green monochrome display with 640x480 resolution.
|
|
126
|
-
* It uses the Vuzix Ultralite SDK and Noto Sans font family.
|
|
127
|
-
*
|
|
128
|
-
* Display specs:
|
|
129
|
-
* - Resolution: 640x480
|
|
130
|
-
* - Usable text width: ~390px (empirically tested - SDK applies margins)
|
|
131
|
-
* - Color: Green monochrome
|
|
132
|
-
* - Max text lines: 7
|
|
133
|
-
* - Font: Noto Sans Regular at 21px
|
|
134
|
-
* - No bitmap support via text commands
|
|
135
|
-
* - Adjustable brightness
|
|
136
|
-
*
|
|
137
|
-
* NOTE: The Vuzix Ultralite SDK handles text rendering internally and applies
|
|
138
|
-
* its own margins/padding. The usable text width is significantly less than
|
|
139
|
-
* the physical 640px resolution. Empirical testing shows ~42 characters of
|
|
140
|
-
* mixed text (387px measured) fits on one line before the SDK wraps.
|
|
141
|
-
*/
|
|
142
|
-
export const Z100_PROFILE: DisplayProfile = {
|
|
143
|
-
id: "vuzix-z100",
|
|
144
|
-
name: "Vuzix Z100",
|
|
145
|
-
|
|
146
|
-
// Display dimensions
|
|
147
|
-
// Empirically tested: ~42 chars of mixed text (387px) fits before SDK wraps
|
|
148
|
-
// Using 390px to account for measurement variance
|
|
149
|
-
displayWidthPx: 390,
|
|
150
|
-
maxLines: 7,
|
|
151
|
-
|
|
152
|
-
// BLE constraints
|
|
153
|
-
// Z100 uses Vuzix Ultralite SDK which handles chunking internally
|
|
154
|
-
// These are conservative values for direct BLE if needed
|
|
155
|
-
maxPayloadBytes: 512,
|
|
156
|
-
bleChunkSize: 180,
|
|
157
|
-
|
|
158
|
-
// Font metrics - Noto Sans Regular at 21px
|
|
159
|
-
fontMetrics: {
|
|
160
|
-
glyphWidths: new Map(Object.entries(Z100_GLYPH_WIDTHS)),
|
|
161
|
-
defaultGlyphWidth: 12, // Average width from extracted metrics
|
|
162
|
-
// Z100 uses direct pixel widths, no render formula needed
|
|
163
|
-
renderFormula: (glyphWidth: number) => glyphWidth,
|
|
164
|
-
|
|
165
|
-
// Uniform-width scripts for CJK and other non-Latin
|
|
166
|
-
// Noto Sans CJK characters are typically wider
|
|
167
|
-
uniformScripts: {
|
|
168
|
-
cjk: 21, // Full-width CJK characters
|
|
169
|
-
hiragana: 21,
|
|
170
|
-
katakana: 21,
|
|
171
|
-
korean: 21,
|
|
172
|
-
cyrillic: 14, // Cyrillic is similar to Latin in Noto Sans
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
fallback: {
|
|
176
|
-
latinMaxWidth: 20, // 'W' and 'm' are the widest at 20px
|
|
177
|
-
unknownBehavior: "useLatinMax",
|
|
178
|
-
},
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
constraints: {
|
|
182
|
-
minCharsBeforeHyphen: 3,
|
|
183
|
-
noStartChars: [".", ",", "!", "?", ":", ";", ")", "]", "}", "。", ",", "!", "?", ":", ";", ")", "】", "」"],
|
|
184
|
-
noEndChars: ["(", "[", "{", "(", "【", "「"],
|
|
185
|
-
},
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Get the hyphen width for Z100 in pixels.
|
|
190
|
-
* Used for line breaking calculations.
|
|
191
|
-
*/
|
|
192
|
-
export const Z100_HYPHEN_WIDTH_PX = 7
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Get the space width for Z100 in pixels.
|
|
196
|
-
* Used for column alignment calculations.
|
|
197
|
-
*/
|
|
198
|
-
export const Z100_SPACE_WIDTH_PX = 5
|
|
1
|
+
// Moved into the SDK (@glassly/miniapp/display) so miniapps lay text out the way the host measures it; this path re-exports it for the engine.
|
|
2
|
+
export {Z100_PROFILE, Z100_HYPHEN_WIDTH_PX, Z100_SPACE_WIDTH_PX} from "@glassly/miniapp/display"
|
|
@@ -37,6 +37,9 @@ export function degradeScene(input: readonly SceneElementInput[]): DegradedScene
|
|
|
37
37
|
|
|
38
38
|
const texts: TextEl[] = []
|
|
39
39
|
input.forEach((el, index) => {
|
|
40
|
+
if (el && typeof el === "object" && Array.isArray((el as {points?: unknown}).points)) {
|
|
41
|
+
return // vector shapes: decoration on a text wall
|
|
42
|
+
}
|
|
40
43
|
if (!el || typeof el !== "object" || !el.box) {
|
|
41
44
|
// Malformed element — report it like the positioning pipeline does
|
|
42
45
|
// instead of silently pretending the render was clean.
|
|
@@ -50,7 +53,7 @@ export function degradeScene(input: readonly SceneElementInput[]): DegradedScene
|
|
|
50
53
|
dropped.push(el.id ?? `image[${index}]`)
|
|
51
54
|
degraded = true
|
|
52
55
|
}
|
|
53
|
-
// rects: silent drop — pure decoration on a text wall.
|
|
56
|
+
// rects and other shapes: silent drop — pure decoration on a text wall.
|
|
54
57
|
})
|
|
55
58
|
|
|
56
59
|
if (texts.length === 0) {
|
|
@@ -15,17 +15,30 @@
|
|
|
15
15
|
* prefixed "~" so they can never collide with app-supplied ids.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import type {FrameElement, SceneBox, SceneChange, SceneElementType} from "./types"
|
|
18
|
+
import type {FrameElement, SceneBox, SceneChange, SceneElementType, ScenePoint, SceneTransition} from "./types"
|
|
19
19
|
import {boxesEqual} from "./types"
|
|
20
20
|
|
|
21
21
|
/** A processed (clamped/wrapped) element, pre-diff: id optional, no annotation yet. */
|
|
22
22
|
export interface DiffableElement {
|
|
23
|
+
/** SVG path and its checked firmware command stream (Q4 coordinates). */
|
|
24
|
+
d?: string
|
|
25
|
+
path?: number[]
|
|
26
|
+
pathScale?: number
|
|
27
|
+
fillRule?: "nonzero" | "evenodd"
|
|
28
|
+
rotation?: number
|
|
29
|
+
pivot?: ScenePoint
|
|
30
|
+
depth?: number
|
|
31
|
+
|
|
23
32
|
id?: string
|
|
24
33
|
type: SceneElementType
|
|
25
34
|
box: SceneBox
|
|
26
35
|
text?: string
|
|
27
36
|
data?: string
|
|
28
37
|
style?: FrameElement["style"]
|
|
38
|
+
points?: ScenePoint[]
|
|
39
|
+
startDeg?: number
|
|
40
|
+
endDeg?: number
|
|
41
|
+
transition?: SceneTransition
|
|
29
42
|
contentHash: string
|
|
30
43
|
}
|
|
31
44
|
|
|
@@ -54,6 +67,17 @@ function buildFrameElement(el: DiffableElement, id: string, change: SceneChange)
|
|
|
54
67
|
if (el.text !== undefined) out.text = el.text
|
|
55
68
|
if (el.data !== undefined) out.data = el.data
|
|
56
69
|
if (el.style !== undefined) out.style = el.style
|
|
70
|
+
if (el.points !== undefined) out.points = el.points
|
|
71
|
+
if (el.startDeg !== undefined) out.startDeg = el.startDeg
|
|
72
|
+
if (el.endDeg !== undefined) out.endDeg = el.endDeg
|
|
73
|
+
if (el.transition !== undefined) out.transition = el.transition
|
|
74
|
+
if (el.d !== undefined) out.d = el.d
|
|
75
|
+
if (el.path !== undefined) out.path = el.path
|
|
76
|
+
if (el.pathScale !== undefined) out.pathScale = el.pathScale
|
|
77
|
+
if (el.fillRule !== undefined) out.fillRule = el.fillRule
|
|
78
|
+
if (el.rotation !== undefined) out.rotation = el.rotation
|
|
79
|
+
if (el.pivot !== undefined) out.pivot = el.pivot
|
|
80
|
+
if (el.depth !== undefined) out.depth = el.depth
|
|
57
81
|
return out
|
|
58
82
|
}
|
|
59
83
|
|
|
@@ -9,9 +9,14 @@ export type {
|
|
|
9
9
|
SceneElementInput,
|
|
10
10
|
SceneElementType,
|
|
11
11
|
SceneFrame,
|
|
12
|
+
SceneImageStyle,
|
|
13
|
+
ScenePoint,
|
|
12
14
|
SceneProcessResult,
|
|
13
15
|
SceneRectStyle,
|
|
16
|
+
SceneShapeStyle,
|
|
17
|
+
SceneStrokeStyle,
|
|
14
18
|
SceneTextStyle,
|
|
19
|
+
SceneTransition,
|
|
15
20
|
} from "./types"
|
|
16
21
|
export {boxesEqual, contentHash, elementContentHash} from "./types"
|
|
17
22
|
export {resolveAnchors} from "./anchor"
|
|
@@ -8,12 +8,21 @@
|
|
|
8
8
|
* design doc's image "reject" to per-element drop).
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import {compileSvgPath} from "./svgPath"
|
|
11
12
|
import {TextMeasurer} from "../measurer/TextMeasurer"
|
|
12
13
|
import {TextWrapper} from "../wrapper/TextWrapper"
|
|
13
14
|
import type {DisplayProfile} from "../profiles/types"
|
|
14
15
|
import type {DiffableElement} from "./differ"
|
|
15
|
-
import type {
|
|
16
|
-
|
|
16
|
+
import type {
|
|
17
|
+
SceneBox,
|
|
18
|
+
SceneBoxInput,
|
|
19
|
+
SceneDisplayCapabilities,
|
|
20
|
+
SceneElementInput,
|
|
21
|
+
ScenePoint,
|
|
22
|
+
SceneTextStyle,
|
|
23
|
+
SceneTransition,
|
|
24
|
+
} from "./types"
|
|
25
|
+
import {MAX_SCENE_DEPTH, POINT_SHAPE_ARITY, POINT_SHAPE_TYPES, elementContentHash} from "./types"
|
|
17
26
|
|
|
18
27
|
export interface ProcessedScene {
|
|
19
28
|
elements: DiffableElement[]
|
|
@@ -35,6 +44,35 @@ function clampBox(box: SceneBox, width: number, height: number): SceneBox | null
|
|
|
35
44
|
return {x: x1, y: y1, w: x2 - x1, h: y2 - y1}
|
|
36
45
|
}
|
|
37
46
|
|
|
47
|
+
const isFinite = (n: unknown): n is number => typeof n === "number" && Number.isFinite(n)
|
|
48
|
+
|
|
49
|
+
/** Integer points, or null when the count/values are invalid for the type. */
|
|
50
|
+
function validPoints(el: SceneElementInput): ScenePoint[] | null {
|
|
51
|
+
const raw = (el as {points?: unknown}).points
|
|
52
|
+
if (!Array.isArray(raw) || !(POINT_SHAPE_ARITY[el.type] ?? []).includes(raw.length)) return null
|
|
53
|
+
const points: ScenePoint[] = []
|
|
54
|
+
for (const p of raw) {
|
|
55
|
+
if (!p || typeof p !== "object" || !isFinite((p as ScenePoint).x) || !isFinite((p as ScenePoint).y)) return null
|
|
56
|
+
points.push({x: Math.floor((p as ScenePoint).x), y: Math.floor((p as ScenePoint).y)})
|
|
57
|
+
}
|
|
58
|
+
return points
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function pointsBox(points: ScenePoint[]): SceneBox {
|
|
62
|
+
const xs = points.map((p) => p.x)
|
|
63
|
+
const ys = points.map((p) => p.y)
|
|
64
|
+
const x = Math.min(...xs)
|
|
65
|
+
const y = Math.min(...ys)
|
|
66
|
+
return {x, y, w: Math.max(...xs) - x + 1, h: Math.max(...ys) - y + 1}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function validTransition(t: unknown): SceneTransition | undefined {
|
|
70
|
+
if (!t || typeof t !== "object") return undefined
|
|
71
|
+
const {durationMs, easing} = t as SceneTransition
|
|
72
|
+
if (!isFinite(durationMs) || durationMs <= 0) return undefined
|
|
73
|
+
return easing ? {durationMs, easing} : {durationMs}
|
|
74
|
+
}
|
|
75
|
+
|
|
38
76
|
function boxShrunk(orig: SceneBox, clamped: SceneBox): boolean {
|
|
39
77
|
return (
|
|
40
78
|
clamped.x !== Math.floor(orig.x) ||
|
|
@@ -77,17 +115,38 @@ export function processScene(
|
|
|
77
115
|
|
|
78
116
|
// Validate + dedupe explicit ids (first occurrence wins; dupes are dev error).
|
|
79
117
|
const seenIds = new Set<string>()
|
|
80
|
-
const valid: {el: SceneElementInput; index: number}[] = []
|
|
118
|
+
const valid: {el: SceneElementInput; index: number; box: SceneBoxInput; points?: ScenePoint[]}[] = []
|
|
81
119
|
input.forEach((raw, index) => {
|
|
82
|
-
if (!raw || typeof raw !== "object"
|
|
120
|
+
if (!raw || typeof raw !== "object") {
|
|
83
121
|
dropped.push(reportId(raw ?? ({type: "text"} as SceneElementInput), index))
|
|
84
122
|
degraded = true
|
|
85
123
|
return
|
|
86
124
|
}
|
|
125
|
+
let points: ScenePoint[] | undefined
|
|
126
|
+
if (POINT_SHAPE_TYPES.includes(raw.type)) {
|
|
127
|
+
const valid = validPoints(raw)
|
|
128
|
+
if (!valid) {
|
|
129
|
+
dropped.push(reportId(raw, index))
|
|
130
|
+
degraded = true
|
|
131
|
+
return
|
|
132
|
+
}
|
|
133
|
+
points = valid
|
|
134
|
+
raw = {...raw, box: pointsBox(valid)} as SceneElementInput
|
|
135
|
+
}
|
|
136
|
+
if (!raw.box) {
|
|
137
|
+
dropped.push(reportId(raw, index))
|
|
138
|
+
degraded = true
|
|
139
|
+
return
|
|
140
|
+
}
|
|
87
141
|
// Non-finite box numbers (NaN/±Infinity/non-number) would survive the
|
|
88
142
|
// Math.* clamp below and poison the frame all the way to native ints.
|
|
89
143
|
const b = raw.box
|
|
90
|
-
if (![b.x, b.y, b.w, b.h].every(
|
|
144
|
+
if (![b.x, b.y, b.w, b.h].every(isFinite)) {
|
|
145
|
+
dropped.push(reportId(raw, index))
|
|
146
|
+
degraded = true
|
|
147
|
+
return
|
|
148
|
+
}
|
|
149
|
+
if ((raw.type === "arc" || raw.type === "pie") && !(isFinite(raw.startDeg) && isFinite(raw.endDeg))) {
|
|
91
150
|
dropped.push(reportId(raw, index))
|
|
92
151
|
degraded = true
|
|
93
152
|
return
|
|
@@ -105,24 +164,138 @@ export function processScene(
|
|
|
105
164
|
}
|
|
106
165
|
seenIds.add(key)
|
|
107
166
|
}
|
|
108
|
-
valid.push({el, index})
|
|
167
|
+
valid.push({el, index, box: el.box as SceneBoxInput, points})
|
|
109
168
|
})
|
|
110
169
|
|
|
111
170
|
// Clamp + per-type limits, then budget in array order.
|
|
112
171
|
let textBudget = caps.maxTextElements
|
|
113
172
|
let imageBudget = caps.maxImageElements
|
|
114
173
|
const out: DiffableElement[] = []
|
|
174
|
+
let pathEdges = 0
|
|
115
175
|
|
|
116
|
-
for (const {el, index} of valid) {
|
|
117
|
-
const
|
|
176
|
+
for (const {el, index, box, points} of valid) {
|
|
177
|
+
const transition = validTransition((el as {transition?: unknown}).transition)
|
|
178
|
+
const transform: {rotation?: number; pivot?: ScenePoint} = {}
|
|
179
|
+
if (el.rotation !== undefined || el.pivot !== undefined) {
|
|
180
|
+
const angle = el.rotation ?? 0
|
|
181
|
+
const pivot = el.pivot ?? {x: box.x + box.w / 2, y: box.y + box.h / 2}
|
|
182
|
+
if (
|
|
183
|
+
!isFinite(angle) ||
|
|
184
|
+
Math.abs(angle) > 36000 ||
|
|
185
|
+
!isFinite(pivot.x) ||
|
|
186
|
+
!isFinite(pivot.y) ||
|
|
187
|
+
Math.abs(pivot.x) > 32767 ||
|
|
188
|
+
Math.abs(pivot.y) > 32767 ||
|
|
189
|
+
!caps.rotation ||
|
|
190
|
+
el.type === "image" ||
|
|
191
|
+
el.type === "text"
|
|
192
|
+
) {
|
|
193
|
+
dropped.push(reportId(el, index))
|
|
194
|
+
degraded = true
|
|
195
|
+
continue
|
|
196
|
+
}
|
|
197
|
+
transform.rotation = Math.round(angle * 256) / 256
|
|
198
|
+
transform.pivot = {x: Math.round(pivot.x), y: Math.round(pivot.y)}
|
|
199
|
+
if (transition) transition.durationMs = Math.min(65535, transition.durationMs)
|
|
200
|
+
}
|
|
201
|
+
const transformHash =
|
|
202
|
+
transform.rotation === undefined ? undefined : `${transform.rotation}:${transform.pivot?.x}:${transform.pivot?.y}`
|
|
203
|
+
// Depth is a lens disparity, not content: devices without it draw the
|
|
204
|
+
// element flat instead of dropping it. A non-number is still a dev error.
|
|
205
|
+
let depth: number | undefined
|
|
206
|
+
if (el.depth !== undefined) {
|
|
207
|
+
if (!isFinite(el.depth)) {
|
|
208
|
+
dropped.push(reportId(el, index))
|
|
209
|
+
degraded = true
|
|
210
|
+
continue
|
|
211
|
+
}
|
|
212
|
+
const d = Math.max(-MAX_SCENE_DEPTH, Math.min(MAX_SCENE_DEPTH, Math.round(el.depth)))
|
|
213
|
+
if (caps.depth && d !== 0) depth = d
|
|
214
|
+
}
|
|
215
|
+
const plane = depth === undefined ? {} : {depth}
|
|
216
|
+
const clamped = clampBox(box, caps.width, caps.height)
|
|
118
217
|
if (!clamped) {
|
|
119
218
|
dropped.push(reportId(el, index))
|
|
120
219
|
degraded = true
|
|
121
220
|
continue
|
|
122
221
|
}
|
|
123
|
-
const shrunk = boxShrunk(
|
|
222
|
+
const shrunk = boxShrunk(box, clamped)
|
|
124
223
|
if (shrunk) degraded = true
|
|
125
224
|
|
|
225
|
+
if (el.type === "svg") {
|
|
226
|
+
try {
|
|
227
|
+
if (!caps.shapes.includes("svg") || textBudget <= 0 || shrunk)
|
|
228
|
+
throw new Error("SVG unavailable or out of bounds")
|
|
229
|
+
const scale = el.scale ?? 1
|
|
230
|
+
if (
|
|
231
|
+
!isFinite(scale) ||
|
|
232
|
+
scale < 0 ||
|
|
233
|
+
scale > 8 ||
|
|
234
|
+
(el.fillRule !== undefined && el.fillRule !== "evenodd" && el.fillRule !== "nonzero")
|
|
235
|
+
)
|
|
236
|
+
throw new Error("Invalid SVG scale or fill rule")
|
|
237
|
+
const compiled = compileSvgPath(el.d)
|
|
238
|
+
if (pathEdges + compiled.edges > 4096) throw new Error("SVG scene exceeds the edge budget")
|
|
239
|
+
pathEdges += compiled.edges
|
|
240
|
+
textBudget--
|
|
241
|
+
out.push({
|
|
242
|
+
id: el.id,
|
|
243
|
+
type: "svg",
|
|
244
|
+
box: clamped,
|
|
245
|
+
d: el.d,
|
|
246
|
+
path: compiled.commands,
|
|
247
|
+
pathScale: Math.round(scale * 256),
|
|
248
|
+
fillRule: el.fillRule ?? "nonzero",
|
|
249
|
+
style: el.style,
|
|
250
|
+
...transform,
|
|
251
|
+
...plane,
|
|
252
|
+
...(transition ? {transition} : {}),
|
|
253
|
+
contentHash: elementContentHash({
|
|
254
|
+
type: "svg",
|
|
255
|
+
data: `${el.d}:${scale}:${el.fillRule}:${transformHash}`,
|
|
256
|
+
style: el.style,
|
|
257
|
+
depth,
|
|
258
|
+
}),
|
|
259
|
+
})
|
|
260
|
+
} catch {
|
|
261
|
+
dropped.push(reportId(el, index))
|
|
262
|
+
degraded = true
|
|
263
|
+
}
|
|
264
|
+
continue
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if (el.type !== "text" && el.type !== "image" && el.type !== "rect") {
|
|
268
|
+
// Vector shapes: only devices that draw them get them; the device clips
|
|
269
|
+
// point shapes itself, so an off-canvas point is not a drop.
|
|
270
|
+
if (!caps.shapes.includes(el.type) || textBudget <= 0) {
|
|
271
|
+
dropped.push(reportId(el, index))
|
|
272
|
+
degraded = true
|
|
273
|
+
continue
|
|
274
|
+
}
|
|
275
|
+
textBudget--
|
|
276
|
+
const angles = el.type === "arc" || el.type === "pie" ? {startDeg: el.startDeg, endDeg: el.endDeg} : {}
|
|
277
|
+
out.push({
|
|
278
|
+
id: el.id,
|
|
279
|
+
type: el.type,
|
|
280
|
+
box: clamped,
|
|
281
|
+
style: el.style,
|
|
282
|
+
...(points ? {points} : {}),
|
|
283
|
+
...angles,
|
|
284
|
+
...(transition ? {transition} : {}),
|
|
285
|
+
...transform,
|
|
286
|
+
...plane,
|
|
287
|
+
contentHash: elementContentHash({
|
|
288
|
+
type: el.type,
|
|
289
|
+
style: el.style,
|
|
290
|
+
points,
|
|
291
|
+
...angles,
|
|
292
|
+
data: transformHash,
|
|
293
|
+
depth,
|
|
294
|
+
}),
|
|
295
|
+
})
|
|
296
|
+
continue
|
|
297
|
+
}
|
|
298
|
+
|
|
126
299
|
if (el.type === "image") {
|
|
127
300
|
// Images: a shrunk box can't be honored (we don't crop pixels host-side)
|
|
128
301
|
// and per-image device limits are box-level (the firmware allocates the
|
|
@@ -148,7 +321,10 @@ export function processScene(
|
|
|
148
321
|
type: "image",
|
|
149
322
|
box: clamped,
|
|
150
323
|
data: el.data,
|
|
151
|
-
|
|
324
|
+
...(el.style ? {style: el.style} : {}),
|
|
325
|
+
...(transition ? {transition} : {}),
|
|
326
|
+
...plane,
|
|
327
|
+
contentHash: elementContentHash({type: "image", data: el.data, style: el.style, depth}),
|
|
152
328
|
})
|
|
153
329
|
continue
|
|
154
330
|
}
|
|
@@ -167,7 +343,10 @@ export function processScene(
|
|
|
167
343
|
type: "rect",
|
|
168
344
|
box: clamped,
|
|
169
345
|
style: el.style,
|
|
170
|
-
|
|
346
|
+
...(transition ? {transition} : {}),
|
|
347
|
+
...transform,
|
|
348
|
+
...plane,
|
|
349
|
+
contentHash: elementContentHash({type: "rect", style: el.style, data: transformHash, depth}),
|
|
171
350
|
})
|
|
172
351
|
continue
|
|
173
352
|
}
|
|
@@ -188,7 +367,9 @@ export function processScene(
|
|
|
188
367
|
box: clamped,
|
|
189
368
|
text: monoText,
|
|
190
369
|
style: el.style,
|
|
191
|
-
|
|
370
|
+
...(transition ? {transition} : {}),
|
|
371
|
+
...plane,
|
|
372
|
+
contentHash: elementContentHash({type: "text", text: monoText, style: el.style, depth}),
|
|
192
373
|
})
|
|
193
374
|
continue
|
|
194
375
|
}
|
|
@@ -221,7 +402,9 @@ export function processScene(
|
|
|
221
402
|
box: clamped,
|
|
222
403
|
text: wrappedText,
|
|
223
404
|
style: el.style,
|
|
224
|
-
|
|
405
|
+
...(transition ? {transition} : {}),
|
|
406
|
+
...plane,
|
|
407
|
+
contentHash: elementContentHash({type: "text", text: wrappedText, style: el.style, depth}),
|
|
225
408
|
})
|
|
226
409
|
}
|
|
227
410
|
|
|
Binary file
|