@nebulahome/package-sdk 1.1.0 → 1.3.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/ui.js CHANGED
@@ -173,6 +173,56 @@ function useTranslation() {
173
173
  return lent === void 0 ? ENGLISH : lent();
174
174
  }
175
175
  /**
176
+ * The recorded changes of some entities over a window, live as the window moves: what a chart of
177
+ * an on/off thing, an activity list or a replay of a day is drawn from. Read with the viewer's
178
+ * permissions: an entity they may not read has no points.
179
+ *
180
+ * @param query - Which entities (at most 64), which window, how often to read it again.
181
+ * @returns Each entity's changes, oldest first, and whether the read is still on its way.
182
+ */
183
+ function useStateHistory(query) {
184
+ return ui("useStateHistory", "1.2")(query);
185
+ }
186
+ /**
187
+ * The numeric readings of some entities over a window: what a sensor's chart is drawn from. A
188
+ * long window is read in buckets of a minute, an hour or a day, each with its lowest and highest.
189
+ *
190
+ * @param query - Which entities (at most 64), which window, which resolution (`auto` by default).
191
+ * @returns Each entity's readings, oldest first, and the resolution they were read at.
192
+ */
193
+ function useTelemetry(query) {
194
+ return ui("useTelemetry", "1.2")(query);
195
+ }
196
+ /**
197
+ * The areas of the house: the house itself (with its position, when set), its floors and its
198
+ * rooms, as the owner arranged them.
199
+ *
200
+ * @returns Them, in the owner's order.
201
+ */
202
+ function useAreas() {
203
+ return ui("useAreas", "1.2")();
204
+ }
205
+ /**
206
+ * Adds, renames and removes the house's floors and rooms, as the platform's areas page does, with
207
+ * the viewer's permissions: `canEdit` says whether they hold them. Since 1.3.
208
+ *
209
+ * @returns What changes the areas.
210
+ */
211
+ function useAreaActions() {
212
+ return ui("useAreaActions", "1.3")();
213
+ }
214
+ /**
215
+ * A camera's latest still, fetched again every so often, or an image entity's picture, fetched
216
+ * again when it changes: an address an `<img>` shows, let go of when a newer one replaces it.
217
+ *
218
+ * @param entityId - A `camera.*` or an `image.*` entity.
219
+ * @param options - How often a still is fetched again, and whether at all.
220
+ * @returns The address, or null before there is one.
221
+ */
222
+ function useEntityPicture(entityId, options) {
223
+ return ui("useEntityPicture", "1.2")(entityId, options);
224
+ }
225
+ /**
176
226
  * The theme the interface draws in, for what draws its own colours: a canvas, a chart.
177
227
  *
178
228
  * @returns Light or dark.
@@ -230,5 +280,15 @@ function PackageLink(props) {
230
280
  function PlatformLink(props) {
231
281
  return createElement(ui("PlatformLink", "1.0"), props);
232
282
  }
283
+ /**
284
+ * Buttons and links drawn in the header of the package's page, in place of the platform's own:
285
+ * the page's actions, beside its title. On a card or a view it draws nothing. Since 1.3.
286
+ *
287
+ * @param props - What the header shows.
288
+ * @returns The actions.
289
+ */
290
+ function PageActions(props) {
291
+ return createElement(ui("PageActions", "1.3"), props);
292
+ }
233
293
  //#endregion
234
- export { PackageLink, PlatformLink, useCommand, useCustomEntity, useEntities, useEntity, useLocale, usePackage, usePackageCall, usePackageMutation, usePackageNavigate, usePackageRoute, usePackageRpc, usePackageSettings, usePlatformNavigate, usePortalContainer, useTheme, useTranslation, useViewer };
294
+ export { PackageLink, PageActions, PlatformLink, useAreaActions, useAreas, useCommand, useCustomEntity, useEntities, useEntity, useEntityPicture, useLocale, usePackage, usePackageCall, usePackageMutation, usePackageNavigate, usePackageRoute, usePackageRpc, usePackageSettings, usePlatformNavigate, usePortalContainer, useStateHistory, useTelemetry, useTheme, useTranslation, useViewer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebulahome/package-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Write a NebulaHome package: declare it, build it, and run it on the platform.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,6 +32,10 @@
32
32
  "types": "./dist/ui.d.ts",
33
33
  "default": "./dist/ui.js"
34
34
  },
35
+ "./sun": {
36
+ "types": "./dist/sun.d.ts",
37
+ "default": "./dist/sun.js"
38
+ },
35
39
  "./components": {
36
40
  "types": "./dist/components.d.ts",
37
41
  "default": "./dist/components.js"
@@ -97,9 +101,9 @@
97
101
  "yaml": "^2.9.0",
98
102
  "zod": "^4.5.4",
99
103
  "@nebulahome/contracts": "0.0.0",
104
+ "@nebulahome/eslint-config": "0.0.0",
100
105
  "@nebulahome/tsconfig": "0.0.0",
101
- "@nebulahome/ui": "0.0.0",
102
- "@nebulahome/eslint-config": "0.0.0"
106
+ "@nebulahome/ui": "0.0.0"
103
107
  },
104
108
  "scripts": {
105
109
  "build": "tsdown && node scripts/build-styles.js",