@camstack/ui-library 1.2.290 → 1.2.292
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/{MaskShapeCanvas-DI4BY7W2.js → MaskShapeCanvas-C9cJlxvG.js} +3 -1
- package/dist/{MaskShapeCanvas-BByN3jvt.cjs → MaskShapeCanvas-NCNwu9_5.cjs} +3 -1
- package/dist/{MotionZonesSettings-CiYjd-yl.js → MotionZonesSettings-Bv8XzCa3.js} +45 -48
- package/dist/{MotionZonesSettings-BK9R9NIr.cjs → MotionZonesSettings-CPRH536-.cjs} +44 -47
- package/dist/{PrivacyMaskSettings-DuXUCUev.cjs → PrivacyMaskSettings-BUWvVF_n.cjs} +33 -42
- package/dist/{PrivacyMaskSettings-BmRdUrPp.js → PrivacyMaskSettings-BlkbESYj.js} +34 -43
- package/dist/{SceneMonitorEditor-COgAjtq5.cjs → SceneMonitorEditor-D_jkzQ2o.cjs} +189 -86
- package/dist/{SceneMonitorEditor-J4Ix_0tu.js → SceneMonitorEditor-i3-nXAEU.js} +190 -87
- package/dist/composites/addon-global-settings-form.d.ts +0 -12
- package/dist/composites/cap-settings/AutotrackSection.d.ts +0 -16
- package/dist/composites/cap-settings/CameraGridLayoutEditor.d.ts +0 -21
- package/dist/composites/cap-settings/ConsumablesPanel.d.ts +0 -18
- package/dist/composites/cap-settings/MaskShapeCanvas.d.ts +0 -102
- package/dist/composites/cap-settings/MotionZonesSettings.d.ts +0 -38
- package/dist/composites/cap-settings/SceneReferenceGallery.d.ts +0 -38
- package/dist/composites/cap-settings/scene-monitor-copy.d.ts +12 -6
- package/dist/composites/clips/clip-source-state.d.ts +3 -2
- package/dist/composites/clips/clip-thumbnail-fetch.d.ts +2 -1
- package/dist/composites/clips/clip-tile-media.d.ts +3 -2
- package/dist/composites/clips/clip-view-state.d.ts +2 -1
- package/dist/composites/confirm-dialog.d.ts +0 -62
- package/dist/composites/data-table.d.ts +2 -11
- package/dist/composites/detection-canvas.d.ts +0 -9
- package/dist/composites/detection-result-tree.d.ts +0 -12
- package/dist/composites/device-controls/container-primary-hero.d.ts +0 -17
- package/dist/composites/device-controls/humidifier-control.d.ts +0 -17
- package/dist/composites/device-controls/lawn-mower-control.d.ts +2 -1
- package/dist/composites/device-controls/pet-feeder-panel.d.ts +0 -18
- package/dist/composites/device-controls/script-automation-controls.d.ts +2 -1
- package/dist/composites/device-controls/sensor-hero-card.d.ts +0 -18
- package/dist/composites/device-controls/update-control.d.ts +0 -13
- package/dist/composites/device-controls/vacuum-control.d.ts +2 -1
- package/dist/composites/device-controls/valve-control.d.ts +2 -1
- package/dist/composites/device-controls/weather-control.d.ts +2 -1
- package/dist/composites/device-item/actions.d.ts +0 -22
- package/dist/composites/device-item/helpers.d.ts +2 -1
- package/dist/composites/device-item/index.d.ts +0 -9
- package/dist/composites/device-list/batch-actions-bar.d.ts +0 -11
- package/dist/composites/device-list/filter-chips.d.ts +0 -13
- package/dist/composites/device-list/page-size-select.d.ts +2 -1
- package/dist/composites/device-list/url-state.d.ts +2 -3
- package/dist/composites/device-meta.d.ts +14 -7
- package/dist/composites/device-picker/DevicePicker.d.ts +9 -1
- package/dist/composites/device-picker/device-filter-bar.d.ts +2 -1
- package/dist/composites/device-picker/device-parent.d.ts +2 -1
- package/dist/composites/device-picker/device-selection-rows.d.ts +6 -1
- package/dist/composites/device-selector-picker.d.ts +25 -1
- package/dist/composites/device-step-matrix.d.ts +0 -26
- package/dist/composites/error-box.d.ts +0 -15
- package/dist/composites/event-stream.d.ts +2 -1
- package/dist/composites/extensions/extensions-view-state.d.ts +2 -1
- package/dist/composites/hls-quality.d.ts +3 -2
- package/dist/composites/index.d.ts +0 -2
- package/dist/composites/notification-targets-field.d.ts +2 -2
- package/dist/composites/option-select/OptionSelect.d.ts +6 -0
- package/dist/composites/pipeline-matrix-shared.d.ts +2 -1
- package/dist/composites/provider-entries/AddProviderEntryDialog.d.ts +1 -1
- package/dist/composites/provider-entries/ProviderEntryPills.d.ts +1 -1
- package/dist/composites/ptz-overlay.d.ts +0 -19
- package/dist/composites/qr-code.d.ts +0 -14
- package/dist/composites/scope-picker.d.ts +2 -1
- package/dist/composites/step-inspector/layered-settings-form.d.ts +0 -11
- package/dist/composites/step-inspector/step-inspector-panel.d.ts +0 -6
- package/dist/composites/stream-broker-selector.d.ts +0 -21
- package/dist/composites/training/TrainingBaseModelPicker.d.ts +0 -10
- package/dist/composites/training/retrain-review-badge.d.ts +2 -1
- package/dist/composites/webrtc-diagnostics/endpoint-test.d.ts +2 -1
- package/dist/composites/webrtc-diagnostics/nat-mapping.d.ts +2 -1
- package/dist/composites/webrtc-diagnostics/session-run.d.ts +2 -1
- package/dist/composites/webrtc-diagnostics/session-verdict.d.ts +2 -1
- package/dist/contexts/ui-text.d.ts +49 -0
- package/dist/generated/system-hooks.d.ts +4 -0
- package/dist/i18n/addon-i18n.d.ts +46 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/use-addon-t.d.ts +57 -0
- package/dist/index.cjs +3309 -2368
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3297 -2368
- package/dist/lib/format-last-seen.d.ts +15 -1
- package/dist/lib/phase-config.d.ts +9 -3
- package/dist/lib/pipeline-mirror.d.ts +2 -1
- package/package.json +1 -1
- package/dist/composites/data-table/data-table-header.d.ts +0 -11
- package/dist/composites/data-table/data-table-pagination.d.ts +0 -10
- package/dist/composites/data-table/data-table-row.d.ts +0 -11
- package/dist/composites/data-table/data-table.d.ts +0 -3
- package/dist/composites/data-table/index.d.ts +0 -2
- package/dist/composites/data-table/types.d.ts +0 -34
- package/dist/composites/data-table-layout.d.ts +0 -31
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Relative "last seen" formatter for the offline affordance.
|
|
3
|
+
*
|
|
4
|
+
* Renders a short relative-time label from a millisecond epoch:
|
|
5
|
+
* "just now", "5m ago", "3h ago", "2d ago". Returns `null` for missing
|
|
6
|
+
* inputs, or inputs below {@link MIN_PLAUSIBLE_TIMESTAMP_MS} (a
|
|
7
|
+
* placeholder or a seeded "known value, unknown change time" stamp), so
|
|
8
|
+
* callers can render nothing rather than a misleading "—", "NaN ago", or
|
|
9
|
+
* (for a seeded `1`) "20000 days ago".
|
|
10
|
+
*
|
|
11
|
+
* Future timestamps (clock skew between the device and the browser)
|
|
12
|
+
* collapse to "just now" instead of a negative duration.
|
|
13
|
+
*/
|
|
14
|
+
import { type UiTextFn } from "../contexts/ui-text";
|
|
15
|
+
/**
|
|
2
16
|
* The earliest timestamp a real "last seen" could plausibly carry. Below
|
|
3
17
|
* this, a value is a placeholder or a seeded "known value, unknown change
|
|
4
18
|
* time" stamp (e.g. Homematic's `HM_SEEDED_CHANGED_AT = 1`) — never a real
|
|
5
19
|
* instant. Year 2000 predates every device this renders.
|
|
6
20
|
*/
|
|
7
21
|
export declare const MIN_PLAUSIBLE_TIMESTAMP_MS: number;
|
|
8
|
-
export declare function formatLastSeen(timestampMs: number | null | undefined): string | null;
|
|
22
|
+
export declare function formatLastSeen(timestampMs: number | null | undefined, t?: UiTextFn): string | null;
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
* or use the provided `PhaseIcon` component from `./phase-icon.tsx`.
|
|
13
13
|
*/
|
|
14
14
|
import type { CameraPhase } from "@camstack/types";
|
|
15
|
+
import { type UiTextFn } from "../contexts/ui-text";
|
|
15
16
|
export interface PhaseVisual {
|
|
16
|
-
/** Human-readable label (e.g. "Active", "Load-Shed"). */
|
|
17
|
+
/** Human-readable label (e.g. "Active", "Load-Shed"), resolved through the host's translator. */
|
|
17
18
|
readonly label: string;
|
|
18
19
|
/** Tailwind text color class (e.g. "text-success"). */
|
|
19
20
|
readonly textColor: string;
|
|
@@ -24,6 +25,11 @@ export interface PhaseVisual {
|
|
|
24
25
|
/** Lucide icon name to use for this phase. */
|
|
25
26
|
readonly icon: "Activity" | "Eye" | "AlertTriangle" | "PauseCircle" | "PowerOff";
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
+
/** A table row: the label is a catalogue key + English fallback, resolved by the consumer. */
|
|
29
|
+
export interface PhaseStyle extends Omit<PhaseVisual, "label"> {
|
|
30
|
+
readonly labelKey: string;
|
|
31
|
+
readonly labelFallback: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const PHASE_CONFIG: Record<CameraPhase, PhaseStyle>;
|
|
28
34
|
/** Look up phase config with a safe fallback to `watching` for unknown values. */
|
|
29
|
-
export declare function getPhaseVisual(phase: string): PhaseVisual;
|
|
35
|
+
export declare function getPhaseVisual(phase: string, t?: UiTextFn): PhaseVisual;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentAddonConfig, CameraStepOverridePatch, PipelineSchema } from "@camstack/types";
|
|
2
|
+
import { type UiTextFn } from "../contexts/ui-text";
|
|
2
3
|
export interface MirrorSource {
|
|
3
4
|
readonly nodeId: string;
|
|
4
5
|
readonly engine: {
|
|
@@ -20,4 +21,4 @@ export interface MirrorResultEntry {
|
|
|
20
21
|
readonly reason?: string;
|
|
21
22
|
readonly patch: CameraStepOverridePatch | null;
|
|
22
23
|
}
|
|
23
|
-
export declare function mirror(input: MirrorInput): readonly MirrorResultEntry[];
|
|
24
|
+
export declare function mirror(input: MirrorInput, t?: UiTextFn): readonly MirrorResultEntry[];
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { HeaderGroup, flexRender } from "@tanstack/react-table";
|
|
2
|
-
import type { SortingState } from "./types";
|
|
3
|
-
import { type JSX } from "react";
|
|
4
|
-
interface DataTableHeaderProps<T> {
|
|
5
|
-
headerGroups: HeaderGroup<T>[];
|
|
6
|
-
onSortingChange?: (sorting: SortingState) => void;
|
|
7
|
-
stickyHeader?: boolean;
|
|
8
|
-
flexRender: typeof flexRender;
|
|
9
|
-
}
|
|
10
|
-
export declare function DataTableHeader<T>({ headerGroups, onSortingChange, stickyHeader, flexRender: render }: DataTableHeaderProps<T>): JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PaginationState } from "./types";
|
|
2
|
-
import { type JSX } from "react";
|
|
3
|
-
interface DataTablePaginationProps {
|
|
4
|
-
page: number;
|
|
5
|
-
pageSize: number;
|
|
6
|
-
total: number;
|
|
7
|
-
onPaginationChange?: (pagination: PaginationState) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare function DataTablePagination({ page, pageSize, total, onPaginationChange }: DataTablePaginationProps): JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Row, flexRender } from "@tanstack/react-table";
|
|
2
|
-
import type { JSX } from "react";
|
|
3
|
-
import type { DataTableAction } from "./types";
|
|
4
|
-
interface DataTableRowProps<T> {
|
|
5
|
-
row: Row<T>;
|
|
6
|
-
onRowClick?: (row: T) => void;
|
|
7
|
-
rowActions?: (row: T) => DataTableAction[];
|
|
8
|
-
flexRender: typeof flexRender;
|
|
9
|
-
}
|
|
10
|
-
export declare function DataTableRow<T>({ row, onRowClick, rowActions, flexRender: render }: DataTableRowProps<T>): JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { type JSX } from "react";
|
|
2
|
-
import type { DataTableProps } from "./types";
|
|
3
|
-
export declare function DataTable<T>({ data, columns: userColumns, sorting, onSortingChange, filtering, onFilteringChange, pagination, onPaginationChange, loading, emptyState, rowActions, onRowClick, selectable, compact, stickyHeader, className, mobileMode }: DataTableProps<T>): JSX.Element;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ColumnDef, SortingState, ColumnFiltersState, PaginationState } from "@tanstack/react-table";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
import type { LucideIcon } from "lucide-react";
|
|
4
|
-
export type { ColumnDef, SortingState, ColumnFiltersState, PaginationState };
|
|
5
|
-
export interface DataTableAction {
|
|
6
|
-
label: string;
|
|
7
|
-
icon?: LucideIcon;
|
|
8
|
-
onClick: () => void;
|
|
9
|
-
variant?: "danger" | "default";
|
|
10
|
-
}
|
|
11
|
-
export interface DataTableProps<T> {
|
|
12
|
-
data: T[];
|
|
13
|
-
columns: ColumnDef<T, unknown>[];
|
|
14
|
-
sorting?: SortingState;
|
|
15
|
-
onSortingChange?: (sorting: SortingState) => void;
|
|
16
|
-
filtering?: ColumnFiltersState;
|
|
17
|
-
onFilteringChange?: (filtering: ColumnFiltersState) => void;
|
|
18
|
-
pagination?: {
|
|
19
|
-
page: number;
|
|
20
|
-
pageSize: number;
|
|
21
|
-
total: number;
|
|
22
|
-
};
|
|
23
|
-
onPaginationChange?: (pagination: PaginationState) => void;
|
|
24
|
-
loading?: boolean;
|
|
25
|
-
emptyState?: ReactNode;
|
|
26
|
-
rowActions?: (row: T) => DataTableAction[];
|
|
27
|
-
onRowClick?: (row: T) => void;
|
|
28
|
-
selectable?: boolean;
|
|
29
|
-
compact?: boolean;
|
|
30
|
-
stickyHeader?: boolean;
|
|
31
|
-
className?: string;
|
|
32
|
-
/** How to render on mobile. 'scroll' keeps table with horizontal scroll. 'cards' renders each row as a card. Default: 'scroll' */
|
|
33
|
-
mobileMode?: "scroll" | "cards";
|
|
34
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The one decision a shared table has to make on a phone.
|
|
3
|
-
*
|
|
4
|
-
* A wide table has no good phone rendering. There are exactly two honest
|
|
5
|
-
* answers — become a list of cards, or scroll horizontally INSIDE its own
|
|
6
|
-
* container while the page body never moves sideways — and shrinking the font
|
|
7
|
-
* is not one of them. `DataTable` supports both; this module decides which, so
|
|
8
|
-
* the choice is a pure, testable rule instead of per-page CSS.
|
|
9
|
-
*
|
|
10
|
-
* The default is a table that scrolls horizontally inside its own container.
|
|
11
|
-
* Cards exist as an explicit `mobileMode="cards"` opt-in. `auto` still
|
|
12
|
-
* applies a column-count rule for surfaces that want the old behaviour.
|
|
13
|
-
*
|
|
14
|
-
* Pass an explicit `mobileMode` to override per table.
|
|
15
|
-
*/
|
|
16
|
-
/** Per-table override. `auto` applies the column-count rule below. */
|
|
17
|
-
export type TableMobileMode = "auto" | "scroll" | "cards";
|
|
18
|
-
/** How the table renders once the decision is made. */
|
|
19
|
-
export type TableLayoutKind = "table" | "cards";
|
|
20
|
-
/**
|
|
21
|
-
* At this many columns and above, `auto` switches a narrow viewport to cards.
|
|
22
|
-
* Three columns still fit a phone at a readable size; four do not.
|
|
23
|
-
*/
|
|
24
|
-
export declare const CARD_MODE_MIN_COLUMNS = 4;
|
|
25
|
-
export interface ResolveTableLayoutInput {
|
|
26
|
-
readonly mode: TableMobileMode;
|
|
27
|
-
readonly columnCount: number;
|
|
28
|
-
/** Viewport below the card breakpoint (`useIsMobile`). */
|
|
29
|
-
readonly isNarrow: boolean;
|
|
30
|
-
}
|
|
31
|
-
export declare function resolveTableLayout({ mode, columnCount, isNarrow }: ResolveTableLayoutInput): TableLayoutKind;
|