@camstack/ui-library 0.1.55 → 0.1.57
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/dist/composites/camera-stream-player.d.ts +41 -1
- package/dist/composites/cap-settings/MaskShapeCanvas.d.ts +48 -0
- package/dist/composites/cap-settings/MotionZonesSettings.d.ts +1 -1
- package/dist/composites/cap-settings/PrivacyMaskSettings.d.ts +2 -0
- package/dist/composites/cap-settings/index.d.ts +3 -0
- package/dist/composites/device-export-panel.d.ts +8 -1
- package/dist/composites/device-item/helpers.d.ts +9 -0
- package/dist/composites/device-list/filter-chips.d.ts +10 -8
- package/dist/composites/device-list/index.d.ts +9 -0
- package/dist/composites/device-list/url-state.d.ts +7 -2
- package/dist/composites/index.d.ts +2 -2
- package/dist/composites/stream-panel.d.ts +18 -2
- package/dist/generated/system-hooks.d.ts +28 -0
- package/dist/hooks/use-device-webrtc.d.ts +66 -1
- package/dist/index.cjs +7826 -5770
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7813 -5772
- package/dist/index.js.map +1 -1
- package/dist/lib/cap-error.d.ts +41 -0
- package/dist/lib/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/composites/cap-settings/MotionGridCanvas.d.ts +0 -9
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared capability-error utilities for the admin UI.
|
|
3
|
+
*
|
|
4
|
+
* The primary export `isAbsentProvider` lets UI components distinguish
|
|
5
|
+
* "this device doesn't have this cap" (expected — hide the widget) from
|
|
6
|
+
* "something went wrong while calling a present cap" (unexpected — surface
|
|
7
|
+
* the error to the operator).
|
|
8
|
+
*
|
|
9
|
+
* Detection strategy (two-tier):
|
|
10
|
+
*
|
|
11
|
+
* 1. **Typed reason** (preferred): tRPC's errorFormatter augments the
|
|
12
|
+
* error shape with `data.capRouteReason` when the server throws a
|
|
13
|
+
* CapRouteError. Read it from `err.data?.capRouteReason` to avoid
|
|
14
|
+
* brittle string matching.
|
|
15
|
+
*
|
|
16
|
+
* 2. **Substring fallback** (transitional safety): older error paths
|
|
17
|
+
* that don't carry a typed reason still emit the human-readable
|
|
18
|
+
* message "provider not available". The fallback is ONLY engaged
|
|
19
|
+
* when `capRouteReason` is absent — future clean-up can drop it
|
|
20
|
+
* once every throw site has been migrated.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Returns `true` when `err` indicates that the requested capability has
|
|
24
|
+
* no provider bound for the device — i.e. the device legitimately does
|
|
25
|
+
* not expose this cap and the UI should stay hidden / show a friendly
|
|
26
|
+
* "not supported" message.
|
|
27
|
+
*
|
|
28
|
+
* Returns `false` for real dispatch errors (`transport-failed`) — those
|
|
29
|
+
* should be surfaced to the operator as unexpected failures.
|
|
30
|
+
*
|
|
31
|
+
* ## Absent-provider reasons
|
|
32
|
+
* - `'no-provider'` — no provider is registered for this cap/device pair.
|
|
33
|
+
* - `'node-offline'` — the node that hosts the cap is not reachable; the
|
|
34
|
+
* device is effectively unavailable so we treat it as absent.
|
|
35
|
+
*
|
|
36
|
+
* ## Not-absent reasons
|
|
37
|
+
* - `'transport-failed'` — a provider exists but the call failed in transit.
|
|
38
|
+
* - `'cap-unknown'` — the cap name isn't registered at all; treat as
|
|
39
|
+
* a real error (likely a programming mistake or version skew).
|
|
40
|
+
*/
|
|
41
|
+
export declare function isAbsentProvider(err: unknown): boolean;
|
package/dist/lib/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MotionZoneOptions } from '@camstack/types';
|
|
2
|
-
export interface MotionGridCanvasProps {
|
|
3
|
-
/** Fixed lattice dimensions — from the cap's `getOptions`. */
|
|
4
|
-
readonly options: MotionZoneOptions;
|
|
5
|
-
/** Row-major active-cell grid, length === gridWidth*gridHeight. */
|
|
6
|
-
readonly cells: readonly boolean[];
|
|
7
|
-
readonly onCellsChange: (next: boolean[]) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare function MotionGridCanvas({ options, cells, onCellsChange }: MotionGridCanvasProps): import("react/jsx-runtime").JSX.Element;
|