@camstack/ui-library 1.2.347 → 1.2.349
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/CHANGELOG.md +17 -0
- package/dist/composites/device-item/helpers.d.ts +23 -0
- package/dist/composites/device-name/format-device-name.d.ts +4 -3
- package/dist/contexts/unit-preferences-from-server.d.ts +9 -0
- package/dist/contexts/unit-preferences.d.ts +12 -0
- package/dist/generated/system-hooks.d.ts +20 -0
- package/dist/hooks/merge-detections.d.ts +16 -0
- package/dist/hooks/use-account-unit-preferences.d.ts +10 -0
- package/dist/index.cjs +473 -75
- package/dist/index.d.ts +4 -0
- package/dist/index.js +456 -77
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/resolve-sensor-display.d.ts +4 -1
- package/dist/lib/unit-preferences.d.ts +28 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.349] - 2026-10-29
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Live detection boxes ignore out-of-order frames and fade by frame age
|
|
15
|
+
- Live detection boxes come straight from the detector; faces, plates and names attach as they arrive
|
|
16
|
+
|
|
17
|
+
## [1.2.348] - 2026-10-29
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Generated hooks for the new ir-transmitter and remote capabilities
|
|
22
|
+
- Generated system hooks for the template and remote capabilities
|
|
23
|
+
- Pet feeder: the manual-feed portion stepper responds instantly, repeats and speeds up while held, and starts from the last manual feed
|
|
24
|
+
- A device listed inside its container's own list no longer repeats the container's name; the prefix is also stripped after a hyphen or a colon.
|
|
25
|
+
- Readings follow the signed-in user's unit preferences (temperature in °C or °F, other quantities metric or imperial), read once from the account preference admin.units; the default stays metric and °C
|
|
26
|
+
|
|
10
27
|
## [1.2.347] - 2026-10-29
|
|
11
28
|
|
|
12
29
|
### Changed
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { type ChildLayout, type DeviceDisplayOverride, type RoleDisplayDefault, type SourceInfo } from "@camstack/types";
|
|
19
19
|
import type { LucideIcon } from "lucide-react";
|
|
20
20
|
import type { ReactNode } from "react";
|
|
21
|
+
import type { DeviceNameForm } from "../device-name";
|
|
21
22
|
import type { UseDeviceProxyTrpc } from "../../hooks/use-device-proxy";
|
|
22
23
|
import { type UiTextFn } from "../../contexts/ui-text";
|
|
23
24
|
/**
|
|
@@ -124,6 +125,13 @@ export interface DeviceItemProps {
|
|
|
124
125
|
*/
|
|
125
126
|
readonly isAccessoryRow?: boolean;
|
|
126
127
|
/**
|
|
128
|
+
* Name form override. A row listed INSIDE its parent's own list passes
|
|
129
|
+
* `'nested'` (with `parent`) so the name reads as the bare noun, never
|
|
130
|
+
* `"<Parent> · <Noun>"`. Omitted: `'nested'` for an accessory row, else
|
|
131
|
+
* `'compact'`.
|
|
132
|
+
*/
|
|
133
|
+
readonly nameForm?: DeviceNameForm;
|
|
134
|
+
/**
|
|
127
135
|
* Indent level for the `<td>` first cell in `view='table'`. Controls
|
|
128
136
|
* `pl-N` on the name cell so adopted-under-hub rows can be visually
|
|
129
137
|
* nested below their parent without forcing the accessory tint.
|
|
@@ -245,6 +253,21 @@ export declare function deviceLeadIcon(device: DeviceItemDevice, roleDefaults?:
|
|
|
245
253
|
* this is the small secondary role caption on accessory/sensor rows.
|
|
246
254
|
*/
|
|
247
255
|
export declare function displayRoleLabel(device: DeviceItemDevice, t?: UiTextFn): string;
|
|
256
|
+
/**
|
|
257
|
+
* Strip a redundant parent-name prefix from a child device's name. Providers
|
|
258
|
+
* name container children fully-qualified so the entity reads cleanly on its
|
|
259
|
+
* own detail page / exports / Alexa / the parent badge — Dreame joins with a
|
|
260
|
+
* plain space (`"<Parent> <Label>"`), Ecowitt with an em-dash
|
|
261
|
+
* (`"<Parent> — <Label>"`). Under the parent row that prefix is noise, so this
|
|
262
|
+
* trims it for the in-list label ONLY; the underlying `device.name` is never
|
|
263
|
+
* mutated.
|
|
264
|
+
*
|
|
265
|
+
* The `" — "` separator is tried BEFORE the plain space so an Ecowitt child
|
|
266
|
+
* (`"Ecowitt Gateway — gateway"`) yields `"gateway"` rather than `"— gateway"`.
|
|
267
|
+
* Matching is case-insensitive and also accepts `" - "` and `": "`. A missing
|
|
268
|
+
* parent name, a name that doesn't carry the prefix, a name equal to the
|
|
269
|
+
* parent's, or one with nothing after the prefix is returned verbatim.
|
|
270
|
+
*/
|
|
248
271
|
export declare function stripParentNamePrefix(name: string, parentName: string): string;
|
|
249
272
|
/**
|
|
250
273
|
* Display name for a child device rendered UNDER its container/parent row.
|
|
@@ -32,9 +32,10 @@ export interface DeviceNameNouns {
|
|
|
32
32
|
export declare function foldDeviceName(value: string): string;
|
|
33
33
|
export declare function sameDeviceName(left: string, right: string): boolean;
|
|
34
34
|
/**
|
|
35
|
-
* Drop a parent prefix. `" — "`
|
|
36
|
-
*
|
|
37
|
-
* does not keep a
|
|
35
|
+
* Drop a parent prefix. The separators `" — "`, `" - "` and `": "` are tried
|
|
36
|
+
* before a plain space, case-insensitive, so a provider that capitalised the
|
|
37
|
+
* parent differently still strips, and a dash or colon child does not keep a
|
|
38
|
+
* dangling mark.
|
|
38
39
|
*/
|
|
39
40
|
export declare function stripDeviceParentPrefix(name: string, parentName: string): string;
|
|
40
41
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the user's unit preferences ONCE, at the top, and publishes them by
|
|
3
|
+
* context. While the read is pending or failed, the default applies — a
|
|
4
|
+
* reading is never withheld because the preference has not answered.
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement, ReactNode } from "react";
|
|
7
|
+
export declare function UnitPreferencesFromServer({ children }: {
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
}): ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The signed-in user's unit preferences, published by context so every
|
|
3
|
+
* reading renders in the same units without a query of its own. Without a
|
|
4
|
+
* provider (a spec, a standalone addon page) the default applies: metric, °C.
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
7
|
+
import { type UnitPreferences } from "../lib/unit-preferences";
|
|
8
|
+
export declare function UnitPreferencesProvider({ value, children }: {
|
|
9
|
+
readonly value: UnitPreferences;
|
|
10
|
+
readonly children: ReactNode;
|
|
11
|
+
}): ReactElement;
|
|
12
|
+
export declare function useUnitPreferences(): UnitPreferences;
|
|
@@ -2003,6 +2003,16 @@ export declare const useRecordingOnboardSetSettings: typeof trpc.recordingOnboar
|
|
|
2003
2003
|
export declare const useRecordingOnboardGetStatus: typeof trpc.recordingOnboard.getStatus.useQuery;
|
|
2004
2004
|
/** Generated alias around `trpc.recordingSignal.getStatus.useQuery`. */
|
|
2005
2005
|
export declare const useRecordingSignalGetStatus: typeof trpc.recordingSignal.getStatus.useQuery;
|
|
2006
|
+
/** Generated alias around `trpc.remote.getConfig.useQuery`. */
|
|
2007
|
+
export declare const useRemoteGetConfig: typeof trpc.remote.getConfig.useQuery;
|
|
2008
|
+
/** Generated alias around `trpc.remote.setConfig.useMutation`. */
|
|
2009
|
+
export declare const useRemoteSetConfig: typeof trpc.remote.setConfig.useMutation;
|
|
2010
|
+
/** Generated alias around `trpc.remote.listCommands.useQuery`. */
|
|
2011
|
+
export declare const useRemoteListCommands: typeof trpc.remote.listCommands.useQuery;
|
|
2012
|
+
/** Generated alias around `trpc.remote.sendCommand.useMutation`. */
|
|
2013
|
+
export declare const useRemoteSendCommand: typeof trpc.remote.sendCommand.useMutation;
|
|
2014
|
+
/** Generated alias around `trpc.remote.sendMediaCommand.useMutation`. */
|
|
2015
|
+
export declare const useRemoteSendMediaCommand: typeof trpc.remote.sendMediaCommand.useMutation;
|
|
2006
2016
|
/** Generated alias around `trpc.runningState.getStatus.useQuery`. */
|
|
2007
2017
|
export declare const useRunningStateGetStatus: typeof trpc.runningState.getStatus.useQuery;
|
|
2008
2018
|
/** Generated alias around `trpc.sceneMonitor.listScenes.useQuery`. */
|
|
@@ -2289,6 +2299,16 @@ export declare const useSystemSetLoggingSettings: typeof trpc.system.setLoggingS
|
|
|
2289
2299
|
export declare const useTamperGetStatus: typeof trpc.tamper.getStatus.useQuery;
|
|
2290
2300
|
/** Generated alias around `trpc.temperatureSensor.getStatus.useQuery`. */
|
|
2291
2301
|
export declare const useTemperatureSensorGetStatus: typeof trpc.temperatureSensor.getStatus.useQuery;
|
|
2302
|
+
/** Generated alias around `trpc.template.list.useQuery`. */
|
|
2303
|
+
export declare const useTemplateList: typeof trpc.template.list.useQuery;
|
|
2304
|
+
/** Generated alias around `trpc.template.get.useQuery`. */
|
|
2305
|
+
export declare const useTemplateGet: typeof trpc.template.get.useQuery;
|
|
2306
|
+
/** Generated alias around `trpc.template.create.useMutation`. */
|
|
2307
|
+
export declare const useTemplateCreate: typeof trpc.template.create.useMutation;
|
|
2308
|
+
/** Generated alias around `trpc.template.update.useMutation`. */
|
|
2309
|
+
export declare const useTemplateUpdate: typeof trpc.template.update.useMutation;
|
|
2310
|
+
/** Generated alias around `trpc.template.delete.useMutation`. */
|
|
2311
|
+
export declare const useTemplateDelete: typeof trpc.template.delete.useMutation;
|
|
2292
2312
|
/** Generated alias around `trpc.terminalSession.listProfiles.useQuery`. */
|
|
2293
2313
|
export declare const useTerminalSessionListProfiles: typeof trpc.terminalSession.listProfiles.useQuery;
|
|
2294
2314
|
/** Generated alias around `trpc.terminalSession.listInstances.useQuery`. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge of the two live overlay sources into the one flat list the overlay
|
|
3
|
+
* renders. Root boxes ALWAYS come from the raw detector frame; the enriched
|
|
4
|
+
* (post-analysis) frame contributes only EXTRAS — detail children (face,
|
|
5
|
+
* plate…) and identity labels — attached to the matching raw root.
|
|
6
|
+
*/
|
|
7
|
+
import type { ObjectDetection } from "@camstack/types";
|
|
8
|
+
/** Minimum IoU between an enriched root and a raw root to call them one subject
|
|
9
|
+
* when no trackId pairs them. */
|
|
10
|
+
export declare const EXTRA_MATCH_IOU_THRESHOLD = .3;
|
|
11
|
+
export interface FramePart {
|
|
12
|
+
readonly detections: readonly ObjectDetection[];
|
|
13
|
+
readonly frameWidth: number;
|
|
14
|
+
readonly frameHeight: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function mergeDetections(raw: FramePart | null, extras: FramePart | null): FramePart | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type UnitPreferences } from "../lib/unit-preferences";
|
|
2
|
+
export interface AccountUnitPreferencesState {
|
|
3
|
+
/** `pending` until the row answered; `error` when the read failed (never "the default"). */
|
|
4
|
+
readonly status: "pending" | "error" | "ok";
|
|
5
|
+
readonly value: UnitPreferences;
|
|
6
|
+
/** False when the stored row could not be read: writing would destroy it. */
|
|
7
|
+
readonly writable: boolean;
|
|
8
|
+
readonly update: (change: Partial<UnitPreferences>) => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare function useAccountUnitPreferences(): AccountUnitPreferencesState;
|