@glasshome/widget-cli 0.10.1 → 0.10.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glasshome/widget-cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "CLI for creating and managing GlassHome widgets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"@fontsource-variable/caveat": "^5.2.8",
|
|
29
29
|
"@fontsource-variable/geist": "^5.2.9",
|
|
30
30
|
"@fontsource-variable/geist-mono": "^5.2.8",
|
|
31
|
-
"@glasshome/sync-layer": "0.
|
|
31
|
+
"@glasshome/sync-layer": "0.6.0",
|
|
32
32
|
"@glasshome/widget-contract": "0.2.0",
|
|
33
|
-
"@glasshome/widget-sdk": "1.9.
|
|
33
|
+
"@glasshome/widget-sdk": "1.9.2",
|
|
34
34
|
"@iconify-json/lucide": "^1.2.0",
|
|
35
35
|
"@iconify-json/mdi": "^1.2.3",
|
|
36
36
|
"@tailwindcss/vite": "^4.1.13",
|
|
@@ -85,7 +85,13 @@ async function loadWidget(name: string): Promise<{ def: WidgetDefinition; css: s
|
|
|
85
85
|
// Grid geometry mirrored from the dash route (rowHeight 70, margin 16, lg 12
|
|
86
86
|
// cols at a 1024px reference container). A preview approximates one dashboard
|
|
87
87
|
// width rather than mirroring every breakpoint.
|
|
88
|
-
|
|
88
|
+
// max-w-7xl (1280px) minus the route's px-3 padding, i.e. the width the grid
|
|
89
|
+
// actually gets on a desktop dashboard. NOT the lg breakpoint's 1024 minimum:
|
|
90
|
+
// that is the narrowest a desktop can be, and using it rendered every
|
|
91
|
+
// size-responsive widget one tier below what users see (energy-flow never
|
|
92
|
+
// reached its node-graph tier, so the storefront advertised the compact
|
|
93
|
+
// layout).
|
|
94
|
+
const CONTAINER = 1256;
|
|
89
95
|
const COLS = 12;
|
|
90
96
|
const GAP = 16;
|
|
91
97
|
const ROW_H = 70;
|
|
@@ -98,11 +104,26 @@ function tilePx(size: { w: number; h: number }): { width: number; height: number
|
|
|
98
104
|
};
|
|
99
105
|
}
|
|
100
106
|
|
|
107
|
+
/* The shell composites `--glass-frost` as its bottom background layer and
|
|
108
|
+
defaults it to `none`, because in the app a live backdrop-filter blurs the
|
|
109
|
+
dashboard wallpaper behind the widget. A preview is shot alone on a
|
|
110
|
+
transparent page, so there is nothing to blur and the widget would render
|
|
111
|
+
with no surface at all: legible by luck in light mode, white-on-nothing in
|
|
112
|
+
dark. ui registers --glass-frost with `inherits: false`, so it cannot be
|
|
113
|
+
handed down from the host and has to be set on the shell element itself,
|
|
114
|
+
which is what dash's performant-blur override sheet does too.
|
|
115
|
+
|
|
116
|
+
`--card` is an ordinary inheriting theme token, so it crosses the shadow
|
|
117
|
+
boundary and follows the `dark` class already mirrored onto the host. */
|
|
118
|
+
const FROST_SHEET = new CSSStyleSheet();
|
|
119
|
+
FROST_SHEET.replaceSync(
|
|
120
|
+
".glasshome-widget { --glass-frost: linear-gradient(var(--card), var(--card)); }",
|
|
121
|
+
);
|
|
122
|
+
|
|
101
123
|
/** Mount via the shared SDK recipe (`@glasshome/widget-sdk/host`): closed shadow
|
|
102
124
|
root, injected tokens, adopted widget CSS, WidgetCtx provider, `dark`
|
|
103
|
-
mirrored onto the host.
|
|
104
|
-
|
|
105
|
-
`dark` document class is toggled by the caller before this runs. */
|
|
125
|
+
mirrored onto the host. `dark` is the default `mirrorClasses`; the `dark`
|
|
126
|
+
document class is toggled by the caller before this runs. */
|
|
106
127
|
function mount(
|
|
107
128
|
host: HTMLElement,
|
|
108
129
|
def: WidgetDefinition,
|
|
@@ -115,6 +136,7 @@ function mount(
|
|
|
115
136
|
config: () => config,
|
|
116
137
|
ctx,
|
|
117
138
|
cssText,
|
|
139
|
+
extraSheets: [FROST_SHEET],
|
|
118
140
|
onCrash: (err) => console.error("[harness] widget threw:", err),
|
|
119
141
|
});
|
|
120
142
|
}
|