@glasshome/widget-sdk 1.5.0 → 1.6.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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +271 -255
- package/dist/types.d.ts +15 -2
- package/dist/vite/index.d.ts +7 -1
- package/dist/vite/index.js +109 -109
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3,12 +3,12 @@ import { WidgetManifestSchema as r, formatSchemaError as i } from "./schemas.js"
|
|
|
3
3
|
import { z as a, z as o } from "zod";
|
|
4
4
|
import { getForecasts as s, getStream as c, getWebRtcClientConfig as l, hassMediaUrl as u, sendWebRtcCandidate as d, startWebRtcSession as f, state as p, trackEntityHistory as m, untrackEntityHistory as h } from "@glasshome/sync-layer";
|
|
5
5
|
import { byDomain as g, useArea as _, useCamera as v, useConnection as ee, useCurrency as y, useEntities as b, useEntity as te, useEntityHistory as x, useEntityStatistics as ne, useForecast as re, useHassConfig as ie, useLocale as ae, useService as S, useStore as oe, useTemperatureUnit as se, useToggle as ce, useTurnOff as le, useTurnOn as ue, useUnitSystem as de } from "@glasshome/sync-layer/solid";
|
|
6
|
-
import { Show as C, createContext as fe, createEffect as w, createMemo as T, createSignal as E, on as
|
|
7
|
-
import { addEventListener as
|
|
8
|
-
import { clsx as
|
|
9
|
-
import { twMerge as
|
|
6
|
+
import { Show as C, createContext as fe, createEffect as w, createMemo as T, createSignal as E, on as D, onCleanup as O, onMount as pe, splitProps as me, untrack as he, useContext as k } from "solid-js";
|
|
7
|
+
import { addEventListener as A, className as j, createComponent as M, delegateEvents as ge, effect as N, insert as P, memo as F, setStyleProperty as I, style as _e, template as L, use as ve } from "solid-js/web";
|
|
8
|
+
import { clsx as ye } from "clsx";
|
|
9
|
+
import { twMerge as be } from "tailwind-merge";
|
|
10
10
|
//#region src/framework/to-form-schema.ts
|
|
11
|
-
function
|
|
11
|
+
function xe(e) {
|
|
12
12
|
return o.toJSONSchema(e, { override: (e) => {
|
|
13
13
|
let t = o.globalRegistry.get(e.zodSchema);
|
|
14
14
|
return t && typeof t == "object" && Object.keys(t).length > 0 ? {
|
|
@@ -17,7 +17,7 @@ function Se(e) {
|
|
|
17
17
|
} : e.jsonSchema;
|
|
18
18
|
} });
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Se(e) {
|
|
21
21
|
try {
|
|
22
22
|
return e.parse({});
|
|
23
23
|
} catch {
|
|
@@ -26,82 +26,82 @@ function Ce(e) {
|
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/define-widget.ts
|
|
29
|
-
function
|
|
30
|
-
return e.configSchema && (e.manifest.schema || (e.manifest.schema =
|
|
29
|
+
function Ce(e) {
|
|
30
|
+
return e.configSchema && (e.manifest.schema || (e.manifest.schema = xe(e.configSchema)), e.manifest.defaultConfig || (e.manifest.defaultConfig = Se(e.configSchema))), e;
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/framework/hooks/use-widget-context.ts
|
|
34
|
-
var
|
|
35
|
-
function
|
|
36
|
-
let e =
|
|
34
|
+
var R = fe();
|
|
35
|
+
function we() {
|
|
36
|
+
let e = k(R);
|
|
37
37
|
if (!e) throw Error("useWidgetContext must be used within a Widget component");
|
|
38
38
|
return e;
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/framework/hooks/use-service.ts
|
|
42
|
-
function
|
|
42
|
+
function Te(e) {
|
|
43
43
|
let t = Array.isArray(e) ? e[0] : e, n = t?.split(".")[0];
|
|
44
44
|
if (!n) throw Error(`Invalid entity ID: ${String(t)}`);
|
|
45
45
|
return n;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
return (n, r = {}) => e(
|
|
47
|
+
function z(e, t) {
|
|
48
|
+
return (n, r = {}) => e(Te(n), t, r, { entity_id: n });
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
let e =
|
|
50
|
+
function Ee() {
|
|
51
|
+
let e = k(R)?.callService;
|
|
52
52
|
return e ? {
|
|
53
53
|
callService: e,
|
|
54
|
-
turnOn:
|
|
55
|
-
turnOff:
|
|
56
|
-
toggle:
|
|
54
|
+
turnOn: z(e, "turn_on"),
|
|
55
|
+
turnOff: z(e, "turn_off"),
|
|
56
|
+
toggle: z(e, "toggle")
|
|
57
57
|
} : S();
|
|
58
58
|
}
|
|
59
|
+
function De() {
|
|
60
|
+
let e = k(R)?.callService;
|
|
61
|
+
return e ? z(e, "turn_on") : ue();
|
|
62
|
+
}
|
|
59
63
|
function Oe() {
|
|
60
|
-
let e =
|
|
61
|
-
return e ?
|
|
64
|
+
let e = k(R)?.callService;
|
|
65
|
+
return e ? z(e, "turn_off") : le();
|
|
62
66
|
}
|
|
63
67
|
function ke() {
|
|
64
|
-
let e =
|
|
65
|
-
return e ?
|
|
66
|
-
}
|
|
67
|
-
function Ae() {
|
|
68
|
-
let e = O(L)?.callService;
|
|
69
|
-
return e ? R(e, "toggle") : ce();
|
|
68
|
+
let e = k(R)?.callService;
|
|
69
|
+
return e ? z(e, "toggle") : ce();
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/framework/design-system/z-index.ts
|
|
73
|
-
var
|
|
73
|
+
var B = {
|
|
74
74
|
BACKGROUND: 0,
|
|
75
75
|
CONTENT: 10,
|
|
76
76
|
OVERLAY: 20,
|
|
77
77
|
ACTIONS: 30
|
|
78
|
-
},
|
|
79
|
-
function
|
|
80
|
-
return
|
|
78
|
+
}, Ae = "/* Authoritative SDK CSS contract. Injected once on first Widget mount\n * via framework/theming/tokens.ts.\n *\n * All widget-internal visual scale is driven from CSS custom properties +\n * container queries on the `.glasshome-widget` shell (`container-type: size`).\n * No JS classifier, no size tier enum.\n */\n\n:root {\n --tone-success: oklch(0.70 0.18 145);\n --tone-warning: oklch(0.80 0.17 75);\n --tone-danger: oklch(0.64 0.22 27);\n --tone-info: oklch(0.66 0.20 245);\n --tone-neutral: oklch(0.65 0.02 250);\n --tone-accent: oklch(0.74 0.18 60);\n\n --widget-grad-strength: 1;\n --widget-glow-default: 0.4;\n --widget-border-highlight: oklch(0.98 0 0 / 0.4);\n}\n\n.dark {\n --tone-success: oklch(0.74 0.18 145);\n --tone-warning: oklch(0.82 0.17 75);\n --tone-danger: oklch(0.68 0.22 27);\n --tone-info: oklch(0.70 0.20 245);\n --tone-neutral: oklch(0.69 0.02 250);\n --tone-accent: oklch(0.78 0.18 60);\n\n --widget-grad-strength: 1.1;\n --widget-glow-default: 0.5;\n --widget-border-highlight: oklch(1 0 0 / 0.08);\n}\n\n@property --widget-color {\n syntax: \"<color>\";\n inherits: true;\n initial-value: oklch(0.65 0.02 250);\n}\n\n/* === Widget shell ===\n * Fluid scale tokens — tied to the shell's own container box (cqb=height, cqi=width).\n * Icon/pad/gap track HEIGHT (cqb) not the shortest side: two widgets of equal\n * height match regardless of width (a 2×2 and a 4×2 get the same icon). cqmin\n * starved portrait tiles by pinning the icon to the narrow width. Tune\n * multipliers / clamps to adjust density. */\n.glasshome-widget {\n --widget-color: var(--tone-neutral);\n --widget-glow-strength: var(--widget-glow-default);\n\n --widget-icon-box: clamp(44px, 25cqb, 58px);\n --widget-icon-glyph: clamp(24px, 14cqb, 33px);\n --widget-pad: clamp(8px, 3.5cqb, 22px);\n --widget-gap: clamp(6px, 2cqb, 14px);\n --widget-title-size: clamp(12px, 2cqi, 18px);\n --widget-subtitle: clamp(12px, 2.5cqi, 20px);\n --widget-status-size: clamp(14px, 5cqi, 36px);\n --widget-value-size: clamp(18px, 7cqi, 48px);\n --widget-badge-size: clamp(11px, 1.6cqi, 14px);\n}\n\n.glasshome-widget {\n background: var(--widget-gradient,\n linear-gradient(135deg,\n color-mix(in oklch, var(--widget-color) calc(22% * var(--widget-grad-strength)), transparent),\n color-mix(in oklch, var(--widget-color-to, var(--widget-color)) calc(11% * var(--widget-grad-strength)), transparent)\n )\n );\n box-shadow: inset 0 1px 0 var(--widget-border-highlight);\n}\n\n/* === Slot: content layout === */\n/* Default: column. Flip to row only on wide-and-short widgets (matches the\n * old contentLayout heuristic: aspect > 1 AND height < 150px). */\n.glasshome-widget-content {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n padding: var(--widget-pad);\n gap: var(--widget-gap);\n overflow: hidden;\n}\n@container widget (min-aspect-ratio: 1) and (max-height: 149px) {\n .glasshome-widget-content {\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n }\n}\n\n/* === Compact 1×1 ===\n * Small in BOTH axes → stack the tile: icon on top, label + status centered\n * under it. Icon stays moderate (not a hero) so the text keeps room. Wide\n * tiles (2×1) fail the width test and keep the row layout above. Placed after\n * the row-flip so it wins. */\n@container widget (max-width: 189px) and (max-height: 189px) {\n .glasshome-widget-content {\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: clamp(4px, 2.5cqmin, 8px);\n }\n .glasshome-widget-content > * { align-items: center; text-align: center; }\n .glasshome-widget-icon {\n --widget-icon-box: clamp(36px, 30cqmin, 56px);\n --widget-icon-glyph: clamp(20px, 17cqmin, 32px);\n }\n .glasshome-widget-title { font-size: clamp(11px, 6cqmin, 14px); max-width: 100%; }\n .glasshome-widget-status,\n .glasshome-widget-value { font-size: clamp(13px, 7cqmin, 17px); }\n .glasshome-widget-content [class*=\"ml-auto\"] { margin-left: 0 !important; }\n}\n.glasshome-widget-content [class*=\"ml-auto\"] {\n position: relative;\n z-index: 30;\n}\n\n/* === Slot: icon === */\n.glasshome-widget-icon {\n width: var(--widget-icon-box);\n height: var(--widget-icon-box);\n border-radius: var(--radius-sm, 12px);\n background: var(--widget-icon-color, var(--widget-color));\n box-shadow: 0 0 calc(var(--widget-glow-strength) * 30px)\n color-mix(in oklch, var(--widget-icon-color, var(--widget-color)) 50%, transparent);\n color: oklch(from var(--widget-icon-color, var(--widget-color)) calc(0.52 + sign(0.5 - l) * 0.43) calc(c * 0.2) h);\n}\n.glasshome-widget-icon-glyph {\n font-size: var(--widget-icon-glyph);\n line-height: 1;\n}\n.glasshome-widget-icon-stack {\n position: absolute;\n width: 102%;\n height: 102%;\n border-radius: var(--radius-sm, 12px);\n}\n.glasshome-widget-icon-stack-2 { bottom: -14%; right: -10%; opacity: 0.45; z-index: -2; }\n.glasshome-widget-icon-stack-3 { bottom: -28%; right: -20%; opacity: 0.20; z-index: -3; }\n\n/* === Slot: text === */\n.glasshome-widget-title {\n font-size: var(--widget-title-size);\n line-height: 1.2;\n color: color-mix(in oklch, var(--color-foreground, currentColor) 60%, transparent);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.glasshome-widget-subtitle {\n font-size: var(--widget-subtitle);\n color: color-mix(in oklch, var(--color-foreground, currentColor) 60%, transparent);\n}\n.glasshome-widget-status {\n font-size: var(--widget-status-size);\n font-weight: 700;\n color: var(--color-foreground, currentColor);\n line-height: 1.1;\n}\n.glasshome-widget-value {\n font-size: var(--widget-value-size);\n font-weight: 700;\n color: var(--color-foreground, currentColor);\n line-height: 1.05;\n}\n.glasshome-widget-badge {\n font-size: var(--widget-badge-size);\n font-weight: 500;\n padding: 0.125rem 0.5rem;\n border-radius: 9999px;\n background: color-mix(in oklch, var(--color-foreground, currentColor) 20%, transparent);\n color: var(--color-foreground, currentColor);\n}\n\n.glasshome-widget-loading {\n background: color-mix(in oklch, var(--widget-color) 20%, transparent);\n}\n\n/* === Slider fill ===\n * Value flows in via --widget-fill-value (0-100). Vertical orientation auto-\n * detected via container query. */\n.glasshome-widget-slider-fill {\n --widget-fill-value: 0;\n background: color-mix(in oklch, var(--widget-icon-color, var(--widget-color)) 30%, transparent);\n box-shadow: 0 0 calc(var(--widget-glow-strength) * 40px)\n color-mix(in oklch, var(--widget-icon-color, var(--widget-color)) 40%, transparent);\n clip-path: inset(0 calc((100 - var(--widget-fill-value)) * 1%) 0 0);\n}\n@container widget (max-aspect-ratio: 1) {\n .glasshome-widget-slider-fill {\n clip-path: inset(calc((100 - var(--widget-fill-value)) * 1%) 0 0 0);\n }\n}\n", je = !1, V, Me = /* @__PURE__ */ new WeakSet();
|
|
79
|
+
function Ne() {
|
|
80
|
+
return V || (V = new CSSStyleSheet(), V.replaceSync(Ae.replace(/:root\b/g, ":host").replace(/^\.dark\b/gm, ":host(.dark)"))), V;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Pe(e) {
|
|
83
83
|
if (typeof ShadowRoot < "u" && e instanceof ShadowRoot) {
|
|
84
|
-
if (
|
|
85
|
-
let t =
|
|
86
|
-
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]),
|
|
84
|
+
if (Me.has(e)) return;
|
|
85
|
+
let t = Ne();
|
|
86
|
+
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]), Me.add(e);
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
if (
|
|
89
|
+
if (je) return;
|
|
90
90
|
let t = e ?? (typeof document > "u" ? void 0 : document);
|
|
91
91
|
if (!t) return;
|
|
92
92
|
if (t.head.querySelector?.("style[data-glasshome-tokens]")) {
|
|
93
|
-
|
|
93
|
+
je = !0;
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
let n = t.createElement("style");
|
|
97
|
-
n.setAttribute("data-glasshome-tokens", ""), n.textContent =
|
|
97
|
+
n.setAttribute("data-glasshome-tokens", ""), n.textContent = Ae, t.head.appendChild(n), je = !0;
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/framework/utils/cn.ts
|
|
101
|
-
function
|
|
102
|
-
return
|
|
101
|
+
function H(...e) {
|
|
102
|
+
return be(ye(e));
|
|
103
103
|
}
|
|
104
|
-
var
|
|
104
|
+
var Fe = {
|
|
105
105
|
"classic-glass": {
|
|
106
106
|
id: "classic-glass",
|
|
107
107
|
name: "Classic Glass",
|
|
@@ -187,22 +187,22 @@ var Ie = {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
function
|
|
191
|
-
return
|
|
190
|
+
function Ie(e) {
|
|
191
|
+
return Fe[e];
|
|
192
192
|
}
|
|
193
193
|
//#endregion
|
|
194
194
|
//#region src/framework/backgrounds/WidgetSliderFill.tsx
|
|
195
|
-
var
|
|
196
|
-
function
|
|
195
|
+
var Le = /*#__PURE__*/ L("<div>");
|
|
196
|
+
function Re(e) {
|
|
197
197
|
return (() => {
|
|
198
|
-
var t =
|
|
199
|
-
return
|
|
200
|
-
var r =
|
|
198
|
+
var t = Le();
|
|
199
|
+
return N((n) => {
|
|
200
|
+
var r = H("glasshome-widget-slider-fill pointer-events-none absolute inset-0", e.isDragging ? "duration-0" : "transition-all duration-300 ease-out", e.class), i = {
|
|
201
201
|
"--widget-fill-value": e.value,
|
|
202
|
-
"z-index":
|
|
202
|
+
"z-index": B.BACKGROUND,
|
|
203
203
|
...e.color ? { "--widget-icon-color": e.color } : {}
|
|
204
204
|
};
|
|
205
|
-
return r !== n.e &&
|
|
205
|
+
return r !== n.e && j(t, n.e = r), n.t = _e(t, i, n.t), n;
|
|
206
206
|
}, {
|
|
207
207
|
e: void 0,
|
|
208
208
|
t: void 0
|
|
@@ -211,37 +211,37 @@ function ze(e) {
|
|
|
211
211
|
}
|
|
212
212
|
//#endregion
|
|
213
213
|
//#region src/framework/components/WidgetContent.tsx
|
|
214
|
-
var
|
|
215
|
-
function
|
|
214
|
+
var ze = /*#__PURE__*/ L("<div>");
|
|
215
|
+
function Be(e) {
|
|
216
216
|
return (() => {
|
|
217
|
-
var t =
|
|
218
|
-
return
|
|
217
|
+
var t = ze();
|
|
218
|
+
return P(t, () => e.children), N(() => j(t, H("glasshome-widget-content", e.class))), t;
|
|
219
219
|
})();
|
|
220
220
|
}
|
|
221
221
|
//#endregion
|
|
222
222
|
//#region src/framework/components/WidgetIcon.tsx
|
|
223
|
-
var
|
|
224
|
-
function
|
|
223
|
+
var Ve = /*#__PURE__*/ L("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-2\">"), He = /*#__PURE__*/ L("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-3\">"), Ue = /*#__PURE__*/ L("<div><div class=\"glasshome-widget-icon-glyph flex items-center justify-center\">");
|
|
224
|
+
function We(e) {
|
|
225
225
|
let t = () => e.entityCount ?? 1;
|
|
226
226
|
return (() => {
|
|
227
|
-
var n =
|
|
228
|
-
return
|
|
227
|
+
var n = Ue(), r = n.firstChild;
|
|
228
|
+
return P(n, M(C, {
|
|
229
229
|
get when() {
|
|
230
230
|
return t() >= 2;
|
|
231
231
|
},
|
|
232
232
|
get children() {
|
|
233
|
-
return
|
|
233
|
+
return Ve();
|
|
234
234
|
}
|
|
235
|
-
}), r),
|
|
235
|
+
}), r), P(n, M(C, {
|
|
236
236
|
get when() {
|
|
237
237
|
return t() >= 3;
|
|
238
238
|
},
|
|
239
239
|
get children() {
|
|
240
|
-
return
|
|
240
|
+
return He();
|
|
241
241
|
}
|
|
242
|
-
}), r),
|
|
243
|
-
var r =
|
|
244
|
-
return r !== t.e &&
|
|
242
|
+
}), r), P(r, () => e.icon), N((t) => {
|
|
243
|
+
var r = H("glasshome-widget-icon", "relative flex shrink-0 items-center justify-center pointer-events-none transition-all", e.dimmed && "opacity-50", e.class), i = e.color ? { "--widget-icon-color": e.color } : void 0;
|
|
244
|
+
return r !== t.e && j(n, t.e = r), t.t = _e(n, i, t.t), t;
|
|
245
245
|
}, {
|
|
246
246
|
e: void 0,
|
|
247
247
|
t: void 0
|
|
@@ -250,16 +250,16 @@ function Ge(e) {
|
|
|
250
250
|
}
|
|
251
251
|
//#endregion
|
|
252
252
|
//#region src/framework/components/WidgetStatus.tsx
|
|
253
|
-
var
|
|
254
|
-
function
|
|
253
|
+
var Ge = /*#__PURE__*/ L("<p>");
|
|
254
|
+
function Ke(e) {
|
|
255
255
|
return (() => {
|
|
256
|
-
var t =
|
|
257
|
-
return
|
|
258
|
-
var t =
|
|
256
|
+
var t = Ge();
|
|
257
|
+
return P(t, (() => {
|
|
258
|
+
var t = F(() => !!e.isUnavailable);
|
|
259
259
|
return () => t() ? "Unavailable" : e.children;
|
|
260
|
-
})()),
|
|
261
|
-
var r =
|
|
262
|
-
return r !== n.e &&
|
|
260
|
+
})()), N((n) => {
|
|
261
|
+
var r = H("glasshome-widget-status", "relative", e.dimmed && "opacity-40", e.class), i = B.ACTIONS;
|
|
262
|
+
return r !== n.e && j(t, n.e = r), i !== n.t && I(t, "z-index", n.t = i), n;
|
|
263
263
|
}, {
|
|
264
264
|
e: void 0,
|
|
265
265
|
t: void 0
|
|
@@ -268,21 +268,21 @@ function qe(e) {
|
|
|
268
268
|
}
|
|
269
269
|
//#endregion
|
|
270
270
|
//#region src/framework/components/WidgetTitle.tsx
|
|
271
|
-
var
|
|
272
|
-
function
|
|
271
|
+
var qe = /*#__PURE__*/ L("<span class=\"glasshome-widget-badge shrink-0\">"), Je = /*#__PURE__*/ L("<div><h3 class=glasshome-widget-title>");
|
|
272
|
+
function Ye(e) {
|
|
273
273
|
return (() => {
|
|
274
|
-
var t =
|
|
275
|
-
return
|
|
274
|
+
var t = Je(), n = t.firstChild;
|
|
275
|
+
return P(n, () => e.children), P(t, M(C, {
|
|
276
276
|
get when() {
|
|
277
|
-
return
|
|
277
|
+
return F(() => e.badge !== void 0)() && e.badge > 0;
|
|
278
278
|
},
|
|
279
279
|
get children() {
|
|
280
|
-
var t =
|
|
281
|
-
return
|
|
280
|
+
var t = qe();
|
|
281
|
+
return P(t, () => e.badge), t;
|
|
282
282
|
}
|
|
283
|
-
}), null),
|
|
284
|
-
var r =
|
|
285
|
-
return r !== n.e &&
|
|
283
|
+
}), null), N((n) => {
|
|
284
|
+
var r = H("relative flex items-center gap-2", e.class), i = B.ACTIONS;
|
|
285
|
+
return r !== n.e && j(t, n.e = r), i !== n.t && I(t, "z-index", n.t = i), n;
|
|
286
286
|
}, {
|
|
287
287
|
e: void 0,
|
|
288
288
|
t: void 0
|
|
@@ -291,7 +291,7 @@ function Xe(e) {
|
|
|
291
291
|
}
|
|
292
292
|
//#endregion
|
|
293
293
|
//#region src/framework/utils/entity-aggregation.ts
|
|
294
|
-
function
|
|
294
|
+
function Xe(e, t = !1) {
|
|
295
295
|
if (e.length === 0) return {
|
|
296
296
|
isGroup: !1,
|
|
297
297
|
state: "unknown",
|
|
@@ -323,7 +323,11 @@ function Ze(e, t = !1) {
|
|
|
323
323
|
let r = 0, i = 0, a = 0, o = 0, s = 0, c = 0, l = [];
|
|
324
324
|
for (let t of e) switch (t.state) {
|
|
325
325
|
case "on":
|
|
326
|
-
r++, t.attributes?.brightness !== void 0 && (s += t.attributes.brightness, c++), t.attributes?.rgb_color
|
|
326
|
+
if (r++, t.attributes?.brightness !== void 0 && (s += t.attributes.brightness, c++), t.attributes?.rgb_color) l.push(t.attributes.rgb_color);
|
|
327
|
+
else if (t.attributes?.hs_color) {
|
|
328
|
+
let [e, n] = t.attributes.hs_color;
|
|
329
|
+
l.push(Qe(e, n));
|
|
330
|
+
}
|
|
327
331
|
break;
|
|
328
332
|
case "off":
|
|
329
333
|
i++;
|
|
@@ -356,7 +360,7 @@ function Ze(e, t = !1) {
|
|
|
356
360
|
description: b
|
|
357
361
|
};
|
|
358
362
|
}
|
|
359
|
-
function
|
|
363
|
+
function Ze(e, t = "mean", n = !0) {
|
|
360
364
|
if (e.length === 0) return {
|
|
361
365
|
isGroup: !1,
|
|
362
366
|
state: "unknown",
|
|
@@ -452,6 +456,14 @@ function Qe(e, t = "mean", n = !0) {
|
|
|
452
456
|
memberValues: a
|
|
453
457
|
};
|
|
454
458
|
}
|
|
459
|
+
function Qe(e, t) {
|
|
460
|
+
let n = t / 100, r = n * (1 - Math.abs(e / 60 % 2 - 1)), i = 1 - n, a = 0, o = 0, s = 0;
|
|
461
|
+
return e < 60 ? [a, o] = [n, r] : e < 120 ? [a, o] = [r, n] : e < 180 ? [o, s] = [n, r] : e < 240 ? [o, s] = [r, n] : e < 300 ? [a, s] = [r, n] : [a, s] = [n, r], [
|
|
462
|
+
(a + i) * 255,
|
|
463
|
+
(o + i) * 255,
|
|
464
|
+
(s + i) * 255
|
|
465
|
+
];
|
|
466
|
+
}
|
|
455
467
|
function $e(e) {
|
|
456
468
|
if (e.state !== "on") return "rgb(100, 100, 100)";
|
|
457
469
|
let t = (e.attributes?.brightness ?? 255) / 255;
|
|
@@ -459,6 +471,10 @@ function $e(e) {
|
|
|
459
471
|
let [n, r, i] = e.attributes.rgb_color;
|
|
460
472
|
return `rgb(${Math.round(n * t)}, ${Math.round(r * t)}, ${Math.round(i * t)})`;
|
|
461
473
|
}
|
|
474
|
+
if (e.attributes?.hs_color) {
|
|
475
|
+
let [n, r] = e.attributes.hs_color, [i, a, o] = Qe(n, r);
|
|
476
|
+
return `rgb(${Math.round(i * t)}, ${Math.round(a * t)}, ${Math.round(o * t)})`;
|
|
477
|
+
}
|
|
462
478
|
if (e.attributes?.color_temp) {
|
|
463
479
|
let n = 1e6 / e.attributes.color_temp / 100, r, i, a;
|
|
464
480
|
return n <= 66 ? (r = 255, i = n <= 19 ? 0 : 99.4708025861 * Math.log(n - 10) - 161.1195681661, a = n <= 19 ? 0 : n <= 66 ? 138.5177312231 * Math.log(n - 10) - 305.0447927307 : 255) : (r = 329.698727446 * (n - 60) ** -.1332047592, i = 288.1221695283 * (n - 60) ** -.0755148492, a = 255), r = Math.max(0, Math.min(255, r)) * t, i = Math.max(0, Math.min(255, i)) * t, a = Math.max(0, Math.min(255, a)) * t, `rgb(${Math.round(r)}, ${Math.round(i)}, ${Math.round(a)})`;
|
|
@@ -507,26 +523,26 @@ function it(e, t) {
|
|
|
507
523
|
}
|
|
508
524
|
//#endregion
|
|
509
525
|
//#region src/framework/components/WidgetValue.tsx
|
|
510
|
-
var at = /*#__PURE__*/
|
|
526
|
+
var at = /*#__PURE__*/ L("<div class=glasshome-widget-subtitle>"), ot = /*#__PURE__*/ L("<div><div class=glasshome-widget-value>");
|
|
511
527
|
function st(e) {
|
|
512
528
|
return (() => {
|
|
513
529
|
var t = ot(), n = t.firstChild;
|
|
514
|
-
return
|
|
530
|
+
return P(n, () => rt(e.value, e.unit)), P(t, M(C, {
|
|
515
531
|
get when() {
|
|
516
|
-
return
|
|
532
|
+
return F(() => !!e.interpret)() && typeof e.value == "number";
|
|
517
533
|
},
|
|
518
534
|
get children() {
|
|
519
535
|
var t = at();
|
|
520
|
-
return
|
|
536
|
+
return P(t, () => it(e.value, e.unit)), t;
|
|
521
537
|
}
|
|
522
|
-
}), null),
|
|
538
|
+
}), null), N(() => j(t, H("flex flex-col", e.class))), t;
|
|
523
539
|
})();
|
|
524
540
|
}
|
|
525
541
|
//#endregion
|
|
526
542
|
//#region src/framework/core/Widget.tsx
|
|
527
|
-
var ct = /*#__PURE__*/
|
|
543
|
+
var ct = /*#__PURE__*/ L("<div><div class=\"relative h-full w-full\">"), lt = /*#__PURE__*/ L("<div class=\"glasshome-widget-loading pointer-events-none absolute inset-0 animate-pulse\">"), ut = /*#__PURE__*/ L("<div class=\"flex h-full w-full flex-col items-center justify-center gap-2 text-center\">"), dt = /*#__PURE__*/ L("<div class=\"flex items-center justify-center text-white/30\">"), ft = /*#__PURE__*/ L("<h3 class=\"font-semibold text-sm text-white/60\">"), pt = /*#__PURE__*/ L("<p class=\"text-white/50 text-xs\">");
|
|
528
544
|
function mt(e) {
|
|
529
|
-
let t =
|
|
545
|
+
let t = k(R), [n, r] = E(), [i, a] = E({
|
|
530
546
|
width: 0,
|
|
531
547
|
height: 0
|
|
532
548
|
});
|
|
@@ -544,10 +560,10 @@ function mt(e) {
|
|
|
544
560
|
height: e.contentRect.height
|
|
545
561
|
});
|
|
546
562
|
});
|
|
547
|
-
t.observe(e),
|
|
548
|
-
}),
|
|
563
|
+
t.observe(e), O(() => t.disconnect());
|
|
564
|
+
}), pe(() => {
|
|
549
565
|
let e = n()?.getRootNode();
|
|
550
|
-
|
|
566
|
+
Pe(typeof ShadowRoot < "u" && e instanceof ShadowRoot || typeof Document < "u" && e instanceof Document ? e : void 0);
|
|
551
567
|
});
|
|
552
568
|
let o = {
|
|
553
569
|
isEditMode: () => e.isEditMode ?? !1,
|
|
@@ -556,7 +572,7 @@ function mt(e) {
|
|
|
556
572
|
callService: t?.callService,
|
|
557
573
|
dimensions: () => i()
|
|
558
574
|
}, s = T(() => {
|
|
559
|
-
if (e.variant) return typeof e.variant == "string" ?
|
|
575
|
+
if (e.variant) return typeof e.variant == "string" ? Ie(e.variant) : e.variant;
|
|
560
576
|
}), c = T(() => ({
|
|
561
577
|
"container-type": "size",
|
|
562
578
|
"container-name": "widget",
|
|
@@ -578,15 +594,15 @@ function mt(e) {
|
|
|
578
594
|
}, m = (t) => {
|
|
579
595
|
l() && e.gestures?.onPointerCancel(t);
|
|
580
596
|
};
|
|
581
|
-
return
|
|
597
|
+
return M(R.Provider, {
|
|
582
598
|
value: o,
|
|
583
599
|
get children() {
|
|
584
600
|
var t = ct(), n = t.firstChild;
|
|
585
|
-
return
|
|
601
|
+
return A(t, "pointercancel", m), A(t, "pointerup", p), A(t, "pointermove", f), A(t, "pointerdown", d), A(t, "pointerenter", u), ve((t) => {
|
|
586
602
|
r(t), e.gestures?.bindElement(t);
|
|
587
|
-
}, t),
|
|
588
|
-
var t =
|
|
589
|
-
return () => t() ?
|
|
603
|
+
}, t), P(n, (() => {
|
|
604
|
+
var t = F(() => !!e.emptyState);
|
|
605
|
+
return () => t() ? M(ht, {
|
|
590
606
|
get icon() {
|
|
591
607
|
return e.emptyState.icon;
|
|
592
608
|
},
|
|
@@ -597,15 +613,15 @@ function mt(e) {
|
|
|
597
613
|
return e.emptyState.message;
|
|
598
614
|
}
|
|
599
615
|
}) : e.children;
|
|
600
|
-
})()),
|
|
601
|
-
var t =
|
|
616
|
+
})()), P(t, (() => {
|
|
617
|
+
var t = F(() => !!e.loading);
|
|
602
618
|
return () => t() && (() => {
|
|
603
619
|
var e = lt();
|
|
604
|
-
return
|
|
620
|
+
return N((t) => I(e, "z-index", B.OVERLAY)), e;
|
|
605
621
|
})();
|
|
606
|
-
})(), null),
|
|
607
|
-
var i =
|
|
608
|
-
return i !== r.e &&
|
|
622
|
+
})(), null), N((r) => {
|
|
623
|
+
var i = H("glasshome-widget", "relative h-full w-full select-none overflow-hidden rounded-xl border border-border/50", s()?.styles?.class, e.class), a = c(), o = B.CONTENT;
|
|
624
|
+
return i !== r.e && j(t, r.e = i), r.t = _e(t, a, r.t), o !== r.a && I(n, "z-index", r.a = o), r;
|
|
609
625
|
}, {
|
|
610
626
|
e: void 0,
|
|
611
627
|
t: void 0,
|
|
@@ -617,52 +633,52 @@ function mt(e) {
|
|
|
617
633
|
function ht(e) {
|
|
618
634
|
return (() => {
|
|
619
635
|
var t = ut();
|
|
620
|
-
return
|
|
621
|
-
var t =
|
|
636
|
+
return P(t, (() => {
|
|
637
|
+
var t = F(() => !!e.icon);
|
|
622
638
|
return () => t() && (() => {
|
|
623
639
|
var t = dt();
|
|
624
|
-
return
|
|
640
|
+
return P(t, () => e.icon), t;
|
|
625
641
|
})();
|
|
626
|
-
})(), null),
|
|
627
|
-
var t =
|
|
642
|
+
})(), null), P(t, (() => {
|
|
643
|
+
var t = F(() => !!e.title);
|
|
628
644
|
return () => t() && (() => {
|
|
629
645
|
var t = ft();
|
|
630
|
-
return
|
|
646
|
+
return P(t, () => e.title), t;
|
|
631
647
|
})();
|
|
632
|
-
})(), null),
|
|
633
|
-
var t =
|
|
648
|
+
})(), null), P(t, (() => {
|
|
649
|
+
var t = F(() => !!e.message);
|
|
634
650
|
return () => t() && (() => {
|
|
635
651
|
var t = pt();
|
|
636
|
-
return
|
|
652
|
+
return P(t, () => e.message), t;
|
|
637
653
|
})();
|
|
638
654
|
})(), null), t;
|
|
639
655
|
})();
|
|
640
656
|
}
|
|
641
|
-
var
|
|
642
|
-
|
|
657
|
+
var U = mt;
|
|
658
|
+
U.Content = Be, U.Icon = We, U.Title = Ye, U.Status = Ke, U.Value = st, U.SliderFill = Re;
|
|
643
659
|
//#endregion
|
|
644
660
|
//#region src/framework/dialogs/WidgetDialog.tsx
|
|
645
|
-
var gt = /*#__PURE__*/
|
|
661
|
+
var gt = /*#__PURE__*/ L("<span class=\"inline-flex size-3.5 shrink-0 items-center\">"), _t = /*#__PURE__*/ L("<button type=button>"), vt = /*#__PURE__*/ L("<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox=\"0 0 24 24\"stroke=currentColor stroke-width=2><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"></path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\">"), yt = /*#__PURE__*/ L("<div class=\"rounded-lg bg-muted/30 p-2 text-center md:p-6\"><p class=\"text-muted-foreground text-sm\">No edit options available"), bt = /*#__PURE__*/ L("<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox=\"0 0 24 24\"stroke=currentColor stroke-width=2><line x1=4 y1=21 x2=4 y2=14></line><line x1=4 y1=10 x2=4 y2=3></line><line x1=12 y1=21 x2=12 y2=12></line><line x1=12 y1=8 x2=12 y2=3></line><line x1=20 y1=21 x2=20 y2=16></line><line x1=20 y1=12 x2=20 y2=3></line><line x1=1 y1=14 x2=7 y2=14></line><line x1=9 y1=8 x2=15 y2=8></line><line x1=17 y1=16 x2=23 y2=16>"), xt = /*#__PURE__*/ L("<div class=\"rounded-lg bg-muted/30 p-2 text-center md:p-6\"><p class=\"text-muted-foreground text-sm\">No additional controls"), St = /*#__PURE__*/ L("<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox=\"0 0 24 24\"stroke=currentColor stroke-width=2><path d=\"m8 2 1.88 1.88\"></path><path d=\"M14.12 3.88 16 2\"></path><path d=\"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1\"></path><path d=\"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6\"></path><path d=\"M12 20v-9\"></path><path d=\"M6.53 9C4.6 8.8 3 7.1 3 5\"></path><path d=\"M6 13H2\"></path><path d=\"M3 21c0-2.1 1.7-3.9 3.8-4\"></path><path d=\"M20.97 5c0 2.1-1.6 3.8-3.5 4\"></path><path d=\"M22 13h-4\"></path><path d=\"M17.2 17c2.1.1 3.8 1.9 3.8 4\">"), Ct = /*#__PURE__*/ L("<div class=\"rounded-lg bg-muted/30 p-2 text-center md:p-6\"><p class=\"text-muted-foreground text-sm\">No debug information available"), wt = /*#__PURE__*/ L("<div class=\"min-w-0 shrink-0\">"), Tt = /*#__PURE__*/ L("<div class=\"flex items-center gap-2\"><div class=\"flex h-8 items-center rounded-lg border border-border/50 bg-muted/30 p-0.5\">"), Et = /*#__PURE__*/ L("<div class=\"min-h-0 flex-1 overflow-y-auto [scrollbar-gutter:stable]\">"), Dt = /*#__PURE__*/ L("<div class=\"flex shrink-0 items-center justify-end gap-2 border-border/50 border-t pt-3\">");
|
|
646
662
|
function Ot(e) {
|
|
647
663
|
return (() => {
|
|
648
664
|
var t = _t();
|
|
649
|
-
return t.$$click = () => e.onClick(),
|
|
665
|
+
return t.$$click = () => e.onClick(), P(t, M(C, {
|
|
650
666
|
get when() {
|
|
651
667
|
return e.isActive;
|
|
652
668
|
},
|
|
653
669
|
get children() {
|
|
654
670
|
var t = gt();
|
|
655
|
-
return
|
|
671
|
+
return P(t, () => e.icon), t;
|
|
656
672
|
}
|
|
657
|
-
}), null),
|
|
673
|
+
}), null), P(t, () => e.label, null), N(() => j(t, H("flex cursor-pointer items-center justify-center rounded-md px-3 py-1.5 text-xs transition-all duration-300 ease-in-out", e.isActive ? "gap-1.5 bg-foreground/10 font-semibold text-foreground shadow-sm" : "gap-0 text-muted-foreground hover:bg-foreground/5 hover:text-foreground"))), t;
|
|
658
674
|
})();
|
|
659
675
|
}
|
|
660
676
|
function kt(e) {
|
|
661
|
-
let [t] =
|
|
662
|
-
w(
|
|
677
|
+
let [t] = me(e, /* @__PURE__ */ "open.onOpenChange.title.onSave.hasUnsavedChanges.onDelete.editContent.controlsContent.debugContent.debugData.tabs.class.maxWidth.defaultTab.activeTab.onActiveTabChange.headerActions.configSchema.config.onConfigSave.ResponsiveDialog.ResponsiveDialogContent.ResponsiveDialogHeader.ResponsiveDialogTitle.ResponsiveDialogDescription.Button.SchemaForm".split(".")), n = () => !!t.configSchema && !!t.config && !!t.onConfigSave && !!t.SchemaForm, [r, i] = E({}), [a, o] = E(null);
|
|
678
|
+
w(D(() => t.config, (e) => {
|
|
663
679
|
e && i({ ...e });
|
|
664
|
-
})), w(
|
|
665
|
-
e && o(
|
|
680
|
+
})), w(D(() => t.configSchema, (e) => {
|
|
681
|
+
e && o(xe(e));
|
|
666
682
|
}));
|
|
667
683
|
let s = () => n() && JSON.stringify(r()) !== JSON.stringify(t.config), c = (e) => {
|
|
668
684
|
!e && t.config && i({ ...t.config }), t.onOpenChange(e);
|
|
@@ -685,12 +701,12 @@ function kt(e) {
|
|
|
685
701
|
id: "edit",
|
|
686
702
|
label: "Edit",
|
|
687
703
|
icon: vt(),
|
|
688
|
-
content: t.editContent ?? (n() && a() ?
|
|
704
|
+
content: t.editContent ?? (n() && a() ? M(ne, {
|
|
689
705
|
get schema() {
|
|
690
706
|
return a();
|
|
691
707
|
},
|
|
692
708
|
get data() {
|
|
693
|
-
return
|
|
709
|
+
return he(r);
|
|
694
710
|
},
|
|
695
711
|
onChange: i
|
|
696
712
|
}) : yt())
|
|
@@ -713,41 +729,41 @@ function kt(e) {
|
|
|
713
729
|
}, _ = () => {
|
|
714
730
|
let e = re();
|
|
715
731
|
return e.find((e) => e.id === f())?.content ?? e[0]?.content;
|
|
716
|
-
}, v = t.ResponsiveDialog, ee = t.ResponsiveDialogContent, y = t.ResponsiveDialogHeader, b = t.ResponsiveDialogTitle, te = t.ResponsiveDialogDescription, x = t.Button, ne = t.SchemaForm, re = T(
|
|
732
|
+
}, v = t.ResponsiveDialog, ee = t.ResponsiveDialogContent, y = t.ResponsiveDialogHeader, b = t.ResponsiveDialogTitle, te = t.ResponsiveDialogDescription, x = t.Button, ne = t.SchemaForm, re = T(D([
|
|
717
733
|
() => t.open,
|
|
718
734
|
a,
|
|
719
735
|
() => t.config,
|
|
720
736
|
() => t.tabs
|
|
721
737
|
], () => h())), ie = (e) => n() ? c(e) : t.onOpenChange(e), ae = () => n() ? s() : t.hasUnsavedChanges, S = () => n() ? l : t.onSave;
|
|
722
|
-
return
|
|
738
|
+
return M(v, {
|
|
723
739
|
get open() {
|
|
724
740
|
return t.open;
|
|
725
741
|
},
|
|
726
742
|
onOpenChange: (e) => ie(e),
|
|
727
743
|
get children() {
|
|
728
|
-
return
|
|
744
|
+
return M(ee, {
|
|
729
745
|
get class() {
|
|
730
|
-
return
|
|
746
|
+
return H(m(), t.class);
|
|
731
747
|
},
|
|
732
748
|
get children() {
|
|
733
749
|
return [
|
|
734
|
-
|
|
750
|
+
M(y, {
|
|
735
751
|
class: "flex flex-row items-center justify-between gap-3",
|
|
736
752
|
get children() {
|
|
737
753
|
return [(() => {
|
|
738
754
|
var e = wt();
|
|
739
|
-
return
|
|
755
|
+
return P(e, M(b, {
|
|
740
756
|
class: "truncate leading-tight",
|
|
741
757
|
get children() {
|
|
742
758
|
return t.title;
|
|
743
759
|
}
|
|
744
|
-
}), null),
|
|
760
|
+
}), null), P(e, M(te, {
|
|
745
761
|
class: "sr-only",
|
|
746
762
|
children: "Widget configuration dialog"
|
|
747
763
|
}), null), e;
|
|
748
764
|
})(), (() => {
|
|
749
765
|
var e = Tt(), n = e.firstChild;
|
|
750
|
-
return
|
|
766
|
+
return P(n, () => re().map((e) => M(Ot, {
|
|
751
767
|
get icon() {
|
|
752
768
|
return e.icon;
|
|
753
769
|
},
|
|
@@ -758,7 +774,7 @@ function kt(e) {
|
|
|
758
774
|
return f() === e.id;
|
|
759
775
|
},
|
|
760
776
|
onClick: () => p(e.id)
|
|
761
|
-
}))),
|
|
777
|
+
}))), P(e, M(C, {
|
|
762
778
|
get when() {
|
|
763
779
|
return t.headerActions;
|
|
764
780
|
},
|
|
@@ -771,32 +787,32 @@ function kt(e) {
|
|
|
771
787
|
}),
|
|
772
788
|
(() => {
|
|
773
789
|
var e = Et();
|
|
774
|
-
return
|
|
790
|
+
return P(e, _), e;
|
|
775
791
|
})(),
|
|
776
|
-
|
|
792
|
+
M(C, {
|
|
777
793
|
get when() {
|
|
778
|
-
return
|
|
794
|
+
return F(() => f() === "edit")() && (S() || t.onDelete) || f() === "debug" && t.debugData !== void 0;
|
|
779
795
|
},
|
|
780
796
|
get children() {
|
|
781
797
|
var e = Dt();
|
|
782
|
-
return
|
|
798
|
+
return P(e, M(C, {
|
|
783
799
|
get when() {
|
|
784
|
-
return
|
|
800
|
+
return F(() => f() === "edit")() && t.onDelete;
|
|
785
801
|
},
|
|
786
802
|
get children() {
|
|
787
|
-
return
|
|
803
|
+
return M(x, {
|
|
788
804
|
size: "sm",
|
|
789
805
|
variant: "destructive",
|
|
790
806
|
onClick: () => t.onDelete?.(),
|
|
791
807
|
children: "Delete"
|
|
792
808
|
});
|
|
793
809
|
}
|
|
794
|
-
}), null),
|
|
810
|
+
}), null), P(e, M(C, {
|
|
795
811
|
get when() {
|
|
796
|
-
return
|
|
812
|
+
return F(() => f() === "edit")() && S();
|
|
797
813
|
},
|
|
798
814
|
get children() {
|
|
799
|
-
return
|
|
815
|
+
return M(x, {
|
|
800
816
|
size: "sm",
|
|
801
817
|
get disabled() {
|
|
802
818
|
return !ae();
|
|
@@ -805,12 +821,12 @@ function kt(e) {
|
|
|
805
821
|
children: "Save"
|
|
806
822
|
});
|
|
807
823
|
}
|
|
808
|
-
}), null),
|
|
824
|
+
}), null), P(e, M(C, {
|
|
809
825
|
get when() {
|
|
810
|
-
return
|
|
826
|
+
return F(() => f() === "debug")() && t.debugData !== void 0;
|
|
811
827
|
},
|
|
812
828
|
get children() {
|
|
813
|
-
return
|
|
829
|
+
return M(x, {
|
|
814
830
|
size: "sm",
|
|
815
831
|
variant: "outline",
|
|
816
832
|
onClick: g,
|
|
@@ -826,7 +842,7 @@ function kt(e) {
|
|
|
826
842
|
}
|
|
827
843
|
});
|
|
828
844
|
}
|
|
829
|
-
|
|
845
|
+
ge(["click"]);
|
|
830
846
|
//#endregion
|
|
831
847
|
//#region src/framework/hooks/use-intersection-pause.ts
|
|
832
848
|
function At(e) {
|
|
@@ -838,22 +854,22 @@ function At(e) {
|
|
|
838
854
|
return w(() => {
|
|
839
855
|
let t = e();
|
|
840
856
|
r.disconnect(), t && r.observe(t);
|
|
841
|
-
}),
|
|
857
|
+
}), O(() => r.disconnect()), t;
|
|
842
858
|
}
|
|
843
859
|
//#endregion
|
|
844
860
|
//#region src/framework/hooks/use-reduced-motion.ts
|
|
845
861
|
function jt() {
|
|
846
862
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => !1;
|
|
847
863
|
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), [t, n] = E(e.matches), r = (e) => n(e.matches);
|
|
848
|
-
return e.addEventListener("change", r),
|
|
864
|
+
return e.addEventListener("change", r), O(() => e.removeEventListener("change", r)), t;
|
|
849
865
|
}
|
|
850
866
|
//#endregion
|
|
851
867
|
//#region src/framework/hooks/use-widget-dialog.ts
|
|
852
868
|
function Mt(e = "controls") {
|
|
853
869
|
let [t, n] = E(!1), [r, i] = E(e), a = (t) => {
|
|
854
870
|
i(t ?? e), n(!0);
|
|
855
|
-
}, o =
|
|
856
|
-
return o?.registerDialogOpener?.(a),
|
|
871
|
+
}, o = k(R);
|
|
872
|
+
return o?.registerDialogOpener?.(a), O(() => o?.registerDialogOpener?.(null)), {
|
|
857
873
|
showDialog: t,
|
|
858
874
|
setShowDialog: n,
|
|
859
875
|
openDialog: a,
|
|
@@ -880,8 +896,8 @@ function Nt(e) {
|
|
|
880
896
|
let t = e.aggregationMode?.();
|
|
881
897
|
if (!t || t === "none") return;
|
|
882
898
|
let n = e.entities();
|
|
883
|
-
if (t === "light" || t === "binary-sensor" || t === "switch") return
|
|
884
|
-
if (t === "sensor") return
|
|
899
|
+
if (t === "light" || t === "binary-sensor" || t === "switch") return Xe(n, e.allEntitiesMode);
|
|
900
|
+
if (t === "sensor") return Ze(n, e.sensorGroupType?.() ?? "mean", !0);
|
|
885
901
|
}), o = T(() => r() ? void 0 : e.emptyStateConfig);
|
|
886
902
|
return {
|
|
887
903
|
entities: e.entities,
|
|
@@ -894,105 +910,105 @@ function Nt(e) {
|
|
|
894
910
|
}
|
|
895
911
|
//#endregion
|
|
896
912
|
//#region src/framework/gestures/cursors.ts
|
|
897
|
-
var
|
|
913
|
+
var W = 32, G = W / 2, K = "white", q = "rgba(0,0,0,0.4)", J = 2, Y = 3;
|
|
898
914
|
function Pt(e) {
|
|
899
915
|
return `url("data:image/svg+xml,${encodeURIComponent(e)}")`;
|
|
900
916
|
}
|
|
901
|
-
function
|
|
902
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
917
|
+
function X(e) {
|
|
918
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${W}" height="${W}" viewBox="0 0 ${W} ${W}">${e}</svg>`;
|
|
903
919
|
}
|
|
904
|
-
var Ft =
|
|
920
|
+
var Ft = X(`
|
|
905
921
|
<g transform="translate(6, 2)">
|
|
906
922
|
<!-- shadow -->
|
|
907
|
-
<g stroke="${
|
|
923
|
+
<g stroke="${q}" stroke-width="${Y}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
908
924
|
<path d="M10 8V3a2 2 0 0 1 4 0v10l4.5-4.5a2 2 0 0 1 2.83 2.83L14 18.5c-2 2-4 3.5-8 3.5-3 0-5-2-5-5v-6a2 2 0 0 1 4 0v2"/>
|
|
909
925
|
</g>
|
|
910
926
|
<!-- main -->
|
|
911
|
-
<g stroke="${
|
|
927
|
+
<g stroke="${K}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
912
928
|
<path d="M10 8V3a2 2 0 0 1 4 0v10l4.5-4.5a2 2 0 0 1 2.83 2.83L14 18.5c-2 2-4 3.5-8 3.5-3 0-5-2-5-5v-6a2 2 0 0 1 4 0v2"/>
|
|
913
929
|
</g>
|
|
914
930
|
</g>
|
|
915
|
-
`), It =
|
|
931
|
+
`), It = X(`
|
|
916
932
|
<g>
|
|
917
|
-
<circle cx="${
|
|
918
|
-
<circle cx="${
|
|
919
|
-
<circle cx="${
|
|
933
|
+
<circle cx="${G}" cy="${G}" r="8" stroke="${q}" stroke-width="${Y}" fill="none"/>
|
|
934
|
+
<circle cx="${G}" cy="${G}" r="8" stroke="${K}" stroke-width="1.5" fill="none"/>
|
|
935
|
+
<circle cx="${G}" cy="${G}" r="1.5" fill="${K}"/>
|
|
920
936
|
</g>
|
|
921
|
-
`), Lt =
|
|
937
|
+
`), Lt = X(`
|
|
922
938
|
<g>
|
|
923
939
|
<!-- shadow -->
|
|
924
|
-
<g stroke="${
|
|
925
|
-
<line x1="6" y1="${
|
|
926
|
-
<polyline points="10,${
|
|
927
|
-
<polyline points="22,${
|
|
940
|
+
<g stroke="${q}" stroke-width="${Y}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
941
|
+
<line x1="6" y1="${G}" x2="26" y2="${G}"/>
|
|
942
|
+
<polyline points="10,${G - 4} 6,${G} 10,20"/>
|
|
943
|
+
<polyline points="22,${G - 4} 26,${G} 22,20"/>
|
|
928
944
|
</g>
|
|
929
945
|
<!-- main -->
|
|
930
|
-
<g stroke="${
|
|
931
|
-
<line x1="6" y1="${
|
|
932
|
-
<polyline points="10,${
|
|
933
|
-
<polyline points="22,${
|
|
946
|
+
<g stroke="${K}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
947
|
+
<line x1="6" y1="${G}" x2="26" y2="${G}"/>
|
|
948
|
+
<polyline points="10,${G - 4} 6,${G} 10,20"/>
|
|
949
|
+
<polyline points="22,${G - 4} 26,${G} 22,20"/>
|
|
934
950
|
</g>
|
|
935
951
|
<!-- center grip dots -->
|
|
936
|
-
<circle cx="${
|
|
937
|
-
<circle cx="${
|
|
938
|
-
<circle cx="21" cy="${
|
|
952
|
+
<circle cx="${G}" cy="${G}" r="1.5" fill="${K}"/>
|
|
953
|
+
<circle cx="${G - 5}" cy="${G}" r="1" fill="${K}" opacity="0.6"/>
|
|
954
|
+
<circle cx="21" cy="${G}" r="1" fill="${K}" opacity="0.6"/>
|
|
939
955
|
</g>
|
|
940
|
-
`), Rt =
|
|
956
|
+
`), Rt = X(`
|
|
941
957
|
<g>
|
|
942
958
|
<!-- shadow -->
|
|
943
|
-
<g stroke="${
|
|
944
|
-
<line x1="${
|
|
945
|
-
<polyline points="${
|
|
946
|
-
<polyline points="${
|
|
959
|
+
<g stroke="${q}" stroke-width="${Y}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
960
|
+
<line x1="${G}" y1="6" x2="${G}" y2="26"/>
|
|
961
|
+
<polyline points="${G - 4},10 ${G},6 20,10"/>
|
|
962
|
+
<polyline points="${G - 4},22 ${G},26 20,22"/>
|
|
947
963
|
</g>
|
|
948
964
|
<!-- main -->
|
|
949
|
-
<g stroke="${
|
|
950
|
-
<line x1="${
|
|
951
|
-
<polyline points="${
|
|
952
|
-
<polyline points="${
|
|
965
|
+
<g stroke="${K}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
966
|
+
<line x1="${G}" y1="6" x2="${G}" y2="26"/>
|
|
967
|
+
<polyline points="${G - 4},10 ${G},6 20,10"/>
|
|
968
|
+
<polyline points="${G - 4},22 ${G},26 20,22"/>
|
|
953
969
|
</g>
|
|
954
970
|
<!-- center grip dots -->
|
|
955
|
-
<circle cx="${
|
|
956
|
-
<circle cx="${
|
|
957
|
-
<circle cx="${
|
|
971
|
+
<circle cx="${G}" cy="${G}" r="1.5" fill="${K}"/>
|
|
972
|
+
<circle cx="${G}" cy="${G - 5}" r="1" fill="${K}" opacity="0.6"/>
|
|
973
|
+
<circle cx="${G}" cy="21" r="1" fill="${K}" opacity="0.6"/>
|
|
958
974
|
</g>
|
|
959
|
-
`), zt =
|
|
975
|
+
`), zt = X(`
|
|
960
976
|
<g>
|
|
961
977
|
<!-- shadow -->
|
|
962
|
-
<g stroke="${
|
|
963
|
-
<line x1="7" y1="${
|
|
964
|
-
<line x1="${
|
|
965
|
-
<polyline points="11,${
|
|
966
|
-
<polyline points="21,${
|
|
967
|
-
<polyline points="${
|
|
968
|
-
<polyline points="${
|
|
978
|
+
<g stroke="${q}" stroke-width="${Y}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
979
|
+
<line x1="7" y1="${G}" x2="25" y2="${G}"/>
|
|
980
|
+
<line x1="${G}" y1="7" x2="${G}" y2="25"/>
|
|
981
|
+
<polyline points="11,${G - 3} 7,${G} 11,19"/>
|
|
982
|
+
<polyline points="21,${G - 3} 25,${G} 21,19"/>
|
|
983
|
+
<polyline points="${G - 3},11 ${G},7 19,11"/>
|
|
984
|
+
<polyline points="${G - 3},21 ${G},25 19,21"/>
|
|
969
985
|
</g>
|
|
970
986
|
<!-- main -->
|
|
971
|
-
<g stroke="${
|
|
972
|
-
<line x1="7" y1="${
|
|
973
|
-
<line x1="${
|
|
974
|
-
<polyline points="11,${
|
|
975
|
-
<polyline points="21,${
|
|
976
|
-
<polyline points="${
|
|
977
|
-
<polyline points="${
|
|
987
|
+
<g stroke="${K}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
988
|
+
<line x1="7" y1="${G}" x2="25" y2="${G}"/>
|
|
989
|
+
<line x1="${G}" y1="7" x2="${G}" y2="25"/>
|
|
990
|
+
<polyline points="11,${G - 3} 7,${G} 11,19"/>
|
|
991
|
+
<polyline points="21,${G - 3} 25,${G} 21,19"/>
|
|
992
|
+
<polyline points="${G - 3},11 ${G},7 19,11"/>
|
|
993
|
+
<polyline points="${G - 3},21 ${G},25 19,21"/>
|
|
978
994
|
</g>
|
|
979
995
|
<!-- center dot -->
|
|
980
|
-
<circle cx="${
|
|
996
|
+
<circle cx="${G}" cy="${G}" r="2" fill="${K}"/>
|
|
981
997
|
</g>
|
|
982
998
|
`);
|
|
983
|
-
function
|
|
999
|
+
function Z(e, t, n) {
|
|
984
1000
|
return {
|
|
985
1001
|
css: `${Pt(e)} ${t} ${n}, auto`,
|
|
986
1002
|
hotspotX: t,
|
|
987
1003
|
hotspotY: n
|
|
988
1004
|
};
|
|
989
1005
|
}
|
|
990
|
-
var
|
|
991
|
-
tap:
|
|
992
|
-
hold:
|
|
993
|
-
slideHorizontal:
|
|
994
|
-
slideVertical:
|
|
995
|
-
slideAuto:
|
|
1006
|
+
var Q = {
|
|
1007
|
+
tap: Z(Ft, 12, 4),
|
|
1008
|
+
hold: Z(It, 16, 16),
|
|
1009
|
+
slideHorizontal: Z(Lt, G, G),
|
|
1010
|
+
slideVertical: Z(Rt, G, G),
|
|
1011
|
+
slideAuto: Z(zt, G, G)
|
|
996
1012
|
};
|
|
997
1013
|
//#endregion
|
|
998
1014
|
//#region src/framework/gestures/haptics.ts
|
|
@@ -1001,19 +1017,19 @@ function Bt() {
|
|
|
1001
1017
|
let e = window;
|
|
1002
1018
|
return e.Capacitor?.isNativePlatform?.() ? e.Capacitor.Plugins?.Haptics ?? null : null;
|
|
1003
1019
|
}
|
|
1004
|
-
function
|
|
1020
|
+
function Vt(e) {
|
|
1005
1021
|
if (!(typeof navigator > "u" || typeof navigator.vibrate != "function")) try {
|
|
1006
1022
|
navigator.vibrate(e);
|
|
1007
1023
|
} catch {}
|
|
1008
1024
|
}
|
|
1009
|
-
var
|
|
1025
|
+
var Ht = {
|
|
1010
1026
|
tick() {
|
|
1011
1027
|
let e = Bt();
|
|
1012
1028
|
if (e) {
|
|
1013
1029
|
e.impact({ style: "Light" }).catch(() => {});
|
|
1014
1030
|
return;
|
|
1015
1031
|
}
|
|
1016
|
-
|
|
1032
|
+
Vt(8);
|
|
1017
1033
|
},
|
|
1018
1034
|
bump() {
|
|
1019
1035
|
let e = Bt();
|
|
@@ -1021,7 +1037,7 @@ var Vt = {
|
|
|
1021
1037
|
e.impact({ style: "Medium" }).catch(() => {});
|
|
1022
1038
|
return;
|
|
1023
1039
|
}
|
|
1024
|
-
|
|
1040
|
+
Vt(20);
|
|
1025
1041
|
},
|
|
1026
1042
|
pulse() {
|
|
1027
1043
|
let e = Bt();
|
|
@@ -1029,7 +1045,7 @@ var Vt = {
|
|
|
1029
1045
|
e.impact({ style: "Heavy" }).catch(() => {});
|
|
1030
1046
|
return;
|
|
1031
1047
|
}
|
|
1032
|
-
|
|
1048
|
+
Vt([
|
|
1033
1049
|
0,
|
|
1034
1050
|
15,
|
|
1035
1051
|
40,
|
|
@@ -1039,7 +1055,7 @@ var Vt = {
|
|
|
1039
1055
|
};
|
|
1040
1056
|
//#endregion
|
|
1041
1057
|
//#region src/framework/gestures/use-widget-gestures.ts
|
|
1042
|
-
function
|
|
1058
|
+
function Ut(e, t) {
|
|
1043
1059
|
let n = {
|
|
1044
1060
|
isDown: !1,
|
|
1045
1061
|
isTouch: !1,
|
|
@@ -1082,7 +1098,7 @@ function Ht(e, t) {
|
|
|
1082
1098
|
if (n.isDown = !0, n.isTouch = t.pointerType === "touch", n.element = t.currentTarget, c(n.element), n.startX = t.clientX, n.startY = t.clientY, n.startTime = Date.now(), n.hasMoved = !1, n.sliding = !1, r.hold) {
|
|
1083
1099
|
let e = r.hold.delay ?? 300;
|
|
1084
1100
|
n.holdTimer = setTimeout(() => {
|
|
1085
|
-
n.holdTimer = null, !(!n.isDown || n.hasMoved) && (
|
|
1101
|
+
n.holdTimer = null, !(!n.isDown || n.hasMoved) && (Ht.bump(), r.hold?.action(), n.isDown = !1);
|
|
1086
1102
|
}, e);
|
|
1087
1103
|
}
|
|
1088
1104
|
if (!n.isTouch && r.slide) try {
|
|
@@ -1119,9 +1135,9 @@ function Ht(e, t) {
|
|
|
1119
1135
|
let n = e();
|
|
1120
1136
|
if (n.slide) {
|
|
1121
1137
|
let e = n.slide.orientation;
|
|
1122
|
-
return e === "horizontal" ?
|
|
1138
|
+
return e === "horizontal" ? Q.slideHorizontal.css : e === "vertical" ? Q.slideVertical.css : (r || c(t), r && r.height > r.width ? Q.slideVertical.css : Q.slideHorizontal.css);
|
|
1123
1139
|
}
|
|
1124
|
-
return n.tap ?
|
|
1140
|
+
return n.tap ? Q.tap.css : n.hold ? Q.hold.css : "";
|
|
1125
1141
|
};
|
|
1126
1142
|
return {
|
|
1127
1143
|
onPointerDown: f,
|
|
@@ -1150,7 +1166,7 @@ function Ht(e, t) {
|
|
|
1150
1166
|
}
|
|
1151
1167
|
//#endregion
|
|
1152
1168
|
//#region src/framework/theming/svg-colors.ts
|
|
1153
|
-
var
|
|
1169
|
+
var Wt = {
|
|
1154
1170
|
solar: "oklch(0.74 0.18 60)",
|
|
1155
1171
|
grid: "oklch(0.62 0.12 245)",
|
|
1156
1172
|
battery: "oklch(0.70 0.18 145)",
|
|
@@ -1159,21 +1175,21 @@ var Ut = {
|
|
|
1159
1175
|
positive: "oklch(0.70 0.14 160)",
|
|
1160
1176
|
negative: "oklch(0.64 0.22 27)"
|
|
1161
1177
|
};
|
|
1162
|
-
function
|
|
1178
|
+
function Gt(e) {
|
|
1163
1179
|
return {
|
|
1164
1180
|
fill: `color-mix(in oklch, ${e} 20%, transparent)`,
|
|
1165
1181
|
stroke: e,
|
|
1166
1182
|
solid: e
|
|
1167
1183
|
};
|
|
1168
1184
|
}
|
|
1169
|
-
var
|
|
1185
|
+
var Kt = Object.fromEntries(Object.entries(Wt).map(([e, t]) => [e, Gt(t)])), qt = o.enum([
|
|
1170
1186
|
"success",
|
|
1171
1187
|
"warning",
|
|
1172
1188
|
"danger",
|
|
1173
1189
|
"info",
|
|
1174
1190
|
"neutral",
|
|
1175
1191
|
"accent"
|
|
1176
|
-
]),
|
|
1192
|
+
]), Jt = {
|
|
1177
1193
|
title: e(() => o.string().optional().meta({
|
|
1178
1194
|
title: "Title",
|
|
1179
1195
|
description: "Optional display name override"
|
|
@@ -1201,39 +1217,39 @@ function $(e) {
|
|
|
1201
1217
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
1202
1218
|
return t;
|
|
1203
1219
|
}
|
|
1204
|
-
function
|
|
1220
|
+
function Yt() {
|
|
1205
1221
|
return o.string().optional().meta({
|
|
1206
1222
|
title: "Title",
|
|
1207
1223
|
description: "Optional display name override"
|
|
1208
1224
|
});
|
|
1209
1225
|
}
|
|
1210
|
-
function
|
|
1226
|
+
function Xt(e) {
|
|
1211
1227
|
return (e.default === void 0 ? o.string().optional() : o.string().default(e.default)).meta($({
|
|
1212
1228
|
title: e.title,
|
|
1213
1229
|
description: e.description
|
|
1214
1230
|
}));
|
|
1215
1231
|
}
|
|
1216
|
-
function
|
|
1232
|
+
function Zt(e) {
|
|
1217
1233
|
let t = o.number();
|
|
1218
1234
|
return e.min !== void 0 && (t = t.min(e.min)), e.max !== void 0 && (t = t.max(e.max)), (e.default === void 0 ? t.optional() : t.default(e.default)).meta($({
|
|
1219
1235
|
title: e.title,
|
|
1220
1236
|
description: e.description
|
|
1221
1237
|
}));
|
|
1222
1238
|
}
|
|
1223
|
-
function
|
|
1239
|
+
function Qt(e) {
|
|
1224
1240
|
return o.boolean().default(e.default ?? !1).meta($({
|
|
1225
1241
|
title: e.title,
|
|
1226
1242
|
description: e.description
|
|
1227
1243
|
}));
|
|
1228
1244
|
}
|
|
1229
|
-
function
|
|
1245
|
+
function $t(e, t) {
|
|
1230
1246
|
let n = o.enum(e);
|
|
1231
1247
|
return (t.default === void 0 ? n.optional() : n.default(t.default)).meta($({
|
|
1232
1248
|
title: t.title,
|
|
1233
1249
|
description: t.description
|
|
1234
1250
|
}));
|
|
1235
1251
|
}
|
|
1236
|
-
function
|
|
1252
|
+
function en(e, t) {
|
|
1237
1253
|
return o.array(o.string()).default([]).meta($({
|
|
1238
1254
|
domain: e,
|
|
1239
1255
|
title: t?.title ?? "Entities",
|
|
@@ -1241,7 +1257,7 @@ function $t(e, t) {
|
|
|
1241
1257
|
deviceClass: t?.deviceClass
|
|
1242
1258
|
}));
|
|
1243
1259
|
}
|
|
1244
|
-
function
|
|
1260
|
+
function tn(e, t) {
|
|
1245
1261
|
return o.array(o.string()).default([]).meta($({
|
|
1246
1262
|
domain: e,
|
|
1247
1263
|
title: t?.title ?? "Entity",
|
|
@@ -1250,40 +1266,40 @@ function en(e, t) {
|
|
|
1250
1266
|
singleSelect: !0
|
|
1251
1267
|
}));
|
|
1252
1268
|
}
|
|
1253
|
-
function
|
|
1269
|
+
function nn(e) {
|
|
1254
1270
|
return o.string().optional().meta({
|
|
1255
1271
|
formType: "area-picker",
|
|
1256
1272
|
title: e?.title ?? "Area"
|
|
1257
1273
|
});
|
|
1258
1274
|
}
|
|
1259
|
-
function
|
|
1275
|
+
function rn(e) {
|
|
1260
1276
|
return o.array(o.string()).default([]).meta($({
|
|
1261
1277
|
title: e.title,
|
|
1262
1278
|
description: e.description
|
|
1263
1279
|
}));
|
|
1264
1280
|
}
|
|
1265
|
-
function
|
|
1281
|
+
function an(e, t) {
|
|
1266
1282
|
let n = o.object(e);
|
|
1267
|
-
return n.default(
|
|
1283
|
+
return n.default(Se(n)).meta({ title: t.title });
|
|
1268
1284
|
}
|
|
1269
|
-
var
|
|
1270
|
-
title:
|
|
1271
|
-
text:
|
|
1272
|
-
number:
|
|
1273
|
-
toggle:
|
|
1274
|
-
choice:
|
|
1275
|
-
entities:
|
|
1276
|
-
entity:
|
|
1277
|
-
area:
|
|
1278
|
-
stringList:
|
|
1279
|
-
group:
|
|
1285
|
+
var on = {
|
|
1286
|
+
title: Yt,
|
|
1287
|
+
text: Xt,
|
|
1288
|
+
number: Zt,
|
|
1289
|
+
toggle: Qt,
|
|
1290
|
+
choice: $t,
|
|
1291
|
+
entities: en,
|
|
1292
|
+
entity: tn,
|
|
1293
|
+
area: nn,
|
|
1294
|
+
stringList: rn,
|
|
1295
|
+
group: an
|
|
1280
1296
|
};
|
|
1281
|
-
function
|
|
1297
|
+
function sn(e) {
|
|
1282
1298
|
return o.object(e);
|
|
1283
1299
|
}
|
|
1284
1300
|
//#endregion
|
|
1285
1301
|
//#region src/shared/spline.ts
|
|
1286
|
-
function
|
|
1302
|
+
function cn(e) {
|
|
1287
1303
|
if (e.length < 2) return "";
|
|
1288
1304
|
let t = e[0], n = e[1];
|
|
1289
1305
|
if (!t || !n) return "";
|
|
@@ -1310,14 +1326,14 @@ function sn(e) {
|
|
|
1310
1326
|
}
|
|
1311
1327
|
//#endregion
|
|
1312
1328
|
//#region src/theme.ts
|
|
1313
|
-
function
|
|
1329
|
+
function ln() {
|
|
1314
1330
|
return document.documentElement.classList.contains("dark");
|
|
1315
1331
|
}
|
|
1316
1332
|
//#endregion
|
|
1317
1333
|
//#region src/version.ts
|
|
1318
|
-
var
|
|
1334
|
+
var un = {
|
|
1319
1335
|
name: "@glasshome/widget-sdk",
|
|
1320
|
-
version: "1.
|
|
1336
|
+
version: "1.6.0",
|
|
1321
1337
|
description: "SDK for building GlassHome dashboard widgets with SolidJS",
|
|
1322
1338
|
keywords: [
|
|
1323
1339
|
"glasshome",
|
|
@@ -1373,7 +1389,7 @@ var ln = {
|
|
|
1373
1389
|
"solid-js": "^1.9.11"
|
|
1374
1390
|
},
|
|
1375
1391
|
dependencies: {
|
|
1376
|
-
"@glasshome/widget-contract": "0.
|
|
1392
|
+
"@glasshome/widget-contract": "0.2.0",
|
|
1377
1393
|
"@modular-forms/solid": "^0.25.1",
|
|
1378
1394
|
clsx: "^2.1.1",
|
|
1379
1395
|
"tailwind-merge": "^3.5.0",
|
|
@@ -1400,4 +1416,4 @@ var ln = {
|
|
|
1400
1416
|
engines: { node: ">=18" }
|
|
1401
1417
|
}.version;
|
|
1402
1418
|
//#endregion
|
|
1403
|
-
export {
|
|
1419
|
+
export { un as SDK_VERSION, qt as ToneSchema, U as Widget, Be as WidgetContent, R as WidgetCtx, kt as WidgetDialog, We as WidgetIcon, r as WidgetManifestSchema, Re as WidgetSliderFill, Ke as WidgetStatus, Ye as WidgetTitle, st as WidgetValue, g as byDomain, Xe as calculateLightGroup, Ze as calculateSensorGroup, nt as countActiveEntities, sn as defineConfig, Ce as defineWidget, t as deprecations, on as field, n as formatDeprecation, i as formatSchemaError, tt as getEntityAttribute, s as getForecasts, c as getStream, l as getWebRtcClientConfig, u as hassMediaUrl, Pe as injectTokens, ln as isDark, et as isEntityActive, cn as monotoneCubicPath, d as sendWebRtcCandidate, f as startWebRtcSession, p as state, Kt as svgColors, m as trackEntityHistory, h as untrackEntityHistory, _ as useArea, v as useCamera, ee as useConnection, y as useCurrency, b as useEntities, te as useEntity, x as useEntityHistory, ne as useEntityStatistics, re as useForecast, ie as useHassConfig, At as useIntersectionPause, ae as useLocale, jt as useReducedMotion, Ee as useService, oe as useStore, se as useTemperatureUnit, ke as useToggle, Oe as useTurnOff, De as useTurnOn, de as useUnitSystem, we as useWidgetContext, Mt as useWidgetDialog, Nt as useWidgetEntityGroup, Ut as useWidgetGestures, Jt as widgetFields, a as z };
|