@camstack/ui-library 1.2.173 → 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.
@@ -1,32 +1,7 @@
1
- import { TEXT_HINT, WidgetPanel, c as createLucideIcon, isAbsentProvider, useDeviceProxy, usePlayerOverlayLayer, useSystem } from "./index.js";
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, c as createLucideIcon, i as Mic, isAbsentProvider, n as Square, o as EyeOff, t as Trash2, useDeviceProxy, usePlayerOverlayLayer, useSystem } from "./index.js";
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 createLucideIcon, coverageLine, hubPath, isAbsentProvider, r as RotateCcw, roiTooLarge, s as Camera, statusLine, t as Trash2, useDeviceProxy, useDeviceSnapshotImage, useDeviceStateSlice, useSystem, variantLabel } from "./index.js";
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,4 @@
1
+ export interface CameraGridLayoutEditorProps {
2
+ readonly deviceId: number;
3
+ }
4
+ export declare function CameraGridLayoutEditor({ deviceId }: CameraGridLayoutEditorProps): import("react").JSX.Element;
@@ -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;
@@ -1547,6 +1547,12 @@ export declare const usePtzGoHome: typeof trpc.ptz.goHome.useMutation;
1547
1547
  export declare const usePtzGetHomePreset: typeof trpc.ptz.getHomePreset.useQuery;
1548
1548
  /** Generated alias around `trpc.ptz.setHomePreset.useMutation`. */
1549
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;
1550
1556
  /** Generated alias around `trpc.ptz.getPosition.useQuery`. */
1551
1557
  export declare const usePtzGetPosition: typeof trpc.ptz.getPosition.useQuery;
1552
1558
  /** Generated alias around `trpc.ptz.setAutofocus.useMutation`. */
@@ -76,6 +76,15 @@ export interface UsePTZResult {
76
76
  readonly homePreset: PTZHomePreset | null;
77
77
  /** Pin the home preset. `null` clears the operator's choice. */
78
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>;
79
88
  /** Jump to a named preset. */
80
89
  readonly goToPreset: (presetId: string) => Promise<void>;
81
90
  /**