@edgestation/sdk 0.10.0 → 0.12.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/README.md CHANGED
@@ -215,4 +215,4 @@ To share the widget, ship the folder with `manifest.json`, `dist/` and any files
215
215
 
216
216
  ## Types
217
217
 
218
- Everything is exported from `@edgestation/sdk` as types: `WidgetApi`, `WidgetModule`, `WidgetManifest`, `WidgetPermission`, `WidgetProps`, the settings types and the results of `api.system()`, `api.media`, `api.audio`, `api.apps` and `api.storage`.
218
+ Everything is exported from `@edgestation/sdk` as types: `WidgetApi`, `WidgetModule`, `WidgetManifest`, `WidgetPermission`, `WidgetProps`, `WidgetSurface`, the settings types and the results of `api.system()`, `api.media`, `api.audio`, `api.apps` and `api.storage`.
@@ -7,6 +7,17 @@ import type { WebviewOptions } from './api/webview.js';
7
7
  import type { Cleanup } from './cleanup.js';
8
8
  import type { WidgetManifest } from './manifest.js';
9
9
  import type { WidgetSettingValues } from './settings.js';
10
+ /**
11
+ * Where a widget shows.
12
+ *
13
+ * - `card`: a card in a grid. The pages of the Edge and open Ambient show cards.
14
+ * - `ambient`: closed Ambient, at the top of the main screen, about 200 x 38 CSS px. It is a
15
+ * notch or a pill, black or liquid glass. It uses the dark theme colors, or the light ones on
16
+ * light liquid glass. It has room for one line of content. Closed Ambient gets no clicks or
17
+ * touches, because the pointer opens it. Show information, not controls, and keep it short, so
18
+ * that the user can read it at a glance.
19
+ */
20
+ export type WidgetSurface = 'card' | 'ambient';
10
21
  /**
11
22
  * What a widget gets from the host. It is small on purpose, because the full API is not
12
23
  * designed yet. When the widget unmounts, the host releases all that the widget registered here.
@@ -23,6 +34,12 @@ export interface WidgetApi {
23
34
  * changes a setting.
24
35
  */
25
36
  readonly settings: Readonly<WidgetSettingValues>;
37
+ /**
38
+ * Where this placement shows: a card in a grid, or closed Ambient. Use it to adapt
39
+ * the layout. It does not change while the widget is mounted. If it must change, the host
40
+ * mounts the widget again.
41
+ */
42
+ readonly surface: WidgetSurface;
26
43
  /**
27
44
  * The performance of the machine, read when you call it. Nothing monitors between calls.
28
45
  * Needs `system`.
@@ -35,6 +35,13 @@ export interface WidgetManifest {
35
35
  w: number;
36
36
  h: number;
37
37
  };
38
+ /**
39
+ * Set it to `true` when the widget has a layout for closed Ambient, where `api.surface` is
40
+ * `ambient`. The user can pick only these widgets for closed Ambient, and the host does not
41
+ * mount other widgets there. Every widget can show as a card, on the Edge and in open
42
+ * Ambient.
43
+ */
44
+ ambient?: boolean;
38
45
  /** The options that the user can set for each placement, in display order. */
39
46
  settings?: WidgetSetting[];
40
47
  /**
@@ -43,6 +43,10 @@
43
43
  "h": { "type": "integer", "minimum": 1 }
44
44
  }
45
45
  },
46
+ "ambient": {
47
+ "type": "boolean",
48
+ "description": "true when the widget has a layout for closed Ambient (api.surface is ambient), about 200 x 38 px with room for one line. Only these widgets can be picked for closed Ambient. Every widget can show as a card."
49
+ },
46
50
  "permissions": {
47
51
  "type": "array",
48
52
  "description": "The parts of api the widget uses. The marketplace shows what each one allows before an install. A call to a part not listed here shows the error card. system also gives api.topPrograms. webview also gives the widget's settings a Profile choice.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgestation/sdk",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Types and build helpers to write widgets for EdgeStation, the secondary display dashboard made for the Corsair Xeneon Edge, in plain JavaScript, Svelte, React or Vue.",
5
5
  "keywords": [
6
6
  "edgestation",