@devicechain/widgets 0.23.0 → 0.24.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.
Files changed (97) hide show
  1. package/README.md +8 -3
  2. package/dist/aggregate-fold.d.ts +3 -2
  3. package/dist/aggregate-strings.d.ts +1 -0
  4. package/dist/alarm-strings.d.ts +18 -0
  5. package/dist/binding-policy.d.ts +4 -0
  6. package/dist/bound-devices-notice.d.ts +30 -0
  7. package/dist/builtin-descriptors.d.ts +290 -249
  8. package/dist/builtin-option-docs.d.ts +2 -0
  9. package/dist/builtin-registry.d.ts +249 -226
  10. package/dist/category-geometry.d.ts +1 -0
  11. package/dist/chunks/{aggregate-feed-BD3CHNFU.js → aggregate-feed-4FSBQYJL.js} +39 -11
  12. package/dist/chunks/aggregate-feed-4FSBQYJL.js.map +7 -0
  13. package/dist/chunks/{aggregate-widgets-HZQI5HTX.js → aggregate-widgets-2ZQBW3YF.js} +376 -182
  14. package/dist/chunks/aggregate-widgets-2ZQBW3YF.js.map +7 -0
  15. package/dist/chunks/alarm-widgets-X4PX5MYJ.js +72 -0
  16. package/dist/chunks/alarm-widgets-X4PX5MYJ.js.map +7 -0
  17. package/dist/chunks/chunk-546TK2QG.js +722 -0
  18. package/dist/chunks/chunk-546TK2QG.js.map +7 -0
  19. package/dist/chunks/{chunk-WBKHYZU2.js → chunk-62CHYCHI.js} +6 -62
  20. package/dist/chunks/chunk-62CHYCHI.js.map +7 -0
  21. package/dist/chunks/chunk-BMFQOTYG.js +41 -0
  22. package/dist/chunks/chunk-BMFQOTYG.js.map +7 -0
  23. package/dist/chunks/{chunk-2D7JNKFE.js → chunk-JFH4QMLA.js} +28 -4
  24. package/dist/chunks/chunk-JFH4QMLA.js.map +7 -0
  25. package/dist/chunks/chunk-QMGKB6J3.js +84 -0
  26. package/dist/chunks/chunk-QMGKB6J3.js.map +7 -0
  27. package/dist/chunks/chunk-XNEBAY4J.js +19 -0
  28. package/dist/chunks/chunk-XNEBAY4J.js.map +7 -0
  29. package/dist/chunks/chunk-YYJV54BV.js +58 -0
  30. package/dist/chunks/chunk-YYJV54BV.js.map +7 -0
  31. package/dist/chunks/compare-feed-AY3CVKUZ.js +346 -0
  32. package/dist/chunks/compare-feed-AY3CVKUZ.js.map +7 -0
  33. package/dist/chunks/{control-widgets-3V2LSSRF.js → control-widgets-UCTJJJ2D.js} +267 -78
  34. package/dist/chunks/control-widgets-UCTJJJ2D.js.map +7 -0
  35. package/dist/chunks/event-markers-feed-GEGTIHXT.js +373 -0
  36. package/dist/chunks/event-markers-feed-GEGTIHXT.js.map +7 -0
  37. package/dist/chunks/{fleet-feed-5QGDLOV5.js → fleet-feed-2SKDR6ZQ.js} +47 -8
  38. package/dist/chunks/fleet-feed-2SKDR6ZQ.js.map +7 -0
  39. package/dist/chunks/presence-widgets-2LIUKN4Y.js +350 -0
  40. package/dist/chunks/presence-widgets-2LIUKN4Y.js.map +7 -0
  41. package/dist/command-control-strings.d.ts +5 -0
  42. package/dist/compare-feed.d.ts +13 -0
  43. package/dist/compare-model.d.ts +38 -0
  44. package/dist/compare-strings.d.ts +13 -0
  45. package/dist/documented-descriptors.d.ts +4826 -0
  46. package/dist/event-markers-feed.d.ts +11 -0
  47. package/dist/event-markers-model.d.ts +38 -0
  48. package/dist/event-markers-strings.d.ts +20 -0
  49. package/dist/event-markers-types.d.ts +7 -0
  50. package/dist/fleet-count-model.d.ts +13 -0
  51. package/dist/fleet-feed.d.ts +1 -0
  52. package/dist/fleet-model.d.ts +1 -0
  53. package/dist/fleet-strings.d.ts +11 -0
  54. package/dist/index.d.ts +6 -3
  55. package/dist/index.js +946 -398
  56. package/dist/index.js.map +4 -4
  57. package/dist/presence-feed.d.ts +24 -0
  58. package/dist/presence-model.d.ts +13 -0
  59. package/dist/presence-strings.d.ts +19 -0
  60. package/dist/sparkline.d.ts +23 -0
  61. package/dist/use-bound-devices.d.ts +26 -0
  62. package/dist/widgets/aggregate-lazy.d.ts +81 -46
  63. package/dist/widgets/aggregate-widgets.d.ts +1 -0
  64. package/dist/widgets/alarm-grouped.d.ts +17 -0
  65. package/dist/widgets/alarm-lazy.d.ts +63 -16
  66. package/dist/widgets/alarm-severity.d.ts +8 -0
  67. package/dist/widgets/alarm-table.d.ts +2 -0
  68. package/dist/widgets/alarm-type-tabs.d.ts +10 -0
  69. package/dist/widgets/alarm-widgets.d.ts +2 -0
  70. package/dist/widgets/command-stepper.d.ts +22 -0
  71. package/dist/widgets/control-lazy.d.ts +16 -24
  72. package/dist/widgets/device-status.d.ts +4 -0
  73. package/dist/widgets/fleet-count.d.ts +2 -0
  74. package/dist/widgets/gauge.d.ts +2 -15
  75. package/dist/widgets/image.d.ts +2 -6
  76. package/dist/widgets/label.d.ts +2 -6
  77. package/dist/widgets/latest-card.d.ts +2 -13
  78. package/dist/widgets/lazy-chunk.d.ts +7 -2
  79. package/dist/widgets/level-lazy.d.ts +14 -96
  80. package/dist/widgets/map.d.ts +8 -5
  81. package/dist/widgets/online-doughnut.d.ts +2 -0
  82. package/dist/widgets/presence-lazy.d.ts +27 -0
  83. package/dist/widgets/presence-widgets.d.ts +3 -0
  84. package/dist/widgets/selection-lazy.d.ts +2 -4
  85. package/dist/widgets/table-lazy.d.ts +2 -7
  86. package/dist/widgets/time-series-chart.d.ts +62 -12
  87. package/package.json +13 -13
  88. package/dist/chunks/aggregate-feed-BD3CHNFU.js.map +0 -7
  89. package/dist/chunks/aggregate-widgets-HZQI5HTX.js.map +0 -7
  90. package/dist/chunks/alarm-widgets-7UY6MIYZ.js +0 -9
  91. package/dist/chunks/alarm-widgets-7UY6MIYZ.js.map +0 -7
  92. package/dist/chunks/chunk-2D7JNKFE.js.map +0 -7
  93. package/dist/chunks/chunk-6OGI4UFJ.js +0 -367
  94. package/dist/chunks/chunk-6OGI4UFJ.js.map +0 -7
  95. package/dist/chunks/chunk-WBKHYZU2.js.map +0 -7
  96. package/dist/chunks/control-widgets-3V2LSSRF.js.map +0 -7
  97. package/dist/chunks/fleet-feed-5QGDLOV5.js.map +0 -7
package/README.md CHANGED
@@ -65,19 +65,24 @@ bound to a slot needs its datasource resolved first (`resolveWidgets` or
65
65
 
66
66
  | channel | widgets |
67
67
  | --- | --- |
68
- | measurement | `timeseries-chart`, `latest-card`, `gauge`, `linear-gauge`, `level-gauge`, `battery`, `status-light`, `signal-bars`, `compass`, `progress-ring`, `table`, `bar-chart`, `pie-chart`, `fleet-table` |
68
+ | measurement | `timeseries-chart`, `latest-card`, `gauge`, `linear-gauge`, `level-gauge`, `battery`, `status-light`, `signal-bars`, `compass`, `progress-ring`, `table`, `bar-chart`, `pie-chart`, `fleet-table`, `fleet-count`, `device-status`, `online-doughnut` |
69
69
  | aggregate | `stat-card` |
70
70
  | none (static) | `label`, `image` |
71
- | alarm | `alarm-table`, `alarm-count` |
71
+ | alarm | `alarm-table`, `alarm-count`, `alarm-severity` |
72
72
  | control | `command-button`, `command-slider`, `command-toggle` |
73
73
  | selection | `entity-selector` |
74
74
  | location | `map` |
75
75
 
76
- `fleet-table`, and `bar-chart` in its one-bar-per-device mode, read a device
76
+ `fleet-table`, `fleet-count`, and `bar-chart` in its one-bar-per-device mode, read a device
77
77
  group member by member. The other measurement widgets, and `stat-card`, show one
78
78
  device and refuse a group. `stat-card` shows one figure (average, minimum, maximum, sum, count or
79
79
  latest) over the board's time range.
80
80
 
81
+ `device-status` and `online-doughnut` read the devices' connectivity (online or offline, and when
82
+ each was last active) from device-state, not their readings. They ride the measurement channel's
83
+ member feed (`data.members[].presence`), so the channel set is unchanged. `device-status` shows one
84
+ device; `online-doughnut` takes a group.
85
+
81
86
  The time-series chart, the dial gauge and the compass are drawn with
82
87
  [Apache ECharts](https://echarts.apache.org); the other widgets are plain DOM
83
88
  and SVG. The map is [MapLibre GL](https://maplibre.org), loaded lazily so a board
@@ -1,11 +1,12 @@
1
- import { type HistoryWindow, type MeasurementAggregate, type MeasurementBucket } from '@devicechain/dashboards';
1
+ import { type AggregateTrendPoint, type HistoryWindow, type MeasurementAggregate, type MeasurementBucket } from '@devicechain/dashboards';
2
2
  export declare class AggregateFieldsError extends Error {
3
3
  constructor(message: string);
4
4
  }
5
5
  export declare function aggregateBuckets(buckets: readonly MeasurementBucket[]): Record<string, MeasurementAggregate>;
6
+ export declare function aggregateSeries(buckets: readonly MeasurementBucket[]): Record<string, AggregateTrendPoint[]>;
6
7
  export declare function aggregateRefreshMs(spanSeconds: number): number;
7
8
  export interface AggregateWindow {
8
9
  window: HistoryWindow;
9
10
  spanSeconds: number;
10
11
  }
11
- export declare function aggregateWindow(spanSeconds: number, at: number): AggregateWindow;
12
+ export declare function aggregateWindow(spanSeconds: number, at: number, bucketSeconds?: number): AggregateWindow;
@@ -8,6 +8,7 @@ export interface AggregateStrings {
8
8
  noReadings: (span: string) => string;
9
9
  noData: string;
10
10
  unbound: string;
11
+ trend: (stat: string, span: string) => string;
11
12
  noCategories: string;
12
13
  pieNegative: string;
13
14
  pieNoShare: string;
@@ -0,0 +1,18 @@
1
+ export interface AlarmStrings {
2
+ tabsLabel: string;
3
+ all: string;
4
+ deviceType: string;
5
+ activeBadge: (count: number, worst: string) => string;
6
+ severity: Record<string, string>;
7
+ breakdown: {
8
+ label: string;
9
+ total: (count: number) => string;
10
+ ofType: (count: number, deviceType: string) => string;
11
+ item: (severity: string, count: number) => string;
12
+ loading: string;
13
+ unsupported: string;
14
+ failed: string;
15
+ };
16
+ }
17
+ export declare const ALARM_STRINGS: Record<'en' | 'es', AlarmStrings>;
18
+ export declare function alarmStrings(locale?: string | undefined): AlarmStrings;
@@ -2,5 +2,9 @@ import { type AlarmSubscription, type CommandSubscription, type WidgetDescriptor
2
2
  export declare function measurementWindow(descriptor: WidgetDescriptor, widget: WidgetInstance): number | undefined;
3
3
  export declare function measurementSpan(descriptor: WidgetDescriptor, widget: WidgetInstance, boardSpan: number | undefined): number | undefined;
4
4
  export declare function membersMode(descriptor: WidgetDescriptor, widget: WidgetInstance): boolean;
5
+ export declare function measurementIsMembersOnly(descriptor: WidgetDescriptor): boolean;
6
+ export declare function presenceMode(descriptor: WidgetDescriptor): boolean;
5
7
  export declare function alarmSubscription(descriptor: WidgetDescriptor, widget: WidgetInstance): AlarmSubscription;
8
+ export declare function groupsAlarmsByDeviceType(descriptor: WidgetDescriptor, widget: WidgetInstance): boolean;
6
9
  export declare function commandSubscription(descriptor: WidgetDescriptor, widget: WidgetInstance): CommandSubscription;
10
+ export declare function wantsEventMarkers(descriptor: WidgetDescriptor, widget: WidgetInstance): boolean;
@@ -0,0 +1,30 @@
1
+ import type { BindParamIssue } from '@devicechain/dashboards';
2
+ export interface BoundDevicesNoticeProps {
3
+ title: string;
4
+ lines: string[];
5
+ dismissLabel: string;
6
+ onDismiss: () => void;
7
+ retryLabel?: string;
8
+ onRetry?: () => void;
9
+ }
10
+ export declare function BoundDevicesNotice({ title, lines, dismissLabel, onDismiss, retryLabel, onRetry }: BoundDevicesNoticeProps): import("react").JSX.Element;
11
+ export interface BoundDevicesWording {
12
+ unknownSlot: (slot: string) => string;
13
+ notADeviceSlot: (slot: string) => string;
14
+ invalidToken: (slot: string, token: string) => string;
15
+ duplicateSlot: (slot: string) => string;
16
+ derivedSlot: (slot: string) => string;
17
+ missing: (slot: string, token: string) => string;
18
+ failed: (slot: string, token: string) => string;
19
+ }
20
+ export declare function describeBoundDevicesProblems(problems: {
21
+ issues: BindParamIssue[];
22
+ missing: Array<{
23
+ slot: string;
24
+ token: string;
25
+ }>;
26
+ failed: Array<{
27
+ slot: string;
28
+ token: string;
29
+ }>;
30
+ }, w: BoundDevicesWording): string[];