@camstack/ui-library 1.1.42 → 1.1.44
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 +2 -2
- package/dist/composites/device-controls/control-registry.d.ts +14 -5
- package/dist/composites/device-step-matrix.d.ts +33 -0
- package/dist/composites/index.d.ts +3 -0
- package/dist/composites/pipeline-matrix-shared.d.ts +69 -0
- package/dist/composites/pipeline-tree-matrix.d.ts +2 -14
- package/dist/generated/system-hooks.d.ts +0 -2
- package/dist/hooks/use-device-webrtc.d.ts +2 -1
- package/dist/index.cjs +764 -270
- package/dist/index.js +764 -271
- package/package.json +1 -1
|
@@ -168,7 +168,7 @@ export interface CameraStreamPlayerProps {
|
|
|
168
168
|
* Main/High (incl. 4K) source pass through with NO transcode — the only
|
|
169
169
|
* path that lets iOS decode High. The caller closes over the target.
|
|
170
170
|
*/
|
|
171
|
-
handleOffer?: (sdpOffer: string, sessionId?: string) => Promise<ClientOfferResult>;
|
|
171
|
+
handleOffer?: (sdpOffer: string, sessionId?: string, hints?: ClientStreamHints) => Promise<ClientOfferResult>;
|
|
172
172
|
/**
|
|
173
173
|
* Fetch the browser-side ICE servers (STUN + TURN) for client-offer mode.
|
|
174
174
|
* Called BEFORE the offer is built so a remote/CGNAT viewer can gather a
|
|
@@ -205,7 +205,7 @@ export interface CameraStreamPlayerProps {
|
|
|
205
205
|
* the server-chosen downgrade target instead. Required (alongside
|
|
206
206
|
* `getSessionState`) for adaptive re-offer to run.
|
|
207
207
|
*/
|
|
208
|
-
reoffer?: (sessionId: string, sdpOffer: string, target: PlayerWebrtcTarget) => Promise<ClientOfferResult>;
|
|
208
|
+
reoffer?: (sessionId: string, sdpOffer: string, target: PlayerWebrtcTarget, hints?: ClientStreamHints) => Promise<ClientOfferResult>;
|
|
209
209
|
/**
|
|
210
210
|
* Optional poster image (snapshot data-URL) shown by the <video> before
|
|
211
211
|
* the FIRST-EVER frame is decoded. Only a cold-start fallback — once a
|
|
@@ -17,8 +17,16 @@ export interface DeviceTypeControl {
|
|
|
17
17
|
readonly HeroCard: (p: DeviceControlProps) => ReactNode;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Exhaustive record over DeviceType
|
|
21
|
-
*
|
|
20
|
+
* Exhaustive record over DeviceType, DERIVED from the shared decision
|
|
21
|
+
* (`DEVICE_TYPE_CONTROL_KIND`) composed with the web `CONTROL_KIND_COMPONENTS`
|
|
22
|
+
* binding — so the type→control mapping can never diverge from the single
|
|
23
|
+
* source in `@camstack/types`. Preserved as a public export for consumers/tests
|
|
24
|
+
* that index it by `DeviceType`.
|
|
25
|
+
*
|
|
26
|
+
* The `Object.fromEntries` result is a `{ [k: string]: DeviceTypeControl }`;
|
|
27
|
+
* `Object.values(DeviceType)` (a string enum) yields exactly the enum's members,
|
|
28
|
+
* so the record is fully populated — the assertion narrows that documented
|
|
29
|
+
* enum-record projection boundary.
|
|
22
30
|
*/
|
|
23
31
|
export declare const DEVICE_TYPE_CONTROL: Record<DeviceType, DeviceTypeControl>;
|
|
24
32
|
/**
|
|
@@ -53,9 +61,10 @@ export declare const CONTROL_FILLS: Record<DeviceType, boolean>;
|
|
|
53
61
|
*/
|
|
54
62
|
export type ControlPlacement = 'right' | 'center' | 'table';
|
|
55
63
|
/**
|
|
56
|
-
* Runtime-string-safe lookup: a device row's `type` crosses the wire
|
|
57
|
-
*
|
|
58
|
-
*
|
|
64
|
+
* Runtime-string-safe lookup: a device row's `type` crosses the wire as a plain
|
|
65
|
+
* string. The type→control-kind DECISION is single-sourced in `@camstack/types`
|
|
66
|
+
* (`resolveDeviceControlKind`, null for an unrecognised type); this maps the
|
|
67
|
+
* resolved kind onto the web components.
|
|
59
68
|
*/
|
|
60
69
|
export declare function resolveDeviceControl(type: string): DeviceTypeControl | null;
|
|
61
70
|
/**
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { StepTreeNode } from './step-tree-master';
|
|
2
|
+
import { AgentColumn, CellState } from './pipeline-matrix-shared';
|
|
3
|
+
export type { AgentColumn, CellState } from './pipeline-matrix-shared';
|
|
4
|
+
/**
|
|
5
|
+
* Per-camera gate state for a step (node-independent). `zone-driven` steps
|
|
6
|
+
* (package-detection) sit OUTSIDE the gate — a badge, never a switch.
|
|
7
|
+
*/
|
|
8
|
+
export type StepGate = {
|
|
9
|
+
readonly kind: 'gate';
|
|
10
|
+
readonly effectiveOn: boolean;
|
|
11
|
+
readonly defaultOn: boolean;
|
|
12
|
+
readonly explicit: boolean;
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: 'zone-driven';
|
|
15
|
+
};
|
|
16
|
+
export interface DeviceStepMatrixProps {
|
|
17
|
+
readonly tree: readonly StepTreeNode[];
|
|
18
|
+
readonly agents: readonly AgentColumn[];
|
|
19
|
+
readonly gateFor: (addonId: string) => StepGate;
|
|
20
|
+
readonly getCellState: (addonId: string, agentNodeId: string) => CellState;
|
|
21
|
+
readonly onCellClick: (addonId: string, agentNodeId: string) => void;
|
|
22
|
+
readonly selectedCell: {
|
|
23
|
+
readonly addonId: string;
|
|
24
|
+
readonly agentNodeId: string;
|
|
25
|
+
} | null;
|
|
26
|
+
/** `next: null` resets the gate to the catalog default (inherit). */
|
|
27
|
+
readonly onSetGate: (addonId: string, next: boolean | null) => void;
|
|
28
|
+
readonly gateBusy?: boolean;
|
|
29
|
+
/** Single-node fallback (B): which node the one column shows. */
|
|
30
|
+
readonly fallbackNodeId: string | null;
|
|
31
|
+
readonly onFallbackNodeChange: (nodeId: string) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare function DeviceStepMatrix({ tree, agents, gateFor, getCellState, onCellClick, selectedCell, onSetGate, gateBusy, fallbackNodeId, onFallbackNodeChange, }: DeviceStepMatrixProps): import("react").JSX.Element;
|
|
@@ -9,6 +9,9 @@ export { AgentStepEditor } from './agent-step-editor';
|
|
|
9
9
|
export type { AgentStepEditorProps, EditorMode } from './agent-step-editor';
|
|
10
10
|
export { PipelineTreeMatrix } from './pipeline-tree-matrix';
|
|
11
11
|
export type { PipelineTreeMatrixProps, AgentColumn, CellState } from './pipeline-tree-matrix';
|
|
12
|
+
export { DeviceStepMatrix } from './device-step-matrix';
|
|
13
|
+
export type { DeviceStepMatrixProps, StepGate } from './device-step-matrix';
|
|
14
|
+
export { shouldUseSingleNode } from './pipeline-matrix-shared';
|
|
12
15
|
export { NodePicker } from './node-picker';
|
|
13
16
|
export type { NodePickerProps } from './node-picker';
|
|
14
17
|
export * from './status-badge';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PipelineSlot } from '@camstack/types';
|
|
3
|
+
import { StepTreeNode } from './step-tree-master';
|
|
4
|
+
export interface AgentColumn {
|
|
5
|
+
readonly agentNodeId: string;
|
|
6
|
+
readonly engineLabel: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A single (step, node) cell's rendered state.
|
|
10
|
+
* - `enabled` — the node runs a model for this step (chip + optional `ovr`).
|
|
11
|
+
* - `disabled` — cluster-default off (used by the per-node matrix only).
|
|
12
|
+
* - `skip` — #33: gated ON for the camera but this node has no compatible
|
|
13
|
+
* model — a visible amber status, never silent.
|
|
14
|
+
* - `na` — not applicable on this node.
|
|
15
|
+
*/
|
|
16
|
+
export type CellState = {
|
|
17
|
+
readonly kind: 'enabled';
|
|
18
|
+
readonly modelId: string;
|
|
19
|
+
readonly overridden?: boolean;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: 'disabled';
|
|
22
|
+
readonly overridden?: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: 'na';
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'skip';
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Fixed column geometry (rem). Both matrices use CSS-grid STATIC track widths
|
|
30
|
+
* so a cell's content (a status chip, a long model id) can never resize a
|
|
31
|
+
* column or shift its neighbours — content truncates WITHIN the fixed track.
|
|
32
|
+
* This kills the "table dances when the last column's status changes" jitter.
|
|
33
|
+
*/
|
|
34
|
+
export declare const AGENT_COL_REM = 13;
|
|
35
|
+
export declare const REM_PX = 16;
|
|
36
|
+
export declare const AGENT_COL_PX: number;
|
|
37
|
+
export interface FlatRow {
|
|
38
|
+
readonly node: StepTreeNode;
|
|
39
|
+
readonly depth: number;
|
|
40
|
+
}
|
|
41
|
+
export declare function flattenTree(nodes: readonly StepTreeNode[]): readonly FlatRow[];
|
|
42
|
+
/**
|
|
43
|
+
* Layout decision for the responsive A↔B switch. Pure so it can be unit-tested
|
|
44
|
+
* in isolation from the DOM.
|
|
45
|
+
*
|
|
46
|
+
* Returns `true` (single-node fallback) when there is MORE than one node but
|
|
47
|
+
* the container is too narrow to show the step column plus at least TWO node
|
|
48
|
+
* columns side by side. An unmeasured container (`width <= 0`) defaults to the
|
|
49
|
+
* wide matrix so there is no first-paint flash into the fallback.
|
|
50
|
+
*/
|
|
51
|
+
export declare function shouldUseSingleNode(width: number, nodeCount: number, stepColPx: number, agentColPx?: number): boolean;
|
|
52
|
+
export declare function SlotHeading({ slot }: {
|
|
53
|
+
readonly slot: PipelineSlot;
|
|
54
|
+
}): import("react").JSX.Element;
|
|
55
|
+
export declare function ClassChips({ inputs, outputs, }: {
|
|
56
|
+
readonly inputs: readonly string[];
|
|
57
|
+
readonly outputs: readonly string[];
|
|
58
|
+
}): import("react").JSX.Element | null;
|
|
59
|
+
/** Step label (slot heading + addon name + class chips), shared by both views. */
|
|
60
|
+
export declare function StepLabel({ node }: {
|
|
61
|
+
readonly node: StepTreeNode;
|
|
62
|
+
}): import("react").JSX.Element;
|
|
63
|
+
/**
|
|
64
|
+
* Cell content. Width-stable: the status dot is `shrink-0` (reserved space) and
|
|
65
|
+
* the model id truncates inside a `min-w-0` flex row, so a longer model id never
|
|
66
|
+
* widens the cell — it ellipsises instead.
|
|
67
|
+
*/
|
|
68
|
+
export declare function renderCellContent(state: CellState): ReactNode;
|
|
69
|
+
export declare function cellButtonClass(state: CellState, isSelected: boolean, extra?: string): string;
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { StepTreeNode } from './step-tree-master';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
readonly engineLabel: string;
|
|
5
|
-
}
|
|
6
|
-
export type CellState = {
|
|
7
|
-
readonly kind: 'enabled';
|
|
8
|
-
readonly modelId: string;
|
|
9
|
-
readonly overridden?: boolean;
|
|
10
|
-
} | {
|
|
11
|
-
readonly kind: 'disabled';
|
|
12
|
-
readonly overridden?: boolean;
|
|
13
|
-
} | {
|
|
14
|
-
readonly kind: 'na';
|
|
15
|
-
};
|
|
2
|
+
import { AgentColumn, CellState } from './pipeline-matrix-shared';
|
|
3
|
+
export type { AgentColumn, CellState } from './pipeline-matrix-shared';
|
|
16
4
|
export interface PipelineTreeMatrixProps {
|
|
17
5
|
readonly tree: readonly StepTreeNode[];
|
|
18
6
|
readonly agents: readonly AgentColumn[];
|
|
@@ -43,8 +43,6 @@ export declare const useAddonsListFrameworkPackages: typeof trpc.addons.listFram
|
|
|
43
43
|
export declare const useAddonsListCapabilityProviders: typeof trpc.addons.listCapabilityProviders.useQuery;
|
|
44
44
|
/** Generated alias around `trpc.addons.setCapabilityProviderEnabled.useMutation`. */
|
|
45
45
|
export declare const useAddonsSetCapabilityProviderEnabled: typeof trpc.addons.setCapabilityProviderEnabled.useMutation;
|
|
46
|
-
/** Generated alias around `trpc.addons.updateFrameworkPackage.useMutation`. */
|
|
47
|
-
export declare const useAddonsUpdateFrameworkPackage: typeof trpc.addons.updateFrameworkPackage.useMutation;
|
|
48
46
|
/** Generated alias around `trpc.addons.getVersions.useQuery`. */
|
|
49
47
|
export declare const useAddonsGetVersions: typeof trpc.addons.getVersions.useQuery;
|
|
50
48
|
/** Generated alias around `trpc.addons.restartAddon.useMutation`. */
|
|
@@ -65,6 +65,7 @@ export interface UseDeviceWebrtcTrpc {
|
|
|
65
65
|
target: WebrtcTarget;
|
|
66
66
|
sdpOffer: string;
|
|
67
67
|
sessionId?: string;
|
|
68
|
+
hints?: ClientStreamHints;
|
|
68
69
|
}, {
|
|
69
70
|
sessionId: string;
|
|
70
71
|
sdpAnswer: string;
|
|
@@ -160,7 +161,7 @@ export interface DeviceWebrtcResult {
|
|
|
160
161
|
* H.264 decode caps in the offer, so a Main/High (incl. 4K) source passes
|
|
161
162
|
* through with no transcode — the only path that lets iOS decode High.
|
|
162
163
|
*/
|
|
163
|
-
readonly handleOffer: (target: WebrtcTarget, sdpOffer: string, sessionId?: string) => Promise<ClientOfferResult>;
|
|
164
|
+
readonly handleOffer: (target: WebrtcTarget, sdpOffer: string, sessionId?: string, hints?: ClientStreamHints) => Promise<ClientOfferResult>;
|
|
164
165
|
/**
|
|
165
166
|
* Fetch the browser-side ICE servers (STUN + TURN from the `turn-provider`
|
|
166
167
|
* cap). Needed for client-offer mode, where the PeerConnection must be
|