@sentinel-nvr/web 0.20.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/chunk-Z5USWUIE.js +1102 -0
- package/dist/chunk-Z5USWUIE.js.map +1 -0
- package/dist/glas/index.d.ts +76 -0
- package/dist/glas/index.js +221 -0
- package/dist/glas/index.js.map +1 -0
- package/dist/glas-data-CSRWRmcF.d.ts +368 -0
- package/dist/ui/glas.css +1629 -0
- package/dist/ui/index.d.ts +68 -96
- package/dist/ui/index.js +925 -685
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/locales/de.json +15 -1
- package/dist/ui/locales/en.json +14 -0
- package/dist/ui/locales/es.json +15 -1
- package/dist/ui/locales/fr.json +15 -1
- package/dist/ui/locales/it.json +15 -1
- package/dist/ui/locales/pt.json +15 -1
- package/dist/ui/locales/sv.json +15 -1
- package/dist/ui/ui.css +44 -0
- package/package.json +9 -2
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { g as SentinelClient, m as SentinelEventClass, s as SentinelRecentEvent, f as SentinelCamera, k as SentinelEvent, w as SentinelStats, h as SentinelClip } from '../client-BZP21uB4.js';
|
|
4
|
+
import { H as ThemeTokens, T as ThemeName, a as ThemeMode, I as ResolvedMode, U as UiStyle, G as GlasStrength } from '../glas-data-CSRWRmcF.js';
|
|
5
|
+
export { J as THEMES, K as THEME_LABELS, L as THEME_NAMES, M as accentOverride, N as resolveThemeMode } from '../glas-data-CSRWRmcF.js';
|
|
4
6
|
import { e as PlayerState } from '../controller-CaekZ6RJ.js';
|
|
5
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Apply a theme to the document (port of HAPulse's dashboard theme façade, MIT,
|
|
10
|
+
* © 2026 Julian — see NOTICE.md). Writes every token as an inline CSS custom
|
|
11
|
+
* property on :root and sets data-theme / data-mode / color-scheme.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
declare const TOKEN_TO_VAR: Record<keyof ThemeTokens, string>;
|
|
15
|
+
/** Resolve 'auto' to light/dark from the OS preference. */
|
|
16
|
+
declare function resolveMode(mode: ThemeMode): ResolvedMode;
|
|
17
|
+
declare function isThemeName(name: string): name is ThemeName;
|
|
18
|
+
/** Apply identity + mode (+ optional accent hue override) to <html>. */
|
|
19
|
+
declare function applyTheme(name: ThemeName, mode?: ThemeMode, accentHue?: number): ResolvedMode;
|
|
20
|
+
/** Re-apply while mode === 'auto' when the OS scheme flips. Returns a cleanup. */
|
|
21
|
+
declare function watchSystemMode(getState: () => {
|
|
22
|
+
theme: ThemeName;
|
|
23
|
+
mode: ThemeMode;
|
|
24
|
+
accentHue?: number | undefined;
|
|
25
|
+
}): () => void;
|
|
26
|
+
|
|
6
27
|
/**
|
|
7
28
|
* Minimal translation core with the same dictionary semantics as HAPulse:
|
|
8
29
|
* flat `key: string` dictionaries, `{name}` placeholders, plurals as
|
|
@@ -40,100 +61,6 @@ declare function SentinelUiProvider({ value, children }: {
|
|
|
40
61
|
}): react.JSX.Element;
|
|
41
62
|
declare function useSentinelUi(): SentinelUiValue;
|
|
42
63
|
|
|
43
|
-
/*! Theme tokens derived from HAPulse (https://github.com/jlnbln/HAPulse) — MIT License, Copyright (c) 2026 Julian */
|
|
44
|
-
/**
|
|
45
|
-
* Theme tokens: the four colour identities (aurora / sunset / ocean / forest),
|
|
46
|
-
* each with light + dark token sets, plus the pure mode/accent maths.
|
|
47
|
-
*
|
|
48
|
-
* Copied from HAPulse (https://github.com/jlnbln/HAPulse, packages/core/src/themes.ts),
|
|
49
|
-
* MIT License, Copyright (c) 2026 Julian — see NOTICE.md. Kept verbatim so both
|
|
50
|
-
* consumers stay pixel-identical.
|
|
51
|
-
*/
|
|
52
|
-
type ThemeName = 'aurora' | 'sunset' | 'ocean' | 'forest';
|
|
53
|
-
type ThemeMode = 'light' | 'dark' | 'auto';
|
|
54
|
-
type ResolvedMode = 'light' | 'dark';
|
|
55
|
-
declare const THEME_NAMES: readonly ThemeName[];
|
|
56
|
-
/** Human-facing labels for the theme identities. */
|
|
57
|
-
declare const THEME_LABELS: Record<ThemeName, string>;
|
|
58
|
-
interface ThemeTokens {
|
|
59
|
-
/** Page background */
|
|
60
|
-
bg: string;
|
|
61
|
-
/** Raised surface (sidebar, sheets) */
|
|
62
|
-
bgRaised: string;
|
|
63
|
-
/** Card surface */
|
|
64
|
-
bgCard: string;
|
|
65
|
-
/** Card hover surface */
|
|
66
|
-
bgCardHover: string;
|
|
67
|
-
/** Subtle inset surface (icon chips, inputs) */
|
|
68
|
-
bgSubtle: string;
|
|
69
|
-
text: string;
|
|
70
|
-
textDim: string;
|
|
71
|
-
textFaint: string;
|
|
72
|
-
/** Primary accent — orange family for aurora (= lights) */
|
|
73
|
-
accent: string;
|
|
74
|
-
accentSoft: string;
|
|
75
|
-
onAccent: string;
|
|
76
|
-
/** Hairline divider (alpha) */
|
|
77
|
-
line: string;
|
|
78
|
-
/** Solid card border */
|
|
79
|
-
border: string;
|
|
80
|
-
positive: string;
|
|
81
|
-
positiveSoft: string;
|
|
82
|
-
warning: string;
|
|
83
|
-
warningSoft: string;
|
|
84
|
-
danger: string;
|
|
85
|
-
dangerSoft: string;
|
|
86
|
-
info: string;
|
|
87
|
-
infoSoft: string;
|
|
88
|
-
shadowCard: string;
|
|
89
|
-
shadowElevated: string;
|
|
90
|
-
shadowActive: string;
|
|
91
|
-
}
|
|
92
|
-
interface ThemeVariants {
|
|
93
|
-
light: ThemeTokens;
|
|
94
|
-
dark: ThemeTokens;
|
|
95
|
-
}
|
|
96
|
-
declare const THEMES: Record<ThemeName, ThemeVariants>;
|
|
97
|
-
/**
|
|
98
|
-
* Resolve 'auto' to the concrete light/dark based on the OS preference.
|
|
99
|
-
*
|
|
100
|
-
* Pure function — the caller supplies `systemPrefersDark` (e.g. from
|
|
101
|
-
* `window.matchMedia('(prefers-color-scheme: dark)').matches` in the browser,
|
|
102
|
-
* or the platform's equivalent on mobile) so this module stays DOM-free.
|
|
103
|
-
*/
|
|
104
|
-
declare function resolveThemeMode(mode: ThemeMode, systemPrefersDark: boolean): ResolvedMode;
|
|
105
|
-
/**
|
|
106
|
-
* Compute the `accent` / `accentSoft` / `onAccent` token overrides for a
|
|
107
|
-
* custom accent hue (0–360), matching the HSL math the dashboard's
|
|
108
|
-
* `applyTheme()` has always used. Mirrors the current inline override exactly:
|
|
109
|
-
* lightness differs by resolved mode (60% dark / 50% light), saturation is
|
|
110
|
-
* fixed at 78%, and the soft alpha differs by mode (0.16 dark / 0.12 light).
|
|
111
|
-
*/
|
|
112
|
-
declare function accentOverride(hue: number, resolvedMode: ResolvedMode): {
|
|
113
|
-
accent: string;
|
|
114
|
-
accentSoft: string;
|
|
115
|
-
onAccent: string;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Apply a theme to the document (port of HAPulse's dashboard theme façade, MIT,
|
|
120
|
-
* © 2026 Julian — see NOTICE.md). Writes every token as an inline CSS custom
|
|
121
|
-
* property on :root and sets data-theme / data-mode / color-scheme.
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
declare const TOKEN_TO_VAR: Record<keyof ThemeTokens, string>;
|
|
125
|
-
/** Resolve 'auto' to light/dark from the OS preference. */
|
|
126
|
-
declare function resolveMode(mode: ThemeMode): ResolvedMode;
|
|
127
|
-
declare function isThemeName(name: string): name is ThemeName;
|
|
128
|
-
/** Apply identity + mode (+ optional accent hue override) to <html>. */
|
|
129
|
-
declare function applyTheme(name: ThemeName, mode?: ThemeMode, accentHue?: number): ResolvedMode;
|
|
130
|
-
/** Re-apply while mode === 'auto' when the OS scheme flips. Returns a cleanup. */
|
|
131
|
-
declare function watchSystemMode(getState: () => {
|
|
132
|
-
theme: ThemeName;
|
|
133
|
-
mode: ThemeMode;
|
|
134
|
-
accentHue?: number | undefined;
|
|
135
|
-
}): () => void;
|
|
136
|
-
|
|
137
64
|
/** Word-dependent formatters (need `t`). Intl-only ones live in ../api. */
|
|
138
65
|
|
|
139
66
|
/** "just now / 5 min ago / 2 h ago / 3 d ago" */
|
|
@@ -182,6 +109,39 @@ declare function CameraGrid({ cameras, icon }: {
|
|
|
182
109
|
icon?: ReactNode;
|
|
183
110
|
}): react.JSX.Element;
|
|
184
111
|
|
|
112
|
+
interface GlassCamerasProps {
|
|
113
|
+
cameras: SentinelCamera[];
|
|
114
|
+
/** No answer from the NVR yet: an empty tile instead of "no cameras". */
|
|
115
|
+
loading?: boolean | undefined;
|
|
116
|
+
/** How often the snapshots refresh (ms, while the page is visible); default 5 s. */
|
|
117
|
+
refreshMs?: number | undefined;
|
|
118
|
+
}
|
|
119
|
+
/** The cameras: per camera its snapshot tile, opening the camera page. */
|
|
120
|
+
declare function GlassCameras({ cameras, loading, refreshMs }: GlassCamerasProps): react.JSX.Element;
|
|
121
|
+
interface GlassEventsProps {
|
|
122
|
+
events: SentinelRecentEvent[];
|
|
123
|
+
/** Name the camera of each event (more than one camera). */
|
|
124
|
+
several: boolean;
|
|
125
|
+
}
|
|
126
|
+
/** The latest events: picture, time (before today with its day, "gestern 22:10"), classes and camera; each opens the
|
|
127
|
+
* camera at that moment. */
|
|
128
|
+
declare function GlassEvents({ events, several }: GlassEventsProps): react.JSX.Element | null;
|
|
129
|
+
interface GlassNvrProps {
|
|
130
|
+
cameras: SentinelCamera[];
|
|
131
|
+
events: SentinelRecentEvent[];
|
|
132
|
+
/** No answer from the NVR yet: an empty tile instead of "no cameras". */
|
|
133
|
+
loading?: boolean | undefined;
|
|
134
|
+
/** How often the snapshots refresh (ms, while the page is visible); default 5 s. */
|
|
135
|
+
refreshMs?: number | undefined;
|
|
136
|
+
}
|
|
137
|
+
/** Cameras and events as one body (a host's NVR card). */
|
|
138
|
+
declare function GlassNvr({ cameras, events, loading, refreshMs }: GlassNvrProps): react.JSX.Element;
|
|
139
|
+
/** The overview's cameras and events as sections with their titles (symbol + title), the cameras first. */
|
|
140
|
+
declare function GlassSections({ cameras, events }: {
|
|
141
|
+
cameras: SentinelCamera[];
|
|
142
|
+
events: SentinelRecentEvent[];
|
|
143
|
+
}): react.JSX.Element;
|
|
144
|
+
|
|
185
145
|
/**
|
|
186
146
|
* Last snapshot a camera tile showed, per camera (module state, survives the route change to the camera page).
|
|
187
147
|
* Opening a camera posters it at once instead of a grey stage (user 23.09.: "erstmal kein Bild"; 27.09.: the stage
|
|
@@ -259,9 +219,13 @@ declare function CardTitle({ icon, title, sub, tone, action, }: {
|
|
|
259
219
|
tone?: Tone;
|
|
260
220
|
action?: ReactNode;
|
|
261
221
|
}): react.JSX.Element;
|
|
262
|
-
|
|
222
|
+
/** `appearance="glass"`: the head of the style "Glas", a tafel as on HAPulse's other pages (from 0.21.0, before HAPulse's
|
|
223
|
+
* `NvrHeroGlas`): the camera symbol in a circle, the state large in its colour, the values as a grid. Same facts as the
|
|
224
|
+
* classic hero; looks in `glas.css` (`.nvr-tafel*`). Without the prop the markup is that of 0.20. */
|
|
225
|
+
declare function Hero({ cameras, stats, appearance, }: {
|
|
263
226
|
cameras: SentinelCamera[];
|
|
264
227
|
stats: SentinelStats;
|
|
228
|
+
appearance?: 'glass' | undefined;
|
|
265
229
|
}): react.JSX.Element;
|
|
266
230
|
declare function HistogramCard({ histogram }: {
|
|
267
231
|
histogram: number[];
|
|
@@ -418,6 +382,14 @@ interface AppearanceProps {
|
|
|
418
382
|
onMode: (mode: ThemeMode) => void;
|
|
419
383
|
onAccent: (hue: number | undefined) => void;
|
|
420
384
|
onLanguage: (id: string) => void;
|
|
385
|
+
/** the style; the row appears only with `onUiStyle` */
|
|
386
|
+
uiStyle?: UiStyle | undefined;
|
|
387
|
+
onUiStyle?: ((style: UiStyle) => void) | undefined;
|
|
388
|
+
/** Glas only: the stored strength (contrast or reduced transparency make it opaque, the row shows the choice) */
|
|
389
|
+
glassStrength?: GlasStrength | undefined;
|
|
390
|
+
onGlassStrength?: ((strength: GlasStrength) => void) | undefined;
|
|
391
|
+
reduceTransparency?: boolean | undefined;
|
|
392
|
+
onReduceTransparency?: ((on: boolean) => void) | undefined;
|
|
421
393
|
}
|
|
422
394
|
/** Hue (0–360) of a `#rrggbb` colour — the slider's rest position for a theme's own accent. */
|
|
423
395
|
declare function hexHue(hex: string): number;
|
|
@@ -431,4 +403,4 @@ declare function ThemeSwatch({ name, active, previewMode, onClick, ariaLabel, }:
|
|
|
431
403
|
}): react.JSX.Element;
|
|
432
404
|
declare function AppearanceSection(p: AppearanceProps): react.JSX.Element;
|
|
433
405
|
|
|
434
|
-
export { type AppearanceProps, AppearanceSection, CameraGrid, type CameraHeaderInfo, CameraPage, type CameraPageProps, CameraTiles, CameraTitle, CardTitle, ClassBadge, DatePickerPanel, type DatePickerPanelProps, type DatePickerRequest, type Dict, EventBadges, EventList, EventsStrip, Hero, HistogramCard,
|
|
406
|
+
export { type AppearanceProps, AppearanceSection, CameraGrid, type CameraHeaderInfo, CameraPage, type CameraPageProps, CameraTiles, CameraTitle, CardTitle, ClassBadge, DatePickerPanel, type DatePickerPanelProps, type DatePickerRequest, type Dict, EventBadges, EventList, EventsStrip, GlassCameras, type GlassCamerasProps, GlassEvents, type GlassEventsProps, GlassNvr, type GlassNvrProps, GlassSections, Hero, HistogramCard, ResolvedMode, type ScrubHandlers, type SentinelUiNav, SentinelUiProvider, type SentinelUiValue, StatTile, StorageCard, type TFn, TOKEN_TO_VAR, ThemeMode, ThemeName, ThemeSwatch, ThemeTokens, type TileSnapshot, type TimelineProps, type Tone, UI_LOCALES, UI_LOCALE_LABELS, type UiLocale, VerticalTimeline, applyTheme, classLabel, createT, dateChipNav, drawLastTileSnapshot, eventLabel, fmtDays, fmtRelative, hasLastTileSnapshot, hexHue, humanBytes, interpolate, isIosHomeScreenApp, isThemeName, outsideAppHref, pickLocale, rememberTileSnapshot, resolveMode, stageStatus, tileSnapshotWidth, translate, useDatePicker, useSentinelUi, watchSystemMode };
|