@glasshome/widget-sdk 1.32.3 → 1.33.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/export-history.json +299 -0
- package/dist/framework/dialogs/WidgetDialog.d.ts +6 -2
- package/dist/framework/dialogs/index.d.ts +1 -1
- package/dist/framework/dialogs/warm-dialogs.d.ts +8 -0
- package/dist/framework/index.d.ts +1 -1
- package/dist/framework/to-form-schema.d.ts +3 -0
- package/dist/index.js +943 -904
- package/dist/vite/index.d.ts +4 -15
- package/dist/vite/index.js +860 -126
- package/guide/widgets.md +1 -1
- package/package.json +6 -3
package/dist/export-history.json
CHANGED
|
@@ -7039,5 +7039,304 @@
|
|
|
7039
7039
|
"useWidgetViewer",
|
|
7040
7040
|
"widgetFields",
|
|
7041
7041
|
"z"
|
|
7042
|
+
],
|
|
7043
|
+
"1.32.4": [
|
|
7044
|
+
"Badge",
|
|
7045
|
+
"Button",
|
|
7046
|
+
"ButtonGroup",
|
|
7047
|
+
"CameraSourceContext",
|
|
7048
|
+
"CameraStream",
|
|
7049
|
+
"Carousel",
|
|
7050
|
+
"CarouselContent",
|
|
7051
|
+
"CarouselDots",
|
|
7052
|
+
"CarouselItem",
|
|
7053
|
+
"CarouselNext",
|
|
7054
|
+
"CarouselPrevious",
|
|
7055
|
+
"ColorDisc",
|
|
7056
|
+
"ColorSlider",
|
|
7057
|
+
"ColorWheel",
|
|
7058
|
+
"CountPill",
|
|
7059
|
+
"Icon",
|
|
7060
|
+
"Input",
|
|
7061
|
+
"Label",
|
|
7062
|
+
"PanelEntityRow",
|
|
7063
|
+
"PanelFacts",
|
|
7064
|
+
"PanelRow",
|
|
7065
|
+
"PanelRows",
|
|
7066
|
+
"PanelSection",
|
|
7067
|
+
"Progress",
|
|
7068
|
+
"ResponsiveDialog",
|
|
7069
|
+
"ResponsiveDialogBody",
|
|
7070
|
+
"ResponsiveDialogClose",
|
|
7071
|
+
"ResponsiveDialogContent",
|
|
7072
|
+
"ResponsiveDialogDescription",
|
|
7073
|
+
"ResponsiveDialogFooter",
|
|
7074
|
+
"ResponsiveDialogHeader",
|
|
7075
|
+
"ResponsiveDialogTitle",
|
|
7076
|
+
"SDK_VERSION",
|
|
7077
|
+
"SchemaForm",
|
|
7078
|
+
"SectionIcon",
|
|
7079
|
+
"SectionTitle",
|
|
7080
|
+
"Select",
|
|
7081
|
+
"SelectContent",
|
|
7082
|
+
"SelectItem",
|
|
7083
|
+
"SelectTrigger",
|
|
7084
|
+
"SelectValue",
|
|
7085
|
+
"Slider",
|
|
7086
|
+
"SwatchPicker",
|
|
7087
|
+
"Switch",
|
|
7088
|
+
"Tabs",
|
|
7089
|
+
"TabsContent",
|
|
7090
|
+
"TabsList",
|
|
7091
|
+
"TabsTrigger",
|
|
7092
|
+
"TemperatureBar",
|
|
7093
|
+
"Toggle",
|
|
7094
|
+
"ToggleGroup",
|
|
7095
|
+
"ToggleGroupItem",
|
|
7096
|
+
"ToneSchema",
|
|
7097
|
+
"Widget",
|
|
7098
|
+
"WidgetAction",
|
|
7099
|
+
"WidgetBackdrop",
|
|
7100
|
+
"WidgetChip",
|
|
7101
|
+
"WidgetChoice",
|
|
7102
|
+
"WidgetContent",
|
|
7103
|
+
"WidgetControls",
|
|
7104
|
+
"WidgetCtx",
|
|
7105
|
+
"WidgetDebugTab",
|
|
7106
|
+
"WidgetDebugView",
|
|
7107
|
+
"WidgetDialog",
|
|
7108
|
+
"WidgetGlyph",
|
|
7109
|
+
"WidgetHead",
|
|
7110
|
+
"WidgetHero",
|
|
7111
|
+
"WidgetIcon",
|
|
7112
|
+
"WidgetLayer",
|
|
7113
|
+
"WidgetManifestSchema",
|
|
7114
|
+
"WidgetSizeCtx",
|
|
7115
|
+
"WidgetSliderFill",
|
|
7116
|
+
"WidgetStatus",
|
|
7117
|
+
"WidgetStepper",
|
|
7118
|
+
"WidgetTitle",
|
|
7119
|
+
"WidgetValue",
|
|
7120
|
+
"buildDebugData",
|
|
7121
|
+
"byDomain",
|
|
7122
|
+
"calculateLightGroup",
|
|
7123
|
+
"calculateSensorGroup",
|
|
7124
|
+
"copyText",
|
|
7125
|
+
"countActiveEntities",
|
|
7126
|
+
"defineConfig",
|
|
7127
|
+
"defineWidget",
|
|
7128
|
+
"deprecations",
|
|
7129
|
+
"field",
|
|
7130
|
+
"formatDeprecation",
|
|
7131
|
+
"formatSchemaError",
|
|
7132
|
+
"getEntityAttribute",
|
|
7133
|
+
"getForecasts",
|
|
7134
|
+
"getStream",
|
|
7135
|
+
"getWebRtcClientConfig",
|
|
7136
|
+
"hassMediaUrl",
|
|
7137
|
+
"imagePreset",
|
|
7138
|
+
"imageSrc",
|
|
7139
|
+
"imageUrl",
|
|
7140
|
+
"injectTokens",
|
|
7141
|
+
"isDark",
|
|
7142
|
+
"isEntityActive",
|
|
7143
|
+
"isPanelControllable",
|
|
7144
|
+
"mediaUrl",
|
|
7145
|
+
"monotoneCubicPath",
|
|
7146
|
+
"parseColor",
|
|
7147
|
+
"presetValue",
|
|
7148
|
+
"provideCameraSource",
|
|
7149
|
+
"sendWebRtcCandidate",
|
|
7150
|
+
"startWebRtcSession",
|
|
7151
|
+
"state",
|
|
7152
|
+
"svgColors",
|
|
7153
|
+
"trackEntityHistory",
|
|
7154
|
+
"untrackEntityHistory",
|
|
7155
|
+
"useArea",
|
|
7156
|
+
"useCalendarEvents",
|
|
7157
|
+
"useCamera",
|
|
7158
|
+
"useCameraSource",
|
|
7159
|
+
"useConfirm",
|
|
7160
|
+
"useConnection",
|
|
7161
|
+
"useCopyText",
|
|
7162
|
+
"useCurrency",
|
|
7163
|
+
"useDaylight",
|
|
7164
|
+
"useEntities",
|
|
7165
|
+
"useEntity",
|
|
7166
|
+
"useEntityHistory",
|
|
7167
|
+
"useEntityStatistics",
|
|
7168
|
+
"useForecast",
|
|
7169
|
+
"useHassConfig",
|
|
7170
|
+
"useIntersectionPause",
|
|
7171
|
+
"useLocale",
|
|
7172
|
+
"useMaterial",
|
|
7173
|
+
"useReducedMotion",
|
|
7174
|
+
"useService",
|
|
7175
|
+
"useStore",
|
|
7176
|
+
"useTemperatureUnit",
|
|
7177
|
+
"useToggle",
|
|
7178
|
+
"useTurnOff",
|
|
7179
|
+
"useTurnOn",
|
|
7180
|
+
"useUnitSystem",
|
|
7181
|
+
"useWidgetContext",
|
|
7182
|
+
"useWidgetDashboard",
|
|
7183
|
+
"useWidgetDialog",
|
|
7184
|
+
"useWidgetDimensions",
|
|
7185
|
+
"useWidgetEntityGroup",
|
|
7186
|
+
"useWidgetGestures",
|
|
7187
|
+
"useWidgetState",
|
|
7188
|
+
"useWidgetViewer",
|
|
7189
|
+
"widgetFields",
|
|
7190
|
+
"z"
|
|
7191
|
+
],
|
|
7192
|
+
"1.33.0": [
|
|
7193
|
+
"Badge",
|
|
7194
|
+
"Button",
|
|
7195
|
+
"ButtonGroup",
|
|
7196
|
+
"CameraSourceContext",
|
|
7197
|
+
"CameraStream",
|
|
7198
|
+
"Carousel",
|
|
7199
|
+
"CarouselContent",
|
|
7200
|
+
"CarouselDots",
|
|
7201
|
+
"CarouselItem",
|
|
7202
|
+
"CarouselNext",
|
|
7203
|
+
"CarouselPrevious",
|
|
7204
|
+
"ColorDisc",
|
|
7205
|
+
"ColorSlider",
|
|
7206
|
+
"ColorWheel",
|
|
7207
|
+
"CountPill",
|
|
7208
|
+
"Icon",
|
|
7209
|
+
"Input",
|
|
7210
|
+
"Label",
|
|
7211
|
+
"PanelEntityRow",
|
|
7212
|
+
"PanelFacts",
|
|
7213
|
+
"PanelRow",
|
|
7214
|
+
"PanelRows",
|
|
7215
|
+
"PanelSection",
|
|
7216
|
+
"Progress",
|
|
7217
|
+
"ResponsiveDialog",
|
|
7218
|
+
"ResponsiveDialogBody",
|
|
7219
|
+
"ResponsiveDialogClose",
|
|
7220
|
+
"ResponsiveDialogContent",
|
|
7221
|
+
"ResponsiveDialogDescription",
|
|
7222
|
+
"ResponsiveDialogFooter",
|
|
7223
|
+
"ResponsiveDialogHeader",
|
|
7224
|
+
"ResponsiveDialogTitle",
|
|
7225
|
+
"SDK_VERSION",
|
|
7226
|
+
"SchemaForm",
|
|
7227
|
+
"SectionIcon",
|
|
7228
|
+
"SectionTitle",
|
|
7229
|
+
"Select",
|
|
7230
|
+
"SelectContent",
|
|
7231
|
+
"SelectItem",
|
|
7232
|
+
"SelectTrigger",
|
|
7233
|
+
"SelectValue",
|
|
7234
|
+
"Slider",
|
|
7235
|
+
"SwatchPicker",
|
|
7236
|
+
"Switch",
|
|
7237
|
+
"Tabs",
|
|
7238
|
+
"TabsContent",
|
|
7239
|
+
"TabsList",
|
|
7240
|
+
"TabsTrigger",
|
|
7241
|
+
"TemperatureBar",
|
|
7242
|
+
"Toggle",
|
|
7243
|
+
"ToggleGroup",
|
|
7244
|
+
"ToggleGroupItem",
|
|
7245
|
+
"ToneSchema",
|
|
7246
|
+
"Widget",
|
|
7247
|
+
"WidgetAction",
|
|
7248
|
+
"WidgetBackdrop",
|
|
7249
|
+
"WidgetChip",
|
|
7250
|
+
"WidgetChoice",
|
|
7251
|
+
"WidgetContent",
|
|
7252
|
+
"WidgetControls",
|
|
7253
|
+
"WidgetCtx",
|
|
7254
|
+
"WidgetDebugTab",
|
|
7255
|
+
"WidgetDebugView",
|
|
7256
|
+
"WidgetDialog",
|
|
7257
|
+
"WidgetGlyph",
|
|
7258
|
+
"WidgetHead",
|
|
7259
|
+
"WidgetHero",
|
|
7260
|
+
"WidgetIcon",
|
|
7261
|
+
"WidgetLayer",
|
|
7262
|
+
"WidgetManifestSchema",
|
|
7263
|
+
"WidgetSizeCtx",
|
|
7264
|
+
"WidgetSliderFill",
|
|
7265
|
+
"WidgetStatus",
|
|
7266
|
+
"WidgetStepper",
|
|
7267
|
+
"WidgetTitle",
|
|
7268
|
+
"WidgetValue",
|
|
7269
|
+
"buildDebugData",
|
|
7270
|
+
"byDomain",
|
|
7271
|
+
"calculateLightGroup",
|
|
7272
|
+
"calculateSensorGroup",
|
|
7273
|
+
"copyText",
|
|
7274
|
+
"countActiveEntities",
|
|
7275
|
+
"defineConfig",
|
|
7276
|
+
"defineWidget",
|
|
7277
|
+
"deprecations",
|
|
7278
|
+
"field",
|
|
7279
|
+
"formatDeprecation",
|
|
7280
|
+
"formatSchemaError",
|
|
7281
|
+
"getEntityAttribute",
|
|
7282
|
+
"getForecasts",
|
|
7283
|
+
"getStream",
|
|
7284
|
+
"getWebRtcClientConfig",
|
|
7285
|
+
"hassMediaUrl",
|
|
7286
|
+
"imagePreset",
|
|
7287
|
+
"imageSrc",
|
|
7288
|
+
"imageUrl",
|
|
7289
|
+
"injectTokens",
|
|
7290
|
+
"isDark",
|
|
7291
|
+
"isEntityActive",
|
|
7292
|
+
"isPanelControllable",
|
|
7293
|
+
"mediaUrl",
|
|
7294
|
+
"monotoneCubicPath",
|
|
7295
|
+
"parseColor",
|
|
7296
|
+
"presetValue",
|
|
7297
|
+
"provideCameraSource",
|
|
7298
|
+
"sendWebRtcCandidate",
|
|
7299
|
+
"startWebRtcSession",
|
|
7300
|
+
"state",
|
|
7301
|
+
"svgColors",
|
|
7302
|
+
"trackEntityHistory",
|
|
7303
|
+
"untrackEntityHistory",
|
|
7304
|
+
"useArea",
|
|
7305
|
+
"useCalendarEvents",
|
|
7306
|
+
"useCamera",
|
|
7307
|
+
"useCameraSource",
|
|
7308
|
+
"useConfirm",
|
|
7309
|
+
"useConnection",
|
|
7310
|
+
"useCopyText",
|
|
7311
|
+
"useCurrency",
|
|
7312
|
+
"useDaylight",
|
|
7313
|
+
"useEntities",
|
|
7314
|
+
"useEntity",
|
|
7315
|
+
"useEntityHistory",
|
|
7316
|
+
"useEntityStatistics",
|
|
7317
|
+
"useForecast",
|
|
7318
|
+
"useHassConfig",
|
|
7319
|
+
"useIntersectionPause",
|
|
7320
|
+
"useLocale",
|
|
7321
|
+
"useMaterial",
|
|
7322
|
+
"useReducedMotion",
|
|
7323
|
+
"useService",
|
|
7324
|
+
"useSheetDormant",
|
|
7325
|
+
"useStore",
|
|
7326
|
+
"useTemperatureUnit",
|
|
7327
|
+
"useToggle",
|
|
7328
|
+
"useTurnOff",
|
|
7329
|
+
"useTurnOn",
|
|
7330
|
+
"useUnitSystem",
|
|
7331
|
+
"useWidgetContext",
|
|
7332
|
+
"useWidgetDashboard",
|
|
7333
|
+
"useWidgetDialog",
|
|
7334
|
+
"useWidgetDimensions",
|
|
7335
|
+
"useWidgetEntityGroup",
|
|
7336
|
+
"useWidgetGestures",
|
|
7337
|
+
"useWidgetState",
|
|
7338
|
+
"useWidgetViewer",
|
|
7339
|
+
"widgetFields",
|
|
7340
|
+
"z"
|
|
7042
7341
|
]
|
|
7043
7342
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ModalSize, Button as UIButton, ResponsiveDialog as UIResponsiveDialog, ResponsiveDialogContent as UIResponsiveDialogContent, ResponsiveDialogDescription as UIResponsiveDialogDescription, ResponsiveDialogHeader as UIResponsiveDialogHeader, ResponsiveDialogTitle as UIResponsiveDialogTitle, SchemaForm as UISchemaForm } from "@glasshome/ui/solid";
|
|
2
2
|
import { ResponsiveDialogBody, ResponsiveDialogFooter, Tabs, TabsContent, TabsList, TabsTrigger } from "@glasshome/ui/solid";
|
|
3
|
-
import { type JSX } from "solid-js";
|
|
3
|
+
import { type Accessor, type Component, type ComponentProps, type JSX } from "solid-js";
|
|
4
4
|
import type { ZodType } from "zod";
|
|
5
5
|
/** Widths a widget could name before ui's modal size scale existed. */
|
|
6
6
|
type LegacyMaxWidth = "2xl" | "3xl" | "4xl";
|
|
@@ -50,7 +50,9 @@ export interface WidgetDialogProps {
|
|
|
50
50
|
configSchema?: ZodType;
|
|
51
51
|
config?: Record<string, unknown>;
|
|
52
52
|
onConfigSave?: (config: Record<string, unknown>) => void;
|
|
53
|
-
ResponsiveDialog: typeof UIResponsiveDialog
|
|
53
|
+
ResponsiveDialog: Component<ComponentProps<typeof UIResponsiveDialog> & {
|
|
54
|
+
keep?: boolean;
|
|
55
|
+
}>;
|
|
54
56
|
ResponsiveDialogContent: typeof UIResponsiveDialogContent;
|
|
55
57
|
ResponsiveDialogHeader: typeof UIResponsiveDialogHeader;
|
|
56
58
|
ResponsiveDialogTitle: typeof UIResponsiveDialogTitle;
|
|
@@ -64,5 +66,7 @@ export interface WidgetDialogProps {
|
|
|
64
66
|
TabsTrigger?: typeof TabsTrigger;
|
|
65
67
|
TabsContent?: typeof TabsContent;
|
|
66
68
|
}
|
|
69
|
+
/** True from a sheet's close to its next open: a warm sheet stays mounted, so a ticker inside it pauses on this. */
|
|
70
|
+
export declare function useSheetDormant(): Accessor<boolean>;
|
|
67
71
|
export declare function WidgetDialog(props: WidgetDialogProps): JSX.Element;
|
|
68
72
|
export {};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Dialog Components - Barrel Export
|
|
3
3
|
*/
|
|
4
4
|
export { buildDebugData, WidgetDebugTab, WidgetDebugView, type WidgetDebugData, type WidgetDebugEntity, } from "./debug-view";
|
|
5
|
-
export { type SheetTile, WidgetDialog, type WidgetDialogProps, type WidgetDialogTab, } from "./WidgetDialog";
|
|
5
|
+
export { type SheetTile, useSheetDormant, WidgetDialog, type WidgetDialogProps, type WidgetDialogTab, } from "./WidgetDialog";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface WarmSet<K> {
|
|
2
|
+
has(key: K): boolean;
|
|
3
|
+
touch(key: K): void;
|
|
4
|
+
drop(key: K): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function createWarmSet<K>(cap: number): WarmSet<K>;
|
|
7
|
+
export declare const WARM_SHEET_CAP = 3;
|
|
8
|
+
export declare const warmSheets: WarmSet<object>;
|
|
@@ -35,7 +35,7 @@ export { type Confirm, useConfirm } from "./hooks/use-confirm";
|
|
|
35
35
|
export { WidgetSliderFill } from "./backgrounds/WidgetSliderFill";
|
|
36
36
|
export { type PanelFact, PanelFacts, PanelRow, type PanelRowProps, PanelRows, PanelSection, type PanelSlide, } from "./panel/panel";
|
|
37
37
|
export { isPanelControllable, PanelEntityRow } from "./panel/panel-entity";
|
|
38
|
-
export { buildDebugData, WidgetDebugTab, type WidgetDebugData, type WidgetDebugEntity, WidgetDebugView, WidgetDialog, type SheetTile, type WidgetDialogProps, type WidgetDialogTab, } from "./dialogs";
|
|
38
|
+
export { buildDebugData, WidgetDebugTab, type WidgetDebugData, type WidgetDebugEntity, WidgetDebugView, WidgetDialog, type SheetTile, useSheetDormant, type WidgetDialogProps, type WidgetDialogTab, } from "./dialogs";
|
|
39
39
|
export { type AggregationPreset, type ReactiveWidgetContext, type ServiceCallFn, type UseWidgetEntityGroupOptions, type UseWidgetEntityGroupResult, type Daylight, type DaylightPhase, useDaylight, useIntersectionPause, useReducedMotion, useWidgetContext, useWidgetDashboard, useMaterial, useWidgetViewer, useWidgetState, useWidgetDialog, useWidgetDimensions, useWidgetEntityGroup, WidgetCtx, type WidgetDashboard, type WidgetMaterial, type WidgetViewer, type WidgetStateStore, type WidgetStateVerdict, type WidgetDialogReturn, type WidgetDimensions, type WidgetDimensionsAccessor, WidgetSizeCtx, } from "./hooks";
|
|
40
40
|
export { type GestureHandlers, useWidgetGestures } from "./gestures/use-widget-gestures";
|
|
41
41
|
export { injectTokens, type SvgColorKey, svgColors, type Tone, ToneSchema } from "./theming";
|
|
@@ -6,6 +6,9 @@ import { type ZodType } from "zod";
|
|
|
6
6
|
* `{ formType: "area-picker" }`). The `override` callback reads these from
|
|
7
7
|
* `z.globalRegistry` and merges them into the JSON Schema output so the
|
|
8
8
|
* form renderer can detect custom field types.
|
|
9
|
+
*
|
|
10
|
+
* The conversion runs once per schema object; every caller of the same schema
|
|
11
|
+
* receives the same result, so read it and never change it.
|
|
9
12
|
*/
|
|
10
13
|
export declare function toFormSchema(schema: ZodType): object;
|
|
11
14
|
/**
|