@camstack/ui-library 1.2.172 → 1.2.174
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/{MotionZonesSettings-DNdnFHso.js → MotionZonesSettings-7c3yiT5E.js} +1 -26
- package/dist/{MotionZonesSettings-BP9p0pFB.cjs → MotionZonesSettings-BK9R9NIr.cjs} +1 -26
- package/dist/{PrivacyMaskSettings-CooCVUmA.js → PrivacyMaskSettings-PkYs077O.js} +1 -1
- package/dist/{SceneMonitorEditor-Bfo4BNqA.js → SceneMonitorEditor-BvDy3x3k.js} +1 -1
- package/dist/composites/cap-settings/CameraGridLayoutEditor.d.ts +4 -0
- package/dist/composites/cap-settings/HomePresetPicker.d.ts +6 -0
- package/dist/composites/cap-settings/camera-grid-layout.d.ts +54 -0
- package/dist/generated/system-hooks.d.ts +10 -0
- package/dist/hooks/use-ptz.d.ts +31 -0
- package/dist/index.cjs +828 -166
- package/dist/index.js +826 -170
- package/package.json +1 -1
|
@@ -1,32 +1,7 @@
|
|
|
1
|
-
import { TEXT_HINT, WidgetPanel,
|
|
1
|
+
import { TEXT_HINT, WidgetPanel, isAbsentProvider, o as Grid2x2, useDeviceProxy, usePlayerOverlayLayer, useSystem } from "./index.js";
|
|
2
2
|
import { MaskShapeCanvas } from "./MaskShapeCanvas-DI4BY7W2.js";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
/**
|
|
6
|
-
* @license lucide-react v0.576.0 - ISC
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the ISC license.
|
|
9
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var Grid2x2 = createLucideIcon("grid-2x2", [
|
|
12
|
-
["path", {
|
|
13
|
-
d: "M12 3v18",
|
|
14
|
-
key: "108xh3"
|
|
15
|
-
}],
|
|
16
|
-
["path", {
|
|
17
|
-
d: "M3 12h18",
|
|
18
|
-
key: "1i2n21"
|
|
19
|
-
}],
|
|
20
|
-
["rect", {
|
|
21
|
-
x: "3",
|
|
22
|
-
y: "3",
|
|
23
|
-
width: "18",
|
|
24
|
-
height: "18",
|
|
25
|
-
rx: "2",
|
|
26
|
-
key: "h1oib"
|
|
27
|
-
}]
|
|
28
|
-
]);
|
|
29
|
-
//#endregion
|
|
30
5
|
//#region src/composites/cap-settings/MotionZonesSettings.tsx
|
|
31
6
|
/**
|
|
32
7
|
* MotionZonesSettings — management surface for the on-camera
|
|
@@ -2,31 +2,6 @@ const require_index = require("./index.cjs");
|
|
|
2
2
|
const require_MaskShapeCanvas = require("./MaskShapeCanvas-BByN3jvt.cjs");
|
|
3
3
|
let react = require("react");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
* @license lucide-react v0.576.0 - ISC
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the ISC license.
|
|
9
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/
|
|
11
|
-
var Grid2x2 = require_index.createLucideIcon("grid-2x2", [
|
|
12
|
-
["path", {
|
|
13
|
-
d: "M12 3v18",
|
|
14
|
-
key: "108xh3"
|
|
15
|
-
}],
|
|
16
|
-
["path", {
|
|
17
|
-
d: "M3 12h18",
|
|
18
|
-
key: "1i2n21"
|
|
19
|
-
}],
|
|
20
|
-
["rect", {
|
|
21
|
-
x: "3",
|
|
22
|
-
y: "3",
|
|
23
|
-
width: "18",
|
|
24
|
-
height: "18",
|
|
25
|
-
rx: "2",
|
|
26
|
-
key: "h1oib"
|
|
27
|
-
}]
|
|
28
|
-
]);
|
|
29
|
-
//#endregion
|
|
30
5
|
//#region src/composites/cap-settings/MotionZonesSettings.tsx
|
|
31
6
|
/**
|
|
32
7
|
* MotionZonesSettings — management surface for the on-camera
|
|
@@ -318,7 +293,7 @@ function MotionZonesSettings({ deviceId }) {
|
|
|
318
293
|
if (!dev) return null;
|
|
319
294
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.WidgetPanel, {
|
|
320
295
|
title: "Motion Zones",
|
|
321
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Grid2x2, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
|
|
296
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.Grid2x2, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
|
|
322
297
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
323
298
|
className: "flex flex-col gap-3",
|
|
324
299
|
children: unsupported ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TEXT_HINT, WidgetPanel,
|
|
1
|
+
import { TEXT_HINT, WidgetPanel, i as Mic, isAbsentProvider, l as createLucideIcon, n as Square, s as EyeOff, t as Trash2, useDeviceProxy, usePlayerOverlayLayer, useSystem } from "./index.js";
|
|
2
2
|
import { MaskShapeCanvas } from "./MaskShapeCanvas-DI4BY7W2.js";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SCENE_CAPTURE_VARIANTS, TEXT_HINT, a as ImageOff, badgeFor, c as
|
|
1
|
+
import { SCENE_CAPTURE_VARIANTS, TEXT_HINT, a as ImageOff, badgeFor, c as Camera, coverageLine, hubPath, isAbsentProvider, l as createLucideIcon, r as RotateCcw, roiTooLarge, statusLine, t as Trash2, useDeviceProxy, useDeviceSnapshotImage, useDeviceStateSlice, useSystem, variantLabel } from "./index.js";
|
|
2
2
|
import { MaskShapeCanvas } from "./MaskShapeCanvas-DI4BY7W2.js";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure half of the camera-grid layout editor: what a grid IS on this side
|
|
3
|
+
* of the wire, and the geometry the drag handles apply.
|
|
4
|
+
*
|
|
5
|
+
* Both rectangles an editor manipulates are NORMALIZED [0,1] — the crop taken
|
|
6
|
+
* out of a source, and the cell it lands in. The addon stores them that way so
|
|
7
|
+
* a source camera that changes resolution does not silently start cutting the
|
|
8
|
+
* wrong part of the picture, and the editor has to speak the same language or
|
|
9
|
+
* the conversion becomes a second place the convention can drift.
|
|
10
|
+
*/
|
|
11
|
+
export interface GridNormalizedRect {
|
|
12
|
+
readonly x: number;
|
|
13
|
+
readonly y: number;
|
|
14
|
+
readonly width: number;
|
|
15
|
+
readonly height: number;
|
|
16
|
+
}
|
|
17
|
+
export interface GridLayoutCell {
|
|
18
|
+
readonly deviceId: number;
|
|
19
|
+
/** The part of the SOURCE taken, normalized against the source. */
|
|
20
|
+
readonly source: GridNormalizedRect;
|
|
21
|
+
/** Where it lands, normalized against the CANVAS. */
|
|
22
|
+
readonly cell: GridNormalizedRect;
|
|
23
|
+
}
|
|
24
|
+
export interface GridLayoutView {
|
|
25
|
+
readonly instanceId: string;
|
|
26
|
+
readonly deviceId: number;
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly width: number;
|
|
29
|
+
readonly height: number;
|
|
30
|
+
readonly fps: number;
|
|
31
|
+
readonly cells: readonly GridLayoutCell[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* What a read of the grid can be.
|
|
35
|
+
*
|
|
36
|
+
* Three OUTCOMES, never two: a grid, an answer of "this device is not a grid"
|
|
37
|
+
* (`null`), and a reply this page could not read (`'unreadable'`). Collapsing
|
|
38
|
+
* the last two makes "not yet known" indistinguishable from "not installed",
|
|
39
|
+
* which is exactly the failure D315 exists to stop.
|
|
40
|
+
*/
|
|
41
|
+
export type GridLayoutReadOutcome = GridLayoutView | null | 'unreadable';
|
|
42
|
+
/** Parse the `getGridForDevice` reply. See {@link GridLayoutReadOutcome}. */
|
|
43
|
+
export declare function parseGridView(raw: unknown): GridLayoutReadOutcome;
|
|
44
|
+
/**
|
|
45
|
+
* Keep a rectangle inside the unit square.
|
|
46
|
+
*
|
|
47
|
+
* The addon THROWS on a rectangle that falls outside — a silently clipped
|
|
48
|
+
* picture is worse than a refusal — so the editor must never hand it one.
|
|
49
|
+
*/
|
|
50
|
+
export declare function clampNormalizedRect(rect: GridNormalizedRect): GridNormalizedRect;
|
|
51
|
+
/** Drag: translate by a normalized delta, clamped. */
|
|
52
|
+
export declare function moveNormalizedRect(rect: GridNormalizedRect, dx: number, dy: number): GridNormalizedRect;
|
|
53
|
+
/** Resize from the bottom-right corner: the origin stays put. */
|
|
54
|
+
export declare function resizeNormalizedRect(rect: GridNormalizedRect, dw: number, dh: number): GridNormalizedRect;
|
|
@@ -1543,6 +1543,16 @@ export declare const usePtzDeletePreset: typeof trpc.ptz.deletePreset.useMutatio
|
|
|
1543
1543
|
export declare const usePtzGetOptions: typeof trpc.ptz.getOptions.useQuery;
|
|
1544
1544
|
/** Generated alias around `trpc.ptz.goHome.useMutation`. */
|
|
1545
1545
|
export declare const usePtzGoHome: typeof trpc.ptz.goHome.useMutation;
|
|
1546
|
+
/** Generated alias around `trpc.ptz.getHomePreset.useQuery`. */
|
|
1547
|
+
export declare const usePtzGetHomePreset: typeof trpc.ptz.getHomePreset.useQuery;
|
|
1548
|
+
/** Generated alias around `trpc.ptz.setHomePreset.useMutation`. */
|
|
1549
|
+
export declare const usePtzSetHomePreset: typeof trpc.ptz.setHomePreset.useMutation;
|
|
1550
|
+
/** Generated alias around `trpc.ptz.captureHomeHere.useMutation`. */
|
|
1551
|
+
export declare const usePtzCaptureHomeHere: typeof trpc.ptz.captureHomeHere.useMutation;
|
|
1552
|
+
/** Generated alias around `trpc.ptz.getHomeReturnSeconds.useQuery`. */
|
|
1553
|
+
export declare const usePtzGetHomeReturnSeconds: typeof trpc.ptz.getHomeReturnSeconds.useQuery;
|
|
1554
|
+
/** Generated alias around `trpc.ptz.setHomeReturnSeconds.useMutation`. */
|
|
1555
|
+
export declare const usePtzSetHomeReturnSeconds: typeof trpc.ptz.setHomeReturnSeconds.useMutation;
|
|
1546
1556
|
/** Generated alias around `trpc.ptz.getPosition.useQuery`. */
|
|
1547
1557
|
export declare const usePtzGetPosition: typeof trpc.ptz.getPosition.useQuery;
|
|
1548
1558
|
/** Generated alias around `trpc.ptz.setAutofocus.useMutation`. */
|
package/dist/hooks/use-ptz.d.ts
CHANGED
|
@@ -5,9 +5,27 @@ import { UseDeviceProxyTrpc } from './use-device-proxy';
|
|
|
5
5
|
* cap so the cap surface stays speed-vector-shaped.
|
|
6
6
|
*/
|
|
7
7
|
export type PTZDirection = 'up' | 'down' | 'left' | 'right' | 'up-left' | 'up-right' | 'down-left' | 'down-right';
|
|
8
|
+
/** Which preset `goHome` targets on this camera, and who decided it. */
|
|
9
|
+
interface PTZHomePreset {
|
|
10
|
+
readonly presetId: string | null;
|
|
11
|
+
readonly source: 'operator' | 'firmware' | 'native' | 'none';
|
|
12
|
+
}
|
|
8
13
|
interface PTZPreset {
|
|
9
14
|
readonly id: string;
|
|
10
15
|
readonly name: string;
|
|
16
|
+
/**
|
|
17
|
+
* The firmware function this id performs, or `null` for a stored position.
|
|
18
|
+
* A camera's reserved band shares the preset namespace: the dispensa camera
|
|
19
|
+
* returns `34 Back to origin`, `94 Remote reboot`, `95 Call OSD menu`
|
|
20
|
+
* alongside the operator's own.
|
|
21
|
+
*/
|
|
22
|
+
readonly fn: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the camera accepts a write on this id. Overwriting a reserved one
|
|
25
|
+
* is what produced `PUT .../presets/34 -> HTTP 500`, which reached the
|
|
26
|
+
* operator as a transport failure with no hint of the cause.
|
|
27
|
+
*/
|
|
28
|
+
readonly writable: boolean;
|
|
11
29
|
}
|
|
12
30
|
/**
|
|
13
31
|
* Per-camera PTZ availability descriptor returned by `ptz.getOptions`.
|
|
@@ -54,6 +72,19 @@ export interface UsePTZResult {
|
|
|
54
72
|
readonly zoom: (direction: 'in' | 'out', speed?: number) => Promise<void>;
|
|
55
73
|
/** Jump to the home preset (0 on most cameras). */
|
|
56
74
|
readonly goHome: () => Promise<void>;
|
|
75
|
+
/** Which preset `goHome` targets and who decided; `null` until loaded. */
|
|
76
|
+
readonly homePreset: PTZHomePreset | null;
|
|
77
|
+
/** Pin the home preset. `null` clears the operator's choice. */
|
|
78
|
+
readonly setHomePreset: (presetId: string | null) => Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Make where the head is pointing RIGHT NOW this camera's home. The natural
|
|
81
|
+
* gesture — aim, then say "here" — and the only one a camera whose home is
|
|
82
|
+
* not a preset can accept.
|
|
83
|
+
*/
|
|
84
|
+
readonly captureHomeHere: () => Promise<void>;
|
|
85
|
+
/** Idle seconds before the camera returns home by itself; `null` = no timer. */
|
|
86
|
+
readonly homeReturnSeconds: number | null;
|
|
87
|
+
readonly setHomeReturnSeconds: (seconds: number) => Promise<void>;
|
|
57
88
|
/** Jump to a named preset. */
|
|
58
89
|
readonly goToPreset: (presetId: string) => Promise<void>;
|
|
59
90
|
/**
|