@nebulahome/package-sdk 1.2.0 → 1.4.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/CHANGELOG.md +16 -0
- package/README.md +19 -2
- package/dist/chunks/node-build.js +1 -1
- package/dist/chunks/version.js +1 -1
- package/dist/styles.css +149 -3
- package/dist/ui.d.ts +80 -1
- package/dist/ui.js +29 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
The SDK's version is the version of the package API the platform implements: a minor version adds
|
|
4
4
|
to it, a major one breaks it, and a patch leaves it as it is.
|
|
5
5
|
|
|
6
|
+
## 1.4.0
|
|
7
|
+
|
|
8
|
+
- **Toasts.** `useToast()` from `@nebulahome/package-sdk/ui` shows the interface's own toasts -
|
|
9
|
+
`success`, `warning`, `error`, `info`, each with a title, a line or two and at most one action -
|
|
10
|
+
for the outcome of something the viewer just did.
|
|
11
|
+
|
|
12
|
+
## 1.3.0
|
|
13
|
+
|
|
14
|
+
- **The page's actions in its header.** `<PageActions>` from `@nebulahome/package-sdk/ui` draws
|
|
15
|
+
its children in the header of the package's page, beside the title, in place of the platform's
|
|
16
|
+
own "Details": the buttons a page would otherwise give a row of their own. On a card or an
|
|
17
|
+
entity view it draws nothing.
|
|
18
|
+
- **Changing the areas.** `useAreaActions()` adds a floor or a room to the house, renames one,
|
|
19
|
+
moves a floor to another storey or removes an area, with the viewer's permissions (`area:write`,
|
|
20
|
+
which `canEdit` says): a package that draws the house keeps its floors and rooms the house's own.
|
|
21
|
+
|
|
6
22
|
## 1.2.0
|
|
7
23
|
|
|
8
24
|
- **The past of the house.** `ctx.history.states()` and `ctx.history.telemetry()` on the server
|
package/README.md
CHANGED
|
@@ -140,6 +140,22 @@ import { sunPosition } from '@nebulahome/package-sdk/sun';
|
|
|
140
140
|
const { elevation, azimuth } = sunPosition(at, { latitude, longitude });
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
+
## Toasts
|
|
144
|
+
|
|
145
|
+
The interface's own toasts, for the outcome of something the viewer just did (since 1.4):
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
const toast = useToast();
|
|
149
|
+
const save = usePackageMutation('rules.save');
|
|
150
|
+
|
|
151
|
+
try {
|
|
152
|
+
await save.mutate(rules);
|
|
153
|
+
toast.success({ title: t('save.done', 'Saved') });
|
|
154
|
+
} catch (error) {
|
|
155
|
+
toast.error({ title: t('save.failed', "Couldn't save"), message: String(error) });
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
143
159
|
## Entry points
|
|
144
160
|
|
|
145
161
|
| Import | What |
|
|
@@ -189,8 +205,9 @@ git tag package-sdk@<version> && git push origin package-sdk@<version>
|
|
|
189
205
|
```
|
|
190
206
|
|
|
191
207
|
`.github/workflows/release-package-sdk.yml` checks the tag says the package's version, runs the
|
|
192
|
-
SDK's gates and
|
|
193
|
-
|
|
208
|
+
SDK's gates and keeps the archive npm will receive as the run's artifact; it makes no GitHub
|
|
209
|
+
release, npm is where the SDK is published. The maintainer downloads that artifact from the run
|
|
210
|
+
and publishes it, signed in to npm:
|
|
194
211
|
|
|
195
212
|
```sh
|
|
196
213
|
npm publish nebulahome-package-sdk-<version>.tgz
|
|
@@ -6850,7 +6850,7 @@ function composeFileProblems(text, settingKeys) {
|
|
|
6850
6850
|
* the two are compared before a package is installed or started (PACKAGES_DOCS.md 11).
|
|
6851
6851
|
*/
|
|
6852
6852
|
/** The SDK's own version, `1.0.0`. */
|
|
6853
|
-
const SDK_VERSION = "1.
|
|
6853
|
+
const SDK_VERSION = "1.4.0";
|
|
6854
6854
|
//#endregion
|
|
6855
6855
|
//#region src/vite/catalogues.ts
|
|
6856
6856
|
/**
|
package/dist/chunks/version.js
CHANGED
package/dist/styles.css
CHANGED
|
@@ -116,9 +116,12 @@
|
|
|
116
116
|
/** Scenes, aliases and computed things; the If lane of an automation. */
|
|
117
117
|
--color-violet: #a78bfa;
|
|
118
118
|
|
|
119
|
-
/** Sensors, charts, live scanning; the When lane of an automation. */
|
|
119
|
+
/** Sensors, charts, live scanning; the When lane of an automation. Wi-Fi on a network map. */
|
|
120
120
|
--color-cyan: #4fd0ee;
|
|
121
121
|
|
|
122
|
+
/** Thread, on a network map: its links, its routers. */
|
|
123
|
+
--color-thread: #e879f9;
|
|
124
|
+
|
|
122
125
|
/* --- states ------------------------------------------------------------------------------ */
|
|
123
126
|
|
|
124
127
|
--color-success: #52cd86;
|
|
@@ -258,11 +261,26 @@
|
|
|
258
261
|
--text-headline--line-height: 1.25;
|
|
259
262
|
--text-headline--letter-spacing: -0.02em;
|
|
260
263
|
|
|
264
|
+
/** A settings page's own title, beside its icon chip under the breadcrumb. */
|
|
265
|
+
--text-headline-lg: 24px;
|
|
266
|
+
--text-headline-lg--line-height: 1.2;
|
|
267
|
+
--text-headline-lg--letter-spacing: -0.02em;
|
|
268
|
+
|
|
269
|
+
/** The title of a section with its own column of pages, such as Settings. */
|
|
270
|
+
--text-display-sm: 28px;
|
|
271
|
+
--text-display-sm--line-height: 1.15;
|
|
272
|
+
--text-display-sm--letter-spacing: -0.03em;
|
|
273
|
+
|
|
261
274
|
/** The page title, one per screen, with its meta beside it in `mono-ui`. */
|
|
262
275
|
--text-display: 30px;
|
|
263
276
|
--text-display--line-height: 1.15;
|
|
264
277
|
--text-display--letter-spacing: -0.03em;
|
|
265
278
|
|
|
279
|
+
/** The title of the screen every page shows while Nebula Home restarts or updates. */
|
|
280
|
+
--text-display-lg: 40px;
|
|
281
|
+
--text-display-lg--line-height: 1.1;
|
|
282
|
+
--text-display-lg--letter-spacing: -0.035em;
|
|
283
|
+
|
|
266
284
|
/** The number an entity card is about; its unit follows at half size in `foreground-subtle`. */
|
|
267
285
|
--text-reading: 32px;
|
|
268
286
|
--text-reading--line-height: 1;
|
|
@@ -329,14 +347,15 @@
|
|
|
329
347
|
/* --- depth -------------------------------------------------------------------------------- */
|
|
330
348
|
/*
|
|
331
349
|
* Flat. A panel has no resting shadow; an entity card has the faint lit top edge of `edge`. A
|
|
332
|
-
* dialog and the sign-in card take `dialog`, a menu and a dragged card `float`, a
|
|
333
|
-
* field `focus`.
|
|
350
|
+
* dialog and the sign-in card take `dialog`, a menu and a dragged card `float`, a popover
|
|
351
|
+
* (search results, the icon picker) `popover`, a focused field `focus`.
|
|
334
352
|
*/
|
|
335
353
|
|
|
336
354
|
--shadow-edge: inset 0 1px 0 rgb(255 255 255 / 0.04);
|
|
337
355
|
--shadow-focus: 0 0 0 3px rgb(124 134 255 / 0.25);
|
|
338
356
|
--shadow-float: 0 24px 48px -12px rgb(0 0 0 / 0.7);
|
|
339
357
|
--shadow-dialog: 0 30px 80px -20px rgb(0 0 0 / 0.9);
|
|
358
|
+
--shadow-popover: 0 28px 60px -20px rgb(0 0 0 / 0.95);
|
|
340
359
|
|
|
341
360
|
/* --- motion ---------------------------------------------------------------------------- */
|
|
342
361
|
|
|
@@ -370,6 +389,92 @@
|
|
|
370
389
|
* the dashes go by `animation-direction`.
|
|
371
390
|
*/
|
|
372
391
|
--animate-energy-flow: energy-flow 1.6s linear infinite;
|
|
392
|
+
|
|
393
|
+
/*
|
|
394
|
+
* Nebula Home restarting or updating itself (boards N-Restart, N-Update, N-Transition-Flow): the
|
|
395
|
+
* ring turns slowly and unevenly while the core breathes out of phase, rings ripple out from the
|
|
396
|
+
* mark, its glow swells, a bar sweeps or shimmers, and the screen arrives out of a blur.
|
|
397
|
+
*/
|
|
398
|
+
--animate-orbit-work: orbit 2.4s cubic-bezier(0.55, 0.1, 0.35, 0.9) infinite;
|
|
399
|
+
--animate-breathe: breathe 2.4s ease-in-out infinite;
|
|
400
|
+
--animate-ripple: ripple 2.4s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
|
|
401
|
+
--animate-glow: glow 3.6s ease-in-out infinite;
|
|
402
|
+
--animate-sweep: sweep 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
|
403
|
+
--animate-shimmer: shimmer 2s linear infinite;
|
|
404
|
+
--animate-enter: enter 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
|
|
405
|
+
--animate-arrive: arrive 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/* The core of the mark breathing while Nebula Home works on itself. */
|
|
409
|
+
@keyframes breathe {
|
|
410
|
+
0%,
|
|
411
|
+
100% {
|
|
412
|
+
transform: scale(1);
|
|
413
|
+
opacity: 1;
|
|
414
|
+
}
|
|
415
|
+
50% {
|
|
416
|
+
transform: scale(0.86);
|
|
417
|
+
opacity: 0.75;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/* A ring leaving the mark and fading as it widens. */
|
|
422
|
+
@keyframes ripple {
|
|
423
|
+
from {
|
|
424
|
+
transform: scale(0.55);
|
|
425
|
+
opacity: 0.55;
|
|
426
|
+
}
|
|
427
|
+
to {
|
|
428
|
+
transform: scale(1.9);
|
|
429
|
+
opacity: 0;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
@keyframes glow {
|
|
434
|
+
0%,
|
|
435
|
+
100% {
|
|
436
|
+
opacity: 0.45;
|
|
437
|
+
}
|
|
438
|
+
50% {
|
|
439
|
+
opacity: 0.8;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/* A bar that cannot say how far it is: a highlight crossing it again and again. */
|
|
444
|
+
@keyframes sweep {
|
|
445
|
+
from {
|
|
446
|
+
left: -40%;
|
|
447
|
+
}
|
|
448
|
+
to {
|
|
449
|
+
left: 100%;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/* A light passing along a bar that is moving. */
|
|
454
|
+
@keyframes shimmer {
|
|
455
|
+
from {
|
|
456
|
+
background-position: -200% 0;
|
|
457
|
+
}
|
|
458
|
+
to {
|
|
459
|
+
background-position: 200% 0;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/* A screen arriving out of a blur, a little small. */
|
|
464
|
+
@keyframes enter {
|
|
465
|
+
from {
|
|
466
|
+
opacity: 0;
|
|
467
|
+
transform: scale(0.96);
|
|
468
|
+
filter: blur(10px);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/* A note rising into place. */
|
|
473
|
+
@keyframes arrive {
|
|
474
|
+
from {
|
|
475
|
+
opacity: 0;
|
|
476
|
+
transform: translateY(10px);
|
|
477
|
+
}
|
|
373
478
|
}
|
|
374
479
|
|
|
375
480
|
/* One period of a wire's dash pattern, which is 12 units long: 2 drawn, 10 gap. */
|
|
@@ -552,6 +657,47 @@
|
|
|
552
657
|
* The Matter mark's square, lit violet from its top-left corner: the broker's hero and its
|
|
553
658
|
* dialogs' lead. Over the square's own ground, so it sits on `bg-surface-raised`.
|
|
554
659
|
*/
|
|
660
|
+
@utility modbus-glow {
|
|
661
|
+
background-image: radial-gradient(
|
|
662
|
+
120% 120% at 0% 0%,
|
|
663
|
+
color-mix(in srgb, var(--color-cyan) 18%, transparent),
|
|
664
|
+
transparent 60%
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/* The newer brokers' squares, each lit in its own mark's colour the same way. */
|
|
669
|
+
@utility thread-glow {
|
|
670
|
+
background-image: radial-gradient(
|
|
671
|
+
120% 120% at 0% 0%,
|
|
672
|
+
color-mix(in srgb, var(--color-thread) 20%, transparent),
|
|
673
|
+
transparent 60%
|
|
674
|
+
);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
@utility bluetooth-glow {
|
|
678
|
+
background-image: radial-gradient(
|
|
679
|
+
120% 120% at 0% 0%,
|
|
680
|
+
color-mix(in srgb, #5b9dff 20%, transparent),
|
|
681
|
+
transparent 60%
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
@utility serial-glow {
|
|
686
|
+
background-image: radial-gradient(
|
|
687
|
+
120% 120% at 0% 0%,
|
|
688
|
+
color-mix(in srgb, #f0c27b 18%, transparent),
|
|
689
|
+
transparent 60%
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
@utility infrared-glow {
|
|
694
|
+
background-image: radial-gradient(
|
|
695
|
+
120% 120% at 0% 0%,
|
|
696
|
+
color-mix(in srgb, #f7895c 18%, transparent),
|
|
697
|
+
transparent 60%
|
|
698
|
+
);
|
|
699
|
+
}
|
|
700
|
+
|
|
555
701
|
@utility matter-glow {
|
|
556
702
|
background-image: radial-gradient(
|
|
557
703
|
120% 120% at 0% 0%,
|
package/dist/ui.d.ts
CHANGED
|
@@ -90,6 +90,27 @@ type AreaView = {
|
|
|
90
90
|
readonly latitude: number | null;
|
|
91
91
|
readonly longitude: number | null;
|
|
92
92
|
};
|
|
93
|
+
/** A floor or a room to add to the house. Since 1.3. */
|
|
94
|
+
type AreaDraft = {
|
|
95
|
+
readonly kind: 'floor' | 'room';
|
|
96
|
+
readonly name: string;
|
|
97
|
+
/** The house a floor is in, the floor a room is on. */
|
|
98
|
+
readonly parentKey: string;
|
|
99
|
+
/** A floor's storey: 0 the ground floor, -1 the one below. */
|
|
100
|
+
readonly level?: number;
|
|
101
|
+
};
|
|
102
|
+
/** Changes to the house's areas, with the viewer's permissions. Since 1.3. */
|
|
103
|
+
type AreaActions = {
|
|
104
|
+
/** Whether the viewer may change the areas (`area:write`). */
|
|
105
|
+
readonly canEdit: boolean;
|
|
106
|
+
/** Adds a floor or a room; its key comes from its name. */
|
|
107
|
+
readonly create: (draft: AreaDraft) => Promise<AreaView>;
|
|
108
|
+
readonly rename: (key: string, name: string) => Promise<void>;
|
|
109
|
+
/** Moves a floor to another storey. */
|
|
110
|
+
readonly setLevel: (key: string, level: number) => Promise<void>;
|
|
111
|
+
/** Removes an area and everything under it. */
|
|
112
|
+
readonly remove: (key: string) => Promise<void>;
|
|
113
|
+
};
|
|
93
114
|
/** How a picture is fetched. */
|
|
94
115
|
type PictureOptions = {
|
|
95
116
|
/** A camera's still is fetched again this often; 15 seconds when not said, at least 2. */
|
|
@@ -273,6 +294,36 @@ type PackageLinkProps = LinkAttributes & {
|
|
|
273
294
|
type PlatformLinkProps = LinkAttributes & {
|
|
274
295
|
readonly to: PlatformTarget;
|
|
275
296
|
};
|
|
297
|
+
/** What the header of the package's page shows. Since 1.3. */
|
|
298
|
+
type PageActionsProps = {
|
|
299
|
+
readonly children?: ReactNode;
|
|
300
|
+
};
|
|
301
|
+
/** What a toast says. Since 1.4. */
|
|
302
|
+
type ToastMessage = {
|
|
303
|
+
/** A few words, no full stop. */
|
|
304
|
+
readonly title: string;
|
|
305
|
+
/** One or two lines. */
|
|
306
|
+
readonly message?: string;
|
|
307
|
+
/** The one thing to do about it; doing it closes the toast. */
|
|
308
|
+
readonly action?: {
|
|
309
|
+
readonly label: string;
|
|
310
|
+
readonly onSelect: () => void;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
/**
|
|
314
|
+
* Shows one of the interface's toasts, one function per kind: bottom right, three at a time, the
|
|
315
|
+
* rest waiting their turn; the same toast twice is shown once. Since 1.4.
|
|
316
|
+
*/
|
|
317
|
+
type Toasts = {
|
|
318
|
+
/** Confirms what was just done; stays 4 s. */
|
|
319
|
+
readonly success: (message: ToastMessage) => void;
|
|
320
|
+
/** Something that needs a look, not right now; stays 8 s. */
|
|
321
|
+
readonly warning: (message: ToastMessage) => void;
|
|
322
|
+
/** Something that failed; stays 10 s. */
|
|
323
|
+
readonly error: (message: ToastMessage) => void;
|
|
324
|
+
/** Something that started or changed; stays 6 s. */
|
|
325
|
+
readonly info: (message: ToastMessage) => void;
|
|
326
|
+
};
|
|
276
327
|
/** What the interface lends to implement `/ui`. */
|
|
277
328
|
type UiHost = {
|
|
278
329
|
readonly usePackage: () => PackageInfo;
|
|
@@ -303,6 +354,12 @@ type UiHost = {
|
|
|
303
354
|
readonly usePlatformNavigate: () => PlatformNavigate;
|
|
304
355
|
readonly PackageLink: ComponentType<PackageLinkProps>;
|
|
305
356
|
readonly PlatformLink: ComponentType<PlatformLinkProps>;
|
|
357
|
+
/** Since 1.3. */
|
|
358
|
+
readonly PageActions: ComponentType<PageActionsProps>;
|
|
359
|
+
/** Since 1.3. */
|
|
360
|
+
readonly useAreaActions: () => AreaActions;
|
|
361
|
+
/** Since 1.4. */
|
|
362
|
+
readonly useToast: () => Toasts;
|
|
306
363
|
};
|
|
307
364
|
//#endregion
|
|
308
365
|
//#region src/ui/index.d.ts
|
|
@@ -418,6 +475,20 @@ export declare function useTelemetry(query: TelemetryQuery): Telemetry;
|
|
|
418
475
|
* @returns Them, in the owner's order.
|
|
419
476
|
*/
|
|
420
477
|
export declare function useAreas(): readonly AreaView[];
|
|
478
|
+
/**
|
|
479
|
+
* Adds, renames and removes the house's floors and rooms, as the platform's areas page does, with
|
|
480
|
+
* the viewer's permissions: `canEdit` says whether they hold them. Since 1.3.
|
|
481
|
+
*
|
|
482
|
+
* @returns What changes the areas.
|
|
483
|
+
*/
|
|
484
|
+
export declare function useAreaActions(): AreaActions;
|
|
485
|
+
/**
|
|
486
|
+
* Shows the interface's toasts: the outcome of something the viewer just did - "Saved", "Couldn't
|
|
487
|
+
* reach the printer" - from a handler, a mutation's `onError`, wherever. Since 1.4.
|
|
488
|
+
*
|
|
489
|
+
* @returns One function per kind: `success`, `warning`, `error`, `info`.
|
|
490
|
+
*/
|
|
491
|
+
export declare function useToast(): Toasts;
|
|
421
492
|
/**
|
|
422
493
|
* A camera's latest still, fetched again every so often, or an image entity's picture, fetched
|
|
423
494
|
* again when it changes: an address an `<img>` shows, let go of when a newer one replaces it.
|
|
@@ -471,5 +542,13 @@ export declare function PackageLink(props: PackageLinkProps): ReactElement;
|
|
|
471
542
|
* @returns The link.
|
|
472
543
|
*/
|
|
473
544
|
export declare function PlatformLink(props: PlatformLinkProps): ReactElement;
|
|
545
|
+
/**
|
|
546
|
+
* Buttons and links drawn in the header of the package's page, in place of the platform's own:
|
|
547
|
+
* the page's actions, beside its title. On a card or a view it draws nothing. Since 1.3.
|
|
548
|
+
*
|
|
549
|
+
* @param props - What the header shows.
|
|
550
|
+
* @returns The actions.
|
|
551
|
+
*/
|
|
552
|
+
export declare function PageActions(props: PageActionsProps): ReactElement;
|
|
474
553
|
//#endregion
|
|
475
|
-
export type { AreaKind, AreaView, CardProps, ChangeCause, CustomEntityState, EntitiesFilter, EntityPicture, EntityView, EntityViewProps, History, HistoryQuery, HistorySeries, HistoryWindow, Locale, Mutation, MutationOptions, PackageCall, PackageInfo, PackageLinkProps, PackageNavigate, PackageRoute, PackageSettings, PageProps, PictureOptions, PlatformLinkProps, PlatformNavigate, PlatformTarget, PluralEnglish, RpcOptions, RpcState, SendCommand, SettingsPatch, StateHistoryPoint, Telemetry, TelemetryPoint, TelemetryQuery, TelemetryResolution, Theme, Translate, Translation, TranslationValues, UiHost, Viewer, VisibleSettings };
|
|
554
|
+
export type { AreaActions, AreaDraft, AreaKind, AreaView, CardProps, ChangeCause, CustomEntityState, EntitiesFilter, EntityPicture, EntityView, EntityViewProps, History, HistoryQuery, HistorySeries, HistoryWindow, Locale, Mutation, MutationOptions, PackageCall, PackageInfo, PackageLinkProps, PackageNavigate, PackageRoute, PackageSettings, PageActionsProps, PageProps, PictureOptions, PlatformLinkProps, PlatformNavigate, PlatformTarget, PluralEnglish, RpcOptions, RpcState, SendCommand, SettingsPatch, StateHistoryPoint, Telemetry, TelemetryPoint, TelemetryQuery, TelemetryResolution, Theme, ToastMessage, Toasts, Translate, Translation, TranslationValues, UiHost, Viewer, VisibleSettings };
|
package/dist/ui.js
CHANGED
|
@@ -203,6 +203,24 @@ function useAreas() {
|
|
|
203
203
|
return ui("useAreas", "1.2")();
|
|
204
204
|
}
|
|
205
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
|
+
* Shows the interface's toasts: the outcome of something the viewer just did - "Saved", "Couldn't
|
|
216
|
+
* reach the printer" - from a handler, a mutation's `onError`, wherever. Since 1.4.
|
|
217
|
+
*
|
|
218
|
+
* @returns One function per kind: `success`, `warning`, `error`, `info`.
|
|
219
|
+
*/
|
|
220
|
+
function useToast() {
|
|
221
|
+
return ui("useToast", "1.4")();
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
206
224
|
* A camera's latest still, fetched again every so often, or an image entity's picture, fetched
|
|
207
225
|
* again when it changes: an address an `<img>` shows, let go of when a newer one replaces it.
|
|
208
226
|
*
|
|
@@ -271,5 +289,15 @@ function PackageLink(props) {
|
|
|
271
289
|
function PlatformLink(props) {
|
|
272
290
|
return createElement(ui("PlatformLink", "1.0"), props);
|
|
273
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* Buttons and links drawn in the header of the package's page, in place of the platform's own:
|
|
294
|
+
* the page's actions, beside its title. On a card or a view it draws nothing. Since 1.3.
|
|
295
|
+
*
|
|
296
|
+
* @param props - What the header shows.
|
|
297
|
+
* @returns The actions.
|
|
298
|
+
*/
|
|
299
|
+
function PageActions(props) {
|
|
300
|
+
return createElement(ui("PageActions", "1.3"), props);
|
|
301
|
+
}
|
|
274
302
|
//#endregion
|
|
275
|
-
export { PackageLink, PlatformLink, useAreas, useCommand, useCustomEntity, useEntities, useEntity, useEntityPicture, useLocale, usePackage, usePackageCall, usePackageMutation, usePackageNavigate, usePackageRoute, usePackageRpc, usePackageSettings, usePlatformNavigate, usePortalContainer, useStateHistory, useTelemetry, useTheme, useTranslation, useViewer };
|
|
303
|
+
export { PackageLink, PageActions, PlatformLink, useAreaActions, useAreas, useCommand, useCustomEntity, useEntities, useEntity, useEntityPicture, useLocale, usePackage, usePackageCall, usePackageMutation, usePackageNavigate, usePackageRoute, usePackageRpc, usePackageSettings, usePlatformNavigate, usePortalContainer, useStateHistory, useTelemetry, useTheme, useToast, useTranslation, useViewer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebulahome/package-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.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",
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"vitest": "^4.1.11",
|
|
101
101
|
"yaml": "^2.9.0",
|
|
102
102
|
"zod": "^4.5.4",
|
|
103
|
-
"@nebulahome/
|
|
104
|
-
"@nebulahome/
|
|
105
|
-
"@nebulahome/
|
|
106
|
-
"@nebulahome/
|
|
103
|
+
"@nebulahome/contracts": "2026.10.0-alpha.23",
|
|
104
|
+
"@nebulahome/tsconfig": "2026.10.0-alpha.23",
|
|
105
|
+
"@nebulahome/eslint-config": "2026.10.0-alpha.23",
|
|
106
|
+
"@nebulahome/ui": "2026.10.0-alpha.23"
|
|
107
107
|
},
|
|
108
108
|
"scripts": {
|
|
109
109
|
"build": "tsdown && node scripts/build-styles.js",
|