@glasshome/widget-sdk 1.15.0 → 1.16.0

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.
@@ -71,6 +71,22 @@ var e = "https://glasshome.app/docs/widget-sdk/config", t = [
71
71
  replacement: "defineConfig({ ... })",
72
72
  docsUrl: e,
73
73
  sourcePattern: "configSchema\\s*=\\s*z\\.object\\("
74
+ },
75
+ {
76
+ id: "widget.gradient",
77
+ since: "1.16.0",
78
+ removeIn: "2.0.0",
79
+ replacement: "<Widget color colorTo>",
80
+ docsUrl: "https://glasshome.app/docs/widget-sdk/widget",
81
+ sourcePattern: "<Widget[^>]*\\sgradient="
82
+ },
83
+ {
84
+ id: "sliderFill.color",
85
+ since: "1.16.0",
86
+ removeIn: "2.0.0",
87
+ replacement: "the Widget's tone or color; the fill follows the card",
88
+ docsUrl: "https://glasshome.app/docs/widget-sdk/widget",
89
+ sourcePattern: "<WidgetSliderFill[^>]*\\scolor="
74
90
  }
75
91
  ];
76
92
  function n(e) {
@@ -2,7 +2,7 @@ import type { JSX } from "solid-js";
2
2
  interface WidgetSliderFillProps {
3
3
  /** Current value (0-100) */
4
4
  value: number;
5
- /** Per-fill channel override; sets --widget-icon-color inline. */
5
+ /** @deprecated Ignored: the fill wears the card's own tone. Removed in 2.0.0. */
6
6
  color?: string;
7
7
  /** Disables the fill transition while the user is dragging. */
8
8
  isDragging?: boolean;
@@ -31,7 +31,7 @@ interface WidgetProps {
31
31
  color?: string;
32
32
  /** Second-stop gradient color (`--widget-color-to`). */
33
33
  colorTo?: string;
34
- /** Full CSS gradient string (`--widget-gradient`); overrides the auto-shell. */
34
+ /** @deprecated Use `color` + `colorTo`; a full gradient paints over the material. Removed in 2.0.0. */
35
35
  gradient?: string;
36
36
  loading?: boolean;
37
37
  class?: string;
@@ -0,0 +1,27 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { EntityView } from "../types";
3
+ export interface WidgetDebugEntity {
4
+ entity_id: string;
5
+ state: string;
6
+ domain: string;
7
+ friendly_name?: string;
8
+ device_class: string | null;
9
+ area_id: string | null;
10
+ last_changed: string;
11
+ last_updated: string;
12
+ attributes: Record<string, unknown>;
13
+ }
14
+ export interface WidgetDebugData {
15
+ widgetConfig: Record<string, unknown>;
16
+ entities: WidgetDebugEntity[];
17
+ [key: string]: unknown;
18
+ }
19
+ export declare function buildDebugData(config: Record<string, unknown>, entities: EntityView[], extra?: Record<string, unknown>): WidgetDebugData;
20
+ export declare function WidgetDebugView(props: {
21
+ data: WidgetDebugData;
22
+ }): JSX.Element;
23
+ /** The debug tab a widget gets for free: the shaped view when its data came
24
+ * from buildDebugData, the raw payload otherwise. */
25
+ export declare function WidgetDebugTab(props: {
26
+ data?: string | Record<string, unknown>;
27
+ }): JSX.Element;
@@ -1,4 +1,5 @@
1
1
  /**
2
2
  * Dialog Components - Barrel Export
3
3
  */
4
+ export { buildDebugData, WidgetDebugTab, WidgetDebugView, type WidgetDebugData, type WidgetDebugEntity, } from "./debug-view";
4
5
  export { WidgetDialog, type WidgetDialogProps, type WidgetDialogTab } from "./WidgetDialog";
@@ -36,11 +36,11 @@ export { WidgetStatus } from "./components/WidgetStatus";
36
36
  export { WidgetTitle } from "./components/WidgetTitle";
37
37
  export { WidgetValue } from "./components/WidgetValue";
38
38
  export { WidgetSliderFill } from "./backgrounds/WidgetSliderFill";
39
- export { WidgetDialog, type WidgetDialogProps, type WidgetDialogTab } from "./dialogs";
39
+ export { buildDebugData, WidgetDebugTab, type WidgetDebugData, type WidgetDebugEntity, WidgetDebugView, WidgetDialog, type WidgetDialogProps, type WidgetDialogTab, } from "./dialogs";
40
40
  export { type AggregationPreset, type ReactiveWidgetContext, type ServiceCallFn, type UseWidgetEntityGroupOptions, type UseWidgetEntityGroupResult, useIntersectionPause, useReducedMotion, useWidgetContext, useWidgetDashboard, useWidgetViewer, useWidgetDialog, useWidgetDimensions, useWidgetEntityGroup, WidgetCtx, type WidgetDashboard, type WidgetViewer, type WidgetDialogReturn, type WidgetDimensions, type WidgetDimensionsAccessor, WidgetSizeCtx, } from "./hooks";
41
41
  export { type GestureHandlers, useWidgetGestures } from "./gestures/use-widget-gestures";
42
42
  export { injectTokens, type SvgColorKey, svgColors, type Tone, ToneSchema, } from "./theming";
43
43
  export { widgetFields } from "./fields";
44
44
  export { type ConfigShape, defineConfig, field, type Field, type Infer, } from "./config";
45
- export { calculateLightGroup, calculateSensorGroup, countActiveEntities, getEntityAttribute, isEntityActive, type LightGroupResult, type SensorGroupResult, type SensorGroupType, } from "./utils";
45
+ export { calculateLightGroup, calculateSensorGroup, type CopyState, copyText, countActiveEntities, getEntityAttribute, isEntityActive, type LightGroupResult, type SensorGroupResult, type SensorGroupType, useCopyText, } from "./utils";
46
46
  export type { EntityView, WidgetStyles, WidgetVariantConfig, } from "./types";
@@ -44,7 +44,7 @@ export interface WidgetStyles {
44
44
  /** Tailwind utility classes (for simple styling) */
45
45
  class?: string;
46
46
  /** CSS custom properties for themeable values */
47
- cssVars?: Record<`--widget-${string}`, string | number>;
47
+ cssVars?: Record<`--widget-${string}` | `--glass-${string}`, string | number>;
48
48
  }
49
49
  /**
50
50
  * Flex layout strategy with type-safe configuration
@@ -0,0 +1,9 @@
1
+ export type CopyState = "idle" | "copied" | "failed";
2
+ /** Dashboards are reached over plain http on the LAN, where navigator.clipboard
3
+ * does not exist; the selection path is the only copy those installs have. */
4
+ export declare function copyText(text: string): Promise<boolean>;
5
+ /** Copy plus the state a control needs to say what happened. */
6
+ export declare function useCopyText(resetAfterMs?: number): {
7
+ state: import("solid-js").Accessor<CopyState>;
8
+ copy: (text: string) => Promise<void>;
9
+ };
@@ -6,6 +6,7 @@
6
6
  * public re-export surface.
7
7
  */
8
8
  export { cn } from "./cn";
9
+ export { copyText, type CopyState, useCopyText } from "./clipboard";
9
10
  export { calculateLightGroup, calculateSensorGroup, type LightGroupResult, type SensorGroupResult, type SensorGroupType, } from "./entity-aggregation";
10
11
  export { countActiveEntities, getEntityAttribute, isEntityActive, } from "./entity-state";
11
12
  export { formatValue } from "./format-value";
@@ -16,7 +16,7 @@ import type { FlexLayoutStrategy, LayoutStrategy, WidgetVariantConfig } from "..
16
16
  * const customVariant = mergeVariants(classicGlass, {
17
17
  * styles: {
18
18
  * cssVars: {
19
- * "--widget-bg": "rgba(0, 0, 0, 0.5)"
19
+ * "--glass-base": "oklch(0.2 0 0 / 0.5)"
20
20
  * }
21
21
  * }
22
22
  * });
@@ -36,7 +36,7 @@ export declare function mergeVariants(base: WidgetVariantConfig, override: Parti
36
36
  * name: "Dark Glass",
37
37
  * styles: {
38
38
  * cssVars: {
39
- * "--widget-bg": "rgba(0, 0, 0, 0.5)"
39
+ * "--glass-base": "oklch(0.2 0 0 / 0.5)"
40
40
  * }
41
41
  * }
42
42
  * });
@@ -86,12 +86,12 @@ export declare function applyLayout(variant: WidgetVariantConfig, layout: Layout
86
86
  * @example
87
87
  * ```tsx
88
88
  * const blueTinted = applyCssVars(classicGlass, {
89
- * "--widget-bg": "rgba(59, 130, 246, 0.2)",
90
- * "--widget-border": "rgba(59, 130, 246, 0.3)"
89
+ * "--glass-tone": "oklch(0.62 0.2 260)",
90
+ * "--glass-wash": "30%"
91
91
  * });
92
92
  * ```
93
93
  */
94
- export declare function applyCssVars(variant: WidgetVariantConfig, cssVars: Record<`--widget-${string}`, string | number>): WidgetVariantConfig;
94
+ export declare function applyCssVars(variant: WidgetVariantConfig, cssVars: Record<`--widget-${string}` | `--glass-${string}`, string | number>): WidgetVariantConfig;
95
95
  /**
96
96
  * Create a flex layout strategy
97
97
  *