@luxonis/depthai-viewer-common 3.8.1 → 3.8.3
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 +104 -11
- package/dist/components/CTASubLabel.d.ts +10 -2
- package/dist/components/CTASubLabel.d.ts.map +1 -1
- package/dist/components/CTASubLabel.js +3 -0
- package/dist/components/CTASubLabel.js.map +1 -1
- package/dist/components/DepthAIContext.d.ts +25 -2
- package/dist/components/DepthAIContext.d.ts.map +1 -1
- package/dist/components/DepthAIContext.js +3 -0
- package/dist/components/DepthAIContext.js.map +1 -1
- package/dist/components/Pipeline.d.ts +19 -2
- package/dist/components/Pipeline.d.ts.map +1 -1
- package/dist/components/Pipeline.js +12 -0
- package/dist/components/Pipeline.js.map +1 -1
- package/dist/components/Resizable.d.ts +20 -0
- package/dist/components/Resizable.d.ts.map +1 -1
- package/dist/components/Resizable.js +8 -0
- package/dist/components/Resizable.js.map +1 -1
- package/dist/components/Streams.d.ts +100 -4
- package/dist/components/Streams.d.ts.map +1 -1
- package/dist/components/Streams.js +78 -17
- package/dist/components/Streams.js.map +1 -1
- package/dist/components/ThemeToggle.d.ts +8 -0
- package/dist/components/ThemeToggle.d.ts.map +1 -1
- package/dist/components/ThemeToggle.js +8 -0
- package/dist/components/ThemeToggle.js.map +1 -1
- package/dist/constants/connection.d.ts +27 -0
- package/dist/constants/connection.d.ts.map +1 -1
- package/dist/constants/connection.js +12 -0
- package/dist/constants/connection.js.map +1 -1
- package/dist/constants/streams.d.ts +9 -0
- package/dist/constants/streams.d.ts.map +1 -1
- package/dist/constants/streams.js +6 -0
- package/dist/constants/streams.js.map +1 -1
- package/dist/constants/url.d.ts +12 -0
- package/dist/constants/url.d.ts.map +1 -1
- package/dist/constants/url.js +12 -0
- package/dist/constants/url.js.map +1 -1
- package/dist/dai-connection/connection.d.ts +189 -2
- package/dist/dai-connection/connection.d.ts.map +1 -1
- package/dist/dai-connection/connection.js +121 -5
- package/dist/dai-connection/connection.js.map +1 -1
- package/dist/dai-connection/decoder.worker.d.ts +21 -0
- package/dist/dai-connection/decoder.worker.d.ts.map +1 -1
- package/dist/dai-connection/decoder.worker.js +6 -0
- package/dist/dai-connection/decoder.worker.js.map +1 -1
- package/dist/hooks/connection.d.ts +206 -0
- package/dist/hooks/connection.d.ts.map +1 -1
- package/dist/hooks/connection.js +22 -0
- package/dist/hooks/connection.js.map +1 -1
- package/dist/hooks/navigation.d.ts +5 -0
- package/dist/hooks/navigation.d.ts.map +1 -1
- package/dist/hooks/navigation.js +5 -0
- package/dist/hooks/navigation.js.map +1 -1
- package/dist/hooks/search.d.ts +12 -0
- package/dist/hooks/search.d.ts.map +1 -1
- package/dist/hooks/search.js +3 -0
- package/dist/hooks/search.js.map +1 -1
- package/dist/hooks/useFullScreen.d.ts +8 -0
- package/dist/hooks/useFullScreen.d.ts.map +1 -1
- package/dist/hooks/useFullScreen.js +8 -0
- package/dist/hooks/useFullScreen.js.map +1 -1
- package/dist/index.css +9 -9
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/models/device-configuration.d.ts +69 -0
- package/dist/models/device-configuration.d.ts.map +1 -1
- package/dist/models/device-configuration.js +21 -0
- package/dist/models/device-configuration.js.map +1 -1
- package/dist/providers/ConnectionProvider.d.ts +56 -2
- package/dist/providers/ConnectionProvider.d.ts.map +1 -1
- package/dist/providers/ConnectionProvider.js +26 -0
- package/dist/providers/ConnectionProvider.js.map +1 -1
- package/dist/providers/DataProvider.d.ts +129 -0
- package/dist/providers/DataProvider.d.ts.map +1 -1
- package/dist/providers/DataProvider.js +21 -0
- package/dist/providers/DataProvider.js.map +1 -1
- package/dist/providers/ThemeProvider.d.ts +67 -7
- package/dist/providers/ThemeProvider.d.ts.map +1 -1
- package/dist/providers/ThemeProvider.js +39 -2
- package/dist/providers/ThemeProvider.js.map +1 -1
- package/dist/providers/VisualizerRuntimeConfigProvider.d.ts +43 -3
- package/dist/providers/VisualizerRuntimeConfigProvider.d.ts.map +1 -1
- package/dist/providers/VisualizerRuntimeConfigProvider.js +20 -3
- package/dist/providers/VisualizerRuntimeConfigProvider.js.map +1 -1
- package/dist/utils/arrays.d.ts +7 -0
- package/dist/utils/arrays.d.ts.map +1 -1
- package/dist/utils/arrays.js +7 -0
- package/dist/utils/arrays.js.map +1 -1
- package/dist/utils/functions.d.ts +3 -0
- package/dist/utils/functions.d.ts.map +1 -1
- package/dist/utils/functions.js +3 -0
- package/dist/utils/functions.js.map +1 -1
- package/dist/utils/local-storage.d.ts +20 -0
- package/dist/utils/local-storage.d.ts.map +1 -1
- package/dist/utils/local-storage.js +17 -0
- package/dist/utils/local-storage.js.map +1 -1
- package/dist/utils/logger.d.ts +31 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +36 -7
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/sorting.d.ts +6 -0
- package/dist/utils/sorting.d.ts.map +1 -1
- package/dist/utils/sorting.js +6 -0
- package/dist/utils/sorting.js.map +1 -1
- package/dist/utils/topic.d.ts +6 -0
- package/dist/utils/topic.d.ts.map +1 -1
- package/dist/utils/topic.js +3 -0
- package/dist/utils/topic.js.map +1 -1
- package/dist/utils/units.d.ts +24 -0
- package/dist/utils/units.d.ts.map +1 -1
- package/dist/utils/units.js +24 -0
- package/dist/utils/units.js.map +1 -1
- package/dist/utils/url.d.ts +9 -0
- package/dist/utils/url.d.ts.map +1 -1
- package/dist/utils/url.js +10 -1
- package/dist/utils/url.js.map +1 -1
- package/dist/utils/vite-dev-fix.d.ts +13 -0
- package/dist/utils/vite-dev-fix.d.ts.map +1 -1
- package/dist/utils/vite-dev-fix.js +13 -0
- package/dist/utils/vite-dev-fix.js.map +1 -1
- package/dist/visualizer/components/Panel.js +1 -1
- package/dist/visualizer/components/Panel.js.map +1 -1
- package/dist/visualizer/messaging/decoder-fixtures.d.ts.map +1 -1
- package/dist/visualizer/messaging/decoder-fixtures.js +8 -2
- package/dist/visualizer/messaging/decoder-fixtures.js.map +1 -1
- package/dist/visualizer/messaging/deserialization/detections/constants.d.ts +1 -0
- package/dist/visualizer/messaging/deserialization/detections/constants.d.ts.map +1 -1
- package/dist/visualizer/messaging/deserialization/detections/constants.js +1 -0
- package/dist/visualizer/messaging/deserialization/detections/constants.js.map +1 -1
- package/dist/visualizer/messaging/deserialization/detections/custom.d.ts.map +1 -1
- package/dist/visualizer/messaging/deserialization/detections/custom.js +2 -2
- package/dist/visualizer/messaging/deserialization/detections/custom.js.map +1 -1
- package/dist/visualizer/messaging/deserialization/detections/detection.d.ts.map +1 -1
- package/dist/visualizer/messaging/deserialization/detections/detection.js +2 -2
- package/dist/visualizer/messaging/deserialization/detections/detection.js.map +1 -1
- package/dist/visualizer/messaging/utils.d.ts +1 -0
- package/dist/visualizer/messaging/utils.d.ts.map +1 -1
- package/dist/visualizer/messaging/utils.js +8 -6
- package/dist/visualizer/messaging/utils.js.map +1 -1
- package/dist/visualizer/output.css +18 -18
- package/dist/visualizer/panels/image/ImageCanvasRenderer.d.ts.map +1 -1
- package/dist/visualizer/panels/image/ImageCanvasRenderer.js +4 -1
- package/dist/visualizer/panels/image/ImageCanvasRenderer.js.map +1 -1
- package/dist/visualizer/panels/image/annotation-overlay.d.ts.map +1 -1
- package/dist/visualizer/panels/image/annotation-overlay.js +16 -5
- package/dist/visualizer/panels/image/annotation-overlay.js.map +1 -1
- package/package.json +2 -2
- package/protobuf-gen.sh +60 -3
|
@@ -2,19 +2,37 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { noop } from '../utils/functions.js';
|
|
4
4
|
import { getItemFromLocalStorage, setItemToLocalStorage } from '../utils/local-storage.js';
|
|
5
|
+
/**
|
|
6
|
+
* Supported theme preferences shown by the theme picker.
|
|
7
|
+
*/
|
|
5
8
|
export const THEME_PREFERENCES = ['light', 'dark', 'system'];
|
|
6
9
|
const DARK_CLASS = 'dark';
|
|
7
10
|
const COLOR_SCHEME_QUERY = '(prefers-color-scheme: dark)';
|
|
8
11
|
const isThemePreference = (value) => THEME_PREFERENCES.includes(value);
|
|
9
12
|
const prefersDark = () => typeof window !== 'undefined' && window.matchMedia(COLOR_SCHEME_QUERY).matches;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves a user theme preference into the theme currently rendered by the UI.
|
|
15
|
+
*
|
|
16
|
+
* @param preference - User-selected theme preference.
|
|
17
|
+
* @returns Concrete light or dark theme.
|
|
18
|
+
*/
|
|
10
19
|
export const resolveTheme = (preference) => preference === 'system' ? (prefersDark() ? 'dark' : 'light') : preference;
|
|
20
|
+
/**
|
|
21
|
+
* Reads the stored theme preference from local storage.
|
|
22
|
+
*
|
|
23
|
+
* @returns Stored theme preference, or `system` when the stored value is missing or invalid.
|
|
24
|
+
*/
|
|
11
25
|
export const readStoredTheme = () => {
|
|
12
26
|
const stored = getItemFromLocalStorage('theme');
|
|
13
27
|
return isThemePreference(stored) ? stored : 'system';
|
|
14
28
|
};
|
|
15
29
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
30
|
+
* Applies a resolved theme to the document root.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* This toggles the `dark` class on `document.documentElement`. It is used both from
|
|
34
|
+
* React and from the inline bootstrap script in `index.html`, which runs before first
|
|
35
|
+
* paint so the app never flashes the light theme on load.
|
|
18
36
|
*/
|
|
19
37
|
export const applyTheme = (theme) => {
|
|
20
38
|
document.documentElement.classList.toggle(DARK_CLASS, theme === 'dark');
|
|
@@ -25,7 +43,26 @@ const ThemeContext = React.createContext({
|
|
|
25
43
|
setTheme: noop,
|
|
26
44
|
toggleTheme: noop,
|
|
27
45
|
});
|
|
46
|
+
/**
|
|
47
|
+
* Returns the current theme context.
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Outside {@link ThemeProvider}, this hook returns the default system/light context.
|
|
51
|
+
*/
|
|
28
52
|
export const useTheme = () => React.useContext(ThemeContext);
|
|
53
|
+
/**
|
|
54
|
+
* Provides shared theme state and keeps DOM/local storage in sync.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* The provider reads the initial preference from local storage, follows OS theme changes
|
|
58
|
+
* while the preference is `system`, persists explicit user changes, and applies the
|
|
59
|
+
* resolved theme to the document root.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* <ThemeProvider>{children}</ThemeProvider>
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
29
66
|
export const ThemeProvider = ({ children }) => {
|
|
30
67
|
const [theme, setThemeState] = React.useState(readStoredTheme);
|
|
31
68
|
const [systemTheme, setSystemTheme] = React.useState(() => prefersDark() ? 'dark' : 'light');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../src/providers/ThemeProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../src/providers/ThemeProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAe3F;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEhF,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,kBAAkB,GAAG,8BAA8B,CAAC;AAE1D,MAAM,iBAAiB,GAAG,CAAC,KAAc,EAA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AC,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE9B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,EACvD,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,CAAC,CAC7C,CAAC;IAEF,OAAO,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAyB,CAAC;AAChF,CAAC,CAAC"}
|
|
@@ -1,17 +1,57 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type RuntimeConfig } from '../visualizer/index.js';
|
|
3
3
|
export declare const STREAM_DIAGNOSTICS_LOCAL_STORAGE_KEY: "viewer-stream-diagnostics-enabled";
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Runtime configuration state exposed to visualizer consumers.
|
|
6
|
+
*/
|
|
7
|
+
export type VisualizerRuntimeConfigContextValue = {
|
|
8
|
+
/**
|
|
9
|
+
* Current immutable visualizer runtime configuration.
|
|
10
|
+
*/
|
|
5
11
|
runtimeConfig: Readonly<RuntimeConfig>;
|
|
12
|
+
/**
|
|
13
|
+
* Merges a partial runtime configuration into the current value.
|
|
14
|
+
*/
|
|
6
15
|
updateRuntimeConfig: (runtimeConfig: Readonly<RuntimeConfig>) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Updates the maximum expected stereo depth value in millimeters.
|
|
18
|
+
*/
|
|
7
19
|
setStereoDepthMaxValue: (value: number | undefined) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Enables or disables perspective rendering for point cloud panels.
|
|
22
|
+
*/
|
|
8
23
|
setPerspective: (value: boolean | undefined) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Updates neural camera intrinsics used by depth and point cloud decoding.
|
|
26
|
+
*/
|
|
9
27
|
setNeuralCameraIntrinsics: (value: RuntimeConfig['neuralCameraIntrinsics']) => void;
|
|
10
28
|
};
|
|
11
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Props for the visualizer runtime configuration provider.
|
|
31
|
+
*/
|
|
32
|
+
export type VisualizerRuntimeConfigProviderProps = React.PropsWithChildren<{
|
|
33
|
+
/**
|
|
34
|
+
* Runtime configuration applied on initial render before any user changes.
|
|
35
|
+
*/
|
|
12
36
|
initialRuntimeConfig?: Readonly<RuntimeConfig>;
|
|
13
37
|
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Provides visualizer runtime settings and synchronizes them with the shared visualizer runtime store.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* Initial values are merged with persisted runtime settings, then updates are mirrored
|
|
43
|
+
* into the visualizer runtime store used by stream panels.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <VisualizerRuntimeConfigProvider initialRuntimeConfig={{ debugLogs: true }}>
|
|
48
|
+
* {children}
|
|
49
|
+
* </VisualizerRuntimeConfigProvider>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
14
52
|
export declare const VisualizerRuntimeConfigProvider: React.FC<VisualizerRuntimeConfigProviderProps>;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the current visualizer runtime configuration context.
|
|
55
|
+
*/
|
|
15
56
|
export declare function useVisualizerRuntimeConfig(): VisualizerRuntimeConfigContextValue;
|
|
16
|
-
export {};
|
|
17
57
|
//# sourceMappingURL=VisualizerRuntimeConfigProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisualizerRuntimeConfigProvider.d.ts","sourceRoot":"","sources":["../../src/providers/VisualizerRuntimeConfigProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEN,KAAK,aAAa,EAClB,MAAM,wBAAwB,CAAC;AAGhC,eAAO,MAAM,oCAAoC,EAAG,mCAA4C,CAAC;AAGjG,
|
|
1
|
+
{"version":3,"file":"VisualizerRuntimeConfigProvider.d.ts","sourceRoot":"","sources":["../../src/providers/VisualizerRuntimeConfigProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEN,KAAK,aAAa,EAClB,MAAM,wBAAwB,CAAC;AAGhC,eAAO,MAAM,oCAAoC,EAAG,mCAA4C,CAAC;AAGjG;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG;IACjD;;OAEG;IACH,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IACvC;;OAEG;IACH,mBAAmB,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IACtE;;OAEG;IACH,sBAAsB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,KAAK,IAAI,CAAC;IACrD;;OAEG;IACH,yBAAyB,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,wBAAwB,CAAC,KAAK,IAAI,CAAC;CACpF,CAAC;AA2BF;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG,KAAK,CAAC,iBAAiB,CAAC;IAC1E;;OAEG;IACH,oBAAoB,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;CAC/C,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,+BAA+B,EAAE,KAAK,CAAC,EAAE,CAAC,oCAAoC,CAkF1F,CAAC;AAEF;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,mCAAmC,CAEhF"}
|
|
@@ -17,7 +17,7 @@ function readPersistedStreamDiagnostics() {
|
|
|
17
17
|
}
|
|
18
18
|
function readPersistedStereoDepthMaxValue() {
|
|
19
19
|
const rawValue = globalThis.localStorage?.getItem(STEREO_DEPTH_MAX_VALUE_STORAGE_KEY);
|
|
20
|
-
// biome-ignore lint/suspicious/noDoubleEquals:
|
|
20
|
+
// biome-ignore lint/suspicious/noDoubleEquals: Treat null and undefined as missing persisted data.
|
|
21
21
|
if (rawValue == undefined) {
|
|
22
22
|
return undefined;
|
|
23
23
|
}
|
|
@@ -26,6 +26,20 @@ function readPersistedStereoDepthMaxValue() {
|
|
|
26
26
|
? parsedValue
|
|
27
27
|
: DEFAULT_STEREO_DEPTH_MAX_VALUE;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Provides visualizer runtime settings and synchronizes them with the shared visualizer runtime store.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Initial values are merged with persisted runtime settings, then updates are mirrored
|
|
34
|
+
* into the visualizer runtime store used by stream panels.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <VisualizerRuntimeConfigProvider initialRuntimeConfig={{ debugLogs: true }}>
|
|
39
|
+
* {children}
|
|
40
|
+
* </VisualizerRuntimeConfigProvider>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
29
43
|
export const VisualizerRuntimeConfigProvider = ({ children, initialRuntimeConfig, }) => {
|
|
30
44
|
const [runtimeConfig, setRuntimeConfigState] = React.useState(() => ({
|
|
31
45
|
stereoDepthMaxValue: initialRuntimeConfig?.stereoDepthMaxValue ?? readPersistedStereoDepthMaxValue(),
|
|
@@ -35,7 +49,7 @@ export const VisualizerRuntimeConfigProvider = ({ children, initialRuntimeConfig
|
|
|
35
49
|
streamDiagnostics: initialRuntimeConfig?.streamDiagnostics ?? readPersistedStreamDiagnostics(),
|
|
36
50
|
}));
|
|
37
51
|
const updateRuntimeConfig = React.useCallback((nextRuntimeConfig) => {
|
|
38
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
52
|
+
// biome-ignore lint/suspicious/noExplicitAny: React state updater merges partial runtime config.
|
|
39
53
|
setRuntimeConfigState((currentRuntimeConfig) => ({
|
|
40
54
|
...currentRuntimeConfig,
|
|
41
55
|
...nextRuntimeConfig,
|
|
@@ -55,7 +69,7 @@ export const VisualizerRuntimeConfigProvider = ({ children, initialRuntimeConfig
|
|
|
55
69
|
}, [runtimeConfig]);
|
|
56
70
|
React.useEffect(() => {
|
|
57
71
|
const stereoDepthMaxValue = runtimeConfig.stereoDepthMaxValue;
|
|
58
|
-
// biome-ignore lint/suspicious/noDoubleEquals:
|
|
72
|
+
// biome-ignore lint/suspicious/noDoubleEquals: Treat null and undefined as missing runtime config.
|
|
59
73
|
if (stereoDepthMaxValue == undefined) {
|
|
60
74
|
globalThis.localStorage?.removeItem(STEREO_DEPTH_MAX_VALUE_STORAGE_KEY);
|
|
61
75
|
return;
|
|
@@ -77,6 +91,9 @@ export const VisualizerRuntimeConfigProvider = ({ children, initialRuntimeConfig
|
|
|
77
91
|
]);
|
|
78
92
|
return (_jsx(VisualizerRuntimeConfigContext.Provider, { value: contextValue, children: children }));
|
|
79
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* Returns the current visualizer runtime configuration context.
|
|
96
|
+
*/
|
|
80
97
|
export function useVisualizerRuntimeConfig() {
|
|
81
98
|
return React.useContext(VisualizerRuntimeConfigContext);
|
|
82
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisualizerRuntimeConfigProvider.js","sourceRoot":"","sources":["../../src/providers/VisualizerRuntimeConfigProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EACN,gBAAgB,IAAI,4BAA4B,GAEhD,MAAM,wBAAwB,CAAC;AAEhC,MAAM,kCAAkC,GAAG,qBAA8B,CAAC;AAC1E,MAAM,CAAC,MAAM,oCAAoC,GAAG,mCAA4C,C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B,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACpB,4BAA4B,CAAC,aAAa,CAAC,CAAC;IAC7C,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACpB,MAAM,mBAAmB,GAAG,aAAa,CAAC,mBAAmB,CAAC;QAC9D,mGAAmG;QACnG,IAAI,mBAAmB,IAAI,SAAS,EAAE,CAAC;YACtC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,kCAAkC,CAAC,CAAC;YACxE,OAAO;QACR,CAAC;QAED,UAAU,CAAC,YAAY,EAAE,OAAO,CAC/B,kCAAkC,EAClC,mBAAmB,CAAC,QAAQ,EAAE,CAC9B,CAAC;IACH,CAAC,EAAE,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAExC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CACjC,GAAG,EAAE,CAAC,CAAC;QACN,aAAa;QACb,mBAAmB;QACnB,sBAAsB;QACtB,cAAc;QACd,yBAAyB;KACzB,CAAC,EACF;QACC,aAAa;QACb,mBAAmB;QACnB,sBAAsB;QACtB,cAAc;QACd,yBAAyB;KACzB,CACD,CAAC;IAEF,OAAO,CACN,KAAC,8BAA8B,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC1D,QAAQ,GACgC,CAC1C,CAAC;AACH,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,0BAA0B;IACzC,OAAO,KAAK,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;AACzD,CAAC"}
|
package/dist/utils/arrays.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Splits a flat list into rows with a fixed number of columns.
|
|
3
|
+
*
|
|
4
|
+
* @param list - Items to split.
|
|
5
|
+
* @param columns - Number of items per row, or `null` to keep all items in one row.
|
|
6
|
+
* @returns Two-dimensional row layout.
|
|
7
|
+
*/
|
|
1
8
|
export declare function makeColumns<T>(list: T[], columns: number | null): T[][];
|
|
2
9
|
//# sourceMappingURL=arrays.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../src/utils/arrays.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,EAAE,EAAE,CAWvE"}
|
|
1
|
+
{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../src/utils/arrays.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,EAAE,EAAE,CAWvE"}
|
package/dist/utils/arrays.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Splits a flat list into rows with a fixed number of columns.
|
|
3
|
+
*
|
|
4
|
+
* @param list - Items to split.
|
|
5
|
+
* @param columns - Number of items per row, or `null` to keep all items in one row.
|
|
6
|
+
* @returns Two-dimensional row layout.
|
|
7
|
+
*/
|
|
1
8
|
export function makeColumns(list, columns) {
|
|
2
9
|
if (!columns) {
|
|
3
10
|
return [list];
|
package/dist/utils/arrays.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../src/utils/arrays.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAI,IAAS,EAAE,OAAsB;IAC/D,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAED,MAAM,MAAM,GAAU,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC;QAC/C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
1
|
+
{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../src/utils/arrays.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAI,IAAS,EAAE,OAAsB;IAC/D,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAED,MAAM,MAAM,GAAU,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC;QAC/C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/utils/functions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,YAEhB,CAAC"}
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/utils/functions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,IAAI,YAEhB,CAAC"}
|
package/dist/utils/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/utils/functions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;IACxB,WAAW;AACZ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/utils/functions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;IACxB,WAAW;AACZ,CAAC,CAAC"}
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local storage keys managed by the common viewer package.
|
|
3
|
+
*/
|
|
1
4
|
export type LocalStorageItems = 'topicList' | 'analyticsEnabled' | 'theme';
|
|
5
|
+
/**
|
|
6
|
+
* Reads and parses a JSON value from local storage.
|
|
7
|
+
*
|
|
8
|
+
* @param key - Known local storage key.
|
|
9
|
+
* @returns Parsed value, or `null` when the key is not present.
|
|
10
|
+
*/
|
|
2
11
|
export declare function getItemFromLocalStorage<T>(key: LocalStorageItems): T | null;
|
|
12
|
+
/**
|
|
13
|
+
* Serializes and stores a value in local storage.
|
|
14
|
+
*
|
|
15
|
+
* @param key - Known local storage key.
|
|
16
|
+
* @param value - Value to serialize.
|
|
17
|
+
*/
|
|
3
18
|
export declare function setItemToLocalStorage(key: LocalStorageItems, value: unknown): void;
|
|
19
|
+
/**
|
|
20
|
+
* Removes a managed key from local storage.
|
|
21
|
+
*
|
|
22
|
+
* @param key - Known local storage key.
|
|
23
|
+
*/
|
|
4
24
|
export declare function removeItemFromLocalStorage(key: LocalStorageItems): void;
|
|
5
25
|
//# sourceMappingURL=local-storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../../src/utils/local-storage.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,kBAAkB,GAAG,OAAO,CAAC;AAE3E,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,GAAG,EAAE,iBAAiB,GAAG,CAAC,GAAG,IAAI,CAQ3E;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,QAE3E;AAED,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,iBAAiB,QAEhE"}
|
|
1
|
+
{"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../../src/utils/local-storage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,kBAAkB,GAAG,OAAO,CAAC;AAE3E;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,GAAG,EAAE,iBAAiB,GAAG,CAAC,GAAG,IAAI,CAQ3E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,QAE3E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,iBAAiB,QAEhE"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads and parses a JSON value from local storage.
|
|
3
|
+
*
|
|
4
|
+
* @param key - Known local storage key.
|
|
5
|
+
* @returns Parsed value, or `null` when the key is not present.
|
|
6
|
+
*/
|
|
1
7
|
export function getItemFromLocalStorage(key) {
|
|
2
8
|
const itemInStorage = localStorage.getItem(key);
|
|
3
9
|
if (!itemInStorage) {
|
|
@@ -5,9 +11,20 @@ export function getItemFromLocalStorage(key) {
|
|
|
5
11
|
}
|
|
6
12
|
return JSON.parse(itemInStorage);
|
|
7
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Serializes and stores a value in local storage.
|
|
16
|
+
*
|
|
17
|
+
* @param key - Known local storage key.
|
|
18
|
+
* @param value - Value to serialize.
|
|
19
|
+
*/
|
|
8
20
|
export function setItemToLocalStorage(key, value) {
|
|
9
21
|
localStorage.setItem(key, JSON.stringify(value));
|
|
10
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Removes a managed key from local storage.
|
|
25
|
+
*
|
|
26
|
+
* @param key - Known local storage key.
|
|
27
|
+
*/
|
|
11
28
|
export function removeItemFromLocalStorage(key) {
|
|
12
29
|
localStorage.removeItem(key);
|
|
13
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage.js","sourceRoot":"","sources":["../../src/utils/local-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-storage.js","sourceRoot":"","sources":["../../src/utils/local-storage.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAI,GAAsB;IAChE,MAAM,aAAa,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEhD,IAAI,CAAC,aAAa,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAM,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAsB,EAAE,KAAc;IAC3E,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,GAAsB;IAChE,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC"}
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local storage key controlling whether Viewer debug logs are enabled.
|
|
3
|
+
*/
|
|
1
4
|
export declare const DEBUG_LOGS_LOCAL_STORAGE_KEY: "viewer-debug-logs-enabled";
|
|
2
5
|
type ElectronLogLevel = 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'CRITICAL';
|
|
3
6
|
declare global {
|
|
@@ -11,17 +14,45 @@ declare global {
|
|
|
11
14
|
};
|
|
12
15
|
}
|
|
13
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Singleton logger used by Viewer and Visualizer code paths.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Debug output is controlled by `DEBUG_LOGS_LOCAL_STORAGE_KEY`. When Electron log forwarding is
|
|
22
|
+
* available, messages are also forwarded to the native host on a best-effort basis.
|
|
23
|
+
*/
|
|
14
24
|
export declare class Logger {
|
|
15
25
|
protected static instance: Logger | null;
|
|
16
26
|
private static _debugLogsEnabled;
|
|
17
27
|
protected constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Whether debug logs are currently enabled.
|
|
30
|
+
*/
|
|
18
31
|
static get debugLogsEnabled(): boolean;
|
|
19
32
|
static set debugLogsEnabled(value: boolean);
|
|
33
|
+
/**
|
|
34
|
+
* Writes an informational log entry when debug logs are enabled.
|
|
35
|
+
*/
|
|
20
36
|
log(message?: any, ...optionalParams: any[]): void;
|
|
37
|
+
/**
|
|
38
|
+
* Writes an informational log entry when debug logs are enabled.
|
|
39
|
+
*/
|
|
21
40
|
info(message?: any, ...optionalParams: any[]): void;
|
|
41
|
+
/**
|
|
42
|
+
* Writes a debug log entry when debug logs are enabled.
|
|
43
|
+
*/
|
|
22
44
|
debug(message?: any, ...optionalParams: any[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* Writes a warning log entry when debug logs are enabled.
|
|
47
|
+
*/
|
|
23
48
|
warn(message?: any, ...optionalParams: any[]): void;
|
|
49
|
+
/**
|
|
50
|
+
* Writes an error log entry when debug logs are enabled.
|
|
51
|
+
*/
|
|
24
52
|
error(message?: any, ...optionalParams: any[]): void;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the shared logger instance.
|
|
55
|
+
*/
|
|
25
56
|
static getLogger(): Logger;
|
|
26
57
|
}
|
|
27
58
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,EAAG,2BAAoC,CAAC;AAEjF,KAAK,gBAAgB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC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cAAc,EAAE,GAAG,EAAE,GAAG,IAAI;IAO1D;;OAEG;IAEI,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,GAAG,IAAI;IAO3D;;OAEG;IAEI,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,GAAG,IAAI;IAO1D;;OAEG;IAEI,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,GAAG,IAAI;IAO3D;;OAEG;WACW,SAAS,IAAI,MAAM;CAOjC"}
|
package/dist/utils/logger.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local storage key controlling whether Viewer debug logs are enabled.
|
|
3
|
+
*/
|
|
1
4
|
export const DEBUG_LOGS_LOCAL_STORAGE_KEY = 'viewer-debug-logs-enabled';
|
|
2
5
|
function stringifyLogPart(value) {
|
|
3
6
|
if (typeof value === 'string') {
|
|
@@ -34,12 +37,20 @@ function forwardToElectron(level, message, optionalParams) {
|
|
|
34
37
|
// Electron log forwarding is best-effort and must never affect consumers.
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Singleton logger used by Viewer and Visualizer code paths.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* Debug output is controlled by `DEBUG_LOGS_LOCAL_STORAGE_KEY`. When Electron log forwarding is
|
|
45
|
+
* available, messages are also forwarded to the native host on a best-effort basis.
|
|
46
|
+
*/
|
|
39
47
|
export class Logger {
|
|
40
48
|
static instance = null;
|
|
41
49
|
static _debugLogsEnabled = null;
|
|
42
50
|
constructor() { }
|
|
51
|
+
/**
|
|
52
|
+
* Whether debug logs are currently enabled.
|
|
53
|
+
*/
|
|
43
54
|
static get debugLogsEnabled() {
|
|
44
55
|
if (Logger._debugLogsEnabled === null) {
|
|
45
56
|
const storedValue = localStorage.getItem(DEBUG_LOGS_LOCAL_STORAGE_KEY);
|
|
@@ -51,41 +62,59 @@ export class Logger {
|
|
|
51
62
|
Logger._debugLogsEnabled = value;
|
|
52
63
|
localStorage.setItem(DEBUG_LOGS_LOCAL_STORAGE_KEY, value ? 'true' : 'false');
|
|
53
64
|
}
|
|
54
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Writes an informational log entry when debug logs are enabled.
|
|
67
|
+
*/
|
|
68
|
+
// biome-ignore lint/suspicious/noExplicitAny: Logger methods intentionally match console signatures.
|
|
55
69
|
log(message, ...optionalParams) {
|
|
56
70
|
if (Logger.debugLogsEnabled) {
|
|
57
71
|
console.log(message, ...optionalParams);
|
|
58
72
|
forwardToElectron('INFO', message, optionalParams);
|
|
59
73
|
}
|
|
60
74
|
}
|
|
61
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Writes an informational log entry when debug logs are enabled.
|
|
77
|
+
*/
|
|
78
|
+
// biome-ignore lint/suspicious/noExplicitAny: Logger methods intentionally match console signatures.
|
|
62
79
|
info(message, ...optionalParams) {
|
|
63
80
|
if (Logger.debugLogsEnabled) {
|
|
64
81
|
console.log(message, ...optionalParams);
|
|
65
82
|
forwardToElectron('INFO', message, optionalParams);
|
|
66
83
|
}
|
|
67
84
|
}
|
|
68
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Writes a debug log entry when debug logs are enabled.
|
|
87
|
+
*/
|
|
88
|
+
// biome-ignore lint/suspicious/noExplicitAny: Logger methods intentionally match console signatures.
|
|
69
89
|
debug(message, ...optionalParams) {
|
|
70
90
|
if (Logger.debugLogsEnabled) {
|
|
71
91
|
console.debug(message, ...optionalParams);
|
|
72
92
|
forwardToElectron('DEBUG', message, optionalParams);
|
|
73
93
|
}
|
|
74
94
|
}
|
|
75
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Writes a warning log entry when debug logs are enabled.
|
|
97
|
+
*/
|
|
98
|
+
// biome-ignore lint/suspicious/noExplicitAny: Logger methods intentionally match console signatures.
|
|
76
99
|
warn(message, ...optionalParams) {
|
|
77
100
|
if (Logger.debugLogsEnabled) {
|
|
78
101
|
console.warn(message, ...optionalParams);
|
|
79
102
|
forwardToElectron('WARN', message, optionalParams);
|
|
80
103
|
}
|
|
81
104
|
}
|
|
82
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Writes an error log entry when debug logs are enabled.
|
|
107
|
+
*/
|
|
108
|
+
// biome-ignore lint/suspicious/noExplicitAny: Logger methods intentionally match console signatures.
|
|
83
109
|
error(message, ...optionalParams) {
|
|
84
110
|
if (Logger.debugLogsEnabled) {
|
|
85
111
|
console.error(message, ...optionalParams);
|
|
86
112
|
forwardToElectron('ERROR', message, optionalParams);
|
|
87
113
|
}
|
|
88
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Returns the shared logger instance.
|
|
117
|
+
*/
|
|
89
118
|
static getLogger() {
|
|
90
119
|
if (!Logger.instance) {
|
|
91
120
|
Logger.instance = new Logger();
|
package/dist/utils/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG,2BAAoC,CAAC;AAgBjF,SAAS,gBAAgB,CAAC,KAAc;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC;IACrC,CAAC;IAED,IAAI,CAAC;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACF,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAgB,EAAE,cA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,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;IAED;;OAEG;IACH,qGAAqG;IAC9F,KAAK,CAAC,OAAa,EAAE,GAAG,cAAqB;QACnD,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAC7B,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,CAAC;YAC1C,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACrD,CAAC;IACF,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,SAAS;QACtB,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YACtB,MAAM,CAAC,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QAChC,CAAC;QAED,OAAO,MAAM,CAAC,QAAQ,CAAC;IACxB,CAAC"}
|
package/dist/utils/sorting.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { Topic } from '../hooks/connection.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sorts stream topics using the default Viewer display order.
|
|
4
|
+
*
|
|
5
|
+
* @param streams - Topics to sort in place.
|
|
6
|
+
* @returns The same array sorted by preferred stream order.
|
|
7
|
+
*/
|
|
2
8
|
export declare function sortStreamsDefault(streams: Topic[]): Topic[];
|
|
3
9
|
//# sourceMappingURL=sorting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sorting.d.ts","sourceRoot":"","sources":["../../src/utils/sorting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAcpD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,KAAK,EAAE,WAmBlD"}
|
|
1
|
+
{"version":3,"file":"sorting.d.ts","sourceRoot":"","sources":["../../src/utils/sorting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAcpD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,KAAK,EAAE,WAmBlD"}
|
package/dist/utils/sorting.js
CHANGED
|
@@ -10,6 +10,12 @@ const PreferredStreamOrder = [
|
|
|
10
10
|
StreamTypes.RightRaw,
|
|
11
11
|
StreamTypes.Depth,
|
|
12
12
|
];
|
|
13
|
+
/**
|
|
14
|
+
* Sorts stream topics using the default Viewer display order.
|
|
15
|
+
*
|
|
16
|
+
* @param streams - Topics to sort in place.
|
|
17
|
+
* @returns The same array sorted by preferred stream order.
|
|
18
|
+
*/
|
|
13
19
|
export function sortStreamsDefault(streams) {
|
|
14
20
|
return streams.sort((a, b) => {
|
|
15
21
|
const indexA = PreferredStreamOrder.indexOf(a.name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sorting.js","sourceRoot":"","sources":["../../src/utils/sorting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,MAAM,oBAAoB,GAAa;IACtC,WAAW,CAAC,OAAO;IACnB,WAAW,CAAC,GAAG;IACf,WAAW,CAAC,SAAS;IACrB,WAAW,CAAC,UAAU;IACtB,WAAW,CAAC,WAAW;IACvB,WAAW,CAAC,OAAO;IACnB,WAAW,CAAC,YAAY;IACxB,WAAW,CAAC,QAAQ;IACpB,WAAW,CAAC,KAAK;CACjB,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IAClD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAEpD,IAAI,MAAM,KAAK,CAAC,CAAC,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;YACpC,OAAO,CAAC,CAAC;QACV,CAAC;QAED,IA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xB,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/utils/topic.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { type StreamType } from '../constants/streams.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns whether a topic name represents the point cloud stream.
|
|
4
|
+
*/
|
|
2
5
|
export declare function isPointCloudTopic(topic: string): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Mapping from stream topic names to display group labels.
|
|
8
|
+
*/
|
|
3
9
|
export type TopicGroup = {
|
|
4
10
|
[key in StreamType | string]: string;
|
|
5
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic.d.ts","sourceRoot":"","sources":["../../src/utils/topic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,yBAAyB,CAAC;AAEvE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,MAAM,MAAM,UAAU,GAAG;KACvB,GAAG,IAAI,UAAU,GAAG,MAAM,GAAG,MAAM;CACpC,CAAC"}
|
|
1
|
+
{"version":3,"file":"topic.d.ts","sourceRoot":"","sources":["../../src/utils/topic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,yBAAyB,CAAC;AAEvE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;KACvB,GAAG,IAAI,UAAU,GAAG,MAAM,GAAG,MAAM;CACpC,CAAC"}
|
package/dist/utils/topic.js
CHANGED
package/dist/utils/topic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic.js","sourceRoot":"","sources":["../../src/utils/topic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEvE,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC9C,OAAO,KAAK,KAAK,WAAW,CAAC,UAAU,CAAC;AACzC,CAAC"}
|
|
1
|
+
{"version":3,"file":"topic.js","sourceRoot":"","sources":["../../src/utils/topic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEvE;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC9C,OAAO,KAAK,KAAK,WAAW,CAAC,UAAU,CAAC;AACzC,CAAC"}
|
package/dist/utils/units.d.ts
CHANGED
|
@@ -1,9 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts millimeters to the metric value shown in stream overlays.
|
|
3
|
+
*/
|
|
1
4
|
export declare function millimetersToMetricsViewValue(mmValue: number): number;
|
|
5
|
+
/**
|
|
6
|
+
* Converts millimeters to centimeters with configurable decimal precision.
|
|
7
|
+
*/
|
|
2
8
|
export declare function millimetersToCentimeters(mmValue: number, precision?: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Converts millimeters to meters with configurable decimal precision.
|
|
11
|
+
*/
|
|
3
12
|
export declare function millimetersToMeters(mmValue: number, precision?: number): number;
|
|
13
|
+
/**
|
|
14
|
+
* Converts millimeters to the imperial value shown in stream overlays.
|
|
15
|
+
*/
|
|
4
16
|
export declare function millimetersToImperialViewValue(mmValue: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Converts millimeters to inches with configurable decimal precision.
|
|
19
|
+
*/
|
|
5
20
|
export declare function millimetersToInches(mmValue: number, precision?: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* Converts millimeters to feet with configurable decimal precision.
|
|
23
|
+
*/
|
|
6
24
|
export declare function millimetersToFeet(mmValue: number, precision?: number): number;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the metric unit label used for a millimeter distance.
|
|
27
|
+
*/
|
|
7
28
|
export declare function millimetersToMetricsUnit(mmValue: number): string;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the imperial unit label used for a millimeter distance.
|
|
31
|
+
*/
|
|
8
32
|
export declare function millimetersToImperialUnit(mmValue: number): string;
|
|
9
33
|
//# sourceMappingURL=units.d.ts.map
|