@camstack/ui-library 1.2.386 → 1.2.388
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/CHANGELOG.md +15 -0
- package/dist/{PrivacyMaskSettings-BUWvVF_n.cjs → PrivacyMaskSettings-BLM8OfT5.cjs} +1 -1
- package/dist/{PrivacyMaskSettings-D7o4tx8e.js → PrivacyMaskSettings-DZfNWppi.js} +1 -1
- package/dist/{SceneMonitorEditor-BwelmHlF.js → SceneMonitorEditor-C09HggGp.js} +40 -5
- package/dist/{SceneMonitorEditor-C-way4ES.cjs → SceneMonitorEditor-DjZ61oOM.cjs} +39 -4
- package/dist/{createLucideIcon-kNomBP27.js → chevron-down-B71qEdFG.js} +11 -1
- package/dist/{createLucideIcon-COWDteJh.cjs → chevron-down-VnEXTuJa.cjs} +16 -0
- package/dist/composites/cap-settings/NavigationPanel.d.ts +0 -11
- package/dist/composites/cap-settings/SceneSettingsForm.d.ts +0 -35
- package/dist/composites/data-table.d.ts +8 -1
- package/dist/composites/device-controls/dishwasher-control.d.ts +0 -14
- package/dist/composites/device-controls/primary-child.d.ts +9 -3
- package/dist/composites/device-controls/vacuum-control.d.ts +0 -16
- package/dist/composites/device-controls/water-heater-control.d.ts +0 -17
- package/dist/composites/device-item/helpers.d.ts +8 -0
- package/dist/composites/device-list/device-mode.d.ts +8 -0
- package/dist/composites/device-list/page-size-select.d.ts +0 -6
- package/dist/composites/device-list/table-layout.d.ts +4 -1
- package/dist/composites/pipeline-step.d.ts +0 -7
- package/dist/composites/scope-picker.d.ts +0 -23
- package/dist/composites/stream-panel.d.ts +0 -10
- package/dist/composites/unit-picker/UnitPicker.d.ts +0 -5
- package/dist/generated/system-hooks.d.ts +2 -20
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/use-broker-instances.d.ts +48 -0
- package/dist/hooks/use-device-removal.d.ts +26 -0
- package/dist/hooks/use-row-operations.d.ts +22 -0
- package/dist/{icons-cIFSolkx.js → icons-B1fIm76S.js} +4 -4
- package/dist/{icons-BWpVdTJu.cjs → icons-BP_WA6rt.cjs} +1486 -1486
- package/dist/index.cjs +598 -387
- package/dist/index.js +353 -138
- package/dist/{mic-off-C2VTYr91.js → mic-off-B83GCRGo.js} +1 -1
- package/dist/{mic-off-4nCMfrMI.cjs → mic-off-BKguA8pd.cjs} +3 -3
- package/dist/primitives/select.d.ts +7 -0
- package/dist/{settings-2-jT1iBqHD.js → settings-2-CHcjJCqa.js} +1 -1
- package/dist/{settings-2-CR4WtEw4.cjs → settings-2-LxL8s7fK.cjs} +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { IntegrationInstance, IntegrationInstanceDescription } from "@camstack/types";
|
|
2
|
+
export declare const BROKER_INSTANCES_QUERY_KEY = "broker-instances-holder";
|
|
3
|
+
/** One broker, as the pickers and link fields see it. */
|
|
4
|
+
export interface BrokerInstance {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
/** The registry kind of the broker (`kind.brokerKind ?? kind.id`). */
|
|
8
|
+
readonly kind: string;
|
|
9
|
+
readonly addonId: string;
|
|
10
|
+
readonly state: "ok" | "off" | "error" | "unknown";
|
|
11
|
+
readonly stateLabel: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Whether it can carry traffic now: switched on, configured (signed in) and not failing. A
|
|
14
|
+
* picker offers only these, plus the one already chosen (see {@link selectableBrokers}).
|
|
15
|
+
*/
|
|
16
|
+
readonly usable: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The brokers a picker offers: the usable ones, plus the CURRENTLY chosen one whatever its state,
|
|
20
|
+
* so an existing pick stays visible with its state instead of vanishing from the list.
|
|
21
|
+
*/
|
|
22
|
+
export declare function selectableBrokers(brokers: readonly BrokerInstance[], selectedId: string | null | undefined): readonly BrokerInstance[];
|
|
23
|
+
export interface BrokerHolderData {
|
|
24
|
+
readonly addonId: string;
|
|
25
|
+
readonly description: IntegrationInstanceDescription;
|
|
26
|
+
readonly instances: readonly IntegrationInstance[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The brokers of one holder: instances whose kind is a `broker` kind, optionally of one registry
|
|
30
|
+
* kind. The kinds are the holder's own declaration (D1013, `check-instances-kinds-declared`): a
|
|
31
|
+
* holder without `kinds` declares no broker kind, so it holds no broker. An instance of a kind
|
|
32
|
+
* that is not a `broker` kind is a device integration, never a broker.
|
|
33
|
+
*/
|
|
34
|
+
export declare function brokerInstancesOf(holder: BrokerHolderData, kind?: string): readonly BrokerInstance[];
|
|
35
|
+
export interface UseBrokerInstancesResult {
|
|
36
|
+
readonly data: readonly BrokerInstance[] | undefined;
|
|
37
|
+
readonly isLoading: boolean;
|
|
38
|
+
readonly isError: boolean;
|
|
39
|
+
readonly isSuccess: boolean;
|
|
40
|
+
readonly error: {
|
|
41
|
+
readonly message: string;
|
|
42
|
+
} | null;
|
|
43
|
+
}
|
|
44
|
+
export declare function useBrokerInstances(filter?: {
|
|
45
|
+
readonly kind?: string;
|
|
46
|
+
}, opts?: {
|
|
47
|
+
readonly enabled?: boolean;
|
|
48
|
+
}): UseBrokerInstancesResult;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type RowOperationState } from "./use-row-operations";
|
|
2
|
+
export interface UseDeviceRemovalOptions {
|
|
3
|
+
/** Must resolve only once the removal has completed on the hub. */
|
|
4
|
+
readonly remove: (input: {
|
|
5
|
+
readonly deviceId: number;
|
|
6
|
+
}) => Promise<unknown>;
|
|
7
|
+
/** Awaited after `remove`: refetch the devices list the table renders. */
|
|
8
|
+
readonly refresh?: () => Promise<unknown>;
|
|
9
|
+
/** A removal failed; the row is restored. Surface `message` (a toast). */
|
|
10
|
+
readonly onError?: (deviceId: number, message: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface DeviceRemoval {
|
|
13
|
+
/** Fire-and-track; has the shape of `DeviceListBatchActions.remove`. */
|
|
14
|
+
readonly remove: (input: {
|
|
15
|
+
readonly deviceId: number;
|
|
16
|
+
}) => void;
|
|
17
|
+
/** Awaitable form: `true` when the device was removed. */
|
|
18
|
+
readonly removeAsync: (input: {
|
|
19
|
+
readonly deviceId: number;
|
|
20
|
+
}) => Promise<boolean>;
|
|
21
|
+
/** The row's state for `<DeviceList rowOperation>`; undefined = idle. */
|
|
22
|
+
readonly rowOperation: (device: {
|
|
23
|
+
readonly id: number;
|
|
24
|
+
}) => RowOperationState | undefined;
|
|
25
|
+
}
|
|
26
|
+
export declare function useDeviceRemoval(options: UseDeviceRemovalOptions): DeviceRemoval;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type RowOperationState = {
|
|
2
|
+
readonly kind: "pending";
|
|
3
|
+
} | {
|
|
4
|
+
readonly kind: "failed";
|
|
5
|
+
readonly message: string;
|
|
6
|
+
};
|
|
7
|
+
export interface UseRowOperationsResult<K> {
|
|
8
|
+
/** Every row with a state — absent keys are idle. */
|
|
9
|
+
readonly states: ReadonlyMap<K, RowOperationState>;
|
|
10
|
+
readonly stateOf: (key: K) => RowOperationState | undefined;
|
|
11
|
+
readonly isPending: (key: K) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Run `task` for `key`. Resolves `true` when it completed, `false` when it
|
|
14
|
+
* threw or when `key` was already pending (nothing was started). A failure
|
|
15
|
+
* is reported to `onError` and kept as the key's `failed` state.
|
|
16
|
+
*/
|
|
17
|
+
readonly run: (key: K, task: () => Promise<unknown>, onError?: (message: string) => void) => Promise<boolean>;
|
|
18
|
+
/** Forget a key's failure (the row goes back to idle). */
|
|
19
|
+
readonly clearFailure: (key: K) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function errorMessageOf(error: unknown): string;
|
|
22
|
+
export declare function useRowOperations<K>(): UseRowOperationsResult<K>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as Hexagon, t as MicOff } from "./mic-off-
|
|
3
|
-
import { t as Settings2 } from "./settings-2-
|
|
4
|
-
import { $ as Shuffle, $n as Cog, $r as
|
|
1
|
+
import { n as createLucideIcon, t as ChevronDown } from "./chevron-down-B71qEdFG.js";
|
|
2
|
+
import { n as Hexagon, t as MicOff } from "./mic-off-B83GCRGo.js";
|
|
3
|
+
import { t as Settings2 } from "./settings-2-CHcjJCqa.js";
|
|
4
|
+
import { $ as Shuffle, $n as Cog, $r as AlarmSmoke, $t as Maximize2, A as Trash2, An as Funnel, Ar as Bug, At as Plane, B as Sunrise, Bn as ExternalLink, Br as BatteryWarning, Bt as Music, C as Unlink2, Cn as Hand, Cr as ChartLine, Ct as QrCode, D as TriangleAlert, Dn as GraduationCap, Dr as Camera, Dt as Plug, E as Truck, En as Grid2x2, Er as Car, Et as PowerOff, F as Timer, Fn as Film, Fr as Bird, Ft as PawPrint, G as Sprout, Gn as Download, Gr as Ban, Gt as Moon, H as SunMedium, Hn as EllipsisVertical, Hr as BatteryLow, Ht as MoveVertical, I as TimerOff, In as Feather, Ir as Bike, It as Pause, J as Smartphone, Jn as Dog, Jr as ArrowUpToLine, Jt as Minimize2, K as Sparkles, Kn as DoorOpen, Kr as Baby, Kt as MonitorPlay, L as Thermometer, Ln as Fan, Lr as Bell, Lt as Package, M as Tractor, Mn as Flashlight, Mr as Bot, Mt as Pin, N as ToggleRight, Nn as FlashlightOff, Nr as Bone, Nt as Phone, O as TrendingDown, On as Gauge, Or as Cable, Ot as Plus, P as ToggleLeft, Pn as Flame, Pr as Blinds, Pt as Pencil, Q as Siren, Qn as Copy, Qr as ArrowDownToLine, Qt as Megaphone, R as Target, Rn as Eye, Rr as BellRing, Rt as Network, S as Upload, Sn as HardDrive, Sr as Check, St as Radar, T as Type, Tn as GripHorizontal, Tr as Cast, Tt as Power, U as Star, Un as Droplets, Ur as BatteryFull, Ut as MoveHorizontal, V as Sun, Vn as Eraser, Vr as BatteryMedium, Vt as Move, W as Square, Wn as Droplet, Wr as Bath, Wt as MousePointerClick, X as SkipForward, Xn as Crosshair, Xr as ArrowLeft, Xt as MessageSquare, Y as SlidersHorizontal, Yn as Database, Yr as ArrowRight, Yt as Mic, Z as SkipBack, Zn as Cpu, Zr as ArrowDown, Zt as Menu, _ as Vibrate, _n as ImageOff, _r as ChevronsUpDown, _t as Repeat, a as Wrench, an as LoaderCircle, ar as CloudFog, at as Share2, b as User, bn as Heater, br as ChevronRight, bt as Radio, c as Wifi, cr as CircleX, ct as Search, d as WifiLow, dn as Leaf, dr as CirclePlus, dt as Save, ei as AirVent, en as MapPin, er as Cloud, et as Ship, f as WifiHigh, fn as LayoutGrid, fr as CirclePause, ft as Sailboat, g as Volume2, gn as Image, gr as CircleAlert, gt as RotateCcw, h as VolumeX, hn as Inbox, hr as CircleCheckBig, ht as RotateCw, i as X, in as LocateFixed, ir as CloudLightning, it as ShieldAlert, j as TrainFront, jn as Footprints, jr as Box, jt as Pipette, k as TrendingUp, kn as Gamepad2, kr as Bus, kt as Play, l as WifiZero, ln as Link2, lr as CircleStop, lt as ScrollText, m as WashingMachine, mn as Info, mr as CircleCheck, mt as Route, n as ZoomIn, nn as Lock, nr as CloudSnow, nt as ShieldOff, o as Workflow, on as List, or as Clock, ot as Settings, p as Waves, pn as Laugh, pr as CircleDot, pt as Router, q as Snowflake, qn as DoorClosed, qr as ArrowUp, qt as Minus, r as Zap, rn as LockOpen, rr as CloudRain, rt as ShieldCheck, s as Wind, sn as ListChecks, sr as Clapperboard, st as Server, t as ZoomOut, ti as Activity, tn as Mail, tr as CloudSun, tt as Shield, u as WifiOff, un as Lightbulb, ur as CircleQuestionMark, ut as Scan, v as UtensilsCrossed, vn as House, vr as ChevronsDownUp, vt as Repeat1, w as Undo2, wn as Hammer, wr as Cat, wt as Puzzle, x as UserCheck, xn as Hash, xr as ChevronLeft, xt as RadioTower, y as Users, yn as History, yr as ChevronUp, yt as RefreshCw, z as Tag, zn as EyeOff, zr as Battery, zt as Navigation } from "./index.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.576.0 - ISC
|
|
7
7
|
*
|