@glasshome/widget-sdk 1.23.0 → 1.23.1

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.js CHANGED
@@ -3136,7 +3136,7 @@ function Co() {
3136
3136
  //#region src/version.ts
3137
3137
  var wo = {
3138
3138
  name: "@glasshome/widget-sdk",
3139
- version: "1.23.0",
3139
+ version: "1.23.1",
3140
3140
  description: "SDK for building GlassHome dashboard widgets with SolidJS",
3141
3141
  keywords: [
3142
3142
  "dashboard",
@@ -3197,17 +3197,17 @@ var wo = {
3197
3197
  },
3198
3198
  publishConfig: { access: "public" },
3199
3199
  scripts: {
3200
- build: "vite build && tsc && bun scripts/check-host-singleton.ts",
3200
+ build: "vite build && tsc -p tsconfig.build.json && bun scripts/check-host-singleton.ts",
3201
3201
  dev: "vite build --watch",
3202
3202
  test: "bun test src && vitest run",
3203
3203
  "test:dom": "vitest run",
3204
3204
  "test:dom:watch": "vitest",
3205
- "typecheck:test": "tsc --noEmit -p tsconfig.test.json",
3205
+ "typecheck:test": "tsc --noEmit",
3206
3206
  "check:dead": "fallow dead-code --fail-on-issues",
3207
3207
  lint: "oxlint --type-aware . && oxfmt --check ."
3208
3208
  },
3209
3209
  dependencies: {
3210
- "@glasshome/widget-contract": "0.4.0",
3210
+ "@glasshome/widget-contract": "0.4.1",
3211
3211
  "@tailwindcss/vite": "^4.1.13",
3212
3212
  clsx: "^2.1.1",
3213
3213
  "happy-dom": "^20.0.0",
package/guide/widgets.md CHANGED
@@ -70,6 +70,18 @@ Render `<WidgetDialog>` next to `<Widget>`, spreading the dialog parts (`Respons
70
70
  - Everything sits on an edge; text left, values/actions right. One accent per view; defaults quiet. No card in a card.
71
71
  - Motion: colours morph, never snap; time transitions with `--duration-state` / `--ease-morph` (zeroed under reduced motion). Decorative loops scale by `var(--motion-ambient, 0)`. Gate on `useReducedMotion()`; pause offscreen with `useIntersectionPause()`.
72
72
 
73
+ ## Sealed engine
74
+
75
+ Dash 1.5 previews the engine every widget will run in: QuickJS, no page access. Test there before publishing: Settings, Developer Mode, Sealed widgets (preview), reload, then `bun widget connect`. `bun widget preview` still renders in the page, so it does not prove a widget runs sealed.
76
+
77
+ - Import only `@glasshome/widget-sdk` and `solid-js` (`/store`, `/web`).
78
+ - No `fetch`, `XMLHttpRequest`, WebSocket, cookies, Capacitor. `localStorage` is in-memory and empties on reload. Built-ins are frozen: no `z.config`, no global patches.
79
+ - DOM is mirrored through an allowlist: no `<style>`, `<link>`, `<script>`, no `el.click()`; images only `data:image/…`, same-origin `blob:` or `/ha-proxy/media`.
80
+ - Limits: CPU 250 ms per second, setup 1.5 s per 10 s (both stop the widget until the homeowner turns it back on), 500 ms per run and 256 MB (both crash it), 20,000 elements, 512 timers, 128 observers.
81
+ - Refusals and CPU use: Settings > Sealed widgets (Developer Mode). Each refusal has a sentence and a code; fix every one.
82
+
83
+ Full page: https://glasshome.app/md/widgets/widget-sealed-engine.
84
+
73
85
  ## More
74
86
 
75
87
  Docs as markdown: https://glasshome.app/llms.txt, `https://glasshome.app/md/widgets/<page>` (`widget-sheets`, `widget-styling`, `widget-sdk`, `widget-sdk/materials`, `widget-api-reference`, `widget-capabilities`, `widget-previews`). Official widgets as worked examples: https://github.com/glasshome/widgets (`src/button`, `src/sensor`); where they differ from this guide, the guide wins.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glasshome/widget-sdk",
3
- "version": "1.23.0",
3
+ "version": "1.23.1",
4
4
  "description": "SDK for building GlassHome dashboard widgets with SolidJS",
5
5
  "keywords": [
6
6
  "dashboard",
@@ -65,17 +65,17 @@
65
65
  "access": "public"
66
66
  },
67
67
  "scripts": {
68
- "build": "vite build && tsc && bun scripts/check-host-singleton.ts",
68
+ "build": "vite build && tsc -p tsconfig.build.json && bun scripts/check-host-singleton.ts",
69
69
  "dev": "vite build --watch",
70
70
  "test": "bun test src && vitest run",
71
71
  "test:dom": "vitest run",
72
72
  "test:dom:watch": "vitest",
73
- "typecheck:test": "tsc --noEmit -p tsconfig.test.json",
73
+ "typecheck:test": "tsc --noEmit",
74
74
  "check:dead": "fallow dead-code --fail-on-issues",
75
75
  "lint": "oxlint --type-aware . && oxfmt --check ."
76
76
  },
77
77
  "dependencies": {
78
- "@glasshome/widget-contract": "0.4.0",
78
+ "@glasshome/widget-contract": "0.4.1",
79
79
  "@tailwindcss/vite": "^4.1.13",
80
80
  "clsx": "^2.1.1",
81
81
  "happy-dom": "^20.0.0",
package/preview/host.tsx CHANGED
@@ -41,7 +41,7 @@ function PreviewHost() {
41
41
  "margin-top": "4px",
42
42
  }}
43
43
  >
44
- &lt;{widget.manifest.name}&gt; | {widget.manifest.type} | {widget.manifest.size}
44
+ &lt;{widget.manifest.name}&gt;
45
45
  </p>
46
46
  </div>
47
47
  <button
@@ -0,0 +1,4 @@
1
+ declare module "virtual:glasshome-widget" {
2
+ const widget: import("../src/types").WidgetDefinition;
3
+ export default widget;
4
+ }