@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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Capability profile for the Simulated Glasses model.
|
|
5
5
|
* Defines the hardware and software features available on this device.
|
|
6
|
-
*
|
|
6
|
+
* The display previews the G2 Glassly CFW scene API, including SVG and rotation.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Simulated Glasses capability profile
|
|
@@ -32,9 +32,12 @@ export const simulatedGlasses = {
|
|
|
32
32
|
width: 576,
|
|
33
33
|
height: 288,
|
|
34
34
|
canPosition: true,
|
|
35
|
-
maxTextElements:
|
|
36
|
-
maxImageElements:
|
|
37
|
-
shapes: ["rect"],
|
|
35
|
+
maxTextElements: 120,
|
|
36
|
+
maxImageElements: 120,
|
|
37
|
+
shapes: ["rect", "circle", "arc", "pie", "line", "triangle", "quad", "bezier", "svg"],
|
|
38
|
+
animation: true,
|
|
39
|
+
rotation: true,
|
|
40
|
+
depth: true,
|
|
38
41
|
// The mirror renders full 8-bit grayscale; 16 matches the G2's 4-bit
|
|
39
42
|
// panel so simulated output previews what real hardware can show.
|
|
40
43
|
intensityLevels: 16,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulated-glasses.js","sourceRoot":"","sources":["../../../src/types/capabilities/simulated-glasses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC5C,SAAS,EAAE,mBAAmB;IAE9B,+CAA+C;IAC/C,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,IAAI;IAEZ,wDAAwD;IACxD,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,OAAO;QACd,gBAAgB,EAAE,IAAI;QACtB,UAAU,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAC;QACrC,WAAW,EAAE,EAAC,UAAU,EAAE,EAAE,EAAC;QAC7B,YAAY,EAAE,CAAC;QACf,gBAAgB,EAAE,IAAI;QAEtB,sEAAsE;QACtE,wEAAwE;QACxE,sEAAsE;QACtE,uEAAuE;QACvE,2DAA2D;QAC3D,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,IAAI;QACjB,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"simulated-glasses.js","sourceRoot":"","sources":["../../../src/types/capabilities/simulated-glasses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC5C,SAAS,EAAE,mBAAmB;IAE9B,+CAA+C;IAC/C,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,IAAI;IAEZ,wDAAwD;IACxD,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,OAAO;QACd,gBAAgB,EAAE,IAAI;QACtB,UAAU,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAC;QACrC,WAAW,EAAE,EAAC,UAAU,EAAE,EAAE,EAAC;QAC7B,YAAY,EAAE,CAAC;QACf,gBAAgB,EAAE,IAAI;QAEtB,sEAAsE;QACtE,wEAAwE;QACxE,sEAAsE;QACtE,uEAAuE;QACvE,2DAA2D;QAC3D,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,IAAI;QACjB,eAAe,EAAE,GAAG;QACpB,gBAAgB,EAAE,GAAG;QACrB,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC;QACrF,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;QACX,qEAAqE;QAErE,kEAAkE;QAClE,eAAe,EAAE,EAAE;QACnB,aAAa,EAAE,IAAI;KACpB;IAED,yDAAyD;IACzD,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE;QACV,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;KACd;IAED,uDAAuD;IACvD,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,KAAK;KACjB;IAED,0CAA0C;IAC1C,MAAM,EAAE,KAAK;IACb,GAAG,EAAE,IAAI;IAET,iDAAiD;IACjD,SAAS,EAAE,IAAI;IACf,MAAM,EAAE;QACN,KAAK,EAAE,CAAC;QACR,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,CAAC,OAAO,CAAC;gBACjB,YAAY,EAAE,KAAK;aACpB;SACF;KACF;IAED,4CAA4C;IAC5C,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;IAEX,sDAAsD;IACtD,KAAK,EAAE;QACL,kBAAkB,EAAE,KAAK;KAC1B;IAED,4CAA4C;IAC5C,OAAO,EAAE,KAAK;IAEd,0DAA0D;IAC1D,MAAM,EAAE,KAAK;CACd,CAAA","sourcesContent":["/**\n * @fileoverview Simulated Glasses Hardware Capabilities\n *\n * Capability profile for the Simulated Glasses model.\n * Defines the hardware and software features available on this device.\n * The display previews the G2 Glassly CFW scene API, including SVG and rotation.\n */\n\nimport type {Capabilities} from \"../hardware\"\n\n/**\n * Simulated Glasses capability profile\n */\nexport const simulatedGlasses: Capabilities = {\n modelName: \"Simulated Glasses\",\n\n // Camera capabilities - does not have a camera\n hasCamera: false,\n camera: null,\n\n // Display capabilities - has a green monochrome display\n hasDisplay: true,\n display: {\n count: 1,\n isColor: false,\n color: \"green\",\n canDisplayBitmap: true,\n resolution: {width: 640, height: 480},\n fieldOfView: {horizontal: 30},\n maxTextLines: 7,\n adjustBrightness: true,\n\n // Scene display API — the simulated display is the phone-side mirror,\n // which renders positioned text AND image elements natively. Mirror the\n // G2's canvas and budgets so behavior verified here transfers to real\n // hardware (without this block the scene pipeline degrades every frame\n // to a text wall and image elements are silently dropped).\n width: 576,\n height: 288,\n canPosition: true,\n maxTextElements: 120,\n maxImageElements: 120,\n shapes: [\"rect\", \"circle\", \"arc\", \"pie\", \"line\", \"triangle\", \"quad\", \"bezier\", \"svg\"],\n animation: true,\n rotation: true,\n depth: true,\n // The mirror renders full 8-bit grayscale; 16 matches the G2's 4-bit\n\n // panel so simulated output previews what real hardware can show.\n intensityLevels: 16,\n partialUpdate: true,\n },\n\n // Microphone capabilities - has a microphone (phone mic)\n hasMicrophone: true,\n microphone: {\n count: 1,\n hasVAD: false,\n },\n\n // Speaker capabilities - has a speaker (phone speaker)\n hasSpeaker: true,\n speaker: {\n count: 1,\n isPrivate: false,\n },\n\n // IMU capabilities - does not have an IMU\n hasIMU: false,\n imu: null,\n\n // Button capabilities - Has one simulated button\n hasButton: true,\n button: {\n count: 1,\n buttons: [\n {\n type: \"press\",\n events: [\"press\"],\n isCapacitive: false,\n },\n ],\n },\n\n // Light capabilities - does not have lights\n hasLight: false,\n light: null,\n\n // Power capabilities - does not have external battery\n power: {\n hasExternalBattery: false,\n },\n\n // WiFi capabilities - does not support WiFi\n hasWifi: false,\n\n // OTA capabilities - simulated glasses do not support OTA\n hasOta: false,\n}\n"]}
|
|
@@ -61,10 +61,26 @@ export interface DisplayCapabilities {
|
|
|
61
61
|
width: number;
|
|
62
62
|
height: number;
|
|
63
63
|
};
|
|
64
|
-
shapes?:
|
|
64
|
+
shapes?: DisplayShape[];
|
|
65
|
+
/** True ⇒ the device animates element transitions itself. */
|
|
66
|
+
animation?: boolean;
|
|
67
|
+
/** Geometric and SVG rotations, including duration-based transitions. */
|
|
68
|
+
rotation?: boolean;
|
|
69
|
+
/** Per-element stereo `depth` (a lens disparity) is honored; otherwise elements draw flat. */
|
|
70
|
+
depth?: boolean;
|
|
65
71
|
intensityLevels?: number;
|
|
66
72
|
partialUpdate?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The views a miniapp may draw right now: "main" for every app, "dashboard"
|
|
75
|
+
* (the overlay slot) only for the designated system dashboard app while the
|
|
76
|
+
* glasses are eligible. Per app; filled in by the miniapp runtime.
|
|
77
|
+
*/
|
|
78
|
+
views?: DisplayView[];
|
|
67
79
|
}
|
|
80
|
+
export type DisplayView = "main" | "dashboard";
|
|
81
|
+
export type DisplayShape = "rect" | "circle" | "arc" | "pie" | "line" | "triangle" | "quad" | "bezier" | "svg";
|
|
82
|
+
/** Every vector shape the Glassly CFW rasterizes on the glasses. */
|
|
83
|
+
export declare const ALL_DISPLAY_SHAPES: DisplayShape[];
|
|
68
84
|
/**
|
|
69
85
|
* Microphone capabilities
|
|
70
86
|
*/
|
|
@@ -141,8 +157,11 @@ export interface Capabilities {
|
|
|
141
157
|
power: PowerCapabilities;
|
|
142
158
|
hasWifi: boolean;
|
|
143
159
|
hasOta?: boolean;
|
|
160
|
+
hasCustomFirmware?: boolean;
|
|
144
161
|
hasNativeDashboard?: boolean;
|
|
145
162
|
hasNativeNavigation?: boolean;
|
|
163
|
+
hasNativeNotifications?: boolean;
|
|
164
|
+
nativeNotificationPopupSeconds?: number[];
|
|
146
165
|
}
|
|
147
166
|
/**
|
|
148
167
|
* Hardware capability profiles for supported glasses models
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardware.d.ts","sourceRoot":"","sources":["../../src/types/hardware.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAA;AAChE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CAyB9D,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,YAAY,WAAW,KAAG,YAM9D,CAAA;AAGD,OAAO,EAAC,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAC,CAAA"}
|
package/build/types/hardware.js
CHANGED
|
@@ -10,6 +10,8 @@ import { nimo } from "./capabilities/nimo";
|
|
|
10
10
|
import { vuzixZ100 } from "./capabilities/vuzix-z100";
|
|
11
11
|
import { none } from "./capabilities/none";
|
|
12
12
|
import { DeviceTypes } from "./enums";
|
|
13
|
+
/** Every vector shape the Glassly CFW rasterizes on the glasses. */
|
|
14
|
+
export const ALL_DISPLAY_SHAPES = ["rect", "circle", "arc", "pie", "line", "triangle", "quad", "bezier"];
|
|
13
15
|
/**
|
|
14
16
|
* Hardware capability profiles for supported glasses models
|
|
15
17
|
* Key: model_name string (e.g., "Even Realities G1", "Mentra Live")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardware.js","sourceRoot":"","sources":["../../src/types/hardware.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AACjE,OAAO,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAA;AACxC,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAA;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"hardware.js","sourceRoot":"","sources":["../../src/types/hardware.ts"],"names":[],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E,WAAW,CAAC,IAAI;QAC3B,OAAO,EAAE;YACP,GAAG,eAAe,CAAC,OAAO;YAC1B,gBAAgB,EAAE,KAAK;SACxB;QACD,aAAa,EAAE,IAAI;QACnB,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE;YACV,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,KAAK;SACd;KACF;IACD,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI;CACvB,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,UAAuB,EAAgB,EAAE;IAC5E,MAAM,SAAS,GAAG,UAAoB,CAAA;IACtC,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,CAAC;QACtC,OAAO,qBAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAChD,CAAC;IACD,OAAO,qBAAqB,CAAC,SAAS,CAAC,CAAA;AACzC,CAAC,CAAA;AAED,iCAAiC;AACjC,OAAO,EAAC,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAC,CAAA","sourcesContent":["/**\n * Hardware capability types\n */\n\nimport {evenRealitiesG1} from \"./capabilities/even-realities-g1\"\nimport {evenRealitiesG2} from \"./capabilities/even-realities-g2\"\nimport {mentraDisplay} from \"./capabilities/mentra-display\"\nimport {mentraLive} from \"./capabilities/mentra-live\"\nimport {simulatedGlasses} from \"./capabilities/simulated-glasses\"\nimport {nimo} from \"./capabilities/nimo\"\nimport {vuzixZ100} from \"./capabilities/vuzix-z100\"\nimport {none} from \"./capabilities/none\"\nimport {DeviceTypes} from \"./enums\"\n\n// Canonical def lives in @glassly/miniapp; re-exported for engine consumers.\nexport type {HardwareRequirement} from \"@glassly/miniapp/hardware\"\n\n/**\n * Camera capabilities\n */\nexport interface CameraCapabilities {\n resolution?: {width: number; height: number}\n hasHDR?: boolean\n hasFocus?: boolean\n video: {\n canRecord: boolean\n canStream: boolean\n supportedStreamTypes?: string[]\n supportedResolutions?: {width: number; height: number}[]\n }\n}\n\n/**\n * Display capabilities\n */\nexport interface DisplayCapabilities {\n count?: number\n isColor?: boolean\n color?: string // e.g., \"green\", \"full_color\", \"pallet\"\n canDisplayBitmap?: boolean\n resolution?: {width: number; height: number}\n fieldOfView?: {horizontal?: number; vertical?: number}\n maxTextLines?: number\n adjustBrightness?: boolean\n\n // --- Scene display API (display.render()) — typed capabilities ---\n // Pure DATA the host scene pipeline acts on generically; a device without\n // canPosition renders scenes via the host degrade path instead.\n /** Public drawable canvas in px — the raw coordinate space for render() boxes. */\n width?: number\n height?: number\n /** True ⇒ the device renders positioned elements (containers / canvas components). */\n canPosition?: boolean\n /** Element budgets. Rects share the text pool on container-based devices. */\n maxTextElements?: number\n maxImageElements?: number\n /** Per-image dimension cap (box-level), when the firmware has one. */\n maxImagePx?: {width: number; height: number}\n shapes?: DisplayShape[]\n /** True ⇒ the device animates element transitions itself. */\n animation?: boolean\n /** Geometric and SVG rotations, including duration-based transitions. */\n rotation?: boolean\n /** Per-element stereo `depth` (a lens disparity) is honored; otherwise elements draw flat. */\n depth?: boolean\n intensityLevels?: number\n\n partialUpdate?: boolean\n /**\n * The views a miniapp may draw right now: \"main\" for every app, \"dashboard\"\n * (the overlay slot) only for the designated system dashboard app while the\n * glasses are eligible. Per app; filled in by the miniapp runtime.\n */\n views?: DisplayView[]\n}\n\nexport type DisplayView = \"main\" | \"dashboard\"\n\nexport type DisplayShape = \"rect\" | \"circle\" | \"arc\" | \"pie\" | \"line\" | \"triangle\" | \"quad\" | \"bezier\" | \"svg\"\n\n/** Every vector shape the Glassly CFW rasterizes on the glasses. */\nexport const ALL_DISPLAY_SHAPES: DisplayShape[] = [\"rect\", \"circle\", \"arc\", \"pie\", \"line\", \"triangle\", \"quad\", \"bezier\"]\n\n/**\n * Microphone capabilities\n */\nexport interface MicrophoneCapabilities {\n count?: number\n hasVAD?: boolean // Voice Activity Detection\n}\n\n/**\n * Speaker capabilities\n */\nexport interface SpeakerCapabilities {\n count?: number\n isPrivate?: boolean // e.g., bone conduction\n}\n\n/**\n * IMU (Inertial Measurement Unit) capabilities\n */\nexport interface IMUCapabilities {\n axisCount?: number\n hasAccelerometer?: boolean\n hasCompass?: boolean\n hasGyroscope?: boolean\n}\n\n/**\n * Button capabilities\n */\nexport interface ButtonCapabilities {\n count?: number\n buttons?: {\n type: \"press\" | \"swipe1d\" | \"swipe2d\"\n events: string[] // e.g., \"press\", \"double_press\", \"long_press\", \"swipe_up\", \"swipe_down\"\n isCapacitive?: boolean\n }[]\n}\n\n/**\n * Light capabilities\n */\nexport interface LightCapabilities {\n count?: number\n lights?: {\n id: string // Unique identifier for the LED (e.g., \"privacy\", \"user_feedback\")\n purpose: \"privacy\" | \"user_feedback\" | \"general\" // LED purpose/function\n isFullColor: boolean\n color?: string // e.g., \"white\", \"rgb\"\n position?: \"front_facing\" | \"user_facing\" | \"side\" | \"unknown\" // LED physical position\n }[]\n}\n\n/**\n * Power capabilities\n */\nexport interface PowerCapabilities {\n hasExternalBattery: boolean // e.g., a case or puck\n}\n\n/**\n * Device hardware capabilities\n * Complete information about what hardware a device has\n */\nexport interface Capabilities {\n modelName: string\n\n // Camera capabilities\n hasCamera: boolean\n camera: CameraCapabilities | null\n\n // Display capabilities\n hasDisplay: boolean\n display: DisplayCapabilities | null\n\n // Microphone capabilities\n hasMicrophone: boolean\n microphone: MicrophoneCapabilities | null\n\n // Speaker capabilities\n hasSpeaker: boolean\n speaker: SpeakerCapabilities | null\n\n // IMU capabilities\n hasIMU: boolean\n imu: IMUCapabilities | null\n\n // Button capabilities\n hasButton: boolean\n button: ButtonCapabilities | null\n\n // Light capabilities\n hasLight: boolean\n light: LightCapabilities | null\n\n // Power capabilities\n power: PowerCapabilities\n\n // WiFi capability\n hasWifi: boolean\n\n // OTA capability\n hasOta?: boolean\n\n // True when the app ships a flashable Glassly custom firmware for this\n // model, so pairing can offer to install it and Settings exposes the flasher\n hasCustomFirmware?: boolean\n\n // Native dashboard capability\n // True when the device renders its own dashboard in firmware (e.g. Even\n // Realities' built-in dashboard on G2). Glassly does not manage or expose\n // dashboard settings for these devices. Absent/false means Glassly owns the\n // dashboard.\n hasNativeDashboard?: boolean\n\n // True when the device renders its own turn-by-turn nav UI in firmware\n // (G2 nav mode: instruction card + map slots + magnetometer compass); nav\n // apps feed it structured fields and map bitmaps instead of scene elements\n hasNativeNavigation?: boolean\n\n // True when the firmware presents phone notifications itself (popup +\n // history) and takes a GlassesNotificationConfig. How it gets the content\n // (reading the phone's stream, or an upload from the phone) is the driver's\n // business; the engine only decides who presents.\n hasNativeNotifications?: boolean\n // Popup durations the firmware accepts, in seconds (0 = firmware default).\n // Drivers snap other values; the settings UI offers exactly these.\n nativeNotificationPopupSeconds?: number[]\n}\n\n/**\n * Hardware capability profiles for supported glasses models\n * Key: model_name string (e.g., \"Even Realities G1\", \"Mentra Live\")\n * Value: Capabilities object defining device features\n */\nexport const HARDWARE_CAPABILITIES: Record<string, Capabilities> = {\n [evenRealitiesG1.modelName]: evenRealitiesG1,\n [evenRealitiesG2.modelName]: evenRealitiesG2,\n [mentraDisplay.modelName]: mentraDisplay,\n [mentraLive.modelName]: mentraLive,\n [simulatedGlasses.modelName]: simulatedGlasses,\n [vuzixZ100.modelName]: vuzixZ100,\n [nimo.modelName]: nimo,\n [DeviceTypes.MACH1]: vuzixZ100, // Mach1 uses same Vuzix Ultralite hardware as Z100\n [nimo.modelName]: nimo,\n [DeviceTypes.AR99]: {\n ...evenRealitiesG1,\n modelName: DeviceTypes.AR99,\n display: {\n ...evenRealitiesG1.display,\n canDisplayBitmap: false,\n },\n hasMicrophone: true,\n hasOta: true,\n microphone: {\n count: 1,\n hasVAD: false,\n },\n },\n [none.modelName]: none,\n}\n\nexport const getModelCapabilities = (deviceType: DeviceTypes): Capabilities => {\n const modelName = deviceType as string\n if (!HARDWARE_CAPABILITIES[modelName]) {\n return HARDWARE_CAPABILITIES[DeviceTypes.NONE]\n }\n return HARDWARE_CAPABILITIES[modelName]\n}\n\n// export * from \"./capabilities\"\nexport {simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, vuzixZ100, mentraDisplay, nimo}\n"]}
|
package/build/types/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* are re-exported from @glassly/miniapp, their canonical owner. */
|
|
3
3
|
export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes } from "./enums";
|
|
4
4
|
export type { HardwareRequirement, CameraCapabilities, DisplayCapabilities, MicrophoneCapabilities, SpeakerCapabilities, IMUCapabilities, ButtonCapabilities, LightCapabilities, PowerCapabilities, Capabilities, } from "./hardware";
|
|
5
|
+
export { ALL_DISPLAY_SHAPES } from "./hardware";
|
|
5
6
|
export { HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, vuzixZ100, mentraDisplay, } from "./hardware";
|
|
6
7
|
export type { AppletType, AppPermissionType, AppletPermission, AppletInterface, ClientApp } from "./applet";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;mEACmE;AAGnE,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAG5F,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;mEACmE;AAGnE,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAG5F,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAA;AACnB,OAAO,EAAC,kBAAkB,EAAC,MAAM,YAAY,CAAA;AAE7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,IAAI,EACJ,SAAS,EACT,aAAa,GACd,MAAM,YAAY,CAAA;AAGnB,YAAY,EAAC,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAC,MAAM,UAAU,CAAA"}
|
package/build/types/index.js
CHANGED
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
* are re-exported from @glassly/miniapp, their canonical owner. */
|
|
3
3
|
// Enums (runtime values)
|
|
4
4
|
export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes } from "./enums";
|
|
5
|
+
export { ALL_DISPLAY_SHAPES } from "./hardware";
|
|
5
6
|
export { HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, vuzixZ100, mentraDisplay, } from "./hardware";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/build/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;mEACmE;AAEnE,yBAAyB;AACzB,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;mEACmE;AAEnE,yBAAyB;AACzB,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAe5F,OAAO,EAAC,kBAAkB,EAAC,MAAM,YAAY,CAAA;AAE7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,IAAI,EACJ,SAAS,EACT,aAAa,GACd,MAAM,YAAY,CAAA","sourcesContent":["/** Engine capability types and profiles. Miniapp manifest requirement types\n * are re-exported from @glassly/miniapp, their canonical owner. */\n\n// Enums (runtime values)\nexport {HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes} from \"./enums\"\n\n// Hardware types\nexport type {\n HardwareRequirement,\n CameraCapabilities,\n DisplayCapabilities,\n MicrophoneCapabilities,\n SpeakerCapabilities,\n IMUCapabilities,\n ButtonCapabilities,\n LightCapabilities,\n PowerCapabilities,\n Capabilities,\n} from \"./hardware\"\nexport {ALL_DISPLAY_SHAPES} from \"./hardware\"\n\nexport {\n HARDWARE_CAPABILITIES,\n getModelCapabilities,\n simulatedGlasses,\n evenRealitiesG1,\n evenRealitiesG2,\n mentraLive,\n nimo,\n vuzixZ100,\n mentraDisplay,\n} from \"./hardware\"\n\n// Applet types\nexport type {AppletType, AppPermissionType, AppletPermission, AppletInterface, ClientApp} from \"./applet\"\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Merge partial patches and flush once after `delayMs` of quiet time.
|
|
3
|
-
*
|
|
3
|
+
* Runs on BgTimer so a debounced write still lands while the app is
|
|
4
|
+
* backgrounded; off-Android (and under Jest) BgTimer falls through to the
|
|
5
|
+
* global timer, so fake timers can still advance it.
|
|
4
6
|
*/
|
|
5
7
|
export declare function createDebouncedPatchFlusher<T extends Record<string, unknown>>(flush: (patch: T) => void, delayMs: number): (patch: Partial<T>) => void;
|
|
6
8
|
//# sourceMappingURL=debouncedPatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debouncedPatch.d.ts","sourceRoot":"","sources":["../../src/utils/debouncedPatch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debouncedPatch.d.ts","sourceRoot":"","sources":["../../src/utils/debouncedPatch.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3E,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EACzB,OAAO,EAAE,MAAM,IASP,OAAO,OAAO,CAAC,CAAC,CAAC,UAY1B"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
import { BgTimer } from "./timers";
|
|
1
2
|
/**
|
|
2
3
|
* Merge partial patches and flush once after `delayMs` of quiet time.
|
|
3
|
-
*
|
|
4
|
+
* Runs on BgTimer so a debounced write still lands while the app is
|
|
5
|
+
* backgrounded; off-Android (and under Jest) BgTimer falls through to the
|
|
6
|
+
* global timer, so fake timers can still advance it.
|
|
4
7
|
*/
|
|
5
8
|
export function createDebouncedPatchFlusher(flush, delayMs) {
|
|
6
9
|
let pending = {};
|
|
7
10
|
let timer = null;
|
|
8
11
|
const schedule = (callback) => {
|
|
9
|
-
timer = setTimeout(callback, delayMs);
|
|
12
|
+
timer = BgTimer.setTimeout(callback, delayMs);
|
|
10
13
|
};
|
|
11
14
|
return (patch) => {
|
|
12
15
|
pending = { ...pending, ...patch };
|
|
13
16
|
if (timer != null) {
|
|
14
|
-
clearTimeout(timer);
|
|
17
|
+
BgTimer.clearTimeout(timer);
|
|
15
18
|
}
|
|
16
19
|
schedule(() => {
|
|
17
20
|
timer = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debouncedPatch.js","sourceRoot":"","sources":["../../src/utils/debouncedPatch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"debouncedPatch.js","sourceRoot":"","sources":["../../src/utils/debouncedPatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAA;AAEhC;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAAyB,EACzB,OAAe;IAEf,IAAI,OAAO,GAAG,EAAO,CAAA;IACrB,IAAI,KAAK,GAAkB,IAAI,CAAA;IAE/B,MAAM,QAAQ,GAAG,CAAC,QAAoB,EAAE,EAAE;QACxC,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC/C,CAAC,CAAA;IAED,OAAO,CAAC,KAAiB,EAAE,EAAE;QAC3B,OAAO,GAAG,EAAC,GAAG,OAAO,EAAE,GAAG,KAAK,EAAC,CAAA;QAChC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QAC7B,CAAC;QACD,QAAQ,CAAC,GAAG,EAAE;YACZ,KAAK,GAAG,IAAI,CAAA;YACZ,MAAM,KAAK,GAAG,OAAO,CAAA;YACrB,OAAO,GAAG,EAAO,CAAA;YACjB,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC;gBAAE,KAAK,CAAC,KAAK,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC","sourcesContent":["import {BgTimer} from \"./timers\"\n\n/**\n * Merge partial patches and flush once after `delayMs` of quiet time.\n * Runs on BgTimer so a debounced write still lands while the app is\n * backgrounded; off-Android (and under Jest) BgTimer falls through to the\n * global timer, so fake timers can still advance it.\n */\nexport function createDebouncedPatchFlusher<T extends Record<string, unknown>>(\n flush: (patch: T) => void,\n delayMs: number,\n) {\n let pending = {} as T\n let timer: number | null = null\n\n const schedule = (callback: () => void) => {\n timer = BgTimer.setTimeout(callback, delayMs)\n }\n\n return (patch: Partial<T>) => {\n pending = {...pending, ...patch}\n if (timer != null) {\n BgTimer.clearTimeout(timer)\n }\n schedule(() => {\n timer = null\n const batch = pending\n pending = {} as T\n if (Object.keys(batch).length > 0) flush(batch)\n })\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devMiniappLaunch.d.ts","sourceRoot":"","sources":["../../src/utils/devMiniappLaunch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"devMiniappLaunch.d.ts","sourceRoot":"","sources":["../../src/utils/devMiniappLaunch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAkBH,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,eAAe,GACvB;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAC,GAC9D;IAAC,QAAQ,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,SAAS,CAAA;CAAC,CAAA;AAElE,MAAM,MAAM,sBAAsB,GAAG;IACnC,gFAAgF;IAChF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAC1B,CAAA;AA4FD;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,eAAe,CAAC,CAoC1B"}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { configuredDevHost } from "./configuredDevHost";
|
|
22
22
|
import { storage } from "./storage/storage";
|
|
23
|
+
import { BgTimer } from "./timers";
|
|
23
24
|
const REACHABILITY_TIMEOUT_MS = 1500;
|
|
24
25
|
// A single dropped DNS lookup or momentary Wi-Fi blip (AP roam, DHCP renewal,
|
|
25
26
|
// phone hopping to cellular for a beat) looks identical to a dead dev server —
|
|
@@ -30,12 +31,12 @@ const REACHABILITY_TIMEOUT_MS = 1500;
|
|
|
30
31
|
const REACHABILITY_MAX_ATTEMPTS = 2;
|
|
31
32
|
const REACHABILITY_RETRY_DELAY_MS = 400;
|
|
32
33
|
function delay(ms) {
|
|
33
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
34
|
+
return new Promise((resolve) => BgTimer.setTimeout(resolve, ms));
|
|
34
35
|
}
|
|
35
36
|
/** Single GET <devUrl>/miniapp.json attempt with a hard timeout. */
|
|
36
37
|
async function fetchManifestOnce(devUrl) {
|
|
37
38
|
const controller = new AbortController();
|
|
38
|
-
const timer = setTimeout(() => controller.abort(), REACHABILITY_TIMEOUT_MS);
|
|
39
|
+
const timer = BgTimer.setTimeout(() => controller.abort(), REACHABILITY_TIMEOUT_MS);
|
|
39
40
|
try {
|
|
40
41
|
const res = await fetch(`${devUrl.replace(/\/$/, "")}/miniapp.json`, {
|
|
41
42
|
method: "GET",
|
|
@@ -46,7 +47,7 @@ async function fetchManifestOnce(devUrl) {
|
|
|
46
47
|
return (await res.json());
|
|
47
48
|
}
|
|
48
49
|
finally {
|
|
49
|
-
clearTimeout(timer);
|
|
50
|
+
BgTimer.clearTimeout(timer);
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
function rewriteHost(devUrl, host) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devMiniappLaunch.js","sourceRoot":"","sources":["../../src/utils/devMiniappLaunch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AACrD,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BACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAC,CAAA;IACrE,CAAC;IAED,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAA;AAC9C,CAAC","sourcesContent":["/**\n * decideDevLaunchRoute — pre-flight reachability + manifest fetch for dev\n * miniapp launches.\n *\n * Every entry point that wants to launch a dev miniapp (home tile, QR\n * scan, URL screen, dev-offline \"Try again\" button) calls this BEFORE\n * navigating, so:\n *\n * 1. We land on the right destination in a single transition\n * (live mount vs offline takeover) — no flash through /applet/local.\n * 2. Callers that need the manifest (permission gate, name/icon read)\n * get it in the same round trip — no second fetch.\n *\n * Pre-flighting at the call site keeps /applet/local a pure mount route.\n *\n * When the laptop's Wi-Fi IP changes, the URL stored from the last QR scan\n * goes stale. We then retry alternate hosts (Metro / EXPO_PUBLIC_LOCAL_MINIAPP_HOST,\n * plus an mDNS name captured at scan time) and persist the working URL so\n * the next launch doesn't need a re-scan.\n */\n\nimport {configuredDevHost} from \"./configuredDevHost\"\nimport {storage} from \"./storage/storage\"\n\nconst REACHABILITY_TIMEOUT_MS = 1500\n\n// A single dropped DNS lookup or momentary Wi-Fi blip (AP roam, DHCP renewal,\n// phone hopping to cellular for a beat) looks identical to a dead dev server —\n// both throw out of fetch(). Retrying once absorbs that transient case instead\n// of bouncing straight to the offline screen. We do NOT retry a real HTTP\n// response (res.ok === false): that's the server telling us something\n// definitive, not a network-layer hiccup.\nconst REACHABILITY_MAX_ATTEMPTS = 2\nconst REACHABILITY_RETRY_DELAY_MS = 400\n\nexport type DevManifest = {\n packageName?: string\n name?: string\n /** First-found of `icon` / `iconUrl` / `logoUrl` (relative or absolute). */\n icon?: string\n permissions?: unknown\n hardwareRequirements?: unknown\n [key: string]: unknown\n}\n\nexport type DevLaunchResult =\n | {decision: \"live\"; manifest: DevManifest; resolvedUrl: string}\n | {decision: \"offline\"; manifest: null; resolvedUrl?: undefined}\n\nexport type DecideDevLaunchOptions = {\n /** Extra hostnames / IPs to try if `devUrl` is unreachable (no scheme/port). */\n alternateHosts?: string[]\n}\n\nfunction delay(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\n/** Single GET <devUrl>/miniapp.json attempt with a hard timeout. */\nasync function fetchManifestOnce(devUrl: string): Promise<DevManifest | null> {\n const controller = new AbortController()\n const timer = setTimeout(() => controller.abort(), REACHABILITY_TIMEOUT_MS)\n try {\n const res = await fetch(`${devUrl.replace(/\\/$/, \"\")}/miniapp.json`, {\n method: \"GET\",\n signal: controller.signal,\n })\n if (!res.ok) return null\n return (await res.json()) as DevManifest\n } finally {\n clearTimeout(timer)\n }\n}\n\nfunction rewriteHost(devUrl: string, host: string): string | null {\n const trimmed = host.trim()\n if (!trimmed) return null\n try {\n const url = new URL(devUrl)\n if (url.hostname === trimmed) return null\n url.hostname = trimmed\n return url.toString().replace(/\\/$/, \"\")\n } catch {\n return null\n }\n}\n\n/**\n * Point an http(s) icon at the host that actually answered. Cached dev icons are\n * local `file://` paths and third-party icons live on unrelated hosts, so only\n * icons still served by the stale dev host are rewritten.\n */\nfunction rewriteIconHost(iconUrl: string, staleDevUrl: string, resolvedDevUrl: string): string | null {\n try {\n const icon = new URL(iconUrl)\n if (icon.protocol !== \"http:\" && icon.protocol !== \"https:\") return null\n const stale = new URL(staleDevUrl)\n const resolved = new URL(resolvedDevUrl)\n // Compare host (hostname+port) so an icon on the same hostname but a\n // different service port is left alone.\n if (icon.host !== stale.host) return null\n icon.host = resolved.host\n return icon.toString()\n } catch {\n return null\n }\n}\n\nfunction collectAlternateHosts(packageName: string, extra?: string[]): string[] {\n const hosts: string[] = []\n const push = (h: string | undefined | null) => {\n const v = h?.trim()\n if (v && !hosts.includes(v)) hosts.push(v)\n }\n\n push(configuredDevHost())\n\n if (packageName) {\n const mdns = storage.load<string>(`${packageName}_dev_mdns`)\n if (mdns.is_ok()) push(mdns.value)\n }\n\n for (const h of extra ?? []) push(h)\n return hosts\n}\n\nasync function probeUrl(devUrl: string): Promise<DevManifest | null | \"network-error\"> {\n for (let attempt = 1; attempt <= REACHABILITY_MAX_ATTEMPTS; attempt++) {\n try {\n const manifest = await fetchManifestOnce(devUrl)\n // Definitive HTTP failure — do not retry this URL further.\n if (!manifest) return null\n return manifest\n } catch {\n if (attempt < REACHABILITY_MAX_ATTEMPTS) {\n await delay(REACHABILITY_RETRY_DELAY_MS)\n continue\n }\n return \"network-error\"\n }\n }\n return \"network-error\"\n}\n\n/**\n * GET <devUrl>/miniapp.json with a hard timeout, retrying once on a\n * network-layer failure (DNS/connection/abort) before trying alternate\n * hosts (Metro laptop IP, mDNS name from the QR). Returns the parsed\n * manifest on success (\"live\") or null (\"offline\").\n *\n * Side effects on success:\n * - writes <packageName>_dev_last_reachable\n * - if an alternate host worked, rewrites <packageName>_dev_url so the\n * next launch skips the stale IP\n */\nexport async function decideDevLaunchRoute(\n packageName: string,\n devUrl: string,\n options?: DecideDevLaunchOptions,\n): Promise<DevLaunchResult> {\n const candidates: string[] = [devUrl]\n for (const host of collectAlternateHosts(packageName, options?.alternateHosts)) {\n const rewritten = rewriteHost(devUrl, host)\n if (rewritten && !candidates.includes(rewritten)) candidates.push(rewritten)\n }\n\n for (const candidate of candidates) {\n const result = await probeUrl(candidate)\n if (result === \"network-error\" || result === null) continue\n\n if (packageName) {\n storage.save(`${packageName}_dev_last_reachable`, Date.now())\n if (candidate !== devUrl) {\n storage.save(`${packageName}_dev_url`, candidate)\n // Keep _dev_meta.devUrl in sync when present so home-tile reads match.\n const metaRes = storage.load<string>(`${packageName}_dev_meta`)\n if (metaRes.is_ok()) {\n try {\n const meta = JSON.parse(metaRes.value) as {devUrl?: string; iconUrl?: string}\n meta.devUrl = candidate\n if (typeof meta.iconUrl === \"string\") {\n const rewritten = rewriteIconHost(meta.iconUrl, devUrl, candidate)\n if (rewritten) meta.iconUrl = rewritten\n }\n storage.save(`${packageName}_dev_meta`, JSON.stringify(meta))\n } catch {\n /* ignore malformed meta */\n }\n }\n }\n }\n return {decision: \"live\", manifest: result, resolvedUrl: candidate}\n }\n\n return {decision: \"offline\", manifest: null}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"devMiniappLaunch.js","sourceRoot":"","sources":["../../src/utils/devMiniappLaunch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAA;AAEzC,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAA;AAEhC,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAEpC,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,0EAA0E;AAC1E,sEAAsE;AACtE,0CAA0C;AAC1C,MAAM,yBAAyB,GAAG,CAAC,CAAA;AACnC,MAAM,2BAA2B,GAAG,GAAG,CAAA;AAqBvC,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;AAClE,CAAC;AAED,oEAAoE;AACpE,KAAK,UAAU,iBAAiB,CAAC,MAAc;IAC7C,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;IACxC,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,uBAAuB,CAAC,CAAA;IACnF,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,EAAE;YACnE,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,UAAU,CAAC,MAAM;SAC1B,CAAC,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IAAI,CAAC,MAAM,GAAG,SAAS,CAAA;wBACvB,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;4BACrC,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;4BAClE,IAAI,SAAS;gCAAE,IAAI,CAAC,OAAO,GAAG,SAAS,CAAA;wBACzC,CAAC;wBACD,OAAO,CAAC,IAAI,CAAC,GAAG,WAAW,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;oBAC/D,CAAC;oBAAC,MAAM,CAAC;wBACP,2BAA2B;oBAC7B,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAC,CAAA;IACrE,CAAC;IAED,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAA;AAC9C,CAAC","sourcesContent":["/**\n * decideDevLaunchRoute — pre-flight reachability + manifest fetch for dev\n * miniapp launches.\n *\n * Every entry point that wants to launch a dev miniapp (home tile, QR\n * scan, URL screen, dev-offline \"Try again\" button) calls this BEFORE\n * navigating, so:\n *\n * 1. We land on the right destination in a single transition\n * (live mount vs offline takeover) — no flash through /applet/local.\n * 2. Callers that need the manifest (permission gate, name/icon read)\n * get it in the same round trip — no second fetch.\n *\n * Pre-flighting at the call site keeps /applet/local a pure mount route.\n *\n * When the laptop's Wi-Fi IP changes, the URL stored from the last QR scan\n * goes stale. We then retry alternate hosts (Metro / EXPO_PUBLIC_LOCAL_MINIAPP_HOST,\n * plus an mDNS name captured at scan time) and persist the working URL so\n * the next launch doesn't need a re-scan.\n */\n\nimport {configuredDevHost} from \"./configuredDevHost\"\nimport {storage} from \"./storage/storage\"\n\nimport {BgTimer} from \"./timers\"\n\nconst REACHABILITY_TIMEOUT_MS = 1500\n\n// A single dropped DNS lookup or momentary Wi-Fi blip (AP roam, DHCP renewal,\n// phone hopping to cellular for a beat) looks identical to a dead dev server —\n// both throw out of fetch(). Retrying once absorbs that transient case instead\n// of bouncing straight to the offline screen. We do NOT retry a real HTTP\n// response (res.ok === false): that's the server telling us something\n// definitive, not a network-layer hiccup.\nconst REACHABILITY_MAX_ATTEMPTS = 2\nconst REACHABILITY_RETRY_DELAY_MS = 400\n\nexport type DevManifest = {\n packageName?: string\n name?: string\n /** First-found of `icon` / `iconUrl` / `logoUrl` (relative or absolute). */\n icon?: string\n permissions?: unknown\n hardwareRequirements?: unknown\n [key: string]: unknown\n}\n\nexport type DevLaunchResult =\n | {decision: \"live\"; manifest: DevManifest; resolvedUrl: string}\n | {decision: \"offline\"; manifest: null; resolvedUrl?: undefined}\n\nexport type DecideDevLaunchOptions = {\n /** Extra hostnames / IPs to try if `devUrl` is unreachable (no scheme/port). */\n alternateHosts?: string[]\n}\n\nfunction delay(ms: number): Promise<void> {\n return new Promise((resolve) => BgTimer.setTimeout(resolve, ms))\n}\n\n/** Single GET <devUrl>/miniapp.json attempt with a hard timeout. */\nasync function fetchManifestOnce(devUrl: string): Promise<DevManifest | null> {\n const controller = new AbortController()\n const timer = BgTimer.setTimeout(() => controller.abort(), REACHABILITY_TIMEOUT_MS)\n try {\n const res = await fetch(`${devUrl.replace(/\\/$/, \"\")}/miniapp.json`, {\n method: \"GET\",\n signal: controller.signal,\n })\n if (!res.ok) return null\n return (await res.json()) as DevManifest\n } finally {\n BgTimer.clearTimeout(timer)\n }\n}\n\nfunction rewriteHost(devUrl: string, host: string): string | null {\n const trimmed = host.trim()\n if (!trimmed) return null\n try {\n const url = new URL(devUrl)\n if (url.hostname === trimmed) return null\n url.hostname = trimmed\n return url.toString().replace(/\\/$/, \"\")\n } catch {\n return null\n }\n}\n\n/**\n * Point an http(s) icon at the host that actually answered. Cached dev icons are\n * local `file://` paths and third-party icons live on unrelated hosts, so only\n * icons still served by the stale dev host are rewritten.\n */\nfunction rewriteIconHost(iconUrl: string, staleDevUrl: string, resolvedDevUrl: string): string | null {\n try {\n const icon = new URL(iconUrl)\n if (icon.protocol !== \"http:\" && icon.protocol !== \"https:\") return null\n const stale = new URL(staleDevUrl)\n const resolved = new URL(resolvedDevUrl)\n // Compare host (hostname+port) so an icon on the same hostname but a\n // different service port is left alone.\n if (icon.host !== stale.host) return null\n icon.host = resolved.host\n return icon.toString()\n } catch {\n return null\n }\n}\n\nfunction collectAlternateHosts(packageName: string, extra?: string[]): string[] {\n const hosts: string[] = []\n const push = (h: string | undefined | null) => {\n const v = h?.trim()\n if (v && !hosts.includes(v)) hosts.push(v)\n }\n\n push(configuredDevHost())\n\n if (packageName) {\n const mdns = storage.load<string>(`${packageName}_dev_mdns`)\n if (mdns.is_ok()) push(mdns.value)\n }\n\n for (const h of extra ?? []) push(h)\n return hosts\n}\n\nasync function probeUrl(devUrl: string): Promise<DevManifest | null | \"network-error\"> {\n for (let attempt = 1; attempt <= REACHABILITY_MAX_ATTEMPTS; attempt++) {\n try {\n const manifest = await fetchManifestOnce(devUrl)\n // Definitive HTTP failure — do not retry this URL further.\n if (!manifest) return null\n return manifest\n } catch {\n if (attempt < REACHABILITY_MAX_ATTEMPTS) {\n await delay(REACHABILITY_RETRY_DELAY_MS)\n continue\n }\n return \"network-error\"\n }\n }\n return \"network-error\"\n}\n\n/**\n * GET <devUrl>/miniapp.json with a hard timeout, retrying once on a\n * network-layer failure (DNS/connection/abort) before trying alternate\n * hosts (Metro laptop IP, mDNS name from the QR). Returns the parsed\n * manifest on success (\"live\") or null (\"offline\").\n *\n * Side effects on success:\n * - writes <packageName>_dev_last_reachable\n * - if an alternate host worked, rewrites <packageName>_dev_url so the\n * next launch skips the stale IP\n */\nexport async function decideDevLaunchRoute(\n packageName: string,\n devUrl: string,\n options?: DecideDevLaunchOptions,\n): Promise<DevLaunchResult> {\n const candidates: string[] = [devUrl]\n for (const host of collectAlternateHosts(packageName, options?.alternateHosts)) {\n const rewritten = rewriteHost(devUrl, host)\n if (rewritten && !candidates.includes(rewritten)) candidates.push(rewritten)\n }\n\n for (const candidate of candidates) {\n const result = await probeUrl(candidate)\n if (result === \"network-error\" || result === null) continue\n\n if (packageName) {\n storage.save(`${packageName}_dev_last_reachable`, Date.now())\n if (candidate !== devUrl) {\n storage.save(`${packageName}_dev_url`, candidate)\n // Keep _dev_meta.devUrl in sync when present so home-tile reads match.\n const metaRes = storage.load<string>(`${packageName}_dev_meta`)\n if (metaRes.is_ok()) {\n try {\n const meta = JSON.parse(metaRes.value) as {devUrl?: string; iconUrl?: string}\n meta.devUrl = candidate\n if (typeof meta.iconUrl === \"string\") {\n const rewritten = rewriteIconHost(meta.iconUrl, devUrl, candidate)\n if (rewritten) meta.iconUrl = rewritten\n }\n storage.save(`${packageName}_dev_meta`, JSON.stringify(meta))\n } catch {\n /* ignore malformed meta */\n }\n }\n }\n }\n return {decision: \"live\", manifest: result, resolvedUrl: candidate}\n }\n\n return {decision: \"offline\", manifest: null}\n}\n"]}
|
|
@@ -1,160 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Character measurement result with detailed breakdown.
|
|
4
|
-
*/
|
|
5
|
-
export interface CharMeasurement {
|
|
6
|
-
/** The character measured */
|
|
7
|
-
char: string;
|
|
8
|
-
/** Width in rendered pixels */
|
|
9
|
-
widthPx: number;
|
|
10
|
-
/** The script type of the character */
|
|
11
|
-
script: ScriptType;
|
|
12
|
-
/** Whether width came from glyph map (true) or fallback (false) */
|
|
13
|
-
fromGlyphMap: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Text measurement result with detailed breakdown.
|
|
17
|
-
*/
|
|
18
|
-
export interface TextMeasurement {
|
|
19
|
-
/** The text measured */
|
|
20
|
-
text: string;
|
|
21
|
-
/** Total width in rendered pixels */
|
|
22
|
-
totalWidthPx: number;
|
|
23
|
-
/** Number of characters */
|
|
24
|
-
charCount: number;
|
|
25
|
-
/** Per-character measurements (optional, for debugging) */
|
|
26
|
-
chars?: CharMeasurement[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Measures text width in pixels based on a DisplayProfile.
|
|
30
|
-
* All measurements are in actual rendered pixels, not abstract units.
|
|
31
|
-
*
|
|
32
|
-
* Key features:
|
|
33
|
-
* - Pixel-perfect measurement for mapped characters
|
|
34
|
-
* - Uniform-width handling for CJK, Korean, Cyrillic
|
|
35
|
-
* - Safe fallback for unmapped Latin characters
|
|
36
|
-
* - Caching for performance
|
|
37
|
-
*/
|
|
38
|
-
export declare class TextMeasurer {
|
|
39
|
-
private readonly profile;
|
|
40
|
-
private readonly charCache;
|
|
41
|
-
constructor(profile: DisplayProfile);
|
|
42
|
-
/**
|
|
43
|
-
* Pre-compute rendered widths for all known glyphs.
|
|
44
|
-
*/
|
|
45
|
-
private buildCharCache;
|
|
46
|
-
/**
|
|
47
|
-
* Measure the total pixel width of a text string.
|
|
48
|
-
*
|
|
49
|
-
* @param text - The text to measure
|
|
50
|
-
* @returns Width in rendered pixels
|
|
51
|
-
*/
|
|
52
|
-
measureText(text: string): number;
|
|
53
|
-
/**
|
|
54
|
-
* Measure text with detailed breakdown of each character.
|
|
55
|
-
*
|
|
56
|
-
* @param text - The text to measure
|
|
57
|
-
* @returns Detailed measurement result
|
|
58
|
-
*/
|
|
59
|
-
measureTextDetailed(text: string): TextMeasurement;
|
|
60
|
-
/**
|
|
61
|
-
* Measure a single character's pixel width.
|
|
62
|
-
*
|
|
63
|
-
* IMPORTANT: This is PIXEL-PERFECT measurement, not averaging!
|
|
64
|
-
* - Mapped characters: exact width from glyph map
|
|
65
|
-
* - Uniform scripts (CJK, Korean, Cyrillic): verified uniform width
|
|
66
|
-
* - Unmapped Latin: MAX width fallback (safe, never overflow)
|
|
67
|
-
*
|
|
68
|
-
* @param char - Single character to measure
|
|
69
|
-
* @returns Width in rendered pixels
|
|
70
|
-
*/
|
|
71
|
-
measureChar(char: string): number;
|
|
72
|
-
/**
|
|
73
|
-
* Calculate character width (called when not in cache).
|
|
74
|
-
*/
|
|
75
|
-
private calculateCharWidth;
|
|
76
|
-
/**
|
|
77
|
-
* Get the raw glyph width (before render formula).
|
|
78
|
-
* Returns undefined for unmapped characters.
|
|
79
|
-
*
|
|
80
|
-
* @param char - Single character
|
|
81
|
-
* @returns Glyph width in pixels, or undefined if not in glyph map
|
|
82
|
-
*/
|
|
83
|
-
getGlyphWidth(char: string): number | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* Check if text fits within a pixel width.
|
|
86
|
-
*
|
|
87
|
-
* @param text - Text to check
|
|
88
|
-
* @param maxWidthPx - Maximum width in pixels
|
|
89
|
-
* @returns true if text fits
|
|
90
|
-
*/
|
|
91
|
-
fitsInWidth(text: string, maxWidthPx: number): boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Find how many characters fit within a pixel width.
|
|
94
|
-
*
|
|
95
|
-
* @param text - Text to measure
|
|
96
|
-
* @param maxWidthPx - Maximum width in pixels
|
|
97
|
-
* @param startIndex - Starting index (default: 0)
|
|
98
|
-
* @returns Number of characters that fit
|
|
99
|
-
*/
|
|
100
|
-
charsThatFit(text: string, maxWidthPx: number, startIndex?: number): number;
|
|
101
|
-
/**
|
|
102
|
-
* Find the pixel position of a character index in text.
|
|
103
|
-
*
|
|
104
|
-
* @param text - Text to measure
|
|
105
|
-
* @param index - Character index
|
|
106
|
-
* @returns Pixel offset from start of text
|
|
107
|
-
*/
|
|
108
|
-
getPixelOffset(text: string, index: number): number;
|
|
109
|
-
/**
|
|
110
|
-
* Detect the script type of a character.
|
|
111
|
-
*
|
|
112
|
-
* @param char - Single character
|
|
113
|
-
* @returns Script type
|
|
114
|
-
*/
|
|
115
|
-
detectScript(char: string): ScriptType;
|
|
116
|
-
/**
|
|
117
|
-
* Check if a character is from a uniform-width script.
|
|
118
|
-
*
|
|
119
|
-
* @param char - Single character
|
|
120
|
-
* @returns true if character is from CJK, Korean, or Cyrillic
|
|
121
|
-
*/
|
|
122
|
-
isUniformWidth(char: string): boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Get the display profile.
|
|
125
|
-
*/
|
|
126
|
-
getProfile(): DisplayProfile;
|
|
127
|
-
/**
|
|
128
|
-
* Get the display width in pixels.
|
|
129
|
-
*/
|
|
130
|
-
getDisplayWidthPx(): number;
|
|
131
|
-
/**
|
|
132
|
-
* Get the maximum number of lines.
|
|
133
|
-
*/
|
|
134
|
-
getMaxLines(): number;
|
|
135
|
-
/**
|
|
136
|
-
* Get the maximum payload size in bytes.
|
|
137
|
-
*/
|
|
138
|
-
getMaxPayloadBytes(): number;
|
|
139
|
-
/**
|
|
140
|
-
* Calculate the UTF-8 byte size of text.
|
|
141
|
-
*
|
|
142
|
-
* @param text - Text to measure
|
|
143
|
-
* @returns Byte size
|
|
144
|
-
*/
|
|
145
|
-
getByteSize(text: string): number;
|
|
146
|
-
/**
|
|
147
|
-
* Get the width of a hyphen character in rendered pixels.
|
|
148
|
-
*/
|
|
149
|
-
getHyphenWidth(): number;
|
|
150
|
-
/**
|
|
151
|
-
* Get the width of a space character in rendered pixels.
|
|
152
|
-
*/
|
|
153
|
-
getSpaceWidth(): number;
|
|
154
|
-
/**
|
|
155
|
-
* Clear the character cache.
|
|
156
|
-
* Useful if profile metrics change at runtime.
|
|
157
|
-
*/
|
|
158
|
-
clearCache(): void;
|
|
159
|
-
}
|
|
1
|
+
export { TextMeasurer } from "@glassly/miniapp/display";
|
|
2
|
+
export type { CharMeasurement, TextMeasurement } from "@glassly/miniapp/display";
|
|
160
3
|
//# sourceMappingURL=TextMeasurer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextMeasurer.d.ts","sourceRoot":"","sources":["../../../../src/utils/display/measurer/TextMeasurer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextMeasurer.d.ts","sourceRoot":"","sources":["../../../../src/utils/display/measurer/TextMeasurer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAA;AACrD,YAAY,EAAC,eAAe,EAAE,eAAe,EAAC,MAAM,0BAA0B,CAAA"}
|